Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
mantid
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Model registry
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mantidproject
mantid
Commits
a0572250
Commit
a0572250
authored
9 years ago
by
Elliot Oram
Browse files
Options
Downloads
Patches
Plain Diff
Improved quality to validation to check matching histoNumber
Refs #14078
parent
36295a8e
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
MantidQt/CustomInterfaces/src/Indirect/ContainerSubtraction.cpp
+21
-1
21 additions, 1 deletion
...Qt/CustomInterfaces/src/Indirect/ContainerSubtraction.cpp
with
21 additions
and
1 deletion
MantidQt/CustomInterfaces/src/Indirect/ContainerSubtraction.cpp
+
21
−
1
View file @
a0572250
...
...
@@ -172,9 +172,20 @@ void ContainerSubtraction::addRebinStep(QString toRebin, QString toMatch) {
*/
bool
ContainerSubtraction
::
validate
()
{
UserInputValidator
uiv
;
// Check valid inputs
uiv
.
checkDataSelectorIsValid
(
"Sample"
,
m_uiForm
.
dsSample
);
uiv
.
checkDataSelectorIsValid
(
"Container"
,
m_uiForm
.
dsContainer
);
MatrixWorkspace_sptr
sampleWs
;
// Get Workspaces
MatrixWorkspace_sptr
sampleWs
=
AnalysisDataService
::
Instance
().
retrieveWS
<
MatrixWorkspace
>
(
m_uiForm
.
dsSample
->
getCurrentDataName
().
toStdString
());
MatrixWorkspace_sptr
containerWs
=
AnalysisDataService
::
Instance
().
retrieveWS
<
MatrixWorkspace
>
(
m_uiForm
.
dsContainer
->
getCurrentDataName
().
toStdString
());
// Check Sample is of same type as container
QString
sample
=
m_uiForm
.
dsSample
->
getCurrentDataName
();
QString
sampleType
=
sample
.
right
(
sample
.
length
()
-
sample
.
lastIndexOf
(
"_"
));
QString
container
=
m_uiForm
.
dsContainer
->
getCurrentDataName
();
...
...
@@ -189,6 +200,15 @@ bool ContainerSubtraction::validate() {
uiv
.
addErrorMessage
(
"Sample and can workspaces must contain the same type of data."
);
// Check sample has the same number of Histograms as the contianer
const
size_t
sampleHist
=
sampleWs
->
getNumberHistograms
();
const
size_t
containerHist
=
containerWs
->
getNumberHistograms
();
if
(
sampleHist
!=
containerHist
)
{
uiv
.
addErrorMessage
(
" Sample and Container do not have a matching number of Histograms."
);
}
// Show errors if there are any
if
(
!
uiv
.
isAllInputValid
())
emit
showMessageBox
(
uiv
.
generateErrorMessage
());
...
...
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