Moved clock to top left of the screen
This commit is contained in:
+61
-77
@@ -1407,11 +1407,7 @@ void loop() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void GetData() {
|
void GetData() {
|
||||||
if (!afscreen) {
|
if (!afscreen) ShowSignalLevel();
|
||||||
showCT();
|
|
||||||
ShowSignalLevel();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!BWtune && !menu) showPS();
|
if (!BWtune && !menu) showPS();
|
||||||
|
|
||||||
if (band < BAND_GAP && !BWtune && !menu) {
|
if (band < BAND_GAP && !BWtune && !menu) {
|
||||||
@@ -1430,6 +1426,7 @@ void GetData() {
|
|||||||
ShowStereoStatus();
|
ShowStereoStatus();
|
||||||
|
|
||||||
if (!screenmute) {
|
if (!screenmute) {
|
||||||
|
showCT();
|
||||||
ShowRSSI();
|
ShowRSSI();
|
||||||
ShowOffset();
|
ShowOffset();
|
||||||
ShowBW();
|
ShowBW();
|
||||||
@@ -3450,92 +3447,79 @@ void ShowOffset() {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int baseX = 1; // Left boundary
|
||||||
|
int baseY = 16; // Top boundary
|
||||||
|
int width = 51; // Max width
|
||||||
|
int height = 13; // Max height
|
||||||
|
|
||||||
|
int centerX = baseX + width / 2; // Center dot X
|
||||||
|
int centerY = baseY + height / 2; // Center dot Y
|
||||||
|
|
||||||
|
// **Move arrows 3px further from the dot**
|
||||||
|
int arrowGap = 3; // Space between dot and arrows
|
||||||
|
int arrowWidth = 18; // Arrow stretch size
|
||||||
|
int leftArrowBaseX = centerX - arrowWidth - arrowGap; // Shift left arrow further left
|
||||||
|
int rightArrowBaseX = centerX + arrowWidth + arrowGap; // Shift right arrow further right
|
||||||
|
|
||||||
|
int arrowHeight = height - 2; // Arrow height
|
||||||
|
int arrowBaseYTop = baseY + 1; // Adjusted top Y position
|
||||||
|
int arrowBaseYBottom = baseY + height - 1;
|
||||||
|
|
||||||
if (band < BAND_GAP) {
|
if (band < BAND_GAP) {
|
||||||
if (OStatus < -500) {
|
if (OStatus < -250) {
|
||||||
tft.fillTriangle(3, 8, 3, 22, 11, 14, GreyoutColor);
|
// Left arrow active (▶)
|
||||||
tft.fillTriangle(13, 8, 13, 22, 21, 14, GreyoutColor);
|
tft.fillTriangle(leftArrowBaseX, arrowBaseYTop, centerX - arrowGap, centerY, leftArrowBaseX, arrowBaseYBottom, SignificantColor);
|
||||||
tft.fillCircle(26, 15, 3, GreyoutColor);
|
// Center dot
|
||||||
tft.fillTriangle(32, 14, 40, 8, 40, 22, GreyoutColor);
|
tft.fillCircle(centerX, centerY, 3, GreyoutColor);
|
||||||
tft.fillTriangle(42, 14, 50, 8, 50, 22, SignificantColor);
|
// Right arrow dimmed (◀)
|
||||||
tuned = false;
|
tft.fillTriangle(rightArrowBaseX, arrowBaseYTop, centerX + arrowGap, centerY, rightArrowBaseX, arrowBaseYBottom, GreyoutColor);
|
||||||
} else if (OStatus < -250 && OStatus > -500) {
|
|
||||||
tft.fillTriangle(3, 8, 3, 22, 11, 14, GreyoutColor);
|
|
||||||
tft.fillTriangle(13, 8, 13, 22, 21, 14, GreyoutColor);
|
|
||||||
tft.fillCircle(26, 15, 3, GreyoutColor);
|
|
||||||
tft.fillTriangle(32, 14, 40, 8, 40, 22, SignificantColor);
|
|
||||||
tft.fillTriangle(42, 14, 50, 8, 50, 22, GreyoutColor);
|
|
||||||
tuned = false;
|
tuned = false;
|
||||||
} else if (USN < 250 && WAM < 250 && OStatus > -250 && OStatus < 250 && !SQ) {
|
} else if (USN < 250 && WAM < 250 && OStatus > -250 && OStatus < 250 && !SQ) {
|
||||||
tft.fillTriangle(3, 8, 3, 22, 11, 14, GreyoutColor);
|
// Both arrows dimmed
|
||||||
tft.fillTriangle(13, 8, 13, 22, 21, 14, GreyoutColor);
|
tft.fillTriangle(leftArrowBaseX, arrowBaseYTop, centerX - arrowGap, centerY, leftArrowBaseX, arrowBaseYBottom, GreyoutColor);
|
||||||
tft.fillCircle(26, 15, 3, InsignificantColor);
|
tft.fillTriangle(rightArrowBaseX, arrowBaseYTop, centerX + arrowGap, centerY, rightArrowBaseX, arrowBaseYBottom, GreyoutColor);
|
||||||
tft.fillTriangle(32, 14, 40, 8, 40, 22, GreyoutColor);
|
// Center dot active
|
||||||
tft.fillTriangle(42, 14, 50, 8, 50, 22, GreyoutColor);
|
tft.fillCircle(centerX, centerY, 3, InsignificantColor);
|
||||||
tuned = true;
|
tuned = true;
|
||||||
} else if (OStatus > 250 && OStatus < 500) {
|
} else if (OStatus > 250) {
|
||||||
tft.fillTriangle(3, 8, 3, 22, 11, 14, GreyoutColor);
|
// Right arrow active (◀)
|
||||||
tft.fillTriangle(13, 8, 13, 22, 21, 14, SignificantColor);
|
tft.fillTriangle(rightArrowBaseX, arrowBaseYTop, centerX + arrowGap, centerY, rightArrowBaseX, arrowBaseYBottom, SignificantColor);
|
||||||
tft.fillCircle(26, 15, 3, GreyoutColor);
|
// Center dot dimmed
|
||||||
tft.fillTriangle(32, 14, 40, 8, 40, 22, GreyoutColor);
|
tft.fillCircle(centerX, centerY, 3, GreyoutColor);
|
||||||
tft.fillTriangle(42, 14, 50, 8, 50, 22, GreyoutColor);
|
// Left arrow dimmed (▶)
|
||||||
tuned = false;
|
tft.fillTriangle(leftArrowBaseX, arrowBaseYTop, centerX - arrowGap, centerY, leftArrowBaseX, arrowBaseYBottom, GreyoutColor);
|
||||||
} else if (OStatus > 500) {
|
|
||||||
tft.fillTriangle(3, 8, 3, 22, 11, 14, SignificantColor);
|
|
||||||
tft.fillTriangle(13, 8, 13, 22, 21, 14, GreyoutColor);
|
|
||||||
tft.fillCircle(26, 15, 3, GreyoutColor);
|
|
||||||
tft.fillTriangle(32, 14, 40, 8, 40, 22, GreyoutColor);
|
|
||||||
tft.fillTriangle(42, 14, 50, 8, 50, 22, GreyoutColor);
|
|
||||||
tuned = false;
|
tuned = false;
|
||||||
} else {
|
} else {
|
||||||
tft.fillTriangle(3, 8, 3, 22, 11, 14, GreyoutColor);
|
// Everything dimmed
|
||||||
tft.fillTriangle(13, 8, 13, 22, 21, 14, GreyoutColor);
|
tft.fillTriangle(leftArrowBaseX, arrowBaseYTop, centerX - arrowGap, centerY, leftArrowBaseX, arrowBaseYBottom, GreyoutColor);
|
||||||
tft.fillCircle(26, 15, 3, GreyoutColor);
|
tft.fillTriangle(rightArrowBaseX, arrowBaseYTop, centerX + arrowGap, centerY, rightArrowBaseX, arrowBaseYBottom, GreyoutColor);
|
||||||
tft.fillTriangle(32, 14, 40, 8, 40, 22, GreyoutColor);
|
tft.fillCircle(centerX, centerY, 3, GreyoutColor);
|
||||||
tft.fillTriangle(42, 14, 50, 8, 50, 22, GreyoutColor);
|
|
||||||
tuned = false;
|
tuned = false;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (OStatus <= -3) {
|
if (OStatus <= -2) {
|
||||||
tft.fillTriangle(3, 8, 3, 22, 11, 14, GreyoutColor);
|
// Left arrow active (▶)
|
||||||
tft.fillTriangle(13, 8, 13, 22, 21, 14, GreyoutColor);
|
tft.fillTriangle(leftArrowBaseX, arrowBaseYTop, centerX - arrowGap, centerY, leftArrowBaseX, arrowBaseYBottom, SignificantColor);
|
||||||
tft.fillCircle(26, 15, 3, GreyoutColor);
|
tft.fillCircle(centerX, centerY, 3, GreyoutColor);
|
||||||
tft.fillTriangle(32, 14, 40, 8, 40, 22, GreyoutColor);
|
// Right arrow dimmed (◀)
|
||||||
tft.fillTriangle(42, 14, 50, 8, 50, 22, SignificantColor);
|
tft.fillTriangle(rightArrowBaseX, arrowBaseYTop, centerX + arrowGap, centerY, rightArrowBaseX, arrowBaseYBottom, GreyoutColor);
|
||||||
tuned = false;
|
|
||||||
} else if (OStatus < -2 && OStatus > -3) {
|
|
||||||
tft.fillTriangle(3, 8, 3, 22, 11, 14, GreyoutColor);
|
|
||||||
tft.fillTriangle(13, 8, 13, 22, 21, 14, GreyoutColor);
|
|
||||||
tft.fillCircle(26, 15, 3, GreyoutColor);
|
|
||||||
tft.fillTriangle(32, 14, 40, 8, 40, 22, SignificantColor);
|
|
||||||
tft.fillTriangle(42, 14, 50, 8, 50, 22, GreyoutColor);
|
|
||||||
tuned = false;
|
tuned = false;
|
||||||
} else if (OStatus > -2 && OStatus < 2 && !SQ) {
|
} else if (OStatus > -2 && OStatus < 2 && !SQ) {
|
||||||
tft.fillTriangle(3, 8, 3, 22, 11, 14, GreyoutColor);
|
tft.fillTriangle(leftArrowBaseX, arrowBaseYTop, centerX - arrowGap, centerY, leftArrowBaseX, arrowBaseYBottom, GreyoutColor);
|
||||||
tft.fillTriangle(13, 8, 13, 22, 21, 14, GreyoutColor);
|
tft.fillTriangle(rightArrowBaseX, arrowBaseYTop, centerX + arrowGap, centerY, rightArrowBaseX, arrowBaseYBottom, GreyoutColor);
|
||||||
tft.fillCircle(26, 15, 3, InsignificantColor);
|
tft.fillCircle(centerX, centerY, 3, InsignificantColor);
|
||||||
tft.fillTriangle(32, 14, 40, 8, 40, 22, GreyoutColor);
|
|
||||||
tft.fillTriangle(42, 14, 50, 8, 50, 22, GreyoutColor);
|
|
||||||
tuned = true;
|
tuned = true;
|
||||||
} else if (OStatus > 2 && OStatus < 3) {
|
} else if (OStatus > 2) {
|
||||||
tft.fillTriangle(3, 8, 3, 22, 11, 14, GreyoutColor);
|
// Right arrow active (◀)
|
||||||
tft.fillTriangle(13, 8, 13, 22, 21, 14, SignificantColor);
|
tft.fillTriangle(rightArrowBaseX, arrowBaseYTop, centerX + arrowGap, centerY, rightArrowBaseX, arrowBaseYBottom, SignificantColor);
|
||||||
tft.fillCircle(26, 15, 3, GreyoutColor);
|
tft.fillCircle(centerX, centerY, 3, GreyoutColor);
|
||||||
tft.fillTriangle(32, 14, 40, 8, 40, 22, GreyoutColor);
|
// Left arrow dimmed (▶)
|
||||||
tft.fillTriangle(42, 14, 50, 8, 50, 22, GreyoutColor);
|
tft.fillTriangle(leftArrowBaseX, arrowBaseYTop, centerX - arrowGap, centerY, leftArrowBaseX, arrowBaseYBottom, GreyoutColor);
|
||||||
tuned = false;
|
|
||||||
} else if (OStatus >= 3) {
|
|
||||||
tft.fillTriangle(3, 8, 3, 22, 11, 14, SignificantColor);
|
|
||||||
tft.fillTriangle(13, 8, 13, 22, 21, 14, GreyoutColor);
|
|
||||||
tft.fillCircle(26, 15, 3, GreyoutColor);
|
|
||||||
tft.fillTriangle(32, 14, 40, 8, 40, 22, GreyoutColor);
|
|
||||||
tft.fillTriangle(42, 14, 50, 8, 50, 22, GreyoutColor);
|
|
||||||
tuned = false;
|
tuned = false;
|
||||||
} else {
|
} else {
|
||||||
tft.fillTriangle(3, 8, 3, 22, 11, 14, GreyoutColor);
|
tft.fillTriangle(leftArrowBaseX, arrowBaseYTop, centerX - arrowGap, centerY, leftArrowBaseX, arrowBaseYBottom, GreyoutColor);
|
||||||
tft.fillTriangle(13, 8, 13, 22, 21, 14, GreyoutColor);
|
tft.fillTriangle(rightArrowBaseX, arrowBaseYTop, centerX + arrowGap, centerY, rightArrowBaseX, arrowBaseYBottom, GreyoutColor);
|
||||||
tft.fillCircle(26, 15, 3, GreyoutColor);
|
tft.fillCircle(centerX, centerY, 3, GreyoutColor);
|
||||||
tft.fillTriangle(32, 14, 40, 8, 40, 22, GreyoutColor);
|
|
||||||
tft.fillTriangle(42, 14, 50, 8, 50, 22, GreyoutColor);
|
|
||||||
tuned = false;
|
tuned = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2955,6 +2955,7 @@ void BuildDisplay() {
|
|||||||
tft.drawRect(0, 0, 320, 240, FrameColor);
|
tft.drawRect(0, 0, 320, 240, FrameColor);
|
||||||
tft.drawLine(0, 30, 320, 30, FrameColor);
|
tft.drawLine(0, 30, 320, 30, FrameColor);
|
||||||
tft.drawLine(0, 100, 320, 100, FrameColor);
|
tft.drawLine(0, 100, 320, 100, FrameColor);
|
||||||
|
tft.drawLine(0, 15, 53, 15, FrameColor);
|
||||||
tft.drawLine(120, 30, 120, 0, FrameColor);
|
tft.drawLine(120, 30, 120, 0, FrameColor);
|
||||||
tft.drawLine(210, 100, 210, 217, FrameColor);
|
tft.drawLine(210, 100, 210, 217, FrameColor);
|
||||||
tft.drawLine(248, 30, 248, 0, FrameColor);
|
tft.drawLine(248, 30, 248, 0, FrameColor);
|
||||||
|
|||||||
+5
-7
@@ -822,7 +822,7 @@ void showCT() {
|
|||||||
|
|
||||||
// Format the time string with leading zeros for minutes
|
// Format the time string with leading zeros for minutes
|
||||||
char formattedTime[10];
|
char formattedTime[10];
|
||||||
sprintf(formattedTime, "%d:%02d %s", hour, localtime(&t)->tm_min, ampm.c_str());
|
sprintf(formattedTime, "%d:%02d%s", hour, localtime(&t)->tm_min, ampm.c_str());
|
||||||
|
|
||||||
rds_clock = String(formattedTime);
|
rds_clock = String(formattedTime);
|
||||||
} else { // Other regions: 24-hour format
|
} else { // Other regions: 24-hour format
|
||||||
@@ -841,16 +841,14 @@ void showCT() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Display the updated time
|
// Display the updated time
|
||||||
int yCoord = advancedRDS ? 109 : 163;
|
tftReplace(0, rds_clockold, rds_clock, 26, 1, RDSColor, RDSColorSmooth, BackgroundColor, 16);
|
||||||
tftReplace(1, rds_clockold, rds_clock, 208, yCoord, RDSColor, RDSColorSmooth, BackgroundColor, 16);
|
|
||||||
} else { // Handle dropout scenarios
|
} else { // Handle dropout scenarios
|
||||||
int yCoord = advancedRDS ? 109 : 163;
|
|
||||||
|
|
||||||
if (rtcset) { // Display dropout message if RTC was set
|
if (rtcset) { // Display dropout message if RTC was set
|
||||||
tftReplace(1, rds_clockold, rds_clock, 208, yCoord, RDSDropoutColor, RDSDropoutColorSmooth, BackgroundColor, 16);
|
tftReplace(1, rds_clockold, rds_clock, 26, 1, RDSDropoutColor, RDSDropoutColorSmooth, BackgroundColor, 16);
|
||||||
} else { // Clear and reprint the clock
|
} else { // Clear and reprint the clock
|
||||||
tftPrint(1, rds_clockold, 208, yCoord, BackgroundColor, BackgroundColor, 16);
|
tftPrint(0, rds_clockold, 26, 1, BackgroundColor, BackgroundColor, 16);
|
||||||
tftPrint(1, rds_clock, 208, yCoord, BackgroundColor, BackgroundColor, 16);
|
tftPrint(0, rds_clock, 26, 1, BackgroundColor, BackgroundColor, 16);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user