-
-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e0ca7a7
commit f09b764
Showing
14 changed files
with
937 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,174 @@ | ||
package ru.r2cloud.jradio.lasarsat; | ||
|
||
public class Dos { | ||
|
||
private long mode; | ||
private long gyrX; | ||
private long gyrY; | ||
private long gyrZ; | ||
private long magX; | ||
private long magY; | ||
private long magZ; | ||
private long plasma; | ||
private long phd; | ||
private long dozi; | ||
private long gyrT; | ||
private long magT; | ||
private long lppa; | ||
private long busCur; | ||
private long busVol; | ||
private long uptime; | ||
|
||
public Dos() { | ||
// do nothing | ||
} | ||
|
||
public Dos(String[] parts) { | ||
int i = 1; | ||
mode = Long.valueOf(parts[i++]); | ||
gyrX = Long.valueOf(parts[i++]); | ||
gyrY = Long.valueOf(parts[i++]); | ||
gyrZ = Long.valueOf(parts[i++]); | ||
magX = Long.valueOf(parts[i++]); | ||
magY = Long.valueOf(parts[i++]); | ||
magZ = Long.valueOf(parts[i++]); | ||
plasma = Long.valueOf(parts[i++]); | ||
phd = Long.valueOf(parts[i++]); | ||
dozi = Long.valueOf(parts[i++]); | ||
gyrT = Long.valueOf(parts[i++]); | ||
magT = Long.valueOf(parts[i++]); | ||
lppa = Long.valueOf(parts[i++]); | ||
busCur = Long.valueOf(parts[i++]); | ||
busVol = Long.valueOf(parts[i++]); | ||
uptime = Long.valueOf(parts[i++]); | ||
} | ||
|
||
public long getMode() { | ||
return mode; | ||
} | ||
|
||
public void setMode(long mode) { | ||
this.mode = mode; | ||
} | ||
|
||
public long getGyrX() { | ||
return gyrX; | ||
} | ||
|
||
public void setGyrX(long gyrX) { | ||
this.gyrX = gyrX; | ||
} | ||
|
||
public long getGyrY() { | ||
return gyrY; | ||
} | ||
|
||
public void setGyrY(long gyrY) { | ||
this.gyrY = gyrY; | ||
} | ||
|
||
public long getGyrZ() { | ||
return gyrZ; | ||
} | ||
|
||
public void setGyrZ(long gyrZ) { | ||
this.gyrZ = gyrZ; | ||
} | ||
|
||
public long getMagX() { | ||
return magX; | ||
} | ||
|
||
public void setMagX(long magX) { | ||
this.magX = magX; | ||
} | ||
|
||
public long getMagY() { | ||
return magY; | ||
} | ||
|
||
public void setMagY(long magY) { | ||
this.magY = magY; | ||
} | ||
|
||
public long getMagZ() { | ||
return magZ; | ||
} | ||
|
||
public void setMagZ(long magZ) { | ||
this.magZ = magZ; | ||
} | ||
|
||
public long getPlasma() { | ||
return plasma; | ||
} | ||
|
||
public void setPlasma(long plasma) { | ||
this.plasma = plasma; | ||
} | ||
|
||
public long getPhd() { | ||
return phd; | ||
} | ||
|
||
public void setPhd(long phd) { | ||
this.phd = phd; | ||
} | ||
|
||
public long getDozi() { | ||
return dozi; | ||
} | ||
|
||
public void setDozi(long dozi) { | ||
this.dozi = dozi; | ||
} | ||
|
||
public long getGyrT() { | ||
return gyrT; | ||
} | ||
|
||
public void setGyrT(long gyrT) { | ||
this.gyrT = gyrT; | ||
} | ||
|
||
public long getMagT() { | ||
return magT; | ||
} | ||
|
||
public void setMagT(long magT) { | ||
this.magT = magT; | ||
} | ||
|
||
public long getLppa() { | ||
return lppa; | ||
} | ||
|
||
public void setLppa(long lppa) { | ||
this.lppa = lppa; | ||
} | ||
|
||
public long getBusCur() { | ||
return busCur; | ||
} | ||
|
||
public void setBusCur(long busCur) { | ||
this.busCur = busCur; | ||
} | ||
|
||
public long getBusVol() { | ||
return busVol; | ||
} | ||
|
||
public void setBusVol(long busVol) { | ||
this.busVol = busVol; | ||
} | ||
|
||
public long getUptime() { | ||
return uptime; | ||
} | ||
|
||
public void setUptime(long uptime) { | ||
this.uptime = uptime; | ||
} | ||
|
||
} |
131 changes: 131 additions & 0 deletions
131
src/main/java/ru/r2cloud/jradio/lasarsat/LasarsatBeacon.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,131 @@ | ||
package ru.r2cloud.jradio.lasarsat; | ||
|
||
import java.io.DataInputStream; | ||
import java.io.IOException; | ||
import java.nio.charset.StandardCharsets; | ||
import java.util.regex.Pattern; | ||
|
||
import ru.r2cloud.jradio.ax25.Ax25Beacon; | ||
import ru.r2cloud.jradio.bdsat.Psu; | ||
import ru.r2cloud.jradio.bdsat.Radio; | ||
import ru.r2cloud.jradio.fec.ccsds.UncorrectableException; | ||
import ru.r2cloud.jradio.veronika.Sol; | ||
|
||
public class LasarsatBeacon extends Ax25Beacon { | ||
|
||
private static final Pattern COMMA = Pattern.compile(","); | ||
|
||
private Radio uhf; | ||
private Radio vhf; | ||
private Obc obc; | ||
private Psu psu; | ||
private Mgs mgs; | ||
private Nav nav; | ||
private Dos dos; | ||
private Sol sol; | ||
private String message; | ||
|
||
@Override | ||
public void readBeacon(DataInputStream dis) throws IOException, UncorrectableException { | ||
byte[] payload = new byte[dis.available()]; | ||
dis.readFully(payload); | ||
String message = new String(payload, StandardCharsets.US_ASCII).trim(); | ||
String[] parts = COMMA.split(message); | ||
if (parts.length == 0) { | ||
setPayload(payload); | ||
return; | ||
} | ||
if (parts[0].equalsIgnoreCase("U")) { | ||
uhf = new Radio(parts); | ||
} else if (parts[0].equalsIgnoreCase("V")) { | ||
vhf = new Radio(parts); | ||
} else if (parts[0].equalsIgnoreCase("OBC")) { | ||
obc = new Obc(parts); | ||
} else if (parts[0].equalsIgnoreCase("PSU")) { | ||
psu = new Psu(parts); | ||
} else if (parts[0].equalsIgnoreCase("MGS")) { | ||
mgs = new Mgs(parts); | ||
} else if (parts[0].equalsIgnoreCase("DOS")) { | ||
dos = new Dos(parts); | ||
} else if (parts[0].equalsIgnoreCase("SOL")) { | ||
sol = new Sol(parts); | ||
} else if (parts[0].equalsIgnoreCase("NAV")) { | ||
nav = new Nav(parts); | ||
} else { | ||
this.message = message; | ||
} | ||
} | ||
|
||
public Radio getUhf() { | ||
return uhf; | ||
} | ||
|
||
public void setUhf(Radio uhf) { | ||
this.uhf = uhf; | ||
} | ||
|
||
public Radio getVhf() { | ||
return vhf; | ||
} | ||
|
||
public void setVhf(Radio vhf) { | ||
this.vhf = vhf; | ||
} | ||
|
||
public Obc getObc() { | ||
return obc; | ||
} | ||
|
||
public void setObc(Obc obc) { | ||
this.obc = obc; | ||
} | ||
|
||
public Psu getPsu() { | ||
return psu; | ||
} | ||
|
||
public void setPsu(Psu psu) { | ||
this.psu = psu; | ||
} | ||
|
||
public Mgs getMgs() { | ||
return mgs; | ||
} | ||
|
||
public void setMgs(Mgs mgs) { | ||
this.mgs = mgs; | ||
} | ||
|
||
public Nav getNav() { | ||
return nav; | ||
} | ||
|
||
public void setNav(Nav nav) { | ||
this.nav = nav; | ||
} | ||
|
||
public Dos getDos() { | ||
return dos; | ||
} | ||
|
||
public void setDos(Dos dos) { | ||
this.dos = dos; | ||
} | ||
|
||
public Sol getSol() { | ||
return sol; | ||
} | ||
|
||
public void setSol(Sol sol) { | ||
this.sol = sol; | ||
} | ||
|
||
public String getMessage() { | ||
return message; | ||
} | ||
|
||
public void setMessage(String message) { | ||
this.message = message; | ||
} | ||
|
||
} |
Oops, something went wrong.