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
9e3d6bce
Commit
9e3d6bce
authored
3 years ago
by
Matthias Puchner
Browse files
Options
Downloads
Patches
Plain Diff
Do not allow integration over Xi in Windows (see issue
#160
for details)
parent
469f8981
No related branches found
No related tags found
1 merge request
!529
Do not allow integration over Xi in Windows
Pipeline
#51670
passed
3 years ago
Stage: build
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
GUI/Model/Sample/SampleValidator.cpp
+27
-2
27 additions, 2 deletions
GUI/Model/Sample/SampleValidator.cpp
GUI/Model/Sample/SampleValidator.h
+3
-0
3 additions, 0 deletions
GUI/Model/Sample/SampleValidator.h
with
30 additions
and
2 deletions
GUI/Model/Sample/SampleValidator.cpp
+
27
−
2
View file @
9e3d6bce
...
...
@@ -13,6 +13,7 @@
// ************************************************************************************************
#include
"GUI/Model/Sample/SampleValidator.h"
#include
"GUI/Model/Sample/InterferenceItems.h"
#include
"GUI/Model/Sample/LayerItem.h"
#include
"GUI/Model/Sample/MultiLayerItem.h"
#include
"GUI/Model/Sample/ParticleCompositionItem.h"
...
...
@@ -39,6 +40,29 @@ void SampleValidator::validateItem(const SessionItem* item)
addMessage
(
"Particle composition doesn't have any particles."
);
}
void
SampleValidator
::
validateInterferences
(
const
LayerItem
*
layer
)
{
#ifdef WIN32
ASSERT
(
layer
);
int
iLayout
=
0
;
for
(
auto
*
layout
:
layer
->
layouts
())
{
iLayout
++
;
if
(
auto
*
c
=
dynamic_cast
<
const
Interference2DAbstractLatticeItem
*>
(
layout
->
interference
().
currentItem
()))
if
(
c
->
xiIntegration
())
{
QString
message
=
QString
(
"Interference function of layer '%1', Particle layout %2: "
"Integration over Xi is currently not supported "
"under Windows"
)
.
arg
(
layer
->
layerName
())
.
arg
(
iLayout
);
addMessage
(
message
);
}
}
#endif
}
void
SampleValidator
::
addMessage
(
const
QString
&
m
)
{
m_messages
+=
QString
(
"* "
)
+
m
+
"
\n
"
;
...
...
@@ -56,7 +80,8 @@ bool SampleValidator::isValidMultiLayer(const MultiLayerItem* multilayer)
if
(
layers
.
front
()
->
layouts
().
isEmpty
())
addMessage
(
"The single layer in your MultiLayer should contain a particle layout."
);
for
(
auto
*
layer
:
layers
)
for
(
auto
*
layer
:
layers
)
{
validateInterferences
(
layer
);
for
(
auto
*
layout
:
layer
->
layouts
())
{
if
(
layout
->
particles
().
isEmpty
())
addMessage
(
"Particle layout doesn't contain any particles."
);
...
...
@@ -65,7 +90,7 @@ bool SampleValidator::isValidMultiLayer(const MultiLayerItem* multilayer)
iterateItems
(
particle
);
}
}
}
if
(
!
m_messages
.
isEmpty
())
m_messages
=
"Can't setup DWBA simulation for given MultiLayer.
\n
"
+
m_messages
;
...
...
This diff is collapsed.
Click to expand it.
GUI/Model/Sample/SampleValidator.h
+
3
−
0
View file @
9e3d6bce
...
...
@@ -22,6 +22,7 @@ class MultiLayerItem;
class
ParticleCompositionItem
;
class
ParticleCoreShellItem
;
class
ParticleLayoutItem
;
class
LayerItem
;
//! Validates SampleModel for MultiLayerItem suitable for simulation
class
SampleValidator
{
...
...
@@ -34,6 +35,8 @@ private:
void
iterateItems
(
const
SessionItem
*
parentItem
);
void
validateItem
(
const
SessionItem
*
item
);
void
validateInterferences
(
const
LayerItem
*
item
);
//! Adds this message to the report.
void
addMessage
(
const
QString
&
m
);
...
...
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