Typica is a free program for professional coffee roasters. https://typica.us
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

manuallogentry.xml 4.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. <window id="manualLogEntry">
  2. <layout type="horizontal"><!-- Top horizontal layout -->
  3. <layout type="vertical"><!-- Left vertical layout -->
  4. <layout type="horizontal">
  5. <label>Batch Type:</label>
  6. <sqldrop id="batchType" />
  7. <stretch />
  8. </layout>
  9. <label>Green Coffee:</label>
  10. <layout type="stack" id="greenInfoLayout"><!-- Green information -->
  11. <page id="sampleGreen">
  12. <layout type="vertical">
  13. <layout type="grid">
  14. <row>
  15. <column><label>Name:</label></column>
  16. <column><line id="sampleGreenName" /></column>
  17. </row>
  18. <row>
  19. <column><label>Weight:</label></column>
  20. <column><line id="sampleGreenWeight" /></column>
  21. <column><sqldrop id="sampleGreenUnit" /></column>
  22. </row>
  23. <row>
  24. <column><label>Vendor:</label></column>
  25. <column><line id="sampleGreenVendor" /></column>
  26. </row>
  27. <row>
  28. <column><label>Arrival Date:</label></column>
  29. <column><line id="sampleGreenArrivalDate" /></column>
  30. </row>
  31. </layout>
  32. <label>Additional Details:</label>
  33. <sqltablearray columns="2" id="attributes">
  34. <column name="Attribute" />
  35. <column name="Value" />
  36. </sqltablearray>
  37. </layout>
  38. </page>
  39. <page id="productionGreen">
  40. <layout type="vertical">
  41. <layout type="horizontal">
  42. <label>Unit:</label>
  43. <sqldrop id="productionGreenUnit" />
  44. <stretch />
  45. </layout>
  46. <sqltablearray columns="2" id="productionGreenTable">
  47. <column name="Coffee" delegate="sql" showdata="true" null="true" nulltext="Delete" nulldata="delete" data="0" display="1">
  48. <![CDATA[SELECT id, name FROM coffees WHERE quantity <> 0 ORDER BY name]]>
  49. </column>
  50. <column name="Weight" delegate="numeric" />
  51. </sqltablearray>
  52. </layout>
  53. </page>
  54. </layout><!-- End of green information -->
  55. <label>Roasting Details:</label>
  56. <layout type="grid">
  57. <row>
  58. <column><label>Item:</label></column>
  59. <column>
  60. <sqldrop data="0" display="1" showdata="true" id="roastedItem">
  61. <null />
  62. <query>SELECT id, name FROM items WHERE category = 'Coffee: Roasted' AND id IN (SELECT item FROM current_items) ORDER BY name</query>
  63. </sqldrop>
  64. </column>
  65. </row>
  66. <row>
  67. <column><label>Weight:</label></column>
  68. <column><line id="roastedWeight" validator="numeric" /></column>
  69. </row>
  70. <row>
  71. <column><label>Time:</label></column>
  72. <column><line id="roastTime" /></column>
  73. </row>
  74. <row>
  75. <column><label>Duration:</label></column>
  76. <column><line id="roastDuration" /></column>
  77. </row>
  78. </layout>
  79. </layout><!-- End of left vertical layout -->
  80. </layout><!-- End of top horizontal layout -->
  81. <program>
  82. <![CDATA[
  83. greenInfoLayout = findChildObject(this, 'greenInfoLayout');
  84. roastedItem = findChildObject(this, 'roastedItem');
  85. batchType = findChildObject(this, 'batchType');
  86. batchType.addItem("Sample");
  87. batchType.addItem("Production");
  88. batchType['currentIndexChanged(int)'].connect(function(batchTypeIndex) {
  89. QSettings.setValue("script/manual_batchType", batchTypeIndex);
  90. greenInfoLayout.setCurrentIndex(batchTypeIndex);
  91. roastedItem.enabled = (batchTypeIndex == 1);
  92. });
  93. batchType.setCurrentIndex(QSettings.value("script/manual_batchType", 1));
  94. roastedItem.enabled = (batchTypeIndex == 1);
  95. sampleGreenUnit = findChildObject(this, 'sampleGreenUnit');
  96. sampleGreenUnit.addItem("g");
  97. sampleGreenUnit.addItem("Kg");
  98. sampleGreenUnit.addItem("oz");
  99. sampleGreenUnit.addItem("lb");
  100. sampleGreenUnit.currentIndex = (QSettings.value("script/manual_unit", sampleGreenUnit.findText("lb")));
  101. productionGreenUnit = findChildObject(this, 'productionGreenUnit');
  102. productionGreenUnit.addItem("g");
  103. productionGreenUnit.addItem("Kg");
  104. productionGreenUnit.addItem("oz");
  105. productionGreenUnit.addItem("lb");
  106. productionGreenUnit.currentIndex = (QSettings.value("script/manual_unit", productionGreenUnit.findText("lb")));
  107. sampleGreenUnit['currentIndexChanged(int)'].connect(function(greenUnitIndex) {
  108. QSettings.setValue("script/manual_unit", greenUnitIndex);
  109. productionGreenUnit.setCurrentIndex(greenUnitIndex);
  110. });
  111. productionGreenUnit['currentIndexChanged(int)'].connect(function(greenUnitIndex) {
  112. QSettings.setValue("script/manual_unit", greenUnitIndex);
  113. sampleGreenUnit.setCurrentIndex(greenUnitIndex);
  114. });
  115. ]]>
  116. </program>
  117. </window>