Sat, 09 Jul 2022 23:05:25 +0200
Increased some labels sizes.
333
499c95108bbd
Moved Fermenter and iSpindel charts to their own functions. Added these to DetailFermenter and DetailiSpindel too.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1 | /** |
499c95108bbd
Moved Fermenter and iSpindel charts to their own functions. Added these to DetailFermenter and DetailiSpindel too.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
2 | * ChartiSpindel.cpp is part of bmsapp. |
499c95108bbd
Moved Fermenter and iSpindel charts to their own functions. Added these to DetailFermenter and DetailiSpindel too.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
3 | * |
499c95108bbd
Moved Fermenter and iSpindel charts to their own functions. Added these to DetailFermenter and DetailiSpindel too.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
4 | * bmsapp is free software: you can redistribute it and/or modify |
499c95108bbd
Moved Fermenter and iSpindel charts to their own functions. Added these to DetailFermenter and DetailiSpindel too.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
5 | * it under the terms of the GNU General Public License as published by |
499c95108bbd
Moved Fermenter and iSpindel charts to their own functions. Added these to DetailFermenter and DetailiSpindel too.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
6 | * the Free Software Foundation, either version 3 of the License, or |
499c95108bbd
Moved Fermenter and iSpindel charts to their own functions. Added these to DetailFermenter and DetailiSpindel too.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
7 | * (at your option) any later version. |
499c95108bbd
Moved Fermenter and iSpindel charts to their own functions. Added these to DetailFermenter and DetailiSpindel too.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
8 | * |
499c95108bbd
Moved Fermenter and iSpindel charts to their own functions. Added these to DetailFermenter and DetailiSpindel too.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
9 | * bmsapp is distributed in the hope that it will be useful, |
499c95108bbd
Moved Fermenter and iSpindel charts to their own functions. Added these to DetailFermenter and DetailiSpindel too.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
499c95108bbd
Moved Fermenter and iSpindel charts to their own functions. Added these to DetailFermenter and DetailiSpindel too.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
499c95108bbd
Moved Fermenter and iSpindel charts to their own functions. Added these to DetailFermenter and DetailiSpindel too.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
12 | * GNU General Public License for more details. |
499c95108bbd
Moved Fermenter and iSpindel charts to their own functions. Added these to DetailFermenter and DetailiSpindel too.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
13 | * |
499c95108bbd
Moved Fermenter and iSpindel charts to their own functions. Added these to DetailFermenter and DetailiSpindel too.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
14 | * You should have received a copy of the GNU General Public License |
499c95108bbd
Moved Fermenter and iSpindel charts to their own functions. Added these to DetailFermenter and DetailiSpindel too.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
15 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
499c95108bbd
Moved Fermenter and iSpindel charts to their own functions. Added these to DetailFermenter and DetailiSpindel too.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
16 | */ |
499c95108bbd
Moved Fermenter and iSpindel charts to their own functions. Added these to DetailFermenter and DetailiSpindel too.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
17 | #include "ChartiSpindel.h" |
499c95108bbd
Moved Fermenter and iSpindel charts to their own functions. Added these to DetailFermenter and DetailiSpindel too.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
18 | #include "MainWindow.h" |
499c95108bbd
Moved Fermenter and iSpindel charts to their own functions. Added these to DetailFermenter and DetailiSpindel too.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
19 | |
499c95108bbd
Moved Fermenter and iSpindel charts to their own functions. Added these to DetailFermenter and DetailiSpindel too.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
20 | |
499c95108bbd
Moved Fermenter and iSpindel charts to their own functions. Added these to DetailFermenter and DetailiSpindel too.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
21 | ChartiSpindel::ChartiSpindel(QString code, QString name, QWidget *parent) : QDialog(parent) |
499c95108bbd
Moved Fermenter and iSpindel charts to their own functions. Added these to DetailFermenter and DetailiSpindel too.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
22 | { |
499c95108bbd
Moved Fermenter and iSpindel charts to their own functions. Added these to DetailFermenter and DetailiSpindel too.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
23 | QSqlQuery query; |
499c95108bbd
Moved Fermenter and iSpindel charts to their own functions. Added these to DetailFermenter and DetailiSpindel too.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
24 | double timestamp; |
499c95108bbd
Moved Fermenter and iSpindel charts to their own functions. Added these to DetailFermenter and DetailiSpindel too.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
25 | |
499c95108bbd
Moved Fermenter and iSpindel charts to their own functions. Added these to DetailFermenter and DetailiSpindel too.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
26 | qDebug() << "ChartiSpindel:" << code << name; |
499c95108bbd
Moved Fermenter and iSpindel charts to their own functions. Added these to DetailFermenter and DetailiSpindel too.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
27 | |
499c95108bbd
Moved Fermenter and iSpindel charts to their own functions. Added these to DetailFermenter and DetailiSpindel too.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
28 | QDialog* dialog = new QDialog(parent); |
334
9203fa01ddbf
Version 0.2.15 with updated translations.
Michiel Broek <mbroek@mbse.eu>
parents:
333
diff
changeset
|
29 | dialog->setWindowTitle(tr("BMSapp - iSpindel ") + "\"" + name + "\""); |
333
499c95108bbd
Moved Fermenter and iSpindel charts to their own functions. Added these to DetailFermenter and DetailiSpindel too.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
30 | dialog->setObjectName(QString::fromUtf8("ChartiSpindel")); |
499c95108bbd
Moved Fermenter and iSpindel charts to their own functions. Added these to DetailFermenter and DetailiSpindel too.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
31 | dialog->setWindowFlags(Qt::Window | Qt::WindowTitleHint | Qt::CustomizeWindowHint); |
499c95108bbd
Moved Fermenter and iSpindel charts to their own functions. Added these to DetailFermenter and DetailiSpindel too.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
32 | dialog->resize(1024, 600); |
499c95108bbd
Moved Fermenter and iSpindel charts to their own functions. Added these to DetailFermenter and DetailiSpindel too.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
33 | |
499c95108bbd
Moved Fermenter and iSpindel charts to their own functions. Added these to DetailFermenter and DetailiSpindel too.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
34 | QDialogButtonBox *buttonBox = new QDialogButtonBox(dialog); |
499c95108bbd
Moved Fermenter and iSpindel charts to their own functions. Added these to DetailFermenter and DetailiSpindel too.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
35 | buttonBox->setObjectName(QString::fromUtf8("buttonBox")); |
499c95108bbd
Moved Fermenter and iSpindel charts to their own functions. Added these to DetailFermenter and DetailiSpindel too.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
36 | buttonBox->setGeometry(QRect(40, 565, 944, 36)); |
499c95108bbd
Moved Fermenter and iSpindel charts to their own functions. Added these to DetailFermenter and DetailiSpindel too.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
37 | buttonBox->setLayoutDirection(Qt::LeftToRight); |
499c95108bbd
Moved Fermenter and iSpindel charts to their own functions. Added these to DetailFermenter and DetailiSpindel too.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
38 | buttonBox->setOrientation(Qt::Horizontal); |
499c95108bbd
Moved Fermenter and iSpindel charts to their own functions. Added these to DetailFermenter and DetailiSpindel too.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
39 | buttonBox->setStandardButtons(QDialogButtonBox::Ok); |
499c95108bbd
Moved Fermenter and iSpindel charts to their own functions. Added these to DetailFermenter and DetailiSpindel too.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
40 | buttonBox->setCenterButtons(true); |
499c95108bbd
Moved Fermenter and iSpindel charts to their own functions. Added these to DetailFermenter and DetailiSpindel too.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
41 | |
499c95108bbd
Moved Fermenter and iSpindel charts to their own functions. Added these to DetailFermenter and DetailiSpindel too.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
42 | QSplineSeries *temperature = new QSplineSeries(); |
499c95108bbd
Moved Fermenter and iSpindel charts to their own functions. Added these to DetailFermenter and DetailiSpindel too.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
43 | QSplineSeries *density = new QSplineSeries(); |
499c95108bbd
Moved Fermenter and iSpindel charts to their own functions. Added these to DetailFermenter and DetailiSpindel too.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
44 | QSplineSeries *battery = new QSplineSeries(); |
499c95108bbd
Moved Fermenter and iSpindel charts to their own functions. Added these to DetailFermenter and DetailiSpindel too.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
45 | |
499c95108bbd
Moved Fermenter and iSpindel charts to their own functions. Added these to DetailFermenter and DetailiSpindel too.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
46 | query.prepare("SELECT * FROM log_ispindel WHERE code=:code ORDER BY datetime"); |
499c95108bbd
Moved Fermenter and iSpindel charts to their own functions. Added these to DetailFermenter and DetailiSpindel too.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
47 | query.bindValue(":code", code); |
499c95108bbd
Moved Fermenter and iSpindel charts to their own functions. Added these to DetailFermenter and DetailiSpindel too.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
48 | query.exec(); |
499c95108bbd
Moved Fermenter and iSpindel charts to their own functions. Added these to DetailFermenter and DetailiSpindel too.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
49 | while (query.next()) { |
499c95108bbd
Moved Fermenter and iSpindel charts to their own functions. Added these to DetailFermenter and DetailiSpindel too.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
50 | timestamp = query.value("datetime").toDateTime().toSecsSinceEpoch() * 1000; |
499c95108bbd
Moved Fermenter and iSpindel charts to their own functions. Added these to DetailFermenter and DetailiSpindel too.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
51 | temperature->append(timestamp, query.value("temperature").toDouble()); |
499c95108bbd
Moved Fermenter and iSpindel charts to their own functions. Added these to DetailFermenter and DetailiSpindel too.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
52 | density->append(timestamp, query.value("sg").toDouble()); |
499c95108bbd
Moved Fermenter and iSpindel charts to their own functions. Added these to DetailFermenter and DetailiSpindel too.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
53 | battery ->append(timestamp, query.value("battery").toDouble()); |
499c95108bbd
Moved Fermenter and iSpindel charts to their own functions. Added these to DetailFermenter and DetailiSpindel too.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
54 | } |
499c95108bbd
Moved Fermenter and iSpindel charts to their own functions. Added these to DetailFermenter and DetailiSpindel too.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
55 | |
499c95108bbd
Moved Fermenter and iSpindel charts to their own functions. Added these to DetailFermenter and DetailiSpindel too.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
56 | temperature->setName(tr("Temp °C")); |
499c95108bbd
Moved Fermenter and iSpindel charts to their own functions. Added these to DetailFermenter and DetailiSpindel too.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
57 | temperature->setColor(QColorConstants::Svg::red); |
499c95108bbd
Moved Fermenter and iSpindel charts to their own functions. Added these to DetailFermenter and DetailiSpindel too.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
58 | density->setName(tr("SG")); |
499c95108bbd
Moved Fermenter and iSpindel charts to their own functions. Added these to DetailFermenter and DetailiSpindel too.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
59 | QPen pen(QColorConstants::Svg::navy); |
499c95108bbd
Moved Fermenter and iSpindel charts to their own functions. Added these to DetailFermenter and DetailiSpindel too.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
60 | pen.setWidth(3); |
499c95108bbd
Moved Fermenter and iSpindel charts to their own functions. Added these to DetailFermenter and DetailiSpindel too.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
61 | density->setPen(pen); |
499c95108bbd
Moved Fermenter and iSpindel charts to their own functions. Added these to DetailFermenter and DetailiSpindel too.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
62 | battery->setName(tr("Battery")); |
499c95108bbd
Moved Fermenter and iSpindel charts to their own functions. Added these to DetailFermenter and DetailiSpindel too.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
63 | battery->setColor(QColorConstants::Svg::limegreen); |
499c95108bbd
Moved Fermenter and iSpindel charts to their own functions. Added these to DetailFermenter and DetailiSpindel too.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
64 | |
499c95108bbd
Moved Fermenter and iSpindel charts to their own functions. Added these to DetailFermenter and DetailiSpindel too.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
65 | QChart *chart = new QChart(); |
499c95108bbd
Moved Fermenter and iSpindel charts to their own functions. Added these to DetailFermenter and DetailiSpindel too.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
66 | chart->setTitle(QString("%1 \"%2\"").arg(code).arg(name)); |
499c95108bbd
Moved Fermenter and iSpindel charts to their own functions. Added these to DetailFermenter and DetailiSpindel too.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
67 | chart->addSeries(battery); |
499c95108bbd
Moved Fermenter and iSpindel charts to their own functions. Added these to DetailFermenter and DetailiSpindel too.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
68 | chart->addSeries(temperature); |
499c95108bbd
Moved Fermenter and iSpindel charts to their own functions. Added these to DetailFermenter and DetailiSpindel too.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
69 | chart->addSeries(density); |
499c95108bbd
Moved Fermenter and iSpindel charts to their own functions. Added these to DetailFermenter and DetailiSpindel too.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
70 | |
499c95108bbd
Moved Fermenter and iSpindel charts to their own functions. Added these to DetailFermenter and DetailiSpindel too.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
71 | QDateTimeAxis *axisX = new QDateTimeAxis; |
499c95108bbd
Moved Fermenter and iSpindel charts to their own functions. Added these to DetailFermenter and DetailiSpindel too.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
72 | axisX->setTickCount(10); |
499c95108bbd
Moved Fermenter and iSpindel charts to their own functions. Added these to DetailFermenter and DetailiSpindel too.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
73 | axisX->setFormat("dd MMM"); |
499c95108bbd
Moved Fermenter and iSpindel charts to their own functions. Added these to DetailFermenter and DetailiSpindel too.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
74 | axisX->setTitleText(tr("Date")); |
499c95108bbd
Moved Fermenter and iSpindel charts to their own functions. Added these to DetailFermenter and DetailiSpindel too.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
75 | axisX->setLabelsFont(QFont("Helvetica", 8, QFont::Normal)); |
499c95108bbd
Moved Fermenter and iSpindel charts to their own functions. Added these to DetailFermenter and DetailiSpindel too.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
76 | chart->addAxis(axisX, Qt::AlignBottom); |
499c95108bbd
Moved Fermenter and iSpindel charts to their own functions. Added these to DetailFermenter and DetailiSpindel too.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
77 | battery->attachAxis(axisX); |
499c95108bbd
Moved Fermenter and iSpindel charts to their own functions. Added these to DetailFermenter and DetailiSpindel too.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
78 | temperature->attachAxis(axisX); |
499c95108bbd
Moved Fermenter and iSpindel charts to their own functions. Added these to DetailFermenter and DetailiSpindel too.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
79 | density->attachAxis(axisX); |
499c95108bbd
Moved Fermenter and iSpindel charts to their own functions. Added these to DetailFermenter and DetailiSpindel too.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
80 | |
499c95108bbd
Moved Fermenter and iSpindel charts to their own functions. Added these to DetailFermenter and DetailiSpindel too.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
81 | QValueAxis *axisYT = new QValueAxis; |
499c95108bbd
Moved Fermenter and iSpindel charts to their own functions. Added these to DetailFermenter and DetailiSpindel too.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
82 | axisYT->setTickCount(10); |
499c95108bbd
Moved Fermenter and iSpindel charts to their own functions. Added these to DetailFermenter and DetailiSpindel too.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
83 | axisYT->setLabelFormat("%.1f"); |
499c95108bbd
Moved Fermenter and iSpindel charts to their own functions. Added these to DetailFermenter and DetailiSpindel too.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
84 | axisYT->setTitleText(tr("Temperature °C")); |
499c95108bbd
Moved Fermenter and iSpindel charts to their own functions. Added these to DetailFermenter and DetailiSpindel too.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
85 | axisYT->setLabelsFont(QFont("Helvetica", 8, QFont::Normal)); |
499c95108bbd
Moved Fermenter and iSpindel charts to their own functions. Added these to DetailFermenter and DetailiSpindel too.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
86 | chart->addAxis(axisYT, Qt::AlignRight); |
499c95108bbd
Moved Fermenter and iSpindel charts to their own functions. Added these to DetailFermenter and DetailiSpindel too.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
87 | temperature->attachAxis(axisYT); |
499c95108bbd
Moved Fermenter and iSpindel charts to their own functions. Added these to DetailFermenter and DetailiSpindel too.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
88 | |
499c95108bbd
Moved Fermenter and iSpindel charts to their own functions. Added these to DetailFermenter and DetailiSpindel too.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
89 | QValueAxis *axisYD = new QValueAxis; |
499c95108bbd
Moved Fermenter and iSpindel charts to their own functions. Added these to DetailFermenter and DetailiSpindel too.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
90 | axisYD->setTickCount(10); |
499c95108bbd
Moved Fermenter and iSpindel charts to their own functions. Added these to DetailFermenter and DetailiSpindel too.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
91 | axisYD->setLabelFormat("%.3f"); |
499c95108bbd
Moved Fermenter and iSpindel charts to their own functions. Added these to DetailFermenter and DetailiSpindel too.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
92 | axisYD->setTitleText("SG"); |
499c95108bbd
Moved Fermenter and iSpindel charts to their own functions. Added these to DetailFermenter and DetailiSpindel too.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
93 | axisYD->setLabelsFont(QFont("Helvetica", 8, QFont::Normal)); |
499c95108bbd
Moved Fermenter and iSpindel charts to their own functions. Added these to DetailFermenter and DetailiSpindel too.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
94 | chart->addAxis(axisYD, Qt::AlignLeft); |
499c95108bbd
Moved Fermenter and iSpindel charts to their own functions. Added these to DetailFermenter and DetailiSpindel too.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
95 | density->attachAxis(axisYD); |
499c95108bbd
Moved Fermenter and iSpindel charts to their own functions. Added these to DetailFermenter and DetailiSpindel too.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
96 | |
499c95108bbd
Moved Fermenter and iSpindel charts to their own functions. Added these to DetailFermenter and DetailiSpindel too.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
97 | QValueAxis *axisYB = new QValueAxis; |
499c95108bbd
Moved Fermenter and iSpindel charts to their own functions. Added these to DetailFermenter and DetailiSpindel too.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
98 | axisYB->setTickCount(10); |
499c95108bbd
Moved Fermenter and iSpindel charts to their own functions. Added these to DetailFermenter and DetailiSpindel too.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
99 | axisYB->setLabelFormat("%.2f"); |
499c95108bbd
Moved Fermenter and iSpindel charts to their own functions. Added these to DetailFermenter and DetailiSpindel too.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
100 | axisYB->setTitleText(tr("Battery volt")); |
499c95108bbd
Moved Fermenter and iSpindel charts to their own functions. Added these to DetailFermenter and DetailiSpindel too.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
101 | axisYB->setLabelsFont(QFont("Helvetica", 8, QFont::Normal)); |
499c95108bbd
Moved Fermenter and iSpindel charts to their own functions. Added these to DetailFermenter and DetailiSpindel too.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
102 | chart->addAxis(axisYB, Qt::AlignRight); |
499c95108bbd
Moved Fermenter and iSpindel charts to their own functions. Added these to DetailFermenter and DetailiSpindel too.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
103 | battery->attachAxis(axisYB); |
499c95108bbd
Moved Fermenter and iSpindel charts to their own functions. Added these to DetailFermenter and DetailiSpindel too.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
104 | |
499c95108bbd
Moved Fermenter and iSpindel charts to their own functions. Added these to DetailFermenter and DetailiSpindel too.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
105 | QChartView *chartView = new QChartView(chart); |
499c95108bbd
Moved Fermenter and iSpindel charts to their own functions. Added these to DetailFermenter and DetailiSpindel too.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
106 | chartView->setRenderHint(QPainter::Antialiasing); |
499c95108bbd
Moved Fermenter and iSpindel charts to their own functions. Added these to DetailFermenter and DetailiSpindel too.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
107 | dialog->setLayout(new QVBoxLayout); |
499c95108bbd
Moved Fermenter and iSpindel charts to their own functions. Added these to DetailFermenter and DetailiSpindel too.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
108 | dialog->layout()->addWidget(chartView); |
499c95108bbd
Moved Fermenter and iSpindel charts to their own functions. Added these to DetailFermenter and DetailiSpindel too.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
109 | dialog->layout()->addWidget(buttonBox); |
499c95108bbd
Moved Fermenter and iSpindel charts to their own functions. Added these to DetailFermenter and DetailiSpindel too.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
110 | |
499c95108bbd
Moved Fermenter and iSpindel charts to their own functions. Added these to DetailFermenter and DetailiSpindel too.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
111 | QObject::connect(buttonBox, SIGNAL(accepted()), dialog, SLOT(accept())); |
499c95108bbd
Moved Fermenter and iSpindel charts to their own functions. Added these to DetailFermenter and DetailiSpindel too.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
112 | QObject::connect(buttonBox, SIGNAL(rejected()), dialog, SLOT(reject())); |
499c95108bbd
Moved Fermenter and iSpindel charts to their own functions. Added these to DetailFermenter and DetailiSpindel too.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
113 | |
499c95108bbd
Moved Fermenter and iSpindel charts to their own functions. Added these to DetailFermenter and DetailiSpindel too.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
114 | dialog->setModal(true); |
499c95108bbd
Moved Fermenter and iSpindel charts to their own functions. Added these to DetailFermenter and DetailiSpindel too.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
115 | dialog->exec(); |
499c95108bbd
Moved Fermenter and iSpindel charts to their own functions. Added these to DetailFermenter and DetailiSpindel too.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
116 | } |
499c95108bbd
Moved Fermenter and iSpindel charts to their own functions. Added these to DetailFermenter and DetailiSpindel too.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
117 | |
499c95108bbd
Moved Fermenter and iSpindel charts to their own functions. Added these to DetailFermenter and DetailiSpindel too.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
118 | |
499c95108bbd
Moved Fermenter and iSpindel charts to their own functions. Added these to DetailFermenter and DetailiSpindel too.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
119 | ChartiSpindel::~ChartiSpindel() {} |
499c95108bbd
Moved Fermenter and iSpindel charts to their own functions. Added these to DetailFermenter and DetailiSpindel too.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
120 |