More GUI adjustments and minor fixes

This commit is contained in:
MCelliotG
2023-08-04 03:26:48 +03:00
committed by GitHub
parent 41e59b746e
commit f3acb150f4
+16 -16
View File
@@ -1019,7 +1019,7 @@ void ShowBandSelectionFM(bool notglanceview, bool normaldisplay) {
bandFMx = 155; bandFMx = 155;
bandFMy = 118; bandFMy = 118;
} else { } else {
bandFMx = 305; bandFMx = 310;
bandFMy = 196; bandFMy = 196;
} }
@@ -1118,7 +1118,7 @@ void ShowBandSelectionAM(bool notglanceview, bool normaldisplay) {
bandAMx = 155; bandAMx = 155;
bandAMy = 118; bandAMy = 118;
} else { } else {
bandAMx = 305; bandAMx = 310;
bandAMy = 216; bandAMy = 216;
} }
@@ -2303,7 +2303,7 @@ void ShowAdvancedRDS() {
String afstring; String afstring;
if (radio.rds.hasAF) for (byte i = 0; i < radio.af_counter; i++) afstring += String(radio.af[i].frequency / 100) + "." + String((radio.af[i].frequency % 100) / 10) + (radio.af[i].filler ? "(f)" : "") + (i == radio.af_counter - 1 ? " " : " | "); else afstring = myLanguage[language][87]; if (radio.rds.hasAF) for (byte i = 0; i < radio.af_counter; i++) afstring += String(radio.af[i].frequency / 100) + "." + String((radio.af[i].frequency % 100) / 10) + (radio.af[i].filler ? "(f)" : "") + (i == radio.af_counter - 1 ? " " : " | "); else afstring = myLanguage[language][87];
if (hasafold != radio.rds.hasAF) { if (hasafold != radio.rds.hasAF) {
if (radio.rds.hasAF) tftPrint(-1, "AF", 50, 51, PrimaryColor, PrimaryColorSmooth, FONT16); else tftPrint(-1, "AF", 50, 51, GreyoutColor, BackgroundColor, FONT16); if (radio.rds.hasAF) tftPrint(-1, "AF", 47, 51, PrimaryColor, PrimaryColorSmooth, FONT16); else tftPrint(-1, "AF", 47, 51, GreyoutColor, BackgroundColor, FONT16);
hasafold = radio.rds.hasAF; hasafold = radio.rds.hasAF;
} }
@@ -2341,7 +2341,7 @@ void ShowAdvancedRDS() {
String eonstring; String eonstring;
if (radio.rds.hasEON) for (byte i = 0; i < radio.eon_counter; i++) eonstring += String(radio.eon[i].picode) + (radio.eon[i].ps.length() > 0 ? String(": " + String(radio.eon[i].ps)) : "") + (radio.eon[i].mappedfreq > 0 ? String(" " + String(radio.eon[i].mappedfreq / 100) + "." + String((radio.eon[i].mappedfreq % 100) / 10)) : "") + (radio.eon[i].mappedfreq2 > 0 ? String(" / " + String(radio.eon[i].mappedfreq2 / 100) + "." + String((radio.eon[i].mappedfreq2 % 100) / 10)) : "") + (radio.eon[i].mappedfreq3 > 0 ? String(" / " + String(radio.eon[i].mappedfreq3 / 100) + "." + String((radio.eon[i].mappedfreq3 % 100) / 10)) : "") + (i == radio.eon_counter - 1 ? " " : " | "); else eonstring = myLanguage[language][88]; if (radio.rds.hasEON) for (byte i = 0; i < radio.eon_counter; i++) eonstring += String(radio.eon[i].picode) + (radio.eon[i].ps.length() > 0 ? String(": " + String(radio.eon[i].ps)) : "") + (radio.eon[i].mappedfreq > 0 ? String(" " + String(radio.eon[i].mappedfreq / 100) + "." + String((radio.eon[i].mappedfreq % 100) / 10)) : "") + (radio.eon[i].mappedfreq2 > 0 ? String(" / " + String(radio.eon[i].mappedfreq2 / 100) + "." + String((radio.eon[i].mappedfreq2 % 100) / 10)) : "") + (radio.eon[i].mappedfreq3 > 0 ? String(" / " + String(radio.eon[i].mappedfreq3 / 100) + "." + String((radio.eon[i].mappedfreq3 % 100) / 10)) : "") + (i == radio.eon_counter - 1 ? " " : " | "); else eonstring = myLanguage[language][88];
if (haseonold != radio.rds.hasEON) { if (haseonold != radio.rds.hasEON) {
if (radio.rds.hasEON) tftPrint(-1, "EON", 153, 51, PrimaryColor, PrimaryColorSmooth, FONT16); else tftPrint(-1, "EON", 153, 51, GreyoutColor, BackgroundColor, FONT16); if (radio.rds.hasEON) tftPrint(-1, "EON", 150, 51, PrimaryColor, PrimaryColorSmooth, FONT16); else tftPrint(-1, "EON", 150, 51, GreyoutColor, BackgroundColor, FONT16);
haseonold = radio.rds.hasEON; haseonold = radio.rds.hasEON;
} }
if (eonstring.length() < 20) { if (eonstring.length() < 20) {
@@ -2378,7 +2378,7 @@ void ShowAdvancedRDS() {
String rtplusstring; String rtplusstring;
if (radio.rds.hasRDSplus) rtplusstring = (radio.rds.rdsplusTag1 != 169 ? String(myLanguage[language][radio.rds.rdsplusTag1]) + ": " + String(radio.rds.RTContent1) : "") + (radio.rds.rdsplusTag2 != 169 ? " - " + String(myLanguage[language][radio.rds.rdsplusTag2]) + ": " + String(radio.rds.RTContent2) : "") + " "; else rtplusstring = myLanguage[language][89]; if (radio.rds.hasRDSplus) rtplusstring = (radio.rds.rdsplusTag1 != 169 ? String(myLanguage[language][radio.rds.rdsplusTag1]) + ": " + String(radio.rds.RTContent1) : "") + (radio.rds.rdsplusTag2 != 169 ? " - " + String(myLanguage[language][radio.rds.rdsplusTag2]) + ": " + String(radio.rds.RTContent2) : "") + " "; else rtplusstring = myLanguage[language][89];
if (hasrtplusold != radio.rds.hasRDSplus) { if (hasrtplusold != radio.rds.hasRDSplus) {
if (radio.rds.hasRDSplus) tftPrint(-1, "RT+", 124, 51, PrimaryColor, PrimaryColorSmooth, FONT16); else tftPrint(-1, "RT+", 124, 51, GreyoutColor, BackgroundColor, FONT16); if (radio.rds.hasRDSplus) tftPrint(-1, "RT+", 122, 51, PrimaryColor, PrimaryColorSmooth, FONT16); else tftPrint(-1, "RT+", 122, 51, GreyoutColor, BackgroundColor, FONT16);
hasrtplusold = radio.rds.hasRDSplus; hasrtplusold = radio.rds.hasRDSplus;
} }
if (rtplusstring.length() < 20) { if (rtplusstring.length() < 20) {
@@ -2413,30 +2413,30 @@ void ShowAdvancedRDS() {
rtplusstringold = rtplusstring; rtplusstringold = rtplusstring;
if (TPold != radio.rds.hasTP) { if (TPold != radio.rds.hasTP) {
if (radio.rds.hasTP == true) tftPrint(-1, "TP", 6, 51, PrimaryColor, PrimaryColorSmooth, FONT16); else tftPrint(-1, "TP", 6, 51, GreyoutColor, BackgroundColor, FONT16); if (radio.rds.hasTP == true) tftPrint(-1, "TP", 3, 51, PrimaryColor, PrimaryColorSmooth, FONT16); else tftPrint(-1, "TP", 3, 51, GreyoutColor, BackgroundColor, FONT16);
TPold = radio.rds.hasTP; TPold = radio.rds.hasTP;
} }
if (TAold != radio.rds.hasTA) { if (TAold != radio.rds.hasTA) {
if (radio.rds.hasTA == true) tftPrint(-1, "TA", 28, 51, PrimaryColor, PrimaryColorSmooth, FONT16); else tftPrint(-1, "TA", 28, 51, GreyoutColor, BackgroundColor, FONT16); if (radio.rds.hasTA == true) tftPrint(-1, "TA", 25, 51, PrimaryColor, PrimaryColorSmooth, FONT16); else tftPrint(-1, "TA", 25, 51, GreyoutColor, BackgroundColor, FONT16);
TAold = radio.rds.hasTA; TAold = radio.rds.hasTA;
} }
if (MSold != radio.rds.MS) { if (MSold != radio.rds.MS) {
switch (radio.rds.MS) { switch (radio.rds.MS) {
case 0: case 0:
tftPrint(-1, "M", 185, 51, GreyoutColor, BackgroundColor, FONT16); tftPrint(-1, "M", 183, 51, GreyoutColor, BackgroundColor, FONT16);
tftPrint(-1, "S", 198, 51, GreyoutColor, BackgroundColor, FONT16); tftPrint(-1, "S", 199, 51, GreyoutColor, BackgroundColor, FONT16);
break; break;
case 1: case 1:
tftPrint(-1, "M", 185, 51, PrimaryColor, PrimaryColorSmooth, FONT16); tftPrint(-1, "M", 183, 51, PrimaryColor, PrimaryColorSmooth, FONT16);
tftPrint(-1, "S", 198, 51, GreyoutColor, BackgroundColor, FONT16); tftPrint(-1, "S", 199, 51, GreyoutColor, BackgroundColor, FONT16);
break; break;
case 2: case 2:
tftPrint(-1, "M", 185, 51, GreyoutColor, BackgroundColor, FONT16); tftPrint(-1, "M", 183, 51, GreyoutColor, BackgroundColor, FONT16);
tftPrint(-1, "S", 198, 51, PrimaryColor, PrimaryColorSmooth, FONT16); tftPrint(-1, "S", 199, 51, PrimaryColor, PrimaryColorSmooth, FONT16);
break; break;
} }
MSold = radio.rds.MS; MSold = radio.rds.MS;
@@ -2446,10 +2446,10 @@ void ShowAdvancedRDS() {
if (rds_clock != rds_clockold) { if (rds_clock != rds_clockold) {
if (radio.rds.hasCT) { if (radio.rds.hasCT) {
tftReplace(1, rds_clockold, rds_clock, 205, 109, PrimaryColor, PrimaryColorSmooth, FONT16); tftReplace(1, rds_clockold, rds_clock, 205, 109, PrimaryColor, PrimaryColorSmooth, FONT16);
tftPrint(-1, "CT", 72, 51, PrimaryColor, PrimaryColorSmooth, FONT16); tftPrint(-1, "CT", 69, 51, PrimaryColor, PrimaryColorSmooth, FONT16);
} else { } else {
tftPrint(1, rds_clock, 205, 109, BackgroundColor, BackgroundColor, FONT16); tftPrint(1, rds_clock, 205, 109, BackgroundColor, BackgroundColor, FONT16);
tftPrint(-1, "CT", 72, 51, GreyoutColor, BackgroundColor, FONT16); tftPrint(-1, "CT", 69, 51, GreyoutColor, BackgroundColor, FONT16);
} }
rds_clockold = rds_clock; rds_clockold = rds_clock;
} }
@@ -2461,7 +2461,7 @@ void ShowAdvancedRDS() {
} }
if (hastmcold != radio.rds.hasTMC) { if (hastmcold != radio.rds.hasTMC) {
if (radio.rds.hasTMC == true) tftPrint(-1, "TMC", 90, 51, PrimaryColor, PrimaryColorSmooth, FONT16); else tftPrint(-1, "TMC", 90, 51, GreyoutColor, BackgroundColor, FONT16); if (radio.rds.hasTMC == true) tftPrint(-1, "TMC", 89, 51, PrimaryColor, PrimaryColorSmooth, FONT16); else tftPrint(-1, "TMC", 89, 51, GreyoutColor, BackgroundColor, FONT16);
hastmcold = radio.rds.hasTMC; hastmcold = radio.rds.hasTMC;
} }
} }