Revised the equipment edit screen, order is more logical. Changed some label names. Made room for one more setting.

Wed, 28 Jul 2021 20:42:30 +0200

author
Michiel Broek <mbroek@mbse.eu>
date
Wed, 28 Jul 2021 20:42:30 +0200
changeset 111
b5037adae8ab
parent 110
2f9e48e5b8ce
child 112
77cf1e9866e5

Revised the equipment edit screen, order is more logical. Changed some label names. Made room for one more setting.

main/buttons.h file | annotate | diff | comparison | revisions
main/setup.c file | annotate | diff | comparison | revisions
--- a/main/buttons.h	Wed Jul 28 17:12:00 2021 +0200
+++ b/main/buttons.h	Wed Jul 28 20:42:30 2021 +0200
@@ -87,6 +87,14 @@
 int KeyBoardDigits(void);
 
 /**
+ * @brief Show label field.
+ * @param x The X position on the screen
+ * @param y The Y position on the screen
+ * @param label The field name text
+ */
+void ShowLabel(uint16_t x, uint16_t y, char *label);
+
+/**
  * @brief Show data text field.
  * @param x The X position on the screen
  * @param y The Y position on the screen
--- a/main/setup.c	Wed Jul 28 17:12:00 2021 +0200
+++ b/main/setup.c	Wed Jul 28 20:42:30 2021 +0200
@@ -166,26 +166,35 @@
 			    read_equipment(CurrentRec);
 			    TFT_setFont(DEFAULT_FONT, NULL);
 			    ShowText(2, 28, (char *)"Naam", equipment.Name);
-			    ShowInteger(  2, 44, (char *)"Kook vermogen", (char *)"%", equipment.BoilPower);
-			    ShowInteger(161, 44, (char *)"Maisch verm.", (char *)"%", equipment.MashPower);
-			    ShowInteger(  2, 60, (char *)"Ramp vermogen", (char *)"%", equipment.RampPower);
-			    ShowFloat(161, 60, (char *)"Spoelwater", NULL, equipment.TempHLT, 2);
-			    ShowInteger(  2, 76, (char *)"Sample tijd", (char *)"mS", equipment.SampleTime);
-			    Show2Integer(161, 76, (char *)"Pomp cyclus", (char *)"m", equipment.PumpCycle, equipment.PumpRest);
-			    ShowBool(  2,  92, (char *)"Pomp opwarmen", equipment.PumpPreMash);
-			    ShowBool(161,  92, (char *)"Pomp maischen", equipment.PumpOnMash);
-			    ShowBool(  2,  108, (char *)"Pomp uitmaischen", equipment.PumpMashOut);
-			    ShowBool(161,  108, (char *)"Pomp bij koken", equipment.PumpOnBoil);
-			    ShowInteger(2, 124, (char *)"Pomp maxtemp.", (char *)"C", equipment.PumpMaxTemp);
-			    ShowBool(161, 124, (char *)"PID bij mout weg", equipment.PIDPipe);
-			    ShowSSR2(2, 140, equipment.SSR2);
-			    ShowBool(161, 140, (char *)"Hendi PWM", equipment.Hendi);
-			    ShowDouble(2, 156, (char *)"PID P", NULL, equipment.PID_kP, 3);
-			    ShowInteger(161, 156, (char *)"MLT watt", NULL, equipment.MLT_watt);
-			    ShowDouble(2, 172, (char *)"PID I", NULL, equipment.PID_kI, 3);
-			    ShowInteger(161, 172, (char *)"HLT watt", NULL, equipment.HLT_watt);
-			    ShowDouble(2, 188, (char *)"PID D", NULL, equipment.PID_kD, 3);
-			    ShowInteger(161, 188, (char *)"Max watt", NULL, equipment.Max_watt);
+			    ShowFloat(2, 44, (char *)"Spoelwater", NULL, equipment.TempHLT, 2);
+			    Show2Integer(161, 44, (char *)"Pomp cyclus", (char *)"m", equipment.PumpCycle, equipment.PumpRest);
+			    ShowBool(  2,  60, (char *)"Pomp opwarmen", equipment.PumpPreMash);
+			    ShowBool(161,  60, (char *)"Pomp maischen", equipment.PumpOnMash);
+			    ShowBool(  2,  76, (char *)"Pomp uitmaischen", equipment.PumpMashOut);
+			    ShowBool(161,  76, (char *)"Pomp bij koken", equipment.PumpOnBoil);
+			    ShowInteger(2, 92, (char *)"Pomp maxtemp.", (char *)"C", equipment.PumpMaxTemp);
+			    ShowBool(161, 92, (char *)"PID bij mout weg", equipment.PIDPipe);
+			    ShowSSR2(2, 108, equipment.SSR2);
+			    ShowInteger(161, 108, (char *)"Max watt", NULL, equipment.Max_watt);
+			    ShowInteger(2, 124, (char *)"MLT watt", NULL, equipment.MLT_watt);
+                            ShowInteger(161, 124, (char *)"HLT watt", NULL, equipment.HLT_watt);
+			    ShowInteger(2, 140, (char *)"Kook vermogen", (char *)"%", equipment.BoilPower);
+			    ShowInteger(161, 140, (char *)"Naar kook verm", (char *)"%", equipment.RampPower);
+			    ShowInteger(2, 156, (char *)"PID vermogen", (char *)"%", equipment.MashPower);
+			    ShowBool(161, 156, (char *)"Hendi PWM", equipment.Hendi);
+			    ShowInteger(2, 172, (char *)"Sample tijd", (char *)"mS", equipment.SampleTime);
+			    /* 161, 172 free space */
+			    char tmp[32];
+			    ShowLabel(2, 188, (char *)"PID P");
+    			    sprintf(tmp, "%.3f", equipment.PID_kP);
+    			    TFT_print(tmp, LASTX, LASTY);
+			    ShowLabel(LASTX, LASTY, (char *)"  I");
+			    sprintf(tmp, "%.3f", equipment.PID_kI);
+                            TFT_print(tmp, LASTX, LASTY);
+			    ShowLabel(LASTX, LASTY, (char *)"  D");
+                            sprintf(tmp, "%.3f", equipment.PID_kD);
+                            TFT_print(tmp, LASTX, LASTY);
+
 			    Buttons_Clear();
 			    Buttons_Add(  0, 210, 45, 30, (char *)"Ok"  , 0);
 			    Buttons_Add( 46, 210, 45, 30, (char *)"+"   , 1);
@@ -287,31 +296,31 @@
 			dst = (uint8_t*)&equipment;
 			crc1 = crc32_le(0, dst, sizeof(equipment));
 			EditText((char *)"Naam", equipment.Name, 31);
-			EditInt((char *)"Kook vermogen in %", &equipment.BoilPower, 0, 100);
-			EditInt((char *)"Maisch vermogen in %", &equipment.MashPower, 0, 100);
-			EditInt((char *)"Ramp vermogen in %", &equipment.RampPower, 0, 100);
 			EditFloat((char *)"Spoelwater temp", &equipment.TempHLT, 75, 98, 2);
                         // Round to 0.25 values.
                         equipment.TempHLT = ((int)(equipment.TempHLT * 4)) / 4.0;
+			EditInt((char *)"Pomp cyclus minuten", &equipment.PumpCycle, 5, 15);
+                        EditInt((char *)"Pomp rust minuten", &equipment.PumpRest, 0, 5);
+                        EditBool((char *)"Pomp bij opwarmen", &equipment.PumpPreMash);
+                        EditBool((char *)"Pomp bij maischen", &equipment.PumpOnMash);
+                        EditBool((char *)"Pomp bij uitmaischen", &equipment.PumpMashOut);
+                        EditBool((char *)"Pomp tijdens koken", &equipment.PumpOnBoil);
+                        EditInt((char *)"Pomp max. temperatuur", &equipment.PumpMaxTemp, 60, 105);
+                        EditBool((char *)"PID by mout verwijderen", &equipment.PIDPipe);
+                        EditSSR2(&equipment.SSR2);
+			EditInt((char *)"Max watt", &equipment.Max_watt, 100, 45000);
+			EditInt((char *)"MLT watt", &equipment.MLT_watt, 100, 45000);
+                        EditInt((char *)"HLT watt", &equipment.HLT_watt, 100, 45000);
+			EditInt((char *)"Kook vermogen in %", &equipment.BoilPower, 0, 100);
+			EditInt((char *)"Naar kook vermogen in %", &equipment.RampPower, 0, 100);
+			EditInt((char *)"PID Maisch vermogen in %", &equipment.MashPower, 0, 100);
+			EditBool((char *)"Hendi PWM", &equipment.Hendi);
 			EditInt((char *)"Sample tijd in mS", &equipment.SampleTime, 1000, 20000);
 			// Round to 250 mSec units.
                         equipment.SampleTime = ((int)(equipment.SampleTime / 250)) * 250;
-			EditInt((char *)"Pomp cyclus minuten", &equipment.PumpCycle, 5, 15);
-			EditInt((char *)"Pomp rust minuten", &equipment.PumpRest, 0, 5);
-			EditBool((char *)"Pomp bij opwarmen", &equipment.PumpPreMash);
-			EditBool((char *)"Pomp bij maischen", &equipment.PumpOnMash);
-			EditBool((char *)"Pomp bij uitmaischen", &equipment.PumpMashOut);
-			EditBool((char *)"Pomp tijdens koken", &equipment.PumpOnBoil);
-			EditInt((char *)"Pomp max. temperatuur", &equipment.PumpMaxTemp, 60, 105);
-			EditBool((char *)"PID by mout verwijderen", &equipment.PIDPipe);
-			EditSSR2(&equipment.SSR2);
-			EditBool((char *)"Hendi PWM", &equipment.Hendi);
 			EditDouble((char *)"PID P",  &equipment.PID_kP, 20, 2000, 3);
 			EditDouble((char *)"PID I",  &equipment.PID_kI, 0, 100, 3);
 			EditDouble((char *)"PID D",  &equipment.PID_kD, 0, 50000, 3);
-			EditInt((char *)"MLT watt", &equipment.MLT_watt, 100, 45000);
-			EditInt((char *)"HLT watt", &equipment.HLT_watt, 100, 45000);
-			EditInt((char *)"Max watt", &equipment.Max_watt, 100, 45000);
 
 			crc2 = crc32_le(0, dst, sizeof(equipment));
 			if ((crc1 != crc2) && Confirm((char *)"Gewijzigd, opslaan?", (char *)"Ja", (char *)"Nee")) {

mercurial