00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
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