GUI optimalisation
This commit is contained in:
@@ -932,6 +932,7 @@ void setup() {
|
|||||||
Wire.endTransmission();
|
Wire.endTransmission();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Stereostatusold = radio.getStereoStatus();
|
||||||
BuildDisplay();
|
BuildDisplay();
|
||||||
SelectBand();
|
SelectBand();
|
||||||
if (tunemode == TUNE_MEM) DoMemoryPosTune();
|
if (tunemode == TUNE_MEM) DoMemoryPosTune();
|
||||||
|
|||||||
+8
-8
@@ -732,7 +732,7 @@ void XDRGTKRoutine() {
|
|||||||
|
|
||||||
case '\0':
|
case '\0':
|
||||||
radio.setMute();
|
radio.setMute();
|
||||||
if (!screenmute && !afscreen) tft.drawBitmap((advancedRDS ? 215 : 253), (advancedRDS ? 47: 142), Speaker, 21, 20, PrimaryColor);
|
if (!screenmute && !afscreen) tft.drawBitmap((advancedRDS ? 215 : 253), (advancedRDS ? 47 : 142), Speaker, 21, 20, PrimaryColor);
|
||||||
if (!screenmute) {
|
if (!screenmute) {
|
||||||
tft.drawRoundRect(10, 30, 300, 170, 5, ActiveColor);
|
tft.drawRoundRect(10, 30, 300, 170, 5, ActiveColor);
|
||||||
tft.fillRoundRect(12, 32, 296, 166, 5, BackgroundColor);
|
tft.fillRoundRect(12, 32, 296, 166, 5, BackgroundColor);
|
||||||
@@ -761,7 +761,7 @@ void XDRGTKRoutine() {
|
|||||||
XDRScan = false;
|
XDRScan = false;
|
||||||
if (VolSet != 0) {
|
if (VolSet != 0) {
|
||||||
radio.setUnMute();
|
radio.setUnMute();
|
||||||
if (!screenmute && !afscreen) tft.drawBitmap((advancedRDS ? 215 : 253), (advancedRDS ? 47: 142), Speaker, 21, 20, GreyoutColor);
|
if (!screenmute && !afscreen) tft.drawBitmap((advancedRDS ? 215 : 253), (advancedRDS ? 47 : 142), Speaker, 21, 20, GreyoutColor);
|
||||||
radio.setVolume(((VolSet * 10) - 40) / 10);
|
radio.setVolume(((VolSet * 10) - 40) / 10);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@@ -799,12 +799,12 @@ void XDRGTKRoutine() {
|
|||||||
VolSet = atoi(buff + 1);
|
VolSet = atoi(buff + 1);
|
||||||
if (VolSet == 0) {
|
if (VolSet == 0) {
|
||||||
radio.setMute();
|
radio.setMute();
|
||||||
if (!screenmute && !afscreen) tft.drawBitmap((advancedRDS ? 215 : 253), (advancedRDS ? 47: 142), Speaker, 21, 20, PrimaryColor);
|
if (!screenmute && !afscreen) tft.drawBitmap((advancedRDS ? 215 : 253), (advancedRDS ? 47 : 142), Speaker, 21, 20, PrimaryColor);
|
||||||
XDRMute = true;
|
XDRMute = true;
|
||||||
SQ = true;
|
SQ = true;
|
||||||
} else {
|
} else {
|
||||||
radio.setUnMute();
|
radio.setUnMute();
|
||||||
if (!screenmute && !afscreen) tft.drawBitmap((advancedRDS ? 215 : 253), (advancedRDS ? 47: 142), Speaker, 21, 20, GreyoutColor);
|
if (!screenmute && !afscreen) tft.drawBitmap((advancedRDS ? 215 : 253), (advancedRDS ? 47 : 142), Speaker, 21, 20, GreyoutColor);
|
||||||
radio.setVolume((VolSet - 40) / 10);
|
radio.setVolume((VolSet - 40) / 10);
|
||||||
XDRMute = false;
|
XDRMute = false;
|
||||||
}
|
}
|
||||||
@@ -831,7 +831,7 @@ void XDRGTKRoutine() {
|
|||||||
store = true;
|
store = true;
|
||||||
XDRMute = false;
|
XDRMute = false;
|
||||||
radio.setUnMute();
|
radio.setUnMute();
|
||||||
if (!screenmute && !afscreen) tft.drawBitmap((advancedRDS ? 215 : 253), (advancedRDS ? 47: 142), Speaker, 21, 20, GreyoutColor);
|
if (!screenmute && !afscreen) tft.drawBitmap((advancedRDS ? 215 : 253), (advancedRDS ? 47 : 142), Speaker, 21, 20, GreyoutColor);
|
||||||
VolSet = EEPROM.readByte(EE_BYTE_VOLSET);
|
VolSet = EEPROM.readByte(EE_BYTE_VOLSET);
|
||||||
LowLevelSet = EEPROM.readByte(EE_BYTE_LOWLEVELSET);
|
LowLevelSet = EEPROM.readByte(EE_BYTE_LOWLEVELSET);
|
||||||
softmuteam = EEPROM.readByte(EE_BYTE_SOFTMUTEAM);
|
softmuteam = EEPROM.readByte(EE_BYTE_SOFTMUTEAM);
|
||||||
@@ -903,9 +903,9 @@ void passwordcrypt() {
|
|||||||
|
|
||||||
void tryWiFi() {
|
void tryWiFi() {
|
||||||
if (!setupmode && wifi) {
|
if (!setupmode && wifi) {
|
||||||
tft.drawRoundRect(1, 60, 319, 140, 5, ActiveColor);
|
tft.drawRoundRect(1, 20, 319, 180, 5, ActiveColor);
|
||||||
tft.fillRoundRect(3, 62, 315, 136, 5, BackgroundColor);
|
tft.fillRoundRect(3, 22, 315, 176, 5, BackgroundColor);
|
||||||
tftPrint(0, myLanguage[language][55], 155, 88, ActiveColor, ActiveColorSmooth, 28);
|
Infoboxprint(myLanguage[language][55]);
|
||||||
}
|
}
|
||||||
if (wifi) {
|
if (wifi) {
|
||||||
if (wc.autoConnect()) {
|
if (wc.autoConnect()) {
|
||||||
|
|||||||
@@ -153,4 +153,5 @@ extern void NTPupdate();
|
|||||||
extern void handleRoot();
|
extern void handleRoot();
|
||||||
extern void handleDownloadCSV();
|
extern void handleDownloadCSV();
|
||||||
extern void handleLogo();
|
extern void handleLogo();
|
||||||
|
extern void Infoboxprint(const char* input);
|
||||||
#endif
|
#endif
|
||||||
+2
-2
@@ -3663,7 +3663,7 @@ static const char* const myLanguage[21][300] PROGMEM = {
|
|||||||
"Викл.", // 30
|
"Викл.", // 30
|
||||||
"У", // 31
|
"У", // 31
|
||||||
"НАТ. MODE ДЛЯ ЗБЕР. Й ВИХ.", // 32
|
"НАТ. MODE ДЛЯ ЗБЕР. Й ВИХ.", // 32
|
||||||
"НАСТИСНІТЬ BAND ДЛЯ ЗАКРИТТЯ", // 33
|
"НАСТИСНІТЬ BAND ДЛЯ ЗАКРИТТЯ", // 33
|
||||||
"СКАНУВАННЯ...", // 34
|
"СКАНУВАННЯ...", // 34
|
||||||
"Тюнер не виявлено", // 35
|
"Тюнер не виявлено", // 35
|
||||||
"Підсилення AM-антени", // 36
|
"Підсилення AM-антени", // 36
|
||||||
@@ -6349,4 +6349,4 @@ static const char* const myLanguage[21][300] PROGMEM = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
+9
-5
@@ -814,7 +814,11 @@ void showCT() {
|
|||||||
rds_clock = String(timeStr);
|
rds_clock = String(timeStr);
|
||||||
|
|
||||||
// Format the date as DD-MM-YY
|
// Format the date as DD-MM-YY
|
||||||
strftime(dateStr, sizeof(dateStr), "%d-%m-%y", localtime(&t));
|
if (clockampm) {
|
||||||
|
strftime(dateStr, sizeof(dateStr), "%m-%d-%y", localtime(&t));
|
||||||
|
} else {
|
||||||
|
strftime(dateStr, sizeof(dateStr), "%d-%m-%y", localtime(&t));
|
||||||
|
}
|
||||||
rds_date = String(dateStr);
|
rds_date = String(dateStr);
|
||||||
|
|
||||||
// Check if the clock or RDS CT status has changed
|
// Check if the clock or RDS CT status has changed
|
||||||
@@ -829,16 +833,16 @@ void showCT() {
|
|||||||
|
|
||||||
// Display the updated time and date
|
// Display the updated time and date
|
||||||
tftReplace(0, rds_clockold, rds_clock, 134, 1, RDSColor, RDSColorSmooth, BackgroundColor, 16);
|
tftReplace(0, rds_clockold, rds_clock, 134, 1, RDSColor, RDSColorSmooth, BackgroundColor, 16);
|
||||||
tftReplace(0, rds_dateold, rds_date, 134, 16, RDSColor, RDSColorSmooth, BackgroundColor, 16);
|
tftReplace(0, rds_dateold, rds_date, 134, 15, RDSColor, RDSColorSmooth, BackgroundColor, 16);
|
||||||
} else { // Handle dropout scenarios
|
} else { // Handle dropout scenarios
|
||||||
if (rtcset) { // Display dropout message if RTC was set
|
if (rtcset) { // Display dropout message if RTC was set
|
||||||
tftReplace(0, rds_clockold, rds_clock, 134, 1, RDSDropoutColor, RDSDropoutColorSmooth, BackgroundColor, 16);
|
tftReplace(0, rds_clockold, rds_clock, 134, 1, RDSDropoutColor, RDSDropoutColorSmooth, BackgroundColor, 16);
|
||||||
tftReplace(0, rds_dateold, rds_date, 134, 16, RDSDropoutColor, RDSDropoutColorSmooth, BackgroundColor, 16);
|
tftReplace(0, rds_dateold, rds_date, 134, 15, RDSDropoutColor, RDSDropoutColorSmooth, BackgroundColor, 16);
|
||||||
} else { // Clear and reprint the clock and date
|
} else { // Clear and reprint the clock and date
|
||||||
tftPrint(0, rds_clockold, 134, 1, BackgroundColor, BackgroundColor, 16);
|
tftPrint(0, rds_clockold, 134, 1, BackgroundColor, BackgroundColor, 16);
|
||||||
tftPrint(0, rds_clock, 134, 1, BackgroundColor, BackgroundColor, 16);
|
tftPrint(0, rds_clock, 134, 1, BackgroundColor, BackgroundColor, 16);
|
||||||
tftPrint(0, rds_dateold, 134, 16, BackgroundColor, BackgroundColor, 16);
|
tftPrint(0, rds_dateold, 134, 15, BackgroundColor, BackgroundColor, 16);
|
||||||
tftPrint(0, rds_date, 134, 16, BackgroundColor, BackgroundColor, 16);
|
tftPrint(0, rds_date, 134, 15, BackgroundColor, BackgroundColor, 16);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user