26 * Build the table and buttons on the mainscreen. |
26 * Build the table and buttons on the mainscreen. |
27 * Don't use a ui file, do it dynamicly. |
27 * Don't use a ui file, do it dynamicly. |
28 */ |
28 */ |
29 MoniSpindels::MoniSpindels(QWidget *parent) : QDialog(parent) |
29 MoniSpindels::MoniSpindels(QWidget *parent) : QDialog(parent) |
30 { |
30 { |
|
31 #ifdef DEBUG_MONITOR |
31 qDebug() << "MoniSpindels start"; |
32 qDebug() << "MoniSpindels start"; |
|
33 #endif |
32 |
34 |
33 gridLayout = new QGridLayout(this); |
35 gridLayout = new QGridLayout(this); |
34 gridLayout->setObjectName(QString::fromUtf8("gridLayout")); |
36 gridLayout->setObjectName(QString::fromUtf8("gridLayout")); |
35 tableiSpindels = new QTableWidget(this); |
37 tableiSpindels = new QTableWidget(this); |
36 tableiSpindels->setObjectName(QString::fromUtf8("tableiSpindels")); |
38 tableiSpindels->setObjectName(QString::fromUtf8("tableiSpindels")); |
69 |
71 |
70 |
72 |
71 void MoniSpindels::refreshTable() |
73 void MoniSpindels::refreshTable() |
72 { |
74 { |
73 QTableWidgetItem *item; |
75 QTableWidgetItem *item; |
74 |
|
75 qDebug() << "MoniSpindels reload"; |
|
76 |
76 |
77 QSqlQuery query("SELECT record,alias,node,online,mode,temperature,gravity,beercode,beername FROM mon_ispindels ORDER BY alias"); |
77 QSqlQuery query("SELECT record,alias,node,online,mode,temperature,gravity,beercode,beername FROM mon_ispindels ORDER BY alias"); |
78 const QStringList labels({tr("Unit"), tr("Node"), tr("Status"), tr("Beer"), tr("Temperature"), tr("SG"), tr("Details")}); |
78 const QStringList labels({tr("Unit"), tr("Node"), tr("Status"), tr("Beer"), tr("Temperature"), tr("SG"), tr("Details")}); |
79 |
79 |
80 this->tableiSpindels->setColumnCount(7); |
80 this->tableiSpindels->setColumnCount(7); |