MNE-CPP  beta 1.0
formulaeditor.h
Go to the documentation of this file.
1 //=============================================================================================================
37 #ifndef FORMULAEDITOR_H
38 #define FORMULAEDITOR_H
39 //*************************************************************************************************************
40 //=============================================================================================================
41 // INCLUDES
42 //=============================================================================================================
43 
44 
45 
46 //*************************************************************************************************************
47 //=============================================================================================================
48 // Qt INCLUDES
49 //=============================================================================================================
50 
51 #include <QWidget>
52 #include <QtGui>
53 
54 //*************************************************************************************************************
55 //=============================================================================================================
56 // USED NAMESPACES
57 //=============================================================================================================
58 
59 
60 
61 //*************************************************************************************************************
62 //=============================================================================================================
63 // FORWARD DECLARATIONS
64 //=============================================================================================================
65 
66 #define ANZFUNKTKONST 10
67 
68 class AtomPaintWindow;
69 
70 namespace Ui
71 {
72  class Formulaeditor;
73 }
74 
75 class Formulaeditor : public QWidget
76 {
77 
78  Q_OBJECT
79 
80 public:
81 
82  //*********************************************************************************************************
83  //constructor
84  explicit Formulaeditor(QWidget *parent = 0);
85  ~Formulaeditor();
86  //*********************************************************************************************************
87 
88  //========================================================================================================
98  QString get_formula();
99 
100  //========================================================================================================
112  void strip_formula(QString& strFormula);
113 
114  //========================================================================================================
126  void set_formula(QString Formula);
127 
128  //========================================================================================================
141  void set_funct_const(int index, double val);
142 
143  //========================================================================================================
157  double calculation(QString strFormula, qreal xValue, bool strip =true);
158  //========================================================================================================
159 
160 private slots:
161  void on_tb_A_textChanged(const QString &arg1);
162  void on_tb_B_textChanged(const QString &arg1);
163  void on_tb_C_textChanged(const QString &arg1);
164  void on_tb_D_textChanged(const QString &arg1);
165  void on_tb_E_textChanged(const QString &arg1);
166  void on_tb_F_textChanged(const QString &arg1);
167  void on_tb_G_textChanged(const QString &arg1);
168  void on_tb_H_textChanged(const QString &arg1);
169  void on_tb_Formula_textChanged(const QString &arg1);
170  void on_btt_Test_clicked();
171  void on_btt_Save_clicked();
172  void on_dsb_StartValue_editingFinished();
173  void on_dsb_StepWidth_editingFinished();
174 
175 signals:
176  void formula_saved();
177 
178 private:
179  Ui::Formulaeditor *ui;
180  AtomPaintWindow *callAtomPaintWindow;
181 
182  //========================================================================================================
183  // formula methods Copyright: 2004, Ralf Wirtz
184  QString m_strFormula;
185  QString m_strFunction;
186  QString m_strErrortext;
187  QStringList m_strStandardFunction;
188  static QString g_strF;
189  double m_dFktValue;
190  double m_dFunctionConstant[ANZFUNKTKONST];
191 
192  qreal sign_factor(qint32 &nPosition, QString& strCharacter);
193  double expression(int& nPosition, QString& strCharacter);
194  double simple_expression(int& nPosition, QString& strCharacter);
195  double term(int& nPosition, QString& strCharacter);
196  double factor(qint32 &nPosition, QString& strCharacter);
197  double char_n(int& nPosition, QString& strCharacter);
198  QString str_char(QString DecimalZahl);
199 
200  QString get_next_token(QString& strSrc, const QString strDelim);
201  double SINQ(double Winkel_grad);
202  double COSQ(double Winkel_grad);
203  double DEG(double x /* rad */) ;
204  double RAD(double x /* grad */);
205  double cot(double x);
206  long double signl(long double x);
207  double ArSinh(double x);
208  double ArCosh(double x);
209  double ArTanh(double x);
210  double ArCoth(double x);
211  double sqr(double x);
212  void closeEvent(QCloseEvent * event);
213  // end formula methods Copyright: 2004, Ralf Wirtz
214  //========================================================================================================
215 
216 };
217 
218 class AtomPaintWindow : public QWidget
219 {
220  Q_OBJECT
221 
222 protected:
223  void paintEvent(QPaintEvent *event);
224 
225 public:
226  void paint_signal(QList<qreal> valueList, QSize windowSize);
227 
228 };
229 
230 #endif // FORMULAEDITOR_H
231 
void set_formula(QString Formula)
void set_funct_const(int index, double val)
Definition: aboutwindow.h:52
double calculation(QString strFormula, qreal xValue, bool strip=true)
QString get_formula()
void strip_formula(QString &strFormula)