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
fe89be44
Commit
fe89be44
authored
3 years ago
by
Matthias Puchner
Browse files
Options
Downloads
Patches
Plain Diff
free SampleValidator from SessionItem/-Model
parent
c40785df
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!570
remove SessionModel/Item from SampleModel and all related items
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
GUI/Model/Sample/SampleValidator.cpp
+2
-10
2 additions, 10 deletions
GUI/Model/Sample/SampleValidator.cpp
GUI/Model/Sample/SampleValidator.h
+3
-7
3 additions, 7 deletions
GUI/Model/Sample/SampleValidator.h
with
5 additions
and
17 deletions
GUI/Model/Sample/SampleValidator.cpp
+
2
−
10
View file @
fe89be44
...
@@ -20,15 +20,8 @@
...
@@ -20,15 +20,8 @@
#include
"GUI/Model/Sample/ParticleCoreShellItem.h"
#include
"GUI/Model/Sample/ParticleCoreShellItem.h"
#include
"GUI/Model/Sample/ParticleLayoutItem.h"
#include
"GUI/Model/Sample/ParticleLayoutItem.h"
void
SampleValidator
::
iterateItems
(
const
SessionItem
*
parentItem
)
{
for
(
const
SessionItem
*
child
:
parentItem
->
children
())
{
validateItem
(
child
);
iterateItems
(
child
);
}
}
void
SampleValidator
::
validateItem
(
const
SessionItem
*
item
)
void
SampleValidator
::
validateItem
(
const
ItemWithParticles
*
item
)
{
{
if
(
const
auto
*
p
=
dynamic_cast
<
const
ParticleCoreShellItem
*>
(
item
))
{
if
(
const
auto
*
p
=
dynamic_cast
<
const
ParticleCoreShellItem
*>
(
item
))
{
if
(
!
p
->
core
())
if
(
!
p
->
core
())
...
@@ -85,9 +78,8 @@ bool SampleValidator::isValidMultiLayer(const MultiLayerItem* multilayer)
...
@@ -85,9 +78,8 @@ bool SampleValidator::isValidMultiLayer(const MultiLayerItem* multilayer)
for
(
const
auto
*
layout
:
layer
->
layouts
())
{
for
(
const
auto
*
layout
:
layer
->
layouts
())
{
if
(
layout
->
particles
().
isEmpty
())
if
(
layout
->
particles
().
isEmpty
())
addMessage
(
"Particle layout doesn't contain any particles."
);
addMessage
(
"Particle layout doesn't contain any particles."
);
for
(
const
auto
*
particle
:
layout
->
p
articles
())
{
for
(
const
auto
*
particle
:
layout
->
containedItemsWithP
articles
())
{
validateItem
(
particle
);
validateItem
(
particle
);
iterateItems
(
particle
);
}
}
}
}
}
}
...
...
This diff is collapsed.
Click to expand it.
GUI/Model/Sample/SampleValidator.h
+
3
−
7
View file @
fe89be44
...
@@ -15,14 +15,11 @@
...
@@ -15,14 +15,11 @@
#ifndef BORNAGAIN_GUI_MODEL_SAMPLE_SAMPLEVALIDATOR_H
#ifndef BORNAGAIN_GUI_MODEL_SAMPLE_SAMPLEVALIDATOR_H
#define BORNAGAIN_GUI_MODEL_SAMPLE_SAMPLEVALIDATOR_H
#define BORNAGAIN_GUI_MODEL_SAMPLE_SAMPLEVALIDATOR_H
#include
<Q
ModelIndex
>
#include
<Q
String
>
class
SessionItem
;
class
MultiLayerItem
;
class
MultiLayerItem
;
class
ParticleCompositionItem
;
class
ParticleCoreShellItem
;
class
ParticleLayoutItem
;
class
LayerItem
;
class
LayerItem
;
class
ItemWithParticles
;
//! Validates SampleModel for MultiLayerItem suitable for simulation
//! Validates SampleModel for MultiLayerItem suitable for simulation
class
SampleValidator
{
class
SampleValidator
{
...
@@ -32,8 +29,7 @@ public:
...
@@ -32,8 +29,7 @@ public:
QString
getValidationMessage
()
const
{
return
m_messages
;
}
QString
getValidationMessage
()
const
{
return
m_messages
;
}
private
:
private
:
void
iterateItems
(
const
SessionItem
*
parentItem
);
void
validateItem
(
const
ItemWithParticles
*
item
);
void
validateItem
(
const
SessionItem
*
item
);
void
validateInterferences
(
const
LayerItem
*
item
);
void
validateInterferences
(
const
LayerItem
*
item
);
...
...
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