UltraScan III
us_sassoc.h
Go to the documentation of this file.
1 #ifndef US_SASSOC_H
3 #define US_SASSOC_H
4 
5 #include <QtGui>
6 
7 #include <qwt_counter.h>
8 #include <qwt_plot_curve.h>
9 
10 #include "us_extern.h"
11 #include "us_widgets.h"
12 #include "us_plot.h"
13 #include "us_help.h"
14 
16 #define ARRAY_SIZE 555
17 
21 
23 {
24  Q_OBJECT
25 
26  public:
27 
41  US_Sassoc( double, double, double, double,
42  const QString&, int, bool,
43  bool = true, QWidget* = 0, Qt::WindowFlags = 0 );
44 
45  private:
46  double eq [ 2 ];
47  double stoich[ 2 ];
48  QString project;
49  int model;
50 
51  double x [ ARRAY_SIZE ];
52  double species1[ ARRAY_SIZE ];
53  double species2[ ARRAY_SIZE ];
54  double species3[ ARRAY_SIZE ];
55 
56  bool updating;
57 
58  QwtPlot* plot;
59 
60  QwtPlotCurve* curve1;
61  QwtPlotCurve* curve2;
62  QwtPlotCurve* curve3;
63 
64  QwtCounter* c_equil1;
65  QwtCounter* c_equil2;
66 
67  QLineEdit* le_species1;
68  QLineEdit* le_species2;
69  QLineEdit* le_species3;
70  QLineEdit* le_conc;
71  QLineEdit* le_assoc1;
72  QLineEdit* le_assoc2;
73  QLineEdit* le_equil1;
74  QLineEdit* le_equil2;
75 
77 
79 
80  QwtPlotPicker* pick;
81 
82  void recalc ( void );
83  double monomer_root ( double );
84  double polynomial ( double, double );
85  void update_legend ( double );
86 
87  private slots:
88  void new_value ( const QwtDoublePoint& );
89  void mouseD ( const QwtDoublePoint& );
90  void mouseU ( const QwtDoublePoint& );
91  void update_stoich1 ( const QString& );
92  void update_stoich2 ( const QString& );
93  void update_eq1 ( const QString& );
94  void update_eq2 ( const QString& );
95  void update_eq1Count( double );
96  void update_eq2Count( double );
97  void save ( void );
98 
99  void help ( void )
100  { showHelp.show_help( "manual/sassoc.html" ); };
101 };
102 #endif
103 
104 #ifdef NEVER
105 #include "us_util.h"
106 #include "us_pixmap.h"
107 #include "us_math.h"
108 #include "us_selectplot.h"
109 #include "us_printfilter.h"
110 
111 
112 class US_SassocLegend : public QFrame
113 {
114  Q_OBJECT
115 
116  public:
117 
118  US_SassocLegend(QWidget *p=0 , const char *name=0);
119  ~US_SassocLegend();
120  US_Config *USglobal;
121 
122  int xpos, buttonh, column1, column2, ypos, spacing, border;
123  QLabel *lbl_species1a;
124  QLabel *lbl_species2a;
125  QLabel *lbl_species3a;
126  QLabel *lbl_species4a;
127  QLabel *lbl_species1b;
128  QLabel *lbl_species2b;
129  QLabel *lbl_species3b;
130  QLabel *lbl_species4b;
131  QLabel *lbl_instructions;
132  void setup_GUI();
133 };
134 
135 class US_GUI_EXTERN US_Sassoc : public QFrame
136 {
137  Q_OBJECT
138 
139  public:
140 
141  US_Sassoc( float, float, float, float, QString, int, bool, QWidget *p=0 , const char *name=0);
142  ~US_Sassoc();
143 
144  QwtPlot *data_plot;
145  QLabel *lbl_banner1;
146  QLabel *lbl_banner2;
147  QLabel *lbl_banner3;
148  QLabel *lbl_banner4;
149  QLabel *lbl_banner5;
150  QLabel *lbl_eq1;
151  QLabel *lbl_eq2;
152  QLabel *lbl_stoich1;
153  QLabel *lbl_stoich2;
154  QLabel *lbl_project;
155 
156  QTextEdit *mle_model;
157  QPushButton *pb_cancel;
158  QPushButton *pb_write;
159  QPushButton *pb_help;
160  QPushButton *pb_print;
161  QPushButton *pb_recalc;
162  QwtCounter *cnt_eq1;
163  QwtCounter *cnt_eq2;
164  QLineEdit *le_stoich1;
165  QLineEdit *le_stoich2;
166  QLineEdit *le_eq1;
167  QLineEdit *le_eq2;
168  QPoint point;
169  US_SassocLegend *sas_l;
170  US_Pixmap *pm;
171 
172  private:
173 
174  int xpos, buttonh, buttonw, ypos, spacing, border, model;
175  unsigned int ARRAY_SIZE;
176  unsigned int curve[3];
177  double **data;
178  QString htmlDir;
179 
180  protected slots:
181  void setup_GUI();
182  void closeEvent(QCloseEvent *);
183 // void resizeEvent(QResizeEvent *e);
184  void mouseMoved(const QMouseEvent &e);
185  void mousePressed(const QMouseEvent &e);
186  void mouseReleased(const QMouseEvent &e);
187 
188  public slots:
189 
190  void print();
191  void recalc();
192  bool createHtmlDir();
193  void write_data();
194  void help();
195  void cancel();
196  double monomer_root(double);
197  double polynomial(double, double);
198  void update_stoich1(const QString &);
199  void update_stoich2(const QString &);
200  void update_eq1(const QString &);
201  void update_eq2(const QString &);
202  void update_eq1Count(double);
203  void update_eq2Count(double);
204 };
205 
206 #endif
207