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
a6d32909
Commit
a6d32909
authored
9 years ago
by
Elliot Oram
Browse files
Options
Downloads
Patches
Plain Diff
Added Check on Run not just Plot Time validation
Refs #13897
parent
86724d97
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/ISISEnergyTransfer.cpp
+46
-0
46 additions, 0 deletions
...idQt/CustomInterfaces/src/Indirect/ISISEnergyTransfer.cpp
with
46 additions
and
0 deletions
MantidQt/CustomInterfaces/src/Indirect/ISISEnergyTransfer.cpp
+
46
−
0
View file @
a6d32909
...
...
@@ -128,6 +128,52 @@ bool ISISEnergyTransfer::validate() {
}
}
if
(
m_uiForm
.
dsRunFiles
->
isValid
())
{
int
detectorMin
=
m_uiForm
.
spPlotTimeSpecMin
->
value
();
int
detectorMax
=
m_uiForm
.
spPlotTimeSpecMax
->
value
();
QString
rawFile
=
m_uiForm
.
dsRunFiles
->
getFirstFilename
();
auto
pos
=
rawFile
.
lastIndexOf
(
"."
);
auto
extension
=
rawFile
.
right
(
rawFile
.
length
()
-
pos
);
QFileInfo
rawFileInfo
(
rawFile
);
std
::
string
name
=
rawFileInfo
.
baseName
().
toStdString
();
IAlgorithm_sptr
loadAlg
=
AlgorithmManager
::
Instance
().
create
(
"Load"
);
loadAlg
->
initialize
();
loadAlg
->
setProperty
(
"Filename"
,
rawFile
.
toStdString
());
loadAlg
->
setProperty
(
"OutputWorkspace"
,
name
);
if
(
extension
.
compare
(
".nxs"
)
==
0
)
{
int64_t
detectorMin
=
static_cast
<
int64_t
>
(
m_uiForm
.
spPlotTimeSpecMin
->
value
());
int64_t
detectorMax
=
static_cast
<
int64_t
>
(
m_uiForm
.
spPlotTimeSpecMax
->
value
());
loadAlg
->
setProperty
(
"SpectrumMin"
,
detectorMin
);
loadAlg
->
setProperty
(
"SpectrumMax"
,
detectorMax
);
}
else
{
loadAlg
->
setProperty
(
"SpectrumMin"
,
detectorMin
);
loadAlg
->
setProperty
(
"SpectrumMax"
,
detectorMax
);
}
loadAlg
->
execute
();
if
(
m_uiForm
.
ckBackgroundRemoval
->
isChecked
())
{
MatrixWorkspace_sptr
tempWs
=
AnalysisDataService
::
Instance
().
retrieveWS
<
MatrixWorkspace
>
(
name
);
const
int
minBack
=
tempWs
->
readX
(
0
)[
0
];
const
int
maxBack
=
tempWs
->
readX
(
0
)[
tempWs
->
blocksize
()];
if
(
m_uiForm
.
spBackgroundStart
->
value
()
<
minBack
)
{
uiv
.
addErrorMessage
(
"The Start of Background Removal is less than the "
"minimum of the data range"
);
}
if
(
m_uiForm
.
spBackgroundEnd
->
value
()
>
maxBack
)
{
uiv
.
addErrorMessage
(
"The End of Background Removal is more than the "
"maximum of the data range"
);
}
}
}
QString
error
=
uiv
.
generateErrorMessage
();
showMessageBox
(
error
);
...
...
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