Skin adjustments

Fix a bug on callsign display
This commit is contained in:
Sjef Verhoeven PE5PVB
2024-03-30 23:55:14 +01:00
parent 0d70002a2a
commit b1c521ec3b
6 changed files with 585 additions and 536 deletions
+25 -21
View File
@@ -204,6 +204,7 @@ int BackgroundColor1;
int BackgroundColor2;
int BackgroundColor3;
int BackgroundColor4;
int BackgroundColor5;
int BarSignificantColor;
int BarInsignificantColor;
int BatteryValueColor;
@@ -2088,17 +2089,17 @@ void ModeButtonPress() {
void ShowStepSize() {
if (!advancedRDS) {
if (CurrentSkin == 1) {
tft.pushImage (194, 30, 22, 5, skin1_stepoff);
tft.pushImage (225, 30, 22, 5, skin1_stepoff);
if (band < BAND_GAP) tft.pushImage (116, 30, 22, 5, skin1_stepoff); else if (band != BAND_LW && band != BAND_MW) tft.pushImage (132, 30, 22, 5, skin1_stepoff);
if (band < BAND_GAP) tft.pushImage (147, 30, 22, 5, skin1_stepoff); else tft.pushImage (162, 30, 22, 5, skin1_stepoff);
if (stepsize == 1) tft.pushImage (225, 30, 22, 5, skin1_stepon);
if (stepsize == 2) tft.pushImage (194, 30, 22, 5, skin1_stepon);
tft.pushImage (196, 30, 22, 5, skin1_stepoff);
tft.pushImage (227, 30, 22, 5, skin1_stepoff);
if (band < BAND_GAP) tft.pushImage (118, 30, 22, 5, skin1_stepoff); else if (band != BAND_LW && band != BAND_MW) tft.pushImage (134, 30, 22, 5, skin1_stepoff);
if (band < BAND_GAP) tft.pushImage (149, 30, 22, 5, skin1_stepoff); else tft.pushImage (164, 30, 22, 5, skin1_stepoff);
if (stepsize == 1) tft.pushImage (227, 30, 22, 5, skin1_stepon);
if (stepsize == 2) tft.pushImage (196, 30, 22, 5, skin1_stepon);
if (stepsize == 3) {
if (band < BAND_GAP) tft.pushImage (147, 30, 22, 5, skin1_stepon); else tft.pushImage (162, 30, 22, 5, skin1_stepon);
if (band < BAND_GAP) tft.pushImage (149, 30, 22, 5, skin1_stepon); else tft.pushImage (164, 30, 22, 5, skin1_stepon);
}
if (stepsize == 4) {
if (band < BAND_GAP) tft.pushImage (116, 30, 22, 5, skin1_stepon); else tft.pushImage (132, 30, 22, 5, skin1_stepon);
if (band < BAND_GAP) tft.pushImage (118, 30, 22, 5, skin1_stepon); else tft.pushImage (134, 30, 22, 5, skin1_stepon);
}
} else {
tft.fillRect(191, 38, 15, 4, GreyoutColor);
@@ -2472,14 +2473,14 @@ void ShowMemoryPos() {
if (advancedRDS) {
tftReplace(-1, String(memoryposold + 1), String(memorypos + 1), 215, 36, SecondaryColor, SecondaryColorSmooth, BackgroundColor, 16);
} else {
if (CurrentSkin == 1) tftReplace(-1, String(memoryposold + 1), String(memorypos + 1), 5, 29, memposcolor, memposcolorsmooth, BackgroundColor, 16); else tftReplace(-1, String(memoryposold + 1), String(memorypos + 1), 50, 32, memposcolor, memposcolorsmooth, BackgroundColor, 16);
if (CurrentSkin == 1) tftReplace(-1, String(memoryposold + 1), String(memorypos + 1), 5, 29, memposcolor, memposcolorsmooth, BackgroundColor5, 16); else tftReplace(-1, String(memoryposold + 1), String(memorypos + 1), 50, 32, memposcolor, memposcolorsmooth, BackgroundColor, 16);
}
memoryposold = memorypos;
} else {
if (advancedRDS) {
tftPrint(-1, String(memorypos + 1), 215, 36, BackgroundColor, BackgroundColor, 16);
} else {
if (CurrentSkin == 1) tftPrint(-1, String(memorypos + 1), 5, 29, BackgroundColor, BackgroundColor, 16); else tftPrint(-1, String(memorypos + 1), 50, 32, BackgroundColor, BackgroundColor, 16);
if (CurrentSkin == 1) tftPrint(-1, String(memorypos + 1), 5, 29, BackgroundColor5, BackgroundColor5, 16); else tftPrint(-1, String(memorypos + 1), 50, 32, BackgroundColor, BackgroundColor, 16);
}
}
}
@@ -2572,7 +2573,7 @@ void ShowFreq(int mode) {
}
if (!screenmute) {
if (CurrentSkin == 1) FrequencySprite.pushImage (-55, -40, 320, 240, skin1_mainbackground); else FrequencySprite.fillSprite(BackgroundColor);
if (CurrentSkin == 1) FrequencySprite.pushImage (-57, -40, 320, 240, skin1_mainbackground); else FrequencySprite.fillSprite(BackgroundColor);
FrequencySprite.setTextDatum(TR_DATUM);
FrequencySprite.setTextColor(FreqColor, FreqColorSmooth, false);
FrequencySprite.drawString(String(frequency_AM) + " ", 218, -6);
@@ -2585,7 +2586,7 @@ void ShowFreq(int mode) {
updateSWMIBand();
}
if (CurrentSkin == 1) FrequencySprite.pushSprite(55, 40); else FrequencySprite.pushSprite(46, 46);
if (CurrentSkin == 1) FrequencySprite.pushSprite(57, 40); else FrequencySprite.pushSprite(46, 46);
FrequencySprite.setTextDatum(TR_DATUM);
switch (freqfont) {
@@ -2684,7 +2685,7 @@ void ShowSignalLevel() {
}
if (tuned) {
if (CurrentSkin == 1) {
if (CN == 0) tftPrint(-1, "--", 274, 128, PrimaryColor, PrimaryColorSmooth, 16); else tftPrint(-1, String(CN), 274, 128, PrimaryColor, PrimaryColorSmooth, 16);
if (CN == 0) tftPrint(-1, "--", 274, 128, FreqColor, FreqColorSmooth, 16); else tftPrint(-1, String(CN), 274, 128, PrimaryColor, PrimaryColorSmooth, 16);
} else {
if (CN == 0) tftPrint(1, "--", 295, 163, PrimaryColor, PrimaryColorSmooth, 16); else tftPrint(1, String(CN), 295, 163, PrimaryColor, PrimaryColorSmooth, 16);
}
@@ -2728,16 +2729,20 @@ void ShowSignalLevel() {
tftReplace(1, String(SStatusold / 10) + "." + String(abs(SStatusold % 10)), String(SStatusprint / 10) + "." + String(abs(SStatusprint % 10)), 273, 51, PrimaryColor, PrimaryColorSmooth, BackgroundColor, 16);
} else {
if (CurrentSkin == 1) {
if (SStatusold / 10 != SStatusprint / 10) tftReplace(1, String(SStatusold / 10), String(SStatusprint / 10), 262, 99, PrimaryColor, PrimaryColorSmooth, BackgroundColor2, 28);
tftReplace(-1, "." + String(abs(SStatusold % 10)), "." + String(abs(SStatusprint % 10)), 264, 99, PrimaryColor, PrimaryColorSmooth, BackgroundColor2, 16);
if (SStatusold / 10 != SStatusprint / 10) tftReplace(1, String(SStatusold / 10), String(SStatusprint / 10), 262, 99, FreqColor, FreqColorSmooth, BackgroundColor2, 28);
tftReplace(-1, "." + String(abs(SStatusold % 10)), "." + String(abs(SStatusprint % 10)), 264, 99, FreqColor, FreqColorSmooth, BackgroundColor2, 16);
if (band < BAND_GAP) segments = map(SStatus / 10, 5, 70, 0, 136); else map((SStatus + 200) / 10, 0, 120, 0, 136);
int SStatuscalc = SStatus;
if (SStatuscalc < 0) SStatuscalc = 0;
if (SStatuscalc > 700) SStatuscalc = 700;
if (band < BAND_GAP) segments = map(SStatuscalc / 10, 5, 70, 0, 136); else segments = map((SStatuscalc + 200) / 10, 0, 120, 0, 136);
tft.fillRect(18, 213, 136, 6, GreyoutColor);
if (segments > 100) {
tft.fillRect(18, 213, 100, 6, BarInsignificantColor);
tft.fillRect(18 + 100, 213, segments - 100, 6, BarSignificantColor);
} else {
tft.fillRect(18, 213, segments, 6, BarInsignificantColor);
tft.fillRect(18, 213, segments, 6, FreqColor);
}
} else {
if (SStatusold / 10 != SStatusprint / 10) tftReplace(1, String(SStatusold / 10), String(SStatusprint / 10), 288, 105, FreqColor, FreqColorSmooth, BackgroundColor, 48);
@@ -3016,7 +3021,7 @@ void ShowModLevel() {
MStatusold = 1;
}
if (CurrentSkin == 1) {
segments = map(MStatus, 0, 120, 0, 136);
segments = map(MStatus, 0, 120, 0, 133);
if (segments > peakholdold) {
peakholdold = segments;
@@ -3031,11 +3036,10 @@ void ShowModLevel() {
tft.fillRect(178, 213, segments, 6, BarInsignificantColor);
}
int peakHoldPosition = map(peakholdold, 0, 132, 0, 136);
tft.fillRect(178 + peakHoldPosition, 213, 2, 6, (peakholdold > 80) ? BarSignificantColor : BarInsignificantColor);
tft.fillRect(178 + peakholdold, 213, 2, 6, (peakholdold > 80) ? BarSignificantColor : BarInsignificantColor);
if (millis() - peakholdmillis >= 1000) {
tft.fillRect(178 + peakHoldPosition, 213, 2, 6, GreyoutColor);
tft.fillRect(178 + peakholdold, 213, 2, 6, GreyoutColor);
peakholdold = segments;
peakholdmillis = millis();
}
+3 -4
View File
@@ -575,11 +575,10 @@ void TEF6686::readRDS(byte showrdserrors)
}
if (faultyID) {
for (byte i = 0; i < 9; i++) {
rds.stationID[i] = ' ';
}
strcpy(rds.stationID, "Unknown");
} else {
rds.stationID[7] = '?';
}
rds.stationID[7] = '?';
rds.stationID[8] = '\0';
}
correctPIold = rds.correctPI;
+491 -491
View File
File diff suppressed because it is too large Load Diff
+7 -1
View File
@@ -430,6 +430,7 @@ void doTheme() { // Use this to put your own colors in: http://www.barth-dev.de
BackgroundColor2 = 0x0044;
BackgroundColor3 = 0x00a2;
BackgroundColor4 = 0x00c6;
BackgroundColor5 = 0x0001;
ActiveColor = White;
ActiveColorSmooth = WhiteSmooth;
FreqColor = 0x1ff7;
@@ -1630,9 +1631,14 @@ void BuildDisplay() {
tft.drawLine(178, 219, 313, 219, FrameColor);
tft.drawLine(18, 219, 153, 219, FrameColor);
if (region == REGION_EU) tftPrint(-1, "PI:", 8, 104, ActiveColor, ActiveColorSmooth, 16);
if (region == REGION_US) {
tftPrint(-1, "PI:", 8, 97, ActiveColor, ActiveColorSmooth, 16);
tftPrint(-1, "ID:", 8, 111, ActiveColor, ActiveColorSmooth, 16);
}
tftPrint(-1, "S", 6, 214, PrimaryColor, PrimaryColorSmooth, 16);
tftPrint(-1, "M", 162, 214, PrimaryColor, PrimaryColorSmooth, 16);
tftPrint(-1, "PI:", 8, 104, ActiveColor, ActiveColorSmooth, 16);
if (usesquelch) tftPrint(1, "SQ:", 276, 168, ActiveColor, ActiveColorSmooth, 16);
tftPrint(1, unitString[unit], 312, 108, ActiveColor, ActiveColorSmooth, 16);
tftPrint(1, "dB", 312, 128, ActiveColor, ActiveColorSmooth, 16);
+1
View File
@@ -127,6 +127,7 @@ extern int BackgroundColor1;
extern int BackgroundColor2;
extern int BackgroundColor3;
extern int BackgroundColor4;
extern int BackgroundColor5;
extern int BarInsignificantColor;
extern int BarSignificantColor;
extern int BatteryValueColor;
+58 -19
View File
@@ -305,9 +305,21 @@ void readRds() {
}
if (region == REGION_US) {
if (advancedRDS) tftPrint(-1, PIold, 240, 72, RDSDropoutColor, RDSDropoutColorSmooth, 16); else tftPrint(-1, PIold, 240, 184, RDSDropoutColor, RDSDropoutColorSmooth, 16);
if (advancedRDS) tftPrint(-1, stationIDold, 240, 89, RDSDropoutColor, RDSDropoutColorSmooth, 16); else tftPrint(-1, stationIDold, 240, 201, RDSDropoutColor, RDSDropoutColorSmooth, 16);
if (advancedRDS) tftPrint(1, stationStateold, 318, 89, RDSDropoutColor, RDSDropoutColorSmooth, 16); else tftPrint(1, stationStateold, 318, 201, RDSDropoutColor, RDSDropoutColorSmooth, 16);
if (advancedRDS) {
tftPrint(-1, PIold, 240, 72, RDSDropoutColor, RDSDropoutColorSmooth, 16);
tftPrint(-1, stationIDold, 240, 89, RDSDropoutColor, RDSDropoutColorSmooth, 16);
tftPrint(1, stationStateold, 318, 89, RDSDropoutColor, RDSDropoutColorSmooth, 16);
} else {
if (CurrentSkin == 1) {
tftPrint(-1, PIold, 30, 97, RDSDropoutColor, RDSDropoutColorSmooth, 16);
tftPrint(-1, stationIDold, 30, 111, RDSDropoutColor, RDSDropoutColorSmooth, 16);
tftPrint(1, stationStateold, 108, 111, RDSDropoutColor, RDSDropoutColorSmooth, 16);
} else {
tftPrint(-1, PIold, 240, 184, RDSDropoutColor, RDSDropoutColorSmooth, 16);
tftPrint(-1, stationIDold, 240, 201, RDSDropoutColor, RDSDropoutColorSmooth, 16);
tftPrint(1, stationStateold, 318, 201, RDSDropoutColor, RDSDropoutColorSmooth, 16);
}
}
}
if (advancedRDS) {
@@ -349,13 +361,26 @@ void readRds() {
if (advancedRDS) {
tftPrint(0, PIold, 275, 75, RDSColor, RDSColorSmooth, 28);
} else {
if (CurrentSkin == 1) tftPrint(-1, PIold, 30, 99, PrimaryColor, PrimaryColorSmooth, 28); else tftPrint(0, PIold, 275, 187, RDSColor, RDSColor, 28);
if (CurrentSkin == 1) tftPrint(-1, PIold, 30, 99, FreqColor, FreqColorSmooth, 28); else tftPrint(0, PIold, 275, 187, RDSColor, RDSColor, 28);
}
}
if (region == REGION_US) {
if (advancedRDS) tftPrint(-1, PIold, 240, 72, RDSColor, RDSColorSmooth, 16); else tftPrint(-1, PIold, 240, 184, RDSColor, RDSColorSmooth, 16);
if (advancedRDS) tftPrint(-1, stationIDold, 240, 89, RDSColor, RDSColorSmooth, 16); else tftPrint(-1, stationIDold, 240, 201, RDSColor, RDSColorSmooth, 16);
if (advancedRDS) {
tftPrint(-1, PIold, 240, 72, RDSColor, RDSColorSmooth, 16);
tftPrint(-1, stationIDold, 240, 89, RDSColor, RDSColorSmooth, 16);
tftPrint(1, stationStateold, 318, 89, RDSColor, RDSColorSmooth, 16);
} else {
if (CurrentSkin == 1) {
tftPrint(-1, PIold, 30, 97, FreqColor, FreqColorSmooth, 16);
tftPrint(-1, stationIDold, 30, 111, FreqColor, FreqColorSmooth, 16);
tftPrint(1, stationStateold, 108, 111, FreqColor, FreqColorSmooth, 16);
} else {
tftPrint(-1, PIold, 240, 184, RDSColor, RDSColorSmooth, 16);
tftPrint(-1, stationIDold, 240, 201, RDSColor, RDSColorSmooth, 16);
tftPrint(1, stationStateold, 318, 201, RDSDropoutColor, RDSDropoutColorSmooth, 16);
}
}
}
if (advancedRDS) {
@@ -363,7 +388,7 @@ void readRds() {
} else {
if (CurrentSkin == 1) {
PSSprite.pushImage (-8, -154, 320, 240, skin1_mainbackground);
PSSprite.setTextColor(PrimaryColor, PrimaryColorSmooth, false);
PSSprite.setTextColor(FreqColor, FreqColorSmooth, false);
PSSprite.drawString(PSold, 84, 1);
PSSprite.pushSprite(8, 154);
} else {
@@ -622,12 +647,12 @@ void showPI() {
if (region == REGION_US) {
if (!RDSstatus) {
if (String(radio.rds.picode) != PIold) tftReplace(-1, PIold, radio.rds.picode, 240, 72, RDSDropoutColor, RDSDropoutColorSmooth, BackgroundColor, 16);
tftReplace(-1, stationIDold, radio.rds.stationID, 240, 89, RDSDropoutColor, RDSDropoutColorSmooth, BackgroundColor, 16);
tftReplace(-1, stationIDold, radio.rds.stationIDtext, 240, 89, RDSDropoutColor, RDSDropoutColorSmooth, BackgroundColor, 16);
} else {
if (String(radio.rds.picode) != PIold) tftReplace(-1, PIold, radio.rds.picode, 240, 72, RDSColor, RDSColorSmooth, BackgroundColor, 16);
tftReplace(-1, stationIDold, radio.rds.stationID, 240, 89, RDSColor, RDSColorSmooth, BackgroundColor, 16);
tftReplace(-1, stationIDold, radio.rds.stationIDtext, 240, 89, RDSColor, RDSColorSmooth, BackgroundColor, 16);
}
tftReplace(1, stationStateold, radio.rds.stationState, 318, 89, RDSDropoutColor, RDSDropoutColorSmooth, BackgroundColor, 16);
tftReplace(1, stationStateold, radio.rds.stationStatetext, 318, 89, RDSDropoutColor, RDSDropoutColorSmooth, BackgroundColor, 16);
}
} else if (afscreen) {
tftReplace(-1, PIold, radio.rds.picode, 30, 201, BWAutoColor, BWAutoColorSmooth, BackgroundColor, 16);
@@ -636,23 +661,37 @@ void showPI() {
if (!RDSstatus) {
if (CurrentSkin == 1) tftReplace(-1, PIold, radio.rds.picode, 30, 99, RDSDropoutColor, RDSDropoutColorSmooth, BackgroundColor2, 28); else tftReplace(0, PIold, radio.rds.picode, 275, 187, RDSDropoutColor, RDSDropoutColorSmooth, BackgroundColor, 28);
} else {
if (CurrentSkin == 1) tftReplace(-1, PIold, radio.rds.picode, 30, 99, PrimaryColor, PrimaryColorSmooth, BackgroundColor2, 28); else tftReplace(0, PIold, radio.rds.picode, 275, 187, RDSColor, RDSColorSmooth, BackgroundColor, 28);
if (CurrentSkin == 1) tftReplace(-1, PIold, radio.rds.picode, 30, 99, FreqColor, FreqColorSmooth, BackgroundColor2, 28); else tftReplace(0, PIold, radio.rds.picode, 275, 187, RDSColor, RDSColorSmooth, BackgroundColor, 28);
}
}
if (region == REGION_US) {
if (!RDSstatus) {
if (String(radio.rds.picode) != PIold) tftReplace(-1, PIold, radio.rds.picode, 240, 184, RDSDropoutColor, RDSDropoutColorSmooth, BackgroundColor, 16);
tftReplace(-1, stationIDold, radio.rds.stationID, 240, 201, RDSDropoutColor, RDSDropoutColorSmooth, BackgroundColor, 16);
if (String(radio.rds.picode) != PIold || radio.rds.stationIDtext != stationIDold) {
if (CurrentSkin == 1) {
tftReplace(-1, PIold, radio.rds.picode, 30, 97, RDSDropoutColor, RDSDropoutColorSmooth, BackgroundColor, 16);
tftReplace(-1, stationIDold, radio.rds.stationIDtext, 30, 111, RDSDropoutColor, RDSDropoutColorSmooth, BackgroundColor, 16);
} else {
tftReplace(-1, PIold, radio.rds.picode, 240, 184, RDSDropoutColor, RDSDropoutColorSmooth, BackgroundColor, 16);
tftReplace(-1, stationIDold, radio.rds.stationIDtext, 240, 201, RDSDropoutColor, RDSDropoutColorSmooth, BackgroundColor, 16);
}
}
} else {
if (String(radio.rds.picode) != PIold) tftReplace(-1, PIold, radio.rds.picode, 240, 184, RDSColor, RDSColorSmooth, BackgroundColor, 16);
tftReplace(-1, stationIDold, radio.rds.stationID, 240, 201, RDSColor, RDSColorSmooth, BackgroundColor, 16);
if (String(radio.rds.picode) != PIold || radio.rds.stationIDtext != stationIDold) {
if (CurrentSkin == 1) {
tftReplace(-1, PIold, radio.rds.picode, 30, 97, FreqColor, FreqColorSmooth, BackgroundColor, 16);
tftReplace(-1, stationIDold, radio.rds.stationIDtext, 30, 111, FreqColor, FreqColorSmooth, BackgroundColor, 16);
} else {
tftReplace(-1, PIold, radio.rds.picode, 240, 184, RDSColor, RDSColorSmooth, BackgroundColor, 16);
tftReplace(-1, stationIDold, radio.rds.stationIDtext, 240, 201, RDSColor, RDSColorSmooth, BackgroundColor, 16);
}
}
}
tftReplace(1, stationStateold, radio.rds.stationState, 318, 201, RDSDropoutColor, RDSDropoutColorSmooth, BackgroundColor, 16);
if (CurrentSkin == 1) tftReplace(1, stationStateold, radio.rds.stationStatetext, 108, 111, RDSDropoutColor, RDSDropoutColorSmooth, BackgroundColor, 16); else tftReplace(1, stationStateold, radio.rds.stationStatetext, 318, 201, RDSDropoutColor, RDSDropoutColorSmooth, BackgroundColor, 16);
}
}
PIold = radio.rds.picode;
stationIDold = radio.rds.stationID;
stationStateold = radio.rds.stationState;
stationIDold = radio.rds.stationIDtext;
stationStateold = radio.rds.stationStatetext;
}
if (wifi) {
Udp.beginPacket(remoteip, 9030);
@@ -714,7 +753,7 @@ void showPS() {
} else {
if (CurrentSkin == 1) {
PSSprite.pushImage (-8, -154, 320, 240, skin1_mainbackground);
PSSprite.setTextColor(PrimaryColor, PrimaryColorSmooth, false);
PSSprite.setTextColor(FreqColor, FreqColorSmooth, false);
PSSprite.drawString(radio.rds.stationName, 84, 1);
PSSprite.pushSprite(8, 154);
} else {