"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/kdefrontend/dockwidgets/XYFitCurveDock.cpp" between
labplot-2.8.1.tar.gz and labplot-2.8.2.tar.gz

About: LabPlot is an application for plotting and analysis of 2D and 3D functions and data. It is a complete rewrite of LabPlot1 and lacks in the first release a lot of features available in the predecessor. On the other hand, the GUI and the usability is more superior.

XYFitCurveDock.cpp  (labplot-2.8.1):XYFitCurveDock.cpp  (labplot-2.8.2)
skipping to change at line 926 skipping to change at line 926
* Update parameter by parsing expression * Update parameter by parsing expression
* Only called for custom fit model * Only called for custom fit model
*/ */
void XYFitCurveDock::updateParameterList() { void XYFitCurveDock::updateParameterList() {
DEBUG("XYFitCurveDock::updateParameterList()"); DEBUG("XYFitCurveDock::updateParameterList()");
// use current model function // use current model function
m_fitData.model = uiGeneralTab.teEquation->toPlainText(); m_fitData.model = uiGeneralTab.teEquation->toPlainText();
ExpressionParser* parser = ExpressionParser::getInstance(); ExpressionParser* parser = ExpressionParser::getInstance();
QStringList vars; // variables that are known QStringList vars; // variables that are known
vars << "x"; //TODO: others? vars << "x"; //TODO: generalize when we support other XYEquationCurve: :EquationType
m_fitData.paramNames = m_fitData.paramNamesUtf8 = parser->getParameter(m_ fitData.model, vars); m_fitData.paramNames = m_fitData.paramNamesUtf8 = parser->getParameter(m_ fitData.model, vars);
// if number of parameter changed // if number of parameter changed
int oldNumberOfParameter = m_fitData.paramStartValues.size(); int oldNumberOfParameter = m_fitData.paramStartValues.size();
int numberOfParameter = m_fitData.paramNames.size(); int numberOfParameter = m_fitData.paramNames.size();
DEBUG(" old number of parameter: " << oldNumberOfParameter << " new numbe r of parameter: " << numberOfParameter); DEBUG(" old number of parameter: " << oldNumberOfParameter << " new numbe r of parameter: " << numberOfParameter);
if (numberOfParameter != oldNumberOfParameter) { if (numberOfParameter != oldNumberOfParameter) {
m_fitData.paramStartValues.resize(numberOfParameter); m_fitData.paramStartValues.resize(numberOfParameter);
m_fitData.paramFixed.resize(numberOfParameter); m_fitData.paramFixed.resize(numberOfParameter);
m_fitData.paramLowerLimits.resize(numberOfParameter); m_fitData.paramLowerLimits.resize(numberOfParameter);
skipping to change at line 958 skipping to change at line 958
parametersChanged(); parametersChanged();
} }
/*! /*!
* called when parameter names and/or start values for the model were changed * called when parameter names and/or start values for the model were changed
* also called from parameter widget * also called from parameter widget
*/ */
void XYFitCurveDock::parametersChanged(bool updateParameterWidget) { void XYFitCurveDock::parametersChanged(bool updateParameterWidget) {
DEBUG("XYFitCurveDock::parametersChanged() m_initializing = " << m_initia lizing); DEBUG("XYFitCurveDock::parametersChanged() m_initializing = " << m_initia lizing);
//parameter names were (probably) changed -> set the new names in Equatio //parameter names were (probably) changed -> set the new vars in Expressi
nTextEdit onTextEdit teEquation
uiGeneralTab.teEquation->setVariables(m_fitData.paramNames); QStringList vars{m_fitData.paramNames};
vars << "x"; //TODO: generalize when we support other XYEquationCurve:
:EquationType
uiGeneralTab.teEquation->setVariables(vars);
if (m_initializing) if (m_initializing)
return; return;
if (updateParameterWidget) if (updateParameterWidget)
fitParametersWidget->setFitData(&m_fitData); fitParametersWidget->setFitData(&m_fitData);
enableRecalculate(); enableRecalculate();
} }
void XYFitCurveDock::parametersValid(bool valid) { void XYFitCurveDock::parametersValid(bool valid) {
 End of changes. 2 change blocks. 
4 lines changed or deleted 7 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)