123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178 |
- <window id="batchDetails">
- <layout type="vertical">
- <layout type="horizontal">
- <label>Time:</label>
- <line editable="false" id="time" />
- </layout>
- <layout type="horizontal">
- <label>Name:</label>
- <line editable="false" id="name" />
- </layout>
- <layout type="horizontal">
- <label>Green:</label>
- <line editable="false" id="green" />
- </layout>
- <layout type="horizontal">
- <label>Roasted:</label>
- <line editable="false" id="roasted" />
- </layout>
- <layout type="horizontal">
- <label>Duration:</label>
- <line editable="false" id="duration" />
- </layout>
- <layout type="horizontal">
- <label>Approval:</label>
- <line editable="false" id="approval" />
- </layout>
- <layout type="horizontal">
- <label>Files:</label>
- <line id="files" />
- </layout>
- <layout type="vertical">
- <button type="push" id="target" name="Load profile as target" />
- <button type="push" id="view" name="View profile" />
- <button type="push" id="compare" name="Compare profile" />
- </layout>
- </layout>
- <program>
- <![CDATA[
- var widget = this;
- var target = findChildObject(this, 'target');
- var batchTime = findChildObject(this, 'time');
- var filesfield = findChildObject(this, 'files');
- var compare = findChildObject(this, 'compare');
- if(typeof(navigationwindow.loggingWindow) == "undefined")
- {
- compare.enabled = false;
- target.enabled = false;
- }
- compare.clicked.connect(function() {
- files = filesfield.text;
- files = files.replace("{", "(");
- files = files.replace("}", ")");
- var q = "SELECT file, name FROM files WHERE id IN ";
- q = q + files;
- q = q + " AND type = 'profile'";
- query = new QSqlQuery();
- query.exec(q);
- query.next();
- var buffer = new QBuffer(query.value(0));
- var pname = query.value(1);
- query = query.invalidate();
- var startSeries = Number(QSettings.value('cseries', 3));
- var nextSeries = startSeries + 2;
- QSettings.setValue('cseries', nextSeries);
- var input = new XMLInput(buffer, startSeries);
- var graph = findChildObject(navigationwindow.loggingWindow, 'graph');
- input.measure.connect(graph.newMeasurement);
- input.input();
- });
- target.clicked.connect(function() {
- files = filesfield.text;
- files = files.replace("{", "(");
- files = files.replace("}", ")");
- var q = "SELECT file, name FROM files WHERE id IN ";
- q = q + files;
- q = q + " AND type = 'profile'";
- query = new QSqlQuery();
- query.exec(q);
- query.next();
- var targetseries = -1;
- var buffer = new QBuffer(query.value(0));
- var pname = query.value(1);
- query = query.invalidate();
- var input = new XMLInput(buffer, 1);
- var graph = findChildObject(navigationwindow.loggingWindow, 'graph');
- var log = findChildObject(navigationwindow.loggingWindow, 'log');
- log.clear();
- graph.clear();
- input.newTemperatureColumn.connect(log.setHeaderData);
- input.newTemperatureColumn.connect(function(col, text) {
- if(text == navigationwindow.loggingWindow.targetcolumnname)
- {
- targetseries = col;
- }
- });
- input.newAnnotationColumn.connect(log.setHeaderData);
- input.measure.connect(graph.newMeasurement);
- input.measure.connect(log.newMeasurement);
- input.measure.connect(function(data, series) {
- if(series == targetseries)
- {
- targetDetector.newMeasurement(data);
- }
- });
- var lc;
- input.lastColumn.connect(function(c) {
- lc = c;
- QSettings.setValue("liveColumn", c + 1);
- navigationwindow.loggingWindow.postLoadColumnSetup(c);
- });
- input.annotation.connect(log.newAnnotation);
- input.annotation.connect(function(note, tcol, ncol) {
- for(var i = tcol; i < ncol; i++) {
- log.newAnnotation(note, i, ncol);
- }
- });
- navigationwindow.loggingWindow.windowTitle = "Typica - " + pname;
- navigationwindow.loggingWindow.raise();
- navigationwindow.loggingWindow.activateWindow();
- input.input();
- log.newAnnotation("End", 1, lc);
- });
- var viewbutton = findChildObject(this, 'view');
- viewbutton.clicked.connect(function() {
- files = filesfield.text;
- files = files.replace("{", "(");
- files = files.replace("}", ")");
- var q = "SELECT file, name FROM files WHERE id IN ";
- q = q + files;
- q = q + " AND type = 'profile'";
- query = new QSqlQuery();
- query.exec(q);
- if(query.next()) {
- var viewer = createWindow('offline');
- var buffer = new QBuffer(query.value(0));
- var pname = query.value(1);
- query = query.invalidate();
- var input = new XMLInput(buffer, 1);
- var graph = findChildObject(viewer, 'graph');
- var log = findChildObject(viewer, 'log');
- input.newTemperatureColumn.connect(log.setHeaderData);
- input.newTemperatureColumn.connect(function(column) {
- viewer.saveTemperatureColumns.push(column);
- });
- input.newAnnotationColumn.connect(log.setHeaderData);
- input.newAnnotationColumn.connect(function(column) {
- viewer.saveAnnotationColumns.push(column);
- });
- input.measure.connect(graph.newMeasurement);
- input.measure.connect(log.newMeasurement);
- input.annotation.connect(log.newAnnotation);
- var lc;
- input.lastColumn.connect(function(c) {
- lc = c;
- if(c < 3)
- {
- log.setHeaderData(3, "");
- }
- });
- input.annotation.connect(function(note, tcol, ncol) {
- for(var i = tcol; i < ncol; i++) {
- log.newAnnotation(note, i, ncol);
- }
- });
- viewer.windowTitle = "Typica - " + pname;
- viewer.raise();
- viewer.activateWindow();
- input.input();
- log.newAnnotation("End", 1, lc);
- }
- else {
- print("Query returned no results");
- }
- query = query.invalidate();
- });
- ]]>
- </program>
- </window>
|