Skip to content
Snippets Groups Projects
Commit a293d2f5 authored by Dan Nixon's avatar Dan Nixon
Browse files

Support proper plot options on UI

Refs #9198
parent 99440c83
No related branches found
No related tags found
No related merge requests found
...@@ -45,6 +45,7 @@ namespace IDA ...@@ -45,6 +45,7 @@ namespace IDA
void fixItem(); void fixItem();
void unFixItem(); void unFixItem();
void showTieCheckbox(QString); void showTieCheckbox(QString);
void updatePlotOptions();
private: private:
boost::shared_ptr<Mantid::API::CompositeFunction> createFunction(bool tieCentres=false); boost::shared_ptr<Mantid::API::CompositeFunction> createFunction(bool tieCentres=false);
......
...@@ -141,6 +141,8 @@ namespace IDA ...@@ -141,6 +141,8 @@ namespace IDA
// Tie // Tie
connect(m_uiForm.cbFitType,SIGNAL(currentIndexChanged(QString)),SLOT(showTieCheckbox(QString))); connect(m_uiForm.cbFitType,SIGNAL(currentIndexChanged(QString)),SLOT(showTieCheckbox(QString)));
showTieCheckbox( m_uiForm.cbFitType->currentText() ); showTieCheckbox( m_uiForm.cbFitType->currentText() );
updatePlotOptions();
} }
void ConvFit::run() void ConvFit::run()
...@@ -764,6 +766,8 @@ namespace IDA ...@@ -764,6 +766,8 @@ namespace IDA
hwhmRangeSelector->setVisible(false); hwhmRangeSelector->setVisible(false);
break; break;
} }
updatePlotOptions();
} }
void ConvFit::bgTypeSelection(int index) void ConvFit::bgTypeSelection(int index)
...@@ -1139,22 +1143,10 @@ namespace IDA ...@@ -1139,22 +1143,10 @@ namespace IDA
void ConvFit::checkBoxUpdate(QtProperty* prop, bool checked) void ConvFit::checkBoxUpdate(QtProperty* prop, bool checked)
{ {
// Add/remove some properties to display only relevant options UNUSED_ARG(checked);
if ( prop == m_properties["UseDeltaFunc"] )
{ if(prop == m_properties["UseDeltaFunc"])
if ( checked ) updatePlotOptions();
{
m_properties["DeltaFunction"]->addSubProperty(m_properties["DeltaHeight"]);
m_uiForm.cbPlotType->addItem("Height");
m_uiForm.cbPlotType->addItem("EISF");
}
else
{
m_properties["DeltaFunction"]->removeSubProperty(m_properties["DeltaHeight"]);
m_uiForm.cbPlotType->removeItem(m_uiForm.cbPlotType->count()-1);
m_uiForm.cbPlotType->removeItem(m_uiForm.cbPlotType->count()-1);
}
}
} }
void ConvFit::fitContextMenu(const QPoint &) void ConvFit::fitContextMenu(const QPoint &)
...@@ -1241,6 +1233,46 @@ namespace IDA ...@@ -1241,6 +1233,46 @@ namespace IDA
m_uiForm.ckTieCentres->setVisible( fitType == "Two Lorentzians" ); m_uiForm.ckTieCentres->setVisible( fitType == "Two Lorentzians" );
} }
void ConvFit::updatePlotOptions()
{
m_uiForm.cbPlotType->clear();
bool deltaFunction = m_blnManager->value(m_properties["UseDeltaFunc"]);
QStringList plotOptions;
plotOptions << "None";
if(deltaFunction)
plotOptions << "Height";
switch(m_uiForm.cbFitType->currentIndex())
{
// Lorentzians
case 1:
case 2:
plotOptions << "Amplitude" << "FWHM";
if(deltaFunction)
plotOptions << "EISF";
break;
// DiffSphere
case 3:
plotOptions << "Intensity" << "Radius" << "Diffusion" << "Shift";
break;
// DiffRotDiscreteCircle
case 4:
plotOptions << "Intensity" << "Radius" << "Decay" << "Shift";
break;
default:
break;
}
plotOptions << "All";
m_uiForm.cbPlotType->addItems(plotOptions);
}
} // namespace IDA } // namespace IDA
} // namespace CustomInterfaces } // namespace CustomInterfaces
} // namespace MantidQt } // namespace MantidQt
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment