Browse Source

Replaced grid line model population with a loop.

Neal Wilson 11 years ago
parent
commit
7987d34160
1 changed files with 8 additions and 15 deletions
  1. 8
    15
      qml/BrewPlot/BrewingControlChart.qml

+ 8
- 15
qml/BrewPlot/BrewingControlChart.qml View File

@@ -237,21 +237,14 @@ Item {
237 237
         }
238 238
     }
239 239
 	Component.onCompleted: {
240
-		xGridLines.append({"value": 0.14, "pwidth": 1})
241
-		xGridLines.append({"value": 0.15, "pwidth": 1})
242
-		xGridLines.append({"value": 0.16, "pwidth": 1})
243
-		xGridLines.append({"value": 0.17, "pwidth": 1})
244
-		xGridLines.append({"value": 0.18, "pwidth": 2})
245
-		xGridLines.append({"value": 0.19, "pwidth": 1})
246
-		xGridLines.append({"value": 0.20, "pwidth": 1})
247
-		xGridLines.append({"value": 0.21, "pwidth": 1})
248
-		xGridLines.append({"value": 0.22, "pwidth": 2})
249
-		xGridLines.append({"value": 0.23, "pwidth": 1})
250
-		xGridLines.append({"value": 0.24, "pwidth": 1})
251
-		xGridLines.append({"value": 0.25, "pwidth": 1})
252
-		xGridLines.append({"value": 0.26, "pwidth": 1})
240
+        for(var i = 0.14; i < 0.261; i += 0.01) {
241
+            xGridLines.append({"value": i, "pwidth": i.toFixed(2) == 0.18 || i.toFixed(2) == 0.22 ? 2 : 1});
242
+        }
243
+        for(var i = 0.008; i < 0.0161; i += 0.0005) {
244
+            yGridLines.append({"value": i, "pwidth": i.toFixed(4) == 0.0115 || i.toFixed(4) == 0.0135 ? 2 : 1});
245
+        }
253 246
 		
254
-		yGridLines.append({"value": 0.008, "pwidth": 1})
247
+/*		yGridLines.append({"value": 0.008, "pwidth": 1})
255 248
 		yGridLines.append({"value": 0.0085, "pwidth": 1})
256 249
 		yGridLines.append({"value": 0.009, "pwidth": 1})
257 250
 		yGridLines.append({"value": 0.0095, "pwidth": 1})
@@ -267,6 +260,6 @@ Item {
267 260
 		yGridLines.append({"value": 0.0145, "pwidth": 1})
268 261
 		yGridLines.append({"value": 0.015, "pwidth": 1})
269 262
 		yGridLines.append({"value": 0.0155, "pwidth": 1})
270
-		yGridLines.append({"value": 0.016, "pwidth": 1})
263
+        yGridLines.append({"value": 0.016, "pwidth": 1})*/
271 264
 	}
272 265
 }

Loading…
Cancel
Save