UltraScan III
us_edit.h
Go to the documentation of this file.
1 #ifndef US_EDIT_H
2 #define US_EDIT_H
3 
4 #include <QtGui>
5 
6 #include "qwt_plot_marker.h"
7 
8 #include "us_extern.h"
9 #include "us_widgets.h"
10 #include "us_help.h"
11 #include "us_plot.h"
12 #include "us_dataIO.h"
13 #include "us_db2.h"
14 #include "us_mwl_data.h"
15 
16 class US_Edit : public US_Widgets
17 {
18  Q_OBJECT
19 
20  public:
21  US_Edit();
22 
23  private:
24 
26 
27  class Edits
28  {
29  public:
30  int scan;
31  QList< QPointF > changes;
32  };
33 
34  QList< Edits > changed_points;
37  QList< US_DataIO::SpeedData > sData;
38  QVector< US_DataIO::RawData > allData;
39  QVector< US_DataIO::RawData* > outData;
40 
42 
44  bool spikes;
46  bool expIsVelo;
47  bool expIsEquil;
48  bool expIsDiff;
49  bool expIsOther;
50  bool all_edits;
51  bool men_1click;
52 
58  int dbg_level;
59 
60  double meniscus;
61  double meniscus_left;
62  double airGap_left;
63  double airGap_right;
64  double range_left;
65  double range_right;
66  double baseline;
67  double invert;
68  double plateau;
69 
70  QChar chlamb;
71 
72  QList< int > sd_offs; // Speed data offsets, ea. triple
73  QList< int > sd_knts; // Speed data counts, ea. triple
74  QList< int > includes; // Scan includes, current triple
75  QList< double > residuals; // Noise residuals, current triple
76  QVector< QString > editGUIDs; // Edit GUIDs, ea. i/p triple
77  QVector< QString > editIDs; // Edit DB IDs, ea. i/p triple
78  QVector< QString > editFnames; // Edit file names, ea. i/p triple
79 
81 
82  QIcon check;
83 
84  QString workingDir;
85  QString runID;
86  QString editLabel;
87  QString dataType;
88  QString expType;
89  QStringList files;
90  QStringList triples;
91  QStringList trip_rpms;
92  QStringList celchns;
93  QStringList rawc_wvlns;
94  QStringList expc_wvlns;
95  QStringList expc_radii;
96 
97  QwtPlot* data_plot;
98  QwtPlotCurve* raw_curve;
99  QwtPlotCurve* fit_curve;
100  QwtPlotCurve* v_line;
101  QwtPlotCurve* minimum_curve;
102  QwtPlotGrid* grid;
103  QwtPlotMarker* marker;
106 
107  QLabel* lb_edtrsp;
108  QLabel* lb_gaps;
109  QLabel* lb_rpms;
110  QLabel* lb_triple;
111  QLabel* lb_baseline;
112 
113  QLineEdit* le_investigator;
114  QLineEdit* le_info;
115  QLineEdit* le_meniscus;
116  QLineEdit* le_airGap;
117  QLineEdit* le_dataRange;
118  QLineEdit* le_plateau;
119  QLineEdit* le_baseline;
120  QLineEdit* le_edtrsp;
121 
122  QPushButton* pb_details;
123  QPushButton* pb_exclude;
124  QPushButton* pb_excludeRange;
125  QPushButton* pb_exclusion;
126  QPushButton* pb_include;
127  QPushButton* pb_edit1;
128  QPushButton* pb_meniscus;
129  QPushButton* pb_airGap;
130  QPushButton* pb_dataRange;
131  QPushButton* pb_plateau;
132  QPushButton* pb_noise;
133  QPushButton* pb_spikes;
134  QPushButton* pb_invert;
135  QPushButton* pb_write;
136  QPushButton* pb_residuals;
137  QPushButton* pb_priorEdits;
138  QPushButton* pb_reviewep;
139  QPushButton* pb_nexttrip;
140  QPushButton* pb_float;
141  QPushButton* pb_undo;
142 
144 
145  QComboBox* cb_triple;
146  QComboBox* cb_rpms;
147 
148  QwtCounter* ct_from;
149  QwtCounter* ct_to;
150  QwtCounter* ct_noise;
151  QwtCounter* ct_gaps;
152 
153  // MWL Controls - only shown if multi-wavelength data
154  QLabel* lb_mwlctl;
155  QLabel* lb_ldelta;
156  QLabel* lb_lstart;
157  QLabel* lb_lend;
158  QLabel* lb_lplot;
159  QLabel* lb_odlim;
160 
161  QwtCounter* ct_ldelta;
162  QwtCounter* ct_odlim;
163 
164  QLineEdit* le_lxrng;
165  QLineEdit* le_ltrng;
166 
167  QComboBox* cb_lplot;
168  QComboBox* cb_lstart;
169  QComboBox* cb_lend;
170 
171  QPushButton* pb_larrow;
172  QPushButton* pb_rarrow;
173  QPushButton* pb_custom;
174  QPushButton* pb_incall;
175 
176  QRadioButton* rb_lrange;
177  QRadioButton* rb_custom;
178  QRadioButton* rb_radius;
179  QRadioButton* rb_waveln;
180 
181  QCheckBox* ck_writemwl;
182 
183  QGridLayout* lo_lrange;
184  QGridLayout* lo_custom;
185  QGridLayout* lo_radius;
186  QGridLayout* lo_waveln;
187  QGridLayout* lo_writemwl;
188 
189  bool isMwl;
193 
194  int dlambda;
195  int slambda;
196  int elambda;
197  int plotrec;
198  int plotndx;
199  int nwaveln;
200  int nwavelo;
201  int maxwavl;
202  int nrpoint;
203  int ncelchn;
204  int ntriple;
205 
206  double odlimit;
207 
209 
210  QVector< double > expd_radii;
211  QVector< int > expi_wvlns;
212  QVector< int > rawi_wvlns;
213  QVector< int > toti_wvlns;
214 
215  QVector< QVector< int > > wavelns_i;
216 
217  QVector< QVector< double > > rdata;
218 
219  // Private slots
220  void set_pbColors ( QPushButton* );
221  void draw_vline ( double );
222  void next_step ( void );
223  void gap_check ( void );
224 
225  void replot ( void );
226  void plot_current ( void );
227  void plot_all ( void );
228  void plot_range ( void );
229  void plot_last ( void );
230  void plot_current ( int );
231  void plot_scan ( void );
232  void plot_mwl ( void );
233  void init_includes ( void );
234 
235  void reset_excludes ( void );
236  void set_colors ( const QList< int >& );
237 
238  private slots:
239  void load ( void );
240  void details ( void );
241  void new_triple ( int );
242  void new_rpmval ( int );
243 
244  void focus_from ( double );
245  void focus_to ( double );
246  void focus ( int, int );
247 
248  void exclude_range ( void );
249  void exclusion ( void );
250  void update_excludes ( QList< int > );
251  void finish_excludes ( QList< int > );
252  void cancel_excludes ( void );
253  void edit_scan ( void );
254  void update_scan ( QList< QPointF > );
255  void include ( void );
256  void apply_prior ( void );
257  void prior_equil ( void );
258 
259  void sel_investigator ( void );
260  void set_fringe_tolerance( double );
261  void set_meniscus ( void );
262  void set_airGap ( void );
263  void set_dataRange ( void );
264  void set_plateau ( void );
265  void mouse ( const QwtDoublePoint& );
266 
267  void noise ( void );
268  void subtract_residuals( void );
269  void remove_spikes ( void );
270  void invert_values ( void );
271  void undo ( void );
272  void floating ( void );
273  void write ( void );
274  void write_triple ( void );
275  void write_mwl ( void );
276  void review_edits ( void );
277  void next_triple ( void );
278  bool all_edits_done ( void );
279  void update_disk_db ( bool );
280  void show_mwl_controls ( bool );
281  void connect_mwl_ctrls ( bool );
282  void ldelta_value ( double );
283  void lambda_start_value( int );
284  void lambda_end_value ( int );
285  void reset_plot_lambdas( void );
286  void lambda_plot_value ( int );
287  void lselect_range_on ( bool );
288  void lselect_custom_on ( bool );
289  void xaxis_radius_on ( bool );
290  void xaxis_waveln_on ( bool );
291  void lambda_plot_prev ( void );
292  void lambda_plot_next ( void );
293  void lambda_custom_list( void );
294  void lambda_new_list ( QVector< int > );
295  void lambda_include_all( void );
296  void od_radius_limit ( double );
297  void progress_load ( QString );
298  int write_xml_file ( QString&, QString&, QString&, QString& );
299  int write_edit_db ( US_DB2*,
300  QString&, QString&, QString&, QString& );
301  int index_data ( int = -1 );
302  int like_edit_files ( QString, QStringList&, US_DB2* );
303  int apply_edits ( US_DataIO::EditValues parameters );
304  int lambdas_by_cell ( int = -1 );
305  double radius_indexed ( const double );
306 
307  void reset ( void );
308  void reset_triple ( void );
309  void reset_outData ( void );
310  void help ( void )
311  { showHelp.show_help( "manual/us_edit.html" ); };
312 };
313 #endif
314