Skip to content

Commit

Permalink
add support for images from stratosattk1 and siren
Browse files Browse the repository at this point in the history
  • Loading branch information
dernasherbrezon committed Jan 9, 2024
1 parent 227560c commit 7123915
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 1 deletion.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@
<dependency>
<groupId>ru.r2cloud</groupId>
<artifactId>jradio</artifactId>
<version>1.97</version>
<version>1.98</version>
</dependency>
<dependency>
<groupId>io.dropwizard.metrics</groupId>
Expand Down
1 change: 1 addition & 0 deletions src/main/java/ru/r2cloud/satellite/decoder/Decoders.java
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ public Decoders(PredictOreKit predict, Configuration props, ProcessFactory proce
index("57167", "57167-0", new StratosatTk1Decoder(predict, props));
index("55104", "55104-0", new Sharjahsat1Decoder(predict, props));
index("56212", "56212-0", new RoseyDecoder(predict, props));
index("53384", "53384-0", new SputnixDecoder(predict, props));
}

public Decoder findByTransmitter(Transmitter transmitter) {
Expand Down
28 changes: 28 additions & 0 deletions src/main/java/ru/r2cloud/satellite/decoder/SputnixDecoder.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
package ru.r2cloud.satellite.decoder;

import java.awt.image.BufferedImage;
import java.util.List;

import ru.r2cloud.jradio.Beacon;
import ru.r2cloud.jradio.sputnix.SputnixBeacon;
import ru.r2cloud.jradio.sputnix.SputnixPictureDecoder;
import ru.r2cloud.predict.PredictOreKit;
import ru.r2cloud.util.Configuration;

public class SputnixDecoder extends UspDecoder {

public SputnixDecoder(PredictOreKit predict, Configuration config) {
super(predict, config, SputnixBeacon.class);
}

@Override
protected BufferedImage decodeImage(List<? extends Beacon> beacons) {
@SuppressWarnings("unchecked")
SputnixPictureDecoder decoder = new SputnixPictureDecoder((List<SputnixBeacon>) beacons);
while (decoder.hasNext()) {
return decoder.next();
}
return null;
}

}
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
package ru.r2cloud.satellite.decoder;

import java.awt.image.BufferedImage;
import java.util.List;

import ru.r2cloud.jradio.Beacon;
import ru.r2cloud.jradio.BeaconSource;
import ru.r2cloud.jradio.ByteInput;
import ru.r2cloud.jradio.sstk1.StratosatTk1;
import ru.r2cloud.jradio.sstk1.StratosatTk1Beacon;
import ru.r2cloud.jradio.sstk1.StratosatTk1PictureDecoder;
import ru.r2cloud.model.Observation;
import ru.r2cloud.predict.PredictOreKit;
import ru.r2cloud.util.Configuration;
Expand All @@ -14,6 +18,16 @@ public class StratosatTk1Decoder extends TelemetryDecoder {
public StratosatTk1Decoder(PredictOreKit predict, Configuration config) {
super(predict, config);
}

@Override
protected BufferedImage decodeImage(List<? extends Beacon> beacons) {
@SuppressWarnings("unchecked")
StratosatTk1PictureDecoder decoder = new StratosatTk1PictureDecoder((List<StratosatTk1Beacon>) beacons);
while (decoder.hasNext()) {
return decoder.next();
}
return null;
}

@Override
public BeaconSource<? extends Beacon> createBeaconSource(ByteInput demodulator, Observation req) {
Expand Down

0 comments on commit 7123915

Please sign in to comment.