Skip to content

Commit a78e602

Browse files
committed
Handle transmitting RTCM, remove duplicate code
1 parent 74d2f43 commit a78e602

File tree

1 file changed

+7
-133
lines changed

1 file changed

+7
-133
lines changed

Firmware/RTK_Surveyor/Display.ino

Lines changed: 7 additions & 133 deletions
Original file line numberDiff line numberDiff line change
@@ -153,21 +153,21 @@ void updateDisplay()
153153
| ICON_BASE_TEMPORARY //Top center
154154
| ICON_BATTERY //Top right
155155
| ICON_LOGGING; //Bottom right
156-
paintBaseTempTransmitting();
156+
paintXmittingRTCM();
157157
break;
158158
case (STATE_BASE_TEMP_WIFI_STARTED):
159159
icons = paintWirelessIcon() //Top left
160160
| ICON_BASE_TEMPORARY //Top center
161161
| ICON_BATTERY //Top right
162162
| ICON_LOGGING; //Bottom right
163-
paintBaseTempWiFiStarted();
163+
paintXmittingRTCM();
164164
break;
165165
case (STATE_BASE_TEMP_WIFI_CONNECTED):
166166
icons = paintWirelessIcon() //Top left
167167
| ICON_BASE_TEMPORARY //Top center
168168
| ICON_BATTERY //Top right
169169
| ICON_LOGGING; //Bottom right
170-
paintBaseTempWiFiConnected();
170+
paintXmittingRTCM();
171171
break;
172172
case (STATE_BASE_TEMP_CASTER_STARTED):
173173
icons = paintWirelessIcon() //Top left
@@ -191,21 +191,21 @@ void updateDisplay()
191191
| ICON_BASE_FIXED //Top center
192192
| ICON_BATTERY //Top right
193193
| ICON_LOGGING; //Bottom right
194-
paintBaseFixedTransmitting();
194+
paintXmittingRTCM();
195195
break;
196196
case (STATE_BASE_FIXED_WIFI_STARTED):
197197
icons = paintWirelessIcon() //Top left
198198
| ICON_BASE_FIXED //Top center
199199
| ICON_BATTERY //Top right
200200
| ICON_LOGGING; //Bottom right
201-
paintBaseFixedWiFiStarted();
201+
paintXmittingRTCM();
202202
break;
203203
case (STATE_BASE_FIXED_WIFI_CONNECTED):
204204
icons = paintWirelessIcon() //Top left
205205
| ICON_BASE_FIXED //Top center
206206
| ICON_BATTERY //Top right
207207
| ICON_LOGGING; //Bottom right
208-
paintBaseFixedWiFiConnected();
208+
paintXmittingRTCM();
209209
break;
210210
case (STATE_BASE_FIXED_CASTER_STARTED):
211211
icons = paintWirelessIcon() //Top left
@@ -707,58 +707,7 @@ void paintBaseTempSurveyStarted()
707707
}
708708

709709
//Show transmission of RTCM packets
710-
void paintBaseTempTransmitting()
711-
{
712-
int textX = 1;
713-
int textY = 17;
714-
int textKerning = 8;
715-
oled.setFont(QW_FONT_8X16);
716-
printTextwithKerning("Xmitting", textX, textY, textKerning);
717-
718-
oled.setCursor(0, 39); //x, y
719-
oled.setFont(QW_FONT_5X7);
720-
oled.print("RTCM:");
721-
722-
if (rtcmPacketsSent < 100)
723-
oled.setCursor(30, 36); //x, y - Give space for two digits
724-
else
725-
oled.setCursor(28, 36); //x, y - Push towards colon to make room for log icon
726-
727-
oled.setFont(QW_FONT_8X16); //Set font to type 1: 8x16
728-
oled.print(rtcmPacketsSent); //rtcmPacketsSent is controlled in processRTCM()
729-
730-
paintResets();
731-
}
732-
733-
//Show transmission of RTCM packets
734-
//Blink WiFi icon
735-
void paintBaseTempWiFiStarted()
736-
{
737-
int textX = 1;
738-
int textY = 17;
739-
int textKerning = 8;
740-
oled.setFont(QW_FONT_8X16);
741-
printTextwithKerning("Xmitting", textX, textY, textKerning);
742-
743-
oled.setCursor(0, 39); //x, y
744-
oled.setFont(QW_FONT_5X7);
745-
oled.print("RTCM:");
746-
747-
if (rtcmPacketsSent < 100)
748-
oled.setCursor(30, 36); //x, y - Give space for two digits
749-
else
750-
oled.setCursor(28, 36); //x, y - Push towards colon to make room for log icon
751-
752-
oled.setFont(QW_FONT_8X16); //Set font to type 1: 8x16
753-
oled.print(rtcmPacketsSent); //rtcmPacketsSent is controlled in processRTCM()
754-
755-
paintResets();
756-
}
757-
758-
//Show transmission of RTCM packets
759-
//Solid WiFi icon
760-
//This is identical to paintBaseTempWiFiStarted
761-
void paintBaseTempWiFiConnected()
710+
void paintXmittingRTCM()
762711
{
763712
int textX = 1;
764713
int textY = 17;
@@ -824,81 +773,6 @@ void paintBaseTempCasterConnected()
824773
paintResets();
825774
}
826775

827-
//Show transmission of RTCM packets
828-
void paintBaseFixedTransmitting()
829-
{
830-
int textX = 1;
831-
int textY = 17;
832-
int textKerning = 8;
833-
oled.setFont(QW_FONT_8X16);
834-
printTextwithKerning("Xmitting", textX, textY, textKerning);
835-
836-
oled.setCursor(0, 39); //x, y
837-
oled.setFont(QW_FONT_5X7);
838-
oled.print("RTCM:");
839-
840-
if (rtcmPacketsSent < 100)
841-
oled.setCursor(30, 36); //x, y - Give space for two digits
842-
else
843-
oled.setCursor(28, 36); //x, y - Push towards colon to make room for log icon
844-
845-
oled.setFont(QW_FONT_8X16); //Set font to type 1: 8x16
846-
oled.print(rtcmPacketsSent); //rtcmPacketsSent is controlled in processRTCM()
847-
848-
paintResets();
849-
}
850-
851-
//Show transmission of RTCM packets
852-
//Blink WiFi icon
853-
void paintBaseFixedWiFiStarted()
854-
{
855-
int textX = 1;
856-
int textY = 17;
857-
int textKerning = 8;
858-
oled.setFont(QW_FONT_8X16);
859-
printTextwithKerning("Xmitting", textX, textY, textKerning);
860-
861-
oled.setCursor(0, 39); //x, y
862-
oled.setFont(QW_FONT_5X7);
863-
oled.print("RTCM:");
864-
865-
if (rtcmPacketsSent < 100)
866-
oled.setCursor(30, 36); //x, y - Give space for two digits
867-
else
868-
oled.setCursor(28, 36); //x, y - Push towards colon to make room for log icon
869-
870-
oled.setFont(QW_FONT_8X16); //Set font to type 1: 8x16
871-
oled.print(rtcmPacketsSent); //rtcmPacketsSent is controlled in processRTCM()
872-
873-
paintResets();
874-
}
875-
876-
//Show transmission of RTCM packets
877-
//Solid WiFi icon
878-
//This is identical to paintBaseTempWiFiStarted
879-
void paintBaseFixedWiFiConnected()
880-
{
881-
int textX = 1;
882-
int textY = 17;
883-
int textKerning = 8;
884-
oled.setFont(QW_FONT_8X16);
885-
printTextwithKerning("Xmitting", textX, textY, textKerning);
886-
887-
oled.setCursor(0, 39); //x, y
888-
oled.setFont(QW_FONT_5X7);
889-
oled.print("RTCM:");
890-
891-
if (rtcmPacketsSent < 100)
892-
oled.setCursor(30, 36); //x, y - Give space for two digits
893-
else
894-
oled.setCursor(28, 36); //x, y - Push towards colon to make room for log icon
895-
896-
oled.setFont(QW_FONT_8X16); //Set font to type 1: 8x16
897-
oled.print(rtcmPacketsSent); //rtcmPacketsSent is controlled in processRTCM()
898-
899-
paintResets();
900-
}
901-
902776
//Show connecting to caster service
903777
//Solid WiFi icon
904778
void paintBaseFixedCasterStarted()

0 commit comments

Comments
 (0)