Revert "require location param when initialising a sentence"

This reverts commit b2f118fec6.
pull/8/head
Medad Rufus Newman 2022-05-09 21:50:19 +01:00
rodzic 573579901b
commit 8099769ed3
2 zmienionych plików z 3 dodań i 7 usunięć

Wyświetl plik

@ -86,8 +86,7 @@ public final class PayloadDecoder {
double longitude = sodaq.getLongitude();
double altitude = sodaq.getAltitude();
Instant instant = Instant.ofEpochSecond(sodaq.getTimeStamp());
Location location = new Location(latitude, longitude, altitude);
Sentence sentence = new Sentence(callSign, counter, instant, location);
Sentence sentence = new Sentence(callSign, counter, instant);
sentence.addField("lat", String.format(Locale.ROOT, "%.6f", latitude));
sentence.addField("lon", String.format(Locale.ROOT, "%.6f", longitude));
sentence.addField("alt", String.format(Locale.ROOT, "%.1f", altitude));
@ -117,8 +116,7 @@ public final class PayloadDecoder {
double latitude = parseDouble(fields.get("lat"));
double longitude = parseDouble(fields.get("lon"));
double altitude = parseDouble(fields.get("gpsalt"));
Location location = new Location(latitude, longitude, altitude);
Sentence sentence = new Sentence(callSign, counter, time, location);
Sentence sentence = new Sentence(callSign, counter, time);
sentence.addField("lat", String.format(Locale.ROOT, "%.6f", latitude));
sentence.addField("lon", String.format(Locale.ROOT, "%.6f", longitude));
sentence.addField("alt", String.format(Locale.ROOT, "%.1f", altitude));

Wyświetl plik

@ -23,7 +23,6 @@ public final class Sentence {
private final String callSign;
private final int id;
private final Instant time;
private final Location location;
private final CrcCcitt16 crc16 = new CrcCcitt16();
@ -39,11 +38,10 @@ public final class Sentence {
* @param id message sequence number
* @param time the creation time
*/
public Sentence(String callSign, int id, Instant time, Location location ) {
public Sentence(String callSign, int id, Instant time) {
this.callSign = callSign;
this.id = id;
this.time = Instant.from(time);
this.location = location;
}
/**