UltraScan III
us_rotor_calibration.h
Go to the documentation of this file.
1 #ifndef US_ROTOR_CALIBRATION_H
2 #define US_ROTOR_CALIBRATION_H
3 
4 #include <QtGui>
5 #include <QApplication>
6 #include <QDomDocument>
7 
8 #include <qwt_plot_marker.h>
9 
10 #include "us_extern.h"
11 #include "us_widgets.h"
12 #include "us_help.h"
13 #include "us_plot.h"
14 #include "us_dataIO.h"
15 #include "us_matrix.h"
16 #include "us_editor.h"
17 
18 struct Average
19 {
20  double top;
21  double bottom;
22  int cell;
23  int rpm;
24  int channel;
25  int top_count;
27 };
28 
29 struct Limit
30 {
31  // this structure contains 2 limits:
32  // [0] = top of channel
33  // [1] = bottom of channel
34  QwtDoubleRect rect[ 2 ];
35  bool used[ 2 ];
36  int cell;
37  QString channel;
38 };
39 
41 {
42  Q_OBJECT
43 
44  public:
46 
48 
49  private:
50 
51  double left;
52  double right;
53  double top;
54  double bottom;
55  double coef[ 3 ];
56  QVector< double > x;
57  QVector< double > y;
58  QVector< double > sd1;
59  QVector< double > sd2;
60  int maxcell;
65  bool newlimit;
66 
67  QString rotor;
68  QString fileText;
69  QString current_channel;
70 
72 
73  QIcon check;
74 
75  QPushButton* pb_reset;
76  QPushButton* pb_accept;
77  QPushButton* pb_calculate;
78  QPushButton* pb_save;
79  QPushButton* pb_load;
80  QPushButton* pb_view;
81 
82  QString workingDir;
83  QString runID;
84  QString editID;
85  QString dataType;
86  QStringList files;
87  QStringList triples;
88 
89  QwtPlot* data_plot;
90  QwtPlotCurve* fit_curve;
91  QwtPlotCurve* v_line;
92  QwtPlotCurve* minimum_curve;
93  QwtPlotGrid* grid;
94  QwtPlotMarker* marker;
95  QwtCounter* ct_cell;
96  QwtCounter* ct_channel;
97 
98 
101 
102  QLineEdit* le_instructions;
103 
104  QRadioButton* rb_channel;
105  QRadioButton* rb_top;
106  QRadioButton* rb_bottom;
107 
108  QCheckBox* cb_assigned;
109  QComboBox* cb_lab;
110 
112  QVector< US_DataIO::RawData > allData;
113  QVector< Average > avg;
114  QVector< QVector < double > > reading;
115  QVector< double > stretch_factors, std_dev;
116  QVector< Limit > limit;
117 
118  private slots:
119  void reset ( void );
120  void source_changed ( bool );
121  void update_disk_db ( bool );
122  void load ( void );
123  void loadDB ( void );
124  void loadDisk ( void );
125  void plotAll ( void );
126  void currentRect ( QwtDoubleRect );
127  void findTriple ( void );
128  void next ( void );
129  void calculate ( void );
130  double findAverage ( QwtDoubleRect, US_DataIO::RawData, int );
131  void save ( void );
132  void view ( void );
133  void update_used ( void );
134  void update_cell ( double );
135  void update_channel ( double );
136  void update_position( void );
137  void update_plot ( void );
138  void help ( void )
139  { showHelp.show_help( "manual/rotor_calibration.html" ); };
140 
141 };
142 #endif