You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

106 lines
3.3 KiB

void GxepdPage3()
{
int Dn=dow;
if(Dn==0){Dn=7;}//день недели определяем и переводим в интервал 1-7
display.setRotation(4);
display.fillScreen(GxEPD_WHITE);
display.setTextColor(GxEPD_BLACK);
display.setFont();
// DisplayWeatherIcon(64, 100); // Display weather icon scale = Large;
DrawBattery( 0, 21);
//DrawRSSI(105, 21, wifi_signal);
display.setTextColor(GxEPD_RED);
clok(70, 19);
display.setTextColor(GxEPD_BLACK);
display.drawLine(10,25, 128, 25, GxEPD_BLACK);//x1 y1 x2 y2
display.drawLine(127, 25, 127, 295, GxEPD_BLACK);//x1 y1 x2 y2
//display.drawLine(0, 40, 120, 40, GxEPD_BLACK);//x1 y1 x2 y2
//display.drawLine(0, 70, 120, 70, GxEPD_BLACK);//x1 y1 x2 y2
for (int i=0;i<6;i++)
{DisplayForecastWeather6(0, 55, i,Dn);//x,y,index ,день недели
Dn++;
if(Dn>7)Dn=1;
}
//display.drawLine(0, 230, 120, 230, GxEPD_BLACK);//x1 y1 x2 y2
//display.drawLine(64, 170, 64, 230, GxEPD_BLACK);//x1 y1 x2 y2
display.update();
// Serial.println("GxepdPage3");
// опрос кнопок 10с перед сном
for (int i = 0; i < 200; i++) {
// покинуть цикл при достижении 100
delay (100);
if ((i == 70)||(i == 80)||(i == 90)) testSpeaker2();
if (i == 100) break;
bool gpio_get_level_38 = digitalRead(38);
if (gpio_get_level_38 == 1)
{testSpeaker();
// Serial.println("GxepdPage4");
GxepdPage4();
}
bool gpio_get_level_37 = digitalRead(37);
if (gpio_get_level_37 == 1)
{testSpeaker();
// kalen=1;
//Kalendar();
GxepdPage2();
break;
}
bool gpio_get_level_39 = digitalRead(39);
if (gpio_get_level_39 == 1)
{testSpeaker();
GxepdPage2();
break;
}
}
//Serial.println("END");
}
//***************************************************************************************************
void DisplayForecastWeather6(int x, int y, int index,int Dn) {
int fwidth = 45;//высота
const char* wek[] = { "П","В","С","Ч","П","С","В","н","т","р","т","т","б","с"};
y = y + fwidth * index;
x=x+10;
//**************День недели*************************
if(Dn<6)
{display.fillRect(0, y-29 , 10,y+9,GxEPD_BLACK);
}
else
{
display.fillRect(0, y-29 , 10,y+9,GxEPD_RED);
}
display.setFont();
display.setTextColor(GxEPD_WHITE);
display.setCursor(2,y-20+3);
display.print(utf8rus(wek[Dn-1]));
display.setCursor(2,y-10+3);
display.print(utf8rus(wek[Dn-1+7]));
//*********************
DisplayConditionsSection(x+30-3 , y-6 , WxForecast[index].Icon, SmallIcon);
display.setTextColor(GxEPD_RED);
display.setFont();
display.setTextSize(2);
static char outstr[15];
display.setCursor(62,y-24);
dtostrf(WxForecast[index].day,5, 1, outstr);
display.print(outstr);
display.setTextColor(GxEPD_BLACK);
display.setCursor(62,y-4);
dtostrf(WxForecast[index].night,5, 1, outstr);
display.print(outstr);
display.setTextSize(1);
display.drawLine(0, y+15, 128, y+15, GxEPD_WHITE);//x1 y1 x2 y2
display.drawLine(10, y+15, 128, y+15, GxEPD_BLACK);//x1 y1 x2 y2
// drawString(x + fwidth / 2, y + 30, String(ConvertUnixTime(WxForecast[index].Dt + WxConditions[0].Timezone).substring(0, 5)), CENTER);
// drawString(x + fwidth / 2, y + 125, String(WxForecast[index].High, 0) + "°/" + String(WxForecast[index].Low, 0) + "°", CENTER);
}