00001
00002
00003
00004
00005
00006
00007 #ifndef FITTING_WINDOW_H
00008 #define FITTING_WINDOW_H
00009
00010 #include "DocumentModelExportFormat.h"
00011 #include "FittingCurveCoefficients.h"
00012 #include "FittingPointsConvenient.h"
00013 #include <QVector>
00014 #include "WindowAbstractBase.h"
00015
00016 class CmdMediator;
00017 class Curve;
00018 class FittingModel;
00019 class MainWindow;
00020 class MainWindowModel;
00021 class Matrix;
00022 class QComboBox;
00023 class QItemSelection;
00024 class QLabel;
00025 class QLineEdit;
00026 class QString;
00027 class QTableView;
00028 class Transformation;
00029
00034 class FittingWindow : public WindowAbstractBase
00035 {
00036 Q_OBJECT;
00037
00038 public:
00040 FittingWindow (MainWindow *mainWindow);
00041 virtual ~FittingWindow ();
00042
00043 virtual void clear ();
00044 virtual void closeEvent(QCloseEvent *event);
00045 virtual void doCopy ();
00046 virtual void update (const CmdMediator &cmdMediator,
00047 const MainWindowModel &modelMainWindow,
00048 const QString &curveSelected,
00049 const Transformation &transformation);
00050 virtual QTableView *view () const;
00051
00052 private slots:
00053
00055 void slotCmbOrder(int index);
00056
00057 signals:
00058
00060 void signalCurveFit(FittingCurveCoefficients, double, double, bool, bool);
00061
00063 void signalFittingWindowClosed();
00064
00065 private:
00066 FittingWindow();
00067
00068 void calculateCurveFitAndStatistics ();
00069 void createWidgets(MainWindow *mainWindow);
00070 void initializeOrder ();
00071 int maxOrder () const;
00072 void refreshTable ();
00073 void resizeTable (int order);
00074
00075 QComboBox *m_cmbOrder;
00076 QLabel *m_labelY;
00077 QTableView *m_view;
00078 FittingModel *m_model;
00079 QLineEdit *m_lblMeanSquareError;
00080 QLineEdit *m_lblRootMeanSquare;
00081 QLineEdit *m_lblRSquared;
00082
00083 QString m_curveSelected;
00084 bool m_isLogXTheta;
00085 bool m_isLogYRadius;
00086 FittingPointsConvenient m_pointsConvenient;
00087
00088
00089 QVector<double> m_coefficients;
00090
00091
00092 DocumentModelExportFormat m_modelExport;
00093 };
00094
00095 #endif // FITTING_WINDOW_H