UltraScan III
us_astfem_sim.h
Go to the documentation of this file.
1 #ifndef US_ASTFEM_SIM_H
3 #define US_ASTFEM_SIM_H
4 
5 #include <QtGui>
6 
7 #include <qwt_plot.h>
8 #include <qwt_counter.h>
9 
10 #include "us_widgets.h"
11 #include "us_plot.h"
12 #include "us_model.h"
13 #include "us_simparms.h"
14 #include "us_help.h"
15 #include "us_astfem_rsa.h"
16 #include "us_lamm_astfvm.h"
17 #include "us_buffer.h"
18 #include "us_dataIO.h"
19 
20 #ifndef DbgLv
21 #define DbgLv(a) if(dbg_level>=a)qDebug()
22 #endif
23 
26 class US_Astfem_Sim : public US_Widgets
27 {
28  Q_OBJECT
29 
30  public:
33  US_Astfem_Sim( QWidget* = 0, Qt::WindowFlags = 0 );
34 
35  private:
36  bool stopFlag;
37  bool movieFlag;
38  bool save_movie;
40  double total_conc;
43  int dbg_level;
44  QString imagedir;
45  QString imageName;
46 
47  QCheckBox* ck_movie;
48  QCheckBox* ck_savemovie;
49  QCheckBox* ck_timeCorr;
50 
51  QPushButton* pb_saveExp;
52  QPushButton* pb_saveSim;
53  QPushButton* pb_buffer;
54  QPushButton* pb_simParms;
55  QPushButton* pb_changeModel;
56  QPushButton* pb_start;
57  QPushButton* pb_stop;
58 
59  QTextEdit* te_status;
60 
61  QLabel* lb_component;
62  QLabel* lb_progress;
63 
64  QLCDNumber* lcd_time;
65  QLCDNumber* lcd_speed;
66  QLCDNumber* lcd_component;
67  QProgressBar* progress;
68 
69  QwtPlot* moviePlot;
70  QwtPlot* scanPlot;
71 
74 
76 
77  QString progress_text;
80 
88 
89  void init_simparams ( void );
90  void save_xla ( const QString& );
91  void save_ultrascan ( const QString& );
92  void finish ( void );
93  void ri_noise ( void );
94  void random_noise ( void );
95  void ti_noise ( void );
96  void plot ( void );
97 
98 // debug
99  void dump_system ( void );
100  void dump_simparms ( void );
101  void dump_astfem_data( void );
107 
108  private slots:
109  void new_model ( void );
110  void change_model ( US_Model );
111  void new_buffer ( void );
112  void change_buffer ( US_Buffer );
113  void change_status ( void );
114  void set_parameters ( void );
115  void sim_parameters ( void );
116  void start_simulation( void );
117  void stop_simulation ( void );
118  void save_scans ( void );
119  void update_progress ( int );
120  void update_component( int );
121  void start_calc ( int );
122  void show_progress ( int );
123  void calc_over ( void );
124 
125  void update_movie_plot( QVector< double >*, double* );
126  void update_save_movie( bool );
127 
128  void update_time ( double time )
129  { lcd_time ->display( (int)time ); };
130 
131  void update_speed ( int speed )
132  { lcd_speed->display( (int) speed ); };
133 
134  void help ( void )
135  { showhelp.show_help( "manual/astfem_sim.html" ); };
136 
137  void update_time_corr( void )
138  { time_correctionFlag = ck_timeCorr->isChecked(); };
139 };
140 #endif
141