UltraScan III
us_fematch.h
Go to the documentation of this file.
1 #ifndef US_FEMATCH_H
2 #define US_FEMATCH_H
3 
4 #include "us_resids_bitmap.h"
5 #include "us_plot_control_fem.h"
6 #include "us_advanced_fem.h"
7 #include "us_dmga_mc_stats.h"
8 #include "us_noise_loader.h"
9 #include "us_resplot_fem.h"
10 #include "us_dataIO.h"
11 #include "us_db2.h"
12 #include "us_astfem_rsa.h"
13 #include "us_model.h"
14 #include "us_noise.h"
15 #include "us_model_loader.h"
16 #include "us_editor.h"
17 #include "us_math2.h"
18 #include "us_run_details2.h"
19 #include "us_buffer_gui.h"
20 #include "us_analyte.h"
21 #include "us_solution.h"
22 #include "qwt_plot_marker.h"
23 
24 #ifndef DbgLv
25 #define DbgLv(a) if(dbg_level>=a)qDebug()
26 #endif
27 
28 #ifndef SP_SPEEDPROFILE
29 #define SP_SPEEDPROFILE US_SimulationParameters::SpeedProfile
30 #endif
31 
32 class US_FeMatch : public US_Widgets
33 {
34  Q_OBJECT
35 
36  public:
37  US_FeMatch();
38 
41  QList< int >* fem_excllist();
45  QPointer< US_ResidsBitmap > fem_resbmap();
46 
47  public slots:
48  void thread_progress( int, int );
49  void thread_complete( int );
50  void simulate( void );
51 
52  private:
53 
54  QLabel* lb_tolerance;
55  QLabel* lb_division;
56  QLabel* lb_rmsd;
57 
58  QLineEdit* le_id;
59  QLineEdit* le_temp;
60  QLineEdit* le_solution;
61  QLineEdit* le_density;
62  QLineEdit* le_viscosity;
63  QLineEdit* le_vbar;
64  QLineEdit* le_compress;
65  QLineEdit* le_rmsd;
66  QLineEdit* le_variance;
67 
68  QTextEdit* te_desc;
69 
70  QCheckBox* ck_edit;
71 
72  QRadioButton* rb_curmod;
73  QRadioButton* rb_mean;
74  QRadioButton* rb_median;
75  QRadioButton* rb_mode;
76 
77  QPushButton* pb_nextm;
78 
79  QwtCounter* ct_model;
80  QwtCounter* ct_from;
81  QwtCounter* ct_to;
82 
83  QwtPlotCurve* curve;
84  QwtPlotCurve* dcurve;
86 
88 
89  QPushButton* pb_load;
90  QPushButton* pb_details;
91  QPushButton* pb_solution;
92  QPushButton* pb_view;
93  QPushButton* pb_save;
94  QPushButton* pb_distrib;
95  QPushButton* pb_advanced;
96  QPushButton* pb_adv_dmga;
97  QPushButton* pb_plot3d;
98  QPushButton* pb_plotres;
99  QPushButton* pb_reset;
100  QPushButton* pb_help;
101  QPushButton* pb_close;
102  QPushButton* pb_rmsd;
103  QPushButton* pb_exclude;
104  QPushButton* pb_reset_exclude;
105  QPushButton* pb_loadmodel;
106  QPushButton* pb_simumodel;
107 
108  QListWidget* lw_triples;
109 
112  int nthread;
113  int thrdone;
114  int mc_iters;
115 
117  bool haveSim;
120  bool cnstvb;
121  bool cnstff;
122  bool exp_steps;
124 
125  QString run_name;
126  QString cell;
127  QString wavelength;
128  QString workingDir;
129  QString runID;
130  QString editID;
131  QString dfilter;
132  QString mfilter;
133 
134  QStringList files;
135 
140 
142 
149  QList< US_Model > models;
150 
151  QVector< SP_SPEEDPROFILE > speed_steps;
152 
153  QPointer< US_ResidsBitmap > rbmapd;
154  QPointer< US_PlotControlFem > eplotcd;
155  QPointer< US_ResidPlotFem > resplotd;
156  QPointer< US_AdvancedFem > advdiag;
157 
158  QPoint bmd_pos;
159  QPoint epd_pos;
160  QPoint rpd_pos;
161 
162  QDateTime start_time;
163 
164  QMap< QString, QString > adv_vals;
165 
166  QVector< int > kcomps;
167 
168  QList< US_DataIO::RawData > tsimdats;
169  QList< US_Model > tmodels;
171  QVector< US_Model > imodels;
172 
173  private slots:
174 
175  void load( void );
176  void data_plot( void );
177  void save_data( void );
178  void details( void );
179  void reset( void );
180  void advanced( void );
181  void adv_dmga( void );
182  void plot3d( void );
183  void plotres( void );
184  void update( int );
185  void load_model( void );
186  void distrib_type( void );
187  void simulate_model( void );
188  void view_report( void );
189  void exclude ( void );
190  void adjust_model( void );
191  void reset_excludes( void );
192  void exclude_from( double );
193  void exclude_to ( double );
194  void comp_number ( double );
195  void component_values( int );
196  QStringList last_edit_files( QStringList );
197  int type_distrib( void );
198 
199  void distrib_plot_stick( int );
200  void distrib_plot_2d( int );
201  void distrib_plot_resids( void );
202 
203  void load_noise( void );
204  double interp_sval( double, double*, double*, int );
205  void write_report( QTextStream& );
206  QString indent ( int ) const;
207  QString text_model( US_Model, int );
208  double calc_baseline( int ) const;
209  void calc_residuals( void );
210  void close_all( void );
211  QString table_row( const QString&, const QString& ) const;
212  QString table_row( const QString&, const QString&,
213  const QString& ) const;
214  QString table_row( const QString&, const QString&,
215  const QString&, const QString&,
216  const QString& ) const;
217  QString table_row( const QString&, const QString&,
218  const QString&, const QString&,
219  const QString&, const QString&,
220  const QString& ) const;
221  QString html_header ( QString, QString, US_DataIO::EditedData* );
222  QString data_details ( void ) const;
223  QString hydrodynamics ( void ) const;
224  QString scan_info ( void ) const;
225  QString distrib_info ( void );
226  void model_table ( QString );
227  void set_progress ( const QString );
228  void update_disk_db( bool );
229  void write_plot ( const QString&, const QwtPlot* );
230  bool mkdir ( const QString&, const QString& );
231  void new_triple ( int );
232  void get_solution ( void );
233  void updateSolution( US_Solution );
234  void update_progress( int );
235  void reportFilesToDB( QStringList& );
236  void show_results ( void );
237  void update_filelist( QStringList&, const QString );
238  void curmod_clicked ( bool );
239  void modbtn_clicked ( bool );
240  void next_model ( void );
241  void update_mc_model( void );
242 
243  void help ( void )
244  { showHelp.show_help( "fe_match.html" ); };
245 
246  protected:
247  QList< int > excludedScans;
248  QStringList triples;
249  QVector< US_DataIO::EditedData > dataList;
250  QVector< US_DataIO::RawData > rawList;
251  QVector< QVector< double > > resids;
252  QVector< QList< int > > allExcls;
253 
255 
257 
258  double density;
259  double viscosity;
260  double vbar;
261  double compress;
262 
263  bool manual;
264 
265  // Layouts
266  QBoxLayout* mainLayout;
267  QBoxLayout* leftLayout;
268  QBoxLayout* rightLayout;
269  QBoxLayout* buttonLayout;
270  QBoxLayout* progressLayout;
271 
272  QGridLayout* analysisLayout;
273  QGridLayout* runInfoLayout;
274  QGridLayout* parameterLayout;
275  QGridLayout* controlsLayout;
276 
277  QProgressBar* progress;
278 
279  US_Plot* plotLayout1; // Derived from QVBoxLayout
281 
282  // Widgets
283  QwtPlot* data_plot1;
284  QwtPlot* data_plot2;
285 };
286 #endif