|
@@ -1222,48 +1222,54 @@
|
1222
|
1222
|
exportWindow.windowTitle = TTR("basicWindow", "Typica - Export XHTML+SVG");
|
1223
|
1223
|
exportWindow.log = log;
|
1224
|
1224
|
});
|
|
1225
|
+ window.loadPlan = function(device, name) {
|
|
1226
|
+ window.clearLog();
|
|
1227
|
+ var input = new XMLInput(device, 1);
|
|
1228
|
+ targetseries = -1;
|
|
1229
|
+ input.newTemperatureColumn.connect(log.setHeaderData);
|
|
1230
|
+ input.newTemperatureColumn.connect(function(col, text) {
|
|
1231
|
+ if(text == window.targetcolumnname) {
|
|
1232
|
+ targetseries = col;
|
|
1233
|
+ }
|
|
1234
|
+ });
|
|
1235
|
+ input.newAnnotationColumn.connect(log.setHeaderData);
|
|
1236
|
+ input.measure.connect(graph.newMeasurement);
|
|
1237
|
+ input.measure.connect(log.newMeasurement);
|
|
1238
|
+ input.measure.connect(function(data, series) {
|
|
1239
|
+ if(series == targetseries) {
|
|
1240
|
+ targetDetector.newMeasurement(data);
|
|
1241
|
+ }
|
|
1242
|
+ });
|
|
1243
|
+ resetTranslation.enabled = false;
|
|
1244
|
+ setTranslation.enabled = false;
|
|
1245
|
+ input.annotation.connect(log.newAnnotation);
|
|
1246
|
+ input.annotation.connect(function(note, tcol, ncol) {
|
|
1247
|
+ for(var i = tcol; i < ncol; i++) {
|
|
1248
|
+ log.newAnnotation(note, i, ncol);
|
|
1249
|
+ }
|
|
1250
|
+ });
|
|
1251
|
+ var lc;
|
|
1252
|
+ input.lastColumn.connect(function(c) {
|
|
1253
|
+ lc = c;
|
|
1254
|
+ QSettings.setValue("liveColumn", c + 1);
|
|
1255
|
+ window.postLoadColumnSetup(c);
|
|
1256
|
+ });
|
|
1257
|
+ graph.updatesEnabled = false;
|
|
1258
|
+ log.updatesEnabled = false;
|
|
1259
|
+ input.input();
|
|
1260
|
+ log.updatesEnabled = true;
|
|
1261
|
+ graph.updatesEnabled = true;
|
|
1262
|
+ window.windowTitle = 'Typica - [*]' + name;
|
|
1263
|
+ log.newAnnotation(TTR("basicWindow", "End"), 1, lc);
|
|
1264
|
+ window.raise();
|
|
1265
|
+ window.activateWindow();
|
|
1266
|
+ }
|
1225
|
1267
|
openMenu.triggered.connect(function() {
|
1226
|
1268
|
var filename = QFileDialog.getOpenFileName(window, TTR("basicWindow", "Open Log..."), QSettings.value('script/lastDir', '') + '/');
|
1227
|
1269
|
if(filename != '') {
|
1228
|
1270
|
var file = new QFile(filename);
|
1229
|
|
- var input = new XMLInput(file, 1);
|
1230
|
|
- targetseries = -1;
|
1231
|
|
- input.newTemperatureColumn.connect(log.setHeaderData);
|
1232
|
|
- input.newTemperatureColumn.connect(function(col, text) {
|
1233
|
|
- if(text == window.targetcolumnname) {
|
1234
|
|
- targetseries = col;
|
1235
|
|
- }
|
1236
|
|
- });
|
1237
|
|
- input.newAnnotationColumn.connect(log.setHeaderData);
|
1238
|
|
- input.measure.connect(graph.newMeasurement);
|
1239
|
|
- input.measure.connect(log.newMeasurement);
|
1240
|
|
- input.measure.connect(function(data, series) {
|
1241
|
|
- if(series == targetseries) {
|
1242
|
|
- targetDetector.newMeasurement(data);
|
1243
|
|
- }
|
1244
|
|
- });
|
1245
|
|
- resetTranslation.enabled = false;
|
1246
|
|
- setTranslation.enabled = false;
|
1247
|
|
- input.annotation.connect(log.newAnnotation);
|
1248
|
|
- input.annotation.connect(function(note, tcol, ncol) {
|
1249
|
|
- for(var i = tcol; i < ncol; i++) {
|
1250
|
|
- log.newAnnotation(note, i, ncol);
|
1251
|
|
- }
|
1252
|
|
- });
|
1253
|
|
- var lc;
|
1254
|
|
- input.lastColumn.connect(function(c) {
|
1255
|
|
- lc = c;
|
1256
|
|
- QSettings.setValue("liveColumn", c + 1);
|
1257
|
|
- window.postLoadColumnSetup(c);
|
1258
|
|
- });
|
1259
|
|
- graph.updatesEnabled = false;
|
1260
|
|
- log.updatesEnabled = false;
|
1261
|
|
- input.input();
|
1262
|
|
- log.updatesEnabled = true;
|
1263
|
|
- graph.updatesEnabled = true;
|
1264
|
|
- window.windowTitle = 'Typica - [*]' + baseName(filename);
|
|
1271
|
+ window.loadPlan(file, baseName(filename));
|
1265
|
1272
|
QSettings.setValue("script/lastDir", dir(filename));
|
1266
|
|
- log.newAnnotation(TTR("basicWindow", "End"), 1, lc);
|
1267
|
1273
|
}
|
1268
|
1274
|
});
|
1269
|
1275
|
var columnName = function(c) {
|