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
9f0936e1
Commit
9f0936e1
authored
3 years ago
by
Matthias Puchner
Browse files
Options
Downloads
Patches
Plain Diff
complete FTDecayFunctions' serialization
parent
3be0d1de
No related branches found
No related tags found
1 merge request
!573
Sample item serialization
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
GUI/Model/Sample/FTDecayFunctionItems.cpp
+31
-0
31 additions, 0 deletions
GUI/Model/Sample/FTDecayFunctionItems.cpp
GUI/Model/Sample/FTDecayFunctionItems.h
+6
-0
6 additions, 0 deletions
GUI/Model/Sample/FTDecayFunctionItems.h
with
37 additions
and
0 deletions
GUI/Model/Sample/FTDecayFunctionItems.cpp
+
31
−
0
View file @
9f0936e1
...
...
@@ -14,6 +14,7 @@
#include
"GUI/Model/Sample/FTDecayFunctionItems.h"
#include
"Base/Const/Units.h"
#include
"GUI/Model/Session/Serializer.h"
#include
<QList>
// --------------------------------------------------------------------------------------------- //
...
...
@@ -24,6 +25,12 @@ FTDecayFunction1DItem::FTDecayFunction1DItem()
Unit
::
nanometer
,
"decay"
);
}
void
FTDecayFunction1DItem
::
serialize
(
Serializer
&
s
)
{
s
.
assertVersion
(
0
);
s
.
rw
(
m_decayLength
);
}
DoubleDescriptor
FTDecayFunction1DItem
::
decayLength
()
const
{
return
m_decayLength
;
...
...
@@ -68,6 +75,13 @@ std::unique_ptr<IFTDecayFunction1D> FTDecayFunction1DVoigtItem::createFTDecayFun
return
std
::
make_unique
<
FTDecayFunction1DVoigt
>
(
decayLength
(),
m_eta
);
}
void
FTDecayFunction1DVoigtItem
::
serialize
(
Serializer
&
s
)
{
s
.
assertVersion
(
0
);
s
.
rw
(
m_decayLength
);
s
.
rw
(
m_eta
);
}
DoubleDescriptor
FTDecayFunction1DVoigtItem
::
eta
()
const
{
return
m_eta
;
...
...
@@ -94,6 +108,14 @@ FTDecayFunction2DItem::FTDecayFunction2DItem()
Unit
::
degree
,
"gamma"
);
}
void
FTDecayFunction2DItem
::
serialize
(
Serializer
&
s
)
{
s
.
assertVersion
(
0
);
s
.
rw
(
m_decayLengthX
);
s
.
rw
(
m_decayLengthY
);
s
.
rw
(
m_gamma
);
}
DoubleDescriptor
FTDecayFunction2DItem
::
decayLengthX
()
const
{
return
m_decayLengthX
;
...
...
@@ -159,6 +181,15 @@ std::unique_ptr<IFTDecayFunction2D> FTDecayFunction2DVoigtItem::createFTDecayFun
Units
::
deg2rad
(
gamma
()));
}
void
FTDecayFunction2DVoigtItem
::
serialize
(
Serializer
&
s
)
{
s
.
assertVersion
(
0
);
s
.
rw
(
m_decayLengthX
);
s
.
rw
(
m_decayLengthY
);
s
.
rw
(
m_gamma
);
s
.
rw
(
m_eta
);
}
void
FTDecayFunction2DVoigtItem
::
setEta
(
const
double
eta
)
{
m_eta
.
set
(
eta
);
...
...
This diff is collapsed.
Click to expand it.
GUI/Model/Sample/FTDecayFunctionItems.h
+
6
−
0
View file @
9f0936e1
...
...
@@ -21,10 +21,13 @@
#include
"Sample/Correlations/FTDecay2D.h"
#include
<memory>
class
Serializer
;
class
FTDecayFunction1DItem
{
public:
virtual
~
FTDecayFunction1DItem
()
=
default
;
virtual
std
::
unique_ptr
<
IFTDecayFunction1D
>
createFTDecayFunction
()
const
=
0
;
virtual
void
serialize
(
Serializer
&
s
);
DoubleDescriptor
decayLength
()
const
;
virtual
DoubleDescriptors
valueDescriptors
()
const
;
...
...
@@ -53,6 +56,7 @@ class FTDecayFunction1DVoigtItem : public FTDecayFunction1DItem {
public:
FTDecayFunction1DVoigtItem
();
std
::
unique_ptr
<
IFTDecayFunction1D
>
createFTDecayFunction
()
const
override
;
void
serialize
(
Serializer
&
s
)
override
;
DoubleDescriptor
eta
()
const
;
DoubleDescriptors
valueDescriptors
()
const
override
;
...
...
@@ -67,6 +71,7 @@ class FTDecayFunction2DItem {
public:
virtual
~
FTDecayFunction2DItem
()
=
default
;
virtual
std
::
unique_ptr
<
IFTDecayFunction2D
>
createFTDecayFunction
()
const
=
0
;
virtual
void
serialize
(
Serializer
&
s
);
DoubleDescriptor
decayLengthX
()
const
;
void
setDecayLengthX
(
double
decay_length_x
);
...
...
@@ -101,6 +106,7 @@ class FTDecayFunction2DVoigtItem : public FTDecayFunction2DItem {
public:
FTDecayFunction2DVoigtItem
();
std
::
unique_ptr
<
IFTDecayFunction2D
>
createFTDecayFunction
()
const
override
;
void
serialize
(
Serializer
&
s
)
override
;
void
setEta
(
double
eta
);
DoubleDescriptor
eta
()
const
;
...
...
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