diff --git a/Code/Mantid/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/IndirectDataAnalysis.ui b/Code/Mantid/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/IndirectDataAnalysis.ui index 5c10c6511e24ad4ccd00e5d8358ba96bcfbc37d0..e873efe11955162dfa1dade2a38c148152c74b90 100644 --- a/Code/Mantid/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/IndirectDataAnalysis.ui +++ b/Code/Mantid/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/IndirectDataAnalysis.ui @@ -348,7 +348,7 @@ <item> <widget class="QPushButton" name="msd_pbSingle"> <property name="text"> - <string>Fit Single Spectra</string> + <string>Fit Single Spectrum</string> </property> </widget> </item> @@ -856,7 +856,7 @@ <item> <widget class="QPushButton" name="furyfit_pbSingle"> <property name="text"> - <string>Fit Single Spectra</string> + <string>Fit Single Spectum</string> </property> </widget> </item> @@ -1267,7 +1267,7 @@ <item> <widget class="QPushButton" name="confit_pbSingle"> <property name="text"> - <string>Fit Single Spectra</string> + <string>Fit Single Spectrum</string> </property> </widget> </item> diff --git a/Code/Mantid/MantidQt/CustomInterfaces/src/ConvFit.cpp b/Code/Mantid/MantidQt/CustomInterfaces/src/ConvFit.cpp index efbd115cdf4dc6f4cc4c3a4527544110fa50edb2..58cb9690b758a5f6589efafd2f811eb689c1ab57 100644 --- a/Code/Mantid/MantidQt/CustomInterfaces/src/ConvFit.cpp +++ b/Code/Mantid/MantidQt/CustomInterfaces/src/ConvFit.cpp @@ -14,6 +14,11 @@ #include <qwt_plot.h> #include <qwt_plot_curve.h> +namespace +{ + Mantid::Kernel::Logger g_log("ConvFit"); +} + namespace MantidQt { namespace CustomInterfaces @@ -148,6 +153,12 @@ namespace IDA QString ftype = fitTypeString(); QString bg = backgroundString(); + + if(ftype == "") + { + g_log.error("No fit type defined"); + } + bool useTies = uiForm().confit_ckTieCentres->isChecked(); QString ties = (useTies ? "True" : "False"); @@ -522,15 +533,8 @@ namespace IDA fitType += "1L"; break; case 2: fitType += "2L"; break; - default: - assert( false ); // Should never happen. } - // We should never get to a stage where the user is allowed to - // continue having not selected at least one fit - be it - // Lorentzian, delta, or both. - assert( ! fitType.isEmpty() ); - return fitType; } @@ -554,7 +558,6 @@ namespace IDA case 2: return "FitL_s"; default: - assert( false ); // Should never happen. return ""; } } @@ -643,7 +646,6 @@ namespace IDA void ConvFit::plotGuess(QtProperty*) { - if ( ! uiForm().confit_ckPlotGuess->isChecked() || m_cfDataCurve == NULL ) { return; @@ -706,6 +708,13 @@ namespace IDA void ConvFit::singleFit() { + const QString error = validate(); + if( ! error.isEmpty() ) + { + showInformationBox(error); + return; + } + plotInput(); if ( m_cfDataCurve == NULL ) @@ -722,6 +731,11 @@ namespace IDA QString ftype = fitTypeString(); QString bg = backgroundString(); + if(ftype == "") + { + g_log.error("No fit type defined!"); + } + QString outputNm = runPythonCode(QString("from IndirectCommon import getWSprefix\nprint getWSprefix('") + m_cfInputWSName + QString("')\n")).trimmed(); outputNm += QString("conv_") + ftype + bg + uiForm().confit_leSpecNo->text(); std::string output = outputNm.toStdString(); diff --git a/Code/Mantid/MantidQt/CustomInterfaces/src/FuryFit.cpp b/Code/Mantid/MantidQt/CustomInterfaces/src/FuryFit.cpp index 687eefbe721fa88afb7162b4e7263922dc9f1696..50f523cff3f28ba0e4c5da5f097e8899fa5801d9 100644 --- a/Code/Mantid/MantidQt/CustomInterfaces/src/FuryFit.cpp +++ b/Code/Mantid/MantidQt/CustomInterfaces/src/FuryFit.cpp @@ -561,6 +561,13 @@ namespace IDA void FuryFit::singleFit() { + const QString error = validate(); + if( ! error.isEmpty() ) + { + showInformationBox(error); + return; + } + // First create the function auto function = createFunction(); diff --git a/Code/Mantid/MantidQt/CustomInterfaces/src/MSDFit.cpp b/Code/Mantid/MantidQt/CustomInterfaces/src/MSDFit.cpp index 93f4569924a953aaa435db6798aa91e2c3c04810..9d0f589b49123c9f30e77cbb0484f60024c2fb14 100644 --- a/Code/Mantid/MantidQt/CustomInterfaces/src/MSDFit.cpp +++ b/Code/Mantid/MantidQt/CustomInterfaces/src/MSDFit.cpp @@ -98,6 +98,13 @@ namespace IDA void MSDFit::singleFit() { + const QString error = validate(); + if( ! error.isEmpty() ) + { + showInformationBox(error); + return; + } + QString pyInput = "from IndirectDataAnalysis import msdfit\n" "startX = " + QString::number(m_msdDblMng->value(m_msdProp["Start"])) +"\n"