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
6a0f411b
Commit
6a0f411b
authored
7 years ago
by
Yurov, Dmitry
Browse files
Options
Downloads
Patches
Plain Diff
Eliminated isInFittingBlackList function
Redmine: #1981
parent
fc266aa8
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/ModelPath.cpp
+1
-44
1 addition, 44 deletions
GUI/coregui/Models/ModelPath.cpp
GUI/coregui/Models/ModelPath.h
+0
-2
0 additions, 2 deletions
GUI/coregui/Models/ModelPath.h
GUI/coregui/Models/ParameterTreeItems.cpp
+41
-1
41 additions, 1 deletion
GUI/coregui/Models/ParameterTreeItems.cpp
with
42 additions
and
47 deletions
GUI/coregui/Models/ModelPath.cpp
+
1
−
44
View file @
6a0f411b
...
...
@@ -13,11 +13,9 @@
// ************************************************************************** //
#include
"ModelPath.h"
#include
"InstrumentItems.h"
#include
"JobItem.h"
#include
"RectangularDetectorItem.h"
#include
"SessionModel.h"
#include
"SphericalDetectorItem.h"
QString
ModelPath
::
getPathFromIndex
(
const
QModelIndex
&
index
)
{
...
...
@@ -85,47 +83,6 @@ bool ModelPath::isValidItem(SessionModel* model, SessionItem* item, const QModel
return
false
;
}
//! Returns true when we know how to translate ParameterItem link to domain name.
bool
ModelPath
::
isInFittingBlackList
(
const
QString
&
par_name
)
{
static
const
QStringList
fitting_black_list
{
// distribution types
Constants
::
DistributionGateType
,
Constants
::
DistributionLorentzType
,
Constants
::
DistributionGaussianType
,
Constants
::
DistributionLogNormalType
,
Constants
::
DistributionCosineType
,
Constants
::
DistributionTrapezoidType
,
// axes
SphericalDetectorItem
::
P_PHI_AXIS
,
SphericalDetectorItem
::
P_ALPHA_AXIS
,
RectangularDetectorItem
::
P_X_AXIS
,
RectangularDetectorItem
::
P_Y_AXIS
,
OffSpecInstrumentItem
::
P_ALPHA_AXIS
,
// rectangular detector positioning
RectangularDetectorItem
::
P_ALIGNMENT
,
RectangularDetectorItem
::
P_NORMAL
,
RectangularDetectorItem
::
P_DIRECTION
,
RectangularDetectorItem
::
P_U0
,
RectangularDetectorItem
::
P_V0
,
RectangularDetectorItem
::
P_DBEAM_U0
,
RectangularDetectorItem
::
P_DBEAM_V0
,
RectangularDetectorItem
::
P_DISTANCE
,
// Detector resolution
Constants
::
ResolutionFunction2DGaussianType
};
for
(
const
auto
&
name
:
fitting_black_list
)
if
(
par_name
.
contains
(
name
))
return
false
;
return
true
;
}
//! Returns ancestor of given modelType for given item.
//! For example, returns corresponding jobItem owning ParameterItem via ParameterContainer.
...
...
This diff is collapsed.
Click to expand it.
GUI/coregui/Models/ModelPath.h
+
0
−
2
View file @
6a0f411b
...
...
@@ -34,8 +34,6 @@ BA_CORE_API_ SessionItem* getItemFromPath(const QString& relPath, const SessionI
BA_CORE_API_
bool
isValidItem
(
SessionModel
*
model
,
SessionItem
*
item
,
const
QModelIndex
&
parent
);
BA_CORE_API_
bool
isInFittingBlackList
(
const
QString
&
par_name
);
BA_CORE_API_
const
SessionItem
*
ancestor
(
const
SessionItem
*
item
,
const
QString
&
requiredModelType
);
BA_CORE_API_
QString
itemPathTranslation
(
const
SessionItem
&
item
,
const
SessionItem
*
topItem
=
0
);
...
...
This diff is collapsed.
Click to expand it.
GUI/coregui/Models/ParameterTreeItems.cpp
+
41
−
1
View file @
6a0f411b
...
...
@@ -15,8 +15,11 @@
#include
"ParameterTreeItems.h"
#include
"DistributionItems.h"
#include
"FitParameterHelper.h"
#include
"InstrumentItems.h"
#include
"ModelPath.h"
#include
"RectangularDetectorItem.h"
#include
"SessionModel.h"
#include
"SphericalDetectorItem.h"
// ----------------------------------------------------------------------------
...
...
@@ -78,8 +81,45 @@ void ParameterItem::restoreFromBackup()
bool
ParameterItem
::
isFittable
()
const
{
static
const
QStringList
fitting_black_list
{
// distribution types
Constants
::
DistributionGateType
,
Constants
::
DistributionLorentzType
,
Constants
::
DistributionGaussianType
,
Constants
::
DistributionLogNormalType
,
Constants
::
DistributionCosineType
,
Constants
::
DistributionTrapezoidType
,
// axes
SphericalDetectorItem
::
P_PHI_AXIS
,
SphericalDetectorItem
::
P_ALPHA_AXIS
,
RectangularDetectorItem
::
P_X_AXIS
,
RectangularDetectorItem
::
P_Y_AXIS
,
OffSpecInstrumentItem
::
P_ALPHA_AXIS
,
// rectangular detector positioning
RectangularDetectorItem
::
P_ALIGNMENT
,
RectangularDetectorItem
::
P_NORMAL
,
RectangularDetectorItem
::
P_DIRECTION
,
RectangularDetectorItem
::
P_U0
,
RectangularDetectorItem
::
P_V0
,
RectangularDetectorItem
::
P_DBEAM_U0
,
RectangularDetectorItem
::
P_DBEAM_V0
,
RectangularDetectorItem
::
P_DISTANCE
,
// Detector resolution
Constants
::
ResolutionFunction2DGaussianType
};
Q_ASSERT
(
ModelPath
::
ancestor
(
this
,
Constants
::
JobItemType
));
return
ModelPath
::
isInFittingBlackList
(
FitParameterHelper
::
getParameterItemPath
(
this
));
const
QString
&
par_path
=
FitParameterHelper
::
getParameterItemPath
(
this
);
for
(
const
auto
&
name
:
fitting_black_list
)
if
(
par_path
.
contains
(
name
))
return
false
;
return
true
;
}
// ----------------------------------------------------------------------------
...
...
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