main/setup.c

changeset 101
1bc6e9263ada
parent 95
c02e12e9c884
child 103
1885d0c75c48
equal deleted inserted replaced
100:9833fd86736b 101:1bc6e9263ada
166 read_equipment(CurrentRec); 166 read_equipment(CurrentRec);
167 TFT_setFont(DEFAULT_FONT, NULL); 167 TFT_setFont(DEFAULT_FONT, NULL);
168 ShowText(2, 28, (char *)"Naam", equipment.Name); 168 ShowText(2, 28, (char *)"Naam", equipment.Name);
169 ShowInteger( 2, 44, (char *)"Kook vermogen", (char *)"%", equipment.BoilPower); 169 ShowInteger( 2, 44, (char *)"Kook vermogen", (char *)"%", equipment.BoilPower);
170 ShowInteger(161, 44, (char *)"Maisch verm.", (char *)"%", equipment.MashPower); 170 ShowInteger(161, 44, (char *)"Maisch verm.", (char *)"%", equipment.MashPower);
171 ShowInteger( 2, 60, (char *)"Pomp cyclus", (char *)"m", equipment.PumpCycle); 171 ShowInteger( 2, 60, (char *)"Ramp vermogen", (char *)"%", equipment.RampPower);
172 ShowInteger(161, 60, (char *)"Pomp rust", (char *)"m", equipment.PumpRest); 172 ShowFloat(161, 60, (char *)"Spoelwater", NULL, equipment.TempHLT, 2);
173 ShowBool( 2, 76, (char *)"Pomp opwarmen", equipment.PumpPreMash); 173 ShowInteger( 2, 76, (char *)"Sample tijd", (char *)"mS", equipment.SampleTime);
174 ShowBool(161, 76, (char *)"Pomp maischen", equipment.PumpOnMash); 174 Show2Integer(161, 76, (char *)"Pomp cyclus", (char *)"m", equipment.PumpCycle, equipment.PumpRest);
175 ShowBool( 2, 92, (char *)"Pomp uitmaischen", equipment.PumpMashOut); 175 ShowBool( 2, 92, (char *)"Pomp opwarmen", equipment.PumpPreMash);
176 ShowBool(161, 92, (char *)"Pomp bij koken", equipment.PumpOnBoil); 176 ShowBool(161, 92, (char *)"Pomp maischen", equipment.PumpOnMash);
177 ShowInteger(2, 108, (char *)"Pomp maxtemp.", (char *)"C", equipment.PumpMaxTemp); 177 ShowBool( 2, 108, (char *)"Pomp uitmaischen", equipment.PumpMashOut);
178 ShowBool(161, 108, (char *)"PID bij mout weg", equipment.PIDPipe); 178 ShowBool(161, 108, (char *)"Pomp bij koken", equipment.PumpOnBoil);
179 ShowSSR2(2, 124, equipment.SSR2); 179 ShowInteger(2, 124, (char *)"Pomp maxtemp.", (char *)"C", equipment.PumpMaxTemp);
180 ShowFloat(161, 124, (char *)"Spoelwater", NULL, equipment.TempHLT, 2); 180 ShowBool(161, 124, (char *)"PID bij mout weg", equipment.PIDPipe);
181 ShowDouble(2, 140, (char *)"PID P", NULL, equipment.PID_kP, 3); 181 ShowSSR2(2, 140, equipment.SSR2);
182 ShowInteger(161, 140, (char *)"Sample tijd", (char *)"mS", equipment.SampleTime); 182 ShowBool(161, 140, (char *)"Hendi PWM", equipment.Hendi);
183 ShowDouble(2, 156, (char *)"PID I", NULL, equipment.PID_kI, 3); 183 ShowDouble(2, 156, (char *)"PID P", NULL, equipment.PID_kP, 3);
184 ShowInteger(161, 156, (char *)"MLT watt", NULL, equipment.MLT_watt); 184 ShowInteger(161, 156, (char *)"MLT watt", NULL, equipment.MLT_watt);
185 ShowDouble(2, 172, (char *)"PID D", NULL, equipment.PID_kD, 3); 185 ShowDouble(2, 172, (char *)"PID I", NULL, equipment.PID_kI, 3);
186 ShowInteger(161, 172, (char *)"HLT watt", NULL, equipment.HLT_watt); 186 ShowInteger(161, 172, (char *)"HLT watt", NULL, equipment.HLT_watt);
187 ShowDouble(2, 188, (char *)"PID D", NULL, equipment.PID_kD, 3);
188 ShowInteger(161, 188, (char *)"Max watt", NULL, equipment.Max_watt);
187 Buttons_Clear(); 189 Buttons_Clear();
188 Buttons_Add( 0, 210, 45, 30, (char *)"Ok" , 0); 190 Buttons_Add( 0, 210, 45, 30, (char *)"Ok" , 0);
189 Buttons_Add( 46, 210, 45, 30, (char *)"+" , 1); 191 Buttons_Add( 46, 210, 45, 30, (char *)"+" , 1);
190 if (CurrentRec != config.EquipmentRec) 192 if (CurrentRec != config.EquipmentRec)
191 Buttons_Add( 92, 210, 45, 30, (char *)"-", 2); 193 Buttons_Add( 92, 210, 45, 30, (char *)"-", 2);
282 dst = (uint8_t*)&equipment; 284 dst = (uint8_t*)&equipment;
283 crc1 = crc32_le(0, dst, sizeof(equipment)); 285 crc1 = crc32_le(0, dst, sizeof(equipment));
284 EditText((char *)"Naam", equipment.Name, 31); 286 EditText((char *)"Naam", equipment.Name, 31);
285 EditInt((char *)"Kook vermogen in %", &equipment.BoilPower, 0, 100); 287 EditInt((char *)"Kook vermogen in %", &equipment.BoilPower, 0, 100);
286 EditInt((char *)"Maisch vermogen in %", &equipment.MashPower, 0, 100); 288 EditInt((char *)"Maisch vermogen in %", &equipment.MashPower, 0, 100);
289 EditInt((char *)"Ramp vermogen in %", &equipment.RampPower, 0, 100);
290 EditFloat((char *)"Spoelwater temp", &equipment.TempHLT, 75, 98, 2);
291 // Round to 0.25 values.
292 equipment.TempHLT = ((int)(equipment.TempHLT * 4)) / 4.0;
293 EditInt((char *)"Sample tijd in mS", &equipment.SampleTime, 1000, 20000);
294 // Round to 250 mSec units.
295 equipment.SampleTime = ((int)(equipment.SampleTime / 250)) * 250;
287 EditInt((char *)"Pomp cyclus minuten", &equipment.PumpCycle, 5, 15); 296 EditInt((char *)"Pomp cyclus minuten", &equipment.PumpCycle, 5, 15);
288 EditInt((char *)"Pomp rust minuten", &equipment.PumpRest, 0, 5); 297 EditInt((char *)"Pomp rust minuten", &equipment.PumpRest, 0, 5);
289 EditBool((char *)"Pomp bij opwarmen", &equipment.PumpPreMash); 298 EditBool((char *)"Pomp bij opwarmen", &equipment.PumpPreMash);
290 EditBool((char *)"Pomp bij maischen", &equipment.PumpOnMash); 299 EditBool((char *)"Pomp bij maischen", &equipment.PumpOnMash);
291 EditBool((char *)"Pomp bij uitmaischen", &equipment.PumpMashOut); 300 EditBool((char *)"Pomp bij uitmaischen", &equipment.PumpMashOut);
292 EditBool((char *)"Pomp tijdens koken", &equipment.PumpOnBoil); 301 EditBool((char *)"Pomp tijdens koken", &equipment.PumpOnBoil);
293 EditInt((char *)"Pomp max. temperatuur", &equipment.PumpMaxTemp, 60, 105); 302 EditInt((char *)"Pomp max. temperatuur", &equipment.PumpMaxTemp, 60, 105);
294 EditBool((char *)"PID by mout verwijderen", &equipment.PIDPipe); 303 EditBool((char *)"PID by mout verwijderen", &equipment.PIDPipe);
295 EditSSR2(&equipment.SSR2); 304 EditSSR2(&equipment.SSR2);
296 EditFloat((char *)"Spoelwater temp", &equipment.TempHLT, 75, 98, 2); 305 EditBool((char *)"Hendi PWM", &equipment.Hendi);
297 // Round to 0.25 values.
298 equipment.TempHLT = ((int)(equipment.TempHLT * 4)) / 4.0;
299 EditDouble((char *)"PID P", &equipment.PID_kP, 20, 2000, 3); 306 EditDouble((char *)"PID P", &equipment.PID_kP, 20, 2000, 3);
300 EditDouble((char *)"PID I", &equipment.PID_kI, 0, 100, 3); 307 EditDouble((char *)"PID I", &equipment.PID_kI, 0, 100, 3);
301 EditDouble((char *)"PID D", &equipment.PID_kD, 0, 50000, 3); 308 EditDouble((char *)"PID D", &equipment.PID_kD, 0, 50000, 3);
302 EditInt((char *)"Sample tijd in mS", &equipment.SampleTime, 1000, 20000);
303 // Round to 250 mSec units.
304 equipment.SampleTime = ((int)(equipment.SampleTime / 250)) * 250;
305 EditInt((char *)"MLT watt", &equipment.MLT_watt, 100, 45000); 309 EditInt((char *)"MLT watt", &equipment.MLT_watt, 100, 45000);
306 EditInt((char *)"HLT watt", &equipment.HLT_watt, 100, 45000); 310 EditInt((char *)"HLT watt", &equipment.HLT_watt, 100, 45000);
311 EditInt((char *)"Max watt", &equipment.Max_watt, 100, 45000);
307 312
308 crc2 = crc32_le(0, dst, sizeof(equipment)); 313 crc2 = crc32_le(0, dst, sizeof(equipment));
309 if ((crc1 != crc2) && Confirm((char *)"Gewijzigd, opslaan?", (char *)"Ja", (char *)"Nee")) { 314 if ((crc1 != crc2) && Confirm((char *)"Gewijzigd, opslaan?", (char *)"Ja", (char *)"Nee")) {
310 write_equipment(CurrentRec); 315 write_equipment(CurrentRec);
311 } 316 }

mercurial