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
b168e31e
"README.md" did not exist on "7450e48b2b843eb08414d72e57bf8f9d727fa640"
Commit
b168e31e
authored
3 years ago
by
Wuttke, Joachim
Browse files
Options
Downloads
Patches
Plain Diff
DoubleDescriptor: sort c'tors
parent
731a188f
No related branches found
No related tags found
1 merge request
!598
Reorganize GUI/Model subdirectories; remove unused includes; mv some fcts
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
GUI/Model/Types/DoubleDescriptor.cpp
+24
-24
24 additions, 24 deletions
GUI/Model/Types/DoubleDescriptor.cpp
GUI/Model/Types/DoubleDescriptor.h
+22
-22
22 additions, 22 deletions
GUI/Model/Types/DoubleDescriptor.h
with
46 additions
and
46 deletions
GUI/Model/Types/DoubleDescriptor.cpp
+
24
−
24
View file @
b168e31e
...
...
@@ -18,30 +18,6 @@
#include
"GUI/Util/Path.h"
#include
<utility>
DoubleDescriptor
::
DoubleDescriptor
(
const
QString
&
label
,
SessionItem
*
item
,
const
variant
<
QString
,
Unit
>&
unit
)
:
DoubleDescriptor
(
label
,
item
->
toolTip
(),
item
->
decimals
(),
item
->
limits
(),
[
=
](
double
d
)
{
item
->
setValue
(
d
);
},
[
=
]()
{
return
item
->
value
().
toDouble
();
},
unit
)
{
path
=
[
=
]
{
ASSERT
(
item
->
model
());
// if assert, item is not completely initialized
return
GUI
::
Util
::
Path
::
getPathFromIndex
(
item
->
model
()
->
indexOfItem
(
item
));
};
}
DoubleDescriptor
::
DoubleDescriptor
(
SessionItem
*
item
,
const
variant
<
QString
,
Unit
>&
unit
)
:
DoubleDescriptor
(
item
->
displayName
(),
item
,
unit
)
{
}
DoubleDescriptor
::
DoubleDescriptor
(
const
QString
&
label
,
const
QString
&
tooltip
,
function
<
void
(
double
)
>
setter
,
function
<
double
()
>
getter
,
const
variant
<
QString
,
Unit
>&
unit
)
:
DoubleDescriptor
(
label
,
tooltip
,
3
,
RealLimits
::
nonnegative
(),
setter
,
getter
,
unit
)
{
}
DoubleDescriptor
::
DoubleDescriptor
(
QString
label_
,
QString
tooltip_
,
int
decimals_
,
const
RealLimits
&
limits_
,
function
<
void
(
double
)
>
setter
,
function
<
double
()
>
getter
,
const
variant
<
QString
,
Unit
>&
unit_
)
...
...
@@ -58,6 +34,13 @@ DoubleDescriptor::DoubleDescriptor(QString label_, QString tooltip_, int decimal
path
=
[]
{
return
QString
();
};
}
DoubleDescriptor
::
DoubleDescriptor
(
const
QString
&
label
,
const
QString
&
tooltip
,
function
<
void
(
double
)
>
setter
,
function
<
double
()
>
getter
,
const
variant
<
QString
,
Unit
>&
unit
)
:
DoubleDescriptor
(
label
,
tooltip
,
3
,
RealLimits
::
nonnegative
(),
setter
,
getter
,
unit
)
{
}
DoubleDescriptor
::
DoubleDescriptor
(
const
QString
&
label
,
const
QString
&
tooltip
,
double
*
var
,
const
variant
<
QString
,
Unit
>&
unit
)
:
DoubleDescriptor
(
label
,
tooltip
,
3
,
RealLimits
::
nonnegative
(),
var
,
unit
)
...
...
@@ -81,6 +64,23 @@ DoubleDescriptor::DoubleDescriptor(const QString& label, const double* var,
{
}
DoubleDescriptor
::
DoubleDescriptor
(
const
QString
&
label
,
SessionItem
*
item
,
const
variant
<
QString
,
Unit
>&
unit
)
:
DoubleDescriptor
(
label
,
item
->
toolTip
(),
item
->
decimals
(),
item
->
limits
(),
[
=
](
double
d
)
{
item
->
setValue
(
d
);
},
[
=
]()
{
return
item
->
value
().
toDouble
();
},
unit
)
{
path
=
[
=
]
{
ASSERT
(
item
->
model
());
// if assert, item is not completely initialized
return
GUI
::
Util
::
Path
::
getPathFromIndex
(
item
->
model
()
->
indexOfItem
(
item
));
};
}
DoubleDescriptor
::
DoubleDescriptor
(
SessionItem
*
item
,
const
variant
<
QString
,
Unit
>&
unit
)
:
DoubleDescriptor
(
item
->
displayName
(),
item
,
unit
)
{
}
DoubleDescriptor
::
operator
double
()
const
{
return
get
();
...
...
This diff is collapsed.
Click to expand it.
GUI/Model/Types/DoubleDescriptor.h
+
22
−
22
View file @
b168e31e
...
...
@@ -34,43 +34,43 @@ using std::variant;
//! eases SessionItem migration. The underlying implementation can be a SessionItem, a simple double
//! member, or any other construction to hold a double value.
class
DoubleDescriptor
{
public:
DoubleDescriptor
(
const
DoubleDescriptor
&
other
)
=
default
;
private:
// private as long as path initialization is not included in params (to be done after
// SessionItem migration)
//! Operates on a double value (e.g a member variable).
DoubleDescriptor
(
const
QString
&
label
,
const
QString
&
tooltip
,
int
decimals
,
const
RealLimits
&
limits
,
double
*
var
,
const
variant
<
QString
,
Unit
>&
unit
);
//! Operates on a
session item. The settings (like decimals, limits) are taken from the session
//!
item.
//! Only for easier migration. Should be removed after SessionItem refactoring.
DoubleDescriptor
(
SessionItem
*
item
,
const
variant
<
QString
,
Unit
>&
unit
);
//! Operates on a
double value (e.g a member variable).
//!
Decimals is set to 3, limits is set to nonnegative
DoubleDescriptor
(
const
QString
&
label
,
const
QString
&
tooltip
,
double
*
var
,
const
variant
<
QString
,
Unit
>&
unit
);
public:
//! Operates on any kind of storage (e.g. session items), by using setter/getter methods
//! decimals is set to 3, limits is set to nonnegative
DoubleDescriptor
(
const
QString
&
label
,
const
QString
&
tooltip
,
function
<
void
(
double
)
>
setter
,
function
<
double
()
>
getter
,
const
variant
<
QString
,
Unit
>&
unit
);
//! Operates on any kind of storage (e.g. session items), by using setter/getter methods
DoubleDescriptor
(
QString
label
,
QString
tooltip
,
int
decimals
,
const
RealLimits
&
limits
,
function
<
void
(
double
)
>
setter
,
function
<
double
()
>
getter
,
const
variant
<
QString
,
Unit
>&
unit
);
DoubleDescriptor
(
const
QString
&
label
,
const
double
*
var
,
const
variant
<
QString
,
Unit
>&
unit
);
//! Operates on a session item. The settings (like decimals, limits) are taken from the session
//! item.
//! Only for easier migration. Should be removed after SessionItem refactoring.
DoubleDescriptor
(
const
QString
&
label
,
SessionItem
*
item
,
const
variant
<
QString
,
Unit
>&
unit
);
DoubleDescriptor
(
const
QString
&
label
,
const
double
*
var
,
const
variant
<
QString
,
Unit
>&
unit
);
//! Operates on any kind of storage (e.g. session items), by using setter/getter methods
DoubleDescriptor
(
QString
label
,
QString
tooltip
,
int
decimals
,
const
RealLimits
&
limits
,
function
<
void
(
double
)
>
setter
,
function
<
double
()
>
getter
,
const
variant
<
QString
,
Unit
>&
unit
);
//! Operates on a session item. The settings (like decimals, limits) are taken from the session
//! item.
//! Only for easier migration. Should be removed after SessionItem refactoring.
DoubleDescriptor
(
SessionItem
*
item
,
const
variant
<
QString
,
Unit
>&
unit
);
DoubleDescriptor
()
=
default
;
private:
// private as long as path initialization is not included in params (to be done after
// SessionItem migration)
//! Operates on a double value (e.g a member variable).
DoubleDescriptor
(
const
QString
&
label
,
const
QString
&
tooltip
,
int
decimals
,
const
RealLimits
&
limits
,
double
*
var
,
const
variant
<
QString
,
Unit
>&
unit
);
//! Operates on a double value (e.g a member variable).
//! Decimals is set to 3, limits is set to nonnegative
DoubleDescriptor
(
const
QString
&
label
,
const
QString
&
tooltip
,
double
*
var
,
const
variant
<
QString
,
Unit
>&
unit
);
DoubleDescriptor
(
const
DoubleDescriptor
&
other
)
=
default
;
public:
//! Return the current value of the handled parameter.
...
...
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