mirror of
https://github.com/barbeau/gpstest.git
synced 2025-12-05 18:46:30 -06:00
feat: Add SouthPAN support (#601)
Closes https://github.com/barbeau/gpstest/issues/271.
This commit is contained in:
@@ -644,6 +644,41 @@ class CarrierFreqUtilsTest {
|
||||
|
||||
label = CarrierFreqUtils.getCarrierFrequencyLabel(sdcm125L5)
|
||||
assertEquals("L5", label)
|
||||
|
||||
// INMARSAT_4F1 (SBAS)
|
||||
|
||||
// SouthPAN - ID 122 L1
|
||||
val southpan122L1 = SatelliteStatus(122,
|
||||
GnssType.SBAS,
|
||||
30f,
|
||||
true,
|
||||
true,
|
||||
true,
|
||||
72f,
|
||||
25f);
|
||||
southpan122L1.hasCarrierFrequency = true
|
||||
southpan122L1.carrierFrequencyHz = 1575420000.0
|
||||
southpan122L1.sbasType = SbasType.SOUTHPAN
|
||||
|
||||
label = CarrierFreqUtils.getCarrierFrequencyLabel(southpan122L1)
|
||||
assertEquals("L1", label)
|
||||
|
||||
// SouthPAN - ID 122 L5
|
||||
val southpan122L5 = SatelliteStatus(122,
|
||||
GnssType.SBAS,
|
||||
30f,
|
||||
true,
|
||||
true,
|
||||
true,
|
||||
72f,
|
||||
25f);
|
||||
southpan122L5.hasCarrierFrequency = true
|
||||
southpan122L5.carrierFrequencyHz = 1176450000.0
|
||||
southpan122L5.sbasType = SbasType.SOUTHPAN
|
||||
|
||||
label = CarrierFreqUtils.getCarrierFrequencyLabel(southpan122L5)
|
||||
assertEquals("L5", label)
|
||||
|
||||
|
||||
// Test variations on the "same" numbers to make sure floating point equality works
|
||||
val gpsL1variation = SatelliteStatus(1,
|
||||
|
||||
@@ -263,6 +263,9 @@ fun SbasFlag(status: SatelliteStatus, modifier: Modifier = Modifier) {
|
||||
SbasType.SACCSA -> {
|
||||
FlagImage(R.drawable.ic_flag_icao, R.string.saccsa_content_description, modifier)
|
||||
}
|
||||
SbasType.SOUTHPAN -> {
|
||||
FlagImage(R.drawable.ic_flag_southpan, R.string.southpan_content_description, modifier)
|
||||
}
|
||||
SbasType.UNKNOWN -> {
|
||||
Box(
|
||||
modifier = modifier
|
||||
@@ -436,4 +439,4 @@ fun NotAvailableText(text: String) {
|
||||
@Composable
|
||||
fun StatusRowFooter() {
|
||||
Spacer(modifier = Modifier.padding(bottom = 5.dp))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -684,6 +684,55 @@
|
||||
android:layout_margin="5dp"
|
||||
android:text="@string/sky_legend_shape_saccsa" />
|
||||
</TableRow>
|
||||
|
||||
<TableRow
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/sky_legend_diamond8"
|
||||
android:layout_width="@dimen/sky_legend_shape_size"
|
||||
android:layout_height="@dimen/sky_legend_shape_size"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_margin="5dp"
|
||||
app:srcCompat="@drawable/diamond"
|
||||
android:contentDescription="@string/diamond"/>
|
||||
|
||||
<View
|
||||
android:id="@+id/sky_legend_shape_line17a"
|
||||
android:layout_width="@dimen/sky_legend_shape_small_line"
|
||||
android:layout_height="1dp"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_margin="5dp"
|
||||
android:background="@color/body_text_2_light" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/legend_flag_southpan"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_margin="5dp"
|
||||
android:background="@color/body_text_2_light"
|
||||
android:padding="1dp"
|
||||
app:srcCompat="@drawable/ic_flag_southpan"
|
||||
android:contentDescription="@string/southpan_flag"/>
|
||||
|
||||
<View
|
||||
android:id="@+id/sky_legend_shape_line17b"
|
||||
android:layout_width="@dimen/sky_legend_shape_small_line"
|
||||
android:layout_height="1dp"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_margin="5dp"
|
||||
android:background="@color/body_text_2_light" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/sky_southpan_text"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="5dp"
|
||||
android:text="@string/sky_legend_shape_southpan" />
|
||||
</TableRow>
|
||||
|
||||
</TableLayout>
|
||||
|
||||
<TextView
|
||||
@@ -793,4 +842,4 @@
|
||||
</TableRow>
|
||||
</TableLayout>
|
||||
</RelativeLayout>
|
||||
</androidx.cardview.widget.CardView>
|
||||
</androidx.cardview.widget.CardView>
|
||||
|
||||
@@ -30,6 +30,7 @@ It supports dual-frequency¹ GNSS for:
|
||||
* System for Differential Corrections and Monitoring (SDCM) (Russia)
|
||||
* Satellite Navigation Augmentation System (SNAS) (China)
|
||||
* Soluciόn de Aumentaciόn para Caribe, Centro y Sudamérica (SACCSA) (ICAO)
|
||||
* Southern Positioning Augmentation Network (SouthPAN) (Australia / New Zealand)
|
||||
|
||||
¹*Dual-frequency GNSS requires device hardware support and Android 8.0 Oreo or higher. See [Dual-frequency GNSS on Android](https://medium.com/@sjbarbeau/dual-frequency-gnss-on-android-devices-152b8826e1c) for more details.*
|
||||
|
||||
|
||||
BIN
icons/SouthPANLogo-Cropped-Positive-CMYK.jpg
Normal file
BIN
icons/SouthPANLogo-Cropped-Positive-CMYK.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 84 KiB |
@@ -19,5 +19,5 @@ package com.android.gpstest.library.model;
|
||||
* Types of Global Navigation Satellite Systems
|
||||
*/
|
||||
public enum SatelliteName {
|
||||
ANIK, GALAXY_15, INMARSAT_3F2, INMARSAT_3F5, INMARSAT_4F3, SES_5, ASTRA_5B, GEO5, UNKNOWN
|
||||
ANIK, GALAXY_15, INMARSAT_3F2, INMARSAT_3F5, INMARSAT_4F1, INMARSAT_4F3, SES_5, ASTRA_5B, GEO5, UNKNOWN
|
||||
}
|
||||
|
||||
@@ -21,5 +21,5 @@ package com.android.gpstest.library.model;
|
||||
* http://mgex.igs.org/IGS_MGEX_Status_SBAS.php.
|
||||
*/
|
||||
public enum SbasType {
|
||||
WAAS, EGNOS, GAGAN, MSAS, SDCM, SNAS, SACCSA, UNKNOWN
|
||||
WAAS, EGNOS, GAGAN, MSAS, SDCM, SNAS, SACCSA, SOUTHPAN, UNKNOWN
|
||||
}
|
||||
|
||||
@@ -211,6 +211,13 @@ public class CarrierFreqUtils {
|
||||
} else if (MathUtils.fuzzyEquals(carrierFrequencyMhz, 1176.45, CF_TOLERANCE_MHZ)) {
|
||||
return "L5";
|
||||
}
|
||||
} else if (svid == 122) {
|
||||
// SouthPAN (Australia/New Zealand)
|
||||
if (MathUtils.fuzzyEquals(carrierFrequencyMhz, 1575.42, CF_TOLERANCE_MHZ)) {
|
||||
return "L1";
|
||||
} else if (MathUtils.fuzzyEquals(carrierFrequencyMhz, 1176.45, CF_TOLERANCE_MHZ)) {
|
||||
return "L5";
|
||||
}
|
||||
} else if (svid == 129 || svid == 137 || svid == 139) {
|
||||
// MSAS (Japan) - https://gssc.esa.int/navipedia/index.php/MSAS_Space_Segment
|
||||
if (MathUtils.fuzzyEquals(carrierFrequencyMhz, 1575.42, CF_TOLERANCE_MHZ)) {
|
||||
|
||||
@@ -302,7 +302,9 @@ object SatelliteUtil {
|
||||
return SbasType.GAGAN
|
||||
} else if (this == 129 || this == 137) {
|
||||
return SbasType.MSAS
|
||||
} else if (this == 122) {
|
||||
return SbasType.SOUTHPAN
|
||||
}
|
||||
return SbasType.UNKNOWN
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -64,6 +64,8 @@ public class SatelliteUtils {
|
||||
case SBAS:
|
||||
if (svid == 120) {
|
||||
return SatelliteName.INMARSAT_3F2;
|
||||
} else if (svid == 122) {
|
||||
return SatelliteName.INMARSAT_4F1;
|
||||
} else if (svid == 123) {
|
||||
return SatelliteName.ASTRA_5B;
|
||||
} else if (svid == 126) {
|
||||
|
||||
BIN
library/src/main/res/drawable-hdpi/ic_flag_southpan.png
Normal file
BIN
library/src/main/res/drawable-hdpi/ic_flag_southpan.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.3 KiB |
BIN
library/src/main/res/drawable-mdpi/ic_flag_southpan.png
Normal file
BIN
library/src/main/res/drawable-mdpi/ic_flag_southpan.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.0 KiB |
BIN
library/src/main/res/drawable-xhdpi/ic_flag_southpan.png
Normal file
BIN
library/src/main/res/drawable-xhdpi/ic_flag_southpan.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.3 KiB |
BIN
library/src/main/res/drawable-xxhdpi/ic_flag_southpan.png
Normal file
BIN
library/src/main/res/drawable-xxhdpi/ic_flag_southpan.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.0 KiB |
BIN
library/src/main/res/drawable-xxxhdpi/ic_flag_southpan.png
Normal file
BIN
library/src/main/res/drawable-xxxhdpi/ic_flag_southpan.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.5 KiB |
@@ -149,6 +149,7 @@
|
||||
<string name="sdcm_content_description">SDCM</string>
|
||||
<string name="snas_content_description">SNAS</string>
|
||||
<string name="saccsa_content_description">SACCSA</string>
|
||||
<string name="southpan_content_description">SouthPAN</string>
|
||||
|
||||
<!-- Map view -->
|
||||
<string name="ground_truth_latitude">Your latitude</string>
|
||||
@@ -193,6 +194,7 @@
|
||||
<string name="sky_legend_shape_sdcm">SDCM (Russia)</string>
|
||||
<string name="sky_legend_shape_snas">BDSBAS/SNAS (China)</string>
|
||||
<string name="sky_legend_shape_saccsa">SACCSA (ICAO)</string>
|
||||
<string name="sky_legend_shape_southpan">SouthPAN (Australia / New Zealand)</string>
|
||||
|
||||
<string name="sky_legend_shape_availability_title">Signal Availability</string>
|
||||
<string name="sky_legend_shape_not_in_view">Not in view of device</string>
|
||||
@@ -208,6 +210,7 @@
|
||||
<string name="japan_flag">Japan flag</string>
|
||||
<string name="india_flag">India flag</string>
|
||||
<string name="icao_flag">ICAO flag</string>
|
||||
<string name="southpan_flag">SouthPAN flag</string>
|
||||
|
||||
<string name="circle">circle</string>
|
||||
<string name="square">square</string>
|
||||
@@ -457,7 +460,7 @@
|
||||
- Pentagons\n•\u0020
|
||||
<b>IRNSS/NavIC (India)</b>
|
||||
- Ovals\n•\u0020
|
||||
<b>SBAS (WAAS, EGNOS, GAGAN, MSAS, SDCM, BDSBAS/SNAS, SACCSA)</b>
|
||||
<b>SBAS (WAAS, EGNOS, GAGAN, MSAS, SDCM, BDSBAS/SNAS, SACCSA, SouthPAN)</b>
|
||||
- Diamonds\n\n
|
||||
|
||||
•\u0020 Transparent satellites - Not in view\n
|
||||
@@ -485,6 +488,7 @@
|
||||
•\u0020 <b>Mike Lockwood</b> - original developer for v1.x\n
|
||||
•\u0020 <b>Sean Barbeau</b> - developer for v2.x and higher\n
|
||||
•\u0020 GPSTest launcher icon is derived from the Android Material Design "satellite" icon, licensed by Google under Apache v2.0. Other Google material design icons are also used under Apache v2.0. QR code icon by Austin Andrews from https://materialdesignicons.com/icon/qrcode.\n
|
||||
•\u0020 Land Information New Zealand has approved use of the SouthPAN logo for the GPSTest open-source application. For further information, please contact southpan@linz.govt.nz \n
|
||||
•\u0020 Chinese translation provided by wangkf, liuyunli, SakuraSa233 & Skimige\n
|
||||
•\u0020 German translation provided by SIRSteiner\n
|
||||
•\u0020 Dutch translation provided by Dennis Dolman, Meteor0id\n
|
||||
|
||||
@@ -323,6 +323,9 @@ fun SbasFlag(status: SatelliteStatus, modifier: Modifier = Modifier) {
|
||||
SbasType.SACCSA -> {
|
||||
FlagImage(R.drawable.ic_flag_icao, R.string.saccsa_content_description, modifier)
|
||||
}
|
||||
SbasType.SOUTHPAN -> {
|
||||
FlagImage(R.drawable.ic_flag_southpan, R.string.southpan_content_description, modifier)
|
||||
}
|
||||
SbasType.UNKNOWN -> {
|
||||
Box(
|
||||
modifier = modifier
|
||||
|
||||
Reference in New Issue
Block a user