|
@@ -151,7 +151,9 @@
|
151
|
151
|
pluginContext = {};
|
152
|
152
|
pluginContext.table = findChildObject(this, 'log');
|
153
|
153
|
pluginContext.table.setHeaderData(1, "Temp");
|
|
154
|
+ pluginContext.table.addOutputTemperatureColumn(1);
|
154
|
155
|
pluginContext.table.setHeaderData(2, "Note");
|
|
156
|
+ pluginContext.table.addOutputAnnotationColumn(2);
|
155
|
157
|
pluginContext.graph = findChildObject(this, 'graph');
|
156
|
158
|
pluginContext.preRun = function() {
|
157
|
159
|
var filename = QFileDialog.getOpenFileName(window, TTR("manualLogEntry", "Import"), QSettings.value('script/lastDir', '') + '/');
|
|
@@ -279,6 +281,9 @@
|
279
|
281
|
currenttime.time = QTime(0, 0, 0, 0);
|
280
|
282
|
currenttemperature.text = "";
|
281
|
283
|
currentnote.text = "";
|
|
284
|
+ pluginContext.table.clearOutputColumns();
|
|
285
|
+ pluginContext.table.addOutputTemperatureColumn(1);
|
|
286
|
+ pluginContext.table.addOutputAnnotationColumn(2);
|
282
|
287
|
});
|
283
|
288
|
var sampleGreenName = findChildObject(this, 'sampleGreenName');
|
284
|
289
|
var sampleGreenWeight = findChildObject(this, 'sampleGreenWeight');
|
|
@@ -365,13 +370,15 @@
|
365
|
370
|
var buffer = new QBuffer;
|
366
|
371
|
buffer.open(3);
|
367
|
372
|
pluginContext.table.saveXML(buffer);
|
|
373
|
+ buffer.open(3); /* saveXML closes the buffer */
|
368
|
374
|
var q = "INSERT INTO files (id, name, type, note, file) VALUES (default, :name, 'profile', NULL, :data) RETURNING id";
|
369
|
375
|
query.prepare(q);
|
370
|
376
|
query.bind(":name", roastTime.text + " Manual Entry");
|
371
|
|
- query.bindDeviceData(":data", buffer);
|
|
377
|
+ query.bind(":data", buffer.readToString());
|
372
|
378
|
query.exec();
|
373
|
379
|
query.next();
|
374
|
|
- fileID = Number(query.value(0));
|
|
380
|
+ fileID = query.value(0);
|
|
381
|
+ buffer.close();
|
375
|
382
|
}
|
376
|
383
|
var rootIndex = machineModel.index(machineSelector.currentIndex, 0);
|
377
|
384
|
var selectedRoasterName = machineModel.data(rootIndex, 0);
|