"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/fitdlg.h" between
kpl-4.1.tar.gz and kpl-5.0.tar.gz

About: Kpl is a KDE program for two- and three-dimensional graphical presentation (plots) of data sets and functions. Multidimensional nonlinear parameter and general linear least square parameter fits can be performed.

fitdlg.h  (kpl-4.1):fitdlg.h  (kpl-5.0)
/*************************************************************************** /***************************************************************************
fitdlg.h - description fitdlg.h - description
------------------- -------------------
begin : Tue May 25 1999 begin : Tue May 25 1999
copyright : (C) 2015 by Werner Stille copyright : (C) 2017 by Werner Stille
email : stille@uni-freiburg.de email : kpl@werner-stille.de
***************************************************************************/ ***************************************************************************/
/*************************************************************************** /***************************************************************************
* * * *
* This program is free software; you can redistribute it and/or modify * * This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by * * it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or * * the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. * * (at your option) any later version. *
* * * *
***************************************************************************/ ***************************************************************************/
#ifndef FITDLG_H #ifndef FITDLG_H
#define FITDLG_H #define FITDLG_H
#include <QList> #include <QList>
#include <QVector> #include <QVector>
#include <KDialog> #include <QDialog>
#include "funitem.h" #include "funitem.h"
class QCheckBox; class QCheckBox;
class QDialogButtonBox;
class QLabel; class QLabel;
class QListWidget; class QListWidget;
class QPushButton; class QPushButton;
class ArrayItem; class ArrayItem;
class DoubleEdit; class DoubleEdit;
class KplDoc; class KplDoc;
class LMFit; class LMFit;
class SourceWidget; class SourceWidget;
class SpinBox; class SpinBox;
/** /**
* Correlation matrix dialog class. Provides a dialog for displaying * Correlation matrix dialog class. Provides a dialog for displaying
* the parameter correlation matrix. * the parameter correlation matrix.
*@author Werner Stille *@author Werner Stille
*/ */
class CorrDlg : public KDialog class CorrDlg : public QDialog
{ {
Q_OBJECT Q_OBJECT
public: public:
/** /**
* Constructor. * Constructor.
* @param parent pointer to parent widget. * @param parent pointer to parent widget.
* @param np number of fitted parameters. * @param np number of fitted parameters.
* @param ip array with parameter indices. * @param ip array with parameter indices.
* @param corr np * np matrix with correlation coefficients. * @param corr np * np matrix with correlation coefficients.
*/ */
CorrDlg(QWidget* parent, int np, const int* ip, const double* corr); CorrDlg(QWidget* parent, int np, const int* ip, const double* corr);
/** Destructor. */ /** Destructor. */
~CorrDlg(); ~CorrDlg();
protected slots:
/** Resizes window. */
void slotResize();
}; };
/** /**
* Fit dialog class. Provides a dialog for performing a parameter fit * Fit dialog class. Provides a dialog for performing a parameter fit
* of an ordinary function to a data set of an array. * of an ordinary function to a data set of an array.
*@author Werner Stille *@author Werner Stille
*/ */
class FitDlg : public KDialog class FitDlg : public QDialog
{ {
Q_OBJECT Q_OBJECT
public: public:
/** /**
* Constructor. * Constructor.
* @param parent pointer to parent widget. * @param parent pointer to parent widget.
* @param model pointer to KplDoc model object. * @param model pointer to KplDoc model object.
* @param ad pointer to array item list. * @param ad pointer to array item list.
* @param fd function item list. * @param fd function item list.
* @param mode combination of ShowDlg and AutoFit. * @param mode combination of ShowDlg and AutoFit.
*/ */
FitDlg(QWidget* parent, KplDoc* model, const QList<const ArrayItem*>* ad, FitDlg(QWidget* parent, KplDoc* model, const QList<const ArrayItem*>* ad,
const QList<FunItem*>& fd, int mode); const QList<FunItem*>& fd, int mode);
/** Destructor. */ /** Destructor. */
~FitDlg(); ~FitDlg();
/** Dialog mode flags. */ /** Dialog mode flags. */
enum DlgMode{ShowDlg = 1, AutoFit = 2, SavePar = 4, Follow = 8}; enum DlgMode{ShowDlg = 1, AutoFit = 2, SavePar = 4, Follow = 8};
/** Applies settings. */ /**
void apply(); * Applies settings.
* @param ok true to close the dialog.
*/
void apply(bool ok = false);
public slots:
/** Performs Levenberg-Marquardt fit. */ /** Performs Levenberg-Marquardt fit. */
void fit(); void slotFit();
/** Reimplemented from QDialog. */
virtual void reject();
protected: protected:
/**
* Reimplemented to display help when key F1 is pressed.
* @param e Key event.
*/
virtual void keyPressEvent(QKeyEvent* e);
bool running; bool running;
int ip[FunItem::NumParMax]; int ip[FunItem::NumParMax];
int np, dlgMode; int np, dlgMode;
double corr[FunItem::NumParMax * FunItem::NumParMax]; double corr[FunItem::NumParMax * FunItem::NumParMax];
KplDoc* m; KplDoc* m;
QVector<double> fvec, sig; QVector<double> fvec, sig;
const QList<const ArrayItem*>* ai; const QList<const ArrayItem*>* ai;
QList<FunItem*> fi; QList<FunItem*> fi;
QList<QWidget*> widgetList; QList<QWidget*> widgetList;
LMFit* lm; LMFit* lm;
QListWidget* results; QListWidget* results;
DoubleEdit* eTol; DoubleEdit* eTol;
DoubleEdit* par[FunItem::NumParMax]; DoubleEdit* par[FunItem::NumParMax];
QLabel* lArr; QLabel* lArr;
QLabel* epar[FunItem::NumParMax]; QLabel* epar[FunItem::NumParMax];
QCheckBox* enFit[FunItem::NumParMax]; QCheckBox* enFit[FunItem::NumParMax];
QCheckBox *errCol, *nonLin; QCheckBox *errCol, *nonLin;
SpinBox *sArr, *sItmax; SpinBox *sArr, *sItmax;
QPushButton* showCorr; QPushButton* showCorr;
QPushButton* errMod; QPushButton* errMod;
QDialogButtonBox* buttonBox;
FunItem::DataErrorStruct* err; FunItem::DataErrorStruct* err;
SourceWidget* sw; SourceWidget* sw;
protected slots: protected slots:
/** /**
* Disables/enables error model button. * Disables/enables error model button.
* @param state error column state, disables button when true. * @param state error column state, disables button when true.
*/ */
void errColToggled(bool state); void errColToggled(bool state);
/** /**
* Disables/enables widgets for nonlinear fits. * Disables/enables widgets for nonlinear fits.
* @param on enables widgets when true. * @param on enables widgets when true.
*/ */
void enableNonLin(bool on); void enableNonLin(bool on);
/** Reimplemented from KDialog. */ /**
virtual void slotButtonClicked(int button); * Handles button clicks.
* @param button pointer to button.
*/
void slotButtonClicked(QAbstractButton* button);
/** Displays parameter correlation matrix. */ /** Displays parameter correlation matrix. */
void slotCorr(); void slotCorr();
/** Displays the dialog for setting the calculation of error bars. */ /** Displays the dialog for setting the calculation of error bars. */
void slotErrMod(); void slotErrMod();
/** Displays the dialog for selection of a parameter file to read. */ /** Displays the dialog for selection of a parameter file to read. */
void slotGetParameter(); void slotGetParameter();
/** /**
* Displays message line in listbox. * Displays message line in listbox.
* @param msg message text. * @param msg message text.
*/ */
void slotMessage(const QString& msg); void slotMessage(const QString& msg);
/** Plots residuals. */
void slotResiduals();
/** Restores window size. */
void slotRestoreSize();
/** Displays the dialog for selection of a parameter file to save. */ /** Displays the dialog for selection of a parameter file to save. */
void slotSaveParameter(); void slotSaveParameter();
/** Updates display for selected array in data error settings. */ /** Updates display for selected array in data error settings. */
void updArray(); void updArray();
}; };
#endif #endif
 End of changes. 12 change blocks. 
10 lines changed or deleted 35 lines changed or added

Home  |  About  |  All  |  Newest  |  Fossies Dox  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTPS