Bläddra i källkod

Merge branch 'release-1.6.4' of https://github.com/N3Roaster/typica into release-1.6.4

Neal Wilson 9 år sedan
förälder
incheckning
9239ee566d

+ 11
- 3
config/Windows/greeninventory.xml Visa fil

@@ -15,6 +15,7 @@
15 15
 			var units = findChildObject(this, 'units');
16 16
 			units.addItem("bag");
17 17
 			units.addItem("lb");
18
+			units.addItem("kg");
18 19
 			var items = findChildObject(this, 'item');
19 20
 			var status = findChildObject(this, 'current');
20 21
 			var q = "SELECT quantity FROM items WHERE id = ";
@@ -25,7 +26,9 @@
25 26
 			var text = items.currentText;
26 27
 			text = text + " Current inventory: ";
27 28
 			text = text + query.value(0);
28
-			text = text + " pounds (";
29
+			text = text + " pounds ("
30
+			text = text + Number(query.value(0)) / 2.2;
31
+			text = text + " Kg (";
29 32
 			q = "SELECT ";
30 33
 			q = q + query.value(0);
31 34
 			q = q + " / (SELECT conversion FROM lb_bag_conversion WHERE item = ";
@@ -45,7 +48,10 @@
45 48
 				q = q + ", ";
46 49
 				if(units.currentText == "lb") {
47 50
 					q = q + value.text;
48
-				} else {
51
+				} else if (units.currentText == "kg") {
52
+					q = q + (value.text * 2.2);
53
+				}
54
+				else {
49 55
 					q = q + value.text;
50 56
 					q = q + " * (SELECT conversion FROM lb_bag_conversion WHERE item = ";
51 57
 					q = q + items.currentData();
@@ -83,7 +89,9 @@
83 89
 				var text = items.currentText;
84 90
 				text = text + " Current inventory: ";
85 91
 				text = text + query.value(0);
86
-				text = text + " pounds (";
92
+				text = text + " pounds ";
93
+				text = text + Number(query.value(0)) / 2.2;
94
+				text = text + " Kg (";
87 95
 				q = "SELECT ";
88 96
 				q = q + query.value(0);
89 97
 				q = q + " / (SELECT conversion FROM lb_bag_conversion WHERE item = ";

+ 1
- 1
config/Windows/history.xml Visa fil

@@ -31,7 +31,7 @@
31 31
 				var dateRange = dateSelect.currentRange();
32 32
 				var startDate = "'"+dateRange[0]+"'";
33 33
 				var endDate = "'"+dateRange[dateRange.length - 1]+"'";
34
-				var q = "SELECT time, machine, (SELECT name FROM items WHERE id = roasted_id) AS name, unroasted_total_quantity AS green, roasted_quantity AS roasted, ((unroasted_total_quantity - roasted_quantity) / unroasted_total_quantity * 100::numeric)::numeric(12,2) AS weight_loss, duration, annotation FROM roasting_log WHERE time >= " + startDate + "::date AND time < " + endDate + "::date + interval '1 day' ORDER BY time DESC";
34
+				var q = "SELECT time, machine, (SELECT name FROM items WHERE id = roasted_id) AS name, unroasted_total_quantity AS green, roasted_quantity AS roasted, CASE WHEN unroasted_total_quantity = 0 THEN NULL ELSE ((unroasted_total_quantity - roasted_quantity) / unroasted_total_quantity * 100::numeric)::numeric(12,2) END AS weight_loss, duration, annotation FROM roasting_log WHERE time >= " + startDate + "::date AND time < " + endDate + "::date + interval '1 day' ORDER BY time DESC";
35 35
 				table.setQuery(q);
36 36
 				table.hideColumn(1);
37 37
 			}

+ 1
- 1
config/Windows/productionroaster.xml Visa fil

@@ -1130,7 +1130,7 @@
1130 1130
                 var file = new QFile(filename);
1131 1131
                 log.clearOutputColumns();
1132 1132
 				channelSkip = 0;
1133
-				for(var i = 0; i < columnNames.length - channelSkip; i++)
1133
+				for(var i = 0; i < channels.length; i++)
1134 1134
 				{
1135 1135
 					if(channelVisibility[i]) {
1136 1136
 						if(channelType[i] == "T") {

Laddar…
Avbryt
Spara