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
142152dd
Commit
142152dd
authored
6 years ago
by
Yurov, Dmitry
Browse files
Options
Downloads
Patches
Plain Diff
Move native axis handling from instrument down to beam item
Redmine: #2217
parent
b009d3ba
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
GUI/coregui/Models/BeamItems.cpp
+8
-0
8 additions, 0 deletions
GUI/coregui/Models/BeamItems.cpp
GUI/coregui/Models/BeamItems.h
+2
-0
2 additions, 0 deletions
GUI/coregui/Models/BeamItems.h
GUI/coregui/Models/InstrumentItems.cpp
+6
-8
6 additions, 8 deletions
GUI/coregui/Models/InstrumentItems.cpp
with
16 additions
and
8 deletions
GUI/coregui/Models/BeamItems.cpp
+
8
−
0
View file @
142152dd
...
@@ -192,6 +192,14 @@ void SpecularBeamItem::updateFileName(const QString& filename)
...
@@ -192,6 +192,14 @@ void SpecularBeamItem::updateFileName(const QString& filename)
item
<
SpecularBeamInclinationItem
>
(
BeamItem
::
P_INCLINATION_ANGLE
).
updateFileName
(
filename
);
item
<
SpecularBeamInclinationItem
>
(
BeamItem
::
P_INCLINATION_ANGLE
).
updateFileName
(
filename
);
}
}
void
SpecularBeamItem
::
updateToData
(
const
IAxis
&
axis
,
QString
units
)
{
auto
axis_group
=
inclinationAxisGroup
();
axis_group
->
setCurrentType
(
Constants
::
PointwiseAxisType
);
auto
axis_item
=
static_cast
<
PointwiseAxisItem
*>
(
axis_group
->
currentItem
());
axis_item
->
init
(
axis
,
units
);
}
// GISAS beam item
// GISAS beam item
/* ------------------------------------------------------------------------- */
/* ------------------------------------------------------------------------- */
...
...
This diff is collapsed.
Click to expand it.
GUI/coregui/Models/BeamItems.h
+
2
−
0
View file @
142152dd
...
@@ -21,6 +21,7 @@ class BasicAxisItem;
...
@@ -21,6 +21,7 @@ class BasicAxisItem;
class
Beam
;
class
Beam
;
class
FootprintItem
;
class
FootprintItem
;
class
GroupItem
;
class
GroupItem
;
class
IAxis
;
class
BA_CORE_API_
BeamItem
:
public
SessionItem
class
BA_CORE_API_
BeamItem
:
public
SessionItem
{
{
...
@@ -70,6 +71,7 @@ public:
...
@@ -70,6 +71,7 @@ public:
FootprintItem
*
currentFootprintItem
()
const
;
FootprintItem
*
currentFootprintItem
()
const
;
void
updateFileName
(
const
QString
&
filename
);
void
updateFileName
(
const
QString
&
filename
);
void
updateToData
(
const
IAxis
&
axis
,
QString
units
);
};
};
class
BA_CORE_API_
GISASBeamItem
:
public
BeamItem
class
BA_CORE_API_
GISASBeamItem
:
public
BeamItem
...
...
This diff is collapsed.
Click to expand it.
GUI/coregui/Models/InstrumentItems.cpp
+
6
−
8
View file @
142152dd
...
@@ -150,15 +150,13 @@ void SpecularInstrumentItem::updateToRealData(const RealDataItem* item)
...
@@ -150,15 +150,13 @@ void SpecularInstrumentItem::updateToRealData(const RealDataItem* item)
if
(
item
->
getItemValue
(
RealDataItem
::
P_NATIVE_UNITS
).
toString
()
==
Constants
::
UnitsNbins
)
{
if
(
item
->
getItemValue
(
RealDataItem
::
P_NATIVE_UNITS
).
toString
()
==
Constants
::
UnitsNbins
)
{
beamItem
()
->
inclinationAxisGroup
()
->
setCurrentType
(
Constants
::
BasicAxisType
);
beamItem
()
->
inclinationAxisGroup
()
->
setCurrentType
(
Constants
::
BasicAxisType
);
setShape
(
item
->
shape
());
setShape
(
item
->
shape
());
}
else
{
return
;
QString
units
=
item
->
getItemValue
(
RealDataItem
::
P_NATIVE_UNITS
).
toString
();
const
auto
&
data
=
item
->
nativeData
()
->
getOutputData
()
->
getAxis
(
0
);
auto
axis_group
=
beamItem
()
->
inclinationAxisGroup
();
axis_group
->
setCurrentType
(
Constants
::
PointwiseAxisType
);
auto
axis
=
dynamic_cast
<
PointwiseAxisItem
*>
(
axis_group
->
currentItem
());
axis
->
init
(
data
,
units
);
}
}
// the case of dimensional units in user data
QString
units
=
item
->
getItemValue
(
RealDataItem
::
P_NATIVE_UNITS
).
toString
();
const
auto
&
data
=
item
->
nativeData
()
->
getOutputData
()
->
getAxis
(
0
);
beamItem
()
->
updateToData
(
data
,
units
);
}
}
bool
SpecularInstrumentItem
::
alignedWith
(
const
RealDataItem
*
item
)
const
bool
SpecularInstrumentItem
::
alignedWith
(
const
RealDataItem
*
item
)
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