|  |  | @ -1,19 +1,13 @@ | 
			
		
	
		
			
				
					|  |  |  | #ifndef __MONOCHROME_DISPLAY__ | 
			
		
	
		
			
				
					|  |  |  | #define __MONOCHROME_DISPLAY__ | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  | /* esp8266 : SCL = 5, SDA = 4 */ | 
			
		
	
		
			
				
					|  |  |  | /* ewsp32  : SCL = 22, SDA = 21 */ | 
			
		
	
		
			
				
					|  |  |  | #if defined(ENA_NOKIA) || defined(ENA_SSD1306) || defined(ENA_SH1106) | 
			
		
	
		
			
				
					|  |  |  | #include <U8g2lib.h> | 
			
		
	
		
			
				
					|  |  |  | #ifdef ENA_NOKIA | 
			
		
	
		
			
				
					|  |  |  |     #include <U8g2lib.h> | 
			
		
	
		
			
				
					|  |  |  |     #define DISP_PROGMEM U8X8_PROGMEM | 
			
		
	
		
			
				
					|  |  |  | #else // ENA_SSD1306 || ENA_SH1106
 | 
			
		
	
		
			
				
					|  |  |  |     /* esp8266 : SCL = 5, SDA = 4 */ | 
			
		
	
		
			
				
					|  |  |  |     /* ewsp32  : SCL = 22, SDA = 21 */ | 
			
		
	
		
			
				
					|  |  |  |     #include <Wire.h> | 
			
		
	
		
			
				
					|  |  |  |     #ifdef ENA_SSD1306 | 
			
		
	
		
			
				
					|  |  |  |         #include <SSD1306Wire.h> | 
			
		
	
		
			
				
					|  |  |  |     # else //ENA_SH1106
 | 
			
		
	
		
			
				
					|  |  |  |         #include <SH1106Wire.h> | 
			
		
	
		
			
				
					|  |  |  |     #endif | 
			
		
	
		
			
				
					|  |  |  |     #define DISP_PROGMEM PROGMEM | 
			
		
	
		
			
				
					|  |  |  | #endif | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
	
		
			
				
					|  |  | @ -22,6 +16,27 @@ | 
			
		
	
		
			
				
					|  |  |  | #include "../../utils/helper.h" | 
			
		
	
		
			
				
					|  |  |  | #include "../../hm/hmSystem.h" | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  | static uint8_t bmp_logo[] PROGMEM = { | 
			
		
	
		
			
				
					|  |  |  |   B00000000,B00000000, // ................
 | 
			
		
	
		
			
				
					|  |  |  |   B11101100,B00110111, // ..##.######.##..
 | 
			
		
	
		
			
				
					|  |  |  |   B11101100,B00110111, // ..##.######.##..
 | 
			
		
	
		
			
				
					|  |  |  |   B11100000,B00000111, // .....######.....
 | 
			
		
	
		
			
				
					|  |  |  |   B11010000,B00001011, // ....#.####.#....
 | 
			
		
	
		
			
				
					|  |  |  |   B10011000,B00011001, // ...##..##..##...
 | 
			
		
	
		
			
				
					|  |  |  |   B10000000,B00000001, // .......##.......
 | 
			
		
	
		
			
				
					|  |  |  |   B00000000,B00000000, // ................
 | 
			
		
	
		
			
				
					|  |  |  |   B01111000,B00011110, // ...####..####...
 | 
			
		
	
		
			
				
					|  |  |  |   B11111100,B00111111, // ..############..
 | 
			
		
	
		
			
				
					|  |  |  |   B01111100,B00111110, // ..#####..#####..
 | 
			
		
	
		
			
				
					|  |  |  |   B00000000,B00000000, // ................
 | 
			
		
	
		
			
				
					|  |  |  |   B11111100,B00111111, // ..############..
 | 
			
		
	
		
			
				
					|  |  |  |   B11111110,B01111111, // .##############.
 | 
			
		
	
		
			
				
					|  |  |  |   B01111110,B01111110, // .######..######.
 | 
			
		
	
		
			
				
					|  |  |  |   B00000000,B00000000  // ................
 | 
			
		
	
		
			
				
					|  |  |  | }; | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  | static uint8_t bmp_arrow[] DISP_PROGMEM = { | 
			
		
	
		
			
				
					|  |  |  |     B00000000, B00011100, B00011100, B00001110, B00001110, B11111110, B01111111, | 
			
		
	
		
			
				
					|  |  |  |     B01110000, B01110000, B00110000, B00111000, B00011000, B01111111, B00111111, | 
			
		
	
	
		
			
				
					|  |  | @ -33,17 +48,15 @@ static TimeChangeRule CET = {"CET ", Last, Sun, Oct, 3, 60};       // Central Eu | 
			
		
	
		
			
				
					|  |  |  | template<class HMSYSTEM> | 
			
		
	
		
			
				
					|  |  |  | class MonochromeDisplay { | 
			
		
	
		
			
				
					|  |  |  |     public: | 
			
		
	
		
			
				
					|  |  |  |         #if defined(ENA_NOKIA) | 
			
		
	
		
			
				
					|  |  |  |         #ifdef ENA_NOKIA | 
			
		
	
		
			
				
					|  |  |  |         MonochromeDisplay() : mDisplay(U8G2_R0, 5, 4, 16), mCE(CEST, CET) { | 
			
		
	
		
			
				
					|  |  |  |             mNewPayload = false; | 
			
		
	
		
			
				
					|  |  |  |             mExtra      = 0; | 
			
		
	
		
			
				
					|  |  |  |         } | 
			
		
	
		
			
				
					|  |  |  |         #else // ENA_SSD1306 || ENA_SH1106
 | 
			
		
	
		
			
				
					|  |  |  |         MonochromeDisplay() : mDisplay(0x3c, SDA, SCL), mCE(CEST, CET) { | 
			
		
	
		
			
				
					|  |  |  |         MonochromeDisplay() : mDisplay(U8G2_R0, SCL, SDA, U8X8_PIN_NONE), mCE(CEST, CET) { | 
			
		
	
		
			
				
					|  |  |  |             mNewPayload = false; | 
			
		
	
		
			
				
					|  |  |  |             mExtra      = 0; | 
			
		
	
		
			
				
					|  |  |  |             mRx         = 0; | 
			
		
	
		
			
				
					|  |  |  |             mUp         = 1; | 
			
		
	
		
			
				
					|  |  |  |         } | 
			
		
	
		
			
				
					|  |  |  |         #endif | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
	
		
			
				
					|  |  | @ -53,23 +66,8 @@ class MonochromeDisplay { | 
			
		
	
		
			
				
					|  |  |  |             memset( mToday, 0, sizeof(float)*MAX_NUM_INVERTERS ); | 
			
		
	
		
			
				
					|  |  |  |             memset( mTotal, 0, sizeof(float)*MAX_NUM_INVERTERS ); | 
			
		
	
		
			
				
					|  |  |  |             mLastHour = 25; | 
			
		
	
		
			
				
					|  |  |  |             #if defined(ENA_NOKIA) | 
			
		
	
		
			
				
					|  |  |  |                 mDisplay.begin(); | 
			
		
	
		
			
				
					|  |  |  |                 ShowInfoText("booting..."); | 
			
		
	
		
			
				
					|  |  |  |             #else | 
			
		
	
		
			
				
					|  |  |  |                 mDisplay.init(); | 
			
		
	
		
			
				
					|  |  |  |                 mDisplay.flipScreenVertically(); | 
			
		
	
		
			
				
					|  |  |  |                 mDisplay.setContrast(63); | 
			
		
	
		
			
				
					|  |  |  |                 mDisplay.setBrightness(63); | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |                 mDisplay.clear(); | 
			
		
	
		
			
				
					|  |  |  |                 mDisplay.setFont(ArialMT_Plain_24); | 
			
		
	
		
			
				
					|  |  |  |                 mDisplay.setTextAlignment(TEXT_ALIGN_CENTER_BOTH); | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |                 mDisplay.drawString(64,22,"Starting..."); | 
			
		
	
		
			
				
					|  |  |  |                 mDisplay.display(); | 
			
		
	
		
			
				
					|  |  |  |                 mDisplay.setTextAlignment(TEXT_ALIGN_LEFT); | 
			
		
	
		
			
				
					|  |  |  |             #endif | 
			
		
	
		
			
				
					|  |  |  |         } | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |         void loop(void) { | 
			
		
	
	
		
			
				
					|  |  | @ -92,7 +90,6 @@ class MonochromeDisplay { | 
			
		
	
		
			
				
					|  |  |  |         } | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |     private: | 
			
		
	
		
			
				
					|  |  |  |         #if defined(ENA_NOKIA) | 
			
		
	
		
			
				
					|  |  |  |         void ShowInfoText(const char *txt) { | 
			
		
	
		
			
				
					|  |  |  |             /* u8g2_font_open_iconic_embedded_2x_t 'D' + 'G' + 'J' */ | 
			
		
	
		
			
				
					|  |  |  |             mDisplay.clear(); | 
			
		
	
	
		
			
				
					|  |  | @ -116,10 +113,9 @@ class MonochromeDisplay { | 
			
		
	
		
			
				
					|  |  |  |                 mDisplay.sendBuffer(); | 
			
		
	
		
			
				
					|  |  |  |             } while( mDisplay.nextPage() ); | 
			
		
	
		
			
				
					|  |  |  |         } | 
			
		
	
		
			
				
					|  |  |  |         #endif | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |         void DataScreen(void) { | 
			
		
	
		
			
				
					|  |  |  |             String timeStr = ah::getDateTimeStr(mCE.toLocal(*mUtcTs)).substring(2, 22); | 
			
		
	
		
			
				
					|  |  |  |             String timeStr = ah::getDateTimeStr(mCE.toLocal(*mUtcTs)).substring(2, 16); | 
			
		
	
		
			
				
					|  |  |  |             int hr = timeStr.substring(9,2).toInt(); | 
			
		
	
		
			
				
					|  |  |  |             IPAddress ip = WiFi.localIP(); | 
			
		
	
		
			
				
					|  |  |  |             float totalYield = 0.0, totalYieldToday = 0.0, totalActual = 0.0; | 
			
		
	
	
		
			
				
					|  |  | @ -167,21 +163,31 @@ class MonochromeDisplay { | 
			
		
	
		
			
				
					|  |  |  |             } | 
			
		
	
		
			
				
					|  |  |  |             /* u8g2_font_open_iconic_embedded_2x_t 'D' + 'G' + 'J' */ | 
			
		
	
		
			
				
					|  |  |  |             mDisplay.clear(); | 
			
		
	
		
			
				
					|  |  |  |             #if defined(ENA_NOKIA) | 
			
		
	
		
			
				
					|  |  |  |                 mDisplay.firstPage(); | 
			
		
	
		
			
				
					|  |  |  |                 do { | 
			
		
	
		
			
				
					|  |  |  |                     #ifdef ENA_NOKIA | 
			
		
	
		
			
				
					|  |  |  |                         if(ucnt) { | 
			
		
	
		
			
				
					|  |  |  |                             //=====> Actual Production
 | 
			
		
	
		
			
				
					|  |  |  |                             mDisplay.drawXBMP(10,1,8,17,bmp_arrow); | 
			
		
	
		
			
				
					|  |  |  |                             mDisplay.setFont(u8g2_font_logisoso16_tr); | 
			
		
	
		
			
				
					|  |  |  |                             mDisplay.setCursor(25,17); | 
			
		
	
		
			
				
					|  |  |  |                             if (totalActual>999){ | 
			
		
	
		
			
				
					|  |  |  |                                 sprintf(fmtText,"%2.1f",(totalActual/1000)); | 
			
		
	
		
			
				
					|  |  |  |                                 mDisplay.print(String(fmtText)+F(" kW")); | 
			
		
	
		
			
				
					|  |  |  |                             } else { | 
			
		
	
		
			
				
					|  |  |  |                                 sprintf(fmtText,"%3.0f",totalActual); | 
			
		
	
		
			
				
					|  |  |  |                                 mDisplay.print(String(fmtText)+F(" W")); | 
			
		
	
		
			
				
					|  |  |  |                             } | 
			
		
	
		
			
				
					|  |  |  |                             //<=======================
 | 
			
		
	
		
			
				
					|  |  |  |                         } | 
			
		
	
		
			
				
					|  |  |  |                         else | 
			
		
	
		
			
				
					|  |  |  |                         { | 
			
		
	
		
			
				
					|  |  |  |                             //=====> Offline
 | 
			
		
	
		
			
				
					|  |  |  |                             mDisplay.setFont(u8g2_font_logisoso16_tr  ); | 
			
		
	
		
			
				
					|  |  |  |                             mDisplay.setCursor(10,17); | 
			
		
	
		
			
				
					|  |  |  |                             mDisplay.print(String(F("offline"))); | 
			
		
	
		
			
				
					|  |  |  |                             //<=======================
 | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |                         } | 
			
		
	
		
			
				
					|  |  |  |                         mDisplay.drawHLine(2,20,78); | 
			
		
	
		
			
				
					|  |  |  |                         mDisplay.setFont(u8g2_font_5x8_tr); | 
			
		
	
	
		
			
				
					|  |  | @ -212,94 +218,90 @@ class MonochromeDisplay { | 
			
		
	
		
			
				
					|  |  |  |                             mDisplay.print(ip.toString()); | 
			
		
	
		
			
				
					|  |  |  |                         } | 
			
		
	
		
			
				
					|  |  |  |                         else { | 
			
		
	
		
			
				
					|  |  |  |                         mDisplay.setCursor(0,47); | 
			
		
	
		
			
				
					|  |  |  |                             mDisplay.setCursor(5,47); | 
			
		
	
		
			
				
					|  |  |  |                             mDisplay.print(timeStr); | 
			
		
	
		
			
				
					|  |  |  |                         } | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |                     mDisplay.sendBuffer(); | 
			
		
	
		
			
				
					|  |  |  |                 } while( mDisplay.nextPage() ); | 
			
		
	
		
			
				
					|  |  |  |                 mExtra++; | 
			
		
	
		
			
				
					|  |  |  |         #else // ENA_SSD1306 || ENA_SH1106
 | 
			
		
	
		
			
				
					|  |  |  |             if(mUp) { | 
			
		
	
		
			
				
					|  |  |  |                 mRx += 2; | 
			
		
	
		
			
				
					|  |  |  |                 if(mRx >= 20) | 
			
		
	
		
			
				
					|  |  |  |                 mUp = 0; | 
			
		
	
		
			
				
					|  |  |  |             } else { | 
			
		
	
		
			
				
					|  |  |  |                 mRx -= 2; | 
			
		
	
		
			
				
					|  |  |  |                 if(mRx <= 0) | 
			
		
	
		
			
				
					|  |  |  |                 mUp = 1; | 
			
		
	
		
			
				
					|  |  |  |             } | 
			
		
	
		
			
				
					|  |  |  |                     #else // ENA_SSD1306
 | 
			
		
	
		
			
				
					|  |  |  |                     mDisplay.setContrast(60); | 
			
		
	
		
			
				
					|  |  |  |                     // pxZittern in +x (0 - 8 px)
 | 
			
		
	
		
			
				
					|  |  |  |                     int ex = 2*( mExtra % 5 ); | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |                         mDisplay.drawXBM(100+ex,2,16,16,bmp_logo); | 
			
		
	
		
			
				
					|  |  |  |                         mDisplay.setFont(u8g2_font_ncenB08_tr); | 
			
		
	
		
			
				
					|  |  |  |                         if(ucnt) { | 
			
		
	
		
			
				
					|  |  |  |                 mDisplay.setBrightness(63); | 
			
		
	
		
			
				
					|  |  |  |                 mDisplay.drawXbm(10+ex,5,8,17,bmp_arrow); | 
			
		
	
		
			
				
					|  |  |  |                 mDisplay.setFont(ArialMT_Plain_24); | 
			
		
	
		
			
				
					|  |  |  |                             //=====> Actual Production
 | 
			
		
	
		
			
				
					|  |  |  |                             mDisplay.setPowerSave(false); | 
			
		
	
		
			
				
					|  |  |  |                             displaySleep=false; | 
			
		
	
		
			
				
					|  |  |  |                             mDisplay.setFont(u8g2_font_logisoso18_tr); | 
			
		
	
		
			
				
					|  |  |  |                             mDisplay.drawXBM(10+ex,2,8,17,bmp_arrow); | 
			
		
	
		
			
				
					|  |  |  |                             mDisplay.setCursor(25+ex,20); | 
			
		
	
		
			
				
					|  |  |  |                             if (totalActual>999){ | 
			
		
	
		
			
				
					|  |  |  |                                 sprintf(fmtText,"%2.1f",(totalActual/1000)); | 
			
		
	
		
			
				
					|  |  |  |                                 mDisplay.print(String(fmtText)+F(" kW")); | 
			
		
	
		
			
				
					|  |  |  |                             } else { | 
			
		
	
		
			
				
					|  |  |  |                                 sprintf(fmtText,"%3.0f",totalActual); | 
			
		
	
		
			
				
					|  |  |  |                 mDisplay.drawString(25+ex,0,String(fmtText)+F(" W")); | 
			
		
	
		
			
				
					|  |  |  |                                 mDisplay.print(String(fmtText)+F(" W")); | 
			
		
	
		
			
				
					|  |  |  |                             } | 
			
		
	
		
			
				
					|  |  |  |                             //<=======================
 | 
			
		
	
		
			
				
					|  |  |  |                         } | 
			
		
	
		
			
				
					|  |  |  |                         else | 
			
		
	
		
			
				
					|  |  |  |                         { | 
			
		
	
		
			
				
					|  |  |  |                 mDisplay.setBrightness(1); | 
			
		
	
		
			
				
					|  |  |  |                 mDisplay.setFont(ArialMT_Plain_24); | 
			
		
	
		
			
				
					|  |  |  |                 mDisplay.drawString(25+ex,0,String(F("offline"))); | 
			
		
	
		
			
				
					|  |  |  |                             //=====> Offline
 | 
			
		
	
		
			
				
					|  |  |  |                             if(!displaySleep) { | 
			
		
	
		
			
				
					|  |  |  |                                 displaySleepTimer = millis(); | 
			
		
	
		
			
				
					|  |  |  |                                 displaySleep=true; | 
			
		
	
		
			
				
					|  |  |  |                             } | 
			
		
	
		
			
				
					|  |  |  |             mDisplay.setFont(ArialMT_Plain_16); | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |                             mDisplay.setFont(u8g2_font_logisoso18_tr); | 
			
		
	
		
			
				
					|  |  |  |                             mDisplay.setCursor(10+ex,20); | 
			
		
	
		
			
				
					|  |  |  |                             mDisplay.print(String(F("offline"))); | 
			
		
	
		
			
				
					|  |  |  |                             if ((millis() - displaySleepTimer) > displaySleepDelay) { | 
			
		
	
		
			
				
					|  |  |  |                                 mDisplay.setPowerSave(true); | 
			
		
	
		
			
				
					|  |  |  |                             } | 
			
		
	
		
			
				
					|  |  |  |                             //<=======================
 | 
			
		
	
		
			
				
					|  |  |  |                         } | 
			
		
	
		
			
				
					|  |  |  |                         mDisplay.drawLine(2+ex, 23, 123, 23); | 
			
		
	
		
			
				
					|  |  |  |                         mDisplay.setFont(u8g2_font_ncenB10_tr); | 
			
		
	
		
			
				
					|  |  |  |                         mDisplay.setCursor(2+ex,36); | 
			
		
	
		
			
				
					|  |  |  |                         if (( num_inv < 2 ) || !(mExtra%2)) | 
			
		
	
		
			
				
					|  |  |  |                         { | 
			
		
	
		
			
				
					|  |  |  |                 sprintf(fmtText,"%4.0f",totalYieldToday); | 
			
		
	
		
			
				
					|  |  |  |                 mDisplay.drawString(5,22,F("today ")+String(fmtText)+F(" Wh")); | 
			
		
	
		
			
				
					|  |  |  |                             //=====> Today & Total Production
 | 
			
		
	
		
			
				
					|  |  |  |                             sprintf(fmtText,"%5.0f",totalYieldToday); | 
			
		
	
		
			
				
					|  |  |  |                             mDisplay.print(F("today: ")+String(fmtText)+F(" Wh")); | 
			
		
	
		
			
				
					|  |  |  |                             mDisplay.setCursor(2+ex,50); | 
			
		
	
		
			
				
					|  |  |  |                             sprintf(fmtText,"%.1f",totalYield); | 
			
		
	
		
			
				
					|  |  |  |                 mDisplay.drawString(5,35,F("total  ")+String(fmtText)+F(" kWh")); | 
			
		
	
		
			
				
					|  |  |  |             } | 
			
		
	
		
			
				
					|  |  |  |             else | 
			
		
	
		
			
				
					|  |  |  |             { | 
			
		
	
		
			
				
					|  |  |  |                             mDisplay.print(F("total: ")+String(fmtText)+F(" kWh")); | 
			
		
	
		
			
				
					|  |  |  |                             //<=======================
 | 
			
		
	
		
			
				
					|  |  |  |                         } else { | 
			
		
	
		
			
				
					|  |  |  |                             int id1=(mExtra/2)%(num_inv-1); | 
			
		
	
		
			
				
					|  |  |  |                             if( pow_i[id1] ) | 
			
		
	
		
			
				
					|  |  |  |                     mDisplay.drawString(15,22,F("#")+String(id1+1)+F("  ")+String(pow_i[id1])+F(" W")); | 
			
		
	
		
			
				
					|  |  |  |                                 mDisplay.print(F("#")+String(id1+1)+F("  ")+String(pow_i[id1])+F(" W")); | 
			
		
	
		
			
				
					|  |  |  |                             else | 
			
		
	
		
			
				
					|  |  |  |                     mDisplay.drawString(15,22,F("#")+String(id1+1)+F("  -----")); | 
			
		
	
		
			
				
					|  |  |  |                                 mDisplay.print(F("#")+String(id1+1)+F("  -----")); | 
			
		
	
		
			
				
					|  |  |  |                             mDisplay.setCursor(5+ex,50); | 
			
		
	
		
			
				
					|  |  |  |                             if( pow_i[id1+1] ) | 
			
		
	
		
			
				
					|  |  |  |                     mDisplay.drawString(15,35,F("#")+String(id1+2)+F("  ")+String(pow_i[id1+1])+F(" W")); | 
			
		
	
		
			
				
					|  |  |  |                 else | 
			
		
	
		
			
				
					|  |  |  |                     mDisplay.drawString(15,35,F("#")+String(id1+2)+F("  -----")); | 
			
		
	
		
			
				
					|  |  |  |             } | 
			
		
	
		
			
				
					|  |  |  |             mDisplay.drawLine(2,23,123,23); | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |             if ( (!(mExtra%10) && ip )|| (timeStr.length()<16)) | 
			
		
	
		
			
				
					|  |  |  |             { | 
			
		
	
		
			
				
					|  |  |  |                 mDisplay.drawString(5,49,ip.toString()); | 
			
		
	
		
			
				
					|  |  |  |             } | 
			
		
	
		
			
				
					|  |  |  |                                 mDisplay.print(F("#")+String(id1+2)+F("  ")+String(pow_i[id1+1])+F(" W")); | 
			
		
	
		
			
				
					|  |  |  |                             else | 
			
		
	
		
			
				
					|  |  |  |             { | 
			
		
	
		
			
				
					|  |  |  |                 int w=mDisplay.getStringWidth(timeStr.c_str(),timeStr.length(),0); | 
			
		
	
		
			
				
					|  |  |  |                 if ( w>127 ) | 
			
		
	
		
			
				
					|  |  |  |                 { | 
			
		
	
		
			
				
					|  |  |  |                     String tt=timeStr.substring(9,17); | 
			
		
	
		
			
				
					|  |  |  |                     w=mDisplay.getStringWidth(tt.c_str(),tt.length(),0); | 
			
		
	
		
			
				
					|  |  |  |                     mDisplay.drawString(127-w-mRx,49,tt); | 
			
		
	
		
			
				
					|  |  |  |                                 mDisplay.print(F("#")+String(id1+2)+F("  -----")); | 
			
		
	
		
			
				
					|  |  |  |                         } | 
			
		
	
		
			
				
					|  |  |  |                         mDisplay.setFont(u8g2_font_5x8_tr); | 
			
		
	
		
			
				
					|  |  |  |                         mDisplay.setCursor(5+ex,63); | 
			
		
	
		
			
				
					|  |  |  |                         if ( !(mExtra%10) && ip ) | 
			
		
	
		
			
				
					|  |  |  |                             mDisplay.print(ip.toString()); | 
			
		
	
		
			
				
					|  |  |  |                         else | 
			
		
	
		
			
				
					|  |  |  |                     mDisplay.drawString(0,49,timeStr); | 
			
		
	
		
			
				
					|  |  |  |             } | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |             mDisplay.display(); | 
			
		
	
		
			
				
					|  |  |  |             mExtra++; | 
			
		
	
		
			
				
					|  |  |  |                             mDisplay.print(timeStr); | 
			
		
	
		
			
				
					|  |  |  |                     #endif | 
			
		
	
		
			
				
					|  |  |  |                     mDisplay.sendBuffer(); | 
			
		
	
		
			
				
					|  |  |  |                 } while( mDisplay.nextPage() ); | 
			
		
	
		
			
				
					|  |  |  |                 delay(200); | 
			
		
	
		
			
				
					|  |  |  |                 mExtra++; | 
			
		
	
		
			
				
					|  |  |  |         } | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |         // private member variables
 | 
			
		
	
		
			
				
					|  |  |  |         #if defined(ENA_NOKIA) | 
			
		
	
		
			
				
					|  |  |  |         #ifdef ENA_NOKIA | 
			
		
	
		
			
				
					|  |  |  |             U8G2_PCD8544_84X48_1_4W_HW_SPI mDisplay; | 
			
		
	
		
			
				
					|  |  |  |         #else // ENA_SSD1306
 | 
			
		
	
		
			
				
					|  |  |  |             #ifdef ENA_SSD1306 | 
			
		
	
		
			
				
					|  |  |  |                 SSD1306Wire mDisplay; | 
			
		
	
		
			
				
					|  |  |  |             # else //ENA_SH1106
 | 
			
		
	
		
			
				
					|  |  |  |                 SH1106Wire mDisplay; | 
			
		
	
		
			
				
					|  |  |  |             #endif | 
			
		
	
		
			
				
					|  |  |  |             int mRx; | 
			
		
	
		
			
				
					|  |  |  |             char mUp; | 
			
		
	
		
			
				
					|  |  |  |         #elif defined(ENA_SSD1306) | 
			
		
	
		
			
				
					|  |  |  |             U8G2_SSD1306_128X64_NONAME_F_HW_I2C mDisplay; | 
			
		
	
		
			
				
					|  |  |  |         #elif defined(ENA_SH1106) | 
			
		
	
		
			
				
					|  |  |  |             U8G2_SH1106_128X64_NONAME_F_HW_I2C mDisplay; | 
			
		
	
		
			
				
					|  |  |  |         #endif | 
			
		
	
		
			
				
					|  |  |  |         int mExtra; | 
			
		
	
		
			
				
					|  |  |  |         bool mNewPayload; | 
			
		
	
	
		
			
				
					|  |  | @ -309,6 +311,9 @@ class MonochromeDisplay { | 
			
		
	
		
			
				
					|  |  |  |         int mLastHour; | 
			
		
	
		
			
				
					|  |  |  |         HMSYSTEM *mSys; | 
			
		
	
		
			
				
					|  |  |  |         Timezone mCE; | 
			
		
	
		
			
				
					|  |  |  |         bool displaySleep; | 
			
		
	
		
			
				
					|  |  |  |         uint32_t displaySleepTimer; | 
			
		
	
		
			
				
					|  |  |  |         const uint32_t displaySleepDelay= 60000; | 
			
		
	
		
			
				
					|  |  |  | }; | 
			
		
	
		
			
				
					|  |  |  | #endif | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
	
		
			
				
					|  |  | 
 |