Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
BornAgain
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mlz
BornAgain
Commits
ad0e756d
Commit
ad0e756d
authored
2 years ago
by
Wuttke, Joachim
Browse files
Options
Downloads
Patches
Plain Diff
InstrumentItem: move m_beamItem to subclasses
parent
2f83da94
No related branches found
No related tags found
1 merge request
!1434
InstrumentItems::beamItem() relegated to GISASInstrumentItems; otherwise provide and use scanItem()
Pipeline
#91491
passed
2 years ago
Stage: build
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
GUI/Model/Device/InstrumentItems.cpp
+30
-14
30 additions, 14 deletions
GUI/Model/Device/InstrumentItems.cpp
GUI/Model/Device/InstrumentItems.h
+10
-1
10 additions, 1 deletion
GUI/Model/Device/InstrumentItems.h
with
40 additions
and
15 deletions
GUI/Model/Device/InstrumentItems.cpp
+
30
−
14
View file @
ad0e756d
...
...
@@ -120,8 +120,6 @@ void InstrumentItem::setWithPolarizerAnalyzer(bool with)
void
InstrumentItem
::
writeTo
(
QXmlStreamWriter
*
w
)
const
{
ASSERT
(
m_beamItem
);
XML
::
writeAttribute
(
w
,
XML
::
Attrib
::
version
,
uint
(
1
));
// id
...
...
@@ -169,11 +167,6 @@ void InstrumentItem::writeTo(QXmlStreamWriter* w) const
m_background
.
writeTo
(
w
);
w
->
writeEndElement
();
// beam
w
->
writeStartElement
(
Tag
::
Beam
);
m_beamItem
->
writeTo
(
w
);
w
->
writeEndElement
();
// info groupbox: is expanded?
w
->
writeStartElement
(
Tag
::
ExpandInfoGroupbox
);
XML
::
writeAttribute
(
w
,
XML
::
Attrib
::
value
,
m_expandInfo
);
...
...
@@ -197,8 +190,6 @@ void InstrumentItem::writeTo(QXmlStreamWriter* w) const
void
InstrumentItem
::
readFrom
(
QXmlStreamReader
*
r
)
{
ASSERT
(
m_beamItem
);
const
uint
version
=
XML
::
readUIntAttribute
(
r
,
XML
::
Attrib
::
version
);
Q_UNUSED
(
version
)
...
...
@@ -250,11 +241,6 @@ void InstrumentItem::readFrom(QXmlStreamReader* r)
m_background
.
readFrom
(
r
);
XML
::
gotoEndElementOfTag
(
r
,
tag
);
// beam
}
else
if
(
tag
==
Tag
::
Beam
)
{
m_beamItem
->
readFrom
(
r
);
XML
::
gotoEndElementOfTag
(
r
,
tag
);
// info groupbox: is expanded?
}
else
if
(
tag
==
Tag
::
ExpandInfoGroupbox
)
{
XML
::
readAttribute
(
r
,
XML
::
Attrib
::
value
,
&
m_expandInfo
);
...
...
@@ -437,6 +423,11 @@ void DepthprobeInstrumentItem::writeTo(QXmlStreamWriter* w) const
InstrumentItem
::
writeTo
(
w
);
w
->
writeEndElement
();
// beam
w
->
writeStartElement
(
Tag
::
Beam
);
m_beamItem
->
writeTo
(
w
);
w
->
writeEndElement
();
// z axis
w
->
writeStartElement
(
Tag
::
ZAxis
);
m_zAxis
.
writeTo
(
w
);
...
...
@@ -456,6 +447,11 @@ void DepthprobeInstrumentItem::readFrom(QXmlStreamReader* r)
InstrumentItem
::
readFrom
(
r
);
XML
::
gotoEndElementOfTag
(
r
,
tag
);
// scan
}
else
if
(
tag
==
Tag
::
Beam
)
{
m_beamItem
->
readFrom
(
r
);
XML
::
gotoEndElementOfTag
(
r
,
tag
);
// z axis
}
else
if
(
tag
==
Tag
::
ZAxis
)
{
m_zAxis
.
readFrom
(
r
);
...
...
@@ -553,6 +549,11 @@ void OffspecInstrumentItem::writeTo(QXmlStreamWriter* w) const
InstrumentItem
::
writeTo
(
w
);
w
->
writeEndElement
();
// beam
w
->
writeStartElement
(
Tag
::
Beam
);
m_beamItem
->
writeTo
(
w
);
w
->
writeEndElement
();
// alpha axis
w
->
writeStartElement
(
Tag
::
AlphaAxis
);
m_alphaAxis
.
writeTo
(
w
);
...
...
@@ -577,6 +578,11 @@ void OffspecInstrumentItem::readFrom(QXmlStreamReader* r)
InstrumentItem
::
readFrom
(
r
);
XML
::
gotoEndElementOfTag
(
r
,
tag
);
// scan
}
else
if
(
tag
==
Tag
::
Beam
)
{
m_beamItem
->
readFrom
(
r
);
XML
::
gotoEndElementOfTag
(
r
,
tag
);
// alpha axis
}
else
if
(
tag
==
Tag
::
AlphaAxis
)
{
m_alphaAxis
.
readFrom
(
r
);
...
...
@@ -671,6 +677,11 @@ void GISASInstrumentItem::writeTo(QXmlStreamWriter* w) const
InstrumentItem
::
writeTo
(
w
);
w
->
writeEndElement
();
// beam
w
->
writeStartElement
(
Tag
::
Beam
);
m_beamItem
->
writeTo
(
w
);
w
->
writeEndElement
();
// detector
w
->
writeStartElement
(
Tag
::
Detector
);
m_detector
.
writeTo
(
w
);
...
...
@@ -690,6 +701,11 @@ void GISASInstrumentItem::readFrom(QXmlStreamReader* r)
InstrumentItem
::
readFrom
(
r
);
XML
::
gotoEndElementOfTag
(
r
,
tag
);
// beam
}
else
if
(
tag
==
Tag
::
Beam
)
{
m_beamItem
->
readFrom
(
r
);
XML
::
gotoEndElementOfTag
(
r
,
tag
);
// detector
}
else
if
(
tag
==
Tag
::
Detector
)
{
m_detector
.
readFrom
(
r
);
...
...
This diff is collapsed.
Click to expand it.
GUI/Model/Device/InstrumentItems.h
+
10
−
1
View file @
ad0e756d
...
...
@@ -125,7 +125,6 @@ protected:
QString
m_description
;
bool
m_withPolarizerAnalyzer
;
SelectionProperty
<
BackgroundItemCatalog
>
m_background
;
std
::
unique_ptr
<
BeamItem
>
m_beamItem
;
VectorProperty
m_polarization
;
VectorProperty
m_analyzerDirection
;
...
...
@@ -153,6 +152,9 @@ public:
const
ICoordSystem
*
createCoordSystem
()
const
override
;
ISimulation
*
createSimulation
(
const
MultiLayer
&
sample
)
const
override
;
private:
std
::
unique_ptr
<
ScanItem
>
m_beamItem
;
};
...
...
@@ -183,6 +185,9 @@ protected:
mutable
std
::
unique_ptr
<
const
ICoordSystem
>
m_coosys
;
AxisProperty
m_zAxis
;
bool
m_expandParameters
=
true
;
private
:
std
::
unique_ptr
<
ScanItem
>
m_beamItem
;
};
...
...
@@ -215,6 +220,9 @@ protected:
AxisProperty
m_alphaAxis
;
bool
m_expandBeamParameters
=
true
;
std
::
unique_ptr
<
OffspecDetectorItem
>
m_detector
;
private
:
std
::
unique_ptr
<
ScanItem
>
m_beamItem
;
};
...
...
@@ -245,6 +253,7 @@ public:
private
:
SelectionProperty
<
DetectorItemCatalog
>
m_detector
;
std
::
unique_ptr
<
BeamItem
>
m_beamItem
;
};
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment