241 if (MaxMash >= 75.0) |
241 if (MaxMash >= 75.0) |
242 MaxMash = 74.75; |
242 MaxMash = 74.75; |
243 } |
243 } |
244 MashState = Sub_Screen = MASH_NONE; |
244 MashState = Sub_Screen = MASH_NONE; |
245 snprintf(msg, 63, "{\"main\":\"%d\",\"sub\":\"%d\",\"timer\":\"\"}", Main_Screen, Sub_Screen); |
245 snprintf(msg, 63, "{\"main\":\"%d\",\"sub\":\"%d\",\"timer\":\"\"}", Main_Screen, Sub_Screen); |
246 ws_server_send_text_clients((char *)"/ws", msg, strlen(msg)); |
246 ws_server_send_text_clients(msg); |
247 pumpTime = 0; |
247 pumpTime = 0; |
248 pumpRest = false; |
248 pumpRest = false; |
249 runtime.StageResume = Main_Screen; |
249 runtime.StageResume = Main_Screen; |
250 updateRuntime = true; |
250 updateRuntime = true; |
251 TopMessage((char *)"Maischen"); |
251 TopMessage((char *)"Maischen"); |
452 */ |
452 */ |
453 Sub_Screen = 1; |
453 Sub_Screen = 1; |
454 read_recipe(config.RecipeRec); |
454 read_recipe(config.RecipeRec); |
455 snprintf(msg, 255, "{\"main\":\"%d\",\"sub\":\"%d\",\"timer\":\"\",\"brew1\":\"%s\",\"brew2\":\"%s\"}", |
455 snprintf(msg, 255, "{\"main\":\"%d\",\"sub\":\"%d\",\"timer\":\"\",\"brew1\":\"%s\",\"brew2\":\"%s\"}", |
456 Main_Screen, Sub_Screen, equipment.Name, recipe.Name); |
456 Main_Screen, Sub_Screen, equipment.Name, recipe.Name); |
457 ws_server_send_text_clients((char *)"/ws", msg, strlen(msg)); |
457 ws_server_send_text_clients(msg); |
458 y = 28; |
458 y = 28; |
459 TopMessage((char *)"Automaat"); |
459 TopMessage((char *)"Automaat"); |
460 TFT_setFont(DEFAULT_FONT, NULL); |
460 TFT_setFont(DEFAULT_FONT, NULL); |
461 ShowText(2,y,(char *)"Installatie", equipment.Name); |
461 ShowText(2,y,(char *)"Installatie", equipment.Name); |
462 y += 16; |
462 y += 16; |
672 driver_state->mlt_mode = MLT_MODE_PID; |
672 driver_state->mlt_mode = MLT_MODE_PID; |
673 xSemaphoreGive(xSemaphoreDriver); |
673 xSemaphoreGive(xSemaphoreDriver); |
674 } |
674 } |
675 MashState = Sub_Screen = MASH_WAITTEMP; |
675 MashState = Sub_Screen = MASH_WAITTEMP; |
676 snprintf(msg, 255, "{\"main\":\"%d\",\"sub\":\"%d\",\"timer\":\"\"}", Main_Screen, Sub_Screen); |
676 snprintf(msg, 255, "{\"main\":\"%d\",\"sub\":\"%d\",\"timer\":\"\"}", Main_Screen, Sub_Screen); |
677 ws_server_send_text_clients((char *)"/ws", msg, strlen(msg)); |
677 ws_server_send_text_clients(msg); |
678 log_msg(TAG, "Mash step %d type: %s time: %d sp: %6.4f-%6.4f sv: %6.4f", |
678 log_msg(TAG, "Mash step %d type: %s time: %d sp: %6.4f-%6.4f sv: %6.4f", |
679 runtime.MashStep, mashTypes[recipe.MashStep[runtime.MashStep].Type], |
679 runtime.MashStep, mashTypes[recipe.MashStep[runtime.MashStep].Type], |
680 stageTime, recipe.MashStep[runtime.MashStep].Step_temp, recipe.MashStep[runtime.MashStep].End_temp, temp_MLT); |
680 stageTime, recipe.MashStep[runtime.MashStep].Step_temp, recipe.MashStep[runtime.MashStep].End_temp, temp_MLT); |
681 |
681 |
682 if (runtime.MashStep) { |
682 if (runtime.MashStep) { |
718 log_msg(TAG, "Mash decoction prompt"); |
718 log_msg(TAG, "Mash decoction prompt"); |
719 } |
719 } |
720 TFT_print(temp_buf, CENTER, 135); |
720 TFT_print(temp_buf, CENTER, 135); |
721 SoundPlay(SOUND_Prompt); |
721 SoundPlay(SOUND_Prompt); |
722 snprintf(msg, 255, "{\"main\":\"%d\",\"sub\":\"%d\",\"timer\":\"%s\"}", Main_Screen, Sub_Screen, temp_buf); |
722 snprintf(msg, 255, "{\"main\":\"%d\",\"sub\":\"%d\",\"timer\":\"%s\"}", Main_Screen, Sub_Screen, temp_buf); |
723 ws_server_send_text_clients((char *)"/ws", msg, strlen(msg)); |
723 ws_server_send_text_clients(msg); |
724 if (recipe.MashStep[runtime.MashStep].Type == MASHTYPE_INFUSION) { |
724 if (recipe.MashStep[runtime.MashStep].Type == MASHTYPE_INFUSION) { |
725 if (xSemaphoreTake(xSemaphoreDriver, 10) == pdTRUE) { |
725 if (xSemaphoreTake(xSemaphoreDriver, 10) == pdTRUE) { |
726 // No heating during the infusion. |
726 // No heating during the infusion. |
727 driver_state->mlt_sp = stageTemp; |
727 driver_state->mlt_sp = stageTemp; |
728 driver_state->mlt_mode = MLT_MODE_OFF; |
728 driver_state->mlt_mode = MLT_MODE_OFF; |
744 SoundPlay(SOUND_TempReached); |
744 SoundPlay(SOUND_TempReached); |
745 TempReached = true; |
745 TempReached = true; |
746 newTemp = stageTemp; |
746 newTemp = stageTemp; |
747 MashState = Sub_Screen = MASH_REST; |
747 MashState = Sub_Screen = MASH_REST; |
748 snprintf(msg, 63, "{\"main\":\"%d\",\"sub\":\"%d\",\"timer\":\"\"}", Main_Screen, Sub_Screen); |
748 snprintf(msg, 63, "{\"main\":\"%d\",\"sub\":\"%d\",\"timer\":\"\"}", Main_Screen, Sub_Screen); |
749 ws_server_send_text_clients((char *)"/ws", msg, strlen(msg)); |
749 ws_server_send_text_clients(msg); |
750 if (! runtime.MaltAdded && runtime.MashStep == 0) { |
750 if (! runtime.MaltAdded && runtime.MashStep == 0) { |
751 TimerSet(0); |
751 TimerSet(0); |
752 } else { |
752 } else { |
753 if (Resume && (runtime.StageTimeLeft < stageTime)) |
753 if (Resume && (runtime.StageTimeLeft < stageTime)) |
754 TimerSet(runtime.StageTimeLeft * 60); |
754 TimerSet(runtime.StageTimeLeft * 60); |
837 if (TimeLeft == 0) { |
837 if (TimeLeft == 0) { |
838 runtime.StageTimeLeft = 0; |
838 runtime.StageTimeLeft = 0; |
839 updateRuntime = true; |
839 updateRuntime = true; |
840 TFT_fillRect(0, 120, 320, 50, TFT_BLACK); |
840 TFT_fillRect(0, 120, 320, 50, TFT_BLACK); |
841 snprintf(msg, 63, "{\"main\":\"%d\",\"sub\":\"%d\",\"timer\":\"\"}", Main_Screen, Sub_Screen); |
841 snprintf(msg, 63, "{\"main\":\"%d\",\"sub\":\"%d\",\"timer\":\"\"}", Main_Screen, Sub_Screen); |
842 ws_server_send_text_clients((char *)"/ws", msg, strlen(msg)); |
842 ws_server_send_text_clients(msg); |
843 |
843 |
844 if (runtime.MashStep == 0 && ! runtime.MaltAdded && config.AskAdd) { |
844 if (runtime.MashStep == 0 && ! runtime.MaltAdded && config.AskAdd) { |
845 /* |
845 /* |
846 * Add Mash prompt. |
846 * Add Mash prompt. |
847 */ |
847 */ |
861 TFT_setFont(DEJAVU24_FONT, NULL); |
861 TFT_setFont(DEJAVU24_FONT, NULL); |
862 TFT_print((char *)"Mout storten?", CENTER, 135); |
862 TFT_print((char *)"Mout storten?", CENTER, 135); |
863 SoundPlay(SOUND_Prompt); |
863 SoundPlay(SOUND_Prompt); |
864 MashState = Sub_Screen = MASH_ADD; |
864 MashState = Sub_Screen = MASH_ADD; |
865 snprintf(msg, 63, "{\"main\":\"%d\",\"sub\":\"%d\",\"timer\":\"Mout storten?\"}", Main_Screen, Sub_Screen); |
865 snprintf(msg, 63, "{\"main\":\"%d\",\"sub\":\"%d\",\"timer\":\"Mout storten?\"}", Main_Screen, Sub_Screen); |
866 ws_server_send_text_clients((char *)"/ws", msg, strlen(msg)); |
866 ws_server_send_text_clients(msg); |
867 log_msg(TAG, "Mash add prompt"); |
867 log_msg(TAG, "Mash add prompt"); |
868 break; |
868 break; |
869 } |
869 } |
870 if ((runtime.MashStep == LastMashStep) && config.AskIodine) { |
870 if ((runtime.MashStep == LastMashStep) && config.AskIodine) { |
871 /* |
871 /* |
884 SoundPlay(SOUND_Prompt); |
884 SoundPlay(SOUND_Prompt); |
885 beeped = false; |
885 beeped = false; |
886 TimerSet(config.IodineTime * 60); |
886 TimerSet(config.IodineTime * 60); |
887 MashState = Sub_Screen = MASH_IODINE; |
887 MashState = Sub_Screen = MASH_IODINE; |
888 snprintf(msg, 63, "{\"main\":\"%d\",\"sub\":\"%d\",\"timer\":\"Jodium test?\"}", Main_Screen, Sub_Screen); |
888 snprintf(msg, 63, "{\"main\":\"%d\",\"sub\":\"%d\",\"timer\":\"Jodium test?\"}", Main_Screen, Sub_Screen); |
889 ws_server_send_text_clients((char *)"/ws", msg, strlen(msg)); |
889 ws_server_send_text_clients(msg); |
890 log_msg(TAG, "Mash iodine test prompt"); |
890 log_msg(TAG, "Mash iodine test prompt"); |
891 break; |
891 break; |
892 } |
892 } |
893 if ((runtime.MashStep == (recipe.Mashsteps - 1)) && config.AskRemove) { |
893 if ((runtime.MashStep == (recipe.Mashsteps - 1)) && config.AskRemove) { |
894 /* |
894 /* |
905 TFT_setFont(DEJAVU18_FONT, NULL); |
905 TFT_setFont(DEJAVU18_FONT, NULL); |
906 TFT_print((char *)"Mout verwijderen?", CENTER, 135); |
906 TFT_print((char *)"Mout verwijderen?", CENTER, 135); |
907 SoundPlay(SOUND_Prompt); |
907 SoundPlay(SOUND_Prompt); |
908 MashState = Sub_Screen = MASH_REMOVE; |
908 MashState = Sub_Screen = MASH_REMOVE; |
909 snprintf(msg, 127, "{\"main\":\"%d\",\"sub\":\"%d\",\"timer\":\"Mout verwijderen?\"}", Main_Screen, Sub_Screen); |
909 snprintf(msg, 127, "{\"main\":\"%d\",\"sub\":\"%d\",\"timer\":\"Mout verwijderen?\"}", Main_Screen, Sub_Screen); |
910 ws_server_send_text_clients((char *)"/ws", msg, strlen(msg)); |
910 ws_server_send_text_clients(msg); |
911 log_msg(TAG, "Mash remove prompt"); |
911 log_msg(TAG, "Mash remove prompt"); |
912 break; |
912 break; |
913 } |
913 } |
914 if (Main_Screen != MAIN_AUTO_ABORT) { |
914 if (Main_Screen != MAIN_AUTO_ABORT) { |
915 runtime.MashStep++; |
915 runtime.MashStep++; |
1006 recipe.MashStep[runtime.MashStep].Step_temp, recipe.MashStep[runtime.MashStep].End_temp, temp_MLT); |
1006 recipe.MashStep[runtime.MashStep].Step_temp, recipe.MashStep[runtime.MashStep].End_temp, temp_MLT); |
1007 log_annotation(ANNOTATION_EVENT, (char *)"Eind decoctie"); |
1007 log_annotation(ANNOTATION_EVENT, (char *)"Eind decoctie"); |
1008 } |
1008 } |
1009 MashState = Sub_Screen = MASH_WAITTEMP; |
1009 MashState = Sub_Screen = MASH_WAITTEMP; |
1010 snprintf(msg, 63, "{\"main\":\"%d\",\"sub\":\"%d\",\"timer\":\"\"}", Main_Screen, Sub_Screen); |
1010 snprintf(msg, 63, "{\"main\":\"%d\",\"sub\":\"%d\",\"timer\":\"\"}", Main_Screen, Sub_Screen); |
1011 ws_server_send_text_clients((char *)"/ws", msg, strlen(msg)); |
1011 ws_server_send_text_clients(msg); |
1012 break; |
1012 break; |
1013 default: break; |
1013 default: break; |
1014 } |
1014 } |
1015 } /* MashState */ |
1015 } /* MashState */ |
1016 MLT_info(71, 26, true); |
1016 MLT_info(71, 26, true); |
1177 stageTemp = 66.0; |
1177 stageTemp = 66.0; |
1178 } else { |
1178 } else { |
1179 stageTemp = recipe.CoolTemp; |
1179 stageTemp = recipe.CoolTemp; |
1180 } |
1180 } |
1181 snprintf(msg, 63, "{\"main\":\"%d\",\"sub\":\"%d\",\"timer\":\"\"}", Main_Screen, Sub_Screen); |
1181 snprintf(msg, 63, "{\"main\":\"%d\",\"sub\":\"%d\",\"timer\":\"\"}", Main_Screen, Sub_Screen); |
1182 ws_server_send_text_clients((char *)"/ws", msg, strlen(msg)); |
1182 ws_server_send_text_clients(msg); |
1183 CoolBeep = false; |
1183 CoolBeep = false; |
1184 log_msg(TAG, "Start cooling from %6.2f to %4.1f", ds18b20_state->mlt_temperature, stageTemp); |
1184 log_msg(TAG, "Start cooling from %6.2f to %4.1f", ds18b20_state->mlt_temperature, stageTemp); |
1185 if (xSemaphoreTake(xSemaphoreDriver, 10) == pdTRUE) { |
1185 if (xSemaphoreTake(xSemaphoreDriver, 10) == pdTRUE) { |
1186 driver_state->mlt_mode = MLT_MODE_OFF; |
1186 driver_state->mlt_mode = MLT_MODE_OFF; |
1187 driver_state->mlt_sp = stageTemp; |
1187 driver_state->mlt_sp = stageTemp; |
1230 Sub_Screen = 2; |
1230 Sub_Screen = 2; |
1231 } |
1231 } |
1232 xSemaphoreGive(xSemaphoreDriver); |
1232 xSemaphoreGive(xSemaphoreDriver); |
1233 if (Sub_Screen == 2) { |
1233 if (Sub_Screen == 2) { |
1234 snprintf(msg, 63, "{\"main\":\"%d\",\"sub\":\"%d\",\"timer\":\"\"}", Main_Screen, Sub_Screen); |
1234 snprintf(msg, 63, "{\"main\":\"%d\",\"sub\":\"%d\",\"timer\":\"\"}", Main_Screen, Sub_Screen); |
1235 ws_server_send_text_clients((char *)"/ws", msg, strlen(msg)); |
1235 ws_server_send_text_clients(msg); |
1236 } |
1236 } |
1237 } |
1237 } |
1238 switch (Buttons_Scan()) { |
1238 switch (Buttons_Scan()) { |
1239 case 1: if (xSemaphoreTake(xSemaphoreDriver, 10) == pdTRUE) { |
1239 case 1: if (xSemaphoreTake(xSemaphoreDriver, 10) == pdTRUE) { |
1240 if (Main_Screen == MAIN_AUTO_COOLING_H) { |
1240 if (Main_Screen == MAIN_AUTO_COOLING_H) { |
1343 */ |
1343 */ |
1344 Buttons_Clear(); |
1344 Buttons_Clear(); |
1345 TFT_fillScreen(_bg); |
1345 TFT_fillScreen(_bg); |
1346 Sub_Screen = 1; |
1346 Sub_Screen = 1; |
1347 snprintf(msg, 63, "{\"main\":\"%d\",\"sub\":\"%d\",\"timer\":\"\"}", Main_Screen, Sub_Screen); |
1347 snprintf(msg, 63, "{\"main\":\"%d\",\"sub\":\"%d\",\"timer\":\"\"}", Main_Screen, Sub_Screen); |
1348 ws_server_send_text_clients((char *)"/ws", msg, strlen(msg)); |
1348 ws_server_send_text_clients(msg); |
1349 if (Main_Screen == MAIN_AUTO_WHIRLPOOL9) { |
1349 if (Main_Screen == MAIN_AUTO_WHIRLPOOL9) { |
1350 TimeWhirlPool = recipe.Whirlpool9; |
1350 TimeWhirlPool = recipe.Whirlpool9; |
1351 if (xSemaphoreTake(xSemaphoreDriver, 10) == pdTRUE) { |
1351 if (xSemaphoreTake(xSemaphoreDriver, 10) == pdTRUE) { |
1352 driver_state->mlt_sp = 93.0; |
1352 driver_state->mlt_sp = 93.0; |
1353 driver_state->mlt_mode = MLT_MODE_PID; |
1353 driver_state->mlt_mode = MLT_MODE_PID; |