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
ba56f50b
Commit
ba56f50b
authored
1 year ago
by
Wuttke, Joachim
Browse files
Options
Downloads
Patches
Plain Diff
GUI Suite test with just one InstrumentItem
parent
d27f2be6
No related branches found
No related tags found
1 merge request
!1862
minor cleanup while hunting bug in fd5
Pipeline
#108772
passed
1 year ago
Stage: build
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
GUI/Model/FromCore/ItemizeSimulation.cpp
+7
-9
7 additions, 9 deletions
GUI/Model/FromCore/ItemizeSimulation.cpp
GUI/Model/FromCore/ItemizeSimulation.h
+2
-2
2 additions, 2 deletions
GUI/Model/FromCore/ItemizeSimulation.h
Tests/Suite/GUI/Check.cpp
+4
-4
4 additions, 4 deletions
Tests/Suite/GUI/Check.cpp
with
13 additions
and
15 deletions
GUI/Model/FromCore/ItemizeSimulation.cpp
+
7
−
9
View file @
ba56f50b
...
...
@@ -375,24 +375,22 @@ SpecularInstrumentItem* createSpecularInstrumentItem(const SpecularSimulation& s
}
// namespace
Instrument
Model
*
GUI
::
FromCore
::
itemizeInstrument
(
const
ISimulation
&
simulation
)
Instrument
Item
*
GUI
::
FromCore
::
itemizeInstrument
(
const
ISimulation
&
simulation
)
{
InstrumentItem
*
item
;
InstrumentItem
*
result
;
if
(
const
auto
*
sim
=
dynamic_cast
<
const
ScatteringSimulation
*>
(
&
simulation
))
item
=
createGISASInstrumentItem
(
*
sim
);
result
=
createGISASInstrumentItem
(
*
sim
);
else
if
(
const
auto
*
sim
=
dynamic_cast
<
const
OffspecSimulation
*>
(
&
simulation
))
item
=
createOffspecInstrumentItem
(
*
sim
);
result
=
createOffspecInstrumentItem
(
*
sim
);
else
if
(
const
auto
*
sim
=
dynamic_cast
<
const
SpecularSimulation
*>
(
&
simulation
))
item
=
createSpecularInstrumentItem
(
*
sim
);
result
=
createSpecularInstrumentItem
(
*
sim
);
else
ASSERT_NEVER
;
setBackground
(
item
,
simulation
);
setBackground
(
result
,
simulation
);
auto
*
model
=
new
InstrumentModel
;
model
->
emplace_back
(
item
);
return
model
;
return
result
;
}
SimulationOptionsItem
*
GUI
::
FromCore
::
itemizeOptions
(
const
ISimulation
&
simulation
)
...
...
This diff is collapsed.
Click to expand it.
GUI/Model/FromCore/ItemizeSimulation.h
+
2
−
2
View file @
ba56f50b
...
...
@@ -17,13 +17,13 @@
class
SimulationOptionsItem
;
class
ISimulation
;
class
Instrument
Model
;
class
Instrument
Item
;
//! Contains set of methods to populate GUI models with content from domain.
namespace
GUI
::
FromCore
{
Instrument
Model
*
itemizeInstrument
(
const
ISimulation
&
simulation
);
Instrument
Item
*
itemizeInstrument
(
const
ISimulation
&
simulation
);
SimulationOptionsItem
*
itemizeOptions
(
const
ISimulation
&
simulation
);
...
...
This diff is collapsed.
Click to expand it.
Tests/Suite/GUI/Check.cpp
+
4
−
4
View file @
ba56f50b
...
...
@@ -18,7 +18,8 @@
#include
"Device/Data/Datafield.h"
#include
"Device/IO/DiffUtil.h"
#include
"Device/IO/IOFactory.h"
#include
"GUI/Model/Device/InstrumentModel.h"
#include
"GUI/Model/Device/BackgroundItems.h"
#include
"GUI/Model/Device/InstrumentItems.h"
#include
"GUI/Model/FromCore/ItemizeSample.h"
#include
"GUI/Model/FromCore/ItemizeSimulation.h"
#include
"GUI/Model/Sample/SampleItem.h"
...
...
@@ -36,11 +37,10 @@ namespace {
std
::
unique_ptr
<
ISimulation
>
indirectSimulation
(
const
ISimulation
&
sim
)
{
std
::
unique_ptr
<
SampleItem
>
sampleItem
(
GUI
::
FromCore
::
itemizeSample
(
*
sim
.
sample
()));
std
::
unique_ptr
<
Instrument
Model
>
instrument
Model
(
GUI
::
FromCore
::
itemizeInstrument
(
sim
));
std
::
unique_ptr
<
Instrument
Item
>
instrument
Item
(
GUI
::
FromCore
::
itemizeInstrument
(
sim
));
std
::
unique_ptr
<
SimulationOptionsItem
>
optionsItem
(
GUI
::
FromCore
::
itemizeOptions
(
sim
));
return
GUI
::
ToCore
::
itemsToSimulation
(
*
sampleItem
,
*
instrumentModel
->
instrumentItems
().
front
(),
*
optionsItem
);
return
GUI
::
ToCore
::
itemsToSimulation
(
*
sampleItem
,
*
instrumentItem
,
*
optionsItem
);
}
}
// namespace
...
...
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