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
66b1baf1
Commit
66b1baf1
authored
6 years ago
by
Yurov, Dmitry
Browse files
Options
Downloads
Patches
Plain Diff
Proper handling of PointwiseAxisItem while copying instrument
Redmine: #2177
parent
c6c23f62
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
GUI/coregui/Models/JobModelFunctions.cpp
+24
-1
24 additions, 1 deletion
GUI/coregui/Models/JobModelFunctions.cpp
with
24 additions
and
1 deletion
GUI/coregui/Models/JobModelFunctions.cpp
+
24
−
1
View file @
66b1baf1
...
@@ -29,6 +29,7 @@
...
@@ -29,6 +29,7 @@
#include
"JobModel.h"
#include
"JobModel.h"
#include
"MaskItems.h"
#include
"MaskItems.h"
#include
"MaskUnitsConverter.h"
#include
"MaskUnitsConverter.h"
#include
"PointwiseAxisItem.h"
#include
"RealDataItem.h"
#include
"RealDataItem.h"
namespace
JobModelFunctions
namespace
JobModelFunctions
...
@@ -39,7 +40,9 @@ void copyMasksToInstrument(JobItem* jobItem);
...
@@ -39,7 +40,9 @@ void copyMasksToInstrument(JobItem* jobItem);
void
cropRealData
(
JobItem
*
jobItem
);
void
cropRealData
(
JobItem
*
jobItem
);
void
createFitContainers
(
JobItem
*
jobItem
);
void
createFitContainers
(
JobItem
*
jobItem
);
void
initDataView
(
JobItem
*
jobItem
);
void
initDataView
(
JobItem
*
jobItem
);
}
PointwiseAxisItem
*
getPointwiseAxisItem
(
const
InstrumentItem
*
instrument
);
}
// namespace
void
JobModelFunctions
::
setupJobItemInstrument
(
JobItem
*
jobItem
,
void
JobModelFunctions
::
setupJobItemInstrument
(
JobItem
*
jobItem
,
const
InstrumentItem
*
instrumentItem
)
const
InstrumentItem
*
instrumentItem
)
...
@@ -48,6 +51,15 @@ void JobModelFunctions::setupJobItemInstrument(JobItem* jobItem,
...
@@ -48,6 +51,15 @@ void JobModelFunctions::setupJobItemInstrument(JobItem* jobItem,
SessionItem
*
instrument
=
model
->
copyItem
(
instrumentItem
,
jobItem
,
JobItem
::
T_INSTRUMENT
);
SessionItem
*
instrument
=
model
->
copyItem
(
instrumentItem
,
jobItem
,
JobItem
::
T_INSTRUMENT
);
instrument
->
setItemName
(
instrumentItem
->
modelType
());
instrument
->
setItemName
(
instrumentItem
->
modelType
());
jobItem
->
getItem
(
JobItem
::
P_INSTRUMENT_NAME
)
->
setValue
(
instrumentItem
->
itemName
());
jobItem
->
getItem
(
JobItem
::
P_INSTRUMENT_NAME
)
->
setValue
(
instrumentItem
->
itemName
());
if
(
auto
spec_instrument
=
dynamic_cast
<
SpecularInstrumentItem
*>
(
instrument
))
{
// updating filename
const
auto
filename
=
ItemFileNameUtils
::
instrumentDataFileName
(
*
spec_instrument
);
spec_instrument
->
beamItem
()
->
updateFileName
(
filename
);
// copying axis data
const
auto
instrument_axis
=
getPointwiseAxisItem
(
instrumentItem
)
->
getAxis
();
getPointwiseAxisItem
(
spec_instrument
)
->
setAxis
(
instrument_axis
);
}
}
}
//! Setup items intended for storing results of the job.
//! Setup items intended for storing results of the job.
...
@@ -195,3 +207,14 @@ void JobModelFunctions::createFitContainers(JobItem* jobItem)
...
@@ -195,3 +207,14 @@ void JobModelFunctions::createFitContainers(JobItem* jobItem)
minimizerContainerItem
=
model
->
insertNewItem
(
minimizerContainerItem
=
model
->
insertNewItem
(
Constants
::
MinimizerContainerType
,
fitSuiteItem
->
index
(),
-
1
,
FitSuiteItem
::
T_MINIMIZER
);
Constants
::
MinimizerContainerType
,
fitSuiteItem
->
index
(),
-
1
,
FitSuiteItem
::
T_MINIMIZER
);
}
}
PointwiseAxisItem
*
JobModelFunctions
::
getPointwiseAxisItem
(
const
InstrumentItem
*
instrument
)
{
auto
spec_instrument
=
dynamic_cast
<
const
SpecularInstrumentItem
*>
(
instrument
);
if
(
!
spec_instrument
)
return
nullptr
;
return
dynamic_cast
<
PointwiseAxisItem
*>
(
spec_instrument
->
beamItem
()
->
inclinationAxisGroup
()
->
getChildOfType
(
Constants
::
PointwiseAxisType
));
}
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