Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- extern TFT_eSPI tft;
- extern TPogoda pogoda;
- extern Tools tools;
- // =========================================================================================================== //
- //
- // Plik : esp32_tft.h
- // Wersja : 0.20 Beta
- // Data : 27.03.2021
- // Autor : TRANSLINE GROUP, Tomasz Majcher, Lubin
- //
- //
- // E-Mail : transline.majcher@gmail.com
- //
- //
- // Licencja v1 : Donationware. Oprogramowanie na tej licencji może być dowolnie modyfikowane, kopiowane
- // i dystrybuowane pod warunkiem, że licencjobiorca zapłaci autorowi symboliczną kwotę.
- // Wielkość opłaty zależy od licencjobiorcy.
- //
- //
- // Licencja v2 : OpenSource. Oprogramowanie na tej licencji może być dowolnie modyfikowane, kopiowane
- // i dystrybuowane pod warenkiem, że licencjobiorca jest członkiem grupy: ESP Projekty
- // oraz ESP Polska
- //
- // =========================================================================================================== //
- // === H I S T O R I A W E R S J I ========================================================================= //
- // =========================================================================================================== //
- //
- // wersja 0.20 STABLE - BETA (28.03.2021) - obłusga 32bitowych Bitmap
- // wersja 0.19 STABLE - BETA (28.03.2021) - obłusga 16bitowych Bitmap
- // wersja 0.18 STABLE - BETA (28.03.2021) - dodano bitmapy dla Cisnienie
- // wersja 0.17 STABLE - BETA (28.03.2021) - dodano bitmapy dla Wilgotnosc
- // wersja 0.16 STABLE - BETA (27.03.2021) - zmieniono kolory dla Wilgotnosc
- // wersja 0.15 STABLE - BETA (27.03.2021) - dodano DrawWilgotnoscColor
- // wersja 0.14 STABLE - BETA (27.03.2021) - dodano DrawTemperatureColor
- // wersja 0.13 STABLE - BETA (27.03.2021) - dodano panel v1 Pokaz Lokalizacje
- // wersja 0.12 STABLE - BETA (27.03.2021) - dodano panel v1 Zachód Słońca
- // wersja 0.11 STABLE - BETA (27.03.2021) - dodano panel v1 Wschod Słońca
- // wersja 0.10 STABLE - BETA (27.03.2021) - dodano panel v1 Predkosc Wiatru
- // wersja 0.09 STABLE - BETA (27.03.2021) - dodano panel v1 Wilgotnosc
- // wersja 0.08 STABLE - BETA (27.03.2021) - dodano panel v1 Zachmurzenie
- // wersja 0.07 STABLE - BETA (27.03.2021) - dodano panel v1 Code MSG
- // wersja 0.06 STABLE - BETA (27.03.2021) - dodano panel v1 Cisnienie
- // wersja 0.05 STABLE - BETA (27.03.2021) - dodano obsługę Terminal
- // wersja 0.04 SIMPLE - BETA (27.03.2021) - rozbudowa panel v1
- // wersja 0.03 SIMPLE - BETA (27.03.2021) - dodano panel Zegar RTC
- // wersja 0.02 SIMPLE - BETA (26.03.2021) - dodano panel v1 Temperatura
- // wersja 0.01 SIMPLE - BETA (26.03.2021) - budowa klasy TFTPanel
- // //
- // =========================================================================================================== //
- // === D E F I N I C J E ===================================================================================== //
- // =========================================================================================================== //
- #define Color_Bakground TFT_BLACK
- #define Color_Line tft.color565(37, 205, 245)
- #define TFT_kolor_zegara tft.color565(37, 205, 245)
- #define TFT_BLUE2 tft.color565(0, 128, 255)
- #define TFT_GREEN1 tft.color565(51, 255, 153)
- #define TFT_tlo_zegara TFT_BLACK
- #define Terminal 1 // terminal USB
- // =========================================================================================================== //
- // === P R O T O T Y P Y ===================================================================================== //
- // =========================================================================================================== //
- struct OKNO_v1
- {
- int value_min = 0;
- int value_max = 0;
- int value_step = 0;
- String value_name;
- int pos_y = 0;
- float ltx = 0;
- uint16_t osx = 120, osy = 120;
- int old_analog = -999;
- int old_value = 0;
- int d = 0;
- }
- Window_TFT_up, Window_TFT_down;
- // =========================================================================================================== //
- // === K L A S A T F T P a n e l =========================================================================== //
- // =========================================================================================================== //
- class TFTPanel
- {
- private: // metody i zmienne prywatne -------------------------------------------------------------------- //
- TFT_eSPI & tft;
- uint16_t screen_min_x = 0; // minimalny punkt x
- uint16_t screen_min_y = 0; // minimalny punkt y
- uint16_t screen_max_x = 240; // maksymalny punkt x
- uint16_t screen_max_y = 320; // maksymalny punkt y
- uint16_t window_min_x = 1; // minimalny punkt x OKNA
- uint16_t window_min_y = 1; // minimalny punkt y OKNA
- uint16_t window_max_x = 239; // maksymalny punkt x OKNA
- uint16_t window_max_y = 319; // maksymalny punkt y OKNA
- uint16_t window_size_x = window_max_x - window_min_x; // maksymalna szerokość OKNA
- uint16_t window_size_y = window_max_y - window_min_y; // maksymalna wysokość OKNA
- uint16_t window_up_v1 = 70; // pozycja y dla OKNA górnego v1
- uint16_t window_down_v1 = 190; // pozycja y dla OKNA dolnego v1
- uint8_t Godzina = 0; // czas z zegara RTC
- uint8_t Minuta = 0; // czas z zegara RTC
- uint8_t Sekunda = 0; // czas z zegara RTC
- String AmPm = ""; // AM / PM
- String Data = ""; // data z RTC
- // ---------------------------------------------------------------------------------------------------- //
- // --- F U N K C J E P R Y W A T N E ---------------------------------------------------------------- //
- // ---------------------------------------------------------------------------------------------------- //
- inline void DrawMaxWindow(); // rysuj maksymalne okno (-1px) na wyświetlaczu
- inline void DrawDownWindow126(); // rysuj dolne okno o wysokości 126 punktów
- inline void DrawUpWindow126(); // rysuj górne okno o wysokości 126 punktów
- void DrawAnalogWindow126(uint16_t start_y, int value_start, int value_step, byte color_mode);
- void ShowAnalogWindow126();
- inline void SetupUpAnalogWindow126( int v_min, int v_step, String v_name);
- inline void SetupDownAnalogWindow126( int v_min, int v_step, String v_name);
- void AnalogPanelUp_v1_Show126(int value);
- void AnalogPanelDown_v1_Show126(int value);
- void DrawTemperatureColor(int x0, int y0, int x1, int y1, int x2, int y2, int x3, int y3, int i);
- void DrawWilgotnoscColor(int x0, int y0, int x1, int y1, int x2, int y2, int x3, int y3, int i);
- void DrawCisnienieColor(int x0, int y0, int x1, int y1, int x2, int y2, int x3, int y3, int i);
- void DrawZachmurzenieColor(int x0, int y0, int x1, int y1, int x2, int y2, int x3, int y3, int i);
- void drawBmp(const char *filename, int16_t x, int16_t y);
- uint16_t read16(fs::File &f);
- uint32_t read32(fs::File &f);
- public: // metody i zmienne publiczne ------------------------------------------------------------------- //
- TFTPanel(TFT_eSPI & adresTFT) : tft (adresTFT) { } // konstruktor klasy TFTPanel
- void PanelInit(); // funkcja konfigurująca dla klasy TFTPanel
- void AnalogPanel_v1_Create(); // funkcja tworząca panel wyświetlacza v1
- void AnalogPanel_v2_Create(); // funkcja tworząca panel wyświetlacza v2
- void AnalogPanel_v1_Show(int Wilgotnosc, int Temperatura); // funkcja pokazująca panel wyświetlacza v1
- void AnalogPanel_v2_Show(int Cisnienie, int Zachmurzenie); // funkcja pokazująca panel wyświetlacza v2
- void DigitalClock_v1_Show(ESP32Time & clock, uint8_t x, uint8_t y); // pokaz zegar dla Panel v1
- void DigitalDate_v1_Show(ESP32Time & clock, uint8_t x, uint8_t y); // pokaz datę dla Panel v1
- void DigitalTemperature_v1_Show(uint8_t x, uint8_t y); // pokaż temperaturę dla Panel v1
- void DigitalCisnienie_v1_Show(uint8_t x, uint8_t y); // pokaż ciśnienie dla Panel v1
- void DigitalWilgotnosc_v1_Show(uint8_t x, uint8_t y); // pokaż wilgotność dla Panel v1
- void DigitalZachmurzenie_v1_Show(uint8_t x, uint8_t y); // pokaż zachmurzenie dla Panel v1
- void DigitalPredkoscWiatru_v1_Show(uint8_t x, uint8_t y); // pokaż predkosc wiatru dla Panel v1
- void DigitalWschodSlonca_v1_Show(uint8_t x, uint8_t y); // pokaż wschód słońca dla Panel v1
- void DigitalZachodSlonca_v1_Show(uint8_t x, uint8_t y); // pokaż zachód słońca dla Panel v1
- void DigitalLokalizacja_v1_Show(uint8_t x, uint8_t y); // pokaż lokalizację dla Panel v1
- void CodeMsg_v1_Show(uint8_t x, uint8_t y); // pokaż info o Autorze Panel v1
- void MultiSwitchPanel_v1(ESP32Time & clock, uint8_t x, uint8_t y); // multi przełącznik
- };
- // =========================================================================================================== //
- // === M E T O D Y P R Y W A T N E ========================================================================= //
- // =========================================================================================================== //
- //
- // --- S P I S M E T O D P R Y W A T N Y C H ---
- //
- // inline void TFTPanel :: DrawMaxWindow()
- // inline void TFTPanel :: DrawDownWindow126()
- // inline void TFTPanel :: DrawUpWindow126()
- // void DrawAnalogWindow126(uint16_t start_y, int value_start, int value_step, byte color_mode)
- // inline void SetupUpAnalogWindow126( int v_min, int v_step, String v_name)
- // inline void SetupDownAnalogWindow126( int v_min, int v_step, String v_name)
- // void AnalogPanel_v1_Show(int Wilgotnosc, int Temperatura)
- // void AnalogPanel_v2_Show(int Cisnienie, int Zachmurzenie)
- // void DrawTemperatureColor(int x0, int y0, int x1, int y1, int x2, int y2, int x3, int y3, int i)
- // void DrawWilgotnoscColor(int x0, int y0, int x1, int y1, int x2, int y2, int x3, int y3, int i);
- // void TFTPanel :: drawBmp(const char *filename, int16_t x, int16_t y)
- //
- //
- // *********************************************************************************************************** //
- // *** Wczytaj BITMAPĘ z SPIFFS *** //
- // *********************************************************************************************************** //
- //
- void TFTPanel :: drawBmp(const char *filename, int16_t x, int16_t y)
- {
- if ((x >= tft.width()) || (y >= tft.height())) return;
- fs::File bmpFS;
- bmpFS = SPIFFS.open(filename, "r");
- uint32_t seekOffset;
- uint16_t w, h, row, col;
- uint8_t r, g, b;
- if (read16(bmpFS) == 0x4D42)
- {
- read32(bmpFS);
- read32(bmpFS);
- seekOffset = read32(bmpFS);
- read32(bmpFS);
- w = read32(bmpFS);
- h = read32(bmpFS);
- if ((read16(bmpFS) == 1) && (read16(bmpFS) == 24) && (read32(bmpFS) == 0))
- {
- y += h - 1;
- bool oldSwapBytes = tft.getSwapBytes();
- tft.setSwapBytes(true);
- bmpFS.seek(seekOffset);
- uint16_t padding = (4 - ((w * 3) & 3)) & 3;
- uint8_t lineBuffer[w * 3 + padding];
- for (row = 0; row < h; row++)
- {
- bmpFS.read(lineBuffer, sizeof(lineBuffer));
- uint8_t* bptr = lineBuffer;
- uint16_t* tptr = (uint16_t*)lineBuffer;
- for (uint16_t col = 0; col < w; col++)
- {
- b = *bptr++;
- g = *bptr++;
- r = *bptr++;
- *tptr++ = ((r & 0xF8) << 8) | ((g & 0xFC) << 3) | (b >> 3);
- }
- tft.pushImage(x, y--, w, 1, (uint16_t*)lineBuffer);
- }
- tft.setSwapBytes(oldSwapBytes);
- }
- else tools.PokazWiadomosc("TFT","Load BMP","Nie rozpoznano formatu");
- }
- bmpFS.close();
- }
- //
- // *********************************************************************************************************** //
- // *** Wczytaj BITMAPĘ 16 *** //
- // *********************************************************************************************************** //
- //
- uint16_t TFTPanel :: read16(fs::File &f) {
- uint16_t result;
- ((uint8_t *)&result)[0] = f.read(); // LSB
- ((uint8_t *)&result)[1] = f.read(); // MSB
- return result;
- }
- // *********************************************************************************************************** //
- // *** Wczytaj BITMAPĘ 32 *** //
- // *********************************************************************************************************** //
- uint32_t TFTPanel :: read32(fs::File &f) {
- uint32_t result;
- ((uint8_t *)&result)[0] = f.read(); // LSB
- ((uint8_t *)&result)[1] = f.read();
- ((uint8_t *)&result)[2] = f.read();
- ((uint8_t *)&result)[3] = f.read(); // MSB
- return result;
- }
- //
- // *********************************************************************************************************** //
- // *** Narysuj maksymalne okno *** //
- // *********************************************************************************************************** //
- //
- inline void TFTPanel :: DrawMaxWindow()
- {
- tft.drawRect(window_min_x, window_min_y, window_size_x, window_size_y, Color_Line); // ramka ekranu
- tft.drawFastHLine(window_min_x, window_min_y + 35, window_size_y, Color_Line); // rysuj linię
- }
- //
- // *********************************************************************************************************** //
- // *** Narysuj ramkę dolną *** //
- // *********************************************************************************************************** //
- //
- inline void TFTPanel :: DrawDownWindow126()
- {
- tft.drawRect(window_min_x, window_max_y - 126, window_size_x, 126, Color_Line); // ramka dolna
- }
- //
- // *********************************************************************************************************** //
- // *** Narysuj ramkę górną *** //
- // *********************************************************************************************************** //
- //
- inline void TFTPanel :: DrawUpWindow126()
- {
- tft.drawRect(window_min_x, window_max_y - (2 * 126) + 2, window_size_x, 126, Color_Line); // ramka górna
- }
- //
- // *********************************************************************************************************** //
- // *** Zapamiętaj ustawienia okna UP *** //
- // *********************************************************************************************************** //
- //
- inline void TFTPanel :: SetupUpAnalogWindow126( int v_min, int v_step, String v_name)
- {
- Window_TFT_up.value_min = v_min; // minimalna wartość ANALOG METER
- Window_TFT_up.value_step = v_step; // zwiekszaj wartość ANALOG METER o V_STEP
- Window_TFT_up.value_max = v_min + ( 4 * v_step ); // maksymalna wartość ANALOG METER
- Window_TFT_up.value_name = v_name; // przypisz nazwę dla ANALOG METER
- }
- //
- // *********************************************************************************************************** //
- // *** Zapamiętaj ustawienia okna DOWN *** //
- // *********************************************************************************************************** //
- //
- inline void TFTPanel :: SetupDownAnalogWindow126( int v_min, int v_step, String v_name)
- {
- Window_TFT_down.value_min = v_min; // minimalna wartość ANALOG METER
- Window_TFT_down.value_step = v_step; // zwiększaj wartość ANALOG METER o V_STEP
- Window_TFT_down.value_max = v_min + ( 4 * v_step ); // maksymalna wartość ANALOG METER
- Window_TFT_down.value_name = v_name; // przypisz nazwę dla ANALOG METER
- }
- //
- // *********************************************************************************************************** //
- // *** Temperatura color mode *** //
- // *********************************************************************************************************** //
- //
- void TFTPanel :: DrawTemperatureColor(int x0, int y0, int x1, int y1, int x2, int y2, int x3, int y3, int i)
- {
- if (i >= -50 && i < -45) // początek IF
- {
- tft.fillTriangle(x0, y0, x1, y1, x2, y2, tft.color565(0, 191, 255));
- tft.fillTriangle(x1, y1, x2, y2, x3, y3, tft.color565(0, 191, 255));
- } // koniec IF
- else // lub
- if (i >= -45 && i < -40) // początek IF
- {
- tft.fillTriangle(x0, y0, x1, y1, x2, y2, tft.color565(0, 220, 255));
- tft.fillTriangle(x1, y1, x2, y2, x3, y3, tft.color565(0, 220, 255));
- } // koniec IF
- else // lub
- if (i >= -40 && i < -35) // początek IF
- {
- tft.fillTriangle(x0, y0, x1, y1, x2, y2, tft.color565(0, 255, 255));
- tft.fillTriangle(x1, y1, x2, y2, x3, y3, tft.color565(0, 255, 255));
- } // koniec IF
- else // lub
- if (i >= -35 && i < -30) // początek IF
- {
- tft.fillTriangle(x0, y0, x1, y1, x2, y2, tft.color565(0, 255, 191));
- tft.fillTriangle(x1, y1, x2, y2, x3, y3, tft.color565(0, 255, 191));
- } // koniec IF
- else // lub
- if (i >= -30 && i < -25) // początek IF
- {
- tft.fillTriangle(x0, y0, x1, y1, x2, y2, tft.color565(0, 255, 128));
- tft.fillTriangle(x1, y1, x2, y2, x3, y3, tft.color565(0, 255, 128));
- } // koniec IF
- else // lub
- if (i >= -25 && i < -20) // początek IF
- {
- tft.fillTriangle(x0, y0, x1, y1, x2, y2, tft.color565(0, 255, 64));
- tft.fillTriangle(x1, y1, x2, y2, x3, y3, tft.color565(0, 255, 64));
- }
- else // lub
- if (i >= -20 && i < -15) // początek IF
- {
- tft.fillTriangle(x0, y0, x1, y1, x2, y2, tft.color565(0, 255, 0));
- tft.fillTriangle(x1, y1, x2, y2, x3, y3, tft.color565(0, 255, 0));
- } // koniec IF
- else // lub
- if (i >= -15 && i < -10) // początek IF
- {
- tft.fillTriangle(x0, y0, x1, y1, x2, y2, tft.color565(20, 255, 0));
- tft.fillTriangle(x1, y1, x2, y2, x3, y3, tft.color565(20, 255, 0));
- } // koniec IF
- else // lub
- if (i >= -10 && i < -5) // początek IF
- {
- tft.fillTriangle(x0, y0, x1, y1, x2, y2, tft.color565(40, 255, 0));
- tft.fillTriangle(x1, y1, x2, y2, x3, y3, tft.color565(40, 255, 0));
- } // koniec IF
- else // lub
- if (i >= -5 && i < 0) // początek IF
- {
- tft.fillTriangle(x0, y0, x1, y1, x2, y2, tft.color565(64, 255, 0));
- tft.fillTriangle(x1, y1, x2, y2, x3, y3, tft.color565(64, 255, 0));
- } // koniec IF
- else // lub
- if (i >= 0 && i < 5) // początek IF
- {
- tft.fillTriangle(x0, y0, x1, y1, x2, y2, tft.color565(128, 255, 0));
- tft.fillTriangle(x1, y1, x2, y2, x3, y3, tft.color565(128, 255, 0));
- } // koniec IF
- else // lub
- if (i >= 5 && i < 10) // początek IF
- {
- tft.fillTriangle(x0, y0, x1, y1, x2, y2, tft.color565(160, 255, 0));
- tft.fillTriangle(x1, y1, x2, y2, x3, y3, tft.color565(160, 255, 0));
- } // koniec IF
- else // lub
- if (i >= 10 && i < 15) // początek IF
- {
- tft.fillTriangle(x0, y0, x1, y1, x2, y2, tft.color565(160, 255, 0));
- tft.fillTriangle(x1, y1, x2, y2, x3, y3, tft.color565(160, 255, 0));
- } // koniec IF
- else // lub
- if (i >= 15 && i < 20) // początek IF
- {
- tft.fillTriangle(x0, y0, x1, y1, x2, y2, tft.color565(190, 255, 0));
- tft.fillTriangle(x1, y1, x2, y2, x3, y3, tft.color565(190, 255, 0));
- } // koniec IF
- else // lub
- if (i >= 20 && i < 25) // początek IF
- {
- tft.fillTriangle(x0, y0, x1, y1, x2, y2, tft.color565(220, 255, 0));
- tft.fillTriangle(x1, y1, x2, y2, x3, y3, tft.color565(220, 255, 0));
- } // koniec IF
- else // lub
- if (i >= 25 && i < 30) // początek IF
- {
- tft.fillTriangle(x0, y0, x1, y1, x2, y2, tft.color565(255, 255, 0));
- tft.fillTriangle(x1, y1, x2, y2, x3, y3, tft.color565(255, 255, 0));
- } // koniec IF
- else // lub
- if (i >= 30 && i < 35) // początek IF
- {
- tft.fillTriangle(x0, y0, x1, y1, x2, y2, tft.color565(230, 230, 0));
- tft.fillTriangle(x1, y1, x2, y2, x3, y3, tft.color565(230, 230, 0));
- } // koniec IF
- else // lub
- if (i >= 35 && i < 40) // początek IF
- {
- tft.fillTriangle(x0, y0, x1, y1, x2, y2, tft.color565(204, 204, 0));
- tft.fillTriangle(x1, y1, x2, y2, x3, y3, tft.color565(204, 204, 0));
- } // koniec IF
- else // lub
- if (i >= 40 && i < 45) // początek IF
- {
- tft.fillTriangle(x0, y0, x1, y1, x2, y2, tft.color565(179, 179, 0));
- tft.fillTriangle(x1, y1, x2, y2, x3, y3, tft.color565(179, 179, 0));
- } // koniec IF
- else // lub
- if (i >= 45 && i < 50) // początek IF
- {
- tft.fillTriangle(x0, y0, x1, y1, x2, y2, tft.color565(153, 153, 0));
- tft.fillTriangle(x1, y1, x2, y2, x3, y3, tft.color565(153, 153, 0));
- }
- }
- //
- // *********************************************************************************************************** //
- // *** Temperatura color mode *** //
- // *********************************************************************************************************** //
- //
- void TFTPanel :: DrawWilgotnoscColor(int x0, int y0, int x1, int y1, int x2, int y2, int x3, int y3, int i)
- {
- if (i >= -50 && i < -45) // początek IF
- {
- tft.fillTriangle(x0, y0, x1, y1, x2, y2, tft.color565(230, 255, 242));
- tft.fillTriangle(x1, y1, x2, y2, x3, y3, tft.color565(230, 255, 242));
- } // koniec IF
- else // lub
- if (i >= -45 && i < -40) // początek IF
- {
- tft.fillTriangle(x0, y0, x1, y1, x2, y2, tft.color565(204, 255, 230));
- tft.fillTriangle(x1, y1, x2, y2, x3, y3, tft.color565(204, 255, 230));
- } // koniec IF
- else // lub
- if (i >= -40 && i < -35) // początek IF
- {
- tft.fillTriangle(x0, y0, x1, y1, x2, y2, tft.color565(179, 255, 217));
- tft.fillTriangle(x1, y1, x2, y2, x3, y3, tft.color565(179, 255, 217));
- } // koniec IF
- else // lub
- if (i >= -35 && i < -30) // początek IF
- {
- tft.fillTriangle(x0, y0, x1, y1, x2, y2, tft.color565(153, 255, 204));
- tft.fillTriangle(x1, y1, x2, y2, x3, y3, tft.color565(153, 255, 204));
- } // koniec IF
- else // lub
- if (i >= -30 && i < -25) // początek IF
- {
- tft.fillTriangle(x0, y0, x1, y1, x2, y2, tft.color565(128, 255, 191));
- tft.fillTriangle(x1, y1, x2, y2, x3, y3, tft.color565(128, 255, 191));
- } // koniec IF
- else // lub
- if (i >= -25 && i < -20) // początek IF
- {
- tft.fillTriangle(x0, y0, x1, y1, x2, y2, tft.color565(102, 255, 179));
- tft.fillTriangle(x1, y1, x2, y2, x3, y3, tft.color565(102, 255, 179));
- }
- else // lub
- if (i >= -20 && i < -15) // początek IF
- {
- tft.fillTriangle(x0, y0, x1, y1, x2, y2, tft.color565(77, 255, 166));
- tft.fillTriangle(x1, y1, x2, y2, x3, y3, tft.color565(77, 255, 166));
- } // koniec IF
- else // lub
- if (i >= -15 && i < -10) // początek IF
- {
- tft.fillTriangle(x0, y0, x1, y1, x2, y2, tft.color565(51, 255, 153));
- tft.fillTriangle(x1, y1, x2, y2, x3, y3, tft.color565(51, 255, 153));
- } // koniec IF
- else // lub
- if (i >= -10 && i < -5) // początek IF
- {
- tft.fillTriangle(x0, y0, x1, y1, x2, y2, tft.color565(26, 255, 140));
- tft.fillTriangle(x1, y1, x2, y2, x3, y3, tft.color565(26, 255, 140));
- } // koniec IF
- else // lub
- if (i >= -5 && i < 0) // początek IF
- {
- tft.fillTriangle(x0, y0, x1, y1, x2, y2, tft.color565(51, 255, 153));
- tft.fillTriangle(x1, y1, x2, y2, x3, y3, tft.color565(51, 255, 153));
- } // koniec IF
- else // lub
- if (i >= 0 && i < 5) // początek IF
- {
- tft.fillTriangle(x0, y0, x1, y1, x2, y2, tft.color565(26, 255, 140));
- tft.fillTriangle(x1, y1, x2, y2, x3, y3, tft.color565(26, 255, 140));
- } // koniec IF
- else // lub
- if (i >= 5 && i < 10) // początek IF
- {
- tft.fillTriangle(x0, y0, x1, y1, x2, y2, tft.color565(0, 255, 128));
- tft.fillTriangle(x1, y1, x2, y2, x3, y3, tft.color565(0, 255, 128));
- } // koniec IF
- else // lub
- if (i >= 10 && i < 15) // początek IF
- {
- tft.fillTriangle(x0, y0, x1, y1, x2, y2, tft.color565(0, 230, 115));
- tft.fillTriangle(x1, y1, x2, y2, x3, y3, tft.color565(0, 230, 115));
- } // koniec IF
- else // lub
- if (i >= 15 && i < 20) // początek IF
- {
- tft.fillTriangle(x0, y0, x1, y1, x2, y2, tft.color565(0, 204, 102));
- tft.fillTriangle(x1, y1, x2, y2, x3, y3, tft.color565(0, 204, 102));
- } // koniec IF
- else // lub
- if (i >= 20 && i < 25) // początek IF
- {
- tft.fillTriangle(x0, y0, x1, y1, x2, y2, tft.color565(0, 179, 89));
- tft.fillTriangle(x1, y1, x2, y2, x3, y3, tft.color565(0, 179, 89));
- } // koniec IF
- else // lub
- if (i >= 25 && i < 30) // początek IF
- {
- tft.fillTriangle(x0, y0, x1, y1, x2, y2, tft.color565(0, 153, 77));
- tft.fillTriangle(x1, y1, x2, y2, x3, y3, tft.color565(0, 153, 77));
- } // koniec IF
- else // lub
- if (i >= 30 && i < 35) // początek IF
- {
- tft.fillTriangle(x0, y0, x1, y1, x2, y2, tft.color565(0, 128, 64));
- tft.fillTriangle(x1, y1, x2, y2, x3, y3, tft.color565(0, 128, 64));
- } // koniec IF
- else // lub
- if (i >= 35 && i < 40) // początek IF
- {
- tft.fillTriangle(x0, y0, x1, y1, x2, y2, tft.color565(0, 102, 51));
- tft.fillTriangle(x1, y1, x2, y2, x3, y3, tft.color565(0, 102, 51));
- } // koniec IF
- else // lub
- if (i >= 40 && i < 45) // początek IF
- {
- tft.fillTriangle(x0, y0, x1, y1, x2, y2, tft.color565(0, 77, 38));
- tft.fillTriangle(x1, y1, x2, y2, x3, y3, tft.color565(0, 77, 38));
- } // koniec IF
- else // lub
- if (i >= 45 && i < 50) // początek IF
- {
- tft.fillTriangle(x0, y0, x1, y1, x2, y2, tft.color565(0, 51, 26));
- tft.fillTriangle(x1, y1, x2, y2, x3, y3, tft.color565(0, 51, 26));
- }
- }
- //
- // *********************************************************************************************************** //
- // *** Zachmurzenie color mode *** //
- // *********************************************************************************************************** //
- //
- void TFTPanel :: DrawZachmurzenieColor(int x0, int y0, int x1, int y1, int x2, int y2, int x3, int y3, int i)
- {
- if (i >= -50 && i < -45) // początek IF
- {
- tft.fillTriangle(x0, y0, x1, y1, x2, y2, tft.color565(255, 255, 255));
- tft.fillTriangle(x1, y1, x2, y2, x3, y3, tft.color565(255, 255, 255));
- } // koniec IF
- else // lub
- if (i >= -45 && i < -40) // początek IF
- {
- tft.fillTriangle(x0, y0, x1, y1, x2, y2, tft.color565(230, 242, 255));
- tft.fillTriangle(x1, y1, x2, y2, x3, y3, tft.color565(230, 242, 255));
- } // koniec IF
- else // lub
- if (i >= -40 && i < -35) // początek IF
- {
- tft.fillTriangle(x0, y0, x1, y1, x2, y2, tft.color565(204, 230, 255));
- tft.fillTriangle(x1, y1, x2, y2, x3, y3, tft.color565(204, 230, 255));
- } // koniec IF
- else // lub
- if (i >= -35 && i < -30) // początek IF
- {
- tft.fillTriangle(x0, y0, x1, y1, x2, y2, tft.color565(179, 217, 255));
- tft.fillTriangle(x1, y1, x2, y2, x3, y3, tft.color565(179, 217, 255));
- } // koniec IF
- else // lub
- if (i >= -30 && i < -25) // początek IF
- {
- tft.fillTriangle(x0, y0, x1, y1, x2, y2, tft.color565(153, 204, 255));
- tft.fillTriangle(x1, y1, x2, y2, x3, y3, tft.color565(153, 204, 255));
- } // koniec IF
- else // lub
- if (i >= -25 && i < -20) // początek IF
- {
- tft.fillTriangle(x0, y0, x1, y1, x2, y2, tft.color565(128, 191, 255));
- tft.fillTriangle(x1, y1, x2, y2, x3, y3, tft.color565(128, 191, 255));
- }
- else // lub
- if (i >= -20 && i < -15) // początek IF
- {
- tft.fillTriangle(x0, y0, x1, y1, x2, y2, tft.color565(102, 179, 255));
- tft.fillTriangle(x1, y1, x2, y2, x3, y3, tft.color565(102, 179, 255));
- } // koniec IF
- else // lub
- if (i >= -15 && i < -10) // początek IF
- {
- tft.fillTriangle(x0, y0, x1, y1, x2, y2, tft.color565(77, 166, 255));
- tft.fillTriangle(x1, y1, x2, y2, x3, y3, tft.color565(77, 166, 255));
- } // koniec IF
- else // lub
- if (i >= -10 && i < -5) // początek IF
- {
- tft.fillTriangle(x0, y0, x1, y1, x2, y2, tft.color565(51, 153, 255));
- tft.fillTriangle(x1, y1, x2, y2, x3, y3, tft.color565(51, 153, 255));
- } // koniec IF
- else // lub
- if (i >= -5 && i < 0) // początek IF
- {
- tft.fillTriangle(x0, y0, x1, y1, x2, y2, tft.color565(26, 140, 255));
- tft.fillTriangle(x1, y1, x2, y2, x3, y3, tft.color565(26, 140, 255));
- } // koniec IF
- else // lub
- if (i >= 0 && i < 5) // początek IF
- {
- tft.fillTriangle(x0, y0, x1, y1, x2, y2, tft.color565(0, 128, 255));
- tft.fillTriangle(x1, y1, x2, y2, x3, y3, tft.color565(0, 128, 255));
- } // koniec IF
- else // lub
- if (i >= 5 && i < 10) // początek IF
- {
- tft.fillTriangle(x0, y0, x1, y1, x2, y2, tft.color565(0, 115, 230));
- tft.fillTriangle(x1, y1, x2, y2, x3, y3, tft.color565(0, 115, 230));
- } // koniec IF
- else // lub
- if (i >= 10 && i < 15) // początek IF
- {
- tft.fillTriangle(x0, y0, x1, y1, x2, y2, tft.color565(0, 102, 204));
- tft.fillTriangle(x1, y1, x2, y2, x3, y3, tft.color565(0, 102, 204));
- } // koniec IF
- else // lub
- if (i >= 15 && i < 20) // początek IF
- {
- tft.fillTriangle(x0, y0, x1, y1, x2, y2, tft.color565(0, 89, 179));
- tft.fillTriangle(x1, y1, x2, y2, x3, y3, tft.color565(0, 89, 179));
- } // koniec IF
- else // lub
- if (i >= 20 && i < 25) // początek IF
- {
- tft.fillTriangle(x0, y0, x1, y1, x2, y2, tft.color565(0, 77, 153));
- tft.fillTriangle(x1, y1, x2, y2, x3, y3, tft.color565(0, 77, 153));
- } // koniec IF
- else // lub
- if (i >= 25 && i < 30) // początek IF
- {
- tft.fillTriangle(x0, y0, x1, y1, x2, y2, tft.color565(0, 64, 128));
- tft.fillTriangle(x1, y1, x2, y2, x3, y3, tft.color565(0, 64, 128));
- } // koniec IF
- else // lub
- if (i >= 30 && i < 35) // początek IF
- {
- tft.fillTriangle(x0, y0, x1, y1, x2, y2, tft.color565(0, 59, 102));
- tft.fillTriangle(x1, y1, x2, y2, x3, y3, tft.color565(0, 59, 102));
- } // koniec IF
- else // lub
- if (i >= 35 && i < 40) // początek IF
- {
- tft.fillTriangle(x0, y0, x1, y1, x2, y2, tft.color565(0, 50, 102));
- tft.fillTriangle(x1, y1, x2, y2, x3, y3, tft.color565(0, 50, 102));
- } // koniec IF
- else // lub
- if (i >= 40 && i < 45) // początek IF
- {
- tft.fillTriangle(x0, y0, x1, y1, x2, y2, tft.color565(0, 40, 102));
- tft.fillTriangle(x1, y1, x2, y2, x3, y3, tft.color565(0, 40, 102));
- } // koniec IF
- else // lub
- if (i >= 45 && i < 50) // początek IF
- {
- tft.fillTriangle(x0, y0, x1, y1, x2, y2, tft.color565(0, 38, 77));
- tft.fillTriangle(x1, y1, x2, y2, x3, y3, tft.color565(0, 38, 77));
- }
- }
- //
- // *********************************************************************************************************** //
- // *** Cisnienie color mode *** //
- // *********************************************************************************************************** //
- //
- void TFTPanel :: DrawCisnienieColor(int x0, int y0, int x1, int y1, int x2, int y2, int x3, int y3, int i)
- {
- if (i >= -50 && i < -45) // początek IF
- {
- tft.fillTriangle(x0, y0, x1, y1, x2, y2, tft.color565(0, 0, 255));
- tft.fillTriangle(x1, y1, x2, y2, x3, y3, tft.color565(0, 0, 255));
- } // koniec IF
- else // lub
- if (i >= -45 && i < -40) // początek IF
- {
- tft.fillTriangle(x0, y0, x1, y1, x2, y2, tft.color565(0, 40, 255));
- tft.fillTriangle(x1, y1, x2, y2, x3, y3, tft.color565(0, 40, 255));
- } // koniec IF
- else // lub
- if (i >= -40 && i < -35) // początek IF
- {
- tft.fillTriangle(x0, y0, x1, y1, x2, y2, tft.color565(0, 80, 255));
- tft.fillTriangle(x1, y1, x2, y2, x3, y3, tft.color565(0, 80, 255));
- } // koniec IF
- else // lub
- if (i >= -35 && i < -30) // początek IF
- {
- tft.fillTriangle(x0, y0, x1, y1, x2, y2, tft.color565(0, 128, 255));
- tft.fillTriangle(x1, y1, x2, y2, x3, y3, tft.color565(0, 128, 255));
- } // koniec IF
- else // lub
- if (i >= -30 && i < -25) // początek IF
- {
- tft.fillTriangle(x0, y0, x1, y1, x2, y2, tft.color565(0, 191, 255));
- tft.fillTriangle(x1, y1, x2, y2, x3, y3, tft.color565(0, 191, 255));
- } // koniec IF
- else // lub
- if (i >= -25 && i < -20) // początek IF
- {
- tft.fillTriangle(x0, y0, x1, y1, x2, y2, tft.color565(0, 210, 255));
- tft.fillTriangle(x1, y1, x2, y2, x3, y3, tft.color565(0, 210, 255));
- }
- else // lub
- if (i >= -20 && i < -15) // początek IF
- {
- tft.fillTriangle(x0, y0, x1, y1, x2, y2, tft.color565(0, 235, 191));
- tft.fillTriangle(x1, y1, x2, y2, x3, y3, tft.color565(0, 235, 191));
- } // koniec IF
- else // lub
- if (i >= -15 && i < -10) // początek IF
- {
- tft.fillTriangle(x0, y0, x1, y1, x2, y2, tft.color565(0, 255, 205));
- tft.fillTriangle(x1, y1, x2, y2, x3, y3, tft.color565(0, 255, 205));
- } // koniec IF
- else // lub
- if (i >= -10 && i < -5) // początek IF
- {
- tft.fillTriangle(x0, y0, x1, y1, x2, y2, tft.color565(100, 255, 180));
- tft.fillTriangle(x1, y1, x2, y2, x3, y3, tft.color565(100, 255, 180));
- } // koniec IF
- else // lub
- if (i >= -5 && i < 0) // początek IF
- {
- tft.fillTriangle(x0, y0, x1, y1, x2, y2, tft.color565(122, 255, 153));
- tft.fillTriangle(x1, y1, x2, y2, x3, y3, tft.color565(122, 255, 153));
- } // koniec IF
- else // lub
- if (i >= 0 && i < 5) // początek IF
- {
- tft.fillTriangle(x0, y0, x1, y1, x2, y2, tft.color565(122, 255, 153));
- tft.fillTriangle(x1, y1, x2, y2, x3, y3, tft.color565(122, 255, 153));
- } // koniec IF
- else // lub
- if (i >= 5 && i < 10) // początek IF
- {
- tft.fillTriangle(x0, y0, x1, y1, x2, y2, tft.color565(102, 255, 153));
- tft.fillTriangle(x1, y1, x2, y2, x3, y3, tft.color565(102, 255, 153));
- } // koniec IF
- else // lub
- if (i >= 10 && i < 15) // początek IF
- {
- tft.fillTriangle(x0, y0, x1, y1, x2, y2, tft.color565(77, 255, 136));
- tft.fillTriangle(x1, y1, x2, y2, x3, y3, tft.color565(77, 255, 136));
- } // koniec IF
- else // lub
- if (i >= 15 && i < 20) // początek IF
- {
- tft.fillTriangle(x0, y0, x1, y1, x2, y2, tft.color565(51, 255, 119));
- tft.fillTriangle(x1, y1, x2, y2, x3, y3, tft.color565(51, 255, 119));
- } // koniec IF
- else // lub
- if (i >= 20 && i < 25) // początek IF
- {
- tft.fillTriangle(x0, y0, x1, y1, x2, y2, tft.color565(26, 255, 102));
- tft.fillTriangle(x1, y1, x2, y2, x3, y3, tft.color565(26, 255, 102));
- } // koniec IF
- else // lub
- if (i >= 25 && i < 30) // początek IF
- {
- tft.fillTriangle(x0, y0, x1, y1, x2, y2, tft.color565(0, 255, 85));
- tft.fillTriangle(x1, y1, x2, y2, x3, y3, tft.color565(0, 255, 85));
- } // koniec IF
- else // lub
- if (i >= 30 && i < 35) // początek IF
- {
- tft.fillTriangle(x0, y0, x1, y1, x2, y2, tft.color565(0, 204, 68));
- tft.fillTriangle(x1, y1, x2, y2, x3, y3, tft.color565(0, 204, 68));
- } // koniec IF
- else // lub
- if (i >= 35 && i < 40) // początek IF
- {
- tft.fillTriangle(x0, y0, x1, y1, x2, y2, tft.color565(0, 179, 60));
- tft.fillTriangle(x1, y1, x2, y2, x3, y3, tft.color565(0, 179, 60));
- } // koniec IF
- else // lub
- if (i >= 40 && i < 45) // początek IF
- {
- tft.fillTriangle(x0, y0, x1, y1, x2, y2, tft.color565(0, 153, 51));
- tft.fillTriangle(x1, y1, x2, y2, x3, y3, tft.color565(0, 153, 51));
- } // koniec IF
- else // lub
- if (i >= 45 && i < 50) // początek IF
- {
- tft.fillTriangle(x0, y0, x1, y1, x2, y2, tft.color565(0, 128, 43));
- tft.fillTriangle(x1, y1, x2, y2, x3, y3, tft.color565(0, 128, 43));
- }
- }
- //
- // *********************************************************************************************************** //
- // *** Narysuj miernik analogowy *** //
- // *********************************************************************************************************** //
- //
- void TFTPanel :: DrawAnalogWindow126(uint16_t start_y, int value_start, int value_step, byte color_mode)
- {
- tft.setTextColor(TFT_WHITE);
- if ( window_up_v1 == start_y )
- {
- tft.drawRightString ( Window_TFT_up.value_name, 220, 119 - 20 + start_y, 2);
- Window_TFT_up.pos_y = start_y;
- }
- else
- if (window_down_v1 == start_y)
- {
- tft.drawRightString ( Window_TFT_down.value_name, 220, 119 - 20 + start_y, 2);
- Window_TFT_down.pos_y = start_y;
- }
- for (int i = -50; i < 51; i += 5) // pętla od - 50 do 50
- { // początek FOR
- int tl = 15; // tl równa się 15
- float sx = cos((i - 90) * 0.0174532925); // wyznacz sx
- float sy = sin((i - 90) * 0.0174532925); // wyznacz sy
- uint16_t x0 = sx * (100 + tl) + 120; // wyznacz x0
- uint16_t y0 = sy * (100 + tl) + 140+start_y; // wyznacz y0
- uint16_t x1 = sx * 100 + 120; // wyznacz x1
- uint16_t y1 = sy * 100 + 140+start_y; // wyznacz y1
- float sx2 = cos((i + 5 - 90) * 0.0174532925); // wyznacz sx2
- float sy2 = sin((i + 5 - 90) * 0.0174532925); // wyznacz sy2
- int x2 = sx2 * (100 + tl) + 120; // wyznacz x2
- int y2 = sy2 * (100 + tl) + 140+start_y; // wyznacz y2
- int x3 = sx2 * 100 + 120; // wyznacz x3
- int y3 = sy2 * 100 + 140+start_y; // wyznacz y3
- // fake line auto-generater
- switch ( color_mode )
- {
- case 0 : DrawTemperatureColor(x0, y0, x1, y1, x2, y2, x3, y3, i); break;
- case 1 : DrawWilgotnoscColor(x0, y0, x1, y1, x2, y2, x3, y3, i); break;
- case 2 : DrawZachmurzenieColor(x0, y0, x1, y1, x2, y2, x3, y3, i); break;
- case 3 : DrawCisnienieColor(x0, y0, x1, y1, x2, y2, x3, y3, i); break;
- }
- // fake line auto-generate
- if (i % 25 != 0) tl = 8; // jeśli reszta z dzielenia rózna od 0
- // fake line auto-generate
- x0 = sx * (100 + tl) + 120; // oblicz x0
- y0 = sy * (100 + tl) + 140+start_y; // oblicz y0
- x1 = sx * 100 + 120; // oblicz x1
- y1 = sy * 100 + 140+start_y; // oblicz y1
- // fake line auto-generate
- tft.drawLine(x0, y0, x1, y1, TFT_BLACK); // drukuj ticka
- // fake line auto-generate
- if (i % 25 == 0) // jeśli reszta z dzielenia to 0
- { // to
- x0 = sx * (100 + tl + 10) + 120; // wyznacz x0
- y0 = sy * (100 + tl + 10) + 140+start_y; // wyznacz y0
- // fake line auto-generate
- int FValue; // zapisz tu skok skali
- // fake line auto-generate
- switch (i / 25) // liczba całkowita z dzielenia / 25
- { // przełącznik logiczny
- case -2: FValue = value_start + ( 0 * value_step ); // oblicz dla -2 wartość FVALUE
- tft.drawCentreString(String(FValue), x0, y0 - 12, 2); // konwertuj do STRING pokaż na TFT
- break; // przerwij
- case -1: FValue = value_start + ( 1 * value_step ); // oblicz dla -1 wartość FVALUE
- tft.drawCentreString(String(FValue), x0, y0 - 9, 2); // konwertuj do STRING pokaż na TFT
- break; // przerwij
- case 0: FValue = value_start + ( 2 * value_step ); // oblicz dla 0 wartość FVALUE
- tft.drawCentreString(String(FValue), x0, y0 - 6, 2); // konwertuj do STRING pokaż na TFT
- break; // przerwij
- case 1: FValue = value_start + ( 3 * value_step ); // oblicz dla +1 wartość FVALUE
- tft.drawCentreString(String(FValue), x0, y0 - 9, 2); // konwertuj do STRING pokaż na TFT
- break; // przerwij
- case 2: FValue = value_start + ( 4 * value_step ); // oblicz dla +2 wartość FVALUE
- tft.drawCentreString(String(FValue), x0, y0 - 12, 2); // konwertuj do STRING pokaż na TFT
- break; // przerwij
- } // K O N I E C P R Z E Ł A C Z N I K
- } // K O N I E C R E S Z T A % 0
- // fake line auto-generate
- sx = cos((i + 5 - 90) * 0.0174532925); // wyznacz sx z cosinusa DT I 0.1714
- sy = sin((i + 5 - 90) * 0.0174532925); // wyznacz sy z sinusa DT I 0.1714
- x0 = sx * 100 + 120; // podstaw pod x0
- y0 = sy * 100 + 140+start_y; // podstaw pod y0
- if (i < 50) tft.drawLine(x0, y0, x1, y1, TFT_BLACK); // drukuj skalę
- } // K O N I E C P Ę T L I F O R
- } // K O N I E C F U N K C J I
- //
- // *********************************************************************************************************** //
- // *** Pokaz miernik analogowy UP *** //
- // *********************************************************************************************************** //
- //
- void TFTPanel :: AnalogPanelUp_v1_Show126(int value)
- {
- int y = Window_TFT_up.pos_y; // wyznacz oś y ze struktury UP
- int ms_delay = 0;
- char buf[8]; // bufor tekstowy
- dtostrf(value, 4, 0, buf); // kopiuj wartość typu INT do CHAR
- // fake line auto-generated
- tft.setTextColor(TFT_WHITE, TFT_BLACK); // ustaw kolor czcionki / tła
- tft.drawRightString(buf, 50, 119 - 20+y, 2); // drukuj zawartość bufora CHAR
- tft.drawRightString(Window_TFT_up.value_name, 220, 119 - 20+y, 2); // drukuj zawartość dla UP
- // fake line auto-generated
- if (value < Window_TFT_up.value_min) value = Window_TFT_up.value_min; // ustaw wartość minimalną
- if (value > Window_TFT_up.value_max) value = Window_TFT_up.value_max; // ustaw wartość maxymalną
- // fake line auto-generated
- while (!(value == Window_TFT_up.old_analog)) // jesli wartości się zmieniły
- { // początek pętli WHILE
- if (Window_TFT_up.old_analog < value) Window_TFT_up.old_analog++; // sprawdź
- else Window_TFT_up.old_analog--; // jeśli FAŁSZ odejmij 1
- // fake line auto-generated
- if (ms_delay == 0) Window_TFT_up.old_analog = value; // fake flicker
- // fake line auto-generated
- float sdeg = map(Window_TFT_up.old_analog, Window_TFT_up.value_min, Window_TFT_up.value_max, -150, -30); // skalowanie to wartości MIN / MAX
- // fale line auto-generated
- float sx = cos(sdeg * 0.0174532925); // oblicz nowe wartości dla sx
- float sy = sin(sdeg * 0.0174532925); // oblicz nowe wartości dla xy
- float tx = tan((sdeg + 90) * 0.0174532925); // oblicz DELTĘ
- // fake line auto-generated
- tft.drawLine(120 + 20 * Window_TFT_up.ltx - 1, 140 - 20+y, Window_TFT_up.osx - 1, Window_TFT_up.osy+y, TFT_BLACK); // skasuj starą wskazówkę
- tft.drawLine(120 + 20 * Window_TFT_up.ltx, 140 - 20+y, Window_TFT_up.osx, Window_TFT_up.osy+y, TFT_BLACK); // skasuj starą wskazówkę
- tft.drawLine(120 + 20 * Window_TFT_up.ltx + 1, 140 - 20+y, Window_TFT_up.osx + 1, Window_TFT_up.osy+y, TFT_BLACK); // skasuj starą wskazówkę
- tft.setTextColor(TFT_WHITE); // ustaw kolor znaków / pikseli
- // fake line auto-generated
- Window_TFT_up.ltx = tx; // zapisz nowe tx
- Window_TFT_up.osx = sx * 98 + 120; // zapisz nowe sx
- Window_TFT_up.osy = sy * 98 + 140; // zapisz nowe sy
- // fake line auto-generated
- tft.drawLine(120 + 20 * Window_TFT_up.ltx - 1, 140 - 20+y, Window_TFT_up.osx - 1, Window_TFT_up.osy +y, TFT_WHITE); // pokaz nową wskazówkę
- tft.drawLine(120 + 20 * Window_TFT_up.ltx, 140 - 20+y, Window_TFT_up.osx, Window_TFT_up.osy +y, TFT_WHITE); // pokaz nową wskazówkę
- tft.drawLine(120 + 20 * Window_TFT_up.ltx + 1, 140 - 20+y, Window_TFT_up.osx + 1, Window_TFT_up.osy +y, TFT_WHITE); // pokaz nową wskazówkę
- // fake line auto-generated
- if (abs(Window_TFT_up.old_analog - value) < 10) ms_delay += ms_delay / 5; // fake flicker
- delay(ms_delay); // fake flicker
- } // K O N I E C W H I L E
- }
- //
- // *********************************************************************************************************** //
- // *** Narysuj miernik analogowy DOWN *** //
- // *********************************************************************************************************** //
- //
- void TFTPanel :: AnalogPanelDown_v1_Show126(int value)
- {
- int y = Window_TFT_down.pos_y; // wyznacz oś y ze struktury UP
- int ms_delay = 0;
- char buf[8]; // bufor tekstowy
- dtostrf(value, 4, 0, buf); // kopiuj wartość typu INT do CHAR
- // fake line auto-generated
- tft.setTextColor(TFT_WHITE, TFT_BLACK); // ustaw kolor czcionki / tła
- tft.drawRightString(buf, 40, 119 - 20+y, 2); // drukuj zawartość bufora CHAR
- tft.drawRightString(Window_TFT_down.value_name, 220, 119 - 20+y, 2); // drukuj zawartość dla UP
- // fake line auto-generated
- if (value < Window_TFT_down.value_min) value = Window_TFT_down.value_min; // ustaw wartość minimalną
- if (value > Window_TFT_down.value_max) value = Window_TFT_down.value_max; // ustaw wartość maxymalną
- // fake line auto-generated
- while (!(value == Window_TFT_down.old_analog)) // jesli wartości się zmieniły
- { // początek pętli WHILE
- if (Window_TFT_down.old_analog < value) Window_TFT_down.old_analog++; // sprawdź
- else Window_TFT_down.old_analog--; // jeśli FAŁSZ odejmij 1
- // fake line auto-generated
- if (ms_delay == 0) Window_TFT_down.old_analog = value; // fake flicker
- // fake line auto-generated
- float sdeg = map(Window_TFT_down.old_analog, Window_TFT_down.value_min-5, Window_TFT_down.value_max+5, -150, -30); // skalowanie to wartości MIN / MAX
- // fale line auto-generated
- float sx = cos(sdeg * 0.0174532925); // oblicz nowe wartości dla sx
- float sy = sin(sdeg * 0.0174532925); // oblicz nowe wartości dla xy
- float tx = tan((sdeg + 90) * 0.0174532925); // oblicz DELTĘ
- // fake line auto-generated
- tft.drawLine(120 + 20 * Window_TFT_down.ltx - 1, 140 - 20+y, Window_TFT_down.osx - 1, Window_TFT_down.osy+y, TFT_BLACK); // skasuj starą wskazówkę
- tft.drawLine(120 + 20 * Window_TFT_down.ltx, 140 - 20+y, Window_TFT_down.osx, Window_TFT_down.osy+y, TFT_BLACK); // skasuj starą wskazówkę
- tft.drawLine(120 + 20 * Window_TFT_down.ltx + 1, 140 - 20+y, Window_TFT_down.osx + 1, Window_TFT_down.osy+y, TFT_BLACK); // skasuj starą wskazówkę
- tft.setTextColor(TFT_WHITE); // ustaw kolor znaków / pikseli
- // fake line auto-generated
- Window_TFT_down.ltx = tx; // zapisz nowe tx
- Window_TFT_down.osx = sx * 98 + 120; // zapisz nowe sx
- Window_TFT_down.osy = sy * 98 + 140; // zapisz nowe sy
- // fake line auto-generated
- tft.drawLine(120 + 20 * Window_TFT_down.ltx - 1, 140 - 20+y, Window_TFT_down.osx - 1, Window_TFT_down.osy +y, TFT_WHITE); // pokaz nową wskazówkę
- tft.drawLine(120 + 20 * Window_TFT_down.ltx, 140 - 20+y, Window_TFT_down.osx, Window_TFT_down.osy +y, TFT_WHITE); // pokaz nową wskazówkę
- tft.drawLine(120 + 20 * Window_TFT_down.ltx + 1, 140 - 20+y, Window_TFT_down.osx + 1, Window_TFT_down.osy +y, TFT_WHITE); // pokaz nową wskazówkę
- // fake line auto-generated
- if (abs(Window_TFT_down.old_analog - value) < 10) ms_delay += ms_delay / 5; // fake flicker
- delay(ms_delay); // fake flicker
- }
- }
- // =========================================================================================================== //
- // === M E T O D Y P U B L I C Z N E ======================================================================= //
- // =========================================================================================================== //
- //
- //
- // --- S P I S M E T O D P R Y W A T N Y C H ---
- //
- // void TFTPanel :: PanelInit()
- // void TFTPanel :: AnalogPanel_v1_Create()
- // void TFTPanel :: AnalogPanel_v1_Show(int Temperatura, int Wilgotnosc)
- // void TFTPanel :: DigitalClock_v1_Show(ESP32Time & clock, uint8_t x = 10, uint8_t y = 10)
- // void TFTPanel :: DigitalDate_v1_Show(ESP32Time & clock, uint8_t x = 5, uint8_t y = 8)
- // void TFTPanel :: MultiSwitchPanel_v1(ESP32Time & clock, uint8_t x = 5, uint8_t y = 42)
- // void TFTPanel :: DigitalTemperature_v1_Show(uint8_t x = 120, uint8_t y = 42)
- // void TFTPanel :: CodeMsg_v1_Show(uint8_t x = 120, uint8_t y = 42)
- // void TFTPanel :: DigitalCisnienie_v1_Show(uint8_t x = 120, uint8_t y = 42)
- // void TFTPanel :: DigitalWilgotnosc_v1_Show(uint8_t x = 120, uint8_t y = 42)
- // void TFTPanel :: DigitalZachmurzenie_v1_Show(uint8_t x = 120, uint8_t y = 42)
- // void TFTPanel :: DigitalPredkoscWiatru_v1_Show(uint8_t x = 120, uint8_t y = 42);
- // void TFTPanel :: DigitalWschodSlonca_v1_Show(uint8_t x = 120, uint8_t y = 42);
- // void TFTPanel :: DigitalZachodSlonca_v1_Show(uint8_t x = 120, uint8_t y = 42);
- // void TFTPanel :: DigitalLokalizacja_v1_Show(uint8_t x = 120, uint8_t y = 42);
- //
- // *********************************************************************************************************** //
- // *** G ł ó w n a F u n k c j a K o n f i g u r a c y j n a *** //
- // *********************************************************************************************************** //
- //
- void TFTPanel :: PanelInit()
- {
- tft.init(); // inicjalizuj ekran
- tft.setRotation(0); // ustaw rotację
- tft.fillScreen(Color_Bakground); // ustaw tło okna
- }
- //
- // *********************************************************************************************************** //
- // *** A N A L O G P A N E L C R E A T E V 1 *** //
- // *********************************************************************************************************** //
- //
- void TFTPanel :: AnalogPanel_v1_Create()
- {
- DrawMaxWindow(); // rysuj ramkę dla maksymalnego okna głównego
- DrawDownWindow126(); // rysuj ramkę dolną dla modułu ANALOG METER ( DOWN )
- SetupDownAnalogWindow126( 0, 25, "Wilgotnosc"); // ustaw parametry dla ANALOG METER ( DOWN )
- DrawUpWindow126(); // rysuj ramkę górną dla modułu ANALOG METER ( UP )
- SetupUpAnalogWindow126( -10, 10, "Temperatura"); // ustaw parametry dla ANALOG METER ( UP )
- DrawAnalogWindow126( window_up_v1, -10, 10, 0); // rysuj analogowy wskaźnik ( UP ) ( min value ) ( max value )
- DrawAnalogWindow126( window_down_v1, 0, 25, 1); // rysuj analogowy wskaźnik ( DOWN ) ( min value ) ( max value )
- }
- //
- // *********************************************************************************************************** //
- // *** A N A L O G P A N E L C R E A T E V 2 *** //
- // *********************************************************************************************************** //
- //
- void TFTPanel :: AnalogPanel_v2_Create()
- {
- DrawMaxWindow(); // rysuj ramkę dla maksymalnego okna głównego
- DrawDownWindow126(); // rysuj ramkę dolną dla modułu ANALOG METER ( DOWN )
- SetupDownAnalogWindow126( 0, 25, "Zachmurzenie"); // ustaw parametry dla ANALOG METER ( DOWN )
- DrawUpWindow126(); // rysuj ramkę górną dla modułu ANALOG METER ( UP )
- SetupUpAnalogWindow126( 920, 40, "Cisnienie"); // ustaw parametry dla ANALOG METER ( UP )
- DrawAnalogWindow126( window_up_v1, 920, 40, 3); // rysuj analogowy wskaźnik ( UP ) ( min value ) ( max value )
- DrawAnalogWindow126( window_down_v1, 0, 25, 2); // rysuj analogowy wskaźnik ( DOWN ) ( min value ) ( max value )
- }
- //
- // *********************************************************************************************************** //
- // *** A N A L O G P A N E L S H O W V 1 *** //
- // *********************************************************************************************************** //
- //
- void TFTPanel :: AnalogPanel_v1_Show(int Temperatura, int Wilgotnosc)
- {
- AnalogPanelUp_v1_Show126(Temperatura);
- AnalogPanelDown_v1_Show126(Wilgotnosc);
- }
- //
- // *********************************************************************************************************** //
- // *** A N A L O G P A N E L S H O W V 2 *** //
- // *********************************************************************************************************** //
- //
- void TFTPanel :: AnalogPanel_v2_Show(int Cisnienie, int Zachmurzenie)
- {
- if (Zachmurzenie==100) Zachmurzenie = 90;
- AnalogPanelUp_v1_Show126(Cisnienie);
- AnalogPanelDown_v1_Show126(Zachmurzenie);
- drawBmp("/chmurka.bmp", 183, 203);
- drawBmp("/slonko.bmp", 7, 198);
- drawBmp("/higrometr.bmp", 64, 126);
- drawBmp("/deszcz.bmp", 5, 74);
- drawBmp("/slonko2.bmp", 190, 75);
- }
- //
- // *********************************************************************************************************** //
- // *** D I G I T A L C L O C K V 1 *** //
- // *********************************************************************************************************** //
- //
- void TFTPanel :: DigitalClock_v1_Show(ESP32Time & clock, uint8_t x = 40, uint8_t y = 8)
- {
- // położenie x - wartość domyślna to : 40
- // położenie y - wartość domyślna to : 8
- char showBufor[4]; // buforek typu char
- char tempBufor[4]; // buforek typu char
- static bool FlagaZmiany = false; // flaga do zmiany co 1 sekundę
- // sprawdź warunki czy coś do zrobienia (optymalizacja) ----------------------------------
- if ( AmPm != clock.getAmPm() ) // jeśli zmienił się AM i PM
- { // początek IF
- AmPm = clock.getAmPm(false); // zapisz nowy AM/PM pod zmienną
- } // ten warunek ma być pierwszy !!!
- if ( Godzina != clock.getHour(true) ) // jeśli zmieniła się godzina
- { // początek IF
- Godzina = clock.getHour(true); // zapisz nową godzinę pod zmienną
- if ( Godzina < 10 ) // jeśli minuta mniejsze niz 10
- { // początek IF
- strcpy(showBufor, "0"); // kopiuj do showBufor 0
- sprintf(tempBufor, "%d", Godzina); // konwersja do char
- strcat(showBufor, tempBufor); // doklej do showBufor tempBufor
- } // koniec IF
- else // jeśli minuta większa niz 10
- { // początek IF
- sprintf( tempBufor, "%d", Godzina ); // konwersja do char
- strcpy( showBufor, tempBufor ); // skopiuj do showBufor tempBufor
- } // koniec IF
- tft.setTextColor(TFT_kolor_zegara, TFT_tlo_zegara); // ustaw kolor czcionki / tła
- tft.drawString(showBufor, x, y, 4); // drukuj Godzinę jeśli się zmieniła
- tft.setTextColor(TFT_BLUE2, TFT_tlo_zegara); // ustaw kolor czcionki / tła
- tft.drawString(AmPm, x + 115, y, 4); // wyświetl na TFT
- } // koniec IF
- if ( Minuta != clock.getMinute() ) // jeśli zmieniła się minuta
- { // początek IF
- Minuta = clock.getMinute(); // zapisz nową minutę pod zmienną
- if ( Minuta < 10 ) // jeśli minuta mniejsze niz 10
- { // początek IF
- strcpy(showBufor, "0"); // kopiuj do showBufor 0
- sprintf(tempBufor, "%d", Minuta); // konwersja do char
- strcat(showBufor, tempBufor); // doklej do showBufor tempBufor
- } // koniec IF
- else // jeśli minuta większa niz 10
- { // początek IF
- sprintf( tempBufor, "%d", Minuta ); // konwersja do char
- strcpy( showBufor, tempBufor ); // skopiuj do showBufor tempBufor
- } // koniec IF
- tft.setTextColor(TFT_kolor_zegara, TFT_tlo_zegara); // ustaw kolor czcionki / tła
- tft.drawString(showBufor, x + 40, y, 4); // drukuj Minutę jeśli się zmieniła
- } // koniec IF
- if ( Sekunda != clock.getSecond() ) // jeśli zmieniła się sekunda
- { // początek IF
- Sekunda = clock.getSecond(); // zapisz nową sekundę pod zmienną
- if ( Sekunda < 10 ) // jeśli minuta mniejsze niz 10
- { // początek IF
- strcpy(showBufor, "0"); // kopiuj do showBufor 0
- sprintf(tempBufor, "%d", Sekunda); // konwersja do char
- strcat(showBufor, tempBufor); // doklej do showBufor tempBufor
- } // koniec IF
- else // jeśli minuta większa niz 10
- { // początek IF
- sprintf( tempBufor, "%d", Sekunda ); // konwersja do char
- strcpy( showBufor, tempBufor ); // skopiuj do showBufor tempBufor
- } // koniec IF
- tft.setTextColor(TFT_kolor_zegara, TFT_tlo_zegara); // ustaw kolor czcionki / tła
- tft.drawString(showBufor, x + 80, y, 4); // drukuj Minutę jeśli się zmieniła
- if ( FlagaZmiany ) FlagaZmiany = false; // zmien wartosc flagi co 1 sekunde
- else // lub
- if (!FlagaZmiany ) FlagaZmiany = true; // zmien wartosc flagi co 1 sekunde
- } // koniec IF
- // koniec sprawdzania warunków RTC -------------------------------------------------------
- if( FlagaZmiany )
- {
- tft.setTextColor(TFT_kolor_zegara, TFT_tlo_zegara); // ustaw kolor czcionki / tła
- tft.drawString(":", x + 30, y, 4); // drukuj dwukropek zegara
- tft.setTextColor(TFT_kolor_zegara, TFT_tlo_zegara); // ustaw kolor czcionki / tła
- tft.drawString(".", x + 70, y, 4); // drukuj dwukropek zegara
- }
- else
- {
- tft.setTextColor(TFT_BLUE, TFT_tlo_zegara); // ustaw kolor czcionki / tła
- tft.drawString(":", x + 30, y, 4); // zamaż dwukropke zegara
- tft.setTextColor(TFT_BLUE, TFT_tlo_zegara); // ustaw kolor czcionki / tła
- tft.drawString(".", x + 70, y, 4); // drukuj dwukropek zegara
- }
- }
- //
- // *********************************************************************************************************** //
- // *** D I G I T A L D A T E V 1 *** //
- // *********************************************************************************************************** //
- //
- void TFTPanel :: DigitalDate_v1_Show(ESP32Time & clock, uint8_t x = 120, uint8_t y = 42)
- {
- // położenie x - wartość domyślna to : 120
- // położenie y - wartość domyślna to : 42
- if ( Data != clock.getDate(false) ) // sprawdź czy data się zmieniła (optymalizacja)
- { // początek IF
- Data = clock.getDate(false); // zapisz pod zmienną Data nową datę z RTC
- } // koniec IF
- else
- {
- tft.setTextColor(TFT_kolor_zegara, TFT_tlo_zegara); // ustaw kolor czcionki / tła
- tft.drawCentreString(Data, x, y, 4); // pokaż datę (angielska wersja)
- }
- #if Terminal
- tools.PokazWiadomosc("TFT","DigitalDate_v1 Wyswietlam",Data.c_str());
- #endif
- }
- //
- // *********************************************************************************************************** //
- // *** D I G I T A L T E M P E R A T U R A V 1 *** //
- // *********************************************************************************************************** //
- //
- void TFTPanel :: DigitalTemperature_v1_Show(uint8_t x = 120, uint8_t y = 42)
- {
- String bufor = "Temp.Out " + String(pogoda.PublicPobierzTemperature()) + " C"; // załaduj do bufora
- tft.drawCentreString(bufor, x, y, 4); // wyświetl tekst
- #if Terminal
- tools.PokazWiadomosc("TFT","DigitalTemperature_v1 Wyswietlam",bufor.c_str());
- #endif
- }
- //
- // *********************************************************************************************************** //
- // *** D I G I T A L W I L G O T N O S C V 1 *** //
- // *********************************************************************************************************** //
- //
- void TFTPanel :: DigitalWilgotnosc_v1_Show(uint8_t x = 120, uint8_t y = 42)
- {
- String bufor = "Wilgotnosc " + String(pogoda.PublicPobierzWilgotnosc()) + " %"; // załaduj do bufora
- tft.drawCentreString(bufor, x, y, 4); // wyświetl tekst
- #if Terminal
- tools.PokazWiadomosc("TFT","DigitalWilgotnosc_v1 Wyswietlam",bufor.c_str());
- #endif
- }
- //
- // *********************************************************************************************************** //
- // *** D I G I T A L Z A C H M U R Z E N I E V 1 *** //
- // *********************************************************************************************************** //
- //
- void TFTPanel :: DigitalZachmurzenie_v1_Show(uint8_t x = 120, uint8_t y = 42)
- {
- String bufor = "Zachmurzenie " + String(pogoda.PublicPobierzZachmurzenie()) + " %"; // załaduj do bufora
- tft.drawCentreString(bufor, x, y, 4); // wyświetl tekst
- #if Terminal
- tools.PokazWiadomosc("TFT","DigitalZachmurzenie_v1 Wyswietlam",bufor.c_str());
- #endif
- }
- //
- // *********************************************************************************************************** //
- // *** D I G I T A L P R Ę D K O Ś Ć W I A T R U V 1 *** //
- // *********************************************************************************************************** //
- //
- void TFTPanel :: DigitalPredkoscWiatru_v1_Show(uint8_t x = 120, uint8_t y = 42)
- {
- String bufor = "Wiatr " + String(pogoda.PublicPobierzPredkoscWiatru()) + " km/h"; // załaduj do bufora
- tft.drawCentreString(bufor, x, y, 4); // wyświetl tekst
- #if Terminal
- tools.PokazWiadomosc("TFT","DigitalPredkoscWiatru_v1 Wyswietlam",bufor.c_str());
- #endif
- }
- //
- // *********************************************************************************************************** //
- // *** D I G I T A L C I S N I E N I E V 1 *** //
- // *********************************************************************************************************** //
- //
- void TFTPanel :: DigitalCisnienie_v1_Show(uint8_t x = 120, uint8_t y = 42)
- {
- String bufor = "Cisnienie " + String(pogoda.PublicPobierzCisnienie()) + " mPa"; // załaduj do bufora
- tft.drawCentreString(bufor, x, y, 4); // wyświetl tekst
- #if Terminal
- tools.PokazWiadomosc("TFT","DigitalCisnienie_v1 Wyswietlam",bufor.c_str());
- #endif
- }
- //
- // *********************************************************************************************************** //
- // *** D I G I T A L W S C H O D S L O N C A V 1 *** //
- // *********************************************************************************************************** //
- //
- void TFTPanel :: DigitalWschodSlonca_v1_Show(uint8_t x = 120, uint8_t y = 42)
- {
- String bufor = "Wschod " + String(pogoda.PublicPobierzWschodSlonca()); // załaduj do bufora
- tft.drawCentreString(bufor, x, y, 4); // wyświetl tekst
- #if Terminal
- tools.PokazWiadomosc("TFT","DigitalWschodSlonca_v1 Wyswietlam",bufor.c_str());
- #endif
- }
- //
- // *********************************************************************************************************** //
- // *** D I G I T A L Z A C H O D S L O N C A V 1 *** //
- // *********************************************************************************************************** //
- //
- void TFTPanel :: DigitalZachodSlonca_v1_Show(uint8_t x = 120, uint8_t y = 42)
- {
- String bufor = "Zachod " + String(pogoda.PublicPobierzZachodSlonca()); // załaduj do bufora
- tft.drawCentreString(bufor, x, y, 4); // wyświetl tekst
- #if Terminal
- tools.PokazWiadomosc("TFT","DigitalZachodSlonca_v1 Wyswietlam",bufor.c_str());
- #endif
- }
- //
- // *********************************************************************************************************** //
- // *** D I G I T A L L O K A L I Z A C J E V 1 *** //
- // *********************************************************************************************************** //
- //
- void TFTPanel :: DigitalLokalizacja_v1_Show(uint8_t x = 120, uint8_t y = 42)
- {
- tft.drawCentreString(pogoda.PublicPobierzLokalizacje(), x, y, 4); // wyświetl tekst
- #if Terminal
- tools.PokazWiadomosc("TFT","DigitalZachodSlonca_v1 Wyswietlam",pogoda.PublicPobierzLokalizacje().c_str());
- #endif
- }
- //
- // *********************************************************************************************************** //
- // *** C O D E M S G V 1 *** //
- // *********************************************************************************************************** //
- //
- void TFTPanel :: CodeMsg_v1_Show(uint8_t x = 120, uint8_t y = 42)
- {
- tft.drawCentreString("Code by Transline", x, y, 4); // wyświetl tekst
- #if Terminal
- tools.PokazWiadomosc("TFT","CodeMsg v1 Wyswietlam","Code by Transline");
- #endif
- }
- //
- // *********************************************************************************************************** //
- // *** D I G I T A L M U L T I S W I T C H V 1 *** //
- // *********************************************************************************************************** //
- //
- void TFTPanel :: MultiSwitchPanel_v1(ESP32Time & clock, uint8_t x = 5, uint8_t y = 42)
- {
- static byte przelacznik = 0; // przelacznik dla switch
- #if Terminal
- tools.PokazWiadomosc("TFT","MultiSwitchPanel v1 - Przelacznik",String(przelacznik).c_str());
- #endif
- tft.fillRect(window_min_x+1, window_min_y + 36, window_size_x - 2, 30, TFT_BLACK); // posprzątaj
- tft.setTextColor(TFT_GREEN1, TFT_tlo_zegara); // ustaw kolor czcionki / tła
- switch ( przelacznik ) // przelacznik komunikatow
- { // początek SWITCH
- case 0 : DigitalDate_v1_Show(clock); // wyświetl DATĘ
- przelacznik ++; // dodaj 1 do przelacznik
- break; // przerwij warunek 0
- case 1 : DigitalTemperature_v1_Show(); // wyświetl CZAS
- przelacznik ++; // dodaj 1 do przelacznik
- break; // przerwij warunek 1
- case 2 : DigitalCisnienie_v1_Show(); // wyświetl CIŚNIENIE
- przelacznik ++; // dodaj 1 do przełącznik
- break; // przerwij warunek 2
- case 3 : DigitalWilgotnosc_v1_Show(); // wyświetl WILGOTNOŚĆ
- przelacznik ++; // dodaj 1 do przełącznik
- break; // przerwij warunek 3
- case 4 : DigitalZachmurzenie_v1_Show(); // wyświetl ZACHMURZENIE
- przelacznik ++; // dodaj 1 do przełącznik
- break; // przerwij warunek 4
- case 5 : DigitalPredkoscWiatru_v1_Show(); // wyświetl PREDKOSC WIATRU
- przelacznik ++; // dodaj 1 do przełącznik
- break; // przerwij warunek 5
- case 6 : DigitalWschodSlonca_v1_Show(); // wyświetl WSCHÓD SŁOŃCA
- przelacznik ++; // dodaj 1 do przełącznik
- break; // przerwij warunek 6
- case 7 : DigitalZachodSlonca_v1_Show(); // wyświetl ZACHÓD SŁOŃCA
- przelacznik ++; // dodaj 1 do przełącznik
- break; // przerwij warunek 7
- case 8 : DigitalLokalizacja_v1_Show(); // wyświetl LOKALIZACJE
- przelacznik ++; // dodaj 1 do przełącznik
- break; // przerwij warunek 7
- default : CodeMsg_v1_Show(); // wyświetl MSG
- przelacznik = 0; // dodaj 1 do przelacznik
- break; // przerwij warunek DEFAULT
- } // koniec SWITCH
- } // koniec MultiSwitchPanel_v1
- //
- // *********************************************************************************************************** //
- // *** E N D *** //
- // *********************************************************************************************************** //
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement