Explorar el Código

Fix regression in defining new sample roast profiles

Neal Wilson hace 7 años
padre
commit
5ea01b811d
Se han modificado 2 ficheros con 32 adiciones y 33 borrados
  1. 7
    9
      config/Windows/newsamplebatch.xml
  2. 25
    24
      config/Windows/productionroaster.xml

+ 7
- 9
config/Windows/newsamplebatch.xml Ver fichero

@@ -199,10 +199,12 @@
199 199
                 if(proceed) {
200 200
                     doRoast();
201 201
                 }
202
-                });
203
-                var doRoast = function() {
202
+            });
203
+            var doRoast = function() {
204 204
 				var lc = 1;
205 205
 				currentBatchInfo = batch;
206
+                var targetseries = -1;
207
+                navigationwindow.loggingWindow.clearLog();
206 208
 				query = new QSqlQuery();
207 209
 				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)";
208 210
 				query.prepare(q);
@@ -217,13 +219,10 @@
217 219
 					query.exec();
218 220
 					if(query.next())
219 221
 					{
220
-						var targetseries = -1;
221 222
 						var buffer = new QBuffer(query.value(0));
222 223
 						var input = new XMLInput(buffer, 1);
223 224
 						var graph = findChildObject(navigationwindow.loggingWindow, 'graph');
224 225
 						var log = findChildObject(navigationwindow.loggingWindow, 'log');
225
-						log.clear();
226
-						graph.clear();
227 226
 						input.newTemperatureColumn.connect(function(col, text) {
228 227
 							log.setHeaderData(col, text);
229 228
 							if(text == navigationwindow.loggingWindow.targetcolumnname)
@@ -235,8 +234,7 @@
235 234
 						input.measure.connect(graph.newMeasurement);
236 235
 						input.measure.connect(log.newMeasurement);
237 236
 						input.measure.connect(function(data, series) {
238
-							if(series == targetseries)
239
-							{
237
+							if(series == targetseries) {
240 238
 								targetDetector.newMeasurement(data);
241 239
 							}
242 240
 						});
@@ -246,8 +244,6 @@
246 244
 							QSettings.setValue("liveColumn", c+1);
247 245
 							navigationwindow.loggingWindow.postLoadColumnSetup(c);
248 246
 						});
249
-						navigationwindow.loggingWindow.raise();
250
-						navigationwindow.loggingWindow.activateWindow();
251 247
 						log.updatesEnabled = false;
252 248
 						graph.updatesEnabled = false;
253 249
 						input.input();
@@ -256,6 +252,8 @@
256 252
 						log.newAnnotation(TTR("sampleRoastingBatch", "End"), 1, lc);
257 253
 					}
258 254
 				}
255
+                navigationwindow.loggingWindow.raise();
256
+                navigationwindow.loggingWindow.activateWindow();
259 257
 				query = query.invalidate();
260 258
 				var t = TTR("sampleRoastingBatch", "Typica - Sample Roasting: [*]") + name.text;
261 259
 				if(profileName.currentText != '')

+ 25
- 24
config/Windows/productionroaster.xml Ver fichero

@@ -1163,10 +1163,30 @@
1163 1163
 		if(QSettings.value("temperatureUnit", "F") == "C") {
1164 1164
 			showC.trigger();
1165 1165
 		}
1166
+        window.postLoadColumnSetup = function(c) {
1167
+			for(var i = 0; i < adapters.length; i++) {
1168
+				adapters[i].setColumn(c + i + 1);
1169
+				zeroemitters[i].setColumn(c + i + 1);
1170
+				log.setHeaderData(c + i + 1, columnName(i));
1171
+			}
1172
+			log.setHeaderData(c + columnNames.length + 1 - channelSkip, TTR("basicWindow", "Note"));
1173
+            stop.setTemperatureColumn(c + 1);
1174
+			stop.setAnnotationColumn(c + columnNames.length + 1 - channelSkip);
1175
+			for(var i = 0; i < annotationButtons.length; i++) {
1176
+				annotationButtons[i].setTemperatureColumn(c + 1);
1177
+				annotationButtons[i].setAnnotationColumn(c + columnNames.length + 1 - channelSkip);
1178
+			}
1179
+			log.clearCurrentColumnSet();
1180
+			for(var i = 0; i < channels.length - channelSkip; i++) {
1181
+				log.addToCurrentColumnSet(c + i + 1);
1182
+			}
1183
+			window.firstTempColumn = c + 1;
1184
+			window.annotationColumn = c + columnNames.length - channelSkip + 1;
1185
+		}
1166 1186
 		var clear = findChildObject(this, 'clear');
1167
-        clear.triggered.connect(log.clear);
1168
-        clear.triggered.connect(graph.clear);
1169
-        clear.triggered.connect(function() {
1187
+        window.clearLog = function() {
1188
+            log.clear();
1189
+            graph.clear();
1170 1190
             window.windowTitle = "Typica [*]";
1171 1191
 			log.setHeaderData(0, "Time");
1172 1192
             QSettings.setValue("liveColumn", 1);
@@ -1176,7 +1196,8 @@
1176 1196
 			}
1177 1197
 			resetTranslation.enabled = false;
1178 1198
 			setTranslation.enabled = false;
1179
-        });
1199
+        };
1200
+        clear.triggered.connect(window.clearLog);
1180 1201
 		var openMenu = findChildObject(this, 'open');
1181 1202
         var compareMenu = findChildObject(this, 'compare');
1182 1203
         compareMenu.triggered.connect(function() {
@@ -1252,26 +1273,6 @@
1252 1273
 			}
1253 1274
 			return "";
1254 1275
 		};
1255
-		window.postLoadColumnSetup = function(c) {
1256
-			for(var i = 0; i < adapters.length; i++) {
1257
-				adapters[i].setColumn(c + i + 1);
1258
-				zeroemitters[i].setColumn(c + i + 1);
1259
-				log.setHeaderData(c + i + 1, columnName(i));
1260
-			}
1261
-			log.setHeaderData(c + columnNames.length + 1 - channelSkip, TTR("basicWindow", "Note"));
1262
-            stop.setTemperatureColumn(c + 1);
1263
-			stop.setAnnotationColumn(c + columnNames.length + 1 - channelSkip);
1264
-			for(var i = 0; i < annotationButtons.length; i++) {
1265
-				annotationButtons[i].setTemperatureColumn(c + 1);
1266
-				annotationButtons[i].setAnnotationColumn(c + columnNames.length + 1 - channelSkip);
1267
-			}
1268
-			log.clearCurrentColumnSet();
1269
-			for(var i = 0; i < channels.length - channelSkip; i++) {
1270
-				log.addToCurrentColumnSet(c + i + 1);
1271
-			}
1272
-			window.firstTempColumn = c + 1;
1273
-			window.annotationColumn = c + columnNames.length - channelSkip + 1;
1274
-		}
1275 1276
 		var saveMenu = findChildObject(this, 'save');
1276 1277
         saveMenu.triggered.connect(function() {
1277 1278
             var filename = QFileDialog.getSaveFileName(window, TTR("basicWindow", "Save Log As..."), QSettings.value("script/lastDir", "") + "/");

Loading…
Cancelar
Guardar