-
Notifications
You must be signed in to change notification settings - Fork 0
/
settingsdialog.h
317 lines (244 loc) · 11.2 KB
/
settingsdialog.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
#ifndef SettingsDialog_H
#define SettingsDialog_H
#include "globals.h"
#include "Settings.h"
#include "settingsdialog.h"
#include <memory>
#include <QDialog>
#include <QLabel>
#include <QHash>
#include <QDoubleSpinBox>
#include <QAbstractButton>
namespace Ui {
class SettingsDialog;
}
/**
* dialog class to manage application settings
*/
class SettingsDialog : public QDialog
{
Q_OBJECT
public:
explicit SettingsDialog(SettingsValues* v, QWidget *parent = 0);
explicit SettingsDialog(QWidget *parent = 0);
void create(SettingsValues* v);
void initializeSettings() { m_Settings->initialize(); };
void initControls();
void updateCONNECTPORT(bool XY, QString port);
void enableFiducial(bool lock);
void setHistogramImage(QImage im);
void setImageGridDisplaySize(QSize size);
bool checkIndex(const double& val1, const double& val2);
void updateFiducialComboIndex();
bool checkFiducialsOrder(QInt3DMap fiducial_marks_stage, QIntPointMap fiducial_marks_image, bool bFlagRed = false);
void setFiducial();
void updatePositions();
void updatePosition();
void setFiducial(int type);
void setupFiducialMarks();
bool checkOrder(int startIndex, QPointF tl, QPointF tr, QPointF bl, QPointF br, bool flagRed = true);
void flagFiducialOrderRed(int ind1, int ind2);
bool checkFiducialsOrder(bool bFlagRed = true);
void setActiveTab(QString tabName);
void updateSamplingSpacing();
~SettingsDialog();
QSize imageSize; /// Size of current image
double m_stage_x;
double m_stage_y;
private:
void updateGrid() { emit setGrid(m_Settings->displayGrid, m_Settings->gridOffsetX, m_Settings->gridOffsetY, m_Settings->gridSpacingX, m_Settings->gridSpacingY, m_Settings->objectColours[drawingItems::grid]); };
private:
Ui::SettingsDialog *ui;
SettingsValues* m_Settings;
QHash<int, QLabel*> labelsFiducial;
QHash<int, QDoubleSpinBox*> spinFiducials_X;
QHash<int, QDoubleSpinBox*> spinFiducials_Y;
QHash<int, QDoubleSpinBox*> spinFiducials_stage_X;
QHash<int, QDoubleSpinBox*> spinFiducials_stage_Y;
QHash<int, QDoubleSpinBox*> spinFiducials_stage_Z;
public slots:
void updateCOMPORTS(QVector<QString> strs);
private slots:
void on_btnCenterGrid_clicked();
void on_distanceThreshold_valueChanged(int value);
void on_distanceBinsThreshold_valueChanged(int value);
void on_numClusters_valueChanged(int value);
void on_cboThresholdType_currentIndexChanged(int index);
void on_cboSamplingType_currentIndexChanged(int index);
void on_ThresholdMaxSlider_valueChanged(int value);
void on_ThresholdMinSlider_valueChanged(int value);
void on_sliderGridOffsetX_valueChanged(int value);
void on_sliderGridOffsetY_valueChanged(int value);
void on_sliderGridSpacingX_valueChanged(int value);
void on_sliderGridSpacingY_valueChanged(int value);
void on_sliderBarcodeThreshold_valueChanged(int value);
void on_chkAutoBarcodeThreshold_clicked(bool checked);
void on_chkProcessGrayscale_clicked(bool checked);
void on_spinGridOffsetX_valueChanged(double value);
void on_spinGridOffsetY_valueChanged(double value);
void on_spinGridSpacingX_valueChanged(double value);
void on_spinGridSpacingY_valueChanged(double value);
void on_editPixelSizeMicrons_textChanged(QString val);
void on_spinSamplingDistanceX_valueChanged(int value);
void on_spinSamplingDistanceY_valueChanged(int value);
void on_spinSamplingOffsetX_valueChanged(int value);
void on_spinSamplingOffsetY_valueChanged(int value);
void on_btnDeleteFiducial_clicked();
void on_btnLogFeedback_clicked();
void on_spnTopLeft_Overview_X_valueChanged(double value);
void on_spnTopLeft_Overview_Y_valueChanged(double value);
void on_spnTopRight_Overview_X_valueChanged(double value);
void on_spnTopRight_Overview_Y_valueChanged(double value);
void on_spnBottomLeft_Overview_X_valueChanged(double value);
void on_spnBottomLeft_Overview_Y_valueChanged(double value);
void on_spnBottomRight_Overview_X_valueChanged(double value);
void on_spnBottomRight_Overview_Y_valueChanged(double value);
void on_spinXPositionAbsoluteXY_valueChanged(double value);
void on_spinYPositionAbsoluteXY_valueChanged(double value);
void on_spinXPositionRelativeXY_valueChanged(double value);
void on_spinYPositionRelativeXY_valueChanged(double value);
void on_spnTopLeft_Overview_Stage_X_valueChanged(double value);
void on_spnTopLeft_Overview_Stage_Y_valueChanged(double value);
void on_spnTopLeft_Microscope_X_valueChanged(double value);
void on_spnTopLeft_Microscope_Y_valueChanged(double value);
void on_spnTopLeft_Microscope_Stage_X_valueChanged(double value);
void on_spnTopLeft_Microscope_Stage_Y_valueChanged(double value);
void on_spnTopLeft_Microscope_Stage_Z_valueChanged(double value);
void on_spnTopRight_Microscope_X_valueChanged(double value);
void on_spnTopRight_Microscope_Y_valueChanged(double value);
void on_spnTopRight_Microscope_Stage_X_valueChanged(double value);
void on_spnTopRight_Microscope_Stage_Y_valueChanged(double value);
void on_spnTopRight_Microscope_Stage_Z_valueChanged(double value);
void on_spnBottomLeft_Microscope_X_valueChanged(double value);
void on_spnBottomLeft_Microscope_Y_valueChanged(double value);
void on_spnBottomLeft_Microscope_Stage_X_valueChanged(double value);
void on_spnBottomLeft_Microscope_Stage_Y_valueChanged(double value);
void on_spnBottomLeft_Microscope_Stage_Z_valueChanged(double value);
void on_spnBottomRight_Microscope_X_valueChanged(double value);
void on_spnBottomRight_Microscope_Y_valueChanged(double value);
void on_spnBottomRight_Microscope_Stage_X_valueChanged(double value);
void on_spnBottomRight_Microscope_Stage_Y_valueChanged(double value);
void on_spnBottomRight_Microscope_Stage_Z_valueChanged(double value);
void on_spinFocusRange_valueChanged(double value);
void on_spinDefaultFocusPosition_valueChanged(double value);
void on_spinCoarseFocusStep_valueChanged(double value);
void on_spinFineFocusStep_valueChanged(double value);
void on_spinFocusFraction_valueChanged(double value);
void on_btnCalcTransformationMatrix_clicked();
void on_spinVelocityXY_valueChanged(double value);
void on_btnMoveToFiducial_clicked();
void on_btnMoveAbsoluteXY_clicked();
void on_btnMoveRelativeXY_clicked();
void on_btnSendCommandXY_clicked();
void on_btnSetVelocityXY_clicked();
void on_btnCalibrateXY_clicked();
void on_btnMeasureRangeXY_clicked();
void on_btnConnectXY_clicked();
void on_btnDisconnectXY_clicked();
void on_btnAbortXY_clicked();
void on_btnMoveOverviewPosition_clicked();
void on_btnAddFocusPosition_clicked();
void on_btnRemoveFocusPosition_clicked();
void on_btnMoveAbsoluteZ_clicked();
void on_btnMoveRelativeZ_clicked();
void on_btnUpZ_pressed();
void on_btnDownZ_pressed();
void on_btnUpZ_released();
void on_btnDownZ_released();
void on_btnSendCommandZ_clicked();
void on_btnConnectZ_clicked();
void on_btnDisconnectZ_clicked();
void on_spinPositionAbsoluteZ_valueChanged(double value);
void on_spinPositionRelativeZ_valueChanged(double value);
void on_btnRestoreBackup_clicked();
void on_btnSaveBackup_clicked();
void on_cboSelectFiducial_currentIndexChanged(int value);
void on_cboBaudXY_currentIndexChanged(int value);
void on_cboFocusAlgorithm_currentIndexChanged(int value);
void on_NoClustersSlider_valueChanged(int value);
void on_ScoreThreshold_valueChanged(int value);
void on_AlgoComboBox_currentIndexChanged(int index);
void on_chkAutoThreshold_clicked(bool checked);
void on_chkCV_CALIB_CB_ADAPTIVE_THRESH_clicked(bool checked);
void on_chkCV_CALIB_CB_NORMALIZE_IMAGE_clicked(bool checked);
void on_chkCV_CALIB_CB_FILTER_QUADS_clicked(bool checked);
void on_btnProjectDirectory_clicked(bool checked);
void on_cboCalibrateAlgorithm_currentIndexChanged(int index);
void on_chkCALIB_CB_FAST_CHECK_clicked(bool checked);
void on_chkCALIB_CB_CLUSTERING_clicked(bool checked);
void on_chkFixedAspect_clicked(bool checked);
void on_chkZeroDistortion_clicked(bool checked);
void on_chkFixPrincipalPointCenter_clicked(bool checked);
void on_chkIntrinsicGuess_clicked(bool checked);
void on_chkFixFocalLength_clicked(bool checked);
void on_chkOptimiseFocusRange_clicked(bool checked);
void on_chkInterpolateFocusPosition_clicked(bool checked);
void on_chkUseFocusThreshold_clicked(bool checked);
void on_chkUseCoarseFocusRange_clicked(bool checked);
void on_chkUseFineFocusRange_clicked(bool checked);
void on_chkCenterFocus_clicked(bool checked);
void on_chkUseRegisteredFocusPoints_clicked(bool checked);
void on_chkShowBestFocusImage_clicked(bool checked);
void on_chkDetectTargetsWhileScanning_clicked(bool checked);
void on_chkCorrectBackGround_clicked(bool checked);
void on_spinWaveletLevels_valueChanged(int value);
void on_spinItemsInRow_valueChanged(int value);
void on_spinItemsInColumn_valueChanged(int value);
void on_spinSizeSquare_valueChanged(int value);
void on_huMomentSimilaritySlider_valueChanged(int value);
void on_spinAspectTolerance_valueChanged(double value);
void on_scoreRegionArea_valueChanged(int value);
void on_chkLockFiducial_clicked(bool checked);
void on_chkPaddTargetImage_clicked(bool checked);
void on_spOverviewLensFocalLength_valueChanged(int value);
void on_spMicroscopeLensFocalLength_valueChanged(int value);
void on_chkDisplayGrid_clicked(bool value);
void on_chkJoystickOn_clicked(bool on);
void on_chkKeypadOn_clicked(bool on);
void on_cboActiveCamera_currentIndexChanged(int value);
void on_buttonBox_clicked(QAbstractButton *button);
void on_btnSelectColour_clicked();
void on_editName_textChanged(QString val);
void on_editInstitute_textChanged(QString val);
void on_editProjectName_textChanged(QString val);
void on_editProjectID_textChanged(QString val);
void on_editVersion_textChanged(QString val);
void on_editDescription_textChanged(QString val);
void on_editSampleDescription_textChanged(QString val);
void on_editFilenamePrefix_textChanged(QString val);
void on_editBarcode_textChanged(QString val);
void on_projectDate_dateChanged(QDate date);
void on_editProjectDirectoryName_textChanged(QString val);
void on_lineEditOverviewCameraSN_textChanged(QString val);
void on_lineEditMicroscopeCameraSN_textChanged(QString val);
signals:
void sendSettings();
void updatePaddTarget(bool bPaddTargetImage, int levels);
void setGrid(bool bChecked, double offX, double offY, double spaceX, double spaceY, QColor colour);
void logFeedback(int score, QString name, QString email, QString institute, QString desc);
void MoveAbsoluteXY(double x, double y, ACTIONS::action act);
void MoveRelativeXY(double x, double y, ACTIONS::action act);
void MoveAbsoluteZ(double z, ACTIONS::action act);
void MoveRelativeZ(double z, ACTIONS::action act);
void stopMotionZ(ACTIONS::action act);
void SendCommandXY(QString cmd);
void SendCommandZ(QString cmd);
void SetVelocityXY(double velo);
void SetJoystickXY(bool on);
void SetKeypadZ(bool on);
void CalibrateXY();
void MeasureRangeXY();
void ConnectXY();
void DisconnectXY();
void ConnectZ();
void DisconnectZ();
void AbortXY();
void getCOMPORTS();
void moveToFiducialFromOverview(QPoint pt);
void createTransformationMatrix(QVector3D topleft, QVector3D topright, QVector3D bottomleft);
void saveBackup(bool bLoad);
void LOGCONSOLE(QString strText, CONSOLECOLOURS::colour col);
void SETFIDUCIALPOSITION(FIDUCIAL::position index);
void LockFiducial(bool clicked);
};
#endif // SettingsDialog_H