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
ecba387f
Commit
ecba387f
authored
2 years ago
by
Wuttke, Joachim
Browse files
Options
Downloads
Patches
Plain Diff
XML w/r at leave level
parent
a0b91609
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!1437
source items: minor cleanup
Pipeline
#91530
passed
2 years ago
Stage: build
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
GUI/Model/Device/BeamItems.cpp
+28
-0
28 additions, 0 deletions
GUI/Model/Device/BeamItems.cpp
GUI/Model/Device/BeamItems.h
+8
-5
8 additions, 5 deletions
GUI/Model/Device/BeamItems.h
with
36 additions
and
5 deletions
GUI/Model/Device/BeamItems.cpp
+
28
−
0
View file @
ecba387f
...
...
@@ -194,6 +194,34 @@ BeamItem::BeamItem()
m_inclinationAngleItem
.
reset
(
new
BeamInclinationAngleItem
);
}
void
BeamItem
::
writeTo
(
QXmlStreamWriter
*
w
)
const
{
XML
::
writeAttribute
(
w
,
XML
::
Attrib
::
version
,
uint
(
1
));
// parameters from base class
w
->
writeStartElement
(
Tag
::
BaseData
);
SourceItem
::
writeTo
(
w
);
w
->
writeEndElement
();
}
void
BeamItem
::
readFrom
(
QXmlStreamReader
*
r
)
{
const
uint
version
=
XML
::
readUIntAttribute
(
r
,
XML
::
Attrib
::
version
);
Q_UNUSED
(
version
)
while
(
r
->
readNextStartElement
())
{
QString
tag
=
r
->
name
().
toString
();
// parameters from base class
if
(
tag
==
Tag
::
BaseData
)
{
SourceItem
::
readFrom
(
r
);
XML
::
gotoEndElementOfTag
(
r
,
tag
);
}
else
r
->
skipCurrentElement
();
}
}
double
BeamItem
::
getInclinationAngle
()
const
{
return
dynamic_cast
<
BeamInclinationAngleItem
*>
(
beamDistributionItem
())
->
inclinationAngle
();
...
...
This diff is collapsed.
Click to expand it.
GUI/Model/Device/BeamItems.h
+
8
−
5
View file @
ecba387f
...
...
@@ -34,9 +34,6 @@ class InstrumentItem;
//! Base class for BeamItem and ScanItem. Name refers to radiation source.
class
SourceItem
{
public:
virtual
void
writeTo
(
QXmlStreamWriter
*
w
)
const
;
virtual
void
readFrom
(
QXmlStreamReader
*
r
);
DoubleProperty
&
intensity
()
{
return
m_intensity
;
}
const
DoubleProperty
&
intensity
()
const
{
return
m_intensity
;
}
void
setIntensity
(
double
v
)
{
m_intensity
.
setValue
(
v
);
}
...
...
@@ -61,6 +58,8 @@ public:
protected
:
SourceItem
();
void
writeTo
(
QXmlStreamWriter
*
w
)
const
;
void
readFrom
(
QXmlStreamReader
*
r
);
std
::
unique_ptr
<
BeamWavelengthItem
>
m_wavelengthItem
;
std
::
unique_ptr
<
BeamAzimuthalAngleItem
>
m_azimuthalAngleItem
;
...
...
@@ -73,6 +72,10 @@ protected:
class
BeamItem
:
public
SourceItem
{
public:
BeamItem
();
void
writeTo
(
QXmlStreamWriter
*
w
)
const
;
void
readFrom
(
QXmlStreamReader
*
r
);
double
getInclinationAngle
()
const
override
;
};
...
...
@@ -80,8 +83,8 @@ class ScanItem : public SourceItem {
public:
explicit
ScanItem
(
const
InstrumentItem
*
owningInstrument
);
void
writeTo
(
QXmlStreamWriter
*
w
)
const
override
;
void
readFrom
(
QXmlStreamReader
*
r
)
override
;
void
writeTo
(
QXmlStreamWriter
*
w
)
const
;
void
readFrom
(
QXmlStreamReader
*
r
);
double
getInclinationAngle
()
const
override
;
void
setInclinationAngle
(
double
value
)
override
;
...
...
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