Browse Source

Continue refactoring plan loading

Neal Wilson 6 years ago
parent
commit
c1274a90de
Signed by: neal <neal@typica.us> GPG Key ID: D6F25C90DD5819DF
2 changed files with 13 additions and 46 deletions
  1. 6
    6
      config/Windows/newbatch.xml
  2. 7
    40
      config/Windows/newsamplebatch.xml

+ 6
- 6
config/Windows/newbatch.xml View File

@@ -220,9 +220,9 @@
220 220
             var scalesLayout = findChildObject(this, 'scales');
221 221
             scalesLayout.spacing = 10;
222 222
             var batchTag = findChildObject(this, 'batchTag');
223
-            if(navigationwindow.loggingWindow.scales.length > 0) {
224
-                for(var i = 0; i < navigationwindow.loggingWindow.scales.length; i++) {
225
-                    var scale = navigationwindow.loggingWindow.scales[i];
223
+            if(Windows.loggingWindow.scales.length > 0) {
224
+                for(var i = 0; i < Windows.loggingWindow.scales.length; i++) {
225
+                    var scale = Windows.loggingWindow.scales[i];
226 226
                     var label = new DragLabel();
227 227
                     var weighButton = new QPushButton();
228 228
                     weighButton.text = "Weigh";
@@ -616,9 +616,9 @@
616 616
             var doNoProfile = function() {
617 617
                 batch.windowModified = true;
618 618
                 currentBatchInfo = batch;
619
-				navigationwindow.loggingWindow.clearLog();
620
-                navigationwindow.loggingWindow.raise();
621
-                navigationwindow.loggingWindow.activateWindow();
619
+				Windows.loggingWindow.clearLog();
620
+                Windows.loggingWindow.raise();
621
+                Windows.loggingWindow.activateWindow();
622 622
                 if(scheduledID > 0) {
623 623
                     markTaken();
624 624
                 }

+ 7
- 40
config/Windows/newsamplebatch.xml View File

@@ -201,10 +201,7 @@
201 201
                 }
202 202
             });
203 203
             var doRoast = function() {
204
-				var lc = 1;
205 204
 				currentBatchInfo = batch;
206
-                var targetseries = -1;
207
-                navigationwindow.loggingWindow.clearLog();
208 205
 				query = new QSqlQuery();
209 206
 				var q = "SELECT file FROM sample_roast_profiles WHERE profile_name = :name AND time = (SELECT max(time) FROM sample_roast_profiles WHERE profile_name = :again)";
210 207
 				query.prepare(q);
@@ -220,47 +217,17 @@
220 217
 					if(query.next())
221 218
 					{
222 219
 						var buffer = new QBuffer(query.value(0));
223
-						var input = new XMLInput(buffer, 1);
224
-						var graph = findChildObject(navigationwindow.loggingWindow, 'graph');
225
-						var log = findChildObject(navigationwindow.loggingWindow, 'log');
226
-						input.newTemperatureColumn.connect(function(col, text) {
227
-							log.setHeaderData(col, text);
228
-							if(text == navigationwindow.loggingWindow.targetcolumnname)
229
-							{
230
-								targetseries = col;
231
-							}
232
-						});
233
-						input.newAnnotationColumn.connect(log.setHeaderData);
234
-						input.measure.connect(graph.newMeasurement);
235
-						input.measure.connect(log.newMeasurement);
236
-						input.measure.connect(function(data, series) {
237
-							if(series == targetseries) {
238
-								targetDetector.newMeasurement(data);
239
-							}
240
-						});
241
-						input.annotation.connect(log.newAnnotation);
242
-						input.lastColumn.connect(function(c) {
243
-							lc = c;
244
-							QSettings.setValue("liveColumn", c+1);
245
-							navigationwindow.loggingWindow.postLoadColumnSetup(c);
246
-						});
247
-						log.updatesEnabled = false;
248
-						graph.updatesEnabled = false;
249
-						input.input();
250
-						graph.updatesEnabled = true;
251
-						log.updatesEnabled = true;
252
-						log.newAnnotation(TTR("sampleRoastingBatch", "End"), 1, lc);
220
+						Windows.loggingWindow.loadPlan(buffer, name.text);
253 221
 					}
254 222
 				}
255
-                navigationwindow.loggingWindow.raise();
256
-                navigationwindow.loggingWindow.activateWindow();
257
-				query = query.invalidate();
258
-				var t = TTR("sampleRoastingBatch", "Typica - Sample Roasting: [*]") + name.text;
259
-				if(profileName.currentText != '')
223
+				else
260 224
 				{
261
-					t = t + ", " + profileName.currentText;
225
+					Windows.loggingWindow.clearLog();
226
+					Windows.loggingWindow.windowTitle = 'Typica - [*]' + name.text;
227
+					Windows.loggingWindow.raise();
228
+					Windows.loggingWindow.activateWindow();
262 229
 				}
263
-				navigationwindow.loggingWindow.windowTitle = t;
230
+				query = query.invalidate();
264 231
 			};
265 232
 			var notes = findChildObject(this, 'annotation');
266 233
 			var machine = findChildObject(this, 'machine');

Loading…
Cancel
Save