diff --git a/Code/Mantid/Build/auto_wiki.py b/Code/Mantid/Build/wiki_maker.py similarity index 100% rename from Code/Mantid/Build/auto_wiki.py rename to Code/Mantid/Build/wiki_maker.py diff --git a/Code/Mantid/Framework/CurveFitting/CMakeLists.txt b/Code/Mantid/Framework/CurveFitting/CMakeLists.txt index 0c89398a0e52affe5618a1ed2cf32dee30b778b9..989fcafbdcb557b2d3baa933e604aabced64b570 100644 --- a/Code/Mantid/Framework/CurveFitting/CMakeLists.txt +++ b/Code/Mantid/Framework/CurveFitting/CMakeLists.txt @@ -1,115 +1,118 @@ set ( SRC_FILES - src/BFGS_Minimizer.cpp - src/BackToBackExponential.cpp - src/BivariateNormal.cpp - src/BackgroundFunction.cpp - src/BoundaryConstraint.cpp - src/Chebyshev.cpp - src/Convolution.cpp - src/CostFuncIgnorePosPeaks.cpp - src/CostFuncLeastSquares.cpp - src/DeltaFunction.cpp - src/ExpDecay.cpp - src/FRConjugateGradientMinimizer.cpp - src/Fit.cpp - src/Fit1D.cpp - src/FuncMinimizerFactory.cpp - src/GSLFunctions.cpp - src/Gaussian.cpp - src/Gaussian1D.cpp - src/GaussianLinearBG1D.cpp - src/GenericFit.cpp - src/IkedaCarpenterPV.cpp - src/LevenbergMarquardtMinimizer.cpp - src/Linear.cpp - src/LinearBackground.cpp - src/Lorentzian.cpp - src/Lorentzian1D.cpp - src/MultiBG.cpp - src/PRConjugateGradientMinimizer.cpp - src/PlotPeakByLogValue.cpp - src/ProductFunctionMW.cpp - src/Quadratic.cpp - src/Resolution.cpp - src/SimplexMinimizer.cpp - src/SpecialFunctionHelper.cpp - src/SplineBackground.cpp - src/UserFunction.cpp - src/UserFunction1D.cpp + src/BFGS_Minimizer.cpp + src/BackToBackExponential.cpp + src/BackgroundFunction.cpp + src/BivariateNormal.cpp + src/BoundaryConstraint.cpp + src/Chebyshev.cpp + src/Convolution.cpp + src/CostFuncIgnorePosPeaks.cpp + src/CostFuncLeastSquares.cpp + src/DeltaFunction.cpp + src/ExpDecay.cpp + src/FRConjugateGradientMinimizer.cpp + src/Fit.cpp + src/Fit1D.cpp + src/FuncMinimizerFactory.cpp + src/GSLFunctions.cpp + src/Gaussian.cpp + src/Gaussian1D.cpp + src/GaussianLinearBG1D.cpp + src/GenericFit.cpp + src/IkedaCarpenterPV.cpp + src/LevenbergMarquardtMinimizer.cpp + src/Linear.cpp + src/LinearBackground.cpp + src/Lorentzian.cpp + src/Lorentzian1D.cpp + src/MultiBG.cpp + src/PRConjugateGradientMinimizer.cpp + src/PlotPeakByLogValue.cpp + src/ProductFunctionMW.cpp + src/Quadratic.cpp + src/QuadraticBackground.cpp + src/Resolution.cpp + src/SimplexMinimizer.cpp + src/SpecialFunctionHelper.cpp + src/SplineBackground.cpp + src/UserFunction.cpp + src/UserFunction1D.cpp ) set ( SRC_UNITY_IGNORE_FILES src/Fit1D.cpp src/GSLFunctions.cpp ) set ( INC_FILES - inc/MantidCurveFitting/BFGS_Minimizer.h - inc/MantidCurveFitting/BackToBackExponential.h - inc/MantidCurveFitting/BackgroundFunction.h - inc/MantidCurveFitting/BivariateNormal.h - inc/MantidCurveFitting/BoundaryConstraint.h - inc/MantidCurveFitting/Chebyshev.h - inc/MantidCurveFitting/Convolution.h - inc/MantidCurveFitting/CostFuncIgnorePosPeaks.h - inc/MantidCurveFitting/CostFuncLeastSquares.h - inc/MantidCurveFitting/DeltaFunction.h - inc/MantidCurveFitting/DllConfig.h - inc/MantidCurveFitting/ExpDecay.h - inc/MantidCurveFitting/FRConjugateGradientMinimizer.h - inc/MantidCurveFitting/Fit.h - inc/MantidCurveFitting/Fit1D.h - inc/MantidCurveFitting/FuncMinimizerFactory.h - inc/MantidCurveFitting/GSLFunctions.h - inc/MantidCurveFitting/Gaussian.h - inc/MantidCurveFitting/Gaussian1D.h - inc/MantidCurveFitting/GaussianLinearBG1D.h - inc/MantidCurveFitting/GenericFit.h - inc/MantidCurveFitting/IFuncMinimizer.h - inc/MantidCurveFitting/IkedaCarpenterPV.h - inc/MantidCurveFitting/LevenbergMarquardtMinimizer.h - inc/MantidCurveFitting/Linear.h - inc/MantidCurveFitting/LinearBackground.h - inc/MantidCurveFitting/Lorentzian.h - inc/MantidCurveFitting/Lorentzian1D.h - inc/MantidCurveFitting/MultiBG.h - inc/MantidCurveFitting/PRConjugateGradientMinimizer.h - inc/MantidCurveFitting/PlotPeakByLogValue.h - inc/MantidCurveFitting/ProductFunctionMW.h - inc/MantidCurveFitting/Quadratic.h - inc/MantidCurveFitting/Resolution.h - inc/MantidCurveFitting/SimplexMinimizer.h - inc/MantidCurveFitting/SpecialFunctionSupport.h - inc/MantidCurveFitting/SplineBackground.h - inc/MantidCurveFitting/UserFunction.h - inc/MantidCurveFitting/UserFunction1D.h + inc/MantidCurveFitting/BFGS_Minimizer.h + inc/MantidCurveFitting/BackToBackExponential.h + inc/MantidCurveFitting/BackgroundFunction.h + inc/MantidCurveFitting/BivariateNormal.h + inc/MantidCurveFitting/BoundaryConstraint.h + inc/MantidCurveFitting/Chebyshev.h + inc/MantidCurveFitting/Convolution.h + inc/MantidCurveFitting/CostFuncIgnorePosPeaks.h + inc/MantidCurveFitting/CostFuncLeastSquares.h + inc/MantidCurveFitting/DeltaFunction.h + inc/MantidCurveFitting/DllConfig.h + inc/MantidCurveFitting/ExpDecay.h + inc/MantidCurveFitting/FRConjugateGradientMinimizer.h + inc/MantidCurveFitting/Fit.h + inc/MantidCurveFitting/Fit1D.h + inc/MantidCurveFitting/FuncMinimizerFactory.h + inc/MantidCurveFitting/GSLFunctions.h + inc/MantidCurveFitting/Gaussian.h + inc/MantidCurveFitting/Gaussian1D.h + inc/MantidCurveFitting/GaussianLinearBG1D.h + inc/MantidCurveFitting/GenericFit.h + inc/MantidCurveFitting/IFuncMinimizer.h + inc/MantidCurveFitting/IkedaCarpenterPV.h + inc/MantidCurveFitting/LevenbergMarquardtMinimizer.h + inc/MantidCurveFitting/Linear.h + inc/MantidCurveFitting/LinearBackground.h + inc/MantidCurveFitting/Lorentzian.h + inc/MantidCurveFitting/Lorentzian1D.h + inc/MantidCurveFitting/MultiBG.h + inc/MantidCurveFitting/PRConjugateGradientMinimizer.h + inc/MantidCurveFitting/PlotPeakByLogValue.h + inc/MantidCurveFitting/ProductFunctionMW.h + inc/MantidCurveFitting/Quadratic.h + inc/MantidCurveFitting/QuadraticBackground.h + inc/MantidCurveFitting/Resolution.h + inc/MantidCurveFitting/SimplexMinimizer.h + inc/MantidCurveFitting/SpecialFunctionSupport.h + inc/MantidCurveFitting/SplineBackground.h + inc/MantidCurveFitting/UserFunction.h + inc/MantidCurveFitting/UserFunction1D.h ) set ( TEST_FILES - test/BackToBackExponentialTest.h - test/BivariateNormalTest.h - test/BoundaryConstraintTest.h - test/ChebyshevTest.h - test/CompositeFunctionTest.h - test/ConvolutionTest.h - test/ExpDecayTest.h - test/FitTest.h - test/FuncMinimizerFactoryTest.h - test/FunctionFactoryTest.h - test/FunctionTest.h - test/Gaussian1DTest.h - test/GaussianTest.h - test/IkedaCarpenterPVTest.h - test/LinearBackgroundTest.h - test/LinearTest.h - test/Lorentzian1DTest.h - test/LorentzianTest.h - test/MultiBGTest.h - test/PlotPeakByLogValueTest.h - test/ProductFunctionMWTest.h - test/QuadraticTest.h - test/ResolutionTest.h - test/SpecialFunctionSupportTest.h - test/SplineBackgroundTest.h - test/UserFunction1DTest.h - test/UserFunctionTest.h + test/BackToBackExponentialTest.h + test/BivariateNormalTest.h + test/BoundaryConstraintTest.h + test/ChebyshevTest.h + test/CompositeFunctionTest.h + test/ConvolutionTest.h + test/ExpDecayTest.h + test/FitTest.h + test/FuncMinimizerFactoryTest.h + test/FunctionFactoryTest.h + test/FunctionTest.h + test/Gaussian1DTest.h + test/GaussianTest.h + test/IkedaCarpenterPVTest.h + test/LinearBackgroundTest.h + test/LinearTest.h + test/Lorentzian1DTest.h + test/LorentzianTest.h + test/MultiBGTest.h + test/PlotPeakByLogValueTest.h + test/ProductFunctionMWTest.h + test/QuadraticBackgroundTest.h + test/QuadraticTest.h + test/ResolutionTest.h + test/SpecialFunctionSupportTest.h + test/SplineBackgroundTest.h + test/UserFunction1DTest.h + test/UserFunctionTest.h ) diff --git a/Code/Mantid/Framework/CurveFitting/inc/MantidCurveFitting/QuadraticBackground.h b/Code/Mantid/Framework/CurveFitting/inc/MantidCurveFitting/QuadraticBackground.h new file mode 100644 index 0000000000000000000000000000000000000000..743a4f9a616181ceed2d47b2287c47896f2cd26f --- /dev/null +++ b/Code/Mantid/Framework/CurveFitting/inc/MantidCurveFitting/QuadraticBackground.h @@ -0,0 +1,61 @@ +#ifndef MANTID_CURVEFITTING_QUADRATICBACKGROUND_H_ +#define MANTID_CURVEFITTING_QUADRATICBACKGROUND_H_ +/*WIKI* +Quadratic background +Y = A0 + A1*X + A2*X**2 +*WIKI*/ + +#include "MantidKernel/System.h" +#include "MantidCurveFitting/BackgroundFunction.h" +#include <cmath> + +namespace Mantid +{ +namespace CurveFitting +{ + + /** QuadraticBackground : Quadratic background as Y = A0 + A1*X + A2*X**2 + + @author + @date 2011-10-25 + + Copyright © 2011 ISIS Rutherford Appleton Laboratory & NScD Oak Ridge National Laboratory + + This file is part of Mantid. + + Mantid is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + Mantid is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. + + File change history is stored at: <https://svn.mantidproject.org/mantid/trunk/Code/Mantid> + Code Documentation is available at: <http://doxygen.mantidproject.org> + */ + class DLLExport QuadraticBackground : public BackgroundFunction + { + public: + QuadraticBackground(); + ~QuadraticBackground(); + + std::string name()const{return "QuadraticBackground";} + virtual void functionMW(double* out, const double* xValues, const size_t nData)const; + virtual void functionDerivMW(API::Jacobian* out, const double* xValues, const size_t nData); + + private: + void init(); + + }; + + +} // namespace CurveFitting +} // namespace Mantid + +#endif /* MANTID_CURVEFITTING_QUADRATICBACKGROUND_H_ */ diff --git a/Code/Mantid/Framework/CurveFitting/src/QuadraticBackground.cpp b/Code/Mantid/Framework/CurveFitting/src/QuadraticBackground.cpp new file mode 100644 index 0000000000000000000000000000000000000000..d68d36c1694174e80e6d8789fe3c3ac1c968ea97 --- /dev/null +++ b/Code/Mantid/Framework/CurveFitting/src/QuadraticBackground.cpp @@ -0,0 +1,64 @@ +#include "MantidCurveFitting/QuadraticBackground.h" +#include "MantidKernel/System.h" + +using namespace Mantid::Kernel; +using namespace Mantid::API; + +namespace Mantid +{ +namespace CurveFitting +{ + +DECLARE_FUNCTION(QuadraticBackground) + + //---------------------------------------------------------------------------------------------- + /** Constructor + */ + QuadraticBackground::QuadraticBackground() + { + // TODO Auto-generated constructor stub + } + + //---------------------------------------------------------------------------------------------- + /** Destructor + */ + QuadraticBackground::~QuadraticBackground() + { + // TODO Auto-generated destructor stub + } + + void QuadraticBackground::init() + { + declareParameter("A0", 0.0); + declareParameter("A1", 0.0); + declareParameter("A2", 0.0); + } + + + /* + * + */ + void QuadraticBackground::functionMW(double* out, const double* xValues, const size_t nData)const + { + const double& a0 = getParameter("A0"); + const double& a1 = getParameter("A1"); + const double& a2 = getParameter("A2"); + + for (size_t i = 0; i < nData; i++) { + out[i] = a0+a1*xValues[i]+a2*xValues[i]*xValues[i]; + } + } + + void QuadraticBackground::functionDerivMW(API::Jacobian* out, const double* xValues, const size_t nData) + { + for (size_t i = 0; i < nData; i++) { + out->set(i, 0, 1); + out->set(i, 1, xValues[i]); + out->set(i, 2, xValues[i]*xValues[i]); + } + } + + +} // namespace Mantid +} // namespace CurveFitting + diff --git a/Code/Mantid/Framework/CurveFitting/test/QuadraticBackgroundTest.h b/Code/Mantid/Framework/CurveFitting/test/QuadraticBackgroundTest.h new file mode 100644 index 0000000000000000000000000000000000000000..0d7d453dd11a0c30a9cad65595f09690e3ab09dc --- /dev/null +++ b/Code/Mantid/Framework/CurveFitting/test/QuadraticBackgroundTest.h @@ -0,0 +1,34 @@ +#ifndef MANTID_CURVEFITTING_QUADRATICBACKGROUNDTEST_H_ +#define MANTID_CURVEFITTING_QUADRATICBACKGROUNDTEST_H_ + +#include <cxxtest/TestSuite.h> +#include "MantidKernel/Timer.h" +#include "MantidKernel/System.h" +#include <iostream> +#include <iomanip> + +#include "MantidCurveFitting/QuadraticBackground.h" + +using namespace Mantid; +using namespace Mantid::CurveFitting; +using namespace Mantid::API; + +class QuadraticBackgroundTest : public CxxTest::TestSuite +{ +public: + // This pair of boilerplate methods prevent the suite being created statically + // This means the constructor isn't called when running other tests + static QuadraticBackgroundTest *createSuite() { return new QuadraticBackgroundTest(); } + static void destroySuite( QuadraticBackgroundTest *suite ) { delete suite; } + + + void test_Something() + { + } + + +}; + + +#endif /* MANTID_CURVEFITTING_QUADRATICBACKGROUNDTEST_H_ */ + diff --git a/Code/Mantid/Framework/DataHandling/test/ManagedRawFileWorkspace2DTest.h b/Code/Mantid/Framework/DataHandling/test/ManagedRawFileWorkspace2DTest.h index 1aee77a1bfdd2a8570826a90990f3dc1d32627fc..1e46177238bd789acb45ed2b415e0d0522bf2573 100644 --- a/Code/Mantid/Framework/DataHandling/test/ManagedRawFileWorkspace2DTest.h +++ b/Code/Mantid/Framework/DataHandling/test/ManagedRawFileWorkspace2DTest.h @@ -236,58 +236,58 @@ public: ManagedRawFileWorkspace2DTestPerformance() : outputSpace("wishWS") { - // Load the instrument alone so as to isolate the raw file loading time from the instrument loading time - IAlgorithm * loader = FrameworkManager::Instance().createAlgorithm("LoadEmptyInstrument"); - loader->setPropertyValue("Filename","WISH_Definition.xml"); - loader->setPropertyValue("OutputWorkspace", "InstrumentOnly"); - TS_ASSERT( loader->execute() ); +// // Load the instrument alone so as to isolate the raw file loading time from the instrument loading time +// IAlgorithm * loader = FrameworkManager::Instance().createAlgorithm("LoadEmptyInstrument"); +// loader->setPropertyValue("Filename","WISH_Definition.xml"); +// loader->setPropertyValue("OutputWorkspace", "InstrumentOnly"); +// TS_ASSERT( loader->execute() ); } // This should take ~no time. If it does an unacceptable change has occurred! void testLoadTime() { - // Make sure we go managed - ConfigServiceImpl& conf = ConfigService::Instance(); - const std::string managed = "ManagedWorkspace.LowerMemoryLimit"; - const std::string oldValue = conf.getString(managed); - conf.setString(managed,"0"); - const std::string managed2 = "ManagedRawFileWorkspace.DoNotUse"; - const std::string oldValue2 = conf.getString(managed2); - conf.setString(managed2,"0"); - const std::string datapath = "datasearch.directories"; - std::string pathValue = conf.getString(datapath); - pathValue.append(";../../Data/SystemTests/"); - conf.setString(datapath,pathValue); - - IAlgorithm * loader = FrameworkManager::Instance().createAlgorithm("LoadRaw"); - //IAlgorithm_sptr loader = AlgorithmFactory::Instance().create("LoadRaw"); - loader->setPropertyValue("Filename","WISH00016748.raw"); - loader->setPropertyValue("OutputWorkspace",outputSpace); - TS_ASSERT( loader->execute() ); - - conf.setString(managed,oldValue); - conf.setString(managed2,oldValue2); +// // Make sure we go managed +// ConfigServiceImpl& conf = ConfigService::Instance(); +// const std::string managed = "ManagedWorkspace.LowerMemoryLimit"; +// const std::string oldValue = conf.getString(managed); +// conf.setString(managed,"0"); +// const std::string managed2 = "ManagedRawFileWorkspace.DoNotUse"; +// const std::string oldValue2 = conf.getString(managed2); +// conf.setString(managed2,"0"); +// const std::string datapath = "datasearch.directories"; +// std::string pathValue = conf.getString(datapath); +// pathValue.append(";../../Data/SystemTests/"); +// conf.setString(datapath,pathValue); +// +// IAlgorithm * loader = FrameworkManager::Instance().createAlgorithm("LoadRaw"); +// //IAlgorithm_sptr loader = AlgorithmFactory::Instance().create("LoadRaw"); +// loader->setPropertyValue("Filename","WISH00016748.raw"); +// loader->setPropertyValue("OutputWorkspace",outputSpace); +// TS_ASSERT( loader->execute() ); +// +// conf.setString(managed,oldValue); +// conf.setString(managed2,oldValue2); } // This also should be very quick (nothing should get written to disk) void testReadValues() { - MatrixWorkspace_const_sptr ws = boost::dynamic_pointer_cast<const MatrixWorkspace>(AnalysisDataService::Instance().retrieve(outputSpace)); - TS_ASSERT( ws ); - - double x(0),y(0),e(0); - for ( std::size_t i = 0 ; i < ws->getNumberHistograms() ; ++i ) - { - x = ws->readX(i)[0]; - y = ws->readY(i)[0]; - e = ws->readE(i)[0]; - } - - TS_ASSERT( x > 0.0 ); - TS_ASSERT( y == 0.0 ); - TS_ASSERT( e == 0.0 ); - - AnalysisDataService::Instance().remove(outputSpace); +// MatrixWorkspace_const_sptr ws = boost::dynamic_pointer_cast<const MatrixWorkspace>(AnalysisDataService::Instance().retrieve(outputSpace)); +// TS_ASSERT( ws ); +// +// double x(0),y(0),e(0); +// for ( std::size_t i = 0 ; i < ws->getNumberHistograms() ; ++i ) +// { +// x = ws->readX(i)[0]; +// y = ws->readY(i)[0]; +// e = ws->readE(i)[0]; +// } +// +// TS_ASSERT( x > 0.0 ); +// TS_ASSERT( y == 0.0 ); +// TS_ASSERT( e == 0.0 ); +// +// AnalysisDataService::Instance().remove(outputSpace); } }; diff --git a/Code/Mantid/MantidPlot/src/ApplicationWindow.cpp b/Code/Mantid/MantidPlot/src/ApplicationWindow.cpp index 224e80bb6aafaa1509e95d4851e0292657faad57..61df8ff3782499b50f8824707431ad02dbc901fc 100644 --- a/Code/Mantid/MantidPlot/src/ApplicationWindow.cpp +++ b/Code/Mantid/MantidPlot/src/ApplicationWindow.cpp @@ -16305,6 +16305,7 @@ QMessageBox::critical(this, tr("MantidPlot") + " - " + tr("Error"),//Mantid #endif } /**This searches for the graph with a selected name and then attaches the fitFunctionBrowser to it +* This also disables the fitFunctionBrowser from all the other graphs. * * @param fpb The fit property browser from the custom interface * @param nameOfPlot A string variable containing the name of the graph we want to fit. @@ -16314,6 +16315,7 @@ void ApplicationWindow::runConnectFitting(MantidQt::MantidWidgets::FitPropertyBr { // Loop through all multilayer (i.e. plots) windows displayed in Mantidplot // and apply pickpickertool to relevant plot + // Search and delete any current peak picker tools first QList<MdiSubWindow *> windows = windowsList(); foreach (MdiSubWindow *w, windows) { @@ -16335,7 +16337,17 @@ void ApplicationWindow::runConnectFitting(MantidQt::MantidWidgets::FitPropertyBr g->disableTools(); } } - else // if (w->objectName() == nameOfPlot) + } + } + } + // now check for graphs to add the peak picker tool to. + foreach (MdiSubWindow *w, windows) + { + if (w->isA("MultiLayer")) + { + MultiLayer *plot = (MultiLayer *)w; + { + if (w->objectName() == nameOfPlot) { QList<Graph *> layers = plot->layersList(); if (layers.size() > 1) // Check to see if more than one graph with the same name on the layer diff --git a/Code/Mantid/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/MuonAnalysis.h b/Code/Mantid/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/MuonAnalysis.h index 9ff93104414116aac120ac53861861ddaac1976a..79df5e78525e91fdc51ee377bcf601c82adc187c 100644 --- a/Code/Mantid/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/MuonAnalysis.h +++ b/Code/Mantid/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/MuonAnalysis.h @@ -241,9 +241,12 @@ private: /// name of workspace std::string m_workspace_name; - // name of the loaded data + /// name of the loaded data QString m_currentDataName; + /// boolean to tell whether the fit property browser has been assigned + bool m_assigned; + /// which group table row has the user last clicked on int m_groupTableRowInFocus; diff --git a/Code/Mantid/MantidQt/CustomInterfaces/src/MuonAnalysis.cpp b/Code/Mantid/MantidQt/CustomInterfaces/src/MuonAnalysis.cpp index fae209184a77ccb9a10a1dc6f50bf71ba23f8893..24f28f08697b740576201aa9d6f08146a4c2694c 100644 --- a/Code/Mantid/MantidQt/CustomInterfaces/src/MuonAnalysis.cpp +++ b/Code/Mantid/MantidQt/CustomInterfaces/src/MuonAnalysis.cpp @@ -74,7 +74,7 @@ Logger& MuonAnalysis::g_log = Logger::get("MuonAnalysis"); //---------------------- ///Constructor MuonAnalysis::MuonAnalysis(QWidget *parent) : - UserSubWindow(parent), m_last_dir(), m_workspace_name("MuonAnalysis"), m_currentDataName(""), m_groupTableRowInFocus(0), m_pairTableRowInFocus(0), + UserSubWindow(parent), m_last_dir(), m_workspace_name("MuonAnalysis"), m_currentDataName(""), m_assigned(false), m_groupTableRowInFocus(0), m_pairTableRowInFocus(0), m_tabNumber(0), m_groupNames(), m_groupingTempFilename("tempMuonAnalysisGrouping.xml"), m_settingsGroup("CustomInterfaces/MuonAnalysis/") { } @@ -2777,8 +2777,10 @@ void MuonAnalysis::changeTab(int tabNumber) // If data analysis tab is chosen by user, assign peak picker tool to the current data if not done so already. if (tabNumber == 3) { + m_assigned = false; // Update the peak picker tool with the current workspace. m_uiForm.fitBrowser->updatePPTool(m_currentDataName); + } else { @@ -2797,8 +2799,9 @@ void MuonAnalysis::changeTab(int tabNumber) */ void MuonAnalysis::assignPeakPickerTool(const QString & workspaceName) { - if (m_tabNumber == 3) + if ((m_tabNumber == 3 && !m_assigned) || (m_tabNumber == 3 && m_currentDataName != workspaceName)) { + m_assigned = true; m_currentDataName = workspaceName; emit fittingRequested(m_uiForm.fitBrowser, workspaceName); }