diff --git a/Code/Mantid/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/Indirect/ConvFit.h b/Code/Mantid/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/Indirect/ConvFit.h index cdef8cc89853767739b9286307f9748a175391ea..4c08a72458bba6ec029da0160d35377a29b90358 100644 --- a/Code/Mantid/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/Indirect/ConvFit.h +++ b/Code/Mantid/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/Indirect/ConvFit.h @@ -45,6 +45,7 @@ namespace IDA void fixItem(); void unFixItem(); void showTieCheckbox(QString); + void updatePlotOptions(); private: boost::shared_ptr<Mantid::API::CompositeFunction> createFunction(bool tieCentres=false); diff --git a/Code/Mantid/MantidQt/CustomInterfaces/src/Indirect/ConvFit.cpp b/Code/Mantid/MantidQt/CustomInterfaces/src/Indirect/ConvFit.cpp index 5631714a085ce96c8243c77d3bfdf8b4fd5ecefc..fa1183730693e226efd0c69ecc3e89a665faf707 100644 --- a/Code/Mantid/MantidQt/CustomInterfaces/src/Indirect/ConvFit.cpp +++ b/Code/Mantid/MantidQt/CustomInterfaces/src/Indirect/ConvFit.cpp @@ -141,6 +141,8 @@ namespace IDA // Tie connect(m_uiForm.cbFitType,SIGNAL(currentIndexChanged(QString)),SLOT(showTieCheckbox(QString))); showTieCheckbox( m_uiForm.cbFitType->currentText() ); + + updatePlotOptions(); } void ConvFit::run() @@ -764,6 +766,8 @@ namespace IDA hwhmRangeSelector->setVisible(false); break; } + + updatePlotOptions(); } void ConvFit::bgTypeSelection(int index) @@ -1139,22 +1143,10 @@ namespace IDA void ConvFit::checkBoxUpdate(QtProperty* prop, bool checked) { - // Add/remove some properties to display only relevant options - if ( prop == m_properties["UseDeltaFunc"] ) - { - if ( checked ) - { - 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); - } - } + UNUSED_ARG(checked); + + if(prop == m_properties["UseDeltaFunc"]) + updatePlotOptions(); } void ConvFit::fitContextMenu(const QPoint &) @@ -1241,6 +1233,46 @@ namespace IDA 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 CustomInterfaces } // namespace MantidQt