src/DetailCO2meter.cpp

changeset 492
c3a781b4d35b
parent 491
76f3a96e82b5
child 518
6922856f4288
equal deleted inserted replaced
491:76f3a96e82b5 492:c3a781b4d35b
30 30
31 DetailCO2meter::DetailCO2meter(int id, QWidget *parent) : QDialog(parent), ui(new Ui::DetailCO2meter) 31 DetailCO2meter::DetailCO2meter(int id, QWidget *parent) : QDialog(parent), ui(new Ui::DetailCO2meter)
32 { 32 {
33 QSqlQuery query; 33 QSqlQuery query;
34 34
35 #ifdef DEBUG_MONITOR
35 qDebug() << "DetailCO2meter record:" << id; 36 qDebug() << "DetailCO2meter record:" << id;
37 #endif
38
36 ui->setupUi(this); 39 ui->setupUi(this);
37 this->recno = id; 40 this->recno = id;
38 setWindowFlags(Qt::Window | Qt::WindowTitleHint | Qt::CustomizeWindowHint); 41 setWindowFlags(Qt::Window | Qt::WindowTitleHint | Qt::CustomizeWindowHint);
39 setWindowTitle(tr("BMSapp - Details Carbonation")); 42 setWindowTitle(tr("BMSapp - Details Carbonation"));
40 43
62 65
63 void DetailCO2meter::refreshTable() 66 void DetailCO2meter::refreshTable()
64 { 67 {
65 QSqlQuery query, query2; 68 QSqlQuery query, query2;
66 QString sql = ""; 69 QString sql = "";
67
68 // qDebug() << "refreshTable co2meter rec:" << this->recno;
69 70
70 query.prepare("SELECT * FROM mon_co2meters WHERE record = :recno"); 71 query.prepare("SELECT * FROM mon_co2meters WHERE record = :recno");
71 query.bindValue(":recno", this->recno); 72 query.bindValue(":recno", this->recno);
72 query.exec(); 73 query.exec();
73 if (query.next()) { 74 if (query.next()) {
105 ui->maxVol->setValue(query2.value("st_carb_max").toDouble()); 106 ui->maxVol->setValue(query2.value("st_carb_max").toDouble());
106 ui->thisVol->setValue(query2.value("bottle_carbonation").toDouble()); 107 ui->thisVol->setValue(query2.value("bottle_carbonation").toDouble());
107 ui->minBar->setValue(barmin); 108 ui->minBar->setValue(barmin);
108 ui->maxBar->setValue(barmax); 109 ui->maxBar->setValue(barmax);
109 ui->thisBar->setValue(barthis); 110 ui->thisBar->setValue(barthis);
110 // qDebug() << " beerdata" << TSec << carbtemp << barmin << barmax << barthis;
111
112 ui->barMeter->setNominal(barmin); 111 ui->barMeter->setNominal(barmin);
113 ui->barMeter->setCritical(barmax); 112 ui->barMeter->setCritical(barmax);
114 } 113 }
115 114
116 bool alarm = (query.value("alarm").toInt() != 0) ? true:false; 115 bool alarm = (query.value("alarm").toInt() != 0) ? true:false;
218 msg.append(QString("\"beeruuid\":\"") + query.value("uuid").toString() + "\","); 217 msg.append(QString("\"beeruuid\":\"") + query.value("uuid").toString() + "\",");
219 msg.append(QString("\"beercode\":\"") + query.value("code").toString() + "\","); 218 msg.append(QString("\"beercode\":\"") + query.value("code").toString() + "\",");
220 msg.append(QString("\"beername\":\"") + query.value("name").toString() + "\"}"); 219 msg.append(QString("\"beername\":\"") + query.value("name").toString() + "\"}");
221 } 220 }
222 221
222 #ifdef DEBUG_MONITOR
223 qDebug() << "code_changed" << val << msg; 223 qDebug() << "code_changed" << val << msg;
224 #endif
224 webSocket->sendTextMessage(msg); 225 webSocket->sendTextMessage(msg);
225 } 226 }
226 227

mercurial