diff --git a/Blynk.ino b/Blynk.ino index 7718c7fe..fbd24c1e 100644 --- a/Blynk.ino +++ b/Blynk.ino @@ -150,6 +150,8 @@ BLYNK_WRITE(V4) { sam_command_sync = SAMOVAR_BEER; } else if (Samovar_Mode == SAMOVAR_BK_MODE && !PowerOn) { sam_command_sync = SAMOVAR_BK; + } else if (Samovar_Mode == SAMOVAR_NBK_MODE && !PowerOn) { + sam_command_sync = SAMOVAR_NBK; } else if (Samovar_Mode == SAMOVAR_DISTILLATION_MODE && !PowerOn) { sam_command_sync = SAMOVAR_DISTILLATION; } else diff --git a/FS.ino b/FS.ino index f821e2ef..a6361352 100644 --- a/FS.ino +++ b/FS.ino @@ -344,6 +344,8 @@ String get_prf_name() { fl = "/dist.prf"; } else if (Samovar_CR_Mode == SAMOVAR_BK_MODE) { fl = "/bk.prf"; + } else if (Samovar_CR_Mode == SAMOVAR_NBK_MODE) { + fl = "/nbk.prf"; } else { fl = "/rectificat.prf"; } diff --git a/Menu.ino b/Menu.ino index cb58a895..3f23b528 100644 --- a/Menu.ino +++ b/Menu.ino @@ -427,6 +427,14 @@ void menu_get_power() { set_menu_screen(3); samovar_reset(); } + } else if (Samovar_Mode == SAMOVAR_NBK_MODE) { + if (!PowerOn) { + set_menu_screen(2); + sam_command_sync = SAMOVAR_NBK; + } else { + set_menu_screen(3); + samovar_reset(); + } } else { if (!PowerOn) { set_menu_screen(2); diff --git a/Samovar.h b/Samovar.h index 5d07da50..f0ec3e8b 100644 --- a/Samovar.h +++ b/Samovar.h @@ -5,7 +5,7 @@ #error This code is designed to run on ESP32 platform, not Arduino nor ESP8266! Please check your Tools->Board setting. #endif -#define SAMOVAR_VERSION F("6.18") +#define SAMOVAR_VERSION F("6.19") //#define __SAMOVAR_DEBUG @@ -157,6 +157,10 @@ StaticSemaphore_t xSemaphoreBufferAVR; #define LUA_BK "" #endif +#ifndef LUA_NBK +#define LUA_NBK "" +#endif + #ifndef LUA_RECT #define LUA_RECT "" #endif @@ -300,10 +304,10 @@ LiquidMenu main_menu1(lcd); DNSServer dns; -enum SamovarCommands {SAMOVAR_NONE, SAMOVAR_START, SAMOVAR_POWER, SAMOVAR_RESET, CALIBRATE_START, CALIBRATE_STOP, SAMOVAR_PAUSE, SAMOVAR_CONTINUE, SAMOVAR_SETBODYTEMP, SAMOVAR_DISTILLATION, SAMOVAR_BEER, SAMOVAR_BEER_NEXT, SAMOVAR_BK, SAMOVAR_SELF_TEST, SAMOVAR_DIST_NEXT}; +enum SamovarCommands {SAMOVAR_NONE, SAMOVAR_START, SAMOVAR_POWER, SAMOVAR_RESET, CALIBRATE_START, CALIBRATE_STOP, SAMOVAR_PAUSE, SAMOVAR_CONTINUE, SAMOVAR_SETBODYTEMP, SAMOVAR_DISTILLATION, SAMOVAR_BEER, SAMOVAR_BEER_NEXT, SAMOVAR_BK, SAMOVAR_NBK, SAMOVAR_SELF_TEST, SAMOVAR_DIST_NEXT}; volatile SamovarCommands sam_command_sync; // переменная для передачи команд между процессами -enum SAMOVAR_MODE {SAMOVAR_RECTIFICATION_MODE, SAMOVAR_DISTILLATION_MODE, SAMOVAR_BEER_MODE, SAMOVAR_BK_MODE, SAMOVAR_SUVID_MODE, SAMOVAR_LUA_MODE}; +enum SAMOVAR_MODE {SAMOVAR_RECTIFICATION_MODE, SAMOVAR_DISTILLATION_MODE, SAMOVAR_BEER_MODE, SAMOVAR_BK_MODE, SAMOVAR_NBK_MODE, SAMOVAR_SUVID_MODE, SAMOVAR_LUA_MODE}; volatile SAMOVAR_MODE Samovar_Mode; volatile SAMOVAR_MODE Samovar_CR_Mode; diff --git a/Samovar.ino b/Samovar.ino index 752c9d35..c7becc36 100644 --- a/Samovar.ino +++ b/Samovar.ino @@ -139,6 +139,7 @@ cppQueue msg_q(100, 5, FIFO); #include "distiller.h" #include "beer.h" #include "BK.h" +#include "nbk.h" #include "SPIFFSEditor.h" #include "I2CStepper.h" @@ -457,6 +458,8 @@ void triggerSysTicker(void *parameter) { check_alarm_distiller(); } else if (Samovar_Mode == SAMOVAR_BK_MODE) { check_alarm_bk(); + } else if (Samovar_Mode == SAMOVAR_NBK_MODE) { + check_alarm_nbk(); } else if (Samovar_Mode == SAMOVAR_BEER_MODE) { check_alarm_beer(); WFpulseCount = 100; @@ -508,6 +511,8 @@ void triggerSysTicker(void *parameter) { } else if (Samovar_Mode == SAMOVAR_BK_MODE) { + } else if (Samovar_Mode == SAMOVAR_NBK_MODE) { + } //Считаем прогресс отбора для текущей строки программы и время до конца завершения строки и всего отбора (режим ректификации) else if (Samovar_Mode == SAMOVAR_RECTIFICATION_MODE && (TargetStepps > 0 || program[ProgramNum].WType == "P")) { @@ -1093,6 +1098,12 @@ void loop() { sam_command_sync = SAMOVAR_BK; } else bk_finish(); + } else if (Samovar_Mode == SAMOVAR_NBK_MODE) { + //если дистилляция включаем или выключаем + if (!PowerOn) { + sam_command_sync = SAMOVAR_NBK; + } else + nbk_finish(); } else if (Samovar_Mode == SAMOVAR_BEER_MODE) { //если пиво включаем или двигаем программу if (!PowerOn) { @@ -1162,6 +1173,11 @@ void loop() { SamovarStatusInt = 3000; startval = 3000; break; + case SAMOVAR_NBK: + Samovar_Mode = SAMOVAR_NBK_MODE; + SamovarStatusInt = 4000; + startval = 4000; + break; case SAMOVAR_SELF_TEST: start_self_test(); break; diff --git a/WebServer.ino b/WebServer.ino index efcb91a1..befef5b4 100644 --- a/WebServer.ino +++ b/WebServer.ino @@ -46,6 +46,13 @@ void change_samovar_mode() { server.on("/index.htm", HTTP_GET, [](AsyncWebServerRequest * request) { request->send(SPIFFS, "/bk.htm", String(), false, indexKeyProcessor); }); + } else if (Samovar_Mode == SAMOVAR_NBK_MODE) { + server.on("/", HTTP_GET, [](AsyncWebServerRequest * request) { + request->send(SPIFFS, "/nbk.htm", String(), false, indexKeyProcessor); + }); + server.on("/index.htm", HTTP_GET, [](AsyncWebServerRequest * request) { + request->send(SPIFFS, "/nbk.htm", String(), false, indexKeyProcessor); + }); } else { Samovar_Mode = SAMOVAR_RECTIFICATION_MODE; server.on("/", HTTP_GET, [](AsyncWebServerRequest * request) { @@ -427,6 +434,8 @@ String setupKeyProcessor(const String &var) { return "selected"; else if (var == "BK" && (SAMOVAR_MODE)SamSetup.Mode == SAMOVAR_BK_MODE) return "selected"; + else if (var == "NBK" && (SAMOVAR_MODE)SamSetup.Mode == SAMOVAR_NBK_MODE) + return "selected"; else if (var == "SUVID" && (SAMOVAR_MODE)SamSetup.Mode == SAMOVAR_SUVID_MODE) return "selected"; else if (var == "RAL" && !SamSetup.rele1) @@ -750,6 +759,10 @@ void web_command(AsyncWebServerRequest *request) { if (!PowerOn) sam_command_sync = SAMOVAR_BK; else sam_command_sync = SAMOVAR_POWER; + } else if (Samovar_Mode == SAMOVAR_NBK_MODE) { + if (!PowerOn) sam_command_sync = SAMOVAR_NBK; + else + sam_command_sync = SAMOVAR_POWER; } else sam_command_sync = SAMOVAR_POWER; } else if (request->hasArg("setbodytemp")) { @@ -909,6 +922,7 @@ void get_web_interface() { s += get_web_file("beer.htm", SAVE_FILE_OVERRIDE); s += get_web_file("bk.htm", SAVE_FILE_OVERRIDE); + s += get_web_file("nbk.htm", SAVE_FILE_OVERRIDE); s += get_web_file("brewxml.htm", SAVE_FILE_OVERRIDE); s += get_web_file("calibrate.htm", SAVE_FILE_OVERRIDE); s += get_web_file("chart.htm", SAVE_FILE_OVERRIDE); @@ -920,6 +934,7 @@ void get_web_interface() { s += get_web_file("beer.lua", SAVE_FILE_IF_NOT_EXIST); s += get_web_file("bk.lua", SAVE_FILE_IF_NOT_EXIST); + s += get_web_file("nbk.lua", SAVE_FILE_IF_NOT_EXIST); s += get_web_file("btn_button1.lua", SAVE_FILE_IF_NOT_EXIST); s += get_web_file("btn_button2.lua", SAVE_FILE_IF_NOT_EXIST); s += get_web_file("dist.lua", SAVE_FILE_IF_NOT_EXIST); diff --git a/data/nbk.htm b/data/nbk.htm new file mode 100644 index 00000000..7e4e365c --- /dev/null +++ b/data/nbk.htm @@ -0,0 +1,685 @@ + + +
+ + + + +