diff --git a/docs/~$leitung-Wort-Uhr.docx b/docs/~$leitung-Wort-Uhr.docx deleted file mode 100644 index 1215360c..00000000 Binary files a/docs/~$leitung-Wort-Uhr.docx and /dev/null differ diff --git a/erase_before_upload.py b/erase_before_upload.py new file mode 100644 index 00000000..7f9bf75e --- /dev/null +++ b/erase_before_upload.py @@ -0,0 +1,11 @@ +Import("env") + +old_uploaderflags = env["UPLOADERFLAGS"] +#print("Old uploaderflags: " + str(old_uploaderflags)) + +index_write_flash = old_uploaderflags.index("write_flash") +if index_write_flash != -1: + new_uploaderflags = old_uploaderflags[::] + new_uploaderflags.insert(index_write_flash + 1, "--erase-all") + #print("Replaced with: " + str(new_uploaderflags)) + env.Replace(UPLOADERFLAGS=new_uploaderflags) \ No newline at end of file diff --git a/include/Transitiontypes/Transition.hpp b/include/Transitiontypes/Transition.hpp index ce241b6d..b9e77538 100644 --- a/include/Transitiontypes/Transition.hpp +++ b/include/Transitiontypes/Transition.hpp @@ -1137,7 +1137,7 @@ void Transition::loop(struct tm &tm) { setMinute(); if (G.secondVariant != SecondVariant::Off) { led.setbySecondArray(); - // Workaround: setbySecoundArray not in 'work' + // Workaround: setbySecondArray not in 'work' } } led.show(); diff --git a/include/Uhr.h b/include/Uhr.h index f96e30d1..a639d8e8 100644 --- a/include/Uhr.h +++ b/include/Uhr.h @@ -91,6 +91,14 @@ enum class WordclockChanges { Words, }; +enum class ItIsVariant { + Permanent = 0, + Quarterly = 1, + HalfHourly = 2, + Hourly = 3, + Off = 4, +}; + struct GLOBAL { uint16_t sernr; uint16_t prog; @@ -103,6 +111,7 @@ struct GLOBAL { uint8_t client_nr; SecondVariant secondVariant; MinuteVariant minuteVariant; + ItIsVariant itIsVariant; bool languageVariant[6]; bool layoutVariant[3]; char timeserver[PAYLOAD_LENGTH]; @@ -190,8 +199,7 @@ enum LanguageDialects { ItIs20 = 1, ItIs40 = 2, ItIs45 = 3, - NotShowItIs = 4, - EN_ShowAQuarter = 5, + EN_ShowAQuarter = 4, }; enum LayoutVariants { @@ -285,6 +293,7 @@ enum ClockType { Fr10x11 = 21, Se10x11 = 22, Ru10x11 = 23, + Ch10x11V2 = 24, }; enum Icons { diff --git a/include/Uhrtypes/CH10x11v2.hpp b/include/Uhrtypes/CH10x11v2.hpp new file mode 100644 index 00000000..dda861b4 --- /dev/null +++ b/include/Uhrtypes/CH10x11v2.hpp @@ -0,0 +1,130 @@ +#pragma once + +#include "CH10x11.hpp" + +/* + * Layout Front + * COL + * X 9 8 7 6 5 4 3 2 1 0 + * ROW + - - - - - - - - - - - + * 0 | E S K I S C H U F Ü F + * 1 | V I E R T U N F Z Ä Ä + * 2 | Z W Ä N Z G S E V O R + * 3 | A B C H A U B I E C M + * 4 | E I S Z W Ö I S D R Ü + * 5 | V I E R I F Ü F I S T + * 6 | S Ä C H S I S I B N I + * 7 | A C H T I N Ü N I E L + * 8 | Z Ä N I E C H E U F I + * 9 | Z W Ö U F I E N G S I + */ + +class Ch10x11V2_t : public Ch10x11_t { +public: + virtual LanguageAbbreviation usedLang() override { + return LanguageAbbreviation::DE; + }; + + //------------------------------------------------------------------------------ + + void show(FrontWord word) override { + switch (word) { + + case FrontWord::es_ist: + setFrontMatrixWord(0, 9, 10); + setFrontMatrixWord(0, 4, 7); + break; + + case FrontWord::nach: + case FrontWord::v_nach: + setFrontMatrixWord(3, 9, 10); + break; + + case FrontWord::vor: + case FrontWord::v_vor: + setFrontMatrixWord(2, 0, 2); + break; + + case FrontWord::viertel: + setFrontMatrixWord(1, 5, 10); + break; + + case FrontWord::min_5: + setFrontMatrixWord(0, 0, 2); + break; + + case FrontWord::min_10: + setFrontMatrixWord(1, 0, 2); + break; + + case FrontWord::min_20: + setFrontMatrixWord(2, 5, 10); + break; + + case FrontWord::halb: + setFrontMatrixWord(3, 3, 7); + break; + + case FrontWord::eins: + setFrontMatrixWord(4, 8, 10); + break; + + case FrontWord::hour_1: + setFrontMatrixWord(4, 8, 10); + break; + + case FrontWord::hour_2: + setFrontMatrixWord(4, 4, 7); + break; + + case FrontWord::hour_3: + setFrontMatrixWord(4, 0, 2); + break; + + case FrontWord::hour_4: + setFrontMatrixWord(5, 6, 10); + break; + + case FrontWord::hour_5: + setFrontMatrixWord(5, 2, 5); + break; + + case FrontWord::hour_6: + setFrontMatrixWord(6, 5, 10); + break; + + case FrontWord::hour_7: + setFrontMatrixWord(6, 0, 4); + break; + + case FrontWord::hour_8: + setFrontMatrixWord(7, 6, 10); + break; + + case FrontWord::hour_9: + setFrontMatrixWord(7, 2, 5); + break; + + case FrontWord::hour_10: + setFrontMatrixWord(8, 7, 10); + break; + + case FrontWord::hour_11: + setFrontMatrixWord(8, 0, 3); + break; + + case FrontWord::hour_12: + setFrontMatrixWord(9, 5, 10); + break; + + case FrontWord::gewesen: + setFrontMatrixWord(9, 0, 2); + break; + + default: + break; + }; + }; +}; + +Ch10x11_t _ch10x11V2; \ No newline at end of file diff --git a/include/Uhrtypes/DE16x8.hpp b/include/Uhrtypes/DE16x8.hpp index c85c0c6f..4b22ad3b 100644 --- a/include/Uhrtypes/DE16x8.hpp +++ b/include/Uhrtypes/DE16x8.hpp @@ -164,7 +164,7 @@ class De16x8_t : public iUhrType { break; case FrontWord::hour_9: - setFrontMatrixWord(4, 7, 10); + setFrontMatrixWord(4, 4, 7); break; case FrontWord::hour_10: diff --git a/include/clockWork.h b/include/clockWork.h index 8553f52e..527b3476 100644 --- a/include/clockWork.h +++ b/include/clockWork.h @@ -42,6 +42,7 @@ class ClockWork { void showMinute(uint8_t min); void resetMinVariantIfNotAvailable(); FrontWord getFrontWordForNum(uint8_t min); + bool checkTwentyUsage(); bool hasTwentyAndCheckForUsage(); bool hasDreiviertelAndCheckForUsage(); void setMinute(uint8_t min, uint8_t &offsetHour, bool &fullHour); @@ -59,6 +60,8 @@ class ClockWork { WordclockChanges changesInClockface(); void calcClockface(); void setClock(); + void setItIs(uint8_t min, const uint8_t offsetHour); + bool DetermineIfItIsIsShown(const uint8_t min); void DetermineWhichItIsToShow(uint8_t offsetHour); void clearClockByProgInit(); diff --git a/include/clockWork.hpp b/include/clockWork.hpp index 2a71bda0..3319a8a1 100644 --- a/include/clockWork.hpp +++ b/include/clockWork.hpp @@ -143,6 +143,8 @@ iUhrType *ClockWork::getPointer(uint8_t type) { return &_se10x11; case Ru10x11: return &_ru10x11; + case Ch10x11V2: + return &_ch10x11V2; default: return nullptr; } @@ -513,8 +515,15 @@ FrontWord ClockWork::getFrontWordForNum(uint8_t min) { //------------------------------------------------------------------------------ +bool ClockWork::checkTwentyUsage() { + return G.languageVariant[ItIs20] || G.languageVariant[ItIs40]; +} + +//------------------------------------------------------------------------------ + bool ClockWork::hasTwentyAndCheckForUsage() { - return usedUhrType->hasZwanzig() || G.languageVariant[ItIs40]; + // ToDo: Is this true for every supoorted language variant? + return usedUhrType->hasZwanzig() && checkTwentyUsage(); } //------------------------------------------------------------------------------ @@ -909,16 +918,46 @@ WordclockChanges ClockWork::changesInClockface() { //------------------------------------------------------------------------------ +bool ClockWork::DetermineIfItIsIsShown(const uint8_t min) { + switch (G.itIsVariant) { + case ItIsVariant::Permanent: + return true; + break; + case ItIsVariant::Hourly: + return !min; + break; + case ItIsVariant::HalfHourly: + return !(min % 30); + break; + case ItIsVariant::Quarterly: + return !(min % 15); + break; + case ItIsVariant::Off: + default: + return false; + break; + } +} + +//------------------------------------------------------------------------------ +void ClockWork::setItIs(uint8_t min, const uint8_t offsetHour) { + min /= 5; + min *= 5; + + if (DetermineIfItIsIsShown(min)) { + DetermineWhichItIsToShow(_hour + offsetHour); + } +} + +//------------------------------------------------------------------------------ + void ClockWork::setClock() { uint8_t offsetHour = 0; bool fullHour = 0; setMinute(_minute, offsetHour, fullHour); setHour(_hour + offsetHour, fullHour); - - if (!G.languageVariant[NotShowItIs]) { - DetermineWhichItIsToShow(_hour + offsetHour); - } + setItIs(_minute, offsetHour); } //------------------------------------------------------------------------------ @@ -1168,6 +1207,7 @@ void ClockWork::loop(struct tm &tm) { config["effectSpeed"] = G.effectSpeed; config["colortype"] = G.Colortype; config["hasHappyBirthday"] = usedUhrType->hasHappyBirthday(); + config["hasSecondsFrame"] = usedUhrType->hasSecondsFrame(); config["prog"] = G.prog; serializeJson(config, str); webSocket.sendTXT(G.client_nr, str, strlen(str)); diff --git a/include/config.h b/include/config.h index 427ec30a..74584e51 100644 --- a/include/config.h +++ b/include/config.h @@ -107,6 +107,10 @@ // #define DEFAULT_LAYOUT Ch10x11 // 10 rows, 11 LED's per row + 4 LED's for minutes, with modified // layout for the Swiss German language +// +// #define DEFAULT_LAYOUT Ch10x11V2 +// 10 rows, 11 LED's per row + 4 LED's for minutes, with modified +// layout for the Swiss German language with "Gsi" option /**********************/ /* Romanian */ diff --git a/include/webPageAdapter.h b/include/webPageAdapter.h index bcca4c6b..6b46e55b 100644 --- a/include/webPageAdapter.h +++ b/include/webPageAdapter.h @@ -374,7 +374,7 @@ void webSocketEvent(uint8_t num, WStype_t type, uint8_t *payload, G.languageVariant[ItIs20] = split(payload, 6); G.languageVariant[ItIs40] = split(payload, 9); G.languageVariant[ItIs45] = split(payload, 12); - G.languageVariant[NotShowItIs] = split(payload, 15); + G.itIsVariant = static_cast(split(payload, 15)); G.languageVariant[EN_ShowAQuarter] = split(payload, 18); break; } diff --git a/platformio.ini b/platformio.ini index 42c6cb4b..18fe6079 100644 --- a/platformio.ini +++ b/platformio.ini @@ -52,11 +52,11 @@ lib_deps = extra_scripts = pre:extra_scripts.py [env:esp32c3dev] -platform = espressif32 +platform = espressif32 @ 6.9.0 board = esp32-c3-devkitc-02 board_build.partitions = partitions_singleapp_large.csv framework = arduino -upload_speed = 921600 +upload_speed = 115200 monitor_speed = 460800 build_flags = -Os @@ -66,7 +66,7 @@ build_flags = lib_deps = makuna/NeoPixelBus@^2.7.6 bblanchon/ArduinoJson@^6.17.2 - links2004/WebSockets@2.4.1 + links2004/WebSockets@^2.4.1 adafruit/RTClib@^1.11.2 knolleary/PubSubClient@^2.8.0 https://github.com/tzapu/WiFiManager#v2.0.17 diff --git a/svg/Front_400x400/SVG_DoubleResM1_layout/Layout_400x400_Foam.svg b/svg/Front_400x400/SVG_DoubleResM1_layout/Layout_400x400_Foam.svg index dc71837d..5134982b 100644 --- a/svg/Front_400x400/SVG_DoubleResM1_layout/Layout_400x400_Foam.svg +++ b/svg/Front_400x400/SVG_DoubleResM1_layout/Layout_400x400_Foam.svg @@ -1,588 +1,366 @@ - - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + viewBox="0 0 2834.6 1700.8" style="enable-background:new 0 0 2834.6 1700.8;" xml:space="preserve"> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/webpage/icons/color_bg.svg b/webpage/icons/color_bg.svg new file mode 100644 index 00000000..a5b4c632 --- /dev/null +++ b/webpage/icons/color_bg.svg @@ -0,0 +1,13 @@ + + + + + + + diff --git a/webpage/icons/color_fr.svg b/webpage/icons/color_fr.svg new file mode 100644 index 00000000..401f3204 --- /dev/null +++ b/webpage/icons/color_fr.svg @@ -0,0 +1,29 @@ + + + + + + + + diff --git a/webpage/index.html b/webpage/index.html index 9769ffc9..25152cd4 100644 --- a/webpage/index.html +++ b/webpage/index.html @@ -68,6 +68,14 @@ + + + + + + + +