Sat, 08 Jun 2024 15:54:30 +0200
Version 0.4.6a1. Added HLT equipment volume and deadspace settings. In EditProduct the target water selection is now sticky. Changed the water treatment tab. Added a row wich displays the salt adjustments. This can be selected between actual and target values. The treated water show can select between mash or sparge water. The total line will become the final water in the boil kettle. Database update function is expanded with the new settings. Added a popup message warning that the database is upgraded and user action is required for the equipment profiles.
310 | 1 | /** |
2 | * MoniSpindels.cpp is part of bmsapp. | |
3 | * | |
4 | * bmsapp is free software: you can redistribute it and/or modify | |
5 | * it under the terms of the GNU General Public License as published by | |
6 | * the Free Software Foundation, either version 3 of the License, or | |
7 | * (at your option) any later version. | |
8 | * | |
9 | * bmsapp is distributed in the hope that it will be useful, | |
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
12 | * GNU General Public License for more details. | |
13 | * | |
14 | * You should have received a copy of the GNU General Public License | |
15 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | |
16 | */ | |
17 | #include "MoniSpindels.h" | |
329
b57299738980
Added iSpindel detail screen
Michiel Broek <mbroek@mbse.eu>
parents:
312
diff
changeset
|
18 | #include "DetailiSpindel.h" |
503
61c114afb0ee
Basic setup for iSpindel calibration.
Michiel Broek <mbroek@mbse.eu>
parents:
492
diff
changeset
|
19 | #include "CalibrateiSpindel.h" |
310 | 20 | #include "MainWindow.h" |
311
449116c083bd
Respond to websocket ping. Added iSpindels monitor overview.
Michiel Broek <mbroek@mbse.eu>
parents:
310
diff
changeset
|
21 | #include "Utils.h" |
310 | 22 | #include "config.h" |
23 | ||
24 | ||
25 | ||
26 | /* | |
27 | * Build the table and buttons on the mainscreen. | |
28 | * Don't use a ui file, do it dynamicly. | |
29 | */ | |
30 | MoniSpindels::MoniSpindels(QWidget *parent) : QDialog(parent) | |
31 | { | |
492
c3a781b4d35b
ChartCarbonate saves the image path in the settings file. Conditional debug messages in a lot on monitor files. In Fermenter monitor details make the status background red if offline. A lot more generic variables instead of continuous expensive calls to MySQL. If fermenter values for the thermometers are not OK, then do not show anything.
Michiel Broek <mbroek@mbse.eu>
parents:
329
diff
changeset
|
32 | #ifdef DEBUG_MONITOR |
310 | 33 | qDebug() << "MoniSpindels start"; |
492
c3a781b4d35b
ChartCarbonate saves the image path in the settings file. Conditional debug messages in a lot on monitor files. In Fermenter monitor details make the status background red if offline. A lot more generic variables instead of continuous expensive calls to MySQL. If fermenter values for the thermometers are not OK, then do not show anything.
Michiel Broek <mbroek@mbse.eu>
parents:
329
diff
changeset
|
34 | #endif |
310 | 35 | |
36 | gridLayout = new QGridLayout(this); | |
37 | gridLayout->setObjectName(QString::fromUtf8("gridLayout")); | |
311
449116c083bd
Respond to websocket ping. Added iSpindels monitor overview.
Michiel Broek <mbroek@mbse.eu>
parents:
310
diff
changeset
|
38 | tableiSpindels = new QTableWidget(this); |
449116c083bd
Respond to websocket ping. Added iSpindels monitor overview.
Michiel Broek <mbroek@mbse.eu>
parents:
310
diff
changeset
|
39 | tableiSpindels->setObjectName(QString::fromUtf8("tableiSpindels")); |
449116c083bd
Respond to websocket ping. Added iSpindels monitor overview.
Michiel Broek <mbroek@mbse.eu>
parents:
310
diff
changeset
|
40 | tableiSpindels->setEnabled(true); |
310 | 41 | QSizePolicy sizePolicy(QSizePolicy::Fixed, QSizePolicy::Expanding); |
42 | sizePolicy.setHorizontalStretch(0); | |
43 | sizePolicy.setVerticalStretch(0); | |
311
449116c083bd
Respond to websocket ping. Added iSpindels monitor overview.
Michiel Broek <mbroek@mbse.eu>
parents:
310
diff
changeset
|
44 | sizePolicy.setHeightForWidth(tableiSpindels->sizePolicy().hasHeightForWidth()); |
449116c083bd
Respond to websocket ping. Added iSpindels monitor overview.
Michiel Broek <mbroek@mbse.eu>
parents:
310
diff
changeset
|
45 | tableiSpindels->setSizePolicy(sizePolicy); |
449116c083bd
Respond to websocket ping. Added iSpindels monitor overview.
Michiel Broek <mbroek@mbse.eu>
parents:
310
diff
changeset
|
46 | tableiSpindels->setMinimumSize(QSize(1054, 0)); |
449116c083bd
Respond to websocket ping. Added iSpindels monitor overview.
Michiel Broek <mbroek@mbse.eu>
parents:
310
diff
changeset
|
47 | gridLayout->addWidget(tableiSpindels, 0, 0, 1, 1); |
310 | 48 | |
49 | groupBox = new QGroupBox(this); | |
50 | groupBox->setObjectName(QString::fromUtf8("groupBox")); | |
51 | groupBox->setEnabled(true); | |
52 | groupBox->setFlat(false); | |
53 | horizontalLayout = new QHBoxLayout(groupBox); | |
54 | horizontalLayout->setSpacing(6); | |
55 | horizontalLayout->setObjectName(QString::fromUtf8("horizontalLayout")); | |
56 | horizontalLayout->setContentsMargins(0, 0, 0, 0); | |
57 | quitButton = new QPushButton(groupBox); | |
58 | quitButton->setObjectName(QString::fromUtf8("quitButton")); | |
59 | quitButton->setMinimumSize(QSize(80, 24)); | |
60 | quitButton->setText(tr("Quit")); | |
61 | QIcon icon; | |
62 | icon.addFile(QString::fromUtf8(":icons/silk/door_out.png"), QSize(), QIcon::Normal, QIcon::Off); | |
63 | quitButton->setIcon(icon); | |
311
449116c083bd
Respond to websocket ping. Added iSpindels monitor overview.
Michiel Broek <mbroek@mbse.eu>
parents:
310
diff
changeset
|
64 | horizontalLayout->addWidget(quitButton, 0, Qt::AlignCenter); |
310 | 65 | gridLayout->addWidget(groupBox, 1, 0, 1, 1); |
66 | ||
67 | connect(quitButton, SIGNAL(clicked()), parent, SLOT(fromMoniSpindels())); | |
68 | connect(this, SIGNAL(setStatus(QString)), parent, SLOT(statusMsg(QString))); | |
311
449116c083bd
Respond to websocket ping. Added iSpindels monitor overview.
Michiel Broek <mbroek@mbse.eu>
parents:
310
diff
changeset
|
69 | connect(parent, SIGNAL(updateiSpindels(QString)), this, SLOT(refreshiSpindels(QString))); |
310 | 70 | emit refreshTable(); |
71 | } | |
72 | ||
73 | ||
74 | void MoniSpindels::refreshTable() | |
75 | { | |
311
449116c083bd
Respond to websocket ping. Added iSpindels monitor overview.
Michiel Broek <mbroek@mbse.eu>
parents:
310
diff
changeset
|
76 | QTableWidgetItem *item; |
449116c083bd
Respond to websocket ping. Added iSpindels monitor overview.
Michiel Broek <mbroek@mbse.eu>
parents:
310
diff
changeset
|
77 | |
449116c083bd
Respond to websocket ping. Added iSpindels monitor overview.
Michiel Broek <mbroek@mbse.eu>
parents:
310
diff
changeset
|
78 | QSqlQuery query("SELECT record,alias,node,online,mode,temperature,gravity,beercode,beername FROM mon_ispindels ORDER BY alias"); |
503
61c114afb0ee
Basic setup for iSpindel calibration.
Michiel Broek <mbroek@mbse.eu>
parents:
492
diff
changeset
|
79 | const QStringList labels({tr("Unit"), tr("Node"), tr("Status"), tr("Beer"), tr("Temperature"), tr("SG"), tr("Cal"), tr("Details")}); |
310 | 80 | |
503
61c114afb0ee
Basic setup for iSpindel calibration.
Michiel Broek <mbroek@mbse.eu>
parents:
492
diff
changeset
|
81 | this->tableiSpindels->setColumnCount(8); |
311
449116c083bd
Respond to websocket ping. Added iSpindels monitor overview.
Michiel Broek <mbroek@mbse.eu>
parents:
310
diff
changeset
|
82 | this->tableiSpindels->setColumnWidth(0, 150); /* Alias */ |
449116c083bd
Respond to websocket ping. Added iSpindels monitor overview.
Michiel Broek <mbroek@mbse.eu>
parents:
310
diff
changeset
|
83 | this->tableiSpindels->setColumnWidth(1, 120); /* Node */ |
449116c083bd
Respond to websocket ping. Added iSpindels monitor overview.
Michiel Broek <mbroek@mbse.eu>
parents:
310
diff
changeset
|
84 | this->tableiSpindels->setColumnWidth(2, 100); /* Status */ |
503
61c114afb0ee
Basic setup for iSpindel calibration.
Michiel Broek <mbroek@mbse.eu>
parents:
492
diff
changeset
|
85 | this->tableiSpindels->setColumnWidth(3, 330); /* Beer */ |
311
449116c083bd
Respond to websocket ping. Added iSpindels monitor overview.
Michiel Broek <mbroek@mbse.eu>
parents:
310
diff
changeset
|
86 | this->tableiSpindels->setColumnWidth(4, 90); /* Temperature */ |
449116c083bd
Respond to websocket ping. Added iSpindels monitor overview.
Michiel Broek <mbroek@mbse.eu>
parents:
310
diff
changeset
|
87 | this->tableiSpindels->setColumnWidth(5, 90); /* Gravity */ |
503
61c114afb0ee
Basic setup for iSpindel calibration.
Michiel Broek <mbroek@mbse.eu>
parents:
492
diff
changeset
|
88 | this->tableiSpindels->setColumnWidth(6, 60); /* Calibrate */ |
61c114afb0ee
Basic setup for iSpindel calibration.
Michiel Broek <mbroek@mbse.eu>
parents:
492
diff
changeset
|
89 | this->tableiSpindels->setColumnWidth(7, 90); /* Edit button */ |
311
449116c083bd
Respond to websocket ping. Added iSpindels monitor overview.
Michiel Broek <mbroek@mbse.eu>
parents:
310
diff
changeset
|
90 | this->tableiSpindels->setRowCount(query.size()); |
449116c083bd
Respond to websocket ping. Added iSpindels monitor overview.
Michiel Broek <mbroek@mbse.eu>
parents:
310
diff
changeset
|
91 | this->tableiSpindels->setHorizontalHeaderLabels(labels); |
449116c083bd
Respond to websocket ping. Added iSpindels monitor overview.
Michiel Broek <mbroek@mbse.eu>
parents:
310
diff
changeset
|
92 | this->tableiSpindels->verticalHeader()->hide(); |
310 | 93 | /* Set the widget size to 1054 x 575 in the ui. */ |
94 | ||
95 | query.first(); | |
311
449116c083bd
Respond to websocket ping. Added iSpindels monitor overview.
Michiel Broek <mbroek@mbse.eu>
parents:
310
diff
changeset
|
96 | for (int i = 0 ; i < query.size() ; i++ ) { |
449116c083bd
Respond to websocket ping. Added iSpindels monitor overview.
Michiel Broek <mbroek@mbse.eu>
parents:
310
diff
changeset
|
97 | this->tableiSpindels->setItem(i, 0, new QTableWidgetItem(query.value("alias").toString())); |
449116c083bd
Respond to websocket ping. Added iSpindels monitor overview.
Michiel Broek <mbroek@mbse.eu>
parents:
310
diff
changeset
|
98 | this->tableiSpindels->setItem(i, 1, new QTableWidgetItem(query.value("node").toString())); |
449116c083bd
Respond to websocket ping. Added iSpindels monitor overview.
Michiel Broek <mbroek@mbse.eu>
parents:
310
diff
changeset
|
99 | |
449116c083bd
Respond to websocket ping. Added iSpindels monitor overview.
Michiel Broek <mbroek@mbse.eu>
parents:
310
diff
changeset
|
100 | if (query.value("online").toInt()) { |
449116c083bd
Respond to websocket ping. Added iSpindels monitor overview.
Michiel Broek <mbroek@mbse.eu>
parents:
310
diff
changeset
|
101 | item = new QTableWidgetItem(QString("Ok")); |
449116c083bd
Respond to websocket ping. Added iSpindels monitor overview.
Michiel Broek <mbroek@mbse.eu>
parents:
310
diff
changeset
|
102 | } else { |
449116c083bd
Respond to websocket ping. Added iSpindels monitor overview.
Michiel Broek <mbroek@mbse.eu>
parents:
310
diff
changeset
|
103 | item = new QTableWidgetItem(QString("Offline")); |
449116c083bd
Respond to websocket ping. Added iSpindels monitor overview.
Michiel Broek <mbroek@mbse.eu>
parents:
310
diff
changeset
|
104 | item->setForeground(QBrush(QColor(Qt::red))); |
449116c083bd
Respond to websocket ping. Added iSpindels monitor overview.
Michiel Broek <mbroek@mbse.eu>
parents:
310
diff
changeset
|
105 | } |
449116c083bd
Respond to websocket ping. Added iSpindels monitor overview.
Michiel Broek <mbroek@mbse.eu>
parents:
310
diff
changeset
|
106 | item->setTextAlignment(Qt::AlignCenter|Qt::AlignVCenter); |
449116c083bd
Respond to websocket ping. Added iSpindels monitor overview.
Michiel Broek <mbroek@mbse.eu>
parents:
310
diff
changeset
|
107 | this->tableiSpindels->setItem(i, 2, item); |
449116c083bd
Respond to websocket ping. Added iSpindels monitor overview.
Michiel Broek <mbroek@mbse.eu>
parents:
310
diff
changeset
|
108 | |
449116c083bd
Respond to websocket ping. Added iSpindels monitor overview.
Michiel Broek <mbroek@mbse.eu>
parents:
310
diff
changeset
|
109 | if (query.value("mode").toString() == "ON") { |
449116c083bd
Respond to websocket ping. Added iSpindels monitor overview.
Michiel Broek <mbroek@mbse.eu>
parents:
310
diff
changeset
|
110 | item = new QTableWidgetItem(query.value("beercode").toString()+" - "+query.value("beername").toString()); |
449116c083bd
Respond to websocket ping. Added iSpindels monitor overview.
Michiel Broek <mbroek@mbse.eu>
parents:
310
diff
changeset
|
111 | this->tableiSpindels->setItem(i, 3, item); |
449116c083bd
Respond to websocket ping. Added iSpindels monitor overview.
Michiel Broek <mbroek@mbse.eu>
parents:
310
diff
changeset
|
112 | } else { |
449116c083bd
Respond to websocket ping. Added iSpindels monitor overview.
Michiel Broek <mbroek@mbse.eu>
parents:
310
diff
changeset
|
113 | this->tableiSpindels->setItem(i, 3, new QTableWidgetItem(QString(""))); |
449116c083bd
Respond to websocket ping. Added iSpindels monitor overview.
Michiel Broek <mbroek@mbse.eu>
parents:
310
diff
changeset
|
114 | } |
449116c083bd
Respond to websocket ping. Added iSpindels monitor overview.
Michiel Broek <mbroek@mbse.eu>
parents:
310
diff
changeset
|
115 | |
449116c083bd
Respond to websocket ping. Added iSpindels monitor overview.
Michiel Broek <mbroek@mbse.eu>
parents:
310
diff
changeset
|
116 | if (query.value("online").toInt()) { |
449116c083bd
Respond to websocket ping. Added iSpindels monitor overview.
Michiel Broek <mbroek@mbse.eu>
parents:
310
diff
changeset
|
117 | item = new QTableWidgetItem(QString("%1°C").arg(query.value("temperature").toDouble(), 4, 'f', 3, '0')); |
449116c083bd
Respond to websocket ping. Added iSpindels monitor overview.
Michiel Broek <mbroek@mbse.eu>
parents:
310
diff
changeset
|
118 | item->setTextAlignment(Qt::AlignCenter|Qt::AlignVCenter); |
449116c083bd
Respond to websocket ping. Added iSpindels monitor overview.
Michiel Broek <mbroek@mbse.eu>
parents:
310
diff
changeset
|
119 | this->tableiSpindels->setItem(i, 4, item); |
449116c083bd
Respond to websocket ping. Added iSpindels monitor overview.
Michiel Broek <mbroek@mbse.eu>
parents:
310
diff
changeset
|
120 | double sg = Utils::plato_to_sg(query.value("gravity").toDouble()); |
449116c083bd
Respond to websocket ping. Added iSpindels monitor overview.
Michiel Broek <mbroek@mbse.eu>
parents:
310
diff
changeset
|
121 | item = new QTableWidgetItem(QString("%1").arg(sg, 5, 'f', 4, '0')); |
449116c083bd
Respond to websocket ping. Added iSpindels monitor overview.
Michiel Broek <mbroek@mbse.eu>
parents:
310
diff
changeset
|
122 | item->setTextAlignment(Qt::AlignCenter|Qt::AlignVCenter); |
449116c083bd
Respond to websocket ping. Added iSpindels monitor overview.
Michiel Broek <mbroek@mbse.eu>
parents:
310
diff
changeset
|
123 | this->tableiSpindels->setItem(i, 5, item); |
449116c083bd
Respond to websocket ping. Added iSpindels monitor overview.
Michiel Broek <mbroek@mbse.eu>
parents:
310
diff
changeset
|
124 | } else { |
449116c083bd
Respond to websocket ping. Added iSpindels monitor overview.
Michiel Broek <mbroek@mbse.eu>
parents:
310
diff
changeset
|
125 | this->tableiSpindels->setItem(i, 4, new QTableWidgetItem(QString(""))); |
449116c083bd
Respond to websocket ping. Added iSpindels monitor overview.
Michiel Broek <mbroek@mbse.eu>
parents:
310
diff
changeset
|
126 | this->tableiSpindels->setItem(i, 5, new QTableWidgetItem(QString(""))); |
449116c083bd
Respond to websocket ping. Added iSpindels monitor overview.
Michiel Broek <mbroek@mbse.eu>
parents:
310
diff
changeset
|
127 | } |
310 | 128 | |
503
61c114afb0ee
Basic setup for iSpindel calibration.
Michiel Broek <mbroek@mbse.eu>
parents:
492
diff
changeset
|
129 | /* Add the Calibrate button */ |
61c114afb0ee
Basic setup for iSpindel calibration.
Michiel Broek <mbroek@mbse.eu>
parents:
492
diff
changeset
|
130 | QWidget* cWidget = new QWidget(); |
61c114afb0ee
Basic setup for iSpindel calibration.
Michiel Broek <mbroek@mbse.eu>
parents:
492
diff
changeset
|
131 | QPushButton* btn_cal = new QPushButton(); |
61c114afb0ee
Basic setup for iSpindel calibration.
Michiel Broek <mbroek@mbse.eu>
parents:
492
diff
changeset
|
132 | btn_cal->setObjectName(QString("%1").arg(query.value("record").toString())); /* Send record with the button */ |
61c114afb0ee
Basic setup for iSpindel calibration.
Michiel Broek <mbroek@mbse.eu>
parents:
492
diff
changeset
|
133 | btn_cal->setText(tr("Cal")); |
61c114afb0ee
Basic setup for iSpindel calibration.
Michiel Broek <mbroek@mbse.eu>
parents:
492
diff
changeset
|
134 | connect(btn_cal, SIGNAL(clicked()), this, SLOT(on_calButton_clicked())); |
61c114afb0ee
Basic setup for iSpindel calibration.
Michiel Broek <mbroek@mbse.eu>
parents:
492
diff
changeset
|
135 | QHBoxLayout* cLayout = new QHBoxLayout(cWidget); |
61c114afb0ee
Basic setup for iSpindel calibration.
Michiel Broek <mbroek@mbse.eu>
parents:
492
diff
changeset
|
136 | cLayout->addWidget(btn_cal); |
61c114afb0ee
Basic setup for iSpindel calibration.
Michiel Broek <mbroek@mbse.eu>
parents:
492
diff
changeset
|
137 | cLayout->setContentsMargins(5, 0, 5, 0); |
61c114afb0ee
Basic setup for iSpindel calibration.
Michiel Broek <mbroek@mbse.eu>
parents:
492
diff
changeset
|
138 | cWidget->setLayout(cLayout); |
61c114afb0ee
Basic setup for iSpindel calibration.
Michiel Broek <mbroek@mbse.eu>
parents:
492
diff
changeset
|
139 | this->tableiSpindels->setCellWidget(i, 6, cWidget); |
61c114afb0ee
Basic setup for iSpindel calibration.
Michiel Broek <mbroek@mbse.eu>
parents:
492
diff
changeset
|
140 | |
61c114afb0ee
Basic setup for iSpindel calibration.
Michiel Broek <mbroek@mbse.eu>
parents:
492
diff
changeset
|
141 | /* Add the Details button */ |
310 | 142 | QWidget* pWidget = new QWidget(); |
143 | QPushButton* btn_edit = new QPushButton(); | |
311
449116c083bd
Respond to websocket ping. Added iSpindels monitor overview.
Michiel Broek <mbroek@mbse.eu>
parents:
310
diff
changeset
|
144 | btn_edit->setObjectName(QString("%1").arg(query.value("record").toString())); /* Send record with the button */ |
449116c083bd
Respond to websocket ping. Added iSpindels monitor overview.
Michiel Broek <mbroek@mbse.eu>
parents:
310
diff
changeset
|
145 | btn_edit->setText(tr("Details")); |
310 | 146 | connect(btn_edit, SIGNAL(clicked()), this, SLOT(on_editButton_clicked())); |
147 | QHBoxLayout* pLayout = new QHBoxLayout(pWidget); | |
148 | pLayout->addWidget(btn_edit); | |
149 | pLayout->setContentsMargins(5, 0, 5, 0); | |
150 | pWidget->setLayout(pLayout); | |
503
61c114afb0ee
Basic setup for iSpindel calibration.
Michiel Broek <mbroek@mbse.eu>
parents:
492
diff
changeset
|
151 | this->tableiSpindels->setCellWidget(i, 7, pWidget); |
310 | 152 | query.next(); |
153 | } | |
154 | emit setStatus(QString(tr("Total items: %1")).arg(query.size())); | |
155 | } | |
156 | ||
157 | ||
158 | MoniSpindels::~MoniSpindels() {} | |
159 | ||
160 | ||
311
449116c083bd
Respond to websocket ping. Added iSpindels monitor overview.
Michiel Broek <mbroek@mbse.eu>
parents:
310
diff
changeset
|
161 | void MoniSpindels::refreshiSpindels(QString data) |
449116c083bd
Respond to websocket ping. Added iSpindels monitor overview.
Michiel Broek <mbroek@mbse.eu>
parents:
310
diff
changeset
|
162 | { |
449116c083bd
Respond to websocket ping. Added iSpindels monitor overview.
Michiel Broek <mbroek@mbse.eu>
parents:
310
diff
changeset
|
163 | emit refreshTable(); |
329
b57299738980
Added iSpindel detail screen
Michiel Broek <mbroek@mbse.eu>
parents:
312
diff
changeset
|
164 | emit updateiSpindel(data); |
311
449116c083bd
Respond to websocket ping. Added iSpindels monitor overview.
Michiel Broek <mbroek@mbse.eu>
parents:
310
diff
changeset
|
165 | } |
449116c083bd
Respond to websocket ping. Added iSpindels monitor overview.
Michiel Broek <mbroek@mbse.eu>
parents:
310
diff
changeset
|
166 | |
449116c083bd
Respond to websocket ping. Added iSpindels monitor overview.
Michiel Broek <mbroek@mbse.eu>
parents:
310
diff
changeset
|
167 | |
310 | 168 | void MoniSpindels::edit(int recno) |
169 | { | |
329
b57299738980
Added iSpindel detail screen
Michiel Broek <mbroek@mbse.eu>
parents:
312
diff
changeset
|
170 | DetailiSpindel dialog(recno, this); |
b57299738980
Added iSpindel detail screen
Michiel Broek <mbroek@mbse.eu>
parents:
312
diff
changeset
|
171 | dialog.setModal(true); |
b57299738980
Added iSpindel detail screen
Michiel Broek <mbroek@mbse.eu>
parents:
312
diff
changeset
|
172 | dialog.exec(); |
310 | 173 | } |
174 | ||
175 | ||
176 | void MoniSpindels::on_editButton_clicked() | |
177 | { | |
178 | QPushButton *pb = qobject_cast<QPushButton *>(QObject::sender()); | |
179 | int recno = pb->objectName().toInt(); | |
180 | edit(recno); | |
181 | } | |
182 | ||
183 | ||
503
61c114afb0ee
Basic setup for iSpindel calibration.
Michiel Broek <mbroek@mbse.eu>
parents:
492
diff
changeset
|
184 | void MoniSpindels::cal(int recno) |
61c114afb0ee
Basic setup for iSpindel calibration.
Michiel Broek <mbroek@mbse.eu>
parents:
492
diff
changeset
|
185 | { |
61c114afb0ee
Basic setup for iSpindel calibration.
Michiel Broek <mbroek@mbse.eu>
parents:
492
diff
changeset
|
186 | CalibrateiSpindel dialog(recno, this); |
61c114afb0ee
Basic setup for iSpindel calibration.
Michiel Broek <mbroek@mbse.eu>
parents:
492
diff
changeset
|
187 | dialog.setModal(true); |
61c114afb0ee
Basic setup for iSpindel calibration.
Michiel Broek <mbroek@mbse.eu>
parents:
492
diff
changeset
|
188 | dialog.exec(); |
61c114afb0ee
Basic setup for iSpindel calibration.
Michiel Broek <mbroek@mbse.eu>
parents:
492
diff
changeset
|
189 | } |
61c114afb0ee
Basic setup for iSpindel calibration.
Michiel Broek <mbroek@mbse.eu>
parents:
492
diff
changeset
|
190 | |
61c114afb0ee
Basic setup for iSpindel calibration.
Michiel Broek <mbroek@mbse.eu>
parents:
492
diff
changeset
|
191 | |
61c114afb0ee
Basic setup for iSpindel calibration.
Michiel Broek <mbroek@mbse.eu>
parents:
492
diff
changeset
|
192 | void MoniSpindels::on_calButton_clicked() |
61c114afb0ee
Basic setup for iSpindel calibration.
Michiel Broek <mbroek@mbse.eu>
parents:
492
diff
changeset
|
193 | { |
61c114afb0ee
Basic setup for iSpindel calibration.
Michiel Broek <mbroek@mbse.eu>
parents:
492
diff
changeset
|
194 | QPushButton *pb = qobject_cast<QPushButton *>(QObject::sender()); |
61c114afb0ee
Basic setup for iSpindel calibration.
Michiel Broek <mbroek@mbse.eu>
parents:
492
diff
changeset
|
195 | int recno = pb->objectName().toInt(); |
61c114afb0ee
Basic setup for iSpindel calibration.
Michiel Broek <mbroek@mbse.eu>
parents:
492
diff
changeset
|
196 | cal(recno); |
61c114afb0ee
Basic setup for iSpindel calibration.
Michiel Broek <mbroek@mbse.eu>
parents:
492
diff
changeset
|
197 | } |
61c114afb0ee
Basic setup for iSpindel calibration.
Michiel Broek <mbroek@mbse.eu>
parents:
492
diff
changeset
|
198 |