src/CalibrateiSpindel.h

Sun, 15 Oct 2023 17:37:08 +0200

author
Michiel Broek <mbroek@mbse.eu>
date
Sun, 15 Oct 2023 17:37:08 +0200
changeset 510
080524ab2fe8
parent 506
ea07f6c97a69
child 511
c6fa5be47634
permissions
-rw-r--r--

Changed xCal array to a QList. Added sort on angle. Added save data. Added quit/save dialog.

503
61c114afb0ee Basic setup for iSpindel calibration.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1 #ifndef _CALIBRATEISPINDEL_H
61c114afb0ee Basic setup for iSpindel calibration.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2 #define _CALIBRATEISPINDEL_H
61c114afb0ee Basic setup for iSpindel calibration.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3
506
ea07f6c97a69 Added Simple polynomial fitting functions written by Henry M. Forson. Added a graph that displays the old and new iSpindel calibration curve. Implemented delete row from the data.
Michiel Broek <mbroek@mbse.eu>
parents: 505
diff changeset
4 #include "MainWindow.h"
ea07f6c97a69 Added Simple polynomial fitting functions written by Henry M. Forson. Added a graph that displays the old and new iSpindel calibration curve. Implemented delete row from the data.
Michiel Broek <mbroek@mbse.eu>
parents: 505
diff changeset
5
505
7ae4d022cf8f Load and show current calibration data.
Michiel Broek <mbroek@mbse.eu>
parents: 503
diff changeset
6
7ae4d022cf8f Load and show current calibration data.
Michiel Broek <mbroek@mbse.eu>
parents: 503
diff changeset
7 struct Calibrate {
7ae4d022cf8f Load and show current calibration data.
Michiel Broek <mbroek@mbse.eu>
parents: 503
diff changeset
8 double sg;
7ae4d022cf8f Load and show current calibration data.
Michiel Broek <mbroek@mbse.eu>
parents: 503
diff changeset
9 double plato;
7ae4d022cf8f Load and show current calibration data.
Michiel Broek <mbroek@mbse.eu>
parents: 503
diff changeset
10 double angle;
7ae4d022cf8f Load and show current calibration data.
Michiel Broek <mbroek@mbse.eu>
parents: 503
diff changeset
11 };
503
61c114afb0ee Basic setup for iSpindel calibration.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
12
61c114afb0ee Basic setup for iSpindel calibration.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
13
61c114afb0ee Basic setup for iSpindel calibration.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
14 namespace Ui {
61c114afb0ee Basic setup for iSpindel calibration.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
15 class CalibrateiSpindel;
61c114afb0ee Basic setup for iSpindel calibration.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
16 }
61c114afb0ee Basic setup for iSpindel calibration.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
17
61c114afb0ee Basic setup for iSpindel calibration.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
18 class CalibrateiSpindel : public QDialog
61c114afb0ee Basic setup for iSpindel calibration.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
19 {
61c114afb0ee Basic setup for iSpindel calibration.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
20 Q_OBJECT
61c114afb0ee Basic setup for iSpindel calibration.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
21
505
7ae4d022cf8f Load and show current calibration data.
Michiel Broek <mbroek@mbse.eu>
parents: 503
diff changeset
22 signals:
7ae4d022cf8f Load and show current calibration data.
Michiel Broek <mbroek@mbse.eu>
parents: 503
diff changeset
23 void entry_changed();
7ae4d022cf8f Load and show current calibration data.
Michiel Broek <mbroek@mbse.eu>
parents: 503
diff changeset
24
503
61c114afb0ee Basic setup for iSpindel calibration.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
25 public:
61c114afb0ee Basic setup for iSpindel calibration.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
26 explicit CalibrateiSpindel(int id, QWidget *parent = 0);
61c114afb0ee Basic setup for iSpindel calibration.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
27 ~CalibrateiSpindel();
61c114afb0ee Basic setup for iSpindel calibration.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
28
61c114afb0ee Basic setup for iSpindel calibration.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
29 private slots:
61c114afb0ee Basic setup for iSpindel calibration.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
30 void on_quitButton_clicked();
505
7ae4d022cf8f Load and show current calibration data.
Michiel Broek <mbroek@mbse.eu>
parents: 503
diff changeset
31 void on_saveButton_clicked();
503
61c114afb0ee Basic setup for iSpindel calibration.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
32 void refreshTable(void);
505
7ae4d022cf8f Load and show current calibration data.
Michiel Broek <mbroek@mbse.eu>
parents: 503
diff changeset
33 void on_addButton_clicked();
7ae4d022cf8f Load and show current calibration data.
Michiel Broek <mbroek@mbse.eu>
parents: 503
diff changeset
34 void on_deleteRow_clicked();
7ae4d022cf8f Load and show current calibration data.
Michiel Broek <mbroek@mbse.eu>
parents: 503
diff changeset
35 void cell_Changed(int nRow, int nCol);
503
61c114afb0ee Basic setup for iSpindel calibration.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
36
61c114afb0ee Basic setup for iSpindel calibration.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
37 private:
61c114afb0ee Basic setup for iSpindel calibration.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
38 Ui::CalibrateiSpindel *ui;
61c114afb0ee Basic setup for iSpindel calibration.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
39 QString _node, _alias, _data_old, _data_new;
506
ea07f6c97a69 Added Simple polynomial fitting functions written by Henry M. Forson. Added a graph that displays the old and new iSpindel calibration curve. Implemented delete row from the data.
Michiel Broek <mbroek@mbse.eu>
parents: 505
diff changeset
40 QChartView *chartView;
ea07f6c97a69 Added Simple polynomial fitting functions written by Henry M. Forson. Added a graph that displays the old and new iSpindel calibration curve. Implemented delete row from the data.
Michiel Broek <mbroek@mbse.eu>
parents: 505
diff changeset
41 QChart *chart;
ea07f6c97a69 Added Simple polynomial fitting functions written by Henry M. Forson. Added a graph that displays the old and new iSpindel calibration curve. Implemented delete row from the data.
Michiel Broek <mbroek@mbse.eu>
parents: 505
diff changeset
42 QLineSeries *new_plot, *old_plot;
ea07f6c97a69 Added Simple polynomial fitting functions written by Henry M. Forson. Added a graph that displays the old and new iSpindel calibration curve. Implemented delete row from the data.
Michiel Broek <mbroek@mbse.eu>
parents: 505
diff changeset
43 int recno, oldtotal, newtotal;
505
7ae4d022cf8f Load and show current calibration data.
Michiel Broek <mbroek@mbse.eu>
parents: 503
diff changeset
44 QJsonDocument data;
7ae4d022cf8f Load and show current calibration data.
Michiel Broek <mbroek@mbse.eu>
parents: 503
diff changeset
45 bool ignoreChanges = false;
7ae4d022cf8f Load and show current calibration data.
Michiel Broek <mbroek@mbse.eu>
parents: 503
diff changeset
46 bool textIsChanged = false;
7ae4d022cf8f Load and show current calibration data.
Michiel Broek <mbroek@mbse.eu>
parents: 503
diff changeset
47 double Old[4], New[4];
510
080524ab2fe8 Changed xCal array to a QList. Added sort on angle. Added save data. Added quit/save dialog.
Michiel Broek <mbroek@mbse.eu>
parents: 506
diff changeset
48 QList<Calibrate> oCal;
080524ab2fe8 Changed xCal array to a QList. Added sort on angle. Added save data. Added quit/save dialog.
Michiel Broek <mbroek@mbse.eu>
parents: 506
diff changeset
49 QList<Calibrate> nCal;
505
7ae4d022cf8f Load and show current calibration data.
Michiel Broek <mbroek@mbse.eu>
parents: 503
diff changeset
50
510
080524ab2fe8 Changed xCal array to a QList. Added sort on angle. Added save data. Added quit/save dialog.
Michiel Broek <mbroek@mbse.eu>
parents: 506
diff changeset
51 bool sort_test(const Calibrate &D1, const Calibrate &D2);
505
7ae4d022cf8f Load and show current calibration data.
Michiel Broek <mbroek@mbse.eu>
parents: 503
diff changeset
52 void WindowTitle();
503
61c114afb0ee Basic setup for iSpindel calibration.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
53 };
61c114afb0ee Basic setup for iSpindel calibration.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
54
61c114afb0ee Basic setup for iSpindel calibration.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
55 #endif

mercurial