FitDialog.h

Go to the documentation of this file.
00001 /***************************************************************************
00002     File                 : FitDialog.h
00003     Project              : QtiPlot
00004     --------------------------------------------------------------------
00005     Copyright            : (C) 2006 by Ion Vasilief, Tilman Hoener zu Siederdissen
00006     Email (use @ for *)  : ion_vasilief*yahoo.fr, thzs*gmx.net
00007     Description          : Fit Wizard
00008 
00009  ***************************************************************************/
00010 
00011 /***************************************************************************
00012  *                                                                         *
00013  *  This program is free software; you can redistribute it and/or modify   *
00014  *  it under the terms of the GNU General Public License as published by   *
00015  *  the Free Software Foundation; either version 2 of the License, or      *
00016  *  (at your option) any later version.                                    *
00017  *                                                                         *
00018  *  This program is distributed in the hope that it will be useful,        *
00019  *  but WITHOUT ANY WARRANTY; without even the implied warranty of         *
00020  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the          *
00021  *  GNU General Public License for more details.                           *
00022  *                                                                         *
00023  *   You should have received a copy of the GNU General Public License     *
00024  *   along with this program; if not, write to the Free Software           *
00025  *   Foundation, Inc., 51 Franklin Street, Fifth Floor,                    *
00026  *   Boston, MA  02110-1301  USA                                           *
00027  *                                                                         *
00028  ***************************************************************************/
00029 #ifndef FITDIALOG_H
00030 #define FITDIALOG_H
00031 
00032 #include "Graph.h"
00033 
00034 class QPushButton;
00035 class QLineEdit;
00036 class QComboBox;
00037 class QStackedWidget;
00038 class QWidget;
00039 class QTextEdit;
00040 class QListWidget;
00041 class QCheckBox;
00042 class QTableWidget;
00043 class QSpinBox;
00044 class QLabel;
00045 class QRadioButton;
00046 class QLineEdit;
00047 class ColorBox;
00048 class Fit;
00049 
00051 class FitDialog : public QDialog
00052 {
00053     Q_OBJECT
00054 
00055 public:
00056     FitDialog(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0 );
00057 
00058 protected:
00059     void closeEvent (QCloseEvent * e );
00060     void initFitPage();
00061     void initEditPage();
00062     void initAdvancedPage();
00063 
00064 public slots:
00065     void accept();
00066     void insertFunctionsList(const QStringList& list);
00067     void clearUserList();
00069     void resetFunction();
00070     void showFitPage();
00071     void showEditPage();
00072     void showAdvancedPage();
00073     void showFunctionsList(int category);
00074     void showParseFunctions();
00075     void showUserFunctions();
00076     void loadPlugins();
00077     void showExpression(int function);
00078     void addFunction();
00079     void addFunctionName();
00080     void setFunction(bool ok);
00081     void saveUserFunction();
00082     void removeUserFunction();
00083     void setBuiltInFunctionNames();
00084     void setBuiltInFunctions();
00085     bool containsUserFunctionName(const QString& s);
00086     void setGraph(Graph *g);
00087     void activateCurve(const QString& curveName);
00088     void choosePluginsFolder();
00089     bool validInitialValues();
00090     void changeDataRange();
00091     void fitBuiltInFunction(const QString& function, double* initVal);
00092 
00093     void setSrcTables(QWidgetList* tables);
00094     void selectSrcTable(int tabnr);
00095     void enableWeightingParameters(int index);
00096     void showPointsBox(bool);
00097     void showParametersTable();
00098     void showCovarianceMatrix();
00099 
00101     void applyChanges();
00102 
00104     void deleteFitCurves();
00105 
00106 private slots:
00108     void enableApplyChanges(int = 0);
00109 
00110 signals:
00111     void clearFunctionsList();
00112     void saveFunctionsList(const QStringList&);
00113 
00114 private:
00115     int d_param_table_rows;
00116     Fit *fitter;
00117     Graph *graph;
00118     QStringList userFunctions, userFunctionNames, userFunctionParams;
00119     QStringList builtInFunctionNames, builtInFunctions;
00120     QStringList pluginFunctionNames, pluginFunctions, pluginFilesList, pluginParameters;
00121     QWidgetList *srcTables;
00122 
00123     QCheckBox* boxUseBuiltIn;
00124     QStackedWidget* tw;
00125     QPushButton* buttonOk;
00126     QPushButton* buttonCancel1;
00127     QPushButton* buttonCancel2;
00128     QPushButton* buttonCancel3;
00129     QPushButton* buttonAdvanced;
00130     QPushButton* buttonClear;
00131     QPushButton* buttonClearUsrList;
00132     QPushButton* buttonPlugins;
00133     QPushButton* btnBack;
00134     QComboBox* boxCurve;
00135     QComboBox* boxAlgorithm;
00136     QTableWidget* boxParams;
00137     QLineEdit* boxFrom;
00138     QLineEdit* boxTo;
00139     QLineEdit* boxTolerance;
00140     QSpinBox* boxPoints, *generatePointsBox, *boxPrecision, *polynomOrderBox;
00141     QWidget *fitPage, *editPage, *advancedPage;
00142     QTextEdit *editBox, *explainBox, *boxFunction;
00143     QListWidget *categoryBox, *funcBox;
00144     QLineEdit *boxName, *boxParam;
00145     QLabel *lblFunction, *lblPoints, *polynomOrderLabel;
00146     QPushButton *btnAddFunc, *btnDelFunc, *btnContinue, *btnApply;
00147     QPushButton *buttonEdit, *btnAddTxt, *btnAddName, *btnDeleteFitCurves;
00148     ColorBox* boxColor;
00149     QComboBox *boxWeighting, *tableNamesBox, *colNamesBox;
00150     QRadioButton *generatePointsBtn, *samePointsBtn;
00151     QPushButton *btnParamTable, *btnCovMatrix;
00152     QLineEdit *covMatrixName, *paramTableName;
00153     QCheckBox *plotLabelBox, *logBox, *scaleErrorsBox;
00154 };
00155 
00156 #endif // FITDIALOG_H

Generated on Mon Oct 15 06:11:41 2007 for QtiPlot by  doxygen 1.5.3