Typica is a free program for professional coffee roasters. https://typica.us
Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

batchdetails.xml 6.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178
  1. <window id="batchDetails">
  2. <layout type="vertical">
  3. <layout type="horizontal">
  4. <label>Time:</label>
  5. <line editable="false" id="time" />
  6. </layout>
  7. <layout type="horizontal">
  8. <label>Name:</label>
  9. <line editable="false" id="name" />
  10. </layout>
  11. <layout type="horizontal">
  12. <label>Green:</label>
  13. <line editable="false" id="green" />
  14. </layout>
  15. <layout type="horizontal">
  16. <label>Roasted:</label>
  17. <line editable="false" id="roasted" />
  18. </layout>
  19. <layout type="horizontal">
  20. <label>Duration:</label>
  21. <line editable="false" id="duration" />
  22. </layout>
  23. <layout type="horizontal">
  24. <label>Approval:</label>
  25. <line editable="false" id="approval" />
  26. </layout>
  27. <layout type="horizontal">
  28. <label>Files:</label>
  29. <line id="files" />
  30. </layout>
  31. <layout type="vertical">
  32. <button type="push" id="target" name="Load profile as target" />
  33. <button type="push" id="view" name="View profile" />
  34. <button type="push" id="compare" name="Compare profile" />
  35. </layout>
  36. </layout>
  37. <program>
  38. <![CDATA[
  39. var widget = this;
  40. var target = findChildObject(this, 'target');
  41. var batchTime = findChildObject(this, 'time');
  42. var filesfield = findChildObject(this, 'files');
  43. var compare = findChildObject(this, 'compare');
  44. if(typeof(navigationwindow.loggingWindow) == "undefined")
  45. {
  46. compare.enabled = false;
  47. target.enabled = false;
  48. }
  49. compare.clicked.connect(function() {
  50. files = filesfield.text;
  51. files = files.replace("{", "(");
  52. files = files.replace("}", ")");
  53. var q = "SELECT file, name FROM files WHERE id IN ";
  54. q = q + files;
  55. q = q + " AND type = 'profile'";
  56. query = new QSqlQuery();
  57. query.exec(q);
  58. query.next();
  59. var buffer = new QBuffer(query.value(0));
  60. var pname = query.value(1);
  61. query = query.invalidate();
  62. var startSeries = Number(QSettings.value('cseries', 3));
  63. var nextSeries = startSeries + 2;
  64. QSettings.setValue('cseries', nextSeries);
  65. var input = new XMLInput(buffer, startSeries);
  66. var graph = findChildObject(navigationwindow.loggingWindow, 'graph');
  67. input.measure.connect(graph.newMeasurement);
  68. input.input();
  69. });
  70. target.clicked.connect(function() {
  71. files = filesfield.text;
  72. files = files.replace("{", "(");
  73. files = files.replace("}", ")");
  74. var q = "SELECT file, name FROM files WHERE id IN ";
  75. q = q + files;
  76. q = q + " AND type = 'profile'";
  77. query = new QSqlQuery();
  78. query.exec(q);
  79. query.next();
  80. var targetseries = -1;
  81. var buffer = new QBuffer(query.value(0));
  82. var pname = query.value(1);
  83. query = query.invalidate();
  84. var input = new XMLInput(buffer, 1);
  85. var graph = findChildObject(navigationwindow.loggingWindow, 'graph');
  86. var log = findChildObject(navigationwindow.loggingWindow, 'log');
  87. log.clear();
  88. graph.clear();
  89. input.newTemperatureColumn.connect(log.setHeaderData);
  90. input.newTemperatureColumn.connect(function(col, text) {
  91. if(text == navigationwindow.loggingWindow.targetcolumnname)
  92. {
  93. targetseries = col;
  94. }
  95. });
  96. input.newAnnotationColumn.connect(log.setHeaderData);
  97. input.measure.connect(graph.newMeasurement);
  98. input.measure.connect(log.newMeasurement);
  99. input.measure.connect(function(data, series) {
  100. if(series == targetseries)
  101. {
  102. targetDetector.newMeasurement(data);
  103. }
  104. });
  105. var lc;
  106. input.lastColumn.connect(function(c) {
  107. lc = c;
  108. QSettings.setValue("liveColumn", c + 1);
  109. navigationwindow.loggingWindow.postLoadColumnSetup(c);
  110. });
  111. input.annotation.connect(log.newAnnotation);
  112. input.annotation.connect(function(note, tcol, ncol) {
  113. for(var i = tcol; i < ncol; i++) {
  114. log.newAnnotation(note, i, ncol);
  115. }
  116. });
  117. navigationwindow.loggingWindow.windowTitle = "Typica - " + pname;
  118. navigationwindow.loggingWindow.raise();
  119. navigationwindow.loggingWindow.activateWindow();
  120. input.input();
  121. log.newAnnotation("End", 1, lc);
  122. });
  123. var viewbutton = findChildObject(this, 'view');
  124. viewbutton.clicked.connect(function() {
  125. files = filesfield.text;
  126. files = files.replace("{", "(");
  127. files = files.replace("}", ")");
  128. var q = "SELECT file, name FROM files WHERE id IN ";
  129. q = q + files;
  130. q = q + " AND type = 'profile'";
  131. query = new QSqlQuery();
  132. query.exec(q);
  133. if(query.next()) {
  134. var viewer = createWindow('offline');
  135. var buffer = new QBuffer(query.value(0));
  136. var pname = query.value(1);
  137. query = query.invalidate();
  138. var input = new XMLInput(buffer, 1);
  139. var graph = findChildObject(viewer, 'graph');
  140. var log = findChildObject(viewer, 'log');
  141. input.newTemperatureColumn.connect(log.setHeaderData);
  142. input.newTemperatureColumn.connect(function(column) {
  143. viewer.saveTemperatureColumns.push(column);
  144. });
  145. input.newAnnotationColumn.connect(log.setHeaderData);
  146. input.newAnnotationColumn.connect(function(column) {
  147. viewer.saveAnnotationColumns.push(column);
  148. });
  149. input.measure.connect(graph.newMeasurement);
  150. input.measure.connect(log.newMeasurement);
  151. input.annotation.connect(log.newAnnotation);
  152. var lc;
  153. input.lastColumn.connect(function(c) {
  154. lc = c;
  155. if(c < 3)
  156. {
  157. log.setHeaderData(3, "");
  158. }
  159. });
  160. input.annotation.connect(function(note, tcol, ncol) {
  161. for(var i = tcol; i < ncol; i++) {
  162. log.newAnnotation(note, i, ncol);
  163. }
  164. });
  165. viewer.windowTitle = "Typica - " + pname;
  166. viewer.raise();
  167. viewer.activateWindow();
  168. input.input();
  169. log.newAnnotation("End", 1, lc);
  170. }
  171. else {
  172. print("Query returned no results");
  173. }
  174. query = query.invalidate();
  175. });
  176. ]]>
  177. </program>
  178. </window>