diff --git a/Prakti_elster_20.11.2022_21.24.pfx b/Prakti_elster_20.11.2022_21.24.pfx deleted file mode 100644 index 1a24767..0000000 Binary files a/Prakti_elster_20.11.2022_21.24.pfx and /dev/null differ diff --git a/src/main/java/kst4contest/locatorUtils/Location.java b/src/main/java/kst4contest/locatorUtils/Location.java index 6903c55..0535dc1 100644 --- a/src/main/java/kst4contest/locatorUtils/Location.java +++ b/src/main/java/kst4contest/locatorUtils/Location.java @@ -1,5 +1,10 @@ package kst4contest.locatorUtils; +import java.text.DecimalFormat; +import java.text.NumberFormat; +import java.text.ParseException; +import java.util.Locale; + /** * Location class with methods allowing conversion to and from Maidenhead * locator (grid squares) based off of @@ -203,6 +208,28 @@ public class Location { return getDistanceKm(this, loc2); } + /** + * @param locator1 6 letter location string + * @param locator2 6 letter location string + * @return great circle distance in kilometers + */ + public double getDistanceKmByTwoLocatorStrings(String locator1,String locator2 ) { + Location loc1 = new Location(locator1); + Location loc2 = new Location(locator2); + + Locale locale = new Locale("en", "UK"); + String pattern = "###.##"; + + DecimalFormat decimalFormat = (DecimalFormat) + NumberFormat.getNumberInstance(locale); + decimalFormat.applyPattern(pattern); + + String format = decimalFormat.format(loc1.getDistanceKm(loc2)); + +// return df.format(number); + return Double.parseDouble(format); + } + /** * @param loc2 * second location @@ -278,6 +305,19 @@ public class Location { return getBearing(this, loc2); } + + /** + * + * @return bearing in degrees + */ + public double getBearingOfTwoLocatorStrings(String locator1, String locator2) { + + Location loc1 = new Location(locator1); + Location loc2 = new Location(locator2); + + return getBearing(loc1, loc2); + } + /** * @param loc1 * source location diff --git a/LTTR0.mp3 b/src/main/resources/LTTR0.mp3 similarity index 100% rename from LTTR0.mp3 rename to src/main/resources/LTTR0.mp3 diff --git a/LTTR1.mp3 b/src/main/resources/LTTR1.mp3 similarity index 100% rename from LTTR1.mp3 rename to src/main/resources/LTTR1.mp3 diff --git a/LTTR2.mp3 b/src/main/resources/LTTR2.mp3 similarity index 100% rename from LTTR2.mp3 rename to src/main/resources/LTTR2.mp3 diff --git a/LTTR3.mp3 b/src/main/resources/LTTR3.mp3 similarity index 100% rename from LTTR3.mp3 rename to src/main/resources/LTTR3.mp3 diff --git a/LTTR4.mp3 b/src/main/resources/LTTR4.mp3 similarity index 100% rename from LTTR4.mp3 rename to src/main/resources/LTTR4.mp3 diff --git a/LTTR5.mp3 b/src/main/resources/LTTR5.mp3 similarity index 100% rename from LTTR5.mp3 rename to src/main/resources/LTTR5.mp3 diff --git a/LTTR6.mp3 b/src/main/resources/LTTR6.mp3 similarity index 100% rename from LTTR6.mp3 rename to src/main/resources/LTTR6.mp3 diff --git a/LTTR7.mp3 b/src/main/resources/LTTR7.mp3 similarity index 100% rename from LTTR7.mp3 rename to src/main/resources/LTTR7.mp3 diff --git a/LTTR8.mp3 b/src/main/resources/LTTR8.mp3 similarity index 100% rename from LTTR8.mp3 rename to src/main/resources/LTTR8.mp3 diff --git a/LTTR9.mp3 b/src/main/resources/LTTR9.mp3 similarity index 100% rename from LTTR9.mp3 rename to src/main/resources/LTTR9.mp3 diff --git a/LTTRA.mp3 b/src/main/resources/LTTRA.mp3 similarity index 100% rename from LTTRA.mp3 rename to src/main/resources/LTTRA.mp3 diff --git a/LTTRB.mp3 b/src/main/resources/LTTRB.mp3 similarity index 100% rename from LTTRB.mp3 rename to src/main/resources/LTTRB.mp3 diff --git a/LTTRC.mp3 b/src/main/resources/LTTRC.mp3 similarity index 100% rename from LTTRC.mp3 rename to src/main/resources/LTTRC.mp3 diff --git a/LTTRD.mp3 b/src/main/resources/LTTRD.mp3 similarity index 100% rename from LTTRD.mp3 rename to src/main/resources/LTTRD.mp3 diff --git a/LTTRE.mp3 b/src/main/resources/LTTRE.mp3 similarity index 100% rename from LTTRE.mp3 rename to src/main/resources/LTTRE.mp3 diff --git a/LTTRF.mp3 b/src/main/resources/LTTRF.mp3 similarity index 100% rename from LTTRF.mp3 rename to src/main/resources/LTTRF.mp3 diff --git a/LTTRG.mp3 b/src/main/resources/LTTRG.mp3 similarity index 100% rename from LTTRG.mp3 rename to src/main/resources/LTTRG.mp3 diff --git a/LTTRH.mp3 b/src/main/resources/LTTRH.mp3 similarity index 100% rename from LTTRH.mp3 rename to src/main/resources/LTTRH.mp3 diff --git a/LTTRI.mp3 b/src/main/resources/LTTRI.mp3 similarity index 100% rename from LTTRI.mp3 rename to src/main/resources/LTTRI.mp3 diff --git a/LTTRJ.mp3 b/src/main/resources/LTTRJ.mp3 similarity index 100% rename from LTTRJ.mp3 rename to src/main/resources/LTTRJ.mp3 diff --git a/LTTRK.mp3 b/src/main/resources/LTTRK.mp3 similarity index 100% rename from LTTRK.mp3 rename to src/main/resources/LTTRK.mp3 diff --git a/LTTRL.mp3 b/src/main/resources/LTTRL.mp3 similarity index 100% rename from LTTRL.mp3 rename to src/main/resources/LTTRL.mp3 diff --git a/LTTRM.mp3 b/src/main/resources/LTTRM.mp3 similarity index 100% rename from LTTRM.mp3 rename to src/main/resources/LTTRM.mp3 diff --git a/LTTRMINUS.mp3 b/src/main/resources/LTTRMINUS.mp3 similarity index 100% rename from LTTRMINUS.mp3 rename to src/main/resources/LTTRMINUS.mp3 diff --git a/LTTRN.mp3 b/src/main/resources/LTTRN.mp3 similarity index 100% rename from LTTRN.mp3 rename to src/main/resources/LTTRN.mp3 diff --git a/LTTRO.mp3 b/src/main/resources/LTTRO.mp3 similarity index 100% rename from LTTRO.mp3 rename to src/main/resources/LTTRO.mp3 diff --git a/LTTRP.mp3 b/src/main/resources/LTTRP.mp3 similarity index 100% rename from LTTRP.mp3 rename to src/main/resources/LTTRP.mp3 diff --git a/LTTRPOINT.mp3 b/src/main/resources/LTTRPOINT.mp3 similarity index 100% rename from LTTRPOINT.mp3 rename to src/main/resources/LTTRPOINT.mp3 diff --git a/LTTRQ.mp3 b/src/main/resources/LTTRQ.mp3 similarity index 100% rename from LTTRQ.mp3 rename to src/main/resources/LTTRQ.mp3 diff --git a/LTTRQUESTMARK.mp3 b/src/main/resources/LTTRQUESTMARK.mp3 similarity index 100% rename from LTTRQUESTMARK.mp3 rename to src/main/resources/LTTRQUESTMARK.mp3 diff --git a/LTTRR.mp3 b/src/main/resources/LTTRR.mp3 similarity index 100% rename from LTTRR.mp3 rename to src/main/resources/LTTRR.mp3 diff --git a/LTTRS.mp3 b/src/main/resources/LTTRS.mp3 similarity index 100% rename from LTTRS.mp3 rename to src/main/resources/LTTRS.mp3 diff --git a/LTTRSPACE.mp3 b/src/main/resources/LTTRSPACE.mp3 similarity index 100% rename from LTTRSPACE.mp3 rename to src/main/resources/LTTRSPACE.mp3 diff --git a/LTTRSTROKE.mp3 b/src/main/resources/LTTRSTROKE.mp3 similarity index 100% rename from LTTRSTROKE.mp3 rename to src/main/resources/LTTRSTROKE.mp3 diff --git a/LTTRT.mp3 b/src/main/resources/LTTRT.mp3 similarity index 100% rename from LTTRT.mp3 rename to src/main/resources/LTTRT.mp3 diff --git a/LTTRU.mp3 b/src/main/resources/LTTRU.mp3 similarity index 100% rename from LTTRU.mp3 rename to src/main/resources/LTTRU.mp3 diff --git a/LTTRV.mp3 b/src/main/resources/LTTRV.mp3 similarity index 100% rename from LTTRV.mp3 rename to src/main/resources/LTTRV.mp3 diff --git a/LTTRW.mp3 b/src/main/resources/LTTRW.mp3 similarity index 100% rename from LTTRW.mp3 rename to src/main/resources/LTTRW.mp3 diff --git a/LTTRX.mp3 b/src/main/resources/LTTRX.mp3 similarity index 100% rename from LTTRX.mp3 rename to src/main/resources/LTTRX.mp3 diff --git a/LTTRY.mp3 b/src/main/resources/LTTRY.mp3 similarity index 100% rename from LTTRY.mp3 rename to src/main/resources/LTTRY.mp3 diff --git a/LTTRZ.mp3 b/src/main/resources/LTTRZ.mp3 similarity index 100% rename from LTTRZ.mp3 rename to src/main/resources/LTTRZ.mp3 diff --git a/NOISECQWINDOW.mp3 b/src/main/resources/NOISECQWINDOW.mp3 similarity index 100% rename from NOISECQWINDOW.mp3 rename to src/main/resources/NOISECQWINDOW.mp3 diff --git a/NOISEERROR.mp3 b/src/main/resources/NOISEERROR.mp3 similarity index 100% rename from NOISEERROR.mp3 rename to src/main/resources/NOISEERROR.mp3 diff --git a/NOISENOTIFY.mp3 b/src/main/resources/NOISENOTIFY.mp3 similarity index 100% rename from NOISENOTIFY.mp3 rename to src/main/resources/NOISENOTIFY.mp3 diff --git a/NOISEPMWINDOW.mp3 b/src/main/resources/NOISEPMWINDOW.mp3 similarity index 100% rename from NOISEPMWINDOW.mp3 rename to src/main/resources/NOISEPMWINDOW.mp3 diff --git a/NOISESTARTUP.mp3 b/src/main/resources/NOISESTARTUP.mp3 similarity index 100% rename from NOISESTARTUP.mp3 rename to src/main/resources/NOISESTARTUP.mp3 diff --git a/VOICE0.mp3 b/src/main/resources/VOICE0.mp3 similarity index 100% rename from VOICE0.mp3 rename to src/main/resources/VOICE0.mp3 diff --git a/VOICE1.mp3 b/src/main/resources/VOICE1.mp3 similarity index 100% rename from VOICE1.mp3 rename to src/main/resources/VOICE1.mp3 diff --git a/VOICE2.mp3 b/src/main/resources/VOICE2.mp3 similarity index 100% rename from VOICE2.mp3 rename to src/main/resources/VOICE2.mp3 diff --git a/VOICE3.mp3 b/src/main/resources/VOICE3.mp3 similarity index 100% rename from VOICE3.mp3 rename to src/main/resources/VOICE3.mp3 diff --git a/VOICE4.mp3 b/src/main/resources/VOICE4.mp3 similarity index 100% rename from VOICE4.mp3 rename to src/main/resources/VOICE4.mp3 diff --git a/VOICE5.mp3 b/src/main/resources/VOICE5.mp3 similarity index 100% rename from VOICE5.mp3 rename to src/main/resources/VOICE5.mp3 diff --git a/VOICE6.mp3 b/src/main/resources/VOICE6.mp3 similarity index 100% rename from VOICE6.mp3 rename to src/main/resources/VOICE6.mp3 diff --git a/VOICE7.mp3 b/src/main/resources/VOICE7.mp3 similarity index 100% rename from VOICE7.mp3 rename to src/main/resources/VOICE7.mp3 diff --git a/VOICE73.mp3 b/src/main/resources/VOICE73.mp3 similarity index 100% rename from VOICE73.mp3 rename to src/main/resources/VOICE73.mp3 diff --git a/VOICE8.mp3 b/src/main/resources/VOICE8.mp3 similarity index 100% rename from VOICE8.mp3 rename to src/main/resources/VOICE8.mp3 diff --git a/VOICE9.mp3 b/src/main/resources/VOICE9.mp3 similarity index 100% rename from VOICE9.mp3 rename to src/main/resources/VOICE9.mp3 diff --git a/VOICEA.mp3 b/src/main/resources/VOICEA.mp3 similarity index 100% rename from VOICEA.mp3 rename to src/main/resources/VOICEA.mp3 diff --git a/VOICEB.mp3 b/src/main/resources/VOICEB.mp3 similarity index 100% rename from VOICEB.mp3 rename to src/main/resources/VOICEB.mp3 diff --git a/VOICEBELL.mp3 b/src/main/resources/VOICEBELL.mp3 similarity index 100% rename from VOICEBELL.mp3 rename to src/main/resources/VOICEBELL.mp3 diff --git a/VOICEC.mp3 b/src/main/resources/VOICEC.mp3 similarity index 100% rename from VOICEC.mp3 rename to src/main/resources/VOICEC.mp3 diff --git a/VOICED.mp3 b/src/main/resources/VOICED.mp3 similarity index 100% rename from VOICED.mp3 rename to src/main/resources/VOICED.mp3 diff --git a/VOICEE.mp3 b/src/main/resources/VOICEE.mp3 similarity index 100% rename from VOICEE.mp3 rename to src/main/resources/VOICEE.mp3 diff --git a/VOICEF.mp3 b/src/main/resources/VOICEF.mp3 similarity index 100% rename from VOICEF.mp3 rename to src/main/resources/VOICEF.mp3 diff --git a/VOICEG.mp3 b/src/main/resources/VOICEG.mp3 similarity index 100% rename from VOICEG.mp3 rename to src/main/resources/VOICEG.mp3 diff --git a/VOICEH.mp3 b/src/main/resources/VOICEH.mp3 similarity index 100% rename from VOICEH.mp3 rename to src/main/resources/VOICEH.mp3 diff --git a/VOICEHELLO.mp3 b/src/main/resources/VOICEHELLO.mp3 similarity index 100% rename from VOICEHELLO.mp3 rename to src/main/resources/VOICEHELLO.mp3 diff --git a/VOICEI.mp3 b/src/main/resources/VOICEI.mp3 similarity index 100% rename from VOICEI.mp3 rename to src/main/resources/VOICEI.mp3 diff --git a/VOICEJ.mp3 b/src/main/resources/VOICEJ.mp3 similarity index 100% rename from VOICEJ.mp3 rename to src/main/resources/VOICEJ.mp3 diff --git a/VOICEK.mp3 b/src/main/resources/VOICEK.mp3 similarity index 100% rename from VOICEK.mp3 rename to src/main/resources/VOICEK.mp3 diff --git a/VOICEL.mp3 b/src/main/resources/VOICEL.mp3 similarity index 100% rename from VOICEL.mp3 rename to src/main/resources/VOICEL.mp3 diff --git a/VOICEM.mp3 b/src/main/resources/VOICEM.mp3 similarity index 100% rename from VOICEM.mp3 rename to src/main/resources/VOICEM.mp3 diff --git a/VOICEMEEPMEEP.mp3 b/src/main/resources/VOICEMEEPMEEP.mp3 similarity index 100% rename from VOICEMEEPMEEP.mp3 rename to src/main/resources/VOICEMEEPMEEP.mp3 diff --git a/VOICEN.mp3 b/src/main/resources/VOICEN.mp3 similarity index 100% rename from VOICEN.mp3 rename to src/main/resources/VOICEN.mp3 diff --git a/VOICEO.mp3 b/src/main/resources/VOICEO.mp3 similarity index 100% rename from VOICEO.mp3 rename to src/main/resources/VOICEO.mp3 diff --git a/VOICEP.mp3 b/src/main/resources/VOICEP.mp3 similarity index 100% rename from VOICEP.mp3 rename to src/main/resources/VOICEP.mp3 diff --git a/VOICEQ.mp3 b/src/main/resources/VOICEQ.mp3 similarity index 100% rename from VOICEQ.mp3 rename to src/main/resources/VOICEQ.mp3 diff --git a/VOICER.mp3 b/src/main/resources/VOICER.mp3 similarity index 100% rename from VOICER.mp3 rename to src/main/resources/VOICER.mp3 diff --git a/VOICES.mp3 b/src/main/resources/VOICES.mp3 similarity index 100% rename from VOICES.mp3 rename to src/main/resources/VOICES.mp3 diff --git a/VOICESTROKE.mp3 b/src/main/resources/VOICESTROKE.mp3 similarity index 100% rename from VOICESTROKE.mp3 rename to src/main/resources/VOICESTROKE.mp3 diff --git a/VOICESTROKEPORTABLE.mp3 b/src/main/resources/VOICESTROKEPORTABLE.mp3 similarity index 100% rename from VOICESTROKEPORTABLE.mp3 rename to src/main/resources/VOICESTROKEPORTABLE.mp3 diff --git a/VOICET.mp3 b/src/main/resources/VOICET.mp3 similarity index 100% rename from VOICET.mp3 rename to src/main/resources/VOICET.mp3 diff --git a/VOICEU.mp3 b/src/main/resources/VOICEU.mp3 similarity index 100% rename from VOICEU.mp3 rename to src/main/resources/VOICEU.mp3 diff --git a/VOICEV.mp3 b/src/main/resources/VOICEV.mp3 similarity index 100% rename from VOICEV.mp3 rename to src/main/resources/VOICEV.mp3 diff --git a/VOICEW.mp3 b/src/main/resources/VOICEW.mp3 similarity index 100% rename from VOICEW.mp3 rename to src/main/resources/VOICEW.mp3 diff --git a/VOICEX.mp3 b/src/main/resources/VOICEX.mp3 similarity index 100% rename from VOICEX.mp3 rename to src/main/resources/VOICEX.mp3 diff --git a/VOICEY.mp3 b/src/main/resources/VOICEY.mp3 similarity index 100% rename from VOICEY.mp3 rename to src/main/resources/VOICEY.mp3 diff --git a/VOICEYOUGOTMAIL.mp3 b/src/main/resources/VOICEYOUGOTMAIL.mp3 similarity index 100% rename from VOICEYOUGOTMAIL.mp3 rename to src/main/resources/VOICEYOUGOTMAIL.mp3 diff --git a/VOICEZ.mp3 b/src/main/resources/VOICEZ.mp3 similarity index 100% rename from VOICEZ.mp3 rename to src/main/resources/VOICEZ.mp3 diff --git a/sk.mp3 b/src/main/resources/sk.mp3 similarity index 100% rename from sk.mp3 rename to src/main/resources/sk.mp3 diff --git a/src/test/java/kst4contest/test/TestLocatorUtils.java b/src/test/java/kst4contest/test/TestLocatorUtils.java new file mode 100644 index 0000000..076d062 --- /dev/null +++ b/src/test/java/kst4contest/test/TestLocatorUtils.java @@ -0,0 +1,38 @@ +package kst4contest.test; + +import kst4contest.locatorUtils.Angle; +import kst4contest.locatorUtils.Latitude; +import kst4contest.locatorUtils.Location; +import kst4contest.locatorUtils.Longitude; + +import java.text.DecimalFormat; + +public class TestLocatorUtils { + + public static void main(String[] args) { + Location location = new Location("JN49FL"); + Location location2 = new Location("JO51IJ"); + +// System.out.println(location.getDistanceKm(location2)); +// System.out.println(Location.getBearing(location, location2)); + + + System.out.println(new Location().getDistanceKmByTwoLocatorStrings("JN49FL", "Jo51ij") + ""); + +// String test = new Location().getDistanceKmByTwoLocatorStrings("JN49FL", "Jo51ij") + ""; +// +// DecimalFormat df = new DecimalFormat("#.##"); +// +// System.out.println(df.format(Double.parseDouble(test))); + +// Angle angle = new Angle(); +// Latitude lat = new Latitude(); +// Longitude lon = new Longitude(); +// +// location.setLatitude(lat); +// location.setLongitude(lon); + + + + } +}