Skip to content

Commit

Permalink
fix #179 build issue due to non-ascii character in a class name
Browse files Browse the repository at this point in the history
  • Loading branch information
mkrupczak3 committed Nov 20, 2024
1 parent 97a1978 commit eca82a8
Show file tree
Hide file tree
Showing 9 changed files with 21 additions and 21 deletions.
12 changes: 6 additions & 6 deletions app/src/main/java/com/openathena/AthenaActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public enum outputModes {
MGRS10m,
MGRS100m,
CK42Geodetic,
CK42GaussKrüger
CK42GaussKruger
}


Expand All @@ -81,7 +81,7 @@ public String getCurrentOutputModeName() {
return getString(R.string.nato_mgrs_100m);
case CK42Geodetic:
return getString(R.string.ck_42_lat_lon);
case CK42GaussKrüger:
case CK42GaussKruger:
return getString(R.string.ck_42_gauss_kruger_n_e);
}
return ""; // this should never happen
Expand Down Expand Up @@ -271,19 +271,19 @@ public void setOutputMode(int mode) {
case 8:
prefsEditor.putInt("outputMode", mode);
prefsEditor.apply(); // make the outputMode change persistent
outputMode = outputModes.CK42GaussKrüger; // An alternative geodetic system using the Krasovsky 1940 ellipsoid. Northing defined by X value, and Easting defined by Y value describe an exact position on Earth
outputMode = outputModes.CK42GaussKruger; // An alternative geodetic system using the Krasovsky 1940 ellipsoid. Northing defined by X value, and Easting defined by Y value describe an exact position on Earth
// There is no reason anyone would ever use anything but Meter as the unit for CK42
setMeasurementUnit(measurementUnits.METER);
if (outputModeRadioGroup != null && outputModeRadioGroup.getVisibility() == View.VISIBLE) {
outputModeRadioGroup.check(R.id.radioButtonCK42GaussKrüger);
outputModeRadioGroup.check(R.id.radioButtonCK42GaussKruger);
}
if (textViewTargetCoord != null && textViewTargetCoord.getVisibility() == View.VISIBLE) {
if(!isTargetCoordDisplayed) {
textViewTargetCoord.setText("\uD83C\uDFAF " + getString(R.string.ck_42_gauss_kruger_n_e));
isTargetCoordDisplayed = false;
}
}
Log.i(TAG, "Output mode changed to CK42 GaussKrüger");
Log.i(TAG, "Output mode changed to CK42 GaussKruger");
break;
default:
Log.e(TAG, "ERROR: unrecognized value for output mode: " + mode + ". reverting to WGS84...");
Expand Down Expand Up @@ -718,7 +718,7 @@ protected void onDestroy()
} // onDestroy()

public boolean outputModeIsSlavic() {
return (outputMode == outputModes.CK42GaussKrüger || outputMode == outputModes.CK42Geodetic);
return (outputMode == outputModes.CK42GaussKruger || outputMode == outputModes.CK42Geodetic);
}

public boolean outputModeIsMGRS() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
//
// GPL-v3.0

public class CK42_Gauss_Krüger_Translator {
public class CK42_Gauss_Kruger_Translator {
// Параметры эллипсоида Красовского // Parameters of the Krasovsky ellipsoid
static final double a = WGS84_CK42_Geodetic_Translator.aP;
static final double b = 6356863.019d; // Малая (полярная) полуось // Small (polar) semi-axis
Expand All @@ -16,7 +16,7 @@ public class CK42_Gauss_Krüger_Translator {
static final double F = 1.0d; // Масштабный коэффициент // Scale factor
static final double Lat0 = 0.0d; // Начальная параллель (в радианах) // Initial parallel (in radians)

public static long[] CK42_Geodetic_to_Gauss_Krüger(double CK42_LatDegrees, double CK42_LonDegrees) {
public static long[] CK42_Geodetic_to_Gauss_Kruger(double CK42_LatDegrees, double CK42_LonDegrees) {
while (CK42_LonDegrees < 0.0d) {
CK42_LonDegrees += 360.0d;
}
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/java/com/openathena/CoordTranslator.java
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ public static String toSelectedOutputMode(double latitude, double longitude, Ath
// This conversion introduces some inaccuracy due to lack of ellipsoidal height
// therefore, result should only be used for unimportant uses such as for dem bounds UI
return roundDouble(toCK42Lat(latitude,longitude,0.0d)) + "," + " " + roundDouble(toCK42Lon(latitude,longitude,0.0d));
case CK42GaussKrüger:
case CK42GaussKruger:
// This conversion introduces some inaccuracy due to lack of ellipsoidal height
// therefore, result should only be used for unimportant uses such as for dem bounds UI
return toCK42_GK_String(latitude, longitude, 0.0d);
Expand Down Expand Up @@ -221,7 +221,7 @@ public static double fromCK42Alt(double CK42_latitude, double CK42_longitude, do
}

public static long[] fromCK42toCK42_GK(double CK42_latitude, double CK42_longitude) {
return CK42_Gauss_Krüger_Translator.CK42_Geodetic_to_Gauss_Krüger(CK42_latitude, CK42_longitude);
return CK42_Gauss_Kruger_Translator.CK42_Geodetic_to_Gauss_Kruger(CK42_latitude, CK42_longitude);
}

public static String makeGKHumanReadable(long GK) {
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/java/com/openathena/DemDetailsActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ protected void onResume()
String teletypeTextFlag = "<tt>"; // this tag is deprecated in HTML5, too bad we use it anyways
// "<pre>" // proper tag for current rev HTML, does not seem to work with Android

if(outputModeIsMGRS() || outputMode == outputModes.UTM || outputMode == outputModes.CK42GaussKrüger) { // For Grid-based output modes
if(outputModeIsMGRS() || outputMode == outputModes.UTM || outputMode == outputModes.CK42GaussKruger) { // For Grid-based output modes
htmlString += "DEM lat/lon bounds (" + getCurrentOutputModeName() + "):" + "<br>";
htmlString += teletypeTextFlag;
htmlString += "NW: " + CoordTranslator.toSelectedOutputMode(maxLat,minLon,outputMode) + "<br>";
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/java/com/openathena/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -1005,7 +1005,7 @@ public void calculateImage(View view, boolean shouldISendCoT)
targetCoordString += " ";
}
targetCoordString += "Alt: " + altCK42 + "m";
} else if (outputMode == outputModes.CK42GaussKrüger) {
} else if (outputMode == outputModes.CK42GaussKruger) {
String northing_string = CoordTranslator.makeGKHumanReadable(GK_northing);
String easting_string = CoordTranslator.makeGKHumanReadable(GK_easting);
// Note that for CK-42, height above ellipsoid is used rather than above mean sea level
Expand Down Expand Up @@ -1156,7 +1156,7 @@ public void copyTargetCoordText(View view) {
Log.d(TAG, "clipboard text: " + text);
text = text.replaceAll("<[^>]*>", ""); // remove HTML link tag(s)
// don't remove newline characters for copy/paste text if output mode is CK42 GK gridref
if (outputMode != outputModes.CK42GaussKrüger) {
if (outputMode != outputModes.CK42GaussKruger) {
text = text.replaceAll("<br>", ""); // remove HTML <br> newlines
text = text.replaceAll("(\r\n|\n)", ""); // remove string literal newlines
}
Expand Down
8 changes: 4 additions & 4 deletions app/src/main/java/com/openathena/PrefsActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,9 @@ public void onCheckedChanged(RadioGroup group, int checkedId) {
if (outputMode != outputModes.CK42Geodetic) {
setOutputMode(outputModes.CK42Geodetic);
}
} else if (checkedId == R.id.radioButtonCK42GaussKrüger) {
if (outputMode != outputModes.CK42GaussKrüger) {
setOutputMode(outputModes.CK42GaussKrüger);
} else if (checkedId == R.id.radioButtonCK42GaussKruger) {
if (outputMode != outputModes.CK42GaussKruger) {
setOutputMode(outputModes.CK42GaussKruger);
}
} else {
setOutputMode(-1); // should never happen
Expand Down Expand Up @@ -192,4 +192,4 @@ public void prefsReset(View view)
//
// } // appendLog()

}
}
4 changes: 2 additions & 2 deletions app/src/main/res/layout-land/activity_prefs.xml
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@
android:tooltipText="@string/ck_42_geodetic_tooltip" />

<RadioButton
android:id="@+id/radioButtonCK42GaussKrüger"
android:id="@+id/radioButtonCK42GaussKruger"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:minHeight="48dp"
Expand Down Expand Up @@ -205,4 +205,4 @@
android:text="@string/us_foot_label" />
</RadioGroup>

</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
2 changes: 1 addition & 1 deletion app/src/main/res/layout/activity_prefs.xml
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@
android:tooltipText="@string/ck_42_geodetic_tooltip" />

<RadioButton
android:id="@+id/radioButtonCK42GaussKrüger"
android:id="@+id/radioButtonCK42GaussKruger"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="8dp"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public class CK42_Gauss_Krüger_TranslatorTest {
// https://mapshow.s3.eu-west-2.amazonaws.com/N-33-123-4.html
@Test
public void testCK42_Geodetic_to_Gauss_Krüger() {
long[] results = CK42_Gauss_Krüger_Translator.CK42_Geodetic_to_Gauss_Krüger(52.48969955423094, 13.484073132860129);
long[] results = CK42_Gauss_Kruger_Translator.CK42_Geodetic_to_Gauss_Kruger(52.48969955423094, 13.484073132860129);
assertEquals(5819, results[0] / 1000); // Easting line (latitude) in Km
assertEquals(3397, results[1] / 1000); // Northing line (longitude) in Km
}
Expand Down

0 comments on commit eca82a8

Please sign in to comment.