From cb8b34a388bd6868bddd2d4bee86b7eaa11c8a7c Mon Sep 17 00:00:00 2001
From: Robert Applin <40830825+robertapplin@users.noreply.github.com>
Date: Wed, 3 Oct 2018 11:52:04 +0100
Subject: [PATCH] Refs #23699. Add output options for MSD Fit

---
 .../release/v3.14.0/indirect_inelastic.rst    |  3 +-
 qt/scientific_interfaces/Indirect/JumpFit.ui  |  6 ++++
 qt/scientific_interfaces/Indirect/MSDFit.cpp  |  9 +++--
 qt/scientific_interfaces/Indirect/MSDFit.ui   | 33 ++++++++++++++++++-
 4 files changed, 46 insertions(+), 5 deletions(-)

diff --git a/docs/source/release/v3.14.0/indirect_inelastic.rst b/docs/source/release/v3.14.0/indirect_inelastic.rst
index fd69d1e950e..6b8a1c79979 100644
--- a/docs/source/release/v3.14.0/indirect_inelastic.rst
+++ b/docs/source/release/v3.14.0/indirect_inelastic.rst
@@ -32,8 +32,9 @@ Improvements
 - When the InelasticDiffSphere, InelasticDiffRotDiscreteCircle, ElasticDiffSphere or ElasticDiffRotDiscreteCircle
   Fit Types are selected in the ConvFit Tab, the Q values are retrieved from the workspaces, preventing a crash 
   when plotting a guess.
-- The Plot Result buttons in MSDFit and F(Q)Fit are disabled after a Run when the result workspace only has one
+- The Plot buttons in MSDFit and F(Q)Fit are disabled after a Run when the result workspace only has one
   data point to plot.
+- There is now an option to choose which output parameter to plot in MSDFit.
 - An option to skip the calculation of Monte Carlo Errors on the I(Q,t) Tab has been added.
 - During the calculation of Monte Carlo Errors, a progress bar is now shown.
 
diff --git a/qt/scientific_interfaces/Indirect/JumpFit.ui b/qt/scientific_interfaces/Indirect/JumpFit.ui
index ef209e03d90..5747dec9b19 100644
--- a/qt/scientific_interfaces/Indirect/JumpFit.ui
+++ b/qt/scientific_interfaces/Indirect/JumpFit.ui
@@ -223,6 +223,9 @@
              </item>
              <item>
               <widget class="QComboBox" name="cbPlotType">
+               <property name="enabled">
+                <bool>false</bool>
+               </property>
                <property name="minimumSize">
                 <size>
                  <width>100</width>
@@ -244,6 +247,9 @@
              </item>
              <item>
               <widget class="QPushButton" name="pbPlot">
+               <property name="enabled">
+                <bool>false</bool>
+               </property>
                <property name="text">
                 <string>Plot</string>
                </property>
diff --git a/qt/scientific_interfaces/Indirect/MSDFit.cpp b/qt/scientific_interfaces/Indirect/MSDFit.cpp
index 74cea77e007..4f0c3a7b9b4 100644
--- a/qt/scientific_interfaces/Indirect/MSDFit.cpp
+++ b/qt/scientific_interfaces/Indirect/MSDFit.cpp
@@ -58,11 +58,13 @@ void MSDFit::updateModelFitTypeString() {
   m_msdFittingModel->setFitType(selectedFitType().toStdString());
 }
 
-void MSDFit::updatePlotOptions() {}
+void MSDFit::updatePlotOptions() {
+  IndirectFitAnalysisTab::updatePlotOptions(m_uiForm->cbPlotType);
+}
 
 void MSDFit::plotClicked() {
   setPlotResultIsPlotting(true);
-  IndirectFitAnalysisTab::plotResult("All");
+  IndirectFitAnalysisTab::plotResult(m_uiForm->cbPlotType->currentText());
   setPlotResultIsPlotting(false);
 }
 
@@ -79,6 +81,7 @@ void MSDFit::setRunEnabled(bool enabled) {
 
 void MSDFit::setPlotResultEnabled(bool enabled) {
   m_uiForm->pbPlot->setEnabled(enabled);
+  m_uiForm->cbPlotType->setEnabled(enabled);
 }
 
 void MSDFit::setFitSingleSpectrumEnabled(bool enabled) {
@@ -96,7 +99,7 @@ void MSDFit::setRunIsRunning(bool running) {
 }
 
 void MSDFit::setPlotResultIsPlotting(bool plotting) {
-  m_uiForm->pbPlot->setText(plotting ? "Plotting..." : "Plot Result");
+  m_uiForm->pbPlot->setText(plotting ? "Plotting..." : "Plot");
   setPlotResultEnabled(!plotting);
 }
 
diff --git a/qt/scientific_interfaces/Indirect/MSDFit.ui b/qt/scientific_interfaces/Indirect/MSDFit.ui
index 0e7da511e92..596ace91681 100644
--- a/qt/scientific_interfaces/Indirect/MSDFit.ui
+++ b/qt/scientific_interfaces/Indirect/MSDFit.ui
@@ -121,13 +121,44 @@
              <string>Output</string>
             </property>
             <layout class="QHBoxLayout" name="horizontalLayout_8">
+             <item>
+              <widget class="QLabel" name="label">
+               <property name="text">
+                <string>Plot Output:</string>
+               </property>
+              </widget>
+             </item>
+             <item>
+              <widget class="QComboBox" name="cbPlotType">
+               <property name="enabled">
+                <bool>false</bool>
+               </property>
+               <property name="minimumSize">
+                <size>
+                 <width>100</width>
+                 <height>0</height>
+                </size>
+               </property>
+               <property name="maximumSize">
+                <size>
+                 <width>100</width>
+                 <height>16777215</height>
+                </size>
+               </property>
+               <item>
+                <property name="text">
+                 <string>All</string>
+                </property>
+               </item>
+              </widget>
+             </item>
              <item>
               <widget class="QPushButton" name="pbPlot">
                <property name="enabled">
                 <bool>false</bool>
                </property>
                <property name="text">
-                <string>Plot Result</string>
+                <string>Plot</string>
                </property>
                <property name="checked">
                 <bool>false</bool>
-- 
GitLab