20 * Software Foundation, 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. |
20 * Software Foundation, 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. |
21 *****************************************************************************/ |
21 *****************************************************************************/ |
22 |
22 |
23 |
23 |
24 function createDelElements(){ |
24 function createDelElements(){ |
25 $('#eventWindow').jqxWindow({ |
25 |
26 theme:theme,position:{x:490,y:210},width:300,height:175,resizable:false,isModal:true,modalOpacity:0.4,okButton:$('#delOk'),cancelButton:$('#delCancel'), |
26 $('#eventWindow').jqxWindow({ |
27 initContent:function(){ |
27 theme:theme, |
28 $('#delOk').jqxButton({template:"danger",width:'65px',theme:theme}); |
28 position:{x:490,y:210}, |
29 $('#delCancel').jqxButton({template:"success",width:'65px',theme:theme}); |
29 width:300, |
30 $('#delCancel').focus();} |
30 height:175, |
31 }); |
31 resizable:false, |
32 $('#eventWindow').jqxWindow('hide'); |
32 isModal:true, |
|
33 modalOpacity:0.4, |
|
34 okButton:$('#delOk'), |
|
35 cancelButton:$('#delCancel'), |
|
36 initContent:function(){ |
|
37 $('#delOk').jqxButton({template:"danger",width:'65px',theme:theme}); |
|
38 $('#delCancel').jqxButton({template:"success",width:'65px',theme:theme}); |
|
39 $('#delCancel').focus(); |
|
40 } |
|
41 }); |
|
42 $('#eventWindow').jqxWindow('hide'); |
33 } |
43 } |
34 |
44 |
35 |
45 |
36 |
46 |
37 $(document).ready(function () { |
47 $(document).ready(function () { |
131 } else { |
141 } else { |
132 $("#fermentableGrid").jqxGrid('setcellvalue', 0, "f_percentage", 100); |
142 $("#fermentableGrid").jqxGrid('setcellvalue', 0, "f_percentage", 100); |
133 } |
143 } |
134 } |
144 } |
135 |
145 |
136 /* |
146 /* |
137 * All calculations that depend on changes in the fermentables, |
147 * All calculations that depend on changes in the fermentables, |
138 * volumes and equipments. |
148 * volumes and equipments. |
139 */ |
149 */ |
140 function calcFermentables() { |
150 function calcFermentables() { |
141 |
151 |
142 var sugarsf = 0; // fermentable sugars mash + boil |
152 var sugarsf = 0; // fermentable sugars mash + boil |
143 var sugarsm = 0; // fermentable sugars in mash |
153 var sugarsm = 0; // fermentable sugars in mash |
155 var colorn = 0; // Colors ebc * pt * pct |
165 var colorn = 0; // Colors ebc * pt * pct |
156 var my_100 = false; |
166 var my_100 = false; |
157 var mashtime = 0; // Total mash time |
167 var mashtime = 0; // Total mash time |
158 var mashtemp = 0; // Average mash temperature |
168 var mashtemp = 0; // Average mash temperature |
159 var bv = 0.925; // Bierverlies rendement |
169 var bv = 0.925; // Bierverlies rendement |
160 var sr = 0.95; // Mash en spoel rendement |
170 var sr = 0.95; // Mash en spoel rendement |
161 var lintner = 0; // Total recipe lintner |
171 var lintner = 0; // Total recipe lintner |
162 |
172 |
163 if ((rows = $('#mashGrid').jqxGrid('getrows'))) { |
173 if ((rows = $('#mashGrid').jqxGrid('getrows'))){ |
164 for (var i = 0; i < rows.length; i++) { |
174 for(var i=0;i<rows.length;i++){ |
165 var row = rows[i]; |
175 var row=rows[i]; |
166 if (row.step_type == 0) // Infusion |
176 if(row.step_type==0) // Infusion |
167 mvol += parseFloat(row.step_infuse_amount); |
177 mvol+=parseFloat(row.step_infuse_amount); |
168 if (row.step_temp <= 75) { // Ignore mashout |
178 if(row.step_temp<=75){ // Ignore mashout |
169 mashtime += row.step_time; |
179 var timem=row.step_time+row.ramp_time; |
170 mashtemp += row.step_time * row.step_temp; |
180 mashtime+=timem; |
|
181 mashtemp+=timem*row.step_temp; |
171 } |
182 } |
172 } |
183 } |
173 mashtemp = mashtemp / mashtime; |
184 if(mashtime>5) |
|
185 mashtime-=5;//Correct last ramp > 75 |
|
186 mashtemp=Round(mashtemp/mashtime,2); |
174 } |
187 } |
175 |
188 |
176 if (!(rows = $('#fermentableGrid').jqxGrid('getrows'))) { |
189 if (!(rows = $('#fermentableGrid').jqxGrid('getrows'))) { |
177 return; // grid not yet loaded. |
190 return; // grid not yet loaded. |
178 } |
191 } |