Skip to content

Commit

Permalink
Refs #4856 Clear spectra range when using a different workspace.
Browse files Browse the repository at this point in the history
  • Loading branch information
Samuel Jackson committed Feb 21, 2014
1 parent f9791a5 commit d958022
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 19 deletions.
Expand Up @@ -32,6 +32,7 @@ namespace IDA
void updateRS(QtProperty* prop, double val);

private:
QString currentWsName;
QIntValidator * m_intVal;
QwtPlot* m_msdPlot;
MantidWidgets::RangeSelector* m_msdRange;
Expand Down
43 changes: 24 additions & 19 deletions Code/Mantid/MantidQt/CustomInterfaces/src/MSDFit.cpp
Expand Up @@ -188,29 +188,32 @@ namespace IDA
int wsIndex = 0;
int minIndex = 0;
int maxIndex = nHist-1;

if (!plotSpec.isEmpty() && plotSpec.toInt() < nHist)
{
wsIndex = plotSpec.toInt();
}

if (!specMin.isEmpty())
if (currentWsName == wsname)
{
minIndex = specMin.toInt();
}
if (!plotSpec.isEmpty() && plotSpec.toInt() < nHist)
{
wsIndex = plotSpec.toInt();
}

if (!specMax.isEmpty())
{
maxIndex = specMax.toInt();
}
if (!specMin.isEmpty())
{
minIndex = specMin.toInt();
}

if (wsIndex < minIndex)
{
wsIndex = minIndex;
}
else if( wsIndex > maxIndex)
{
wsIndex = maxIndex;
if (!specMax.isEmpty() && specMax.toInt() < nHist)
{
maxIndex = specMax.toInt();
}

if (wsIndex < minIndex)
{
wsIndex = minIndex;
}
else if( wsIndex > maxIndex)
{
wsIndex = maxIndex;
}
}

m_msdDataCurve = plotMiniplot(m_msdPlot, m_msdDataCurve, ws, wsIndex);
Expand Down Expand Up @@ -240,6 +243,8 @@ namespace IDA
{
showInformationBox(exc.what());
}

currentWsName = wsname;
}
else
{
Expand Down

0 comments on commit d958022

Please sign in to comment.