Skip to content

Commit

Permalink
reduce custom decoders
Browse files Browse the repository at this point in the history
  • Loading branch information
dernasherbrezon committed Jun 27, 2024
1 parent 214c6a4 commit ab7154c
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 38 deletions.
4 changes: 2 additions & 2 deletions .classpath
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@
</classpathentry>
<classpathentry kind="src" output="target/test-classes" path="src/test/java">
<attributes>
<attribute name="test" value="true"/>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
<attribute name="test" value="true"/>
</attributes>
</classpathentry>
<classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources">
<attributes>
<attribute name="maven.pomderived" value="true"/>
<attribute name="test" value="true"/>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-17">
Expand Down
6 changes: 4 additions & 2 deletions src/main/java/ru/r2cloud/satellite/decoder/Ax100Decoder.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,17 @@
public class Ax100Decoder extends TelemetryDecoder {

private final Class<? extends Beacon> beacon;
private final String syncword;

public Ax100Decoder(PredictOreKit predict, Configuration config, Class<? extends Beacon> beacon) {
public Ax100Decoder(PredictOreKit predict, Configuration config, Class<? extends Beacon> beacon, String syncword) {
super(predict, config);
this.beacon = beacon;
this.syncword = syncword;
}

@Override
public BeaconSource<? extends Beacon> createBeaconSource(ByteInput source, Observation req) {
return new Ax100BeaconSource<>(source, beacon);
return new Ax100BeaconSource<>(source, 512, syncword, beacon, false, true, true);
}

@Override
Expand Down
29 changes: 0 additions & 29 deletions src/main/java/ru/r2cloud/satellite/decoder/BlueWalker3Decoder.java

This file was deleted.

14 changes: 9 additions & 5 deletions src/main/java/ru/r2cloud/satellite/decoder/Decoders.java
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,10 @@ public Decoders(PredictOreKit predict, Configuration props, ProcessFactory proce
index("51439", "51439-0", new GaspacsDecoder(predict, props));
index("53385", "53385-0", new GeoscanDecoder(predict, props));
index("53108", "53108-0", new CcsdsDecoder(predict, props, TransferFrame.class));
index("53807", "53807-0", new BlueWalker3Decoder(predict, props, RawBeacon.class));
index("51509", "51509-0", new BlueWalker3Decoder(predict, props, RawBeacon.class));
index("56180", "56180-0", new BlueWalker3Decoder(predict, props, RawBeacon.class));
index("59588", "59588-0", new BlueWalker3Decoder(predict, props, RawBeacon.class));
index("53807", "53807-0", new Cc11xxDecoder(predict, props, RawBeacon.class, "10010011000010110101000111011110", 512));
index("51509", "51509-0", new Cc11xxDecoder(predict, props, RawBeacon.class, "10010011000010110101000111011110", 512));
index("56180", "56180-0", new Cc11xxDecoder(predict, props, RawBeacon.class, "10010011000010110101000111011110", 512));
index("59588", "59588-0", new Cc11xxDecoder(predict, props, RawBeacon.class, "10010011000010110101000111011110", 512));
index("56993", "56993-0", new Mrc100Decoder(predict, props, Mrc100Beacon.class));
index("56211", "56211-1", new InspireSat7SpinoDecoder(predict, props));
index("57167", "57167-0", new StratosatTk1Decoder(predict, props));
Expand Down Expand Up @@ -113,7 +113,11 @@ public Decoder findByTransmitter(Transmitter transmitter) {
} else if (transmitter.getFraming().equals(Framing.AX25)) {
return new Ax25Decoder(predict, props, transmitter.getBeaconClass(), transmitter.getAssistedHeader());
} else if (transmitter.getFraming().equals(Framing.AX100)) {
return new Ax100Decoder(predict, props, transmitter.getBeaconClass());
String syncword = "10010011000010110101000111011110";
if (transmitter.getSyncword() != null) {
syncword = transmitter.getSyncword();
}
return new Ax100Decoder(predict, props, transmitter.getBeaconClass(), syncword);
} else if (transmitter.getFraming().equals(Framing.U482C)) {
String syncword = "11000011101010100110011001010101";
if (transmitter.getSyncword() != null) {
Expand Down

0 comments on commit ab7154c

Please sign in to comment.