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
ae1f5be8
Commit
ae1f5be8
authored
9 years ago
by
Elliot Oram
Browse files
Options
Downloads
Patches
Plain Diff
Ensure plot is correct for current spectra in mini plot
Refs #13977
parent
f9e5a621
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/Indirect/ConvFit.h
+3
-0
3 additions, 0 deletions
...nterfaces/inc/MantidQtCustomInterfaces/Indirect/ConvFit.h
MantidQt/CustomInterfaces/src/Indirect/ConvFit.cpp
+18
-13
18 additions, 13 deletions
MantidQt/CustomInterfaces/src/Indirect/ConvFit.cpp
with
21 additions
and
13 deletions
MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/Indirect/ConvFit.h
+
3
−
0
View file @
ae1f5be8
...
@@ -77,6 +77,9 @@ private:
...
@@ -77,6 +77,9 @@ private:
QStringList
m_fitStrings
;
QStringList
m_fitStrings
;
QString
m_previousFit
;
QString
m_previousFit
;
QString
m_baseName
;
QString
m_baseName
;
int
m_runMin
;
int
m_runMax
;
};
};
}
// namespace IDA
}
// namespace IDA
}
// namespace CustomInterfaces
}
// namespace CustomInterfaces
...
...
This diff is collapsed.
Click to expand it.
MantidQt/CustomInterfaces/src/Indirect/ConvFit.cpp
+
18
−
13
View file @
ae1f5be8
...
@@ -35,6 +35,8 @@ ConvFit::ConvFit(QWidget *parent)
...
@@ -35,6 +35,8 @@ ConvFit::ConvFit(QWidget *parent)
void
ConvFit
::
setup
()
{
void
ConvFit
::
setup
()
{
// Create Property Managers
// Create Property Managers
m_stringManager
=
new
QtStringPropertyManager
();
m_stringManager
=
new
QtStringPropertyManager
();
m_runMin
=
0
;
m_runMax
=
0
;
// Initialise fitTypeStrings
// Initialise fitTypeStrings
m_fitStrings
=
QStringList
()
<<
""
m_fitStrings
=
QStringList
()
<<
""
...
@@ -237,6 +239,8 @@ void ConvFit::run() {
...
@@ -237,6 +239,8 @@ void ConvFit::run() {
std
::
string
function
=
std
::
string
(
func
->
asString
());
std
::
string
function
=
std
::
string
(
func
->
asString
());
std
::
string
stX
=
m_properties
[
"StartX"
]
->
valueText
().
toStdString
();
std
::
string
stX
=
m_properties
[
"StartX"
]
->
valueText
().
toStdString
();
std
::
string
enX
=
m_properties
[
"EndX"
]
->
valueText
().
toStdString
();
std
::
string
enX
=
m_properties
[
"EndX"
]
->
valueText
().
toStdString
();
m_runMin
=
m_uiForm
.
spSpectraMin
->
value
();
m_runMax
=
m_uiForm
.
spSpectraMax
->
value
();
std
::
string
specMin
=
m_uiForm
.
spSpectraMin
->
text
().
toStdString
();
std
::
string
specMin
=
m_uiForm
.
spSpectraMin
->
text
().
toStdString
();
std
::
string
specMax
=
m_uiForm
.
spSpectraMax
->
text
().
toStdString
();
std
::
string
specMax
=
m_uiForm
.
spSpectraMax
->
text
().
toStdString
();
int
maxIterations
=
int
maxIterations
=
...
@@ -984,22 +988,23 @@ void ConvFit::updatePlot() {
...
@@ -984,22 +988,23 @@ void ConvFit::updatePlot() {
}
}
// If there is a result plot then plot it
// If there is a result plot then plot it
std
::
string
groupName
=
m_baseName
.
toStdString
()
+
"_Workspaces"
;
std
::
string
groupName
=
m_baseName
.
toStdString
()
+
"_Workspaces"
;
if
(
AnalysisDataService
::
Instance
().
doesExist
(
groupName
))
{
if
(
AnalysisDataService
::
Instance
().
doesExist
(
groupName
))
{
WorkspaceGroup_sptr
outputGroup
=
WorkspaceGroup_sptr
outputGroup
=
AnalysisDataService
::
Instance
().
retrieveWS
<
WorkspaceGroup
>
(
AnalysisDataService
::
Instance
().
retrieveWS
<
WorkspaceGroup
>
(
groupName
);
groupName
);
if
(
specNo
-
m_runMin
>=
static_cast
<
int
>
(
outputGroup
->
size
()))
if
(
specNo
>=
static_cast
<
int
>
(
outputGroup
->
size
()))
return
;
return
;
MatrixWorkspace_sptr
ws
=
boost
::
dynamic_pointer_cast
<
MatrixWorkspace
>
(
if
((
specNo
-
m_runMin
)
>=
0
)
{
outputGroup
->
getItem
(
specNo
));
MatrixWorkspace_sptr
ws
=
boost
::
dynamic_pointer_cast
<
MatrixWorkspace
>
(
if
(
ws
)
{
outputGroup
->
getItem
(
specNo
-
m_runMin
));
m_uiForm
.
ppPlot
->
addSpectrum
(
"Fit"
,
ws
,
1
,
Qt
::
red
);
if
(
ws
)
{
m_uiForm
.
ppPlot
->
addSpectrum
(
"Diff"
,
ws
,
2
,
Qt
::
blue
);
m_uiForm
.
ppPlot
->
addSpectrum
(
"Fit"
,
ws
,
1
,
Qt
::
red
);
if
(
m_uiForm
.
ckPlotGuess
->
isChecked
()){
m_uiForm
.
ppPlot
->
addSpectrum
(
"Diff"
,
ws
,
2
,
Qt
::
blue
);
m_uiForm
.
ppPlot
->
removeSpectrum
(
"Guess"
);
if
(
m_uiForm
.
ckPlotGuess
->
isChecked
())
{
m_uiForm
.
ckPlotGuess
->
setChecked
(
false
);
m_uiForm
.
ppPlot
->
removeSpectrum
(
"Guess"
);
}
m_uiForm
.
ckPlotGuess
->
setChecked
(
false
);
}
}
}
}
}
}
}
}
...
...
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