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
c981fa3a
Commit
c981fa3a
authored
1 year ago
by
Wuttke, Joachim
Browse files
Options
Downloads
Patches
Plain Diff
rm call of unitAsString
parent
7077abe6
No related branches found
No related tags found
1 merge request
!2003
In GUI, remove option to switch beteen nm and angstrom, degrees and radians.
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
GUI/Model/Model/ParameterTreeUtil.cpp
+3
-15
3 additions, 15 deletions
GUI/Model/Model/ParameterTreeUtil.cpp
GUI/Model/Model/ParameterTreeUtil.h
+1
-1
1 addition, 1 deletion
GUI/Model/Model/ParameterTreeUtil.h
with
4 additions
and
16 deletions
GUI/Model/Model/ParameterTreeUtil.cpp
+
3
−
15
View file @
c981fa3a
...
...
@@ -37,17 +37,6 @@ using std::variant;
namespace
{
QString
labelWithUnit
(
const
QString
&
label
,
variant
<
QString
,
Unit
>
unit
)
{
const
QString
s
=
std
::
holds_alternative
<
QString
>
(
unit
)
?
std
::
get
<
QString
>
(
unit
)
:
unitAsString
(
std
::
get
<
Unit
>
(
unit
));
if
(
!
s
.
isEmpty
())
return
label
+
" ("
+
s
+
")"
;
return
label
;
}
template
<
typename
Catalog
>
ParameterLabelItem
*
addLabel
(
ParameterLabelItem
*
parent
,
const
QString
&
category
,
const
typename
Catalog
::
CatalogedType
*
p
)
...
...
@@ -138,10 +127,10 @@ void ParameterTreeBuilder::addSample()
}
void
ParameterTreeBuilder
::
addParameterItem
(
ParameterLabelItem
*
parent
,
DoubleProperty
&
d
,
const
QString
&
label
)
const
QString
&
label
)
{
auto
*
parameterItem
=
new
ParameterItem
(
parent
);
parameterItem
->
setTitle
(
labelWithUnit
(
label
.
isEmpty
()
?
d
.
label
()
:
label
,
d
.
unit
())
);
parameterItem
->
setTitle
(
label
.
isEmpty
()
?
d
.
label
()
:
label
);
parameterItem
->
linkToProperty
(
d
);
if
(
m_recreateBackupValues
)
m_jobItem
->
parameterContainerItem
()
->
setBackupValue
(
parameterItem
->
link
(),
d
.
value
());
...
...
@@ -411,8 +400,7 @@ void ParameterTreeBuilder::addBackground(ParameterLabelItem* instrumentLabel,
BackgroundItem
*
backgroundItem
)
{
if
(
auto
*
b
=
dynamic_cast
<
ConstantBackgroundItem
*>
(
backgroundItem
))
addParameterItem
(
instrumentLabel
,
b
->
backgroundValue
(),
labelWithUnit
(
"Constant background"
,
b
->
backgroundValue
().
unit
()));
addParameterItem
(
instrumentLabel
,
b
->
backgroundValue
());
}
void
ParameterTreeBuilder
::
addPolarization
(
ParameterLabelItem
*
instrumentLabel
,
...
...
This diff is collapsed.
Click to expand it.
GUI/Model/Model/ParameterTreeUtil.h
+
1
−
1
View file @
c981fa3a
...
...
@@ -54,7 +54,7 @@ private:
void
addSample
();
void
addInstrument
();
void
addParameterItem
(
ParameterLabelItem
*
parent
,
DoubleProperty
&
d
,
const
QString
&
label
=
QString
()
);
const
QString
&
label
=
""
);
void
addParameterItem
(
ParameterLabelItem
*
parent
,
VectorProperty
&
d
);
void
addMagnetizationNoZ
(
ParameterLabelItem
*
parent
,
VectorProperty
&
d
);
ParameterContainerItem
*
parameterContainerItem
();
...
...
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