|
@@ -12,49 +12,22 @@ Rectangle {
|
12
|
12
|
|
13
|
13
|
width: 720
|
14
|
14
|
height: 680
|
15
|
|
- Component.onCompleted: {
|
16
|
|
- var quitItem = window.addMenuItem("File", "Quit");
|
17
|
|
- quitItem.shortcut = "Ctrl+Q";
|
18
|
|
- quitItem.triggered.connect(function() {
|
19
|
|
- Qt.quit();
|
20
|
|
- });
|
21
|
|
- var clearItem = window.addMenuItem("Plotting", "Clear Data");
|
22
|
|
- clearItem.triggered.connect(function() {
|
23
|
|
- graph.clear();
|
24
|
|
- dataViewModel.clear();
|
25
|
|
- root.sumy = 0;
|
26
|
|
- root.sumxsq = 0;
|
27
|
|
- root.sumx = 0;
|
28
|
|
- root.sumxy = 0;
|
29
|
|
- root.n = 0;
|
30
|
|
- graph.setFit(0, 0, 0, 0);
|
31
|
|
- });
|
32
|
|
- var showLeastSquares = window.addMenuItem("Plotting", "Least Squares Fit");
|
33
|
|
- showLeastSquares.checkable = true;
|
34
|
|
- showLeastSquares.triggered.connect(function() {
|
35
|
|
- graph.setFitVisible(showLeastSquares.checked);
|
36
|
|
- lsfrow.visible = showLeastSquares.checked;
|
37
|
|
- });
|
38
|
|
- }
|
|
15
|
+
|
39
|
16
|
BrewingControlChart {
|
40
|
17
|
id: graph
|
41
|
18
|
|
42
|
|
- width: 450
|
43
|
|
- height: 600
|
44
|
|
- anchors.right: parent.right
|
45
|
|
- anchors.rightMargin: 20
|
46
|
|
- anchors.top: parent.top
|
47
|
|
- anchors.topMargin: 20
|
|
19
|
+ width: 450; height: 600
|
|
20
|
+ anchors {right: parent.right; rightMargin: 20; top: parent.top; topMargin: 20}
|
48
|
21
|
}
|
49
|
22
|
Item {
|
50
|
|
- anchors.left: parent.left
|
51
|
|
- anchors.leftMargin: 10
|
52
|
|
- anchors.top: parent.top
|
53
|
|
- anchors.topMargin: 10
|
|
23
|
+ anchors {left: parent.left; leftMargin: 10; top: parent.top; topMargin: 10}
|
|
24
|
+
|
54
|
25
|
Column {
|
55
|
26
|
spacing: 8
|
|
27
|
+
|
56
|
28
|
Row {
|
57
|
29
|
spacing: 5
|
|
30
|
+
|
58
|
31
|
Text {
|
59
|
32
|
text: "Mass of ground coffee: "
|
60
|
33
|
}
|
|
@@ -69,10 +42,8 @@ Rectangle {
|
69
|
42
|
}
|
70
|
43
|
|
71
|
44
|
Line {
|
72
|
|
- x1: -3
|
73
|
|
- x2: 33
|
74
|
|
- y1: groundMass.height
|
75
|
|
- y2: y1
|
|
45
|
+ x1: -3; y1: groundMass.height
|
|
46
|
+ x2: 33; y2: y1
|
76
|
47
|
penWidth: 1
|
77
|
48
|
color: "black"
|
78
|
49
|
}
|
|
@@ -80,6 +51,7 @@ Rectangle {
|
80
|
51
|
}
|
81
|
52
|
Row {
|
82
|
53
|
spacing: 5
|
|
54
|
+
|
83
|
55
|
Text {
|
84
|
56
|
text: "Mass of brewed coffee:"
|
85
|
57
|
}
|
|
@@ -94,10 +66,8 @@ Rectangle {
|
94
|
66
|
}
|
95
|
67
|
|
96
|
68
|
Line {
|
97
|
|
- x1: -3
|
98
|
|
- x2: 33
|
99
|
|
- y1: brewedMass.height
|
100
|
|
- y2: y1
|
|
69
|
+ x1: -3; y1: brewedMass.height
|
|
70
|
+ x2: 33; y2: y1
|
101
|
71
|
penWidth: 1
|
102
|
72
|
color: "black"
|
103
|
73
|
}
|
|
@@ -105,11 +75,13 @@ Rectangle {
|
105
|
75
|
}
|
106
|
76
|
Row {
|
107
|
77
|
spacing: 56
|
|
78
|
+
|
108
|
79
|
Text {
|
109
|
80
|
text: "Percent TDS:"
|
110
|
81
|
}
|
111
|
82
|
TextInput {
|
112
|
83
|
id: ptds
|
|
84
|
+
|
113
|
85
|
width: 30
|
114
|
86
|
validator: DoubleValidator {
|
115
|
87
|
bottom: 0
|
|
@@ -117,11 +89,10 @@ Rectangle {
|
117
|
89
|
decimals: 2
|
118
|
90
|
notation: DoubleValidator.StandardNotation
|
119
|
91
|
}
|
|
92
|
+
|
120
|
93
|
Line {
|
121
|
|
- x1: -3
|
122
|
|
- x2: 33
|
123
|
|
- y1: ptds.height
|
124
|
|
- y2: y1
|
|
94
|
+ x1: -3; y1: ptds.height
|
|
95
|
+ x2: 33; y2: y1
|
125
|
96
|
penWidth: 1
|
126
|
97
|
color: "black"
|
127
|
98
|
}
|
|
@@ -129,29 +100,34 @@ Rectangle {
|
129
|
100
|
}
|
130
|
101
|
Row {
|
131
|
102
|
spacing: 87
|
|
103
|
+
|
132
|
104
|
Text {
|
133
|
105
|
id: colorlabel
|
|
106
|
+
|
134
|
107
|
text: "Color:"
|
135
|
108
|
}
|
136
|
109
|
ColorPicker {
|
137
|
110
|
id: colorpicker
|
138
|
|
- width: 37
|
139
|
|
- height: colorlabel.height
|
|
111
|
+
|
|
112
|
+ width: 37; height: colorlabel.height
|
140
|
113
|
}
|
141
|
114
|
}
|
142
|
115
|
Row {
|
143
|
116
|
id: lsfrow
|
144
|
|
- visible: false
|
145
|
117
|
|
|
118
|
+ visible: false
|
146
|
119
|
spacing: 1
|
|
120
|
+
|
147
|
121
|
Text {
|
148
|
122
|
id: fitcolorlabel
|
|
123
|
+
|
149
|
124
|
text: "Least Squares Fit Color:"
|
150
|
125
|
}
|
151
|
126
|
ColorPicker {
|
152
|
127
|
id: fitcolorpicker
|
153
|
|
- width: 37
|
154
|
|
- height: colorlabel.height
|
|
128
|
+
|
|
129
|
+ width: 37; height: colorlabel.height
|
|
130
|
+
|
155
|
131
|
onColorChanged: {
|
156
|
132
|
graph.setFitColor(color)
|
157
|
133
|
}
|
|
@@ -160,19 +136,19 @@ Rectangle {
|
160
|
136
|
Rectangle {
|
161
|
137
|
z: 0
|
162
|
138
|
anchors.horizontalCenter: parent.horizontalCenter
|
163
|
|
- height: buttonText.height + 20
|
164
|
|
- width: buttonText.width + 40
|
|
139
|
+ height: buttonText.height + 20; width: buttonText.width + 40
|
165
|
140
|
border.color: "black"
|
166
|
141
|
radius: 10
|
|
142
|
+
|
167
|
143
|
Text {
|
168
|
144
|
id: buttonText
|
169
|
145
|
|
170
|
146
|
text: "Plot This Brew"
|
171
|
|
- anchors.horizontalCenter: parent.horizontalCenter
|
172
|
|
- anchors.verticalCenter: parent.verticalCenter
|
|
147
|
+ anchors {horizontalCenter: parent.horizontalCenter; verticalCenter: parent.verticalCenter}
|
173
|
148
|
}
|
174
|
149
|
MouseArea {
|
175
|
150
|
anchors.fill: parent
|
|
151
|
+
|
176
|
152
|
onClicked: {
|
177
|
153
|
var extraction = (brewedMass.text * (ptds.text / 100)) / groundMass.text
|
178
|
154
|
graph.plotPoint(extraction, (ptds.text / 100), colorpicker.color)
|
|
@@ -218,9 +194,9 @@ Rectangle {
|
218
|
194
|
}
|
219
|
195
|
delegate: Row {
|
220
|
196
|
spacing: 3
|
|
197
|
+
|
221
|
198
|
Rectangle {
|
222
|
|
- width: 30
|
223
|
|
- height: 30
|
|
199
|
+ width: 30; height: 30
|
224
|
200
|
color: dataViewModel.get(index).color
|
225
|
201
|
}
|
226
|
202
|
Column {
|
|
@@ -235,4 +211,28 @@ Rectangle {
|
235
|
211
|
}
|
236
|
212
|
}
|
237
|
213
|
}
|
|
214
|
+ Component.onCompleted: {
|
|
215
|
+ var quitItem = window.addMenuItem("File", "Quit");
|
|
216
|
+ quitItem.shortcut = "Ctrl+Q";
|
|
217
|
+ quitItem.triggered.connect(function() {
|
|
218
|
+ Qt.quit();
|
|
219
|
+ });
|
|
220
|
+ var clearItem = window.addMenuItem("Plotting", "Clear Data");
|
|
221
|
+ clearItem.triggered.connect(function() {
|
|
222
|
+ graph.clear();
|
|
223
|
+ dataViewModel.clear();
|
|
224
|
+ root.sumy = 0;
|
|
225
|
+ root.sumxsq = 0;
|
|
226
|
+ root.sumx = 0;
|
|
227
|
+ root.sumxy = 0;
|
|
228
|
+ root.n = 0;
|
|
229
|
+ graph.setFit(0, 0, 0, 0);
|
|
230
|
+ });
|
|
231
|
+ var showLeastSquares = window.addMenuItem("Plotting", "Least Squares Fit");
|
|
232
|
+ showLeastSquares.checkable = true;
|
|
233
|
+ showLeastSquares.triggered.connect(function() {
|
|
234
|
+ graph.setFitVisible(showLeastSquares.checked);
|
|
235
|
+ lsfrow.visible = showLeastSquares.checked;
|
|
236
|
+ });
|
|
237
|
+ }
|
238
|
238
|
}
|