Added PTY to EON screen

This commit is contained in:
Sjef Verhoeven PE5PVB
2023-11-15 19:55:44 +01:00
parent 1aba3908d4
commit 52bb1b8366
5 changed files with 39 additions and 28 deletions

View File

@@ -140,6 +140,7 @@ byte ContrastSet;
byte CurrentTheme;
byte displayflip;
byte ECCold;
byte eonptyold[20];
byte EQset;
byte fmdefaultstepsize;
byte fmnb;

View File

@@ -1426,6 +1426,7 @@ void TEF6686::readRDS(byte showrdserrors)
if (offset == 13 && eon[position].pi == rds.rdsD) {
eon[position].taset = true;
eon[position].ta = bitRead(rds.rdsC, 0);
eon[position].pty = (rds.rdsC >> 11) & 0xF;
}
if (bitRead(rds.rdsB, 4) && eon[position].pi == rds.rdsD) eon[position].tp = true;
@@ -1460,7 +1461,7 @@ void TEF6686::readRDS(byte showrdserrors)
eon[j].picode[sizeof(eon[j].picode) - 1] = '\0';
strncpy(eon[j + 1].picode, temp6, sizeof(eon[j + 1].picode) - 1);
eon[j + 1].picode[sizeof(eon[j + 1].picode) - 1] = '\0';
std::swap(eon[j].pty, eon[j + 1].pty);
std::swap(eon[j].ps, eon[j + 1].ps);
std::swap(eon[j].ta, eon[j + 1].ta);
std::swap(eon[j].tp, eon[j + 1].tp);
@@ -1535,6 +1536,7 @@ void TEF6686::clearRDS (bool fullsearchrds) {
}
for (i = 0; i < 20; i++) {
eon[i].pty = 254;
eon[i].pi = 0;
eon[i].ps = "";
eon[i].mappedfreq = 0;
@@ -1832,4 +1834,4 @@ void TEF6686::RDScharConverter(const char* input, wchar_t* output, size_t size,
}
}
output[size - 1] = L'\0';
}
}

View File

@@ -635,6 +635,7 @@ typedef struct _eon_ {
bool ta;
bool tp;
bool taset;
uint8_t pty;
} eon_;
typedef struct _logbook_ {

View File

@@ -520,11 +520,11 @@ void showRadioText() {
AdvRadiotextSprite.drawString(radio.rds.stationText + " " + radio.rds.stationText32, xPos, 2);
AdvRadiotextSprite.pushSprite(35, 220);
} else if (!advancedRDS && radio.rds.stationText.length() < 29) {
xPos = 0;
RadiotextSprite.fillSprite(BackgroundColor);
if (RDSstatus) RadiotextSprite.setTextColor(PrimaryColor, PrimaryColorSmooth, false); else RadiotextSprite.setTextColor(SecondaryColor, SecondaryColorSmooth, false);
RadiotextSprite.drawString(radio.rds.stationText + " " + radio.rds.stationText32, xPos, 2);
RadiotextSprite.pushSprite(38, 220);
xPos = 0;
RadiotextSprite.fillSprite(BackgroundColor);
if (RDSstatus) RadiotextSprite.setTextColor(PrimaryColor, PrimaryColorSmooth, false); else RadiotextSprite.setTextColor(SecondaryColor, SecondaryColorSmooth, false);
RadiotextSprite.drawString(radio.rds.stationText + " " + radio.rds.stationText32, xPos, 2);
RadiotextSprite.pushSprite(38, 220);
} else {
if (millis() - rtticker >= 15) {
if (xPos == 0) {
@@ -633,9 +633,10 @@ void ShowAFEON() {
if (radio.rds.hasEON && afpagenr > 1) {
if (!haseonold) {
tftPrint(-1, myLanguage[language][88], 6, 48, BackgroundColor, BackgroundColor, 16);
tftPrint(-1, "PI:", 4, 32, ActiveColor, ActiveColorSmooth, 16);
tftPrint(0, "TA:", 276, 32, ActiveColor, ActiveColorSmooth, 16);
tftPrint(0, "TP:", 302, 32, ActiveColor, ActiveColorSmooth, 16);
tftPrint(-1, "PI", 4, 32, ActiveColor, ActiveColorSmooth, 16);
tftPrint(0, "TA", 250, 32, ActiveColor, ActiveColorSmooth, 16);
tftPrint(0, "TP", 276, 32, ActiveColor, ActiveColorSmooth, 16);
tftPrint(0, "PTY", 304, 32, ActiveColor, ActiveColorSmooth, 16);
haseonold = true;
}
@@ -649,54 +650,59 @@ void ShowAFEON() {
strcpy(eonpicodeold[i + y], radio.eon[i + y].picode);
if (radio.eon[i + y].ps.length() > 0) {
tftPrint(-1, "PS:", 66, 32, ActiveColor, ActiveColorSmooth, 16);
tftPrint(-1, "PS", 46, 32, ActiveColor, ActiveColorSmooth, 16);
if (strcmp(radio.eon[i + y].ps.c_str(), eonpsold[i + y].c_str()) != 0) tftPrint(-1, String(eonpsold[i + y]), 66, 48 + (15 * i), BackgroundColor, BackgroundColor, 16);
tftPrint(-1, String(radio.eon[i + y].ps), 66, 48 + (15 * i), SecondaryColor, SecondaryColorSmooth, 16);
if (strcmp(radio.eon[i + y].ps.c_str(), eonpsold[i + y].c_str()) != 0) tftPrint(-1, String(eonpsold[i + y]), 46, 48 + (15 * i), BackgroundColor, BackgroundColor, 16);
tftPrint(-1, String(radio.eon[i + y].ps), 46, 48 + (15 * i), SecondaryColor, SecondaryColorSmooth, 16);
eonpsold[i + y] = radio.eon[i + y].ps;
} else {
tftPrint(-1, String(eonpsold[i + y]), 66, 48 + (15 * i), BackgroundColor, BackgroundColor, 16);
tftPrint(-1, String(eonpsold[i + y]), 46, 48 + (15 * i), BackgroundColor, BackgroundColor, 16);
}
if (radio.eon[i + y].mappedfreq > 0) {
tftPrint(1, "FREQ:", 176, 32, ActiveColor, ActiveColorSmooth, 16);
tftPrint(1, "FREQ", 156, 32, ActiveColor, ActiveColorSmooth, 16);
if (radio.eon[i + y].mappedfreq != mappedfreqold[i + y]) tftPrint(1, String(mappedfreqold[i + y] / 100) + "." + String((mappedfreqold[i + y] % 100) / 10), 176, 48 + (15 * i), BackgroundColor, BackgroundColor, 16);
tftPrint(1, String(radio.eon[i + y].mappedfreq / 100) + "." + String((radio.eon[i + y].mappedfreq % 100) / 10), 176, 48 + (15 * i), PrimaryColor, PrimaryColorSmooth, 16);
if (radio.eon[i + y].mappedfreq != mappedfreqold[i + y]) tftPrint(1, String(mappedfreqold[i + y] / 100) + "." + String((mappedfreqold[i + y] % 100) / 10), 156, 48 + (15 * i), BackgroundColor, BackgroundColor, 16);
tftPrint(1, String(radio.eon[i + y].mappedfreq / 100) + "." + String((radio.eon[i + y].mappedfreq % 100) / 10), 156, 48 + (15 * i), PrimaryColor, PrimaryColorSmooth, 16);
mappedfreqold[i + y] = radio.eon[i + y].mappedfreq;
} else {
tftPrint(1, String(mappedfreqold[i + y] / 100) + "." + String((mappedfreqold[i + y] % 100) / 10), 176, 48 + (15 * i), BackgroundColor, BackgroundColor, 16);
tftPrint(1, String(mappedfreqold[i + y] / 100) + "." + String((mappedfreqold[i + y] % 100) / 10), 156, 48 + (15 * i), BackgroundColor, BackgroundColor, 16);
}
if (radio.eon[i + y].mappedfreq2 > 0) {
if (radio.eon[i + y].mappedfreq2 != mappedfreqold2[i + y]) tftPrint(1, String(mappedfreqold2[i + y] / 100) + "." + String((mappedfreqold2[i + y] % 100) / 10), 216, 48 + (15 * i), BackgroundColor, BackgroundColor, 16);
tftPrint(1, String(radio.eon[i + y].mappedfreq2 / 100) + "." + String((radio.eon[i + y].mappedfreq2 % 100) / 10), 216, 48 + (15 * i), PrimaryColor, PrimaryColorSmooth, 16);
if (radio.eon[i + y].mappedfreq2 != mappedfreqold2[i + y]) tftPrint(1, String(mappedfreqold2[i + y] / 100) + "." + String((mappedfreqold2[i + y] % 100) / 10), 196, 48 + (15 * i), BackgroundColor, BackgroundColor, 16);
tftPrint(1, String(radio.eon[i + y].mappedfreq2 / 100) + "." + String((radio.eon[i + y].mappedfreq2 % 100) / 10), 196, 48 + (15 * i), PrimaryColor, PrimaryColorSmooth, 16);
mappedfreqold2[i + y] = radio.eon[i + y].mappedfreq2;
} else {
tftPrint(1, String(mappedfreqold2[i + y] / 100) + "." + String((mappedfreqold2[i + y] % 100) / 10), 216, 48 + (15 * i), BackgroundColor, BackgroundColor, 16);
tftPrint(1, String(mappedfreqold2[i + y] / 100) + "." + String((mappedfreqold2[i + y] % 100) / 10), 196, 48 + (15 * i), BackgroundColor, BackgroundColor, 16);
}
if (radio.eon[i + y].mappedfreq3 > 0) {
if (radio.eon[i + y].mappedfreq3 != mappedfreqold3[i + y]) tftPrint(1, String(mappedfreqold3[i + y] / 100) + "." + String((mappedfreqold3[i + y] % 100) / 10), 256, 48 + (15 * i), BackgroundColor, BackgroundColor, 16);
tftPrint(1, String(radio.eon[i + y].mappedfreq3 / 100) + "." + String((radio.eon[i + y].mappedfreq3 % 100) / 10), 256, 48 + (15 * i), PrimaryColor, PrimaryColorSmooth, 16);
if (radio.eon[i + y].mappedfreq3 != mappedfreqold3[i + y]) tftPrint(1, String(mappedfreqold3[i + y] / 100) + "." + String((mappedfreqold3[i + y] % 100) / 10), 236, 48 + (15 * i), BackgroundColor, BackgroundColor, 16);
tftPrint(1, String(radio.eon[i + y].mappedfreq3 / 100) + "." + String((radio.eon[i + y].mappedfreq3 % 100) / 10), 236, 48 + (15 * i), PrimaryColor, PrimaryColorSmooth, 16);
mappedfreqold3[i + y] = radio.eon[i + y].mappedfreq3;
} else {
tftPrint(1, String(mappedfreqold3[i + y] / 100) + "." + String((mappedfreqold3[i + y] % 100) / 10), 256, 48 + (15 * i), BackgroundColor, BackgroundColor, 16);
tftPrint(1, String(mappedfreqold3[i + y] / 100) + "." + String((mappedfreqold3[i + y] % 100) / 10), 236, 48 + (15 * i), BackgroundColor, BackgroundColor, 16);
}
if (radio.eon[i + y].taset) {
if (radio.eon[i + y].ta) {
tft.fillCircle(276, 54 + (15 * i), 4, InsignificantColor);
tft.fillCircle(250, 54 + (15 * i), 4, InsignificantColor);
} else {
tft.fillCircle(276, 54 + (15 * i), 4, BackgroundColor);
tft.fillCircle(250, 54 + (15 * i), 4, BackgroundColor);
}
} else {
tft.fillCircle(276, 54 + (15 * i), 4, BackgroundColor);
tft.fillCircle(250, 54 + (15 * i), 4, BackgroundColor);
}
if (radio.eon[i + y].tp) tft.fillCircle(302, 54 + (15 * i), 4, InsignificantColor); else tft.fillCircle(302, 54 + (15 * i), 4, BackgroundColor);
if (radio.eon[i + y].tp) tft.fillCircle(276, 54 + (15 * i), 4, InsignificantColor); else tft.fillCircle(276, 54 + (15 * i), 4, BackgroundColor);
if (radio.eon[i + y].pty != eonptyold[i + y]) {
tftReplace(0, String(eonptyold[i + y]), (radio.eon[i + y].pty < 32 ? String(radio.eon[i + y].pty) : " "), 304, 48 + (15 * i), PrimaryColor, PrimaryColorSmooth, 16);
eonptyold[i + y] = radio.eon[i + y].pty;
}
if (i == 9) i = 254;
}

View File

@@ -46,6 +46,7 @@ extern byte ECCold;
extern byte language;
extern byte licold;
extern byte MSold;
extern byte eonptyold[20];
extern byte rdsblockold;
extern byte region;
extern byte stationlistid;