Fixed a bug in PS viewer
This commit is contained in:
+14
-28
@@ -5,25 +5,9 @@
|
|||||||
#include "constants.h"
|
#include "constants.h"
|
||||||
#include <TimeLib.h>
|
#include <TimeLib.h>
|
||||||
|
|
||||||
bool rtABold;
|
int RadiotextWidth, PSLongWidth, AIDWidth, afstringWidth, eonstringWidth, rtplusstringWidth, length1, length2, length3, length4, length5, length6, length7;
|
||||||
int RadiotextWidth;
|
String afstringold, eonstringold, rtplusstringold, stationNameLongOld, AIDStringold;
|
||||||
int PSLongWidth;
|
bool rtABold, ps12errorold, ps34errorold, ps56errorold, ps78errorold;
|
||||||
int AIDWidth;
|
|
||||||
int afstringWidth;
|
|
||||||
int eonstringWidth;
|
|
||||||
int rtplusstringWidth;
|
|
||||||
int length1, length2, length3, length4, length5, length6, length7;
|
|
||||||
|
|
||||||
String afstringold;
|
|
||||||
String eonstringold;
|
|
||||||
String rtplusstringold;
|
|
||||||
String stationNameLongOld;
|
|
||||||
String AIDStringold;
|
|
||||||
|
|
||||||
bool ps12errorold;
|
|
||||||
bool ps34errorold;
|
|
||||||
bool ps56errorold;
|
|
||||||
bool ps78errorold;
|
|
||||||
|
|
||||||
void ShowAdvancedRDS() {
|
void ShowAdvancedRDS() {
|
||||||
if (!dropout) {
|
if (!dropout) {
|
||||||
@@ -691,7 +675,7 @@ void showPTY() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void showPS() {
|
void showPS() {
|
||||||
if (radio.rds.stationName != PSold || (RDSstatus && (!radio.rds.hasLongPS && showlongps) && !(ps12errorold == radio.rds.ps12error || ps34errorold == radio.rds.ps34error || ps56errorold == radio.rds.ps56error || ps78errorold == radio.rds.ps78error)) || (radio.rds.hasLongPS && showlongps)) {
|
if ((RDSstatus && (radio.rds.stationName != PSold)) || (RDSstatus && !(ps12errorold == radio.rds.ps12error || ps34errorold == radio.rds.ps34error || ps56errorold == radio.rds.ps56error || ps78errorold == radio.rds.ps78error)) || (radio.rds.hasLongPS && showlongps)) {
|
||||||
if (afscreen) {
|
if (afscreen) {
|
||||||
if (!screenmute) tftReplace(0, PSold, radio.rds.stationName, 160, 201, BWAutoColor, BWAutoColorSmooth, BackgroundColor, 16);
|
if (!screenmute) tftReplace(0, PSold, radio.rds.stationName, 160, 201, BWAutoColor, BWAutoColorSmooth, BackgroundColor, 16);
|
||||||
} else {
|
} else {
|
||||||
@@ -737,14 +721,10 @@ void showPS() {
|
|||||||
length6 = PSSprite.textWidth(radio.rds.stationName.substring(5, 6)) + length5;
|
length6 = PSSprite.textWidth(radio.rds.stationName.substring(5, 6)) + length5;
|
||||||
length7 = PSSprite.textWidth(radio.rds.stationName.substring(6, 7)) + length6;
|
length7 = PSSprite.textWidth(radio.rds.stationName.substring(6, 7)) + length6;
|
||||||
|
|
||||||
if (PSold.substring(0, 2) != radio.rds.stationName.substring(0, 2)) ps12errorold = true;
|
if (ps12errorold) ps12errorold = radio.rds.ps12error;
|
||||||
if (PSold.substring(2, 4) != radio.rds.stationName.substring(2, 4)) ps34errorold = true;
|
if (ps34errorold) ps34errorold = radio.rds.ps34error;
|
||||||
if (PSold.substring(4, 6) != radio.rds.stationName.substring(4, 6)) ps56errorold = true;
|
if (ps56errorold) ps56errorold = radio.rds.ps56error;
|
||||||
if (PSold.substring(6, 8) != radio.rds.stationName.substring(6, 8)) ps78errorold = true;
|
if (ps78errorold) ps78errorold = radio.rds.ps78error;
|
||||||
if (ps12errorold && PSold.substring(0, 2) != radio.rds.stationName.substring(0, 2)) ps12errorold = radio.rds.ps12error;
|
|
||||||
if (ps34errorold && PSold.substring(2, 4) != radio.rds.stationName.substring(2, 4)) ps34errorold = radio.rds.ps34error;
|
|
||||||
if (ps56errorold && PSold.substring(4, 6) != radio.rds.stationName.substring(4, 6)) ps56errorold = radio.rds.ps56error;
|
|
||||||
if (ps78errorold && PSold.substring(6, 8) != radio.rds.stationName.substring(6, 8)) ps78errorold = radio.rds.ps78error;
|
|
||||||
|
|
||||||
if (!RDSstatus || band > BAND_GAP) {
|
if (!RDSstatus || band > BAND_GAP) {
|
||||||
PSSprite.setTextColor(RDSDropoutColor, RDSDropoutColorSmooth, false);
|
PSSprite.setTextColor(RDSDropoutColor, RDSDropoutColorSmooth, false);
|
||||||
@@ -762,6 +742,12 @@ void showPS() {
|
|||||||
PSSprite.drawString(radio.rds.stationName.substring(6, 7), length6, 2);
|
PSSprite.drawString(radio.rds.stationName.substring(6, 7), length6, 2);
|
||||||
PSSprite.drawString(radio.rds.stationName.substring(7, 8), length7, 2);
|
PSSprite.drawString(radio.rds.stationName.substring(7, 8), length7, 2);
|
||||||
}
|
}
|
||||||
|
if (PSold != radio.rds.stationName) {
|
||||||
|
ps12errorold = true;
|
||||||
|
ps34errorold = true;
|
||||||
|
ps56errorold = true;
|
||||||
|
ps78errorold = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (!screenmute) {
|
if (!screenmute) {
|
||||||
if (advancedRDS) {
|
if (advancedRDS) {
|
||||||
|
|||||||
Reference in New Issue
Block a user