diff --git a/ApplicationAmicalsat/src/main/java/org/josast/ApplicationAmicalsat/App.java b/ApplicationAmicalsat/src/main/java/org/josast/ApplicationAmicalsat/App.java index dcf929ed142b6498e1096606b5b06fd6513b43c2..eb1bd6db2edb6f2f18277cd6b74db580fae0af76 100644 --- a/ApplicationAmicalsat/src/main/java/org/josast/ApplicationAmicalsat/App.java +++ b/ApplicationAmicalsat/src/main/java/org/josast/ApplicationAmicalsat/App.java @@ -1,79 +1,74 @@ package org.josast.ApplicationAmicalsat; -import javafx.application.Application; -import javafx.fxml.FXMLLoader; -import javafx.scene.Parent; -import javafx.scene.Scene; -import javafx.stage.Stage; - import java.io.File; import java.io.IOException; import java.util.logging.FileHandler; import java.util.logging.Handler; import java.util.logging.Logger; +import javafx.application.Application; +import javafx.fxml.FXMLLoader; +import javafx.scene.Parent; +import javafx.scene.Scene; +import javafx.stage.Stage; -/** - * JavaFX App - */ +/** JavaFX App */ public class App extends Application { - private static Scene scene; - private static FXMLLoader fxmlLoader; - private static Logger logger = Logger.getLogger("AmsatLogger"); - - @Override - public void start(Stage stage) throws IOException { - - System.setProperty("glass.accessible.force", "false"); - scene = new Scene(loadFXML("Amicalsat"), 800, 600); - stage.setScene(scene); - - Controler ctrl = fxmlLoader.getController(); - ctrl.setPrimaryStage(stage); - scene.getStylesheets().add(this.getClass().getResource("boot.css").toExternalForm()); - stage.setTitle("Amicalsat Decoder"); - ctrl.initMMI(); - stage.show(); - } - - static void setRoot(String fxml) throws IOException { - scene.setRoot(loadFXML(fxml)); - } - - private static Parent loadFXML(String fxml) throws IOException { - fxmlLoader = new FXMLLoader(App.class.getResource(fxml + ".fxml")); - return fxmlLoader.load(); - } - - public static void main(String[] args) { - // initialisation du systéme de log en premier - try { - String path = System.getProperty("user.dir") + "/log"; - File apath = new File(path); - - if (!apath.exists()) { - if (apath.mkdir() == false) { - System.err.println("fail to create " + path); - } - } - FileHandler fh = new FileHandler(path + "/" + "AmicalsatLog.log"); - logger.setUseParentHandlers(false); - Handler[] handlers = logger.getHandlers(); - for (Handler handler : handlers) { - logger.removeHandler(handler); - } - logger.addHandler(fh); - - } catch (SecurityException e) { + private static Scene scene; + private static FXMLLoader fxmlLoader; + private static Logger logger = Logger.getLogger("AmsatLogger"); + + @Override + public void start(Stage stage) throws IOException { + + System.setProperty("glass.accessible.force", "false"); + scene = new Scene(loadFXML("Amicalsat"), 800, 600); + stage.setScene(scene); + + Controler ctrl = fxmlLoader.getController(); + ctrl.setPrimaryStage(stage); + scene.getStylesheets().add(this.getClass().getResource("boot.css").toExternalForm()); + stage.setTitle("Amicalsat Decoder"); + ctrl.initMMI(); + stage.show(); + } + + static void setRoot(String fxml) throws IOException { + scene.setRoot(loadFXML(fxml)); + } + + private static Parent loadFXML(String fxml) throws IOException { + fxmlLoader = new FXMLLoader(App.class.getResource(fxml + ".fxml")); + return fxmlLoader.load(); + } + + public static void main(String[] args) { + // initialisation du systéme de log en premier + try { + String path = System.getProperty("user.dir") + "/log"; + File apath = new File(path); + + if (!apath.exists()) { + if (apath.mkdir() == false) { + System.err.println("fail to create " + path); + } + } + FileHandler fh = new FileHandler(path + "/" + "AmicalsatLog.log"); + logger.setUseParentHandlers(false); + Handler[] handlers = logger.getHandlers(); + for (Handler handler : handlers) { + logger.removeHandler(handler); + } + logger.addHandler(fh); - e.printStackTrace(); + } catch (SecurityException e) { - } catch (IOException e) { + e.printStackTrace(); - e.printStackTrace(); + } catch (IOException e) { - } - launch(); + e.printStackTrace(); } - -} \ No newline at end of file + launch(); + } +} diff --git a/ApplicationAmicalsat/src/main/java/org/josast/ApplicationAmicalsat/Configuration.java b/ApplicationAmicalsat/src/main/java/org/josast/ApplicationAmicalsat/Configuration.java index e8fc94c27578eb9adbab3c7e2f8f25911664d708..2d3fbd2d22b870873bf65ad126200de7d96998c5 100644 --- a/ApplicationAmicalsat/src/main/java/org/josast/ApplicationAmicalsat/Configuration.java +++ b/ApplicationAmicalsat/src/main/java/org/josast/ApplicationAmicalsat/Configuration.java @@ -1,245 +1,211 @@ -/** - * - */ +/** */ package org.josast.ApplicationAmicalsat; import org.josast.property.CONFIG; /** - * Singleton to manage all application parameter - * The default configuration is automaticaly saved in a properties file. + * Singleton to manage all application parameter The default configuration is automaticaly saved in + * a properties file. + * * @author christophe - * - * */ public class Configuration { - - - /* - * parameter with default value - */ - private String callsign="Anonymous"; - private String longitude="0.0W"; - private String latitude="0.0N"; - - private String soundModemIP="127.0.0.1"; - private String soundModemPort="8100"; - - private String SIDSAMSATSource="Anonymous"; - private String SIDSAMSATUrl="https://amsat.electrolab.fr/SIDS"; - private String SIDSSatnogsSource="Anonymous"; - private String SIDSSatnogsURL="https://db.satnogs.org/api/telemetry/"; - private String SIDSSatnogs="0"; - private String SIDSAMSAT="1"; - private int Norad=99836; // default value - equivalent to satnogs - private boolean SISD_SatNogs = false; - private boolean SIDS_AMSAT = true; - - - private CONFIG conf = CONFIG.getInstance(); - - public static Configuration getInstance() - { - return SingletonHolder.instance; - } - - public boolean isSISD_SatNogs() { - - return SISD_SatNogs; - } - - - private Configuration() + /* + * parameter with default value + */ + private String callsign = "Anonymous"; + private String longitude = "0.0W"; + private String latitude = "0.0N"; + + private String soundModemIP = "127.0.0.1"; + private String soundModemPort = "8100"; + + private String SIDSAMSATSource = "Anonymous"; + private String SIDSAMSATUrl = "https://amsat.electrolab.fr/SIDS"; + private String SIDSSatnogsSource = "Anonymous"; + private String SIDSSatnogsURL = "https://db.satnogs.org/api/telemetry/"; + private String SIDSSatnogs = "0"; + private String SIDSAMSAT = "1"; + private int Norad = 99836; // default value - equivalent to satnogs + private boolean SISD_SatNogs = false; + private boolean SIDS_AMSAT = true; + + private CONFIG conf = CONFIG.getInstance(); + + public static Configuration getInstance() { + return SingletonHolder.instance; + } + + public boolean isSISD_SatNogs() { + + return SISD_SatNogs; + } + + private Configuration() { + if (conf.getProperty("Callsign") != null) { + callsign = conf.getProperty("Callsign"); + latitude = conf.getProperty("Latitude"); + longitude = conf.getProperty("Longitude"); + + SIDSAMSATSource = conf.getProperty("SIDSAMSATSource"); + SIDSAMSATUrl = conf.getProperty("SIDSAMSATUrl"); + SIDSSatnogsSource = conf.getProperty("SIDSSatnogsSource"); + SIDSSatnogsURL = conf.getProperty("SIDSSatnogsURL"); + SIDSSatnogs = conf.getProperty("SIDSSatnogs"); + SIDSAMSAT = conf.getProperty("SIDSAMSAT"); + soundModemIP = conf.getProperty("soundModemIP"); + soundModemPort = conf.getProperty("soundModemPort"); + Norad = Integer.parseUnsignedInt(conf.getProperty("NoradID").trim()); + if (SIDSSatnogs.contentEquals("1")) { + SISD_SatNogs = true; + } else { + SISD_SatNogs = false; + } + if (SIDSAMSAT.contentEquals("1")) { + SIDS_AMSAT = true; + } else { + SIDS_AMSAT = false; + } + + } else // si le fichier n'existe pas, il est créé par défaut { - if ( conf.getProperty("Callsign")!=null) - { - callsign = conf.getProperty("Callsign"); - latitude = conf.getProperty("Latitude"); - longitude = conf.getProperty("Longitude"); - - SIDSAMSATSource=conf.getProperty("SIDSAMSATSource"); - SIDSAMSATUrl=conf.getProperty("SIDSAMSATUrl"); - SIDSSatnogsSource=conf.getProperty("SIDSSatnogsSource"); - SIDSSatnogsURL=conf.getProperty("SIDSSatnogsURL"); - SIDSSatnogs=conf.getProperty("SIDSSatnogs"); - SIDSAMSAT=conf.getProperty("SIDSAMSAT"); - soundModemIP = conf.getProperty("soundModemIP"); - soundModemPort = conf.getProperty("soundModemPort"); - Norad = Integer.parseUnsignedInt(conf.getProperty("NoradID").trim()); - if (SIDSSatnogs.contentEquals("1") ) - { - SISD_SatNogs=true; - } else - { - SISD_SatNogs=false; - } - if (SIDSAMSAT.contentEquals("1") ) - { - SIDS_AMSAT=true; - } else - { - SIDS_AMSAT=false; - } - - } - else // si le fichier n'existe pas, il est créé par défaut - { - save(); - } - - - } - - - private static class SingletonHolder - { - - private final static Configuration instance = new Configuration(); - } - - - - - public void setSIDSSatnogs(String sIDSSatnogs) { - SIDSSatnogs = sIDSSatnogs; - if (SIDSSatnogs.contentEquals("1") ) - { - SISD_SatNogs=true; - } else - { - SISD_SatNogs=false; - } - } - - - public void setSIDSAMSAT(String sIDSEntrySat) { - SIDSAMSAT = sIDSEntrySat; - if (SIDSAMSAT.contentEquals("1") ) - { - SIDS_AMSAT=true; - } else - { - SIDS_AMSAT=false; - } - } - - - public void save() { - - conf.setProperty("Callsign",callsign); - conf.setProperty("Latitude",latitude); - conf.setProperty("Longitude",longitude); - conf.setProperty("SIDSAMSATSource",this.SIDSAMSATSource); - conf.setProperty("SIDSAMSATUrl",this.SIDSAMSATUrl); - conf.setProperty("SIDSSatnogsSource",this.SIDSSatnogsSource); - conf.setProperty("SIDSSatnogsURL",this.SIDSSatnogsURL); - conf.setProperty("SIDSSatnogs",this.SIDSSatnogs); - conf.setProperty("SIDSAMSAT",this.SIDSAMSAT); - conf.setProperty("soundModemPort",this.soundModemPort); - conf.setProperty("soundModemIP",this.soundModemIP); - conf.setProperty("NoradID",""+this.Norad); - - } - - public String getCallsign() { - return callsign; - } - - public void setCallsign(String callsign) { - this.callsign = callsign; - } - - public String getLongitude() { - return longitude; - } - - public void setLongitude(String longitude) { - this.longitude = longitude; - } - - public String getLatitude() { - return latitude; - } - - public void setLatitude(String latitude) { - this.latitude = latitude; - } - - public String getSoundModemIP() { - return soundModemIP; - } - - public void setSoundModemIP(String soundModemIP) { - this.soundModemIP = soundModemIP; - } - - public String getSoundModemPort() { - return soundModemPort; - } - - public void setSoundModemPort(String soundModemPort) { - this.soundModemPort = soundModemPort; - } - - public String getSIDSAMSATSource() { - return SIDSAMSATSource; - } - - public void setSIDSAMSATSource(String sIDSAMSATSource) { - SIDSAMSATSource = sIDSAMSATSource; - } - - public String getSIDSAMSATUrl() { - return SIDSAMSATUrl; - } - - public void setSIDSAMSATUrl(String sIDSAMSATUrl) { - SIDSAMSATUrl = sIDSAMSATUrl; - } - - public String getSIDSSatnogsSource() { - return SIDSSatnogsSource; - } - - public void setSIDSSatnogsSource(String sIDSSatnogsSource) { - SIDSSatnogsSource = sIDSSatnogsSource; - } - - public String getSIDSSatnogsURL() { - return SIDSSatnogsURL; - } - - public void setSIDSSatnogsURL(String sIDSSatnogsURL) { - SIDSSatnogsURL = sIDSSatnogsURL; - } - - public int getNorad() { - return Norad; - } - - public void setNorad(int norad) { - Norad = norad; - } - - public boolean isSIDS_AMSAT() { - return SIDS_AMSAT; - } - - - - public CONFIG getConf() { - return conf; - } - - public void setConf(CONFIG conf) { - this.conf = conf; - } - - public void setSISD_SatNogs(boolean sISD_SatNogs) { - SISD_SatNogs = sISD_SatNogs; - } - - + save(); + } + } + + private static class SingletonHolder { + + private static final Configuration instance = new Configuration(); + } + + public void setSIDSSatnogs(String sIDSSatnogs) { + SIDSSatnogs = sIDSSatnogs; + if (SIDSSatnogs.contentEquals("1")) { + SISD_SatNogs = true; + } else { + SISD_SatNogs = false; + } + } + + public void setSIDSAMSAT(String sIDSEntrySat) { + SIDSAMSAT = sIDSEntrySat; + if (SIDSAMSAT.contentEquals("1")) { + SIDS_AMSAT = true; + } else { + SIDS_AMSAT = false; + } + } + public void save() { + + conf.setProperty("Callsign", callsign); + conf.setProperty("Latitude", latitude); + conf.setProperty("Longitude", longitude); + conf.setProperty("SIDSAMSATSource", this.SIDSAMSATSource); + conf.setProperty("SIDSAMSATUrl", this.SIDSAMSATUrl); + conf.setProperty("SIDSSatnogsSource", this.SIDSSatnogsSource); + conf.setProperty("SIDSSatnogsURL", this.SIDSSatnogsURL); + conf.setProperty("SIDSSatnogs", this.SIDSSatnogs); + conf.setProperty("SIDSAMSAT", this.SIDSAMSAT); + conf.setProperty("soundModemPort", this.soundModemPort); + conf.setProperty("soundModemIP", this.soundModemIP); + conf.setProperty("NoradID", "" + this.Norad); + } + + public String getCallsign() { + return callsign; + } + + public void setCallsign(String callsign) { + this.callsign = callsign; + } + + public String getLongitude() { + return longitude; + } + + public void setLongitude(String longitude) { + this.longitude = longitude; + } + + public String getLatitude() { + return latitude; + } + + public void setLatitude(String latitude) { + this.latitude = latitude; + } + + public String getSoundModemIP() { + return soundModemIP; + } + + public void setSoundModemIP(String soundModemIP) { + this.soundModemIP = soundModemIP; + } + + public String getSoundModemPort() { + return soundModemPort; + } + + public void setSoundModemPort(String soundModemPort) { + this.soundModemPort = soundModemPort; + } + + public String getSIDSAMSATSource() { + return SIDSAMSATSource; + } + + public void setSIDSAMSATSource(String sIDSAMSATSource) { + SIDSAMSATSource = sIDSAMSATSource; + } + + public String getSIDSAMSATUrl() { + return SIDSAMSATUrl; + } + + public void setSIDSAMSATUrl(String sIDSAMSATUrl) { + SIDSAMSATUrl = sIDSAMSATUrl; + } + + public String getSIDSSatnogsSource() { + return SIDSSatnogsSource; + } + + public void setSIDSSatnogsSource(String sIDSSatnogsSource) { + SIDSSatnogsSource = sIDSSatnogsSource; + } + + public String getSIDSSatnogsURL() { + return SIDSSatnogsURL; + } + + public void setSIDSSatnogsURL(String sIDSSatnogsURL) { + SIDSSatnogsURL = sIDSSatnogsURL; + } + + public int getNorad() { + return Norad; + } + + public void setNorad(int norad) { + Norad = norad; + } + + public boolean isSIDS_AMSAT() { + return SIDS_AMSAT; + } + + public CONFIG getConf() { + return conf; + } + + public void setConf(CONFIG conf) { + this.conf = conf; + } + + public void setSISD_SatNogs(boolean sISD_SatNogs) { + SISD_SatNogs = sISD_SatNogs; + } } diff --git a/ApplicationAmicalsat/src/main/java/org/josast/ApplicationAmicalsat/Controler.java b/ApplicationAmicalsat/src/main/java/org/josast/ApplicationAmicalsat/Controler.java index 4934f836e219dd413e5540e84b0f37342111890f..7050243c03fd20ea3b869fde4b896506e2db2d15 100644 --- a/ApplicationAmicalsat/src/main/java/org/josast/ApplicationAmicalsat/Controler.java +++ b/ApplicationAmicalsat/src/main/java/org/josast/ApplicationAmicalsat/Controler.java @@ -10,9 +10,23 @@ import java.io.PrintWriter; import java.text.SimpleDateFormat; import java.util.Date; import java.util.logging.Logger; - +import javafx.application.Platform; +import javafx.concurrent.WorkerStateEvent; +import javafx.embed.swing.SwingFXUtils; +import javafx.event.ActionEvent; +import javafx.event.EventHandler; +import javafx.fxml.FXML; +import javafx.scene.control.Alert; +import javafx.scene.control.Button; +import javafx.scene.control.CheckBox; +import javafx.scene.control.Label; +import javafx.scene.control.TextArea; +import javafx.scene.control.TextField; +import javafx.scene.image.Image; +import javafx.scene.image.ImageView; +import javafx.stage.Stage; +import javafx.stage.Window; import javax.imageio.ImageIO; - import org.josast.ApplicationAmicalsat.util.LogFile; import org.josast.ModuleSoundModem.SoundModemConfiguration; import org.josast.SIDS.Station; @@ -33,994 +47,751 @@ import org.josast.amicalsat.V1RlTypeFrame; import org.josast.javafx.AlertHelper; import org.josast.propertyHttp.ConfigHttp; -import javafx.application.Platform; -import javafx.concurrent.WorkerStateEvent; - -import javafx.event.ActionEvent; -import javafx.event.EventHandler; - -//import java.util.logging.Logger; - -import javafx.fxml.FXML; -import javafx.scene.control.Alert; -import javafx.scene.control.Button; -import javafx.scene.control.CheckBox; -import javafx.scene.control.Label; -import javafx.scene.control.TextArea; -import javafx.scene.control.TextField; -import javafx.scene.image.Image; -import javafx.scene.image.ImageView; -import javafx.stage.Stage; -import javafx.stage.Window; -import javafx.embed.swing.SwingFXUtils; - public class Controler { - private static final String LINE_SEPARATOR = "\r\n"; - private static final int STATE_INIT = 0; - private static final int STATE_START = 1; - protected static final int STATE_STOP = 2; - private static final int STATE_SAVE = 3; - - private static Logger appLogger = Logger.getLogger("AmsatLogger"); - - private String version = "1.1"; - - @FXML - private Button ButtonStart; - @FXML - private Button ButtonStop; - @FXML - private Button ButtonSave; - @FXML - private Label LabelIP; - - @FXML - private Button ButtonFile; - @FXML - private Button ButtonSerial; - @FXML - private Button ButtonKiss; - - @FXML - private TextField FieldIP; - @FXML - private TextField FieldPort; - - @FXML - private Label labelStatus; - @FXML - private Label LabelFrame; - - @FXML - private TextArea DecodedData; - - @FXML - private TextArea TexAreaLog; - - @FXML - private TextField textFieldMode; - - @FXML - private TextField textFieldDate; - - @FXML - private Label LabelInformation; - @FXML - private TextField textFieldbEps33VCurrent; - @FXML - private TextField TextFieldEps5VCurrent; - @FXML - private TextField TextFieldepsBattVcurrent; - @FXML - private TextField TextFieldEpsTemp; - @FXML - private TextField TextFieldTrxTemp; - @FXML - private TextField TextFieldEPSVBAT; - - @FXML - private TextField TFBattTemp; - - @FXML - private ImageView ImageViewAMSAT; - - @FXML - private ImageView imageViewEntrysat; - - @FXML - private TextField TextFieldCallsign; - @FXML - private TextField TextFieldLatitude; - @FXML - private TextField TextFieldLongitude; - - @FXML - private CheckBox CheckbBoxAmicalSat; - @FXML - private CheckBox CheckBoxSatNogs; - - @FXML - private Button ButtonSaveConfiguration; - - @FXML - private TextField TextFieldSIDSEntrysat; - @FXML - private TextField TextFieldSIDSSatnogs; - - @FXML - private TextField tfEMVin; - @FXML - private TextField tfERVin; - - @FXML - private TextField tfM1Bootnumber; - @FXML - private TextField tfM1CPUvoltage; - @FXML - private TextField tfM1Uptime; - @FXML - private TextField tfM1CPUtemperature; - @FXML - private TextField tfM1HexFlag; - - @FXML - private TextField tfMNEMtimestamps; - @FXML - private TextField tfMNERtimestamps; - @FXML - private TextField tfMNEMVin; - @FXML - private TextField tfMNERVin; - @FXML - private TextField tfMNEMIin; - @FXML - private TextField tfMNERIin; - @FXML - private TextField tfMNEMPin; - @FXML - private TextField tfMREMPin; - @FXML - private TextField tfMNEMPpeak; - @FXML - private TextField tfMNERPpeak; - @FXML - private TextField tfMNEMVsolar; - @FXML - private TextField tfMNERVsolar; - @FXML - private TextField tfMNEMTcpu; - @FXML - private TextField tfMNERTcpu; - @FXML - private TextField tfMNEMVcpu; - @FXML - private TextField tfMNERVcpu; - - @FXML - private TextField tfDateCurrent; - - @FXML - private TextField tfTypeCurrent; - - @FXML - private TextField tfAreaCurrent; - @FXML - private TextField tfM1Logdate; - @FXML - private TextField tfM1Flagsdate; - - @FXML - private TextField tfLOGEMtimestamps; - @FXML - private TextField tfLOGERtimestamps; - @FXML - private TextField tfLogEMBootnumber; - @FXML - private TextField tfLogEMInputvoltage; - @FXML - private TextField tfLogEMInputpower; - @FXML - private TextField tfLogEMPeakPower; - @FXML - private TextField tfLogERBootnumber; - @FXML - private TextField tfLogERInputvoltage; - @FXML - private TextField tfLogERInputpower; - @FXML - private TextField tfLogERPeakPower; - @FXML - private TextField tfLogEMSolarpanelvoltage; - @FXML - private TextField tfLogERSolarpanelvoltage; - - @FXML - private TextField tfRLV1timeStamps; - @FXML - private TextField tfRLU2timeStamps; - @FXML - private TextField tfRLV1CPUvoltage; - @FXML - private TextField tfRLU2CPUvoltage; - @FXML - private TextField tfRLV1Batteryvoltage; - @FXML - private TextField tfRLU2Batteryvoltage; - @FXML - private TextField tfRLV1CPUtemperature; - @FXML - private TextField tfRLU2CPUtemperature; - @FXML - private TextField tfRLV1Amplifiertemperature; - @FXML - private TextField tfRLU2Amplifiertemperature; - @FXML - private TextField tfRLV1Flags; - @FXML - private TextField tfRLU2Flags; - - @FXML - private TextField tfMSV1Currentrssi; - @FXML - private TextField tfMSU2Currentrssi; - @FXML - private TextField tfMSV1timeStamps; - @FXML - private TextField tfMSU2timeStamps; - @FXML - private TextField tfMSV1Latchrssi; - @FXML - private TextField tfMSU2Latchrssi; - @FXML - private TextField tfMSV1AFCoffset; - @FXML - private TextField tfMSU2AFCoffset; - @FXML - private TextField tfA1FLAGStimeSpamps; - @FXML - private TextField tfA1FLAGmode; - @FXML - private TextField tfA1FLAGflags; - @FXML - private TextField tfA1FLAGfaults; - @FXML - private TextField tfA1MAGStimeSpamps; - @FXML - private TextField tfA1MAGMagX; - @FXML - private TextField tfA1MAGMagY; - @FXML - private TextField tfA1MAGMagZ; - @FXML - private TextField tfA1GIROStimeSpamps; - @FXML - private TextField tfA1GIROGyroX; - @FXML - private TextField tfA1GIROGyroY; - @FXML - private TextField tfA1GIROGyroZ; - @FXML - private TextField tfA1POSITIONStimeSpamps; - @FXML - private TextField tfA1POSITIONLatitude; - @FXML - private TextField tfA1POSITIONLongitude; - @FXML - private TextField tfCURLOGtimeStamps; - @FXML - private TextField tfCURLOGCPUvoltage; - @FXML - private TextField tfCURLOGCPUtemperature; - @FXML - private TextField tfCURLOGflags; - @FXML - private TextField tfCULROGtimeStamps; - @FXML - private TextField tfCULLOGCPUvoltage; - @FXML - private TextField tfCULLOGCPUtemperature; - @FXML - private TextField tfCULLOGflags; - @FXML - private TextField tfCURONYXtimeStamps; - @FXML - private TextField tfCULONYXtimeStamps; - @FXML - private TextField tfCURONYXReturnvalue; - @FXML - private TextField tfCULONYXReturnvalue; - @FXML - private TextField tfMNERPin; - - Stage primaryStage = null; - - private String imgAmsat = "logoAmsat.png"; - private String imgAmicalsat = "Amicalsat.jpg"; - - Station station = new Station(); - - ModelReceivedData receivedFrame = new ModelReceivedData(); - Configuration conf = Configuration.getInstance(); - - private TaskSoundmodemTCP task; - private SendSIDS SendSIDSSatnogs; - private SendSIDS SendSIDSMVPAmsat; - private LogFile logfile = null; - - @FXML - private void HandleSaveConfiguration(ActionEvent event) { - - String erreurmsg = null; - String Callsign = null; - - if (TextFieldCallsign.getText().isEmpty()) { - erreurmsg += "please enter a CallSign \r\n"; - } else { - Callsign = TextFieldCallsign.getText(); - } - - String Latitude = TextFieldLatitude.getText(); - String Longitude = TextFieldLongitude.getText(); - - if (station.checkLatitude(Latitude) == false) { - erreurmsg += "Wrong format for Latitude : XX.XXE/W \r\n"; - } - - if (station.checkLongitude(Longitude) == false) { - erreurmsg += "Wrong format for Longitude : XX.XXS/N \r\n"; - } - if (erreurmsg != null) { - Window owner = ButtonSaveConfiguration.getScene().getWindow(); - AlertHelper.showAlert(Alert.AlertType.ERROR, owner, "Form Error!", - erreurmsg); - return; - } - - station.setCallsign(Callsign); - station.setLatitude(Latitude); - station.setLongitude(Longitude); - - conf.setCallsign(Callsign); - conf.setLatitude(Latitude); - conf.setLongitude(Longitude); - - conf.setSIDSAMSATSource(TextFieldSIDSEntrysat.getText()); - conf.setSIDSSatnogsSource(TextFieldSIDSSatnogs.getText()); - conf.setSoundModemIP(FieldIP.getText()); - conf.setSoundModemPort(FieldPort.getText()); - - Station StationSatnogs = new Station(conf.getSIDSSatnogsSource(), - station.getLongitude(), station.getLatitude()); - Station StationEntry = new Station(conf.getSIDSAMSATSource(), - station.getLongitude(), station.getLatitude()); - - if (CheckbBoxAmicalSat.isSelected() == true) { - conf.setSIDSAMSAT("1"); - SendSIDSMVPAmsat = new SendSIDS(StationEntry, conf.getNorad(), - conf.getSIDSAMSATUrl()); - } else { - conf.setSIDSAMSAT("0"); - - } - - if (CheckBoxSatNogs.isSelected() == true) { - conf.setSIDSSatnogs("1"); - SendSIDSSatnogs = new SendSIDS(StationSatnogs, conf.getNorad(), - conf.getSIDSSatnogsURL()); - } else { - conf.setSIDSSatnogs("0"); - } - - conf.save(); - manageStatusinformation("Configuration Saved", "Configuration Saved"); - - } - - @FXML - private void handleStart(ActionEvent event) { - - manageStatusinformation("Connected to modem", "Connection to modem"); - manageStateMMI(STATE_START); - - // TODO : to improve - SoundModemConfiguration smc = new SoundModemConfiguration("default"); - smc.setSmIPadress(FieldIP.getText()); - smc.setSmPort(Integer.parseInt(FieldPort.getText())); - - if (task == null) { - receivedFrame - .addPropertyChangeListener(new PropertyChangeListener() { - @Override - public void propertyChange(PropertyChangeEvent evt) { - final Frame decodedData = receivedFrame - .getLastDecodedData(); - Platform.runLater(new Runnable() { - @Override - public void run() { - try { - - if (decodedData != null) { - displayLog(decodedData - .toStringHeader()); - displayLog(decodedData.toString()); - displayLog(decodedData - .toStringDecoded()); - DecodedData.appendText(decodedData - .toStringDecoded() - + "\r\n"); - updateFrame(receivedFrame - .getNumberFrame()); - UpdateDecodedData(decodedData); - SendSids(receivedFrame.getLastReceivedData()); - - } else { - displayLog( - "received frame : null"); - } - - } catch (Exception e) { - displayLog("Run - error"); - displayLog(e.toString()); - e.printStackTrace(); - } - - } - - - }); - } - - } - - ); + private static final String LINE_SEPARATOR = "\r\n"; + private static final int STATE_INIT = 0; + private static final int STATE_START = 1; + protected static final int STATE_STOP = 2; + private static final int STATE_SAVE = 3; - } - task = new TaskSoundmodemTCP(smc, receivedFrame); + private static Logger appLogger = Logger.getLogger("AmsatLogger"); - task.setOnSucceeded(new EventHandler() { - - @Override - public void handle(WorkerStateEvent event) { - // La tache s'est correctement terminee. - manageStatusinformation("KISS TCP CONNECTION FAILED", - "KISS TCP DISCONNECTED"); - manageStateMMI(STATE_STOP); - - } - - }); - - task.setOnFailed(new EventHandler() { - - @Override - public void handle(WorkerStateEvent event) { - // La tache s'est correctement terminee. - manageStatusinformation("KISS TCP CONNECTION FAILED", - "KISS TCP DISCONNECTED - Connection failed"); - displayLog(event.toString()); - displayLog(event.getSource().toString()); - manageStateMMI(STATE_STOP); - } - - }); - - Thread backgroundThread = new Thread(task); - backgroundThread.setDaemon(true); - backgroundThread.start(); + private String version = "1.1"; + @FXML private Button ButtonStart; + @FXML private Button ButtonStop; + @FXML private Button ButtonSave; + @FXML private Label LabelIP; + + @FXML private Button ButtonFile; + @FXML private Button ButtonSerial; + @FXML private Button ButtonKiss; + + @FXML private TextField FieldIP; + @FXML private TextField FieldPort; + + @FXML private Label labelStatus; + @FXML private Label LabelFrame; + + @FXML private TextArea DecodedData; + + @FXML private TextArea TexAreaLog; + + @FXML private TextField textFieldMode; + + @FXML private TextField textFieldDate; + + @FXML private Label LabelInformation; + @FXML private TextField textFieldbEps33VCurrent; + @FXML private TextField TextFieldEps5VCurrent; + @FXML private TextField TextFieldepsBattVcurrent; + @FXML private TextField TextFieldEpsTemp; + @FXML private TextField TextFieldTrxTemp; + @FXML private TextField TextFieldEPSVBAT; + + @FXML private TextField TFBattTemp; + + @FXML private ImageView ImageViewAMSAT; + + @FXML private ImageView imageViewEntrysat; + + @FXML private TextField TextFieldCallsign; + @FXML private TextField TextFieldLatitude; + @FXML private TextField TextFieldLongitude; + + @FXML private CheckBox CheckbBoxAmicalSat; + @FXML private CheckBox CheckBoxSatNogs; + + @FXML private Button ButtonSaveConfiguration; + + @FXML private TextField TextFieldSIDSEntrysat; + @FXML private TextField TextFieldSIDSSatnogs; + + @FXML private TextField tfEMVin; + @FXML private TextField tfERVin; + + @FXML private TextField tfM1Bootnumber; + @FXML private TextField tfM1CPUvoltage; + @FXML private TextField tfM1Uptime; + @FXML private TextField tfM1CPUtemperature; + @FXML private TextField tfM1HexFlag; + + @FXML private TextField tfMNEMtimestamps; + @FXML private TextField tfMNERtimestamps; + @FXML private TextField tfMNEMVin; + @FXML private TextField tfMNERVin; + @FXML private TextField tfMNEMIin; + @FXML private TextField tfMNERIin; + @FXML private TextField tfMNEMPin; + @FXML private TextField tfMREMPin; + @FXML private TextField tfMNEMPpeak; + @FXML private TextField tfMNERPpeak; + @FXML private TextField tfMNEMVsolar; + @FXML private TextField tfMNERVsolar; + @FXML private TextField tfMNEMTcpu; + @FXML private TextField tfMNERTcpu; + @FXML private TextField tfMNEMVcpu; + @FXML private TextField tfMNERVcpu; + + @FXML private TextField tfDateCurrent; + + @FXML private TextField tfTypeCurrent; + + @FXML private TextField tfAreaCurrent; + @FXML private TextField tfM1Logdate; + @FXML private TextField tfM1Flagsdate; + + @FXML private TextField tfLOGEMtimestamps; + @FXML private TextField tfLOGERtimestamps; + @FXML private TextField tfLogEMBootnumber; + @FXML private TextField tfLogEMInputvoltage; + @FXML private TextField tfLogEMInputpower; + @FXML private TextField tfLogEMPeakPower; + @FXML private TextField tfLogERBootnumber; + @FXML private TextField tfLogERInputvoltage; + @FXML private TextField tfLogERInputpower; + @FXML private TextField tfLogERPeakPower; + @FXML private TextField tfLogEMSolarpanelvoltage; + @FXML private TextField tfLogERSolarpanelvoltage; + + @FXML private TextField tfRLV1timeStamps; + @FXML private TextField tfRLU2timeStamps; + @FXML private TextField tfRLV1CPUvoltage; + @FXML private TextField tfRLU2CPUvoltage; + @FXML private TextField tfRLV1Batteryvoltage; + @FXML private TextField tfRLU2Batteryvoltage; + @FXML private TextField tfRLV1CPUtemperature; + @FXML private TextField tfRLU2CPUtemperature; + @FXML private TextField tfRLV1Amplifiertemperature; + @FXML private TextField tfRLU2Amplifiertemperature; + @FXML private TextField tfRLV1Flags; + @FXML private TextField tfRLU2Flags; + + @FXML private TextField tfMSV1Currentrssi; + @FXML private TextField tfMSU2Currentrssi; + @FXML private TextField tfMSV1timeStamps; + @FXML private TextField tfMSU2timeStamps; + @FXML private TextField tfMSV1Latchrssi; + @FXML private TextField tfMSU2Latchrssi; + @FXML private TextField tfMSV1AFCoffset; + @FXML private TextField tfMSU2AFCoffset; + @FXML private TextField tfA1FLAGStimeSpamps; + @FXML private TextField tfA1FLAGmode; + @FXML private TextField tfA1FLAGflags; + @FXML private TextField tfA1FLAGfaults; + @FXML private TextField tfA1MAGStimeSpamps; + @FXML private TextField tfA1MAGMagX; + @FXML private TextField tfA1MAGMagY; + @FXML private TextField tfA1MAGMagZ; + @FXML private TextField tfA1GIROStimeSpamps; + @FXML private TextField tfA1GIROGyroX; + @FXML private TextField tfA1GIROGyroY; + @FXML private TextField tfA1GIROGyroZ; + @FXML private TextField tfA1POSITIONStimeSpamps; + @FXML private TextField tfA1POSITIONLatitude; + @FXML private TextField tfA1POSITIONLongitude; + @FXML private TextField tfCURLOGtimeStamps; + @FXML private TextField tfCURLOGCPUvoltage; + @FXML private TextField tfCURLOGCPUtemperature; + @FXML private TextField tfCURLOGflags; + @FXML private TextField tfCULROGtimeStamps; + @FXML private TextField tfCULLOGCPUvoltage; + @FXML private TextField tfCULLOGCPUtemperature; + @FXML private TextField tfCULLOGflags; + @FXML private TextField tfCURONYXtimeStamps; + @FXML private TextField tfCULONYXtimeStamps; + @FXML private TextField tfCURONYXReturnvalue; + @FXML private TextField tfCULONYXReturnvalue; + @FXML private TextField tfMNERPin; + + Stage primaryStage = null; + + private String imgAmsat = "logoAmsat.png"; + private String imgAmicalsat = "Amicalsat.jpg"; + + Station station = new Station(); + + ModelReceivedData receivedFrame = new ModelReceivedData(); + Configuration conf = Configuration.getInstance(); + + private TaskSoundmodemTCP task; + private SendSIDS SendSIDSSatnogs; + private SendSIDS SendSIDSMVPAmsat; + private LogFile logfile = null; + + @FXML + private void HandleSaveConfiguration(ActionEvent event) { + + String erreurmsg = null; + String Callsign = null; + + if (TextFieldCallsign.getText().isEmpty()) { + erreurmsg += "please enter a CallSign \r\n"; + } else { + Callsign = TextFieldCallsign.getText(); } - @FXML - private void handleStop(ActionEvent event) { + String Latitude = TextFieldLatitude.getText(); + String Longitude = TextFieldLongitude.getText(); - manageStateMMI(STATE_STOP); - task.arreter(); - manageStatusinformation("Stop received data", - "Stop task to receive telemetrie"); + if (station.checkLatitude(Latitude) == false) { + erreurmsg += "Wrong format for Latitude : XX.XXE/W \r\n"; } - @FXML - private void handleSave(ActionEvent event) { - - manageStateMMI(STATE_SAVE); - manageStatusinformation("save data", "save Telemetry in file"); - saveDataFile(); - manageStatusinformation("Data Saved", "Telemetry Data saved in file"); + if (station.checkLongitude(Longitude) == false) { + erreurmsg += "Wrong format for Longitude : XX.XXS/N \r\n"; } - - @FXML - private void HandleIP(ActionEvent event) { + if (erreurmsg != null) { + Window owner = ButtonSaveConfiguration.getScene().getWindow(); + AlertHelper.showAlert(Alert.AlertType.ERROR, owner, "Form Error!", erreurmsg); + return; } - @FXML - private void HandlePort(ActionEvent event) { + station.setCallsign(Callsign); + station.setLatitude(Latitude); + station.setLongitude(Longitude); + + conf.setCallsign(Callsign); + conf.setLatitude(Latitude); + conf.setLongitude(Longitude); + + conf.setSIDSAMSATSource(TextFieldSIDSEntrysat.getText()); + conf.setSIDSSatnogsSource(TextFieldSIDSSatnogs.getText()); + conf.setSoundModemIP(FieldIP.getText()); + conf.setSoundModemPort(FieldPort.getText()); + + Station StationSatnogs = + new Station(conf.getSIDSSatnogsSource(), station.getLongitude(), station.getLatitude()); + Station StationEntry = + new Station(conf.getSIDSAMSATSource(), station.getLongitude(), station.getLatitude()); + + if (CheckbBoxAmicalSat.isSelected() == true) { + conf.setSIDSAMSAT("1"); + SendSIDSMVPAmsat = new SendSIDS(StationEntry, conf.getNorad(), conf.getSIDSAMSATUrl()); + } else { + conf.setSIDSAMSAT("0"); } - public void initMMI() { - - logfile = new LogFile(); - // initialise le log - // initdisplayLogFile(); - - manageStatusinformation("Initialised", - "AMICALSAT DECODER - LOG \r\n Initialise application"); - appLogger.warning("Initialise "); - primaryStage.setTitle("AmicalSat Decoder - " + version); - - station.setCallsign(conf.getCallsign()); - station.setLatitude(conf.getLatitude()); - station.setLongitude(conf.getLongitude()); - - TextFieldCallsign.setText(station.getCallsign()); - TextFieldLatitude.setText(station.getLatitude()); - TextFieldLongitude.setText(station.getLongitude()); - - TextFieldSIDSEntrysat.setText(conf.getSIDSAMSATSource()); - TextFieldSIDSSatnogs.setText(conf.getSIDSSatnogsSource()); - - FieldIP.setText(conf.getSoundModemIP()); - FieldPort.setText(conf.getSoundModemPort()); - - if (conf.isSIDS_AMSAT()) { - CheckbBoxAmicalSat.setSelected(true); - } - if (conf.isSISD_SatNogs()) { - CheckBoxSatNogs.setSelected(true); - } - - displayLog(conf.getSIDSSatnogsURL()); - displayLog(conf.getSIDSAMSATUrl()); - displayLog("Initialisation with Properties File Done "); - - BufferedImage bufferedImage1 = null; - BufferedImage bufferedImage2 = null; - - try { - - bufferedImage1 = ImageIO.read(getClass().getResource((imgAmsat))); - bufferedImage2 = ImageIO - .read(getClass().getResource((imgAmicalsat))); - } catch (IOException e) { - - appLogger.severe("Error loading Image resources"); - appLogger.severe(e.toString()); - } - Image imageamsat = SwingFXUtils.toFXImage(bufferedImage1, null); - ImageViewAMSAT.setImage(imageamsat); - Image imgQB = SwingFXUtils.toFXImage(bufferedImage2, null); - imageViewEntrysat.setImage(imgQB); - - ConfigHttp c = new ConfigHttp( - "http://site.amsat-f.org/download/117168/"); - String ver; - String message; - int NoradIdConf = conf.getNorad(); - if (c.isConnected()) { - ver = c.getProperty("AmicalsatVersion"); - message = c.getProperty("Message"); - String noradid = c.getProperty("NoradID"); - - if(noradid!=null) - { - NoradIdConf = Integer - .parseUnsignedInt(c.getProperty("NoradID").trim()); - - } - } else { - ver = version; - message = "not connected to internet"; - } - if (NoradIdConf != 0) - { - // ID norad attribué - mise à jours du logiciel - if (NoradIdConf != conf.getNorad()) { - conf.setNorad(NoradIdConf); - conf.save(); - displayLog("Norad ID updated "); - } - } + if (CheckBoxSatNogs.isSelected() == true) { + conf.setSIDSSatnogs("1"); + SendSIDSSatnogs = new SendSIDS(StationSatnogs, conf.getNorad(), conf.getSIDSSatnogsURL()); + } else { + conf.setSIDSSatnogs("0"); + } - manageStateMMI(STATE_INIT); - manageStatusinformation("Application Ready", "Application initialised"); - this.LabelInformation.setText(""); + conf.save(); + manageStatusinformation("Configuration Saved", "Configuration Saved"); + } - // initialise SIDS + @FXML + private void handleStart(ActionEvent event) { - Station StationSatnogs = new Station(conf.getSIDSSatnogsSource(), - station.getLongitude(), station.getLatitude()); - Station StationEntry = new Station(conf.getSIDSAMSATSource(), - station.getLongitude(), station.getLatitude()); + manageStatusinformation("Connected to modem", "Connection to modem"); + manageStateMMI(STATE_START); - if (conf.isSISD_SatNogs() == true) { - SendSIDSSatnogs = new SendSIDS(StationSatnogs, conf.getNorad(), - conf.getSIDSSatnogsURL()); - } + // TODO : to improve + SoundModemConfiguration smc = new SoundModemConfiguration("default"); + smc.setSmIPadress(FieldIP.getText()); + smc.setSmPort(Integer.parseInt(FieldPort.getText())); - if (conf.isSIDS_AMSAT() == true) { - SendSIDSMVPAmsat = new SendSIDS(StationEntry, conf.getNorad(), - conf.getSIDSAMSATUrl()); - } + if (task == null) { + receivedFrame.addPropertyChangeListener( + new PropertyChangeListener() { + @Override + public void propertyChange(PropertyChangeEvent evt) { + final Frame decodedData = receivedFrame.getLastDecodedData(); + Platform.runLater( + new Runnable() { + @Override + public void run() { + try { + + if (decodedData != null) { + displayLog(decodedData.toStringHeader()); + displayLog(decodedData.toString()); + displayLog(decodedData.toStringDecoded()); + DecodedData.appendText(decodedData.toStringDecoded() + "\r\n"); + updateFrame(receivedFrame.getNumberFrame()); + UpdateDecodedData(decodedData); + SendSids(receivedFrame.getLastReceivedData()); + + } else { + displayLog("received frame : null"); + } - String erreurmsg = message; + } catch (Exception e) { + displayLog("Run - error"); + displayLog(e.toString()); + e.printStackTrace(); + } + } + }); + } + }); + } + task = new TaskSoundmodemTCP(smc, receivedFrame); - if (ver.equals(version) == false) { - erreurmsg += " New version " + ver + " available ! "; + task.setOnSucceeded( + new EventHandler() { - } - this.LabelInformation.setText(erreurmsg); + @Override + public void handle(WorkerStateEvent event) { + // La tache s'est correctement terminee. + manageStatusinformation("KISS TCP CONNECTION FAILED", "KISS TCP DISCONNECTED"); + manageStateMMI(STATE_STOP); + } + }); - } + task.setOnFailed( + new EventHandler() { + + @Override + public void handle(WorkerStateEvent event) { + // La tache s'est correctement terminee. + manageStatusinformation( + "KISS TCP CONNECTION FAILED", "KISS TCP DISCONNECTED - Connection failed"); + displayLog(event.toString()); + displayLog(event.getSource().toString()); + manageStateMMI(STATE_STOP); + } + }); - public void setPrimaryStage(Stage primaryStage) { - this.primaryStage = primaryStage; + Thread backgroundThread = new Thread(task); + backgroundThread.setDaemon(true); + backgroundThread.start(); + } - } + @FXML + private void handleStop(ActionEvent event) { - /** - * Save telemetry data received in text file. The file is stored in data - * folder. - */ - public void saveDataFile() { - SimpleDateFormat formater = new SimpleDateFormat("yyyy-MM-dd-HHmmss"); - Date aujourdhui = new Date(); + manageStateMMI(STATE_STOP); + task.arreter(); + manageStatusinformation("Stop received data", "Stop task to receive telemetrie"); + } - // + @FXML + private void handleSave(ActionEvent event) { - String path = System.getProperty("user.dir") + "/data"; - File apath = new File(path); + manageStateMMI(STATE_SAVE); + manageStatusinformation("save data", "save Telemetry in file"); + saveDataFile(); + manageStatusinformation("Data Saved", "Telemetry Data saved in file"); + } - if (!apath.exists()) { - if (apath.mkdir() == false) { - appLogger.severe("fail to create " + path); - } - } + @FXML + private void HandleIP(ActionEvent event) {} - PrintWriter pw = null; + @FXML + private void HandlePort(ActionEvent event) {} - long NbFrame = receivedFrame.getNumberFrame(); + public void initMMI() { - try { - pw = new PrintWriter(new FileWriter(path + "/" - + formater.format(aujourdhui) + "-tlm-Hexa.txt")); - for (int i = 0; i < NbFrame; i++) { - pw.write(receivedFrame.getRawFrame(i)); - pw.write(LINE_SEPARATOR); - } + logfile = new LogFile(); + // initialise le log + // initdisplayLogFile(); - pw.flush(); - pw.close(); - } catch (IOException e) { - e.printStackTrace(); - } + manageStatusinformation("Initialised", "AMICALSAT DECODER - LOG \r\n Initialise application"); + appLogger.warning("Initialise "); + primaryStage.setTitle("AmicalSat Decoder - " + version); - } + station.setCallsign(conf.getCallsign()); + station.setLatitude(conf.getLatitude()); + station.setLongitude(conf.getLongitude()); - private void updateFrame(long nbframe) { - LabelFrame.setText("frame : " + nbframe); + TextFieldCallsign.setText(station.getCallsign()); + TextFieldLatitude.setText(station.getLatitude()); + TextFieldLongitude.setText(station.getLongitude()); - } + TextFieldSIDSEntrysat.setText(conf.getSIDSAMSATSource()); + TextFieldSIDSSatnogs.setText(conf.getSIDSSatnogsSource()); - private void displayLog(String log) { - appLogger.info(log); - logfile.displayLog(log); - TexAreaLog.appendText(log); - TexAreaLog.appendText("\r\n"); - } + FieldIP.setText(conf.getSoundModemIP()); + FieldPort.setText(conf.getSoundModemPort()); - private void manageStateMMI(int state) { - switch (state) { - case STATE_INIT: - ButtonStop.setDisable(true); - ButtonStart.setDisable(false); - ButtonSave.setDisable(true); - break; - case STATE_START: - ButtonStop.setDisable(false); - ButtonStart.setDisable(true); - ButtonSave.setDisable(false); - break; - case STATE_STOP: - ButtonStop.setDisable(true); - ButtonStart.setDisable(false); - ButtonSave.setDisable(false); - break; - case STATE_SAVE: - ButtonStop.setDisable(true); - ButtonStart.setDisable(false); - ButtonSave.setDisable(true); - break; - default : - ButtonStop.setDisable(true); - ButtonStart.setDisable(false); - ButtonSave.setDisable(false); - break; - } + if (conf.isSIDS_AMSAT()) { + CheckbBoxAmicalSat.setSelected(true); } - - private void manageStatusinformation(String statusMessage, - String logMessage) { - labelStatus.setText(statusMessage); - displayLog(logMessage); - + if (conf.isSISD_SatNogs()) { + CheckBoxSatNogs.setSelected(true); } - private void UpdateDecodedData(Frame decodedData) { - - String tlmArea = decodedData.getTlmArea(); - String typeFrame = decodedData.getTypeFrame(); + displayLog(conf.getSIDSSatnogsURL()); + displayLog(conf.getSIDSAMSATUrl()); + displayLog("Initialisation with Properties File Done "); - tfDateCurrent.setText(decodedData.getTimseStampsGregorian()); - tfTypeCurrent.setText(typeFrame); - tfAreaCurrent.setText(tlmArea); + BufferedImage bufferedImage1 = null; + BufferedImage bufferedImage2 = null; - if (tlmArea.compareTo("M1") == 0) { - - if (typeFrame.compareTo("LOG") == 0) { - - M1LogTypeFrame m1LogTypeFrame = (M1LogTypeFrame) decodedData; - tfM1Logdate - .setText("" + m1LogTypeFrame.getTimseStampsGregorian()); - tfM1Bootnumber - .setText("" + m1LogTypeFrame.getBootNumberValue()); - tfM1CPUvoltage.setText("" + m1LogTypeFrame.getCpuVoltageVolt()); - tfM1Uptime.setText("" + m1LogTypeFrame.getUpTimeSec()); - tfM1CPUtemperature - .setText("" + m1LogTypeFrame.getCpuTemperatureDegree()); - - } + try { - if (typeFrame.compareTo("FLAGS") == 0) { + bufferedImage1 = ImageIO.read(getClass().getResource((imgAmsat))); + bufferedImage2 = ImageIO.read(getClass().getResource((imgAmicalsat))); + } catch (IOException e) { - FlagsTypeFrame m1FlagsTypeFrame = (FlagsTypeFrame) decodedData; - tfM1Flagsdate.setText(""+ m1FlagsTypeFrame.getTimseStampsGregorian()); - tfM1HexFlag.setText(m1FlagsTypeFrame.getHexFlags()); -// frame = new FlagsTypeFrame(); - - } - } + appLogger.severe("Error loading Image resources"); + appLogger.severe(e.toString()); + } + Image imageamsat = SwingFXUtils.toFXImage(bufferedImage1, null); + ImageViewAMSAT.setImage(imageamsat); + Image imgQB = SwingFXUtils.toFXImage(bufferedImage2, null); + imageViewEntrysat.setImage(imgQB); + + ConfigHttp c = new ConfigHttp("http://site.amsat-f.org/download/117168/"); + String ver; + String message; + int NoradIdConf = conf.getNorad(); + if (c.isConnected()) { + ver = c.getProperty("AmicalsatVersion"); + message = c.getProperty("Message"); + String noradid = c.getProperty("NoradID"); + + if (noradid != null) { + NoradIdConf = Integer.parseUnsignedInt(c.getProperty("NoradID").trim()); + } + } else { + ver = version; + message = "not connected to internet"; + } + if (NoradIdConf != 0) { + // ID norad attribué - mise à jours du logiciel + if (NoradIdConf != conf.getNorad()) { + conf.setNorad(NoradIdConf); + conf.save(); + displayLog("Norad ID updated "); + } + } - if (tlmArea.compareTo("A1") == 0) { + manageStateMMI(STATE_INIT); + manageStatusinformation("Application Ready", "Application initialised"); + this.LabelInformation.setText(""); - if (typeFrame.compareTo("FLAGS") == 0) { + // initialise SIDS - A1FlagTypeFrame a1FlagTypeFrame = (A1FlagTypeFrame) decodedData; - tfA1FLAGStimeSpamps - .setText(a1FlagTypeFrame.getTimseStampsGregorian()); - ; - tfA1FLAGmode.setText(a1FlagTypeFrame.getMode()); - tfA1FLAGflags.setText(a1FlagTypeFrame.getA1Flags()); - tfA1FLAGfaults.setText("" + a1FlagTypeFrame.getFaultsValue()); -// frame = new A1FlagTypeFrame(); - } + Station StationSatnogs = + new Station(conf.getSIDSSatnogsSource(), station.getLongitude(), station.getLatitude()); + Station StationEntry = + new Station(conf.getSIDSAMSATSource(), station.getLongitude(), station.getLatitude()); - if (typeFrame.compareTo("MAG") == 0) { -// frame = new A1MagTypeFrame(); + if (conf.isSISD_SatNogs() == true) { + SendSIDSSatnogs = new SendSIDS(StationSatnogs, conf.getNorad(), conf.getSIDSSatnogsURL()); + } - A1MagTypeFrame a1MagTypeFrame = (A1MagTypeFrame) decodedData; - tfA1MAGStimeSpamps - .setText(a1MagTypeFrame.getTimseStampsGregorian()); - tfA1MAGMagX.setText("" + a1MagTypeFrame.getMagXValue()); - tfA1MAGMagY.setText("" + a1MagTypeFrame.getMagYValue()); - tfA1MAGMagZ.setText("" + a1MagTypeFrame.getMagZValue()); + if (conf.isSIDS_AMSAT() == true) { + SendSIDSMVPAmsat = new SendSIDS(StationEntry, conf.getNorad(), conf.getSIDSAMSATUrl()); + } - } + String erreurmsg = message; - if (typeFrame.compareTo("GYRO") == 0) { + if (ver.equals(version) == false) { + erreurmsg += " New version " + ver + " available ! "; + } + this.LabelInformation.setText(erreurmsg); + } - A1GyroTypeFrame a1GyroTypeFrame = (A1GyroTypeFrame) decodedData; - tfA1GIROStimeSpamps - .setText(a1GyroTypeFrame.getTimseStampsGregorian()); - tfA1GIROGyroX.setText("" + a1GyroTypeFrame.getGyroXValue()); - tfA1GIROGyroY.setText("" + a1GyroTypeFrame.getGyroYValue()); - tfA1GIROGyroZ.setText("" + a1GyroTypeFrame.getGyroZValue()); + public void setPrimaryStage(Stage primaryStage) { + this.primaryStage = primaryStage; + } - } - // # #A1;POSITION;[Current timestamp];[Latitude];[Longitude] - if (typeFrame.compareTo("POSITION") == 0) { + /** Save telemetry data received in text file. The file is stored in data folder. */ + public void saveDataFile() { + SimpleDateFormat formater = new SimpleDateFormat("yyyy-MM-dd-HHmmss"); + Date aujourdhui = new Date(); - A1PositionTypeFrame a1PositionTypeFrame = (A1PositionTypeFrame) decodedData; - tfA1POSITIONStimeSpamps - .setText(a1PositionTypeFrame.getTimseStampsGregorian()); - tfA1POSITIONLatitude.setText(a1PositionTypeFrame.getLatitude()); + // - tfA1POSITIONLongitude - .setText(a1PositionTypeFrame.getLongitude()); + String path = System.getProperty("user.dir") + "/data"; + File apath = new File(path); - } - } - if (tlmArea.compareTo("EM") == 0) { - - if (typeFrame.compareTo("MN") == 0) { - - EmmnTypeFrame emmnTypeFrame = (EmmnTypeFrame) decodedData; - tfMNEMtimestamps - .setText(emmnTypeFrame.getTimseStampsGregorian()); - tfMNEMVin.setText("" + emmnTypeFrame.getvInVolt()); - tfMNEMIin.setText("" + emmnTypeFrame.getiInMa()); - tfMNEMPin.setText("" + emmnTypeFrame.getpInMw()); - tfMNEMPpeak.setText("" + emmnTypeFrame.getpPeakMw()); - tfMNEMVsolar.setText("" + emmnTypeFrame.getvSolarVolt()); - tfMNEMTcpu.setText("" + emmnTypeFrame.gettCpuDegree()); - tfMNEMVcpu.setText("" + emmnTypeFrame.getvCpuVolt()); + if (!apath.exists()) { + if (apath.mkdir() == false) { + appLogger.severe("fail to create " + path); + } + } - } + PrintWriter pw = null; - if (typeFrame.compareTo("LOG") == 0) { - EmLogTypeFrame emLogTypeFrame = (EmLogTypeFrame) decodedData; - - tfLOGEMtimestamps - .setText(emLogTypeFrame.getTimseStampsGregorian()); - tfLogEMBootnumber - .setText("" + emLogTypeFrame.getBootNumberInt()); - tfLogEMInputvoltage - .setText("" + emLogTypeFrame.getInputVoltageVolt()); - tfLogEMInputpower - .setText("" + emLogTypeFrame.getInputPowerMw()); - tfLogEMPeakPower.setText("" + emLogTypeFrame.getPeakPowerMw()); - tfLogEMSolarpanelvoltage.setText( - "" + emLogTypeFrame.getSolarPanelVoltageVolt()); + long NbFrame = receivedFrame.getNumberFrame(); - } + try { + pw = + new PrintWriter( + new FileWriter(path + "/" + formater.format(aujourdhui) + "-tlm-Hexa.txt")); + for (int i = 0; i < NbFrame; i++) { + pw.write(receivedFrame.getRawFrame(i)); + pw.write(LINE_SEPARATOR); + } - } + pw.flush(); + pw.close(); + } catch (IOException e) { + e.printStackTrace(); + } + } + + private void updateFrame(long nbframe) { + LabelFrame.setText("frame : " + nbframe); + } + + private void displayLog(String log) { + appLogger.info(log); + logfile.displayLog(log); + TexAreaLog.appendText(log); + TexAreaLog.appendText("\r\n"); + } + + private void manageStateMMI(int state) { + switch (state) { + case STATE_INIT: + ButtonStop.setDisable(true); + ButtonStart.setDisable(false); + ButtonSave.setDisable(true); + break; + case STATE_START: + ButtonStop.setDisable(false); + ButtonStart.setDisable(true); + ButtonSave.setDisable(false); + break; + case STATE_STOP: + ButtonStop.setDisable(true); + ButtonStart.setDisable(false); + ButtonSave.setDisable(false); + break; + case STATE_SAVE: + ButtonStop.setDisable(true); + ButtonStart.setDisable(false); + ButtonSave.setDisable(true); + break; + default: + ButtonStop.setDisable(true); + ButtonStart.setDisable(false); + ButtonSave.setDisable(false); + break; + } + } - if (tlmArea.compareTo("CU_R") == 0) { + private void manageStatusinformation(String statusMessage, String logMessage) { + labelStatus.setText(statusMessage); + displayLog(logMessage); + } - if (typeFrame.compareTo("LOG") == 0) { - CuLogTypeFrame cuLogTypeFrame = (CuLogTypeFrame) decodedData; + private void UpdateDecodedData(Frame decodedData) { - tfCURLOGtimeStamps - .setText(cuLogTypeFrame.getTimseStampsGregorian()); - tfCURLOGCPUvoltage - .setText("" + cuLogTypeFrame.getCpuVoltageVolt()); - tfCURLOGCPUtemperature - .setText("" + cuLogTypeFrame.getCpuTemperatureDegree()); - tfCURLOGflags.setText(cuLogTypeFrame.getFlags()); + String tlmArea = decodedData.getTlmArea(); + String typeFrame = decodedData.getTypeFrame(); - } - } + tfDateCurrent.setText(decodedData.getTimseStampsGregorian()); + tfTypeCurrent.setText(typeFrame); + tfAreaCurrent.setText(tlmArea); - if (tlmArea.compareTo("CU_L") == 0) { + if (tlmArea.compareTo("M1") == 0) { - if (typeFrame.compareTo("LOG") == 0) { + if (typeFrame.compareTo("LOG") == 0) { - CuLogTypeFrame cuLogTypeFrame = (CuLogTypeFrame) decodedData; + M1LogTypeFrame m1LogTypeFrame = (M1LogTypeFrame) decodedData; + tfM1Logdate.setText("" + m1LogTypeFrame.getTimseStampsGregorian()); + tfM1Bootnumber.setText("" + m1LogTypeFrame.getBootNumberValue()); + tfM1CPUvoltage.setText("" + m1LogTypeFrame.getCpuVoltageVolt()); + tfM1Uptime.setText("" + m1LogTypeFrame.getUpTimeSec()); + tfM1CPUtemperature.setText("" + m1LogTypeFrame.getCpuTemperatureDegree()); + } - tfCULROGtimeStamps - .setText(cuLogTypeFrame.getTimseStampsGregorian()); - tfCULLOGCPUvoltage - .setText("" + cuLogTypeFrame.getCpuVoltageVolt()); - tfCULLOGCPUtemperature - .setText("" + cuLogTypeFrame.getCpuTemperatureDegree()); - tfCULLOGflags.setText(cuLogTypeFrame.getFlags()); + if (typeFrame.compareTo("FLAGS") == 0) { - } - } + FlagsTypeFrame m1FlagsTypeFrame = (FlagsTypeFrame) decodedData; + tfM1Flagsdate.setText("" + m1FlagsTypeFrame.getTimseStampsGregorian()); + tfM1HexFlag.setText(m1FlagsTypeFrame.getHexFlags()); + // frame = new FlagsTypeFrame(); - if (tlmArea.compareTo("V1") == 0) { + } + } - // #[V1/U2];MS;[Timestamp];[Current rssi];[Latch rssi];[AFC offset ] + if (tlmArea.compareTo("A1") == 0) { + + if (typeFrame.compareTo("FLAGS") == 0) { + + A1FlagTypeFrame a1FlagTypeFrame = (A1FlagTypeFrame) decodedData; + tfA1FLAGStimeSpamps.setText(a1FlagTypeFrame.getTimseStampsGregorian()); + ; + tfA1FLAGmode.setText(a1FlagTypeFrame.getMode()); + tfA1FLAGflags.setText(a1FlagTypeFrame.getA1Flags()); + tfA1FLAGfaults.setText("" + a1FlagTypeFrame.getFaultsValue()); + // frame = new A1FlagTypeFrame(); + } + + if (typeFrame.compareTo("MAG") == 0) { + // frame = new A1MagTypeFrame(); + + A1MagTypeFrame a1MagTypeFrame = (A1MagTypeFrame) decodedData; + tfA1MAGStimeSpamps.setText(a1MagTypeFrame.getTimseStampsGregorian()); + tfA1MAGMagX.setText("" + a1MagTypeFrame.getMagXValue()); + tfA1MAGMagY.setText("" + a1MagTypeFrame.getMagYValue()); + tfA1MAGMagZ.setText("" + a1MagTypeFrame.getMagZValue()); + } + + if (typeFrame.compareTo("GYRO") == 0) { + + A1GyroTypeFrame a1GyroTypeFrame = (A1GyroTypeFrame) decodedData; + tfA1GIROStimeSpamps.setText(a1GyroTypeFrame.getTimseStampsGregorian()); + tfA1GIROGyroX.setText("" + a1GyroTypeFrame.getGyroXValue()); + tfA1GIROGyroY.setText("" + a1GyroTypeFrame.getGyroYValue()); + tfA1GIROGyroZ.setText("" + a1GyroTypeFrame.getGyroZValue()); + } + // # #A1;POSITION;[Current timestamp];[Latitude];[Longitude] + if (typeFrame.compareTo("POSITION") == 0) { + + A1PositionTypeFrame a1PositionTypeFrame = (A1PositionTypeFrame) decodedData; + tfA1POSITIONStimeSpamps.setText(a1PositionTypeFrame.getTimseStampsGregorian()); + tfA1POSITIONLatitude.setText(a1PositionTypeFrame.getLatitude()); + + tfA1POSITIONLongitude.setText(a1PositionTypeFrame.getLongitude()); + } + } + if (tlmArea.compareTo("EM") == 0) { + + if (typeFrame.compareTo("MN") == 0) { + + EmmnTypeFrame emmnTypeFrame = (EmmnTypeFrame) decodedData; + tfMNEMtimestamps.setText(emmnTypeFrame.getTimseStampsGregorian()); + tfMNEMVin.setText("" + emmnTypeFrame.getvInVolt()); + tfMNEMIin.setText("" + emmnTypeFrame.getiInMa()); + tfMNEMPin.setText("" + emmnTypeFrame.getpInMw()); + tfMNEMPpeak.setText("" + emmnTypeFrame.getpPeakMw()); + tfMNEMVsolar.setText("" + emmnTypeFrame.getvSolarVolt()); + tfMNEMTcpu.setText("" + emmnTypeFrame.gettCpuDegree()); + tfMNEMVcpu.setText("" + emmnTypeFrame.getvCpuVolt()); + } + + if (typeFrame.compareTo("LOG") == 0) { + EmLogTypeFrame emLogTypeFrame = (EmLogTypeFrame) decodedData; + + tfLOGEMtimestamps.setText(emLogTypeFrame.getTimseStampsGregorian()); + tfLogEMBootnumber.setText("" + emLogTypeFrame.getBootNumberInt()); + tfLogEMInputvoltage.setText("" + emLogTypeFrame.getInputVoltageVolt()); + tfLogEMInputpower.setText("" + emLogTypeFrame.getInputPowerMw()); + tfLogEMPeakPower.setText("" + emLogTypeFrame.getPeakPowerMw()); + tfLogEMSolarpanelvoltage.setText("" + emLogTypeFrame.getSolarPanelVoltageVolt()); + } + } - if (typeFrame.compareTo("MS") == 0) { + if (tlmArea.compareTo("CU_R") == 0) { - V1MsTypeFrame v1MsTypeFrame = (V1MsTypeFrame) decodedData; + if (typeFrame.compareTo("LOG") == 0) { + CuLogTypeFrame cuLogTypeFrame = (CuLogTypeFrame) decodedData; - tfMSV1timeStamps - .setText(v1MsTypeFrame.getTimseStampsGregorian()); - tfMSV1Currentrssi - .setText("" + v1MsTypeFrame.getCurrentRssiMa()); + tfCURLOGtimeStamps.setText(cuLogTypeFrame.getTimseStampsGregorian()); + tfCURLOGCPUvoltage.setText("" + cuLogTypeFrame.getCpuVoltageVolt()); + tfCURLOGCPUtemperature.setText("" + cuLogTypeFrame.getCpuTemperatureDegree()); + tfCURLOGflags.setText(cuLogTypeFrame.getFlags()); + } + } - tfMSV1Latchrssi.setText("" + v1MsTypeFrame.getLatchRssiValue()); - tfMSV1AFCoffset.setText("" + v1MsTypeFrame.getaFCOffsetValue()); + if (tlmArea.compareTo("CU_L") == 0) { - } + if (typeFrame.compareTo("LOG") == 0) { - if (typeFrame.compareTo("RL") == 0) { -// frame = new V1RlTypeFrame(); - V1RlTypeFrame v1RlTypeFrame = (V1RlTypeFrame) decodedData; - - tfRLV1timeStamps - .setText(v1RlTypeFrame.getTimseStampsGregorian()); - tfRLV1CPUvoltage - .setText("" + v1RlTypeFrame.getCpuVoltageVolt()); - tfRLV1Batteryvoltage - .setText("" + v1RlTypeFrame.getBatteryVoltageVolt()); - tfRLV1CPUtemperature - .setText("" + v1RlTypeFrame.getCpuTemperatureDegree()); - tfRLV1Amplifiertemperature.setText( - "" + v1RlTypeFrame.getAmplifierTemperatureDegree()); - tfRLV1Flags.setText("" + v1RlTypeFrame.getFlagsHexa()); + CuLogTypeFrame cuLogTypeFrame = (CuLogTypeFrame) decodedData; - } - } + tfCULROGtimeStamps.setText(cuLogTypeFrame.getTimseStampsGregorian()); + tfCULLOGCPUvoltage.setText("" + cuLogTypeFrame.getCpuVoltageVolt()); + tfCULLOGCPUtemperature.setText("" + cuLogTypeFrame.getCpuTemperatureDegree()); + tfCULLOGflags.setText(cuLogTypeFrame.getFlags()); + } + } - if (tlmArea.compareTo("U2") == 0) { + if (tlmArea.compareTo("V1") == 0) { - // #[V1/U2];MS;[Timestamp];[Current rssi];[Latch rssi];[AFC offset ] - if (typeFrame.compareTo("MS") == 0) { - // frame = new U2MsTypeFrame(); + // #[V1/U2];MS;[Timestamp];[Current rssi];[Latch rssi];[AFC offset ] - U2MsTypeFrame u2MsTypeFrame = (U2MsTypeFrame) decodedData; - tfMSU2timeStamps - .setText(u2MsTypeFrame.getTimseStampsGregorian()); - tfMSU2Currentrssi - .setText("" + u2MsTypeFrame.getCurrentRssiMa()); - tfMSU2Latchrssi.setText("" + u2MsTypeFrame.getLatchRssiValue()); - tfMSU2AFCoffset.setText("" + u2MsTypeFrame.getaFCOffsetValue()); + if (typeFrame.compareTo("MS") == 0) { - } - // #[U2];RL;[Timestamp],[CPU voltage];[Battery voltage];[CPU - // temperature];[Amplifier temperature];[Flags] - if (typeFrame.compareTo("RL") == 0) { - - U2RlTypeFrame u2RlTypeFrame = (U2RlTypeFrame) decodedData; - - tfRLU2timeStamps - .setText(u2RlTypeFrame.getTimseStampsGregorian()); - tfRLU2CPUvoltage - .setText("" + u2RlTypeFrame.getCpuVoltageVolt()); - tfRLU2Batteryvoltage - .setText("" + u2RlTypeFrame.getBatteryVoltageVolt()); - tfRLU2CPUtemperature - .setText("" + u2RlTypeFrame.getCpuTemperatureDegree()); - tfRLU2Amplifiertemperature.setText( - "" + u2RlTypeFrame.getAmplifierTemperatureDegree()); - tfRLU2Flags.setText("" + u2RlTypeFrame.getFlagsHexa()); + V1MsTypeFrame v1MsTypeFrame = (V1MsTypeFrame) decodedData; - } + tfMSV1timeStamps.setText(v1MsTypeFrame.getTimseStampsGregorian()); + tfMSV1Currentrssi.setText("" + v1MsTypeFrame.getCurrentRssiMa()); - } + tfMSV1Latchrssi.setText("" + v1MsTypeFrame.getLatchRssiValue()); + tfMSV1AFCoffset.setText("" + v1MsTypeFrame.getaFCOffsetValue()); + } - if (tlmArea.compareTo("ER") == 0) { + if (typeFrame.compareTo("RL") == 0) { + // frame = new V1RlTypeFrame(); + V1RlTypeFrame v1RlTypeFrame = (V1RlTypeFrame) decodedData; - // #[V1/U2];MS;[Timestamp];[Current rssi];[Latch rssi];[AFC offset ] - if (typeFrame.compareTo("LOG") == 0) { - EmLogTypeFrame emLogTypeFrame = (EmLogTypeFrame) decodedData; + tfRLV1timeStamps.setText(v1RlTypeFrame.getTimseStampsGregorian()); + tfRLV1CPUvoltage.setText("" + v1RlTypeFrame.getCpuVoltageVolt()); + tfRLV1Batteryvoltage.setText("" + v1RlTypeFrame.getBatteryVoltageVolt()); + tfRLV1CPUtemperature.setText("" + v1RlTypeFrame.getCpuTemperatureDegree()); + tfRLV1Amplifiertemperature.setText("" + v1RlTypeFrame.getAmplifierTemperatureDegree()); + tfRLV1Flags.setText("" + v1RlTypeFrame.getFlagsHexa()); + } + } - tfLOGERtimestamps - .setText(emLogTypeFrame.getTimseStampsGregorian()); - tfLogERBootnumber - .setText("" + emLogTypeFrame.getBootNumberInt()); - tfLogERInputvoltage - .setText("" + emLogTypeFrame.getInputVoltageVolt()); - tfLogERInputpower - .setText("" + emLogTypeFrame.getInputPowerMw()); - tfLogERPeakPower.setText("" + emLogTypeFrame.getPeakPowerMw()); - tfLogERSolarpanelvoltage.setText( - "" + emLogTypeFrame.getSolarPanelVoltageVolt()); + if (tlmArea.compareTo("U2") == 0) { + + // #[V1/U2];MS;[Timestamp];[Current rssi];[Latch rssi];[AFC offset ] + if (typeFrame.compareTo("MS") == 0) { + // frame = new U2MsTypeFrame(); + + U2MsTypeFrame u2MsTypeFrame = (U2MsTypeFrame) decodedData; + tfMSU2timeStamps.setText(u2MsTypeFrame.getTimseStampsGregorian()); + tfMSU2Currentrssi.setText("" + u2MsTypeFrame.getCurrentRssiMa()); + tfMSU2Latchrssi.setText("" + u2MsTypeFrame.getLatchRssiValue()); + tfMSU2AFCoffset.setText("" + u2MsTypeFrame.getaFCOffsetValue()); + } + // #[U2];RL;[Timestamp],[CPU voltage];[Battery voltage];[CPU + // temperature];[Amplifier temperature];[Flags] + if (typeFrame.compareTo("RL") == 0) { + + U2RlTypeFrame u2RlTypeFrame = (U2RlTypeFrame) decodedData; + + tfRLU2timeStamps.setText(u2RlTypeFrame.getTimseStampsGregorian()); + tfRLU2CPUvoltage.setText("" + u2RlTypeFrame.getCpuVoltageVolt()); + tfRLU2Batteryvoltage.setText("" + u2RlTypeFrame.getBatteryVoltageVolt()); + tfRLU2CPUtemperature.setText("" + u2RlTypeFrame.getCpuTemperatureDegree()); + tfRLU2Amplifiertemperature.setText("" + u2RlTypeFrame.getAmplifierTemperatureDegree()); + tfRLU2Flags.setText("" + u2RlTypeFrame.getFlagsHexa()); + } + } - } - if (typeFrame.compareTo("MN") == 0) { - - EmmnTypeFrame emmnTypeFrame = (EmmnTypeFrame) decodedData; - tfMNERtimestamps - .setText(emmnTypeFrame.getTimseStampsGregorian()); - tfMNERVin.setText("" + emmnTypeFrame.getvInVolt()); - tfMNERIin.setText("" + emmnTypeFrame.getiInMa()); - tfMNERPin.setText("" + emmnTypeFrame.getpInMw()); - tfMNERPpeak.setText("" + emmnTypeFrame.getpPeakMw()); - tfMNERVsolar.setText("" + emmnTypeFrame.getvSolarVolt()); - tfMNERTcpu.setText("" + emmnTypeFrame.gettCpuDegree()); - tfMNERVcpu.setText("" + emmnTypeFrame.getvCpuVolt()); + if (tlmArea.compareTo("ER") == 0) { + + // #[V1/U2];MS;[Timestamp];[Current rssi];[Latch rssi];[AFC offset ] + if (typeFrame.compareTo("LOG") == 0) { + EmLogTypeFrame emLogTypeFrame = (EmLogTypeFrame) decodedData; + + tfLOGERtimestamps.setText(emLogTypeFrame.getTimseStampsGregorian()); + tfLogERBootnumber.setText("" + emLogTypeFrame.getBootNumberInt()); + tfLogERInputvoltage.setText("" + emLogTypeFrame.getInputVoltageVolt()); + tfLogERInputpower.setText("" + emLogTypeFrame.getInputPowerMw()); + tfLogERPeakPower.setText("" + emLogTypeFrame.getPeakPowerMw()); + tfLogERSolarpanelvoltage.setText("" + emLogTypeFrame.getSolarPanelVoltageVolt()); + } + if (typeFrame.compareTo("MN") == 0) { + + EmmnTypeFrame emmnTypeFrame = (EmmnTypeFrame) decodedData; + tfMNERtimestamps.setText(emmnTypeFrame.getTimseStampsGregorian()); + tfMNERVin.setText("" + emmnTypeFrame.getvInVolt()); + tfMNERIin.setText("" + emmnTypeFrame.getiInMa()); + tfMNERPin.setText("" + emmnTypeFrame.getpInMw()); + tfMNERPpeak.setText("" + emmnTypeFrame.getpPeakMw()); + tfMNERVsolar.setText("" + emmnTypeFrame.getvSolarVolt()); + tfMNERTcpu.setText("" + emmnTypeFrame.gettCpuDegree()); + tfMNERVcpu.setText("" + emmnTypeFrame.getvCpuVolt()); + } + } + } - } - } + private void SendSids(ReceivedData receivedData) { + if (conf.isSIDS_AMSAT() == true) { + int results = SendSIDSMVPAmsat.Send(receivedData); + displayLog("Send SIDS AMSAT-F Database ; " + results); } - - private void SendSids(ReceivedData receivedData) { - - if (conf.isSIDS_AMSAT() == true) { - int results = SendSIDSMVPAmsat.Send(receivedData); - displayLog("Send SIDS AMSAT-F Database ; "+results); - } - - if (conf.isSISD_SatNogs() == true) { - int results = SendSIDSSatnogs.Send(receivedData); - displayLog("Send SIDS SatNogs Database : "+results ); - } - } - + if (conf.isSISD_SatNogs() == true) { + int results = SendSIDSSatnogs.Send(receivedData); + displayLog("Send SIDS SatNogs Database : " + results); + } + } } diff --git a/ApplicationAmicalsat/src/main/java/org/josast/ApplicationAmicalsat/ModelReceivedData.java b/ApplicationAmicalsat/src/main/java/org/josast/ApplicationAmicalsat/ModelReceivedData.java index c47b6069a807f934302608845e4779ff935d0e1b..7915ce968b33f4dbac50023e9e350a8788381b91 100644 --- a/ApplicationAmicalsat/src/main/java/org/josast/ApplicationAmicalsat/ModelReceivedData.java +++ b/ApplicationAmicalsat/src/main/java/org/josast/ApplicationAmicalsat/ModelReceivedData.java @@ -4,68 +4,57 @@ import java.beans.PropertyChangeListener; import java.beans.PropertyChangeSupport; import java.util.Date; import java.util.Vector; - import org.josast.amicalsat.FactoryConsumer; import org.josast.amicalsat.Frame; - +public class ModelReceivedData { + + long numberFrame = 0; + Vector vecRawData = new Vector(); + Vector vecDecodedData = new Vector(); + FactoryConsumer ff = new FactoryConsumer(); + private PropertyChangeSupport listenerList = new PropertyChangeSupport(this); -public class ModelReceivedData { - - long numberFrame = 0; - Vector vecRawData = new Vector(); - Vector vecDecodedData= new Vector(); - FactoryConsumer ff = new FactoryConsumer(); - - - private PropertyChangeSupport listenerList = new PropertyChangeSupport(this); - - public void addPropertyChangeListener(PropertyChangeListener listener) { - listenerList.addPropertyChangeListener(listener); - } - - public void removePropertyChangeListener(PropertyChangeListener listener) { - listenerList.removePropertyChangeListener(listener); - } - - public void addPropertyChangeListener(String propertyName, PropertyChangeListener listener) { - listenerList.addPropertyChangeListener(propertyName, listener); - } - - public void removePropertyChangeListener(String propertyName, PropertyChangeListener listener) { - listenerList.removePropertyChangeListener(propertyName, listener); - } + public void addPropertyChangeListener(PropertyChangeListener listener) { + listenerList.addPropertyChangeListener(listener); + } - public long getNumberFrame() { - return numberFrame; - } + public void removePropertyChangeListener(PropertyChangeListener listener) { + listenerList.removePropertyChangeListener(listener); + } - public ReceivedData getLastReceivedData() { - return vecRawData.lastElement(); - } - - public Frame getLastDecodedData() { - return vecDecodedData.lastElement(); - } + public void addPropertyChangeListener(String propertyName, PropertyChangeListener listener) { + listenerList.addPropertyChangeListener(propertyName, listener); + } + public void removePropertyChangeListener(String propertyName, PropertyChangeListener listener) { + listenerList.removePropertyChangeListener(propertyName, listener); + } + public long getNumberFrame() { + return numberFrame; + } - public void addFrame(byte[] received) { - long oldNumberFrame = numberFrame; - numberFrame++; - vecRawData.add(new ReceivedData(new Date(),received)); - Frame framereceived = ff.getFrame(received); - vecDecodedData.add(framereceived); - listenerList.firePropertyChange("numberFrame", oldNumberFrame, numberFrame); - - } + public ReceivedData getLastReceivedData() { + return vecRawData.lastElement(); + } - public String getRawFrame(int i) { - - return vecRawData.get(i).toString(); - } + public Frame getLastDecodedData() { + return vecDecodedData.lastElement(); + } + public void addFrame(byte[] received) { + long oldNumberFrame = numberFrame; + numberFrame++; + vecRawData.add(new ReceivedData(new Date(), received)); + Frame framereceived = ff.getFrame(received); + vecDecodedData.add(framereceived); + listenerList.firePropertyChange("numberFrame", oldNumberFrame, numberFrame); + } + public String getRawFrame(int i) { + return vecRawData.get(i).toString(); + } } diff --git a/ApplicationAmicalsat/src/main/java/org/josast/ApplicationAmicalsat/ReceivedData.java b/ApplicationAmicalsat/src/main/java/org/josast/ApplicationAmicalsat/ReceivedData.java index 4ccb059f28fb8a4a2149d4e0c397494b216ac6a4..2bddd754c83b432599317c795694b69ffedc1fbc 100644 --- a/ApplicationAmicalsat/src/main/java/org/josast/ApplicationAmicalsat/ReceivedData.java +++ b/ApplicationAmicalsat/src/main/java/org/josast/ApplicationAmicalsat/ReceivedData.java @@ -2,39 +2,35 @@ package org.josast.ApplicationAmicalsat; import java.util.Date; - public class ReceivedData { - - private Date time; - private byte [] data; - - public ReceivedData(Date receivedTime, byte [] receivedData) { - super(); - time = receivedTime; - data = receivedData ; - } - - public Date getTime() { - return time; - } - - public void setTime(Date time) { - this.time = time; - } - - - public byte[] getData() { - return data; - } - - public void setData(byte[] data) { - this.data = data; - } - - @Override - public String toString() { - return "Frame [time=" + time + "][ Frame=" + new String(data) + "]"; - } + private Date time; + private byte[] data; + + public ReceivedData(Date receivedTime, byte[] receivedData) { + super(); + time = receivedTime; + data = receivedData; + } + + public Date getTime() { + return time; + } + + public void setTime(Date time) { + this.time = time; + } + + public byte[] getData() { + return data; + } + + public void setData(byte[] data) { + this.data = data; + } + @Override + public String toString() { + return "Frame [time=" + time + "][ Frame=" + new String(data) + "]"; + } } diff --git a/ApplicationAmicalsat/src/main/java/org/josast/ApplicationAmicalsat/SendSIDS.java b/ApplicationAmicalsat/src/main/java/org/josast/ApplicationAmicalsat/SendSIDS.java index a2171159ad796cd9c014d74c111dfe8af6d66c53..582d76bc7f67f438132d3818db9ab80dca571b3a 100644 --- a/ApplicationAmicalsat/src/main/java/org/josast/ApplicationAmicalsat/SendSIDS.java +++ b/ApplicationAmicalsat/src/main/java/org/josast/ApplicationAmicalsat/SendSIDS.java @@ -2,42 +2,31 @@ package org.josast.ApplicationAmicalsat; import java.math.BigInteger; import java.util.logging.Logger; - import org.josast.SIDS.HttpPostSIDS; import org.josast.SIDS.SIDSData; import org.josast.SIDS.Station; -/** - * - * @author christophe - * - */ +/** @author christophe */ public class SendSIDS { - private static Logger appLogger = Logger.getLogger("AmsatLogger"); - SIDSData sids = new SIDSData(); - HttpPostSIDS client; - - public SendSIDS ( Station station, int norad, String url) - { - sids.setStation(station); - sids.setNoradID(norad); - client = new HttpPostSIDS(url); - - - } - - public int Send(ReceivedData data) - { - //BasicConfigurator.configure(); + private static Logger appLogger = Logger.getLogger("AmsatLogger"); + SIDSData sids = new SIDSData(); + HttpPostSIDS client; - // transforme en hexa String - String hexaString = new BigInteger(1, data.getData()).toString(16); - sids.setTelemetryData(data.getTime(),hexaString); - appLogger.info(sids.toStringBasic()); - int result = client.SendSIDSBasic(sids); - return result; + public SendSIDS(Station station, int norad, String url) { + sids.setStation(station); + sids.setNoradID(norad); + client = new HttpPostSIDS(url); + } - } + public int Send(ReceivedData data) { + // BasicConfigurator.configure(); + // transforme en hexa String + String hexaString = new BigInteger(1, data.getData()).toString(16); + sids.setTelemetryData(data.getTime(), hexaString); + appLogger.info(sids.toStringBasic()); + int result = client.SendSIDSBasic(sids); + return result; + } } diff --git a/ApplicationAmicalsat/src/main/java/org/josast/ApplicationAmicalsat/TaskSoundmodemTCP.java b/ApplicationAmicalsat/src/main/java/org/josast/ApplicationAmicalsat/TaskSoundmodemTCP.java index 1330ccd9c53f2b803874d13337252e1b550da82c..c8cc202794642a4b803dd1f6759625bff6913785 100644 --- a/ApplicationAmicalsat/src/main/java/org/josast/ApplicationAmicalsat/TaskSoundmodemTCP.java +++ b/ApplicationAmicalsat/src/main/java/org/josast/ApplicationAmicalsat/TaskSoundmodemTCP.java @@ -1,89 +1,77 @@ package org.josast.ApplicationAmicalsat; import java.util.logging.Logger; - - +import javafx.concurrent.Task; import org.josast.ModuleSoundModem.SoundModemClient; import org.josast.ModuleSoundModem.SoundModemConfiguration; -import javafx.concurrent.Task; - public class TaskSoundmodemTCP extends Task { - - private Logger log = Logger.getLogger("AmsatLogger"); - private volatile boolean running = true; - - SoundModemConfiguration smConfiguration = null; - SoundModemClient smc = null; - ModelReceivedData receivedFrame = null; + private Logger log = Logger.getLogger("AmsatLogger"); + + private volatile boolean running = true; + + SoundModemConfiguration smConfiguration = null; + SoundModemClient smc = null; + ModelReceivedData receivedFrame = null; + + /** + * @param smConfiguration fichier de configuration + * @param receivedFrame Frame Data model + */ + public TaskSoundmodemTCP( + SoundModemConfiguration smConfiguration, ModelReceivedData receivedFrame) { + this.smConfiguration = smConfiguration; + smc = new SoundModemClient(smConfiguration); + if (smc.isOpen() == false) { + this.failed(); + } + this.receivedFrame = receivedFrame; + } + + public TaskSoundmodemTCP(ModelReceivedData receivedFrame) { - /** - * @param smConfiguration fichier de configuration - * @param receivedFrame Frame Data model - */ - public TaskSoundmodemTCP(SoundModemConfiguration smConfiguration, ModelReceivedData receivedFrame) { - this.smConfiguration = smConfiguration; - smc = new SoundModemClient(smConfiguration); - if (smc.isOpen() == false) { - this.failed(); - } - this.receivedFrame = receivedFrame; + smConfiguration = new SoundModemConfiguration("default"); + smc = new SoundModemClient(smConfiguration); + if (smc.isOpen() == false) { + this.failed(); + } + this.receivedFrame = receivedFrame; + } - } + /** + * while the connection is open, the modem is listening. When a frame is received, this frame is + * added to the model + */ + @Override + protected String call() { + try { - public TaskSoundmodemTCP(ModelReceivedData receivedFrame) { - - smConfiguration = new SoundModemConfiguration("default"); - smc = new SoundModemClient(smConfiguration); - if (smc.isOpen() == false) { - this.failed(); - } - this.receivedFrame = receivedFrame; - } + while (running == true) { + if (smc.isOpen()) { + byte[] temp = smc.receivedRawData(); + receivedFrame.addFrame(temp); + this.updateValue(receivedFrame.toString()); + } else { + this.running = false; + log.severe("Erreur SoundModem closed"); + } + } + } catch (Exception e) { + log.severe("Erreur SoundModem not available"); + log.severe(e.toString()); + this.failed(); + } + return receivedFrame.toString(); + } - /** - * while the connection is open, the modem is listening. When a frame is received, - * this frame is added to the model - */ - @Override - protected String call() { - try { + public void arreter() { - while (running == true) { - if(smc.isOpen()) - { - byte[] temp = smc.receivedRawData(); - receivedFrame.addFrame(temp); - this.updateValue(receivedFrame.toString()); - } else - { - this.running=false; - log.severe("Erreur SoundModem closed"); - } - } - } catch (Exception e) { - log.severe("Erreur SoundModem not available"); - log.severe(e.toString()); - this.failed(); + this.running = false; + } - } - return receivedFrame.toString(); - } + public void redemarrer() { - - - public void arreter() { - - this.running = false; - - } - - public void redemarrer() - { - - this.running = true; - - } - + this.running = true; + } } diff --git a/ApplicationAmicalsat/src/main/java/org/josast/ApplicationAmicalsat/util/LogFile.java b/ApplicationAmicalsat/src/main/java/org/josast/ApplicationAmicalsat/util/LogFile.java index 176c7273263e236e843b40340ff5922b6ca01c66..3fa1a3aa2f45d2b4eacf8e0fc3fdf0c62b448212 100644 --- a/ApplicationAmicalsat/src/main/java/org/josast/ApplicationAmicalsat/util/LogFile.java +++ b/ApplicationAmicalsat/src/main/java/org/josast/ApplicationAmicalsat/util/LogFile.java @@ -1,6 +1,4 @@ -/** - * - */ +/** */ package org.josast.ApplicationAmicalsat.util; import java.io.File; @@ -11,55 +9,43 @@ import java.text.SimpleDateFormat; import java.util.Date; import java.util.logging.Logger; -/** - * @author christophe - * - */ +/** @author christophe */ public class LogFile { - private static Logger appLogger = Logger.getLogger("AmsatLogger"); - private PrintWriter pw; - - /** - * - */ - public LogFile() { - // TODO Auto-generated constructor stub - initdisplayLogFile(); - } + private static Logger appLogger = Logger.getLogger("AmsatLogger"); + private PrintWriter pw; + + /** */ + public LogFile() { + // TODO Auto-generated constructor stub + initdisplayLogFile(); + } - - private void initdisplayLogFile() - { + private void initdisplayLogFile() { - - SimpleDateFormat formater = new SimpleDateFormat("yyyy-MM-dd-HHmmss"); - Date aujourdhui = new Date(); - String path = System.getProperty("user.dir") + "/log"; - File apath = new File(path); + SimpleDateFormat formater = new SimpleDateFormat("yyyy-MM-dd-HHmmss"); + Date aujourdhui = new Date(); + String path = System.getProperty("user.dir") + "/log"; + File apath = new File(path); - if (!apath.exists()) { - if (apath.mkdir() == false) { - appLogger.severe("fail to create " + path); - } - } - try { - pw = new PrintWriter (new FileWriter(path+"/"+formater.format(aujourdhui)+"-"+".log")); - } catch (IOException e) { - appLogger.severe("erreur creating log file"); - appLogger.severe (e.toString()); - } + if (!apath.exists()) { + if (apath.mkdir() == false) { + appLogger.severe("fail to create " + path); + } + } + try { + pw = new PrintWriter(new FileWriter(path + "/" + formater.format(aujourdhui) + "-" + ".log")); + } catch (IOException e) { + appLogger.severe("erreur creating log file"); + appLogger.severe(e.toString()); } - - public void displayLog(String log) { - if(pw!=null) - { - pw.println(log); - pw.flush(); - } - appLogger.info(log); + } + public void displayLog(String log) { + if (pw != null) { + pw.println(log); + pw.flush(); } - - + appLogger.info(log); + } } diff --git a/ApplicationAmicalsat/src/main/java/org/josast/javafx/AlertHelper.java b/ApplicationAmicalsat/src/main/java/org/josast/javafx/AlertHelper.java index 7f3d20eee2a6085c069c7a085fbfff2b0b08daf4..2c8ef7739641d83ab37022fadfed49d1ab5672f9 100644 --- a/ApplicationAmicalsat/src/main/java/org/josast/javafx/AlertHelper.java +++ b/ApplicationAmicalsat/src/main/java/org/josast/javafx/AlertHelper.java @@ -5,24 +5,23 @@ import javafx.stage.Window; public class AlertHelper { - private AlertHelper() - { - - } - /** - * Display a window in order to display a message - * @param alertType Type of alert - * @param owner - * @param title title of the windows - * @param message message to display - */ - public static void showAlert(Alert.AlertType alertType, Window owner, String title, String message) { - Alert alert = new Alert(alertType); - alert.setTitle(title); - alert.setHeaderText(null); - alert.setContentText(message); - alert.initOwner(owner); - alert.show(); - } + private AlertHelper() {} + /** + * Display a window in order to display a message + * + * @param alertType Type of alert + * @param owner + * @param title title of the windows + * @param message message to display + */ + public static void showAlert( + Alert.AlertType alertType, Window owner, String title, String message) { + Alert alert = new Alert(alertType); + alert.setTitle(title); + alert.setHeaderText(null); + alert.setContentText(message); + alert.initOwner(owner); + alert.show(); + } } diff --git a/ApplicationAmicalsatCli/src/main/java/org/josast/app/amicalsat/cli/AmicalsatCli.java b/ApplicationAmicalsatCli/src/main/java/org/josast/app/amicalsat/cli/AmicalsatCli.java index b7a5b4943f1edeb662d7cf5b30b1d3bcccfcbef8..2bfa3f3880616eebdf29f941eec981e08c02f17e 100644 --- a/ApplicationAmicalsatCli/src/main/java/org/josast/app/amicalsat/cli/AmicalsatCli.java +++ b/ApplicationAmicalsatCli/src/main/java/org/josast/app/amicalsat/cli/AmicalsatCli.java @@ -1,34 +1,24 @@ package org.josast.app.amicalsat.cli; import java.util.Vector; - import org.josast.app.amicalsat.cli.option.Cmd; import org.josast.app.amicalsat.cli.option.OptionsAnalysis; public class AmicalsatCli { - - - /** - * @param args - */ - public AmicalsatCli(String[] args) { - OptionsAnalysis opt=new OptionsAnalysis(args); - Vector vec = opt.getCommandes(); - for(Cmd cmd : vec){ - cmd.excute(); - } - } - - - /** - * @param args - */ - public static void main(String[] args) { - - @SuppressWarnings("unused") - AmicalsatCli cli = new AmicalsatCli(args); - - - } + /** @param args */ + public AmicalsatCli(String[] args) { + OptionsAnalysis opt = new OptionsAnalysis(args); + Vector vec = opt.getCommandes(); + for (Cmd cmd : vec) { + cmd.excute(); + } + } + + /** @param args */ + public static void main(String[] args) { + + @SuppressWarnings("unused") + AmicalsatCli cli = new AmicalsatCli(args); + } } diff --git a/ApplicationAmicalsatCli/src/main/java/org/josast/app/amicalsat/cli/AmicalsatCliConf.java b/ApplicationAmicalsatCli/src/main/java/org/josast/app/amicalsat/cli/AmicalsatCliConf.java index c454cde2465e65c4738d959ad7479a89dbab9b21..52fb12ec1760c85c68abb319f270eb09e71d17a3 100644 --- a/ApplicationAmicalsatCli/src/main/java/org/josast/app/amicalsat/cli/AmicalsatCliConf.java +++ b/ApplicationAmicalsatCli/src/main/java/org/josast/app/amicalsat/cli/AmicalsatCliConf.java @@ -2,179 +2,170 @@ package org.josast.app.amicalsat.cli; import java.nio.file.Path; import java.util.logging.Logger; - import org.josast.property.CONFIG; import org.josast.property.ConfigObject; - public class AmicalsatCliConf extends ConfigObject { - private Logger logger = Logger.getLogger(getClass().getName()); - - private String configurationFile = "defaultConfigFile.ini"; - private String smBinarieOutputFile = null; - private String smBinarieOutputDirectory = "SoundModemOutpt"; - private boolean smGenerateBinarieFile = false; - private String textualFile = null; - private boolean generateTextualOutputFile = false; - private String outputTextualFileRepository = "OuputTextual"; - private String configFileDefined = "true"; - private boolean textualFilePrefixDate = true; - private String smIPadress = "localhost"; - private int smPort = 8100; - private boolean isInitialised = false; - - protected CONFIG configFile = CONFIG.getInstance(); - - private Path RealTextualFilePath; - - private AmicalsatCliConf() - { - - } - /** Holder */ - private static class SingletonHolder - { - /** Instance unique non pr�initialis�e */ - private final static AmicalsatCliConf instance = new AmicalsatCliConf(); - } - - /** Point d'acc�s pour l'instance unique du singleton */ - public static AmicalsatCliConf getInstance() - { - SingletonHolder.instance.setConfigurationFile(SingletonHolder.instance.configurationFile); - SingletonHolder.instance.initialise(SingletonHolder.instance.configurationFile); - return SingletonHolder.instance; + private Logger logger = Logger.getLogger(getClass().getName()); - } - - public static AmicalsatCliConf getInstance(String configFilename) - { - SingletonHolder.instance.configurationFile = configFilename; - SingletonHolder.instance.initialise(configFilename); - return SingletonHolder.instance; - } - - private void initialise(String configFilename) { - - - if (!isInitialised) - { - // vérifie si la propriété est dans le fichier - configFile.setFileName(configFilename); - - String temp = configFile.getProperty("configFileDefined"); - - if (temp == null) { - // config file not initialised - - logger.severe("properties file not initialised - a file is created with properties with defaults value"); - System.out.println("config file does not content required properties \n the file " + configFilename - + " has been set up with default properties to configure"); - save(); - - } else { - - initialiseFromProperties(); - } - - isInitialised=true; - } - } - - private void initialiseFromProperties() { - configFileDefined = configFile.getProperty("configFileDefined"); - smIPadress = configFile.getProperty("smIPadress"); - String portString = configFile.getProperty("smPort"); - smPort = Integer.parseInt(portString); - smGenerateBinarieFile = Boolean.getBoolean(configFile.getProperty("smGenerateBinarieFile")); - smBinarieOutputFile = configFile.getProperty("smBinarieOutputFile"); - textualFile = configFile.getProperty("textualFile"); - configurationFile = configFile.getProperty("configurationFile"); - generateTextualOutputFile = Boolean.getBoolean(configFile.getProperty("generateTextualOutputFile")); - outputTextualFileRepository = configFile.getProperty("outputTextualFileRepository"); - smBinarieOutputDirectory = configFile.getProperty("smBinarieOutputDirectory"); - } - - public void save() { - configFile.setProperty("configFileDefined", configFileDefined); - configFile.setProperty("smPort", "" + smPort); - configFile.setProperty("smIPadress", "" + smIPadress); - configFile.setProperty("smBinarieOutputFile", "" + smBinarieOutputFile); - configFile.setProperty("smGenerateBinarieFile", "" + smGenerateBinarieFile); - configFile.setProperty("textualFile", "" + textualFile); - configFile.setProperty("generateTextualOutputFile", "" + generateTextualOutputFile); - configFile.setProperty("outputTextualFileRepository", "" + outputTextualFileRepository); - configFile.setProperty("configurationFile", "" + configurationFile); - configFile.setProperty("smBinarieOutputDirectory", "" + smBinarieOutputDirectory); - - - } - - public String getConfigurationFile() { - return configurationFile; - } - - public void setConfigurationFile(String configurationFile) { - this.configurationFile = configurationFile; - } - - public String getSmBinarieOutputFile() { - return smBinarieOutputFile; - } - - public void setSmBinarieOutputFile(String binariefile) { - this.smBinarieOutputFile = binariefile; - smGenerateBinarieFile = true; - } - - public String getTextualFile() { - return textualFile; - } - - public void setTextualFile(String textualFile) { - this.textualFile = textualFile; - generateTextualOutputFile = true; - } - - public boolean isSmGenerateBinarieFile() { - return smGenerateBinarieFile; - } - - public void setSmGenerateBinarieFile(boolean smGenerateBinarieFile) { - this.smGenerateBinarieFile = smGenerateBinarieFile; - } - - public boolean isGenerateTextualOutputFile() { - return generateTextualOutputFile; - } - - public void setGenerateTextualOutputFile(boolean smTextualOutputFile) { - this.generateTextualOutputFile = smTextualOutputFile; - } - - public String getOutputTextualFileRepository() { - return outputTextualFileRepository; - } - - public void setOutputTextualFileRepository(String outputTextualFileRepository) { - this.outputTextualFileRepository = outputTextualFileRepository; - } - - public boolean isTextualFilePrefixDate() { - return textualFilePrefixDate; - } - - public void setTextualFilePrefixDate(boolean textualFilePrefixDateInput) { - textualFilePrefixDate = textualFilePrefixDateInput; - } - - public void setRealTextualFilePath(Path filepath) { - RealTextualFilePath = filepath; - } - - public Path getRealTextualFilePath() { - return RealTextualFilePath; - } + private String configurationFile = "defaultConfigFile.ini"; + private String smBinarieOutputFile = null; + private String smBinarieOutputDirectory = "SoundModemOutpt"; + private boolean smGenerateBinarieFile = false; + private String textualFile = null; + private boolean generateTextualOutputFile = false; + private String outputTextualFileRepository = "OuputTextual"; + private String configFileDefined = "true"; + private boolean textualFilePrefixDate = true; + private String smIPadress = "localhost"; + private int smPort = 8100; + private boolean isInitialised = false; + + protected CONFIG configFile = CONFIG.getInstance(); + + private Path RealTextualFilePath; + + private AmicalsatCliConf() {} + + /** Holder */ + private static class SingletonHolder { + /** Instance unique non pr�initialis�e */ + private static final AmicalsatCliConf instance = new AmicalsatCliConf(); + } + + /** Point d'acc�s pour l'instance unique du singleton */ + public static AmicalsatCliConf getInstance() { + SingletonHolder.instance.setConfigurationFile(SingletonHolder.instance.configurationFile); + SingletonHolder.instance.initialise(SingletonHolder.instance.configurationFile); + return SingletonHolder.instance; + } + public static AmicalsatCliConf getInstance(String configFilename) { + SingletonHolder.instance.configurationFile = configFilename; + SingletonHolder.instance.initialise(configFilename); + return SingletonHolder.instance; + } + + private void initialise(String configFilename) { + + if (!isInitialised) { + // vérifie si la propriété est dans le fichier + configFile.setFileName(configFilename); + + String temp = configFile.getProperty("configFileDefined"); + + if (temp == null) { + // config file not initialised + + logger.severe( + "properties file not initialised - a file is created with properties with defaults value"); + System.out.println( + "config file does not content required properties \n the file " + + configFilename + + " has been set up with default properties to configure"); + save(); + + } else { + + initialiseFromProperties(); + } + + isInitialised = true; + } + } + + private void initialiseFromProperties() { + configFileDefined = configFile.getProperty("configFileDefined"); + smIPadress = configFile.getProperty("smIPadress"); + String portString = configFile.getProperty("smPort"); + smPort = Integer.parseInt(portString); + smGenerateBinarieFile = Boolean.getBoolean(configFile.getProperty("smGenerateBinarieFile")); + smBinarieOutputFile = configFile.getProperty("smBinarieOutputFile"); + textualFile = configFile.getProperty("textualFile"); + configurationFile = configFile.getProperty("configurationFile"); + generateTextualOutputFile = + Boolean.getBoolean(configFile.getProperty("generateTextualOutputFile")); + outputTextualFileRepository = configFile.getProperty("outputTextualFileRepository"); + smBinarieOutputDirectory = configFile.getProperty("smBinarieOutputDirectory"); + } + + public void save() { + configFile.setProperty("configFileDefined", configFileDefined); + configFile.setProperty("smPort", "" + smPort); + configFile.setProperty("smIPadress", "" + smIPadress); + configFile.setProperty("smBinarieOutputFile", "" + smBinarieOutputFile); + configFile.setProperty("smGenerateBinarieFile", "" + smGenerateBinarieFile); + configFile.setProperty("textualFile", "" + textualFile); + configFile.setProperty("generateTextualOutputFile", "" + generateTextualOutputFile); + configFile.setProperty("outputTextualFileRepository", "" + outputTextualFileRepository); + configFile.setProperty("configurationFile", "" + configurationFile); + configFile.setProperty("smBinarieOutputDirectory", "" + smBinarieOutputDirectory); + } + + public String getConfigurationFile() { + return configurationFile; + } + + public void setConfigurationFile(String configurationFile) { + this.configurationFile = configurationFile; + } + + public String getSmBinarieOutputFile() { + return smBinarieOutputFile; + } + + public void setSmBinarieOutputFile(String binariefile) { + this.smBinarieOutputFile = binariefile; + smGenerateBinarieFile = true; + } + + public String getTextualFile() { + return textualFile; + } + + public void setTextualFile(String textualFile) { + this.textualFile = textualFile; + generateTextualOutputFile = true; + } + + public boolean isSmGenerateBinarieFile() { + return smGenerateBinarieFile; + } + + public void setSmGenerateBinarieFile(boolean smGenerateBinarieFile) { + this.smGenerateBinarieFile = smGenerateBinarieFile; + } + + public boolean isGenerateTextualOutputFile() { + return generateTextualOutputFile; + } + + public void setGenerateTextualOutputFile(boolean smTextualOutputFile) { + this.generateTextualOutputFile = smTextualOutputFile; + } + + public String getOutputTextualFileRepository() { + return outputTextualFileRepository; + } + + public void setOutputTextualFileRepository(String outputTextualFileRepository) { + this.outputTextualFileRepository = outputTextualFileRepository; + } + + public boolean isTextualFilePrefixDate() { + return textualFilePrefixDate; + } + + public void setTextualFilePrefixDate(boolean textualFilePrefixDateInput) { + textualFilePrefixDate = textualFilePrefixDateInput; + } + + public void setRealTextualFilePath(Path filepath) { + RealTextualFilePath = filepath; + } + + public Path getRealTextualFilePath() { + return RealTextualFilePath; + } } diff --git a/ApplicationAmicalsatCli/src/main/java/org/josast/app/amicalsat/cli/option/Cmd.java b/ApplicationAmicalsatCli/src/main/java/org/josast/app/amicalsat/cli/option/Cmd.java index ab72a7327a973b1ea9013f2416f10cc47d874ef7..bcb63048d74f9ab497739abf05ae83a6eec6b5b5 100644 --- a/ApplicationAmicalsatCli/src/main/java/org/josast/app/amicalsat/cli/option/Cmd.java +++ b/ApplicationAmicalsatCli/src/main/java/org/josast/app/amicalsat/cli/option/Cmd.java @@ -2,14 +2,11 @@ package org.josast.app.amicalsat.cli.option; /** * Command pattern interface - * @author chris * + * @author chris */ public interface Cmd { - - /** - * Excecute command - */ - void excute(); + /** Excecute command */ + void excute(); } diff --git a/ApplicationAmicalsatCli/src/main/java/org/josast/app/amicalsat/cli/option/InitialiseTextualFileCmd.java b/ApplicationAmicalsatCli/src/main/java/org/josast/app/amicalsat/cli/option/InitialiseTextualFileCmd.java index de8f9271f55ae3daa48e202bca8b4ac5f7fdf147..71bc5ac64a534b6a37001715f3bccf466e9ee50e 100644 --- a/ApplicationAmicalsatCli/src/main/java/org/josast/app/amicalsat/cli/option/InitialiseTextualFileCmd.java +++ b/ApplicationAmicalsatCli/src/main/java/org/josast/app/amicalsat/cli/option/InitialiseTextualFileCmd.java @@ -8,46 +8,45 @@ import java.text.SimpleDateFormat; import java.util.Date; import java.util.logging.Level; import java.util.logging.Logger; - import org.josast.app.amicalsat.cli.AmicalsatCliConf; public class InitialiseTextualFileCmd implements Cmd { - private Logger log = Logger.getLogger(getClass().getName()); - private Path filepath = null; - - @Override - public void excute() { - AmicalsatCliConf conf = AmicalsatCliConf.getInstance(); - - if (conf.isGenerateTextualOutputFile()) { - - Path path = Paths.get(conf.getOutputTextualFileRepository()); - // if directory exists? - if (!Files.exists(path)) { - try { - Files.createDirectories(path); - log.info("directory created : " + path); - } catch (IOException e) { - log.log(Level.SEVERE, "cannot create outpout directorie " + e.toString()); - } - } - - String creationdate = ""; - if (conf.isTextualFilePrefixDate()) { - SimpleDateFormat formater = new SimpleDateFormat("yyyy-MM-dd-HHmmss"); - Date aujourdhui = new Date(); - creationdate = formater.format(aujourdhui) + "-"; - } - - filepath = Paths.get(conf.getOutputTextualFileRepository() + "\\" + creationdate + conf.getTextualFile()); - try { - Files.writeString(filepath, "Output file \r\n"); - } catch (IOException e) { - log.severe("cannot write to outpout file " + e.toString()); - } - conf.setRealTextualFilePath(filepath); - - } - } - + private Logger log = Logger.getLogger(getClass().getName()); + private Path filepath = null; + + @Override + public void excute() { + AmicalsatCliConf conf = AmicalsatCliConf.getInstance(); + + if (conf.isGenerateTextualOutputFile()) { + + Path path = Paths.get(conf.getOutputTextualFileRepository()); + // if directory exists? + if (!Files.exists(path)) { + try { + Files.createDirectories(path); + log.info("directory created : " + path); + } catch (IOException e) { + log.log(Level.SEVERE, "cannot create outpout directorie " + e.toString()); + } + } + + String creationdate = ""; + if (conf.isTextualFilePrefixDate()) { + SimpleDateFormat formater = new SimpleDateFormat("yyyy-MM-dd-HHmmss"); + Date aujourdhui = new Date(); + creationdate = formater.format(aujourdhui) + "-"; + } + + filepath = + Paths.get( + conf.getOutputTextualFileRepository() + "\\" + creationdate + conf.getTextualFile()); + try { + Files.writeString(filepath, "Output file \r\n"); + } catch (IOException e) { + log.severe("cannot write to outpout file " + e.toString()); + } + conf.setRealTextualFilePath(filepath); + } + } } diff --git a/ApplicationAmicalsatCli/src/main/java/org/josast/app/amicalsat/cli/option/OptionsAnalysis.java b/ApplicationAmicalsatCli/src/main/java/org/josast/app/amicalsat/cli/option/OptionsAnalysis.java index 4ce1772b113eaae8564c3398f033d128a3ac96df..45fa49f5d81d451c32d412b8aa0576de9d02feba 100644 --- a/ApplicationAmicalsatCli/src/main/java/org/josast/app/amicalsat/cli/option/OptionsAnalysis.java +++ b/ApplicationAmicalsatCli/src/main/java/org/josast/app/amicalsat/cli/option/OptionsAnalysis.java @@ -2,7 +2,6 @@ package org.josast.app.amicalsat.cli.option; import java.util.Vector; import java.util.logging.Logger; - import org.apache.commons.cli.CommandLine; import org.apache.commons.cli.CommandLineParser; import org.apache.commons.cli.DefaultParser; @@ -13,110 +12,122 @@ import org.apache.commons.cli.ParseException; import org.josast.app.amicalsat.cli.AmicalsatCliConf; public class OptionsAnalysis { - private Logger log = Logger.getLogger(getClass().getName()); - Vector listeCmd = null; - Options options = null; - CommandLine line = null; - - AmicalsatCliConf conf = AmicalsatCliConf.getInstance(); - - public OptionsAnalysis(String[] args) { - options = configParameters(); - CommandLineParser parser = new DefaultParser(); - - try { - line = parser.parse(options, args); - listeCmd = interprete(line, args); - } catch (ParseException e) { - log.severe(" Unrecognise option " + e.toString()); - System.exit(0); - } - } - - public Vector getCommandes() { - return listeCmd; - } - - public void setListeCmd(Vector listeCmd) { - this.listeCmd = listeCmd; - } - - private Options configParameters() { - - // -V Version - - final Option versionOption = Option.builder("V").longOpt("Version") // - .desc("Return application version").hasArg(false).required(false).build(); - - final Option helpFileOption = Option.builder("h").longOpt("help").desc("display help message").build(); - -// final Option configFileOption = Option.builder("CS").longOpt("ConfigSave") // -// .desc("provide configuration file").hasArg(true).argName("configFile").required(false).build(); - - final Option generateBinarieFileOption = Option.builder("SB").longOpt("SaveBinarie") // - .desc("generate a file with all frame received in binarie (KISS)").hasArg(true).argName("FileNameBin") - .required(false).build(); - - final Option generateTxtFileOption = Option.builder("ST").longOpt("SaveTextual") // - .desc("generate a file with all frame received in textual format - data intepreated").hasArg(true) - .argName("FileNameTxt").required(false).build(); - - final Options options = new Options(); - - options.addOption(versionOption); -// options.addOption(configFileOption); - options.addOption(generateBinarieFileOption); - options.addOption(generateTxtFileOption); - options.addOption(helpFileOption); - - return options; - - } - - private Vector interprete(CommandLine line, String[] args) { - - Vector cmdList = new Vector(); - - boolean helpMode = line.hasOption("help"); - - if (helpMode) { -// TODO : a mettre à jours - VersionCmd cmd = new VersionCmd(); - cmd.excute(); - final HelpFormatter formatter = new HelpFormatter(); - formatter.printHelp(args[0], options, true); - System.exit(0); - - } - cmdList.add(new VersionCmd()); - boolean versionpMode = line.hasOption("Version"); - if (versionpMode) { - VersionCmd cmd = new VersionCmd(); - cmd.excute(); - System.exit(0); - } - -// boolean confFile = line.hasOption("configFile"); -// if (confFile) { -// -// } - - boolean binaryfile = line.hasOption("SaveBinarie"); - if (binaryfile) { - conf.setSmBinarieOutputFile(line.getOptionValue("SaveBinarie", "")); - conf.save(); - - } - - boolean generateMode = line.hasOption("SaveTextual"); - if (generateMode) { - conf.setTextualFile(line.getOptionValue("SaveTextual", "")); - cmdList.add(new InitialiseTextualFileCmd()); - - } - - cmdList.add(new ReceiveDataCmd()); - return cmdList; - } - + private Logger log = Logger.getLogger(getClass().getName()); + Vector listeCmd = null; + Options options = null; + CommandLine line = null; + + AmicalsatCliConf conf = AmicalsatCliConf.getInstance(); + + public OptionsAnalysis(String[] args) { + options = configParameters(); + CommandLineParser parser = new DefaultParser(); + + try { + line = parser.parse(options, args); + listeCmd = interprete(line, args); + } catch (ParseException e) { + log.severe(" Unrecognise option " + e.toString()); + System.exit(0); + } + } + + public Vector getCommandes() { + return listeCmd; + } + + public void setListeCmd(Vector listeCmd) { + this.listeCmd = listeCmd; + } + + private Options configParameters() { + + // -V Version + + final Option versionOption = + Option.builder("V") + .longOpt("Version") // + .desc("Return application version") + .hasArg(false) + .required(false) + .build(); + + final Option helpFileOption = + Option.builder("h").longOpt("help").desc("display help message").build(); + + // final Option configFileOption = Option.builder("CS").longOpt("ConfigSave") // + // .desc("provide configuration + // file").hasArg(true).argName("configFile").required(false).build(); + + final Option generateBinarieFileOption = + Option.builder("SB") + .longOpt("SaveBinarie") // + .desc("generate a file with all frame received in binarie (KISS)") + .hasArg(true) + .argName("FileNameBin") + .required(false) + .build(); + + final Option generateTxtFileOption = + Option.builder("ST") + .longOpt("SaveTextual") // + .desc("generate a file with all frame received in textual format - data intepreated") + .hasArg(true) + .argName("FileNameTxt") + .required(false) + .build(); + + final Options options = new Options(); + + options.addOption(versionOption); + // options.addOption(configFileOption); + options.addOption(generateBinarieFileOption); + options.addOption(generateTxtFileOption); + options.addOption(helpFileOption); + + return options; + } + + private Vector interprete(CommandLine line, String[] args) { + + Vector cmdList = new Vector(); + + boolean helpMode = line.hasOption("help"); + + if (helpMode) { + // TODO : a mettre à jours + VersionCmd cmd = new VersionCmd(); + cmd.excute(); + final HelpFormatter formatter = new HelpFormatter(); + formatter.printHelp(args[0], options, true); + System.exit(0); + } + cmdList.add(new VersionCmd()); + boolean versionpMode = line.hasOption("Version"); + if (versionpMode) { + VersionCmd cmd = new VersionCmd(); + cmd.excute(); + System.exit(0); + } + + // boolean confFile = line.hasOption("configFile"); + // if (confFile) { + // + // } + + boolean binaryfile = line.hasOption("SaveBinarie"); + if (binaryfile) { + conf.setSmBinarieOutputFile(line.getOptionValue("SaveBinarie", "")); + conf.save(); + } + + boolean generateMode = line.hasOption("SaveTextual"); + if (generateMode) { + conf.setTextualFile(line.getOptionValue("SaveTextual", "")); + cmdList.add(new InitialiseTextualFileCmd()); + } + + cmdList.add(new ReceiveDataCmd()); + return cmdList; + } } diff --git a/ApplicationAmicalsatCli/src/main/java/org/josast/app/amicalsat/cli/option/ReceiveDataCmd.java b/ApplicationAmicalsatCli/src/main/java/org/josast/app/amicalsat/cli/option/ReceiveDataCmd.java index e3f7a588683b7838e07d4d09fdeb54f37d9e7d69..d565d5e40836a77d56605c1acec92cfb2e00e687 100644 --- a/ApplicationAmicalsatCli/src/main/java/org/josast/app/amicalsat/cli/option/ReceiveDataCmd.java +++ b/ApplicationAmicalsatCli/src/main/java/org/josast/app/amicalsat/cli/option/ReceiveDataCmd.java @@ -1,5 +1,6 @@ package org.josast.app.amicalsat.cli.option; +import io.kaitai.struct.ByteBufferKaitaiStream; import java.io.IOException; import java.nio.charset.StandardCharsets; import java.nio.file.Files; @@ -7,7 +8,6 @@ import java.nio.file.StandardOpenOption; import java.text.SimpleDateFormat; import java.util.Date; import java.util.logging.Logger; - import org.josast.AX25.generated.Ax25frames; import org.josast.ModuleSoundModem.SoundModemClient; import org.josast.amicalsat.Frame; @@ -15,67 +15,60 @@ import org.josast.amicalsat.FrameFactory; import org.josast.amicalsat.generated.FrameTlmAmicalsat; import org.josast.app.amicalsat.cli.AmicalsatCliConf; -import io.kaitai.struct.ByteBufferKaitaiStream; - public class ReceiveDataCmd implements Cmd { - private Logger log = Logger.getLogger(getClass().getName()); - private SimpleDateFormat formater = new SimpleDateFormat("yyyy-MM-dd-HHmmss"); + private Logger log = Logger.getLogger(getClass().getName()); + private SimpleDateFormat formater = new SimpleDateFormat("yyyy-MM-dd-HHmmss"); - @Override - public void excute() { + @Override + public void excute() { - AmicalsatCliConf conf = AmicalsatCliConf.getInstance(); - FrameFactory ff = new FrameFactory(); - SoundModemClient sm = new SoundModemClient(conf.getConfigurationFile()); - if (!sm.isOpen()) { - System.out.println("Connection to modem failed"); - } else { - System.out.println("Connected to modem"); - while (sm.isOpen()) { + AmicalsatCliConf conf = AmicalsatCliConf.getInstance(); + FrameFactory ff = new FrameFactory(); + SoundModemClient sm = new SoundModemClient(conf.getConfigurationFile()); + if (!sm.isOpen()) { + System.out.println("Connection to modem failed"); + } else { + System.out.println("Connected to modem"); + while (sm.isOpen()) { - byte[] temp = sm.receivedRawData(); - - - - - try { - FrameTlmAmicalsat cube = new FrameTlmAmicalsat(new ByteBufferKaitaiStream(temp)); -//AX25 - Ax25frames ax25 = new Ax25frames(new ByteBufferKaitaiStream(temp)); - byte [] info = ax25.ax25Frame().ax25Info(); - System.out.println(new String (info,StandardCharsets.UTF_8)); - - - String tlmArea = cube.frameTlmEntrySat().payload().tlmArea(); - String typeFrame = cube.frameTlmEntrySat().payload().tlmType(); - Frame fm = ff.creerFrame(tlmArea, typeFrame); - fm.setUp(cube); + byte[] temp = sm.receivedRawData(); - Date aujourdhui = new Date(); - String receiveddate = formater.format(aujourdhui); + try { + FrameTlmAmicalsat cube = new FrameTlmAmicalsat(new ByteBufferKaitaiStream(temp)); + // AX25 + Ax25frames ax25 = new Ax25frames(new ByteBufferKaitaiStream(temp)); + byte[] info = ax25.ax25Frame().ax25Info(); + System.out.println(new String(info, StandardCharsets.UTF_8)); - System.out.println(receiveddate + " : " + fm.toStringHeader()); - System.out.println(fm.toString()); - if (conf.isGenerateTextualOutputFile()) { - try { - Files.writeString(conf.getRealTextualFilePath(), receiveddate, StandardOpenOption.APPEND); - Files.writeString(conf.getRealTextualFilePath(), fm.toStringHeader(), - StandardOpenOption.APPEND); - Files.writeString(conf.getRealTextualFilePath(), fm.toString() + "\r\n", - StandardOpenOption.APPEND); - } catch (IOException e) { - log.severe(e.toString()); - } - } - } catch (Exception e) { - log.severe("Data input received not decoded " + e.toString()); - } + String tlmArea = cube.frameTlmEntrySat().payload().tlmArea(); + String typeFrame = cube.frameTlmEntrySat().payload().tlmType(); + Frame fm = ff.creerFrame(tlmArea, typeFrame); + fm.setUp(cube); - } + Date aujourdhui = new Date(); + String receiveddate = formater.format(aujourdhui); - System.out.println("Connection closed"); - } + System.out.println(receiveddate + " : " + fm.toStringHeader()); + System.out.println(fm.toString()); + if (conf.isGenerateTextualOutputFile()) { + try { + Files.writeString( + conf.getRealTextualFilePath(), receiveddate, StandardOpenOption.APPEND); + Files.writeString( + conf.getRealTextualFilePath(), fm.toStringHeader(), StandardOpenOption.APPEND); + Files.writeString( + conf.getRealTextualFilePath(), fm.toString() + "\r\n", StandardOpenOption.APPEND); + } catch (IOException e) { + log.severe(e.toString()); + } + } + } catch (Exception e) { + log.severe("Data input received not decoded " + e.toString()); + } + } - } + System.out.println("Connection closed"); + } + } } diff --git a/ApplicationAmicalsatCli/src/main/java/org/josast/app/amicalsat/cli/option/VersionCmd.java b/ApplicationAmicalsatCli/src/main/java/org/josast/app/amicalsat/cli/option/VersionCmd.java index 9679288c0c407b863afe4e24f1506c78ec7e6651..a8576ff25df675029b68a0c084eae74364f11312 100644 --- a/ApplicationAmicalsatCli/src/main/java/org/josast/app/amicalsat/cli/option/VersionCmd.java +++ b/ApplicationAmicalsatCli/src/main/java/org/josast/app/amicalsat/cli/option/VersionCmd.java @@ -4,14 +4,11 @@ import org.josast.app.amicalsat.cli.AmicalsatCli; public class VersionCmd implements Cmd { - String version = "0.4"; - - /** - * - */ - @Override - public void excute() { - System.out.println(AmicalsatCli.class.getSimpleName() + " " + version); - } + String version = "0.4"; + /** */ + @Override + public void excute() { + System.out.println(AmicalsatCli.class.getSimpleName() + " " + version); + } } diff --git a/ApplicationCubesatSim/src/main/java/org/josast/application/cubesatsim/SoundmodemToInfluxDbCli.java b/ApplicationCubesatSim/src/main/java/org/josast/application/cubesatsim/SoundmodemToInfluxDbCli.java index 479821d6214ad9b4405591e7a3bc184f48688438..e34c10ea24d864c4654aef01e339f2aca475eaa9 100644 --- a/ApplicationCubesatSim/src/main/java/org/josast/application/cubesatsim/SoundmodemToInfluxDbCli.java +++ b/ApplicationCubesatSim/src/main/java/org/josast/application/cubesatsim/SoundmodemToInfluxDbCli.java @@ -1,6 +1,4 @@ -/** - * - */ +/** */ package org.josast.application.cubesatsim; import org.apache.commons.cli.CommandLine; @@ -17,197 +15,164 @@ import org.josast.CubesatSim.influxDB.InfluxDatabaseConfig; import org.josast.CubesatSim.kaitai.generated.Cubesatsim.CubesatsimAo7; import org.josast.ModuleSoundModem.SoundModemClient; -/** - * @author christophe - * - */ +/** @author christophe */ public class SoundmodemToInfluxDbCli { - /** Application version. */ - private static String version = "1.2"; - /** configuration filename by default. */ - private static String configurationfile = "config.ini"; - /** Verbose mode diseable by default. */ - private boolean verboseMode = false; - - /** - * - */ - public SoundmodemToInfluxDbCli() { - + /** Application version. */ + private static String version = "1.2"; + /** configuration filename by default. */ + private static String configurationfile = "config.ini"; + /** Verbose mode diseable by default. */ + private boolean verboseMode = false; + + /** */ + public SoundmodemToInfluxDbCli() {} + + private static Options configParameters() { + + final Option versionOption = + Option.builder("V") + .longOpt("Version") // + .desc("Return application version") + .hasArg(false) + .required(false) + .build(); + final Option verboseOption = + Option.builder("v") + .longOpt("verbose") // + .desc("display data received") + .hasArg(false) + .required(false) + .build(); + + final Option configFileOption = + Option.builder("C") + .longOpt("Config") // + .desc("Return application version") + .hasArg(true) + .argName("configFile") + .required(false) + .build(); + + final Option helpFileOption = + Option.builder("h").longOpt("help").desc("display help message").build(); + + final Options options = new Options(); + + options.addOption(versionOption); + options.addOption(verboseOption); + options.addOption(configFileOption); + + options.addOption(helpFileOption); + + return options; + } + + /** @param conffile */ + public void execute(final String conffile) { + + // connection to Sound Modem + InfluxDBInstance database = InfluxDBInstance.getInstance(); + InfluxDatabaseConfig config = new InfluxDatabaseConfig(conffile); + + database.conect(config.getAdresse(), config.getLogin(), config.getPassword()); + database.createDataBase("CubesatSim"); + + SoundModemClient sm = new SoundModemClient(configurationfile); + + // waiting data + while (true) { + byte[] temp = sm.receivedRawData(); + + ManageFrame mngt = new ManageFrame(temp); + + if (verboseMode) { + + System.out.print(mngt.headerToString()); + + } else { + System.out.print("."); + } + + CubesatsimAo7 ao7 = mngt.getCubesatsimAo7(); + + DataCubesatSim datasim = new DataCubesatSim(); + datasim.setBatteryVoltage(ao7.channel3aVal()); + datasim.setTotalCurrent(ao7.channel1aVal()); + datasim.setpXCurent(ao7.channel1bVal()); + datasim.setmXcurrent(ao7.channel1cVal()); + datasim.setpYcurrent(ao7.channel1dVal()); + datasim.setmYcurrent(ao7.channel2aVal()); + datasim.setpZcurrent(ao7.channel2bVal()); + datasim.setmZcurrent(ao7.channel2cVal()); + datasim.setBaseTemperature(ao7.channel4aVal()); + + datasim.writetoInfluxDB(database); + if (verboseMode) { + System.out.println(datasim); + } } - private static Options configParameters() { - - final Option versionOption = Option.builder("V") - - .longOpt("Version") // - - .desc("Return application version") - - .hasArg(false) - - .required(false) - - .build(); - final Option verboseOption = Option.builder("v") - - .longOpt("verbose") // - - .desc("display data received") - - .hasArg(false) - - .required(false) - - .build(); - - final Option configFileOption = Option.builder("C") - - .longOpt("Config") // - - .desc("Return application version") - - .hasArg(true) - - .argName("configFile") - - .required(false) - - .build(); - - final Option helpFileOption = Option.builder("h") - - .longOpt("help") - - .desc("display help message") - - .build(); - - final Options options = new Options(); - - options.addOption(versionOption); - options.addOption(verboseOption); - options.addOption(configFileOption); - - options.addOption(helpFileOption); + // decoding - return options; + // write to data base - } + } - /** - * @param conffile - */ - public void execute(final String conffile) { + /** + * Main function. + * + * @param args command line option + * @throws ParseException + */ + public static void main(final String[] args) throws ParseException { - // connection to Sound Modem - InfluxDBInstance database = InfluxDBInstance.getInstance(); - InfluxDatabaseConfig config = new InfluxDatabaseConfig(conffile); + final Options options = configParameters(); - database.conect(config.getAdresse(), config.getLogin(), config.getPassword()); - database.createDataBase("CubesatSim"); + final CommandLineParser parser = new DefaultParser(); - SoundModemClient sm = new SoundModemClient(configurationfile); + final CommandLine line = parser.parse(options, args); - // waiting data - while (true) { - byte[] temp = sm.receivedRawData(); + // Si mode aide - ManageFrame mngt = new ManageFrame(temp); + boolean helpMode = line.hasOption("help"); - if (verboseMode) { + if (helpMode) { - System.out.print(mngt.headerToString()); + final HelpFormatter formatter = new HelpFormatter(); - } else { - System.out.print("."); - } + formatter.printHelp(args[0], options, true); - CubesatsimAo7 ao7 = mngt.getCubesatsimAo7(); - - DataCubesatSim datasim = new DataCubesatSim(); - datasim.setBatteryVoltage(ao7.channel3aVal()); - datasim.setTotalCurrent(ao7.channel1aVal()); - datasim.setpXCurent(ao7.channel1bVal()); - datasim.setmXcurrent(ao7.channel1cVal()); - datasim.setpYcurrent(ao7.channel1dVal()); - datasim.setmYcurrent(ao7.channel2aVal()); - datasim.setpZcurrent(ao7.channel2bVal()); - datasim.setmZcurrent(ao7.channel2cVal()); - datasim.setBaseTemperature(ao7.channel4aVal()); - - datasim.writetoInfluxDB(database); - if (verboseMode) { - System.out.println(datasim); - - } - - } - - // decoding - - // write to data base - - } - - /** - * Main function. - * @param args command line option - * @throws ParseException - */ - public static void main(final String[] args) throws ParseException { - - final Options options = configParameters(); - - final CommandLineParser parser = new DefaultParser(); - - final CommandLine line = parser.parse(options, args); - - // Si mode aide - - boolean helpMode = line.hasOption("help"); - - if (helpMode) { - - final HelpFormatter formatter = new HelpFormatter(); - - formatter.printHelp(args[0], options, true); - - System.exit(0); - - } - - boolean versionpMode = line.hasOption("Version"); - - if (versionpMode) { - - System.out.println(args[0] + version); - - System.exit(0); - - } - System.out.println(SoundmodemToInfluxDbCli.class.getSimpleName() + " " + version); + System.exit(0); + } - boolean configMode = line.hasOption("Config"); - boolean verboseMode = line.hasOption("verbose"); - if (configMode) { + boolean versionpMode = line.hasOption("Version"); - configurationfile = line.getOptionValue("Config", ""); + if (versionpMode) { - } - SoundmodemToInfluxDbCli smd = new SoundmodemToInfluxDbCli(); - smd.setVerbose(verboseMode); - smd.execute(configurationfile); - } + System.out.println(args[0] + version); - /** - * Set verbose mode. - * @param verbose - */ - public void setVerbose(final boolean verbose) { - verboseMode = verbose; + System.exit(0); + } + System.out.println(SoundmodemToInfluxDbCli.class.getSimpleName() + " " + version); - } + boolean configMode = line.hasOption("Config"); + boolean verboseMode = line.hasOption("verbose"); + if (configMode) { + configurationfile = line.getOptionValue("Config", ""); + } + SoundmodemToInfluxDbCli smd = new SoundmodemToInfluxDbCli(); + smd.setVerbose(verboseMode); + smd.execute(configurationfile); + } + + /** + * Set verbose mode. + * + * @param verbose + */ + public void setVerbose(final boolean verbose) { + verboseMode = verbose; + } } diff --git a/ApplicationKissTool/pom.xml b/ApplicationKissTool/pom.xml index e1f793ba840cb6877b1b68eb829043abb0389568..4a4f4257126872fb2e711ed6d8810ef67f713345 100644 --- a/ApplicationKissTool/pom.xml +++ b/ApplicationKissTool/pom.xml @@ -10,7 +10,7 @@ ApplicationKissTool - 0.0.1-SNAPSHOT + UTF-8 11 @@ -22,7 +22,7 @@ ${josast.version} ${josast.version} ${josast.version} - 18-ea+2 + 18-ea+10 @@ -114,7 +114,7 @@ org.openjfx javafx-maven-plugin - 0.0.4 + 0.0.6 org.josast.ApplicationKissTool.App diff --git a/ApplicationKissTool/src/main/java/module-info.java b/ApplicationKissTool/src/main/java/module-info.java index 184b36b5b87627e574ad5608d8f0476029c49354..2f151731b76c585d59676bf8b5a8f7fb88bd3bda 100644 --- a/ApplicationKissTool/src/main/java/module-info.java +++ b/ApplicationKissTool/src/main/java/module-info.java @@ -1,17 +1,19 @@ module org.josast.ApplicationKissTool { - requires transitive javafx.controls; - requires javafx.fxml; - requires java.logging; - requires javafx.graphics; - requires transitive java.desktop; - requires ModuleSoundModem; - requires transitive ModuleSIDS; - requires ModuleConfig; - requires ModuleUVSQsatTelemetry; - requires javafx.swing; - requires kaitai.struct.runtime; - requires org.json; + requires transitive javafx.controls; + requires javafx.fxml; + requires java.logging; + requires javafx.graphics; + requires transitive java.desktop; + requires ModuleSoundModem; + requires transitive ModuleSIDS; + requires ModuleConfig; + requires ModuleUVSQsatTelemetry; + requires javafx.swing; + requires kaitai.struct.runtime; + requires org.json; - opens org.josast.ApplicationKissTool to javafx.fxml; - exports org.josast.ApplicationKissTool; -} \ No newline at end of file + opens org.josast.ApplicationKissTool to + javafx.fxml; + + exports org.josast.ApplicationKissTool; +} diff --git a/ApplicationKissTool/src/main/java/org/josast/ApplicationKissTool/AlertHelper.java b/ApplicationKissTool/src/main/java/org/josast/ApplicationKissTool/AlertHelper.java index 6ba50ef331bd9c420cf30e3e4270a797fa6b94aa..531eded4264ea0b5a5bb712ed888dab4f89a896f 100644 --- a/ApplicationKissTool/src/main/java/org/josast/ApplicationKissTool/AlertHelper.java +++ b/ApplicationKissTool/src/main/java/org/josast/ApplicationKissTool/AlertHelper.java @@ -5,24 +5,23 @@ import javafx.stage.Window; public class AlertHelper { - private AlertHelper() - { - - } - /** - * Display a window in order to display a message - * @param alertType Type of alert - * @param owner - * @param title title of the windows - * @param message message to display - */ - public static void showAlert(Alert.AlertType alertType, Window owner, String title, String message) { - Alert alert = new Alert(alertType); - alert.setTitle(title); - alert.setHeaderText(null); - alert.setContentText(message); - alert.initOwner(owner); - alert.show(); - } + private AlertHelper() {} + /** + * Display a window in order to display a message + * + * @param alertType Type of alert + * @param owner + * @param title title of the windows + * @param message message to display + */ + public static void showAlert( + Alert.AlertType alertType, Window owner, String title, String message) { + Alert alert = new Alert(alertType); + alert.setTitle(title); + alert.setHeaderText(null); + alert.setContentText(message); + alert.initOwner(owner); + alert.show(); + } } diff --git a/ApplicationKissTool/src/main/java/org/josast/ApplicationKissTool/App.java b/ApplicationKissTool/src/main/java/org/josast/ApplicationKissTool/App.java index f7760e27d23101e0fd9a6be817e389abc278f8d2..ffcf3b5cfb55a1402c8e36c0a8c38c948afbb822 100644 --- a/ApplicationKissTool/src/main/java/org/josast/ApplicationKissTool/App.java +++ b/ApplicationKissTool/src/main/java/org/josast/ApplicationKissTool/App.java @@ -1,82 +1,74 @@ package org.josast.ApplicationKissTool; -import javafx.application.Application; -import javafx.fxml.FXMLLoader; -import javafx.scene.Parent; -import javafx.scene.Scene; -import javafx.stage.Stage; - import java.io.File; import java.io.IOException; import java.util.logging.FileHandler; import java.util.logging.Handler; import java.util.logging.Logger; +import javafx.application.Application; +import javafx.fxml.FXMLLoader; +import javafx.scene.Parent; +import javafx.scene.Scene; +import javafx.stage.Stage; - - -/** - * JavaFX App - */ +/** JavaFX App */ public class App extends Application { - private static Scene scene; - private static FXMLLoader fxmlLoader; - private static Logger logger = Logger.getLogger("AmsatLogger"); - - @Override - public void start(Stage stage) throws IOException { - - System.setProperty("glass.accessible.force", "false"); - scene = new Scene(loadFXML("KissTool"), 800, 600); - stage.setScene(scene); - - - Controler ctrl = fxmlLoader.getController(); - ctrl.setPrimaryStage(stage); - scene.getStylesheets().add(this.getClass().getResource("boot.css").toExternalForm()); - stage.setTitle("KISS tool -UVSQSAT Dedicated "+ ctrl.getVersion() ); - ctrl.initMMI(); - stage.show(); - } - - static void setRoot(String fxml) throws IOException { - scene.setRoot(loadFXML(fxml)); - } - - private static Parent loadFXML(String fxml) throws IOException { - fxmlLoader = new FXMLLoader(App.class.getResource(fxml + ".fxml")); - return fxmlLoader.load(); - } - - public static void main(String[] args) { - // initialisation du systéme de log en premier - try { - String path = System.getProperty("user.dir") + "/log"; - File apath = new File(path); - - if (!apath.exists()) { - if (apath.mkdir() == false) { - System.err.println("fail to create " + path); - } - } - FileHandler fh = new FileHandler(path + "/" + "KissTool.log.xml"); - logger.setUseParentHandlers(false); - Handler[] handlers = logger.getHandlers(); - for (Handler handler : handlers) { - logger.removeHandler(handler); - } - logger.addHandler(fh); - - } catch (SecurityException e) { + private static Scene scene; + private static FXMLLoader fxmlLoader; + private static Logger logger = Logger.getLogger("AmsatLogger"); + + @Override + public void start(Stage stage) throws IOException { + + System.setProperty("glass.accessible.force", "false"); + scene = new Scene(loadFXML("KissTool"), 800, 600); + stage.setScene(scene); + + Controler ctrl = fxmlLoader.getController(); + ctrl.setPrimaryStage(stage); + scene.getStylesheets().add(this.getClass().getResource("boot.css").toExternalForm()); + stage.setTitle("KISS tool -UVSQSAT Dedicated " + ctrl.getVersion()); + ctrl.initMMI(); + stage.show(); + } + + static void setRoot(String fxml) throws IOException { + scene.setRoot(loadFXML(fxml)); + } + + private static Parent loadFXML(String fxml) throws IOException { + fxmlLoader = new FXMLLoader(App.class.getResource(fxml + ".fxml")); + return fxmlLoader.load(); + } + + public static void main(String[] args) { + // initialisation du systéme de log en premier + try { + String path = System.getProperty("user.dir") + "/log"; + File apath = new File(path); + + if (!apath.exists()) { + if (apath.mkdir() == false) { + System.err.println("fail to create " + path); + } + } + FileHandler fh = new FileHandler(path + "/" + "KissTool.log.xml"); + logger.setUseParentHandlers(false); + Handler[] handlers = logger.getHandlers(); + for (Handler handler : handlers) { + logger.removeHandler(handler); + } + logger.addHandler(fh); - e.printStackTrace(); + } catch (SecurityException e) { - } catch (IOException e) { + e.printStackTrace(); - e.printStackTrace(); + } catch (IOException e) { - } - launch(); + e.printStackTrace(); } - -} \ No newline at end of file + launch(); + } +} diff --git a/ApplicationKissTool/src/main/java/org/josast/ApplicationKissTool/Ax25Display.java b/ApplicationKissTool/src/main/java/org/josast/ApplicationKissTool/Ax25Display.java index 3349d6550c39202030e0195407b2e4ea0d76ee4e..7c8581719815e21f1544637c73f87b03dcb12e3b 100644 --- a/ApplicationKissTool/src/main/java/org/josast/ApplicationKissTool/Ax25Display.java +++ b/ApplicationKissTool/src/main/java/org/josast/ApplicationKissTool/Ax25Display.java @@ -2,48 +2,33 @@ package org.josast.ApplicationKissTool; import org.josast.AX25.AX25DecodedData; - public class Ax25Display { - - ReceivedData decodedData =null; - AX25DecodedData ax25 = null; - - - - - public String getDisplay() { - StringBuffer sb = new StringBuffer(); - - - - - sb.append("\r\n"); - sb.append(decodedData.getTime().toString()); - sb.append(ax25.toStringHeader()); - sb.append(ax25.toStringData()); - sb.append("\r\n"); - return sb.toString(); - } - - - public void setdata(ReceivedData decodedData2) { - this.decodedData = decodedData2; - ax25 = new AX25DecodedData(decodedData.getData()); - - } - + ReceivedData decodedData = null; + AX25DecodedData ax25 = null; - public String getAx25Data() { - return ax25.toString(); - } + public String getDisplay() { + StringBuffer sb = new StringBuffer(); + sb.append("\r\n"); + sb.append(decodedData.getTime().toString()); + sb.append(ax25.toStringHeader()); + sb.append(ax25.toStringData()); + sb.append("\r\n"); + return sb.toString(); + } - public String GetCallsignFrom() { - - return ax25.source; - } + public void setdata(ReceivedData decodedData2) { + this.decodedData = decodedData2; + ax25 = new AX25DecodedData(decodedData.getData()); + } + public String getAx25Data() { + return ax25.toString(); + } + public String GetCallsignFrom() { + return ax25.source; + } } diff --git a/ApplicationKissTool/src/main/java/org/josast/ApplicationKissTool/Configuration.java b/ApplicationKissTool/src/main/java/org/josast/ApplicationKissTool/Configuration.java index ab4ead3f2a36dac723a2a997462c215428f029b8..d28f0df6913fbd8893a616ee1939b3b35cd4257c 100644 --- a/ApplicationKissTool/src/main/java/org/josast/ApplicationKissTool/Configuration.java +++ b/ApplicationKissTool/src/main/java/org/josast/ApplicationKissTool/Configuration.java @@ -1,296 +1,248 @@ -/** - * - */ +/** */ package org.josast.ApplicationKissTool; import org.josast.property.CONFIG; /** - * Singleton to manage all application parameter - * The default configuration is automaticaly saved in a properties file. + * Singleton to manage all application parameter The default configuration is automaticaly saved in + * a properties file. + * * @author christophe - * - * */ public class Configuration { - - - /* - * parameter with default value - */ - private String callsign="Anonymous"; - private String longitude="0.0W"; - private String latitude="0.0N"; - - private String soundModemIP="127.0.0.1"; - private String soundModemPort="8100"; - - private String SIDSAMSATSource="Anonymous"; - private String SIDSAMSATUrl="https://amsat.electrolab.fr/api/V2/SIDS"; - private String SIDSSatnogsSource="Anonymous"; - private String SIDSSatnogsURL="https://db.satnogs.org/api/telemetry/"; - private String SIDSSatnogs="0"; - private String SIDSAMSAT="1"; - private boolean SISD_SatNogs = false; - private boolean SIDS_AMSAT = true; - private boolean Silent_Mode = false; - private String SilentMode = "0"; - private String OutputFileDirectory =""; - - private int Norad=99999; - private final CONFIG conf = CONFIG.getInstance(); - - public static Configuration getInstance() - { - return SingletonHolder.instance; - } - - public boolean isSISD_SatNogs() { - - return SISD_SatNogs; - } - - - private Configuration() + /* + * parameter with default value + */ + private String callsign = "Anonymous"; + private String longitude = "0.0W"; + private String latitude = "0.0N"; + + private String soundModemIP = "127.0.0.1"; + private String soundModemPort = "8100"; + + private String SIDSAMSATSource = "Anonymous"; + private String SIDSAMSATUrl = "https://amsat.electrolab.fr/api/V2/SIDS"; + private String SIDSSatnogsSource = "Anonymous"; + private String SIDSSatnogsURL = "https://db.satnogs.org/api/telemetry/"; + private String SIDSSatnogs = "0"; + private String SIDSAMSAT = "1"; + private boolean SISD_SatNogs = false; + private boolean SIDS_AMSAT = true; + private boolean Silent_Mode = false; + private String SilentMode = "0"; + private String OutputFileDirectory = ""; + + private int Norad = 99999; + private final CONFIG conf = CONFIG.getInstance(); + + public static Configuration getInstance() { + return SingletonHolder.instance; + } + + public boolean isSISD_SatNogs() { + + return SISD_SatNogs; + } + + private Configuration() { + if (conf.getProperty("Callsign") != null) { + callsign = conf.getProperty("Callsign"); + latitude = conf.getProperty("Latitude"); + longitude = conf.getProperty("Longitude"); + + SIDSAMSATSource = conf.getProperty("SIDSAMSATSource"); + SIDSAMSATUrl = conf.getProperty("SIDSAMSATUrl"); + SIDSSatnogsSource = conf.getProperty("SIDSSatnogsSource"); + SIDSSatnogsURL = conf.getProperty("SIDSSatnogsURL"); + SIDSSatnogs = conf.getProperty("SIDSSatnogs"); + SIDSAMSAT = conf.getProperty("SIDSAMSAT"); + soundModemIP = conf.getProperty("soundModemIP"); + soundModemPort = conf.getProperty("soundModemPort"); + OutputFileDirectory = conf.getProperty("OutputFileDirectory"); + SilentMode = conf.getProperty("SilentMode"); + if (SIDSSatnogs.contentEquals("1")) { + SISD_SatNogs = true; + } else { + SISD_SatNogs = false; + } + if (SIDSAMSAT.contentEquals("1")) { + SIDS_AMSAT = true; + } else { + SIDS_AMSAT = false; + } + + if (SilentMode.contentEquals("1")) { + Silent_Mode = true; + + } else { + Silent_Mode = false; + } + + } else // si le fichier n'existe pas, il est créé par défaut { - if ( conf.getProperty("Callsign")!=null) - { - callsign = conf.getProperty("Callsign"); - latitude = conf.getProperty("Latitude"); - longitude = conf.getProperty("Longitude"); - - SIDSAMSATSource=conf.getProperty("SIDSAMSATSource"); - SIDSAMSATUrl=conf.getProperty("SIDSAMSATUrl"); - SIDSSatnogsSource=conf.getProperty("SIDSSatnogsSource"); - SIDSSatnogsURL=conf.getProperty("SIDSSatnogsURL"); - SIDSSatnogs=conf.getProperty("SIDSSatnogs"); - SIDSAMSAT=conf.getProperty("SIDSAMSAT"); - soundModemIP = conf.getProperty("soundModemIP"); - soundModemPort = conf.getProperty("soundModemPort"); - OutputFileDirectory = conf.getProperty("OutputFileDirectory"); - SilentMode = conf.getProperty("SilentMode"); - if (SIDSSatnogs.contentEquals("1") ) - { - SISD_SatNogs=true; - } else - { - SISD_SatNogs=false; - } - if (SIDSAMSAT.contentEquals("1") ) - { - SIDS_AMSAT=true; - } else - { - SIDS_AMSAT=false; - } - - if (SilentMode.contentEquals("1") ) - { - Silent_Mode=true; - - } else - { - Silent_Mode=false; - } - - } - else // si le fichier n'existe pas, il est créé par défaut - { - save(); - } - - - } - - - private static class SingletonHolder - { - - private final static Configuration instance = new Configuration(); - } - - - - - public void setSIDSSatnogs(String sIDSSatnogs) { - SIDSSatnogs = sIDSSatnogs; - if (SIDSSatnogs.contentEquals("1") ) - { - SISD_SatNogs=true; - } else - { - SISD_SatNogs=false; - } - } - - - public void setSIDSAMSAT(String sIDSEntrySat) { - SIDSAMSAT = sIDSEntrySat; - if (SIDSAMSAT.contentEquals("1") ) - { - SIDS_AMSAT=true; - } else - { - SIDS_AMSAT=false; - } - } - - - public void save() { - - conf.setProperty("Callsign",callsign); - conf.setProperty("Latitude",latitude); - conf.setProperty("Longitude",longitude); - conf.setProperty("SIDSAMSATSource",this.SIDSAMSATSource); - conf.setProperty("SIDSAMSATUrl",this.SIDSAMSATUrl); - conf.setProperty("SIDSSatnogsSource",this.SIDSSatnogsSource); - conf.setProperty("SIDSSatnogsURL",this.SIDSSatnogsURL); - conf.setProperty("SIDSSatnogs",this.SIDSSatnogs); - conf.setProperty("SIDSAMSAT",this.SIDSAMSAT); - conf.setProperty("soundModemPort",this.soundModemPort); - conf.setProperty("soundModemIP",this.soundModemIP); - conf.setProperty("OutputFileDirectory", OutputFileDirectory); - conf.setProperty("SilentMode", this.SilentMode); - } - - public String getCallsign() { - return callsign; - } - - public void setCallsign(String callsign) { - this.callsign = callsign; - } - - public String getLongitude() { - return longitude; - } - - public void setLongitude(String longitude) { - this.longitude = longitude; - } - - public String getLatitude() { - return latitude; - } - - public void setLatitude(String latitude) { - this.latitude = latitude; - } - - public String getSoundModemIP() { - return soundModemIP; - } - - public void setSoundModemIP(String soundModemIP) { - this.soundModemIP = soundModemIP; - } - - public String getSoundModemPort() { - return soundModemPort; - } - - public void setSoundModemPort(String soundModemPort) { - this.soundModemPort = soundModemPort; - } - - public String getSIDSAMSATSource() { - return SIDSAMSATSource; - } - - public void setSIDSAMSATSource(String sIDSAMSATSource) { - SIDSAMSATSource = sIDSAMSATSource; - } - - public String getSIDSAMSATUrl() { - return SIDSAMSATUrl; - } - - public void setSIDSAMSATUrl(String sIDSAMSATUrl) { - SIDSAMSATUrl = sIDSAMSATUrl; - } - - public String getSIDSSatnogsSource() { - return SIDSSatnogsSource; - } - - public void setSIDSSatnogsSource(String sIDSSatnogsSource) { - SIDSSatnogsSource = sIDSSatnogsSource; - } - - public String getSIDSSatnogsURL() { - return SIDSSatnogsURL; - } - - public void setSIDSSatnogsURL(String sIDSSatnogsURL) { - SIDSSatnogsURL = sIDSSatnogsURL; - } - - - - - - public boolean isSIDS_AMSAT() { - return SIDS_AMSAT; - } - - - -// public CONFIG getConf() { -// return conf; -// } -// -// public void setConf(CONFIG conf) { -// this.conf = conf; -// } - - public void setSISD_SatNogs(boolean sISD_SatNogs) { - SISD_SatNogs = sISD_SatNogs; - } - - public int getNorad() { - return Norad; - } - - public void setNorad(int norad) { - Norad = norad; - } - - /** - * @return the silentMode - */ - public boolean isSilentMode() { - return Silent_Mode; - } - - /** - * @param silentMode the silentMode to set - */ - public void setSilentMode(boolean silentMode) { - Silent_Mode = silentMode; - if (Silent_Mode ) - { - SilentMode="1"; - } else - { - SilentMode="O"; - } - } - - /** - * @return the outputFileDirectory - */ - public String getOutputFileDirectory() { - return OutputFileDirectory; - } - - /** - * @param outputFileDirectory the outputFileDirectory to set - */ - public void setOutputFileDirectory(String outputFileDirectory) { - OutputFileDirectory = outputFileDirectory; - } - - - + save(); + } + } + + private static class SingletonHolder { + + private static final Configuration instance = new Configuration(); + } + + public void setSIDSSatnogs(String sIDSSatnogs) { + SIDSSatnogs = sIDSSatnogs; + if (SIDSSatnogs.contentEquals("1")) { + SISD_SatNogs = true; + } else { + SISD_SatNogs = false; + } + } + + public void setSIDSAMSAT(String sIDSEntrySat) { + SIDSAMSAT = sIDSEntrySat; + if (SIDSAMSAT.contentEquals("1")) { + SIDS_AMSAT = true; + } else { + SIDS_AMSAT = false; + } + } + + public void save() { + + conf.setProperty("Callsign", callsign); + conf.setProperty("Latitude", latitude); + conf.setProperty("Longitude", longitude); + conf.setProperty("SIDSAMSATSource", this.SIDSAMSATSource); + conf.setProperty("SIDSAMSATUrl", this.SIDSAMSATUrl); + conf.setProperty("SIDSSatnogsSource", this.SIDSSatnogsSource); + conf.setProperty("SIDSSatnogsURL", this.SIDSSatnogsURL); + conf.setProperty("SIDSSatnogs", this.SIDSSatnogs); + conf.setProperty("SIDSAMSAT", this.SIDSAMSAT); + conf.setProperty("soundModemPort", this.soundModemPort); + conf.setProperty("soundModemIP", this.soundModemIP); + conf.setProperty("OutputFileDirectory", OutputFileDirectory); + conf.setProperty("SilentMode", this.SilentMode); + } + + public String getCallsign() { + return callsign; + } + + public void setCallsign(String callsign) { + this.callsign = callsign; + } + + public String getLongitude() { + return longitude; + } + + public void setLongitude(String longitude) { + this.longitude = longitude; + } + + public String getLatitude() { + return latitude; + } + + public void setLatitude(String latitude) { + this.latitude = latitude; + } + + public String getSoundModemIP() { + return soundModemIP; + } + + public void setSoundModemIP(String soundModemIP) { + this.soundModemIP = soundModemIP; + } + + public String getSoundModemPort() { + return soundModemPort; + } + + public void setSoundModemPort(String soundModemPort) { + this.soundModemPort = soundModemPort; + } + + public String getSIDSAMSATSource() { + return SIDSAMSATSource; + } + + public void setSIDSAMSATSource(String sIDSAMSATSource) { + SIDSAMSATSource = sIDSAMSATSource; + } + + public String getSIDSAMSATUrl() { + return SIDSAMSATUrl; + } + + public void setSIDSAMSATUrl(String sIDSAMSATUrl) { + SIDSAMSATUrl = sIDSAMSATUrl; + } + + public String getSIDSSatnogsSource() { + return SIDSSatnogsSource; + } + + public void setSIDSSatnogsSource(String sIDSSatnogsSource) { + SIDSSatnogsSource = sIDSSatnogsSource; + } + + public String getSIDSSatnogsURL() { + return SIDSSatnogsURL; + } + + public void setSIDSSatnogsURL(String sIDSSatnogsURL) { + SIDSSatnogsURL = sIDSSatnogsURL; + } + + public boolean isSIDS_AMSAT() { + return SIDS_AMSAT; + } + + // public CONFIG getConf() { + // return conf; + // } + // + // public void setConf(CONFIG conf) { + // this.conf = conf; + // } + + public void setSISD_SatNogs(boolean sISD_SatNogs) { + SISD_SatNogs = sISD_SatNogs; + } + + public int getNorad() { + return Norad; + } + + public void setNorad(int norad) { + Norad = norad; + } + + /** @return the silentMode */ + public boolean isSilentMode() { + return Silent_Mode; + } + + /** @param silentMode the silentMode to set */ + public void setSilentMode(boolean silentMode) { + Silent_Mode = silentMode; + if (Silent_Mode) { + SilentMode = "1"; + } else { + SilentMode = "O"; + } + } + + /** @return the outputFileDirectory */ + public String getOutputFileDirectory() { + return OutputFileDirectory; + } + + /** @param outputFileDirectory the outputFileDirectory to set */ + public void setOutputFileDirectory(String outputFileDirectory) { + OutputFileDirectory = outputFileDirectory; + } } diff --git a/ApplicationKissTool/src/main/java/org/josast/ApplicationKissTool/Controler.java b/ApplicationKissTool/src/main/java/org/josast/ApplicationKissTool/Controler.java index cf8fee05ecb4a3939201679ec7e549220111a6b4..dc3af9d116956ef059c8bb134c76634aea987ca9 100644 --- a/ApplicationKissTool/src/main/java/org/josast/ApplicationKissTool/Controler.java +++ b/ApplicationKissTool/src/main/java/org/josast/ApplicationKissTool/Controler.java @@ -11,21 +11,11 @@ import java.util.Date; import java.util.TimeZone; import java.util.logging.Level; import java.util.logging.Logger; - -import javax.imageio.ImageIO; - -import org.josast.ModuleSoundModem.SoundModemConfiguration; -import org.josast.SIDS.Station; -import org.josast.propertyHttp.ConfigHttp; - import javafx.application.Platform; import javafx.concurrent.WorkerStateEvent; import javafx.embed.swing.SwingFXUtils; import javafx.event.ActionEvent; import javafx.event.EventHandler; - -//import java.util.logging.Logger; - import javafx.fxml.FXML; import javafx.scene.control.Alert; import javafx.scene.control.Button; @@ -38,515 +28,468 @@ import javafx.scene.image.ImageView; import javafx.stage.DirectoryChooser; import javafx.stage.Stage; import javafx.stage.Window; +import javax.imageio.ImageIO; +import org.josast.ModuleSoundModem.SoundModemConfiguration; +import org.josast.SIDS.Station; +import org.josast.propertyHttp.ConfigHttp; public class Controler { - private static final int STATE_INIT = 0; - private static final int STATE_START = 1; - protected static final int STATE_STOP = 2; - private static final int STATE_SAVE = 3; + private static final int STATE_INIT = 0; + private static final int STATE_START = 1; + protected static final int STATE_STOP = 2; + private static final int STATE_SAVE = 3; - private static Logger appLogger = Logger.getLogger("AmsatLogger"); - ConfigHttp c = new ConfigHttp("http://site.amsat-f.org/download/117487/"); - final private SimpleDateFormat ISO8601DATEFORMAT = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'"); + private static Logger appLogger = Logger.getLogger("AmsatLogger"); + ConfigHttp c = new ConfigHttp("http://site.amsat-f.org/download/117487/"); + private final SimpleDateFormat ISO8601DATEFORMAT = + new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'"); - private ManageDataFile mdf = new ManageDataFile(); + private ManageDataFile mdf = new ManageDataFile(); - private String version = "1.5"; + private String version = "1.5"; - @FXML - private Button ButtonStart; - @FXML - private Button ButtonStop; - @FXML - private Button ButtonSave; - @FXML - private Button buttonFileChoiser; - @FXML - private TextField TextFielRepository; + @FXML private Button ButtonStart; + @FXML private Button ButtonStop; + @FXML private Button ButtonSave; + @FXML private Button buttonFileChoiser; + @FXML private TextField TextFielRepository; - @FXML - private Label LabelIP; - - @FXML - private CheckBox checkboxSilenceMode; - @FXML - private Button ButtonFile; - @FXML - private Button ButtonSerial; - @FXML - private Button ButtonKiss; - - @FXML - private TextField FieldIP; - @FXML - private TextField FieldPort; - - @FXML - private Label labelStatus; - @FXML - private Label LabelFrame; - - @FXML - private TextArea DecodedData; - - @FXML - private TextArea TexAreaLog; - - @FXML - private TextField textFieldMode; - - @FXML - private TextField textFieldDate; - - @FXML - private Label LabelInformation; - - @FXML - private ImageView ImageViewAMSAT; - - @FXML - private ImageView imageViewEntrysat; - - @FXML - private TextField TextFieldCallsign; - @FXML - private TextField TextFieldLatitude; - @FXML - private TextField TextFieldLongitude; - - @FXML - private CheckBox CheckbBoxAmicalSat; - @FXML - private CheckBox CheckBoxSatNogs; - - @FXML - private Button ButtonSaveConfiguration; - - @FXML - private TextField TextFieldSIDSEntrysat; - @FXML - private TextField TextFieldSIDSSatnogs; - - Stage primaryStage = null; - - private String imgAmsat = "logoAmsat.png"; - private String imgAmicalsat = "OIP.jpg"; - - Station station = new Station(); - - ModelReceivedData receivedFrame = new ModelReceivedData(); - private final Configuration conf = Configuration.getInstance(); - - private TaskSoundmodemTCP task; - private SendSIDS SendSIDSSatnogs; - private SendSIDS SendSIDSMVPAmsat; - private Ax25Display ax25display = new Ax25Display(); - private DisplayUVSQsat displayUVSQsat = new DisplayUVSQsat(); - - @FXML - private void HandleSaveConfiguration(ActionEvent event) { - - String erreurmsg = null; - String Callsign = null; - - if (TextFieldCallsign.getText().isEmpty()) { - erreurmsg += "please enter a CallSign \r\n"; - } else { - Callsign = TextFieldCallsign.getText(); - } - - String Latitude = TextFieldLatitude.getText(); - String Longitude = TextFieldLongitude.getText(); - - if (station.checkLatitude(Latitude) == false) { - erreurmsg += "Wrong format for Latitude : XX.XXE/W \r\n"; - } - - if (station.checkLongitude(Longitude) == false) { - erreurmsg += "Wrong format for Longitude : XX.XXS/N \r\n"; - } - if (erreurmsg != null) { - Window owner = ButtonSaveConfiguration.getScene().getWindow(); - AlertHelper.showAlert(Alert.AlertType.ERROR, owner, "Form Error!", erreurmsg); - return; - } - - station.setCallsign(Callsign); - station.setLatitude(Latitude); - station.setLongitude(Longitude); - - conf.setCallsign(Callsign); - conf.setLatitude(Latitude); - conf.setLongitude(Longitude); - - conf.setSIDSAMSATSource(TextFieldSIDSEntrysat.getText()); - conf.setSIDSSatnogsSource(TextFieldSIDSSatnogs.getText()); - conf.setSoundModemIP(FieldIP.getText()); - conf.setSoundModemPort(FieldPort.getText()); - conf.setOutputFileDirectory(this.TextFielRepository.getText()); - conf.setSilentMode(checkboxSilenceMode.isSelected()); - if(checkboxSilenceMode.isSelected()) - appLogger.setLevel(Level.SEVERE); - else - appLogger.setLevel(Level.INFO); - Station StationSatnogs = new Station(conf.getSIDSSatnogsSource(), station.getLongitude(), - station.getLatitude()); - Station StationEntry = new Station(conf.getSIDSAMSATSource(), station.getLongitude(), station.getLatitude()); - - if (CheckbBoxAmicalSat.isSelected() == true) { - conf.setSIDSAMSAT("1"); - - SendSIDSMVPAmsat = new SendSIDS(StationEntry, conf.getNorad(), conf.getSIDSAMSATUrl()); - } else { - conf.setSIDSAMSAT("0"); - - } - - if (CheckBoxSatNogs.isSelected() == true) { - conf.setSIDSSatnogs("1"); - - SendSIDSSatnogs = new SendSIDS(StationSatnogs, conf.getNorad(), - conf.getSIDSSatnogsURL()); - } else { - conf.setSIDSSatnogs("0"); - } - - conf.save(); - mdf.setRepositoryPath(conf.getOutputFileDirectory()); - manageStatusinformation("Configuration Saved", "Configuration Saved"); - - } - - @FXML - private void Handlefilechooser() { - DirectoryChooser directoryChooser = new DirectoryChooser(); - File selectedDirectory = directoryChooser.showDialog(primaryStage); + @FXML private Label LabelIP; - conf.setOutputFileDirectory(selectedDirectory.getAbsolutePath()); - TextFielRepository.setText(selectedDirectory.getAbsolutePath()); - - } - - @FXML - private void handleStart(ActionEvent event) { - - manageStatusinformation("Connected to modem", "Connection to modem"); - manageStateMMI(STATE_START); - - // TODO : to improve - SoundModemConfiguration smc = new SoundModemConfiguration("configuration.ini"); - smc.setSmIPadress(FieldIP.getText()); - smc.setSmPort(Integer.parseInt(FieldPort.getText())); - - if (task == null) { - receivedFrame.addPropertyChangeListener(new PropertyChangeListener() { - @Override - public void propertyChange(PropertyChangeEvent evt) { - final ReceivedData decodedData = receivedFrame.getLastReceivedData(); - Platform.runLater(new Runnable() { - - @Override - public void run() { - try { - - if (decodedData != null) { - updateFrame(receivedFrame.getNumberFrame()); - ax25display.setdata(decodedData); - ISO8601DATEFORMAT.setTimeZone(TimeZone.getTimeZone("UTC")); - Date aujourdhui = new Date(); - String creationdate = ISO8601DATEFORMAT.format(aujourdhui); - - - String hexaString = new BigInteger(1, decodedData.getData()).toString(16); - -// UVSQsat mdf.saveRawFile(decodedData.getData()); - TlmData tlmData = new TlmData(hexaString, ax25display.GetCallsignFrom(),conf.getLongitude(),conf.getLatitude(), - creationdate); - if(mdf.saveTlmData(tlmData)!=0) - { - displayLog("Error creation JSON file"); - } -// mdf.saveDataHex(hexaString); - - if (!checkboxSilenceMode.isSelected()) { - displayLog(decodedData.toString()); - ax25display.setdata(decodedData); - DecodedData.appendText(ax25display.getDisplay()); + @FXML private CheckBox checkboxSilenceMode; + @FXML private Button ButtonFile; + @FXML private Button ButtonSerial; + @FXML private Button ButtonKiss; - if (ax25display.GetCallsignFrom().contains("LATMOS")) { - - displayUVSQsat.setData(decodedData); - DecodedData.appendText(displayUVSQsat.getData()); - - } - } - - // envoie vers serveur - SendSids(receivedFrame.getLastReceivedData()); - - } else { - displayLog("received frame : null"); - } - - } catch (Exception e) { - displayLog("Run - error"); - displayLog(e.toString()); - e.printStackTrace(); - } - - } - - }); - } - - } - - ); - - } - task = new TaskSoundmodemTCP(smc, receivedFrame); - - task.setOnSucceeded(new EventHandler() { - - @Override - public void handle(WorkerStateEvent event) { - // La tache s'est correctement terminee. - manageStatusinformation("KISS TCP CONNECTION FAILED", "KISS TCP DISCONNECTED"); - manageStateMMI(STATE_STOP); - - } - - }); - - task.setOnFailed(new EventHandler() { - - @Override - public void handle(WorkerStateEvent event) { - // La tache s'est correctement terminee. - manageStatusinformation("KISS TCP CONNECTION FAILED", "KISS TCP DISCONNECTED - Connection failed"); - displayLog(event.toString()); - displayLog(event.getSource().toString()); - manageStateMMI(STATE_STOP); - } - - }); - - Thread backgroundThread = new Thread(task); - backgroundThread.setDaemon(true); - backgroundThread.start(); - - } - - @FXML - private void handleStop(ActionEvent event) { - - manageStateMMI(STATE_STOP); - task.arreter(); - manageStatusinformation("Stop received data", "Stop task to receive telemetrie"); - } - - @FXML - private void handleSave(ActionEvent event) { - - manageStateMMI(STATE_SAVE); - manageStatusinformation("save data", "save Telemetry in file"); - mdf.saveDataFile(receivedFrame); - manageStatusinformation("Data Saved", "Telemetry Data saved in file"); - } - - @FXML - private void HandleIP(ActionEvent event) { - } - - @FXML - private void HandlePort(ActionEvent event) { - } - - public void initMMI() { - - manageStatusinformation("Initialised", "KISS TOOL - LOG \r\n Initialise application"); - appLogger.warning("Initialise "); - primaryStage.setTitle("KISS TOOL - " + version); - int NoradIdConf = conf.getNorad(); - - station.setCallsign(conf.getCallsign()); - station.setLatitude(conf.getLatitude()); - station.setLongitude(conf.getLongitude()); - - TextFieldCallsign.setText(station.getCallsign()); - TextFieldLatitude.setText(station.getLatitude()); - TextFieldLongitude.setText(station.getLongitude()); - - FieldIP.setText(conf.getSoundModemIP()); - FieldPort.setText(conf.getSoundModemPort()); - TextFieldSIDSEntrysat.setText(conf.getSIDSAMSATSource()); - TextFieldSIDSSatnogs.setText(conf.getSIDSSatnogsSource()); - TextFielRepository.setText(conf.getOutputFileDirectory()); - - if (conf.isSIDS_AMSAT()) { - CheckbBoxAmicalSat.setSelected(true); - } - if (conf.isSISD_SatNogs()) { - CheckBoxSatNogs.setSelected(true); - } - - checkboxSilenceMode.setSelected(conf.isSilentMode()); - if(checkboxSilenceMode.isSelected()) - appLogger.setLevel(Level.SEVERE); - else - appLogger.setLevel(Level.INFO); - - displayLog(conf.getSIDSSatnogsURL()); - displayLog(conf.getSIDSAMSATUrl()); - displayLog("Initialisation with Properties File Done "); - - BufferedImage bufferedImage1 = null; - BufferedImage bufferedImage2 = null; - - try { - - bufferedImage1 = ImageIO.read(getClass().getResource((imgAmsat))); - bufferedImage2 = ImageIO.read(getClass().getResource((imgAmicalsat))); - } catch (IOException e) { - - appLogger.severe("Error loading Image resources"); - appLogger.severe(e.toString()); - } - Image imageamsat = SwingFXUtils.toFXImage(bufferedImage1, null); - ImageViewAMSAT.setImage(imageamsat); - Image imgQB = SwingFXUtils.toFXImage(bufferedImage2, null); - imageViewEntrysat.setImage(imgQB); - - String ver; - String message; - - if (c.isConnected()) { - ver = c.getProperty("Kisstool"); - message = c.getProperty("Message"); - String noradid = c.getProperty("NoradID"); - - if(noradid!=null) - { - NoradIdConf = Integer - .parseUnsignedInt(c.getProperty("NoradID").trim()); - - } - - } else { - ver = version; - message = "not connected to internet"; - } - if (NoradIdConf != 0) - { - // ID norad attribué - mise à jours du logiciel - if (NoradIdConf != conf.getNorad()) { - conf.setNorad(NoradIdConf); - conf.save(); - displayLog("Norad ID updated "); + @FXML private TextField FieldIP; + @FXML private TextField FieldPort; + + @FXML private Label labelStatus; + @FXML private Label LabelFrame; + + @FXML private TextArea DecodedData; + + @FXML private TextArea TexAreaLog; + + @FXML private TextField textFieldMode; + + @FXML private TextField textFieldDate; + + @FXML private Label LabelInformation; + + @FXML private ImageView ImageViewAMSAT; + + @FXML private ImageView imageViewEntrysat; + + @FXML private TextField TextFieldCallsign; + @FXML private TextField TextFieldLatitude; + @FXML private TextField TextFieldLongitude; + + @FXML private CheckBox CheckbBoxAmicalSat; + @FXML private CheckBox CheckBoxSatNogs; + + @FXML private Button ButtonSaveConfiguration; + + @FXML private TextField TextFieldSIDSEntrysat; + @FXML private TextField TextFieldSIDSSatnogs; + + Stage primaryStage = null; + + private String imgAmsat = "logoAmsat.png"; + private String imgAmicalsat = "OIP.jpg"; + + Station station = new Station(); + + ModelReceivedData receivedFrame = new ModelReceivedData(); + private final Configuration conf = Configuration.getInstance(); + + private TaskSoundmodemTCP task; + private SendSIDS SendSIDSSatnogs; + private SendSIDS SendSIDSMVPAmsat; + private Ax25Display ax25display = new Ax25Display(); + private DisplayUVSQsat displayUVSQsat = new DisplayUVSQsat(); + + @FXML + private void HandleSaveConfiguration(ActionEvent event) { + + String erreurmsg = null; + String Callsign = null; + + if (TextFieldCallsign.getText().isEmpty()) { + erreurmsg += "please enter a CallSign \r\n"; + } else { + Callsign = TextFieldCallsign.getText(); + } + + String Latitude = TextFieldLatitude.getText(); + String Longitude = TextFieldLongitude.getText(); + + if (station.checkLatitude(Latitude) == false) { + erreurmsg += "Wrong format for Latitude : XX.XXE/W \r\n"; + } + + if (station.checkLongitude(Longitude) == false) { + erreurmsg += "Wrong format for Longitude : XX.XXS/N \r\n"; + } + if (erreurmsg != null) { + Window owner = ButtonSaveConfiguration.getScene().getWindow(); + AlertHelper.showAlert(Alert.AlertType.ERROR, owner, "Form Error!", erreurmsg); + return; + } + + station.setCallsign(Callsign); + station.setLatitude(Latitude); + station.setLongitude(Longitude); + + conf.setCallsign(Callsign); + conf.setLatitude(Latitude); + conf.setLongitude(Longitude); + + conf.setSIDSAMSATSource(TextFieldSIDSEntrysat.getText()); + conf.setSIDSSatnogsSource(TextFieldSIDSSatnogs.getText()); + conf.setSoundModemIP(FieldIP.getText()); + conf.setSoundModemPort(FieldPort.getText()); + conf.setOutputFileDirectory(this.TextFielRepository.getText()); + conf.setSilentMode(checkboxSilenceMode.isSelected()); + if (checkboxSilenceMode.isSelected()) appLogger.setLevel(Level.SEVERE); + else appLogger.setLevel(Level.INFO); + Station StationSatnogs = + new Station(conf.getSIDSSatnogsSource(), station.getLongitude(), station.getLatitude()); + Station StationEntry = + new Station(conf.getSIDSAMSATSource(), station.getLongitude(), station.getLatitude()); + + if (CheckbBoxAmicalSat.isSelected() == true) { + conf.setSIDSAMSAT("1"); + + SendSIDSMVPAmsat = new SendSIDS(StationEntry, conf.getNorad(), conf.getSIDSAMSATUrl()); + } else { + conf.setSIDSAMSAT("0"); + } + + if (CheckBoxSatNogs.isSelected() == true) { + conf.setSIDSSatnogs("1"); + + SendSIDSSatnogs = new SendSIDS(StationSatnogs, conf.getNorad(), conf.getSIDSSatnogsURL()); + } else { + conf.setSIDSSatnogs("0"); + } + + conf.save(); + mdf.setRepositoryPath(conf.getOutputFileDirectory()); + manageStatusinformation("Configuration Saved", "Configuration Saved"); + } + + @FXML + private void Handlefilechooser() { + DirectoryChooser directoryChooser = new DirectoryChooser(); + File selectedDirectory = directoryChooser.showDialog(primaryStage); + + conf.setOutputFileDirectory(selectedDirectory.getAbsolutePath()); + TextFielRepository.setText(selectedDirectory.getAbsolutePath()); + } + + @FXML + private void handleStart(ActionEvent event) { + + manageStatusinformation("Connected to modem", "Connection to modem"); + manageStateMMI(STATE_START); + + // TODO : to improve + SoundModemConfiguration smc = new SoundModemConfiguration("configuration.ini"); + smc.setSmIPadress(FieldIP.getText()); + smc.setSmPort(Integer.parseInt(FieldPort.getText())); + + if (task == null) { + receivedFrame.addPropertyChangeListener( + new PropertyChangeListener() { + @Override + public void propertyChange(PropertyChangeEvent evt) { + final ReceivedData decodedData = receivedFrame.getLastReceivedData(); + Platform.runLater( + new Runnable() { + + @Override + public void run() { + try { + + if (decodedData != null) { + updateFrame(receivedFrame.getNumberFrame()); + ax25display.setdata(decodedData); + ISO8601DATEFORMAT.setTimeZone(TimeZone.getTimeZone("UTC")); + Date aujourdhui = new Date(); + String creationdate = ISO8601DATEFORMAT.format(aujourdhui); + + String hexaString = new BigInteger(1, decodedData.getData()).toString(16); + + // UVSQsat mdf.saveRawFile(decodedData.getData()); + TlmData tlmData = + new TlmData( + hexaString, + ax25display.GetCallsignFrom(), + conf.getLongitude(), + conf.getLatitude(), + creationdate); + if (mdf.saveTlmData(tlmData) != 0) { + displayLog("Error creation JSON file"); + } + // mdf.saveDataHex(hexaString); + + if (!checkboxSilenceMode.isSelected()) { + displayLog(decodedData.toString()); + ax25display.setdata(decodedData); + DecodedData.appendText(ax25display.getDisplay()); + + if (ax25display.GetCallsignFrom().contains("LATMOS")) { + + displayUVSQsat.setData(decodedData); + DecodedData.appendText(displayUVSQsat.getData()); + } + } + + // envoie vers serveur + SendSids(receivedFrame.getLastReceivedData()); + + } else { + displayLog("received frame : null"); + } + + } catch (Exception e) { + displayLog("Run - error"); + displayLog(e.toString()); + e.printStackTrace(); + } + } + }); } - } - manageStateMMI(STATE_INIT); - manageStatusinformation("Application Ready", "Application initialised"); - this.LabelInformation.setText(""); - - // initialise SIDS - - Station StationSatnogs = new Station(conf.getSIDSSatnogsSource(), station.getLongitude(), - station.getLatitude()); - Station StationEntry = new Station(conf.getSIDSAMSATSource(), station.getLongitude(), station.getLatitude()); - - if (conf.isSISD_SatNogs() == true) { - SendSIDSSatnogs = new SendSIDS(StationSatnogs, conf.getNorad(), - conf.getSIDSSatnogsURL()); - } - - if (conf.isSIDS_AMSAT() == true) { - SendSIDSMVPAmsat = new SendSIDS(StationEntry, conf.getNorad(), conf.getSIDSAMSATUrl()); - } - - String erreurmsg = message; - - if (ver.equals(version) == false) { - erreurmsg += " New version " + ver + " available ! "; - - } - this.LabelInformation.setText(erreurmsg); - mdf.setRepositoryPath(conf.getOutputFileDirectory()); - - //UVSQsat - ButtonSave.setVisible(false); - - - } - - public void setPrimaryStage(Stage primaryStageIn) { - this.primaryStage = primaryStageIn; - - } - - private void updateFrame(long nbframe) { - LabelFrame.setText("frame : " + nbframe); - - } - - private void displayLog(String log) { - appLogger.info(log); - TexAreaLog.appendText(log); - TexAreaLog.appendText("\r\n"); - } - - private void manageStateMMI(int state) { - switch (state) { - case STATE_INIT: - ButtonStop.setDisable(true); - ButtonStart.setDisable(false); - ButtonSave.setDisable(true); - break; - case STATE_START: - ButtonStop.setDisable(false); - ButtonStart.setDisable(true); - ButtonSave.setDisable(false); - break; - case STATE_STOP: - ButtonStop.setDisable(true); - ButtonStart.setDisable(false); - ButtonSave.setDisable(false); - break; - case STATE_SAVE: - ButtonStop.setDisable(true); - ButtonStart.setDisable(false); - ButtonSave.setDisable(true); - break; - default: - ButtonStop.setDisable(true); - ButtonStart.setDisable(false); - ButtonSave.setDisable(false); - break; - } - } - - private void manageStatusinformation(String statusMessage, String logMessage) { - labelStatus.setText(statusMessage); - displayLog(logMessage); - - } - - private void SendSids(ReceivedData receivedData) { - - if (conf.isSIDS_AMSAT() == true) { - int results = SendSIDSMVPAmsat.Send(receivedData); - displayLog("Send SIDS AMSAT-F Database ; " + results); - } - - if (conf.isSISD_SatNogs() == true) { - int results = SendSIDSSatnogs.Send(receivedData); - displayLog("Send SIDS SatNogs Database : " + results); - } - } - - public String getVersion() - { - return version; - } + }); + } + task = new TaskSoundmodemTCP(smc, receivedFrame); + + task.setOnSucceeded( + new EventHandler() { + + @Override + public void handle(WorkerStateEvent event) { + // La tache s'est correctement terminee. + manageStatusinformation("KISS TCP CONNECTION FAILED", "KISS TCP DISCONNECTED"); + manageStateMMI(STATE_STOP); + } + }); + + task.setOnFailed( + new EventHandler() { + + @Override + public void handle(WorkerStateEvent event) { + // La tache s'est correctement terminee. + manageStatusinformation( + "KISS TCP CONNECTION FAILED", "KISS TCP DISCONNECTED - Connection failed"); + displayLog(event.toString()); + displayLog(event.getSource().toString()); + manageStateMMI(STATE_STOP); + } + }); + + Thread backgroundThread = new Thread(task); + backgroundThread.setDaemon(true); + backgroundThread.start(); + } + + @FXML + private void handleStop(ActionEvent event) { + + manageStateMMI(STATE_STOP); + task.arreter(); + manageStatusinformation("Stop received data", "Stop task to receive telemetrie"); + } + + @FXML + private void handleSave(ActionEvent event) { + + manageStateMMI(STATE_SAVE); + manageStatusinformation("save data", "save Telemetry in file"); + mdf.saveDataFile(receivedFrame); + manageStatusinformation("Data Saved", "Telemetry Data saved in file"); + } + + @FXML + private void HandleIP(ActionEvent event) {} + + @FXML + private void HandlePort(ActionEvent event) {} + + public void initMMI() { + + manageStatusinformation("Initialised", "KISS TOOL - LOG \r\n Initialise application"); + appLogger.warning("Initialise "); + primaryStage.setTitle("KISS TOOL - " + version); + int NoradIdConf = conf.getNorad(); + + station.setCallsign(conf.getCallsign()); + station.setLatitude(conf.getLatitude()); + station.setLongitude(conf.getLongitude()); + + TextFieldCallsign.setText(station.getCallsign()); + TextFieldLatitude.setText(station.getLatitude()); + TextFieldLongitude.setText(station.getLongitude()); + + FieldIP.setText(conf.getSoundModemIP()); + FieldPort.setText(conf.getSoundModemPort()); + TextFieldSIDSEntrysat.setText(conf.getSIDSAMSATSource()); + TextFieldSIDSSatnogs.setText(conf.getSIDSSatnogsSource()); + TextFielRepository.setText(conf.getOutputFileDirectory()); + + if (conf.isSIDS_AMSAT()) { + CheckbBoxAmicalSat.setSelected(true); + } + if (conf.isSISD_SatNogs()) { + CheckBoxSatNogs.setSelected(true); + } + + checkboxSilenceMode.setSelected(conf.isSilentMode()); + if (checkboxSilenceMode.isSelected()) appLogger.setLevel(Level.SEVERE); + else appLogger.setLevel(Level.INFO); + + displayLog(conf.getSIDSSatnogsURL()); + displayLog(conf.getSIDSAMSATUrl()); + displayLog("Initialisation with Properties File Done "); + + BufferedImage bufferedImage1 = null; + BufferedImage bufferedImage2 = null; + + try { + + bufferedImage1 = ImageIO.read(getClass().getResource((imgAmsat))); + bufferedImage2 = ImageIO.read(getClass().getResource((imgAmicalsat))); + } catch (IOException e) { + + appLogger.severe("Error loading Image resources"); + appLogger.severe(e.toString()); + } + Image imageamsat = SwingFXUtils.toFXImage(bufferedImage1, null); + ImageViewAMSAT.setImage(imageamsat); + Image imgQB = SwingFXUtils.toFXImage(bufferedImage2, null); + imageViewEntrysat.setImage(imgQB); + + String ver; + String message; + + if (c.isConnected()) { + ver = c.getProperty("Kisstool"); + message = c.getProperty("Message"); + String noradid = c.getProperty("NoradID"); + + if (noradid != null) { + NoradIdConf = Integer.parseUnsignedInt(c.getProperty("NoradID").trim()); + } + + } else { + ver = version; + message = "not connected to internet"; + } + if (NoradIdConf != 0) { + // ID norad attribué - mise à jours du logiciel + if (NoradIdConf != conf.getNorad()) { + conf.setNorad(NoradIdConf); + conf.save(); + displayLog("Norad ID updated "); + } + } + manageStateMMI(STATE_INIT); + manageStatusinformation("Application Ready", "Application initialised"); + this.LabelInformation.setText(""); + + // initialise SIDS + + Station StationSatnogs = + new Station(conf.getSIDSSatnogsSource(), station.getLongitude(), station.getLatitude()); + Station StationEntry = + new Station(conf.getSIDSAMSATSource(), station.getLongitude(), station.getLatitude()); + + if (conf.isSISD_SatNogs() == true) { + SendSIDSSatnogs = new SendSIDS(StationSatnogs, conf.getNorad(), conf.getSIDSSatnogsURL()); + } + + if (conf.isSIDS_AMSAT() == true) { + SendSIDSMVPAmsat = new SendSIDS(StationEntry, conf.getNorad(), conf.getSIDSAMSATUrl()); + } + + String erreurmsg = message; + + if (ver.equals(version) == false) { + erreurmsg += " New version " + ver + " available ! "; + } + this.LabelInformation.setText(erreurmsg); + mdf.setRepositoryPath(conf.getOutputFileDirectory()); + + // UVSQsat + ButtonSave.setVisible(false); + } + + public void setPrimaryStage(Stage primaryStageIn) { + this.primaryStage = primaryStageIn; + } + + private void updateFrame(long nbframe) { + LabelFrame.setText("frame : " + nbframe); + } + + private void displayLog(String log) { + appLogger.info(log); + TexAreaLog.appendText(log); + TexAreaLog.appendText("\r\n"); + } + + private void manageStateMMI(int state) { + switch (state) { + case STATE_INIT: + ButtonStop.setDisable(true); + ButtonStart.setDisable(false); + ButtonSave.setDisable(true); + break; + case STATE_START: + ButtonStop.setDisable(false); + ButtonStart.setDisable(true); + ButtonSave.setDisable(false); + break; + case STATE_STOP: + ButtonStop.setDisable(true); + ButtonStart.setDisable(false); + ButtonSave.setDisable(false); + break; + case STATE_SAVE: + ButtonStop.setDisable(true); + ButtonStart.setDisable(false); + ButtonSave.setDisable(true); + break; + default: + ButtonStop.setDisable(true); + ButtonStart.setDisable(false); + ButtonSave.setDisable(false); + break; + } + } + + private void manageStatusinformation(String statusMessage, String logMessage) { + labelStatus.setText(statusMessage); + displayLog(logMessage); + } + + private void SendSids(ReceivedData receivedData) { + + if (conf.isSIDS_AMSAT() == true) { + int results = SendSIDSMVPAmsat.Send(receivedData); + displayLog("Send SIDS AMSAT-F Database ; " + results); + } + + if (conf.isSISD_SatNogs() == true) { + int results = SendSIDSSatnogs.Send(receivedData); + displayLog("Send SIDS SatNogs Database : " + results); + } + } + + public String getVersion() { + return version; + } } diff --git a/ApplicationKissTool/src/main/java/org/josast/ApplicationKissTool/DisplayUVSQsat.java b/ApplicationKissTool/src/main/java/org/josast/ApplicationKissTool/DisplayUVSQsat.java index c22551edbfcce3920b9685c384371cae18448a5e..cf444f7ac90430a0c05a639733196de05e4fd188 100644 --- a/ApplicationKissTool/src/main/java/org/josast/ApplicationKissTool/DisplayUVSQsat.java +++ b/ApplicationKissTool/src/main/java/org/josast/ApplicationKissTool/DisplayUVSQsat.java @@ -1,46 +1,35 @@ package org.josast.ApplicationKissTool; +import io.kaitai.struct.ByteBufferKaitaiStream; import java.util.logging.Logger; - import org.josast.uvsqsat.Frame; import org.josast.uvsqsat.generated.Uvsqsat; -import io.kaitai.struct.ByteBufferKaitaiStream; - public class DisplayUVSQsat { - Frame frame =null; - private static Logger appLogger = Logger.getLogger("AmsatLogger"); - - public void setData(ReceivedData decodedData) { - try { - Uvsqsat cube = new Uvsqsat(new ByteBufferKaitaiStream(decodedData.getData())); - frame = new Frame(); - frame.setUp(cube); - - } catch (Exception e) { - - appLogger.severe(e.getMessage()); - - } - - } - - - public String getData() - { - StringBuffer sb = new StringBuffer(); - if(frame == null) - { - sb.append("Data not decoded"); - }else - { - sb.append (frame.toString()); - } - - sb.append ("\r\n"); - return sb.toString(); - - } - - + Frame frame = null; + private static Logger appLogger = Logger.getLogger("AmsatLogger"); + + public void setData(ReceivedData decodedData) { + try { + Uvsqsat cube = new Uvsqsat(new ByteBufferKaitaiStream(decodedData.getData())); + frame = new Frame(); + frame.setUp(cube); + + } catch (Exception e) { + + appLogger.severe(e.getMessage()); + } + } + + public String getData() { + StringBuffer sb = new StringBuffer(); + if (frame == null) { + sb.append("Data not decoded"); + } else { + sb.append(frame.toString()); + } + + sb.append("\r\n"); + return sb.toString(); + } } diff --git a/ApplicationKissTool/src/main/java/org/josast/ApplicationKissTool/LogFile.java b/ApplicationKissTool/src/main/java/org/josast/ApplicationKissTool/LogFile.java index 78263019ae93c656be4f92229de5f6ec8a924c41..9e95027b57634fc308be77dcc1b8a468ab4275fb 100644 --- a/ApplicationKissTool/src/main/java/org/josast/ApplicationKissTool/LogFile.java +++ b/ApplicationKissTool/src/main/java/org/josast/ApplicationKissTool/LogFile.java @@ -1,6 +1,4 @@ -/** - * - */ +/** */ package org.josast.ApplicationKissTool; import java.io.File; @@ -11,55 +9,43 @@ import java.text.SimpleDateFormat; import java.util.Date; import java.util.logging.Logger; -/** - * @author christophe - * - */ +/** @author christophe */ public class LogFile { - private static Logger appLogger = Logger.getLogger("AmsatLogger"); - private PrintWriter pw; - - /** - * - */ - public LogFile() { - // TODO Auto-generated constructor stub - initdisplayLogFile(); - } + private static Logger appLogger = Logger.getLogger("AmsatLogger"); + private PrintWriter pw; + + /** */ + public LogFile() { + // TODO Auto-generated constructor stub + initdisplayLogFile(); + } - - private void initdisplayLogFile() - { + private void initdisplayLogFile() { - - SimpleDateFormat formater = new SimpleDateFormat("yyyy-MM-dd-HHmmss"); - Date aujourdhui = new Date(); - String path = System.getProperty("user.dir") + "/log"; - File apath = new File(path); + SimpleDateFormat formater = new SimpleDateFormat("yyyy-MM-dd-HHmmss"); + Date aujourdhui = new Date(); + String path = System.getProperty("user.dir") + "/log"; + File apath = new File(path); - if (!apath.exists()) { - if (apath.mkdir() == false) { - appLogger.severe("fail to create " + path); - } - } - try { - pw = new PrintWriter (new FileWriter(path+"/"+formater.format(aujourdhui)+"-"+".log")); - } catch (IOException e) { - appLogger.severe("erreur creating log file"); - appLogger.severe (e.toString()); - } + if (!apath.exists()) { + if (apath.mkdir() == false) { + appLogger.severe("fail to create " + path); + } + } + try { + pw = new PrintWriter(new FileWriter(path + "/" + formater.format(aujourdhui) + "-" + ".log")); + } catch (IOException e) { + appLogger.severe("erreur creating log file"); + appLogger.severe(e.toString()); } - - public void displayLog(String log) { - if(pw!=null) - { - pw.println(log); - pw.flush(); - } - appLogger.info(log); + } + public void displayLog(String log) { + if (pw != null) { + pw.println(log); + pw.flush(); } - - + appLogger.info(log); + } } diff --git a/ApplicationKissTool/src/main/java/org/josast/ApplicationKissTool/ManageDataFile.java b/ApplicationKissTool/src/main/java/org/josast/ApplicationKissTool/ManageDataFile.java index 687c00a9a2277a15b09365e95b0b663d50ba6814..dd33d7717738ed79c45b1dd599dfb77d2e0d9957 100644 --- a/ApplicationKissTool/src/main/java/org/josast/ApplicationKissTool/ManageDataFile.java +++ b/ApplicationKissTool/src/main/java/org/josast/ApplicationKissTool/ManageDataFile.java @@ -12,210 +12,174 @@ import java.text.SimpleDateFormat; import java.util.Date; import java.util.logging.Level; import java.util.logging.Logger; - import org.json.JSONObject; - - public class ManageDataFile { - - private static Logger appLogger = Logger.getLogger("AmsatLogger"); - private String generateRepository = "./ouputFile"; - private int cpt = 0; - private Path filepath; - private String RepositoryPath =null; - - private static final String LINE_SEPARATOR = "\r\n"; - - public ManageDataFile() - { - initDirectory(); - } - - - public String saveRawFile(byte[] data) { - - String message ="File created "; - - try { - Files.write(Paths.get(generateRepository + "\\Frame_" + cpt++ + ".bin"), data); - } catch (IOException e) { - - message = "Error creation file : "+e.toString(); - appLogger.severe(message); - } - return generateRepository; - - -} - - public void saveDataFileHex(String stringData) { - - SimpleDateFormat formater = new SimpleDateFormat("yyyy-MM-dd-HHmmss"); - Date aujourdhui = new Date(); - - - PrintWriter pw = null; - File files = new File(RepositoryPath + "/" + formater.format(aujourdhui) + "-tlm-Hexa.txt"); - - try { - if (files.exists() == false) { - pw = new PrintWriter(new FileWriter(RepositoryPath + "/" + formater.format(aujourdhui) + "-tlm-Hexa.txt")); - pw.write("Start file"); - pw.write(LINE_SEPARATOR); - } else { - pw = new PrintWriter(RepositoryPath + "/" + formater.format(aujourdhui) + "-tlm-Hexa.txt"); - - } - pw.append(stringData); - pw.append(LINE_SEPARATOR); - - pw.flush(); - pw.close(); - } catch (IOException e) { - e.printStackTrace(); - } - - } - - - /** - * Save telemetry data received in text file. The file is stored in data folder. - * @param receivedFrame - */ - public void saveDataFile(ModelReceivedData receivedFrame) { - SimpleDateFormat formater = new SimpleDateFormat("yyyy-MM-dd-HHmmss"); - Date aujourdhui = new Date(); - - // - - - - PrintWriter pw = null; - - long NbFrame = receivedFrame.getNumberFrame(); - - try { - pw = new PrintWriter(new FileWriter(RepositoryPath + "/" + formater.format(aujourdhui) + "-tlm-Hexa.txt")); - for (int i = 0; i < NbFrame; i++) { - pw.write(receivedFrame.getRawFrame(i)); - pw.write(LINE_SEPARATOR); - } - - pw.flush(); - pw.close(); - } catch (IOException e) { - e.printStackTrace(); - } - - } - - public void saveDataHex(String stringData) - { - - - SimpleDateFormat formater = new SimpleDateFormat("yyyy-MM-dd-HH"); - Date aujourdhui = new Date(); - String creationdate = formater.format(aujourdhui); - - filepath = Paths.get(this.RepositoryPath + "\\" + creationdate +"-Data-hex.txt"); - - - - - try { - if (!Files.exists(filepath)) - { - Files.createFile(filepath); - } - Files.writeString(filepath, stringData+ "\r\n",StandardOpenOption.APPEND); - - } catch (IOException e) { - appLogger.severe(e.toString()); - } - } - - - public int saveTlmData(TlmData tlmData) - { - - int erreur = 0; - SimpleDateFormat formater = new SimpleDateFormat("yyyy-MM-dd-HH-mm-ss.SSS"); - Date aujourdhui = new Date(); - JSONObject jasonObject = new JSONObject(tlmData); - String creationdate = formater.format(aujourdhui); - - filepath = Paths.get(this.RepositoryPath + "\\" + creationdate +"-Data.json"); - - - try { -// if (!Files.exists(filepath)) -// { - Files.createFile(filepath); -// Files.writeString(filepath, "Test" + "\r\n",StandardOpenOption.CREATE); -// } - - Files.writeString(filepath, jasonObject.toString() + "\r\n",StandardOpenOption.CREATE); - if (Files.size(filepath)<10) - { - appLogger.severe("file not created "); - erreur=-1; - } - - } catch (IOException e) { - appLogger.severe(e.toString()); - erreur=-1; - } - - return erreur; - } - - - - - - - /** - * Create all directory needed for saving data in different format - * - */ - - public void initDirectory() { - - if (RepositoryPath==null) - { - RepositoryPath=System.getProperty("user.dir")+ "\\data"; - }else if (RepositoryPath.length()==0) - { - RepositoryPath=System.getProperty("user.dir")+ "\\data"; - } - - Path path = Paths.get(RepositoryPath); - // if directory exists? - if (!Files.exists(path)) { - try { - Files.createDirectories(path); - appLogger.info("directory created : " + RepositoryPath); - } catch (IOException e) { - appLogger.log(Level.SEVERE, "cannot create outpout directorie " + e.toString()); - } - } - - } - - - public String getRepositoryPath() { - return RepositoryPath; - } - - - public void setRepositoryPath(String repositoryPath) { - RepositoryPath = repositoryPath; - // setup directory - initDirectory(); - } - - + private static Logger appLogger = Logger.getLogger("AmsatLogger"); + private String generateRepository = "./ouputFile"; + private int cpt = 0; + private Path filepath; + private String RepositoryPath = null; + + private static final String LINE_SEPARATOR = "\r\n"; + + public ManageDataFile() { + initDirectory(); + } + + public String saveRawFile(byte[] data) { + + String message = "File created "; + + try { + Files.write(Paths.get(generateRepository + "\\Frame_" + cpt++ + ".bin"), data); + } catch (IOException e) { + + message = "Error creation file : " + e.toString(); + appLogger.severe(message); + } + return generateRepository; + } + + public void saveDataFileHex(String stringData) { + + SimpleDateFormat formater = new SimpleDateFormat("yyyy-MM-dd-HHmmss"); + Date aujourdhui = new Date(); + + PrintWriter pw = null; + File files = new File(RepositoryPath + "/" + formater.format(aujourdhui) + "-tlm-Hexa.txt"); + + try { + if (files.exists() == false) { + pw = + new PrintWriter( + new FileWriter( + RepositoryPath + "/" + formater.format(aujourdhui) + "-tlm-Hexa.txt")); + pw.write("Start file"); + pw.write(LINE_SEPARATOR); + } else { + pw = new PrintWriter(RepositoryPath + "/" + formater.format(aujourdhui) + "-tlm-Hexa.txt"); + } + pw.append(stringData); + pw.append(LINE_SEPARATOR); + + pw.flush(); + pw.close(); + } catch (IOException e) { + e.printStackTrace(); + } + } + + /** + * Save telemetry data received in text file. The file is stored in data folder. + * + * @param receivedFrame + */ + public void saveDataFile(ModelReceivedData receivedFrame) { + SimpleDateFormat formater = new SimpleDateFormat("yyyy-MM-dd-HHmmss"); + Date aujourdhui = new Date(); + + // + + PrintWriter pw = null; + + long NbFrame = receivedFrame.getNumberFrame(); + + try { + pw = + new PrintWriter( + new FileWriter(RepositoryPath + "/" + formater.format(aujourdhui) + "-tlm-Hexa.txt")); + for (int i = 0; i < NbFrame; i++) { + pw.write(receivedFrame.getRawFrame(i)); + pw.write(LINE_SEPARATOR); + } + + pw.flush(); + pw.close(); + } catch (IOException e) { + e.printStackTrace(); + } + } + + public void saveDataHex(String stringData) { + + SimpleDateFormat formater = new SimpleDateFormat("yyyy-MM-dd-HH"); + Date aujourdhui = new Date(); + String creationdate = formater.format(aujourdhui); + + filepath = Paths.get(this.RepositoryPath + "\\" + creationdate + "-Data-hex.txt"); + + try { + if (!Files.exists(filepath)) { + Files.createFile(filepath); + } + Files.writeString(filepath, stringData + "\r\n", StandardOpenOption.APPEND); + + } catch (IOException e) { + appLogger.severe(e.toString()); + } + } + + public int saveTlmData(TlmData tlmData) { + + int erreur = 0; + SimpleDateFormat formater = new SimpleDateFormat("yyyy-MM-dd-HH-mm-ss.SSS"); + Date aujourdhui = new Date(); + JSONObject jasonObject = new JSONObject(tlmData); + String creationdate = formater.format(aujourdhui); + + filepath = Paths.get(this.RepositoryPath + "\\" + creationdate + "-Data.json"); + + try { + // if (!Files.exists(filepath)) + // { + Files.createFile(filepath); + // Files.writeString(filepath, "Test" + "\r\n",StandardOpenOption.CREATE); + // } + + Files.writeString(filepath, jasonObject.toString() + "\r\n", StandardOpenOption.CREATE); + if (Files.size(filepath) < 10) { + appLogger.severe("file not created "); + erreur = -1; + } + + } catch (IOException e) { + appLogger.severe(e.toString()); + erreur = -1; + } + + return erreur; + } + + /** Create all directory needed for saving data in different format */ + public void initDirectory() { + + if (RepositoryPath == null) { + RepositoryPath = System.getProperty("user.dir") + "\\data"; + } else if (RepositoryPath.length() == 0) { + RepositoryPath = System.getProperty("user.dir") + "\\data"; + } + + Path path = Paths.get(RepositoryPath); + // if directory exists? + if (!Files.exists(path)) { + try { + Files.createDirectories(path); + appLogger.info("directory created : " + RepositoryPath); + } catch (IOException e) { + appLogger.log(Level.SEVERE, "cannot create outpout directorie " + e.toString()); + } + } + } + + public String getRepositoryPath() { + return RepositoryPath; + } + + public void setRepositoryPath(String repositoryPath) { + RepositoryPath = repositoryPath; + // setup directory + initDirectory(); + } } - diff --git a/ApplicationKissTool/src/main/java/org/josast/ApplicationKissTool/ModelReceivedData.java b/ApplicationKissTool/src/main/java/org/josast/ApplicationKissTool/ModelReceivedData.java index a2c89014398dc88f78296c721935486d510ae308..db36aba6104cfc368d2a33ed23b5bcb6ba9fae5f 100644 --- a/ApplicationKissTool/src/main/java/org/josast/ApplicationKissTool/ModelReceivedData.java +++ b/ApplicationKissTool/src/main/java/org/josast/ApplicationKissTool/ModelReceivedData.java @@ -5,61 +5,46 @@ import java.beans.PropertyChangeSupport; import java.util.Date; import java.util.Vector; - - - - - public class ModelReceivedData { - - long numberFrame = 0; - Vector vecRawData = new Vector(); - - - private PropertyChangeSupport listenerList = new PropertyChangeSupport(this); - - public void addPropertyChangeListener(PropertyChangeListener listener) { - listenerList.addPropertyChangeListener(listener); - } - - public void removePropertyChangeListener(PropertyChangeListener listener) { - listenerList.removePropertyChangeListener(listener); - } - - public void addPropertyChangeListener(String propertyName, PropertyChangeListener listener) { - listenerList.addPropertyChangeListener(propertyName, listener); - } - - public void removePropertyChangeListener(String propertyName, PropertyChangeListener listener) { - listenerList.removePropertyChangeListener(propertyName, listener); - } + long numberFrame = 0; + Vector vecRawData = new Vector(); - public long getNumberFrame() { - return numberFrame; - } + private PropertyChangeSupport listenerList = new PropertyChangeSupport(this); - public ReceivedData getLastReceivedData() { - return vecRawData.lastElement(); - } - + public void addPropertyChangeListener(PropertyChangeListener listener) { + listenerList.addPropertyChangeListener(listener); + } + public void removePropertyChangeListener(PropertyChangeListener listener) { + listenerList.removePropertyChangeListener(listener); + } + public void addPropertyChangeListener(String propertyName, PropertyChangeListener listener) { + listenerList.addPropertyChangeListener(propertyName, listener); + } + public void removePropertyChangeListener(String propertyName, PropertyChangeListener listener) { + listenerList.removePropertyChangeListener(propertyName, listener); + } - public void addFrame(byte[] received) { - long oldNumberFrame = numberFrame; - numberFrame++; - vecRawData.add(new ReceivedData(new Date(),received)); - listenerList.firePropertyChange("numberFrame", oldNumberFrame, numberFrame); - - } + public long getNumberFrame() { + return numberFrame; + } - public String getRawFrame(int i) { - - return vecRawData.get(i).toString(); - } + public ReceivedData getLastReceivedData() { + return vecRawData.lastElement(); + } + public void addFrame(byte[] received) { + long oldNumberFrame = numberFrame; + numberFrame++; + vecRawData.add(new ReceivedData(new Date(), received)); + listenerList.firePropertyChange("numberFrame", oldNumberFrame, numberFrame); + } + public String getRawFrame(int i) { + return vecRawData.get(i).toString(); + } } diff --git a/ApplicationKissTool/src/main/java/org/josast/ApplicationKissTool/PrimaryController.java b/ApplicationKissTool/src/main/java/org/josast/ApplicationKissTool/PrimaryController.java index bd1ddfe09d8b458b0d669f92d34a29c7340bfb41..86a5296c7f4f6e28ab52b8afcfa696233aa4106a 100644 --- a/ApplicationKissTool/src/main/java/org/josast/ApplicationKissTool/PrimaryController.java +++ b/ApplicationKissTool/src/main/java/org/josast/ApplicationKissTool/PrimaryController.java @@ -5,8 +5,8 @@ import javafx.fxml.FXML; public class PrimaryController { - @FXML - private void switchToSecondary() throws IOException { - App.setRoot("secondary"); - } + @FXML + private void switchToSecondary() throws IOException { + App.setRoot("secondary"); + } } diff --git a/ApplicationKissTool/src/main/java/org/josast/ApplicationKissTool/ReceivedData.java b/ApplicationKissTool/src/main/java/org/josast/ApplicationKissTool/ReceivedData.java index 27a6173fb229d5f294645ad9c4b1dc35d2236fbb..258679d496ad28c935fc77b561359dff837b390a 100644 --- a/ApplicationKissTool/src/main/java/org/josast/ApplicationKissTool/ReceivedData.java +++ b/ApplicationKissTool/src/main/java/org/josast/ApplicationKissTool/ReceivedData.java @@ -2,39 +2,35 @@ package org.josast.ApplicationKissTool; import java.util.Date; - public class ReceivedData { - - private Date time; - private byte [] data; - - public ReceivedData(Date receivedTime, byte [] receivedData) { - super(); - time = receivedTime; - data = receivedData ; - } - - public Date getTime() { - return time; - } - - public void setTime(Date time) { - this.time = time; - } - - - public byte[] getData() { - return data; - } - - public void setData(byte[] data) { - this.data = data; - } - - @Override - public String toString() { - return "Frame [time=" + time + "][ Frame=" + new String(data) + "]"; - } + private Date time; + private byte[] data; + + public ReceivedData(Date receivedTime, byte[] receivedData) { + super(); + time = receivedTime; + data = receivedData; + } + + public Date getTime() { + return time; + } + + public void setTime(Date time) { + this.time = time; + } + + public byte[] getData() { + return data; + } + + public void setData(byte[] data) { + this.data = data; + } + @Override + public String toString() { + return "Frame [time=" + time + "][ Frame=" + new String(data) + "]"; + } } diff --git a/ApplicationKissTool/src/main/java/org/josast/ApplicationKissTool/SecondaryController.java b/ApplicationKissTool/src/main/java/org/josast/ApplicationKissTool/SecondaryController.java index 9c5ae0069f7024fedc3f6c60d7bd3328b3b42e98..636860a88de8aedd7550457881ec57f4e54e8402 100644 --- a/ApplicationKissTool/src/main/java/org/josast/ApplicationKissTool/SecondaryController.java +++ b/ApplicationKissTool/src/main/java/org/josast/ApplicationKissTool/SecondaryController.java @@ -5,8 +5,8 @@ import javafx.fxml.FXML; public class SecondaryController { - @FXML - private void switchToPrimary() throws IOException { - App.setRoot("primary"); - } -} \ No newline at end of file + @FXML + private void switchToPrimary() throws IOException { + App.setRoot("primary"); + } +} diff --git a/ApplicationKissTool/src/main/java/org/josast/ApplicationKissTool/SendSIDS.java b/ApplicationKissTool/src/main/java/org/josast/ApplicationKissTool/SendSIDS.java index daf0406e007c753ed4374e88f15e0e70c1ae10f6..420bf9c463d75735b35b223b2d2833ad16dfe46a 100644 --- a/ApplicationKissTool/src/main/java/org/josast/ApplicationKissTool/SendSIDS.java +++ b/ApplicationKissTool/src/main/java/org/josast/ApplicationKissTool/SendSIDS.java @@ -2,44 +2,32 @@ package org.josast.ApplicationKissTool; import java.math.BigInteger; import java.util.logging.Logger; - import org.josast.SIDS.HttpPostSIDS; import org.josast.SIDS.SIDSData; import org.josast.SIDS.Station; -/** - * - * @author christophe - * - */ +/** @author christophe */ public class SendSIDS { - private static Logger appLogger = Logger.getLogger("AmsatLogger"); - SIDSData sids = new SIDSData(); - HttpPostSIDS client; + private static Logger appLogger = Logger.getLogger("AmsatLogger"); + SIDSData sids = new SIDSData(); + HttpPostSIDS client; - - public SendSIDS ( Station station, int norad, String url) - { - - sids.setStation(station); - sids.setNoradID(norad); - client = new HttpPostSIDS(url); - - - } - - public int Send(ReceivedData data) - { - //BasicConfigurator.configure(); + public SendSIDS(Station station, int norad, String url) { - // transforme en hexa String - String hexaString = new BigInteger(1, data.getData()).toString(16); - sids.setTelemetryData(data.getTime(),hexaString); - appLogger.info(sids.toStringBasic()); - int result = client.SendSIDSBasic(sids); - return result; + sids.setStation(station); + sids.setNoradID(norad); + client = new HttpPostSIDS(url); + } - } + public int Send(ReceivedData data) { + // BasicConfigurator.configure(); + // transforme en hexa String + String hexaString = new BigInteger(1, data.getData()).toString(16); + sids.setTelemetryData(data.getTime(), hexaString); + appLogger.info(sids.toStringBasic()); + int result = client.SendSIDSBasic(sids); + return result; + } } diff --git a/ApplicationKissTool/src/main/java/org/josast/ApplicationKissTool/TaskSoundmodemTCP.java b/ApplicationKissTool/src/main/java/org/josast/ApplicationKissTool/TaskSoundmodemTCP.java index 672bfe3337851a8d02787a52a0e48a93cbd7066e..21f9b0f22bec629c1f57d7d8d2c058ecb8c9a88c 100644 --- a/ApplicationKissTool/src/main/java/org/josast/ApplicationKissTool/TaskSoundmodemTCP.java +++ b/ApplicationKissTool/src/main/java/org/josast/ApplicationKissTool/TaskSoundmodemTCP.java @@ -1,89 +1,77 @@ package org.josast.ApplicationKissTool; import java.util.logging.Logger; - - +import javafx.concurrent.Task; import org.josast.ModuleSoundModem.SoundModemClient; import org.josast.ModuleSoundModem.SoundModemConfiguration; -import javafx.concurrent.Task; - public class TaskSoundmodemTCP extends Task { - - private Logger log = Logger.getLogger("AmsatLogger"); - private volatile boolean running = true; - - SoundModemConfiguration smConfiguration = null; - SoundModemClient smc = null; - ModelReceivedData receivedFrame = null; + private Logger log = Logger.getLogger("AmsatLogger"); + + private volatile boolean running = true; + + SoundModemConfiguration smConfiguration = null; + SoundModemClient smc = null; + ModelReceivedData receivedFrame = null; + + /** + * @param smConfiguration fichier de configuration + * @param receivedFrame Frame Data model + */ + public TaskSoundmodemTCP( + SoundModemConfiguration smConfiguration, ModelReceivedData receivedFrame) { + this.smConfiguration = smConfiguration; + smc = new SoundModemClient(smConfiguration); + if (smc.isOpen() == false) { + this.failed(); + } + this.receivedFrame = receivedFrame; + } + + public TaskSoundmodemTCP(ModelReceivedData receivedFrame) { - /** - * @param smConfiguration fichier de configuration - * @param receivedFrame Frame Data model - */ - public TaskSoundmodemTCP(SoundModemConfiguration smConfiguration, ModelReceivedData receivedFrame) { - this.smConfiguration = smConfiguration; - smc = new SoundModemClient(smConfiguration); - if (smc.isOpen() == false) { - this.failed(); - } - this.receivedFrame = receivedFrame; + smConfiguration = new SoundModemConfiguration("default"); + smc = new SoundModemClient(smConfiguration); + if (smc.isOpen() == false) { + this.failed(); + } + this.receivedFrame = receivedFrame; + } - } + /** + * while the connection is open, the modem is listening. When a frame is received, this frame is + * added to the model + */ + @Override + protected String call() { + try { - public TaskSoundmodemTCP(ModelReceivedData receivedFrame) { - - smConfiguration = new SoundModemConfiguration("default"); - smc = new SoundModemClient(smConfiguration); - if (smc.isOpen() == false) { - this.failed(); - } - this.receivedFrame = receivedFrame; - } + while (running == true) { + if (smc.isOpen()) { + byte[] temp = smc.receivedRawData(); + receivedFrame.addFrame(temp); + this.updateValue(receivedFrame.toString()); + } else { + this.running = false; + log.severe("Erreur SoundModem closed"); + } + } + } catch (Exception e) { + log.severe("Erreur SoundModem not available"); + log.severe(e.toString()); + this.failed(); + } + return receivedFrame.toString(); + } - /** - * while the connection is open, the modem is listening. When a frame is received, - * this frame is added to the model - */ - @Override - protected String call() { - try { + public void arreter() { - while (running == true) { - if(smc.isOpen()) - { - byte[] temp = smc.receivedRawData(); - receivedFrame.addFrame(temp); - this.updateValue(receivedFrame.toString()); - } else - { - this.running=false; - log.severe("Erreur SoundModem closed"); - } - } - } catch (Exception e) { - log.severe("Erreur SoundModem not available"); - log.severe(e.toString()); - this.failed(); + this.running = false; + } - } - return receivedFrame.toString(); - } + public void redemarrer() { - - - public void arreter() { - - this.running = false; - - } - - public void redemarrer() - { - - this.running = true; - - } - + this.running = true; + } } diff --git a/ApplicationKissTool/src/main/java/org/josast/ApplicationKissTool/TlmData.java b/ApplicationKissTool/src/main/java/org/josast/ApplicationKissTool/TlmData.java index 9f59622e42decbd97c4cb496f55aa0b7c6a786b8..4c9b5987120f1696ed5a99cda55c14e848f2ae7f 100644 --- a/ApplicationKissTool/src/main/java/org/josast/ApplicationKissTool/TlmData.java +++ b/ApplicationKissTool/src/main/java/org/josast/ApplicationKissTool/TlmData.java @@ -1,94 +1,67 @@ package org.josast.ApplicationKissTool; public class TlmData { - - private String data; - private String source=""; // Callsign or user name of the receiver - private String longitude=null; // Longitude of the receiver (WGS84) 8.95564E - private String latitude=null; //Latitude of the receiver (WGS84) - private String timestamp; // UTC timestamp (see ISO 8601) 2018-01-24T23:42:46Z - - - public TlmData(String data, String source, String longitude, String latitude, String timestamp) { - super(); - this.data = data; - this.source = source; - this.longitude = longitude; - this.latitude = latitude; - this.timestamp = timestamp; - } - - - public TlmData(String source, String longitude, String latitude) { - super(); - this.source = source; - this.longitude = longitude; - this.latitude = latitude; - } + private String data; + private String source = ""; // Callsign or user name of the receiver + private String longitude = null; // Longitude of the receiver (WGS84) 8.95564E + private String latitude = null; // Latitude of the receiver (WGS84) + private String timestamp; // UTC timestamp (see ISO 8601) 2018-01-24T23:42:46Z + public TlmData(String data, String source, String longitude, String latitude, String timestamp) { + super(); + this.data = data; + this.source = source; + this.longitude = longitude; + this.latitude = latitude; + this.timestamp = timestamp; + } - /** - * @return the data - */ - public String getData() { - return data; - } - /** - * @param data the data to set - */ - public void setData(String data) { - this.data = data; - } - /** - * @return the source - */ - public String getSource() { - return source; - } - /** - * @param source the source to set - */ - public void setSource(String source) { - this.source = source; - } - /** - * @return the longitude - */ - public String getLongitude() { - return longitude; - } - /** - * @param longitude the longitude to set - */ - public void setLongitude(String longitude) { - this.longitude = longitude; - } - /** - * @return the latitude - */ - public String getLatitude() { - return latitude; - } - /** - * @param latitude the latitude to set - */ - public void setLatitude(String latitude) { - this.latitude = latitude; - } - /** - * @return the timestamp - */ - public String getTimestamp() { - return timestamp; - } - /** - * @param timestamp the timestamp to set - */ - public void setTimestamp(String timestamp) { - this.timestamp = timestamp; - } + public TlmData(String source, String longitude, String latitude) { + super(); + this.source = source; + this.longitude = longitude; + this.latitude = latitude; + } - - + /** @return the data */ + public String getData() { + return data; + } + /** @param data the data to set */ + public void setData(String data) { + this.data = data; + } + /** @return the source */ + public String getSource() { + return source; + } + /** @param source the source to set */ + public void setSource(String source) { + this.source = source; + } + /** @return the longitude */ + public String getLongitude() { + return longitude; + } + /** @param longitude the longitude to set */ + public void setLongitude(String longitude) { + this.longitude = longitude; + } + /** @return the latitude */ + public String getLatitude() { + return latitude; + } + /** @param latitude the latitude to set */ + public void setLatitude(String latitude) { + this.latitude = latitude; + } + /** @return the timestamp */ + public String getTimestamp() { + return timestamp; + } + /** @param timestamp the timestamp to set */ + public void setTimestamp(String timestamp) { + this.timestamp = timestamp; + } } diff --git a/ApplicationSatelliteDatabaseCli/pom.xml b/ApplicationSatelliteDatabaseCli/pom.xml index f6c1770be5fe2b3a6205cabcd987357395d7424c..4affc4ababf843830ae6143e4c2a551b5eda9e74 100644 --- a/ApplicationSatelliteDatabaseCli/pom.xml +++ b/ApplicationSatelliteDatabaseCli/pom.xml @@ -37,8 +37,8 @@ 3.0.0-M2 - 2.17.0 - 20210307 + 2.17.1 + 20211205 1.5.0 diff --git a/ApplicationSatelliteDatabaseCli/src/main/java/org/josast/ApplicationSatelliteDatabaseCli/AppCli.java b/ApplicationSatelliteDatabaseCli/src/main/java/org/josast/ApplicationSatelliteDatabaseCli/AppCli.java index 22ae7fe98f1a9b322d4fc7169c913ecfec3540eb..3899d3240ff0445018b9d2f7029ae65b84cecf4c 100644 --- a/ApplicationSatelliteDatabaseCli/src/main/java/org/josast/ApplicationSatelliteDatabaseCli/AppCli.java +++ b/ApplicationSatelliteDatabaseCli/src/main/java/org/josast/ApplicationSatelliteDatabaseCli/AppCli.java @@ -1,57 +1,45 @@ package org.josast.ApplicationSatelliteDatabaseCli; import java.util.Vector; - import org.apache.commons.cli.ParseException; import org.josast.ApplicationSatelliteDatabaseCli.cmd.Cmd; import org.josast.ApplicationSatelliteDatabaseCli.cmd.OptionsAnalysis; /** - * Classe Java for mergin AMSAT-LIST Xml file. - * Concept : read all files from a directory add this file data in memory - * save all data in one file. - * @author Christophe + * Classe Java for mergin AMSAT-LIST Xml file. Concept : read all files from a directory add this + * file data in memory save all data in one file. * + * @author Christophe */ - - public class AppCli { - /** - * vec list of command. - */ - private Vector vec = null; - - /** - * Initialise analysis of option. - * - * @param args - */ - public AppCli(final String[] args) { - OptionsAnalysis opt = new OptionsAnalysis(args); - vec = opt.getCommandes(); - + /** vec list of command. */ + private Vector vec = null; + + /** + * Initialise analysis of option. + * + * @param args + */ + public AppCli(final String[] args) { + OptionsAnalysis opt = new OptionsAnalysis(args); + vec = opt.getCommandes(); + } + + /** launch all commande store in vec. */ + private void execute() { + for (Cmd cmd : vec) { + cmd.excute(); } + } - /** - * launch all commande store in vec. - */ - private void execute() { - for (Cmd cmd : vec) { - cmd.excute(); - } - - } - - /** - * @param args - * @throws ParseException - */ - public static void main(String[] args) throws ParseException { - - AppCli app = new AppCli(args); - app.execute(); - - } + /** + * @param args + * @throws ParseException + */ + public static void main(String[] args) throws ParseException { + AppCli app = new AppCli(args); + app.execute(); + } } diff --git a/ApplicationSatelliteDatabaseCli/src/main/java/org/josast/ApplicationSatelliteDatabaseCli/cmd/CheckCmd.java b/ApplicationSatelliteDatabaseCli/src/main/java/org/josast/ApplicationSatelliteDatabaseCli/cmd/CheckCmd.java index c30577d547a6efa591451269e9b7e2e6803f4cf0..9a19f34d86733149624a2db78c0ad548000cb791 100644 --- a/ApplicationSatelliteDatabaseCli/src/main/java/org/josast/ApplicationSatelliteDatabaseCli/cmd/CheckCmd.java +++ b/ApplicationSatelliteDatabaseCli/src/main/java/org/josast/ApplicationSatelliteDatabaseCli/cmd/CheckCmd.java @@ -2,49 +2,39 @@ package org.josast.ApplicationSatelliteDatabaseCli.cmd; import java.util.Vector; import java.util.logging.Logger; - import org.josast.AmsatList.Commande.Commande; import org.josast.AmsatList.Commande.CommandeList; import org.josast.ModuleSatelliteDatabase.CheckAmsatListFile; public class CheckCmd implements Cmd { - /** - * logger. - */ - private Logger log = Logger.getLogger(getClass().getName()); + /** logger. */ + private Logger log = Logger.getLogger(getClass().getName()); - /** - * - */ - @Override - public void excute() { - log.info(CheckCmd.class.getName()); - ParameterSingleton parameter = ParameterSingleton.getInstance(); - // check if file exist - if (parameter.getInputFile() != null) { - log.info("filename" + parameter.getInputFile() + " " - + parameter.getInputDirectory()); - CheckAmsatListFile check = new CheckAmsatListFile( - parameter.getInputFile()); - System.out.println("Multiple Name"); - System.out.println(check.checkUniqueSatelliteName()); - System.out.println("Multiple Nasa ID"); - System.out.println(check.checkUniqueSatelliteNasaID()); - System.out.println("Identify satellite Status"); - System.out.println(check.getListSatelliteStatus()); - System.out.println("Satellite Status"); - Vector cmd = check.checkSatelliteStatus(); - System.out.println(cmd); - CommandeList cmdl = new CommandeList(cmd); - cmdl.save("cmdUpdateStatus.csv"); - - - } else { - System.out.println("Input filename not set"); - log.info("Input filename not set"); - } + /** */ + @Override + public void excute() { + log.info(CheckCmd.class.getName()); + ParameterSingleton parameter = ParameterSingleton.getInstance(); + // check if file exist + if (parameter.getInputFile() != null) { + log.info("filename" + parameter.getInputFile() + " " + parameter.getInputDirectory()); + CheckAmsatListFile check = new CheckAmsatListFile(parameter.getInputFile()); + System.out.println("Multiple Name"); + System.out.println(check.checkUniqueSatelliteName()); + System.out.println("Multiple Nasa ID"); + System.out.println(check.checkUniqueSatelliteNasaID()); + System.out.println("Identify satellite Status"); + System.out.println(check.getListSatelliteStatus()); + System.out.println("Satellite Status"); + Vector cmd = check.checkSatelliteStatus(); + System.out.println(cmd); + CommandeList cmdl = new CommandeList(cmd); + cmdl.save("cmdUpdateStatus.csv"); + } else { + System.out.println("Input filename not set"); + log.info("Input filename not set"); } - + } } diff --git a/ApplicationSatelliteDatabaseCli/src/main/java/org/josast/ApplicationSatelliteDatabaseCli/cmd/Cmd.java b/ApplicationSatelliteDatabaseCli/src/main/java/org/josast/ApplicationSatelliteDatabaseCli/cmd/Cmd.java index 3a8e9989b9f31ec06771f66825a5c8c8320e1c7a..68dd38adfbdf33afd253dc1cc05e23b678d9b7ce 100644 --- a/ApplicationSatelliteDatabaseCli/src/main/java/org/josast/ApplicationSatelliteDatabaseCli/cmd/Cmd.java +++ b/ApplicationSatelliteDatabaseCli/src/main/java/org/josast/ApplicationSatelliteDatabaseCli/cmd/Cmd.java @@ -2,14 +2,11 @@ package org.josast.ApplicationSatelliteDatabaseCli.cmd; /** * Command pattern interface. - * @author chris * + * @author chris */ public interface Cmd { - /** - * Excecute command. - */ - void excute(); - + /** Excecute command. */ + void excute(); } diff --git a/ApplicationSatelliteDatabaseCli/src/main/java/org/josast/ApplicationSatelliteDatabaseCli/cmd/ExecuteCommandeFile.java b/ApplicationSatelliteDatabaseCli/src/main/java/org/josast/ApplicationSatelliteDatabaseCli/cmd/ExecuteCommandeFile.java index f024908773473f3335527a055cb51f999daafa89..3163540f57517a05e746b72745e087d59a7ddeae 100644 --- a/ApplicationSatelliteDatabaseCli/src/main/java/org/josast/ApplicationSatelliteDatabaseCli/cmd/ExecuteCommandeFile.java +++ b/ApplicationSatelliteDatabaseCli/src/main/java/org/josast/ApplicationSatelliteDatabaseCli/cmd/ExecuteCommandeFile.java @@ -1,34 +1,30 @@ package org.josast.ApplicationSatelliteDatabaseCli.cmd; import java.util.logging.Logger; - import org.josast.AmsatList.Commande.CommandeList; import org.josast.AmsatList.Commande.ExecuteCommand; public class ExecuteCommandeFile implements Cmd { - - private Logger log = Logger.getLogger(getClass().getName()); - public ExecuteCommandeFile() { - // TODO Auto-generated constructor stub - } + private Logger log = Logger.getLogger(getClass().getName()); + + public ExecuteCommandeFile() { + // TODO Auto-generated constructor stub + } - @Override - public void excute() { - - ParameterSingleton parameter = ParameterSingleton.getInstance(); - //"src\\test\\data\\FileIn\\StatusSatelliteCmdcommandeSave.csv"; - String filecmd2 = parameter.getInputFile(); - String inputDirectory = parameter.getInputDirectory(); - String outputDirectory = parameter.getOutputDirectory(); -// - CommandeList cl = new CommandeList(filecmd2); - log.info("list size "+cl.getListeCommande().size()); - - ExecuteCommand ex = new ExecuteCommand(); - ex.execute(inputDirectory, outputDirectory, cl); + @Override + public void excute() { - - } + ParameterSingleton parameter = ParameterSingleton.getInstance(); + // "src\\test\\data\\FileIn\\StatusSatelliteCmdcommandeSave.csv"; + String filecmd2 = parameter.getInputFile(); + String inputDirectory = parameter.getInputDirectory(); + String outputDirectory = parameter.getOutputDirectory(); + // + CommandeList cl = new CommandeList(filecmd2); + log.info("list size " + cl.getListeCommande().size()); + ExecuteCommand ex = new ExecuteCommand(); + ex.execute(inputDirectory, outputDirectory, cl); + } } diff --git a/ApplicationSatelliteDatabaseCli/src/main/java/org/josast/ApplicationSatelliteDatabaseCli/cmd/HelpCmd.java b/ApplicationSatelliteDatabaseCli/src/main/java/org/josast/ApplicationSatelliteDatabaseCli/cmd/HelpCmd.java index f26ce67b954306857e4482c4f569dbcb2878f567..c6d81c3ffc805ff417e90eaf6c1fac444c6d79a6 100644 --- a/ApplicationSatelliteDatabaseCli/src/main/java/org/josast/ApplicationSatelliteDatabaseCli/cmd/HelpCmd.java +++ b/ApplicationSatelliteDatabaseCli/src/main/java/org/josast/ApplicationSatelliteDatabaseCli/cmd/HelpCmd.java @@ -4,15 +4,11 @@ import org.apache.commons.cli.HelpFormatter; public class HelpCmd implements Cmd { - /** - * - */ - @Override - public void excute() { - final HelpFormatter formatter = new HelpFormatter(); - ParameterSingleton parameter = ParameterSingleton.getInstance(); - formatter.printHelp(parameter.getArg0(), parameter.getOption(), true); - - } - + /** */ + @Override + public void excute() { + final HelpFormatter formatter = new HelpFormatter(); + ParameterSingleton parameter = ParameterSingleton.getInstance(); + formatter.printHelp(parameter.getArg0(), parameter.getOption(), true); + } } diff --git a/ApplicationSatelliteDatabaseCli/src/main/java/org/josast/ApplicationSatelliteDatabaseCli/cmd/MergeCmd.java b/ApplicationSatelliteDatabaseCli/src/main/java/org/josast/ApplicationSatelliteDatabaseCli/cmd/MergeCmd.java index 5725eb22b848588d50f77e8f88ee73d0e0bb7f9c..e4fcc155871eb70451b18507be80d5a863ba5dad 100644 --- a/ApplicationSatelliteDatabaseCli/src/main/java/org/josast/ApplicationSatelliteDatabaseCli/cmd/MergeCmd.java +++ b/ApplicationSatelliteDatabaseCli/src/main/java/org/josast/ApplicationSatelliteDatabaseCli/cmd/MergeCmd.java @@ -1,27 +1,19 @@ package org.josast.ApplicationSatelliteDatabaseCli.cmd; import java.util.logging.Logger; - import org.josast.ModuleSatelliteDatabase.MergeAmsatListFile; public class MergeCmd implements Cmd { - /** - * logger. - */ - private Logger log = Logger.getLogger(getClass().getName()); - - /** - * - */ - @Override - public void excute() { - log.info(MergeCmd.class.getName()); - ParameterSingleton parameter = ParameterSingleton.getInstance(); - MergeAmsatListFile merge = new MergeAmsatListFile(); - merge.merge(parameter.getInputDirectory() - ); - merge.save(parameter.getOutputFile()); - - } + /** logger. */ + private Logger log = Logger.getLogger(getClass().getName()); + /** */ + @Override + public void excute() { + log.info(MergeCmd.class.getName()); + ParameterSingleton parameter = ParameterSingleton.getInstance(); + MergeAmsatListFile merge = new MergeAmsatListFile(); + merge.merge(parameter.getInputDirectory()); + merge.save(parameter.getOutputFile()); + } } diff --git a/ApplicationSatelliteDatabaseCli/src/main/java/org/josast/ApplicationSatelliteDatabaseCli/cmd/OptionsAnalysis.java b/ApplicationSatelliteDatabaseCli/src/main/java/org/josast/ApplicationSatelliteDatabaseCli/cmd/OptionsAnalysis.java index 24fcf22b1ad2eac5cfa901eaf136a533ef2aa03e..8b5447627ce4800b7a9d4fd81b2afced84d73278 100644 --- a/ApplicationSatelliteDatabaseCli/src/main/java/org/josast/ApplicationSatelliteDatabaseCli/cmd/OptionsAnalysis.java +++ b/ApplicationSatelliteDatabaseCli/src/main/java/org/josast/ApplicationSatelliteDatabaseCli/cmd/OptionsAnalysis.java @@ -2,7 +2,6 @@ package org.josast.ApplicationSatelliteDatabaseCli.cmd; import java.util.Vector; import java.util.logging.Logger; - import org.apache.commons.cli.CommandLine; import org.apache.commons.cli.CommandLineParser; import org.apache.commons.cli.DefaultParser; @@ -11,275 +10,205 @@ import org.apache.commons.cli.Options; import org.apache.commons.cli.ParseException; public class OptionsAnalysis { - /** - * logger. - */ - private Logger log = Logger.getLogger(getClass().getName()); - /** - * List of command to execute. - */ - private Vector listeCmd = new Vector<>(); - /** - * Option. - */ - private Options options = null; - /** - * line. - */ - private CommandLine line = null; - - /** - * @param args - */ - public OptionsAnalysis(final String[] args) { - options = configParameters(); - CommandLineParser parser = new DefaultParser(); - - try { - line = parser.parse(options, args); - listeCmd = interprete(line, args); - } catch (ParseException e) { - log.severe(" Unrecognise option " + e.toString()); - - } + /** logger. */ + private Logger log = Logger.getLogger(getClass().getName()); + /** List of command to execute. */ + private Vector listeCmd = new Vector<>(); + /** Option. */ + private Options options = null; + /** line. */ + private CommandLine line = null; + + /** @param args */ + public OptionsAnalysis(final String[] args) { + options = configParameters(); + CommandLineParser parser = new DefaultParser(); + + try { + line = parser.parse(options, args); + listeCmd = interprete(line, args); + } catch (ParseException e) { + log.severe(" Unrecognise option " + e.toString()); } - - /** - * @return list of command. - */ - public Vector getCommandes() { - return listeCmd; + } + + /** @return list of command. */ + public Vector getCommandes() { + return listeCmd; + } + + /** @param listeCmds */ + public void setListeCmd(final Vector listeCmds) { + this.listeCmd = listeCmds; + } + + private static Options configParameters() { + + final Option versionOption = + Option.builder("V") + .longOpt("Version") // + .desc("Return application version") + .hasArg(false) + .required(false) + .build(); + + final Option mergeOption = + Option.builder("M") + .longOpt("Merge") // + .desc("Merge all input folder to new Directoy to ouput xml " + "file ") + .hasArg(false) + .required(false) + .build(); + + final Option checkOption = + Option.builder("C") + .longOpt("Check") // + .desc("verify AmsatList File data") + .hasArg(false) + .required(false) + .build(); + + final Option updateOption = + Option.builder("U") + .longOpt("Update") // + .desc("update AmsatList File data") + .hasArg(false) + .required(false) + .build(); + + // ExecuteCommandeFile + + final Option executeCmdOption = + Option.builder("E") + .longOpt("ExecuteCommandeFile") // + .desc("Execute command file to modify input AmsatList File data") + .hasArg(false) + .required(false) + .build(); + + final Option inputDirectoryOption = + Option.builder("I") + .longOpt("Input Directory") // + .desc("Input directory with all input xml files (*.xml) ") + .hasArg(true) + .argName("InputRepository") + .required(false) + .build(); + + final Option outputDirectoryOption = + Option.builder("O") + .longOpt("Output Directory") // + .desc("Output directory with all input xml files (*.xml) ") + .hasArg(true) + .argName("OutputDirectory") + .required(false) + .build(); + + final Option outputFileOption = + Option.builder("o") + .longOpt("OutputFile") // + .desc("output file") + .hasArg(true) + .argName("OutputFile") + .required(false) + .build(); + + final Option inputFileOption = + Option.builder("i") + .longOpt("InputFile") // + .desc("Input file (depending of usage XMl file or CSV file") + .hasArg(true) + .argName("InputFile") + .required(false) + .build(); + + final Option helpFileOption = + Option.builder("h").longOpt("help").desc("display help message").build(); + + final Options options = new Options(); + + options.addOption(updateOption); + options.addOption(inputFileOption); + options.addOption(checkOption); + options.addOption(versionOption); + options.addOption(mergeOption); + options.addOption(executeCmdOption); + options.addOption(inputDirectoryOption); + options.addOption(outputDirectoryOption); + options.addOption(outputFileOption); + options.addOption(helpFileOption); + + return options; + } + + private Vector interprete(final CommandLine cmdLine, final String[] args) { + + Vector cmdList = new Vector<>(); + ParameterSingleton parameter = ParameterSingleton.getInstance(); + + parameter.setOutputFile(cmdLine.getOptionValue("o")); + log.info("Output file dir" + cmdLine.getOptionValue("o")); + parameter.setInputDirectory(cmdLine.getOptionValue("I")); + log.info("Input dir" + cmdLine.getOptionValue("I")); + parameter.setOutputDirectory(cmdLine.getOptionValue("O")); + log.info("OUtput dir" + cmdLine.getOptionValue("O")); + parameter.setInputFile(cmdLine.getOptionValue("InputFile", "")); + cmdList.add(new VersionCmd()); + + if (cmdLine.hasOption("help")) { + parameter.setArg0(args[0]); + parameter.setOption(options); + cmdList.add(new HelpCmd()); } - /** - * @param listeCmds - */ - public void setListeCmd(final Vector listeCmds) { - this.listeCmd = listeCmds; + if (cmdLine.hasOption("Version")) { + return cmdList; } - private static Options configParameters() { - - final Option versionOption = Option.builder("V") - - .longOpt("Version") // - - .desc("Return application version") - - .hasArg(false) - - .required(false) - - .build(); - - final Option mergeOption = Option.builder("M") - - .longOpt("Merge") // - - .desc("Merge all input folder to new Directoy to ouput xml " - + "file ") - - .hasArg(false) - - .required(false) - - .build(); - - final Option checkOption = Option.builder("C") - - .longOpt("Check") // - - .desc("verify AmsatList File data") - - .hasArg(false) - - .required(false) - - .build(); - - final Option updateOption = Option.builder("U") - - .longOpt("Update") // - - .desc("update AmsatList File data") - - .hasArg(false) - - .required(false) - - .build(); - - // ExecuteCommandeFile - - - final Option executeCmdOption = Option.builder("E") - - .longOpt("ExecuteCommandeFile") // - - .desc("Execute command file to modify input AmsatList File data") - - .hasArg(false) - - .required(false) - - .build(); - - - - final Option inputDirectoryOption = Option.builder("I") - - .longOpt("Input Directory") // - - .desc("Input directory with all input xml files (*.xml) ") - - .hasArg(true) - - .argName("InputRepository") - - .required(false) - - .build(); - - final Option outputDirectoryOption = Option.builder("O") - - .longOpt("Output Directory") // - - .desc("Output directory with all input xml files (*.xml) ") - - .hasArg(true) - - .argName("OutputDirectory") - - .required(false) - - .build(); - - final Option outputFileOption = Option.builder("o") - - .longOpt("OutputFile") // - - .desc("output file") - - .hasArg(true) - - .argName("OutputFile") - - .required(false) - - .build(); - - final Option inputFileOption = Option.builder("i") - - .longOpt("InputFile") // - - .desc("Input file (depending of usage XMl file or CSV file") - - .hasArg(true) - - .argName("InputFile") - - .required(false) - - .build(); - - final Option helpFileOption = Option.builder("h") - - .longOpt("help") - - .desc("display help message") - - .build(); - - final Options options = new Options(); - - options.addOption(updateOption); - options.addOption(inputFileOption); - options.addOption(checkOption); - options.addOption(versionOption); - options.addOption(mergeOption); - options.addOption(executeCmdOption); - options.addOption(inputDirectoryOption); - options.addOption(outputDirectoryOption); - options.addOption(outputFileOption); - options.addOption(helpFileOption); + if (cmdLine.hasOption("Merge")) { + if (parameter.getInputDirectory() == null) { + System.err.println("Merge : inputDirectory not defined"); + } else if (parameter.getOutputFile() == null) { + System.err.println("Merge : Output file name not defined"); + } else { + MergeCmd cmd = new MergeCmd(); + cmdList.add(cmd); + } + } - return options; + if (cmdLine.hasOption("Check")) { + if (parameter.getInputFile() == null) { + System.err.println("Check : Input file name not defined"); + } + CheckCmd cmd = new CheckCmd(); + cmdList.add(cmd); + } + if (cmdLine.hasOption("Update")) { + if (parameter.getInputDirectory() == null) { + System.err.println("Update : input Directory not defined"); + } else if (parameter.getOutputDirectory() == null) { + System.err.println("Update : Output Directory not defined"); + } else { + UpdateCmd cmd = new UpdateCmd(); + cmdList.add(cmd); + } } - private Vector interprete(final CommandLine cmdLine,final String[] args) { - - Vector cmdList = new Vector<>(); - ParameterSingleton parameter = ParameterSingleton.getInstance(); - - parameter.setOutputFile(cmdLine.getOptionValue("o")); - log.info("Output file dir" + cmdLine.getOptionValue("o")); - parameter.setInputDirectory(cmdLine.getOptionValue("I")); - log.info("Input dir" + cmdLine.getOptionValue("I")); - parameter.setOutputDirectory(cmdLine.getOptionValue("O")); - log.info("OUtput dir" + cmdLine.getOptionValue("O")); - parameter.setInputFile(cmdLine.getOptionValue("InputFile", "")); - cmdList.add(new VersionCmd()); - - if (cmdLine.hasOption("help")) { - parameter.setArg0(args[0]); - parameter.setOption(options); - cmdList.add(new HelpCmd()); - } - - if (cmdLine.hasOption("Version")) { - return cmdList; - } - - if (cmdLine.hasOption("Merge")) { - if (parameter.getInputDirectory() == null) { - System.err.println("Merge : inputDirectory not defined"); - } else if (parameter.getOutputFile() == null) { - System.err.println("Merge : Output file name not defined"); - } else { - MergeCmd cmd = new MergeCmd(); - cmdList.add(cmd); - } - } - - if (cmdLine.hasOption("Check")) { - if (parameter.getInputFile() == null) { - System.err.println("Check : Input file name not defined"); - } - CheckCmd cmd = new CheckCmd(); - cmdList.add(cmd); - } - - if (cmdLine.hasOption("Update")) { - if (parameter.getInputDirectory() == null) { - System.err.println("Update : input Directory not defined"); - } else if (parameter.getOutputDirectory() == null) { - System.err.println("Update : Output Directory not defined"); - } else { - UpdateCmd cmd = new UpdateCmd(); - cmdList.add(cmd); - } - - } - - if (cmdLine.hasOption("ExecuteCommandeFile")) { - - if (parameter.getInputDirectory() == null) { - System.err.println("Update : input Directory not defined"); - } else if (parameter.getOutputDirectory() == null) { - System.err.println("Update : Output Directory not defined"); - } else if (parameter.getInputFile() == null) { - System.err.println("Update : input file not defined"); - }else { - ExecuteCommandeFile cmd = new ExecuteCommandeFile(); - cmdList.add(cmd); - } - - - } - - - return cmdList; + if (cmdLine.hasOption("ExecuteCommandeFile")) { + + if (parameter.getInputDirectory() == null) { + System.err.println("Update : input Directory not defined"); + } else if (parameter.getOutputDirectory() == null) { + System.err.println("Update : Output Directory not defined"); + } else if (parameter.getInputFile() == null) { + System.err.println("Update : input file not defined"); + } else { + ExecuteCommandeFile cmd = new ExecuteCommandeFile(); + cmdList.add(cmd); + } } + return cmdList; + } } diff --git a/ApplicationSatelliteDatabaseCli/src/main/java/org/josast/ApplicationSatelliteDatabaseCli/cmd/ParameterSingleton.java b/ApplicationSatelliteDatabaseCli/src/main/java/org/josast/ApplicationSatelliteDatabaseCli/cmd/ParameterSingleton.java index 8568e6da70d1740c01b4d81c97850bbd0adcafa5..d717d4f1da55a6dc5e21fc5852969b8154f4e012 100644 --- a/ApplicationSatelliteDatabaseCli/src/main/java/org/josast/ApplicationSatelliteDatabaseCli/cmd/ParameterSingleton.java +++ b/ApplicationSatelliteDatabaseCli/src/main/java/org/josast/ApplicationSatelliteDatabaseCli/cmd/ParameterSingleton.java @@ -4,135 +4,92 @@ import org.apache.commons.cli.Options; public final class ParameterSingleton { - /** - * INSTANCE singleton. - */ - private static ParameterSingleton instance; - /** - * OutputFile. - */ - private String outputFile; - /** - * InputFile. - */ - private String inputFile; - /** - * inputDirectory. - */ - private String inputDirectory; - /** - * outputDirectory. - */ - private String outputDirectory; - - /** - * arg0. - */ - private String arg0; - /** - * option. - */ - private Options option; - - private ParameterSingleton() { - } - - /** - * @return singleton. - */ - public static ParameterSingleton getInstance() { - if (instance == null) { - instance = new ParameterSingleton(); - } - - return instance; - } - - // getters and setters - - /** - * @return outputFile. - */ - public String getOutputFile() { - return outputFile; - } - - /** - * @return inputDirectory. - */ - public String getInputDirectory() { - return inputDirectory; - } - - /** - * @param inputdirectory - */ - public void setInputDirectory(final String inputdirectory) { - this.inputDirectory = inputdirectory; - } - - /** - * @return outputDirectory. - */ - public String getOutputDirectory() { - return outputDirectory; - } - - /** - * @param outputdirectory - */ - public void setOutputDirectory(final String outputdirectory) { - this.outputDirectory = outputdirectory; - } - - /** - * @param outputfile - */ - public void setOutputFile(final String outputfile) { - outputFile = outputfile; - } - - /** - * @return arg0. - */ - public String getArg0() { - return arg0; - } - - /** - * @param arg - */ - public void setArg0(final String arg) { - this.arg0 = arg; - } - - /** - * @return option. - */ - public Options getOption() { - return option; - } - - /** - * @param options - */ - public void setOption(final Options options) { - this.option = options; - } - - /** - * @param optionValue options - */ - public void setInputFile(final String optionValue) { - inputFile = optionValue; - - } - - /** - * @return inputFile. - */ - public String getInputFile() { - return inputFile; + /** INSTANCE singleton. */ + private static ParameterSingleton instance; + /** OutputFile. */ + private String outputFile; + /** InputFile. */ + private String inputFile; + /** inputDirectory. */ + private String inputDirectory; + /** outputDirectory. */ + private String outputDirectory; + + /** arg0. */ + private String arg0; + /** option. */ + private Options option; + + private ParameterSingleton() {} + + /** @return singleton. */ + public static ParameterSingleton getInstance() { + if (instance == null) { + instance = new ParameterSingleton(); } + return instance; + } + + // getters and setters + + /** @return outputFile. */ + public String getOutputFile() { + return outputFile; + } + + /** @return inputDirectory. */ + public String getInputDirectory() { + return inputDirectory; + } + + /** @param inputdirectory */ + public void setInputDirectory(final String inputdirectory) { + this.inputDirectory = inputdirectory; + } + + /** @return outputDirectory. */ + public String getOutputDirectory() { + return outputDirectory; + } + + /** @param outputdirectory */ + public void setOutputDirectory(final String outputdirectory) { + this.outputDirectory = outputdirectory; + } + + /** @param outputfile */ + public void setOutputFile(final String outputfile) { + outputFile = outputfile; + } + + /** @return arg0. */ + public String getArg0() { + return arg0; + } + + /** @param arg */ + public void setArg0(final String arg) { + this.arg0 = arg; + } + + /** @return option. */ + public Options getOption() { + return option; + } + + /** @param options */ + public void setOption(final Options options) { + this.option = options; + } + + /** @param optionValue options */ + public void setInputFile(final String optionValue) { + inputFile = optionValue; + } + + /** @return inputFile. */ + public String getInputFile() { + return inputFile; + } } diff --git a/ApplicationSatelliteDatabaseCli/src/main/java/org/josast/ApplicationSatelliteDatabaseCli/cmd/UpdateCmd.java b/ApplicationSatelliteDatabaseCli/src/main/java/org/josast/ApplicationSatelliteDatabaseCli/cmd/UpdateCmd.java index 1cd81cbbf43fef0f7acb54fa03bc120279f6c20d..301c34f556fe79ff7fcd14953a59ff1d265adb2a 100644 --- a/ApplicationSatelliteDatabaseCli/src/main/java/org/josast/ApplicationSatelliteDatabaseCli/cmd/UpdateCmd.java +++ b/ApplicationSatelliteDatabaseCli/src/main/java/org/josast/ApplicationSatelliteDatabaseCli/cmd/UpdateCmd.java @@ -2,54 +2,45 @@ package org.josast.ApplicationSatelliteDatabaseCli.cmd; import java.io.File; import java.util.logging.Logger; - import org.josast.ModuleSatelliteDatabase.UpdateAmsatListFile; public class UpdateCmd implements Cmd { - /** - * logger. - */ - private Logger log = Logger.getLogger(getClass().getName()); - - /** - * - */ - @Override - public void excute() { - ParameterSingleton parameter = ParameterSingleton.getInstance(); - String inputRepository = parameter.getInputDirectory(); - String outputRepository = parameter.getOutputDirectory(); - File inputRepertoire = new File(inputRepository); - File outputRepertoire = new File(outputRepository); - - int i = 0; - if (!inputRepertoire.isDirectory()) { - log.severe(inputRepository + "is not a repository"); - } - if (!outputRepertoire.exists()) { - log.info("create " + inputRepository); - if (!outputRepertoire.mkdir()) { - log.severe(outputRepertoire + "is not created"); - } - } else if (!outputRepertoire.isDirectory()) { - log.severe(outputRepertoire + "is not a repository"); - } - - File[] inputsfiles = inputRepertoire.listFiles(); - if (inputsfiles == null) { - log.severe(inputRepository + "Repository empty"); - } else { - for (i = 0; i < inputsfiles.length; i++) { + /** logger. */ + private Logger log = Logger.getLogger(getClass().getName()); + + /** */ + @Override + public void excute() { + ParameterSingleton parameter = ParameterSingleton.getInstance(); + String inputRepository = parameter.getInputDirectory(); + String outputRepository = parameter.getOutputDirectory(); + File inputRepertoire = new File(inputRepository); + File outputRepertoire = new File(outputRepository); + + int i = 0; + if (!inputRepertoire.isDirectory()) { + log.severe(inputRepository + "is not a repository"); + } + if (!outputRepertoire.exists()) { + log.info("create " + inputRepository); + if (!outputRepertoire.mkdir()) { + log.severe(outputRepertoire + "is not created"); + } + } else if (!outputRepertoire.isDirectory()) { + log.severe(outputRepertoire + "is not a repository"); + } - UpdateAmsatListFile up = new UpdateAmsatListFile( - inputsfiles[i].getAbsolutePath()); - up.updateStatus(); - up.saveUpdateFile( - outputRepository + "\\" + inputsfiles[i].getName()); - } - } + File[] inputsfiles = inputRepertoire.listFiles(); + if (inputsfiles == null) { + log.severe(inputRepository + "Repository empty"); + } else { + for (i = 0; i < inputsfiles.length; i++) { + UpdateAmsatListFile up = new UpdateAmsatListFile(inputsfiles[i].getAbsolutePath()); + up.updateStatus(); + up.saveUpdateFile(outputRepository + "\\" + inputsfiles[i].getName()); + } } - + } } diff --git a/ApplicationSatelliteDatabaseCli/src/main/java/org/josast/ApplicationSatelliteDatabaseCli/cmd/VersionCmd.java b/ApplicationSatelliteDatabaseCli/src/main/java/org/josast/ApplicationSatelliteDatabaseCli/cmd/VersionCmd.java index a2de9a03c3584c6ceed278bf99ddd0ead58a7790..18b14b576c0e690ecbd39cf7fed7f75c4a0a9a15 100644 --- a/ApplicationSatelliteDatabaseCli/src/main/java/org/josast/ApplicationSatelliteDatabaseCli/cmd/VersionCmd.java +++ b/ApplicationSatelliteDatabaseCli/src/main/java/org/josast/ApplicationSatelliteDatabaseCli/cmd/VersionCmd.java @@ -1,21 +1,15 @@ - package org.josast.ApplicationSatelliteDatabaseCli.cmd; import org.josast.ApplicationSatelliteDatabaseCli.AppCli; public class VersionCmd implements Cmd { - /** - * software version. - */ - private String version = "0.9"; - - /** - * - */ - @Override - public void excute() { - System.out.println(AppCli.class.getSimpleName() + " " + version); - } + /** software version. */ + private String version = "0.9"; + /** */ + @Override + public void excute() { + System.out.println(AppCli.class.getSimpleName() + " " + version); + } } diff --git a/ApplicationSatelliteDatabaseCli/src/test/java/org/josast/ApplicationSatelliteDatabaseCli/cmd/CheckCmdTest.java b/ApplicationSatelliteDatabaseCli/src/test/java/org/josast/ApplicationSatelliteDatabaseCli/cmd/CheckCmdTest.java index 9da676ba57fa083b8f9379977c5b4ae5d1cdcb67..e1725a838614af730caa8846b6d3628a1b7c682b 100644 --- a/ApplicationSatelliteDatabaseCli/src/test/java/org/josast/ApplicationSatelliteDatabaseCli/cmd/CheckCmdTest.java +++ b/ApplicationSatelliteDatabaseCli/src/test/java/org/josast/ApplicationSatelliteDatabaseCli/cmd/CheckCmdTest.java @@ -10,30 +10,25 @@ import org.junit.Test; public class CheckCmdTest { - @BeforeClass - public static void setUpBeforeClass() throws Exception { - } + @BeforeClass + public static void setUpBeforeClass() throws Exception {} - @AfterClass - public static void tearDownAfterClass() throws Exception { - } + @AfterClass + public static void tearDownAfterClass() throws Exception {} - @Before - public void setUp() throws Exception { - } + @Before + public void setUp() throws Exception {} - @After - public void tearDown() throws Exception { - } + @After + public void tearDown() throws Exception {} - @Test - public void test() { - ParameterSingleton parameter = ParameterSingleton.getInstance(); - - parameter.setInputFile("src/test/data/FileIn/AmsatList.xml"); - CheckCmd cmd = new CheckCmd(); - cmd.excute(); - assertTrue(true); - } + @Test + public void test() { + ParameterSingleton parameter = ParameterSingleton.getInstance(); + parameter.setInputFile("src/test/data/FileIn/AmsatList.xml"); + CheckCmd cmd = new CheckCmd(); + cmd.excute(); + assertTrue(true); + } } diff --git a/ApplicationSatelliteDatabaseCli/src/test/java/org/josast/ApplicationSatelliteDatabaseCli/cmd/MergeCmdTest.java b/ApplicationSatelliteDatabaseCli/src/test/java/org/josast/ApplicationSatelliteDatabaseCli/cmd/MergeCmdTest.java index b34129f50af223a127b1ba1698b24af4edaf78ee..f71f133ac23496b067068a653eb5604260ba83bb 100644 --- a/ApplicationSatelliteDatabaseCli/src/test/java/org/josast/ApplicationSatelliteDatabaseCli/cmd/MergeCmdTest.java +++ b/ApplicationSatelliteDatabaseCli/src/test/java/org/josast/ApplicationSatelliteDatabaseCli/cmd/MergeCmdTest.java @@ -10,32 +10,27 @@ import org.junit.Test; public class MergeCmdTest { - @BeforeClass - public static void setUpBeforeClass() throws Exception { - } - - @AfterClass - public static void tearDownAfterClass() throws Exception { - } - - @Before - public void setUp() throws Exception { - } - - @After - public void tearDown() throws Exception { - } - - @Test - public void testExcute() { - ParameterSingleton parameter = ParameterSingleton.getInstance(); - parameter.setOutputFile("outputFile.xml"); - parameter.setInputDirectory("src/test/data/in"); - - MergeCmd cmd = new MergeCmd(); - cmd.excute(); - // si il n'y a pas d'erreur généré. - assertTrue( true ); - } + @BeforeClass + public static void setUpBeforeClass() throws Exception {} + @AfterClass + public static void tearDownAfterClass() throws Exception {} + + @Before + public void setUp() throws Exception {} + + @After + public void tearDown() throws Exception {} + + @Test + public void testExcute() { + ParameterSingleton parameter = ParameterSingleton.getInstance(); + parameter.setOutputFile("outputFile.xml"); + parameter.setInputDirectory("src/test/data/in"); + + MergeCmd cmd = new MergeCmd(); + cmd.excute(); + // si il n'y a pas d'erreur généré. + assertTrue(true); + } } diff --git a/ApplicationSatelliteDatabaseCli/src/test/java/org/josast/ApplicationSatelliteDatabaseCli/cmd/UpdateCmdTest.java b/ApplicationSatelliteDatabaseCli/src/test/java/org/josast/ApplicationSatelliteDatabaseCli/cmd/UpdateCmdTest.java index 3eb7085b9f6c0a234810d1da6ba5e4ac8cd2cda9..1f9a5496365ff10dc1be6d78696373a04f83c74d 100644 --- a/ApplicationSatelliteDatabaseCli/src/test/java/org/josast/ApplicationSatelliteDatabaseCli/cmd/UpdateCmdTest.java +++ b/ApplicationSatelliteDatabaseCli/src/test/java/org/josast/ApplicationSatelliteDatabaseCli/cmd/UpdateCmdTest.java @@ -10,33 +10,27 @@ import org.junit.Test; public class UpdateCmdTest { - @BeforeClass - public static void setUpBeforeClass() throws Exception { - } + @BeforeClass + public static void setUpBeforeClass() throws Exception {} - @AfterClass - public static void tearDownAfterClass() throws Exception { - } + @AfterClass + public static void tearDownAfterClass() throws Exception {} - @Before - public void setUp() throws Exception { - } + @Before + public void setUp() throws Exception {} - @After - public void tearDown() throws Exception { - } + @After + public void tearDown() throws Exception {} - @Test - public void test() { - ParameterSingleton parameter = ParameterSingleton.getInstance(); - - - parameter.setInputDirectory("src/test/data/in"); - parameter.setOutputDirectory("src/test/data/out"); - UpdateCmd cmd = new UpdateCmd(); - cmd.excute(); - // si il n'y a pas d'erreur généré. - assertTrue( true ); - } + @Test + public void test() { + ParameterSingleton parameter = ParameterSingleton.getInstance(); + parameter.setInputDirectory("src/test/data/in"); + parameter.setOutputDirectory("src/test/data/out"); + UpdateCmd cmd = new UpdateCmd(); + cmd.excute(); + // si il n'y a pas d'erreur généré. + assertTrue(true); + } } diff --git a/ApplicationSerial/pom.xml b/ApplicationSerial/pom.xml index 9fd158ef0cbe2b52a81c6a928851dcb694c4d2dc..5d6811e3e6d5a1c930b743ee5feee00dce9f0248 100644 --- a/ApplicationSerial/pom.xml +++ b/ApplicationSerial/pom.xml @@ -12,7 +12,7 @@ ApplicationSerial jar - 1.0-SNAPSHOT + ApplicationSerial http://maven.apache.org diff --git a/ApplicationSerial/src/main/java/org/josast/serialtoTNC/ASCII.java b/ApplicationSerial/src/main/java/org/josast/serialtoTNC/ASCII.java index a0ecf6f9318c00055b95782c40b745dc036d719a..62342089a48cf3117e8a61d8bd004da4a77d7e60 100644 --- a/ApplicationSerial/src/main/java/org/josast/serialtoTNC/ASCII.java +++ b/ApplicationSerial/src/main/java/org/josast/serialtoTNC/ASCII.java @@ -1,16 +1,10 @@ -/** - * - */ +/** */ package org.josast.serialtoTNC; -/** - * @author chris - * - */ +/** @author chris */ public class ASCII { - - public static final byte ESC = 27; - public static final byte LF = 10; - public static final byte CR = 13; + public static final byte ESC = 27; + public static final byte LF = 10; + public static final byte CR = 13; } diff --git a/ApplicationSerial/src/main/java/org/josast/serialtoTNC/AX25simple/Callsign.java b/ApplicationSerial/src/main/java/org/josast/serialtoTNC/AX25simple/Callsign.java index a5b8cc6ee14fd2eea59c38ed53030d5a08c77dca..7d2571b766f121950ffa4fb6df3ba05c368d91a4 100644 --- a/ApplicationSerial/src/main/java/org/josast/serialtoTNC/AX25simple/Callsign.java +++ b/ApplicationSerial/src/main/java/org/josast/serialtoTNC/AX25simple/Callsign.java @@ -3,84 +3,65 @@ package org.josast.serialtoTNC.AX25simple; import java.util.logging.Logger; public class Callsign { - private byte [] callsign= new byte [6]; - private byte ssid; - - private static Logger logger = Logger.getLogger("AmsatLogger"); - - - public Callsign (String inCallsign,byte inSsid) - { - if(inCallsign.length() > 6 ) - { - logger.severe("callsign : "+inCallsign+" lenght greater than 6"); - inCallsign = inCallsign.substring(0, 6); - } - callsign = inCallsign.getBytes(); - ssid = inSsid; - } - - - - public Callsign () - { - - } + private byte[] callsign = new byte[6]; + private byte ssid; - public byte[] getBytes () - { - byte[] call = new byte [7]; - int i; - for(i=0;i 6) { + logger.severe("callsign : " + inCallsign + " lenght greater than 6"); + inCallsign = inCallsign.substring(0, 6); + } + callsign = inCallsign.getBytes(); + ssid = inSsid; + } - } - call[6] = ssid; - return call; - } - - public String getCallsign() { - return String.valueOf(callsign); - } - - public void setCallsign(String callsign) { - if(callsign.length() > 6 ) - { - logger.severe("callsign : "+callsign+" lenght greater than 6"); - callsign = callsign.substring(0, 6); - } - this.callsign = callsign.getBytes(); - } - - public byte getSsid() { - return ssid; - } - - public void setSsid(byte ssid) { - this.ssid = ssid; - } + public Callsign() {} - - public String toString() - { - - return String.valueOf(callsign)+" SSID "+ssid ; - - } - - public boolean isCallsign(String in) - { - return in.equals(String.valueOf(callsign)); - } -} + public byte[] getBytes() { + byte[] call = new byte[7]; + int i; + for (i = 0; i < callsign.length; i++) { + if (callsign[i] == 0) { + call[i] = ' '; + } + call[i] = callsign[i]; + } + + for (; i < 6; i++) { + call[i] = ' '; + } + call[6] = ssid; + return call; + } + + public String getCallsign() { + return String.valueOf(callsign); + } + + public void setCallsign(String callsign) { + if (callsign.length() > 6) { + logger.severe("callsign : " + callsign + " lenght greater than 6"); + callsign = callsign.substring(0, 6); + } + this.callsign = callsign.getBytes(); + } + + public byte getSsid() { + return ssid; + } + public void setSsid(byte ssid) { + this.ssid = ssid; + } + + public String toString() { + + return String.valueOf(callsign) + " SSID " + ssid; + } + + public boolean isCallsign(String in) { + return in.equals(String.valueOf(callsign)); + } +} diff --git a/ApplicationSerial/src/main/java/org/josast/serialtoTNC/AX25simple/SimpleAX25frame.java b/ApplicationSerial/src/main/java/org/josast/serialtoTNC/AX25simple/SimpleAX25frame.java index 3d8d45d5964619edf8bbdec3f8e0bbfdd440b705..d57cfb6b10f82bf523f94272ce3b74ff2dead01b 100644 --- a/ApplicationSerial/src/main/java/org/josast/serialtoTNC/AX25simple/SimpleAX25frame.java +++ b/ApplicationSerial/src/main/java/org/josast/serialtoTNC/AX25simple/SimpleAX25frame.java @@ -4,50 +4,45 @@ import java.util.Arrays; public class SimpleAX25frame { - public static final byte AX25 = 0; - public static final byte TXDELAY = 1; - public static final byte P = 2; - public static final byte SlotTime = 3; - public static final byte TXtail = 4; - public static final byte Fullduplex = 5; - public static final byte SetHardware = 6; - public static final byte Exit1 = (byte) 255; - public static final byte unknow = -1; - - Callsign from; - Callsign to; -// Callsign[] repeater = new Callsign[8]; -// char[] data; - byte controlID = 0x3; - byte protocolID = (byte) 0XF0 ; -// byte type; - - public SimpleAX25frame(Callsign inFrom, Callsign inTo) - - { - from = inFrom; - to = inTo; - } - - public byte[] encodeTrameUI(byte[] data) { - // size = header size (2 callsign) + PID + - byte[] encodedAx25 = new byte[16 + data.length]; - int cpt = 0; - byte[] callsignbyte = from.getBytes(); - - for (int i = 0; i < callsignbyte.length; i++) - { - encodedAx25[cpt++] = callsignbyte[i]; - } - callsignbyte = to.getBytes(); - for (int i = 0; i < callsignbyte.length; i++) - encodedAx25[cpt++] = callsignbyte[i]; - encodedAx25[cpt++] = controlID; - encodedAx25[cpt++] = protocolID; - for (int i = 0; i < data.length; i++) - encodedAx25[cpt++] = data[i]; - - return Arrays.copyOf(encodedAx25, cpt); - } - + public static final byte AX25 = 0; + public static final byte TXDELAY = 1; + public static final byte P = 2; + public static final byte SlotTime = 3; + public static final byte TXtail = 4; + public static final byte Fullduplex = 5; + public static final byte SetHardware = 6; + public static final byte Exit1 = (byte) 255; + public static final byte unknow = -1; + + Callsign from; + Callsign to; + // Callsign[] repeater = new Callsign[8]; + // char[] data; + byte controlID = 0x3; + byte protocolID = (byte) 0XF0; + // byte type; + + public SimpleAX25frame(Callsign inFrom, Callsign inTo) { + + from = inFrom; + to = inTo; + } + + public byte[] encodeTrameUI(byte[] data) { + // size = header size (2 callsign) + PID + + byte[] encodedAx25 = new byte[16 + data.length]; + int cpt = 0; + byte[] callsignbyte = from.getBytes(); + + for (int i = 0; i < callsignbyte.length; i++) { + encodedAx25[cpt++] = callsignbyte[i]; + } + callsignbyte = to.getBytes(); + for (int i = 0; i < callsignbyte.length; i++) encodedAx25[cpt++] = callsignbyte[i]; + encodedAx25[cpt++] = controlID; + encodedAx25[cpt++] = protocolID; + for (int i = 0; i < data.length; i++) encodedAx25[cpt++] = data[i]; + + return Arrays.copyOf(encodedAx25, cpt); + } } diff --git a/ApplicationSerial/src/main/java/org/josast/serialtoTNC/ApplicationUVSQsatTNC.java b/ApplicationSerial/src/main/java/org/josast/serialtoTNC/ApplicationUVSQsatTNC.java index 771c6d3a9e4d3c8c5e329cb48f8fd5cfe0ba7c23..6f42c7d062ca779c26475cef0ba3da84f75d015c 100644 --- a/ApplicationSerial/src/main/java/org/josast/serialtoTNC/ApplicationUVSQsatTNC.java +++ b/ApplicationSerial/src/main/java/org/josast/serialtoTNC/ApplicationUVSQsatTNC.java @@ -6,69 +6,61 @@ import java.util.Vector; import java.util.logging.FileHandler; import java.util.logging.Handler; import java.util.logging.Logger; - import org.apache.commons.cli.ParseException; import org.josast.serialtoTNC.options.AppCmd; import org.josast.serialtoTNC.options.OptionAnalysis; public class ApplicationUVSQsatTNC { - private static Logger logger = Logger.getLogger("AmsatLogger"); - private static Vector vec; - - public ApplicationUVSQsatTNC(String[] args) { - try { - String path = System.getProperty("user.dir") + "/log"; - File apath = new File(path); - - if (!apath.exists()) { - if (apath.mkdir() == false) { - System.err.println("fail to create " + path); - } - } - - FileHandler fh = new FileHandler(path + "/" + "UVSQSAT.xml"); - logger.setUseParentHandlers(false); - Handler[] handlers = logger.getHandlers(); - for (Handler handler : handlers) { - logger.removeHandler(handler); - } - logger.addHandler(fh); - - } catch (SecurityException e) { - - e.printStackTrace(); - - } catch (IOException e) { - - e.printStackTrace(); - - } - - OptionAnalysis opt = new OptionAnalysis(args); - vec = opt.getCommandes(); - - } - - /** - * launch all commande store in vec. - */ - private void execute() { - for (AppCmd cmd : vec) { - cmd.excute(); - } - - } - - /** - * @param args - * @throws ParseException - */ - public static void main(String[] args) throws ParseException { - - ApplicationUVSQsatTNC app = new ApplicationUVSQsatTNC(args); - app.execute(); - - } - + private static Logger logger = Logger.getLogger("AmsatLogger"); + private static Vector vec; + + public ApplicationUVSQsatTNC(String[] args) { + try { + String path = System.getProperty("user.dir") + "/log"; + File apath = new File(path); + + if (!apath.exists()) { + if (apath.mkdir() == false) { + System.err.println("fail to create " + path); + } + } + + FileHandler fh = new FileHandler(path + "/" + "UVSQSAT.xml"); + logger.setUseParentHandlers(false); + Handler[] handlers = logger.getHandlers(); + for (Handler handler : handlers) { + logger.removeHandler(handler); + } + logger.addHandler(fh); + + } catch (SecurityException e) { + + e.printStackTrace(); + + } catch (IOException e) { + + e.printStackTrace(); + } + + OptionAnalysis opt = new OptionAnalysis(args); + vec = opt.getCommandes(); + } + + /** launch all commande store in vec. */ + private void execute() { + for (AppCmd cmd : vec) { + cmd.excute(); + } + } + + /** + * @param args + * @throws ParseException + */ + public static void main(String[] args) throws ParseException { + + ApplicationUVSQsatTNC app = new ApplicationUVSQsatTNC(args); + app.execute(); + } } diff --git a/ApplicationSerial/src/main/java/org/josast/serialtoTNC/ParameterSingleton.java b/ApplicationSerial/src/main/java/org/josast/serialtoTNC/ParameterSingleton.java index 9ff48f8103af4c4cfe0978f0d2bcc8efbc818bc3..868c4e0a58d3d1a8ff902f3946a1affc02581f3b 100644 --- a/ApplicationSerial/src/main/java/org/josast/serialtoTNC/ParameterSingleton.java +++ b/ApplicationSerial/src/main/java/org/josast/serialtoTNC/ParameterSingleton.java @@ -1,217 +1,151 @@ package org.josast.serialtoTNC; -/** - * Manage application parameter in configuration file - * - * - */ - +/** Manage application parameter in configuration file */ import org.apache.commons.cli.Options; - - import org.josast.property.CONFIG; public class ParameterSingleton { - - private String callsignto="LATMOS"; - private byte ssidto=0; - private String callsignFrom="LATMOS"; - private byte ssidfrom=1; - private String serialport="COM5"; - private int delayCmd = 1000; - private int delayData= 2000; - - - - - /** - * @return the delayCmd - */ - public int getDelayCmd() { - return delayCmd; - } - - /** - * @param delayCmd the delayCmd to set - */ - public void setDelayCmd(int delayCmd) { - this.delayCmd = delayCmd; - } - - /** - * @return the delayData - */ - public int getDelayData() { - return delayData; - } - - /** - * @param delayData the delayData to set - */ - public void setDelayData(int delayData) { - this.delayData = delayData; - } - - /** - * arg0. - */ - private String arg0; - /** - * option. - */ - private Options option; - - - /** - * INSTANCE singleton. - */ - private CONFIG conf = CONFIG.getInstance(); - - private static ParameterSingleton INSTANCE; - /** - * OutputFile. - */ - - - - private ParameterSingleton() { - if ( conf.getProperty("serialport")!=null) - { - callsignto= conf.getProperty("callsignto"); - ssidto= Byte.parseByte(conf.getProperty("ssidto")); - callsignFrom= conf.getProperty("callsignFrom"); - ssidfrom= Byte.parseByte(conf.getProperty("ssidfrom")); - serialport= conf.getProperty("serialport"); - delayCmd = Integer.parseInt(conf.getProperty("delayCmd")); - delayData = Integer.parseInt(conf.getProperty("delayData")); - - } - else // si le fichier n'existe pas, il est créé par défaut - { - save(); - } - } - - /** - * @return singleton. - */ - public static ParameterSingleton getInstance() { - if (INSTANCE == null) { - INSTANCE = new ParameterSingleton(); - } - - return INSTANCE; - } - - - /** - * @return arg0. - */ - public String getArg0() { - return arg0; - } - - /** - * @param arg - */ - public void setArg0(final String arg) { - this.arg0 = arg; - } - - /** - * @return option. - */ - public Options getOption() { - return option; - } - - /** - * @param options - */ - public void setOption(final Options options) { - this.option = options; - } - /** - * @return the callsignto - */ - public String getCallsignto() { - return callsignto; - } - - /** - * @param callsignto the callsignto to set - */ - public void setCallsignto(String callsignto) { - this.callsignto = callsignto; - } - - /** - * @return the ssidto - */ - public byte getSsidto() { - return ssidto; - } - - /** - * @param ssidto the ssidto to set - */ - public void setSsidto(byte ssidto) { - this.ssidto = ssidto; - } - - /** - * @return the callsignFrom - */ - public String getCallsignFrom() { - return callsignFrom; - } - - /** - * @param callsignFrom the callsignFrom to set - */ - public void setCallsignFrom(String callsignFrom) { - this.callsignFrom = callsignFrom; - } - - /** - * @return the ssidfrom - */ - public byte getSsidfrom() { - return ssidfrom; - } - - /** - * @param ssidfrom the ssidfrom to set - */ - public void setSsidfrom(byte ssidfrom) { - this.ssidfrom = ssidfrom; - } - - /** - * @return the serialport - */ - public String getSerialport() { - return serialport; - } - - /** - * @param serialport the serialport to set - */ - public void setSerialport(String serialport) { - this.serialport = serialport; - } - - public void save () + private String callsignto = "LATMOS"; + private byte ssidto = 0; + private String callsignFrom = "LATMOS"; + private byte ssidfrom = 1; + private String serialport = "COM5"; + private int delayCmd = 1000; + private int delayData = 2000; + + /** @return the delayCmd */ + public int getDelayCmd() { + return delayCmd; + } + + /** @param delayCmd the delayCmd to set */ + public void setDelayCmd(int delayCmd) { + this.delayCmd = delayCmd; + } + + /** @return the delayData */ + public int getDelayData() { + return delayData; + } + + /** @param delayData the delayData to set */ + public void setDelayData(int delayData) { + this.delayData = delayData; + } + + /** arg0. */ + private String arg0; + /** option. */ + private Options option; + + /** INSTANCE singleton. */ + private CONFIG conf = CONFIG.getInstance(); + + private static ParameterSingleton INSTANCE; + /** OutputFile. */ + private ParameterSingleton() { + if (conf.getProperty("serialport") != null) { + callsignto = conf.getProperty("callsignto"); + ssidto = Byte.parseByte(conf.getProperty("ssidto")); + callsignFrom = conf.getProperty("callsignFrom"); + ssidfrom = Byte.parseByte(conf.getProperty("ssidfrom")); + serialport = conf.getProperty("serialport"); + delayCmd = Integer.parseInt(conf.getProperty("delayCmd")); + delayData = Integer.parseInt(conf.getProperty("delayData")); + + } else // si le fichier n'existe pas, il est créé par défaut { - conf.setProperty("callsignto", callsignto); - conf.setProperty("ssidto",""+ssidto); - conf.setProperty("callsignFrom",callsignFrom); - conf.setProperty("ssidfrom",""+ssidfrom); - conf.setProperty("serialport",""+serialport); - conf.setProperty("delayData",""+delayData); - conf.setProperty("delayCmd",""+delayCmd); + save(); } + } + /** @return singleton. */ + public static ParameterSingleton getInstance() { + if (INSTANCE == null) { + INSTANCE = new ParameterSingleton(); + } + return INSTANCE; + } + + /** @return arg0. */ + public String getArg0() { + return arg0; + } + + /** @param arg */ + public void setArg0(final String arg) { + this.arg0 = arg; + } + + /** @return option. */ + public Options getOption() { + return option; + } + + /** @param options */ + public void setOption(final Options options) { + this.option = options; + } + + /** @return the callsignto */ + public String getCallsignto() { + return callsignto; + } + + /** @param callsignto the callsignto to set */ + public void setCallsignto(String callsignto) { + this.callsignto = callsignto; + } + + /** @return the ssidto */ + public byte getSsidto() { + return ssidto; + } + + /** @param ssidto the ssidto to set */ + public void setSsidto(byte ssidto) { + this.ssidto = ssidto; + } + + /** @return the callsignFrom */ + public String getCallsignFrom() { + return callsignFrom; + } + + /** @param callsignFrom the callsignFrom to set */ + public void setCallsignFrom(String callsignFrom) { + this.callsignFrom = callsignFrom; + } + + /** @return the ssidfrom */ + public byte getSsidfrom() { + return ssidfrom; + } + + /** @param ssidfrom the ssidfrom to set */ + public void setSsidfrom(byte ssidfrom) { + this.ssidfrom = ssidfrom; + } + + /** @return the serialport */ + public String getSerialport() { + return serialport; + } + + /** @param serialport the serialport to set */ + public void setSerialport(String serialport) { + this.serialport = serialport; + } + + public void save() { + conf.setProperty("callsignto", callsignto); + conf.setProperty("ssidto", "" + ssidto); + conf.setProperty("callsignFrom", callsignFrom); + conf.setProperty("ssidfrom", "" + ssidfrom); + conf.setProperty("serialport", "" + serialport); + conf.setProperty("delayData", "" + delayData); + conf.setProperty("delayCmd", "" + delayCmd); + } } diff --git a/ApplicationSerial/src/main/java/org/josast/serialtoTNC/ReadFileHEX.java b/ApplicationSerial/src/main/java/org/josast/serialtoTNC/ReadFileHEX.java index e3dfd1bed5af3c628007d4cad99c392ed93f94fd..7ddd467aab00addb6d039bed81d7ee4ec6893173 100644 --- a/ApplicationSerial/src/main/java/org/josast/serialtoTNC/ReadFileHEX.java +++ b/ApplicationSerial/src/main/java/org/josast/serialtoTNC/ReadFileHEX.java @@ -8,60 +8,54 @@ import java.util.ArrayList; import java.util.logging.Logger; public class ReadFileHEX { - private static Logger logger = Logger.getLogger("AmsatLogger"); + private static Logger logger = Logger.getLogger("AmsatLogger"); - ArrayList listLine = new ArrayList(); + ArrayList listLine = new ArrayList(); - public ReadFileHEX() { + public ReadFileHEX() {} - } + public ReadFileHEX(String file) { + try { - public ReadFileHEX(String file) { - try { + File f = new File(file); - File f = new File(file); + BufferedReader b = new BufferedReader(new FileReader(f)); - BufferedReader b = new BufferedReader(new FileReader(f)); + String readLine = ""; - String readLine = ""; + while ((readLine = b.readLine()) != null) { - while ((readLine = b.readLine()) != null) { + listLine.add(asciiTohex(readLine)); + } - listLine.add(asciiTohex(readLine)); - } + b.close(); - b.close(); + } catch (IOException e) { + logger.severe("File " + file + "Not Found"); + logger.severe(e.getMessage()); + } + } - } catch (IOException e) { - logger.severe("File " + file + "Not Found"); - logger.severe(e.getMessage()); - } + public byte[] asciiTohex(String readLine) { - } + String line = readLine.trim(); + String linewithoutspace = line.replaceAll("\\s", ""); + int len = linewithoutspace.length(); + if (len % 2 != 0) + throw new IllegalArgumentException("hexBinary needs to be even-length: " + linewithoutspace); - public byte[] asciiTohex(String readLine) { + byte[] val = new byte[len / 2]; - String line = readLine.trim(); - String linewithoutspace = line.replaceAll("\\s", ""); - int len = linewithoutspace.length(); - if (len % 2 != 0) - throw new IllegalArgumentException("hexBinary needs to be even-length: " + linewithoutspace); + for (int i = 0; i < val.length; i++) { + int index = i * 2; + int j = Integer.parseInt(linewithoutspace.substring(index, index + 2), 16); + val[i] = (byte) j; + } - byte[] val = new byte[len / 2]; - - for (int i = 0; i < val.length; i++) { - int index = i * 2; - int j = Integer.parseInt(linewithoutspace.substring(index, index + 2), 16); - val[i] = (byte) j; - } - - return val; - - } - - public ArrayList getLines() { - return listLine; - - } + return val; + } + public ArrayList getLines() { + return listLine; + } } diff --git a/ApplicationSerial/src/main/java/org/josast/serialtoTNC/ReadFileLine.java b/ApplicationSerial/src/main/java/org/josast/serialtoTNC/ReadFileLine.java index 7d92eb62f436dc935ced590a37a114ab64e5ce88..669a83047f959ea16f117d878b25f43907fa7ed4 100644 --- a/ApplicationSerial/src/main/java/org/josast/serialtoTNC/ReadFileLine.java +++ b/ApplicationSerial/src/main/java/org/josast/serialtoTNC/ReadFileLine.java @@ -8,39 +8,32 @@ import java.util.ArrayList; import java.util.logging.Logger; public class ReadFileLine { - private static Logger logger = Logger.getLogger("AmsatLogger"); - - ArrayList listLine = new ArrayList(); - - public ReadFileLine (String file) - { - try { - - File f = new File(file); - - BufferedReader b = new BufferedReader(new FileReader(f)); - - String readLine = ""; - - while ((readLine = b.readLine()) != null) { - listLine.add(readLine); - } - - b.close(); - - } catch (IOException e) { - logger.severe("File " + file + "Not Found"); - logger.severe(e.getMessage()); - } - - - } - - - public ArrayList getLines () - { - return listLine; - - } - + private static Logger logger = Logger.getLogger("AmsatLogger"); + + ArrayList listLine = new ArrayList(); + + public ReadFileLine(String file) { + try { + + File f = new File(file); + + BufferedReader b = new BufferedReader(new FileReader(f)); + + String readLine = ""; + + while ((readLine = b.readLine()) != null) { + listLine.add(readLine); + } + + b.close(); + + } catch (IOException e) { + logger.severe("File " + file + "Not Found"); + logger.severe(e.getMessage()); + } + } + + public ArrayList getLines() { + return listLine; + } } diff --git a/ApplicationSerial/src/main/java/org/josast/serialtoTNC/kiss/Kiss.java b/ApplicationSerial/src/main/java/org/josast/serialtoTNC/kiss/Kiss.java index 93bf4be8616a26b2a3bd3c890d5ef430d9400711..35c2ff2adbf801a098ec9752472f65edb8233702 100644 --- a/ApplicationSerial/src/main/java/org/josast/serialtoTNC/kiss/Kiss.java +++ b/ApplicationSerial/src/main/java/org/josast/serialtoTNC/kiss/Kiss.java @@ -4,201 +4,176 @@ import java.util.Arrays; /** * manage Kiss frame based on KISS protocol - * - * Kiss frame format is : FEND Command Data FEND - * + * + *

Kiss frame format is : FEND Command Data FEND + * * @see http://www.ka9q.net/papers/kiss.html - * * @author christophe - * */ public class Kiss { -// Command codes - public static final byte DATA = 0; - - public static final byte UNKNOW = (byte) 0xF0; - - public static final byte TXDELAY = 1; - - public static final byte P = 2; - - public static final byte SLOTTIME = 3; - - public static final byte TXTAIL = 4; - - public static final byte FULLDUPLEX = 5; - - public static final byte SETHARDWARE = 6; - - public static final byte RETURN = (byte) 0xFF; - - private static final byte FEND = (byte) 0xC0; - -// Special caracters - - // TFEND ($DB, $DC) - private static final byte FESC = (byte) 0xDB; - private static final byte TFEND = (byte) 0xDC; - // FESC, TFESC ($DB, $DD). - private static final byte TFESC = (byte) 0xDD; - -// - // trame Kiss - private byte[] kiss = null; - // commande - private byte type = 0; - // data - private byte[] kissdata = null; - - /** - * - * From Kiss frame extract data and commande information. - * - **/ - - public Kiss(final byte[] kissRaw) throws KissException { - kissdata = kissRaw; - type = 0; - encodeTokiss(); - } - - /** - * - * create kissframe from commande and data - * - **/ - - public Kiss(byte commande, byte[] data) throws KissException { - kissdata = data.clone(); - type = commande; - encodeTokiss(); - } - - /** - * - * create kissframe from commande and data - * - **/ - - public Kiss(byte commande, byte[] data, int port) throws KissException { - kissdata = data.clone(); - type = commande; - encodeTokiss(); - } - - public byte getType() { - return type; - } - - public void setType(byte type) { - this.type = type; - } - - private void encodeTokiss() { - byte[] tempdata = new byte[kissdata.length * 2 + 3]; // Taille maximale ( size data * 2 si uniquement des - // caracteres C0 & DB ) + 3 caracteres de trame Kiss - int i = 0; - tempdata[i++] = FEND; - tempdata[i++] = type; - for (int j = 0; j < kissdata.length; j++) { - if (kissdata[j] == FEND) { - tempdata[i++] = FESC; - tempdata[i++] = TFEND; - } else if (kissdata[j] == FESC) { - tempdata[i++] = FESC; - tempdata[i++] = TFESC; - } else - tempdata[i++] = kissdata[j]; - } - tempdata[i++] = FEND; - - kiss = Arrays.copyOf(tempdata, i); - - } - - /** - * - * @return array with data - * @throws KissException - */ - @SuppressWarnings("unused") - private void toRaw() throws KissException { - byte[] rawData = null; - rawData = new byte[kissdata.length]; - // identifie le début de trame - if (kissdata[0] != FEND) { - throw new KissException("FEND (0xC0) value not find at the beginning of the frame "); - } - // vérifie que la fin de trame est bien identifié - if (kissdata[kissdata.length - 1] != FEND) { - throw new KissException("FEND (0xC0) value not find at the end of the frame "); - } - // Identifie le type de trame - switch (kissdata[1]) { - case 0: - type = DATA; - break; - case 1: - type = TXDELAY; - break; - case 2: - type = P; - break; - case 3: - type = SLOTTIME; - break; - case 4: - type = TXTAIL; - break; - case 5: - type = FULLDUPLEX; - break; - case 6: - type = SETHARDWARE; - break; - case (byte) 0xff: - type = RETURN; - break; - - default: - type = UNKNOW; - - } - - int cptraw = 0; - int i = 2; - while (kissdata[i] != FEND) { - if (kissdata[i] != FESC) { - rawData[cptraw++] = kissdata[i++]; - } else { - if (kissdata[i + 1] == TFEND) { - - rawData[cptraw++] = FEND; - i = i + 2; - } else if (kissdata[i + 1] == TFESC) { - - rawData[cptraw++] = FESC; - i = i + 2; - } else { - rawData[cptraw++] = kissdata[i++]; - } - - } - - } - - kissdata = Arrays.copyOf(rawData, cptraw); - - } - - public byte[] getKiss() { - return kiss.clone(); - } - - public void setKiss(byte[] kiss) { - this.kiss = kiss.clone(); - - } - + // Command codes + public static final byte DATA = 0; + + public static final byte UNKNOW = (byte) 0xF0; + + public static final byte TXDELAY = 1; + + public static final byte P = 2; + + public static final byte SLOTTIME = 3; + + public static final byte TXTAIL = 4; + + public static final byte FULLDUPLEX = 5; + + public static final byte SETHARDWARE = 6; + + public static final byte RETURN = (byte) 0xFF; + + private static final byte FEND = (byte) 0xC0; + + // Special caracters + + // TFEND ($DB, $DC) + private static final byte FESC = (byte) 0xDB; + private static final byte TFEND = (byte) 0xDC; + // FESC, TFESC ($DB, $DD). + private static final byte TFESC = (byte) 0xDD; + + // + // trame Kiss + private byte[] kiss = null; + // commande + private byte type = 0; + // data + private byte[] kissdata = null; + + /** From Kiss frame extract data and commande information. */ + public Kiss(final byte[] kissRaw) throws KissException { + kissdata = kissRaw; + type = 0; + encodeTokiss(); + } + + /** create kissframe from commande and data */ + public Kiss(byte commande, byte[] data) throws KissException { + kissdata = data.clone(); + type = commande; + encodeTokiss(); + } + + /** create kissframe from commande and data */ + public Kiss(byte commande, byte[] data, int port) throws KissException { + kissdata = data.clone(); + type = commande; + encodeTokiss(); + } + + public byte getType() { + return type; + } + + public void setType(byte type) { + this.type = type; + } + + private void encodeTokiss() { + byte[] tempdata = + new byte[kissdata.length * 2 + 3]; // Taille maximale ( size data * 2 si uniquement des + // caracteres C0 & DB ) + 3 caracteres de trame Kiss + int i = 0; + tempdata[i++] = FEND; + tempdata[i++] = type; + for (int j = 0; j < kissdata.length; j++) { + if (kissdata[j] == FEND) { + tempdata[i++] = FESC; + tempdata[i++] = TFEND; + } else if (kissdata[j] == FESC) { + tempdata[i++] = FESC; + tempdata[i++] = TFESC; + } else tempdata[i++] = kissdata[j]; + } + tempdata[i++] = FEND; + + kiss = Arrays.copyOf(tempdata, i); + } + + /** + * @return array with data + * @throws KissException + */ + @SuppressWarnings("unused") + private void toRaw() throws KissException { + byte[] rawData = null; + rawData = new byte[kissdata.length]; + // identifie le début de trame + if (kissdata[0] != FEND) { + throw new KissException("FEND (0xC0) value not find at the beginning of the frame "); + } + // vérifie que la fin de trame est bien identifié + if (kissdata[kissdata.length - 1] != FEND) { + throw new KissException("FEND (0xC0) value not find at the end of the frame "); + } + // Identifie le type de trame + switch (kissdata[1]) { + case 0: + type = DATA; + break; + case 1: + type = TXDELAY; + break; + case 2: + type = P; + break; + case 3: + type = SLOTTIME; + break; + case 4: + type = TXTAIL; + break; + case 5: + type = FULLDUPLEX; + break; + case 6: + type = SETHARDWARE; + break; + case (byte) 0xff: + type = RETURN; + break; + + default: + type = UNKNOW; + } + + int cptraw = 0; + int i = 2; + while (kissdata[i] != FEND) { + if (kissdata[i] != FESC) { + rawData[cptraw++] = kissdata[i++]; + } else { + if (kissdata[i + 1] == TFEND) { + + rawData[cptraw++] = FEND; + i = i + 2; + } else if (kissdata[i + 1] == TFESC) { + + rawData[cptraw++] = FESC; + i = i + 2; + } else { + rawData[cptraw++] = kissdata[i++]; + } + } + } + + kissdata = Arrays.copyOf(rawData, cptraw); + } + + public byte[] getKiss() { + return kiss.clone(); + } + + public void setKiss(byte[] kiss) { + this.kiss = kiss.clone(); + } } diff --git a/ApplicationSerial/src/main/java/org/josast/serialtoTNC/kiss/KissException.java b/ApplicationSerial/src/main/java/org/josast/serialtoTNC/kiss/KissException.java index e98cfc7846d40ce0230a68415f14d6353b2055e5..2dc6e784e289de42137b8301f994a00a028c2796 100644 --- a/ApplicationSerial/src/main/java/org/josast/serialtoTNC/kiss/KissException.java +++ b/ApplicationSerial/src/main/java/org/josast/serialtoTNC/kiss/KissException.java @@ -2,15 +2,10 @@ package org.josast.serialtoTNC.kiss; public class KissException extends Exception { + /** */ + private static final long serialVersionUID = 1L; - - /** - * - */ - private static final long serialVersionUID = 1L; - - public KissException(String string) { - // TODO Auto-generated constructor stub - } - + public KissException(String string) { + // TODO Auto-generated constructor stub + } } diff --git a/ApplicationSerial/src/main/java/org/josast/serialtoTNC/options/AppCmd.java b/ApplicationSerial/src/main/java/org/josast/serialtoTNC/options/AppCmd.java index 4f0b9c150c294e57d4f2b3b51872073f563a7889..1c77ce656c4708d60f42f69ce23f3f48e119694c 100644 --- a/ApplicationSerial/src/main/java/org/josast/serialtoTNC/options/AppCmd.java +++ b/ApplicationSerial/src/main/java/org/josast/serialtoTNC/options/AppCmd.java @@ -1,10 +1,7 @@ package org.josast.serialtoTNC.options; public interface AppCmd { - - /** - * Excecute command. - */ - void excute(); + /** Excecute command. */ + void excute(); } diff --git a/ApplicationSerial/src/main/java/org/josast/serialtoTNC/options/HelpCmd.java b/ApplicationSerial/src/main/java/org/josast/serialtoTNC/options/HelpCmd.java index be25986e6930e2aeba49374ca79ec88b4b26e08f..73cd581917e8b6d1c448912b52f51e8ef8e3352c 100644 --- a/ApplicationSerial/src/main/java/org/josast/serialtoTNC/options/HelpCmd.java +++ b/ApplicationSerial/src/main/java/org/josast/serialtoTNC/options/HelpCmd.java @@ -3,15 +3,12 @@ package org.josast.serialtoTNC.options; import org.apache.commons.cli.HelpFormatter; import org.josast.serialtoTNC.ParameterSingleton; - public class HelpCmd implements AppCmd { - @Override - public void excute() { - final HelpFormatter formatter = new HelpFormatter(); - ParameterSingleton parameter = ParameterSingleton.getInstance(); - formatter.printHelp(parameter.getArg0(), parameter.getOption(), true); - - } - + @Override + public void excute() { + final HelpFormatter formatter = new HelpFormatter(); + ParameterSingleton parameter = ParameterSingleton.getInstance(); + formatter.printHelp(parameter.getArg0(), parameter.getOption(), true); + } } diff --git a/ApplicationSerial/src/main/java/org/josast/serialtoTNC/options/OptionAnalysis.java b/ApplicationSerial/src/main/java/org/josast/serialtoTNC/options/OptionAnalysis.java index ee6e57b0c43aa308d19d12c84212ac2f159dcba2..e0f9a4842e3226b854f615093a223ebd976f559d 100644 --- a/ApplicationSerial/src/main/java/org/josast/serialtoTNC/options/OptionAnalysis.java +++ b/ApplicationSerial/src/main/java/org/josast/serialtoTNC/options/OptionAnalysis.java @@ -3,18 +3,17 @@ package org.josast.serialtoTNC.options; import java.util.ArrayList; import java.util.Vector; import java.util.logging.Logger; - import org.apache.commons.cli.CommandLine; import org.apache.commons.cli.CommandLineParser; import org.apache.commons.cli.DefaultParser; import org.apache.commons.cli.Option; import org.apache.commons.cli.Options; import org.apache.commons.cli.ParseException; +import org.josast.serialtoTNC.AX25simple.Callsign; +import org.josast.serialtoTNC.AX25simple.SimpleAX25frame; import org.josast.serialtoTNC.ParameterSingleton; import org.josast.serialtoTNC.ReadFileHEX; import org.josast.serialtoTNC.ReadFileLine; -import org.josast.serialtoTNC.AX25simple.Callsign; -import org.josast.serialtoTNC.AX25simple.SimpleAX25frame; import org.josast.serialtoTNC.kiss.Kiss; import org.josast.serialtoTNC.kiss.KissException; import org.josast.serialtoTNC.type.TncCommandeType; @@ -23,243 +22,207 @@ import org.josast.serialtoTNC.type.TncKissType; public class OptionAnalysis { - private static Logger logger = Logger.getLogger("AmsatLogger"); - /** - * List of command to execute. - */ - private Vector listeCmd = new Vector(); - - private Options options = null; - /** - * line. - */ - private CommandLine line = null; - - public OptionAnalysis(final String[] args) { - options = configParameters(); - CommandLineParser parser = new DefaultParser(); - - try { - line = parser.parse(options, args); - listeCmd = interprete(line, args); - } catch (ParseException e) { - logger.severe("Argument analysis error"); - logger.severe(e.toString()); - - } - } - - /** - * @return list of command. - */ - public Vector getCommandes() { - return listeCmd; - } - - /** - * @param listeCmds - */ - public void setListeCmd(final Vector listeCmds) { - this.listeCmd = listeCmds; - } - - private static Options configParameters() { - - // request Vesion - final Option versionOption = Option.builder("V") - - .longOpt("Version") // - - .desc("Return application version") - - .hasArg(false) - - .required(false) - - .build(); - // List serial Port - final Option testserial = Option.builder("S") - - .longOpt("Serial?") // - - .desc("List all serial port detected on the computeur ") - - .hasArg(false) - - .required(false) - - .build(); - - final Option serialPort = Option.builder("s") - - .longOpt("SerialPort") // - - .desc("Provide Serial port name (eg COM1 ") - - .hasArg(true) - - .required(false) - - .build(); - // identify configuration file - final Option configurationFile = Option.builder("C") - - .longOpt("ModemConf") // - - .desc("Modem configuration file ") - - .hasArg(true).argName("InputFileModemConfiguration").required(false) - - .build(); - // identify line file to send - final Option dataFile = Option.builder("D") - - .longOpt("ASCIIfile") // - - .desc("data to send ASCII") - - .hasArg(true).argName("InputFileModemData").required(false) - - .build(); - final Option BinaryFile = Option.builder("B") - - .longOpt("HEXFile") // - - .desc("data to send HEX ") - - .hasArg(true).argName("InputFileModemDataHexa").required(false) - - .build(); - - final Option helpFileOption = Option.builder("h") - - .longOpt("help") - - .desc("display help message") - - .build(); - - final Options options = new Options(); - - options.addOption(dataFile); - - options.addOption(configurationFile); - options.addOption(versionOption); - options.addOption(testserial); - options.addOption(helpFileOption); - options.addOption(serialPort); - options.addOption(BinaryFile); - - return options; - - } - - private Vector interprete(CommandLine line, String[] args) { - - Vector cmdList = new Vector(); - ParameterSingleton parameter = ParameterSingleton.getInstance(); - - cmdList.add(new VersionCmd()); - if (line.hasOption("help")) { - parameter.setArg0(args[0]); - parameter.setOption(options); - cmdList.add(new HelpCmd()); - } - - if (line.hasOption("Version")) { - return cmdList; - } - - if (line.hasOption("Serial?")) { - cmdList.add(new SerialCmd()); - - } - - if (line.hasOption("ASCIIfile")) { - - String confModemfile = line.getOptionValue("C"); - String dataModemfile = line.getOptionValue("D"); - String serialportModem = line.getOptionValue("s"); - serialportModem = ParameterSingleton.getInstance().getSerialport(); - - if (line.getOptionValue("s") != null) { - serialportModem = line.getOptionValue("s"); - ParameterSingleton.getInstance().setSerialport(serialportModem); - } - - SendCmd cmd = null; - - if (confModemfile == null) { - cmd = new SendCmd(serialportModem, dataModemfile); - } else { - cmd = new SendCmd(serialportModem, confModemfile, dataModemfile); - } - - cmdList.add(cmd); - } - // cas ou fichier binaire - - if (line.hasOption("HEXFile")) { - - ArrayList commandetnc =null; - String confModemfile = line.getOptionValue("C"); - if (confModemfile !=null) - { - commandetnc = readConfigFile(confModemfile); - } - - - String dataHexModemfile = line.getOptionValue("B"); - ArrayList kissdata = readhexdata(dataHexModemfile); - - String serialportModem = ParameterSingleton.getInstance().getSerialport(); - - if (line.getOptionValue("s") != null) { - serialportModem = line.getOptionValue("s"); - ParameterSingleton.getInstance().setSerialport(serialportModem); - } - SendToTnc cmd = new SendToTnc(serialportModem, commandetnc, kissdata); - cmdList.add(cmd); - } - - return cmdList; - } - - private ArrayList readhexdata(String dataHexModemfile) { - ArrayList kissdata = new ArrayList(); - ReadFileHEX cmd = new ReadFileHEX(dataHexModemfile); - ArrayList cmds = cmd.getLines(); - String fromcalsign = ParameterSingleton.getInstance().getCallsignFrom(); - Callsign from = new Callsign(fromcalsign, (byte) 0X60); - String tocallsign = ParameterSingleton.getInstance().getCallsignto(); - Callsign to = new Callsign(tocallsign, (byte) 0xE2); - SimpleAX25frame simple = new SimpleAX25frame(from, to); - Kiss kiss = null; - for (int i = 0; i < cmds.size(); i++) { - byte[] ax25 = simple.encodeTrameUI(cmds.get(i)); -// System.out.println(TncKissType.bytesToHexString(ax25)); - try { - kiss = new Kiss((byte) 0, ax25); - } catch (KissException e) { - logger.severe(e.getMessage()); - } - byte[] kissFrame = kiss.getKiss(); - // creer UI + kis - kissdata.add(new TncKissType(kissFrame, kissFrame.length)); - } - return kissdata; - - } - - public ArrayList readConfigFile(String confModemfile) { - ArrayList commande = new ArrayList(); - ReadFileLine cmd = new ReadFileLine(confModemfile); - ArrayList cmds = cmd.getLines(); - for (int i = 0; i < cmds.size(); i++) { - - commande.add(new TncCommandeType(cmds.get(i))); - } - return commande; - - } - + private static Logger logger = Logger.getLogger("AmsatLogger"); + /** List of command to execute. */ + private Vector listeCmd = new Vector(); + + private Options options = null; + /** line. */ + private CommandLine line = null; + + public OptionAnalysis(final String[] args) { + options = configParameters(); + CommandLineParser parser = new DefaultParser(); + + try { + line = parser.parse(options, args); + listeCmd = interprete(line, args); + } catch (ParseException e) { + logger.severe("Argument analysis error"); + logger.severe(e.toString()); + } + } + + /** @return list of command. */ + public Vector getCommandes() { + return listeCmd; + } + + /** @param listeCmds */ + public void setListeCmd(final Vector listeCmds) { + this.listeCmd = listeCmds; + } + + private static Options configParameters() { + + // request Vesion + final Option versionOption = + Option.builder("V") + .longOpt("Version") // + .desc("Return application version") + .hasArg(false) + .required(false) + .build(); + // List serial Port + final Option testserial = + Option.builder("S") + .longOpt("Serial?") // + .desc("List all serial port detected on the computeur ") + .hasArg(false) + .required(false) + .build(); + + final Option serialPort = + Option.builder("s") + .longOpt("SerialPort") // + .desc("Provide Serial port name (eg COM1 ") + .hasArg(true) + .required(false) + .build(); + // identify configuration file + final Option configurationFile = + Option.builder("C") + .longOpt("ModemConf") // + .desc("Modem configuration file ") + .hasArg(true) + .argName("InputFileModemConfiguration") + .required(false) + .build(); + // identify line file to send + final Option dataFile = + Option.builder("D") + .longOpt("ASCIIfile") // + .desc("data to send ASCII") + .hasArg(true) + .argName("InputFileModemData") + .required(false) + .build(); + final Option BinaryFile = + Option.builder("B") + .longOpt("HEXFile") // + .desc("data to send HEX ") + .hasArg(true) + .argName("InputFileModemDataHexa") + .required(false) + .build(); + + final Option helpFileOption = + Option.builder("h").longOpt("help").desc("display help message").build(); + + final Options options = new Options(); + + options.addOption(dataFile); + + options.addOption(configurationFile); + options.addOption(versionOption); + options.addOption(testserial); + options.addOption(helpFileOption); + options.addOption(serialPort); + options.addOption(BinaryFile); + + return options; + } + + private Vector interprete(CommandLine line, String[] args) { + + Vector cmdList = new Vector(); + ParameterSingleton parameter = ParameterSingleton.getInstance(); + + cmdList.add(new VersionCmd()); + if (line.hasOption("help")) { + parameter.setArg0(args[0]); + parameter.setOption(options); + cmdList.add(new HelpCmd()); + } + + if (line.hasOption("Version")) { + return cmdList; + } + + if (line.hasOption("Serial?")) { + cmdList.add(new SerialCmd()); + } + + if (line.hasOption("ASCIIfile")) { + + String confModemfile = line.getOptionValue("C"); + String dataModemfile = line.getOptionValue("D"); + String serialportModem = line.getOptionValue("s"); + serialportModem = ParameterSingleton.getInstance().getSerialport(); + + if (line.getOptionValue("s") != null) { + serialportModem = line.getOptionValue("s"); + ParameterSingleton.getInstance().setSerialport(serialportModem); + } + + SendCmd cmd = null; + + if (confModemfile == null) { + cmd = new SendCmd(serialportModem, dataModemfile); + } else { + cmd = new SendCmd(serialportModem, confModemfile, dataModemfile); + } + + cmdList.add(cmd); + } + // cas ou fichier binaire - + if (line.hasOption("HEXFile")) { + + ArrayList commandetnc = null; + String confModemfile = line.getOptionValue("C"); + if (confModemfile != null) { + commandetnc = readConfigFile(confModemfile); + } + + String dataHexModemfile = line.getOptionValue("B"); + ArrayList kissdata = readhexdata(dataHexModemfile); + + String serialportModem = ParameterSingleton.getInstance().getSerialport(); + + if (line.getOptionValue("s") != null) { + serialportModem = line.getOptionValue("s"); + ParameterSingleton.getInstance().setSerialport(serialportModem); + } + SendToTnc cmd = new SendToTnc(serialportModem, commandetnc, kissdata); + cmdList.add(cmd); + } + + return cmdList; + } + + private ArrayList readhexdata(String dataHexModemfile) { + ArrayList kissdata = new ArrayList(); + ReadFileHEX cmd = new ReadFileHEX(dataHexModemfile); + ArrayList cmds = cmd.getLines(); + String fromcalsign = ParameterSingleton.getInstance().getCallsignFrom(); + Callsign from = new Callsign(fromcalsign, (byte) 0X60); + String tocallsign = ParameterSingleton.getInstance().getCallsignto(); + Callsign to = new Callsign(tocallsign, (byte) 0xE2); + SimpleAX25frame simple = new SimpleAX25frame(from, to); + Kiss kiss = null; + for (int i = 0; i < cmds.size(); i++) { + byte[] ax25 = simple.encodeTrameUI(cmds.get(i)); + // System.out.println(TncKissType.bytesToHexString(ax25)); + try { + kiss = new Kiss((byte) 0, ax25); + } catch (KissException e) { + logger.severe(e.getMessage()); + } + byte[] kissFrame = kiss.getKiss(); + // creer UI + kis + kissdata.add(new TncKissType(kissFrame, kissFrame.length)); + } + return kissdata; + } + + public ArrayList readConfigFile(String confModemfile) { + ArrayList commande = new ArrayList(); + ReadFileLine cmd = new ReadFileLine(confModemfile); + ArrayList cmds = cmd.getLines(); + for (int i = 0; i < cmds.size(); i++) { + + commande.add(new TncCommandeType(cmds.get(i))); + } + return commande; + } } diff --git a/ApplicationSerial/src/main/java/org/josast/serialtoTNC/options/SendCmd.java b/ApplicationSerial/src/main/java/org/josast/serialtoTNC/options/SendCmd.java index bd1e5b232108489c5e61df3a006f90bbe90b7f5c..9c1b1070ce6e5f2ef80dd089f7a5067610eb168d 100644 --- a/ApplicationSerial/src/main/java/org/josast/serialtoTNC/options/SendCmd.java +++ b/ApplicationSerial/src/main/java/org/josast/serialtoTNC/options/SendCmd.java @@ -1,8 +1,10 @@ package org.josast.serialtoTNC.options; +import com.fazecast.jSerialComm.SerialPort; +import com.fazecast.jSerialComm.SerialPortDataListener; +import com.fazecast.jSerialComm.SerialPortEvent; import java.util.ArrayList; import java.util.logging.Logger; - import org.josast.serialtoTNC.ReadFileLine; import org.josast.serialtoTNC.serial.SerialConfiguration; import org.josast.serialtoTNC.serial.SerialPortDriver; @@ -10,110 +12,101 @@ import org.josast.serialtoTNC.type.TncCommandeType; import org.josast.serialtoTNC.type.TncDataType; import org.josast.serialtoTNC.type.TncLineType; -import com.fazecast.jSerialComm.SerialPort; -import com.fazecast.jSerialComm.SerialPortDataListener; -import com.fazecast.jSerialComm.SerialPortEvent; - public class SendCmd implements AppCmd { - private static Logger logger = Logger.getLogger("AmsatLogger"); - - public ArrayList commande = new ArrayList(); - private String confModemfile; - private String dataModemfile; - private SerialPort serp = null; - private String serialportModem = null; - private SerialPortDriver spd = new SerialPortDriver(); - - public SendCmd(String serialportModem, String confModemfile, String dataModemfile) { - this.confModemfile = confModemfile; - this.dataModemfile = dataModemfile; - this.serialportModem = serialportModem; - - } - - public SendCmd(String serialportModem, String dataModemfile) { - - this.dataModemfile = dataModemfile; - this.serialportModem = serialportModem; - } - - @Override - public void excute() { - - // chargement configuration - ReadFileLine cmd = new ReadFileLine(confModemfile); - ArrayList cmds = cmd.getLines(); - for (int i = 0; i < cmds.size(); i++) { - commande.add(new TncCommandeType(cmds.get(i))); - } - // chargement des message - ReadFileLine data = new ReadFileLine(dataModemfile); - ArrayList datas = data.getLines(); - for (int i = 0; i < datas.size(); i++) { - commande.add(new TncLineType(datas.get(i))); - } - - initSerialport(); - sendtotnc(); - serp.closePort(); - - } - - private void sendtotnc() { - for (int i = 0; i < commande.size(); i++) { - - TncDataType msg = commande.get(i); - msg.send(serp); - wait(1000); - } - - } - - private void initSerialport() { - - serp = spd.getSerialComNumber(serialportModem); - addListener(serp); - open(serp, new SerialConfiguration()); - } - - private void open(SerialPort sp, SerialConfiguration sc) { - - sp.setComPortParameters(sc.getBaudRate(), sc.getDataBits(), sc.getStopBits(), sc.getParity()); - if (sp.openPort() == true) { - logger.severe("Serial port open"); - - } else { - logger.severe("Serial port not open"); - - } - - } - - private void addListener(SerialPort sp) { - sp.addDataListener(new SerialPortDataListener() { - @Override - public int getListeningEvents() { - return SerialPort.LISTENING_EVENT_DATA_AVAILABLE; - } - - @Override - public void serialEvent(SerialPortEvent event) { - if (event.getEventType() != SerialPort.LISTENING_EVENT_DATA_AVAILABLE) - return; - byte[] newData = new byte[sp.bytesAvailable()]; - // int numRead = sp.readBytes(newData, newData.length); - String message = new String(newData); - System.out.print(message); - } - }); - } - - private static void wait(int ms) { - try { - Thread.sleep(ms); - } catch (InterruptedException ex) { - Thread.currentThread().interrupt(); - } - } + private static Logger logger = Logger.getLogger("AmsatLogger"); + + public ArrayList commande = new ArrayList(); + private String confModemfile; + private String dataModemfile; + private SerialPort serp = null; + private String serialportModem = null; + private SerialPortDriver spd = new SerialPortDriver(); + + public SendCmd(String serialportModem, String confModemfile, String dataModemfile) { + this.confModemfile = confModemfile; + this.dataModemfile = dataModemfile; + this.serialportModem = serialportModem; + } + + public SendCmd(String serialportModem, String dataModemfile) { + + this.dataModemfile = dataModemfile; + this.serialportModem = serialportModem; + } + + @Override + public void excute() { + + // chargement configuration + ReadFileLine cmd = new ReadFileLine(confModemfile); + ArrayList cmds = cmd.getLines(); + for (int i = 0; i < cmds.size(); i++) { + commande.add(new TncCommandeType(cmds.get(i))); + } + // chargement des message + ReadFileLine data = new ReadFileLine(dataModemfile); + ArrayList datas = data.getLines(); + for (int i = 0; i < datas.size(); i++) { + commande.add(new TncLineType(datas.get(i))); + } + + initSerialport(); + sendtotnc(); + serp.closePort(); + } + + private void sendtotnc() { + for (int i = 0; i < commande.size(); i++) { + + TncDataType msg = commande.get(i); + msg.send(serp); + wait(1000); + } + } + + private void initSerialport() { + + serp = spd.getSerialComNumber(serialportModem); + addListener(serp); + open(serp, new SerialConfiguration()); + } + + private void open(SerialPort sp, SerialConfiguration sc) { + + sp.setComPortParameters(sc.getBaudRate(), sc.getDataBits(), sc.getStopBits(), sc.getParity()); + if (sp.openPort() == true) { + logger.severe("Serial port open"); + + } else { + logger.severe("Serial port not open"); + } + } + + private void addListener(SerialPort sp) { + sp.addDataListener( + new SerialPortDataListener() { + @Override + public int getListeningEvents() { + return SerialPort.LISTENING_EVENT_DATA_AVAILABLE; + } + + @Override + public void serialEvent(SerialPortEvent event) { + if (event.getEventType() != SerialPort.LISTENING_EVENT_DATA_AVAILABLE) return; + byte[] newData = new byte[sp.bytesAvailable()]; + // int numRead = sp.readBytes(newData, newData.length); + String message = new String(newData); + System.out.print(message); + } + }); + } + + private static void wait(int ms) { + try { + Thread.sleep(ms); + } catch (InterruptedException ex) { + Thread.currentThread().interrupt(); + } + } } diff --git a/ApplicationSerial/src/main/java/org/josast/serialtoTNC/options/SendToTnc.java b/ApplicationSerial/src/main/java/org/josast/serialtoTNC/options/SendToTnc.java index 41e8f5cd66aadadd6e91a030b6d01645b7e26cc9..133a426e6e769d9d3f0247e8074825f40d8e1c44 100644 --- a/ApplicationSerial/src/main/java/org/josast/serialtoTNC/options/SendToTnc.java +++ b/ApplicationSerial/src/main/java/org/josast/serialtoTNC/options/SendToTnc.java @@ -1,67 +1,60 @@ package org.josast.serialtoTNC.options; +import com.fazecast.jSerialComm.SerialPort; import java.util.ArrayList; - import org.josast.serialtoTNC.ParameterSingleton; import org.josast.serialtoTNC.serial.SerialConfiguration; import org.josast.serialtoTNC.serial.SerialPortDriver; import org.josast.serialtoTNC.type.TncDataType; import org.josast.serialtoTNC.type.TncKissType; -import com.fazecast.jSerialComm.SerialPort; - -/** - * @author chris - * - */ +/** @author chris */ public class SendToTnc implements AppCmd { - SerialPortDriver sdp; - ArrayList commandetnc; - ArrayList kissdata; - - public SendToTnc(String serialportModem, ArrayList inCommandetnc, ArrayList inKissdata) { - sdp = new SerialPortDriver(); - - sdp.initSerialport(serialportModem, new SerialConfiguration()); - commandetnc = inCommandetnc; - kissdata = inKissdata; - - } - - /** - * - */ - @Override - public void excute() { - SerialPort serp = sdp.getSerialPort(); - ParameterSingleton ps = ParameterSingleton.getInstance(); - if (commandetnc != null) - { - for (int i = 0; i < commandetnc.size(); i++) { - - TncDataType msg = commandetnc.get(i); - msg.send(serp); - wait(ps.getDelayCmd()); - } - wait(2000); - } - for (int i = 0; i < kissdata.size(); i++) { - - TncDataType msg = kissdata.get(i); - System.out.println("Data"+msg.toString()); - msg.send(serp); - wait(ps.getDelayData()); - } - serp.closePort(); - } - - private static void wait(int ms) { - try { - Thread.sleep(ms); - } catch (InterruptedException ex) { - Thread.currentThread().interrupt(); - } - } - + SerialPortDriver sdp; + ArrayList commandetnc; + ArrayList kissdata; + + public SendToTnc( + String serialportModem, + ArrayList inCommandetnc, + ArrayList inKissdata) { + sdp = new SerialPortDriver(); + + sdp.initSerialport(serialportModem, new SerialConfiguration()); + commandetnc = inCommandetnc; + kissdata = inKissdata; + } + + /** */ + @Override + public void excute() { + SerialPort serp = sdp.getSerialPort(); + ParameterSingleton ps = ParameterSingleton.getInstance(); + if (commandetnc != null) { + for (int i = 0; i < commandetnc.size(); i++) { + + TncDataType msg = commandetnc.get(i); + msg.send(serp); + wait(ps.getDelayCmd()); + } + wait(2000); + } + for (int i = 0; i < kissdata.size(); i++) { + + TncDataType msg = kissdata.get(i); + System.out.println("Data" + msg.toString()); + msg.send(serp); + wait(ps.getDelayData()); + } + serp.closePort(); + } + + private static void wait(int ms) { + try { + Thread.sleep(ms); + } catch (InterruptedException ex) { + Thread.currentThread().interrupt(); + } + } } diff --git a/ApplicationSerial/src/main/java/org/josast/serialtoTNC/options/SerialCmd.java b/ApplicationSerial/src/main/java/org/josast/serialtoTNC/options/SerialCmd.java index 6d1a174e09a9930b9d8bacb76e3445235697f099..175d61eeb2f38593822b7f462f5469129e859438 100644 --- a/ApplicationSerial/src/main/java/org/josast/serialtoTNC/options/SerialCmd.java +++ b/ApplicationSerial/src/main/java/org/josast/serialtoTNC/options/SerialCmd.java @@ -1,27 +1,26 @@ package org.josast.serialtoTNC.options; import org.josast.serialtoTNC.serial.SerialPortDriver; + // -//import com.fazecast.jSerialComm.SerialPort; +// import com.fazecast.jSerialComm.SerialPort; public class SerialCmd implements AppCmd { - @Override - public void excute() { - - SerialPortDriver spd = new SerialPortDriver(); - spd.list(); - + @Override + public void excute() { -// SerialPort[] serialports = SerialPort.getCommPorts(); -// System.out.println("Number of serial port Deteted : " + serialports.length); -// if (serialports.length == 0) { -// System.out.println("No serial Port Found"); -// } else { -// for (int i = 0; i < serialports.length; i++) -// System.out.println(" Port : " + i + " " + serialports[i].getDescriptivePortName()); -// } + SerialPortDriver spd = new SerialPortDriver(); + spd.list(); - } + // SerialPort[] serialports = SerialPort.getCommPorts(); + // System.out.println("Number of serial port Deteted : " + serialports.length); + // if (serialports.length == 0) { + // System.out.println("No serial Port Found"); + // } else { + // for (int i = 0; i < serialports.length; i++) + // System.out.println(" Port : " + i + " " + serialports[i].getDescriptivePortName()); + // } + } } diff --git a/ApplicationSerial/src/main/java/org/josast/serialtoTNC/options/VersionCmd.java b/ApplicationSerial/src/main/java/org/josast/serialtoTNC/options/VersionCmd.java index c35550ca70c3c1f785241ae8898ac141dc590ed8..492ac88dade5adf951c9ab5b8bd5e515771c859e 100644 --- a/ApplicationSerial/src/main/java/org/josast/serialtoTNC/options/VersionCmd.java +++ b/ApplicationSerial/src/main/java/org/josast/serialtoTNC/options/VersionCmd.java @@ -4,17 +4,11 @@ import org.josast.serialtoTNC.ApplicationUVSQsatTNC; public class VersionCmd implements AppCmd { + String version = "0.5"; - String version = "0.5"; - - /** - * - */ - @Override - public void excute() { - System.out.println( ApplicationUVSQsatTNC.class.getSimpleName() + " Version : " + version); - } - - - + /** */ + @Override + public void excute() { + System.out.println(ApplicationUVSQsatTNC.class.getSimpleName() + " Version : " + version); + } } diff --git a/ApplicationSerial/src/main/java/org/josast/serialtoTNC/serial/SerialConfiguration.java b/ApplicationSerial/src/main/java/org/josast/serialtoTNC/serial/SerialConfiguration.java index e3354296b063ab649205c162e53102300f2f1663..4d3b4827035baf55b1e2b9ee9ac55e1b29635cac 100644 --- a/ApplicationSerial/src/main/java/org/josast/serialtoTNC/serial/SerialConfiguration.java +++ b/ApplicationSerial/src/main/java/org/josast/serialtoTNC/serial/SerialConfiguration.java @@ -4,31 +4,28 @@ import com.fazecast.jSerialComm.SerialPort; public class SerialConfiguration { - private int baudRate = 38400; - private int dataBits = 8 ; - private int parity = SerialPort.NO_PARITY; - private int stopByte = SerialPort.ONE_STOP_BIT; + private int baudRate = 38400; + private int dataBits = 8; + private int parity = SerialPort.NO_PARITY; + private int stopByte = SerialPort.ONE_STOP_BIT; - public int getStopBits() { - - return stopByte; - } + public int getStopBits() { - public int getParity() { + return stopByte; + } - return parity ; - } + public int getParity() { - public int getDataBits() { - - return dataBits; - } + return parity; + } - public int getBaudRate() { - - return baudRate ; - } - - + public int getDataBits() { + return dataBits; + } + + public int getBaudRate() { + + return baudRate; + } } diff --git a/ApplicationSerial/src/main/java/org/josast/serialtoTNC/serial/SerialPortDriver.java b/ApplicationSerial/src/main/java/org/josast/serialtoTNC/serial/SerialPortDriver.java index 5cf5a96d4b89dcf21629ad79b719df2f0db92004..a7b5cab7fbbffd8820b26ff3dcc91876928e4e4b 100644 --- a/ApplicationSerial/src/main/java/org/josast/serialtoTNC/serial/SerialPortDriver.java +++ b/ApplicationSerial/src/main/java/org/josast/serialtoTNC/serial/SerialPortDriver.java @@ -1,108 +1,105 @@ package org.josast.serialtoTNC.serial; -import java.util.logging.Logger; - import com.fazecast.jSerialComm.SerialPort; import com.fazecast.jSerialComm.SerialPortDataListener; import com.fazecast.jSerialComm.SerialPortEvent; +import java.util.logging.Logger; public class SerialPortDriver { - private static Logger logger = Logger.getLogger("AmsatLogger"); - private SerialPort serialPort = null; - - /** - * @return the serialPort - */ - public SerialPort getSerialPort() { - return serialPort; - } - - /** - * @param serialPort the serialPort to set - */ - public void setSerialPort(SerialPort serialPort) { - this.serialPort = serialPort; - } - - public void list() { - - SerialPort[] serialports = SerialPort.getCommPorts(); - System.out.println("Number of serial port Deteted : " + serialports.length); - if (serialports.length == 0) { - System.out.println("No serial Port Found"); - } else { - for (int i = 0; i < serialports.length; i++) - System.out.println(" Port : " + i + " " + serialports[i].getSystemPortName() + " - " - + serialports[i].getDescriptivePortName()); - } - - } - - public void open(SerialPort sp, SerialConfiguration sc) { - - sp.setComPortParameters(sc.getBaudRate(), sc.getDataBits(), sc.getStopBits(), sc.getParity()); - if (sp.openPort() == true) { - System.out.println("Serial port open"); - } else { - System.out.println("Serial port not open"); - } - - } - - private void addListener(SerialPort sp) { - sp.addDataListener(new SerialPortDataListener() { - @Override - public int getListeningEvents() { - return SerialPort.LISTENING_EVENT_DATA_AVAILABLE; - } - - @Override - public void serialEvent(SerialPortEvent event) { - if (event.getEventType() != SerialPort.LISTENING_EVENT_DATA_AVAILABLE) - return; - byte[] newData = new byte[sp.bytesAvailable()]; - sp.readBytes(newData, newData.length); - String message = new String(newData); - System.out.print(message); - } - }); - } - - public SerialPort getSerialComNumber(String systemPortname) { - SerialPort[] serialports = SerialPort.getCommPorts(); - - boolean found = false; - int i = 0; - if(serialports.length==0) - { - logger.severe("index " + systemPortname + " no serial port available " + serialports.length); - System.err.println("No serial Port found"); - System.exit(-1); - } - while (found == false) { - if (serialports[i].getSystemPortName().contains(systemPortname)) { - serialPort = serialports[i]; - found = true; - } - i++; - if (i > serialports.length) { - logger.severe("index " + systemPortname + " greater than number of serial port available" - + serialports.length); - System.err.println("Port not found"); - System.exit(-1); - - } - - } - return serialPort; - } - - public void initSerialport(String serialportModem, SerialConfiguration sc) { - - serialPort = getSerialComNumber(serialportModem); - addListener(serialPort); - open(serialPort, new SerialConfiguration()); - } - + private static Logger logger = Logger.getLogger("AmsatLogger"); + private SerialPort serialPort = null; + + /** @return the serialPort */ + public SerialPort getSerialPort() { + return serialPort; + } + + /** @param serialPort the serialPort to set */ + public void setSerialPort(SerialPort serialPort) { + this.serialPort = serialPort; + } + + public void list() { + + SerialPort[] serialports = SerialPort.getCommPorts(); + System.out.println("Number of serial port Deteted : " + serialports.length); + if (serialports.length == 0) { + System.out.println("No serial Port Found"); + } else { + for (int i = 0; i < serialports.length; i++) + System.out.println( + " Port : " + + i + + " " + + serialports[i].getSystemPortName() + + " - " + + serialports[i].getDescriptivePortName()); + } + } + + public void open(SerialPort sp, SerialConfiguration sc) { + + sp.setComPortParameters(sc.getBaudRate(), sc.getDataBits(), sc.getStopBits(), sc.getParity()); + if (sp.openPort() == true) { + System.out.println("Serial port open"); + } else { + System.out.println("Serial port not open"); + } + } + + private void addListener(SerialPort sp) { + sp.addDataListener( + new SerialPortDataListener() { + @Override + public int getListeningEvents() { + return SerialPort.LISTENING_EVENT_DATA_AVAILABLE; + } + + @Override + public void serialEvent(SerialPortEvent event) { + if (event.getEventType() != SerialPort.LISTENING_EVENT_DATA_AVAILABLE) return; + byte[] newData = new byte[sp.bytesAvailable()]; + sp.readBytes(newData, newData.length); + String message = new String(newData); + System.out.print(message); + } + }); + } + + public SerialPort getSerialComNumber(String systemPortname) { + SerialPort[] serialports = SerialPort.getCommPorts(); + + boolean found = false; + int i = 0; + if (serialports.length == 0) { + logger.severe("index " + systemPortname + " no serial port available " + serialports.length); + System.err.println("No serial Port found"); + System.exit(-1); + } + while (found == false) { + if (serialports[i].getSystemPortName().contains(systemPortname)) { + serialPort = serialports[i]; + found = true; + } + i++; + if (i > serialports.length) { + logger.severe( + "index " + + systemPortname + + " greater than number of serial port available" + + serialports.length); + System.err.println("Port not found"); + System.exit(-1); + } + } + return serialPort; + } + + public void initSerialport(String serialportModem, SerialConfiguration sc) { + + serialPort = getSerialComNumber(serialportModem); + addListener(serialPort); + open(serialPort, new SerialConfiguration()); + } } diff --git a/ApplicationSerial/src/main/java/org/josast/serialtoTNC/type/TncCommandeType.java b/ApplicationSerial/src/main/java/org/josast/serialtoTNC/type/TncCommandeType.java index b79b80acfe3e188edb0dbc688fd0f4767b95bc5d..4a79348f2b7046e74c844c83990ced85226617e8 100644 --- a/ApplicationSerial/src/main/java/org/josast/serialtoTNC/type/TncCommandeType.java +++ b/ApplicationSerial/src/main/java/org/josast/serialtoTNC/type/TncCommandeType.java @@ -1,43 +1,34 @@ -/** - * - */ +/** */ package org.josast.serialtoTNC.type; +import com.fazecast.jSerialComm.SerialPort; import java.util.logging.Logger; - import org.josast.serialtoTNC.ASCII; -import com.fazecast.jSerialComm.SerialPort; - -/** - * @author chris - * - */ +/** @author chris */ public class TncCommandeType implements TncDataType { - private static Logger logger = Logger.getLogger("AmsatLogger"); - - private String commande; + private static Logger logger = Logger.getLogger("AmsatLogger"); + + private String commande; + + public TncCommandeType(String value) { + logger.info(value); + commande = value; + } - public TncCommandeType ( String value) - { - logger.info(value); - commande = value; - } - @Override - public void send(SerialPort serialPort) { - byte commandes [] = new byte[255]; - - byte[] valueB = commande.getBytes(); - commandes[0] = ASCII.ESC; - int i=0; - for(i=0; i < valueB.length;i++) - { - commandes [i+1]= valueB[i]; - } - commandes[i+1] = ASCII.CR; - System.out.println("\r\n Commande sent : " + new String(valueB)); - serialPort.writeBytes(commandes, i+2); - } + @Override + public void send(SerialPort serialPort) { + byte commandes[] = new byte[255]; + byte[] valueB = commande.getBytes(); + commandes[0] = ASCII.ESC; + int i = 0; + for (i = 0; i < valueB.length; i++) { + commandes[i + 1] = valueB[i]; + } + commandes[i + 1] = ASCII.CR; + System.out.println("\r\n Commande sent : " + new String(valueB)); + serialPort.writeBytes(commandes, i + 2); + } } diff --git a/ApplicationSerial/src/main/java/org/josast/serialtoTNC/type/TncDataType.java b/ApplicationSerial/src/main/java/org/josast/serialtoTNC/type/TncDataType.java index 24f96394385d7314daedd83a41d96db22cb80cf3..e2ad55f657aab684b6ab2dd48a2398d8065038f6 100644 --- a/ApplicationSerial/src/main/java/org/josast/serialtoTNC/type/TncDataType.java +++ b/ApplicationSerial/src/main/java/org/josast/serialtoTNC/type/TncDataType.java @@ -3,9 +3,6 @@ package org.josast.serialtoTNC.type; import com.fazecast.jSerialComm.SerialPort; public interface TncDataType { - - public void send(SerialPort serialPort); - - + public void send(SerialPort serialPort); } diff --git a/ApplicationSerial/src/main/java/org/josast/serialtoTNC/type/TncKissType.java b/ApplicationSerial/src/main/java/org/josast/serialtoTNC/type/TncKissType.java index b906d60cbfbd9f7abfdf24b0a5721fc3e4888971..bfc06c35cdb7d918706150c9c73fc17c2897ec17 100644 --- a/ApplicationSerial/src/main/java/org/josast/serialtoTNC/type/TncKissType.java +++ b/ApplicationSerial/src/main/java/org/josast/serialtoTNC/type/TncKissType.java @@ -1,34 +1,30 @@ package org.josast.serialtoTNC.type; -import java.util.logging.Logger; - import com.fazecast.jSerialComm.SerialPort; +import java.util.logging.Logger; public class TncKissType implements TncDataType { - private static Logger logger = Logger.getLogger("AmsatLogger"); - private long size; - private byte[] kiss; - - public TncKissType(byte[] kissData, int KissDatasize) { - kiss = kissData; - size = KissDatasize; - - } - - @Override - public void send(SerialPort serialPort) { - logger.info(bytesToHexString(kiss)); - serialPort.writeBytes(kiss, size); - - } - - public static String bytesToHexString(byte[] bytes) { - StringBuilder sb = new StringBuilder(); - for (byte b : bytes) { - sb.append(String.format("%02x", b & 0xff)); - } - return sb.toString(); - } - + private static Logger logger = Logger.getLogger("AmsatLogger"); + private long size; + private byte[] kiss; + + public TncKissType(byte[] kissData, int KissDatasize) { + kiss = kissData; + size = KissDatasize; + } + + @Override + public void send(SerialPort serialPort) { + logger.info(bytesToHexString(kiss)); + serialPort.writeBytes(kiss, size); + } + + public static String bytesToHexString(byte[] bytes) { + StringBuilder sb = new StringBuilder(); + for (byte b : bytes) { + sb.append(String.format("%02x", b & 0xff)); + } + return sb.toString(); + } } diff --git a/ApplicationSerial/src/main/java/org/josast/serialtoTNC/type/TncLineType.java b/ApplicationSerial/src/main/java/org/josast/serialtoTNC/type/TncLineType.java index 103109e94ebc00a14c4a94dc61227e6768a27d19..4e9311b0435d8b60df70cecba9e0836cf45156a4 100644 --- a/ApplicationSerial/src/main/java/org/josast/serialtoTNC/type/TncLineType.java +++ b/ApplicationSerial/src/main/java/org/josast/serialtoTNC/type/TncLineType.java @@ -1,35 +1,29 @@ package org.josast.serialtoTNC.type; -import org.josast.serialtoTNC.ASCII; - import com.fazecast.jSerialComm.SerialPort; +import org.josast.serialtoTNC.ASCII; public class TncLineType implements TncDataType { - - - private String data; - - public TncLineType ( String value) - { - - data = value; - } - - @Override - public void send(SerialPort serialPort) { - byte commande [] = new byte[255]; - - byte[] valueB = data.getBytes(); - - int i=0; - for(i=0; i < data.length();i++) - { - commande [i]= valueB[i]; - } - commande[i] = ASCII.CR; - - serialPort.writeBytes(commande, i+1); - - } + private String data; + + public TncLineType(String value) { + + data = value; + } + + @Override + public void send(SerialPort serialPort) { + byte commande[] = new byte[255]; + + byte[] valueB = data.getBytes(); + + int i = 0; + for (i = 0; i < data.length(); i++) { + commande[i] = valueB[i]; + } + commande[i] = ASCII.CR; + + serialPort.writeBytes(commande, i + 1); + } } diff --git a/ApplicationSerial/src/test/java/org/josast/serialtoTNC/ReadFileHEXTest.java b/ApplicationSerial/src/test/java/org/josast/serialtoTNC/ReadFileHEXTest.java index b7ff24d4ba4ada4370125962d67ed165b875ac18..6a00aef1a28d812e2c5cdeb722a2ebb1af487d44 100644 --- a/ApplicationSerial/src/test/java/org/josast/serialtoTNC/ReadFileHEXTest.java +++ b/ApplicationSerial/src/test/java/org/josast/serialtoTNC/ReadFileHEXTest.java @@ -1,54 +1,47 @@ package org.josast.serialtoTNC; import java.util.ArrayList; - import junit.framework.Assert; import junit.framework.TestCase; public class ReadFileHEXTest extends TestCase { - protected void setUp() throws Exception { - super.setUp(); - } - - protected void tearDown() throws Exception { - super.tearDown(); - } - - public void testReadFileHEX() { - ReadFileHEX rfh = new ReadFileHEX ("HELLO-UVSQSAT.txt"); - ArrayList listHex = rfh.getLines(); - byte[] data = {0x48,0x45,0x4C,0x4C,0x4F,0x20,0x55,0x56,0x53,0x51,0x53,0x41,0x54}; - Assert.assertEquals(listHex.size(),1); - - for(int i=0;i listHex = rfh.getLines(); + byte[] data = {0x48, 0x45, 0x4C, 0x4C, 0x4F, 0x20, 0x55, 0x56, 0x53, 0x51, 0x53, 0x41, 0x54}; + Assert.assertEquals(listHex.size(), 1); + + for (int i = 0; i < data.length; i++) { + + Assert.assertEquals(data[i], listHex.get(0)[i]); + } + } + + public void testAsciiTohex() { + String test = "0001"; + String test2 = "00 01"; + String test3 = "000A"; + String test4 = "00 0a"; + byte[] res = {0, 1}; + byte[] res2 = {0, 10}; + ReadFileHEX rfh = new ReadFileHEX(); + byte[] decode = rfh.asciiTohex(test); + for (int i = 0; i < decode.length; i++) Assert.assertEquals(res[i], decode[i]); + decode = rfh.asciiTohex(test2); + for (int i = 0; i < decode.length; i++) Assert.assertEquals(res[i], decode[i]); + decode = rfh.asciiTohex(test3); + for (int i = 0; i < decode.length; i++) Assert.assertEquals(res2[i], decode[i]); + decode = rfh.asciiTohex(test4); + for (int i = 0; i < decode.length; i++) Assert.assertEquals(res2[i], decode[i]); + // fail("Not yet implemented"); + } } diff --git a/ApplicationSerial/src/test/java/org/josast/serialtoTNC/kiss/KissTest.java b/ApplicationSerial/src/test/java/org/josast/serialtoTNC/kiss/KissTest.java index c85beb6b77a2cdee8954b965e459dbadc8cdea4d..e676cb09f60a9aef24b4ef41bd1a66fd5b19bc70 100644 --- a/ApplicationSerial/src/test/java/org/josast/serialtoTNC/kiss/KissTest.java +++ b/ApplicationSerial/src/test/java/org/josast/serialtoTNC/kiss/KissTest.java @@ -1,72 +1,169 @@ package org.josast.serialtoTNC.kiss; -import org.josast.serialtoTNC.AX25simple.Callsign; -import org.josast.serialtoTNC.AX25simple.SimpleAX25frame; - import junit.framework.Assert; import junit.framework.TestCase; +import org.josast.serialtoTNC.AX25simple.Callsign; +import org.josast.serialtoTNC.AX25simple.SimpleAX25frame; public class KissTest extends TestCase { - protected void setUp() throws Exception { - super.setUp(); - } + protected void setUp() throws Exception { + super.setUp(); + } + + protected void tearDown() throws Exception { + super.tearDown(); + } - protected void tearDown() throws Exception { - super.tearDown(); - } + public void testGetKiss() { + Callsign from = new Callsign("LATMOS", (byte) 0X60); + Callsign to = new Callsign("LATMOS", (byte) 0xE2); - public void testGetKiss() { - Callsign from = new Callsign("LATMOS",(byte)0X60); - Callsign to = new Callsign("LATMOS",(byte)0xE2); - - SimpleAX25frame simple = new SimpleAX25frame(from,to); - - // test trame dans caractére Escape - byte[] data = {0x48,0x45,0x4C,0x4C,0x4F,0x20,0x55,0x56,0x53,0x51,0x53,0x41,0x54}; - Kiss kissframe =null; - - byte[] ax25 = simple.encodeTrameUI(data); + SimpleAX25frame simple = new SimpleAX25frame(from, to); + + // test trame dans caractére Escape + byte[] data = {0x48, 0x45, 0x4C, 0x4C, 0x4F, 0x20, 0x55, 0x56, 0x53, 0x51, 0x53, 0x41, 0x54}; + Kiss kissframe = null; + + byte[] ax25 = simple.encodeTrameUI(data); // Assert.assertEquals(ax25.length, 0); - try { - kissframe = new Kiss((byte)0, ax25); - } catch (KissException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - byte[] kissFr = kissframe.getKiss(); - byte[] results = {(byte)0xC0,0X00,0X4C,0X41,0X54,0X4D,0X4F,0X53,0X60,0X4C,0X41,0X54,0X4D,0X4F,0X53,(byte)0XE2,0X03,(byte) 0XF0,0X48,0X45,0X4C,0X4C,0X4F,0X20,0X55,0X56,0X53,0X51,0X53,0X41,0X54,(byte)0XC0}; - Assert.assertEquals(results.length, kissFr.length); - for(int i=0;i org.openjfx javafx-maven-plugin - 0.0.5 + 0.0.8 org.josast.UVSQsatDecoder.App diff --git a/ApplicationUVSQsatDecoder/src/main/java/org/josast/UVSQsatDecoder/App.java b/ApplicationUVSQsatDecoder/src/main/java/org/josast/UVSQsatDecoder/App.java index 87955c3978cdf93f82ac68d8a78b76b4efae166c..9b826d317ef70c9015916fb6a4348ff7053b1256 100644 --- a/ApplicationUVSQsatDecoder/src/main/java/org/josast/UVSQsatDecoder/App.java +++ b/ApplicationUVSQsatDecoder/src/main/java/org/josast/UVSQsatDecoder/App.java @@ -1,5 +1,10 @@ package org.josast.UVSQsatDecoder; +import java.io.File; +import java.io.IOException; +import java.util.logging.FileHandler; +import java.util.logging.Handler; +import java.util.logging.Logger; import javafx.application.Application; import javafx.application.Platform; import javafx.event.EventHandler; @@ -10,83 +15,73 @@ import javafx.scene.image.Image; import javafx.stage.Stage; import javafx.stage.WindowEvent; -import java.io.File; -import java.io.IOException; -import java.util.logging.FileHandler; -import java.util.logging.Handler; -import java.util.logging.Logger; - -/** - * JavaFX App - */ +/** JavaFX App */ public class App extends Application { - private static Scene scene; - private static FXMLLoader fxmlLoader; - private static Logger logger = Logger.getLogger("AmsatLogger"); + private static Scene scene; + private static FXMLLoader fxmlLoader; + private static Logger logger = Logger.getLogger("AmsatLogger"); + + @Override + public void start(Stage stage) throws IOException { - @Override - public void start(Stage stage) throws IOException { - - System.setProperty("glass.accessible.force", "false"); - scene = new Scene(loadFXML("UVSQsat"), 800, 600); - stage.setScene(scene); - stage.setOnCloseRequest(new EventHandler() { - @Override - public void handle(WindowEvent event) { - Platform.exit(); - System.exit(0); - } + System.setProperty("glass.accessible.force", "false"); + scene = new Scene(loadFXML("UVSQsat"), 800, 600); + stage.setScene(scene); + stage.setOnCloseRequest( + new EventHandler() { + @Override + public void handle(WindowEvent event) { + Platform.exit(); + System.exit(0); + } }); - Controler ctrl = fxmlLoader.getController(); - ctrl.setPrimaryStage(stage); - scene.getStylesheets().add(this.getClass().getResource("boot.css").toExternalForm()); - stage.setTitle("UVSQsat Decoder - "+ctrl.getversion()); - stage.getIcons().add(new Image(App.class.getResourceAsStream("OIP.jpg"))); - ctrl.initMMI(); - stage.show(); - } + Controler ctrl = fxmlLoader.getController(); + ctrl.setPrimaryStage(stage); + scene.getStylesheets().add(this.getClass().getResource("boot.css").toExternalForm()); + stage.setTitle("UVSQsat Decoder - " + ctrl.getversion()); + stage.getIcons().add(new Image(App.class.getResourceAsStream("OIP.jpg"))); + ctrl.initMMI(); + stage.show(); + } - static void setRoot(String fxml) throws IOException { - scene.setRoot(loadFXML(fxml)); - } + static void setRoot(String fxml) throws IOException { + scene.setRoot(loadFXML(fxml)); + } - private static Parent loadFXML(String fxml) throws IOException { - fxmlLoader = new FXMLLoader(App.class.getResource(fxml + ".fxml")); - logger.info("class "+App.class.getResource(fxml + ".fxml").getFile().toString()); - return fxmlLoader.load(); - } - + private static Parent loadFXML(String fxml) throws IOException { + fxmlLoader = new FXMLLoader(App.class.getResource(fxml + ".fxml")); + logger.info("class " + App.class.getResource(fxml + ".fxml").getFile().toString()); + return fxmlLoader.load(); + } - public static void main(String[] args) { - // initialisation du systéme de log en premier - try { - String path = System.getProperty("user.dir") + "/log"; - File apath = new File(path); + public static void main(String[] args) { + // initialisation du systéme de log en premier + try { + String path = System.getProperty("user.dir") + "/log"; + File apath = new File(path); - if (!apath.exists()) { - if (apath.mkdir() == false) { - logger.severe("fail to create " + path); - } - } - FileHandler fh = new FileHandler(path + "/" + "UVSQsat.log"); - logger.setUseParentHandlers(false); - Handler[] handlers = logger.getHandlers(); - for (Handler handler : handlers) { - logger.removeHandler(handler); - } - logger.addHandler(fh); - - } catch (SecurityException e) { + if (!apath.exists()) { + if (apath.mkdir() == false) { + logger.severe("fail to create " + path); + } + } + FileHandler fh = new FileHandler(path + "/" + "UVSQsat.log"); + logger.setUseParentHandlers(false); + Handler[] handlers = logger.getHandlers(); + for (Handler handler : handlers) { + logger.removeHandler(handler); + } + logger.addHandler(fh); - e.printStackTrace(); + } catch (SecurityException e) { - } catch (IOException e) { + e.printStackTrace(); - e.printStackTrace(); + } catch (IOException e) { - } - launch(); + e.printStackTrace(); } - -} \ No newline at end of file + launch(); + } +} diff --git a/ApplicationUVSQsatDecoder/src/main/java/org/josast/UVSQsatDecoder/Ax25Display.java b/ApplicationUVSQsatDecoder/src/main/java/org/josast/UVSQsatDecoder/Ax25Display.java index eb53e7365a95d86dfdc4ae19369174842c36a0af..21d2699d6bb18dc54f11ea7b55ca829f9ed9b24c 100644 --- a/ApplicationUVSQsatDecoder/src/main/java/org/josast/UVSQsatDecoder/Ax25Display.java +++ b/ApplicationUVSQsatDecoder/src/main/java/org/josast/UVSQsatDecoder/Ax25Display.java @@ -2,49 +2,39 @@ package org.josast.UVSQsatDecoder; import org.josast.AX25.AX25DecodedData; -/** - * @author chris - * - * - */ +/** @author chris */ -//@TODO Refactor this class with AX25DecodedData +// @TODO Refactor this class with AX25DecodedData public class Ax25Display { - ReceivedData decodedData = null; - AX25DecodedData ax25 = null; + ReceivedData decodedData = null; + AX25DecodedData ax25 = null; - public String getDisplay() { - StringBuffer sb = new StringBuffer(); + public String getDisplay() { + StringBuffer sb = new StringBuffer(); - sb.append("\r\n"); - sb.append(decodedData.getTime().toString()); - sb.append(ax25.toStringHeader()); - sb.append(ax25.toStringData()); - sb.append("\r\n"); - return sb.toString(); - } + sb.append("\r\n"); + sb.append(decodedData.getTime().toString()); + sb.append(ax25.toStringHeader()); + sb.append(ax25.toStringData()); + sb.append("\r\n"); + return sb.toString(); + } - public void setdata(ReceivedData decodedData2) { - this.decodedData = decodedData2; - ax25 = new AX25DecodedData(decodedData.getData()); + public void setdata(ReceivedData decodedData2) { + this.decodedData = decodedData2; + ax25 = new AX25DecodedData(decodedData.getData()); + } - } + /** @return AX25 data */ + public String getAx25Data() { + return ax25.toString(); + } - /** - * @return AX25 data - */ - public String getAx25Data() { - return ax25.toString(); - } - - /** - * @return Callsign - */ - public String GetCallsignFrom() { - - return ax25.source; - } + /** @return Callsign */ + public String GetCallsignFrom() { + return ax25.source; + } } diff --git a/ApplicationUVSQsatDecoder/src/main/java/org/josast/UVSQsatDecoder/Configuration.java b/ApplicationUVSQsatDecoder/src/main/java/org/josast/UVSQsatDecoder/Configuration.java index dd82747b2ad73316903eea97459b539d77de1535..baaa8f5c7a56477b4dfa40ccc36d3fb1aed5deb0 100644 --- a/ApplicationUVSQsatDecoder/src/main/java/org/josast/UVSQsatDecoder/Configuration.java +++ b/ApplicationUVSQsatDecoder/src/main/java/org/josast/UVSQsatDecoder/Configuration.java @@ -1,245 +1,211 @@ -/** - * - */ +/** */ package org.josast.UVSQsatDecoder; import org.josast.property.CONFIG; /** - * Singleton to manage all application parameter - * The default configuration is automaticaly saved in a properties file. + * Singleton to manage all application parameter The default configuration is automaticaly saved in + * a properties file. + * * @author christophe - * - * */ public class Configuration { - - - /* - * parameter with default value - */ - private String callsign="Anonymous"; - private String longitude="0.0W"; - private String latitude="0.0N"; - - private String soundModemIP="127.0.0.1"; - private String soundModemPort="8100"; - - private String SIDSAMSATSource="Anonymous"; - private String SIDSAMSATUrl="https://amsat.electrolab.fr/api/V2/SIDS"; - private String SIDSSatnogsSource="Anonymous"; - private String SIDSSatnogsURL="https://db.satnogs.org/api/telemetry/"; - private String SIDSSatnogs="0"; - private String SIDSAMSAT="1"; - private int Norad=99760; // default value - equivalent to satnogs - private boolean SISD_SatNogs = false; - private boolean SIDS_AMSAT = true; - - - private CONFIG conf = CONFIG.getInstance(); - - public static Configuration getInstance() - { - return SingletonHolder.instance; - } - - public boolean isSISD_SatNogs() { - - return SISD_SatNogs; - } - - - private Configuration() + /* + * parameter with default value + */ + private String callsign = "Anonymous"; + private String longitude = "0.0W"; + private String latitude = "0.0N"; + + private String soundModemIP = "127.0.0.1"; + private String soundModemPort = "8100"; + + private String SIDSAMSATSource = "Anonymous"; + private String SIDSAMSATUrl = "https://amsat.electrolab.fr/api/V2/SIDS"; + private String SIDSSatnogsSource = "Anonymous"; + private String SIDSSatnogsURL = "https://db.satnogs.org/api/telemetry/"; + private String SIDSSatnogs = "0"; + private String SIDSAMSAT = "1"; + private int Norad = 99760; // default value - equivalent to satnogs + private boolean SISD_SatNogs = false; + private boolean SIDS_AMSAT = true; + + private CONFIG conf = CONFIG.getInstance(); + + public static Configuration getInstance() { + return SingletonHolder.instance; + } + + public boolean isSISD_SatNogs() { + + return SISD_SatNogs; + } + + private Configuration() { + if (conf.getProperty("Callsign") != null) { + callsign = conf.getProperty("Callsign"); + latitude = conf.getProperty("Latitude"); + longitude = conf.getProperty("Longitude"); + + SIDSAMSATSource = conf.getProperty("SIDSAMSATSource"); + SIDSAMSATUrl = conf.getProperty("SIDSAMSATUrl"); + SIDSSatnogsSource = conf.getProperty("SIDSSatnogsSource"); + SIDSSatnogsURL = conf.getProperty("SIDSSatnogsURL"); + SIDSSatnogs = conf.getProperty("SIDSSatnogs"); + SIDSAMSAT = conf.getProperty("SIDSAMSAT"); + soundModemIP = conf.getProperty("soundModemIP"); + soundModemPort = conf.getProperty("soundModemPort"); + Norad = Integer.parseUnsignedInt(conf.getProperty("NoradID").trim()); + if (SIDSSatnogs.contentEquals("1")) { + SISD_SatNogs = true; + } else { + SISD_SatNogs = false; + } + if (SIDSAMSAT.contentEquals("1")) { + SIDS_AMSAT = true; + } else { + SIDS_AMSAT = false; + } + + } else // si le fichier n'existe pas, il est créé par défaut { - if ( conf.getProperty("Callsign")!=null) - { - callsign = conf.getProperty("Callsign"); - latitude = conf.getProperty("Latitude"); - longitude = conf.getProperty("Longitude"); - - SIDSAMSATSource=conf.getProperty("SIDSAMSATSource"); - SIDSAMSATUrl=conf.getProperty("SIDSAMSATUrl"); - SIDSSatnogsSource=conf.getProperty("SIDSSatnogsSource"); - SIDSSatnogsURL=conf.getProperty("SIDSSatnogsURL"); - SIDSSatnogs=conf.getProperty("SIDSSatnogs"); - SIDSAMSAT=conf.getProperty("SIDSAMSAT"); - soundModemIP = conf.getProperty("soundModemIP"); - soundModemPort = conf.getProperty("soundModemPort"); - Norad = Integer.parseUnsignedInt(conf.getProperty("NoradID").trim()); - if (SIDSSatnogs.contentEquals("1") ) - { - SISD_SatNogs=true; - } else - { - SISD_SatNogs=false; - } - if (SIDSAMSAT.contentEquals("1") ) - { - SIDS_AMSAT=true; - } else - { - SIDS_AMSAT=false; - } - - } - else // si le fichier n'existe pas, il est créé par défaut - { - save(); - } - - - } - - - private static class SingletonHolder - { - - private final static Configuration instance = new Configuration(); - } - - - - - public void setSIDSSatnogs(String sIDSSatnogs) { - SIDSSatnogs = sIDSSatnogs; - if (SIDSSatnogs.contentEquals("1") ) - { - SISD_SatNogs=true; - } else - { - SISD_SatNogs=false; - } - } - - - public void setSIDSAMSAT(String sIDSEntrySat) { - SIDSAMSAT = sIDSEntrySat; - if (SIDSAMSAT.contentEquals("1") ) - { - SIDS_AMSAT=true; - } else - { - SIDS_AMSAT=false; - } - } - - - public void save() { - - conf.setProperty("Callsign",callsign); - conf.setProperty("Latitude",latitude); - conf.setProperty("Longitude",longitude); - conf.setProperty("SIDSAMSATSource",this.SIDSAMSATSource); - conf.setProperty("SIDSAMSATUrl",this.SIDSAMSATUrl); - conf.setProperty("SIDSSatnogsSource",this.SIDSSatnogsSource); - conf.setProperty("SIDSSatnogsURL",this.SIDSSatnogsURL); - conf.setProperty("SIDSSatnogs",this.SIDSSatnogs); - conf.setProperty("SIDSAMSAT",this.SIDSAMSAT); - conf.setProperty("soundModemPort",this.soundModemPort); - conf.setProperty("soundModemIP",this.soundModemIP); - conf.setProperty("NoradID",""+this.Norad); - - } - - public String getCallsign() { - return callsign; - } - - public void setCallsign(String callsign) { - this.callsign = callsign; - } - - public String getLongitude() { - return longitude; - } - - public void setLongitude(String longitude) { - this.longitude = longitude; - } - - public String getLatitude() { - return latitude; - } - - public void setLatitude(String latitude) { - this.latitude = latitude; - } - - public String getSoundModemIP() { - return soundModemIP; - } - - public void setSoundModemIP(String soundModemIP) { - this.soundModemIP = soundModemIP; - } - - public String getSoundModemPort() { - return soundModemPort; - } - - public void setSoundModemPort(String soundModemPort) { - this.soundModemPort = soundModemPort; - } - - public String getSIDSAMSATSource() { - return SIDSAMSATSource; - } - - public void setSIDSAMSATSource(String sIDSAMSATSource) { - SIDSAMSATSource = sIDSAMSATSource; - } - - public String getSIDSAMSATUrl() { - return SIDSAMSATUrl; - } - - public void setSIDSAMSATUrl(String sIDSAMSATUrl) { - SIDSAMSATUrl = sIDSAMSATUrl; - } - - public String getSIDSSatnogsSource() { - return SIDSSatnogsSource; - } - - public void setSIDSSatnogsSource(String sIDSSatnogsSource) { - SIDSSatnogsSource = sIDSSatnogsSource; - } - - public String getSIDSSatnogsURL() { - return SIDSSatnogsURL; - } - - public void setSIDSSatnogsURL(String sIDSSatnogsURL) { - SIDSSatnogsURL = sIDSSatnogsURL; - } - - public int getNorad() { - return Norad; - } - - public void setNorad(int norad) { - Norad = norad; - } - - public boolean isSIDS_AMSAT() { - return SIDS_AMSAT; - } - - - - public CONFIG getConf() { - return conf; - } - - public void setConf(CONFIG conf) { - this.conf = conf; - } - - public void setSISD_SatNogs(boolean sISD_SatNogs) { - SISD_SatNogs = sISD_SatNogs; - } - - + save(); + } + } + + private static class SingletonHolder { + + private static final Configuration instance = new Configuration(); + } + + public void setSIDSSatnogs(String sIDSSatnogs) { + SIDSSatnogs = sIDSSatnogs; + if (SIDSSatnogs.contentEquals("1")) { + SISD_SatNogs = true; + } else { + SISD_SatNogs = false; + } + } + + public void setSIDSAMSAT(String sIDSEntrySat) { + SIDSAMSAT = sIDSEntrySat; + if (SIDSAMSAT.contentEquals("1")) { + SIDS_AMSAT = true; + } else { + SIDS_AMSAT = false; + } + } + public void save() { + + conf.setProperty("Callsign", callsign); + conf.setProperty("Latitude", latitude); + conf.setProperty("Longitude", longitude); + conf.setProperty("SIDSAMSATSource", this.SIDSAMSATSource); + conf.setProperty("SIDSAMSATUrl", this.SIDSAMSATUrl); + conf.setProperty("SIDSSatnogsSource", this.SIDSSatnogsSource); + conf.setProperty("SIDSSatnogsURL", this.SIDSSatnogsURL); + conf.setProperty("SIDSSatnogs", this.SIDSSatnogs); + conf.setProperty("SIDSAMSAT", this.SIDSAMSAT); + conf.setProperty("soundModemPort", this.soundModemPort); + conf.setProperty("soundModemIP", this.soundModemIP); + conf.setProperty("NoradID", "" + this.Norad); + } + + public String getCallsign() { + return callsign; + } + + public void setCallsign(String callsign) { + this.callsign = callsign; + } + + public String getLongitude() { + return longitude; + } + + public void setLongitude(String longitude) { + this.longitude = longitude; + } + + public String getLatitude() { + return latitude; + } + + public void setLatitude(String latitude) { + this.latitude = latitude; + } + + public String getSoundModemIP() { + return soundModemIP; + } + + public void setSoundModemIP(String soundModemIP) { + this.soundModemIP = soundModemIP; + } + + public String getSoundModemPort() { + return soundModemPort; + } + + public void setSoundModemPort(String soundModemPort) { + this.soundModemPort = soundModemPort; + } + + public String getSIDSAMSATSource() { + return SIDSAMSATSource; + } + + public void setSIDSAMSATSource(String sIDSAMSATSource) { + SIDSAMSATSource = sIDSAMSATSource; + } + + public String getSIDSAMSATUrl() { + return SIDSAMSATUrl; + } + + public void setSIDSAMSATUrl(String sIDSAMSATUrl) { + SIDSAMSATUrl = sIDSAMSATUrl; + } + + public String getSIDSSatnogsSource() { + return SIDSSatnogsSource; + } + + public void setSIDSSatnogsSource(String sIDSSatnogsSource) { + SIDSSatnogsSource = sIDSSatnogsSource; + } + + public String getSIDSSatnogsURL() { + return SIDSSatnogsURL; + } + + public void setSIDSSatnogsURL(String sIDSSatnogsURL) { + SIDSSatnogsURL = sIDSSatnogsURL; + } + + public int getNorad() { + return Norad; + } + + public void setNorad(int norad) { + Norad = norad; + } + + public boolean isSIDS_AMSAT() { + return SIDS_AMSAT; + } + + public CONFIG getConf() { + return conf; + } + + public void setConf(CONFIG conf) { + this.conf = conf; + } + + public void setSISD_SatNogs(boolean sISD_SatNogs) { + SISD_SatNogs = sISD_SatNogs; + } } diff --git a/ApplicationUVSQsatDecoder/src/main/java/org/josast/UVSQsatDecoder/Controler.java b/ApplicationUVSQsatDecoder/src/main/java/org/josast/UVSQsatDecoder/Controler.java index c896b5d19526b0e2872ce818f2efa83082333274..b7f884ffcdb54e81bea99c11b070fee4c4e0a7db 100644 --- a/ApplicationUVSQsatDecoder/src/main/java/org/josast/UVSQsatDecoder/Controler.java +++ b/ApplicationUVSQsatDecoder/src/main/java/org/josast/UVSQsatDecoder/Controler.java @@ -1,6 +1,5 @@ package org.josast.UVSQsatDecoder; - import java.awt.image.BufferedImage; import java.beans.PropertyChangeEvent; import java.beans.PropertyChangeListener; @@ -17,10 +16,27 @@ import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.ScheduledFuture; import java.util.concurrent.TimeUnit; import java.util.logging.Logger; - +import javafx.application.Platform; +import javafx.concurrent.WorkerStateEvent; +import javafx.embed.swing.SwingFXUtils; +import javafx.event.ActionEvent; +import javafx.event.EventHandler; +import javafx.fxml.FXML; +import javafx.scene.control.Alert; +import javafx.scene.control.Button; +import javafx.scene.control.CheckBox; +import javafx.scene.control.Label; +import javafx.scene.control.Tab; +import javafx.scene.control.TextArea; +import javafx.scene.control.TextField; +import javafx.scene.image.Image; +import javafx.scene.image.ImageView; +import javafx.scene.layout.VBox; +import javafx.scene.web.WebEngine; +import javafx.scene.web.WebView; +import javafx.stage.Stage; +import javafx.stage.Window; import javax.imageio.ImageIO; - - import org.josast.ModuleSoundModem.SoundModemConfiguration; import org.josast.SIDS.Station; import org.josast.UVSQsatDecoder.util.LogFile; @@ -34,1780 +50,1447 @@ import org.josast.uvsqsat.generated.Uvsqsat.IepsHkStatus; import org.josast.uvsqsat.generated.Uvsqsat.ImtqHk; import org.josast.uvsqsat.generated.Uvsqsat.MainboardAllScience; import org.josast.uvsqsat.generated.Uvsqsat.MainboardHk; - import org.josast.uvsqsat.generated.Uvsqsat.ObcHk; import org.josast.uvsqsat.generated.Uvsqsat.ObcStatus; import org.josast.uvsqsat.generated.Uvsqsat.TrxvurxHk; import org.josast.uvsqsat.generated.Uvsqsat.TrxvutxHk; import org.josast.uvsqsat.generated.Uvsqsat.UiFrame; +public class Controler { -import javafx.application.Platform; -import javafx.concurrent.WorkerStateEvent; -import javafx.embed.swing.SwingFXUtils; -import javafx.event.ActionEvent; -import javafx.event.EventHandler; -import javafx.fxml.FXML; -import javafx.scene.control.Alert; -import javafx.scene.control.Button; -import javafx.scene.control.CheckBox; -import javafx.scene.control.Label; -import javafx.scene.control.Tab; -import javafx.scene.control.TextArea; -import javafx.scene.control.TextField; -import javafx.scene.image.Image; -import javafx.scene.image.ImageView; -import javafx.scene.layout.VBox; -import javafx.scene.web.WebEngine; -import javafx.scene.web.WebView; -import javafx.stage.Stage; -import javafx.stage.Window; + private static Logger appLogger = Logger.getLogger("AmsatLogger"); + private int delayRefresh = 6; // toute les 6 heures + + private LogFile logfile = null; + private static final String LINE_SEPARATOR = "\r\n"; + private static final int STATE_INIT = 0; + private static final int STATE_START = 1; + protected static final int STATE_STOP = 2; + private static final int STATE_SAVE = 3; + + // + private Ax25Display ax25display = new Ax25Display(); + private DisplayUVSQsat displayUVSQsat = new DisplayUVSQsat(); + ModelReceivedData receivedFrame = new ModelReceivedData(); + private TaskSoundmodemTCP task; + private SendSIDS SendSIDSSatnogs; + private SendSIDS SendSIDSMVPAmsat; + private String imgAmsat = "logoAmsat.png"; + private String imgSatellite = "OIP.jpg"; + Station station = new Station(); + Configuration conf = Configuration.getInstance(); + private String version = "0.6"; + // main variable + @FXML private TextArea DecodedData; + @FXML private Label LabelFrame; + @FXML private Label LabelInformation; + @FXML private Button ButtonStart; + @FXML private Button ButtonStop; + @FXML private Button ButtonSave; + + @FXML private Button ButtonSaveConfiguration; + + @FXML private TextArea TextAreaMessage; + + @FXML private Label labelStatus; + @FXML private TextArea TexAreaLog; + @FXML private TextField TextFieldCallsign; + @FXML private TextField TextFieldLatitude; + @FXML private TextField TextFieldLongitude; + + @FXML private CheckBox CheckboxAmsatFDatabase; + @FXML private CheckBox CheckBoxSatNogs; + @FXML private TextField TextFieldSIDSEntrysat; + @FXML private TextField TextFieldSIDSSatnogs; + + @FXML private TextField FieldIP; + @FXML private TextField FieldPort; + + @FXML private ImageView ImageViewAMSAT; + + @FXML private ImageView imageViewSatellite; + + @FXML private WebView WebViewInfo; + + @FXML private VBox VboxInfo; + // + @FXML private TextField tfDateCurrent; + + @FXML private TextField tfFrameSid; + + @FXML private TextField tfFrameName; + + private Stage primaryStage = null; + + // Add generated FXML variable + + @FXML private TextField tfsideAAntsTemperatureRaw; + @FXML private TextField tfsideAAntsDeploymentStatusRaw; + @FXML private TextField tfsideAAntsUptimeRaw; + @FXML private TextField tfsideADeploymentCountAntenna1Raw; + @FXML private TextField tfsideADeploymentCountAntenna2Raw; + @FXML private TextField tfsideADeploymentCountAntenna3Raw; + @FXML private TextField tfsideADeploymentCountAntenna4Raw; + @FXML private TextField tfsideADeploymentTimeAntenna1Raw; + @FXML private TextField tfsideADeploymentTimeAntenna2Raw; + @FXML private TextField tfsideADeploymentTimeAntenna3Raw; + @FXML private TextField tfsideADeploymentTimeAntenna4Raw; + @FXML private TextField tfsideBAntsTemperatureRaw; + @FXML private TextField tfsideBAntsDeploymentStatusRaw; + @FXML private TextField tfsideBAntsUptimeRaw; + @FXML private TextField tfsideBDeploymentCountAntenna1Raw; + @FXML private TextField tfsideBDeploymentCountAntenna2Raw; + @FXML private TextField tfsideBDeploymentCountAntenna3Raw; + @FXML private TextField tfsideBDeploymentCountAntenna4Raw; + @FXML private TextField tfsideBDeploymentTimeAntenna1Raw; + @FXML private TextField tfsideBDeploymentTimeAntenna2Raw; + @FXML private TextField tfsideBDeploymentTimeAntenna3Raw; + @FXML private TextField tfsideBDeploymentTimeAntenna4Raw; + + // beacon + + @FXML private TextField tfswModeRaw; + @FXML private TextField tfresetOrderRaw; + @FXML private TextField tfformatSdcardOrderRaw; + @FXML private TextField tfnbTcPingSinceFirstStartRaw; + + // IEPS HK + + @FXML private TextField tfhKStidRaw; + @FXML private TextField tfhKIvidRaw; + @FXML private TextField tfhKRcRaw; + @FXML private TextField tfhKBidRaw; + @FXML private TextField tfhKCmderrRaw; + @FXML private TextField tfhKStatRaw; + @FXML private TextField tfvoltBrdSupRawV; + @FXML private TextField tftempRawT; + @FXML private TextField tfvDistInputRawV; + @FXML private TextField tfiDistInputRawMa; + @FXML private TextField tfpDistInputRawMw; + @FXML private TextField tfvBattInputRawV; + @FXML private TextField tfiBattInputRawMa; + @FXML private TextField tfpBattInputRawMw; + @FXML private TextField tfstatObcOnRaw; + @FXML private TextField tfstatObcOcfRaw; + @FXML private TextField tfbatStatRaw; + @FXML private TextField tfbatTemp2RawT; + @FXML private TextField tfvoltVd0Raw; + @FXML private TextField tfvoltVd1Raw; + @FXML private TextField tfvoltVd2Raw; + @FXML private TextField tfvObc00V; + @FXML private TextField tfiObc00Ma; + @FXML private TextField tfpObc00Mw; + @FXML private TextField tfvObc01V; + @FXML private TextField tfiObc01Ma; + @FXML private TextField tfpObc01Mw; + @FXML private TextField tfvObc02V; + @FXML private TextField tfiObc02Ma; + @FXML private TextField tfpObc02Mw; + @FXML private TextField tfvObc03V; + @FXML private TextField tfiObc03Ma; + @FXML private TextField tfpObc03Mw; + @FXML private TextField tfvObc05V; + @FXML private TextField tfiObc05Ma; + @FXML private TextField tfpObc05Mw; + @FXML private TextField tfvObc06V; + @FXML private TextField tfiObc06Ma; + @FXML private TextField tfpObc06Mw; + @FXML private TextField tfcc1Byte; + @FXML private TextField tfcc2Byte; + @FXML private TextField tfcc3Byte; + @FXML private TextField tfstatusStidRaw; + @FXML private TextField tfstatusIvidRaw; + @FXML private TextField tfstatusRcRaw; + @FXML private TextField tfstatusBidRaw; + @FXML private TextField tfstatusCmderrRaw; + @FXML private TextField tfstatusStatRaw; + @FXML private TextField tfmodeRaw; + @FXML private TextField tfconfRaw; + @FXML private TextField tfresetCauseRaw; + @FXML private TextField tfuptimeRaw; + @FXML private TextField tferrorRaw; + @FXML private TextField tfrcCntPwronRaw; + @FXML private TextField tfrcCntWdgRaw; + @FXML private TextField tfrcCntCmdRaw; + @FXML private TextField tfrcCntMcuRaw; + @FXML private TextField tfrcCntEmlopoRaw; + @FXML private TextField tfprevcmdElapsedRaw; + + // IMTQ + @FXML private TextField tfdigitaleVoltageV; + @FXML private TextField tfanalogVoltageV; + @FXML private TextField tfdigitalCurrentRaw; + @FXML private TextField tfanalogCurrentRaw; + @FXML private TextField tfmeasureCoilXCurrentMa; + @FXML private TextField tfmeasureCoilYCurrentMa; + @FXML private TextField tfmeasureCoilZCurrentMa; + @FXML private TextField tfmeasureCoilXTemperatureC; + @FXML private TextField tfmeasureCoilYTemperatureC; + @FXML private TextField tfmeasureCoilZTemperatureC; + @FXML private TextField tfmcuTemperatureC; + @FXML private TextField tfimtqSystemStateModeRaw; + @FXML private TextField tfimtqSystemStateErrorRaw; + @FXML private TextField tfimtqSystemStateConfigurationRaw; + @FXML private TextField tfimtqSystemStateUptimeRaw; + + // Mainboard ALL Science + + @FXML private TextField tfmainboardScienceTimeRaw; + @FXML private TextField tfteachWearOnRaw; + @FXML private TextField tffrequenceOfAcquisitionsRaw; + @FXML private TextField tfgainRaw; + @FXML private TextField tfnumberOfAcquisitionCommandedRaw; + @FXML private TextField tfnumberOfRealAcquisitionRaw; + @FXML private TextField tfhkPlus5vRaw; + @FXML private TextField tfhkMinus5vRaw; + @FXML private TextField tfhkMinus5vPolarRaw; + @FXML private TextField tfhkTempAdcRaw; + @FXML private TextField tfhkFeePlusXVrefRaw; + @FXML private TextField tfhkFeeMinusXVrefRaw; + @FXML private TextField tfhkFeePlusYVrefRaw; + @FXML private TextField tfhkFeeMinusYVrefRaw; + @FXML private TextField tffeePlusXErs1SignalRaw; + @FXML private TextField tffeePlusXErs1TemperatureRaw; + @FXML private TextField tffeePlusXErs2SignalRaw; + @FXML private TextField tffeePlusXErs2TemperatureRaw; + @FXML private TextField tffeePlusXErs3SignalRaw; + @FXML private TextField tffeePlusXErs3TemperatureRaw; + @FXML private TextField tffeePlusXUvsSignalRaw; + @FXML private TextField tffeeMinusXErs1SignalRaw; + @FXML private TextField tffeeMinusXErs1TemperatureRaw; + @FXML private TextField tffeeMinusXErs2SignalRaw; + @FXML private TextField tffeeMinusXErs2TemperatureRaw; + @FXML private TextField tffeeMinusXErs3SignalRaw; + @FXML private TextField tffeeMinusXErs3TemperatureRaw; + @FXML private TextField tffeeMinusXUvsSignalRaw; + @FXML private TextField tffeePlusYErs1SignalRaw; + @FXML private TextField tffeePlusYErs1TemperatureRaw; + @FXML private TextField tffeePlusYErs2SignalRaw; + @FXML private TextField tffeePlusYErs2TemperatureRaw; + @FXML private TextField tffeePlusYErs3SignalRaw; + @FXML private TextField tffeePlusYErs3TemperatureRaw; + @FXML private TextField tffeePlusYUvsSignalRaw; + @FXML private TextField tffeeMinusYErs1SignalRaw; + @FXML private TextField tffeeMinusYErs1TemperatureRaw; + @FXML private TextField tffeeMinusYErs2SignalRaw; + @FXML private TextField tffeeMinusYErs2TemperatureRaw; + @FXML private TextField tffeeMinusYErs3SignalRaw; + @FXML private TextField tffeeMinusYErs3TemperatureRaw; + @FXML private TextField tffeeMinusYUvsSignalRaw; + @FXML private TextField tfteachwearAccXRaw; + @FXML private TextField tfteachwearAccYRaw; + @FXML private TextField tfteachwearAccZRaw; + @FXML private TextField tfteachwearDegCRaw; + @FXML private TextField tfteachwearGyroXRaw; + @FXML private TextField tfteachwearGyroYRaw; + @FXML private TextField tfteachwearGyroZRaw; + @FXML private TextField tfteachwearMagnXRaw; + @FXML private TextField tfteachwearMagnYRaw; + @FXML private TextField tfteachwearMagnZRaw; + @FXML private TextField tfteachwearStateRaw; + @FXML private TextField tfteachwearResetReasonRaw; + @FXML private TextField tfteachwearCRCRaw; + @FXML private TextField tfnbTmSinceFirstStartRaw; + + // Mainboard HK + + @FXML private TextField tfmainboardHKTimeRaw; + @FXML private TextField tfhkPlus5VRaw; + @FXML private TextField tfhkMinus5VRaw; + @FXML private TextField tfhkMinusPolarRaw; + @FXML private TextField tfhkTempADCRaw; + // @FXML + // private TextField tfhkFeePlusXVrefRaw; + // @FXML + // private TextField tfhkFeeMinusXVrefRaw; + // @FXML + // private TextField tfhkFeePlusYVrefRaw; + // @FXML + // private TextField tfhkFeeMinusYVrefRaw; + + // OBC HK + + @FXML private TextField tfdummyRaw; + // @FXML + // private TextField tfspiCommandStatusRaw; + @FXML private TextField tfsupervisorEnableStatusRaw; + @FXML private TextField tfsupervisorUptimeRaw; + @FXML private TextField tfiobcResetCountRaw; + @FXML private TextField tfiobcUptimeRaw; + @FXML private TextField tfiobcMeasureTemperatureRaw; + @FXML private TextField tfiobcMeasure3v3InRaw; + @FXML private TextField tfiobcMeasure3v3Raw; + @FXML private TextField tfiobcMeasure2vReferenceRaw; + @FXML private TextField tfiobcMeasure1v8Raw; + @FXML private TextField tfiobcMeasure1v0Raw; + @FXML private TextField tfiobcMeasureCurrent3v3Raw; + @FXML private TextField tfiobcMeasureCurrent1v8Raw; + @FXML private TextField tfiobcMeasureCurrent1v0Raw; + @FXML private TextField tfiobcMeasureVoltRtcRaw; + @FXML private TextField tfiobcAdcUpdateFlagRaw; + @FXML private TextField tfiobcCrc8Raw; + @FXML private TextField tfphotodiode1Raw; + @FXML private TextField tfphotodiode2Raw; + @FXML private TextField tfphotodiode3Raw; + @FXML private TextField tfphotodiode4Raw; + @FXML private TextField tfphotodiode5Raw; + @FXML private TextField tfphotodiode6Raw; + @FXML private TextField tfpanelTemperature1C; + @FXML private TextField tfpanelTemperature2C; + @FXML private TextField tfpanelTemperature3C; + @FXML private TextField tfpanelTemperature4C; + @FXML private TextField tfpanelTemperature5C; + @FXML private TextField tfpanelTemperature6C; + + // OBC STATUS + + @FXML private TextField tfdummydummy; + @FXML private TextField tfspiCommandStatusRaw; + @FXML private TextField tfsupervisorIndexOfSubsystemRaw; + @FXML private TextField tfsupervisorMajorVersionRaw; + @FXML private TextField tfsupervisorMinorVersionRaw; + @FXML private TextField tfsupervisorPatchVersionRaw; + @FXML private TextField tfsupervisorGitHeadVersionRaw; + @FXML private TextField tfsupervisorSerialNumberRaw; + @FXML private TextField tfcompilationInformationByte; + @FXML private TextField tfclockSpeedRaw; + @FXML private TextField tfcodeTypeRaw; + @FXML private TextField tfcrc8Raw; + @FXML private TextField tfswMmodeRaw; + @FXML private TextField tflastResetReasonRaw; + @FXML private TextField tfreservedRaw; + @FXML private TextField tfnbResetRaw; + @FXML private TextField tfreserved2Raw; + @FXML private TextField tfdeployAntennasSystemRaw; + // @FXML + // private TextField tfnbTmSinceFirstStartRaw; + @FXML private TextField tfnbTcSinceFirstStartRaw; + @FXML private TextField tfnbBadTcSinceFirstStartRaw; + @FXML private TextField tfnbTmInSdcardRaw; + @FXML private TextField tfsdcardStatusRaw; + @FXML private TextField tfsdcardLastErrorRaw; + @FXML private TextField tfoldTimeTMInSdcardRaw; + @FXML private TextField tfnewTimeTMInSdcardRaw; + + // TRXURX HK + + @FXML private TextField tftrxvurxInstantaneousReceivedSignalDopplerHz; + @FXML private TextField tftrxvurxInstantaneousReceivedSignalStrengthDbm; + @FXML private TextField tftrxvurxSupplyVoltageV; + @FXML private TextField tftrxvurxTotalSupplyCurrentMa; + @FXML private TextField tftrxvurxTransmitterCurrentMa; + @FXML private TextField tftrxvurxReceiverCurrentMa; + @FXML private TextField tftrxvurxPowerAmplifierCurrentMa; + @FXML private TextField tftrxvurxPowerAmplifierTemperatureC; + @FXML private TextField tftrxvurxLocalOscillatorTemperatureC; + @FXML private TextField tftrxvurxZeroPaddingRaw; + @FXML private TextField tftrxvuRxUptimeRaw; + + // TRSUTX HK + + @FXML private TextField tftrxvutxInstantaneousRfReflectedPowerFromTransmitterPortMw; + @FXML private TextField tftrxvutxInstantaneousRfForwardPowerFromTransmitterPortMw; + @FXML private TextField tftrxvutxSupplyVoltageV; + @FXML private TextField tftrxvutxTotalSupplyCurrentMa; + @FXML private TextField tftrxvutxTransmitterCurrentMa; + @FXML private TextField tftrxvutxReceiverCurrentMa; + @FXML private TextField tftrxvutxPowerAmplifierCurrentMa; + @FXML private TextField tftrxvutxPowerAmplifierTemperatureC; + @FXML private TextField tftrxvutxLocalOscillatorTemperatureC; + @FXML private TextField tftrxvutxZeroPaddingRaw; + @FXML private TextField tftrxvuTxUptimeRaw; + @FXML private TextField tftrxvuTxStateRaw; + + @FXML private Tab TabDataSream; + @FXML private Tab infoTab; + + ScheduledExecutorService ses = Executors.newScheduledThreadPool(1); + private ScheduledFuture scheduledFuture = null; + + private void setupDataStream() { + + ReceivedData decodedData = receivedFrame.getLastReceivedData(); + if (decodedData != null) { + DecodedData.clear(); + ax25display.setdata(decodedData); + if (ax25display.GetCallsignFrom().contains("LATMOS")) { + displayUVSQsat.setData(decodedData); + Frame frame = displayUVSQsat.getFrame(); + if (frame != null) { + DecodedData.appendText(displayUVSQsat.getData()); + } else { + DecodedData.appendText(ax25display.getDisplay()); + } + // release memory + frame = null; + } else { + DecodedData.appendText(ax25display.getDisplay()); + } + } else { + DecodedData.setText("No Value to display"); + } + } + + @FXML + private void HandleTabDataSreamChange() { + + Platform.runLater( + new Runnable() { + @Override + public void run() { + if (TabDataSream.isSelected()) setupDataStream(); + } + }); + } + + @FXML + private void HandleIP(ActionEvent event) {} + + @FXML + private void HandlePort(ActionEvent event) {} + + @FXML + private void handleStart(ActionEvent event) { + + manageStatusinformation("Connected to modem", "Connection to modem"); + manageStateMMI(STATE_START); + + // TODO : to improve + SoundModemConfiguration smc = new SoundModemConfiguration("configuration.ini"); + smc.setSmIPadress(FieldIP.getText()); + smc.setSmPort(Integer.parseInt(FieldPort.getText())); + + if (task == null) { + receivedFrame.addPropertyChangeListener( + new PropertyChangeListener() { + @Override + public void propertyChange(PropertyChangeEvent evt) { + + // final ; + // final ReceivedData decodedData = receivedFrame.getLastReceivedData(); + Platform.runLater( + new Runnable() { + @Override + public void run() { + ReceivedData decodedData = receivedFrame.getLastReceivedData(); + + try {; + + if (decodedData != null) { + + updateFrame(receivedFrame.getNumberFrame()); + ax25display.setdata(decodedData); + + if (ax25display.GetCallsignFrom().contains("LATMOS")) { + + SendSids(decodedData); + displayUVSQsat.setData(decodedData); + Frame frame = displayUVSQsat.getFrame(); + if (frame != null) { + String date = + displayUVSQsat.getFrame().getPacketSecondaryHeader().getTime(); + tfDateCurrent.setText(date); + int sid = displayUVSQsat.getFrame().getSid(); + tfFrameSid.setText("" + sid); + if (TabDataSream + .isSelected()) // append le texte uniquement si visible + { + DecodedData.appendText(displayUVSQsat.getData()); + } + displayUvsqsat(sid, (UiFrame) displayUVSQsat.getFrame().getUiFrame()); + + // release memory + + date = null; + } else { + displayLog("Frame not reconized"); + ax25display.setdata(decodedData); + displayLog(decodedData.toString()); + + DecodedData.appendText(ax25display.getDisplay()); + } + // release memory + frame = null; + } else { + ax25display.setdata(decodedData); + displayLog(decodedData.toString()); + // DecodedData.appendText(ax25display.getDisplay()); + } -public class Controler { - - private static Logger appLogger = Logger.getLogger("AmsatLogger"); - private int delayRefresh = 6; // toute les 6 heures - - private LogFile logfile = null; - private static final String LINE_SEPARATOR = "\r\n"; - private static final int STATE_INIT = 0; - private static final int STATE_START = 1; - protected static final int STATE_STOP = 2; - private static final int STATE_SAVE = 3; - -// - private Ax25Display ax25display = new Ax25Display(); - private DisplayUVSQsat displayUVSQsat = new DisplayUVSQsat(); - ModelReceivedData receivedFrame = new ModelReceivedData(); - private TaskSoundmodemTCP task; - private SendSIDS SendSIDSSatnogs; - private SendSIDS SendSIDSMVPAmsat; - private String imgAmsat = "logoAmsat.png"; - private String imgSatellite = "OIP.jpg"; - Station station = new Station(); - Configuration conf = Configuration.getInstance(); - private String version = "0.6"; -// main variable - @FXML - private TextArea DecodedData; - @FXML - private Label LabelFrame; - @FXML - private Label LabelInformation; - @FXML - private Button ButtonStart; - @FXML - private Button ButtonStop; - @FXML - private Button ButtonSave; - - @FXML - private Button ButtonSaveConfiguration; - - @FXML - private TextArea TextAreaMessage; - - @FXML - private Label labelStatus; - @FXML - private TextArea TexAreaLog; - @FXML - private TextField TextFieldCallsign; - @FXML - private TextField TextFieldLatitude; - @FXML - private TextField TextFieldLongitude; - - @FXML - private CheckBox CheckboxAmsatFDatabase; - @FXML - private CheckBox CheckBoxSatNogs; - @FXML - private TextField TextFieldSIDSEntrysat; - @FXML - private TextField TextFieldSIDSSatnogs; - - @FXML - private TextField FieldIP; - @FXML - private TextField FieldPort; - - @FXML - private ImageView ImageViewAMSAT; - - @FXML - private ImageView imageViewSatellite; - - - @FXML - private WebView WebViewInfo; - - @FXML - private VBox VboxInfo; -// -@FXML -private TextField tfDateCurrent; - -@FXML -private TextField tfFrameSid; - -@FXML -private TextField tfFrameName; - -private Stage primaryStage = null; - -// Add generated FXML variable - -@FXML -private TextField tfsideAAntsTemperatureRaw; -@FXML -private TextField tfsideAAntsDeploymentStatusRaw; -@FXML -private TextField tfsideAAntsUptimeRaw; -@FXML -private TextField tfsideADeploymentCountAntenna1Raw; -@FXML -private TextField tfsideADeploymentCountAntenna2Raw; -@FXML -private TextField tfsideADeploymentCountAntenna3Raw; -@FXML -private TextField tfsideADeploymentCountAntenna4Raw; -@FXML -private TextField tfsideADeploymentTimeAntenna1Raw; -@FXML -private TextField tfsideADeploymentTimeAntenna2Raw; -@FXML -private TextField tfsideADeploymentTimeAntenna3Raw; -@FXML -private TextField tfsideADeploymentTimeAntenna4Raw; -@FXML -private TextField tfsideBAntsTemperatureRaw; -@FXML -private TextField tfsideBAntsDeploymentStatusRaw; -@FXML -private TextField tfsideBAntsUptimeRaw; -@FXML -private TextField tfsideBDeploymentCountAntenna1Raw; -@FXML -private TextField tfsideBDeploymentCountAntenna2Raw; -@FXML -private TextField tfsideBDeploymentCountAntenna3Raw; -@FXML -private TextField tfsideBDeploymentCountAntenna4Raw; -@FXML -private TextField tfsideBDeploymentTimeAntenna1Raw; -@FXML -private TextField tfsideBDeploymentTimeAntenna2Raw; -@FXML -private TextField tfsideBDeploymentTimeAntenna3Raw; -@FXML -private TextField tfsideBDeploymentTimeAntenna4Raw; - -// beacon - -@FXML -private TextField tfswModeRaw; -@FXML -private TextField tfresetOrderRaw; -@FXML -private TextField tfformatSdcardOrderRaw; -@FXML -private TextField tfnbTcPingSinceFirstStartRaw; - -// IEPS HK - -@FXML -private TextField tfhKStidRaw; -@FXML -private TextField tfhKIvidRaw; -@FXML -private TextField tfhKRcRaw; -@FXML -private TextField tfhKBidRaw; -@FXML -private TextField tfhKCmderrRaw; -@FXML -private TextField tfhKStatRaw; -@FXML -private TextField tfvoltBrdSupRawV; -@FXML -private TextField tftempRawT; -@FXML -private TextField tfvDistInputRawV; -@FXML -private TextField tfiDistInputRawMa; -@FXML -private TextField tfpDistInputRawMw; -@FXML -private TextField tfvBattInputRawV; -@FXML -private TextField tfiBattInputRawMa; -@FXML -private TextField tfpBattInputRawMw; -@FXML -private TextField tfstatObcOnRaw; -@FXML -private TextField tfstatObcOcfRaw; -@FXML -private TextField tfbatStatRaw; -@FXML -private TextField tfbatTemp2RawT; -@FXML -private TextField tfvoltVd0Raw; -@FXML -private TextField tfvoltVd1Raw; -@FXML -private TextField tfvoltVd2Raw; -@FXML -private TextField tfvObc00V; -@FXML -private TextField tfiObc00Ma; -@FXML -private TextField tfpObc00Mw; -@FXML -private TextField tfvObc01V; -@FXML -private TextField tfiObc01Ma; -@FXML -private TextField tfpObc01Mw; -@FXML -private TextField tfvObc02V; -@FXML -private TextField tfiObc02Ma; -@FXML -private TextField tfpObc02Mw; -@FXML -private TextField tfvObc03V; -@FXML -private TextField tfiObc03Ma; -@FXML -private TextField tfpObc03Mw; -@FXML -private TextField tfvObc05V; -@FXML -private TextField tfiObc05Ma; -@FXML -private TextField tfpObc05Mw; -@FXML -private TextField tfvObc06V; -@FXML -private TextField tfiObc06Ma; -@FXML -private TextField tfpObc06Mw; -@FXML -private TextField tfcc1Byte; -@FXML -private TextField tfcc2Byte; -@FXML -private TextField tfcc3Byte; -@FXML -private TextField tfstatusStidRaw; -@FXML -private TextField tfstatusIvidRaw; -@FXML -private TextField tfstatusRcRaw; -@FXML -private TextField tfstatusBidRaw; -@FXML -private TextField tfstatusCmderrRaw; -@FXML -private TextField tfstatusStatRaw; -@FXML -private TextField tfmodeRaw; -@FXML -private TextField tfconfRaw; -@FXML -private TextField tfresetCauseRaw; -@FXML -private TextField tfuptimeRaw; -@FXML -private TextField tferrorRaw; -@FXML -private TextField tfrcCntPwronRaw; -@FXML -private TextField tfrcCntWdgRaw; -@FXML -private TextField tfrcCntCmdRaw; -@FXML -private TextField tfrcCntMcuRaw; -@FXML -private TextField tfrcCntEmlopoRaw; -@FXML -private TextField tfprevcmdElapsedRaw; - -// IMTQ -@FXML -private TextField tfdigitaleVoltageV; -@FXML -private TextField tfanalogVoltageV; -@FXML -private TextField tfdigitalCurrentRaw; -@FXML -private TextField tfanalogCurrentRaw; -@FXML -private TextField tfmeasureCoilXCurrentMa; -@FXML -private TextField tfmeasureCoilYCurrentMa; -@FXML -private TextField tfmeasureCoilZCurrentMa; -@FXML -private TextField tfmeasureCoilXTemperatureC; -@FXML -private TextField tfmeasureCoilYTemperatureC; -@FXML -private TextField tfmeasureCoilZTemperatureC; -@FXML -private TextField tfmcuTemperatureC; -@FXML -private TextField tfimtqSystemStateModeRaw; -@FXML -private TextField tfimtqSystemStateErrorRaw; -@FXML -private TextField tfimtqSystemStateConfigurationRaw; -@FXML -private TextField tfimtqSystemStateUptimeRaw; - -// Mainboard ALL Science - -@FXML -private TextField tfmainboardScienceTimeRaw; -@FXML -private TextField tfteachWearOnRaw; -@FXML -private TextField tffrequenceOfAcquisitionsRaw; -@FXML -private TextField tfgainRaw; -@FXML -private TextField tfnumberOfAcquisitionCommandedRaw; -@FXML -private TextField tfnumberOfRealAcquisitionRaw; -@FXML -private TextField tfhkPlus5vRaw; -@FXML -private TextField tfhkMinus5vRaw; -@FXML -private TextField tfhkMinus5vPolarRaw; -@FXML -private TextField tfhkTempAdcRaw; -@FXML -private TextField tfhkFeePlusXVrefRaw; -@FXML -private TextField tfhkFeeMinusXVrefRaw; -@FXML -private TextField tfhkFeePlusYVrefRaw; -@FXML -private TextField tfhkFeeMinusYVrefRaw; -@FXML -private TextField tffeePlusXErs1SignalRaw; -@FXML -private TextField tffeePlusXErs1TemperatureRaw; -@FXML -private TextField tffeePlusXErs2SignalRaw; -@FXML -private TextField tffeePlusXErs2TemperatureRaw; -@FXML -private TextField tffeePlusXErs3SignalRaw; -@FXML -private TextField tffeePlusXErs3TemperatureRaw; -@FXML -private TextField tffeePlusXUvsSignalRaw; -@FXML -private TextField tffeeMinusXErs1SignalRaw; -@FXML -private TextField tffeeMinusXErs1TemperatureRaw; -@FXML -private TextField tffeeMinusXErs2SignalRaw; -@FXML -private TextField tffeeMinusXErs2TemperatureRaw; -@FXML -private TextField tffeeMinusXErs3SignalRaw; -@FXML -private TextField tffeeMinusXErs3TemperatureRaw; -@FXML -private TextField tffeeMinusXUvsSignalRaw; -@FXML -private TextField tffeePlusYErs1SignalRaw; -@FXML -private TextField tffeePlusYErs1TemperatureRaw; -@FXML -private TextField tffeePlusYErs2SignalRaw; -@FXML -private TextField tffeePlusYErs2TemperatureRaw; -@FXML -private TextField tffeePlusYErs3SignalRaw; -@FXML -private TextField tffeePlusYErs3TemperatureRaw; -@FXML -private TextField tffeePlusYUvsSignalRaw; -@FXML -private TextField tffeeMinusYErs1SignalRaw; -@FXML -private TextField tffeeMinusYErs1TemperatureRaw; -@FXML -private TextField tffeeMinusYErs2SignalRaw; -@FXML -private TextField tffeeMinusYErs2TemperatureRaw; -@FXML -private TextField tffeeMinusYErs3SignalRaw; -@FXML -private TextField tffeeMinusYErs3TemperatureRaw; -@FXML -private TextField tffeeMinusYUvsSignalRaw; -@FXML -private TextField tfteachwearAccXRaw; -@FXML -private TextField tfteachwearAccYRaw; -@FXML -private TextField tfteachwearAccZRaw; -@FXML -private TextField tfteachwearDegCRaw; -@FXML -private TextField tfteachwearGyroXRaw; -@FXML -private TextField tfteachwearGyroYRaw; -@FXML -private TextField tfteachwearGyroZRaw; -@FXML -private TextField tfteachwearMagnXRaw; -@FXML -private TextField tfteachwearMagnYRaw; -@FXML -private TextField tfteachwearMagnZRaw; -@FXML -private TextField tfteachwearStateRaw; -@FXML -private TextField tfteachwearResetReasonRaw; -@FXML -private TextField tfteachwearCRCRaw; -@FXML -private TextField tfnbTmSinceFirstStartRaw; - -// Mainboard HK - -@FXML -private TextField tfmainboardHKTimeRaw; -@FXML -private TextField tfhkPlus5VRaw; -@FXML -private TextField tfhkMinus5VRaw; -@FXML -private TextField tfhkMinusPolarRaw; -@FXML -private TextField tfhkTempADCRaw; -//@FXML -//private TextField tfhkFeePlusXVrefRaw; -//@FXML -//private TextField tfhkFeeMinusXVrefRaw; -//@FXML -//private TextField tfhkFeePlusYVrefRaw; -//@FXML -//private TextField tfhkFeeMinusYVrefRaw; - -// OBC HK - -@FXML -private TextField tfdummyRaw; -//@FXML -//private TextField tfspiCommandStatusRaw; -@FXML -private TextField tfsupervisorEnableStatusRaw; -@FXML -private TextField tfsupervisorUptimeRaw; -@FXML -private TextField tfiobcResetCountRaw; -@FXML -private TextField tfiobcUptimeRaw; -@FXML -private TextField tfiobcMeasureTemperatureRaw; -@FXML -private TextField tfiobcMeasure3v3InRaw; -@FXML -private TextField tfiobcMeasure3v3Raw; -@FXML -private TextField tfiobcMeasure2vReferenceRaw; -@FXML -private TextField tfiobcMeasure1v8Raw; -@FXML -private TextField tfiobcMeasure1v0Raw; -@FXML -private TextField tfiobcMeasureCurrent3v3Raw; -@FXML -private TextField tfiobcMeasureCurrent1v8Raw; -@FXML -private TextField tfiobcMeasureCurrent1v0Raw; -@FXML -private TextField tfiobcMeasureVoltRtcRaw; -@FXML -private TextField tfiobcAdcUpdateFlagRaw; -@FXML -private TextField tfiobcCrc8Raw; -@FXML -private TextField tfphotodiode1Raw; -@FXML -private TextField tfphotodiode2Raw; -@FXML -private TextField tfphotodiode3Raw; -@FXML -private TextField tfphotodiode4Raw; -@FXML -private TextField tfphotodiode5Raw; -@FXML -private TextField tfphotodiode6Raw; -@FXML -private TextField tfpanelTemperature1C; -@FXML -private TextField tfpanelTemperature2C; -@FXML -private TextField tfpanelTemperature3C; -@FXML -private TextField tfpanelTemperature4C; -@FXML -private TextField tfpanelTemperature5C; -@FXML -private TextField tfpanelTemperature6C; - -// OBC STATUS - -@FXML -private TextField tfdummydummy; -@FXML -private TextField tfspiCommandStatusRaw; -@FXML -private TextField tfsupervisorIndexOfSubsystemRaw; -@FXML -private TextField tfsupervisorMajorVersionRaw; -@FXML -private TextField tfsupervisorMinorVersionRaw; -@FXML -private TextField tfsupervisorPatchVersionRaw; -@FXML -private TextField tfsupervisorGitHeadVersionRaw; -@FXML -private TextField tfsupervisorSerialNumberRaw; -@FXML -private TextField tfcompilationInformationByte; -@FXML -private TextField tfclockSpeedRaw; -@FXML -private TextField tfcodeTypeRaw; -@FXML -private TextField tfcrc8Raw; -@FXML -private TextField tfswMmodeRaw; -@FXML -private TextField tflastResetReasonRaw; -@FXML -private TextField tfreservedRaw; -@FXML -private TextField tfnbResetRaw; -@FXML -private TextField tfreserved2Raw; -@FXML -private TextField tfdeployAntennasSystemRaw; -//@FXML -//private TextField tfnbTmSinceFirstStartRaw; -@FXML -private TextField tfnbTcSinceFirstStartRaw; -@FXML -private TextField tfnbBadTcSinceFirstStartRaw; -@FXML -private TextField tfnbTmInSdcardRaw; -@FXML -private TextField tfsdcardStatusRaw; -@FXML -private TextField tfsdcardLastErrorRaw; -@FXML -private TextField tfoldTimeTMInSdcardRaw; -@FXML -private TextField tfnewTimeTMInSdcardRaw; - -// TRXURX HK - -@FXML -private TextField tftrxvurxInstantaneousReceivedSignalDopplerHz; -@FXML -private TextField tftrxvurxInstantaneousReceivedSignalStrengthDbm; -@FXML -private TextField tftrxvurxSupplyVoltageV; -@FXML -private TextField tftrxvurxTotalSupplyCurrentMa; -@FXML -private TextField tftrxvurxTransmitterCurrentMa; -@FXML -private TextField tftrxvurxReceiverCurrentMa; -@FXML -private TextField tftrxvurxPowerAmplifierCurrentMa; -@FXML -private TextField tftrxvurxPowerAmplifierTemperatureC; -@FXML -private TextField tftrxvurxLocalOscillatorTemperatureC; -@FXML -private TextField tftrxvurxZeroPaddingRaw; -@FXML -private TextField tftrxvuRxUptimeRaw; - -// TRSUTX HK - -@FXML -private TextField tftrxvutxInstantaneousRfReflectedPowerFromTransmitterPortMw; -@FXML -private TextField tftrxvutxInstantaneousRfForwardPowerFromTransmitterPortMw; -@FXML -private TextField tftrxvutxSupplyVoltageV; -@FXML -private TextField tftrxvutxTotalSupplyCurrentMa; -@FXML -private TextField tftrxvutxTransmitterCurrentMa; -@FXML -private TextField tftrxvutxReceiverCurrentMa; -@FXML -private TextField tftrxvutxPowerAmplifierCurrentMa; -@FXML -private TextField tftrxvutxPowerAmplifierTemperatureC; -@FXML -private TextField tftrxvutxLocalOscillatorTemperatureC; -@FXML -private TextField tftrxvutxZeroPaddingRaw; -@FXML -private TextField tftrxvuTxUptimeRaw; -@FXML -private TextField tftrxvuTxStateRaw; - -@FXML -private Tab TabDataSream; -@FXML -private Tab infoTab; - -ScheduledExecutorService ses = Executors.newScheduledThreadPool(1); -private ScheduledFuture scheduledFuture = null; - - - - -private void setupDataStream () -{ - - ReceivedData decodedData = receivedFrame.getLastReceivedData(); - if (decodedData != null) { - DecodedData.clear(); - ax25display.setdata(decodedData); - if (ax25display.GetCallsignFrom().contains("LATMOS")) { - displayUVSQsat.setData(decodedData); - Frame frame = displayUVSQsat.getFrame(); - if (frame !=null) - { - DecodedData.appendText(displayUVSQsat.getData()); - } - else - { - DecodedData.appendText(ax25display.getDisplay()); - } - // release memory - frame=null; - }else - { - DecodedData.appendText(ax25display.getDisplay()); - } - } - else - { - DecodedData.setText("No Value to display"); - } -} + } else { + displayLog("received frame : null"); + } + } catch (Exception e) { + displayLog("Run - error"); + displayLog(e.toString()); + e.printStackTrace(); + } + decodedData = null; + } + }); + } + }); + } + task = new TaskSoundmodemTCP(smc, receivedFrame); + + task.setOnSucceeded( + new EventHandler() { + + @Override + public void handle(WorkerStateEvent event) { + // La tache s'est correctement terminee. + manageStatusinformation("KISS TCP CONNECTION FAILED", "KISS TCP DISCONNECTED"); + manageStateMMI(STATE_STOP); + } + }); + + task.setOnFailed( + new EventHandler() { + + @Override + public void handle(WorkerStateEvent event) { + // La tache s'est correctement terminee. + manageStatusinformation( + "KISS TCP CONNECTION FAILED", "KISS TCP DISCONNECTED - Connection failed"); + displayLog(event.toString()); + displayLog(event.getSource().toString()); + manageStateMMI(STATE_STOP); + } + }); + + Thread backgroundThread = new Thread(task); + backgroundThread.setDaemon(true); + backgroundThread.start(); + } + + @FXML + private void handleStop(ActionEvent event) { + manageStateMMI(STATE_STOP); + task.arreter(); + manageStatusinformation("Stop received data", "Stop task to receive telemetrie"); + } + + @FXML + private void handleSave(ActionEvent event) { + manageStateMMI(STATE_SAVE); + manageStatusinformation("save data", "save Telemetry in file"); + saveDataFile(); + manageStatusinformation("Data Saved", "Telemetry Data saved in file"); + } + + @FXML + private void HandleSaveConfiguration(ActionEvent event) { + + String erreurmsg = null; + String Callsign = null; + + if (TextFieldCallsign.getText().isEmpty()) { + erreurmsg += "please enter a CallSign \r\n"; + } else { + Callsign = TextFieldCallsign.getText(); + } + + String Latitude = TextFieldLatitude.getText(); + String Longitude = TextFieldLongitude.getText(); + + if (station.checkLatitude(Latitude) == false) { + erreurmsg += "Wrong format for Latitude : XX.XXE/W \r\n"; + } -@FXML - private void HandleTabDataSreamChange() - { - - Platform.runLater(new Runnable() { - @Override - public void run() { - if(TabDataSream.isSelected()) - setupDataStream(); - }}); - - } - -@FXML - private void HandleIP(ActionEvent event) - { - + if (station.checkLongitude(Longitude) == false) { + erreurmsg += "Wrong format for Longitude : XX.XXS/N \r\n"; } - - @FXML - private void HandlePort(ActionEvent event) - { - + if (erreurmsg != null) { + Window owner = ButtonSaveConfiguration.getScene().getWindow(); + AlertHelper.showAlert(Alert.AlertType.ERROR, owner, "Form Error!", erreurmsg); + return; } - @FXML - private void handleStart(ActionEvent event) { - - manageStatusinformation("Connected to modem", "Connection to modem"); - manageStateMMI(STATE_START); - - // TODO : to improve - SoundModemConfiguration smc = new SoundModemConfiguration("configuration.ini"); - smc.setSmIPadress(FieldIP.getText()); - smc.setSmPort(Integer.parseInt(FieldPort.getText())); - - if (task == null) { - receivedFrame - .addPropertyChangeListener(new PropertyChangeListener() { - @Override - public void propertyChange(PropertyChangeEvent evt) { - - // final ; - // final ReceivedData decodedData = receivedFrame.getLastReceivedData(); - Platform.runLater(new Runnable() { - @Override - public void run() { - ReceivedData decodedData = receivedFrame.getLastReceivedData(); - - try { - -; - - if (decodedData != null) { - - updateFrame(receivedFrame.getNumberFrame()); - ax25display.setdata(decodedData); - - if (ax25display.GetCallsignFrom().contains("LATMOS")) { - - SendSids(decodedData); - displayUVSQsat.setData(decodedData); - Frame frame = displayUVSQsat.getFrame(); - if (frame !=null) - { - String date = displayUVSQsat.getFrame().getPacketSecondaryHeader().getTime(); - tfDateCurrent.setText(date); - int sid = displayUVSQsat.getFrame().getSid(); - tfFrameSid.setText(""+sid); - if(TabDataSream.isSelected()) // append le texte uniquement si visible - { - DecodedData.appendText(displayUVSQsat.getData()); - } - displayUvsqsat(sid,(UiFrame) displayUVSQsat.getFrame().getUiFrame()); - - //release memory - - date=null; - } - else - { - displayLog( "Frame not reconized"); - ax25display.setdata(decodedData); - displayLog(decodedData.toString()); - - DecodedData.appendText(ax25display.getDisplay()); - } - - // release memory - frame=null; - }else - { - ax25display.setdata(decodedData); - displayLog(decodedData.toString()); - // DecodedData.appendText(ax25display.getDisplay()); - } - - - } else { - displayLog( - "received frame : null"); - } - - - } catch (Exception e) { - displayLog("Run - error"); - displayLog(e.toString()); - e.printStackTrace(); - } - decodedData = null; - } - - - - - }); - } + station.setCallsign(Callsign); + station.setLatitude(Latitude); + station.setLongitude(Longitude); + + conf.setCallsign(Callsign); + conf.setLatitude(Latitude); + conf.setLongitude(Longitude); + + conf.setSIDSAMSATSource(TextFieldSIDSEntrysat.getText()); + conf.setSIDSSatnogsSource(TextFieldSIDSSatnogs.getText()); + conf.setSoundModemIP(FieldIP.getText()); + conf.setSoundModemPort(FieldPort.getText()); + + Station StationSatnogs = + new Station(conf.getSIDSSatnogsSource(), station.getLongitude(), station.getLatitude()); + Station StationEntry = + new Station(conf.getSIDSAMSATSource(), station.getLongitude(), station.getLatitude()); + + if (CheckboxAmsatFDatabase.isSelected() == true) { + conf.setSIDSAMSAT("1"); + SendSIDSMVPAmsat = new SendSIDS(StationEntry, conf.getNorad(), conf.getSIDSAMSATUrl()); + } else { + conf.setSIDSAMSAT("0"); + } - } + if (CheckBoxSatNogs.isSelected() == true) { + conf.setSIDSSatnogs("1"); + SendSIDSSatnogs = new SendSIDS(StationSatnogs, conf.getNorad(), conf.getSIDSSatnogsURL()); + } else { + conf.setSIDSSatnogs("0"); + } - ); + conf.save(); + manageStatusinformation("Configuration Saved", "Configuration Saved"); + } + + public void updateDistantconfiguration() { + String ver; + String message; + int NoradIdConf = conf.getNorad(); + + ConfigHttp c = new ConfigHttp("http://site.amsat-f.org/download/117652/"); + if (c.isConnected()) { + ver = c.getProperty("UVSQSatDecoder"); + message = c.getProperty("Message"); + String noradid = c.getProperty("NoradID"); + + if (noradid != null) { + NoradIdConf = Integer.parseUnsignedInt(c.getProperty("NoradID").trim()); + } + } else { + ver = version; + message = "not connected to internet"; + } + if (NoradIdConf != 0) { + // ID norad attribué - mise à jours du logiciel + if (NoradIdConf != conf.getNorad()) { + conf.setNorad(NoradIdConf); + conf.save(); + SendSIDSSatnogs.setNorad(NoradIdConf); + SendSIDSMVPAmsat.setNorad(NoradIdConf); + displayLog("Norad ID updated "); + } + } + final String erreurmsg; - } - task = new TaskSoundmodemTCP(smc, receivedFrame); + if (ver.equals(version) == false) { + erreurmsg = message + " New version " + ver + " available ! "; - task.setOnSucceeded(new EventHandler() { + } else { + erreurmsg = message; + } + Platform.runLater( + new Runnable() { + @Override + public void run() { + LabelInformation.setText(erreurmsg); + displayLog("information updated from internet"); + } + }); + } + + public void setPrimaryStage(Stage stage) { + this.primaryStage = primaryStage; + } + + @FXML + private void HandleInfoTabChange() { + Platform.runLater( + new Runnable() { + @Override + public void run() { + if (infoTab.isSelected()) setupInfoTab(); + } + }); + } + + private void setupInfoTab() { + File f = new File("./UVSQsatDecoderWithJREHelp.html"); + WebEngine engine = WebViewInfo.getEngine(); + if (f.exists()) { + File file = new File(f.getAbsolutePath()); + URL url = null; + try { + url = file.toURI().toURL(); + } catch (MalformedURLException e) { + appLogger.severe("Error to acces to " + f.getName()); + // e.printStackTrace(); + + } + engine.load(url.toString()); + } else { + appLogger.severe(f.getName() + "Not Found"); + } + } - @Override - public void handle(WorkerStateEvent event) { - // La tache s'est correctement terminee. - manageStatusinformation("KISS TCP CONNECTION FAILED", - "KISS TCP DISCONNECTED"); - manageStateMMI(STATE_STOP); + public void initMMI() { - } + setupInfoTab(); - }); + Runnable task1 = + () -> { + appLogger.info("Distant Information update"); + updateDistantconfiguration(); + }; - task.setOnFailed(new EventHandler() { + // init Delay = 5, repeat the task every 1 second + scheduledFuture = ses.scheduleAtFixedRate(task1, delayRefresh, delayRefresh, TimeUnit.HOURS); - @Override - public void handle(WorkerStateEvent event) { - // La tache s'est correctement terminee. - manageStatusinformation("KISS TCP CONNECTION FAILED", - "KISS TCP DISCONNECTED - Connection failed"); - displayLog(event.toString()); - displayLog(event.getSource().toString()); - manageStateMMI(STATE_STOP); - } + logfile = new LogFile(); + // initialise le log + // initdisplayLogFile(); - }); + ConfigHttp c = new ConfigHttp("http://site.amsat-f.org/download/117652/"); - Thread backgroundThread = new Thread(task); - backgroundThread.setDaemon(true); - backgroundThread.start(); + manageStatusinformation("Initialised", "UVSQsat DECODER - LOG \r\n Initialise application"); + appLogger.warning("Initialise "); + // primaryStage.setTitle("UVSQsat Decoder - " + version); - } - @FXML - private void handleStop(ActionEvent event) - { - manageStateMMI(STATE_STOP); - task.arreter(); - manageStatusinformation("Stop received data", - "Stop task to receive telemetrie"); - + station.setCallsign(conf.getCallsign()); + station.setLatitude(conf.getLatitude()); + station.setLongitude(conf.getLongitude()); + + TextFieldCallsign.setText(station.getCallsign()); + TextFieldLatitude.setText(station.getLatitude()); + TextFieldLongitude.setText(station.getLongitude()); + + TextFieldSIDSEntrysat.setText(conf.getSIDSAMSATSource()); + TextFieldSIDSSatnogs.setText(conf.getSIDSSatnogsSource()); + + FieldIP.setText(conf.getSoundModemIP()); + FieldPort.setText(conf.getSoundModemPort()); + + if (conf.isSIDS_AMSAT()) { + CheckboxAmsatFDatabase.setSelected(true); } - @FXML - private void handleSave(ActionEvent event) - { - manageStateMMI(STATE_SAVE); - manageStatusinformation("save data", "save Telemetry in file"); - saveDataFile(); - manageStatusinformation("Data Saved", "Telemetry Data saved in file"); + if (conf.isSISD_SatNogs()) { + CheckBoxSatNogs.setSelected(true); } - - - @FXML - private void HandleSaveConfiguration(ActionEvent event) { - - String erreurmsg = null; - String Callsign = null; - - if (TextFieldCallsign.getText().isEmpty()) { - erreurmsg += "please enter a CallSign \r\n"; - } else { - Callsign = TextFieldCallsign.getText(); - } - - String Latitude = TextFieldLatitude.getText(); - String Longitude = TextFieldLongitude.getText(); - - if (station.checkLatitude(Latitude) == false) { - erreurmsg += "Wrong format for Latitude : XX.XXE/W \r\n"; - } - - if (station.checkLongitude(Longitude) == false) { - erreurmsg += "Wrong format for Longitude : XX.XXS/N \r\n"; - } - if (erreurmsg != null) { - Window owner = ButtonSaveConfiguration.getScene().getWindow(); - AlertHelper.showAlert(Alert.AlertType.ERROR, owner, "Form Error!", - erreurmsg); - return; - } - - station.setCallsign(Callsign); - station.setLatitude(Latitude); - station.setLongitude(Longitude); - - conf.setCallsign(Callsign); - conf.setLatitude(Latitude); - conf.setLongitude(Longitude); - - conf.setSIDSAMSATSource(TextFieldSIDSEntrysat.getText()); - conf.setSIDSSatnogsSource(TextFieldSIDSSatnogs.getText()); - conf.setSoundModemIP(FieldIP.getText()); - conf.setSoundModemPort(FieldPort.getText()); - - Station StationSatnogs = new Station(conf.getSIDSSatnogsSource(), - station.getLongitude(), station.getLatitude()); - Station StationEntry = new Station(conf.getSIDSAMSATSource(), - station.getLongitude(), station.getLatitude()); - - if (CheckboxAmsatFDatabase.isSelected() == true) { - conf.setSIDSAMSAT("1"); - SendSIDSMVPAmsat = new SendSIDS(StationEntry, conf.getNorad(), - conf.getSIDSAMSATUrl()); - } else { - conf.setSIDSAMSAT("0"); - - } - - if (CheckBoxSatNogs.isSelected() == true) { - conf.setSIDSSatnogs("1"); - SendSIDSSatnogs = new SendSIDS(StationSatnogs, conf.getNorad(), - conf.getSIDSSatnogsURL()); - } else { - conf.setSIDSSatnogs("0"); - } - - conf.save(); - manageStatusinformation("Configuration Saved", "Configuration Saved"); - - } - - - public void updateDistantconfiguration () - { - String ver; - String message; - int NoradIdConf = conf.getNorad(); - - ConfigHttp c = new ConfigHttp("http://site.amsat-f.org/download/117652/"); - if (c.isConnected()) { - ver = c.getProperty("UVSQSatDecoder"); - message = c.getProperty("Message"); - String noradid = c.getProperty("NoradID"); - - if(noradid!=null) - { - NoradIdConf = Integer - .parseUnsignedInt(c.getProperty("NoradID").trim()); - - } - } else { - ver = version; - message = "not connected to internet"; - } - if (NoradIdConf != 0) - { - // ID norad attribué - mise à jours du logiciel - if (NoradIdConf != conf.getNorad()) { - conf.setNorad(NoradIdConf); - conf.save(); - SendSIDSSatnogs.setNorad(NoradIdConf); - SendSIDSMVPAmsat.setNorad(NoradIdConf); - displayLog("Norad ID updated "); - } - } - final String erreurmsg; - - if (ver.equals(version) == false) { - erreurmsg = message + " New version " + ver + " available ! "; - - } - else - { - erreurmsg = message; - } - Platform.runLater(new Runnable() { - @Override - public void run() { - LabelInformation.setText(erreurmsg); - displayLog("information updated from internet"); - } - }); - - } - public void setPrimaryStage(Stage stage) { - this.primaryStage = primaryStage; - - } - @FXML - private void HandleInfoTabChange() - { - Platform.runLater(new Runnable() { - @Override - public void run() { - if(infoTab.isSelected()) - setupInfoTab(); - }}); - } - - private void setupInfoTab () - { - File f = new File("./UVSQsatDecoderWithJREHelp.html"); - WebEngine engine = WebViewInfo.getEngine(); - if(f.exists()) - { - File file = new File(f.getAbsolutePath()); - URL url = null; - try { - url = file.toURI().toURL(); - } catch (MalformedURLException e) { - appLogger.severe("Error to acces to "+f.getName()); - //e.printStackTrace(); - - } - engine.load(url.toString()); } - else - { - appLogger.severe(f.getName() + "Not Found"); - } - } - public void initMMI() { - - - setupInfoTab(); - - Runnable task1 = () -> { - appLogger.info("Distant Information update"); - updateDistantconfiguration(); - }; - - // init Delay = 5, repeat the task every 1 second - scheduledFuture = ses.scheduleAtFixedRate(task1,delayRefresh,delayRefresh, TimeUnit.HOURS); - - logfile = new LogFile(); - // initialise le log - // initdisplayLogFile(); - - ConfigHttp c = new ConfigHttp("http://site.amsat-f.org/download/117652/"); - - manageStatusinformation("Initialised", - "UVSQsat DECODER - LOG \r\n Initialise application"); - appLogger.warning("Initialise "); -// primaryStage.setTitle("UVSQsat Decoder - " + version); - - station.setCallsign(conf.getCallsign()); - station.setLatitude(conf.getLatitude()); - station.setLongitude(conf.getLongitude()); - - TextFieldCallsign.setText(station.getCallsign()); - TextFieldLatitude.setText(station.getLatitude()); - TextFieldLongitude.setText(station.getLongitude()); - - TextFieldSIDSEntrysat.setText(conf.getSIDSAMSATSource()); - TextFieldSIDSSatnogs.setText(conf.getSIDSSatnogsSource()); - - FieldIP.setText(conf.getSoundModemIP()); - FieldPort.setText(conf.getSoundModemPort()); - - if (conf.isSIDS_AMSAT()) { - CheckboxAmsatFDatabase.setSelected(true); - } - if (conf.isSISD_SatNogs()) { - CheckBoxSatNogs.setSelected(true); - } - - displayLog(conf.getSIDSSatnogsURL()); - displayLog(conf.getSIDSAMSATUrl()); - displayLog("Initialisation with Properties File Done "); - - BufferedImage bufferedImage1 = null; - BufferedImage bufferedImage2 = null; - - try { - - bufferedImage1 = ImageIO.read(getClass().getResource((imgAmsat))); - bufferedImage2 = ImageIO - .read(getClass().getResource((imgSatellite))); - } catch (IOException e) { - - appLogger.severe("Error loading Image resources"); - appLogger.severe(e.toString()); - } - Image imageamsat = SwingFXUtils.toFXImage(bufferedImage1, null); - ImageViewAMSAT.setImage(imageamsat); - Image imgQB = SwingFXUtils.toFXImage(bufferedImage2, null); - imageViewSatellite.setImage(imgQB); - - - String ver; - String message; - int NoradIdConf = conf.getNorad(); - if (c.isConnected()) { - ver = c.getProperty("UVSQSatDecoder"); - message = c.getProperty("Message"); - String noradid = c.getProperty("NoradID"); - - if(noradid!=null) - { - NoradIdConf = Integer - .parseUnsignedInt(c.getProperty("NoradID").trim()); - - } - } else { - ver = version; - message = "not connected to internet"; - } - if (NoradIdConf != 0) - { - // ID norad attribué - mise à jours du logiciel - if (NoradIdConf != conf.getNorad()) { - conf.setNorad(NoradIdConf); - conf.save(); - displayLog("Norad ID updated "); - } - } - - manageStateMMI(STATE_INIT); - manageStatusinformation("Application Ready", "Application initialised"); - this.LabelInformation.setText(""); - - // initialise SIDS - - Station StationSatnogs = new Station(conf.getSIDSSatnogsSource(), - station.getLongitude(), station.getLatitude()); - Station StationEntry = new Station(conf.getSIDSAMSATSource(), - station.getLongitude(), station.getLatitude()); - - if (conf.isSISD_SatNogs() == true) { - SendSIDSSatnogs = new SendSIDS(StationSatnogs, conf.getNorad(), - conf.getSIDSSatnogsURL()); - } - - if (conf.isSIDS_AMSAT() == true) { - SendSIDSMVPAmsat = new SendSIDS(StationEntry, conf.getNorad(), - conf.getSIDSAMSATUrl()); - } - - String erreurmsg = message; - - if (ver.equals(version) == false) { - erreurmsg += " New version " + ver + " available ! "; - - } - this.LabelInformation.setText(erreurmsg); - - } - - private void manageStatusinformation(String statusMessage, - String logMessage) { - labelStatus.setText(statusMessage); - displayLog(logMessage); - - } - private void displayLog(String log) { - appLogger.info(log); - logfile.displayLog(log); - TexAreaLog.appendText(log); - TexAreaLog.appendText("\r\n"); - } - - private void manageStateMMI(int state) { - switch (state) { - case STATE_INIT: - ButtonStop.setDisable(true); - ButtonStart.setDisable(false); - ButtonSave.setDisable(true); - break; - case STATE_START: - ButtonStop.setDisable(false); - ButtonStart.setDisable(true); - ButtonSave.setDisable(false); - break; - case STATE_STOP: - ButtonStop.setDisable(true); - ButtonStart.setDisable(false); - ButtonSave.setDisable(false); - break; - case STATE_SAVE: - ButtonStop.setDisable(true); - ButtonStart.setDisable(false); - ButtonSave.setDisable(true); - break; - default : - ButtonStop.setDisable(true); - ButtonStart.setDisable(false); - ButtonSave.setDisable(false); - break; - } - } - - private void updateFrame(long nbframe) { - LabelFrame.setText("frame : " + nbframe); - - } - - private void SendSids(ReceivedData receivedData) { - - if (conf.isSIDS_AMSAT() == true) { - int results = SendSIDSMVPAmsat.Send(receivedData); - displayLog("Send SIDS AMSAT-F Database ; "+results); - } - - if (conf.isSISD_SatNogs() == true) { - int results = SendSIDSSatnogs.Send(receivedData); - displayLog("Send SIDS SatNogs Database : "+results ); - } - - } - - public void saveDataFile() { - SimpleDateFormat formater = new SimpleDateFormat("yyyy-MM-dd-HHmmss"); - Date aujourdhui = new Date(); - - // - - String path = System.getProperty("user.dir") + "/data"; - File apath = new File(path); - - if (!apath.exists()) { - if (apath.mkdir() == false) { - appLogger.severe("fail to create " + path); - } - } - - PrintWriter pw = null; - - long NbFrame = receivedFrame.getNumberFrame(); - - try { - pw = new PrintWriter(new FileWriter(path + "/" - + formater.format(aujourdhui) + "-tlm-Hexa.txt")); - for (int i = 0; i < NbFrame; i++) { - pw.write(receivedFrame.getRawFrame(i)); - pw.write(LINE_SEPARATOR); - } - - pw.flush(); - pw.close(); - } catch (IOException e) { - e.printStackTrace(); - } - - } - - private void displayUvsqsat(int sid, UiFrame uiFrame) { - - switch (sid) { - - case 0x0E : - tfFrameName.setText("Message"); - allocateAmsatAscii( (AmsatAscii) uiFrame.tlm()); - break; - case 0x0F : - tfFrameName.setText("Beacon"); - allocateBeacon( (Beacon) uiFrame.tlm()); - break; - - case 0x10 : - tfFrameName.setText("Ants HK"); - allocateAntsHk ( (AntsHk) uiFrame.tlm()); - break; - case 0x11: - // obc_status - tfFrameName.setText("OBC status"); - allocateObcStatus((ObcStatus) uiFrame.tlm()); - break; - case 0x12: - // obc_hk_tm - tfFrameName.setText("OBC HK"); - allocateObcHk((ObcHk) uiFrame.tlm()); - break; - case 0x13: - // 0x13: mainboard_all_science - tfFrameName.setText("Mainboard all science"); - allocateMainboardAllScience((MainboardAllScience) uiFrame.tlm()); - break; - case 0x14: - // 0x14: mainboard_hk - tfFrameName.setText("Mainboard HK"); - allocateMainboardHk((MainboardHk) uiFrame.tlm()); - break; - case 0x15: - // ieps_hk_status_tm - tfFrameName.setText("Ieps HK status "); - allocateIepsHkStatus((IepsHkStatus) uiFrame.tlm()); - break; - case 0x16: - // 0x16: trxvurx_hk - tfFrameName.setText("trxvurx HK"); - allocateTrxvurxHk((TrxvurxHk) uiFrame.tlm()); - break; - - case 0x17: - // imtq_hk_tm - tfFrameName.setText("IMTQ HK"); - allocateImtqHk((ImtqHk) uiFrame.tlm()); - break; - case 0x18: - // trxvutx_hk_tm - tfFrameName.setText("Trxvutx HK"); - allocateTrxvutxHk((TrxvutxHk) uiFrame.tlm()); - break; - - default: - tfFrameName.setText("SID not found"); - System.err.println("SID not found " + sid); - } - } - - private void allocateAmsatAscii(AmsatAscii tlm) { - this.TextAreaMessage.setText(tlm.messageStr()); - - } - - - public String getversion() - { - return version; - } - - -//### All following code is generated - - private void allocateAntsHk(AntsHk o) { - tfsideAAntsTemperatureRaw.setText("" + o.sideAAntsTemperatureRaw()); - tfsideAAntsDeploymentStatusRaw.setText("" + o.sideAAntsDeploymentStatusRaw()); - tfsideAAntsUptimeRaw.setText("" + o.sideAAntsUptimeRaw()); - tfsideADeploymentCountAntenna1Raw.setText("" + o.sideADeploymentCountAntenna1Raw()); - tfsideADeploymentCountAntenna2Raw.setText("" + o.sideADeploymentCountAntenna2Raw()); - tfsideADeploymentCountAntenna3Raw.setText("" + o.sideADeploymentCountAntenna3Raw()); - tfsideADeploymentCountAntenna4Raw.setText("" + o.sideADeploymentCountAntenna4Raw()); - tfsideADeploymentTimeAntenna1Raw.setText("" + o.sideADeploymentTimeAntenna1Raw()); - tfsideADeploymentTimeAntenna2Raw.setText("" + o.sideADeploymentTimeAntenna2Raw()); - tfsideADeploymentTimeAntenna3Raw.setText("" + o.sideADeploymentTimeAntenna3Raw()); - tfsideADeploymentTimeAntenna4Raw.setText("" + o.sideADeploymentTimeAntenna4Raw()); - tfsideBAntsTemperatureRaw.setText("" + o.sideBAntsTemperatureRaw()); - tfsideBAntsDeploymentStatusRaw.setText("" + o.sideBAntsDeploymentStatusRaw()); - tfsideBAntsUptimeRaw.setText("" + o.sideBAntsUptimeRaw()); - tfsideBDeploymentCountAntenna1Raw.setText("" + o.sideBDeploymentCountAntenna1Raw()); - tfsideBDeploymentCountAntenna2Raw.setText("" + o.sideBDeploymentCountAntenna2Raw()); - tfsideBDeploymentCountAntenna3Raw.setText("" + o.sideBDeploymentCountAntenna3Raw()); - tfsideBDeploymentCountAntenna4Raw.setText("" + o.sideBDeploymentCountAntenna4Raw()); - tfsideBDeploymentTimeAntenna1Raw.setText("" + o.sideBDeploymentTimeAntenna1Raw()); - tfsideBDeploymentTimeAntenna2Raw.setText("" + o.sideBDeploymentTimeAntenna2Raw()); - tfsideBDeploymentTimeAntenna3Raw.setText("" + o.sideBDeploymentTimeAntenna3Raw()); - tfsideBDeploymentTimeAntenna4Raw.setText("" + o.sideBDeploymentTimeAntenna4Raw()); -} - private void allocateBeacon(Beacon o) { - tfswModeRaw.setText("" +decodeSwMode( o.swModeRaw())); - // MCR Add decoder - tflastResetReasonRaw.setText("" + decodelastResetReason(o.lastResetReasonRaw())); - // MCR Add decoder - tfresetOrderRaw.setText("" + decodeResetOrder (o.resetOrderRaw())); - tfnbResetRaw.setText("" + o.nbResetRaw()); - tfformatSdcardOrderRaw.setText("" + o.formatSdcardOrderRaw()); - tfdeployAntennasSystemRaw.setText("" + o.deployAntennasSystemRaw()); - tfnbTmSinceFirstStartRaw.setText("" + o.nbTmSinceFirstStartRaw()); - tfnbTcSinceFirstStartRaw.setText("" + o.nbTcSinceFirstStartRaw()); - tfnbTcPingSinceFirstStartRaw.setText("" + o.nbTcPingSinceFirstStartRaw()); - tfnbBadTcSinceFirstStartRaw.setText("" + o.nbBadTcSinceFirstStartRaw()); - tfnbTmInSdcardRaw.setText("" + o.nbTmInSdcardRaw()); - tftrxvutxInstantaneousRfReflectedPowerFromTransmitterPortMw.setText( String.format("%.3f", o.trxvutxInstantaneousRfReflectedPowerFromTransmitterPortMw())); - tftrxvutxInstantaneousRfForwardPowerFromTransmitterPortMw.setText( String.format("%.3f", o.trxvutxInstantaneousRfForwardPowerFromTransmitterPortMw())); - tftrxvutxSupplyVoltageV.setText( String.format("%.3f", o.trxvutxSupplyVoltageV())); - tftrxvutxTotalSupplyCurrentMa.setText( String.format("%.3f", o.trxvutxTotalSupplyCurrentMa())); - tftrxvutxTransmitterCurrentMa.setText( String.format("%.3f", o.trxvutxTransmitterCurrentMa())); - tftrxvutxReceiverCurrentMa.setText( String.format("%.3f", o.trxvutxReceiverCurrentMa())); - tftrxvutxPowerAmplifierCurrentMa.setText( String.format("%.3f", o.trxvutxPowerAmplifierCurrentMa())); - tftrxvutxPowerAmplifierTemperatureC.setText( String.format("%.3f", o.trxvutxPowerAmplifierTemperatureC())); - tftrxvutxLocalOscillatorTemperatureC.setText( String.format("%.3f", o.trxvutxLocalOscillatorTemperatureC())); - tftrxvurxInstantaneousReceivedSignalDopplerHz.setText( String.format("%.3f", o.trxvurxInstantaneousReceivedSignalDopplerHz())); - tftrxvurxInstantaneousReceivedSignalStrengthDbm.setText( String.format("%.3f", o.trxvurxInstantaneousReceivedSignalStrengthDbm())); - tftrxvurxSupplyVoltageV.setText( String.format("%.3f", o.trxvurxSupplyVoltageV())); - tftrxvurxTotalSupplyCurrentMa.setText( String.format("%.3f", o.trxvurxTotalSupplyCurrentMa())); - tftrxvurxTransmitterCurrentMa.setText( String.format("%.3f", o.trxvurxTransmitterCurrentMa())); - tftrxvurxReceiverCurrentMa.setText( String.format("%.3f", o.trxvurxReceiverCurrentMa())); - tftrxvurxPowerAmplifierCurrentMa.setText( String.format("%.3f", o.trxvurxPowerAmplifierCurrentMa())); - tftrxvurxPowerAmplifierTemperatureC.setText( String.format("%.3f", o.trxvurxPowerAmplifierTemperatureC())); - tftrxvurxLocalOscillatorTemperatureC.setText( String.format("%.3f", o.trxvurxLocalOscillatorTemperatureC())); - tfimtqSystemStateModeRaw.setText("" + o.imtqSystemStateModeRaw()); - tfmeasureCoilXCurrentMa.setText( String.format("%.3f", o.measureCoilXCurrentMa())); - tfmeasureCoilYCurrentMa.setText( String.format("%.3f", o.measureCoilYCurrentMa())); - tfmeasureCoilZCurrentMa.setText( String.format("%.3f", o.measureCoilZCurrentMa())); - tfmeasureCoilXTemperatureC.setText( String.format("%.3f", o.measureCoilXTemperatureC())); - tfmeasureCoilYTemperatureC.setText( String.format("%.3f", o.measureCoilYTemperatureC())); - tfmeasureCoilZTemperatureC.setText( String.format("%.3f", o.measureCoilZTemperatureC())); - tfmcuTemperatureC.setText( String.format("%.3f", o.mcuTemperatureC())); - tfsideAAntsTemperatureRaw.setText("" + o.sideAAntsTemperatureRaw()); - tfsideAAntsDeploymentStatusRaw.setText("" + o.sideAAntsDeploymentStatusRaw()); - tfvoltBrdSupRawV.setText( String.format("%.3f", o.voltBrdSupRawV())); - tftempRawT.setText( String.format("%.3f", o.tempRawT())); - tfvDistInputRawV.setText( String.format("%.3f", o.vDistInputRawV())); - tfiDistInputRawMa.setText( String.format("%.3f", o.iDistInputRawMa())); - tfpDistInputRawMw.setText( String.format("%.3f", o.pDistInputRawMw())); - tfvBattInputRawV.setText( String.format("%.3f", o.vBattInputRawV())); - tfiBattInputRawMa.setText( String.format("%.3f", o.iBattInputRawMa())); - tfpBattInputRawMw.setText( String.format("%.3f", o.pBattInputRawMw())); - tfstatObcOnRaw.setText("" + o.statObcOnRaw()); - tfstatObcOcfRaw.setText("" + o.statObcOcfRaw()); - tfbatStatRaw.setText("" + o.batStatRaw()); - tfbatTemp2RawT.setText( String.format("%.3f", o.batTemp2RawT())); - tfvoltVd0Raw.setText("" + o.voltVd0Raw()); - tfvoltVd1Raw.setText("" + o.voltVd1Raw()); - tfvoltVd2Raw.setText("" + o.voltVd2Raw()); - tfvObc00V.setText( String.format("%.3f", o.vObc00V())); - tfiObc00Ma.setText( String.format("%.3f", o.iObc00Ma())); - tfpObc00Mw.setText( String.format("%.3f", o.pObc00Mw())); - tfvObc01V.setText( String.format("%.3f", o.vObc01V())); - tfiObc01Ma.setText( String.format("%.3f", o.iObc01Ma())); - tfpObc01Mw.setText( String.format("%.3f", o.pObc01Mw())); - tfvObc02V.setText( String.format("%.3f", o.vObc02V())); - tfiObc02Ma.setText( String.format("%.3f", o.iObc02Ma())); - tfpObc02Mw.setText( String.format("%.3f", o.pObc02Mw())); - tfvObc03V.setText( String.format("%.3f", o.vObc03V())); - tfiObc03Ma.setText( String.format("%.3f", o.iObc03Ma())); - tfpObc03Mw.setText( String.format("%.3f", o.pObc03Mw())); - tfvObc05V.setText( String.format("%.3f", o.vObc05V())); - tfiObc05Ma.setText( String.format("%.3f", o.iObc05Ma())); - tfpObc05Mw.setText( String.format("%.3f", o.pObc05Mw())); - tfvObc06V.setText( String.format("%.3f", o.vObc06V())); - tfiObc06Ma.setText( String.format("%.3f", o.iObc06Ma())); - tfpObc06Mw.setText( String.format("%.3f", o.pObc06Mw())); - tfstatusStidRaw.setText("" + o.statusStidRaw()); - tfstatusIvidRaw.setText("" + o.statusIvidRaw()); - tfstatusRcRaw.setText("" + o.statusRcRaw()); - tfstatusBidRaw.setText("" + o.statusBidRaw()); - tfstatusCmderrRaw.setText("" + o.statusCmderrRaw()); - tfstatusStatRaw.setText("" + o.statusStatRaw()); - tfmodeRaw.setText("" + o.modeRaw()); - tfconfRaw.setText("" + o.confRaw()); - tfresetCauseRaw.setText("" + o.resetCauseRaw()); - tfuptimeRaw.setText("" + o.uptimeRaw()); - tferrorRaw.setText("" + o.errorRaw()); - tfrcCntPwronRaw.setText("" + o.rcCntPwronRaw()); - tfrcCntWdgRaw.setText("" + o.rcCntWdgRaw()); - tfrcCntCmdRaw.setText("" + o.rcCntCmdRaw()); - tfrcCntMcuRaw.setText("" + o.rcCntMcuRaw()); - tfrcCntEmlopoRaw.setText("" + o.rcCntEmlopoRaw()); - tfprevcmdElapsedRaw.setText("" + o.prevcmdElapsedRaw()); - tfphotodiode1Raw.setText("" + o.photodiode1Raw()); - tfphotodiode2Raw.setText("" + o.photodiode2Raw()); - tfphotodiode3Raw.setText("" + o.photodiode3Raw()); - tfphotodiode4Raw.setText("" + o.photodiode4Raw()); - tfphotodiode5Raw.setText("" + o.photodiode5Raw()); - tfphotodiode6Raw.setText("" + o.photodiode6Raw()); - tfpanelTemperature1C.setText( String.format("%.3f", o.panelTemperature1C())); - tfpanelTemperature2C.setText( String.format("%.3f", o.panelTemperature2C())); - tfpanelTemperature3C.setText( String.format("%.3f", o.panelTemperature3C())); - tfpanelTemperature4C.setText( String.format("%.3f", o.panelTemperature4C())); - tfpanelTemperature5C.setText( String.format("%.3f", o.panelTemperature5C())); - tfpanelTemperature6C.setText( String.format("%.3f", o.panelTemperature6C())); -} - private void allocateIepsHkStatus(IepsHkStatus o) { - tfhKStidRaw.setText("" + o.hKStidRaw()); - tfhKIvidRaw.setText("" + o.hKIvidRaw()); - tfhKRcRaw.setText("" + o.hKRcRaw()); - tfhKBidRaw.setText("" + o.hKBidRaw()); - tfhKCmderrRaw.setText("" + o.hKCmderrRaw()); - tfhKStatRaw.setText("" + o.hKStatRaw()); - tfvoltBrdSupRawV.setText( String.format("%.3f", o.voltBrdSupRawV())); - tftempRawT.setText( String.format("%.3f", o.tempRawT())); - tfvDistInputRawV.setText( String.format("%.3f", o.vDistInputRawV())); - tfiDistInputRawMa.setText( String.format("%.3f", o.iDistInputRawMa())); - tfpDistInputRawMw.setText( String.format("%.3f", o.pDistInputRawMw())); - tfvBattInputRawV.setText( String.format("%.3f", o.vBattInputRawV())); - tfiBattInputRawMa.setText( String.format("%.3f", o.iBattInputRawMa())); - tfpBattInputRawMw.setText( String.format("%.3f", o.pBattInputRawMw())); - tfstatObcOnRaw.setText("" + o.statObcOnRaw()); - tfstatObcOcfRaw.setText("" + o.statObcOcfRaw()); - tfbatStatRaw.setText("" + o.batStatRaw()); - tfbatTemp2RawT.setText( String.format("%.3f", o.batTemp2RawT())); - tfvoltVd0Raw.setText("" + o.voltVd0Raw()); - tfvoltVd1Raw.setText("" + o.voltVd1Raw()); - tfvoltVd2Raw.setText("" + o.voltVd2Raw()); - tfvObc00V.setText( String.format("%.3f", o.vObc00V())); - tfiObc00Ma.setText( String.format("%.3f", o.iObc00Ma())); - tfpObc00Mw.setText( String.format("%.3f", o.pObc00Mw())); - tfvObc01V.setText( String.format("%.3f", o.vObc01V())); - tfiObc01Ma.setText( String.format("%.3f", o.iObc01Ma())); - tfpObc01Mw.setText( String.format("%.3f", o.pObc01Mw())); - tfvObc02V.setText( String.format("%.3f", o.vObc02V())); - tfiObc02Ma.setText( String.format("%.3f", o.iObc02Ma())); - tfpObc02Mw.setText( String.format("%.3f", o.pObc02Mw())); - tfvObc03V.setText( String.format("%.3f", o.vObc03V())); - tfiObc03Ma.setText( String.format("%.3f", o.iObc03Ma())); - tfpObc03Mw.setText( String.format("%.3f", o.pObc03Mw())); - tfvObc05V.setText( String.format("%.3f", o.vObc05V())); - tfiObc05Ma.setText( String.format("%.3f", o.iObc05Ma())); - tfpObc05Mw.setText( String.format("%.3f", o.pObc05Mw())); - tfvObc06V.setText( String.format("%.3f", o.vObc06V())); - tfiObc06Ma.setText( String.format("%.3f", o.iObc06Ma())); - tfpObc06Mw.setText( String.format("%.3f", o.pObc06Mw())); - tfcc1Byte.setText(toStringData( o.cc1Byte())); - tfcc2Byte.setText(toStringData( o.cc2Byte())); - tfcc3Byte.setText(toStringData( o.cc3Byte())); - tfstatusStidRaw.setText("" + o.statusStidRaw()); - tfstatusIvidRaw.setText("" + o.statusIvidRaw()); - tfstatusRcRaw.setText("" + o.statusRcRaw()); - tfstatusBidRaw.setText("" + o.statusBidRaw()); - tfstatusCmderrRaw.setText("" + o.statusCmderrRaw()); - tfstatusStatRaw.setText("" + o.statusStatRaw()); - tfmodeRaw.setText("" + o.modeRaw()); - tfconfRaw.setText("" + o.confRaw()); - tfresetCauseRaw.setText("" + o.resetCauseRaw()); - tfuptimeRaw.setText("" + o.uptimeRaw()); - tferrorRaw.setText("" + o.errorRaw()); - tfrcCntPwronRaw.setText("" + o.rcCntPwronRaw()); - tfrcCntWdgRaw.setText("" + o.rcCntWdgRaw()); - tfrcCntCmdRaw.setText("" + o.rcCntCmdRaw()); - tfrcCntMcuRaw.setText("" + o.rcCntMcuRaw()); - tfrcCntEmlopoRaw.setText("" + o.rcCntEmlopoRaw()); - tfprevcmdElapsedRaw.setText("" + o.prevcmdElapsedRaw()); -} - private void allocateImtqHk(ImtqHk o) { - tfdigitaleVoltageV.setText( String.format("%.3f", o.digitaleVoltageV())); - tfanalogVoltageV.setText( String.format("%.3f", o.analogVoltageV())); - tfdigitalCurrentRaw.setText("" + o.digitalCurrentRaw()); - tfanalogCurrentRaw.setText("" + o.analogCurrentRaw()); - tfmeasureCoilXCurrentMa.setText( String.format("%.3f", o.measureCoilXCurrentMa())); - tfmeasureCoilYCurrentMa.setText( String.format("%.3f", o.measureCoilYCurrentMa())); - tfmeasureCoilZCurrentMa.setText( String.format("%.3f", o.measureCoilZCurrentMa())); - tfmeasureCoilXTemperatureC.setText( String.format("%.3f", o.measureCoilXTemperatureC())); - tfmeasureCoilYTemperatureC.setText( String.format("%.3f", o.measureCoilYTemperatureC())); - tfmeasureCoilZTemperatureC.setText( String.format("%.3f", o.measureCoilZTemperatureC())); - tfmcuTemperatureC.setText( String.format("%.3f", o.mcuTemperatureC())); - tfimtqSystemStateModeRaw.setText("" + o.imtqSystemStateModeRaw()); - tfimtqSystemStateErrorRaw.setText("" + o.imtqSystemStateErrorRaw()); - tfimtqSystemStateConfigurationRaw.setText("" + o.imtqSystemStateConfigurationRaw()); - tfimtqSystemStateUptimeRaw.setText("" + o.imtqSystemStateUptimeRaw()); -} - private void allocateMainboardAllScience(MainboardAllScience o) { - tfmainboardScienceTimeRaw.setText("" + o.mainboardScienceTimeRaw()); - tfteachWearOnRaw.setText("" + o.teachWearOnRaw()); - tffrequenceOfAcquisitionsRaw.setText("" + o.frequenceOfAcquisitionsRaw()); - tfgainRaw.setText("" + o.gainRaw()); - tfnumberOfAcquisitionCommandedRaw.setText("" + o.numberOfAcquisitionCommandedRaw()); - tfnumberOfRealAcquisitionRaw.setText("" + o.numberOfRealAcquisitionRaw()); - tfhkPlus5vRaw.setText("" + o.hkPlus5vRaw()); - tfhkMinus5vRaw.setText("" + o.hkMinus5vRaw()); - tfhkMinus5vPolarRaw.setText("" + o.hkMinus5vPolarRaw()); - tfhkTempAdcRaw.setText("" + o.hkTempAdcRaw()); - tfhkFeePlusXVrefRaw.setText("" + o.hkFeePlusXVrefRaw()); - tfhkFeeMinusXVrefRaw.setText("" + o.hkFeeMinusXVrefRaw()); - tfhkFeePlusYVrefRaw.setText("" + o.hkFeePlusYVrefRaw()); - tfhkFeeMinusYVrefRaw.setText("" + o.hkFeeMinusYVrefRaw()); - tffeePlusXErs1SignalRaw.setText("" + o.feePlusXErs1SignalRaw()); - tffeePlusXErs1TemperatureRaw.setText("" + o.feePlusXErs1TemperatureRaw()); - tffeePlusXErs2SignalRaw.setText("" + o.feePlusXErs2SignalRaw()); - tffeePlusXErs2TemperatureRaw.setText("" + o.feePlusXErs2TemperatureRaw()); - tffeePlusXErs3SignalRaw.setText("" + o.feePlusXErs3SignalRaw()); - tffeePlusXErs3TemperatureRaw.setText("" + o.feePlusXErs3TemperatureRaw()); - tffeePlusXUvsSignalRaw.setText("" + o.feePlusXUvsSignalRaw()); - tffeeMinusXErs1SignalRaw.setText("" + o.feeMinusXErs1SignalRaw()); - tffeeMinusXErs1TemperatureRaw.setText("" + o.feeMinusXErs1TemperatureRaw()); - tffeeMinusXErs2SignalRaw.setText("" + o.feeMinusXErs2SignalRaw()); - tffeeMinusXErs2TemperatureRaw.setText("" + o.feeMinusXErs2TemperatureRaw()); - tffeeMinusXErs3SignalRaw.setText("" + o.feeMinusXErs3SignalRaw()); - tffeeMinusXErs3TemperatureRaw.setText("" + o.feeMinusXErs3TemperatureRaw()); - tffeeMinusXUvsSignalRaw.setText("" + o.feeMinusXUvsSignalRaw()); - tffeePlusYErs1SignalRaw.setText("" + o.feePlusYErs1SignalRaw()); - tffeePlusYErs1TemperatureRaw.setText("" + o.feePlusYErs1TemperatureRaw()); - tffeePlusYErs2SignalRaw.setText("" + o.feePlusYErs2SignalRaw()); - tffeePlusYErs2TemperatureRaw.setText("" + o.feePlusYErs2TemperatureRaw()); - tffeePlusYErs3SignalRaw.setText("" + o.feePlusYErs3SignalRaw()); - tffeePlusYErs3TemperatureRaw.setText("" + o.feePlusYErs3TemperatureRaw()); - tffeePlusYUvsSignalRaw.setText("" + o.feePlusYUvsSignalRaw()); - tffeeMinusYErs1SignalRaw.setText("" + o.feeMinusYErs1SignalRaw()); - tffeeMinusYErs1TemperatureRaw.setText("" + o.feeMinusYErs1TemperatureRaw()); - tffeeMinusYErs2SignalRaw.setText("" + o.feeMinusYErs2SignalRaw()); - tffeeMinusYErs2TemperatureRaw.setText("" + o.feeMinusYErs2TemperatureRaw()); - tffeeMinusYErs3SignalRaw.setText("" + o.feeMinusYErs3SignalRaw()); - tffeeMinusYErs3TemperatureRaw.setText("" + o.feeMinusYErs3TemperatureRaw()); - tffeeMinusYUvsSignalRaw.setText("" + o.feeMinusYUvsSignalRaw()); - tfteachwearAccXRaw.setText("" + o.teachwearAccXRaw()); - tfteachwearAccYRaw.setText("" + o.teachwearAccYRaw()); - tfteachwearAccZRaw.setText("" + o.teachwearAccZRaw()); - tfteachwearDegCRaw.setText("" + o.teachwearDegCRaw()); - tfteachwearGyroXRaw.setText("" + o.teachwearGyroXRaw()); - tfteachwearGyroYRaw.setText("" + o.teachwearGyroYRaw()); - tfteachwearGyroZRaw.setText("" + o.teachwearGyroZRaw()); - tfteachwearMagnXRaw.setText("" + o.teachwearMagnXRaw()); - tfteachwearMagnYRaw.setText("" + o.teachwearMagnYRaw()); - tfteachwearMagnZRaw.setText("" + o.teachwearMagnZRaw()); - tfteachwearStateRaw.setText("" + o.teachwearStateRaw()); - tfteachwearResetReasonRaw.setText("" + o.teachwearResetReasonRaw()); - tfteachwearCRCRaw.setText("" + o.teachwearCRCRaw()); - tfnbTmSinceFirstStartRaw.setText("" + o.nbTmSinceFirstStartRaw()); -} - private void allocateMainboardHk(MainboardHk o) { - tfmainboardHKTimeRaw.setText("" + o.mainboardHKTimeRaw()); - tfhkPlus5VRaw.setText("" + o.hkPlus5VRaw()); - tfhkMinus5VRaw.setText("" + o.hkMinus5VRaw()); - tfhkMinusPolarRaw.setText("" + o.hkMinusPolarRaw()); - tfhkTempADCRaw.setText("" + o.hkTempADCRaw()); - tfhkFeePlusXVrefRaw.setText("" + o.hkFeePlusXVrefRaw()); - tfhkFeeMinusXVrefRaw.setText("" + o.hkFeeMinusXVrefRaw()); - tfhkFeePlusYVrefRaw.setText("" + o.hkFeePlusYVrefRaw()); - tfhkFeeMinusYVrefRaw.setText("" + o.hkFeeMinusYVrefRaw()); -} - private void allocateObcHk(ObcHk o) { - tfdummyRaw.setText("" + o.dummyRaw()); - tfspiCommandStatusRaw.setText("" + o.spiCommandStatusRaw()); - tfsupervisorEnableStatusRaw.setText("" + o.supervisorEnableStatusRaw()); - tfsupervisorUptimeRaw.setText("" + o.supervisorUptimeRaw()); - tfiobcUptimeRaw.setText("" + o.iobcUptimeRaw()); - tfiobcResetCountRaw.setText("" + o.iobcResetCountRaw()); - tfiobcMeasureTemperatureRaw.setText("" + o.iobcMeasureTemperatureRaw()); - tfiobcMeasure3v3InRaw.setText("" + o.iobcMeasure3v3InRaw()); - tfiobcMeasure3v3Raw.setText("" + o.iobcMeasure3v3Raw()); - tfiobcMeasure2vReferenceRaw.setText("" + o.iobcMeasure2vReferenceRaw()); - tfiobcMeasure1v8Raw.setText("" + o.iobcMeasure1v8Raw()); - tfiobcMeasure1v0Raw.setText("" + o.iobcMeasure1v0Raw()); - tfiobcMeasureCurrent3v3Raw.setText("" + o.iobcMeasureCurrent3v3Raw()); - tfiobcMeasureCurrent1v8Raw.setText("" + o.iobcMeasureCurrent1v8Raw()); - tfiobcMeasureCurrent1v0Raw.setText("" + o.iobcMeasureCurrent1v0Raw()); - tfiobcMeasureVoltRtcRaw.setText("" + o.iobcMeasureVoltRtcRaw()); - tfiobcAdcUpdateFlagRaw.setText("" + o.iobcAdcUpdateFlagRaw()); - tfiobcCrc8Raw.setText("" + o.iobcCrc8Raw()); - tfphotodiode1Raw.setText("" + o.photodiode1Raw()); - tfphotodiode2Raw.setText("" + o.photodiode2Raw()); - tfphotodiode3Raw.setText("" + o.photodiode3Raw()); - tfphotodiode4Raw.setText("" + o.photodiode4Raw()); - tfphotodiode5Raw.setText("" + o.photodiode5Raw()); - tfphotodiode6Raw.setText("" + o.photodiode6Raw()); - tfpanelTemperature1C.setText( String.format("%.3f", o.panelTemperature1C())); - tfpanelTemperature2C.setText( String.format("%.3f", o.panelTemperature2C())); - tfpanelTemperature3C.setText( String.format("%.3f", o.panelTemperature3C())); - tfpanelTemperature4C.setText( String.format("%.3f", o.panelTemperature4C())); - tfpanelTemperature5C.setText( String.format("%.3f", o.panelTemperature5C())); - tfpanelTemperature6C.setText( String.format("%.3f", o.panelTemperature6C())); -} + displayLog(conf.getSIDSSatnogsURL()); + displayLog(conf.getSIDSAMSATUrl()); + displayLog("Initialisation with Properties File Done "); - private void allocateObcStatus(ObcStatus o) { - // MCR - // tfdummydummy.setText( ""+ o.dummy()); - tfspiCommandStatusRaw.setText("" + o.spiCommandStatusRaw()); - tfsupervisorIndexOfSubsystemRaw.setText("" + o.supervisorIndexOfSubsystemRaw()); - tfsupervisorMajorVersionRaw.setText("" + o.supervisorMajorVersionRaw()); - tfsupervisorMinorVersionRaw.setText("" + o.supervisorMinorVersionRaw()); - tfsupervisorPatchVersionRaw.setText("" + o.supervisorPatchVersionRaw()); - tfsupervisorGitHeadVersionRaw.setText("" + o.supervisorGitHeadVersionRaw()); - tfsupervisorSerialNumberRaw.setText("" + o.supervisorSerialNumberRaw()); - tfcompilationInformationByte.setText(toStringData(o.compilationInformationByte())); - tfclockSpeedRaw.setText("" + o.clockSpeedRaw()); - tfcodeTypeRaw.setText("" + o.codeTypeRaw()); - tfcrc8Raw.setText("" + o.crc8Raw()); - tfswMmodeRaw.setText("" + o.swMmodeRaw()); - tflastResetReasonRaw.setText("" + decodelastResetReason(o.lastResetReasonRaw())); - tfreservedRaw.setText("" + o.reservedRaw()); - tfnbResetRaw.setText("" + o.nbResetRaw()); - tfreserved2Raw.setText("" + o.reserved2Raw()); - tfdeployAntennasSystemRaw.setText("" + o.deployAntennasSystemRaw()); - tfnbTmSinceFirstStartRaw.setText("" + o.nbTmSinceFirstStartRaw()); - tfnbTcSinceFirstStartRaw.setText("" + o.nbTcSinceFirstStartRaw()); - tfnbBadTcSinceFirstStartRaw.setText("" + o.nbBadTcSinceFirstStartRaw()); - tfnbTmInSdcardRaw.setText("" + o.nbTmInSdcardRaw()); - tfsdcardStatusRaw.setText("" + o.sdcardStatusRaw()); - tfsdcardLastErrorRaw.setText("" + o.sdcardLastErrorRaw()); - tfoldTimeTMInSdcardRaw.setText("" + o.oldTimeTMInSdcardRaw()); - tfnewTimeTMInSdcardRaw.setText("" + o.newTimeTMInSdcardRaw()); -} - private void allocateTrxvurxHk(TrxvurxHk o) { - tftrxvurxInstantaneousReceivedSignalDopplerHz.setText( String.format("%.3f", o.trxvurxInstantaneousReceivedSignalDopplerHz())); - tftrxvurxInstantaneousReceivedSignalStrengthDbm.setText( String.format("%.3f", o.trxvurxInstantaneousReceivedSignalStrengthDbm())); - tftrxvurxSupplyVoltageV.setText( String.format("%.3f", o.trxvurxSupplyVoltageV())); - tftrxvurxTotalSupplyCurrentMa.setText( String.format("%.3f", o.trxvurxTotalSupplyCurrentMa())); - tftrxvurxTransmitterCurrentMa.setText( String.format("%.3f", o.trxvurxTransmitterCurrentMa())); - tftrxvurxReceiverCurrentMa.setText( String.format("%.3f", o.trxvurxReceiverCurrentMa())); - tftrxvurxPowerAmplifierCurrentMa.setText( String.format("%.3f", o.trxvurxPowerAmplifierCurrentMa())); - tftrxvurxPowerAmplifierTemperatureC.setText( String.format("%.3f", o.trxvurxPowerAmplifierTemperatureC())); - tftrxvurxLocalOscillatorTemperatureC.setText( String.format("%.3f", o.trxvurxLocalOscillatorTemperatureC())); - tftrxvurxZeroPaddingRaw.setText("" + o.trxvurxZeroPaddingRaw()); - tftrxvuRxUptimeRaw.setText("" + o.trxvuRxUptimeRaw()); -} - private void allocateTrxvutxHk(TrxvutxHk o) { - tftrxvutxInstantaneousRfReflectedPowerFromTransmitterPortMw.setText( String.format("%.3f", o.trxvutxInstantaneousRfReflectedPowerFromTransmitterPortMw())); - tftrxvutxInstantaneousRfForwardPowerFromTransmitterPortMw.setText( String.format("%.3f", o.trxvutxInstantaneousRfForwardPowerFromTransmitterPortMw())); - tftrxvutxSupplyVoltageV.setText( String.format("%.3f", o.trxvutxSupplyVoltageV())); - tftrxvutxTotalSupplyCurrentMa.setText( String.format("%.3f", o.trxvutxTotalSupplyCurrentMa())); - tftrxvutxTransmitterCurrentMa.setText( String.format("%.3f", o.trxvutxTransmitterCurrentMa())); - tftrxvutxReceiverCurrentMa.setText( String.format("%.3f", o.trxvutxReceiverCurrentMa())); - tftrxvutxPowerAmplifierCurrentMa.setText( String.format("%.3f", o.trxvutxPowerAmplifierCurrentMa())); - tftrxvutxPowerAmplifierTemperatureC.setText( String.format("%.3f", o.trxvutxPowerAmplifierTemperatureC())); - tftrxvutxLocalOscillatorTemperatureC.setText( String.format("%.3f", o.trxvutxLocalOscillatorTemperatureC())); - tftrxvutxZeroPaddingRaw.setText("" + o.trxvutxZeroPaddingRaw()); - tftrxvuTxUptimeRaw.setText("" + o.trxvuTxUptimeRaw()); - tftrxvuTxStateRaw.setText("" + o.trxvuTxStateRaw()); -} + BufferedImage bufferedImage1 = null; + BufferedImage bufferedImage2 = null; + + try { + + bufferedImage1 = ImageIO.read(getClass().getResource((imgAmsat))); + bufferedImage2 = ImageIO.read(getClass().getResource((imgSatellite))); + } catch (IOException e) { + + appLogger.severe("Error loading Image resources"); + appLogger.severe(e.toString()); + } + Image imageamsat = SwingFXUtils.toFXImage(bufferedImage1, null); + ImageViewAMSAT.setImage(imageamsat); + Image imgQB = SwingFXUtils.toFXImage(bufferedImage2, null); + imageViewSatellite.setImage(imgQB); + + String ver; + String message; + int NoradIdConf = conf.getNorad(); + if (c.isConnected()) { + ver = c.getProperty("UVSQSatDecoder"); + message = c.getProperty("Message"); + String noradid = c.getProperty("NoradID"); + + if (noradid != null) { + NoradIdConf = Integer.parseUnsignedInt(c.getProperty("NoradID").trim()); + } + } else { + ver = version; + message = "not connected to internet"; + } + if (NoradIdConf != 0) { + // ID norad attribué - mise à jours du logiciel + if (NoradIdConf != conf.getNorad()) { + conf.setNorad(NoradIdConf); + conf.save(); + displayLog("Norad ID updated "); + } + } + + manageStateMMI(STATE_INIT); + manageStatusinformation("Application Ready", "Application initialised"); + this.LabelInformation.setText(""); + + // initialise SIDS + + Station StationSatnogs = + new Station(conf.getSIDSSatnogsSource(), station.getLongitude(), station.getLatitude()); + Station StationEntry = + new Station(conf.getSIDSAMSATSource(), station.getLongitude(), station.getLatitude()); - - // Interpretation - - public String decodeSwMode(int mode) - { - String value = "Unknow"; - - switch(mode) { -// MODE_INIT = 0 - case 0 : value ="INIT"; - break; -// MODE_DETUMBLING = 1 - case 1 : value ="DETUMBLING"; - break; -// MODE_STANDBY = 2 - case 2 : value ="STANDBY"; - break; -// MODE_OPERATIONAL = 3 - case 3 : value ="OPERATIONAL"; - break; -// MODE_SAFE = 4 - case 4 : value ="SAFE"; - break; -// MODE_TRANSPONDER = 5 - case 5 : value ="TRANSPONDER"; - break; - } - return value; - - } - -// First start = 0 -// TC Init received = 0x80 -// No TC since 4 days = 0x81 -// Unknown reason = 0x81 - - public String decodelastResetReason(int lastResetReason) - { - String value = "Unknow"; - - switch(lastResetReason) { -// MODE_INIT = 0 - case 0 : value ="First start"; - break; -// MODE_DETUMBLING = 1 - case 0x80 : value ="TC Init"; - break; -// MODE_STANDBY = 2 - case 0x81 : value ="No TC since 4 days"; - break; -// MODE_OPERATIONAL = 3 - - } - return value; - - } - - - public String decodeResetOrder(int resetOrder) - { - - - - String value = "Unknow"; - - switch(resetOrder) { -// No order = 0 - case 0 : value ="No Order"; - break; -// Order by TC = 0xCA - case 0xCA : value ="TC Order"; - break; - - - } - return value; - - - } - - private String toStringData(byte[] bytes) { - StringBuffer buffer = new StringBuffer(); - - for (byte b : bytes) { - buffer.append(String.format("%02X ", b)); - } - return buffer.toString(); - } - + if (conf.isSISD_SatNogs() == true) { + SendSIDSSatnogs = new SendSIDS(StationSatnogs, conf.getNorad(), conf.getSIDSSatnogsURL()); + } + + if (conf.isSIDS_AMSAT() == true) { + SendSIDSMVPAmsat = new SendSIDS(StationEntry, conf.getNorad(), conf.getSIDSAMSATUrl()); + } + + String erreurmsg = message; + + if (ver.equals(version) == false) { + erreurmsg += " New version " + ver + " available ! "; + } + this.LabelInformation.setText(erreurmsg); + } + + private void manageStatusinformation(String statusMessage, String logMessage) { + labelStatus.setText(statusMessage); + displayLog(logMessage); + } + + private void displayLog(String log) { + appLogger.info(log); + logfile.displayLog(log); + TexAreaLog.appendText(log); + TexAreaLog.appendText("\r\n"); + } + + private void manageStateMMI(int state) { + switch (state) { + case STATE_INIT: + ButtonStop.setDisable(true); + ButtonStart.setDisable(false); + ButtonSave.setDisable(true); + break; + case STATE_START: + ButtonStop.setDisable(false); + ButtonStart.setDisable(true); + ButtonSave.setDisable(false); + break; + case STATE_STOP: + ButtonStop.setDisable(true); + ButtonStart.setDisable(false); + ButtonSave.setDisable(false); + break; + case STATE_SAVE: + ButtonStop.setDisable(true); + ButtonStart.setDisable(false); + ButtonSave.setDisable(true); + break; + default: + ButtonStop.setDisable(true); + ButtonStart.setDisable(false); + ButtonSave.setDisable(false); + break; + } + } + + private void updateFrame(long nbframe) { + LabelFrame.setText("frame : " + nbframe); + } + + private void SendSids(ReceivedData receivedData) { + + if (conf.isSIDS_AMSAT() == true) { + int results = SendSIDSMVPAmsat.Send(receivedData); + displayLog("Send SIDS AMSAT-F Database ; " + results); + } + + if (conf.isSISD_SatNogs() == true) { + int results = SendSIDSSatnogs.Send(receivedData); + displayLog("Send SIDS SatNogs Database : " + results); + } + } + + public void saveDataFile() { + SimpleDateFormat formater = new SimpleDateFormat("yyyy-MM-dd-HHmmss"); + Date aujourdhui = new Date(); + + // + + String path = System.getProperty("user.dir") + "/data"; + File apath = new File(path); + + if (!apath.exists()) { + if (apath.mkdir() == false) { + appLogger.severe("fail to create " + path); + } + } + + PrintWriter pw = null; + + long NbFrame = receivedFrame.getNumberFrame(); + + try { + pw = + new PrintWriter( + new FileWriter(path + "/" + formater.format(aujourdhui) + "-tlm-Hexa.txt")); + for (int i = 0; i < NbFrame; i++) { + pw.write(receivedFrame.getRawFrame(i)); + pw.write(LINE_SEPARATOR); + } + + pw.flush(); + pw.close(); + } catch (IOException e) { + e.printStackTrace(); + } + } + + private void displayUvsqsat(int sid, UiFrame uiFrame) { + + switch (sid) { + case 0x0E: + tfFrameName.setText("Message"); + allocateAmsatAscii((AmsatAscii) uiFrame.tlm()); + break; + case 0x0F: + tfFrameName.setText("Beacon"); + allocateBeacon((Beacon) uiFrame.tlm()); + break; + + case 0x10: + tfFrameName.setText("Ants HK"); + allocateAntsHk((AntsHk) uiFrame.tlm()); + break; + case 0x11: + // obc_status + tfFrameName.setText("OBC status"); + allocateObcStatus((ObcStatus) uiFrame.tlm()); + break; + case 0x12: + // obc_hk_tm + tfFrameName.setText("OBC HK"); + allocateObcHk((ObcHk) uiFrame.tlm()); + break; + case 0x13: + // 0x13: mainboard_all_science + tfFrameName.setText("Mainboard all science"); + allocateMainboardAllScience((MainboardAllScience) uiFrame.tlm()); + break; + case 0x14: + // 0x14: mainboard_hk + tfFrameName.setText("Mainboard HK"); + allocateMainboardHk((MainboardHk) uiFrame.tlm()); + break; + case 0x15: + // ieps_hk_status_tm + tfFrameName.setText("Ieps HK status "); + allocateIepsHkStatus((IepsHkStatus) uiFrame.tlm()); + break; + case 0x16: + // 0x16: trxvurx_hk + tfFrameName.setText("trxvurx HK"); + allocateTrxvurxHk((TrxvurxHk) uiFrame.tlm()); + break; + + case 0x17: + // imtq_hk_tm + tfFrameName.setText("IMTQ HK"); + allocateImtqHk((ImtqHk) uiFrame.tlm()); + break; + case 0x18: + // trxvutx_hk_tm + tfFrameName.setText("Trxvutx HK"); + allocateTrxvutxHk((TrxvutxHk) uiFrame.tlm()); + break; + + default: + tfFrameName.setText("SID not found"); + System.err.println("SID not found " + sid); + } + } + + private void allocateAmsatAscii(AmsatAscii tlm) { + this.TextAreaMessage.setText(tlm.messageStr()); + } + + public String getversion() { + return version; + } + + // ### All following code is generated + + private void allocateAntsHk(AntsHk o) { + tfsideAAntsTemperatureRaw.setText("" + o.sideAAntsTemperatureRaw()); + tfsideAAntsDeploymentStatusRaw.setText("" + o.sideAAntsDeploymentStatusRaw()); + tfsideAAntsUptimeRaw.setText("" + o.sideAAntsUptimeRaw()); + tfsideADeploymentCountAntenna1Raw.setText("" + o.sideADeploymentCountAntenna1Raw()); + tfsideADeploymentCountAntenna2Raw.setText("" + o.sideADeploymentCountAntenna2Raw()); + tfsideADeploymentCountAntenna3Raw.setText("" + o.sideADeploymentCountAntenna3Raw()); + tfsideADeploymentCountAntenna4Raw.setText("" + o.sideADeploymentCountAntenna4Raw()); + tfsideADeploymentTimeAntenna1Raw.setText("" + o.sideADeploymentTimeAntenna1Raw()); + tfsideADeploymentTimeAntenna2Raw.setText("" + o.sideADeploymentTimeAntenna2Raw()); + tfsideADeploymentTimeAntenna3Raw.setText("" + o.sideADeploymentTimeAntenna3Raw()); + tfsideADeploymentTimeAntenna4Raw.setText("" + o.sideADeploymentTimeAntenna4Raw()); + tfsideBAntsTemperatureRaw.setText("" + o.sideBAntsTemperatureRaw()); + tfsideBAntsDeploymentStatusRaw.setText("" + o.sideBAntsDeploymentStatusRaw()); + tfsideBAntsUptimeRaw.setText("" + o.sideBAntsUptimeRaw()); + tfsideBDeploymentCountAntenna1Raw.setText("" + o.sideBDeploymentCountAntenna1Raw()); + tfsideBDeploymentCountAntenna2Raw.setText("" + o.sideBDeploymentCountAntenna2Raw()); + tfsideBDeploymentCountAntenna3Raw.setText("" + o.sideBDeploymentCountAntenna3Raw()); + tfsideBDeploymentCountAntenna4Raw.setText("" + o.sideBDeploymentCountAntenna4Raw()); + tfsideBDeploymentTimeAntenna1Raw.setText("" + o.sideBDeploymentTimeAntenna1Raw()); + tfsideBDeploymentTimeAntenna2Raw.setText("" + o.sideBDeploymentTimeAntenna2Raw()); + tfsideBDeploymentTimeAntenna3Raw.setText("" + o.sideBDeploymentTimeAntenna3Raw()); + tfsideBDeploymentTimeAntenna4Raw.setText("" + o.sideBDeploymentTimeAntenna4Raw()); + } + + private void allocateBeacon(Beacon o) { + tfswModeRaw.setText("" + decodeSwMode(o.swModeRaw())); + // MCR Add decoder + tflastResetReasonRaw.setText("" + decodelastResetReason(o.lastResetReasonRaw())); + // MCR Add decoder + tfresetOrderRaw.setText("" + decodeResetOrder(o.resetOrderRaw())); + tfnbResetRaw.setText("" + o.nbResetRaw()); + tfformatSdcardOrderRaw.setText("" + o.formatSdcardOrderRaw()); + tfdeployAntennasSystemRaw.setText("" + o.deployAntennasSystemRaw()); + tfnbTmSinceFirstStartRaw.setText("" + o.nbTmSinceFirstStartRaw()); + tfnbTcSinceFirstStartRaw.setText("" + o.nbTcSinceFirstStartRaw()); + tfnbTcPingSinceFirstStartRaw.setText("" + o.nbTcPingSinceFirstStartRaw()); + tfnbBadTcSinceFirstStartRaw.setText("" + o.nbBadTcSinceFirstStartRaw()); + tfnbTmInSdcardRaw.setText("" + o.nbTmInSdcardRaw()); + tftrxvutxInstantaneousRfReflectedPowerFromTransmitterPortMw.setText( + String.format("%.3f", o.trxvutxInstantaneousRfReflectedPowerFromTransmitterPortMw())); + tftrxvutxInstantaneousRfForwardPowerFromTransmitterPortMw.setText( + String.format("%.3f", o.trxvutxInstantaneousRfForwardPowerFromTransmitterPortMw())); + tftrxvutxSupplyVoltageV.setText(String.format("%.3f", o.trxvutxSupplyVoltageV())); + tftrxvutxTotalSupplyCurrentMa.setText(String.format("%.3f", o.trxvutxTotalSupplyCurrentMa())); + tftrxvutxTransmitterCurrentMa.setText(String.format("%.3f", o.trxvutxTransmitterCurrentMa())); + tftrxvutxReceiverCurrentMa.setText(String.format("%.3f", o.trxvutxReceiverCurrentMa())); + tftrxvutxPowerAmplifierCurrentMa.setText( + String.format("%.3f", o.trxvutxPowerAmplifierCurrentMa())); + tftrxvutxPowerAmplifierTemperatureC.setText( + String.format("%.3f", o.trxvutxPowerAmplifierTemperatureC())); + tftrxvutxLocalOscillatorTemperatureC.setText( + String.format("%.3f", o.trxvutxLocalOscillatorTemperatureC())); + tftrxvurxInstantaneousReceivedSignalDopplerHz.setText( + String.format("%.3f", o.trxvurxInstantaneousReceivedSignalDopplerHz())); + tftrxvurxInstantaneousReceivedSignalStrengthDbm.setText( + String.format("%.3f", o.trxvurxInstantaneousReceivedSignalStrengthDbm())); + tftrxvurxSupplyVoltageV.setText(String.format("%.3f", o.trxvurxSupplyVoltageV())); + tftrxvurxTotalSupplyCurrentMa.setText(String.format("%.3f", o.trxvurxTotalSupplyCurrentMa())); + tftrxvurxTransmitterCurrentMa.setText(String.format("%.3f", o.trxvurxTransmitterCurrentMa())); + tftrxvurxReceiverCurrentMa.setText(String.format("%.3f", o.trxvurxReceiverCurrentMa())); + tftrxvurxPowerAmplifierCurrentMa.setText( + String.format("%.3f", o.trxvurxPowerAmplifierCurrentMa())); + tftrxvurxPowerAmplifierTemperatureC.setText( + String.format("%.3f", o.trxvurxPowerAmplifierTemperatureC())); + tftrxvurxLocalOscillatorTemperatureC.setText( + String.format("%.3f", o.trxvurxLocalOscillatorTemperatureC())); + tfimtqSystemStateModeRaw.setText("" + o.imtqSystemStateModeRaw()); + tfmeasureCoilXCurrentMa.setText(String.format("%.3f", o.measureCoilXCurrentMa())); + tfmeasureCoilYCurrentMa.setText(String.format("%.3f", o.measureCoilYCurrentMa())); + tfmeasureCoilZCurrentMa.setText(String.format("%.3f", o.measureCoilZCurrentMa())); + tfmeasureCoilXTemperatureC.setText(String.format("%.3f", o.measureCoilXTemperatureC())); + tfmeasureCoilYTemperatureC.setText(String.format("%.3f", o.measureCoilYTemperatureC())); + tfmeasureCoilZTemperatureC.setText(String.format("%.3f", o.measureCoilZTemperatureC())); + tfmcuTemperatureC.setText(String.format("%.3f", o.mcuTemperatureC())); + tfsideAAntsTemperatureRaw.setText("" + o.sideAAntsTemperatureRaw()); + tfsideAAntsDeploymentStatusRaw.setText("" + o.sideAAntsDeploymentStatusRaw()); + tfvoltBrdSupRawV.setText(String.format("%.3f", o.voltBrdSupRawV())); + tftempRawT.setText(String.format("%.3f", o.tempRawT())); + tfvDistInputRawV.setText(String.format("%.3f", o.vDistInputRawV())); + tfiDistInputRawMa.setText(String.format("%.3f", o.iDistInputRawMa())); + tfpDistInputRawMw.setText(String.format("%.3f", o.pDistInputRawMw())); + tfvBattInputRawV.setText(String.format("%.3f", o.vBattInputRawV())); + tfiBattInputRawMa.setText(String.format("%.3f", o.iBattInputRawMa())); + tfpBattInputRawMw.setText(String.format("%.3f", o.pBattInputRawMw())); + tfstatObcOnRaw.setText("" + o.statObcOnRaw()); + tfstatObcOcfRaw.setText("" + o.statObcOcfRaw()); + tfbatStatRaw.setText("" + o.batStatRaw()); + tfbatTemp2RawT.setText(String.format("%.3f", o.batTemp2RawT())); + tfvoltVd0Raw.setText("" + o.voltVd0Raw()); + tfvoltVd1Raw.setText("" + o.voltVd1Raw()); + tfvoltVd2Raw.setText("" + o.voltVd2Raw()); + tfvObc00V.setText(String.format("%.3f", o.vObc00V())); + tfiObc00Ma.setText(String.format("%.3f", o.iObc00Ma())); + tfpObc00Mw.setText(String.format("%.3f", o.pObc00Mw())); + tfvObc01V.setText(String.format("%.3f", o.vObc01V())); + tfiObc01Ma.setText(String.format("%.3f", o.iObc01Ma())); + tfpObc01Mw.setText(String.format("%.3f", o.pObc01Mw())); + tfvObc02V.setText(String.format("%.3f", o.vObc02V())); + tfiObc02Ma.setText(String.format("%.3f", o.iObc02Ma())); + tfpObc02Mw.setText(String.format("%.3f", o.pObc02Mw())); + tfvObc03V.setText(String.format("%.3f", o.vObc03V())); + tfiObc03Ma.setText(String.format("%.3f", o.iObc03Ma())); + tfpObc03Mw.setText(String.format("%.3f", o.pObc03Mw())); + tfvObc05V.setText(String.format("%.3f", o.vObc05V())); + tfiObc05Ma.setText(String.format("%.3f", o.iObc05Ma())); + tfpObc05Mw.setText(String.format("%.3f", o.pObc05Mw())); + tfvObc06V.setText(String.format("%.3f", o.vObc06V())); + tfiObc06Ma.setText(String.format("%.3f", o.iObc06Ma())); + tfpObc06Mw.setText(String.format("%.3f", o.pObc06Mw())); + tfstatusStidRaw.setText("" + o.statusStidRaw()); + tfstatusIvidRaw.setText("" + o.statusIvidRaw()); + tfstatusRcRaw.setText("" + o.statusRcRaw()); + tfstatusBidRaw.setText("" + o.statusBidRaw()); + tfstatusCmderrRaw.setText("" + o.statusCmderrRaw()); + tfstatusStatRaw.setText("" + o.statusStatRaw()); + tfmodeRaw.setText("" + o.modeRaw()); + tfconfRaw.setText("" + o.confRaw()); + tfresetCauseRaw.setText("" + o.resetCauseRaw()); + tfuptimeRaw.setText("" + o.uptimeRaw()); + tferrorRaw.setText("" + o.errorRaw()); + tfrcCntPwronRaw.setText("" + o.rcCntPwronRaw()); + tfrcCntWdgRaw.setText("" + o.rcCntWdgRaw()); + tfrcCntCmdRaw.setText("" + o.rcCntCmdRaw()); + tfrcCntMcuRaw.setText("" + o.rcCntMcuRaw()); + tfrcCntEmlopoRaw.setText("" + o.rcCntEmlopoRaw()); + tfprevcmdElapsedRaw.setText("" + o.prevcmdElapsedRaw()); + tfphotodiode1Raw.setText("" + o.photodiode1Raw()); + tfphotodiode2Raw.setText("" + o.photodiode2Raw()); + tfphotodiode3Raw.setText("" + o.photodiode3Raw()); + tfphotodiode4Raw.setText("" + o.photodiode4Raw()); + tfphotodiode5Raw.setText("" + o.photodiode5Raw()); + tfphotodiode6Raw.setText("" + o.photodiode6Raw()); + tfpanelTemperature1C.setText(String.format("%.3f", o.panelTemperature1C())); + tfpanelTemperature2C.setText(String.format("%.3f", o.panelTemperature2C())); + tfpanelTemperature3C.setText(String.format("%.3f", o.panelTemperature3C())); + tfpanelTemperature4C.setText(String.format("%.3f", o.panelTemperature4C())); + tfpanelTemperature5C.setText(String.format("%.3f", o.panelTemperature5C())); + tfpanelTemperature6C.setText(String.format("%.3f", o.panelTemperature6C())); + } + + private void allocateIepsHkStatus(IepsHkStatus o) { + tfhKStidRaw.setText("" + o.hKStidRaw()); + tfhKIvidRaw.setText("" + o.hKIvidRaw()); + tfhKRcRaw.setText("" + o.hKRcRaw()); + tfhKBidRaw.setText("" + o.hKBidRaw()); + tfhKCmderrRaw.setText("" + o.hKCmderrRaw()); + tfhKStatRaw.setText("" + o.hKStatRaw()); + tfvoltBrdSupRawV.setText(String.format("%.3f", o.voltBrdSupRawV())); + tftempRawT.setText(String.format("%.3f", o.tempRawT())); + tfvDistInputRawV.setText(String.format("%.3f", o.vDistInputRawV())); + tfiDistInputRawMa.setText(String.format("%.3f", o.iDistInputRawMa())); + tfpDistInputRawMw.setText(String.format("%.3f", o.pDistInputRawMw())); + tfvBattInputRawV.setText(String.format("%.3f", o.vBattInputRawV())); + tfiBattInputRawMa.setText(String.format("%.3f", o.iBattInputRawMa())); + tfpBattInputRawMw.setText(String.format("%.3f", o.pBattInputRawMw())); + tfstatObcOnRaw.setText("" + o.statObcOnRaw()); + tfstatObcOcfRaw.setText("" + o.statObcOcfRaw()); + tfbatStatRaw.setText("" + o.batStatRaw()); + tfbatTemp2RawT.setText(String.format("%.3f", o.batTemp2RawT())); + tfvoltVd0Raw.setText("" + o.voltVd0Raw()); + tfvoltVd1Raw.setText("" + o.voltVd1Raw()); + tfvoltVd2Raw.setText("" + o.voltVd2Raw()); + tfvObc00V.setText(String.format("%.3f", o.vObc00V())); + tfiObc00Ma.setText(String.format("%.3f", o.iObc00Ma())); + tfpObc00Mw.setText(String.format("%.3f", o.pObc00Mw())); + tfvObc01V.setText(String.format("%.3f", o.vObc01V())); + tfiObc01Ma.setText(String.format("%.3f", o.iObc01Ma())); + tfpObc01Mw.setText(String.format("%.3f", o.pObc01Mw())); + tfvObc02V.setText(String.format("%.3f", o.vObc02V())); + tfiObc02Ma.setText(String.format("%.3f", o.iObc02Ma())); + tfpObc02Mw.setText(String.format("%.3f", o.pObc02Mw())); + tfvObc03V.setText(String.format("%.3f", o.vObc03V())); + tfiObc03Ma.setText(String.format("%.3f", o.iObc03Ma())); + tfpObc03Mw.setText(String.format("%.3f", o.pObc03Mw())); + tfvObc05V.setText(String.format("%.3f", o.vObc05V())); + tfiObc05Ma.setText(String.format("%.3f", o.iObc05Ma())); + tfpObc05Mw.setText(String.format("%.3f", o.pObc05Mw())); + tfvObc06V.setText(String.format("%.3f", o.vObc06V())); + tfiObc06Ma.setText(String.format("%.3f", o.iObc06Ma())); + tfpObc06Mw.setText(String.format("%.3f", o.pObc06Mw())); + tfcc1Byte.setText(toStringData(o.cc1Byte())); + tfcc2Byte.setText(toStringData(o.cc2Byte())); + tfcc3Byte.setText(toStringData(o.cc3Byte())); + tfstatusStidRaw.setText("" + o.statusStidRaw()); + tfstatusIvidRaw.setText("" + o.statusIvidRaw()); + tfstatusRcRaw.setText("" + o.statusRcRaw()); + tfstatusBidRaw.setText("" + o.statusBidRaw()); + tfstatusCmderrRaw.setText("" + o.statusCmderrRaw()); + tfstatusStatRaw.setText("" + o.statusStatRaw()); + tfmodeRaw.setText("" + o.modeRaw()); + tfconfRaw.setText("" + o.confRaw()); + tfresetCauseRaw.setText("" + o.resetCauseRaw()); + tfuptimeRaw.setText("" + o.uptimeRaw()); + tferrorRaw.setText("" + o.errorRaw()); + tfrcCntPwronRaw.setText("" + o.rcCntPwronRaw()); + tfrcCntWdgRaw.setText("" + o.rcCntWdgRaw()); + tfrcCntCmdRaw.setText("" + o.rcCntCmdRaw()); + tfrcCntMcuRaw.setText("" + o.rcCntMcuRaw()); + tfrcCntEmlopoRaw.setText("" + o.rcCntEmlopoRaw()); + tfprevcmdElapsedRaw.setText("" + o.prevcmdElapsedRaw()); + } + + private void allocateImtqHk(ImtqHk o) { + tfdigitaleVoltageV.setText(String.format("%.3f", o.digitaleVoltageV())); + tfanalogVoltageV.setText(String.format("%.3f", o.analogVoltageV())); + tfdigitalCurrentRaw.setText("" + o.digitalCurrentRaw()); + tfanalogCurrentRaw.setText("" + o.analogCurrentRaw()); + tfmeasureCoilXCurrentMa.setText(String.format("%.3f", o.measureCoilXCurrentMa())); + tfmeasureCoilYCurrentMa.setText(String.format("%.3f", o.measureCoilYCurrentMa())); + tfmeasureCoilZCurrentMa.setText(String.format("%.3f", o.measureCoilZCurrentMa())); + tfmeasureCoilXTemperatureC.setText(String.format("%.3f", o.measureCoilXTemperatureC())); + tfmeasureCoilYTemperatureC.setText(String.format("%.3f", o.measureCoilYTemperatureC())); + tfmeasureCoilZTemperatureC.setText(String.format("%.3f", o.measureCoilZTemperatureC())); + tfmcuTemperatureC.setText(String.format("%.3f", o.mcuTemperatureC())); + tfimtqSystemStateModeRaw.setText("" + o.imtqSystemStateModeRaw()); + tfimtqSystemStateErrorRaw.setText("" + o.imtqSystemStateErrorRaw()); + tfimtqSystemStateConfigurationRaw.setText("" + o.imtqSystemStateConfigurationRaw()); + tfimtqSystemStateUptimeRaw.setText("" + o.imtqSystemStateUptimeRaw()); + } + + private void allocateMainboardAllScience(MainboardAllScience o) { + tfmainboardScienceTimeRaw.setText("" + o.mainboardScienceTimeRaw()); + tfteachWearOnRaw.setText("" + o.teachWearOnRaw()); + tffrequenceOfAcquisitionsRaw.setText("" + o.frequenceOfAcquisitionsRaw()); + tfgainRaw.setText("" + o.gainRaw()); + tfnumberOfAcquisitionCommandedRaw.setText("" + o.numberOfAcquisitionCommandedRaw()); + tfnumberOfRealAcquisitionRaw.setText("" + o.numberOfRealAcquisitionRaw()); + tfhkPlus5vRaw.setText("" + o.hkPlus5vRaw()); + tfhkMinus5vRaw.setText("" + o.hkMinus5vRaw()); + tfhkMinus5vPolarRaw.setText("" + o.hkMinus5vPolarRaw()); + tfhkTempAdcRaw.setText("" + o.hkTempAdcRaw()); + tfhkFeePlusXVrefRaw.setText("" + o.hkFeePlusXVrefRaw()); + tfhkFeeMinusXVrefRaw.setText("" + o.hkFeeMinusXVrefRaw()); + tfhkFeePlusYVrefRaw.setText("" + o.hkFeePlusYVrefRaw()); + tfhkFeeMinusYVrefRaw.setText("" + o.hkFeeMinusYVrefRaw()); + tffeePlusXErs1SignalRaw.setText("" + o.feePlusXErs1SignalRaw()); + tffeePlusXErs1TemperatureRaw.setText("" + o.feePlusXErs1TemperatureRaw()); + tffeePlusXErs2SignalRaw.setText("" + o.feePlusXErs2SignalRaw()); + tffeePlusXErs2TemperatureRaw.setText("" + o.feePlusXErs2TemperatureRaw()); + tffeePlusXErs3SignalRaw.setText("" + o.feePlusXErs3SignalRaw()); + tffeePlusXErs3TemperatureRaw.setText("" + o.feePlusXErs3TemperatureRaw()); + tffeePlusXUvsSignalRaw.setText("" + o.feePlusXUvsSignalRaw()); + tffeeMinusXErs1SignalRaw.setText("" + o.feeMinusXErs1SignalRaw()); + tffeeMinusXErs1TemperatureRaw.setText("" + o.feeMinusXErs1TemperatureRaw()); + tffeeMinusXErs2SignalRaw.setText("" + o.feeMinusXErs2SignalRaw()); + tffeeMinusXErs2TemperatureRaw.setText("" + o.feeMinusXErs2TemperatureRaw()); + tffeeMinusXErs3SignalRaw.setText("" + o.feeMinusXErs3SignalRaw()); + tffeeMinusXErs3TemperatureRaw.setText("" + o.feeMinusXErs3TemperatureRaw()); + tffeeMinusXUvsSignalRaw.setText("" + o.feeMinusXUvsSignalRaw()); + tffeePlusYErs1SignalRaw.setText("" + o.feePlusYErs1SignalRaw()); + tffeePlusYErs1TemperatureRaw.setText("" + o.feePlusYErs1TemperatureRaw()); + tffeePlusYErs2SignalRaw.setText("" + o.feePlusYErs2SignalRaw()); + tffeePlusYErs2TemperatureRaw.setText("" + o.feePlusYErs2TemperatureRaw()); + tffeePlusYErs3SignalRaw.setText("" + o.feePlusYErs3SignalRaw()); + tffeePlusYErs3TemperatureRaw.setText("" + o.feePlusYErs3TemperatureRaw()); + tffeePlusYUvsSignalRaw.setText("" + o.feePlusYUvsSignalRaw()); + tffeeMinusYErs1SignalRaw.setText("" + o.feeMinusYErs1SignalRaw()); + tffeeMinusYErs1TemperatureRaw.setText("" + o.feeMinusYErs1TemperatureRaw()); + tffeeMinusYErs2SignalRaw.setText("" + o.feeMinusYErs2SignalRaw()); + tffeeMinusYErs2TemperatureRaw.setText("" + o.feeMinusYErs2TemperatureRaw()); + tffeeMinusYErs3SignalRaw.setText("" + o.feeMinusYErs3SignalRaw()); + tffeeMinusYErs3TemperatureRaw.setText("" + o.feeMinusYErs3TemperatureRaw()); + tffeeMinusYUvsSignalRaw.setText("" + o.feeMinusYUvsSignalRaw()); + tfteachwearAccXRaw.setText("" + o.teachwearAccXRaw()); + tfteachwearAccYRaw.setText("" + o.teachwearAccYRaw()); + tfteachwearAccZRaw.setText("" + o.teachwearAccZRaw()); + tfteachwearDegCRaw.setText("" + o.teachwearDegCRaw()); + tfteachwearGyroXRaw.setText("" + o.teachwearGyroXRaw()); + tfteachwearGyroYRaw.setText("" + o.teachwearGyroYRaw()); + tfteachwearGyroZRaw.setText("" + o.teachwearGyroZRaw()); + tfteachwearMagnXRaw.setText("" + o.teachwearMagnXRaw()); + tfteachwearMagnYRaw.setText("" + o.teachwearMagnYRaw()); + tfteachwearMagnZRaw.setText("" + o.teachwearMagnZRaw()); + tfteachwearStateRaw.setText("" + o.teachwearStateRaw()); + tfteachwearResetReasonRaw.setText("" + o.teachwearResetReasonRaw()); + tfteachwearCRCRaw.setText("" + o.teachwearCRCRaw()); + tfnbTmSinceFirstStartRaw.setText("" + o.nbTmSinceFirstStartRaw()); + } + + private void allocateMainboardHk(MainboardHk o) { + tfmainboardHKTimeRaw.setText("" + o.mainboardHKTimeRaw()); + tfhkPlus5VRaw.setText("" + o.hkPlus5VRaw()); + tfhkMinus5VRaw.setText("" + o.hkMinus5VRaw()); + tfhkMinusPolarRaw.setText("" + o.hkMinusPolarRaw()); + tfhkTempADCRaw.setText("" + o.hkTempADCRaw()); + tfhkFeePlusXVrefRaw.setText("" + o.hkFeePlusXVrefRaw()); + tfhkFeeMinusXVrefRaw.setText("" + o.hkFeeMinusXVrefRaw()); + tfhkFeePlusYVrefRaw.setText("" + o.hkFeePlusYVrefRaw()); + tfhkFeeMinusYVrefRaw.setText("" + o.hkFeeMinusYVrefRaw()); + } + + private void allocateObcHk(ObcHk o) { + tfdummyRaw.setText("" + o.dummyRaw()); + tfspiCommandStatusRaw.setText("" + o.spiCommandStatusRaw()); + tfsupervisorEnableStatusRaw.setText("" + o.supervisorEnableStatusRaw()); + tfsupervisorUptimeRaw.setText("" + o.supervisorUptimeRaw()); + tfiobcUptimeRaw.setText("" + o.iobcUptimeRaw()); + tfiobcResetCountRaw.setText("" + o.iobcResetCountRaw()); + tfiobcMeasureTemperatureRaw.setText("" + o.iobcMeasureTemperatureRaw()); + tfiobcMeasure3v3InRaw.setText("" + o.iobcMeasure3v3InRaw()); + tfiobcMeasure3v3Raw.setText("" + o.iobcMeasure3v3Raw()); + tfiobcMeasure2vReferenceRaw.setText("" + o.iobcMeasure2vReferenceRaw()); + tfiobcMeasure1v8Raw.setText("" + o.iobcMeasure1v8Raw()); + tfiobcMeasure1v0Raw.setText("" + o.iobcMeasure1v0Raw()); + tfiobcMeasureCurrent3v3Raw.setText("" + o.iobcMeasureCurrent3v3Raw()); + tfiobcMeasureCurrent1v8Raw.setText("" + o.iobcMeasureCurrent1v8Raw()); + tfiobcMeasureCurrent1v0Raw.setText("" + o.iobcMeasureCurrent1v0Raw()); + tfiobcMeasureVoltRtcRaw.setText("" + o.iobcMeasureVoltRtcRaw()); + tfiobcAdcUpdateFlagRaw.setText("" + o.iobcAdcUpdateFlagRaw()); + tfiobcCrc8Raw.setText("" + o.iobcCrc8Raw()); + tfphotodiode1Raw.setText("" + o.photodiode1Raw()); + tfphotodiode2Raw.setText("" + o.photodiode2Raw()); + tfphotodiode3Raw.setText("" + o.photodiode3Raw()); + tfphotodiode4Raw.setText("" + o.photodiode4Raw()); + tfphotodiode5Raw.setText("" + o.photodiode5Raw()); + tfphotodiode6Raw.setText("" + o.photodiode6Raw()); + tfpanelTemperature1C.setText(String.format("%.3f", o.panelTemperature1C())); + tfpanelTemperature2C.setText(String.format("%.3f", o.panelTemperature2C())); + tfpanelTemperature3C.setText(String.format("%.3f", o.panelTemperature3C())); + tfpanelTemperature4C.setText(String.format("%.3f", o.panelTemperature4C())); + tfpanelTemperature5C.setText(String.format("%.3f", o.panelTemperature5C())); + tfpanelTemperature6C.setText(String.format("%.3f", o.panelTemperature6C())); + } + + private void allocateObcStatus(ObcStatus o) { + // MCR + // tfdummydummy.setText( ""+ o.dummy()); + tfspiCommandStatusRaw.setText("" + o.spiCommandStatusRaw()); + tfsupervisorIndexOfSubsystemRaw.setText("" + o.supervisorIndexOfSubsystemRaw()); + tfsupervisorMajorVersionRaw.setText("" + o.supervisorMajorVersionRaw()); + tfsupervisorMinorVersionRaw.setText("" + o.supervisorMinorVersionRaw()); + tfsupervisorPatchVersionRaw.setText("" + o.supervisorPatchVersionRaw()); + tfsupervisorGitHeadVersionRaw.setText("" + o.supervisorGitHeadVersionRaw()); + tfsupervisorSerialNumberRaw.setText("" + o.supervisorSerialNumberRaw()); + tfcompilationInformationByte.setText(toStringData(o.compilationInformationByte())); + tfclockSpeedRaw.setText("" + o.clockSpeedRaw()); + tfcodeTypeRaw.setText("" + o.codeTypeRaw()); + tfcrc8Raw.setText("" + o.crc8Raw()); + tfswMmodeRaw.setText("" + o.swMmodeRaw()); + tflastResetReasonRaw.setText("" + decodelastResetReason(o.lastResetReasonRaw())); + tfreservedRaw.setText("" + o.reservedRaw()); + tfnbResetRaw.setText("" + o.nbResetRaw()); + tfreserved2Raw.setText("" + o.reserved2Raw()); + tfdeployAntennasSystemRaw.setText("" + o.deployAntennasSystemRaw()); + tfnbTmSinceFirstStartRaw.setText("" + o.nbTmSinceFirstStartRaw()); + tfnbTcSinceFirstStartRaw.setText("" + o.nbTcSinceFirstStartRaw()); + tfnbBadTcSinceFirstStartRaw.setText("" + o.nbBadTcSinceFirstStartRaw()); + tfnbTmInSdcardRaw.setText("" + o.nbTmInSdcardRaw()); + tfsdcardStatusRaw.setText("" + o.sdcardStatusRaw()); + tfsdcardLastErrorRaw.setText("" + o.sdcardLastErrorRaw()); + tfoldTimeTMInSdcardRaw.setText("" + o.oldTimeTMInSdcardRaw()); + tfnewTimeTMInSdcardRaw.setText("" + o.newTimeTMInSdcardRaw()); + } + + private void allocateTrxvurxHk(TrxvurxHk o) { + tftrxvurxInstantaneousReceivedSignalDopplerHz.setText( + String.format("%.3f", o.trxvurxInstantaneousReceivedSignalDopplerHz())); + tftrxvurxInstantaneousReceivedSignalStrengthDbm.setText( + String.format("%.3f", o.trxvurxInstantaneousReceivedSignalStrengthDbm())); + tftrxvurxSupplyVoltageV.setText(String.format("%.3f", o.trxvurxSupplyVoltageV())); + tftrxvurxTotalSupplyCurrentMa.setText(String.format("%.3f", o.trxvurxTotalSupplyCurrentMa())); + tftrxvurxTransmitterCurrentMa.setText(String.format("%.3f", o.trxvurxTransmitterCurrentMa())); + tftrxvurxReceiverCurrentMa.setText(String.format("%.3f", o.trxvurxReceiverCurrentMa())); + tftrxvurxPowerAmplifierCurrentMa.setText( + String.format("%.3f", o.trxvurxPowerAmplifierCurrentMa())); + tftrxvurxPowerAmplifierTemperatureC.setText( + String.format("%.3f", o.trxvurxPowerAmplifierTemperatureC())); + tftrxvurxLocalOscillatorTemperatureC.setText( + String.format("%.3f", o.trxvurxLocalOscillatorTemperatureC())); + tftrxvurxZeroPaddingRaw.setText("" + o.trxvurxZeroPaddingRaw()); + tftrxvuRxUptimeRaw.setText("" + o.trxvuRxUptimeRaw()); + } + + private void allocateTrxvutxHk(TrxvutxHk o) { + tftrxvutxInstantaneousRfReflectedPowerFromTransmitterPortMw.setText( + String.format("%.3f", o.trxvutxInstantaneousRfReflectedPowerFromTransmitterPortMw())); + tftrxvutxInstantaneousRfForwardPowerFromTransmitterPortMw.setText( + String.format("%.3f", o.trxvutxInstantaneousRfForwardPowerFromTransmitterPortMw())); + tftrxvutxSupplyVoltageV.setText(String.format("%.3f", o.trxvutxSupplyVoltageV())); + tftrxvutxTotalSupplyCurrentMa.setText(String.format("%.3f", o.trxvutxTotalSupplyCurrentMa())); + tftrxvutxTransmitterCurrentMa.setText(String.format("%.3f", o.trxvutxTransmitterCurrentMa())); + tftrxvutxReceiverCurrentMa.setText(String.format("%.3f", o.trxvutxReceiverCurrentMa())); + tftrxvutxPowerAmplifierCurrentMa.setText( + String.format("%.3f", o.trxvutxPowerAmplifierCurrentMa())); + tftrxvutxPowerAmplifierTemperatureC.setText( + String.format("%.3f", o.trxvutxPowerAmplifierTemperatureC())); + tftrxvutxLocalOscillatorTemperatureC.setText( + String.format("%.3f", o.trxvutxLocalOscillatorTemperatureC())); + tftrxvutxZeroPaddingRaw.setText("" + o.trxvutxZeroPaddingRaw()); + tftrxvuTxUptimeRaw.setText("" + o.trxvuTxUptimeRaw()); + tftrxvuTxStateRaw.setText("" + o.trxvuTxStateRaw()); + } + + // Interpretation + + public String decodeSwMode(int mode) { + String value = "Unknow"; + + switch (mode) { + // MODE_INIT = 0 + case 0: + value = "INIT"; + break; + // MODE_DETUMBLING = 1 + case 1: + value = "DETUMBLING"; + break; + // MODE_STANDBY = 2 + case 2: + value = "STANDBY"; + break; + // MODE_OPERATIONAL = 3 + case 3: + value = "OPERATIONAL"; + break; + // MODE_SAFE = 4 + case 4: + value = "SAFE"; + break; + // MODE_TRANSPONDER = 5 + case 5: + value = "TRANSPONDER"; + break; + default: + value = "Unknow Mode"; + } + return value; + } + + // First start = 0 + // TC Init received = 0x80 + // No TC since 4 days = 0x81 + // Unknown reason = 0x81 + + public String decodelastResetReason(int lastResetReason) { + String value = "Unknow"; + + switch (lastResetReason) { + // MODE_INIT = 0 + case 0: + value = "First start"; + break; + // MODE_DETUMBLING = 1 + case 0x80: + value = "TC Init"; + break; + // MODE_STANDBY = 2 + case 0x81: + value = "No TC since 4 days"; + break; + // MODE_OPERATIONAL = 3 + default: + value = "Unknow Reason"; + } + return value; + } + + public String decodeResetOrder(int resetOrder) { + + String value = "Unknow"; + + switch (resetOrder) { + // No order = 0 + case 0: + value = "No Order"; + break; + // Order by TC = 0xCA + case 0xCA: + value = "TC Order"; + break; + default: + value = "Unknow Reason"; + } + return value; + } + + private String toStringData(byte[] bytes) { + StringBuffer buffer = new StringBuffer(); + + for (byte b : bytes) { + buffer.append(String.format("%02X ", b)); + } + return buffer.toString(); + } } diff --git a/ApplicationUVSQsatDecoder/src/main/java/org/josast/UVSQsatDecoder/DisplayUVSQsat.java b/ApplicationUVSQsatDecoder/src/main/java/org/josast/UVSQsatDecoder/DisplayUVSQsat.java index 4e77e5316b6b0bed09defbe0afec8b5001219fcd..3e28f4bf138e06b7b76d86441aa89b0f4ee17283 100644 --- a/ApplicationUVSQsatDecoder/src/main/java/org/josast/UVSQsatDecoder/DisplayUVSQsat.java +++ b/ApplicationUVSQsatDecoder/src/main/java/org/josast/UVSQsatDecoder/DisplayUVSQsat.java @@ -1,50 +1,42 @@ package org.josast.UVSQsatDecoder; +import io.kaitai.struct.ByteBufferKaitaiStream; import java.util.logging.Logger; - import org.josast.uvsqsat.Frame; import org.josast.uvsqsat.generated.Uvsqsat; -import io.kaitai.struct.ByteBufferKaitaiStream; - public class DisplayUVSQsat { - Frame frame = null; - private static Logger appLogger = Logger.getLogger("AmsatLogger"); - - public void setData(ReceivedData decodedData) { - try { - frame = null; - Uvsqsat cube = new Uvsqsat(new ByteBufferKaitaiStream(decodedData.getData())); - frame = new Frame(); - frame.setUp(cube); - cube = null; - - } catch (Exception e) { - appLogger.severe("Error decoding frame"); - appLogger.severe(e.getMessage()); - - } - - } - - public String getData() { - StringBuffer sb = new StringBuffer(); - if (frame == null) { - sb.append("Data not decoded"); - } else { - sb.append(frame.toStringFormat()); - } - - sb.append("\r\n"); - return sb.toString(); - - } - - /** - * @return the frame - */ - public Frame getFrame() { - return frame; - } - + Frame frame = null; + private static Logger appLogger = Logger.getLogger("AmsatLogger"); + + public void setData(ReceivedData decodedData) { + try { + frame = null; + Uvsqsat cube = new Uvsqsat(new ByteBufferKaitaiStream(decodedData.getData())); + frame = new Frame(); + frame.setUp(cube); + cube = null; + + } catch (Exception e) { + appLogger.severe("Error decoding frame"); + appLogger.severe(e.getMessage()); + } + } + + public String getData() { + StringBuffer sb = new StringBuffer(); + if (frame == null) { + sb.append("Data not decoded"); + } else { + sb.append(frame.toStringFormat()); + } + + sb.append("\r\n"); + return sb.toString(); + } + + /** @return the frame */ + public Frame getFrame() { + return frame; + } } diff --git a/ApplicationUVSQsatDecoder/src/main/java/org/josast/UVSQsatDecoder/ModelReceivedData.java b/ApplicationUVSQsatDecoder/src/main/java/org/josast/UVSQsatDecoder/ModelReceivedData.java index 3830658b38690bcc7b3a1e71e5f674f7d147c75d..ac94ed84d6df0ef98154881a193ee85efd480255 100644 --- a/ApplicationUVSQsatDecoder/src/main/java/org/josast/UVSQsatDecoder/ModelReceivedData.java +++ b/ApplicationUVSQsatDecoder/src/main/java/org/josast/UVSQsatDecoder/ModelReceivedData.java @@ -5,69 +5,50 @@ import java.beans.PropertyChangeSupport; import java.util.Date; import java.util.Vector; - - - - - public class ModelReceivedData { - - long numberFrame = 0; - Vector vecRawData = new Vector(); - - - private PropertyChangeSupport listenerList = new PropertyChangeSupport(this); - - public void addPropertyChangeListener(PropertyChangeListener listener) { - listenerList.addPropertyChangeListener(listener); - } - - public void removePropertyChangeListener(PropertyChangeListener listener) { - listenerList.removePropertyChangeListener(listener); - } - - public void addPropertyChangeListener(String propertyName, PropertyChangeListener listener) { - listenerList.addPropertyChangeListener(propertyName, listener); - } - - public void removePropertyChangeListener(String propertyName, PropertyChangeListener listener) { - listenerList.removePropertyChangeListener(propertyName, listener); - } + long numberFrame = 0; + Vector vecRawData = new Vector(); - public long getNumberFrame() { - return numberFrame; - } + private PropertyChangeSupport listenerList = new PropertyChangeSupport(this); - public ReceivedData getLastReceivedData() { - if (vecRawData.isEmpty()) - { - return null; - } - else - { - return vecRawData.lastElement(); - - } - } - + public void addPropertyChangeListener(PropertyChangeListener listener) { + listenerList.addPropertyChangeListener(listener); + } + public void removePropertyChangeListener(PropertyChangeListener listener) { + listenerList.removePropertyChangeListener(listener); + } + public void addPropertyChangeListener(String propertyName, PropertyChangeListener listener) { + listenerList.addPropertyChangeListener(propertyName, listener); + } + public void removePropertyChangeListener(String propertyName, PropertyChangeListener listener) { + listenerList.removePropertyChangeListener(propertyName, listener); + } - public void addFrame(byte[] received) { - long oldNumberFrame = numberFrame; - numberFrame++; - vecRawData.add(new ReceivedData(new Date(),received)); - listenerList.firePropertyChange("numberFrame", oldNumberFrame, numberFrame); - - } + public long getNumberFrame() { + return numberFrame; + } - public String getRawFrame(int i) { - - return vecRawData.get(i).toString(); + public ReceivedData getLastReceivedData() { + if (vecRawData.isEmpty()) { + return null; + } else { + return vecRawData.lastElement(); } + } + public void addFrame(byte[] received) { + long oldNumberFrame = numberFrame; + numberFrame++; + vecRawData.add(new ReceivedData(new Date(), received)); + listenerList.firePropertyChange("numberFrame", oldNumberFrame, numberFrame); + } + public String getRawFrame(int i) { + return vecRawData.get(i).toString(); + } } diff --git a/ApplicationUVSQsatDecoder/src/main/java/org/josast/UVSQsatDecoder/ReceivedData.java b/ApplicationUVSQsatDecoder/src/main/java/org/josast/UVSQsatDecoder/ReceivedData.java index c288e56d02281f80ec432564d2168297d56a8b10..50de39a6c5230490448877dbccab4dc637ef9ce8 100644 --- a/ApplicationUVSQsatDecoder/src/main/java/org/josast/UVSQsatDecoder/ReceivedData.java +++ b/ApplicationUVSQsatDecoder/src/main/java/org/josast/UVSQsatDecoder/ReceivedData.java @@ -4,34 +4,33 @@ import java.util.Date; public class ReceivedData { - private Date time; - private byte[] data; - - public ReceivedData(Date receivedTime, byte[] receivedData) { - super(); - time = receivedTime; - data = receivedData; - } - - public Date getTime() { - return time; - } - - public void setTime(Date time) { - this.time = time; - } - - public byte[] getData() { - return data; - } - - public void setData(byte[] data) { - this.data = data; - } - - @Override - public String toString() { - return "Frame [time=" + time + "][ Frame=" + new String(data) + "]"; - } - + private Date time; + private byte[] data; + + public ReceivedData(Date receivedTime, byte[] receivedData) { + super(); + time = receivedTime; + data = receivedData; + } + + public Date getTime() { + return time; + } + + public void setTime(Date time) { + this.time = time; + } + + public byte[] getData() { + return data; + } + + public void setData(byte[] data) { + this.data = data; + } + + @Override + public String toString() { + return "Frame [time=" + time + "][ Frame=" + new String(data) + "]"; + } } diff --git a/ApplicationUVSQsatDecoder/src/main/java/org/josast/UVSQsatDecoder/SendSIDS.java b/ApplicationUVSQsatDecoder/src/main/java/org/josast/UVSQsatDecoder/SendSIDS.java index ea1b701a6bb52c7945a40927645bc191777a7a1a..f92f28922a77caeb1938556a4988df44c9652d78 100644 --- a/ApplicationUVSQsatDecoder/src/main/java/org/josast/UVSQsatDecoder/SendSIDS.java +++ b/ApplicationUVSQsatDecoder/src/main/java/org/josast/UVSQsatDecoder/SendSIDS.java @@ -2,49 +2,37 @@ package org.josast.UVSQsatDecoder; import java.math.BigInteger; import java.util.logging.Logger; - import org.josast.SIDS.HttpPostSIDS; import org.josast.SIDS.SIDSData; import org.josast.SIDS.Station; -/** - * - * @author christophe - * - */ +/** @author christophe */ public class SendSIDS { - private static Logger appLogger = Logger.getLogger("AmsatLogger"); - SIDSData sids = new SIDSData(); - HttpPostSIDS client; - - public SendSIDS ( Station station, int norad, String url) - { - sids.setStation(station); - sids.setNoradID(norad); - client = new HttpPostSIDS(url); - - - } - - public void setNorad(int norad) - { - sids.setNoradID(norad); - } - - public int Send(ReceivedData data) - { - //BasicConfigurator.configure(); + private static Logger appLogger = Logger.getLogger("AmsatLogger"); + SIDSData sids = new SIDSData(); + HttpPostSIDS client; + + public SendSIDS(Station station, int norad, String url) { + sids.setStation(station); + sids.setNoradID(norad); + client = new HttpPostSIDS(url); + } - // transforme en hexa String - String hexaString = new BigInteger(1, data.getData()).toString(16); - sids.setTelemetryData(data.getTime(),hexaString); - appLogger.info(sids.toStringBasic()); - int result = client.SendSIDSBasic(sids); - // realease memory - hexaString=null; - return result; + public void setNorad(int norad) { + sids.setNoradID(norad); + } - } + public int Send(ReceivedData data) { + // BasicConfigurator.configure(); + // transforme en hexa String + String hexaString = new BigInteger(1, data.getData()).toString(16); + sids.setTelemetryData(data.getTime(), hexaString); + appLogger.info(sids.toStringBasic()); + int result = client.SendSIDSBasic(sids); + // realease memory + hexaString = null; + return result; + } } diff --git a/ApplicationUVSQsatDecoder/src/main/java/org/josast/UVSQsatDecoder/TaskSoundmodemTCP.java b/ApplicationUVSQsatDecoder/src/main/java/org/josast/UVSQsatDecoder/TaskSoundmodemTCP.java index e86f5339e656751c558da9215fc234a1f8cc26c9..0b0f6bb5bde060cb2062ce7b7951340f03c80af3 100644 --- a/ApplicationUVSQsatDecoder/src/main/java/org/josast/UVSQsatDecoder/TaskSoundmodemTCP.java +++ b/ApplicationUVSQsatDecoder/src/main/java/org/josast/UVSQsatDecoder/TaskSoundmodemTCP.java @@ -1,90 +1,78 @@ package org.josast.UVSQsatDecoder; import java.util.logging.Logger; - - +import javafx.concurrent.Task; import org.josast.ModuleSoundModem.SoundModemClient; import org.josast.ModuleSoundModem.SoundModemConfiguration; -import javafx.concurrent.Task; - public class TaskSoundmodemTCP extends Task { - - private Logger log = Logger.getLogger("AmsatLogger"); - private volatile boolean running = true; - - SoundModemConfiguration smConfiguration = null; - SoundModemClient smc = null; - ModelReceivedData receivedFrame = null; + private Logger log = Logger.getLogger("AmsatLogger"); + + private volatile boolean running = true; + + SoundModemConfiguration smConfiguration = null; + SoundModemClient smc = null; + ModelReceivedData receivedFrame = null; + + /** + * @param smConfiguration fichier de configuration + * @param receivedFrame Frame Data model + */ + public TaskSoundmodemTCP( + SoundModemConfiguration smConfiguration, ModelReceivedData receivedFrame) { + this.smConfiguration = smConfiguration; + smc = new SoundModemClient(smConfiguration); + if (smc.isOpen() == false) { + this.failed(); + } + this.receivedFrame = receivedFrame; + } + + public TaskSoundmodemTCP(ModelReceivedData receivedFrame) { - /** - * @param smConfiguration fichier de configuration - * @param receivedFrame Frame Data model - */ - public TaskSoundmodemTCP(SoundModemConfiguration smConfiguration, ModelReceivedData receivedFrame) { - this.smConfiguration = smConfiguration; - smc = new SoundModemClient(smConfiguration); - if (smc.isOpen() == false) { - this.failed(); - } - this.receivedFrame = receivedFrame; + smConfiguration = new SoundModemConfiguration("default"); + smc = new SoundModemClient(smConfiguration); + if (smc.isOpen() == false) { + this.failed(); + } + this.receivedFrame = receivedFrame; + } - } + /** + * while the connection is open, the modem is listening. When a frame is received, this frame is + * added to the model + */ + @Override + protected String call() { + try { - public TaskSoundmodemTCP(ModelReceivedData receivedFrame) { - - smConfiguration = new SoundModemConfiguration("default"); - smc = new SoundModemClient(smConfiguration); - if (smc.isOpen() == false) { - this.failed(); - } - this.receivedFrame = receivedFrame; - } + while (running == true) { + if (smc.isOpen()) { + byte[] temp = smc.receivedRawData(); + receivedFrame.addFrame(temp); + this.updateValue(receivedFrame.toString()); + temp = null; + } else { + this.running = false; + log.severe("Erreur SoundModem closed"); + } + } + } catch (Exception e) { + log.severe("Erreur SoundModem not available"); + log.severe(e.toString()); + this.failed(); + } + return receivedFrame.toString(); + } - /** - * while the connection is open, the modem is listening. When a frame is received, - * this frame is added to the model - */ - @Override - protected String call() { - try { + public void arreter() { - while (running == true) { - if(smc.isOpen()) - { - byte[] temp = smc.receivedRawData(); - receivedFrame.addFrame(temp); - this.updateValue(receivedFrame.toString()); - temp=null; - } else - { - this.running=false; - log.severe("Erreur SoundModem closed"); - } - } - } catch (Exception e) { - log.severe("Erreur SoundModem not available"); - log.severe(e.toString()); - this.failed(); + this.running = false; + } - } - return receivedFrame.toString(); - } + public void redemarrer() { - - - public void arreter() { - - this.running = false; - - } - - public void redemarrer() - { - - this.running = true; - - } - + this.running = true; + } } diff --git a/ApplicationUVSQsatDecoder/src/main/java/org/josast/UVSQsatDecoder/util/LogFile.java b/ApplicationUVSQsatDecoder/src/main/java/org/josast/UVSQsatDecoder/util/LogFile.java index 1417dad391eaa5d327185fc97a22b2d77c223468..165547dd0df2896ba843decb864b616e7102e2d4 100644 --- a/ApplicationUVSQsatDecoder/src/main/java/org/josast/UVSQsatDecoder/util/LogFile.java +++ b/ApplicationUVSQsatDecoder/src/main/java/org/josast/UVSQsatDecoder/util/LogFile.java @@ -1,6 +1,4 @@ -/** - * - */ +/** */ package org.josast.UVSQsatDecoder.util; import java.io.File; @@ -11,54 +9,42 @@ import java.text.SimpleDateFormat; import java.util.Date; import java.util.logging.Logger; -/** - * @author christophe - * - */ +/** @author christophe */ public class LogFile { - private static Logger appLogger = Logger.getLogger("AmsatLogger"); - private PrintWriter pw; - - /** - * - */ - public LogFile() { - initdisplayLogFile(); - } + private static Logger appLogger = Logger.getLogger("AmsatLogger"); + private PrintWriter pw; + + /** */ + public LogFile() { + initdisplayLogFile(); + } - - private void initdisplayLogFile() - { + private void initdisplayLogFile() { - - SimpleDateFormat formater = new SimpleDateFormat("yyyy-MM-dd-HHmmss"); - Date aujourdhui = new Date(); - String path = System.getProperty("user.dir") + "/log"; - File apath = new File(path); + SimpleDateFormat formater = new SimpleDateFormat("yyyy-MM-dd-HHmmss"); + Date aujourdhui = new Date(); + String path = System.getProperty("user.dir") + "/log"; + File apath = new File(path); - if (!apath.exists()) { - if (apath.mkdir() == false) { - appLogger.severe("fail to create " + path); - } - } - try { - pw = new PrintWriter (new FileWriter(path+"/"+formater.format(aujourdhui)+"-"+".log")); - } catch (IOException e) { - appLogger.severe("erreur creating log file"); - appLogger.severe (e.toString()); - } + if (!apath.exists()) { + if (apath.mkdir() == false) { + appLogger.severe("fail to create " + path); + } + } + try { + pw = new PrintWriter(new FileWriter(path + "/" + formater.format(aujourdhui) + "-" + ".log")); + } catch (IOException e) { + appLogger.severe("erreur creating log file"); + appLogger.severe(e.toString()); } - - public void displayLog(String log) { - if(pw!=null) - { - pw.println(log); - pw.flush(); - } - appLogger.info(log); + } + public void displayLog(String log) { + if (pw != null) { + pw.println(log); + pw.flush(); } - - + appLogger.info(log); + } } diff --git a/ApplicationUVSQsatDecoder/src/main/java/org/josast/javafx/AlertHelper.java b/ApplicationUVSQsatDecoder/src/main/java/org/josast/javafx/AlertHelper.java index 7f3d20eee2a6085c069c7a085fbfff2b0b08daf4..2c8ef7739641d83ab37022fadfed49d1ab5672f9 100644 --- a/ApplicationUVSQsatDecoder/src/main/java/org/josast/javafx/AlertHelper.java +++ b/ApplicationUVSQsatDecoder/src/main/java/org/josast/javafx/AlertHelper.java @@ -5,24 +5,23 @@ import javafx.stage.Window; public class AlertHelper { - private AlertHelper() - { - - } - /** - * Display a window in order to display a message - * @param alertType Type of alert - * @param owner - * @param title title of the windows - * @param message message to display - */ - public static void showAlert(Alert.AlertType alertType, Window owner, String title, String message) { - Alert alert = new Alert(alertType); - alert.setTitle(title); - alert.setHeaderText(null); - alert.setContentText(message); - alert.initOwner(owner); - alert.show(); - } + private AlertHelper() {} + /** + * Display a window in order to display a message + * + * @param alertType Type of alert + * @param owner + * @param title title of the windows + * @param message message to display + */ + public static void showAlert( + Alert.AlertType alertType, Window owner, String title, String message) { + Alert alert = new Alert(alertType); + alert.setTitle(title); + alert.setHeaderText(null); + alert.setContentText(message); + alert.initOwner(owner); + alert.show(); + } } diff --git a/ModuleAPRSIS/pom.xml b/ModuleAPRSIS/pom.xml index 8052afea3d087926e3faa3b4e45d325e3157fe2a..5cd7ea12ae3fc3458421f6e86f5e951c14c9bcc8 100644 --- a/ModuleAPRSIS/pom.xml +++ b/ModuleAPRSIS/pom.xml @@ -23,6 +23,39 @@ + + + + + + com.coveo + fmt-maven-plugin + 2.9 + + src/main/java + src/test/java + false + .*\.java + false + false + + + + + + check + + + + + + + + + + + + diff --git a/ModuleAPRSIS/src/main/java/org/avmdti/josast/aprsis/AThreadInputStream.java b/ModuleAPRSIS/src/main/java/org/avmdti/josast/aprsis/AThreadInputStream.java index f0c6daf6ce6d4ca608185c0290e97cc43fbfa99d..06f80bf14f30e8236b72e3ad274b300623d4c3ab 100644 --- a/ModuleAPRSIS/src/main/java/org/avmdti/josast/aprsis/AThreadInputStream.java +++ b/ModuleAPRSIS/src/main/java/org/avmdti/josast/aprsis/AThreadInputStream.java @@ -1,50 +1,37 @@ -/** - * - */ +/** */ package org.avmdti.josast.aprsis; import java.util.logging.Logger; /** * Simple Tread to help the use of the APRS-IS server. - * - * @author XTOPHE * + * @author XTOPHE */ -public class AThreadInputStream extends Thread { - - private static Logger logger = Logger.getLogger("AmsatLogger"); - - private boolean actif = true; - - private ICompute compute = null; +public class AThreadInputStream extends Thread { + + private static Logger logger = Logger.getLogger("AmsatLogger"); + + private boolean actif = true; - /** - * @param compute specific treatment - */ - public AThreadInputStream(ICompute compute) { - super(); - this.compute = compute; - } + private ICompute compute = null; - /** - * @see java.lang.Runnable#run() - */ - public void run() - { - // set the process to actif - actif = true; - if (compute!= null) - { - while (actif) - { - actif = compute.execute(); - } - } - else - { - logger.severe("compute equal null"); - } - } + /** @param compute specific treatment */ + public AThreadInputStream(ICompute compute) { + super(); + this.compute = compute; + } + /** @see java.lang.Runnable#run() */ + public void run() { + // set the process to actif + actif = true; + if (compute != null) { + while (actif) { + actif = compute.execute(); + } + } else { + logger.severe("compute equal null"); + } + } } diff --git a/ModuleAPRSIS/src/main/java/org/avmdti/josast/aprsis/AprsIsConfiguration.java b/ModuleAPRSIS/src/main/java/org/avmdti/josast/aprsis/AprsIsConfiguration.java index 8f4de3f93c0be5c1af8560d114fae06b5f608f2b..8b8ed0dac4d29466cbe41e2d933103dde0ec1bb4 100644 --- a/ModuleAPRSIS/src/main/java/org/avmdti/josast/aprsis/AprsIsConfiguration.java +++ b/ModuleAPRSIS/src/main/java/org/avmdti/josast/aprsis/AprsIsConfiguration.java @@ -1,84 +1,74 @@ package org.avmdti.josast.aprsis; public class AprsIsConfiguration { - private String call = null; + private String call = null; - private String password = null; + private String password = null; - private String filter =null ; - - private String host = "rotate.aprs.net";// "first.aprs.net"; + private String filter = null; - private int port = 14580; - /** - * @return the callSign used - */ - public String getCall() { - return call; - } + private String host = "rotate.aprs.net"; // "first.aprs.net"; - public void setCall(String call) { - this.call = call; - } + private int port = 14580; + /** @return the callSign used */ + public String getCall() { + return call; + } - public String getPass() { - return password; - } + public void setCall(String call) { + this.call = call; + } - public void setPass(String pass) { - this.password = pass; - } + public String getPass() { + return password; + } - public String getFilter() { - return filter; - } + public void setPass(String pass) { + this.password = pass; + } - public void setFilter(String filter) { - this.filter = filter; - } - /** - * @return hostname of the server - */ + public String getFilter() { + return filter; + } - public String getHost() { - return host; - } + public void setFilter(String filter) { + this.filter = filter; + } + /** @return hostname of the server */ + public String getHost() { + return host; + } - public void setHost(String host) { - this.host = host; - } - /** - * @return the port number - */ - public int getPort() { - return port; - } + public void setHost(String host) { + this.host = host; + } + /** @return the port number */ + public int getPort() { + return port; + } - public void setPort(int port) { - this.port = port; - } + public void setPort(int port) { + this.port = port; + } - /** - * @param host hostname of the APRS-IS server - * @param port port number - * @param call callsign used for the connection - * @param password password - * @param filter filter used to select packet - */ - public AprsIsConfiguration(String call, String password, String filter, - String host, int port) { - super(); - this.call = call; - this.password = password; - this.filter = filter; - this.host = host; - this.port = port; - } + /** + * @param host hostname of the APRS-IS server + * @param port port number + * @param call callsign used for the connection + * @param password password + * @param filter filter used to select packet + */ + public AprsIsConfiguration(String call, String password, String filter, String host, int port) { + super(); + this.call = call; + this.password = password; + this.filter = filter; + this.host = host; + this.port = port; + } - public AprsIsConfiguration() { - super(); - // TODO Auto-generated constructor stub - } - - + public AprsIsConfiguration() { + super(); + // TODO Auto-generated constructor stub + } } diff --git a/ModuleAPRSIS/src/main/java/org/avmdti/josast/aprsis/Client.java b/ModuleAPRSIS/src/main/java/org/avmdti/josast/aprsis/Client.java index eeecb73df3b728a9d09cec67fe351f1179d185db..d03bf130429f6980ae944e72666c56d902c68fb0 100644 --- a/ModuleAPRSIS/src/main/java/org/avmdti/josast/aprsis/Client.java +++ b/ModuleAPRSIS/src/main/java/org/avmdti/josast/aprsis/Client.java @@ -1,7 +1,7 @@ /* * Client.java * - * Created on 19 avril 2006, 16:15 + * Created on 19 avril 2006, 16:15. * */ @@ -15,89 +15,87 @@ import java.util.logging.Level; import java.util.logging.Logger; /** - * Client used to perform the connection to the APRS-IS Serveur; - * + * Client used to perform the connection to the APRS-IS Serveur. + * * @author XTOPHE */ public class Client { - private static Logger logger = Logger.getLogger("AmsatLogger"); - - private Socket s = null; - - private AprsIsConfiguration Config; - - /** - * - * create a "client" to connect to an APRS-IS Server - * - * @param config - * - */ - public Client(AprsIsConfiguration config) { - Config = config; + private static Logger logger = Logger.getLogger("AmsatLogger"); + + private Socket socket = null; + + private AprsIsConfiguration configPrivate; + + /** + * create a "client" to connect to an APRS-IS Server + * + * @param config + */ + public Client(AprsIsConfiguration config) { + configPrivate = config; + } + + /** + * return an inputStream from the current connection + * + * @return InputStream when the a connection is avalailable. If the connection failed, null is + * returned. + */ + public void connect() { + + if (socket == null) { + try { + socket = + new Socket(configPrivate.getHost(), configPrivate.getPort()) { + public void close() throws IOException { + logger.log(Level.SEVERE, "Closing " + this); + super.close(); + socket = null; + } + }; + socket + .getOutputStream() + .write( + ("user " + + configPrivate.getCall() + + " pass " + + configPrivate.getPass() + + " vers josastaprssrvr 0.1\r\n") + .getBytes()); + socket + .getOutputStream() + .write(("# filter " + configPrivate.getFilter() + "\r\n").getBytes()); + socket.getOutputStream().flush(); + + } catch (UnknownHostException ex) { + + logger.severe(ex.getMessage()); + + } catch (IOException ex) { + logger.severe(ex.getMessage()); + } } - - /** - * - * return an inputStream from the current connection - * - * @return InputStream when the a connection is avalailable. If the - * connection failed, null is returned. - * - */ - public void connect() { - - if (s == null) { - try { - s = new Socket(Config.getHost(), Config.getPort()) { - public void close() throws IOException { - logger.log(Level.SEVERE, "Closing " + this); - super.close(); - s = null; - } - }; - s.getOutputStream() - .write(("user " + Config.getCall() + " pass " - + Config.getPass() - + " vers josastaprssrvr 0.1\r\n").getBytes()); - s.getOutputStream().write( - ("# filter " + Config.getFilter() + "\r\n").getBytes()); - s.getOutputStream().flush(); - - } catch (UnknownHostException ex) { - - logger.severe(ex.getMessage()); - - } catch (IOException ex) { - logger.severe(ex.getMessage()); - } - } - + } + + public InputStream getInputStream() { + if (socket != null) { + try { + return socket.getInputStream(); + } catch (IOException ex) { + logger.log(Level.SEVERE, "input Stream " + this + ex.getMessage()); + } } - public InputStream getInputStream() { - if (s != null) { - try { - return s.getInputStream(); - } catch (IOException ex) { - logger.log(Level.SEVERE, - "input Stream " + this + ex.getMessage()); - } - } + return null; + } - return null; + /** close the connection. */ + public void close() { + try { + socket.close(); + } catch (IOException ex) { + logger.log(Level.SEVERE, "close " + this + ex.getMessage()); } - - /** - * close the connection. - */ - public void close() { - try { - s.close(); - } catch (IOException ex) { - logger.log(Level.SEVERE, "close " + this + ex.getMessage()); - } - } - + } } diff --git a/ModuleAPRSIS/src/main/java/org/avmdti/josast/aprsis/ICompute.java b/ModuleAPRSIS/src/main/java/org/avmdti/josast/aprsis/ICompute.java index b93002773534b92792495ff13d079e16b009a9a3..dd6853c80300750b6959649191a64944d732cd10 100644 --- a/ModuleAPRSIS/src/main/java/org/avmdti/josast/aprsis/ICompute.java +++ b/ModuleAPRSIS/src/main/java/org/avmdti/josast/aprsis/ICompute.java @@ -1,17 +1,16 @@ package org.avmdti.josast.aprsis; /** - * * Interface for the thread used in AThreadInputStream - * @author XTOPHE * + * @author XTOPHE */ public interface ICompute { - /** - * This method is call each time a set of data is received - *
at the end of the treatement, the return value indicate if we wait a new set of data. - * - * @return boolean true continue, false stop the thread - */ - boolean execute(); + /** + * This method is call each time a set of data is received
+ * at the end of the treatement, the return value indicate if we wait a new set of data. + * + * @return boolean true continue, false stop the thread + */ + boolean execute(); } diff --git a/ModuleAPRSIS/src/main/java/org/avmdti/josast/aprsis/demo/DemoAPRSIS.java b/ModuleAPRSIS/src/main/java/org/avmdti/josast/aprsis/demo/DemoAPRSIS.java index ddb5b13d80e360c34c7911fd33c8ecb9730ea1f7..2e1259a10f290814d7701817207532ed1adb9ef2 100644 --- a/ModuleAPRSIS/src/main/java/org/avmdti/josast/aprsis/demo/DemoAPRSIS.java +++ b/ModuleAPRSIS/src/main/java/org/avmdti/josast/aprsis/demo/DemoAPRSIS.java @@ -1,9 +1,6 @@ - package org.avmdti.josast.aprsis.demo; - import java.util.logging.Logger; - import org.avmdti.josast.aprsis.AThreadInputStream; import org.avmdti.josast.aprsis.AprsIsConfiguration; import org.avmdti.josast.aprsis.Client; @@ -13,48 +10,42 @@ import org.avmdti.josast.aprsis.Client; * this example :
* create a link to the APRS-IS server
* Display the data received - * - * - * + * * @author XTOPHE */ public class DemoAPRSIS { - /** - * Creates a new instance of Main * - */ - public DemoAPRSIS() { - } - - /** - * @param args the command line arguments - */ - static public void main(String[] args) { - - Logger logger = Logger.getLogger("AmsatLogger"); - /* set the configuration */ -// AprsIsConfiguration config = new AprsIsConfiguration("F6ZZZ","PASS","b/W3ADO*/PCSAT/ANDE-1/ANDE-2/RAFT/POLLUX-1/KD4HBO-1/NMARS/PCSAT* p/PCSAT2/POLLUX-1/PC2PSK/PC2TLM/PC2XXA/ISSTLM/PC2ISS/PC2RPT/PC2XXB/PCSAT*/ANDE-1/ANDE-2/RAFT/NMARS/W3ADO* d/PCSAT2/PC2PSK/KD4HBO-1/PC2TLM/PC2XXA/ISSTLM/PC2ISS/PC2RPT/PC2XXB/PCSAT*/ANDE-1/ANDE-2/RAFT/NMARS/W3ADO*","rotate.aprs.net",14580); - - AprsIsConfiguration config = new AprsIsConfiguration("TEST-1", "PASS", - "p/PCSAT*/RS0ISS-4/ARISS b/PCSAT*/RS0ISS-4/ARISS d/PCSAT*/RS0ISS-4/ARISS", - "euro.aprs2.net", 14580); - - /* create the client */ - Client c = new Client(config); - c.connect(); - - - - DemoTreatment log = new DemoTreatment(c.getInputStream()); - AThreadInputStream thread = new AThreadInputStream(log); - thread.start(); - try { - thread.join(); - } catch (InterruptedException e) { - logger.severe(e.getMessage()); - } - c.close(); - + /** Creates a new instance of Main * */ + public DemoAPRSIS() {} + + /** @param args the command line arguments */ + public static void main(String[] args) { + + Logger logger = Logger.getLogger("AmsatLogger"); + /* set the configuration */ + // AprsIsConfiguration config = new + // AprsIsConfiguration("F6ZZZ","PASS","b/W3ADO*/PCSAT/ANDE-1/ANDE-2/RAFT/POLLUX-1/KD4HBO-1/NMARS/PCSAT* p/PCSAT2/POLLUX-1/PC2PSK/PC2TLM/PC2XXA/ISSTLM/PC2ISS/PC2RPT/PC2XXB/PCSAT*/ANDE-1/ANDE-2/RAFT/NMARS/W3ADO* d/PCSAT2/PC2PSK/KD4HBO-1/PC2TLM/PC2XXA/ISSTLM/PC2ISS/PC2RPT/PC2XXB/PCSAT*/ANDE-1/ANDE-2/RAFT/NMARS/W3ADO*","rotate.aprs.net",14580); + + AprsIsConfiguration config = + new AprsIsConfiguration( + "TEST-1", + "PASS", + "p/PCSAT*/RS0ISS-4/ARISS b/PCSAT*/RS0ISS-4/ARISS d/PCSAT*/RS0ISS-4/ARISS", + "euro.aprs2.net", + 14580); + + /* create the client */ + Client c = new Client(config); + c.connect(); + + DemoTreatment log = new DemoTreatment(c.getInputStream()); + AThreadInputStream thread = new AThreadInputStream(log); + thread.start(); + try { + thread.join(); + } catch (InterruptedException e) { + logger.severe(e.getMessage()); } - + c.close(); + } } diff --git a/ModuleAPRSIS/src/main/java/org/avmdti/josast/aprsis/demo/DemoTreatment.java b/ModuleAPRSIS/src/main/java/org/avmdti/josast/aprsis/demo/DemoTreatment.java index d7e57bb75a9cd942a41af5fef91aaeccf22defe8..6027fc9b15b34b2f782089f79cbe1683b3d02cc8 100644 --- a/ModuleAPRSIS/src/main/java/org/avmdti/josast/aprsis/demo/DemoTreatment.java +++ b/ModuleAPRSIS/src/main/java/org/avmdti/josast/aprsis/demo/DemoTreatment.java @@ -2,45 +2,38 @@ package org.avmdti.josast.aprsis.demo; import java.io.IOException; import java.io.InputStream; - - import java.util.logging.Logger; - import org.avmdti.josast.aprsis.ICompute; -//import org.avmdti.josast.aprsis.persistence.Persistence; +// import org.avmdti.josast.aprsis.persistence.Persistence; public class DemoTreatment implements ICompute { - Logger logger = Logger.getLogger("AmsatLogger"); - InputStream input = null; + Logger logger = Logger.getLogger("AmsatLogger"); + InputStream input = null; - // TlmDecoder td = new TlmDecoder(); - public DemoTreatment(InputStream input) { - super(); + // TlmDecoder td = new TlmDecoder(); + public DemoTreatment(InputStream input) { + super(); - this.input = input; + this.input = input; + } - } + public boolean execute() { + byte bytes[] = null; + int nbBytes = 0; + try { - public boolean execute() { - byte bytes[] = null; - int nbBytes = 0; - try { - - bytes = new byte[1000]; - nbBytes = input.read(bytes); - - - String buff = new String(bytes).trim(); - if (!buff.startsWith("#")) - { - System.out.print("+"+buff + "\n"); - } - - } catch (IOException e) { - logger.severe(e.getMessage()); - } - return true; - } + bytes = new byte[1000]; + nbBytes = input.read(bytes); + + String buff = new String(bytes).trim(); + if (!buff.startsWith("#")) { + System.out.print("+" + buff + "\n"); + } + } catch (IOException e) { + logger.severe(e.getMessage()); + } + return true; + } } diff --git a/ModuleAPRSIS/src/test/java/org/avmdti/josast/AThreadInputStreamTest.java b/ModuleAPRSIS/src/test/java/org/avmdti/josast/AThreadInputStreamTest.java index 6aa069ea9b1fef8ee5cead7be681d91c929bcbdc..219e3f4fe4bbc12aeaa52fec18f34fd1a6a939df 100644 --- a/ModuleAPRSIS/src/test/java/org/avmdti/josast/AThreadInputStreamTest.java +++ b/ModuleAPRSIS/src/test/java/org/avmdti/josast/AThreadInputStreamTest.java @@ -4,19 +4,13 @@ import junit.framework.TestCase; public class AThreadInputStreamTest extends TestCase { - /* - * Test method for 'org.avmdti.josast.aprsis.AThreadInputStream.run()' - */ - public void testRun() { - - - } - - /* - * Test method for 'org.avmdti.josast.aprsis.AThreadInputStream.AThreadInputStream(ICompute)' - */ - public void testAThreadInputStream() { - - } + /* + * Test method for 'org.avmdti.josast.aprsis.AThreadInputStream.run()' + */ + public void testRun() {} + /* + * Test method for 'org.avmdti.josast.aprsis.AThreadInputStream.AThreadInputStream(ICompute)' + */ + public void testAThreadInputStream() {} } diff --git a/ModuleAPRSIS/src/test/java/org/avmdti/josast/ClientTest.java b/ModuleAPRSIS/src/test/java/org/avmdti/josast/ClientTest.java index fb4026abfd7b78c9235cfbbf9dd7dce0af6683fa..9ea63eab22a8dcd3bd154132fe67502bac6347ca 100644 --- a/ModuleAPRSIS/src/test/java/org/avmdti/josast/ClientTest.java +++ b/ModuleAPRSIS/src/test/java/org/avmdti/josast/ClientTest.java @@ -1,73 +1,70 @@ package org.avmdti.josast; import java.io.InputStream; - -import org.avmdti.josast.aprsis.Client; - - import junit.framework.Assert; import junit.framework.TestCase; import org.avmdti.josast.aprsis.AprsIsConfiguration; +import org.avmdti.josast.aprsis.Client; public class ClientTest extends TestCase { - /* set the configuration */ - AprsIsConfiguration config = new AprsIsConfiguration("F6ZZZ","PASS","b/W3ADO*/PCSAT/ANDE-1/ANDE-2/RAFT/POLLUX-1/KD4HBO-1/NMARS/PCSAT* p/PCSAT2/POLLUX-1/PC2PSK/PC2TLM/PC2XXA/ISSTLM/PC2ISS/PC2RPT/PC2XXB/PCSAT*/ANDE-1/ANDE-2/RAFT/NMARS/W3ADO* d/PCSAT2/PC2PSK/KD4HBO-1/PC2TLM/PC2XXA/ISSTLM/PC2ISS/PC2RPT/PC2XXB/PCSAT*/ANDE-1/ANDE-2/RAFT/NMARS/W3ADO*","rotate.aprs.net",14580); - /* create the client */ - Client client = new Client (config); - - - public ClientTest(String arg0) { - super(arg0); - } - - protected void setUp() throws Exception { - super.setUp(); - } - - protected void tearDown() throws Exception { - super.tearDown(); - } - - /* - * Test method for 'org.avmdti.josast.aprsis.Client.Client(String, int, String, String, String)' - */ - public final void testClientStringIntStringStringString() { - // TODO Auto-generated method stub - - } - - /* - * Test method for 'org.avmdti.josast.aprsis.Client.connect()' - */ - public final void testConnect() { -// client.setHost("localhost"); -// client.connect(); -// InputStream in = client.getInputStream(); -// Assert.assertNotNull(in); -// client.close(); -// - - } - - /* - * Test method for 'org.avmdti.josast.aprsis.Client.getInputStream()' - */ - public final void testGetInputStream() { - InputStream in = client.getInputStream(); - Assert.assertEquals(in,null); - } - - /* - * Test method for 'org.avmdti.josast.aprsis.Client.close()' - */ - public final void testClose() { - // TODO Auto-generated method stub - - } - - - - - + /* set the configuration */ + AprsIsConfiguration config = + new AprsIsConfiguration( + "F6ZZZ", + "PASS", + "b/W3ADO*/PCSAT/ANDE-1/ANDE-2/RAFT/POLLUX-1/KD4HBO-1/NMARS/PCSAT* p/PCSAT2/POLLUX-1/PC2PSK/PC2TLM/PC2XXA/ISSTLM/PC2ISS/PC2RPT/PC2XXB/PCSAT*/ANDE-1/ANDE-2/RAFT/NMARS/W3ADO* d/PCSAT2/PC2PSK/KD4HBO-1/PC2TLM/PC2XXA/ISSTLM/PC2ISS/PC2RPT/PC2XXB/PCSAT*/ANDE-1/ANDE-2/RAFT/NMARS/W3ADO*", + "rotate.aprs.net", + 14580); + /* create the client */ + Client client = new Client(config); + + public ClientTest(String arg0) { + super(arg0); + } + + protected void setUp() throws Exception { + super.setUp(); + } + + protected void tearDown() throws Exception { + super.tearDown(); + } + + /* + * Test method for 'org.avmdti.josast.aprsis.Client.Client(String, int, String, String, String)' + */ + public final void testClientStringIntStringStringString() { + // TODO Auto-generated method stub + + } + + /* + * Test method for 'org.avmdti.josast.aprsis.Client.connect()' + */ + public final void testConnect() { + // client.setHost("localhost"); + // client.connect(); + // InputStream in = client.getInputStream(); + // Assert.assertNotNull(in); + // client.close(); + // + + } + + /* + * Test method for 'org.avmdti.josast.aprsis.Client.getInputStream()' + */ + public final void testGetInputStream() { + InputStream in = client.getInputStream(); + Assert.assertEquals(in, null); + } + + /* + * Test method for 'org.avmdti.josast.aprsis.Client.close()' + */ + public final void testClose() { + // TODO Auto-generated method stub + + } } diff --git a/ModuleAPRSIS/src/test/java/org/avmdti/josast/SeveurDetest.java b/ModuleAPRSIS/src/test/java/org/avmdti/josast/SeveurDetest.java index d18a0c629e1ecec30519d162c796c4813efa3ba4..a4ba221e113a2953feffba1712ad03fe03792572 100644 --- a/ModuleAPRSIS/src/test/java/org/avmdti/josast/SeveurDetest.java +++ b/ModuleAPRSIS/src/test/java/org/avmdti/josast/SeveurDetest.java @@ -9,39 +9,33 @@ import java.net.ServerSocket; import java.net.Socket; /** - * Socket server for unit test. - * Simple ECHO server. - * - * @author cmercier + * Socket server for unit test. Simple ECHO server. * + * @author cmercier */ public class SeveurDetest { - static final int port = 8080; + static final int port = 8080; - public static void main(String[] args) throws Exception { - ServerSocket s = new ServerSocket(port); - Socket soc = s.accept(); + public static void main(String[] args) throws Exception { + ServerSocket s = new ServerSocket(port); + Socket soc = s.accept(); - // Un BufferedReader permet de lire par ligne. - BufferedReader plec = new BufferedReader( - new InputStreamReader(soc.getInputStream()) - ); + // Un BufferedReader permet de lire par ligne. + BufferedReader plec = new BufferedReader(new InputStreamReader(soc.getInputStream())); - // Un PrintWriter possède toutes les opérations print classiques. - // En mode auto-flush, le tampon est vidé (flush) à l'appel de println. - PrintWriter pred = new PrintWriter( - new BufferedWriter( - new OutputStreamWriter(soc.getOutputStream())), - true); + // Un PrintWriter poss�de toutes les op�rations print classiques. + // En mode auto-flush, le tampon est vid� (flush) � l'appel de println. + PrintWriter pred = + new PrintWriter(new BufferedWriter(new OutputStreamWriter(soc.getOutputStream())), true); - while (true) { - String str = plec.readLine(); // lecture du message - if (str.equals("END")) break; - System.out.println("ECHO = " + str); // trace locale - pred.println(str); // renvoi d'un écho - } - plec.close(); - pred.close(); - soc.close(); - } - } + while (true) { + String str = plec.readLine(); // lecture du message + if (str.equals("END")) break; + System.out.println("ECHO = " + str); // trace locale + pred.println(str); // renvoi d'un �cho + } + plec.close(); + pred.close(); + soc.close(); + } +} diff --git a/ModuleAPRSIS/src/test/java/org/avmdti/josast/aprsis/AprsIsConfigurationTest.java b/ModuleAPRSIS/src/test/java/org/avmdti/josast/aprsis/AprsIsConfigurationTest.java index 28a320120b59af78c6e520b5d94348ee78a718bd..1dd36d54010b08954217957cb0e73d1666e90e03 100644 --- a/ModuleAPRSIS/src/test/java/org/avmdti/josast/aprsis/AprsIsConfigurationTest.java +++ b/ModuleAPRSIS/src/test/java/org/avmdti/josast/aprsis/AprsIsConfigurationTest.java @@ -5,47 +5,44 @@ import junit.framework.TestCase; public class AprsIsConfigurationTest extends TestCase { - public void testSetCall() { - AprsIsConfiguration classUnderTest = new AprsIsConfiguration(); - classUnderTest.setCall("test"); - Assert.assertEquals("test", classUnderTest.getCall()); - } - - public void testSetPass() { - AprsIsConfiguration classUnderTest = new AprsIsConfiguration(); - classUnderTest.setPass("test"); - Assert.assertEquals("test", classUnderTest.getPass()); - } - - public void testSetFilter() { - AprsIsConfiguration classUnderTest = new AprsIsConfiguration(); - classUnderTest.setFilter("test"); - Assert.assertEquals("test", classUnderTest.getFilter()); - } - - public void testSetHost() { - AprsIsConfiguration classUnderTest = new AprsIsConfiguration(); - Assert.assertEquals("rotate.aprs.net", classUnderTest.getHost()); - classUnderTest.setHost("test"); - Assert.assertEquals("test", classUnderTest.getHost()); - } - - public void testSetPort() { - AprsIsConfiguration classUnderTest = new AprsIsConfiguration(); - Assert.assertEquals(14580, classUnderTest.getPort()); - classUnderTest.setPort(10); - Assert.assertEquals(10, classUnderTest.getPort()); - } - - public void testAprsIsConfiguration() { - AprsIsConfiguration classUnderTest = new AprsIsConfiguration(); - Assert.assertEquals(14580, classUnderTest.getPort()); - Assert.assertEquals("rotate.aprs.net", classUnderTest.getHost()); - Assert.assertEquals(null, classUnderTest.getFilter()); - Assert.assertEquals(null, classUnderTest.getPass()); - Assert.assertEquals(null, classUnderTest.getCall()); - - - } - + public void testSetCall() { + AprsIsConfiguration classUnderTest = new AprsIsConfiguration(); + classUnderTest.setCall("test"); + Assert.assertEquals("test", classUnderTest.getCall()); + } + + public void testSetPass() { + AprsIsConfiguration classUnderTest = new AprsIsConfiguration(); + classUnderTest.setPass("test"); + Assert.assertEquals("test", classUnderTest.getPass()); + } + + public void testSetFilter() { + AprsIsConfiguration classUnderTest = new AprsIsConfiguration(); + classUnderTest.setFilter("test"); + Assert.assertEquals("test", classUnderTest.getFilter()); + } + + public void testSetHost() { + AprsIsConfiguration classUnderTest = new AprsIsConfiguration(); + Assert.assertEquals("rotate.aprs.net", classUnderTest.getHost()); + classUnderTest.setHost("test"); + Assert.assertEquals("test", classUnderTest.getHost()); + } + + public void testSetPort() { + AprsIsConfiguration classUnderTest = new AprsIsConfiguration(); + Assert.assertEquals(14580, classUnderTest.getPort()); + classUnderTest.setPort(10); + Assert.assertEquals(10, classUnderTest.getPort()); + } + + public void testAprsIsConfiguration() { + AprsIsConfiguration classUnderTest = new AprsIsConfiguration(); + Assert.assertEquals(14580, classUnderTest.getPort()); + Assert.assertEquals("rotate.aprs.net", classUnderTest.getHost()); + Assert.assertEquals(null, classUnderTest.getFilter()); + Assert.assertEquals(null, classUnderTest.getPass()); + Assert.assertEquals(null, classUnderTest.getCall()); + } } diff --git a/ModuleAmicalsat/src/main/java/org/josast/amicalsat/A1FlagTypeFrame.java b/ModuleAmicalsat/src/main/java/org/josast/amicalsat/A1FlagTypeFrame.java index 22bf62ad0008f5988b5921aeb4d9f620c8721041..74e43dcd89a5fb927b92e1ca4fd4e6a166fc0ed9 100644 --- a/ModuleAmicalsat/src/main/java/org/josast/amicalsat/A1FlagTypeFrame.java +++ b/ModuleAmicalsat/src/main/java/org/josast/amicalsat/A1FlagTypeFrame.java @@ -3,67 +3,63 @@ package org.josast.amicalsat; import org.josast.amicalsat.generated.FrameTlmAmicalsat.A1FlagType; import org.josast.amicalsat.generated.FrameTlmAmicalsat.A1Type; - - // #A1;FLAGS;timeStamps;[mode];[flags];[faults] public class A1FlagTypeFrame extends Frame { - - - private String mode; - private String a1Flags; - private String faults; - private int modeValue; - private int faultsValue; - - @Override - protected void setUpFrame() { - - A1Type a1type = (A1Type) data.frameTlmEntrySat().payload().tlmAreaSwitch(); - A1FlagType log = (A1FlagType) a1type.tlmSw(); - - timeStamps= log.timeStamps(); - hash.put("timeStamps", timeStamps); - setupTimeStamps(log.timeStampsSec()); - mode= log.mode(); - hash.put("Mode", mode); - a1Flags= log.a1Flags(); - hash.put("Flags", a1Flags); - faults= log.faults(); - hash.put("Faults", faults); - - modeValue = log.modeValue(); - faultsValue = log.faultsValue(); - - - } - - - @Override - public String toStringDecoded() { - return "TimeStamps = " + this.timseStampsGregorian +" , "+ tlmArea + " "+ typeFrame - + separator + " mode = " + modeValue - + separator + " flags = " +a1Flags - + separator + " faults = " + faultsValue; - } - - - public String getMode() { - return mode; - } - - - public String getA1Flags() { - return a1Flags; - } - - - public int getFaultsValue() { - return faultsValue; - } - - - - } - - + private String mode; + private String a1Flags; + private String faults; + private int modeValue; + private int faultsValue; + + @Override + protected void setUpFrame() { + + A1Type a1type = (A1Type) data.frameTlmEntrySat().payload().tlmAreaSwitch(); + A1FlagType log = (A1FlagType) a1type.tlmSw(); + + timeStamps = log.timeStamps(); + hash.put("timeStamps", timeStamps); + setupTimeStamps(log.timeStampsSec()); + mode = log.mode(); + hash.put("Mode", mode); + a1Flags = log.a1Flags(); + hash.put("Flags", a1Flags); + faults = log.faults(); + hash.put("Faults", faults); + + modeValue = log.modeValue(); + faultsValue = log.faultsValue(); + } + + @Override + public String toStringDecoded() { + return "TimeStamps = " + + this.timseStampsGregorian + + " , " + + tlmArea + + " " + + typeFrame + + separator + + " mode = " + + modeValue + + separator + + " flags = " + + a1Flags + + separator + + " faults = " + + faultsValue; + } + + public String getMode() { + return mode; + } + + public String getA1Flags() { + return a1Flags; + } + + public int getFaultsValue() { + return faultsValue; + } +} diff --git a/ModuleAmicalsat/src/main/java/org/josast/amicalsat/A1GyroTypeFrame.java b/ModuleAmicalsat/src/main/java/org/josast/amicalsat/A1GyroTypeFrame.java index d64fceaec24d73d86717daac0df59240966e01f9..ed8e43b06dc2347ad5a40f724099c7f4759a1ea6 100644 --- a/ModuleAmicalsat/src/main/java/org/josast/amicalsat/A1GyroTypeFrame.java +++ b/ModuleAmicalsat/src/main/java/org/josast/amicalsat/A1GyroTypeFrame.java @@ -6,57 +6,62 @@ import org.josast.amicalsat.generated.FrameTlmAmicalsat.A1Type; // #A1;GYRO;[Current timestamp];[GyroX];[GyroY];[GyroZ] public class A1GyroTypeFrame extends Frame { + private String giroX; + private String giroZ; + private String giroY; - private String giroX; - private String giroZ; - private String giroY; - - private int gyroZValue; - private int gyroXValue; - private int gyroYValue; - - @Override - protected void setUpFrame() { - A1Type a1type = (A1Type) data.frameTlmEntrySat().payload().tlmAreaSwitch(); - A1GyroType log = (A1GyroType) a1type.tlmSw(); - timeStamps = log.timeStamps(); - hash.put("TimeStamp", timeStamps); - setupTimeStamps(log.timeStampsSec()); - - giroX = log.giroX(); - hash.put("giroX", giroX); - giroY = log.giroY(); - hash.put("giroY", giroY); - giroZ = log.giroZ(); - hash.put("giroZ", giroZ); - - gyroXValue = log.giroXValue(); - gyroYValue = log.giroYValue(); - gyroZValue = log.giroZValue(); - - } - - @Override - public String toStringDecoded() { - return "TimeStamps = " + this.timseStampsGregorian +" , "+ tlmArea + " "+ typeFrame - + separator +" GyroX = " + gyroXValue - + separator +" GyroY = " + gyroYValue - + separator +" GyroZ = " + gyroZValue; - } - - public int getGyroZValue() { - return gyroZValue; - } - - public int getGyroXValue() { - return gyroXValue; - } - - public int getGyroYValue() { - return gyroYValue; - } - - + private int gyroZValue; + private int gyroXValue; + private int gyroYValue; + @Override + protected void setUpFrame() { + A1Type a1type = (A1Type) data.frameTlmEntrySat().payload().tlmAreaSwitch(); + A1GyroType log = (A1GyroType) a1type.tlmSw(); + timeStamps = log.timeStamps(); + hash.put("TimeStamp", timeStamps); + setupTimeStamps(log.timeStampsSec()); + giroX = log.giroX(); + hash.put("giroX", giroX); + giroY = log.giroY(); + hash.put("giroY", giroY); + giroZ = log.giroZ(); + hash.put("giroZ", giroZ); + + gyroXValue = log.giroXValue(); + gyroYValue = log.giroYValue(); + gyroZValue = log.giroZValue(); + } + + @Override + public String toStringDecoded() { + return "TimeStamps = " + + this.timseStampsGregorian + + " , " + + tlmArea + + " " + + typeFrame + + separator + + " GyroX = " + + gyroXValue + + separator + + " GyroY = " + + gyroYValue + + separator + + " GyroZ = " + + gyroZValue; + } + + public int getGyroZValue() { + return gyroZValue; + } + + public int getGyroXValue() { + return gyroXValue; + } + + public int getGyroYValue() { + return gyroYValue; + } } diff --git a/ModuleAmicalsat/src/main/java/org/josast/amicalsat/A1MagTypeFrame.java b/ModuleAmicalsat/src/main/java/org/josast/amicalsat/A1MagTypeFrame.java index 133d0cc1186ea83521e385bf2d5783d6e2dfc1ff..7b2204f3ff330deda6d3ae90453e22cb699294a2 100644 --- a/ModuleAmicalsat/src/main/java/org/josast/amicalsat/A1MagTypeFrame.java +++ b/ModuleAmicalsat/src/main/java/org/josast/amicalsat/A1MagTypeFrame.java @@ -3,60 +3,65 @@ package org.josast.amicalsat; import org.josast.amicalsat.generated.FrameTlmAmicalsat.A1MagType; import org.josast.amicalsat.generated.FrameTlmAmicalsat.A1Type; -//#A1;MAG;[Current timestamp];[MagX];[MagY];[MagZ] +// #A1;MAG;[Current timestamp];[MagX];[MagY];[MagZ] public class A1MagTypeFrame extends Frame { + private String magX; + private String magY; + private String magZ; + private int magXValue; + private int magYValue; + private int magZValue; - private String magX; - private String magY; - private String magZ; - private int magXValue; - private int magYValue; - private int magZValue; - - @Override - protected void setUpFrame() { - A1Type a1type = (A1Type) data.frameTlmEntrySat().payload().tlmAreaSwitch(); - A1MagType log = (A1MagType) a1type.tlmSw(); - - timeStamps = log.timeStamps(); - hash.put("TimeStamp", timeStamps); - setupTimeStamps(log.timeStampsSec()); - - magX=log.magX(); - magY=log.magY(); - magZ=log.magZ(); - hash.put("magX", magX); - hash.put("magY", magY); - hash.put("magZ", magZ); - - magXValue = log.magXValue(); - magYValue = log.magYValue(); - magZValue = log.magZValue(); - - } - - @Override - public String toStringDecoded() { - return "TimeStamps = " + this.timseStampsGregorian +" , "+ tlmArea + " "+ typeFrame - + separator +" MagX = " + magXValue - + separator +" MagY = " + magYValue - + separator +" MagZ = " + magZValue; - } - - public int getMagXValue() { - return magXValue; - } - - public int getMagYValue() { - return magYValue; - } - - public int getMagZValue() { - return magZValue; - } - - - - + @Override + protected void setUpFrame() { + A1Type a1type = (A1Type) data.frameTlmEntrySat().payload().tlmAreaSwitch(); + A1MagType log = (A1MagType) a1type.tlmSw(); + + timeStamps = log.timeStamps(); + hash.put("TimeStamp", timeStamps); + setupTimeStamps(log.timeStampsSec()); + + magX = log.magX(); + magY = log.magY(); + magZ = log.magZ(); + hash.put("magX", magX); + hash.put("magY", magY); + hash.put("magZ", magZ); + + magXValue = log.magXValue(); + magYValue = log.magYValue(); + magZValue = log.magZValue(); + } + + @Override + public String toStringDecoded() { + return "TimeStamps = " + + this.timseStampsGregorian + + " , " + + tlmArea + + " " + + typeFrame + + separator + + " MagX = " + + magXValue + + separator + + " MagY = " + + magYValue + + separator + + " MagZ = " + + magZValue; + } + + public int getMagXValue() { + return magXValue; + } + + public int getMagYValue() { + return magYValue; + } + + public int getMagZValue() { + return magZValue; + } } diff --git a/ModuleAmicalsat/src/main/java/org/josast/amicalsat/A1PositionTypeFrame.java b/ModuleAmicalsat/src/main/java/org/josast/amicalsat/A1PositionTypeFrame.java index 12e3315482251904a7e684a64266fa04f2f0c48b..05dc5cf08db8c496badaf3b0f850021a38123090 100644 --- a/ModuleAmicalsat/src/main/java/org/josast/amicalsat/A1PositionTypeFrame.java +++ b/ModuleAmicalsat/src/main/java/org/josast/amicalsat/A1PositionTypeFrame.java @@ -3,45 +3,48 @@ package org.josast.amicalsat; import org.josast.amicalsat.generated.FrameTlmAmicalsat.A1PositionType; import org.josast.amicalsat.generated.FrameTlmAmicalsat.A1Type; -//# #A1;POSITION;[Current timestamp];[Latitude];[Longitude] +// # #A1;POSITION;[Current timestamp];[Latitude];[Longitude] public class A1PositionTypeFrame extends Frame { - - private String latitude; - private String longitude; - - @Override - protected void setUpFrame() { - A1Type a1type = (A1Type) data.frameTlmEntrySat().payload().tlmAreaSwitch(); - A1PositionType log = (A1PositionType) a1type.tlmSw(); - - timeStamps = log.timeStamps(); - hash.put("TimeStamp", timeStamps); - setupTimeStamps(log.timeStampsSec()); - - latitude = log.latitude(); - hash.put("latitude", latitude); - longitude = log.longitude(); - hash.put("longitude", longitude); - - - } - - @Override - public String toStringDecoded() { - return "TimeStamps = " + this.timseStampsGregorian +" , "+ tlmArea + " "+ typeFrame - + separator + " Latitude = " + latitude - + separator + " Longitude = " + longitude; - } - - public String getLatitude() { - return latitude; - } - - public String getLongitude() { - return longitude; - } - - - + private String latitude; + private String longitude; + + @Override + protected void setUpFrame() { + A1Type a1type = (A1Type) data.frameTlmEntrySat().payload().tlmAreaSwitch(); + A1PositionType log = (A1PositionType) a1type.tlmSw(); + + timeStamps = log.timeStamps(); + hash.put("TimeStamp", timeStamps); + setupTimeStamps(log.timeStampsSec()); + + latitude = log.latitude(); + hash.put("latitude", latitude); + longitude = log.longitude(); + hash.put("longitude", longitude); + } + + @Override + public String toStringDecoded() { + return "TimeStamps = " + + this.timseStampsGregorian + + " , " + + tlmArea + + " " + + typeFrame + + separator + + " Latitude = " + + latitude + + separator + + " Longitude = " + + longitude; + } + + public String getLatitude() { + return latitude; + } + + public String getLongitude() { + return longitude; + } } diff --git a/ModuleAmicalsat/src/main/java/org/josast/amicalsat/CuLogTypeFrame.java b/ModuleAmicalsat/src/main/java/org/josast/amicalsat/CuLogTypeFrame.java index 965a55e08af1ce3fe0254c1563231ed96f7d973b..10d48615f8d225856e82599dfb88617b247e53d2 100644 --- a/ModuleAmicalsat/src/main/java/org/josast/amicalsat/CuLogTypeFrame.java +++ b/ModuleAmicalsat/src/main/java/org/josast/amicalsat/CuLogTypeFrame.java @@ -3,61 +3,64 @@ package org.josast.amicalsat; import org.josast.amicalsat.generated.FrameTlmAmicalsat.CuLogType; import org.josast.amicalsat.generated.FrameTlmAmicalsat.CuType; -//#[CU_R/CU_L];LOG;[Timestamp];[CPU voltage];[CPU temperature];[flags ] +// #[CU_R/CU_L];LOG;[Timestamp];[CPU voltage];[CPU temperature];[flags ] public class CuLogTypeFrame extends Frame { - - - public String getFlags() { - return flags; - } - - private String cpuVoltage; - private String cpuTemperature; - private String flags; - private Double cpuVoltageVolt; - private Integer cpuTemperatureDegree; - - @Override - protected void setUpFrame() { - - CuType cutype = (CuType) data.frameTlmEntrySat().payload().tlmAreaSwitch(); - CuLogType log = (CuLogType) cutype.tlmsw(); - - timeStamps = cutype.timeStamps(); - hash.put("TimeStamp", timeStamps); - setupTimeStamps(log.timeStampsSec()); - - - cpuVoltage = log.cpuVoltage(); - hash.put("cpuVoltage", cpuVoltage); - cpuTemperature = log.cpuTemperature(); - hash.put("cpuTemperature", cpuTemperature); - flags = log.flags(); - hash.put("Flags", flags); - - cpuVoltageVolt = log.cpuVoltageVolt(); - cpuTemperatureDegree = log.cpuTemperatureDegree(); - - } - - @Override - public String toStringDecoded() { - return "TimeStamps = " + this.timseStampsGregorian +" , "+ tlmArea + " "+ typeFrame - + separator + " CPU voltage (V) = " + cpuVoltageVolt - + separator + " CPU temperature (°C) = " + cpuTemperatureDegree - + separator + " flags = "+ flags; - } - - public Double getCpuVoltageVolt() { - return cpuVoltageVolt; - } - - public Integer getCpuTemperatureDegree() { - return cpuTemperatureDegree; - } - - - - + public String getFlags() { + return flags; + } + + private String cpuVoltage; + private String cpuTemperature; + private String flags; + private Double cpuVoltageVolt; + private Integer cpuTemperatureDegree; + + @Override + protected void setUpFrame() { + + CuType cutype = (CuType) data.frameTlmEntrySat().payload().tlmAreaSwitch(); + CuLogType log = (CuLogType) cutype.tlmsw(); + + timeStamps = cutype.timeStamps(); + hash.put("TimeStamp", timeStamps); + setupTimeStamps(log.timeStampsSec()); + + cpuVoltage = log.cpuVoltage(); + hash.put("cpuVoltage", cpuVoltage); + cpuTemperature = log.cpuTemperature(); + hash.put("cpuTemperature", cpuTemperature); + flags = log.flags(); + hash.put("Flags", flags); + + cpuVoltageVolt = log.cpuVoltageVolt(); + cpuTemperatureDegree = log.cpuTemperatureDegree(); + } + + @Override + public String toStringDecoded() { + return "TimeStamps = " + + this.timseStampsGregorian + + " , " + + tlmArea + + " " + + typeFrame + + separator + + " CPU voltage (V) = " + + cpuVoltageVolt + + separator + + " CPU temperature (°C) = " + + cpuTemperatureDegree + + separator + + " flags = " + + flags; + } + + public Double getCpuVoltageVolt() { + return cpuVoltageVolt; + } + + public Integer getCpuTemperatureDegree() { + return cpuTemperatureDegree; + } } diff --git a/ModuleAmicalsat/src/main/java/org/josast/amicalsat/EmLogTypeFrame.java b/ModuleAmicalsat/src/main/java/org/josast/amicalsat/EmLogTypeFrame.java index 0084c8f6c53fcee9a420be9f2dc78c5af074f650..0d9f6358f7b6e17d0ed4703f41d559429a43fb85 100644 --- a/ModuleAmicalsat/src/main/java/org/josast/amicalsat/EmLogTypeFrame.java +++ b/ModuleAmicalsat/src/main/java/org/josast/amicalsat/EmLogTypeFrame.java @@ -7,95 +7,99 @@ import org.josast.amicalsat.generated.FrameTlmAmicalsat.EmerType; // power];[Peak Power];[Solar panel voltage] public class EmLogTypeFrame extends Frame { - - private String bootNumber; - private String inputVoltage; - private String inputCurrent; - private String inputPower; - private String peakPower; - private String solarPanelVoltage; - private Integer bootNumberInt; - private Double inputVoltageVolt; - private Integer inputCurrentMa; - private Integer inputPowerMw; - private Integer peakPowerMw; - private Double solarPanelVoltageVolt; - - - @Override - protected void setUpFrame() { - - EmerType emtype = (EmerType) data.frameTlmEntrySat().payload().tlmAreaSwitch(); - EmLogType log = (EmLogType) emtype.tlmsw(); - - timeStamps = emtype.timeStamps(); - hash.put("TimeStamp", timeStamps); - setupTimeStamps(log.timeStampsSec()); - - bootNumber = log.bootNumber(); - hash.put("bootNumber", bootNumber); - inputVoltage = log.inputVoltage(); - hash.put("inputVoltage", inputVoltage); - inputCurrent = log.inputCurrent(); - hash.put("inputCurrent", inputCurrent); - inputPower = log.inputPower(); - hash.put("inputPower", inputPower); - peakPower = log.peakPower(); - hash.put("peakPower", peakPower); - solarPanelVoltage = log.solarPanelVoltage(); - hash.put("solarPanelVoltage", solarPanelVoltage); - - bootNumberInt = log.bootNumberInt(); - inputVoltageVolt = log.inputVoltageVolt(); - inputCurrentMa = log.inputCurrentMa(); - inputPowerMw = log.inputPowerMw(); - peakPowerMw = log.peakPowerMw(); - solarPanelVoltageVolt = log.solarPanelVoltageVolt(); - - } - - - @Override - public String toStringDecoded() { - return "TimeStamps = " + this.timseStampsGregorian +" , "+ tlmArea + " "+ typeFrame - + separator + " Boot number = " + bootNumberInt - + separator + " Input voltage (V) = " + inputVoltageVolt - + separator + " Input current (mA) = " + inputCurrentMa - + separator + " Input power (mW) = " + inputPowerMw - + separator + " Peak Power (mW) = " + peakPowerMw - + separator + " Solar panel voltage = " + solarPanelVoltageVolt; - } - - - public Integer getBootNumberInt() { - return bootNumberInt; - } - - - public Double getInputVoltageVolt() { - return inputVoltageVolt; - } - - - public Integer getInputCurrentMa() { - return inputCurrentMa; - } - - - public Integer getInputPowerMw() { - return inputPowerMw; - } - - - public Integer getPeakPowerMw() { - return peakPowerMw; - } - - - public Double getSolarPanelVoltageVolt() { - return solarPanelVoltageVolt; - } - - - + private String bootNumber; + private String inputVoltage; + private String inputCurrent; + private String inputPower; + private String peakPower; + private String solarPanelVoltage; + private Integer bootNumberInt; + private Double inputVoltageVolt; + private Integer inputCurrentMa; + private Integer inputPowerMw; + private Integer peakPowerMw; + private Double solarPanelVoltageVolt; + + @Override + protected void setUpFrame() { + + EmerType emtype = (EmerType) data.frameTlmEntrySat().payload().tlmAreaSwitch(); + EmLogType log = (EmLogType) emtype.tlmsw(); + + timeStamps = emtype.timeStamps(); + hash.put("TimeStamp", timeStamps); + setupTimeStamps(log.timeStampsSec()); + + bootNumber = log.bootNumber(); + hash.put("bootNumber", bootNumber); + inputVoltage = log.inputVoltage(); + hash.put("inputVoltage", inputVoltage); + inputCurrent = log.inputCurrent(); + hash.put("inputCurrent", inputCurrent); + inputPower = log.inputPower(); + hash.put("inputPower", inputPower); + peakPower = log.peakPower(); + hash.put("peakPower", peakPower); + solarPanelVoltage = log.solarPanelVoltage(); + hash.put("solarPanelVoltage", solarPanelVoltage); + + bootNumberInt = log.bootNumberInt(); + inputVoltageVolt = log.inputVoltageVolt(); + inputCurrentMa = log.inputCurrentMa(); + inputPowerMw = log.inputPowerMw(); + peakPowerMw = log.peakPowerMw(); + solarPanelVoltageVolt = log.solarPanelVoltageVolt(); + } + + @Override + public String toStringDecoded() { + return "TimeStamps = " + + this.timseStampsGregorian + + " , " + + tlmArea + + " " + + typeFrame + + separator + + " Boot number = " + + bootNumberInt + + separator + + " Input voltage (V) = " + + inputVoltageVolt + + separator + + " Input current (mA) = " + + inputCurrentMa + + separator + + " Input power (mW) = " + + inputPowerMw + + separator + + " Peak Power (mW) = " + + peakPowerMw + + separator + + " Solar panel voltage = " + + solarPanelVoltageVolt; + } + + public Integer getBootNumberInt() { + return bootNumberInt; + } + + public Double getInputVoltageVolt() { + return inputVoltageVolt; + } + + public Integer getInputCurrentMa() { + return inputCurrentMa; + } + + public Integer getInputPowerMw() { + return inputPowerMw; + } + + public Integer getPeakPowerMw() { + return peakPowerMw; + } + + public Double getSolarPanelVoltageVolt() { + return solarPanelVoltageVolt; + } } diff --git a/ModuleAmicalsat/src/main/java/org/josast/amicalsat/EmmnTypeFrame.java b/ModuleAmicalsat/src/main/java/org/josast/amicalsat/EmmnTypeFrame.java index 55e212608fc88e52d7adbeecd841b33fa9d5c33b..296b0f3463a9185ecd0ef138f570322598f78047 100644 --- a/ModuleAmicalsat/src/main/java/org/josast/amicalsat/EmmnTypeFrame.java +++ b/ModuleAmicalsat/src/main/java/org/josast/amicalsat/EmmnTypeFrame.java @@ -3,103 +3,117 @@ package org.josast.amicalsat; import org.josast.amicalsat.generated.FrameTlmAmicalsat.EmerType; import org.josast.amicalsat.generated.FrameTlmAmicalsat.EmmnType; -//#[EM/ER];MN;[Timestamp];[V in];[V solar];[I in];[P in];[P peak];[T cpu];[V +// #[EM/ER];MN;[Timestamp];[V in];[V solar];[I in];[P in];[P peak];[T cpu];[V // cpu] public class EmmnTypeFrame extends Frame { - - private String vIn; - private String vSolar; - private String iIn; - private String pIn; - private String pPeak; - private String tCpu; - private String vCpu; - private double vInVolt; - private double vSolarVolt; - private int iInMa; - private int pInMw; - private int tCpuDegree; - private double vCpuVolt; - private int pPeakMw; - - private String separator="\r\n"; - - @Override - protected void setUpFrame() { - EmerType emtype = (EmerType) data.frameTlmEntrySat().payload().tlmAreaSwitch(); - EmmnType log = (EmmnType) emtype.tlmsw(); - - timeStamps = emtype.timeStamps(); - hash.put("TimeStamp", timeStamps); - setupTimeStamps(log.timeStampsSec()); - - vIn = log.vIn(); - hash.put("vIn", vIn); - vSolar = log.vSolar(); - hash.put("vSolar", vSolar); - iIn = log.iIn(); - hash.put("iIn", iIn); - pIn = log.pIn(); - hash.put("pIn", pIn); - pPeak = log.pPeak(); - hash.put("pPeak", pPeak); - tCpu = log.tCpu(); - hash.put("tCpu", tCpu); - vCpu = log.vCpu(); - hash.put("vCpu", vCpu); - - vInVolt = log.vInVolt(); - vSolarVolt = log.vSolarVolt(); - iInMa = log.iInMa(); - pInMw = log.pInMw(); - pPeakMw = log.pPeakMw(); - tCpuDegree = log.tCpuDegree(); - vCpuVolt = log.vCpuVolt(); - - } - - @Override - public String toStringDecoded() { - return "TimeStamps = " + this.timseStampsGregorian +" , "+ tlmArea + " "+ typeFrame - + separator+ " V in (V) = " + vInVolt - + separator+ " V solar (V) = " + vSolarVolt - + separator+ " I in (mA) = " + iInMa - + separator+ " P in (mW) = " + pInMw - + separator+ " P peak (mW) = " + pPeakMw - + separator+ " T cpu (°C) = " + tCpuDegree - + separator+ " V cpu (V) = " + vCpuVolt; - } - - public double getvInVolt() { - return vInVolt; - } - - public double getvSolarVolt() { - return vSolarVolt; - } - - public int getiInMa() { - return iInMa; - } - - public int getpInMw() { - return pInMw; - } - - public int gettCpuDegree() { - return tCpuDegree; - } - - public double getvCpuVolt() { - return vCpuVolt; - } - - public int getpPeakMw() { - return pPeakMw; - } - - - + private String vIn; + private String vSolar; + private String iIn; + private String pIn; + private String pPeak; + private String tCpu; + private String vCpu; + private double vInVolt; + private double vSolarVolt; + private int iInMa; + private int pInMw; + private int tCpuDegree; + private double vCpuVolt; + private int pPeakMw; + + private String separator = "\r\n"; + + @Override + protected void setUpFrame() { + EmerType emtype = (EmerType) data.frameTlmEntrySat().payload().tlmAreaSwitch(); + EmmnType log = (EmmnType) emtype.tlmsw(); + + timeStamps = emtype.timeStamps(); + hash.put("TimeStamp", timeStamps); + setupTimeStamps(log.timeStampsSec()); + + vIn = log.vIn(); + hash.put("vIn", vIn); + vSolar = log.vSolar(); + hash.put("vSolar", vSolar); + iIn = log.iIn(); + hash.put("iIn", iIn); + pIn = log.pIn(); + hash.put("pIn", pIn); + pPeak = log.pPeak(); + hash.put("pPeak", pPeak); + tCpu = log.tCpu(); + hash.put("tCpu", tCpu); + vCpu = log.vCpu(); + hash.put("vCpu", vCpu); + + vInVolt = log.vInVolt(); + vSolarVolt = log.vSolarVolt(); + iInMa = log.iInMa(); + pInMw = log.pInMw(); + pPeakMw = log.pPeakMw(); + tCpuDegree = log.tCpuDegree(); + vCpuVolt = log.vCpuVolt(); + } + + @Override + public String toStringDecoded() { + return "TimeStamps = " + + this.timseStampsGregorian + + " , " + + tlmArea + + " " + + typeFrame + + separator + + " V in (V) = " + + vInVolt + + separator + + " V solar (V) = " + + vSolarVolt + + separator + + " I in (mA) = " + + iInMa + + separator + + " P in (mW) = " + + pInMw + + separator + + " P peak (mW) = " + + pPeakMw + + separator + + " T cpu (°C) = " + + tCpuDegree + + separator + + " V cpu (V) = " + + vCpuVolt; + } + + public double getvInVolt() { + return vInVolt; + } + + public double getvSolarVolt() { + return vSolarVolt; + } + + public int getiInMa() { + return iInMa; + } + + public int getpInMw() { + return pInMw; + } + + public int gettCpuDegree() { + return tCpuDegree; + } + + public double getvCpuVolt() { + return vCpuVolt; + } + + public int getpPeakMw() { + return pPeakMw; + } } diff --git a/ModuleAmicalsat/src/main/java/org/josast/amicalsat/FactoryConsumer.java b/ModuleAmicalsat/src/main/java/org/josast/amicalsat/FactoryConsumer.java index 169ee26237056216a32e55307319f6bc758c4833..4025ec21532c8ef0634e11a4eac310c310fa7d94 100644 --- a/ModuleAmicalsat/src/main/java/org/josast/amicalsat/FactoryConsumer.java +++ b/ModuleAmicalsat/src/main/java/org/josast/amicalsat/FactoryConsumer.java @@ -1,41 +1,29 @@ package org.josast.amicalsat; +import io.kaitai.struct.ByteBufferKaitaiStream; import java.util.logging.Logger; - import org.josast.amicalsat.generated.FrameTlmAmicalsat; -import io.kaitai.struct.ByteBufferKaitaiStream; - public class FactoryConsumer { - private Logger log = Logger.getLogger("AmsatLogger"); - FrameFactory ff = new FrameFactory(); - public FactoryConsumer() { - - + private Logger log = Logger.getLogger("AmsatLogger"); + FrameFactory ff = new FrameFactory(); + public FactoryConsumer() {} + + public Frame getFrame(byte[] data) { + Frame fm = null; + + try { + + FrameTlmAmicalsat cube = new FrameTlmAmicalsat(new ByteBufferKaitaiStream(data)); + String tlmArea = cube.frameTlmEntrySat().payload().tlmArea(); + String typeFrame = cube.frameTlmEntrySat().payload().tlmType(); + fm = ff.creerFrame(tlmArea, typeFrame); + fm.setUp(cube); + } catch (Exception e) { + log.severe("Data input received not decoded " + e.toString()); } - - public Frame getFrame (byte [] data) - { - Frame fm = null; - - try { - - - FrameTlmAmicalsat cube = new FrameTlmAmicalsat(new ByteBufferKaitaiStream(data)); - String tlmArea = cube.frameTlmEntrySat().payload().tlmArea(); - String typeFrame = cube.frameTlmEntrySat().payload().tlmType(); - fm = ff.creerFrame(tlmArea, typeFrame); - fm.setUp(cube); - } - catch (Exception e) - { - log.severe("Data input received not decoded " + e.toString()); - } - - return fm; - } - - + return fm; + } } diff --git a/ModuleAmicalsat/src/main/java/org/josast/amicalsat/FlagsTypeFrame.java b/ModuleAmicalsat/src/main/java/org/josast/amicalsat/FlagsTypeFrame.java index 063c4b6288ba1c110be93eca0636eb3da961a697..b604c9fdc6bb913bac1230e95208dfce5ad68881 100644 --- a/ModuleAmicalsat/src/main/java/org/josast/amicalsat/FlagsTypeFrame.java +++ b/ModuleAmicalsat/src/main/java/org/josast/amicalsat/FlagsTypeFrame.java @@ -3,36 +3,38 @@ package org.josast.amicalsat; import org.josast.amicalsat.generated.FrameTlmAmicalsat.FlagsType; import org.josast.amicalsat.generated.FrameTlmAmicalsat.M1Type; -//#M1;FLAGS;[Timestamp];[Hex flags] +// #M1;FLAGS;[Timestamp];[Hex flags] public class FlagsTypeFrame extends Frame { - - private String hexFlags; - - @Override - protected void setUpFrame() { - M1Type m1type = (M1Type) data.frameTlmEntrySat().payload().tlmAreaSwitch(); - FlagsType log = (FlagsType) m1type.tlmSw(); - - timeStamps = m1type.timeStamps(); - setupTimeStamps(log.timeStampsSec()); - - hash.put("TimeStamp", timeStamps); - hexFlags = log.hexFlags(); - hash.put("hexFlags", hexFlags); - } - - @Override - public String toStringDecoded() { - return "TimeStamps = " + this.timseStampsGregorian +" , "+ tlmArea + " "+ typeFrame - + separator+ " hexFlags = " + hexFlags; - - } - - public String getHexFlags() { - return hexFlags; - } - - - + private String hexFlags; + + @Override + protected void setUpFrame() { + M1Type m1type = (M1Type) data.frameTlmEntrySat().payload().tlmAreaSwitch(); + FlagsType log = (FlagsType) m1type.tlmSw(); + + timeStamps = m1type.timeStamps(); + setupTimeStamps(log.timeStampsSec()); + + hash.put("TimeStamp", timeStamps); + hexFlags = log.hexFlags(); + hash.put("hexFlags", hexFlags); + } + + @Override + public String toStringDecoded() { + return "TimeStamps = " + + this.timseStampsGregorian + + " , " + + tlmArea + + " " + + typeFrame + + separator + + " hexFlags = " + + hexFlags; + } + + public String getHexFlags() { + return hexFlags; + } } diff --git a/ModuleAmicalsat/src/main/java/org/josast/amicalsat/Frame.java b/ModuleAmicalsat/src/main/java/org/josast/amicalsat/Frame.java index 00e554732c80846190f0dceb312d8e280f6d5633..7b0a2d8c6d4b15b301e628df1e09b59afc1c9d43 100644 --- a/ModuleAmicalsat/src/main/java/org/josast/amicalsat/Frame.java +++ b/ModuleAmicalsat/src/main/java/org/josast/amicalsat/Frame.java @@ -3,69 +3,64 @@ package org.josast.amicalsat; import java.text.SimpleDateFormat; import java.util.Date; import java.util.HashMap; - import org.josast.amicalsat.generated.FrameTlmAmicalsat; - public abstract class Frame { - protected FrameTlmAmicalsat data =null; - protected HashMap hash = new HashMap(); - protected HashMap hashHeader = new HashMap(); - protected String tlmArea; - protected String typeFrame; - protected String timeStamps; - protected Date timseStampsDate=null; - protected String timseStampsGregorian=null; - private SimpleDateFormat jdf = new SimpleDateFormat("dd-MM-yy HH:mm:ss z"); - protected String separator="\r\n"; - - - public void setUp(FrameTlmAmicalsat fm) - { - data = fm; - tlmArea = fm.frameTlmEntrySat().payload().tlmArea(); - typeFrame = fm.frameTlmEntrySat().payload().tlmType(); - hash.put("Area", tlmArea); - hash.put("typeFrame", typeFrame); - setUpFrame(); - } + protected FrameTlmAmicalsat data = null; + protected HashMap hash = new HashMap(); + protected HashMap hashHeader = new HashMap(); + protected String tlmArea; + protected String typeFrame; + protected String timeStamps; + protected Date timseStampsDate = null; + protected String timseStampsGregorian = null; + private SimpleDateFormat jdf = new SimpleDateFormat("dd-MM-yy HH:mm:ss z"); + protected String separator = "\r\n"; + + public void setUp(FrameTlmAmicalsat fm) { + data = fm; + tlmArea = fm.frameTlmEntrySat().payload().tlmArea(); + typeFrame = fm.frameTlmEntrySat().payload().tlmType(); + hash.put("Area", tlmArea); + hash.put("typeFrame", typeFrame); + setUpFrame(); + } + + protected abstract void setUpFrame(); - protected abstract void setUpFrame (); - public abstract String toStringDecoded(); - - protected void setupTimeStamps(long timestamps) - { - timseStampsDate = new Date(timestamps*1000); //convertie les secondes en ms - timseStampsGregorian = jdf.format(timseStampsDate); - - } - - public String toStringHeader() { - hashHeader.put("Source", data.frameTlmEntrySat().ax25Header().srcCallsignRaw().srcCallsignRor().srcCallsign()); - hashHeader.put("Destination",data.frameTlmEntrySat().ax25Header().destCallsignRaw().destCallsignRor().destCallsign()); - hashHeader.put("PID",""+data.frameTlmEntrySat().payload().pid()); - hashHeader.put("SSID",""+data.frameTlmEntrySat().ax25Header().srcSsidRaw()); - return hashHeader.toString(); + public abstract String toStringDecoded(); - } - @Override - public String toString() { - return hash.toString(); + protected void setupTimeStamps(long timestamps) { + timseStampsDate = new Date(timestamps * 1000); // convertie les secondes en ms + timseStampsGregorian = jdf.format(timseStampsDate); + } - } + public String toStringHeader() { + hashHeader.put( + "Source", + data.frameTlmEntrySat().ax25Header().srcCallsignRaw().srcCallsignRor().srcCallsign()); + hashHeader.put( + "Destination", + data.frameTlmEntrySat().ax25Header().destCallsignRaw().destCallsignRor().destCallsign()); + hashHeader.put("PID", "" + data.frameTlmEntrySat().payload().pid()); + hashHeader.put("SSID", "" + data.frameTlmEntrySat().ax25Header().srcSsidRaw()); + return hashHeader.toString(); + } - public String getTlmArea() { - return tlmArea; - } + @Override + public String toString() { + return hash.toString(); + } - public String getTypeFrame() { - return typeFrame; - } + public String getTlmArea() { + return tlmArea; + } - public String getTimseStampsGregorian() { - return timseStampsGregorian; - } - - + public String getTypeFrame() { + return typeFrame; + } + public String getTimseStampsGregorian() { + return timseStampsGregorian; + } } diff --git a/ModuleAmicalsat/src/main/java/org/josast/amicalsat/FrameFactory.java b/ModuleAmicalsat/src/main/java/org/josast/amicalsat/FrameFactory.java index ef1aa100fbbaade51a5da401d535b553927a5053..5eead4b3bc1cc8676a57fe4f1a233ee7b32a5fb9 100644 --- a/ModuleAmicalsat/src/main/java/org/josast/amicalsat/FrameFactory.java +++ b/ModuleAmicalsat/src/main/java/org/josast/amicalsat/FrameFactory.java @@ -2,125 +2,109 @@ package org.josast.amicalsat; public class FrameFactory { - public Frame creerFrame(String tlmArea, String typeFrame) { + public Frame creerFrame(String tlmArea, String typeFrame) { - Frame frame = null; + Frame frame = null; - if (tlmArea.compareTo("M1") == 0) { + if (tlmArea.compareTo("M1") == 0) { - if (typeFrame.compareTo("LOG") == 0) { + if (typeFrame.compareTo("LOG") == 0) { - frame = new M1LogTypeFrame(); + frame = new M1LogTypeFrame(); + } - } + if (typeFrame.compareTo("FLAGS") == 0) { - if (typeFrame.compareTo("FLAGS") == 0) { - - frame = new FlagsTypeFrame(); - - } - } - - if (tlmArea.compareTo("A1") == 0) { - - if (typeFrame.compareTo("FLAGS") == 0) { - frame = new A1FlagTypeFrame(); - } - - if (typeFrame.compareTo("MAG") == 0) { - frame = new A1MagTypeFrame(); - - } - - if (typeFrame.compareTo("GYRO") == 0) { - - frame = new A1GyroTypeFrame(); - - } - // # #A1;POSITION;[Current timestamp];[Latitude];[Longitude] - if (typeFrame.compareTo("POSITION") == 0) { - - frame = new A1PositionTypeFrame(); - } - } - if (tlmArea.compareTo("EM") == 0) { - - if (typeFrame.compareTo("MN") == 0) { - frame = new EmmnTypeFrame(); - - } - - if (typeFrame.compareTo("LOG") == 0) { - frame = new EmLogTypeFrame(); - - } - - } - - if (tlmArea.compareTo("CU_R") == 0) { + frame = new FlagsTypeFrame(); + } + } - if (typeFrame.compareTo("LOG") == 0) { - frame = new CuLogTypeFrame(); + if (tlmArea.compareTo("A1") == 0) { - } - } + if (typeFrame.compareTo("FLAGS") == 0) { + frame = new A1FlagTypeFrame(); + } - if (tlmArea.compareTo("CU_L") == 0) { + if (typeFrame.compareTo("MAG") == 0) { + frame = new A1MagTypeFrame(); + } - if (typeFrame.compareTo("LOG") == 0) { + if (typeFrame.compareTo("GYRO") == 0) { - frame = new CuLogTypeFrame(); + frame = new A1GyroTypeFrame(); + } + // # #A1;POSITION;[Current timestamp];[Latitude];[Longitude] + if (typeFrame.compareTo("POSITION") == 0) { - } - } + frame = new A1PositionTypeFrame(); + } + } + if (tlmArea.compareTo("EM") == 0) { - if (tlmArea.compareTo("V1") == 0) { + if (typeFrame.compareTo("MN") == 0) { + frame = new EmmnTypeFrame(); + } - // #[V1/U2];MS;[Timestamp];[Current rssi];[Latch rssi];[AFC offset ] + if (typeFrame.compareTo("LOG") == 0) { + frame = new EmLogTypeFrame(); + } + } - if (typeFrame.compareTo("MS") == 0) { + if (tlmArea.compareTo("CU_R") == 0) { - frame = new V1MsTypeFrame(); + if (typeFrame.compareTo("LOG") == 0) { + frame = new CuLogTypeFrame(); + } + } - } + if (tlmArea.compareTo("CU_L") == 0) { - if (typeFrame.compareTo("RL") == 0) { - frame = new V1RlTypeFrame(); + if (typeFrame.compareTo("LOG") == 0) { - } - } + frame = new CuLogTypeFrame(); + } + } - if (tlmArea.compareTo("U2") == 0) { + if (tlmArea.compareTo("V1") == 0) { - // #[V1/U2];MS;[Timestamp];[Current rssi];[Latch rssi];[AFC offset ] - if (typeFrame.compareTo("MS") == 0) { - frame = new U2MsTypeFrame(); + // #[V1/U2];MS;[Timestamp];[Current rssi];[Latch rssi];[AFC offset ] - } - // #[U2];RL;[Timestamp],[CPU voltage];[Battery voltage];[CPU - // temperature];[Amplifier temperature];[Flags] - if (typeFrame.compareTo("RL") == 0) { + if (typeFrame.compareTo("MS") == 0) { - frame = new U2RlTypeFrame(); + frame = new V1MsTypeFrame(); + } - } + if (typeFrame.compareTo("RL") == 0) { + frame = new V1RlTypeFrame(); + } + } - } + if (tlmArea.compareTo("U2") == 0) { - if (tlmArea.compareTo("ER") == 0) { + // #[V1/U2];MS;[Timestamp];[Current rssi];[Latch rssi];[AFC offset ] + if (typeFrame.compareTo("MS") == 0) { + frame = new U2MsTypeFrame(); + } + // #[U2];RL;[Timestamp],[CPU voltage];[Battery voltage];[CPU + // temperature];[Amplifier temperature];[Flags] + if (typeFrame.compareTo("RL") == 0) { - // #[V1/U2];MS;[Timestamp];[Current rssi];[Latch rssi];[AFC offset ] - if (typeFrame.compareTo("LOG") == 0) { - frame = new EmLogTypeFrame(); + frame = new U2RlTypeFrame(); + } + } - } - if (typeFrame.compareTo("MN") == 0) { + if (tlmArea.compareTo("ER") == 0) { - frame = new EmmnTypeFrame(); - } - } + // #[V1/U2];MS;[Timestamp];[Current rssi];[Latch rssi];[AFC offset ] + if (typeFrame.compareTo("LOG") == 0) { + frame = new EmLogTypeFrame(); + } + if (typeFrame.compareTo("MN") == 0) { - return frame; + frame = new EmmnTypeFrame(); + } } + return frame; + } } diff --git a/ModuleAmicalsat/src/main/java/org/josast/amicalsat/M1LogTypeFrame.java b/ModuleAmicalsat/src/main/java/org/josast/amicalsat/M1LogTypeFrame.java index 84cf8ac61a83ccf40a9b6759b7197e2c399d2730..1eaccbd38332efac4566298b3eb3bc7e8c005a8e 100644 --- a/ModuleAmicalsat/src/main/java/org/josast/amicalsat/M1LogTypeFrame.java +++ b/ModuleAmicalsat/src/main/java/org/josast/amicalsat/M1LogTypeFrame.java @@ -3,73 +3,77 @@ package org.josast.amicalsat; import org.josast.amicalsat.generated.FrameTlmAmicalsat.LogType; import org.josast.amicalsat.generated.FrameTlmAmicalsat.M1Type; -//#M1;LOG;[Timestamp];[Boot number];[Up time];[CPU voltage];[CPU temperature] - +// #M1;LOG;[Timestamp];[Boot number];[Up time];[CPU voltage];[CPU temperature] public class M1LogTypeFrame extends Frame { + private String bootNumber; + private String upTime; + private String cpuVoltage; + private String cpuTemperature; - private String bootNumber; - private String upTime; - private String cpuVoltage; - private String cpuTemperature; - - private Integer bootNumberValue; - private Integer upTimeSec; - private Double cpuVoltageVolt; - private Integer cpuTemperatureDegree; - - - - @Override - protected void setUpFrame() { - M1Type m1type = (M1Type) data.frameTlmEntrySat().payload().tlmAreaSwitch(); - LogType log = (LogType) m1type.tlmSw(); - timeStamps= m1type.timeStamps(); - setupTimeStamps(log.timeStampsSec()); - //raw data - hash.put("TimeStamp", timeStamps); - bootNumber= log.bootNumber(); - hash.put("BootNumber", bootNumber); - upTime=log.upTime(); - hash.put("UpTime", upTime); - cpuVoltage=log.cpuVoltage(); - hash.put("CpuVoltage", cpuVoltage); - cpuTemperature = log.cpuTemperature(); - hash.put("CpuTemperature", cpuTemperature); - //intepreted data - cpuVoltageVolt=log.cpuVoltageVolt(); - cpuTemperatureDegree = log.cpuTemperatureDegree(); - bootNumberValue = log.bootNumberInt(); - upTimeSec = log.upTimeSec(); - - } - - public String toStringDecoded() - { - return "TimeStamps = " + this.timseStampsGregorian +" , "+ tlmArea + " "+ typeFrame - + separator + " Boot number = " + this.bootNumberValue - + separator + " Up time (S) = "+ this.upTimeSec - + separator + " CPU VoltageVolt (V) = "+cpuVoltageVolt - + separator + " CPU Temperature (D) = "+ cpuTemperatureDegree; - - } + private Integer bootNumberValue; + private Integer upTimeSec; + private Double cpuVoltageVolt; + private Integer cpuTemperatureDegree; - public Integer getBootNumberValue() { - return bootNumberValue; - } + @Override + protected void setUpFrame() { + M1Type m1type = (M1Type) data.frameTlmEntrySat().payload().tlmAreaSwitch(); + LogType log = (LogType) m1type.tlmSw(); + timeStamps = m1type.timeStamps(); + setupTimeStamps(log.timeStampsSec()); + // raw data + hash.put("TimeStamp", timeStamps); + bootNumber = log.bootNumber(); + hash.put("BootNumber", bootNumber); + upTime = log.upTime(); + hash.put("UpTime", upTime); + cpuVoltage = log.cpuVoltage(); + hash.put("CpuVoltage", cpuVoltage); + cpuTemperature = log.cpuTemperature(); + hash.put("CpuTemperature", cpuTemperature); + // intepreted data + cpuVoltageVolt = log.cpuVoltageVolt(); + cpuTemperatureDegree = log.cpuTemperatureDegree(); + bootNumberValue = log.bootNumberInt(); + upTimeSec = log.upTimeSec(); + } - public Integer getUpTimeSec() { - return upTimeSec; - } + public String toStringDecoded() { + return "TimeStamps = " + + this.timseStampsGregorian + + " , " + + tlmArea + + " " + + typeFrame + + separator + + " Boot number = " + + this.bootNumberValue + + separator + + " Up time (S) = " + + this.upTimeSec + + separator + + " CPU VoltageVolt (V) = " + + cpuVoltageVolt + + separator + + " CPU Temperature (D) = " + + cpuTemperatureDegree; + } - public Double getCpuVoltageVolt() { - return cpuVoltageVolt; - } + public Integer getBootNumberValue() { + return bootNumberValue; + } - public Integer getCpuTemperatureDegree() { - return cpuTemperatureDegree; - } + public Integer getUpTimeSec() { + return upTimeSec; + } + public Double getCpuVoltageVolt() { + return cpuVoltageVolt; + } + public Integer getCpuTemperatureDegree() { + return cpuTemperatureDegree; + } } diff --git a/ModuleAmicalsat/src/main/java/org/josast/amicalsat/U2MsTypeFrame.java b/ModuleAmicalsat/src/main/java/org/josast/amicalsat/U2MsTypeFrame.java index d99eb9179886081d4b7eb23ec9641646a9a4626a..5f2c2997879b1fe8968d0995dd9fba3713ef5641 100644 --- a/ModuleAmicalsat/src/main/java/org/josast/amicalsat/U2MsTypeFrame.java +++ b/ModuleAmicalsat/src/main/java/org/josast/amicalsat/U2MsTypeFrame.java @@ -3,64 +3,66 @@ package org.josast.amicalsat; import org.josast.amicalsat.generated.FrameTlmAmicalsat.MsType; import org.josast.amicalsat.generated.FrameTlmAmicalsat.U2Type; - -//#[V1/U2];MS;[Timestamp];[Current rssi];[Latch rssi];[AFC offset ] +// #[V1/U2];MS;[Timestamp];[Current rssi];[Latch rssi];[AFC offset ] public class U2MsTypeFrame extends Frame { + private String currentRssi; + private String latchRssi; + private String aFCOffset; - private String currentRssi; - private String latchRssi; - private String aFCOffset; - - private Integer currentRssiMa; - private Integer latchRssiValue; - private Integer aFCOffsetValue; - - - @Override - protected void setUpFrame() { - U2Type u2type = (U2Type) data.frameTlmEntrySat().payload().tlmAreaSwitch(); - MsType mstype = (MsType) u2type.tlmsw(); - - timeStamps = mstype.timeStamps(); - hash.put("timeStamps", timeStamps); - setupTimeStamps(mstype.timeStampsSec()); - - - currentRssi = mstype.currentRssi(); - hash.put("currentRssi", currentRssi); - latchRssi = mstype.latchRssi(); - hash.put("latchRssi", latchRssi); - aFCOffset = mstype.aFCOffset(); - hash.put("aFCOffset", aFCOffset); - - currentRssiMa= mstype.currentRssiMa(); - latchRssiValue= mstype.latchRssiValue(); - aFCOffsetValue= mstype.aFCOffsetValue(); + private Integer currentRssiMa; + private Integer latchRssiValue; + private Integer aFCOffsetValue; - - } + @Override + protected void setUpFrame() { + U2Type u2type = (U2Type) data.frameTlmEntrySat().payload().tlmAreaSwitch(); + MsType mstype = (MsType) u2type.tlmsw(); - @Override - public String toStringDecoded() { - return "TimeStamps = " + this.timseStampsGregorian +" , "+ tlmArea + " "+ typeFrame - + separator+ " Current rssi (mA) = " + currentRssiMa - + separator+ " Latch rssi = " + latchRssiValue - + separator+ " AFC offset = " + aFCOffsetValue; - } + timeStamps = mstype.timeStamps(); + hash.put("timeStamps", timeStamps); + setupTimeStamps(mstype.timeStampsSec()); - public Integer getCurrentRssiMa() { - return currentRssiMa; - } + currentRssi = mstype.currentRssi(); + hash.put("currentRssi", currentRssi); + latchRssi = mstype.latchRssi(); + hash.put("latchRssi", latchRssi); + aFCOffset = mstype.aFCOffset(); + hash.put("aFCOffset", aFCOffset); - public Integer getLatchRssiValue() { - return latchRssiValue; - } + currentRssiMa = mstype.currentRssiMa(); + latchRssiValue = mstype.latchRssiValue(); + aFCOffsetValue = mstype.aFCOffsetValue(); + } - public Integer getaFCOffsetValue() { - return aFCOffsetValue; - } + @Override + public String toStringDecoded() { + return "TimeStamps = " + + this.timseStampsGregorian + + " , " + + tlmArea + + " " + + typeFrame + + separator + + " Current rssi (mA) = " + + currentRssiMa + + separator + + " Latch rssi = " + + latchRssiValue + + separator + + " AFC offset = " + + aFCOffsetValue; + } + public Integer getCurrentRssiMa() { + return currentRssiMa; + } + public Integer getLatchRssiValue() { + return latchRssiValue; + } + public Integer getaFCOffsetValue() { + return aFCOffsetValue; + } } diff --git a/ModuleAmicalsat/src/main/java/org/josast/amicalsat/U2RlTypeFrame.java b/ModuleAmicalsat/src/main/java/org/josast/amicalsat/U2RlTypeFrame.java index 2dd4afeab93b378f6e072b23e1ab79f9c4b1e821..03c1020710ab047f872019c67e6ff80b76f44243 100644 --- a/ModuleAmicalsat/src/main/java/org/josast/amicalsat/U2RlTypeFrame.java +++ b/ModuleAmicalsat/src/main/java/org/josast/amicalsat/U2RlTypeFrame.java @@ -3,85 +3,93 @@ package org.josast.amicalsat; import org.josast.amicalsat.generated.FrameTlmAmicalsat.U2RlType; import org.josast.amicalsat.generated.FrameTlmAmicalsat.U2Type; -//#[U2];RL;[Timestamp],[CPU voltage];[Battery voltage];[CPU temperature];[Amplifier temperature];[Flags] +// #[U2];RL;[Timestamp],[CPU voltage];[Battery voltage];[CPU temperature];[Amplifier +// temperature];[Flags] public class U2RlTypeFrame extends Frame { + private String cpuVoltage; + private String batteryVoltage; + private String cpuTtemperature; + private String amplifierTemperature; + private String flags; + private Double cpuVoltageVolt; + private Double batteryVoltageVolt; + private Integer cpuTemperatureDegree; + private Integer amplifierTemperatureDegree; + private Integer flagsHexa; - - private String cpuVoltage; - private String batteryVoltage; - private String cpuTtemperature; - private String amplifierTemperature; - private String flags; - private Double cpuVoltageVolt; - private Double batteryVoltageVolt; - private Integer cpuTemperatureDegree; - private Integer amplifierTemperatureDegree; - private Integer flagsHexa; + @Override + protected void setUpFrame() { - @Override - protected void setUpFrame() { + U2Type u2type = (U2Type) data.frameTlmEntrySat().payload().tlmAreaSwitch(); + U2RlType mstype = (U2RlType) u2type.tlmsw(); - U2Type u2type = (U2Type) data.frameTlmEntrySat().payload().tlmAreaSwitch(); - U2RlType mstype = (U2RlType) u2type.tlmsw(); - - timeStamps = mstype.timeStamps(); - hash.put("timeStamps", timeStamps); - setupTimeStamps( mstype.timeStampsSec()); - - cpuVoltage = mstype.cpuVoltage(); - hash.put("cpuVoltage", cpuVoltage); - batteryVoltage = mstype.batteryVoltage(); - hash.put("batteryVoltage", batteryVoltage); - cpuTtemperature = mstype.cpuTemperature(); - hash.put("cpuTtemperature", cpuTtemperature); - cpuTtemperature = mstype.batteryVoltage(); - hash.put("batteryVoltage", batteryVoltage); - amplifierTemperature = mstype.amplifierTemperature(); - hash.put("amplifierTemperature", amplifierTemperature); - flags = mstype.flags(); - hash.put("flags", ""+flags ); - - cpuVoltageVolt = mstype.cpuVoltageVolt() ; - batteryVoltageVolt= mstype.batteryVoltageVolt(); - cpuTemperatureDegree = mstype.cpuTemperatureDegree(); - amplifierTemperatureDegree=mstype.amplifierTemperatureDegree(); - flagsHexa=mstype.flagsHexa(); - - } - - public String toStringDecoded() - { - return "TimeStamps = " + this.timseStampsGregorian +" , "+ tlmArea + " "+ typeFrame - + separator+ " CPU VoltageVolt (V) = "+cpuVoltageVolt - + separator+ " Battery Voltage (V) = "+batteryVoltageVolt - + separator+ " CPU Temperature (°C) = "+cpuTemperatureDegree - + separator+ " Amplifier Temperature (°C) = "+amplifierTemperatureDegree - + separator+ " flags = "+flagsHexa; - } + timeStamps = mstype.timeStamps(); + hash.put("timeStamps", timeStamps); + setupTimeStamps(mstype.timeStampsSec()); - public Double getCpuVoltageVolt() { - return cpuVoltageVolt; - } + cpuVoltage = mstype.cpuVoltage(); + hash.put("cpuVoltage", cpuVoltage); + batteryVoltage = mstype.batteryVoltage(); + hash.put("batteryVoltage", batteryVoltage); + cpuTtemperature = mstype.cpuTemperature(); + hash.put("cpuTtemperature", cpuTtemperature); + cpuTtemperature = mstype.batteryVoltage(); + hash.put("batteryVoltage", batteryVoltage); + amplifierTemperature = mstype.amplifierTemperature(); + hash.put("amplifierTemperature", amplifierTemperature); + flags = mstype.flags(); + hash.put("flags", "" + flags); - public Double getBatteryVoltageVolt() { - return batteryVoltageVolt; - } + cpuVoltageVolt = mstype.cpuVoltageVolt(); + batteryVoltageVolt = mstype.batteryVoltageVolt(); + cpuTemperatureDegree = mstype.cpuTemperatureDegree(); + amplifierTemperatureDegree = mstype.amplifierTemperatureDegree(); + flagsHexa = mstype.flagsHexa(); + } - public Integer getCpuTemperatureDegree() { - return cpuTemperatureDegree; - } + public String toStringDecoded() { + return "TimeStamps = " + + this.timseStampsGregorian + + " , " + + tlmArea + + " " + + typeFrame + + separator + + " CPU VoltageVolt (V) = " + + cpuVoltageVolt + + separator + + " Battery Voltage (V) = " + + batteryVoltageVolt + + separator + + " CPU Temperature (°C) = " + + cpuTemperatureDegree + + separator + + " Amplifier Temperature (°C) = " + + amplifierTemperatureDegree + + separator + + " flags = " + + flagsHexa; + } - public Integer getAmplifierTemperatureDegree() { - return amplifierTemperatureDegree; - } + public Double getCpuVoltageVolt() { + return cpuVoltageVolt; + } - public Integer getFlagsHexa() { - return flagsHexa; - } + public Double getBatteryVoltageVolt() { + return batteryVoltageVolt; + } - - + public Integer getCpuTemperatureDegree() { + return cpuTemperatureDegree; + } + public Integer getAmplifierTemperatureDegree() { + return amplifierTemperatureDegree; + } + + public Integer getFlagsHexa() { + return flagsHexa; + } } diff --git a/ModuleAmicalsat/src/main/java/org/josast/amicalsat/V1MsTypeFrame.java b/ModuleAmicalsat/src/main/java/org/josast/amicalsat/V1MsTypeFrame.java index b68b29cbbc7e0b786527b37defe441fb83125b6c..9db840ccc67cb78af9e7bac41f4aa239eb439d20 100644 --- a/ModuleAmicalsat/src/main/java/org/josast/amicalsat/V1MsTypeFrame.java +++ b/ModuleAmicalsat/src/main/java/org/josast/amicalsat/V1MsTypeFrame.java @@ -3,60 +3,65 @@ package org.josast.amicalsat; import org.josast.amicalsat.generated.FrameTlmAmicalsat.MsType; import org.josast.amicalsat.generated.FrameTlmAmicalsat.V1Type; - -//#[V1/U2];MS;[Timestamp];[Current rssi];[Latch rssi];[AFC offset ] +// #[V1/U2];MS;[Timestamp];[Current rssi];[Latch rssi];[AFC offset ] public class V1MsTypeFrame extends Frame { + private String currentRssi; + private String latchRssi; + private String aFCOffset; + private Integer currentRssiMa; + private Integer latchRssiValue; + private Integer aFCOffsetValue; + + @Override + protected void setUpFrame() { + V1Type u2type = (V1Type) data.frameTlmEntrySat().payload().tlmAreaSwitch(); + MsType mstype = (MsType) u2type.tlmsw(); + + timeStamps = mstype.timeStamps(); + hash.put("timeStamps", timeStamps); + setupTimeStamps(mstype.timeStampsSec()); + + currentRssi = mstype.currentRssi(); + hash.put("currentRssi", currentRssi); + latchRssi = mstype.latchRssi(); + hash.put("latchRssi", latchRssi); + aFCOffset = mstype.aFCOffset(); + hash.put("aFCOffset", aFCOffset); + + currentRssiMa = mstype.currentRssiMa(); + latchRssiValue = mstype.latchRssiValue(); + aFCOffsetValue = mstype.aFCOffsetValue(); + } + + @Override + public String toStringDecoded() { + return "TimeStamps = " + + this.timseStampsGregorian + + " , " + + tlmArea + + " " + + typeFrame + + separator + + " Current rssi (mA) = " + + currentRssiMa + + separator + + " Latch rssi = " + + latchRssiValue + + separator + + " AFC offset = " + + aFCOffsetValue; + } - private String currentRssi; - private String latchRssi; - private String aFCOffset; - private Integer currentRssiMa; - private Integer latchRssiValue; - private Integer aFCOffsetValue; - - @Override - protected void setUpFrame() { - V1Type u2type = (V1Type) data.frameTlmEntrySat().payload().tlmAreaSwitch(); - MsType mstype = (MsType) u2type.tlmsw(); - - timeStamps = mstype.timeStamps(); - hash.put("timeStamps", timeStamps); - setupTimeStamps(mstype.timeStampsSec()); - - currentRssi = mstype.currentRssi(); - hash.put("currentRssi", currentRssi); - latchRssi = mstype.latchRssi(); - hash.put("latchRssi", latchRssi); - aFCOffset = mstype.aFCOffset(); - hash.put("aFCOffset", aFCOffset); - - currentRssiMa= mstype.currentRssiMa(); - latchRssiValue= mstype.latchRssiValue(); - aFCOffsetValue= mstype.aFCOffsetValue(); - - - } - - @Override - public String toStringDecoded() { - return "TimeStamps = " + this.timseStampsGregorian +" , "+ tlmArea + " "+ typeFrame - + separator+ " Current rssi (mA) = " + currentRssiMa - + separator+ " Latch rssi = " + latchRssiValue - + separator+ " AFC offset = " + aFCOffsetValue; - } - - public Integer getCurrentRssiMa() { - return currentRssiMa; - } - - public Integer getLatchRssiValue() { - return latchRssiValue; - } - - public Integer getaFCOffsetValue() { - return aFCOffsetValue; - } + public Integer getCurrentRssiMa() { + return currentRssiMa; + } + public Integer getLatchRssiValue() { + return latchRssiValue; + } + public Integer getaFCOffsetValue() { + return aFCOffsetValue; + } } diff --git a/ModuleAmicalsat/src/main/java/org/josast/amicalsat/V1RlTypeFrame.java b/ModuleAmicalsat/src/main/java/org/josast/amicalsat/V1RlTypeFrame.java index b2983bb01594cf8d81f0a1f36ec0daaea93469e7..c55c57821dc0f62789b526ea287e9645294673b1 100644 --- a/ModuleAmicalsat/src/main/java/org/josast/amicalsat/V1RlTypeFrame.java +++ b/ModuleAmicalsat/src/main/java/org/josast/amicalsat/V1RlTypeFrame.java @@ -5,77 +5,89 @@ import org.josast.amicalsat.generated.FrameTlmAmicalsat.V1Type; public class V1RlTypeFrame extends Frame { - private String cpuVoltage; - private String batteryVoltage; - private String cpuTtemperature; - private String amplifierTemperature; - private String flags; - - private Double cpuVoltageVolt; - private Double batteryVoltageVolt; - private Integer cpuTemperatureDegree; - private Integer amplifierTemperatureDegree; - private Integer flagsHexa; - - @Override - protected void setUpFrame() { - - V1Type v1u2type = (V1Type) data.frameTlmEntrySat().payload() - .tlmAreaSwitch(); - V1RlType mstype = (V1RlType) v1u2type.tlmsw(); - - timeStamps = mstype.timeStamps(); - hash.put("timeStamps", timeStamps); - setupTimeStamps(mstype.timeStampsSec()); - - cpuVoltage = mstype.cpuVoltage(); - hash.put("cpuVoltage", cpuVoltage); - batteryVoltage = mstype.batteryVoltage(); - hash.put("batteryVoltage", batteryVoltage); - cpuTtemperature = mstype.cpuTemperature(); - hash.put("cpuTtemperature", cpuTtemperature); - amplifierTemperature = mstype.amplifierTemperature(); - hash.put("amplifierTemperature", amplifierTemperature); - - flags = mstype.flags(); - hash.put("flags", flags); - - cpuVoltageVolt = mstype.cpuVoltageVolt(); - batteryVoltageVolt = mstype.batteryVoltageVolt(); - cpuTemperatureDegree = mstype.cpuTemperatureDegree(); - amplifierTemperatureDegree = mstype.amplifierTemperatureDegree(); - flagsHexa = mstype.flagsHexa(); - - } - - @Override - public String toStringDecoded() { - return "TimeStamps = " + this.timseStampsGregorian +" , "+ tlmArea + " "+ typeFrame - + separator+ " CPU VoltageVolt (V) = " + cpuVoltageVolt - + separator+ " Battery Voltage (V) = " + batteryVoltageVolt - + separator+ " CPU Temperature (°C) = " + cpuTemperatureDegree - + separator+ " Amplifier Temperature (°C) = " + amplifierTemperatureDegree - + separator+ " flags = " + flagsHexa; - } - - public Double getCpuVoltageVolt() { - return cpuVoltageVolt; - } - - public Double getBatteryVoltageVolt() { - return batteryVoltageVolt; - } - - public Integer getCpuTemperatureDegree() { - return cpuTemperatureDegree; - } - - public Integer getAmplifierTemperatureDegree() { - return amplifierTemperatureDegree; - } - - public Integer getFlagsHexa() { - return flagsHexa; - } - + private String cpuVoltage; + private String batteryVoltage; + private String cpuTtemperature; + private String amplifierTemperature; + private String flags; + + private Double cpuVoltageVolt; + private Double batteryVoltageVolt; + private Integer cpuTemperatureDegree; + private Integer amplifierTemperatureDegree; + private Integer flagsHexa; + + @Override + protected void setUpFrame() { + + V1Type v1u2type = (V1Type) data.frameTlmEntrySat().payload().tlmAreaSwitch(); + V1RlType mstype = (V1RlType) v1u2type.tlmsw(); + + timeStamps = mstype.timeStamps(); + hash.put("timeStamps", timeStamps); + setupTimeStamps(mstype.timeStampsSec()); + + cpuVoltage = mstype.cpuVoltage(); + hash.put("cpuVoltage", cpuVoltage); + batteryVoltage = mstype.batteryVoltage(); + hash.put("batteryVoltage", batteryVoltage); + cpuTtemperature = mstype.cpuTemperature(); + hash.put("cpuTtemperature", cpuTtemperature); + amplifierTemperature = mstype.amplifierTemperature(); + hash.put("amplifierTemperature", amplifierTemperature); + + flags = mstype.flags(); + hash.put("flags", flags); + + cpuVoltageVolt = mstype.cpuVoltageVolt(); + batteryVoltageVolt = mstype.batteryVoltageVolt(); + cpuTemperatureDegree = mstype.cpuTemperatureDegree(); + amplifierTemperatureDegree = mstype.amplifierTemperatureDegree(); + flagsHexa = mstype.flagsHexa(); + } + + @Override + public String toStringDecoded() { + return "TimeStamps = " + + this.timseStampsGregorian + + " , " + + tlmArea + + " " + + typeFrame + + separator + + " CPU VoltageVolt (V) = " + + cpuVoltageVolt + + separator + + " Battery Voltage (V) = " + + batteryVoltageVolt + + separator + + " CPU Temperature (°C) = " + + cpuTemperatureDegree + + separator + + " Amplifier Temperature (°C) = " + + amplifierTemperatureDegree + + separator + + " flags = " + + flagsHexa; + } + + public Double getCpuVoltageVolt() { + return cpuVoltageVolt; + } + + public Double getBatteryVoltageVolt() { + return batteryVoltageVolt; + } + + public Integer getCpuTemperatureDegree() { + return cpuTemperatureDegree; + } + + public Integer getAmplifierTemperatureDegree() { + return amplifierTemperatureDegree; + } + + public Integer getFlagsHexa() { + return flagsHexa; + } } diff --git a/ModuleAmicalsat/src/main/java/org/josast/amicalsat/generated/FrameTlmAmicalsat.java b/ModuleAmicalsat/src/main/java/org/josast/amicalsat/generated/FrameTlmAmicalsat.java index afa346cc96b880efb49f48c825d57c91655f1711..372ff40dca63d2bedb0f1175d91f037ed6068a25 100644 --- a/ModuleAmicalsat/src/main/java/org/josast/amicalsat/generated/FrameTlmAmicalsat.java +++ b/ModuleAmicalsat/src/main/java/org/josast/amicalsat/generated/FrameTlmAmicalsat.java @@ -3,1521 +3,2166 @@ package org.josast.amicalsat.generated; import io.kaitai.struct.ByteBufferKaitaiStream; -import io.kaitai.struct.KaitaiStruct; import io.kaitai.struct.KaitaiStream; +import io.kaitai.struct.KaitaiStruct; import java.io.IOException; import java.nio.charset.Charset; public class FrameTlmAmicalsat extends KaitaiStruct { - public static FrameTlmAmicalsat fromFile(String fileName) throws IOException { - return new FrameTlmAmicalsat(new ByteBufferKaitaiStream(fileName)); + public static FrameTlmAmicalsat fromFile(String fileName) throws IOException { + return new FrameTlmAmicalsat(new ByteBufferKaitaiStream(fileName)); + } + + public FrameTlmAmicalsat(KaitaiStream _io) { + this(_io, null, null); + } + + public FrameTlmAmicalsat(KaitaiStream _io, KaitaiStruct _parent) { + this(_io, _parent, null); + } + + public FrameTlmAmicalsat(KaitaiStream _io, KaitaiStruct _parent, FrameTlmAmicalsat _root) { + super(_io); + this._parent = _parent; + this._root = _root == null ? this : _root; + _read(); + } + + private void _read() { + this.frameTlmEntrySat = new Ax25Frame(this._io, this, _root); + } + + public static class EmmnType extends KaitaiStruct { + public static EmmnType fromFile(String fileName) throws IOException { + return new EmmnType(new ByteBufferKaitaiStream(fileName)); } - public FrameTlmAmicalsat(KaitaiStream _io) { - this(_io, null, null); + public EmmnType(KaitaiStream _io) { + this(_io, null, null); } - public FrameTlmAmicalsat(KaitaiStream _io, KaitaiStruct _parent) { - this(_io, _parent, null); + public EmmnType(KaitaiStream _io, FrameTlmAmicalsat.EmerType _parent) { + this(_io, _parent, null); } - public FrameTlmAmicalsat(KaitaiStream _io, KaitaiStruct _parent, FrameTlmAmicalsat _root) { - super(_io); - this._parent = _parent; - this._root = _root == null ? this : _root; - _read(); + public EmmnType(KaitaiStream _io, FrameTlmAmicalsat.EmerType _parent, FrameTlmAmicalsat _root) { + super(_io); + this._parent = _parent; + this._root = _root; + _read(); } + private void _read() { - this.frameTlmEntrySat = new Ax25Frame(this._io, this, _root); - } - public static class EmmnType extends KaitaiStruct { - public static EmmnType fromFile(String fileName) throws IOException { - return new EmmnType(new ByteBufferKaitaiStream(fileName)); - } - - public EmmnType(KaitaiStream _io) { - this(_io, null, null); - } - - public EmmnType(KaitaiStream _io, FrameTlmAmicalsat.EmerType _parent) { - this(_io, _parent, null); - } - - public EmmnType(KaitaiStream _io, FrameTlmAmicalsat.EmerType _parent, FrameTlmAmicalsat _root) { - super(_io); - this._parent = _parent; - this._root = _root; - _read(); - } - private void _read() { - this.vIn = new String(this._io.readBytesTerm(59, false, true, true), Charset.forName("ASCII")); - this.vSolar = new String(this._io.readBytesTerm(59, false, true, true), Charset.forName("ASCII")); - this.iIn = new String(this._io.readBytesTerm(59, false, true, true), Charset.forName("ASCII")); - this.pIn = new String(this._io.readBytesTerm(59, false, true, true), Charset.forName("ASCII")); - this.pPeak = new String(this._io.readBytesTerm(59, false, true, true), Charset.forName("ASCII")); - this.tCpu = new String(this._io.readBytesTerm(59, false, true, true), Charset.forName("ASCII")); - this.vCpu = new String(this._io.readBytesFull(), Charset.forName("ASCII")); - } - private Integer pPeakMw; - public Integer pPeakMw() { - if (this.pPeakMw != null) - return this.pPeakMw; - int _tmp = (int) (Long.parseLong(pPeak(), 10)); - this.pPeakMw = _tmp; - return this.pPeakMw; - } - private Integer timeStampsSec; - public Integer timeStampsSec() { - if (this.timeStampsSec != null) - return this.timeStampsSec; - int _tmp = (int) (Long.parseLong(_parent().timeStamps(), 10)); - this.timeStampsSec = _tmp; - return this.timeStampsSec; - } - private Integer tCpuDegree; - public Integer tCpuDegree() { - if (this.tCpuDegree != null) - return this.tCpuDegree; - int _tmp = (int) (Long.parseLong(tCpu(), 10)); - this.tCpuDegree = _tmp; - return this.tCpuDegree; - } - private Double vSolarVolt; - public Double vSolarVolt() { - if (this.vSolarVolt != null) - return this.vSolarVolt; - double _tmp = (double) ((Long.parseLong(vSolar(), 10) / 1000.0)); - this.vSolarVolt = _tmp; - return this.vSolarVolt; - } - private Double vInVolt; - public Double vInVolt() { - if (this.vInVolt != null) - return this.vInVolt; - double _tmp = (double) ((Long.parseLong(vIn(), 10) / 1000.0)); - this.vInVolt = _tmp; - return this.vInVolt; - } - private Integer pInMw; - public Integer pInMw() { - if (this.pInMw != null) - return this.pInMw; - int _tmp = (int) (Long.parseLong(pIn(), 10)); - this.pInMw = _tmp; - return this.pInMw; - } - private Integer iInMa; - public Integer iInMa() { - if (this.iInMa != null) - return this.iInMa; - int _tmp = (int) (Long.parseLong(iIn(), 10)); - this.iInMa = _tmp; - return this.iInMa; - } - private Double vCpuVolt; - public Double vCpuVolt() { - if (this.vCpuVolt != null) - return this.vCpuVolt; - double _tmp = (double) ((Long.parseLong(vCpu(), 10) / 1000.0)); - this.vCpuVolt = _tmp; - return this.vCpuVolt; - } - private String vIn; - private String vSolar; - private String iIn; - private String pIn; - private String pPeak; - private String tCpu; - private String vCpu; - private FrameTlmAmicalsat _root; - private FrameTlmAmicalsat.EmerType _parent; - public String vIn() { return vIn; } - public String vSolar() { return vSolar; } - public String iIn() { return iIn; } - public String pIn() { return pIn; } - public String pPeak() { return pPeak; } - public String tCpu() { return tCpu; } - public String vCpu() { return vCpu; } - public FrameTlmAmicalsat _root() { return _root; } - public FrameTlmAmicalsat.EmerType _parent() { return _parent; } - } - public static class Ax25Frame extends KaitaiStruct { - public static Ax25Frame fromFile(String fileName) throws IOException { - return new Ax25Frame(new ByteBufferKaitaiStream(fileName)); - } - - public Ax25Frame(KaitaiStream _io) { - this(_io, null, null); - } - - public Ax25Frame(KaitaiStream _io, FrameTlmAmicalsat _parent) { - this(_io, _parent, null); - } - - public Ax25Frame(KaitaiStream _io, FrameTlmAmicalsat _parent, FrameTlmAmicalsat _root) { - super(_io); - this._parent = _parent; - this._root = _root; - _read(); - } - private void _read() { - this.ax25Header = new Ax25Header(this._io, this, _root); - this.payload = new IFrame(this._io, this, _root); - } - private Ax25Header ax25Header; - private IFrame payload; - private FrameTlmAmicalsat _root; - private FrameTlmAmicalsat _parent; - public Ax25Header ax25Header() { return ax25Header; } - public IFrame payload() { return payload; } - public FrameTlmAmicalsat _root() { return _root; } - public FrameTlmAmicalsat _parent() { return _parent; } - } - public static class DestCallsign extends KaitaiStruct { - public static DestCallsign fromFile(String fileName) throws IOException { - return new DestCallsign(new ByteBufferKaitaiStream(fileName)); - } - - public DestCallsign(KaitaiStream _io) { - this(_io, null, null); - } - - public DestCallsign(KaitaiStream _io, FrameTlmAmicalsat.DestCallsignRaw _parent) { - this(_io, _parent, null); - } - - public DestCallsign(KaitaiStream _io, FrameTlmAmicalsat.DestCallsignRaw _parent, FrameTlmAmicalsat _root) { - super(_io); - this._parent = _parent; - this._root = _root; - _read(); - } - private void _read() { - this.destCallsign = new String(this._io.readBytes(6), Charset.forName("ASCII")); - } - private String destCallsign; - private FrameTlmAmicalsat _root; - private FrameTlmAmicalsat.DestCallsignRaw _parent; - public String destCallsign() { return destCallsign; } - public FrameTlmAmicalsat _root() { return _root; } - public FrameTlmAmicalsat.DestCallsignRaw _parent() { return _parent; } - } - public static class Ax25Header extends KaitaiStruct { - public static Ax25Header fromFile(String fileName) throws IOException { - return new Ax25Header(new ByteBufferKaitaiStream(fileName)); - } - - public Ax25Header(KaitaiStream _io) { - this(_io, null, null); - } - - public Ax25Header(KaitaiStream _io, FrameTlmAmicalsat.Ax25Frame _parent) { - this(_io, _parent, null); - } - - public Ax25Header(KaitaiStream _io, FrameTlmAmicalsat.Ax25Frame _parent, FrameTlmAmicalsat _root) { - super(_io); - this._parent = _parent; - this._root = _root; - _read(); - } - private void _read() { - this.destCallsignRaw = new DestCallsignRaw(this._io, this, _root); - this.destSsidRaw = this._io.readU1(); - this.srcCallsignRaw = new SrcCallsignRaw(this._io, this, _root); - this.srcSsidRaw = this._io.readU1(); - this.ctl = this._io.readU1(); - } - private Integer srcSsid; - public Integer srcSsid() { - if (this.srcSsid != null) - return this.srcSsid; - int _tmp = (int) (((srcSsidRaw() & 15) >> 1)); - this.srcSsid = _tmp; - return this.srcSsid; - } - private Integer destSsid; - public Integer destSsid() { - if (this.destSsid != null) - return this.destSsid; - int _tmp = (int) (((destSsidRaw() & 15) >> 1)); - this.destSsid = _tmp; - return this.destSsid; - } - private DestCallsignRaw destCallsignRaw; - private int destSsidRaw; - private SrcCallsignRaw srcCallsignRaw; - private int srcSsidRaw; - private int ctl; - private FrameTlmAmicalsat _root; - private FrameTlmAmicalsat.Ax25Frame _parent; - public DestCallsignRaw destCallsignRaw() { return destCallsignRaw; } - public int destSsidRaw() { return destSsidRaw; } - public SrcCallsignRaw srcCallsignRaw() { return srcCallsignRaw; } - public int srcSsidRaw() { return srcSsidRaw; } - public int ctl() { return ctl; } - public FrameTlmAmicalsat _root() { return _root; } - public FrameTlmAmicalsat.Ax25Frame _parent() { return _parent; } - } - public static class A1PositionType extends KaitaiStruct { - public static A1PositionType fromFile(String fileName) throws IOException { - return new A1PositionType(new ByteBufferKaitaiStream(fileName)); - } - - public A1PositionType(KaitaiStream _io) { - this(_io, null, null); - } - - public A1PositionType(KaitaiStream _io, FrameTlmAmicalsat.A1Type _parent) { - this(_io, _parent, null); - } - - public A1PositionType(KaitaiStream _io, FrameTlmAmicalsat.A1Type _parent, FrameTlmAmicalsat _root) { - super(_io); - this._parent = _parent; - this._root = _root; - _read(); - } - private void _read() { - this.timeStamps = new String(this._io.readBytesTerm(59, false, true, true), Charset.forName("ASCII")); - this.latitude = new String(this._io.readBytesTerm(59, false, true, true), Charset.forName("ASCII")); - this.longitude = new String(this._io.readBytesFull(), Charset.forName("ASCII")); - } - private Integer timeStampsSec; - public Integer timeStampsSec() { - if (this.timeStampsSec != null) - return this.timeStampsSec; - int _tmp = (int) (Long.parseLong(timeStamps(), 10)); - this.timeStampsSec = _tmp; - return this.timeStampsSec; - } - private String timeStamps; - private String latitude; - private String longitude; - private FrameTlmAmicalsat _root; - private FrameTlmAmicalsat.A1Type _parent; - public String timeStamps() { return timeStamps; } - public String latitude() { return latitude; } - public String longitude() { return longitude; } - public FrameTlmAmicalsat _root() { return _root; } - public FrameTlmAmicalsat.A1Type _parent() { return _parent; } - } - public static class M1Type extends KaitaiStruct { - public static M1Type fromFile(String fileName) throws IOException { - return new M1Type(new ByteBufferKaitaiStream(fileName)); - } - - public M1Type(KaitaiStream _io) { - this(_io, null, null); - } - - public M1Type(KaitaiStream _io, FrameTlmAmicalsat.IFrame _parent) { - this(_io, _parent, null); - } - - public M1Type(KaitaiStream _io, FrameTlmAmicalsat.IFrame _parent, FrameTlmAmicalsat _root) { - super(_io); - this._parent = _parent; - this._root = _root; - _read(); - } - private void _read() { - this.timeStamps = new String(this._io.readBytesTerm(59, false, true, true), Charset.forName("ASCII")); - switch (_parent().tlmType()) { - case "LOG": { - this.tlmSw = new LogType(this._io, this, _root); - break; - } - case "FLAGS": { - this.tlmSw = new FlagsType(this._io, this, _root); - break; - } - } - this.ax25Info = this._io.readBytesFull(); - } - private String timeStamps; - private KaitaiStruct tlmSw; - private byte[] ax25Info; - private FrameTlmAmicalsat _root; - private FrameTlmAmicalsat.IFrame _parent; - public String timeStamps() { return timeStamps; } - public KaitaiStruct tlmSw() { return tlmSw; } - public byte[] ax25Info() { return ax25Info; } - public FrameTlmAmicalsat _root() { return _root; } - public FrameTlmAmicalsat.IFrame _parent() { return _parent; } - } - public static class EmLogType extends KaitaiStruct { - public static EmLogType fromFile(String fileName) throws IOException { - return new EmLogType(new ByteBufferKaitaiStream(fileName)); - } - - public EmLogType(KaitaiStream _io) { - this(_io, null, null); - } - - public EmLogType(KaitaiStream _io, FrameTlmAmicalsat.EmerType _parent) { - this(_io, _parent, null); - } - - public EmLogType(KaitaiStream _io, FrameTlmAmicalsat.EmerType _parent, FrameTlmAmicalsat _root) { - super(_io); - this._parent = _parent; - this._root = _root; - _read(); - } - private void _read() { - this.bootNumber = new String(this._io.readBytesTerm(59, false, true, true), Charset.forName("ASCII")); - this.inputVoltage = new String(this._io.readBytesTerm(59, false, true, true), Charset.forName("ASCII")); - this.inputCurrent = new String(this._io.readBytesTerm(59, false, true, true), Charset.forName("ASCII")); - this.inputPower = new String(this._io.readBytesTerm(59, false, true, true), Charset.forName("ASCII")); - this.peakPower = new String(this._io.readBytesTerm(59, false, true, true), Charset.forName("ASCII")); - this.solarPanelVoltage = new String(this._io.readBytesFull(), Charset.forName("ASCII")); - } - private Integer inputCurrentMa; - public Integer inputCurrentMa() { - if (this.inputCurrentMa != null) - return this.inputCurrentMa; - int _tmp = (int) (Long.parseLong(inputCurrent(), 10)); - this.inputCurrentMa = _tmp; - return this.inputCurrentMa; - } - private Integer peakPowerMw; - public Integer peakPowerMw() { - if (this.peakPowerMw != null) - return this.peakPowerMw; - int _tmp = (int) (Long.parseLong(peakPower(), 10)); - this.peakPowerMw = _tmp; - return this.peakPowerMw; - } - private Integer timeStampsSec; - public Integer timeStampsSec() { - if (this.timeStampsSec != null) - return this.timeStampsSec; - int _tmp = (int) (Long.parseLong(_parent().timeStamps(), 10)); - this.timeStampsSec = _tmp; - return this.timeStampsSec; - } - private Integer inputPowerMw; - public Integer inputPowerMw() { - if (this.inputPowerMw != null) - return this.inputPowerMw; - int _tmp = (int) (Long.parseLong(inputPower(), 10)); - this.inputPowerMw = _tmp; - return this.inputPowerMw; - } - private Integer bootNumberInt; - public Integer bootNumberInt() { - if (this.bootNumberInt != null) - return this.bootNumberInt; - int _tmp = (int) (Long.parseLong(bootNumber(), 10)); - this.bootNumberInt = _tmp; - return this.bootNumberInt; - } - private Double inputVoltageVolt; - public Double inputVoltageVolt() { - if (this.inputVoltageVolt != null) - return this.inputVoltageVolt; - double _tmp = (double) ((Long.parseLong(inputVoltage(), 10) / 1000.0)); - this.inputVoltageVolt = _tmp; - return this.inputVoltageVolt; - } - private Double solarPanelVoltageVolt; - public Double solarPanelVoltageVolt() { - if (this.solarPanelVoltageVolt != null) - return this.solarPanelVoltageVolt; - double _tmp = (double) ((Long.parseLong(solarPanelVoltage(), 10) / 1000.0)); - this.solarPanelVoltageVolt = _tmp; - return this.solarPanelVoltageVolt; - } - private String bootNumber; - private String inputVoltage; - private String inputCurrent; - private String inputPower; - private String peakPower; - private String solarPanelVoltage; - private FrameTlmAmicalsat _root; - private FrameTlmAmicalsat.EmerType _parent; - public String bootNumber() { return bootNumber; } - public String inputVoltage() { return inputVoltage; } - public String inputCurrent() { return inputCurrent; } - public String inputPower() { return inputPower; } - public String peakPower() { return peakPower; } - public String solarPanelVoltage() { return solarPanelVoltage; } - public FrameTlmAmicalsat _root() { return _root; } - public FrameTlmAmicalsat.EmerType _parent() { return _parent; } - } - public static class A1FlagType extends KaitaiStruct { - public static A1FlagType fromFile(String fileName) throws IOException { - return new A1FlagType(new ByteBufferKaitaiStream(fileName)); - } - - public A1FlagType(KaitaiStream _io) { - this(_io, null, null); - } - - public A1FlagType(KaitaiStream _io, FrameTlmAmicalsat.A1Type _parent) { - this(_io, _parent, null); - } - - public A1FlagType(KaitaiStream _io, FrameTlmAmicalsat.A1Type _parent, FrameTlmAmicalsat _root) { - super(_io); - this._parent = _parent; - this._root = _root; - _read(); - } - private void _read() { - this.timeStamps = new String(this._io.readBytesTerm(59, false, true, true), Charset.forName("ASCII")); - this.mode = new String(this._io.readBytesTerm(59, false, true, true), Charset.forName("ASCII")); - this.a1Flags = new String(this._io.readBytesTerm(59, false, true, true), Charset.forName("ASCII")); - this.faults = new String(this._io.readBytesFull(), Charset.forName("ASCII")); - } - private Integer modeValue; - public Integer modeValue() { - if (this.modeValue != null) - return this.modeValue; - int _tmp = (int) (Long.parseLong(mode(), 10)); - this.modeValue = _tmp; - return this.modeValue; - } - private Integer faultsValue; - public Integer faultsValue() { - if (this.faultsValue != null) - return this.faultsValue; - int _tmp = (int) (Long.parseLong(faults(), 10)); - this.faultsValue = _tmp; - return this.faultsValue; - } - private Integer timeStampsSec; - public Integer timeStampsSec() { - if (this.timeStampsSec != null) - return this.timeStampsSec; - int _tmp = (int) (Long.parseLong(timeStamps(), 10)); - this.timeStampsSec = _tmp; - return this.timeStampsSec; - } - private String timeStamps; - private String mode; - private String a1Flags; - private String faults; - private FrameTlmAmicalsat _root; - private FrameTlmAmicalsat.A1Type _parent; - public String timeStamps() { return timeStamps; } - public String mode() { return mode; } - public String a1Flags() { return a1Flags; } - public String faults() { return faults; } - public FrameTlmAmicalsat _root() { return _root; } - public FrameTlmAmicalsat.A1Type _parent() { return _parent; } - } - public static class SrcCallsignRaw extends KaitaiStruct { - public static SrcCallsignRaw fromFile(String fileName) throws IOException { - return new SrcCallsignRaw(new ByteBufferKaitaiStream(fileName)); - } - - public SrcCallsignRaw(KaitaiStream _io) { - this(_io, null, null); - } - - public SrcCallsignRaw(KaitaiStream _io, FrameTlmAmicalsat.Ax25Header _parent) { - this(_io, _parent, null); - } - - public SrcCallsignRaw(KaitaiStream _io, FrameTlmAmicalsat.Ax25Header _parent, FrameTlmAmicalsat _root) { - super(_io); - this._parent = _parent; - this._root = _root; - _read(); - } - private void _read() { - this._raw__raw_srcCallsignRor = this._io.readBytes(6); - this._raw_srcCallsignRor = KaitaiStream.processRotateLeft(this._raw__raw_srcCallsignRor, 8 - (1), 1); - KaitaiStream _io__raw_srcCallsignRor = new ByteBufferKaitaiStream(_raw_srcCallsignRor); - this.srcCallsignRor = new SrcCallsign(_io__raw_srcCallsignRor, this, _root); - } - private SrcCallsign srcCallsignRor; - private FrameTlmAmicalsat _root; - private FrameTlmAmicalsat.Ax25Header _parent; - private byte[] _raw__raw_srcCallsignRor; - private byte[] _raw_srcCallsignRor; - public SrcCallsign srcCallsignRor() { return srcCallsignRor; } - public FrameTlmAmicalsat _root() { return _root; } - public FrameTlmAmicalsat.Ax25Header _parent() { return _parent; } - public byte[] _raw__raw_srcCallsignRor() { return _raw__raw_srcCallsignRor; } - public byte[] _raw_srcCallsignRor() { return _raw_srcCallsignRor; } - } - public static class FlagsType extends KaitaiStruct { - public static FlagsType fromFile(String fileName) throws IOException { - return new FlagsType(new ByteBufferKaitaiStream(fileName)); - } - - public FlagsType(KaitaiStream _io) { - this(_io, null, null); - } - - public FlagsType(KaitaiStream _io, FrameTlmAmicalsat.M1Type _parent) { - this(_io, _parent, null); - } - - public FlagsType(KaitaiStream _io, FrameTlmAmicalsat.M1Type _parent, FrameTlmAmicalsat _root) { - super(_io); - this._parent = _parent; - this._root = _root; - _read(); - } - private void _read() { - this.hexFlags = new String(this._io.readBytesTerm(59, false, true, true), Charset.forName("ASCII")); - } - private Integer timeStampsSec; - public Integer timeStampsSec() { - if (this.timeStampsSec != null) - return this.timeStampsSec; - int _tmp = (int) (Long.parseLong(_parent().timeStamps(), 10)); - this.timeStampsSec = _tmp; - return this.timeStampsSec; - } - private String hexFlags; - private FrameTlmAmicalsat _root; - private FrameTlmAmicalsat.M1Type _parent; - public String hexFlags() { return hexFlags; } - public FrameTlmAmicalsat _root() { return _root; } - public FrameTlmAmicalsat.M1Type _parent() { return _parent; } - } - public static class IFrame extends KaitaiStruct { - public static IFrame fromFile(String fileName) throws IOException { - return new IFrame(new ByteBufferKaitaiStream(fileName)); - } - - public IFrame(KaitaiStream _io) { - this(_io, null, null); - } - - public IFrame(KaitaiStream _io, FrameTlmAmicalsat.Ax25Frame _parent) { - this(_io, _parent, null); - } - - public IFrame(KaitaiStream _io, FrameTlmAmicalsat.Ax25Frame _parent, FrameTlmAmicalsat _root) { - super(_io); - this._parent = _parent; - this._root = _root; - _read(); - } - private void _read() { - this.pid = this._io.readU1(); - this.field = new String(this._io.readBytesTerm(61, false, true, true), Charset.forName("ASCII")); - this.tlmArea = new String(this._io.readBytesTerm(59, false, true, true), Charset.forName("ASCII")); - this.tlmType = new String(this._io.readBytesTerm(59, false, true, true), Charset.forName("ASCII")); - switch (tlmArea()) { - case "EM": { - this.tlmAreaSwitch = new EmerType(this._io, this, _root); - break; - } - case "M1": { - this.tlmAreaSwitch = new M1Type(this._io, this, _root); - break; - } - case "V1": { - this.tlmAreaSwitch = new V1Type(this._io, this, _root); - break; - } - case "U2": { - this.tlmAreaSwitch = new U2Type(this._io, this, _root); - break; - } - case "A1": { - this.tlmAreaSwitch = new A1Type(this._io, this, _root); - break; - } - case "CU_L": { - this.tlmAreaSwitch = new CuType(this._io, this, _root); - break; - } - case "CU_R": { - this.tlmAreaSwitch = new CuType(this._io, this, _root); - break; - } - case "ER": { - this.tlmAreaSwitch = new EmerType(this._io, this, _root); - break; - } - } - } - private int pid; - private String field; - private String tlmArea; - private String tlmType; - private KaitaiStruct tlmAreaSwitch; - private FrameTlmAmicalsat _root; - private FrameTlmAmicalsat.Ax25Frame _parent; - public int pid() { return pid; } - public String field() { return field; } - public String tlmArea() { return tlmArea; } - public String tlmType() { return tlmType; } - public KaitaiStruct tlmAreaSwitch() { return tlmAreaSwitch; } - public FrameTlmAmicalsat _root() { return _root; } - public FrameTlmAmicalsat.Ax25Frame _parent() { return _parent; } - } - public static class U2RlType extends KaitaiStruct { - public static U2RlType fromFile(String fileName) throws IOException { - return new U2RlType(new ByteBufferKaitaiStream(fileName)); - } - - public U2RlType(KaitaiStream _io) { - this(_io, null, null); - } - - public U2RlType(KaitaiStream _io, FrameTlmAmicalsat.U2Type _parent) { - this(_io, _parent, null); - } - - public U2RlType(KaitaiStream _io, FrameTlmAmicalsat.U2Type _parent, FrameTlmAmicalsat _root) { - super(_io); - this._parent = _parent; - this._root = _root; - _read(); - } - private void _read() { - this.timeStamps = new String(this._io.readBytesTerm(59, false, true, true), Charset.forName("ASCII")); - this.cpuVoltage = new String(this._io.readBytesTerm(59, false, true, true), Charset.forName("ASCII")); - this.batteryVoltage = new String(this._io.readBytesTerm(59, false, true, true), Charset.forName("ASCII")); - this.cpuTemperature = new String(this._io.readBytesTerm(59, false, true, true), Charset.forName("ASCII")); - this.amplifierTemperature = new String(this._io.readBytesTerm(59, false, true, true), Charset.forName("ASCII")); - this.flagsmagic = this._io.ensureFixedContents(new byte[] { 48, 120 }); - this.flags = new String(this._io.readBytes(1), Charset.forName("ASCII")); - } - private Integer cpuTemperatureDegree; - public Integer cpuTemperatureDegree() { - if (this.cpuTemperatureDegree != null) - return this.cpuTemperatureDegree; - int _tmp = (int) (Long.parseLong(cpuTemperature(), 10)); - this.cpuTemperatureDegree = _tmp; - return this.cpuTemperatureDegree; - } - private Integer timeStampsSec; - public Integer timeStampsSec() { - if (this.timeStampsSec != null) - return this.timeStampsSec; - int _tmp = (int) (Long.parseLong(timeStamps(), 10)); - this.timeStampsSec = _tmp; - return this.timeStampsSec; - } - private Double cpuVoltageVolt; - public Double cpuVoltageVolt() { - if (this.cpuVoltageVolt != null) - return this.cpuVoltageVolt; - double _tmp = (double) ((Long.parseLong(cpuVoltage(), 10) / 1000.0)); - this.cpuVoltageVolt = _tmp; - return this.cpuVoltageVolt; - } - private Integer flagsHexa; - public Integer flagsHexa() { - if (this.flagsHexa != null) - return this.flagsHexa; - int _tmp = (int) (Long.parseLong(flags(), 10)); - this.flagsHexa = _tmp; - return this.flagsHexa; - } - private Integer amplifierTemperatureDegree; - public Integer amplifierTemperatureDegree() { - if (this.amplifierTemperatureDegree != null) - return this.amplifierTemperatureDegree; - int _tmp = (int) (Long.parseLong(amplifierTemperature(), 10)); - this.amplifierTemperatureDegree = _tmp; - return this.amplifierTemperatureDegree; - } - private Double batteryVoltageVolt; - public Double batteryVoltageVolt() { - if (this.batteryVoltageVolt != null) - return this.batteryVoltageVolt; - double _tmp = (double) ((Long.parseLong(batteryVoltage(), 10) / 1000.0)); - this.batteryVoltageVolt = _tmp; - return this.batteryVoltageVolt; - } - private String timeStamps; - private String cpuVoltage; - private String batteryVoltage; - private String cpuTemperature; - private String amplifierTemperature; - private byte[] flagsmagic; - private String flags; - private FrameTlmAmicalsat _root; - private FrameTlmAmicalsat.U2Type _parent; - public String timeStamps() { return timeStamps; } - public String cpuVoltage() { return cpuVoltage; } - public String batteryVoltage() { return batteryVoltage; } - public String cpuTemperature() { return cpuTemperature; } - public String amplifierTemperature() { return amplifierTemperature; } - public byte[] flagsmagic() { return flagsmagic; } - public String flags() { return flags; } - public FrameTlmAmicalsat _root() { return _root; } - public FrameTlmAmicalsat.U2Type _parent() { return _parent; } - } - public static class CuLogType extends KaitaiStruct { - public static CuLogType fromFile(String fileName) throws IOException { - return new CuLogType(new ByteBufferKaitaiStream(fileName)); - } - - public CuLogType(KaitaiStream _io) { - this(_io, null, null); - } - - public CuLogType(KaitaiStream _io, FrameTlmAmicalsat.CuType _parent) { - this(_io, _parent, null); - } - - public CuLogType(KaitaiStream _io, FrameTlmAmicalsat.CuType _parent, FrameTlmAmicalsat _root) { - super(_io); - this._parent = _parent; - this._root = _root; - _read(); - } - private void _read() { - this.cpuVoltage = new String(this._io.readBytesTerm(59, false, true, true), Charset.forName("ASCII")); - this.cpuTemperature = new String(this._io.readBytesTerm(59, false, true, true), Charset.forName("ASCII")); - this.flagsmagic = this._io.ensureFixedContents(new byte[] { 48, 120 }); - this.flags = new String(this._io.readBytesFull(), Charset.forName("ASCII")); - } - private Double cpuVoltageVolt; - public Double cpuVoltageVolt() { - if (this.cpuVoltageVolt != null) - return this.cpuVoltageVolt; - double _tmp = (double) ((Long.parseLong(cpuVoltage(), 10) / 1000.0)); - this.cpuVoltageVolt = _tmp; - return this.cpuVoltageVolt; - } - private Integer cpuTemperatureDegree; - public Integer cpuTemperatureDegree() { - if (this.cpuTemperatureDegree != null) - return this.cpuTemperatureDegree; - int _tmp = (int) (Long.parseLong(cpuTemperature(), 10)); - this.cpuTemperatureDegree = _tmp; - return this.cpuTemperatureDegree; - } - private Integer timeStampsSec; - public Integer timeStampsSec() { - if (this.timeStampsSec != null) - return this.timeStampsSec; - int _tmp = (int) (Long.parseLong(_parent().timeStamps(), 10)); - this.timeStampsSec = _tmp; - return this.timeStampsSec; - } - private String cpuVoltage; - private String cpuTemperature; - private byte[] flagsmagic; - private String flags; - private FrameTlmAmicalsat _root; - private FrameTlmAmicalsat.CuType _parent; - public String cpuVoltage() { return cpuVoltage; } - public String cpuTemperature() { return cpuTemperature; } - public byte[] flagsmagic() { return flagsmagic; } - public String flags() { return flags; } - public FrameTlmAmicalsat _root() { return _root; } - public FrameTlmAmicalsat.CuType _parent() { return _parent; } - } - public static class V1RlType extends KaitaiStruct { - public static V1RlType fromFile(String fileName) throws IOException { - return new V1RlType(new ByteBufferKaitaiStream(fileName)); - } - - public V1RlType(KaitaiStream _io) { - this(_io, null, null); - } - - public V1RlType(KaitaiStream _io, FrameTlmAmicalsat.V1Type _parent) { - this(_io, _parent, null); - } - - public V1RlType(KaitaiStream _io, FrameTlmAmicalsat.V1Type _parent, FrameTlmAmicalsat _root) { - super(_io); - this._parent = _parent; - this._root = _root; - _read(); - } - private void _read() { - this.timeStamps = new String(this._io.readBytesTerm(44, false, true, true), Charset.forName("ASCII")); - this.cpuVoltage = new String(this._io.readBytesTerm(59, false, true, true), Charset.forName("ASCII")); - this.batteryVoltage = new String(this._io.readBytesTerm(59, false, true, true), Charset.forName("ASCII")); - this.cpuTemperature = new String(this._io.readBytesTerm(59, false, true, true), Charset.forName("ASCII")); - this.amplifierTemperature = new String(this._io.readBytesTerm(59, false, true, true), Charset.forName("ASCII")); - this.flagsmagic = this._io.ensureFixedContents(new byte[] { 48, 120 }); - this.flags = new String(this._io.readBytes(1), Charset.forName("ASCII")); - } - private Integer cpuTemperatureDegree; - public Integer cpuTemperatureDegree() { - if (this.cpuTemperatureDegree != null) - return this.cpuTemperatureDegree; - int _tmp = (int) (Long.parseLong(cpuTemperature(), 10)); - this.cpuTemperatureDegree = _tmp; - return this.cpuTemperatureDegree; - } - private Integer timeStampsSec; - public Integer timeStampsSec() { - if (this.timeStampsSec != null) - return this.timeStampsSec; - int _tmp = (int) (Long.parseLong(timeStamps(), 10)); - this.timeStampsSec = _tmp; - return this.timeStampsSec; - } - private Double cpuVoltageVolt; - public Double cpuVoltageVolt() { - if (this.cpuVoltageVolt != null) - return this.cpuVoltageVolt; - double _tmp = (double) ((Long.parseLong(cpuVoltage(), 10) / 1000.0)); - this.cpuVoltageVolt = _tmp; - return this.cpuVoltageVolt; - } - private Integer flagsHexa; - public Integer flagsHexa() { - if (this.flagsHexa != null) - return this.flagsHexa; - int _tmp = (int) (Long.parseLong(flags(), 10)); - this.flagsHexa = _tmp; - return this.flagsHexa; - } - private Integer amplifierTemperatureDegree; - public Integer amplifierTemperatureDegree() { - if (this.amplifierTemperatureDegree != null) - return this.amplifierTemperatureDegree; - int _tmp = (int) (Long.parseLong(amplifierTemperature(), 10)); - this.amplifierTemperatureDegree = _tmp; - return this.amplifierTemperatureDegree; - } - private Double batteryVoltageVolt; - public Double batteryVoltageVolt() { - if (this.batteryVoltageVolt != null) - return this.batteryVoltageVolt; - double _tmp = (double) ((Long.parseLong(batteryVoltage(), 10) / 1000.0)); - this.batteryVoltageVolt = _tmp; - return this.batteryVoltageVolt; - } - private String timeStamps; - private String cpuVoltage; - private String batteryVoltage; - private String cpuTemperature; - private String amplifierTemperature; - private byte[] flagsmagic; - private String flags; - private FrameTlmAmicalsat _root; - private FrameTlmAmicalsat.V1Type _parent; - public String timeStamps() { return timeStamps; } - public String cpuVoltage() { return cpuVoltage; } - public String batteryVoltage() { return batteryVoltage; } - public String cpuTemperature() { return cpuTemperature; } - public String amplifierTemperature() { return amplifierTemperature; } - public byte[] flagsmagic() { return flagsmagic; } - public String flags() { return flags; } - public FrameTlmAmicalsat _root() { return _root; } - public FrameTlmAmicalsat.V1Type _parent() { return _parent; } - } - public static class OnyxType extends KaitaiStruct { - public static OnyxType fromFile(String fileName) throws IOException { - return new OnyxType(new ByteBufferKaitaiStream(fileName)); - } - - public OnyxType(KaitaiStream _io) { - this(_io, null, null); - } - - public OnyxType(KaitaiStream _io, FrameTlmAmicalsat.CuType _parent) { - this(_io, _parent, null); - } - - public OnyxType(KaitaiStream _io, FrameTlmAmicalsat.CuType _parent, FrameTlmAmicalsat _root) { - super(_io); - this._parent = _parent; - this._root = _root; - _read(); - } - private void _read() { - this.timeStamps = new String(this._io.readBytesTerm(59, false, true, true), Charset.forName("ASCII")); - this.returnValue = new String(this._io.readBytesFull(), Charset.forName("ASCII")); - } - private Integer timeStampsSec; - public Integer timeStampsSec() { - if (this.timeStampsSec != null) - return this.timeStampsSec; - int _tmp = (int) (Long.parseLong(timeStamps(), 10)); - this.timeStampsSec = _tmp; - return this.timeStampsSec; - } - private String timeStamps; - private String returnValue; - private FrameTlmAmicalsat _root; - private FrameTlmAmicalsat.CuType _parent; - public String timeStamps() { return timeStamps; } - public String returnValue() { return returnValue; } - public FrameTlmAmicalsat _root() { return _root; } - public FrameTlmAmicalsat.CuType _parent() { return _parent; } - } - public static class EmerType extends KaitaiStruct { - public static EmerType fromFile(String fileName) throws IOException { - return new EmerType(new ByteBufferKaitaiStream(fileName)); - } - - public EmerType(KaitaiStream _io) { - this(_io, null, null); - } - - public EmerType(KaitaiStream _io, FrameTlmAmicalsat.IFrame _parent) { - this(_io, _parent, null); - } - - public EmerType(KaitaiStream _io, FrameTlmAmicalsat.IFrame _parent, FrameTlmAmicalsat _root) { - super(_io); - this._parent = _parent; - this._root = _root; - _read(); - } - private void _read() { - this.timeStamps = new String(this._io.readBytesTerm(59, false, true, true), Charset.forName("ASCII")); - switch (_parent().tlmType()) { - case "LOG": { - this.tlmsw = new EmLogType(this._io, this, _root); - break; - } - case "MN": { - this.tlmsw = new EmmnType(this._io, this, _root); - break; - } - } - } - private String timeStamps; - private KaitaiStruct tlmsw; - private FrameTlmAmicalsat _root; - private FrameTlmAmicalsat.IFrame _parent; - public String timeStamps() { return timeStamps; } - public KaitaiStruct tlmsw() { return tlmsw; } - public FrameTlmAmicalsat _root() { return _root; } - public FrameTlmAmicalsat.IFrame _parent() { return _parent; } - } - public static class CuType extends KaitaiStruct { - public static CuType fromFile(String fileName) throws IOException { - return new CuType(new ByteBufferKaitaiStream(fileName)); - } - - public CuType(KaitaiStream _io) { - this(_io, null, null); - } - - public CuType(KaitaiStream _io, FrameTlmAmicalsat.IFrame _parent) { - this(_io, _parent, null); - } - - public CuType(KaitaiStream _io, FrameTlmAmicalsat.IFrame _parent, FrameTlmAmicalsat _root) { - super(_io); - this._parent = _parent; - this._root = _root; - _read(); - } - private void _read() { - this.timeStamps = new String(this._io.readBytesTerm(59, false, true, true), Charset.forName("ASCII")); - switch (_parent().tlmType()) { - case "ONYX SENSOR T": { - this.tlmsw = new OnyxType(this._io, this, _root); - break; - } - case "LOG": { - this.tlmsw = new CuLogType(this._io, this, _root); - break; - } - } - } - private String timeStamps; - private KaitaiStruct tlmsw; - private FrameTlmAmicalsat _root; - private FrameTlmAmicalsat.IFrame _parent; - public String timeStamps() { return timeStamps; } - public KaitaiStruct tlmsw() { return tlmsw; } - public FrameTlmAmicalsat _root() { return _root; } - public FrameTlmAmicalsat.IFrame _parent() { return _parent; } - } - public static class A1GyroType extends KaitaiStruct { - public static A1GyroType fromFile(String fileName) throws IOException { - return new A1GyroType(new ByteBufferKaitaiStream(fileName)); - } - - public A1GyroType(KaitaiStream _io) { - this(_io, null, null); - } - - public A1GyroType(KaitaiStream _io, FrameTlmAmicalsat.A1Type _parent) { - this(_io, _parent, null); - } - - public A1GyroType(KaitaiStream _io, FrameTlmAmicalsat.A1Type _parent, FrameTlmAmicalsat _root) { - super(_io); - this._parent = _parent; - this._root = _root; - _read(); - } - private void _read() { - this.timeStamps = new String(this._io.readBytesTerm(59, false, true, true), Charset.forName("ASCII")); - this.giroX = new String(this._io.readBytesTerm(59, false, true, true), Charset.forName("ASCII")); - this.giroY = new String(this._io.readBytesTerm(59, false, true, true), Charset.forName("ASCII")); - this.giroZ = new String(this._io.readBytesTerm(59, false, true, true), Charset.forName("ASCII")); - this.misc = new String(this._io.readBytesFull(), Charset.forName("ASCII")); - } - private Integer timeStampsSec; - public Integer timeStampsSec() { - if (this.timeStampsSec != null) - return this.timeStampsSec; - int _tmp = (int) (Long.parseLong(timeStamps(), 10)); - this.timeStampsSec = _tmp; - return this.timeStampsSec; - } - private Integer giroXValue; - public Integer giroXValue() { - if (this.giroXValue != null) - return this.giroXValue; - int _tmp = (int) (Long.parseLong(giroX(), 10)); - this.giroXValue = _tmp; - return this.giroXValue; - } - private Integer giroYValue; - public Integer giroYValue() { - if (this.giroYValue != null) - return this.giroYValue; - int _tmp = (int) (Long.parseLong(giroY(), 10)); - this.giroYValue = _tmp; - return this.giroYValue; - } - private Integer giroZValue; - public Integer giroZValue() { - if (this.giroZValue != null) - return this.giroZValue; - int _tmp = (int) (Long.parseLong(giroZ(), 10)); - this.giroZValue = _tmp; - return this.giroZValue; - } - private String timeStamps; - private String giroX; - private String giroY; - private String giroZ; - private String misc; - private FrameTlmAmicalsat _root; - private FrameTlmAmicalsat.A1Type _parent; - public String timeStamps() { return timeStamps; } - public String giroX() { return giroX; } - public String giroY() { return giroY; } - public String giroZ() { return giroZ; } - public String misc() { return misc; } - public FrameTlmAmicalsat _root() { return _root; } - public FrameTlmAmicalsat.A1Type _parent() { return _parent; } - } - public static class A1MagType extends KaitaiStruct { - public static A1MagType fromFile(String fileName) throws IOException { - return new A1MagType(new ByteBufferKaitaiStream(fileName)); - } - - public A1MagType(KaitaiStream _io) { - this(_io, null, null); - } - - public A1MagType(KaitaiStream _io, FrameTlmAmicalsat.A1Type _parent) { - this(_io, _parent, null); - } - - public A1MagType(KaitaiStream _io, FrameTlmAmicalsat.A1Type _parent, FrameTlmAmicalsat _root) { - super(_io); - this._parent = _parent; - this._root = _root; - _read(); - } - private void _read() { - this.timeStamps = new String(this._io.readBytesTerm(59, false, true, true), Charset.forName("ASCII")); - this.magX = new String(this._io.readBytesTerm(59, false, true, true), Charset.forName("ASCII")); - this.magY = new String(this._io.readBytesTerm(59, false, true, true), Charset.forName("ASCII")); - this.magZ = new String(this._io.readBytesTerm(59, false, true, true), Charset.forName("ASCII")); - this.misc = new String(this._io.readBytesFull(), Charset.forName("ASCII")); - } - private Integer timeStampsSec; - public Integer timeStampsSec() { - if (this.timeStampsSec != null) - return this.timeStampsSec; - int _tmp = (int) (Long.parseLong(timeStamps(), 10)); - this.timeStampsSec = _tmp; - return this.timeStampsSec; - } - private Integer magXValue; - public Integer magXValue() { - if (this.magXValue != null) - return this.magXValue; - int _tmp = (int) (Long.parseLong(magX(), 10)); - this.magXValue = _tmp; - return this.magXValue; - } - private Integer magYValue; - public Integer magYValue() { - if (this.magYValue != null) - return this.magYValue; - int _tmp = (int) (Long.parseLong(magY(), 10)); - this.magYValue = _tmp; - return this.magYValue; - } - private Integer magZValue; - public Integer magZValue() { - if (this.magZValue != null) - return this.magZValue; - int _tmp = (int) (Long.parseLong(magZ(), 10)); - this.magZValue = _tmp; - return this.magZValue; - } - private String timeStamps; - private String magX; - private String magY; - private String magZ; - private String misc; - private FrameTlmAmicalsat _root; - private FrameTlmAmicalsat.A1Type _parent; - public String timeStamps() { return timeStamps; } - public String magX() { return magX; } - public String magY() { return magY; } - public String magZ() { return magZ; } - public String misc() { return misc; } - public FrameTlmAmicalsat _root() { return _root; } - public FrameTlmAmicalsat.A1Type _parent() { return _parent; } - } - public static class A1Type extends KaitaiStruct { - public static A1Type fromFile(String fileName) throws IOException { - return new A1Type(new ByteBufferKaitaiStream(fileName)); - } - - public A1Type(KaitaiStream _io) { - this(_io, null, null); - } - - public A1Type(KaitaiStream _io, FrameTlmAmicalsat.IFrame _parent) { - this(_io, _parent, null); - } - - public A1Type(KaitaiStream _io, FrameTlmAmicalsat.IFrame _parent, FrameTlmAmicalsat _root) { - super(_io); - this._parent = _parent; - this._root = _root; - _read(); - } - private void _read() { - switch (_parent().tlmType()) { - case "FLAGS": { - this.tlmSw = new A1FlagType(this._io, this, _root); - break; - } - case "MAG": { - this.tlmSw = new A1MagType(this._io, this, _root); - break; - } - case "GYRO": { - this.tlmSw = new A1GyroType(this._io, this, _root); - break; - } - case "POSITION": { - this.tlmSw = new A1PositionType(this._io, this, _root); - break; - } - } - } - private KaitaiStruct tlmSw; - private FrameTlmAmicalsat _root; - private FrameTlmAmicalsat.IFrame _parent; - public KaitaiStruct tlmSw() { return tlmSw; } - public FrameTlmAmicalsat _root() { return _root; } - public FrameTlmAmicalsat.IFrame _parent() { return _parent; } - } - public static class MsType extends KaitaiStruct { - public static MsType fromFile(String fileName) throws IOException { - return new MsType(new ByteBufferKaitaiStream(fileName)); - } - - public MsType(KaitaiStream _io) { - this(_io, null, null); - } - - public MsType(KaitaiStream _io, KaitaiStruct _parent) { - this(_io, _parent, null); - } - - public MsType(KaitaiStream _io, KaitaiStruct _parent, FrameTlmAmicalsat _root) { - super(_io); - this._parent = _parent; - this._root = _root; - _read(); - } - private void _read() { - this.timeStamps = new String(this._io.readBytesTerm(59, false, true, true), Charset.forName("ASCII")); - this.currentRssi = new String(this._io.readBytesTerm(59, false, true, true), Charset.forName("ASCII")); - this.latchRssi = new String(this._io.readBytesTerm(59, false, true, true), Charset.forName("ASCII")); - this.aFCOffset = new String(this._io.readBytesFull(), Charset.forName("ASCII")); - } - private Integer currentRssiMa; - public Integer currentRssiMa() { - if (this.currentRssiMa != null) - return this.currentRssiMa; - int _tmp = (int) (Long.parseLong(currentRssi(), 10)); - this.currentRssiMa = _tmp; - return this.currentRssiMa; - } - private Integer latchRssiValue; - public Integer latchRssiValue() { - if (this.latchRssiValue != null) - return this.latchRssiValue; - int _tmp = (int) (Long.parseLong(latchRssi(), 10)); - this.latchRssiValue = _tmp; - return this.latchRssiValue; - } - private Integer aFCOffsetValue; - public Integer aFCOffsetValue() { - if (this.aFCOffsetValue != null) - return this.aFCOffsetValue; - int _tmp = (int) (Long.parseLong(aFCOffset(), 10)); - this.aFCOffsetValue = _tmp; - return this.aFCOffsetValue; - } - private Integer timeStampsSec; - public Integer timeStampsSec() { - if (this.timeStampsSec != null) - return this.timeStampsSec; - int _tmp = (int) (Long.parseLong(timeStamps(), 10)); - this.timeStampsSec = _tmp; - return this.timeStampsSec; - } - private String timeStamps; - private String currentRssi; - private String latchRssi; - private String aFCOffset; - private FrameTlmAmicalsat _root; - private KaitaiStruct _parent; - public String timeStamps() { return timeStamps; } - public String currentRssi() { return currentRssi; } - public String latchRssi() { return latchRssi; } - public String aFCOffset() { return aFCOffset; } - public FrameTlmAmicalsat _root() { return _root; } - public KaitaiStruct _parent() { return _parent; } - } - public static class LogType extends KaitaiStruct { - public static LogType fromFile(String fileName) throws IOException { - return new LogType(new ByteBufferKaitaiStream(fileName)); - } - - public LogType(KaitaiStream _io) { - this(_io, null, null); - } - - public LogType(KaitaiStream _io, FrameTlmAmicalsat.M1Type _parent) { - this(_io, _parent, null); - } - - public LogType(KaitaiStream _io, FrameTlmAmicalsat.M1Type _parent, FrameTlmAmicalsat _root) { - super(_io); - this._parent = _parent; - this._root = _root; - _read(); - } - private void _read() { - this.bootNumber = new String(this._io.readBytesTerm(59, false, true, true), Charset.forName("ASCII")); - this.upTime = new String(this._io.readBytesTerm(59, false, true, true), Charset.forName("ASCII")); - this.cpuVoltage = new String(this._io.readBytesTerm(59, false, true, true), Charset.forName("ASCII")); - this.cpuTemperature = new String(this._io.readBytesFull(), Charset.forName("ASCII")); - } - private Integer cpuTemperatureDegree; - public Integer cpuTemperatureDegree() { - if (this.cpuTemperatureDegree != null) - return this.cpuTemperatureDegree; - int _tmp = (int) (Long.parseLong(cpuTemperature(), 10)); - this.cpuTemperatureDegree = _tmp; - return this.cpuTemperatureDegree; - } - private Integer upTimeSec; - public Integer upTimeSec() { - if (this.upTimeSec != null) - return this.upTimeSec; - int _tmp = (int) (Long.parseLong(upTime(), 10)); - this.upTimeSec = _tmp; - return this.upTimeSec; - } - private Integer timeStampsSec; - public Integer timeStampsSec() { - if (this.timeStampsSec != null) - return this.timeStampsSec; - int _tmp = (int) (Long.parseLong(_parent().timeStamps(), 10)); - this.timeStampsSec = _tmp; - return this.timeStampsSec; - } - private Integer bootNumberInt; - public Integer bootNumberInt() { - if (this.bootNumberInt != null) - return this.bootNumberInt; - int _tmp = (int) (Long.parseLong(bootNumber(), 10)); - this.bootNumberInt = _tmp; - return this.bootNumberInt; - } - private Double cpuVoltageVolt; - public Double cpuVoltageVolt() { - if (this.cpuVoltageVolt != null) - return this.cpuVoltageVolt; - double _tmp = (double) ((Long.parseLong(cpuVoltage(), 10) / 1000.0)); - this.cpuVoltageVolt = _tmp; - return this.cpuVoltageVolt; - } - private String bootNumber; - private String upTime; - private String cpuVoltage; - private String cpuTemperature; - private FrameTlmAmicalsat _root; - private FrameTlmAmicalsat.M1Type _parent; - public String bootNumber() { return bootNumber; } - public String upTime() { return upTime; } - public String cpuVoltage() { return cpuVoltage; } - public String cpuTemperature() { return cpuTemperature; } - public FrameTlmAmicalsat _root() { return _root; } - public FrameTlmAmicalsat.M1Type _parent() { return _parent; } - } - public static class DestCallsignRaw extends KaitaiStruct { - public static DestCallsignRaw fromFile(String fileName) throws IOException { - return new DestCallsignRaw(new ByteBufferKaitaiStream(fileName)); - } - - public DestCallsignRaw(KaitaiStream _io) { - this(_io, null, null); - } - - public DestCallsignRaw(KaitaiStream _io, FrameTlmAmicalsat.Ax25Header _parent) { - this(_io, _parent, null); - } - - public DestCallsignRaw(KaitaiStream _io, FrameTlmAmicalsat.Ax25Header _parent, FrameTlmAmicalsat _root) { - super(_io); - this._parent = _parent; - this._root = _root; - _read(); - } - private void _read() { - this._raw__raw_destCallsignRor = this._io.readBytes(6); - this._raw_destCallsignRor = KaitaiStream.processRotateLeft(this._raw__raw_destCallsignRor, 8 - (1), 1); - KaitaiStream _io__raw_destCallsignRor = new ByteBufferKaitaiStream(_raw_destCallsignRor); - this.destCallsignRor = new DestCallsign(_io__raw_destCallsignRor, this, _root); - } - private DestCallsign destCallsignRor; - private FrameTlmAmicalsat _root; - private FrameTlmAmicalsat.Ax25Header _parent; - private byte[] _raw__raw_destCallsignRor; - private byte[] _raw_destCallsignRor; - public DestCallsign destCallsignRor() { return destCallsignRor; } - public FrameTlmAmicalsat _root() { return _root; } - public FrameTlmAmicalsat.Ax25Header _parent() { return _parent; } - public byte[] _raw__raw_destCallsignRor() { return _raw__raw_destCallsignRor; } - public byte[] _raw_destCallsignRor() { return _raw_destCallsignRor; } - } - public static class V1Type extends KaitaiStruct { - public static V1Type fromFile(String fileName) throws IOException { - return new V1Type(new ByteBufferKaitaiStream(fileName)); - } - - public V1Type(KaitaiStream _io) { - this(_io, null, null); - } - - public V1Type(KaitaiStream _io, FrameTlmAmicalsat.IFrame _parent) { - this(_io, _parent, null); - } - - public V1Type(KaitaiStream _io, FrameTlmAmicalsat.IFrame _parent, FrameTlmAmicalsat _root) { - super(_io); - this._parent = _parent; - this._root = _root; - _read(); - } - private void _read() { - switch (_parent().tlmType()) { - case "RL": { - this.tlmsw = new V1RlType(this._io, this, _root); - break; - } - case "MS": { - this.tlmsw = new MsType(this._io, this, _root); - break; - } - } - } - private KaitaiStruct tlmsw; - private FrameTlmAmicalsat _root; - private FrameTlmAmicalsat.IFrame _parent; - public KaitaiStruct tlmsw() { return tlmsw; } - public FrameTlmAmicalsat _root() { return _root; } - public FrameTlmAmicalsat.IFrame _parent() { return _parent; } - } - public static class SrcCallsign extends KaitaiStruct { - public static SrcCallsign fromFile(String fileName) throws IOException { - return new SrcCallsign(new ByteBufferKaitaiStream(fileName)); - } - - public SrcCallsign(KaitaiStream _io) { - this(_io, null, null); - } - - public SrcCallsign(KaitaiStream _io, FrameTlmAmicalsat.SrcCallsignRaw _parent) { - this(_io, _parent, null); - } - - public SrcCallsign(KaitaiStream _io, FrameTlmAmicalsat.SrcCallsignRaw _parent, FrameTlmAmicalsat _root) { - super(_io); - this._parent = _parent; - this._root = _root; - _read(); - } - private void _read() { - this.srcCallsign = new String(this._io.readBytes(6), Charset.forName("ASCII")); - } - private String srcCallsign; - private FrameTlmAmicalsat _root; - private FrameTlmAmicalsat.SrcCallsignRaw _parent; - public String srcCallsign() { return srcCallsign; } - public FrameTlmAmicalsat _root() { return _root; } - public FrameTlmAmicalsat.SrcCallsignRaw _parent() { return _parent; } - } - public static class U2Type extends KaitaiStruct { - public static U2Type fromFile(String fileName) throws IOException { - return new U2Type(new ByteBufferKaitaiStream(fileName)); - } - - public U2Type(KaitaiStream _io) { - this(_io, null, null); - } - - public U2Type(KaitaiStream _io, FrameTlmAmicalsat.IFrame _parent) { - this(_io, _parent, null); - } - - public U2Type(KaitaiStream _io, FrameTlmAmicalsat.IFrame _parent, FrameTlmAmicalsat _root) { - super(_io); - this._parent = _parent; - this._root = _root; - _read(); - } - private void _read() { - switch (_parent().tlmType()) { - case "RL": { - this.tlmsw = new U2RlType(this._io, this, _root); - break; - } - case "MS": { - this.tlmsw = new MsType(this._io, this, _root); - break; - } - } - } - private KaitaiStruct tlmsw; - private FrameTlmAmicalsat _root; - private FrameTlmAmicalsat.IFrame _parent; - public KaitaiStruct tlmsw() { return tlmsw; } - public FrameTlmAmicalsat _root() { return _root; } - public FrameTlmAmicalsat.IFrame _parent() { return _parent; } - } - private Ax25Frame frameTlmEntrySat; + this.vIn = + new String(this._io.readBytesTerm(59, false, true, true), Charset.forName("ASCII")); + this.vSolar = + new String(this._io.readBytesTerm(59, false, true, true), Charset.forName("ASCII")); + this.iIn = + new String(this._io.readBytesTerm(59, false, true, true), Charset.forName("ASCII")); + this.pIn = + new String(this._io.readBytesTerm(59, false, true, true), Charset.forName("ASCII")); + this.pPeak = + new String(this._io.readBytesTerm(59, false, true, true), Charset.forName("ASCII")); + this.tCpu = + new String(this._io.readBytesTerm(59, false, true, true), Charset.forName("ASCII")); + this.vCpu = new String(this._io.readBytesFull(), Charset.forName("ASCII")); + } + + private Integer pPeakMw; + + public Integer pPeakMw() { + if (this.pPeakMw != null) return this.pPeakMw; + int _tmp = (int) (Long.parseLong(pPeak(), 10)); + this.pPeakMw = _tmp; + return this.pPeakMw; + } + + private Integer timeStampsSec; + + public Integer timeStampsSec() { + if (this.timeStampsSec != null) return this.timeStampsSec; + int _tmp = (int) (Long.parseLong(_parent().timeStamps(), 10)); + this.timeStampsSec = _tmp; + return this.timeStampsSec; + } + + private Integer tCpuDegree; + + public Integer tCpuDegree() { + if (this.tCpuDegree != null) return this.tCpuDegree; + int _tmp = (int) (Long.parseLong(tCpu(), 10)); + this.tCpuDegree = _tmp; + return this.tCpuDegree; + } + + private Double vSolarVolt; + + public Double vSolarVolt() { + if (this.vSolarVolt != null) return this.vSolarVolt; + double _tmp = (double) ((Long.parseLong(vSolar(), 10) / 1000.0)); + this.vSolarVolt = _tmp; + return this.vSolarVolt; + } + + private Double vInVolt; + + public Double vInVolt() { + if (this.vInVolt != null) return this.vInVolt; + double _tmp = (double) ((Long.parseLong(vIn(), 10) / 1000.0)); + this.vInVolt = _tmp; + return this.vInVolt; + } + + private Integer pInMw; + + public Integer pInMw() { + if (this.pInMw != null) return this.pInMw; + int _tmp = (int) (Long.parseLong(pIn(), 10)); + this.pInMw = _tmp; + return this.pInMw; + } + + private Integer iInMa; + + public Integer iInMa() { + if (this.iInMa != null) return this.iInMa; + int _tmp = (int) (Long.parseLong(iIn(), 10)); + this.iInMa = _tmp; + return this.iInMa; + } + + private Double vCpuVolt; + + public Double vCpuVolt() { + if (this.vCpuVolt != null) return this.vCpuVolt; + double _tmp = (double) ((Long.parseLong(vCpu(), 10) / 1000.0)); + this.vCpuVolt = _tmp; + return this.vCpuVolt; + } + + private String vIn; + private String vSolar; + private String iIn; + private String pIn; + private String pPeak; + private String tCpu; + private String vCpu; private FrameTlmAmicalsat _root; - private KaitaiStruct _parent; + private FrameTlmAmicalsat.EmerType _parent; + + public String vIn() { + return vIn; + } + + public String vSolar() { + return vSolar; + } + + public String iIn() { + return iIn; + } + + public String pIn() { + return pIn; + } + + public String pPeak() { + return pPeak; + } + + public String tCpu() { + return tCpu; + } + + public String vCpu() { + return vCpu; + } + + public FrameTlmAmicalsat _root() { + return _root; + } + + public FrameTlmAmicalsat.EmerType _parent() { + return _parent; + } + } + + public static class Ax25Frame extends KaitaiStruct { + public static Ax25Frame fromFile(String fileName) throws IOException { + return new Ax25Frame(new ByteBufferKaitaiStream(fileName)); + } + + public Ax25Frame(KaitaiStream _io) { + this(_io, null, null); + } + + public Ax25Frame(KaitaiStream _io, FrameTlmAmicalsat _parent) { + this(_io, _parent, null); + } + + public Ax25Frame(KaitaiStream _io, FrameTlmAmicalsat _parent, FrameTlmAmicalsat _root) { + super(_io); + this._parent = _parent; + this._root = _root; + _read(); + } + + private void _read() { + this.ax25Header = new Ax25Header(this._io, this, _root); + this.payload = new IFrame(this._io, this, _root); + } + + private Ax25Header ax25Header; + private IFrame payload; + private FrameTlmAmicalsat _root; + private FrameTlmAmicalsat _parent; + + public Ax25Header ax25Header() { + return ax25Header; + } + + public IFrame payload() { + return payload; + } + + public FrameTlmAmicalsat _root() { + return _root; + } + + public FrameTlmAmicalsat _parent() { + return _parent; + } + } + + public static class DestCallsign extends KaitaiStruct { + public static DestCallsign fromFile(String fileName) throws IOException { + return new DestCallsign(new ByteBufferKaitaiStream(fileName)); + } + + public DestCallsign(KaitaiStream _io) { + this(_io, null, null); + } + + public DestCallsign(KaitaiStream _io, FrameTlmAmicalsat.DestCallsignRaw _parent) { + this(_io, _parent, null); + } + + public DestCallsign( + KaitaiStream _io, FrameTlmAmicalsat.DestCallsignRaw _parent, FrameTlmAmicalsat _root) { + super(_io); + this._parent = _parent; + this._root = _root; + _read(); + } + + private void _read() { + this.destCallsign = new String(this._io.readBytes(6), Charset.forName("ASCII")); + } + + private String destCallsign; + private FrameTlmAmicalsat _root; + private FrameTlmAmicalsat.DestCallsignRaw _parent; + + public String destCallsign() { + return destCallsign; + } + + public FrameTlmAmicalsat _root() { + return _root; + } + + public FrameTlmAmicalsat.DestCallsignRaw _parent() { + return _parent; + } + } + + public static class Ax25Header extends KaitaiStruct { + public static Ax25Header fromFile(String fileName) throws IOException { + return new Ax25Header(new ByteBufferKaitaiStream(fileName)); + } + + public Ax25Header(KaitaiStream _io) { + this(_io, null, null); + } + + public Ax25Header(KaitaiStream _io, FrameTlmAmicalsat.Ax25Frame _parent) { + this(_io, _parent, null); + } + + public Ax25Header( + KaitaiStream _io, FrameTlmAmicalsat.Ax25Frame _parent, FrameTlmAmicalsat _root) { + super(_io); + this._parent = _parent; + this._root = _root; + _read(); + } + + private void _read() { + this.destCallsignRaw = new DestCallsignRaw(this._io, this, _root); + this.destSsidRaw = this._io.readU1(); + this.srcCallsignRaw = new SrcCallsignRaw(this._io, this, _root); + this.srcSsidRaw = this._io.readU1(); + this.ctl = this._io.readU1(); + } + + private Integer srcSsid; + + public Integer srcSsid() { + if (this.srcSsid != null) return this.srcSsid; + int _tmp = (int) (((srcSsidRaw() & 15) >> 1)); + this.srcSsid = _tmp; + return this.srcSsid; + } + + private Integer destSsid; + + public Integer destSsid() { + if (this.destSsid != null) return this.destSsid; + int _tmp = (int) (((destSsidRaw() & 15) >> 1)); + this.destSsid = _tmp; + return this.destSsid; + } + + private DestCallsignRaw destCallsignRaw; + private int destSsidRaw; + private SrcCallsignRaw srcCallsignRaw; + private int srcSsidRaw; + private int ctl; + private FrameTlmAmicalsat _root; + private FrameTlmAmicalsat.Ax25Frame _parent; + + public DestCallsignRaw destCallsignRaw() { + return destCallsignRaw; + } + + public int destSsidRaw() { + return destSsidRaw; + } + + public SrcCallsignRaw srcCallsignRaw() { + return srcCallsignRaw; + } + + public int srcSsidRaw() { + return srcSsidRaw; + } + + public int ctl() { + return ctl; + } + + public FrameTlmAmicalsat _root() { + return _root; + } + + public FrameTlmAmicalsat.Ax25Frame _parent() { + return _parent; + } + } + + public static class A1PositionType extends KaitaiStruct { + public static A1PositionType fromFile(String fileName) throws IOException { + return new A1PositionType(new ByteBufferKaitaiStream(fileName)); + } + + public A1PositionType(KaitaiStream _io) { + this(_io, null, null); + } + + public A1PositionType(KaitaiStream _io, FrameTlmAmicalsat.A1Type _parent) { + this(_io, _parent, null); + } + + public A1PositionType( + KaitaiStream _io, FrameTlmAmicalsat.A1Type _parent, FrameTlmAmicalsat _root) { + super(_io); + this._parent = _parent; + this._root = _root; + _read(); + } + + private void _read() { + this.timeStamps = + new String(this._io.readBytesTerm(59, false, true, true), Charset.forName("ASCII")); + this.latitude = + new String(this._io.readBytesTerm(59, false, true, true), Charset.forName("ASCII")); + this.longitude = new String(this._io.readBytesFull(), Charset.forName("ASCII")); + } + + private Integer timeStampsSec; + + public Integer timeStampsSec() { + if (this.timeStampsSec != null) return this.timeStampsSec; + int _tmp = (int) (Long.parseLong(timeStamps(), 10)); + this.timeStampsSec = _tmp; + return this.timeStampsSec; + } + + private String timeStamps; + private String latitude; + private String longitude; + private FrameTlmAmicalsat _root; + private FrameTlmAmicalsat.A1Type _parent; + + public String timeStamps() { + return timeStamps; + } + + public String latitude() { + return latitude; + } + + public String longitude() { + return longitude; + } + + public FrameTlmAmicalsat _root() { + return _root; + } + + public FrameTlmAmicalsat.A1Type _parent() { + return _parent; + } + } + + public static class M1Type extends KaitaiStruct { + public static M1Type fromFile(String fileName) throws IOException { + return new M1Type(new ByteBufferKaitaiStream(fileName)); + } + + public M1Type(KaitaiStream _io) { + this(_io, null, null); + } + + public M1Type(KaitaiStream _io, FrameTlmAmicalsat.IFrame _parent) { + this(_io, _parent, null); + } + + public M1Type(KaitaiStream _io, FrameTlmAmicalsat.IFrame _parent, FrameTlmAmicalsat _root) { + super(_io); + this._parent = _parent; + this._root = _root; + _read(); + } + + private void _read() { + this.timeStamps = + new String(this._io.readBytesTerm(59, false, true, true), Charset.forName("ASCII")); + switch (_parent().tlmType()) { + case "LOG": + { + this.tlmSw = new LogType(this._io, this, _root); + break; + } + case "FLAGS": + { + this.tlmSw = new FlagsType(this._io, this, _root); + break; + } + } + this.ax25Info = this._io.readBytesFull(); + } + + private String timeStamps; + private KaitaiStruct tlmSw; + private byte[] ax25Info; + private FrameTlmAmicalsat _root; + private FrameTlmAmicalsat.IFrame _parent; + + public String timeStamps() { + return timeStamps; + } + + public KaitaiStruct tlmSw() { + return tlmSw; + } + + public byte[] ax25Info() { + return ax25Info; + } + + public FrameTlmAmicalsat _root() { + return _root; + } + + public FrameTlmAmicalsat.IFrame _parent() { + return _parent; + } + } + + public static class EmLogType extends KaitaiStruct { + public static EmLogType fromFile(String fileName) throws IOException { + return new EmLogType(new ByteBufferKaitaiStream(fileName)); + } + + public EmLogType(KaitaiStream _io) { + this(_io, null, null); + } + + public EmLogType(KaitaiStream _io, FrameTlmAmicalsat.EmerType _parent) { + this(_io, _parent, null); + } + + public EmLogType( + KaitaiStream _io, FrameTlmAmicalsat.EmerType _parent, FrameTlmAmicalsat _root) { + super(_io); + this._parent = _parent; + this._root = _root; + _read(); + } + + private void _read() { + this.bootNumber = + new String(this._io.readBytesTerm(59, false, true, true), Charset.forName("ASCII")); + this.inputVoltage = + new String(this._io.readBytesTerm(59, false, true, true), Charset.forName("ASCII")); + this.inputCurrent = + new String(this._io.readBytesTerm(59, false, true, true), Charset.forName("ASCII")); + this.inputPower = + new String(this._io.readBytesTerm(59, false, true, true), Charset.forName("ASCII")); + this.peakPower = + new String(this._io.readBytesTerm(59, false, true, true), Charset.forName("ASCII")); + this.solarPanelVoltage = new String(this._io.readBytesFull(), Charset.forName("ASCII")); + } + + private Integer inputCurrentMa; + + public Integer inputCurrentMa() { + if (this.inputCurrentMa != null) return this.inputCurrentMa; + int _tmp = (int) (Long.parseLong(inputCurrent(), 10)); + this.inputCurrentMa = _tmp; + return this.inputCurrentMa; + } + + private Integer peakPowerMw; + + public Integer peakPowerMw() { + if (this.peakPowerMw != null) return this.peakPowerMw; + int _tmp = (int) (Long.parseLong(peakPower(), 10)); + this.peakPowerMw = _tmp; + return this.peakPowerMw; + } + + private Integer timeStampsSec; + + public Integer timeStampsSec() { + if (this.timeStampsSec != null) return this.timeStampsSec; + int _tmp = (int) (Long.parseLong(_parent().timeStamps(), 10)); + this.timeStampsSec = _tmp; + return this.timeStampsSec; + } + + private Integer inputPowerMw; + + public Integer inputPowerMw() { + if (this.inputPowerMw != null) return this.inputPowerMw; + int _tmp = (int) (Long.parseLong(inputPower(), 10)); + this.inputPowerMw = _tmp; + return this.inputPowerMw; + } + + private Integer bootNumberInt; + + public Integer bootNumberInt() { + if (this.bootNumberInt != null) return this.bootNumberInt; + int _tmp = (int) (Long.parseLong(bootNumber(), 10)); + this.bootNumberInt = _tmp; + return this.bootNumberInt; + } + + private Double inputVoltageVolt; + + public Double inputVoltageVolt() { + if (this.inputVoltageVolt != null) return this.inputVoltageVolt; + double _tmp = (double) ((Long.parseLong(inputVoltage(), 10) / 1000.0)); + this.inputVoltageVolt = _tmp; + return this.inputVoltageVolt; + } + + private Double solarPanelVoltageVolt; + + public Double solarPanelVoltageVolt() { + if (this.solarPanelVoltageVolt != null) return this.solarPanelVoltageVolt; + double _tmp = (double) ((Long.parseLong(solarPanelVoltage(), 10) / 1000.0)); + this.solarPanelVoltageVolt = _tmp; + return this.solarPanelVoltageVolt; + } + + private String bootNumber; + private String inputVoltage; + private String inputCurrent; + private String inputPower; + private String peakPower; + private String solarPanelVoltage; + private FrameTlmAmicalsat _root; + private FrameTlmAmicalsat.EmerType _parent; + + public String bootNumber() { + return bootNumber; + } + + public String inputVoltage() { + return inputVoltage; + } + + public String inputCurrent() { + return inputCurrent; + } + + public String inputPower() { + return inputPower; + } + + public String peakPower() { + return peakPower; + } + + public String solarPanelVoltage() { + return solarPanelVoltage; + } + + public FrameTlmAmicalsat _root() { + return _root; + } + + public FrameTlmAmicalsat.EmerType _parent() { + return _parent; + } + } + + public static class A1FlagType extends KaitaiStruct { + public static A1FlagType fromFile(String fileName) throws IOException { + return new A1FlagType(new ByteBufferKaitaiStream(fileName)); + } + + public A1FlagType(KaitaiStream _io) { + this(_io, null, null); + } + + public A1FlagType(KaitaiStream _io, FrameTlmAmicalsat.A1Type _parent) { + this(_io, _parent, null); + } + + public A1FlagType(KaitaiStream _io, FrameTlmAmicalsat.A1Type _parent, FrameTlmAmicalsat _root) { + super(_io); + this._parent = _parent; + this._root = _root; + _read(); + } + + private void _read() { + this.timeStamps = + new String(this._io.readBytesTerm(59, false, true, true), Charset.forName("ASCII")); + this.mode = + new String(this._io.readBytesTerm(59, false, true, true), Charset.forName("ASCII")); + this.a1Flags = + new String(this._io.readBytesTerm(59, false, true, true), Charset.forName("ASCII")); + this.faults = new String(this._io.readBytesFull(), Charset.forName("ASCII")); + } + + private Integer modeValue; + + public Integer modeValue() { + if (this.modeValue != null) return this.modeValue; + int _tmp = (int) (Long.parseLong(mode(), 10)); + this.modeValue = _tmp; + return this.modeValue; + } + + private Integer faultsValue; + + public Integer faultsValue() { + if (this.faultsValue != null) return this.faultsValue; + int _tmp = (int) (Long.parseLong(faults(), 10)); + this.faultsValue = _tmp; + return this.faultsValue; + } + + private Integer timeStampsSec; + + public Integer timeStampsSec() { + if (this.timeStampsSec != null) return this.timeStampsSec; + int _tmp = (int) (Long.parseLong(timeStamps(), 10)); + this.timeStampsSec = _tmp; + return this.timeStampsSec; + } + + private String timeStamps; + private String mode; + private String a1Flags; + private String faults; + private FrameTlmAmicalsat _root; + private FrameTlmAmicalsat.A1Type _parent; + + public String timeStamps() { + return timeStamps; + } + + public String mode() { + return mode; + } + + public String a1Flags() { + return a1Flags; + } + + public String faults() { + return faults; + } + + public FrameTlmAmicalsat _root() { + return _root; + } + + public FrameTlmAmicalsat.A1Type _parent() { + return _parent; + } + } + + public static class SrcCallsignRaw extends KaitaiStruct { + public static SrcCallsignRaw fromFile(String fileName) throws IOException { + return new SrcCallsignRaw(new ByteBufferKaitaiStream(fileName)); + } + + public SrcCallsignRaw(KaitaiStream _io) { + this(_io, null, null); + } + + public SrcCallsignRaw(KaitaiStream _io, FrameTlmAmicalsat.Ax25Header _parent) { + this(_io, _parent, null); + } + + public SrcCallsignRaw( + KaitaiStream _io, FrameTlmAmicalsat.Ax25Header _parent, FrameTlmAmicalsat _root) { + super(_io); + this._parent = _parent; + this._root = _root; + _read(); + } + + private void _read() { + this._raw__raw_srcCallsignRor = this._io.readBytes(6); + this._raw_srcCallsignRor = + KaitaiStream.processRotateLeft(this._raw__raw_srcCallsignRor, 8 - (1), 1); + KaitaiStream _io__raw_srcCallsignRor = new ByteBufferKaitaiStream(_raw_srcCallsignRor); + this.srcCallsignRor = new SrcCallsign(_io__raw_srcCallsignRor, this, _root); + } + + private SrcCallsign srcCallsignRor; + private FrameTlmAmicalsat _root; + private FrameTlmAmicalsat.Ax25Header _parent; + private byte[] _raw__raw_srcCallsignRor; + private byte[] _raw_srcCallsignRor; + + public SrcCallsign srcCallsignRor() { + return srcCallsignRor; + } + + public FrameTlmAmicalsat _root() { + return _root; + } + + public FrameTlmAmicalsat.Ax25Header _parent() { + return _parent; + } + + public byte[] _raw__raw_srcCallsignRor() { + return _raw__raw_srcCallsignRor; + } + + public byte[] _raw_srcCallsignRor() { + return _raw_srcCallsignRor; + } + } + + public static class FlagsType extends KaitaiStruct { + public static FlagsType fromFile(String fileName) throws IOException { + return new FlagsType(new ByteBufferKaitaiStream(fileName)); + } + + public FlagsType(KaitaiStream _io) { + this(_io, null, null); + } + + public FlagsType(KaitaiStream _io, FrameTlmAmicalsat.M1Type _parent) { + this(_io, _parent, null); + } + + public FlagsType(KaitaiStream _io, FrameTlmAmicalsat.M1Type _parent, FrameTlmAmicalsat _root) { + super(_io); + this._parent = _parent; + this._root = _root; + _read(); + } + + private void _read() { + this.hexFlags = + new String(this._io.readBytesTerm(59, false, true, true), Charset.forName("ASCII")); + } + + private Integer timeStampsSec; + + public Integer timeStampsSec() { + if (this.timeStampsSec != null) return this.timeStampsSec; + int _tmp = (int) (Long.parseLong(_parent().timeStamps(), 10)); + this.timeStampsSec = _tmp; + return this.timeStampsSec; + } + + private String hexFlags; + private FrameTlmAmicalsat _root; + private FrameTlmAmicalsat.M1Type _parent; + + public String hexFlags() { + return hexFlags; + } + + public FrameTlmAmicalsat _root() { + return _root; + } + + public FrameTlmAmicalsat.M1Type _parent() { + return _parent; + } + } + + public static class IFrame extends KaitaiStruct { + public static IFrame fromFile(String fileName) throws IOException { + return new IFrame(new ByteBufferKaitaiStream(fileName)); + } + + public IFrame(KaitaiStream _io) { + this(_io, null, null); + } + + public IFrame(KaitaiStream _io, FrameTlmAmicalsat.Ax25Frame _parent) { + this(_io, _parent, null); + } + + public IFrame(KaitaiStream _io, FrameTlmAmicalsat.Ax25Frame _parent, FrameTlmAmicalsat _root) { + super(_io); + this._parent = _parent; + this._root = _root; + _read(); + } + + private void _read() { + this.pid = this._io.readU1(); + this.field = + new String(this._io.readBytesTerm(61, false, true, true), Charset.forName("ASCII")); + this.tlmArea = + new String(this._io.readBytesTerm(59, false, true, true), Charset.forName("ASCII")); + this.tlmType = + new String(this._io.readBytesTerm(59, false, true, true), Charset.forName("ASCII")); + switch (tlmArea()) { + case "EM": + { + this.tlmAreaSwitch = new EmerType(this._io, this, _root); + break; + } + case "M1": + { + this.tlmAreaSwitch = new M1Type(this._io, this, _root); + break; + } + case "V1": + { + this.tlmAreaSwitch = new V1Type(this._io, this, _root); + break; + } + case "U2": + { + this.tlmAreaSwitch = new U2Type(this._io, this, _root); + break; + } + case "A1": + { + this.tlmAreaSwitch = new A1Type(this._io, this, _root); + break; + } + case "CU_L": + { + this.tlmAreaSwitch = new CuType(this._io, this, _root); + break; + } + case "CU_R": + { + this.tlmAreaSwitch = new CuType(this._io, this, _root); + break; + } + case "ER": + { + this.tlmAreaSwitch = new EmerType(this._io, this, _root); + break; + } + } + } + + private int pid; + private String field; + private String tlmArea; + private String tlmType; + private KaitaiStruct tlmAreaSwitch; + private FrameTlmAmicalsat _root; + private FrameTlmAmicalsat.Ax25Frame _parent; + + public int pid() { + return pid; + } + + public String field() { + return field; + } + + public String tlmArea() { + return tlmArea; + } + + public String tlmType() { + return tlmType; + } + + public KaitaiStruct tlmAreaSwitch() { + return tlmAreaSwitch; + } + + public FrameTlmAmicalsat _root() { + return _root; + } + + public FrameTlmAmicalsat.Ax25Frame _parent() { + return _parent; + } + } + + public static class U2RlType extends KaitaiStruct { + public static U2RlType fromFile(String fileName) throws IOException { + return new U2RlType(new ByteBufferKaitaiStream(fileName)); + } + + public U2RlType(KaitaiStream _io) { + this(_io, null, null); + } + + public U2RlType(KaitaiStream _io, FrameTlmAmicalsat.U2Type _parent) { + this(_io, _parent, null); + } + + public U2RlType(KaitaiStream _io, FrameTlmAmicalsat.U2Type _parent, FrameTlmAmicalsat _root) { + super(_io); + this._parent = _parent; + this._root = _root; + _read(); + } + + private void _read() { + this.timeStamps = + new String(this._io.readBytesTerm(59, false, true, true), Charset.forName("ASCII")); + this.cpuVoltage = + new String(this._io.readBytesTerm(59, false, true, true), Charset.forName("ASCII")); + this.batteryVoltage = + new String(this._io.readBytesTerm(59, false, true, true), Charset.forName("ASCII")); + this.cpuTemperature = + new String(this._io.readBytesTerm(59, false, true, true), Charset.forName("ASCII")); + this.amplifierTemperature = + new String(this._io.readBytesTerm(59, false, true, true), Charset.forName("ASCII")); + this.flagsmagic = this._io.ensureFixedContents(new byte[] {48, 120}); + this.flags = new String(this._io.readBytes(1), Charset.forName("ASCII")); + } + + private Integer cpuTemperatureDegree; + + public Integer cpuTemperatureDegree() { + if (this.cpuTemperatureDegree != null) return this.cpuTemperatureDegree; + int _tmp = (int) (Long.parseLong(cpuTemperature(), 10)); + this.cpuTemperatureDegree = _tmp; + return this.cpuTemperatureDegree; + } + + private Integer timeStampsSec; + + public Integer timeStampsSec() { + if (this.timeStampsSec != null) return this.timeStampsSec; + int _tmp = (int) (Long.parseLong(timeStamps(), 10)); + this.timeStampsSec = _tmp; + return this.timeStampsSec; + } + + private Double cpuVoltageVolt; + + public Double cpuVoltageVolt() { + if (this.cpuVoltageVolt != null) return this.cpuVoltageVolt; + double _tmp = (double) ((Long.parseLong(cpuVoltage(), 10) / 1000.0)); + this.cpuVoltageVolt = _tmp; + return this.cpuVoltageVolt; + } + + private Integer flagsHexa; + + public Integer flagsHexa() { + if (this.flagsHexa != null) return this.flagsHexa; + int _tmp = (int) (Long.parseLong(flags(), 10)); + this.flagsHexa = _tmp; + return this.flagsHexa; + } + + private Integer amplifierTemperatureDegree; + + public Integer amplifierTemperatureDegree() { + if (this.amplifierTemperatureDegree != null) return this.amplifierTemperatureDegree; + int _tmp = (int) (Long.parseLong(amplifierTemperature(), 10)); + this.amplifierTemperatureDegree = _tmp; + return this.amplifierTemperatureDegree; + } + + private Double batteryVoltageVolt; + + public Double batteryVoltageVolt() { + if (this.batteryVoltageVolt != null) return this.batteryVoltageVolt; + double _tmp = (double) ((Long.parseLong(batteryVoltage(), 10) / 1000.0)); + this.batteryVoltageVolt = _tmp; + return this.batteryVoltageVolt; + } + + private String timeStamps; + private String cpuVoltage; + private String batteryVoltage; + private String cpuTemperature; + private String amplifierTemperature; + private byte[] flagsmagic; + private String flags; + private FrameTlmAmicalsat _root; + private FrameTlmAmicalsat.U2Type _parent; + + public String timeStamps() { + return timeStamps; + } + + public String cpuVoltage() { + return cpuVoltage; + } + + public String batteryVoltage() { + return batteryVoltage; + } + + public String cpuTemperature() { + return cpuTemperature; + } + + public String amplifierTemperature() { + return amplifierTemperature; + } + + public byte[] flagsmagic() { + return flagsmagic; + } + + public String flags() { + return flags; + } + + public FrameTlmAmicalsat _root() { + return _root; + } + + public FrameTlmAmicalsat.U2Type _parent() { + return _parent; + } + } + + public static class CuLogType extends KaitaiStruct { + public static CuLogType fromFile(String fileName) throws IOException { + return new CuLogType(new ByteBufferKaitaiStream(fileName)); + } + + public CuLogType(KaitaiStream _io) { + this(_io, null, null); + } + + public CuLogType(KaitaiStream _io, FrameTlmAmicalsat.CuType _parent) { + this(_io, _parent, null); + } + + public CuLogType(KaitaiStream _io, FrameTlmAmicalsat.CuType _parent, FrameTlmAmicalsat _root) { + super(_io); + this._parent = _parent; + this._root = _root; + _read(); + } + + private void _read() { + this.cpuVoltage = + new String(this._io.readBytesTerm(59, false, true, true), Charset.forName("ASCII")); + this.cpuTemperature = + new String(this._io.readBytesTerm(59, false, true, true), Charset.forName("ASCII")); + this.flagsmagic = this._io.ensureFixedContents(new byte[] {48, 120}); + this.flags = new String(this._io.readBytesFull(), Charset.forName("ASCII")); + } + + private Double cpuVoltageVolt; + + public Double cpuVoltageVolt() { + if (this.cpuVoltageVolt != null) return this.cpuVoltageVolt; + double _tmp = (double) ((Long.parseLong(cpuVoltage(), 10) / 1000.0)); + this.cpuVoltageVolt = _tmp; + return this.cpuVoltageVolt; + } + + private Integer cpuTemperatureDegree; + + public Integer cpuTemperatureDegree() { + if (this.cpuTemperatureDegree != null) return this.cpuTemperatureDegree; + int _tmp = (int) (Long.parseLong(cpuTemperature(), 10)); + this.cpuTemperatureDegree = _tmp; + return this.cpuTemperatureDegree; + } + + private Integer timeStampsSec; + + public Integer timeStampsSec() { + if (this.timeStampsSec != null) return this.timeStampsSec; + int _tmp = (int) (Long.parseLong(_parent().timeStamps(), 10)); + this.timeStampsSec = _tmp; + return this.timeStampsSec; + } + + private String cpuVoltage; + private String cpuTemperature; + private byte[] flagsmagic; + private String flags; + private FrameTlmAmicalsat _root; + private FrameTlmAmicalsat.CuType _parent; + + public String cpuVoltage() { + return cpuVoltage; + } + + public String cpuTemperature() { + return cpuTemperature; + } + + public byte[] flagsmagic() { + return flagsmagic; + } + + public String flags() { + return flags; + } + + public FrameTlmAmicalsat _root() { + return _root; + } + + public FrameTlmAmicalsat.CuType _parent() { + return _parent; + } + } + + public static class V1RlType extends KaitaiStruct { + public static V1RlType fromFile(String fileName) throws IOException { + return new V1RlType(new ByteBufferKaitaiStream(fileName)); + } + + public V1RlType(KaitaiStream _io) { + this(_io, null, null); + } + + public V1RlType(KaitaiStream _io, FrameTlmAmicalsat.V1Type _parent) { + this(_io, _parent, null); + } + + public V1RlType(KaitaiStream _io, FrameTlmAmicalsat.V1Type _parent, FrameTlmAmicalsat _root) { + super(_io); + this._parent = _parent; + this._root = _root; + _read(); + } + + private void _read() { + this.timeStamps = + new String(this._io.readBytesTerm(44, false, true, true), Charset.forName("ASCII")); + this.cpuVoltage = + new String(this._io.readBytesTerm(59, false, true, true), Charset.forName("ASCII")); + this.batteryVoltage = + new String(this._io.readBytesTerm(59, false, true, true), Charset.forName("ASCII")); + this.cpuTemperature = + new String(this._io.readBytesTerm(59, false, true, true), Charset.forName("ASCII")); + this.amplifierTemperature = + new String(this._io.readBytesTerm(59, false, true, true), Charset.forName("ASCII")); + this.flagsmagic = this._io.ensureFixedContents(new byte[] {48, 120}); + this.flags = new String(this._io.readBytes(1), Charset.forName("ASCII")); + } + + private Integer cpuTemperatureDegree; + + public Integer cpuTemperatureDegree() { + if (this.cpuTemperatureDegree != null) return this.cpuTemperatureDegree; + int _tmp = (int) (Long.parseLong(cpuTemperature(), 10)); + this.cpuTemperatureDegree = _tmp; + return this.cpuTemperatureDegree; + } + + private Integer timeStampsSec; + + public Integer timeStampsSec() { + if (this.timeStampsSec != null) return this.timeStampsSec; + int _tmp = (int) (Long.parseLong(timeStamps(), 10)); + this.timeStampsSec = _tmp; + return this.timeStampsSec; + } + + private Double cpuVoltageVolt; + + public Double cpuVoltageVolt() { + if (this.cpuVoltageVolt != null) return this.cpuVoltageVolt; + double _tmp = (double) ((Long.parseLong(cpuVoltage(), 10) / 1000.0)); + this.cpuVoltageVolt = _tmp; + return this.cpuVoltageVolt; + } + + private Integer flagsHexa; + + public Integer flagsHexa() { + if (this.flagsHexa != null) return this.flagsHexa; + int _tmp = (int) (Long.parseLong(flags(), 10)); + this.flagsHexa = _tmp; + return this.flagsHexa; + } + + private Integer amplifierTemperatureDegree; + + public Integer amplifierTemperatureDegree() { + if (this.amplifierTemperatureDegree != null) return this.amplifierTemperatureDegree; + int _tmp = (int) (Long.parseLong(amplifierTemperature(), 10)); + this.amplifierTemperatureDegree = _tmp; + return this.amplifierTemperatureDegree; + } + + private Double batteryVoltageVolt; + + public Double batteryVoltageVolt() { + if (this.batteryVoltageVolt != null) return this.batteryVoltageVolt; + double _tmp = (double) ((Long.parseLong(batteryVoltage(), 10) / 1000.0)); + this.batteryVoltageVolt = _tmp; + return this.batteryVoltageVolt; + } + + private String timeStamps; + private String cpuVoltage; + private String batteryVoltage; + private String cpuTemperature; + private String amplifierTemperature; + private byte[] flagsmagic; + private String flags; + private FrameTlmAmicalsat _root; + private FrameTlmAmicalsat.V1Type _parent; + + public String timeStamps() { + return timeStamps; + } + + public String cpuVoltage() { + return cpuVoltage; + } + + public String batteryVoltage() { + return batteryVoltage; + } + + public String cpuTemperature() { + return cpuTemperature; + } + + public String amplifierTemperature() { + return amplifierTemperature; + } + + public byte[] flagsmagic() { + return flagsmagic; + } + + public String flags() { + return flags; + } + + public FrameTlmAmicalsat _root() { + return _root; + } + + public FrameTlmAmicalsat.V1Type _parent() { + return _parent; + } + } + + public static class OnyxType extends KaitaiStruct { + public static OnyxType fromFile(String fileName) throws IOException { + return new OnyxType(new ByteBufferKaitaiStream(fileName)); + } + + public OnyxType(KaitaiStream _io) { + this(_io, null, null); + } + + public OnyxType(KaitaiStream _io, FrameTlmAmicalsat.CuType _parent) { + this(_io, _parent, null); + } + + public OnyxType(KaitaiStream _io, FrameTlmAmicalsat.CuType _parent, FrameTlmAmicalsat _root) { + super(_io); + this._parent = _parent; + this._root = _root; + _read(); + } + + private void _read() { + this.timeStamps = + new String(this._io.readBytesTerm(59, false, true, true), Charset.forName("ASCII")); + this.returnValue = new String(this._io.readBytesFull(), Charset.forName("ASCII")); + } + + private Integer timeStampsSec; + + public Integer timeStampsSec() { + if (this.timeStampsSec != null) return this.timeStampsSec; + int _tmp = (int) (Long.parseLong(timeStamps(), 10)); + this.timeStampsSec = _tmp; + return this.timeStampsSec; + } + + private String timeStamps; + private String returnValue; + private FrameTlmAmicalsat _root; + private FrameTlmAmicalsat.CuType _parent; + + public String timeStamps() { + return timeStamps; + } + + public String returnValue() { + return returnValue; + } + + public FrameTlmAmicalsat _root() { + return _root; + } + + public FrameTlmAmicalsat.CuType _parent() { + return _parent; + } + } + + public static class EmerType extends KaitaiStruct { + public static EmerType fromFile(String fileName) throws IOException { + return new EmerType(new ByteBufferKaitaiStream(fileName)); + } + + public EmerType(KaitaiStream _io) { + this(_io, null, null); + } + + public EmerType(KaitaiStream _io, FrameTlmAmicalsat.IFrame _parent) { + this(_io, _parent, null); + } + + public EmerType(KaitaiStream _io, FrameTlmAmicalsat.IFrame _parent, FrameTlmAmicalsat _root) { + super(_io); + this._parent = _parent; + this._root = _root; + _read(); + } + + private void _read() { + this.timeStamps = + new String(this._io.readBytesTerm(59, false, true, true), Charset.forName("ASCII")); + switch (_parent().tlmType()) { + case "LOG": + { + this.tlmsw = new EmLogType(this._io, this, _root); + break; + } + case "MN": + { + this.tlmsw = new EmmnType(this._io, this, _root); + break; + } + } + } + + private String timeStamps; + private KaitaiStruct tlmsw; + private FrameTlmAmicalsat _root; + private FrameTlmAmicalsat.IFrame _parent; + + public String timeStamps() { + return timeStamps; + } + + public KaitaiStruct tlmsw() { + return tlmsw; + } + + public FrameTlmAmicalsat _root() { + return _root; + } + + public FrameTlmAmicalsat.IFrame _parent() { + return _parent; + } + } + + public static class CuType extends KaitaiStruct { + public static CuType fromFile(String fileName) throws IOException { + return new CuType(new ByteBufferKaitaiStream(fileName)); + } + + public CuType(KaitaiStream _io) { + this(_io, null, null); + } + + public CuType(KaitaiStream _io, FrameTlmAmicalsat.IFrame _parent) { + this(_io, _parent, null); + } + + public CuType(KaitaiStream _io, FrameTlmAmicalsat.IFrame _parent, FrameTlmAmicalsat _root) { + super(_io); + this._parent = _parent; + this._root = _root; + _read(); + } + + private void _read() { + this.timeStamps = + new String(this._io.readBytesTerm(59, false, true, true), Charset.forName("ASCII")); + switch (_parent().tlmType()) { + case "ONYX SENSOR T": + { + this.tlmsw = new OnyxType(this._io, this, _root); + break; + } + case "LOG": + { + this.tlmsw = new CuLogType(this._io, this, _root); + break; + } + } + } + + private String timeStamps; + private KaitaiStruct tlmsw; + private FrameTlmAmicalsat _root; + private FrameTlmAmicalsat.IFrame _parent; + + public String timeStamps() { + return timeStamps; + } + + public KaitaiStruct tlmsw() { + return tlmsw; + } + + public FrameTlmAmicalsat _root() { + return _root; + } + + public FrameTlmAmicalsat.IFrame _parent() { + return _parent; + } + } + + public static class A1GyroType extends KaitaiStruct { + public static A1GyroType fromFile(String fileName) throws IOException { + return new A1GyroType(new ByteBufferKaitaiStream(fileName)); + } + + public A1GyroType(KaitaiStream _io) { + this(_io, null, null); + } + + public A1GyroType(KaitaiStream _io, FrameTlmAmicalsat.A1Type _parent) { + this(_io, _parent, null); + } + + public A1GyroType(KaitaiStream _io, FrameTlmAmicalsat.A1Type _parent, FrameTlmAmicalsat _root) { + super(_io); + this._parent = _parent; + this._root = _root; + _read(); + } + + private void _read() { + this.timeStamps = + new String(this._io.readBytesTerm(59, false, true, true), Charset.forName("ASCII")); + this.giroX = + new String(this._io.readBytesTerm(59, false, true, true), Charset.forName("ASCII")); + this.giroY = + new String(this._io.readBytesTerm(59, false, true, true), Charset.forName("ASCII")); + this.giroZ = + new String(this._io.readBytesTerm(59, false, true, true), Charset.forName("ASCII")); + this.misc = new String(this._io.readBytesFull(), Charset.forName("ASCII")); + } + + private Integer timeStampsSec; + + public Integer timeStampsSec() { + if (this.timeStampsSec != null) return this.timeStampsSec; + int _tmp = (int) (Long.parseLong(timeStamps(), 10)); + this.timeStampsSec = _tmp; + return this.timeStampsSec; + } + + private Integer giroXValue; + + public Integer giroXValue() { + if (this.giroXValue != null) return this.giroXValue; + int _tmp = (int) (Long.parseLong(giroX(), 10)); + this.giroXValue = _tmp; + return this.giroXValue; + } + + private Integer giroYValue; + + public Integer giroYValue() { + if (this.giroYValue != null) return this.giroYValue; + int _tmp = (int) (Long.parseLong(giroY(), 10)); + this.giroYValue = _tmp; + return this.giroYValue; + } + + private Integer giroZValue; + + public Integer giroZValue() { + if (this.giroZValue != null) return this.giroZValue; + int _tmp = (int) (Long.parseLong(giroZ(), 10)); + this.giroZValue = _tmp; + return this.giroZValue; + } + + private String timeStamps; + private String giroX; + private String giroY; + private String giroZ; + private String misc; + private FrameTlmAmicalsat _root; + private FrameTlmAmicalsat.A1Type _parent; + + public String timeStamps() { + return timeStamps; + } + + public String giroX() { + return giroX; + } + + public String giroY() { + return giroY; + } + + public String giroZ() { + return giroZ; + } + + public String misc() { + return misc; + } + + public FrameTlmAmicalsat _root() { + return _root; + } + + public FrameTlmAmicalsat.A1Type _parent() { + return _parent; + } + } + + public static class A1MagType extends KaitaiStruct { + public static A1MagType fromFile(String fileName) throws IOException { + return new A1MagType(new ByteBufferKaitaiStream(fileName)); + } + + public A1MagType(KaitaiStream _io) { + this(_io, null, null); + } + + public A1MagType(KaitaiStream _io, FrameTlmAmicalsat.A1Type _parent) { + this(_io, _parent, null); + } + + public A1MagType(KaitaiStream _io, FrameTlmAmicalsat.A1Type _parent, FrameTlmAmicalsat _root) { + super(_io); + this._parent = _parent; + this._root = _root; + _read(); + } + + private void _read() { + this.timeStamps = + new String(this._io.readBytesTerm(59, false, true, true), Charset.forName("ASCII")); + this.magX = + new String(this._io.readBytesTerm(59, false, true, true), Charset.forName("ASCII")); + this.magY = + new String(this._io.readBytesTerm(59, false, true, true), Charset.forName("ASCII")); + this.magZ = + new String(this._io.readBytesTerm(59, false, true, true), Charset.forName("ASCII")); + this.misc = new String(this._io.readBytesFull(), Charset.forName("ASCII")); + } + + private Integer timeStampsSec; + + public Integer timeStampsSec() { + if (this.timeStampsSec != null) return this.timeStampsSec; + int _tmp = (int) (Long.parseLong(timeStamps(), 10)); + this.timeStampsSec = _tmp; + return this.timeStampsSec; + } + + private Integer magXValue; + + public Integer magXValue() { + if (this.magXValue != null) return this.magXValue; + int _tmp = (int) (Long.parseLong(magX(), 10)); + this.magXValue = _tmp; + return this.magXValue; + } + + private Integer magYValue; + + public Integer magYValue() { + if (this.magYValue != null) return this.magYValue; + int _tmp = (int) (Long.parseLong(magY(), 10)); + this.magYValue = _tmp; + return this.magYValue; + } + + private Integer magZValue; + + public Integer magZValue() { + if (this.magZValue != null) return this.magZValue; + int _tmp = (int) (Long.parseLong(magZ(), 10)); + this.magZValue = _tmp; + return this.magZValue; + } + + private String timeStamps; + private String magX; + private String magY; + private String magZ; + private String misc; + private FrameTlmAmicalsat _root; + private FrameTlmAmicalsat.A1Type _parent; + + public String timeStamps() { + return timeStamps; + } + + public String magX() { + return magX; + } + + public String magY() { + return magY; + } + + public String magZ() { + return magZ; + } + + public String misc() { + return misc; + } + + public FrameTlmAmicalsat _root() { + return _root; + } + + public FrameTlmAmicalsat.A1Type _parent() { + return _parent; + } + } + + public static class A1Type extends KaitaiStruct { + public static A1Type fromFile(String fileName) throws IOException { + return new A1Type(new ByteBufferKaitaiStream(fileName)); + } + + public A1Type(KaitaiStream _io) { + this(_io, null, null); + } + + public A1Type(KaitaiStream _io, FrameTlmAmicalsat.IFrame _parent) { + this(_io, _parent, null); + } + + public A1Type(KaitaiStream _io, FrameTlmAmicalsat.IFrame _parent, FrameTlmAmicalsat _root) { + super(_io); + this._parent = _parent; + this._root = _root; + _read(); + } + + private void _read() { + switch (_parent().tlmType()) { + case "FLAGS": + { + this.tlmSw = new A1FlagType(this._io, this, _root); + break; + } + case "MAG": + { + this.tlmSw = new A1MagType(this._io, this, _root); + break; + } + case "GYRO": + { + this.tlmSw = new A1GyroType(this._io, this, _root); + break; + } + case "POSITION": + { + this.tlmSw = new A1PositionType(this._io, this, _root); + break; + } + } + } + + private KaitaiStruct tlmSw; + private FrameTlmAmicalsat _root; + private FrameTlmAmicalsat.IFrame _parent; + + public KaitaiStruct tlmSw() { + return tlmSw; + } + + public FrameTlmAmicalsat _root() { + return _root; + } + + public FrameTlmAmicalsat.IFrame _parent() { + return _parent; + } + } + + public static class MsType extends KaitaiStruct { + public static MsType fromFile(String fileName) throws IOException { + return new MsType(new ByteBufferKaitaiStream(fileName)); + } + + public MsType(KaitaiStream _io) { + this(_io, null, null); + } + + public MsType(KaitaiStream _io, KaitaiStruct _parent) { + this(_io, _parent, null); + } + + public MsType(KaitaiStream _io, KaitaiStruct _parent, FrameTlmAmicalsat _root) { + super(_io); + this._parent = _parent; + this._root = _root; + _read(); + } + + private void _read() { + this.timeStamps = + new String(this._io.readBytesTerm(59, false, true, true), Charset.forName("ASCII")); + this.currentRssi = + new String(this._io.readBytesTerm(59, false, true, true), Charset.forName("ASCII")); + this.latchRssi = + new String(this._io.readBytesTerm(59, false, true, true), Charset.forName("ASCII")); + this.aFCOffset = new String(this._io.readBytesFull(), Charset.forName("ASCII")); + } + + private Integer currentRssiMa; + + public Integer currentRssiMa() { + if (this.currentRssiMa != null) return this.currentRssiMa; + int _tmp = (int) (Long.parseLong(currentRssi(), 10)); + this.currentRssiMa = _tmp; + return this.currentRssiMa; + } + + private Integer latchRssiValue; + + public Integer latchRssiValue() { + if (this.latchRssiValue != null) return this.latchRssiValue; + int _tmp = (int) (Long.parseLong(latchRssi(), 10)); + this.latchRssiValue = _tmp; + return this.latchRssiValue; + } + + private Integer aFCOffsetValue; + + public Integer aFCOffsetValue() { + if (this.aFCOffsetValue != null) return this.aFCOffsetValue; + int _tmp = (int) (Long.parseLong(aFCOffset(), 10)); + this.aFCOffsetValue = _tmp; + return this.aFCOffsetValue; + } + + private Integer timeStampsSec; + + public Integer timeStampsSec() { + if (this.timeStampsSec != null) return this.timeStampsSec; + int _tmp = (int) (Long.parseLong(timeStamps(), 10)); + this.timeStampsSec = _tmp; + return this.timeStampsSec; + } + + private String timeStamps; + private String currentRssi; + private String latchRssi; + private String aFCOffset; + private FrameTlmAmicalsat _root; + private KaitaiStruct _parent; + + public String timeStamps() { + return timeStamps; + } + + public String currentRssi() { + return currentRssi; + } + + public String latchRssi() { + return latchRssi; + } + + public String aFCOffset() { + return aFCOffset; + } + + public FrameTlmAmicalsat _root() { + return _root; + } + + public KaitaiStruct _parent() { + return _parent; + } + } + + public static class LogType extends KaitaiStruct { + public static LogType fromFile(String fileName) throws IOException { + return new LogType(new ByteBufferKaitaiStream(fileName)); + } + + public LogType(KaitaiStream _io) { + this(_io, null, null); + } + + public LogType(KaitaiStream _io, FrameTlmAmicalsat.M1Type _parent) { + this(_io, _parent, null); + } + + public LogType(KaitaiStream _io, FrameTlmAmicalsat.M1Type _parent, FrameTlmAmicalsat _root) { + super(_io); + this._parent = _parent; + this._root = _root; + _read(); + } + + private void _read() { + this.bootNumber = + new String(this._io.readBytesTerm(59, false, true, true), Charset.forName("ASCII")); + this.upTime = + new String(this._io.readBytesTerm(59, false, true, true), Charset.forName("ASCII")); + this.cpuVoltage = + new String(this._io.readBytesTerm(59, false, true, true), Charset.forName("ASCII")); + this.cpuTemperature = new String(this._io.readBytesFull(), Charset.forName("ASCII")); + } + + private Integer cpuTemperatureDegree; + + public Integer cpuTemperatureDegree() { + if (this.cpuTemperatureDegree != null) return this.cpuTemperatureDegree; + int _tmp = (int) (Long.parseLong(cpuTemperature(), 10)); + this.cpuTemperatureDegree = _tmp; + return this.cpuTemperatureDegree; + } + + private Integer upTimeSec; + + public Integer upTimeSec() { + if (this.upTimeSec != null) return this.upTimeSec; + int _tmp = (int) (Long.parseLong(upTime(), 10)); + this.upTimeSec = _tmp; + return this.upTimeSec; + } + + private Integer timeStampsSec; + + public Integer timeStampsSec() { + if (this.timeStampsSec != null) return this.timeStampsSec; + int _tmp = (int) (Long.parseLong(_parent().timeStamps(), 10)); + this.timeStampsSec = _tmp; + return this.timeStampsSec; + } + + private Integer bootNumberInt; + + public Integer bootNumberInt() { + if (this.bootNumberInt != null) return this.bootNumberInt; + int _tmp = (int) (Long.parseLong(bootNumber(), 10)); + this.bootNumberInt = _tmp; + return this.bootNumberInt; + } + + private Double cpuVoltageVolt; + + public Double cpuVoltageVolt() { + if (this.cpuVoltageVolt != null) return this.cpuVoltageVolt; + double _tmp = (double) ((Long.parseLong(cpuVoltage(), 10) / 1000.0)); + this.cpuVoltageVolt = _tmp; + return this.cpuVoltageVolt; + } + + private String bootNumber; + private String upTime; + private String cpuVoltage; + private String cpuTemperature; + private FrameTlmAmicalsat _root; + private FrameTlmAmicalsat.M1Type _parent; + + public String bootNumber() { + return bootNumber; + } + + public String upTime() { + return upTime; + } + + public String cpuVoltage() { + return cpuVoltage; + } + + public String cpuTemperature() { + return cpuTemperature; + } + + public FrameTlmAmicalsat _root() { + return _root; + } + + public FrameTlmAmicalsat.M1Type _parent() { + return _parent; + } + } + + public static class DestCallsignRaw extends KaitaiStruct { + public static DestCallsignRaw fromFile(String fileName) throws IOException { + return new DestCallsignRaw(new ByteBufferKaitaiStream(fileName)); + } + + public DestCallsignRaw(KaitaiStream _io) { + this(_io, null, null); + } + + public DestCallsignRaw(KaitaiStream _io, FrameTlmAmicalsat.Ax25Header _parent) { + this(_io, _parent, null); + } + + public DestCallsignRaw( + KaitaiStream _io, FrameTlmAmicalsat.Ax25Header _parent, FrameTlmAmicalsat _root) { + super(_io); + this._parent = _parent; + this._root = _root; + _read(); + } + + private void _read() { + this._raw__raw_destCallsignRor = this._io.readBytes(6); + this._raw_destCallsignRor = + KaitaiStream.processRotateLeft(this._raw__raw_destCallsignRor, 8 - (1), 1); + KaitaiStream _io__raw_destCallsignRor = new ByteBufferKaitaiStream(_raw_destCallsignRor); + this.destCallsignRor = new DestCallsign(_io__raw_destCallsignRor, this, _root); + } + + private DestCallsign destCallsignRor; + private FrameTlmAmicalsat _root; + private FrameTlmAmicalsat.Ax25Header _parent; + private byte[] _raw__raw_destCallsignRor; + private byte[] _raw_destCallsignRor; + + public DestCallsign destCallsignRor() { + return destCallsignRor; + } + + public FrameTlmAmicalsat _root() { + return _root; + } + + public FrameTlmAmicalsat.Ax25Header _parent() { + return _parent; + } + + public byte[] _raw__raw_destCallsignRor() { + return _raw__raw_destCallsignRor; + } + + public byte[] _raw_destCallsignRor() { + return _raw_destCallsignRor; + } + } + + public static class V1Type extends KaitaiStruct { + public static V1Type fromFile(String fileName) throws IOException { + return new V1Type(new ByteBufferKaitaiStream(fileName)); + } + + public V1Type(KaitaiStream _io) { + this(_io, null, null); + } + + public V1Type(KaitaiStream _io, FrameTlmAmicalsat.IFrame _parent) { + this(_io, _parent, null); + } + + public V1Type(KaitaiStream _io, FrameTlmAmicalsat.IFrame _parent, FrameTlmAmicalsat _root) { + super(_io); + this._parent = _parent; + this._root = _root; + _read(); + } + + private void _read() { + switch (_parent().tlmType()) { + case "RL": + { + this.tlmsw = new V1RlType(this._io, this, _root); + break; + } + case "MS": + { + this.tlmsw = new MsType(this._io, this, _root); + break; + } + } + } + + private KaitaiStruct tlmsw; + private FrameTlmAmicalsat _root; + private FrameTlmAmicalsat.IFrame _parent; + + public KaitaiStruct tlmsw() { + return tlmsw; + } + + public FrameTlmAmicalsat _root() { + return _root; + } + + public FrameTlmAmicalsat.IFrame _parent() { + return _parent; + } + } + + public static class SrcCallsign extends KaitaiStruct { + public static SrcCallsign fromFile(String fileName) throws IOException { + return new SrcCallsign(new ByteBufferKaitaiStream(fileName)); + } + + public SrcCallsign(KaitaiStream _io) { + this(_io, null, null); + } + + public SrcCallsign(KaitaiStream _io, FrameTlmAmicalsat.SrcCallsignRaw _parent) { + this(_io, _parent, null); + } + + public SrcCallsign( + KaitaiStream _io, FrameTlmAmicalsat.SrcCallsignRaw _parent, FrameTlmAmicalsat _root) { + super(_io); + this._parent = _parent; + this._root = _root; + _read(); + } + + private void _read() { + this.srcCallsign = new String(this._io.readBytes(6), Charset.forName("ASCII")); + } + + private String srcCallsign; + private FrameTlmAmicalsat _root; + private FrameTlmAmicalsat.SrcCallsignRaw _parent; + + public String srcCallsign() { + return srcCallsign; + } + + public FrameTlmAmicalsat _root() { + return _root; + } + + public FrameTlmAmicalsat.SrcCallsignRaw _parent() { + return _parent; + } + } + + public static class U2Type extends KaitaiStruct { + public static U2Type fromFile(String fileName) throws IOException { + return new U2Type(new ByteBufferKaitaiStream(fileName)); + } + + public U2Type(KaitaiStream _io) { + this(_io, null, null); + } + + public U2Type(KaitaiStream _io, FrameTlmAmicalsat.IFrame _parent) { + this(_io, _parent, null); + } + + public U2Type(KaitaiStream _io, FrameTlmAmicalsat.IFrame _parent, FrameTlmAmicalsat _root) { + super(_io); + this._parent = _parent; + this._root = _root; + _read(); + } + + private void _read() { + switch (_parent().tlmType()) { + case "RL": + { + this.tlmsw = new U2RlType(this._io, this, _root); + break; + } + case "MS": + { + this.tlmsw = new MsType(this._io, this, _root); + break; + } + } + } + + private KaitaiStruct tlmsw; + private FrameTlmAmicalsat _root; + private FrameTlmAmicalsat.IFrame _parent; + + public KaitaiStruct tlmsw() { + return tlmsw; + } + + public FrameTlmAmicalsat _root() { + return _root; + } + + public FrameTlmAmicalsat.IFrame _parent() { + return _parent; + } + } + + private Ax25Frame frameTlmEntrySat; + private FrameTlmAmicalsat _root; + private KaitaiStruct _parent; + + /** @see Source */ + public Ax25Frame frameTlmEntrySat() { + return frameTlmEntrySat; + } + + public FrameTlmAmicalsat _root() { + return _root; + } - /** - * @see Source - */ - public Ax25Frame frameTlmEntrySat() { return frameTlmEntrySat; } - public FrameTlmAmicalsat _root() { return _root; } - public KaitaiStruct _parent() { return _parent; } + public KaitaiStruct _parent() { + return _parent; + } } diff --git a/ModuleAmicalsat/src/test/java/org/josast/amicalsat/FrameFactoryTest.java b/ModuleAmicalsat/src/test/java/org/josast/amicalsat/FrameFactoryTest.java index 2a02aa16db0b09c6558e678122b31e6edcf61f6c..f9c0cc324c139e322647ddf7d8d4aab05c45af3d 100644 --- a/ModuleAmicalsat/src/test/java/org/josast/amicalsat/FrameFactoryTest.java +++ b/ModuleAmicalsat/src/test/java/org/josast/amicalsat/FrameFactoryTest.java @@ -1,15 +1,13 @@ -/** - * - */ +/** */ package org.josast.amicalsat; +import io.kaitai.struct.ByteBufferKaitaiStream; import java.io.IOException; import java.nio.file.DirectoryStream; import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.Paths; import java.util.Iterator; - import org.josast.ModuleSoundModem.KissException; import org.josast.ModuleSoundModem.kiss; import org.josast.amicalsat.generated.FrameTlmAmicalsat; @@ -19,94 +17,72 @@ import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; -import io.kaitai.struct.ByteBufferKaitaiStream; - -/** - * @author christophe - * - */ +/** @author christophe */ class FrameFactoryTest { - - int cpt=0; - String generateRepository="src/test/resources/kissfiles"; - byte[] buff = null; - FrameTlmAmicalsat cube=null; - /** - * @throws java.lang.Exception - */ - @BeforeAll - static void setUpBeforeClass() throws Exception { - } + int cpt = 0; + String generateRepository = "src/test/resources/kissfiles"; + byte[] buff = null; + FrameTlmAmicalsat cube = null; - /** - * @throws java.lang.Exception - */ - @AfterAll - static void tearDownAfterClass() throws Exception { - } + /** @throws java.lang.Exception */ + @BeforeAll + static void setUpBeforeClass() throws Exception {} - /** - * @throws java.lang.Exception - */ - @BeforeEach - void setUp() throws Exception { - + /** @throws java.lang.Exception */ + @AfterAll + static void tearDownAfterClass() throws Exception {} + /** @throws java.lang.Exception */ + @BeforeEach + void setUp() throws Exception {} - } + /** @throws java.lang.Exception */ + @AfterEach + void tearDown() throws Exception {} - /** - * @throws java.lang.Exception - */ - @AfterEach - void tearDown() throws Exception { - } + /** + * Test method for {@link org.josast.amicalsat.FrameFactory#creerFrame(java.lang.String, + * java.lang.String)}. + */ + @Test + void testCreerFrame() { - /** - * Test method for {@link org.josast.amicalsat.FrameFactory#creerFrame(java.lang.String, java.lang.String)}. - */ - @Test - void testCreerFrame() { - - FrameFactory ff = new FrameFactory(); + FrameFactory ff = new FrameFactory(); - Path path = Paths.get(generateRepository); + Path path = Paths.get(generateRepository); - DirectoryStream stream; - try { - stream = Files.newDirectoryStream(path); + DirectoryStream stream; + try { + stream = Files.newDirectoryStream(path); - try { - Iterator iterator = stream.iterator(); - while(iterator.hasNext()) { - Path p = iterator.next(); - System.out.println(p); - byte [] kissbuff = Files.readAllBytes(p); - kiss k = new kiss(kissbuff); - buff =k.toRaw(); - cube = new FrameTlmAmicalsat(new ByteBufferKaitaiStream(buff)); - String tlmArea = cube.frameTlmEntrySat().payload().tlmArea(); - String typeFrame = cube.frameTlmEntrySat().payload().tlmType(); - System.out.println(tlmArea +" "+ typeFrame); - Frame fm = ff.creerFrame(tlmArea, typeFrame); - fm.setUp(cube); - - System.out.println(fm.toStringHeader()); - System.out.println(fm.toString()); - - } - } catch (KissException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } finally { - stream.close(); - } - } catch (IOException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - - } + try { + Iterator iterator = stream.iterator(); + while (iterator.hasNext()) { + Path p = iterator.next(); + System.out.println(p); + byte[] kissbuff = Files.readAllBytes(p); + kiss k = new kiss(kissbuff); + buff = k.toRaw(); + cube = new FrameTlmAmicalsat(new ByteBufferKaitaiStream(buff)); + String tlmArea = cube.frameTlmEntrySat().payload().tlmArea(); + String typeFrame = cube.frameTlmEntrySat().payload().tlmType(); + System.out.println(tlmArea + " " + typeFrame); + Frame fm = ff.creerFrame(tlmArea, typeFrame); + fm.setUp(cube); + System.out.println(fm.toStringHeader()); + System.out.println(fm.toString()); + } + } catch (KissException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } finally { + stream.close(); + } + } catch (IOException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } } diff --git a/ModuleConfig/src/main/java/org/josast/config/databinding/AbstractDataBinding.java b/ModuleConfig/src/main/java/org/josast/config/databinding/AbstractDataBinding.java index e48f9fa598ae7c90709c95daffc61a3dfbf32041..32e5a7e0cf446ec56c76a864c85d6e7311fddec2 100644 --- a/ModuleConfig/src/main/java/org/josast/config/databinding/AbstractDataBinding.java +++ b/ModuleConfig/src/main/java/org/josast/config/databinding/AbstractDataBinding.java @@ -9,151 +9,137 @@ import java.io.Reader; import java.io.Serializable; import java.io.Writer; import java.util.logging.Logger; - import org.exolab.castor.xml.MarshalException; import org.exolab.castor.xml.Marshaller; import org.exolab.castor.xml.Unmarshaller; import org.exolab.castor.xml.ValidationException; /** - * - * Description : This class allows to load and sav data on a XML file. The - * castor API is used for the data binding. The default name for the file is the - * name of the class with ".xml" for the extension
+ * Description : This class allows to load and sav data on a XML file. The castor API is used for + * the data binding. The default name for the file is the name of the class with ".xml" for the + * extension
* need a specific library : org.exolab.castor.xml
* JOSAST : Java Open Source Amateur Satellite Toolbox
- * The aim of the project is to create a set of tools for amateur satellite - * purpose. All this tools could be used together to create specific software. - * JOSAST project is managed by AVMDTI + * The aim of the project is to create a set of tools for amateur satellite purpose. All this tools + * could be used together to create specific software. JOSAST project is managed by AVMDTI * (http://www.avmdti.org )
- * This software is an open source software. Please read the JOSAST - * licence
+ * This software is an open source software. Please read the JOSAST licence
* (http://www.avmdti.org ) - *

- * for more information contact - * josast@avmdti.org - *

+ * + *

for more information contact josast@avmdti.org * * @author mercier * @version 1.0 - *

- * Source Update - *

- *
- * Version : date : name : comments
- * V1 : 3 mars 2004 : C. Mercier : create file
- * V2 : 01 mai 2019 : C. Mercier : Change log system - *

+ *

Source Update
+ * Version : date : name : comments
+ * V1 : 3 mars 2004 : C. Mercier : create file
+ * V2 : 01 mai 2019 : C. Mercier : Change log system + *

*/ public abstract class AbstractDataBinding implements Serializable { - /** - * - */ - private static final long serialVersionUID = 8410353753997330889L; - private transient String folder = ".\\"; - - private Logger log = Logger.getLogger("AmsatLogger"); - - /** - * This method read data from the file. The method return an object. - * - * @return object. - */ - public Object load() { - - String fileName = folder + "\\" + this.getClass().getName() + ".xml"; - - Object o = null; - Reader reader = null; - File f = new File(fileName); - if (f.exists()) { - try { - reader = new FileReader(fileName); - } catch (FileNotFoundException e) { - e.printStackTrace(); - } - try { - o = Unmarshaller.unmarshal(this.getClass(), reader); - } catch (MarshalException e) { - e.printStackTrace(); - } catch (ValidationException e1) { - e1.printStackTrace(); - } - try { - reader.close(); - } catch (IOException e) { - e.printStackTrace(); - - } - } else { - log.warning("file not found"); - } - - return o; + /** */ + private static final long serialVersionUID = 8410353753997330889L; + + private transient String folder = ".\\"; + + private Logger log = Logger.getLogger("AmsatLogger"); + + /** + * This method read data from the file. The method return an object. + * + * @return object. + */ + public Object load() { + + String fileName = folder + "\\" + this.getClass().getName() + ".xml"; + + Object o = null; + Reader reader = null; + File f = new File(fileName); + if (f.exists()) { + try { + reader = new FileReader(fileName); + } catch (FileNotFoundException e) { + e.printStackTrace(); + } + try { + o = Unmarshaller.unmarshal(this.getClass(), reader); + } catch (MarshalException e) { + e.printStackTrace(); + } catch (ValidationException e1) { + e1.printStackTrace(); + } + try { + reader.close(); + } catch (IOException e) { + e.printStackTrace(); + } + } else { + log.warning("file not found"); } - /** - * This method save all parameters of the class in an XML file. - */ - public void save() { - String fileName = folder + "\\" + this.getClass().getName() + ".xml"; - File file = new File(fileName); - Writer writer = null; - try { - writer = new FileWriter(file); - } catch (IOException e) { - e.printStackTrace(); - } - try { - Marshaller.marshal(this, writer); - } catch (MarshalException | ValidationException e) { - - e.printStackTrace(); - } - try { - writer.close(); - } catch (IOException e) { - e.printStackTrace(); - } - log.info("file : " + file.getAbsoluteFile()); - + return o; + } + + /** This method save all parameters of the class in an XML file. */ + public void save() { + String fileName = folder + "\\" + this.getClass().getName() + ".xml"; + File file = new File(fileName); + Writer writer = null; + try { + writer = new FileWriter(file); + } catch (IOException e) { + e.printStackTrace(); } + try { + Marshaller.marshal(this, writer); + } catch (MarshalException | ValidationException e) { - /** - * This method returns true if a configuration file already exist. - * @return true if the configuration file exist. - */ - public boolean isExist() { - String FileName = folder + "\\" + this.getClass().getName() + ".xml"; - File f = new File(FileName); - return f.exists(); + e.printStackTrace(); } - - /** - * return the folder where the configuration file is read or save - * - * @return - */ - public String getFolder() { - return folder; + try { + writer.close(); + } catch (IOException e) { + e.printStackTrace(); } - - /** - * set the folder where the configuration file is read or save. If the - * folder do not exist, the folder is created. - * - * @param folder - * @return true if the folder exist else folder is not accessible - */ - public boolean setFolder(final String folder) { - this.folder = folder; - File f = new File(folder); - boolean value = true; - if (!f.exists()) { - value = f.mkdir(); - } - return value; + log.info("file : " + file.getAbsoluteFile()); + } + + /** + * This method returns true if a configuration file already exist. + * + * @return true if the configuration file exist. + */ + public boolean isExist() { + String FileName = folder + "\\" + this.getClass().getName() + ".xml"; + File f = new File(FileName); + return f.exists(); + } + + /** + * return the folder where the configuration file is read or save + * + * @return + */ + public String getFolder() { + return folder; + } + + /** + * set the folder where the configuration file is read or save. If the folder do not exist, the + * folder is created. + * + * @param folder + * @return true if the folder exist else folder is not accessible + */ + public boolean setFolder(final String folder) { + this.folder = folder; + File f = new File(folder); + boolean value = true; + if (!f.exists()) { + value = f.mkdir(); } - + return value; + } } diff --git a/ModuleConfig/src/main/java/org/josast/config/databinding/ConfigurationdataBindingDemo.java b/ModuleConfig/src/main/java/org/josast/config/databinding/ConfigurationdataBindingDemo.java index 37ea93f68a656c2d88039f332686a2743fc20418..7a17a7d58a02f7892e44fcb38e9ba9df36949b1e 100644 --- a/ModuleConfig/src/main/java/org/josast/config/databinding/ConfigurationdataBindingDemo.java +++ b/ModuleConfig/src/main/java/org/josast/config/databinding/ConfigurationdataBindingDemo.java @@ -1,21 +1,24 @@ /** + * Description : used for demonstration to the config package. see main to understand how to used + * the AbstactDataBinding.
* - * Description : used for demonstration to the config package. - * see main to understand how to used the AbstactDataBinding. - *
- *

Projet : JOSAST
+ *

Projet : JOSAST
*
- * JOSAST : Java Open Source Amateur Satellite Toolbox - *
The aim of the project is to create a set of tools for amateur satellite purpose. All this tools could be used together to create specific software. - * JOSAST project is managed by AVMDTI (http://www.avmdti.org ) - *
This software is an open source software. Please read the JOSAST licence
(http://www.avmdti.org ) - *

for more information contact josast@avmdti.org

- * @author mercier + * JOSAST : Java Open Source Amateur Satellite Toolbox
+ * The aim of the project is to create a set of tools for amateur satellite purpose. All this tools + * could be used together to create specific software. JOSAST project is managed by AVMDTI + * (http://www.avmdti.org )
+ * This software is an open source software. Please read the JOSAST licence
+ * (http://www.avmdti.org ) + * + *

for more information contact josast@avmdti.org + * + * @author mercier * @version 1.0 - *

Source Update

- *
Version : date : name : comments - *
V1 : 3 mars 2004 : C. Mercier : create file - *

+ *

Source Update
+ * Version : date : name : comments
+ * V1 : 3 mars 2004 : C. Mercier : create file + *

*/ package org.josast.config.databinding; @@ -23,154 +26,143 @@ import java.io.File; import java.util.Vector; /** - * * Description : - *

Projet : JOSAST
* + *

Projet : JOSAST
*
- * JOSAST : Java Open Source Amateur Satellite Toolbox - *
The aim of the project is to create a set of tools for amateur satellite purpose. All this tools could be used together to create specific software. - * JOSAST project is managed by AVMDTI (http://www.avmdti.org ) - *
This software is an open source software. Please read the JOSAST licence
(http://www.avmdti.org ) - *

for more information contact josast@avmdti.org

- * @author mercier + * JOSAST : Java Open Source Amateur Satellite Toolbox
+ * The aim of the project is to create a set of tools for amateur satellite purpose. All this tools + * could be used together to create specific software. JOSAST project is managed by AVMDTI + * (http://www.avmdti.org )
+ * This software is an open source software. Please read the JOSAST licence
+ * (http://www.avmdti.org ) + * + *

for more information contact josast@avmdti.org + * + * @author mercier * @version 1.0 - *

Source Update

- *
Version : date : name : comments - *
V1 : 3 mars 2004 : C. Mercier : create file - *
V2 : 01 mai 2019 : C. Mercier : Change log system - *

- + *

Source Update
+ * Version : date : name : comments
+ * V1 : 3 mars 2004 : C. Mercier : create file
+ * V2 : 01 mai 2019 : C. Mercier : Change log system + *

*/ - public class ConfigurationdataBindingDemo extends AbstractDataBinding { - private static final long serialVersionUID = -9045143058463814039L; - private double version = 1.0; - private String name = null; - private Vector V = new Vector(); - private String directory = "C:\\temp"; - - private ConfigurationdataBindingDemo() { - } - -/** - * This method return an instance of the class. - * If the configuration file exist, the function return an object from the configuration file - * else the function return a default object. - * @return an instance of the class. - */ -public static ConfigurationdataBindingDemo getInstance() { - // create a default object - ConfigurationdataBindingDemo t = new ConfigurationdataBindingDemo(); - // test if the file exist - // TODO : A REVOIR - File f = new File(t.getDirectory()); - - if (!f.exists()) { - boolean created = f.mkdir(); - if(!created) System.err.println("Dierctory not created"+ f.getAbsolutePath() ); - } - t.setFolder(t.getDirectory()); - if (t.isExist()) { - // load the object - t = (ConfigurationdataBindingDemo) t.load(); - } - // return the object - return t; - } - - /** - * display Vector data and also name of the class and version.
- * @see java.lang.Object#toString() - */ - public String toString() { - return this.V.toString() + name + version; - } - - /** - * @return field name. - */ - public String getName() { - return name; - } - - /** - * @return field vector - */ - public Vector getV() { - return V; - } - - /** - * @return field version - */ - public double getVersion() { - return version; - } - - /** - * set field name. - * @param string - */ - public void setName(final String string) { - name = string; - } - - /** - * set a vector - * - * @param vector - */ - public void setV(final Vector vector) { - V = vector; - } - - /** - * set version. - * - * @param d - */ - public void setVersion(final double d) { - version = d; - } - - - - public void setDirectory(final String directory) { - this.directory = directory; - } - - - public String getDirectory() { - return directory; - } - - /** - * D�monstration : - * - cr�ation d'un objet - * - modification des param�tres de l'objet - * - sauvegarde - * - lecture - * @param messages non utilis� - */ - public static void main(String[] arg) { - Vector v = new Vector(); - v.add("�lement 1"); - v.add("�l�ment 2"); - v.add("�l�ment 3"); - ConfigurationdataBindingDemo t = getInstance(); - System.out.println("First Load" + t); - t.setName("d�monstration du fichier"); - t.setVersion(1.3); - t.setV(v); - System.out.println("avant sauvegarde" + t); - t.save(); - t = new ConfigurationdataBindingDemo(); - System.out.println("a la cr�ation" + t); - t = (ConfigurationdataBindingDemo) t.load(); - System.out.println("apr�s sauvegarde" + t); - - } - + private static final long serialVersionUID = -9045143058463814039L; + private double version = 1.0; + private String name = null; + private Vector V = new Vector(); + private String directory = "C:\\temp"; + + private ConfigurationdataBindingDemo() {} + + /** + * This method return an instance of the class. If the configuration file exist, the function + * return an object from the configuration file else the function return a default object. + * + * @return an instance of the class. + */ + public static ConfigurationdataBindingDemo getInstance() { + // create a default object + ConfigurationdataBindingDemo t = new ConfigurationdataBindingDemo(); + // test if the file exist + // TODO : A REVOIR + File f = new File(t.getDirectory()); + + if (!f.exists()) { + boolean created = f.mkdir(); + if (!created) System.err.println("Dierctory not created" + f.getAbsolutePath()); + } + t.setFolder(t.getDirectory()); + if (t.isExist()) { + // load the object + t = (ConfigurationdataBindingDemo) t.load(); + } + // return the object + return t; + } + + /** + * display Vector data and also name of the class and version.
+ * + * @see java.lang.Object#toString() + */ + public String toString() { + return this.V.toString() + name + version; + } + + /** @return field name. */ + public String getName() { + return name; + } + + /** @return field vector */ + public Vector getV() { + return V; + } + + /** @return field version */ + public double getVersion() { + return version; + } + + /** + * set field name. + * + * @param string + */ + public void setName(final String string) { + name = string; + } + + /** + * set a vector + * + * @param vector + */ + public void setV(final Vector vector) { + V = vector; + } + + /** + * set version. + * + * @param d + */ + public void setVersion(final double d) { + version = d; + } + + public void setDirectory(final String directory) { + this.directory = directory; + } + + public String getDirectory() { + return directory; + } + + /** + * D�monstration : - cr�ation d'un objet - modification des param�tres de l'objet - sauvegarde - + * lecture + * + * @param messages non utilis� + */ + public static void main(String[] arg) { + Vector v = new Vector(); + v.add("�lement 1"); + v.add("�l�ment 2"); + v.add("�l�ment 3"); + ConfigurationdataBindingDemo t = getInstance(); + System.out.println("First Load" + t); + t.setName("d�monstration du fichier"); + t.setVersion(1.3); + t.setV(v); + System.out.println("avant sauvegarde" + t); + t.save(); + t = new ConfigurationdataBindingDemo(); + System.out.println("a la cr�ation" + t); + t = (ConfigurationdataBindingDemo) t.load(); + System.out.println("apr�s sauvegarde" + t); + } } diff --git a/ModuleConfig/src/main/java/org/josast/property/CONFIG.java b/ModuleConfig/src/main/java/org/josast/property/CONFIG.java index 0cd8b2ba4b697c35fa2ebb5fdfeb75c7e40fa29a..a5f3113294eb5f94683beed12720cc76fea06612 100644 --- a/ModuleConfig/src/main/java/org/josast/property/CONFIG.java +++ b/ModuleConfig/src/main/java/org/josast/property/CONFIG.java @@ -9,160 +9,143 @@ import java.util.Properties; import java.util.logging.Logger; /** + * Description : This class allows to save data in a configuration file.
+ * for the JOSAST project the org.josast.config.databinding is prefered to this package for storing + * data. * - * Description : This class allows to save data in a configuration file. - *
- * for the JOSAST project the org.josast.config.databinding is prefered to this - * package for storing data. - * - *

- * Projet : JOSAST
- * + *

Projet : JOSAST
*
* JOSAST : Java Open Source Amateur Satellite Toolbox
- * The aim of the project is to create a set of tools for amateur satellite - * purpose. All this tools could be used together to create specific software. - * JOSAST project is managed by AVMDTI + * The aim of the project is to create a set of tools for amateur satellite purpose. All this tools + * could be used together to create specific software. JOSAST project is managed by AVMDTI * (http://www.avmdti.org )
- * This software is an open source software. Please read the JOSAST - * licence
+ * This software is an open source software. Please read the JOSAST licence
* (http://www.avmdti.org ) - *

- * for more information contact - * josast@avmdti.org - *

+ * + *

for more information contact josast@avmdti.org * * @author mercier * @version 1.0 - *

- * Source Update - *

- *
- * Version : date : name : comments
- * V1 : 3 mars 2004 : C. Mercier : create file
- * V2 : 01 mai 2019 : C. Mercier : Change log system - *

+ *

Source Update
+ * Version : date : name : comments
+ * V1 : 3 mars 2004 : C. Mercier : create file
+ * V2 : 01 mai 2019 : C. Mercier : Change log system + *

*/ public class CONFIG { - private static Logger log = Logger.getLogger("AmsatLogger"); - private Properties P = null; - private String fileName = "configuration.ini"; - - /** Constructeur priv� */ - private CONFIG() { - } + private static Logger log = Logger.getLogger("AmsatLogger"); + private Properties P = null; + private String fileName = "configuration.ini"; - private String getName() { - String path = System.getProperty("user.dir") + "/config"; - File apath = new File(path); + /** Constructeur priv� */ + private CONFIG() {} - if (!apath.exists()) { - boolean res = apath.mkdir(); - if (!res) { - log.severe("fail to create " + path); + private String getName() { + String path = System.getProperty("user.dir") + "/config"; + File apath = new File(path); - } - } - return path + "/" + fileName; + if (!apath.exists()) { + boolean res = apath.mkdir(); + if (!res) { + log.severe("fail to create " + path); + } } - - /** Holder */ - private static class SingletonHolder { - /** Instance unique non pr�initialis�e */ - private static final CONFIG instance = new CONFIG(); + return path + "/" + fileName; + } + + /** Holder */ + private static class SingletonHolder { + /** Instance unique non pr�initialis�e */ + private static final CONFIG instance = new CONFIG(); + } + + /** Point d'acc�s pour l'instance unique du singleton */ + public static CONFIG getInstance() { + return SingletonHolder.instance; + } + + public String getProperty(final String Item) { + + if (P == null) { + try { + P = new Properties(); + FileInputStream in = new FileInputStream(getName()); + P.load(in); + in.close(); + } catch (Exception e) { + log.severe("erreur ouverture fichier de configuration"); // $NON-NLS-1$ + return null; + } } - - /** Point d'acc�s pour l'instance unique du singleton */ - public static CONFIG getInstance() { - return SingletonHolder.instance; + String S = P.getProperty(Item); + if (S == null) { + return null; + } else { + return S.trim(); // $NON-NLS-1$ } - - public String getProperty(final String Item) { - - if (P == null) { - try { - P = new Properties(); - FileInputStream in = new FileInputStream(getName()); - P.load(in); - in.close(); - } catch (Exception e) { - log.severe("erreur ouverture fichier de configuration"); //$NON-NLS-1$ - return null; - } - } - String S = P.getProperty(Item); - if (S == null) { - return null; - } else { - return S.trim(); // $NON-NLS-1$ - } + } + + /** + * Set a property into the file + * + * @param Item Item to store + * @param Valeur value to store + */ + public void setProperty(final String Item, final String Valeur) { + + if (P == null) { + + P = new Properties(); + try { + + FileInputStream in = new FileInputStream(getName()); + P.load(in); + in.close(); + } catch (Exception e2) { + log.severe("Erreur de ouverture du fichier de configuration"); // $NON-NLS-1$ + e2.printStackTrace(); + } } - /** - * Set a property into the file - * - * - * @param Item Item to store - * @param Valeur value to store - * - */ - public void setProperty(final String Item, final String Valeur) { - - if (P == null) { - - P = new Properties(); - try { - - FileInputStream in = new FileInputStream(getName()); - P.load(in); - in.close(); - } catch (Exception e2) { - log.severe("Erreur de ouverture du fichier de configuration"); //$NON-NLS-1$ - e2.printStackTrace(); - } - } - - P.put(Item, Valeur); // $NON-NLS-1$ - - FileOutputStream out = null; - try { - out = new FileOutputStream(getName()); - } catch (FileNotFoundException e) { - log.severe("erreur cr�ation de fichier"); - e.printStackTrace(); - } - try { - P.store(out, null); - } catch (IOException e1) { - log.severe("erreur sauvegarde"); - e1.printStackTrace(); - } - try { - out.close(); - } catch (IOException e3) { - log.severe("erreur de fermeture"); - e3.printStackTrace(); - } + P.put(Item, Valeur); // $NON-NLS-1$ + FileOutputStream out = null; + try { + out = new FileOutputStream(getName()); + } catch (FileNotFoundException e) { + log.severe("erreur cr�ation de fichier"); + e.printStackTrace(); } - - /** - * Returns the nomFichier. - * - * @return String - */ - public String getFileName() { - return fileName; + try { + P.store(out, null); + } catch (IOException e1) { + log.severe("erreur sauvegarde"); + e1.printStackTrace(); } - - /** - * Sets the nomFichier. - * - * @param nomfichier The nomFichier to set - */ - public void setFileName(final String nomfichier) { - fileName = nomfichier; + try { + out.close(); + } catch (IOException e3) { + log.severe("erreur de fermeture"); + e3.printStackTrace(); } - + } + + /** + * Returns the nomFichier. + * + * @return String + */ + public String getFileName() { + return fileName; + } + + /** + * Sets the nomFichier. + * + * @param nomfichier The nomFichier to set + */ + public void setFileName(final String nomfichier) { + fileName = nomfichier; + } } diff --git a/ModuleConfig/src/main/java/org/josast/property/ConfigObject.java b/ModuleConfig/src/main/java/org/josast/property/ConfigObject.java index 79523070012b57d659a4d58ee017f7f773064085..67e72e2cee4cb4b89e74555a5d13ff34d8e88a3c 100644 --- a/ModuleConfig/src/main/java/org/josast/property/ConfigObject.java +++ b/ModuleConfig/src/main/java/org/josast/property/ConfigObject.java @@ -1,57 +1,41 @@ -/** - * - */ +/** */ package org.josast.property; import java.io.File; import java.util.logging.Logger; -/** - * @author Christophe - * - */ +/** @author Christophe */ public abstract class ConfigObject { - private Logger log = Logger.getLogger("AmsatLogger"); - private String ConfigFilename = null; - private String fullConfigFilename = null; - protected CONFIG configFile = CONFIG.getInstance(); - - public ConfigObject() { - - } - - public String getFulFileName() { - fullConfigFilename = System.getProperty("user.dir") + "/config"; - File apath = new File(fullConfigFilename); - - if (!apath.exists()) { - boolean res = apath.mkdir(); - if (!res) { - log.severe("fail to create " + fullConfigFilename); - } - } - return fullConfigFilename; - } - - - - /** - * @param configFilename Configuration file name - */ - public ConfigObject(final String configFilename) { - super(); - ConfigFilename = configFilename; - configFile.setFileName(configFilename); - } - - - - /** - * @return Configuration Filename - */ - public String getConfigFilename() { - return ConfigFilename; - } - + private Logger log = Logger.getLogger("AmsatLogger"); + private String ConfigFilename = null; + private String fullConfigFilename = null; + protected CONFIG configFile = CONFIG.getInstance(); + + public ConfigObject() {} + + public String getFulFileName() { + fullConfigFilename = System.getProperty("user.dir") + "/config"; + File apath = new File(fullConfigFilename); + + if (!apath.exists()) { + boolean res = apath.mkdir(); + if (!res) { + log.severe("fail to create " + fullConfigFilename); + } + } + return fullConfigFilename; + } + + /** @param configFilename Configuration file name */ + public ConfigObject(final String configFilename) { + super(); + ConfigFilename = configFilename; + configFile.setFileName(configFilename); + } + + /** @return Configuration Filename */ + public String getConfigFilename() { + return ConfigFilename; + } } diff --git a/ModuleConfig/src/main/java/org/josast/propertyHttp/ConfigHttp.java b/ModuleConfig/src/main/java/org/josast/propertyHttp/ConfigHttp.java index 69b3ffcd15b08e24c473561efcb827a1b59ac682..244df29f747385a0a8054a97ac77dc0f1d923e85 100644 --- a/ModuleConfig/src/main/java/org/josast/propertyHttp/ConfigHttp.java +++ b/ModuleConfig/src/main/java/org/josast/propertyHttp/ConfigHttp.java @@ -3,10 +3,8 @@ package org.josast.propertyHttp; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; - import java.util.Properties; import java.util.logging.Logger; - import org.apache.http.HttpResponse; import org.apache.http.client.ClientProtocolException; import org.apache.http.client.HttpClient; @@ -15,90 +13,76 @@ import org.apache.http.impl.client.HttpClientBuilder; /** * @author christophe - * - * This class read a properties file from an URL. - * - * + *

This class read a properties file from an URL. */ public class ConfigHttp { - private static Logger log = Logger.getLogger("AmsatLogger"); - private String url = ""; - private Properties props = new Properties(); - private boolean connected = false; - - /** - * @param url URL of the properties file to read - */ - public ConfigHttp(final String url) { - super(); - this.url = url; - try { - loadProperties(); - } catch (Exception e) { - log.severe(e.getMessage()); - } + private static Logger log = Logger.getLogger("AmsatLogger"); + private String url = ""; + private Properties props = new Properties(); + private boolean connected = false; + + /** @param url URL of the properties file to read */ + public ConfigHttp(final String url) { + super(); + this.url = url; + try { + loadProperties(); + } catch (Exception e) { + log.severe(e.getMessage()); } + } - /** - * Load the properties file and initialise Properties field - */ - private void loadProperties() { + /** Load the properties file and initialise Properties field */ + private void loadProperties() { - final String USER_AGENT = "Mozilla/5.0"; + final String USER_AGENT = "Mozilla/5.0"; - HttpClient client = HttpClientBuilder.create().build(); - HttpGet request = new HttpGet(url); - request.addHeader("User-Agent", USER_AGENT); - HttpResponse response; - try { - response = client.execute(request); + HttpClient client = HttpClientBuilder.create().build(); + HttpGet request = new HttpGet(url); + request.addHeader("User-Agent", USER_AGENT); + HttpResponse response; + try { + response = client.execute(request); - BufferedReader rd = new BufferedReader( - new InputStreamReader(response.getEntity().getContent())); + BufferedReader rd = + new BufferedReader(new InputStreamReader(response.getEntity().getContent())); - props.load(rd); - connected = true; - rd.close(); + props.load(rd); + connected = true; + rd.close(); - } catch (ClientProtocolException e) { - log.severe("Error read URL"); + } catch (ClientProtocolException e) { + log.severe("Error read URL"); - } catch (IOException e) { - log.severe("Error read URL "); - - } + } catch (IOException e) { + log.severe("Error read URL "); } + } - /** - * - * @param Item property name - * @return property value, null if property not found - */ - public String getProperty(final String Item) { + /** + * @param Item property name + * @return property value, null if property not found + */ + public String getProperty(final String Item) { - if (props != null) { - String S = props.getProperty(Item); - if (S == null) { - return null; - } else { - return S.trim(); // $NON-NLS-1$ - } - } + if (props != null) { + String S = props.getProperty(Item); + if (S == null) { return null; - + } else { + return S.trim(); // $NON-NLS-1$ + } } - - /** - * @return true if the Property file has been read - */ - public boolean isConnected() { - return connected; - } - - public static void main(String[] args) { - ConfigHttp c = new ConfigHttp( - "http://site.amsat-f.org/download/117168/"); - System.out.println(c.getProperty("EntrySatVersion")); - } - + return null; + } + + /** @return true if the Property file has been read */ + public boolean isConnected() { + return connected; + } + + public static void main(String[] args) { + ConfigHttp c = new ConfigHttp("http://site.amsat-f.org/download/117168/"); + System.out.println(c.getProperty("EntrySatVersion")); + } } diff --git a/ModuleConfig/src/test/java/org/avmdti/josast/config/databinding/test.java b/ModuleConfig/src/test/java/org/avmdti/josast/config/databinding/test.java index 461083a5fa98ff816b2bd3b28918f28058ea43ae..3283cef5816772935bff271d874c396cdf125a68 100644 --- a/ModuleConfig/src/test/java/org/avmdti/josast/config/databinding/test.java +++ b/ModuleConfig/src/test/java/org/avmdti/josast/config/databinding/test.java @@ -1,74 +1,64 @@ /** - * * Description : * + *

Projet : JOSAST
+ *
+ * JOSAST : Java Open Source Amateur Satellite Toolbox
+ * The aim of the project is to create a set of tools for amateur satellite purpose. All this tools + * could be used together to create specific software. JOSAST project is managed by AVMDTI + * (http://www.avmdti.org )
+ * This software is an open source software. Please read the JOSAST licence
+ * (http://www.avmdti.org ) * - *

Projet : JOSAST
+ *

for more information contact josast@avmdti.org * - *
- * JOSAST : Java Open Source Amateur Satellite Toolbox - *
The aim of the project is to create a set of tools for amateur satellite purpose. All this tools could be used together to create specific software. - * JOSAST project is managed by AVMDTI (http://www.avmdti.org ) - *
This software is an open source software. Please read the JOSAST licence
(http://www.avmdti.org ) - *

for more information contact josast@avmdti.org

- * @author mercier + * @author mercier * @version 1.0 - *

Source Update

- *
Version : date : name : comments - *
V1 : 3 mars 2004 : C. Mercier : create file - *

+ *

Source Update
+ * Version : date : name : comments
+ * V1 : 3 mars 2004 : C. Mercier : create file + *

*/ package org.avmdti.josast.config.databinding; import java.util.Vector; - import org.josast.config.databinding.AbstractDataBinding; - public class test extends AbstractDataBinding { - private static final long serialVersionUID = 1L; - private int toto; - private Vector V = new Vector(); - public test() { - V.add("essai"); - V.add("test"); - } - - /** - * @return - */ - public int getToto() { - return toto; - } + private static final long serialVersionUID = 1L; + private int toto; + private Vector V = new Vector(); - /** - * @param i - */ - public void setToto(final int i) { - toto = i; - } + public test() { + V.add("essai"); + V.add("test"); + } + /** @return */ + public int getToto() { + return toto; + } - /** - * @return - */ - public Vector getV() { - return V; - } + /** @param i */ + public void setToto(final int i) { + toto = i; + } - /** - * @param vector - */ - public void setV(final Vector vector) { - V = vector; - } + /** @return */ + public Vector getV() { + return V; + } - public static void main(String[] strings) { - test t = new test(); - t.setFolder("D:\\temps2"); - t.setToto(4); - t.save(); - } + /** @param vector */ + public void setV(final Vector vector) { + V = vector; + } + public static void main(String[] strings) { + test t = new test(); + t.setFolder("D:\\temps2"); + t.setToto(4); + t.save(); + } } diff --git a/ModuleCubesatSim/src/main/java/org/josast/CubesatSim/TLM/ManageFrame.java b/ModuleCubesatSim/src/main/java/org/josast/CubesatSim/TLM/ManageFrame.java index a4b8ca09244b141b36f3bf45bec691c1401ab290..836c94f558fbba65b7d34881a874adf366a7c18e 100644 --- a/ModuleCubesatSim/src/main/java/org/josast/CubesatSim/TLM/ManageFrame.java +++ b/ModuleCubesatSim/src/main/java/org/josast/CubesatSim/TLM/ManageFrame.java @@ -1,36 +1,30 @@ package org.josast.CubesatSim.TLM; +import io.kaitai.struct.ByteBufferKaitaiStream; import java.util.HashMap; - import org.josast.CubesatSim.kaitai.generated.Cubesatsim; import org.josast.CubesatSim.kaitai.generated.Cubesatsim.CubesatsimAo7; import org.josast.CubesatSim.kaitai.generated.Cubesatsim.CubesatsimData; -import io.kaitai.struct.ByteBufferKaitaiStream; - public class ManageFrame { - private Cubesatsim cube = null; - private HashMap hashHeader = new HashMap(); - - public ManageFrame(byte[] data) { - cube = new Cubesatsim(new ByteBufferKaitaiStream(data)); - } - - public String headerToString() { - hashHeader.put("Source", - cube.ax25Header().srcAddress().srcAddressStr()); - hashHeader.put("Destination", - cube.ax25Header().destAddress().destAddressStr()); - hashHeader.put("Dest SSID", "" + cube.ax25Header().destSsid()); - hashHeader.put("Src SSID", "" + cube.ax25Header().srcSsid()); - return hashHeader.toString(); - } - - public CubesatsimAo7 getCubesatsimAo7() { - CubesatsimData data = cube.frametype().ax25Info(); - return data.payload(); - - } - + private Cubesatsim cube = null; + private HashMap hashHeader = new HashMap(); + + public ManageFrame(byte[] data) { + cube = new Cubesatsim(new ByteBufferKaitaiStream(data)); + } + + public String headerToString() { + hashHeader.put("Source", cube.ax25Header().srcAddress().srcAddressStr()); + hashHeader.put("Destination", cube.ax25Header().destAddress().destAddressStr()); + hashHeader.put("Dest SSID", "" + cube.ax25Header().destSsid()); + hashHeader.put("Src SSID", "" + cube.ax25Header().srcSsid()); + return hashHeader.toString(); + } + + public CubesatsimAo7 getCubesatsimAo7() { + CubesatsimData data = cube.frametype().ax25Info(); + return data.payload(); + } } diff --git a/ModuleCubesatSim/src/main/java/org/josast/CubesatSim/TLM/Telemetry.java b/ModuleCubesatSim/src/main/java/org/josast/CubesatSim/TLM/Telemetry.java index ab806a0529e317c60a3c2d88be38e31631195c24..f762cf8c6713f37afb046b8a32ce5accc90c0347 100644 --- a/ModuleCubesatSim/src/main/java/org/josast/CubesatSim/TLM/Telemetry.java +++ b/ModuleCubesatSim/src/main/java/org/josast/CubesatSim/TLM/Telemetry.java @@ -3,156 +3,129 @@ package org.josast.CubesatSim.TLM; import java.util.Hashtable; import java.util.Iterator; import java.util.Set; - import org.josast.CubesatSim.kaitai.generated.Cubesatsim.CubesatsimAo7; import org.josast.TLM.TlmData; import org.josast.TLM.xEqx; -/** - * @author chris - * - */ +/** @author chris */ public class Telemetry { - public static final String PlusXCurent = "+X Current"; - public static final String PlusYCurent = "+Y Current"; - public static final String PlusZCurent = "+Z Current"; - public static final String MoinsXCurent = "-X Current"; - public static final String MoinsYCurent = "-Y Current"; - public static final String MoinsZCurent = "-Z Current"; - public static final String BatteryCurent = "Battery Current"; - - public static final String BatteryVoltage = "Battery Voltage"; - public static final String Temperature = "Temperature"; - - /** - * dataDescription list with description of each telemetry data. - */ - private Hashtable dataDescription = new Hashtable(); - /** - * dataValue list to store value of 1 frame. - */ - private Hashtable dataValue = new Hashtable(); - - /** - * - */ - public Telemetry() { - init(); - } - - /** - * return string with all decoded value of the frame. - * - * @return String with all decoded data, ";' is used as separator - */ - - public String afficheTLM() { - - StringBuilder stringBuilder = new StringBuilder(); - Set keys = dataDescription.keySet(); - - // Obtaining iterator over set entries - Iterator itr = keys.iterator(); - String strvalue; - // Displaying Key and value pairs - while (itr.hasNext()) { - // Getting Key - strvalue = itr.next(); - - TlmData tlm = dataDescription.get(strvalue); - Double value = dataValue.get(strvalue); - String valueS = String.format(tlm.getFormat(), value); - stringBuilder.append(valueS); - stringBuilder.append(";\t"); - } - - stringBuilder.append("\r\n"); - return stringBuilder.toString(); - } - - /** - * Compute the raw value with formulea. - * @param dataName - * @return value interpreted - */ - public double getValueDec(String dataName) { - - Double value = dataValue.get(dataName); - return value; + public static final String PlusXCurent = "+X Current"; + public static final String PlusYCurent = "+Y Current"; + public static final String PlusZCurent = "+Z Current"; + public static final String MoinsXCurent = "-X Current"; + public static final String MoinsYCurent = "-Y Current"; + public static final String MoinsZCurent = "-Z Current"; + public static final String BatteryCurent = "Battery Current"; + + public static final String BatteryVoltage = "Battery Voltage"; + public static final String Temperature = "Temperature"; + + /** dataDescription list with description of each telemetry data. */ + private Hashtable dataDescription = new Hashtable(); + /** dataValue list to store value of 1 frame. */ + private Hashtable dataValue = new Hashtable(); + + /** */ + public Telemetry() { + init(); + } + + /** + * return string with all decoded value of the frame. + * + * @return String with all decoded data, ";' is used as separator + */ + public String afficheTLM() { + + StringBuilder stringBuilder = new StringBuilder(); + Set keys = dataDescription.keySet(); + + // Obtaining iterator over set entries + Iterator itr = keys.iterator(); + String strvalue; + // Displaying Key and value pairs + while (itr.hasNext()) { + // Getting Key + strvalue = itr.next(); + + TlmData tlm = dataDescription.get(strvalue); + Double value = dataValue.get(strvalue); + String valueS = String.format(tlm.getFormat(), value); + stringBuilder.append(valueS); + stringBuilder.append(";\t"); } - /** - * - */ - private void init() { - dataDescription.put(PlusXCurent, - new TlmData(PlusXCurent, new xEqx(), "", "%.0f")); - dataDescription.put(PlusZCurent, - new TlmData(PlusZCurent, new xEqx(), "", "%.0f")); - dataDescription.put(PlusYCurent, - new TlmData(PlusYCurent, new xEqx(), "", "%.0f")); - dataDescription.put(MoinsXCurent, - new TlmData(MoinsXCurent, new xEqx(), "", "%.0f")); - dataDescription.put(MoinsYCurent, - new TlmData(MoinsYCurent, new xEqx(), "", "%.0f")); - dataDescription.put(MoinsZCurent, - new TlmData(MoinsZCurent, new xEqx(), "", "%.0f")); - dataDescription.put(BatteryCurent, - new TlmData(BatteryCurent, new xEqx(), "", "%.0f")); - dataDescription.put(BatteryVoltage, - new TlmData(BatteryVoltage, new xEqx(), "", "%.0f")); - dataDescription.put(Temperature, - new TlmData(Temperature, new xEqx(), "", "%.0f")); - - } - - /** - * From an Ax25Frame (generated by Kaitai), the function extract data and - * fill hastable with value. - * - * @param CubesatsimData - */ - public void setValue(CubesatsimAo7 CubesatsimData) { - - dataValue.put(PlusXCurent, CubesatsimData.channel1bVal().doubleValue()); - dataValue.put(PlusYCurent, CubesatsimData.channel1dVal().doubleValue()); - dataValue.put(PlusZCurent, CubesatsimData.channel2bVal()); - dataValue.put(MoinsXCurent, - CubesatsimData.channel1cVal().doubleValue()); - dataValue.put(MoinsYCurent, - CubesatsimData.channel2aVal().doubleValue()); - dataValue.put(MoinsZCurent, CubesatsimData.channel2cVal()); - dataValue.put(BatteryCurent, - CubesatsimData.channel2dVal().doubleValue()); - dataValue.put(BatteryVoltage, CubesatsimData.channel3aVal()); - dataValue.put(Temperature, CubesatsimData.channel4aVal()); - } - - /** - * display list of data decoded. - * - * @return name of data decoded separated by "," - */ - public String toStringHeader() { - StringBuilder stringBuilder = new StringBuilder(); - Set keys = dataDescription.keySet(); - - // Obtaining iterator over set entries - Iterator itr = keys.iterator(); - String strvalue; - // Displaying Key and value pairs - while (itr.hasNext()) { - // Getting Key - strvalue = itr.next(); - - stringBuilder.append(strvalue); - stringBuilder.append(";\t"); - } - - stringBuilder.append("\r\n"); - return stringBuilder.toString(); - + stringBuilder.append("\r\n"); + return stringBuilder.toString(); + } + + /** + * Compute the raw value with formulea. + * + * @param dataName + * @return value interpreted + */ + public double getValueDec(String dataName) { + + Double value = dataValue.get(dataName); + return value; + } + + /** */ + private void init() { + dataDescription.put(PlusXCurent, new TlmData(PlusXCurent, new xEqx(), "", "%.0f")); + dataDescription.put(PlusZCurent, new TlmData(PlusZCurent, new xEqx(), "", "%.0f")); + dataDescription.put(PlusYCurent, new TlmData(PlusYCurent, new xEqx(), "", "%.0f")); + dataDescription.put(MoinsXCurent, new TlmData(MoinsXCurent, new xEqx(), "", "%.0f")); + dataDescription.put(MoinsYCurent, new TlmData(MoinsYCurent, new xEqx(), "", "%.0f")); + dataDescription.put(MoinsZCurent, new TlmData(MoinsZCurent, new xEqx(), "", "%.0f")); + dataDescription.put(BatteryCurent, new TlmData(BatteryCurent, new xEqx(), "", "%.0f")); + dataDescription.put(BatteryVoltage, new TlmData(BatteryVoltage, new xEqx(), "", "%.0f")); + dataDescription.put(Temperature, new TlmData(Temperature, new xEqx(), "", "%.0f")); + } + + /** + * From an Ax25Frame (generated by Kaitai), the function extract data and fill hastable with + * value. + * + * @param CubesatsimData + */ + public void setValue(CubesatsimAo7 CubesatsimData) { + + dataValue.put(PlusXCurent, CubesatsimData.channel1bVal().doubleValue()); + dataValue.put(PlusYCurent, CubesatsimData.channel1dVal().doubleValue()); + dataValue.put(PlusZCurent, CubesatsimData.channel2bVal()); + dataValue.put(MoinsXCurent, CubesatsimData.channel1cVal().doubleValue()); + dataValue.put(MoinsYCurent, CubesatsimData.channel2aVal().doubleValue()); + dataValue.put(MoinsZCurent, CubesatsimData.channel2cVal()); + dataValue.put(BatteryCurent, CubesatsimData.channel2dVal().doubleValue()); + dataValue.put(BatteryVoltage, CubesatsimData.channel3aVal()); + dataValue.put(Temperature, CubesatsimData.channel4aVal()); + } + + /** + * display list of data decoded. + * + * @return name of data decoded separated by "," + */ + public String toStringHeader() { + StringBuilder stringBuilder = new StringBuilder(); + Set keys = dataDescription.keySet(); + + // Obtaining iterator over set entries + Iterator itr = keys.iterator(); + String strvalue; + // Displaying Key and value pairs + while (itr.hasNext()) { + // Getting Key + strvalue = itr.next(); + + stringBuilder.append(strvalue); + stringBuilder.append(";\t"); } + stringBuilder.append("\r\n"); + return stringBuilder.toString(); + } } diff --git a/ModuleCubesatSim/src/main/java/org/josast/CubesatSim/influxDB/DataCubesatSim.java b/ModuleCubesatSim/src/main/java/org/josast/CubesatSim/influxDB/DataCubesatSim.java index fa7501f7f3af7e7749f30f5d684901c3a2af9e87..af3de2739e96418061d49fdd9116ac0b8a54a6e9 100644 --- a/ModuleCubesatSim/src/main/java/org/josast/CubesatSim/influxDB/DataCubesatSim.java +++ b/ModuleCubesatSim/src/main/java/org/josast/CubesatSim/influxDB/DataCubesatSim.java @@ -2,234 +2,226 @@ package org.josast.CubesatSim.influxDB; import java.util.concurrent.TimeUnit; import java.util.logging.Logger; - import org.influxdb.dto.BatchPoints; import org.influxdb.dto.Point; public class DataCubesatSim { - private Logger log = Logger.getLogger(getClass().getName()); - - private double BatteryVoltage; - private double TotalCurrent; - private double pXcurrent; - private double mXcurrent; - private double pYcurrent; - private double mYcurrent; - private double pZcurrent; - private double mZcurrent; - private double BaseTemperature; - private double BatteruCurrent; - - public DataCubesatSim() { - // TODO Auto-generated constructor stub - } - - /** - * @return the batteryVoltage - */ - public double getBatteryVoltage() { - return BatteryVoltage; - } - - /** - * @param batteryVoltage the batteryVoltage to set - */ - public void setBatteryVoltage(double batteryVoltage) { - BatteryVoltage = batteryVoltage; - } - - /** - * @return the totalCurrent - */ - public double getTotalCurrent() { - return TotalCurrent; - } - - /** - * @param totalCurrent the totalCurrent to set - */ - public void setTotalCurrent(double totalCurrent) { - TotalCurrent = totalCurrent; - } - - /** - * @return the pXCurent - */ - public double getpXCurent() { - return pXcurrent; - } - - /** - * @param pXcurrent the pXcurrent to set. - */ - public void setpXCurent(final double pXcurrent) { - this.pXcurrent = pXcurrent; - } - - /** - * @return the mXcurrent - */ - public double getmXcurrent() { - return mXcurrent; - } - - /** - * @param mXcurrent the mXcurrent to set - */ - public void setmXcurrent(double mXcurrent) { - this.mXcurrent = mXcurrent; - } - - /** - * @return the pYcurrent - */ - public double getpYcurrent() { - return pYcurrent; - } - - /** - * @param pYcurrent the pYcurrent to set - */ - public void setpYcurrent(double pYcurrent) { - this.pYcurrent = pYcurrent; - } - - /** - * @return the mYcurrent - */ - public double getmYcurrent() { - return mYcurrent; - } - - /** - * @param mYcurrent the mYcurrent to set - */ - public void setmYcurrent(double mYcurrent) { - this.mYcurrent = mYcurrent; - } - - /** - * @return the pZcurrent - */ - public double getpZcurrent() { - return pZcurrent; - } - - /** - * @param pZcurrent the pZcurrent to set - */ - public void setpZcurrent(double pZcurrent) { - this.pZcurrent = pZcurrent; - } - - /** - * @return the mZcurrent - */ - public double getmZcurrent() { - return mZcurrent; - } - - /** - * @param mZcurrent the mZcurrent to set - */ - public void setmZcurrent(double mZcurrent) { - this.mZcurrent = mZcurrent; - } - - /** - * @return the baseTemperature - */ - public double getBaseTemperature() { - return BaseTemperature; - } - - /** - * @param baseTemperature the baseTemperature to set - */ - public void setBaseTemperature(double baseTemperature) { - BaseTemperature = baseTemperature; - } - - /** - * @return the batteruCurrent - */ - public double getBatteruCurrent() { - return BatteruCurrent; - } - - /** - * @param batteruCurrent the batteruCurrent to set - */ - public void setBatteruCurrent(double batteruCurrent) { - BatteruCurrent = batteruCurrent; - } - - public void writetoInfluxDB(InfluxDBInstance dataBase) { - BatchPoints batchPoints = BatchPoints - .database(dataBase.getDatabasename()) - // .retentionPolicy("defaultPolicy") - .build(); - - Point point1 = Point.measurement("BatteryVoltage") - .time(System.currentTimeMillis(), TimeUnit.MILLISECONDS) - .addField("value", BatteryVoltage).build(); - Point point2 = Point.measurement("TotalCurrent") - .time(System.currentTimeMillis(), TimeUnit.MILLISECONDS) - .addField("value", TotalCurrent).build(); - Point point3 = Point.measurement("pXcurrent") - .time(System.currentTimeMillis(), TimeUnit.MILLISECONDS) - .addField("value", pXcurrent).build(); - Point point4 = Point.measurement("mXcurrent") - .time(System.currentTimeMillis(), TimeUnit.MILLISECONDS) - .addField("value", mXcurrent).build(); - Point point5 = Point.measurement("pYcurrent") - .time(System.currentTimeMillis(), TimeUnit.MILLISECONDS) - .addField("value", pYcurrent).build(); - Point point6 = Point.measurement("mYcurrent") - .time(System.currentTimeMillis(), TimeUnit.MILLISECONDS) - .addField("value", mYcurrent).build(); - Point point7 = Point.measurement("pZcurrent") - .time(System.currentTimeMillis(), TimeUnit.MILLISECONDS) - .addField("value", pZcurrent).build(); - Point point8 = Point.measurement("mZcurrent") - .time(System.currentTimeMillis(), TimeUnit.MILLISECONDS) - .addField("value", mZcurrent).build(); - Point point9 = Point.measurement("BaseTemperature") - .time(System.currentTimeMillis(), TimeUnit.MILLISECONDS) - .addField("value", BaseTemperature).build(); - Point point10 = Point.measurement("BatteruCurrent") - .time(System.currentTimeMillis(), TimeUnit.MILLISECONDS) - .addField("value", BatteruCurrent).build(); - - batchPoints.point(point1); - batchPoints.point(point2); - batchPoints.point(point3); - batchPoints.point(point4); - batchPoints.point(point5); - batchPoints.point(point6); - batchPoints.point(point7); - batchPoints.point(point8); - batchPoints.point(point9); - batchPoints.point(point10); - dataBase.write(batchPoints); - log.info("data write :" + this.toString()); - - } - /* - * (non-Javadoc) - * - * @see java.lang.Object#toString() - */ - - @Override - public String toString() { - return "dataCubesatSim [BatteryVoltage=" + BatteryVoltage - + ", TotalCurrent=" + TotalCurrent + ", pXCurent=" + pXcurrent - + ", mXcurrent=" + mXcurrent + ", pYcurrent=" + pYcurrent - + ", mYcurrent=" + mYcurrent + ", pZcurrent=" + pZcurrent - + ", mZcurrent=" + mZcurrent + ", BaseTemperature=" - + BaseTemperature + ", BatteruCurrent=" + BatteruCurrent + "]"; - } - + private Logger log = Logger.getLogger(getClass().getName()); + + private double BatteryVoltage; + private double TotalCurrent; + private double pXcurrent; + private double mXcurrent; + private double pYcurrent; + private double mYcurrent; + private double pZcurrent; + private double mZcurrent; + private double BaseTemperature; + private double BatteruCurrent; + + public DataCubesatSim() { + // TODO Auto-generated constructor stub + } + + /** @return the batteryVoltage */ + public double getBatteryVoltage() { + return BatteryVoltage; + } + + /** @param batteryVoltage the batteryVoltage to set */ + public void setBatteryVoltage(double batteryVoltage) { + BatteryVoltage = batteryVoltage; + } + + /** @return the totalCurrent */ + public double getTotalCurrent() { + return TotalCurrent; + } + + /** @param totalCurrent the totalCurrent to set */ + public void setTotalCurrent(double totalCurrent) { + TotalCurrent = totalCurrent; + } + + /** @return the pXCurent */ + public double getpXCurent() { + return pXcurrent; + } + + /** @param pXcurrent the pXcurrent to set. */ + public void setpXCurent(final double pXcurrent) { + this.pXcurrent = pXcurrent; + } + + /** @return the mXcurrent */ + public double getmXcurrent() { + return mXcurrent; + } + + /** @param mXcurrent the mXcurrent to set */ + public void setmXcurrent(double mXcurrent) { + this.mXcurrent = mXcurrent; + } + + /** @return the pYcurrent */ + public double getpYcurrent() { + return pYcurrent; + } + + /** @param pYcurrent the pYcurrent to set */ + public void setpYcurrent(double pYcurrent) { + this.pYcurrent = pYcurrent; + } + + /** @return the mYcurrent */ + public double getmYcurrent() { + return mYcurrent; + } + + /** @param mYcurrent the mYcurrent to set */ + public void setmYcurrent(double mYcurrent) { + this.mYcurrent = mYcurrent; + } + + /** @return the pZcurrent */ + public double getpZcurrent() { + return pZcurrent; + } + + /** @param pZcurrent the pZcurrent to set */ + public void setpZcurrent(double pZcurrent) { + this.pZcurrent = pZcurrent; + } + + /** @return the mZcurrent */ + public double getmZcurrent() { + return mZcurrent; + } + + /** @param mZcurrent the mZcurrent to set */ + public void setmZcurrent(double mZcurrent) { + this.mZcurrent = mZcurrent; + } + + /** @return the baseTemperature */ + public double getBaseTemperature() { + return BaseTemperature; + } + + /** @param baseTemperature the baseTemperature to set */ + public void setBaseTemperature(double baseTemperature) { + BaseTemperature = baseTemperature; + } + + /** @return the batteruCurrent */ + public double getBatteruCurrent() { + return BatteruCurrent; + } + + /** @param batteruCurrent the batteruCurrent to set */ + public void setBatteruCurrent(double batteruCurrent) { + BatteruCurrent = batteruCurrent; + } + + public void writetoInfluxDB(InfluxDBInstance dataBase) { + BatchPoints batchPoints = + BatchPoints.database(dataBase.getDatabasename()) + // .retentionPolicy("defaultPolicy") + .build(); + + Point point1 = + Point.measurement("BatteryVoltage") + .time(System.currentTimeMillis(), TimeUnit.MILLISECONDS) + .addField("value", BatteryVoltage) + .build(); + Point point2 = + Point.measurement("TotalCurrent") + .time(System.currentTimeMillis(), TimeUnit.MILLISECONDS) + .addField("value", TotalCurrent) + .build(); + Point point3 = + Point.measurement("pXcurrent") + .time(System.currentTimeMillis(), TimeUnit.MILLISECONDS) + .addField("value", pXcurrent) + .build(); + Point point4 = + Point.measurement("mXcurrent") + .time(System.currentTimeMillis(), TimeUnit.MILLISECONDS) + .addField("value", mXcurrent) + .build(); + Point point5 = + Point.measurement("pYcurrent") + .time(System.currentTimeMillis(), TimeUnit.MILLISECONDS) + .addField("value", pYcurrent) + .build(); + Point point6 = + Point.measurement("mYcurrent") + .time(System.currentTimeMillis(), TimeUnit.MILLISECONDS) + .addField("value", mYcurrent) + .build(); + Point point7 = + Point.measurement("pZcurrent") + .time(System.currentTimeMillis(), TimeUnit.MILLISECONDS) + .addField("value", pZcurrent) + .build(); + Point point8 = + Point.measurement("mZcurrent") + .time(System.currentTimeMillis(), TimeUnit.MILLISECONDS) + .addField("value", mZcurrent) + .build(); + Point point9 = + Point.measurement("BaseTemperature") + .time(System.currentTimeMillis(), TimeUnit.MILLISECONDS) + .addField("value", BaseTemperature) + .build(); + Point point10 = + Point.measurement("BatteruCurrent") + .time(System.currentTimeMillis(), TimeUnit.MILLISECONDS) + .addField("value", BatteruCurrent) + .build(); + + batchPoints.point(point1); + batchPoints.point(point2); + batchPoints.point(point3); + batchPoints.point(point4); + batchPoints.point(point5); + batchPoints.point(point6); + batchPoints.point(point7); + batchPoints.point(point8); + batchPoints.point(point9); + batchPoints.point(point10); + dataBase.write(batchPoints); + log.info("data write :" + this.toString()); + } + /* + * (non-Javadoc) + * + * @see java.lang.Object#toString() + */ + + @Override + public String toString() { + return "dataCubesatSim [BatteryVoltage=" + + BatteryVoltage + + ", TotalCurrent=" + + TotalCurrent + + ", pXCurent=" + + pXcurrent + + ", mXcurrent=" + + mXcurrent + + ", pYcurrent=" + + pYcurrent + + ", mYcurrent=" + + mYcurrent + + ", pZcurrent=" + + pZcurrent + + ", mZcurrent=" + + mZcurrent + + ", BaseTemperature=" + + BaseTemperature + + ", BatteruCurrent=" + + BatteruCurrent + + "]"; + } } diff --git a/ModuleCubesatSim/src/main/java/org/josast/CubesatSim/influxDB/InfluxDBInstance.java b/ModuleCubesatSim/src/main/java/org/josast/CubesatSim/influxDB/InfluxDBInstance.java index 4fa4d4066759231c5cff36029832fa3b932133c0..f5cdb2deb79f9797bbb565ce65dd4e53477a1863 100644 --- a/ModuleCubesatSim/src/main/java/org/josast/CubesatSim/influxDB/InfluxDBInstance.java +++ b/ModuleCubesatSim/src/main/java/org/josast/CubesatSim/influxDB/InfluxDBInstance.java @@ -1,97 +1,86 @@ package org.josast.CubesatSim.influxDB; import java.util.logging.Logger; - import org.influxdb.InfluxDB; import org.influxdb.InfluxDBFactory; import org.influxdb.InfluxDBIOException; import org.influxdb.dto.BatchPoints; import org.influxdb.dto.Pong; -/** Manage InflusDB Instance. - * - * @author christophe +/** + * Manage InflusDB Instance. * + * @author christophe */ public final class InfluxDBInstance { - /** log */ - private Logger log = Logger.getLogger(getClass().getName()); + /** log */ + private Logger log = Logger.getLogger(getClass().getName()); - static InfluxDBInstance influxDB = null; - private InfluxDB influxdatabase = null; - private String databasename; + static InfluxDBInstance influxDB = null; + private InfluxDB influxdatabase = null; + private String databasename; - /** - * @return the databasename - */ - public String getDatabasename() { - return databasename; - } + /** @return the databasename */ + public String getDatabasename() { + return databasename; + } - /** - * @param databasename the databasename to set - */ - public void setDatabasename(String databasename) { - this.databasename = databasename; - } - - private InfluxDBInstance() { + /** @param databasename the databasename to set */ + public void setDatabasename(String databasename) { + this.databasename = databasename; + } - } + private InfluxDBInstance() {} - /** Holder. */ - private static class SingletonHolder { - /** Instance unique non pr�initialis�e.*/ - private final static InfluxDBInstance instance = new InfluxDBInstance(); - } + /** Holder. */ + private static class SingletonHolder { + /** Instance unique non pr�initialis�e. */ + private static final InfluxDBInstance instance = new InfluxDBInstance(); + } - @SuppressWarnings("deprecation") - public void createDataBase(String database) { + @SuppressWarnings("deprecation") + public void createDataBase(String database) { - if (!influxdatabase.databaseExists(database)) { - log.info("new database created"); - influxdatabase.createDatabase(database); - } - log.info("database already exist"); - databasename = database; + if (!influxdatabase.databaseExists(database)) { + log.info("new database created"); + influxdatabase.createDatabase(database); } + log.info("database already exist"); + databasename = database; + } - public void conect(String databaseURL, String userName, String password) { - - try { + public void conect(String databaseURL, String userName, String password) { - influxdatabase = InfluxDBFactory.connect(databaseURL, userName, - password); - Pong response = influxdatabase.ping(); - if (response.getVersion().equalsIgnoreCase("unknown")) { - log.severe("Error pinging server database : " + databaseURL); + try { - } else { - log.info(response.getVersion()); - } - } catch (InfluxDBIOException e) { - log.severe("InfluxDB database not reach"); - - } + influxdatabase = InfluxDBFactory.connect(databaseURL, userName, password); + Pong response = influxdatabase.ping(); + if (response.getVersion().equalsIgnoreCase("unknown")) { + log.severe("Error pinging server database : " + databaseURL); + } else { + log.info(response.getVersion()); + } + } catch (InfluxDBIOException e) { + log.severe("InfluxDB database not reach"); } - - /** - * Point d'acc�s pour l'instance unique du singleton. - * - * @return instance - */ - public static InfluxDBInstance getInstance() { - return SingletonHolder.instance; + } + + /** + * Point d'acc�s pour l'instance unique du singleton. + * + * @return instance + */ + public static InfluxDBInstance getInstance() { + return SingletonHolder.instance; + } + + public void write(BatchPoints batchPoints) { + if (influxdatabase != null) { + influxdatabase.write(batchPoints); + } else { + log.severe("Database connection not initialised"); } - - public void write(BatchPoints batchPoints) { - if (influxdatabase != null) { - influxdatabase.write(batchPoints); - } else { - log.severe("Database connection not initialised"); - } - } - + } } diff --git a/ModuleCubesatSim/src/main/java/org/josast/CubesatSim/influxDB/InfluxDatabaseConfig.java b/ModuleCubesatSim/src/main/java/org/josast/CubesatSim/influxDB/InfluxDatabaseConfig.java index c70940628a8418d5b01e8e53621f49c1761cb76d..512e96c2001ff49c6a3233e409146d1e1902bf42 100644 --- a/ModuleCubesatSim/src/main/java/org/josast/CubesatSim/influxDB/InfluxDatabaseConfig.java +++ b/ModuleCubesatSim/src/main/java/org/josast/CubesatSim/influxDB/InfluxDatabaseConfig.java @@ -1,80 +1,66 @@ package org.josast.CubesatSim.influxDB; import java.util.logging.Logger; - import org.josast.property.ConfigObject; public class InfluxDatabaseConfig extends ConfigObject { - private Logger log = Logger.getLogger(getClass().getName()); + private Logger log = Logger.getLogger(getClass().getName()); - private String adresse = "replace by your URL"; - private String login = "replace by your login"; - private String password = "replace by your Password"; + private String adresse = "replace by your URL"; + private String login = "replace by your login"; + private String password = "replace by your Password"; - /** - * @param configFilename - */ - public InfluxDatabaseConfig(final String configFilename) { - super(configFilename); + /** @param configFilename */ + public InfluxDatabaseConfig(final String configFilename) { + super(configFilename); - String temp = configFile.getProperty("adresse"); - if (temp == null) { - // config file not initialised - configFile.setProperty("adresse", adresse); - configFile.setProperty("login", login); - configFile.setProperty("password", password); - log.severe( - "propoerties file not initialised - a file is created with properties with comments"); - System.out.println( - "config file does not content required properties \n the file " - + configFilename - + " has been set up with properties to configure"); - System.exit(-1); - } else { - adresse = temp; - login = configFile.getProperty("login"); - password = configFile.getProperty("password"); - } + String temp = configFile.getProperty("adresse"); + if (temp == null) { + // config file not initialised + configFile.setProperty("adresse", adresse); + configFile.setProperty("login", login); + configFile.setProperty("password", password); + log.severe( + "propoerties file not initialised - a file is created with properties with comments"); + System.out.println( + "config file does not content required properties \n the file " + + configFilename + + " has been set up with properties to configure"); + System.exit(-1); + } else { + adresse = temp; + login = configFile.getProperty("login"); + password = configFile.getProperty("password"); } + } - /** - * @return adresse - */ - public String getAdresse() { - return adresse; - } + /** @return adresse */ + public String getAdresse() { + return adresse; + } - public void setAdresse(String adresse) { - this.adresse = adresse; - } + public void setAdresse(String adresse) { + this.adresse = adresse; + } - /** - * @return login - */ - public String getLogin() { - return login; - } + /** @return login */ + public String getLogin() { + return login; + } - /** - * @param login - */ - public void setLogin(String login) { - this.login = login; - } - - /** - * @return password - */ - public String getPassword() { - return password; - } + /** @param login */ + public void setLogin(String login) { + this.login = login; + } - /** - * @param password - */ - public void setPassword(String password) { - this.password = password; - }; + /** @return password */ + public String getPassword() { + return password; + } + /** @param password */ + public void setPassword(String password) { + this.password = password; + }; } diff --git a/ModuleCubesatSim/src/main/java/org/josast/CubesatSim/kaitai/generated/Cubesatsim.java b/ModuleCubesatSim/src/main/java/org/josast/CubesatSim/kaitai/generated/Cubesatsim.java index 99afc8b90b5fa20d7bd7ffb32f2294e4c25b9222..1b6d092e775515c1165a4a76aac0a3d1be4bc000 100644 --- a/ModuleCubesatSim/src/main/java/org/josast/CubesatSim/kaitai/generated/Cubesatsim.java +++ b/ModuleCubesatSim/src/main/java/org/josast/CubesatSim/kaitai/generated/Cubesatsim.java @@ -1,1309 +1,1329 @@ package org.josast.CubesatSim.kaitai.generated; -//This is a generated file! Please edit source .ksy file and use kaitai-struct-compiler to rebuild +// This is a generated file! Please edit source .ksy file and use kaitai-struct-compiler to rebuild -//This is a generated file! Please edit source .ksy file and use kaitai-struct-compiler to rebuild +// This is a generated file! Please edit source .ksy file and use kaitai-struct-compiler to rebuild import io.kaitai.struct.ByteBufferKaitaiStream; -import io.kaitai.struct.KaitaiStruct; import io.kaitai.struct.KaitaiStream; +import io.kaitai.struct.KaitaiStruct; import java.io.IOException; import java.nio.charset.Charset; import java.util.ArrayList; public class Cubesatsim extends KaitaiStruct { - public static Cubesatsim fromFile(String fileName) throws IOException { - return new Cubesatsim(new ByteBufferKaitaiStream(fileName)); - } - - public Cubesatsim(KaitaiStream _io) { - this(_io, null, null); - } - - public Cubesatsim(KaitaiStream _io, KaitaiStruct _parent) { - this(_io, _parent, null); - } - - public Cubesatsim(KaitaiStream _io, KaitaiStruct _parent, Cubesatsim _root) { - super(_io); - this._parent = _parent; - this._root = _root == null ? this : _root; - _read(); - } - - private void _read() { - this._raw_ax25Header = this._io.readBytes(15); - KaitaiStream _io__raw_ax25Header = new ByteBufferKaitaiStream(_raw_ax25Header); - this.ax25Header = new Hdr(_io__raw_ax25Header, this, _root); - switch (ax25Header().ctrl()) { - case 3: { - this.frametype = new UiFrame(this._io, this, _root); - break; - } - } - } - - public static class Hdr extends KaitaiStruct { - public static Hdr fromFile(String fileName) throws IOException { - return new Hdr(new ByteBufferKaitaiStream(fileName)); - } - - public Hdr(KaitaiStream _io) { - this(_io, null, null); - } - - public Hdr(KaitaiStream _io, Cubesatsim _parent) { - this(_io, _parent, null); - } - - public Hdr(KaitaiStream _io, Cubesatsim _parent, Cubesatsim _root) { - super(_io); - this._parent = _parent; - this._root = _root; - _read(); - } - - private void _read() { - this._raw__raw_destAddress = this._io.readBytes(6); - this._raw_destAddress = KaitaiStream.processRotateLeft(this._raw__raw_destAddress, 8 - (1), 1); - KaitaiStream _io__raw_destAddress = new ByteBufferKaitaiStream(_raw_destAddress); - this.destAddress = new DestAddress(_io__raw_destAddress, this, _root); - this.uDestSsid = this._io.readU1(); - this._raw__raw_srcAddress = this._io.readBytes(6); - this._raw_srcAddress = KaitaiStream.processRotateLeft(this._raw__raw_srcAddress, 8 - (1), 1); - KaitaiStream _io__raw_srcAddress = new ByteBufferKaitaiStream(_raw_srcAddress); - this.srcAddress = new SrcAddress(_io__raw_srcAddress, this, _root); - this.uSrcSsid = this._io.readU1(); - this.ctrl = this._io.readU1(); - } - - private Integer srcSsid; - - public Integer srcSsid() { - if (this.srcSsid != null) - return this.srcSsid; - int _tmp = (int) (((uSrcSsid() & 15) >> 1)); - this.srcSsid = _tmp; - return this.srcSsid; - } - - private Integer destSsid; - - public Integer destSsid() { - if (this.destSsid != null) - return this.destSsid; - int _tmp = (int) (((uDestSsid() & 15) >> 1)); - this.destSsid = _tmp; - return this.destSsid; - } - - private DestAddress destAddress; - private int uDestSsid; - private SrcAddress srcAddress; - private int uSrcSsid; - private int ctrl; - private Cubesatsim _root; - private Cubesatsim _parent; - private byte[] _raw__raw_destAddress; - private byte[] _raw_destAddress; - private byte[] _raw__raw_srcAddress; - private byte[] _raw_srcAddress; - - public DestAddress destAddress() { - return destAddress; - } - - public int uDestSsid() { - return uDestSsid; - } - - public SrcAddress srcAddress() { - return srcAddress; - } - - public int uSrcSsid() { - return uSrcSsid; - } - - public int ctrl() { - return ctrl; - } - - public Cubesatsim _root() { - return _root; - } - - public Cubesatsim _parent() { - return _parent; - } - - public byte[] _raw__raw_destAddress() { - return _raw__raw_destAddress; - } - - public byte[] _raw_destAddress() { - return _raw_destAddress; - } - - public byte[] _raw__raw_srcAddress() { - return _raw__raw_srcAddress; - } - - public byte[] _raw_srcAddress() { - return _raw_srcAddress; - } - } - - public static class DestAddress extends KaitaiStruct { - public static DestAddress fromFile(String fileName) throws IOException { - return new DestAddress(new ByteBufferKaitaiStream(fileName)); - } - - public DestAddress(KaitaiStream _io) { - this(_io, null, null); - } - - public DestAddress(KaitaiStream _io, Cubesatsim.Hdr _parent) { - this(_io, _parent, null); - } - - public DestAddress(KaitaiStream _io, Cubesatsim.Hdr _parent, Cubesatsim _root) { - super(_io); - this._parent = _parent; - this._root = _root; - _read(); - } - - private void _read() { - this.destAddressStr = new String(this._io.readBytes(6), Charset.forName("ASCII")); - } - - private String destAddressStr; - private Cubesatsim _root; - private Cubesatsim.Hdr _parent; - - public String destAddressStr() { - return destAddressStr; - } - - public Cubesatsim _root() { - return _root; - } - - public Cubesatsim.Hdr _parent() { - return _parent; - } - } - - public static class UiFrame extends KaitaiStruct { - public static UiFrame fromFile(String fileName) throws IOException { - return new UiFrame(new ByteBufferKaitaiStream(fileName)); - } - - public UiFrame(KaitaiStream _io) { - this(_io, null, null); - } - - public UiFrame(KaitaiStream _io, Cubesatsim _parent) { - this(_io, _parent, null); - } - - public UiFrame(KaitaiStream _io, Cubesatsim _parent, Cubesatsim _root) { - super(_io); - this._parent = _parent; - this._root = _root; - _read(); - } - - private void _read() { - this.pid = this._io.readU1(); - this._raw_ax25Info = this._io.readBytesFull(); - KaitaiStream _io__raw_ax25Info = new ByteBufferKaitaiStream(_raw_ax25Info); - this.ax25Info = new CubesatsimData(_io__raw_ax25Info, this, _root); - } - - private int pid; - private CubesatsimData ax25Info; - private Cubesatsim _root; - private Cubesatsim _parent; - private byte[] _raw_ax25Info; - - public int pid() { - return pid; - } - - public CubesatsimData ax25Info() { - return ax25Info; - } - - public Cubesatsim _root() { - return _root; - } - - public Cubesatsim _parent() { - return _parent; - } - - public byte[] _raw_ax25Info() { - return _raw_ax25Info; - } - } - - public static class CubesatsimData extends KaitaiStruct { - public static CubesatsimData fromFile(String fileName) throws IOException { - return new CubesatsimData(new ByteBufferKaitaiStream(fileName)); - } - - public CubesatsimData(KaitaiStream _io) { - this(_io, null, null); - } - - public CubesatsimData(KaitaiStream _io, Cubesatsim.UiFrame _parent) { - this(_io, _parent, null); - } - - public CubesatsimData(KaitaiStream _io, Cubesatsim.UiFrame _parent, Cubesatsim _root) { - super(_io); - this._parent = _parent; - this._root = _root; - _read(); - } - - private void _read() { - this.dataType = this._io.readU2be(); - switch (dataType()) { - case 26729: { - this.payload = new CubesatsimAo7(this._io, this, _root); - break; - } - default: { - this.payload = new CubesatsimAo7(this._io, this, _root); - break; - } - } - } - - private int dataType; - private CubesatsimAo7 payload; - private Cubesatsim _root; - private Cubesatsim.UiFrame _parent; - - public int dataType() { - return dataType; - } - - public CubesatsimAo7 payload() { - return payload; - } - - public Cubesatsim _root() { - return _root; - } - - public Cubesatsim.UiFrame _parent() { - return _parent; - } - } - - public static class IFrame extends KaitaiStruct { - public static IFrame fromFile(String fileName) throws IOException { - return new IFrame(new ByteBufferKaitaiStream(fileName)); - } - - public IFrame(KaitaiStream _io) { - this(_io, null, null); - } - - public IFrame(KaitaiStream _io, KaitaiStruct _parent) { - this(_io, _parent, null); - } - - public IFrame(KaitaiStream _io, KaitaiStruct _parent, Cubesatsim _root) { - super(_io); - this._parent = _parent; - this._root = _root; - _read(); - } - - private void _read() { - this.pid = this._io.readU1(); - this.ax25Info = this._io.readBytesFull(); - } - - private int pid; - private byte[] ax25Info; - private Cubesatsim _root; - private KaitaiStruct _parent; - - public int pid() { - return pid; - } - - public byte[] ax25Info() { - return ax25Info; - } - - public Cubesatsim _root() { - return _root; - } - - public KaitaiStruct _parent() { - return _parent; - } - } - - public static class CubesatsimAo7 extends KaitaiStruct { - public static CubesatsimAo7 fromFile(String fileName) throws IOException { - return new CubesatsimAo7(new ByteBufferKaitaiStream(fileName)); - } - - public CubesatsimAo7(KaitaiStream _io) { - this(_io, null, null); - } - - public CubesatsimAo7(KaitaiStream _io, Cubesatsim.CubesatsimData _parent) { - this(_io, _parent, null); - } - - public CubesatsimAo7(KaitaiStream _io, Cubesatsim.CubesatsimData _parent, Cubesatsim _root) { - super(_io); - this._parent = _parent; - this._root = _root; - _read(); - } - - private void _read() { - this.ao7Magic = this._io.ensureFixedContents(new byte[] { 32, 104, 105, 32 }); - this.channel1aId = this._io.ensureFixedContents(new byte[] { 49 }); - channel1aValRaw = new ArrayList((int) (2)); - for (int i = 0; i < 2; i++) { - this.channel1aValRaw.add(this._io.readU1()); - } - this.delim1a = this._io.readBytes(1); - this.channel1bId = this._io.ensureFixedContents(new byte[] { 49 }); - channel1bValRaw = new ArrayList((int) (2)); - for (int i = 0; i < 2; i++) { - this.channel1bValRaw.add(this._io.readU1()); - } - this.delim1b = this._io.readBytes(1); - this.channel1cId = this._io.ensureFixedContents(new byte[] { 49 }); - channel1cValRaw = new ArrayList((int) (2)); - for (int i = 0; i < 2; i++) { - this.channel1cValRaw.add(this._io.readU1()); - } - this.delim1c = this._io.readBytes(1); - this.channel1dId = this._io.ensureFixedContents(new byte[] { 49 }); - channel1dValRaw = new ArrayList((int) (2)); - for (int i = 0; i < 2; i++) { - this.channel1dValRaw.add(this._io.readU1()); - } - this.delim1d = this._io.readBytes(1); - this.channel2aId = this._io.ensureFixedContents(new byte[] { 50 }); - channel2aValRaw = new ArrayList((int) (2)); - for (int i = 0; i < 2; i++) { - this.channel2aValRaw.add(this._io.readU1()); - } - this.delim2a = this._io.readBytes(1); - this.channel2bId = this._io.ensureFixedContents(new byte[] { 50 }); - channel2bValRaw = new ArrayList((int) (2)); - for (int i = 0; i < 2; i++) { - this.channel2bValRaw.add(this._io.readU1()); - } - this.delim2b = this._io.readBytes(1); - this.channel2cId = this._io.ensureFixedContents(new byte[] { 50 }); - channel2cValRaw = new ArrayList((int) (2)); - for (int i = 0; i < 2; i++) { - this.channel2cValRaw.add(this._io.readU1()); - } - this.delim2c = this._io.readBytes(1); - this.channel2dId = this._io.ensureFixedContents(new byte[] { 50 }); - channel2dValRaw = new ArrayList((int) (2)); - for (int i = 0; i < 2; i++) { - this.channel2dValRaw.add(this._io.readU1()); - } - this.delim2d = this._io.readBytes(1); - this.channel3aId = this._io.ensureFixedContents(new byte[] { 51 }); - channel3aValRaw = new ArrayList((int) (2)); - for (int i = 0; i < 2; i++) { - this.channel3aValRaw.add(this._io.readU1()); - } - this.delim3a = this._io.readBytes(1); - this.channel3bId = this._io.ensureFixedContents(new byte[] { 51 }); - channel3bValRaw = new ArrayList((int) (2)); - for (int i = 0; i < 2; i++) { - this.channel3bValRaw.add(this._io.readU1()); - } - this.delim3b = this._io.readBytes(1); - this.channel3cId = this._io.ensureFixedContents(new byte[] { 51 }); - channel3cValRaw = new ArrayList((int) (2)); - for (int i = 0; i < 2; i++) { - this.channel3cValRaw.add(this._io.readU1()); - } - this.delim3c = this._io.readBytes(1); - this.channel3dId = this._io.ensureFixedContents(new byte[] { 51 }); - channel3dValRaw = new ArrayList((int) (2)); - for (int i = 0; i < 2; i++) { - this.channel3dValRaw.add(this._io.readU1()); - } - this.delim3d = this._io.readBytes(1); - this.channel4aId = this._io.ensureFixedContents(new byte[] { 52 }); - channel4aValRaw = new ArrayList((int) (2)); - for (int i = 0; i < 2; i++) { - this.channel4aValRaw.add(this._io.readU1()); - } - this.delim4a = this._io.readBytes(1); - this.channel4bId = this._io.ensureFixedContents(new byte[] { 52 }); - channel4bValRaw = new ArrayList((int) (2)); - for (int i = 0; i < 2; i++) { - this.channel4bValRaw.add(this._io.readU1()); - } - this.delim4b = this._io.readBytes(1); - this.channel4cId = this._io.ensureFixedContents(new byte[] { 52 }); - channel4cValRaw = new ArrayList((int) (2)); - for (int i = 0; i < 2; i++) { - this.channel4cValRaw.add(this._io.readU1()); - } - this.delim4c = this._io.readBytes(1); - this.channel4dId = this._io.ensureFixedContents(new byte[] { 52 }); - channel4dValRaw = new ArrayList((int) (2)); - for (int i = 0; i < 2; i++) { - this.channel4dValRaw.add(this._io.readU1()); - } - this.delim4d = this._io.readBytes(1); - this.channel5aId = this._io.ensureFixedContents(new byte[] { 53 }); - channel5aValRaw = new ArrayList((int) (2)); - for (int i = 0; i < 2; i++) { - this.channel5aValRaw.add(this._io.readU1()); - } - this.delim5a = this._io.readBytes(1); - this.channel5bId = this._io.ensureFixedContents(new byte[] { 53 }); - channel5bValRaw = new ArrayList((int) (2)); - for (int i = 0; i < 2; i++) { - this.channel5bValRaw.add(this._io.readU1()); - } - this.delim5b = this._io.readBytes(1); - this.channel5cId = this._io.ensureFixedContents(new byte[] { 53 }); - channel5cValRaw = new ArrayList((int) (2)); - for (int i = 0; i < 2; i++) { - this.channel5cValRaw.add(this._io.readU1()); - } - this.delim5c = this._io.readBytes(1); - this.channel5dId = this._io.ensureFixedContents(new byte[] { 53 }); - channel5dValRaw = new ArrayList((int) (2)); - for (int i = 0; i < 2; i++) { - this.channel5dValRaw.add(this._io.readU1()); - } - this.delim5d = this._io.readBytes(1); - this.channel6aId = this._io.ensureFixedContents(new byte[] { 54 }); - channel6aValRaw = new ArrayList((int) (2)); - for (int i = 0; i < 2; i++) { - this.channel6aValRaw.add(this._io.readU1()); - } - this.delim6a = this._io.readBytes(1); - this.channel6bId = this._io.ensureFixedContents(new byte[] { 54 }); - channel6bValRaw = new ArrayList((int) (2)); - for (int i = 0; i < 2; i++) { - this.channel6bValRaw.add(this._io.readU1()); - } - this.delim6b = this._io.readBytes(1); - this.channel6cId = this._io.ensureFixedContents(new byte[] { 54 }); - channel6cValRaw = new ArrayList((int) (2)); - for (int i = 0; i < 2; i++) { - this.channel6cValRaw.add(this._io.readU1()); - } - this.delim6c = this._io.readBytes(1); - this.channel6dId = this._io.ensureFixedContents(new byte[] { 54 }); - channel6dValRaw = new ArrayList((int) (2)); - for (int i = 0; i < 2; i++) { - this.channel6dValRaw.add(this._io.readU1()); - } - this.delim6d = this._io.readBytes(1); - } - - private Integer channel1dVal; - - /** - * 1970 - (20 * value) [mA] - */ - public Integer channel1dVal() { - if (this.channel1dVal != null) - return this.channel1dVal; - int _tmp = (int) ((((channel1dValRaw().get((int) 0) - 48) * 10) + (channel1dValRaw().get((int) 1) - 48))); - this.channel1dVal = _tmp; - return this.channel1dVal; - } - - private Double channel1aVal; - - /** - * value * 29.5 [mA] - */ - public Double channel1aVal() { - if (this.channel1aVal != null) - return this.channel1aVal; - double _tmp = (double) (((((channel1aValRaw().get((int) 0) - 48) * 10) - + (channel1aValRaw().get((int) 1) - 48)) * 29.5)); - this.channel1aVal = _tmp; - return this.channel1aVal; - } - - private Double channel6aVal; - - /** - * value^2 / 1.56 [mA] - */ - public Double channel6aVal() { - if (this.channel6aVal != null) - return this.channel6aVal; - double _tmp = (double) ((((((channel6aValRaw().get((int) 0) - 48) * 10) - + (channel6aValRaw().get((int) 1) - 48)) - * (((channel6aValRaw().get((int) 0) - 48) * 10) + (channel6aValRaw().get((int) 1) - 48))) / 1.56)); - this.channel6aVal = _tmp; - return this.channel6aVal; - } - - private Integer channel1cVal; - - /** - * 1970 - (20 * value) [mA] - */ - public Integer channel1cVal() { - if (this.channel1cVal != null) - return this.channel1cVal; - int _tmp = (int) ((1970 - - (20 * (((channel1cValRaw().get((int) 0) - 48) * 10) + (channel1cValRaw().get((int) 1) - 48))))); - this.channel1cVal = _tmp; - return this.channel1cVal; - } - - private Double channel4aVal; - - /** - * 95.8 - 1.48 * value [�C] - */ - public Double channel4aVal() { - if (this.channel4aVal != null) - return this.channel4aVal; - double _tmp = (double) ((95.8 - - (1.48 * (((channel4aValRaw().get((int) 0) - 48) * 10) + (channel4aValRaw().get((int) 1) - 48))))); - this.channel4aVal = _tmp; - return this.channel4aVal; - } - - private Double channel5aVal; - - /** - * 95.8 - 1.48 * value [�C] - */ - public Double channel5aVal() { - if (this.channel5aVal != null) - return this.channel5aVal; - double _tmp = (double) ((95.8 - - (1.48 * (((channel5aValRaw().get((int) 0) - 48) * 10) + (channel5aValRaw().get((int) 1) - 48))))); - this.channel5aVal = _tmp; - return this.channel5aVal; - } - - private Double channel2bVal; - - /** - * 8 * (1 - 0.01 * value)^2 [W] - */ - public Double channel2bVal() { - if (this.channel2bVal != null) - return this.channel2bVal; - double _tmp = (double) ((8 * ((1 - - (0.01 * (((channel2bValRaw().get((int) 0) - 48) * 10) + (channel2bValRaw().get((int) 1) - 48)))) - * (1 - (0.01 * (((channel2bValRaw().get((int) 0) - 48) * 10) - + (channel2bValRaw().get((int) 1) - 48))))))); - this.channel2bVal = _tmp; - return this.channel2bVal; - } - - private Double channel6bVal; - - /** - * 0.1 * value^2 + 35 [mA] - */ - public Double channel6bVal() { - if (this.channel6bVal != null) - return this.channel6bVal; - double _tmp = (double) (((0.1 - * ((((channel6bValRaw().get((int) 0) - 48) * 10) + (channel6bValRaw().get((int) 1) - 48)) - * (((channel6bValRaw().get((int) 0) - 48) * 10) + (channel6bValRaw().get((int) 1) - 48)))) - + 35)); - this.channel6bVal = _tmp; - return this.channel6bVal; - } - - private Double channel6cVal; - - /** - * 0.041 * value^2 [mA] - */ - public Double channel6cVal() { - if (this.channel6cVal != null) - return this.channel6cVal; - double _tmp = (double) ((0.041 - * ((((channel6cValRaw().get((int) 0) - 48) * 10) + (channel6cValRaw().get((int) 1) - 48)) - * (((channel6cValRaw().get((int) 0) - 48) * 10) + (channel6cValRaw().get((int) 1) - 48))))); - this.channel6cVal = _tmp; - return this.channel6cVal; - } - - private Double channel3aVal; - - /** - * 0.1 * value + 6.4 [V] - */ - public Double channel3aVal() { - if (this.channel3aVal != null) - return this.channel3aVal; - double _tmp = (double) (((0.1 - * (((channel3aValRaw().get((int) 0) - 48) * 10) + (channel3aValRaw().get((int) 1) - 48))) + 6.4)); - this.channel3aVal = _tmp; - return this.channel3aVal; - } - - private Integer channel2dVal; - - /** - * 40 * (value - 50) [mA] - */ - public Integer channel2dVal() { - if (this.channel2dVal != null) - return this.channel2dVal; - int _tmp = (int) ((40 - * ((((channel2dValRaw().get((int) 0) - 48) * 10) + (channel2dValRaw().get((int) 1) - 48)) - 50))); - this.channel2dVal = _tmp; - return this.channel2dVal; - } - - private Double channel5dVal; - - /** - * 11 + 0.82 * value [mA] - */ - public Double channel5dVal() { - if (this.channel5dVal != null) - return this.channel5dVal; - double _tmp = (double) ((11 - + (0.82 * (((channel5dValRaw().get((int) 0) - 48) * 10) + (channel5dValRaw().get((int) 1) - 48))))); - this.channel5dVal = _tmp; - return this.channel5dVal; - } - - private Double channel2cVal; - - /** - * 15.16 * value [h] - */ - public Double channel2cVal() { - if (this.channel2cVal != null) - return this.channel2cVal; - double _tmp = (double) ((15.16 - * (((channel2cValRaw().get((int) 0) - 48) * 10) + (channel2cValRaw().get((int) 1) - 48)))); - this.channel2cVal = _tmp; - return this.channel2cVal; - } - - private Double channel6dVal; - - /** - * 0.01 * value - */ - public Double channel6dVal() { - if (this.channel6dVal != null) - return this.channel6dVal; - double _tmp = (double) ((0.01 - * (((channel6dValRaw().get((int) 0) - 48) * 10) + (channel6dValRaw().get((int) 1) - 48)))); - this.channel6dVal = _tmp; - return this.channel6dVal; - } - - private Integer channel1bVal; - - /** - * 1970 - (20 * value) [mA] - */ - public Integer channel1bVal() { - if (this.channel1bVal != null) - return this.channel1bVal; - int _tmp = (int) ((1970 - - (20 * (((channel1bValRaw().get((int) 0) - 48) * 10) + (channel1bValRaw().get((int) 1) - 48))))); - this.channel1bVal = _tmp; - return this.channel1bVal; - } - - private Double channel3bVal; - - /** - * 0.1 * value [V] - */ - public Double channel3bVal() { - if (this.channel3bVal != null) - return this.channel3bVal; - double _tmp = (double) ((0.1 - * (((channel3bValRaw().get((int) 0) - 48) * 10) + (channel3bValRaw().get((int) 1) - 48)))); - this.channel3bVal = _tmp; - return this.channel3bVal; - } - - private Double channel4cVal; - - /** - * 95.8 - 1.48 * value [�C] - */ - public Double channel4cVal() { - if (this.channel4cVal != null) - return this.channel4cVal; - double _tmp = (double) ((95.8 - - (1.48 * (((channel4cValRaw().get((int) 0) - 48) * 10) + (channel4cValRaw().get((int) 1) - 48))))); - this.channel4cVal = _tmp; - return this.channel4cVal; - } - - private Double channel5cVal; - - /** - * 95.8 - 1.48 * value [�C] - */ - public Double channel5cVal() { - if (this.channel5cVal != null) - return this.channel5cVal; - double _tmp = (double) ((95.8 - - (1.48 * (((channel5cValRaw().get((int) 0) - 48) * 10) + (channel5cValRaw().get((int) 1) - 48))))); - this.channel5cVal = _tmp; - return this.channel5cVal; - } - - private Double channel4bVal; - - /** - * 95.8 - 1.48 * value [�C] - */ - public Double channel4bVal() { - if (this.channel4bVal != null) - return this.channel4bVal; - double _tmp = (double) ((95.8 - - (1.48 * (((channel4bValRaw().get((int) 0) - 48) * 10) + (channel4bValRaw().get((int) 1) - 48))))); - this.channel4bVal = _tmp; - return this.channel4bVal; - } - - private Double channel3dVal; - - /** - * 95.8 - 1.48 * value [�C] - */ - public Double channel3dVal() { - if (this.channel3dVal != null) - return this.channel3dVal; - double _tmp = (double) ((95.8 - - (1.48 * (((channel3dValRaw().get((int) 0) - 48) * 10) + (channel3dValRaw().get((int) 1) - 48))))); - this.channel3dVal = _tmp; - return this.channel3dVal; - } - - private Integer channel2aVal; - - /** - * 1970 - (20 * value) [mA] - */ - public Integer channel2aVal() { - if (this.channel2aVal != null) - return this.channel2aVal; - int _tmp = (int) ((1970 - - (20 * (((channel2aValRaw().get((int) 0) - 48) * 10) + (channel2aValRaw().get((int) 1) - 48))))); - this.channel2aVal = _tmp; - return this.channel2aVal; - } - - private Double channel4dVal; - - /** - * 95.8 - 1.48 * value [�C] - */ - public Double channel4dVal() { - if (this.channel4dVal != null) - return this.channel4dVal; - double _tmp = (double) ((95.8 - - (1.48 * (((channel4dValRaw().get((int) 0) - 48) * 10) + (channel4dValRaw().get((int) 1) - 48))))); - this.channel4dVal = _tmp; - return this.channel4dVal; - } - - private Double channel3cVal; - - /** - * 0.15 * value [V] - */ - public Double channel3cVal() { - if (this.channel3cVal != null) - return this.channel3cVal; - double _tmp = (double) ((0.15 - * (((channel3cValRaw().get((int) 0) - 48) * 10) + (channel3cValRaw().get((int) 1) - 48)))); - this.channel3cVal = _tmp; - return this.channel3cVal; - } - - private Double channel5bVal; - - /** - * 11.67 * value [mA] - */ - public Double channel5bVal() { - if (this.channel5bVal != null) - return this.channel5bVal; - double _tmp = (double) ((11.67 - * (((channel5bValRaw().get((int) 0) - 48) * 10) + (channel5bValRaw().get((int) 1) - 48)))); - this.channel5bVal = _tmp; - return this.channel5bVal; - } - - private byte[] ao7Magic; - private byte[] channel1aId; - private ArrayList channel1aValRaw; - private byte[] delim1a; - private byte[] channel1bId; - private ArrayList channel1bValRaw; - private byte[] delim1b; - private byte[] channel1cId; - private ArrayList channel1cValRaw; - private byte[] delim1c; - private byte[] channel1dId; - private ArrayList channel1dValRaw; - private byte[] delim1d; - private byte[] channel2aId; - private ArrayList channel2aValRaw; - private byte[] delim2a; - private byte[] channel2bId; - private ArrayList channel2bValRaw; - private byte[] delim2b; - private byte[] channel2cId; - private ArrayList channel2cValRaw; - private byte[] delim2c; - private byte[] channel2dId; - private ArrayList channel2dValRaw; - private byte[] delim2d; - private byte[] channel3aId; - private ArrayList channel3aValRaw; - private byte[] delim3a; - private byte[] channel3bId; - private ArrayList channel3bValRaw; - private byte[] delim3b; - private byte[] channel3cId; - private ArrayList channel3cValRaw; - private byte[] delim3c; - private byte[] channel3dId; - private ArrayList channel3dValRaw; - private byte[] delim3d; - private byte[] channel4aId; - private ArrayList channel4aValRaw; - private byte[] delim4a; - private byte[] channel4bId; - private ArrayList channel4bValRaw; - private byte[] delim4b; - private byte[] channel4cId; - private ArrayList channel4cValRaw; - private byte[] delim4c; - private byte[] channel4dId; - private ArrayList channel4dValRaw; - private byte[] delim4d; - private byte[] channel5aId; - private ArrayList channel5aValRaw; - private byte[] delim5a; - private byte[] channel5bId; - private ArrayList channel5bValRaw; - private byte[] delim5b; - private byte[] channel5cId; - private ArrayList channel5cValRaw; - private byte[] delim5c; - private byte[] channel5dId; - private ArrayList channel5dValRaw; - private byte[] delim5d; - private byte[] channel6aId; - private ArrayList channel6aValRaw; - private byte[] delim6a; - private byte[] channel6bId; - private ArrayList channel6bValRaw; - private byte[] delim6b; - private byte[] channel6cId; - private ArrayList channel6cValRaw; - private byte[] delim6c; - private byte[] channel6dId; - private ArrayList channel6dValRaw; - private byte[] delim6d; - private Cubesatsim _root; - private Cubesatsim.CubesatsimData _parent; - - public byte[] ao7Magic() { - return ao7Magic; - } - - public byte[] channel1aId() { - return channel1aId; - } - - public ArrayList channel1aValRaw() { - return channel1aValRaw; - } - - public byte[] delim1a() { - return delim1a; - } - - public byte[] channel1bId() { - return channel1bId; - } - - public ArrayList channel1bValRaw() { - return channel1bValRaw; - } - - public byte[] delim1b() { - return delim1b; - } - - public byte[] channel1cId() { - return channel1cId; - } - - public ArrayList channel1cValRaw() { - return channel1cValRaw; - } - - public byte[] delim1c() { - return delim1c; - } - - public byte[] channel1dId() { - return channel1dId; - } - - public ArrayList channel1dValRaw() { - return channel1dValRaw; - } - - public byte[] delim1d() { - return delim1d; - } - - public byte[] channel2aId() { - return channel2aId; - } - - public ArrayList channel2aValRaw() { - return channel2aValRaw; - } - - public byte[] delim2a() { - return delim2a; - } - - public byte[] channel2bId() { - return channel2bId; - } - - public ArrayList channel2bValRaw() { - return channel2bValRaw; - } - - public byte[] delim2b() { - return delim2b; - } - - public byte[] channel2cId() { - return channel2cId; - } - - public ArrayList channel2cValRaw() { - return channel2cValRaw; - } - - public byte[] delim2c() { - return delim2c; - } - - public byte[] channel2dId() { - return channel2dId; - } - - public ArrayList channel2dValRaw() { - return channel2dValRaw; - } + public static Cubesatsim fromFile(String fileName) throws IOException { + return new Cubesatsim(new ByteBufferKaitaiStream(fileName)); + } + + public Cubesatsim(KaitaiStream _io) { + this(_io, null, null); + } + + public Cubesatsim(KaitaiStream _io, KaitaiStruct _parent) { + this(_io, _parent, null); + } + + public Cubesatsim(KaitaiStream _io, KaitaiStruct _parent, Cubesatsim _root) { + super(_io); + this._parent = _parent; + this._root = _root == null ? this : _root; + _read(); + } + + private void _read() { + this._raw_ax25Header = this._io.readBytes(15); + KaitaiStream _io__raw_ax25Header = new ByteBufferKaitaiStream(_raw_ax25Header); + this.ax25Header = new Hdr(_io__raw_ax25Header, this, _root); + switch (ax25Header().ctrl()) { + case 3: + { + this.frametype = new UiFrame(this._io, this, _root); + break; + } + } + } + + public static class Hdr extends KaitaiStruct { + public static Hdr fromFile(String fileName) throws IOException { + return new Hdr(new ByteBufferKaitaiStream(fileName)); + } + + public Hdr(KaitaiStream _io) { + this(_io, null, null); + } + + public Hdr(KaitaiStream _io, Cubesatsim _parent) { + this(_io, _parent, null); + } + + public Hdr(KaitaiStream _io, Cubesatsim _parent, Cubesatsim _root) { + super(_io); + this._parent = _parent; + this._root = _root; + _read(); + } + + private void _read() { + this._raw__raw_destAddress = this._io.readBytes(6); + this._raw_destAddress = + KaitaiStream.processRotateLeft(this._raw__raw_destAddress, 8 - (1), 1); + KaitaiStream _io__raw_destAddress = new ByteBufferKaitaiStream(_raw_destAddress); + this.destAddress = new DestAddress(_io__raw_destAddress, this, _root); + this.uDestSsid = this._io.readU1(); + this._raw__raw_srcAddress = this._io.readBytes(6); + this._raw_srcAddress = KaitaiStream.processRotateLeft(this._raw__raw_srcAddress, 8 - (1), 1); + KaitaiStream _io__raw_srcAddress = new ByteBufferKaitaiStream(_raw_srcAddress); + this.srcAddress = new SrcAddress(_io__raw_srcAddress, this, _root); + this.uSrcSsid = this._io.readU1(); + this.ctrl = this._io.readU1(); + } + + private Integer srcSsid; + + public Integer srcSsid() { + if (this.srcSsid != null) return this.srcSsid; + int _tmp = (int) (((uSrcSsid() & 15) >> 1)); + this.srcSsid = _tmp; + return this.srcSsid; + } + + private Integer destSsid; + + public Integer destSsid() { + if (this.destSsid != null) return this.destSsid; + int _tmp = (int) (((uDestSsid() & 15) >> 1)); + this.destSsid = _tmp; + return this.destSsid; + } + + private DestAddress destAddress; + private int uDestSsid; + private SrcAddress srcAddress; + private int uSrcSsid; + private int ctrl; + private Cubesatsim _root; + private Cubesatsim _parent; + private byte[] _raw__raw_destAddress; + private byte[] _raw_destAddress; + private byte[] _raw__raw_srcAddress; + private byte[] _raw_srcAddress; + + public DestAddress destAddress() { + return destAddress; + } + + public int uDestSsid() { + return uDestSsid; + } + + public SrcAddress srcAddress() { + return srcAddress; + } + + public int uSrcSsid() { + return uSrcSsid; + } + + public int ctrl() { + return ctrl; + } + + public Cubesatsim _root() { + return _root; + } + + public Cubesatsim _parent() { + return _parent; + } + + public byte[] _raw__raw_destAddress() { + return _raw__raw_destAddress; + } + + public byte[] _raw_destAddress() { + return _raw_destAddress; + } + + public byte[] _raw__raw_srcAddress() { + return _raw__raw_srcAddress; + } + + public byte[] _raw_srcAddress() { + return _raw_srcAddress; + } + } + + public static class DestAddress extends KaitaiStruct { + public static DestAddress fromFile(String fileName) throws IOException { + return new DestAddress(new ByteBufferKaitaiStream(fileName)); + } + + public DestAddress(KaitaiStream _io) { + this(_io, null, null); + } + + public DestAddress(KaitaiStream _io, Cubesatsim.Hdr _parent) { + this(_io, _parent, null); + } + + public DestAddress(KaitaiStream _io, Cubesatsim.Hdr _parent, Cubesatsim _root) { + super(_io); + this._parent = _parent; + this._root = _root; + _read(); + } + + private void _read() { + this.destAddressStr = new String(this._io.readBytes(6), Charset.forName("ASCII")); + } + + private String destAddressStr; + private Cubesatsim _root; + private Cubesatsim.Hdr _parent; + + public String destAddressStr() { + return destAddressStr; + } + + public Cubesatsim _root() { + return _root; + } + + public Cubesatsim.Hdr _parent() { + return _parent; + } + } + + public static class UiFrame extends KaitaiStruct { + public static UiFrame fromFile(String fileName) throws IOException { + return new UiFrame(new ByteBufferKaitaiStream(fileName)); + } + + public UiFrame(KaitaiStream _io) { + this(_io, null, null); + } + + public UiFrame(KaitaiStream _io, Cubesatsim _parent) { + this(_io, _parent, null); + } + + public UiFrame(KaitaiStream _io, Cubesatsim _parent, Cubesatsim _root) { + super(_io); + this._parent = _parent; + this._root = _root; + _read(); + } + + private void _read() { + this.pid = this._io.readU1(); + this._raw_ax25Info = this._io.readBytesFull(); + KaitaiStream _io__raw_ax25Info = new ByteBufferKaitaiStream(_raw_ax25Info); + this.ax25Info = new CubesatsimData(_io__raw_ax25Info, this, _root); + } + + private int pid; + private CubesatsimData ax25Info; + private Cubesatsim _root; + private Cubesatsim _parent; + private byte[] _raw_ax25Info; + + public int pid() { + return pid; + } + + public CubesatsimData ax25Info() { + return ax25Info; + } + + public Cubesatsim _root() { + return _root; + } + + public Cubesatsim _parent() { + return _parent; + } + + public byte[] _raw_ax25Info() { + return _raw_ax25Info; + } + } + + public static class CubesatsimData extends KaitaiStruct { + public static CubesatsimData fromFile(String fileName) throws IOException { + return new CubesatsimData(new ByteBufferKaitaiStream(fileName)); + } + + public CubesatsimData(KaitaiStream _io) { + this(_io, null, null); + } + + public CubesatsimData(KaitaiStream _io, Cubesatsim.UiFrame _parent) { + this(_io, _parent, null); + } + + public CubesatsimData(KaitaiStream _io, Cubesatsim.UiFrame _parent, Cubesatsim _root) { + super(_io); + this._parent = _parent; + this._root = _root; + _read(); + } + + private void _read() { + this.dataType = this._io.readU2be(); + switch (dataType()) { + case 26729: + { + this.payload = new CubesatsimAo7(this._io, this, _root); + break; + } + default: + { + this.payload = new CubesatsimAo7(this._io, this, _root); + break; + } + } + } + + private int dataType; + private CubesatsimAo7 payload; + private Cubesatsim _root; + private Cubesatsim.UiFrame _parent; + + public int dataType() { + return dataType; + } + + public CubesatsimAo7 payload() { + return payload; + } + + public Cubesatsim _root() { + return _root; + } + + public Cubesatsim.UiFrame _parent() { + return _parent; + } + } + + public static class IFrame extends KaitaiStruct { + public static IFrame fromFile(String fileName) throws IOException { + return new IFrame(new ByteBufferKaitaiStream(fileName)); + } + + public IFrame(KaitaiStream _io) { + this(_io, null, null); + } + + public IFrame(KaitaiStream _io, KaitaiStruct _parent) { + this(_io, _parent, null); + } + + public IFrame(KaitaiStream _io, KaitaiStruct _parent, Cubesatsim _root) { + super(_io); + this._parent = _parent; + this._root = _root; + _read(); + } + + private void _read() { + this.pid = this._io.readU1(); + this.ax25Info = this._io.readBytesFull(); + } + + private int pid; + private byte[] ax25Info; + private Cubesatsim _root; + private KaitaiStruct _parent; + + public int pid() { + return pid; + } + + public byte[] ax25Info() { + return ax25Info; + } + + public Cubesatsim _root() { + return _root; + } + + public KaitaiStruct _parent() { + return _parent; + } + } + + public static class CubesatsimAo7 extends KaitaiStruct { + public static CubesatsimAo7 fromFile(String fileName) throws IOException { + return new CubesatsimAo7(new ByteBufferKaitaiStream(fileName)); + } + + public CubesatsimAo7(KaitaiStream _io) { + this(_io, null, null); + } + + public CubesatsimAo7(KaitaiStream _io, Cubesatsim.CubesatsimData _parent) { + this(_io, _parent, null); + } + + public CubesatsimAo7(KaitaiStream _io, Cubesatsim.CubesatsimData _parent, Cubesatsim _root) { + super(_io); + this._parent = _parent; + this._root = _root; + _read(); + } + + private void _read() { + this.ao7Magic = this._io.ensureFixedContents(new byte[] {32, 104, 105, 32}); + this.channel1aId = this._io.ensureFixedContents(new byte[] {49}); + channel1aValRaw = new ArrayList((int) (2)); + for (int i = 0; i < 2; i++) { + this.channel1aValRaw.add(this._io.readU1()); + } + this.delim1a = this._io.readBytes(1); + this.channel1bId = this._io.ensureFixedContents(new byte[] {49}); + channel1bValRaw = new ArrayList((int) (2)); + for (int i = 0; i < 2; i++) { + this.channel1bValRaw.add(this._io.readU1()); + } + this.delim1b = this._io.readBytes(1); + this.channel1cId = this._io.ensureFixedContents(new byte[] {49}); + channel1cValRaw = new ArrayList((int) (2)); + for (int i = 0; i < 2; i++) { + this.channel1cValRaw.add(this._io.readU1()); + } + this.delim1c = this._io.readBytes(1); + this.channel1dId = this._io.ensureFixedContents(new byte[] {49}); + channel1dValRaw = new ArrayList((int) (2)); + for (int i = 0; i < 2; i++) { + this.channel1dValRaw.add(this._io.readU1()); + } + this.delim1d = this._io.readBytes(1); + this.channel2aId = this._io.ensureFixedContents(new byte[] {50}); + channel2aValRaw = new ArrayList((int) (2)); + for (int i = 0; i < 2; i++) { + this.channel2aValRaw.add(this._io.readU1()); + } + this.delim2a = this._io.readBytes(1); + this.channel2bId = this._io.ensureFixedContents(new byte[] {50}); + channel2bValRaw = new ArrayList((int) (2)); + for (int i = 0; i < 2; i++) { + this.channel2bValRaw.add(this._io.readU1()); + } + this.delim2b = this._io.readBytes(1); + this.channel2cId = this._io.ensureFixedContents(new byte[] {50}); + channel2cValRaw = new ArrayList((int) (2)); + for (int i = 0; i < 2; i++) { + this.channel2cValRaw.add(this._io.readU1()); + } + this.delim2c = this._io.readBytes(1); + this.channel2dId = this._io.ensureFixedContents(new byte[] {50}); + channel2dValRaw = new ArrayList((int) (2)); + for (int i = 0; i < 2; i++) { + this.channel2dValRaw.add(this._io.readU1()); + } + this.delim2d = this._io.readBytes(1); + this.channel3aId = this._io.ensureFixedContents(new byte[] {51}); + channel3aValRaw = new ArrayList((int) (2)); + for (int i = 0; i < 2; i++) { + this.channel3aValRaw.add(this._io.readU1()); + } + this.delim3a = this._io.readBytes(1); + this.channel3bId = this._io.ensureFixedContents(new byte[] {51}); + channel3bValRaw = new ArrayList((int) (2)); + for (int i = 0; i < 2; i++) { + this.channel3bValRaw.add(this._io.readU1()); + } + this.delim3b = this._io.readBytes(1); + this.channel3cId = this._io.ensureFixedContents(new byte[] {51}); + channel3cValRaw = new ArrayList((int) (2)); + for (int i = 0; i < 2; i++) { + this.channel3cValRaw.add(this._io.readU1()); + } + this.delim3c = this._io.readBytes(1); + this.channel3dId = this._io.ensureFixedContents(new byte[] {51}); + channel3dValRaw = new ArrayList((int) (2)); + for (int i = 0; i < 2; i++) { + this.channel3dValRaw.add(this._io.readU1()); + } + this.delim3d = this._io.readBytes(1); + this.channel4aId = this._io.ensureFixedContents(new byte[] {52}); + channel4aValRaw = new ArrayList((int) (2)); + for (int i = 0; i < 2; i++) { + this.channel4aValRaw.add(this._io.readU1()); + } + this.delim4a = this._io.readBytes(1); + this.channel4bId = this._io.ensureFixedContents(new byte[] {52}); + channel4bValRaw = new ArrayList((int) (2)); + for (int i = 0; i < 2; i++) { + this.channel4bValRaw.add(this._io.readU1()); + } + this.delim4b = this._io.readBytes(1); + this.channel4cId = this._io.ensureFixedContents(new byte[] {52}); + channel4cValRaw = new ArrayList((int) (2)); + for (int i = 0; i < 2; i++) { + this.channel4cValRaw.add(this._io.readU1()); + } + this.delim4c = this._io.readBytes(1); + this.channel4dId = this._io.ensureFixedContents(new byte[] {52}); + channel4dValRaw = new ArrayList((int) (2)); + for (int i = 0; i < 2; i++) { + this.channel4dValRaw.add(this._io.readU1()); + } + this.delim4d = this._io.readBytes(1); + this.channel5aId = this._io.ensureFixedContents(new byte[] {53}); + channel5aValRaw = new ArrayList((int) (2)); + for (int i = 0; i < 2; i++) { + this.channel5aValRaw.add(this._io.readU1()); + } + this.delim5a = this._io.readBytes(1); + this.channel5bId = this._io.ensureFixedContents(new byte[] {53}); + channel5bValRaw = new ArrayList((int) (2)); + for (int i = 0; i < 2; i++) { + this.channel5bValRaw.add(this._io.readU1()); + } + this.delim5b = this._io.readBytes(1); + this.channel5cId = this._io.ensureFixedContents(new byte[] {53}); + channel5cValRaw = new ArrayList((int) (2)); + for (int i = 0; i < 2; i++) { + this.channel5cValRaw.add(this._io.readU1()); + } + this.delim5c = this._io.readBytes(1); + this.channel5dId = this._io.ensureFixedContents(new byte[] {53}); + channel5dValRaw = new ArrayList((int) (2)); + for (int i = 0; i < 2; i++) { + this.channel5dValRaw.add(this._io.readU1()); + } + this.delim5d = this._io.readBytes(1); + this.channel6aId = this._io.ensureFixedContents(new byte[] {54}); + channel6aValRaw = new ArrayList((int) (2)); + for (int i = 0; i < 2; i++) { + this.channel6aValRaw.add(this._io.readU1()); + } + this.delim6a = this._io.readBytes(1); + this.channel6bId = this._io.ensureFixedContents(new byte[] {54}); + channel6bValRaw = new ArrayList((int) (2)); + for (int i = 0; i < 2; i++) { + this.channel6bValRaw.add(this._io.readU1()); + } + this.delim6b = this._io.readBytes(1); + this.channel6cId = this._io.ensureFixedContents(new byte[] {54}); + channel6cValRaw = new ArrayList((int) (2)); + for (int i = 0; i < 2; i++) { + this.channel6cValRaw.add(this._io.readU1()); + } + this.delim6c = this._io.readBytes(1); + this.channel6dId = this._io.ensureFixedContents(new byte[] {54}); + channel6dValRaw = new ArrayList((int) (2)); + for (int i = 0; i < 2; i++) { + this.channel6dValRaw.add(this._io.readU1()); + } + this.delim6d = this._io.readBytes(1); + } + + private Integer channel1dVal; + + /** 1970 - (20 * value) [mA] */ + public Integer channel1dVal() { + if (this.channel1dVal != null) return this.channel1dVal; + int _tmp = + (int) + ((((channel1dValRaw().get((int) 0) - 48) * 10) + + (channel1dValRaw().get((int) 1) - 48))); + this.channel1dVal = _tmp; + return this.channel1dVal; + } + + private Double channel1aVal; + + /** value * 29.5 [mA] */ + public Double channel1aVal() { + if (this.channel1aVal != null) return this.channel1aVal; + double _tmp = + (double) + (((((channel1aValRaw().get((int) 0) - 48) * 10) + + (channel1aValRaw().get((int) 1) - 48)) + * 29.5)); + this.channel1aVal = _tmp; + return this.channel1aVal; + } + + private Double channel6aVal; + + /** value^2 / 1.56 [mA] */ + public Double channel6aVal() { + if (this.channel6aVal != null) return this.channel6aVal; + double _tmp = + (double) + ((((((channel6aValRaw().get((int) 0) - 48) * 10) + + (channel6aValRaw().get((int) 1) - 48)) + * (((channel6aValRaw().get((int) 0) - 48) * 10) + + (channel6aValRaw().get((int) 1) - 48))) + / 1.56)); + this.channel6aVal = _tmp; + return this.channel6aVal; + } + + private Integer channel1cVal; + + /** 1970 - (20 * value) [mA] */ + public Integer channel1cVal() { + if (this.channel1cVal != null) return this.channel1cVal; + int _tmp = + (int) + ((1970 + - (20 + * (((channel1cValRaw().get((int) 0) - 48) * 10) + + (channel1cValRaw().get((int) 1) - 48))))); + this.channel1cVal = _tmp; + return this.channel1cVal; + } + + private Double channel4aVal; + + /** 95.8 - 1.48 * value [�C] */ + public Double channel4aVal() { + if (this.channel4aVal != null) return this.channel4aVal; + double _tmp = + (double) + ((95.8 + - (1.48 + * (((channel4aValRaw().get((int) 0) - 48) * 10) + + (channel4aValRaw().get((int) 1) - 48))))); + this.channel4aVal = _tmp; + return this.channel4aVal; + } + + private Double channel5aVal; + + /** 95.8 - 1.48 * value [�C] */ + public Double channel5aVal() { + if (this.channel5aVal != null) return this.channel5aVal; + double _tmp = + (double) + ((95.8 + - (1.48 + * (((channel5aValRaw().get((int) 0) - 48) * 10) + + (channel5aValRaw().get((int) 1) - 48))))); + this.channel5aVal = _tmp; + return this.channel5aVal; + } + + private Double channel2bVal; + + /** 8 * (1 - 0.01 * value)^2 [W] */ + public Double channel2bVal() { + if (this.channel2bVal != null) return this.channel2bVal; + double _tmp = + (double) + ((8 + * ((1 + - (0.01 + * (((channel2bValRaw().get((int) 0) - 48) * 10) + + (channel2bValRaw().get((int) 1) - 48)))) + * (1 + - (0.01 + * (((channel2bValRaw().get((int) 0) - 48) * 10) + + (channel2bValRaw().get((int) 1) - 48))))))); + this.channel2bVal = _tmp; + return this.channel2bVal; + } + + private Double channel6bVal; + + /** 0.1 * value^2 + 35 [mA] */ + public Double channel6bVal() { + if (this.channel6bVal != null) return this.channel6bVal; + double _tmp = + (double) + (((0.1 + * ((((channel6bValRaw().get((int) 0) - 48) * 10) + + (channel6bValRaw().get((int) 1) - 48)) + * (((channel6bValRaw().get((int) 0) - 48) * 10) + + (channel6bValRaw().get((int) 1) - 48)))) + + 35)); + this.channel6bVal = _tmp; + return this.channel6bVal; + } + + private Double channel6cVal; + + /** 0.041 * value^2 [mA] */ + public Double channel6cVal() { + if (this.channel6cVal != null) return this.channel6cVal; + double _tmp = + (double) + ((0.041 + * ((((channel6cValRaw().get((int) 0) - 48) * 10) + + (channel6cValRaw().get((int) 1) - 48)) + * (((channel6cValRaw().get((int) 0) - 48) * 10) + + (channel6cValRaw().get((int) 1) - 48))))); + this.channel6cVal = _tmp; + return this.channel6cVal; + } + + private Double channel3aVal; + + /** 0.1 * value + 6.4 [V] */ + public Double channel3aVal() { + if (this.channel3aVal != null) return this.channel3aVal; + double _tmp = + (double) + (((0.1 + * (((channel3aValRaw().get((int) 0) - 48) * 10) + + (channel3aValRaw().get((int) 1) - 48))) + + 6.4)); + this.channel3aVal = _tmp; + return this.channel3aVal; + } + + private Integer channel2dVal; + + /** 40 * (value - 50) [mA] */ + public Integer channel2dVal() { + if (this.channel2dVal != null) return this.channel2dVal; + int _tmp = + (int) + ((40 + * ((((channel2dValRaw().get((int) 0) - 48) * 10) + + (channel2dValRaw().get((int) 1) - 48)) + - 50))); + this.channel2dVal = _tmp; + return this.channel2dVal; + } + + private Double channel5dVal; + + /** 11 + 0.82 * value [mA] */ + public Double channel5dVal() { + if (this.channel5dVal != null) return this.channel5dVal; + double _tmp = + (double) + ((11 + + (0.82 + * (((channel5dValRaw().get((int) 0) - 48) * 10) + + (channel5dValRaw().get((int) 1) - 48))))); + this.channel5dVal = _tmp; + return this.channel5dVal; + } + + private Double channel2cVal; + + /** 15.16 * value [h] */ + public Double channel2cVal() { + if (this.channel2cVal != null) return this.channel2cVal; + double _tmp = + (double) + ((15.16 + * (((channel2cValRaw().get((int) 0) - 48) * 10) + + (channel2cValRaw().get((int) 1) - 48)))); + this.channel2cVal = _tmp; + return this.channel2cVal; + } + + private Double channel6dVal; + + /** 0.01 * value */ + public Double channel6dVal() { + if (this.channel6dVal != null) return this.channel6dVal; + double _tmp = + (double) + ((0.01 + * (((channel6dValRaw().get((int) 0) - 48) * 10) + + (channel6dValRaw().get((int) 1) - 48)))); + this.channel6dVal = _tmp; + return this.channel6dVal; + } + + private Integer channel1bVal; + + /** 1970 - (20 * value) [mA] */ + public Integer channel1bVal() { + if (this.channel1bVal != null) return this.channel1bVal; + int _tmp = + (int) + ((1970 + - (20 + * (((channel1bValRaw().get((int) 0) - 48) * 10) + + (channel1bValRaw().get((int) 1) - 48))))); + this.channel1bVal = _tmp; + return this.channel1bVal; + } + + private Double channel3bVal; + + /** 0.1 * value [V] */ + public Double channel3bVal() { + if (this.channel3bVal != null) return this.channel3bVal; + double _tmp = + (double) + ((0.1 + * (((channel3bValRaw().get((int) 0) - 48) * 10) + + (channel3bValRaw().get((int) 1) - 48)))); + this.channel3bVal = _tmp; + return this.channel3bVal; + } + + private Double channel4cVal; + + /** 95.8 - 1.48 * value [�C] */ + public Double channel4cVal() { + if (this.channel4cVal != null) return this.channel4cVal; + double _tmp = + (double) + ((95.8 + - (1.48 + * (((channel4cValRaw().get((int) 0) - 48) * 10) + + (channel4cValRaw().get((int) 1) - 48))))); + this.channel4cVal = _tmp; + return this.channel4cVal; + } + + private Double channel5cVal; + + /** 95.8 - 1.48 * value [�C] */ + public Double channel5cVal() { + if (this.channel5cVal != null) return this.channel5cVal; + double _tmp = + (double) + ((95.8 + - (1.48 + * (((channel5cValRaw().get((int) 0) - 48) * 10) + + (channel5cValRaw().get((int) 1) - 48))))); + this.channel5cVal = _tmp; + return this.channel5cVal; + } + + private Double channel4bVal; + + /** 95.8 - 1.48 * value [�C] */ + public Double channel4bVal() { + if (this.channel4bVal != null) return this.channel4bVal; + double _tmp = + (double) + ((95.8 + - (1.48 + * (((channel4bValRaw().get((int) 0) - 48) * 10) + + (channel4bValRaw().get((int) 1) - 48))))); + this.channel4bVal = _tmp; + return this.channel4bVal; + } + + private Double channel3dVal; + + /** 95.8 - 1.48 * value [�C] */ + public Double channel3dVal() { + if (this.channel3dVal != null) return this.channel3dVal; + double _tmp = + (double) + ((95.8 + - (1.48 + * (((channel3dValRaw().get((int) 0) - 48) * 10) + + (channel3dValRaw().get((int) 1) - 48))))); + this.channel3dVal = _tmp; + return this.channel3dVal; + } + + private Integer channel2aVal; + + /** 1970 - (20 * value) [mA] */ + public Integer channel2aVal() { + if (this.channel2aVal != null) return this.channel2aVal; + int _tmp = + (int) + ((1970 + - (20 + * (((channel2aValRaw().get((int) 0) - 48) * 10) + + (channel2aValRaw().get((int) 1) - 48))))); + this.channel2aVal = _tmp; + return this.channel2aVal; + } + + private Double channel4dVal; + + /** 95.8 - 1.48 * value [�C] */ + public Double channel4dVal() { + if (this.channel4dVal != null) return this.channel4dVal; + double _tmp = + (double) + ((95.8 + - (1.48 + * (((channel4dValRaw().get((int) 0) - 48) * 10) + + (channel4dValRaw().get((int) 1) - 48))))); + this.channel4dVal = _tmp; + return this.channel4dVal; + } + + private Double channel3cVal; + + /** 0.15 * value [V] */ + public Double channel3cVal() { + if (this.channel3cVal != null) return this.channel3cVal; + double _tmp = + (double) + ((0.15 + * (((channel3cValRaw().get((int) 0) - 48) * 10) + + (channel3cValRaw().get((int) 1) - 48)))); + this.channel3cVal = _tmp; + return this.channel3cVal; + } + + private Double channel5bVal; + + /** 11.67 * value [mA] */ + public Double channel5bVal() { + if (this.channel5bVal != null) return this.channel5bVal; + double _tmp = + (double) + ((11.67 + * (((channel5bValRaw().get((int) 0) - 48) * 10) + + (channel5bValRaw().get((int) 1) - 48)))); + this.channel5bVal = _tmp; + return this.channel5bVal; + } + + private byte[] ao7Magic; + private byte[] channel1aId; + private ArrayList channel1aValRaw; + private byte[] delim1a; + private byte[] channel1bId; + private ArrayList channel1bValRaw; + private byte[] delim1b; + private byte[] channel1cId; + private ArrayList channel1cValRaw; + private byte[] delim1c; + private byte[] channel1dId; + private ArrayList channel1dValRaw; + private byte[] delim1d; + private byte[] channel2aId; + private ArrayList channel2aValRaw; + private byte[] delim2a; + private byte[] channel2bId; + private ArrayList channel2bValRaw; + private byte[] delim2b; + private byte[] channel2cId; + private ArrayList channel2cValRaw; + private byte[] delim2c; + private byte[] channel2dId; + private ArrayList channel2dValRaw; + private byte[] delim2d; + private byte[] channel3aId; + private ArrayList channel3aValRaw; + private byte[] delim3a; + private byte[] channel3bId; + private ArrayList channel3bValRaw; + private byte[] delim3b; + private byte[] channel3cId; + private ArrayList channel3cValRaw; + private byte[] delim3c; + private byte[] channel3dId; + private ArrayList channel3dValRaw; + private byte[] delim3d; + private byte[] channel4aId; + private ArrayList channel4aValRaw; + private byte[] delim4a; + private byte[] channel4bId; + private ArrayList channel4bValRaw; + private byte[] delim4b; + private byte[] channel4cId; + private ArrayList channel4cValRaw; + private byte[] delim4c; + private byte[] channel4dId; + private ArrayList channel4dValRaw; + private byte[] delim4d; + private byte[] channel5aId; + private ArrayList channel5aValRaw; + private byte[] delim5a; + private byte[] channel5bId; + private ArrayList channel5bValRaw; + private byte[] delim5b; + private byte[] channel5cId; + private ArrayList channel5cValRaw; + private byte[] delim5c; + private byte[] channel5dId; + private ArrayList channel5dValRaw; + private byte[] delim5d; + private byte[] channel6aId; + private ArrayList channel6aValRaw; + private byte[] delim6a; + private byte[] channel6bId; + private ArrayList channel6bValRaw; + private byte[] delim6b; + private byte[] channel6cId; + private ArrayList channel6cValRaw; + private byte[] delim6c; + private byte[] channel6dId; + private ArrayList channel6dValRaw; + private byte[] delim6d; + private Cubesatsim _root; + private Cubesatsim.CubesatsimData _parent; + + public byte[] ao7Magic() { + return ao7Magic; + } + + public byte[] channel1aId() { + return channel1aId; + } + + public ArrayList channel1aValRaw() { + return channel1aValRaw; + } + + public byte[] delim1a() { + return delim1a; + } + + public byte[] channel1bId() { + return channel1bId; + } + + public ArrayList channel1bValRaw() { + return channel1bValRaw; + } + + public byte[] delim1b() { + return delim1b; + } + + public byte[] channel1cId() { + return channel1cId; + } + + public ArrayList channel1cValRaw() { + return channel1cValRaw; + } + + public byte[] delim1c() { + return delim1c; + } + + public byte[] channel1dId() { + return channel1dId; + } + + public ArrayList channel1dValRaw() { + return channel1dValRaw; + } + + public byte[] delim1d() { + return delim1d; + } + + public byte[] channel2aId() { + return channel2aId; + } + + public ArrayList channel2aValRaw() { + return channel2aValRaw; + } + + public byte[] delim2a() { + return delim2a; + } + + public byte[] channel2bId() { + return channel2bId; + } + + public ArrayList channel2bValRaw() { + return channel2bValRaw; + } + + public byte[] delim2b() { + return delim2b; + } + + public byte[] channel2cId() { + return channel2cId; + } + + public ArrayList channel2cValRaw() { + return channel2cValRaw; + } + + public byte[] delim2c() { + return delim2c; + } + + public byte[] channel2dId() { + return channel2dId; + } + + public ArrayList channel2dValRaw() { + return channel2dValRaw; + } - public byte[] delim2d() { - return delim2d; - } + public byte[] delim2d() { + return delim2d; + } - public byte[] channel3aId() { - return channel3aId; - } + public byte[] channel3aId() { + return channel3aId; + } - public ArrayList channel3aValRaw() { - return channel3aValRaw; - } + public ArrayList channel3aValRaw() { + return channel3aValRaw; + } - public byte[] delim3a() { - return delim3a; - } + public byte[] delim3a() { + return delim3a; + } - public byte[] channel3bId() { - return channel3bId; - } + public byte[] channel3bId() { + return channel3bId; + } - public ArrayList channel3bValRaw() { - return channel3bValRaw; - } + public ArrayList channel3bValRaw() { + return channel3bValRaw; + } - public byte[] delim3b() { - return delim3b; - } + public byte[] delim3b() { + return delim3b; + } - public byte[] channel3cId() { - return channel3cId; - } + public byte[] channel3cId() { + return channel3cId; + } - public ArrayList channel3cValRaw() { - return channel3cValRaw; - } + public ArrayList channel3cValRaw() { + return channel3cValRaw; + } - public byte[] delim3c() { - return delim3c; - } + public byte[] delim3c() { + return delim3c; + } - public byte[] channel3dId() { - return channel3dId; - } + public byte[] channel3dId() { + return channel3dId; + } - public ArrayList channel3dValRaw() { - return channel3dValRaw; - } + public ArrayList channel3dValRaw() { + return channel3dValRaw; + } - public byte[] delim3d() { - return delim3d; - } + public byte[] delim3d() { + return delim3d; + } - public byte[] channel4aId() { - return channel4aId; - } + public byte[] channel4aId() { + return channel4aId; + } - public ArrayList channel4aValRaw() { - return channel4aValRaw; - } + public ArrayList channel4aValRaw() { + return channel4aValRaw; + } - public byte[] delim4a() { - return delim4a; - } + public byte[] delim4a() { + return delim4a; + } - public byte[] channel4bId() { - return channel4bId; - } + public byte[] channel4bId() { + return channel4bId; + } - public ArrayList channel4bValRaw() { - return channel4bValRaw; - } + public ArrayList channel4bValRaw() { + return channel4bValRaw; + } - public byte[] delim4b() { - return delim4b; - } + public byte[] delim4b() { + return delim4b; + } - public byte[] channel4cId() { - return channel4cId; - } + public byte[] channel4cId() { + return channel4cId; + } - public ArrayList channel4cValRaw() { - return channel4cValRaw; - } + public ArrayList channel4cValRaw() { + return channel4cValRaw; + } - public byte[] delim4c() { - return delim4c; - } + public byte[] delim4c() { + return delim4c; + } - public byte[] channel4dId() { - return channel4dId; - } + public byte[] channel4dId() { + return channel4dId; + } - public ArrayList channel4dValRaw() { - return channel4dValRaw; - } + public ArrayList channel4dValRaw() { + return channel4dValRaw; + } - public byte[] delim4d() { - return delim4d; - } + public byte[] delim4d() { + return delim4d; + } - public byte[] channel5aId() { - return channel5aId; - } + public byte[] channel5aId() { + return channel5aId; + } - public ArrayList channel5aValRaw() { - return channel5aValRaw; - } + public ArrayList channel5aValRaw() { + return channel5aValRaw; + } - public byte[] delim5a() { - return delim5a; - } + public byte[] delim5a() { + return delim5a; + } - public byte[] channel5bId() { - return channel5bId; - } + public byte[] channel5bId() { + return channel5bId; + } - public ArrayList channel5bValRaw() { - return channel5bValRaw; - } + public ArrayList channel5bValRaw() { + return channel5bValRaw; + } - public byte[] delim5b() { - return delim5b; - } - - public byte[] channel5cId() { - return channel5cId; - } - - public ArrayList channel5cValRaw() { - return channel5cValRaw; - } - - public byte[] delim5c() { - return delim5c; - } - - public byte[] channel5dId() { - return channel5dId; - } - - public ArrayList channel5dValRaw() { - return channel5dValRaw; - } - - public byte[] delim5d() { - return delim5d; - } - - public byte[] channel6aId() { - return channel6aId; - } - - public ArrayList channel6aValRaw() { - return channel6aValRaw; - } - - public byte[] delim6a() { - return delim6a; - } - - public byte[] channel6bId() { - return channel6bId; - } - - public ArrayList channel6bValRaw() { - return channel6bValRaw; - } - - public byte[] delim6b() { - return delim6b; - } - - public byte[] channel6cId() { - return channel6cId; - } - - public ArrayList channel6cValRaw() { - return channel6cValRaw; - } - - public byte[] delim6c() { - return delim6c; - } - - public byte[] channel6dId() { - return channel6dId; - } - - public ArrayList channel6dValRaw() { - return channel6dValRaw; - } - - public byte[] delim6d() { - return delim6d; - } - - public Cubesatsim _root() { - return _root; - } - - public Cubesatsim.CubesatsimData _parent() { - return _parent; - } - } - - public static class SrcAddress extends KaitaiStruct { - public static SrcAddress fromFile(String fileName) throws IOException { - return new SrcAddress(new ByteBufferKaitaiStream(fileName)); - } - - public SrcAddress(KaitaiStream _io) { - this(_io, null, null); - } - - public SrcAddress(KaitaiStream _io, Cubesatsim.Hdr _parent) { - this(_io, _parent, null); - } - - public SrcAddress(KaitaiStream _io, Cubesatsim.Hdr _parent, Cubesatsim _root) { - super(_io); - this._parent = _parent; - this._root = _root; - _read(); - } - - private void _read() { - this.srcAddressStr = new String(this._io.readBytes(6), Charset.forName("ASCII")); - } - - private String srcAddressStr; - private Cubesatsim _root; - private Cubesatsim.Hdr _parent; - - public String srcAddressStr() { - return srcAddressStr; - } - - public Cubesatsim _root() { - return _root; - } - - public Cubesatsim.Hdr _parent() { - return _parent; - } - } - - private Hdr ax25Header; - private UiFrame frametype; - private Cubesatsim _root; - private KaitaiStruct _parent; - private byte[] _raw_ax25Header; - - /** - * @see Source - */ - public Hdr ax25Header() { - return ax25Header; - } - - public UiFrame frametype() { - return frametype; - } - - public Cubesatsim _root() { - return _root; - } - - public KaitaiStruct _parent() { - return _parent; - } - - public byte[] _raw_ax25Header() { - return _raw_ax25Header; - } + public byte[] delim5b() { + return delim5b; + } + + public byte[] channel5cId() { + return channel5cId; + } + + public ArrayList channel5cValRaw() { + return channel5cValRaw; + } + + public byte[] delim5c() { + return delim5c; + } + + public byte[] channel5dId() { + return channel5dId; + } + + public ArrayList channel5dValRaw() { + return channel5dValRaw; + } + + public byte[] delim5d() { + return delim5d; + } + + public byte[] channel6aId() { + return channel6aId; + } + + public ArrayList channel6aValRaw() { + return channel6aValRaw; + } + + public byte[] delim6a() { + return delim6a; + } + + public byte[] channel6bId() { + return channel6bId; + } + + public ArrayList channel6bValRaw() { + return channel6bValRaw; + } + + public byte[] delim6b() { + return delim6b; + } + + public byte[] channel6cId() { + return channel6cId; + } + + public ArrayList channel6cValRaw() { + return channel6cValRaw; + } + + public byte[] delim6c() { + return delim6c; + } + + public byte[] channel6dId() { + return channel6dId; + } + + public ArrayList channel6dValRaw() { + return channel6dValRaw; + } + + public byte[] delim6d() { + return delim6d; + } + + public Cubesatsim _root() { + return _root; + } + + public Cubesatsim.CubesatsimData _parent() { + return _parent; + } + } + + public static class SrcAddress extends KaitaiStruct { + public static SrcAddress fromFile(String fileName) throws IOException { + return new SrcAddress(new ByteBufferKaitaiStream(fileName)); + } + + public SrcAddress(KaitaiStream _io) { + this(_io, null, null); + } + + public SrcAddress(KaitaiStream _io, Cubesatsim.Hdr _parent) { + this(_io, _parent, null); + } + + public SrcAddress(KaitaiStream _io, Cubesatsim.Hdr _parent, Cubesatsim _root) { + super(_io); + this._parent = _parent; + this._root = _root; + _read(); + } + + private void _read() { + this.srcAddressStr = new String(this._io.readBytes(6), Charset.forName("ASCII")); + } + + private String srcAddressStr; + private Cubesatsim _root; + private Cubesatsim.Hdr _parent; + + public String srcAddressStr() { + return srcAddressStr; + } + + public Cubesatsim _root() { + return _root; + } + + public Cubesatsim.Hdr _parent() { + return _parent; + } + } + + private Hdr ax25Header; + private UiFrame frametype; + private Cubesatsim _root; + private KaitaiStruct _parent; + private byte[] _raw_ax25Header; + + /** @see Source */ + public Hdr ax25Header() { + return ax25Header; + } + + public UiFrame frametype() { + return frametype; + } + + public Cubesatsim _root() { + return _root; + } + + public KaitaiStruct _parent() { + return _parent; + } + + public byte[] _raw_ax25Header() { + return _raw_ax25Header; + } } diff --git a/ModuleCubesatSim/src/main/java/org/josast/TLM/AxBEqx.java b/ModuleCubesatSim/src/main/java/org/josast/TLM/AxBEqx.java index 4cbcfd7479e4259e4237b87cf646bf28d2f0f035..9256f1bf65e41e7e5392bd0088d1ae279c90f847 100644 --- a/ModuleCubesatSim/src/main/java/org/josast/TLM/AxBEqx.java +++ b/ModuleCubesatSim/src/main/java/org/josast/TLM/AxBEqx.java @@ -1,36 +1,34 @@ package org.josast.TLM; public class AxBEqx implements ICalculData { - private double A; - private double B; + private double A; + private double B; - /** - * Constructor with two parameters of the equation A & B. - * - * @param a - * @param b - */ - public AxBEqx(double a, double b) { - A = a; - B = b; - } + /** + * Constructor with two parameters of the equation A & B. + * + * @param a + * @param b + */ + public AxBEqx(double a, double b) { + A = a; + B = b; + } - /** - * Equation is : y= A x + B. - * - * @param x x value - * @return computed value - * @see org.josast.TLM.ICalculData#calcul(int) - */ + /** + * Equation is : y= A x + B. + * + * @param x x value + * @return computed value + * @see org.josast.TLM.ICalculData#calcul(int) + */ + @Override + public double calcul(int x) { + // TODO Auto-generated method stub + return (double) x * A + B; + } - @Override - public double calcul(int x) { - // TODO Auto-generated method stub - return (double) x * A + B; - } - - public String toString() { - return "" + A + " x + " + B; - - } + public String toString() { + return "" + A + " x + " + B; + } } diff --git a/ModuleCubesatSim/src/main/java/org/josast/TLM/AxEqx.java b/ModuleCubesatSim/src/main/java/org/josast/TLM/AxEqx.java index 8b3f9b560f4ebfab9fa920ea06f540beefb71cb6..d890cdf0daed82f11d7b72f734cd2b94aacda050 100644 --- a/ModuleCubesatSim/src/main/java/org/josast/TLM/AxEqx.java +++ b/ModuleCubesatSim/src/main/java/org/josast/TLM/AxEqx.java @@ -1,16 +1,15 @@ package org.josast.TLM; public class AxEqx implements ICalculData { - double a; + double a; - public AxEqx(double aa) { - this.a = aa; - } - - @Override - public double calcul(int x) { - // TODO Auto-generated method stub - return a * x; - } + public AxEqx(double aa) { + this.a = aa; + } + @Override + public double calcul(int x) { + // TODO Auto-generated method stub + return a * x; + } } diff --git a/ModuleCubesatSim/src/main/java/org/josast/TLM/BooleanTLM.java b/ModuleCubesatSim/src/main/java/org/josast/TLM/BooleanTLM.java index f80ede78e22d09f0257abd4036bece3a0d0abe3f..5b13487993b54af1837906044b7d1825f7a6e956 100644 --- a/ModuleCubesatSim/src/main/java/org/josast/TLM/BooleanTLM.java +++ b/ModuleCubesatSim/src/main/java/org/josast/TLM/BooleanTLM.java @@ -2,42 +2,39 @@ package org.josast.TLM; public class BooleanTLM { - protected boolean[] bool = new boolean[8]; - - public BooleanTLM() { - - } - - public boolean getValue(int data) { - return this.bool[data]; - } - - public boolean[] convertToBoolean(int in, int lengh) { - - String maxAmpStr = Integer.toBinaryString(in); - char[] arr = maxAmpStr.toCharArray(); - boolean[] bool = new boolean[lengh]; - int j = 0; - for (int i = arr.length - 1; i >= 0; i--) { - if (arr[i] == '1') { - bool[j++] = true; - } else if (arr[i] == '0') { - bool[j++] = false; - } - } - - return bool; + protected boolean[] bool = new boolean[8]; + + public BooleanTLM() {} + + public boolean getValue(int data) { + return this.bool[data]; + } + + public boolean[] convertToBoolean(int in, int lengh) { + + String maxAmpStr = Integer.toBinaryString(in); + char[] arr = maxAmpStr.toCharArray(); + boolean[] bool = new boolean[lengh]; + int j = 0; + for (int i = arr.length - 1; i >= 0; i--) { + if (arr[i] == '1') { + bool[j++] = true; + } else if (arr[i] == '0') { + bool[j++] = false; + } } - public String toString() { + return bool; + } - StringBuilder stringBuilder = new StringBuilder(); - for (int j = 0; j < 8; j++) { + public String toString() { - stringBuilder.append(bool[j] + ","); - } + StringBuilder stringBuilder = new StringBuilder(); + for (int j = 0; j < 8; j++) { - return stringBuilder.toString(); + stringBuilder.append(bool[j] + ","); } + return stringBuilder.toString(); + } } diff --git a/ModuleCubesatSim/src/main/java/org/josast/TLM/CubicEqx.java b/ModuleCubesatSim/src/main/java/org/josast/TLM/CubicEqx.java index 0988d595e2bb6a8332c7b78138a1ebb2ebc43f3b..2a471d8c490f5a1b2fd1304d0b480b307ae4edfd 100644 --- a/ModuleCubesatSim/src/main/java/org/josast/TLM/CubicEqx.java +++ b/ModuleCubesatSim/src/main/java/org/josast/TLM/CubicEqx.java @@ -1,47 +1,42 @@ package org.josast.TLM; /** - * Calculate Cubix equation
. - * Ax3+bx2+Cx+d
- * - * @author Christophe + * Calculate Cubix equation
+ * . Ax3+bx2+Cx+d
* + * @author Christophe */ public class CubicEqx implements ICalculData { - double A; - double B; - double C; - double D; - - /** - * The Constructor. - * - * @param d the d - * @param a the a - * @param c the c - * @param b the b - */ - public CubicEqx(double a, double b, double c, double d) { - super(); - A = a; - B = b; - C = c; - D = d; - } + double A; + double B; + double C; + double D; - /** - * Calcul. - * - * @param x the x - * - * @return the double - * - * - */ - public double calcul(int x) { + /** + * The Constructor. + * + * @param d the d + * @param a the a + * @param c the c + * @param b the b + */ + public CubicEqx(double a, double b, double c, double d) { + super(); + A = a; + B = b; + C = c; + D = d; + } - return A * Math.pow(x, 3) + B * Math.pow(x, 2) + C * x + D; - } + /** + * Calcul. + * + * @param x the x + * @return the double + */ + public double calcul(int x) { + return A * Math.pow(x, 3) + B * Math.pow(x, 2) + C * x + D; + } } diff --git a/ModuleCubesatSim/src/main/java/org/josast/TLM/ICalculData.java b/ModuleCubesatSim/src/main/java/org/josast/TLM/ICalculData.java index a5ab3ba8832615dd7d12a26c10a90a13c9502556..70135b75ada93f2d7f973f637302dec8ffa2fcb4 100644 --- a/ModuleCubesatSim/src/main/java/org/josast/TLM/ICalculData.java +++ b/ModuleCubesatSim/src/main/java/org/josast/TLM/ICalculData.java @@ -1,17 +1,12 @@ package org.josast.TLM; -/** - * - * - * @author Christophe - * - */ +/** @author Christophe */ public interface ICalculData { - /** - * compute the value of X. - * - * @param x x used by the equation - * @return y - */ - double calcul(int x); + /** + * compute the value of X. + * + * @param x x used by the equation + * @return y + */ + double calcul(int x); } diff --git a/ModuleCubesatSim/src/main/java/org/josast/TLM/TlmData.java b/ModuleCubesatSim/src/main/java/org/josast/TLM/TlmData.java index 0cc8276d34e6262d920c303ec78d8ef6134ae3c0..f7ffe7b6d56c0ce0e86320c49d457f60fab157bb 100644 --- a/ModuleCubesatSim/src/main/java/org/josast/TLM/TlmData.java +++ b/ModuleCubesatSim/src/main/java/org/josast/TLM/TlmData.java @@ -1,103 +1,98 @@ package org.josast.TLM; -/** - * @author Christophe - * - */ +/** @author Christophe */ public class TlmData { - /** The name. */ - private String name; - - /** The formulae. */ - private ICalculData formulae; - - /** The unit. */ - private String unit; - - private String format; - - /** - * The Constructor. - * - * @param unit the unit - * @param formulae the formulae - * @param name the name - * @param formatDislay - */ - public TlmData(String name, ICalculData formulae, String unit, - String formatDislay) { - super(); - this.name = name; - this.formulae = formulae; - this.unit = unit; - this.format = formatDislay; - } - - public String getFormat() { - return format; - } - - public void setFormat(String format) { - this.format = format; - } - - /** - * Gets the formulae. - * - * @return the formulae - */ - public ICalculData getFormulae() { - return formulae; - } - - /** - * Sets the formulae. - * - * @param formulae the formulae - */ - public void setFormulae(ICalculData formulae) { - this.formulae = formulae; - } - - /** - * Gets the name. - * - * @return the name - */ - public String getName() { - return name; - } - - /** - * Sets the name. - * - * @param name the name - */ - public void setName(String name) { - this.name = name; - } - - /** - * Gets the unit. - * - * @return the unit - */ - public String getUnit() { - return unit; - } - - /** - * Sets the unit. - * - * @param unit the unit - */ - public void setUnit(String unit) { - this.unit = unit; - } - - public String toString() { - return "" + name + ":" + formulae.toString() + " " + unit; - - } + /** The name. */ + private String name; + + /** The formulae. */ + private ICalculData formulae; + + /** The unit. */ + private String unit; + + private String format; + + /** + * The Constructor. + * + * @param unit the unit + * @param formulae the formulae + * @param name the name + * @param formatDislay + */ + public TlmData(String name, ICalculData formulae, String unit, String formatDislay) { + super(); + this.name = name; + this.formulae = formulae; + this.unit = unit; + this.format = formatDislay; + } + + public String getFormat() { + return format; + } + + public void setFormat(String format) { + this.format = format; + } + + /** + * Gets the formulae. + * + * @return the formulae + */ + public ICalculData getFormulae() { + return formulae; + } + + /** + * Sets the formulae. + * + * @param formulae the formulae + */ + public void setFormulae(ICalculData formulae) { + this.formulae = formulae; + } + + /** + * Gets the name. + * + * @return the name + */ + public String getName() { + return name; + } + + /** + * Sets the name. + * + * @param name the name + */ + public void setName(String name) { + this.name = name; + } + + /** + * Gets the unit. + * + * @return the unit + */ + public String getUnit() { + return unit; + } + + /** + * Sets the unit. + * + * @param unit the unit + */ + public void setUnit(String unit) { + this.unit = unit; + } + + public String toString() { + return "" + name + ":" + formulae.toString() + " " + unit; + } } diff --git a/ModuleCubesatSim/src/main/java/org/josast/TLM/xEqx.java b/ModuleCubesatSim/src/main/java/org/josast/TLM/xEqx.java index 80cdc8f95591cd842493940ab40ecf21b3378fa8..58e36e572e1edda84742c10576242c0d84640d02 100644 --- a/ModuleCubesatSim/src/main/java/org/josast/TLM/xEqx.java +++ b/ModuleCubesatSim/src/main/java/org/josast/TLM/xEqx.java @@ -2,10 +2,9 @@ package org.josast.TLM; public class xEqx implements ICalculData { - @Override - public double calcul(int x) { - - return (double) x; - } + @Override + public double calcul(int x) { + return (double) x; + } } diff --git a/ModuleCubesatSim/src/test/java/org/josast/CubesatSim/CubesatSimeFrameTest.java b/ModuleCubesatSim/src/test/java/org/josast/CubesatSim/CubesatSimeFrameTest.java index 2321743d261777d179df80e561947a1e1af0d294..5529402843fb88c48d00126af2f424bb712365ce 100644 --- a/ModuleCubesatSim/src/test/java/org/josast/CubesatSim/CubesatSimeFrameTest.java +++ b/ModuleCubesatSim/src/test/java/org/josast/CubesatSim/CubesatSimeFrameTest.java @@ -2,11 +2,11 @@ package org.josast.CubesatSim; import static org.junit.jupiter.api.Assertions.*; +import io.kaitai.struct.ByteBufferKaitaiStream; import java.io.IOException; import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.Paths; - import org.josast.CubesatSim.kaitai.generated.Cubesatsim; import org.josast.ModuleSoundModem.KissException; import org.josast.ModuleSoundModem.kiss; @@ -16,66 +16,54 @@ import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; -import io.kaitai.struct.ByteBufferKaitaiStream; - class CubesatSimeFrameTest { - int cpt = 0; - String generateRepository = "src/test/resources"; - String filetest = "src/test/resources/CubesatSim.bin"; - byte[] buff = null; - Cubesatsim cube = null; - - @BeforeAll - static void setUpBeforeClass() throws Exception { - } + int cpt = 0; + String generateRepository = "src/test/resources"; + String filetest = "src/test/resources/CubesatSim.bin"; + byte[] buff = null; + Cubesatsim cube = null; - @AfterAll - static void tearDownAfterClass() throws Exception { - } + @BeforeAll + static void setUpBeforeClass() throws Exception {} - @BeforeEach - void setUp() throws Exception { - } + @AfterAll + static void tearDownAfterClass() throws Exception {} - @AfterEach - void tearDown() throws Exception { - } + @BeforeEach + void setUp() throws Exception {} - @Test - void test() { + @AfterEach + void tearDown() throws Exception {} - Path p = Paths.get(filetest); - byte[] kissbuff; - try { - kissbuff = Files.readAllBytes(p); + @Test + void test() { - kiss k = new kiss(kissbuff); - try { - buff = k.toRaw(); - } catch (KissException e) { - e.printStackTrace(); - } - cube = new Cubesatsim(new ByteBufferKaitaiStream(buff)); - System.out.print("Dest Adress : " - + cube.ax25Header().destAddress().destAddressStr()); - System.out.print("Dest SSID :" + cube.ax25Header().destSsid()); - System.out.print("SRC Adress : " - + cube.ax25Header().srcAddress().srcAddressStr()); - System.out.print("SRC SSID : " + cube.ax25Header().srcSsid()); - System.out.println("CTRL : " + cube.ax25Header().ctrl()); - assertEquals(3, cube.ax25Header().ctrl()); - assertEquals(1, cube.ax25Header().srcSsid()); - assertEquals(1, cube.ax25Header().destSsid()); - assertEquals("CQ ", - cube.ax25Header().destAddress().destAddressStr()); - assertEquals("F4KLK ", - cube.ax25Header().srcAddress().srcAddressStr()); - } catch (IOException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } + Path p = Paths.get(filetest); + byte[] kissbuff; + try { + kissbuff = Files.readAllBytes(p); + kiss k = new kiss(kissbuff); + try { + buff = k.toRaw(); + } catch (KissException e) { + e.printStackTrace(); + } + cube = new Cubesatsim(new ByteBufferKaitaiStream(buff)); + System.out.print("Dest Adress : " + cube.ax25Header().destAddress().destAddressStr()); + System.out.print("Dest SSID :" + cube.ax25Header().destSsid()); + System.out.print("SRC Adress : " + cube.ax25Header().srcAddress().srcAddressStr()); + System.out.print("SRC SSID : " + cube.ax25Header().srcSsid()); + System.out.println("CTRL : " + cube.ax25Header().ctrl()); + assertEquals(3, cube.ax25Header().ctrl()); + assertEquals(1, cube.ax25Header().srcSsid()); + assertEquals(1, cube.ax25Header().destSsid()); + assertEquals("CQ ", cube.ax25Header().destAddress().destAddressStr()); + assertEquals("F4KLK ", cube.ax25Header().srcAddress().srcAddressStr()); + } catch (IOException e) { + // TODO Auto-generated catch block + e.printStackTrace(); } - + } } diff --git a/ModuleEntrySatTelemetry/pom.xml b/ModuleEntrySatTelemetry/pom.xml index 206d82676b7af48d00549da03d6546796bb0caf4..535dc46c6b2ed7f49f2e8321eb480473c4d4e3d9 100644 --- a/ModuleEntrySatTelemetry/pom.xml +++ b/ModuleEntrySatTelemetry/pom.xml @@ -23,19 +23,14 @@ 1.8 1.8 1.4 - 0.1.5 - 0.8 + 0.1.6 + 0.9 1.2.17 - - - - - - + diff --git a/ModuleEntrySatTelemetry/src/main/java/org/josast/EntrySat/Telemetry.java b/ModuleEntrySatTelemetry/src/main/java/org/josast/EntrySat/Telemetry.java index 303452449dcceafc84359bd0a841eec4ba61fe9e..cb4ebe7351c85595cb7a9f676edd881616264c63 100644 --- a/ModuleEntrySatTelemetry/src/main/java/org/josast/EntrySat/Telemetry.java +++ b/ModuleEntrySatTelemetry/src/main/java/org/josast/EntrySat/Telemetry.java @@ -6,7 +6,6 @@ import java.util.GregorianCalendar; import java.util.Hashtable; import java.util.Iterator; import java.util.Set; - import org.josast.TLM.AxBEqx; import org.josast.TLM.TlmData; import org.josast.TLM.xEqx; @@ -16,199 +15,187 @@ import org.josast.kaikai.generated.FrameTlmEntrySat.UiFrameTlmEntrySat; /** * This class give access to data form Entrysat TLM data - * + * * @author christophe - * */ public class Telemetry { - public static final String BATT_TEMP = "BATT TEMP"; - public static final String EPS_TEMP = "EPS TEMP"; - public static final String EPS_3_3V_C = "EPS 3.3 V Current"; - public static final String EPS_5_V_C = "EPS 5 V Current"; - public static final String EPS_VBATT = "EPS VBATT"; - public static final String TRX_TEMP = "TRX TEMP"; - public static final String ModeSafe = "Mode Safe"; - public static final String SID = "SID"; - public static final String EPS_BATT_VCURRENT = "EPS BATTVCURRENT"; -// private static final String TIME = "Time"; - - private SimpleDateFormat ft = new SimpleDateFormat("dd MM yyyy - HH:mm:ss zzz"); - - /** - * dataDescription list with description of each telemetry data - */ - private Hashtable dataDescription = new Hashtable(); - /** - * dataValue list to store value of 1 frame - */ - private Hashtable dataValue = new Hashtable(); - - private String timeformat; - private long timeFrame; - - /** - * - */ - public Telemetry() { - - init(); - } - - /** - * Initialise all telemetry data with associated formulea - */ - - private void init() { - - dataDescription.put(SID, new TlmData(SID, new xEqx(), "", "%.0f")); - dataDescription.put(ModeSafe, new TlmData(ModeSafe, new xEqx(), "", "%2.0f")); - dataDescription.put(EPS_VBATT, new TlmData(EPS_VBATT, new AxBEqx(0.05, 3.0), "", "%.5f")); - dataDescription.put(EPS_BATT_VCURRENT, new TlmData(EPS_BATT_VCURRENT, new AxBEqx(0.0078740, -1.0), "", "%.3f")); - dataDescription.put(EPS_3_3V_C, new TlmData(EPS_3_3V_C, new AxBEqx(0.025, 0), "", "%.5f")); - dataDescription.put(EPS_5_V_C, new TlmData(EPS_5_V_C, new AxBEqx(0.025, 0), "", "%.5f")); - dataDescription.put(TRX_TEMP, new TlmData(TRX_TEMP, new AxBEqx(0.25, -15.0), "", "%.3f")); - dataDescription.put(EPS_TEMP, new TlmData(EPS_TEMP, new AxBEqx(0.25, -15.0), "", "%.3f")); - dataDescription.put(BATT_TEMP, new TlmData(BATT_TEMP, new AxBEqx(0.25, -15.0), "", "%.3f")); - - } - - public static int unsignedByteToInt(byte b) { - return (int) b & 0xFF; - } - - /** - * From an Ax25Frame (generated by Kaitai), the function extract data and fill - * hastable with value - * - * @param ax Ax25Frame - */ - public void setValue(Ax25Frame ax) { - - UiFrameTlmEntrySat Ui = (UiFrameTlmEntrySat) ax.payload(); - - TelemetryDataFiledHearder TDF = Ui.telemetryDataFiledHearder(); - - // Compute time - - byte[] b = TDF.time2(); - long times = unsignedByteToInt(b[0]) * 256 * 256 * 256 + unsignedByteToInt(b[1]) * 256 * 256 - + unsignedByteToInt(b[2]) * 256 + unsignedByteToInt(b[3]); - long timems = (long) ((float) (unsignedByteToInt(b[4]) / 256.0) * 1000); - GregorianCalendar gcalendar = new GregorianCalendar(2000, 0, 1, 0, 0, 0); - Date time = gcalendar.getTime(); - long value = time.getTime(); - value = value + times * 1000; - value = value + timems; - time.setTime(value); - setTimeFrame(value); - timeformat = ft.format(time); - - dataValue.put(SID, Ui.telemetryData().sid()); - dataValue.put(ModeSafe, Ui.telemetryData().modeSafe()); - dataValue.put(EPS_VBATT, Ui.telemetryData().epsVbatt()); - dataValue.put(EPS_BATT_VCURRENT, Ui.telemetryData().epsBattVcurrent()); - dataValue.put(EPS_3_3V_C, Ui.telemetryData().eps33VCurrent()); - dataValue.put(EPS_5_V_C, Ui.telemetryData().eps5VCurrent()); - dataValue.put(TRX_TEMP, Ui.telemetryData().trxTemp()); - dataValue.put(EPS_TEMP, Ui.telemetryData().epsTemp()); - dataValue.put(BATT_TEMP, Ui.telemetryData().battTemp()); - } - - /** - * @return TIME - time interpreted - */ - public String getTimetoSting() { - return timeformat; - } - - /** - * return string with all decoded value of the frame - * - * @return String with all decoded data, ";' is used as separator - */ - public String afficheTLM() { - - StringBuilder stringBuilder = new StringBuilder(); - Set keys = dataDescription.keySet(); - - // Obtaining iterator over set entries - Iterator itr = keys.iterator(); - String strvalue; - // Displaying Key and value pairs - while (itr.hasNext()) { - // Getting Key - strvalue = itr.next(); - - TlmData tlm = dataDescription.get(strvalue); - int value = dataValue.get(strvalue); - String valueS = String.format(tlm.getFormat(), tlm.getFormulae().calcul(value)); - stringBuilder.append(valueS); - stringBuilder.append(";\t"); - } - - stringBuilder.append("\r\n"); - return stringBuilder.toString(); - } - - /** - * Compute the raw value with formulea and format the string - * - * @param dataName - * @return value interpreted - */ - public String getValueDecoded(String dataName) { - - TlmData tlm = dataDescription.get(dataName); - int value = dataValue.get(dataName); - return String.format(tlm.getFormat(), tlm.getFormulae().calcul(value)); - } - - /** - * Compute the raw value with formulea - * - * @param dataName - * @return value interpreted - */ - public double getValueDec(String dataName) { - - TlmData tlm = dataDescription.get(dataName); - int value = dataValue.get(dataName); - return tlm.getFormulae().calcul(value); - } - - /** - * display list of data decoded - * - * @return name of data decoded separated by "," - */ - public String toStringHeader() { - StringBuilder stringBuilder = new StringBuilder(); - Set keys = dataDescription.keySet(); - - // Obtaining iterator over set entries - Iterator itr = keys.iterator(); - String strvalue; - // Displaying Key and value pairs - while (itr.hasNext()) { - // Getting Key - strvalue = itr.next(); - - stringBuilder.append(strvalue); - stringBuilder.append(";\t"); - } - - stringBuilder.append("\r\n"); - return stringBuilder.toString(); - - } - - public long getTimeFrame() { - return timeFrame; - } - - public void setTimeFrame(long timeFrame) { - this.timeFrame = timeFrame; - } - + public static final String BATT_TEMP = "BATT TEMP"; + public static final String EPS_TEMP = "EPS TEMP"; + public static final String EPS_3_3V_C = "EPS 3.3 V Current"; + public static final String EPS_5_V_C = "EPS 5 V Current"; + public static final String EPS_VBATT = "EPS VBATT"; + public static final String TRX_TEMP = "TRX TEMP"; + public static final String ModeSafe = "Mode Safe"; + public static final String SID = "SID"; + public static final String EPS_BATT_VCURRENT = "EPS BATTVCURRENT"; + // private static final String TIME = "Time"; + + private SimpleDateFormat ft = new SimpleDateFormat("dd MM yyyy - HH:mm:ss zzz"); + + /** dataDescription list with description of each telemetry data */ + private Hashtable dataDescription = new Hashtable(); + /** dataValue list to store value of 1 frame */ + private Hashtable dataValue = new Hashtable(); + + private String timeformat; + private long timeFrame; + + /** */ + public Telemetry() { + + init(); + } + + /** Initialise all telemetry data with associated formulea */ + private void init() { + + dataDescription.put(SID, new TlmData(SID, new xEqx(), "", "%.0f")); + dataDescription.put(ModeSafe, new TlmData(ModeSafe, new xEqx(), "", "%2.0f")); + dataDescription.put(EPS_VBATT, new TlmData(EPS_VBATT, new AxBEqx(0.05, 3.0), "", "%.5f")); + dataDescription.put( + EPS_BATT_VCURRENT, new TlmData(EPS_BATT_VCURRENT, new AxBEqx(0.0078740, -1.0), "", "%.3f")); + dataDescription.put(EPS_3_3V_C, new TlmData(EPS_3_3V_C, new AxBEqx(0.025, 0), "", "%.5f")); + dataDescription.put(EPS_5_V_C, new TlmData(EPS_5_V_C, new AxBEqx(0.025, 0), "", "%.5f")); + dataDescription.put(TRX_TEMP, new TlmData(TRX_TEMP, new AxBEqx(0.25, -15.0), "", "%.3f")); + dataDescription.put(EPS_TEMP, new TlmData(EPS_TEMP, new AxBEqx(0.25, -15.0), "", "%.3f")); + dataDescription.put(BATT_TEMP, new TlmData(BATT_TEMP, new AxBEqx(0.25, -15.0), "", "%.3f")); + } + + public static int unsignedByteToInt(byte b) { + return (int) b & 0xFF; + } + + /** + * From an Ax25Frame (generated by Kaitai), the function extract data and fill hastable with value + * + * @param ax Ax25Frame + */ + public void setValue(Ax25Frame ax) { + + UiFrameTlmEntrySat Ui = (UiFrameTlmEntrySat) ax.payload(); + + TelemetryDataFiledHearder TDF = Ui.telemetryDataFiledHearder(); + + // Compute time + + byte[] b = TDF.time2(); + long times = + unsignedByteToInt(b[0]) * 256 * 256 * 256 + + unsignedByteToInt(b[1]) * 256 * 256 + + unsignedByteToInt(b[2]) * 256 + + unsignedByteToInt(b[3]); + long timems = (long) ((float) (unsignedByteToInt(b[4]) / 256.0) * 1000); + GregorianCalendar gcalendar = new GregorianCalendar(2000, 0, 1, 0, 0, 0); + Date time = gcalendar.getTime(); + long value = time.getTime(); + value = value + times * 1000; + value = value + timems; + time.setTime(value); + setTimeFrame(value); + timeformat = ft.format(time); + + dataValue.put(SID, Ui.telemetryData().sid()); + dataValue.put(ModeSafe, Ui.telemetryData().modeSafe()); + dataValue.put(EPS_VBATT, Ui.telemetryData().epsVbatt()); + dataValue.put(EPS_BATT_VCURRENT, Ui.telemetryData().epsBattVcurrent()); + dataValue.put(EPS_3_3V_C, Ui.telemetryData().eps33VCurrent()); + dataValue.put(EPS_5_V_C, Ui.telemetryData().eps5VCurrent()); + dataValue.put(TRX_TEMP, Ui.telemetryData().trxTemp()); + dataValue.put(EPS_TEMP, Ui.telemetryData().epsTemp()); + dataValue.put(BATT_TEMP, Ui.telemetryData().battTemp()); + } + + /** @return TIME - time interpreted */ + public String getTimetoSting() { + return timeformat; + } + + /** + * return string with all decoded value of the frame + * + * @return String with all decoded data, ";' is used as separator + */ + public String afficheTLM() { + + StringBuilder stringBuilder = new StringBuilder(); + Set keys = dataDescription.keySet(); + + // Obtaining iterator over set entries + Iterator itr = keys.iterator(); + String strvalue; + // Displaying Key and value pairs + while (itr.hasNext()) { + // Getting Key + strvalue = itr.next(); + + TlmData tlm = dataDescription.get(strvalue); + int value = dataValue.get(strvalue); + String valueS = String.format(tlm.getFormat(), tlm.getFormulae().calcul(value)); + stringBuilder.append(valueS); + stringBuilder.append(";\t"); + } + + stringBuilder.append("\r\n"); + return stringBuilder.toString(); + } + + /** + * Compute the raw value with formulea and format the string + * + * @param dataName + * @return value interpreted + */ + public String getValueDecoded(String dataName) { + + TlmData tlm = dataDescription.get(dataName); + int value = dataValue.get(dataName); + return String.format(tlm.getFormat(), tlm.getFormulae().calcul(value)); + } + + /** + * Compute the raw value with formulea + * + * @param dataName + * @return value interpreted + */ + public double getValueDec(String dataName) { + + TlmData tlm = dataDescription.get(dataName); + int value = dataValue.get(dataName); + return tlm.getFormulae().calcul(value); + } + + /** + * display list of data decoded + * + * @return name of data decoded separated by "," + */ + public String toStringHeader() { + StringBuilder stringBuilder = new StringBuilder(); + Set keys = dataDescription.keySet(); + + // Obtaining iterator over set entries + Iterator itr = keys.iterator(); + String strvalue; + // Displaying Key and value pairs + while (itr.hasNext()) { + // Getting Key + strvalue = itr.next(); + + stringBuilder.append(strvalue); + stringBuilder.append(";\t"); + } + + stringBuilder.append("\r\n"); + return stringBuilder.toString(); + } + + public long getTimeFrame() { + return timeFrame; + } + + public void setTimeFrame(long timeFrame) { + this.timeFrame = timeFrame; + } } diff --git a/ModuleEntrySatTelemetry/src/main/java/org/josast/EntrySat/app/DecodeEntrySatFile.java b/ModuleEntrySatTelemetry/src/main/java/org/josast/EntrySat/app/DecodeEntrySatFile.java index 0c7c5214e6578d96c3a77430fd5a67b95703b2ef..5a5adb66002c14a5cf6ed91026d3039ef0951f6c 100644 --- a/ModuleEntrySatTelemetry/src/main/java/org/josast/EntrySat/app/DecodeEntrySatFile.java +++ b/ModuleEntrySatTelemetry/src/main/java/org/josast/EntrySat/app/DecodeEntrySatFile.java @@ -1,5 +1,6 @@ package org.josast.EntrySat.app; +import io.kaitai.struct.ByteBufferKaitaiStream; import java.io.BufferedReader; import java.io.FileNotFoundException; import java.io.FileReader; @@ -7,7 +8,6 @@ import java.io.IOException; import java.text.SimpleDateFormat; import java.util.Date; import java.util.Locale; - import org.apache.commons.cli.CommandLine; import org.apache.commons.cli.CommandLineParser; import org.apache.commons.cli.DefaultParser; @@ -15,168 +15,163 @@ import org.apache.commons.cli.HelpFormatter; import org.apache.commons.cli.Option; import org.apache.commons.cli.Options; import org.apache.commons.cli.ParseException; - import org.josast.kaikai.generated.FrameTlmEntrySat; import org.josast.kaikai.generated.FrameTlmEntrySat.Ax25Frame; import org.josast.kaikai.generated.FrameTlmEntrySat.UiFrameTlmEntrySat; -import io.kaitai.struct.ByteBufferKaitaiStream; - public class DecodeEntrySatFile { - private static final String Version = "0.01"; - Options options = new Options(); - HelpFormatter formatter = new HelpFormatter(); - private BufferedReader lecteurAvecBuffer; - private String ligne; - - public DecodeEntrySatFile() { - - // automatically generate the help statement - - // create Options object - - // add File option - options.addOption("v", "verbose", false, "display information during the process"); - options.addOption("V", "Version", false, Version); - Option FileOption = Option.builder("f").argName("file").hasArg().desc("Telemery file ").build(); - options.addOption(FileOption); - formatter.printHelp("DecodeTLM", options); - - } - - public void execute(String[] args) { - CommandLineParser cmdLineParser = new DefaultParser(); - CommandLine commandLineGlobal; - try { - commandLineGlobal = cmdLineParser.parse(options, args); - if (commandLineGlobal.hasOption("f")) { - System.out.println("file to extract : " + commandLineGlobal.getOptionValue("f")); - - openFile(commandLineGlobal.getOptionValue("f")); - readFile(); - -// FrameTlmEntrySat frame; -// try { -// frame = FrameTlmEntrySat.fromFile(commandLineGlobal.getOptionValue("f")); -// Telemetry tlm = new Telemetry(); -// tlm.setValue(frame.frameTlmEntrySat()); -// -// System.out.println(tlm.toStringHeader()); -// System.out.println(tlm.afficheTLM()); -// -// System.out.println(tlm.getValueDecoded(Telemetry.SID)); -// System.out.println(tlm.getValueDecoded(Telemetry.EPS_VBATT)); -// -// } catch (IOException e) { -// // TODO Auto-generated catch block -// e.printStackTrace(); -// } - - } - } catch (ParseException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - - } - - public void openFile(String file) { - try { - lecteurAvecBuffer = new BufferedReader(new FileReader(file)); - } catch (FileNotFoundException exc) { - System.out.println("Erreur d'ouverture"); - } - } - - public void readFile() { - boolean first = false; - Date dateref = null; - try { - while ((ligne = lecteurAvecBuffer.readLine()) != null) { - // System.out.println(ligne); - String[] result1 = ligne.split("="); - String[] date = result1[1].split("]"); - String[] trame = result1[2].split("]"); - - SimpleDateFormat simpleDateFormat = new SimpleDateFormat("E MMM dd hh:mm:ss z yyyy", Locale.ENGLISH); - - System.out.println("date : " + date[0] + " - Trame " + trame[0]); - Date date2 = null; - try { - date2 = simpleDateFormat.parse(date[0]); - } catch (java.text.ParseException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - if (!first) { - dateref = date2; - first = true; - } else { - System.out.println((date2.getTime() - dateref.getTime()) / 1000); - } - byte[] tlm = hexStringToByteArray(trame[0]); - FrameTlmEntrySat frame = new FrameTlmEntrySat(new ByteBufferKaitaiStream(tlm)); - Ax25Frame ax = frame.frameTlmEntrySat(); -// System.out.println(ax.ax25Header().destSsidRaw()); -// System.out.println(ax.ax25Header().srcSsidRaw()); - System.out.println(ax.ax25Header().destCallsignRaw().destCallsignRor().destCallsign()); - System.out.println(ax.ax25Header().srcCallsignRaw().srcCallsignRor().srcCallsign()); - - if (ax.ax25Header().destCallsignRaw().destCallsignRor().destCallsign().compareTo("F6KTA ") == 0) { -// System.out.println(ax.ax25Header().ctl()); - UiFrameTlmEntrySat Ui = (UiFrameTlmEntrySat) ax.payload(); -// System.out.println(Ui.packetheader().version()); -// System.out.println(Ui.packetheader().packetType()); -// System.out.println(Ui.packetheader().packetFlag()); -// System.out.println(Ui.packetheader().packetApid()); -// System.out.println(Ui.packetheader().sequenceControl()); -// System.out.println(Ui.packetheader().packetLenght()); - System.out.println("SID : " + Ui.telemetryData().sid()); - if (Ui.telemetryData().sid() == 1) { - System.err.println("SID valeur 4 "); - System.exit(0); - } -// System.out.println("battTemp : " + Ui.telemetryData().battTemp()); -// System.out.println("eps33VCurrent : " + Ui.telemetryData().eps33VCurrent()); -// System.out.println("eps5VCurrent : " + Ui.telemetryData().eps5VCurrent()); -// System.out.println("epsBattVcurrent : " + Ui.telemetryData().epsBattVcurrent()); -// System.out.println("epsTemp : " + Ui.telemetryData().epsTemp()); -// System.out.println("trxTemp : " + Ui.telemetryData().trxTemp()); - - } else { - System.out.println("SID :"); - } - } - } - - catch (IOException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - - } - - public void closeFile() { - try { - lecteurAvecBuffer.close(); - } catch (IOException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - } - - public static byte[] hexStringToByteArray(String s) { - byte[] b = new byte[s.length() / 2]; - for (int i = 0; i < b.length; i++) { - int index = i * 2; - int v = Integer.parseInt(s.substring(index, index + 2), 16); - b[i] = (byte) v; - } - return b; - } - - public static void main(String[] args) { - DecodeEntrySatFile decode = new DecodeEntrySatFile(); - decode.execute(args); - } + private static final String Version = "0.01"; + Options options = new Options(); + HelpFormatter formatter = new HelpFormatter(); + private BufferedReader lecteurAvecBuffer; + private String ligne; + + public DecodeEntrySatFile() { + + // automatically generate the help statement + + // create Options object + + // add File option + options.addOption("v", "verbose", false, "display information during the process"); + options.addOption("V", "Version", false, Version); + Option FileOption = + Option.builder("f").argName("file").hasArg().desc("Telemery file ").build(); + options.addOption(FileOption); + formatter.printHelp("DecodeTLM", options); + } + + public void execute(String[] args) { + CommandLineParser cmdLineParser = new DefaultParser(); + CommandLine commandLineGlobal; + try { + commandLineGlobal = cmdLineParser.parse(options, args); + if (commandLineGlobal.hasOption("f")) { + System.out.println("file to extract : " + commandLineGlobal.getOptionValue("f")); + + openFile(commandLineGlobal.getOptionValue("f")); + readFile(); + + // FrameTlmEntrySat frame; + // try { + // frame = FrameTlmEntrySat.fromFile(commandLineGlobal.getOptionValue("f")); + // Telemetry tlm = new Telemetry(); + // tlm.setValue(frame.frameTlmEntrySat()); + // + // System.out.println(tlm.toStringHeader()); + // System.out.println(tlm.afficheTLM()); + // + // System.out.println(tlm.getValueDecoded(Telemetry.SID)); + // System.out.println(tlm.getValueDecoded(Telemetry.EPS_VBATT)); + // + // } catch (IOException e) { + // // TODO Auto-generated catch block + // e.printStackTrace(); + // } + + } + } catch (ParseException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } + + public void openFile(String file) { + try { + lecteurAvecBuffer = new BufferedReader(new FileReader(file)); + } catch (FileNotFoundException exc) { + System.out.println("Erreur d'ouverture"); + } + } + + public void readFile() { + boolean first = false; + Date dateref = null; + try { + while ((ligne = lecteurAvecBuffer.readLine()) != null) { + // System.out.println(ligne); + String[] result1 = ligne.split("="); + String[] date = result1[1].split("]"); + String[] trame = result1[2].split("]"); + + SimpleDateFormat simpleDateFormat = + new SimpleDateFormat("E MMM dd hh:mm:ss z yyyy", Locale.ENGLISH); + + System.out.println("date : " + date[0] + " - Trame " + trame[0]); + Date date2 = null; + try { + date2 = simpleDateFormat.parse(date[0]); + } catch (java.text.ParseException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + if (!first) { + dateref = date2; + first = true; + } else { + System.out.println((date2.getTime() - dateref.getTime()) / 1000); + } + byte[] tlm = hexStringToByteArray(trame[0]); + FrameTlmEntrySat frame = new FrameTlmEntrySat(new ByteBufferKaitaiStream(tlm)); + Ax25Frame ax = frame.frameTlmEntrySat(); + // System.out.println(ax.ax25Header().destSsidRaw()); + // System.out.println(ax.ax25Header().srcSsidRaw()); + System.out.println(ax.ax25Header().destCallsignRaw().destCallsignRor().destCallsign()); + System.out.println(ax.ax25Header().srcCallsignRaw().srcCallsignRor().srcCallsign()); + + if (ax.ax25Header().destCallsignRaw().destCallsignRor().destCallsign().compareTo("F6KTA ") + == 0) { + // System.out.println(ax.ax25Header().ctl()); + UiFrameTlmEntrySat Ui = (UiFrameTlmEntrySat) ax.payload(); + // System.out.println(Ui.packetheader().version()); + // System.out.println(Ui.packetheader().packetType()); + // System.out.println(Ui.packetheader().packetFlag()); + // System.out.println(Ui.packetheader().packetApid()); + // System.out.println(Ui.packetheader().sequenceControl()); + // System.out.println(Ui.packetheader().packetLenght()); + System.out.println("SID : " + Ui.telemetryData().sid()); + if (Ui.telemetryData().sid() == 1) { + System.err.println("SID valeur 4 "); + System.exit(0); + } + // System.out.println("battTemp : " + Ui.telemetryData().battTemp()); + // System.out.println("eps33VCurrent : " + Ui.telemetryData().eps33VCurrent()); + // System.out.println("eps5VCurrent : " + Ui.telemetryData().eps5VCurrent()); + // System.out.println("epsBattVcurrent : " + Ui.telemetryData().epsBattVcurrent()); + // System.out.println("epsTemp : " + Ui.telemetryData().epsTemp()); + // System.out.println("trxTemp : " + Ui.telemetryData().trxTemp()); + + } else { + System.out.println("SID :"); + } + } + } catch (IOException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } + + public void closeFile() { + try { + lecteurAvecBuffer.close(); + } catch (IOException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } + + public static byte[] hexStringToByteArray(String s) { + byte[] b = new byte[s.length() / 2]; + for (int i = 0; i < b.length; i++) { + int index = i * 2; + int v = Integer.parseInt(s.substring(index, index + 2), 16); + b[i] = (byte) v; + } + return b; + } + + public static void main(String[] args) { + DecodeEntrySatFile decode = new DecodeEntrySatFile(); + decode.execute(args); + } } diff --git a/ModuleEntrySatTelemetry/src/main/java/org/josast/EntrySat/app/DecodeTLM.java b/ModuleEntrySatTelemetry/src/main/java/org/josast/EntrySat/app/DecodeTLM.java index 718f3c99380aa2db1cb2f55194cedf2f3d8d54ed..f4bf2d7060e60e4120c38d5d4af3016847a79593 100644 --- a/ModuleEntrySatTelemetry/src/main/java/org/josast/EntrySat/app/DecodeTLM.java +++ b/ModuleEntrySatTelemetry/src/main/java/org/josast/EntrySat/app/DecodeTLM.java @@ -1,13 +1,11 @@ package org.josast.EntrySat.app; import java.io.IOException; - import org.apache.commons.cli.CommandLine; import org.apache.commons.cli.CommandLineParser; import org.apache.commons.cli.DefaultParser; import org.apache.commons.cli.HelpFormatter; import org.apache.commons.cli.Option; - import org.apache.commons.cli.Options; import org.apache.commons.cli.ParseException; import org.josast.EntrySat.Telemetry; @@ -15,61 +13,57 @@ import org.josast.kaikai.generated.FrameTlmEntrySat; public class DecodeTLM { - private static final String Version = "0.01"; - Options options = new Options(); - HelpFormatter formatter = new HelpFormatter(); - - public DecodeTLM() { - - // automatically generate the help statement - - // create Options object - - // add File option - options.addOption("v", "verbose", false, "display information during the process"); - options.addOption("V", "Version", false, Version); - Option FileOption = Option.builder("f").argName("file").hasArg().desc("Telemery file ").build(); - options.addOption(FileOption); - formatter.printHelp("DecodeTLM", options); - - } - - public void execute(String[] args) { - CommandLineParser cmdLineParser = new DefaultParser(); - CommandLine commandLineGlobal; - try { - commandLineGlobal = cmdLineParser.parse(options, args); - if (commandLineGlobal.hasOption("f")) { - System.out.println("file to extract : " + commandLineGlobal.getOptionValue("f")); - FrameTlmEntrySat frame; - try { - frame = FrameTlmEntrySat.fromFile(commandLineGlobal.getOptionValue("f")); - Telemetry tlm = new Telemetry(); - tlm.setValue(frame.frameTlmEntrySat()); - - System.out.println(tlm.toStringHeader()); - System.out.println(tlm.afficheTLM()); - - System.out.println(tlm.getValueDecoded(Telemetry.SID)); - System.out.println(tlm.getValueDecoded(Telemetry.EPS_VBATT)); - - } catch (IOException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - - } - } catch (ParseException e) { - - - e.printStackTrace(); - } - - } - - public static void main(String[] args) { - DecodeTLM decode = new DecodeTLM(); - decode.execute(args); - } - + private static final String Version = "0.01"; + Options options = new Options(); + HelpFormatter formatter = new HelpFormatter(); + + public DecodeTLM() { + + // automatically generate the help statement + + // create Options object + + // add File option + options.addOption("v", "verbose", false, "display information during the process"); + options.addOption("V", "Version", false, Version); + Option FileOption = + Option.builder("f").argName("file").hasArg().desc("Telemery file ").build(); + options.addOption(FileOption); + formatter.printHelp("DecodeTLM", options); + } + + public void execute(String[] args) { + CommandLineParser cmdLineParser = new DefaultParser(); + CommandLine commandLineGlobal; + try { + commandLineGlobal = cmdLineParser.parse(options, args); + if (commandLineGlobal.hasOption("f")) { + System.out.println("file to extract : " + commandLineGlobal.getOptionValue("f")); + FrameTlmEntrySat frame; + try { + frame = FrameTlmEntrySat.fromFile(commandLineGlobal.getOptionValue("f")); + Telemetry tlm = new Telemetry(); + tlm.setValue(frame.frameTlmEntrySat()); + + System.out.println(tlm.toStringHeader()); + System.out.println(tlm.afficheTLM()); + + System.out.println(tlm.getValueDecoded(Telemetry.SID)); + System.out.println(tlm.getValueDecoded(Telemetry.EPS_VBATT)); + + } catch (IOException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } + } catch (ParseException e) { + + e.printStackTrace(); + } + } + + public static void main(String[] args) { + DecodeTLM decode = new DecodeTLM(); + decode.execute(args); + } } diff --git a/ModuleEntrySatTelemetry/src/main/java/org/josast/EntrySat/app/Testkaikaigenerated.java b/ModuleEntrySatTelemetry/src/main/java/org/josast/EntrySat/app/Testkaikaigenerated.java index 3023585f654c8b188ab59b5f5ef6513bf39bb163..4e0624f054e83defb2c1a61df9e2ba5df08a1c41 100644 --- a/ModuleEntrySatTelemetry/src/main/java/org/josast/EntrySat/app/Testkaikaigenerated.java +++ b/ModuleEntrySatTelemetry/src/main/java/org/josast/EntrySat/app/Testkaikaigenerated.java @@ -1,55 +1,52 @@ package org.josast.EntrySat.app; +import io.kaitai.struct.ByteBufferKaitaiStream; import org.josast.kaikai.generated.FrameTlmEntrySat; import org.josast.kaikai.generated.FrameTlmEntrySat.Ax25Frame; import org.josast.kaikai.generated.FrameTlmEntrySat.UiFrameTlmEntrySat; -import io.kaitai.struct.ByteBufferKaitaiStream; - public class Testkaikaigenerated { - private Testkaikaigenerated() { - - } - - public static void main(String[] args) { - - // FrameTlmEntrySat frame = FrameTlmEntrySat.fromFile("myfile2.dat"); - // byte[] tlm = - // hexStringToByteArray("8c6c96a88240e09e9c60648ca46103f0000000000801c1200017100102249a78f25d1801dc010002a5a52175fe0800001603b0f2789a24c0"); - byte[] tlm = hexStringToByteArray( - "8c6c96a88240e09e9c60648ca46103f0000000000801c729001210031923febdcd170600f16b00009ea0981fc6b009befe23c0"); - FrameTlmEntrySat frame = new FrameTlmEntrySat(new ByteBufferKaitaiStream(tlm)); - Ax25Frame ax = frame.frameTlmEntrySat(); - System.out.println(ax.ax25Header().destSsidRaw()); - System.out.println(ax.ax25Header().srcSsidRaw()); - System.out.println(ax.ax25Header().destCallsignRaw().destCallsignRor().destCallsign()); - System.out.println(ax.ax25Header().srcCallsignRaw().srcCallsignRor().srcCallsign()); - System.out.println(ax.ax25Header().ctl()); - UiFrameTlmEntrySat Ui = (UiFrameTlmEntrySat) ax.payload(); - System.out.println(Ui.packetheader().version()); - System.out.println(Ui.packetheader().packetType()); - System.out.println(Ui.packetheader().packetFlag()); - System.out.println(Ui.packetheader().packetApid()); - System.out.println(Ui.packetheader().sequenceControl()); - System.out.println(Ui.packetheader().packetLenght()); - System.out.println("SID : " + Ui.telemetryData().sid()); - System.out.println("battTemp : " + Ui.telemetryData().battTemp()); - System.out.println("eps33VCurrent : " + Ui.telemetryData().eps33VCurrent()); - System.out.println("eps5VCurrent : " + Ui.telemetryData().eps5VCurrent()); - System.out.println("epsBattVcurrent : " + Ui.telemetryData().epsBattVcurrent()); - System.out.println("epsTemp : " + Ui.telemetryData().epsTemp()); - System.out.println("trxTemp : " + Ui.telemetryData().trxTemp()); - } - - public static byte[] hexStringToByteArray(String s) { - byte[] b = new byte[s.length() / 2]; - for (int i = 0; i < b.length; i++) { - int index = i * 2; - int v = Integer.parseInt(s.substring(index, index + 2), 16); - b[i] = (byte) v; - } - return b; - } - + private Testkaikaigenerated() {} + + public static void main(String[] args) { + + // FrameTlmEntrySat frame = FrameTlmEntrySat.fromFile("myfile2.dat"); + // byte[] tlm = + // hexStringToByteArray("8c6c96a88240e09e9c60648ca46103f0000000000801c1200017100102249a78f25d1801dc010002a5a52175fe0800001603b0f2789a24c0"); + byte[] tlm = + hexStringToByteArray( + "8c6c96a88240e09e9c60648ca46103f0000000000801c729001210031923febdcd170600f16b00009ea0981fc6b009befe23c0"); + FrameTlmEntrySat frame = new FrameTlmEntrySat(new ByteBufferKaitaiStream(tlm)); + Ax25Frame ax = frame.frameTlmEntrySat(); + System.out.println(ax.ax25Header().destSsidRaw()); + System.out.println(ax.ax25Header().srcSsidRaw()); + System.out.println(ax.ax25Header().destCallsignRaw().destCallsignRor().destCallsign()); + System.out.println(ax.ax25Header().srcCallsignRaw().srcCallsignRor().srcCallsign()); + System.out.println(ax.ax25Header().ctl()); + UiFrameTlmEntrySat Ui = (UiFrameTlmEntrySat) ax.payload(); + System.out.println(Ui.packetheader().version()); + System.out.println(Ui.packetheader().packetType()); + System.out.println(Ui.packetheader().packetFlag()); + System.out.println(Ui.packetheader().packetApid()); + System.out.println(Ui.packetheader().sequenceControl()); + System.out.println(Ui.packetheader().packetLenght()); + System.out.println("SID : " + Ui.telemetryData().sid()); + System.out.println("battTemp : " + Ui.telemetryData().battTemp()); + System.out.println("eps33VCurrent : " + Ui.telemetryData().eps33VCurrent()); + System.out.println("eps5VCurrent : " + Ui.telemetryData().eps5VCurrent()); + System.out.println("epsBattVcurrent : " + Ui.telemetryData().epsBattVcurrent()); + System.out.println("epsTemp : " + Ui.telemetryData().epsTemp()); + System.out.println("trxTemp : " + Ui.telemetryData().trxTemp()); + } + + public static byte[] hexStringToByteArray(String s) { + byte[] b = new byte[s.length() / 2]; + for (int i = 0; i < b.length; i++) { + int index = i * 2; + int v = Integer.parseInt(s.substring(index, index + 2), 16); + b[i] = (byte) v; + } + return b; + } } diff --git a/ModuleEntrySatTelemetry/src/main/java/org/josast/TLM/AxBEqx.java b/ModuleEntrySatTelemetry/src/main/java/org/josast/TLM/AxBEqx.java index e6d634a7d47c015111ef52d5ccd4a8181901cb77..97aa9b8fe86017b7d34a074cf65e6c417e49dd7b 100644 --- a/ModuleEntrySatTelemetry/src/main/java/org/josast/TLM/AxBEqx.java +++ b/ModuleEntrySatTelemetry/src/main/java/org/josast/TLM/AxBEqx.java @@ -1,36 +1,34 @@ package org.josast.TLM; public class AxBEqx implements ICalculData { - private double A; - private double B; + private double A; + private double B; - /** - * Constructor with two parameters of the equation A & B - * - * @param a - * @param b - */ - public AxBEqx(double a, double b) { - A = a; - B = b; - } + /** + * Constructor with two parameters of the equation A & B + * + * @param a + * @param b + */ + public AxBEqx(double a, double b) { + A = a; + B = b; + } - /** - * Equation is : y= A x + B - * - * @param x x value - * @return computed value - * @see org.josast.TLM.ICalculData#calcul(int) - */ + /** + * Equation is : y= A x + B + * + * @param x x value + * @return computed value + * @see org.josast.TLM.ICalculData#calcul(int) + */ + @Override + public double calcul(int x) { + // TODO Auto-generated method stub + return (double) x * A + B; + } - @Override - public double calcul(int x) { - // TODO Auto-generated method stub - return (double) x * A + B; - } - - public String toString() { - return "" + A + " x + " + B; - - } + public String toString() { + return "" + A + " x + " + B; + } } diff --git a/ModuleEntrySatTelemetry/src/main/java/org/josast/TLM/AxEqx.java b/ModuleEntrySatTelemetry/src/main/java/org/josast/TLM/AxEqx.java index d37882849d91a9ed8678b441e5fe817bf12457da..18b8807e3b83dcdf5d6e9a8a826902187fddf9fc 100644 --- a/ModuleEntrySatTelemetry/src/main/java/org/josast/TLM/AxEqx.java +++ b/ModuleEntrySatTelemetry/src/main/java/org/josast/TLM/AxEqx.java @@ -1,16 +1,15 @@ package org.josast.TLM; public class AxEqx implements ICalculData { - double a; + double a; - public AxEqx(double a) { - this.a = a; - } - - @Override - public double calcul(int x) { - // TODO Auto-generated method stub - return a * x; - } + public AxEqx(double a) { + this.a = a; + } + @Override + public double calcul(int x) { + // TODO Auto-generated method stub + return a * x; + } } diff --git a/ModuleEntrySatTelemetry/src/main/java/org/josast/TLM/BooleanTLM.java b/ModuleEntrySatTelemetry/src/main/java/org/josast/TLM/BooleanTLM.java index e989c44b2bbb949fed53b00cf3c3eb21a942bb71..5b13487993b54af1837906044b7d1825f7a6e956 100644 --- a/ModuleEntrySatTelemetry/src/main/java/org/josast/TLM/BooleanTLM.java +++ b/ModuleEntrySatTelemetry/src/main/java/org/josast/TLM/BooleanTLM.java @@ -2,42 +2,39 @@ package org.josast.TLM; public class BooleanTLM { - protected boolean[] bool = new boolean[8]; + protected boolean[] bool = new boolean[8]; - public BooleanTLM() { + public BooleanTLM() {} - } + public boolean getValue(int data) { + return this.bool[data]; + } - public boolean getValue(int data) { - return this.bool[data]; - } + public boolean[] convertToBoolean(int in, int lengh) { - public boolean[] convertToBoolean(int in, int lengh) { + String maxAmpStr = Integer.toBinaryString(in); + char[] arr = maxAmpStr.toCharArray(); + boolean[] bool = new boolean[lengh]; + int j = 0; + for (int i = arr.length - 1; i >= 0; i--) { + if (arr[i] == '1') { + bool[j++] = true; + } else if (arr[i] == '0') { + bool[j++] = false; + } + } - String maxAmpStr = Integer.toBinaryString(in); - char[] arr = maxAmpStr.toCharArray(); - boolean[] bool = new boolean[lengh]; - int j = 0; - for (int i = arr.length - 1; i >= 0; i--) { - if (arr[i] == '1') { - bool[j++] = true; - } else if (arr[i] == '0') { - bool[j++] = false; - } - } + return bool; + } - return bool; - } + public String toString() { - public String toString() { + StringBuilder stringBuilder = new StringBuilder(); + for (int j = 0; j < 8; j++) { - StringBuilder stringBuilder = new StringBuilder(); - for (int j = 0; j < 8; j++) { - - stringBuilder.append(bool[j] + ","); - } - - return stringBuilder.toString(); - } + stringBuilder.append(bool[j] + ","); + } + return stringBuilder.toString(); + } } diff --git a/ModuleEntrySatTelemetry/src/main/java/org/josast/TLM/CubicEqx.java b/ModuleEntrySatTelemetry/src/main/java/org/josast/TLM/CubicEqx.java index a068f046e84c154a0c407d86d4b0c3298d50177f..e6e0db80b90d8c6d6888f2ea5bd02fc5448e6ca7 100644 --- a/ModuleEntrySatTelemetry/src/main/java/org/josast/TLM/CubicEqx.java +++ b/ModuleEntrySatTelemetry/src/main/java/org/josast/TLM/CubicEqx.java @@ -3,45 +3,40 @@ package org.josast.TLM; /** * Calculate Cubix equation
* Ax3+bx2+Cx+d
- * - * @author Christophe * + * @author Christophe */ public class CubicEqx implements ICalculData { - double A; - double B; - double C; - double D; - - /** - * The Constructor. - * - * @param d the d - * @param a the a - * @param c the c - * @param b the b - */ - public CubicEqx(double a, double b, double c, double d) { - super(); - A = a; - B = b; - C = c; - D = d; - } + double A; + double B; + double C; + double D; - /** - * Calcul. - * - * @param x the x - * - * @return the double - * - * - */ - public double calcul(int x) { + /** + * The Constructor. + * + * @param d the d + * @param a the a + * @param c the c + * @param b the b + */ + public CubicEqx(double a, double b, double c, double d) { + super(); + A = a; + B = b; + C = c; + D = d; + } - return A * Math.pow(x, 3) + B * Math.pow(x, 2) + C * x + D; - } + /** + * Calcul. + * + * @param x the x + * @return the double + */ + public double calcul(int x) { + return A * Math.pow(x, 3) + B * Math.pow(x, 2) + C * x + D; + } } diff --git a/ModuleEntrySatTelemetry/src/main/java/org/josast/TLM/ICalculData.java b/ModuleEntrySatTelemetry/src/main/java/org/josast/TLM/ICalculData.java index 8890d6873d505c2cd801c01ca828f0af6a00f7d7..e7cef704867130291847d2aa64b8ce3d910d37cf 100644 --- a/ModuleEntrySatTelemetry/src/main/java/org/josast/TLM/ICalculData.java +++ b/ModuleEntrySatTelemetry/src/main/java/org/josast/TLM/ICalculData.java @@ -1,17 +1,12 @@ package org.josast.TLM; -/** - * - * - * @author Christophe - * - */ +/** @author Christophe */ public interface ICalculData { - /** - * compute the value of X - * - * @param x x used by the equation - * @return y - */ - double calcul(int x); + /** + * compute the value of X + * + * @param x x used by the equation + * @return y + */ + double calcul(int x); } diff --git a/ModuleEntrySatTelemetry/src/main/java/org/josast/TLM/TlmData.java b/ModuleEntrySatTelemetry/src/main/java/org/josast/TLM/TlmData.java index 65ba050bd04f7856a34b5b04b3a8d18f97af1155..aa6d79837af7cbc146b4183f9ffe8a26308d3cd8 100644 --- a/ModuleEntrySatTelemetry/src/main/java/org/josast/TLM/TlmData.java +++ b/ModuleEntrySatTelemetry/src/main/java/org/josast/TLM/TlmData.java @@ -1,101 +1,97 @@ package org.josast.TLM; -/** - * @author Christophe - * - */ +/** @author Christophe */ public class TlmData { - /** The name. */ - private String name; - - /** The formulae. */ - private ICalculData formulae; - - /** The unit. */ - private String unit; - - private String format; - - /** - * The Constructor. - * - * @param unit the unit - * @param formulae the formulae - * @param name the name - */ - public TlmData(String name, ICalculData formulae, String unit, String formatDislay) { - super(); - this.name = name; - this.formulae = formulae; - this.unit = unit; - this.format = formatDislay; - } - - public String getFormat() { - return format; - } - - public void setFormat(String format) { - this.format = format; - } - - /** - * Gets the formulae. - * - * @return the formulae - */ - public ICalculData getFormulae() { - return formulae; - } - - /** - * Sets the formulae. - * - * @param formulae the formulae - */ - public void setFormulae(ICalculData formulae) { - this.formulae = formulae; - } - - /** - * Gets the name. - * - * @return the name - */ - public String getName() { - return name; - } - - /** - * Sets the name. - * - * @param name the name - */ - public void setName(String name) { - this.name = name; - } - - /** - * Gets the unit. - * - * @return the unit - */ - public String getUnit() { - return unit; - } - - /** - * Sets the unit. - * - * @param unit the unit - */ - public void setUnit(String unit) { - this.unit = unit; - } - - public String toString() { - return "" + name + ":" + formulae.toString() + " " + unit; - - } + /** The name. */ + private String name; + + /** The formulae. */ + private ICalculData formulae; + + /** The unit. */ + private String unit; + + private String format; + + /** + * The Constructor. + * + * @param unit the unit + * @param formulae the formulae + * @param name the name + */ + public TlmData(String name, ICalculData formulae, String unit, String formatDislay) { + super(); + this.name = name; + this.formulae = formulae; + this.unit = unit; + this.format = formatDislay; + } + + public String getFormat() { + return format; + } + + public void setFormat(String format) { + this.format = format; + } + + /** + * Gets the formulae. + * + * @return the formulae + */ + public ICalculData getFormulae() { + return formulae; + } + + /** + * Sets the formulae. + * + * @param formulae the formulae + */ + public void setFormulae(ICalculData formulae) { + this.formulae = formulae; + } + + /** + * Gets the name. + * + * @return the name + */ + public String getName() { + return name; + } + + /** + * Sets the name. + * + * @param name the name + */ + public void setName(String name) { + this.name = name; + } + + /** + * Gets the unit. + * + * @return the unit + */ + public String getUnit() { + return unit; + } + + /** + * Sets the unit. + * + * @param unit the unit + */ + public void setUnit(String unit) { + this.unit = unit; + } + + public String toString() { + return "" + name + ":" + formulae.toString() + " " + unit; + } } diff --git a/ModuleEntrySatTelemetry/src/main/java/org/josast/TLM/xEqx.java b/ModuleEntrySatTelemetry/src/main/java/org/josast/TLM/xEqx.java index ac8f63959a7561c266daf2022784d8f33345a3ec..58e36e572e1edda84742c10576242c0d84640d02 100644 --- a/ModuleEntrySatTelemetry/src/main/java/org/josast/TLM/xEqx.java +++ b/ModuleEntrySatTelemetry/src/main/java/org/josast/TLM/xEqx.java @@ -2,10 +2,9 @@ package org.josast.TLM; public class xEqx implements ICalculData { - @Override - public double calcul(int x) { - - return (double) x; - } + @Override + public double calcul(int x) { + return (double) x; + } } diff --git a/ModuleEntrySatTelemetry/src/main/java/org/josast/kaikai/generated/FrameTlmEntrySat.java b/ModuleEntrySatTelemetry/src/main/java/org/josast/kaikai/generated/FrameTlmEntrySat.java index 6da447dd675fe3ba7eb3041e137b638a7802eba3..6e6b73261b134fe1a6a2f5edb1c0de85083627ff 100644 --- a/ModuleEntrySatTelemetry/src/main/java/org/josast/kaikai/generated/FrameTlmEntrySat.java +++ b/ModuleEntrySatTelemetry/src/main/java/org/josast/kaikai/generated/FrameTlmEntrySat.java @@ -1,776 +1,773 @@ package org.josast.kaikai.generated; -//This is a generated file! Please edit source .ksy file and use kaitai-struct-compiler to rebuild +// This is a generated file! Please edit source .ksy file and use kaitai-struct-compiler to rebuild import io.kaitai.struct.ByteBufferKaitaiStream; -import io.kaitai.struct.KaitaiStruct; import io.kaitai.struct.KaitaiStream; +import io.kaitai.struct.KaitaiStruct; import java.io.IOException; import java.nio.charset.Charset; public class FrameTlmEntrySat extends KaitaiStruct { - public static FrameTlmEntrySat fromFile(String fileName) throws IOException { - return new FrameTlmEntrySat(new ByteBufferKaitaiStream(fileName)); - } - - public FrameTlmEntrySat(KaitaiStream _io) { - this(_io, null, null); - } - - public FrameTlmEntrySat(KaitaiStream _io, KaitaiStruct _parent) { - this(_io, _parent, null); - } - - public FrameTlmEntrySat(KaitaiStream _io, KaitaiStruct _parent, FrameTlmEntrySat _root) { - super(_io); - this._parent = _parent; - this._root = _root == null ? this : _root; - _read(); - } - - private void _read() { - this.frameTlmEntrySat = new Ax25Frame(this._io, this, _root); - } - - public static class Ax25Frame extends KaitaiStruct { - public static Ax25Frame fromFile(String fileName) throws IOException { - return new Ax25Frame(new ByteBufferKaitaiStream(fileName)); - } - - public Ax25Frame(KaitaiStream _io) { - this(_io, null, null); - } - - public Ax25Frame(KaitaiStream _io, FrameTlmEntrySat _parent) { - this(_io, _parent, null); - } - - public Ax25Frame(KaitaiStream _io, FrameTlmEntrySat _parent, FrameTlmEntrySat _root) { - super(_io); - this._parent = _parent; - this._root = _root; - _read(); - } - - private void _read() { - this.ax25Header = new Ax25Header(this._io, this, _root); - switch ((ax25Header().ctl() & 19)) { - case 0: { - this.payload = new IFrame(this._io, this, _root); - break; - } - case 3: { - this.payload = new UiFrameTlmEntrySat(this._io, this, _root); - break; - } - case 19: { - this.payload = new IFrame(this._io, this, _root); - break; - } - case 16: { - this.payload = new IFrame(this._io, this, _root); - break; - } - case 18: { - this.payload = new IFrame(this._io, this, _root); - break; - } - case 2: { - this.payload = new IFrame(this._io, this, _root); - break; - } - } - } - - private Ax25Header ax25Header; - private KaitaiStruct payload; - private FrameTlmEntrySat _root; - private FrameTlmEntrySat _parent; - - public Ax25Header ax25Header() { - return ax25Header; - } - - public KaitaiStruct payload() { - return payload; - } - - public FrameTlmEntrySat _root() { - return _root; - } - - public FrameTlmEntrySat _parent() { - return _parent; - } - } - - public static class UiFrameTlmEntrySat extends KaitaiStruct { - public static UiFrameTlmEntrySat fromFile(String fileName) throws IOException { - return new UiFrameTlmEntrySat(new ByteBufferKaitaiStream(fileName)); - } - - public UiFrameTlmEntrySat(KaitaiStream _io) { - this(_io, null, null); - } - - public UiFrameTlmEntrySat(KaitaiStream _io, FrameTlmEntrySat.Ax25Frame _parent) { - this(_io, _parent, null); - } - - public UiFrameTlmEntrySat(KaitaiStream _io, FrameTlmEntrySat.Ax25Frame _parent, FrameTlmEntrySat _root) { - super(_io); - this._parent = _parent; - this._root = _root; - _read(); - } - - private void _read() { - this.pid = this._io.readU1(); - this.time = this._io.readU4be(); - this.packetheader = new Packetheader(this._io, this, _root); - this.telemetryDataFiledHearder = new TelemetryDataFiledHearder(this._io, this, _root); - this.telemetryData = new TelemetryData(this._io, this, _root); - this.ax25Info = this._io.readBytesFull(); - } - - private int pid; - private long time; - private Packetheader packetheader; - private TelemetryDataFiledHearder telemetryDataFiledHearder; - private TelemetryData telemetryData; - private byte[] ax25Info; - private FrameTlmEntrySat _root; - private FrameTlmEntrySat.Ax25Frame _parent; - - public int pid() { - return pid; - } - - public long time() { - return time; - } - - public Packetheader packetheader() { - return packetheader; - } - - public TelemetryDataFiledHearder telemetryDataFiledHearder() { - return telemetryDataFiledHearder; - } - - public TelemetryData telemetryData() { - return telemetryData; - } - - public byte[] ax25Info() { - return ax25Info; - } - - public FrameTlmEntrySat _root() { - return _root; - } - - public FrameTlmEntrySat.Ax25Frame _parent() { - return _parent; - } - } - - public static class DestCallsign extends KaitaiStruct { - public static DestCallsign fromFile(String fileName) throws IOException { - return new DestCallsign(new ByteBufferKaitaiStream(fileName)); - } - - public DestCallsign(KaitaiStream _io) { - this(_io, null, null); - } - - public DestCallsign(KaitaiStream _io, FrameTlmEntrySat.DestCallsignRaw _parent) { - this(_io, _parent, null); - } - - public DestCallsign(KaitaiStream _io, FrameTlmEntrySat.DestCallsignRaw _parent, FrameTlmEntrySat _root) { - super(_io); - this._parent = _parent; - this._root = _root; - _read(); - } - - private void _read() { - this.destCallsign = new String(this._io.readBytes(6), Charset.forName("ASCII")); - } - - private String destCallsign; - private FrameTlmEntrySat _root; - private FrameTlmEntrySat.DestCallsignRaw _parent; - - public String destCallsign() { - return destCallsign; - } - - public FrameTlmEntrySat _root() { - return _root; - } - - public FrameTlmEntrySat.DestCallsignRaw _parent() { - return _parent; - } - } - - public static class Ax25Header extends KaitaiStruct { - public static Ax25Header fromFile(String fileName) throws IOException { - return new Ax25Header(new ByteBufferKaitaiStream(fileName)); - } - - public Ax25Header(KaitaiStream _io) { - this(_io, null, null); - } - - public Ax25Header(KaitaiStream _io, FrameTlmEntrySat.Ax25Frame _parent) { - this(_io, _parent, null); - } - - public Ax25Header(KaitaiStream _io, FrameTlmEntrySat.Ax25Frame _parent, FrameTlmEntrySat _root) { - super(_io); - this._parent = _parent; - this._root = _root; - _read(); - } - - private void _read() { - this.destCallsignRaw = new DestCallsignRaw(this._io, this, _root); - this.destSsidRaw = this._io.readU1(); - this.srcCallsignRaw = new SrcCallsignRaw(this._io, this, _root); - this.srcSsidRaw = this._io.readU1(); - this.ctl = this._io.readU1(); - } - - private Integer srcSsid; - - public Integer srcSsid() { - if (this.srcSsid != null) - return this.srcSsid; - int _tmp = (int) (((srcSsidRaw() & 15) >> 1)); - this.srcSsid = _tmp; - return this.srcSsid; - } - - private Integer destSsid; - - public Integer destSsid() { - if (this.destSsid != null) - return this.destSsid; - int _tmp = (int) (((destSsidRaw() & 15) >> 1)); - this.destSsid = _tmp; - return this.destSsid; - } - - private DestCallsignRaw destCallsignRaw; - private int destSsidRaw; - private SrcCallsignRaw srcCallsignRaw; - private int srcSsidRaw; - private int ctl; - private FrameTlmEntrySat _root; - private FrameTlmEntrySat.Ax25Frame _parent; - - public DestCallsignRaw destCallsignRaw() { - return destCallsignRaw; - } - - public int destSsidRaw() { - return destSsidRaw; - } - - public SrcCallsignRaw srcCallsignRaw() { - return srcCallsignRaw; - } - - public int srcSsidRaw() { - return srcSsidRaw; - } - - public int ctl() { - return ctl; - } - - public FrameTlmEntrySat _root() { - return _root; - } - - public FrameTlmEntrySat.Ax25Frame _parent() { - return _parent; - } - } - - public static class SrcCallsignRaw extends KaitaiStruct { - public static SrcCallsignRaw fromFile(String fileName) throws IOException { - return new SrcCallsignRaw(new ByteBufferKaitaiStream(fileName)); - } - - public SrcCallsignRaw(KaitaiStream _io) { - this(_io, null, null); - } - - public SrcCallsignRaw(KaitaiStream _io, FrameTlmEntrySat.Ax25Header _parent) { - this(_io, _parent, null); - } - - public SrcCallsignRaw(KaitaiStream _io, FrameTlmEntrySat.Ax25Header _parent, FrameTlmEntrySat _root) { - super(_io); - this._parent = _parent; - this._root = _root; - _read(); - } - - private void _read() { - this._raw__raw_srcCallsignRor = this._io.readBytes(6); - this._raw_srcCallsignRor = KaitaiStream.processRotateLeft(this._raw__raw_srcCallsignRor, 8 - (1), 1); - KaitaiStream _io__raw_srcCallsignRor = new ByteBufferKaitaiStream(_raw_srcCallsignRor); - this.srcCallsignRor = new SrcCallsign(_io__raw_srcCallsignRor, this, _root); - } - - private SrcCallsign srcCallsignRor; - private FrameTlmEntrySat _root; - private FrameTlmEntrySat.Ax25Header _parent; - private byte[] _raw__raw_srcCallsignRor; - private byte[] _raw_srcCallsignRor; - - public SrcCallsign srcCallsignRor() { - return srcCallsignRor; - } - - public FrameTlmEntrySat _root() { - return _root; - } - - public FrameTlmEntrySat.Ax25Header _parent() { - return _parent; - } - - public byte[] _raw__raw_srcCallsignRor() { - return _raw__raw_srcCallsignRor; - } - - public byte[] _raw_srcCallsignRor() { - return _raw_srcCallsignRor; - } - } - - public static class IFrame extends KaitaiStruct { - public static IFrame fromFile(String fileName) throws IOException { - return new IFrame(new ByteBufferKaitaiStream(fileName)); - } - - public IFrame(KaitaiStream _io) { - this(_io, null, null); - } - - public IFrame(KaitaiStream _io, FrameTlmEntrySat.Ax25Frame _parent) { - this(_io, _parent, null); - } - - public IFrame(KaitaiStream _io, FrameTlmEntrySat.Ax25Frame _parent, FrameTlmEntrySat _root) { - super(_io); - this._parent = _parent; - this._root = _root; - _read(); - } - - private void _read() { - this.pid = this._io.readU1(); - this.ax25Info = this._io.readBytesFull(); - } - - private int pid; - private byte[] ax25Info; - private FrameTlmEntrySat _root; - private FrameTlmEntrySat.Ax25Frame _parent; - - public int pid() { - return pid; - } - - public byte[] ax25Info() { - return ax25Info; - } - - public FrameTlmEntrySat _root() { - return _root; - } - - public FrameTlmEntrySat.Ax25Frame _parent() { - return _parent; - } - } - - public static class TelemetryDataFiledHearder extends KaitaiStruct { - public static TelemetryDataFiledHearder fromFile(String fileName) throws IOException { - return new TelemetryDataFiledHearder(new ByteBufferKaitaiStream(fileName)); - } - - public TelemetryDataFiledHearder(KaitaiStream _io) { - this(_io, null, null); - } - - public TelemetryDataFiledHearder(KaitaiStream _io, FrameTlmEntrySat.UiFrameTlmEntrySat _parent) { - this(_io, _parent, null); - } - - public TelemetryDataFiledHearder(KaitaiStream _io, FrameTlmEntrySat.UiFrameTlmEntrySat _parent, - FrameTlmEntrySat _root) { - super(_io); - this._parent = _parent; - this._root = _root; - _read(); - } - - private void _read() { - this.spare1 = this._io.readBitsInt(1) != 0; - this.pusVersion = this._io.readBitsInt(3); - this.spare2 = this._io.readBitsInt(4); - this._io.alignToByte(); - this.service = this._io.readU1(); - this.serviceSubtype = this._io.readU1(); - this.time2 = this._io.readBytes(5); - } - - private boolean spare1; - private long pusVersion; - private long spare2; - private int service; - private int serviceSubtype; - private byte[] time2; - private FrameTlmEntrySat _root; - private FrameTlmEntrySat.UiFrameTlmEntrySat _parent; - - public boolean spare1() { - return spare1; - } - - public long pusVersion() { - return pusVersion; - } - - public long spare2() { - return spare2; - } - - public int service() { - return service; - } - - public int serviceSubtype() { - return serviceSubtype; - } - - public byte[] time2() { - return time2; - } - - public FrameTlmEntrySat _root() { - return _root; - } - - public FrameTlmEntrySat.UiFrameTlmEntrySat _parent() { - return _parent; - } - } - - public static class TelemetryData extends KaitaiStruct { - public static TelemetryData fromFile(String fileName) throws IOException { - return new TelemetryData(new ByteBufferKaitaiStream(fileName)); - } - - public TelemetryData(KaitaiStream _io) { - this(_io, null, null); - } - - public TelemetryData(KaitaiStream _io, FrameTlmEntrySat.UiFrameTlmEntrySat _parent) { - this(_io, _parent, null); - } - - public TelemetryData(KaitaiStream _io, FrameTlmEntrySat.UiFrameTlmEntrySat _parent, FrameTlmEntrySat _root) { - super(_io); - this._parent = _parent; - this._root = _root; - _read(); - } - - private void _read() { - this.sid = this._io.readU1(); - this.modeSafe = this._io.readU1(); - this.epsVbatt = this._io.readU1(); - this.epsBattVcurrent = this._io.readU1(); - this.eps33VCurrent = this._io.readU1(); - this.eps5VCurrent = this._io.readU1(); - this.trxTemp = this._io.readU1(); - this.epsTemp = this._io.readU1(); - this.battTemp = this._io.readU1(); - } - - private int sid; - private int modeSafe; - private int epsVbatt; - private int epsBattVcurrent; - private int eps33VCurrent; - private int eps5VCurrent; - private int trxTemp; - private int epsTemp; - private int battTemp; - private FrameTlmEntrySat _root; - private FrameTlmEntrySat.UiFrameTlmEntrySat _parent; - - public int sid() { - return sid; - } - - /** - * Operational status. 0 = Safe mode 1 = Orbital or Entry mode - */ - public int modeSafe() { - return modeSafe; - } - - /** - * Battery voltage in V formulae ð?‘¦ = 3 + 0.05×ð??Š - */ - public int epsVbatt() { - return epsVbatt; - } - - /** - * Battery bus current in A formulae ð?‘¦ = −1 + 0.0078740×ð?‘¥ - */ - public int epsBattVcurrent() { - return epsBattVcurrent; - } - - /** - * 3.3V bus current in A formulae ð?‘¦ = 0.025*x - */ - public int eps33VCurrent() { - return eps33VCurrent; - } - - /** - * 5V bus current in A formulae ð?‘¦ = 0.025*x - */ - public int eps5VCurrent() { - return eps5VCurrent; - } - - /** - * Transceiver’s temperature in °C formulae ð?‘¦ = −15 + 0.25×ð?‘¥ - */ - public int trxTemp() { - return trxTemp; - } - - /** - * Power system’s temperature °C formulae ð?‘¦ = −15 + 0.25×ð?‘¥ - */ - public int epsTemp() { - return epsTemp; - } - - /** - * Batteries temperature in °C formulae ð?‘¦ = −15 + 0.25×ð?‘¥ - */ - public int battTemp() { - return battTemp; - } - - public FrameTlmEntrySat _root() { - return _root; - } - - public FrameTlmEntrySat.UiFrameTlmEntrySat _parent() { - return _parent; - } - } - - public static class Packetheader extends KaitaiStruct { - public static Packetheader fromFile(String fileName) throws IOException { - return new Packetheader(new ByteBufferKaitaiStream(fileName)); - } - - public Packetheader(KaitaiStream _io) { - this(_io, null, null); - } - - public Packetheader(KaitaiStream _io, FrameTlmEntrySat.UiFrameTlmEntrySat _parent) { - this(_io, _parent, null); - } - - public Packetheader(KaitaiStream _io, FrameTlmEntrySat.UiFrameTlmEntrySat _parent, FrameTlmEntrySat _root) { - super(_io); - this._parent = _parent; - this._root = _root; - _read(); - } - - private void _read() { - this.version = this._io.readBitsInt(3); - this.packetType = this._io.readBitsInt(1) != 0; - this.packetFlag = this._io.readBitsInt(1) != 0; - this.packetApid = this._io.readBitsInt(11); - this._io.alignToByte(); - this.sequenceControl = this._io.readU2be(); - this.packetLenght = this._io.readU2be(); - } - - private long version; - private boolean packetType; - private boolean packetFlag; - private long packetApid; - private int sequenceControl; - private int packetLenght; - private FrameTlmEntrySat _root; - private FrameTlmEntrySat.UiFrameTlmEntrySat _parent; - - public long version() { - return version; - } - - public boolean packetType() { - return packetType; - } - - public boolean packetFlag() { - return packetFlag; - } - - public long packetApid() { - return packetApid; - } - - public int sequenceControl() { - return sequenceControl; - } - - public int packetLenght() { - return packetLenght; - } - - public FrameTlmEntrySat _root() { - return _root; - } - - public FrameTlmEntrySat.UiFrameTlmEntrySat _parent() { - return _parent; - } - } - - public static class DestCallsignRaw extends KaitaiStruct { - public static DestCallsignRaw fromFile(String fileName) throws IOException { - return new DestCallsignRaw(new ByteBufferKaitaiStream(fileName)); - } - - public DestCallsignRaw(KaitaiStream _io) { - this(_io, null, null); - } - - public DestCallsignRaw(KaitaiStream _io, FrameTlmEntrySat.Ax25Header _parent) { - this(_io, _parent, null); - } - - public DestCallsignRaw(KaitaiStream _io, FrameTlmEntrySat.Ax25Header _parent, FrameTlmEntrySat _root) { - super(_io); - this._parent = _parent; - this._root = _root; - _read(); - } - - private void _read() { - this._raw__raw_destCallsignRor = this._io.readBytes(6); - this._raw_destCallsignRor = KaitaiStream.processRotateLeft(this._raw__raw_destCallsignRor, 8 - (1), 1); - KaitaiStream _io__raw_destCallsignRor = new ByteBufferKaitaiStream(_raw_destCallsignRor); - this.destCallsignRor = new DestCallsign(_io__raw_destCallsignRor, this, _root); - } - - private DestCallsign destCallsignRor; - private FrameTlmEntrySat _root; - private FrameTlmEntrySat.Ax25Header _parent; - private byte[] _raw__raw_destCallsignRor; - private byte[] _raw_destCallsignRor; - - public DestCallsign destCallsignRor() { - return destCallsignRor; - } - - public FrameTlmEntrySat _root() { - return _root; - } - - public FrameTlmEntrySat.Ax25Header _parent() { - return _parent; - } - - public byte[] _raw__raw_destCallsignRor() { - return _raw__raw_destCallsignRor; - } - - public byte[] _raw_destCallsignRor() { - return _raw_destCallsignRor; - } - } - - public static class SrcCallsign extends KaitaiStruct { - public static SrcCallsign fromFile(String fileName) throws IOException { - return new SrcCallsign(new ByteBufferKaitaiStream(fileName)); - } - - public SrcCallsign(KaitaiStream _io) { - this(_io, null, null); - } - - public SrcCallsign(KaitaiStream _io, FrameTlmEntrySat.SrcCallsignRaw _parent) { - this(_io, _parent, null); - } - - public SrcCallsign(KaitaiStream _io, FrameTlmEntrySat.SrcCallsignRaw _parent, FrameTlmEntrySat _root) { - super(_io); - this._parent = _parent; - this._root = _root; - _read(); - } - - private void _read() { - this.srcCallsign = new String(this._io.readBytes(6), Charset.forName("ASCII")); - } - - private String srcCallsign; - private FrameTlmEntrySat _root; - private FrameTlmEntrySat.SrcCallsignRaw _parent; - - public String srcCallsign() { - return srcCallsign; - } - - public FrameTlmEntrySat _root() { - return _root; - } - - public FrameTlmEntrySat.SrcCallsignRaw _parent() { - return _parent; - } - } - - private Ax25Frame frameTlmEntrySat; - private FrameTlmEntrySat _root; - private KaitaiStruct _parent; - - /** - * @see Source - */ - public Ax25Frame frameTlmEntrySat() { - return frameTlmEntrySat; - } - - public FrameTlmEntrySat _root() { - return _root; - } - - public KaitaiStruct _parent() { - return _parent; - } + public static FrameTlmEntrySat fromFile(String fileName) throws IOException { + return new FrameTlmEntrySat(new ByteBufferKaitaiStream(fileName)); + } + + public FrameTlmEntrySat(KaitaiStream _io) { + this(_io, null, null); + } + + public FrameTlmEntrySat(KaitaiStream _io, KaitaiStruct _parent) { + this(_io, _parent, null); + } + + public FrameTlmEntrySat(KaitaiStream _io, KaitaiStruct _parent, FrameTlmEntrySat _root) { + super(_io); + this._parent = _parent; + this._root = _root == null ? this : _root; + _read(); + } + + private void _read() { + this.frameTlmEntrySat = new Ax25Frame(this._io, this, _root); + } + + public static class Ax25Frame extends KaitaiStruct { + public static Ax25Frame fromFile(String fileName) throws IOException { + return new Ax25Frame(new ByteBufferKaitaiStream(fileName)); + } + + public Ax25Frame(KaitaiStream _io) { + this(_io, null, null); + } + + public Ax25Frame(KaitaiStream _io, FrameTlmEntrySat _parent) { + this(_io, _parent, null); + } + + public Ax25Frame(KaitaiStream _io, FrameTlmEntrySat _parent, FrameTlmEntrySat _root) { + super(_io); + this._parent = _parent; + this._root = _root; + _read(); + } + + private void _read() { + this.ax25Header = new Ax25Header(this._io, this, _root); + switch ((ax25Header().ctl() & 19)) { + case 0: + { + this.payload = new IFrame(this._io, this, _root); + break; + } + case 3: + { + this.payload = new UiFrameTlmEntrySat(this._io, this, _root); + break; + } + case 19: + { + this.payload = new IFrame(this._io, this, _root); + break; + } + case 16: + { + this.payload = new IFrame(this._io, this, _root); + break; + } + case 18: + { + this.payload = new IFrame(this._io, this, _root); + break; + } + case 2: + { + this.payload = new IFrame(this._io, this, _root); + break; + } + } + } + + private Ax25Header ax25Header; + private KaitaiStruct payload; + private FrameTlmEntrySat _root; + private FrameTlmEntrySat _parent; + + public Ax25Header ax25Header() { + return ax25Header; + } + + public KaitaiStruct payload() { + return payload; + } + + public FrameTlmEntrySat _root() { + return _root; + } + + public FrameTlmEntrySat _parent() { + return _parent; + } + } + + public static class UiFrameTlmEntrySat extends KaitaiStruct { + public static UiFrameTlmEntrySat fromFile(String fileName) throws IOException { + return new UiFrameTlmEntrySat(new ByteBufferKaitaiStream(fileName)); + } + + public UiFrameTlmEntrySat(KaitaiStream _io) { + this(_io, null, null); + } + + public UiFrameTlmEntrySat(KaitaiStream _io, FrameTlmEntrySat.Ax25Frame _parent) { + this(_io, _parent, null); + } + + public UiFrameTlmEntrySat( + KaitaiStream _io, FrameTlmEntrySat.Ax25Frame _parent, FrameTlmEntrySat _root) { + super(_io); + this._parent = _parent; + this._root = _root; + _read(); + } + + private void _read() { + this.pid = this._io.readU1(); + this.time = this._io.readU4be(); + this.packetheader = new Packetheader(this._io, this, _root); + this.telemetryDataFiledHearder = new TelemetryDataFiledHearder(this._io, this, _root); + this.telemetryData = new TelemetryData(this._io, this, _root); + this.ax25Info = this._io.readBytesFull(); + } + + private int pid; + private long time; + private Packetheader packetheader; + private TelemetryDataFiledHearder telemetryDataFiledHearder; + private TelemetryData telemetryData; + private byte[] ax25Info; + private FrameTlmEntrySat _root; + private FrameTlmEntrySat.Ax25Frame _parent; + + public int pid() { + return pid; + } + + public long time() { + return time; + } + + public Packetheader packetheader() { + return packetheader; + } + + public TelemetryDataFiledHearder telemetryDataFiledHearder() { + return telemetryDataFiledHearder; + } + + public TelemetryData telemetryData() { + return telemetryData; + } + + public byte[] ax25Info() { + return ax25Info; + } + + public FrameTlmEntrySat _root() { + return _root; + } + + public FrameTlmEntrySat.Ax25Frame _parent() { + return _parent; + } + } + + public static class DestCallsign extends KaitaiStruct { + public static DestCallsign fromFile(String fileName) throws IOException { + return new DestCallsign(new ByteBufferKaitaiStream(fileName)); + } + + public DestCallsign(KaitaiStream _io) { + this(_io, null, null); + } + + public DestCallsign(KaitaiStream _io, FrameTlmEntrySat.DestCallsignRaw _parent) { + this(_io, _parent, null); + } + + public DestCallsign( + KaitaiStream _io, FrameTlmEntrySat.DestCallsignRaw _parent, FrameTlmEntrySat _root) { + super(_io); + this._parent = _parent; + this._root = _root; + _read(); + } + + private void _read() { + this.destCallsign = new String(this._io.readBytes(6), Charset.forName("ASCII")); + } + + private String destCallsign; + private FrameTlmEntrySat _root; + private FrameTlmEntrySat.DestCallsignRaw _parent; + + public String destCallsign() { + return destCallsign; + } + + public FrameTlmEntrySat _root() { + return _root; + } + + public FrameTlmEntrySat.DestCallsignRaw _parent() { + return _parent; + } + } + + public static class Ax25Header extends KaitaiStruct { + public static Ax25Header fromFile(String fileName) throws IOException { + return new Ax25Header(new ByteBufferKaitaiStream(fileName)); + } + + public Ax25Header(KaitaiStream _io) { + this(_io, null, null); + } + + public Ax25Header(KaitaiStream _io, FrameTlmEntrySat.Ax25Frame _parent) { + this(_io, _parent, null); + } + + public Ax25Header( + KaitaiStream _io, FrameTlmEntrySat.Ax25Frame _parent, FrameTlmEntrySat _root) { + super(_io); + this._parent = _parent; + this._root = _root; + _read(); + } + + private void _read() { + this.destCallsignRaw = new DestCallsignRaw(this._io, this, _root); + this.destSsidRaw = this._io.readU1(); + this.srcCallsignRaw = new SrcCallsignRaw(this._io, this, _root); + this.srcSsidRaw = this._io.readU1(); + this.ctl = this._io.readU1(); + } + + private Integer srcSsid; + + public Integer srcSsid() { + if (this.srcSsid != null) return this.srcSsid; + int _tmp = (int) (((srcSsidRaw() & 15) >> 1)); + this.srcSsid = _tmp; + return this.srcSsid; + } + + private Integer destSsid; + + public Integer destSsid() { + if (this.destSsid != null) return this.destSsid; + int _tmp = (int) (((destSsidRaw() & 15) >> 1)); + this.destSsid = _tmp; + return this.destSsid; + } + + private DestCallsignRaw destCallsignRaw; + private int destSsidRaw; + private SrcCallsignRaw srcCallsignRaw; + private int srcSsidRaw; + private int ctl; + private FrameTlmEntrySat _root; + private FrameTlmEntrySat.Ax25Frame _parent; + + public DestCallsignRaw destCallsignRaw() { + return destCallsignRaw; + } + + public int destSsidRaw() { + return destSsidRaw; + } + + public SrcCallsignRaw srcCallsignRaw() { + return srcCallsignRaw; + } + + public int srcSsidRaw() { + return srcSsidRaw; + } + + public int ctl() { + return ctl; + } + + public FrameTlmEntrySat _root() { + return _root; + } + + public FrameTlmEntrySat.Ax25Frame _parent() { + return _parent; + } + } + + public static class SrcCallsignRaw extends KaitaiStruct { + public static SrcCallsignRaw fromFile(String fileName) throws IOException { + return new SrcCallsignRaw(new ByteBufferKaitaiStream(fileName)); + } + + public SrcCallsignRaw(KaitaiStream _io) { + this(_io, null, null); + } + + public SrcCallsignRaw(KaitaiStream _io, FrameTlmEntrySat.Ax25Header _parent) { + this(_io, _parent, null); + } + + public SrcCallsignRaw( + KaitaiStream _io, FrameTlmEntrySat.Ax25Header _parent, FrameTlmEntrySat _root) { + super(_io); + this._parent = _parent; + this._root = _root; + _read(); + } + + private void _read() { + this._raw__raw_srcCallsignRor = this._io.readBytes(6); + this._raw_srcCallsignRor = + KaitaiStream.processRotateLeft(this._raw__raw_srcCallsignRor, 8 - (1), 1); + KaitaiStream _io__raw_srcCallsignRor = new ByteBufferKaitaiStream(_raw_srcCallsignRor); + this.srcCallsignRor = new SrcCallsign(_io__raw_srcCallsignRor, this, _root); + } + + private SrcCallsign srcCallsignRor; + private FrameTlmEntrySat _root; + private FrameTlmEntrySat.Ax25Header _parent; + private byte[] _raw__raw_srcCallsignRor; + private byte[] _raw_srcCallsignRor; + + public SrcCallsign srcCallsignRor() { + return srcCallsignRor; + } + + public FrameTlmEntrySat _root() { + return _root; + } + + public FrameTlmEntrySat.Ax25Header _parent() { + return _parent; + } + + public byte[] _raw__raw_srcCallsignRor() { + return _raw__raw_srcCallsignRor; + } + + public byte[] _raw_srcCallsignRor() { + return _raw_srcCallsignRor; + } + } + + public static class IFrame extends KaitaiStruct { + public static IFrame fromFile(String fileName) throws IOException { + return new IFrame(new ByteBufferKaitaiStream(fileName)); + } + + public IFrame(KaitaiStream _io) { + this(_io, null, null); + } + + public IFrame(KaitaiStream _io, FrameTlmEntrySat.Ax25Frame _parent) { + this(_io, _parent, null); + } + + public IFrame(KaitaiStream _io, FrameTlmEntrySat.Ax25Frame _parent, FrameTlmEntrySat _root) { + super(_io); + this._parent = _parent; + this._root = _root; + _read(); + } + + private void _read() { + this.pid = this._io.readU1(); + this.ax25Info = this._io.readBytesFull(); + } + + private int pid; + private byte[] ax25Info; + private FrameTlmEntrySat _root; + private FrameTlmEntrySat.Ax25Frame _parent; + + public int pid() { + return pid; + } + + public byte[] ax25Info() { + return ax25Info; + } + + public FrameTlmEntrySat _root() { + return _root; + } + + public FrameTlmEntrySat.Ax25Frame _parent() { + return _parent; + } + } + + public static class TelemetryDataFiledHearder extends KaitaiStruct { + public static TelemetryDataFiledHearder fromFile(String fileName) throws IOException { + return new TelemetryDataFiledHearder(new ByteBufferKaitaiStream(fileName)); + } + + public TelemetryDataFiledHearder(KaitaiStream _io) { + this(_io, null, null); + } + + public TelemetryDataFiledHearder( + KaitaiStream _io, FrameTlmEntrySat.UiFrameTlmEntrySat _parent) { + this(_io, _parent, null); + } + + public TelemetryDataFiledHearder( + KaitaiStream _io, FrameTlmEntrySat.UiFrameTlmEntrySat _parent, FrameTlmEntrySat _root) { + super(_io); + this._parent = _parent; + this._root = _root; + _read(); + } + + private void _read() { + this.spare1 = this._io.readBitsInt(1) != 0; + this.pusVersion = this._io.readBitsInt(3); + this.spare2 = this._io.readBitsInt(4); + this._io.alignToByte(); + this.service = this._io.readU1(); + this.serviceSubtype = this._io.readU1(); + this.time2 = this._io.readBytes(5); + } + + private boolean spare1; + private long pusVersion; + private long spare2; + private int service; + private int serviceSubtype; + private byte[] time2; + private FrameTlmEntrySat _root; + private FrameTlmEntrySat.UiFrameTlmEntrySat _parent; + + public boolean spare1() { + return spare1; + } + + public long pusVersion() { + return pusVersion; + } + + public long spare2() { + return spare2; + } + + public int service() { + return service; + } + + public int serviceSubtype() { + return serviceSubtype; + } + + public byte[] time2() { + return time2; + } + + public FrameTlmEntrySat _root() { + return _root; + } + + public FrameTlmEntrySat.UiFrameTlmEntrySat _parent() { + return _parent; + } + } + + public static class TelemetryData extends KaitaiStruct { + public static TelemetryData fromFile(String fileName) throws IOException { + return new TelemetryData(new ByteBufferKaitaiStream(fileName)); + } + + public TelemetryData(KaitaiStream _io) { + this(_io, null, null); + } + + public TelemetryData(KaitaiStream _io, FrameTlmEntrySat.UiFrameTlmEntrySat _parent) { + this(_io, _parent, null); + } + + public TelemetryData( + KaitaiStream _io, FrameTlmEntrySat.UiFrameTlmEntrySat _parent, FrameTlmEntrySat _root) { + super(_io); + this._parent = _parent; + this._root = _root; + _read(); + } + + private void _read() { + this.sid = this._io.readU1(); + this.modeSafe = this._io.readU1(); + this.epsVbatt = this._io.readU1(); + this.epsBattVcurrent = this._io.readU1(); + this.eps33VCurrent = this._io.readU1(); + this.eps5VCurrent = this._io.readU1(); + this.trxTemp = this._io.readU1(); + this.epsTemp = this._io.readU1(); + this.battTemp = this._io.readU1(); + } + + private int sid; + private int modeSafe; + private int epsVbatt; + private int epsBattVcurrent; + private int eps33VCurrent; + private int eps5VCurrent; + private int trxTemp; + private int epsTemp; + private int battTemp; + private FrameTlmEntrySat _root; + private FrameTlmEntrySat.UiFrameTlmEntrySat _parent; + + public int sid() { + return sid; + } + + /** Operational status. 0 = Safe mode 1 = Orbital or Entry mode */ + public int modeSafe() { + return modeSafe; + } + + /** Battery voltage in V formulae �?�� = 3 + 0.05�??� */ + public int epsVbatt() { + return epsVbatt; + } + + /** Battery bus current in A formulae �?�� = −1 + 0.0078740�?�� */ + public int epsBattVcurrent() { + return epsBattVcurrent; + } + + /** 3.3V bus current in A formulae �?�� = 0.025*x */ + public int eps33VCurrent() { + return eps33VCurrent; + } + + /** 5V bus current in A formulae �?�� = 0.025*x */ + public int eps5VCurrent() { + return eps5VCurrent; + } + + /** Transceiver’s temperature in °C formulae �?�� = −15 + 0.25�?�� */ + public int trxTemp() { + return trxTemp; + } + + /** Power system’s temperature °C formulae �?�� = −15 + 0.25�?�� */ + public int epsTemp() { + return epsTemp; + } + + /** Batteries temperature in °C formulae �?�� = −15 + 0.25�?�� */ + public int battTemp() { + return battTemp; + } + + public FrameTlmEntrySat _root() { + return _root; + } + + public FrameTlmEntrySat.UiFrameTlmEntrySat _parent() { + return _parent; + } + } + + public static class Packetheader extends KaitaiStruct { + public static Packetheader fromFile(String fileName) throws IOException { + return new Packetheader(new ByteBufferKaitaiStream(fileName)); + } + + public Packetheader(KaitaiStream _io) { + this(_io, null, null); + } + + public Packetheader(KaitaiStream _io, FrameTlmEntrySat.UiFrameTlmEntrySat _parent) { + this(_io, _parent, null); + } + + public Packetheader( + KaitaiStream _io, FrameTlmEntrySat.UiFrameTlmEntrySat _parent, FrameTlmEntrySat _root) { + super(_io); + this._parent = _parent; + this._root = _root; + _read(); + } + + private void _read() { + this.version = this._io.readBitsInt(3); + this.packetType = this._io.readBitsInt(1) != 0; + this.packetFlag = this._io.readBitsInt(1) != 0; + this.packetApid = this._io.readBitsInt(11); + this._io.alignToByte(); + this.sequenceControl = this._io.readU2be(); + this.packetLenght = this._io.readU2be(); + } + + private long version; + private boolean packetType; + private boolean packetFlag; + private long packetApid; + private int sequenceControl; + private int packetLenght; + private FrameTlmEntrySat _root; + private FrameTlmEntrySat.UiFrameTlmEntrySat _parent; + + public long version() { + return version; + } + + public boolean packetType() { + return packetType; + } + + public boolean packetFlag() { + return packetFlag; + } + + public long packetApid() { + return packetApid; + } + + public int sequenceControl() { + return sequenceControl; + } + + public int packetLenght() { + return packetLenght; + } + + public FrameTlmEntrySat _root() { + return _root; + } + + public FrameTlmEntrySat.UiFrameTlmEntrySat _parent() { + return _parent; + } + } + + public static class DestCallsignRaw extends KaitaiStruct { + public static DestCallsignRaw fromFile(String fileName) throws IOException { + return new DestCallsignRaw(new ByteBufferKaitaiStream(fileName)); + } + + public DestCallsignRaw(KaitaiStream _io) { + this(_io, null, null); + } + + public DestCallsignRaw(KaitaiStream _io, FrameTlmEntrySat.Ax25Header _parent) { + this(_io, _parent, null); + } + + public DestCallsignRaw( + KaitaiStream _io, FrameTlmEntrySat.Ax25Header _parent, FrameTlmEntrySat _root) { + super(_io); + this._parent = _parent; + this._root = _root; + _read(); + } + + private void _read() { + this._raw__raw_destCallsignRor = this._io.readBytes(6); + this._raw_destCallsignRor = + KaitaiStream.processRotateLeft(this._raw__raw_destCallsignRor, 8 - (1), 1); + KaitaiStream _io__raw_destCallsignRor = new ByteBufferKaitaiStream(_raw_destCallsignRor); + this.destCallsignRor = new DestCallsign(_io__raw_destCallsignRor, this, _root); + } + + private DestCallsign destCallsignRor; + private FrameTlmEntrySat _root; + private FrameTlmEntrySat.Ax25Header _parent; + private byte[] _raw__raw_destCallsignRor; + private byte[] _raw_destCallsignRor; + + public DestCallsign destCallsignRor() { + return destCallsignRor; + } + + public FrameTlmEntrySat _root() { + return _root; + } + + public FrameTlmEntrySat.Ax25Header _parent() { + return _parent; + } + + public byte[] _raw__raw_destCallsignRor() { + return _raw__raw_destCallsignRor; + } + + public byte[] _raw_destCallsignRor() { + return _raw_destCallsignRor; + } + } + + public static class SrcCallsign extends KaitaiStruct { + public static SrcCallsign fromFile(String fileName) throws IOException { + return new SrcCallsign(new ByteBufferKaitaiStream(fileName)); + } + + public SrcCallsign(KaitaiStream _io) { + this(_io, null, null); + } + + public SrcCallsign(KaitaiStream _io, FrameTlmEntrySat.SrcCallsignRaw _parent) { + this(_io, _parent, null); + } + + public SrcCallsign( + KaitaiStream _io, FrameTlmEntrySat.SrcCallsignRaw _parent, FrameTlmEntrySat _root) { + super(_io); + this._parent = _parent; + this._root = _root; + _read(); + } + + private void _read() { + this.srcCallsign = new String(this._io.readBytes(6), Charset.forName("ASCII")); + } + + private String srcCallsign; + private FrameTlmEntrySat _root; + private FrameTlmEntrySat.SrcCallsignRaw _parent; + + public String srcCallsign() { + return srcCallsign; + } + + public FrameTlmEntrySat _root() { + return _root; + } + + public FrameTlmEntrySat.SrcCallsignRaw _parent() { + return _parent; + } + } + + private Ax25Frame frameTlmEntrySat; + private FrameTlmEntrySat _root; + private KaitaiStruct _parent; + + /** @see Source */ + public Ax25Frame frameTlmEntrySat() { + return frameTlmEntrySat; + } + + public FrameTlmEntrySat _root() { + return _root; + } + + public KaitaiStruct _parent() { + return _parent; + } } diff --git a/ModuleEquationKepler/src/main/java/org/josast/equationKepler/Kepler.java b/ModuleEquationKepler/src/main/java/org/josast/equationKepler/Kepler.java index f50c5efbf32ad3490fe84c568c18ed8081b724bc..af648abd8e362ae4c68f277317a996685f8c60ac 100644 --- a/ModuleEquationKepler/src/main/java/org/josast/equationKepler/Kepler.java +++ b/ModuleEquationKepler/src/main/java/org/josast/equationKepler/Kepler.java @@ -2,51 +2,46 @@ package org.josast.equationKepler; /** * Description : Interface use for kepler Equation - * - *

- * Projet : JOSAST

- * JOSAST : Java Open Source Amateur Satellite Toolbox
- * The aim of the project is to create a set of tools for amateur - * satellite purpose. All this tools could be used together to create - * specific software. JOSAST project is managed by AVMDTI (http://www.avmdti.org )
- * This software is an open source software. Please read the JOSAST - * licence
(http://www.avmdti.org ) - *

- * - *

- * for more information contact josast - * at avmdti.org - *

+ * + *

Projet : JOSAST
+ *
+ * JOSAST : Java Open Source Amateur Satellite Toolbox
+ * The aim of the project is to create a set of tools for amateur satellite purpose. All this tools + * could be used together to create specific software. JOSAST project is managed by AVMDTI + * (http://www.avmdti.org )
+ * This software is an open source software. Please read the JOSAST licence
+ * (http://www.avmdti.org ) + * + *

for more information contact josast at avmdti.org * * @author mercier - * @version 1.0

+ * @version 1.0 + *

+ *

*/ public interface Kepler { - //~ Methods ----------------------------------------------------------- + // ~ Methods ----------------------------------------------------------- - /** - * Method Calcul. Solve the Kepler Equation - * - * @param meanAnomaly mean anomalie in radian - * @param eccentricity exentricity - * - * @return double - */ - double calcul(double meanAnomaly, double eccentricity); + /** + * Method Calcul. Solve the Kepler Equation + * + * @param meanAnomaly mean anomalie in radian + * @param eccentricity exentricity + * @return double + */ + double calcul(double meanAnomaly, double eccentricity); - /** - * Method getEpsilon. - * - * @return double return the accuracy of the solver - */ - double getEpsilon(); + /** + * Method getEpsilon. + * + * @return double return the accuracy of the solver + */ + double getEpsilon(); - /** - * Method setEpsilon. - * - * @param epsilon accuracy of the solver - */ - void setEpsilon(double epsilon); + /** + * Method setEpsilon. + * + * @param epsilon accuracy of the solver + */ + void setEpsilon(double epsilon); } diff --git a/ModuleEquationKepler/src/main/java/org/josast/equationKepler/KeplerFixPpoint.java b/ModuleEquationKepler/src/main/java/org/josast/equationKepler/KeplerFixPpoint.java index cad48f3f9426a8c94c9175cf034d26df60836ccd..8236ea4925fad601c174c1a67da933c8f2158538 100644 --- a/ModuleEquationKepler/src/main/java/org/josast/equationKepler/KeplerFixPpoint.java +++ b/ModuleEquationKepler/src/main/java/org/josast/equationKepler/KeplerFixPpoint.java @@ -3,80 +3,67 @@ package org.josast.equationKepler; import org.avmdti.josast.util.MathTools; /** - * Description : Solve the Kepler Equation with the Fixed Point - * Method - * - *

- * Projet : JCP

- * JOSAST : Java Open Source Amateur Satellite Toolbox
- * The aim of the project is to create a set of tools for amateur - * satellite purpose. All this tools could be used together to create - * specific software. JOSAST project is managed by AVMDTI (http://www.avmdti.org )
- * This software is an open source software. Please read the JOSAST - * licence
(http://www.avmdti.org ) - *

- * - *

- * for more information contact josast - * at avmdti.org - *

+ * Description : Solve the Kepler Equation with the Fixed Point Method + * + *

Projet : JCP
+ *
+ * JOSAST : Java Open Source Amateur Satellite Toolbox
+ * The aim of the project is to create a set of tools for amateur satellite purpose. All this tools + * could be used together to create specific software. JOSAST project is managed by AVMDTI + * (http://www.avmdti.org )
+ * This software is an open source software. Please read the JOSAST licence
+ * (http://www.avmdti.org ) + * + *

for more information contact josast at avmdti.org * * @author mercier - * @version 1.0

+ * @version 1.0 + *

+ *

*/ public class KeplerFixPpoint implements Kepler { - //~ Static fields/initializers ---------------------------------------- + // ~ Static fields/initializers ---------------------------------------- - /** DOCUMENT ME! */ - static private final double DEFAULTPRECISION = 1.0e-14; + /** DOCUMENT ME! */ + private static final double DEFAULTPRECISION = 1.0e-14; - /** DOCUMENT ME! */ - private static double epsilon = DEFAULTPRECISION; + /** DOCUMENT ME! */ + private static double epsilon = DEFAULTPRECISION; - //~ Methods ----------------------------------------------------------- + // ~ Methods ----------------------------------------------------------- - /** - * @see org.josast.equationKepler.Kepler#calcul() - */ - public final double calcul(final double meanAnomaly, - final double eccentricity) { - double eccentricanomalie1; // Eccentric Anomaly utilisé pour + /** @see org.josast.equationKepler.Kepler#calcul() */ + public final double calcul(final double meanAnomaly, final double eccentricity) { + double eccentricanomalie1; // Eccentric Anomaly utilisé pour - // les calculs - double eccentricanomaliei1; // Eccentric Anomaly utilisé pour + // les calculs + double eccentricanomaliei1; // Eccentric Anomaly utilisé pour - //les calculs - double error = 0; // erreur - double res; // + // les calculs + double error = 0; // erreur + double res; // - eccentricanomalie1 = meanAnomaly; // Initial guess + eccentricanomalie1 = meanAnomaly; // Initial guess - do { - eccentricanomaliei1 = (eccentricity * Math.sin(eccentricanomalie1)) - + meanAnomaly; - error = eccentricanomaliei1 - eccentricanomalie1; - eccentricanomalie1 = eccentricanomaliei1; - } while (MathTools.abs(error) >= epsilon); + do { + eccentricanomaliei1 = (eccentricity * Math.sin(eccentricanomalie1)) + meanAnomaly; + error = eccentricanomaliei1 - eccentricanomalie1; + eccentricanomalie1 = eccentricanomaliei1; + } while (MathTools.abs(error) >= epsilon); - // tant que l'erreur est inférieur à une certaine valeur - res = eccentricanomaliei1; + // tant que l'erreur est inférieur à une certaine valeur + res = eccentricanomaliei1; - return res; - } + return res; + } - /** - * @see org.josast.equationKepler.Kepler#getEpsilon() - */ - public final double getEpsilon() { - return epsilon; - } + /** @see org.josast.equationKepler.Kepler#getEpsilon() */ + public final double getEpsilon() { + return epsilon; + } - /** - * @see org.josast.equationKepler.Kepler#setEpsilon(double) - */ - public final void setEpsilon(final double epsilonl) { - epsilon = epsilonl; - } + /** @see org.josast.equationKepler.Kepler#setEpsilon(double) */ + public final void setEpsilon(final double epsilonl) { + epsilon = epsilonl; + } } diff --git a/ModuleEquationKepler/src/main/java/org/josast/equationKepler/KeplerNewton.java b/ModuleEquationKepler/src/main/java/org/josast/equationKepler/KeplerNewton.java index e6ee8b33359234a5c4e149e528c75ca8c9b95410..59f77faf412fc1d77c50212f6227c77284c63025 100644 --- a/ModuleEquationKepler/src/main/java/org/josast/equationKepler/KeplerNewton.java +++ b/ModuleEquationKepler/src/main/java/org/josast/equationKepler/KeplerNewton.java @@ -4,77 +4,67 @@ import org.avmdti.josast.util.MathTools; /** * Description :Solve the kepler Equation with the Newton Method - * - *

- * Projet : JCP

- * JOSAST : Java Open Source Amateur Satellite Toolbox
- * The aim of the project is to create a set of tools for amateur - * satellite purpose. All this tools could be used together to create - * specific software. JOSAST project is managed by AVMDTI (http://www.avmdti.org )
- * This software is an open source software. Please read the JOSAST - * licence
(http://www.avmdti.org ) - *

- * - *

- * for more information contact josast - * at avmdti.org - *

+ * + *

Projet : JCP
+ *
+ * JOSAST : Java Open Source Amateur Satellite Toolbox
+ * The aim of the project is to create a set of tools for amateur satellite purpose. All this tools + * could be used together to create specific software. JOSAST project is managed by AVMDTI + * (http://www.avmdti.org )
+ * This software is an open source software. Please read the JOSAST licence
+ * (http://www.avmdti.org ) + * + *

for more information contact josast at avmdti.org * * @author mercier - * @version 1.0

+ * @version 1.0 + *

+ *

*/ public class KeplerNewton implements Kepler { - //~ Static fields/initializers ---------------------------------------- + // ~ Static fields/initializers ---------------------------------------- - /** DOCUMENT ME! */ - static private final double DEFAULTPRECISION = 1.0e-14; + /** DOCUMENT ME! */ + private static final double DEFAULTPRECISION = 1.0e-14; - /** DOCUMENT ME! */ - private static double epsilon = DEFAULTPRECISION; + /** DOCUMENT ME! */ + private static double epsilon = DEFAULTPRECISION; - //~ Methods ----------------------------------------------------------- + // ~ Methods ----------------------------------------------------------- - //(Mathematique.RadiansPerDegree / 360000.0); + // (Mathematique.RadiansPerDegree / 360000.0); - /** - * @see org.josast.equationKepler.Kepler#Calcul(double, double) - */ - public final double calcul(final double meanAnomaly, - final double eccentricity) { - double exentrici; // Eccentric Anomaly utilisé pour les calculs - double exentrici1; // Eccentric Anomaly utilisé pour les calculs - double error; // erreur - double res; // + /** @see org.josast.equationKepler.Kepler#Calcul(double, double) */ + public final double calcul(final double meanAnomaly, final double eccentricity) { + double exentrici; // Eccentric Anomaly utilisé pour les calculs + double exentrici1; // Eccentric Anomaly utilisé pour les calculs + double error; // erreur + double res; // - exentrici = meanAnomaly; // Initial guess + exentrici = meanAnomaly; // Initial guess - do { - exentrici1 = exentrici - - ((exentrici - (eccentricity * Math.sin(exentrici)) - - meanAnomaly) / (1 - (eccentricity * Math.cos(exentrici)))); - error = exentrici1 - exentrici; - exentrici = exentrici1; - } while (MathTools.abs(error) >= epsilon); + do { + exentrici1 = + exentrici + - ((exentrici - (eccentricity * Math.sin(exentrici)) - meanAnomaly) + / (1 - (eccentricity * Math.cos(exentrici)))); + error = exentrici1 - exentrici; + exentrici = exentrici1; + } while (MathTools.abs(error) >= epsilon); - // tant que l'erreur est inférieur à une certaine valeur - res = exentrici1; + // tant que l'erreur est inférieur à une certaine valeur + res = exentrici1; - return res; - } + return res; + } - /** - * @see org.josast.equationKepler.Kepler#getEpsilon() - */ - public final double getEpsilon() { - return epsilon; - } + /** @see org.josast.equationKepler.Kepler#getEpsilon() */ + public final double getEpsilon() { + return epsilon; + } - /** - * @see org.josast.equationKepler.Kepler#setEpsilon(double) - */ - public final void setEpsilon(final double epsilon1) { - epsilon = epsilon1; - } + /** @see org.josast.equationKepler.Kepler#setEpsilon(double) */ + public final void setEpsilon(final double epsilon1) { + epsilon = epsilon1; + } } diff --git a/ModuleEquationKepler/src/main/java/org/josast/equationKepler/demo/DemoMain.java b/ModuleEquationKepler/src/main/java/org/josast/equationKepler/demo/DemoMain.java index 703bcfb1383a70abc020874587f3c3e49de471e1..57f873918f701eca1178c480bf49e8136e037d49 100644 --- a/ModuleEquationKepler/src/main/java/org/josast/equationKepler/demo/DemoMain.java +++ b/ModuleEquationKepler/src/main/java/org/josast/equationKepler/demo/DemoMain.java @@ -4,46 +4,40 @@ import org.josast.equationKepler.Kepler; import org.josast.equationKepler.KeplerFixPpoint; import org.josast.equationKepler.KeplerNewton; - /** * Description : This class is use for Kepler Equation Demonstration - * - *

- * Projet : JCP

- * JOSAST : Java Open Source Amateur Satellite Toolbox
- * The aim of the project is to create a set of tools for amateur - * satellite purpose. All this tools could be used together to create - * specific software. JOSAST project is managed by AVMDTI (http://www.avmdti.org )
- * This software is an open source software. Please read the JOSAST - * licence
(http://www.avmdti.org ) - *

- * - *

- * for more information contact josast - * at avmdti.org - *

+ * + *

Projet : JCP
+ *
+ * JOSAST : Java Open Source Amateur Satellite Toolbox
+ * The aim of the project is to create a set of tools for amateur satellite purpose. All this tools + * could be used together to create specific software. JOSAST project is managed by AVMDTI + * (http://www.avmdti.org )
+ * This software is an open source software. Please read the JOSAST licence
+ * (http://www.avmdti.org ) + * + *

for more information contact josast at avmdti.org * * @author mercier - * @version 1.0

+ * @version 1.0 + *

+ *

*/ public class DemoMain { - //~ Methods ----------------------------------------------------------- - + // ~ Methods ----------------------------------------------------------- - public static void main(String args[]) { - Kepler K = new KeplerFixPpoint(); - System.out.println("Fixed Point Method"); - System.out.println("Test kepler Fix Point : 50 , E = 0,72"); - System.out.println(K.calcul(Math.toRadians(50), 0.72)); - System.out.println("Test kepler Fix Point : 4 , E = 0,72"); - System.out.println(K.calcul(Math.toRadians(4), 0.72)); - System.out.println("Newton Method"); - K = new KeplerNewton(); - System.out.println("Test kepler Fix Point : 50 , E = 0,72"); - System.out.println(K.calcul(Math.toRadians(50), 0.72)); - System.out.println("Test kepler Fix Point : 4 , E = 0,72"); - System.out.println(K.calcul(Math.toRadians(4), 0.72)); - } + public static void main(String args[]) { + Kepler K = new KeplerFixPpoint(); + System.out.println("Fixed Point Method"); + System.out.println("Test kepler Fix Point : 50 , E = 0,72"); + System.out.println(K.calcul(Math.toRadians(50), 0.72)); + System.out.println("Test kepler Fix Point : 4 , E = 0,72"); + System.out.println(K.calcul(Math.toRadians(4), 0.72)); + System.out.println("Newton Method"); + K = new KeplerNewton(); + System.out.println("Test kepler Fix Point : 50 , E = 0,72"); + System.out.println(K.calcul(Math.toRadians(50), 0.72)); + System.out.println("Test kepler Fix Point : 4 , E = 0,72"); + System.out.println(K.calcul(Math.toRadians(4), 0.72)); + } } diff --git a/ModuleEquationKepler/src/test/java/org/josast/equationKepler/KeplerTest.java b/ModuleEquationKepler/src/test/java/org/josast/equationKepler/KeplerTest.java index e7671556c663b649a987609e3ebe9c3e48616e14..ffc60407d6ea95baa1a06f9675d0e81f06f579f6 100644 --- a/ModuleEquationKepler/src/test/java/org/josast/equationKepler/KeplerTest.java +++ b/ModuleEquationKepler/src/test/java/org/josast/equationKepler/KeplerTest.java @@ -1,50 +1,40 @@ -/** - * - */ +/** */ package org.josast.equationKepler; import junit.framework.Assert; import junit.framework.TestCase; -/** - * @author cmercier - * - */ +/** @author cmercier */ public class KeplerTest extends TestCase { - /** - * @param name - */ - public KeplerTest(String name) { - super(name); - } + /** @param name */ + public KeplerTest(String name) { + super(name); + } - /* (non-Javadoc) - * @see junit.framework.TestCase#setUp() - */ - protected void setUp() throws Exception { - super.setUp(); - } + /* (non-Javadoc) + * @see junit.framework.TestCase#setUp() + */ + protected void setUp() throws Exception { + super.setUp(); + } - /* (non-Javadoc) - * @see junit.framework.TestCase#tearDown() - */ - protected void tearDown() throws Exception { - super.tearDown(); - } - - /** - * Test method for {@link org.josast.equationKepler.Kepler#calcul(double, double)}. - */ - public final void testCalcul() { - Kepler K = new KeplerFixPpoint(); - Assert.assertEquals(K.calcul(Math.toRadians(50), 0.72), 1.5924951309313728,0.0000001); - Assert.assertEquals(K.calcul(Math.toRadians(4), 0.72), 0.24318719636991842,0.0000001); - Assert.assertEquals(K.getEpsilon(),1.0e-14,1.0e-14); - K = new KeplerNewton(); - Assert.assertEquals(K.calcul(Math.toRadians(50), 0.72), 1.5924951309313728,0.0000001); - Assert.assertEquals(K.calcul(Math.toRadians(4), 0.72), 0.2431871963699407,0.0000001); - Assert.assertEquals(K.getEpsilon(),1.0e-14,1.0e-14); - } + /* (non-Javadoc) + * @see junit.framework.TestCase#tearDown() + */ + protected void tearDown() throws Exception { + super.tearDown(); + } + /** Test method for {@link org.josast.equationKepler.Kepler#calcul(double, double)}. */ + public final void testCalcul() { + Kepler K = new KeplerFixPpoint(); + Assert.assertEquals(K.calcul(Math.toRadians(50), 0.72), 1.5924951309313728, 0.0000001); + Assert.assertEquals(K.calcul(Math.toRadians(4), 0.72), 0.24318719636991842, 0.0000001); + Assert.assertEquals(K.getEpsilon(), 1.0e-14, 1.0e-14); + K = new KeplerNewton(); + Assert.assertEquals(K.calcul(Math.toRadians(50), 0.72), 1.5924951309313728, 0.0000001); + Assert.assertEquals(K.calcul(Math.toRadians(4), 0.72), 0.2431871963699407, 0.0000001); + Assert.assertEquals(K.getEpsilon(), 1.0e-14, 1.0e-14); + } } diff --git a/ModuleJourJulien/src/main/java/org/josast/util/date/Day.java b/ModuleJourJulien/src/main/java/org/josast/util/date/Day.java index 93a86e7a4dcef1f9e90706daa153cfe4c9cefb2b..00ced4d5821fab64f7c256b9885e131bf33b41c6 100644 --- a/ModuleJourJulien/src/main/java/org/josast/util/date/Day.java +++ b/ModuleJourJulien/src/main/java/org/josast/util/date/Day.java @@ -7,17 +7,14 @@ package org.josast.util.date; * @version $Revision: 1.1 $ */ public class Day { - //~ Static fields/initializers ---------------------------------------- + // ~ Static fields/initializers ---------------------------------------- - /** number of second in a day : 86400 */ - public static final double SEC_PER_DAY = 86400.0; - /** number minutes by day */ - public static final double MIN_PER_DAY = 1440.0; - //~ Constructors ------------------------------------------------------ + /** number of second in a day : 86400 */ + public static final double SEC_PER_DAY = 86400.0; + /** number minutes by day */ + public static final double MIN_PER_DAY = 1440.0; + // ~ Constructors ------------------------------------------------------ - /** - * Creates a new Day object. - */ - private Day() { - } + /** Creates a new Day object. */ + private Day() {} } diff --git a/ModuleJourJulien/src/main/java/org/josast/util/date/GenericDate.java b/ModuleJourJulien/src/main/java/org/josast/util/date/GenericDate.java index 3149c9c7fce0a9dbd2ef2795d9d9a6ae0c72f5c0..fe4464ca8bab4becf2f05e332b03e7c3f9699bdb 100644 --- a/ModuleJourJulien/src/main/java/org/josast/util/date/GenericDate.java +++ b/ModuleJourJulien/src/main/java/org/josast/util/date/GenericDate.java @@ -1,212 +1,153 @@ package org.josast.util.date; /** - * - * Description : generic container for a date. - * - * - *

Projet : JOSAST
- * + * Description : generic container for a date. + * + *

Projet : JOSAST
*
- * - * @author mercier + * + * @author mercier * @version 1.0 - *

Source Update

- *
Version : date : name : comments - *
V1 : 1 avr. 2005 : C. Mercier : create file - *

- * + *

Source Update
+ * Version : date : name : comments
+ * V1 : 1 avr. 2005 : C. Mercier : create file + *

*/ public class GenericDate { - //~ Instance fields --------------------------------------------------- - - /** DOCUMENT ME! */ - private int _year; - - /** DOCUMENT ME! */ - private int _month; - - /** DOCUMENT ME! */ - private int _day; - - /** DOCUMENT ME! */ - private int _hour; - - /** DOCUMENT ME! */ - private int _minute; - - /** DOCUMENT ME! */ - private int _seconde; - - //~ Constructors ------------------------------------------------------ - - /** - * Creates a new GenericDate object. - *
no verification on the input value
- * - * @param year 4 digit - * - * @param month 1 to 12 - * - * @param day 1 to 31 - * - * @param hour 1 to 24 - * - * @param minute 1 to 59 - * ! - * @param seconde 1 to 59 - * - */ - public GenericDate(int year, int month, int day, int hour, int minute, - int seconde) { - _year = year; - _month = month; - _day = day; - _hour = hour; - _minute = minute; - _seconde = seconde; - } - - /** - * Creates a new GenericDate object. - * - * @param JulianDate julian day - * - */ - public GenericDate(double JulianDate) { - GenericDate Gd = JulianDay.convertToGenericDate(JulianDate); - _year = Gd._year; - _month = Gd._month; - _day = Gd._day; - _hour = Gd._hour; - _minute = Gd._minute; - _seconde = Gd._seconde; - } - - //~ Methods ----------------------------------------------------------- - - /** - * return the julian day - * - * @return return julian day - */ - public double getJulianDay() { - return (JulianDay.convertToJulianDay(_year, _month, _day, _hour, - _minute, _seconde)); - } - - /** - * - * @return day - */ - public int get_day() { - return _day; - } - - /** - * - * - * @return hours - */ - public int get_hour() { - return _hour; - } - - /** - - * - * @return minute - */ - public int get_minute() { - return _minute; - } - - /** - * - * @return month - */ - public int get_month() { - return _month; - } - - /** - - * - * @return seconde - */ - public int get_seconde() { - return _seconde; - } - - /** - * - * - * @return year - */ - public int get_year() { - return _year; - } - - /** - - * - * @param _day day - * - */ - public void set_day(int _day) { - this._day = _day; - } - - /** - * - * - * @param _hour hour - * - */ - public void set_hour(int _hour) { - this._hour = _hour; - } - - /** - * - * @param _minute minute - */ - public void set_minute(int _minute) { - this._minute = _minute; - } - - /** - * - * @param _month month - */ - public void set_month(int _month) { - this._month = _month; - } - - /** - * - * @param _seconde seconde - */ - public void set_seconde(int _seconde) { - this._seconde = _seconde; - } - - /** - - * - * @param _year year - * - */ - public void set_year(int _year) { - this._year = _year; - } - - /** - * print generic date with the following format dd mm yy hh mn ss - * @return string - */ - public String toString() { - return (" " + _day + " " + _month + " " + _year + " " + _hour - + " " + _minute + " " + _seconde); - } + // ~ Instance fields --------------------------------------------------- + + /** DOCUMENT ME! */ + private int _year; + + /** DOCUMENT ME! */ + private int _month; + + /** DOCUMENT ME! */ + private int _day; + + /** DOCUMENT ME! */ + private int _hour; + + /** DOCUMENT ME! */ + private int _minute; + + /** DOCUMENT ME! */ + private int _seconde; + + // ~ Constructors ------------------------------------------------------ + + /** + * Creates a new GenericDate object.
+ * no verification on the input value
+ * + * @param year 4 digit + * @param month 1 to 12 + * @param day 1 to 31 + * @param hour 1 to 24 + * @param minute 1 to 59 ! + * @param seconde 1 to 59 + */ + public GenericDate(int year, int month, int day, int hour, int minute, int seconde) { + _year = year; + _month = month; + _day = day; + _hour = hour; + _minute = minute; + _seconde = seconde; + } + + /** + * Creates a new GenericDate object. + * + * @param JulianDate julian day + */ + public GenericDate(double JulianDate) { + GenericDate Gd = JulianDay.convertToGenericDate(JulianDate); + _year = Gd._year; + _month = Gd._month; + _day = Gd._day; + _hour = Gd._hour; + _minute = Gd._minute; + _seconde = Gd._seconde; + } + + // ~ Methods ----------------------------------------------------------- + + /** + * return the julian day + * + * @return return julian day + */ + public double getJulianDay() { + return JulianDay.convertToJulianDay(_year, _month, _day, _hour, _minute, _seconde); + } + + /** @return day */ + public int get_day() { + return _day; + } + + /** @return hours */ + public int get_hour() { + return _hour; + } + + /** @return minute */ + public int get_minute() { + return _minute; + } + + /** @return month */ + public int get_month() { + return _month; + } + + /** @return seconde */ + public int get_seconde() { + return _seconde; + } + + /** @return year */ + public int get_year() { + return _year; + } + + /** @param _day day */ + public void set_day(int _day) { + this._day = _day; + } + + /** @param _hour hour */ + public void set_hour(int _hour) { + this._hour = _hour; + } + + /** @param _minute minute */ + public void set_minute(int _minute) { + this._minute = _minute; + } + + /** @param _month month */ + public void set_month(int _month) { + this._month = _month; + } + + /** @param _seconde seconde */ + public void set_seconde(int _seconde) { + this._seconde = _seconde; + } + + /** @param _year year */ + public void set_year(int _year) { + this._year = _year; + } + + /** + * print generic date with the following format dd mm yy hh mn ss + * + * @return string + */ + public String toString() { + return " " + _day + " " + _month + " " + _year + " " + _hour + " " + _minute + " " + _seconde; + } } diff --git a/ModuleJourJulien/src/main/java/org/josast/util/date/JulianDay.java b/ModuleJourJulien/src/main/java/org/josast/util/date/JulianDay.java index 3626a584bb742a08c7820c8177536c0d28b107bf..ddd058dc6246a3e9df056080ff22d10dfe6e5dd4 100644 --- a/ModuleJourJulien/src/main/java/org/josast/util/date/JulianDay.java +++ b/ModuleJourJulien/src/main/java/org/josast/util/date/JulianDay.java @@ -2,446 +2,378 @@ package org.josast.util.date; import java.util.GregorianCalendar; - - /** - * Description : Julian day computing
- * - *

- * date 7 août 2003 - *

- * - *

- * Source Update - *

- *
date : name : comments
+ * Description : Julian day computing
+ * + *

date 7 ao�t 2003 + * + *

Source Update
+ * date : name : comments
* V1 : mercier : create file
- * V1.1 : Mercier : correction bug moi de février - * - *

- * This class is a set of static method to use Julian day. - *

- * + * V1.1 : Mercier : correction bug moi de f�vrier + * + *

This class is a set of static method to use Julian day. + * + *

Algorithm are based on french version of the Jean Meeus book "Calculs Astronomiques � l'usage + * des Amateurs" editor : soci�t� Astronomique de France. + * *

- * Algorithm are based on french version of the Jean Meeus book "Calculs - * Astronomiques à l'usage des Amateurs" editor : société Astronomique de - * France. - *

- * - *

* - * @author XTOPHE josast at - * avmdti.org + * @author XTOPHE josast at avmdti.org * @version 1.1 */ public class JulianDay { - //~ Static fields/initializers ---------------------------------------- - - private static final double EPOCH_JAN1_00H_1900 = 2415019.5; // Jan 1.0 1900 - // = Jan 1 1900 - // 00h UTC - - - // = Jan 1 1900 - // 12h UTC - - // = Jan 1 2000 - - /** DOCUMENT ME! */ - private static final double EPOCH_JAN1_12H_1900 = 2415020.0; // Jan 1.5 1900 = Jan 1 1900 12h UTC - // 12h UTC - - //~ Constructors ------------------------------------------------------ - - - - //~ Methods ----------------------------------------------------------- - - - - - // static method in the class, the constructor is not needed - - private JulianDay() - {} - - /** - * Convert epoch from TLE data to julian day - * this method is valid from 1957 through 2056 - * epoch is : yyddd.ddddddd - * where yy is year - * ddd.ddddddd is day of the curent year - * @param epoch - * @return - */ - public static double convertToJulianDay(double epoch) - { - double year, day, JDoE; - /* Valid 1957 through 2056 */ - year = Math.floor(epoch*1.0E-3); - if (year < 57) - year += 2000; - else - year += 1900; - day = epoch - (Math.floor(epoch*1.0E-3))*1.0E3; - JDoE = Julian_Date_of_Year(year) + day; - - return JDoE; - } - - - - - - - - /** - * Astronomical Formulae for Calculators, Jean Meeus, pages 23-25 Calculate - * Julian Date of 0.0 Jan year - * - * @param year - * @return Julian day - */ - public static double Julian_Date_of_Year(double year) - { - /* Astronomical Formulae for Calculators, Jean Meeus, pages 23-25 - Calculate Julian Date of 0.0 Jan year */ - double A, B, JDoY; - year = year - 1.0; - A = Math.floor(year / 100.0); - B = 2.0 - A + Math.floor(A / 4.0); - JDoY = Math.floor(365.25 * year) + Math.floor(30.6001 * 14.0) + 1720994.5 + B; - - return JDoY; - } - - /** - * Method diffdate - * - * This method realise the difference between 2 date. - * The folowing treatement is made : - * - convert the 2 date in Julian Day - * - return the difference between the 2 Julian Day - * . - * @param d1 - * @param d2 - * @return double - */ - public static double diffdate(GregorianCalendar d1, GregorianCalendar d2) { - return (convertToJulianDay(d1) - convertToJulianDay(d2)); - } - - /** - * Method addJours. - * - * This method allows to add a number of day to a date. - * The folowing treatement is made : - * - convert the date to Julian Day - * - add the number of day - * - convert the date to GregorianCalendar - * - * @param d1 date - * @param jour number of day to add - * @return GregorianCalendar - */ - public static GregorianCalendar addDays(GregorianCalendar d1, long jour) { - double JDd1 = convertToJulianDay(d1); - JDd1 += jour; - return (convertToGregorianCalendar(JDd1)); - - } - - /** - * Method convertToJourJulien. - * - * This method convert a date in Julian Day. - * - * This method call the convertToJourJulien(int annee,int mois,int jour,int heure,int minute,int seconde) - * - * @param date - * @return double - */ - public static double convertToJulianDay(GregorianCalendar date) { - - return convertToJulianDay( - date.get(GregorianCalendar.YEAR), - date.get(GregorianCalendar.MONTH)+1, - date.get(GregorianCalendar.DAY_OF_MONTH), - date.get(GregorianCalendar.HOUR_OF_DAY), - date.get(GregorianCalendar.MINUTE), - date.get(GregorianCalendar.SECOND)); - - } - /** - * Method convertToJourJulien. - * - * This method convert a date in Julian Day. - * - * This method call the convertToJourJulien(int annee,int mois,int jour,int heure,int minute,int seconde) - * - * @param date - * @return double - */ - public static double convertToJulianDay(GenericDate date) { - return convertToJulianDay( - date.get_year(), - date.get_month(), - date.get_day(), - date.get_hour(), - date.get_minute(), - date.get_seconde()); - - } - - /** - * Method convertToJourJulien. - * - * This method concert a date in Julian Date. The algorithm from the Jean Meeus book is used. - * - * This method as been tested with the exemple of the book. cf Unit test. - * - * Be carrefull the input are not checked. - * - * - * @param annee positive and negative year coold be used - * @param mois 1->junary 12->december - * @param jour 1 to 31 - * @param heure 0-24 - * @param minute 0-59 - * @param seconde 0-59 - * @return double julian date. - */ - public static double convertToJulianDay( - int annee, - int mois, - int jour, - int heure, - int minute, - int seconde) { - // détection si la date est > 1582.1015 - double A = 0; - double B = 0; - double date = annee + mois / 100.0 + jour / 10000.0; - double JulianDate = 0; - - double y = annee; - double m = mois; - double j = - heure / 24.0 - + ((minute / (24 * 60.0))) - + ((seconde / (3600.0 * 24.0))); -// MCR 15-2-2004 correction suite a un défaut détecté sur le mois de févier -// remplacement du < par <= puisque les mois de janvier et févier sont considéré comme -// les 13eme et 14eme mois. - - if (mois <= 2) { - y = y - 1; - m = m + 12; - } - - if (date > 1582.1015) { - A = ENT(y / 100.0); - B = 2 - A + ENT(A / 4.0); - } else { - A = 0; - B = 0; - } - - if (y > 0) { - JulianDate = - ENT(365.25 * y) - + ENT(30.6001 * (m + 1)) - + jour - + j - + 1720994.5 - + B; - } else { - JulianDate = - ENT(365.25 * y - 0.75) - + ENT(30.6001 * (m + 1)) - + jour - + j - + 1720994.5 - + B; - } - - return (JulianDate); - } - - /** - * - * This method concert a date in Julian Date Modified with origin 1/1/2000 0H. - * - * The time scale used here is a "day number" from 2000 Jan 0.0 TDT, which is the same as 1999 Dec 31.0 TDT, i.e. precisely at midnight TDT at the start of the last day of this century. With the modest accuracy we strive for here, one can usually disregard the difference between TDT (formerly canned ET) and UT. - * - * @param annee - * @param mois - * @param jour - * @param heure - * @param minute - * @param seconde - * @return - */ - public static double convertToJulianDay2000(int annee, - int mois, - int jour, - int heure, - int minute, - int seconde) - { - return (convertToJulianDay(annee,mois,jour,heure,minute,seconde)- 2451543.5d); - } - - /** - * Method convertToGregorianCalendar. - * - * This method convert an Julian date to a Gregorian Calendar date. - * - * @param JulianDate - * @return GregorianCalendar - */ - public static GregorianCalendar convertToGregorianCalendar(double JulianDate) { - double Z = ENT(JulianDate + 0.5); - double A = 0; - if (Z < 2299161) { - A = Z; - } else { - double alpha = ENT((Z - 1867216.25) / 36524.35); - A = Z + 1 + alpha - ENT(alpha / 4); - } - - double F = JulianDate + 0.5 - Z; - - double B = A + 1524; - double C = ENT((B - 122.1) / 365.25); - double D = ENT(365.25 * C); - double E = ENT((B - D) / 30.6001); - double tempjour = (B - D - ENT(30.6001 * E) + F); - - int jour= (int) ENT(tempjour); - double temp = tempjour - jour; - - double ensecondes = 24 * 60 * 60 * temp; - - int heure = (int) ENT(ensecondes / 3600); - int minute = (int) ENT((ensecondes - (3600 * heure)) / 60.0); - int secondes = (int) ensecondes - ((3600 * heure) + (60 * minute)); - int mois = (int) E - 1; - - if (E > 13.5) { - mois = (int) E - 13; - } - - int annee = (int) C - 4716; - if (mois < 2.5) { - annee = (int) C - 4715; - } - System.err.println(""+annee+"" +mois+""+ jour); - return ( - - new GregorianCalendar(annee, mois-1, jour, heure, minute, secondes)); - } - - /** - * Method ENT. - * - * @param valeur - * @return double - */ - private static double ENT(double valeur) { - long l = (long) valeur; - return (l * 1.0); - } - - /** - * Method convertToGenericDate. - * @param JulianDate - * @return GenericDate - */ - public static GenericDate convertToGenericDate(double JulianDate) { - double Z = ENT(JulianDate + 0.5); - double A = 0; - if (Z < 2299161) { - A = Z; - } else { - double alpha = ENT((Z - 1867216.25) / 36524.35); - A = Z + 1 + alpha - ENT(alpha / 4); - } - - double F = JulianDate + 0.5 - Z; - - double B = A + 1524; - double C = ENT((B - 122.1) / 365.25); - double D = ENT(365.25 * C); - double E = ENT((B - D) / 30.6001); - double tempjour = (B - D - ENT(30.6001 * E) + F); - - int jour = (int) ENT(tempjour); - double temp = tempjour - jour; - - double ensecondes = 24 * 60 * 60 * temp; - - int heure = (int) ENT(ensecondes / 3600); - int minute = (int) ENT((ensecondes - (3600 * heure)) / 60.0); - int secondes = (int) ensecondes - ((3600 * heure) + (60 * minute)); - int mois = (int) E - 1; - - if (E > 13.5) { - mois = (int) E - 13; - } - - int annee = (int) C - 4716; - if (mois < 2.5) { - annee = (int) C - 4715; - } - - return (new GenericDate(annee, mois, jour, heure, minute, secondes)); - - } - /** - * DOCUMENT ME! - * - * @param m_Date julian day - * - * @return number of day from 1/1/1900 OH - */ - public static double FromJan1_00h_1900(double m_Date) { - return m_Date - EPOCH_JAN1_00H_1900; + // ~ Static fields/initializers ---------------------------------------- + + private static final double EPOCH_JAN1_00H_1900 = 2415019.5; // Jan 1.0 1900 + // = Jan 1 1900 + // 00h UTC + + // = Jan 1 1900 + // 12h UTC + + // = Jan 1 2000 + + /** DOCUMENT ME! */ + private static final double EPOCH_JAN1_12H_1900 = 2415020.0; // Jan 1.5 1900 = Jan 1 1900 12h UTC + // 12h UTC + + // ~ Constructors ------------------------------------------------------ + + // ~ Methods ----------------------------------------------------------- + + // static method in the class, the constructor is not needed + + private JulianDay() {} + + /** + * Convert epoch from TLE data to julian day this method is valid from 1957 through 2056 epoch is + * : yyddd.ddddddd where yy is year ddd.ddddddd is day of the curent year + * + * @param epoch + * @return + */ + public static double convertToJulianDay(double epoch) { + double year, day, JDoE; + /* Valid 1957 through 2056 */ + year = Math.floor(epoch * 1.0E-3); + if (year < 57) year += 2000; + else year += 1900; + day = epoch - (Math.floor(epoch * 1.0E-3)) * 1.0E3; + JDoE = Julian_Date_of_Year(year) + day; + + return JDoE; + } + + /** + * Astronomical Formulae for Calculators, Jean Meeus, pages 23-25 Calculate Julian Date of 0.0 Jan + * year + * + * @param year + * @return Julian day + */ + public static double Julian_Date_of_Year(double year) { + /* Astronomical Formulae for Calculators, Jean Meeus, pages 23-25 + Calculate Julian Date of 0.0 Jan year */ + double A, B, JDoY; + year = year - 1.0; + A = Math.floor(year / 100.0); + B = 2.0 - A + Math.floor(A / 4.0); + JDoY = Math.floor(365.25 * year) + Math.floor(30.6001 * 14.0) + 1720994.5 + B; + + return JDoY; + } + + /** + * Method diffdate + * + *

This method realise the difference between 2 date. The folowing treatement is made : - + * convert the 2 date in Julian Day - return the difference between the 2 Julian Day . + * + * @param d1 + * @param d2 + * @return double + */ + public static double diffdate(GregorianCalendar d1, GregorianCalendar d2) { + return convertToJulianDay(d1) - convertToJulianDay(d2); + } + + /** + * Method addJours. + * + *

This method allows to add a number of day to a date. The folowing treatement is made : - + * convert the date to Julian Day - add the number of day - convert the date to GregorianCalendar + * + * @param d1 date + * @param jour number of day to add + * @return GregorianCalendar + */ + public static GregorianCalendar addDays(GregorianCalendar d1, long jour) { + double JDd1 = convertToJulianDay(d1); + JDd1 += jour; + return convertToGregorianCalendar(JDd1); + } + + /** + * Method convertToJourJulien. + * + *

This method convert a date in Julian Day. + * + *

This method call the convertToJourJulien(int annee,int mois,int jour,int heure,int + * minute,int seconde) + * + * @param date + * @return double + */ + public static double convertToJulianDay(GregorianCalendar date) { + + return convertToJulianDay( + date.get(GregorianCalendar.YEAR), + date.get(GregorianCalendar.MONTH) + 1, + date.get(GregorianCalendar.DAY_OF_MONTH), + date.get(GregorianCalendar.HOUR_OF_DAY), + date.get(GregorianCalendar.MINUTE), + date.get(GregorianCalendar.SECOND)); + } + /** + * Method convertToJourJulien. + * + *

This method convert a date in Julian Day. + * + *

This method call the convertToJourJulien(int annee,int mois,int jour,int heure,int + * minute,int seconde) + * + * @param date + * @return double + */ + public static double convertToJulianDay(GenericDate date) { + return convertToJulianDay( + date.get_year(), + date.get_month(), + date.get_day(), + date.get_hour(), + date.get_minute(), + date.get_seconde()); + } + + /** + * Method convertToJourJulien. + * + *

This method concert a date in Julian Date. The algorithm from the Jean Meeus book is used. + * + *

This method as been tested with the exemple of the book. cf Unit test. + * + *

Be carrefull the input are not checked. + * + * @param annee positive and negative year coold be used + * @param mois 1->junary 12->december + * @param jour 1 to 31 + * @param heure 0-24 + * @param minute 0-59 + * @param seconde 0-59 + * @return double julian date. + */ + public static double convertToJulianDay( + int annee, int mois, int jour, int heure, int minute, int seconde) { + // d�tection si la date est > 1582.1015 + double A = 0; + double B = 0; + double date = annee + mois / 100.0 + jour / 10000.0; + double JulianDate = 0; + + double y = annee; + double m = mois; + double j = heure / 24.0 + ((minute / (24 * 60.0))) + ((seconde / (3600.0 * 24.0))); + // MCR 15-2-2004 correction suite a un d�faut d�tect� sur le mois de f�vier + // remplacement du < par <= puisque les mois de janvier et f�vier sont consid�r� comme + // les 13eme et 14eme mois. + + if (mois <= 2) { + y = y - 1; + m = m + 12; + } + + if (date > 1582.1015) { + A = ENT(y / 100.0); + B = 2 - A + ENT(A / 4.0); + } else { + A = 0; + B = 0; + } + + if (y > 0) { + JulianDate = ENT(365.25 * y) + ENT(30.6001 * (m + 1)) + jour + j + 1720994.5 + B; + } else { + JulianDate = ENT(365.25 * y - 0.75) + ENT(30.6001 * (m + 1)) + jour + j + 1720994.5 + B; } - - /** - * DOCUMENT ME! - * - * @param m_Date julian day - * - * @return number of day from 1/1/1900 12H - */ - public static double FromJan1_12h_1900(double m_Date) { - return m_Date - EPOCH_JAN1_12H_1900; + return JulianDate; + } + + /** + * This method concert a date in Julian Date Modified with origin 1/1/2000 0H. + * + *

The time scale used here is a "day number" from 2000 Jan 0.0 TDT, which is the same as 1999 + * Dec 31.0 TDT, i.e. precisely at midnight TDT at the start of the last day of this century. With + * the modest accuracy we strive for here, one can usually disregard the difference between TDT + * (formerly canned ET) and UT. + * + * @param annee + * @param mois + * @param jour + * @param heure + * @param minute + * @param seconde + * @return + */ + public static double convertToJulianDay2000( + int annee, int mois, int jour, int heure, int minute, int seconde) { + return convertToJulianDay(annee, mois, jour, heure, minute, seconde) - 2451543.5d; + } + + /** + * Method convertToGregorianCalendar. + * + *

This method convert an Julian date to a Gregorian Calendar date. + * + * @param JulianDate + * @return GregorianCalendar + */ + public static GregorianCalendar convertToGregorianCalendar(double JulianDate) { + double Z = ENT(JulianDate + 0.5); + double A = 0; + if (Z < 2299161) { + A = Z; + } else { + double alpha = ENT((Z - 1867216.25) / 36524.35); + A = Z + 1 + alpha - ENT(alpha / 4); } - /** - * DOCUMENT ME! - * - * @param m_Date julian day - * - * @return number of day from 1/1/2000 12H - */ - public static double FromJan1_12h_2000(double m_Date) { - return m_Date - EPOCH_JAN1_12H_2000; + double F = JulianDate + 0.5 - Z; + + double B = A + 1524; + double C = ENT((B - 122.1) / 365.25); + double D = ENT(365.25 * C); + double E = ENT((B - D) / 30.6001); + double tempjour = B - D - ENT(30.6001 * E) + F; + + int jour = (int) ENT(tempjour); + double temp = tempjour - jour; + + double ensecondes = 24 * 60 * 60 * temp; + + int heure = (int) ENT(ensecondes / 3600); + int minute = (int) ENT((ensecondes - (3600 * heure)) / 60.0); + int secondes = (int) ensecondes - ((3600 * heure) + (60 * minute)); + int mois = (int) E - 1; + + if (E > 13.5) { + mois = (int) E - 13; + } + + int annee = (int) C - 4716; + if (mois < 2.5) { + annee = (int) C - 4715; } + System.err.println("" + annee + "" + mois + "" + jour); + return new GregorianCalendar(annee, mois - 1, jour, heure, minute, secondes); + } + + /** + * Method ENT. + * + * @param valeur + * @return double + */ + private static double ENT(double valeur) { + long l = (long) valeur; + return l * 1.0; + } + + /** + * Method convertToGenericDate. + * + * @param JulianDate + * @return GenericDate + */ + public static GenericDate convertToGenericDate(double JulianDate) { + double Z = ENT(JulianDate + 0.5); + double A = 0; + if (Z < 2299161) { + A = Z; + } else { + double alpha = ENT((Z - 1867216.25) / 36524.35); + A = Z + 1 + alpha - ENT(alpha / 4); + } + + double F = JulianDate + 0.5 - Z; + + double B = A + 1524; + double C = ENT((B - 122.1) / 365.25); + double D = ENT(365.25 * C); + double E = ENT((B - D) / 30.6001); + double tempjour = (B - D - ENT(30.6001 * E) + F); + + int jour = (int) ENT(tempjour); + double temp = tempjour - jour; + double ensecondes = 24 * 60 * 60 * temp; - /** DOCUMENT ME! */ - private static final double EPOCH_JAN1_12H_2000 = 2451545.0; // Jan 1.5 2000 = Jan 1 2000 12h UTC + int heure = (int) ENT(ensecondes / 3600); + int minute = (int) ENT((ensecondes - (3600 * heure)) / 60.0); + int secondes = (int) ensecondes - ((3600 * heure) + (60 * minute)); + int mois = (int) E - 1; - public static double getFromJan1_12h_2000(double date) { - return date - EPOCH_JAN1_12H_2000; - } + if (E > 13.5) { + mois = (int) E - 13; + } + + int annee = (int) C - 4716; + if (mois < 2.5) { + annee = (int) C - 4715; + } - //~ Constructors ------------------------------------------------------ + return new GenericDate(annee, mois, jour, heure, minute, secondes); + } + /** + * DOCUMENT ME! + * + * @param m_Date julian day + * @return number of day from 1/1/1900 OH + */ + public static double FromJan1_00h_1900(double m_Date) { + return m_Date - EPOCH_JAN1_00H_1900; + } + + /** + * DOCUMENT ME! + * + * @param m_Date julian day + * @return number of day from 1/1/1900 12H + */ + public static double FromJan1_12h_1900(double m_Date) { + return m_Date - EPOCH_JAN1_12H_1900; + } + + /** + * DOCUMENT ME! + * + * @param m_Date julian day + * @return number of day from 1/1/2000 12H + */ + public static double FromJan1_12h_2000(double m_Date) { + return m_Date - EPOCH_JAN1_12H_2000; + } + + /** DOCUMENT ME! */ + private static final double EPOCH_JAN1_12H_2000 = 2451545.0; // Jan 1.5 2000 = Jan 1 2000 12h UTC + + public static double getFromJan1_12h_2000(double date) { + return date - EPOCH_JAN1_12H_2000; + } + + // ~ Constructors ------------------------------------------------------ + + // static method in the class, the constructor is not needed - // static method in the class, the constructor is not needed - } diff --git a/ModuleJourJulien/src/main/java/org/josast/util/date/JulianDay2000.java b/ModuleJourJulien/src/main/java/org/josast/util/date/JulianDay2000.java index 22ce161ba7fea76fa568e3f642d5ee265c72623d..0f35ab9b5b28455221ccc142455e0044b91073c2 100644 --- a/ModuleJourJulien/src/main/java/org/josast/util/date/JulianDay2000.java +++ b/ModuleJourJulien/src/main/java/org/josast/util/date/JulianDay2000.java @@ -1,39 +1,35 @@ package org.josast.util.date; /** - * - * Description : julian day with Y2000 reference - * - * - *

Projet : JOSAST
- * - * - *

for more information contact josast@avmdti.org

- * @author mercier + * Description : julian day with Y2000 reference + * + *

Projet : JOSAST
+ * + *

for more information contact josast@avmdti.org + * + * @author mercier * @version 1.0 - *

Source Update

- *
Version : date : name : comments - *
V1 : 1 avr. 2005 : C. Mercier : create file - *

+ *

Source Update
+ * Version : date : name : comments
+ * V1 : 1 avr. 2005 : C. Mercier : create file + *

* @deprecated since 1 1 2005 - * */ - public class JulianDay2000 { - private JulianDay2000 () {}; - - //~ Methods ----------------------------------------------------------- + private JulianDay2000() {}; + + // ~ Methods ----------------------------------------------------------- - /** - * - * @see JulianDay#convertToJulianDay2000(int annee, int mois, int jour,int heure, int minute, int seconde) - */ - public static double getTime(int year, int month, int day, int hours, - int minutes, int secondes) { - int d = ((367 * year) - ((7 * (year + ((month + 9) / 12))) / 4) - + ((275 * month) / 9) + day) - 730530; + /** + * @see JulianDay#convertToJulianDay2000(int annee, int mois, int jour,int heure, int minute, int + * seconde) + */ + public static double getTime(int year, int month, int day, int hours, int minutes, int secondes) { + int d = + ((367 * year) - ((7 * (year + ((month + 9) / 12))) / 4) + ((275 * month) / 9) + day) + - 730530; - return (d + ((hours + (minutes / 60.0) + (secondes / 3600.0)) / 24.0)); - } -} \ No newline at end of file + return d + ((hours + (minutes / 60.0) + (secondes / 3600.0)) / 24.0); + } +} diff --git a/ModuleJourJulien/src/main/java/org/josast/util/date/SideralTime.java b/ModuleJourJulien/src/main/java/org/josast/util/date/SideralTime.java index 5b006fab45e563b6917a2e8dd000ec9863ccce30..fe009659252f631efada2302627d013ee8475bf3 100644 --- a/ModuleJourJulien/src/main/java/org/josast/util/date/SideralTime.java +++ b/ModuleJourJulien/src/main/java/org/josast/util/date/SideralTime.java @@ -1,87 +1,63 @@ - package org.josast.util.date; import org.avmdti.josast.util.*; /** - * Calculate Greenwich Mean Sidereal Time for the Julian date.
- * - *

- * date 7 ao�t 2003 - *

- * - *

- * Source Update - *

- *
date : name : comments
+ * Calculate Greenwich Mean Sidereal Time for the Julian date.
+ * + *

date 7 ao�t 2003 + * + *

Source Update
+ * date : name : comments
* V1 : mercier : create file
- * *
- * - * Explanatory Supplement to the Astronomical Almanac, page 50. // Orbital - * Coordinate Systems, Part III, Dr. T.S. Kelso, Satellite Times, // Nov/Dec - * 1995 - * - *

+ * Explanatory Supplement to the Astronomical Almanac, page 50. // Orbital Coordinate Systems, Part + * III, Dr. T.S. Kelso, Satellite Times, // Nov/Dec 1995 * - * @author XTOPHE josast at - * avmdti.org + *

+ * + * @author XTOPHE josast at avmdti.org * @version 1.0 */ -/** - * - * - * - */ +/** */ public class SideralTime { - private static final double OMEGA_E = 1.00273790934; // earth rotation per - - /** - * - * Calculate Greenwich Mean Sidereal Time for the Julian date. The return - * value is the angle, in radians, measuring eastward from the Vernal - * Equinox to the prime meridian. This angle is also referred to as "ThetaG" - * (Theta GMST). - * - *
References: The 1992 Astronomical Almanac, page B6. - * Explanatory Supplement to the Astronomical Almanac, page 50. // Orbital - * Coordinate Systems, Part III, Dr. T.S. Kelso, Satellite Times, // Nov/Dec - * 1995 - * - * @param m_Date - * julian date - * @return Greenwich Mean Sidereal Time (in radian) - */ - public static double calculGMST(double m_Date) { - double UT = MathTools.fmod(m_Date + 0.5, 1.0); - double TU = (JulianDay.FromJan1_12h_2000(m_Date) - UT) / 36525.0; - - double GMST = 24110.54841 + TU - * (8640184.812866 + TU * (0.093104 - TU * 6.2e-06)); - - GMST = MathTools.fmod(GMST + Day.SEC_PER_DAY * OMEGA_E * UT, - Day.SEC_PER_DAY); - - if (GMST < 0.0) - GMST += Day.SEC_PER_DAY; // "wrap" negative modulo value - - return (Math.PI * 2 * (GMST / Day.SEC_PER_DAY)); - } - - - /** - * Calculate Local Mean Sidereal Time for given longitude (for this date). - * The longitude is assumed to be in radians measured west from Greenwich. - * The return value is the angle, in radians, measuring eastward from the - * Vernal Equinox to the given longitude. - * - * @param longitude (in radian) - * @param M_Date Julian date - * @return Local Mean Sidereal Time (in radian) - */ - public static double toLMST(double lon, double M_Date) { - return MathTools.fmod(calculGMST(M_Date) + lon, Math.PI * 2); - } - -} \ No newline at end of file + private static final double OMEGA_E = 1.00273790934; // earth rotation per + + /** + * Calculate Greenwich Mean Sidereal Time for the Julian date. The return value is the angle, in + * radians, measuring eastward from the Vernal Equinox to the prime meridian. This angle is also + * referred to as "ThetaG" (Theta GMST).
+ * References: The 1992 Astronomical Almanac, page B6. Explanatory Supplement to the Astronomical + * Almanac, page 50. // Orbital Coordinate Systems, Part III, Dr. T.S. Kelso, Satellite Times, // + * Nov/Dec 1995 + * + * @param m_Date julian date + * @return Greenwich Mean Sidereal Time (in radian) + */ + public static double calculGMST(double m_Date) { + double UT = MathTools.fmod(m_Date + 0.5, 1.0); + double TU = (JulianDay.FromJan1_12h_2000(m_Date) - UT) / 36525.0; + + double GMST = 24110.54841 + TU * (8640184.812866 + TU * (0.093104 - TU * 6.2e-06)); + + GMST = MathTools.fmod(GMST + Day.SEC_PER_DAY * OMEGA_E * UT, Day.SEC_PER_DAY); + + if (GMST < 0.0) GMST += Day.SEC_PER_DAY; // "wrap" negative modulo value + + return Math.PI * 2 * (GMST / Day.SEC_PER_DAY); + } + + /** + * Calculate Local Mean Sidereal Time for given longitude (for this date). The longitude is + * assumed to be in radians measured west from Greenwich. The return value is the angle, in + * radians, measuring eastward from the Vernal Equinox to the given longitude. + * + * @param longitude (in radian) + * @param M_Date Julian date + * @return Local Mean Sidereal Time (in radian) + */ + public static double toLMST(double lon, double M_Date) { + return MathTools.fmod(calculGMST(M_Date) + lon, Math.PI * 2); + } +} diff --git a/ModuleJourJulien/src/test/java/org/josast/util/date/GenericDateTest.java b/ModuleJourJulien/src/test/java/org/josast/util/date/GenericDateTest.java index 2667beeb06af13bb8e003b47925e41568aaf4b17..9972d29f5eb67d4a786a5a6a48d11e85dad11f83 100644 --- a/ModuleJourJulien/src/test/java/org/josast/util/date/GenericDateTest.java +++ b/ModuleJourJulien/src/test/java/org/josast/util/date/GenericDateTest.java @@ -2,7 +2,6 @@ package org.josast.util.date; import junit.framework.TestCase; - /** * DOCUMENT ME! * @@ -10,36 +9,37 @@ import junit.framework.TestCase; * @version $Revision: 1.1 $ */ public class GenericDateTest extends TestCase { - //~ Constructors ------------------------------------------------------ + // ~ Constructors ------------------------------------------------------ - /** - * Creates a new GenericDateTest object. - * - * @param arg0 DOCUMENT ME! - */ - public GenericDateTest(String arg0) { - super(arg0); - } + /** + * Creates a new GenericDateTest object. + * + * @param arg0 DOCUMENT ME! + */ + public GenericDateTest(String arg0) { + super(arg0); + } - //~ Methods ----------------------------------------------------------- + // ~ Methods ----------------------------------------------------------- - /** - *
create a date with Generic Date with Date, Month, Day .. - *
compare to the expected Julian Day - *
create a date with Generic date with Julian Day value - *
compare to the expected Julian Day - */ - public void testGetJulianDay() { - GenericDate Gd = new GenericDate(1950, 5, 19, 22, 30, 00); - GenericDateTest.assertEquals(2433421.4375, Gd.getJulianDay(), 0); + /** + *
+ * create a date with Generic Date with Date, Month, Day ..
+ * compare to the expected Julian Day
+ * create a date with Generic date with Julian Day value
+ * compare to the expected Julian Day + */ + public void testGetJulianDay() { + GenericDate Gd = new GenericDate(1950, 5, 19, 22, 30, 00); + GenericDateTest.assertEquals(2433421.4375, Gd.getJulianDay(), 0); - GenericDate Gd2 = new GenericDate(2433421.4375); - GenericDateTest.assertEquals(2433421.4375, Gd2.getJulianDay(), 0); - GenericDateTest.assertEquals(1950, Gd2.get_year()); - GenericDateTest.assertEquals(5, Gd2.get_month()); - GenericDateTest.assertEquals(19, Gd2.get_day()); - GenericDateTest.assertEquals(22, Gd2.get_hour()); - GenericDateTest.assertEquals(30, Gd2.get_minute()); - GenericDateTest.assertEquals(00, Gd2.get_seconde()); - } + GenericDate Gd2 = new GenericDate(2433421.4375); + GenericDateTest.assertEquals(2433421.4375, Gd2.getJulianDay(), 0); + GenericDateTest.assertEquals(1950, Gd2.get_year()); + GenericDateTest.assertEquals(5, Gd2.get_month()); + GenericDateTest.assertEquals(19, Gd2.get_day()); + GenericDateTest.assertEquals(22, Gd2.get_hour()); + GenericDateTest.assertEquals(30, Gd2.get_minute()); + GenericDateTest.assertEquals(00, Gd2.get_seconde()); + } } diff --git a/ModuleJourJulien/src/test/java/org/josast/util/date/JulianDayTest.java b/ModuleJourJulien/src/test/java/org/josast/util/date/JulianDayTest.java index a7af41ccd99259666e3286e64c9da67c048b0c71..4e0110c9e00d324b3ec1bdfb9c5617375640e659 100644 --- a/ModuleJourJulien/src/test/java/org/josast/util/date/JulianDayTest.java +++ b/ModuleJourJulien/src/test/java/org/josast/util/date/JulianDayTest.java @@ -1,11 +1,9 @@ package org.josast.util.date; +import java.util.GregorianCalendar; import junit.framework.Assert; import junit.framework.TestCase; -import java.util.GregorianCalendar; - - /** * DOCUMENT ME! * @@ -13,165 +11,137 @@ import java.util.GregorianCalendar; * @version $Revision: 1.2 $ */ public class JulianDayTest extends TestCase { - //~ Static fields/initializers ---------------------------------------- - - - private static final int DAY19 = 19; - - - private static final int MONTH4 = 4; - - - private static final int YEAR1990 = 1990; - - - private static final double JULIANDAY1941990 = 3543.0; - - //~ Constructors ------------------------------------------------------ - - /** - * Creates a new JulianDayTest object. - * - * @param arg0 DOCUMENT ME! - */ - public JulianDayTest(String arg0) { - super(arg0); - } - - //~ Methods ----------------------------------------------------------- - - /** - * DOCUMENT ME! - * - * @throws Exception DOCUMENT ME! - */ - protected void setUp() throws Exception { - super.setUp(); - } - - /** - * DOCUMENT ME! - * - * @throws Exception DOCUMENT ME! - */ - protected void tearDown() throws Exception { - super.tearDown(); - } - - /** - *
unit test for Julian day convertion from Gregorian Calendar - *
Date used for the test : - *
- 1957 10 4 19 26 24 julian day value expected 2436116.31 - *
- 333 1 27 12 0 0 julian day value expected 1842713.0, - */ - public void testconvertToJulianDayGC() { - GregorianCalendar valeur = new GregorianCalendar(1957, GregorianCalendar.OCTOBER, 4, - 19, 26, 24); - GregorianCalendar valeur1 = new GregorianCalendar(333, GregorianCalendar.JANUARY, 27, 12, - 0, 0); - Assert.assertEquals(1842713.0, - JulianDay.convertToJulianDay(valeur1), 0); - Assert.assertEquals(2436116.31, - JulianDay.convertToJulianDay(valeur), 0); - } - - /** - * unit test for Julian day convertion from a given date - *
333 1 27 12 0 0 julian day value expected 1842713.0 - *
-584 5 28 0 0 0 julian day value expected 1507899.5 - *
1957 10 4 19 26, julian day value expected 24 2436116.31 - *
2000 1 1 12 0 0 julian day value expected 2451545.0 - *
-4712 1 1 12 0 0 julian day value expected 0.0 - *
1999 1 1 0 0 0 julian day value expected 2451179.5 - *
1987 1 27 0 0 0 julian day value expected 2446822.5 - */ - public void testconvertToJulianDay() { - Assert.assertEquals(1842713.0, - JulianDay.convertToJulianDay(333, 1, 27, 12, 0, 0), 0); - Assert.assertEquals(1507899.5, - JulianDay.convertToJulianDay(-584, 5, 28, 0, 0, 0), 0); - Assert.assertEquals(2436116.31, - JulianDay.convertToJulianDay(1957, 10, 4, 19, 26, 24), - 0); - - Assert.assertEquals(2451545.0, - JulianDay.convertToJulianDay(2000, 1, 1, 12, 0, 0), 0); - Assert.assertEquals(0.0, - JulianDay.convertToJulianDay(-4712, 1, 1, 12, 0, 0), 0); - Assert.assertEquals(2451179.5, - JulianDay.convertToJulianDay(1999, 1, 1, 0, 0, 0), 0); - Assert.assertEquals(2446822.5, - JulianDay.convertToJulianDay(1987, 1, 27, 0, 0, 0), 0); - } - - /** - * Unit test to addDays - *
original date 1954 6 28 0, 0, 0 - *
add 1 day - *
expected results 1954 6 29 0 0 0 - * - */ - public void testaddJours() { - GregorianCalendar valeur = new GregorianCalendar(1954, 6, 29, 0, - 0, 0); - GregorianCalendar valeur2 = new GregorianCalendar(1954, 6, 28, 0, - 0, 0); - GregorianCalendar resultat = JulianDay.addDays(valeur2, 1); - Assert.assertEquals(valeur.getTimeInMillis(), - resultat.getTimeInMillis()); - } - - /** - * Unit Tes from a Gregorian value - *
333 1 27 12 0 0 julian day value expected 1842713.0 - *
-584 5 28 0 0 0 julian day value expected 1507899.5 - *
1957 10 4 19 26, julian day value expected 24 2436116.31 - */ - public void testconvertToGregorianCalendar() { - GregorianCalendar valeur = new GregorianCalendar(1957, GregorianCalendar.OCTOBER, 4, - 19, 26, 24); - GregorianCalendar resultat = JulianDay.convertToGregorianCalendar(2436116.31); - Assert.assertEquals(valeur.getTimeInMillis(), - resultat.getTimeInMillis()); - - GregorianCalendar valeur1 = new GregorianCalendar(333,GregorianCalendar.JANUARY, 27, 12, - 0, 0); - GregorianCalendar resultat1 = JulianDay.convertToGregorianCalendar(1842713.0); - Assert.assertEquals(valeur1.getTimeInMillis(), - resultat1.getTimeInMillis()); - - GregorianCalendar valeur2 = new GregorianCalendar(-584, GregorianCalendar.MAY, 28, 0, - 0, 0); - GregorianCalendar resultat2 = JulianDay.convertToGregorianCalendar(1507899.5); - Assert.assertEquals(valeur2.getTimeInMillis(), - resultat2.getTimeInMillis()); - } - - /** - * unit test for - */ - public void testdiffdate() { - GregorianCalendar J1 = new GregorianCalendar(1835, 11, 16, 0, 0, 0); - GregorianCalendar J2 = new GregorianCalendar(1910, MONTH4, 20, 0, - 0, 0); - - Assert.assertEquals(27183, JulianDay.diffdate(J2, J1), 0); - - // new test for bug ? - //Le probl�me rencontr� est que lorsque j'essais de soustraire 1940-02-29 et 1940-01-01 j'ai comme r�sultat 57 alors que je m'attends � avoir 59. - J1 = new GregorianCalendar(1940, GregorianCalendar.FEBRUARY, 29, 0, 0, 0); - J2 = new GregorianCalendar(1940, GregorianCalendar.JANUARY, 1, 0, 0, 0); - - Assert.assertEquals(59, JulianDay.diffdate(J1, J2), 0); - } - - /** - * DOCUMENT ME! - */ - public final void testconvertToJulianDay2000() { - // 19 april 1990, at 0:00 UT - Assert.assertEquals(-JULIANDAY1941990, - JulianDay.convertToJulianDay2000(YEAR1990, MONTH4, DAY19, 0, - 0, 0), 0); - } + // ~ Static fields/initializers ---------------------------------------- + + private static final int DAY19 = 19; + + private static final int MONTH4 = 4; + + private static final int YEAR1990 = 1990; + + private static final double JULIANDAY1941990 = 3543.0; + + // ~ Constructors ------------------------------------------------------ + + /** + * Creates a new JulianDayTest object. + * + * @param arg0 DOCUMENT ME! + */ + public JulianDayTest(String arg0) { + super(arg0); + } + + // ~ Methods ----------------------------------------------------------- + + /** + * DOCUMENT ME! + * + * @throws Exception DOCUMENT ME! + */ + protected void setUp() throws Exception { + super.setUp(); + } + + /** + * DOCUMENT ME! + * + * @throws Exception DOCUMENT ME! + */ + protected void tearDown() throws Exception { + super.tearDown(); + } + + /** + *
+ * unit test for Julian day convertion from Gregorian Calendar
+ * Date used for the test :
+ * - 1957 10 4 19 26 24 julian day value expected 2436116.31
+ * - 333 1 27 12 0 0 julian day value expected 1842713.0, + */ + public void testconvertToJulianDayGC() { + GregorianCalendar valeur = + new GregorianCalendar(1957, GregorianCalendar.OCTOBER, 4, 19, 26, 24); + GregorianCalendar valeur1 = new GregorianCalendar(333, GregorianCalendar.JANUARY, 27, 12, 0, 0); + Assert.assertEquals(1842713.0, JulianDay.convertToJulianDay(valeur1), 0); + Assert.assertEquals(2436116.31, JulianDay.convertToJulianDay(valeur), 0); + } + + /** + * unit test for Julian day convertion from a given date
+ * 333 1 27 12 0 0 julian day value expected 1842713.0
+ * -584 5 28 0 0 0 julian day value expected 1507899.5
+ * 1957 10 4 19 26, julian day value expected 24 2436116.31
+ * 2000 1 1 12 0 0 julian day value expected 2451545.0
+ * -4712 1 1 12 0 0 julian day value expected 0.0
+ * 1999 1 1 0 0 0 julian day value expected 2451179.5
+ * 1987 1 27 0 0 0 julian day value expected 2446822.5 + */ + public void testconvertToJulianDay() { + Assert.assertEquals(1842713.0, JulianDay.convertToJulianDay(333, 1, 27, 12, 0, 0), 0); + Assert.assertEquals(1507899.5, JulianDay.convertToJulianDay(-584, 5, 28, 0, 0, 0), 0); + Assert.assertEquals(2436116.31, JulianDay.convertToJulianDay(1957, 10, 4, 19, 26, 24), 0); + + Assert.assertEquals(2451545.0, JulianDay.convertToJulianDay(2000, 1, 1, 12, 0, 0), 0); + Assert.assertEquals(0.0, JulianDay.convertToJulianDay(-4712, 1, 1, 12, 0, 0), 0); + Assert.assertEquals(2451179.5, JulianDay.convertToJulianDay(1999, 1, 1, 0, 0, 0), 0); + Assert.assertEquals(2446822.5, JulianDay.convertToJulianDay(1987, 1, 27, 0, 0, 0), 0); + } + + /** + * Unit test to addDays
+ * original date 1954 6 28 0, 0, 0
+ * add 1 day
+ * expected results 1954 6 29 0 0 0 + */ + public void testaddJours() { + GregorianCalendar valeur = new GregorianCalendar(1954, 6, 29, 0, 0, 0); + GregorianCalendar valeur2 = new GregorianCalendar(1954, 6, 28, 0, 0, 0); + GregorianCalendar resultat = JulianDay.addDays(valeur2, 1); + Assert.assertEquals(valeur.getTimeInMillis(), resultat.getTimeInMillis()); + } + + /** + * Unit Tes from a Gregorian value
+ * 333 1 27 12 0 0 julian day value expected 1842713.0
+ * -584 5 28 0 0 0 julian day value expected 1507899.5
+ * 1957 10 4 19 26, julian day value expected 24 2436116.31 + */ + public void testconvertToGregorianCalendar() { + GregorianCalendar valeur = + new GregorianCalendar(1957, GregorianCalendar.OCTOBER, 4, 19, 26, 24); + GregorianCalendar resultat = JulianDay.convertToGregorianCalendar(2436116.31); + Assert.assertEquals(valeur.getTimeInMillis(), resultat.getTimeInMillis()); + + GregorianCalendar valeur1 = new GregorianCalendar(333, GregorianCalendar.JANUARY, 27, 12, 0, 0); + GregorianCalendar resultat1 = JulianDay.convertToGregorianCalendar(1842713.0); + Assert.assertEquals(valeur1.getTimeInMillis(), resultat1.getTimeInMillis()); + + GregorianCalendar valeur2 = new GregorianCalendar(-584, GregorianCalendar.MAY, 28, 0, 0, 0); + GregorianCalendar resultat2 = JulianDay.convertToGregorianCalendar(1507899.5); + Assert.assertEquals(valeur2.getTimeInMillis(), resultat2.getTimeInMillis()); + } + + /** unit test for */ + public void testdiffdate() { + GregorianCalendar J1 = new GregorianCalendar(1835, 11, 16, 0, 0, 0); + GregorianCalendar J2 = new GregorianCalendar(1910, MONTH4, 20, 0, 0, 0); + + Assert.assertEquals(27183, JulianDay.diffdate(J2, J1), 0); + + // new test for bug ? + // Le probl�me rencontr� est que lorsque j'essais de soustraire 1940-02-29 et 1940-01-01 j'ai + // comme r�sultat 57 alors que je m'attends � avoir 59. + J1 = new GregorianCalendar(1940, GregorianCalendar.FEBRUARY, 29, 0, 0, 0); + J2 = new GregorianCalendar(1940, GregorianCalendar.JANUARY, 1, 0, 0, 0); + + Assert.assertEquals(59, JulianDay.diffdate(J1, J2), 0); + } + + /** DOCUMENT ME! */ + public final void testconvertToJulianDay2000() { + // 19 april 1990, at 0:00 UT + Assert.assertEquals( + -JULIANDAY1941990, JulianDay.convertToJulianDay2000(YEAR1990, MONTH4, DAY19, 0, 0, 0), 0); + } } diff --git a/ModuleSIDS/src/main/java/org/josast/SIDS/HttpPostSIDS.java b/ModuleSIDS/src/main/java/org/josast/SIDS/HttpPostSIDS.java index f5d94deae7343f833a59dd766f5827b41943897c..cead9ccffd08dd4cbc766bfee906f9277a50b992 100644 --- a/ModuleSIDS/src/main/java/org/josast/SIDS/HttpPostSIDS.java +++ b/ModuleSIDS/src/main/java/org/josast/SIDS/HttpPostSIDS.java @@ -12,162 +12,143 @@ import java.security.cert.X509Certificate; import java.util.ArrayList; import java.util.List; import java.util.logging.Logger; - import org.apache.http.HttpResponse; import org.apache.http.NameValuePair; - import org.apache.http.client.entity.UrlEncodedFormEntity; import org.apache.http.client.methods.HttpPost; import org.apache.http.conn.ssl.NoopHostnameVerifier; - import org.apache.http.impl.client.CloseableHttpClient; - import org.apache.http.impl.client.HttpClients; import org.apache.http.message.BasicNameValuePair; import org.apache.http.ssl.SSLContextBuilder; import org.apache.http.ssl.TrustStrategy; -/** - * @author christophe - * - */ +/** @author christophe */ public class HttpPostSIDS { - private static Logger logger = Logger.getLogger("AmsatLogger"); - private static String USERAGENT = "Mozilla/5.0"; - private CloseableHttpClient client = null; - private HttpPost post = null; - private StringBuffer result = null; - - /** - * Create a Http client for sending SIDS data.
- * exemple of URL - *

  • Satnogs https://db.satnogs.org/api/telemetry/ - * - * @param url Database http or https adress - */ - public HttpPostSIDS(final String url) { - - client = getCloseableHttpClient(); - post = new HttpPost(url); - post.setHeader("User-Agent", USERAGENT); - - } - - /** - * Create a Http client for sending SIDS data.
    - * - * @param url - * @param token provided by satnogs if - */ - public HttpPostSIDS(final String url, final String token) { - - client = getCloseableHttpClient(); - post = new HttpPost(url); - post.setHeader("User-Agent", USERAGENT); - addSatnogsToken(token); - + private static Logger logger = Logger.getLogger("AmsatLogger"); + private static String USERAGENT = "Mozilla/5.0"; + private CloseableHttpClient client = null; + private HttpPost post = null; + private StringBuffer result = null; + + /** + * Create a Http client for sending SIDS data.
    + * exemple of URL + *
  • Satnogs https://db.satnogs.org/api/telemetry/ + * + * @param url Database http or https adress + */ + public HttpPostSIDS(final String url) { + + client = getCloseableHttpClient(); + post = new HttpPost(url); + post.setHeader("User-Agent", USERAGENT); + } + + /** + * Create a Http client for sending SIDS data.
    + * + * @param url + * @param token provided by satnogs if + */ + public HttpPostSIDS(final String url, final String token) { + + client = getCloseableHttpClient(); + post = new HttpPost(url); + post.setHeader("User-Agent", USERAGENT); + addSatnogsToken(token); + } + + public void addSatnogsToken(final String token) { + + post.addHeader("Authorization", "Token " + token); + } + + private CloseableHttpClient getCloseableHttpClient() { + CloseableHttpClient httpClient = null; + try { + httpClient = + HttpClients.custom() + .setSSLHostnameVerifier(NoopHostnameVerifier.INSTANCE) + .setSSLContext( + new SSLContextBuilder() + .loadTrustMaterial( + null, + new TrustStrategy() { + public boolean isTrusted( + final X509Certificate[] arg0, final String arg1) + throws CertificateException { + return true; + } + }) + .build()) + .build(); + } catch (KeyManagementException e) { + logger.severe("KeyManagementException in creating http client instance " + e.toString()); + } catch (NoSuchAlgorithmException e) { + logger.severe("NoSuchAlgorithmException in creating http client instance " + e.toString()); + } catch (KeyStoreException e) { + logger.severe("KeyStoreException in creating http client instance " + e.toString()); } - - public void addSatnogsToken(final String token) { - - post.addHeader("Authorization", "Token " + token); + return httpClient; + } + + /** + * @param sids + * @return + */ + public int SendSIDSBasic(final SIDSData sids) { + // Data preparation + int resultat = 0; + HttpResponse response = null; + BufferedReader rd = null; + + List urlParameters = new ArrayList(); + urlParameters.add(new BasicNameValuePair("noradID", "" + sids.getNoradID())); + urlParameters.add(new BasicNameValuePair("source", sids.getSource())); + urlParameters.add(new BasicNameValuePair("timestamp", sids.getTimestamp())); + urlParameters.add(new BasicNameValuePair("frame", sids.getFrame())); + urlParameters.add(new BasicNameValuePair("locator", sids.getLocator())); + urlParameters.add(new BasicNameValuePair("longitude", "" + sids.getLongitude())); + urlParameters.add(new BasicNameValuePair("latitude", "" + sids.getLatitude())); + urlParameters.add(new BasicNameValuePair("version", "2.0.2")); + + try { + post.setEntity(new UrlEncodedFormEntity(urlParameters)); + } catch (UnsupportedEncodingException e) { + logger.severe("URL Encoding error" + e); } - private CloseableHttpClient getCloseableHttpClient() { - CloseableHttpClient httpClient = null; - try { - httpClient = HttpClients.custom() - .setSSLHostnameVerifier(NoopHostnameVerifier.INSTANCE) - .setSSLContext(new SSLContextBuilder() - .loadTrustMaterial(null, new TrustStrategy() { - public boolean isTrusted( - final X509Certificate[] arg0, - final String arg1) - throws CertificateException { - return true; - } - }).build()) - .build(); - } catch (KeyManagementException e) { - logger.severe( - "KeyManagementException in creating http client instance " - + e.toString()); - } catch (NoSuchAlgorithmException e) { - logger.severe( - "NoSuchAlgorithmException in creating http client instance " - + e.toString()); - } catch (KeyStoreException e) { - logger.severe("KeyStoreException in creating http client instance " - + e.toString()); - } - return httpClient; + try { + response = client.execute(post); + resultat = response.getStatusLine().getStatusCode(); + logger.info("URL Result " + resultat); + } catch (IOException e) { + logger.severe("Cient executon error" + e.toString()); } - /** - * @param sids - * @return - */ - public int SendSIDSBasic(final SIDSData sids) { - // Data preparation - int resultat = 0; - HttpResponse response = null; - BufferedReader rd = null; - - List urlParameters = new ArrayList(); - urlParameters - .add(new BasicNameValuePair("noradID", "" + sids.getNoradID())); - urlParameters.add(new BasicNameValuePair("source", sids.getSource())); - urlParameters - .add(new BasicNameValuePair("timestamp", sids.getTimestamp())); - urlParameters.add(new BasicNameValuePair("frame", sids.getFrame())); - urlParameters.add(new BasicNameValuePair("locator", sids.getLocator())); - urlParameters.add( - new BasicNameValuePair("longitude", "" + sids.getLongitude())); - urlParameters.add( - new BasicNameValuePair("latitude", "" + sids.getLatitude())); - urlParameters.add(new BasicNameValuePair("version", "2.0.2")); - - try { - post.setEntity(new UrlEncodedFormEntity(urlParameters)); - } catch (UnsupportedEncodingException e) { - logger.severe("URL Encoding error" + e); + if (response != null) { - } + try { + rd = new BufferedReader(new InputStreamReader(response.getEntity().getContent())); + } catch (UnsupportedOperationException | IOException e) { + logger.severe("Buffer reader Exception " + e.toString()); + } - try { - response = client.execute(post); - resultat = response.getStatusLine().getStatusCode(); - logger.info("URL Result " + resultat); - } catch (IOException e) { - logger.severe("Cient executon error" + e.toString()); + result = new StringBuffer(); + String line = ""; + try { + while ((line = rd.readLine()) != null) { + result.append(line); } - - if (response != null) { - - try { - rd = new BufferedReader(new InputStreamReader( - response.getEntity().getContent())); - } catch (UnsupportedOperationException | IOException e) { - logger.severe("Buffer reader Exception " + e.toString()); - } - - result = new StringBuffer(); - String line = ""; - try { - while ((line = rd.readLine()) != null) { - result.append(line); - } - } catch (IOException e) { - logger.severe( - "Error reading line from server " + e.toString()); - } - } - return resultat; - - } - - public StringBuffer getResult() { - return result; + } catch (IOException e) { + logger.severe("Error reading line from server " + e.toString()); + } } + return resultat; + } + public StringBuffer getResult() { + return result; + } } diff --git a/ModuleSIDS/src/main/java/org/josast/SIDS/SIDSData.java b/ModuleSIDS/src/main/java/org/josast/SIDS/SIDSData.java index d05b61bc23674c09ad66ac74479cebe7c6e11f99..acdd1d34c42dd0b6512252ddb915702318392a55 100644 --- a/ModuleSIDS/src/main/java/org/josast/SIDS/SIDSData.java +++ b/ModuleSIDS/src/main/java/org/josast/SIDS/SIDSData.java @@ -8,189 +8,181 @@ import java.util.TimeZone; * SIDSdate is a simple class used to store SIDS data information * * @author Xtophe - * */ - public class SIDSData { - private final SimpleDateFormat ISO8601DATEFORMAT = new SimpleDateFormat( - "yyyy-MM-dd'T'HH:mm:ss'Z'"); - - private int noradID; // Norad ID of the spacecraft - - private String source = ""; // Callsign or user name of the receiver - - private String timestamp; // UTC timestamp (see ISO 8601) - // 2018-01-24T23:42:46Z - - private String frame; // The received data, in hexadecimal string (AX.25 - // packet with or without KISS 'C0 00 .. C0'. - // Whitespaces optional. C0 00 A9 05 DE ... - - private final String locator = "longLat"; // Type of the given receiver's - // location. Currently, only - // 'longLat' is supported. longLat - - private String longitude = null; // Longitude of the receiver (WGS84) - // 8.95564E - - private String latitude = null; // Latitude of the receiver (WGS84) - // 49.73145N - - private int tncPort = 0; // Optional as per SiDS standard specification, but - // not used in PicSat SiDS system 0 - - private double azimuth = 0.0; // azimuth degree of directionnal antenna (if - // avaiblable) 10.5 - - private double elevation = 0.0; // elevation degree of directionnal antenna - // (if avaiblable) 85.0 - - private long fDown = 0; // Frequency of the receiver's downlink channel - // during reception (with Doppler), in Hz 435525000 - - private final String version = "2.0.1"; - - public SIDSData() { - - } - - /** - * addTelemetryData is used for adding telemetry data with associated - * TimeStamp. The timestamp is formated in correct date format. - * - * @param date Date in local time - * @param inputframe telemetry data - */ - public void setTelemetryData(final Date date, final String inputframe) { - - ISO8601DATEFORMAT.setTimeZone(TimeZone.getTimeZone("UTC")); - timestamp = ISO8601DATEFORMAT.format(date); - frame = inputframe; - - } - - public String getLongitude() { - return longitude; - } - - public void setLongitude(final String longitude) { - this.longitude = longitude; - } + private final SimpleDateFormat ISO8601DATEFORMAT = + new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'"); - public String getLatitude() { - return latitude; - } + private int noradID; // Norad ID of the spacecraft - public void setLatitude(final String latitudein) { - this.latitude = latitudein; - } + private String source = ""; // Callsign or user name of the receiver - public int getNoradID() { - return noradID; - } + private String timestamp; // UTC timestamp (see ISO 8601) + // 2018-01-24T23:42:46Z - public void setNoradID(final int noradID) { - this.noradID = noradID; - } + private String frame; // The received data, in hexadecimal string (AX.25 + // packet with or without KISS 'C0 00 .. C0'. + // Whitespaces optional. C0 00 A9 05 DE ... - public String getSource() { - return source; - } + private final String locator = "longLat"; // Type of the given receiver's + // location. Currently, only + // 'longLat' is supported. longLat - public void setSource(final String source) { - this.source = source; - } + private String longitude = null; // Longitude of the receiver (WGS84) + // 8.95564E - public String getTimestamp() { - return timestamp; - } + private String latitude = null; // Latitude of the receiver (WGS84) + // 49.73145N - public void setTimestamp(final String timestamp) { - this.timestamp = timestamp; - } + private int tncPort = 0; // Optional as per SiDS standard specification, but + // not used in PicSat SiDS system 0 - public String getFrame() { - return frame; - } + private double azimuth = 0.0; // azimuth degree of directionnal antenna (if + // avaiblable) 10.5 - public void setFrame(final String frame) { - this.frame = frame; - } + private double elevation = 0.0; // elevation degree of directionnal antenna + // (if avaiblable) 85.0 - public int getTncPort() { - return tncPort; - } + private long fDown = 0; // Frequency of the receiver's downlink channel + // during reception (with Doppler), in Hz 435525000 - public void setTncPort(final int tncPort) { - this.tncPort = tncPort; - } + private final String version = "2.0.1"; - public double getAzimuth() { - return azimuth; - } + public SIDSData() {} - public void setAzimuth(final double azimuth) { - this.azimuth = azimuth; - } + /** + * addTelemetryData is used for adding telemetry data with associated TimeStamp. The timestamp is + * formated in correct date format. + * + * @param date Date in local time + * @param inputframe telemetry data + */ + public void setTelemetryData(final Date date, final String inputframe) { - public double getElevation() { - return elevation; - } + ISO8601DATEFORMAT.setTimeZone(TimeZone.getTimeZone("UTC")); + timestamp = ISO8601DATEFORMAT.format(date); + frame = inputframe; + } - public void setElevation(final double elevation) { - this.elevation = elevation; - } + public String getLongitude() { + return longitude; + } - public long getfDown() { - return fDown; - } + public void setLongitude(final String longitude) { + this.longitude = longitude; + } - public void setfDown(final long fDown) { - this.fDown = fDown; - } + public String getLatitude() { + return latitude; + } - /** - * Set Station information. Fill source, longitude & latitude information. - * - * @param station - */ - public void setStation(final Station station) { - - source = station.getCallsign(); + public void setLatitude(final String latitudein) { + this.latitude = latitudein; + } - longitude = station.getLongitude(); + public int getNoradID() { + return noradID; + } - latitude = station.getLatitude(); + public void setNoradID(final int noradID) { + this.noradID = noradID; + } - } + public String getSource() { + return source; + } - public String getLocator() { + public void setSource(final String source) { + this.source = source; + } - return locator; - } + public String getTimestamp() { + return timestamp; + } - public String toStringBasic() { - StringBuilder sb = new StringBuilder(); - sb.append("noradID="); - sb.append(noradID); - sb.append("&source="); - sb.append(source); - sb.append("×tamp="); - sb.append(timestamp); - sb.append("&frame="); - sb.append(frame); - sb.append("&locator="); - sb.append(locator); - sb.append("&longitude="); - sb.append(longitude); - sb.append("&latitude="); - sb.append(latitude); - sb.append("&version="); - sb.append(version); + public void setTimestamp(final String timestamp) { + this.timestamp = timestamp; + } - return sb.toString(); + public String getFrame() { + return frame; + } - } + public void setFrame(final String frame) { + this.frame = frame; + } + public int getTncPort() { + return tncPort; + } + + public void setTncPort(final int tncPort) { + this.tncPort = tncPort; + } + + public double getAzimuth() { + return azimuth; + } + + public void setAzimuth(final double azimuth) { + this.azimuth = azimuth; + } + + public double getElevation() { + return elevation; + } + + public void setElevation(final double elevation) { + this.elevation = elevation; + } + + public long getfDown() { + return fDown; + } + + public void setfDown(final long fDown) { + this.fDown = fDown; + } + + /** + * Set Station information. Fill source, longitude & latitude information. + * + * @param station + */ + public void setStation(final Station station) { + + source = station.getCallsign(); + + longitude = station.getLongitude(); + + latitude = station.getLatitude(); + } + + public String getLocator() { + + return locator; + } + + public String toStringBasic() { + StringBuilder sb = new StringBuilder(); + sb.append("noradID="); + sb.append(noradID); + sb.append("&source="); + sb.append(source); + sb.append("×tamp="); + sb.append(timestamp); + sb.append("&frame="); + sb.append(frame); + sb.append("&locator="); + sb.append(locator); + sb.append("&longitude="); + sb.append(longitude); + sb.append("&latitude="); + sb.append(latitude); + sb.append("&version="); + sb.append(version); + + return sb.toString(); + } } diff --git a/ModuleSIDS/src/main/java/org/josast/SIDS/Station.java b/ModuleSIDS/src/main/java/org/josast/SIDS/Station.java index 872febb4764b4a3ccaf10bbae127307c3646449d..df8f9b66ec08dc67d2e9e08469b675ab6ccbac1c 100644 --- a/ModuleSIDS/src/main/java/org/josast/SIDS/Station.java +++ b/ModuleSIDS/src/main/java/org/josast/SIDS/Station.java @@ -5,54 +5,56 @@ import java.util.regex.Pattern; public class Station { - private String callsign = "XtopheSwl"; - private String longitude = "1.47E"; - private String latitude = "43.56N"; - public Station(final String callsign, final String longitude, final String latitude) { + private String callsign = "XtopheSwl"; + private String longitude = "1.47E"; + private String latitude = "43.56N"; + + public Station(final String callsign, final String longitude, final String latitude) { super(); this.callsign = callsign; this.longitude = longitude; this.latitude = latitude; - } + } - public Station() { - // TODO Auto-generated constructor stub - } + public Station() { + // TODO Auto-generated constructor stub + } - public String getCallsign() { - return callsign; - } - public void setCallsign(final String callsign) { - this.callsign = callsign; - } - public String getLongitude() { - return longitude; - } - public void setLongitude(final String longitude) { - this.longitude = longitude; - } - public String getLatitude() { - return latitude; - } - public void setLatitude(final String latitude) { - this.latitude = latitude; - } + public String getCallsign() { + return callsign; + } - public boolean checkLatitude(final String latitude) { + public void setCallsign(final String callsign) { + this.callsign = callsign; + } - Pattern p = Pattern.compile("[\\d]*\\.[\\d]*[N,S]"); - Matcher m = p.matcher(latitude); - return m.matches(); + public String getLongitude() { + return longitude; + } - } - public boolean checkLongitude(final String longitude) { + public void setLongitude(final String longitude) { + this.longitude = longitude; + } - Pattern p = Pattern.compile("[\\d]*\\.[\\d]*[E,W]"); - Matcher m = p.matcher(longitude); - return m.matches(); + public String getLatitude() { + return latitude; + } + + public void setLatitude(final String latitude) { + this.latitude = latitude; + } - } + public boolean checkLatitude(final String latitude) { + Pattern p = Pattern.compile("[\\d]*\\.[\\d]*[N,S]"); + Matcher m = p.matcher(latitude); + return m.matches(); + } + public boolean checkLongitude(final String longitude) { + Pattern p = Pattern.compile("[\\d]*\\.[\\d]*[E,W]"); + Matcher m = p.matcher(longitude); + return m.matches(); + } } diff --git a/ModuleSIDS/src/main/java/org/josast/SIDS/app/SendFile.java b/ModuleSIDS/src/main/java/org/josast/SIDS/app/SendFile.java index af51f47388771dfcbc204d72a264d7fdcb00bab9..2acefe7ad98f07f5fcfcb469f51abb9f764fc14d 100644 --- a/ModuleSIDS/src/main/java/org/josast/SIDS/app/SendFile.java +++ b/ModuleSIDS/src/main/java/org/josast/SIDS/app/SendFile.java @@ -8,84 +8,77 @@ import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Date; import java.util.Locale; - import org.josast.SIDS.SIDSData; import org.josast.SIDS.Station; public class SendFile { - private SIDSData sids = new SIDSData(); - private BufferedReader lecteurAvecBuffer = null; - private String ligne; - - public void initSIDS() { - - sids.setStation(new Station()); - sids.setNoradID(99990); - } - - public void openFile(final String file) { - try { - lecteurAvecBuffer = new BufferedReader(new FileReader(file)); - - - } catch (FileNotFoundException exc) { - System.out.println("Erreur d'ouverture"); - } - } - - public void readFile() { - boolean first = false; - Date dateref = null; - try { - while ((ligne = lecteurAvecBuffer.readLine()) != null) { + private SIDSData sids = new SIDSData(); + private BufferedReader lecteurAvecBuffer = null; + private String ligne; - String[] result1 = ligne.split("="); - String[] date = result1[1].split("]"); - String[] trame = result1[2].split("]"); + public void initSIDS() { - SimpleDateFormat simpleDateFormat = new SimpleDateFormat( - "E MMM dd hh:mm:ss z yyyy", Locale.ENGLISH); + sids.setStation(new Station()); + sids.setNoradID(99990); + } - System.out - .println("date : " + date[0] + " - Trame " + trame[0]); - Date date2 = simpleDateFormat.parse(date[0]); - if (first == false) { - dateref = date2; - first = true; - } else { - System.out.println( - (date2.getTime() - dateref.getTime()) / 1000); - } - } - - } catch (IOException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } catch (ParseException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } + public void openFile(final String file) { + try { + lecteurAvecBuffer = new BufferedReader(new FileReader(file)); + } catch (FileNotFoundException exc) { + System.out.println("Erreur d'ouverture"); } - - public void closeFile() { - try { - lecteurAvecBuffer.close(); - } catch (IOException e) { - // TODO Auto-generated catch block - e.printStackTrace(); + } + + public void readFile() { + boolean first = false; + Date dateref = null; + try { + while ((ligne = lecteurAvecBuffer.readLine()) != null) { + + String[] result1 = ligne.split("="); + String[] date = result1[1].split("]"); + String[] trame = result1[2].split("]"); + + SimpleDateFormat simpleDateFormat = + new SimpleDateFormat("E MMM dd hh:mm:ss z yyyy", Locale.ENGLISH); + + System.out.println("date : " + date[0] + " - Trame " + trame[0]); + Date date2 = simpleDateFormat.parse(date[0]); + if (first == false) { + dateref = date2; + first = true; + } else { + System.out.println((date2.getTime() - dateref.getTime()) / 1000); } + } + + } catch (IOException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } catch (ParseException e) { + // TODO Auto-generated catch block + e.printStackTrace(); } - - public static void main(String[] argv) throws IOException { - - SendFile sf = new SendFile(); - sf.openFile(argv[0]); - sf.initSIDS(); - sf.readFile(); - sf.closeFile(); - + } + + public void closeFile() { + try { + lecteurAvecBuffer.close(); + } catch (IOException e) { + // TODO Auto-generated catch block + e.printStackTrace(); } + } + + public static void main(String[] argv) throws IOException { + SendFile sf = new SendFile(); + sf.openFile(argv[0]); + sf.initSIDS(); + sf.readFile(); + sf.closeFile(); + } } diff --git a/ModuleSIDS/src/main/java/org/josast/SIDS/app/TestSIDS.java b/ModuleSIDS/src/main/java/org/josast/SIDS/app/TestSIDS.java index 0cafe2c21b4ba040dc84d1ea1e4f15553cdc29df..e97d7fec62a6ca43c14858f9b0ecd040a0c437bb 100644 --- a/ModuleSIDS/src/main/java/org/josast/SIDS/app/TestSIDS.java +++ b/ModuleSIDS/src/main/java/org/josast/SIDS/app/TestSIDS.java @@ -1,61 +1,54 @@ -/** - * - */ +/** */ package org.josast.SIDS.app; import java.io.IOException; import java.util.GregorianCalendar; - import org.josast.SIDS.HttpPostSIDS; import org.josast.SIDS.SIDSData; import org.josast.SIDS.Station; -/** - * @author chris - * - */ +/** @author chris */ public class TestSIDS { - private HttpPostSIDS client = null; - - public TestSIDS(final String url) { - super(); - client = new HttpPostSIDS(url); - } - - public void send(final SIDSData sids) { - int result = client.SendSIDSBasic(sids); - - System.out.println("resutats = " + result); - System.out.println("resutats = " + client.getResult()); - } - - /** - * @param args - */ - public static void main(String[] args) throws IOException { - - // String url = "https://db.satnogs.org/api/telemetry/"; - // String url = "https://db-dev.satnogs.org/api/telemetry/"; - // String url = "http://127.0.0.1:9000/echoPost"; - // String url = "https://amsat.electrolab.fr/SIDS"; - String url = "https://amsat.electrolab.fr/api/V2/SIDS"; - // String url = "http://127.0.0.1:8080/api/V2/SIDS"; - TestSIDS test = new TestSIDS(url); - // initialise SIDS data - - SIDSData sids = new SIDSData(); - sids.setStation(new Station()); - sids.setNoradID(47438); - sids.setTelemetryData(GregorianCalendar.getInstance().getTime(), - "9882a89a9ea6e09882a89a9ea66303f00801c000002d200319000000023871c7a400000017ffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7943"); - System.out.println(sids.toStringBasic()); - test.send(sids); -// sids.setNoradID(99749); - sids.setTelemetryData(GregorianCalendar.getInstance().getTime(), - "8c6c96a88240e09e9c60648ca46103f0000000000801ca5c0012100319240a0d4b5f0600ff2800002822443e6fb0870d0a24c0"); -// System.out.println(sids.toStringBasic()); -// test.send(sids); - } - + private HttpPostSIDS client = null; + + public TestSIDS(final String url) { + super(); + client = new HttpPostSIDS(url); + } + + public void send(final SIDSData sids) { + int result = client.SendSIDSBasic(sids); + + System.out.println("resutats = " + result); + System.out.println("resutats = " + client.getResult()); + } + + /** @param args */ + public static void main(String[] args) throws IOException { + + // String url = "https://db.satnogs.org/api/telemetry/"; + // String url = "https://db-dev.satnogs.org/api/telemetry/"; + // String url = "http://127.0.0.1:9000/echoPost"; + // String url = "https://amsat.electrolab.fr/SIDS"; + String url = "https://amsat.electrolab.fr/api/V2/SIDS"; + // String url = "http://127.0.0.1:8080/api/V2/SIDS"; + TestSIDS test = new TestSIDS(url); + // initialise SIDS data + + SIDSData sids = new SIDSData(); + sids.setStation(new Station()); + sids.setNoradID(47438); + sids.setTelemetryData( + GregorianCalendar.getInstance().getTime(), + "9882a89a9ea6e09882a89a9ea66303f00801c000002d200319000000023871c7a400000017ffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7943"); + System.out.println(sids.toStringBasic()); + test.send(sids); + // sids.setNoradID(99749); + sids.setTelemetryData( + GregorianCalendar.getInstance().getTime(), + "8c6c96a88240e09e9c60648ca46103f0000000000801ca5c0012100319240a0d4b5f0600ff2800002822443e6fb0870d0a24c0"); + // System.out.println(sids.toStringBasic()); + // test.send(sids); + } } diff --git a/ModuleSatelliteDatabase/src/main/java/org/josast/AmsatList/Commande/Commande.java b/ModuleSatelliteDatabase/src/main/java/org/josast/AmsatList/Commande/Commande.java index fa6f2589fa8453b2e8b8bf334341e664e3907425..57d31c7060b77288fad694120b20e43e4356ba93 100644 --- a/ModuleSatelliteDatabase/src/main/java/org/josast/AmsatList/Commande/Commande.java +++ b/ModuleSatelliteDatabase/src/main/java/org/josast/AmsatList/Commande/Commande.java @@ -3,172 +3,178 @@ package org.josast.AmsatList.Commande; import java.math.BigInteger; import java.util.GregorianCalendar; import java.util.logging.Logger; - import javax.xml.datatype.DatatypeConfigurationException; import javax.xml.datatype.DatatypeFactory; import javax.xml.datatype.XMLGregorianCalendar; - import org.josast.AmsatList.generated.IARUCoordination; import org.josast.AmsatList.generated.Satellites; public class Commande { - private Logger log = Logger.getLogger(getClass().getName()); - - public final static int IARUCoordinationUpdate = 1; - public final static int SatelliteStatusUpdate = 2; - public final static int NasaIDUpdate = 3; - public static final int IARULinkCoordinationUpdate = 4; - public static final int InternationalIDUpdate = 5; - - private String satName; - private BigInteger nasaId; - private int action; - private String valueRef; - private String valueNew; - private String comments; - - public Commande(String satName, BigInteger nasaId, int action, String valueRef, String valueNew, String comments) { - super(); - this.satName = satName; - this.nasaId = nasaId; - this.action = action; - this.valueRef = valueRef; - this.valueNew = valueNew; - this.comments = comments; - } - - public Commande(String[] values) { - - this.satName = values[0]; - this.nasaId = BigInteger.valueOf(Long.parseLong(values[1])); - this.action = Integer.parseInt(values[2]); - this.valueRef = values[3]; - this.valueNew = values[4]; - this.comments = values[5]; - } - - @Override - public String toString() { - return satName + ";" + nasaId + ";" + action + ";" + valueRef + ";" + "" + valueNew + ";" + comments + ";"; - } - - public static int getIARUCoordinationUpdate() { - return IARUCoordinationUpdate; - } - - public String getSatName() { - return satName; - } - - public void setSatName(String satName) { - this.satName = satName; - } - - public BigInteger getNasaId() { - return nasaId; - } - - public void setNasaId(BigInteger nasaId) { - this.nasaId = nasaId; - } - - public int getAction() { - return action; - } - - public void setAction(int action) { - this.action = action; - } - - public String getValueRef() { - return valueRef; - } - - public void setValueRef(String valueRef) { - this.valueRef = valueRef; - } - - public String getValueNew() { - return valueNew; - } - - public void setValueNew(String valueNew) { - this.valueNew = valueNew; - } - - public String getComments() { - return comments; - } - - public void setComments(String comments) { - this.comments = comments; - } - - public Satellites execute(Satellites sat) { - - System.out.println("Commande to execute : " + sat); - /* veriie que c'est le bon sat */ - if (!sat.getNasaID().equals(this.nasaId)) { - log.severe("error : wrong Nasa ID" + sat.getName() + " " + sat.getNasaID() + " " + this.nasaId); - - } else { - switch (this.action) { - case Commande.IARUCoordinationUpdate: - IARUCoordination iaru = sat.getIARUCoordination(); - if (iaru == null) { - iaru = new IARUCoordination(); - sat.setIARUCoordination(iaru); - } - iaru.setCoordinated(Boolean.parseBoolean(this.getValueNew())); - break; - - case Commande.IARULinkCoordinationUpdate: - - IARUCoordination iarulink = sat.getIARUCoordination(); - if (iarulink == null) { - iarulink = new IARUCoordination(); - sat.setIARUCoordination(iarulink); - } - iarulink.setCoordinated(true); - iarulink.setURL(this.getValueNew()); - - break; - case Commande.NasaIDUpdate: - sat.setNasaID(BigInteger.valueOf(Long.parseLong(this.valueNew))); - break; - - case Commande.InternationalIDUpdate: - sat.setInternationalID(this.valueNew); - break; - - case Commande.SatelliteStatusUpdate: - // update Status du satellite - - log.info("Satellite status update : " + sat.getName() + " from " + sat.getStatus() + " to " - + this.valueNew); - sat.setStatus(this.valueNew); - break; - - default: - log.severe("Error commande unknown :" + this.action); - - } - - GregorianCalendar gcal = new GregorianCalendar(); - XMLGregorianCalendar xgcal = null; - try { - xgcal = DatatypeFactory.newInstance().newXMLGregorianCalendar(gcal); - } catch (DatatypeConfigurationException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - sat.setUpdateDate(xgcal); - - } - - return sat; - - } - + private Logger log = Logger.getLogger(getClass().getName()); + + public static final int IARUCoordinationUpdate = 1; + public static final int SatelliteStatusUpdate = 2; + public static final int NasaIDUpdate = 3; + public static final int IARULinkCoordinationUpdate = 4; + public static final int InternationalIDUpdate = 5; + + private String satName; + private BigInteger nasaId; + private int action; + private String valueRef; + private String valueNew; + private String comments; + + public Commande( + String satName, + BigInteger nasaId, + int action, + String valueRef, + String valueNew, + String comments) { + super(); + this.satName = satName; + this.nasaId = nasaId; + this.action = action; + this.valueRef = valueRef; + this.valueNew = valueNew; + this.comments = comments; + } + + public Commande(String[] values) { + + this.satName = values[0]; + this.nasaId = BigInteger.valueOf(Long.parseLong(values[1])); + this.action = Integer.parseInt(values[2]); + this.valueRef = values[3]; + this.valueNew = values[4]; + this.comments = values[5]; + } + + @Override + public String toString() { + return satName + ";" + nasaId + ";" + action + ";" + valueRef + ";" + "" + valueNew + ";" + + comments + ";"; + } + + public static int getIARUCoordinationUpdate() { + return IARUCoordinationUpdate; + } + + public String getSatName() { + return satName; + } + + public void setSatName(String satName) { + this.satName = satName; + } + + public BigInteger getNasaId() { + return nasaId; + } + + public void setNasaId(BigInteger nasaId) { + this.nasaId = nasaId; + } + + public int getAction() { + return action; + } + + public void setAction(int action) { + this.action = action; + } + + public String getValueRef() { + return valueRef; + } + + public void setValueRef(String valueRef) { + this.valueRef = valueRef; + } + + public String getValueNew() { + return valueNew; + } + + public void setValueNew(String valueNew) { + this.valueNew = valueNew; + } + + public String getComments() { + return comments; + } + + public void setComments(String comments) { + this.comments = comments; + } + + public Satellites execute(Satellites sat) { + + System.out.println("Commande to execute : " + sat); + /* veriie que c'est le bon sat */ + if (!sat.getNasaID().equals(this.nasaId)) { + log.severe( + "error : wrong Nasa ID" + sat.getName() + " " + sat.getNasaID() + " " + this.nasaId); + + } else { + switch (this.action) { + case Commande.IARUCoordinationUpdate: + IARUCoordination iaru = sat.getIARUCoordination(); + if (iaru == null) { + iaru = new IARUCoordination(); + sat.setIARUCoordination(iaru); + } + iaru.setCoordinated(Boolean.parseBoolean(this.getValueNew())); + break; + + case Commande.IARULinkCoordinationUpdate: + IARUCoordination iarulink = sat.getIARUCoordination(); + if (iarulink == null) { + iarulink = new IARUCoordination(); + sat.setIARUCoordination(iarulink); + } + iarulink.setCoordinated(true); + iarulink.setURL(this.getValueNew()); + + break; + case Commande.NasaIDUpdate: + sat.setNasaID(BigInteger.valueOf(Long.parseLong(this.valueNew))); + break; + + case Commande.InternationalIDUpdate: + sat.setInternationalID(this.valueNew); + break; + + case Commande.SatelliteStatusUpdate: + // update Status du satellite + + log.info( + "Satellite status update : " + + sat.getName() + + " from " + + sat.getStatus() + + " to " + + this.valueNew); + sat.setStatus(this.valueNew); + break; + + default: + log.severe("Error commande unknown :" + this.action); + } + + GregorianCalendar gcal = new GregorianCalendar(); + XMLGregorianCalendar xgcal = null; + try { + xgcal = DatatypeFactory.newInstance().newXMLGregorianCalendar(gcal); + } catch (DatatypeConfigurationException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + sat.setUpdateDate(xgcal); + } + + return sat; + } } diff --git a/ModuleSatelliteDatabase/src/main/java/org/josast/AmsatList/Commande/CommandeList.java b/ModuleSatelliteDatabase/src/main/java/org/josast/AmsatList/Commande/CommandeList.java index 60d30b78984a242733375268731b26b415be7f69..241815742c1cecec739fef0e57406a9c1f0f4855 100644 --- a/ModuleSatelliteDatabase/src/main/java/org/josast/AmsatList/Commande/CommandeList.java +++ b/ModuleSatelliteDatabase/src/main/java/org/josast/AmsatList/Commande/CommandeList.java @@ -8,89 +8,74 @@ import java.util.Iterator; import java.util.List; import java.util.Vector; import java.util.logging.Logger; - import org.josast.AmsatList.source.ReadCsvFile; - - public class CommandeList { - - private Logger log = Logger.getLogger(getClass().getName()); - Hashtable HashtableCommande = new Hashtable<>(); - Vector listeCommande = null; - - - public CommandeList(String file) - { - listeCommande = new Vector<> () ; - ReadCsvFile rcv = new ReadCsvFile(); - - List listrawcmd = rcv.allLine(file); - - Iterator it = listrawcmd.iterator(); - { - while(it.hasNext()) - { - Commande cmd = new Commande(it.next()); - listeCommande.add(cmd); - HashtableCommande.put(cmd.getNasaId(),cmd); - } - } - } - - public CommandeList(Vector listeCommande) - { - this.listeCommande = listeCommande; - Iterator itr = listeCommande.iterator(); - while(itr.hasNext()){ - Commande cmd = itr.next(); - HashtableCommande.put(cmd.getNasaId(),cmd); - } - } - - - public void save(String file) - { - PrintWriter writer = null; - try { - writer = new PrintWriter(file); - } catch (FileNotFoundException e) { - log.severe("File not found :"+e.getMessage()); - } - Iterator itr = listeCommande.iterator(); - while(itr.hasNext()){ - writer.println(itr.next().toString()); - } - - if (writer!=null) - writer.close(); - - } - - public Hashtable getHashtableCommande() { - return HashtableCommande; - } - - public void setHashtableCommande(Hashtable hashtableCommande) { - HashtableCommande = hashtableCommande; - } - - public Vector getListeCommande() { - return listeCommande; - } - - public void setListeCommande(Vector listeCommande) { - this.listeCommande = listeCommande; - } - - - public void print() - { - Iterator itr = listeCommande.iterator(); - while(itr.hasNext()){ - System.out.println(itr.next().toString()); - } - } + private Logger log = Logger.getLogger(getClass().getName()); + Hashtable HashtableCommande = new Hashtable<>(); + Vector listeCommande = null; + + public CommandeList(String file) { + listeCommande = new Vector<>(); + ReadCsvFile rcv = new ReadCsvFile(); + + List listrawcmd = rcv.allLine(file); + + Iterator it = listrawcmd.iterator(); + { + while (it.hasNext()) { + Commande cmd = new Commande(it.next()); + listeCommande.add(cmd); + HashtableCommande.put(cmd.getNasaId(), cmd); + } + } + } + + public CommandeList(Vector listeCommande) { + this.listeCommande = listeCommande; + Iterator itr = listeCommande.iterator(); + while (itr.hasNext()) { + Commande cmd = itr.next(); + HashtableCommande.put(cmd.getNasaId(), cmd); + } + } + + public void save(String file) { + PrintWriter writer = null; + try { + writer = new PrintWriter(file); + } catch (FileNotFoundException e) { + log.severe("File not found :" + e.getMessage()); + } + Iterator itr = listeCommande.iterator(); + while (itr.hasNext()) { + writer.println(itr.next().toString()); + } + + if (writer != null) writer.close(); + } + + public Hashtable getHashtableCommande() { + return HashtableCommande; + } + + public void setHashtableCommande(Hashtable hashtableCommande) { + HashtableCommande = hashtableCommande; + } + + public Vector getListeCommande() { + return listeCommande; + } + + public void setListeCommande(Vector listeCommande) { + this.listeCommande = listeCommande; + } + + public void print() { + Iterator itr = listeCommande.iterator(); + while (itr.hasNext()) { + System.out.println(itr.next().toString()); + } + } } diff --git a/ModuleSatelliteDatabase/src/main/java/org/josast/AmsatList/Commande/ExecuteCommand.java b/ModuleSatelliteDatabase/src/main/java/org/josast/AmsatList/Commande/ExecuteCommand.java index 9d4eaf17e76569614cc40b1719b0d375387f233e..dbd9b748208438478a58220800de2ae2f42731f3 100644 --- a/ModuleSatelliteDatabase/src/main/java/org/josast/AmsatList/Commande/ExecuteCommand.java +++ b/ModuleSatelliteDatabase/src/main/java/org/josast/AmsatList/Commande/ExecuteCommand.java @@ -5,104 +5,93 @@ import java.math.BigInteger; import java.util.Hashtable; import java.util.List; import java.util.logging.Logger; - import org.josast.AmsatList.generated.AmsatList; import org.josast.AmsatList.generated.Satellites; import org.josast.ModuleSatelliteDatabase.AmsatListFile; public class ExecuteCommand { - private Logger log = Logger.getLogger(getClass().getName()); - - public void execute(String inputRepository, String outputRepository, - CommandeList cmd) { - File inputRepertoire = new File(inputRepository); - File outputRepertoire = new File(outputRepository); - - int i = 0; - if (!inputRepertoire.isDirectory()) { - log.severe(inputRepository + "is not a repository"); - } - if (!outputRepertoire.exists()) { - log.info("create " + inputRepository); - if (!outputRepertoire.mkdir()) { - log.severe(outputRepertoire + "is not created"); - } - } else if (!outputRepertoire.isDirectory()) { - log.severe(outputRepertoire + "is not a repository"); - } - - File[] inputsfiles = inputRepertoire.listFiles(); - if (inputsfiles == null) { - log.severe(inputRepository + "Repository empty"); - } else { - - for (i = 0; i < inputsfiles.length; i++) { - AmsatListFile amsatListfile = new AmsatListFile(); - AmsatList amsatList = amsatListfile.openAmsatList - (inputsfiles[i].getAbsolutePath()); - List satellites = amsatList.getSatellites(); - if (satellites.size() != 1) { - log.severe("Wrong number of satellite" + satellites.size()); - } - - Satellites sat = satellites.get(0); - - Hashtable cmdhas = cmd.getHashtableCommande(); - Commande cmdex = cmdhas.get(sat.getNasaID()); - if (cmdex != null) { - sat = cmdex.execute(sat); - log.info("commande exécutée"); - String fichOutSring = outputRepertoire + "\\AL_" - + sat.getName()+".xml"; - amsatListfile.save(fichOutSring, amsatList); - } else { - log.info("pas de commande à exécuter"); - } - - } - } - - } - - - public void copie(String inputRepository, String outputRepository) { - File inputRepertoire = new File(inputRepository); - File outputRepertoire = new File(outputRepository); - - int i = 0; - if (!inputRepertoire.isDirectory()) { - log.severe(inputRepository + "is not a repository"); - } - if (!outputRepertoire.exists()) { - log.info("create " + inputRepository); - if (!outputRepertoire.mkdir()) { - log.severe(outputRepertoire + "is not created"); - } - } else if (!outputRepertoire.isDirectory()) { - log.severe(outputRepertoire + "is not a repository"); - } - - File[] inputsfiles = inputRepertoire.listFiles(); - if (inputsfiles == null) { - log.severe(inputRepository + "Repository empty"); - } else { - - for (i = 0; i < inputsfiles.length; i++) { - AmsatListFile amsatListfile = new AmsatListFile(); - AmsatList amsatList = amsatListfile.openAmsatList(inputsfiles[i].getAbsolutePath()); - List satellites = amsatList.getSatellites(); - if (satellites.size() != 1) { - log.severe("Wrong number of satellite" + satellites.size()); - } - Satellites sat = satellites.get(0); - String fichOutSring = outputRepertoire + "\\AL_" + sat.getName()+".xml"; - amsatListfile.save(fichOutSring, amsatList); - - - } - } - - } - + private Logger log = Logger.getLogger(getClass().getName()); + + public void execute(String inputRepository, String outputRepository, CommandeList cmd) { + File inputRepertoire = new File(inputRepository); + File outputRepertoire = new File(outputRepository); + + int i = 0; + if (!inputRepertoire.isDirectory()) { + log.severe(inputRepository + "is not a repository"); + } + if (!outputRepertoire.exists()) { + log.info("create " + inputRepository); + if (!outputRepertoire.mkdir()) { + log.severe(outputRepertoire + "is not created"); + } + } else if (!outputRepertoire.isDirectory()) { + log.severe(outputRepertoire + "is not a repository"); + } + + File[] inputsfiles = inputRepertoire.listFiles(); + if (inputsfiles == null) { + log.severe(inputRepository + "Repository empty"); + } else { + + for (i = 0; i < inputsfiles.length; i++) { + AmsatListFile amsatListfile = new AmsatListFile(); + AmsatList amsatList = amsatListfile.openAmsatList(inputsfiles[i].getAbsolutePath()); + List satellites = amsatList.getSatellites(); + if (satellites.size() != 1) { + log.severe("Wrong number of satellite" + satellites.size()); + } + + Satellites sat = satellites.get(0); + + Hashtable cmdhas = cmd.getHashtableCommande(); + Commande cmdex = cmdhas.get(sat.getNasaID()); + if (cmdex != null) { + sat = cmdex.execute(sat); + log.info("commande exécutée"); + String fichOutSring = outputRepertoire + "\\AL_" + sat.getName() + ".xml"; + amsatListfile.save(fichOutSring, amsatList); + } else { + log.info("pas de commande à exécuter"); + } + } + } + } + + public void copie(String inputRepository, String outputRepository) { + File inputRepertoire = new File(inputRepository); + File outputRepertoire = new File(outputRepository); + + int i = 0; + if (!inputRepertoire.isDirectory()) { + log.severe(inputRepository + "is not a repository"); + } + if (!outputRepertoire.exists()) { + log.info("create " + inputRepository); + if (!outputRepertoire.mkdir()) { + log.severe(outputRepertoire + "is not created"); + } + } else if (!outputRepertoire.isDirectory()) { + log.severe(outputRepertoire + "is not a repository"); + } + + File[] inputsfiles = inputRepertoire.listFiles(); + if (inputsfiles == null) { + log.severe(inputRepository + "Repository empty"); + } else { + + for (i = 0; i < inputsfiles.length; i++) { + AmsatListFile amsatListfile = new AmsatListFile(); + AmsatList amsatList = amsatListfile.openAmsatList(inputsfiles[i].getAbsolutePath()); + List satellites = amsatList.getSatellites(); + if (satellites.size() != 1) { + log.severe("Wrong number of satellite" + satellites.size()); + } + Satellites sat = satellites.get(0); + String fichOutSring = outputRepertoire + "\\AL_" + sat.getName() + ".xml"; + amsatListfile.save(fichOutSring, amsatList); + } + } + } } diff --git a/ModuleSatelliteDatabase/src/main/java/org/josast/AmsatList/api/AmsatListRequest.java b/ModuleSatelliteDatabase/src/main/java/org/josast/AmsatList/api/AmsatListRequest.java index 806fce72b7e5ef4f90e923312a7caf761f058c36..935a7cae6fc12f435f5274ae136af5a8d2a5b08e 100644 --- a/ModuleSatelliteDatabase/src/main/java/org/josast/AmsatList/api/AmsatListRequest.java +++ b/ModuleSatelliteDatabase/src/main/java/org/josast/AmsatList/api/AmsatListRequest.java @@ -11,7 +11,6 @@ import java.util.Map; import java.util.Vector; import java.util.logging.Logger; import java.util.stream.Collectors; - import org.josast.AmsatList.generated.AmsatList; import org.josast.AmsatList.generated.Beacons; import org.josast.AmsatList.generated.RadioData; @@ -24,268 +23,231 @@ import org.json.JSONArray; import org.json.JSONObject; public class AmsatListRequest { - private Logger log = Logger.getLogger(getClass().getName()); - AmsatList amsatList=null; - AmsatListFile amf = null; - Hashtable> AMSATFreqBeacon =null ; - - public AmsatListRequest( String filename) { - log.warning("load" +filename); - amsatList= - AmsatListFileSingleton.getInstance().getAmsatList(new File(filename)); - amf= - AmsatListFileSingleton.getInstance().getAmsatListFlat(new File(filename)); + private Logger log = Logger.getLogger(getClass().getName()); + AmsatList amsatList = null; + AmsatListFile amf = null; + Hashtable> AMSATFreqBeacon = null; + + public AmsatListRequest(String filename) { + log.warning("load" + filename); + amsatList = AmsatListFileSingleton.getInstance().getAmsatList(new File(filename)); + amf = AmsatListFileSingleton.getInstance().getAmsatListFlat(new File(filename)); + } + + /** + * provide number of satellite in the database + * + * @return + */ + public int getNumberOfSatellite() { + List listSatellite = amsatList.getSatellites(); + return (listSatellite.size()); + } + + /** + * provide list of satellite with few data + * + * @return + */ + public JSONArray getSatellitesData() { + FlatSatList listsatFlat = amf.getAmsatListFlat(); + List listValues = new ArrayList<>(listsatFlat.values()); + JSONArray ja = new JSONArray(listValues); + return ja; + } + + /** + * provide for each frequency, the list of satellite + * + * @return + */ + public Hashtable> getBeaconFrequency() { + + if (AMSATFreqBeacon == null) { + AMSATFreqBeacon = new Hashtable<>(); + + List listSatellite = amsatList.getSatellites(); + + ListIterator it = listSatellite.listIterator(); + while (it.hasNext()) { + Satellites sat = it.next(); + List listbeacon = sat.getRadioData().getBeacons(); + ListIterator itb = listbeacon.listIterator(); + while (itb.hasNext()) { + Vector vsat = null; + long frequency = 0; + String val = itb.next().getFrequency(); + if (val == null) { + val = "0"; + } + try { + + frequency = Long.parseLong(val.trim()); + } catch (NumberFormatException e) { + log.severe(e.toString()); + } + Long freq = new Long(frequency); + if (AMSATFreqBeacon.containsKey(freq)) { + vsat = AMSATFreqBeacon.get(freq); + } else { + + vsat = new Vector<>(); + AMSATFreqBeacon.put(freq, vsat); + } + vsat.addElement(sat); + } + } } - /** - * provide number of satellite in the database - * @return - */ - public int getNumberOfSatellite() { - List listSatellite = amsatList.getSatellites(); - return (listSatellite.size()); - } + return AMSATFreqBeacon; + } - /** - * provide list of satellite with few data - * @return - */ - public JSONArray getSatellitesData() { - FlatSatList listsatFlat = amf.getAmsatListFlat(); - List listValues = new ArrayList<>( listsatFlat.values()); - JSONArray ja = new JSONArray(listValues); - return ja; + public Vector getSatellitesBeacons(Long frequency) { - } - - /** - * provide for each frequency, the list of satellite - * - * @return - */ - public Hashtable> getBeaconFrequency() { - - - if (AMSATFreqBeacon == null) - { - AMSATFreqBeacon = new Hashtable<>(); - - List listSatellite = amsatList.getSatellites(); - - ListIterator it = listSatellite.listIterator(); - while (it.hasNext()) { - Satellites sat = it.next(); - List listbeacon = sat.getRadioData().getBeacons(); - ListIterator itb = listbeacon.listIterator(); - while (itb.hasNext()) { - Vector vsat = null; - long frequency = 0; - String val = itb.next().getFrequency(); - if (val == null) { - val = "0"; - } - try { - - frequency = Long.parseLong(val.trim()); - } catch (NumberFormatException e) { - log.severe( e.toString()); - } - Long freq = new Long(frequency); - if (AMSATFreqBeacon.containsKey(freq)) { - vsat = AMSATFreqBeacon.get(freq); - } else { - - vsat = new Vector<>(); - AMSATFreqBeacon.put(freq, vsat); - } - vsat.addElement(sat); - } - } - } - - return AMSATFreqBeacon; + Vector vsat = null; + if (AMSATFreqBeacon == null) { + getBeaconFrequency(); } - public Vector getSatellitesBeacons(Long frequency) - { - - Vector vsat =null; - - - if (AMSATFreqBeacon == null) - { - getBeaconFrequency(); + vsat = AMSATFreqBeacon.get(frequency); + + System.out.println("rrt" + vsat); + + return vsat; + } + + /** + * @param AMSATFreqBeacon + * @return + */ + public String getStringHastableFrequence(Hashtable> AMSATFreqBeacon) { + StringBuffer str = new StringBuffer(); + int j = 0; + str.append("["); + for (Long key : AMSATFreqBeacon.keySet()) { + if (j != 0) { + str.append(","); + } + j++; + Vector vectorSat = AMSATFreqBeacon.get(key); + + str.append("[{\"frequency\" :" + key + "}, {\"satellites\" : ["); + for (int i = 0; i < vectorSat.size(); i++) { + if (i != 0) { + str.append(","); } + str.append("{\"name\" : \"" + vectorSat.get(i).getName() + "\"}"); + } + str.append("]}]"); + } + str.append("]"); + return str.toString(); + } + public void getStringSatellite(Vector vsat) { + StringBuffer str = new StringBuffer(); + str.append("["); + if (vsat != null) { - vsat = AMSATFreqBeacon.get(frequency); - - System.out.println("rrt"+vsat); - - return vsat; + Iterator itr = vsat.iterator(); + while (itr.hasNext()) { + System.out.println(itr.next().getName()); + } } - - /** - * @param AMSATFreqBeacon - * @return - */ - public String getStringHastableFrequence(Hashtable> AMSATFreqBeacon) { - StringBuffer str = new StringBuffer(); - int j=0; - str.append("["); - for (Long key : AMSATFreqBeacon.keySet()) { - if(j!=0) - { - str.append(","); - } - j++; - Vector vectorSat = AMSATFreqBeacon.get(key); - - str.append("[{\"frequency\" :"+ key +"}, {\"satellites\" : [" ); - for (int i = 0; i < vectorSat.size(); i++) { - if(i!=0) - { - str.append(","); - } - str.append("{\"name\" : \"" + vectorSat.get(i).getName()+"\"}"); - } - str.append("]}]"); + } + + public Satellites getSatelliteByName(String satName) { + Hashtable Amsatlistbyname = amf.getAmsatListByName(); + + return Amsatlistbyname.get(satName); + } + + public Satellites getSatelliteByNoradID(long norad) { + Hashtable Amsatlistbynorad = amf.getAmsatListNasaId(); + + return Amsatlistbynorad.get(BigInteger.valueOf(norad)); + } + + public String getSatelliteByNameBeacon(String satName) { + Hashtable Amsatlistbyname = amf.getAmsatListByName(); + Satellites sat = Amsatlistbyname.get(satName); + RadioData beacon = sat.getRadioData(); + // JSONArray ja = new JSONArray(beacon); + + JSONObject jsonObject = new JSONObject(beacon); + return jsonObject.toString(); + } + /** + * provide for each beacon frequency, the list of satellite + * + * @return an hastable with frequency in Hz as key + */ + public Hashtable> getBeaconFrequencies() { + + if (AMSATFreqBeacon == null) { + AMSATFreqBeacon = new Hashtable<>(); + + List listSatellite = amsatList.getSatellites(); + + ListIterator it = listSatellite.listIterator(); + while (it.hasNext()) { + Satellites sat = it.next(); + List listbeacon = sat.getRadioData().getBeacons(); + ListIterator itb = listbeacon.listIterator(); + while (itb.hasNext()) { + Vector vsat = null; + long frequency = 0; + String val = itb.next().getFrequency(); + if (val == null) { + val = "0"; + } + try { + + frequency = Long.parseLong(val.trim()); + } catch (NumberFormatException e) { + log.severe(e.toString()); + } + Long freq = new Long(frequency); + if (AMSATFreqBeacon.containsKey(freq)) { + vsat = AMSATFreqBeacon.get(freq); + } else { + + vsat = new Vector<>(); + AMSATFreqBeacon.put(freq, vsat); + } + vsat.addElement(sat); } - str.append("]"); - return str.toString(); + } } + return AMSATFreqBeacon; + } - public void getStringSatellite(Vector vsat) - { - StringBuffer str = new StringBuffer(); - str.append("["); - - - if (vsat != null) - { + public void getSatellitesWithFrequency(long freq) { + Map> mapfreq = getBeaconFrequencies(); - Iterator itr = vsat.iterator(); - while(itr.hasNext()){ + Map> result = + mapfreq.entrySet().stream() + .filter(map -> map.getKey().intValue() == freq) + .collect(Collectors.toMap(map -> map.getKey(), map -> map.getValue())); + System.out.println("Result: " + result); + } + public void getSatellitesWithFrequencyrange(long freqlow, long freqHight) { + Map> mapfreq = getBeaconFrequencies(); - System.out.println(itr.next().getName()); - } - } - - - } - - public Satellites getSatelliteByName (String satName) - { - Hashtable Amsatlistbyname = - amf.getAmsatListByName(); - - return Amsatlistbyname.get(satName); - - } - - public Satellites getSatelliteByNoradID (long norad) - { - Hashtable Amsatlistbynorad = - amf.getAmsatListNasaId(); - - return Amsatlistbynorad.get(BigInteger.valueOf(norad)); - - } - - public String getSatelliteByNameBeacon (String satName) - { - Hashtable Amsatlistbyname = - amf.getAmsatListByName(); - Satellites sat = Amsatlistbyname.get(satName); - RadioData beacon = sat.getRadioData(); - // JSONArray ja = new JSONArray(beacon); - - JSONObject jsonObject = new JSONObject(beacon); - return jsonObject.toString(); - - } - /** - * provide for each beacon frequency, the list of satellite - * - * @return an hastable with frequency in Hz as key - */ - public Hashtable> getBeaconFrequencies() { - - if (AMSATFreqBeacon == null) { - AMSATFreqBeacon = new Hashtable<>(); - - List listSatellite = amsatList.getSatellites(); - - ListIterator it = listSatellite.listIterator(); - while (it.hasNext()) { - Satellites sat = it.next(); - List listbeacon = sat.getRadioData().getBeacons(); - ListIterator itb = listbeacon.listIterator(); - while (itb.hasNext()) { - Vector vsat = null; - long frequency = 0; - String val = itb.next().getFrequency(); - if (val == null) { - val = "0"; - } - try { - - frequency = Long.parseLong(val.trim()); - } catch (NumberFormatException e) { - log.severe(e.toString()); - } - Long freq = new Long(frequency); - if (AMSATFreqBeacon.containsKey(freq)) { - vsat = AMSATFreqBeacon.get(freq); - } else { - - vsat = new Vector<>(); - AMSATFreqBeacon.put(freq, vsat); - } - vsat.addElement(sat); - } - } - } - - return AMSATFreqBeacon; - - } - public void getSatellitesWithFrequency (long freq) - { - - Map> mapfreq = getBeaconFrequencies(); - - Map> result = mapfreq.entrySet() - .stream() - .filter(map -> map.getKey().intValue() == freq) - .collect(Collectors.toMap(map -> map.getKey(), - map -> map.getValue())); - - System.out.println("Result: " + result); - } - - public void getSatellitesWithFrequencyrange (long freqlow, long freqHight) - { - - Map> mapfreq = getBeaconFrequencies(); - - Map> result = mapfreq.entrySet() - .stream() - .filter(map -> map.getKey().intValue() <= freqHight - && map.getKey().intValue() >= freqlow ) - .collect(Collectors.toMap(map -> map.getKey(), - map -> map.getValue())); - - System.out.println("Result: " + result); - } + Map> result = + mapfreq.entrySet().stream() + .filter( + map -> map.getKey().intValue() <= freqHight && map.getKey().intValue() >= freqlow) + .collect(Collectors.toMap(map -> map.getKey(), map -> map.getValue())); + System.out.println("Result: " + result); + } } diff --git a/ModuleSatelliteDatabase/src/main/java/org/josast/AmsatList/check/TwoListCompare.java b/ModuleSatelliteDatabase/src/main/java/org/josast/AmsatList/check/TwoListCompare.java index c8ddb15c1edfe8760a00cab8f8b219f249efd640..9ee3e98eafb110e107a2543fd04872591ca137c5 100644 --- a/ModuleSatelliteDatabase/src/main/java/org/josast/AmsatList/check/TwoListCompare.java +++ b/ModuleSatelliteDatabase/src/main/java/org/josast/AmsatList/check/TwoListCompare.java @@ -3,160 +3,178 @@ package org.josast.AmsatList.check; import java.math.BigInteger; import java.util.Enumeration; import java.util.Vector; - import org.josast.AmsatList.Commande.Commande; import org.josast.ModuleSatelliteDatabase.FlatSatList; import org.josast.ModuleSatelliteDatabase.FlatSatellite; public class TwoListCompare { - public Vector compareNoradId(FlatSatList ref, FlatSatList tocomp) { - Vector listeCommande = new Vector(); - - Enumeration idSat = tocomp.keys(); - while (idSat.hasMoreElements()) { - BigInteger key = (BigInteger) idSat.nextElement(); - - FlatSatellite fsat = ref.get(key); - FlatSatellite flatSatelliteRef = tocomp.get(key); - - if (fsat == null) { - Commande cmd = new Commande(flatSatelliteRef.getSatelliteName(), flatSatelliteRef.getSatelliteNoradId(), - Commande.NasaIDUpdate, "0", "" + flatSatelliteRef.getSatelliteNoradId(), "norad Id not found"); - listeCommande.add(cmd); - } - } - return listeCommande; - } - - public Vector compareIARUCoordination(FlatSatList ref, FlatSatList tocomp) { - Vector listeCommande = new Vector(); - - Enumeration idSat = tocomp.keys(); - - while (idSat.hasMoreElements()) { - BigInteger key = (BigInteger) idSat.nextElement(); - - FlatSatellite fsattocomp = ref.get(key); - FlatSatellite FlatSatelliteRef = tocomp.get(key); - -// System.out.println(FlatSatelliteRef.getSatelliteName()+ " "+ FlatSatelliteRef.getIARUCoordinationLink() ); - - if (fsattocomp != null) { -// System.out.println(FlatSatelliteRef.getSatelliteName()+ " "+ FlatSatelliteRef.getIARUCoordinationLink() + " " + fsattocomp.getIARUCoordinationLink()); -// System.out.println(FlatSatelliteRef.getSatelliteName()+ " "+ FlatSatelliteRef.isIARUCoordination() + " " + fsattocomp.isIARUCoordination()); - Commande cmd = null; - if (FlatSatelliteRef.isIARUCoordination() != fsattocomp.isIARUCoordination()) { - cmd = new Commande(FlatSatelliteRef.getSatelliteName(), - FlatSatelliteRef.getSatelliteNoradId(), Commande.IARUCoordinationUpdate, - "" + FlatSatelliteRef.isIARUCoordination(),"" + fsattocomp.isIARUCoordination(), - "IARU Coordination Update A"); - listeCommande.add(cmd); - System.out.println(cmd); - } - - - if (FlatSatelliteRef.getIARUCoordinationLink()==null ) - { - if (fsattocomp.getIARUCoordinationLink()!= null) - { - cmd = new Commande(FlatSatelliteRef.getSatelliteName(), - FlatSatelliteRef.getSatelliteNoradId(), Commande.IARULinkCoordinationUpdate, - "" + FlatSatelliteRef.getIARUCoordinationLink(),"" + fsattocomp.getIARUCoordinationLink(), - "IARU link update B"); - listeCommande.add(cmd); - } - } else if (fsattocomp.getIARUCoordinationLink()!=null ) - { - if (!FlatSatelliteRef.getIARUCoordinationLink().contains(fsattocomp.getIARUCoordinationLink())) - { - cmd = new Commande(FlatSatelliteRef.getSatelliteName(), - FlatSatelliteRef.getSatelliteNoradId(), Commande.IARULinkCoordinationUpdate, - "" + FlatSatelliteRef.getIARUCoordinationLink(),"" + fsattocomp.getIARUCoordinationLink(), - "IARU link update C"); - listeCommande.add(cmd); - } - } - - System.out.println(cmd); - - - - } - - } - return listeCommande; - } - - public Vector compareSatelliteStatus(FlatSatList ref, FlatSatList tocomp) { - Vector listeCommande = new Vector(); - - Enumeration idSat = tocomp.keys(); - - while (idSat.hasMoreElements()) { - BigInteger key = (BigInteger) idSat.nextElement(); - - FlatSatellite FlatSatelliteRef = ref.get(key); - FlatSatellite FlatSatellitetoComp = tocomp.get(key); - - if ((FlatSatellitetoComp != null) && (FlatSatelliteRef!=null)) { - - String refStatus = FlatSatelliteRef.getSatelliteStatus(); - String compStatus = FlatSatellitetoComp.getSatelliteStatus(); - if ((refStatus != null) & (compStatus != null)) { - if (refStatus.compareTo(compStatus) != 0) { - Commande cmd = new Commande(FlatSatelliteRef.getSatelliteName(), - FlatSatelliteRef.getSatelliteNoradId(), Commande.SatelliteStatusUpdate, compStatus, refStatus, - "Satellite status from : " + compStatus + " to " + refStatus); - listeCommande.add(cmd); - } - } - - } - - } - return listeCommande; - } - - public Vector compareInternationalId(FlatSatList ref, FlatSatList tocomp) { - Vector listeCommande = new Vector(); - - Enumeration idSat = tocomp.keys(); - while (idSat.hasMoreElements()) { - BigInteger key = (BigInteger) idSat.nextElement(); - - FlatSatellite FlatSatellitetoComp = ref.get(key); - FlatSatellite flatSatelliteRef = tocomp.get(key); - - if ((FlatSatellitetoComp != null) && (flatSatelliteRef!=null)) - { - - String refIntId= flatSatelliteRef.getInternationalID(); - String compIntId = FlatSatellitetoComp.getInternationalID(); - - if ((refIntId==null) && (compIntId != null)) - { - Commande cmd = new Commande(flatSatelliteRef.getSatelliteName(), - flatSatelliteRef.getSatelliteNoradId(), Commande.InternationalIDUpdate,compIntId, "null", - "Satellite status from : " + "null" + " to " + compIntId); - listeCommande.add(cmd); - } else - if ((refIntId != null) && (compIntId != null)) { - if (refIntId.compareTo(compIntId) != 0) { - Commande cmd = new Commande(flatSatelliteRef.getSatelliteName(), - flatSatelliteRef.getSatelliteNoradId(), Commande.InternationalIDUpdate, compIntId, refIntId, - "Satellite status from : " + refIntId + " to " + compIntId); - listeCommande.add(cmd); - } - - } - } - } - - - - return listeCommande; - } - - + public Vector compareNoradId(FlatSatList ref, FlatSatList tocomp) { + Vector listeCommande = new Vector(); + + Enumeration idSat = tocomp.keys(); + while (idSat.hasMoreElements()) { + BigInteger key = (BigInteger) idSat.nextElement(); + + FlatSatellite fsat = ref.get(key); + FlatSatellite flatSatelliteRef = tocomp.get(key); + + if (fsat == null) { + Commande cmd = + new Commande( + flatSatelliteRef.getSatelliteName(), + flatSatelliteRef.getSatelliteNoradId(), + Commande.NasaIDUpdate, + "0", + "" + flatSatelliteRef.getSatelliteNoradId(), + "norad Id not found"); + listeCommande.add(cmd); + } + } + return listeCommande; + } + + public Vector compareIARUCoordination(FlatSatList ref, FlatSatList tocomp) { + Vector listeCommande = new Vector(); + + Enumeration idSat = tocomp.keys(); + + while (idSat.hasMoreElements()) { + BigInteger key = (BigInteger) idSat.nextElement(); + + FlatSatellite fsattocomp = ref.get(key); + FlatSatellite FlatSatelliteRef = tocomp.get(key); + + // System.out.println(FlatSatelliteRef.getSatelliteName()+ " "+ + // FlatSatelliteRef.getIARUCoordinationLink() ); + + if (fsattocomp != null) { + // System.out.println(FlatSatelliteRef.getSatelliteName()+ " "+ + // FlatSatelliteRef.getIARUCoordinationLink() + " " + + // fsattocomp.getIARUCoordinationLink()); + // System.out.println(FlatSatelliteRef.getSatelliteName()+ " "+ + // FlatSatelliteRef.isIARUCoordination() + " " + fsattocomp.isIARUCoordination()); + Commande cmd = null; + if (FlatSatelliteRef.isIARUCoordination() != fsattocomp.isIARUCoordination()) { + cmd = + new Commande( + FlatSatelliteRef.getSatelliteName(), + FlatSatelliteRef.getSatelliteNoradId(), + Commande.IARUCoordinationUpdate, + "" + FlatSatelliteRef.isIARUCoordination(), + "" + fsattocomp.isIARUCoordination(), + "IARU Coordination Update A"); + listeCommande.add(cmd); + System.out.println(cmd); + } + + if (FlatSatelliteRef.getIARUCoordinationLink() == null) { + if (fsattocomp.getIARUCoordinationLink() != null) { + cmd = + new Commande( + FlatSatelliteRef.getSatelliteName(), + FlatSatelliteRef.getSatelliteNoradId(), + Commande.IARULinkCoordinationUpdate, + "" + FlatSatelliteRef.getIARUCoordinationLink(), + "" + fsattocomp.getIARUCoordinationLink(), + "IARU link update B"); + listeCommande.add(cmd); + } + } else if (fsattocomp.getIARUCoordinationLink() != null) { + if (!FlatSatelliteRef.getIARUCoordinationLink() + .contains(fsattocomp.getIARUCoordinationLink())) { + cmd = + new Commande( + FlatSatelliteRef.getSatelliteName(), + FlatSatelliteRef.getSatelliteNoradId(), + Commande.IARULinkCoordinationUpdate, + "" + FlatSatelliteRef.getIARUCoordinationLink(), + "" + fsattocomp.getIARUCoordinationLink(), + "IARU link update C"); + listeCommande.add(cmd); + } + } + + System.out.println(cmd); + } + } + return listeCommande; + } + + public Vector compareSatelliteStatus(FlatSatList ref, FlatSatList tocomp) { + Vector listeCommande = new Vector(); + + Enumeration idSat = tocomp.keys(); + + while (idSat.hasMoreElements()) { + BigInteger key = (BigInteger) idSat.nextElement(); + + FlatSatellite FlatSatelliteRef = ref.get(key); + FlatSatellite FlatSatellitetoComp = tocomp.get(key); + + if ((FlatSatellitetoComp != null) && (FlatSatelliteRef != null)) { + + String refStatus = FlatSatelliteRef.getSatelliteStatus(); + String compStatus = FlatSatellitetoComp.getSatelliteStatus(); + if ((refStatus != null) & (compStatus != null)) { + if (refStatus.compareTo(compStatus) != 0) { + Commande cmd = + new Commande( + FlatSatelliteRef.getSatelliteName(), + FlatSatelliteRef.getSatelliteNoradId(), + Commande.SatelliteStatusUpdate, + compStatus, + refStatus, + "Satellite status from : " + compStatus + " to " + refStatus); + listeCommande.add(cmd); + } + } + } + } + return listeCommande; + } + + public Vector compareInternationalId(FlatSatList ref, FlatSatList tocomp) { + Vector listeCommande = new Vector(); + + Enumeration idSat = tocomp.keys(); + while (idSat.hasMoreElements()) { + BigInteger key = (BigInteger) idSat.nextElement(); + + FlatSatellite FlatSatellitetoComp = ref.get(key); + FlatSatellite flatSatelliteRef = tocomp.get(key); + + if ((FlatSatellitetoComp != null) && (flatSatelliteRef != null)) { + + String refIntId = flatSatelliteRef.getInternationalID(); + String compIntId = FlatSatellitetoComp.getInternationalID(); + + if ((refIntId == null) && (compIntId != null)) { + Commande cmd = + new Commande( + flatSatelliteRef.getSatelliteName(), + flatSatelliteRef.getSatelliteNoradId(), + Commande.InternationalIDUpdate, + compIntId, + "null", + "Satellite status from : " + "null" + " to " + compIntId); + listeCommande.add(cmd); + } else if ((refIntId != null) && (compIntId != null)) { + if (refIntId.compareTo(compIntId) != 0) { + Commande cmd = + new Commande( + flatSatelliteRef.getSatelliteName(), + flatSatelliteRef.getSatelliteNoradId(), + Commande.InternationalIDUpdate, + compIntId, + refIntId, + "Satellite status from : " + refIntId + " to " + compIntId); + listeCommande.add(cmd); + } + } + } + } + + return listeCommande; + } } diff --git a/ModuleSatelliteDatabase/src/main/java/org/josast/AmsatList/source/ReadCsvFile.java b/ModuleSatelliteDatabase/src/main/java/org/josast/AmsatList/source/ReadCsvFile.java index 1559083f90bb7d334a2c61d8399096ddfa196cf2..78f4f593f232721fb6013b510a55f6e59c3707dc 100644 --- a/ModuleSatelliteDatabase/src/main/java/org/josast/AmsatList/source/ReadCsvFile.java +++ b/ModuleSatelliteDatabase/src/main/java/org/josast/AmsatList/source/ReadCsvFile.java @@ -1,5 +1,10 @@ package org.josast.AmsatList.source; +import com.opencsv.CSVParser; +import com.opencsv.CSVParserBuilder; +import com.opencsv.CSVReader; +import com.opencsv.CSVReaderBuilder; +import com.opencsv.exceptions.CsvValidationException; import java.io.FileNotFoundException; import java.io.FileReader; import java.io.IOException; @@ -7,89 +12,66 @@ import java.util.ArrayList; import java.util.List; import java.util.logging.Logger; -import com.opencsv.CSVParser; -import com.opencsv.CSVParserBuilder; -import com.opencsv.CSVReader; -import com.opencsv.CSVReaderBuilder; -import com.opencsv.exceptions.CsvValidationException; - - -/** - * @author chris - * - */ +/** @author chris */ public class ReadCsvFile { - private Logger log = Logger.getLogger(getClass().getName()); - private char separator = ';'; + private Logger log = Logger.getLogger(getClass().getName()); + private char separator = ';'; + + public List allLine(String file) { + List list = new ArrayList<>(); + FileReader fileReader = null; + try { + fileReader = new FileReader(file); + } catch (FileNotFoundException e) { + log.severe(" File not found : " + e.getMessage()); + } + CSVParser parser = new CSVParserBuilder().withSeparator(separator).build(); + CSVReader csvReader = new CSVReaderBuilder(fileReader).withCSVParser(parser).build(); - public List allLine(String file) { - List list = new ArrayList<>(); - FileReader fileReader = null; - try { - fileReader = new FileReader(file); - } catch (FileNotFoundException e) { - log.severe(" File not found : "+ e.getMessage()); - } - CSVParser parser = new CSVParserBuilder().withSeparator(separator).build(); - CSVReader csvReader = - new CSVReaderBuilder(fileReader).withCSVParser(parser).build(); + // CSVReader csvReader = new CSVReader(fileReader,';'); + String[] line; + boolean loop = true; - // CSVReader csvReader = new CSVReader(fileReader,';'); - String[] line; - boolean loop = true; - - while( loop) - { - try { - line = csvReader.readNext(); - if (line !=null) - { - list.add(line); - } - else - { - loop = false; - } - - } catch (IOException e) { - e.printStackTrace(); - log.severe(e.getMessage()); - } catch (CsvValidationException e) { - e.printStackTrace(); - log.severe("CSV Validation" + e.getMessage()); + while (loop) { + try { + line = csvReader.readNext(); + if (line != null) { + list.add(line); + } else { + loop = false; } - finally { - // log.warning("Erreur lecture ligne "); - } - } - - try { - fileReader.close(); - csvReader.close(); - } catch (IOException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - log.severe(e.getMessage()); - } - - - return list; - } + } catch (IOException e) { + e.printStackTrace(); + log.severe(e.getMessage()); + } catch (CsvValidationException e) { + e.printStackTrace(); + log.severe("CSV Validation" + e.getMessage()); + } finally { + // log.warning("Erreur lecture ligne "); + } + } + + try { + fileReader.close(); + csvReader.close(); + } catch (IOException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + log.severe(e.getMessage()); + } - /** - * @return the separator - */ - public char getSeparator() { - return separator; - } + return list; + } - /** - * @param separator the separator to set - */ - public void setSeparator(char separator) { - this.separator = separator; - } + /** @return the separator */ + public char getSeparator() { + return separator; + } + /** @param separator the separator to set */ + public void setSeparator(char separator) { + this.separator = separator; + } } diff --git a/ModuleSatelliteDatabase/src/main/java/org/josast/AmsatList/source/SimplifiedDK3WM.java b/ModuleSatelliteDatabase/src/main/java/org/josast/AmsatList/source/SimplifiedDK3WM.java index 3ce01819c8dd0bcff675b9d726a61834d3e371eb..4e9fd21152727732d5f2dafb760e1db22d8ae280 100644 --- a/ModuleSatelliteDatabase/src/main/java/org/josast/AmsatList/source/SimplifiedDK3WM.java +++ b/ModuleSatelliteDatabase/src/main/java/org/josast/AmsatList/source/SimplifiedDK3WM.java @@ -4,86 +4,66 @@ import java.math.BigInteger; import java.util.List; import java.util.ListIterator; import java.util.logging.Logger; - import org.josast.ModuleSatelliteDatabase.FlatSatList; import org.josast.ModuleSatelliteDatabase.FlatSatelliteImp; public class SimplifiedDK3WM { - - private Logger log = Logger.getLogger(getClass().getName()); - private FlatSatList fsatLits= new FlatSatList(); - + private Logger log = Logger.getLogger(getClass().getName()); + private FlatSatList fsatLits = new FlatSatList(); + private int Satellite = 0; + private int Status = 1; + private int NORAD = 2; + private int IARU = 3; - private int Satellite = 0; - private int Status = 1; - private int NORAD = 2; - private int IARU =3; + public SimplifiedDK3WM(String file) { - - public SimplifiedDK3WM(String file) { - - ReadCsvFile rcv = new ReadCsvFile(); - List list = rcv.allLine(file); - ListIterator it = list.listIterator(); - while (it.hasNext()) - { - String[] value = it.next(); - try { - BigInteger biNorad = BigInteger.valueOf(Long.parseLong(value[NORAD])); - FlatSatelliteImp fs=new FlatSatelliteImp(); - fs.setSatelliteName(value[Satellite]); - fs.setSatelliteNoradId(biNorad); - fs.setSatelliteStatus(TranslateStatus(value[Status])); - if (value[IARU].startsWith("http")) - { - fs.setIARUCoordinationLink(value[IARU]); - fs.setIARUCoordination(true); - } - else - { - fs.setIARUCoordinationLink(null); - fs.setIARUCoordination(false); - } - fsatLits.put(biNorad, fs); - } catch ( Exception e) - { - log.severe("Wrong NASA ID for "+ value[Satellite] +" info "+value[NORAD] ); - } - - - } - } + ReadCsvFile rcv = new ReadCsvFile(); + List list = rcv.allLine(file); + ListIterator it = list.listIterator(); + while (it.hasNext()) { + String[] value = it.next(); + try { + BigInteger biNorad = BigInteger.valueOf(Long.parseLong(value[NORAD])); + FlatSatelliteImp fs = new FlatSatelliteImp(); + fs.setSatelliteName(value[Satellite]); + fs.setSatelliteNoradId(biNorad); + fs.setSatelliteStatus(TranslateStatus(value[Status])); + if (value[IARU].startsWith("http")) { + fs.setIARUCoordinationLink(value[IARU]); + fs.setIARUCoordination(true); + } else { + fs.setIARUCoordinationLink(null); + fs.setIARUCoordination(false); + } + fsatLits.put(biNorad, fs); + } catch (Exception e) { + log.severe("Wrong NASA ID for " + value[Satellite] + " info " + value[NORAD]); + } + } + } - /** - * @return the fsatLits - */ - public FlatSatList getFsatLits() { - return fsatLits; - } + /** @return the fsatLits */ + public FlatSatList getFsatLits() { + return fsatLits; + } + /** @param fsatLits the fsatLits to set */ + public void setFsatLits(FlatSatList fsatLits) { + this.fsatLits = fsatLits; + } - /** - * @param fsatLits the fsatLits to set - */ - public void setFsatLits(FlatSatList fsatLits) { - this.fsatLits = fsatLits; - } - - private String TranslateStatus(String status) { + private String TranslateStatus(String status) { - String etat = "Unknown"; - - if (status.trim().contentEquals("ACTIVE")) - { - etat = "Operational"; - } else if (status.trim().contentEquals("INACTIVE")) - { - etat = "Inactive"; - } - return etat; - } + String etat = "Unknown"; + if (status.trim().contentEquals("ACTIVE")) { + etat = "Operational"; + } else if (status.trim().contentEquals("INACTIVE")) { + etat = "Inactive"; + } + return etat; + } } diff --git a/ModuleSatelliteDatabase/src/main/java/org/josast/AmsatList/source/SimplifiedJ9PL.java b/ModuleSatelliteDatabase/src/main/java/org/josast/AmsatList/source/SimplifiedJ9PL.java index 287ecc9e7f25d96a1f3757d5c3d712d0d10f694a..16631547964fe06e2f1d95482f149d3760124044 100644 --- a/ModuleSatelliteDatabase/src/main/java/org/josast/AmsatList/source/SimplifiedJ9PL.java +++ b/ModuleSatelliteDatabase/src/main/java/org/josast/AmsatList/source/SimplifiedJ9PL.java @@ -4,97 +4,70 @@ import java.math.BigInteger; import java.util.List; import java.util.ListIterator; import java.util.logging.Logger; - import org.josast.ModuleSatelliteDatabase.FlatSatList; import org.josast.ModuleSatelliteDatabase.FlatSatelliteImp; public class SimplifiedJ9PL { - - private Logger log = Logger.getLogger(getClass().getName()); - - private FlatSatList fsatLits= new FlatSatList(); - - // SatelliteName NASAID FREQ 1 FREQ 2 FREQ 3 MODE CALLSIGN STATUS - - - - - - private int SATNAME = 0; - private int NORADID = 1; - private int FREQ1 =2; - private int FREQ2 = 3; - private int FREQ3 = 4; - private int MODE = 5; - private int CALLSIGN = 6; - private int STATUS = 7; - - - - public SimplifiedJ9PL(String file) { - ReadCsvFile rcv = new ReadCsvFile(); - List list = rcv.allLine(file); - ListIterator it = list.listIterator(); - while (it.hasNext()) - { - String[] value = it.next(); - try { - BigInteger biNorad = BigInteger.valueOf(Long.parseLong(value[NORADID])); - FlatSatelliteImp fs=new FlatSatelliteImp(); - fs.setSatelliteName(value[SATNAME]); - fs.setSatelliteNoradId(biNorad); - fs.setSatelliteStatus(TranslateStatus(value[STATUS])); - - - fsatLits.put(biNorad, fs); - } catch ( Exception e) - { - log.severe("Wrong NASA ID for "+ value[SATNAME] +" info "+value[NORADID] ); - } - - - } - } - - /** - * @return the fsatLits - */ - public FlatSatList getFsatLits() { - return fsatLits; - } - - - - /** - * @param fsatLits the fsatLits to set - */ - public void setFsatLits(FlatSatList fsatLits) { - this.fsatLits = fsatLits; - } - - private String TranslateStatus(String status) { - String etat = "Unknown"; - - if (status.trim().contentEquals("active")) - { - etat = "Operational"; - } else if (status.trim().contentEquals("deep space")) - { - etat = "Deep Space"; - } - else if (status.trim().contentEquals("inactive")) - { - etat = "Inactive"; - }else if (status.trim().contentEquals("Non-Operational")) - { - etat = "Inactive"; - } - else if (status.trim().contentEquals("re-entered")) - { - etat = "Decayed"; - } - return etat; - - } + private Logger log = Logger.getLogger(getClass().getName()); + + private FlatSatList fsatLits = new FlatSatList(); + + // SatelliteName NASAID FREQ 1 FREQ 2 FREQ 3 MODE CALLSIGN STATUS + + private int SATNAME = 0; + private int NORADID = 1; + private int FREQ1 = 2; + private int FREQ2 = 3; + private int FREQ3 = 4; + private int MODE = 5; + private int CALLSIGN = 6; + private int STATUS = 7; + + public SimplifiedJ9PL(String file) { + ReadCsvFile rcv = new ReadCsvFile(); + List list = rcv.allLine(file); + ListIterator it = list.listIterator(); + while (it.hasNext()) { + String[] value = it.next(); + try { + BigInteger biNorad = BigInteger.valueOf(Long.parseLong(value[NORADID])); + FlatSatelliteImp fs = new FlatSatelliteImp(); + fs.setSatelliteName(value[SATNAME]); + fs.setSatelliteNoradId(biNorad); + fs.setSatelliteStatus(TranslateStatus(value[STATUS])); + + fsatLits.put(biNorad, fs); + } catch (Exception e) { + log.severe("Wrong NASA ID for " + value[SATNAME] + " info " + value[NORADID]); + } + } + } + + /** @return the fsatLits */ + public FlatSatList getFsatLits() { + return fsatLits; + } + + /** @param fsatLits the fsatLits to set */ + public void setFsatLits(FlatSatList fsatLits) { + this.fsatLits = fsatLits; + } + + private String TranslateStatus(String status) { + String etat = "Unknown"; + + if (status.trim().contentEquals("active")) { + etat = "Operational"; + } else if (status.trim().contentEquals("deep space")) { + etat = "Deep Space"; + } else if (status.trim().contentEquals("inactive")) { + etat = "Inactive"; + } else if (status.trim().contentEquals("Non-Operational")) { + etat = "Inactive"; + } else if (status.trim().contentEquals("re-entered")) { + etat = "Decayed"; + } + return etat; + } } diff --git a/ModuleSatelliteDatabase/src/main/java/org/josast/AmsatList/source/SimplifiedN2YO.java b/ModuleSatelliteDatabase/src/main/java/org/josast/AmsatList/source/SimplifiedN2YO.java index f67e2cb94212b3506788b8e7aeca8f4754ee7c18..44b4fdb9e1bd8e49445ac779d10f58fc9358519e 100644 --- a/ModuleSatelliteDatabase/src/main/java/org/josast/AmsatList/source/SimplifiedN2YO.java +++ b/ModuleSatelliteDatabase/src/main/java/org/josast/AmsatList/source/SimplifiedN2YO.java @@ -4,77 +4,57 @@ import java.math.BigInteger; import java.util.List; import java.util.ListIterator; import java.util.logging.Logger; - import org.josast.ModuleSatelliteDatabase.FlatSatList; import org.josast.ModuleSatelliteDatabase.FlatSatelliteImp; public class SimplifiedN2YO { - private Logger log = Logger.getLogger(getClass().getName()); - - - - private FlatSatList fsatLits= new FlatSatList(); - //Name Noardi Inten Status Frea Orbite - - - private int SatelliteName = 0; - private int NORADID = 1; - private int INTERNATIONALID = 2; - private int STATUS =3; - private int Frequence = 4; - private int Orbite = 5; - - - public SimplifiedN2YO(String file) { - - ReadCsvFile rcv = new ReadCsvFile(); - List list = rcv.allLine(file); - ListIterator it = list.listIterator(); - while (it.hasNext()) - { - String[] value = it.next(); - try { - BigInteger biNorad = BigInteger.valueOf(Long.parseLong(value[NORADID])); - FlatSatelliteImp fs=new FlatSatelliteImp(); - fs.setSatelliteName(value[SatelliteName]); - fs.setSatelliteNoradId(biNorad); - fs.setSatelliteStatus(TranslateStatus(value[STATUS])); - fs.setInternationalID(value[INTERNATIONALID]); - - fsatLits.put(biNorad, fs); - } catch ( Exception e) - { - log.severe("Wrong NASA ID for "+ value[SatelliteName] +" info "+value[NORADID] ); - } - - - } - } - - - private String TranslateStatus(String string) { - // TODO Auto-generated method stub - return " "; - } - - - - /** - * @return the fsatLits - */ - public FlatSatList getFsatLits() { - return fsatLits; - } - - - /** - * @param fsatLits the fsatLits to set - */ - public void setFsatLits(FlatSatList fsatLits) { - this.fsatLits = fsatLits; - } - - - + private Logger log = Logger.getLogger(getClass().getName()); + + private FlatSatList fsatLits = new FlatSatList(); + // Name Noardi Inten Status Frea Orbite + + private int SatelliteName = 0; + private int NORADID = 1; + private int INTERNATIONALID = 2; + private int STATUS = 3; + private int Frequence = 4; + private int Orbite = 5; + + public SimplifiedN2YO(String file) { + + ReadCsvFile rcv = new ReadCsvFile(); + List list = rcv.allLine(file); + ListIterator it = list.listIterator(); + while (it.hasNext()) { + String[] value = it.next(); + try { + BigInteger biNorad = BigInteger.valueOf(Long.parseLong(value[NORADID])); + FlatSatelliteImp fs = new FlatSatelliteImp(); + fs.setSatelliteName(value[SatelliteName]); + fs.setSatelliteNoradId(biNorad); + fs.setSatelliteStatus(TranslateStatus(value[STATUS])); + fs.setInternationalID(value[INTERNATIONALID]); + + fsatLits.put(biNorad, fs); + } catch (Exception e) { + log.severe("Wrong NASA ID for " + value[SatelliteName] + " info " + value[NORADID]); + } + } + } + + private String TranslateStatus(String string) { + // TODO Auto-generated method stub + return " "; + } + + /** @return the fsatLits */ + public FlatSatList getFsatLits() { + return fsatLits; + } + + /** @param fsatLits the fsatLits to set */ + public void setFsatLits(FlatSatList fsatLits) { + this.fsatLits = fsatLits; + } } diff --git a/ModuleSatelliteDatabase/src/main/java/org/josast/AmsatList/source/SimplifiedSatnogsTable.java b/ModuleSatelliteDatabase/src/main/java/org/josast/AmsatList/source/SimplifiedSatnogsTable.java index cbddb09a96fb298c0ffbd7ac8c57a664aae75a6a..fcbd062e9121f511a0df3d82f9076ee9d6b59cbd 100644 --- a/ModuleSatelliteDatabase/src/main/java/org/josast/AmsatList/source/SimplifiedSatnogsTable.java +++ b/ModuleSatelliteDatabase/src/main/java/org/josast/AmsatList/source/SimplifiedSatnogsTable.java @@ -4,97 +4,72 @@ import java.math.BigInteger; import java.util.List; import java.util.ListIterator; import java.util.logging.Logger; - import org.josast.ModuleSatelliteDatabase.FlatSatList; import org.josast.ModuleSatelliteDatabase.FlatSatelliteImp; public class SimplifiedSatnogsTable { - - // Satellite Identifier Name NORAD Status Alt. Names Transmitters Operator Dashboard - - - private Logger log = Logger.getLogger(getClass().getName()); - - private FlatSatList fsatLits= new FlatSatList(); - - // SatelliteName NASAID FREQ 1 FREQ 2 FREQ 3 MODE CALLSIGN STATUS - - - - - private int SATNOGSID = 0; - private int SATNAME = 1; - private int NORADID = 2; - private int STATUS = 3; - private int ALTNAME = 4; - private int TRANSMITER = 5; - private int OPERATOR = 6; - private int DASHBOARD = 6; - - public SimplifiedSatnogsTable(String file) { - ReadCsvFile rcv = new ReadCsvFile(); - List list = rcv.allLine(file); - ListIterator it = list.listIterator(); - while (it.hasNext()) - { - String[] value = it.next(); - try { - BigInteger biNorad = BigInteger.valueOf(Long.parseLong(value[NORADID])); - FlatSatelliteImp fs=new FlatSatelliteImp(); - fs.setSatelliteName(value[SATNAME]); - fs.setSatelliteNoradId(biNorad); - fs.setSatelliteStatus(TranslateStatus(value[STATUS])); - - - fsatLits.put(biNorad, fs); - } catch ( Exception e) - { - log.severe("Wrong NASA ID for "+ value[SATNAME] +" info "+value[NORADID] ); - } - - - } - } - - /** - * @return the fsatLits - */ - public FlatSatList getFsatLits() { - return fsatLits; - } - - - - /** - * @param fsatLits the fsatLits to set - */ - public void setFsatLits(FlatSatList fsatLits) { - this.fsatLits = fsatLits; - } - - private String TranslateStatus(String status) { - String etat = "Unknown"; - - if (status.trim().contentEquals("Operational")) - { - etat = "Operational"; - } else if (status.trim().contentEquals("deep space")) - { - etat = "Deep Space"; - } - else if (status.trim().contentEquals("Malfunctioning")) - { - etat = "Inactive"; - }else if (status.trim().contentEquals("Non-Operational")) - { - etat = "Inactive"; - } - else if (status.trim().contentEquals("Decayed")) - { - etat = "Decayed"; - } - return etat; - - } + // Satellite Identifier Name NORAD Status Alt. Names Transmitters Operator Dashboard + + private Logger log = Logger.getLogger(getClass().getName()); + + private FlatSatList fsatLits = new FlatSatList(); + + // SatelliteName NASAID FREQ 1 FREQ 2 FREQ 3 MODE CALLSIGN STATUS + + private int SATNOGSID = 0; + private int SATNAME = 1; + private int NORADID = 2; + private int STATUS = 3; + private int ALTNAME = 4; + private int TRANSMITER = 5; + private int OPERATOR = 6; + private int DASHBOARD = 6; + + public SimplifiedSatnogsTable(String file) { + ReadCsvFile rcv = new ReadCsvFile(); + List list = rcv.allLine(file); + ListIterator it = list.listIterator(); + while (it.hasNext()) { + String[] value = it.next(); + try { + BigInteger biNorad = BigInteger.valueOf(Long.parseLong(value[NORADID])); + FlatSatelliteImp fs = new FlatSatelliteImp(); + fs.setSatelliteName(value[SATNAME]); + fs.setSatelliteNoradId(biNorad); + fs.setSatelliteStatus(TranslateStatus(value[STATUS])); + + fsatLits.put(biNorad, fs); + } catch (Exception e) { + log.severe("Wrong NASA ID for " + value[SATNAME] + " info " + value[NORADID]); + } + } + } + + /** @return the fsatLits */ + public FlatSatList getFsatLits() { + return fsatLits; + } + + /** @param fsatLits the fsatLits to set */ + public void setFsatLits(FlatSatList fsatLits) { + this.fsatLits = fsatLits; + } + + private String TranslateStatus(String status) { + String etat = "Unknown"; + + if (status.trim().contentEquals("Operational")) { + etat = "Operational"; + } else if (status.trim().contentEquals("deep space")) { + etat = "Deep Space"; + } else if (status.trim().contentEquals("Malfunctioning")) { + etat = "Inactive"; + } else if (status.trim().contentEquals("Non-Operational")) { + etat = "Inactive"; + } else if (status.trim().contentEquals("Decayed")) { + etat = "Decayed"; + } + return etat; + } } diff --git a/ModuleSatelliteDatabase/src/main/java/org/josast/AmsatList/source/gcat/LaunchCat.java b/ModuleSatelliteDatabase/src/main/java/org/josast/AmsatList/source/gcat/LaunchCat.java index b58fecedc133fd6082b1f8b60ffc27912d5bf866..2dda4d522d2b8d6913bba100adcfa754cdccbe1c 100644 --- a/ModuleSatelliteDatabase/src/main/java/org/josast/AmsatList/source/gcat/LaunchCat.java +++ b/ModuleSatelliteDatabase/src/main/java/org/josast/AmsatList/source/gcat/LaunchCat.java @@ -2,105 +2,86 @@ package org.josast.AmsatList.source.gcat; public class LaunchCat { - private String launchTag; - private String launch_Date; - private String LVType; - private String Mission; - private String launchSite; - private String launchPad; - private String agency; - /** - * @return the launchTag - */ - public String getLaunchTag() { - return launchTag; - } - /** - * @param launchTag the launchTag to set - */ - public void setLaunchTag(String launchTag) { - this.launchTag = launchTag; - } - /** - * @return the launch_Date - */ - public String getLaunch_Date() { - return launch_Date; - } - /** - * @param launch_Date the launch_Date to set - */ - public void setLaunch_Date(String launch_Date) { - this.launch_Date = launch_Date; - } - /** - * @return the lVType - */ - public String getLVType() { - return LVType; - } - /** - * @param lVType the lVType to set - */ - public void setLVType(String lVType) { - LVType = lVType; - } - /** - * @return the mission - */ - public String getMission() { - return Mission; - } - /** - * @param mission the mission to set - */ - public void setMission(String mission) { - Mission = mission; - } - /** - * @return the launchSite - */ - public String getLaunchSite() { - return launchSite; - } - /** - * @param launchSite the launchSite to set - */ - public void setLaunchSite(String launchSite) { - this.launchSite = launchSite; - } - /** - * @return the launchPad - */ - public String getLaunchPad() { - return launchPad; - } - /** - * @param launchPad the launchPad to set - */ - public void setLaunchPad(String launchPad) { - this.launchPad = launchPad; - } - /** - * @return the agency - */ - public String getAgency() { - return agency; - } - /** - * @param agency the agency to set - */ - public void setAgency(String agency) { - this.agency = agency; - } - @Override - public String toString() { - return "LaunchCat [launchTag=" + launchTag + ", launch_Date=" + launch_Date + ", LVType=" + LVType - + ", Mission=" + Mission + ", launchSite=" + launchSite + ", launchPad=" + launchPad + ", agency=" - + agency + "]"; - } - - + private String launchTag; + private String launch_Date; + private String LVType; + private String Mission; + private String launchSite; + private String launchPad; + private String agency; + /** @return the launchTag */ + public String getLaunchTag() { + return launchTag; + } + /** @param launchTag the launchTag to set */ + public void setLaunchTag(String launchTag) { + this.launchTag = launchTag; + } + /** @return the launch_Date */ + public String getLaunch_Date() { + return launch_Date; + } + /** @param launch_Date the launch_Date to set */ + public void setLaunch_Date(String launch_Date) { + this.launch_Date = launch_Date; + } + /** @return the lVType */ + public String getLVType() { + return LVType; + } + /** @param lVType the lVType to set */ + public void setLVType(String lVType) { + LVType = lVType; + } + /** @return the mission */ + public String getMission() { + return Mission; + } + /** @param mission the mission to set */ + public void setMission(String mission) { + Mission = mission; + } + /** @return the launchSite */ + public String getLaunchSite() { + return launchSite; + } + /** @param launchSite the launchSite to set */ + public void setLaunchSite(String launchSite) { + this.launchSite = launchSite; + } + /** @return the launchPad */ + public String getLaunchPad() { + return launchPad; + } + /** @param launchPad the launchPad to set */ + public void setLaunchPad(String launchPad) { + this.launchPad = launchPad; + } + /** @return the agency */ + public String getAgency() { + return agency; + } + /** @param agency the agency to set */ + public void setAgency(String agency) { + this.agency = agency; + } - + @Override + public String toString() { + return "LaunchCat [launchTag=" + + launchTag + + ", launch_Date=" + + launch_Date + + ", LVType=" + + LVType + + ", Mission=" + + Mission + + ", launchSite=" + + launchSite + + ", launchPad=" + + launchPad + + ", agency=" + + agency + + "]"; + } } diff --git a/ModuleSatelliteDatabase/src/main/java/org/josast/AmsatList/source/gcat/LaunchCatTsvFile.java b/ModuleSatelliteDatabase/src/main/java/org/josast/AmsatList/source/gcat/LaunchCatTsvFile.java index 0c217d2417a25b7a2eac1ad174552135e9681424..96ccac619a8f51cc8fba2ff5d43548d59eb3295f 100644 --- a/ModuleSatelliteDatabase/src/main/java/org/josast/AmsatList/source/gcat/LaunchCatTsvFile.java +++ b/ModuleSatelliteDatabase/src/main/java/org/josast/AmsatList/source/gcat/LaunchCatTsvFile.java @@ -1,93 +1,80 @@ package org.josast.AmsatList.source.gcat; -import java.math.BigInteger; import java.util.Hashtable; import java.util.List; import java.util.ListIterator; import java.util.logging.Logger; - import org.josast.AmsatList.source.ReadCsvFile; public class LaunchCatTsvFile { - private Logger log = Logger.getLogger(getClass().getName()); - private Hashtable launchList = new Hashtable(); - - private int INDEX_Launch_Tag = 0 ; - private int INDEX_Launch_JD = 1 ; - private int INDEX_Launch_Date = 2 ; - private int INDEX_LV_Type = 3 ; - private int INDEX_Variant = 4 ; - private int INDEX_Flight_ID = 5 ; - private int INDEX_Flight = 6 ; - private int INDEX_Mission = 7 ; - private int INDEX_FlightCode = 8 ; - private int INDEX_Platform = 9 ; - private int INDEX_Launch_Site = 10 ; - private int INDEX_Launch_Pad = 11 ; - private int INDEX_Ascent_Site = 12 ; - private int INDEX_Ascent_Pad = 13 ; - private int INDEX_Apogee = 14 ; - private int INDEX_Apoflag = 15 ; - private int INDEX_Range = 16 ; - private int INDEX_RangeFlag = 17 ; - private int INDEX_Dest = 18 ; - private int INDEX_Agency = 19 ; - private int INDEX_Launch_Code = 20 ; - private int INDEX_Group = 21 ; - private int INDEX_Category = 22 ; - private int INDEX_LTCite = 23 ; - private int INDEX_Cite = 24 ; - private int INDEX_Notes = 25 ; - - - public LaunchCatTsvFile( String file) - { - ReadCsvFile rcv = new ReadCsvFile(); - rcv.setSeparator('\t'); - - List list = rcv.allLine(file); - - ListIterator it = list.listIterator(); - while (it.hasNext()) { - String[] value = it.next(); - try { - - // Lecture des données - - - LaunchCat launchcat = new LaunchCat(); + private Logger log = Logger.getLogger(getClass().getName()); + private Hashtable launchList = new Hashtable(); + + private int INDEX_Launch_Tag = 0; + private int INDEX_Launch_JD = 1; + private int INDEX_Launch_Date = 2; + private int INDEX_LV_Type = 3; + private int INDEX_Variant = 4; + private int INDEX_Flight_ID = 5; + private int INDEX_Flight = 6; + private int INDEX_Mission = 7; + private int INDEX_FlightCode = 8; + private int INDEX_Platform = 9; + private int INDEX_Launch_Site = 10; + private int INDEX_Launch_Pad = 11; + private int INDEX_Ascent_Site = 12; + private int INDEX_Ascent_Pad = 13; + private int INDEX_Apogee = 14; + private int INDEX_Apoflag = 15; + private int INDEX_Range = 16; + private int INDEX_RangeFlag = 17; + private int INDEX_Dest = 18; + private int INDEX_Agency = 19; + private int INDEX_Launch_Code = 20; + private int INDEX_Group = 21; + private int INDEX_Category = 22; + private int INDEX_LTCite = 23; + private int INDEX_Cite = 24; + private int INDEX_Notes = 25; + + public LaunchCatTsvFile(String file) { + ReadCsvFile rcv = new ReadCsvFile(); + rcv.setSeparator('\t'); + List list = rcv.allLine(file); - launchcat.setLaunchTag(value[INDEX_Launch_Tag].trim()); - launchcat.setLaunch_Date(value[INDEX_Launch_Date]); - launchcat.setLVType(value[INDEX_LV_Type]); - launchcat.setMission(value[INDEX_Mission]); - launchcat.setLaunchSite(value[INDEX_Launch_Site]); - launchcat.setLaunchPad(value[INDEX_Launch_Pad]); - launchcat.setAgency(value[INDEX_Agency]); - - launchList.put(launchcat.getLaunchTag(), launchcat); - } catch (Exception e) { - log.severe("Wrong NASA ID for " + value[INDEX_Launch_Tag] + " info " + value[INDEX_LV_Type]); - } + ListIterator it = list.listIterator(); + while (it.hasNext()) { + String[] value = it.next(); + try { - } - } + // Lecture des données + LaunchCat launchcat = new LaunchCat(); - /** - * @return the launchList - */ - public Hashtable getLaunchList() { - return launchList; - } + launchcat.setLaunchTag(value[INDEX_Launch_Tag].trim()); + launchcat.setLaunch_Date(value[INDEX_Launch_Date]); + launchcat.setLVType(value[INDEX_LV_Type]); + launchcat.setMission(value[INDEX_Mission]); + launchcat.setLaunchSite(value[INDEX_Launch_Site]); + launchcat.setLaunchPad(value[INDEX_Launch_Pad]); + launchcat.setAgency(value[INDEX_Agency]); + launchList.put(launchcat.getLaunchTag(), launchcat); + } catch (Exception e) { + log.severe( + "Wrong NASA ID for " + value[INDEX_Launch_Tag] + " info " + value[INDEX_LV_Type]); + } + } + } - /** - * @param launchList the launchList to set - */ - public void setLaunchList(Hashtable launchList) { - this.launchList = launchList; - } + /** @return the launchList */ + public Hashtable getLaunchList() { + return launchList; + } + /** @param launchList the launchList to set */ + public void setLaunchList(Hashtable launchList) { + this.launchList = launchList; + } } diff --git a/ModuleSatelliteDatabase/src/main/java/org/josast/AmsatList/source/gcat/OrgsCat.java b/ModuleSatelliteDatabase/src/main/java/org/josast/AmsatList/source/gcat/OrgsCat.java index a55630083ca5778354057f41e3a80916cbf51b8b..f018161238e8cc1c11855fbeb9451467a044390b 100644 --- a/ModuleSatelliteDatabase/src/main/java/org/josast/AmsatList/source/gcat/OrgsCat.java +++ b/ModuleSatelliteDatabase/src/main/java/org/josast/AmsatList/source/gcat/OrgsCat.java @@ -1,114 +1,82 @@ -/** - * - */ +/** */ package org.josast.AmsatList.source.gcat; -/** - * @author chris - * - */ +/** @author chris */ public class OrgsCat { - - private String code; - private String stateCode; - private String name; - private String location; - private String ShortName; - - /** - * - */ - public OrgsCat() { - // TODO Auto-generated constructor stub - } - - - /** - * @return the shortName - */ - public String getShortName() { - return ShortName; - } - - - /** - * @param shortName the shortName to set - */ - public void setShortName(String shortName) { - ShortName = shortName; - } - - - /** - * @return the code - */ - public String getCode() { - return code; - } - - - /** - * @param code the code to set - */ - public void setCode(String code) { - this.code = code; - } - - - /** - * @return the stateCode - */ - public String getStateCode() { - return stateCode; - } - - - /** - * @param stateCode the stateCode to set - */ - public void setStateCode(String stateCode) { - this.stateCode = stateCode; - } - - - /** - * @return the name - */ - public String getName() { - return name; - } - - - /** - * @param name the name to set - */ - public void setName(String name) { - this.name = name; - } - - - /** - * @return the location - */ - public String getLocation() { - return location; - } - - - /** - * @param location the location to set - */ - public void setLocation(String location) { - this.location = location; - } - - - @Override - public String toString() { - return "OrgsCat [code=" + code + ", stateCode=" + stateCode + ", name=" + name + ", location=" + location - + ", ShortName=" + ShortName + "]"; - } - - + private String code; + private String stateCode; + private String name; + private String location; + private String ShortName; + + /** */ + public OrgsCat() { + // TODO Auto-generated constructor stub + } + + /** @return the shortName */ + public String getShortName() { + return ShortName; + } + + /** @param shortName the shortName to set */ + public void setShortName(String shortName) { + ShortName = shortName; + } + + /** @return the code */ + public String getCode() { + return code; + } + + /** @param code the code to set */ + public void setCode(String code) { + this.code = code; + } + + /** @return the stateCode */ + public String getStateCode() { + return stateCode; + } + + /** @param stateCode the stateCode to set */ + public void setStateCode(String stateCode) { + this.stateCode = stateCode; + } + + /** @return the name */ + public String getName() { + return name; + } + + /** @param name the name to set */ + public void setName(String name) { + this.name = name; + } + + /** @return the location */ + public String getLocation() { + return location; + } + + /** @param location the location to set */ + public void setLocation(String location) { + this.location = location; + } + + @Override + public String toString() { + return "OrgsCat [code=" + + code + + ", stateCode=" + + stateCode + + ", name=" + + name + + ", location=" + + location + + ", ShortName=" + + ShortName + + "]"; + } } diff --git a/ModuleSatelliteDatabase/src/main/java/org/josast/AmsatList/source/gcat/OrgsCatTsvFile.java b/ModuleSatelliteDatabase/src/main/java/org/josast/AmsatList/source/gcat/OrgsCatTsvFile.java index 8508e2ddeef729c50cf92e445ce1a85116ca9683..24cfa5216b770a7f7be9482b1ccda5107f5a205a 100644 --- a/ModuleSatelliteDatabase/src/main/java/org/josast/AmsatList/source/gcat/OrgsCatTsvFile.java +++ b/ModuleSatelliteDatabase/src/main/java/org/josast/AmsatList/source/gcat/OrgsCatTsvFile.java @@ -1,94 +1,75 @@ -/** - * - */ +/** */ package org.josast.AmsatList.source.gcat; import java.util.Hashtable; import java.util.List; import java.util.ListIterator; import java.util.logging.Logger; - import org.josast.AmsatList.source.ReadCsvFile; -/** - * @author chris - * - */ +/** @author chris */ public class OrgsCatTsvFile { - - private Logger log = Logger.getLogger(getClass().getName()); - private Hashtable orgsCatList = new Hashtable(); - - private static int INDEX_Code=0; - private static int INDEX_UCode=1; - private static int INDEX_StateCode=2; - private static int INDEX_Type=3; - private static int INDEX_Class=4; - private static int INDEX_TStart=5; - private static int INDEX_TStop=6; - private static int INDEX_ShortName=7; - private static int INDEX_Name=8; - private static int INDEX_Location=9; - private static int INDEX_Longitude=10; - private static int INDEX_Latitude=11; - private static int INDEX_Error=12; - private static int INDEX_Parent=13; - private static int INDEX_ShortEName=14; - private static int INDEX_EName=15; - private static int INDEX_UName=16; + private Logger log = Logger.getLogger(getClass().getName()); + private Hashtable orgsCatList = new Hashtable(); + + private static int INDEX_Code = 0; + private static int INDEX_UCode = 1; + private static int INDEX_StateCode = 2; + private static int INDEX_Type = 3; + private static int INDEX_Class = 4; + private static int INDEX_TStart = 5; + private static int INDEX_TStop = 6; + private static int INDEX_ShortName = 7; + private static int INDEX_Name = 8; + private static int INDEX_Location = 9; + private static int INDEX_Longitude = 10; + private static int INDEX_Latitude = 11; + private static int INDEX_Error = 12; + private static int INDEX_Parent = 13; + private static int INDEX_ShortEName = 14; + private static int INDEX_EName = 15; + private static int INDEX_UName = 16; + + /** */ + public OrgsCatTsvFile(String file) { + + ReadCsvFile rcv = new ReadCsvFile(); + rcv.setSeparator('\t'); + + List list = rcv.allLine(file); + + ListIterator it = list.listIterator(); + while (it.hasNext()) { + String[] value = it.next(); + try { + + // Lecture des données - /** - * - */ - public OrgsCatTsvFile(String file) { - - ReadCsvFile rcv = new ReadCsvFile(); - rcv.setSeparator('\t'); - - List list = rcv.allLine(file); - - ListIterator it = list.listIterator(); - while (it.hasNext()) { - String[] value = it.next(); - try { - - // Lecture des données - - - OrgsCat org = new OrgsCat(); - - org.setCode(value[INDEX_Code]); - org.setLocation(value[INDEX_Location]); - org.setName(value[INDEX_Name]); - org.setStateCode(value[INDEX_StateCode]); - org.setShortName(value[INDEX_ShortName]); - - orgsCatList.put(org.getCode(), org); - - } catch (Exception e) { - log.severe("Wrong NASA ID for " + value[INDEX_Code] + " info " + value[INDEX_Name]); - } + OrgsCat org = new OrgsCat(); - } - System.out.println(orgsCatList.size()); - } + org.setCode(value[INDEX_Code]); + org.setLocation(value[INDEX_Location]); + org.setName(value[INDEX_Name]); + org.setStateCode(value[INDEX_StateCode]); + org.setShortName(value[INDEX_ShortName]); + orgsCatList.put(org.getCode(), org); - /** - * @return the orgsCatList - */ - public Hashtable getOrgsCatList() { - return orgsCatList; - } + } catch (Exception e) { + log.severe("Wrong NASA ID for " + value[INDEX_Code] + " info " + value[INDEX_Name]); + } + } + System.out.println(orgsCatList.size()); + } + /** @return the orgsCatList */ + public Hashtable getOrgsCatList() { + return orgsCatList; + } - /** - * @param orgsCatList the orgsCatList to set - */ - public void setOrgsCatList(Hashtable orgsCatList) { - this.orgsCatList = orgsCatList; - } - - + /** @param orgsCatList the orgsCatList to set */ + public void setOrgsCatList(Hashtable orgsCatList) { + this.orgsCatList = orgsCatList; + } } diff --git a/ModuleSatelliteDatabase/src/main/java/org/josast/AmsatList/source/gcat/SatCat.java b/ModuleSatelliteDatabase/src/main/java/org/josast/AmsatList/source/gcat/SatCat.java index a4fdab8216477473ba6d51b01624c4d5e5a48b53..7060f0a3e3290c8c8b8d845f416bb5e705ab4e60 100644 --- a/ModuleSatelliteDatabase/src/main/java/org/josast/AmsatList/source/gcat/SatCat.java +++ b/ModuleSatelliteDatabase/src/main/java/org/josast/AmsatList/source/gcat/SatCat.java @@ -1,160 +1,132 @@ package org.josast.AmsatList.source.gcat; public class SatCat { - - private String satelliteName; - private String launchDate; - private String owner; - private String state; - private String manufacturer; - private String bus; - private String Mass; - private String Shape; - private String plName; - private String altNames; - private String piece; - /** - * @return the satelliteName - */ - public String getSatelliteName() { - return satelliteName; - } - /** - * @param satelliteName the satelliteName to set - */ - public void setSatelliteName(String satelliteName) { - this.satelliteName = satelliteName; - } - /** - * @return the launchDate - */ - public String getLaunchDate() { - return launchDate; - } - /** - * @param launchDate the launchDate to set - */ - public void setLaunchDate(String launchDate) { - this.launchDate = launchDate; - } - /** - * @return the owner - */ - public String getOwner() { - return owner; - } - /** - * @param owner the owner to set - */ - public void setOwner(String owner) { - this.owner = owner; - } - /** - * @return the state - */ - public String getState() { - return state; - } - /** - * @param state the state to set - */ - public void setState(String state) { - this.state = state; - } - /** - * @return the manufacturer - */ - public String getManufacturer() { - return manufacturer; - } - /** - * @param manufacturer the manufacturer to set - */ - public void setManufacturer(String manufacturer) { - this.manufacturer = manufacturer; - } - /** - * @return the bus - */ - public String getBus() { - return bus; - } - /** - * @param bus the bus to set - */ - public void setBus(String bus) { - this.bus = bus; - } - /** - * @return the mass - */ - public String getMass() { - return Mass; - } - /** - * @param mass the mass to set - */ - public void setMass(String mass) { - Mass = mass; - } - /** - * @return the shape - */ - public String getShape() { - return Shape; - } - /** - * @param shape the shape to set - */ - public void setShape(String shape) { - Shape = shape; - } - /** - * @return the plName - */ - public String getPlName() { - return plName; - } - /** - * @param plName the plName to set - */ - public void setPlName(String plName) { - this.plName = plName; - } - /** - * @return the altNames - */ - public String getAltNames() { - return altNames; - } - /** - * @param altNames the altNames to set - */ - public void setAltNames(String altNames) { - this.altNames = altNames; - } - - /** - * @return the piece - */ - public String getPiece() { - return piece; - } - /** - * @param piece the piece to set - */ - public void setPiece(String piece) { - this.piece = piece; - } - - @Override - public String toString() { - return "SatCat [satelliteName=" + satelliteName + ", launchDate=" + launchDate + ", owner=" + owner + ", state=" - + state + ", manufacturer=" + manufacturer + ", bus=" + bus + ", Mass=" + Mass + ", Shape=" + Shape - + ", plName=" + plName + ", altNames=" + altNames + ", piece=" + piece + "]"; - } - - - + private String satelliteName; + private String launchDate; + private String owner; + private String state; + private String manufacturer; + private String bus; + private String Mass; + private String Shape; + private String plName; + private String altNames; + private String piece; + /** @return the satelliteName */ + public String getSatelliteName() { + return satelliteName; + } + /** @param satelliteName the satelliteName to set */ + public void setSatelliteName(String satelliteName) { + this.satelliteName = satelliteName; + } + /** @return the launchDate */ + public String getLaunchDate() { + return launchDate; + } + /** @param launchDate the launchDate to set */ + public void setLaunchDate(String launchDate) { + this.launchDate = launchDate; + } + /** @return the owner */ + public String getOwner() { + return owner; + } + /** @param owner the owner to set */ + public void setOwner(String owner) { + this.owner = owner; + } + /** @return the state */ + public String getState() { + return state; + } + /** @param state the state to set */ + public void setState(String state) { + this.state = state; + } + /** @return the manufacturer */ + public String getManufacturer() { + return manufacturer; + } + /** @param manufacturer the manufacturer to set */ + public void setManufacturer(String manufacturer) { + this.manufacturer = manufacturer; + } + /** @return the bus */ + public String getBus() { + return bus; + } + /** @param bus the bus to set */ + public void setBus(String bus) { + this.bus = bus; + } + /** @return the mass */ + public String getMass() { + return Mass; + } + /** @param mass the mass to set */ + public void setMass(String mass) { + Mass = mass; + } + /** @return the shape */ + public String getShape() { + return Shape; + } + /** @param shape the shape to set */ + public void setShape(String shape) { + Shape = shape; + } + /** @return the plName */ + public String getPlName() { + return plName; + } + /** @param plName the plName to set */ + public void setPlName(String plName) { + this.plName = plName; + } + /** @return the altNames */ + public String getAltNames() { + return altNames; + } + /** @param altNames the altNames to set */ + public void setAltNames(String altNames) { + this.altNames = altNames; + } + + /** @return the piece */ + public String getPiece() { + return piece; + } + /** @param piece the piece to set */ + public void setPiece(String piece) { + this.piece = piece; + } + + @Override + public String toString() { + return "SatCat [satelliteName=" + + satelliteName + + ", launchDate=" + + launchDate + + ", owner=" + + owner + + ", state=" + + state + + ", manufacturer=" + + manufacturer + + ", bus=" + + bus + + ", Mass=" + + Mass + + ", Shape=" + + Shape + + ", plName=" + + plName + + ", altNames=" + + altNames + + ", piece=" + + piece + + "]"; + } } diff --git a/ModuleSatelliteDatabase/src/main/java/org/josast/AmsatList/source/gcat/SatcCatTsvFile.java b/ModuleSatelliteDatabase/src/main/java/org/josast/AmsatList/source/gcat/SatcCatTsvFile.java index eebcd92a472da0d5662cf61f0e9ebd2184d45b35..825897f6b4f04918d512d32f072b710bc0684c36 100644 --- a/ModuleSatelliteDatabase/src/main/java/org/josast/AmsatList/source/gcat/SatcCatTsvFile.java +++ b/ModuleSatelliteDatabase/src/main/java/org/josast/AmsatList/source/gcat/SatcCatTsvFile.java @@ -5,108 +5,101 @@ import java.util.Hashtable; import java.util.List; import java.util.ListIterator; import java.util.logging.Logger; - import org.josast.AmsatList.source.ReadCsvFile; public class SatcCatTsvFile { - private static final int INDEX_satelliteName = 0; + private static final int INDEX_satelliteName = 0; + + private Logger log = Logger.getLogger(getClass().getName()); + + private int INDEX_JCAT = 0; + private int INDEX_Satcat = 1; + private int INDEX_Piece = 2; + private int INDEX_Type = 3; + private int INDEX_Name = 4; + private int INDEX_PLName = 5; + private int INDEX_LDate = 6; + private int INDEX_Parent = 7; + private int INDEX_SDate = 8; + private int INDEX_Primary = 9; + private int INDEX_DDate = 10; + private int INDEX_Status = 11; + private int INDEX_Dest = 12; + private int INDEX_Owner = 13; + private int INDEX_State = 14; + private int INDEX_Manufacturer = 15; + private int INDEX_Bus = 16; + private int INDEX_Motor = 17; + private int INDEX_Mass = 18; + private int INDEX_MassFlag = 19; + private int INDEX_DryMass = 20; + private int INDEX_DryFlag = 21; + private int INDEX_TotMass = 22; + private int INDEX_TotFlag = 23; + private int INDEX_Length = 24; + private int INDEX_LFlag = 25; + private int INDEX_Diameter = 26; + private int INDEX_DFlag = 27; + private int INDEX_Span = 28; + private int INDEX_SpanFlag = 29; + private int INDEX_Shape = 30; + private int INDEX_ODate = 31; + private int INDEX_Perigee = 32; + private int INDEX_PF = 33; + private int INDEX_Apogee = 34; + private int INDEX_AF = 35; + private int INDEX_Inc = 36; + private int INDEX_IF = 37; + private int INDEX_OpOrbit = 38; + private int INDEX_OQUAL = 39; + private int INDEX_AltNames = 40; + + private Hashtable satcatList = new Hashtable(); - private Logger log = Logger.getLogger(getClass().getName()); + public SatcCatTsvFile(String file) { - private int INDEX_JCAT = 0; - private int INDEX_Satcat = 1; - private int INDEX_Piece = 2; - private int INDEX_Type = 3; - private int INDEX_Name = 4; - private int INDEX_PLName = 5; - private int INDEX_LDate = 6; - private int INDEX_Parent = 7; - private int INDEX_SDate = 8; - private int INDEX_Primary = 9; - private int INDEX_DDate = 10; - private int INDEX_Status = 11; - private int INDEX_Dest = 12; - private int INDEX_Owner = 13; - private int INDEX_State = 14; - private int INDEX_Manufacturer = 15; - private int INDEX_Bus = 16; - private int INDEX_Motor = 17; - private int INDEX_Mass = 18; - private int INDEX_MassFlag = 19; - private int INDEX_DryMass = 20; - private int INDEX_DryFlag = 21; - private int INDEX_TotMass = 22; - private int INDEX_TotFlag = 23; - private int INDEX_Length = 24; - private int INDEX_LFlag = 25; - private int INDEX_Diameter = 26; - private int INDEX_DFlag = 27; - private int INDEX_Span = 28; - private int INDEX_SpanFlag = 29; - private int INDEX_Shape = 30; - private int INDEX_ODate = 31; - private int INDEX_Perigee = 32; - private int INDEX_PF = 33; - private int INDEX_Apogee = 34; - private int INDEX_AF = 35; - private int INDEX_Inc = 36; - private int INDEX_IF = 37; - private int INDEX_OpOrbit = 38; - private int INDEX_OQUAL = 39; - private int INDEX_AltNames = 40; + ReadCsvFile rcv = new ReadCsvFile(); + rcv.setSeparator('\t'); - private Hashtable satcatList = new Hashtable(); + List list = rcv.allLine(file); - public SatcCatTsvFile(String file) { - - ReadCsvFile rcv = new ReadCsvFile(); - rcv.setSeparator('\t'); - - List list = rcv.allLine(file); - - ListIterator it = list.listIterator(); - while (it.hasNext()) { - String[] value = it.next(); - try { - - // Lecture des données - - BigInteger biNorad = BigInteger.valueOf(Long.parseLong(value[INDEX_Satcat])); - SatCat sat = new SatCat(); - // System.out.println(biNorad); + ListIterator it = list.listIterator(); + while (it.hasNext()) { + String[] value = it.next(); + try { - sat.setSatelliteName(value[INDEX_Name]); - sat.setLaunchDate(value[INDEX_LDate]); - sat.setOwner(value[INDEX_Owner]); - sat.setState(value[INDEX_State]); - sat.setManufacturer(value[INDEX_Manufacturer]); - sat.setBus(value[INDEX_Bus]); - sat.setMass(value[INDEX_Mass]); - sat.setShape(value[INDEX_Shape]); - sat.setPlName(value[INDEX_PLName]); - sat.setAltNames(value[INDEX_AltNames]); - sat.setPiece(value[INDEX_Piece]); - satcatList.put(biNorad, sat); - } catch (Exception e) { - log.severe("Wrong NASA ID for " + value[INDEX_Name] + " info " + value[INDEX_Satcat]); - } + // Lecture des données - } - } + BigInteger biNorad = BigInteger.valueOf(Long.parseLong(value[INDEX_Satcat])); + SatCat sat = new SatCat(); + // System.out.println(biNorad); - /** - * @return the satcatList - */ - public Hashtable getSatcatList() { - return satcatList; - } + sat.setSatelliteName(value[INDEX_Name]); + sat.setLaunchDate(value[INDEX_LDate]); + sat.setOwner(value[INDEX_Owner]); + sat.setState(value[INDEX_State]); + sat.setManufacturer(value[INDEX_Manufacturer]); + sat.setBus(value[INDEX_Bus]); + sat.setMass(value[INDEX_Mass]); + sat.setShape(value[INDEX_Shape]); + sat.setPlName(value[INDEX_PLName]); + sat.setAltNames(value[INDEX_AltNames]); + sat.setPiece(value[INDEX_Piece]); + satcatList.put(biNorad, sat); + } catch (Exception e) { + log.severe("Wrong NASA ID for " + value[INDEX_Name] + " info " + value[INDEX_Satcat]); + } + } + } - /** - * @param satcatList the satcatList to set - */ - public void setSatcatList(Hashtable satcatList) { - this.satcatList = satcatList; - } + /** @return the satcatList */ + public Hashtable getSatcatList() { + return satcatList; + } + /** @param satcatList the satcatList to set */ + public void setSatcatList(Hashtable satcatList) { + this.satcatList = satcatList; + } } diff --git a/ModuleSatelliteDatabase/src/main/java/org/josast/AmsatList/source/gcat/SiteCat.java b/ModuleSatelliteDatabase/src/main/java/org/josast/AmsatList/source/gcat/SiteCat.java index f2350d77a8bf6b5f1f60575bafc288aa5e475f87..6809fd4d818b78627d24f98eb3efc6b04d64ab91 100644 --- a/ModuleSatelliteDatabase/src/main/java/org/josast/AmsatList/source/gcat/SiteCat.java +++ b/ModuleSatelliteDatabase/src/main/java/org/josast/AmsatList/source/gcat/SiteCat.java @@ -1,94 +1,69 @@ -/** - * - */ +/** */ package org.josast.AmsatList.source.gcat; -/** - * @author chris - * - */ +/** @author chris */ public class SiteCat { - - private String site; - private String name; - private String ShortName; - private String stateCode; - - /** - * - */ - public SiteCat() { - // TODO Auto-generated constructor stub - } - - - - /** - * @return the shortName - */ - public String getShortName() { - return ShortName; - } - - - - /** - * @param shortName the shortName to set - */ - public void setShortName(String shortName) { - ShortName = shortName; - } - - - - /** - * @return the site - */ - public String getSite() { - return site; - } - - /** - * @param site the site to set - */ - public void setSite(String site) { - this.site = site; - } - - /** - * @return the name - */ - public String getName() { - return name; - } - - /** - * @param name the name to set - */ - public void setName(String name) { - this.name = name; - } - - /** - * @return the stateCode - */ - public String getStateCode() { - return stateCode; - } - - /** - * @param stateCode the stateCode to set - */ - public void setStateCode(String stateCode) { - this.stateCode = stateCode; - } - - @Override - public String toString() { - return "SiteCat [site=" + site + ", name=" + name + ", ShortName=" + ShortName + ", stateCode=" + stateCode - + "]"; - } - - + private String site; + private String name; + private String ShortName; + private String stateCode; + + /** */ + public SiteCat() { + // TODO Auto-generated constructor stub + } + + /** @return the shortName */ + public String getShortName() { + return ShortName; + } + + /** @param shortName the shortName to set */ + public void setShortName(String shortName) { + ShortName = shortName; + } + + /** @return the site */ + public String getSite() { + return site; + } + + /** @param site the site to set */ + public void setSite(String site) { + this.site = site; + } + + /** @return the name */ + public String getName() { + return name; + } + + /** @param name the name to set */ + public void setName(String name) { + this.name = name; + } + + /** @return the stateCode */ + public String getStateCode() { + return stateCode; + } + + /** @param stateCode the stateCode to set */ + public void setStateCode(String stateCode) { + this.stateCode = stateCode; + } + + @Override + public String toString() { + return "SiteCat [site=" + + site + + ", name=" + + name + + ", ShortName=" + + ShortName + + ", stateCode=" + + stateCode + + "]"; + } } diff --git a/ModuleSatelliteDatabase/src/main/java/org/josast/AmsatList/source/gcat/SiteCatTsvFile.java b/ModuleSatelliteDatabase/src/main/java/org/josast/AmsatList/source/gcat/SiteCatTsvFile.java index b1975efddc1cba8ae74f02684e0f60535015b920..a716b5c1f8125c52c4f4e876c5ddb7a426e512bf 100644 --- a/ModuleSatelliteDatabase/src/main/java/org/josast/AmsatList/source/gcat/SiteCatTsvFile.java +++ b/ModuleSatelliteDatabase/src/main/java/org/josast/AmsatList/source/gcat/SiteCatTsvFile.java @@ -1,115 +1,96 @@ -/** - * - */ +/** */ package org.josast.AmsatList.source.gcat; - import java.util.Hashtable; import java.util.List; import java.util.ListIterator; import java.util.logging.Logger; - import org.josast.AmsatList.source.ReadCsvFile; -/** - * @author chris - * - */ +/** @author chris */ public class SiteCatTsvFile { - - private Logger log = Logger.getLogger(getClass().getName()); - private static int INDEX_Site = 0; // Selected + private Logger log = Logger.getLogger(getClass().getName()); + + private static int INDEX_Site = 0; // Selected + + private static int INDEX_Code = 1; + + private static int INDEX_UCode = 2; + + private static int INDEX_Type = 3; + + private static int INDEX_StateCode = 4; // Selected - private static int INDEX_Code = 1; + private static int INDEX_TStart = 5; - private static int INDEX_UCode = 2; + private static int INDEX_TStop = 6; - private static int INDEX_Type = 3; + private static int INDEX_ShortName = 7; - private static int INDEX_StateCode = 4; // Selected + private static int INDEX_Name = 8; // Selected - private static int INDEX_TStart = 5; + private static int INDEX_Location = 9; - private static int INDEX_TStop = 6; + private static int INDEX_Longitude = 10; - private static int INDEX_ShortName = 7; + private static int INDEX_Latitude = 11; - private static int INDEX_Name = 8; // Selected + private static int INDEX_Error = 12; - private static int INDEX_Location = 9; + private static int INDEX_Parent = 13; - private static int INDEX_Longitude = 10; + private static int INDEX_ShortEName = 14; - private static int INDEX_Latitude = 11; + private static int INDEX_EName = 15; - private static int INDEX_Error = 12; + private static int INDEX_Group = 16; - private static int INDEX_Parent = 13; + private static int INDEX_UName = 17; - private static int INDEX_ShortEName = 14; + private Hashtable sitecatList = new Hashtable(); - private static int INDEX_EName = 15; + /** */ + public SiteCatTsvFile() { + // TODO Auto-generated constructor stub + } - private static int INDEX_Group = 16; + public SiteCatTsvFile(String file) { - private static int INDEX_UName = 17; + ReadCsvFile rcv = new ReadCsvFile(); + rcv.setSeparator('\t'); + List list = rcv.allLine(file); - private Hashtable sitecatList = new Hashtable(); + ListIterator it = list.listIterator(); + while (it.hasNext()) { + String[] value = it.next(); + try { - /** - * - */ - public SiteCatTsvFile() { - // TODO Auto-generated constructor stub - } - - public SiteCatTsvFile(String file) { - - ReadCsvFile rcv = new ReadCsvFile(); - rcv.setSeparator('\t'); - - List list = rcv.allLine(file); - - ListIterator it = list.listIterator(); - while (it.hasNext()) { - String[] value = it.next(); - try { - - // Lecture des données - - - SiteCat site = new SiteCat(); - // System.out.println(biNorad); + // Lecture des données - site.setSite(value[INDEX_Site]); - site.setStateCode(value[INDEX_StateCode]); - site.setName(value[INDEX_Name]); - site.setShortName(value[INDEX_ShortName]); - sitecatList.put(site.getSite(), site); - - } catch (Exception e) { - log.severe("Wrong NASA ID for " + value[INDEX_Name] + " info " + value[INDEX_Site]); - } + SiteCat site = new SiteCat(); + // System.out.println(biNorad); - } - } + site.setSite(value[INDEX_Site]); + site.setStateCode(value[INDEX_StateCode]); + site.setName(value[INDEX_Name]); + site.setShortName(value[INDEX_ShortName]); + sitecatList.put(site.getSite(), site); - /** - * @return the sitecatList - */ - public Hashtable getSitecatList() { - return sitecatList; - } + } catch (Exception e) { + log.severe("Wrong NASA ID for " + value[INDEX_Name] + " info " + value[INDEX_Site]); + } + } + } - /** - * @param sitecatList the sitecatList to set - */ - public void setSitecatList(Hashtable sitecatList) { - this.sitecatList = sitecatList; - } + /** @return the sitecatList */ + public Hashtable getSitecatList() { + return sitecatList; + } - - + /** @param sitecatList the sitecatList to set */ + public void setSitecatList(Hashtable sitecatList) { + this.sitecatList = sitecatList; + } } diff --git a/ModuleSatelliteDatabase/src/main/java/org/josast/AmsatList/source/gcat/UpdateAmsatListFileWithGsatData.java b/ModuleSatelliteDatabase/src/main/java/org/josast/AmsatList/source/gcat/UpdateAmsatListFileWithGsatData.java index 07ee6fc7bba8e558b5782f65cbdee237c6072dee..74820bfccfa29252e80c2b5cb98a2164bb60508d 100644 --- a/ModuleSatelliteDatabase/src/main/java/org/josast/AmsatList/source/gcat/UpdateAmsatListFileWithGsatData.java +++ b/ModuleSatelliteDatabase/src/main/java/org/josast/AmsatList/source/gcat/UpdateAmsatListFileWithGsatData.java @@ -1,26 +1,19 @@ -/** - * - */ +/** */ package org.josast.AmsatList.source.gcat; - import java.io.File; import java.math.BigDecimal; import java.math.BigInteger; import java.text.ParseException; import java.text.SimpleDateFormat; - import java.util.Date; - import java.util.Hashtable; import java.util.List; import java.util.Locale; import java.util.logging.Logger; - import javax.xml.datatype.DatatypeConfigurationException; import javax.xml.datatype.DatatypeFactory; import javax.xml.datatype.XMLGregorianCalendar; - import org.josast.AmsatList.generated.AmsatList; import org.josast.AmsatList.generated.LaunchData; import org.josast.AmsatList.generated.Manufacturer; @@ -32,287 +25,229 @@ import org.josast.AmsatList.generated.Satellites; import org.josast.ModuleSatelliteDatabase.AmsatListFile; import org.josast.util.files.ManageFolder; -/** - * @author chris - * - */ +/** @author chris */ public class UpdateAmsatListFileWithGsatData { - - private static Logger appLogger = Logger.getLogger("AmsatLogger"); - - private File repertoireAmsatlist; - private File repertoireGsat; - private File[] inputsfiles; - - // GSat data - Hashtable listLaunchCat; - Hashtable orgsCatList; - Hashtable satCatList; - Hashtable siteCatlist; - - private String repout; - - - public UpdateAmsatListFileWithGsatData(String repositorieAmsatListIn, String repositorieGsat, String destRep) { - super(); - - - repertoireAmsatlist = new File(repositorieAmsatListIn); - if (!repertoireAmsatlist.isDirectory()) { - appLogger.severe(repositorieAmsatListIn + "is not a repository"); - } - else - { - inputsfiles = repertoireAmsatlist.listFiles(); - if (inputsfiles == null) { - appLogger.severe(repositorieAmsatListIn + "Repository empty"); - } - } - - repertoireGsat = new File(repositorieGsat); - if (!repertoireGsat.isDirectory()) { - appLogger.severe(repertoireGsat + "is not a repository"); - } - - - ManageFolder repoutmngt = new ManageFolder(destRep); - repout = repoutmngt.getRepositoryPath(); - } - - public void LoadGsatFiles() - { - LaunchCatTsvFile lcFile = new LaunchCatTsvFile (repertoireGsat.getAbsolutePath()+"\\launch2.tsv" ); - listLaunchCat = lcFile.getLaunchList(); - - OrgsCatTsvFile orgFile = new OrgsCatTsvFile (repertoireGsat.getAbsolutePath()+"\\orgs.tsv" ); - orgsCatList = orgFile.getOrgsCatList(); - - SatcCatTsvFile scFile = new SatcCatTsvFile (repertoireGsat.getAbsolutePath()+"\\satcat2.tsv" ); - satCatList = scFile.getSatcatList(); - - SiteCatTsvFile sitesFile = new SiteCatTsvFile (repertoireGsat.getAbsolutePath()+"\\sites.tsv" ); - siteCatlist = sitesFile.getSitecatList(); - } - - public void Update() - { - Satellites sat=null; - int i =0; - AmsatListFile amf = new AmsatListFile(); - for (i = 0; i < inputsfiles.length; i++) { - // TODO - AmsatList amsatData = amf.openAmsatList(inputsfiles[i]); - if(amsatData.getSatellites().size()!=1) - { - appLogger.severe("error size "+inputsfiles[i].getAbsolutePath()); - } - else - { - List satList = amsatData.getSatellites(); - sat= satList.get(0); - System.out.println(sat.getName() + ","+ sat.getNasaID()); - int noradid = sat.getNasaID().intValue(); - if(noradid < 1) - { - appLogger.severe("Norad ID to low "+ sat.getName()); - } - else - { - SatCat infosat = satCatList.get(sat.getNasaID()); - // appLogger.info("infosat "+ infosat); - // Physical carateristics - PhysicalCharacterics physical = sat.getPhysicalCharacterics(); - if(physical==null) - { - physical=new PhysicalCharacterics(); - sat.setPhysicalCharacterics(physical); - } - physical.setBus(infosat.getBus()); - physical.setMass(BigDecimal.valueOf(Double.parseDouble(infosat.getMass()))); - physical.setShape(infosat.getShape()); - - - - - // Owner management - String [] owners = infosat.getOwner().split("/"); - for (int t=0;t listOwner = satOwners.getOwner() ; - Owner satowner = new Owner(); - satowner.setName(owner.getName()); - satowner.setLocation(owner.getLocation()); - satowner.setState(owner.getStateCode()); - listOwner.add(satowner); - - - } - else - { - appLogger.info("organisaton not found "+ owners[t]); - } - } - // Manufacturer mamanagement - - String[] manufacturers = infosat.getManufacturer().split("/"); - for (int t=0;t listManufacturer = satManufacturers.getManufacturer() ; - Manufacturer satManufacturer = new Manufacturer(); - satManufacturer.setName(manufacturer.getName()); - satManufacturer.setLocation(manufacturer.getLocation()); - satManufacturer.setState(manufacturer.getStateCode()); - listManufacturer.add(satManufacturer); - - - - - } - else - { - appLogger.info("manufacturer not found "+ manufacturers[t]); - } - } - - // launch site - LaunchCat launchsite = listLaunchCat.get(infosat.getPiece().substring(0,8)); - if(launchsite!=null) - { - // appLogger.info("launchsite "+ launchsite); -// OrgsCat agencies = orgsCatList.get(launchsite.getAgency()); -// appLogger.info("Agency "+ agencies); - - LaunchData launchdata = sat.getLaunchData(); - if(launchdata==null) - { - launchdata = new LaunchData(); - sat.setLaunchData(launchdata); - } - - launchdata.setMissionName(launchsite.getMission()); - launchdata.setLauncher(launchsite.getLVType()); - - SimpleDateFormat formatter = new SimpleDateFormat("yyyy MMM dd hhmm", Locale.ENGLISH); - - String dateInString = launchsite.getLaunch_Date(); - try { - Date date = formatter.parse(dateInString); - XMLGregorianCalendar date2 =DatatypeFactory.newInstance().newXMLGregorianCalendar(date.toInstant().toString()); - launchdata.setLaunchDate(date2); - } catch (ParseException | DatatypeConfigurationException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - - SiteCat site = siteCatlist.get(launchsite.getLaunchSite()); - - launchdata.setLaunchingSite(site.getName()); - launchdata.setLaunchPad(launchsite.getLaunchPad()); - - - - -// -- - String agency = launchsite.getAgency(); - String[] agencies = agency.split("/"); - - - for (int t=0;t listLaunchCat; + Hashtable orgsCatList; + Hashtable satCatList; + Hashtable siteCatlist; + + private String repout; + + public UpdateAmsatListFileWithGsatData( + String repositorieAmsatListIn, String repositorieGsat, String destRep) { + super(); + + repertoireAmsatlist = new File(repositorieAmsatListIn); + if (!repertoireAmsatlist.isDirectory()) { + appLogger.severe(repositorieAmsatListIn + "is not a repository"); + } else { + inputsfiles = repertoireAmsatlist.listFiles(); + if (inputsfiles == null) { + appLogger.severe(repositorieAmsatListIn + "Repository empty"); + } + } + + repertoireGsat = new File(repositorieGsat); + if (!repertoireGsat.isDirectory()) { + appLogger.severe(repertoireGsat + "is not a repository"); + } + + ManageFolder repoutmngt = new ManageFolder(destRep); + repout = repoutmngt.getRepositoryPath(); + } + + public void LoadGsatFiles() { + LaunchCatTsvFile lcFile = + new LaunchCatTsvFile(repertoireGsat.getAbsolutePath() + "\\launch2.tsv"); + listLaunchCat = lcFile.getLaunchList(); + + OrgsCatTsvFile orgFile = new OrgsCatTsvFile(repertoireGsat.getAbsolutePath() + "\\orgs.tsv"); + orgsCatList = orgFile.getOrgsCatList(); + + SatcCatTsvFile scFile = new SatcCatTsvFile(repertoireGsat.getAbsolutePath() + "\\satcat2.tsv"); + satCatList = scFile.getSatcatList(); + + SiteCatTsvFile sitesFile = new SiteCatTsvFile(repertoireGsat.getAbsolutePath() + "\\sites.tsv"); + siteCatlist = sitesFile.getSitecatList(); + } + + public void Update() { + Satellites sat = null; + int i = 0; + AmsatListFile amf = new AmsatListFile(); + for (i = 0; i < inputsfiles.length; i++) { + // TODO + AmsatList amsatData = amf.openAmsatList(inputsfiles[i]); + if (amsatData.getSatellites().size() != 1) { + appLogger.severe("error size " + inputsfiles[i].getAbsolutePath()); + } else { + List satList = amsatData.getSatellites(); + sat = satList.get(0); + System.out.println(sat.getName() + "," + sat.getNasaID()); + int noradid = sat.getNasaID().intValue(); + if (noradid < 1) { + appLogger.severe("Norad ID to low " + sat.getName()); + } else { + SatCat infosat = satCatList.get(sat.getNasaID()); + // appLogger.info("infosat "+ infosat); + // Physical carateristics + PhysicalCharacterics physical = sat.getPhysicalCharacterics(); + if (physical == null) { + physical = new PhysicalCharacterics(); + sat.setPhysicalCharacterics(physical); + } + physical.setBus(infosat.getBus()); + physical.setMass(BigDecimal.valueOf(Double.parseDouble(infosat.getMass()))); + physical.setShape(infosat.getShape()); + + // Owner management + String[] owners = infosat.getOwner().split("/"); + for (int t = 0; t < owners.length; t++) { + OrgsCat owner = orgsCatList.get(owners[t]); + if (owner != null) { + // appLogger.info("organisaton "+ owner); + // appLogger.info("pays "+ orgsCatList.get(owner.getStateCode())); + OrgsCat country = orgsCatList.get(owner.getStateCode()); + Owners satOwners = sat.getOwners(); + + if (satOwners == null) { + satOwners = new Owners(); + sat.setOwners(satOwners); + } + List listOwner = satOwners.getOwner(); + Owner satowner = new Owner(); + satowner.setName(owner.getName()); + satowner.setLocation(owner.getLocation()); + satowner.setState(owner.getStateCode()); + listOwner.add(satowner); + + } else { + appLogger.info("organisaton not found " + owners[t]); + } + } + // Manufacturer mamanagement + + String[] manufacturers = infosat.getManufacturer().split("/"); + for (int t = 0; t < manufacturers.length; t++) { + OrgsCat manufacturer = orgsCatList.get(manufacturers[t]); + if (manufacturer != null) { + // appLogger.info("manufacturer "+ manufacturer); + OrgsCat country = orgsCatList.get(manufacturer.getStateCode()); + // appLogger.info("pays "+ ); + Manufacturers satManufacturers = sat.getManufacturers(); + + if (satManufacturers == null) { + satManufacturers = new Manufacturers(); + sat.setManufacturers(satManufacturers); + } + List listManufacturer = satManufacturers.getManufacturer(); + Manufacturer satManufacturer = new Manufacturer(); + satManufacturer.setName(manufacturer.getName()); + satManufacturer.setLocation(manufacturer.getLocation()); + satManufacturer.setState(manufacturer.getStateCode()); + listManufacturer.add(satManufacturer); + + } else { + appLogger.info("manufacturer not found " + manufacturers[t]); + } + } + + // launch site + LaunchCat launchsite = listLaunchCat.get(infosat.getPiece().substring(0, 8)); + if (launchsite != null) { + // appLogger.info("launchsite "+ launchsite); + // OrgsCat agencies = orgsCatList.get(launchsite.getAgency()); + // appLogger.info("Agency "+ agencies); + + LaunchData launchdata = sat.getLaunchData(); + if (launchdata == null) { + launchdata = new LaunchData(); + sat.setLaunchData(launchdata); + } + + launchdata.setMissionName(launchsite.getMission()); + launchdata.setLauncher(launchsite.getLVType()); + + SimpleDateFormat formatter = new SimpleDateFormat("yyyy MMM dd hhmm", Locale.ENGLISH); + + String dateInString = launchsite.getLaunch_Date(); + try { + Date date = formatter.parse(dateInString); + XMLGregorianCalendar date2 = + DatatypeFactory.newInstance() + .newXMLGregorianCalendar(date.toInstant().toString()); + launchdata.setLaunchDate(date2); + } catch (ParseException | DatatypeConfigurationException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + + SiteCat site = siteCatlist.get(launchsite.getLaunchSite()); + + launchdata.setLaunchingSite(site.getName()); + launchdata.setLaunchPad(launchsite.getLaunchPad()); + + // -- + String agency = launchsite.getAgency(); + String[] agencies = agency.split("/"); + + for (int t = 0; t < agencies.length; t++) { + OrgsCat agenciesData = orgsCatList.get(agencies[t]); + if (agenciesData != null) { + // appLogger.info("agenciesData "+ agenciesData); + // appLogger.info("pays "+ orgsCatList.get(agenciesData.getStateCode())); + launchdata.setOrganisation(agenciesData.getName()); + launchdata.setState(agenciesData.getStateCode()); + } else { + appLogger.info("agenciesData not found " + agencies[t]); + } } - - - - } - - - - /** - * @param args - */ - public static void main(String[] args) { - // TODO Auto-generated method stub - - String amsatListRep = "src\\test\\data\\in"; - String gsatRep = "src\\test\\data\\GSat"; - String destRep = "src\\test\\data\\out"; - // initialisation des répertoires - UpdateAmsatListFileWithGsatData ualf = new UpdateAmsatListFileWithGsatData(amsatListRep,gsatRep,destRep); - - // chargement données GSat - - ualf.LoadGsatFiles(); - - // pour tout fichier AmsatList - ualf.Update(); - // Récupérerer le N0 NOrad - - // recupérer les données GSAt - - // ajouter dans le fichier AmsatList - - - // Sauvegarder le fichier modifier - - } + // -- + + } else { + appLogger.info("launch site not found " + infosat.getPiece().substring(0, 8)); + } + } + } + + amf.save(repout + "/" + sat.getName() + "updated.xml", amsatData); + } + } + + /** @param args */ + public static void main(String[] args) { + // TODO Auto-generated method stub + + String amsatListRep = "src\\test\\data\\in"; + String gsatRep = "src\\test\\data\\GSat"; + String destRep = "src\\test\\data\\out"; + // initialisation des répertoires + UpdateAmsatListFileWithGsatData ualf = + new UpdateAmsatListFileWithGsatData(amsatListRep, gsatRep, destRep); + + // chargement données GSat + + ualf.LoadGsatFiles(); + + // pour tout fichier AmsatList + ualf.Update(); + // Récupérerer le N0 NOrad + + // recupérer les données GSAt + + // ajouter dans le fichier AmsatList + + // Sauvegarder le fichier modifier + + } } diff --git a/ModuleSatelliteDatabase/src/main/java/org/josast/AmsatList/source/je9pel/JE9PELcsvFile.java b/ModuleSatelliteDatabase/src/main/java/org/josast/AmsatList/source/je9pel/JE9PELcsvFile.java index 38524ceb38e923f858eb4ba070605c9a87fda0cc..686950f980a58e47ac6e352f433812dc29ebe341 100644 --- a/ModuleSatelliteDatabase/src/main/java/org/josast/AmsatList/source/je9pel/JE9PELcsvFile.java +++ b/ModuleSatelliteDatabase/src/main/java/org/josast/AmsatList/source/je9pel/JE9PELcsvFile.java @@ -4,81 +4,73 @@ import java.util.Hashtable; import java.util.Iterator; import java.util.List; import java.util.logging.Logger; - import org.josast.AmsatList.source.ReadCsvFile; public class JE9PELcsvFile { - private Logger log = Logger.getLogger(getClass().getName()); - private Hashtable satellites = new Hashtable(); - private Hashtable status = new Hashtable(); - - // "E:\\gitjosast\\josast\\ModuleSatelliteDatabase\\src\\test\\data\\je9pel-csv-file\\satslist.csv" - - private void readFile(String file) { - ReadCsvFile rcv = new ReadCsvFile(); - List list = rcv.allLine(file); - - for (String[] str : list) { - - if (str.length > 7) { - int norad = 0; - - status.put(str[7], str[7]); - try { - norad = new Integer(str[1]); - } catch (Exception e) { - log.warning ("Norad Number format fail : " +str[0] + " " + str[1]); - } - - Radio radio = new Radio(str[2], str[3], str[4], str[5], str[6], - str[7]); - Satellite sat = satellites.get(str[0]); - if (sat != null) { - sat.addRadio(radio); - sat.setStatus(radio.getStatus()); - } else { - sat = new Satellite(str[0], norad); - sat.setStatus(radio.getStatus()); - satellites.put(str[0], sat); - sat.addRadio(radio); - } - - } else { - - log.info(str[0]); - } - } - } + private Logger log = Logger.getLogger(getClass().getName()); + private Hashtable satellites = new Hashtable(); + private Hashtable status = new Hashtable(); + + // "E:\\gitjosast\\josast\\ModuleSatelliteDatabase\\src\\test\\data\\je9pel-csv-file\\satslist.csv" + + private void readFile(String file) { + ReadCsvFile rcv = new ReadCsvFile(); + List list = rcv.allLine(file); + + for (String[] str : list) { + + if (str.length > 7) { + int norad = 0; - public void displayStatus() - { - - System.out.println("========Status ============="); - Iterator it = status.values().iterator(); - while ( it.hasNext()) { - System.out.println(it.next()); + status.put(str[7], str[7]); + try { + norad = new Integer(str[1]); + } catch (Exception e) { + log.warning("Norad Number format fail : " + str[0] + " " + str[1]); } - } - - public void displaySatellites() - { - System.out.println("========Satellites ============="); - Iterator it2 = satellites.values().iterator(); - while ( it2.hasNext()) { - System.out.println(it2.next()); + Radio radio = new Radio(str[2], str[3], str[4], str[5], str[6], str[7]); + Satellite sat = satellites.get(str[0]); + if (sat != null) { + sat.addRadio(radio); + sat.setStatus(radio.getStatus()); + } else { + sat = new Satellite(str[0], norad); + sat.setStatus(radio.getStatus()); + satellites.put(str[0], sat); + sat.addRadio(radio); } + + } else { + + log.info(str[0]); + } } - - - public Hashtable getSatellites() { - return satellites; + } + + public void displayStatus() { + + System.out.println("========Status ============="); + Iterator it = status.values().iterator(); + while (it.hasNext()) { + System.out.println(it.next()); } + } - public JE9PELcsvFile(String file) { - readFile(file); + public void displaySatellites() { + System.out.println("========Satellites ============="); + Iterator it2 = satellites.values().iterator(); + while (it2.hasNext()) { + System.out.println(it2.next()); } + } + + public Hashtable getSatellites() { + return satellites; + } - + public JE9PELcsvFile(String file) { + readFile(file); + } } diff --git a/ModuleSatelliteDatabase/src/main/java/org/josast/AmsatList/source/je9pel/Radio.java b/ModuleSatelliteDatabase/src/main/java/org/josast/AmsatList/source/je9pel/Radio.java index 3f91837519104c75792e976d1b4a284f413a0dcd..41c8eac1ae9f6abe68aef8f748dc280889a12803 100644 --- a/ModuleSatelliteDatabase/src/main/java/org/josast/AmsatList/source/je9pel/Radio.java +++ b/ModuleSatelliteDatabase/src/main/java/org/josast/AmsatList/source/je9pel/Radio.java @@ -1,103 +1,74 @@ package org.josast.AmsatList.source.je9pel; public class Radio { - - private String uplink; - private String downlink; - private String beacon; - private String mode; - private String callsign; - private String status; - - - - public Radio(String uplink, String downlink, String beacon, String mode, - String callsign, String status) { - super(); - this.uplink = uplink; - this.downlink = downlink; - this.beacon = beacon; - this.mode = mode; - this.callsign = callsign; - this.status = status; - } - - - - public String getUplink() { - return uplink; - } - - - - public void setUplink(String uplink) { - this.uplink = uplink; - } - - - - public String getDownlink() { - return downlink; - } - - - - public void setDownlink(String downlink) { - this.downlink = downlink; - } - - - - public String getBeacon() { - return beacon; - } - - - - public void setBeacon(String beacon) { - this.beacon = beacon; - } - - - - public String getMode() { - return mode; - } - - - - public void setMode(String mode) { - this.mode = mode; - } - - - - public String getCallsign() { - return callsign; - } - - - - public void setCallsign(String callsign) { - this.callsign = callsign; - } - - - - public String getStatus() { - return status; - } - - - - public void setStatus(String status) { - this.status = status; - } - - - - public Radio() { - // TODO Auto-generated constructor stub - } + private String uplink; + private String downlink; + private String beacon; + private String mode; + private String callsign; + private String status; + + public Radio( + String uplink, String downlink, String beacon, String mode, String callsign, String status) { + super(); + this.uplink = uplink; + this.downlink = downlink; + this.beacon = beacon; + this.mode = mode; + this.callsign = callsign; + this.status = status; + } + + public String getUplink() { + return uplink; + } + + public void setUplink(String uplink) { + this.uplink = uplink; + } + + public String getDownlink() { + return downlink; + } + + public void setDownlink(String downlink) { + this.downlink = downlink; + } + + public String getBeacon() { + return beacon; + } + + public void setBeacon(String beacon) { + this.beacon = beacon; + } + + public String getMode() { + return mode; + } + + public void setMode(String mode) { + this.mode = mode; + } + + public String getCallsign() { + return callsign; + } + + public void setCallsign(String callsign) { + this.callsign = callsign; + } + + public String getStatus() { + return status; + } + + public void setStatus(String status) { + this.status = status; + } + + public Radio() { + // TODO Auto-generated constructor stub + } } diff --git a/ModuleSatelliteDatabase/src/main/java/org/josast/AmsatList/source/je9pel/Satellite.java b/ModuleSatelliteDatabase/src/main/java/org/josast/AmsatList/source/je9pel/Satellite.java index c39b9afc09843c130d2d99918ae4dd5bdaab1dd4..784904ea3155f5b5e5e645276314bafe30dea147 100644 --- a/ModuleSatelliteDatabase/src/main/java/org/josast/AmsatList/source/je9pel/Satellite.java +++ b/ModuleSatelliteDatabase/src/main/java/org/josast/AmsatList/source/je9pel/Satellite.java @@ -3,75 +3,70 @@ package org.josast.AmsatList.source.je9pel; import java.util.Vector; public class Satellite { - - private String name; - private int NoradId; - - private int nbstatus=0; - private String status = "Unknwow"; - private Vector radios = new Vector(); - - public void addRadio(Radio radio) - { - radios.add(radio); - } - - - public String getName() { - return name; - } - public void setName(String name) { - this.name = name; - } + private String name; + private int NoradId; - public int getNoradId() { - return NoradId; - } + private int nbstatus = 0; + private String status = "Unknwow"; + private Vector radios = new Vector(); - public void setNoradId(int noradId) { - NoradId = noradId; - } + public void addRadio(Radio radio) { + radios.add(radio); + } + public String getName() { + return name; + } - public String getStatus() { - return status; - } + public void setName(String name) { + this.name = name; + } - public void setStatus(String status) { - - if (nbstatus== 0) - this.status = status; - else if (this.status.compareTo(status)!=0) - { - status="Unknow"; - } - - - nbstatus++; - } + public int getNoradId() { + return NoradId; + } + public void setNoradId(int noradId) { + NoradId = noradId; + } - public Satellite(String name, int noradId) { - super(); - this.name = name; - NoradId = noradId; - - } + public String getStatus() { + return status; + } + + public void setStatus(String status) { - - public Satellite() { - // TODO Auto-generated constructor stub + if (nbstatus == 0) this.status = status; + else if (this.status.compareTo(status) != 0) { + status = "Unknow"; } + nbstatus++; + } - @Override - public String toString() { - return "Satellite [name=" + name + ", NoradId=" + NoradId - + ", nbstatus=" + nbstatus + ", status=" + status + ", radios=" - + radios + "]"; - } + public Satellite(String name, int noradId) { + super(); + this.name = name; + NoradId = noradId; + } + + public Satellite() { + // TODO Auto-generated constructor stub + } - - + @Override + public String toString() { + return "Satellite [name=" + + name + + ", NoradId=" + + NoradId + + ", nbstatus=" + + nbstatus + + ", status=" + + status + + ", radios=" + + radios + + "]"; + } } diff --git a/ModuleSatelliteDatabase/src/main/java/org/josast/AmsatList/test/generateXMLforSDRConsole.java b/ModuleSatelliteDatabase/src/main/java/org/josast/AmsatList/test/generateXMLforSDRConsole.java index 4a29e61699d932b2e9703b61727464a71b5fa32d..85e53be03e4e1443ce508900626539c2bee2a9d8 100644 --- a/ModuleSatelliteDatabase/src/main/java/org/josast/AmsatList/test/generateXMLforSDRConsole.java +++ b/ModuleSatelliteDatabase/src/main/java/org/josast/AmsatList/test/generateXMLforSDRConsole.java @@ -7,7 +7,6 @@ import java.util.Date; import java.util.List; import java.util.ListIterator; import java.util.logging.Logger; - import org.josast.AmsatList.generated.AmsatList; import org.josast.AmsatList.generated.Beacons; import org.josast.AmsatList.generated.Modes; @@ -17,233 +16,299 @@ import org.josast.ModuleSatelliteDatabase.AmsatListFile; import org.josast.util.files.ManageFolder; public class generateXMLforSDRConsole { - private static Logger logger = Logger.getLogger("AmsatLogger"); - private AmsatListFile amsatListFile; - private AmsatList amsatList; - ManageFolder folder = new ManageFolder("SDRConsole"); - private static final String LINE_SEPARATOR = "\r\n"; - private String filename = null; - - public generateXMLforSDRConsole(String filename) { - // amsatListFile = AmsatListFileSingletonV2.getInstance(). - // getAmsatListFile(new File(filename)); - amsatList = amsatListFile.getAmsatList(); - } - - public void execute() { - List listSatellite = amsatList.getSatellites(); - ListIterator it = listSatellite.listIterator(); - - Satellites sat = null; - int cpt = 9000; - while (it.hasNext()) { - sat = it.next(); - // SDR_SAT_40906_Custom_data.XML -// Path filepath = Paths.get(folder.getRepositoryPath() + -// "\\SDR_SAT_" + sat.getNasaID()+"_"+sat.getName() +"Custom_data.XML"); - - PrintWriter pw = null; - if (sat.getStatus().contains("Decayed") || - sat.getStatus().contains("Not operational")) { - System.out.println(sat.getName()+ " not computed "); - } else { - - System.out.println(sat.getName()+ - " computed " + sat.getStatus()); - try { - int nasaid = sat.getNasaID().intValue(); - if (nasaid == 0) { - nasaid = cpt++; - } - filename = folder.getRepositoryPath() + - "\\SDR_SAT_" + nasaid + "_Custom_data.XML"; - pw = new PrintWriter(filename); - pw.write(generateXmldata(sat)); - - pw.flush(); - pw.close(); - } catch (IOException e) { - e.printStackTrace(); - } - - } - } - } - - public String generateXmldata(Satellites sat) - -// Modes, a combination of two fields: -// ModeEnum="1" ModeTx="33554432" USB -// ModeEnum="1" ModeTx="67108864" LSB -// ModeEnum="5" ModeTx="33554432" CW-U -// ModeEnum="8" ModeTx="33554432" W-FM (wide Band FM) -// ModeEnum="7" ModeTx="33554432" N-FM (Narrow FM) - - { - StringBuffer sb = new StringBuffer(); - - SimpleDateFormat formater = new SimpleDateFormat("yyyy-MM-dd-HH:mm"); - Date aujourdhui = new Date(); - -// ModeEnum="1" ModeTx="33554432" USB -// ModeEnum="1" ModeTx="67108864" LSB -// ModeEnum="5" ModeTx="33554432" CW-U -// ModeEnum="8" ModeTx="33554432" W-FM (wide Band FM) -// ModeEnum="7" ModeTx="33554432" N-FM (Narrow FM) - - sb.append("" + LINE_SEPARATOR); - sb.append(" " + LINE_SEPARATOR); - sb.append(" " + LINE_SEPARATOR); - sb.append(" " + LINE_SEPARATOR); - sb.append(" " + LINE_SEPARATOR); - sb.append(" " + LINE_SEPARATOR); - sb.append(" " + LINE_SEPARATOR); - sb.append(" " + LINE_SEPARATOR); - sb.append(" " + LINE_SEPARATOR); - sb.append(" " + LINE_SEPARATOR); - sb.append(" " + LINE_SEPARATOR); - sb.append(" " + LINE_SEPARATOR); - sb.append(" " + LINE_SEPARATOR); - sb.append(" " + LINE_SEPARATOR); - sb.append(" " + LINE_SEPARATOR); - sb.append(" " + LINE_SEPARATOR); - sb.append(" " + LINE_SEPARATOR); - - sb.append("" - + LINE_SEPARATOR); - sb.append("" + LINE_SEPARATOR); - - List beaconList = sat.getRadioData().getBeacons(); - ListIterator itb = beaconList.listIterator(); - List transpondeurList = sat.getRadioData().getTransponders(); - ListIterator itt = transpondeurList.listIterator(); - while (itb.hasNext()) { - - Beacons beacon = itb.next(); - List modeList = beacon.getModes(); - ListIterator itm = modeList.listIterator(); -// mode => AFSK => FM -// mode => BPSK - GR3UH => LSB -// Modes, a combination of two fields: -// ModeEnum="1" ModeTx="33554432" USB -// ModeEnum="1" ModeTx="67108864" LSB -// ModeEnum="5" ModeTx="33554432" CW-U -// ModeEnum="8" ModeTx="33554432" W-FM (wide Band FM, for wide band telemetry like FSK 9k6 and higher) -// ModeEnum="7" ModeTx="33554432" N-FM (Narrow FM) - - String ModeEnum = "7"; - String ModeTx = "33554432"; - boolean bmode = false; - Modes mode = null; - while (itm.hasNext()) { - mode = itm.next(); - if (!bmode) { - bmode = true; - - if (mode.getMode().contains("CW")) { // CW-U - ModeEnum = "5"; - ModeTx = "33554432"; - } else if (mode.getMode().contains("FSK") - || mode.getMode().contains("MSK") - || mode.getMode().contains("RTTY")) { - // N-FM (Narrow FM) - - ModeEnum = "7"; - ModeTx = "33554432"; - } else if (mode.getMode().contains("PSK")) { - // LSB - ModeEnum = "1"; - ModeTx = "67108864"; - - } else { - bmode = false; - } - } - - } - if (!bmode) { - System.out.println("Beacon " + mode.getMode() + " " + mode.getSpeed()); - } - - sb.append("" + LINE_SEPARATOR); - sb.append("" + LINE_SEPARATOR); - } - while (itt.hasNext()) { - - Transponders transponders = itt.next(); - // System.out.println("Transpondeur "+transponders.getMode() ); - - String up_ModeEnum = "7"; - String up_ModeTx = "33554432"; - String dw_ModeEnum = "7"; - String dw_ModeTx = "33554432"; - boolean bmode = true; - String mode = transponders.getMode(); - - if (mode != null) - - { - - if (mode.contains("CW")) { // CW-U - up_ModeEnum = "5"; - up_ModeTx = "33554432"; - dw_ModeEnum = "5"; - dw_ModeTx = "33554432"; - } else if (mode.contains("FM") || mode.contains("APRS")) { - // N-FM (Narrow FM) - - up_ModeEnum = "7"; - up_ModeTx = "33554432"; - dw_ModeEnum = "7"; - dw_ModeTx = "33554432"; - } else if (mode.contains("SSB") || mode.contains("LSB")) { - // LSB Up - USB Down - up_ModeEnum = "1"; - up_ModeTx = "67108864"; - dw_ModeEnum = "1"; - dw_ModeTx = "33554432"; - - } else if (mode.contains("FSK")) { - // N-FM (Narrow FM) - - up_ModeEnum = "7"; - up_ModeTx = "33554432"; - dw_ModeEnum = "7"; - dw_ModeTx = "33554432"; - - } else { - bmode = false; - } - } - - if (!bmode) { - System.out.println("Transpondeur " + mode); - } - - sb.append("" + LINE_SEPARATOR); - sb.append("" + LINE_SEPARATOR); - sb.append("" + LINE_SEPARATOR); - sb.append("" + LINE_SEPARATOR); - - } - sb.append(""); - return sb.toString(); - - } - - public static void main(String[] args) { - generateXMLforSDRConsole gen = new generateXMLforSDRConsole("AmsatList.xml"); - gen.execute(); - } + private static Logger logger = Logger.getLogger("AmsatLogger"); + private AmsatListFile amsatListFile; + private AmsatList amsatList; + ManageFolder folder = new ManageFolder("SDRConsole"); + private static final String LINE_SEPARATOR = "\r\n"; + private String filename = null; + + public generateXMLforSDRConsole(String filename) { + // amsatListFile = AmsatListFileSingletonV2.getInstance(). + // getAmsatListFile(new File(filename)); + amsatList = amsatListFile.getAmsatList(); + } + + public void execute() { + List listSatellite = amsatList.getSatellites(); + ListIterator it = listSatellite.listIterator(); + + Satellites sat = null; + int cpt = 9000; + while (it.hasNext()) { + sat = it.next(); + // SDR_SAT_40906_Custom_data.XML + // Path filepath = Paths.get(folder.getRepositoryPath() + + // "\\SDR_SAT_" + sat.getNasaID()+"_"+sat.getName() +"Custom_data.XML"); + + PrintWriter pw = null; + if (sat.getStatus().contains("Decayed") || sat.getStatus().contains("Not operational")) { + System.out.println(sat.getName() + " not computed "); + } else { + + System.out.println(sat.getName() + " computed " + sat.getStatus()); + try { + int nasaid = sat.getNasaID().intValue(); + if (nasaid == 0) { + nasaid = cpt++; + } + filename = folder.getRepositoryPath() + "\\SDR_SAT_" + nasaid + "_Custom_data.XML"; + pw = new PrintWriter(filename); + pw.write(generateXmldata(sat)); + + pw.flush(); + pw.close(); + } catch (IOException e) { + e.printStackTrace(); + } + } + } + } + + public String generateXmldata(Satellites sat) + + // Modes, a combination of two fields: + // ModeEnum="1" ModeTx="33554432" USB + // ModeEnum="1" ModeTx="67108864" LSB + // ModeEnum="5" ModeTx="33554432" CW-U + // ModeEnum="8" ModeTx="33554432" W-FM (wide Band FM) + // ModeEnum="7" ModeTx="33554432" N-FM (Narrow FM) + + { + StringBuffer sb = new StringBuffer(); + + SimpleDateFormat formater = new SimpleDateFormat("yyyy-MM-dd-HH:mm"); + Date aujourdhui = new Date(); + + // ModeEnum="1" ModeTx="33554432" USB + // ModeEnum="1" ModeTx="67108864" LSB + // ModeEnum="5" ModeTx="33554432" CW-U + // ModeEnum="8" ModeTx="33554432" W-FM (wide Band FM) + // ModeEnum="7" ModeTx="33554432" N-FM (Narrow FM) + + sb.append("" + LINE_SEPARATOR); + sb.append( + " " + + LINE_SEPARATOR); + sb.append( + " " + + LINE_SEPARATOR); + sb.append( + " " + + LINE_SEPARATOR); + sb.append( + " " + + LINE_SEPARATOR); + sb.append( + " " + + LINE_SEPARATOR); + sb.append( + " " + + LINE_SEPARATOR); + sb.append( + " " + + LINE_SEPARATOR); + sb.append( + " " + + LINE_SEPARATOR); + sb.append( + " " + + LINE_SEPARATOR); + sb.append( + " " + + LINE_SEPARATOR); + sb.append( + " " + + LINE_SEPARATOR); + sb.append( + " " + + LINE_SEPARATOR); + sb.append( + " " + LINE_SEPARATOR); + sb.append( + " " + + LINE_SEPARATOR); + sb.append( + " " + + LINE_SEPARATOR); + sb.append( + " " + + LINE_SEPARATOR); + + sb.append( + "" + + LINE_SEPARATOR); + sb.append( + "" + + LINE_SEPARATOR); + + List beaconList = sat.getRadioData().getBeacons(); + ListIterator itb = beaconList.listIterator(); + List transpondeurList = sat.getRadioData().getTransponders(); + ListIterator itt = transpondeurList.listIterator(); + while (itb.hasNext()) { + + Beacons beacon = itb.next(); + List modeList = beacon.getModes(); + ListIterator itm = modeList.listIterator(); + // mode => AFSK => FM + // mode => BPSK - GR3UH => LSB + // Modes, a combination of two fields: + // ModeEnum="1" ModeTx="33554432" USB + // ModeEnum="1" ModeTx="67108864" LSB + // ModeEnum="5" ModeTx="33554432" CW-U + // ModeEnum="8" ModeTx="33554432" W-FM (wide Band FM, for wide band telemetry + // like FSK 9k6 and higher) + // ModeEnum="7" ModeTx="33554432" N-FM (Narrow FM) + + String ModeEnum = "7"; + String ModeTx = "33554432"; + boolean bmode = false; + Modes mode = null; + while (itm.hasNext()) { + mode = itm.next(); + if (!bmode) { + bmode = true; + + if (mode.getMode().contains("CW")) { // CW-U + ModeEnum = "5"; + ModeTx = "33554432"; + } else if (mode.getMode().contains("FSK") + || mode.getMode().contains("MSK") + || mode.getMode().contains("RTTY")) { + // N-FM (Narrow FM) + + ModeEnum = "7"; + ModeTx = "33554432"; + } else if (mode.getMode().contains("PSK")) { + // LSB + ModeEnum = "1"; + ModeTx = "67108864"; + + } else { + bmode = false; + } + } + } + if (!bmode) { + System.out.println("Beacon " + mode.getMode() + " " + mode.getSpeed()); + } + + sb.append( + "" + + LINE_SEPARATOR); + sb.append("" + LINE_SEPARATOR); + } + while (itt.hasNext()) { + + Transponders transponders = itt.next(); + // System.out.println("Transpondeur "+transponders.getMode() ); + + String up_ModeEnum = "7"; + String up_ModeTx = "33554432"; + String dw_ModeEnum = "7"; + String dw_ModeTx = "33554432"; + boolean bmode = true; + String mode = transponders.getMode(); + + if (mode != null) { + + if (mode.contains("CW")) { // CW-U + up_ModeEnum = "5"; + up_ModeTx = "33554432"; + dw_ModeEnum = "5"; + dw_ModeTx = "33554432"; + } else if (mode.contains("FM") || mode.contains("APRS")) { + // N-FM (Narrow FM) + + up_ModeEnum = "7"; + up_ModeTx = "33554432"; + dw_ModeEnum = "7"; + dw_ModeTx = "33554432"; + } else if (mode.contains("SSB") || mode.contains("LSB")) { + // LSB Up - USB Down + up_ModeEnum = "1"; + up_ModeTx = "67108864"; + dw_ModeEnum = "1"; + dw_ModeTx = "33554432"; + + } else if (mode.contains("FSK")) { + // N-FM (Narrow FM) + + up_ModeEnum = "7"; + up_ModeTx = "33554432"; + dw_ModeEnum = "7"; + dw_ModeTx = "33554432"; + + } else { + bmode = false; + } + } + + if (!bmode) { + System.out.println("Transpondeur " + mode); + } + + sb.append( + "" + + LINE_SEPARATOR); + sb.append("" + LINE_SEPARATOR); + sb.append( + "" + + LINE_SEPARATOR); + sb.append("" + LINE_SEPARATOR); + } + sb.append(""); + return sb.toString(); + } + + public static void main(String[] args) { + generateXMLforSDRConsole gen = new generateXMLforSDRConsole("AmsatList.xml"); + gen.execute(); + } } diff --git a/ModuleSatelliteDatabase/src/main/java/org/josast/ModuleSatelliteDatabase/AmsatListFile.java b/ModuleSatelliteDatabase/src/main/java/org/josast/ModuleSatelliteDatabase/AmsatListFile.java index 481fc01b43443d790ef53278d456350713ab0e7e..5d935d64367c2715b73bbe0f43696732dcaad5b2 100644 --- a/ModuleSatelliteDatabase/src/main/java/org/josast/ModuleSatelliteDatabase/AmsatListFile.java +++ b/ModuleSatelliteDatabase/src/main/java/org/josast/ModuleSatelliteDatabase/AmsatListFile.java @@ -1,5 +1,10 @@ package org.josast.ModuleSatelliteDatabase; +import jakarta.xml.bind.JAXBContext; +import jakarta.xml.bind.JAXBException; +import jakarta.xml.bind.Marshaller; +import jakarta.xml.bind.PropertyException; +import jakarta.xml.bind.Unmarshaller; import java.io.File; import java.io.FileNotFoundException; import java.io.FileOutputStream; @@ -8,182 +13,142 @@ import java.util.Hashtable; import java.util.List; import java.util.ListIterator; import java.util.logging.Logger; - -//import javax.xml.bind.JAXBContext; -//import javax.xml.bind.JAXBException; -//import javax.xml.bind.Marshaller; -//import javax.xml.bind.PropertyException; -//import javax.xml.bind.Unmarshaller; - import org.josast.AmsatList.generated.AmsatList; import org.josast.AmsatList.generated.Satellites; -import jakarta.xml.bind.JAXBContext; -import jakarta.xml.bind.JAXBException; -import jakarta.xml.bind.Marshaller; -import jakarta.xml.bind.PropertyException; -import jakarta.xml.bind.Unmarshaller; - public class AmsatListFile { - private Logger log = Logger.getLogger(getClass().getName()); - - private FlatSatList amsatListFlat = new FlatSatList(); - private AmsatList amsatList = null; - private Hashtable amsatListByName = - new Hashtable<>(); - private Hashtable amsatListNasaId = - new Hashtable<>(); - - - - /** - * @param filein - * @return - */ - public AmsatList openAmsatList(String filein) { - File fileIn = new File(filein); - return openAmsatList(fileIn); + private Logger log = Logger.getLogger(getClass().getName()); + + private FlatSatList amsatListFlat = new FlatSatList(); + private AmsatList amsatList = null; + private Hashtable amsatListByName = new Hashtable<>(); + private Hashtable amsatListNasaId = new Hashtable<>(); + + /** + * @param filein + * @return + */ + public AmsatList openAmsatList(String filein) { + File fileIn = new File(filein); + return openAmsatList(fileIn); + } + + /** + * @param filein + * @return + */ + public AmsatList openAmsatList(File filein) { + + JAXBContext jaxbContext = null; + try { + jaxbContext = JAXBContext.newInstance("org.josast.AmsatList.generated"); + } catch (JAXBException e) { + + log.severe(e.getMessage()); + e.printStackTrace(); } - /** - * @param filein - * @return - */ - public AmsatList openAmsatList(File filein) { - - - JAXBContext jaxbContext = null; - try { - jaxbContext = JAXBContext - .newInstance("org.josast.AmsatList.generated"); - } catch (JAXBException e) { - - log.severe(e.getMessage()); - e.printStackTrace(); - } - - Unmarshaller unmarshaller = null; - try { - unmarshaller = jaxbContext.createUnmarshaller(); - } catch (JAXBException e) { - - log.severe(e.getMessage()); - e.printStackTrace(); - } - - try { - amsatList = (AmsatList) unmarshaller.unmarshal(filein); - } catch (JAXBException e) { - log.severe("fichier "+filein); - log.severe(e.getMessage()); - e.printStackTrace(); - } - - setupAmsatListFlat(); - - return amsatList; + Unmarshaller unmarshaller = null; + try { + unmarshaller = jaxbContext.createUnmarshaller(); + } catch (JAXBException e) { + log.severe(e.getMessage()); + e.printStackTrace(); } - private void setupAmsatListFlat() { - List listSatellite = amsatList.getSatellites(); - ListIterator it = listSatellite.listIterator(); - while (it.hasNext()) { - Satellites sat = it.next(); - AmsatListFlat amSatFlat = new AmsatListFlat(sat); - amsatListByName.put(sat.getName(), sat); - - - if (sat.getNasaID()==null) - { - System.err.println(" Sat 2 ? "+sat.getName()); - } - - else - { - amsatListNasaId.put(sat.getNasaID(), sat); - - amsatListFlat.put(amSatFlat.getSatelliteNoradId(),amSatFlat); - } - } - - - } - - /** - * @param fichOutSring - * @param amsatList - */ - public void save(String fichOutSring, AmsatList amsatList) { - File fichOut = new File(fichOutSring); - JAXBContext jc = null; - Marshaller mrs = null; - try { - jc = JAXBContext.newInstance("org.josast.AmsatList.generated"); - } catch (JAXBException e) { - - log.severe(e.getMessage()); - } - - try { - mrs = jc.createMarshaller(); - } catch (JAXBException e) { - log.severe(e.getMessage()); - } - try { - mrs.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE); - } catch (PropertyException e) { - log.severe(e.getMessage()); - } // indenter - - if (fichOut != null) { - try { - mrs.marshal(amsatList, new FileOutputStream(fichOut)); - } catch (FileNotFoundException e) { - log.severe(e.getMessage()); - } catch (JAXBException e) { - log.severe(e.getMessage()); - } - } - + try { + amsatList = (AmsatList) unmarshaller.unmarshal(filein); + } catch (JAXBException e) { + log.severe("fichier " + filein); + log.severe(e.getMessage()); + e.printStackTrace(); } - public FlatSatList getAmsatListFlat() { - return amsatListFlat; - } - - public void setAmsatListFlat(FlatSatList amsatListFlat) { - this.amsatListFlat = amsatListFlat; - } - - public AmsatList getAmsatList() { - return amsatList; - } + setupAmsatListFlat(); - public void setAmsatList(AmsatList amsatList) { - this.amsatList = amsatList; - } + return amsatList; + } + private void setupAmsatListFlat() { + List listSatellite = amsatList.getSatellites(); + ListIterator it = listSatellite.listIterator(); + while (it.hasNext()) { + Satellites sat = it.next(); + AmsatListFlat amSatFlat = new AmsatListFlat(sat); + amsatListByName.put(sat.getName(), sat); + if (sat.getNasaID() == null) { + System.err.println(" Sat 2 ? " + sat.getName()); + } else { + amsatListNasaId.put(sat.getNasaID(), sat); + amsatListFlat.put(amSatFlat.getSatelliteNoradId(), amSatFlat); + } + } + } + + /** + * @param fichOutSring + * @param amsatList + */ + public void save(String fichOutSring, AmsatList amsatList) { + File fichOut = new File(fichOutSring); + JAXBContext jc = null; + Marshaller mrs = null; + try { + jc = JAXBContext.newInstance("org.josast.AmsatList.generated"); + } catch (JAXBException e) { + + log.severe(e.getMessage()); + } + try { + mrs = jc.createMarshaller(); + } catch (JAXBException e) { + log.severe(e.getMessage()); + } + try { + mrs.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE); + } catch (PropertyException e) { + log.severe(e.getMessage()); + } // indenter + + if (fichOut != null) { + try { + mrs.marshal(amsatList, new FileOutputStream(fichOut)); + } catch (FileNotFoundException e) { + log.severe(e.getMessage()); + } catch (JAXBException e) { + log.severe(e.getMessage()); + } + } + } - /** - * @return the amsatListByName - */ - public Hashtable getAmsatListByName() { - return amsatListByName; - } + public FlatSatList getAmsatListFlat() { + return amsatListFlat; + } - /** - * @return the amsatListNasaId - */ - public Hashtable getAmsatListNasaId() { - return amsatListNasaId; - } + public void setAmsatListFlat(FlatSatList amsatListFlat) { + this.amsatListFlat = amsatListFlat; + } + public AmsatList getAmsatList() { + return amsatList; + } + public void setAmsatList(AmsatList amsatList) { + this.amsatList = amsatList; + } + /** @return the amsatListByName */ + public Hashtable getAmsatListByName() { + return amsatListByName; + } + /** @return the amsatListNasaId */ + public Hashtable getAmsatListNasaId() { + return amsatListNasaId; + } } diff --git a/ModuleSatelliteDatabase/src/main/java/org/josast/ModuleSatelliteDatabase/AmsatListFileSingleton.java b/ModuleSatelliteDatabase/src/main/java/org/josast/ModuleSatelliteDatabase/AmsatListFileSingleton.java index 1e3193d088687560c39c4617d0fa1b27840455fd..64c97519d5795b6a62ac4d0d44e3d1efc5cb914c 100644 --- a/ModuleSatelliteDatabase/src/main/java/org/josast/ModuleSatelliteDatabase/AmsatListFileSingleton.java +++ b/ModuleSatelliteDatabase/src/main/java/org/josast/ModuleSatelliteDatabase/AmsatListFileSingleton.java @@ -2,55 +2,39 @@ package org.josast.ModuleSatelliteDatabase; import java.io.File; import java.util.logging.Logger; - import org.josast.AmsatList.generated.AmsatList; public class AmsatListFileSingleton { + private Logger log = Logger.getLogger(getClass().getName()); + private static AmsatListFileSingleton singleton = null; + private AmsatList amsatList = null; + private AmsatListFile amf = null; - private Logger log = Logger.getLogger(getClass().getName()); - private static AmsatListFileSingleton singleton = null; - private AmsatList amsatList=null; - private AmsatListFile amf =null; - - - - private AmsatListFileSingleton() { + private AmsatListFileSingleton() {} + public static AmsatListFileSingleton getInstance() { + if (singleton == null) { + singleton = new AmsatListFileSingleton(); } - - public static AmsatListFileSingleton getInstance() - { - if (singleton ==null) - { - singleton = new AmsatListFileSingleton(); - } return singleton; - } - - - public AmsatList getAmsatList(File filein) - { - if(amsatList==null) - { - log.info("load AmsatSatellite Database file"); - this.amf = new AmsatListFile(); - this.amsatList = amf.openAmsatList(filein); - } - return amsatList; - - } - - public AmsatListFile getAmsatListFlat(File filein) - { - if(amsatList==null) - { - log.info("load AmsatSatellite Database file"); - this.amf = new AmsatListFile(); - this.amsatList = amf.openAmsatList(filein); - } - return amf; - - } + } + public AmsatList getAmsatList(File filein) { + if (amsatList == null) { + log.info("load AmsatSatellite Database file"); + this.amf = new AmsatListFile(); + this.amsatList = amf.openAmsatList(filein); + } + return amsatList; + } + + public AmsatListFile getAmsatListFlat(File filein) { + if (amsatList == null) { + log.info("load AmsatSatellite Database file"); + this.amf = new AmsatListFile(); + this.amsatList = amf.openAmsatList(filein); + } + return amf; + } } diff --git a/ModuleSatelliteDatabase/src/main/java/org/josast/ModuleSatelliteDatabase/AmsatListFlat.java b/ModuleSatelliteDatabase/src/main/java/org/josast/ModuleSatelliteDatabase/AmsatListFlat.java index 67c5c5020136d3805adfbdb547900a3e926b1aa0..1acd62d1b2cbe36850454f884dd4db437771f386 100644 --- a/ModuleSatelliteDatabase/src/main/java/org/josast/ModuleSatelliteDatabase/AmsatListFlat.java +++ b/ModuleSatelliteDatabase/src/main/java/org/josast/ModuleSatelliteDatabase/AmsatListFlat.java @@ -1,36 +1,29 @@ package org.josast.ModuleSatelliteDatabase; import java.math.BigInteger; - import org.josast.AmsatList.generated.Satellites; public class AmsatListFlat extends FlatSatellite { - - public AmsatListFlat (Satellites sat) - { - setup(sat); - } - private void setup(Satellites sat) { - satelliteName = sat.getName(); - satelliteStatus = sat.getStatus(); - if(sat.getNasaID()==null) - { - satelliteNoradId = BigInteger.valueOf(-1); - } else - { - satelliteNoradId = sat.getNasaID(); - } - - if(sat.getIARUCoordination() != null) - { - IARUCoordination = sat.getIARUCoordination().isCoordinated(); - IARUCoordinationLink = sat.getIARUCoordination().getURL(); - } - else { - IARUCoordination=false; - } - InternationalID = sat.getInternationalID(); - } + public AmsatListFlat(Satellites sat) { + setup(sat); + } + + private void setup(Satellites sat) { + satelliteName = sat.getName(); + satelliteStatus = sat.getStatus(); + if (sat.getNasaID() == null) { + satelliteNoradId = BigInteger.valueOf(-1); + } else { + satelliteNoradId = sat.getNasaID(); + } + if (sat.getIARUCoordination() != null) { + IARUCoordination = sat.getIARUCoordination().isCoordinated(); + IARUCoordinationLink = sat.getIARUCoordination().getURL(); + } else { + IARUCoordination = false; + } + InternationalID = sat.getInternationalID(); + } } diff --git a/ModuleSatelliteDatabase/src/main/java/org/josast/ModuleSatelliteDatabase/CheckAmsatListFile.java b/ModuleSatelliteDatabase/src/main/java/org/josast/ModuleSatelliteDatabase/CheckAmsatListFile.java index a51ee8cbb024a189bc829576376e65dd764cb680..846275a77224975789008e153843df5b449a3245 100644 --- a/ModuleSatelliteDatabase/src/main/java/org/josast/ModuleSatelliteDatabase/CheckAmsatListFile.java +++ b/ModuleSatelliteDatabase/src/main/java/org/josast/ModuleSatelliteDatabase/CheckAmsatListFile.java @@ -5,151 +5,134 @@ import java.util.Hashtable; import java.util.List; import java.util.ListIterator; import java.util.Vector; - import org.josast.AmsatList.Commande.Commande; import org.josast.AmsatList.generated.AmsatList; import org.josast.AmsatList.generated.Satellites; public class CheckAmsatListFile { - /** - * Amsat list structure. - */ - private AmsatList al = null; - - /** - * @param file file name. - */ - public CheckAmsatListFile(final String file) { - AmsatListFile alf = new AmsatListFile(); - al = alf.openAmsatList(file); - - } - - /** - * Check if a satellite with the same name is more than once in the XML file - * - * @return list of satellite. - */ - public Vector checkUniqueSatelliteName() { - - Hashtable amsatListSatellite = new Hashtable<>(); - - List listSatellite = al.getSatellites(); - ListIterator it = listSatellite.listIterator(); - Vector satNameVec = new Vector<>(); - // vérifier qu'un satellite n'est pas deux fois dans la base - - while (it.hasNext()) { - Satellites sat = it.next(); - String satelliteName = sat.getName(); - - if (amsatListSatellite.containsKey(satelliteName)) { - satNameVec.addElement(satelliteName); - } else { - amsatListSatellite.put(satelliteName, sat); - } - - } - return satNameVec; - } - - /** - * @return list of satellite name - */ - public Vector checkUniqueSatelliteNasaID() { - - Hashtable amsatListSatellite = new Hashtable<>(); - - List listSatellite = al.getSatellites(); - ListIterator it = listSatellite.listIterator(); - Vector satNameVec = new Vector<>(); - // vérifier qu'un satellite n'est pas deux fois dans la base - - while (it.hasNext()) { - Satellites sat = it.next(); - BigInteger satelliteId = sat.getNasaID(); - if (sat.getNasaID() != null) { - - if (amsatListSatellite.containsKey(satelliteId)) { - satNameVec.addElement(sat.getName() + " " + satelliteId); - } else { - amsatListSatellite.put(satelliteId, sat); - } - } else { - System.out.println("Nasa ID null" + sat.getName()); - } - - } - return satNameVec; - } - - /** - * @return amsat List Satellite. - */ - public Vector getListSatelliteStatus() { - Hashtable> amsatListSatellite = new Hashtable<>(); - - List listSatellite = al.getSatellites(); - Vector satelliteStatus = new Vector<>(); - - ListIterator it = listSatellite.listIterator(); - while (it.hasNext()) { - Satellites sat = it.next(); - String status = sat.getStatus(); - - if (status == null) { - System.out.println("Status Null"); - status = "Not Defined"; - - } - Vector vsat; - if (amsatListSatellite.containsKey(status)) { - vsat = amsatListSatellite.get(status); - - } else { - vsat = new Vector<>(); - amsatListSatellite.put(status, vsat); - satelliteStatus.add(status); - } - vsat.addElement(sat); - } - - return satelliteStatus; - } - - - /** - * @return amsat List Satellite. - */ - public Vector checkSatelliteStatus() { - CheckStatus checkStatus = new CheckStatus(); - - List listSatellite = al.getSatellites(); - Vector satelliteStatus = new Vector<>(); - - ListIterator it = listSatellite.listIterator(); - while (it.hasNext()) { - Satellites sat = it.next(); - String status = sat.getStatus(); - - if (status == null) { - System.out.println("Status Null"); - status = "Not Defined"; - - } - - else if (!checkStatus.isValid(status)) - { - Commande cmd = new Commande(sat.getName(), sat.getNasaID(), Commande.SatelliteStatusUpdate, - sat.getStatus(), checkStatus.getCorrespondingStatus(status), "check"); - satelliteStatus.add(cmd); - } - - - } - - return satelliteStatus; - } - - + /** Amsat list structure. */ + private AmsatList al = null; + + /** @param file file name. */ + public CheckAmsatListFile(final String file) { + AmsatListFile alf = new AmsatListFile(); + al = alf.openAmsatList(file); + } + + /** + * Check if a satellite with the same name is more than once in the XML file + * + * @return list of satellite. + */ + public Vector checkUniqueSatelliteName() { + + Hashtable amsatListSatellite = new Hashtable<>(); + + List listSatellite = al.getSatellites(); + ListIterator it = listSatellite.listIterator(); + Vector satNameVec = new Vector<>(); + // vérifier qu'un satellite n'est pas deux fois dans la base + + while (it.hasNext()) { + Satellites sat = it.next(); + String satelliteName = sat.getName(); + + if (amsatListSatellite.containsKey(satelliteName)) { + satNameVec.addElement(satelliteName); + } else { + amsatListSatellite.put(satelliteName, sat); + } + } + return satNameVec; + } + + /** @return list of satellite name */ + public Vector checkUniqueSatelliteNasaID() { + + Hashtable amsatListSatellite = new Hashtable<>(); + + List listSatellite = al.getSatellites(); + ListIterator it = listSatellite.listIterator(); + Vector satNameVec = new Vector<>(); + // vérifier qu'un satellite n'est pas deux fois dans la base + + while (it.hasNext()) { + Satellites sat = it.next(); + BigInteger satelliteId = sat.getNasaID(); + if (sat.getNasaID() != null) { + + if (amsatListSatellite.containsKey(satelliteId)) { + satNameVec.addElement(sat.getName() + " " + satelliteId); + } else { + amsatListSatellite.put(satelliteId, sat); + } + } else { + System.out.println("Nasa ID null" + sat.getName()); + } + } + return satNameVec; + } + + /** @return amsat List Satellite. */ + public Vector getListSatelliteStatus() { + Hashtable> amsatListSatellite = new Hashtable<>(); + + List listSatellite = al.getSatellites(); + Vector satelliteStatus = new Vector<>(); + + ListIterator it = listSatellite.listIterator(); + while (it.hasNext()) { + Satellites sat = it.next(); + String status = sat.getStatus(); + + if (status == null) { + System.out.println("Status Null"); + status = "Not Defined"; + } + Vector vsat; + if (amsatListSatellite.containsKey(status)) { + vsat = amsatListSatellite.get(status); + + } else { + vsat = new Vector<>(); + amsatListSatellite.put(status, vsat); + satelliteStatus.add(status); + } + vsat.addElement(sat); + } + + return satelliteStatus; + } + + /** @return amsat List Satellite. */ + public Vector checkSatelliteStatus() { + CheckStatus checkStatus = new CheckStatus(); + + List listSatellite = al.getSatellites(); + Vector satelliteStatus = new Vector<>(); + + ListIterator it = listSatellite.listIterator(); + while (it.hasNext()) { + Satellites sat = it.next(); + String status = sat.getStatus(); + + if (status == null) { + System.out.println("Status Null"); + status = "Not Defined"; + + } else if (!checkStatus.isValid(status)) { + Commande cmd = + new Commande( + sat.getName(), + sat.getNasaID(), + Commande.SatelliteStatusUpdate, + sat.getStatus(), + checkStatus.getCorrespondingStatus(status), + "check"); + satelliteStatus.add(cmd); + } + } + + return satelliteStatus; + } } diff --git a/ModuleSatelliteDatabase/src/main/java/org/josast/ModuleSatelliteDatabase/CheckStatus.java b/ModuleSatelliteDatabase/src/main/java/org/josast/ModuleSatelliteDatabase/CheckStatus.java index 56ed486f1fc4fde4c1b63fefbfd2c0bb8a9dedea..a8ec96585749d78173f2c283eced701a915db014 100644 --- a/ModuleSatelliteDatabase/src/main/java/org/josast/ModuleSatelliteDatabase/CheckStatus.java +++ b/ModuleSatelliteDatabase/src/main/java/org/josast/ModuleSatelliteDatabase/CheckStatus.java @@ -1,61 +1,49 @@ -/** - * - */ +/** */ package org.josast.ModuleSatelliteDatabase; import java.util.Hashtable; -/** - * @author chris - * - */ +/** @author chris */ public class CheckStatus { - Hashtable status = new Hashtable<>(); - /** - * - */ - public CheckStatus() { - status.put("Decayed","Decayed" ); - status.put("Not operational","Inactive" ); - status.put("To be launch", "To be launch"); - status.put("Operational","Operational" ); - status.put("Non Operational","Inactive" ); - status.put("Unknown", "Unknown"); - status.put("Non Operationel","Inactive" ); - status.put("Deep Space", "Deep Space"); - status.put("Operational","Operational" ); - status.put("Not amateur satellite","Not amateur satellite" ); - status.put("Duplicated","Duplicated"); - status.put("Not Operational","Inactive" ); - status.put("Launched", "Launched"); - status.put("To Be Launch", "To be launch"); - status.put("Unknow", "Unknown" ); - status.put("Operationel","Operational" ); - status.put("Launch", "Launched"); - status.put("Operational","Operational"); - status.put("Inactive","Inactive"); - } - - public boolean isValid(String value) - { - boolean valid = false; - if (status.contains(value)) - { - // System.out.println("Value :"+value +"-" + status.get(value)); - - if(value.contentEquals(status.get(value))) - { - valid=true; - } - } - - return valid; - - } + Hashtable status = new Hashtable<>(); + /** */ + public CheckStatus() { + status.put("Decayed", "Decayed"); + status.put("Not operational", "Inactive"); + status.put("To be launch", "To be launch"); + status.put("Operational", "Operational"); + status.put("Non Operational", "Inactive"); + status.put("Unknown", "Unknown"); + status.put("Non Operationel", "Inactive"); + status.put("Deep Space", "Deep Space"); + status.put("Operational", "Operational"); + status.put("Not amateur satellite", "Not amateur satellite"); + status.put("Duplicated", "Duplicated"); + status.put("Not Operational", "Inactive"); + status.put("Launched", "Launched"); + status.put("To Be Launch", "To be launch"); + status.put("Unknow", "Unknown"); + status.put("Operationel", "Operational"); + status.put("Launch", "Launched"); + status.put("Operational", "Operational"); + status.put("Inactive", "Inactive"); + } - public String getCorrespondingStatus(String value) - { - return status.get(value.trim()); - } + public boolean isValid(String value) { + boolean valid = false; + if (status.contains(value)) { + // System.out.println("Value :"+value +"-" + status.get(value)); + + if (value.contentEquals(status.get(value))) { + valid = true; + } + } + + return valid; + } + + public String getCorrespondingStatus(String value) { + return status.get(value.trim()); + } } diff --git a/ModuleSatelliteDatabase/src/main/java/org/josast/ModuleSatelliteDatabase/FlatSatList.java b/ModuleSatelliteDatabase/src/main/java/org/josast/ModuleSatelliteDatabase/FlatSatList.java index 14aa0049669ba2fbdb58dbc83eca6380caaf06ad..0ab36df71d260b78fdd69c261da068053ffcec61 100644 --- a/ModuleSatelliteDatabase/src/main/java/org/josast/ModuleSatelliteDatabase/FlatSatList.java +++ b/ModuleSatelliteDatabase/src/main/java/org/josast/ModuleSatelliteDatabase/FlatSatList.java @@ -3,21 +3,17 @@ package org.josast.ModuleSatelliteDatabase; import java.math.BigInteger; import java.util.Hashtable; - /** - * Hashtable with Integer as key. - * Usualy the key is satellite Norad ID. - * @author Christophe + * Hashtable with Integer as key. Usualy the key is satellite Norad ID. * + * @author Christophe */ public class FlatSatList extends Hashtable { - /** - * - */ - private static final long serialVersionUID = -8589972573653156592L; - - // Hashtable satelliteListNoradID - //= new Hashtable (); + /** */ + private static final long serialVersionUID = -8589972573653156592L; + + // Hashtable satelliteListNoradID + // = new Hashtable (); } diff --git a/ModuleSatelliteDatabase/src/main/java/org/josast/ModuleSatelliteDatabase/FlatSatellite.java b/ModuleSatelliteDatabase/src/main/java/org/josast/ModuleSatelliteDatabase/FlatSatellite.java index bfab3e0f5024c9fa040ceb67d642b5740086e992..4bdb5ef0b2edd4609215e870b7aeefb0cd3c0cfe 100644 --- a/ModuleSatelliteDatabase/src/main/java/org/josast/ModuleSatelliteDatabase/FlatSatellite.java +++ b/ModuleSatelliteDatabase/src/main/java/org/josast/ModuleSatelliteDatabase/FlatSatellite.java @@ -4,146 +4,134 @@ import java.math.BigInteger; public abstract class FlatSatellite { - protected String satelliteName; - protected String satelliteStatus; - protected BigInteger satelliteNoradId; - protected String satelliteUplinkFrequency; - protected String satelliteDownlinkFrequency; - protected String satelliteBeaconFrequency; - protected String satelliteBeaconMode; - protected String satellitebeaconCallsign; - protected String reports; - protected String info; - protected String TelemetryDecode; - protected boolean IARUCoordination; - protected String IARUCoordinationLink; - protected String InternationalID; - - - - /** - * @return the internationalID - */ - public String getInternationalID() { - return InternationalID; - } - - /** - * @param internationalID the internationalID to set - */ - public void setInternationalID(String internationalID) { - InternationalID = internationalID; - } - - /** - * @return the iARUCoordinationLink - */ - public String getIARUCoordinationLink() { - return IARUCoordinationLink; - } - - /** - * @param iARUCoordinationLink the iARUCoordinationLink to set - */ - public void setIARUCoordinationLink(String iARUCoordinationLink) { - IARUCoordinationLink = iARUCoordinationLink; - } - - public String getSatelliteName() { - return satelliteName; - } - - public void setSatelliteName(String satelliteName) { - this.satelliteName = satelliteName; - } - - public String getSatelliteStatus() { - return satelliteStatus; - } - - public void setSatelliteStatus(String satelliteStatus) { - this.satelliteStatus = satelliteStatus; - } - - public BigInteger getSatelliteNoradId() { - return satelliteNoradId; - } - - public void setSatelliteNoradId(BigInteger satelliteNoradId) { - this.satelliteNoradId = satelliteNoradId; - } - - public String getSatelliteUplinkFrequency() { - return satelliteUplinkFrequency; - } - - public void setSatelliteUplinkFrequency(String satelliteUplinkFrequency) { - this.satelliteUplinkFrequency = satelliteUplinkFrequency; - } - - public String getSatelliteDownlinkFrequency() { - return satelliteDownlinkFrequency; - } - - public void setSatelliteDownlinkFrequency( - String satelliteDownlinkFrequency) { - this.satelliteDownlinkFrequency = satelliteDownlinkFrequency; - } - - public String getSatelliteBeaconFrequency() { - return satelliteBeaconFrequency; - } - - public void setSatelliteBeaconFrequency(String satelliteBeaconFrequency) { - this.satelliteBeaconFrequency = satelliteBeaconFrequency; - } - - public String getSatelliteBeaconMode() { - return satelliteBeaconMode; - } - - public void setSatelliteBeaconMode(String satelliteBeaconMode) { - this.satelliteBeaconMode = satelliteBeaconMode; - } - - public String getSatellitebeaconCallsign() { - return satellitebeaconCallsign; - } - - public void setSatellitebeaconCallsign(String satellitebeaconCallsign) { - this.satellitebeaconCallsign = satellitebeaconCallsign; - } - - public String getReports() { - return reports; - } - - public void setReports(String reports) { - this.reports = reports; - } - - public String getInfo() { - return info; - } - - public void setInfo(String info) { - this.info = info; - } - - public String getTelemetryDecode() { - return TelemetryDecode; - } - - public void setTelemetryDecode(String telemetryDecode) { - TelemetryDecode = telemetryDecode; - } - - public boolean isIARUCoordination() { - return IARUCoordination; - } - - public void setIARUCoordination(boolean iARUCoordination) { - IARUCoordination = iARUCoordination; - } - + protected String satelliteName; + protected String satelliteStatus; + protected BigInteger satelliteNoradId; + protected String satelliteUplinkFrequency; + protected String satelliteDownlinkFrequency; + protected String satelliteBeaconFrequency; + protected String satelliteBeaconMode; + protected String satellitebeaconCallsign; + protected String reports; + protected String info; + protected String TelemetryDecode; + protected boolean IARUCoordination; + protected String IARUCoordinationLink; + protected String InternationalID; + + /** @return the internationalID */ + public String getInternationalID() { + return InternationalID; + } + + /** @param internationalID the internationalID to set */ + public void setInternationalID(String internationalID) { + InternationalID = internationalID; + } + + /** @return the iARUCoordinationLink */ + public String getIARUCoordinationLink() { + return IARUCoordinationLink; + } + + /** @param iARUCoordinationLink the iARUCoordinationLink to set */ + public void setIARUCoordinationLink(String iARUCoordinationLink) { + IARUCoordinationLink = iARUCoordinationLink; + } + + public String getSatelliteName() { + return satelliteName; + } + + public void setSatelliteName(String satelliteName) { + this.satelliteName = satelliteName; + } + + public String getSatelliteStatus() { + return satelliteStatus; + } + + public void setSatelliteStatus(String satelliteStatus) { + this.satelliteStatus = satelliteStatus; + } + + public BigInteger getSatelliteNoradId() { + return satelliteNoradId; + } + + public void setSatelliteNoradId(BigInteger satelliteNoradId) { + this.satelliteNoradId = satelliteNoradId; + } + + public String getSatelliteUplinkFrequency() { + return satelliteUplinkFrequency; + } + + public void setSatelliteUplinkFrequency(String satelliteUplinkFrequency) { + this.satelliteUplinkFrequency = satelliteUplinkFrequency; + } + + public String getSatelliteDownlinkFrequency() { + return satelliteDownlinkFrequency; + } + + public void setSatelliteDownlinkFrequency(String satelliteDownlinkFrequency) { + this.satelliteDownlinkFrequency = satelliteDownlinkFrequency; + } + + public String getSatelliteBeaconFrequency() { + return satelliteBeaconFrequency; + } + + public void setSatelliteBeaconFrequency(String satelliteBeaconFrequency) { + this.satelliteBeaconFrequency = satelliteBeaconFrequency; + } + + public String getSatelliteBeaconMode() { + return satelliteBeaconMode; + } + + public void setSatelliteBeaconMode(String satelliteBeaconMode) { + this.satelliteBeaconMode = satelliteBeaconMode; + } + + public String getSatellitebeaconCallsign() { + return satellitebeaconCallsign; + } + + public void setSatellitebeaconCallsign(String satellitebeaconCallsign) { + this.satellitebeaconCallsign = satellitebeaconCallsign; + } + + public String getReports() { + return reports; + } + + public void setReports(String reports) { + this.reports = reports; + } + + public String getInfo() { + return info; + } + + public void setInfo(String info) { + this.info = info; + } + + public String getTelemetryDecode() { + return TelemetryDecode; + } + + public void setTelemetryDecode(String telemetryDecode) { + TelemetryDecode = telemetryDecode; + } + + public boolean isIARUCoordination() { + return IARUCoordination; + } + + public void setIARUCoordination(boolean iARUCoordination) { + IARUCoordination = iARUCoordination; + } } diff --git a/ModuleSatelliteDatabase/src/main/java/org/josast/ModuleSatelliteDatabase/FlatSatelliteImp.java b/ModuleSatelliteDatabase/src/main/java/org/josast/ModuleSatelliteDatabase/FlatSatelliteImp.java index 0e1ae13ba2549b1e7b35da2c8f552c74a58565d0..ebc1cc04b15a21b8295f3895c4be80ae3d1d5e4d 100644 --- a/ModuleSatelliteDatabase/src/main/java/org/josast/ModuleSatelliteDatabase/FlatSatelliteImp.java +++ b/ModuleSatelliteDatabase/src/main/java/org/josast/ModuleSatelliteDatabase/FlatSatelliteImp.java @@ -1,19 +1,11 @@ -/** - * - */ +/** */ package org.josast.ModuleSatelliteDatabase; -/** - * @author chris - * - */ +/** @author chris */ public class FlatSatelliteImp extends FlatSatellite { - /** - * - */ - public FlatSatelliteImp() { - // TODO Auto-generated constructor stub - } - + /** */ + public FlatSatelliteImp() { + // TODO Auto-generated constructor stub + } } diff --git a/ModuleSatelliteDatabase/src/main/java/org/josast/ModuleSatelliteDatabase/MergeAmsatListFile.java b/ModuleSatelliteDatabase/src/main/java/org/josast/ModuleSatelliteDatabase/MergeAmsatListFile.java index d961414c521682e76990055bc5f4758be4c5ffcc..f6544150834e34c86ca6a7ed9ce6237eaa81d1ba 100644 --- a/ModuleSatelliteDatabase/src/main/java/org/josast/ModuleSatelliteDatabase/MergeAmsatListFile.java +++ b/ModuleSatelliteDatabase/src/main/java/org/josast/ModuleSatelliteDatabase/MergeAmsatListFile.java @@ -1,164 +1,143 @@ package org.josast.ModuleSatelliteDatabase; +import jakarta.xml.bind.JAXBContext; +import jakarta.xml.bind.JAXBException; +import jakarta.xml.bind.Marshaller; +import jakarta.xml.bind.PropertyException; +import jakarta.xml.bind.Unmarshaller; import java.io.File; import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.util.List; import java.util.ListIterator; import java.util.logging.Logger; - -//import javax.xml.bind.JAXBContext; -//import javax.xml.bind.JAXBException; -//import javax.xml.bind.Marshaller; -//import javax.xml.bind.PropertyException; -//import javax.xml.bind.Unmarshaller; - import org.josast.AmsatList.generated.AmsatList; import org.josast.AmsatList.generated.ObjectFactory; import org.josast.AmsatList.generated.Satellites; -import jakarta.xml.bind.JAXBContext; -import jakarta.xml.bind.JAXBException; -import jakarta.xml.bind.Marshaller; -import jakarta.xml.bind.PropertyException; -import jakarta.xml.bind.Unmarshaller; - public class MergeAmsatListFile { - /** - * logger. - */ - private Logger log = Logger.getLogger(getClass().getName()); - /** - * Liste of satellite. - */ - private AmsatList amsatList = null; - /** - * Liste of satellite. - */ - private List liste = null; - - /** - * create a new Amsat List structure in memory. - */ - public MergeAmsatListFile() { - ObjectFactory of = new ObjectFactory(); - amsatList = of.createAmsatList(); - liste = amsatList.getSatellites(); + /** logger. */ + private Logger log = Logger.getLogger(getClass().getName()); + /** Liste of satellite. */ + private AmsatList amsatList = null; + /** Liste of satellite. */ + private List liste = null; + + /** create a new Amsat List structure in memory. */ + public MergeAmsatListFile() { + ObjectFactory of = new ObjectFactory(); + amsatList = of.createAmsatList(); + liste = amsatList.getSatellites(); + } + + /** + * Save file. + * + * @param fichOutSring + */ + public void save(final String fichOutSring) { + File fichOut = new File(fichOutSring); + String path = "org.josast.AmsatList.generated"; + JAXBContext jc = null; + try { + jc = JAXBContext.newInstance(path); + } catch (JAXBException e) { + log.severe("path not found : " + path); + // e.printStackTrace(); } - - /** - * Save file. - * @param fichOutSring - */ - public void save(final String fichOutSring) { - File fichOut = new File(fichOutSring); - String path = "org.josast.AmsatList.generated"; - JAXBContext jc = null; - try { - jc = JAXBContext.newInstance(path); - } catch (JAXBException e) { - log.severe("path not found : " + path); - // e.printStackTrace(); - } - Marshaller mrs = null; - try { - mrs = jc.createMarshaller(); - } catch (JAXBException e) { - log.severe("Marshaller creation faile"); - // e.printStackTrace(); - } - try { - mrs.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE); - } catch (PropertyException e) { - log.severe("Marshaller property exception"); - // e.printStackTrace(); - } // indenter - - try { - mrs.marshal(amsatList, new FileOutputStream(fichOut)); - } catch (FileNotFoundException e) { - log.severe("File not found exeption"); - - } catch (JAXBException e) { - log.severe(e.toString()); - - } + Marshaller mrs = null; + try { + mrs = jc.createMarshaller(); + } catch (JAXBException e) { + log.severe("Marshaller creation faile"); + // e.printStackTrace(); } + try { + mrs.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE); + } catch (PropertyException e) { + log.severe("Marshaller property exception"); + // e.printStackTrace(); + } // indenter + + try { + mrs.marshal(amsatList, new FileOutputStream(fichOut)); + } catch (FileNotFoundException e) { + log.severe("File not found exeption"); + + } catch (JAXBException e) { + log.severe(e.toString()); + } + } - /** - * add data from file in memory (list). - * @param filein input file. - */ - public void appendSatellites(final File filein) { - log.info("Add file : " + filein.getName()); - JAXBContext jaxbContext = null; - - try { - jaxbContext = JAXBContext - .newInstance("org.josast.AmsatList.generated"); - - } catch (JAXBException e) { + /** + * add data from file in memory (list). + * + * @param filein input file. + */ + public void appendSatellites(final File filein) { + log.info("Add file : " + filein.getName()); + JAXBContext jaxbContext = null; - log.severe("JAXBException " + e.toString()); - } + try { + jaxbContext = JAXBContext.newInstance("org.josast.AmsatList.generated"); - Unmarshaller unmarshaller = null; - try { - unmarshaller = jaxbContext.createUnmarshaller(); - } catch (JAXBException e) { - log.severe("JAXBException " + e.toString()); - // e.printStackTrace(); - } + } catch (JAXBException e) { - AmsatList amsatliste = null; - try { - amsatliste = (AmsatList) unmarshaller.unmarshal(filein); - } catch (JAXBException e) { - log.severe("JAXBException " + e.toString()); - // e.printStackTrace(); - } + log.severe("JAXBException " + e.toString()); + } - // TODO revoir comment gérer l'append dans la liste + Unmarshaller unmarshaller = null; + try { + unmarshaller = jaxbContext.createUnmarshaller(); + } catch (JAXBException e) { + log.severe("JAXBException " + e.toString()); + // e.printStackTrace(); + } - List listSatellite = amsatliste.getSatellites(); + AmsatList amsatliste = null; + try { + amsatliste = (AmsatList) unmarshaller.unmarshal(filein); + } catch (JAXBException e) { + log.severe("JAXBException " + e.toString()); + // e.printStackTrace(); + } - ListIterator it = listSatellite.listIterator(); + // TODO revoir comment gérer l'append dans la liste - while (it.hasNext()) { - Satellites sat = it.next(); - liste.add(sat); - log.info("satellite ajouté :" + sat.getName()); + List listSatellite = amsatliste.getSatellites(); - } + ListIterator it = listSatellite.listIterator(); + while (it.hasNext()) { + Satellites sat = it.next(); + liste.add(sat); + log.info("satellite ajouté :" + sat.getName()); } - - /** - * @param repository - * @return number of satellite. - */ - - public int merge(final String repository) { - File repertoire = new File(repository); - int i = 0; - if (!repertoire.isDirectory()) { - log.severe(repository + "is not a repository"); - return -1; - } - File[] inputsfiles = repertoire.listFiles(); - if (inputsfiles == null) { - log.severe(repository + "Repository empty"); - return -1; - } else { - for (i = 0; i < inputsfiles.length; i++) { - appendSatellites(inputsfiles[i]); - } - } - log.info("Nb Satellite" + i); - - return i; - + } + + /** + * @param repository + * @return number of satellite. + */ + public int merge(final String repository) { + File repertoire = new File(repository); + int i = 0; + if (!repertoire.isDirectory()) { + log.severe(repository + "is not a repository"); + return -1; + } + File[] inputsfiles = repertoire.listFiles(); + if (inputsfiles == null) { + log.severe(repository + "Repository empty"); + return -1; + } else { + for (i = 0; i < inputsfiles.length; i++) { + appendSatellites(inputsfiles[i]); + } } + log.info("Nb Satellite" + i); + return i; + } } diff --git a/ModuleSatelliteDatabase/src/main/java/org/josast/ModuleSatelliteDatabase/UpdateAmsatListFile.java b/ModuleSatelliteDatabase/src/main/java/org/josast/ModuleSatelliteDatabase/UpdateAmsatListFile.java index 713501b47ec7685759368b2e317c55701bf3b540..3433149b902078dc5999cb52fe313b0d6f92e538 100644 --- a/ModuleSatelliteDatabase/src/main/java/org/josast/ModuleSatelliteDatabase/UpdateAmsatListFile.java +++ b/ModuleSatelliteDatabase/src/main/java/org/josast/ModuleSatelliteDatabase/UpdateAmsatListFile.java @@ -6,187 +6,175 @@ import java.util.Hashtable; import java.util.List; import java.util.ListIterator; import java.util.Vector; - import org.josast.AmsatList.Commande.Commande; import org.josast.AmsatList.generated.AmsatList; import org.josast.AmsatList.generated.Satellites; public class UpdateAmsatListFile { - - private Hashtable amsatListStatus = - new Hashtable<>(); - /** - * - */ - private AmsatList al; - /** - * - */ - private AmsatListFile alf = null; - - /** - * @param filein - */ - @Deprecated - public UpdateAmsatListFile(final String filein) { - alf = new AmsatListFile(); - al = alf.openAmsatList(filein); - amsatListStatusSetup(); - } - public UpdateAmsatListFile() { - - amsatListStatusSetup(); - } - private void amsatListStatusSetup() { - - // init table status - - amsatListStatus.put("decayed", "Decayed"); - amsatListStatus.put("Decayed", "Decayed"); - amsatListStatus.put("Deep Space", "Deep Space"); - amsatListStatus.put("Deep space", "Deep Space"); - amsatListStatus.put("Fail", "Failed"); - amsatListStatus.put("Failed", "Failed"); - amsatListStatus.put("Launch", "Launch"); - amsatListStatus.put("No operational", "Not operational"); - amsatListStatus.put("No operational", "Not operational"); - amsatListStatus.put("Not amateur Satellite", "Not amateur satellite"); - amsatListStatus.put("Unknown", "Unknown"); - amsatListStatus.put("Not operational", "Not operational"); - amsatListStatus.put("Not Operational", "Not operational"); - amsatListStatus.put("Operational", "Operational"); - amsatListStatus.put("Operationnal", "Operational"); - amsatListStatus.put("To be deployed", "To be deployed"); - amsatListStatus.put("To Be Laucnh", "To be launch"); - amsatListStatus.put("To Be Launch", "To be launch"); - amsatListStatus.put("To be launched", "To be launch"); - amsatListStatus.put("To be Launched", "To be launch"); - amsatListStatus.put("unknown", "Unknown"); - amsatListStatus.put("Unknown", "Unknown"); - } - - /** - * @param filename - */ - @Deprecated - public void saveUpdateFile(final String filename) { - alf.save(filename, al); + private Hashtable amsatListStatus = new Hashtable<>(); + /** */ + private AmsatList al; + /** */ + private AmsatListFile alf = null; + + /** @param filein */ + @Deprecated + public UpdateAmsatListFile(final String filein) { + alf = new AmsatListFile(); + al = alf.openAmsatList(filein); + amsatListStatusSetup(); + } + + public UpdateAmsatListFile() { + + amsatListStatusSetup(); + } + + private void amsatListStatusSetup() { + + // init table status + + amsatListStatus.put("decayed", "Decayed"); + amsatListStatus.put("Decayed", "Decayed"); + amsatListStatus.put("Deep Space", "Deep Space"); + amsatListStatus.put("Deep space", "Deep Space"); + amsatListStatus.put("Fail", "Failed"); + amsatListStatus.put("Failed", "Failed"); + amsatListStatus.put("Launch", "Launch"); + amsatListStatus.put("No operational", "Not operational"); + amsatListStatus.put("No operational", "Not operational"); + amsatListStatus.put("Not amateur Satellite", "Not amateur satellite"); + amsatListStatus.put("Unknown", "Unknown"); + amsatListStatus.put("Not operational", "Not operational"); + amsatListStatus.put("Not Operational", "Not operational"); + amsatListStatus.put("Operational", "Operational"); + amsatListStatus.put("Operationnal", "Operational"); + amsatListStatus.put("To be deployed", "To be deployed"); + amsatListStatus.put("To Be Laucnh", "To be launch"); + amsatListStatus.put("To Be Launch", "To be launch"); + amsatListStatus.put("To be launched", "To be launch"); + amsatListStatus.put("To be Launched", "To be launch"); + amsatListStatus.put("unknown", "Unknown"); + amsatListStatus.put("Unknown", "Unknown"); + } + + /** @param filename */ + @Deprecated + public void saveUpdateFile(final String filename) { + alf.save(filename, al); + } + + /** */ + @Deprecated + public void updateStatus() { + + // init table status + + amsatListStatus.put("decayed", "Decayed"); + amsatListStatus.put("Decayed", "Decayed"); + amsatListStatus.put("Deep Space", "Deep Space"); + amsatListStatus.put("Deep space", "Deep Space"); + amsatListStatus.put("Fail", "Failed"); + amsatListStatus.put("Failed", "Failed"); + amsatListStatus.put("Launch", "Launch"); + amsatListStatus.put("No operational", "Not operational"); + amsatListStatus.put("No operational", "Not operational"); + amsatListStatus.put("Not amateur Satellite", "Not amateur satellite"); + amsatListStatus.put("Unknown", "Unknown"); + amsatListStatus.put("Not operational", "Not operational"); + amsatListStatus.put("Not Operational", "Not operational"); + amsatListStatus.put("Operational", "Operational"); + amsatListStatus.put("Operationnal", "Operational"); + amsatListStatus.put("To be deployed", "To be deployed"); + amsatListStatus.put("To Be Laucnh", "To be launch"); + amsatListStatus.put("To Be Launch", "To be launch"); + amsatListStatus.put("To be launched", "To be launch"); + amsatListStatus.put("To be Launched", "To be launch"); + amsatListStatus.put("unknown", "Unknown"); + amsatListStatus.put("Unknown", "Unknown"); + + List listSatellite = al.getSatellites(); + + ListIterator it = listSatellite.listIterator(); + while (it.hasNext()) { + Satellites sat = it.next(); + String status = sat.getStatus(); + System.out.println(sat.getName() + " " + status + " : "); + if (status == null) { + sat.setStatus("Unknown"); + System.out.println(" add status to :" + sat.getStatus()); + + } else { + status = status.trim(); + + if (amsatListStatus.containsKey(status)) { + String refstatus = amsatListStatus.get(status); + + if (refstatus.compareTo(status) != 0) { + sat.setStatus(refstatus); + System.out.println("Status change :" + status + "to" + refstatus); + } + } else { + sat.setStatus("Unknown"); + System.out.println("add status to :" + sat.getStatus()); + } + } } - - /** - * - */ - @Deprecated - public void updateStatus() { - - - - // init table status - - amsatListStatus.put("decayed", "Decayed"); - amsatListStatus.put("Decayed", "Decayed"); - amsatListStatus.put("Deep Space", "Deep Space"); - amsatListStatus.put("Deep space", "Deep Space"); - amsatListStatus.put("Fail", "Failed"); - amsatListStatus.put("Failed", "Failed"); - amsatListStatus.put("Launch", "Launch"); - amsatListStatus.put("No operational", "Not operational"); - amsatListStatus.put("No operational", "Not operational"); - amsatListStatus.put("Not amateur Satellite", "Not amateur satellite"); - amsatListStatus.put("Unknown", "Unknown"); - amsatListStatus.put("Not operational", "Not operational"); - amsatListStatus.put("Not Operational", "Not operational"); - amsatListStatus.put("Operational", "Operational"); - amsatListStatus.put("Operationnal", "Operational"); - amsatListStatus.put("To be deployed", "To be deployed"); - amsatListStatus.put("To Be Laucnh", "To be launch"); - amsatListStatus.put("To Be Launch", "To be launch"); - amsatListStatus.put("To be launched", "To be launch"); - amsatListStatus.put("To be Launched", "To be launch"); - amsatListStatus.put("unknown", "Unknown"); - amsatListStatus.put("Unknown", "Unknown"); - - List listSatellite = al.getSatellites(); - - ListIterator it = listSatellite.listIterator(); - while (it.hasNext()) { - Satellites sat = it.next(); - String status = sat.getStatus(); - System.out.println(sat.getName() + " " + status +" : "); - if (status == null) { - sat.setStatus("Unknown"); - System.out.println(" add status to :" + sat.getStatus()); - - } else { - status = status.trim(); - - if (amsatListStatus.containsKey(status)) { - String refstatus = amsatListStatus.get(status); - - if (refstatus.compareTo(status) != 0) { - sat.setStatus(refstatus); - System.out.println( - "Status change :" + status + "to" + refstatus); - } - } else { - sat.setStatus("Unknown"); - System.out.println( - "add status to :" + sat.getStatus()); - } - - } - + } + + public Vector checksatelliteStatus(FlatSatList ref) { + Vector listeCommande = new Vector<>(); + + Enumeration idSat = ref.keys(); + while (idSat.hasMoreElements()) { + BigInteger key = idSat.nextElement(); + FlatSatellite flatSatelliteRef = ref.get(key); + String status = flatSatelliteRef.getSatelliteStatus(); + + if (status == null) { + + Commande cmd = + new Commande( + flatSatelliteRef.getSatelliteName(), + flatSatelliteRef.getSatelliteNoradId(), + Commande.SatelliteStatusUpdate, + "null", + "Unknown", + "Set status to Unknown"); + listeCommande.add(cmd); + + } else { + status = status.trim(); + if (amsatListStatus.containsKey(status)) { + String refstatus = amsatListStatus.get(status); + + if (refstatus.compareTo(status) != 0) { + + Commande cmd = + new Commande( + flatSatelliteRef.getSatelliteName(), + flatSatelliteRef.getSatelliteNoradId(), + Commande.SatelliteStatusUpdate, + status, + refstatus, + "Status change :" + status + "to" + refstatus); + listeCommande.add(cmd); + } + } else { + Commande cmd = + new Commande( + flatSatelliteRef.getSatelliteName(), + flatSatelliteRef.getSatelliteNoradId(), + Commande.SatelliteStatusUpdate, + status, + "Unknown", + "Status change :" + status + "to" + "Unknown"); + listeCommande.add(cmd); } - + } } - - public Vector checksatelliteStatus(FlatSatList ref) { - Vector listeCommande = new Vector<>(); - - Enumeration idSat = ref.keys(); - while (idSat.hasMoreElements()) { - BigInteger key = idSat.nextElement(); - FlatSatellite flatSatelliteRef = ref.get(key); - String status = flatSatelliteRef.getSatelliteStatus(); - - if (status == null) { - - Commande cmd = new Commande(flatSatelliteRef.getSatelliteName(), - flatSatelliteRef.getSatelliteNoradId(), - Commande.SatelliteStatusUpdate, "null", "Unknown" , - "Set status to Unknown"); - listeCommande.add(cmd); - - } else { - status = status.trim(); - if (amsatListStatus.containsKey(status)) { - String refstatus = amsatListStatus.get(status); - - if (refstatus.compareTo(status) != 0) { - - Commande cmd = new Commande - (flatSatelliteRef.getSatelliteName(), - flatSatelliteRef.getSatelliteNoradId(), - Commande.SatelliteStatusUpdate, - status, refstatus , "Status change :" - + status + "to" + refstatus); - listeCommande.add(cmd); - } - } else { - Commande cmd = - new Commande(flatSatelliteRef.getSatelliteName(), - flatSatelliteRef.getSatelliteNoradId(), - Commande.SatelliteStatusUpdate, status, "Unknown" - , "Status change :" + status + "to" + "Unknown"); - listeCommande.add(cmd); - } - } - - } - - return listeCommande; - } - + return listeCommande; + } } diff --git a/ModuleSatelliteDatabase/src/main/java/org/josast/util/files/ManageFolder.java b/ModuleSatelliteDatabase/src/main/java/org/josast/util/files/ManageFolder.java index e9b4b6b6e898469b44c5c0a81d7fcd84a0e4eb65..b6aee3b78b6da5a8f227372e6b877fefd1892a4e 100644 --- a/ModuleSatelliteDatabase/src/main/java/org/josast/util/files/ManageFolder.java +++ b/ModuleSatelliteDatabase/src/main/java/org/josast/util/files/ManageFolder.java @@ -7,67 +7,55 @@ import java.nio.file.Paths; import java.util.logging.Level; import java.util.logging.Logger; -//TODO : mettre dans le module util +// TODO : mettre dans le module util public class ManageFolder { - private static Logger appLogger = Logger.getLogger("AmsatLogger"); - private String RepositoryPath = null; - - - private String defaultrepository = "data"; - - public ManageFolder() { - RepositoryPath = System.getProperty("user.dir") + - "\\" + defaultrepository; - } - - public ManageFolder(String path) { - - if (path == null) { - RepositoryPath = System.getProperty("user.dir") + - "\\" + defaultrepository; - - } else if (path.length() == 0) { - RepositoryPath = System.getProperty("user.dir") + - "\\+defaultrepository"; - } else { - RepositoryPath = System.getProperty("user.dir") + "\\" + path; - } - createdDirectories(); - } - - /** - * @return the repositoryPath - */ - public String getRepositoryPath() { - return RepositoryPath; - } - - /** - * @param repositoryPath the repositoryPath to set - */ - public void setRepositoryPath(String repositoryPath) { - RepositoryPath = repositoryPath; - } - - public void createdDirectories() { - - Path path = Paths.get(RepositoryPath); - // if directory exists? - if (!Files.exists(path)) { - try { - Files.createDirectories(path); - appLogger.info("directory created : " + RepositoryPath); - } catch (IOException e) { - appLogger.log(Level.SEVERE, "cannot create outpout directorie " - + e.toString()); - } - } else - { - appLogger.info("directory already exist : " + RepositoryPath); - } - - } - + private static Logger appLogger = Logger.getLogger("AmsatLogger"); + private String RepositoryPath = null; + + private String defaultrepository = "data"; + + public ManageFolder() { + RepositoryPath = System.getProperty("user.dir") + "\\" + defaultrepository; + } + + public ManageFolder(String path) { + + if (path == null) { + RepositoryPath = System.getProperty("user.dir") + "\\" + defaultrepository; + + } else if (path.length() == 0) { + RepositoryPath = System.getProperty("user.dir") + "\\+defaultrepository"; + } else { + RepositoryPath = System.getProperty("user.dir") + "\\" + path; + } + createdDirectories(); + } + + /** @return the repositoryPath */ + public String getRepositoryPath() { + return RepositoryPath; + } + + /** @param repositoryPath the repositoryPath to set */ + public void setRepositoryPath(String repositoryPath) { + RepositoryPath = repositoryPath; + } + + public void createdDirectories() { + + Path path = Paths.get(RepositoryPath); + // if directory exists? + if (!Files.exists(path)) { + try { + Files.createDirectories(path); + appLogger.info("directory created : " + RepositoryPath); + } catch (IOException e) { + appLogger.log(Level.SEVERE, "cannot create outpout directorie " + e.toString()); + } + } else { + appLogger.info("directory already exist : " + RepositoryPath); + } + } } diff --git a/ModuleSatelliteDatabase/src/test/java/org/josast/AmsatList/Commande/executeCommandeTest.java b/ModuleSatelliteDatabase/src/test/java/org/josast/AmsatList/Commande/executeCommandeTest.java index 657b469cca64fa36ecc24130e94f3bf40ccecd53..d06767c9494e7c11a9b26375ee942cc42c253b0e 100644 --- a/ModuleSatelliteDatabase/src/test/java/org/josast/AmsatList/Commande/executeCommandeTest.java +++ b/ModuleSatelliteDatabase/src/test/java/org/josast/AmsatList/Commande/executeCommandeTest.java @@ -10,39 +10,30 @@ import org.junit.Test; public class executeCommandeTest { - @BeforeClass - public static void setUpBeforeClass() throws Exception { - } + @BeforeClass + public static void setUpBeforeClass() throws Exception {} - @AfterClass - public static void tearDownAfterClass() throws Exception { - } + @AfterClass + public static void tearDownAfterClass() throws Exception {} - @Before - public void setUp() throws Exception { - } + @Before + public void setUp() throws Exception {} - @After - public void tearDown() throws Exception { - } - - @Test - public void testExecute() { - - String filecmd2 = "src\\test\\data\\FileIn\\StatusSatelliteCmdcommandeSave.csv"; - String inputDirectory = "src/test/data/in"; - String outputDirectory = "src/test/data/out"; -// - CommandeList cl = new CommandeList(filecmd2); - System.out.println(cl.getListeCommande().size()); - ExecuteCommand ex = new ExecuteCommand(); - ex.execute(inputDirectory, outputDirectory, cl); - - - - assertTrue( true ); - } + @After + public void tearDown() throws Exception {} + @Test + public void testExecute() { + String filecmd2 = "src\\test\\data\\FileIn\\StatusSatelliteCmdcommandeSave.csv"; + String inputDirectory = "src/test/data/in"; + String outputDirectory = "src/test/data/out"; + // + CommandeList cl = new CommandeList(filecmd2); + System.out.println(cl.getListeCommande().size()); + ExecuteCommand ex = new ExecuteCommand(); + ex.execute(inputDirectory, outputDirectory, cl); + assertTrue(true); + } } diff --git a/ModuleSatelliteDatabase/src/test/java/org/josast/AmsatList/api/AmsatListRequestTest.java b/ModuleSatelliteDatabase/src/test/java/org/josast/AmsatList/api/AmsatListRequestTest.java index aa4f92831cb35e8f2ac2b79aeb99ce28a0dab84b..4b91f660a44ce8d295dac01566ee868d15ea8c31 100644 --- a/ModuleSatelliteDatabase/src/test/java/org/josast/AmsatList/api/AmsatListRequestTest.java +++ b/ModuleSatelliteDatabase/src/test/java/org/josast/AmsatList/api/AmsatListRequestTest.java @@ -1,11 +1,8 @@ -/** - * - */ +/** */ package org.josast.AmsatList.api; import java.util.Hashtable; import java.util.Vector; - import org.josast.AmsatList.generated.Satellites; import org.junit.After; import org.junit.AfterClass; @@ -14,102 +11,87 @@ import org.junit.Before; import org.junit.BeforeClass; import org.junit.Test; -/** - * @author chris - * - */ +/** @author chris */ public class AmsatListRequestTest { - /** - * @throws java.lang.Exception - */ - @BeforeClass - public static void setUpBeforeClass() throws Exception { - } - - /** - * @throws java.lang.Exception - */ - @AfterClass - public static void tearDownAfterClass() throws Exception { - } - - private AmsatListRequest amr = null; - - /** - * @throws java.lang.Exception - */ - @Before - public void setUp() throws Exception { - // charge le fichier - // amr = new AmsatListRequest("D:\\AmsatLists.xml"); - amr = new AmsatListRequest("src\\test\\data\\FileIn\\AmsatList.xml"); - } - - /** - * @throws java.lang.Exception - */ - @After - public void tearDown() throws Exception { - } - - /** - * Test method for {@link org.josast.AmsatList.api.AmsatListRequestOld#getNumberOfSatellite()}. - */ - @Test - public void testGetNumberOfSatellite() { - - Assert.assertNotEquals("Nb Satellite", 0, amr.getNumberOfSatellite()); - Assert.assertEquals("Nexus", amr.getSatelliteByName("Nexus").getName() ); - Assert.assertEquals(null, amr.getSatelliteByName("toto")); - System.out.println(" TEST JOSON"); - amr.getSatellitesData() ; - System.out.println(amr.getSatelliteByNameBeacon("Nexus")); - System.out.println(amr.getSatelliteByNameBeacon("ISS")); - System.out.println(amr.getSatelliteByNameBeacon("OrigamiSat-1")); - - } - - /** - * Test method for {@link org.josast.AmsatList.api.AmsatListRequestOld#getBeaconFrequencies()}. - */ - @Test - public void testGetBeaconFrequencies() { - - Hashtable> AMSATFreqBeacon = amr.getBeaconFrequencies(); - Assert.assertNotEquals(0,AMSATFreqBeacon.size()); - System.out.println("Liste Frequence : " + amr.getStringHastableFrequence(AMSATFreqBeacon)); - amr.getSatellitesWithFrequency(437075000); - amr.getSatellitesWithFrequencyrange (437000000, 437076000); - - - // test Stream - - - } - - /** - * Test method for {@link org.josast.AmsatList.api.AmsatListRequestOld#getSatellitesBeacons(java.lang.Long)}. - */ - @Test - public void testGetSatellitesBeacons() { -// fail("Not yet implemented"); - } - - /** - * Test method for {@link org.josast.AmsatList.api.AmsatListRequestOld#getStringHastableFrequence(java.util.Hashtable)}. - */ - @Test - public void testGetStringHastableFrequence() { -// fail("Not yet implemented"); - } - - /** - * Test method for {@link org.josast.AmsatList.api.AmsatListRequestOld#getStringSatellite(java.util.Vector)}. - */ - @Test - public void testGetStringSatellite() { -// fail("Not yet implemented"); - } + /** @throws java.lang.Exception */ + @BeforeClass + public static void setUpBeforeClass() throws Exception {} + + /** @throws java.lang.Exception */ + @AfterClass + public static void tearDownAfterClass() throws Exception {} + + private AmsatListRequest amr = null; + + /** @throws java.lang.Exception */ + @Before + public void setUp() throws Exception { + // charge le fichier + // amr = new AmsatListRequest("D:\\AmsatLists.xml"); + amr = new AmsatListRequest("src\\test\\data\\FileIn\\AmsatList.xml"); + } + + /** @throws java.lang.Exception */ + @After + public void tearDown() throws Exception {} + + /** + * Test method for {@link org.josast.AmsatList.api.AmsatListRequestOld#getNumberOfSatellite()}. + */ + @Test + public void testGetNumberOfSatellite() { + + Assert.assertNotEquals("Nb Satellite", 0, amr.getNumberOfSatellite()); + Assert.assertEquals("Nexus", amr.getSatelliteByName("Nexus").getName()); + Assert.assertEquals(null, amr.getSatelliteByName("toto")); + System.out.println(" TEST JOSON"); + amr.getSatellitesData(); + System.out.println(amr.getSatelliteByNameBeacon("Nexus")); + System.out.println(amr.getSatelliteByNameBeacon("ISS")); + System.out.println(amr.getSatelliteByNameBeacon("OrigamiSat-1")); + } + + /** + * Test method for {@link org.josast.AmsatList.api.AmsatListRequestOld#getBeaconFrequencies()}. + */ + @Test + public void testGetBeaconFrequencies() { + + Hashtable> AMSATFreqBeacon = amr.getBeaconFrequencies(); + Assert.assertNotEquals(0, AMSATFreqBeacon.size()); + System.out.println("Liste Frequence : " + amr.getStringHastableFrequence(AMSATFreqBeacon)); + amr.getSatellitesWithFrequency(437075000); + amr.getSatellitesWithFrequencyrange(437000000, 437076000); + + // test Stream + + } + + /** + * Test method for {@link + * org.josast.AmsatList.api.AmsatListRequestOld#getSatellitesBeacons(java.lang.Long)}. + */ + @Test + public void testGetSatellitesBeacons() { + // fail("Not yet implemented"); + } + + /** + * Test method for {@link + * org.josast.AmsatList.api.AmsatListRequestOld#getStringHastableFrequence(java.util.Hashtable)}. + */ + @Test + public void testGetStringHastableFrequence() { + // fail("Not yet implemented"); + } + /** + * Test method for {@link + * org.josast.AmsatList.api.AmsatListRequestOld#getStringSatellite(java.util.Vector)}. + */ + @Test + public void testGetStringSatellite() { + // fail("Not yet implemented"); + } } diff --git a/ModuleSatelliteDatabase/src/test/java/org/josast/AmsatList/source/SimplifiedDK3WMTest.java b/ModuleSatelliteDatabase/src/test/java/org/josast/AmsatList/source/SimplifiedDK3WMTest.java index 1e5b01dfdae02c78e26975e1b1505f8658215565..78536a49ceff1d04d45adb572b836b02c3caaa03 100644 --- a/ModuleSatelliteDatabase/src/test/java/org/josast/AmsatList/source/SimplifiedDK3WMTest.java +++ b/ModuleSatelliteDatabase/src/test/java/org/josast/AmsatList/source/SimplifiedDK3WMTest.java @@ -9,21 +9,18 @@ import org.junit.Test; public class SimplifiedDK3WMTest { - @Before - public void setUp() throws Exception { - } + @Before + public void setUp() throws Exception {} - @After - public void tearDown() throws Exception { - } + @After + public void tearDown() throws Exception {} - @Test - public void testSimplifiedDK3WM() { - String file = "src\\test\\data\\DK3WN\\Extract.csv"; - SimplifiedDK3WM sDK3WN = new SimplifiedDK3WM(file); - FlatSatList fl = sDK3WN.getFsatLits(); - - //fail("Not yet implemented"); - } + @Test + public void testSimplifiedDK3WM() { + String file = "src\\test\\data\\DK3WN\\Extract.csv"; + SimplifiedDK3WM sDK3WN = new SimplifiedDK3WM(file); + FlatSatList fl = sDK3WN.getFsatLits(); + // fail("Not yet implemented"); + } } diff --git a/ModuleSatelliteDatabase/src/test/java/org/josast/AmsatList/source/SimplifiedJ9PLTest.java b/ModuleSatelliteDatabase/src/test/java/org/josast/AmsatList/source/SimplifiedJ9PLTest.java index e59f47f5174a08e3da630218305b0bce83576c3f..8686b4660dce08c221b714802fcc2bdcf6dfcd2f 100644 --- a/ModuleSatelliteDatabase/src/test/java/org/josast/AmsatList/source/SimplifiedJ9PLTest.java +++ b/ModuleSatelliteDatabase/src/test/java/org/josast/AmsatList/source/SimplifiedJ9PLTest.java @@ -9,23 +9,20 @@ import org.junit.Test; public class SimplifiedJ9PLTest { - @Before - public void setUp() throws Exception { - } - - @After - public void tearDown() throws Exception { - } - - @Test - public void test() { - - String file = "src\\test\\data\\J9EPL\\satslist.csv"; - SimplifiedJ9PL sDK3WN = new SimplifiedJ9PL(file); - FlatSatList fl = sDK3WN.getFsatLits(); - System.out.println("taille liste" + fl.size()); - - //fail("Not yet implemented"); - } + @Before + public void setUp() throws Exception {} + @After + public void tearDown() throws Exception {} + + @Test + public void test() { + + String file = "src\\test\\data\\J9EPL\\satslist.csv"; + SimplifiedJ9PL sDK3WN = new SimplifiedJ9PL(file); + FlatSatList fl = sDK3WN.getFsatLits(); + System.out.println("taille liste" + fl.size()); + + // fail("Not yet implemented"); + } } diff --git a/ModuleSatelliteDatabase/src/test/java/org/josast/AmsatList/source/SimplifiedN2YOTest.java b/ModuleSatelliteDatabase/src/test/java/org/josast/AmsatList/source/SimplifiedN2YOTest.java index 933e57e0bf5976722b095a4955567a13b3b57239..c69806383849372448e4135e9e59bd8aafb5458d 100644 --- a/ModuleSatelliteDatabase/src/test/java/org/josast/AmsatList/source/SimplifiedN2YOTest.java +++ b/ModuleSatelliteDatabase/src/test/java/org/josast/AmsatList/source/SimplifiedN2YOTest.java @@ -9,21 +9,18 @@ import org.junit.Test; public class SimplifiedN2YOTest { - @Before - public void setUp() throws Exception { - } + @Before + public void setUp() throws Exception {} - @After - public void tearDown() throws Exception { - } + @After + public void tearDown() throws Exception {} - @Test - public void testSimplifiedN2YO() { - - String file = "src\\test\\data\\DK3WN\\N2YO.csv"; - SimplifiedN2YO sN2YO = new SimplifiedN2YO(file); - FlatSatList fl = sN2YO.getFsatLits(); - // fail("Not yet implemented"); - } + @Test + public void testSimplifiedN2YO() { + String file = "src\\test\\data\\DK3WN\\N2YO.csv"; + SimplifiedN2YO sN2YO = new SimplifiedN2YO(file); + FlatSatList fl = sN2YO.getFsatLits(); + // fail("Not yet implemented"); + } } diff --git a/ModuleSatelliteDatabase/src/test/java/org/josast/AmsatList/source/gcat/LaunchCatTsvFileTest.java b/ModuleSatelliteDatabase/src/test/java/org/josast/AmsatList/source/gcat/LaunchCatTsvFileTest.java index 54cb4db833ead6ddd250f833edcb28cf3252fb3e..70bdbe77c7eb1d959b0565d77dd3eee8938a95f0 100644 --- a/ModuleSatelliteDatabase/src/test/java/org/josast/AmsatList/source/gcat/LaunchCatTsvFileTest.java +++ b/ModuleSatelliteDatabase/src/test/java/org/josast/AmsatList/source/gcat/LaunchCatTsvFileTest.java @@ -2,45 +2,40 @@ package org.josast.AmsatList.source.gcat; import static org.junit.Assert.*; -import java.math.BigInteger; import java.util.Hashtable; - import org.junit.After; import org.junit.Assume; import org.junit.Before; import org.junit.Test; public class LaunchCatTsvFileTest { - - LaunchCatTsvFile lcFile ; - String SatcatFile ="src\\test\\data\\GSat\\launch2.tsv"; - - @Before - public void setUp() throws Exception { - System.out.println("test launch"); - lcFile = new LaunchCatTsvFile (SatcatFile ); - System.out.println("file loaded"); - - } - - @After - public void tearDown() throws Exception { - } - - @Test - public void testLaunchCatTsvFile() { - Assume.assumeNotNull(lcFile); - } - - @Test - public void testGetLaunchList() { - Hashtablelist = lcFile.getLaunchList(); - Assume.assumeNotNull(list); - System.out.println("NB élémenents" + list.size()); - - System.out.println(list.keys().toString()); - // 2021-006 - System.out.println("UVSQSat"+ list.get("2021-006").toString()); - } + LaunchCatTsvFile lcFile; + String SatcatFile = "src\\test\\data\\GSat\\launch2.tsv"; + + @Before + public void setUp() throws Exception { + System.out.println("test launch"); + lcFile = new LaunchCatTsvFile(SatcatFile); + System.out.println("file loaded"); + } + + @After + public void tearDown() throws Exception {} + + @Test + public void testLaunchCatTsvFile() { + Assume.assumeNotNull(lcFile); + } + + @Test + public void testGetLaunchList() { + Hashtable list = lcFile.getLaunchList(); + Assume.assumeNotNull(list); + System.out.println("NB élémenents" + list.size()); + + System.out.println(list.keys().toString()); + // 2021-006 + System.out.println("UVSQSat" + list.get("2021-006").toString()); + } } diff --git a/ModuleSatelliteDatabase/src/test/java/org/josast/AmsatList/source/gcat/OrgsCatTsvFileTest.java b/ModuleSatelliteDatabase/src/test/java/org/josast/AmsatList/source/gcat/OrgsCatTsvFileTest.java index 1b190dc35276a4156211576aeac41f9a510d7d3c..e5d9256c1986060c8fb452e18beb2c2eca4aa491 100644 --- a/ModuleSatelliteDatabase/src/test/java/org/josast/AmsatList/source/gcat/OrgsCatTsvFileTest.java +++ b/ModuleSatelliteDatabase/src/test/java/org/josast/AmsatList/source/gcat/OrgsCatTsvFileTest.java @@ -2,54 +2,45 @@ package org.josast.AmsatList.source.gcat; import static org.junit.Assert.*; -import java.math.BigInteger; import java.util.Hashtable; - import org.junit.After; import org.junit.Assume; import org.junit.Before; import org.junit.Test; public class OrgsCatTsvFileTest { - - OrgsCatTsvFile orgFile ; - String orgCatFile ="src\\test\\data\\GSat\\orgs.tsv"; - - @Before - public void setUp() throws Exception { - System.out.println("test launch"); - orgFile = new OrgsCatTsvFile (orgCatFile ); - System.out.println("file loaded"); - } - - @After - public void tearDown() throws Exception { - } - - @Test - public void testOrgsCatTsvFile() { - Assume.assumeNotNull(orgFile); - } - - @Test - public void testGetOrgsCatList() { - Hashtable orgsCatList; - - orgsCatList = orgFile.getOrgsCatList(); - Assume.assumeNotNull(orgsCatList); - - System.out.println("NB élémenents" + orgsCatList.size()); - - //verif existance 1 org exisste - - System.out.println("UVSQSat"+ orgsCatList.get("UVSQ")); - System.out.println("Space X"+ orgsCatList.get("SPX")); - System.out.println("Pays"+ orgsCatList.get("F")); - - - - } + OrgsCatTsvFile orgFile; + String orgCatFile = "src\\test\\data\\GSat\\orgs.tsv"; + + @Before + public void setUp() throws Exception { + System.out.println("test launch"); + orgFile = new OrgsCatTsvFile(orgCatFile); + System.out.println("file loaded"); + } + + @After + public void tearDown() throws Exception {} + + @Test + public void testOrgsCatTsvFile() { + Assume.assumeNotNull(orgFile); + } + + @Test + public void testGetOrgsCatList() { + Hashtable orgsCatList; + + orgsCatList = orgFile.getOrgsCatList(); + Assume.assumeNotNull(orgsCatList); + + System.out.println("NB élémenents" + orgsCatList.size()); + // verif existance 1 org exisste + System.out.println("UVSQSat" + orgsCatList.get("UVSQ")); + System.out.println("Space X" + orgsCatList.get("SPX")); + System.out.println("Pays" + orgsCatList.get("F")); + } } diff --git a/ModuleSatelliteDatabase/src/test/java/org/josast/AmsatList/source/gcat/SatcCatTsvFileTest.java b/ModuleSatelliteDatabase/src/test/java/org/josast/AmsatList/source/gcat/SatcCatTsvFileTest.java index 4cecfbb732aaff5f560f298ae920b908eb3b6e91..938b9d04c8ea3812ab943d95ee6c0903a842b1e5 100644 --- a/ModuleSatelliteDatabase/src/test/java/org/josast/AmsatList/source/gcat/SatcCatTsvFileTest.java +++ b/ModuleSatelliteDatabase/src/test/java/org/josast/AmsatList/source/gcat/SatcCatTsvFileTest.java @@ -4,7 +4,6 @@ import static org.junit.Assert.*; import java.math.BigInteger; import java.util.Hashtable; - import org.junit.After; import org.junit.Assume; import org.junit.Before; @@ -12,38 +11,35 @@ import org.junit.Test; public class SatcCatTsvFileTest { - SatcCatTsvFile scFile ; - String SatcatFile ="src\\test\\data\\GSat\\satcat2.tsv"; - @Before - public void setUp() throws Exception { - System.out.println("test launch"); - scFile = new SatcCatTsvFile (SatcatFile ); - System.out.println("file loaded"); - - } - - @After - public void tearDown() throws Exception { - } - - @Test - public void testSatcCatTsvFile() { - Assume.assumeNotNull(scFile); - } - - @Test - public void testGetSatcatList() { - Hashtable list = scFile.getSatcatList(); - Assume.assumeNotNull(list); - System.out.println("NB élémenents" + list.size()); - - //verif existance 1 sat - BigInteger biNorad = BigInteger.valueOf(47438); - System.out.println("UVSQSat"+ list.get(biNorad).toString()); - - String launch = list.get(biNorad).getPiece(); - System.out.println(launch.substring(0, 8)); - - } - + SatcCatTsvFile scFile; + String SatcatFile = "src\\test\\data\\GSat\\satcat2.tsv"; + + @Before + public void setUp() throws Exception { + System.out.println("test launch"); + scFile = new SatcCatTsvFile(SatcatFile); + System.out.println("file loaded"); + } + + @After + public void tearDown() throws Exception {} + + @Test + public void testSatcCatTsvFile() { + Assume.assumeNotNull(scFile); + } + + @Test + public void testGetSatcatList() { + Hashtable list = scFile.getSatcatList(); + Assume.assumeNotNull(list); + System.out.println("NB élémenents" + list.size()); + + // verif existance 1 sat + BigInteger biNorad = BigInteger.valueOf(47438); + System.out.println("UVSQSat" + list.get(biNorad).toString()); + + String launch = list.get(biNorad).getPiece(); + System.out.println(launch.substring(0, 8)); + } } diff --git a/ModuleSatelliteDatabase/src/test/java/org/josast/AmsatList/source/gcat/SiteCatTsvFileTest.java b/ModuleSatelliteDatabase/src/test/java/org/josast/AmsatList/source/gcat/SiteCatTsvFileTest.java index 9dceb651b52c87d43c8f9e91d8cda65304664b38..1dcdaca619ed95a514e873584b12c7e4502281b8 100644 --- a/ModuleSatelliteDatabase/src/test/java/org/josast/AmsatList/source/gcat/SiteCatTsvFileTest.java +++ b/ModuleSatelliteDatabase/src/test/java/org/josast/AmsatList/source/gcat/SiteCatTsvFileTest.java @@ -3,43 +3,39 @@ package org.josast.AmsatList.source.gcat; import static org.junit.Assert.*; import java.util.Hashtable; - import org.junit.After; import org.junit.Assume; import org.junit.Before; import org.junit.Test; public class SiteCatTsvFileTest { - - SiteCatTsvFile scFile ; - String SatcatFile ="src\\test\\data\\GSat\\sites.tsv"; - - @Before - public void setUp() throws Exception { - System.out.println("test launch"); - scFile = new SiteCatTsvFile (SatcatFile ); - System.out.println("file loaded"); - } - - @After - public void tearDown() throws Exception { - } - - @Test - public final void testSiteCatTsvFileString() { - Assume.assumeNotNull(scFile); - } - - @Test - public final void testGetSitecatList() { - Hashtablelist = scFile.getSitecatList(); - Assume.assumeNotNull(list); - System.out.println("NB élémenents" + list.size()); - - System.out.println(list.keys().toString()); - // 2021-006 - System.out.println("UVSQSat"+ list.get("CC").toString()); - - } + SiteCatTsvFile scFile; + String SatcatFile = "src\\test\\data\\GSat\\sites.tsv"; + + @Before + public void setUp() throws Exception { + System.out.println("test launch"); + scFile = new SiteCatTsvFile(SatcatFile); + System.out.println("file loaded"); + } + + @After + public void tearDown() throws Exception {} + + @Test + public final void testSiteCatTsvFileString() { + Assume.assumeNotNull(scFile); + } + + @Test + public final void testGetSitecatList() { + Hashtable list = scFile.getSitecatList(); + Assume.assumeNotNull(list); + System.out.println("NB élémenents" + list.size()); + + System.out.println(list.keys().toString()); + // 2021-006 + System.out.println("UVSQSat" + list.get("CC").toString()); + } } diff --git a/ModuleSatelliteDatabase/src/test/java/org/josast/AmsatList/source/j9pel/J9PELTest.java b/ModuleSatelliteDatabase/src/test/java/org/josast/AmsatList/source/j9pel/J9PELTest.java index a9a2e306a0ba8171d0f9a93b6546e1101f3af2ae..ed21a9a3aa37c4df1559d20269952a7c7887d5ac 100644 --- a/ModuleSatelliteDatabase/src/test/java/org/josast/AmsatList/source/j9pel/J9PELTest.java +++ b/ModuleSatelliteDatabase/src/test/java/org/josast/AmsatList/source/j9pel/J9PELTest.java @@ -1,24 +1,20 @@ package org.josast.AmsatList.source.j9pel; - - import org.josast.AmsatList.source.je9pel.JE9PELcsvFile; public class J9PELTest { - public J9PELTest() { - // TODO Auto-generated constructor stub - } - - public static void main(String[] args) { - - JE9PELcsvFile je9pelFile = new JE9PELcsvFile("E:\\gitjosast\\josast\\ModuleSatelliteDatabase\\src\\test\\data\\je9pel-csv-file\\satslist.csv"); - je9pelFile.displayStatus(); - // je9pelFile.displaySatellites(); + public J9PELTest() { + // TODO Auto-generated constructor stub + } + public static void main(String[] args) { + JE9PELcsvFile je9pelFile = + new JE9PELcsvFile( + "E:\\gitjosast\\josast\\ModuleSatelliteDatabase\\src\\test\\data\\je9pel-csv-file\\satslist.csv"); + je9pelFile.displayStatus(); + // je9pelFile.displaySatellites(); + } } -} - - diff --git a/ModuleSatelliteDatabase/src/test/java/org/josast/ModuleSatelliteDatabase/CheckAmsatListFileTest.java b/ModuleSatelliteDatabase/src/test/java/org/josast/ModuleSatelliteDatabase/CheckAmsatListFileTest.java index 28ed673a8ff539561c0aa504738310e69285b066..e07cc4f6162d681556959b69e119f62cae935ca7 100644 --- a/ModuleSatelliteDatabase/src/test/java/org/josast/ModuleSatelliteDatabase/CheckAmsatListFileTest.java +++ b/ModuleSatelliteDatabase/src/test/java/org/josast/ModuleSatelliteDatabase/CheckAmsatListFileTest.java @@ -10,31 +10,26 @@ import org.junit.Test; public class CheckAmsatListFileTest { - @BeforeClass - public static void setUpBeforeClass() throws Exception { - } - - @AfterClass - public static void tearDownAfterClass() throws Exception { - } - - @Before - public void setUp() throws Exception { - } - - @After - public void tearDown() throws Exception { - } - - @Test - public void test() { - String file = "src\\test\\data\\FileIn\\AmsatList.xml"; - CheckAmsatListFile check = new CheckAmsatListFile(file); - System.out.println(check.checkUniqueSatelliteName().toString()); - System.out.println(check.checkUniqueSatelliteNasaID().toString()); - System.out.println(check.getListSatelliteStatus()); - // si il n'y a pas d'erreur généré. - assertTrue( true ); - } - + @BeforeClass + public static void setUpBeforeClass() throws Exception {} + + @AfterClass + public static void tearDownAfterClass() throws Exception {} + + @Before + public void setUp() throws Exception {} + + @After + public void tearDown() throws Exception {} + + @Test + public void test() { + String file = "src\\test\\data\\FileIn\\AmsatList.xml"; + CheckAmsatListFile check = new CheckAmsatListFile(file); + System.out.println(check.checkUniqueSatelliteName().toString()); + System.out.println(check.checkUniqueSatelliteNasaID().toString()); + System.out.println(check.getListSatelliteStatus()); + // si il n'y a pas d'erreur généré. + assertTrue(true); + } } diff --git a/ModuleSatelliteDatabase/src/test/java/org/josast/ModuleSatelliteDatabase/UpdateAmsatListFileTest.java b/ModuleSatelliteDatabase/src/test/java/org/josast/ModuleSatelliteDatabase/UpdateAmsatListFileTest.java index 2f9928ec8d72104291a25582afb6a198321905b6..8e21fcf2f23879fd9a98a432676c4a3896c08bab 100644 --- a/ModuleSatelliteDatabase/src/test/java/org/josast/ModuleSatelliteDatabase/UpdateAmsatListFileTest.java +++ b/ModuleSatelliteDatabase/src/test/java/org/josast/ModuleSatelliteDatabase/UpdateAmsatListFileTest.java @@ -10,29 +10,24 @@ import org.junit.Test; public class UpdateAmsatListFileTest { - @BeforeClass - public static void setUpBeforeClass() throws Exception { - } - - @AfterClass - public static void tearDownAfterClass() throws Exception { - } - - @Before - public void setUp() throws Exception { - } - - @After - public void tearDown() throws Exception { - } - - @Test - public void test() { - String file = "src\\test\\data\\FileIn\\AmsatList.xml"; - UpdateAmsatListFile uf = new UpdateAmsatListFile(file); - uf.updateStatus(); - - assertTrue( true ); - } + @BeforeClass + public static void setUpBeforeClass() throws Exception {} + @AfterClass + public static void tearDownAfterClass() throws Exception {} + + @Before + public void setUp() throws Exception {} + + @After + public void tearDown() throws Exception {} + + @Test + public void test() { + String file = "src\\test\\data\\FileIn\\AmsatList.xml"; + UpdateAmsatListFile uf = new UpdateAmsatListFile(file); + uf.updateStatus(); + + assertTrue(true); + } } diff --git a/ModuleSound/src/main/java/org/avmdti/sound/AudioFormatFactory.java b/ModuleSound/src/main/java/org/avmdti/sound/AudioFormatFactory.java index ecdd638567943cd7c52e351229ff559648e2a18e..9b81ea6cd7db80ec7049d9110e9596622faab116 100644 --- a/ModuleSound/src/main/java/org/avmdti/sound/AudioFormatFactory.java +++ b/ModuleSound/src/main/java/org/avmdti/sound/AudioFormatFactory.java @@ -3,61 +3,41 @@ package org.avmdti.sound; import javax.sound.sampled.AudioFormat; /** - * * Description : - * - * - *

    - * Projet : Sound
    - * + * + *

    Projet : Sound
    *
    * JOSAST : Java Open Source Amateur Satellite Toolbox
    - * The aim of the project is to create a set of tools for amateur satellite - * purpose. All this tools could be used together to create specific software. - * JOSAST project is managed by AVMDTI + * The aim of the project is to create a set of tools for amateur satellite purpose. All this tools + * could be used together to create specific software. JOSAST project is managed by AVMDTI * (http://www.avmdti.org )
    - * This software is an open source software. Please read the JOSAST - * licence
    + * This software is an open source software. Please read the JOSAST licence
    * (http://www.avmdti.org ) - *

    - * for more information contact - * josast@avmdti.org - *

    - * + * + *

    for more information contact josast@avmdti.org + * * @author mercier * @version 1.0 - *

    - * date 9 janv. 2004 - *

    - *

    - * Source Update - *

    - *
    - * date : name : comments
    - * V1 : mercier : create file - *

    - * + *

    date 9 janv. 2004 + *

    Source Update
    + * date : name : comments
    + * V1 : mercier : create file + *

    */ public class AudioFormatFactory { - public static final int MONO8BITPCM = 1; + public static final int MONO8BITPCM = 1; - public static AudioFormat getAudioFormat(int id) { - switch (id) { - case MONO8BITPCM: - return (new AudioFormat(8000, 8, 1, true, true)); + public static AudioFormat getAudioFormat(int id) { + switch (id) { + case MONO8BITPCM: + return (new AudioFormat(8000, 8, 1, true, true)); - default: - return null; - - } - } - - /** - * do nothing, this class can not be created - * - */ - private AudioFormatFactory() { - } + default: + return null; + } + } + /** do nothing, this class can not be created */ + private AudioFormatFactory() {} } diff --git a/ModuleSound/src/main/java/org/avmdti/sound/SoundRecorder.java b/ModuleSound/src/main/java/org/avmdti/sound/SoundRecorder.java index 34a427021ce717bd6d498b4d67c80b1863d02fa5..14ea00ddc75c965220c39874f4f22da9cb317f7f 100644 --- a/ModuleSound/src/main/java/org/avmdti/sound/SoundRecorder.java +++ b/ModuleSound/src/main/java/org/avmdti/sound/SoundRecorder.java @@ -2,7 +2,8 @@ package org.avmdti.sound; import java.io.File; import java.io.IOException; - +import java.util.logging.Level; +import java.util.logging.Logger; import javax.sound.sampled.AudioFileFormat; import javax.sound.sampled.AudioFormat; import javax.sound.sampled.AudioInputStream; @@ -11,190 +12,164 @@ import javax.sound.sampled.DataLine; import javax.sound.sampled.LineUnavailableException; import javax.sound.sampled.TargetDataLine; -import java.util.logging.Level; -import java.util.logging.Logger; - /** - * * Description : - * - * - *

    - * Projet : enregistreur
    - * + * + *

    Projet : enregistreur
    *
    * JOSAST : Java Open Source Amateur Satellite Toolbox
    - * The aim of the project is to create a set of tools for amateur satellite - * purpose. All this tools could be used together to create specific software. - * JOSAST project is managed by AVMDTI ( + * The aim of the project is to create a set of tools for amateur satellite purpose. All this tools + * could be used together to create specific software. JOSAST project is managed by AVMDTI ( * http://www.avmdti.org )
    - * This software is an open source software. Please read the JOSAST - * licence
    + * This software is an open source software. Please read the JOSAST licence
    * ( http://www.avmdti.org ) - *

    - * for more information contact - * josast@avmdti.org - *

    - * + * + *

    for more information contact josast@avmdti.org + * * @author mercier * @version 1.0 - *

    - * date 7 janv. 2004 - *

    - *

    - * Source Update - *

    - *
    - * date : name : comments
    - * V1 : mercier : create file - *

    - * + *

    date 7 janv. 2004 + *

    Source Update
    + * date : name : comments
    + * V1 : mercier : create file + *

    */ public class SoundRecorder extends Thread { - private Logger log = Logger.getLogger(getClass().getName()); - - private TargetDataLine line = null; - - private File fichier; - - private AudioInputStream AIS = null; - - /** - * Method SoundRecorder. - * - * @param filename - * @param AF - */ - public SoundRecorder(String filename, AudioFormat AF) { - open(filename, AF); - } - - /** - * Method open - * - * This method open the input line and the output file. Some checking are - * performed like : - Audio Format is available - Input line Available - * - * The default format for the Output file is WAV - * - * @param filename Output file name - * @param AF Audio format for the input sound - * - */ - public void open(String filename, AudioFormat AF) { - - DataLine.Info info = new DataLine.Info(TargetDataLine.class, AF); - if (!AudioSystem.isLineSupported(info)) { - log.log(Level.SEVERE, "AudioFormat not available"); - } else { - try { - line = (TargetDataLine) AudioSystem.getLine(info); - } catch (LineUnavailableException e) { - log.log(Level.SEVERE, e.getMessage()); - e.printStackTrace(); - } - try { - line.open(AF); - } catch (LineUnavailableException e) { - log.log(Level.SEVERE, e.getMessage()); - e.printStackTrace(); - } - - fichier = new File(filename + ".wav"); - } - } - - /** - * Method close. This method release the Input device and stop specific Sound - * Thread - * - * see Java sound FAQ - * - * - */ - public void close() { - // recherche de Tread lié à la carte son et les détruire. - // voir sur le site java sound resource - - final ThreadGroup tg = Thread.currentThread().getThreadGroup(); - final Thread[] t = new Thread[tg.activeCount()]; - final int active = tg.enumerate(t); - for (int i = 0; i < active; i++) { - if (t[i].getName().indexOf("Sound") != -1) { - t[i].interrupt(); - } - } - // This trick was provided by Sean A. Irvine. (Matthias) - - } - - /** - * Method startRecord. - * - * Start the record of the Inpout Sound. This method call the start method of - * the Thread. - */ - public void startRecord() { - - AIS = new AudioInputStream(line); - line.start(); - this.start(); - } - - /** - * @see java.lang.Runnable#run() - */ - public void run() { - try { - AudioSystem.write(AIS, AudioFileFormat.Type.WAVE, fichier); - } catch (IOException e) { - log.log(Level.SEVERE, e.getMessage()); - e.printStackTrace(); - } - } - - /** - * Method endRecord. - * - * This Method stop the sound record and close the Input. - */ - public void endRecord() { - - line.flush(); - line.stop(); - try { - AIS.close(); - } catch (IOException e) { - log.log(Level.SEVERE, e.getMessage()); - e.printStackTrace(); - } - line.close(); - try { - this.join(); - } catch (InterruptedException e) { - log.log(Level.SEVERE, e.getMessage()); - e.printStackTrace(); - } - } - - /** - * Method record. - * - * This method record sound during time seconds - * - * @param time number seconds of sound record - */ - public void record(int i) { - startRecord(); - try { - SoundRecorder.sleep(i * 1000); // i en secondes - } catch (InterruptedException e) { - log.log(Level.SEVERE, e.getMessage()); - e.printStackTrace(); - } - endRecord(); - - } - -} \ No newline at end of file + private Logger log = Logger.getLogger(getClass().getName()); + + private TargetDataLine line = null; + + private File fichier; + + private AudioInputStream AIS = null; + + /** + * Method SoundRecorder. + * + * @param filename + * @param AF + */ + public SoundRecorder(String filename, AudioFormat AF) { + open(filename, AF); + } + + /** + * Method open + * + *

    This method open the input line and the output file. Some checking are performed like : - + * Audio Format is available - Input line Available + * + *

    The default format for the Output file is WAV + * + * @param filename Output file name + * @param AF Audio format for the input sound + */ + public void open(String filename, AudioFormat AF) { + + DataLine.Info info = new DataLine.Info(TargetDataLine.class, AF); + if (!AudioSystem.isLineSupported(info)) { + log.log(Level.SEVERE, "AudioFormat not available"); + } else { + try { + line = (TargetDataLine) AudioSystem.getLine(info); + } catch (LineUnavailableException e) { + log.log(Level.SEVERE, e.getMessage()); + e.printStackTrace(); + } + try { + line.open(AF); + } catch (LineUnavailableException e) { + log.log(Level.SEVERE, e.getMessage()); + e.printStackTrace(); + } + + fichier = new File(filename + ".wav"); + } + } + + /** + * Method close. This method release the Input device and stop specific Sound Thread + * + *

    see Java sound FAQ + */ + public void close() { + // recherche de Tread lié à la carte son et les détruire. + // voir sur le site java sound resource + + final ThreadGroup tg = Thread.currentThread().getThreadGroup(); + final Thread[] t = new Thread[tg.activeCount()]; + final int active = tg.enumerate(t); + for (int i = 0; i < active; i++) { + if (t[i].getName().indexOf("Sound") != -1) { + t[i].interrupt(); + } + } + // This trick was provided by Sean A. Irvine. (Matthias) + + } + + /** + * Method startRecord. + * + *

    Start the record of the Inpout Sound. This method call the start method of the Thread. + */ + public void startRecord() { + + AIS = new AudioInputStream(line); + line.start(); + this.start(); + } + + /** @see java.lang.Runnable#run() */ + public void run() { + try { + AudioSystem.write(AIS, AudioFileFormat.Type.WAVE, fichier); + } catch (IOException e) { + log.log(Level.SEVERE, e.getMessage()); + e.printStackTrace(); + } + } + + /** + * Method endRecord. + * + *

    This Method stop the sound record and close the Input. + */ + public void endRecord() { + + line.flush(); + line.stop(); + try { + AIS.close(); + } catch (IOException e) { + log.log(Level.SEVERE, e.getMessage()); + e.printStackTrace(); + } + line.close(); + try { + this.join(); + } catch (InterruptedException e) { + log.log(Level.SEVERE, e.getMessage()); + e.printStackTrace(); + } + } + + /** + * Method record. + * + *

    This method record sound during time seconds + * + * @param time number seconds of sound record + */ + public void record(int i) { + startRecord(); + try { + SoundRecorder.sleep(i * 1000); // i en secondes + } catch (InterruptedException e) { + log.log(Level.SEVERE, e.getMessage()); + e.printStackTrace(); + } + endRecord(); + } +} diff --git a/ModuleSound/src/main/java/org/avmdti/sound/example/DemoSoudRecorder.java b/ModuleSound/src/main/java/org/avmdti/sound/example/DemoSoudRecorder.java index 168cd9a07bf6c8c438f0511fa9570024b2d48f20..557989d9415b429df9d5493da215b13ebe2d821b 100644 --- a/ModuleSound/src/main/java/org/avmdti/sound/example/DemoSoudRecorder.java +++ b/ModuleSound/src/main/java/org/avmdti/sound/example/DemoSoudRecorder.java @@ -4,50 +4,37 @@ import org.avmdti.sound.AudioFormatFactory; import org.avmdti.sound.SoundRecorder; /** - * * Description : - * - * - *

    - * Projet : enregistreur
    - * + * + *

    Projet : enregistreur
    *
    * JOSAST : Java Open Source Amateur Satellite Toolbox
    - * The aim of the project is to create a set of tools for amateur satellite - * purpose. All this tools could be used together to create specific software. - * JOSAST project is managed by AVMDTI + * The aim of the project is to create a set of tools for amateur satellite purpose. All this tools + * could be used together to create specific software. JOSAST project is managed by AVMDTI * (http://www.avmdti.org )
    - * This software is an open source software. Please read the JOSAST - * licence
    + * This software is an open source software. Please read the JOSAST licence
    * (http://www.avmdti.org ) - *

    - * for more information contact - * josast@avmdti.org - *

    - * + * + *

    for more information contact josast@avmdti.org + * * @author mercier * @version 1.0 - *

    - * date 7 janv. 2004 - *

    - *

    - * Source Update - *

    - *
    - * date : name : comments
    - * V1 : mercier : create file - *

    - * + *

    date 7 janv. 2004 + *

    Source Update
    + * date : name : comments
    + * V1 : mercier : create file + *

    */ public class DemoSoudRecorder { - public static void main(String[] args) { - SoundRecorder SR = new SoundRecorder("test", AudioFormatFactory.getAudioFormat(AudioFormatFactory.MONO8BITPCM)); - System.out.println("debut"); - SR.record(100); - System.out.println("end"); - SR.close(); - System.out.println("fini"); - - } + public static void main(String[] args) { + SoundRecorder SR = + new SoundRecorder( + "test", AudioFormatFactory.getAudioFormat(AudioFormatFactory.MONO8BITPCM)); + System.out.println("debut"); + SR.record(100); + System.out.println("end"); + SR.close(); + System.out.println("fini"); + } } diff --git a/ModuleSound/src/main/java/org/avmdti/sound/example/GUIDemoSoundRecorder.java b/ModuleSound/src/main/java/org/avmdti/sound/example/GUIDemoSoundRecorder.java index c6520385ec2c9797bb3cdaf539033aa55982d0d9..d9c8cf1248b66f982b71f7fc4daefc26e32075ed 100644 --- a/ModuleSound/src/main/java/org/avmdti/sound/example/GUIDemoSoundRecorder.java +++ b/ModuleSound/src/main/java/org/avmdti/sound/example/GUIDemoSoundRecorder.java @@ -1,11 +1,8 @@ - package org.avmdti.sound.example; import java.awt.event.ActionEvent; import java.io.File; - import javax.swing.JFileChooser; - import org.avmdti.sound.AudioFormatFactory; import org.avmdti.sound.SoundRecorder; @@ -15,206 +12,203 @@ import org.avmdti.sound.SoundRecorder; * Created on 27 janvier 2004, 09:04 */ -/** - * - * @author mercier - */ +/** @author mercier */ public class GUIDemoSoundRecorder extends javax.swing.JFrame { - /** - * - */ - private static final long serialVersionUID = 3175588711372297398L; - SoundRecorder SR = null; - - /** Creates new form GUIDemoSoundRecorder */ - public GUIDemoSoundRecorder() { - initComponents(); - } - - /** - * This method is called from within the constructor to initialize the form. - * WARNING: Do NOT modify this code. The content of this method is always - * regenerated by the Form Editor. - */ - private void initComponents() {// GEN-BEGIN:initComponents - jPanel1 = new javax.swing.JPanel(); - jPanel2 = new javax.swing.JPanel(); - jPanel3 = new javax.swing.JPanel(); - jLabel1 = new javax.swing.JLabel(); - jTextFieldFileName = new javax.swing.JTextField(); - jButtonFileSelect = new javax.swing.JButton(); - jPanel4 = new javax.swing.JPanel(); - jButtonStart = new javax.swing.JButton(); - jButtonStop = new javax.swing.JButton(); - jButtonExit = new javax.swing.JButton(); - menuBar = new javax.swing.JMenuBar(); - helpMenu = new javax.swing.JMenu(); - contentsMenuItem = new javax.swing.JMenuItem(); - aboutMenuItem = new javax.swing.JMenuItem(); - - setTitle("JOSAST Demo Sound Recorder"); - addWindowListener(new java.awt.event.WindowAdapter() { - public void windowClosing(java.awt.event.WindowEvent evt) { - exitForm(evt); - } - }); - - jPanel1.setLayout(new java.awt.BorderLayout()); - - jPanel2.setLayout(new java.awt.BorderLayout()); - - jPanel3.setToolTipText("null"); - jLabel1.setText("Filename (.wav)"); - jPanel3.add(jLabel1); - - jTextFieldFileName.setText("demo.wav"); - jTextFieldFileName.setMinimumSize(new java.awt.Dimension(4, 50)); - jTextFieldFileName.setPreferredSize(new java.awt.Dimension(200, 20)); - jPanel3.add(jTextFieldFileName); - - jButtonFileSelect.setText("..."); - jButtonFileSelect.setToolTipText("File selection"); - - jButtonFileSelect.addActionListener(new java.awt.event.ActionListener() { - public void actionPerformed(java.awt.event.ActionEvent evt) { - jButtonFileSelectActionPerformed(evt); - } - }); - jPanel3.add(jButtonFileSelect); - - jPanel2.add(jPanel3, java.awt.BorderLayout.CENTER); - - jPanel1.add(jPanel2, java.awt.BorderLayout.NORTH); - - jButtonStart.setText("Start"); - jButtonStart.setToolTipText("Begin to record sound"); - jButtonStart.addActionListener(new java.awt.event.ActionListener() { - public void actionPerformed(java.awt.event.ActionEvent evt) { - jButtonStartActionPerformed(evt); - } - }); - - jPanel4.add(jButtonStart); - - jButtonStop.setText("Stop"); - jButtonStop.setToolTipText("Stop record sound"); - jButtonStop.addActionListener(new java.awt.event.ActionListener() { - public void actionPerformed(java.awt.event.ActionEvent evt) { - jButtonStopActionPerformed(evt); - } - }); - - jPanel4.add(jButtonStop); - - jButtonExit.setText("Exit"); - jButtonExit.setToolTipText("exit demo"); - jButtonExit.addActionListener(new java.awt.event.ActionListener() { - public void actionPerformed(java.awt.event.ActionEvent evt) { - jButtonExitActionPerformed(evt); - } - }); - - jPanel4.add(jButtonExit); - - jPanel1.add(jPanel4, java.awt.BorderLayout.SOUTH); - - getContentPane().add(jPanel1, java.awt.BorderLayout.CENTER); - - helpMenu.setText("Help"); - contentsMenuItem.setText("Contents"); - helpMenu.add(contentsMenuItem); - - aboutMenuItem.setText("About"); - helpMenu.add(aboutMenuItem); - - menuBar.add(helpMenu); - - setJMenuBar(menuBar); - jButtonStop.setEnabled(false); - - pack(); - }// GEN-END:initComponents - - /** - * Method jButtonFileSelectActionPerformed. - * - * @param evt - */ - private void jButtonFileSelectActionPerformed(ActionEvent evt) { - - // Add your handling code here: - JFileChooser jFileChooserkeps = new JFileChooser(); - // Filtre pour le FileChooser - // JFileChooser jFileChooserkeps = null; - MyFileFilter filter = new MyFileFilter(); - // filter.addExtension("jpg"); - filter.addExtension("wav"); - filter.setDescription("WAV File "); - jFileChooserkeps.setFileFilter(filter); - - if (JFileChooser.APPROVE_OPTION == jFileChooserkeps.showOpenDialog(this)) { - File f = jFileChooserkeps.getSelectedFile(); - jTextFieldFileName.setText(f.getAbsolutePath()); - - } // GEN-LAST:event_jButtonLocalFileSelectionActionPerformed - - } - - private void jButtonExitActionPerformed(java.awt.event.ActionEvent evt) {// GEN-FIRST:event_jButtonExitActionPerformed - // Add your handling code here: - if (SR != null) - SR.close(); - System.exit(0); - }// GEN-LAST:event_jButtonExitActionPerformed - - private void jButtonStopActionPerformed(java.awt.event.ActionEvent evt) {// GEN-FIRST:event_jButtonStopActionPerformed - // Add your handling code here: - jButtonStop.setEnabled(false); - jButtonStart.setEnabled(true); - SR.endRecord(); - - }// GEN-LAST:event_jButtonStopActionPerformed - - private void jButtonStartActionPerformed(java.awt.event.ActionEvent evt) {// GEN-FIRST:event_jButtonStartActionPerformed - // Add your handling code here: - jButtonStop.setEnabled(true); - jButtonStart.setEnabled(false); - SR = new SoundRecorder(jTextFieldFileName.getText(), - AudioFormatFactory.getAudioFormat(AudioFormatFactory.MONO8BITPCM)); - SR.startRecord(); - }// GEN-LAST:event_jButtonStartActionPerformed - - /** Exit the Application */ - private void exitForm(java.awt.event.WindowEvent evt) {// GEN-FIRST:event_exitForm - if (SR != null) - SR.close(); - System.exit(0); - }// GEN-LAST:event_exitForm - - /** - * @param args the command line arguments - */ - - @SuppressWarnings("deprecation") - public static void main(String args[]) { - new GUIDemoSoundRecorder().show(); - } - - // Variables declaration - do not modify//GEN-BEGIN:variables - private javax.swing.JMenuItem aboutMenuItem; - private javax.swing.JButton jButtonExit; - private javax.swing.JPanel jPanel4; - private javax.swing.JPanel jPanel3; - private javax.swing.JPanel jPanel2; - private javax.swing.JPanel jPanel1; - private javax.swing.JButton jButtonFileSelect; - private javax.swing.JMenuBar menuBar; - private javax.swing.JButton jButtonStop; - private javax.swing.JMenuItem contentsMenuItem; - private javax.swing.JTextField jTextFieldFileName; - private javax.swing.JLabel jLabel1; - private javax.swing.JButton jButtonStart; - private javax.swing.JMenu helpMenu; - // End of variables declaration//GEN-END:variables + /** */ + private static final long serialVersionUID = 3175588711372297398L; + + SoundRecorder SR = null; + + /** Creates new form GUIDemoSoundRecorder */ + public GUIDemoSoundRecorder() { + initComponents(); + } + + /** + * This method is called from within the constructor to initialize the form. WARNING: Do NOT + * modify this code. The content of this method is always regenerated by the Form Editor. + */ + private void initComponents() { // GEN-BEGIN:initComponents + jPanel1 = new javax.swing.JPanel(); + jPanel2 = new javax.swing.JPanel(); + jPanel3 = new javax.swing.JPanel(); + jLabel1 = new javax.swing.JLabel(); + jTextFieldFileName = new javax.swing.JTextField(); + jButtonFileSelect = new javax.swing.JButton(); + jPanel4 = new javax.swing.JPanel(); + jButtonStart = new javax.swing.JButton(); + jButtonStop = new javax.swing.JButton(); + jButtonExit = new javax.swing.JButton(); + menuBar = new javax.swing.JMenuBar(); + helpMenu = new javax.swing.JMenu(); + contentsMenuItem = new javax.swing.JMenuItem(); + aboutMenuItem = new javax.swing.JMenuItem(); + + setTitle("JOSAST Demo Sound Recorder"); + addWindowListener( + new java.awt.event.WindowAdapter() { + public void windowClosing(java.awt.event.WindowEvent evt) { + exitForm(evt); + } + }); + + jPanel1.setLayout(new java.awt.BorderLayout()); + + jPanel2.setLayout(new java.awt.BorderLayout()); + + jPanel3.setToolTipText("null"); + jLabel1.setText("Filename (.wav)"); + jPanel3.add(jLabel1); + + jTextFieldFileName.setText("demo.wav"); + jTextFieldFileName.setMinimumSize(new java.awt.Dimension(4, 50)); + jTextFieldFileName.setPreferredSize(new java.awt.Dimension(200, 20)); + jPanel3.add(jTextFieldFileName); + + jButtonFileSelect.setText("..."); + jButtonFileSelect.setToolTipText("File selection"); + + jButtonFileSelect.addActionListener( + new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + jButtonFileSelectActionPerformed(evt); + } + }); + jPanel3.add(jButtonFileSelect); + + jPanel2.add(jPanel3, java.awt.BorderLayout.CENTER); + + jPanel1.add(jPanel2, java.awt.BorderLayout.NORTH); + + jButtonStart.setText("Start"); + jButtonStart.setToolTipText("Begin to record sound"); + jButtonStart.addActionListener( + new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + jButtonStartActionPerformed(evt); + } + }); + + jPanel4.add(jButtonStart); + + jButtonStop.setText("Stop"); + jButtonStop.setToolTipText("Stop record sound"); + jButtonStop.addActionListener( + new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + jButtonStopActionPerformed(evt); + } + }); + + jPanel4.add(jButtonStop); + + jButtonExit.setText("Exit"); + jButtonExit.setToolTipText("exit demo"); + jButtonExit.addActionListener( + new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + jButtonExitActionPerformed(evt); + } + }); + + jPanel4.add(jButtonExit); + + jPanel1.add(jPanel4, java.awt.BorderLayout.SOUTH); + + getContentPane().add(jPanel1, java.awt.BorderLayout.CENTER); + + helpMenu.setText("Help"); + contentsMenuItem.setText("Contents"); + helpMenu.add(contentsMenuItem); + + aboutMenuItem.setText("About"); + helpMenu.add(aboutMenuItem); + + menuBar.add(helpMenu); + + setJMenuBar(menuBar); + jButtonStop.setEnabled(false); + + pack(); + } // GEN-END:initComponents + + /** + * Method jButtonFileSelectActionPerformed. + * + * @param evt + */ + private void jButtonFileSelectActionPerformed(ActionEvent evt) { + + // Add your handling code here: + JFileChooser jFileChooserkeps = new JFileChooser(); + // Filtre pour le FileChooser + // JFileChooser jFileChooserkeps = null; + MyFileFilter filter = new MyFileFilter(); + // filter.addExtension("jpg"); + filter.addExtension("wav"); + filter.setDescription("WAV File "); + jFileChooserkeps.setFileFilter(filter); + + if (JFileChooser.APPROVE_OPTION == jFileChooserkeps.showOpenDialog(this)) { + File f = jFileChooserkeps.getSelectedFile(); + jTextFieldFileName.setText(f.getAbsolutePath()); + } // GEN-LAST:event_jButtonLocalFileSelectionActionPerformed + } + + private void jButtonExitActionPerformed( + java.awt.event.ActionEvent evt) { // GEN-FIRST:event_jButtonExitActionPerformed + // Add your handling code here: + if (SR != null) SR.close(); + System.exit(0); + } // GEN-LAST:event_jButtonExitActionPerformed + + private void jButtonStopActionPerformed( + java.awt.event.ActionEvent evt) { // GEN-FIRST:event_jButtonStopActionPerformed + // Add your handling code here: + jButtonStop.setEnabled(false); + jButtonStart.setEnabled(true); + SR.endRecord(); + } // GEN-LAST:event_jButtonStopActionPerformed + + private void jButtonStartActionPerformed( + java.awt.event.ActionEvent evt) { // GEN-FIRST:event_jButtonStartActionPerformed + // Add your handling code here: + jButtonStop.setEnabled(true); + jButtonStart.setEnabled(false); + SR = + new SoundRecorder( + jTextFieldFileName.getText(), + AudioFormatFactory.getAudioFormat(AudioFormatFactory.MONO8BITPCM)); + SR.startRecord(); + } // GEN-LAST:event_jButtonStartActionPerformed + + /** Exit the Application */ + private void exitForm(java.awt.event.WindowEvent evt) { // GEN-FIRST:event_exitForm + if (SR != null) SR.close(); + System.exit(0); + } // GEN-LAST:event_exitForm + + /** @param args the command line arguments */ + @SuppressWarnings("deprecation") + public static void main(String args[]) { + new GUIDemoSoundRecorder().show(); + } + + // Variables declaration - do not modify//GEN-BEGIN:variables + private javax.swing.JMenuItem aboutMenuItem; + private javax.swing.JButton jButtonExit; + private javax.swing.JPanel jPanel4; + private javax.swing.JPanel jPanel3; + private javax.swing.JPanel jPanel2; + private javax.swing.JPanel jPanel1; + private javax.swing.JButton jButtonFileSelect; + private javax.swing.JMenuBar menuBar; + private javax.swing.JButton jButtonStop; + private javax.swing.JMenuItem contentsMenuItem; + private javax.swing.JTextField jTextFieldFileName; + private javax.swing.JLabel jLabel1; + private javax.swing.JButton jButtonStart; + private javax.swing.JMenu helpMenu; + // End of variables declaration//GEN-END:variables } diff --git a/ModuleSound/src/main/java/org/avmdti/sound/example/MyFileFilter.java b/ModuleSound/src/main/java/org/avmdti/sound/example/MyFileFilter.java index a1206b72a494e55c71dc521a57d62611bc95bd94..570fe1644691541f78c96a75864d45ad731f0ea0 100644 --- a/ModuleSound/src/main/java/org/avmdti/sound/example/MyFileFilter.java +++ b/ModuleSound/src/main/java/org/avmdti/sound/example/MyFileFilter.java @@ -17,233 +17,226 @@ package org.avmdti.sound.example; import java.io.File; import java.util.Enumeration; import java.util.Hashtable; - import javax.swing.filechooser.FileFilter; /** - * A convenience implementation of FileFilter that filters out all files except - * for those type extensions that it knows about. + * A convenience implementation of FileFilter that filters out all files except for those type + * extensions that it knows about. * - * Extensions are of the type ".foo", which is typically found on Windows and - * Unix boxes, but not on Macinthosh. Case is ignored. + *

    Extensions are of the type ".foo", which is typically found on Windows and Unix boxes, but not + * on Macinthosh. Case is ignored. * - * Example - create a new filter that filerts out all files but gif and jpg - * image files: + *

    Example - create a new filter that filerts out all files but gif and jpg image files: * - * JFileChooser chooser = new JFileChooser(); MyFileFilter filter = new - * MyFileFilter( new String{"gif", "jpg"}, "JPEG & GIF Images") - * chooser.addChoosableFileFilter(filter); chooser.showOpenDialog(this); + *

    JFileChooser chooser = new JFileChooser(); MyFileFilter filter = new MyFileFilter( new + * String{"gif", "jpg"}, "JPEG & GIF Images") chooser.addChoosableFileFilter(filter); + * chooser.showOpenDialog(this); * * @version 1.8 08/26/98 * @author Jeff Dinkins */ public class MyFileFilter extends FileFilter { - @SuppressWarnings("unused") - private static String TYPE_UNKNOWN = "Type Unknown"; - @SuppressWarnings("unused") - private static String HIDDEN_FILE = "Hidden File"; - - private Hashtable filters = null; - private String description = null; - private String fullDescription = null; - private boolean useExtensionsInDescription = true; - - /** - * Creates a file filter. If no filters are added, then all files are accepted. - * - * @see #addExtension - */ - public MyFileFilter() { - this.filters = new Hashtable(); - } - - /** - * Creates a file filter that accepts files with the given extension. Example: - * new MyFileFilter("jpg"); - * - * @see #addExtension - */ - public MyFileFilter(String extension) { - this(extension, null); - } - - /** - * Creates a file filter that accepts the given file type. Example: new - * MyFileFilter("jpg", "JPEG Image Images"); - * - * Note that the "." before the extension is not needed. If provided, it will be - * ignored. - * - * @see #addExtension - */ - public MyFileFilter(String extension, String description) { - this(); - if (extension != null) - addExtension(extension); - if (description != null) - setDescription(description); - } - - /** - * Creates a file filter from the given string array. Example: new - * MyFileFilter(String {"gif", "jpg"}); - * - * Note that the "." before the extension is not needed adn will be ignored. - * - * @see #addExtension - */ - public MyFileFilter(String[] filters) { - this(filters, null); - } - - /** - * Creates a file filter from the given string array and description. Example: - * new MyFileFilter(String {"gif", "jpg"}, "Gif and JPG Images"); - * - * Note that the "." before the extension is not needed and will be ignored. - * - * @see #addExtension - */ - public MyFileFilter(String[] filters, String description) { - this(); - for (int i = 0; i < filters.length; i++) { - // add filters one by one - addExtension(filters[i]); - } - if (description != null) - setDescription(description); - } - - /** - * Return true if this file should be shown in the directory pane, false if it - * shouldn't. - * - * Files that begin with "." are ignored. - * - * @see #getExtension - * @see FileFilter#accepts - */ - public boolean accept(File f) { - if (f != null) { - if (f.isDirectory()) { - return true; - } - String extension = getExtension(f); - if (extension != null && filters.get(getExtension(f)) != null) { - return true; - } - ; - } - return false; - } - - /** - * Return the extension portion of the file's name . - * - * @see #getExtension - * @see FileFilter#accept - */ - public String getExtension(File f) { - if (f != null) { - String filename = f.getName(); - int i = filename.lastIndexOf('.'); - if (i > 0 && i < filename.length() - 1) { - return filename.substring(i + 1).toLowerCase(); - }; - } - return null; - } - - /** - * Adds a filetype "dot" extension to filter against. - * - * For example: the following code will create a filter that filters out all - * files except those that end in ".jpg" and ".tif": - * - * MyFileFilter filter = new MyFileFilter(); filter.addExtension("jpg"); - * filter.addExtension("tif"); - * - * Note that the "." before the extension is not needed and will be ignored. - */ - public void addExtension(String extension) { - if (filters == null) { - filters = new Hashtable(5); - } - filters.put(extension.toLowerCase(), this); - fullDescription = null; - } - - /** - * Returns the human readable description of this filter. For example: "JPEG and - * GIF Image Files (*.jpg, *.gif)" - * - * @see setDescription - * @see setExtensionListInDescription - * @see isExtensionListInDescription - * @see FileFilter#getDescription - */ - public String getDescription() { - if (fullDescription == null) { - if (description == null || isExtensionListInDescription()) { - fullDescription = description == null ? "(" : description + " ("; - // build the description from the extension list - Enumeration extensions = filters.keys(); - if (extensions != null) { - fullDescription += "." + (String) extensions.nextElement(); - while (extensions.hasMoreElements()) { - fullDescription += ", " + (String) extensions.nextElement(); - } - } - fullDescription += ")"; - } else { - fullDescription = description; - } - } - return fullDescription; - } - - /** - * Sets the human readable description of this filter. For example: - * filter.setDescription("Gif and JPG Images"); - * - * @see setDescription - * @see setExtensionListInDescription - * @see isExtensionListInDescription - */ - public void setDescription(String description) { - this.description = description; - fullDescription = null; - } - - /** - * Determines whether the extension list (.jpg, .gif, etc) should show up in the - * human readable description. - * - * Only relevent if a description was provided in the constructor or using - * setDescription(); - * - * @see getDescription - * @see setDescription - * @see isExtensionListInDescription - */ - public void setExtensionListInDescription(boolean b) { - useExtensionsInDescription = b; - fullDescription = null; - } - - /** - * Returns whether the extension list (.jpg, .gif, etc) should show up in the - * human readable description. - * - * Only relevent if a description was provided in the constructor or using - * setDescription(); - * - * @see getDescription - * @see setDescription - * @see setExtensionListInDescription - */ - public boolean isExtensionListInDescription() { - return useExtensionsInDescription; - } + @SuppressWarnings("unused") + private static String TYPE_UNKNOWN = "Type Unknown"; + + @SuppressWarnings("unused") + private static String HIDDEN_FILE = "Hidden File"; + + private Hashtable filters = null; + private String description = null; + private String fullDescription = null; + private boolean useExtensionsInDescription = true; + + /** + * Creates a file filter. If no filters are added, then all files are accepted. + * + * @see #addExtension + */ + public MyFileFilter() { + this.filters = new Hashtable(); + } + + /** + * Creates a file filter that accepts files with the given extension. Example: new + * MyFileFilter("jpg"); + * + * @see #addExtension + */ + public MyFileFilter(String extension) { + this(extension, null); + } + + /** + * Creates a file filter that accepts the given file type. Example: new MyFileFilter("jpg", "JPEG + * Image Images"); + * + *

    Note that the "." before the extension is not needed. If provided, it will be ignored. + * + * @see #addExtension + */ + public MyFileFilter(String extension, String description) { + this(); + if (extension != null) addExtension(extension); + if (description != null) setDescription(description); + } + + /** + * Creates a file filter from the given string array. Example: new MyFileFilter(String {"gif", + * "jpg"}); + * + *

    Note that the "." before the extension is not needed adn will be ignored. + * + * @see #addExtension + */ + public MyFileFilter(String[] filters) { + this(filters, null); + } + + /** + * Creates a file filter from the given string array and description. Example: new + * MyFileFilter(String {"gif", "jpg"}, "Gif and JPG Images"); + * + *

    Note that the "." before the extension is not needed and will be ignored. + * + * @see #addExtension + */ + public MyFileFilter(String[] filters, String description) { + this(); + for (int i = 0; i < filters.length; i++) { + // add filters one by one + addExtension(filters[i]); + } + if (description != null) setDescription(description); + } + + /** + * Return true if this file should be shown in the directory pane, false if it shouldn't. + * + *

    Files that begin with "." are ignored. + * + * @see #getExtension + * @see FileFilter#accepts + */ + public boolean accept(File f) { + if (f != null) { + if (f.isDirectory()) { + return true; + } + String extension = getExtension(f); + if (extension != null && filters.get(getExtension(f)) != null) { + return true; + } + ; + } + return false; + } + + /** + * Return the extension portion of the file's name . + * + * @see #getExtension + * @see FileFilter#accept + */ + public String getExtension(File f) { + if (f != null) { + String filename = f.getName(); + int i = filename.lastIndexOf('.'); + if (i > 0 && i < filename.length() - 1) { + return filename.substring(i + 1).toLowerCase(); + } + ; + } + return null; + } + + /** + * Adds a filetype "dot" extension to filter against. + * + *

    For example: the following code will create a filter that filters out all files except those + * that end in ".jpg" and ".tif": + * + *

    MyFileFilter filter = new MyFileFilter(); filter.addExtension("jpg"); + * filter.addExtension("tif"); + * + *

    Note that the "." before the extension is not needed and will be ignored. + */ + public void addExtension(String extension) { + if (filters == null) { + filters = new Hashtable(5); + } + filters.put(extension.toLowerCase(), this); + fullDescription = null; + } + + /** + * Returns the human readable description of this filter. For example: "JPEG and GIF Image Files + * (*.jpg, *.gif)" + * + * @see setDescription + * @see setExtensionListInDescription + * @see isExtensionListInDescription + * @see FileFilter#getDescription + */ + public String getDescription() { + if (fullDescription == null) { + if (description == null || isExtensionListInDescription()) { + fullDescription = description == null ? "(" : description + " ("; + // build the description from the extension list + Enumeration extensions = filters.keys(); + if (extensions != null) { + fullDescription += "." + (String) extensions.nextElement(); + while (extensions.hasMoreElements()) { + fullDescription += ", " + (String) extensions.nextElement(); + } + } + fullDescription += ")"; + } else { + fullDescription = description; + } + } + return fullDescription; + } + + /** + * Sets the human readable description of this filter. For example: filter.setDescription("Gif and + * JPG Images"); + * + * @see setDescription + * @see setExtensionListInDescription + * @see isExtensionListInDescription + */ + public void setDescription(String description) { + this.description = description; + fullDescription = null; + } + + /** + * Determines whether the extension list (.jpg, .gif, etc) should show up in the human readable + * description. + * + *

    Only relevent if a description was provided in the constructor or using setDescription(); + * + * @see getDescription + * @see setDescription + * @see isExtensionListInDescription + */ + public void setExtensionListInDescription(boolean b) { + useExtensionsInDescription = b; + fullDescription = null; + } + + /** + * Returns whether the extension list (.jpg, .gif, etc) should show up in the human readable + * description. + * + *

    Only relevent if a description was provided in the constructor or using setDescription(); + * + * @see getDescription + * @see setDescription + * @see setExtensionListInDescription + */ + public boolean isExtensionListInDescription() { + return useExtensionsInDescription; + } } diff --git a/ModuleSoundModem/src/main/java/org/josast/AX25/AX25DecodedData.java b/ModuleSoundModem/src/main/java/org/josast/AX25/AX25DecodedData.java index 224befcd3e47db52ff847d9b9a6ffb981bd1283a..f93a87007e05237d73ed64fdbcd9a9011a214150 100644 --- a/ModuleSoundModem/src/main/java/org/josast/AX25/AX25DecodedData.java +++ b/ModuleSoundModem/src/main/java/org/josast/AX25/AX25DecodedData.java @@ -1,44 +1,55 @@ package org.josast.AX25; -import org.josast.AX25.generated.Ax25frames; import io.kaitai.struct.ByteBufferKaitaiStream; +import org.josast.AX25.generated.Ax25frames; public class AX25DecodedData { - private Ax25frames ax25frames = null; - public String source; - private String destination; - private int PID; - private int destSSID; - private int srcSSID; - private int ctl; - - public AX25DecodedData(byte[] data) { - ax25frames = new Ax25frames(new ByteBufferKaitaiStream(data)); - source = ax25frames.ax25Frame().ax25Header().srcCallsignRaw().callsignRor().callsign(); - destination = ax25frames.ax25Frame().ax25Header().destCallsignRaw().callsignRor().callsign(); - PID = ax25frames.ax25Frame().pid(); - destSSID = ax25frames.ax25Frame().ax25Header().destSsidRaw().ssid(); - srcSSID = ax25frames.ax25Frame().ax25Header().srcSsidRaw().ssid(); - ctl = ax25frames.ax25Frame().ax25Header().ctl(); - - } - - public String toStringHeader() { - - String sep = "\r\n"; - return ("Source : " + source + " - SSID : " + srcSSID + sep + "Destination :" + destination + " - SSID : " - + destSSID + sep + "PID :" + PID + sep + " ctl : " + ctl + sep); - - } - - public String toStringData() { - StringBuffer buffer = new StringBuffer(); - byte[] bytes = ax25frames.ax25Frame().ax25Info(); - for (byte b : bytes) { - buffer.append(String.format("%02X ", b)); - } - return buffer.toString(); - } - + private Ax25frames ax25frames = null; + public String source; + private String destination; + private int PID; + private int destSSID; + private int srcSSID; + private int ctl; + + public AX25DecodedData(byte[] data) { + ax25frames = new Ax25frames(new ByteBufferKaitaiStream(data)); + source = ax25frames.ax25Frame().ax25Header().srcCallsignRaw().callsignRor().callsign(); + destination = ax25frames.ax25Frame().ax25Header().destCallsignRaw().callsignRor().callsign(); + PID = ax25frames.ax25Frame().pid(); + destSSID = ax25frames.ax25Frame().ax25Header().destSsidRaw().ssid(); + srcSSID = ax25frames.ax25Frame().ax25Header().srcSsidRaw().ssid(); + ctl = ax25frames.ax25Frame().ax25Header().ctl(); + } + + public String toStringHeader() { + + String sep = "\r\n"; + return ("Source : " + + source + + " - SSID : " + + srcSSID + + sep + + "Destination :" + + destination + + " - SSID : " + + destSSID + + sep + + "PID :" + + PID + + sep + + " ctl : " + + ctl + + sep); + } + + public String toStringData() { + StringBuffer buffer = new StringBuffer(); + byte[] bytes = ax25frames.ax25Frame().ax25Info(); + for (byte b : bytes) { + buffer.append(String.format("%02X ", b)); + } + return buffer.toString(); + } } diff --git a/ModuleSoundModem/src/main/java/org/josast/AX25/AX25Frame.java b/ModuleSoundModem/src/main/java/org/josast/AX25/AX25Frame.java index 65b6766f0e1fda2ab60b52f38ed764fec316f063..626db6ce09991723a7ce86fc0a45301244bfb493 100644 --- a/ModuleSoundModem/src/main/java/org/josast/AX25/AX25Frame.java +++ b/ModuleSoundModem/src/main/java/org/josast/AX25/AX25Frame.java @@ -2,125 +2,118 @@ package org.josast.AX25; @Deprecated public class AX25Frame { - - - public static final byte AX25 = 0; - public static final byte TXDELAY = 1; - public static final byte P = 2; - public static final byte SlotTime = 3; - public static final byte TXtail = 4; - public static final byte Fullduplex = 5; - public static final byte SetHardware = 6; - public static final byte Exit1 = (byte) 255; - public static final byte unknow = -1; - - byte[] rawData=null; - - - - Callsign from; - Callsign to; - Callsign [] repeater = new Callsign[8]; - char[] data; - byte controlID; - byte protocolID; - byte type; - -@Deprecated -public void decodeAX25Frame(byte[] frame, int lenght) -{ - int offset = 0; - rawData=frame; - to = decodeCalsign( frame,offset); - offset=offset+7; - from = decodeCalsign( frame,offset); - offset=offset+7; - int i=0; - boolean valid=true; - - while (valid) - { - if (frame[offset] !=0x03) - { - repeater[i]=decodeCalsign( frame,offset); - offset=offset+7; - i++; - } - else - { - valid=false; - } - if (i==8) - { - valid=false; - System.out.println("erreur de decodage"); - } - } - - controlID= frame[offset++]; - protocolID= frame[offset++]; - int datalengt = lenght-offset; - data = new char[datalengt]; - int j=0; - for ( j =0; j>1 & 0x7F); - - val[i] = c; - } - calsign.setCallsign(val); - calsign.setSsid((char)((arg0[6+offset]>>1) & 0xFF)); - return calsign; - } + public static final byte AX25 = 0; + public static final byte TXDELAY = 1; + public static final byte P = 2; + public static final byte SlotTime = 3; + public static final byte TXtail = 4; + public static final byte Fullduplex = 5; + public static final byte SetHardware = 6; + public static final byte Exit1 = (byte) 255; + public static final byte unknow = -1; -@Deprecated - public Callsign getFromClassign() { - return from; - } -@Deprecated - public String getData() - { - return String.valueOf(data); - } -@Deprecated - public String toString() - { - return "from : "+ from.toString()+" to : "+to.toString() +" data :"+ String.valueOf(data); + byte[] rawData = null; - } + Callsign from; + Callsign to; + Callsign[] repeater = new Callsign[8]; + char[] data; + byte controlID; + byte protocolID; + byte type; -@Deprecated -public String toStringHexa() { - // TODO Auto-generated method stub - return "string Hexa"; -} + @Deprecated + public void decodeAX25Frame(byte[] frame, int lenght) { + int offset = 0; + rawData = frame; + to = decodeCalsign(frame, offset); + offset = offset + 7; + from = decodeCalsign(frame, offset); + offset = offset + 7; + int i = 0; + boolean valid = true; -@Deprecated -public String toStringHeader() { - // TODO Auto-generated method stub - return "string Header"; -} -@Deprecated -public byte[] getRawData() { - return rawData; -} + while (valid) { + if (frame[offset] != 0x03) { + repeater[i] = decodeCalsign(frame, offset); + offset = offset + 7; + i++; + } else { + valid = false; + } + if (i == 8) { + valid = false; + System.out.println("erreur de decodage"); + } + } -@Deprecated -public void setRawData(byte[] rawData) { - this.rawData = rawData; -} + controlID = frame[offset++]; + protocolID = frame[offset++]; + int datalengt = lenght - offset; + data = new char[datalengt]; + int j = 0; + for (j = 0; j < datalengt; j++) { + data[j] = (char) frame[offset++]; + } + } + + @Deprecated + public Callsign decodeCalsign(byte[] arg0, int offset) { + + Callsign calsign = new Callsign(); + char[] val = new char[6]; + + for (int i = 0; i < 6; i++) { + + char c = (char) ((arg0[i + offset] & 0xFF) >> 1 & 0x7F); + + val[i] = c; + } + calsign.setCallsign(val); + calsign.setSsid((char) ((arg0[6 + offset] >> 1) & 0xFF)); + return calsign; + } + + @Deprecated + public Callsign getFromClassign() { + return from; + } + + @Deprecated + public String getData() { + return String.valueOf(data); + } + + @Deprecated + public String toString() { + return "from : " + + from.toString() + + " to : " + + to.toString() + + " data :" + + String.valueOf(data); + } + + @Deprecated + public String toStringHexa() { + // TODO Auto-generated method stub + return "string Hexa"; + } + + @Deprecated + public String toStringHeader() { + // TODO Auto-generated method stub + return "string Header"; + } + + @Deprecated + public byte[] getRawData() { + return rawData; + } + @Deprecated + public void setRawData(byte[] rawData) { + this.rawData = rawData; + } } diff --git a/ModuleSoundModem/src/main/java/org/josast/AX25/Callsign.java b/ModuleSoundModem/src/main/java/org/josast/AX25/Callsign.java index 2da29c653ef11d05883e3e9ca0f721bb8f211ed2..e17132b5f93569224880a816d52402f3c2e92ce2 100644 --- a/ModuleSoundModem/src/main/java/org/josast/AX25/Callsign.java +++ b/ModuleSoundModem/src/main/java/org/josast/AX25/Callsign.java @@ -1,43 +1,41 @@ package org.josast.AX25; + @Deprecated public class Callsign { - private char [] callsign= new char [6]; - private int ssid; - - @Deprecated - public Callsign() - { - - } - - @Deprecated - public String getCallsign() { - return String.valueOf(callsign); - } - @Deprecated - public void setCallsign(char[] callsign) { - this.callsign = callsign; - } - @Deprecated - public int getSsid() { - return ssid; - } - @Deprecated - public void setSsid(int ssid) { - this.ssid = ssid; - } - - @Deprecated - public String toString() - { - - return String.valueOf(callsign)+" SSID "+ssid; - - } - @Deprecated - public boolean isCallsign(String in) - { - return in.equals(String.valueOf(callsign)); - } -} + private char[] callsign = new char[6]; + private int ssid; + + @Deprecated + public Callsign() {} + + @Deprecated + public String getCallsign() { + return String.valueOf(callsign); + } + + @Deprecated + public void setCallsign(char[] callsign) { + this.callsign = callsign; + } + @Deprecated + public int getSsid() { + return ssid; + } + + @Deprecated + public void setSsid(int ssid) { + this.ssid = ssid; + } + + @Deprecated + public String toString() { + + return String.valueOf(callsign) + " SSID " + ssid; + } + + @Deprecated + public boolean isCallsign(String in) { + return in.equals(String.valueOf(callsign)); + } +} diff --git a/ModuleSoundModem/src/main/java/org/josast/AX25/KissData.java b/ModuleSoundModem/src/main/java/org/josast/AX25/KissData.java index 27b17b3a44bf06090581275cc7b56eb5b27ce6a6..7e3ad41b49a7a81040676ecb2d1154bede4861ec 100644 --- a/ModuleSoundModem/src/main/java/org/josast/AX25/KissData.java +++ b/ModuleSoundModem/src/main/java/org/josast/AX25/KissData.java @@ -1,46 +1,49 @@ package org.josast.AX25; import java.util.Arrays; + @Deprecated public class KissData { - - private byte [] data; - private int size=0; - - @Deprecated - public KissData(byte[] data, int size) { - super(); - this.data = Arrays.copyOf(data, size); - this.size = size; - } - - @Deprecated - public byte[] getData() { - return Arrays.copyOf(data, data.length); - } - @Deprecated - public void setData(byte[] data) { - this.data = Arrays.copyOf(data, data.length);; - } - @Deprecated - public int getSize() { - return size; - } - @Deprecated - public void setSize(int size) { - this.size = size; - } - @Deprecated - public String toString() { - - StringBuilder sb = new StringBuilder(); - for (int i=0; i= nb) { - endFrame = true; - } - - } - kissData = new KissData(contents, cptcontents); - return kissData; - + // identify frame + type = decodeKissType((byte) (frame[cpt++] & 0xFF)); + + // Extract data + while (!endFrame) { + + if (((int) frame[cpt] & 0xFF) == 0xDB) { + cpt++; + } + if (((int) frame[cpt] & 0xFF) == 0xDD) { + cpt++; + } + + if (((int) frame[cpt] & 0xFF) == 0xC0) { + endFrame = true; + } + contents[cptcontents++] = (byte) (frame[cpt++] & 0xFF); + + if (cpt >= nb) { + endFrame = true; + } } - + kissData = new KissData(contents, cptcontents); + return kissData; + } } diff --git a/ModuleSoundModem/src/main/java/org/josast/AX25/generated/Ax25frames.java b/ModuleSoundModem/src/main/java/org/josast/AX25/generated/Ax25frames.java index fc64746a025c941d3db7056146a2f11d3ffdc954..a8f264bfc9cd8ace3851de8bf7e131195958213b 100644 --- a/ModuleSoundModem/src/main/java/org/josast/AX25/generated/Ax25frames.java +++ b/ModuleSoundModem/src/main/java/org/josast/AX25/generated/Ax25frames.java @@ -3,229 +3,320 @@ package org.josast.AX25.generated; import io.kaitai.struct.ByteBufferKaitaiStream; -import io.kaitai.struct.KaitaiStruct; import io.kaitai.struct.KaitaiStream; +import io.kaitai.struct.KaitaiStruct; import java.io.IOException; import java.nio.charset.Charset; - /** - * :field dest_callsign: ax25_frame.ax25_header.dest_callsign_raw.callsign_ror.callsign - * :field src_callsign: ax25_frame.ax25_header.src_callsign_raw.callsign_ror.callsign - * :field src_ssid: ax25_frame.ax25_header.src_ssid_raw.ssid - * :field dest_ssid: ax25_frame.ax25_header.dest_ssid_raw.ssid - * :field ctl: ax25_frame.ax25_header.ctl - * :field pid: ax25_frame.pid - * :field pid: ax25_frame.ax25_info + * :field dest_callsign: ax25_frame.ax25_header.dest_callsign_raw.callsign_ror.callsign :field + * src_callsign: ax25_frame.ax25_header.src_callsign_raw.callsign_ror.callsign :field src_ssid: + * ax25_frame.ax25_header.src_ssid_raw.ssid :field dest_ssid: + * ax25_frame.ax25_header.dest_ssid_raw.ssid :field ctl: ax25_frame.ax25_header.ctl :field pid: + * ax25_frame.pid :field pid: ax25_frame.ax25_info */ public class Ax25frames extends KaitaiStruct { - public static Ax25frames fromFile(String fileName) throws IOException { - return new Ax25frames(new ByteBufferKaitaiStream(fileName)); + public static Ax25frames fromFile(String fileName) throws IOException { + return new Ax25frames(new ByteBufferKaitaiStream(fileName)); + } + + public Ax25frames(KaitaiStream _io) { + this(_io, null, null); + } + + public Ax25frames(KaitaiStream _io, KaitaiStruct _parent) { + this(_io, _parent, null); + } + + public Ax25frames(KaitaiStream _io, KaitaiStruct _parent, Ax25frames _root) { + super(_io); + this._parent = _parent; + this._root = _root == null ? this : _root; + _read(); + } + + private void _read() { + this.ax25Frame = new Ax25Frame(this._io, this, _root); + } + + public static class Ax25Frame extends KaitaiStruct { + public static Ax25Frame fromFile(String fileName) throws IOException { + return new Ax25Frame(new ByteBufferKaitaiStream(fileName)); + } + + public Ax25Frame(KaitaiStream _io) { + this(_io, null, null); + } + + public Ax25Frame(KaitaiStream _io, Ax25frames _parent) { + this(_io, _parent, null); + } + + public Ax25Frame(KaitaiStream _io, Ax25frames _parent, Ax25frames _root) { + super(_io); + this._parent = _parent; + this._root = _root; + _read(); + } + + private void _read() { + this.ax25Header = new Ax25Header(this._io, this, _root); + this.pid = this._io.readU1(); + this.ax25Info = this._io.readBytesFull(); + } + + private Ax25Header ax25Header; + private int pid; + private byte[] ax25Info; + private Ax25frames _root; + private Ax25frames _parent; + + public Ax25Header ax25Header() { + return ax25Header; + } + + public int pid() { + return pid; + } + + public byte[] ax25Info() { + return ax25Info; + } + + public Ax25frames _root() { + return _root; + } + + public Ax25frames _parent() { + return _parent; + } + } + + public static class Ax25Header extends KaitaiStruct { + public static Ax25Header fromFile(String fileName) throws IOException { + return new Ax25Header(new ByteBufferKaitaiStream(fileName)); + } + + public Ax25Header(KaitaiStream _io) { + this(_io, null, null); + } + + public Ax25Header(KaitaiStream _io, Ax25frames.Ax25Frame _parent) { + this(_io, _parent, null); + } + + public Ax25Header(KaitaiStream _io, Ax25frames.Ax25Frame _parent, Ax25frames _root) { + super(_io); + this._parent = _parent; + this._root = _root; + _read(); + } + + private void _read() { + this.destCallsignRaw = new CallsignRaw(this._io, this, _root); + this.destSsidRaw = new SsidMask(this._io, this, _root); + this.srcCallsignRaw = new CallsignRaw(this._io, this, _root); + this.srcSsidRaw = new SsidMask(this._io, this, _root); + this.ctl = this._io.readU1(); + } + + private CallsignRaw destCallsignRaw; + private SsidMask destSsidRaw; + private CallsignRaw srcCallsignRaw; + private SsidMask srcSsidRaw; + private int ctl; + private Ax25frames _root; + private Ax25frames.Ax25Frame _parent; + + public CallsignRaw destCallsignRaw() { + return destCallsignRaw; + } + + public SsidMask destSsidRaw() { + return destSsidRaw; + } + + public CallsignRaw srcCallsignRaw() { + return srcCallsignRaw; + } + + public SsidMask srcSsidRaw() { + return srcSsidRaw; + } + + public int ctl() { + return ctl; + } + + public Ax25frames _root() { + return _root; + } + + public Ax25frames.Ax25Frame _parent() { + return _parent; + } + } + + public static class Callsign extends KaitaiStruct { + public static Callsign fromFile(String fileName) throws IOException { + return new Callsign(new ByteBufferKaitaiStream(fileName)); } - public Ax25frames(KaitaiStream _io) { - this(_io, null, null); + public Callsign(KaitaiStream _io) { + this(_io, null, null); } - public Ax25frames(KaitaiStream _io, KaitaiStruct _parent) { - this(_io, _parent, null); + public Callsign(KaitaiStream _io, Ax25frames.CallsignRaw _parent) { + this(_io, _parent, null); } - public Ax25frames(KaitaiStream _io, KaitaiStruct _parent, Ax25frames _root) { - super(_io); - this._parent = _parent; - this._root = _root == null ? this : _root; - _read(); + public Callsign(KaitaiStream _io, Ax25frames.CallsignRaw _parent, Ax25frames _root) { + super(_io); + this._parent = _parent; + this._root = _root; + _read(); } + + private void _read() { + this.callsign = new String(this._io.readBytes(6), Charset.forName("ASCII")); + } + + private String callsign; + private Ax25frames _root; + private Ax25frames.CallsignRaw _parent; + + public String callsign() { + return callsign; + } + + public Ax25frames _root() { + return _root; + } + + public Ax25frames.CallsignRaw _parent() { + return _parent; + } + } + + public static class SsidMask extends KaitaiStruct { + public static SsidMask fromFile(String fileName) throws IOException { + return new SsidMask(new ByteBufferKaitaiStream(fileName)); + } + + public SsidMask(KaitaiStream _io) { + this(_io, null, null); + } + + public SsidMask(KaitaiStream _io, Ax25frames.Ax25Header _parent) { + this(_io, _parent, null); + } + + public SsidMask(KaitaiStream _io, Ax25frames.Ax25Header _parent, Ax25frames _root) { + super(_io); + this._parent = _parent; + this._root = _root; + _read(); + } + + private void _read() { + this.ssidMask = this._io.readU1(); + } + + private Integer ssid; + + public Integer ssid() { + if (this.ssid != null) return this.ssid; + int _tmp = (int) (((ssidMask() & 15) >> 1)); + this.ssid = _tmp; + return this.ssid; + } + + private int ssidMask; + private Ax25frames _root; + private Ax25frames.Ax25Header _parent; + + public int ssidMask() { + return ssidMask; + } + + public Ax25frames _root() { + return _root; + } + + public Ax25frames.Ax25Header _parent() { + return _parent; + } + } + + public static class CallsignRaw extends KaitaiStruct { + public static CallsignRaw fromFile(String fileName) throws IOException { + return new CallsignRaw(new ByteBufferKaitaiStream(fileName)); + } + + public CallsignRaw(KaitaiStream _io) { + this(_io, null, null); + } + + public CallsignRaw(KaitaiStream _io, Ax25frames.Ax25Header _parent) { + this(_io, _parent, null); + } + + public CallsignRaw(KaitaiStream _io, Ax25frames.Ax25Header _parent, Ax25frames _root) { + super(_io); + this._parent = _parent; + this._root = _root; + _read(); + } + private void _read() { - this.ax25Frame = new Ax25Frame(this._io, this, _root); - } - public static class Ax25Frame extends KaitaiStruct { - public static Ax25Frame fromFile(String fileName) throws IOException { - return new Ax25Frame(new ByteBufferKaitaiStream(fileName)); - } - - public Ax25Frame(KaitaiStream _io) { - this(_io, null, null); - } - - public Ax25Frame(KaitaiStream _io, Ax25frames _parent) { - this(_io, _parent, null); - } - - public Ax25Frame(KaitaiStream _io, Ax25frames _parent, Ax25frames _root) { - super(_io); - this._parent = _parent; - this._root = _root; - _read(); - } - private void _read() { - this.ax25Header = new Ax25Header(this._io, this, _root); - this.pid = this._io.readU1(); - this.ax25Info = this._io.readBytesFull(); - } - private Ax25Header ax25Header; - private int pid; - private byte[] ax25Info; - private Ax25frames _root; - private Ax25frames _parent; - public Ax25Header ax25Header() { return ax25Header; } - public int pid() { return pid; } - public byte[] ax25Info() { return ax25Info; } - public Ax25frames _root() { return _root; } - public Ax25frames _parent() { return _parent; } - } - public static class Ax25Header extends KaitaiStruct { - public static Ax25Header fromFile(String fileName) throws IOException { - return new Ax25Header(new ByteBufferKaitaiStream(fileName)); - } - - public Ax25Header(KaitaiStream _io) { - this(_io, null, null); - } - - public Ax25Header(KaitaiStream _io, Ax25frames.Ax25Frame _parent) { - this(_io, _parent, null); - } - - public Ax25Header(KaitaiStream _io, Ax25frames.Ax25Frame _parent, Ax25frames _root) { - super(_io); - this._parent = _parent; - this._root = _root; - _read(); - } - private void _read() { - this.destCallsignRaw = new CallsignRaw(this._io, this, _root); - this.destSsidRaw = new SsidMask(this._io, this, _root); - this.srcCallsignRaw = new CallsignRaw(this._io, this, _root); - this.srcSsidRaw = new SsidMask(this._io, this, _root); - this.ctl = this._io.readU1(); - } - private CallsignRaw destCallsignRaw; - private SsidMask destSsidRaw; - private CallsignRaw srcCallsignRaw; - private SsidMask srcSsidRaw; - private int ctl; - private Ax25frames _root; - private Ax25frames.Ax25Frame _parent; - public CallsignRaw destCallsignRaw() { return destCallsignRaw; } - public SsidMask destSsidRaw() { return destSsidRaw; } - public CallsignRaw srcCallsignRaw() { return srcCallsignRaw; } - public SsidMask srcSsidRaw() { return srcSsidRaw; } - public int ctl() { return ctl; } - public Ax25frames _root() { return _root; } - public Ax25frames.Ax25Frame _parent() { return _parent; } - } - public static class Callsign extends KaitaiStruct { - public static Callsign fromFile(String fileName) throws IOException { - return new Callsign(new ByteBufferKaitaiStream(fileName)); - } - - public Callsign(KaitaiStream _io) { - this(_io, null, null); - } - - public Callsign(KaitaiStream _io, Ax25frames.CallsignRaw _parent) { - this(_io, _parent, null); - } - - public Callsign(KaitaiStream _io, Ax25frames.CallsignRaw _parent, Ax25frames _root) { - super(_io); - this._parent = _parent; - this._root = _root; - _read(); - } - private void _read() { - this.callsign = new String(this._io.readBytes(6), Charset.forName("ASCII")); - } - private String callsign; - private Ax25frames _root; - private Ax25frames.CallsignRaw _parent; - public String callsign() { return callsign; } - public Ax25frames _root() { return _root; } - public Ax25frames.CallsignRaw _parent() { return _parent; } - } - public static class SsidMask extends KaitaiStruct { - public static SsidMask fromFile(String fileName) throws IOException { - return new SsidMask(new ByteBufferKaitaiStream(fileName)); - } - - public SsidMask(KaitaiStream _io) { - this(_io, null, null); - } - - public SsidMask(KaitaiStream _io, Ax25frames.Ax25Header _parent) { - this(_io, _parent, null); - } - - public SsidMask(KaitaiStream _io, Ax25frames.Ax25Header _parent, Ax25frames _root) { - super(_io); - this._parent = _parent; - this._root = _root; - _read(); - } - private void _read() { - this.ssidMask = this._io.readU1(); - } - private Integer ssid; - public Integer ssid() { - if (this.ssid != null) - return this.ssid; - int _tmp = (int) (((ssidMask() & 15) >> 1)); - this.ssid = _tmp; - return this.ssid; - } - private int ssidMask; - private Ax25frames _root; - private Ax25frames.Ax25Header _parent; - public int ssidMask() { return ssidMask; } - public Ax25frames _root() { return _root; } - public Ax25frames.Ax25Header _parent() { return _parent; } - } - public static class CallsignRaw extends KaitaiStruct { - public static CallsignRaw fromFile(String fileName) throws IOException { - return new CallsignRaw(new ByteBufferKaitaiStream(fileName)); - } - - public CallsignRaw(KaitaiStream _io) { - this(_io, null, null); - } - - public CallsignRaw(KaitaiStream _io, Ax25frames.Ax25Header _parent) { - this(_io, _parent, null); - } - - public CallsignRaw(KaitaiStream _io, Ax25frames.Ax25Header _parent, Ax25frames _root) { - super(_io); - this._parent = _parent; - this._root = _root; - _read(); - } - private void _read() { - this._raw__raw_callsignRor = this._io.readBytes(6); - this._raw_callsignRor = KaitaiStream.processRotateLeft(this._raw__raw_callsignRor, 8 - (1), 1); - KaitaiStream _io__raw_callsignRor = new ByteBufferKaitaiStream(_raw_callsignRor); - this.callsignRor = new Callsign(_io__raw_callsignRor, this, _root); - } - private Callsign callsignRor; - private Ax25frames _root; - private Ax25frames.Ax25Header _parent; - private byte[] _raw__raw_callsignRor; - private byte[] _raw_callsignRor; - public Callsign callsignRor() { return callsignRor; } - public Ax25frames _root() { return _root; } - public Ax25frames.Ax25Header _parent() { return _parent; } - public byte[] _raw__raw_callsignRor() { return _raw__raw_callsignRor; } - public byte[] _raw_callsignRor() { return _raw_callsignRor; } - } - private Ax25Frame ax25Frame; + this._raw__raw_callsignRor = this._io.readBytes(6); + this._raw_callsignRor = + KaitaiStream.processRotateLeft(this._raw__raw_callsignRor, 8 - (1), 1); + KaitaiStream _io__raw_callsignRor = new ByteBufferKaitaiStream(_raw_callsignRor); + this.callsignRor = new Callsign(_io__raw_callsignRor, this, _root); + } + + private Callsign callsignRor; private Ax25frames _root; - private KaitaiStruct _parent; - - /** - * @see Source - */ - public Ax25Frame ax25Frame() { return ax25Frame; } - public Ax25frames _root() { return _root; } - public KaitaiStruct _parent() { return _parent; } + private Ax25frames.Ax25Header _parent; + private byte[] _raw__raw_callsignRor; + private byte[] _raw_callsignRor; + + public Callsign callsignRor() { + return callsignRor; + } + + public Ax25frames _root() { + return _root; + } + + public Ax25frames.Ax25Header _parent() { + return _parent; + } + + public byte[] _raw__raw_callsignRor() { + return _raw__raw_callsignRor; + } + + public byte[] _raw_callsignRor() { + return _raw_callsignRor; + } + } + + private Ax25Frame ax25Frame; + private Ax25frames _root; + private KaitaiStruct _parent; + + /** @see Source */ + public Ax25Frame ax25Frame() { + return ax25Frame; + } + + public Ax25frames _root() { + return _root; + } + + public KaitaiStruct _parent() { + return _parent; + } } diff --git a/ModuleSoundModem/src/main/java/org/josast/ModuleSoundModem/KissException.java b/ModuleSoundModem/src/main/java/org/josast/ModuleSoundModem/KissException.java index b189fd88ffe71d86a1bf26489a1651e5f7551f19..e8c20855c9179f69bc446541c7529f9775ca9e96 100644 --- a/ModuleSoundModem/src/main/java/org/josast/ModuleSoundModem/KissException.java +++ b/ModuleSoundModem/src/main/java/org/josast/ModuleSoundModem/KissException.java @@ -1,60 +1,50 @@ -/** - * - */ +/** */ package org.josast.ModuleSoundModem; -/** - * @author christophe - * - */ +/** @author christophe */ public class KissException extends Exception { - /**. - * - */ - private static final long serialVersionUID = 7103474292775784017L; - - /**. - * - */ - public KissException() { - // TODO Auto-generated constructor stub - } - - /** - * @param message - */ - public KissException(final String message) { - super(message); - // TODO Auto-generated constructor stub - } - - /** - * @param cause - */ - public KissException(final Throwable cause) { - super(cause); - // TODO Auto-generated constructor stub - } - - /** - * @param message - * @param cause - */ - public KissException(final String message, final Throwable cause) { - super(message, cause); - // TODO Auto-generated constructor stub - } - - /** - * @param message - * @param cause - * @param enableSuppression - * @param writableStackTrace - */ - public KissException(final String message, final Throwable cause, final boolean enableSuppression, final boolean writableStackTrace) { - super(message, cause, enableSuppression, writableStackTrace); - // TODO Auto-generated constructor stub - } - + /** . */ + private static final long serialVersionUID = 7103474292775784017L; + + /** . */ + public KissException() { + // TODO Auto-generated constructor stub + } + + /** @param message */ + public KissException(final String message) { + super(message); + // TODO Auto-generated constructor stub + } + + /** @param cause */ + public KissException(final Throwable cause) { + super(cause); + // TODO Auto-generated constructor stub + } + + /** + * @param message + * @param cause + */ + public KissException(final String message, final Throwable cause) { + super(message, cause); + // TODO Auto-generated constructor stub + } + + /** + * @param message + * @param cause + * @param enableSuppression + * @param writableStackTrace + */ + public KissException( + final String message, + final Throwable cause, + final boolean enableSuppression, + final boolean writableStackTrace) { + super(message, cause, enableSuppression, writableStackTrace); + // TODO Auto-generated constructor stub + } } diff --git a/ModuleSoundModem/src/main/java/org/josast/ModuleSoundModem/SoundModemCli.java b/ModuleSoundModem/src/main/java/org/josast/ModuleSoundModem/SoundModemCli.java index ae628d083715da7415f308a25006aaa12ea9b5bf..3ed0293eb8c6494cebeaa3cffe1c7f1068675270 100644 --- a/ModuleSoundModem/src/main/java/org/josast/ModuleSoundModem/SoundModemCli.java +++ b/ModuleSoundModem/src/main/java/org/josast/ModuleSoundModem/SoundModemCli.java @@ -1,6 +1,4 @@ -/** - * - */ +/** */ package org.josast.ModuleSoundModem; import java.io.IOException; @@ -8,7 +6,6 @@ import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.Paths; import java.util.logging.Logger; - import org.apache.commons.cli.CommandLine; import org.apache.commons.cli.CommandLineParser; import org.apache.commons.cli.DefaultParser; @@ -17,200 +14,164 @@ import org.apache.commons.cli.Option; import org.apache.commons.cli.Options; import org.apache.commons.cli.ParseException; -/** - * @author christophe - * - */ +/** @author christophe */ public class SoundModemCli { - private Logger log = Logger.getLogger("AmsatLogger"); - private static String version = "0.2"; - private String configurationfile = "defaultConfigFile.ini"; - /* - * Utilisation d'un répertoire par défaut - */ - private String generateRepository = "SoundModemOuput"; - - /** - * - */ - public SoundModemCli() { - - } - - public String getConfigurationfile() { - return configurationfile; - } - - public void setConfigurationfile(String configurationfile) { - this.configurationfile = configurationfile; - } - - public String getGenerateRepository() { - return generateRepository; - } - - public void setGenerateRepository(String generateRepository) { - this.generateRepository = generateRepository; - } - - private static Options configParameters() { - - final Option versionOption = Option.builder("V") - - .longOpt("Version") // - - .desc("Return application version") - - .hasArg(false) - - .required(false) - - .build(); - - final Option configFileOption = Option.builder("C") - - .longOpt("Config") // - - .desc("Return application version") - - .hasArg(true) - - .argName("configFile") - - .required(false) - - .build(); - - final Option generateFileOption = Option.builder("G") - - .longOpt("Generate") // - - .desc("generate binary file for each frame received") - - .hasArg(true) - - .argName("GenerateRepository") - - .required(false) - - .build(); - - final Option helpFileOption = Option.builder("h") - - .longOpt("help") - - .desc("display help message") - - .build(); - - final Options options = new Options(); + private Logger log = Logger.getLogger("AmsatLogger"); + private static String version = "0.2"; + private String configurationfile = "defaultConfigFile.ini"; + /* + * Utilisation d'un répertoire par défaut + */ + private String generateRepository = "SoundModemOuput"; + + /** */ + public SoundModemCli() {} + + public String getConfigurationfile() { + return configurationfile; + } - options.addOption(versionOption); + public void setConfigurationfile(String configurationfile) { + this.configurationfile = configurationfile; + } - options.addOption(configFileOption); + public String getGenerateRepository() { + return generateRepository; + } - options.addOption(generateFileOption); + public void setGenerateRepository(String generateRepository) { + this.generateRepository = generateRepository; + } - options.addOption(helpFileOption); + private static Options configParameters() { - return options; + final Option versionOption = + Option.builder("V") + .longOpt("Version") // + .desc("Return application version") + .hasArg(false) + .required(false) + .build(); - } + final Option configFileOption = + Option.builder("C") + .longOpt("Config") // + .desc("Return application version") + .hasArg(true) + .argName("configFile") + .required(false) + .build(); - public void execute() { + final Option generateFileOption = + Option.builder("G") + .longOpt("Generate") // + .desc("generate binary file for each frame received") + .hasArg(true) + .argName("GenerateRepository") + .required(false) + .build(); - // use soudmodem configuration file + final Option helpFileOption = + Option.builder("h").longOpt("help").desc("display help message").build(); - SoundModemClient sm = new SoundModemClient(configurationfile); + final Options options = new Options(); - // tant que connecté à SoundModem => reçoit des trames - int cpt = 0; - Path path = Paths.get(generateRepository); - //if directory exists? - if (!Files.exists(path)) { - try { - Files.createDirectories(path); - } catch (IOException e) { - //fail to create directory - e.printStackTrace(); - } - } + options.addOption(versionOption); + options.addOption(configFileOption); - while (true) { + options.addOption(generateFileOption); + options.addOption(helpFileOption); - byte[] temp = sm.receivedKissData(); + return options; + } + public void execute() { - try { - Files.write(Paths.get(generateRepository + "\\Frame_" + cpt++ + ".bin"), temp); - } catch (IOException e) { - log.severe(e.toString()); - } - System.out.println("compteur" + cpt++); - } + // use soudmodem configuration file - } + SoundModemClient sm = new SoundModemClient(configurationfile); - /** - * @param args - * @throws ParseException - */ - public static void main(String[] args) throws ParseException { + // tant que connecté à SoundModem => reçoit des trames + int cpt = 0; + Path path = Paths.get(generateRepository); + // if directory exists? + if (!Files.exists(path)) { + try { + Files.createDirectories(path); + } catch (IOException e) { + // fail to create directory + e.printStackTrace(); + } + } - final Options options = configParameters(); + while (true) { - final CommandLineParser parser = new DefaultParser(); + byte[] temp = sm.receivedKissData(); - final CommandLine line = parser.parse(options, args); + try { + Files.write(Paths.get(generateRepository + "\\Frame_" + cpt++ + ".bin"), temp); + } catch (IOException e) { + log.severe(e.toString()); + } + System.out.println("compteur" + cpt++); + } + } - SoundModemCli smc = new SoundModemCli(); - - System.out.println(SoundModemCli.class.getSimpleName() + " " + version); + /** + * @param args + * @throws ParseException + */ + public static void main(String[] args) throws ParseException { - // Si mode aide + final Options options = configParameters(); - boolean helpMode = line.hasOption("help"); + final CommandLineParser parser = new DefaultParser(); - if (helpMode) { + final CommandLine line = parser.parse(options, args); - final HelpFormatter formatter = new HelpFormatter(); + SoundModemCli smc = new SoundModemCli(); - formatter.printHelp(args[0], options, true); + System.out.println(SoundModemCli.class.getSimpleName() + " " + version); - System.exit(0); + // Si mode aide - } + boolean helpMode = line.hasOption("help"); - boolean versionpMode = line.hasOption("Version"); + if (helpMode) { - if (versionpMode) { + final HelpFormatter formatter = new HelpFormatter(); - System.out.println(SoundModemCli.class.getSimpleName() + " " + version); + formatter.printHelp(args[0], options, true); - System.exit(0); + System.exit(0); + } - } + boolean versionpMode = line.hasOption("Version"); - boolean configMode = line.hasOption("Config"); + if (versionpMode) { - if (configMode) { + System.out.println(SoundModemCli.class.getSimpleName() + " " + version); - smc.setConfigurationfile(line.getOptionValue("Config", "")); + System.exit(0); + } - } + boolean configMode = line.hasOption("Config"); - boolean generateMode = line.hasOption("Generate"); + if (configMode) { - if (generateMode) { + smc.setConfigurationfile(line.getOptionValue("Config", "")); + } - smc.setGenerateRepository(line.getOptionValue("Generate", "")); + boolean generateMode = line.hasOption("Generate"); - } + if (generateMode) { - smc.execute(); - } + smc.setGenerateRepository(line.getOptionValue("Generate", "")); + } + smc.execute(); + } } diff --git a/ModuleSoundModem/src/main/java/org/josast/ModuleSoundModem/SoundModemClient.java b/ModuleSoundModem/src/main/java/org/josast/ModuleSoundModem/SoundModemClient.java index 74fd3dce50fba940570d01721bdcf0798618b219..3517b82cbdc65b2b3e03aa4438416606b32c835c 100644 --- a/ModuleSoundModem/src/main/java/org/josast/ModuleSoundModem/SoundModemClient.java +++ b/ModuleSoundModem/src/main/java/org/josast/ModuleSoundModem/SoundModemClient.java @@ -12,209 +12,193 @@ import java.util.Arrays; import java.util.Date; import java.util.logging.Level; import java.util.logging.Logger; - import org.josast.AX25.AX25Frame; import org.josast.AX25.KissData; import org.josast.AX25.KissFrame; public class SoundModemClient { - private Logger log = Logger.getLogger("AmsatLogger"); - - private SoundModemConfiguration smConfiguration = null; - private Socket skt = null; - private InputStream in = null; - private boolean open = false; - private int bufferSize = 1024; - private Path filepath; - - /** - * Initialise connection to soundmodem application with default value - * - */ - public SoundModemClient() { - - smConfiguration = new SoundModemConfiguration("defaultConfigFile.ini"); - openSocket(); - initialiseFile(); - } - - /** - * Initialise connection to soundmodem application with configuration - * - */ - public SoundModemClient(final SoundModemConfiguration smConfig) { - - smConfiguration = smConfig; - openSocket(); - initialiseFile(); - - } - - /**. - * Initialise connection to soundmodem application with configuration file - * - */ - public SoundModemClient(final String filename) { - - smConfiguration = new SoundModemConfiguration(filename); - openSocket(); - initialiseFile(); - - } - - private void openSocket() { - - try { - skt = new Socket(smConfiguration.getSmIPadress(), smConfiguration.getSmPort()); - in = skt.getInputStream(); - open = true; - } catch (IOException e) { - log.log(Level.SEVERE, "create stream " + e.toString()); - open = false; - } - - } - - private void initialiseFile() { - - if (smConfiguration.isSmGenerateBinarieFile()) { - - Path path = Paths.get(smConfiguration.getSmBinarieOutputDirectory()); - // if directory exists? - if (!Files.exists(path)) { - try { - Files.createDirectories(path); - } catch (IOException e) { - log.log(Level.SEVERE, "cannot create outpout directorie " + e.toString()); - } - } - - String creationdate = ""; - if (smConfiguration.isSmBinarieFilePrefixDate()) { - SimpleDateFormat formater = new SimpleDateFormat("yyyy-MM-dd-HHmmss"); - Date aujourdhui = new Date(); - creationdate = formater.format(aujourdhui) + "-"; - } - - filepath = Paths.get(smConfiguration.getSmBinarieOutputDirectory() + "\\" + creationdate - + smConfiguration.getSmBinarieOutputFile()); - byte[] temp = new byte[] {}; - try { - Files.write(filepath, temp); - } catch (IOException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - - } - - } - - /**. - * wait bytes from sound modem - * - * @return bytes received in KISS format - */ - public byte[] receivedKissData() { - byte[] cbuf = new byte[bufferSize]; - int nbbyteread = 0; - if (this.open) { - - try { - nbbyteread = in.read(cbuf); - - } catch (IOException e) { - - log.log(Level.SEVERE, "Error Read data " + e.toString()); - try { - in.close(); - } catch (IOException e1) { - log.log(Level.SEVERE, "Closing " + e1.toString()); - } - } - - byte[] temp = Arrays.copyOf(cbuf, nbbyteread); - - if (smConfiguration.isSmGenerateBinarieFile()) { - - try { - Files.write(filepath, temp, StandardOpenOption.APPEND); - } catch (IOException e) { - log.severe(e.toString()); - } - - } - return Arrays.copyOf(cbuf, nbbyteread); - } else { - log.severe("Connection not open, return null"); - return null; - } - } - - @Deprecated - public int receiveData(final byte[] cbuf) { - try { - return in.read(cbuf); - } catch (IOException e) { - - log.log(Level.SEVERE, "Error Read data " + e.toString()); - - try { - in.close(); - } catch (IOException e1) { - log.log(Level.SEVERE, "Closing " + e1.toString()); - } - } - return 0; - - } - - @Deprecated - public AX25Frame decode(final byte[] frame, final int nb) { - - KissFrame kf = new KissFrame(); - KissData kissData = kf.extactMessage(frame, nb); - -// if (type==kf.AX25) -// { - AX25Frame ax = new AX25Frame(); - ax.decodeAX25Frame(kissData.getData(), kissData.getSize()); -// } - System.out.println(kissData.toString()); - System.out.println(ax.toString()); - return ax; - - } - - public void close() { - try { - in.close(); - } catch (IOException e1) { - log.log(Level.SEVERE, "Closing " + e1.toString()); - } - } - - public boolean isOpen() { - return open; - } - - public byte[] receivedRawData() { - byte[] temp = receivedKissData(); - if (temp != null) { - - kiss k = new kiss(temp); - try { - temp = k.toRaw(); - } catch (KissException e) { - log.log(Level.SEVERE, "Extract Raw data " + e.toString()); - } - return temp; - } - else { - log.severe("Buffer read null, return null"); - return null; - } - } - + private Logger log = Logger.getLogger("AmsatLogger"); + + private SoundModemConfiguration smConfiguration = null; + private Socket skt = null; + private InputStream in = null; + private boolean open = false; + private int bufferSize = 1024; + private Path filepath; + + /** Initialise connection to soundmodem application with default value */ + public SoundModemClient() { + + smConfiguration = new SoundModemConfiguration("defaultConfigFile.ini"); + openSocket(); + initialiseFile(); + } + + /** Initialise connection to soundmodem application with configuration */ + public SoundModemClient(final SoundModemConfiguration smConfig) { + + smConfiguration = smConfig; + openSocket(); + initialiseFile(); + } + + /** . Initialise connection to soundmodem application with configuration file */ + public SoundModemClient(final String filename) { + + smConfiguration = new SoundModemConfiguration(filename); + openSocket(); + initialiseFile(); + } + + private void openSocket() { + + try { + skt = new Socket(smConfiguration.getSmIPadress(), smConfiguration.getSmPort()); + in = skt.getInputStream(); + open = true; + } catch (IOException e) { + log.log(Level.SEVERE, "create stream " + e.toString()); + open = false; + } + } + + private void initialiseFile() { + + if (smConfiguration.isSmGenerateBinarieFile()) { + + Path path = Paths.get(smConfiguration.getSmBinarieOutputDirectory()); + // if directory exists? + if (!Files.exists(path)) { + try { + Files.createDirectories(path); + } catch (IOException e) { + log.log(Level.SEVERE, "cannot create outpout directorie " + e.toString()); + } + } + + String creationdate = ""; + if (smConfiguration.isSmBinarieFilePrefixDate()) { + SimpleDateFormat formater = new SimpleDateFormat("yyyy-MM-dd-HHmmss"); + Date aujourdhui = new Date(); + creationdate = formater.format(aujourdhui) + "-"; + } + + filepath = + Paths.get( + smConfiguration.getSmBinarieOutputDirectory() + + "\\" + + creationdate + + smConfiguration.getSmBinarieOutputFile()); + byte[] temp = new byte[] {}; + try { + Files.write(filepath, temp); + } catch (IOException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } + } + + /** + * . wait bytes from sound modem + * + * @return bytes received in KISS format + */ + public byte[] receivedKissData() { + byte[] cbuf = new byte[bufferSize]; + int nbbyteread = 0; + if (this.open) { + + try { + nbbyteread = in.read(cbuf); + + } catch (IOException e) { + + log.log(Level.SEVERE, "Error Read data " + e.toString()); + try { + in.close(); + } catch (IOException e1) { + log.log(Level.SEVERE, "Closing " + e1.toString()); + } + } + + byte[] temp = Arrays.copyOf(cbuf, nbbyteread); + + if (smConfiguration.isSmGenerateBinarieFile()) { + + try { + Files.write(filepath, temp, StandardOpenOption.APPEND); + } catch (IOException e) { + log.severe(e.toString()); + } + } + return Arrays.copyOf(cbuf, nbbyteread); + } else { + log.severe("Connection not open, return null"); + return null; + } + } + + @Deprecated + public int receiveData(final byte[] cbuf) { + try { + return in.read(cbuf); + } catch (IOException e) { + + log.log(Level.SEVERE, "Error Read data " + e.toString()); + + try { + in.close(); + } catch (IOException e1) { + log.log(Level.SEVERE, "Closing " + e1.toString()); + } + } + return 0; + } + + @Deprecated + public AX25Frame decode(final byte[] frame, final int nb) { + + KissFrame kf = new KissFrame(); + KissData kissData = kf.extactMessage(frame, nb); + + // if (type==kf.AX25) + // { + AX25Frame ax = new AX25Frame(); + ax.decodeAX25Frame(kissData.getData(), kissData.getSize()); + // } + System.out.println(kissData.toString()); + System.out.println(ax.toString()); + return ax; + } + + public void close() { + try { + in.close(); + } catch (IOException e1) { + log.log(Level.SEVERE, "Closing " + e1.toString()); + } + } + + public boolean isOpen() { + return open; + } + + public byte[] receivedRawData() { + byte[] temp = receivedKissData(); + if (temp != null) { + + kiss k = new kiss(temp); + try { + temp = k.toRaw(); + } catch (KissException e) { + log.log(Level.SEVERE, "Extract Raw data " + e.toString()); + } + return temp; + } else { + log.severe("Buffer read null, return null"); + return null; + } + } } diff --git a/ModuleSoundModem/src/main/java/org/josast/ModuleSoundModem/SoundModemConfiguration.java b/ModuleSoundModem/src/main/java/org/josast/ModuleSoundModem/SoundModemConfiguration.java index 90b62b0c198c45a9715717e1288a73168aa07979..cda0fd49c078f98f0a00034ae06f72fd3e749c97 100644 --- a/ModuleSoundModem/src/main/java/org/josast/ModuleSoundModem/SoundModemConfiguration.java +++ b/ModuleSoundModem/src/main/java/org/josast/ModuleSoundModem/SoundModemConfiguration.java @@ -1,170 +1,125 @@ package org.josast.ModuleSoundModem; import java.util.logging.Logger; - import org.josast.property.CONFIG; import org.josast.property.ConfigObject; -/** - * @author Christophe - * - */ -/** - * @author christophe - * - */ -/** - * @author christophe - * - */ -/** - * @author christophe - * - */ -/** - * @author christophe - * - */ -/** - * @author christophe - * - */ -/** - * @author christophe - * - */ +/** @author Christophe */ +/** @author christophe */ +/** @author christophe */ +/** @author christophe */ +/** @author christophe */ +/** @author christophe */ +/** @author christophe */ public class SoundModemConfiguration extends ConfigObject { - private Logger log = Logger.getLogger("AmsatLogger"); - - /** Default IP Adress. */ - private String smIPadress = "localhost"; - /** Default port. */ - private int smPort = 8100; - private boolean smGenerateBinarieFile = false; - private String smBinarieOutputFile = "soundmodem.bin"; - private String smBinarieOutputDirectory = "SoundModemOuput"; - - private boolean smBinarieFilePrefixDate = false; - - protected CONFIG configFile = CONFIG.getInstance(); - - /** - * @param configFilename - */ - public SoundModemConfiguration(final String configFilename) { - super(configFilename); - // vérifie si la propriété est dans le fichier - String temp = configFile.getProperty("smPort"); - - if (temp == null) { - // config file not initialised - initialisePropertiesFile(); - log.severe( - "properties file not initialised - a file is created with properties with defaults value"); - System.out.println( - "config file does not content required properties \n the file " - + configFilename - + " has been set up with properties to configure"); - - } else { - initialiseFromProperties(); - } - - } - - private void initialisePropertiesFile() { - configFile.setProperty("smIPadress", smIPadress); - configFile.setProperty("smPort", "" + smPort); - configFile.setProperty("smGenerateBinarieFile", - "" + smGenerateBinarieFile); - configFile.setProperty("smBinarieOutputFile", smBinarieOutputFile); - configFile.setProperty("smBinarieOutputFile", smBinarieOutputDirectory); - configFile.setProperty("smBinarieFilePrefixDate", - "" + smBinarieFilePrefixDate); - - } - - private void initialiseFromProperties() { - smIPadress = configFile.getProperty("smIPadress"); - smPort = Integer.parseInt(configFile.getProperty("smPort")); - smGenerateBinarieFile = Boolean - .parseBoolean(configFile.getProperty("smGenerateBinarieFile")); - smBinarieOutputFile = configFile.getProperty("smBinarieOutputFile"); - smBinarieOutputDirectory = configFile - .getProperty("smBinarieOutputDirectory"); - smBinarieFilePrefixDate = Boolean.parseBoolean( - configFile.getProperty("smBinarieFilePrefixDate")); - - } - - /** - * @return IP adress - */ - public String getSmIPadress() { - return smIPadress; - } - - /** - * @param iPadress - */ - public void setSmIPadress(final String iPadress) { - smIPadress = iPadress; - } - - /** - * @return Port - */ - public int getSmPort() { - return smPort; - } - - public void setSmPort(final int port) { - this.smPort = port; - } - - public String toString() { - return smIPadress + ":" + smPort; - } - /** - * @return GenerateBinarieFile - */ - public boolean isSmGenerateBinarieFile() { - return smGenerateBinarieFile; - } - - public void setSmGenerateBinarieFile(final boolean smGenerateBinarieFile) { - this.smGenerateBinarieFile = smGenerateBinarieFile; - } - /** - * @return BinarieOutputFile - */ - public String getSmBinarieOutputFile() { - return smBinarieOutputFile; - } - - public void setSmBinarieOutputFile(final String smBinarieOutputFile) { - this.smBinarieOutputFile = smBinarieOutputFile; - } - /** - * @return BinarieFilePrefixDate - */ - public boolean isSmBinarieFilePrefixDate() { - return smBinarieFilePrefixDate; - } - - public void setSmBinarieFilePrefixDate(final boolean smBinarieFilePrefixDate) { - this.smBinarieFilePrefixDate = smBinarieFilePrefixDate; - } - /** - * @return BinarieOutputDirectory - */ - public String getSmBinarieOutputDirectory() { - return smBinarieOutputDirectory; - } - - public void setSmBinarieOutputDirectory(final String smBinarieOutputDirectory) { - this.smBinarieOutputDirectory = smBinarieOutputDirectory; - } - + private Logger log = Logger.getLogger("AmsatLogger"); + + /** Default IP Adress. */ + private String smIPadress = "localhost"; + /** Default port. */ + private int smPort = 8100; + + private boolean smGenerateBinarieFile = false; + private String smBinarieOutputFile = "soundmodem.bin"; + private String smBinarieOutputDirectory = "SoundModemOuput"; + + private boolean smBinarieFilePrefixDate = false; + + protected CONFIG configFile = CONFIG.getInstance(); + + /** @param configFilename */ + public SoundModemConfiguration(final String configFilename) { + super(configFilename); + // vérifie si la propriété est dans le fichier + String temp = configFile.getProperty("smPort"); + + if (temp == null) { + // config file not initialised + initialisePropertiesFile(); + log.severe( + "properties file not initialised - a file is created with properties with defaults value"); + System.out.println( + "config file does not content required properties \n the file " + + configFilename + + " has been set up with properties to configure"); + + } else { + initialiseFromProperties(); + } + } + + private void initialisePropertiesFile() { + configFile.setProperty("smIPadress", smIPadress); + configFile.setProperty("smPort", "" + smPort); + configFile.setProperty("smGenerateBinarieFile", "" + smGenerateBinarieFile); + configFile.setProperty("smBinarieOutputFile", smBinarieOutputFile); + configFile.setProperty("smBinarieOutputFile", smBinarieOutputDirectory); + configFile.setProperty("smBinarieFilePrefixDate", "" + smBinarieFilePrefixDate); + } + + private void initialiseFromProperties() { + smIPadress = configFile.getProperty("smIPadress"); + smPort = Integer.parseInt(configFile.getProperty("smPort")); + smGenerateBinarieFile = Boolean.parseBoolean(configFile.getProperty("smGenerateBinarieFile")); + smBinarieOutputFile = configFile.getProperty("smBinarieOutputFile"); + smBinarieOutputDirectory = configFile.getProperty("smBinarieOutputDirectory"); + smBinarieFilePrefixDate = + Boolean.parseBoolean(configFile.getProperty("smBinarieFilePrefixDate")); + } + + /** @return IP adress */ + public String getSmIPadress() { + return smIPadress; + } + + /** @param iPadress */ + public void setSmIPadress(final String iPadress) { + smIPadress = iPadress; + } + + /** @return Port */ + public int getSmPort() { + return smPort; + } + + public void setSmPort(final int port) { + this.smPort = port; + } + + public String toString() { + return smIPadress + ":" + smPort; + } + /** @return GenerateBinarieFile */ + public boolean isSmGenerateBinarieFile() { + return smGenerateBinarieFile; + } + + public void setSmGenerateBinarieFile(final boolean smGenerateBinarieFile) { + this.smGenerateBinarieFile = smGenerateBinarieFile; + } + /** @return BinarieOutputFile */ + public String getSmBinarieOutputFile() { + return smBinarieOutputFile; + } + + public void setSmBinarieOutputFile(final String smBinarieOutputFile) { + this.smBinarieOutputFile = smBinarieOutputFile; + } + /** @return BinarieFilePrefixDate */ + public boolean isSmBinarieFilePrefixDate() { + return smBinarieFilePrefixDate; + } + + public void setSmBinarieFilePrefixDate(final boolean smBinarieFilePrefixDate) { + this.smBinarieFilePrefixDate = smBinarieFilePrefixDate; + } + /** @return BinarieOutputDirectory */ + public String getSmBinarieOutputDirectory() { + return smBinarieOutputDirectory; + } + + public void setSmBinarieOutputDirectory(final String smBinarieOutputDirectory) { + this.smBinarieOutputDirectory = smBinarieOutputDirectory; + } } diff --git a/ModuleSoundModem/src/main/java/org/josast/ModuleSoundModem/kiss.java b/ModuleSoundModem/src/main/java/org/josast/ModuleSoundModem/kiss.java index 526095add1e49204710b1fbd39d7a47b6f989065..d411945faa8aa8847a4ee6051450632760fd0c72 100644 --- a/ModuleSoundModem/src/main/java/org/josast/ModuleSoundModem/kiss.java +++ b/ModuleSoundModem/src/main/java/org/josast/ModuleSoundModem/kiss.java @@ -2,119 +2,121 @@ package org.josast.ModuleSoundModem; import java.util.Arrays; -/** manage Kiss frame based on KISS protocol. +/** + * manage Kiss frame based on KISS protocol. + * * @see http://www.ka9q.net/papers/kiss.html * @author christophe - * */ public class kiss { - private static final byte DATA = 0; - - private static final byte UNKNOW = (byte) 0xF0; - - private static final byte TXDELAY = 1; - - private static final byte P = 2; - - private static final byte SLOTTIME = 3; - - private static final byte TXTAIL = 4; - - private static final byte FULLDUPLEX = 5; - - private static final byte SETHARDWARE = 6; - - - private static final byte RETURN = (byte) 0xFF; - - public static final byte FEND = (byte) 0xC0; - - // TFEND ($DB, $DC) - - public static final byte FESC = (byte) 0xDB; - public static final byte TFEND = (byte) 0xDC; - - // FESC, TFESC ($DB, $DD). - public static final byte TFESC = (byte) 0xDD; - - byte[] kissdata = null; - byte type = 0; - - - - public kiss(final byte[] data) { - kissdata = data; - } - - public byte getType() { - return type; - } - - public void setType(byte type) { - this.type = type; - } - - /** - * - * @return array with data - * @throws KissException - */ - public byte[] toRaw() throws KissException { - byte[] rawData = null; - rawData = new byte[kissdata.length]; - // identifie le début de trame - if (kissdata[0] != FEND) { - throw new KissException("FEND (0xC0) value not find at the beginning of the frame "); - } - // vérifie que la fin de trame est bien identifié - if (kissdata[kissdata.length - 1] != FEND) { - throw new KissException("FEND (0xC0) value not find at the end of the frame "); - } - // Identifie le type de trame - switch (kissdata[1]) { - case 0 : type = DATA; - break; - case 1 : type = TXDELAY; - break; - case 2 : type = P; - break; - case 3 : type = SLOTTIME; - break; - case 4 : type = TXTAIL; - break; - case 5 : type = FULLDUPLEX; - break; - case 6 : type = SETHARDWARE; - break; - case (byte) 0xff: type = RETURN; - break; - - default : type = UNKNOW; - } - - int cptraw = 0; - int i = 2; - while (kissdata[i] != FEND) { - if (kissdata[i] != FESC) { - rawData[cptraw++] = kissdata[i++]; - } else { - if (kissdata[i + 1] == TFEND) { - rawData[cptraw++] = FEND; - i = i + 2; - } else if (kissdata[i + 1] == TFESC) { - rawData[cptraw++] = FESC; - i = i + 2; - } else { - rawData[cptraw++] = kissdata[i++]; - } - - } - - } - - return Arrays.copyOf(rawData, cptraw); - - } - + private static final byte DATA = 0; + + private static final byte UNKNOW = (byte) 0xF0; + + private static final byte TXDELAY = 1; + + private static final byte P = 2; + + private static final byte SLOTTIME = 3; + + private static final byte TXTAIL = 4; + + private static final byte FULLDUPLEX = 5; + + private static final byte SETHARDWARE = 6; + + private static final byte RETURN = (byte) 0xFF; + + public static final byte FEND = (byte) 0xC0; + + // TFEND ($DB, $DC) + + public static final byte FESC = (byte) 0xDB; + public static final byte TFEND = (byte) 0xDC; + + // FESC, TFESC ($DB, $DD). + public static final byte TFESC = (byte) 0xDD; + + byte[] kissdata = null; + byte type = 0; + + public kiss(final byte[] data) { + kissdata = data; + } + + public byte getType() { + return type; + } + + public void setType(byte type) { + this.type = type; + } + + /** + * @return array with data + * @throws KissException + */ + public byte[] toRaw() throws KissException { + byte[] rawData = null; + rawData = new byte[kissdata.length]; + // identifie le début de trame + if (kissdata[0] != FEND) { + throw new KissException("FEND (0xC0) value not find at the beginning of the frame "); + } + // vérifie que la fin de trame est bien identifié + if (kissdata[kissdata.length - 1] != FEND) { + throw new KissException("FEND (0xC0) value not find at the end of the frame "); + } + // Identifie le type de trame + switch (kissdata[1]) { + case 0: + type = DATA; + break; + case 1: + type = TXDELAY; + break; + case 2: + type = P; + break; + case 3: + type = SLOTTIME; + break; + case 4: + type = TXTAIL; + break; + case 5: + type = FULLDUPLEX; + break; + case 6: + type = SETHARDWARE; + break; + case (byte) 0xff: + type = RETURN; + break; + + default: + type = UNKNOW; + } + + int cptraw = 0; + int i = 2; + while (kissdata[i] != FEND) { + if (kissdata[i] != FESC) { + rawData[cptraw++] = kissdata[i++]; + } else { + if (kissdata[i + 1] == TFEND) { + rawData[cptraw++] = FEND; + i = i + 2; + } else if (kissdata[i + 1] == TFESC) { + rawData[cptraw++] = FESC; + i = i + 2; + } else { + rawData[cptraw++] = kissdata[i++]; + } + } + } + + return Arrays.copyOf(rawData, cptraw); + } } diff --git a/ModuleSoundModem/src/test/java/org/josast/ModuleSoundModem/kissTest.java b/ModuleSoundModem/src/test/java/org/josast/ModuleSoundModem/kissTest.java index 7580e3d68d4f93d4bfb38b36c74bd1e893f1d337..566826f9e8f1ebddc620a617480517b63d653419 100644 --- a/ModuleSoundModem/src/test/java/org/josast/ModuleSoundModem/kissTest.java +++ b/ModuleSoundModem/src/test/java/org/josast/ModuleSoundModem/kissTest.java @@ -10,79 +10,156 @@ import org.junit.jupiter.api.Test; class kissTest { - @BeforeAll - static void setUpBeforeClass() throws Exception { - } + @BeforeAll + static void setUpBeforeClass() throws Exception {} - @AfterAll - static void tearDownAfterClass() throws Exception { - } + @AfterAll + static void tearDownAfterClass() throws Exception {} - @BeforeEach - void setUp() throws Exception { - } + @BeforeEach + void setUp() throws Exception {} - @AfterEach - void tearDown() throws Exception { - } + @AfterEach + void tearDown() throws Exception {} - @Test - void testToRaw() { - byte [] temp = new byte [] { (byte)0xc0, 0x4f, (byte)0xd0, - 0x20, (byte)0xea, 0x3a, 0x69, 0x10, (byte)0xa2, (byte)0xd8, 0x08, 0x00, 0x2b, - 0x30, 0x30, (byte)0xc0}; - byte [] out = new byte [] { (byte)0xd0, - 0x20, (byte)0xea, 0x3a, 0x69, 0x10, (byte)0xa2, (byte)0xd8, 0x08, 0x00, 0x2b, - 0x30, 0x30, }; - kiss k = new kiss(temp); - try { - byte [] res = k.toRaw(); - assertArrayEquals(res,out); - - } catch (KissException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - } - @Test - void testToRawFEND() { - byte [] temp = new byte [] { (byte)0xc0, 0x4f, (byte)0xd0, - 0x20, (byte)0xea, 0x3a, 0x69,(byte) 0xDB, (byte)0xDC, (byte)0xd8, 0x08, 0x00, 0x2b, - 0x30, 0x30, (byte)0xc0}; - byte [] out = new byte [] {(byte)0xd0, - 0x20, (byte)0xea, 0x3a, 0x69,(byte) 0xC0, (byte)0xd8, 0x08, 0x00, 0x2b, - 0x30, 0x30, }; - kiss k = new kiss(temp); - try { - byte [] res = k.toRaw(); - assertArrayEquals(res,out); - - } catch (KissException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } + @Test + void testToRaw() { + byte[] temp = + new byte[] { + (byte) 0xc0, + 0x4f, + (byte) 0xd0, + 0x20, + (byte) 0xea, + 0x3a, + 0x69, + 0x10, + (byte) 0xa2, + (byte) 0xd8, + 0x08, + 0x00, + 0x2b, + 0x30, + 0x30, + (byte) 0xc0 + }; + byte[] out = + new byte[] { + (byte) 0xd0, + 0x20, + (byte) 0xea, + 0x3a, + 0x69, + 0x10, + (byte) 0xa2, + (byte) 0xd8, + 0x08, + 0x00, + 0x2b, + 0x30, + 0x30, + }; + kiss k = new kiss(temp); + try { + byte[] res = k.toRaw(); + assertArrayEquals(res, out); - - } - @Test - void testToRawFESC() { - byte [] temp = new byte [] { (byte)0xc0, 0x4f, (byte)0xd0, - 0x20, (byte)0xea, 0x3a, 0x69,(byte) 0xDB, (byte)0xDD, (byte)0xd8, 0x08, 0x00, 0x2b, - (byte) 0xDB, (byte)0xDD, (byte)0xc0}; - byte [] out = new byte [] {(byte)0xd0, - 0x20, (byte)0xea, 0x3a, 0x69,(byte) 0xDB, (byte)0xd8, 0x08, 0x00, 0x2b, - (byte) 0xDB, }; - kiss k = new kiss(temp); - try { - byte [] res = k.toRaw(); - assertArrayEquals(res,out); - - } catch (KissException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } + } catch (KissException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } - - } + @Test + void testToRawFEND() { + byte[] temp = + new byte[] { + (byte) 0xc0, + 0x4f, + (byte) 0xd0, + 0x20, + (byte) 0xea, + 0x3a, + 0x69, + (byte) 0xDB, + (byte) 0xDC, + (byte) 0xd8, + 0x08, + 0x00, + 0x2b, + 0x30, + 0x30, + (byte) 0xc0 + }; + byte[] out = + new byte[] { + (byte) 0xd0, + 0x20, + (byte) 0xea, + 0x3a, + 0x69, + (byte) 0xC0, + (byte) 0xd8, + 0x08, + 0x00, + 0x2b, + 0x30, + 0x30, + }; + kiss k = new kiss(temp); + try { + byte[] res = k.toRaw(); + assertArrayEquals(res, out); + } catch (KissException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } + + @Test + void testToRawFESC() { + byte[] temp = + new byte[] { + (byte) 0xc0, + 0x4f, + (byte) 0xd0, + 0x20, + (byte) 0xea, + 0x3a, + 0x69, + (byte) 0xDB, + (byte) 0xDD, + (byte) 0xd8, + 0x08, + 0x00, + 0x2b, + (byte) 0xDB, + (byte) 0xDD, + (byte) 0xc0 + }; + byte[] out = + new byte[] { + (byte) 0xd0, + 0x20, + (byte) 0xea, + 0x3a, + 0x69, + (byte) 0xDB, + (byte) 0xd8, + 0x08, + 0x00, + 0x2b, + (byte) 0xDB, + }; + kiss k = new kiss(temp); + try { + byte[] res = k.toRaw(); + assertArrayEquals(res, out); + + } catch (KissException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } } diff --git a/ModuleUVSQsatTelemetry/pom.xml b/ModuleUVSQsatTelemetry/pom.xml index 3d6634e87ea3387656b740d3dc4c64daa1059556..2106b41dcfe09f045b5074d5f90c205da23a0ba1 100644 --- a/ModuleUVSQsatTelemetry/pom.xml +++ b/ModuleUVSQsatTelemetry/pom.xml @@ -37,12 +37,7 @@ - -org.junit.jupiter - junit-jupiter-engine - 5.5.2 - test - + diff --git a/ModuleUVSQsatTelemetry/src/main/java/org/josast/uvsqsat/AX25decodedData.java b/ModuleUVSQsatTelemetry/src/main/java/org/josast/uvsqsat/AX25decodedData.java index 42207207ced4260b9fcee109ec06a8ebce352d19..5a1f81661f4e61a094102b3319627ab19b71b4d9 100644 --- a/ModuleUVSQsatTelemetry/src/main/java/org/josast/uvsqsat/AX25decodedData.java +++ b/ModuleUVSQsatTelemetry/src/main/java/org/josast/uvsqsat/AX25decodedData.java @@ -1,39 +1,40 @@ package org.josast.uvsqsat; - - - import org.josast.uvsqsat.generated.Uvsqsat; - public class AX25decodedData { - - private String source; - private String destination; - - private int destSSID; - private int srcSSID; - private int ctl; - - public AX25decodedData(Uvsqsat data) { - - source = data.ax25Frame().ax25Header().srcCallsignRaw().callsignRor().callsign(); - destination = data.ax25Frame().ax25Header().destCallsignRaw().callsignRor().callsign(); - destSSID = data.ax25Frame().ax25Header().destSsidRaw().ssid(); - srcSSID = data.ax25Frame().ax25Header().srcSsidRaw().ssid(); - ctl = data.ax25Frame().ax25Header().ctl(); - - } - - public String toStringHeader() { - - String sep = "\r\n"; - return ("Source : " + source + " - SSID : " + srcSSID + sep + "Destination :" + destination + " - SSID : " - + destSSID + sep + " ctl : " + ctl + sep); - - } - - - + private String source; + private String destination; + + private int destSSID; + private int srcSSID; + private int ctl; + + public AX25decodedData(Uvsqsat data) { + + source = data.ax25Frame().ax25Header().srcCallsignRaw().callsignRor().callsign(); + destination = data.ax25Frame().ax25Header().destCallsignRaw().callsignRor().callsign(); + destSSID = data.ax25Frame().ax25Header().destSsidRaw().ssid(); + srcSSID = data.ax25Frame().ax25Header().srcSsidRaw().ssid(); + ctl = data.ax25Frame().ax25Header().ctl(); + } + + public String toStringHeader() { + + String sep = "\r\n"; + return ("Source : " + + source + + " - SSID : " + + srcSSID + + sep + + "Destination :" + + destination + + " - SSID : " + + destSSID + + sep + + " ctl : " + + ctl + + sep); + } } diff --git a/ModuleUVSQsatTelemetry/src/main/java/org/josast/uvsqsat/Frame.java b/ModuleUVSQsatTelemetry/src/main/java/org/josast/uvsqsat/Frame.java index e2340cdc2758027b84cf0a922057c09bb35c4af5..1941e04208abc2068ef31a3bc4e093a05e608096 100644 --- a/ModuleUVSQsatTelemetry/src/main/java/org/josast/uvsqsat/Frame.java +++ b/ModuleUVSQsatTelemetry/src/main/java/org/josast/uvsqsat/Frame.java @@ -1,13 +1,11 @@ package org.josast.uvsqsat; import java.util.logging.Logger; - import org.josast.uvsqsat.generated.Uvsqsat; import org.josast.uvsqsat.generated.Uvsqsat.AntsHk; import org.josast.uvsqsat.generated.Uvsqsat.Beacon; import org.josast.uvsqsat.generated.Uvsqsat.IepsHkStatus; import org.josast.uvsqsat.generated.Uvsqsat.ImtqHk; - import org.josast.uvsqsat.generated.Uvsqsat.MainboardAllScience; import org.josast.uvsqsat.generated.Uvsqsat.MainboardHk; import org.josast.uvsqsat.generated.Uvsqsat.MsgOrUnknow; @@ -15,15 +13,12 @@ import org.josast.uvsqsat.generated.Uvsqsat.ObcHk; import org.josast.uvsqsat.generated.Uvsqsat.ObcStatus; import org.josast.uvsqsat.generated.Uvsqsat.TrxvurxHk; import org.josast.uvsqsat.generated.Uvsqsat.TrxvutxHk; - import org.josast.uvsqsat.generated.Uvsqsat.UiFrame; import org.josast.uvsqsat.pojogenerated.AFrame; import org.josast.uvsqsat.pojogenerated.antsHk; import org.josast.uvsqsat.pojogenerated.beacon; import org.josast.uvsqsat.pojogenerated.iepsHkStatus; - import org.josast.uvsqsat.pojogenerated.imtqHk; - import org.josast.uvsqsat.pojogenerated.mainboardAllScience; import org.josast.uvsqsat.pojogenerated.mainboardHk; import org.josast.uvsqsat.pojogenerated.msgOrUnknow; @@ -33,155 +28,167 @@ import org.josast.uvsqsat.pojogenerated.trxvurxHk; import org.josast.uvsqsat.pojogenerated.trxvutxHk; public class Frame { - private static Logger appLogger = Logger.getLogger("AmsatLogger"); - - protected Uvsqsat UvsqsatData = null; - protected PPrimaryHeader packetPrimaryHeader = null; - protected PSecondaryHeader packetSecondaryHeader = null; - protected String separator = "\r\n"; - private int sid; - - protected UiFrame uiFrame; - protected AFrame tlm; - protected AX25decodedData ax25; - - public void setUp(Uvsqsat data) { - - UvsqsatData = data; - - try { - - uiFrame = (UiFrame) data.ax25Frame().payload(); - ax25 = new AX25decodedData(data); - packetPrimaryHeader = new PPrimaryHeader(uiFrame.packetPrimaryHeader()); - packetSecondaryHeader = new PSecondaryHeader(uiFrame.packetSecondaryHeader()); - sid = packetSecondaryHeader.getSid(); - extractTlm(); - } catch (Exception e) { - appLogger.severe("Error decoding packet " + e.getStackTrace().toString()); - } - } - - /* - * 0x0E: amsat_ascii 0x0F: beacon 0x10: ants_hk 0x11: obc_status 0x12: obc_hk_tm - * 0x13: mainboard_all_science 0x14: mainboard_hk 0x15: ieps_hk_status_tm 0x16: - * trxvurx_hk 0x17: imtq_hk_tm - */ - private void extractTlm() { - - switch (sid) { - case 0x0E: - // obc_status - break; - - case 0x0F: - tlm = new beacon((Beacon) uiFrame.tlm()); - break; - case 0x10: - tlm = new antsHk((AntsHk) uiFrame.tlm()); - break; - - case 0x11: - // obc_status - tlm = new obcStatus((ObcStatus) uiFrame.tlm()); - break; - case 0x12: - // obc_hk_tm - tlm = new obcHk((ObcHk) uiFrame.tlm()); - - break; - - case 0x13: - // 0x13: mainboard_all_science - tlm = new mainboardAllScience((MainboardAllScience) uiFrame.tlm()); - - break; - - case 0x14: - // 0x14: mainboard_hk - tlm = new mainboardHk((MainboardHk) uiFrame.tlm()); - - break; - - case 0x15: - // ieps_hk_status_tm - tlm = new iepsHkStatus((IepsHkStatus) uiFrame.tlm()); - - break; - - case 0x16: - - // 0x16: trxvurx_hk - tlm = new trxvurxHk((TrxvurxHk) uiFrame.tlm()); - - break; - case 0x17: - // imtq_hk_tm - tlm = new imtqHk((ImtqHk) uiFrame.tlm()); - break; - case 0x18: - // trxvutx_hk_tm - tlm = new trxvutxHk((TrxvutxHk) uiFrame.tlm()); - break; - default: - - appLogger.severe("SID not found " + sid); - tlm = new msgOrUnknow((MsgOrUnknow) uiFrame.tlm()); - } - - } - - public String toString() { - return ax25.toStringHeader() + separator + packetPrimaryHeader.toString() + separator - + packetSecondaryHeader.toString() + separator + tlm.toStringRaw() + separator + tlm.toStringCompute(); - } - - public String toStringFormat() { - return "###############################################################" + separator + "AX25 HEADER" + separator - + ax25.toStringHeader() + "===============================================================" + separator - + "HEADERS" + separator + "===============================================================" + separator - + packetPrimaryHeader.toString() + separator + packetSecondaryHeader.toString() + separator -// + "===============================================================" + separator + "RAW DATA" + separator -// + "===============================================================" + separator + tlm.toStringRaw() - + separator + "===============================================================" + separator - + "COMPUTE DATA" + separator + tlm.toStringCompute() + separator - + "###############################################################" + separator; - - } - - /** - * @return the sid - */ - public int getSid() { - return sid; - } - - /** - * @param sid the sid to set - */ - public void setSid(int sid) { - this.sid = sid; - } - - /** - * @return the packetPrimaryHeader - */ - public PPrimaryHeader getPacketPrimaryHeader() { - return packetPrimaryHeader; - } - - /** - * @return the packetSecondaryHeader - */ - public PSecondaryHeader getPacketSecondaryHeader() { - return packetSecondaryHeader; - } - - /** - * @return the uiFrame - */ - public UiFrame getUiFrame() { - return uiFrame; - } - + private static Logger appLogger = Logger.getLogger("AmsatLogger"); + + protected Uvsqsat UvsqsatData = null; + protected PPrimaryHeader packetPrimaryHeader = null; + protected PSecondaryHeader packetSecondaryHeader = null; + protected String separator = "\r\n"; + private int sid; + + protected UiFrame uiFrame; + protected AFrame tlm; + protected AX25decodedData ax25; + + public void setUp(Uvsqsat data) { + + UvsqsatData = data; + + try { + + uiFrame = (UiFrame) data.ax25Frame().payload(); + ax25 = new AX25decodedData(data); + packetPrimaryHeader = new PPrimaryHeader(uiFrame.packetPrimaryHeader()); + packetSecondaryHeader = new PSecondaryHeader(uiFrame.packetSecondaryHeader()); + sid = packetSecondaryHeader.getSid(); + extractTlm(); + } catch (Exception e) { + appLogger.severe("Error decoding packet " + e.getStackTrace().toString()); + } + } + + /* + * 0x0E: amsat_ascii 0x0F: beacon 0x10: ants_hk 0x11: obc_status 0x12: obc_hk_tm + * 0x13: mainboard_all_science 0x14: mainboard_hk 0x15: ieps_hk_status_tm 0x16: + * trxvurx_hk 0x17: imtq_hk_tm + */ + private void extractTlm() { + + switch (sid) { + case 0x0E: + // obc_status + break; + + case 0x0F: + tlm = new beacon((Beacon) uiFrame.tlm()); + break; + case 0x10: + tlm = new antsHk((AntsHk) uiFrame.tlm()); + break; + + case 0x11: + // obc_status + tlm = new obcStatus((ObcStatus) uiFrame.tlm()); + break; + case 0x12: + // obc_hk_tm + tlm = new obcHk((ObcHk) uiFrame.tlm()); + + break; + + case 0x13: + // 0x13: mainboard_all_science + tlm = new mainboardAllScience((MainboardAllScience) uiFrame.tlm()); + + break; + + case 0x14: + // 0x14: mainboard_hk + tlm = new mainboardHk((MainboardHk) uiFrame.tlm()); + + break; + + case 0x15: + // ieps_hk_status_tm + tlm = new iepsHkStatus((IepsHkStatus) uiFrame.tlm()); + + break; + + case 0x16: + + // 0x16: trxvurx_hk + tlm = new trxvurxHk((TrxvurxHk) uiFrame.tlm()); + + break; + case 0x17: + // imtq_hk_tm + tlm = new imtqHk((ImtqHk) uiFrame.tlm()); + break; + case 0x18: + // trxvutx_hk_tm + tlm = new trxvutxHk((TrxvutxHk) uiFrame.tlm()); + break; + default: + appLogger.severe("SID not found " + sid); + tlm = new msgOrUnknow((MsgOrUnknow) uiFrame.tlm()); + } + } + + public String toString() { + return ax25.toStringHeader() + + separator + + packetPrimaryHeader.toString() + + separator + + packetSecondaryHeader.toString() + + separator + + tlm.toStringRaw() + + separator + + tlm.toStringCompute(); + } + + public String toStringFormat() { + return "###############################################################" + + separator + + "AX25 HEADER" + + separator + + ax25.toStringHeader() + + "===============================================================" + + separator + + "HEADERS" + + separator + + "===============================================================" + + separator + + packetPrimaryHeader.toString() + + separator + + packetSecondaryHeader.toString() + + separator + // + "===============================================================" + separator + "RAW + // DATA" + separator + // + "===============================================================" + separator + + // tlm.toStringRaw() + + separator + + "===============================================================" + + separator + + "COMPUTE DATA" + + separator + + tlm.toStringCompute() + + separator + + "###############################################################" + + separator; + } + + /** @return the sid */ + public int getSid() { + return sid; + } + + /** @param sid the sid to set */ + public void setSid(int sid) { + this.sid = sid; + } + + /** @return the packetPrimaryHeader */ + public PPrimaryHeader getPacketPrimaryHeader() { + return packetPrimaryHeader; + } + + /** @return the packetSecondaryHeader */ + public PSecondaryHeader getPacketSecondaryHeader() { + return packetSecondaryHeader; + } + + /** @return the uiFrame */ + public UiFrame getUiFrame() { + return uiFrame; + } } diff --git a/ModuleUVSQsatTelemetry/src/main/java/org/josast/uvsqsat/PPrimaryHeader.java b/ModuleUVSQsatTelemetry/src/main/java/org/josast/uvsqsat/PPrimaryHeader.java index 4f6b8872fda1332aee587b01b1e0b1166d77fea1..263f98d5549f32bdaa0c29066ac9b9f3a813b9f3 100644 --- a/ModuleUVSQsatTelemetry/src/main/java/org/josast/uvsqsat/PPrimaryHeader.java +++ b/ModuleUVSQsatTelemetry/src/main/java/org/josast/uvsqsat/PPrimaryHeader.java @@ -1,154 +1,134 @@ package org.josast.uvsqsat; import java.util.HashMap; - import org.josast.uvsqsat.generated.Uvsqsat.PacketPrimaryHeader; public class PPrimaryHeader { - private long packetVersionNumber; - private boolean packetIdPacketType; - private boolean packetIdSecondaryHeaderFlag; - private long packetIdApplicationProcessId; - private long packetSequenceControlSecquenceFlag; - private long packetSequenceControlCountOrName; - private int packetDataLength; - private HashMap hashHeader = new HashMap(); - protected String separator = "\r\n"; - - public PPrimaryHeader(PacketPrimaryHeader uiFrame) { - packetVersionNumber = uiFrame.packetVersionNumber(); - packetIdPacketType = uiFrame.packetIdPacketType(); - packetIdSecondaryHeaderFlag = uiFrame.packetIdSecondaryHeaderFlag(); - packetIdApplicationProcessId = uiFrame.packetIdApplicationProcessId(); - packetSequenceControlSecquenceFlag = uiFrame.packetSequenceControlSecquenceFlag(); - packetSequenceControlCountOrName = uiFrame.packetSequenceControlCountOrName(); - packetDataLength = uiFrame.packetDataLength(); - - } - - public String toStringHash() { - hashHeader.put("Packet VersionNumber", "" + packetVersionNumber); - hashHeader.put("Packet Id Packet Type", "" + packetIdPacketType); - hashHeader.put("Packet Id Secondary Header Flag", "" + packetIdSecondaryHeaderFlag); - hashHeader.put("Packet Id Application Process Id", "" + packetIdApplicationProcessId); - hashHeader.put("Packet SequenceControl Secquence Flag", "" + packetSequenceControlSecquenceFlag); - hashHeader.put("Packet Sequence Control Count Or Name", "" + packetSequenceControlCountOrName); - hashHeader.put("Packet Data Length", "" + packetDataLength); - - return hashHeader.toString(); - - } - - public String toString() { - return "Packet VersionNumber : " + packetVersionNumber + separator + "Packet Id Packet Type : " - + packetIdPacketType + separator + "Packet Id Secondary Header Flag :" + packetIdSecondaryHeaderFlag - + separator + "Packet Id Application Process Id :" + packetIdApplicationProcessId + separator - + "Packet SequenceControl Secquence Flag :" + packetSequenceControlSecquenceFlag + separator - + "Packet Sequence Control Count Or Name :" + packetSequenceControlCountOrName + separator - + "Packet Data Length :" + packetDataLength + separator; - - } - - /** - * @return the packetVersionNumber - */ - public long getPacketVersionNumber() { - return packetVersionNumber; - } - - /** - * @param packetVersionNumber the packetVersionNumber to set - */ - public void setPacketVersionNumber(long packetVersionNumber) { - this.packetVersionNumber = packetVersionNumber; - } - - /** - * @return the packetIdPacketType - */ - public boolean isPacketIdPacketType() { - return packetIdPacketType; - } - - /** - * @param packetIdPacketType the packetIdPacketType to set - */ - public void setPacketIdPacketType(boolean packetIdPacketType) { - this.packetIdPacketType = packetIdPacketType; - } - - /** - * @return the packetIdSecondaryHeaderFlag - */ - public boolean isPacketIdSecondaryHeaderFlag() { - return packetIdSecondaryHeaderFlag; - } - - /** - * @param packetIdSecondaryHeaderFlag the packetIdSecondaryHeaderFlag to set - */ - public void setPacketIdSecondaryHeaderFlag(boolean packetIdSecondaryHeaderFlag) { - this.packetIdSecondaryHeaderFlag = packetIdSecondaryHeaderFlag; - } - - /** - * @return the packetIdApplicationProcessId - */ - public long getPacketIdApplicationProcessId() { - return packetIdApplicationProcessId; - } - - /** - * @param packetIdApplicationProcessId the packetIdApplicationProcessId to set - */ - public void setPacketIdApplicationProcessId(long packetIdApplicationProcessId) { - this.packetIdApplicationProcessId = packetIdApplicationProcessId; - } - - /** - * @return the packetSequenceControlSecquenceFlag - */ - public long getPacketSequenceControlSecquenceFlag() { - return packetSequenceControlSecquenceFlag; - } - - /** - * @param packetSequenceControlSecquenceFlag the - * packetSequenceControlSecquenceFlag - * to set - */ - public void setPacketSequenceControlSecquenceFlag(long packetSequenceControlSecquenceFlag) { - this.packetSequenceControlSecquenceFlag = packetSequenceControlSecquenceFlag; - } - - /** - * @return the packetSequenceControlCountOrName - */ - public long getPacketSequenceControlCountOrName() { - return packetSequenceControlCountOrName; - } - - /** - * @param packetSequenceControlCountOrName the packetSequenceControlCountOrName - * to set - */ - public void setPacketSequenceControlCountOrName(long packetSequenceControlCountOrName) { - this.packetSequenceControlCountOrName = packetSequenceControlCountOrName; - } - - /** - * @return the packetDataLength - */ - public int getPacketDataLength() { - return packetDataLength; - } - - /** - * @param packetDataLength the packetDataLength to set - */ - public void setPacketDataLength(int packetDataLength) { - this.packetDataLength = packetDataLength; - } - + private long packetVersionNumber; + private boolean packetIdPacketType; + private boolean packetIdSecondaryHeaderFlag; + private long packetIdApplicationProcessId; + private long packetSequenceControlSecquenceFlag; + private long packetSequenceControlCountOrName; + private int packetDataLength; + private HashMap hashHeader = new HashMap(); + protected String separator = "\r\n"; + + public PPrimaryHeader(PacketPrimaryHeader uiFrame) { + packetVersionNumber = uiFrame.packetVersionNumber(); + packetIdPacketType = uiFrame.packetIdPacketType(); + packetIdSecondaryHeaderFlag = uiFrame.packetIdSecondaryHeaderFlag(); + packetIdApplicationProcessId = uiFrame.packetIdApplicationProcessId(); + packetSequenceControlSecquenceFlag = uiFrame.packetSequenceControlSecquenceFlag(); + packetSequenceControlCountOrName = uiFrame.packetSequenceControlCountOrName(); + packetDataLength = uiFrame.packetDataLength(); + } + + public String toStringHash() { + hashHeader.put("Packet VersionNumber", "" + packetVersionNumber); + hashHeader.put("Packet Id Packet Type", "" + packetIdPacketType); + hashHeader.put("Packet Id Secondary Header Flag", "" + packetIdSecondaryHeaderFlag); + hashHeader.put("Packet Id Application Process Id", "" + packetIdApplicationProcessId); + hashHeader.put( + "Packet SequenceControl Secquence Flag", "" + packetSequenceControlSecquenceFlag); + hashHeader.put("Packet Sequence Control Count Or Name", "" + packetSequenceControlCountOrName); + hashHeader.put("Packet Data Length", "" + packetDataLength); + + return hashHeader.toString(); + } + + public String toString() { + return "Packet VersionNumber : " + + packetVersionNumber + + separator + + "Packet Id Packet Type : " + + packetIdPacketType + + separator + + "Packet Id Secondary Header Flag :" + + packetIdSecondaryHeaderFlag + + separator + + "Packet Id Application Process Id :" + + packetIdApplicationProcessId + + separator + + "Packet SequenceControl Secquence Flag :" + + packetSequenceControlSecquenceFlag + + separator + + "Packet Sequence Control Count Or Name :" + + packetSequenceControlCountOrName + + separator + + "Packet Data Length :" + + packetDataLength + + separator; + } + + /** @return the packetVersionNumber */ + public long getPacketVersionNumber() { + return packetVersionNumber; + } + + /** @param packetVersionNumber the packetVersionNumber to set */ + public void setPacketVersionNumber(long packetVersionNumber) { + this.packetVersionNumber = packetVersionNumber; + } + + /** @return the packetIdPacketType */ + public boolean isPacketIdPacketType() { + return packetIdPacketType; + } + + /** @param packetIdPacketType the packetIdPacketType to set */ + public void setPacketIdPacketType(boolean packetIdPacketType) { + this.packetIdPacketType = packetIdPacketType; + } + + /** @return the packetIdSecondaryHeaderFlag */ + public boolean isPacketIdSecondaryHeaderFlag() { + return packetIdSecondaryHeaderFlag; + } + + /** @param packetIdSecondaryHeaderFlag the packetIdSecondaryHeaderFlag to set */ + public void setPacketIdSecondaryHeaderFlag(boolean packetIdSecondaryHeaderFlag) { + this.packetIdSecondaryHeaderFlag = packetIdSecondaryHeaderFlag; + } + + /** @return the packetIdApplicationProcessId */ + public long getPacketIdApplicationProcessId() { + return packetIdApplicationProcessId; + } + + /** @param packetIdApplicationProcessId the packetIdApplicationProcessId to set */ + public void setPacketIdApplicationProcessId(long packetIdApplicationProcessId) { + this.packetIdApplicationProcessId = packetIdApplicationProcessId; + } + + /** @return the packetSequenceControlSecquenceFlag */ + public long getPacketSequenceControlSecquenceFlag() { + return packetSequenceControlSecquenceFlag; + } + + /** @param packetSequenceControlSecquenceFlag the packetSequenceControlSecquenceFlag to set */ + public void setPacketSequenceControlSecquenceFlag(long packetSequenceControlSecquenceFlag) { + this.packetSequenceControlSecquenceFlag = packetSequenceControlSecquenceFlag; + } + + /** @return the packetSequenceControlCountOrName */ + public long getPacketSequenceControlCountOrName() { + return packetSequenceControlCountOrName; + } + + /** @param packetSequenceControlCountOrName the packetSequenceControlCountOrName to set */ + public void setPacketSequenceControlCountOrName(long packetSequenceControlCountOrName) { + this.packetSequenceControlCountOrName = packetSequenceControlCountOrName; + } + + /** @return the packetDataLength */ + public int getPacketDataLength() { + return packetDataLength; + } + + /** @param packetDataLength the packetDataLength to set */ + public void setPacketDataLength(int packetDataLength) { + this.packetDataLength = packetDataLength; + } } diff --git a/ModuleUVSQsatTelemetry/src/main/java/org/josast/uvsqsat/PSecondaryHeader.java b/ModuleUVSQsatTelemetry/src/main/java/org/josast/uvsqsat/PSecondaryHeader.java index 28ec7412327731b952ff8e120ec58f7dd1564fd7..83c1482e4d2e4b6596decb947d37696935155bd2 100644 --- a/ModuleUVSQsatTelemetry/src/main/java/org/josast/uvsqsat/PSecondaryHeader.java +++ b/ModuleUVSQsatTelemetry/src/main/java/org/josast/uvsqsat/PSecondaryHeader.java @@ -5,87 +5,90 @@ import java.util.Date; import java.util.HashMap; import java.util.Locale; import java.util.TimeZone; - import org.josast.uvsqsat.generated.Uvsqsat.PacketSecondaryHeader; public class PSecondaryHeader { - private HashMap hashHeader = new HashMap(); - - - private long tmPacketPusVersionNumber; - private long spacecraftTimeReferenceStatus; - private long serviceTypeId; - private long messageSubtypeId; - private long messageTypeCounter; - private long destinationId; - private long time; - protected String separator = "\r\n"; - private int sid; - - public PSecondaryHeader(PacketSecondaryHeader packetSecondaryHeader) { + private HashMap hashHeader = new HashMap(); + + private long tmPacketPusVersionNumber; + private long spacecraftTimeReferenceStatus; + private long serviceTypeId; + private long messageSubtypeId; + private long messageTypeCounter; + private long destinationId; + private long time; + protected String separator = "\r\n"; + private int sid; + + public PSecondaryHeader(PacketSecondaryHeader packetSecondaryHeader) { + + tmPacketPusVersionNumber = packetSecondaryHeader.tmPacketPusVersionNumber(); + spacecraftTimeReferenceStatus = packetSecondaryHeader.spacecraftTimeReferenceStatus(); + serviceTypeId = packetSecondaryHeader.serviceTypeId(); + messageSubtypeId = packetSecondaryHeader.messageSubtypeId(); + messageTypeCounter = packetSecondaryHeader.messageTypeCounter(); + destinationId = packetSecondaryHeader.destinationId(); + time = packetSecondaryHeader.time(); + sid = packetSecondaryHeader.sid(); + } + + public String toStringHash() { + hashHeader.put("TM Packet Pus Version Numberr", "" + tmPacketPusVersionNumber); + hashHeader.put("Spacecraft Time Reference Status", "" + spacecraftTimeReferenceStatus); + hashHeader.put("Service Type Id", "" + serviceTypeId); + hashHeader.put("Message Sub type Id", "" + messageSubtypeId); + hashHeader.put("Message Type Counter", "" + messageTypeCounter); + hashHeader.put("Destination Id", "" + destinationId); + hashHeader.put("Time", "" + time); + hashHeader.put("SID", "" + sid); + return hashHeader.toString(); + } - tmPacketPusVersionNumber= packetSecondaryHeader.tmPacketPusVersionNumber(); - spacecraftTimeReferenceStatus = packetSecondaryHeader.spacecraftTimeReferenceStatus(); - serviceTypeId =packetSecondaryHeader.serviceTypeId(); - messageSubtypeId = packetSecondaryHeader.messageSubtypeId(); - messageTypeCounter = packetSecondaryHeader.messageTypeCounter(); - destinationId = packetSecondaryHeader.destinationId(); - time = packetSecondaryHeader.time(); - sid = packetSecondaryHeader.sid(); - - } - - - public String toStringHash() { - - hashHeader.put("TM Packet Pus Version Numberr",""+tmPacketPusVersionNumber ); - hashHeader.put("Spacecraft Time Reference Status",""+spacecraftTimeReferenceStatus); - hashHeader.put("Service Type Id",""+serviceTypeId ); - hashHeader.put("Message Sub type Id",""+messageSubtypeId); - hashHeader.put("Message Type Counter",""+messageTypeCounter ); - hashHeader.put("Destination Id",""+destinationId); - hashHeader.put("Time",""+time); - hashHeader.put("SID",""+sid); - return hashHeader.toString(); + public String toString() { + return "TM Packet Pus Version Number : " + + tmPacketPusVersionNumber + + separator + + "Spacecraft Time Reference Status : " + + spacecraftTimeReferenceStatus + + separator + + "Service Type Id : " + + serviceTypeId + + separator + + "Message Sub type Id : " + + messageSubtypeId + + separator + + "Message Type Counter : " + + messageTypeCounter + + separator + + "Destination Id : " + + destinationId + + separator + + "Time : " + + printDate(time) + + separator + + "SID : " + + sid + + separator; + } - } - - public String toString() - { - return "TM Packet Pus Version Number : " + tmPacketPusVersionNumber + separator + - "Spacecraft Time Reference Status : " + spacecraftTimeReferenceStatus + separator + - "Service Type Id : " + serviceTypeId + separator + - "Message Sub type Id : " + messageSubtypeId + separator + - "Message Type Counter : " + messageTypeCounter + separator + - "Destination Id : " + destinationId + separator + - "Time : " + printDate(time) + separator+ - "SID : " + sid + separator; - - } + /** @return the sid */ + public int getSid() { + return sid; + } + public String getTime() { + return printDate(time); + } - /** - * @return the sid - */ - public int getSid() { - return sid; - } - - public String getTime() - { - return printDate(time); - } - public static String printDate(long sec) - { - Date date = new Date(sec*1000); -// SimpleDateFormat sdf = new SimpleDateFormat("EEEE,MMMM d,yyyy h:mm:ss,a", Locale.ENGLISH); - SimpleDateFormat sdf = new SimpleDateFormat("MM/dd/yyyy h:mm:ss", Locale.ENGLISH); - sdf.setTimeZone(TimeZone.getTimeZone("UTC")); - String formattedDate = sdf.format(date); + public static String printDate(long sec) { + Date date = new Date(sec * 1000); + // SimpleDateFormat sdf = new SimpleDateFormat("EEEE,MMMM d,yyyy h:mm:ss,a", Locale.ENGLISH); + SimpleDateFormat sdf = new SimpleDateFormat("MM/dd/yyyy h:mm:ss", Locale.ENGLISH); + sdf.setTimeZone(TimeZone.getTimeZone("UTC")); + String formattedDate = sdf.format(date); - return formattedDate; - } - + return formattedDate; + } } diff --git a/ModuleUVSQsatTelemetry/src/main/java/org/josast/uvsqsat/generated/Uvsqsat.java b/ModuleUVSQsatTelemetry/src/main/java/org/josast/uvsqsat/generated/Uvsqsat.java index 6d50c5313600926f1d5a4fc833640bec010c5a8a..612fff4b3d46dad26a6751416f567141338ed320 100644 --- a/ModuleUVSQsatTelemetry/src/main/java/org/josast/uvsqsat/generated/Uvsqsat.java +++ b/ModuleUVSQsatTelemetry/src/main/java/org/josast/uvsqsat/generated/Uvsqsat.java @@ -3,4660 +3,6355 @@ package org.josast.uvsqsat.generated; import io.kaitai.struct.ByteBufferKaitaiStream; -import io.kaitai.struct.KaitaiStruct; import io.kaitai.struct.KaitaiStream; +import io.kaitai.struct.KaitaiStruct; import java.io.IOException; import java.nio.charset.Charset; - /** - * : UVSQsat telemetry description file - * : Version 0.2.8 - * : - * : reference documentation - * : UVSQsat-Beacon description for web site - * : - * : This ksy file is used for different automatic code generation - * : - ksy file to programming language thanks o ksy compiler - * - ksy file to graphwiz document thnaks to ksy compiler - * - Ksy file to java textual display files thanks to JOSAST GeneratePOJOfromKSY tool (experimental) - * - Ksy file to FXML files and associated java files file thanks to JOSAST GeneratePOJOfromKSY tool (experimental) - * - * : Writing rules should be respected (see JOSAST project) - * : - for interpreted value, variable should finish with - * : _raw if no interpretation is done - * : _c, _ma _v _dbm _mw according to the interpreted value - * : - the name of the interpreted value should be close to the displaed name (to limit rework) - * : _c, _ma _v _dbm _mw are automaticaly converted to (C) (mA) (dbm) (mW) - * : - * :field dest_callsign: ax25_frame.ax25_header.dest_callsign_raw.callsign_ror.callsign - * :field src_callsign: ax25_frame.ax25_header.src_callsign_raw.callsign_ror.callsign - * :field src_ssid: ax25_frame.ax25_header.src_ssid_raw.ssid - * :field dest_ssid: ax25_frame.ax25_header.dest_ssid_raw.ssid - * :field ctl: ax25_frame.ax25_header.ctl - * :field pid: ax25_frame.payload.pid + * : UVSQsat telemetry description file : Version 0.2.8 : : reference documentation : UVSQsat-Beacon + * description for web site : : This ksy file is used for different automatic code generation : - + * ksy file to programming language thanks o ksy compiler - ksy file to graphwiz document thnaks to + * ksy compiler - Ksy file to java textual display files thanks to JOSAST GeneratePOJOfromKSY tool + * (experimental) - Ksy file to FXML files and associated java files file thanks to JOSAST + * GeneratePOJOfromKSY tool (experimental) + * + *

    : Writing rules should be respected (see JOSAST project) : - for interpreted value, variable + * should finish with : _raw if no interpretation is done : _c, _ma _v _dbm _mw according to the + * interpreted value : - the name of the interpreted value should be close to the displaed name (to + * limit rework) : _c, _ma _v _dbm _mw are automaticaly converted to (C) (mA) (dbm) (mW) : :field + * dest_callsign: ax25_frame.ax25_header.dest_callsign_raw.callsign_ror.callsign :field + * src_callsign: ax25_frame.ax25_header.src_callsign_raw.callsign_ror.callsign :field src_ssid: + * ax25_frame.ax25_header.src_ssid_raw.ssid :field dest_ssid: + * ax25_frame.ax25_header.dest_ssid_raw.ssid :field ctl: ax25_frame.ax25_header.ctl :field pid: + * ax25_frame.payload.pid */ public class Uvsqsat extends KaitaiStruct { - public static Uvsqsat fromFile(String fileName) throws IOException { - return new Uvsqsat(new ByteBufferKaitaiStream(fileName)); + public static Uvsqsat fromFile(String fileName) throws IOException { + return new Uvsqsat(new ByteBufferKaitaiStream(fileName)); + } + + public Uvsqsat(KaitaiStream _io) { + this(_io, null, null); + } + + public Uvsqsat(KaitaiStream _io, KaitaiStruct _parent) { + this(_io, _parent, null); + } + + public Uvsqsat(KaitaiStream _io, KaitaiStruct _parent, Uvsqsat _root) { + super(_io); + this._parent = _parent; + this._root = _root == null ? this : _root; + _read(); + } + + private void _read() { + this.ax25Frame = new Ax25Frame(this._io, this, _root); + } + + public static class Ax25Frame extends KaitaiStruct { + public static Ax25Frame fromFile(String fileName) throws IOException { + return new Ax25Frame(new ByteBufferKaitaiStream(fileName)); } - public Uvsqsat(KaitaiStream _io) { - this(_io, null, null); + public Ax25Frame(KaitaiStream _io) { + this(_io, null, null); } - public Uvsqsat(KaitaiStream _io, KaitaiStruct _parent) { - this(_io, _parent, null); + public Ax25Frame(KaitaiStream _io, Uvsqsat _parent) { + this(_io, _parent, null); } - public Uvsqsat(KaitaiStream _io, KaitaiStruct _parent, Uvsqsat _root) { - super(_io); - this._parent = _parent; - this._root = _root == null ? this : _root; - _read(); + public Ax25Frame(KaitaiStream _io, Uvsqsat _parent, Uvsqsat _root) { + super(_io); + this._parent = _parent; + this._root = _root; + _read(); } + private void _read() { - this.ax25Frame = new Ax25Frame(this._io, this, _root); - } - public static class Ax25Frame extends KaitaiStruct { - public static Ax25Frame fromFile(String fileName) throws IOException { - return new Ax25Frame(new ByteBufferKaitaiStream(fileName)); - } - - public Ax25Frame(KaitaiStream _io) { - this(_io, null, null); - } - - public Ax25Frame(KaitaiStream _io, Uvsqsat _parent) { - this(_io, _parent, null); - } - - public Ax25Frame(KaitaiStream _io, Uvsqsat _parent, Uvsqsat _root) { - super(_io); - this._parent = _parent; - this._root = _root; - _read(); - } - private void _read() { - this.ax25Header = new Ax25Header(this._io, this, _root); - switch ((ax25Header().ctl() & 19)) { - case 0: { - this.payload = new IFrame(this._io, this, _root); - break; - } - case 3: { - this.payload = new UiFrame(this._io, this, _root); - break; - } - case 19: { - this.payload = new UiFrame(this._io, this, _root); - break; - } - case 16: { - this.payload = new IFrame(this._io, this, _root); - break; - } - case 18: { - this.payload = new IFrame(this._io, this, _root); - break; - } - case 2: { - this.payload = new IFrame(this._io, this, _root); - break; - } - default: { - this.payload = new IFrame(this._io, this, _root); - break; - } - } - } - private Ax25Header ax25Header; - private KaitaiStruct payload; - private Uvsqsat _root; - private Uvsqsat _parent; - public Ax25Header ax25Header() { return ax25Header; } - public KaitaiStruct payload() { return payload; } - public Uvsqsat _root() { return _root; } - public Uvsqsat _parent() { return _parent; } - } - public static class Ax25Header extends KaitaiStruct { - public static Ax25Header fromFile(String fileName) throws IOException { - return new Ax25Header(new ByteBufferKaitaiStream(fileName)); - } - - public Ax25Header(KaitaiStream _io) { - this(_io, null, null); - } - - public Ax25Header(KaitaiStream _io, Uvsqsat.Ax25Frame _parent) { - this(_io, _parent, null); - } - - public Ax25Header(KaitaiStream _io, Uvsqsat.Ax25Frame _parent, Uvsqsat _root) { - super(_io); - this._parent = _parent; - this._root = _root; - _read(); - } - private void _read() { - this.destCallsignRaw = new CallsignRaw(this._io, this, _root); - this.destSsidRaw = new SsidMask(this._io, this, _root); - this.srcCallsignRaw = new CallsignRaw(this._io, this, _root); - this.srcSsidRaw = new SsidMask(this._io, this, _root); - this.ctl = this._io.readU1(); - } - private CallsignRaw destCallsignRaw; - private SsidMask destSsidRaw; - private CallsignRaw srcCallsignRaw; - private SsidMask srcSsidRaw; - private int ctl; - private Uvsqsat _root; - private Uvsqsat.Ax25Frame _parent; - public CallsignRaw destCallsignRaw() { return destCallsignRaw; } - public SsidMask destSsidRaw() { return destSsidRaw; } - public CallsignRaw srcCallsignRaw() { return srcCallsignRaw; } - public SsidMask srcSsidRaw() { return srcSsidRaw; } - public int ctl() { return ctl; } - public Uvsqsat _root() { return _root; } - public Uvsqsat.Ax25Frame _parent() { return _parent; } - } - public static class UiFrame extends KaitaiStruct { - public static UiFrame fromFile(String fileName) throws IOException { - return new UiFrame(new ByteBufferKaitaiStream(fileName)); - } - - public UiFrame(KaitaiStream _io) { - this(_io, null, null); - } - - public UiFrame(KaitaiStream _io, Uvsqsat.Ax25Frame _parent) { - this(_io, _parent, null); - } - - public UiFrame(KaitaiStream _io, Uvsqsat.Ax25Frame _parent, Uvsqsat _root) { - super(_io); - this._parent = _parent; - this._root = _root; - _read(); - } - private void _read() { - this.pid = this._io.readU1(); - this.packetPrimaryHeader = new PacketPrimaryHeader(this._io, this, _root); - this.packetSecondaryHeader = new PacketSecondaryHeader(this._io, this, _root); - switch (packetSecondaryHeader().sid()) { - case 14: { - this.tlm = new AmsatAscii(this._io, this, _root); - break; - } - case 17: { - this.tlm = new ObcStatus(this._io, this, _root); - break; - } - case 24: { - this.tlm = new TrxvutxHk(this._io, this, _root); - break; - } - case 20: { - this.tlm = new MainboardHk(this._io, this, _root); - break; - } - case 19: { - this.tlm = new MainboardAllScience(this._io, this, _root); - break; - } - case 23: { - this.tlm = new ImtqHk(this._io, this, _root); - break; - } - case 15: { - this.tlm = new Beacon(this._io, this, _root); - break; - } - case 21: { - this.tlm = new IepsHkStatus(this._io, this, _root); - break; - } - case 16: { - this.tlm = new AntsHk(this._io, this, _root); - break; - } - case 18: { - this.tlm = new ObcHk(this._io, this, _root); - break; - } - case 22: { - this.tlm = new TrxvurxHk(this._io, this, _root); - break; - } - default: { - this.tlm = new MsgOrUnknow(this._io, this, _root); - break; - } - } - this.ax25Info = this._io.readBytesFull(); - } - private int pid; - private PacketPrimaryHeader packetPrimaryHeader; - private PacketSecondaryHeader packetSecondaryHeader; - private KaitaiStruct tlm; - private byte[] ax25Info; - private Uvsqsat _root; - private Uvsqsat.Ax25Frame _parent; - public int pid() { return pid; } - public PacketPrimaryHeader packetPrimaryHeader() { return packetPrimaryHeader; } - public PacketSecondaryHeader packetSecondaryHeader() { return packetSecondaryHeader; } - public KaitaiStruct tlm() { return tlm; } - public byte[] ax25Info() { return ax25Info; } - public Uvsqsat _root() { return _root; } - public Uvsqsat.Ax25Frame _parent() { return _parent; } - } - public static class Callsign extends KaitaiStruct { - public static Callsign fromFile(String fileName) throws IOException { - return new Callsign(new ByteBufferKaitaiStream(fileName)); - } - - public Callsign(KaitaiStream _io) { - this(_io, null, null); - } - - public Callsign(KaitaiStream _io, Uvsqsat.CallsignRaw _parent) { - this(_io, _parent, null); - } - - public Callsign(KaitaiStream _io, Uvsqsat.CallsignRaw _parent, Uvsqsat _root) { - super(_io); - this._parent = _parent; - this._root = _root; - _read(); - } - private void _read() { - this.callsign = new String(this._io.readBytes(6), Charset.forName("ASCII")); - } - private String callsign; - private Uvsqsat _root; - private Uvsqsat.CallsignRaw _parent; - public String callsign() { return callsign; } - public Uvsqsat _root() { return _root; } - public Uvsqsat.CallsignRaw _parent() { return _parent; } - } - public static class PacketPrimaryHeader extends KaitaiStruct { - public static PacketPrimaryHeader fromFile(String fileName) throws IOException { - return new PacketPrimaryHeader(new ByteBufferKaitaiStream(fileName)); - } - - public PacketPrimaryHeader(KaitaiStream _io) { - this(_io, null, null); - } - - public PacketPrimaryHeader(KaitaiStream _io, Uvsqsat.UiFrame _parent) { - this(_io, _parent, null); - } - - public PacketPrimaryHeader(KaitaiStream _io, Uvsqsat.UiFrame _parent, Uvsqsat _root) { - super(_io); - this._parent = _parent; - this._root = _root; - _read(); - } - private void _read() { - this.packetVersionNumber = this._io.readBitsInt(3); - this.packetIdPacketType = this._io.readBitsInt(1) != 0; - this.packetIdSecondaryHeaderFlag = this._io.readBitsInt(1) != 0; - this.packetIdApplicationProcessId = this._io.readBitsInt(11); - this.packetSequenceControlSecquenceFlag = this._io.readBitsInt(2); - this.packetSequenceControlCountOrName = this._io.readBitsInt(14); - this._io.alignToByte(); - this.packetDataLength = this._io.readU2be(); - } - private long packetVersionNumber; - private boolean packetIdPacketType; - private boolean packetIdSecondaryHeaderFlag; - private long packetIdApplicationProcessId; - private long packetSequenceControlSecquenceFlag; - private long packetSequenceControlCountOrName; - private int packetDataLength; - private Uvsqsat _root; - private Uvsqsat.UiFrame _parent; - public long packetVersionNumber() { return packetVersionNumber; } - public boolean packetIdPacketType() { return packetIdPacketType; } - public boolean packetIdSecondaryHeaderFlag() { return packetIdSecondaryHeaderFlag; } - public long packetIdApplicationProcessId() { return packetIdApplicationProcessId; } - public long packetSequenceControlSecquenceFlag() { return packetSequenceControlSecquenceFlag; } - public long packetSequenceControlCountOrName() { return packetSequenceControlCountOrName; } - public int packetDataLength() { return packetDataLength; } - public Uvsqsat _root() { return _root; } - public Uvsqsat.UiFrame _parent() { return _parent; } - } - public static class TrxvutxHk extends KaitaiStruct { - public static TrxvutxHk fromFile(String fileName) throws IOException { - return new TrxvutxHk(new ByteBufferKaitaiStream(fileName)); - } - - public TrxvutxHk(KaitaiStream _io) { - this(_io, null, null); - } - - public TrxvutxHk(KaitaiStream _io, Uvsqsat.UiFrame _parent) { - this(_io, _parent, null); - } - - public TrxvutxHk(KaitaiStream _io, Uvsqsat.UiFrame _parent, Uvsqsat _root) { - super(_io); - this._parent = _parent; - this._root = _root; - _read(); - } - private void _read() { - this.trxvutxInstantaneousRfReflectedPowerFromTransmitterPort = this._io.readBitsInt(12); - this.trxvutxInstantaneousRfForwardPowerFromTransmitterPort = this._io.readBitsInt(12); - this.trxvutxSupplyVoltage = this._io.readBitsInt(12); - this.trxvutxTotalSupplyCurrent = this._io.readBitsInt(12); - this.trxvutxTransmitterCurrent = this._io.readBitsInt(12); - this.trxvutxReceiverCurrent = this._io.readBitsInt(12); - this.trxvutxPowerAmplifierCurrent = this._io.readBitsInt(12); - this.trxvutxPowerAmplifierTemperature = this._io.readBitsInt(12); - this.trxvutxLocalOscillatorTemperature = this._io.readBitsInt(12); - this.trxvutxZeroPadding = this._io.readBitsInt(4); - this._io.alignToByte(); - this.trxvuTxUptime = this._io.readU4be(); - this.trxvuTxState = this._io.readU1(); - } - private Double trxvutxTotalSupplyCurrentMa; - public Double trxvutxTotalSupplyCurrentMa() { - if (this.trxvutxTotalSupplyCurrentMa != null) - return this.trxvutxTotalSupplyCurrentMa; - double _tmp = (double) ((0.16643964 * trxvutxTotalSupplyCurrent())); - this.trxvutxTotalSupplyCurrentMa = _tmp; - return this.trxvutxTotalSupplyCurrentMa; - } - private Double trxvutxPowerAmplifierCurrentMa; - public Double trxvutxPowerAmplifierCurrentMa() { - if (this.trxvutxPowerAmplifierCurrentMa != null) - return this.trxvutxPowerAmplifierCurrentMa; - double _tmp = (double) (((1000.0 * trxvutxPowerAmplifierCurrent()) * 0.16643964)); - this.trxvutxPowerAmplifierCurrentMa = _tmp; - return this.trxvutxPowerAmplifierCurrentMa; - } - private Long trxvuTxUptimeRaw; - public Long trxvuTxUptimeRaw() { - if (this.trxvuTxUptimeRaw != null) - return this.trxvuTxUptimeRaw; - long _tmp = (long) (trxvuTxUptime()); - this.trxvuTxUptimeRaw = _tmp; - return this.trxvuTxUptimeRaw; - } - private Double trxvutxSupplyVoltageV; - public Double trxvutxSupplyVoltageV() { - if (this.trxvutxSupplyVoltageV != null) - return this.trxvutxSupplyVoltageV; - double _tmp = (double) ((0.00488 * trxvutxSupplyVoltage())); - this.trxvutxSupplyVoltageV = _tmp; - return this.trxvutxSupplyVoltageV; - } - private Double trxvutxInstantaneousRfReflectedPowerFromTransmitterPortMw; - public Double trxvutxInstantaneousRfReflectedPowerFromTransmitterPortMw() { - if (this.trxvutxInstantaneousRfReflectedPowerFromTransmitterPortMw != null) - return this.trxvutxInstantaneousRfReflectedPowerFromTransmitterPortMw; - double _tmp = (double) (((((1000.0 * trxvutxInstantaneousRfReflectedPowerFromTransmitterPort()) * trxvutxInstantaneousRfReflectedPowerFromTransmitterPort()) * 5.887) * 0.00001)); - this.trxvutxInstantaneousRfReflectedPowerFromTransmitterPortMw = _tmp; - return this.trxvutxInstantaneousRfReflectedPowerFromTransmitterPortMw; - } - private Double trxvutxLocalOscillatorTemperatureC; - public Double trxvutxLocalOscillatorTemperatureC() { - if (this.trxvutxLocalOscillatorTemperatureC != null) - return this.trxvutxLocalOscillatorTemperatureC; - double _tmp = (double) (((trxvutxLocalOscillatorTemperature() * -0.07669) + 195.6037)); - this.trxvutxLocalOscillatorTemperatureC = _tmp; - return this.trxvutxLocalOscillatorTemperatureC; - } - private Double trxvutxInstantaneousRfForwardPowerFromTransmitterPortMw; - public Double trxvutxInstantaneousRfForwardPowerFromTransmitterPortMw() { - if (this.trxvutxInstantaneousRfForwardPowerFromTransmitterPortMw != null) - return this.trxvutxInstantaneousRfForwardPowerFromTransmitterPortMw; - double _tmp = (double) (((((1000.0 * trxvutxInstantaneousRfForwardPowerFromTransmitterPort()) * trxvutxInstantaneousRfForwardPowerFromTransmitterPort()) * 5.887) * 0.00001)); - this.trxvutxInstantaneousRfForwardPowerFromTransmitterPortMw = _tmp; - return this.trxvutxInstantaneousRfForwardPowerFromTransmitterPortMw; - } - private Double trxvutxReceiverCurrentMa; - public Double trxvutxReceiverCurrentMa() { - if (this.trxvutxReceiverCurrentMa != null) - return this.trxvutxReceiverCurrentMa; - double _tmp = (double) ((trxvutxReceiverCurrent() * 0.16643964)); - this.trxvutxReceiverCurrentMa = _tmp; - return this.trxvutxReceiverCurrentMa; - } - private Long trxvutxZeroPaddingRaw; - public Long trxvutxZeroPaddingRaw() { - if (this.trxvutxZeroPaddingRaw != null) - return this.trxvutxZeroPaddingRaw; - long _tmp = (long) (trxvutxZeroPadding()); - this.trxvutxZeroPaddingRaw = _tmp; - return this.trxvutxZeroPaddingRaw; - } - private Double trxvutxPowerAmplifierTemperatureC; - public Double trxvutxPowerAmplifierTemperatureC() { - if (this.trxvutxPowerAmplifierTemperatureC != null) - return this.trxvutxPowerAmplifierTemperatureC; - double _tmp = (double) (((trxvutxPowerAmplifierTemperature() * -0.07669) + 195.6037)); - this.trxvutxPowerAmplifierTemperatureC = _tmp; - return this.trxvutxPowerAmplifierTemperatureC; - } - private Double trxvutxTransmitterCurrentMa; - public Double trxvutxTransmitterCurrentMa() { - if (this.trxvutxTransmitterCurrentMa != null) - return this.trxvutxTransmitterCurrentMa; - double _tmp = (double) ((trxvutxTransmitterCurrent() * 0.16643964)); - this.trxvutxTransmitterCurrentMa = _tmp; - return this.trxvutxTransmitterCurrentMa; - } - private Integer trxvuTxStateRaw; - public Integer trxvuTxStateRaw() { - if (this.trxvuTxStateRaw != null) - return this.trxvuTxStateRaw; - int _tmp = (int) (trxvuTxState()); - this.trxvuTxStateRaw = _tmp; - return this.trxvuTxStateRaw; - } - private long trxvutxInstantaneousRfReflectedPowerFromTransmitterPort; - private long trxvutxInstantaneousRfForwardPowerFromTransmitterPort; - private long trxvutxSupplyVoltage; - private long trxvutxTotalSupplyCurrent; - private long trxvutxTransmitterCurrent; - private long trxvutxReceiverCurrent; - private long trxvutxPowerAmplifierCurrent; - private long trxvutxPowerAmplifierTemperature; - private long trxvutxLocalOscillatorTemperature; - private long trxvutxZeroPadding; - private long trxvuTxUptime; - private int trxvuTxState; - private Uvsqsat _root; - private Uvsqsat.UiFrame _parent; - public long trxvutxInstantaneousRfReflectedPowerFromTransmitterPort() { return trxvutxInstantaneousRfReflectedPowerFromTransmitterPort; } - public long trxvutxInstantaneousRfForwardPowerFromTransmitterPort() { return trxvutxInstantaneousRfForwardPowerFromTransmitterPort; } - public long trxvutxSupplyVoltage() { return trxvutxSupplyVoltage; } - public long trxvutxTotalSupplyCurrent() { return trxvutxTotalSupplyCurrent; } - public long trxvutxTransmitterCurrent() { return trxvutxTransmitterCurrent; } - public long trxvutxReceiverCurrent() { return trxvutxReceiverCurrent; } - public long trxvutxPowerAmplifierCurrent() { return trxvutxPowerAmplifierCurrent; } - public long trxvutxPowerAmplifierTemperature() { return trxvutxPowerAmplifierTemperature; } - public long trxvutxLocalOscillatorTemperature() { return trxvutxLocalOscillatorTemperature; } - public long trxvutxZeroPadding() { return trxvutxZeroPadding; } - public long trxvuTxUptime() { return trxvuTxUptime; } - public int trxvuTxState() { return trxvuTxState; } - public Uvsqsat _root() { return _root; } - public Uvsqsat.UiFrame _parent() { return _parent; } - } - public static class MainboardAllScience extends KaitaiStruct { - public static MainboardAllScience fromFile(String fileName) throws IOException { - return new MainboardAllScience(new ByteBufferKaitaiStream(fileName)); - } - - public MainboardAllScience(KaitaiStream _io) { - this(_io, null, null); - } - - public MainboardAllScience(KaitaiStream _io, Uvsqsat.UiFrame _parent) { - this(_io, _parent, null); - } - - public MainboardAllScience(KaitaiStream _io, Uvsqsat.UiFrame _parent, Uvsqsat _root) { - super(_io); - this._parent = _parent; - this._root = _root; - _read(); - } - private void _read() { - this.mainboardScienceTime = this._io.readU4be(); - this.teachWearOn = this._io.readU1(); - this.frequenceOfAcquisitions = this._io.readU2be(); - this.gain = this._io.readU4be(); - this.numberOfAcquisitionCommanded = this._io.readU2be(); - this.numberOfRealAcquisition = this._io.readU2be(); - this.hkPlus5v = this._io.readU4be(); - this.hkMinus5v = this._io.readU4be(); - this.hkMinus5vPolar = this._io.readU4be(); - this.hkTempAdc = this._io.readU4be(); - this.hkFeePlusXVref = this._io.readU4be(); - this.hkFeeMinusXVref = this._io.readU4be(); - this.hkFeePlusYVref = this._io.readU4be(); - this.hkFeeMinusYVref = this._io.readU4be(); - this.feePlusXErs1Signal = this._io.readU4be(); - this.feePlusXErs1Temperature = this._io.readU4be(); - this.feePlusXErs2Signal = this._io.readU4be(); - this.feePlusXErs2Temperature = this._io.readU4be(); - this.feePlusXErs3Signal = this._io.readU4be(); - this.feePlusXErs3Temperature = this._io.readU4be(); - this.feePlusXUvsSignal = this._io.readU4be(); - this.feeMinusXErs1Signal = this._io.readU4be(); - this.feeMinusXErs1Temperature = this._io.readU4be(); - this.feeMinusXErs2Signal = this._io.readU4be(); - this.feeMinusXErs2Temperature = this._io.readU4be(); - this.feeMinusXErs3Signal = this._io.readU4be(); - this.feeMinusXErs3Temperature = this._io.readU4be(); - this.feeMinusXUvsSignal = this._io.readU4be(); - this.feePlusYErs1Signal = this._io.readU4be(); - this.feePlusYErs1Temperature = this._io.readU4be(); - this.feePlusYErs2Signal = this._io.readU4be(); - this.feePlusYErs2Temperature = this._io.readU4be(); - this.feePlusYErs3Signal = this._io.readU4be(); - this.feePlusYErs3Temperature = this._io.readU4be(); - this.feePlusYUvsSignal = this._io.readU4be(); - this.feeMinusYErs1Signal = this._io.readU4be(); - this.feeMinusYErs1Temperature = this._io.readU4be(); - this.feeMinusYErs2Signal = this._io.readU4be(); - this.feeMinusYErs2Temperature = this._io.readU4be(); - this.feeMinusYErs3Signal = this._io.readU4be(); - this.feeMinusYErs3Temperature = this._io.readU4be(); - this.feeMinusYUvsSignal = this._io.readU4be(); - this.teachwearAccX = this._io.readU2be(); - this.teachwearAccY = this._io.readU2be(); - this.teachwearAccZ = this._io.readU2be(); - this.teachwearDegC = this._io.readU2be(); - this.teachwearGyroX = this._io.readU2be(); - this.teachwearGyroY = this._io.readU2be(); - this.teachwearGyroZ = this._io.readU2be(); - this.teachwearMagnX = this._io.readU2be(); - this.teachwearMagnY = this._io.readU2be(); - this.teachwearMagnZ = this._io.readU2be(); - this.teachwearState = this._io.readU1(); - this.teachwearResetReason = this._io.readU1(); - this.teachwearCrc = this._io.readU2be(); - this.nbTmSinceFirstStart = this._io.readU4be(); - } - private Long feePlusYErs1SignalRaw; - public Long feePlusYErs1SignalRaw() { - if (this.feePlusYErs1SignalRaw != null) - return this.feePlusYErs1SignalRaw; - long _tmp = (long) (feePlusYErs1Signal()); - this.feePlusYErs1SignalRaw = _tmp; - return this.feePlusYErs1SignalRaw; - } - private Long feeMinusYErs1TemperatureRaw; - public Long feeMinusYErs1TemperatureRaw() { - if (this.feeMinusYErs1TemperatureRaw != null) - return this.feeMinusYErs1TemperatureRaw; - long _tmp = (long) (feeMinusYErs1Temperature()); - this.feeMinusYErs1TemperatureRaw = _tmp; - return this.feeMinusYErs1TemperatureRaw; - } - private Integer teachwearCRCRaw; - public Integer teachwearCRCRaw() { - if (this.teachwearCRCRaw != null) - return this.teachwearCRCRaw; - int _tmp = (int) (teachwearCrc()); - this.teachwearCRCRaw = _tmp; - return this.teachwearCRCRaw; - } - private Long feePlusXErs2SignalRaw; - public Long feePlusXErs2SignalRaw() { - if (this.feePlusXErs2SignalRaw != null) - return this.feePlusXErs2SignalRaw; - long _tmp = (long) (feePlusXErs2Signal()); - this.feePlusXErs2SignalRaw = _tmp; - return this.feePlusXErs2SignalRaw; - } - private Long hkFeePlusXVrefRaw; - public Long hkFeePlusXVrefRaw() { - if (this.hkFeePlusXVrefRaw != null) - return this.hkFeePlusXVrefRaw; - long _tmp = (long) (hkFeePlusXVref()); - this.hkFeePlusXVrefRaw = _tmp; - return this.hkFeePlusXVrefRaw; - } - private Long feeMinusYUvsSignalRaw; - public Long feeMinusYUvsSignalRaw() { - if (this.feeMinusYUvsSignalRaw != null) - return this.feeMinusYUvsSignalRaw; - long _tmp = (long) (feeMinusYUvsSignal()); - this.feeMinusYUvsSignalRaw = _tmp; - return this.feeMinusYUvsSignalRaw; - } - private Integer teachwearMagnYRaw; - public Integer teachwearMagnYRaw() { - if (this.teachwearMagnYRaw != null) - return this.teachwearMagnYRaw; - int _tmp = (int) (teachwearMagnY()); - this.teachwearMagnYRaw = _tmp; - return this.teachwearMagnYRaw; - } - private Long hkMinus5vPolarRaw; - public Long hkMinus5vPolarRaw() { - if (this.hkMinus5vPolarRaw != null) - return this.hkMinus5vPolarRaw; - long _tmp = (long) (hkMinus5vPolar()); - this.hkMinus5vPolarRaw = _tmp; - return this.hkMinus5vPolarRaw; - } - private Integer teachwearGyroZRaw; - public Integer teachwearGyroZRaw() { - if (this.teachwearGyroZRaw != null) - return this.teachwearGyroZRaw; - int _tmp = (int) (teachwearGyroZ()); - this.teachwearGyroZRaw = _tmp; - return this.teachwearGyroZRaw; - } - private Long feePlusXErs2TemperatureRaw; - public Long feePlusXErs2TemperatureRaw() { - if (this.feePlusXErs2TemperatureRaw != null) - return this.feePlusXErs2TemperatureRaw; - long _tmp = (long) (feePlusXErs2Temperature()); - this.feePlusXErs2TemperatureRaw = _tmp; - return this.feePlusXErs2TemperatureRaw; - } - private Long feeMinusYErs3TemperatureRaw; - public Long feeMinusYErs3TemperatureRaw() { - if (this.feeMinusYErs3TemperatureRaw != null) - return this.feeMinusYErs3TemperatureRaw; - long _tmp = (long) (feeMinusYErs3Temperature()); - this.feeMinusYErs3TemperatureRaw = _tmp; - return this.feeMinusYErs3TemperatureRaw; - } - private Long feePlusYUvsSignalRaw; - public Long feePlusYUvsSignalRaw() { - if (this.feePlusYUvsSignalRaw != null) - return this.feePlusYUvsSignalRaw; - long _tmp = (long) (feePlusYUvsSignal()); - this.feePlusYUvsSignalRaw = _tmp; - return this.feePlusYUvsSignalRaw; - } - private Long hkTempAdcRaw; - public Long hkTempAdcRaw() { - if (this.hkTempAdcRaw != null) - return this.hkTempAdcRaw; - long _tmp = (long) (hkTempAdc()); - this.hkTempAdcRaw = _tmp; - return this.hkTempAdcRaw; - } - private Long feePlusXErs3TemperatureRaw; - public Long feePlusXErs3TemperatureRaw() { - if (this.feePlusXErs3TemperatureRaw != null) - return this.feePlusXErs3TemperatureRaw; - long _tmp = (long) (feePlusXErs3Temperature()); - this.feePlusXErs3TemperatureRaw = _tmp; - return this.feePlusXErs3TemperatureRaw; - } - private Long hkFeePlusYVrefRaw; - public Long hkFeePlusYVrefRaw() { - if (this.hkFeePlusYVrefRaw != null) - return this.hkFeePlusYVrefRaw; - long _tmp = (long) (hkFeePlusYVref()); - this.hkFeePlusYVrefRaw = _tmp; - return this.hkFeePlusYVrefRaw; - } - private Long feeMinusYErs3SignalRaw; - public Long feeMinusYErs3SignalRaw() { - if (this.feeMinusYErs3SignalRaw != null) - return this.feeMinusYErs3SignalRaw; - long _tmp = (long) (feeMinusYErs3Signal()); - this.feeMinusYErs3SignalRaw = _tmp; - return this.feeMinusYErs3SignalRaw; - } - private Long feeMinusXErs2SignalRaw; - public Long feeMinusXErs2SignalRaw() { - if (this.feeMinusXErs2SignalRaw != null) - return this.feeMinusXErs2SignalRaw; - long _tmp = (long) (feeMinusXErs2Signal()); - this.feeMinusXErs2SignalRaw = _tmp; - return this.feeMinusXErs2SignalRaw; - } - private Integer numberOfAcquisitionCommandedRaw; - public Integer numberOfAcquisitionCommandedRaw() { - if (this.numberOfAcquisitionCommandedRaw != null) - return this.numberOfAcquisitionCommandedRaw; - int _tmp = (int) (numberOfAcquisitionCommanded()); - this.numberOfAcquisitionCommandedRaw = _tmp; - return this.numberOfAcquisitionCommandedRaw; - } - private Long gainRaw; - public Long gainRaw() { - if (this.gainRaw != null) - return this.gainRaw; - long _tmp = (long) (gain()); - this.gainRaw = _tmp; - return this.gainRaw; - } - private Long feeMinusYErs1SignalRaw; - public Long feeMinusYErs1SignalRaw() { - if (this.feeMinusYErs1SignalRaw != null) - return this.feeMinusYErs1SignalRaw; - long _tmp = (long) (feeMinusYErs1Signal()); - this.feeMinusYErs1SignalRaw = _tmp; - return this.feeMinusYErs1SignalRaw; - } - private Integer teachwearAccZRaw; - public Integer teachwearAccZRaw() { - if (this.teachwearAccZRaw != null) - return this.teachwearAccZRaw; - int _tmp = (int) (teachwearAccZ()); - this.teachwearAccZRaw = _tmp; - return this.teachwearAccZRaw; - } - private Long mainboardScienceTimeRaw; - public Long mainboardScienceTimeRaw() { - if (this.mainboardScienceTimeRaw != null) - return this.mainboardScienceTimeRaw; - long _tmp = (long) (mainboardScienceTime()); - this.mainboardScienceTimeRaw = _tmp; - return this.mainboardScienceTimeRaw; - } - private Long feePlusXErs3SignalRaw; - public Long feePlusXErs3SignalRaw() { - if (this.feePlusXErs3SignalRaw != null) - return this.feePlusXErs3SignalRaw; - long _tmp = (long) (feePlusXErs3Signal()); - this.feePlusXErs3SignalRaw = _tmp; - return this.feePlusXErs3SignalRaw; - } - private Integer teachwearAccXRaw; - public Integer teachwearAccXRaw() { - if (this.teachwearAccXRaw != null) - return this.teachwearAccXRaw; - int _tmp = (int) (teachwearAccX()); - this.teachwearAccXRaw = _tmp; - return this.teachwearAccXRaw; - } - private Long feeMinusXUvsSignalRaw; - public Long feeMinusXUvsSignalRaw() { - if (this.feeMinusXUvsSignalRaw != null) - return this.feeMinusXUvsSignalRaw; - long _tmp = (long) (feeMinusXUvsSignal()); - this.feeMinusXUvsSignalRaw = _tmp; - return this.feeMinusXUvsSignalRaw; - } - private Long feePlusYErs3TemperatureRaw; - public Long feePlusYErs3TemperatureRaw() { - if (this.feePlusYErs3TemperatureRaw != null) - return this.feePlusYErs3TemperatureRaw; - long _tmp = (long) (feePlusYErs3Temperature()); - this.feePlusYErs3TemperatureRaw = _tmp; - return this.feePlusYErs3TemperatureRaw; - } - private Long feeMinusXErs1TemperatureRaw; - public Long feeMinusXErs1TemperatureRaw() { - if (this.feeMinusXErs1TemperatureRaw != null) - return this.feeMinusXErs1TemperatureRaw; - long _tmp = (long) (feeMinusXErs1Temperature()); - this.feeMinusXErs1TemperatureRaw = _tmp; - return this.feeMinusXErs1TemperatureRaw; - } - private Long hkPlus5vRaw; - public Long hkPlus5vRaw() { - if (this.hkPlus5vRaw != null) - return this.hkPlus5vRaw; - long _tmp = (long) (hkPlus5v()); - this.hkPlus5vRaw = _tmp; - return this.hkPlus5vRaw; - } - private Integer numberOfRealAcquisitionRaw; - public Integer numberOfRealAcquisitionRaw() { - if (this.numberOfRealAcquisitionRaw != null) - return this.numberOfRealAcquisitionRaw; - int _tmp = (int) (numberOfRealAcquisition()); - this.numberOfRealAcquisitionRaw = _tmp; - return this.numberOfRealAcquisitionRaw; - } - private Long feePlusYErs2SignalRaw; - public Long feePlusYErs2SignalRaw() { - if (this.feePlusYErs2SignalRaw != null) - return this.feePlusYErs2SignalRaw; - long _tmp = (long) (feePlusYErs2Signal()); - this.feePlusYErs2SignalRaw = _tmp; - return this.feePlusYErs2SignalRaw; - } - private Integer teachWearOnRaw; - public Integer teachWearOnRaw() { - if (this.teachWearOnRaw != null) - return this.teachWearOnRaw; - int _tmp = (int) (teachWearOn()); - this.teachWearOnRaw = _tmp; - return this.teachWearOnRaw; - } - private Integer frequenceOfAcquisitionsRaw; - public Integer frequenceOfAcquisitionsRaw() { - if (this.frequenceOfAcquisitionsRaw != null) - return this.frequenceOfAcquisitionsRaw; - int _tmp = (int) (frequenceOfAcquisitions()); - this.frequenceOfAcquisitionsRaw = _tmp; - return this.frequenceOfAcquisitionsRaw; - } - private Long feePlusYErs2TemperatureRaw; - public Long feePlusYErs2TemperatureRaw() { - if (this.feePlusYErs2TemperatureRaw != null) - return this.feePlusYErs2TemperatureRaw; - long _tmp = (long) (feePlusYErs2Temperature()); - this.feePlusYErs2TemperatureRaw = _tmp; - return this.feePlusYErs2TemperatureRaw; - } - private Long nbTmSinceFirstStartRaw; - public Long nbTmSinceFirstStartRaw() { - if (this.nbTmSinceFirstStartRaw != null) - return this.nbTmSinceFirstStartRaw; - long _tmp = (long) (nbTmSinceFirstStart()); - this.nbTmSinceFirstStartRaw = _tmp; - return this.nbTmSinceFirstStartRaw; - } - private Integer teachwearMagnXRaw; - public Integer teachwearMagnXRaw() { - if (this.teachwearMagnXRaw != null) - return this.teachwearMagnXRaw; - int _tmp = (int) (teachwearMagnX()); - this.teachwearMagnXRaw = _tmp; - return this.teachwearMagnXRaw; - } - private Long feeMinusXErs1SignalRaw; - public Long feeMinusXErs1SignalRaw() { - if (this.feeMinusXErs1SignalRaw != null) - return this.feeMinusXErs1SignalRaw; - long _tmp = (long) (feeMinusXErs1Signal()); - this.feeMinusXErs1SignalRaw = _tmp; - return this.feeMinusXErs1SignalRaw; - } - private Long feeMinusXErs3SignalRaw; - public Long feeMinusXErs3SignalRaw() { - if (this.feeMinusXErs3SignalRaw != null) - return this.feeMinusXErs3SignalRaw; - long _tmp = (long) (feeMinusXErs3Signal()); - this.feeMinusXErs3SignalRaw = _tmp; - return this.feeMinusXErs3SignalRaw; - } - private Long feeMinusYErs2SignalRaw; - public Long feeMinusYErs2SignalRaw() { - if (this.feeMinusYErs2SignalRaw != null) - return this.feeMinusYErs2SignalRaw; - long _tmp = (long) (feeMinusYErs2Signal()); - this.feeMinusYErs2SignalRaw = _tmp; - return this.feeMinusYErs2SignalRaw; - } - private Long feeMinusYErs2TemperatureRaw; - public Long feeMinusYErs2TemperatureRaw() { - if (this.feeMinusYErs2TemperatureRaw != null) - return this.feeMinusYErs2TemperatureRaw; - long _tmp = (long) (feeMinusYErs2Temperature()); - this.feeMinusYErs2TemperatureRaw = _tmp; - return this.feeMinusYErs2TemperatureRaw; - } - private Long feeMinusXErs2TemperatureRaw; - public Long feeMinusXErs2TemperatureRaw() { - if (this.feeMinusXErs2TemperatureRaw != null) - return this.feeMinusXErs2TemperatureRaw; - long _tmp = (long) (feeMinusXErs2Temperature()); - this.feeMinusXErs2TemperatureRaw = _tmp; - return this.feeMinusXErs2TemperatureRaw; - } - private Long feePlusXErs1TemperatureRaw; - public Long feePlusXErs1TemperatureRaw() { - if (this.feePlusXErs1TemperatureRaw != null) - return this.feePlusXErs1TemperatureRaw; - long _tmp = (long) (feePlusXErs1Temperature()); - this.feePlusXErs1TemperatureRaw = _tmp; - return this.feePlusXErs1TemperatureRaw; - } - private Long hkFeeMinusXVrefRaw; - public Long hkFeeMinusXVrefRaw() { - if (this.hkFeeMinusXVrefRaw != null) - return this.hkFeeMinusXVrefRaw; - long _tmp = (long) (hkFeeMinusXVref()); - this.hkFeeMinusXVrefRaw = _tmp; - return this.hkFeeMinusXVrefRaw; - } - private Long feePlusYErs1TemperatureRaw; - public Long feePlusYErs1TemperatureRaw() { - if (this.feePlusYErs1TemperatureRaw != null) - return this.feePlusYErs1TemperatureRaw; - long _tmp = (long) (feePlusYErs1Temperature()); - this.feePlusYErs1TemperatureRaw = _tmp; - return this.feePlusYErs1TemperatureRaw; - } - private Integer teachwearGyroXRaw; - public Integer teachwearGyroXRaw() { - if (this.teachwearGyroXRaw != null) - return this.teachwearGyroXRaw; - int _tmp = (int) (teachwearGyroX()); - this.teachwearGyroXRaw = _tmp; - return this.teachwearGyroXRaw; - } - private Long feePlusXUvsSignalRaw; - public Long feePlusXUvsSignalRaw() { - if (this.feePlusXUvsSignalRaw != null) - return this.feePlusXUvsSignalRaw; - long _tmp = (long) (feePlusXUvsSignal()); - this.feePlusXUvsSignalRaw = _tmp; - return this.feePlusXUvsSignalRaw; - } - private Long hkFeeMinusYVrefRaw; - public Long hkFeeMinusYVrefRaw() { - if (this.hkFeeMinusYVrefRaw != null) - return this.hkFeeMinusYVrefRaw; - long _tmp = (long) (hkFeeMinusYVref()); - this.hkFeeMinusYVrefRaw = _tmp; - return this.hkFeeMinusYVrefRaw; - } - private Integer teachwearStateRaw; - public Integer teachwearStateRaw() { - if (this.teachwearStateRaw != null) - return this.teachwearStateRaw; - int _tmp = (int) (teachwearState()); - this.teachwearStateRaw = _tmp; - return this.teachwearStateRaw; - } - private Long feePlusXErs1SignalRaw; - public Long feePlusXErs1SignalRaw() { - if (this.feePlusXErs1SignalRaw != null) - return this.feePlusXErs1SignalRaw; - long _tmp = (long) (feePlusXErs1Signal()); - this.feePlusXErs1SignalRaw = _tmp; - return this.feePlusXErs1SignalRaw; - } - private Long hkMinus5vRaw; - public Long hkMinus5vRaw() { - if (this.hkMinus5vRaw != null) - return this.hkMinus5vRaw; - long _tmp = (long) (hkMinus5v()); - this.hkMinus5vRaw = _tmp; - return this.hkMinus5vRaw; - } - private Long feeMinusXErs3TemperatureRaw; - public Long feeMinusXErs3TemperatureRaw() { - if (this.feeMinusXErs3TemperatureRaw != null) - return this.feeMinusXErs3TemperatureRaw; - long _tmp = (long) (feeMinusXErs3Temperature()); - this.feeMinusXErs3TemperatureRaw = _tmp; - return this.feeMinusXErs3TemperatureRaw; - } - private Integer teachwearResetReasonRaw; - public Integer teachwearResetReasonRaw() { - if (this.teachwearResetReasonRaw != null) - return this.teachwearResetReasonRaw; - int _tmp = (int) (teachwearResetReason()); - this.teachwearResetReasonRaw = _tmp; - return this.teachwearResetReasonRaw; - } - private Integer teachwearDegCRaw; - public Integer teachwearDegCRaw() { - if (this.teachwearDegCRaw != null) - return this.teachwearDegCRaw; - int _tmp = (int) (teachwearDegC()); - this.teachwearDegCRaw = _tmp; - return this.teachwearDegCRaw; - } - private Integer teachwearGyroYRaw; - public Integer teachwearGyroYRaw() { - if (this.teachwearGyroYRaw != null) - return this.teachwearGyroYRaw; - int _tmp = (int) (teachwearGyroY()); - this.teachwearGyroYRaw = _tmp; - return this.teachwearGyroYRaw; - } - private Integer teachwearMagnZRaw; - public Integer teachwearMagnZRaw() { - if (this.teachwearMagnZRaw != null) - return this.teachwearMagnZRaw; - int _tmp = (int) (teachwearMagnZ()); - this.teachwearMagnZRaw = _tmp; - return this.teachwearMagnZRaw; - } - private Long feePlusYErs3SignalRaw; - public Long feePlusYErs3SignalRaw() { - if (this.feePlusYErs3SignalRaw != null) - return this.feePlusYErs3SignalRaw; - long _tmp = (long) (feePlusYErs3Signal()); - this.feePlusYErs3SignalRaw = _tmp; - return this.feePlusYErs3SignalRaw; - } - private Integer teachwearAccYRaw; - public Integer teachwearAccYRaw() { - if (this.teachwearAccYRaw != null) - return this.teachwearAccYRaw; - int _tmp = (int) (teachwearAccY()); - this.teachwearAccYRaw = _tmp; - return this.teachwearAccYRaw; - } - private long mainboardScienceTime; - private int teachWearOn; - private int frequenceOfAcquisitions; - private long gain; - private int numberOfAcquisitionCommanded; - private int numberOfRealAcquisition; - private long hkPlus5v; - private long hkMinus5v; - private long hkMinus5vPolar; - private long hkTempAdc; - private long hkFeePlusXVref; - private long hkFeeMinusXVref; - private long hkFeePlusYVref; - private long hkFeeMinusYVref; - private long feePlusXErs1Signal; - private long feePlusXErs1Temperature; - private long feePlusXErs2Signal; - private long feePlusXErs2Temperature; - private long feePlusXErs3Signal; - private long feePlusXErs3Temperature; - private long feePlusXUvsSignal; - private long feeMinusXErs1Signal; - private long feeMinusXErs1Temperature; - private long feeMinusXErs2Signal; - private long feeMinusXErs2Temperature; - private long feeMinusXErs3Signal; - private long feeMinusXErs3Temperature; - private long feeMinusXUvsSignal; - private long feePlusYErs1Signal; - private long feePlusYErs1Temperature; - private long feePlusYErs2Signal; - private long feePlusYErs2Temperature; - private long feePlusYErs3Signal; - private long feePlusYErs3Temperature; - private long feePlusYUvsSignal; - private long feeMinusYErs1Signal; - private long feeMinusYErs1Temperature; - private long feeMinusYErs2Signal; - private long feeMinusYErs2Temperature; - private long feeMinusYErs3Signal; - private long feeMinusYErs3Temperature; - private long feeMinusYUvsSignal; - private int teachwearAccX; - private int teachwearAccY; - private int teachwearAccZ; - private int teachwearDegC; - private int teachwearGyroX; - private int teachwearGyroY; - private int teachwearGyroZ; - private int teachwearMagnX; - private int teachwearMagnY; - private int teachwearMagnZ; - private int teachwearState; - private int teachwearResetReason; - private int teachwearCrc; - private long nbTmSinceFirstStart; - private Uvsqsat _root; - private Uvsqsat.UiFrame _parent; - public long mainboardScienceTime() { return mainboardScienceTime; } - public int teachWearOn() { return teachWearOn; } - public int frequenceOfAcquisitions() { return frequenceOfAcquisitions; } - public long gain() { return gain; } - public int numberOfAcquisitionCommanded() { return numberOfAcquisitionCommanded; } - public int numberOfRealAcquisition() { return numberOfRealAcquisition; } - public long hkPlus5v() { return hkPlus5v; } - public long hkMinus5v() { return hkMinus5v; } - public long hkMinus5vPolar() { return hkMinus5vPolar; } - public long hkTempAdc() { return hkTempAdc; } - public long hkFeePlusXVref() { return hkFeePlusXVref; } - public long hkFeeMinusXVref() { return hkFeeMinusXVref; } - public long hkFeePlusYVref() { return hkFeePlusYVref; } - public long hkFeeMinusYVref() { return hkFeeMinusYVref; } - public long feePlusXErs1Signal() { return feePlusXErs1Signal; } - public long feePlusXErs1Temperature() { return feePlusXErs1Temperature; } - public long feePlusXErs2Signal() { return feePlusXErs2Signal; } - public long feePlusXErs2Temperature() { return feePlusXErs2Temperature; } - public long feePlusXErs3Signal() { return feePlusXErs3Signal; } - public long feePlusXErs3Temperature() { return feePlusXErs3Temperature; } - public long feePlusXUvsSignal() { return feePlusXUvsSignal; } - public long feeMinusXErs1Signal() { return feeMinusXErs1Signal; } - public long feeMinusXErs1Temperature() { return feeMinusXErs1Temperature; } - public long feeMinusXErs2Signal() { return feeMinusXErs2Signal; } - public long feeMinusXErs2Temperature() { return feeMinusXErs2Temperature; } - public long feeMinusXErs3Signal() { return feeMinusXErs3Signal; } - public long feeMinusXErs3Temperature() { return feeMinusXErs3Temperature; } - public long feeMinusXUvsSignal() { return feeMinusXUvsSignal; } - public long feePlusYErs1Signal() { return feePlusYErs1Signal; } - public long feePlusYErs1Temperature() { return feePlusYErs1Temperature; } - public long feePlusYErs2Signal() { return feePlusYErs2Signal; } - public long feePlusYErs2Temperature() { return feePlusYErs2Temperature; } - public long feePlusYErs3Signal() { return feePlusYErs3Signal; } - public long feePlusYErs3Temperature() { return feePlusYErs3Temperature; } - public long feePlusYUvsSignal() { return feePlusYUvsSignal; } - public long feeMinusYErs1Signal() { return feeMinusYErs1Signal; } - public long feeMinusYErs1Temperature() { return feeMinusYErs1Temperature; } - public long feeMinusYErs2Signal() { return feeMinusYErs2Signal; } - public long feeMinusYErs2Temperature() { return feeMinusYErs2Temperature; } - public long feeMinusYErs3Signal() { return feeMinusYErs3Signal; } - public long feeMinusYErs3Temperature() { return feeMinusYErs3Temperature; } - public long feeMinusYUvsSignal() { return feeMinusYUvsSignal; } - public int teachwearAccX() { return teachwearAccX; } - public int teachwearAccY() { return teachwearAccY; } - public int teachwearAccZ() { return teachwearAccZ; } - public int teachwearDegC() { return teachwearDegC; } - public int teachwearGyroX() { return teachwearGyroX; } - public int teachwearGyroY() { return teachwearGyroY; } - public int teachwearGyroZ() { return teachwearGyroZ; } - public int teachwearMagnX() { return teachwearMagnX; } - public int teachwearMagnY() { return teachwearMagnY; } - public int teachwearMagnZ() { return teachwearMagnZ; } - public int teachwearState() { return teachwearState; } - public int teachwearResetReason() { return teachwearResetReason; } - public int teachwearCrc() { return teachwearCrc; } - public long nbTmSinceFirstStart() { return nbTmSinceFirstStart; } - public Uvsqsat _root() { return _root; } - public Uvsqsat.UiFrame _parent() { return _parent; } - } - public static class AmsatAscii extends KaitaiStruct { - public static AmsatAscii fromFile(String fileName) throws IOException { - return new AmsatAscii(new ByteBufferKaitaiStream(fileName)); - } - - public AmsatAscii(KaitaiStream _io) { - this(_io, null, null); - } - - public AmsatAscii(KaitaiStream _io, Uvsqsat.UiFrame _parent) { - this(_io, _parent, null); - } - - public AmsatAscii(KaitaiStream _io, Uvsqsat.UiFrame _parent, Uvsqsat _root) { - super(_io); - this._parent = _parent; - this._root = _root; - _read(); - } - private void _read() { - this.message = new String(this._io.readBytesFull(), Charset.forName("UTF-8")); - } - private String messageStr; - public String messageStr() { - if (this.messageStr != null) - return this.messageStr; - this.messageStr = message(); - return this.messageStr; - } - private String message; - private Uvsqsat _root; - private Uvsqsat.UiFrame _parent; - public String message() { return message; } - public Uvsqsat _root() { return _root; } - public Uvsqsat.UiFrame _parent() { return _parent; } - } - public static class TrxvurxHk extends KaitaiStruct { - public static TrxvurxHk fromFile(String fileName) throws IOException { - return new TrxvurxHk(new ByteBufferKaitaiStream(fileName)); - } - - public TrxvurxHk(KaitaiStream _io) { - this(_io, null, null); - } - - public TrxvurxHk(KaitaiStream _io, Uvsqsat.UiFrame _parent) { - this(_io, _parent, null); - } - - public TrxvurxHk(KaitaiStream _io, Uvsqsat.UiFrame _parent, Uvsqsat _root) { - super(_io); - this._parent = _parent; - this._root = _root; - _read(); - } - private void _read() { - this.trxvurxInstantaneousReceivedSignalDopplerOffsetAtTheReceiverPort = this._io.readBitsInt(12); - this.trxvurxInstantaneousReceivedSignalStrengthAtTheReceiverPort = this._io.readBitsInt(12); - this.trxvurxSupplyVoltage = this._io.readBitsInt(12); - this.trxvurxTotalSupplyCurrent = this._io.readBitsInt(12); - this.trxvurxTransmitterCurrent = this._io.readBitsInt(12); - this.trxvurxReceiverCurrent = this._io.readBitsInt(12); - this.trxvurxPowerAmplifierCurrent = this._io.readBitsInt(12); - this.trxvurxPowerAmplifierTemperature = this._io.readBitsInt(12); - this.trxvurxLocalOscillatorTemperature = this._io.readBitsInt(12); - this.trxvurxZeroPadding = this._io.readBitsInt(4); - this._io.alignToByte(); - this.trxvuRxUptime = this._io.readU4be(); - } - private Double trxvurxInstantaneousReceivedSignalStrengthDbm; - public Double trxvurxInstantaneousReceivedSignalStrengthDbm() { - if (this.trxvurxInstantaneousReceivedSignalStrengthDbm != null) - return this.trxvurxInstantaneousReceivedSignalStrengthDbm; - double _tmp = (double) (((trxvurxInstantaneousReceivedSignalStrengthAtTheReceiverPort() * 0.03) - 152)); - this.trxvurxInstantaneousReceivedSignalStrengthDbm = _tmp; - return this.trxvurxInstantaneousReceivedSignalStrengthDbm; - } - private Double trxvurxInstantaneousReceivedSignalDopplerHz; - public Double trxvurxInstantaneousReceivedSignalDopplerHz() { - if (this.trxvurxInstantaneousReceivedSignalDopplerHz != null) - return this.trxvurxInstantaneousReceivedSignalDopplerHz; - double _tmp = (double) (((trxvurxInstantaneousReceivedSignalDopplerOffsetAtTheReceiverPort() * 13.552) - 22300)); - this.trxvurxInstantaneousReceivedSignalDopplerHz = _tmp; - return this.trxvurxInstantaneousReceivedSignalDopplerHz; - } - private Double trxvurxSupplyVoltageV; - public Double trxvurxSupplyVoltageV() { - if (this.trxvurxSupplyVoltageV != null) - return this.trxvurxSupplyVoltageV; - double _tmp = (double) ((trxvurxSupplyVoltage() * 0.00488)); - this.trxvurxSupplyVoltageV = _tmp; - return this.trxvurxSupplyVoltageV; - } - private Double trxvurxLocalOscillatorTemperatureC; - public Double trxvurxLocalOscillatorTemperatureC() { - if (this.trxvurxLocalOscillatorTemperatureC != null) - return this.trxvurxLocalOscillatorTemperatureC; - double _tmp = (double) (((trxvurxLocalOscillatorTemperature() * -0.07669) + 195.6037)); - this.trxvurxLocalOscillatorTemperatureC = _tmp; - return this.trxvurxLocalOscillatorTemperatureC; - } - private Double trxvurxTransmitterCurrentMa; - public Double trxvurxTransmitterCurrentMa() { - if (this.trxvurxTransmitterCurrentMa != null) - return this.trxvurxTransmitterCurrentMa; - double _tmp = (double) ((trxvurxTransmitterCurrent() * 0.16643964)); - this.trxvurxTransmitterCurrentMa = _tmp; - return this.trxvurxTransmitterCurrentMa; - } - private Long trxvurxZeroPaddingRaw; - public Long trxvurxZeroPaddingRaw() { - if (this.trxvurxZeroPaddingRaw != null) - return this.trxvurxZeroPaddingRaw; - long _tmp = (long) (trxvurxZeroPadding()); - this.trxvurxZeroPaddingRaw = _tmp; - return this.trxvurxZeroPaddingRaw; - } - private Double trxvurxPowerAmplifierCurrentMa; - public Double trxvurxPowerAmplifierCurrentMa() { - if (this.trxvurxPowerAmplifierCurrentMa != null) - return this.trxvurxPowerAmplifierCurrentMa; - double _tmp = (double) (((1000.0 * trxvurxPowerAmplifierCurrent()) * 0.16643964)); - this.trxvurxPowerAmplifierCurrentMa = _tmp; - return this.trxvurxPowerAmplifierCurrentMa; - } - private Double trxvurxTotalSupplyCurrentMa; - public Double trxvurxTotalSupplyCurrentMa() { - if (this.trxvurxTotalSupplyCurrentMa != null) - return this.trxvurxTotalSupplyCurrentMa; - double _tmp = (double) ((trxvurxTotalSupplyCurrent() * 0.16643964)); - this.trxvurxTotalSupplyCurrentMa = _tmp; - return this.trxvurxTotalSupplyCurrentMa; - } - private Double trxvurxPowerAmplifierTemperatureC; - public Double trxvurxPowerAmplifierTemperatureC() { - if (this.trxvurxPowerAmplifierTemperatureC != null) - return this.trxvurxPowerAmplifierTemperatureC; - double _tmp = (double) (((trxvurxPowerAmplifierTemperature() * -0.07669) + 195.6037)); - this.trxvurxPowerAmplifierTemperatureC = _tmp; - return this.trxvurxPowerAmplifierTemperatureC; - } - private Long trxvuRxUptimeRaw; - public Long trxvuRxUptimeRaw() { - if (this.trxvuRxUptimeRaw != null) - return this.trxvuRxUptimeRaw; - long _tmp = (long) (trxvuRxUptime()); - this.trxvuRxUptimeRaw = _tmp; - return this.trxvuRxUptimeRaw; - } - private Double trxvurxReceiverCurrentMa; - public Double trxvurxReceiverCurrentMa() { - if (this.trxvurxReceiverCurrentMa != null) - return this.trxvurxReceiverCurrentMa; - double _tmp = (double) ((trxvurxReceiverCurrent() * 0.16643964)); - this.trxvurxReceiverCurrentMa = _tmp; - return this.trxvurxReceiverCurrentMa; - } - private long trxvurxInstantaneousReceivedSignalDopplerOffsetAtTheReceiverPort; - private long trxvurxInstantaneousReceivedSignalStrengthAtTheReceiverPort; - private long trxvurxSupplyVoltage; - private long trxvurxTotalSupplyCurrent; - private long trxvurxTransmitterCurrent; - private long trxvurxReceiverCurrent; - private long trxvurxPowerAmplifierCurrent; - private long trxvurxPowerAmplifierTemperature; - private long trxvurxLocalOscillatorTemperature; - private long trxvurxZeroPadding; - private long trxvuRxUptime; - private Uvsqsat _root; - private Uvsqsat.UiFrame _parent; - public long trxvurxInstantaneousReceivedSignalDopplerOffsetAtTheReceiverPort() { return trxvurxInstantaneousReceivedSignalDopplerOffsetAtTheReceiverPort; } - public long trxvurxInstantaneousReceivedSignalStrengthAtTheReceiverPort() { return trxvurxInstantaneousReceivedSignalStrengthAtTheReceiverPort; } - public long trxvurxSupplyVoltage() { return trxvurxSupplyVoltage; } - public long trxvurxTotalSupplyCurrent() { return trxvurxTotalSupplyCurrent; } - public long trxvurxTransmitterCurrent() { return trxvurxTransmitterCurrent; } - public long trxvurxReceiverCurrent() { return trxvurxReceiverCurrent; } - public long trxvurxPowerAmplifierCurrent() { return trxvurxPowerAmplifierCurrent; } - public long trxvurxPowerAmplifierTemperature() { return trxvurxPowerAmplifierTemperature; } - public long trxvurxLocalOscillatorTemperature() { return trxvurxLocalOscillatorTemperature; } - public long trxvurxZeroPadding() { return trxvurxZeroPadding; } - public long trxvuRxUptime() { return trxvuRxUptime; } - public Uvsqsat _root() { return _root; } - public Uvsqsat.UiFrame _parent() { return _parent; } - } - public static class MainboardHk extends KaitaiStruct { - public static MainboardHk fromFile(String fileName) throws IOException { - return new MainboardHk(new ByteBufferKaitaiStream(fileName)); - } - - public MainboardHk(KaitaiStream _io) { - this(_io, null, null); - } - - public MainboardHk(KaitaiStream _io, Uvsqsat.UiFrame _parent) { - this(_io, _parent, null); - } - - public MainboardHk(KaitaiStream _io, Uvsqsat.UiFrame _parent, Uvsqsat _root) { - super(_io); - this._parent = _parent; - this._root = _root; - _read(); - } - private void _read() { - this.mainboardHkTime = this._io.readU4be(); - this.hkPlus5V = this._io.readU2be(); - this.hkMinus5V = this._io.readU2be(); - this.hkMinusPolar = this._io.readU2be(); - this.hkTempADC = this._io.readU2be(); - this.hkFeePlusXVref = this._io.readU2be(); - this.hkFeeMinusXVref = this._io.readU2be(); - this.hkFeePlusYVref = this._io.readU2be(); - this.hkFeeMinusYVref = this._io.readU2be(); - } - private Integer hkFeePlusXVrefRaw; - public Integer hkFeePlusXVrefRaw() { - if (this.hkFeePlusXVrefRaw != null) - return this.hkFeePlusXVrefRaw; - int _tmp = (int) (hkFeePlusXVref()); - this.hkFeePlusXVrefRaw = _tmp; - return this.hkFeePlusXVrefRaw; - } - private Integer hkFeePlusYVrefRaw; - public Integer hkFeePlusYVrefRaw() { - if (this.hkFeePlusYVrefRaw != null) - return this.hkFeePlusYVrefRaw; - int _tmp = (int) (hkFeePlusYVref()); - this.hkFeePlusYVrefRaw = _tmp; - return this.hkFeePlusYVrefRaw; - } - private Integer hkPlus5VRaw; - public Integer hkPlus5VRaw() { - if (this.hkPlus5VRaw != null) - return this.hkPlus5VRaw; - int _tmp = (int) (hkPlus5V()); - this.hkPlus5VRaw = _tmp; - return this.hkPlus5VRaw; - } - private Integer hkTempADCRaw; - public Integer hkTempADCRaw() { - if (this.hkTempADCRaw != null) - return this.hkTempADCRaw; - int _tmp = (int) (hkTempADC()); - this.hkTempADCRaw = _tmp; - return this.hkTempADCRaw; - } - private Long mainboardHKTimeRaw; - public Long mainboardHKTimeRaw() { - if (this.mainboardHKTimeRaw != null) - return this.mainboardHKTimeRaw; - long _tmp = (long) (mainboardHkTime()); - this.mainboardHKTimeRaw = _tmp; - return this.mainboardHKTimeRaw; - } - private Integer hkMinusPolarRaw; - public Integer hkMinusPolarRaw() { - if (this.hkMinusPolarRaw != null) - return this.hkMinusPolarRaw; - int _tmp = (int) (hkMinusPolar()); - this.hkMinusPolarRaw = _tmp; - return this.hkMinusPolarRaw; - } - private Integer hkMinus5VRaw; - public Integer hkMinus5VRaw() { - if (this.hkMinus5VRaw != null) - return this.hkMinus5VRaw; - int _tmp = (int) (hkMinus5V()); - this.hkMinus5VRaw = _tmp; - return this.hkMinus5VRaw; - } - private Integer hkFeeMinusXVrefRaw; - public Integer hkFeeMinusXVrefRaw() { - if (this.hkFeeMinusXVrefRaw != null) - return this.hkFeeMinusXVrefRaw; - int _tmp = (int) (hkFeeMinusXVref()); - this.hkFeeMinusXVrefRaw = _tmp; - return this.hkFeeMinusXVrefRaw; - } - private Integer hkFeeMinusYVrefRaw; - public Integer hkFeeMinusYVrefRaw() { - if (this.hkFeeMinusYVrefRaw != null) - return this.hkFeeMinusYVrefRaw; - int _tmp = (int) (hkFeeMinusYVref()); - this.hkFeeMinusYVrefRaw = _tmp; - return this.hkFeeMinusYVrefRaw; - } - private long mainboardHkTime; - private int hkPlus5V; - private int hkMinus5V; - private int hkMinusPolar; - private int hkTempADC; - private int hkFeePlusXVref; - private int hkFeeMinusXVref; - private int hkFeePlusYVref; - private int hkFeeMinusYVref; - private Uvsqsat _root; - private Uvsqsat.UiFrame _parent; - public long mainboardHkTime() { return mainboardHkTime; } - public int hkPlus5V() { return hkPlus5V; } - public int hkMinus5V() { return hkMinus5V; } - public int hkMinusPolar() { return hkMinusPolar; } - public int hkTempADC() { return hkTempADC; } - public int hkFeePlusXVref() { return hkFeePlusXVref; } - public int hkFeeMinusXVref() { return hkFeeMinusXVref; } - public int hkFeePlusYVref() { return hkFeePlusYVref; } - public int hkFeeMinusYVref() { return hkFeeMinusYVref; } - public Uvsqsat _root() { return _root; } - public Uvsqsat.UiFrame _parent() { return _parent; } - } - public static class IFrame extends KaitaiStruct { - public static IFrame fromFile(String fileName) throws IOException { - return new IFrame(new ByteBufferKaitaiStream(fileName)); - } - - public IFrame(KaitaiStream _io) { - this(_io, null, null); - } - - public IFrame(KaitaiStream _io, Uvsqsat.Ax25Frame _parent) { - this(_io, _parent, null); - } - - public IFrame(KaitaiStream _io, Uvsqsat.Ax25Frame _parent, Uvsqsat _root) { - super(_io); - this._parent = _parent; - this._root = _root; - _read(); - } - private void _read() { - this.pid = this._io.readU1(); - this.ax25Info = this._io.readBytesFull(); - } - private int pid; - private byte[] ax25Info; - private Uvsqsat _root; - private Uvsqsat.Ax25Frame _parent; - public int pid() { return pid; } - public byte[] ax25Info() { return ax25Info; } - public Uvsqsat _root() { return _root; } - public Uvsqsat.Ax25Frame _parent() { return _parent; } - } - public static class ObcStatus extends KaitaiStruct { - public static ObcStatus fromFile(String fileName) throws IOException { - return new ObcStatus(new ByteBufferKaitaiStream(fileName)); - } - - public ObcStatus(KaitaiStream _io) { - this(_io, null, null); - } - - public ObcStatus(KaitaiStream _io, Uvsqsat.UiFrame _parent) { - this(_io, _parent, null); - } - - public ObcStatus(KaitaiStream _io, Uvsqsat.UiFrame _parent, Uvsqsat _root) { - super(_io); - this._parent = _parent; - this._root = _root; - _read(); - } - private void _read() { - this.dummy = this._io.readU1(); - this.spiCommandStatus = this._io.readU1(); - this.supervisorIndexOfSubsystem = this._io.readU1(); - this.supervisorMajorVersion = this._io.readU1(); - this.supervisorMinorVersion = this._io.readU1(); - this.supervisorPatchVersion = this._io.readU1(); - this.supervisorGitHeadVersion = this._io.readU4be(); - this.supervisorSerialNumber = this._io.readU2be(); - this.compilationInformation = this._io.readBytes(19); - this.clockSpeed = this._io.readU1(); - this.codeType = this._io.readU1(); - this.crc8 = this._io.readU1(); - this.swMmode = this._io.readU1(); - this.lastResetReason = this._io.readU1(); - this.reserved = this._io.readU1(); - this.nbReset = this._io.readU1(); - this.reserved2 = this._io.readU1(); - this.deployAntennasSystem = this._io.readU1(); - this.nbTmSinceFirstStart = this._io.readU4be(); - this.nbTcSinceFirstStart = this._io.readU4be(); - this.nbBadTcSinceFirstStart = this._io.readU4be(); - this.nbTmInSdcard = this._io.readU4be(); - this.sdcardStatus = this._io.readU1(); - this.sdcardLastError = this._io.readU4be(); - this.oldTimeTMInSdcard = this._io.readBitsInt(56); - this.newTimeTMInSdcard = this._io.readBitsInt(56); - } - private Long newTimeTMInSdcardRaw; - public Long newTimeTMInSdcardRaw() { - if (this.newTimeTMInSdcardRaw != null) - return this.newTimeTMInSdcardRaw; - long _tmp = (long) (newTimeTMInSdcard()); - this.newTimeTMInSdcardRaw = _tmp; - return this.newTimeTMInSdcardRaw; - } - private Integer deployAntennasSystemRaw; - public Integer deployAntennasSystemRaw() { - if (this.deployAntennasSystemRaw != null) - return this.deployAntennasSystemRaw; - int _tmp = (int) (deployAntennasSystem()); - this.deployAntennasSystemRaw = _tmp; - return this.deployAntennasSystemRaw; - } - private Integer clockSpeedRaw; - public Integer clockSpeedRaw() { - if (this.clockSpeedRaw != null) - return this.clockSpeedRaw; - int _tmp = (int) (clockSpeed()); - this.clockSpeedRaw = _tmp; - return this.clockSpeedRaw; - } - private Integer lastResetReasonRaw; - public Integer lastResetReasonRaw() { - if (this.lastResetReasonRaw != null) - return this.lastResetReasonRaw; - int _tmp = (int) (lastResetReason()); - this.lastResetReasonRaw = _tmp; - return this.lastResetReasonRaw; - } - private Integer supervisorIndexOfSubsystemRaw; - public Integer supervisorIndexOfSubsystemRaw() { - if (this.supervisorIndexOfSubsystemRaw != null) - return this.supervisorIndexOfSubsystemRaw; - int _tmp = (int) (supervisorIndexOfSubsystem()); - this.supervisorIndexOfSubsystemRaw = _tmp; - return this.supervisorIndexOfSubsystemRaw; - } - private Integer crc8Raw; - public Integer crc8Raw() { - if (this.crc8Raw != null) - return this.crc8Raw; - int _tmp = (int) (crc8()); - this.crc8Raw = _tmp; - return this.crc8Raw; - } - private Integer nbResetRaw; - public Integer nbResetRaw() { - if (this.nbResetRaw != null) - return this.nbResetRaw; - int _tmp = (int) (nbReset()); - this.nbResetRaw = _tmp; - return this.nbResetRaw; - } - private Long supervisorGitHeadVersionRaw; - public Long supervisorGitHeadVersionRaw() { - if (this.supervisorGitHeadVersionRaw != null) - return this.supervisorGitHeadVersionRaw; - long _tmp = (long) (supervisorGitHeadVersion()); - this.supervisorGitHeadVersionRaw = _tmp; - return this.supervisorGitHeadVersionRaw; - } - private Integer supervisorMajorVersionRaw; - public Integer supervisorMajorVersionRaw() { - if (this.supervisorMajorVersionRaw != null) - return this.supervisorMajorVersionRaw; - int _tmp = (int) (supervisorMajorVersion()); - this.supervisorMajorVersionRaw = _tmp; - return this.supervisorMajorVersionRaw; - } - private byte[] compilationInformationByte; - public byte[] compilationInformationByte() { - if (this.compilationInformationByte != null) - return this.compilationInformationByte; - this.compilationInformationByte = compilationInformation(); - return this.compilationInformationByte; - } - private Long nbTmSinceFirstStartRaw; - public Long nbTmSinceFirstStartRaw() { - if (this.nbTmSinceFirstStartRaw != null) - return this.nbTmSinceFirstStartRaw; - long _tmp = (long) (nbTmSinceFirstStart()); - this.nbTmSinceFirstStartRaw = _tmp; - return this.nbTmSinceFirstStartRaw; - } - private Integer supervisorMinorVersionRaw; - public Integer supervisorMinorVersionRaw() { - if (this.supervisorMinorVersionRaw != null) - return this.supervisorMinorVersionRaw; - int _tmp = (int) (supervisorMinorVersion()); - this.supervisorMinorVersionRaw = _tmp; - return this.supervisorMinorVersionRaw; - } - private Integer sdcardStatusRaw; - public Integer sdcardStatusRaw() { - if (this.sdcardStatusRaw != null) - return this.sdcardStatusRaw; - int _tmp = (int) (sdcardStatus()); - this.sdcardStatusRaw = _tmp; - return this.sdcardStatusRaw; - } - private Integer supervisorPatchVersionRaw; - public Integer supervisorPatchVersionRaw() { - if (this.supervisorPatchVersionRaw != null) - return this.supervisorPatchVersionRaw; - int _tmp = (int) (supervisorPatchVersion()); - this.supervisorPatchVersionRaw = _tmp; - return this.supervisorPatchVersionRaw; - } - private Integer reservedRaw; - public Integer reservedRaw() { - if (this.reservedRaw != null) - return this.reservedRaw; - int _tmp = (int) (reserved()); - this.reservedRaw = _tmp; - return this.reservedRaw; - } - private Integer supervisorSerialNumberRaw; - public Integer supervisorSerialNumberRaw() { - if (this.supervisorSerialNumberRaw != null) - return this.supervisorSerialNumberRaw; - int _tmp = (int) (supervisorSerialNumber()); - this.supervisorSerialNumberRaw = _tmp; - return this.supervisorSerialNumberRaw; - } - private Long nbTmInSdcardRaw; - public Long nbTmInSdcardRaw() { - if (this.nbTmInSdcardRaw != null) - return this.nbTmInSdcardRaw; - long _tmp = (long) (nbTmInSdcard()); - this.nbTmInSdcardRaw = _tmp; - return this.nbTmInSdcardRaw; - } - private Integer reserved2Raw; - public Integer reserved2Raw() { - if (this.reserved2Raw != null) - return this.reserved2Raw; - int _tmp = (int) (reserved2()); - this.reserved2Raw = _tmp; - return this.reserved2Raw; - } - private Integer swMmodeRaw; - public Integer swMmodeRaw() { - if (this.swMmodeRaw != null) - return this.swMmodeRaw; - int _tmp = (int) (swMmode()); - this.swMmodeRaw = _tmp; - return this.swMmodeRaw; - } - private Integer codeTypeRaw; - public Integer codeTypeRaw() { - if (this.codeTypeRaw != null) - return this.codeTypeRaw; - int _tmp = (int) (codeType()); - this.codeTypeRaw = _tmp; - return this.codeTypeRaw; - } - private Long oldTimeTMInSdcardRaw; - public Long oldTimeTMInSdcardRaw() { - if (this.oldTimeTMInSdcardRaw != null) - return this.oldTimeTMInSdcardRaw; - long _tmp = (long) (oldTimeTMInSdcard()); - this.oldTimeTMInSdcardRaw = _tmp; - return this.oldTimeTMInSdcardRaw; - } - private Integer dummydummy; - public Integer dummydummy() { - if (this.dummydummy != null) - return this.dummydummy; - int _tmp = (int) (dummy()); - this.dummydummy = _tmp; - return this.dummydummy; - } - private Long nbTcSinceFirstStartRaw; - public Long nbTcSinceFirstStartRaw() { - if (this.nbTcSinceFirstStartRaw != null) - return this.nbTcSinceFirstStartRaw; - long _tmp = (long) (nbTcSinceFirstStart()); - this.nbTcSinceFirstStartRaw = _tmp; - return this.nbTcSinceFirstStartRaw; - } - private Long sdcardLastErrorRaw; - public Long sdcardLastErrorRaw() { - if (this.sdcardLastErrorRaw != null) - return this.sdcardLastErrorRaw; - long _tmp = (long) (sdcardLastError()); - this.sdcardLastErrorRaw = _tmp; - return this.sdcardLastErrorRaw; - } - private Long nbBadTcSinceFirstStartRaw; - public Long nbBadTcSinceFirstStartRaw() { - if (this.nbBadTcSinceFirstStartRaw != null) - return this.nbBadTcSinceFirstStartRaw; - long _tmp = (long) (nbBadTcSinceFirstStart()); - this.nbBadTcSinceFirstStartRaw = _tmp; - return this.nbBadTcSinceFirstStartRaw; - } - private Integer spiCommandStatusRaw; - public Integer spiCommandStatusRaw() { - if (this.spiCommandStatusRaw != null) - return this.spiCommandStatusRaw; - int _tmp = (int) (spiCommandStatus()); - this.spiCommandStatusRaw = _tmp; - return this.spiCommandStatusRaw; - } - private int dummy; - private int spiCommandStatus; - private int supervisorIndexOfSubsystem; - private int supervisorMajorVersion; - private int supervisorMinorVersion; - private int supervisorPatchVersion; - private long supervisorGitHeadVersion; - private int supervisorSerialNumber; - private byte[] compilationInformation; - private int clockSpeed; - private int codeType; - private int crc8; - private int swMmode; - private int lastResetReason; - private int reserved; - private int nbReset; - private int reserved2; - private int deployAntennasSystem; - private long nbTmSinceFirstStart; - private long nbTcSinceFirstStart; - private long nbBadTcSinceFirstStart; - private long nbTmInSdcard; - private int sdcardStatus; - private long sdcardLastError; - private long oldTimeTMInSdcard; - private long newTimeTMInSdcard; - private Uvsqsat _root; - private Uvsqsat.UiFrame _parent; - public int dummy() { return dummy; } - public int spiCommandStatus() { return spiCommandStatus; } - public int supervisorIndexOfSubsystem() { return supervisorIndexOfSubsystem; } - public int supervisorMajorVersion() { return supervisorMajorVersion; } - public int supervisorMinorVersion() { return supervisorMinorVersion; } - public int supervisorPatchVersion() { return supervisorPatchVersion; } - public long supervisorGitHeadVersion() { return supervisorGitHeadVersion; } - public int supervisorSerialNumber() { return supervisorSerialNumber; } - public byte[] compilationInformation() { return compilationInformation; } - public int clockSpeed() { return clockSpeed; } - public int codeType() { return codeType; } - public int crc8() { return crc8; } - public int swMmode() { return swMmode; } - public int lastResetReason() { return lastResetReason; } - public int reserved() { return reserved; } - public int nbReset() { return nbReset; } - public int reserved2() { return reserved2; } - public int deployAntennasSystem() { return deployAntennasSystem; } - public long nbTmSinceFirstStart() { return nbTmSinceFirstStart; } - public long nbTcSinceFirstStart() { return nbTcSinceFirstStart; } - public long nbBadTcSinceFirstStart() { return nbBadTcSinceFirstStart; } - public long nbTmInSdcard() { return nbTmInSdcard; } - public int sdcardStatus() { return sdcardStatus; } - public long sdcardLastError() { return sdcardLastError; } - public long oldTimeTMInSdcard() { return oldTimeTMInSdcard; } - public long newTimeTMInSdcard() { return newTimeTMInSdcard; } - public Uvsqsat _root() { return _root; } - public Uvsqsat.UiFrame _parent() { return _parent; } - } - public static class SsidMask extends KaitaiStruct { - public static SsidMask fromFile(String fileName) throws IOException { - return new SsidMask(new ByteBufferKaitaiStream(fileName)); - } - - public SsidMask(KaitaiStream _io) { - this(_io, null, null); - } - - public SsidMask(KaitaiStream _io, Uvsqsat.Ax25Header _parent) { - this(_io, _parent, null); - } - - public SsidMask(KaitaiStream _io, Uvsqsat.Ax25Header _parent, Uvsqsat _root) { - super(_io); - this._parent = _parent; - this._root = _root; - _read(); - } - private void _read() { - this.ssidMask = this._io.readU1(); - } - private Integer ssid; - public Integer ssid() { - if (this.ssid != null) - return this.ssid; - int _tmp = (int) (((ssidMask() & 15) >> 1)); - this.ssid = _tmp; - return this.ssid; - } - private int ssidMask; - private Uvsqsat _root; - private Uvsqsat.Ax25Header _parent; - public int ssidMask() { return ssidMask; } - public Uvsqsat _root() { return _root; } - public Uvsqsat.Ax25Header _parent() { return _parent; } - } - public static class Beacon extends KaitaiStruct { - public static Beacon fromFile(String fileName) throws IOException { - return new Beacon(new ByteBufferKaitaiStream(fileName)); - } - - public Beacon(KaitaiStream _io) { - this(_io, null, null); - } - - public Beacon(KaitaiStream _io, Uvsqsat.UiFrame _parent) { - this(_io, _parent, null); - } - - public Beacon(KaitaiStream _io, Uvsqsat.UiFrame _parent, Uvsqsat _root) { - super(_io); - this._parent = _parent; - this._root = _root; - _read(); - } - private void _read() { - this.swMode = this._io.readU1(); - this.lastResetReason = this._io.readU1(); - this.resetOrder = this._io.readU1(); - this.nbReset = this._io.readU1(); - this.formatSdcardOrder = this._io.readU1(); - this.deployAntennasSystem = this._io.readU1(); - this.nbTmSinceFirstStart = this._io.readU4be(); - this.nbTcSinceFirstStart = this._io.readU4be(); - this.nbTcPingSinceFirstStart = this._io.readU4be(); - this.nbBadTcSinceFirstStart = this._io.readU4be(); - this.nbTmInSdcard = this._io.readU4be(); - this.trxvutxInstantaneousRfReflectedPowerFromTransmitterPort = this._io.readBitsInt(12); - this.trxvutxInstantaneousRfForwardPowerFromTransmitterPort = this._io.readBitsInt(12); - this.trxvutxSupplyVoltage = this._io.readBitsInt(12); - this.trxvutxTotalSupplyCurrent = this._io.readBitsInt(12); - this.trxvutxTransmitterCurrent = this._io.readBitsInt(12); - this.trxvutxReceiverCurrent = this._io.readBitsInt(12); - this.trxvutxPowerAmplifierCurrent = this._io.readBitsInt(12); - this.trxvutxPowerAmplifierTemperature = this._io.readBitsInt(12); - this.trxvutxLocalOscillatorTemperature = this._io.readBitsInt(12); - this.trxvurxInstantaneousReceivedSignalDopplerOffsetAtTheReceiverPort = this._io.readBitsInt(12); - this.trxvurxInstantaneousReceivedSignalStrengthAtTheReceiverPort = this._io.readBitsInt(12); - this.trxvurxSupplyVoltage = this._io.readBitsInt(12); - this.trxvurxTotalSupplyCurrent = this._io.readBitsInt(12); - this.trxvurxTransmitterCurrent = this._io.readBitsInt(12); - this.trxvurxReceiverCurrent = this._io.readBitsInt(12); - this.trxvurxPowerAmplifierCurrent = this._io.readBitsInt(12); - this.trxvurxPowerAmplifierTemperature = this._io.readBitsInt(12); - this.trxvurxLocalOscillatorTemperature = this._io.readBitsInt(12); - this._io.alignToByte(); - this.imtqSystemStateMode = this._io.readU1(); - this.measureCoilXCurrent = this._io.readU2be(); - this.measureCoilYCurrent = this._io.readU2be(); - this.measureCoilZCurrent = this._io.readU2be(); - this.measureCoilXTemperature = this._io.readU2be(); - this.measureCoilYTemperature = this._io.readU2be(); - this.measureCoilZTemperature = this._io.readU2be(); - this.mcuTemperature = this._io.readU2be(); - this.sideAAntsTemperature = this._io.readU2be(); - this.sideAAntsDeploymentStatus = this._io.readU2be(); - this.voltBrdSupRaw = this._io.readU2be(); - this.tempRaw = this._io.readU2be(); - this.vDistInputRaw = this._io.readU2be(); - this.iDistInputRaw = this._io.readU2be(); - this.pDistInputRaw = this._io.readU2be(); - this.vBattInputRaw = this._io.readU2be(); - this.iBattInputRaw = this._io.readU2be(); - this.pBattInputRaw = this._io.readU2be(); - this.statObcOn = this._io.readU2be(); - this.statObcOcf = this._io.readU2be(); - this.batStat = this._io.readU2be(); - this.batTemp2Raw = this._io.readU2be(); - this.voltVd0 = this._io.readU2be(); - this.voltVd1 = this._io.readU2be(); - this.voltVd2 = this._io.readU2be(); - this.vObc00 = this._io.readU2be(); - this.iObc00 = this._io.readU2be(); - this.pObc00 = this._io.readU2be(); - this.vObc01 = this._io.readU2be(); - this.iObc01 = this._io.readU2be(); - this.pObc01 = this._io.readU2be(); - this.vObc02 = this._io.readU2be(); - this.iObc02 = this._io.readU2be(); - this.pObc02 = this._io.readU2be(); - this.vObc03 = this._io.readU2be(); - this.iObc03 = this._io.readU2be(); - this.pObc03 = this._io.readU2be(); - this.vObc05 = this._io.readU2be(); - this.iObc05 = this._io.readU2be(); - this.pObc05 = this._io.readU2be(); - this.vObc06 = this._io.readU2be(); - this.iObc06 = this._io.readU2be(); - this.pObc06 = this._io.readU2be(); - this.statusStid = this._io.readU1(); - this.statusIvid = this._io.readU1(); - this.statusRc = this._io.readU1(); - this.statusBid = this._io.readU1(); - this.statusCmderr = this._io.readBitsInt(4); - this.statusStat = this._io.readBitsInt(4); - this._io.alignToByte(); - this.mode = this._io.readU1(); - this.conf = this._io.readU1(); - this.resetCause = this._io.readU1(); - this.uptime = this._io.readU4be(); - this.error = this._io.readU2be(); - this.rcCntPwron = this._io.readU2be(); - this.rcCntWdg = this._io.readU2be(); - this.rcCntCmd = this._io.readU2be(); - this.rcCntMcu = this._io.readU2be(); - this.rcCntEmlopo = this._io.readU2be(); - this.prevcmdElapsed = this._io.readU2be(); - this.photodiode1 = this._io.readU2be(); - this.photodiode2 = this._io.readU2be(); - this.photodiode3 = this._io.readU2be(); - this.photodiode4 = this._io.readU2be(); - this.photodiode5 = this._io.readU2be(); - this.photodiode6 = this._io.readU2be(); - this.panelTemperature1 = this._io.readS4be(); - this.panelTemperature2 = this._io.readS4be(); - this.panelTemperature3 = this._io.readS4be(); - this.panelTemperature4 = this._io.readS4be(); - this.panelTemperature5 = this._io.readS4be(); - this.panelTemperature6 = this._io.readS4be(); - } - private Double measureCoilYTemperatureC; - public Double measureCoilYTemperatureC() { - if (this.measureCoilYTemperatureC != null) - return this.measureCoilYTemperatureC; - double _tmp = (double) ((((((2.5 / 4095) * measureCoilYTemperature()) - 1.567) * -1.0) / 0.0081)); - this.measureCoilYTemperatureC = _tmp; - return this.measureCoilYTemperatureC; - } - private Integer rcCntPwronRaw; - public Integer rcCntPwronRaw() { - if (this.rcCntPwronRaw != null) - return this.rcCntPwronRaw; - int _tmp = (int) (rcCntPwron()); - this.rcCntPwronRaw = _tmp; - return this.rcCntPwronRaw; - } - private Integer deployAntennasSystemRaw; - - /** - * : value - * Nominal = 0 - * No deploy = 0x11 - * Deployment Debug = 0xDB - */ - public Integer deployAntennasSystemRaw() { - if (this.deployAntennasSystemRaw != null) - return this.deployAntennasSystemRaw; - int _tmp = (int) (deployAntennasSystem()); - this.deployAntennasSystemRaw = _tmp; - return this.deployAntennasSystemRaw; - } - private Double vDistInputRawV; - public Double vDistInputRawV() { - if (this.vDistInputRawV != null) - return this.vDistInputRawV; - double _tmp = (double) ((((vDistInputRaw() * 125.0) / 128.0) / 1000.0)); - this.vDistInputRawV = _tmp; - return this.vDistInputRawV; - } - private Double iObc05Ma; - public Double iObc05Ma() { - if (this.iObc05Ma != null) - return this.iObc05Ma; - double _tmp = (double) (((iObc05() * 3125.0) / 20480.0)); - this.iObc05Ma = _tmp; - return this.iObc05Ma; - } - private Double trxvutxTotalSupplyCurrentMa; - public Double trxvutxTotalSupplyCurrentMa() { - if (this.trxvutxTotalSupplyCurrentMa != null) - return this.trxvutxTotalSupplyCurrentMa; - double _tmp = (double) ((0.16643964 * trxvutxTotalSupplyCurrent())); - this.trxvutxTotalSupplyCurrentMa = _tmp; - return this.trxvutxTotalSupplyCurrentMa; - } - private Integer lastResetReasonRaw; - - /** - * : last reset value - * First start = 0 - * TC Init received = 0x80 - * No TC since 4 days = 0x81 - * Unknown reason = 0x81 - */ - public Integer lastResetReasonRaw() { - if (this.lastResetReasonRaw != null) - return this.lastResetReasonRaw; - int _tmp = (int) (lastResetReason()); - this.lastResetReasonRaw = _tmp; - return this.lastResetReasonRaw; - } - private Double trxvutxPowerAmplifierCurrentMa; - public Double trxvutxPowerAmplifierCurrentMa() { - if (this.trxvutxPowerAmplifierCurrentMa != null) - return this.trxvutxPowerAmplifierCurrentMa; - double _tmp = (double) (((1000.0 * trxvutxPowerAmplifierCurrent()) * 0.16643964)); - this.trxvutxPowerAmplifierCurrentMa = _tmp; - return this.trxvutxPowerAmplifierCurrentMa; - } - private Double trxvurxInstantaneousReceivedSignalStrengthDbm; - public Double trxvurxInstantaneousReceivedSignalStrengthDbm() { - if (this.trxvurxInstantaneousReceivedSignalStrengthDbm != null) - return this.trxvurxInstantaneousReceivedSignalStrengthDbm; - double _tmp = (double) (((trxvurxInstantaneousReceivedSignalStrengthAtTheReceiverPort() * 0.03) - 152)); - this.trxvurxInstantaneousReceivedSignalStrengthDbm = _tmp; - return this.trxvurxInstantaneousReceivedSignalStrengthDbm; - } - private Double pObc05Mw; - public Double pObc05Mw() { - if (this.pObc05Mw != null) - return this.pObc05Mw; - double _tmp = (double) (((pObc05() * 3125.0) / 6400.0)); - this.pObc05Mw = _tmp; - return this.pObc05Mw; - } - private Integer statObcOnRaw; - - /** - * bit n = 1 indicates the channel n is ON 9 firsts bits used - */ - public Integer statObcOnRaw() { - if (this.statObcOnRaw != null) - return this.statObcOnRaw; - int _tmp = (int) (statObcOn()); - this.statObcOnRaw = _tmp; - return this.statObcOnRaw; - } - private Double panelTemperature6C; - public Double panelTemperature6C() { - if (this.panelTemperature6C != null) - return this.panelTemperature6C; - double _tmp = (double) ((panelTemperature6() / 1024.0)); - this.panelTemperature6C = _tmp; - return this.panelTemperature6C; - } - private Long statusStatRaw; - public Long statusStatRaw() { - if (this.statusStatRaw != null) - return this.statusStatRaw; - long _tmp = (long) (statusStat()); - this.statusStatRaw = _tmp; - return this.statusStatRaw; - } - private Double pObc00Mw; - public Double pObc00Mw() { - if (this.pObc00Mw != null) - return this.pObc00Mw; - double _tmp = (double) (((pObc00() * 3125.0) / 6400.0)); - this.pObc00Mw = _tmp; - return this.pObc00Mw; - } - private Double trxvurxInstantaneousReceivedSignalDopplerHz; - public Double trxvurxInstantaneousReceivedSignalDopplerHz() { - if (this.trxvurxInstantaneousReceivedSignalDopplerHz != null) - return this.trxvurxInstantaneousReceivedSignalDopplerHz; - double _tmp = (double) (((trxvurxInstantaneousReceivedSignalDopplerOffsetAtTheReceiverPort() * 13.552) - 22300)); - this.trxvurxInstantaneousReceivedSignalDopplerHz = _tmp; - return this.trxvurxInstantaneousReceivedSignalDopplerHz; - } - private Double vObc02V; - public Double vObc02V() { - if (this.vObc02V != null) - return this.vObc02V; - double _tmp = (double) ((((vObc02() * 125.0) / 128.0) / 1000.0)); - this.vObc02V = _tmp; - return this.vObc02V; - } - private Integer nbResetRaw; - public Integer nbResetRaw() { - if (this.nbResetRaw != null) - return this.nbResetRaw; - int _tmp = (int) (nbReset()); - this.nbResetRaw = _tmp; - return this.nbResetRaw; - } - private Double trxvurxSupplyVoltageV; - public Double trxvurxSupplyVoltageV() { - if (this.trxvurxSupplyVoltageV != null) - return this.trxvurxSupplyVoltageV; - double _tmp = (double) ((0.00488 * trxvurxSupplyVoltage())); - this.trxvurxSupplyVoltageV = _tmp; - return this.trxvurxSupplyVoltageV; - } - private Double pObc06Mw; - public Double pObc06Mw() { - if (this.pObc06Mw != null) - return this.pObc06Mw; - double _tmp = (double) (((pObc06() * 3125.0) / 6400.0)); - this.pObc06Mw = _tmp; - return this.pObc06Mw; - } - private Integer modeRaw; - - /** - * value : - * 0 = Startup - * 1 = Nominal - * 2 = Safety - * 3 = Emergency low power 8 - */ - public Integer modeRaw() { - if (this.modeRaw != null) - return this.modeRaw; - int _tmp = (int) (mode()); - this.modeRaw = _tmp; - return this.modeRaw; - } - private Double trxvurxLocalOscillatorTemperatureC; - public Double trxvurxLocalOscillatorTemperatureC() { - if (this.trxvurxLocalOscillatorTemperatureC != null) - return this.trxvurxLocalOscillatorTemperatureC; - double _tmp = (double) (((trxvurxLocalOscillatorTemperature() * -0.07669) + 195.6037)); - this.trxvurxLocalOscillatorTemperatureC = _tmp; - return this.trxvurxLocalOscillatorTemperatureC; - } - private Long statusCmderrRaw; - public Long statusCmderrRaw() { - if (this.statusCmderrRaw != null) - return this.statusCmderrRaw; - long _tmp = (long) (statusCmderr()); - this.statusCmderrRaw = _tmp; - return this.statusCmderrRaw; - } - private Integer photodiode1Raw; - public Integer photodiode1Raw() { - if (this.photodiode1Raw != null) - return this.photodiode1Raw; - int _tmp = (int) (photodiode1()); - this.photodiode1Raw = _tmp; - return this.photodiode1Raw; - } - private Double pObc01Mw; - public Double pObc01Mw() { - if (this.pObc01Mw != null) - return this.pObc01Mw; - double _tmp = (double) (((pObc01() * 3125.0) / 6400.0)); - this.pObc01Mw = _tmp; - return this.pObc01Mw; - } - private Integer photodiode5Raw; - public Integer photodiode5Raw() { - if (this.photodiode5Raw != null) - return this.photodiode5Raw; - int _tmp = (int) (photodiode5()); - this.photodiode5Raw = _tmp; - return this.photodiode5Raw; - } - private Double trxvurxTransmitterCurrentMa; - public Double trxvurxTransmitterCurrentMa() { - if (this.trxvurxTransmitterCurrentMa != null) - return this.trxvurxTransmitterCurrentMa; - double _tmp = (double) ((trxvurxTransmitterCurrent() * 0.16643964)); - this.trxvurxTransmitterCurrentMa = _tmp; - return this.trxvurxTransmitterCurrentMa; - } - private Integer rcCntCmdRaw; - public Integer rcCntCmdRaw() { - if (this.rcCntCmdRaw != null) - return this.rcCntCmdRaw; - int _tmp = (int) (rcCntCmd()); - this.rcCntCmdRaw = _tmp; - return this.rcCntCmdRaw; - } - private Integer imtqSystemStateModeRaw; - - /** - * value : - * IDLE = 0 - * SELFTEST = 1 - * DETUMBLE = 2 - */ - public Integer imtqSystemStateModeRaw() { - if (this.imtqSystemStateModeRaw != null) - return this.imtqSystemStateModeRaw; - int _tmp = (int) (imtqSystemStateMode()); - this.imtqSystemStateModeRaw = _tmp; - return this.imtqSystemStateModeRaw; - } - private Integer statObcOcfRaw; - - /** - * bit n = 1 indicates a overcurrent on the channel n 9 firsts bits used - */ - public Integer statObcOcfRaw() { - if (this.statObcOcfRaw != null) - return this.statObcOcfRaw; - int _tmp = (int) (statObcOcf()); - this.statObcOcfRaw = _tmp; - return this.statObcOcfRaw; - } - private Double measureCoilZCurrentMa; - public Double measureCoilZCurrentMa() { - if (this.measureCoilZCurrentMa != null) - return this.measureCoilZCurrentMa; - double _tmp = (double) (((1000.0 * (((2.5 / 4095) * measureCoilZCurrent()) - 1.03)) / 0.48)); - this.measureCoilZCurrentMa = _tmp; - return this.measureCoilZCurrentMa; - } - private Integer voltVd2Raw; - public Integer voltVd2Raw() { - if (this.voltVd2Raw != null) - return this.voltVd2Raw; - int _tmp = (int) (voltVd2()); - this.voltVd2Raw = _tmp; - return this.voltVd2Raw; - } - private Long uptimeRaw; - public Long uptimeRaw() { - if (this.uptimeRaw != null) - return this.uptimeRaw; - long _tmp = (long) (uptime()); - this.uptimeRaw = _tmp; - return this.uptimeRaw; - } - private Double voltBrdSupRawV; - public Double voltBrdSupRawV() { - if (this.voltBrdSupRawV != null) - return this.voltBrdSupRawV; - double _tmp = (double) (((voltBrdSupRaw() * 1000.0) / 819.0)); - this.voltBrdSupRawV = _tmp; - return this.voltBrdSupRawV; - } - private Double measureCoilZTemperatureC; - public Double measureCoilZTemperatureC() { - if (this.measureCoilZTemperatureC != null) - return this.measureCoilZTemperatureC; - double _tmp = (double) ((((((2.5 / 4095) * measureCoilZTemperature()) - 1.567) * -1.0) / 0.0081)); - this.measureCoilZTemperatureC = _tmp; - return this.measureCoilZTemperatureC; - } - private Double iObc00Ma; - public Double iObc00Ma() { - if (this.iObc00Ma != null) - return this.iObc00Ma; - double _tmp = (double) (((iObc00() * 3125.0) / 20480.0)); - this.iObc00Ma = _tmp; - return this.iObc00Ma; - } - private Integer rcCntWdgRaw; - public Integer rcCntWdgRaw() { - if (this.rcCntWdgRaw != null) - return this.rcCntWdgRaw; - int _tmp = (int) (rcCntWdg()); - this.rcCntWdgRaw = _tmp; - return this.rcCntWdgRaw; - } - private Double pDistInputRawMw; - public Double pDistInputRawMw() { - if (this.pDistInputRawMw != null) - return this.pDistInputRawMw; - double _tmp = (double) (((pDistInputRaw() * 3125.0) / 3200.0)); - this.pDistInputRawMw = _tmp; - return this.pDistInputRawMw; - } - private Double measureCoilXCurrentMa; - public Double measureCoilXCurrentMa() { - if (this.measureCoilXCurrentMa != null) - return this.measureCoilXCurrentMa; - double _tmp = (double) (((1000.0 * (((2.5 / 4095) * measureCoilXCurrent()) - 1.03)) / 2.0)); - this.measureCoilXCurrentMa = _tmp; - return this.measureCoilXCurrentMa; - } - private Integer batStatRaw; - public Integer batStatRaw() { - if (this.batStatRaw != null) - return this.batStatRaw; - int _tmp = (int) (batStat()); - this.batStatRaw = _tmp; - return this.batStatRaw; - } - private Integer resetOrderRaw; - - /** - * Order by TC = 0xCA - * No order = 0 - */ - public Integer resetOrderRaw() { - if (this.resetOrderRaw != null) - return this.resetOrderRaw; - int _tmp = (int) (resetOrder()); - this.resetOrderRaw = _tmp; - return this.resetOrderRaw; - } - private Double trxvutxSupplyVoltageV; - public Double trxvutxSupplyVoltageV() { - if (this.trxvutxSupplyVoltageV != null) - return this.trxvutxSupplyVoltageV; - double _tmp = (double) ((0.00488 * trxvutxSupplyVoltage())); - this.trxvutxSupplyVoltageV = _tmp; - return this.trxvutxSupplyVoltageV; - } - private Double vObc06V; - public Double vObc06V() { - if (this.vObc06V != null) - return this.vObc06V; - double _tmp = (double) ((((vObc06() * 125.0) / 128.0) / 1000.0)); - this.vObc06V = _tmp; - return this.vObc06V; - } - private Double iObc03Ma; - public Double iObc03Ma() { - if (this.iObc03Ma != null) - return this.iObc03Ma; - double _tmp = (double) (((iObc03() * 3125.0) / 20480.0)); - this.iObc03Ma = _tmp; - return this.iObc03Ma; - } - private Double vObc03V; - public Double vObc03V() { - if (this.vObc03V != null) - return this.vObc03V; - double _tmp = (double) ((((vObc03() * 125.0) / 128.0) / 1000.0)); - this.vObc03V = _tmp; - return this.vObc03V; - } - private Double trxvutxInstantaneousRfReflectedPowerFromTransmitterPortMw; - public Double trxvutxInstantaneousRfReflectedPowerFromTransmitterPortMw() { - if (this.trxvutxInstantaneousRfReflectedPowerFromTransmitterPortMw != null) - return this.trxvutxInstantaneousRfReflectedPowerFromTransmitterPortMw; - double _tmp = (double) (((((1000.0 * trxvutxInstantaneousRfReflectedPowerFromTransmitterPort()) * trxvutxInstantaneousRfReflectedPowerFromTransmitterPort()) * 5.887) * 0.00001)); - this.trxvutxInstantaneousRfReflectedPowerFromTransmitterPortMw = _tmp; - return this.trxvutxInstantaneousRfReflectedPowerFromTransmitterPortMw; - } - private Long nbTmSinceFirstStartRaw; - public Long nbTmSinceFirstStartRaw() { - if (this.nbTmSinceFirstStartRaw != null) - return this.nbTmSinceFirstStartRaw; - long _tmp = (long) (nbTmSinceFirstStart()); - this.nbTmSinceFirstStartRaw = _tmp; - return this.nbTmSinceFirstStartRaw; - } - private Double iBattInputRawMa; - public Double iBattInputRawMa() { - if (this.iBattInputRawMa != null) - return this.iBattInputRawMa; - double _tmp = (double) ((1000.0 * ((iBattInputRaw() * 3125.0) / 10240.0))); - this.iBattInputRawMa = _tmp; - return this.iBattInputRawMa; - } - private Double panelTemperature3C; - public Double panelTemperature3C() { - if (this.panelTemperature3C != null) - return this.panelTemperature3C; - double _tmp = (double) ((panelTemperature3() / 1024.0)); - this.panelTemperature3C = _tmp; - return this.panelTemperature3C; - } - private Double trxvutxLocalOscillatorTemperatureC; - public Double trxvutxLocalOscillatorTemperatureC() { - if (this.trxvutxLocalOscillatorTemperatureC != null) - return this.trxvutxLocalOscillatorTemperatureC; - double _tmp = (double) (((trxvutxLocalOscillatorTemperature() * -0.07669) + 195.6037)); - this.trxvutxLocalOscillatorTemperatureC = _tmp; - return this.trxvutxLocalOscillatorTemperatureC; - } - private Integer photodiode2Raw; - public Integer photodiode2Raw() { - if (this.photodiode2Raw != null) - return this.photodiode2Raw; - int _tmp = (int) (photodiode2()); - this.photodiode2Raw = _tmp; - return this.photodiode2Raw; - } - private Double iObc02Ma; - public Double iObc02Ma() { - if (this.iObc02Ma != null) - return this.iObc02Ma; - double _tmp = (double) (((iObc02() * 3125.0) / 20480.0)); - this.iObc02Ma = _tmp; - return this.iObc02Ma; - } - private Integer statusStidRaw; - public Integer statusStidRaw() { - if (this.statusStidRaw != null) - return this.statusStidRaw; - int _tmp = (int) (statusStid()); - this.statusStidRaw = _tmp; - return this.statusStidRaw; - } - private Double trxvutxInstantaneousRfForwardPowerFromTransmitterPortMw; - public Double trxvutxInstantaneousRfForwardPowerFromTransmitterPortMw() { - if (this.trxvutxInstantaneousRfForwardPowerFromTransmitterPortMw != null) - return this.trxvutxInstantaneousRfForwardPowerFromTransmitterPortMw; - double _tmp = (double) (((((1000.0 * trxvutxInstantaneousRfForwardPowerFromTransmitterPort()) * trxvutxInstantaneousRfForwardPowerFromTransmitterPort()) * 5.887) * 0.00001)); - this.trxvutxInstantaneousRfForwardPowerFromTransmitterPortMw = _tmp; - return this.trxvutxInstantaneousRfForwardPowerFromTransmitterPortMw; - } - private Integer photodiode6Raw; - public Integer photodiode6Raw() { - if (this.photodiode6Raw != null) - return this.photodiode6Raw; - int _tmp = (int) (photodiode6()); - this.photodiode6Raw = _tmp; - return this.photodiode6Raw; - } - private Double iObc06Ma; - public Double iObc06Ma() { - if (this.iObc06Ma != null) - return this.iObc06Ma; - double _tmp = (double) (((iObc06() * 3125.0) / 20480.0)); - this.iObc06Ma = _tmp; - return this.iObc06Ma; - } - private Integer statusRcRaw; - public Integer statusRcRaw() { - if (this.statusRcRaw != null) - return this.statusRcRaw; - int _tmp = (int) (statusRc()); - this.statusRcRaw = _tmp; - return this.statusRcRaw; - } - private Integer errorRaw; - public Integer errorRaw() { - if (this.errorRaw != null) - return this.errorRaw; - int _tmp = (int) (error()); - this.errorRaw = _tmp; - return this.errorRaw; - } - private Double iDistInputRawMa; - public Double iDistInputRawMa() { - if (this.iDistInputRawMa != null) - return this.iDistInputRawMa; - double _tmp = (double) (((iDistInputRaw() * 3125.0) / 10240.0)); - this.iDistInputRawMa = _tmp; - return this.iDistInputRawMa; - } - private Integer photodiode4Raw; - public Integer photodiode4Raw() { - if (this.photodiode4Raw != null) - return this.photodiode4Raw; - int _tmp = (int) (photodiode4()); - this.photodiode4Raw = _tmp; - return this.photodiode4Raw; - } - private Double measureCoilYCurrentMa; - public Double measureCoilYCurrentMa() { - if (this.measureCoilYCurrentMa != null) - return this.measureCoilYCurrentMa; - double _tmp = (double) (((1000.0 * (((2.5 / 4095) * measureCoilYCurrent()) - 1.03)) / 2.0)); - this.measureCoilYCurrentMa = _tmp; - return this.measureCoilYCurrentMa; - } - private Double vObc01V; - public Double vObc01V() { - if (this.vObc01V != null) - return this.vObc01V; - double _tmp = (double) ((((vObc01() * 125.0) / 128.0) / 1000.0)); - this.vObc01V = _tmp; - return this.vObc01V; - } - private Double pBattInputRawMw; - public Double pBattInputRawMw() { - if (this.pBattInputRawMw != null) - return this.pBattInputRawMw; - double _tmp = (double) (((pBattInputRaw() * 3125.0) / 3200.0)); - this.pBattInputRawMw = _tmp; - return this.pBattInputRawMw; - } - private Double iObc01Ma; - public Double iObc01Ma() { - if (this.iObc01Ma != null) - return this.iObc01Ma; - double _tmp = (double) (((iObc01() * 3125.0) / 20480.0)); - this.iObc01Ma = _tmp; - return this.iObc01Ma; - } - private Long nbTmInSdcardRaw; - public Long nbTmInSdcardRaw() { - if (this.nbTmInSdcardRaw != null) - return this.nbTmInSdcardRaw; - long _tmp = (long) (nbTmInSdcard()); - this.nbTmInSdcardRaw = _tmp; - return this.nbTmInSdcardRaw; - } - private Double tempRawT; - public Double tempRawT() { - if (this.tempRawT != null) - return this.tempRawT; - double _tmp = (double) (((((tempRaw() - 1168) * 220.0) / 9.0) / 100.0)); - this.tempRawT = _tmp; - return this.tempRawT; - } - private Double panelTemperature4C; - public Double panelTemperature4C() { - if (this.panelTemperature4C != null) - return this.panelTemperature4C; - double _tmp = (double) ((panelTemperature4() / 1024.0)); - this.panelTemperature4C = _tmp; - return this.panelTemperature4C; - } - private Integer photodiode3Raw; - public Integer photodiode3Raw() { - if (this.photodiode3Raw != null) - return this.photodiode3Raw; - int _tmp = (int) (photodiode3()); - this.photodiode3Raw = _tmp; - return this.photodiode3Raw; - } - private Double trxvutxReceiverCurrentMa; - public Double trxvutxReceiverCurrentMa() { - if (this.trxvutxReceiverCurrentMa != null) - return this.trxvutxReceiverCurrentMa; - double _tmp = (double) ((trxvutxReceiverCurrent() * 0.16643964)); - this.trxvutxReceiverCurrentMa = _tmp; - return this.trxvutxReceiverCurrentMa; - } - private Integer rcCntEmlopoRaw; - public Integer rcCntEmlopoRaw() { - if (this.rcCntEmlopoRaw != null) - return this.rcCntEmlopoRaw; - int _tmp = (int) (rcCntEmlopo()); - this.rcCntEmlopoRaw = _tmp; - return this.rcCntEmlopoRaw; - } - private Integer rcCntMcuRaw; - public Integer rcCntMcuRaw() { - if (this.rcCntMcuRaw != null) - return this.rcCntMcuRaw; - int _tmp = (int) (rcCntMcu()); - this.rcCntMcuRaw = _tmp; - return this.rcCntMcuRaw; - } - private Integer statusBidRaw; - public Integer statusBidRaw() { - if (this.statusBidRaw != null) - return this.statusBidRaw; - int _tmp = (int) (statusBid()); - this.statusBidRaw = _tmp; - return this.statusBidRaw; - } - private Integer statusIvidRaw; - public Integer statusIvidRaw() { - if (this.statusIvidRaw != null) - return this.statusIvidRaw; - int _tmp = (int) (statusIvid()); - this.statusIvidRaw = _tmp; - return this.statusIvidRaw; - } - private Double panelTemperature1C; - public Double panelTemperature1C() { - if (this.panelTemperature1C != null) - return this.panelTemperature1C; - double _tmp = (double) ((panelTemperature1() / 1024.0)); - this.panelTemperature1C = _tmp; - return this.panelTemperature1C; - } - private Double pObc03Mw; - public Double pObc03Mw() { - if (this.pObc03Mw != null) - return this.pObc03Mw; - double _tmp = (double) (((pObc03() * 3125.0) / 6400.0)); - this.pObc03Mw = _tmp; - return this.pObc03Mw; - } - private Integer voltVd1Raw; - public Integer voltVd1Raw() { - if (this.voltVd1Raw != null) - return this.voltVd1Raw; - int _tmp = (int) (voltVd1()); - this.voltVd1Raw = _tmp; - return this.voltVd1Raw; - } - private Double trxvurxPowerAmplifierCurrentMa; - public Double trxvurxPowerAmplifierCurrentMa() { - if (this.trxvurxPowerAmplifierCurrentMa != null) - return this.trxvurxPowerAmplifierCurrentMa; - double _tmp = (double) (((1000.0 * trxvurxPowerAmplifierCurrent()) * 0.16643964)); - this.trxvurxPowerAmplifierCurrentMa = _tmp; - return this.trxvurxPowerAmplifierCurrentMa; - } - private Double trxvurxTotalSupplyCurrentMa; - public Double trxvurxTotalSupplyCurrentMa() { - if (this.trxvurxTotalSupplyCurrentMa != null) - return this.trxvurxTotalSupplyCurrentMa; - double _tmp = (double) ((0.16643964 * trxvurxTotalSupplyCurrent())); - this.trxvurxTotalSupplyCurrentMa = _tmp; - return this.trxvurxTotalSupplyCurrentMa; - } - private Double vObc05V; - public Double vObc05V() { - if (this.vObc05V != null) - return this.vObc05V; - double _tmp = (double) ((((vObc05() * 125.0) / 128.0) / 1000.0)); - this.vObc05V = _tmp; - return this.vObc05V; - } - private Double trxvutxPowerAmplifierTemperatureC; - public Double trxvutxPowerAmplifierTemperatureC() { - if (this.trxvutxPowerAmplifierTemperatureC != null) - return this.trxvutxPowerAmplifierTemperatureC; - double _tmp = (double) (((trxvutxPowerAmplifierTemperature() * -0.07669) + 195.6037)); - this.trxvutxPowerAmplifierTemperatureC = _tmp; - return this.trxvutxPowerAmplifierTemperatureC; - } - private Long nbTcSinceFirstStartRaw; - public Long nbTcSinceFirstStartRaw() { - if (this.nbTcSinceFirstStartRaw != null) - return this.nbTcSinceFirstStartRaw; - long _tmp = (long) (nbTcSinceFirstStart()); - this.nbTcSinceFirstStartRaw = _tmp; - return this.nbTcSinceFirstStartRaw; - } - private Double trxvutxTransmitterCurrentMa; - public Double trxvutxTransmitterCurrentMa() { - if (this.trxvutxTransmitterCurrentMa != null) - return this.trxvutxTransmitterCurrentMa; - double _tmp = (double) ((trxvutxTransmitterCurrent() * 0.16643964)); - this.trxvutxTransmitterCurrentMa = _tmp; - return this.trxvutxTransmitterCurrentMa; - } - private Double mcuTemperatureC; - public Double mcuTemperatureC() { - if (this.mcuTemperatureC != null) - return this.mcuTemperatureC; - double _tmp = (double) ((((((2.5 / 4095) * mcuTemperature()) - 0.680) * -1.0) / 0.00225)); - this.mcuTemperatureC = _tmp; - return this.mcuTemperatureC; - } - private Double vObc00V; - public Double vObc00V() { - if (this.vObc00V != null) - return this.vObc00V; - double _tmp = (double) ((((vObc00() * 125.0) / 128.0) / 1000.0)); - this.vObc00V = _tmp; - return this.vObc00V; - } - private Long nbTcPingSinceFirstStartRaw; - public Long nbTcPingSinceFirstStartRaw() { - if (this.nbTcPingSinceFirstStartRaw != null) - return this.nbTcPingSinceFirstStartRaw; - long _tmp = (long) (nbTcPingSinceFirstStart()); - this.nbTcPingSinceFirstStartRaw = _tmp; - return this.nbTcPingSinceFirstStartRaw; - } - private Integer voltVd0Raw; - public Integer voltVd0Raw() { - if (this.voltVd0Raw != null) - return this.voltVd0Raw; - int _tmp = (int) (voltVd0()); - this.voltVd0Raw = _tmp; - return this.voltVd0Raw; - } - private Double batTemp2RawT; - public Double batTemp2RawT() { - if (this.batTemp2RawT != null) - return this.batTemp2RawT; - double _tmp = (double) (((batTemp2Raw() * -0.047715407918) + 98.38261483)); - this.batTemp2RawT = _tmp; - return this.batTemp2RawT; - } - private Double vBattInputRawV; - public Double vBattInputRawV() { - if (this.vBattInputRawV != null) - return this.vBattInputRawV; - double _tmp = (double) ((((vBattInputRaw() * 125.0) / 128.0) / 1000.0)); - this.vBattInputRawV = _tmp; - return this.vBattInputRawV; - } - private Double trxvurxPowerAmplifierTemperatureC; - public Double trxvurxPowerAmplifierTemperatureC() { - if (this.trxvurxPowerAmplifierTemperatureC != null) - return this.trxvurxPowerAmplifierTemperatureC; - double _tmp = (double) (((trxvurxPowerAmplifierTemperature() * -0.07669) + 195.6037)); - this.trxvurxPowerAmplifierTemperatureC = _tmp; - return this.trxvurxPowerAmplifierTemperatureC; - } - private Integer resetCauseRaw; - - /** - * value : - * 0 = Power-on; system returned from an unpowered state (e.g. power cycle). - * 1 = Watchdog; system was reset due to watchdog timeout, caused by a too-long delay between command interactions with the parent system. - * 2 = Commanded; system was reset after having received a reset command. - * 3 = Control system reset; an upset in the EPS control system caused a reset. - * 4 = Emlopo; emergency low power mode was engaged because the input voltage dropped below the threshold. - */ - public Integer resetCauseRaw() { - if (this.resetCauseRaw != null) - return this.resetCauseRaw; - int _tmp = (int) (resetCause()); - this.resetCauseRaw = _tmp; - return this.resetCauseRaw; - } - private Long nbBadTcSinceFirstStartRaw; - public Long nbBadTcSinceFirstStartRaw() { - if (this.nbBadTcSinceFirstStartRaw != null) - return this.nbBadTcSinceFirstStartRaw; - long _tmp = (long) (nbBadTcSinceFirstStart()); - this.nbBadTcSinceFirstStartRaw = _tmp; - return this.nbBadTcSinceFirstStartRaw; - } - private Double pObc02Mw; - public Double pObc02Mw() { - if (this.pObc02Mw != null) - return this.pObc02Mw; - double _tmp = (double) (((pObc02() * 3125.0) / 6400.0)); - this.pObc02Mw = _tmp; - return this.pObc02Mw; - } - private Integer swModeRaw; - - /** - * : mode value - * MODE_INIT = 0 - * MODE_DETUMBLING = 1 - * MODE_STANDBY = 2 - * MODE_OPERATIONAL = 3 - * MODE_SAFE = 4 - * MODE_TRANSPONDER = 5 - */ - public Integer swModeRaw() { - if (this.swModeRaw != null) - return this.swModeRaw; - int _tmp = (int) (swMode()); - this.swModeRaw = _tmp; - return this.swModeRaw; - } - private Integer sideAAntsTemperatureRaw; - public Integer sideAAntsTemperatureRaw() { - if (this.sideAAntsTemperatureRaw != null) - return this.sideAAntsTemperatureRaw; - int _tmp = (int) (sideAAntsTemperature()); - this.sideAAntsTemperatureRaw = _tmp; - return this.sideAAntsTemperatureRaw; - } - private Double panelTemperature5C; - public Double panelTemperature5C() { - if (this.panelTemperature5C != null) - return this.panelTemperature5C; - double _tmp = (double) ((panelTemperature5() / 1024.0)); - this.panelTemperature5C = _tmp; - return this.panelTemperature5C; - } - private Integer sideAAntsDeploymentStatusRaw; - public Integer sideAAntsDeploymentStatusRaw() { - if (this.sideAAntsDeploymentStatusRaw != null) - return this.sideAAntsDeploymentStatusRaw; - int _tmp = (int) (sideAAntsDeploymentStatus()); - this.sideAAntsDeploymentStatusRaw = _tmp; - return this.sideAAntsDeploymentStatusRaw; - } - private Double measureCoilXTemperatureC; - public Double measureCoilXTemperatureC() { - if (this.measureCoilXTemperatureC != null) - return this.measureCoilXTemperatureC; - double _tmp = (double) ((((((2.5 / 4095) * measureCoilXTemperature()) - 1.567) * -1.0) / 0.0081)); - this.measureCoilXTemperatureC = _tmp; - return this.measureCoilXTemperatureC; - } - private Integer confRaw; - - /** - * value : - * 0 = Parameters have not been altered since the last load/save. - * 1 = Parameters have been altered since the last load/save. - */ - public Integer confRaw() { - if (this.confRaw != null) - return this.confRaw; - int _tmp = (int) (conf()); - this.confRaw = _tmp; - return this.confRaw; - } - private Integer formatSdcardOrderRaw; - - /** - * Order to Format SdCard 0 = 0 - * Order to Format SdCard 1 = 1 - * Order to NOT Format SdCard 0 = 0xAC - * Order to NOT Format SdCard 1 = 0xAD - */ - public Integer formatSdcardOrderRaw() { - if (this.formatSdcardOrderRaw != null) - return this.formatSdcardOrderRaw; - int _tmp = (int) (formatSdcardOrder()); - this.formatSdcardOrderRaw = _tmp; - return this.formatSdcardOrderRaw; - } - private Double panelTemperature2C; - public Double panelTemperature2C() { - if (this.panelTemperature2C != null) - return this.panelTemperature2C; - double _tmp = (double) ((panelTemperature2() / 1024.0)); - this.panelTemperature2C = _tmp; - return this.panelTemperature2C; - } - private Double trxvurxReceiverCurrentMa; - public Double trxvurxReceiverCurrentMa() { - if (this.trxvurxReceiverCurrentMa != null) - return this.trxvurxReceiverCurrentMa; - double _tmp = (double) ((trxvurxReceiverCurrent() * 0.16643964)); - this.trxvurxReceiverCurrentMa = _tmp; - return this.trxvurxReceiverCurrentMa; - } - private Integer prevcmdElapsedRaw; - public Integer prevcmdElapsedRaw() { - if (this.prevcmdElapsedRaw != null) - return this.prevcmdElapsedRaw; - int _tmp = (int) (prevcmdElapsed()); - this.prevcmdElapsedRaw = _tmp; - return this.prevcmdElapsedRaw; - } - private int swMode; - private int lastResetReason; - private int resetOrder; - private int nbReset; - private int formatSdcardOrder; - private int deployAntennasSystem; - private long nbTmSinceFirstStart; - private long nbTcSinceFirstStart; - private long nbTcPingSinceFirstStart; - private long nbBadTcSinceFirstStart; - private long nbTmInSdcard; - private long trxvutxInstantaneousRfReflectedPowerFromTransmitterPort; - private long trxvutxInstantaneousRfForwardPowerFromTransmitterPort; - private long trxvutxSupplyVoltage; - private long trxvutxTotalSupplyCurrent; - private long trxvutxTransmitterCurrent; - private long trxvutxReceiverCurrent; - private long trxvutxPowerAmplifierCurrent; - private long trxvutxPowerAmplifierTemperature; - private long trxvutxLocalOscillatorTemperature; - private long trxvurxInstantaneousReceivedSignalDopplerOffsetAtTheReceiverPort; - private long trxvurxInstantaneousReceivedSignalStrengthAtTheReceiverPort; - private long trxvurxSupplyVoltage; - private long trxvurxTotalSupplyCurrent; - private long trxvurxTransmitterCurrent; - private long trxvurxReceiverCurrent; - private long trxvurxPowerAmplifierCurrent; - private long trxvurxPowerAmplifierTemperature; - private long trxvurxLocalOscillatorTemperature; - private int imtqSystemStateMode; - private int measureCoilXCurrent; - private int measureCoilYCurrent; - private int measureCoilZCurrent; - private int measureCoilXTemperature; - private int measureCoilYTemperature; - private int measureCoilZTemperature; - private int mcuTemperature; - private int sideAAntsTemperature; - private int sideAAntsDeploymentStatus; - private int voltBrdSupRaw; - private int tempRaw; - private int vDistInputRaw; - private int iDistInputRaw; - private int pDistInputRaw; - private int vBattInputRaw; - private int iBattInputRaw; - private int pBattInputRaw; - private int statObcOn; - private int statObcOcf; - private int batStat; - private int batTemp2Raw; - private int voltVd0; - private int voltVd1; - private int voltVd2; - private int vObc00; - private int iObc00; - private int pObc00; - private int vObc01; - private int iObc01; - private int pObc01; - private int vObc02; - private int iObc02; - private int pObc02; - private int vObc03; - private int iObc03; - private int pObc03; - private int vObc05; - private int iObc05; - private int pObc05; - private int vObc06; - private int iObc06; - private int pObc06; - private int statusStid; - private int statusIvid; - private int statusRc; - private int statusBid; - private long statusCmderr; - private long statusStat; - private int mode; - private int conf; - private int resetCause; - private long uptime; - private int error; - private int rcCntPwron; - private int rcCntWdg; - private int rcCntCmd; - private int rcCntMcu; - private int rcCntEmlopo; - private int prevcmdElapsed; - private int photodiode1; - private int photodiode2; - private int photodiode3; - private int photodiode4; - private int photodiode5; - private int photodiode6; - private int panelTemperature1; - private int panelTemperature2; - private int panelTemperature3; - private int panelTemperature4; - private int panelTemperature5; - private int panelTemperature6; - private Uvsqsat _root; - private Uvsqsat.UiFrame _parent; - public int swMode() { return swMode; } - public int lastResetReason() { return lastResetReason; } - public int resetOrder() { return resetOrder; } - public int nbReset() { return nbReset; } - public int formatSdcardOrder() { return formatSdcardOrder; } - public int deployAntennasSystem() { return deployAntennasSystem; } - public long nbTmSinceFirstStart() { return nbTmSinceFirstStart; } - public long nbTcSinceFirstStart() { return nbTcSinceFirstStart; } - public long nbTcPingSinceFirstStart() { return nbTcPingSinceFirstStart; } - public long nbBadTcSinceFirstStart() { return nbBadTcSinceFirstStart; } - public long nbTmInSdcard() { return nbTmInSdcard; } - public long trxvutxInstantaneousRfReflectedPowerFromTransmitterPort() { return trxvutxInstantaneousRfReflectedPowerFromTransmitterPort; } - public long trxvutxInstantaneousRfForwardPowerFromTransmitterPort() { return trxvutxInstantaneousRfForwardPowerFromTransmitterPort; } - public long trxvutxSupplyVoltage() { return trxvutxSupplyVoltage; } - public long trxvutxTotalSupplyCurrent() { return trxvutxTotalSupplyCurrent; } - public long trxvutxTransmitterCurrent() { return trxvutxTransmitterCurrent; } - public long trxvutxReceiverCurrent() { return trxvutxReceiverCurrent; } - public long trxvutxPowerAmplifierCurrent() { return trxvutxPowerAmplifierCurrent; } - public long trxvutxPowerAmplifierTemperature() { return trxvutxPowerAmplifierTemperature; } - public long trxvutxLocalOscillatorTemperature() { return trxvutxLocalOscillatorTemperature; } - public long trxvurxInstantaneousReceivedSignalDopplerOffsetAtTheReceiverPort() { return trxvurxInstantaneousReceivedSignalDopplerOffsetAtTheReceiverPort; } - public long trxvurxInstantaneousReceivedSignalStrengthAtTheReceiverPort() { return trxvurxInstantaneousReceivedSignalStrengthAtTheReceiverPort; } - public long trxvurxSupplyVoltage() { return trxvurxSupplyVoltage; } - public long trxvurxTotalSupplyCurrent() { return trxvurxTotalSupplyCurrent; } - public long trxvurxTransmitterCurrent() { return trxvurxTransmitterCurrent; } - public long trxvurxReceiverCurrent() { return trxvurxReceiverCurrent; } - public long trxvurxPowerAmplifierCurrent() { return trxvurxPowerAmplifierCurrent; } - public long trxvurxPowerAmplifierTemperature() { return trxvurxPowerAmplifierTemperature; } - public long trxvurxLocalOscillatorTemperature() { return trxvurxLocalOscillatorTemperature; } - public int imtqSystemStateMode() { return imtqSystemStateMode; } - public int measureCoilXCurrent() { return measureCoilXCurrent; } - public int measureCoilYCurrent() { return measureCoilYCurrent; } - public int measureCoilZCurrent() { return measureCoilZCurrent; } - public int measureCoilXTemperature() { return measureCoilXTemperature; } - public int measureCoilYTemperature() { return measureCoilYTemperature; } - public int measureCoilZTemperature() { return measureCoilZTemperature; } - public int mcuTemperature() { return mcuTemperature; } - public int sideAAntsTemperature() { return sideAAntsTemperature; } - public int sideAAntsDeploymentStatus() { return sideAAntsDeploymentStatus; } - public int voltBrdSupRaw() { return voltBrdSupRaw; } - public int tempRaw() { return tempRaw; } - public int vDistInputRaw() { return vDistInputRaw; } - public int iDistInputRaw() { return iDistInputRaw; } - public int pDistInputRaw() { return pDistInputRaw; } - public int vBattInputRaw() { return vBattInputRaw; } - public int iBattInputRaw() { return iBattInputRaw; } - public int pBattInputRaw() { return pBattInputRaw; } - public int statObcOn() { return statObcOn; } - public int statObcOcf() { return statObcOcf; } - public int batStat() { return batStat; } - public int batTemp2Raw() { return batTemp2Raw; } - public int voltVd0() { return voltVd0; } - public int voltVd1() { return voltVd1; } - public int voltVd2() { return voltVd2; } - public int vObc00() { return vObc00; } - public int iObc00() { return iObc00; } - public int pObc00() { return pObc00; } - public int vObc01() { return vObc01; } - public int iObc01() { return iObc01; } - public int pObc01() { return pObc01; } - public int vObc02() { return vObc02; } - public int iObc02() { return iObc02; } - public int pObc02() { return pObc02; } - public int vObc03() { return vObc03; } - public int iObc03() { return iObc03; } - public int pObc03() { return pObc03; } - public int vObc05() { return vObc05; } - public int iObc05() { return iObc05; } - public int pObc05() { return pObc05; } - public int vObc06() { return vObc06; } - public int iObc06() { return iObc06; } - public int pObc06() { return pObc06; } - public int statusStid() { return statusStid; } - public int statusIvid() { return statusIvid; } - public int statusRc() { return statusRc; } - public int statusBid() { return statusBid; } - public long statusCmderr() { return statusCmderr; } - public long statusStat() { return statusStat; } - public int mode() { return mode; } - public int conf() { return conf; } - public int resetCause() { return resetCause; } - public long uptime() { return uptime; } - public int error() { return error; } - public int rcCntPwron() { return rcCntPwron; } - public int rcCntWdg() { return rcCntWdg; } - public int rcCntCmd() { return rcCntCmd; } - public int rcCntMcu() { return rcCntMcu; } - public int rcCntEmlopo() { return rcCntEmlopo; } - public int prevcmdElapsed() { return prevcmdElapsed; } - public int photodiode1() { return photodiode1; } - public int photodiode2() { return photodiode2; } - public int photodiode3() { return photodiode3; } - public int photodiode4() { return photodiode4; } - public int photodiode5() { return photodiode5; } - public int photodiode6() { return photodiode6; } - public int panelTemperature1() { return panelTemperature1; } - public int panelTemperature2() { return panelTemperature2; } - public int panelTemperature3() { return panelTemperature3; } - public int panelTemperature4() { return panelTemperature4; } - public int panelTemperature5() { return panelTemperature5; } - public int panelTemperature6() { return panelTemperature6; } - public Uvsqsat _root() { return _root; } - public Uvsqsat.UiFrame _parent() { return _parent; } - } - public static class ObcHk extends KaitaiStruct { - public static ObcHk fromFile(String fileName) throws IOException { - return new ObcHk(new ByteBufferKaitaiStream(fileName)); - } - - public ObcHk(KaitaiStream _io) { - this(_io, null, null); - } - - public ObcHk(KaitaiStream _io, Uvsqsat.UiFrame _parent) { - this(_io, _parent, null); - } - - public ObcHk(KaitaiStream _io, Uvsqsat.UiFrame _parent, Uvsqsat _root) { - super(_io); - this._parent = _parent; - this._root = _root; - _read(); - } - private void _read() { - this.dummy = this._io.readU1(); - this.spiCommandStatus = this._io.readU1(); - this.supervisorEnableStatus = this._io.readU1(); - this.supervisorUptime = this._io.readU4be(); - this.iobcUptime = this._io.readU4be(); - this.iobcResetCount = this._io.readU4be(); - this.iobcMeasureTemperature = this._io.readU2be(); - this.iobcMeasure3v3In = this._io.readU2be(); - this.iobcMeasure3v3 = this._io.readU2be(); - this.iobcMeasure2vReference = this._io.readU2be(); - this.iobcMeasure1v8 = this._io.readU2be(); - this.iobcMeasure1v0 = this._io.readU2be(); - this.iobcMeasureCurrent3v3 = this._io.readU2be(); - this.iobcMeasureCurrent1v8 = this._io.readU2be(); - this.iobcMeasureCurrent1v0 = this._io.readU2be(); - this.iobcMeasureVoltRtc = this._io.readU2be(); - this.iobcAdcUpdateFlag = this._io.readU1(); - this.iobcCrc8 = this._io.readU1(); - this.photodiode1 = this._io.readU2be(); - this.photodiode2 = this._io.readU2be(); - this.photodiode3 = this._io.readU2be(); - this.photodiode4 = this._io.readU2be(); - this.photodiode5 = this._io.readU2be(); - this.photodiode6 = this._io.readU2be(); - this.panelTemperature1 = this._io.readS4be(); - this.panelTemperature2 = this._io.readS4be(); - this.panelTemperature3 = this._io.readS4be(); - this.panelTemperature4 = this._io.readS4be(); - this.panelTemperature5 = this._io.readS4be(); - this.panelTemperature6 = this._io.readS4be(); - } - private Double panelTemperature6C; - public Double panelTemperature6C() { - if (this.panelTemperature6C != null) - return this.panelTemperature6C; - double _tmp = (double) ((panelTemperature6() / 1024.0)); - this.panelTemperature6C = _tmp; - return this.panelTemperature6C; - } - private Integer iobcMeasureTemperatureRaw; - public Integer iobcMeasureTemperatureRaw() { - if (this.iobcMeasureTemperatureRaw != null) - return this.iobcMeasureTemperatureRaw; - int _tmp = (int) (iobcMeasureTemperature()); - this.iobcMeasureTemperatureRaw = _tmp; - return this.iobcMeasureTemperatureRaw; - } - private Long supervisorUptimeRaw; - public Long supervisorUptimeRaw() { - if (this.supervisorUptimeRaw != null) - return this.supervisorUptimeRaw; - long _tmp = (long) (supervisorUptime()); - this.supervisorUptimeRaw = _tmp; - return this.supervisorUptimeRaw; - } - private Integer supervisorEnableStatusRaw; - public Integer supervisorEnableStatusRaw() { - if (this.supervisorEnableStatusRaw != null) - return this.supervisorEnableStatusRaw; - int _tmp = (int) (supervisorEnableStatus()); - this.supervisorEnableStatusRaw = _tmp; - return this.supervisorEnableStatusRaw; - } - private Integer iobcMeasure3v3InRaw; - public Integer iobcMeasure3v3InRaw() { - if (this.iobcMeasure3v3InRaw != null) - return this.iobcMeasure3v3InRaw; - int _tmp = (int) (iobcMeasure3v3In()); - this.iobcMeasure3v3InRaw = _tmp; - return this.iobcMeasure3v3InRaw; - } - private Integer photodiode2Raw; - public Integer photodiode2Raw() { - if (this.photodiode2Raw != null) - return this.photodiode2Raw; - int _tmp = (int) (photodiode2()); - this.photodiode2Raw = _tmp; - return this.photodiode2Raw; - } - private Integer iobcMeasureCurrent1v0Raw; - public Integer iobcMeasureCurrent1v0Raw() { - if (this.iobcMeasureCurrent1v0Raw != null) - return this.iobcMeasureCurrent1v0Raw; - int _tmp = (int) (iobcMeasureCurrent1v0()); - this.iobcMeasureCurrent1v0Raw = _tmp; - return this.iobcMeasureCurrent1v0Raw; - } - private Double panelTemperature3C; - public Double panelTemperature3C() { - if (this.panelTemperature3C != null) - return this.panelTemperature3C; - double _tmp = (double) ((panelTemperature3() / 1024.0)); - this.panelTemperature3C = _tmp; - return this.panelTemperature3C; - } - private Integer dummyRaw; - public Integer dummyRaw() { - if (this.dummyRaw != null) - return this.dummyRaw; - int _tmp = (int) (dummy()); - this.dummyRaw = _tmp; - return this.dummyRaw; - } - private Integer iobcMeasureVoltRtcRaw; - public Integer iobcMeasureVoltRtcRaw() { - if (this.iobcMeasureVoltRtcRaw != null) - return this.iobcMeasureVoltRtcRaw; - int _tmp = (int) (iobcMeasureVoltRtc()); - this.iobcMeasureVoltRtcRaw = _tmp; - return this.iobcMeasureVoltRtcRaw; - } - private Integer iobcMeasure1v8Raw; - public Integer iobcMeasure1v8Raw() { - if (this.iobcMeasure1v8Raw != null) - return this.iobcMeasure1v8Raw; - int _tmp = (int) (iobcMeasure1v8()); - this.iobcMeasure1v8Raw = _tmp; - return this.iobcMeasure1v8Raw; - } - private Integer iobcMeasure2vReferenceRaw; - public Integer iobcMeasure2vReferenceRaw() { - if (this.iobcMeasure2vReferenceRaw != null) - return this.iobcMeasure2vReferenceRaw; - int _tmp = (int) (iobcMeasure2vReference()); - this.iobcMeasure2vReferenceRaw = _tmp; - return this.iobcMeasure2vReferenceRaw; - } - private Integer iobcMeasureCurrent1v8Raw; - public Integer iobcMeasureCurrent1v8Raw() { - if (this.iobcMeasureCurrent1v8Raw != null) - return this.iobcMeasureCurrent1v8Raw; - int _tmp = (int) (iobcMeasureCurrent1v8()); - this.iobcMeasureCurrent1v8Raw = _tmp; - return this.iobcMeasureCurrent1v8Raw; - } - private Integer iobcMeasure3v3Raw; - public Integer iobcMeasure3v3Raw() { - if (this.iobcMeasure3v3Raw != null) - return this.iobcMeasure3v3Raw; - int _tmp = (int) (iobcMeasure3v3()); - this.iobcMeasure3v3Raw = _tmp; - return this.iobcMeasure3v3Raw; - } - private Integer photodiode6Raw; - public Integer photodiode6Raw() { - if (this.photodiode6Raw != null) - return this.photodiode6Raw; - int _tmp = (int) (photodiode6()); - this.photodiode6Raw = _tmp; - return this.photodiode6Raw; - } - private Double panelTemperature4C; - public Double panelTemperature4C() { - if (this.panelTemperature4C != null) - return this.panelTemperature4C; - double _tmp = (double) ((panelTemperature4() / 1024.0)); - this.panelTemperature4C = _tmp; - return this.panelTemperature4C; - } - private Double panelTemperature1C; - public Double panelTemperature1C() { - if (this.panelTemperature1C != null) - return this.panelTemperature1C; - double _tmp = (double) ((panelTemperature1() / 1024.0)); - this.panelTemperature1C = _tmp; - return this.panelTemperature1C; - } - private Integer iobcAdcUpdateFlagRaw; - public Integer iobcAdcUpdateFlagRaw() { - if (this.iobcAdcUpdateFlagRaw != null) - return this.iobcAdcUpdateFlagRaw; - int _tmp = (int) (iobcAdcUpdateFlag()); - this.iobcAdcUpdateFlagRaw = _tmp; - return this.iobcAdcUpdateFlagRaw; - } - private Integer photodiode4Raw; - public Integer photodiode4Raw() { - if (this.photodiode4Raw != null) - return this.photodiode4Raw; - int _tmp = (int) (photodiode4()); - this.photodiode4Raw = _tmp; - return this.photodiode4Raw; - } - private Long iobcResetCountRaw; - public Long iobcResetCountRaw() { - if (this.iobcResetCountRaw != null) - return this.iobcResetCountRaw; - long _tmp = (long) (iobcResetCount()); - this.iobcResetCountRaw = _tmp; - return this.iobcResetCountRaw; - } - private Long iobcUptimeRaw; - public Long iobcUptimeRaw() { - if (this.iobcUptimeRaw != null) - return this.iobcUptimeRaw; - long _tmp = (long) (iobcUptime()); - this.iobcUptimeRaw = _tmp; - return this.iobcUptimeRaw; - } - private Integer photodiode3Raw; - public Integer photodiode3Raw() { - if (this.photodiode3Raw != null) - return this.photodiode3Raw; - int _tmp = (int) (photodiode3()); - this.photodiode3Raw = _tmp; - return this.photodiode3Raw; - } - private Integer photodiode5Raw; - public Integer photodiode5Raw() { - if (this.photodiode5Raw != null) - return this.photodiode5Raw; - int _tmp = (int) (photodiode5()); - this.photodiode5Raw = _tmp; - return this.photodiode5Raw; - } - private Double panelTemperature5C; - public Double panelTemperature5C() { - if (this.panelTemperature5C != null) - return this.panelTemperature5C; - double _tmp = (double) ((panelTemperature5() / 1024.0)); - this.panelTemperature5C = _tmp; - return this.panelTemperature5C; - } - private Integer iobcMeasure1v0Raw; - public Integer iobcMeasure1v0Raw() { - if (this.iobcMeasure1v0Raw != null) - return this.iobcMeasure1v0Raw; - int _tmp = (int) (iobcMeasure1v0()); - this.iobcMeasure1v0Raw = _tmp; - return this.iobcMeasure1v0Raw; - } - private Integer iobcCrc8Raw; - public Integer iobcCrc8Raw() { - if (this.iobcCrc8Raw != null) - return this.iobcCrc8Raw; - int _tmp = (int) (iobcCrc8()); - this.iobcCrc8Raw = _tmp; - return this.iobcCrc8Raw; - } - private Integer photodiode1Raw; - public Integer photodiode1Raw() { - if (this.photodiode1Raw != null) - return this.photodiode1Raw; - int _tmp = (int) (photodiode1()); - this.photodiode1Raw = _tmp; - return this.photodiode1Raw; - } - private Integer spiCommandStatusRaw; - public Integer spiCommandStatusRaw() { - if (this.spiCommandStatusRaw != null) - return this.spiCommandStatusRaw; - int _tmp = (int) (spiCommandStatus()); - this.spiCommandStatusRaw = _tmp; - return this.spiCommandStatusRaw; - } - private Integer iobcMeasureCurrent3v3Raw; - public Integer iobcMeasureCurrent3v3Raw() { - if (this.iobcMeasureCurrent3v3Raw != null) - return this.iobcMeasureCurrent3v3Raw; - int _tmp = (int) (iobcMeasureCurrent3v3()); - this.iobcMeasureCurrent3v3Raw = _tmp; - return this.iobcMeasureCurrent3v3Raw; - } - private Double panelTemperature2C; - public Double panelTemperature2C() { - if (this.panelTemperature2C != null) - return this.panelTemperature2C; - double _tmp = (double) ((panelTemperature2() / 1024.0)); - this.panelTemperature2C = _tmp; - return this.panelTemperature2C; - } - private int dummy; - private int spiCommandStatus; - private int supervisorEnableStatus; - private long supervisorUptime; - private long iobcUptime; - private long iobcResetCount; - private int iobcMeasureTemperature; - private int iobcMeasure3v3In; - private int iobcMeasure3v3; - private int iobcMeasure2vReference; - private int iobcMeasure1v8; - private int iobcMeasure1v0; - private int iobcMeasureCurrent3v3; - private int iobcMeasureCurrent1v8; - private int iobcMeasureCurrent1v0; - private int iobcMeasureVoltRtc; - private int iobcAdcUpdateFlag; - private int iobcCrc8; - private int photodiode1; - private int photodiode2; - private int photodiode3; - private int photodiode4; - private int photodiode5; - private int photodiode6; - private int panelTemperature1; - private int panelTemperature2; - private int panelTemperature3; - private int panelTemperature4; - private int panelTemperature5; - private int panelTemperature6; - private Uvsqsat _root; - private Uvsqsat.UiFrame _parent; - public int dummy() { return dummy; } - public int spiCommandStatus() { return spiCommandStatus; } - public int supervisorEnableStatus() { return supervisorEnableStatus; } - public long supervisorUptime() { return supervisorUptime; } - public long iobcUptime() { return iobcUptime; } - public long iobcResetCount() { return iobcResetCount; } - public int iobcMeasureTemperature() { return iobcMeasureTemperature; } - public int iobcMeasure3v3In() { return iobcMeasure3v3In; } - public int iobcMeasure3v3() { return iobcMeasure3v3; } - public int iobcMeasure2vReference() { return iobcMeasure2vReference; } - public int iobcMeasure1v8() { return iobcMeasure1v8; } - public int iobcMeasure1v0() { return iobcMeasure1v0; } - public int iobcMeasureCurrent3v3() { return iobcMeasureCurrent3v3; } - public int iobcMeasureCurrent1v8() { return iobcMeasureCurrent1v8; } - public int iobcMeasureCurrent1v0() { return iobcMeasureCurrent1v0; } - public int iobcMeasureVoltRtc() { return iobcMeasureVoltRtc; } - public int iobcAdcUpdateFlag() { return iobcAdcUpdateFlag; } - public int iobcCrc8() { return iobcCrc8; } - public int photodiode1() { return photodiode1; } - public int photodiode2() { return photodiode2; } - public int photodiode3() { return photodiode3; } - public int photodiode4() { return photodiode4; } - public int photodiode5() { return photodiode5; } - public int photodiode6() { return photodiode6; } - public int panelTemperature1() { return panelTemperature1; } - public int panelTemperature2() { return panelTemperature2; } - public int panelTemperature3() { return panelTemperature3; } - public int panelTemperature4() { return panelTemperature4; } - public int panelTemperature5() { return panelTemperature5; } - public int panelTemperature6() { return panelTemperature6; } - public Uvsqsat _root() { return _root; } - public Uvsqsat.UiFrame _parent() { return _parent; } - } - public static class ImtqHk extends KaitaiStruct { - public static ImtqHk fromFile(String fileName) throws IOException { - return new ImtqHk(new ByteBufferKaitaiStream(fileName)); - } - - public ImtqHk(KaitaiStream _io) { - this(_io, null, null); - } - - public ImtqHk(KaitaiStream _io, Uvsqsat.UiFrame _parent) { - this(_io, _parent, null); - } - - public ImtqHk(KaitaiStream _io, Uvsqsat.UiFrame _parent, Uvsqsat _root) { - super(_io); - this._parent = _parent; - this._root = _root; - _read(); - } - private void _read() { - this.digitaleVoltage = this._io.readU2be(); - this.analogVoltage = this._io.readU2be(); - this.digitalCurrent = this._io.readU2be(); - this.analogCurrent = this._io.readU2be(); - this.measureCoilXCurrent = this._io.readU2be(); - this.measureCoilYCurrent = this._io.readU2be(); - this.measureCoilZCurrent = this._io.readU2be(); - this.measureCoilXTemperature = this._io.readU2be(); - this.measureCoilYTemperature = this._io.readU2be(); - this.measureCoilZTemperature = this._io.readU2be(); - this.mcuTemperature = this._io.readU2be(); - this.imtqSystemStateMode = this._io.readU1(); - this.imtqSystemStateError = this._io.readU1(); - this.imtqSystemStateConfiguration = this._io.readU1(); - this.imtqSystemStateUptime = this._io.readU4be(); - } - private Integer analogCurrentRaw; - public Integer analogCurrentRaw() { - if (this.analogCurrentRaw != null) - return this.analogCurrentRaw; - int _tmp = (int) (analogCurrent()); - this.analogCurrentRaw = _tmp; - return this.analogCurrentRaw; - } - private Double measureCoilYTemperatureC; - public Double measureCoilYTemperatureC() { - if (this.measureCoilYTemperatureC != null) - return this.measureCoilYTemperatureC; - double _tmp = (double) ((((((2.5 / 4095) * measureCoilYTemperature()) - 1.567) * -1.0) / 0.0081)); - this.measureCoilYTemperatureC = _tmp; - return this.measureCoilYTemperatureC; - } - private Integer digitalCurrentRaw; - public Integer digitalCurrentRaw() { - if (this.digitalCurrentRaw != null) - return this.digitalCurrentRaw; - int _tmp = (int) (digitalCurrent()); - this.digitalCurrentRaw = _tmp; - return this.digitalCurrentRaw; - } - private Integer imtqSystemStateModeRaw; - public Integer imtqSystemStateModeRaw() { - if (this.imtqSystemStateModeRaw != null) - return this.imtqSystemStateModeRaw; - int _tmp = (int) (imtqSystemStateMode()); - this.imtqSystemStateModeRaw = _tmp; - return this.imtqSystemStateModeRaw; - } - private Double measureCoilZCurrentMa; - public Double measureCoilZCurrentMa() { - if (this.measureCoilZCurrentMa != null) - return this.measureCoilZCurrentMa; - double _tmp = (double) (((1000.0 * (((2.5 / 4095) * measureCoilZCurrent()) - 1.03)) / 0.48)); - this.measureCoilZCurrentMa = _tmp; - return this.measureCoilZCurrentMa; - } - private Double measureCoilZTemperatureC; - public Double measureCoilZTemperatureC() { - if (this.measureCoilZTemperatureC != null) - return this.measureCoilZTemperatureC; - double _tmp = (double) ((((((2.5 / 4095) * measureCoilZTemperature()) - 1.567) * -1.0) / 0.0081)); - this.measureCoilZTemperatureC = _tmp; - return this.measureCoilZTemperatureC; - } - private Double measureCoilXCurrentMa; - public Double measureCoilXCurrentMa() { - if (this.measureCoilXCurrentMa != null) - return this.measureCoilXCurrentMa; - double _tmp = (double) (((1000.0 * (((2.5 / 4095) * measureCoilXCurrent()) - 1.03)) / 2.0)); - this.measureCoilXCurrentMa = _tmp; - return this.measureCoilXCurrentMa; - } - private Double measureCoilYCurrentMa; - public Double measureCoilYCurrentMa() { - if (this.measureCoilYCurrentMa != null) - return this.measureCoilYCurrentMa; - double _tmp = (double) (((1000.0 * (((2.5 / 4095) * measureCoilYCurrent()) - 1.03)) / 2.0)); - this.measureCoilYCurrentMa = _tmp; - return this.measureCoilYCurrentMa; - } - private Double digitaleVoltageV; - public Double digitaleVoltageV() { - if (this.digitaleVoltageV != null) - return this.digitaleVoltageV; - double _tmp = (double) (((2 * (2.5 / 4095)) * digitaleVoltage())); - this.digitaleVoltageV = _tmp; - return this.digitaleVoltageV; - } - private Double analogVoltageV; - public Double analogVoltageV() { - if (this.analogVoltageV != null) - return this.analogVoltageV; - double _tmp = (double) (((2 * (2.5 / 4095)) * analogVoltage())); - this.analogVoltageV = _tmp; - return this.analogVoltageV; - } - private Long imtqSystemStateUptimeRaw; - public Long imtqSystemStateUptimeRaw() { - if (this.imtqSystemStateUptimeRaw != null) - return this.imtqSystemStateUptimeRaw; - long _tmp = (long) (imtqSystemStateUptime()); - this.imtqSystemStateUptimeRaw = _tmp; - return this.imtqSystemStateUptimeRaw; - } - private Double mcuTemperatureC; - public Double mcuTemperatureC() { - if (this.mcuTemperatureC != null) - return this.mcuTemperatureC; - double _tmp = (double) ((((((2.5 / 4095) * mcuTemperature()) - 0.680) * -1.0) / 0.00225)); - this.mcuTemperatureC = _tmp; - return this.mcuTemperatureC; - } - private Integer imtqSystemStateConfigurationRaw; - public Integer imtqSystemStateConfigurationRaw() { - if (this.imtqSystemStateConfigurationRaw != null) - return this.imtqSystemStateConfigurationRaw; - int _tmp = (int) (imtqSystemStateConfiguration()); - this.imtqSystemStateConfigurationRaw = _tmp; - return this.imtqSystemStateConfigurationRaw; - } - private Double measureCoilXTemperatureC; - public Double measureCoilXTemperatureC() { - if (this.measureCoilXTemperatureC != null) - return this.measureCoilXTemperatureC; - double _tmp = (double) ((((((2.5 / 4095) * measureCoilXTemperature()) - 1.567) * -1.0) / 0.0081)); - this.measureCoilXTemperatureC = _tmp; - return this.measureCoilXTemperatureC; - } - private Integer imtqSystemStateErrorRaw; - public Integer imtqSystemStateErrorRaw() { - if (this.imtqSystemStateErrorRaw != null) - return this.imtqSystemStateErrorRaw; - int _tmp = (int) (imtqSystemStateError()); - this.imtqSystemStateErrorRaw = _tmp; - return this.imtqSystemStateErrorRaw; - } - private int digitaleVoltage; - private int analogVoltage; - private int digitalCurrent; - private int analogCurrent; - private int measureCoilXCurrent; - private int measureCoilYCurrent; - private int measureCoilZCurrent; - private int measureCoilXTemperature; - private int measureCoilYTemperature; - private int measureCoilZTemperature; - private int mcuTemperature; - private int imtqSystemStateMode; - private int imtqSystemStateError; - private int imtqSystemStateConfiguration; - private long imtqSystemStateUptime; - private Uvsqsat _root; - private Uvsqsat.UiFrame _parent; - public int digitaleVoltage() { return digitaleVoltage; } - public int analogVoltage() { return analogVoltage; } - public int digitalCurrent() { return digitalCurrent; } - public int analogCurrent() { return analogCurrent; } - public int measureCoilXCurrent() { return measureCoilXCurrent; } - public int measureCoilYCurrent() { return measureCoilYCurrent; } - public int measureCoilZCurrent() { return measureCoilZCurrent; } - public int measureCoilXTemperature() { return measureCoilXTemperature; } - public int measureCoilYTemperature() { return measureCoilYTemperature; } - public int measureCoilZTemperature() { return measureCoilZTemperature; } - public int mcuTemperature() { return mcuTemperature; } - public int imtqSystemStateMode() { return imtqSystemStateMode; } - public int imtqSystemStateError() { return imtqSystemStateError; } - public int imtqSystemStateConfiguration() { return imtqSystemStateConfiguration; } - public long imtqSystemStateUptime() { return imtqSystemStateUptime; } - public Uvsqsat _root() { return _root; } - public Uvsqsat.UiFrame _parent() { return _parent; } - } - public static class PacketSecondaryHeader extends KaitaiStruct { - public static PacketSecondaryHeader fromFile(String fileName) throws IOException { - return new PacketSecondaryHeader(new ByteBufferKaitaiStream(fileName)); - } - - public PacketSecondaryHeader(KaitaiStream _io) { - this(_io, null, null); - } - - public PacketSecondaryHeader(KaitaiStream _io, Uvsqsat.UiFrame _parent) { - this(_io, _parent, null); - } - - public PacketSecondaryHeader(KaitaiStream _io, Uvsqsat.UiFrame _parent, Uvsqsat _root) { - super(_io); - this._parent = _parent; - this._root = _root; - _read(); - } - private void _read() { - this.tmPacketPusVersionNumber = this._io.readBitsInt(4); - this.spacecraftTimeReferenceStatus = this._io.readBitsInt(4); - this._io.alignToByte(); - this.serviceTypeId = this._io.readU1(); - this.messageSubtypeId = this._io.readU1(); - this.messageTypeCounter = this._io.readU2be(); - this.destinationId = this._io.readU2be(); - this.time = this._io.readU4be(); - this.dummy1 = this._io.readU2be(); - this.dummy2 = this._io.readU1(); - this.sid = this._io.readU1(); - } - private long tmPacketPusVersionNumber; - private long spacecraftTimeReferenceStatus; - private int serviceTypeId; - private int messageSubtypeId; - private int messageTypeCounter; - private int destinationId; - private long time; - private int dummy1; - private int dummy2; - private int sid; - private Uvsqsat _root; - private Uvsqsat.UiFrame _parent; - public long tmPacketPusVersionNumber() { return tmPacketPusVersionNumber; } - public long spacecraftTimeReferenceStatus() { return spacecraftTimeReferenceStatus; } - public int serviceTypeId() { return serviceTypeId; } - public int messageSubtypeId() { return messageSubtypeId; } - public int messageTypeCounter() { return messageTypeCounter; } - public int destinationId() { return destinationId; } - public long time() { return time; } - public int dummy1() { return dummy1; } - public int dummy2() { return dummy2; } - public int sid() { return sid; } - public Uvsqsat _root() { return _root; } - public Uvsqsat.UiFrame _parent() { return _parent; } - } - public static class MsgOrUnknow extends KaitaiStruct { - public static MsgOrUnknow fromFile(String fileName) throws IOException { - return new MsgOrUnknow(new ByteBufferKaitaiStream(fileName)); - } - - public MsgOrUnknow(KaitaiStream _io) { - this(_io, null, null); - } - - public MsgOrUnknow(KaitaiStream _io, Uvsqsat.UiFrame _parent) { - this(_io, _parent, null); - } - - public MsgOrUnknow(KaitaiStream _io, Uvsqsat.UiFrame _parent, Uvsqsat _root) { - super(_io); - this._parent = _parent; - this._root = _root; - _read(); - } - private void _read() { - this.data = this._io.readBytesFull(); - } - private byte[] dataByte; - public byte[] dataByte() { - if (this.dataByte != null) - return this.dataByte; - this.dataByte = data(); - return this.dataByte; - } - private byte[] data; - private Uvsqsat _root; - private Uvsqsat.UiFrame _parent; - public byte[] data() { return data; } - public Uvsqsat _root() { return _root; } - public Uvsqsat.UiFrame _parent() { return _parent; } - } - public static class CallsignRaw extends KaitaiStruct { - public static CallsignRaw fromFile(String fileName) throws IOException { - return new CallsignRaw(new ByteBufferKaitaiStream(fileName)); - } - - public CallsignRaw(KaitaiStream _io) { - this(_io, null, null); - } - - public CallsignRaw(KaitaiStream _io, Uvsqsat.Ax25Header _parent) { - this(_io, _parent, null); - } - - public CallsignRaw(KaitaiStream _io, Uvsqsat.Ax25Header _parent, Uvsqsat _root) { - super(_io); - this._parent = _parent; - this._root = _root; - _read(); - } - private void _read() { - this._raw__raw_callsignRor = this._io.readBytes(6); - this._raw_callsignRor = KaitaiStream.processRotateLeft(this._raw__raw_callsignRor, 8 - (1), 1); - KaitaiStream _io__raw_callsignRor = new ByteBufferKaitaiStream(_raw_callsignRor); - this.callsignRor = new Callsign(_io__raw_callsignRor, this, _root); - } - private Callsign callsignRor; - private Uvsqsat _root; - private Uvsqsat.Ax25Header _parent; - private byte[] _raw__raw_callsignRor; - private byte[] _raw_callsignRor; - public Callsign callsignRor() { return callsignRor; } - public Uvsqsat _root() { return _root; } - public Uvsqsat.Ax25Header _parent() { return _parent; } - public byte[] _raw__raw_callsignRor() { return _raw__raw_callsignRor; } - public byte[] _raw_callsignRor() { return _raw_callsignRor; } - } - public static class IepsHkStatus extends KaitaiStruct { - public static IepsHkStatus fromFile(String fileName) throws IOException { - return new IepsHkStatus(new ByteBufferKaitaiStream(fileName)); - } - - public IepsHkStatus(KaitaiStream _io) { - this(_io, null, null); - } - - public IepsHkStatus(KaitaiStream _io, Uvsqsat.UiFrame _parent) { - this(_io, _parent, null); - } - - public IepsHkStatus(KaitaiStream _io, Uvsqsat.UiFrame _parent, Uvsqsat _root) { - super(_io); - this._parent = _parent; - this._root = _root; - _read(); - } - private void _read() { - this.hKStid = this._io.readU1(); - this.hKIvid = this._io.readU1(); - this.hKRc = this._io.readU1(); - this.hKBid = this._io.readU1(); - this.hKCmderr = this._io.readBitsInt(4); - this.hKStat = this._io.readBitsInt(4); - this._io.alignToByte(); - this.voltBrdSupRaw = this._io.readU2be(); - this.tempRaw = this._io.readU2be(); - this.vDistInputRaw = this._io.readU2be(); - this.iDistInputRaw = this._io.readU2be(); - this.pDistInputRaw = this._io.readU2be(); - this.vBattInputRaw = this._io.readU2be(); - this.iBattInputRaw = this._io.readU2be(); - this.pBattInputRaw = this._io.readU2be(); - this.statObcOn = this._io.readU2be(); - this.statObcOcf = this._io.readU2be(); - this.batStat = this._io.readU2be(); - this.batTemp2Raw = this._io.readU2be(); - this.voltVd0 = this._io.readU2be(); - this.voltVd1 = this._io.readU2be(); - this.voltVd2 = this._io.readU2be(); - this.vObc00 = this._io.readU2be(); - this.iObc00 = this._io.readU2be(); - this.pObc00 = this._io.readU2be(); - this.vObc01 = this._io.readU2be(); - this.iObc01 = this._io.readU2be(); - this.pObc01 = this._io.readU2be(); - this.vObc02 = this._io.readU2be(); - this.iObc02 = this._io.readU2be(); - this.pObc02 = this._io.readU2be(); - this.vObc03 = this._io.readU2be(); - this.iObc03 = this._io.readU2be(); - this.pObc03 = this._io.readU2be(); - this.vObc05 = this._io.readU2be(); - this.iObc05 = this._io.readU2be(); - this.pObc05 = this._io.readU2be(); - this.vObc06 = this._io.readU2be(); - this.iObc06 = this._io.readU2be(); - this.pObc06 = this._io.readU2be(); - this.cc1 = this._io.readBytes(8); - this.cc2 = this._io.readBytes(8); - this.cc3 = this._io.readBytes(8); - this.statusStid = this._io.readU1(); - this.statusIvid = this._io.readU1(); - this.statusRc = this._io.readU1(); - this.statusBid = this._io.readU1(); - this.statusCmderr = this._io.readBitsInt(4); - this.statusStat = this._io.readBitsInt(4); - this._io.alignToByte(); - this.mode = this._io.readU1(); - this.conf = this._io.readU1(); - this.resetCause = this._io.readU1(); - this.uptime = this._io.readU4be(); - this.error = this._io.readU2be(); - this.rcCntPwron = this._io.readU2be(); - this.rcCntWdg = this._io.readU2be(); - this.rcCntCmd = this._io.readU2be(); - this.rcCntMcu = this._io.readU2be(); - this.rcCntEmlopo = this._io.readU2be(); - this.prevcmdElapsed = this._io.readU2be(); - } - private Integer rcCntPwronRaw; - public Integer rcCntPwronRaw() { - if (this.rcCntPwronRaw != null) - return this.rcCntPwronRaw; - int _tmp = (int) (rcCntPwron()); - this.rcCntPwronRaw = _tmp; - return this.rcCntPwronRaw; - } - private Double vDistInputRawV; - public Double vDistInputRawV() { - if (this.vDistInputRawV != null) - return this.vDistInputRawV; - double _tmp = (double) ((((vDistInputRaw() * 125.0) / 128.0) / 1000.0)); - this.vDistInputRawV = _tmp; - return this.vDistInputRawV; - } - private Double iObc05Ma; - public Double iObc05Ma() { - if (this.iObc05Ma != null) - return this.iObc05Ma; - double _tmp = (double) (((iObc05() * 3125.0) / 20480.0)); - this.iObc05Ma = _tmp; - return this.iObc05Ma; - } - private Double pObc05Mw; - public Double pObc05Mw() { - if (this.pObc05Mw != null) - return this.pObc05Mw; - double _tmp = (double) (((pObc05() * 3125.0) / 6400.0)); - this.pObc05Mw = _tmp; - return this.pObc05Mw; - } - private Integer statObcOnRaw; - public Integer statObcOnRaw() { - if (this.statObcOnRaw != null) - return this.statObcOnRaw; - int _tmp = (int) (statObcOn()); - this.statObcOnRaw = _tmp; - return this.statObcOnRaw; - } - private Long statusStatRaw; - public Long statusStatRaw() { - if (this.statusStatRaw != null) - return this.statusStatRaw; - long _tmp = (long) (statusStat()); - this.statusStatRaw = _tmp; - return this.statusStatRaw; - } - private Integer hKRcRaw; - public Integer hKRcRaw() { - if (this.hKRcRaw != null) - return this.hKRcRaw; - int _tmp = (int) (hKRc()); - this.hKRcRaw = _tmp; - return this.hKRcRaw; - } - private Double pObc00Mw; - public Double pObc00Mw() { - if (this.pObc00Mw != null) - return this.pObc00Mw; - double _tmp = (double) (((pObc00() * 3125.0) / 6400.0)); - this.pObc00Mw = _tmp; - return this.pObc00Mw; - } - private Double vObc02V; - public Double vObc02V() { - if (this.vObc02V != null) - return this.vObc02V; - double _tmp = (double) ((((vObc02() * 125.0) / 128.0) / 1000.0)); - this.vObc02V = _tmp; - return this.vObc02V; - } - private Double pObc06Mw; - public Double pObc06Mw() { - if (this.pObc06Mw != null) - return this.pObc06Mw; - double _tmp = (double) (((pObc06() * 3125.0) / 6400.0)); - this.pObc06Mw = _tmp; - return this.pObc06Mw; - } - private Integer modeRaw; - public Integer modeRaw() { - if (this.modeRaw != null) - return this.modeRaw; - int _tmp = (int) (mode()); - this.modeRaw = _tmp; - return this.modeRaw; - } - private Long statusCmderrRaw; - public Long statusCmderrRaw() { - if (this.statusCmderrRaw != null) - return this.statusCmderrRaw; - long _tmp = (long) (statusCmderr()); - this.statusCmderrRaw = _tmp; - return this.statusCmderrRaw; - } - private Double pObc01Mw; - public Double pObc01Mw() { - if (this.pObc01Mw != null) - return this.pObc01Mw; - double _tmp = (double) (((pObc01() * 3125.0) / 6400.0)); - this.pObc01Mw = _tmp; - return this.pObc01Mw; - } - private Integer rcCntCmdRaw; - public Integer rcCntCmdRaw() { - if (this.rcCntCmdRaw != null) - return this.rcCntCmdRaw; - int _tmp = (int) (rcCntCmd()); - this.rcCntCmdRaw = _tmp; - return this.rcCntCmdRaw; - } - private Integer statObcOcfRaw; - public Integer statObcOcfRaw() { - if (this.statObcOcfRaw != null) - return this.statObcOcfRaw; - int _tmp = (int) (statObcOcf()); - this.statObcOcfRaw = _tmp; - return this.statObcOcfRaw; - } - private Integer voltVd2Raw; - public Integer voltVd2Raw() { - if (this.voltVd2Raw != null) - return this.voltVd2Raw; - int _tmp = (int) (voltVd2()); - this.voltVd2Raw = _tmp; - return this.voltVd2Raw; - } - private Long uptimeRaw; - public Long uptimeRaw() { - if (this.uptimeRaw != null) - return this.uptimeRaw; - long _tmp = (long) (uptime()); - this.uptimeRaw = _tmp; - return this.uptimeRaw; - } - private Double voltBrdSupRawV; - public Double voltBrdSupRawV() { - if (this.voltBrdSupRawV != null) - return this.voltBrdSupRawV; - double _tmp = (double) (((voltBrdSupRaw() * 1000.0) / 819.0)); - this.voltBrdSupRawV = _tmp; - return this.voltBrdSupRawV; - } - private Double iObc00Ma; - public Double iObc00Ma() { - if (this.iObc00Ma != null) - return this.iObc00Ma; - double _tmp = (double) (((iObc00() * 3125.0) / 20480.0)); - this.iObc00Ma = _tmp; - return this.iObc00Ma; - } - private Integer rcCntWdgRaw; - public Integer rcCntWdgRaw() { - if (this.rcCntWdgRaw != null) - return this.rcCntWdgRaw; - int _tmp = (int) (rcCntWdg()); - this.rcCntWdgRaw = _tmp; - return this.rcCntWdgRaw; - } - private Double pDistInputRawMw; - public Double pDistInputRawMw() { - if (this.pDistInputRawMw != null) - return this.pDistInputRawMw; - double _tmp = (double) (((pDistInputRaw() * 3125.0) / 3200.0)); - this.pDistInputRawMw = _tmp; - return this.pDistInputRawMw; - } - private Integer batStatRaw; - public Integer batStatRaw() { - if (this.batStatRaw != null) - return this.batStatRaw; - int _tmp = (int) (batStat()); - this.batStatRaw = _tmp; - return this.batStatRaw; - } - private Double vObc06V; - public Double vObc06V() { - if (this.vObc06V != null) - return this.vObc06V; - double _tmp = (double) ((((vObc06() * 125.0) / 128.0) / 1000.0)); - this.vObc06V = _tmp; - return this.vObc06V; - } - private Double iObc03Ma; - public Double iObc03Ma() { - if (this.iObc03Ma != null) - return this.iObc03Ma; - double _tmp = (double) (((iObc03() * 3125.0) / 20480.0)); - this.iObc03Ma = _tmp; - return this.iObc03Ma; - } - private Double vObc03V; - public Double vObc03V() { - if (this.vObc03V != null) - return this.vObc03V; - double _tmp = (double) ((((vObc03() * 125.0) / 128.0) / 1000.0)); - this.vObc03V = _tmp; - return this.vObc03V; - } - private Integer hKBidRaw; - public Integer hKBidRaw() { - if (this.hKBidRaw != null) - return this.hKBidRaw; - int _tmp = (int) (hKBid()); - this.hKBidRaw = _tmp; - return this.hKBidRaw; - } - private Double iBattInputRawMa; - public Double iBattInputRawMa() { - if (this.iBattInputRawMa != null) - return this.iBattInputRawMa; - double _tmp = (double) ((1000.0 * ((iBattInputRaw() * 3125.0) / 10240.0))); - this.iBattInputRawMa = _tmp; - return this.iBattInputRawMa; - } - private Integer hKIvidRaw; - public Integer hKIvidRaw() { - if (this.hKIvidRaw != null) - return this.hKIvidRaw; - int _tmp = (int) (hKIvid()); - this.hKIvidRaw = _tmp; - return this.hKIvidRaw; - } - private Double iObc02Ma; - public Double iObc02Ma() { - if (this.iObc02Ma != null) - return this.iObc02Ma; - double _tmp = (double) (((iObc02() * 3125.0) / 20480.0)); - this.iObc02Ma = _tmp; - return this.iObc02Ma; - } - private Integer statusStidRaw; - public Integer statusStidRaw() { - if (this.statusStidRaw != null) - return this.statusStidRaw; - int _tmp = (int) (statusStid()); - this.statusStidRaw = _tmp; - return this.statusStidRaw; - } - private Double iObc06Ma; - public Double iObc06Ma() { - if (this.iObc06Ma != null) - return this.iObc06Ma; - double _tmp = (double) (((iObc06() * 3125.0) / 20480.0)); - this.iObc06Ma = _tmp; - return this.iObc06Ma; - } - private Integer statusRcRaw; - public Integer statusRcRaw() { - if (this.statusRcRaw != null) - return this.statusRcRaw; - int _tmp = (int) (statusRc()); - this.statusRcRaw = _tmp; - return this.statusRcRaw; - } - private byte[] cc2Byte; - public byte[] cc2Byte() { - if (this.cc2Byte != null) - return this.cc2Byte; - this.cc2Byte = cc2(); - return this.cc2Byte; - } - private Integer errorRaw; - public Integer errorRaw() { - if (this.errorRaw != null) - return this.errorRaw; - int _tmp = (int) (error()); - this.errorRaw = _tmp; - return this.errorRaw; - } - private Double iDistInputRawMa; - public Double iDistInputRawMa() { - if (this.iDistInputRawMa != null) - return this.iDistInputRawMa; - double _tmp = (double) (((iDistInputRaw() * 3125.0) / 10240.0)); - this.iDistInputRawMa = _tmp; - return this.iDistInputRawMa; - } - private Double vObc01V; - public Double vObc01V() { - if (this.vObc01V != null) - return this.vObc01V; - double _tmp = (double) ((((vObc01() * 125.0) / 128.0) / 1000.0)); - this.vObc01V = _tmp; - return this.vObc01V; - } - private Double pBattInputRawMw; - public Double pBattInputRawMw() { - if (this.pBattInputRawMw != null) - return this.pBattInputRawMw; - double _tmp = (double) (((pBattInputRaw() * 3125.0) / 3200.0)); - this.pBattInputRawMw = _tmp; - return this.pBattInputRawMw; - } - private Double iObc01Ma; - public Double iObc01Ma() { - if (this.iObc01Ma != null) - return this.iObc01Ma; - double _tmp = (double) (((iObc01() * 3125.0) / 20480.0)); - this.iObc01Ma = _tmp; - return this.iObc01Ma; - } - private Double tempRawT; - public Double tempRawT() { - if (this.tempRawT != null) - return this.tempRawT; - double _tmp = (double) (((((tempRaw() - 1168) * 220.0) / 9.0) / 100.0)); - this.tempRawT = _tmp; - return this.tempRawT; - } - private byte[] cc1Byte; - public byte[] cc1Byte() { - if (this.cc1Byte != null) - return this.cc1Byte; - this.cc1Byte = cc1(); - return this.cc1Byte; - } - private Integer rcCntEmlopoRaw; - public Integer rcCntEmlopoRaw() { - if (this.rcCntEmlopoRaw != null) - return this.rcCntEmlopoRaw; - int _tmp = (int) (rcCntEmlopo()); - this.rcCntEmlopoRaw = _tmp; - return this.rcCntEmlopoRaw; - } - private Integer rcCntMcuRaw; - public Integer rcCntMcuRaw() { - if (this.rcCntMcuRaw != null) - return this.rcCntMcuRaw; - int _tmp = (int) (rcCntMcu()); - this.rcCntMcuRaw = _tmp; - return this.rcCntMcuRaw; - } - private Integer statusBidRaw; - public Integer statusBidRaw() { - if (this.statusBidRaw != null) - return this.statusBidRaw; - int _tmp = (int) (statusBid()); - this.statusBidRaw = _tmp; - return this.statusBidRaw; - } - private Integer statusIvidRaw; - public Integer statusIvidRaw() { - if (this.statusIvidRaw != null) - return this.statusIvidRaw; - int _tmp = (int) (statusIvid()); - this.statusIvidRaw = _tmp; - return this.statusIvidRaw; - } - private Double pObc03Mw; - public Double pObc03Mw() { - if (this.pObc03Mw != null) - return this.pObc03Mw; - double _tmp = (double) (((pObc03() * 3125.0) / 6400.0)); - this.pObc03Mw = _tmp; - return this.pObc03Mw; - } - private Integer voltVd1Raw; - public Integer voltVd1Raw() { - if (this.voltVd1Raw != null) - return this.voltVd1Raw; - int _tmp = (int) (voltVd1()); - this.voltVd1Raw = _tmp; - return this.voltVd1Raw; - } - private byte[] cc3Byte; - public byte[] cc3Byte() { - if (this.cc3Byte != null) - return this.cc3Byte; - this.cc3Byte = cc3(); - return this.cc3Byte; - } - private Double vObc05V; - public Double vObc05V() { - if (this.vObc05V != null) - return this.vObc05V; - double _tmp = (double) ((((vObc05() * 125.0) / 128.0) / 1000.0)); - this.vObc05V = _tmp; - return this.vObc05V; - } - private Double vObc00V; - public Double vObc00V() { - if (this.vObc00V != null) - return this.vObc00V; - double _tmp = (double) ((((vObc00() * 125.0) / 128.0) / 1000.0)); - this.vObc00V = _tmp; - return this.vObc00V; - } - private Integer voltVd0Raw; - public Integer voltVd0Raw() { - if (this.voltVd0Raw != null) - return this.voltVd0Raw; - int _tmp = (int) (voltVd0()); - this.voltVd0Raw = _tmp; - return this.voltVd0Raw; - } - private Long hKCmderrRaw; - public Long hKCmderrRaw() { - if (this.hKCmderrRaw != null) - return this.hKCmderrRaw; - long _tmp = (long) (hKCmderr()); - this.hKCmderrRaw = _tmp; - return this.hKCmderrRaw; - } - private Double batTemp2RawT; - public Double batTemp2RawT() { - if (this.batTemp2RawT != null) - return this.batTemp2RawT; - double _tmp = (double) (((batTemp2Raw() * -0.047715407918) + 98.38261483)); - this.batTemp2RawT = _tmp; - return this.batTemp2RawT; - } - private Double vBattInputRawV; - public Double vBattInputRawV() { - if (this.vBattInputRawV != null) - return this.vBattInputRawV; - double _tmp = (double) ((((vBattInputRaw() * 125.0) / 128.0) / 1000.0)); - this.vBattInputRawV = _tmp; - return this.vBattInputRawV; - } - private Integer resetCauseRaw; - public Integer resetCauseRaw() { - if (this.resetCauseRaw != null) - return this.resetCauseRaw; - int _tmp = (int) (resetCause()); - this.resetCauseRaw = _tmp; - return this.resetCauseRaw; - } - private Integer hKStidRaw; - public Integer hKStidRaw() { - if (this.hKStidRaw != null) - return this.hKStidRaw; - int _tmp = (int) (hKStid()); - this.hKStidRaw = _tmp; - return this.hKStidRaw; - } - private Double pObc02Mw; - public Double pObc02Mw() { - if (this.pObc02Mw != null) - return this.pObc02Mw; - double _tmp = (double) (((pObc02() * 3125.0) / 6400.0)); - this.pObc02Mw = _tmp; - return this.pObc02Mw; - } - private Long hKStatRaw; - public Long hKStatRaw() { - if (this.hKStatRaw != null) - return this.hKStatRaw; - long _tmp = (long) (hKStat()); - this.hKStatRaw = _tmp; - return this.hKStatRaw; - } - private Integer confRaw; - public Integer confRaw() { - if (this.confRaw != null) - return this.confRaw; - int _tmp = (int) (conf()); - this.confRaw = _tmp; - return this.confRaw; - } - private Integer prevcmdElapsedRaw; - public Integer prevcmdElapsedRaw() { - if (this.prevcmdElapsedRaw != null) - return this.prevcmdElapsedRaw; - int _tmp = (int) (prevcmdElapsed()); - this.prevcmdElapsedRaw = _tmp; - return this.prevcmdElapsedRaw; - } - private int hKStid; - private int hKIvid; - private int hKRc; - private int hKBid; - private long hKCmderr; - private long hKStat; - private int voltBrdSupRaw; - private int tempRaw; - private int vDistInputRaw; - private int iDistInputRaw; - private int pDistInputRaw; - private int vBattInputRaw; - private int iBattInputRaw; - private int pBattInputRaw; - private int statObcOn; - private int statObcOcf; - private int batStat; - private int batTemp2Raw; - private int voltVd0; - private int voltVd1; - private int voltVd2; - private int vObc00; - private int iObc00; - private int pObc00; - private int vObc01; - private int iObc01; - private int pObc01; - private int vObc02; - private int iObc02; - private int pObc02; - private int vObc03; - private int iObc03; - private int pObc03; - private int vObc05; - private int iObc05; - private int pObc05; - private int vObc06; - private int iObc06; - private int pObc06; - private byte[] cc1; - private byte[] cc2; - private byte[] cc3; - private int statusStid; - private int statusIvid; - private int statusRc; - private int statusBid; - private long statusCmderr; - private long statusStat; - private int mode; - private int conf; - private int resetCause; - private long uptime; - private int error; - private int rcCntPwron; - private int rcCntWdg; - private int rcCntCmd; - private int rcCntMcu; - private int rcCntEmlopo; - private int prevcmdElapsed; - private Uvsqsat _root; - private Uvsqsat.UiFrame _parent; - public int hKStid() { return hKStid; } - public int hKIvid() { return hKIvid; } - public int hKRc() { return hKRc; } - public int hKBid() { return hKBid; } - public long hKCmderr() { return hKCmderr; } - public long hKStat() { return hKStat; } - public int voltBrdSupRaw() { return voltBrdSupRaw; } - public int tempRaw() { return tempRaw; } - public int vDistInputRaw() { return vDistInputRaw; } - public int iDistInputRaw() { return iDistInputRaw; } - public int pDistInputRaw() { return pDistInputRaw; } - public int vBattInputRaw() { return vBattInputRaw; } - public int iBattInputRaw() { return iBattInputRaw; } - public int pBattInputRaw() { return pBattInputRaw; } - public int statObcOn() { return statObcOn; } - public int statObcOcf() { return statObcOcf; } - public int batStat() { return batStat; } - public int batTemp2Raw() { return batTemp2Raw; } - public int voltVd0() { return voltVd0; } - public int voltVd1() { return voltVd1; } - public int voltVd2() { return voltVd2; } - public int vObc00() { return vObc00; } - public int iObc00() { return iObc00; } - public int pObc00() { return pObc00; } - public int vObc01() { return vObc01; } - public int iObc01() { return iObc01; } - public int pObc01() { return pObc01; } - public int vObc02() { return vObc02; } - public int iObc02() { return iObc02; } - public int pObc02() { return pObc02; } - public int vObc03() { return vObc03; } - public int iObc03() { return iObc03; } - public int pObc03() { return pObc03; } - public int vObc05() { return vObc05; } - public int iObc05() { return iObc05; } - public int pObc05() { return pObc05; } - public int vObc06() { return vObc06; } - public int iObc06() { return iObc06; } - public int pObc06() { return pObc06; } - public byte[] cc1() { return cc1; } - public byte[] cc2() { return cc2; } - public byte[] cc3() { return cc3; } - public int statusStid() { return statusStid; } - public int statusIvid() { return statusIvid; } - public int statusRc() { return statusRc; } - public int statusBid() { return statusBid; } - public long statusCmderr() { return statusCmderr; } - public long statusStat() { return statusStat; } - public int mode() { return mode; } - public int conf() { return conf; } - public int resetCause() { return resetCause; } - public long uptime() { return uptime; } - public int error() { return error; } - public int rcCntPwron() { return rcCntPwron; } - public int rcCntWdg() { return rcCntWdg; } - public int rcCntCmd() { return rcCntCmd; } - public int rcCntMcu() { return rcCntMcu; } - public int rcCntEmlopo() { return rcCntEmlopo; } - public int prevcmdElapsed() { return prevcmdElapsed; } - public Uvsqsat _root() { return _root; } - public Uvsqsat.UiFrame _parent() { return _parent; } - } - public static class AntsHk extends KaitaiStruct { - public static AntsHk fromFile(String fileName) throws IOException { - return new AntsHk(new ByteBufferKaitaiStream(fileName)); - } - - public AntsHk(KaitaiStream _io) { - this(_io, null, null); - } - - public AntsHk(KaitaiStream _io, Uvsqsat.UiFrame _parent) { - this(_io, _parent, null); - } - - public AntsHk(KaitaiStream _io, Uvsqsat.UiFrame _parent, Uvsqsat _root) { - super(_io); - this._parent = _parent; - this._root = _root; - _read(); - } - private void _read() { - this.sideAAntsTemperature = this._io.readU2be(); - this.sideAAntsDeploymentStatus = this._io.readU2be(); - this.sideAAntsUptime = this._io.readU4be(); - this.sideADeploymentCountAntenna1 = this._io.readU1(); - this.sideADeploymentCountAntenna2 = this._io.readU1(); - this.sideADeploymentCountAntenna3 = this._io.readU1(); - this.sideADeploymentCountAntenna4 = this._io.readU1(); - this.sideADeploymentTimeAntenna1 = this._io.readU2be(); - this.sideADeploymentTimeAntenna2 = this._io.readU2be(); - this.sideADeploymentTimeAntenna3 = this._io.readU2be(); - this.sideADeploymentTimeAntenna4 = this._io.readU2be(); - this.sideBAntsTemperature = this._io.readU2be(); - this.sideBAntsDeploymentStatus = this._io.readU2be(); - this.sideBAntsUptime = this._io.readU2be(); - this.sideBDeploymentCountAntenna1 = this._io.readU1(); - this.sideBDeploymentCountAntenna2 = this._io.readU1(); - this.sideBDeploymentCountAntenna3 = this._io.readU1(); - this.sideBDeploymentCountAntenna4 = this._io.readU1(); - this.sideBDeploymentTimeAntenna1 = this._io.readU2be(); - this.sideBDeploymentTimeAntenna2 = this._io.readU2be(); - this.sideBDeploymentTimeAntenna3 = this._io.readU2be(); - this.sideBDeploymentTimeAntenna4 = this._io.readU2be(); - } - private Integer sideBDeploymentCountAntenna3Raw; - public Integer sideBDeploymentCountAntenna3Raw() { - if (this.sideBDeploymentCountAntenna3Raw != null) - return this.sideBDeploymentCountAntenna3Raw; - int _tmp = (int) (sideBDeploymentCountAntenna3()); - this.sideBDeploymentCountAntenna3Raw = _tmp; - return this.sideBDeploymentCountAntenna3Raw; - } - private Integer sideBDeploymentTimeAntenna1Raw; - public Integer sideBDeploymentTimeAntenna1Raw() { - if (this.sideBDeploymentTimeAntenna1Raw != null) - return this.sideBDeploymentTimeAntenna1Raw; - int _tmp = (int) (sideBDeploymentTimeAntenna1()); - this.sideBDeploymentTimeAntenna1Raw = _tmp; - return this.sideBDeploymentTimeAntenna1Raw; - } - private Integer sideADeploymentTimeAntenna3Raw; - public Integer sideADeploymentTimeAntenna3Raw() { - if (this.sideADeploymentTimeAntenna3Raw != null) - return this.sideADeploymentTimeAntenna3Raw; - int _tmp = (int) (sideADeploymentTimeAntenna3()); - this.sideADeploymentTimeAntenna3Raw = _tmp; - return this.sideADeploymentTimeAntenna3Raw; - } - private Integer sideBDeploymentCountAntenna4Raw; - public Integer sideBDeploymentCountAntenna4Raw() { - if (this.sideBDeploymentCountAntenna4Raw != null) - return this.sideBDeploymentCountAntenna4Raw; - int _tmp = (int) (sideBDeploymentCountAntenna4()); - this.sideBDeploymentCountAntenna4Raw = _tmp; - return this.sideBDeploymentCountAntenna4Raw; - } - private Integer sideBDeploymentTimeAntenna2Raw; - public Integer sideBDeploymentTimeAntenna2Raw() { - if (this.sideBDeploymentTimeAntenna2Raw != null) - return this.sideBDeploymentTimeAntenna2Raw; - int _tmp = (int) (sideBDeploymentTimeAntenna2()); - this.sideBDeploymentTimeAntenna2Raw = _tmp; - return this.sideBDeploymentTimeAntenna2Raw; - } - private Integer sideADeploymentCountAntenna3Raw; - public Integer sideADeploymentCountAntenna3Raw() { - if (this.sideADeploymentCountAntenna3Raw != null) - return this.sideADeploymentCountAntenna3Raw; - int _tmp = (int) (sideADeploymentCountAntenna3()); - this.sideADeploymentCountAntenna3Raw = _tmp; - return this.sideADeploymentCountAntenna3Raw; - } - private Integer sideBDeploymentCountAntenna1Raw; - public Integer sideBDeploymentCountAntenna1Raw() { - if (this.sideBDeploymentCountAntenna1Raw != null) - return this.sideBDeploymentCountAntenna1Raw; - int _tmp = (int) (sideBDeploymentCountAntenna1()); - this.sideBDeploymentCountAntenna1Raw = _tmp; - return this.sideBDeploymentCountAntenna1Raw; - } - private Integer sideADeploymentCountAntenna4Raw; - public Integer sideADeploymentCountAntenna4Raw() { - if (this.sideADeploymentCountAntenna4Raw != null) - return this.sideADeploymentCountAntenna4Raw; - int _tmp = (int) (sideADeploymentCountAntenna4()); - this.sideADeploymentCountAntenna4Raw = _tmp; - return this.sideADeploymentCountAntenna4Raw; - } - private Integer sideADeploymentCountAntenna1Raw; - public Integer sideADeploymentCountAntenna1Raw() { - if (this.sideADeploymentCountAntenna1Raw != null) - return this.sideADeploymentCountAntenna1Raw; - int _tmp = (int) (sideADeploymentCountAntenna1()); - this.sideADeploymentCountAntenna1Raw = _tmp; - return this.sideADeploymentCountAntenna1Raw; - } - private Long sideAAntsUptimeRaw; - public Long sideAAntsUptimeRaw() { - if (this.sideAAntsUptimeRaw != null) - return this.sideAAntsUptimeRaw; - long _tmp = (long) (sideAAntsUptime()); - this.sideAAntsUptimeRaw = _tmp; - return this.sideAAntsUptimeRaw; - } - private Integer sideBDeploymentTimeAntenna3Raw; - public Integer sideBDeploymentTimeAntenna3Raw() { - if (this.sideBDeploymentTimeAntenna3Raw != null) - return this.sideBDeploymentTimeAntenna3Raw; - int _tmp = (int) (sideBDeploymentTimeAntenna3()); - this.sideBDeploymentTimeAntenna3Raw = _tmp; - return this.sideBDeploymentTimeAntenna3Raw; - } - private Integer sideBAntsTemperatureRaw; - public Integer sideBAntsTemperatureRaw() { - if (this.sideBAntsTemperatureRaw != null) - return this.sideBAntsTemperatureRaw; - int _tmp = (int) (sideBAntsTemperature()); - this.sideBAntsTemperatureRaw = _tmp; - return this.sideBAntsTemperatureRaw; - } - private Integer sideADeploymentTimeAntenna2Raw; - public Integer sideADeploymentTimeAntenna2Raw() { - if (this.sideADeploymentTimeAntenna2Raw != null) - return this.sideADeploymentTimeAntenna2Raw; - int _tmp = (int) (sideADeploymentTimeAntenna2()); - this.sideADeploymentTimeAntenna2Raw = _tmp; - return this.sideADeploymentTimeAntenna2Raw; - } - private Integer sideBDeploymentTimeAntenna4Raw; - public Integer sideBDeploymentTimeAntenna4Raw() { - if (this.sideBDeploymentTimeAntenna4Raw != null) - return this.sideBDeploymentTimeAntenna4Raw; - int _tmp = (int) (sideBDeploymentTimeAntenna4()); - this.sideBDeploymentTimeAntenna4Raw = _tmp; - return this.sideBDeploymentTimeAntenna4Raw; - } - private Integer sideBAntsDeploymentStatusRaw; - public Integer sideBAntsDeploymentStatusRaw() { - if (this.sideBAntsDeploymentStatusRaw != null) - return this.sideBAntsDeploymentStatusRaw; - int _tmp = (int) (sideBAntsDeploymentStatus()); - this.sideBAntsDeploymentStatusRaw = _tmp; - return this.sideBAntsDeploymentStatusRaw; - } - private Integer sideADeploymentTimeAntenna1Raw; - public Integer sideADeploymentTimeAntenna1Raw() { - if (this.sideADeploymentTimeAntenna1Raw != null) - return this.sideADeploymentTimeAntenna1Raw; - int _tmp = (int) (sideADeploymentTimeAntenna1()); - this.sideADeploymentTimeAntenna1Raw = _tmp; - return this.sideADeploymentTimeAntenna1Raw; - } - private Integer sideADeploymentTimeAntenna4Raw; - public Integer sideADeploymentTimeAntenna4Raw() { - if (this.sideADeploymentTimeAntenna4Raw != null) - return this.sideADeploymentTimeAntenna4Raw; - int _tmp = (int) (sideADeploymentTimeAntenna4()); - this.sideADeploymentTimeAntenna4Raw = _tmp; - return this.sideADeploymentTimeAntenna4Raw; - } - private Integer sideAAntsTemperatureRaw; - public Integer sideAAntsTemperatureRaw() { - if (this.sideAAntsTemperatureRaw != null) - return this.sideAAntsTemperatureRaw; - int _tmp = (int) (sideAAntsTemperature()); - this.sideAAntsTemperatureRaw = _tmp; - return this.sideAAntsTemperatureRaw; - } - private Integer sideAAntsDeploymentStatusRaw; - public Integer sideAAntsDeploymentStatusRaw() { - if (this.sideAAntsDeploymentStatusRaw != null) - return this.sideAAntsDeploymentStatusRaw; - int _tmp = (int) (sideAAntsDeploymentStatus()); - this.sideAAntsDeploymentStatusRaw = _tmp; - return this.sideAAntsDeploymentStatusRaw; - } - private Integer sideBDeploymentCountAntenna2Raw; - public Integer sideBDeploymentCountAntenna2Raw() { - if (this.sideBDeploymentCountAntenna2Raw != null) - return this.sideBDeploymentCountAntenna2Raw; - int _tmp = (int) (sideBDeploymentCountAntenna2()); - this.sideBDeploymentCountAntenna2Raw = _tmp; - return this.sideBDeploymentCountAntenna2Raw; - } - private Integer sideADeploymentCountAntenna2Raw; - public Integer sideADeploymentCountAntenna2Raw() { - if (this.sideADeploymentCountAntenna2Raw != null) - return this.sideADeploymentCountAntenna2Raw; - int _tmp = (int) (sideADeploymentCountAntenna2()); - this.sideADeploymentCountAntenna2Raw = _tmp; - return this.sideADeploymentCountAntenna2Raw; - } - private Integer sideBAntsUptimeRaw; - public Integer sideBAntsUptimeRaw() { - if (this.sideBAntsUptimeRaw != null) - return this.sideBAntsUptimeRaw; - int _tmp = (int) (sideBAntsUptime()); - this.sideBAntsUptimeRaw = _tmp; - return this.sideBAntsUptimeRaw; - } - private int sideAAntsTemperature; - private int sideAAntsDeploymentStatus; - private long sideAAntsUptime; - private int sideADeploymentCountAntenna1; - private int sideADeploymentCountAntenna2; - private int sideADeploymentCountAntenna3; - private int sideADeploymentCountAntenna4; - private int sideADeploymentTimeAntenna1; - private int sideADeploymentTimeAntenna2; - private int sideADeploymentTimeAntenna3; - private int sideADeploymentTimeAntenna4; - private int sideBAntsTemperature; - private int sideBAntsDeploymentStatus; - private int sideBAntsUptime; - private int sideBDeploymentCountAntenna1; - private int sideBDeploymentCountAntenna2; - private int sideBDeploymentCountAntenna3; - private int sideBDeploymentCountAntenna4; - private int sideBDeploymentTimeAntenna1; - private int sideBDeploymentTimeAntenna2; - private int sideBDeploymentTimeAntenna3; - private int sideBDeploymentTimeAntenna4; - private Uvsqsat _root; - private Uvsqsat.UiFrame _parent; - public int sideAAntsTemperature() { return sideAAntsTemperature; } - public int sideAAntsDeploymentStatus() { return sideAAntsDeploymentStatus; } - public long sideAAntsUptime() { return sideAAntsUptime; } - public int sideADeploymentCountAntenna1() { return sideADeploymentCountAntenna1; } - public int sideADeploymentCountAntenna2() { return sideADeploymentCountAntenna2; } - public int sideADeploymentCountAntenna3() { return sideADeploymentCountAntenna3; } - public int sideADeploymentCountAntenna4() { return sideADeploymentCountAntenna4; } - public int sideADeploymentTimeAntenna1() { return sideADeploymentTimeAntenna1; } - public int sideADeploymentTimeAntenna2() { return sideADeploymentTimeAntenna2; } - public int sideADeploymentTimeAntenna3() { return sideADeploymentTimeAntenna3; } - public int sideADeploymentTimeAntenna4() { return sideADeploymentTimeAntenna4; } - public int sideBAntsTemperature() { return sideBAntsTemperature; } - public int sideBAntsDeploymentStatus() { return sideBAntsDeploymentStatus; } - public int sideBAntsUptime() { return sideBAntsUptime; } - public int sideBDeploymentCountAntenna1() { return sideBDeploymentCountAntenna1; } - public int sideBDeploymentCountAntenna2() { return sideBDeploymentCountAntenna2; } - public int sideBDeploymentCountAntenna3() { return sideBDeploymentCountAntenna3; } - public int sideBDeploymentCountAntenna4() { return sideBDeploymentCountAntenna4; } - public int sideBDeploymentTimeAntenna1() { return sideBDeploymentTimeAntenna1; } - public int sideBDeploymentTimeAntenna2() { return sideBDeploymentTimeAntenna2; } - public int sideBDeploymentTimeAntenna3() { return sideBDeploymentTimeAntenna3; } - public int sideBDeploymentTimeAntenna4() { return sideBDeploymentTimeAntenna4; } - public Uvsqsat _root() { return _root; } - public Uvsqsat.UiFrame _parent() { return _parent; } - } - private Ax25Frame ax25Frame; + this.ax25Header = new Ax25Header(this._io, this, _root); + switch ((ax25Header().ctl() & 19)) { + case 0: + { + this.payload = new IFrame(this._io, this, _root); + break; + } + case 3: + { + this.payload = new UiFrame(this._io, this, _root); + break; + } + case 19: + { + this.payload = new UiFrame(this._io, this, _root); + break; + } + case 16: + { + this.payload = new IFrame(this._io, this, _root); + break; + } + case 18: + { + this.payload = new IFrame(this._io, this, _root); + break; + } + case 2: + { + this.payload = new IFrame(this._io, this, _root); + break; + } + default: + { + this.payload = new IFrame(this._io, this, _root); + break; + } + } + } + + private Ax25Header ax25Header; + private KaitaiStruct payload; private Uvsqsat _root; - private KaitaiStruct _parent; + private Uvsqsat _parent; - /** - * @see Source - */ - public Ax25Frame ax25Frame() { return ax25Frame; } - public Uvsqsat _root() { return _root; } - public KaitaiStruct _parent() { return _parent; } + public Ax25Header ax25Header() { + return ax25Header; + } + + public KaitaiStruct payload() { + return payload; + } + + public Uvsqsat _root() { + return _root; + } + + public Uvsqsat _parent() { + return _parent; + } + } + + public static class Ax25Header extends KaitaiStruct { + public static Ax25Header fromFile(String fileName) throws IOException { + return new Ax25Header(new ByteBufferKaitaiStream(fileName)); + } + + public Ax25Header(KaitaiStream _io) { + this(_io, null, null); + } + + public Ax25Header(KaitaiStream _io, Uvsqsat.Ax25Frame _parent) { + this(_io, _parent, null); + } + + public Ax25Header(KaitaiStream _io, Uvsqsat.Ax25Frame _parent, Uvsqsat _root) { + super(_io); + this._parent = _parent; + this._root = _root; + _read(); + } + + private void _read() { + this.destCallsignRaw = new CallsignRaw(this._io, this, _root); + this.destSsidRaw = new SsidMask(this._io, this, _root); + this.srcCallsignRaw = new CallsignRaw(this._io, this, _root); + this.srcSsidRaw = new SsidMask(this._io, this, _root); + this.ctl = this._io.readU1(); + } + + private CallsignRaw destCallsignRaw; + private SsidMask destSsidRaw; + private CallsignRaw srcCallsignRaw; + private SsidMask srcSsidRaw; + private int ctl; + private Uvsqsat _root; + private Uvsqsat.Ax25Frame _parent; + + public CallsignRaw destCallsignRaw() { + return destCallsignRaw; + } + + public SsidMask destSsidRaw() { + return destSsidRaw; + } + + public CallsignRaw srcCallsignRaw() { + return srcCallsignRaw; + } + + public SsidMask srcSsidRaw() { + return srcSsidRaw; + } + + public int ctl() { + return ctl; + } + + public Uvsqsat _root() { + return _root; + } + + public Uvsqsat.Ax25Frame _parent() { + return _parent; + } + } + + public static class UiFrame extends KaitaiStruct { + public static UiFrame fromFile(String fileName) throws IOException { + return new UiFrame(new ByteBufferKaitaiStream(fileName)); + } + + public UiFrame(KaitaiStream _io) { + this(_io, null, null); + } + + public UiFrame(KaitaiStream _io, Uvsqsat.Ax25Frame _parent) { + this(_io, _parent, null); + } + + public UiFrame(KaitaiStream _io, Uvsqsat.Ax25Frame _parent, Uvsqsat _root) { + super(_io); + this._parent = _parent; + this._root = _root; + _read(); + } + + private void _read() { + this.pid = this._io.readU1(); + this.packetPrimaryHeader = new PacketPrimaryHeader(this._io, this, _root); + this.packetSecondaryHeader = new PacketSecondaryHeader(this._io, this, _root); + switch (packetSecondaryHeader().sid()) { + case 14: + { + this.tlm = new AmsatAscii(this._io, this, _root); + break; + } + case 17: + { + this.tlm = new ObcStatus(this._io, this, _root); + break; + } + case 24: + { + this.tlm = new TrxvutxHk(this._io, this, _root); + break; + } + case 20: + { + this.tlm = new MainboardHk(this._io, this, _root); + break; + } + case 19: + { + this.tlm = new MainboardAllScience(this._io, this, _root); + break; + } + case 23: + { + this.tlm = new ImtqHk(this._io, this, _root); + break; + } + case 15: + { + this.tlm = new Beacon(this._io, this, _root); + break; + } + case 21: + { + this.tlm = new IepsHkStatus(this._io, this, _root); + break; + } + case 16: + { + this.tlm = new AntsHk(this._io, this, _root); + break; + } + case 18: + { + this.tlm = new ObcHk(this._io, this, _root); + break; + } + case 22: + { + this.tlm = new TrxvurxHk(this._io, this, _root); + break; + } + default: + { + this.tlm = new MsgOrUnknow(this._io, this, _root); + break; + } + } + this.ax25Info = this._io.readBytesFull(); + } + + private int pid; + private PacketPrimaryHeader packetPrimaryHeader; + private PacketSecondaryHeader packetSecondaryHeader; + private KaitaiStruct tlm; + private byte[] ax25Info; + private Uvsqsat _root; + private Uvsqsat.Ax25Frame _parent; + + public int pid() { + return pid; + } + + public PacketPrimaryHeader packetPrimaryHeader() { + return packetPrimaryHeader; + } + + public PacketSecondaryHeader packetSecondaryHeader() { + return packetSecondaryHeader; + } + + public KaitaiStruct tlm() { + return tlm; + } + + public byte[] ax25Info() { + return ax25Info; + } + + public Uvsqsat _root() { + return _root; + } + + public Uvsqsat.Ax25Frame _parent() { + return _parent; + } + } + + public static class Callsign extends KaitaiStruct { + public static Callsign fromFile(String fileName) throws IOException { + return new Callsign(new ByteBufferKaitaiStream(fileName)); + } + + public Callsign(KaitaiStream _io) { + this(_io, null, null); + } + + public Callsign(KaitaiStream _io, Uvsqsat.CallsignRaw _parent) { + this(_io, _parent, null); + } + + public Callsign(KaitaiStream _io, Uvsqsat.CallsignRaw _parent, Uvsqsat _root) { + super(_io); + this._parent = _parent; + this._root = _root; + _read(); + } + + private void _read() { + this.callsign = new String(this._io.readBytes(6), Charset.forName("ASCII")); + } + + private String callsign; + private Uvsqsat _root; + private Uvsqsat.CallsignRaw _parent; + + public String callsign() { + return callsign; + } + + public Uvsqsat _root() { + return _root; + } + + public Uvsqsat.CallsignRaw _parent() { + return _parent; + } + } + + public static class PacketPrimaryHeader extends KaitaiStruct { + public static PacketPrimaryHeader fromFile(String fileName) throws IOException { + return new PacketPrimaryHeader(new ByteBufferKaitaiStream(fileName)); + } + + public PacketPrimaryHeader(KaitaiStream _io) { + this(_io, null, null); + } + + public PacketPrimaryHeader(KaitaiStream _io, Uvsqsat.UiFrame _parent) { + this(_io, _parent, null); + } + + public PacketPrimaryHeader(KaitaiStream _io, Uvsqsat.UiFrame _parent, Uvsqsat _root) { + super(_io); + this._parent = _parent; + this._root = _root; + _read(); + } + + private void _read() { + this.packetVersionNumber = this._io.readBitsInt(3); + this.packetIdPacketType = this._io.readBitsInt(1) != 0; + this.packetIdSecondaryHeaderFlag = this._io.readBitsInt(1) != 0; + this.packetIdApplicationProcessId = this._io.readBitsInt(11); + this.packetSequenceControlSecquenceFlag = this._io.readBitsInt(2); + this.packetSequenceControlCountOrName = this._io.readBitsInt(14); + this._io.alignToByte(); + this.packetDataLength = this._io.readU2be(); + } + + private long packetVersionNumber; + private boolean packetIdPacketType; + private boolean packetIdSecondaryHeaderFlag; + private long packetIdApplicationProcessId; + private long packetSequenceControlSecquenceFlag; + private long packetSequenceControlCountOrName; + private int packetDataLength; + private Uvsqsat _root; + private Uvsqsat.UiFrame _parent; + + public long packetVersionNumber() { + return packetVersionNumber; + } + + public boolean packetIdPacketType() { + return packetIdPacketType; + } + + public boolean packetIdSecondaryHeaderFlag() { + return packetIdSecondaryHeaderFlag; + } + + public long packetIdApplicationProcessId() { + return packetIdApplicationProcessId; + } + + public long packetSequenceControlSecquenceFlag() { + return packetSequenceControlSecquenceFlag; + } + + public long packetSequenceControlCountOrName() { + return packetSequenceControlCountOrName; + } + + public int packetDataLength() { + return packetDataLength; + } + + public Uvsqsat _root() { + return _root; + } + + public Uvsqsat.UiFrame _parent() { + return _parent; + } + } + + public static class TrxvutxHk extends KaitaiStruct { + public static TrxvutxHk fromFile(String fileName) throws IOException { + return new TrxvutxHk(new ByteBufferKaitaiStream(fileName)); + } + + public TrxvutxHk(KaitaiStream _io) { + this(_io, null, null); + } + + public TrxvutxHk(KaitaiStream _io, Uvsqsat.UiFrame _parent) { + this(_io, _parent, null); + } + + public TrxvutxHk(KaitaiStream _io, Uvsqsat.UiFrame _parent, Uvsqsat _root) { + super(_io); + this._parent = _parent; + this._root = _root; + _read(); + } + + private void _read() { + this.trxvutxInstantaneousRfReflectedPowerFromTransmitterPort = this._io.readBitsInt(12); + this.trxvutxInstantaneousRfForwardPowerFromTransmitterPort = this._io.readBitsInt(12); + this.trxvutxSupplyVoltage = this._io.readBitsInt(12); + this.trxvutxTotalSupplyCurrent = this._io.readBitsInt(12); + this.trxvutxTransmitterCurrent = this._io.readBitsInt(12); + this.trxvutxReceiverCurrent = this._io.readBitsInt(12); + this.trxvutxPowerAmplifierCurrent = this._io.readBitsInt(12); + this.trxvutxPowerAmplifierTemperature = this._io.readBitsInt(12); + this.trxvutxLocalOscillatorTemperature = this._io.readBitsInt(12); + this.trxvutxZeroPadding = this._io.readBitsInt(4); + this._io.alignToByte(); + this.trxvuTxUptime = this._io.readU4be(); + this.trxvuTxState = this._io.readU1(); + } + + private Double trxvutxTotalSupplyCurrentMa; + + public Double trxvutxTotalSupplyCurrentMa() { + if (this.trxvutxTotalSupplyCurrentMa != null) return this.trxvutxTotalSupplyCurrentMa; + double _tmp = (double) ((0.16643964 * trxvutxTotalSupplyCurrent())); + this.trxvutxTotalSupplyCurrentMa = _tmp; + return this.trxvutxTotalSupplyCurrentMa; + } + + private Double trxvutxPowerAmplifierCurrentMa; + + public Double trxvutxPowerAmplifierCurrentMa() { + if (this.trxvutxPowerAmplifierCurrentMa != null) return this.trxvutxPowerAmplifierCurrentMa; + double _tmp = (double) (((1000.0 * trxvutxPowerAmplifierCurrent()) * 0.16643964)); + this.trxvutxPowerAmplifierCurrentMa = _tmp; + return this.trxvutxPowerAmplifierCurrentMa; + } + + private Long trxvuTxUptimeRaw; + + public Long trxvuTxUptimeRaw() { + if (this.trxvuTxUptimeRaw != null) return this.trxvuTxUptimeRaw; + long _tmp = (long) (trxvuTxUptime()); + this.trxvuTxUptimeRaw = _tmp; + return this.trxvuTxUptimeRaw; + } + + private Double trxvutxSupplyVoltageV; + + public Double trxvutxSupplyVoltageV() { + if (this.trxvutxSupplyVoltageV != null) return this.trxvutxSupplyVoltageV; + double _tmp = (double) ((0.00488 * trxvutxSupplyVoltage())); + this.trxvutxSupplyVoltageV = _tmp; + return this.trxvutxSupplyVoltageV; + } + + private Double trxvutxInstantaneousRfReflectedPowerFromTransmitterPortMw; + + public Double trxvutxInstantaneousRfReflectedPowerFromTransmitterPortMw() { + if (this.trxvutxInstantaneousRfReflectedPowerFromTransmitterPortMw != null) + return this.trxvutxInstantaneousRfReflectedPowerFromTransmitterPortMw; + double _tmp = + (double) + (((((1000.0 * trxvutxInstantaneousRfReflectedPowerFromTransmitterPort()) + * trxvutxInstantaneousRfReflectedPowerFromTransmitterPort()) + * 5.887) + * 0.00001)); + this.trxvutxInstantaneousRfReflectedPowerFromTransmitterPortMw = _tmp; + return this.trxvutxInstantaneousRfReflectedPowerFromTransmitterPortMw; + } + + private Double trxvutxLocalOscillatorTemperatureC; + + public Double trxvutxLocalOscillatorTemperatureC() { + if (this.trxvutxLocalOscillatorTemperatureC != null) + return this.trxvutxLocalOscillatorTemperatureC; + double _tmp = (double) (((trxvutxLocalOscillatorTemperature() * -0.07669) + 195.6037)); + this.trxvutxLocalOscillatorTemperatureC = _tmp; + return this.trxvutxLocalOscillatorTemperatureC; + } + + private Double trxvutxInstantaneousRfForwardPowerFromTransmitterPortMw; + + public Double trxvutxInstantaneousRfForwardPowerFromTransmitterPortMw() { + if (this.trxvutxInstantaneousRfForwardPowerFromTransmitterPortMw != null) + return this.trxvutxInstantaneousRfForwardPowerFromTransmitterPortMw; + double _tmp = + (double) + (((((1000.0 * trxvutxInstantaneousRfForwardPowerFromTransmitterPort()) + * trxvutxInstantaneousRfForwardPowerFromTransmitterPort()) + * 5.887) + * 0.00001)); + this.trxvutxInstantaneousRfForwardPowerFromTransmitterPortMw = _tmp; + return this.trxvutxInstantaneousRfForwardPowerFromTransmitterPortMw; + } + + private Double trxvutxReceiverCurrentMa; + + public Double trxvutxReceiverCurrentMa() { + if (this.trxvutxReceiverCurrentMa != null) return this.trxvutxReceiverCurrentMa; + double _tmp = (double) ((trxvutxReceiverCurrent() * 0.16643964)); + this.trxvutxReceiverCurrentMa = _tmp; + return this.trxvutxReceiverCurrentMa; + } + + private Long trxvutxZeroPaddingRaw; + + public Long trxvutxZeroPaddingRaw() { + if (this.trxvutxZeroPaddingRaw != null) return this.trxvutxZeroPaddingRaw; + long _tmp = (long) (trxvutxZeroPadding()); + this.trxvutxZeroPaddingRaw = _tmp; + return this.trxvutxZeroPaddingRaw; + } + + private Double trxvutxPowerAmplifierTemperatureC; + + public Double trxvutxPowerAmplifierTemperatureC() { + if (this.trxvutxPowerAmplifierTemperatureC != null) + return this.trxvutxPowerAmplifierTemperatureC; + double _tmp = (double) (((trxvutxPowerAmplifierTemperature() * -0.07669) + 195.6037)); + this.trxvutxPowerAmplifierTemperatureC = _tmp; + return this.trxvutxPowerAmplifierTemperatureC; + } + + private Double trxvutxTransmitterCurrentMa; + + public Double trxvutxTransmitterCurrentMa() { + if (this.trxvutxTransmitterCurrentMa != null) return this.trxvutxTransmitterCurrentMa; + double _tmp = (double) ((trxvutxTransmitterCurrent() * 0.16643964)); + this.trxvutxTransmitterCurrentMa = _tmp; + return this.trxvutxTransmitterCurrentMa; + } + + private Integer trxvuTxStateRaw; + + public Integer trxvuTxStateRaw() { + if (this.trxvuTxStateRaw != null) return this.trxvuTxStateRaw; + int _tmp = (int) (trxvuTxState()); + this.trxvuTxStateRaw = _tmp; + return this.trxvuTxStateRaw; + } + + private long trxvutxInstantaneousRfReflectedPowerFromTransmitterPort; + private long trxvutxInstantaneousRfForwardPowerFromTransmitterPort; + private long trxvutxSupplyVoltage; + private long trxvutxTotalSupplyCurrent; + private long trxvutxTransmitterCurrent; + private long trxvutxReceiverCurrent; + private long trxvutxPowerAmplifierCurrent; + private long trxvutxPowerAmplifierTemperature; + private long trxvutxLocalOscillatorTemperature; + private long trxvutxZeroPadding; + private long trxvuTxUptime; + private int trxvuTxState; + private Uvsqsat _root; + private Uvsqsat.UiFrame _parent; + + public long trxvutxInstantaneousRfReflectedPowerFromTransmitterPort() { + return trxvutxInstantaneousRfReflectedPowerFromTransmitterPort; + } + + public long trxvutxInstantaneousRfForwardPowerFromTransmitterPort() { + return trxvutxInstantaneousRfForwardPowerFromTransmitterPort; + } + + public long trxvutxSupplyVoltage() { + return trxvutxSupplyVoltage; + } + + public long trxvutxTotalSupplyCurrent() { + return trxvutxTotalSupplyCurrent; + } + + public long trxvutxTransmitterCurrent() { + return trxvutxTransmitterCurrent; + } + + public long trxvutxReceiverCurrent() { + return trxvutxReceiverCurrent; + } + + public long trxvutxPowerAmplifierCurrent() { + return trxvutxPowerAmplifierCurrent; + } + + public long trxvutxPowerAmplifierTemperature() { + return trxvutxPowerAmplifierTemperature; + } + + public long trxvutxLocalOscillatorTemperature() { + return trxvutxLocalOscillatorTemperature; + } + + public long trxvutxZeroPadding() { + return trxvutxZeroPadding; + } + + public long trxvuTxUptime() { + return trxvuTxUptime; + } + + public int trxvuTxState() { + return trxvuTxState; + } + + public Uvsqsat _root() { + return _root; + } + + public Uvsqsat.UiFrame _parent() { + return _parent; + } + } + + public static class MainboardAllScience extends KaitaiStruct { + public static MainboardAllScience fromFile(String fileName) throws IOException { + return new MainboardAllScience(new ByteBufferKaitaiStream(fileName)); + } + + public MainboardAllScience(KaitaiStream _io) { + this(_io, null, null); + } + + public MainboardAllScience(KaitaiStream _io, Uvsqsat.UiFrame _parent) { + this(_io, _parent, null); + } + + public MainboardAllScience(KaitaiStream _io, Uvsqsat.UiFrame _parent, Uvsqsat _root) { + super(_io); + this._parent = _parent; + this._root = _root; + _read(); + } + + private void _read() { + this.mainboardScienceTime = this._io.readU4be(); + this.teachWearOn = this._io.readU1(); + this.frequenceOfAcquisitions = this._io.readU2be(); + this.gain = this._io.readU4be(); + this.numberOfAcquisitionCommanded = this._io.readU2be(); + this.numberOfRealAcquisition = this._io.readU2be(); + this.hkPlus5v = this._io.readU4be(); + this.hkMinus5v = this._io.readU4be(); + this.hkMinus5vPolar = this._io.readU4be(); + this.hkTempAdc = this._io.readU4be(); + this.hkFeePlusXVref = this._io.readU4be(); + this.hkFeeMinusXVref = this._io.readU4be(); + this.hkFeePlusYVref = this._io.readU4be(); + this.hkFeeMinusYVref = this._io.readU4be(); + this.feePlusXErs1Signal = this._io.readU4be(); + this.feePlusXErs1Temperature = this._io.readU4be(); + this.feePlusXErs2Signal = this._io.readU4be(); + this.feePlusXErs2Temperature = this._io.readU4be(); + this.feePlusXErs3Signal = this._io.readU4be(); + this.feePlusXErs3Temperature = this._io.readU4be(); + this.feePlusXUvsSignal = this._io.readU4be(); + this.feeMinusXErs1Signal = this._io.readU4be(); + this.feeMinusXErs1Temperature = this._io.readU4be(); + this.feeMinusXErs2Signal = this._io.readU4be(); + this.feeMinusXErs2Temperature = this._io.readU4be(); + this.feeMinusXErs3Signal = this._io.readU4be(); + this.feeMinusXErs3Temperature = this._io.readU4be(); + this.feeMinusXUvsSignal = this._io.readU4be(); + this.feePlusYErs1Signal = this._io.readU4be(); + this.feePlusYErs1Temperature = this._io.readU4be(); + this.feePlusYErs2Signal = this._io.readU4be(); + this.feePlusYErs2Temperature = this._io.readU4be(); + this.feePlusYErs3Signal = this._io.readU4be(); + this.feePlusYErs3Temperature = this._io.readU4be(); + this.feePlusYUvsSignal = this._io.readU4be(); + this.feeMinusYErs1Signal = this._io.readU4be(); + this.feeMinusYErs1Temperature = this._io.readU4be(); + this.feeMinusYErs2Signal = this._io.readU4be(); + this.feeMinusYErs2Temperature = this._io.readU4be(); + this.feeMinusYErs3Signal = this._io.readU4be(); + this.feeMinusYErs3Temperature = this._io.readU4be(); + this.feeMinusYUvsSignal = this._io.readU4be(); + this.teachwearAccX = this._io.readU2be(); + this.teachwearAccY = this._io.readU2be(); + this.teachwearAccZ = this._io.readU2be(); + this.teachwearDegC = this._io.readU2be(); + this.teachwearGyroX = this._io.readU2be(); + this.teachwearGyroY = this._io.readU2be(); + this.teachwearGyroZ = this._io.readU2be(); + this.teachwearMagnX = this._io.readU2be(); + this.teachwearMagnY = this._io.readU2be(); + this.teachwearMagnZ = this._io.readU2be(); + this.teachwearState = this._io.readU1(); + this.teachwearResetReason = this._io.readU1(); + this.teachwearCrc = this._io.readU2be(); + this.nbTmSinceFirstStart = this._io.readU4be(); + } + + private Long feePlusYErs1SignalRaw; + + public Long feePlusYErs1SignalRaw() { + if (this.feePlusYErs1SignalRaw != null) return this.feePlusYErs1SignalRaw; + long _tmp = (long) (feePlusYErs1Signal()); + this.feePlusYErs1SignalRaw = _tmp; + return this.feePlusYErs1SignalRaw; + } + + private Long feeMinusYErs1TemperatureRaw; + + public Long feeMinusYErs1TemperatureRaw() { + if (this.feeMinusYErs1TemperatureRaw != null) return this.feeMinusYErs1TemperatureRaw; + long _tmp = (long) (feeMinusYErs1Temperature()); + this.feeMinusYErs1TemperatureRaw = _tmp; + return this.feeMinusYErs1TemperatureRaw; + } + + private Integer teachwearCRCRaw; + + public Integer teachwearCRCRaw() { + if (this.teachwearCRCRaw != null) return this.teachwearCRCRaw; + int _tmp = (int) (teachwearCrc()); + this.teachwearCRCRaw = _tmp; + return this.teachwearCRCRaw; + } + + private Long feePlusXErs2SignalRaw; + + public Long feePlusXErs2SignalRaw() { + if (this.feePlusXErs2SignalRaw != null) return this.feePlusXErs2SignalRaw; + long _tmp = (long) (feePlusXErs2Signal()); + this.feePlusXErs2SignalRaw = _tmp; + return this.feePlusXErs2SignalRaw; + } + + private Long hkFeePlusXVrefRaw; + + public Long hkFeePlusXVrefRaw() { + if (this.hkFeePlusXVrefRaw != null) return this.hkFeePlusXVrefRaw; + long _tmp = (long) (hkFeePlusXVref()); + this.hkFeePlusXVrefRaw = _tmp; + return this.hkFeePlusXVrefRaw; + } + + private Long feeMinusYUvsSignalRaw; + + public Long feeMinusYUvsSignalRaw() { + if (this.feeMinusYUvsSignalRaw != null) return this.feeMinusYUvsSignalRaw; + long _tmp = (long) (feeMinusYUvsSignal()); + this.feeMinusYUvsSignalRaw = _tmp; + return this.feeMinusYUvsSignalRaw; + } + + private Integer teachwearMagnYRaw; + + public Integer teachwearMagnYRaw() { + if (this.teachwearMagnYRaw != null) return this.teachwearMagnYRaw; + int _tmp = (int) (teachwearMagnY()); + this.teachwearMagnYRaw = _tmp; + return this.teachwearMagnYRaw; + } + + private Long hkMinus5vPolarRaw; + + public Long hkMinus5vPolarRaw() { + if (this.hkMinus5vPolarRaw != null) return this.hkMinus5vPolarRaw; + long _tmp = (long) (hkMinus5vPolar()); + this.hkMinus5vPolarRaw = _tmp; + return this.hkMinus5vPolarRaw; + } + + private Integer teachwearGyroZRaw; + + public Integer teachwearGyroZRaw() { + if (this.teachwearGyroZRaw != null) return this.teachwearGyroZRaw; + int _tmp = (int) (teachwearGyroZ()); + this.teachwearGyroZRaw = _tmp; + return this.teachwearGyroZRaw; + } + + private Long feePlusXErs2TemperatureRaw; + + public Long feePlusXErs2TemperatureRaw() { + if (this.feePlusXErs2TemperatureRaw != null) return this.feePlusXErs2TemperatureRaw; + long _tmp = (long) (feePlusXErs2Temperature()); + this.feePlusXErs2TemperatureRaw = _tmp; + return this.feePlusXErs2TemperatureRaw; + } + + private Long feeMinusYErs3TemperatureRaw; + + public Long feeMinusYErs3TemperatureRaw() { + if (this.feeMinusYErs3TemperatureRaw != null) return this.feeMinusYErs3TemperatureRaw; + long _tmp = (long) (feeMinusYErs3Temperature()); + this.feeMinusYErs3TemperatureRaw = _tmp; + return this.feeMinusYErs3TemperatureRaw; + } + + private Long feePlusYUvsSignalRaw; + + public Long feePlusYUvsSignalRaw() { + if (this.feePlusYUvsSignalRaw != null) return this.feePlusYUvsSignalRaw; + long _tmp = (long) (feePlusYUvsSignal()); + this.feePlusYUvsSignalRaw = _tmp; + return this.feePlusYUvsSignalRaw; + } + + private Long hkTempAdcRaw; + + public Long hkTempAdcRaw() { + if (this.hkTempAdcRaw != null) return this.hkTempAdcRaw; + long _tmp = (long) (hkTempAdc()); + this.hkTempAdcRaw = _tmp; + return this.hkTempAdcRaw; + } + + private Long feePlusXErs3TemperatureRaw; + + public Long feePlusXErs3TemperatureRaw() { + if (this.feePlusXErs3TemperatureRaw != null) return this.feePlusXErs3TemperatureRaw; + long _tmp = (long) (feePlusXErs3Temperature()); + this.feePlusXErs3TemperatureRaw = _tmp; + return this.feePlusXErs3TemperatureRaw; + } + + private Long hkFeePlusYVrefRaw; + + public Long hkFeePlusYVrefRaw() { + if (this.hkFeePlusYVrefRaw != null) return this.hkFeePlusYVrefRaw; + long _tmp = (long) (hkFeePlusYVref()); + this.hkFeePlusYVrefRaw = _tmp; + return this.hkFeePlusYVrefRaw; + } + + private Long feeMinusYErs3SignalRaw; + + public Long feeMinusYErs3SignalRaw() { + if (this.feeMinusYErs3SignalRaw != null) return this.feeMinusYErs3SignalRaw; + long _tmp = (long) (feeMinusYErs3Signal()); + this.feeMinusYErs3SignalRaw = _tmp; + return this.feeMinusYErs3SignalRaw; + } + + private Long feeMinusXErs2SignalRaw; + + public Long feeMinusXErs2SignalRaw() { + if (this.feeMinusXErs2SignalRaw != null) return this.feeMinusXErs2SignalRaw; + long _tmp = (long) (feeMinusXErs2Signal()); + this.feeMinusXErs2SignalRaw = _tmp; + return this.feeMinusXErs2SignalRaw; + } + + private Integer numberOfAcquisitionCommandedRaw; + + public Integer numberOfAcquisitionCommandedRaw() { + if (this.numberOfAcquisitionCommandedRaw != null) return this.numberOfAcquisitionCommandedRaw; + int _tmp = (int) (numberOfAcquisitionCommanded()); + this.numberOfAcquisitionCommandedRaw = _tmp; + return this.numberOfAcquisitionCommandedRaw; + } + + private Long gainRaw; + + public Long gainRaw() { + if (this.gainRaw != null) return this.gainRaw; + long _tmp = (long) (gain()); + this.gainRaw = _tmp; + return this.gainRaw; + } + + private Long feeMinusYErs1SignalRaw; + + public Long feeMinusYErs1SignalRaw() { + if (this.feeMinusYErs1SignalRaw != null) return this.feeMinusYErs1SignalRaw; + long _tmp = (long) (feeMinusYErs1Signal()); + this.feeMinusYErs1SignalRaw = _tmp; + return this.feeMinusYErs1SignalRaw; + } + + private Integer teachwearAccZRaw; + + public Integer teachwearAccZRaw() { + if (this.teachwearAccZRaw != null) return this.teachwearAccZRaw; + int _tmp = (int) (teachwearAccZ()); + this.teachwearAccZRaw = _tmp; + return this.teachwearAccZRaw; + } + + private Long mainboardScienceTimeRaw; + + public Long mainboardScienceTimeRaw() { + if (this.mainboardScienceTimeRaw != null) return this.mainboardScienceTimeRaw; + long _tmp = (long) (mainboardScienceTime()); + this.mainboardScienceTimeRaw = _tmp; + return this.mainboardScienceTimeRaw; + } + + private Long feePlusXErs3SignalRaw; + + public Long feePlusXErs3SignalRaw() { + if (this.feePlusXErs3SignalRaw != null) return this.feePlusXErs3SignalRaw; + long _tmp = (long) (feePlusXErs3Signal()); + this.feePlusXErs3SignalRaw = _tmp; + return this.feePlusXErs3SignalRaw; + } + + private Integer teachwearAccXRaw; + + public Integer teachwearAccXRaw() { + if (this.teachwearAccXRaw != null) return this.teachwearAccXRaw; + int _tmp = (int) (teachwearAccX()); + this.teachwearAccXRaw = _tmp; + return this.teachwearAccXRaw; + } + + private Long feeMinusXUvsSignalRaw; + + public Long feeMinusXUvsSignalRaw() { + if (this.feeMinusXUvsSignalRaw != null) return this.feeMinusXUvsSignalRaw; + long _tmp = (long) (feeMinusXUvsSignal()); + this.feeMinusXUvsSignalRaw = _tmp; + return this.feeMinusXUvsSignalRaw; + } + + private Long feePlusYErs3TemperatureRaw; + + public Long feePlusYErs3TemperatureRaw() { + if (this.feePlusYErs3TemperatureRaw != null) return this.feePlusYErs3TemperatureRaw; + long _tmp = (long) (feePlusYErs3Temperature()); + this.feePlusYErs3TemperatureRaw = _tmp; + return this.feePlusYErs3TemperatureRaw; + } + + private Long feeMinusXErs1TemperatureRaw; + + public Long feeMinusXErs1TemperatureRaw() { + if (this.feeMinusXErs1TemperatureRaw != null) return this.feeMinusXErs1TemperatureRaw; + long _tmp = (long) (feeMinusXErs1Temperature()); + this.feeMinusXErs1TemperatureRaw = _tmp; + return this.feeMinusXErs1TemperatureRaw; + } + + private Long hkPlus5vRaw; + + public Long hkPlus5vRaw() { + if (this.hkPlus5vRaw != null) return this.hkPlus5vRaw; + long _tmp = (long) (hkPlus5v()); + this.hkPlus5vRaw = _tmp; + return this.hkPlus5vRaw; + } + + private Integer numberOfRealAcquisitionRaw; + + public Integer numberOfRealAcquisitionRaw() { + if (this.numberOfRealAcquisitionRaw != null) return this.numberOfRealAcquisitionRaw; + int _tmp = (int) (numberOfRealAcquisition()); + this.numberOfRealAcquisitionRaw = _tmp; + return this.numberOfRealAcquisitionRaw; + } + + private Long feePlusYErs2SignalRaw; + + public Long feePlusYErs2SignalRaw() { + if (this.feePlusYErs2SignalRaw != null) return this.feePlusYErs2SignalRaw; + long _tmp = (long) (feePlusYErs2Signal()); + this.feePlusYErs2SignalRaw = _tmp; + return this.feePlusYErs2SignalRaw; + } + + private Integer teachWearOnRaw; + + public Integer teachWearOnRaw() { + if (this.teachWearOnRaw != null) return this.teachWearOnRaw; + int _tmp = (int) (teachWearOn()); + this.teachWearOnRaw = _tmp; + return this.teachWearOnRaw; + } + + private Integer frequenceOfAcquisitionsRaw; + + public Integer frequenceOfAcquisitionsRaw() { + if (this.frequenceOfAcquisitionsRaw != null) return this.frequenceOfAcquisitionsRaw; + int _tmp = (int) (frequenceOfAcquisitions()); + this.frequenceOfAcquisitionsRaw = _tmp; + return this.frequenceOfAcquisitionsRaw; + } + + private Long feePlusYErs2TemperatureRaw; + + public Long feePlusYErs2TemperatureRaw() { + if (this.feePlusYErs2TemperatureRaw != null) return this.feePlusYErs2TemperatureRaw; + long _tmp = (long) (feePlusYErs2Temperature()); + this.feePlusYErs2TemperatureRaw = _tmp; + return this.feePlusYErs2TemperatureRaw; + } + + private Long nbTmSinceFirstStartRaw; + + public Long nbTmSinceFirstStartRaw() { + if (this.nbTmSinceFirstStartRaw != null) return this.nbTmSinceFirstStartRaw; + long _tmp = (long) (nbTmSinceFirstStart()); + this.nbTmSinceFirstStartRaw = _tmp; + return this.nbTmSinceFirstStartRaw; + } + + private Integer teachwearMagnXRaw; + + public Integer teachwearMagnXRaw() { + if (this.teachwearMagnXRaw != null) return this.teachwearMagnXRaw; + int _tmp = (int) (teachwearMagnX()); + this.teachwearMagnXRaw = _tmp; + return this.teachwearMagnXRaw; + } + + private Long feeMinusXErs1SignalRaw; + + public Long feeMinusXErs1SignalRaw() { + if (this.feeMinusXErs1SignalRaw != null) return this.feeMinusXErs1SignalRaw; + long _tmp = (long) (feeMinusXErs1Signal()); + this.feeMinusXErs1SignalRaw = _tmp; + return this.feeMinusXErs1SignalRaw; + } + + private Long feeMinusXErs3SignalRaw; + + public Long feeMinusXErs3SignalRaw() { + if (this.feeMinusXErs3SignalRaw != null) return this.feeMinusXErs3SignalRaw; + long _tmp = (long) (feeMinusXErs3Signal()); + this.feeMinusXErs3SignalRaw = _tmp; + return this.feeMinusXErs3SignalRaw; + } + + private Long feeMinusYErs2SignalRaw; + + public Long feeMinusYErs2SignalRaw() { + if (this.feeMinusYErs2SignalRaw != null) return this.feeMinusYErs2SignalRaw; + long _tmp = (long) (feeMinusYErs2Signal()); + this.feeMinusYErs2SignalRaw = _tmp; + return this.feeMinusYErs2SignalRaw; + } + + private Long feeMinusYErs2TemperatureRaw; + + public Long feeMinusYErs2TemperatureRaw() { + if (this.feeMinusYErs2TemperatureRaw != null) return this.feeMinusYErs2TemperatureRaw; + long _tmp = (long) (feeMinusYErs2Temperature()); + this.feeMinusYErs2TemperatureRaw = _tmp; + return this.feeMinusYErs2TemperatureRaw; + } + + private Long feeMinusXErs2TemperatureRaw; + + public Long feeMinusXErs2TemperatureRaw() { + if (this.feeMinusXErs2TemperatureRaw != null) return this.feeMinusXErs2TemperatureRaw; + long _tmp = (long) (feeMinusXErs2Temperature()); + this.feeMinusXErs2TemperatureRaw = _tmp; + return this.feeMinusXErs2TemperatureRaw; + } + + private Long feePlusXErs1TemperatureRaw; + + public Long feePlusXErs1TemperatureRaw() { + if (this.feePlusXErs1TemperatureRaw != null) return this.feePlusXErs1TemperatureRaw; + long _tmp = (long) (feePlusXErs1Temperature()); + this.feePlusXErs1TemperatureRaw = _tmp; + return this.feePlusXErs1TemperatureRaw; + } + + private Long hkFeeMinusXVrefRaw; + + public Long hkFeeMinusXVrefRaw() { + if (this.hkFeeMinusXVrefRaw != null) return this.hkFeeMinusXVrefRaw; + long _tmp = (long) (hkFeeMinusXVref()); + this.hkFeeMinusXVrefRaw = _tmp; + return this.hkFeeMinusXVrefRaw; + } + + private Long feePlusYErs1TemperatureRaw; + + public Long feePlusYErs1TemperatureRaw() { + if (this.feePlusYErs1TemperatureRaw != null) return this.feePlusYErs1TemperatureRaw; + long _tmp = (long) (feePlusYErs1Temperature()); + this.feePlusYErs1TemperatureRaw = _tmp; + return this.feePlusYErs1TemperatureRaw; + } + + private Integer teachwearGyroXRaw; + + public Integer teachwearGyroXRaw() { + if (this.teachwearGyroXRaw != null) return this.teachwearGyroXRaw; + int _tmp = (int) (teachwearGyroX()); + this.teachwearGyroXRaw = _tmp; + return this.teachwearGyroXRaw; + } + + private Long feePlusXUvsSignalRaw; + + public Long feePlusXUvsSignalRaw() { + if (this.feePlusXUvsSignalRaw != null) return this.feePlusXUvsSignalRaw; + long _tmp = (long) (feePlusXUvsSignal()); + this.feePlusXUvsSignalRaw = _tmp; + return this.feePlusXUvsSignalRaw; + } + + private Long hkFeeMinusYVrefRaw; + + public Long hkFeeMinusYVrefRaw() { + if (this.hkFeeMinusYVrefRaw != null) return this.hkFeeMinusYVrefRaw; + long _tmp = (long) (hkFeeMinusYVref()); + this.hkFeeMinusYVrefRaw = _tmp; + return this.hkFeeMinusYVrefRaw; + } + + private Integer teachwearStateRaw; + + public Integer teachwearStateRaw() { + if (this.teachwearStateRaw != null) return this.teachwearStateRaw; + int _tmp = (int) (teachwearState()); + this.teachwearStateRaw = _tmp; + return this.teachwearStateRaw; + } + + private Long feePlusXErs1SignalRaw; + + public Long feePlusXErs1SignalRaw() { + if (this.feePlusXErs1SignalRaw != null) return this.feePlusXErs1SignalRaw; + long _tmp = (long) (feePlusXErs1Signal()); + this.feePlusXErs1SignalRaw = _tmp; + return this.feePlusXErs1SignalRaw; + } + + private Long hkMinus5vRaw; + + public Long hkMinus5vRaw() { + if (this.hkMinus5vRaw != null) return this.hkMinus5vRaw; + long _tmp = (long) (hkMinus5v()); + this.hkMinus5vRaw = _tmp; + return this.hkMinus5vRaw; + } + + private Long feeMinusXErs3TemperatureRaw; + + public Long feeMinusXErs3TemperatureRaw() { + if (this.feeMinusXErs3TemperatureRaw != null) return this.feeMinusXErs3TemperatureRaw; + long _tmp = (long) (feeMinusXErs3Temperature()); + this.feeMinusXErs3TemperatureRaw = _tmp; + return this.feeMinusXErs3TemperatureRaw; + } + + private Integer teachwearResetReasonRaw; + + public Integer teachwearResetReasonRaw() { + if (this.teachwearResetReasonRaw != null) return this.teachwearResetReasonRaw; + int _tmp = (int) (teachwearResetReason()); + this.teachwearResetReasonRaw = _tmp; + return this.teachwearResetReasonRaw; + } + + private Integer teachwearDegCRaw; + + public Integer teachwearDegCRaw() { + if (this.teachwearDegCRaw != null) return this.teachwearDegCRaw; + int _tmp = (int) (teachwearDegC()); + this.teachwearDegCRaw = _tmp; + return this.teachwearDegCRaw; + } + + private Integer teachwearGyroYRaw; + + public Integer teachwearGyroYRaw() { + if (this.teachwearGyroYRaw != null) return this.teachwearGyroYRaw; + int _tmp = (int) (teachwearGyroY()); + this.teachwearGyroYRaw = _tmp; + return this.teachwearGyroYRaw; + } + + private Integer teachwearMagnZRaw; + + public Integer teachwearMagnZRaw() { + if (this.teachwearMagnZRaw != null) return this.teachwearMagnZRaw; + int _tmp = (int) (teachwearMagnZ()); + this.teachwearMagnZRaw = _tmp; + return this.teachwearMagnZRaw; + } + + private Long feePlusYErs3SignalRaw; + + public Long feePlusYErs3SignalRaw() { + if (this.feePlusYErs3SignalRaw != null) return this.feePlusYErs3SignalRaw; + long _tmp = (long) (feePlusYErs3Signal()); + this.feePlusYErs3SignalRaw = _tmp; + return this.feePlusYErs3SignalRaw; + } + + private Integer teachwearAccYRaw; + + public Integer teachwearAccYRaw() { + if (this.teachwearAccYRaw != null) return this.teachwearAccYRaw; + int _tmp = (int) (teachwearAccY()); + this.teachwearAccYRaw = _tmp; + return this.teachwearAccYRaw; + } + + private long mainboardScienceTime; + private int teachWearOn; + private int frequenceOfAcquisitions; + private long gain; + private int numberOfAcquisitionCommanded; + private int numberOfRealAcquisition; + private long hkPlus5v; + private long hkMinus5v; + private long hkMinus5vPolar; + private long hkTempAdc; + private long hkFeePlusXVref; + private long hkFeeMinusXVref; + private long hkFeePlusYVref; + private long hkFeeMinusYVref; + private long feePlusXErs1Signal; + private long feePlusXErs1Temperature; + private long feePlusXErs2Signal; + private long feePlusXErs2Temperature; + private long feePlusXErs3Signal; + private long feePlusXErs3Temperature; + private long feePlusXUvsSignal; + private long feeMinusXErs1Signal; + private long feeMinusXErs1Temperature; + private long feeMinusXErs2Signal; + private long feeMinusXErs2Temperature; + private long feeMinusXErs3Signal; + private long feeMinusXErs3Temperature; + private long feeMinusXUvsSignal; + private long feePlusYErs1Signal; + private long feePlusYErs1Temperature; + private long feePlusYErs2Signal; + private long feePlusYErs2Temperature; + private long feePlusYErs3Signal; + private long feePlusYErs3Temperature; + private long feePlusYUvsSignal; + private long feeMinusYErs1Signal; + private long feeMinusYErs1Temperature; + private long feeMinusYErs2Signal; + private long feeMinusYErs2Temperature; + private long feeMinusYErs3Signal; + private long feeMinusYErs3Temperature; + private long feeMinusYUvsSignal; + private int teachwearAccX; + private int teachwearAccY; + private int teachwearAccZ; + private int teachwearDegC; + private int teachwearGyroX; + private int teachwearGyroY; + private int teachwearGyroZ; + private int teachwearMagnX; + private int teachwearMagnY; + private int teachwearMagnZ; + private int teachwearState; + private int teachwearResetReason; + private int teachwearCrc; + private long nbTmSinceFirstStart; + private Uvsqsat _root; + private Uvsqsat.UiFrame _parent; + + public long mainboardScienceTime() { + return mainboardScienceTime; + } + + public int teachWearOn() { + return teachWearOn; + } + + public int frequenceOfAcquisitions() { + return frequenceOfAcquisitions; + } + + public long gain() { + return gain; + } + + public int numberOfAcquisitionCommanded() { + return numberOfAcquisitionCommanded; + } + + public int numberOfRealAcquisition() { + return numberOfRealAcquisition; + } + + public long hkPlus5v() { + return hkPlus5v; + } + + public long hkMinus5v() { + return hkMinus5v; + } + + public long hkMinus5vPolar() { + return hkMinus5vPolar; + } + + public long hkTempAdc() { + return hkTempAdc; + } + + public long hkFeePlusXVref() { + return hkFeePlusXVref; + } + + public long hkFeeMinusXVref() { + return hkFeeMinusXVref; + } + + public long hkFeePlusYVref() { + return hkFeePlusYVref; + } + + public long hkFeeMinusYVref() { + return hkFeeMinusYVref; + } + + public long feePlusXErs1Signal() { + return feePlusXErs1Signal; + } + + public long feePlusXErs1Temperature() { + return feePlusXErs1Temperature; + } + + public long feePlusXErs2Signal() { + return feePlusXErs2Signal; + } + + public long feePlusXErs2Temperature() { + return feePlusXErs2Temperature; + } + + public long feePlusXErs3Signal() { + return feePlusXErs3Signal; + } + + public long feePlusXErs3Temperature() { + return feePlusXErs3Temperature; + } + + public long feePlusXUvsSignal() { + return feePlusXUvsSignal; + } + + public long feeMinusXErs1Signal() { + return feeMinusXErs1Signal; + } + + public long feeMinusXErs1Temperature() { + return feeMinusXErs1Temperature; + } + + public long feeMinusXErs2Signal() { + return feeMinusXErs2Signal; + } + + public long feeMinusXErs2Temperature() { + return feeMinusXErs2Temperature; + } + + public long feeMinusXErs3Signal() { + return feeMinusXErs3Signal; + } + + public long feeMinusXErs3Temperature() { + return feeMinusXErs3Temperature; + } + + public long feeMinusXUvsSignal() { + return feeMinusXUvsSignal; + } + + public long feePlusYErs1Signal() { + return feePlusYErs1Signal; + } + + public long feePlusYErs1Temperature() { + return feePlusYErs1Temperature; + } + + public long feePlusYErs2Signal() { + return feePlusYErs2Signal; + } + + public long feePlusYErs2Temperature() { + return feePlusYErs2Temperature; + } + + public long feePlusYErs3Signal() { + return feePlusYErs3Signal; + } + + public long feePlusYErs3Temperature() { + return feePlusYErs3Temperature; + } + + public long feePlusYUvsSignal() { + return feePlusYUvsSignal; + } + + public long feeMinusYErs1Signal() { + return feeMinusYErs1Signal; + } + + public long feeMinusYErs1Temperature() { + return feeMinusYErs1Temperature; + } + + public long feeMinusYErs2Signal() { + return feeMinusYErs2Signal; + } + + public long feeMinusYErs2Temperature() { + return feeMinusYErs2Temperature; + } + + public long feeMinusYErs3Signal() { + return feeMinusYErs3Signal; + } + + public long feeMinusYErs3Temperature() { + return feeMinusYErs3Temperature; + } + + public long feeMinusYUvsSignal() { + return feeMinusYUvsSignal; + } + + public int teachwearAccX() { + return teachwearAccX; + } + + public int teachwearAccY() { + return teachwearAccY; + } + + public int teachwearAccZ() { + return teachwearAccZ; + } + + public int teachwearDegC() { + return teachwearDegC; + } + + public int teachwearGyroX() { + return teachwearGyroX; + } + + public int teachwearGyroY() { + return teachwearGyroY; + } + + public int teachwearGyroZ() { + return teachwearGyroZ; + } + + public int teachwearMagnX() { + return teachwearMagnX; + } + + public int teachwearMagnY() { + return teachwearMagnY; + } + + public int teachwearMagnZ() { + return teachwearMagnZ; + } + + public int teachwearState() { + return teachwearState; + } + + public int teachwearResetReason() { + return teachwearResetReason; + } + + public int teachwearCrc() { + return teachwearCrc; + } + + public long nbTmSinceFirstStart() { + return nbTmSinceFirstStart; + } + + public Uvsqsat _root() { + return _root; + } + + public Uvsqsat.UiFrame _parent() { + return _parent; + } + } + + public static class AmsatAscii extends KaitaiStruct { + public static AmsatAscii fromFile(String fileName) throws IOException { + return new AmsatAscii(new ByteBufferKaitaiStream(fileName)); + } + + public AmsatAscii(KaitaiStream _io) { + this(_io, null, null); + } + + public AmsatAscii(KaitaiStream _io, Uvsqsat.UiFrame _parent) { + this(_io, _parent, null); + } + + public AmsatAscii(KaitaiStream _io, Uvsqsat.UiFrame _parent, Uvsqsat _root) { + super(_io); + this._parent = _parent; + this._root = _root; + _read(); + } + + private void _read() { + this.message = new String(this._io.readBytesFull(), Charset.forName("UTF-8")); + } + + private String messageStr; + + public String messageStr() { + if (this.messageStr != null) return this.messageStr; + this.messageStr = message(); + return this.messageStr; + } + + private String message; + private Uvsqsat _root; + private Uvsqsat.UiFrame _parent; + + public String message() { + return message; + } + + public Uvsqsat _root() { + return _root; + } + + public Uvsqsat.UiFrame _parent() { + return _parent; + } + } + + public static class TrxvurxHk extends KaitaiStruct { + public static TrxvurxHk fromFile(String fileName) throws IOException { + return new TrxvurxHk(new ByteBufferKaitaiStream(fileName)); + } + + public TrxvurxHk(KaitaiStream _io) { + this(_io, null, null); + } + + public TrxvurxHk(KaitaiStream _io, Uvsqsat.UiFrame _parent) { + this(_io, _parent, null); + } + + public TrxvurxHk(KaitaiStream _io, Uvsqsat.UiFrame _parent, Uvsqsat _root) { + super(_io); + this._parent = _parent; + this._root = _root; + _read(); + } + + private void _read() { + this.trxvurxInstantaneousReceivedSignalDopplerOffsetAtTheReceiverPort = + this._io.readBitsInt(12); + this.trxvurxInstantaneousReceivedSignalStrengthAtTheReceiverPort = this._io.readBitsInt(12); + this.trxvurxSupplyVoltage = this._io.readBitsInt(12); + this.trxvurxTotalSupplyCurrent = this._io.readBitsInt(12); + this.trxvurxTransmitterCurrent = this._io.readBitsInt(12); + this.trxvurxReceiverCurrent = this._io.readBitsInt(12); + this.trxvurxPowerAmplifierCurrent = this._io.readBitsInt(12); + this.trxvurxPowerAmplifierTemperature = this._io.readBitsInt(12); + this.trxvurxLocalOscillatorTemperature = this._io.readBitsInt(12); + this.trxvurxZeroPadding = this._io.readBitsInt(4); + this._io.alignToByte(); + this.trxvuRxUptime = this._io.readU4be(); + } + + private Double trxvurxInstantaneousReceivedSignalStrengthDbm; + + public Double trxvurxInstantaneousReceivedSignalStrengthDbm() { + if (this.trxvurxInstantaneousReceivedSignalStrengthDbm != null) + return this.trxvurxInstantaneousReceivedSignalStrengthDbm; + double _tmp = + (double) (((trxvurxInstantaneousReceivedSignalStrengthAtTheReceiverPort() * 0.03) - 152)); + this.trxvurxInstantaneousReceivedSignalStrengthDbm = _tmp; + return this.trxvurxInstantaneousReceivedSignalStrengthDbm; + } + + private Double trxvurxInstantaneousReceivedSignalDopplerHz; + + public Double trxvurxInstantaneousReceivedSignalDopplerHz() { + if (this.trxvurxInstantaneousReceivedSignalDopplerHz != null) + return this.trxvurxInstantaneousReceivedSignalDopplerHz; + double _tmp = + (double) + (((trxvurxInstantaneousReceivedSignalDopplerOffsetAtTheReceiverPort() * 13.552) + - 22300)); + this.trxvurxInstantaneousReceivedSignalDopplerHz = _tmp; + return this.trxvurxInstantaneousReceivedSignalDopplerHz; + } + + private Double trxvurxSupplyVoltageV; + + public Double trxvurxSupplyVoltageV() { + if (this.trxvurxSupplyVoltageV != null) return this.trxvurxSupplyVoltageV; + double _tmp = (double) ((trxvurxSupplyVoltage() * 0.00488)); + this.trxvurxSupplyVoltageV = _tmp; + return this.trxvurxSupplyVoltageV; + } + + private Double trxvurxLocalOscillatorTemperatureC; + + public Double trxvurxLocalOscillatorTemperatureC() { + if (this.trxvurxLocalOscillatorTemperatureC != null) + return this.trxvurxLocalOscillatorTemperatureC; + double _tmp = (double) (((trxvurxLocalOscillatorTemperature() * -0.07669) + 195.6037)); + this.trxvurxLocalOscillatorTemperatureC = _tmp; + return this.trxvurxLocalOscillatorTemperatureC; + } + + private Double trxvurxTransmitterCurrentMa; + + public Double trxvurxTransmitterCurrentMa() { + if (this.trxvurxTransmitterCurrentMa != null) return this.trxvurxTransmitterCurrentMa; + double _tmp = (double) ((trxvurxTransmitterCurrent() * 0.16643964)); + this.trxvurxTransmitterCurrentMa = _tmp; + return this.trxvurxTransmitterCurrentMa; + } + + private Long trxvurxZeroPaddingRaw; + + public Long trxvurxZeroPaddingRaw() { + if (this.trxvurxZeroPaddingRaw != null) return this.trxvurxZeroPaddingRaw; + long _tmp = (long) (trxvurxZeroPadding()); + this.trxvurxZeroPaddingRaw = _tmp; + return this.trxvurxZeroPaddingRaw; + } + + private Double trxvurxPowerAmplifierCurrentMa; + + public Double trxvurxPowerAmplifierCurrentMa() { + if (this.trxvurxPowerAmplifierCurrentMa != null) return this.trxvurxPowerAmplifierCurrentMa; + double _tmp = (double) (((1000.0 * trxvurxPowerAmplifierCurrent()) * 0.16643964)); + this.trxvurxPowerAmplifierCurrentMa = _tmp; + return this.trxvurxPowerAmplifierCurrentMa; + } + + private Double trxvurxTotalSupplyCurrentMa; + + public Double trxvurxTotalSupplyCurrentMa() { + if (this.trxvurxTotalSupplyCurrentMa != null) return this.trxvurxTotalSupplyCurrentMa; + double _tmp = (double) ((trxvurxTotalSupplyCurrent() * 0.16643964)); + this.trxvurxTotalSupplyCurrentMa = _tmp; + return this.trxvurxTotalSupplyCurrentMa; + } + + private Double trxvurxPowerAmplifierTemperatureC; + + public Double trxvurxPowerAmplifierTemperatureC() { + if (this.trxvurxPowerAmplifierTemperatureC != null) + return this.trxvurxPowerAmplifierTemperatureC; + double _tmp = (double) (((trxvurxPowerAmplifierTemperature() * -0.07669) + 195.6037)); + this.trxvurxPowerAmplifierTemperatureC = _tmp; + return this.trxvurxPowerAmplifierTemperatureC; + } + + private Long trxvuRxUptimeRaw; + + public Long trxvuRxUptimeRaw() { + if (this.trxvuRxUptimeRaw != null) return this.trxvuRxUptimeRaw; + long _tmp = (long) (trxvuRxUptime()); + this.trxvuRxUptimeRaw = _tmp; + return this.trxvuRxUptimeRaw; + } + + private Double trxvurxReceiverCurrentMa; + + public Double trxvurxReceiverCurrentMa() { + if (this.trxvurxReceiverCurrentMa != null) return this.trxvurxReceiverCurrentMa; + double _tmp = (double) ((trxvurxReceiverCurrent() * 0.16643964)); + this.trxvurxReceiverCurrentMa = _tmp; + return this.trxvurxReceiverCurrentMa; + } + + private long trxvurxInstantaneousReceivedSignalDopplerOffsetAtTheReceiverPort; + private long trxvurxInstantaneousReceivedSignalStrengthAtTheReceiverPort; + private long trxvurxSupplyVoltage; + private long trxvurxTotalSupplyCurrent; + private long trxvurxTransmitterCurrent; + private long trxvurxReceiverCurrent; + private long trxvurxPowerAmplifierCurrent; + private long trxvurxPowerAmplifierTemperature; + private long trxvurxLocalOscillatorTemperature; + private long trxvurxZeroPadding; + private long trxvuRxUptime; + private Uvsqsat _root; + private Uvsqsat.UiFrame _parent; + + public long trxvurxInstantaneousReceivedSignalDopplerOffsetAtTheReceiverPort() { + return trxvurxInstantaneousReceivedSignalDopplerOffsetAtTheReceiverPort; + } + + public long trxvurxInstantaneousReceivedSignalStrengthAtTheReceiverPort() { + return trxvurxInstantaneousReceivedSignalStrengthAtTheReceiverPort; + } + + public long trxvurxSupplyVoltage() { + return trxvurxSupplyVoltage; + } + + public long trxvurxTotalSupplyCurrent() { + return trxvurxTotalSupplyCurrent; + } + + public long trxvurxTransmitterCurrent() { + return trxvurxTransmitterCurrent; + } + + public long trxvurxReceiverCurrent() { + return trxvurxReceiverCurrent; + } + + public long trxvurxPowerAmplifierCurrent() { + return trxvurxPowerAmplifierCurrent; + } + + public long trxvurxPowerAmplifierTemperature() { + return trxvurxPowerAmplifierTemperature; + } + + public long trxvurxLocalOscillatorTemperature() { + return trxvurxLocalOscillatorTemperature; + } + + public long trxvurxZeroPadding() { + return trxvurxZeroPadding; + } + + public long trxvuRxUptime() { + return trxvuRxUptime; + } + + public Uvsqsat _root() { + return _root; + } + + public Uvsqsat.UiFrame _parent() { + return _parent; + } + } + + public static class MainboardHk extends KaitaiStruct { + public static MainboardHk fromFile(String fileName) throws IOException { + return new MainboardHk(new ByteBufferKaitaiStream(fileName)); + } + + public MainboardHk(KaitaiStream _io) { + this(_io, null, null); + } + + public MainboardHk(KaitaiStream _io, Uvsqsat.UiFrame _parent) { + this(_io, _parent, null); + } + + public MainboardHk(KaitaiStream _io, Uvsqsat.UiFrame _parent, Uvsqsat _root) { + super(_io); + this._parent = _parent; + this._root = _root; + _read(); + } + + private void _read() { + this.mainboardHkTime = this._io.readU4be(); + this.hkPlus5V = this._io.readU2be(); + this.hkMinus5V = this._io.readU2be(); + this.hkMinusPolar = this._io.readU2be(); + this.hkTempADC = this._io.readU2be(); + this.hkFeePlusXVref = this._io.readU2be(); + this.hkFeeMinusXVref = this._io.readU2be(); + this.hkFeePlusYVref = this._io.readU2be(); + this.hkFeeMinusYVref = this._io.readU2be(); + } + + private Integer hkFeePlusXVrefRaw; + + public Integer hkFeePlusXVrefRaw() { + if (this.hkFeePlusXVrefRaw != null) return this.hkFeePlusXVrefRaw; + int _tmp = (int) (hkFeePlusXVref()); + this.hkFeePlusXVrefRaw = _tmp; + return this.hkFeePlusXVrefRaw; + } + + private Integer hkFeePlusYVrefRaw; + + public Integer hkFeePlusYVrefRaw() { + if (this.hkFeePlusYVrefRaw != null) return this.hkFeePlusYVrefRaw; + int _tmp = (int) (hkFeePlusYVref()); + this.hkFeePlusYVrefRaw = _tmp; + return this.hkFeePlusYVrefRaw; + } + + private Integer hkPlus5VRaw; + + public Integer hkPlus5VRaw() { + if (this.hkPlus5VRaw != null) return this.hkPlus5VRaw; + int _tmp = (int) (hkPlus5V()); + this.hkPlus5VRaw = _tmp; + return this.hkPlus5VRaw; + } + + private Integer hkTempADCRaw; + + public Integer hkTempADCRaw() { + if (this.hkTempADCRaw != null) return this.hkTempADCRaw; + int _tmp = (int) (hkTempADC()); + this.hkTempADCRaw = _tmp; + return this.hkTempADCRaw; + } + + private Long mainboardHKTimeRaw; + + public Long mainboardHKTimeRaw() { + if (this.mainboardHKTimeRaw != null) return this.mainboardHKTimeRaw; + long _tmp = (long) (mainboardHkTime()); + this.mainboardHKTimeRaw = _tmp; + return this.mainboardHKTimeRaw; + } + + private Integer hkMinusPolarRaw; + + public Integer hkMinusPolarRaw() { + if (this.hkMinusPolarRaw != null) return this.hkMinusPolarRaw; + int _tmp = (int) (hkMinusPolar()); + this.hkMinusPolarRaw = _tmp; + return this.hkMinusPolarRaw; + } + + private Integer hkMinus5VRaw; + + public Integer hkMinus5VRaw() { + if (this.hkMinus5VRaw != null) return this.hkMinus5VRaw; + int _tmp = (int) (hkMinus5V()); + this.hkMinus5VRaw = _tmp; + return this.hkMinus5VRaw; + } + + private Integer hkFeeMinusXVrefRaw; + + public Integer hkFeeMinusXVrefRaw() { + if (this.hkFeeMinusXVrefRaw != null) return this.hkFeeMinusXVrefRaw; + int _tmp = (int) (hkFeeMinusXVref()); + this.hkFeeMinusXVrefRaw = _tmp; + return this.hkFeeMinusXVrefRaw; + } + + private Integer hkFeeMinusYVrefRaw; + + public Integer hkFeeMinusYVrefRaw() { + if (this.hkFeeMinusYVrefRaw != null) return this.hkFeeMinusYVrefRaw; + int _tmp = (int) (hkFeeMinusYVref()); + this.hkFeeMinusYVrefRaw = _tmp; + return this.hkFeeMinusYVrefRaw; + } + + private long mainboardHkTime; + private int hkPlus5V; + private int hkMinus5V; + private int hkMinusPolar; + private int hkTempADC; + private int hkFeePlusXVref; + private int hkFeeMinusXVref; + private int hkFeePlusYVref; + private int hkFeeMinusYVref; + private Uvsqsat _root; + private Uvsqsat.UiFrame _parent; + + public long mainboardHkTime() { + return mainboardHkTime; + } + + public int hkPlus5V() { + return hkPlus5V; + } + + public int hkMinus5V() { + return hkMinus5V; + } + + public int hkMinusPolar() { + return hkMinusPolar; + } + + public int hkTempADC() { + return hkTempADC; + } + + public int hkFeePlusXVref() { + return hkFeePlusXVref; + } + + public int hkFeeMinusXVref() { + return hkFeeMinusXVref; + } + + public int hkFeePlusYVref() { + return hkFeePlusYVref; + } + + public int hkFeeMinusYVref() { + return hkFeeMinusYVref; + } + + public Uvsqsat _root() { + return _root; + } + + public Uvsqsat.UiFrame _parent() { + return _parent; + } + } + + public static class IFrame extends KaitaiStruct { + public static IFrame fromFile(String fileName) throws IOException { + return new IFrame(new ByteBufferKaitaiStream(fileName)); + } + + public IFrame(KaitaiStream _io) { + this(_io, null, null); + } + + public IFrame(KaitaiStream _io, Uvsqsat.Ax25Frame _parent) { + this(_io, _parent, null); + } + + public IFrame(KaitaiStream _io, Uvsqsat.Ax25Frame _parent, Uvsqsat _root) { + super(_io); + this._parent = _parent; + this._root = _root; + _read(); + } + + private void _read() { + this.pid = this._io.readU1(); + this.ax25Info = this._io.readBytesFull(); + } + + private int pid; + private byte[] ax25Info; + private Uvsqsat _root; + private Uvsqsat.Ax25Frame _parent; + + public int pid() { + return pid; + } + + public byte[] ax25Info() { + return ax25Info; + } + + public Uvsqsat _root() { + return _root; + } + + public Uvsqsat.Ax25Frame _parent() { + return _parent; + } + } + + public static class ObcStatus extends KaitaiStruct { + public static ObcStatus fromFile(String fileName) throws IOException { + return new ObcStatus(new ByteBufferKaitaiStream(fileName)); + } + + public ObcStatus(KaitaiStream _io) { + this(_io, null, null); + } + + public ObcStatus(KaitaiStream _io, Uvsqsat.UiFrame _parent) { + this(_io, _parent, null); + } + + public ObcStatus(KaitaiStream _io, Uvsqsat.UiFrame _parent, Uvsqsat _root) { + super(_io); + this._parent = _parent; + this._root = _root; + _read(); + } + + private void _read() { + this.dummy = this._io.readU1(); + this.spiCommandStatus = this._io.readU1(); + this.supervisorIndexOfSubsystem = this._io.readU1(); + this.supervisorMajorVersion = this._io.readU1(); + this.supervisorMinorVersion = this._io.readU1(); + this.supervisorPatchVersion = this._io.readU1(); + this.supervisorGitHeadVersion = this._io.readU4be(); + this.supervisorSerialNumber = this._io.readU2be(); + this.compilationInformation = this._io.readBytes(19); + this.clockSpeed = this._io.readU1(); + this.codeType = this._io.readU1(); + this.crc8 = this._io.readU1(); + this.swMmode = this._io.readU1(); + this.lastResetReason = this._io.readU1(); + this.reserved = this._io.readU1(); + this.nbReset = this._io.readU1(); + this.reserved2 = this._io.readU1(); + this.deployAntennasSystem = this._io.readU1(); + this.nbTmSinceFirstStart = this._io.readU4be(); + this.nbTcSinceFirstStart = this._io.readU4be(); + this.nbBadTcSinceFirstStart = this._io.readU4be(); + this.nbTmInSdcard = this._io.readU4be(); + this.sdcardStatus = this._io.readU1(); + this.sdcardLastError = this._io.readU4be(); + this.oldTimeTMInSdcard = this._io.readBitsInt(56); + this.newTimeTMInSdcard = this._io.readBitsInt(56); + } + + private Long newTimeTMInSdcardRaw; + + public Long newTimeTMInSdcardRaw() { + if (this.newTimeTMInSdcardRaw != null) return this.newTimeTMInSdcardRaw; + long _tmp = (long) (newTimeTMInSdcard()); + this.newTimeTMInSdcardRaw = _tmp; + return this.newTimeTMInSdcardRaw; + } + + private Integer deployAntennasSystemRaw; + + public Integer deployAntennasSystemRaw() { + if (this.deployAntennasSystemRaw != null) return this.deployAntennasSystemRaw; + int _tmp = (int) (deployAntennasSystem()); + this.deployAntennasSystemRaw = _tmp; + return this.deployAntennasSystemRaw; + } + + private Integer clockSpeedRaw; + + public Integer clockSpeedRaw() { + if (this.clockSpeedRaw != null) return this.clockSpeedRaw; + int _tmp = (int) (clockSpeed()); + this.clockSpeedRaw = _tmp; + return this.clockSpeedRaw; + } + + private Integer lastResetReasonRaw; + + public Integer lastResetReasonRaw() { + if (this.lastResetReasonRaw != null) return this.lastResetReasonRaw; + int _tmp = (int) (lastResetReason()); + this.lastResetReasonRaw = _tmp; + return this.lastResetReasonRaw; + } + + private Integer supervisorIndexOfSubsystemRaw; + + public Integer supervisorIndexOfSubsystemRaw() { + if (this.supervisorIndexOfSubsystemRaw != null) return this.supervisorIndexOfSubsystemRaw; + int _tmp = (int) (supervisorIndexOfSubsystem()); + this.supervisorIndexOfSubsystemRaw = _tmp; + return this.supervisorIndexOfSubsystemRaw; + } + + private Integer crc8Raw; + + public Integer crc8Raw() { + if (this.crc8Raw != null) return this.crc8Raw; + int _tmp = (int) (crc8()); + this.crc8Raw = _tmp; + return this.crc8Raw; + } + + private Integer nbResetRaw; + + public Integer nbResetRaw() { + if (this.nbResetRaw != null) return this.nbResetRaw; + int _tmp = (int) (nbReset()); + this.nbResetRaw = _tmp; + return this.nbResetRaw; + } + + private Long supervisorGitHeadVersionRaw; + + public Long supervisorGitHeadVersionRaw() { + if (this.supervisorGitHeadVersionRaw != null) return this.supervisorGitHeadVersionRaw; + long _tmp = (long) (supervisorGitHeadVersion()); + this.supervisorGitHeadVersionRaw = _tmp; + return this.supervisorGitHeadVersionRaw; + } + + private Integer supervisorMajorVersionRaw; + + public Integer supervisorMajorVersionRaw() { + if (this.supervisorMajorVersionRaw != null) return this.supervisorMajorVersionRaw; + int _tmp = (int) (supervisorMajorVersion()); + this.supervisorMajorVersionRaw = _tmp; + return this.supervisorMajorVersionRaw; + } + + private byte[] compilationInformationByte; + + public byte[] compilationInformationByte() { + if (this.compilationInformationByte != null) return this.compilationInformationByte; + this.compilationInformationByte = compilationInformation(); + return this.compilationInformationByte; + } + + private Long nbTmSinceFirstStartRaw; + + public Long nbTmSinceFirstStartRaw() { + if (this.nbTmSinceFirstStartRaw != null) return this.nbTmSinceFirstStartRaw; + long _tmp = (long) (nbTmSinceFirstStart()); + this.nbTmSinceFirstStartRaw = _tmp; + return this.nbTmSinceFirstStartRaw; + } + + private Integer supervisorMinorVersionRaw; + + public Integer supervisorMinorVersionRaw() { + if (this.supervisorMinorVersionRaw != null) return this.supervisorMinorVersionRaw; + int _tmp = (int) (supervisorMinorVersion()); + this.supervisorMinorVersionRaw = _tmp; + return this.supervisorMinorVersionRaw; + } + + private Integer sdcardStatusRaw; + + public Integer sdcardStatusRaw() { + if (this.sdcardStatusRaw != null) return this.sdcardStatusRaw; + int _tmp = (int) (sdcardStatus()); + this.sdcardStatusRaw = _tmp; + return this.sdcardStatusRaw; + } + + private Integer supervisorPatchVersionRaw; + + public Integer supervisorPatchVersionRaw() { + if (this.supervisorPatchVersionRaw != null) return this.supervisorPatchVersionRaw; + int _tmp = (int) (supervisorPatchVersion()); + this.supervisorPatchVersionRaw = _tmp; + return this.supervisorPatchVersionRaw; + } + + private Integer reservedRaw; + + public Integer reservedRaw() { + if (this.reservedRaw != null) return this.reservedRaw; + int _tmp = (int) (reserved()); + this.reservedRaw = _tmp; + return this.reservedRaw; + } + + private Integer supervisorSerialNumberRaw; + + public Integer supervisorSerialNumberRaw() { + if (this.supervisorSerialNumberRaw != null) return this.supervisorSerialNumberRaw; + int _tmp = (int) (supervisorSerialNumber()); + this.supervisorSerialNumberRaw = _tmp; + return this.supervisorSerialNumberRaw; + } + + private Long nbTmInSdcardRaw; + + public Long nbTmInSdcardRaw() { + if (this.nbTmInSdcardRaw != null) return this.nbTmInSdcardRaw; + long _tmp = (long) (nbTmInSdcard()); + this.nbTmInSdcardRaw = _tmp; + return this.nbTmInSdcardRaw; + } + + private Integer reserved2Raw; + + public Integer reserved2Raw() { + if (this.reserved2Raw != null) return this.reserved2Raw; + int _tmp = (int) (reserved2()); + this.reserved2Raw = _tmp; + return this.reserved2Raw; + } + + private Integer swMmodeRaw; + + public Integer swMmodeRaw() { + if (this.swMmodeRaw != null) return this.swMmodeRaw; + int _tmp = (int) (swMmode()); + this.swMmodeRaw = _tmp; + return this.swMmodeRaw; + } + + private Integer codeTypeRaw; + + public Integer codeTypeRaw() { + if (this.codeTypeRaw != null) return this.codeTypeRaw; + int _tmp = (int) (codeType()); + this.codeTypeRaw = _tmp; + return this.codeTypeRaw; + } + + private Long oldTimeTMInSdcardRaw; + + public Long oldTimeTMInSdcardRaw() { + if (this.oldTimeTMInSdcardRaw != null) return this.oldTimeTMInSdcardRaw; + long _tmp = (long) (oldTimeTMInSdcard()); + this.oldTimeTMInSdcardRaw = _tmp; + return this.oldTimeTMInSdcardRaw; + } + + private Integer dummydummy; + + public Integer dummydummy() { + if (this.dummydummy != null) return this.dummydummy; + int _tmp = (int) (dummy()); + this.dummydummy = _tmp; + return this.dummydummy; + } + + private Long nbTcSinceFirstStartRaw; + + public Long nbTcSinceFirstStartRaw() { + if (this.nbTcSinceFirstStartRaw != null) return this.nbTcSinceFirstStartRaw; + long _tmp = (long) (nbTcSinceFirstStart()); + this.nbTcSinceFirstStartRaw = _tmp; + return this.nbTcSinceFirstStartRaw; + } + + private Long sdcardLastErrorRaw; + + public Long sdcardLastErrorRaw() { + if (this.sdcardLastErrorRaw != null) return this.sdcardLastErrorRaw; + long _tmp = (long) (sdcardLastError()); + this.sdcardLastErrorRaw = _tmp; + return this.sdcardLastErrorRaw; + } + + private Long nbBadTcSinceFirstStartRaw; + + public Long nbBadTcSinceFirstStartRaw() { + if (this.nbBadTcSinceFirstStartRaw != null) return this.nbBadTcSinceFirstStartRaw; + long _tmp = (long) (nbBadTcSinceFirstStart()); + this.nbBadTcSinceFirstStartRaw = _tmp; + return this.nbBadTcSinceFirstStartRaw; + } + + private Integer spiCommandStatusRaw; + + public Integer spiCommandStatusRaw() { + if (this.spiCommandStatusRaw != null) return this.spiCommandStatusRaw; + int _tmp = (int) (spiCommandStatus()); + this.spiCommandStatusRaw = _tmp; + return this.spiCommandStatusRaw; + } + + private int dummy; + private int spiCommandStatus; + private int supervisorIndexOfSubsystem; + private int supervisorMajorVersion; + private int supervisorMinorVersion; + private int supervisorPatchVersion; + private long supervisorGitHeadVersion; + private int supervisorSerialNumber; + private byte[] compilationInformation; + private int clockSpeed; + private int codeType; + private int crc8; + private int swMmode; + private int lastResetReason; + private int reserved; + private int nbReset; + private int reserved2; + private int deployAntennasSystem; + private long nbTmSinceFirstStart; + private long nbTcSinceFirstStart; + private long nbBadTcSinceFirstStart; + private long nbTmInSdcard; + private int sdcardStatus; + private long sdcardLastError; + private long oldTimeTMInSdcard; + private long newTimeTMInSdcard; + private Uvsqsat _root; + private Uvsqsat.UiFrame _parent; + + public int dummy() { + return dummy; + } + + public int spiCommandStatus() { + return spiCommandStatus; + } + + public int supervisorIndexOfSubsystem() { + return supervisorIndexOfSubsystem; + } + + public int supervisorMajorVersion() { + return supervisorMajorVersion; + } + + public int supervisorMinorVersion() { + return supervisorMinorVersion; + } + + public int supervisorPatchVersion() { + return supervisorPatchVersion; + } + + public long supervisorGitHeadVersion() { + return supervisorGitHeadVersion; + } + + public int supervisorSerialNumber() { + return supervisorSerialNumber; + } + + public byte[] compilationInformation() { + return compilationInformation; + } + + public int clockSpeed() { + return clockSpeed; + } + + public int codeType() { + return codeType; + } + + public int crc8() { + return crc8; + } + + public int swMmode() { + return swMmode; + } + + public int lastResetReason() { + return lastResetReason; + } + + public int reserved() { + return reserved; + } + + public int nbReset() { + return nbReset; + } + + public int reserved2() { + return reserved2; + } + + public int deployAntennasSystem() { + return deployAntennasSystem; + } + + public long nbTmSinceFirstStart() { + return nbTmSinceFirstStart; + } + + public long nbTcSinceFirstStart() { + return nbTcSinceFirstStart; + } + + public long nbBadTcSinceFirstStart() { + return nbBadTcSinceFirstStart; + } + + public long nbTmInSdcard() { + return nbTmInSdcard; + } + + public int sdcardStatus() { + return sdcardStatus; + } + + public long sdcardLastError() { + return sdcardLastError; + } + + public long oldTimeTMInSdcard() { + return oldTimeTMInSdcard; + } + + public long newTimeTMInSdcard() { + return newTimeTMInSdcard; + } + + public Uvsqsat _root() { + return _root; + } + + public Uvsqsat.UiFrame _parent() { + return _parent; + } + } + + public static class SsidMask extends KaitaiStruct { + public static SsidMask fromFile(String fileName) throws IOException { + return new SsidMask(new ByteBufferKaitaiStream(fileName)); + } + + public SsidMask(KaitaiStream _io) { + this(_io, null, null); + } + + public SsidMask(KaitaiStream _io, Uvsqsat.Ax25Header _parent) { + this(_io, _parent, null); + } + + public SsidMask(KaitaiStream _io, Uvsqsat.Ax25Header _parent, Uvsqsat _root) { + super(_io); + this._parent = _parent; + this._root = _root; + _read(); + } + + private void _read() { + this.ssidMask = this._io.readU1(); + } + + private Integer ssid; + + public Integer ssid() { + if (this.ssid != null) return this.ssid; + int _tmp = (int) (((ssidMask() & 15) >> 1)); + this.ssid = _tmp; + return this.ssid; + } + + private int ssidMask; + private Uvsqsat _root; + private Uvsqsat.Ax25Header _parent; + + public int ssidMask() { + return ssidMask; + } + + public Uvsqsat _root() { + return _root; + } + + public Uvsqsat.Ax25Header _parent() { + return _parent; + } + } + + public static class Beacon extends KaitaiStruct { + public static Beacon fromFile(String fileName) throws IOException { + return new Beacon(new ByteBufferKaitaiStream(fileName)); + } + + public Beacon(KaitaiStream _io) { + this(_io, null, null); + } + + public Beacon(KaitaiStream _io, Uvsqsat.UiFrame _parent) { + this(_io, _parent, null); + } + + public Beacon(KaitaiStream _io, Uvsqsat.UiFrame _parent, Uvsqsat _root) { + super(_io); + this._parent = _parent; + this._root = _root; + _read(); + } + + private void _read() { + this.swMode = this._io.readU1(); + this.lastResetReason = this._io.readU1(); + this.resetOrder = this._io.readU1(); + this.nbReset = this._io.readU1(); + this.formatSdcardOrder = this._io.readU1(); + this.deployAntennasSystem = this._io.readU1(); + this.nbTmSinceFirstStart = this._io.readU4be(); + this.nbTcSinceFirstStart = this._io.readU4be(); + this.nbTcPingSinceFirstStart = this._io.readU4be(); + this.nbBadTcSinceFirstStart = this._io.readU4be(); + this.nbTmInSdcard = this._io.readU4be(); + this.trxvutxInstantaneousRfReflectedPowerFromTransmitterPort = this._io.readBitsInt(12); + this.trxvutxInstantaneousRfForwardPowerFromTransmitterPort = this._io.readBitsInt(12); + this.trxvutxSupplyVoltage = this._io.readBitsInt(12); + this.trxvutxTotalSupplyCurrent = this._io.readBitsInt(12); + this.trxvutxTransmitterCurrent = this._io.readBitsInt(12); + this.trxvutxReceiverCurrent = this._io.readBitsInt(12); + this.trxvutxPowerAmplifierCurrent = this._io.readBitsInt(12); + this.trxvutxPowerAmplifierTemperature = this._io.readBitsInt(12); + this.trxvutxLocalOscillatorTemperature = this._io.readBitsInt(12); + this.trxvurxInstantaneousReceivedSignalDopplerOffsetAtTheReceiverPort = + this._io.readBitsInt(12); + this.trxvurxInstantaneousReceivedSignalStrengthAtTheReceiverPort = this._io.readBitsInt(12); + this.trxvurxSupplyVoltage = this._io.readBitsInt(12); + this.trxvurxTotalSupplyCurrent = this._io.readBitsInt(12); + this.trxvurxTransmitterCurrent = this._io.readBitsInt(12); + this.trxvurxReceiverCurrent = this._io.readBitsInt(12); + this.trxvurxPowerAmplifierCurrent = this._io.readBitsInt(12); + this.trxvurxPowerAmplifierTemperature = this._io.readBitsInt(12); + this.trxvurxLocalOscillatorTemperature = this._io.readBitsInt(12); + this._io.alignToByte(); + this.imtqSystemStateMode = this._io.readU1(); + this.measureCoilXCurrent = this._io.readU2be(); + this.measureCoilYCurrent = this._io.readU2be(); + this.measureCoilZCurrent = this._io.readU2be(); + this.measureCoilXTemperature = this._io.readU2be(); + this.measureCoilYTemperature = this._io.readU2be(); + this.measureCoilZTemperature = this._io.readU2be(); + this.mcuTemperature = this._io.readU2be(); + this.sideAAntsTemperature = this._io.readU2be(); + this.sideAAntsDeploymentStatus = this._io.readU2be(); + this.voltBrdSupRaw = this._io.readU2be(); + this.tempRaw = this._io.readU2be(); + this.vDistInputRaw = this._io.readU2be(); + this.iDistInputRaw = this._io.readU2be(); + this.pDistInputRaw = this._io.readU2be(); + this.vBattInputRaw = this._io.readU2be(); + this.iBattInputRaw = this._io.readU2be(); + this.pBattInputRaw = this._io.readU2be(); + this.statObcOn = this._io.readU2be(); + this.statObcOcf = this._io.readU2be(); + this.batStat = this._io.readU2be(); + this.batTemp2Raw = this._io.readU2be(); + this.voltVd0 = this._io.readU2be(); + this.voltVd1 = this._io.readU2be(); + this.voltVd2 = this._io.readU2be(); + this.vObc00 = this._io.readU2be(); + this.iObc00 = this._io.readU2be(); + this.pObc00 = this._io.readU2be(); + this.vObc01 = this._io.readU2be(); + this.iObc01 = this._io.readU2be(); + this.pObc01 = this._io.readU2be(); + this.vObc02 = this._io.readU2be(); + this.iObc02 = this._io.readU2be(); + this.pObc02 = this._io.readU2be(); + this.vObc03 = this._io.readU2be(); + this.iObc03 = this._io.readU2be(); + this.pObc03 = this._io.readU2be(); + this.vObc05 = this._io.readU2be(); + this.iObc05 = this._io.readU2be(); + this.pObc05 = this._io.readU2be(); + this.vObc06 = this._io.readU2be(); + this.iObc06 = this._io.readU2be(); + this.pObc06 = this._io.readU2be(); + this.statusStid = this._io.readU1(); + this.statusIvid = this._io.readU1(); + this.statusRc = this._io.readU1(); + this.statusBid = this._io.readU1(); + this.statusCmderr = this._io.readBitsInt(4); + this.statusStat = this._io.readBitsInt(4); + this._io.alignToByte(); + this.mode = this._io.readU1(); + this.conf = this._io.readU1(); + this.resetCause = this._io.readU1(); + this.uptime = this._io.readU4be(); + this.error = this._io.readU2be(); + this.rcCntPwron = this._io.readU2be(); + this.rcCntWdg = this._io.readU2be(); + this.rcCntCmd = this._io.readU2be(); + this.rcCntMcu = this._io.readU2be(); + this.rcCntEmlopo = this._io.readU2be(); + this.prevcmdElapsed = this._io.readU2be(); + this.photodiode1 = this._io.readU2be(); + this.photodiode2 = this._io.readU2be(); + this.photodiode3 = this._io.readU2be(); + this.photodiode4 = this._io.readU2be(); + this.photodiode5 = this._io.readU2be(); + this.photodiode6 = this._io.readU2be(); + this.panelTemperature1 = this._io.readS4be(); + this.panelTemperature2 = this._io.readS4be(); + this.panelTemperature3 = this._io.readS4be(); + this.panelTemperature4 = this._io.readS4be(); + this.panelTemperature5 = this._io.readS4be(); + this.panelTemperature6 = this._io.readS4be(); + } + + private Double measureCoilYTemperatureC; + + public Double measureCoilYTemperatureC() { + if (this.measureCoilYTemperatureC != null) return this.measureCoilYTemperatureC; + double _tmp = + (double) ((((((2.5 / 4095) * measureCoilYTemperature()) - 1.567) * -1.0) / 0.0081)); + this.measureCoilYTemperatureC = _tmp; + return this.measureCoilYTemperatureC; + } + + private Integer rcCntPwronRaw; + + public Integer rcCntPwronRaw() { + if (this.rcCntPwronRaw != null) return this.rcCntPwronRaw; + int _tmp = (int) (rcCntPwron()); + this.rcCntPwronRaw = _tmp; + return this.rcCntPwronRaw; + } + + private Integer deployAntennasSystemRaw; + + /** : value Nominal = 0 No deploy = 0x11 Deployment Debug = 0xDB */ + public Integer deployAntennasSystemRaw() { + if (this.deployAntennasSystemRaw != null) return this.deployAntennasSystemRaw; + int _tmp = (int) (deployAntennasSystem()); + this.deployAntennasSystemRaw = _tmp; + return this.deployAntennasSystemRaw; + } + + private Double vDistInputRawV; + + public Double vDistInputRawV() { + if (this.vDistInputRawV != null) return this.vDistInputRawV; + double _tmp = (double) ((((vDistInputRaw() * 125.0) / 128.0) / 1000.0)); + this.vDistInputRawV = _tmp; + return this.vDistInputRawV; + } + + private Double iObc05Ma; + + public Double iObc05Ma() { + if (this.iObc05Ma != null) return this.iObc05Ma; + double _tmp = (double) (((iObc05() * 3125.0) / 20480.0)); + this.iObc05Ma = _tmp; + return this.iObc05Ma; + } + + private Double trxvutxTotalSupplyCurrentMa; + + public Double trxvutxTotalSupplyCurrentMa() { + if (this.trxvutxTotalSupplyCurrentMa != null) return this.trxvutxTotalSupplyCurrentMa; + double _tmp = (double) ((0.16643964 * trxvutxTotalSupplyCurrent())); + this.trxvutxTotalSupplyCurrentMa = _tmp; + return this.trxvutxTotalSupplyCurrentMa; + } + + private Integer lastResetReasonRaw; + + /** + * : last reset value First start = 0 TC Init received = 0x80 No TC since 4 days = 0x81 Unknown + * reason = 0x81 + */ + public Integer lastResetReasonRaw() { + if (this.lastResetReasonRaw != null) return this.lastResetReasonRaw; + int _tmp = (int) (lastResetReason()); + this.lastResetReasonRaw = _tmp; + return this.lastResetReasonRaw; + } + + private Double trxvutxPowerAmplifierCurrentMa; + + public Double trxvutxPowerAmplifierCurrentMa() { + if (this.trxvutxPowerAmplifierCurrentMa != null) return this.trxvutxPowerAmplifierCurrentMa; + double _tmp = (double) (((1000.0 * trxvutxPowerAmplifierCurrent()) * 0.16643964)); + this.trxvutxPowerAmplifierCurrentMa = _tmp; + return this.trxvutxPowerAmplifierCurrentMa; + } + + private Double trxvurxInstantaneousReceivedSignalStrengthDbm; + + public Double trxvurxInstantaneousReceivedSignalStrengthDbm() { + if (this.trxvurxInstantaneousReceivedSignalStrengthDbm != null) + return this.trxvurxInstantaneousReceivedSignalStrengthDbm; + double _tmp = + (double) (((trxvurxInstantaneousReceivedSignalStrengthAtTheReceiverPort() * 0.03) - 152)); + this.trxvurxInstantaneousReceivedSignalStrengthDbm = _tmp; + return this.trxvurxInstantaneousReceivedSignalStrengthDbm; + } + + private Double pObc05Mw; + + public Double pObc05Mw() { + if (this.pObc05Mw != null) return this.pObc05Mw; + double _tmp = (double) (((pObc05() * 3125.0) / 6400.0)); + this.pObc05Mw = _tmp; + return this.pObc05Mw; + } + + private Integer statObcOnRaw; + + /** bit n = 1 indicates the channel n is ON 9 firsts bits used */ + public Integer statObcOnRaw() { + if (this.statObcOnRaw != null) return this.statObcOnRaw; + int _tmp = (int) (statObcOn()); + this.statObcOnRaw = _tmp; + return this.statObcOnRaw; + } + + private Double panelTemperature6C; + + public Double panelTemperature6C() { + if (this.panelTemperature6C != null) return this.panelTemperature6C; + double _tmp = (double) ((panelTemperature6() / 1024.0)); + this.panelTemperature6C = _tmp; + return this.panelTemperature6C; + } + + private Long statusStatRaw; + + public Long statusStatRaw() { + if (this.statusStatRaw != null) return this.statusStatRaw; + long _tmp = (long) (statusStat()); + this.statusStatRaw = _tmp; + return this.statusStatRaw; + } + + private Double pObc00Mw; + + public Double pObc00Mw() { + if (this.pObc00Mw != null) return this.pObc00Mw; + double _tmp = (double) (((pObc00() * 3125.0) / 6400.0)); + this.pObc00Mw = _tmp; + return this.pObc00Mw; + } + + private Double trxvurxInstantaneousReceivedSignalDopplerHz; + + public Double trxvurxInstantaneousReceivedSignalDopplerHz() { + if (this.trxvurxInstantaneousReceivedSignalDopplerHz != null) + return this.trxvurxInstantaneousReceivedSignalDopplerHz; + double _tmp = + (double) + (((trxvurxInstantaneousReceivedSignalDopplerOffsetAtTheReceiverPort() * 13.552) + - 22300)); + this.trxvurxInstantaneousReceivedSignalDopplerHz = _tmp; + return this.trxvurxInstantaneousReceivedSignalDopplerHz; + } + + private Double vObc02V; + + public Double vObc02V() { + if (this.vObc02V != null) return this.vObc02V; + double _tmp = (double) ((((vObc02() * 125.0) / 128.0) / 1000.0)); + this.vObc02V = _tmp; + return this.vObc02V; + } + + private Integer nbResetRaw; + + public Integer nbResetRaw() { + if (this.nbResetRaw != null) return this.nbResetRaw; + int _tmp = (int) (nbReset()); + this.nbResetRaw = _tmp; + return this.nbResetRaw; + } + + private Double trxvurxSupplyVoltageV; + + public Double trxvurxSupplyVoltageV() { + if (this.trxvurxSupplyVoltageV != null) return this.trxvurxSupplyVoltageV; + double _tmp = (double) ((0.00488 * trxvurxSupplyVoltage())); + this.trxvurxSupplyVoltageV = _tmp; + return this.trxvurxSupplyVoltageV; + } + + private Double pObc06Mw; + + public Double pObc06Mw() { + if (this.pObc06Mw != null) return this.pObc06Mw; + double _tmp = (double) (((pObc06() * 3125.0) / 6400.0)); + this.pObc06Mw = _tmp; + return this.pObc06Mw; + } + + private Integer modeRaw; + + /** value : 0 = Startup 1 = Nominal 2 = Safety 3 = Emergency low power 8 */ + public Integer modeRaw() { + if (this.modeRaw != null) return this.modeRaw; + int _tmp = (int) (mode()); + this.modeRaw = _tmp; + return this.modeRaw; + } + + private Double trxvurxLocalOscillatorTemperatureC; + + public Double trxvurxLocalOscillatorTemperatureC() { + if (this.trxvurxLocalOscillatorTemperatureC != null) + return this.trxvurxLocalOscillatorTemperatureC; + double _tmp = (double) (((trxvurxLocalOscillatorTemperature() * -0.07669) + 195.6037)); + this.trxvurxLocalOscillatorTemperatureC = _tmp; + return this.trxvurxLocalOscillatorTemperatureC; + } + + private Long statusCmderrRaw; + + public Long statusCmderrRaw() { + if (this.statusCmderrRaw != null) return this.statusCmderrRaw; + long _tmp = (long) (statusCmderr()); + this.statusCmderrRaw = _tmp; + return this.statusCmderrRaw; + } + + private Integer photodiode1Raw; + + public Integer photodiode1Raw() { + if (this.photodiode1Raw != null) return this.photodiode1Raw; + int _tmp = (int) (photodiode1()); + this.photodiode1Raw = _tmp; + return this.photodiode1Raw; + } + + private Double pObc01Mw; + + public Double pObc01Mw() { + if (this.pObc01Mw != null) return this.pObc01Mw; + double _tmp = (double) (((pObc01() * 3125.0) / 6400.0)); + this.pObc01Mw = _tmp; + return this.pObc01Mw; + } + + private Integer photodiode5Raw; + + public Integer photodiode5Raw() { + if (this.photodiode5Raw != null) return this.photodiode5Raw; + int _tmp = (int) (photodiode5()); + this.photodiode5Raw = _tmp; + return this.photodiode5Raw; + } + + private Double trxvurxTransmitterCurrentMa; + + public Double trxvurxTransmitterCurrentMa() { + if (this.trxvurxTransmitterCurrentMa != null) return this.trxvurxTransmitterCurrentMa; + double _tmp = (double) ((trxvurxTransmitterCurrent() * 0.16643964)); + this.trxvurxTransmitterCurrentMa = _tmp; + return this.trxvurxTransmitterCurrentMa; + } + + private Integer rcCntCmdRaw; + + public Integer rcCntCmdRaw() { + if (this.rcCntCmdRaw != null) return this.rcCntCmdRaw; + int _tmp = (int) (rcCntCmd()); + this.rcCntCmdRaw = _tmp; + return this.rcCntCmdRaw; + } + + private Integer imtqSystemStateModeRaw; + + /** value : IDLE = 0 SELFTEST = 1 DETUMBLE = 2 */ + public Integer imtqSystemStateModeRaw() { + if (this.imtqSystemStateModeRaw != null) return this.imtqSystemStateModeRaw; + int _tmp = (int) (imtqSystemStateMode()); + this.imtqSystemStateModeRaw = _tmp; + return this.imtqSystemStateModeRaw; + } + + private Integer statObcOcfRaw; + + /** bit n = 1 indicates a overcurrent on the channel n 9 firsts bits used */ + public Integer statObcOcfRaw() { + if (this.statObcOcfRaw != null) return this.statObcOcfRaw; + int _tmp = (int) (statObcOcf()); + this.statObcOcfRaw = _tmp; + return this.statObcOcfRaw; + } + + private Double measureCoilZCurrentMa; + + public Double measureCoilZCurrentMa() { + if (this.measureCoilZCurrentMa != null) return this.measureCoilZCurrentMa; + double _tmp = (double) (((1000.0 * (((2.5 / 4095) * measureCoilZCurrent()) - 1.03)) / 0.48)); + this.measureCoilZCurrentMa = _tmp; + return this.measureCoilZCurrentMa; + } + + private Integer voltVd2Raw; + + public Integer voltVd2Raw() { + if (this.voltVd2Raw != null) return this.voltVd2Raw; + int _tmp = (int) (voltVd2()); + this.voltVd2Raw = _tmp; + return this.voltVd2Raw; + } + + private Long uptimeRaw; + + public Long uptimeRaw() { + if (this.uptimeRaw != null) return this.uptimeRaw; + long _tmp = (long) (uptime()); + this.uptimeRaw = _tmp; + return this.uptimeRaw; + } + + private Double voltBrdSupRawV; + + public Double voltBrdSupRawV() { + if (this.voltBrdSupRawV != null) return this.voltBrdSupRawV; + double _tmp = (double) (((voltBrdSupRaw() * 1000.0) / 819.0)); + this.voltBrdSupRawV = _tmp; + return this.voltBrdSupRawV; + } + + private Double measureCoilZTemperatureC; + + public Double measureCoilZTemperatureC() { + if (this.measureCoilZTemperatureC != null) return this.measureCoilZTemperatureC; + double _tmp = + (double) ((((((2.5 / 4095) * measureCoilZTemperature()) - 1.567) * -1.0) / 0.0081)); + this.measureCoilZTemperatureC = _tmp; + return this.measureCoilZTemperatureC; + } + + private Double iObc00Ma; + + public Double iObc00Ma() { + if (this.iObc00Ma != null) return this.iObc00Ma; + double _tmp = (double) (((iObc00() * 3125.0) / 20480.0)); + this.iObc00Ma = _tmp; + return this.iObc00Ma; + } + + private Integer rcCntWdgRaw; + + public Integer rcCntWdgRaw() { + if (this.rcCntWdgRaw != null) return this.rcCntWdgRaw; + int _tmp = (int) (rcCntWdg()); + this.rcCntWdgRaw = _tmp; + return this.rcCntWdgRaw; + } + + private Double pDistInputRawMw; + + public Double pDistInputRawMw() { + if (this.pDistInputRawMw != null) return this.pDistInputRawMw; + double _tmp = (double) (((pDistInputRaw() * 3125.0) / 3200.0)); + this.pDistInputRawMw = _tmp; + return this.pDistInputRawMw; + } + + private Double measureCoilXCurrentMa; + + public Double measureCoilXCurrentMa() { + if (this.measureCoilXCurrentMa != null) return this.measureCoilXCurrentMa; + double _tmp = (double) (((1000.0 * (((2.5 / 4095) * measureCoilXCurrent()) - 1.03)) / 2.0)); + this.measureCoilXCurrentMa = _tmp; + return this.measureCoilXCurrentMa; + } + + private Integer batStatRaw; + + public Integer batStatRaw() { + if (this.batStatRaw != null) return this.batStatRaw; + int _tmp = (int) (batStat()); + this.batStatRaw = _tmp; + return this.batStatRaw; + } + + private Integer resetOrderRaw; + + /** Order by TC = 0xCA No order = 0 */ + public Integer resetOrderRaw() { + if (this.resetOrderRaw != null) return this.resetOrderRaw; + int _tmp = (int) (resetOrder()); + this.resetOrderRaw = _tmp; + return this.resetOrderRaw; + } + + private Double trxvutxSupplyVoltageV; + + public Double trxvutxSupplyVoltageV() { + if (this.trxvutxSupplyVoltageV != null) return this.trxvutxSupplyVoltageV; + double _tmp = (double) ((0.00488 * trxvutxSupplyVoltage())); + this.trxvutxSupplyVoltageV = _tmp; + return this.trxvutxSupplyVoltageV; + } + + private Double vObc06V; + + public Double vObc06V() { + if (this.vObc06V != null) return this.vObc06V; + double _tmp = (double) ((((vObc06() * 125.0) / 128.0) / 1000.0)); + this.vObc06V = _tmp; + return this.vObc06V; + } + + private Double iObc03Ma; + + public Double iObc03Ma() { + if (this.iObc03Ma != null) return this.iObc03Ma; + double _tmp = (double) (((iObc03() * 3125.0) / 20480.0)); + this.iObc03Ma = _tmp; + return this.iObc03Ma; + } + + private Double vObc03V; + + public Double vObc03V() { + if (this.vObc03V != null) return this.vObc03V; + double _tmp = (double) ((((vObc03() * 125.0) / 128.0) / 1000.0)); + this.vObc03V = _tmp; + return this.vObc03V; + } + + private Double trxvutxInstantaneousRfReflectedPowerFromTransmitterPortMw; + + public Double trxvutxInstantaneousRfReflectedPowerFromTransmitterPortMw() { + if (this.trxvutxInstantaneousRfReflectedPowerFromTransmitterPortMw != null) + return this.trxvutxInstantaneousRfReflectedPowerFromTransmitterPortMw; + double _tmp = + (double) + (((((1000.0 * trxvutxInstantaneousRfReflectedPowerFromTransmitterPort()) + * trxvutxInstantaneousRfReflectedPowerFromTransmitterPort()) + * 5.887) + * 0.00001)); + this.trxvutxInstantaneousRfReflectedPowerFromTransmitterPortMw = _tmp; + return this.trxvutxInstantaneousRfReflectedPowerFromTransmitterPortMw; + } + + private Long nbTmSinceFirstStartRaw; + + public Long nbTmSinceFirstStartRaw() { + if (this.nbTmSinceFirstStartRaw != null) return this.nbTmSinceFirstStartRaw; + long _tmp = (long) (nbTmSinceFirstStart()); + this.nbTmSinceFirstStartRaw = _tmp; + return this.nbTmSinceFirstStartRaw; + } + + private Double iBattInputRawMa; + + public Double iBattInputRawMa() { + if (this.iBattInputRawMa != null) return this.iBattInputRawMa; + double _tmp = (double) ((1000.0 * ((iBattInputRaw() * 3125.0) / 10240.0))); + this.iBattInputRawMa = _tmp; + return this.iBattInputRawMa; + } + + private Double panelTemperature3C; + + public Double panelTemperature3C() { + if (this.panelTemperature3C != null) return this.panelTemperature3C; + double _tmp = (double) ((panelTemperature3() / 1024.0)); + this.panelTemperature3C = _tmp; + return this.panelTemperature3C; + } + + private Double trxvutxLocalOscillatorTemperatureC; + + public Double trxvutxLocalOscillatorTemperatureC() { + if (this.trxvutxLocalOscillatorTemperatureC != null) + return this.trxvutxLocalOscillatorTemperatureC; + double _tmp = (double) (((trxvutxLocalOscillatorTemperature() * -0.07669) + 195.6037)); + this.trxvutxLocalOscillatorTemperatureC = _tmp; + return this.trxvutxLocalOscillatorTemperatureC; + } + + private Integer photodiode2Raw; + + public Integer photodiode2Raw() { + if (this.photodiode2Raw != null) return this.photodiode2Raw; + int _tmp = (int) (photodiode2()); + this.photodiode2Raw = _tmp; + return this.photodiode2Raw; + } + + private Double iObc02Ma; + + public Double iObc02Ma() { + if (this.iObc02Ma != null) return this.iObc02Ma; + double _tmp = (double) (((iObc02() * 3125.0) / 20480.0)); + this.iObc02Ma = _tmp; + return this.iObc02Ma; + } + + private Integer statusStidRaw; + + public Integer statusStidRaw() { + if (this.statusStidRaw != null) return this.statusStidRaw; + int _tmp = (int) (statusStid()); + this.statusStidRaw = _tmp; + return this.statusStidRaw; + } + + private Double trxvutxInstantaneousRfForwardPowerFromTransmitterPortMw; + + public Double trxvutxInstantaneousRfForwardPowerFromTransmitterPortMw() { + if (this.trxvutxInstantaneousRfForwardPowerFromTransmitterPortMw != null) + return this.trxvutxInstantaneousRfForwardPowerFromTransmitterPortMw; + double _tmp = + (double) + (((((1000.0 * trxvutxInstantaneousRfForwardPowerFromTransmitterPort()) + * trxvutxInstantaneousRfForwardPowerFromTransmitterPort()) + * 5.887) + * 0.00001)); + this.trxvutxInstantaneousRfForwardPowerFromTransmitterPortMw = _tmp; + return this.trxvutxInstantaneousRfForwardPowerFromTransmitterPortMw; + } + + private Integer photodiode6Raw; + + public Integer photodiode6Raw() { + if (this.photodiode6Raw != null) return this.photodiode6Raw; + int _tmp = (int) (photodiode6()); + this.photodiode6Raw = _tmp; + return this.photodiode6Raw; + } + + private Double iObc06Ma; + + public Double iObc06Ma() { + if (this.iObc06Ma != null) return this.iObc06Ma; + double _tmp = (double) (((iObc06() * 3125.0) / 20480.0)); + this.iObc06Ma = _tmp; + return this.iObc06Ma; + } + + private Integer statusRcRaw; + + public Integer statusRcRaw() { + if (this.statusRcRaw != null) return this.statusRcRaw; + int _tmp = (int) (statusRc()); + this.statusRcRaw = _tmp; + return this.statusRcRaw; + } + + private Integer errorRaw; + + public Integer errorRaw() { + if (this.errorRaw != null) return this.errorRaw; + int _tmp = (int) (error()); + this.errorRaw = _tmp; + return this.errorRaw; + } + + private Double iDistInputRawMa; + + public Double iDistInputRawMa() { + if (this.iDistInputRawMa != null) return this.iDistInputRawMa; + double _tmp = (double) (((iDistInputRaw() * 3125.0) / 10240.0)); + this.iDistInputRawMa = _tmp; + return this.iDistInputRawMa; + } + + private Integer photodiode4Raw; + + public Integer photodiode4Raw() { + if (this.photodiode4Raw != null) return this.photodiode4Raw; + int _tmp = (int) (photodiode4()); + this.photodiode4Raw = _tmp; + return this.photodiode4Raw; + } + + private Double measureCoilYCurrentMa; + + public Double measureCoilYCurrentMa() { + if (this.measureCoilYCurrentMa != null) return this.measureCoilYCurrentMa; + double _tmp = (double) (((1000.0 * (((2.5 / 4095) * measureCoilYCurrent()) - 1.03)) / 2.0)); + this.measureCoilYCurrentMa = _tmp; + return this.measureCoilYCurrentMa; + } + + private Double vObc01V; + + public Double vObc01V() { + if (this.vObc01V != null) return this.vObc01V; + double _tmp = (double) ((((vObc01() * 125.0) / 128.0) / 1000.0)); + this.vObc01V = _tmp; + return this.vObc01V; + } + + private Double pBattInputRawMw; + + public Double pBattInputRawMw() { + if (this.pBattInputRawMw != null) return this.pBattInputRawMw; + double _tmp = (double) (((pBattInputRaw() * 3125.0) / 3200.0)); + this.pBattInputRawMw = _tmp; + return this.pBattInputRawMw; + } + + private Double iObc01Ma; + + public Double iObc01Ma() { + if (this.iObc01Ma != null) return this.iObc01Ma; + double _tmp = (double) (((iObc01() * 3125.0) / 20480.0)); + this.iObc01Ma = _tmp; + return this.iObc01Ma; + } + + private Long nbTmInSdcardRaw; + + public Long nbTmInSdcardRaw() { + if (this.nbTmInSdcardRaw != null) return this.nbTmInSdcardRaw; + long _tmp = (long) (nbTmInSdcard()); + this.nbTmInSdcardRaw = _tmp; + return this.nbTmInSdcardRaw; + } + + private Double tempRawT; + + public Double tempRawT() { + if (this.tempRawT != null) return this.tempRawT; + double _tmp = (double) (((((tempRaw() - 1168) * 220.0) / 9.0) / 100.0)); + this.tempRawT = _tmp; + return this.tempRawT; + } + + private Double panelTemperature4C; + + public Double panelTemperature4C() { + if (this.panelTemperature4C != null) return this.panelTemperature4C; + double _tmp = (double) ((panelTemperature4() / 1024.0)); + this.panelTemperature4C = _tmp; + return this.panelTemperature4C; + } + + private Integer photodiode3Raw; + + public Integer photodiode3Raw() { + if (this.photodiode3Raw != null) return this.photodiode3Raw; + int _tmp = (int) (photodiode3()); + this.photodiode3Raw = _tmp; + return this.photodiode3Raw; + } + + private Double trxvutxReceiverCurrentMa; + + public Double trxvutxReceiverCurrentMa() { + if (this.trxvutxReceiverCurrentMa != null) return this.trxvutxReceiverCurrentMa; + double _tmp = (double) ((trxvutxReceiverCurrent() * 0.16643964)); + this.trxvutxReceiverCurrentMa = _tmp; + return this.trxvutxReceiverCurrentMa; + } + + private Integer rcCntEmlopoRaw; + + public Integer rcCntEmlopoRaw() { + if (this.rcCntEmlopoRaw != null) return this.rcCntEmlopoRaw; + int _tmp = (int) (rcCntEmlopo()); + this.rcCntEmlopoRaw = _tmp; + return this.rcCntEmlopoRaw; + } + + private Integer rcCntMcuRaw; + + public Integer rcCntMcuRaw() { + if (this.rcCntMcuRaw != null) return this.rcCntMcuRaw; + int _tmp = (int) (rcCntMcu()); + this.rcCntMcuRaw = _tmp; + return this.rcCntMcuRaw; + } + + private Integer statusBidRaw; + + public Integer statusBidRaw() { + if (this.statusBidRaw != null) return this.statusBidRaw; + int _tmp = (int) (statusBid()); + this.statusBidRaw = _tmp; + return this.statusBidRaw; + } + + private Integer statusIvidRaw; + + public Integer statusIvidRaw() { + if (this.statusIvidRaw != null) return this.statusIvidRaw; + int _tmp = (int) (statusIvid()); + this.statusIvidRaw = _tmp; + return this.statusIvidRaw; + } + + private Double panelTemperature1C; + + public Double panelTemperature1C() { + if (this.panelTemperature1C != null) return this.panelTemperature1C; + double _tmp = (double) ((panelTemperature1() / 1024.0)); + this.panelTemperature1C = _tmp; + return this.panelTemperature1C; + } + + private Double pObc03Mw; + + public Double pObc03Mw() { + if (this.pObc03Mw != null) return this.pObc03Mw; + double _tmp = (double) (((pObc03() * 3125.0) / 6400.0)); + this.pObc03Mw = _tmp; + return this.pObc03Mw; + } + + private Integer voltVd1Raw; + + public Integer voltVd1Raw() { + if (this.voltVd1Raw != null) return this.voltVd1Raw; + int _tmp = (int) (voltVd1()); + this.voltVd1Raw = _tmp; + return this.voltVd1Raw; + } + + private Double trxvurxPowerAmplifierCurrentMa; + + public Double trxvurxPowerAmplifierCurrentMa() { + if (this.trxvurxPowerAmplifierCurrentMa != null) return this.trxvurxPowerAmplifierCurrentMa; + double _tmp = (double) (((1000.0 * trxvurxPowerAmplifierCurrent()) * 0.16643964)); + this.trxvurxPowerAmplifierCurrentMa = _tmp; + return this.trxvurxPowerAmplifierCurrentMa; + } + + private Double trxvurxTotalSupplyCurrentMa; + + public Double trxvurxTotalSupplyCurrentMa() { + if (this.trxvurxTotalSupplyCurrentMa != null) return this.trxvurxTotalSupplyCurrentMa; + double _tmp = (double) ((0.16643964 * trxvurxTotalSupplyCurrent())); + this.trxvurxTotalSupplyCurrentMa = _tmp; + return this.trxvurxTotalSupplyCurrentMa; + } + + private Double vObc05V; + + public Double vObc05V() { + if (this.vObc05V != null) return this.vObc05V; + double _tmp = (double) ((((vObc05() * 125.0) / 128.0) / 1000.0)); + this.vObc05V = _tmp; + return this.vObc05V; + } + + private Double trxvutxPowerAmplifierTemperatureC; + + public Double trxvutxPowerAmplifierTemperatureC() { + if (this.trxvutxPowerAmplifierTemperatureC != null) + return this.trxvutxPowerAmplifierTemperatureC; + double _tmp = (double) (((trxvutxPowerAmplifierTemperature() * -0.07669) + 195.6037)); + this.trxvutxPowerAmplifierTemperatureC = _tmp; + return this.trxvutxPowerAmplifierTemperatureC; + } + + private Long nbTcSinceFirstStartRaw; + + public Long nbTcSinceFirstStartRaw() { + if (this.nbTcSinceFirstStartRaw != null) return this.nbTcSinceFirstStartRaw; + long _tmp = (long) (nbTcSinceFirstStart()); + this.nbTcSinceFirstStartRaw = _tmp; + return this.nbTcSinceFirstStartRaw; + } + + private Double trxvutxTransmitterCurrentMa; + + public Double trxvutxTransmitterCurrentMa() { + if (this.trxvutxTransmitterCurrentMa != null) return this.trxvutxTransmitterCurrentMa; + double _tmp = (double) ((trxvutxTransmitterCurrent() * 0.16643964)); + this.trxvutxTransmitterCurrentMa = _tmp; + return this.trxvutxTransmitterCurrentMa; + } + + private Double mcuTemperatureC; + + public Double mcuTemperatureC() { + if (this.mcuTemperatureC != null) return this.mcuTemperatureC; + double _tmp = (double) ((((((2.5 / 4095) * mcuTemperature()) - 0.680) * -1.0) / 0.00225)); + this.mcuTemperatureC = _tmp; + return this.mcuTemperatureC; + } + + private Double vObc00V; + + public Double vObc00V() { + if (this.vObc00V != null) return this.vObc00V; + double _tmp = (double) ((((vObc00() * 125.0) / 128.0) / 1000.0)); + this.vObc00V = _tmp; + return this.vObc00V; + } + + private Long nbTcPingSinceFirstStartRaw; + + public Long nbTcPingSinceFirstStartRaw() { + if (this.nbTcPingSinceFirstStartRaw != null) return this.nbTcPingSinceFirstStartRaw; + long _tmp = (long) (nbTcPingSinceFirstStart()); + this.nbTcPingSinceFirstStartRaw = _tmp; + return this.nbTcPingSinceFirstStartRaw; + } + + private Integer voltVd0Raw; + + public Integer voltVd0Raw() { + if (this.voltVd0Raw != null) return this.voltVd0Raw; + int _tmp = (int) (voltVd0()); + this.voltVd0Raw = _tmp; + return this.voltVd0Raw; + } + + private Double batTemp2RawT; + + public Double batTemp2RawT() { + if (this.batTemp2RawT != null) return this.batTemp2RawT; + double _tmp = (double) (((batTemp2Raw() * -0.047715407918) + 98.38261483)); + this.batTemp2RawT = _tmp; + return this.batTemp2RawT; + } + + private Double vBattInputRawV; + + public Double vBattInputRawV() { + if (this.vBattInputRawV != null) return this.vBattInputRawV; + double _tmp = (double) ((((vBattInputRaw() * 125.0) / 128.0) / 1000.0)); + this.vBattInputRawV = _tmp; + return this.vBattInputRawV; + } + + private Double trxvurxPowerAmplifierTemperatureC; + + public Double trxvurxPowerAmplifierTemperatureC() { + if (this.trxvurxPowerAmplifierTemperatureC != null) + return this.trxvurxPowerAmplifierTemperatureC; + double _tmp = (double) (((trxvurxPowerAmplifierTemperature() * -0.07669) + 195.6037)); + this.trxvurxPowerAmplifierTemperatureC = _tmp; + return this.trxvurxPowerAmplifierTemperatureC; + } + + private Integer resetCauseRaw; + + /** + * value : 0 = Power-on; system returned from an unpowered state (e.g. power cycle). 1 = + * Watchdog; system was reset due to watchdog timeout, caused by a too-long delay between + * command interactions with the parent system. 2 = Commanded; system was reset after having + * received a reset command. 3 = Control system reset; an upset in the EPS control system caused + * a reset. 4 = Emlopo; emergency low power mode was engaged because the input voltage dropped + * below the threshold. + */ + public Integer resetCauseRaw() { + if (this.resetCauseRaw != null) return this.resetCauseRaw; + int _tmp = (int) (resetCause()); + this.resetCauseRaw = _tmp; + return this.resetCauseRaw; + } + + private Long nbBadTcSinceFirstStartRaw; + + public Long nbBadTcSinceFirstStartRaw() { + if (this.nbBadTcSinceFirstStartRaw != null) return this.nbBadTcSinceFirstStartRaw; + long _tmp = (long) (nbBadTcSinceFirstStart()); + this.nbBadTcSinceFirstStartRaw = _tmp; + return this.nbBadTcSinceFirstStartRaw; + } + + private Double pObc02Mw; + + public Double pObc02Mw() { + if (this.pObc02Mw != null) return this.pObc02Mw; + double _tmp = (double) (((pObc02() * 3125.0) / 6400.0)); + this.pObc02Mw = _tmp; + return this.pObc02Mw; + } + + private Integer swModeRaw; + + /** + * : mode value MODE_INIT = 0 MODE_DETUMBLING = 1 MODE_STANDBY = 2 MODE_OPERATIONAL = 3 + * MODE_SAFE = 4 MODE_TRANSPONDER = 5 + */ + public Integer swModeRaw() { + if (this.swModeRaw != null) return this.swModeRaw; + int _tmp = (int) (swMode()); + this.swModeRaw = _tmp; + return this.swModeRaw; + } + + private Integer sideAAntsTemperatureRaw; + + public Integer sideAAntsTemperatureRaw() { + if (this.sideAAntsTemperatureRaw != null) return this.sideAAntsTemperatureRaw; + int _tmp = (int) (sideAAntsTemperature()); + this.sideAAntsTemperatureRaw = _tmp; + return this.sideAAntsTemperatureRaw; + } + + private Double panelTemperature5C; + + public Double panelTemperature5C() { + if (this.panelTemperature5C != null) return this.panelTemperature5C; + double _tmp = (double) ((panelTemperature5() / 1024.0)); + this.panelTemperature5C = _tmp; + return this.panelTemperature5C; + } + + private Integer sideAAntsDeploymentStatusRaw; + + public Integer sideAAntsDeploymentStatusRaw() { + if (this.sideAAntsDeploymentStatusRaw != null) return this.sideAAntsDeploymentStatusRaw; + int _tmp = (int) (sideAAntsDeploymentStatus()); + this.sideAAntsDeploymentStatusRaw = _tmp; + return this.sideAAntsDeploymentStatusRaw; + } + + private Double measureCoilXTemperatureC; + + public Double measureCoilXTemperatureC() { + if (this.measureCoilXTemperatureC != null) return this.measureCoilXTemperatureC; + double _tmp = + (double) ((((((2.5 / 4095) * measureCoilXTemperature()) - 1.567) * -1.0) / 0.0081)); + this.measureCoilXTemperatureC = _tmp; + return this.measureCoilXTemperatureC; + } + + private Integer confRaw; + + /** + * value : 0 = Parameters have not been altered since the last load/save. 1 = Parameters have + * been altered since the last load/save. + */ + public Integer confRaw() { + if (this.confRaw != null) return this.confRaw; + int _tmp = (int) (conf()); + this.confRaw = _tmp; + return this.confRaw; + } + + private Integer formatSdcardOrderRaw; + + /** + * Order to Format SdCard 0 = 0 Order to Format SdCard 1 = 1 Order to NOT Format SdCard 0 = 0xAC + * Order to NOT Format SdCard 1 = 0xAD + */ + public Integer formatSdcardOrderRaw() { + if (this.formatSdcardOrderRaw != null) return this.formatSdcardOrderRaw; + int _tmp = (int) (formatSdcardOrder()); + this.formatSdcardOrderRaw = _tmp; + return this.formatSdcardOrderRaw; + } + + private Double panelTemperature2C; + + public Double panelTemperature2C() { + if (this.panelTemperature2C != null) return this.panelTemperature2C; + double _tmp = (double) ((panelTemperature2() / 1024.0)); + this.panelTemperature2C = _tmp; + return this.panelTemperature2C; + } + + private Double trxvurxReceiverCurrentMa; + + public Double trxvurxReceiverCurrentMa() { + if (this.trxvurxReceiverCurrentMa != null) return this.trxvurxReceiverCurrentMa; + double _tmp = (double) ((trxvurxReceiverCurrent() * 0.16643964)); + this.trxvurxReceiverCurrentMa = _tmp; + return this.trxvurxReceiverCurrentMa; + } + + private Integer prevcmdElapsedRaw; + + public Integer prevcmdElapsedRaw() { + if (this.prevcmdElapsedRaw != null) return this.prevcmdElapsedRaw; + int _tmp = (int) (prevcmdElapsed()); + this.prevcmdElapsedRaw = _tmp; + return this.prevcmdElapsedRaw; + } + + private int swMode; + private int lastResetReason; + private int resetOrder; + private int nbReset; + private int formatSdcardOrder; + private int deployAntennasSystem; + private long nbTmSinceFirstStart; + private long nbTcSinceFirstStart; + private long nbTcPingSinceFirstStart; + private long nbBadTcSinceFirstStart; + private long nbTmInSdcard; + private long trxvutxInstantaneousRfReflectedPowerFromTransmitterPort; + private long trxvutxInstantaneousRfForwardPowerFromTransmitterPort; + private long trxvutxSupplyVoltage; + private long trxvutxTotalSupplyCurrent; + private long trxvutxTransmitterCurrent; + private long trxvutxReceiverCurrent; + private long trxvutxPowerAmplifierCurrent; + private long trxvutxPowerAmplifierTemperature; + private long trxvutxLocalOscillatorTemperature; + private long trxvurxInstantaneousReceivedSignalDopplerOffsetAtTheReceiverPort; + private long trxvurxInstantaneousReceivedSignalStrengthAtTheReceiverPort; + private long trxvurxSupplyVoltage; + private long trxvurxTotalSupplyCurrent; + private long trxvurxTransmitterCurrent; + private long trxvurxReceiverCurrent; + private long trxvurxPowerAmplifierCurrent; + private long trxvurxPowerAmplifierTemperature; + private long trxvurxLocalOscillatorTemperature; + private int imtqSystemStateMode; + private int measureCoilXCurrent; + private int measureCoilYCurrent; + private int measureCoilZCurrent; + private int measureCoilXTemperature; + private int measureCoilYTemperature; + private int measureCoilZTemperature; + private int mcuTemperature; + private int sideAAntsTemperature; + private int sideAAntsDeploymentStatus; + private int voltBrdSupRaw; + private int tempRaw; + private int vDistInputRaw; + private int iDistInputRaw; + private int pDistInputRaw; + private int vBattInputRaw; + private int iBattInputRaw; + private int pBattInputRaw; + private int statObcOn; + private int statObcOcf; + private int batStat; + private int batTemp2Raw; + private int voltVd0; + private int voltVd1; + private int voltVd2; + private int vObc00; + private int iObc00; + private int pObc00; + private int vObc01; + private int iObc01; + private int pObc01; + private int vObc02; + private int iObc02; + private int pObc02; + private int vObc03; + private int iObc03; + private int pObc03; + private int vObc05; + private int iObc05; + private int pObc05; + private int vObc06; + private int iObc06; + private int pObc06; + private int statusStid; + private int statusIvid; + private int statusRc; + private int statusBid; + private long statusCmderr; + private long statusStat; + private int mode; + private int conf; + private int resetCause; + private long uptime; + private int error; + private int rcCntPwron; + private int rcCntWdg; + private int rcCntCmd; + private int rcCntMcu; + private int rcCntEmlopo; + private int prevcmdElapsed; + private int photodiode1; + private int photodiode2; + private int photodiode3; + private int photodiode4; + private int photodiode5; + private int photodiode6; + private int panelTemperature1; + private int panelTemperature2; + private int panelTemperature3; + private int panelTemperature4; + private int panelTemperature5; + private int panelTemperature6; + private Uvsqsat _root; + private Uvsqsat.UiFrame _parent; + + public int swMode() { + return swMode; + } + + public int lastResetReason() { + return lastResetReason; + } + + public int resetOrder() { + return resetOrder; + } + + public int nbReset() { + return nbReset; + } + + public int formatSdcardOrder() { + return formatSdcardOrder; + } + + public int deployAntennasSystem() { + return deployAntennasSystem; + } + + public long nbTmSinceFirstStart() { + return nbTmSinceFirstStart; + } + + public long nbTcSinceFirstStart() { + return nbTcSinceFirstStart; + } + + public long nbTcPingSinceFirstStart() { + return nbTcPingSinceFirstStart; + } + + public long nbBadTcSinceFirstStart() { + return nbBadTcSinceFirstStart; + } + + public long nbTmInSdcard() { + return nbTmInSdcard; + } + + public long trxvutxInstantaneousRfReflectedPowerFromTransmitterPort() { + return trxvutxInstantaneousRfReflectedPowerFromTransmitterPort; + } + + public long trxvutxInstantaneousRfForwardPowerFromTransmitterPort() { + return trxvutxInstantaneousRfForwardPowerFromTransmitterPort; + } + + public long trxvutxSupplyVoltage() { + return trxvutxSupplyVoltage; + } + + public long trxvutxTotalSupplyCurrent() { + return trxvutxTotalSupplyCurrent; + } + + public long trxvutxTransmitterCurrent() { + return trxvutxTransmitterCurrent; + } + + public long trxvutxReceiverCurrent() { + return trxvutxReceiverCurrent; + } + + public long trxvutxPowerAmplifierCurrent() { + return trxvutxPowerAmplifierCurrent; + } + + public long trxvutxPowerAmplifierTemperature() { + return trxvutxPowerAmplifierTemperature; + } + + public long trxvutxLocalOscillatorTemperature() { + return trxvutxLocalOscillatorTemperature; + } + + public long trxvurxInstantaneousReceivedSignalDopplerOffsetAtTheReceiverPort() { + return trxvurxInstantaneousReceivedSignalDopplerOffsetAtTheReceiverPort; + } + + public long trxvurxInstantaneousReceivedSignalStrengthAtTheReceiverPort() { + return trxvurxInstantaneousReceivedSignalStrengthAtTheReceiverPort; + } + + public long trxvurxSupplyVoltage() { + return trxvurxSupplyVoltage; + } + + public long trxvurxTotalSupplyCurrent() { + return trxvurxTotalSupplyCurrent; + } + + public long trxvurxTransmitterCurrent() { + return trxvurxTransmitterCurrent; + } + + public long trxvurxReceiverCurrent() { + return trxvurxReceiverCurrent; + } + + public long trxvurxPowerAmplifierCurrent() { + return trxvurxPowerAmplifierCurrent; + } + + public long trxvurxPowerAmplifierTemperature() { + return trxvurxPowerAmplifierTemperature; + } + + public long trxvurxLocalOscillatorTemperature() { + return trxvurxLocalOscillatorTemperature; + } + + public int imtqSystemStateMode() { + return imtqSystemStateMode; + } + + public int measureCoilXCurrent() { + return measureCoilXCurrent; + } + + public int measureCoilYCurrent() { + return measureCoilYCurrent; + } + + public int measureCoilZCurrent() { + return measureCoilZCurrent; + } + + public int measureCoilXTemperature() { + return measureCoilXTemperature; + } + + public int measureCoilYTemperature() { + return measureCoilYTemperature; + } + + public int measureCoilZTemperature() { + return measureCoilZTemperature; + } + + public int mcuTemperature() { + return mcuTemperature; + } + + public int sideAAntsTemperature() { + return sideAAntsTemperature; + } + + public int sideAAntsDeploymentStatus() { + return sideAAntsDeploymentStatus; + } + + public int voltBrdSupRaw() { + return voltBrdSupRaw; + } + + public int tempRaw() { + return tempRaw; + } + + public int vDistInputRaw() { + return vDistInputRaw; + } + + public int iDistInputRaw() { + return iDistInputRaw; + } + + public int pDistInputRaw() { + return pDistInputRaw; + } + + public int vBattInputRaw() { + return vBattInputRaw; + } + + public int iBattInputRaw() { + return iBattInputRaw; + } + + public int pBattInputRaw() { + return pBattInputRaw; + } + + public int statObcOn() { + return statObcOn; + } + + public int statObcOcf() { + return statObcOcf; + } + + public int batStat() { + return batStat; + } + + public int batTemp2Raw() { + return batTemp2Raw; + } + + public int voltVd0() { + return voltVd0; + } + + public int voltVd1() { + return voltVd1; + } + + public int voltVd2() { + return voltVd2; + } + + public int vObc00() { + return vObc00; + } + + public int iObc00() { + return iObc00; + } + + public int pObc00() { + return pObc00; + } + + public int vObc01() { + return vObc01; + } + + public int iObc01() { + return iObc01; + } + + public int pObc01() { + return pObc01; + } + + public int vObc02() { + return vObc02; + } + + public int iObc02() { + return iObc02; + } + + public int pObc02() { + return pObc02; + } + + public int vObc03() { + return vObc03; + } + + public int iObc03() { + return iObc03; + } + + public int pObc03() { + return pObc03; + } + + public int vObc05() { + return vObc05; + } + + public int iObc05() { + return iObc05; + } + + public int pObc05() { + return pObc05; + } + + public int vObc06() { + return vObc06; + } + + public int iObc06() { + return iObc06; + } + + public int pObc06() { + return pObc06; + } + + public int statusStid() { + return statusStid; + } + + public int statusIvid() { + return statusIvid; + } + + public int statusRc() { + return statusRc; + } + + public int statusBid() { + return statusBid; + } + + public long statusCmderr() { + return statusCmderr; + } + + public long statusStat() { + return statusStat; + } + + public int mode() { + return mode; + } + + public int conf() { + return conf; + } + + public int resetCause() { + return resetCause; + } + + public long uptime() { + return uptime; + } + + public int error() { + return error; + } + + public int rcCntPwron() { + return rcCntPwron; + } + + public int rcCntWdg() { + return rcCntWdg; + } + + public int rcCntCmd() { + return rcCntCmd; + } + + public int rcCntMcu() { + return rcCntMcu; + } + + public int rcCntEmlopo() { + return rcCntEmlopo; + } + + public int prevcmdElapsed() { + return prevcmdElapsed; + } + + public int photodiode1() { + return photodiode1; + } + + public int photodiode2() { + return photodiode2; + } + + public int photodiode3() { + return photodiode3; + } + + public int photodiode4() { + return photodiode4; + } + + public int photodiode5() { + return photodiode5; + } + + public int photodiode6() { + return photodiode6; + } + + public int panelTemperature1() { + return panelTemperature1; + } + + public int panelTemperature2() { + return panelTemperature2; + } + + public int panelTemperature3() { + return panelTemperature3; + } + + public int panelTemperature4() { + return panelTemperature4; + } + + public int panelTemperature5() { + return panelTemperature5; + } + + public int panelTemperature6() { + return panelTemperature6; + } + + public Uvsqsat _root() { + return _root; + } + + public Uvsqsat.UiFrame _parent() { + return _parent; + } + } + + public static class ObcHk extends KaitaiStruct { + public static ObcHk fromFile(String fileName) throws IOException { + return new ObcHk(new ByteBufferKaitaiStream(fileName)); + } + + public ObcHk(KaitaiStream _io) { + this(_io, null, null); + } + + public ObcHk(KaitaiStream _io, Uvsqsat.UiFrame _parent) { + this(_io, _parent, null); + } + + public ObcHk(KaitaiStream _io, Uvsqsat.UiFrame _parent, Uvsqsat _root) { + super(_io); + this._parent = _parent; + this._root = _root; + _read(); + } + + private void _read() { + this.dummy = this._io.readU1(); + this.spiCommandStatus = this._io.readU1(); + this.supervisorEnableStatus = this._io.readU1(); + this.supervisorUptime = this._io.readU4be(); + this.iobcUptime = this._io.readU4be(); + this.iobcResetCount = this._io.readU4be(); + this.iobcMeasureTemperature = this._io.readU2be(); + this.iobcMeasure3v3In = this._io.readU2be(); + this.iobcMeasure3v3 = this._io.readU2be(); + this.iobcMeasure2vReference = this._io.readU2be(); + this.iobcMeasure1v8 = this._io.readU2be(); + this.iobcMeasure1v0 = this._io.readU2be(); + this.iobcMeasureCurrent3v3 = this._io.readU2be(); + this.iobcMeasureCurrent1v8 = this._io.readU2be(); + this.iobcMeasureCurrent1v0 = this._io.readU2be(); + this.iobcMeasureVoltRtc = this._io.readU2be(); + this.iobcAdcUpdateFlag = this._io.readU1(); + this.iobcCrc8 = this._io.readU1(); + this.photodiode1 = this._io.readU2be(); + this.photodiode2 = this._io.readU2be(); + this.photodiode3 = this._io.readU2be(); + this.photodiode4 = this._io.readU2be(); + this.photodiode5 = this._io.readU2be(); + this.photodiode6 = this._io.readU2be(); + this.panelTemperature1 = this._io.readS4be(); + this.panelTemperature2 = this._io.readS4be(); + this.panelTemperature3 = this._io.readS4be(); + this.panelTemperature4 = this._io.readS4be(); + this.panelTemperature5 = this._io.readS4be(); + this.panelTemperature6 = this._io.readS4be(); + } + + private Double panelTemperature6C; + + public Double panelTemperature6C() { + if (this.panelTemperature6C != null) return this.panelTemperature6C; + double _tmp = (double) ((panelTemperature6() / 1024.0)); + this.panelTemperature6C = _tmp; + return this.panelTemperature6C; + } + + private Integer iobcMeasureTemperatureRaw; + + public Integer iobcMeasureTemperatureRaw() { + if (this.iobcMeasureTemperatureRaw != null) return this.iobcMeasureTemperatureRaw; + int _tmp = (int) (iobcMeasureTemperature()); + this.iobcMeasureTemperatureRaw = _tmp; + return this.iobcMeasureTemperatureRaw; + } + + private Long supervisorUptimeRaw; + + public Long supervisorUptimeRaw() { + if (this.supervisorUptimeRaw != null) return this.supervisorUptimeRaw; + long _tmp = (long) (supervisorUptime()); + this.supervisorUptimeRaw = _tmp; + return this.supervisorUptimeRaw; + } + + private Integer supervisorEnableStatusRaw; + + public Integer supervisorEnableStatusRaw() { + if (this.supervisorEnableStatusRaw != null) return this.supervisorEnableStatusRaw; + int _tmp = (int) (supervisorEnableStatus()); + this.supervisorEnableStatusRaw = _tmp; + return this.supervisorEnableStatusRaw; + } + + private Integer iobcMeasure3v3InRaw; + + public Integer iobcMeasure3v3InRaw() { + if (this.iobcMeasure3v3InRaw != null) return this.iobcMeasure3v3InRaw; + int _tmp = (int) (iobcMeasure3v3In()); + this.iobcMeasure3v3InRaw = _tmp; + return this.iobcMeasure3v3InRaw; + } + + private Integer photodiode2Raw; + + public Integer photodiode2Raw() { + if (this.photodiode2Raw != null) return this.photodiode2Raw; + int _tmp = (int) (photodiode2()); + this.photodiode2Raw = _tmp; + return this.photodiode2Raw; + } + + private Integer iobcMeasureCurrent1v0Raw; + + public Integer iobcMeasureCurrent1v0Raw() { + if (this.iobcMeasureCurrent1v0Raw != null) return this.iobcMeasureCurrent1v0Raw; + int _tmp = (int) (iobcMeasureCurrent1v0()); + this.iobcMeasureCurrent1v0Raw = _tmp; + return this.iobcMeasureCurrent1v0Raw; + } + + private Double panelTemperature3C; + + public Double panelTemperature3C() { + if (this.panelTemperature3C != null) return this.panelTemperature3C; + double _tmp = (double) ((panelTemperature3() / 1024.0)); + this.panelTemperature3C = _tmp; + return this.panelTemperature3C; + } + + private Integer dummyRaw; + + public Integer dummyRaw() { + if (this.dummyRaw != null) return this.dummyRaw; + int _tmp = (int) (dummy()); + this.dummyRaw = _tmp; + return this.dummyRaw; + } + + private Integer iobcMeasureVoltRtcRaw; + + public Integer iobcMeasureVoltRtcRaw() { + if (this.iobcMeasureVoltRtcRaw != null) return this.iobcMeasureVoltRtcRaw; + int _tmp = (int) (iobcMeasureVoltRtc()); + this.iobcMeasureVoltRtcRaw = _tmp; + return this.iobcMeasureVoltRtcRaw; + } + + private Integer iobcMeasure1v8Raw; + + public Integer iobcMeasure1v8Raw() { + if (this.iobcMeasure1v8Raw != null) return this.iobcMeasure1v8Raw; + int _tmp = (int) (iobcMeasure1v8()); + this.iobcMeasure1v8Raw = _tmp; + return this.iobcMeasure1v8Raw; + } + + private Integer iobcMeasure2vReferenceRaw; + + public Integer iobcMeasure2vReferenceRaw() { + if (this.iobcMeasure2vReferenceRaw != null) return this.iobcMeasure2vReferenceRaw; + int _tmp = (int) (iobcMeasure2vReference()); + this.iobcMeasure2vReferenceRaw = _tmp; + return this.iobcMeasure2vReferenceRaw; + } + + private Integer iobcMeasureCurrent1v8Raw; + + public Integer iobcMeasureCurrent1v8Raw() { + if (this.iobcMeasureCurrent1v8Raw != null) return this.iobcMeasureCurrent1v8Raw; + int _tmp = (int) (iobcMeasureCurrent1v8()); + this.iobcMeasureCurrent1v8Raw = _tmp; + return this.iobcMeasureCurrent1v8Raw; + } + + private Integer iobcMeasure3v3Raw; + + public Integer iobcMeasure3v3Raw() { + if (this.iobcMeasure3v3Raw != null) return this.iobcMeasure3v3Raw; + int _tmp = (int) (iobcMeasure3v3()); + this.iobcMeasure3v3Raw = _tmp; + return this.iobcMeasure3v3Raw; + } + + private Integer photodiode6Raw; + + public Integer photodiode6Raw() { + if (this.photodiode6Raw != null) return this.photodiode6Raw; + int _tmp = (int) (photodiode6()); + this.photodiode6Raw = _tmp; + return this.photodiode6Raw; + } + + private Double panelTemperature4C; + + public Double panelTemperature4C() { + if (this.panelTemperature4C != null) return this.panelTemperature4C; + double _tmp = (double) ((panelTemperature4() / 1024.0)); + this.panelTemperature4C = _tmp; + return this.panelTemperature4C; + } + + private Double panelTemperature1C; + + public Double panelTemperature1C() { + if (this.panelTemperature1C != null) return this.panelTemperature1C; + double _tmp = (double) ((panelTemperature1() / 1024.0)); + this.panelTemperature1C = _tmp; + return this.panelTemperature1C; + } + + private Integer iobcAdcUpdateFlagRaw; + + public Integer iobcAdcUpdateFlagRaw() { + if (this.iobcAdcUpdateFlagRaw != null) return this.iobcAdcUpdateFlagRaw; + int _tmp = (int) (iobcAdcUpdateFlag()); + this.iobcAdcUpdateFlagRaw = _tmp; + return this.iobcAdcUpdateFlagRaw; + } + + private Integer photodiode4Raw; + + public Integer photodiode4Raw() { + if (this.photodiode4Raw != null) return this.photodiode4Raw; + int _tmp = (int) (photodiode4()); + this.photodiode4Raw = _tmp; + return this.photodiode4Raw; + } + + private Long iobcResetCountRaw; + + public Long iobcResetCountRaw() { + if (this.iobcResetCountRaw != null) return this.iobcResetCountRaw; + long _tmp = (long) (iobcResetCount()); + this.iobcResetCountRaw = _tmp; + return this.iobcResetCountRaw; + } + + private Long iobcUptimeRaw; + + public Long iobcUptimeRaw() { + if (this.iobcUptimeRaw != null) return this.iobcUptimeRaw; + long _tmp = (long) (iobcUptime()); + this.iobcUptimeRaw = _tmp; + return this.iobcUptimeRaw; + } + + private Integer photodiode3Raw; + + public Integer photodiode3Raw() { + if (this.photodiode3Raw != null) return this.photodiode3Raw; + int _tmp = (int) (photodiode3()); + this.photodiode3Raw = _tmp; + return this.photodiode3Raw; + } + + private Integer photodiode5Raw; + + public Integer photodiode5Raw() { + if (this.photodiode5Raw != null) return this.photodiode5Raw; + int _tmp = (int) (photodiode5()); + this.photodiode5Raw = _tmp; + return this.photodiode5Raw; + } + + private Double panelTemperature5C; + + public Double panelTemperature5C() { + if (this.panelTemperature5C != null) return this.panelTemperature5C; + double _tmp = (double) ((panelTemperature5() / 1024.0)); + this.panelTemperature5C = _tmp; + return this.panelTemperature5C; + } + + private Integer iobcMeasure1v0Raw; + + public Integer iobcMeasure1v0Raw() { + if (this.iobcMeasure1v0Raw != null) return this.iobcMeasure1v0Raw; + int _tmp = (int) (iobcMeasure1v0()); + this.iobcMeasure1v0Raw = _tmp; + return this.iobcMeasure1v0Raw; + } + + private Integer iobcCrc8Raw; + + public Integer iobcCrc8Raw() { + if (this.iobcCrc8Raw != null) return this.iobcCrc8Raw; + int _tmp = (int) (iobcCrc8()); + this.iobcCrc8Raw = _tmp; + return this.iobcCrc8Raw; + } + + private Integer photodiode1Raw; + + public Integer photodiode1Raw() { + if (this.photodiode1Raw != null) return this.photodiode1Raw; + int _tmp = (int) (photodiode1()); + this.photodiode1Raw = _tmp; + return this.photodiode1Raw; + } + + private Integer spiCommandStatusRaw; + + public Integer spiCommandStatusRaw() { + if (this.spiCommandStatusRaw != null) return this.spiCommandStatusRaw; + int _tmp = (int) (spiCommandStatus()); + this.spiCommandStatusRaw = _tmp; + return this.spiCommandStatusRaw; + } + + private Integer iobcMeasureCurrent3v3Raw; + + public Integer iobcMeasureCurrent3v3Raw() { + if (this.iobcMeasureCurrent3v3Raw != null) return this.iobcMeasureCurrent3v3Raw; + int _tmp = (int) (iobcMeasureCurrent3v3()); + this.iobcMeasureCurrent3v3Raw = _tmp; + return this.iobcMeasureCurrent3v3Raw; + } + + private Double panelTemperature2C; + + public Double panelTemperature2C() { + if (this.panelTemperature2C != null) return this.panelTemperature2C; + double _tmp = (double) ((panelTemperature2() / 1024.0)); + this.panelTemperature2C = _tmp; + return this.panelTemperature2C; + } + + private int dummy; + private int spiCommandStatus; + private int supervisorEnableStatus; + private long supervisorUptime; + private long iobcUptime; + private long iobcResetCount; + private int iobcMeasureTemperature; + private int iobcMeasure3v3In; + private int iobcMeasure3v3; + private int iobcMeasure2vReference; + private int iobcMeasure1v8; + private int iobcMeasure1v0; + private int iobcMeasureCurrent3v3; + private int iobcMeasureCurrent1v8; + private int iobcMeasureCurrent1v0; + private int iobcMeasureVoltRtc; + private int iobcAdcUpdateFlag; + private int iobcCrc8; + private int photodiode1; + private int photodiode2; + private int photodiode3; + private int photodiode4; + private int photodiode5; + private int photodiode6; + private int panelTemperature1; + private int panelTemperature2; + private int panelTemperature3; + private int panelTemperature4; + private int panelTemperature5; + private int panelTemperature6; + private Uvsqsat _root; + private Uvsqsat.UiFrame _parent; + + public int dummy() { + return dummy; + } + + public int spiCommandStatus() { + return spiCommandStatus; + } + + public int supervisorEnableStatus() { + return supervisorEnableStatus; + } + + public long supervisorUptime() { + return supervisorUptime; + } + + public long iobcUptime() { + return iobcUptime; + } + + public long iobcResetCount() { + return iobcResetCount; + } + + public int iobcMeasureTemperature() { + return iobcMeasureTemperature; + } + + public int iobcMeasure3v3In() { + return iobcMeasure3v3In; + } + + public int iobcMeasure3v3() { + return iobcMeasure3v3; + } + + public int iobcMeasure2vReference() { + return iobcMeasure2vReference; + } + + public int iobcMeasure1v8() { + return iobcMeasure1v8; + } + + public int iobcMeasure1v0() { + return iobcMeasure1v0; + } + + public int iobcMeasureCurrent3v3() { + return iobcMeasureCurrent3v3; + } + + public int iobcMeasureCurrent1v8() { + return iobcMeasureCurrent1v8; + } + + public int iobcMeasureCurrent1v0() { + return iobcMeasureCurrent1v0; + } + + public int iobcMeasureVoltRtc() { + return iobcMeasureVoltRtc; + } + + public int iobcAdcUpdateFlag() { + return iobcAdcUpdateFlag; + } + + public int iobcCrc8() { + return iobcCrc8; + } + + public int photodiode1() { + return photodiode1; + } + + public int photodiode2() { + return photodiode2; + } + + public int photodiode3() { + return photodiode3; + } + + public int photodiode4() { + return photodiode4; + } + + public int photodiode5() { + return photodiode5; + } + + public int photodiode6() { + return photodiode6; + } + + public int panelTemperature1() { + return panelTemperature1; + } + + public int panelTemperature2() { + return panelTemperature2; + } + + public int panelTemperature3() { + return panelTemperature3; + } + + public int panelTemperature4() { + return panelTemperature4; + } + + public int panelTemperature5() { + return panelTemperature5; + } + + public int panelTemperature6() { + return panelTemperature6; + } + + public Uvsqsat _root() { + return _root; + } + + public Uvsqsat.UiFrame _parent() { + return _parent; + } + } + + public static class ImtqHk extends KaitaiStruct { + public static ImtqHk fromFile(String fileName) throws IOException { + return new ImtqHk(new ByteBufferKaitaiStream(fileName)); + } + + public ImtqHk(KaitaiStream _io) { + this(_io, null, null); + } + + public ImtqHk(KaitaiStream _io, Uvsqsat.UiFrame _parent) { + this(_io, _parent, null); + } + + public ImtqHk(KaitaiStream _io, Uvsqsat.UiFrame _parent, Uvsqsat _root) { + super(_io); + this._parent = _parent; + this._root = _root; + _read(); + } + + private void _read() { + this.digitaleVoltage = this._io.readU2be(); + this.analogVoltage = this._io.readU2be(); + this.digitalCurrent = this._io.readU2be(); + this.analogCurrent = this._io.readU2be(); + this.measureCoilXCurrent = this._io.readU2be(); + this.measureCoilYCurrent = this._io.readU2be(); + this.measureCoilZCurrent = this._io.readU2be(); + this.measureCoilXTemperature = this._io.readU2be(); + this.measureCoilYTemperature = this._io.readU2be(); + this.measureCoilZTemperature = this._io.readU2be(); + this.mcuTemperature = this._io.readU2be(); + this.imtqSystemStateMode = this._io.readU1(); + this.imtqSystemStateError = this._io.readU1(); + this.imtqSystemStateConfiguration = this._io.readU1(); + this.imtqSystemStateUptime = this._io.readU4be(); + } + + private Integer analogCurrentRaw; + + public Integer analogCurrentRaw() { + if (this.analogCurrentRaw != null) return this.analogCurrentRaw; + int _tmp = (int) (analogCurrent()); + this.analogCurrentRaw = _tmp; + return this.analogCurrentRaw; + } + + private Double measureCoilYTemperatureC; + + public Double measureCoilYTemperatureC() { + if (this.measureCoilYTemperatureC != null) return this.measureCoilYTemperatureC; + double _tmp = + (double) ((((((2.5 / 4095) * measureCoilYTemperature()) - 1.567) * -1.0) / 0.0081)); + this.measureCoilYTemperatureC = _tmp; + return this.measureCoilYTemperatureC; + } + + private Integer digitalCurrentRaw; + + public Integer digitalCurrentRaw() { + if (this.digitalCurrentRaw != null) return this.digitalCurrentRaw; + int _tmp = (int) (digitalCurrent()); + this.digitalCurrentRaw = _tmp; + return this.digitalCurrentRaw; + } + + private Integer imtqSystemStateModeRaw; + + public Integer imtqSystemStateModeRaw() { + if (this.imtqSystemStateModeRaw != null) return this.imtqSystemStateModeRaw; + int _tmp = (int) (imtqSystemStateMode()); + this.imtqSystemStateModeRaw = _tmp; + return this.imtqSystemStateModeRaw; + } + + private Double measureCoilZCurrentMa; + + public Double measureCoilZCurrentMa() { + if (this.measureCoilZCurrentMa != null) return this.measureCoilZCurrentMa; + double _tmp = (double) (((1000.0 * (((2.5 / 4095) * measureCoilZCurrent()) - 1.03)) / 0.48)); + this.measureCoilZCurrentMa = _tmp; + return this.measureCoilZCurrentMa; + } + + private Double measureCoilZTemperatureC; + + public Double measureCoilZTemperatureC() { + if (this.measureCoilZTemperatureC != null) return this.measureCoilZTemperatureC; + double _tmp = + (double) ((((((2.5 / 4095) * measureCoilZTemperature()) - 1.567) * -1.0) / 0.0081)); + this.measureCoilZTemperatureC = _tmp; + return this.measureCoilZTemperatureC; + } + + private Double measureCoilXCurrentMa; + + public Double measureCoilXCurrentMa() { + if (this.measureCoilXCurrentMa != null) return this.measureCoilXCurrentMa; + double _tmp = (double) (((1000.0 * (((2.5 / 4095) * measureCoilXCurrent()) - 1.03)) / 2.0)); + this.measureCoilXCurrentMa = _tmp; + return this.measureCoilXCurrentMa; + } + + private Double measureCoilYCurrentMa; + + public Double measureCoilYCurrentMa() { + if (this.measureCoilYCurrentMa != null) return this.measureCoilYCurrentMa; + double _tmp = (double) (((1000.0 * (((2.5 / 4095) * measureCoilYCurrent()) - 1.03)) / 2.0)); + this.measureCoilYCurrentMa = _tmp; + return this.measureCoilYCurrentMa; + } + + private Double digitaleVoltageV; + + public Double digitaleVoltageV() { + if (this.digitaleVoltageV != null) return this.digitaleVoltageV; + double _tmp = (double) (((2 * (2.5 / 4095)) * digitaleVoltage())); + this.digitaleVoltageV = _tmp; + return this.digitaleVoltageV; + } + + private Double analogVoltageV; + + public Double analogVoltageV() { + if (this.analogVoltageV != null) return this.analogVoltageV; + double _tmp = (double) (((2 * (2.5 / 4095)) * analogVoltage())); + this.analogVoltageV = _tmp; + return this.analogVoltageV; + } + + private Long imtqSystemStateUptimeRaw; + + public Long imtqSystemStateUptimeRaw() { + if (this.imtqSystemStateUptimeRaw != null) return this.imtqSystemStateUptimeRaw; + long _tmp = (long) (imtqSystemStateUptime()); + this.imtqSystemStateUptimeRaw = _tmp; + return this.imtqSystemStateUptimeRaw; + } + + private Double mcuTemperatureC; + + public Double mcuTemperatureC() { + if (this.mcuTemperatureC != null) return this.mcuTemperatureC; + double _tmp = (double) ((((((2.5 / 4095) * mcuTemperature()) - 0.680) * -1.0) / 0.00225)); + this.mcuTemperatureC = _tmp; + return this.mcuTemperatureC; + } + + private Integer imtqSystemStateConfigurationRaw; + + public Integer imtqSystemStateConfigurationRaw() { + if (this.imtqSystemStateConfigurationRaw != null) return this.imtqSystemStateConfigurationRaw; + int _tmp = (int) (imtqSystemStateConfiguration()); + this.imtqSystemStateConfigurationRaw = _tmp; + return this.imtqSystemStateConfigurationRaw; + } + + private Double measureCoilXTemperatureC; + + public Double measureCoilXTemperatureC() { + if (this.measureCoilXTemperatureC != null) return this.measureCoilXTemperatureC; + double _tmp = + (double) ((((((2.5 / 4095) * measureCoilXTemperature()) - 1.567) * -1.0) / 0.0081)); + this.measureCoilXTemperatureC = _tmp; + return this.measureCoilXTemperatureC; + } + + private Integer imtqSystemStateErrorRaw; + + public Integer imtqSystemStateErrorRaw() { + if (this.imtqSystemStateErrorRaw != null) return this.imtqSystemStateErrorRaw; + int _tmp = (int) (imtqSystemStateError()); + this.imtqSystemStateErrorRaw = _tmp; + return this.imtqSystemStateErrorRaw; + } + + private int digitaleVoltage; + private int analogVoltage; + private int digitalCurrent; + private int analogCurrent; + private int measureCoilXCurrent; + private int measureCoilYCurrent; + private int measureCoilZCurrent; + private int measureCoilXTemperature; + private int measureCoilYTemperature; + private int measureCoilZTemperature; + private int mcuTemperature; + private int imtqSystemStateMode; + private int imtqSystemStateError; + private int imtqSystemStateConfiguration; + private long imtqSystemStateUptime; + private Uvsqsat _root; + private Uvsqsat.UiFrame _parent; + + public int digitaleVoltage() { + return digitaleVoltage; + } + + public int analogVoltage() { + return analogVoltage; + } + + public int digitalCurrent() { + return digitalCurrent; + } + + public int analogCurrent() { + return analogCurrent; + } + + public int measureCoilXCurrent() { + return measureCoilXCurrent; + } + + public int measureCoilYCurrent() { + return measureCoilYCurrent; + } + + public int measureCoilZCurrent() { + return measureCoilZCurrent; + } + + public int measureCoilXTemperature() { + return measureCoilXTemperature; + } + + public int measureCoilYTemperature() { + return measureCoilYTemperature; + } + + public int measureCoilZTemperature() { + return measureCoilZTemperature; + } + + public int mcuTemperature() { + return mcuTemperature; + } + + public int imtqSystemStateMode() { + return imtqSystemStateMode; + } + + public int imtqSystemStateError() { + return imtqSystemStateError; + } + + public int imtqSystemStateConfiguration() { + return imtqSystemStateConfiguration; + } + + public long imtqSystemStateUptime() { + return imtqSystemStateUptime; + } + + public Uvsqsat _root() { + return _root; + } + + public Uvsqsat.UiFrame _parent() { + return _parent; + } + } + + public static class PacketSecondaryHeader extends KaitaiStruct { + public static PacketSecondaryHeader fromFile(String fileName) throws IOException { + return new PacketSecondaryHeader(new ByteBufferKaitaiStream(fileName)); + } + + public PacketSecondaryHeader(KaitaiStream _io) { + this(_io, null, null); + } + + public PacketSecondaryHeader(KaitaiStream _io, Uvsqsat.UiFrame _parent) { + this(_io, _parent, null); + } + + public PacketSecondaryHeader(KaitaiStream _io, Uvsqsat.UiFrame _parent, Uvsqsat _root) { + super(_io); + this._parent = _parent; + this._root = _root; + _read(); + } + + private void _read() { + this.tmPacketPusVersionNumber = this._io.readBitsInt(4); + this.spacecraftTimeReferenceStatus = this._io.readBitsInt(4); + this._io.alignToByte(); + this.serviceTypeId = this._io.readU1(); + this.messageSubtypeId = this._io.readU1(); + this.messageTypeCounter = this._io.readU2be(); + this.destinationId = this._io.readU2be(); + this.time = this._io.readU4be(); + this.dummy1 = this._io.readU2be(); + this.dummy2 = this._io.readU1(); + this.sid = this._io.readU1(); + } + + private long tmPacketPusVersionNumber; + private long spacecraftTimeReferenceStatus; + private int serviceTypeId; + private int messageSubtypeId; + private int messageTypeCounter; + private int destinationId; + private long time; + private int dummy1; + private int dummy2; + private int sid; + private Uvsqsat _root; + private Uvsqsat.UiFrame _parent; + + public long tmPacketPusVersionNumber() { + return tmPacketPusVersionNumber; + } + + public long spacecraftTimeReferenceStatus() { + return spacecraftTimeReferenceStatus; + } + + public int serviceTypeId() { + return serviceTypeId; + } + + public int messageSubtypeId() { + return messageSubtypeId; + } + + public int messageTypeCounter() { + return messageTypeCounter; + } + + public int destinationId() { + return destinationId; + } + + public long time() { + return time; + } + + public int dummy1() { + return dummy1; + } + + public int dummy2() { + return dummy2; + } + + public int sid() { + return sid; + } + + public Uvsqsat _root() { + return _root; + } + + public Uvsqsat.UiFrame _parent() { + return _parent; + } + } + + public static class MsgOrUnknow extends KaitaiStruct { + public static MsgOrUnknow fromFile(String fileName) throws IOException { + return new MsgOrUnknow(new ByteBufferKaitaiStream(fileName)); + } + + public MsgOrUnknow(KaitaiStream _io) { + this(_io, null, null); + } + + public MsgOrUnknow(KaitaiStream _io, Uvsqsat.UiFrame _parent) { + this(_io, _parent, null); + } + + public MsgOrUnknow(KaitaiStream _io, Uvsqsat.UiFrame _parent, Uvsqsat _root) { + super(_io); + this._parent = _parent; + this._root = _root; + _read(); + } + + private void _read() { + this.data = this._io.readBytesFull(); + } + + private byte[] dataByte; + + public byte[] dataByte() { + if (this.dataByte != null) return this.dataByte; + this.dataByte = data(); + return this.dataByte; + } + + private byte[] data; + private Uvsqsat _root; + private Uvsqsat.UiFrame _parent; + + public byte[] data() { + return data; + } + + public Uvsqsat _root() { + return _root; + } + + public Uvsqsat.UiFrame _parent() { + return _parent; + } + } + + public static class CallsignRaw extends KaitaiStruct { + public static CallsignRaw fromFile(String fileName) throws IOException { + return new CallsignRaw(new ByteBufferKaitaiStream(fileName)); + } + + public CallsignRaw(KaitaiStream _io) { + this(_io, null, null); + } + + public CallsignRaw(KaitaiStream _io, Uvsqsat.Ax25Header _parent) { + this(_io, _parent, null); + } + + public CallsignRaw(KaitaiStream _io, Uvsqsat.Ax25Header _parent, Uvsqsat _root) { + super(_io); + this._parent = _parent; + this._root = _root; + _read(); + } + + private void _read() { + this._raw__raw_callsignRor = this._io.readBytes(6); + this._raw_callsignRor = + KaitaiStream.processRotateLeft(this._raw__raw_callsignRor, 8 - (1), 1); + KaitaiStream _io__raw_callsignRor = new ByteBufferKaitaiStream(_raw_callsignRor); + this.callsignRor = new Callsign(_io__raw_callsignRor, this, _root); + } + + private Callsign callsignRor; + private Uvsqsat _root; + private Uvsqsat.Ax25Header _parent; + private byte[] _raw__raw_callsignRor; + private byte[] _raw_callsignRor; + + public Callsign callsignRor() { + return callsignRor; + } + + public Uvsqsat _root() { + return _root; + } + + public Uvsqsat.Ax25Header _parent() { + return _parent; + } + + public byte[] _raw__raw_callsignRor() { + return _raw__raw_callsignRor; + } + + public byte[] _raw_callsignRor() { + return _raw_callsignRor; + } + } + + public static class IepsHkStatus extends KaitaiStruct { + public static IepsHkStatus fromFile(String fileName) throws IOException { + return new IepsHkStatus(new ByteBufferKaitaiStream(fileName)); + } + + public IepsHkStatus(KaitaiStream _io) { + this(_io, null, null); + } + + public IepsHkStatus(KaitaiStream _io, Uvsqsat.UiFrame _parent) { + this(_io, _parent, null); + } + + public IepsHkStatus(KaitaiStream _io, Uvsqsat.UiFrame _parent, Uvsqsat _root) { + super(_io); + this._parent = _parent; + this._root = _root; + _read(); + } + + private void _read() { + this.hKStid = this._io.readU1(); + this.hKIvid = this._io.readU1(); + this.hKRc = this._io.readU1(); + this.hKBid = this._io.readU1(); + this.hKCmderr = this._io.readBitsInt(4); + this.hKStat = this._io.readBitsInt(4); + this._io.alignToByte(); + this.voltBrdSupRaw = this._io.readU2be(); + this.tempRaw = this._io.readU2be(); + this.vDistInputRaw = this._io.readU2be(); + this.iDistInputRaw = this._io.readU2be(); + this.pDistInputRaw = this._io.readU2be(); + this.vBattInputRaw = this._io.readU2be(); + this.iBattInputRaw = this._io.readU2be(); + this.pBattInputRaw = this._io.readU2be(); + this.statObcOn = this._io.readU2be(); + this.statObcOcf = this._io.readU2be(); + this.batStat = this._io.readU2be(); + this.batTemp2Raw = this._io.readU2be(); + this.voltVd0 = this._io.readU2be(); + this.voltVd1 = this._io.readU2be(); + this.voltVd2 = this._io.readU2be(); + this.vObc00 = this._io.readU2be(); + this.iObc00 = this._io.readU2be(); + this.pObc00 = this._io.readU2be(); + this.vObc01 = this._io.readU2be(); + this.iObc01 = this._io.readU2be(); + this.pObc01 = this._io.readU2be(); + this.vObc02 = this._io.readU2be(); + this.iObc02 = this._io.readU2be(); + this.pObc02 = this._io.readU2be(); + this.vObc03 = this._io.readU2be(); + this.iObc03 = this._io.readU2be(); + this.pObc03 = this._io.readU2be(); + this.vObc05 = this._io.readU2be(); + this.iObc05 = this._io.readU2be(); + this.pObc05 = this._io.readU2be(); + this.vObc06 = this._io.readU2be(); + this.iObc06 = this._io.readU2be(); + this.pObc06 = this._io.readU2be(); + this.cc1 = this._io.readBytes(8); + this.cc2 = this._io.readBytes(8); + this.cc3 = this._io.readBytes(8); + this.statusStid = this._io.readU1(); + this.statusIvid = this._io.readU1(); + this.statusRc = this._io.readU1(); + this.statusBid = this._io.readU1(); + this.statusCmderr = this._io.readBitsInt(4); + this.statusStat = this._io.readBitsInt(4); + this._io.alignToByte(); + this.mode = this._io.readU1(); + this.conf = this._io.readU1(); + this.resetCause = this._io.readU1(); + this.uptime = this._io.readU4be(); + this.error = this._io.readU2be(); + this.rcCntPwron = this._io.readU2be(); + this.rcCntWdg = this._io.readU2be(); + this.rcCntCmd = this._io.readU2be(); + this.rcCntMcu = this._io.readU2be(); + this.rcCntEmlopo = this._io.readU2be(); + this.prevcmdElapsed = this._io.readU2be(); + } + + private Integer rcCntPwronRaw; + + public Integer rcCntPwronRaw() { + if (this.rcCntPwronRaw != null) return this.rcCntPwronRaw; + int _tmp = (int) (rcCntPwron()); + this.rcCntPwronRaw = _tmp; + return this.rcCntPwronRaw; + } + + private Double vDistInputRawV; + + public Double vDistInputRawV() { + if (this.vDistInputRawV != null) return this.vDistInputRawV; + double _tmp = (double) ((((vDistInputRaw() * 125.0) / 128.0) / 1000.0)); + this.vDistInputRawV = _tmp; + return this.vDistInputRawV; + } + + private Double iObc05Ma; + + public Double iObc05Ma() { + if (this.iObc05Ma != null) return this.iObc05Ma; + double _tmp = (double) (((iObc05() * 3125.0) / 20480.0)); + this.iObc05Ma = _tmp; + return this.iObc05Ma; + } + + private Double pObc05Mw; + + public Double pObc05Mw() { + if (this.pObc05Mw != null) return this.pObc05Mw; + double _tmp = (double) (((pObc05() * 3125.0) / 6400.0)); + this.pObc05Mw = _tmp; + return this.pObc05Mw; + } + + private Integer statObcOnRaw; + + public Integer statObcOnRaw() { + if (this.statObcOnRaw != null) return this.statObcOnRaw; + int _tmp = (int) (statObcOn()); + this.statObcOnRaw = _tmp; + return this.statObcOnRaw; + } + + private Long statusStatRaw; + + public Long statusStatRaw() { + if (this.statusStatRaw != null) return this.statusStatRaw; + long _tmp = (long) (statusStat()); + this.statusStatRaw = _tmp; + return this.statusStatRaw; + } + + private Integer hKRcRaw; + + public Integer hKRcRaw() { + if (this.hKRcRaw != null) return this.hKRcRaw; + int _tmp = (int) (hKRc()); + this.hKRcRaw = _tmp; + return this.hKRcRaw; + } + + private Double pObc00Mw; + + public Double pObc00Mw() { + if (this.pObc00Mw != null) return this.pObc00Mw; + double _tmp = (double) (((pObc00() * 3125.0) / 6400.0)); + this.pObc00Mw = _tmp; + return this.pObc00Mw; + } + + private Double vObc02V; + + public Double vObc02V() { + if (this.vObc02V != null) return this.vObc02V; + double _tmp = (double) ((((vObc02() * 125.0) / 128.0) / 1000.0)); + this.vObc02V = _tmp; + return this.vObc02V; + } + + private Double pObc06Mw; + + public Double pObc06Mw() { + if (this.pObc06Mw != null) return this.pObc06Mw; + double _tmp = (double) (((pObc06() * 3125.0) / 6400.0)); + this.pObc06Mw = _tmp; + return this.pObc06Mw; + } + + private Integer modeRaw; + + public Integer modeRaw() { + if (this.modeRaw != null) return this.modeRaw; + int _tmp = (int) (mode()); + this.modeRaw = _tmp; + return this.modeRaw; + } + + private Long statusCmderrRaw; + + public Long statusCmderrRaw() { + if (this.statusCmderrRaw != null) return this.statusCmderrRaw; + long _tmp = (long) (statusCmderr()); + this.statusCmderrRaw = _tmp; + return this.statusCmderrRaw; + } + + private Double pObc01Mw; + + public Double pObc01Mw() { + if (this.pObc01Mw != null) return this.pObc01Mw; + double _tmp = (double) (((pObc01() * 3125.0) / 6400.0)); + this.pObc01Mw = _tmp; + return this.pObc01Mw; + } + + private Integer rcCntCmdRaw; + + public Integer rcCntCmdRaw() { + if (this.rcCntCmdRaw != null) return this.rcCntCmdRaw; + int _tmp = (int) (rcCntCmd()); + this.rcCntCmdRaw = _tmp; + return this.rcCntCmdRaw; + } + + private Integer statObcOcfRaw; + + public Integer statObcOcfRaw() { + if (this.statObcOcfRaw != null) return this.statObcOcfRaw; + int _tmp = (int) (statObcOcf()); + this.statObcOcfRaw = _tmp; + return this.statObcOcfRaw; + } + + private Integer voltVd2Raw; + + public Integer voltVd2Raw() { + if (this.voltVd2Raw != null) return this.voltVd2Raw; + int _tmp = (int) (voltVd2()); + this.voltVd2Raw = _tmp; + return this.voltVd2Raw; + } + + private Long uptimeRaw; + + public Long uptimeRaw() { + if (this.uptimeRaw != null) return this.uptimeRaw; + long _tmp = (long) (uptime()); + this.uptimeRaw = _tmp; + return this.uptimeRaw; + } + + private Double voltBrdSupRawV; + + public Double voltBrdSupRawV() { + if (this.voltBrdSupRawV != null) return this.voltBrdSupRawV; + double _tmp = (double) (((voltBrdSupRaw() * 1000.0) / 819.0)); + this.voltBrdSupRawV = _tmp; + return this.voltBrdSupRawV; + } + + private Double iObc00Ma; + + public Double iObc00Ma() { + if (this.iObc00Ma != null) return this.iObc00Ma; + double _tmp = (double) (((iObc00() * 3125.0) / 20480.0)); + this.iObc00Ma = _tmp; + return this.iObc00Ma; + } + + private Integer rcCntWdgRaw; + + public Integer rcCntWdgRaw() { + if (this.rcCntWdgRaw != null) return this.rcCntWdgRaw; + int _tmp = (int) (rcCntWdg()); + this.rcCntWdgRaw = _tmp; + return this.rcCntWdgRaw; + } + + private Double pDistInputRawMw; + + public Double pDistInputRawMw() { + if (this.pDistInputRawMw != null) return this.pDistInputRawMw; + double _tmp = (double) (((pDistInputRaw() * 3125.0) / 3200.0)); + this.pDistInputRawMw = _tmp; + return this.pDistInputRawMw; + } + + private Integer batStatRaw; + + public Integer batStatRaw() { + if (this.batStatRaw != null) return this.batStatRaw; + int _tmp = (int) (batStat()); + this.batStatRaw = _tmp; + return this.batStatRaw; + } + + private Double vObc06V; + + public Double vObc06V() { + if (this.vObc06V != null) return this.vObc06V; + double _tmp = (double) ((((vObc06() * 125.0) / 128.0) / 1000.0)); + this.vObc06V = _tmp; + return this.vObc06V; + } + + private Double iObc03Ma; + + public Double iObc03Ma() { + if (this.iObc03Ma != null) return this.iObc03Ma; + double _tmp = (double) (((iObc03() * 3125.0) / 20480.0)); + this.iObc03Ma = _tmp; + return this.iObc03Ma; + } + + private Double vObc03V; + + public Double vObc03V() { + if (this.vObc03V != null) return this.vObc03V; + double _tmp = (double) ((((vObc03() * 125.0) / 128.0) / 1000.0)); + this.vObc03V = _tmp; + return this.vObc03V; + } + + private Integer hKBidRaw; + + public Integer hKBidRaw() { + if (this.hKBidRaw != null) return this.hKBidRaw; + int _tmp = (int) (hKBid()); + this.hKBidRaw = _tmp; + return this.hKBidRaw; + } + + private Double iBattInputRawMa; + + public Double iBattInputRawMa() { + if (this.iBattInputRawMa != null) return this.iBattInputRawMa; + double _tmp = (double) ((1000.0 * ((iBattInputRaw() * 3125.0) / 10240.0))); + this.iBattInputRawMa = _tmp; + return this.iBattInputRawMa; + } + + private Integer hKIvidRaw; + + public Integer hKIvidRaw() { + if (this.hKIvidRaw != null) return this.hKIvidRaw; + int _tmp = (int) (hKIvid()); + this.hKIvidRaw = _tmp; + return this.hKIvidRaw; + } + + private Double iObc02Ma; + + public Double iObc02Ma() { + if (this.iObc02Ma != null) return this.iObc02Ma; + double _tmp = (double) (((iObc02() * 3125.0) / 20480.0)); + this.iObc02Ma = _tmp; + return this.iObc02Ma; + } + + private Integer statusStidRaw; + + public Integer statusStidRaw() { + if (this.statusStidRaw != null) return this.statusStidRaw; + int _tmp = (int) (statusStid()); + this.statusStidRaw = _tmp; + return this.statusStidRaw; + } + + private Double iObc06Ma; + + public Double iObc06Ma() { + if (this.iObc06Ma != null) return this.iObc06Ma; + double _tmp = (double) (((iObc06() * 3125.0) / 20480.0)); + this.iObc06Ma = _tmp; + return this.iObc06Ma; + } + + private Integer statusRcRaw; + + public Integer statusRcRaw() { + if (this.statusRcRaw != null) return this.statusRcRaw; + int _tmp = (int) (statusRc()); + this.statusRcRaw = _tmp; + return this.statusRcRaw; + } + + private byte[] cc2Byte; + + public byte[] cc2Byte() { + if (this.cc2Byte != null) return this.cc2Byte; + this.cc2Byte = cc2(); + return this.cc2Byte; + } + + private Integer errorRaw; + + public Integer errorRaw() { + if (this.errorRaw != null) return this.errorRaw; + int _tmp = (int) (error()); + this.errorRaw = _tmp; + return this.errorRaw; + } + + private Double iDistInputRawMa; + + public Double iDistInputRawMa() { + if (this.iDistInputRawMa != null) return this.iDistInputRawMa; + double _tmp = (double) (((iDistInputRaw() * 3125.0) / 10240.0)); + this.iDistInputRawMa = _tmp; + return this.iDistInputRawMa; + } + + private Double vObc01V; + + public Double vObc01V() { + if (this.vObc01V != null) return this.vObc01V; + double _tmp = (double) ((((vObc01() * 125.0) / 128.0) / 1000.0)); + this.vObc01V = _tmp; + return this.vObc01V; + } + + private Double pBattInputRawMw; + + public Double pBattInputRawMw() { + if (this.pBattInputRawMw != null) return this.pBattInputRawMw; + double _tmp = (double) (((pBattInputRaw() * 3125.0) / 3200.0)); + this.pBattInputRawMw = _tmp; + return this.pBattInputRawMw; + } + + private Double iObc01Ma; + + public Double iObc01Ma() { + if (this.iObc01Ma != null) return this.iObc01Ma; + double _tmp = (double) (((iObc01() * 3125.0) / 20480.0)); + this.iObc01Ma = _tmp; + return this.iObc01Ma; + } + + private Double tempRawT; + + public Double tempRawT() { + if (this.tempRawT != null) return this.tempRawT; + double _tmp = (double) (((((tempRaw() - 1168) * 220.0) / 9.0) / 100.0)); + this.tempRawT = _tmp; + return this.tempRawT; + } + + private byte[] cc1Byte; + + public byte[] cc1Byte() { + if (this.cc1Byte != null) return this.cc1Byte; + this.cc1Byte = cc1(); + return this.cc1Byte; + } + + private Integer rcCntEmlopoRaw; + + public Integer rcCntEmlopoRaw() { + if (this.rcCntEmlopoRaw != null) return this.rcCntEmlopoRaw; + int _tmp = (int) (rcCntEmlopo()); + this.rcCntEmlopoRaw = _tmp; + return this.rcCntEmlopoRaw; + } + + private Integer rcCntMcuRaw; + + public Integer rcCntMcuRaw() { + if (this.rcCntMcuRaw != null) return this.rcCntMcuRaw; + int _tmp = (int) (rcCntMcu()); + this.rcCntMcuRaw = _tmp; + return this.rcCntMcuRaw; + } + + private Integer statusBidRaw; + + public Integer statusBidRaw() { + if (this.statusBidRaw != null) return this.statusBidRaw; + int _tmp = (int) (statusBid()); + this.statusBidRaw = _tmp; + return this.statusBidRaw; + } + + private Integer statusIvidRaw; + + public Integer statusIvidRaw() { + if (this.statusIvidRaw != null) return this.statusIvidRaw; + int _tmp = (int) (statusIvid()); + this.statusIvidRaw = _tmp; + return this.statusIvidRaw; + } + + private Double pObc03Mw; + + public Double pObc03Mw() { + if (this.pObc03Mw != null) return this.pObc03Mw; + double _tmp = (double) (((pObc03() * 3125.0) / 6400.0)); + this.pObc03Mw = _tmp; + return this.pObc03Mw; + } + + private Integer voltVd1Raw; + + public Integer voltVd1Raw() { + if (this.voltVd1Raw != null) return this.voltVd1Raw; + int _tmp = (int) (voltVd1()); + this.voltVd1Raw = _tmp; + return this.voltVd1Raw; + } + + private byte[] cc3Byte; + + public byte[] cc3Byte() { + if (this.cc3Byte != null) return this.cc3Byte; + this.cc3Byte = cc3(); + return this.cc3Byte; + } + + private Double vObc05V; + + public Double vObc05V() { + if (this.vObc05V != null) return this.vObc05V; + double _tmp = (double) ((((vObc05() * 125.0) / 128.0) / 1000.0)); + this.vObc05V = _tmp; + return this.vObc05V; + } + + private Double vObc00V; + + public Double vObc00V() { + if (this.vObc00V != null) return this.vObc00V; + double _tmp = (double) ((((vObc00() * 125.0) / 128.0) / 1000.0)); + this.vObc00V = _tmp; + return this.vObc00V; + } + + private Integer voltVd0Raw; + + public Integer voltVd0Raw() { + if (this.voltVd0Raw != null) return this.voltVd0Raw; + int _tmp = (int) (voltVd0()); + this.voltVd0Raw = _tmp; + return this.voltVd0Raw; + } + + private Long hKCmderrRaw; + + public Long hKCmderrRaw() { + if (this.hKCmderrRaw != null) return this.hKCmderrRaw; + long _tmp = (long) (hKCmderr()); + this.hKCmderrRaw = _tmp; + return this.hKCmderrRaw; + } + + private Double batTemp2RawT; + + public Double batTemp2RawT() { + if (this.batTemp2RawT != null) return this.batTemp2RawT; + double _tmp = (double) (((batTemp2Raw() * -0.047715407918) + 98.38261483)); + this.batTemp2RawT = _tmp; + return this.batTemp2RawT; + } + + private Double vBattInputRawV; + + public Double vBattInputRawV() { + if (this.vBattInputRawV != null) return this.vBattInputRawV; + double _tmp = (double) ((((vBattInputRaw() * 125.0) / 128.0) / 1000.0)); + this.vBattInputRawV = _tmp; + return this.vBattInputRawV; + } + + private Integer resetCauseRaw; + + public Integer resetCauseRaw() { + if (this.resetCauseRaw != null) return this.resetCauseRaw; + int _tmp = (int) (resetCause()); + this.resetCauseRaw = _tmp; + return this.resetCauseRaw; + } + + private Integer hKStidRaw; + + public Integer hKStidRaw() { + if (this.hKStidRaw != null) return this.hKStidRaw; + int _tmp = (int) (hKStid()); + this.hKStidRaw = _tmp; + return this.hKStidRaw; + } + + private Double pObc02Mw; + + public Double pObc02Mw() { + if (this.pObc02Mw != null) return this.pObc02Mw; + double _tmp = (double) (((pObc02() * 3125.0) / 6400.0)); + this.pObc02Mw = _tmp; + return this.pObc02Mw; + } + + private Long hKStatRaw; + + public Long hKStatRaw() { + if (this.hKStatRaw != null) return this.hKStatRaw; + long _tmp = (long) (hKStat()); + this.hKStatRaw = _tmp; + return this.hKStatRaw; + } + + private Integer confRaw; + + public Integer confRaw() { + if (this.confRaw != null) return this.confRaw; + int _tmp = (int) (conf()); + this.confRaw = _tmp; + return this.confRaw; + } + + private Integer prevcmdElapsedRaw; + + public Integer prevcmdElapsedRaw() { + if (this.prevcmdElapsedRaw != null) return this.prevcmdElapsedRaw; + int _tmp = (int) (prevcmdElapsed()); + this.prevcmdElapsedRaw = _tmp; + return this.prevcmdElapsedRaw; + } + + private int hKStid; + private int hKIvid; + private int hKRc; + private int hKBid; + private long hKCmderr; + private long hKStat; + private int voltBrdSupRaw; + private int tempRaw; + private int vDistInputRaw; + private int iDistInputRaw; + private int pDistInputRaw; + private int vBattInputRaw; + private int iBattInputRaw; + private int pBattInputRaw; + private int statObcOn; + private int statObcOcf; + private int batStat; + private int batTemp2Raw; + private int voltVd0; + private int voltVd1; + private int voltVd2; + private int vObc00; + private int iObc00; + private int pObc00; + private int vObc01; + private int iObc01; + private int pObc01; + private int vObc02; + private int iObc02; + private int pObc02; + private int vObc03; + private int iObc03; + private int pObc03; + private int vObc05; + private int iObc05; + private int pObc05; + private int vObc06; + private int iObc06; + private int pObc06; + private byte[] cc1; + private byte[] cc2; + private byte[] cc3; + private int statusStid; + private int statusIvid; + private int statusRc; + private int statusBid; + private long statusCmderr; + private long statusStat; + private int mode; + private int conf; + private int resetCause; + private long uptime; + private int error; + private int rcCntPwron; + private int rcCntWdg; + private int rcCntCmd; + private int rcCntMcu; + private int rcCntEmlopo; + private int prevcmdElapsed; + private Uvsqsat _root; + private Uvsqsat.UiFrame _parent; + + public int hKStid() { + return hKStid; + } + + public int hKIvid() { + return hKIvid; + } + + public int hKRc() { + return hKRc; + } + + public int hKBid() { + return hKBid; + } + + public long hKCmderr() { + return hKCmderr; + } + + public long hKStat() { + return hKStat; + } + + public int voltBrdSupRaw() { + return voltBrdSupRaw; + } + + public int tempRaw() { + return tempRaw; + } + + public int vDistInputRaw() { + return vDistInputRaw; + } + + public int iDistInputRaw() { + return iDistInputRaw; + } + + public int pDistInputRaw() { + return pDistInputRaw; + } + + public int vBattInputRaw() { + return vBattInputRaw; + } + + public int iBattInputRaw() { + return iBattInputRaw; + } + + public int pBattInputRaw() { + return pBattInputRaw; + } + + public int statObcOn() { + return statObcOn; + } + + public int statObcOcf() { + return statObcOcf; + } + + public int batStat() { + return batStat; + } + + public int batTemp2Raw() { + return batTemp2Raw; + } + + public int voltVd0() { + return voltVd0; + } + + public int voltVd1() { + return voltVd1; + } + + public int voltVd2() { + return voltVd2; + } + + public int vObc00() { + return vObc00; + } + + public int iObc00() { + return iObc00; + } + + public int pObc00() { + return pObc00; + } + + public int vObc01() { + return vObc01; + } + + public int iObc01() { + return iObc01; + } + + public int pObc01() { + return pObc01; + } + + public int vObc02() { + return vObc02; + } + + public int iObc02() { + return iObc02; + } + + public int pObc02() { + return pObc02; + } + + public int vObc03() { + return vObc03; + } + + public int iObc03() { + return iObc03; + } + + public int pObc03() { + return pObc03; + } + + public int vObc05() { + return vObc05; + } + + public int iObc05() { + return iObc05; + } + + public int pObc05() { + return pObc05; + } + + public int vObc06() { + return vObc06; + } + + public int iObc06() { + return iObc06; + } + + public int pObc06() { + return pObc06; + } + + public byte[] cc1() { + return cc1; + } + + public byte[] cc2() { + return cc2; + } + + public byte[] cc3() { + return cc3; + } + + public int statusStid() { + return statusStid; + } + + public int statusIvid() { + return statusIvid; + } + + public int statusRc() { + return statusRc; + } + + public int statusBid() { + return statusBid; + } + + public long statusCmderr() { + return statusCmderr; + } + + public long statusStat() { + return statusStat; + } + + public int mode() { + return mode; + } + + public int conf() { + return conf; + } + + public int resetCause() { + return resetCause; + } + + public long uptime() { + return uptime; + } + + public int error() { + return error; + } + + public int rcCntPwron() { + return rcCntPwron; + } + + public int rcCntWdg() { + return rcCntWdg; + } + + public int rcCntCmd() { + return rcCntCmd; + } + + public int rcCntMcu() { + return rcCntMcu; + } + + public int rcCntEmlopo() { + return rcCntEmlopo; + } + + public int prevcmdElapsed() { + return prevcmdElapsed; + } + + public Uvsqsat _root() { + return _root; + } + + public Uvsqsat.UiFrame _parent() { + return _parent; + } + } + + public static class AntsHk extends KaitaiStruct { + public static AntsHk fromFile(String fileName) throws IOException { + return new AntsHk(new ByteBufferKaitaiStream(fileName)); + } + + public AntsHk(KaitaiStream _io) { + this(_io, null, null); + } + + public AntsHk(KaitaiStream _io, Uvsqsat.UiFrame _parent) { + this(_io, _parent, null); + } + + public AntsHk(KaitaiStream _io, Uvsqsat.UiFrame _parent, Uvsqsat _root) { + super(_io); + this._parent = _parent; + this._root = _root; + _read(); + } + + private void _read() { + this.sideAAntsTemperature = this._io.readU2be(); + this.sideAAntsDeploymentStatus = this._io.readU2be(); + this.sideAAntsUptime = this._io.readU4be(); + this.sideADeploymentCountAntenna1 = this._io.readU1(); + this.sideADeploymentCountAntenna2 = this._io.readU1(); + this.sideADeploymentCountAntenna3 = this._io.readU1(); + this.sideADeploymentCountAntenna4 = this._io.readU1(); + this.sideADeploymentTimeAntenna1 = this._io.readU2be(); + this.sideADeploymentTimeAntenna2 = this._io.readU2be(); + this.sideADeploymentTimeAntenna3 = this._io.readU2be(); + this.sideADeploymentTimeAntenna4 = this._io.readU2be(); + this.sideBAntsTemperature = this._io.readU2be(); + this.sideBAntsDeploymentStatus = this._io.readU2be(); + this.sideBAntsUptime = this._io.readU2be(); + this.sideBDeploymentCountAntenna1 = this._io.readU1(); + this.sideBDeploymentCountAntenna2 = this._io.readU1(); + this.sideBDeploymentCountAntenna3 = this._io.readU1(); + this.sideBDeploymentCountAntenna4 = this._io.readU1(); + this.sideBDeploymentTimeAntenna1 = this._io.readU2be(); + this.sideBDeploymentTimeAntenna2 = this._io.readU2be(); + this.sideBDeploymentTimeAntenna3 = this._io.readU2be(); + this.sideBDeploymentTimeAntenna4 = this._io.readU2be(); + } + + private Integer sideBDeploymentCountAntenna3Raw; + + public Integer sideBDeploymentCountAntenna3Raw() { + if (this.sideBDeploymentCountAntenna3Raw != null) return this.sideBDeploymentCountAntenna3Raw; + int _tmp = (int) (sideBDeploymentCountAntenna3()); + this.sideBDeploymentCountAntenna3Raw = _tmp; + return this.sideBDeploymentCountAntenna3Raw; + } + + private Integer sideBDeploymentTimeAntenna1Raw; + + public Integer sideBDeploymentTimeAntenna1Raw() { + if (this.sideBDeploymentTimeAntenna1Raw != null) return this.sideBDeploymentTimeAntenna1Raw; + int _tmp = (int) (sideBDeploymentTimeAntenna1()); + this.sideBDeploymentTimeAntenna1Raw = _tmp; + return this.sideBDeploymentTimeAntenna1Raw; + } + + private Integer sideADeploymentTimeAntenna3Raw; + + public Integer sideADeploymentTimeAntenna3Raw() { + if (this.sideADeploymentTimeAntenna3Raw != null) return this.sideADeploymentTimeAntenna3Raw; + int _tmp = (int) (sideADeploymentTimeAntenna3()); + this.sideADeploymentTimeAntenna3Raw = _tmp; + return this.sideADeploymentTimeAntenna3Raw; + } + + private Integer sideBDeploymentCountAntenna4Raw; + + public Integer sideBDeploymentCountAntenna4Raw() { + if (this.sideBDeploymentCountAntenna4Raw != null) return this.sideBDeploymentCountAntenna4Raw; + int _tmp = (int) (sideBDeploymentCountAntenna4()); + this.sideBDeploymentCountAntenna4Raw = _tmp; + return this.sideBDeploymentCountAntenna4Raw; + } + + private Integer sideBDeploymentTimeAntenna2Raw; + + public Integer sideBDeploymentTimeAntenna2Raw() { + if (this.sideBDeploymentTimeAntenna2Raw != null) return this.sideBDeploymentTimeAntenna2Raw; + int _tmp = (int) (sideBDeploymentTimeAntenna2()); + this.sideBDeploymentTimeAntenna2Raw = _tmp; + return this.sideBDeploymentTimeAntenna2Raw; + } + + private Integer sideADeploymentCountAntenna3Raw; + + public Integer sideADeploymentCountAntenna3Raw() { + if (this.sideADeploymentCountAntenna3Raw != null) return this.sideADeploymentCountAntenna3Raw; + int _tmp = (int) (sideADeploymentCountAntenna3()); + this.sideADeploymentCountAntenna3Raw = _tmp; + return this.sideADeploymentCountAntenna3Raw; + } + + private Integer sideBDeploymentCountAntenna1Raw; + + public Integer sideBDeploymentCountAntenna1Raw() { + if (this.sideBDeploymentCountAntenna1Raw != null) return this.sideBDeploymentCountAntenna1Raw; + int _tmp = (int) (sideBDeploymentCountAntenna1()); + this.sideBDeploymentCountAntenna1Raw = _tmp; + return this.sideBDeploymentCountAntenna1Raw; + } + + private Integer sideADeploymentCountAntenna4Raw; + + public Integer sideADeploymentCountAntenna4Raw() { + if (this.sideADeploymentCountAntenna4Raw != null) return this.sideADeploymentCountAntenna4Raw; + int _tmp = (int) (sideADeploymentCountAntenna4()); + this.sideADeploymentCountAntenna4Raw = _tmp; + return this.sideADeploymentCountAntenna4Raw; + } + + private Integer sideADeploymentCountAntenna1Raw; + + public Integer sideADeploymentCountAntenna1Raw() { + if (this.sideADeploymentCountAntenna1Raw != null) return this.sideADeploymentCountAntenna1Raw; + int _tmp = (int) (sideADeploymentCountAntenna1()); + this.sideADeploymentCountAntenna1Raw = _tmp; + return this.sideADeploymentCountAntenna1Raw; + } + + private Long sideAAntsUptimeRaw; + + public Long sideAAntsUptimeRaw() { + if (this.sideAAntsUptimeRaw != null) return this.sideAAntsUptimeRaw; + long _tmp = (long) (sideAAntsUptime()); + this.sideAAntsUptimeRaw = _tmp; + return this.sideAAntsUptimeRaw; + } + + private Integer sideBDeploymentTimeAntenna3Raw; + + public Integer sideBDeploymentTimeAntenna3Raw() { + if (this.sideBDeploymentTimeAntenna3Raw != null) return this.sideBDeploymentTimeAntenna3Raw; + int _tmp = (int) (sideBDeploymentTimeAntenna3()); + this.sideBDeploymentTimeAntenna3Raw = _tmp; + return this.sideBDeploymentTimeAntenna3Raw; + } + + private Integer sideBAntsTemperatureRaw; + + public Integer sideBAntsTemperatureRaw() { + if (this.sideBAntsTemperatureRaw != null) return this.sideBAntsTemperatureRaw; + int _tmp = (int) (sideBAntsTemperature()); + this.sideBAntsTemperatureRaw = _tmp; + return this.sideBAntsTemperatureRaw; + } + + private Integer sideADeploymentTimeAntenna2Raw; + + public Integer sideADeploymentTimeAntenna2Raw() { + if (this.sideADeploymentTimeAntenna2Raw != null) return this.sideADeploymentTimeAntenna2Raw; + int _tmp = (int) (sideADeploymentTimeAntenna2()); + this.sideADeploymentTimeAntenna2Raw = _tmp; + return this.sideADeploymentTimeAntenna2Raw; + } + + private Integer sideBDeploymentTimeAntenna4Raw; + + public Integer sideBDeploymentTimeAntenna4Raw() { + if (this.sideBDeploymentTimeAntenna4Raw != null) return this.sideBDeploymentTimeAntenna4Raw; + int _tmp = (int) (sideBDeploymentTimeAntenna4()); + this.sideBDeploymentTimeAntenna4Raw = _tmp; + return this.sideBDeploymentTimeAntenna4Raw; + } + + private Integer sideBAntsDeploymentStatusRaw; + + public Integer sideBAntsDeploymentStatusRaw() { + if (this.sideBAntsDeploymentStatusRaw != null) return this.sideBAntsDeploymentStatusRaw; + int _tmp = (int) (sideBAntsDeploymentStatus()); + this.sideBAntsDeploymentStatusRaw = _tmp; + return this.sideBAntsDeploymentStatusRaw; + } + + private Integer sideADeploymentTimeAntenna1Raw; + + public Integer sideADeploymentTimeAntenna1Raw() { + if (this.sideADeploymentTimeAntenna1Raw != null) return this.sideADeploymentTimeAntenna1Raw; + int _tmp = (int) (sideADeploymentTimeAntenna1()); + this.sideADeploymentTimeAntenna1Raw = _tmp; + return this.sideADeploymentTimeAntenna1Raw; + } + + private Integer sideADeploymentTimeAntenna4Raw; + + public Integer sideADeploymentTimeAntenna4Raw() { + if (this.sideADeploymentTimeAntenna4Raw != null) return this.sideADeploymentTimeAntenna4Raw; + int _tmp = (int) (sideADeploymentTimeAntenna4()); + this.sideADeploymentTimeAntenna4Raw = _tmp; + return this.sideADeploymentTimeAntenna4Raw; + } + + private Integer sideAAntsTemperatureRaw; + + public Integer sideAAntsTemperatureRaw() { + if (this.sideAAntsTemperatureRaw != null) return this.sideAAntsTemperatureRaw; + int _tmp = (int) (sideAAntsTemperature()); + this.sideAAntsTemperatureRaw = _tmp; + return this.sideAAntsTemperatureRaw; + } + + private Integer sideAAntsDeploymentStatusRaw; + + public Integer sideAAntsDeploymentStatusRaw() { + if (this.sideAAntsDeploymentStatusRaw != null) return this.sideAAntsDeploymentStatusRaw; + int _tmp = (int) (sideAAntsDeploymentStatus()); + this.sideAAntsDeploymentStatusRaw = _tmp; + return this.sideAAntsDeploymentStatusRaw; + } + + private Integer sideBDeploymentCountAntenna2Raw; + + public Integer sideBDeploymentCountAntenna2Raw() { + if (this.sideBDeploymentCountAntenna2Raw != null) return this.sideBDeploymentCountAntenna2Raw; + int _tmp = (int) (sideBDeploymentCountAntenna2()); + this.sideBDeploymentCountAntenna2Raw = _tmp; + return this.sideBDeploymentCountAntenna2Raw; + } + + private Integer sideADeploymentCountAntenna2Raw; + + public Integer sideADeploymentCountAntenna2Raw() { + if (this.sideADeploymentCountAntenna2Raw != null) return this.sideADeploymentCountAntenna2Raw; + int _tmp = (int) (sideADeploymentCountAntenna2()); + this.sideADeploymentCountAntenna2Raw = _tmp; + return this.sideADeploymentCountAntenna2Raw; + } + + private Integer sideBAntsUptimeRaw; + + public Integer sideBAntsUptimeRaw() { + if (this.sideBAntsUptimeRaw != null) return this.sideBAntsUptimeRaw; + int _tmp = (int) (sideBAntsUptime()); + this.sideBAntsUptimeRaw = _tmp; + return this.sideBAntsUptimeRaw; + } + + private int sideAAntsTemperature; + private int sideAAntsDeploymentStatus; + private long sideAAntsUptime; + private int sideADeploymentCountAntenna1; + private int sideADeploymentCountAntenna2; + private int sideADeploymentCountAntenna3; + private int sideADeploymentCountAntenna4; + private int sideADeploymentTimeAntenna1; + private int sideADeploymentTimeAntenna2; + private int sideADeploymentTimeAntenna3; + private int sideADeploymentTimeAntenna4; + private int sideBAntsTemperature; + private int sideBAntsDeploymentStatus; + private int sideBAntsUptime; + private int sideBDeploymentCountAntenna1; + private int sideBDeploymentCountAntenna2; + private int sideBDeploymentCountAntenna3; + private int sideBDeploymentCountAntenna4; + private int sideBDeploymentTimeAntenna1; + private int sideBDeploymentTimeAntenna2; + private int sideBDeploymentTimeAntenna3; + private int sideBDeploymentTimeAntenna4; + private Uvsqsat _root; + private Uvsqsat.UiFrame _parent; + + public int sideAAntsTemperature() { + return sideAAntsTemperature; + } + + public int sideAAntsDeploymentStatus() { + return sideAAntsDeploymentStatus; + } + + public long sideAAntsUptime() { + return sideAAntsUptime; + } + + public int sideADeploymentCountAntenna1() { + return sideADeploymentCountAntenna1; + } + + public int sideADeploymentCountAntenna2() { + return sideADeploymentCountAntenna2; + } + + public int sideADeploymentCountAntenna3() { + return sideADeploymentCountAntenna3; + } + + public int sideADeploymentCountAntenna4() { + return sideADeploymentCountAntenna4; + } + + public int sideADeploymentTimeAntenna1() { + return sideADeploymentTimeAntenna1; + } + + public int sideADeploymentTimeAntenna2() { + return sideADeploymentTimeAntenna2; + } + + public int sideADeploymentTimeAntenna3() { + return sideADeploymentTimeAntenna3; + } + + public int sideADeploymentTimeAntenna4() { + return sideADeploymentTimeAntenna4; + } + + public int sideBAntsTemperature() { + return sideBAntsTemperature; + } + + public int sideBAntsDeploymentStatus() { + return sideBAntsDeploymentStatus; + } + + public int sideBAntsUptime() { + return sideBAntsUptime; + } + + public int sideBDeploymentCountAntenna1() { + return sideBDeploymentCountAntenna1; + } + + public int sideBDeploymentCountAntenna2() { + return sideBDeploymentCountAntenna2; + } + + public int sideBDeploymentCountAntenna3() { + return sideBDeploymentCountAntenna3; + } + + public int sideBDeploymentCountAntenna4() { + return sideBDeploymentCountAntenna4; + } + + public int sideBDeploymentTimeAntenna1() { + return sideBDeploymentTimeAntenna1; + } + + public int sideBDeploymentTimeAntenna2() { + return sideBDeploymentTimeAntenna2; + } + + public int sideBDeploymentTimeAntenna3() { + return sideBDeploymentTimeAntenna3; + } + + public int sideBDeploymentTimeAntenna4() { + return sideBDeploymentTimeAntenna4; + } + + public Uvsqsat _root() { + return _root; + } + + public Uvsqsat.UiFrame _parent() { + return _parent; + } + } + + private Ax25Frame ax25Frame; + private Uvsqsat _root; + private KaitaiStruct _parent; + + /** @see Source */ + public Ax25Frame ax25Frame() { + return ax25Frame; + } + + public Uvsqsat _root() { + return _root; + } + + public KaitaiStruct _parent() { + return _parent; + } } diff --git a/ModuleUVSQsatTelemetry/src/main/java/org/josast/uvsqsat/pojogenerated/AFrame.java b/ModuleUVSQsatTelemetry/src/main/java/org/josast/uvsqsat/pojogenerated/AFrame.java index 315be3b331993296103ab94da9c12b83bbc27244..15adf40c58ad3a77380bde3dd14813e75b3dcf44 100644 --- a/ModuleUVSQsatTelemetry/src/main/java/org/josast/uvsqsat/pojogenerated/AFrame.java +++ b/ModuleUVSQsatTelemetry/src/main/java/org/josast/uvsqsat/pojogenerated/AFrame.java @@ -1,36 +1,21 @@ -/** - * - */ +/** */ package org.josast.uvsqsat.pojogenerated; -/** - * @author chris - * - */ +/** @author chris */ public abstract class AFrame { - - public String toStringCompute() - { - return " toStringCompute not implemented"; - - } - - - public String toStringRaw() - { - return " toStringRaw not implemented"; - - } - - protected String toHex (Object o) - { - - if(o.getClass().getName()=="java.lang.Integer") - return ""+Integer.toHexString((int) o); - else if(o.getClass().getName()=="java.lang.Long") - return ""+Long.toHexString((long) o); - else - return "Nan"; - - } + + public String toStringCompute() { + return " toStringCompute not implemented"; + } + + public String toStringRaw() { + return " toStringRaw not implemented"; + } + + protected String toHex(Object o) { + + if (o.getClass().getName() == "java.lang.Integer") return "" + Integer.toHexString((int) o); + else if (o.getClass().getName() == "java.lang.Long") return "" + Long.toHexString((long) o); + else return "Nan"; + } } diff --git a/ModuleUVSQsatTelemetry/src/main/java/org/josast/uvsqsat/pojogenerated/amsatAscii.java b/ModuleUVSQsatTelemetry/src/main/java/org/josast/uvsqsat/pojogenerated/amsatAscii.java index 7863db49d75beb94b6d29c362135cee70c25ffde..b1ec27a6760ca6982c346b45ce1eb5e3d1d93cae 100644 --- a/ModuleUVSQsatTelemetry/src/main/java/org/josast/uvsqsat/pojogenerated/amsatAscii.java +++ b/ModuleUVSQsatTelemetry/src/main/java/org/josast/uvsqsat/pojogenerated/amsatAscii.java @@ -5,25 +5,25 @@ package org.josast.uvsqsat.pojogenerated; import org.josast.uvsqsat.generated.Uvsqsat.AmsatAscii; -public class amsatAscii extends AFrame { +public class amsatAscii extends AFrame { - private String separator=" \r\n" ; -/** - data raw Declaration **/ -/** - Instance Declaration **/ - private String compmessageStr; - public amsatAscii(AmsatAscii o) { + private String separator = " \r\n"; + /** - data raw Declaration * */ + /** - Instance Declaration * */ + private String compmessageStr; - compmessageStr = o.messageStr(); - } + public amsatAscii(AmsatAscii o) { - public String toStringRaw () { - - return " " -; } + compmessageStr = o.messageStr(); + } - public String toStringCompute () { - - return " " - + separator + "message str : "+ compmessageStr; } + public String toStringRaw() { + return " "; + } + + public String toStringCompute() { + + return " " + separator + "message str : " + compmessageStr; + } } diff --git a/ModuleUVSQsatTelemetry/src/main/java/org/josast/uvsqsat/pojogenerated/antsHk.java b/ModuleUVSQsatTelemetry/src/main/java/org/josast/uvsqsat/pojogenerated/antsHk.java index 1660750f227e2056cc56824db617b89e0e3125f4..d5589923f7d530a2fba0e44852b73e04c130fa91 100644 --- a/ModuleUVSQsatTelemetry/src/main/java/org/josast/uvsqsat/pojogenerated/antsHk.java +++ b/ModuleUVSQsatTelemetry/src/main/java/org/josast/uvsqsat/pojogenerated/antsHk.java @@ -5,155 +5,289 @@ package org.josast.uvsqsat.pojogenerated; import org.josast.uvsqsat.generated.Uvsqsat.AntsHk; -public class antsHk extends AFrame { +public class antsHk extends AFrame { - private String separator=" \r\n" ; -/** - data raw Declaration **/ - private int sideAAntsTemperature; - private int sideAAntsDeploymentStatus; - private long sideAAntsUptime; - private int sideADeploymentCountAntenna1; - private int sideADeploymentCountAntenna2; - private int sideADeploymentCountAntenna3; - private int sideADeploymentCountAntenna4; - private int sideADeploymentTimeAntenna1; - private int sideADeploymentTimeAntenna2; - private int sideADeploymentTimeAntenna3; - private int sideADeploymentTimeAntenna4; - private int sideBAntsTemperature; - private int sideBAntsDeploymentStatus; - private int sideBAntsUptime; - private int sideBDeploymentCountAntenna1; - private int sideBDeploymentCountAntenna2; - private int sideBDeploymentCountAntenna3; - private int sideBDeploymentCountAntenna4; - private int sideBDeploymentTimeAntenna1; - private int sideBDeploymentTimeAntenna2; - private int sideBDeploymentTimeAntenna3; - private int sideBDeploymentTimeAntenna4; -/** - Instance Declaration **/ - private long compsideAAntsTemperatureRaw; - private long compsideAAntsDeploymentStatusRaw; - private long compsideAAntsUptimeRaw; - private long compsideADeploymentCountAntenna1Raw; - private long compsideADeploymentCountAntenna2Raw; - private long compsideADeploymentCountAntenna3Raw; - private long compsideADeploymentCountAntenna4Raw; - private long compsideADeploymentTimeAntenna1Raw; - private long compsideADeploymentTimeAntenna2Raw; - private long compsideADeploymentTimeAntenna3Raw; - private long compsideADeploymentTimeAntenna4Raw; - private long compsideBAntsTemperatureRaw; - private long compsideBAntsDeploymentStatusRaw; - private long compsideBAntsUptimeRaw; - private long compsideBDeploymentCountAntenna1Raw; - private long compsideBDeploymentCountAntenna2Raw; - private long compsideBDeploymentCountAntenna3Raw; - private long compsideBDeploymentCountAntenna4Raw; - private long compsideBDeploymentTimeAntenna1Raw; - private long compsideBDeploymentTimeAntenna2Raw; - private long compsideBDeploymentTimeAntenna3Raw; - private long compsideBDeploymentTimeAntenna4Raw; - public antsHk(AntsHk o) { + private String separator = " \r\n"; + /** - data raw Declaration * */ + private int sideAAntsTemperature; - sideAAntsTemperature = o.sideAAntsTemperature(); - sideAAntsDeploymentStatus = o.sideAAntsDeploymentStatus(); - sideAAntsUptime = o.sideAAntsUptime(); - sideADeploymentCountAntenna1 = o.sideADeploymentCountAntenna1(); - sideADeploymentCountAntenna2 = o.sideADeploymentCountAntenna2(); - sideADeploymentCountAntenna3 = o.sideADeploymentCountAntenna3(); - sideADeploymentCountAntenna4 = o.sideADeploymentCountAntenna4(); - sideADeploymentTimeAntenna1 = o.sideADeploymentTimeAntenna1(); - sideADeploymentTimeAntenna2 = o.sideADeploymentTimeAntenna2(); - sideADeploymentTimeAntenna3 = o.sideADeploymentTimeAntenna3(); - sideADeploymentTimeAntenna4 = o.sideADeploymentTimeAntenna4(); - sideBAntsTemperature = o.sideBAntsTemperature(); - sideBAntsDeploymentStatus = o.sideBAntsDeploymentStatus(); - sideBAntsUptime = o.sideBAntsUptime(); - sideBDeploymentCountAntenna1 = o.sideBDeploymentCountAntenna1(); - sideBDeploymentCountAntenna2 = o.sideBDeploymentCountAntenna2(); - sideBDeploymentCountAntenna3 = o.sideBDeploymentCountAntenna3(); - sideBDeploymentCountAntenna4 = o.sideBDeploymentCountAntenna4(); - sideBDeploymentTimeAntenna1 = o.sideBDeploymentTimeAntenna1(); - sideBDeploymentTimeAntenna2 = o.sideBDeploymentTimeAntenna2(); - sideBDeploymentTimeAntenna3 = o.sideBDeploymentTimeAntenna3(); - sideBDeploymentTimeAntenna4 = o.sideBDeploymentTimeAntenna4(); - compsideAAntsTemperatureRaw = o.sideAAntsTemperatureRaw(); - compsideAAntsDeploymentStatusRaw = o.sideAAntsDeploymentStatusRaw(); - compsideAAntsUptimeRaw = o.sideAAntsUptimeRaw(); - compsideADeploymentCountAntenna1Raw = o.sideADeploymentCountAntenna1Raw(); - compsideADeploymentCountAntenna2Raw = o.sideADeploymentCountAntenna2Raw(); - compsideADeploymentCountAntenna3Raw = o.sideADeploymentCountAntenna3Raw(); - compsideADeploymentCountAntenna4Raw = o.sideADeploymentCountAntenna4Raw(); - compsideADeploymentTimeAntenna1Raw = o.sideADeploymentTimeAntenna1Raw(); - compsideADeploymentTimeAntenna2Raw = o.sideADeploymentTimeAntenna2Raw(); - compsideADeploymentTimeAntenna3Raw = o.sideADeploymentTimeAntenna3Raw(); - compsideADeploymentTimeAntenna4Raw = o.sideADeploymentTimeAntenna4Raw(); - compsideBAntsTemperatureRaw = o.sideBAntsTemperatureRaw(); - compsideBAntsDeploymentStatusRaw = o.sideBAntsDeploymentStatusRaw(); - compsideBAntsUptimeRaw = o.sideBAntsUptimeRaw(); - compsideBDeploymentCountAntenna1Raw = o.sideBDeploymentCountAntenna1Raw(); - compsideBDeploymentCountAntenna2Raw = o.sideBDeploymentCountAntenna2Raw(); - compsideBDeploymentCountAntenna3Raw = o.sideBDeploymentCountAntenna3Raw(); - compsideBDeploymentCountAntenna4Raw = o.sideBDeploymentCountAntenna4Raw(); - compsideBDeploymentTimeAntenna1Raw = o.sideBDeploymentTimeAntenna1Raw(); - compsideBDeploymentTimeAntenna2Raw = o.sideBDeploymentTimeAntenna2Raw(); - compsideBDeploymentTimeAntenna3Raw = o.sideBDeploymentTimeAntenna3Raw(); - compsideBDeploymentTimeAntenna4Raw = o.sideBDeploymentTimeAntenna4Raw(); - } + private int sideAAntsDeploymentStatus; + private long sideAAntsUptime; + private int sideADeploymentCountAntenna1; + private int sideADeploymentCountAntenna2; + private int sideADeploymentCountAntenna3; + private int sideADeploymentCountAntenna4; + private int sideADeploymentTimeAntenna1; + private int sideADeploymentTimeAntenna2; + private int sideADeploymentTimeAntenna3; + private int sideADeploymentTimeAntenna4; + private int sideBAntsTemperature; + private int sideBAntsDeploymentStatus; + private int sideBAntsUptime; + private int sideBDeploymentCountAntenna1; + private int sideBDeploymentCountAntenna2; + private int sideBDeploymentCountAntenna3; + private int sideBDeploymentCountAntenna4; + private int sideBDeploymentTimeAntenna1; + private int sideBDeploymentTimeAntenna2; + private int sideBDeploymentTimeAntenna3; + private int sideBDeploymentTimeAntenna4; + /** - Instance Declaration * */ + private long compsideAAntsTemperatureRaw; - public String toStringRaw () { - - return " " - + separator + "sideAAntsTemperature : " +sideAAntsTemperature - + separator + "sideAAntsDeploymentStatus : " +sideAAntsDeploymentStatus - + separator + "sideAAntsUptime : " +sideAAntsUptime - + separator + "sideADeploymentCountAntenna1 : " +sideADeploymentCountAntenna1 - + separator + "sideADeploymentCountAntenna2 : " +sideADeploymentCountAntenna2 - + separator + "sideADeploymentCountAntenna3 : " +sideADeploymentCountAntenna3 - + separator + "sideADeploymentCountAntenna4 : " +sideADeploymentCountAntenna4 - + separator + "sideADeploymentTimeAntenna1 : " +sideADeploymentTimeAntenna1 - + separator + "sideADeploymentTimeAntenna2 : " +sideADeploymentTimeAntenna2 - + separator + "sideADeploymentTimeAntenna3 : " +sideADeploymentTimeAntenna3 - + separator + "sideADeploymentTimeAntenna4 : " +sideADeploymentTimeAntenna4 - + separator + "sideBAntsTemperature : " +sideBAntsTemperature - + separator + "sideBAntsDeploymentStatus : " +sideBAntsDeploymentStatus - + separator + "sideBAntsUptime : " +sideBAntsUptime - + separator + "sideBDeploymentCountAntenna1 : " +sideBDeploymentCountAntenna1 - + separator + "sideBDeploymentCountAntenna2 : " +sideBDeploymentCountAntenna2 - + separator + "sideBDeploymentCountAntenna3 : " +sideBDeploymentCountAntenna3 - + separator + "sideBDeploymentCountAntenna4 : " +sideBDeploymentCountAntenna4 - + separator + "sideBDeploymentTimeAntenna1 : " +sideBDeploymentTimeAntenna1 - + separator + "sideBDeploymentTimeAntenna2 : " +sideBDeploymentTimeAntenna2 - + separator + "sideBDeploymentTimeAntenna3 : " +sideBDeploymentTimeAntenna3 - + separator + "sideBDeploymentTimeAntenna4 : " +sideBDeploymentTimeAntenna4 -; } + private long compsideAAntsDeploymentStatusRaw; + private long compsideAAntsUptimeRaw; + private long compsideADeploymentCountAntenna1Raw; + private long compsideADeploymentCountAntenna2Raw; + private long compsideADeploymentCountAntenna3Raw; + private long compsideADeploymentCountAntenna4Raw; + private long compsideADeploymentTimeAntenna1Raw; + private long compsideADeploymentTimeAntenna2Raw; + private long compsideADeploymentTimeAntenna3Raw; + private long compsideADeploymentTimeAntenna4Raw; + private long compsideBAntsTemperatureRaw; + private long compsideBAntsDeploymentStatusRaw; + private long compsideBAntsUptimeRaw; + private long compsideBDeploymentCountAntenna1Raw; + private long compsideBDeploymentCountAntenna2Raw; + private long compsideBDeploymentCountAntenna3Raw; + private long compsideBDeploymentCountAntenna4Raw; + private long compsideBDeploymentTimeAntenna1Raw; + private long compsideBDeploymentTimeAntenna2Raw; + private long compsideBDeploymentTimeAntenna3Raw; + private long compsideBDeploymentTimeAntenna4Raw; - public String toStringCompute () { - - return " " - + separator + "side a ants temperature : Ox" + toHex(sideAAntsTemperature) + " : " + compsideAAntsTemperatureRaw - + separator + "side a ants deployment status : Ox" + toHex(sideAAntsDeploymentStatus) + " : " + compsideAAntsDeploymentStatusRaw - + separator + "side a ants uptime : Ox" + toHex(sideAAntsUptime) + " : " + compsideAAntsUptimeRaw - + separator + "side a deployment count antenna 1 : Ox" + toHex(sideADeploymentCountAntenna1) + " : " + compsideADeploymentCountAntenna1Raw - + separator + "side a deployment count antenna 2 : Ox" + toHex(sideADeploymentCountAntenna2) + " : " + compsideADeploymentCountAntenna2Raw - + separator + "side a deployment count antenna 3 : Ox" + toHex(sideADeploymentCountAntenna3) + " : " + compsideADeploymentCountAntenna3Raw - + separator + "side a deployment count antenna 4 : Ox" + toHex(sideADeploymentCountAntenna4) + " : " + compsideADeploymentCountAntenna4Raw - + separator + "side a deployment time antenna 1 : Ox" + toHex(sideADeploymentTimeAntenna1) + " : " + compsideADeploymentTimeAntenna1Raw - + separator + "side a deployment time antenna 2 : Ox" + toHex(sideADeploymentTimeAntenna2) + " : " + compsideADeploymentTimeAntenna2Raw - + separator + "side a deployment time antenna 3 : Ox" + toHex(sideADeploymentTimeAntenna3) + " : " + compsideADeploymentTimeAntenna3Raw - + separator + "side a deployment time antenna 4 : Ox" + toHex(sideADeploymentTimeAntenna4) + " : " + compsideADeploymentTimeAntenna4Raw - + separator + "side b ants temperature : Ox" + toHex(sideBAntsTemperature) + " : " + compsideBAntsTemperatureRaw - + separator + "side b ants deployment status : Ox" + toHex(sideBAntsDeploymentStatus) + " : " + compsideBAntsDeploymentStatusRaw - + separator + "side b ants uptime : Ox" + toHex(sideBAntsUptime) + " : " + compsideBAntsUptimeRaw - + separator + "side b deployment count antenna 1 : Ox" + toHex(sideBDeploymentCountAntenna1) + " : " + compsideBDeploymentCountAntenna1Raw - + separator + "side b deployment count antenna 2 : Ox" + toHex(sideBDeploymentCountAntenna2) + " : " + compsideBDeploymentCountAntenna2Raw - + separator + "side b deployment count antenna 3 : Ox" + toHex(sideBDeploymentCountAntenna3) + " : " + compsideBDeploymentCountAntenna3Raw - + separator + "side b deployment count antenna 4 : Ox" + toHex(sideBDeploymentCountAntenna4) + " : " + compsideBDeploymentCountAntenna4Raw - + separator + "side b deployment time antenna 1 : Ox" + toHex(sideBDeploymentTimeAntenna1) + " : " + compsideBDeploymentTimeAntenna1Raw - + separator + "side b deployment time antenna 2 : Ox" + toHex(sideBDeploymentTimeAntenna2) + " : " + compsideBDeploymentTimeAntenna2Raw - + separator + "side b deployment time antenna 3 : Ox" + toHex(sideBDeploymentTimeAntenna3) + " : " + compsideBDeploymentTimeAntenna3Raw - + separator + "side b deployment time antenna 4 : Ox" + toHex(sideBDeploymentTimeAntenna4) + " : " + compsideBDeploymentTimeAntenna4Raw -; } + public antsHk(AntsHk o) { + sideAAntsTemperature = o.sideAAntsTemperature(); + sideAAntsDeploymentStatus = o.sideAAntsDeploymentStatus(); + sideAAntsUptime = o.sideAAntsUptime(); + sideADeploymentCountAntenna1 = o.sideADeploymentCountAntenna1(); + sideADeploymentCountAntenna2 = o.sideADeploymentCountAntenna2(); + sideADeploymentCountAntenna3 = o.sideADeploymentCountAntenna3(); + sideADeploymentCountAntenna4 = o.sideADeploymentCountAntenna4(); + sideADeploymentTimeAntenna1 = o.sideADeploymentTimeAntenna1(); + sideADeploymentTimeAntenna2 = o.sideADeploymentTimeAntenna2(); + sideADeploymentTimeAntenna3 = o.sideADeploymentTimeAntenna3(); + sideADeploymentTimeAntenna4 = o.sideADeploymentTimeAntenna4(); + sideBAntsTemperature = o.sideBAntsTemperature(); + sideBAntsDeploymentStatus = o.sideBAntsDeploymentStatus(); + sideBAntsUptime = o.sideBAntsUptime(); + sideBDeploymentCountAntenna1 = o.sideBDeploymentCountAntenna1(); + sideBDeploymentCountAntenna2 = o.sideBDeploymentCountAntenna2(); + sideBDeploymentCountAntenna3 = o.sideBDeploymentCountAntenna3(); + sideBDeploymentCountAntenna4 = o.sideBDeploymentCountAntenna4(); + sideBDeploymentTimeAntenna1 = o.sideBDeploymentTimeAntenna1(); + sideBDeploymentTimeAntenna2 = o.sideBDeploymentTimeAntenna2(); + sideBDeploymentTimeAntenna3 = o.sideBDeploymentTimeAntenna3(); + sideBDeploymentTimeAntenna4 = o.sideBDeploymentTimeAntenna4(); + compsideAAntsTemperatureRaw = o.sideAAntsTemperatureRaw(); + compsideAAntsDeploymentStatusRaw = o.sideAAntsDeploymentStatusRaw(); + compsideAAntsUptimeRaw = o.sideAAntsUptimeRaw(); + compsideADeploymentCountAntenna1Raw = o.sideADeploymentCountAntenna1Raw(); + compsideADeploymentCountAntenna2Raw = o.sideADeploymentCountAntenna2Raw(); + compsideADeploymentCountAntenna3Raw = o.sideADeploymentCountAntenna3Raw(); + compsideADeploymentCountAntenna4Raw = o.sideADeploymentCountAntenna4Raw(); + compsideADeploymentTimeAntenna1Raw = o.sideADeploymentTimeAntenna1Raw(); + compsideADeploymentTimeAntenna2Raw = o.sideADeploymentTimeAntenna2Raw(); + compsideADeploymentTimeAntenna3Raw = o.sideADeploymentTimeAntenna3Raw(); + compsideADeploymentTimeAntenna4Raw = o.sideADeploymentTimeAntenna4Raw(); + compsideBAntsTemperatureRaw = o.sideBAntsTemperatureRaw(); + compsideBAntsDeploymentStatusRaw = o.sideBAntsDeploymentStatusRaw(); + compsideBAntsUptimeRaw = o.sideBAntsUptimeRaw(); + compsideBDeploymentCountAntenna1Raw = o.sideBDeploymentCountAntenna1Raw(); + compsideBDeploymentCountAntenna2Raw = o.sideBDeploymentCountAntenna2Raw(); + compsideBDeploymentCountAntenna3Raw = o.sideBDeploymentCountAntenna3Raw(); + compsideBDeploymentCountAntenna4Raw = o.sideBDeploymentCountAntenna4Raw(); + compsideBDeploymentTimeAntenna1Raw = o.sideBDeploymentTimeAntenna1Raw(); + compsideBDeploymentTimeAntenna2Raw = o.sideBDeploymentTimeAntenna2Raw(); + compsideBDeploymentTimeAntenna3Raw = o.sideBDeploymentTimeAntenna3Raw(); + compsideBDeploymentTimeAntenna4Raw = o.sideBDeploymentTimeAntenna4Raw(); + } + + public String toStringRaw() { + + return " " + + separator + + "sideAAntsTemperature : " + + sideAAntsTemperature + + separator + + "sideAAntsDeploymentStatus : " + + sideAAntsDeploymentStatus + + separator + + "sideAAntsUptime : " + + sideAAntsUptime + + separator + + "sideADeploymentCountAntenna1 : " + + sideADeploymentCountAntenna1 + + separator + + "sideADeploymentCountAntenna2 : " + + sideADeploymentCountAntenna2 + + separator + + "sideADeploymentCountAntenna3 : " + + sideADeploymentCountAntenna3 + + separator + + "sideADeploymentCountAntenna4 : " + + sideADeploymentCountAntenna4 + + separator + + "sideADeploymentTimeAntenna1 : " + + sideADeploymentTimeAntenna1 + + separator + + "sideADeploymentTimeAntenna2 : " + + sideADeploymentTimeAntenna2 + + separator + + "sideADeploymentTimeAntenna3 : " + + sideADeploymentTimeAntenna3 + + separator + + "sideADeploymentTimeAntenna4 : " + + sideADeploymentTimeAntenna4 + + separator + + "sideBAntsTemperature : " + + sideBAntsTemperature + + separator + + "sideBAntsDeploymentStatus : " + + sideBAntsDeploymentStatus + + separator + + "sideBAntsUptime : " + + sideBAntsUptime + + separator + + "sideBDeploymentCountAntenna1 : " + + sideBDeploymentCountAntenna1 + + separator + + "sideBDeploymentCountAntenna2 : " + + sideBDeploymentCountAntenna2 + + separator + + "sideBDeploymentCountAntenna3 : " + + sideBDeploymentCountAntenna3 + + separator + + "sideBDeploymentCountAntenna4 : " + + sideBDeploymentCountAntenna4 + + separator + + "sideBDeploymentTimeAntenna1 : " + + sideBDeploymentTimeAntenna1 + + separator + + "sideBDeploymentTimeAntenna2 : " + + sideBDeploymentTimeAntenna2 + + separator + + "sideBDeploymentTimeAntenna3 : " + + sideBDeploymentTimeAntenna3 + + separator + + "sideBDeploymentTimeAntenna4 : " + + sideBDeploymentTimeAntenna4; + } + + public String toStringCompute() { + + return " " + + separator + + "side a ants temperature : Ox" + + toHex(sideAAntsTemperature) + + " : " + + compsideAAntsTemperatureRaw + + separator + + "side a ants deployment status : Ox" + + toHex(sideAAntsDeploymentStatus) + + " : " + + compsideAAntsDeploymentStatusRaw + + separator + + "side a ants uptime : Ox" + + toHex(sideAAntsUptime) + + " : " + + compsideAAntsUptimeRaw + + separator + + "side a deployment count antenna 1 : Ox" + + toHex(sideADeploymentCountAntenna1) + + " : " + + compsideADeploymentCountAntenna1Raw + + separator + + "side a deployment count antenna 2 : Ox" + + toHex(sideADeploymentCountAntenna2) + + " : " + + compsideADeploymentCountAntenna2Raw + + separator + + "side a deployment count antenna 3 : Ox" + + toHex(sideADeploymentCountAntenna3) + + " : " + + compsideADeploymentCountAntenna3Raw + + separator + + "side a deployment count antenna 4 : Ox" + + toHex(sideADeploymentCountAntenna4) + + " : " + + compsideADeploymentCountAntenna4Raw + + separator + + "side a deployment time antenna 1 : Ox" + + toHex(sideADeploymentTimeAntenna1) + + " : " + + compsideADeploymentTimeAntenna1Raw + + separator + + "side a deployment time antenna 2 : Ox" + + toHex(sideADeploymentTimeAntenna2) + + " : " + + compsideADeploymentTimeAntenna2Raw + + separator + + "side a deployment time antenna 3 : Ox" + + toHex(sideADeploymentTimeAntenna3) + + " : " + + compsideADeploymentTimeAntenna3Raw + + separator + + "side a deployment time antenna 4 : Ox" + + toHex(sideADeploymentTimeAntenna4) + + " : " + + compsideADeploymentTimeAntenna4Raw + + separator + + "side b ants temperature : Ox" + + toHex(sideBAntsTemperature) + + " : " + + compsideBAntsTemperatureRaw + + separator + + "side b ants deployment status : Ox" + + toHex(sideBAntsDeploymentStatus) + + " : " + + compsideBAntsDeploymentStatusRaw + + separator + + "side b ants uptime : Ox" + + toHex(sideBAntsUptime) + + " : " + + compsideBAntsUptimeRaw + + separator + + "side b deployment count antenna 1 : Ox" + + toHex(sideBDeploymentCountAntenna1) + + " : " + + compsideBDeploymentCountAntenna1Raw + + separator + + "side b deployment count antenna 2 : Ox" + + toHex(sideBDeploymentCountAntenna2) + + " : " + + compsideBDeploymentCountAntenna2Raw + + separator + + "side b deployment count antenna 3 : Ox" + + toHex(sideBDeploymentCountAntenna3) + + " : " + + compsideBDeploymentCountAntenna3Raw + + separator + + "side b deployment count antenna 4 : Ox" + + toHex(sideBDeploymentCountAntenna4) + + " : " + + compsideBDeploymentCountAntenna4Raw + + separator + + "side b deployment time antenna 1 : Ox" + + toHex(sideBDeploymentTimeAntenna1) + + " : " + + compsideBDeploymentTimeAntenna1Raw + + separator + + "side b deployment time antenna 2 : Ox" + + toHex(sideBDeploymentTimeAntenna2) + + " : " + + compsideBDeploymentTimeAntenna2Raw + + separator + + "side b deployment time antenna 3 : Ox" + + toHex(sideBDeploymentTimeAntenna3) + + " : " + + compsideBDeploymentTimeAntenna3Raw + + separator + + "side b deployment time antenna 4 : Ox" + + toHex(sideBDeploymentTimeAntenna4) + + " : " + + compsideBDeploymentTimeAntenna4Raw; + } } diff --git a/ModuleUVSQsatTelemetry/src/main/java/org/josast/uvsqsat/pojogenerated/ax25Frame.java b/ModuleUVSQsatTelemetry/src/main/java/org/josast/uvsqsat/pojogenerated/ax25Frame.java index f8d07bde053dc357c6cb5e1a1cae2e416eb0ad36..10b0c433f870c7c5256323f4ca2615d86936542f 100644 --- a/ModuleUVSQsatTelemetry/src/main/java/org/josast/uvsqsat/pojogenerated/ax25Frame.java +++ b/ModuleUVSQsatTelemetry/src/main/java/org/josast/uvsqsat/pojogenerated/ax25Frame.java @@ -3,35 +3,31 @@ package org.josast.uvsqsat.pojogenerated; +import io.kaitai.struct.KaitaiStruct; import org.josast.uvsqsat.generated.Uvsqsat.Ax25Frame; import org.josast.uvsqsat.generated.Uvsqsat.Ax25Header; -import io.kaitai.struct.KaitaiStruct; +public class ax25Frame extends AFrame { + + private String separator = " \r\n"; + private Ax25Header ax25Header; + /** - data raw Declaration * */ + private KaitaiStruct payload; -public class ax25Frame extends AFrame { + /** - Instance Declaration * */ + public ax25Frame(Ax25Frame o) { - private String separator=" \r\n" ; - private Ax25Header ax25Header; -/** - data raw Declaration **/ - private KaitaiStruct payload; - -/** - Instance Declaration **/ - public ax25Frame(Ax25Frame o) { + ax25Header = o.ax25Header(); + payload = o.payload(); + } - ax25Header = o.ax25Header(); - payload = o.payload(); - } + public String toStringRaw() { - public String toStringRaw () { - - return " " - + separator + "ax25Header : " +ax25Header - + separator + "payload : " +payload -; } + return " " + separator + "ax25Header : " + ax25Header + separator + "payload : " + payload; + } - public String toStringCompute () { - - return " " -; } + public String toStringCompute() { + return " "; + } } diff --git a/ModuleUVSQsatTelemetry/src/main/java/org/josast/uvsqsat/pojogenerated/ax25Header.java b/ModuleUVSQsatTelemetry/src/main/java/org/josast/uvsqsat/pojogenerated/ax25Header.java index 9c5022e717d72be38d52a54b8d169c47df7d080a..d0cb510f13526a69998e377bb260540d9c7e4a98 100644 --- a/ModuleUVSQsatTelemetry/src/main/java/org/josast/uvsqsat/pojogenerated/ax25Header.java +++ b/ModuleUVSQsatTelemetry/src/main/java/org/josast/uvsqsat/pojogenerated/ax25Header.java @@ -7,38 +7,48 @@ import org.josast.uvsqsat.generated.Uvsqsat.Ax25Header; import org.josast.uvsqsat.generated.Uvsqsat.CallsignRaw; import org.josast.uvsqsat.generated.Uvsqsat.SsidMask; -public class ax25Header extends AFrame { - - private String separator=" \r\n" ; -/** - data raw Declaration **/ - private int ctl; -private CallsignRaw destCallsignRaw; -private SsidMask destSsidRaw; -private CallsignRaw srcCallsignRaw; -private SsidMask srcSsidRaw; -/** - Instance Declaration **/ - public ax25Header(Ax25Header o) { - - destCallsignRaw = o.destCallsignRaw(); - destSsidRaw = o.destSsidRaw(); - srcCallsignRaw = o.srcCallsignRaw(); - srcSsidRaw = o.srcSsidRaw(); - ctl = o.ctl(); - } - - public String toStringRaw () { - - return " " - + separator + "destCallsignRaw : " +destCallsignRaw - + separator + "destSsidRaw : " +destSsidRaw - + separator + "srcCallsignRaw : " +srcCallsignRaw - + separator + "srcSsidRaw : " +srcSsidRaw - + separator + "ctl : " +ctl -; } - - public String toStringCompute () { - - return " " -; } - +public class ax25Header extends AFrame { + + private String separator = " \r\n"; + /** - data raw Declaration * */ + private int ctl; + + private CallsignRaw destCallsignRaw; + private SsidMask destSsidRaw; + private CallsignRaw srcCallsignRaw; + private SsidMask srcSsidRaw; + /** - Instance Declaration * */ + public ax25Header(Ax25Header o) { + + destCallsignRaw = o.destCallsignRaw(); + destSsidRaw = o.destSsidRaw(); + srcCallsignRaw = o.srcCallsignRaw(); + srcSsidRaw = o.srcSsidRaw(); + ctl = o.ctl(); + } + + public String toStringRaw() { + + return " " + + separator + + "destCallsignRaw : " + + destCallsignRaw + + separator + + "destSsidRaw : " + + destSsidRaw + + separator + + "srcCallsignRaw : " + + srcCallsignRaw + + separator + + "srcSsidRaw : " + + srcSsidRaw + + separator + + "ctl : " + + ctl; + } + + public String toStringCompute() { + + return " "; + } } diff --git a/ModuleUVSQsatTelemetry/src/main/java/org/josast/uvsqsat/pojogenerated/beacon.java b/ModuleUVSQsatTelemetry/src/main/java/org/josast/uvsqsat/pojogenerated/beacon.java index 39778e12444a4c35d3a9a2084cc1878cb8b92ba7..34fb0af8de4d7e8573f991cd9949fa471277a064 100644 --- a/ModuleUVSQsatTelemetry/src/main/java/org/josast/uvsqsat/pojogenerated/beacon.java +++ b/ModuleUVSQsatTelemetry/src/main/java/org/josast/uvsqsat/pojogenerated/beacon.java @@ -5,629 +5,1245 @@ package org.josast.uvsqsat.pojogenerated; import org.josast.uvsqsat.generated.Uvsqsat.Beacon; -public class beacon extends AFrame { +public class beacon extends AFrame { - private String separator=" \r\n" ; -/** - data raw Declaration **/ - private int swMode; - private int lastResetReason; - private int resetOrder; - private int nbReset; - private int formatSdcardOrder; - private int deployAntennasSystem; - private long nbTmSinceFirstStart; - private long nbTcSinceFirstStart; - private long nbTcPingSinceFirstStart; - private long nbBadTcSinceFirstStart; - private long nbTmInSdcard; - private long trxvutxInstantaneousRfReflectedPowerFromTransmitterPort; - private long trxvutxInstantaneousRfForwardPowerFromTransmitterPort; - private long trxvutxSupplyVoltage; - private long trxvutxTotalSupplyCurrent; - private long trxvutxTransmitterCurrent; - private long trxvutxReceiverCurrent; - private long trxvutxPowerAmplifierCurrent; - private long trxvutxPowerAmplifierTemperature; - private long trxvutxLocalOscillatorTemperature; - private long trxvurxInstantaneousReceivedSignalDopplerOffsetAtTheReceiverPort; - private long trxvurxInstantaneousReceivedSignalStrengthAtTheReceiverPort; - private long trxvurxSupplyVoltage; - private long trxvurxTotalSupplyCurrent; - private long trxvurxTransmitterCurrent; - private long trxvurxReceiverCurrent; - private long trxvurxPowerAmplifierCurrent; - private long trxvurxPowerAmplifierTemperature; - private long trxvurxLocalOscillatorTemperature; - private int imtqSystemStateMode; - private int measureCoilXCurrent; - private int measureCoilYCurrent; - private int measureCoilZCurrent; - private int measureCoilXTemperature; - private int measureCoilYTemperature; - private int measureCoilZTemperature; - private int mcuTemperature; - private int sideAAntsTemperature; - private int sideAAntsDeploymentStatus; - private int voltBrdSupRaw; - private int tempRaw; - private int vDistInputRaw; - private int iDistInputRaw; - private int pDistInputRaw; - private int vBattInputRaw; - private int iBattInputRaw; - private int pBattInputRaw; - private int statObcOn; - private int statObcOcf; - private int batStat; - private int batTemp2Raw; - private int voltVd0; - private int voltVd1; - private int voltVd2; - private int vObc00; - private int iObc00; - private int pObc00; - private int vObc01; - private int iObc01; - private int pObc01; - private int vObc02; - private int iObc02; - private int pObc02; - private int vObc03; - private int iObc03; - private int pObc03; - private int vObc05; - private int iObc05; - private int pObc05; - private int vObc06; - private int iObc06; - private int pObc06; - private int statusStid; - private int statusIvid; - private int statusRc; - private int statusBid; - private long statusCmderr; - private long statusStat; - private int mode; - private int conf; - private int resetCause; - private long uptime; - private int error; - private int rcCntPwron; - private int rcCntWdg; - private int rcCntCmd; - private int rcCntMcu; - private int rcCntEmlopo; - private int prevcmdElapsed; - private int photodiode1; - private int photodiode2; - private int photodiode3; - private int photodiode4; - private int photodiode5; - private int photodiode6; - private long panelTemperature1; - private long panelTemperature2; - private long panelTemperature3; - private long panelTemperature4; - private long panelTemperature5; - private long panelTemperature6; -/** - Instance Declaration **/ - private long compswModeRaw; - private long complastResetReasonRaw; - private long compresetOrderRaw; - private long compnbResetRaw; - private long compformatSdcardOrderRaw; - private long compdeployAntennasSystemRaw; - private long compnbTmSinceFirstStartRaw; - private long compnbTcSinceFirstStartRaw; - private long compnbTcPingSinceFirstStartRaw; - private long compnbBadTcSinceFirstStartRaw; - private long compnbTmInSdcardRaw; - private double comptrxvutxInstantaneousRfReflectedPowerFromTransmitterPortMw; - private double comptrxvutxInstantaneousRfForwardPowerFromTransmitterPortMw; - private double comptrxvutxSupplyVoltageV; - private double comptrxvutxTotalSupplyCurrentMa; - private double comptrxvutxTransmitterCurrentMa; - private double comptrxvutxReceiverCurrentMa; - private double comptrxvutxPowerAmplifierCurrentMa; - private double comptrxvutxPowerAmplifierTemperatureC; - private double comptrxvutxLocalOscillatorTemperatureC; - private double comptrxvurxInstantaneousReceivedSignalDopplerHz; - private double comptrxvurxInstantaneousReceivedSignalStrengthDbm; - private double comptrxvurxSupplyVoltageV; - private double comptrxvurxTotalSupplyCurrentMa; - private double comptrxvurxTransmitterCurrentMa; - private double comptrxvurxReceiverCurrentMa; - private double comptrxvurxPowerAmplifierCurrentMa; - private double comptrxvurxPowerAmplifierTemperatureC; - private double comptrxvurxLocalOscillatorTemperatureC; - private long compimtqSystemStateModeRaw; - private double compmeasureCoilXCurrentMa; - private double compmeasureCoilYCurrentMa; - private double compmeasureCoilZCurrentMa; - private double compmeasureCoilXTemperatureC; - private double compmeasureCoilYTemperatureC; - private double compmeasureCoilZTemperatureC; - private double compmcuTemperatureC; - private long compsideAAntsTemperatureRaw; - private long compsideAAntsDeploymentStatusRaw; - private double compvoltBrdSupRawV; - private double comptempRawT; - private double compvDistInputRawV; - private double compiDistInputRawMa; - private double comppDistInputRawMw; - private double compvBattInputRawV; - private double compiBattInputRawMa; - private double comppBattInputRawMw; - private long compstatObcOnRaw; - private long compstatObcOcfRaw; - private long compbatStatRaw; - private double compbatTemp2RawT; - private long compvoltVd0Raw; - private long compvoltVd1Raw; - private long compvoltVd2Raw; - private double compvObc00V; - private double compiObc00Ma; - private double comppObc00Mw; - private double compvObc01V; - private double compiObc01Ma; - private double comppObc01Mw; - private double compvObc02V; - private double compiObc02Ma; - private double comppObc02Mw; - private double compvObc03V; - private double compiObc03Ma; - private double comppObc03Mw; - private double compvObc05V; - private double compiObc05Ma; - private double comppObc05Mw; - private double compvObc06V; - private double compiObc06Ma; - private double comppObc06Mw; - private long compstatusStidRaw; - private long compstatusIvidRaw; - private long compstatusRcRaw; - private long compstatusBidRaw; - private long compstatusCmderrRaw; - private long compstatusStatRaw; - private long compmodeRaw; - private long compconfRaw; - private long compresetCauseRaw; - private long compuptimeRaw; - private long comperrorRaw; - private long comprcCntPwronRaw; - private long comprcCntWdgRaw; - private long comprcCntCmdRaw; - private long comprcCntMcuRaw; - private long comprcCntEmlopoRaw; - private long compprevcmdElapsedRaw; - private long compphotodiode1Raw; - private long compphotodiode2Raw; - private long compphotodiode3Raw; - private long compphotodiode4Raw; - private long compphotodiode5Raw; - private long compphotodiode6Raw; - private double comppanelTemperature1C; - private double comppanelTemperature2C; - private double comppanelTemperature3C; - private double comppanelTemperature4C; - private double comppanelTemperature5C; - private double comppanelTemperature6C; - public beacon(Beacon o) { + private String separator = " \r\n"; + /** - data raw Declaration * */ + private int swMode; - swMode = o.swMode(); - lastResetReason = o.lastResetReason(); - resetOrder = o.resetOrder(); - nbReset = o.nbReset(); - formatSdcardOrder = o.formatSdcardOrder(); - deployAntennasSystem = o.deployAntennasSystem(); - nbTmSinceFirstStart = o.nbTmSinceFirstStart(); - nbTcSinceFirstStart = o.nbTcSinceFirstStart(); - nbTcPingSinceFirstStart = o.nbTcPingSinceFirstStart(); - nbBadTcSinceFirstStart = o.nbBadTcSinceFirstStart(); - nbTmInSdcard = o.nbTmInSdcard(); - trxvutxInstantaneousRfReflectedPowerFromTransmitterPort = o.trxvutxInstantaneousRfReflectedPowerFromTransmitterPort(); - trxvutxInstantaneousRfForwardPowerFromTransmitterPort = o.trxvutxInstantaneousRfForwardPowerFromTransmitterPort(); - trxvutxSupplyVoltage = o.trxvutxSupplyVoltage(); - trxvutxTotalSupplyCurrent = o.trxvutxTotalSupplyCurrent(); - trxvutxTransmitterCurrent = o.trxvutxTransmitterCurrent(); - trxvutxReceiverCurrent = o.trxvutxReceiverCurrent(); - trxvutxPowerAmplifierCurrent = o.trxvutxPowerAmplifierCurrent(); - trxvutxPowerAmplifierTemperature = o.trxvutxPowerAmplifierTemperature(); - trxvutxLocalOscillatorTemperature = o.trxvutxLocalOscillatorTemperature(); - trxvurxInstantaneousReceivedSignalDopplerOffsetAtTheReceiverPort = o.trxvurxInstantaneousReceivedSignalDopplerOffsetAtTheReceiverPort(); - trxvurxInstantaneousReceivedSignalStrengthAtTheReceiverPort = o.trxvurxInstantaneousReceivedSignalStrengthAtTheReceiverPort(); - trxvurxSupplyVoltage = o.trxvurxSupplyVoltage(); - trxvurxTotalSupplyCurrent = o.trxvurxTotalSupplyCurrent(); - trxvurxTransmitterCurrent = o.trxvurxTransmitterCurrent(); - trxvurxReceiverCurrent = o.trxvurxReceiverCurrent(); - trxvurxPowerAmplifierCurrent = o.trxvurxPowerAmplifierCurrent(); - trxvurxPowerAmplifierTemperature = o.trxvurxPowerAmplifierTemperature(); - trxvurxLocalOscillatorTemperature = o.trxvurxLocalOscillatorTemperature(); - imtqSystemStateMode = o.imtqSystemStateMode(); - measureCoilXCurrent = o.measureCoilXCurrent(); - measureCoilYCurrent = o.measureCoilYCurrent(); - measureCoilZCurrent = o.measureCoilZCurrent(); - measureCoilXTemperature = o.measureCoilXTemperature(); - measureCoilYTemperature = o.measureCoilYTemperature(); - measureCoilZTemperature = o.measureCoilZTemperature(); - mcuTemperature = o.mcuTemperature(); - sideAAntsTemperature = o.sideAAntsTemperature(); - sideAAntsDeploymentStatus = o.sideAAntsDeploymentStatus(); - voltBrdSupRaw = o.voltBrdSupRaw(); - tempRaw = o.tempRaw(); - vDistInputRaw = o.vDistInputRaw(); - iDistInputRaw = o.iDistInputRaw(); - pDistInputRaw = o.pDistInputRaw(); - vBattInputRaw = o.vBattInputRaw(); - iBattInputRaw = o.iBattInputRaw(); - pBattInputRaw = o.pBattInputRaw(); - statObcOn = o.statObcOn(); - statObcOcf = o.statObcOcf(); - batStat = o.batStat(); - batTemp2Raw = o.batTemp2Raw(); - voltVd0 = o.voltVd0(); - voltVd1 = o.voltVd1(); - voltVd2 = o.voltVd2(); - vObc00 = o.vObc00(); - iObc00 = o.iObc00(); - pObc00 = o.pObc00(); - vObc01 = o.vObc01(); - iObc01 = o.iObc01(); - pObc01 = o.pObc01(); - vObc02 = o.vObc02(); - iObc02 = o.iObc02(); - pObc02 = o.pObc02(); - vObc03 = o.vObc03(); - iObc03 = o.iObc03(); - pObc03 = o.pObc03(); - vObc05 = o.vObc05(); - iObc05 = o.iObc05(); - pObc05 = o.pObc05(); - vObc06 = o.vObc06(); - iObc06 = o.iObc06(); - pObc06 = o.pObc06(); - statusStid = o.statusStid(); - statusIvid = o.statusIvid(); - statusRc = o.statusRc(); - statusBid = o.statusBid(); - statusCmderr = o.statusCmderr(); - statusStat = o.statusStat(); - mode = o.mode(); - conf = o.conf(); - resetCause = o.resetCause(); - uptime = o.uptime(); - error = o.error(); - rcCntPwron = o.rcCntPwron(); - rcCntWdg = o.rcCntWdg(); - rcCntCmd = o.rcCntCmd(); - rcCntMcu = o.rcCntMcu(); - rcCntEmlopo = o.rcCntEmlopo(); - prevcmdElapsed = o.prevcmdElapsed(); - photodiode1 = o.photodiode1(); - photodiode2 = o.photodiode2(); - photodiode3 = o.photodiode3(); - photodiode4 = o.photodiode4(); - photodiode5 = o.photodiode5(); - photodiode6 = o.photodiode6(); - panelTemperature1 = o.panelTemperature1(); - panelTemperature2 = o.panelTemperature2(); - panelTemperature3 = o.panelTemperature3(); - panelTemperature4 = o.panelTemperature4(); - panelTemperature5 = o.panelTemperature5(); - panelTemperature6 = o.panelTemperature6(); - compswModeRaw = o.swModeRaw(); - complastResetReasonRaw = o.lastResetReasonRaw(); - compresetOrderRaw = o.resetOrderRaw(); - compnbResetRaw = o.nbResetRaw(); - compformatSdcardOrderRaw = o.formatSdcardOrderRaw(); - compdeployAntennasSystemRaw = o.deployAntennasSystemRaw(); - compnbTmSinceFirstStartRaw = o.nbTmSinceFirstStartRaw(); - compnbTcSinceFirstStartRaw = o.nbTcSinceFirstStartRaw(); - compnbTcPingSinceFirstStartRaw = o.nbTcPingSinceFirstStartRaw(); - compnbBadTcSinceFirstStartRaw = o.nbBadTcSinceFirstStartRaw(); - compnbTmInSdcardRaw = o.nbTmInSdcardRaw(); - comptrxvutxInstantaneousRfReflectedPowerFromTransmitterPortMw = o.trxvutxInstantaneousRfReflectedPowerFromTransmitterPortMw(); - comptrxvutxInstantaneousRfForwardPowerFromTransmitterPortMw = o.trxvutxInstantaneousRfForwardPowerFromTransmitterPortMw(); - comptrxvutxSupplyVoltageV = o.trxvutxSupplyVoltageV(); - comptrxvutxTotalSupplyCurrentMa = o.trxvutxTotalSupplyCurrentMa(); - comptrxvutxTransmitterCurrentMa = o.trxvutxTransmitterCurrentMa(); - comptrxvutxReceiverCurrentMa = o.trxvutxReceiverCurrentMa(); - comptrxvutxPowerAmplifierCurrentMa = o.trxvutxPowerAmplifierCurrentMa(); - comptrxvutxPowerAmplifierTemperatureC = o.trxvutxPowerAmplifierTemperatureC(); - comptrxvutxLocalOscillatorTemperatureC = o.trxvutxLocalOscillatorTemperatureC(); - comptrxvurxInstantaneousReceivedSignalDopplerHz = o.trxvurxInstantaneousReceivedSignalDopplerHz(); - comptrxvurxInstantaneousReceivedSignalStrengthDbm = o.trxvurxInstantaneousReceivedSignalStrengthDbm(); - comptrxvurxSupplyVoltageV = o.trxvurxSupplyVoltageV(); - comptrxvurxTotalSupplyCurrentMa = o.trxvurxTotalSupplyCurrentMa(); - comptrxvurxTransmitterCurrentMa = o.trxvurxTransmitterCurrentMa(); - comptrxvurxReceiverCurrentMa = o.trxvurxReceiverCurrentMa(); - comptrxvurxPowerAmplifierCurrentMa = o.trxvurxPowerAmplifierCurrentMa(); - comptrxvurxPowerAmplifierTemperatureC = o.trxvurxPowerAmplifierTemperatureC(); - comptrxvurxLocalOscillatorTemperatureC = o.trxvurxLocalOscillatorTemperatureC(); - compimtqSystemStateModeRaw = o.imtqSystemStateModeRaw(); - compmeasureCoilXCurrentMa = o.measureCoilXCurrentMa(); - compmeasureCoilYCurrentMa = o.measureCoilYCurrentMa(); - compmeasureCoilZCurrentMa = o.measureCoilZCurrentMa(); - compmeasureCoilXTemperatureC = o.measureCoilXTemperatureC(); - compmeasureCoilYTemperatureC = o.measureCoilYTemperatureC(); - compmeasureCoilZTemperatureC = o.measureCoilZTemperatureC(); - compmcuTemperatureC = o.mcuTemperatureC(); - compsideAAntsTemperatureRaw = o.sideAAntsTemperatureRaw(); - compsideAAntsDeploymentStatusRaw = o.sideAAntsDeploymentStatusRaw(); - compvoltBrdSupRawV = o.voltBrdSupRawV(); - comptempRawT = o.tempRawT(); - compvDistInputRawV = o.vDistInputRawV(); - compiDistInputRawMa = o.iDistInputRawMa(); - comppDistInputRawMw = o.pDistInputRawMw(); - compvBattInputRawV = o.vBattInputRawV(); - compiBattInputRawMa = o.iBattInputRawMa(); - comppBattInputRawMw = o.pBattInputRawMw(); - compstatObcOnRaw = o.statObcOnRaw(); - compstatObcOcfRaw = o.statObcOcfRaw(); - compbatStatRaw = o.batStatRaw(); - compbatTemp2RawT = o.batTemp2RawT(); - compvoltVd0Raw = o.voltVd0Raw(); - compvoltVd1Raw = o.voltVd1Raw(); - compvoltVd2Raw = o.voltVd2Raw(); - compvObc00V = o.vObc00V(); - compiObc00Ma = o.iObc00Ma(); - comppObc00Mw = o.pObc00Mw(); - compvObc01V = o.vObc01V(); - compiObc01Ma = o.iObc01Ma(); - comppObc01Mw = o.pObc01Mw(); - compvObc02V = o.vObc02V(); - compiObc02Ma = o.iObc02Ma(); - comppObc02Mw = o.pObc02Mw(); - compvObc03V = o.vObc03V(); - compiObc03Ma = o.iObc03Ma(); - comppObc03Mw = o.pObc03Mw(); - compvObc05V = o.vObc05V(); - compiObc05Ma = o.iObc05Ma(); - comppObc05Mw = o.pObc05Mw(); - compvObc06V = o.vObc06V(); - compiObc06Ma = o.iObc06Ma(); - comppObc06Mw = o.pObc06Mw(); - compstatusStidRaw = o.statusStidRaw(); - compstatusIvidRaw = o.statusIvidRaw(); - compstatusRcRaw = o.statusRcRaw(); - compstatusBidRaw = o.statusBidRaw(); - compstatusCmderrRaw = o.statusCmderrRaw(); - compstatusStatRaw = o.statusStatRaw(); - compmodeRaw = o.modeRaw(); - compconfRaw = o.confRaw(); - compresetCauseRaw = o.resetCauseRaw(); - compuptimeRaw = o.uptimeRaw(); - comperrorRaw = o.errorRaw(); - comprcCntPwronRaw = o.rcCntPwronRaw(); - comprcCntWdgRaw = o.rcCntWdgRaw(); - comprcCntCmdRaw = o.rcCntCmdRaw(); - comprcCntMcuRaw = o.rcCntMcuRaw(); - comprcCntEmlopoRaw = o.rcCntEmlopoRaw(); - compprevcmdElapsedRaw = o.prevcmdElapsedRaw(); - compphotodiode1Raw = o.photodiode1Raw(); - compphotodiode2Raw = o.photodiode2Raw(); - compphotodiode3Raw = o.photodiode3Raw(); - compphotodiode4Raw = o.photodiode4Raw(); - compphotodiode5Raw = o.photodiode5Raw(); - compphotodiode6Raw = o.photodiode6Raw(); - comppanelTemperature1C = o.panelTemperature1C(); - comppanelTemperature2C = o.panelTemperature2C(); - comppanelTemperature3C = o.panelTemperature3C(); - comppanelTemperature4C = o.panelTemperature4C(); - comppanelTemperature5C = o.panelTemperature5C(); - comppanelTemperature6C = o.panelTemperature6C(); - } + private int lastResetReason; + private int resetOrder; + private int nbReset; + private int formatSdcardOrder; + private int deployAntennasSystem; + private long nbTmSinceFirstStart; + private long nbTcSinceFirstStart; + private long nbTcPingSinceFirstStart; + private long nbBadTcSinceFirstStart; + private long nbTmInSdcard; + private long trxvutxInstantaneousRfReflectedPowerFromTransmitterPort; + private long trxvutxInstantaneousRfForwardPowerFromTransmitterPort; + private long trxvutxSupplyVoltage; + private long trxvutxTotalSupplyCurrent; + private long trxvutxTransmitterCurrent; + private long trxvutxReceiverCurrent; + private long trxvutxPowerAmplifierCurrent; + private long trxvutxPowerAmplifierTemperature; + private long trxvutxLocalOscillatorTemperature; + private long trxvurxInstantaneousReceivedSignalDopplerOffsetAtTheReceiverPort; + private long trxvurxInstantaneousReceivedSignalStrengthAtTheReceiverPort; + private long trxvurxSupplyVoltage; + private long trxvurxTotalSupplyCurrent; + private long trxvurxTransmitterCurrent; + private long trxvurxReceiverCurrent; + private long trxvurxPowerAmplifierCurrent; + private long trxvurxPowerAmplifierTemperature; + private long trxvurxLocalOscillatorTemperature; + private int imtqSystemStateMode; + private int measureCoilXCurrent; + private int measureCoilYCurrent; + private int measureCoilZCurrent; + private int measureCoilXTemperature; + private int measureCoilYTemperature; + private int measureCoilZTemperature; + private int mcuTemperature; + private int sideAAntsTemperature; + private int sideAAntsDeploymentStatus; + private int voltBrdSupRaw; + private int tempRaw; + private int vDistInputRaw; + private int iDistInputRaw; + private int pDistInputRaw; + private int vBattInputRaw; + private int iBattInputRaw; + private int pBattInputRaw; + private int statObcOn; + private int statObcOcf; + private int batStat; + private int batTemp2Raw; + private int voltVd0; + private int voltVd1; + private int voltVd2; + private int vObc00; + private int iObc00; + private int pObc00; + private int vObc01; + private int iObc01; + private int pObc01; + private int vObc02; + private int iObc02; + private int pObc02; + private int vObc03; + private int iObc03; + private int pObc03; + private int vObc05; + private int iObc05; + private int pObc05; + private int vObc06; + private int iObc06; + private int pObc06; + private int statusStid; + private int statusIvid; + private int statusRc; + private int statusBid; + private long statusCmderr; + private long statusStat; + private int mode; + private int conf; + private int resetCause; + private long uptime; + private int error; + private int rcCntPwron; + private int rcCntWdg; + private int rcCntCmd; + private int rcCntMcu; + private int rcCntEmlopo; + private int prevcmdElapsed; + private int photodiode1; + private int photodiode2; + private int photodiode3; + private int photodiode4; + private int photodiode5; + private int photodiode6; + private long panelTemperature1; + private long panelTemperature2; + private long panelTemperature3; + private long panelTemperature4; + private long panelTemperature5; + private long panelTemperature6; + /** - Instance Declaration * */ + private long compswModeRaw; - public String toStringRaw () { - - return " " - + separator + "swMode : " +swMode - + separator + "lastResetReason : " +lastResetReason - + separator + "resetOrder : " +resetOrder - + separator + "nbReset : " +nbReset - + separator + "formatSdcardOrder : " +formatSdcardOrder - + separator + "deployAntennasSystem : " +deployAntennasSystem - + separator + "nbTmSinceFirstStart : " +nbTmSinceFirstStart - + separator + "nbTcSinceFirstStart : " +nbTcSinceFirstStart - + separator + "nbTcPingSinceFirstStart : " +nbTcPingSinceFirstStart - + separator + "nbBadTcSinceFirstStart : " +nbBadTcSinceFirstStart - + separator + "nbTmInSdcard : " +nbTmInSdcard - + separator + "trxvutxInstantaneousRfReflectedPowerFromTransmitterPort : " +trxvutxInstantaneousRfReflectedPowerFromTransmitterPort - + separator + "trxvutxInstantaneousRfForwardPowerFromTransmitterPort : " +trxvutxInstantaneousRfForwardPowerFromTransmitterPort - + separator + "trxvutxSupplyVoltage : " +trxvutxSupplyVoltage - + separator + "trxvutxTotalSupplyCurrent : " +trxvutxTotalSupplyCurrent - + separator + "trxvutxTransmitterCurrent : " +trxvutxTransmitterCurrent - + separator + "trxvutxReceiverCurrent : " +trxvutxReceiverCurrent - + separator + "trxvutxPowerAmplifierCurrent : " +trxvutxPowerAmplifierCurrent - + separator + "trxvutxPowerAmplifierTemperature : " +trxvutxPowerAmplifierTemperature - + separator + "trxvutxLocalOscillatorTemperature : " +trxvutxLocalOscillatorTemperature - + separator + "trxvurxInstantaneousReceivedSignalDopplerOffsetAtTheReceiverPort : " +trxvurxInstantaneousReceivedSignalDopplerOffsetAtTheReceiverPort - + separator + "trxvurxInstantaneousReceivedSignalStrengthAtTheReceiverPort : " +trxvurxInstantaneousReceivedSignalStrengthAtTheReceiverPort - + separator + "trxvurxSupplyVoltage : " +trxvurxSupplyVoltage - + separator + "trxvurxTotalSupplyCurrent : " +trxvurxTotalSupplyCurrent - + separator + "trxvurxTransmitterCurrent : " +trxvurxTransmitterCurrent - + separator + "trxvurxReceiverCurrent : " +trxvurxReceiverCurrent - + separator + "trxvurxPowerAmplifierCurrent : " +trxvurxPowerAmplifierCurrent - + separator + "trxvurxPowerAmplifierTemperature : " +trxvurxPowerAmplifierTemperature - + separator + "trxvurxLocalOscillatorTemperature : " +trxvurxLocalOscillatorTemperature - + separator + "imtqSystemStateMode : " +imtqSystemStateMode - + separator + "measureCoilXCurrent : " +measureCoilXCurrent - + separator + "measureCoilYCurrent : " +measureCoilYCurrent - + separator + "measureCoilZCurrent : " +measureCoilZCurrent - + separator + "measureCoilXTemperature : " +measureCoilXTemperature - + separator + "measureCoilYTemperature : " +measureCoilYTemperature - + separator + "measureCoilZTemperature : " +measureCoilZTemperature - + separator + "mcuTemperature : " +mcuTemperature - + separator + "sideAAntsTemperature : " +sideAAntsTemperature - + separator + "sideAAntsDeploymentStatus : " +sideAAntsDeploymentStatus - + separator + "voltBrdSupRaw : " +voltBrdSupRaw - + separator + "tempRaw : " +tempRaw - + separator + "vDistInputRaw : " +vDistInputRaw - + separator + "iDistInputRaw : " +iDistInputRaw - + separator + "pDistInputRaw : " +pDistInputRaw - + separator + "vBattInputRaw : " +vBattInputRaw - + separator + "iBattInputRaw : " +iBattInputRaw - + separator + "pBattInputRaw : " +pBattInputRaw - + separator + "statObcOn : " +statObcOn - + separator + "statObcOcf : " +statObcOcf - + separator + "batStat : " +batStat - + separator + "batTemp2Raw : " +batTemp2Raw - + separator + "voltVd0 : " +voltVd0 - + separator + "voltVd1 : " +voltVd1 - + separator + "voltVd2 : " +voltVd2 - + separator + "vObc00 : " +vObc00 - + separator + "iObc00 : " +iObc00 - + separator + "pObc00 : " +pObc00 - + separator + "vObc01 : " +vObc01 - + separator + "iObc01 : " +iObc01 - + separator + "pObc01 : " +pObc01 - + separator + "vObc02 : " +vObc02 - + separator + "iObc02 : " +iObc02 - + separator + "pObc02 : " +pObc02 - + separator + "vObc03 : " +vObc03 - + separator + "iObc03 : " +iObc03 - + separator + "pObc03 : " +pObc03 - + separator + "vObc05 : " +vObc05 - + separator + "iObc05 : " +iObc05 - + separator + "pObc05 : " +pObc05 - + separator + "vObc06 : " +vObc06 - + separator + "iObc06 : " +iObc06 - + separator + "pObc06 : " +pObc06 - + separator + "statusStid : " +statusStid - + separator + "statusIvid : " +statusIvid - + separator + "statusRc : " +statusRc - + separator + "statusBid : " +statusBid - + separator + "statusCmderr : " +statusCmderr - + separator + "statusStat : " +statusStat - + separator + "mode : " +mode - + separator + "conf : " +conf - + separator + "resetCause : " +resetCause - + separator + "uptime : " +uptime - + separator + "error : " +error - + separator + "rcCntPwron : " +rcCntPwron - + separator + "rcCntWdg : " +rcCntWdg - + separator + "rcCntCmd : " +rcCntCmd - + separator + "rcCntMcu : " +rcCntMcu - + separator + "rcCntEmlopo : " +rcCntEmlopo - + separator + "prevcmdElapsed : " +prevcmdElapsed - + separator + "photodiode1 : " +photodiode1 - + separator + "photodiode2 : " +photodiode2 - + separator + "photodiode3 : " +photodiode3 - + separator + "photodiode4 : " +photodiode4 - + separator + "photodiode5 : " +photodiode5 - + separator + "photodiode6 : " +photodiode6 - + separator + "panelTemperature1 : " +panelTemperature1 - + separator + "panelTemperature2 : " +panelTemperature2 - + separator + "panelTemperature3 : " +panelTemperature3 - + separator + "panelTemperature4 : " +panelTemperature4 - + separator + "panelTemperature5 : " +panelTemperature5 - + separator + "panelTemperature6 : " +panelTemperature6 -; } + private long complastResetReasonRaw; + private long compresetOrderRaw; + private long compnbResetRaw; + private long compformatSdcardOrderRaw; + private long compdeployAntennasSystemRaw; + private long compnbTmSinceFirstStartRaw; + private long compnbTcSinceFirstStartRaw; + private long compnbTcPingSinceFirstStartRaw; + private long compnbBadTcSinceFirstStartRaw; + private long compnbTmInSdcardRaw; + private double comptrxvutxInstantaneousRfReflectedPowerFromTransmitterPortMw; + private double comptrxvutxInstantaneousRfForwardPowerFromTransmitterPortMw; + private double comptrxvutxSupplyVoltageV; + private double comptrxvutxTotalSupplyCurrentMa; + private double comptrxvutxTransmitterCurrentMa; + private double comptrxvutxReceiverCurrentMa; + private double comptrxvutxPowerAmplifierCurrentMa; + private double comptrxvutxPowerAmplifierTemperatureC; + private double comptrxvutxLocalOscillatorTemperatureC; + private double comptrxvurxInstantaneousReceivedSignalDopplerHz; + private double comptrxvurxInstantaneousReceivedSignalStrengthDbm; + private double comptrxvurxSupplyVoltageV; + private double comptrxvurxTotalSupplyCurrentMa; + private double comptrxvurxTransmitterCurrentMa; + private double comptrxvurxReceiverCurrentMa; + private double comptrxvurxPowerAmplifierCurrentMa; + private double comptrxvurxPowerAmplifierTemperatureC; + private double comptrxvurxLocalOscillatorTemperatureC; + private long compimtqSystemStateModeRaw; + private double compmeasureCoilXCurrentMa; + private double compmeasureCoilYCurrentMa; + private double compmeasureCoilZCurrentMa; + private double compmeasureCoilXTemperatureC; + private double compmeasureCoilYTemperatureC; + private double compmeasureCoilZTemperatureC; + private double compmcuTemperatureC; + private long compsideAAntsTemperatureRaw; + private long compsideAAntsDeploymentStatusRaw; + private double compvoltBrdSupRawV; + private double comptempRawT; + private double compvDistInputRawV; + private double compiDistInputRawMa; + private double comppDistInputRawMw; + private double compvBattInputRawV; + private double compiBattInputRawMa; + private double comppBattInputRawMw; + private long compstatObcOnRaw; + private long compstatObcOcfRaw; + private long compbatStatRaw; + private double compbatTemp2RawT; + private long compvoltVd0Raw; + private long compvoltVd1Raw; + private long compvoltVd2Raw; + private double compvObc00V; + private double compiObc00Ma; + private double comppObc00Mw; + private double compvObc01V; + private double compiObc01Ma; + private double comppObc01Mw; + private double compvObc02V; + private double compiObc02Ma; + private double comppObc02Mw; + private double compvObc03V; + private double compiObc03Ma; + private double comppObc03Mw; + private double compvObc05V; + private double compiObc05Ma; + private double comppObc05Mw; + private double compvObc06V; + private double compiObc06Ma; + private double comppObc06Mw; + private long compstatusStidRaw; + private long compstatusIvidRaw; + private long compstatusRcRaw; + private long compstatusBidRaw; + private long compstatusCmderrRaw; + private long compstatusStatRaw; + private long compmodeRaw; + private long compconfRaw; + private long compresetCauseRaw; + private long compuptimeRaw; + private long comperrorRaw; + private long comprcCntPwronRaw; + private long comprcCntWdgRaw; + private long comprcCntCmdRaw; + private long comprcCntMcuRaw; + private long comprcCntEmlopoRaw; + private long compprevcmdElapsedRaw; + private long compphotodiode1Raw; + private long compphotodiode2Raw; + private long compphotodiode3Raw; + private long compphotodiode4Raw; + private long compphotodiode5Raw; + private long compphotodiode6Raw; + private double comppanelTemperature1C; + private double comppanelTemperature2C; + private double comppanelTemperature3C; + private double comppanelTemperature4C; + private double comppanelTemperature5C; + private double comppanelTemperature6C; - public String toStringCompute () { - - return " " - + separator + "sw mode : Ox" + toHex(swMode) + " : " + compswModeRaw - + separator + "last reset reason : Ox" + toHex(lastResetReason) + " : " + complastResetReasonRaw - + separator + "reset order : Ox" + toHex(resetOrder) + " : " + compresetOrderRaw - + separator + "nb reset : Ox" + toHex(nbReset) + " : " + compnbResetRaw - + separator + "format sdcard order : Ox" + toHex(formatSdcardOrder) + " : " + compformatSdcardOrderRaw - + separator + "deploy antennas system : Ox" + toHex(deployAntennasSystem) + " : " + compdeployAntennasSystemRaw - + separator + "nb tm since first start : Ox" + toHex(nbTmSinceFirstStart) + " : " + compnbTmSinceFirstStartRaw - + separator + "nb tc since first start : Ox" + toHex(nbTcSinceFirstStart) + " : " + compnbTcSinceFirstStartRaw - + separator + "nb tc ping since first start : Ox" + toHex(nbTcPingSinceFirstStart) + " : " + compnbTcPingSinceFirstStartRaw - + separator + "nb bad tc since first start : Ox" + toHex(nbBadTcSinceFirstStart) + " : " + compnbBadTcSinceFirstStartRaw - + separator + "nb tm in sdcard : Ox" + toHex(nbTmInSdcard) + " : " + compnbTmInSdcardRaw - + separator + "trxvutx instantaneous rf reflected power from transmitter port (mW) : Ox" + toHex(trxvutxInstantaneousRfReflectedPowerFromTransmitterPort) + " : "+ String.format("%.3f", + comptrxvutxInstantaneousRfReflectedPowerFromTransmitterPortMw) - + separator + "trxvutx instantaneous rf forward power from transmitter port (mW) : Ox" + toHex(trxvutxInstantaneousRfForwardPowerFromTransmitterPort) + " : "+ String.format("%.3f", + comptrxvutxInstantaneousRfForwardPowerFromTransmitterPortMw) - + separator + "trxvutx supply voltage (V) : Ox" + toHex(trxvutxSupplyVoltage) + " : "+ String.format("%.3f", + comptrxvutxSupplyVoltageV) - + separator + "trxvutx total supply current (mA) : Ox" + toHex(trxvutxTotalSupplyCurrent) + " : "+ String.format("%.3f", + comptrxvutxTotalSupplyCurrentMa) - + separator + "trxvutx transmitter current (mA) : Ox" + toHex(trxvutxTransmitterCurrent) + " : "+ String.format("%.3f", + comptrxvutxTransmitterCurrentMa) - + separator + "trxvutx receiver current (mA) : Ox" + toHex(trxvutxReceiverCurrent) + " : "+ String.format("%.3f", + comptrxvutxReceiverCurrentMa) - + separator + "trxvutx power amplifier current (mA) : Ox" + toHex(trxvutxPowerAmplifierCurrent) + " : "+ String.format("%.3f", + comptrxvutxPowerAmplifierCurrentMa) - + separator + "trxvutx power amplifier temperature (°C) : Ox" + toHex(trxvutxPowerAmplifierTemperature) + " : "+ String.format("%.3f", + comptrxvutxPowerAmplifierTemperatureC) - + separator + "trxvutx local oscillator temperature (°C) : Ox" + toHex(trxvutxLocalOscillatorTemperature) + " : "+ String.format("%.3f", + comptrxvutxLocalOscillatorTemperatureC) - + separator + "trxvurx instantaneous received signal doppler (Hz) : Ox" + toHex(trxvurxInstantaneousReceivedSignalDopplerOffsetAtTheReceiverPort) + " : "+ String.format("%.3f", + comptrxvurxInstantaneousReceivedSignalDopplerHz) - + separator + "trxvurx instantaneous received signal strength (dbm) : Ox" + toHex(trxvurxInstantaneousReceivedSignalStrengthAtTheReceiverPort) + " : "+ String.format("%.3f", + comptrxvurxInstantaneousReceivedSignalStrengthDbm) - + separator + "trxvurx supply voltage (V) : Ox" + toHex(trxvurxSupplyVoltage) + " : "+ String.format("%.3f", + comptrxvurxSupplyVoltageV) - + separator + "trxvurx total supply current (mA) : Ox" + toHex(trxvurxTotalSupplyCurrent) + " : "+ String.format("%.3f", + comptrxvurxTotalSupplyCurrentMa) - + separator + "trxvurx transmitter current (mA) : Ox" + toHex(trxvurxTransmitterCurrent) + " : "+ String.format("%.3f", + comptrxvurxTransmitterCurrentMa) - + separator + "trxvurx receiver current (mA) : Ox" + toHex(trxvurxReceiverCurrent) + " : "+ String.format("%.3f", + comptrxvurxReceiverCurrentMa) - + separator + "trxvurx power amplifier current (mA) : Ox" + toHex(trxvurxPowerAmplifierCurrent) + " : "+ String.format("%.3f", + comptrxvurxPowerAmplifierCurrentMa) - + separator + "trxvurx power amplifier temperature (°C) : Ox" + toHex(trxvurxPowerAmplifierTemperature) + " : "+ String.format("%.3f", + comptrxvurxPowerAmplifierTemperatureC) - + separator + "trxvurx local oscillator temperature (°C) : Ox" + toHex(trxvurxLocalOscillatorTemperature) + " : "+ String.format("%.3f", + comptrxvurxLocalOscillatorTemperatureC) - + separator + "imtq system state mode : Ox" + toHex(imtqSystemStateMode) + " : " + compimtqSystemStateModeRaw - + separator + "measure coil x current (mA) : Ox" + toHex(measureCoilXCurrent) + " : "+ String.format("%.3f", + compmeasureCoilXCurrentMa) - + separator + "measure coil y current (mA) : Ox" + toHex(measureCoilYCurrent) + " : "+ String.format("%.3f", + compmeasureCoilYCurrentMa) - + separator + "measure coil z current (mA) : Ox" + toHex(measureCoilZCurrent) + " : "+ String.format("%.3f", + compmeasureCoilZCurrentMa) - + separator + "measure coil x temperature (°C) : Ox" + toHex(measureCoilXTemperature) + " : "+ String.format("%.3f", + compmeasureCoilXTemperatureC) - + separator + "measure coil y temperature (°C) : Ox" + toHex(measureCoilYTemperature) + " : "+ String.format("%.3f", + compmeasureCoilYTemperatureC) - + separator + "measure coil z temperature (°C) : Ox" + toHex(measureCoilZTemperature) + " : "+ String.format("%.3f", + compmeasureCoilZTemperatureC) - + separator + "mcu temperature (°C) : Ox" + toHex(mcuTemperature) + " : "+ String.format("%.3f", + compmcuTemperatureC) - + separator + "side a ants temperature : Ox" + toHex(sideAAntsTemperature) + " : " + compsideAAntsTemperatureRaw - + separator + "side a ants deployment status : Ox" + toHex(sideAAntsDeploymentStatus) + " : " + compsideAAntsDeploymentStatusRaw - + separator + "volt brd sup raw (V) : Ox" + toHex(voltBrdSupRaw) + " : "+ String.format("%.3f", + compvoltBrdSupRawV) - + separator + "temp raw t : Ox" + toHex(tempRaw) + " : "+ String.format("%.3f", + comptempRawT) - + separator + "v dist input raw (V) : Ox" + toHex(vDistInputRaw) + " : "+ String.format("%.3f", + compvDistInputRawV) - + separator + "i dist input raw (mA) : Ox" + toHex(iDistInputRaw) + " : "+ String.format("%.3f", + compiDistInputRawMa) - + separator + "p dist input raw (mW) : Ox" + toHex(pDistInputRaw) + " : "+ String.format("%.3f", + comppDistInputRawMw) - + separator + "v batt input raw (V) : Ox" + toHex(vBattInputRaw) + " : "+ String.format("%.3f", + compvBattInputRawV) - + separator + "i batt input raw (mA) : Ox" + toHex(iBattInputRaw) + " : "+ String.format("%.3f", + compiBattInputRawMa) - + separator + "p batt input raw (mW) : Ox" + toHex(pBattInputRaw) + " : "+ String.format("%.3f", + comppBattInputRawMw) - + separator + "stat obc on : Ox" + toHex(statObcOn) + " : " + compstatObcOnRaw - + separator + "stat obc ocf : Ox" + toHex(statObcOcf) + " : " + compstatObcOcfRaw - + separator + "bat stat : Ox" + toHex(batStat) + " : " + compbatStatRaw - + separator + "bat temp 2 raw t : Ox" + toHex(batTemp2Raw) + " : "+ String.format("%.3f", + compbatTemp2RawT) - + separator + "volt vd0 : Ox" + toHex(voltVd0) + " : " + compvoltVd0Raw - + separator + "volt vd1 : Ox" + toHex(voltVd1) + " : " + compvoltVd1Raw - + separator + "volt vd2 : Ox" + toHex(voltVd2) + " : " + compvoltVd2Raw - + separator + "v obc 00 (V) : Ox" + toHex(vObc00) + " : "+ String.format("%.3f", + compvObc00V) - + separator + "i obc 00 (mA) : Ox" + toHex(iObc00) + " : "+ String.format("%.3f", + compiObc00Ma) - + separator + "p obc 00 (mW) : Ox" + toHex(pObc00) + " : "+ String.format("%.3f", + comppObc00Mw) - + separator + "v obc 01 (V) : Ox" + toHex(vObc01) + " : "+ String.format("%.3f", + compvObc01V) - + separator + "i obc 01 (mA) : Ox" + toHex(iObc01) + " : "+ String.format("%.3f", + compiObc01Ma) - + separator + "p obc 01 (mW) : Ox" + toHex(pObc01) + " : "+ String.format("%.3f", + comppObc01Mw) - + separator + "v obc 02 (V) : Ox" + toHex(vObc02) + " : "+ String.format("%.3f", + compvObc02V) - + separator + "i obc 02 (mA) : Ox" + toHex(iObc02) + " : "+ String.format("%.3f", + compiObc02Ma) - + separator + "p obc 02 (mW) : Ox" + toHex(pObc02) + " : "+ String.format("%.3f", + comppObc02Mw) - + separator + "v obc 03 (V) : Ox" + toHex(vObc03) + " : "+ String.format("%.3f", + compvObc03V) - + separator + "i obc 03 (mA) : Ox" + toHex(iObc03) + " : "+ String.format("%.3f", + compiObc03Ma) - + separator + "p obc 03 (mW) : Ox" + toHex(pObc03) + " : "+ String.format("%.3f", + comppObc03Mw) - + separator + "v obc 05 (V) : Ox" + toHex(vObc05) + " : "+ String.format("%.3f", + compvObc05V) - + separator + "i obc 05 (mA) : Ox" + toHex(iObc05) + " : "+ String.format("%.3f", + compiObc05Ma) - + separator + "p obc 05 (mW) : Ox" + toHex(pObc05) + " : "+ String.format("%.3f", + comppObc05Mw) - + separator + "v obc 06 (V) : Ox" + toHex(vObc06) + " : "+ String.format("%.3f", + compvObc06V) - + separator + "i obc 06 (mA) : Ox" + toHex(iObc06) + " : "+ String.format("%.3f", + compiObc06Ma) - + separator + "p obc 06 (mW) : Ox" + toHex(pObc06) + " : "+ String.format("%.3f", + comppObc06Mw) - + separator + "status stid : Ox" + toHex(statusStid) + " : " + compstatusStidRaw - + separator + "status ivid : Ox" + toHex(statusIvid) + " : " + compstatusIvidRaw - + separator + "status rc : Ox" + toHex(statusRc) + " : " + compstatusRcRaw - + separator + "status bid : Ox" + toHex(statusBid) + " : " + compstatusBidRaw - + separator + "status cmderr : Ox" + toHex(statusCmderr) + " : " + compstatusCmderrRaw - + separator + "status stat : Ox" + toHex(statusStat) + " : " + compstatusStatRaw - + separator + "mode : Ox" + toHex(mode) + " : " + compmodeRaw - + separator + "conf : Ox" + toHex(conf) + " : " + compconfRaw - + separator + "reset cause : Ox" + toHex(resetCause) + " : " + compresetCauseRaw - + separator + "uptime : Ox" + toHex(uptime) + " : " + compuptimeRaw - + separator + "error : Ox" + toHex(error) + " : " + comperrorRaw - + separator + "rc cnt pwron : Ox" + toHex(rcCntPwron) + " : " + comprcCntPwronRaw - + separator + "rc cnt wdg : Ox" + toHex(rcCntWdg) + " : " + comprcCntWdgRaw - + separator + "rc cnt cmd : Ox" + toHex(rcCntCmd) + " : " + comprcCntCmdRaw - + separator + "rc cnt mcu : Ox" + toHex(rcCntMcu) + " : " + comprcCntMcuRaw - + separator + "rc cnt emlopo : Ox" + toHex(rcCntEmlopo) + " : " + comprcCntEmlopoRaw - + separator + "prevcmd elapsed : Ox" + toHex(prevcmdElapsed) + " : " + compprevcmdElapsedRaw - + separator + "photodiode 1 : Ox" + toHex(photodiode1) + " : " + compphotodiode1Raw - + separator + "photodiode 2 : Ox" + toHex(photodiode2) + " : " + compphotodiode2Raw - + separator + "photodiode 3 : Ox" + toHex(photodiode3) + " : " + compphotodiode3Raw - + separator + "photodiode 4 : Ox" + toHex(photodiode4) + " : " + compphotodiode4Raw - + separator + "photodiode 5 : Ox" + toHex(photodiode5) + " : " + compphotodiode5Raw - + separator + "photodiode 6 : Ox" + toHex(photodiode6) + " : " + compphotodiode6Raw - + separator + "panel temperature 1 (°C) : Ox" + toHex(panelTemperature1) + " : "+ String.format("%.3f", + comppanelTemperature1C) - + separator + "panel temperature 2 (°C) : Ox" + toHex(panelTemperature2) + " : "+ String.format("%.3f", + comppanelTemperature2C) - + separator + "panel temperature 3 (°C) : Ox" + toHex(panelTemperature3) + " : "+ String.format("%.3f", + comppanelTemperature3C) - + separator + "panel temperature 4 (°C) : Ox" + toHex(panelTemperature4) + " : "+ String.format("%.3f", + comppanelTemperature4C) - + separator + "panel temperature 5 (°C) : Ox" + toHex(panelTemperature5) + " : "+ String.format("%.3f", + comppanelTemperature5C) - + separator + "panel temperature 6 (°C) : Ox" + toHex(panelTemperature6) + " : "+ String.format("%.3f", + comppanelTemperature6C) -; } + public beacon(Beacon o) { + swMode = o.swMode(); + lastResetReason = o.lastResetReason(); + resetOrder = o.resetOrder(); + nbReset = o.nbReset(); + formatSdcardOrder = o.formatSdcardOrder(); + deployAntennasSystem = o.deployAntennasSystem(); + nbTmSinceFirstStart = o.nbTmSinceFirstStart(); + nbTcSinceFirstStart = o.nbTcSinceFirstStart(); + nbTcPingSinceFirstStart = o.nbTcPingSinceFirstStart(); + nbBadTcSinceFirstStart = o.nbBadTcSinceFirstStart(); + nbTmInSdcard = o.nbTmInSdcard(); + trxvutxInstantaneousRfReflectedPowerFromTransmitterPort = + o.trxvutxInstantaneousRfReflectedPowerFromTransmitterPort(); + trxvutxInstantaneousRfForwardPowerFromTransmitterPort = + o.trxvutxInstantaneousRfForwardPowerFromTransmitterPort(); + trxvutxSupplyVoltage = o.trxvutxSupplyVoltage(); + trxvutxTotalSupplyCurrent = o.trxvutxTotalSupplyCurrent(); + trxvutxTransmitterCurrent = o.trxvutxTransmitterCurrent(); + trxvutxReceiverCurrent = o.trxvutxReceiverCurrent(); + trxvutxPowerAmplifierCurrent = o.trxvutxPowerAmplifierCurrent(); + trxvutxPowerAmplifierTemperature = o.trxvutxPowerAmplifierTemperature(); + trxvutxLocalOscillatorTemperature = o.trxvutxLocalOscillatorTemperature(); + trxvurxInstantaneousReceivedSignalDopplerOffsetAtTheReceiverPort = + o.trxvurxInstantaneousReceivedSignalDopplerOffsetAtTheReceiverPort(); + trxvurxInstantaneousReceivedSignalStrengthAtTheReceiverPort = + o.trxvurxInstantaneousReceivedSignalStrengthAtTheReceiverPort(); + trxvurxSupplyVoltage = o.trxvurxSupplyVoltage(); + trxvurxTotalSupplyCurrent = o.trxvurxTotalSupplyCurrent(); + trxvurxTransmitterCurrent = o.trxvurxTransmitterCurrent(); + trxvurxReceiverCurrent = o.trxvurxReceiverCurrent(); + trxvurxPowerAmplifierCurrent = o.trxvurxPowerAmplifierCurrent(); + trxvurxPowerAmplifierTemperature = o.trxvurxPowerAmplifierTemperature(); + trxvurxLocalOscillatorTemperature = o.trxvurxLocalOscillatorTemperature(); + imtqSystemStateMode = o.imtqSystemStateMode(); + measureCoilXCurrent = o.measureCoilXCurrent(); + measureCoilYCurrent = o.measureCoilYCurrent(); + measureCoilZCurrent = o.measureCoilZCurrent(); + measureCoilXTemperature = o.measureCoilXTemperature(); + measureCoilYTemperature = o.measureCoilYTemperature(); + measureCoilZTemperature = o.measureCoilZTemperature(); + mcuTemperature = o.mcuTemperature(); + sideAAntsTemperature = o.sideAAntsTemperature(); + sideAAntsDeploymentStatus = o.sideAAntsDeploymentStatus(); + voltBrdSupRaw = o.voltBrdSupRaw(); + tempRaw = o.tempRaw(); + vDistInputRaw = o.vDistInputRaw(); + iDistInputRaw = o.iDistInputRaw(); + pDistInputRaw = o.pDistInputRaw(); + vBattInputRaw = o.vBattInputRaw(); + iBattInputRaw = o.iBattInputRaw(); + pBattInputRaw = o.pBattInputRaw(); + statObcOn = o.statObcOn(); + statObcOcf = o.statObcOcf(); + batStat = o.batStat(); + batTemp2Raw = o.batTemp2Raw(); + voltVd0 = o.voltVd0(); + voltVd1 = o.voltVd1(); + voltVd2 = o.voltVd2(); + vObc00 = o.vObc00(); + iObc00 = o.iObc00(); + pObc00 = o.pObc00(); + vObc01 = o.vObc01(); + iObc01 = o.iObc01(); + pObc01 = o.pObc01(); + vObc02 = o.vObc02(); + iObc02 = o.iObc02(); + pObc02 = o.pObc02(); + vObc03 = o.vObc03(); + iObc03 = o.iObc03(); + pObc03 = o.pObc03(); + vObc05 = o.vObc05(); + iObc05 = o.iObc05(); + pObc05 = o.pObc05(); + vObc06 = o.vObc06(); + iObc06 = o.iObc06(); + pObc06 = o.pObc06(); + statusStid = o.statusStid(); + statusIvid = o.statusIvid(); + statusRc = o.statusRc(); + statusBid = o.statusBid(); + statusCmderr = o.statusCmderr(); + statusStat = o.statusStat(); + mode = o.mode(); + conf = o.conf(); + resetCause = o.resetCause(); + uptime = o.uptime(); + error = o.error(); + rcCntPwron = o.rcCntPwron(); + rcCntWdg = o.rcCntWdg(); + rcCntCmd = o.rcCntCmd(); + rcCntMcu = o.rcCntMcu(); + rcCntEmlopo = o.rcCntEmlopo(); + prevcmdElapsed = o.prevcmdElapsed(); + photodiode1 = o.photodiode1(); + photodiode2 = o.photodiode2(); + photodiode3 = o.photodiode3(); + photodiode4 = o.photodiode4(); + photodiode5 = o.photodiode5(); + photodiode6 = o.photodiode6(); + panelTemperature1 = o.panelTemperature1(); + panelTemperature2 = o.panelTemperature2(); + panelTemperature3 = o.panelTemperature3(); + panelTemperature4 = o.panelTemperature4(); + panelTemperature5 = o.panelTemperature5(); + panelTemperature6 = o.panelTemperature6(); + compswModeRaw = o.swModeRaw(); + complastResetReasonRaw = o.lastResetReasonRaw(); + compresetOrderRaw = o.resetOrderRaw(); + compnbResetRaw = o.nbResetRaw(); + compformatSdcardOrderRaw = o.formatSdcardOrderRaw(); + compdeployAntennasSystemRaw = o.deployAntennasSystemRaw(); + compnbTmSinceFirstStartRaw = o.nbTmSinceFirstStartRaw(); + compnbTcSinceFirstStartRaw = o.nbTcSinceFirstStartRaw(); + compnbTcPingSinceFirstStartRaw = o.nbTcPingSinceFirstStartRaw(); + compnbBadTcSinceFirstStartRaw = o.nbBadTcSinceFirstStartRaw(); + compnbTmInSdcardRaw = o.nbTmInSdcardRaw(); + comptrxvutxInstantaneousRfReflectedPowerFromTransmitterPortMw = + o.trxvutxInstantaneousRfReflectedPowerFromTransmitterPortMw(); + comptrxvutxInstantaneousRfForwardPowerFromTransmitterPortMw = + o.trxvutxInstantaneousRfForwardPowerFromTransmitterPortMw(); + comptrxvutxSupplyVoltageV = o.trxvutxSupplyVoltageV(); + comptrxvutxTotalSupplyCurrentMa = o.trxvutxTotalSupplyCurrentMa(); + comptrxvutxTransmitterCurrentMa = o.trxvutxTransmitterCurrentMa(); + comptrxvutxReceiverCurrentMa = o.trxvutxReceiverCurrentMa(); + comptrxvutxPowerAmplifierCurrentMa = o.trxvutxPowerAmplifierCurrentMa(); + comptrxvutxPowerAmplifierTemperatureC = o.trxvutxPowerAmplifierTemperatureC(); + comptrxvutxLocalOscillatorTemperatureC = o.trxvutxLocalOscillatorTemperatureC(); + comptrxvurxInstantaneousReceivedSignalDopplerHz = + o.trxvurxInstantaneousReceivedSignalDopplerHz(); + comptrxvurxInstantaneousReceivedSignalStrengthDbm = + o.trxvurxInstantaneousReceivedSignalStrengthDbm(); + comptrxvurxSupplyVoltageV = o.trxvurxSupplyVoltageV(); + comptrxvurxTotalSupplyCurrentMa = o.trxvurxTotalSupplyCurrentMa(); + comptrxvurxTransmitterCurrentMa = o.trxvurxTransmitterCurrentMa(); + comptrxvurxReceiverCurrentMa = o.trxvurxReceiverCurrentMa(); + comptrxvurxPowerAmplifierCurrentMa = o.trxvurxPowerAmplifierCurrentMa(); + comptrxvurxPowerAmplifierTemperatureC = o.trxvurxPowerAmplifierTemperatureC(); + comptrxvurxLocalOscillatorTemperatureC = o.trxvurxLocalOscillatorTemperatureC(); + compimtqSystemStateModeRaw = o.imtqSystemStateModeRaw(); + compmeasureCoilXCurrentMa = o.measureCoilXCurrentMa(); + compmeasureCoilYCurrentMa = o.measureCoilYCurrentMa(); + compmeasureCoilZCurrentMa = o.measureCoilZCurrentMa(); + compmeasureCoilXTemperatureC = o.measureCoilXTemperatureC(); + compmeasureCoilYTemperatureC = o.measureCoilYTemperatureC(); + compmeasureCoilZTemperatureC = o.measureCoilZTemperatureC(); + compmcuTemperatureC = o.mcuTemperatureC(); + compsideAAntsTemperatureRaw = o.sideAAntsTemperatureRaw(); + compsideAAntsDeploymentStatusRaw = o.sideAAntsDeploymentStatusRaw(); + compvoltBrdSupRawV = o.voltBrdSupRawV(); + comptempRawT = o.tempRawT(); + compvDistInputRawV = o.vDistInputRawV(); + compiDistInputRawMa = o.iDistInputRawMa(); + comppDistInputRawMw = o.pDistInputRawMw(); + compvBattInputRawV = o.vBattInputRawV(); + compiBattInputRawMa = o.iBattInputRawMa(); + comppBattInputRawMw = o.pBattInputRawMw(); + compstatObcOnRaw = o.statObcOnRaw(); + compstatObcOcfRaw = o.statObcOcfRaw(); + compbatStatRaw = o.batStatRaw(); + compbatTemp2RawT = o.batTemp2RawT(); + compvoltVd0Raw = o.voltVd0Raw(); + compvoltVd1Raw = o.voltVd1Raw(); + compvoltVd2Raw = o.voltVd2Raw(); + compvObc00V = o.vObc00V(); + compiObc00Ma = o.iObc00Ma(); + comppObc00Mw = o.pObc00Mw(); + compvObc01V = o.vObc01V(); + compiObc01Ma = o.iObc01Ma(); + comppObc01Mw = o.pObc01Mw(); + compvObc02V = o.vObc02V(); + compiObc02Ma = o.iObc02Ma(); + comppObc02Mw = o.pObc02Mw(); + compvObc03V = o.vObc03V(); + compiObc03Ma = o.iObc03Ma(); + comppObc03Mw = o.pObc03Mw(); + compvObc05V = o.vObc05V(); + compiObc05Ma = o.iObc05Ma(); + comppObc05Mw = o.pObc05Mw(); + compvObc06V = o.vObc06V(); + compiObc06Ma = o.iObc06Ma(); + comppObc06Mw = o.pObc06Mw(); + compstatusStidRaw = o.statusStidRaw(); + compstatusIvidRaw = o.statusIvidRaw(); + compstatusRcRaw = o.statusRcRaw(); + compstatusBidRaw = o.statusBidRaw(); + compstatusCmderrRaw = o.statusCmderrRaw(); + compstatusStatRaw = o.statusStatRaw(); + compmodeRaw = o.modeRaw(); + compconfRaw = o.confRaw(); + compresetCauseRaw = o.resetCauseRaw(); + compuptimeRaw = o.uptimeRaw(); + comperrorRaw = o.errorRaw(); + comprcCntPwronRaw = o.rcCntPwronRaw(); + comprcCntWdgRaw = o.rcCntWdgRaw(); + comprcCntCmdRaw = o.rcCntCmdRaw(); + comprcCntMcuRaw = o.rcCntMcuRaw(); + comprcCntEmlopoRaw = o.rcCntEmlopoRaw(); + compprevcmdElapsedRaw = o.prevcmdElapsedRaw(); + compphotodiode1Raw = o.photodiode1Raw(); + compphotodiode2Raw = o.photodiode2Raw(); + compphotodiode3Raw = o.photodiode3Raw(); + compphotodiode4Raw = o.photodiode4Raw(); + compphotodiode5Raw = o.photodiode5Raw(); + compphotodiode6Raw = o.photodiode6Raw(); + comppanelTemperature1C = o.panelTemperature1C(); + comppanelTemperature2C = o.panelTemperature2C(); + comppanelTemperature3C = o.panelTemperature3C(); + comppanelTemperature4C = o.panelTemperature4C(); + comppanelTemperature5C = o.panelTemperature5C(); + comppanelTemperature6C = o.panelTemperature6C(); + } + + public String toStringRaw() { + + return " " + + separator + + "swMode : " + + swMode + + separator + + "lastResetReason : " + + lastResetReason + + separator + + "resetOrder : " + + resetOrder + + separator + + "nbReset : " + + nbReset + + separator + + "formatSdcardOrder : " + + formatSdcardOrder + + separator + + "deployAntennasSystem : " + + deployAntennasSystem + + separator + + "nbTmSinceFirstStart : " + + nbTmSinceFirstStart + + separator + + "nbTcSinceFirstStart : " + + nbTcSinceFirstStart + + separator + + "nbTcPingSinceFirstStart : " + + nbTcPingSinceFirstStart + + separator + + "nbBadTcSinceFirstStart : " + + nbBadTcSinceFirstStart + + separator + + "nbTmInSdcard : " + + nbTmInSdcard + + separator + + "trxvutxInstantaneousRfReflectedPowerFromTransmitterPort : " + + trxvutxInstantaneousRfReflectedPowerFromTransmitterPort + + separator + + "trxvutxInstantaneousRfForwardPowerFromTransmitterPort : " + + trxvutxInstantaneousRfForwardPowerFromTransmitterPort + + separator + + "trxvutxSupplyVoltage : " + + trxvutxSupplyVoltage + + separator + + "trxvutxTotalSupplyCurrent : " + + trxvutxTotalSupplyCurrent + + separator + + "trxvutxTransmitterCurrent : " + + trxvutxTransmitterCurrent + + separator + + "trxvutxReceiverCurrent : " + + trxvutxReceiverCurrent + + separator + + "trxvutxPowerAmplifierCurrent : " + + trxvutxPowerAmplifierCurrent + + separator + + "trxvutxPowerAmplifierTemperature : " + + trxvutxPowerAmplifierTemperature + + separator + + "trxvutxLocalOscillatorTemperature : " + + trxvutxLocalOscillatorTemperature + + separator + + "trxvurxInstantaneousReceivedSignalDopplerOffsetAtTheReceiverPort : " + + trxvurxInstantaneousReceivedSignalDopplerOffsetAtTheReceiverPort + + separator + + "trxvurxInstantaneousReceivedSignalStrengthAtTheReceiverPort : " + + trxvurxInstantaneousReceivedSignalStrengthAtTheReceiverPort + + separator + + "trxvurxSupplyVoltage : " + + trxvurxSupplyVoltage + + separator + + "trxvurxTotalSupplyCurrent : " + + trxvurxTotalSupplyCurrent + + separator + + "trxvurxTransmitterCurrent : " + + trxvurxTransmitterCurrent + + separator + + "trxvurxReceiverCurrent : " + + trxvurxReceiverCurrent + + separator + + "trxvurxPowerAmplifierCurrent : " + + trxvurxPowerAmplifierCurrent + + separator + + "trxvurxPowerAmplifierTemperature : " + + trxvurxPowerAmplifierTemperature + + separator + + "trxvurxLocalOscillatorTemperature : " + + trxvurxLocalOscillatorTemperature + + separator + + "imtqSystemStateMode : " + + imtqSystemStateMode + + separator + + "measureCoilXCurrent : " + + measureCoilXCurrent + + separator + + "measureCoilYCurrent : " + + measureCoilYCurrent + + separator + + "measureCoilZCurrent : " + + measureCoilZCurrent + + separator + + "measureCoilXTemperature : " + + measureCoilXTemperature + + separator + + "measureCoilYTemperature : " + + measureCoilYTemperature + + separator + + "measureCoilZTemperature : " + + measureCoilZTemperature + + separator + + "mcuTemperature : " + + mcuTemperature + + separator + + "sideAAntsTemperature : " + + sideAAntsTemperature + + separator + + "sideAAntsDeploymentStatus : " + + sideAAntsDeploymentStatus + + separator + + "voltBrdSupRaw : " + + voltBrdSupRaw + + separator + + "tempRaw : " + + tempRaw + + separator + + "vDistInputRaw : " + + vDistInputRaw + + separator + + "iDistInputRaw : " + + iDistInputRaw + + separator + + "pDistInputRaw : " + + pDistInputRaw + + separator + + "vBattInputRaw : " + + vBattInputRaw + + separator + + "iBattInputRaw : " + + iBattInputRaw + + separator + + "pBattInputRaw : " + + pBattInputRaw + + separator + + "statObcOn : " + + statObcOn + + separator + + "statObcOcf : " + + statObcOcf + + separator + + "batStat : " + + batStat + + separator + + "batTemp2Raw : " + + batTemp2Raw + + separator + + "voltVd0 : " + + voltVd0 + + separator + + "voltVd1 : " + + voltVd1 + + separator + + "voltVd2 : " + + voltVd2 + + separator + + "vObc00 : " + + vObc00 + + separator + + "iObc00 : " + + iObc00 + + separator + + "pObc00 : " + + pObc00 + + separator + + "vObc01 : " + + vObc01 + + separator + + "iObc01 : " + + iObc01 + + separator + + "pObc01 : " + + pObc01 + + separator + + "vObc02 : " + + vObc02 + + separator + + "iObc02 : " + + iObc02 + + separator + + "pObc02 : " + + pObc02 + + separator + + "vObc03 : " + + vObc03 + + separator + + "iObc03 : " + + iObc03 + + separator + + "pObc03 : " + + pObc03 + + separator + + "vObc05 : " + + vObc05 + + separator + + "iObc05 : " + + iObc05 + + separator + + "pObc05 : " + + pObc05 + + separator + + "vObc06 : " + + vObc06 + + separator + + "iObc06 : " + + iObc06 + + separator + + "pObc06 : " + + pObc06 + + separator + + "statusStid : " + + statusStid + + separator + + "statusIvid : " + + statusIvid + + separator + + "statusRc : " + + statusRc + + separator + + "statusBid : " + + statusBid + + separator + + "statusCmderr : " + + statusCmderr + + separator + + "statusStat : " + + statusStat + + separator + + "mode : " + + mode + + separator + + "conf : " + + conf + + separator + + "resetCause : " + + resetCause + + separator + + "uptime : " + + uptime + + separator + + "error : " + + error + + separator + + "rcCntPwron : " + + rcCntPwron + + separator + + "rcCntWdg : " + + rcCntWdg + + separator + + "rcCntCmd : " + + rcCntCmd + + separator + + "rcCntMcu : " + + rcCntMcu + + separator + + "rcCntEmlopo : " + + rcCntEmlopo + + separator + + "prevcmdElapsed : " + + prevcmdElapsed + + separator + + "photodiode1 : " + + photodiode1 + + separator + + "photodiode2 : " + + photodiode2 + + separator + + "photodiode3 : " + + photodiode3 + + separator + + "photodiode4 : " + + photodiode4 + + separator + + "photodiode5 : " + + photodiode5 + + separator + + "photodiode6 : " + + photodiode6 + + separator + + "panelTemperature1 : " + + panelTemperature1 + + separator + + "panelTemperature2 : " + + panelTemperature2 + + separator + + "panelTemperature3 : " + + panelTemperature3 + + separator + + "panelTemperature4 : " + + panelTemperature4 + + separator + + "panelTemperature5 : " + + panelTemperature5 + + separator + + "panelTemperature6 : " + + panelTemperature6; + } + + public String toStringCompute() { + + return " " + + separator + + "sw mode : Ox" + + toHex(swMode) + + " : " + + compswModeRaw + + separator + + "last reset reason : Ox" + + toHex(lastResetReason) + + " : " + + complastResetReasonRaw + + separator + + "reset order : Ox" + + toHex(resetOrder) + + " : " + + compresetOrderRaw + + separator + + "nb reset : Ox" + + toHex(nbReset) + + " : " + + compnbResetRaw + + separator + + "format sdcard order : Ox" + + toHex(formatSdcardOrder) + + " : " + + compformatSdcardOrderRaw + + separator + + "deploy antennas system : Ox" + + toHex(deployAntennasSystem) + + " : " + + compdeployAntennasSystemRaw + + separator + + "nb tm since first start : Ox" + + toHex(nbTmSinceFirstStart) + + " : " + + compnbTmSinceFirstStartRaw + + separator + + "nb tc since first start : Ox" + + toHex(nbTcSinceFirstStart) + + " : " + + compnbTcSinceFirstStartRaw + + separator + + "nb tc ping since first start : Ox" + + toHex(nbTcPingSinceFirstStart) + + " : " + + compnbTcPingSinceFirstStartRaw + + separator + + "nb bad tc since first start : Ox" + + toHex(nbBadTcSinceFirstStart) + + " : " + + compnbBadTcSinceFirstStartRaw + + separator + + "nb tm in sdcard : Ox" + + toHex(nbTmInSdcard) + + " : " + + compnbTmInSdcardRaw + + separator + + "trxvutx instantaneous rf reflected power from transmitter port (mW) : Ox" + + toHex(trxvutxInstantaneousRfReflectedPowerFromTransmitterPort) + + " : " + + String.format("%.3f", +comptrxvutxInstantaneousRfReflectedPowerFromTransmitterPortMw) + + separator + + "trxvutx instantaneous rf forward power from transmitter port (mW) : Ox" + + toHex(trxvutxInstantaneousRfForwardPowerFromTransmitterPort) + + " : " + + String.format("%.3f", +comptrxvutxInstantaneousRfForwardPowerFromTransmitterPortMw) + + separator + + "trxvutx supply voltage (V) : Ox" + + toHex(trxvutxSupplyVoltage) + + " : " + + String.format("%.3f", +comptrxvutxSupplyVoltageV) + + separator + + "trxvutx total supply current (mA) : Ox" + + toHex(trxvutxTotalSupplyCurrent) + + " : " + + String.format("%.3f", +comptrxvutxTotalSupplyCurrentMa) + + separator + + "trxvutx transmitter current (mA) : Ox" + + toHex(trxvutxTransmitterCurrent) + + " : " + + String.format("%.3f", +comptrxvutxTransmitterCurrentMa) + + separator + + "trxvutx receiver current (mA) : Ox" + + toHex(trxvutxReceiverCurrent) + + " : " + + String.format("%.3f", +comptrxvutxReceiverCurrentMa) + + separator + + "trxvutx power amplifier current (mA) : Ox" + + toHex(trxvutxPowerAmplifierCurrent) + + " : " + + String.format("%.3f", +comptrxvutxPowerAmplifierCurrentMa) + + separator + + "trxvutx power amplifier temperature (°C) : Ox" + + toHex(trxvutxPowerAmplifierTemperature) + + " : " + + String.format("%.3f", +comptrxvutxPowerAmplifierTemperatureC) + + separator + + "trxvutx local oscillator temperature (°C) : Ox" + + toHex(trxvutxLocalOscillatorTemperature) + + " : " + + String.format("%.3f", +comptrxvutxLocalOscillatorTemperatureC) + + separator + + "trxvurx instantaneous received signal doppler (Hz) : Ox" + + toHex(trxvurxInstantaneousReceivedSignalDopplerOffsetAtTheReceiverPort) + + " : " + + String.format("%.3f", +comptrxvurxInstantaneousReceivedSignalDopplerHz) + + separator + + "trxvurx instantaneous received signal strength (dbm) : Ox" + + toHex(trxvurxInstantaneousReceivedSignalStrengthAtTheReceiverPort) + + " : " + + String.format("%.3f", +comptrxvurxInstantaneousReceivedSignalStrengthDbm) + + separator + + "trxvurx supply voltage (V) : Ox" + + toHex(trxvurxSupplyVoltage) + + " : " + + String.format("%.3f", +comptrxvurxSupplyVoltageV) + + separator + + "trxvurx total supply current (mA) : Ox" + + toHex(trxvurxTotalSupplyCurrent) + + " : " + + String.format("%.3f", +comptrxvurxTotalSupplyCurrentMa) + + separator + + "trxvurx transmitter current (mA) : Ox" + + toHex(trxvurxTransmitterCurrent) + + " : " + + String.format("%.3f", +comptrxvurxTransmitterCurrentMa) + + separator + + "trxvurx receiver current (mA) : Ox" + + toHex(trxvurxReceiverCurrent) + + " : " + + String.format("%.3f", +comptrxvurxReceiverCurrentMa) + + separator + + "trxvurx power amplifier current (mA) : Ox" + + toHex(trxvurxPowerAmplifierCurrent) + + " : " + + String.format("%.3f", +comptrxvurxPowerAmplifierCurrentMa) + + separator + + "trxvurx power amplifier temperature (°C) : Ox" + + toHex(trxvurxPowerAmplifierTemperature) + + " : " + + String.format("%.3f", +comptrxvurxPowerAmplifierTemperatureC) + + separator + + "trxvurx local oscillator temperature (°C) : Ox" + + toHex(trxvurxLocalOscillatorTemperature) + + " : " + + String.format("%.3f", +comptrxvurxLocalOscillatorTemperatureC) + + separator + + "imtq system state mode : Ox" + + toHex(imtqSystemStateMode) + + " : " + + compimtqSystemStateModeRaw + + separator + + "measure coil x current (mA) : Ox" + + toHex(measureCoilXCurrent) + + " : " + + String.format("%.3f", +compmeasureCoilXCurrentMa) + + separator + + "measure coil y current (mA) : Ox" + + toHex(measureCoilYCurrent) + + " : " + + String.format("%.3f", +compmeasureCoilYCurrentMa) + + separator + + "measure coil z current (mA) : Ox" + + toHex(measureCoilZCurrent) + + " : " + + String.format("%.3f", +compmeasureCoilZCurrentMa) + + separator + + "measure coil x temperature (°C) : Ox" + + toHex(measureCoilXTemperature) + + " : " + + String.format("%.3f", +compmeasureCoilXTemperatureC) + + separator + + "measure coil y temperature (°C) : Ox" + + toHex(measureCoilYTemperature) + + " : " + + String.format("%.3f", +compmeasureCoilYTemperatureC) + + separator + + "measure coil z temperature (°C) : Ox" + + toHex(measureCoilZTemperature) + + " : " + + String.format("%.3f", +compmeasureCoilZTemperatureC) + + separator + + "mcu temperature (°C) : Ox" + + toHex(mcuTemperature) + + " : " + + String.format("%.3f", +compmcuTemperatureC) + + separator + + "side a ants temperature : Ox" + + toHex(sideAAntsTemperature) + + " : " + + compsideAAntsTemperatureRaw + + separator + + "side a ants deployment status : Ox" + + toHex(sideAAntsDeploymentStatus) + + " : " + + compsideAAntsDeploymentStatusRaw + + separator + + "volt brd sup raw (V) : Ox" + + toHex(voltBrdSupRaw) + + " : " + + String.format("%.3f", +compvoltBrdSupRawV) + + separator + + "temp raw t : Ox" + + toHex(tempRaw) + + " : " + + String.format("%.3f", +comptempRawT) + + separator + + "v dist input raw (V) : Ox" + + toHex(vDistInputRaw) + + " : " + + String.format("%.3f", +compvDistInputRawV) + + separator + + "i dist input raw (mA) : Ox" + + toHex(iDistInputRaw) + + " : " + + String.format("%.3f", +compiDistInputRawMa) + + separator + + "p dist input raw (mW) : Ox" + + toHex(pDistInputRaw) + + " : " + + String.format("%.3f", +comppDistInputRawMw) + + separator + + "v batt input raw (V) : Ox" + + toHex(vBattInputRaw) + + " : " + + String.format("%.3f", +compvBattInputRawV) + + separator + + "i batt input raw (mA) : Ox" + + toHex(iBattInputRaw) + + " : " + + String.format("%.3f", +compiBattInputRawMa) + + separator + + "p batt input raw (mW) : Ox" + + toHex(pBattInputRaw) + + " : " + + String.format("%.3f", +comppBattInputRawMw) + + separator + + "stat obc on : Ox" + + toHex(statObcOn) + + " : " + + compstatObcOnRaw + + separator + + "stat obc ocf : Ox" + + toHex(statObcOcf) + + " : " + + compstatObcOcfRaw + + separator + + "bat stat : Ox" + + toHex(batStat) + + " : " + + compbatStatRaw + + separator + + "bat temp 2 raw t : Ox" + + toHex(batTemp2Raw) + + " : " + + String.format("%.3f", +compbatTemp2RawT) + + separator + + "volt vd0 : Ox" + + toHex(voltVd0) + + " : " + + compvoltVd0Raw + + separator + + "volt vd1 : Ox" + + toHex(voltVd1) + + " : " + + compvoltVd1Raw + + separator + + "volt vd2 : Ox" + + toHex(voltVd2) + + " : " + + compvoltVd2Raw + + separator + + "v obc 00 (V) : Ox" + + toHex(vObc00) + + " : " + + String.format("%.3f", +compvObc00V) + + separator + + "i obc 00 (mA) : Ox" + + toHex(iObc00) + + " : " + + String.format("%.3f", +compiObc00Ma) + + separator + + "p obc 00 (mW) : Ox" + + toHex(pObc00) + + " : " + + String.format("%.3f", +comppObc00Mw) + + separator + + "v obc 01 (V) : Ox" + + toHex(vObc01) + + " : " + + String.format("%.3f", +compvObc01V) + + separator + + "i obc 01 (mA) : Ox" + + toHex(iObc01) + + " : " + + String.format("%.3f", +compiObc01Ma) + + separator + + "p obc 01 (mW) : Ox" + + toHex(pObc01) + + " : " + + String.format("%.3f", +comppObc01Mw) + + separator + + "v obc 02 (V) : Ox" + + toHex(vObc02) + + " : " + + String.format("%.3f", +compvObc02V) + + separator + + "i obc 02 (mA) : Ox" + + toHex(iObc02) + + " : " + + String.format("%.3f", +compiObc02Ma) + + separator + + "p obc 02 (mW) : Ox" + + toHex(pObc02) + + " : " + + String.format("%.3f", +comppObc02Mw) + + separator + + "v obc 03 (V) : Ox" + + toHex(vObc03) + + " : " + + String.format("%.3f", +compvObc03V) + + separator + + "i obc 03 (mA) : Ox" + + toHex(iObc03) + + " : " + + String.format("%.3f", +compiObc03Ma) + + separator + + "p obc 03 (mW) : Ox" + + toHex(pObc03) + + " : " + + String.format("%.3f", +comppObc03Mw) + + separator + + "v obc 05 (V) : Ox" + + toHex(vObc05) + + " : " + + String.format("%.3f", +compvObc05V) + + separator + + "i obc 05 (mA) : Ox" + + toHex(iObc05) + + " : " + + String.format("%.3f", +compiObc05Ma) + + separator + + "p obc 05 (mW) : Ox" + + toHex(pObc05) + + " : " + + String.format("%.3f", +comppObc05Mw) + + separator + + "v obc 06 (V) : Ox" + + toHex(vObc06) + + " : " + + String.format("%.3f", +compvObc06V) + + separator + + "i obc 06 (mA) : Ox" + + toHex(iObc06) + + " : " + + String.format("%.3f", +compiObc06Ma) + + separator + + "p obc 06 (mW) : Ox" + + toHex(pObc06) + + " : " + + String.format("%.3f", +comppObc06Mw) + + separator + + "status stid : Ox" + + toHex(statusStid) + + " : " + + compstatusStidRaw + + separator + + "status ivid : Ox" + + toHex(statusIvid) + + " : " + + compstatusIvidRaw + + separator + + "status rc : Ox" + + toHex(statusRc) + + " : " + + compstatusRcRaw + + separator + + "status bid : Ox" + + toHex(statusBid) + + " : " + + compstatusBidRaw + + separator + + "status cmderr : Ox" + + toHex(statusCmderr) + + " : " + + compstatusCmderrRaw + + separator + + "status stat : Ox" + + toHex(statusStat) + + " : " + + compstatusStatRaw + + separator + + "mode : Ox" + + toHex(mode) + + " : " + + compmodeRaw + + separator + + "conf : Ox" + + toHex(conf) + + " : " + + compconfRaw + + separator + + "reset cause : Ox" + + toHex(resetCause) + + " : " + + compresetCauseRaw + + separator + + "uptime : Ox" + + toHex(uptime) + + " : " + + compuptimeRaw + + separator + + "error : Ox" + + toHex(error) + + " : " + + comperrorRaw + + separator + + "rc cnt pwron : Ox" + + toHex(rcCntPwron) + + " : " + + comprcCntPwronRaw + + separator + + "rc cnt wdg : Ox" + + toHex(rcCntWdg) + + " : " + + comprcCntWdgRaw + + separator + + "rc cnt cmd : Ox" + + toHex(rcCntCmd) + + " : " + + comprcCntCmdRaw + + separator + + "rc cnt mcu : Ox" + + toHex(rcCntMcu) + + " : " + + comprcCntMcuRaw + + separator + + "rc cnt emlopo : Ox" + + toHex(rcCntEmlopo) + + " : " + + comprcCntEmlopoRaw + + separator + + "prevcmd elapsed : Ox" + + toHex(prevcmdElapsed) + + " : " + + compprevcmdElapsedRaw + + separator + + "photodiode 1 : Ox" + + toHex(photodiode1) + + " : " + + compphotodiode1Raw + + separator + + "photodiode 2 : Ox" + + toHex(photodiode2) + + " : " + + compphotodiode2Raw + + separator + + "photodiode 3 : Ox" + + toHex(photodiode3) + + " : " + + compphotodiode3Raw + + separator + + "photodiode 4 : Ox" + + toHex(photodiode4) + + " : " + + compphotodiode4Raw + + separator + + "photodiode 5 : Ox" + + toHex(photodiode5) + + " : " + + compphotodiode5Raw + + separator + + "photodiode 6 : Ox" + + toHex(photodiode6) + + " : " + + compphotodiode6Raw + + separator + + "panel temperature 1 (°C) : Ox" + + toHex(panelTemperature1) + + " : " + + String.format("%.3f", +comppanelTemperature1C) + + separator + + "panel temperature 2 (°C) : Ox" + + toHex(panelTemperature2) + + " : " + + String.format("%.3f", +comppanelTemperature2C) + + separator + + "panel temperature 3 (°C) : Ox" + + toHex(panelTemperature3) + + " : " + + String.format("%.3f", +comppanelTemperature3C) + + separator + + "panel temperature 4 (°C) : Ox" + + toHex(panelTemperature4) + + " : " + + String.format("%.3f", +comppanelTemperature4C) + + separator + + "panel temperature 5 (°C) : Ox" + + toHex(panelTemperature5) + + " : " + + String.format("%.3f", +comppanelTemperature5C) + + separator + + "panel temperature 6 (°C) : Ox" + + toHex(panelTemperature6) + + " : " + + String.format("%.3f", +comppanelTemperature6C); + } } diff --git a/ModuleUVSQsatTelemetry/src/main/java/org/josast/uvsqsat/pojogenerated/callsign.java b/ModuleUVSQsatTelemetry/src/main/java/org/josast/uvsqsat/pojogenerated/callsign.java index 3afddc17b683015ee6fd8121343e9064b3c09435..e7c8a59ecccdaff8fa93fcce3656202b597e8a75 100644 --- a/ModuleUVSQsatTelemetry/src/main/java/org/josast/uvsqsat/pojogenerated/callsign.java +++ b/ModuleUVSQsatTelemetry/src/main/java/org/josast/uvsqsat/pojogenerated/callsign.java @@ -5,23 +5,20 @@ package org.josast.uvsqsat.pojogenerated; import org.josast.uvsqsat.generated.Uvsqsat.Callsign; -public class callsign extends AFrame { +public class callsign extends AFrame { - private String separator=" \r\n" ; -/** - data raw Declaration **/ -/** - Instance Declaration **/ - public callsign(Callsign o) { + private String separator = " \r\n"; + /** - data raw Declaration * */ + /** - Instance Declaration * */ + public callsign(Callsign o) {} - } + public String toStringRaw() { - public String toStringRaw () { - - return " " -; } + return " "; + } - public String toStringCompute () { - - return " " -; } + public String toStringCompute() { + return " "; + } } diff --git a/ModuleUVSQsatTelemetry/src/main/java/org/josast/uvsqsat/pojogenerated/callsignRaw.java b/ModuleUVSQsatTelemetry/src/main/java/org/josast/uvsqsat/pojogenerated/callsignRaw.java index 5bf22ac86857dbdb0f402d80c88b399db989908f..379bbe0cf0c5c84b11e52162c5a1ed4d58645a4c 100644 --- a/ModuleUVSQsatTelemetry/src/main/java/org/josast/uvsqsat/pojogenerated/callsignRaw.java +++ b/ModuleUVSQsatTelemetry/src/main/java/org/josast/uvsqsat/pojogenerated/callsignRaw.java @@ -5,23 +5,20 @@ package org.josast.uvsqsat.pojogenerated; import org.josast.uvsqsat.generated.Uvsqsat.CallsignRaw; -public class callsignRaw extends AFrame { +public class callsignRaw extends AFrame { - private String separator=" \r\n" ; -/** - data raw Declaration **/ -/** - Instance Declaration **/ - public callsignRaw(CallsignRaw o) { + private String separator = " \r\n"; + /** - data raw Declaration * */ + /** - Instance Declaration * */ + public callsignRaw(CallsignRaw o) {} - } + public String toStringRaw() { - public String toStringRaw () { - - return " " -; } + return " "; + } - public String toStringCompute () { - - return " " -; } + public String toStringCompute() { + return " "; + } } diff --git a/ModuleUVSQsatTelemetry/src/main/java/org/josast/uvsqsat/pojogenerated/iFrame.java b/ModuleUVSQsatTelemetry/src/main/java/org/josast/uvsqsat/pojogenerated/iFrame.java index 9efaaccaae9080c31577033a6e45aed8e062e51f..a85c1c5d236cdfa27dfce7cea9f352169729cf8a 100644 --- a/ModuleUVSQsatTelemetry/src/main/java/org/josast/uvsqsat/pojogenerated/iFrame.java +++ b/ModuleUVSQsatTelemetry/src/main/java/org/josast/uvsqsat/pojogenerated/iFrame.java @@ -5,29 +5,27 @@ package org.josast.uvsqsat.pojogenerated; import org.josast.uvsqsat.generated.Uvsqsat.IFrame; -public class iFrame extends AFrame { - - private String separator=" \r\n" ; -/** - data raw Declaration **/ - private int pid; -private byte[] ax25Info; -/** - Instance Declaration **/ - public iFrame(IFrame o) { - - pid = o.pid(); - ax25Info = o.ax25Info(); - } - - public String toStringRaw () { - - return " " - + separator + "pid : " +pid - + separator + "ax25Info : " +ax25Info -; } - - public String toStringCompute () { - - return " " -; } +public class iFrame extends AFrame { + private String separator = " \r\n"; + /** - data raw Declaration * */ + private int pid; + + private byte[] ax25Info; + /** - Instance Declaration * */ + public iFrame(IFrame o) { + + pid = o.pid(); + ax25Info = o.ax25Info(); + } + + public String toStringRaw() { + + return " " + separator + "pid : " + pid + separator + "ax25Info : " + ax25Info; + } + + public String toStringCompute() { + + return " "; + } } diff --git a/ModuleUVSQsatTelemetry/src/main/java/org/josast/uvsqsat/pojogenerated/iepsHkStatus.java b/ModuleUVSQsatTelemetry/src/main/java/org/josast/uvsqsat/pojogenerated/iepsHkStatus.java index 6330696c558840428f48557139e5ba2bce8a8825..b5b856a134563dd7084b8235f32c06357b5d9912 100644 --- a/ModuleUVSQsatTelemetry/src/main/java/org/josast/uvsqsat/pojogenerated/iepsHkStatus.java +++ b/ModuleUVSQsatTelemetry/src/main/java/org/josast/uvsqsat/pojogenerated/iepsHkStatus.java @@ -5,377 +5,733 @@ package org.josast.uvsqsat.pojogenerated; import org.josast.uvsqsat.generated.Uvsqsat.IepsHkStatus; -public class iepsHkStatus extends AFrame { +public class iepsHkStatus extends AFrame { - private String separator=" \r\n" ; -/** - data raw Declaration **/ - private int hKStid; - private int hKIvid; - private int hKRc; - private int hKBid; - private long hKCmderr; - private long hKStat; - private int voltBrdSupRaw; - private int tempRaw; - private int vDistInputRaw; - private int iDistInputRaw; - private int pDistInputRaw; - private int vBattInputRaw; - private int iBattInputRaw; - private int pBattInputRaw; - private int statObcOn; - private int statObcOcf; - private int batStat; - private int batTemp2Raw; - private int voltVd0; - private int voltVd1; - private int voltVd2; - private int vObc00; - private int iObc00; - private int pObc00; - private int vObc01; - private int iObc01; - private int pObc01; - private int vObc02; - private int iObc02; - private int pObc02; - private int vObc03; - private int iObc03; - private int pObc03; - private int vObc05; - private int iObc05; - private int pObc05; - private int vObc06; - private int iObc06; - private int pObc06; - private byte[] cc1; - private byte[] cc2; - private byte[] cc3; - private int statusStid; - private int statusIvid; - private int statusRc; - private int statusBid; - private long statusCmderr; - private long statusStat; - private int mode; - private int conf; - private int resetCause; - private long uptime; - private int error; - private int rcCntPwron; - private int rcCntWdg; - private int rcCntCmd; - private int rcCntMcu; - private int rcCntEmlopo; - private int prevcmdElapsed; -/** - Instance Declaration **/ - private long comphKStidRaw; - private long comphKIvidRaw; - private long comphKRcRaw; - private long comphKBidRaw; - private long comphKCmderrRaw; - private long comphKStatRaw; - private double compvoltBrdSupRawV; - private double comptempRawT; - private double compvDistInputRawV; - private double compiDistInputRawMa; - private double comppDistInputRawMw; - private double compvBattInputRawV; - private double compiBattInputRawMa; - private double comppBattInputRawMw; - private long compstatObcOnRaw; - private long compstatObcOcfRaw; - private long compbatStatRaw; - private double compbatTemp2RawT; - private long compvoltVd0Raw; - private long compvoltVd1Raw; - private long compvoltVd2Raw; - private double compvObc00V; - private double compiObc00Ma; - private double comppObc00Mw; - private double compvObc01V; - private double compiObc01Ma; - private double comppObc01Mw; - private double compvObc02V; - private double compiObc02Ma; - private double comppObc02Mw; - private double compvObc03V; - private double compiObc03Ma; - private double comppObc03Mw; - private double compvObc05V; - private double compiObc05Ma; - private double comppObc05Mw; - private double compvObc06V; - private double compiObc06Ma; - private double comppObc06Mw; - private byte [] compcc1Byte; - private byte [] compcc2Byte; - private byte [] compcc3Byte; - private long compstatusStidRaw; - private long compstatusIvidRaw; - private long compstatusRcRaw; - private long compstatusBidRaw; - private long compstatusCmderrRaw; - private long compstatusStatRaw; - private long compmodeRaw; - private long compconfRaw; - private long compresetCauseRaw; - private long compuptimeRaw; - private long comperrorRaw; - private long comprcCntPwronRaw; - private long comprcCntWdgRaw; - private long comprcCntCmdRaw; - private long comprcCntMcuRaw; - private long comprcCntEmlopoRaw; - private long compprevcmdElapsedRaw; - public iepsHkStatus(IepsHkStatus o) { + private String separator = " \r\n"; + /** - data raw Declaration * */ + private int hKStid; - hKStid = o.hKStid(); - hKIvid = o.hKIvid(); - hKRc = o.hKRc(); - hKBid = o.hKBid(); - hKCmderr = o.hKCmderr(); - hKStat = o.hKStat(); - voltBrdSupRaw = o.voltBrdSupRaw(); - tempRaw = o.tempRaw(); - vDistInputRaw = o.vDistInputRaw(); - iDistInputRaw = o.iDistInputRaw(); - pDistInputRaw = o.pDistInputRaw(); - vBattInputRaw = o.vBattInputRaw(); - iBattInputRaw = o.iBattInputRaw(); - pBattInputRaw = o.pBattInputRaw(); - statObcOn = o.statObcOn(); - statObcOcf = o.statObcOcf(); - batStat = o.batStat(); - batTemp2Raw = o.batTemp2Raw(); - voltVd0 = o.voltVd0(); - voltVd1 = o.voltVd1(); - voltVd2 = o.voltVd2(); - vObc00 = o.vObc00(); - iObc00 = o.iObc00(); - pObc00 = o.pObc00(); - vObc01 = o.vObc01(); - iObc01 = o.iObc01(); - pObc01 = o.pObc01(); - vObc02 = o.vObc02(); - iObc02 = o.iObc02(); - pObc02 = o.pObc02(); - vObc03 = o.vObc03(); - iObc03 = o.iObc03(); - pObc03 = o.pObc03(); - vObc05 = o.vObc05(); - iObc05 = o.iObc05(); - pObc05 = o.pObc05(); - vObc06 = o.vObc06(); - iObc06 = o.iObc06(); - pObc06 = o.pObc06(); - cc1 = o.cc1(); - cc2 = o.cc2(); - cc3 = o.cc3(); - statusStid = o.statusStid(); - statusIvid = o.statusIvid(); - statusRc = o.statusRc(); - statusBid = o.statusBid(); - statusCmderr = o.statusCmderr(); - statusStat = o.statusStat(); - mode = o.mode(); - conf = o.conf(); - resetCause = o.resetCause(); - uptime = o.uptime(); - error = o.error(); - rcCntPwron = o.rcCntPwron(); - rcCntWdg = o.rcCntWdg(); - rcCntCmd = o.rcCntCmd(); - rcCntMcu = o.rcCntMcu(); - rcCntEmlopo = o.rcCntEmlopo(); - prevcmdElapsed = o.prevcmdElapsed(); - comphKStidRaw = o.hKStidRaw(); - comphKIvidRaw = o.hKIvidRaw(); - comphKRcRaw = o.hKRcRaw(); - comphKBidRaw = o.hKBidRaw(); - comphKCmderrRaw = o.hKCmderrRaw(); - comphKStatRaw = o.hKStatRaw(); - compvoltBrdSupRawV = o.voltBrdSupRawV(); - comptempRawT = o.tempRawT(); - compvDistInputRawV = o.vDistInputRawV(); - compiDistInputRawMa = o.iDistInputRawMa(); - comppDistInputRawMw = o.pDistInputRawMw(); - compvBattInputRawV = o.vBattInputRawV(); - compiBattInputRawMa = o.iBattInputRawMa(); - comppBattInputRawMw = o.pBattInputRawMw(); - compstatObcOnRaw = o.statObcOnRaw(); - compstatObcOcfRaw = o.statObcOcfRaw(); - compbatStatRaw = o.batStatRaw(); - compbatTemp2RawT = o.batTemp2RawT(); - compvoltVd0Raw = o.voltVd0Raw(); - compvoltVd1Raw = o.voltVd1Raw(); - compvoltVd2Raw = o.voltVd2Raw(); - compvObc00V = o.vObc00V(); - compiObc00Ma = o.iObc00Ma(); - comppObc00Mw = o.pObc00Mw(); - compvObc01V = o.vObc01V(); - compiObc01Ma = o.iObc01Ma(); - comppObc01Mw = o.pObc01Mw(); - compvObc02V = o.vObc02V(); - compiObc02Ma = o.iObc02Ma(); - comppObc02Mw = o.pObc02Mw(); - compvObc03V = o.vObc03V(); - compiObc03Ma = o.iObc03Ma(); - comppObc03Mw = o.pObc03Mw(); - compvObc05V = o.vObc05V(); - compiObc05Ma = o.iObc05Ma(); - comppObc05Mw = o.pObc05Mw(); - compvObc06V = o.vObc06V(); - compiObc06Ma = o.iObc06Ma(); - comppObc06Mw = o.pObc06Mw(); - compcc1Byte = o.cc1Byte(); - compcc2Byte = o.cc2Byte(); - compcc3Byte = o.cc3Byte(); - compstatusStidRaw = o.statusStidRaw(); - compstatusIvidRaw = o.statusIvidRaw(); - compstatusRcRaw = o.statusRcRaw(); - compstatusBidRaw = o.statusBidRaw(); - compstatusCmderrRaw = o.statusCmderrRaw(); - compstatusStatRaw = o.statusStatRaw(); - compmodeRaw = o.modeRaw(); - compconfRaw = o.confRaw(); - compresetCauseRaw = o.resetCauseRaw(); - compuptimeRaw = o.uptimeRaw(); - comperrorRaw = o.errorRaw(); - comprcCntPwronRaw = o.rcCntPwronRaw(); - comprcCntWdgRaw = o.rcCntWdgRaw(); - comprcCntCmdRaw = o.rcCntCmdRaw(); - comprcCntMcuRaw = o.rcCntMcuRaw(); - comprcCntEmlopoRaw = o.rcCntEmlopoRaw(); - compprevcmdElapsedRaw = o.prevcmdElapsedRaw(); - } + private int hKIvid; + private int hKRc; + private int hKBid; + private long hKCmderr; + private long hKStat; + private int voltBrdSupRaw; + private int tempRaw; + private int vDistInputRaw; + private int iDistInputRaw; + private int pDistInputRaw; + private int vBattInputRaw; + private int iBattInputRaw; + private int pBattInputRaw; + private int statObcOn; + private int statObcOcf; + private int batStat; + private int batTemp2Raw; + private int voltVd0; + private int voltVd1; + private int voltVd2; + private int vObc00; + private int iObc00; + private int pObc00; + private int vObc01; + private int iObc01; + private int pObc01; + private int vObc02; + private int iObc02; + private int pObc02; + private int vObc03; + private int iObc03; + private int pObc03; + private int vObc05; + private int iObc05; + private int pObc05; + private int vObc06; + private int iObc06; + private int pObc06; + private byte[] cc1; + private byte[] cc2; + private byte[] cc3; + private int statusStid; + private int statusIvid; + private int statusRc; + private int statusBid; + private long statusCmderr; + private long statusStat; + private int mode; + private int conf; + private int resetCause; + private long uptime; + private int error; + private int rcCntPwron; + private int rcCntWdg; + private int rcCntCmd; + private int rcCntMcu; + private int rcCntEmlopo; + private int prevcmdElapsed; + /** - Instance Declaration * */ + private long comphKStidRaw; - public String toStringRaw () { - - return " " - + separator + "hKStid : " +hKStid - + separator + "hKIvid : " +hKIvid - + separator + "hKRc : " +hKRc - + separator + "hKBid : " +hKBid - + separator + "hKCmderr : " +hKCmderr - + separator + "hKStat : " +hKStat - + separator + "voltBrdSupRaw : " +voltBrdSupRaw - + separator + "tempRaw : " +tempRaw - + separator + "vDistInputRaw : " +vDistInputRaw - + separator + "iDistInputRaw : " +iDistInputRaw - + separator + "pDistInputRaw : " +pDistInputRaw - + separator + "vBattInputRaw : " +vBattInputRaw - + separator + "iBattInputRaw : " +iBattInputRaw - + separator + "pBattInputRaw : " +pBattInputRaw - + separator + "statObcOn : " +statObcOn - + separator + "statObcOcf : " +statObcOcf - + separator + "batStat : " +batStat - + separator + "batTemp2Raw : " +batTemp2Raw - + separator + "voltVd0 : " +voltVd0 - + separator + "voltVd1 : " +voltVd1 - + separator + "voltVd2 : " +voltVd2 - + separator + "vObc00 : " +vObc00 - + separator + "iObc00 : " +iObc00 - + separator + "pObc00 : " +pObc00 - + separator + "vObc01 : " +vObc01 - + separator + "iObc01 : " +iObc01 - + separator + "pObc01 : " +pObc01 - + separator + "vObc02 : " +vObc02 - + separator + "iObc02 : " +iObc02 - + separator + "pObc02 : " +pObc02 - + separator + "vObc03 : " +vObc03 - + separator + "iObc03 : " +iObc03 - + separator + "pObc03 : " +pObc03 - + separator + "vObc05 : " +vObc05 - + separator + "iObc05 : " +iObc05 - + separator + "pObc05 : " +pObc05 - + separator + "vObc06 : " +vObc06 - + separator + "iObc06 : " +iObc06 - + separator + "pObc06 : " +pObc06 - + separator + "cc1 : " +cc1 - + separator + "cc2 : " +cc2 - + separator + "cc3 : " +cc3 - + separator + "statusStid : " +statusStid - + separator + "statusIvid : " +statusIvid - + separator + "statusRc : " +statusRc - + separator + "statusBid : " +statusBid - + separator + "statusCmderr : " +statusCmderr - + separator + "statusStat : " +statusStat - + separator + "mode : " +mode - + separator + "conf : " +conf - + separator + "resetCause : " +resetCause - + separator + "uptime : " +uptime - + separator + "error : " +error - + separator + "rcCntPwron : " +rcCntPwron - + separator + "rcCntWdg : " +rcCntWdg - + separator + "rcCntCmd : " +rcCntCmd - + separator + "rcCntMcu : " +rcCntMcu - + separator + "rcCntEmlopo : " +rcCntEmlopo - + separator + "prevcmdElapsed : " +prevcmdElapsed -; } + private long comphKIvidRaw; + private long comphKRcRaw; + private long comphKBidRaw; + private long comphKCmderrRaw; + private long comphKStatRaw; + private double compvoltBrdSupRawV; + private double comptempRawT; + private double compvDistInputRawV; + private double compiDistInputRawMa; + private double comppDistInputRawMw; + private double compvBattInputRawV; + private double compiBattInputRawMa; + private double comppBattInputRawMw; + private long compstatObcOnRaw; + private long compstatObcOcfRaw; + private long compbatStatRaw; + private double compbatTemp2RawT; + private long compvoltVd0Raw; + private long compvoltVd1Raw; + private long compvoltVd2Raw; + private double compvObc00V; + private double compiObc00Ma; + private double comppObc00Mw; + private double compvObc01V; + private double compiObc01Ma; + private double comppObc01Mw; + private double compvObc02V; + private double compiObc02Ma; + private double comppObc02Mw; + private double compvObc03V; + private double compiObc03Ma; + private double comppObc03Mw; + private double compvObc05V; + private double compiObc05Ma; + private double comppObc05Mw; + private double compvObc06V; + private double compiObc06Ma; + private double comppObc06Mw; + private byte[] compcc1Byte; + private byte[] compcc2Byte; + private byte[] compcc3Byte; + private long compstatusStidRaw; + private long compstatusIvidRaw; + private long compstatusRcRaw; + private long compstatusBidRaw; + private long compstatusCmderrRaw; + private long compstatusStatRaw; + private long compmodeRaw; + private long compconfRaw; + private long compresetCauseRaw; + private long compuptimeRaw; + private long comperrorRaw; + private long comprcCntPwronRaw; + private long comprcCntWdgRaw; + private long comprcCntCmdRaw; + private long comprcCntMcuRaw; + private long comprcCntEmlopoRaw; + private long compprevcmdElapsedRaw; - public String toStringCompute () { - - return " " - + separator + "h k stid : Ox" + toHex(hKStid) + " : " + comphKStidRaw - + separator + "h k ivid : Ox" + toHex(hKIvid) + " : " + comphKIvidRaw - + separator + "h k rc : Ox" + toHex(hKRc) + " : " + comphKRcRaw - + separator + "h k bid : Ox" + toHex(hKBid) + " : " + comphKBidRaw - + separator + "h k cmderr : Ox" + toHex(hKCmderr) + " : " + comphKCmderrRaw - + separator + "h k stat : Ox" + toHex(hKStat) + " : " + comphKStatRaw - + separator + "volt brd sup raw (V) : Ox" + toHex(voltBrdSupRaw) + " : "+ String.format("%.3f", + compvoltBrdSupRawV) - + separator + "temp raw t : Ox" + toHex(tempRaw) + " : "+ String.format("%.3f", + comptempRawT) - + separator + "v dist input raw (V) : Ox" + toHex(vDistInputRaw) + " : "+ String.format("%.3f", + compvDistInputRawV) - + separator + "i dist input raw (mA) : Ox" + toHex(iDistInputRaw) + " : "+ String.format("%.3f", + compiDistInputRawMa) - + separator + "p dist input raw (mW) : Ox" + toHex(pDistInputRaw) + " : "+ String.format("%.3f", + comppDistInputRawMw) - + separator + "v batt input raw (V) : Ox" + toHex(vBattInputRaw) + " : "+ String.format("%.3f", + compvBattInputRawV) - + separator + "i batt input raw (mA) : Ox" + toHex(iBattInputRaw) + " : "+ String.format("%.3f", + compiBattInputRawMa) - + separator + "p batt input raw (mW) : Ox" + toHex(pBattInputRaw) + " : "+ String.format("%.3f", + comppBattInputRawMw) - + separator + "stat obc on : Ox" + toHex(statObcOn) + " : " + compstatObcOnRaw - + separator + "stat obc ocf : Ox" + toHex(statObcOcf) + " : " + compstatObcOcfRaw - + separator + "bat stat : Ox" + toHex(batStat) + " : " + compbatStatRaw - + separator + "bat temp 2 raw t : Ox" + toHex(batTemp2Raw) + " : "+ String.format("%.3f", + compbatTemp2RawT) - + separator + "volt vd0 : Ox" + toHex(voltVd0) + " : " + compvoltVd0Raw - + separator + "volt vd1 : Ox" + toHex(voltVd1) + " : " + compvoltVd1Raw - + separator + "volt vd2 : Ox" + toHex(voltVd2) + " : " + compvoltVd2Raw - + separator + "v obc 00 (V) : Ox" + toHex(vObc00) + " : "+ String.format("%.3f", + compvObc00V) - + separator + "i obc 00 (mA) : Ox" + toHex(iObc00) + " : "+ String.format("%.3f", + compiObc00Ma) - + separator + "p obc 00 (mW) : Ox" + toHex(pObc00) + " : "+ String.format("%.3f", + comppObc00Mw) - + separator + "v obc 01 (V) : Ox" + toHex(vObc01) + " : "+ String.format("%.3f", + compvObc01V) - + separator + "i obc 01 (mA) : Ox" + toHex(iObc01) + " : "+ String.format("%.3f", + compiObc01Ma) - + separator + "p obc 01 (mW) : Ox" + toHex(pObc01) + " : "+ String.format("%.3f", + comppObc01Mw) - + separator + "v obc 02 (V) : Ox" + toHex(vObc02) + " : "+ String.format("%.3f", + compvObc02V) - + separator + "i obc 02 (mA) : Ox" + toHex(iObc02) + " : "+ String.format("%.3f", + compiObc02Ma) - + separator + "p obc 02 (mW) : Ox" + toHex(pObc02) + " : "+ String.format("%.3f", + comppObc02Mw) - + separator + "v obc 03 (V) : Ox" + toHex(vObc03) + " : "+ String.format("%.3f", + compvObc03V) - + separator + "i obc 03 (mA) : Ox" + toHex(iObc03) + " : "+ String.format("%.3f", + compiObc03Ma) - + separator + "p obc 03 (mW) : Ox" + toHex(pObc03) + " : "+ String.format("%.3f", + comppObc03Mw) - + separator + "v obc 05 (V) : Ox" + toHex(vObc05) + " : "+ String.format("%.3f", + compvObc05V) - + separator + "i obc 05 (mA) : Ox" + toHex(iObc05) + " : "+ String.format("%.3f", + compiObc05Ma) - + separator + "p obc 05 (mW) : Ox" + toHex(pObc05) + " : "+ String.format("%.3f", + comppObc05Mw) - + separator + "v obc 06 (V) : Ox" + toHex(vObc06) + " : "+ String.format("%.3f", + compvObc06V) - + separator + "i obc 06 (mA) : Ox" + toHex(iObc06) + " : "+ String.format("%.3f", + compiObc06Ma) - + separator + "p obc 06 (mW) : Ox" + toHex(pObc06) + " : "+ String.format("%.3f", + comppObc06Mw) - + separator + "cc1 byte : Ox" + toHex(cc1) + " : " + compcc1Byte - + separator + "cc2 byte : Ox" + toHex(cc2) + " : " + compcc2Byte - + separator + "cc3 byte : Ox" + toHex(cc3) + " : " + compcc3Byte - + separator + "status stid : Ox" + toHex(statusStid) + " : " + compstatusStidRaw - + separator + "status ivid : Ox" + toHex(statusIvid) + " : " + compstatusIvidRaw - + separator + "status rc : Ox" + toHex(statusRc) + " : " + compstatusRcRaw - + separator + "status bid : Ox" + toHex(statusBid) + " : " + compstatusBidRaw - + separator + "status cmderr : Ox" + toHex(statusCmderr) + " : " + compstatusCmderrRaw - + separator + "status stat : Ox" + toHex(statusStat) + " : " + compstatusStatRaw - + separator + "mode : Ox" + toHex(mode) + " : " + compmodeRaw - + separator + "conf : Ox" + toHex(conf) + " : " + compconfRaw - + separator + "reset cause : Ox" + toHex(resetCause) + " : " + compresetCauseRaw - + separator + "uptime : Ox" + toHex(uptime) + " : " + compuptimeRaw - + separator + "error : Ox" + toHex(error) + " : " + comperrorRaw - + separator + "rc cnt pwron : Ox" + toHex(rcCntPwron) + " : " + comprcCntPwronRaw - + separator + "rc cnt wdg : Ox" + toHex(rcCntWdg) + " : " + comprcCntWdgRaw - + separator + "rc cnt cmd : Ox" + toHex(rcCntCmd) + " : " + comprcCntCmdRaw - + separator + "rc cnt mcu : Ox" + toHex(rcCntMcu) + " : " + comprcCntMcuRaw - + separator + "rc cnt emlopo : Ox" + toHex(rcCntEmlopo) + " : " + comprcCntEmlopoRaw - + separator + "prevcmd elapsed : Ox" + toHex(prevcmdElapsed) + " : " + compprevcmdElapsedRaw -; } + public iepsHkStatus(IepsHkStatus o) { + hKStid = o.hKStid(); + hKIvid = o.hKIvid(); + hKRc = o.hKRc(); + hKBid = o.hKBid(); + hKCmderr = o.hKCmderr(); + hKStat = o.hKStat(); + voltBrdSupRaw = o.voltBrdSupRaw(); + tempRaw = o.tempRaw(); + vDistInputRaw = o.vDistInputRaw(); + iDistInputRaw = o.iDistInputRaw(); + pDistInputRaw = o.pDistInputRaw(); + vBattInputRaw = o.vBattInputRaw(); + iBattInputRaw = o.iBattInputRaw(); + pBattInputRaw = o.pBattInputRaw(); + statObcOn = o.statObcOn(); + statObcOcf = o.statObcOcf(); + batStat = o.batStat(); + batTemp2Raw = o.batTemp2Raw(); + voltVd0 = o.voltVd0(); + voltVd1 = o.voltVd1(); + voltVd2 = o.voltVd2(); + vObc00 = o.vObc00(); + iObc00 = o.iObc00(); + pObc00 = o.pObc00(); + vObc01 = o.vObc01(); + iObc01 = o.iObc01(); + pObc01 = o.pObc01(); + vObc02 = o.vObc02(); + iObc02 = o.iObc02(); + pObc02 = o.pObc02(); + vObc03 = o.vObc03(); + iObc03 = o.iObc03(); + pObc03 = o.pObc03(); + vObc05 = o.vObc05(); + iObc05 = o.iObc05(); + pObc05 = o.pObc05(); + vObc06 = o.vObc06(); + iObc06 = o.iObc06(); + pObc06 = o.pObc06(); + cc1 = o.cc1(); + cc2 = o.cc2(); + cc3 = o.cc3(); + statusStid = o.statusStid(); + statusIvid = o.statusIvid(); + statusRc = o.statusRc(); + statusBid = o.statusBid(); + statusCmderr = o.statusCmderr(); + statusStat = o.statusStat(); + mode = o.mode(); + conf = o.conf(); + resetCause = o.resetCause(); + uptime = o.uptime(); + error = o.error(); + rcCntPwron = o.rcCntPwron(); + rcCntWdg = o.rcCntWdg(); + rcCntCmd = o.rcCntCmd(); + rcCntMcu = o.rcCntMcu(); + rcCntEmlopo = o.rcCntEmlopo(); + prevcmdElapsed = o.prevcmdElapsed(); + comphKStidRaw = o.hKStidRaw(); + comphKIvidRaw = o.hKIvidRaw(); + comphKRcRaw = o.hKRcRaw(); + comphKBidRaw = o.hKBidRaw(); + comphKCmderrRaw = o.hKCmderrRaw(); + comphKStatRaw = o.hKStatRaw(); + compvoltBrdSupRawV = o.voltBrdSupRawV(); + comptempRawT = o.tempRawT(); + compvDistInputRawV = o.vDistInputRawV(); + compiDistInputRawMa = o.iDistInputRawMa(); + comppDistInputRawMw = o.pDistInputRawMw(); + compvBattInputRawV = o.vBattInputRawV(); + compiBattInputRawMa = o.iBattInputRawMa(); + comppBattInputRawMw = o.pBattInputRawMw(); + compstatObcOnRaw = o.statObcOnRaw(); + compstatObcOcfRaw = o.statObcOcfRaw(); + compbatStatRaw = o.batStatRaw(); + compbatTemp2RawT = o.batTemp2RawT(); + compvoltVd0Raw = o.voltVd0Raw(); + compvoltVd1Raw = o.voltVd1Raw(); + compvoltVd2Raw = o.voltVd2Raw(); + compvObc00V = o.vObc00V(); + compiObc00Ma = o.iObc00Ma(); + comppObc00Mw = o.pObc00Mw(); + compvObc01V = o.vObc01V(); + compiObc01Ma = o.iObc01Ma(); + comppObc01Mw = o.pObc01Mw(); + compvObc02V = o.vObc02V(); + compiObc02Ma = o.iObc02Ma(); + comppObc02Mw = o.pObc02Mw(); + compvObc03V = o.vObc03V(); + compiObc03Ma = o.iObc03Ma(); + comppObc03Mw = o.pObc03Mw(); + compvObc05V = o.vObc05V(); + compiObc05Ma = o.iObc05Ma(); + comppObc05Mw = o.pObc05Mw(); + compvObc06V = o.vObc06V(); + compiObc06Ma = o.iObc06Ma(); + comppObc06Mw = o.pObc06Mw(); + compcc1Byte = o.cc1Byte(); + compcc2Byte = o.cc2Byte(); + compcc3Byte = o.cc3Byte(); + compstatusStidRaw = o.statusStidRaw(); + compstatusIvidRaw = o.statusIvidRaw(); + compstatusRcRaw = o.statusRcRaw(); + compstatusBidRaw = o.statusBidRaw(); + compstatusCmderrRaw = o.statusCmderrRaw(); + compstatusStatRaw = o.statusStatRaw(); + compmodeRaw = o.modeRaw(); + compconfRaw = o.confRaw(); + compresetCauseRaw = o.resetCauseRaw(); + compuptimeRaw = o.uptimeRaw(); + comperrorRaw = o.errorRaw(); + comprcCntPwronRaw = o.rcCntPwronRaw(); + comprcCntWdgRaw = o.rcCntWdgRaw(); + comprcCntCmdRaw = o.rcCntCmdRaw(); + comprcCntMcuRaw = o.rcCntMcuRaw(); + comprcCntEmlopoRaw = o.rcCntEmlopoRaw(); + compprevcmdElapsedRaw = o.prevcmdElapsedRaw(); + } + + public String toStringRaw() { + + return " " + + separator + + "hKStid : " + + hKStid + + separator + + "hKIvid : " + + hKIvid + + separator + + "hKRc : " + + hKRc + + separator + + "hKBid : " + + hKBid + + separator + + "hKCmderr : " + + hKCmderr + + separator + + "hKStat : " + + hKStat + + separator + + "voltBrdSupRaw : " + + voltBrdSupRaw + + separator + + "tempRaw : " + + tempRaw + + separator + + "vDistInputRaw : " + + vDistInputRaw + + separator + + "iDistInputRaw : " + + iDistInputRaw + + separator + + "pDistInputRaw : " + + pDistInputRaw + + separator + + "vBattInputRaw : " + + vBattInputRaw + + separator + + "iBattInputRaw : " + + iBattInputRaw + + separator + + "pBattInputRaw : " + + pBattInputRaw + + separator + + "statObcOn : " + + statObcOn + + separator + + "statObcOcf : " + + statObcOcf + + separator + + "batStat : " + + batStat + + separator + + "batTemp2Raw : " + + batTemp2Raw + + separator + + "voltVd0 : " + + voltVd0 + + separator + + "voltVd1 : " + + voltVd1 + + separator + + "voltVd2 : " + + voltVd2 + + separator + + "vObc00 : " + + vObc00 + + separator + + "iObc00 : " + + iObc00 + + separator + + "pObc00 : " + + pObc00 + + separator + + "vObc01 : " + + vObc01 + + separator + + "iObc01 : " + + iObc01 + + separator + + "pObc01 : " + + pObc01 + + separator + + "vObc02 : " + + vObc02 + + separator + + "iObc02 : " + + iObc02 + + separator + + "pObc02 : " + + pObc02 + + separator + + "vObc03 : " + + vObc03 + + separator + + "iObc03 : " + + iObc03 + + separator + + "pObc03 : " + + pObc03 + + separator + + "vObc05 : " + + vObc05 + + separator + + "iObc05 : " + + iObc05 + + separator + + "pObc05 : " + + pObc05 + + separator + + "vObc06 : " + + vObc06 + + separator + + "iObc06 : " + + iObc06 + + separator + + "pObc06 : " + + pObc06 + + separator + + "cc1 : " + + cc1 + + separator + + "cc2 : " + + cc2 + + separator + + "cc3 : " + + cc3 + + separator + + "statusStid : " + + statusStid + + separator + + "statusIvid : " + + statusIvid + + separator + + "statusRc : " + + statusRc + + separator + + "statusBid : " + + statusBid + + separator + + "statusCmderr : " + + statusCmderr + + separator + + "statusStat : " + + statusStat + + separator + + "mode : " + + mode + + separator + + "conf : " + + conf + + separator + + "resetCause : " + + resetCause + + separator + + "uptime : " + + uptime + + separator + + "error : " + + error + + separator + + "rcCntPwron : " + + rcCntPwron + + separator + + "rcCntWdg : " + + rcCntWdg + + separator + + "rcCntCmd : " + + rcCntCmd + + separator + + "rcCntMcu : " + + rcCntMcu + + separator + + "rcCntEmlopo : " + + rcCntEmlopo + + separator + + "prevcmdElapsed : " + + prevcmdElapsed; + } + + public String toStringCompute() { + + return " " + + separator + + "h k stid : Ox" + + toHex(hKStid) + + " : " + + comphKStidRaw + + separator + + "h k ivid : Ox" + + toHex(hKIvid) + + " : " + + comphKIvidRaw + + separator + + "h k rc : Ox" + + toHex(hKRc) + + " : " + + comphKRcRaw + + separator + + "h k bid : Ox" + + toHex(hKBid) + + " : " + + comphKBidRaw + + separator + + "h k cmderr : Ox" + + toHex(hKCmderr) + + " : " + + comphKCmderrRaw + + separator + + "h k stat : Ox" + + toHex(hKStat) + + " : " + + comphKStatRaw + + separator + + "volt brd sup raw (V) : Ox" + + toHex(voltBrdSupRaw) + + " : " + + String.format("%.3f", +compvoltBrdSupRawV) + + separator + + "temp raw t : Ox" + + toHex(tempRaw) + + " : " + + String.format("%.3f", +comptempRawT) + + separator + + "v dist input raw (V) : Ox" + + toHex(vDistInputRaw) + + " : " + + String.format("%.3f", +compvDistInputRawV) + + separator + + "i dist input raw (mA) : Ox" + + toHex(iDistInputRaw) + + " : " + + String.format("%.3f", +compiDistInputRawMa) + + separator + + "p dist input raw (mW) : Ox" + + toHex(pDistInputRaw) + + " : " + + String.format("%.3f", +comppDistInputRawMw) + + separator + + "v batt input raw (V) : Ox" + + toHex(vBattInputRaw) + + " : " + + String.format("%.3f", +compvBattInputRawV) + + separator + + "i batt input raw (mA) : Ox" + + toHex(iBattInputRaw) + + " : " + + String.format("%.3f", +compiBattInputRawMa) + + separator + + "p batt input raw (mW) : Ox" + + toHex(pBattInputRaw) + + " : " + + String.format("%.3f", +comppBattInputRawMw) + + separator + + "stat obc on : Ox" + + toHex(statObcOn) + + " : " + + compstatObcOnRaw + + separator + + "stat obc ocf : Ox" + + toHex(statObcOcf) + + " : " + + compstatObcOcfRaw + + separator + + "bat stat : Ox" + + toHex(batStat) + + " : " + + compbatStatRaw + + separator + + "bat temp 2 raw t : Ox" + + toHex(batTemp2Raw) + + " : " + + String.format("%.3f", +compbatTemp2RawT) + + separator + + "volt vd0 : Ox" + + toHex(voltVd0) + + " : " + + compvoltVd0Raw + + separator + + "volt vd1 : Ox" + + toHex(voltVd1) + + " : " + + compvoltVd1Raw + + separator + + "volt vd2 : Ox" + + toHex(voltVd2) + + " : " + + compvoltVd2Raw + + separator + + "v obc 00 (V) : Ox" + + toHex(vObc00) + + " : " + + String.format("%.3f", +compvObc00V) + + separator + + "i obc 00 (mA) : Ox" + + toHex(iObc00) + + " : " + + String.format("%.3f", +compiObc00Ma) + + separator + + "p obc 00 (mW) : Ox" + + toHex(pObc00) + + " : " + + String.format("%.3f", +comppObc00Mw) + + separator + + "v obc 01 (V) : Ox" + + toHex(vObc01) + + " : " + + String.format("%.3f", +compvObc01V) + + separator + + "i obc 01 (mA) : Ox" + + toHex(iObc01) + + " : " + + String.format("%.3f", +compiObc01Ma) + + separator + + "p obc 01 (mW) : Ox" + + toHex(pObc01) + + " : " + + String.format("%.3f", +comppObc01Mw) + + separator + + "v obc 02 (V) : Ox" + + toHex(vObc02) + + " : " + + String.format("%.3f", +compvObc02V) + + separator + + "i obc 02 (mA) : Ox" + + toHex(iObc02) + + " : " + + String.format("%.3f", +compiObc02Ma) + + separator + + "p obc 02 (mW) : Ox" + + toHex(pObc02) + + " : " + + String.format("%.3f", +comppObc02Mw) + + separator + + "v obc 03 (V) : Ox" + + toHex(vObc03) + + " : " + + String.format("%.3f", +compvObc03V) + + separator + + "i obc 03 (mA) : Ox" + + toHex(iObc03) + + " : " + + String.format("%.3f", +compiObc03Ma) + + separator + + "p obc 03 (mW) : Ox" + + toHex(pObc03) + + " : " + + String.format("%.3f", +comppObc03Mw) + + separator + + "v obc 05 (V) : Ox" + + toHex(vObc05) + + " : " + + String.format("%.3f", +compvObc05V) + + separator + + "i obc 05 (mA) : Ox" + + toHex(iObc05) + + " : " + + String.format("%.3f", +compiObc05Ma) + + separator + + "p obc 05 (mW) : Ox" + + toHex(pObc05) + + " : " + + String.format("%.3f", +comppObc05Mw) + + separator + + "v obc 06 (V) : Ox" + + toHex(vObc06) + + " : " + + String.format("%.3f", +compvObc06V) + + separator + + "i obc 06 (mA) : Ox" + + toHex(iObc06) + + " : " + + String.format("%.3f", +compiObc06Ma) + + separator + + "p obc 06 (mW) : Ox" + + toHex(pObc06) + + " : " + + String.format("%.3f", +comppObc06Mw) + + separator + + "cc1 byte : Ox" + + toHex(cc1) + + " : " + + compcc1Byte + + separator + + "cc2 byte : Ox" + + toHex(cc2) + + " : " + + compcc2Byte + + separator + + "cc3 byte : Ox" + + toHex(cc3) + + " : " + + compcc3Byte + + separator + + "status stid : Ox" + + toHex(statusStid) + + " : " + + compstatusStidRaw + + separator + + "status ivid : Ox" + + toHex(statusIvid) + + " : " + + compstatusIvidRaw + + separator + + "status rc : Ox" + + toHex(statusRc) + + " : " + + compstatusRcRaw + + separator + + "status bid : Ox" + + toHex(statusBid) + + " : " + + compstatusBidRaw + + separator + + "status cmderr : Ox" + + toHex(statusCmderr) + + " : " + + compstatusCmderrRaw + + separator + + "status stat : Ox" + + toHex(statusStat) + + " : " + + compstatusStatRaw + + separator + + "mode : Ox" + + toHex(mode) + + " : " + + compmodeRaw + + separator + + "conf : Ox" + + toHex(conf) + + " : " + + compconfRaw + + separator + + "reset cause : Ox" + + toHex(resetCause) + + " : " + + compresetCauseRaw + + separator + + "uptime : Ox" + + toHex(uptime) + + " : " + + compuptimeRaw + + separator + + "error : Ox" + + toHex(error) + + " : " + + comperrorRaw + + separator + + "rc cnt pwron : Ox" + + toHex(rcCntPwron) + + " : " + + comprcCntPwronRaw + + separator + + "rc cnt wdg : Ox" + + toHex(rcCntWdg) + + " : " + + comprcCntWdgRaw + + separator + + "rc cnt cmd : Ox" + + toHex(rcCntCmd) + + " : " + + comprcCntCmdRaw + + separator + + "rc cnt mcu : Ox" + + toHex(rcCntMcu) + + " : " + + comprcCntMcuRaw + + separator + + "rc cnt emlopo : Ox" + + toHex(rcCntEmlopo) + + " : " + + comprcCntEmlopoRaw + + separator + + "prevcmd elapsed : Ox" + + toHex(prevcmdElapsed) + + " : " + + compprevcmdElapsedRaw; + } } diff --git a/ModuleUVSQsatTelemetry/src/main/java/org/josast/uvsqsat/pojogenerated/imtqHk.java b/ModuleUVSQsatTelemetry/src/main/java/org/josast/uvsqsat/pojogenerated/imtqHk.java index dd4f5e41c530e1613299357edb2ae19e44f39eac..7a8c36697fb6d448a24e6022b0b0ab24d8ee69c5 100644 --- a/ModuleUVSQsatTelemetry/src/main/java/org/josast/uvsqsat/pojogenerated/imtqHk.java +++ b/ModuleUVSQsatTelemetry/src/main/java/org/josast/uvsqsat/pojogenerated/imtqHk.java @@ -5,113 +5,205 @@ package org.josast.uvsqsat.pojogenerated; import org.josast.uvsqsat.generated.Uvsqsat.ImtqHk; -public class imtqHk extends AFrame { +public class imtqHk extends AFrame { - private String separator=" \r\n" ; -/** - data raw Declaration **/ - private int digitaleVoltage; - private int analogVoltage; - private int digitalCurrent; - private int analogCurrent; - private int measureCoilXCurrent; - private int measureCoilYCurrent; - private int measureCoilZCurrent; - private int measureCoilXTemperature; - private int measureCoilYTemperature; - private int measureCoilZTemperature; - private int mcuTemperature; - private int imtqSystemStateMode; - private int imtqSystemStateError; - private int imtqSystemStateConfiguration; - private long imtqSystemStateUptime; -/** - Instance Declaration **/ - private double compdigitaleVoltageV; - private double companalogVoltageV; - private long compdigitalCurrentRaw; - private long companalogCurrentRaw; - private double compmeasureCoilXCurrentMa; - private double compmeasureCoilYCurrentMa; - private double compmeasureCoilZCurrentMa; - private double compmeasureCoilXTemperatureC; - private double compmeasureCoilYTemperatureC; - private double compmeasureCoilZTemperatureC; - private double compmcuTemperatureC; - private long compimtqSystemStateModeRaw; - private long compimtqSystemStateErrorRaw; - private long compimtqSystemStateConfigurationRaw; - private long compimtqSystemStateUptimeRaw; - public imtqHk(ImtqHk o) { + private String separator = " \r\n"; + /** - data raw Declaration * */ + private int digitaleVoltage; - digitaleVoltage = o.digitaleVoltage(); - analogVoltage = o.analogVoltage(); - digitalCurrent = o.digitalCurrent(); - analogCurrent = o.analogCurrent(); - measureCoilXCurrent = o.measureCoilXCurrent(); - measureCoilYCurrent = o.measureCoilYCurrent(); - measureCoilZCurrent = o.measureCoilZCurrent(); - measureCoilXTemperature = o.measureCoilXTemperature(); - measureCoilYTemperature = o.measureCoilYTemperature(); - measureCoilZTemperature = o.measureCoilZTemperature(); - mcuTemperature = o.mcuTemperature(); - imtqSystemStateMode = o.imtqSystemStateMode(); - imtqSystemStateError = o.imtqSystemStateError(); - imtqSystemStateConfiguration = o.imtqSystemStateConfiguration(); - imtqSystemStateUptime = o.imtqSystemStateUptime(); - compdigitaleVoltageV = o.digitaleVoltageV(); - companalogVoltageV = o.analogVoltageV(); - compdigitalCurrentRaw = o.digitalCurrentRaw(); - companalogCurrentRaw = o.analogCurrentRaw(); - compmeasureCoilXCurrentMa = o.measureCoilXCurrentMa(); - compmeasureCoilYCurrentMa = o.measureCoilYCurrentMa(); - compmeasureCoilZCurrentMa = o.measureCoilZCurrentMa(); - compmeasureCoilXTemperatureC = o.measureCoilXTemperatureC(); - compmeasureCoilYTemperatureC = o.measureCoilYTemperatureC(); - compmeasureCoilZTemperatureC = o.measureCoilZTemperatureC(); - compmcuTemperatureC = o.mcuTemperatureC(); - compimtqSystemStateModeRaw = o.imtqSystemStateModeRaw(); - compimtqSystemStateErrorRaw = o.imtqSystemStateErrorRaw(); - compimtqSystemStateConfigurationRaw = o.imtqSystemStateConfigurationRaw(); - compimtqSystemStateUptimeRaw = o.imtqSystemStateUptimeRaw(); - } + private int analogVoltage; + private int digitalCurrent; + private int analogCurrent; + private int measureCoilXCurrent; + private int measureCoilYCurrent; + private int measureCoilZCurrent; + private int measureCoilXTemperature; + private int measureCoilYTemperature; + private int measureCoilZTemperature; + private int mcuTemperature; + private int imtqSystemStateMode; + private int imtqSystemStateError; + private int imtqSystemStateConfiguration; + private long imtqSystemStateUptime; + /** - Instance Declaration * */ + private double compdigitaleVoltageV; - public String toStringRaw () { - - return " " - + separator + "digitaleVoltage : " +digitaleVoltage - + separator + "analogVoltage : " +analogVoltage - + separator + "digitalCurrent : " +digitalCurrent - + separator + "analogCurrent : " +analogCurrent - + separator + "measureCoilXCurrent : " +measureCoilXCurrent - + separator + "measureCoilYCurrent : " +measureCoilYCurrent - + separator + "measureCoilZCurrent : " +measureCoilZCurrent - + separator + "measureCoilXTemperature : " +measureCoilXTemperature - + separator + "measureCoilYTemperature : " +measureCoilYTemperature - + separator + "measureCoilZTemperature : " +measureCoilZTemperature - + separator + "mcuTemperature : " +mcuTemperature - + separator + "imtqSystemStateMode : " +imtqSystemStateMode - + separator + "imtqSystemStateError : " +imtqSystemStateError - + separator + "imtqSystemStateConfiguration : " +imtqSystemStateConfiguration - + separator + "imtqSystemStateUptime : " +imtqSystemStateUptime -; } + private double companalogVoltageV; + private long compdigitalCurrentRaw; + private long companalogCurrentRaw; + private double compmeasureCoilXCurrentMa; + private double compmeasureCoilYCurrentMa; + private double compmeasureCoilZCurrentMa; + private double compmeasureCoilXTemperatureC; + private double compmeasureCoilYTemperatureC; + private double compmeasureCoilZTemperatureC; + private double compmcuTemperatureC; + private long compimtqSystemStateModeRaw; + private long compimtqSystemStateErrorRaw; + private long compimtqSystemStateConfigurationRaw; + private long compimtqSystemStateUptimeRaw; - public String toStringCompute () { - - return " " - + separator + "digitale voltage (V) : Ox" + toHex(digitaleVoltage) + " : "+ String.format("%.3f", + compdigitaleVoltageV) - + separator + "analog voltage (V) : Ox" + toHex(analogVoltage) + " : "+ String.format("%.3f", + companalogVoltageV) - + separator + "digital current : Ox" + toHex(digitalCurrent) + " : " + compdigitalCurrentRaw - + separator + "analog current : Ox" + toHex(analogCurrent) + " : " + companalogCurrentRaw - + separator + "measure coil x current (mA) : Ox" + toHex(measureCoilXCurrent) + " : "+ String.format("%.3f", + compmeasureCoilXCurrentMa) - + separator + "measure coil y current (mA) : Ox" + toHex(measureCoilYCurrent) + " : "+ String.format("%.3f", + compmeasureCoilYCurrentMa) - + separator + "measure coil z current (mA) : Ox" + toHex(measureCoilZCurrent) + " : "+ String.format("%.3f", + compmeasureCoilZCurrentMa) - + separator + "measure coil x temperature (°C) : Ox" + toHex(measureCoilXTemperature) + " : "+ String.format("%.3f", + compmeasureCoilXTemperatureC) - + separator + "measure coil y temperature (°C) : Ox" + toHex(measureCoilYTemperature) + " : "+ String.format("%.3f", + compmeasureCoilYTemperatureC) - + separator + "measure coil z temperature (°C) : Ox" + toHex(measureCoilZTemperature) + " : "+ String.format("%.3f", + compmeasureCoilZTemperatureC) - + separator + "mcu temperature (°C) : Ox" + toHex(mcuTemperature) + " : "+ String.format("%.3f", + compmcuTemperatureC) - + separator + "imtq system state mode : Ox" + toHex(imtqSystemStateMode) + " : " + compimtqSystemStateModeRaw - + separator + "imtq system state error : Ox" + toHex(imtqSystemStateError) + " : " + compimtqSystemStateErrorRaw - + separator + "imtq system state configuration : Ox" + toHex(imtqSystemStateConfiguration) + " : " + compimtqSystemStateConfigurationRaw - + separator + "imtq system state uptime : Ox" + toHex(imtqSystemStateUptime) + " : " + compimtqSystemStateUptimeRaw -; } + public imtqHk(ImtqHk o) { + digitaleVoltage = o.digitaleVoltage(); + analogVoltage = o.analogVoltage(); + digitalCurrent = o.digitalCurrent(); + analogCurrent = o.analogCurrent(); + measureCoilXCurrent = o.measureCoilXCurrent(); + measureCoilYCurrent = o.measureCoilYCurrent(); + measureCoilZCurrent = o.measureCoilZCurrent(); + measureCoilXTemperature = o.measureCoilXTemperature(); + measureCoilYTemperature = o.measureCoilYTemperature(); + measureCoilZTemperature = o.measureCoilZTemperature(); + mcuTemperature = o.mcuTemperature(); + imtqSystemStateMode = o.imtqSystemStateMode(); + imtqSystemStateError = o.imtqSystemStateError(); + imtqSystemStateConfiguration = o.imtqSystemStateConfiguration(); + imtqSystemStateUptime = o.imtqSystemStateUptime(); + compdigitaleVoltageV = o.digitaleVoltageV(); + companalogVoltageV = o.analogVoltageV(); + compdigitalCurrentRaw = o.digitalCurrentRaw(); + companalogCurrentRaw = o.analogCurrentRaw(); + compmeasureCoilXCurrentMa = o.measureCoilXCurrentMa(); + compmeasureCoilYCurrentMa = o.measureCoilYCurrentMa(); + compmeasureCoilZCurrentMa = o.measureCoilZCurrentMa(); + compmeasureCoilXTemperatureC = o.measureCoilXTemperatureC(); + compmeasureCoilYTemperatureC = o.measureCoilYTemperatureC(); + compmeasureCoilZTemperatureC = o.measureCoilZTemperatureC(); + compmcuTemperatureC = o.mcuTemperatureC(); + compimtqSystemStateModeRaw = o.imtqSystemStateModeRaw(); + compimtqSystemStateErrorRaw = o.imtqSystemStateErrorRaw(); + compimtqSystemStateConfigurationRaw = o.imtqSystemStateConfigurationRaw(); + compimtqSystemStateUptimeRaw = o.imtqSystemStateUptimeRaw(); + } + + public String toStringRaw() { + + return " " + + separator + + "digitaleVoltage : " + + digitaleVoltage + + separator + + "analogVoltage : " + + analogVoltage + + separator + + "digitalCurrent : " + + digitalCurrent + + separator + + "analogCurrent : " + + analogCurrent + + separator + + "measureCoilXCurrent : " + + measureCoilXCurrent + + separator + + "measureCoilYCurrent : " + + measureCoilYCurrent + + separator + + "measureCoilZCurrent : " + + measureCoilZCurrent + + separator + + "measureCoilXTemperature : " + + measureCoilXTemperature + + separator + + "measureCoilYTemperature : " + + measureCoilYTemperature + + separator + + "measureCoilZTemperature : " + + measureCoilZTemperature + + separator + + "mcuTemperature : " + + mcuTemperature + + separator + + "imtqSystemStateMode : " + + imtqSystemStateMode + + separator + + "imtqSystemStateError : " + + imtqSystemStateError + + separator + + "imtqSystemStateConfiguration : " + + imtqSystemStateConfiguration + + separator + + "imtqSystemStateUptime : " + + imtqSystemStateUptime; + } + + public String toStringCompute() { + + return " " + + separator + + "digitale voltage (V) : Ox" + + toHex(digitaleVoltage) + + " : " + + String.format("%.3f", +compdigitaleVoltageV) + + separator + + "analog voltage (V) : Ox" + + toHex(analogVoltage) + + " : " + + String.format("%.3f", +companalogVoltageV) + + separator + + "digital current : Ox" + + toHex(digitalCurrent) + + " : " + + compdigitalCurrentRaw + + separator + + "analog current : Ox" + + toHex(analogCurrent) + + " : " + + companalogCurrentRaw + + separator + + "measure coil x current (mA) : Ox" + + toHex(measureCoilXCurrent) + + " : " + + String.format("%.3f", +compmeasureCoilXCurrentMa) + + separator + + "measure coil y current (mA) : Ox" + + toHex(measureCoilYCurrent) + + " : " + + String.format("%.3f", +compmeasureCoilYCurrentMa) + + separator + + "measure coil z current (mA) : Ox" + + toHex(measureCoilZCurrent) + + " : " + + String.format("%.3f", +compmeasureCoilZCurrentMa) + + separator + + "measure coil x temperature (°C) : Ox" + + toHex(measureCoilXTemperature) + + " : " + + String.format("%.3f", +compmeasureCoilXTemperatureC) + + separator + + "measure coil y temperature (°C) : Ox" + + toHex(measureCoilYTemperature) + + " : " + + String.format("%.3f", +compmeasureCoilYTemperatureC) + + separator + + "measure coil z temperature (°C) : Ox" + + toHex(measureCoilZTemperature) + + " : " + + String.format("%.3f", +compmeasureCoilZTemperatureC) + + separator + + "mcu temperature (°C) : Ox" + + toHex(mcuTemperature) + + " : " + + String.format("%.3f", +compmcuTemperatureC) + + separator + + "imtq system state mode : Ox" + + toHex(imtqSystemStateMode) + + " : " + + compimtqSystemStateModeRaw + + separator + + "imtq system state error : Ox" + + toHex(imtqSystemStateError) + + " : " + + compimtqSystemStateErrorRaw + + separator + + "imtq system state configuration : Ox" + + toHex(imtqSystemStateConfiguration) + + " : " + + compimtqSystemStateConfigurationRaw + + separator + + "imtq system state uptime : Ox" + + toHex(imtqSystemStateUptime) + + " : " + + compimtqSystemStateUptimeRaw; + } } diff --git a/ModuleUVSQsatTelemetry/src/main/java/org/josast/uvsqsat/pojogenerated/mainboardAllScience.java b/ModuleUVSQsatTelemetry/src/main/java/org/josast/uvsqsat/pojogenerated/mainboardAllScience.java index 6281d2b6f8265d3dd066c74830589030a70b9df4..593ac8c7dc7faef0749605f3f778c1b9213849bd 100644 --- a/ModuleUVSQsatTelemetry/src/main/java/org/josast/uvsqsat/pojogenerated/mainboardAllScience.java +++ b/ModuleUVSQsatTelemetry/src/main/java/org/josast/uvsqsat/pojogenerated/mainboardAllScience.java @@ -5,359 +5,697 @@ package org.josast.uvsqsat.pojogenerated; import org.josast.uvsqsat.generated.Uvsqsat.MainboardAllScience; -public class mainboardAllScience extends AFrame { +public class mainboardAllScience extends AFrame { - private String separator=" \r\n" ; -/** - data raw Declaration **/ - private long mainboardScienceTime; - private int teachWearOn; - private int frequenceOfAcquisitions; - private long gain; - private int numberOfAcquisitionCommanded; - private int numberOfRealAcquisition; - private long hkPlus5v; - private long hkMinus5v; - private long hkMinus5vPolar; - private long hkTempAdc; - private long hkFeePlusXVref; - private long hkFeeMinusXVref; - private long hkFeePlusYVref; - private long hkFeeMinusYVref; - private long feePlusXErs1Signal; - private long feePlusXErs1Temperature; - private long feePlusXErs2Signal; - private long feePlusXErs2Temperature; - private long feePlusXErs3Signal; - private long feePlusXErs3Temperature; - private long feePlusXUvsSignal; - private long feeMinusXErs1Signal; - private long feeMinusXErs1Temperature; - private long feeMinusXErs2Signal; - private long feeMinusXErs2Temperature; - private long feeMinusXErs3Signal; - private long feeMinusXErs3Temperature; - private long feeMinusXUvsSignal; - private long feePlusYErs1Signal; - private long feePlusYErs1Temperature; - private long feePlusYErs2Signal; - private long feePlusYErs2Temperature; - private long feePlusYErs3Signal; - private long feePlusYErs3Temperature; - private long feePlusYUvsSignal; - private long feeMinusYErs1Signal; - private long feeMinusYErs1Temperature; - private long feeMinusYErs2Signal; - private long feeMinusYErs2Temperature; - private long feeMinusYErs3Signal; - private long feeMinusYErs3Temperature; - private long feeMinusYUvsSignal; - private int teachwearAccX; - private int teachwearAccY; - private int teachwearAccZ; - private int teachwearDegC; - private int teachwearGyroX; - private int teachwearGyroY; - private int teachwearGyroZ; - private int teachwearMagnX; - private int teachwearMagnY; - private int teachwearMagnZ; - private int teachwearState; - private int teachwearResetReason; - private int teachwearCrc; - private long nbTmSinceFirstStart; -/** - Instance Declaration **/ - private long compmainboardScienceTimeRaw; - private long compteachWearOnRaw; - private long compfrequenceOfAcquisitionsRaw; - private long compgainRaw; - private long compnumberOfAcquisitionCommandedRaw; - private long compnumberOfRealAcquisitionRaw; - private long comphkPlus5vRaw; - private long comphkMinus5vRaw; - private long comphkMinus5vPolarRaw; - private long comphkTempAdcRaw; - private long comphkFeePlusXVrefRaw; - private long comphkFeeMinusXVrefRaw; - private long comphkFeePlusYVrefRaw; - private long comphkFeeMinusYVrefRaw; - private long compfeePlusXErs1SignalRaw; - private long compfeePlusXErs1TemperatureRaw; - private long compfeePlusXErs2SignalRaw; - private long compfeePlusXErs2TemperatureRaw; - private long compfeePlusXErs3SignalRaw; - private long compfeePlusXErs3TemperatureRaw; - private long compfeePlusXUvsSignalRaw; - private long compfeeMinusXErs1SignalRaw; - private long compfeeMinusXErs1TemperatureRaw; - private long compfeeMinusXErs2SignalRaw; - private long compfeeMinusXErs2TemperatureRaw; - private long compfeeMinusXErs3SignalRaw; - private long compfeeMinusXErs3TemperatureRaw; - private long compfeeMinusXUvsSignalRaw; - private long compfeePlusYErs1SignalRaw; - private long compfeePlusYErs1TemperatureRaw; - private long compfeePlusYErs2SignalRaw; - private long compfeePlusYErs2TemperatureRaw; - private long compfeePlusYErs3SignalRaw; - private long compfeePlusYErs3TemperatureRaw; - private long compfeePlusYUvsSignalRaw; - private long compfeeMinusYErs1SignalRaw; - private long compfeeMinusYErs1TemperatureRaw; - private long compfeeMinusYErs2SignalRaw; - private long compfeeMinusYErs2TemperatureRaw; - private long compfeeMinusYErs3SignalRaw; - private long compfeeMinusYErs3TemperatureRaw; - private long compfeeMinusYUvsSignalRaw; - private long compteachwearAccXRaw; - private long compteachwearAccYRaw; - private long compteachwearAccZRaw; - private long compteachwearDegCRaw; - private long compteachwearGyroXRaw; - private long compteachwearGyroYRaw; - private long compteachwearGyroZRaw; - private long compteachwearMagnXRaw; - private long compteachwearMagnYRaw; - private long compteachwearMagnZRaw; - private long compteachwearStateRaw; - private long compteachwearResetReasonRaw; - private long compteachwearCRCRaw; - private long compnbTmSinceFirstStartRaw; - public mainboardAllScience(MainboardAllScience o) { + private String separator = " \r\n"; + /** - data raw Declaration * */ + private long mainboardScienceTime; - mainboardScienceTime = o.mainboardScienceTime(); - teachWearOn = o.teachWearOn(); - frequenceOfAcquisitions = o.frequenceOfAcquisitions(); - gain = o.gain(); - numberOfAcquisitionCommanded = o.numberOfAcquisitionCommanded(); - numberOfRealAcquisition = o.numberOfRealAcquisition(); - hkPlus5v = o.hkPlus5v(); - hkMinus5v = o.hkMinus5v(); - hkMinus5vPolar = o.hkMinus5vPolar(); - hkTempAdc = o.hkTempAdc(); - hkFeePlusXVref = o.hkFeePlusXVref(); - hkFeeMinusXVref = o.hkFeeMinusXVref(); - hkFeePlusYVref = o.hkFeePlusYVref(); - hkFeeMinusYVref = o.hkFeeMinusYVref(); - feePlusXErs1Signal = o.feePlusXErs1Signal(); - feePlusXErs1Temperature = o.feePlusXErs1Temperature(); - feePlusXErs2Signal = o.feePlusXErs2Signal(); - feePlusXErs2Temperature = o.feePlusXErs2Temperature(); - feePlusXErs3Signal = o.feePlusXErs3Signal(); - feePlusXErs3Temperature = o.feePlusXErs3Temperature(); - feePlusXUvsSignal = o.feePlusXUvsSignal(); - feeMinusXErs1Signal = o.feeMinusXErs1Signal(); - feeMinusXErs1Temperature = o.feeMinusXErs1Temperature(); - feeMinusXErs2Signal = o.feeMinusXErs2Signal(); - feeMinusXErs2Temperature = o.feeMinusXErs2Temperature(); - feeMinusXErs3Signal = o.feeMinusXErs3Signal(); - feeMinusXErs3Temperature = o.feeMinusXErs3Temperature(); - feeMinusXUvsSignal = o.feeMinusXUvsSignal(); - feePlusYErs1Signal = o.feePlusYErs1Signal(); - feePlusYErs1Temperature = o.feePlusYErs1Temperature(); - feePlusYErs2Signal = o.feePlusYErs2Signal(); - feePlusYErs2Temperature = o.feePlusYErs2Temperature(); - feePlusYErs3Signal = o.feePlusYErs3Signal(); - feePlusYErs3Temperature = o.feePlusYErs3Temperature(); - feePlusYUvsSignal = o.feePlusYUvsSignal(); - feeMinusYErs1Signal = o.feeMinusYErs1Signal(); - feeMinusYErs1Temperature = o.feeMinusYErs1Temperature(); - feeMinusYErs2Signal = o.feeMinusYErs2Signal(); - feeMinusYErs2Temperature = o.feeMinusYErs2Temperature(); - feeMinusYErs3Signal = o.feeMinusYErs3Signal(); - feeMinusYErs3Temperature = o.feeMinusYErs3Temperature(); - feeMinusYUvsSignal = o.feeMinusYUvsSignal(); - teachwearAccX = o.teachwearAccX(); - teachwearAccY = o.teachwearAccY(); - teachwearAccZ = o.teachwearAccZ(); - teachwearDegC = o.teachwearDegC(); - teachwearGyroX = o.teachwearGyroX(); - teachwearGyroY = o.teachwearGyroY(); - teachwearGyroZ = o.teachwearGyroZ(); - teachwearMagnX = o.teachwearMagnX(); - teachwearMagnY = o.teachwearMagnY(); - teachwearMagnZ = o.teachwearMagnZ(); - teachwearState = o.teachwearState(); - teachwearResetReason = o.teachwearResetReason(); - teachwearCrc = o.teachwearCrc(); - nbTmSinceFirstStart = o.nbTmSinceFirstStart(); - compmainboardScienceTimeRaw = o.mainboardScienceTimeRaw(); - compteachWearOnRaw = o.teachWearOnRaw(); - compfrequenceOfAcquisitionsRaw = o.frequenceOfAcquisitionsRaw(); - compgainRaw = o.gainRaw(); - compnumberOfAcquisitionCommandedRaw = o.numberOfAcquisitionCommandedRaw(); - compnumberOfRealAcquisitionRaw = o.numberOfRealAcquisitionRaw(); - comphkPlus5vRaw = o.hkPlus5vRaw(); - comphkMinus5vRaw = o.hkMinus5vRaw(); - comphkMinus5vPolarRaw = o.hkMinus5vPolarRaw(); - comphkTempAdcRaw = o.hkTempAdcRaw(); - comphkFeePlusXVrefRaw = o.hkFeePlusXVrefRaw(); - comphkFeeMinusXVrefRaw = o.hkFeeMinusXVrefRaw(); - comphkFeePlusYVrefRaw = o.hkFeePlusYVrefRaw(); - comphkFeeMinusYVrefRaw = o.hkFeeMinusYVrefRaw(); - compfeePlusXErs1SignalRaw = o.feePlusXErs1SignalRaw(); - compfeePlusXErs1TemperatureRaw = o.feePlusXErs1TemperatureRaw(); - compfeePlusXErs2SignalRaw = o.feePlusXErs2SignalRaw(); - compfeePlusXErs2TemperatureRaw = o.feePlusXErs2TemperatureRaw(); - compfeePlusXErs3SignalRaw = o.feePlusXErs3SignalRaw(); - compfeePlusXErs3TemperatureRaw = o.feePlusXErs3TemperatureRaw(); - compfeePlusXUvsSignalRaw = o.feePlusXUvsSignalRaw(); - compfeeMinusXErs1SignalRaw = o.feeMinusXErs1SignalRaw(); - compfeeMinusXErs1TemperatureRaw = o.feeMinusXErs1TemperatureRaw(); - compfeeMinusXErs2SignalRaw = o.feeMinusXErs2SignalRaw(); - compfeeMinusXErs2TemperatureRaw = o.feeMinusXErs2TemperatureRaw(); - compfeeMinusXErs3SignalRaw = o.feeMinusXErs3SignalRaw(); - compfeeMinusXErs3TemperatureRaw = o.feeMinusXErs3TemperatureRaw(); - compfeeMinusXUvsSignalRaw = o.feeMinusXUvsSignalRaw(); - compfeePlusYErs1SignalRaw = o.feePlusYErs1SignalRaw(); - compfeePlusYErs1TemperatureRaw = o.feePlusYErs1TemperatureRaw(); - compfeePlusYErs2SignalRaw = o.feePlusYErs2SignalRaw(); - compfeePlusYErs2TemperatureRaw = o.feePlusYErs2TemperatureRaw(); - compfeePlusYErs3SignalRaw = o.feePlusYErs3SignalRaw(); - compfeePlusYErs3TemperatureRaw = o.feePlusYErs3TemperatureRaw(); - compfeePlusYUvsSignalRaw = o.feePlusYUvsSignalRaw(); - compfeeMinusYErs1SignalRaw = o.feeMinusYErs1SignalRaw(); - compfeeMinusYErs1TemperatureRaw = o.feeMinusYErs1TemperatureRaw(); - compfeeMinusYErs2SignalRaw = o.feeMinusYErs2SignalRaw(); - compfeeMinusYErs2TemperatureRaw = o.feeMinusYErs2TemperatureRaw(); - compfeeMinusYErs3SignalRaw = o.feeMinusYErs3SignalRaw(); - compfeeMinusYErs3TemperatureRaw = o.feeMinusYErs3TemperatureRaw(); - compfeeMinusYUvsSignalRaw = o.feeMinusYUvsSignalRaw(); - compteachwearAccXRaw = o.teachwearAccXRaw(); - compteachwearAccYRaw = o.teachwearAccYRaw(); - compteachwearAccZRaw = o.teachwearAccZRaw(); - compteachwearDegCRaw = o.teachwearDegCRaw(); - compteachwearGyroXRaw = o.teachwearGyroXRaw(); - compteachwearGyroYRaw = o.teachwearGyroYRaw(); - compteachwearGyroZRaw = o.teachwearGyroZRaw(); - compteachwearMagnXRaw = o.teachwearMagnXRaw(); - compteachwearMagnYRaw = o.teachwearMagnYRaw(); - compteachwearMagnZRaw = o.teachwearMagnZRaw(); - compteachwearStateRaw = o.teachwearStateRaw(); - compteachwearResetReasonRaw = o.teachwearResetReasonRaw(); - compteachwearCRCRaw = o.teachwearCRCRaw(); - compnbTmSinceFirstStartRaw = o.nbTmSinceFirstStartRaw(); - } + private int teachWearOn; + private int frequenceOfAcquisitions; + private long gain; + private int numberOfAcquisitionCommanded; + private int numberOfRealAcquisition; + private long hkPlus5v; + private long hkMinus5v; + private long hkMinus5vPolar; + private long hkTempAdc; + private long hkFeePlusXVref; + private long hkFeeMinusXVref; + private long hkFeePlusYVref; + private long hkFeeMinusYVref; + private long feePlusXErs1Signal; + private long feePlusXErs1Temperature; + private long feePlusXErs2Signal; + private long feePlusXErs2Temperature; + private long feePlusXErs3Signal; + private long feePlusXErs3Temperature; + private long feePlusXUvsSignal; + private long feeMinusXErs1Signal; + private long feeMinusXErs1Temperature; + private long feeMinusXErs2Signal; + private long feeMinusXErs2Temperature; + private long feeMinusXErs3Signal; + private long feeMinusXErs3Temperature; + private long feeMinusXUvsSignal; + private long feePlusYErs1Signal; + private long feePlusYErs1Temperature; + private long feePlusYErs2Signal; + private long feePlusYErs2Temperature; + private long feePlusYErs3Signal; + private long feePlusYErs3Temperature; + private long feePlusYUvsSignal; + private long feeMinusYErs1Signal; + private long feeMinusYErs1Temperature; + private long feeMinusYErs2Signal; + private long feeMinusYErs2Temperature; + private long feeMinusYErs3Signal; + private long feeMinusYErs3Temperature; + private long feeMinusYUvsSignal; + private int teachwearAccX; + private int teachwearAccY; + private int teachwearAccZ; + private int teachwearDegC; + private int teachwearGyroX; + private int teachwearGyroY; + private int teachwearGyroZ; + private int teachwearMagnX; + private int teachwearMagnY; + private int teachwearMagnZ; + private int teachwearState; + private int teachwearResetReason; + private int teachwearCrc; + private long nbTmSinceFirstStart; + /** - Instance Declaration * */ + private long compmainboardScienceTimeRaw; - public String toStringRaw () { - - return " " - + separator + "mainboardScienceTime : " +mainboardScienceTime - + separator + "teachWearOn : " +teachWearOn - + separator + "frequenceOfAcquisitions : " +frequenceOfAcquisitions - + separator + "gain : " +gain - + separator + "numberOfAcquisitionCommanded : " +numberOfAcquisitionCommanded - + separator + "numberOfRealAcquisition : " +numberOfRealAcquisition - + separator + "hkPlus5v : " +hkPlus5v - + separator + "hkMinus5v : " +hkMinus5v - + separator + "hkMinus5vPolar : " +hkMinus5vPolar - + separator + "hkTempAdc : " +hkTempAdc - + separator + "hkFeePlusXVref : " +hkFeePlusXVref - + separator + "hkFeeMinusXVref : " +hkFeeMinusXVref - + separator + "hkFeePlusYVref : " +hkFeePlusYVref - + separator + "hkFeeMinusYVref : " +hkFeeMinusYVref - + separator + "feePlusXErs1Signal : " +feePlusXErs1Signal - + separator + "feePlusXErs1Temperature : " +feePlusXErs1Temperature - + separator + "feePlusXErs2Signal : " +feePlusXErs2Signal - + separator + "feePlusXErs2Temperature : " +feePlusXErs2Temperature - + separator + "feePlusXErs3Signal : " +feePlusXErs3Signal - + separator + "feePlusXErs3Temperature : " +feePlusXErs3Temperature - + separator + "feePlusXUvsSignal : " +feePlusXUvsSignal - + separator + "feeMinusXErs1Signal : " +feeMinusXErs1Signal - + separator + "feeMinusXErs1Temperature : " +feeMinusXErs1Temperature - + separator + "feeMinusXErs2Signal : " +feeMinusXErs2Signal - + separator + "feeMinusXErs2Temperature : " +feeMinusXErs2Temperature - + separator + "feeMinusXErs3Signal : " +feeMinusXErs3Signal - + separator + "feeMinusXErs3Temperature : " +feeMinusXErs3Temperature - + separator + "feeMinusXUvsSignal : " +feeMinusXUvsSignal - + separator + "feePlusYErs1Signal : " +feePlusYErs1Signal - + separator + "feePlusYErs1Temperature : " +feePlusYErs1Temperature - + separator + "feePlusYErs2Signal : " +feePlusYErs2Signal - + separator + "feePlusYErs2Temperature : " +feePlusYErs2Temperature - + separator + "feePlusYErs3Signal : " +feePlusYErs3Signal - + separator + "feePlusYErs3Temperature : " +feePlusYErs3Temperature - + separator + "feePlusYUvsSignal : " +feePlusYUvsSignal - + separator + "feeMinusYErs1Signal : " +feeMinusYErs1Signal - + separator + "feeMinusYErs1Temperature : " +feeMinusYErs1Temperature - + separator + "feeMinusYErs2Signal : " +feeMinusYErs2Signal - + separator + "feeMinusYErs2Temperature : " +feeMinusYErs2Temperature - + separator + "feeMinusYErs3Signal : " +feeMinusYErs3Signal - + separator + "feeMinusYErs3Temperature : " +feeMinusYErs3Temperature - + separator + "feeMinusYUvsSignal : " +feeMinusYUvsSignal - + separator + "teachwearAccX : " +teachwearAccX - + separator + "teachwearAccY : " +teachwearAccY - + separator + "teachwearAccZ : " +teachwearAccZ - + separator + "teachwearDegC : " +teachwearDegC - + separator + "teachwearGyroX : " +teachwearGyroX - + separator + "teachwearGyroY : " +teachwearGyroY - + separator + "teachwearGyroZ : " +teachwearGyroZ - + separator + "teachwearMagnX : " +teachwearMagnX - + separator + "teachwearMagnY : " +teachwearMagnY - + separator + "teachwearMagnZ : " +teachwearMagnZ - + separator + "teachwearState : " +teachwearState - + separator + "teachwearResetReason : " +teachwearResetReason - + separator + "teachwearCrc : " +teachwearCrc - + separator + "nbTmSinceFirstStart : " +nbTmSinceFirstStart -; } + private long compteachWearOnRaw; + private long compfrequenceOfAcquisitionsRaw; + private long compgainRaw; + private long compnumberOfAcquisitionCommandedRaw; + private long compnumberOfRealAcquisitionRaw; + private long comphkPlus5vRaw; + private long comphkMinus5vRaw; + private long comphkMinus5vPolarRaw; + private long comphkTempAdcRaw; + private long comphkFeePlusXVrefRaw; + private long comphkFeeMinusXVrefRaw; + private long comphkFeePlusYVrefRaw; + private long comphkFeeMinusYVrefRaw; + private long compfeePlusXErs1SignalRaw; + private long compfeePlusXErs1TemperatureRaw; + private long compfeePlusXErs2SignalRaw; + private long compfeePlusXErs2TemperatureRaw; + private long compfeePlusXErs3SignalRaw; + private long compfeePlusXErs3TemperatureRaw; + private long compfeePlusXUvsSignalRaw; + private long compfeeMinusXErs1SignalRaw; + private long compfeeMinusXErs1TemperatureRaw; + private long compfeeMinusXErs2SignalRaw; + private long compfeeMinusXErs2TemperatureRaw; + private long compfeeMinusXErs3SignalRaw; + private long compfeeMinusXErs3TemperatureRaw; + private long compfeeMinusXUvsSignalRaw; + private long compfeePlusYErs1SignalRaw; + private long compfeePlusYErs1TemperatureRaw; + private long compfeePlusYErs2SignalRaw; + private long compfeePlusYErs2TemperatureRaw; + private long compfeePlusYErs3SignalRaw; + private long compfeePlusYErs3TemperatureRaw; + private long compfeePlusYUvsSignalRaw; + private long compfeeMinusYErs1SignalRaw; + private long compfeeMinusYErs1TemperatureRaw; + private long compfeeMinusYErs2SignalRaw; + private long compfeeMinusYErs2TemperatureRaw; + private long compfeeMinusYErs3SignalRaw; + private long compfeeMinusYErs3TemperatureRaw; + private long compfeeMinusYUvsSignalRaw; + private long compteachwearAccXRaw; + private long compteachwearAccYRaw; + private long compteachwearAccZRaw; + private long compteachwearDegCRaw; + private long compteachwearGyroXRaw; + private long compteachwearGyroYRaw; + private long compteachwearGyroZRaw; + private long compteachwearMagnXRaw; + private long compteachwearMagnYRaw; + private long compteachwearMagnZRaw; + private long compteachwearStateRaw; + private long compteachwearResetReasonRaw; + private long compteachwearCRCRaw; + private long compnbTmSinceFirstStartRaw; - public String toStringCompute () { - - return " " - + separator + "mainboard science time : Ox" + toHex(mainboardScienceTime) + " : " + compmainboardScienceTimeRaw - + separator + "teach wear on : Ox" + toHex(teachWearOn) + " : " + compteachWearOnRaw - + separator + "frequence of acquisitions : Ox" + toHex(frequenceOfAcquisitions) + " : " + compfrequenceOfAcquisitionsRaw - + separator + "gain : Ox" + toHex(gain) + " : " + compgainRaw - + separator + "number of acquisition commanded : Ox" + toHex(numberOfAcquisitionCommanded) + " : " + compnumberOfAcquisitionCommandedRaw - + separator + "number of real acquisition : Ox" + toHex(numberOfRealAcquisition) + " : " + compnumberOfRealAcquisitionRaw - + separator + "hk plus 5v : Ox" + toHex(hkPlus5v) + " : " + comphkPlus5vRaw - + separator + "hk minus 5v : Ox" + toHex(hkMinus5v) + " : " + comphkMinus5vRaw - + separator + "hk minus 5v polar : Ox" + toHex(hkMinus5vPolar) + " : " + comphkMinus5vPolarRaw - + separator + "hk temp adc : Ox" + toHex(hkTempAdc) + " : " + comphkTempAdcRaw - + separator + "hk fee plus x vref : Ox" + toHex(hkFeePlusXVref) + " : " + comphkFeePlusXVrefRaw - + separator + "hk fee minus x vref : Ox" + toHex(hkFeeMinusXVref) + " : " + comphkFeeMinusXVrefRaw - + separator + "hk fee plus y vref : Ox" + toHex(hkFeePlusYVref) + " : " + comphkFeePlusYVrefRaw - + separator + "hk fee minus y vref : Ox" + toHex(hkFeeMinusYVref) + " : " + comphkFeeMinusYVrefRaw - + separator + "fee plus x ers 1 signal : Ox" + toHex(feePlusXErs1Signal) + " : " + compfeePlusXErs1SignalRaw - + separator + "fee plus x ers 1 temperature : Ox" + toHex(feePlusXErs1Temperature) + " : " + compfeePlusXErs1TemperatureRaw - + separator + "fee plus x ers 2 signal : Ox" + toHex(feePlusXErs2Signal) + " : " + compfeePlusXErs2SignalRaw - + separator + "fee plus x ers 2 temperature : Ox" + toHex(feePlusXErs2Temperature) + " : " + compfeePlusXErs2TemperatureRaw - + separator + "fee plus x ers 3 signal : Ox" + toHex(feePlusXErs3Signal) + " : " + compfeePlusXErs3SignalRaw - + separator + "fee plus x ers 3 temperature : Ox" + toHex(feePlusXErs3Temperature) + " : " + compfeePlusXErs3TemperatureRaw - + separator + "fee plus x uvs signal : Ox" + toHex(feePlusXUvsSignal) + " : " + compfeePlusXUvsSignalRaw - + separator + "fee minus x ers 1 signal : Ox" + toHex(feeMinusXErs1Signal) + " : " + compfeeMinusXErs1SignalRaw - + separator + "fee minus x ers 1 temperature : Ox" + toHex(feeMinusXErs1Temperature) + " : " + compfeeMinusXErs1TemperatureRaw - + separator + "fee minus x ers 2 signal : Ox" + toHex(feeMinusXErs2Signal) + " : " + compfeeMinusXErs2SignalRaw - + separator + "fee minus x ers 2 temperature : Ox" + toHex(feeMinusXErs2Temperature) + " : " + compfeeMinusXErs2TemperatureRaw - + separator + "fee minus x ers 3 signal : Ox" + toHex(feeMinusXErs3Signal) + " : " + compfeeMinusXErs3SignalRaw - + separator + "fee minus x ers 3 temperature : Ox" + toHex(feeMinusXErs3Temperature) + " : " + compfeeMinusXErs3TemperatureRaw - + separator + "fee minus x uvs signal : Ox" + toHex(feeMinusXUvsSignal) + " : " + compfeeMinusXUvsSignalRaw - + separator + "fee plus y ers 1 signal : Ox" + toHex(feePlusYErs1Signal) + " : " + compfeePlusYErs1SignalRaw - + separator + "fee plus y ers 1 temperature : Ox" + toHex(feePlusYErs1Temperature) + " : " + compfeePlusYErs1TemperatureRaw - + separator + "fee plus y ers 2 signal : Ox" + toHex(feePlusYErs2Signal) + " : " + compfeePlusYErs2SignalRaw - + separator + "fee plus y ers 2 temperature : Ox" + toHex(feePlusYErs2Temperature) + " : " + compfeePlusYErs2TemperatureRaw - + separator + "fee plus y ers 3 signal : Ox" + toHex(feePlusYErs3Signal) + " : " + compfeePlusYErs3SignalRaw - + separator + "fee plus y ers 3 temperature : Ox" + toHex(feePlusYErs3Temperature) + " : " + compfeePlusYErs3TemperatureRaw - + separator + "fee plus y uvs signal : Ox" + toHex(feePlusYUvsSignal) + " : " + compfeePlusYUvsSignalRaw - + separator + "fee minus y ers 1 signal : Ox" + toHex(feeMinusYErs1Signal) + " : " + compfeeMinusYErs1SignalRaw - + separator + "fee minus y ers 1 temperature : Ox" + toHex(feeMinusYErs1Temperature) + " : " + compfeeMinusYErs1TemperatureRaw - + separator + "fee minus y ers 2 signal : Ox" + toHex(feeMinusYErs2Signal) + " : " + compfeeMinusYErs2SignalRaw - + separator + "fee minus y ers 2 temperature : Ox" + toHex(feeMinusYErs2Temperature) + " : " + compfeeMinusYErs2TemperatureRaw - + separator + "fee minus y ers 3 signal : Ox" + toHex(feeMinusYErs3Signal) + " : " + compfeeMinusYErs3SignalRaw - + separator + "fee minus y ers 3 temperature : Ox" + toHex(feeMinusYErs3Temperature) + " : " + compfeeMinusYErs3TemperatureRaw - + separator + "fee minus y uvs signal : Ox" + toHex(feeMinusYUvsSignal) + " : " + compfeeMinusYUvsSignalRaw - + separator + "teachwear acc x : Ox" + toHex(teachwearAccX) + " : " + compteachwearAccXRaw - + separator + "teachwear acc y : Ox" + toHex(teachwearAccY) + " : " + compteachwearAccYRaw - + separator + "teachwear acc z : Ox" + toHex(teachwearAccZ) + " : " + compteachwearAccZRaw - + separator + "teachwear deg c : Ox" + toHex(teachwearDegC) + " : " + compteachwearDegCRaw - + separator + "teachwear gyro x : Ox" + toHex(teachwearGyroX) + " : " + compteachwearGyroXRaw - + separator + "teachwear gyro y : Ox" + toHex(teachwearGyroY) + " : " + compteachwearGyroYRaw - + separator + "teachwear gyro z : Ox" + toHex(teachwearGyroZ) + " : " + compteachwearGyroZRaw - + separator + "teachwear magn x : Ox" + toHex(teachwearMagnX) + " : " + compteachwearMagnXRaw - + separator + "teachwear magn y : Ox" + toHex(teachwearMagnY) + " : " + compteachwearMagnYRaw - + separator + "teachwear magn z : Ox" + toHex(teachwearMagnZ) + " : " + compteachwearMagnZRaw - + separator + "teachwear state : Ox" + toHex(teachwearState) + " : " + compteachwearStateRaw - + separator + "teachwear reset reason : Ox" + toHex(teachwearResetReason) + " : " + compteachwearResetReasonRaw - + separator + "teachwear c r c : Ox" + toHex(teachwearCrc) + " : " + compteachwearCRCRaw - + separator + "nb tm since first start : Ox" + toHex(nbTmSinceFirstStart) + " : " + compnbTmSinceFirstStartRaw -; } + public mainboardAllScience(MainboardAllScience o) { + mainboardScienceTime = o.mainboardScienceTime(); + teachWearOn = o.teachWearOn(); + frequenceOfAcquisitions = o.frequenceOfAcquisitions(); + gain = o.gain(); + numberOfAcquisitionCommanded = o.numberOfAcquisitionCommanded(); + numberOfRealAcquisition = o.numberOfRealAcquisition(); + hkPlus5v = o.hkPlus5v(); + hkMinus5v = o.hkMinus5v(); + hkMinus5vPolar = o.hkMinus5vPolar(); + hkTempAdc = o.hkTempAdc(); + hkFeePlusXVref = o.hkFeePlusXVref(); + hkFeeMinusXVref = o.hkFeeMinusXVref(); + hkFeePlusYVref = o.hkFeePlusYVref(); + hkFeeMinusYVref = o.hkFeeMinusYVref(); + feePlusXErs1Signal = o.feePlusXErs1Signal(); + feePlusXErs1Temperature = o.feePlusXErs1Temperature(); + feePlusXErs2Signal = o.feePlusXErs2Signal(); + feePlusXErs2Temperature = o.feePlusXErs2Temperature(); + feePlusXErs3Signal = o.feePlusXErs3Signal(); + feePlusXErs3Temperature = o.feePlusXErs3Temperature(); + feePlusXUvsSignal = o.feePlusXUvsSignal(); + feeMinusXErs1Signal = o.feeMinusXErs1Signal(); + feeMinusXErs1Temperature = o.feeMinusXErs1Temperature(); + feeMinusXErs2Signal = o.feeMinusXErs2Signal(); + feeMinusXErs2Temperature = o.feeMinusXErs2Temperature(); + feeMinusXErs3Signal = o.feeMinusXErs3Signal(); + feeMinusXErs3Temperature = o.feeMinusXErs3Temperature(); + feeMinusXUvsSignal = o.feeMinusXUvsSignal(); + feePlusYErs1Signal = o.feePlusYErs1Signal(); + feePlusYErs1Temperature = o.feePlusYErs1Temperature(); + feePlusYErs2Signal = o.feePlusYErs2Signal(); + feePlusYErs2Temperature = o.feePlusYErs2Temperature(); + feePlusYErs3Signal = o.feePlusYErs3Signal(); + feePlusYErs3Temperature = o.feePlusYErs3Temperature(); + feePlusYUvsSignal = o.feePlusYUvsSignal(); + feeMinusYErs1Signal = o.feeMinusYErs1Signal(); + feeMinusYErs1Temperature = o.feeMinusYErs1Temperature(); + feeMinusYErs2Signal = o.feeMinusYErs2Signal(); + feeMinusYErs2Temperature = o.feeMinusYErs2Temperature(); + feeMinusYErs3Signal = o.feeMinusYErs3Signal(); + feeMinusYErs3Temperature = o.feeMinusYErs3Temperature(); + feeMinusYUvsSignal = o.feeMinusYUvsSignal(); + teachwearAccX = o.teachwearAccX(); + teachwearAccY = o.teachwearAccY(); + teachwearAccZ = o.teachwearAccZ(); + teachwearDegC = o.teachwearDegC(); + teachwearGyroX = o.teachwearGyroX(); + teachwearGyroY = o.teachwearGyroY(); + teachwearGyroZ = o.teachwearGyroZ(); + teachwearMagnX = o.teachwearMagnX(); + teachwearMagnY = o.teachwearMagnY(); + teachwearMagnZ = o.teachwearMagnZ(); + teachwearState = o.teachwearState(); + teachwearResetReason = o.teachwearResetReason(); + teachwearCrc = o.teachwearCrc(); + nbTmSinceFirstStart = o.nbTmSinceFirstStart(); + compmainboardScienceTimeRaw = o.mainboardScienceTimeRaw(); + compteachWearOnRaw = o.teachWearOnRaw(); + compfrequenceOfAcquisitionsRaw = o.frequenceOfAcquisitionsRaw(); + compgainRaw = o.gainRaw(); + compnumberOfAcquisitionCommandedRaw = o.numberOfAcquisitionCommandedRaw(); + compnumberOfRealAcquisitionRaw = o.numberOfRealAcquisitionRaw(); + comphkPlus5vRaw = o.hkPlus5vRaw(); + comphkMinus5vRaw = o.hkMinus5vRaw(); + comphkMinus5vPolarRaw = o.hkMinus5vPolarRaw(); + comphkTempAdcRaw = o.hkTempAdcRaw(); + comphkFeePlusXVrefRaw = o.hkFeePlusXVrefRaw(); + comphkFeeMinusXVrefRaw = o.hkFeeMinusXVrefRaw(); + comphkFeePlusYVrefRaw = o.hkFeePlusYVrefRaw(); + comphkFeeMinusYVrefRaw = o.hkFeeMinusYVrefRaw(); + compfeePlusXErs1SignalRaw = o.feePlusXErs1SignalRaw(); + compfeePlusXErs1TemperatureRaw = o.feePlusXErs1TemperatureRaw(); + compfeePlusXErs2SignalRaw = o.feePlusXErs2SignalRaw(); + compfeePlusXErs2TemperatureRaw = o.feePlusXErs2TemperatureRaw(); + compfeePlusXErs3SignalRaw = o.feePlusXErs3SignalRaw(); + compfeePlusXErs3TemperatureRaw = o.feePlusXErs3TemperatureRaw(); + compfeePlusXUvsSignalRaw = o.feePlusXUvsSignalRaw(); + compfeeMinusXErs1SignalRaw = o.feeMinusXErs1SignalRaw(); + compfeeMinusXErs1TemperatureRaw = o.feeMinusXErs1TemperatureRaw(); + compfeeMinusXErs2SignalRaw = o.feeMinusXErs2SignalRaw(); + compfeeMinusXErs2TemperatureRaw = o.feeMinusXErs2TemperatureRaw(); + compfeeMinusXErs3SignalRaw = o.feeMinusXErs3SignalRaw(); + compfeeMinusXErs3TemperatureRaw = o.feeMinusXErs3TemperatureRaw(); + compfeeMinusXUvsSignalRaw = o.feeMinusXUvsSignalRaw(); + compfeePlusYErs1SignalRaw = o.feePlusYErs1SignalRaw(); + compfeePlusYErs1TemperatureRaw = o.feePlusYErs1TemperatureRaw(); + compfeePlusYErs2SignalRaw = o.feePlusYErs2SignalRaw(); + compfeePlusYErs2TemperatureRaw = o.feePlusYErs2TemperatureRaw(); + compfeePlusYErs3SignalRaw = o.feePlusYErs3SignalRaw(); + compfeePlusYErs3TemperatureRaw = o.feePlusYErs3TemperatureRaw(); + compfeePlusYUvsSignalRaw = o.feePlusYUvsSignalRaw(); + compfeeMinusYErs1SignalRaw = o.feeMinusYErs1SignalRaw(); + compfeeMinusYErs1TemperatureRaw = o.feeMinusYErs1TemperatureRaw(); + compfeeMinusYErs2SignalRaw = o.feeMinusYErs2SignalRaw(); + compfeeMinusYErs2TemperatureRaw = o.feeMinusYErs2TemperatureRaw(); + compfeeMinusYErs3SignalRaw = o.feeMinusYErs3SignalRaw(); + compfeeMinusYErs3TemperatureRaw = o.feeMinusYErs3TemperatureRaw(); + compfeeMinusYUvsSignalRaw = o.feeMinusYUvsSignalRaw(); + compteachwearAccXRaw = o.teachwearAccXRaw(); + compteachwearAccYRaw = o.teachwearAccYRaw(); + compteachwearAccZRaw = o.teachwearAccZRaw(); + compteachwearDegCRaw = o.teachwearDegCRaw(); + compteachwearGyroXRaw = o.teachwearGyroXRaw(); + compteachwearGyroYRaw = o.teachwearGyroYRaw(); + compteachwearGyroZRaw = o.teachwearGyroZRaw(); + compteachwearMagnXRaw = o.teachwearMagnXRaw(); + compteachwearMagnYRaw = o.teachwearMagnYRaw(); + compteachwearMagnZRaw = o.teachwearMagnZRaw(); + compteachwearStateRaw = o.teachwearStateRaw(); + compteachwearResetReasonRaw = o.teachwearResetReasonRaw(); + compteachwearCRCRaw = o.teachwearCRCRaw(); + compnbTmSinceFirstStartRaw = o.nbTmSinceFirstStartRaw(); + } + + public String toStringRaw() { + + return " " + + separator + + "mainboardScienceTime : " + + mainboardScienceTime + + separator + + "teachWearOn : " + + teachWearOn + + separator + + "frequenceOfAcquisitions : " + + frequenceOfAcquisitions + + separator + + "gain : " + + gain + + separator + + "numberOfAcquisitionCommanded : " + + numberOfAcquisitionCommanded + + separator + + "numberOfRealAcquisition : " + + numberOfRealAcquisition + + separator + + "hkPlus5v : " + + hkPlus5v + + separator + + "hkMinus5v : " + + hkMinus5v + + separator + + "hkMinus5vPolar : " + + hkMinus5vPolar + + separator + + "hkTempAdc : " + + hkTempAdc + + separator + + "hkFeePlusXVref : " + + hkFeePlusXVref + + separator + + "hkFeeMinusXVref : " + + hkFeeMinusXVref + + separator + + "hkFeePlusYVref : " + + hkFeePlusYVref + + separator + + "hkFeeMinusYVref : " + + hkFeeMinusYVref + + separator + + "feePlusXErs1Signal : " + + feePlusXErs1Signal + + separator + + "feePlusXErs1Temperature : " + + feePlusXErs1Temperature + + separator + + "feePlusXErs2Signal : " + + feePlusXErs2Signal + + separator + + "feePlusXErs2Temperature : " + + feePlusXErs2Temperature + + separator + + "feePlusXErs3Signal : " + + feePlusXErs3Signal + + separator + + "feePlusXErs3Temperature : " + + feePlusXErs3Temperature + + separator + + "feePlusXUvsSignal : " + + feePlusXUvsSignal + + separator + + "feeMinusXErs1Signal : " + + feeMinusXErs1Signal + + separator + + "feeMinusXErs1Temperature : " + + feeMinusXErs1Temperature + + separator + + "feeMinusXErs2Signal : " + + feeMinusXErs2Signal + + separator + + "feeMinusXErs2Temperature : " + + feeMinusXErs2Temperature + + separator + + "feeMinusXErs3Signal : " + + feeMinusXErs3Signal + + separator + + "feeMinusXErs3Temperature : " + + feeMinusXErs3Temperature + + separator + + "feeMinusXUvsSignal : " + + feeMinusXUvsSignal + + separator + + "feePlusYErs1Signal : " + + feePlusYErs1Signal + + separator + + "feePlusYErs1Temperature : " + + feePlusYErs1Temperature + + separator + + "feePlusYErs2Signal : " + + feePlusYErs2Signal + + separator + + "feePlusYErs2Temperature : " + + feePlusYErs2Temperature + + separator + + "feePlusYErs3Signal : " + + feePlusYErs3Signal + + separator + + "feePlusYErs3Temperature : " + + feePlusYErs3Temperature + + separator + + "feePlusYUvsSignal : " + + feePlusYUvsSignal + + separator + + "feeMinusYErs1Signal : " + + feeMinusYErs1Signal + + separator + + "feeMinusYErs1Temperature : " + + feeMinusYErs1Temperature + + separator + + "feeMinusYErs2Signal : " + + feeMinusYErs2Signal + + separator + + "feeMinusYErs2Temperature : " + + feeMinusYErs2Temperature + + separator + + "feeMinusYErs3Signal : " + + feeMinusYErs3Signal + + separator + + "feeMinusYErs3Temperature : " + + feeMinusYErs3Temperature + + separator + + "feeMinusYUvsSignal : " + + feeMinusYUvsSignal + + separator + + "teachwearAccX : " + + teachwearAccX + + separator + + "teachwearAccY : " + + teachwearAccY + + separator + + "teachwearAccZ : " + + teachwearAccZ + + separator + + "teachwearDegC : " + + teachwearDegC + + separator + + "teachwearGyroX : " + + teachwearGyroX + + separator + + "teachwearGyroY : " + + teachwearGyroY + + separator + + "teachwearGyroZ : " + + teachwearGyroZ + + separator + + "teachwearMagnX : " + + teachwearMagnX + + separator + + "teachwearMagnY : " + + teachwearMagnY + + separator + + "teachwearMagnZ : " + + teachwearMagnZ + + separator + + "teachwearState : " + + teachwearState + + separator + + "teachwearResetReason : " + + teachwearResetReason + + separator + + "teachwearCrc : " + + teachwearCrc + + separator + + "nbTmSinceFirstStart : " + + nbTmSinceFirstStart; + } + + public String toStringCompute() { + + return " " + + separator + + "mainboard science time : Ox" + + toHex(mainboardScienceTime) + + " : " + + compmainboardScienceTimeRaw + + separator + + "teach wear on : Ox" + + toHex(teachWearOn) + + " : " + + compteachWearOnRaw + + separator + + "frequence of acquisitions : Ox" + + toHex(frequenceOfAcquisitions) + + " : " + + compfrequenceOfAcquisitionsRaw + + separator + + "gain : Ox" + + toHex(gain) + + " : " + + compgainRaw + + separator + + "number of acquisition commanded : Ox" + + toHex(numberOfAcquisitionCommanded) + + " : " + + compnumberOfAcquisitionCommandedRaw + + separator + + "number of real acquisition : Ox" + + toHex(numberOfRealAcquisition) + + " : " + + compnumberOfRealAcquisitionRaw + + separator + + "hk plus 5v : Ox" + + toHex(hkPlus5v) + + " : " + + comphkPlus5vRaw + + separator + + "hk minus 5v : Ox" + + toHex(hkMinus5v) + + " : " + + comphkMinus5vRaw + + separator + + "hk minus 5v polar : Ox" + + toHex(hkMinus5vPolar) + + " : " + + comphkMinus5vPolarRaw + + separator + + "hk temp adc : Ox" + + toHex(hkTempAdc) + + " : " + + comphkTempAdcRaw + + separator + + "hk fee plus x vref : Ox" + + toHex(hkFeePlusXVref) + + " : " + + comphkFeePlusXVrefRaw + + separator + + "hk fee minus x vref : Ox" + + toHex(hkFeeMinusXVref) + + " : " + + comphkFeeMinusXVrefRaw + + separator + + "hk fee plus y vref : Ox" + + toHex(hkFeePlusYVref) + + " : " + + comphkFeePlusYVrefRaw + + separator + + "hk fee minus y vref : Ox" + + toHex(hkFeeMinusYVref) + + " : " + + comphkFeeMinusYVrefRaw + + separator + + "fee plus x ers 1 signal : Ox" + + toHex(feePlusXErs1Signal) + + " : " + + compfeePlusXErs1SignalRaw + + separator + + "fee plus x ers 1 temperature : Ox" + + toHex(feePlusXErs1Temperature) + + " : " + + compfeePlusXErs1TemperatureRaw + + separator + + "fee plus x ers 2 signal : Ox" + + toHex(feePlusXErs2Signal) + + " : " + + compfeePlusXErs2SignalRaw + + separator + + "fee plus x ers 2 temperature : Ox" + + toHex(feePlusXErs2Temperature) + + " : " + + compfeePlusXErs2TemperatureRaw + + separator + + "fee plus x ers 3 signal : Ox" + + toHex(feePlusXErs3Signal) + + " : " + + compfeePlusXErs3SignalRaw + + separator + + "fee plus x ers 3 temperature : Ox" + + toHex(feePlusXErs3Temperature) + + " : " + + compfeePlusXErs3TemperatureRaw + + separator + + "fee plus x uvs signal : Ox" + + toHex(feePlusXUvsSignal) + + " : " + + compfeePlusXUvsSignalRaw + + separator + + "fee minus x ers 1 signal : Ox" + + toHex(feeMinusXErs1Signal) + + " : " + + compfeeMinusXErs1SignalRaw + + separator + + "fee minus x ers 1 temperature : Ox" + + toHex(feeMinusXErs1Temperature) + + " : " + + compfeeMinusXErs1TemperatureRaw + + separator + + "fee minus x ers 2 signal : Ox" + + toHex(feeMinusXErs2Signal) + + " : " + + compfeeMinusXErs2SignalRaw + + separator + + "fee minus x ers 2 temperature : Ox" + + toHex(feeMinusXErs2Temperature) + + " : " + + compfeeMinusXErs2TemperatureRaw + + separator + + "fee minus x ers 3 signal : Ox" + + toHex(feeMinusXErs3Signal) + + " : " + + compfeeMinusXErs3SignalRaw + + separator + + "fee minus x ers 3 temperature : Ox" + + toHex(feeMinusXErs3Temperature) + + " : " + + compfeeMinusXErs3TemperatureRaw + + separator + + "fee minus x uvs signal : Ox" + + toHex(feeMinusXUvsSignal) + + " : " + + compfeeMinusXUvsSignalRaw + + separator + + "fee plus y ers 1 signal : Ox" + + toHex(feePlusYErs1Signal) + + " : " + + compfeePlusYErs1SignalRaw + + separator + + "fee plus y ers 1 temperature : Ox" + + toHex(feePlusYErs1Temperature) + + " : " + + compfeePlusYErs1TemperatureRaw + + separator + + "fee plus y ers 2 signal : Ox" + + toHex(feePlusYErs2Signal) + + " : " + + compfeePlusYErs2SignalRaw + + separator + + "fee plus y ers 2 temperature : Ox" + + toHex(feePlusYErs2Temperature) + + " : " + + compfeePlusYErs2TemperatureRaw + + separator + + "fee plus y ers 3 signal : Ox" + + toHex(feePlusYErs3Signal) + + " : " + + compfeePlusYErs3SignalRaw + + separator + + "fee plus y ers 3 temperature : Ox" + + toHex(feePlusYErs3Temperature) + + " : " + + compfeePlusYErs3TemperatureRaw + + separator + + "fee plus y uvs signal : Ox" + + toHex(feePlusYUvsSignal) + + " : " + + compfeePlusYUvsSignalRaw + + separator + + "fee minus y ers 1 signal : Ox" + + toHex(feeMinusYErs1Signal) + + " : " + + compfeeMinusYErs1SignalRaw + + separator + + "fee minus y ers 1 temperature : Ox" + + toHex(feeMinusYErs1Temperature) + + " : " + + compfeeMinusYErs1TemperatureRaw + + separator + + "fee minus y ers 2 signal : Ox" + + toHex(feeMinusYErs2Signal) + + " : " + + compfeeMinusYErs2SignalRaw + + separator + + "fee minus y ers 2 temperature : Ox" + + toHex(feeMinusYErs2Temperature) + + " : " + + compfeeMinusYErs2TemperatureRaw + + separator + + "fee minus y ers 3 signal : Ox" + + toHex(feeMinusYErs3Signal) + + " : " + + compfeeMinusYErs3SignalRaw + + separator + + "fee minus y ers 3 temperature : Ox" + + toHex(feeMinusYErs3Temperature) + + " : " + + compfeeMinusYErs3TemperatureRaw + + separator + + "fee minus y uvs signal : Ox" + + toHex(feeMinusYUvsSignal) + + " : " + + compfeeMinusYUvsSignalRaw + + separator + + "teachwear acc x : Ox" + + toHex(teachwearAccX) + + " : " + + compteachwearAccXRaw + + separator + + "teachwear acc y : Ox" + + toHex(teachwearAccY) + + " : " + + compteachwearAccYRaw + + separator + + "teachwear acc z : Ox" + + toHex(teachwearAccZ) + + " : " + + compteachwearAccZRaw + + separator + + "teachwear deg c : Ox" + + toHex(teachwearDegC) + + " : " + + compteachwearDegCRaw + + separator + + "teachwear gyro x : Ox" + + toHex(teachwearGyroX) + + " : " + + compteachwearGyroXRaw + + separator + + "teachwear gyro y : Ox" + + toHex(teachwearGyroY) + + " : " + + compteachwearGyroYRaw + + separator + + "teachwear gyro z : Ox" + + toHex(teachwearGyroZ) + + " : " + + compteachwearGyroZRaw + + separator + + "teachwear magn x : Ox" + + toHex(teachwearMagnX) + + " : " + + compteachwearMagnXRaw + + separator + + "teachwear magn y : Ox" + + toHex(teachwearMagnY) + + " : " + + compteachwearMagnYRaw + + separator + + "teachwear magn z : Ox" + + toHex(teachwearMagnZ) + + " : " + + compteachwearMagnZRaw + + separator + + "teachwear state : Ox" + + toHex(teachwearState) + + " : " + + compteachwearStateRaw + + separator + + "teachwear reset reason : Ox" + + toHex(teachwearResetReason) + + " : " + + compteachwearResetReasonRaw + + separator + + "teachwear c r c : Ox" + + toHex(teachwearCrc) + + " : " + + compteachwearCRCRaw + + separator + + "nb tm since first start : Ox" + + toHex(nbTmSinceFirstStart) + + " : " + + compnbTmSinceFirstStartRaw; + } } diff --git a/ModuleUVSQsatTelemetry/src/main/java/org/josast/uvsqsat/pojogenerated/mainboardHk.java b/ModuleUVSQsatTelemetry/src/main/java/org/josast/uvsqsat/pojogenerated/mainboardHk.java index bcacc144417837366ffeb54f0e181e5b1673450a..14375fb6e6608c2863582cae707b5f8199d169e4 100644 --- a/ModuleUVSQsatTelemetry/src/main/java/org/josast/uvsqsat/pojogenerated/mainboardHk.java +++ b/ModuleUVSQsatTelemetry/src/main/java/org/josast/uvsqsat/pojogenerated/mainboardHk.java @@ -5,77 +5,133 @@ package org.josast.uvsqsat.pojogenerated; import org.josast.uvsqsat.generated.Uvsqsat.MainboardHk; -public class mainboardHk extends AFrame { +public class mainboardHk extends AFrame { - private String separator=" \r\n" ; -/** - data raw Declaration **/ - private long mainboardHkTime; - private int hkPlus5V; - private int hkMinus5V; - private int hkMinusPolar; - private int hkTempADC; - private int hkFeePlusXVref; - private int hkFeeMinusXVref; - private int hkFeePlusYVref; - private int hkFeeMinusYVref; -/** - Instance Declaration **/ - private long compmainboardHKTimeRaw; - private long comphkPlus5VRaw; - private long comphkMinus5VRaw; - private long comphkMinusPolarRaw; - private long comphkTempADCRaw; - private long comphkFeePlusXVrefRaw; - private long comphkFeeMinusXVrefRaw; - private long comphkFeePlusYVrefRaw; - private long comphkFeeMinusYVrefRaw; - public mainboardHk(MainboardHk o) { + private String separator = " \r\n"; + /** - data raw Declaration * */ + private long mainboardHkTime; - mainboardHkTime = o.mainboardHkTime(); - hkPlus5V = o.hkPlus5V(); - hkMinus5V = o.hkMinus5V(); - hkMinusPolar = o.hkMinusPolar(); - hkTempADC = o.hkTempADC(); - hkFeePlusXVref = o.hkFeePlusXVref(); - hkFeeMinusXVref = o.hkFeeMinusXVref(); - hkFeePlusYVref = o.hkFeePlusYVref(); - hkFeeMinusYVref = o.hkFeeMinusYVref(); - compmainboardHKTimeRaw = o.mainboardHKTimeRaw(); - comphkPlus5VRaw = o.hkPlus5VRaw(); - comphkMinus5VRaw = o.hkMinus5VRaw(); - comphkMinusPolarRaw = o.hkMinusPolarRaw(); - comphkTempADCRaw = o.hkTempADCRaw(); - comphkFeePlusXVrefRaw = o.hkFeePlusXVrefRaw(); - comphkFeeMinusXVrefRaw = o.hkFeeMinusXVrefRaw(); - comphkFeePlusYVrefRaw = o.hkFeePlusYVrefRaw(); - comphkFeeMinusYVrefRaw = o.hkFeeMinusYVrefRaw(); - } + private int hkPlus5V; + private int hkMinus5V; + private int hkMinusPolar; + private int hkTempADC; + private int hkFeePlusXVref; + private int hkFeeMinusXVref; + private int hkFeePlusYVref; + private int hkFeeMinusYVref; + /** - Instance Declaration * */ + private long compmainboardHKTimeRaw; - public String toStringRaw () { - - return " " - + separator + "mainboardHkTime : " +mainboardHkTime - + separator + "hkPlus5V : " +hkPlus5V - + separator + "hkMinus5V : " +hkMinus5V - + separator + "hkMinusPolar : " +hkMinusPolar - + separator + "hkTempADC : " +hkTempADC - + separator + "hkFeePlusXVref : " +hkFeePlusXVref - + separator + "hkFeeMinusXVref : " +hkFeeMinusXVref - + separator + "hkFeePlusYVref : " +hkFeePlusYVref - + separator + "hkFeeMinusYVref : " +hkFeeMinusYVref -; } + private long comphkPlus5VRaw; + private long comphkMinus5VRaw; + private long comphkMinusPolarRaw; + private long comphkTempADCRaw; + private long comphkFeePlusXVrefRaw; + private long comphkFeeMinusXVrefRaw; + private long comphkFeePlusYVrefRaw; + private long comphkFeeMinusYVrefRaw; - public String toStringCompute () { - - return " " - + separator + "mainboard h k time : Ox" + toHex(mainboardHkTime) + " : " + compmainboardHKTimeRaw - + separator + "hk plus 5 v : Ox" + toHex(hkPlus5V) + " : " + comphkPlus5VRaw - + separator + "hk minus 5 v : Ox" + toHex(hkMinus5V) + " : " + comphkMinus5VRaw - + separator + "hk minus polar : Ox" + toHex(hkMinusPolar) + " : " + comphkMinusPolarRaw - + separator + "hk temp a d c : Ox" + toHex(hkTempADC) + " : " + comphkTempADCRaw - + separator + "hk fee plus x vref : Ox" + toHex(hkFeePlusXVref) + " : " + comphkFeePlusXVrefRaw - + separator + "hk fee minus x vref : Ox" + toHex(hkFeeMinusXVref) + " : " + comphkFeeMinusXVrefRaw - + separator + "hk fee plus y vref : Ox" + toHex(hkFeePlusYVref) + " : " + comphkFeePlusYVrefRaw - + separator + "hk fee minus y vref : Ox" + toHex(hkFeeMinusYVref) + " : " + comphkFeeMinusYVrefRaw -; } + public mainboardHk(MainboardHk o) { + mainboardHkTime = o.mainboardHkTime(); + hkPlus5V = o.hkPlus5V(); + hkMinus5V = o.hkMinus5V(); + hkMinusPolar = o.hkMinusPolar(); + hkTempADC = o.hkTempADC(); + hkFeePlusXVref = o.hkFeePlusXVref(); + hkFeeMinusXVref = o.hkFeeMinusXVref(); + hkFeePlusYVref = o.hkFeePlusYVref(); + hkFeeMinusYVref = o.hkFeeMinusYVref(); + compmainboardHKTimeRaw = o.mainboardHKTimeRaw(); + comphkPlus5VRaw = o.hkPlus5VRaw(); + comphkMinus5VRaw = o.hkMinus5VRaw(); + comphkMinusPolarRaw = o.hkMinusPolarRaw(); + comphkTempADCRaw = o.hkTempADCRaw(); + comphkFeePlusXVrefRaw = o.hkFeePlusXVrefRaw(); + comphkFeeMinusXVrefRaw = o.hkFeeMinusXVrefRaw(); + comphkFeePlusYVrefRaw = o.hkFeePlusYVrefRaw(); + comphkFeeMinusYVrefRaw = o.hkFeeMinusYVrefRaw(); + } + + public String toStringRaw() { + + return " " + + separator + + "mainboardHkTime : " + + mainboardHkTime + + separator + + "hkPlus5V : " + + hkPlus5V + + separator + + "hkMinus5V : " + + hkMinus5V + + separator + + "hkMinusPolar : " + + hkMinusPolar + + separator + + "hkTempADC : " + + hkTempADC + + separator + + "hkFeePlusXVref : " + + hkFeePlusXVref + + separator + + "hkFeeMinusXVref : " + + hkFeeMinusXVref + + separator + + "hkFeePlusYVref : " + + hkFeePlusYVref + + separator + + "hkFeeMinusYVref : " + + hkFeeMinusYVref; + } + + public String toStringCompute() { + + return " " + + separator + + "mainboard h k time : Ox" + + toHex(mainboardHkTime) + + " : " + + compmainboardHKTimeRaw + + separator + + "hk plus 5 v : Ox" + + toHex(hkPlus5V) + + " : " + + comphkPlus5VRaw + + separator + + "hk minus 5 v : Ox" + + toHex(hkMinus5V) + + " : " + + comphkMinus5VRaw + + separator + + "hk minus polar : Ox" + + toHex(hkMinusPolar) + + " : " + + comphkMinusPolarRaw + + separator + + "hk temp a d c : Ox" + + toHex(hkTempADC) + + " : " + + comphkTempADCRaw + + separator + + "hk fee plus x vref : Ox" + + toHex(hkFeePlusXVref) + + " : " + + comphkFeePlusXVrefRaw + + separator + + "hk fee minus x vref : Ox" + + toHex(hkFeeMinusXVref) + + " : " + + comphkFeeMinusXVrefRaw + + separator + + "hk fee plus y vref : Ox" + + toHex(hkFeePlusYVref) + + " : " + + comphkFeePlusYVrefRaw + + separator + + "hk fee minus y vref : Ox" + + toHex(hkFeeMinusYVref) + + " : " + + comphkFeeMinusYVrefRaw; + } } diff --git a/ModuleUVSQsatTelemetry/src/main/java/org/josast/uvsqsat/pojogenerated/msgOrUnknow.java b/ModuleUVSQsatTelemetry/src/main/java/org/josast/uvsqsat/pojogenerated/msgOrUnknow.java index 7cae7a7e56c2a00ee0befe7a628dbba487aec23a..8169823f3f4569c1e2baf66f3bb567ad62e5d7ac 100644 --- a/ModuleUVSQsatTelemetry/src/main/java/org/josast/uvsqsat/pojogenerated/msgOrUnknow.java +++ b/ModuleUVSQsatTelemetry/src/main/java/org/josast/uvsqsat/pojogenerated/msgOrUnknow.java @@ -5,29 +5,28 @@ package org.josast.uvsqsat.pojogenerated; import org.josast.uvsqsat.generated.Uvsqsat.MsgOrUnknow; -public class msgOrUnknow extends AFrame { - - private String separator=" \r\n" ; -/** - data raw Declaration **/ -/** - Instance Declaration **/ - private byte [] compdataByte; -private byte[] data; - public msgOrUnknow(MsgOrUnknow o) { - - data = o.data(); - compdataByte = o.dataByte(); - } - - public String toStringRaw () { - - return " " - + separator + "data : " +data -; } - - public String toStringCompute () { - - return " " - + separator + "data byte : Ox" + toHex(data) + " : " + compdataByte -; } +public class msgOrUnknow extends AFrame { + private String separator = " \r\n"; + /** - data raw Declaration * */ + /** - Instance Declaration * */ + private byte[] compdataByte; + + private byte[] data; + + public msgOrUnknow(MsgOrUnknow o) { + + data = o.data(); + compdataByte = o.dataByte(); + } + + public String toStringRaw() { + + return " " + separator + "data : " + data; + } + + public String toStringCompute() { + + return " " + separator + "data byte : Ox" + toHex(data) + " : " + compdataByte; + } } diff --git a/ModuleUVSQsatTelemetry/src/main/java/org/josast/uvsqsat/pojogenerated/obcHk.java b/ModuleUVSQsatTelemetry/src/main/java/org/josast/uvsqsat/pojogenerated/obcHk.java index a43e97f63df3e21cf01bf0bd90e520c87b54eca3..a48fec1bc1b35d16118ad4a6fcd3d0667527d633 100644 --- a/ModuleUVSQsatTelemetry/src/main/java/org/josast/uvsqsat/pojogenerated/obcHk.java +++ b/ModuleUVSQsatTelemetry/src/main/java/org/josast/uvsqsat/pojogenerated/obcHk.java @@ -5,203 +5,385 @@ package org.josast.uvsqsat.pojogenerated; import org.josast.uvsqsat.generated.Uvsqsat.ObcHk; -public class obcHk extends AFrame { +public class obcHk extends AFrame { - private String separator=" \r\n" ; -/** - data raw Declaration **/ - private int dummy; - private int spiCommandStatus; - private int supervisorEnableStatus; - private long supervisorUptime; - private long iobcUptime; - private long iobcResetCount; - private int iobcMeasureTemperature; - private int iobcMeasure3v3In; - private int iobcMeasure3v3; - private int iobcMeasure2vReference; - private int iobcMeasure1v8; - private int iobcMeasure1v0; - private int iobcMeasureCurrent3v3; - private int iobcMeasureCurrent1v8; - private int iobcMeasureCurrent1v0; - private int iobcMeasureVoltRtc; - private int iobcAdcUpdateFlag; - private int iobcCrc8; - private int photodiode1; - private int photodiode2; - private int photodiode3; - private int photodiode4; - private int photodiode5; - private int photodiode6; - private long panelTemperature1; - private long panelTemperature2; - private long panelTemperature3; - private long panelTemperature4; - private long panelTemperature5; - private long panelTemperature6; -/** - Instance Declaration **/ - private long compdummyRaw; - private long compspiCommandStatusRaw; - private long compsupervisorEnableStatusRaw; - private long compsupervisorUptimeRaw; - private long compiobcUptimeRaw; - private long compiobcResetCountRaw; - private long compiobcMeasureTemperatureRaw; - private long compiobcMeasure3v3InRaw; - private long compiobcMeasure3v3Raw; - private long compiobcMeasure2vReferenceRaw; - private long compiobcMeasure1v8Raw; - private long compiobcMeasure1v0Raw; - private long compiobcMeasureCurrent3v3Raw; - private long compiobcMeasureCurrent1v8Raw; - private long compiobcMeasureCurrent1v0Raw; - private long compiobcMeasureVoltRtcRaw; - private long compiobcAdcUpdateFlagRaw; - private long compiobcCrc8Raw; - private long compphotodiode1Raw; - private long compphotodiode2Raw; - private long compphotodiode3Raw; - private long compphotodiode4Raw; - private long compphotodiode5Raw; - private long compphotodiode6Raw; - private double comppanelTemperature1C; - private double comppanelTemperature2C; - private double comppanelTemperature3C; - private double comppanelTemperature4C; - private double comppanelTemperature5C; - private double comppanelTemperature6C; - public obcHk(ObcHk o) { + private String separator = " \r\n"; + /** - data raw Declaration * */ + private int dummy; - dummy = o.dummy(); - spiCommandStatus = o.spiCommandStatus(); - supervisorEnableStatus = o.supervisorEnableStatus(); - supervisorUptime = o.supervisorUptime(); - iobcUptime = o.iobcUptime(); - iobcResetCount = o.iobcResetCount(); - iobcMeasureTemperature = o.iobcMeasureTemperature(); - iobcMeasure3v3In = o.iobcMeasure3v3In(); - iobcMeasure3v3 = o.iobcMeasure3v3(); - iobcMeasure2vReference = o.iobcMeasure2vReference(); - iobcMeasure1v8 = o.iobcMeasure1v8(); - iobcMeasure1v0 = o.iobcMeasure1v0(); - iobcMeasureCurrent3v3 = o.iobcMeasureCurrent3v3(); - iobcMeasureCurrent1v8 = o.iobcMeasureCurrent1v8(); - iobcMeasureCurrent1v0 = o.iobcMeasureCurrent1v0(); - iobcMeasureVoltRtc = o.iobcMeasureVoltRtc(); - iobcAdcUpdateFlag = o.iobcAdcUpdateFlag(); - iobcCrc8 = o.iobcCrc8(); - photodiode1 = o.photodiode1(); - photodiode2 = o.photodiode2(); - photodiode3 = o.photodiode3(); - photodiode4 = o.photodiode4(); - photodiode5 = o.photodiode5(); - photodiode6 = o.photodiode6(); - panelTemperature1 = o.panelTemperature1(); - panelTemperature2 = o.panelTemperature2(); - panelTemperature3 = o.panelTemperature3(); - panelTemperature4 = o.panelTemperature4(); - panelTemperature5 = o.panelTemperature5(); - panelTemperature6 = o.panelTemperature6(); - compdummyRaw = o.dummyRaw(); - compspiCommandStatusRaw = o.spiCommandStatusRaw(); - compsupervisorEnableStatusRaw = o.supervisorEnableStatusRaw(); - compsupervisorUptimeRaw = o.supervisorUptimeRaw(); - compiobcUptimeRaw = o.iobcUptimeRaw(); - compiobcResetCountRaw = o.iobcResetCountRaw(); - compiobcMeasureTemperatureRaw = o.iobcMeasureTemperatureRaw(); - compiobcMeasure3v3InRaw = o.iobcMeasure3v3InRaw(); - compiobcMeasure3v3Raw = o.iobcMeasure3v3Raw(); - compiobcMeasure2vReferenceRaw = o.iobcMeasure2vReferenceRaw(); - compiobcMeasure1v8Raw = o.iobcMeasure1v8Raw(); - compiobcMeasure1v0Raw = o.iobcMeasure1v0Raw(); - compiobcMeasureCurrent3v3Raw = o.iobcMeasureCurrent3v3Raw(); - compiobcMeasureCurrent1v8Raw = o.iobcMeasureCurrent1v8Raw(); - compiobcMeasureCurrent1v0Raw = o.iobcMeasureCurrent1v0Raw(); - compiobcMeasureVoltRtcRaw = o.iobcMeasureVoltRtcRaw(); - compiobcAdcUpdateFlagRaw = o.iobcAdcUpdateFlagRaw(); - compiobcCrc8Raw = o.iobcCrc8Raw(); - compphotodiode1Raw = o.photodiode1Raw(); - compphotodiode2Raw = o.photodiode2Raw(); - compphotodiode3Raw = o.photodiode3Raw(); - compphotodiode4Raw = o.photodiode4Raw(); - compphotodiode5Raw = o.photodiode5Raw(); - compphotodiode6Raw = o.photodiode6Raw(); - comppanelTemperature1C = o.panelTemperature1C(); - comppanelTemperature2C = o.panelTemperature2C(); - comppanelTemperature3C = o.panelTemperature3C(); - comppanelTemperature4C = o.panelTemperature4C(); - comppanelTemperature5C = o.panelTemperature5C(); - comppanelTemperature6C = o.panelTemperature6C(); - } + private int spiCommandStatus; + private int supervisorEnableStatus; + private long supervisorUptime; + private long iobcUptime; + private long iobcResetCount; + private int iobcMeasureTemperature; + private int iobcMeasure3v3In; + private int iobcMeasure3v3; + private int iobcMeasure2vReference; + private int iobcMeasure1v8; + private int iobcMeasure1v0; + private int iobcMeasureCurrent3v3; + private int iobcMeasureCurrent1v8; + private int iobcMeasureCurrent1v0; + private int iobcMeasureVoltRtc; + private int iobcAdcUpdateFlag; + private int iobcCrc8; + private int photodiode1; + private int photodiode2; + private int photodiode3; + private int photodiode4; + private int photodiode5; + private int photodiode6; + private long panelTemperature1; + private long panelTemperature2; + private long panelTemperature3; + private long panelTemperature4; + private long panelTemperature5; + private long panelTemperature6; + /** - Instance Declaration * */ + private long compdummyRaw; - public String toStringRaw () { - - return " " - + separator + "dummy : " +dummy - + separator + "spiCommandStatus : " +spiCommandStatus - + separator + "supervisorEnableStatus : " +supervisorEnableStatus - + separator + "supervisorUptime : " +supervisorUptime - + separator + "iobcUptime : " +iobcUptime - + separator + "iobcResetCount : " +iobcResetCount - + separator + "iobcMeasureTemperature : " +iobcMeasureTemperature - + separator + "iobcMeasure3v3In : " +iobcMeasure3v3In - + separator + "iobcMeasure3v3 : " +iobcMeasure3v3 - + separator + "iobcMeasure2vReference : " +iobcMeasure2vReference - + separator + "iobcMeasure1v8 : " +iobcMeasure1v8 - + separator + "iobcMeasure1v0 : " +iobcMeasure1v0 - + separator + "iobcMeasureCurrent3v3 : " +iobcMeasureCurrent3v3 - + separator + "iobcMeasureCurrent1v8 : " +iobcMeasureCurrent1v8 - + separator + "iobcMeasureCurrent1v0 : " +iobcMeasureCurrent1v0 - + separator + "iobcMeasureVoltRtc : " +iobcMeasureVoltRtc - + separator + "iobcAdcUpdateFlag : " +iobcAdcUpdateFlag - + separator + "iobcCrc8 : " +iobcCrc8 - + separator + "photodiode1 : " +photodiode1 - + separator + "photodiode2 : " +photodiode2 - + separator + "photodiode3 : " +photodiode3 - + separator + "photodiode4 : " +photodiode4 - + separator + "photodiode5 : " +photodiode5 - + separator + "photodiode6 : " +photodiode6 - + separator + "panelTemperature1 : " +panelTemperature1 - + separator + "panelTemperature2 : " +panelTemperature2 - + separator + "panelTemperature3 : " +panelTemperature3 - + separator + "panelTemperature4 : " +panelTemperature4 - + separator + "panelTemperature5 : " +panelTemperature5 - + separator + "panelTemperature6 : " +panelTemperature6 -; } + private long compspiCommandStatusRaw; + private long compsupervisorEnableStatusRaw; + private long compsupervisorUptimeRaw; + private long compiobcUptimeRaw; + private long compiobcResetCountRaw; + private long compiobcMeasureTemperatureRaw; + private long compiobcMeasure3v3InRaw; + private long compiobcMeasure3v3Raw; + private long compiobcMeasure2vReferenceRaw; + private long compiobcMeasure1v8Raw; + private long compiobcMeasure1v0Raw; + private long compiobcMeasureCurrent3v3Raw; + private long compiobcMeasureCurrent1v8Raw; + private long compiobcMeasureCurrent1v0Raw; + private long compiobcMeasureVoltRtcRaw; + private long compiobcAdcUpdateFlagRaw; + private long compiobcCrc8Raw; + private long compphotodiode1Raw; + private long compphotodiode2Raw; + private long compphotodiode3Raw; + private long compphotodiode4Raw; + private long compphotodiode5Raw; + private long compphotodiode6Raw; + private double comppanelTemperature1C; + private double comppanelTemperature2C; + private double comppanelTemperature3C; + private double comppanelTemperature4C; + private double comppanelTemperature5C; + private double comppanelTemperature6C; - public String toStringCompute () { - - return " " - + separator + "dummy : Ox" + toHex(dummy) + " : " + compdummyRaw - + separator + "spi command status : Ox" + toHex(spiCommandStatus) + " : " + compspiCommandStatusRaw - + separator + "supervisor enable status : Ox" + toHex(supervisorEnableStatus) + " : " + compsupervisorEnableStatusRaw - + separator + "supervisor uptime : Ox" + toHex(supervisorUptime) + " : " + compsupervisorUptimeRaw - + separator + "iobc uptime : Ox" + toHex(iobcUptime) + " : " + compiobcUptimeRaw - + separator + "iobc reset count : Ox" + toHex(iobcResetCount) + " : " + compiobcResetCountRaw - + separator + "iobc measure temperature : Ox" + toHex(iobcMeasureTemperature) + " : " + compiobcMeasureTemperatureRaw - + separator + "iobc measure 3v3 in : Ox" + toHex(iobcMeasure3v3In) + " : " + compiobcMeasure3v3InRaw - + separator + "iobc measure 3v3 : Ox" + toHex(iobcMeasure3v3) + " : " + compiobcMeasure3v3Raw - + separator + "iobc measure 2v reference : Ox" + toHex(iobcMeasure2vReference) + " : " + compiobcMeasure2vReferenceRaw - + separator + "iobc measure 1v8 : Ox" + toHex(iobcMeasure1v8) + " : " + compiobcMeasure1v8Raw - + separator + "iobc measure 1v0 : Ox" + toHex(iobcMeasure1v0) + " : " + compiobcMeasure1v0Raw - + separator + "iobc measure current 3v3 : Ox" + toHex(iobcMeasureCurrent3v3) + " : " + compiobcMeasureCurrent3v3Raw - + separator + "iobc measure current 1v8 : Ox" + toHex(iobcMeasureCurrent1v8) + " : " + compiobcMeasureCurrent1v8Raw - + separator + "iobc measure current 1v0 : Ox" + toHex(iobcMeasureCurrent1v0) + " : " + compiobcMeasureCurrent1v0Raw - + separator + "iobc measure volt rtc : Ox" + toHex(iobcMeasureVoltRtc) + " : " + compiobcMeasureVoltRtcRaw - + separator + "iobc adc update flag : Ox" + toHex(iobcAdcUpdateFlag) + " : " + compiobcAdcUpdateFlagRaw - + separator + "iobc crc8 : Ox" + toHex(iobcCrc8) + " : " + compiobcCrc8Raw - + separator + "photodiode1 : Ox" + toHex(photodiode1) + " : " + compphotodiode1Raw - + separator + "photodiode2 : Ox" + toHex(photodiode2) + " : " + compphotodiode2Raw - + separator + "photodiode3 : Ox" + toHex(photodiode3) + " : " + compphotodiode3Raw - + separator + "photodiode4 : Ox" + toHex(photodiode4) + " : " + compphotodiode4Raw - + separator + "photodiode5 : Ox" + toHex(photodiode5) + " : " + compphotodiode5Raw - + separator + "photodiode6 : Ox" + toHex(photodiode6) + " : " + compphotodiode6Raw - + separator + "panel temperature 1 (°C) : Ox" + toHex(panelTemperature1) + " : "+ String.format("%.3f", + comppanelTemperature1C) - + separator + "panel temperature 2 (°C) : Ox" + toHex(panelTemperature2) + " : "+ String.format("%.3f", + comppanelTemperature2C) - + separator + "panel temperature 3 (°C) : Ox" + toHex(panelTemperature3) + " : "+ String.format("%.3f", + comppanelTemperature3C) - + separator + "panel temperature 4 (°C) : Ox" + toHex(panelTemperature4) + " : "+ String.format("%.3f", + comppanelTemperature4C) - + separator + "panel temperature 5 (°C) : Ox" + toHex(panelTemperature5) + " : "+ String.format("%.3f", + comppanelTemperature5C) - + separator + "panel temperature 6 (°C) : Ox" + toHex(panelTemperature6) + " : "+ String.format("%.3f", + comppanelTemperature6C) -; } + public obcHk(ObcHk o) { + dummy = o.dummy(); + spiCommandStatus = o.spiCommandStatus(); + supervisorEnableStatus = o.supervisorEnableStatus(); + supervisorUptime = o.supervisorUptime(); + iobcUptime = o.iobcUptime(); + iobcResetCount = o.iobcResetCount(); + iobcMeasureTemperature = o.iobcMeasureTemperature(); + iobcMeasure3v3In = o.iobcMeasure3v3In(); + iobcMeasure3v3 = o.iobcMeasure3v3(); + iobcMeasure2vReference = o.iobcMeasure2vReference(); + iobcMeasure1v8 = o.iobcMeasure1v8(); + iobcMeasure1v0 = o.iobcMeasure1v0(); + iobcMeasureCurrent3v3 = o.iobcMeasureCurrent3v3(); + iobcMeasureCurrent1v8 = o.iobcMeasureCurrent1v8(); + iobcMeasureCurrent1v0 = o.iobcMeasureCurrent1v0(); + iobcMeasureVoltRtc = o.iobcMeasureVoltRtc(); + iobcAdcUpdateFlag = o.iobcAdcUpdateFlag(); + iobcCrc8 = o.iobcCrc8(); + photodiode1 = o.photodiode1(); + photodiode2 = o.photodiode2(); + photodiode3 = o.photodiode3(); + photodiode4 = o.photodiode4(); + photodiode5 = o.photodiode5(); + photodiode6 = o.photodiode6(); + panelTemperature1 = o.panelTemperature1(); + panelTemperature2 = o.panelTemperature2(); + panelTemperature3 = o.panelTemperature3(); + panelTemperature4 = o.panelTemperature4(); + panelTemperature5 = o.panelTemperature5(); + panelTemperature6 = o.panelTemperature6(); + compdummyRaw = o.dummyRaw(); + compspiCommandStatusRaw = o.spiCommandStatusRaw(); + compsupervisorEnableStatusRaw = o.supervisorEnableStatusRaw(); + compsupervisorUptimeRaw = o.supervisorUptimeRaw(); + compiobcUptimeRaw = o.iobcUptimeRaw(); + compiobcResetCountRaw = o.iobcResetCountRaw(); + compiobcMeasureTemperatureRaw = o.iobcMeasureTemperatureRaw(); + compiobcMeasure3v3InRaw = o.iobcMeasure3v3InRaw(); + compiobcMeasure3v3Raw = o.iobcMeasure3v3Raw(); + compiobcMeasure2vReferenceRaw = o.iobcMeasure2vReferenceRaw(); + compiobcMeasure1v8Raw = o.iobcMeasure1v8Raw(); + compiobcMeasure1v0Raw = o.iobcMeasure1v0Raw(); + compiobcMeasureCurrent3v3Raw = o.iobcMeasureCurrent3v3Raw(); + compiobcMeasureCurrent1v8Raw = o.iobcMeasureCurrent1v8Raw(); + compiobcMeasureCurrent1v0Raw = o.iobcMeasureCurrent1v0Raw(); + compiobcMeasureVoltRtcRaw = o.iobcMeasureVoltRtcRaw(); + compiobcAdcUpdateFlagRaw = o.iobcAdcUpdateFlagRaw(); + compiobcCrc8Raw = o.iobcCrc8Raw(); + compphotodiode1Raw = o.photodiode1Raw(); + compphotodiode2Raw = o.photodiode2Raw(); + compphotodiode3Raw = o.photodiode3Raw(); + compphotodiode4Raw = o.photodiode4Raw(); + compphotodiode5Raw = o.photodiode5Raw(); + compphotodiode6Raw = o.photodiode6Raw(); + comppanelTemperature1C = o.panelTemperature1C(); + comppanelTemperature2C = o.panelTemperature2C(); + comppanelTemperature3C = o.panelTemperature3C(); + comppanelTemperature4C = o.panelTemperature4C(); + comppanelTemperature5C = o.panelTemperature5C(); + comppanelTemperature6C = o.panelTemperature6C(); + } + + public String toStringRaw() { + + return " " + + separator + + "dummy : " + + dummy + + separator + + "spiCommandStatus : " + + spiCommandStatus + + separator + + "supervisorEnableStatus : " + + supervisorEnableStatus + + separator + + "supervisorUptime : " + + supervisorUptime + + separator + + "iobcUptime : " + + iobcUptime + + separator + + "iobcResetCount : " + + iobcResetCount + + separator + + "iobcMeasureTemperature : " + + iobcMeasureTemperature + + separator + + "iobcMeasure3v3In : " + + iobcMeasure3v3In + + separator + + "iobcMeasure3v3 : " + + iobcMeasure3v3 + + separator + + "iobcMeasure2vReference : " + + iobcMeasure2vReference + + separator + + "iobcMeasure1v8 : " + + iobcMeasure1v8 + + separator + + "iobcMeasure1v0 : " + + iobcMeasure1v0 + + separator + + "iobcMeasureCurrent3v3 : " + + iobcMeasureCurrent3v3 + + separator + + "iobcMeasureCurrent1v8 : " + + iobcMeasureCurrent1v8 + + separator + + "iobcMeasureCurrent1v0 : " + + iobcMeasureCurrent1v0 + + separator + + "iobcMeasureVoltRtc : " + + iobcMeasureVoltRtc + + separator + + "iobcAdcUpdateFlag : " + + iobcAdcUpdateFlag + + separator + + "iobcCrc8 : " + + iobcCrc8 + + separator + + "photodiode1 : " + + photodiode1 + + separator + + "photodiode2 : " + + photodiode2 + + separator + + "photodiode3 : " + + photodiode3 + + separator + + "photodiode4 : " + + photodiode4 + + separator + + "photodiode5 : " + + photodiode5 + + separator + + "photodiode6 : " + + photodiode6 + + separator + + "panelTemperature1 : " + + panelTemperature1 + + separator + + "panelTemperature2 : " + + panelTemperature2 + + separator + + "panelTemperature3 : " + + panelTemperature3 + + separator + + "panelTemperature4 : " + + panelTemperature4 + + separator + + "panelTemperature5 : " + + panelTemperature5 + + separator + + "panelTemperature6 : " + + panelTemperature6; + } + + public String toStringCompute() { + + return " " + + separator + + "dummy : Ox" + + toHex(dummy) + + " : " + + compdummyRaw + + separator + + "spi command status : Ox" + + toHex(spiCommandStatus) + + " : " + + compspiCommandStatusRaw + + separator + + "supervisor enable status : Ox" + + toHex(supervisorEnableStatus) + + " : " + + compsupervisorEnableStatusRaw + + separator + + "supervisor uptime : Ox" + + toHex(supervisorUptime) + + " : " + + compsupervisorUptimeRaw + + separator + + "iobc uptime : Ox" + + toHex(iobcUptime) + + " : " + + compiobcUptimeRaw + + separator + + "iobc reset count : Ox" + + toHex(iobcResetCount) + + " : " + + compiobcResetCountRaw + + separator + + "iobc measure temperature : Ox" + + toHex(iobcMeasureTemperature) + + " : " + + compiobcMeasureTemperatureRaw + + separator + + "iobc measure 3v3 in : Ox" + + toHex(iobcMeasure3v3In) + + " : " + + compiobcMeasure3v3InRaw + + separator + + "iobc measure 3v3 : Ox" + + toHex(iobcMeasure3v3) + + " : " + + compiobcMeasure3v3Raw + + separator + + "iobc measure 2v reference : Ox" + + toHex(iobcMeasure2vReference) + + " : " + + compiobcMeasure2vReferenceRaw + + separator + + "iobc measure 1v8 : Ox" + + toHex(iobcMeasure1v8) + + " : " + + compiobcMeasure1v8Raw + + separator + + "iobc measure 1v0 : Ox" + + toHex(iobcMeasure1v0) + + " : " + + compiobcMeasure1v0Raw + + separator + + "iobc measure current 3v3 : Ox" + + toHex(iobcMeasureCurrent3v3) + + " : " + + compiobcMeasureCurrent3v3Raw + + separator + + "iobc measure current 1v8 : Ox" + + toHex(iobcMeasureCurrent1v8) + + " : " + + compiobcMeasureCurrent1v8Raw + + separator + + "iobc measure current 1v0 : Ox" + + toHex(iobcMeasureCurrent1v0) + + " : " + + compiobcMeasureCurrent1v0Raw + + separator + + "iobc measure volt rtc : Ox" + + toHex(iobcMeasureVoltRtc) + + " : " + + compiobcMeasureVoltRtcRaw + + separator + + "iobc adc update flag : Ox" + + toHex(iobcAdcUpdateFlag) + + " : " + + compiobcAdcUpdateFlagRaw + + separator + + "iobc crc8 : Ox" + + toHex(iobcCrc8) + + " : " + + compiobcCrc8Raw + + separator + + "photodiode1 : Ox" + + toHex(photodiode1) + + " : " + + compphotodiode1Raw + + separator + + "photodiode2 : Ox" + + toHex(photodiode2) + + " : " + + compphotodiode2Raw + + separator + + "photodiode3 : Ox" + + toHex(photodiode3) + + " : " + + compphotodiode3Raw + + separator + + "photodiode4 : Ox" + + toHex(photodiode4) + + " : " + + compphotodiode4Raw + + separator + + "photodiode5 : Ox" + + toHex(photodiode5) + + " : " + + compphotodiode5Raw + + separator + + "photodiode6 : Ox" + + toHex(photodiode6) + + " : " + + compphotodiode6Raw + + separator + + "panel temperature 1 (°C) : Ox" + + toHex(panelTemperature1) + + " : " + + String.format("%.3f", +comppanelTemperature1C) + + separator + + "panel temperature 2 (°C) : Ox" + + toHex(panelTemperature2) + + " : " + + String.format("%.3f", +comppanelTemperature2C) + + separator + + "panel temperature 3 (°C) : Ox" + + toHex(panelTemperature3) + + " : " + + String.format("%.3f", +comppanelTemperature3C) + + separator + + "panel temperature 4 (°C) : Ox" + + toHex(panelTemperature4) + + " : " + + String.format("%.3f", +comppanelTemperature4C) + + separator + + "panel temperature 5 (°C) : Ox" + + toHex(panelTemperature5) + + " : " + + String.format("%.3f", +comppanelTemperature5C) + + separator + + "panel temperature 6 (°C) : Ox" + + toHex(panelTemperature6) + + " : " + + String.format("%.3f", +comppanelTemperature6C); + } } diff --git a/ModuleUVSQsatTelemetry/src/main/java/org/josast/uvsqsat/pojogenerated/obcStatus.java b/ModuleUVSQsatTelemetry/src/main/java/org/josast/uvsqsat/pojogenerated/obcStatus.java index 884190eaf01e0a9022c6846bbf07cf760e77f189..95c1b41260c280c1b0a5b2fc2b104282245d7200 100644 --- a/ModuleUVSQsatTelemetry/src/main/java/org/josast/uvsqsat/pojogenerated/obcStatus.java +++ b/ModuleUVSQsatTelemetry/src/main/java/org/josast/uvsqsat/pojogenerated/obcStatus.java @@ -5,179 +5,337 @@ package org.josast.uvsqsat.pojogenerated; import org.josast.uvsqsat.generated.Uvsqsat.ObcStatus; -public class obcStatus extends AFrame { +public class obcStatus extends AFrame { - private String separator=" \r\n" ; -/** - data raw Declaration **/ - private int dummy; - private int spiCommandStatus; - private int supervisorIndexOfSubsystem; - private int supervisorMajorVersion; - private int supervisorMinorVersion; - private int supervisorPatchVersion; - private long supervisorGitHeadVersion; - private int supervisorSerialNumber; - private byte[] compilationInformation; - private int clockSpeed; - private int codeType; - private int crc8; - private int swMmode; - private int lastResetReason; - private int reserved; - private int nbReset; - private int reserved2; - private int deployAntennasSystem; - private long nbTmSinceFirstStart; - private long nbTcSinceFirstStart; - private long nbBadTcSinceFirstStart; - private long nbTmInSdcard; - private int sdcardStatus; - private long sdcardLastError; - private long oldTimeTMInSdcard; - private long newTimeTMInSdcard; -/** - Instance Declaration **/ - private double compdummydummy; - private long compspiCommandStatusRaw; - private long compsupervisorIndexOfSubsystemRaw; - private long compsupervisorMajorVersionRaw; - private long compsupervisorMinorVersionRaw; - private long compsupervisorPatchVersionRaw; - private long compsupervisorGitHeadVersionRaw; - private long compsupervisorSerialNumberRaw; - private byte [] compcompilationInformationByte; - private long compclockSpeedRaw; - private long compcodeTypeRaw; - private long compcrc8Raw; - private long compswMmodeRaw; - private long complastResetReasonRaw; - private long compreservedRaw; - private long compnbResetRaw; - private long compreserved2Raw; - private long compdeployAntennasSystemRaw; - private long compnbTmSinceFirstStartRaw; - private long compnbTcSinceFirstStartRaw; - private long compnbBadTcSinceFirstStartRaw; - private long compnbTmInSdcardRaw; - private long compsdcardStatusRaw; - private long compsdcardLastErrorRaw; - private long compoldTimeTMInSdcardRaw; - private long compnewTimeTMInSdcardRaw; - public obcStatus(ObcStatus o) { + private String separator = " \r\n"; + /** - data raw Declaration * */ + private int dummy; - dummy = o.dummy(); - spiCommandStatus = o.spiCommandStatus(); - supervisorIndexOfSubsystem = o.supervisorIndexOfSubsystem(); - supervisorMajorVersion = o.supervisorMajorVersion(); - supervisorMinorVersion = o.supervisorMinorVersion(); - supervisorPatchVersion = o.supervisorPatchVersion(); - supervisorGitHeadVersion = o.supervisorGitHeadVersion(); - supervisorSerialNumber = o.supervisorSerialNumber(); - compilationInformation = o.compilationInformation(); - clockSpeed = o.clockSpeed(); - codeType = o.codeType(); - crc8 = o.crc8(); - swMmode = o.swMmode(); - lastResetReason = o.lastResetReason(); - reserved = o.reserved(); - nbReset = o.nbReset(); - reserved2 = o.reserved2(); - deployAntennasSystem = o.deployAntennasSystem(); - nbTmSinceFirstStart = o.nbTmSinceFirstStart(); - nbTcSinceFirstStart = o.nbTcSinceFirstStart(); - nbBadTcSinceFirstStart = o.nbBadTcSinceFirstStart(); - nbTmInSdcard = o.nbTmInSdcard(); - sdcardStatus = o.sdcardStatus(); - sdcardLastError = o.sdcardLastError(); - oldTimeTMInSdcard = o.oldTimeTMInSdcard(); - newTimeTMInSdcard = o.newTimeTMInSdcard(); - compdummydummy = o.dummydummy(); - compspiCommandStatusRaw = o.spiCommandStatusRaw(); - compsupervisorIndexOfSubsystemRaw = o.supervisorIndexOfSubsystemRaw(); - compsupervisorMajorVersionRaw = o.supervisorMajorVersionRaw(); - compsupervisorMinorVersionRaw = o.supervisorMinorVersionRaw(); - compsupervisorPatchVersionRaw = o.supervisorPatchVersionRaw(); - compsupervisorGitHeadVersionRaw = o.supervisorGitHeadVersionRaw(); - compsupervisorSerialNumberRaw = o.supervisorSerialNumberRaw(); - compcompilationInformationByte = o.compilationInformationByte(); - compclockSpeedRaw = o.clockSpeedRaw(); - compcodeTypeRaw = o.codeTypeRaw(); - compcrc8Raw = o.crc8Raw(); - compswMmodeRaw = o.swMmodeRaw(); - complastResetReasonRaw = o.lastResetReasonRaw(); - compreservedRaw = o.reservedRaw(); - compnbResetRaw = o.nbResetRaw(); - compreserved2Raw = o.reserved2Raw(); - compdeployAntennasSystemRaw = o.deployAntennasSystemRaw(); - compnbTmSinceFirstStartRaw = o.nbTmSinceFirstStartRaw(); - compnbTcSinceFirstStartRaw = o.nbTcSinceFirstStartRaw(); - compnbBadTcSinceFirstStartRaw = o.nbBadTcSinceFirstStartRaw(); - compnbTmInSdcardRaw = o.nbTmInSdcardRaw(); - compsdcardStatusRaw = o.sdcardStatusRaw(); - compsdcardLastErrorRaw = o.sdcardLastErrorRaw(); - compoldTimeTMInSdcardRaw = o.oldTimeTMInSdcardRaw(); - compnewTimeTMInSdcardRaw = o.newTimeTMInSdcardRaw(); - } + private int spiCommandStatus; + private int supervisorIndexOfSubsystem; + private int supervisorMajorVersion; + private int supervisorMinorVersion; + private int supervisorPatchVersion; + private long supervisorGitHeadVersion; + private int supervisorSerialNumber; + private byte[] compilationInformation; + private int clockSpeed; + private int codeType; + private int crc8; + private int swMmode; + private int lastResetReason; + private int reserved; + private int nbReset; + private int reserved2; + private int deployAntennasSystem; + private long nbTmSinceFirstStart; + private long nbTcSinceFirstStart; + private long nbBadTcSinceFirstStart; + private long nbTmInSdcard; + private int sdcardStatus; + private long sdcardLastError; + private long oldTimeTMInSdcard; + private long newTimeTMInSdcard; + /** - Instance Declaration * */ + private double compdummydummy; - public String toStringRaw () { - - return " " - + separator + "dummy : " +dummy - + separator + "spiCommandStatus : " +spiCommandStatus - + separator + "supervisorIndexOfSubsystem : " +supervisorIndexOfSubsystem - + separator + "supervisorMajorVersion : " +supervisorMajorVersion - + separator + "supervisorMinorVersion : " +supervisorMinorVersion - + separator + "supervisorPatchVersion : " +supervisorPatchVersion - + separator + "supervisorGitHeadVersion : " +supervisorGitHeadVersion - + separator + "supervisorSerialNumber : " +supervisorSerialNumber - + separator + "compilationInformation : " +compilationInformation - + separator + "clockSpeed : " +clockSpeed - + separator + "codeType : " +codeType - + separator + "crc8 : " +crc8 - + separator + "swMmode : " +swMmode - + separator + "lastResetReason : " +lastResetReason - + separator + "reserved : " +reserved - + separator + "nbReset : " +nbReset - + separator + "reserved2 : " +reserved2 - + separator + "deployAntennasSystem : " +deployAntennasSystem - + separator + "nbTmSinceFirstStart : " +nbTmSinceFirstStart - + separator + "nbTcSinceFirstStart : " +nbTcSinceFirstStart - + separator + "nbBadTcSinceFirstStart : " +nbBadTcSinceFirstStart - + separator + "nbTmInSdcard : " +nbTmInSdcard - + separator + "sdcardStatus : " +sdcardStatus - + separator + "sdcardLastError : " +sdcardLastError - + separator + "oldTimeTMInSdcard : " +oldTimeTMInSdcard - + separator + "newTimeTMInSdcard : " +newTimeTMInSdcard -; } + private long compspiCommandStatusRaw; + private long compsupervisorIndexOfSubsystemRaw; + private long compsupervisorMajorVersionRaw; + private long compsupervisorMinorVersionRaw; + private long compsupervisorPatchVersionRaw; + private long compsupervisorGitHeadVersionRaw; + private long compsupervisorSerialNumberRaw; + private byte[] compcompilationInformationByte; + private long compclockSpeedRaw; + private long compcodeTypeRaw; + private long compcrc8Raw; + private long compswMmodeRaw; + private long complastResetReasonRaw; + private long compreservedRaw; + private long compnbResetRaw; + private long compreserved2Raw; + private long compdeployAntennasSystemRaw; + private long compnbTmSinceFirstStartRaw; + private long compnbTcSinceFirstStartRaw; + private long compnbBadTcSinceFirstStartRaw; + private long compnbTmInSdcardRaw; + private long compsdcardStatusRaw; + private long compsdcardLastErrorRaw; + private long compoldTimeTMInSdcardRaw; + private long compnewTimeTMInSdcardRaw; - public String toStringCompute () { - - return " " - + separator + "dummydummy : Ox" + toHex(dummy) + " : "+ String.format("%.3f", + compdummydummy) - + separator + "spi command status : Ox" + toHex(spiCommandStatus) + " : " + compspiCommandStatusRaw - + separator + "supervisor index of subsystem : Ox" + toHex(supervisorIndexOfSubsystem) + " : " + compsupervisorIndexOfSubsystemRaw - + separator + "supervisor major version : Ox" + toHex(supervisorMajorVersion) + " : " + compsupervisorMajorVersionRaw - + separator + "supervisor minor version : Ox" + toHex(supervisorMinorVersion) + " : " + compsupervisorMinorVersionRaw - + separator + "supervisor patch version : Ox" + toHex(supervisorPatchVersion) + " : " + compsupervisorPatchVersionRaw - + separator + "supervisor git head version : Ox" + toHex(supervisorGitHeadVersion) + " : " + compsupervisorGitHeadVersionRaw - + separator + "supervisor serial number : Ox" + toHex(supervisorSerialNumber) + " : " + compsupervisorSerialNumberRaw - + separator + "compilation information byte : Ox" + toHex(compilationInformation) + " : " + compcompilationInformationByte - + separator + "clock speed : Ox" + toHex(clockSpeed) + " : " + compclockSpeedRaw - + separator + "code type : Ox" + toHex(codeType) + " : " + compcodeTypeRaw - + separator + "crc 8 : Ox" + toHex(crc8) + " : " + compcrc8Raw - + separator + "sw mmode : Ox" + toHex(swMmode) + " : " + compswMmodeRaw - + separator + "last reset reason : Ox" + toHex(lastResetReason) + " : " + complastResetReasonRaw - + separator + "reserved : Ox" + toHex(reserved) + " : " + compreservedRaw - + separator + "nb reset : Ox" + toHex(nbReset) + " : " + compnbResetRaw - + separator + "reserved2 : Ox" + toHex(reserved2) + " : " + compreserved2Raw - + separator + "deploy antennas system : Ox" + toHex(deployAntennasSystem) + " : " + compdeployAntennasSystemRaw - + separator + "nb tm since first start : Ox" + toHex(nbTmSinceFirstStart) + " : " + compnbTmSinceFirstStartRaw - + separator + "nb tc since first start : Ox" + toHex(nbTcSinceFirstStart) + " : " + compnbTcSinceFirstStartRaw - + separator + "nb bad tc since first start : Ox" + toHex(nbBadTcSinceFirstStart) + " : " + compnbBadTcSinceFirstStartRaw - + separator + "nb tm in sdcard : Ox" + toHex(nbTmInSdcard) + " : " + compnbTmInSdcardRaw - + separator + "sdcard status : Ox" + toHex(sdcardStatus) + " : " + compsdcardStatusRaw - + separator + "sdcard last error : Ox" + toHex(sdcardLastError) + " : " + compsdcardLastErrorRaw - + separator + "old time t m in sdcard : Ox" + toHex(oldTimeTMInSdcard) + " : " + compoldTimeTMInSdcardRaw - + separator + "new time t m in sdcard : Ox" + toHex(newTimeTMInSdcard) + " : " + compnewTimeTMInSdcardRaw -; } + public obcStatus(ObcStatus o) { + dummy = o.dummy(); + spiCommandStatus = o.spiCommandStatus(); + supervisorIndexOfSubsystem = o.supervisorIndexOfSubsystem(); + supervisorMajorVersion = o.supervisorMajorVersion(); + supervisorMinorVersion = o.supervisorMinorVersion(); + supervisorPatchVersion = o.supervisorPatchVersion(); + supervisorGitHeadVersion = o.supervisorGitHeadVersion(); + supervisorSerialNumber = o.supervisorSerialNumber(); + compilationInformation = o.compilationInformation(); + clockSpeed = o.clockSpeed(); + codeType = o.codeType(); + crc8 = o.crc8(); + swMmode = o.swMmode(); + lastResetReason = o.lastResetReason(); + reserved = o.reserved(); + nbReset = o.nbReset(); + reserved2 = o.reserved2(); + deployAntennasSystem = o.deployAntennasSystem(); + nbTmSinceFirstStart = o.nbTmSinceFirstStart(); + nbTcSinceFirstStart = o.nbTcSinceFirstStart(); + nbBadTcSinceFirstStart = o.nbBadTcSinceFirstStart(); + nbTmInSdcard = o.nbTmInSdcard(); + sdcardStatus = o.sdcardStatus(); + sdcardLastError = o.sdcardLastError(); + oldTimeTMInSdcard = o.oldTimeTMInSdcard(); + newTimeTMInSdcard = o.newTimeTMInSdcard(); + compdummydummy = o.dummydummy(); + compspiCommandStatusRaw = o.spiCommandStatusRaw(); + compsupervisorIndexOfSubsystemRaw = o.supervisorIndexOfSubsystemRaw(); + compsupervisorMajorVersionRaw = o.supervisorMajorVersionRaw(); + compsupervisorMinorVersionRaw = o.supervisorMinorVersionRaw(); + compsupervisorPatchVersionRaw = o.supervisorPatchVersionRaw(); + compsupervisorGitHeadVersionRaw = o.supervisorGitHeadVersionRaw(); + compsupervisorSerialNumberRaw = o.supervisorSerialNumberRaw(); + compcompilationInformationByte = o.compilationInformationByte(); + compclockSpeedRaw = o.clockSpeedRaw(); + compcodeTypeRaw = o.codeTypeRaw(); + compcrc8Raw = o.crc8Raw(); + compswMmodeRaw = o.swMmodeRaw(); + complastResetReasonRaw = o.lastResetReasonRaw(); + compreservedRaw = o.reservedRaw(); + compnbResetRaw = o.nbResetRaw(); + compreserved2Raw = o.reserved2Raw(); + compdeployAntennasSystemRaw = o.deployAntennasSystemRaw(); + compnbTmSinceFirstStartRaw = o.nbTmSinceFirstStartRaw(); + compnbTcSinceFirstStartRaw = o.nbTcSinceFirstStartRaw(); + compnbBadTcSinceFirstStartRaw = o.nbBadTcSinceFirstStartRaw(); + compnbTmInSdcardRaw = o.nbTmInSdcardRaw(); + compsdcardStatusRaw = o.sdcardStatusRaw(); + compsdcardLastErrorRaw = o.sdcardLastErrorRaw(); + compoldTimeTMInSdcardRaw = o.oldTimeTMInSdcardRaw(); + compnewTimeTMInSdcardRaw = o.newTimeTMInSdcardRaw(); + } + + public String toStringRaw() { + + return " " + + separator + + "dummy : " + + dummy + + separator + + "spiCommandStatus : " + + spiCommandStatus + + separator + + "supervisorIndexOfSubsystem : " + + supervisorIndexOfSubsystem + + separator + + "supervisorMajorVersion : " + + supervisorMajorVersion + + separator + + "supervisorMinorVersion : " + + supervisorMinorVersion + + separator + + "supervisorPatchVersion : " + + supervisorPatchVersion + + separator + + "supervisorGitHeadVersion : " + + supervisorGitHeadVersion + + separator + + "supervisorSerialNumber : " + + supervisorSerialNumber + + separator + + "compilationInformation : " + + compilationInformation + + separator + + "clockSpeed : " + + clockSpeed + + separator + + "codeType : " + + codeType + + separator + + "crc8 : " + + crc8 + + separator + + "swMmode : " + + swMmode + + separator + + "lastResetReason : " + + lastResetReason + + separator + + "reserved : " + + reserved + + separator + + "nbReset : " + + nbReset + + separator + + "reserved2 : " + + reserved2 + + separator + + "deployAntennasSystem : " + + deployAntennasSystem + + separator + + "nbTmSinceFirstStart : " + + nbTmSinceFirstStart + + separator + + "nbTcSinceFirstStart : " + + nbTcSinceFirstStart + + separator + + "nbBadTcSinceFirstStart : " + + nbBadTcSinceFirstStart + + separator + + "nbTmInSdcard : " + + nbTmInSdcard + + separator + + "sdcardStatus : " + + sdcardStatus + + separator + + "sdcardLastError : " + + sdcardLastError + + separator + + "oldTimeTMInSdcard : " + + oldTimeTMInSdcard + + separator + + "newTimeTMInSdcard : " + + newTimeTMInSdcard; + } + + public String toStringCompute() { + + return " " + + separator + + "dummydummy : Ox" + + toHex(dummy) + + " : " + + String.format("%.3f", +compdummydummy) + + separator + + "spi command status : Ox" + + toHex(spiCommandStatus) + + " : " + + compspiCommandStatusRaw + + separator + + "supervisor index of subsystem : Ox" + + toHex(supervisorIndexOfSubsystem) + + " : " + + compsupervisorIndexOfSubsystemRaw + + separator + + "supervisor major version : Ox" + + toHex(supervisorMajorVersion) + + " : " + + compsupervisorMajorVersionRaw + + separator + + "supervisor minor version : Ox" + + toHex(supervisorMinorVersion) + + " : " + + compsupervisorMinorVersionRaw + + separator + + "supervisor patch version : Ox" + + toHex(supervisorPatchVersion) + + " : " + + compsupervisorPatchVersionRaw + + separator + + "supervisor git head version : Ox" + + toHex(supervisorGitHeadVersion) + + " : " + + compsupervisorGitHeadVersionRaw + + separator + + "supervisor serial number : Ox" + + toHex(supervisorSerialNumber) + + " : " + + compsupervisorSerialNumberRaw + + separator + + "compilation information byte : Ox" + + toHex(compilationInformation) + + " : " + + compcompilationInformationByte + + separator + + "clock speed : Ox" + + toHex(clockSpeed) + + " : " + + compclockSpeedRaw + + separator + + "code type : Ox" + + toHex(codeType) + + " : " + + compcodeTypeRaw + + separator + + "crc 8 : Ox" + + toHex(crc8) + + " : " + + compcrc8Raw + + separator + + "sw mmode : Ox" + + toHex(swMmode) + + " : " + + compswMmodeRaw + + separator + + "last reset reason : Ox" + + toHex(lastResetReason) + + " : " + + complastResetReasonRaw + + separator + + "reserved : Ox" + + toHex(reserved) + + " : " + + compreservedRaw + + separator + + "nb reset : Ox" + + toHex(nbReset) + + " : " + + compnbResetRaw + + separator + + "reserved2 : Ox" + + toHex(reserved2) + + " : " + + compreserved2Raw + + separator + + "deploy antennas system : Ox" + + toHex(deployAntennasSystem) + + " : " + + compdeployAntennasSystemRaw + + separator + + "nb tm since first start : Ox" + + toHex(nbTmSinceFirstStart) + + " : " + + compnbTmSinceFirstStartRaw + + separator + + "nb tc since first start : Ox" + + toHex(nbTcSinceFirstStart) + + " : " + + compnbTcSinceFirstStartRaw + + separator + + "nb bad tc since first start : Ox" + + toHex(nbBadTcSinceFirstStart) + + " : " + + compnbBadTcSinceFirstStartRaw + + separator + + "nb tm in sdcard : Ox" + + toHex(nbTmInSdcard) + + " : " + + compnbTmInSdcardRaw + + separator + + "sdcard status : Ox" + + toHex(sdcardStatus) + + " : " + + compsdcardStatusRaw + + separator + + "sdcard last error : Ox" + + toHex(sdcardLastError) + + " : " + + compsdcardLastErrorRaw + + separator + + "old time t m in sdcard : Ox" + + toHex(oldTimeTMInSdcard) + + " : " + + compoldTimeTMInSdcardRaw + + separator + + "new time t m in sdcard : Ox" + + toHex(newTimeTMInSdcard) + + " : " + + compnewTimeTMInSdcardRaw; + } } diff --git a/ModuleUVSQsatTelemetry/src/main/java/org/josast/uvsqsat/pojogenerated/packetPrimaryHeader.java b/ModuleUVSQsatTelemetry/src/main/java/org/josast/uvsqsat/pojogenerated/packetPrimaryHeader.java index 180ed8b20408e2ef6ad05c72403cd45deac1c9ab..f1f55c38bc3dedda01e4d88c2525c97c41944e17 100644 --- a/ModuleUVSQsatTelemetry/src/main/java/org/josast/uvsqsat/pojogenerated/packetPrimaryHeader.java +++ b/ModuleUVSQsatTelemetry/src/main/java/org/josast/uvsqsat/pojogenerated/packetPrimaryHeader.java @@ -5,44 +5,58 @@ package org.josast.uvsqsat.pojogenerated; import org.josast.uvsqsat.generated.Uvsqsat.PacketPrimaryHeader; -public class packetPrimaryHeader extends AFrame { - - private String separator=" \r\n" ; -/** - data raw Declaration **/ - private long packetVersionNumber; - private boolean packetIdPacketType; - private boolean packetIdSecondaryHeaderFlag; - private long packetIdApplicationProcessId; - private long packetSequenceControlSecquenceFlag; - private long packetSequenceControlCountOrName; - private int packetDataLength; -/** - Instance Declaration **/ - public packetPrimaryHeader(PacketPrimaryHeader o) { - - packetVersionNumber = o.packetVersionNumber(); - packetIdPacketType = o.packetIdPacketType(); - packetIdSecondaryHeaderFlag = o.packetIdSecondaryHeaderFlag(); - packetIdApplicationProcessId = o.packetIdApplicationProcessId(); - packetSequenceControlSecquenceFlag = o.packetSequenceControlSecquenceFlag(); - packetSequenceControlCountOrName = o.packetSequenceControlCountOrName(); - packetDataLength = o.packetDataLength(); - } - - public String toStringRaw () { - - return " " - + separator + "packetVersionNumber : " +packetVersionNumber - + separator + "packetIdPacketType : " +packetIdPacketType - + separator + "packetIdSecondaryHeaderFlag : " +packetIdSecondaryHeaderFlag - + separator + "packetIdApplicationProcessId : " +packetIdApplicationProcessId - + separator + "packetSequenceControlSecquenceFlag : " +packetSequenceControlSecquenceFlag - + separator + "packetSequenceControlCountOrName : " +packetSequenceControlCountOrName - + separator + "packetDataLength : " +packetDataLength -; } - - public String toStringCompute () { - - return " " -; } - +public class packetPrimaryHeader extends AFrame { + + private String separator = " \r\n"; + /** - data raw Declaration * */ + private long packetVersionNumber; + + private boolean packetIdPacketType; + private boolean packetIdSecondaryHeaderFlag; + private long packetIdApplicationProcessId; + private long packetSequenceControlSecquenceFlag; + private long packetSequenceControlCountOrName; + private int packetDataLength; + /** - Instance Declaration * */ + public packetPrimaryHeader(PacketPrimaryHeader o) { + + packetVersionNumber = o.packetVersionNumber(); + packetIdPacketType = o.packetIdPacketType(); + packetIdSecondaryHeaderFlag = o.packetIdSecondaryHeaderFlag(); + packetIdApplicationProcessId = o.packetIdApplicationProcessId(); + packetSequenceControlSecquenceFlag = o.packetSequenceControlSecquenceFlag(); + packetSequenceControlCountOrName = o.packetSequenceControlCountOrName(); + packetDataLength = o.packetDataLength(); + } + + public String toStringRaw() { + + return " " + + separator + + "packetVersionNumber : " + + packetVersionNumber + + separator + + "packetIdPacketType : " + + packetIdPacketType + + separator + + "packetIdSecondaryHeaderFlag : " + + packetIdSecondaryHeaderFlag + + separator + + "packetIdApplicationProcessId : " + + packetIdApplicationProcessId + + separator + + "packetSequenceControlSecquenceFlag : " + + packetSequenceControlSecquenceFlag + + separator + + "packetSequenceControlCountOrName : " + + packetSequenceControlCountOrName + + separator + + "packetDataLength : " + + packetDataLength; + } + + public String toStringCompute() { + + return " "; + } } diff --git a/ModuleUVSQsatTelemetry/src/main/java/org/josast/uvsqsat/pojogenerated/packetSecondaryHeader.java b/ModuleUVSQsatTelemetry/src/main/java/org/josast/uvsqsat/pojogenerated/packetSecondaryHeader.java index 60873f7d2ca4336d3c78baa50a26b038553e9290..54dcc10be8ed35da0cd1dcafce06192ff0158497 100644 --- a/ModuleUVSQsatTelemetry/src/main/java/org/josast/uvsqsat/pojogenerated/packetSecondaryHeader.java +++ b/ModuleUVSQsatTelemetry/src/main/java/org/josast/uvsqsat/pojogenerated/packetSecondaryHeader.java @@ -5,53 +5,73 @@ package org.josast.uvsqsat.pojogenerated; import org.josast.uvsqsat.generated.Uvsqsat.PacketSecondaryHeader; -public class packetSecondaryHeader extends AFrame { - - private String separator=" \r\n" ; -/** - data raw Declaration **/ - private long tmPacketPusVersionNumber; - private long spacecraftTimeReferenceStatus; - private int serviceTypeId; - private int messageSubtypeId; - private int messageTypeCounter; - private int destinationId; - private long time; - private int dummy1; - private int dummy2; - private int sid; -/** - Instance Declaration **/ - public packetSecondaryHeader(PacketSecondaryHeader o) { - - tmPacketPusVersionNumber = o.tmPacketPusVersionNumber(); - spacecraftTimeReferenceStatus = o.spacecraftTimeReferenceStatus(); - serviceTypeId = o.serviceTypeId(); - messageSubtypeId = o.messageSubtypeId(); - messageTypeCounter = o.messageTypeCounter(); - destinationId = o.destinationId(); - time = o.time(); - dummy1 = o.dummy1(); - dummy2 = o.dummy2(); - sid = o.sid(); - } - - public String toStringRaw () { - - return " " - + separator + "tmPacketPusVersionNumber : " +tmPacketPusVersionNumber - + separator + "spacecraftTimeReferenceStatus : " +spacecraftTimeReferenceStatus - + separator + "serviceTypeId : " +serviceTypeId - + separator + "messageSubtypeId : " +messageSubtypeId - + separator + "messageTypeCounter : " +messageTypeCounter - + separator + "destinationId : " +destinationId - + separator + "time : " +time - + separator + "dummy1 : " +dummy1 - + separator + "dummy2 : " +dummy2 - + separator + "sid : " +sid -; } - - public String toStringCompute () { - - return " " -; } +public class packetSecondaryHeader extends AFrame { + private String separator = " \r\n"; + /** - data raw Declaration * */ + private long tmPacketPusVersionNumber; + + private long spacecraftTimeReferenceStatus; + private int serviceTypeId; + private int messageSubtypeId; + private int messageTypeCounter; + private int destinationId; + private long time; + private int dummy1; + private int dummy2; + private int sid; + /** - Instance Declaration * */ + public packetSecondaryHeader(PacketSecondaryHeader o) { + + tmPacketPusVersionNumber = o.tmPacketPusVersionNumber(); + spacecraftTimeReferenceStatus = o.spacecraftTimeReferenceStatus(); + serviceTypeId = o.serviceTypeId(); + messageSubtypeId = o.messageSubtypeId(); + messageTypeCounter = o.messageTypeCounter(); + destinationId = o.destinationId(); + time = o.time(); + dummy1 = o.dummy1(); + dummy2 = o.dummy2(); + sid = o.sid(); + } + + public String toStringRaw() { + + return " " + + separator + + "tmPacketPusVersionNumber : " + + tmPacketPusVersionNumber + + separator + + "spacecraftTimeReferenceStatus : " + + spacecraftTimeReferenceStatus + + separator + + "serviceTypeId : " + + serviceTypeId + + separator + + "messageSubtypeId : " + + messageSubtypeId + + separator + + "messageTypeCounter : " + + messageTypeCounter + + separator + + "destinationId : " + + destinationId + + separator + + "time : " + + time + + separator + + "dummy1 : " + + dummy1 + + separator + + "dummy2 : " + + dummy2 + + separator + + "sid : " + + sid; + } + + public String toStringCompute() { + + return " "; + } } diff --git a/ModuleUVSQsatTelemetry/src/main/java/org/josast/uvsqsat/pojogenerated/ssidMask.java b/ModuleUVSQsatTelemetry/src/main/java/org/josast/uvsqsat/pojogenerated/ssidMask.java index 9d74e197f5f5d44fa7f167b0791d7b8561732c96..47a9b97e2a842d9268511b081d85c9216ed6e285 100644 --- a/ModuleUVSQsatTelemetry/src/main/java/org/josast/uvsqsat/pojogenerated/ssidMask.java +++ b/ModuleUVSQsatTelemetry/src/main/java/org/josast/uvsqsat/pojogenerated/ssidMask.java @@ -5,29 +5,32 @@ package org.josast.uvsqsat.pojogenerated; import org.josast.uvsqsat.generated.Uvsqsat.SsidMask; -public class ssidMask extends AFrame { - - private String separator=" \r\n" ; -/** - data raw Declaration **/ - private int ssidMask; -/** - Instance Declaration **/ - private double compssid; - public ssidMask(SsidMask o) { - - ssidMask = o.ssidMask(); - compssid = o.ssid(); - } - - public String toStringRaw () { - - return " " - + separator + "ssidMask : " +ssidMask -; } - - public String toStringCompute () { - - return " " - + separator + "ssid : Ox" + toHex(ssidMask) + " : "+ String.format("%.3f", + compssid) -; } +public class ssidMask extends AFrame { + private String separator = " \r\n"; + /** - data raw Declaration * */ + private int ssidMask; + /** - Instance Declaration * */ + private double compssid; + + public ssidMask(SsidMask o) { + + ssidMask = o.ssidMask(); + compssid = o.ssid(); + } + + public String toStringRaw() { + + return " " + separator + "ssidMask : " + ssidMask; + } + + public String toStringCompute() { + + return " " + + separator + + "ssid : Ox" + + toHex(ssidMask) + + " : " + + String.format("%.3f", +compssid); + } } diff --git a/ModuleUVSQsatTelemetry/src/main/java/org/josast/uvsqsat/pojogenerated/trxvurxHk.java b/ModuleUVSQsatTelemetry/src/main/java/org/josast/uvsqsat/pojogenerated/trxvurxHk.java index 17ce83a8593ed6ea4ae9c541eb0f1c0ffa26b854..e9e90f452785dfdbae5b9a7bd600999d0b119c77 100644 --- a/ModuleUVSQsatTelemetry/src/main/java/org/josast/uvsqsat/pojogenerated/trxvurxHk.java +++ b/ModuleUVSQsatTelemetry/src/main/java/org/josast/uvsqsat/pojogenerated/trxvurxHk.java @@ -5,89 +5,161 @@ package org.josast.uvsqsat.pojogenerated; import org.josast.uvsqsat.generated.Uvsqsat.TrxvurxHk; -public class trxvurxHk extends AFrame { +public class trxvurxHk extends AFrame { - private String separator=" \r\n" ; -/** - data raw Declaration **/ - private long trxvurxInstantaneousReceivedSignalDopplerOffsetAtTheReceiverPort; - private long trxvurxInstantaneousReceivedSignalStrengthAtTheReceiverPort; - private long trxvurxSupplyVoltage; - private long trxvurxTotalSupplyCurrent; - private long trxvurxTransmitterCurrent; - private long trxvurxReceiverCurrent; - private long trxvurxPowerAmplifierCurrent; - private long trxvurxPowerAmplifierTemperature; - private long trxvurxLocalOscillatorTemperature; - private long trxvurxZeroPadding; - private long trxvuRxUptime; -/** - Instance Declaration **/ - private double comptrxvurxInstantaneousReceivedSignalDopplerHz; - private double comptrxvurxInstantaneousReceivedSignalStrengthDbm; - private double comptrxvurxSupplyVoltageV; - private double comptrxvurxTotalSupplyCurrentMa; - private double comptrxvurxTransmitterCurrentMa; - private double comptrxvurxReceiverCurrentMa; - private double comptrxvurxPowerAmplifierCurrentMa; - private double comptrxvurxPowerAmplifierTemperatureC; - private double comptrxvurxLocalOscillatorTemperatureC; - private long comptrxvurxZeroPaddingRaw; - private long comptrxvuRxUptimeRaw; - public trxvurxHk(TrxvurxHk o) { + private String separator = " \r\n"; + /** - data raw Declaration * */ + private long trxvurxInstantaneousReceivedSignalDopplerOffsetAtTheReceiverPort; - trxvurxInstantaneousReceivedSignalDopplerOffsetAtTheReceiverPort = o.trxvurxInstantaneousReceivedSignalDopplerOffsetAtTheReceiverPort(); - trxvurxInstantaneousReceivedSignalStrengthAtTheReceiverPort = o.trxvurxInstantaneousReceivedSignalStrengthAtTheReceiverPort(); - trxvurxSupplyVoltage = o.trxvurxSupplyVoltage(); - trxvurxTotalSupplyCurrent = o.trxvurxTotalSupplyCurrent(); - trxvurxTransmitterCurrent = o.trxvurxTransmitterCurrent(); - trxvurxReceiverCurrent = o.trxvurxReceiverCurrent(); - trxvurxPowerAmplifierCurrent = o.trxvurxPowerAmplifierCurrent(); - trxvurxPowerAmplifierTemperature = o.trxvurxPowerAmplifierTemperature(); - trxvurxLocalOscillatorTemperature = o.trxvurxLocalOscillatorTemperature(); - trxvurxZeroPadding = o.trxvurxZeroPadding(); - trxvuRxUptime = o.trxvuRxUptime(); - comptrxvurxInstantaneousReceivedSignalDopplerHz = o.trxvurxInstantaneousReceivedSignalDopplerHz(); - comptrxvurxInstantaneousReceivedSignalStrengthDbm = o.trxvurxInstantaneousReceivedSignalStrengthDbm(); - comptrxvurxSupplyVoltageV = o.trxvurxSupplyVoltageV(); - comptrxvurxTotalSupplyCurrentMa = o.trxvurxTotalSupplyCurrentMa(); - comptrxvurxTransmitterCurrentMa = o.trxvurxTransmitterCurrentMa(); - comptrxvurxReceiverCurrentMa = o.trxvurxReceiverCurrentMa(); - comptrxvurxPowerAmplifierCurrentMa = o.trxvurxPowerAmplifierCurrentMa(); - comptrxvurxPowerAmplifierTemperatureC = o.trxvurxPowerAmplifierTemperatureC(); - comptrxvurxLocalOscillatorTemperatureC = o.trxvurxLocalOscillatorTemperatureC(); - comptrxvurxZeroPaddingRaw = o.trxvurxZeroPaddingRaw(); - comptrxvuRxUptimeRaw = o.trxvuRxUptimeRaw(); - } + private long trxvurxInstantaneousReceivedSignalStrengthAtTheReceiverPort; + private long trxvurxSupplyVoltage; + private long trxvurxTotalSupplyCurrent; + private long trxvurxTransmitterCurrent; + private long trxvurxReceiverCurrent; + private long trxvurxPowerAmplifierCurrent; + private long trxvurxPowerAmplifierTemperature; + private long trxvurxLocalOscillatorTemperature; + private long trxvurxZeroPadding; + private long trxvuRxUptime; + /** - Instance Declaration * */ + private double comptrxvurxInstantaneousReceivedSignalDopplerHz; - public String toStringRaw () { - - return " " - + separator + "trxvurxInstantaneousReceivedSignalDopplerOffsetAtTheReceiverPort : " +trxvurxInstantaneousReceivedSignalDopplerOffsetAtTheReceiverPort - + separator + "trxvurxInstantaneousReceivedSignalStrengthAtTheReceiverPort : " +trxvurxInstantaneousReceivedSignalStrengthAtTheReceiverPort - + separator + "trxvurxSupplyVoltage : " +trxvurxSupplyVoltage - + separator + "trxvurxTotalSupplyCurrent : " +trxvurxTotalSupplyCurrent - + separator + "trxvurxTransmitterCurrent : " +trxvurxTransmitterCurrent - + separator + "trxvurxReceiverCurrent : " +trxvurxReceiverCurrent - + separator + "trxvurxPowerAmplifierCurrent : " +trxvurxPowerAmplifierCurrent - + separator + "trxvurxPowerAmplifierTemperature : " +trxvurxPowerAmplifierTemperature - + separator + "trxvurxLocalOscillatorTemperature : " +trxvurxLocalOscillatorTemperature - + separator + "trxvurxZeroPadding : " +trxvurxZeroPadding - + separator + "trxvuRxUptime : " +trxvuRxUptime -; } + private double comptrxvurxInstantaneousReceivedSignalStrengthDbm; + private double comptrxvurxSupplyVoltageV; + private double comptrxvurxTotalSupplyCurrentMa; + private double comptrxvurxTransmitterCurrentMa; + private double comptrxvurxReceiverCurrentMa; + private double comptrxvurxPowerAmplifierCurrentMa; + private double comptrxvurxPowerAmplifierTemperatureC; + private double comptrxvurxLocalOscillatorTemperatureC; + private long comptrxvurxZeroPaddingRaw; + private long comptrxvuRxUptimeRaw; - public String toStringCompute () { - - return " " - + separator + "trxvurx instantaneous received signal doppler (Hz) : Ox" + toHex(trxvurxInstantaneousReceivedSignalDopplerOffsetAtTheReceiverPort) + " : "+ String.format("%.3f", + comptrxvurxInstantaneousReceivedSignalDopplerHz) - + separator + "trxvurx instantaneous received signal strength (dbm) : Ox" + toHex(trxvurxInstantaneousReceivedSignalStrengthAtTheReceiverPort) + " : "+ String.format("%.3f", + comptrxvurxInstantaneousReceivedSignalStrengthDbm) - + separator + "trxvurx supply voltage (V) : Ox" + toHex(trxvurxSupplyVoltage) + " : "+ String.format("%.3f", + comptrxvurxSupplyVoltageV) - + separator + "trxvurx total supply current (mA) : Ox" + toHex(trxvurxTotalSupplyCurrent) + " : "+ String.format("%.3f", + comptrxvurxTotalSupplyCurrentMa) - + separator + "trxvurx transmitter current (mA) : Ox" + toHex(trxvurxTransmitterCurrent) + " : "+ String.format("%.3f", + comptrxvurxTransmitterCurrentMa) - + separator + "trxvurx receiver current (mA) : Ox" + toHex(trxvurxReceiverCurrent) + " : "+ String.format("%.3f", + comptrxvurxReceiverCurrentMa) - + separator + "trxvurx power amplifier current (mA) : Ox" + toHex(trxvurxPowerAmplifierCurrent) + " : "+ String.format("%.3f", + comptrxvurxPowerAmplifierCurrentMa) - + separator + "trxvurx power amplifier temperature (°C) : Ox" + toHex(trxvurxPowerAmplifierTemperature) + " : "+ String.format("%.3f", + comptrxvurxPowerAmplifierTemperatureC) - + separator + "trxvurx local oscillator temperature (°C) : Ox" + toHex(trxvurxLocalOscillatorTemperature) + " : "+ String.format("%.3f", + comptrxvurxLocalOscillatorTemperatureC) - + separator + "trxvurx zero padding : Ox" + toHex(trxvurxZeroPadding) + " : " + comptrxvurxZeroPaddingRaw - + separator + "trxvu rx uptime : Ox" + toHex(trxvuRxUptime) + " : " + comptrxvuRxUptimeRaw -; } + public trxvurxHk(TrxvurxHk o) { + trxvurxInstantaneousReceivedSignalDopplerOffsetAtTheReceiverPort = + o.trxvurxInstantaneousReceivedSignalDopplerOffsetAtTheReceiverPort(); + trxvurxInstantaneousReceivedSignalStrengthAtTheReceiverPort = + o.trxvurxInstantaneousReceivedSignalStrengthAtTheReceiverPort(); + trxvurxSupplyVoltage = o.trxvurxSupplyVoltage(); + trxvurxTotalSupplyCurrent = o.trxvurxTotalSupplyCurrent(); + trxvurxTransmitterCurrent = o.trxvurxTransmitterCurrent(); + trxvurxReceiverCurrent = o.trxvurxReceiverCurrent(); + trxvurxPowerAmplifierCurrent = o.trxvurxPowerAmplifierCurrent(); + trxvurxPowerAmplifierTemperature = o.trxvurxPowerAmplifierTemperature(); + trxvurxLocalOscillatorTemperature = o.trxvurxLocalOscillatorTemperature(); + trxvurxZeroPadding = o.trxvurxZeroPadding(); + trxvuRxUptime = o.trxvuRxUptime(); + comptrxvurxInstantaneousReceivedSignalDopplerHz = + o.trxvurxInstantaneousReceivedSignalDopplerHz(); + comptrxvurxInstantaneousReceivedSignalStrengthDbm = + o.trxvurxInstantaneousReceivedSignalStrengthDbm(); + comptrxvurxSupplyVoltageV = o.trxvurxSupplyVoltageV(); + comptrxvurxTotalSupplyCurrentMa = o.trxvurxTotalSupplyCurrentMa(); + comptrxvurxTransmitterCurrentMa = o.trxvurxTransmitterCurrentMa(); + comptrxvurxReceiverCurrentMa = o.trxvurxReceiverCurrentMa(); + comptrxvurxPowerAmplifierCurrentMa = o.trxvurxPowerAmplifierCurrentMa(); + comptrxvurxPowerAmplifierTemperatureC = o.trxvurxPowerAmplifierTemperatureC(); + comptrxvurxLocalOscillatorTemperatureC = o.trxvurxLocalOscillatorTemperatureC(); + comptrxvurxZeroPaddingRaw = o.trxvurxZeroPaddingRaw(); + comptrxvuRxUptimeRaw = o.trxvuRxUptimeRaw(); + } + + public String toStringRaw() { + + return " " + + separator + + "trxvurxInstantaneousReceivedSignalDopplerOffsetAtTheReceiverPort : " + + trxvurxInstantaneousReceivedSignalDopplerOffsetAtTheReceiverPort + + separator + + "trxvurxInstantaneousReceivedSignalStrengthAtTheReceiverPort : " + + trxvurxInstantaneousReceivedSignalStrengthAtTheReceiverPort + + separator + + "trxvurxSupplyVoltage : " + + trxvurxSupplyVoltage + + separator + + "trxvurxTotalSupplyCurrent : " + + trxvurxTotalSupplyCurrent + + separator + + "trxvurxTransmitterCurrent : " + + trxvurxTransmitterCurrent + + separator + + "trxvurxReceiverCurrent : " + + trxvurxReceiverCurrent + + separator + + "trxvurxPowerAmplifierCurrent : " + + trxvurxPowerAmplifierCurrent + + separator + + "trxvurxPowerAmplifierTemperature : " + + trxvurxPowerAmplifierTemperature + + separator + + "trxvurxLocalOscillatorTemperature : " + + trxvurxLocalOscillatorTemperature + + separator + + "trxvurxZeroPadding : " + + trxvurxZeroPadding + + separator + + "trxvuRxUptime : " + + trxvuRxUptime; + } + + public String toStringCompute() { + + return " " + + separator + + "trxvurx instantaneous received signal doppler (Hz) : Ox" + + toHex(trxvurxInstantaneousReceivedSignalDopplerOffsetAtTheReceiverPort) + + " : " + + String.format("%.3f", +comptrxvurxInstantaneousReceivedSignalDopplerHz) + + separator + + "trxvurx instantaneous received signal strength (dbm) : Ox" + + toHex(trxvurxInstantaneousReceivedSignalStrengthAtTheReceiverPort) + + " : " + + String.format("%.3f", +comptrxvurxInstantaneousReceivedSignalStrengthDbm) + + separator + + "trxvurx supply voltage (V) : Ox" + + toHex(trxvurxSupplyVoltage) + + " : " + + String.format("%.3f", +comptrxvurxSupplyVoltageV) + + separator + + "trxvurx total supply current (mA) : Ox" + + toHex(trxvurxTotalSupplyCurrent) + + " : " + + String.format("%.3f", +comptrxvurxTotalSupplyCurrentMa) + + separator + + "trxvurx transmitter current (mA) : Ox" + + toHex(trxvurxTransmitterCurrent) + + " : " + + String.format("%.3f", +comptrxvurxTransmitterCurrentMa) + + separator + + "trxvurx receiver current (mA) : Ox" + + toHex(trxvurxReceiverCurrent) + + " : " + + String.format("%.3f", +comptrxvurxReceiverCurrentMa) + + separator + + "trxvurx power amplifier current (mA) : Ox" + + toHex(trxvurxPowerAmplifierCurrent) + + " : " + + String.format("%.3f", +comptrxvurxPowerAmplifierCurrentMa) + + separator + + "trxvurx power amplifier temperature (°C) : Ox" + + toHex(trxvurxPowerAmplifierTemperature) + + " : " + + String.format("%.3f", +comptrxvurxPowerAmplifierTemperatureC) + + separator + + "trxvurx local oscillator temperature (°C) : Ox" + + toHex(trxvurxLocalOscillatorTemperature) + + " : " + + String.format("%.3f", +comptrxvurxLocalOscillatorTemperatureC) + + separator + + "trxvurx zero padding : Ox" + + toHex(trxvurxZeroPadding) + + " : " + + comptrxvurxZeroPaddingRaw + + separator + + "trxvu rx uptime : Ox" + + toHex(trxvuRxUptime) + + " : " + + comptrxvuRxUptimeRaw; + } } diff --git a/ModuleUVSQsatTelemetry/src/main/java/org/josast/uvsqsat/pojogenerated/trxvutxHk.java b/ModuleUVSQsatTelemetry/src/main/java/org/josast/uvsqsat/pojogenerated/trxvutxHk.java index ceef4edab3f54faac59a67c91503efa7c2519c50..2271cd8404cec2977b6cc371874c9623a3f57e8e 100644 --- a/ModuleUVSQsatTelemetry/src/main/java/org/josast/uvsqsat/pojogenerated/trxvutxHk.java +++ b/ModuleUVSQsatTelemetry/src/main/java/org/josast/uvsqsat/pojogenerated/trxvutxHk.java @@ -5,95 +5,173 @@ package org.josast.uvsqsat.pojogenerated; import org.josast.uvsqsat.generated.Uvsqsat.TrxvutxHk; -public class trxvutxHk extends AFrame { +public class trxvutxHk extends AFrame { - private String separator=" \r\n" ; -/** - data raw Declaration **/ - private long trxvutxInstantaneousRfReflectedPowerFromTransmitterPort; - private long trxvutxInstantaneousRfForwardPowerFromTransmitterPort; - private long trxvutxSupplyVoltage; - private long trxvutxTotalSupplyCurrent; - private long trxvutxTransmitterCurrent; - private long trxvutxReceiverCurrent; - private long trxvutxPowerAmplifierCurrent; - private long trxvutxPowerAmplifierTemperature; - private long trxvutxLocalOscillatorTemperature; - private long trxvutxZeroPadding; - private long trxvuTxUptime; - private int trxvuTxState; -/** - Instance Declaration **/ - private double comptrxvutxInstantaneousRfReflectedPowerFromTransmitterPortMw; - private double comptrxvutxInstantaneousRfForwardPowerFromTransmitterPortMw; - private double comptrxvutxSupplyVoltageV; - private double comptrxvutxTotalSupplyCurrentMa; - private double comptrxvutxTransmitterCurrentMa; - private double comptrxvutxReceiverCurrentMa; - private double comptrxvutxPowerAmplifierCurrentMa; - private double comptrxvutxPowerAmplifierTemperatureC; - private double comptrxvutxLocalOscillatorTemperatureC; - private long comptrxvutxZeroPaddingRaw; - private long comptrxvuTxUptimeRaw; - private long comptrxvuTxStateRaw; - public trxvutxHk(TrxvutxHk o) { + private String separator = " \r\n"; + /** - data raw Declaration * */ + private long trxvutxInstantaneousRfReflectedPowerFromTransmitterPort; - trxvutxInstantaneousRfReflectedPowerFromTransmitterPort = o.trxvutxInstantaneousRfReflectedPowerFromTransmitterPort(); - trxvutxInstantaneousRfForwardPowerFromTransmitterPort = o.trxvutxInstantaneousRfForwardPowerFromTransmitterPort(); - trxvutxSupplyVoltage = o.trxvutxSupplyVoltage(); - trxvutxTotalSupplyCurrent = o.trxvutxTotalSupplyCurrent(); - trxvutxTransmitterCurrent = o.trxvutxTransmitterCurrent(); - trxvutxReceiverCurrent = o.trxvutxReceiverCurrent(); - trxvutxPowerAmplifierCurrent = o.trxvutxPowerAmplifierCurrent(); - trxvutxPowerAmplifierTemperature = o.trxvutxPowerAmplifierTemperature(); - trxvutxLocalOscillatorTemperature = o.trxvutxLocalOscillatorTemperature(); - trxvutxZeroPadding = o.trxvutxZeroPadding(); - trxvuTxUptime = o.trxvuTxUptime(); - trxvuTxState = o.trxvuTxState(); - comptrxvutxInstantaneousRfReflectedPowerFromTransmitterPortMw = o.trxvutxInstantaneousRfReflectedPowerFromTransmitterPortMw(); - comptrxvutxInstantaneousRfForwardPowerFromTransmitterPortMw = o.trxvutxInstantaneousRfForwardPowerFromTransmitterPortMw(); - comptrxvutxSupplyVoltageV = o.trxvutxSupplyVoltageV(); - comptrxvutxTotalSupplyCurrentMa = o.trxvutxTotalSupplyCurrentMa(); - comptrxvutxTransmitterCurrentMa = o.trxvutxTransmitterCurrentMa(); - comptrxvutxReceiverCurrentMa = o.trxvutxReceiverCurrentMa(); - comptrxvutxPowerAmplifierCurrentMa = o.trxvutxPowerAmplifierCurrentMa(); - comptrxvutxPowerAmplifierTemperatureC = o.trxvutxPowerAmplifierTemperatureC(); - comptrxvutxLocalOscillatorTemperatureC = o.trxvutxLocalOscillatorTemperatureC(); - comptrxvutxZeroPaddingRaw = o.trxvutxZeroPaddingRaw(); - comptrxvuTxUptimeRaw = o.trxvuTxUptimeRaw(); - comptrxvuTxStateRaw = o.trxvuTxStateRaw(); - } + private long trxvutxInstantaneousRfForwardPowerFromTransmitterPort; + private long trxvutxSupplyVoltage; + private long trxvutxTotalSupplyCurrent; + private long trxvutxTransmitterCurrent; + private long trxvutxReceiverCurrent; + private long trxvutxPowerAmplifierCurrent; + private long trxvutxPowerAmplifierTemperature; + private long trxvutxLocalOscillatorTemperature; + private long trxvutxZeroPadding; + private long trxvuTxUptime; + private int trxvuTxState; + /** - Instance Declaration * */ + private double comptrxvutxInstantaneousRfReflectedPowerFromTransmitterPortMw; - public String toStringRaw () { - - return " " - + separator + "trxvutxInstantaneousRfReflectedPowerFromTransmitterPort : " +trxvutxInstantaneousRfReflectedPowerFromTransmitterPort - + separator + "trxvutxInstantaneousRfForwardPowerFromTransmitterPort : " +trxvutxInstantaneousRfForwardPowerFromTransmitterPort - + separator + "trxvutxSupplyVoltage : " +trxvutxSupplyVoltage - + separator + "trxvutxTotalSupplyCurrent : " +trxvutxTotalSupplyCurrent - + separator + "trxvutxTransmitterCurrent : " +trxvutxTransmitterCurrent - + separator + "trxvutxReceiverCurrent : " +trxvutxReceiverCurrent - + separator + "trxvutxPowerAmplifierCurrent : " +trxvutxPowerAmplifierCurrent - + separator + "trxvutxPowerAmplifierTemperature : " +trxvutxPowerAmplifierTemperature - + separator + "trxvutxLocalOscillatorTemperature : " +trxvutxLocalOscillatorTemperature - + separator + "trxvutxZeroPadding : " +trxvutxZeroPadding - + separator + "trxvuTxUptime : " +trxvuTxUptime - + separator + "trxvuTxState : " +trxvuTxState -; } + private double comptrxvutxInstantaneousRfForwardPowerFromTransmitterPortMw; + private double comptrxvutxSupplyVoltageV; + private double comptrxvutxTotalSupplyCurrentMa; + private double comptrxvutxTransmitterCurrentMa; + private double comptrxvutxReceiverCurrentMa; + private double comptrxvutxPowerAmplifierCurrentMa; + private double comptrxvutxPowerAmplifierTemperatureC; + private double comptrxvutxLocalOscillatorTemperatureC; + private long comptrxvutxZeroPaddingRaw; + private long comptrxvuTxUptimeRaw; + private long comptrxvuTxStateRaw; - public String toStringCompute () { - - return " " - + separator + "trxvutx instantaneous rf reflected power from transmitter port (mW) : Ox" + toHex(trxvutxInstantaneousRfReflectedPowerFromTransmitterPort) + " : "+ String.format("%.3f", + comptrxvutxInstantaneousRfReflectedPowerFromTransmitterPortMw) - + separator + "trxvutx instantaneous rf forward power from transmitter port (mW) : Ox" + toHex(trxvutxInstantaneousRfForwardPowerFromTransmitterPort) + " : "+ String.format("%.3f", + comptrxvutxInstantaneousRfForwardPowerFromTransmitterPortMw) - + separator + "trxvutx supply voltage (V) : Ox" + toHex(trxvutxSupplyVoltage) + " : "+ String.format("%.3f", + comptrxvutxSupplyVoltageV) - + separator + "trxvutx total supply current (mA) : Ox" + toHex(trxvutxTotalSupplyCurrent) + " : "+ String.format("%.3f", + comptrxvutxTotalSupplyCurrentMa) - + separator + "trxvutx transmitter current (mA) : Ox" + toHex(trxvutxTransmitterCurrent) + " : "+ String.format("%.3f", + comptrxvutxTransmitterCurrentMa) - + separator + "trxvutx receiver current (mA) : Ox" + toHex(trxvutxReceiverCurrent) + " : "+ String.format("%.3f", + comptrxvutxReceiverCurrentMa) - + separator + "trxvutx power amplifier current (mA) : Ox" + toHex(trxvutxPowerAmplifierCurrent) + " : "+ String.format("%.3f", + comptrxvutxPowerAmplifierCurrentMa) - + separator + "trxvutx power amplifier temperature (°C) : Ox" + toHex(trxvutxPowerAmplifierTemperature) + " : "+ String.format("%.3f", + comptrxvutxPowerAmplifierTemperatureC) - + separator + "trxvutx local oscillator temperature (°C) : Ox" + toHex(trxvutxLocalOscillatorTemperature) + " : "+ String.format("%.3f", + comptrxvutxLocalOscillatorTemperatureC) - + separator + "trxvutx zero padding : Ox" + toHex(trxvutxZeroPadding) + " : " + comptrxvutxZeroPaddingRaw - + separator + "trxvu tx uptime : Ox" + toHex(trxvuTxUptime) + " : " + comptrxvuTxUptimeRaw - + separator + "trxvu tx state : Ox" + toHex(trxvuTxState) + " : " + comptrxvuTxStateRaw -; } + public trxvutxHk(TrxvutxHk o) { + trxvutxInstantaneousRfReflectedPowerFromTransmitterPort = + o.trxvutxInstantaneousRfReflectedPowerFromTransmitterPort(); + trxvutxInstantaneousRfForwardPowerFromTransmitterPort = + o.trxvutxInstantaneousRfForwardPowerFromTransmitterPort(); + trxvutxSupplyVoltage = o.trxvutxSupplyVoltage(); + trxvutxTotalSupplyCurrent = o.trxvutxTotalSupplyCurrent(); + trxvutxTransmitterCurrent = o.trxvutxTransmitterCurrent(); + trxvutxReceiverCurrent = o.trxvutxReceiverCurrent(); + trxvutxPowerAmplifierCurrent = o.trxvutxPowerAmplifierCurrent(); + trxvutxPowerAmplifierTemperature = o.trxvutxPowerAmplifierTemperature(); + trxvutxLocalOscillatorTemperature = o.trxvutxLocalOscillatorTemperature(); + trxvutxZeroPadding = o.trxvutxZeroPadding(); + trxvuTxUptime = o.trxvuTxUptime(); + trxvuTxState = o.trxvuTxState(); + comptrxvutxInstantaneousRfReflectedPowerFromTransmitterPortMw = + o.trxvutxInstantaneousRfReflectedPowerFromTransmitterPortMw(); + comptrxvutxInstantaneousRfForwardPowerFromTransmitterPortMw = + o.trxvutxInstantaneousRfForwardPowerFromTransmitterPortMw(); + comptrxvutxSupplyVoltageV = o.trxvutxSupplyVoltageV(); + comptrxvutxTotalSupplyCurrentMa = o.trxvutxTotalSupplyCurrentMa(); + comptrxvutxTransmitterCurrentMa = o.trxvutxTransmitterCurrentMa(); + comptrxvutxReceiverCurrentMa = o.trxvutxReceiverCurrentMa(); + comptrxvutxPowerAmplifierCurrentMa = o.trxvutxPowerAmplifierCurrentMa(); + comptrxvutxPowerAmplifierTemperatureC = o.trxvutxPowerAmplifierTemperatureC(); + comptrxvutxLocalOscillatorTemperatureC = o.trxvutxLocalOscillatorTemperatureC(); + comptrxvutxZeroPaddingRaw = o.trxvutxZeroPaddingRaw(); + comptrxvuTxUptimeRaw = o.trxvuTxUptimeRaw(); + comptrxvuTxStateRaw = o.trxvuTxStateRaw(); + } + + public String toStringRaw() { + + return " " + + separator + + "trxvutxInstantaneousRfReflectedPowerFromTransmitterPort : " + + trxvutxInstantaneousRfReflectedPowerFromTransmitterPort + + separator + + "trxvutxInstantaneousRfForwardPowerFromTransmitterPort : " + + trxvutxInstantaneousRfForwardPowerFromTransmitterPort + + separator + + "trxvutxSupplyVoltage : " + + trxvutxSupplyVoltage + + separator + + "trxvutxTotalSupplyCurrent : " + + trxvutxTotalSupplyCurrent + + separator + + "trxvutxTransmitterCurrent : " + + trxvutxTransmitterCurrent + + separator + + "trxvutxReceiverCurrent : " + + trxvutxReceiverCurrent + + separator + + "trxvutxPowerAmplifierCurrent : " + + trxvutxPowerAmplifierCurrent + + separator + + "trxvutxPowerAmplifierTemperature : " + + trxvutxPowerAmplifierTemperature + + separator + + "trxvutxLocalOscillatorTemperature : " + + trxvutxLocalOscillatorTemperature + + separator + + "trxvutxZeroPadding : " + + trxvutxZeroPadding + + separator + + "trxvuTxUptime : " + + trxvuTxUptime + + separator + + "trxvuTxState : " + + trxvuTxState; + } + + public String toStringCompute() { + + return " " + + separator + + "trxvutx instantaneous rf reflected power from transmitter port (mW) : Ox" + + toHex(trxvutxInstantaneousRfReflectedPowerFromTransmitterPort) + + " : " + + String.format("%.3f", +comptrxvutxInstantaneousRfReflectedPowerFromTransmitterPortMw) + + separator + + "trxvutx instantaneous rf forward power from transmitter port (mW) : Ox" + + toHex(trxvutxInstantaneousRfForwardPowerFromTransmitterPort) + + " : " + + String.format("%.3f", +comptrxvutxInstantaneousRfForwardPowerFromTransmitterPortMw) + + separator + + "trxvutx supply voltage (V) : Ox" + + toHex(trxvutxSupplyVoltage) + + " : " + + String.format("%.3f", +comptrxvutxSupplyVoltageV) + + separator + + "trxvutx total supply current (mA) : Ox" + + toHex(trxvutxTotalSupplyCurrent) + + " : " + + String.format("%.3f", +comptrxvutxTotalSupplyCurrentMa) + + separator + + "trxvutx transmitter current (mA) : Ox" + + toHex(trxvutxTransmitterCurrent) + + " : " + + String.format("%.3f", +comptrxvutxTransmitterCurrentMa) + + separator + + "trxvutx receiver current (mA) : Ox" + + toHex(trxvutxReceiverCurrent) + + " : " + + String.format("%.3f", +comptrxvutxReceiverCurrentMa) + + separator + + "trxvutx power amplifier current (mA) : Ox" + + toHex(trxvutxPowerAmplifierCurrent) + + " : " + + String.format("%.3f", +comptrxvutxPowerAmplifierCurrentMa) + + separator + + "trxvutx power amplifier temperature (°C) : Ox" + + toHex(trxvutxPowerAmplifierTemperature) + + " : " + + String.format("%.3f", +comptrxvutxPowerAmplifierTemperatureC) + + separator + + "trxvutx local oscillator temperature (°C) : Ox" + + toHex(trxvutxLocalOscillatorTemperature) + + " : " + + String.format("%.3f", +comptrxvutxLocalOscillatorTemperatureC) + + separator + + "trxvutx zero padding : Ox" + + toHex(trxvutxZeroPadding) + + " : " + + comptrxvutxZeroPaddingRaw + + separator + + "trxvu tx uptime : Ox" + + toHex(trxvuTxUptime) + + " : " + + comptrxvuTxUptimeRaw + + separator + + "trxvu tx state : Ox" + + toHex(trxvuTxState) + + " : " + + comptrxvuTxStateRaw; + } } diff --git a/ModuleUVSQsatTelemetry/src/main/java/org/josast/uvsqsat/pojogenerated/uiFrame.java b/ModuleUVSQsatTelemetry/src/main/java/org/josast/uvsqsat/pojogenerated/uiFrame.java index d0d4955b1654225f3ec55bd8abd760bf0310d3d5..52c3741e69959bd2a05815856f00207295b74537 100644 --- a/ModuleUVSQsatTelemetry/src/main/java/org/josast/uvsqsat/pojogenerated/uiFrame.java +++ b/ModuleUVSQsatTelemetry/src/main/java/org/josast/uvsqsat/pojogenerated/uiFrame.java @@ -3,45 +3,54 @@ package org.josast.uvsqsat.pojogenerated; +import io.kaitai.struct.KaitaiStruct; import org.josast.uvsqsat.generated.Uvsqsat.PacketPrimaryHeader; import org.josast.uvsqsat.generated.Uvsqsat.PacketSecondaryHeader; import org.josast.uvsqsat.generated.Uvsqsat.UiFrame; -import io.kaitai.struct.KaitaiStruct; - -public class uiFrame extends AFrame { - - private String separator=" \r\n" ; -/** - data raw Declaration **/ - private int pid; -private PacketPrimaryHeader packetPrimaryHeader; -private PacketSecondaryHeader packetSecondaryHeader; -private KaitaiStruct tlm; -private byte[] ax25Info; - -/** - Instance Declaration **/ - public uiFrame(UiFrame o) { - - pid = o.pid(); - packetPrimaryHeader = o.packetPrimaryHeader(); - packetSecondaryHeader = o.packetSecondaryHeader(); - tlm = o.tlm(); - ax25Info = o.ax25Info(); - } - - public String toStringRaw () { - - return " " - + separator + "pid : " +pid - + separator + "packetPrimaryHeader : " +packetPrimaryHeader - + separator + "packetSecondaryHeader : " +packetSecondaryHeader - + separator + "tlm : " +tlm - + separator + "ax25Info : " +ax25Info -; } - - public String toStringCompute () { - - return " " -; } - +public class uiFrame extends AFrame { + + private String separator = " \r\n"; + /** - data raw Declaration * */ + private int pid; + + private PacketPrimaryHeader packetPrimaryHeader; + private PacketSecondaryHeader packetSecondaryHeader; + private KaitaiStruct tlm; + private byte[] ax25Info; + + /** - Instance Declaration * */ + public uiFrame(UiFrame o) { + + pid = o.pid(); + packetPrimaryHeader = o.packetPrimaryHeader(); + packetSecondaryHeader = o.packetSecondaryHeader(); + tlm = o.tlm(); + ax25Info = o.ax25Info(); + } + + public String toStringRaw() { + + return " " + + separator + + "pid : " + + pid + + separator + + "packetPrimaryHeader : " + + packetPrimaryHeader + + separator + + "packetSecondaryHeader : " + + packetSecondaryHeader + + separator + + "tlm : " + + tlm + + separator + + "ax25Info : " + + ax25Info; + } + + public String toStringCompute() { + + return " "; + } } diff --git a/ModuleUVSQsatTelemetry/src/test/java/org/josast/uvsqsat/AllUVSQsatFrameTest.java b/ModuleUVSQsatTelemetry/src/test/java/org/josast/uvsqsat/AllUVSQsatFrameTest.java index 8bfc0caf4d08a7877119ad1ef6f6b878e5a706bd..7ddce05cd892a6a4c0d3063d814df87e554149db 100644 --- a/ModuleUVSQsatTelemetry/src/test/java/org/josast/uvsqsat/AllUVSQsatFrameTest.java +++ b/ModuleUVSQsatTelemetry/src/test/java/org/josast/uvsqsat/AllUVSQsatFrameTest.java @@ -1,101 +1,98 @@ package org.josast.uvsqsat; +import io.kaitai.struct.ByteBufferKaitaiStream; import java.io.File; import java.io.IOException; import java.io.PrintStream; import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.Paths; - +import junit.framework.Assert; import org.josast.uvsqsat.generated.Uvsqsat; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; -import io.kaitai.struct.ByteBufferKaitaiStream; -import junit.framework.Assert; - class AllUVSQsatFrameTest { -// String dataRepository = "D:\\01-Projets\\UVSQsat\\Test\\20201127 - Replay pour AMSAT-F\\SDRSharp_20201023_143925Z_437017790Hz_IQ---Beacon_1200\\outputFile"; -// String dataRepository = "D:\\01-Projets\\josast\\ModuleUVSQsatTelemetry\\src\\test\\ressources\\ReferencePacket"; -// String dataRepository = "E:\\gitjosast\\josast\\ModuleUVSQsatTelemetry\\src\\test\\ressources\\ReferencePacket"; - String dataRepository = "src\\test\\ressources\\ReferencePacket"; - @BeforeEach - void setUp() throws Exception { - System.setOut(new PrintStream(new File ("AllUVSQsatFrameDisplay.txt"))); - } - - @AfterEach - void tearDown() throws Exception { - } - - @Test - void test() { - Path path = null; - - byte[] buff = null; - Frame frame = null; - File repertoire = new File(dataRepository); - - int i = 0; - if(!repertoire.isDirectory()) - { -// log.severe(repository + "is not a repository"); - Assert.fail(); - } - - File[] inputsfiles = repertoire.listFiles();if(inputsfiles==null) - { - //log.severe(repository + "Repository empty"); - Assert.fail(); - }else - { - for (i = 0; i < inputsfiles.length; i++) { - path = Paths.get(inputsfiles[i].getAbsolutePath()); - - try { - buff = Files.readAllBytes(path); - } catch (IOException e) { - System.out.println(inputsfiles[i].getAbsolutePath() + "; error1"); - // e.printStackTrace(); - } - - try { - - Uvsqsat cube = new Uvsqsat(new ByteBufferKaitaiStream(buff)); - - frame = new Frame(); - frame.setUp(cube); - } catch (Exception E) { - System.out.println(inputsfiles[i].getAbsolutePath() + "; error"); - // E.printStackTrace(); - } - - if(frame != null) - { - int sid= frame.getSid(); - System.out.println(inputsfiles[i].getAbsolutePath() + ";" ); - - System.out.println("bytes = " + print(buff)); - - if (sid!=0) System.out.println(frame.toStringFormat()); - if (sid!=0) System.out.println(); - } else - { - System.err.println("Frame not decoded "); - } - - } - } - } - public static String print(byte[] bytes) { - StringBuilder sb = new StringBuilder(); - sb.append("[ "); - for (byte b : bytes) { - sb.append(String.format("0x%02X ", b)); - } - sb.append("]"); - return sb.toString(); - } + // String dataRepository = "D:\\01-Projets\\UVSQsat\\Test\\20201127 - Replay pour + // AMSAT-F\\SDRSharp_20201023_143925Z_437017790Hz_IQ---Beacon_1200\\outputFile"; + // String dataRepository = + // "D:\\01-Projets\\josast\\ModuleUVSQsatTelemetry\\src\\test\\ressources\\ReferencePacket"; + // String dataRepository = + // "E:\\gitjosast\\josast\\ModuleUVSQsatTelemetry\\src\\test\\ressources\\ReferencePacket"; + String dataRepository = "src\\test\\ressources\\ReferencePacket"; + + @BeforeEach + void setUp() throws Exception { + System.setOut(new PrintStream(new File("AllUVSQsatFrameDisplay.txt"))); + } + + @AfterEach + void tearDown() throws Exception {} + + @Test + void test() { + Path path = null; + + byte[] buff = null; + Frame frame = null; + File repertoire = new File(dataRepository); + + int i = 0; + if (!repertoire.isDirectory()) { + // log.severe(repository + "is not a repository"); + Assert.fail(); + } + + File[] inputsfiles = repertoire.listFiles(); + if (inputsfiles == null) { + // log.severe(repository + "Repository empty"); + Assert.fail(); + } else { + for (i = 0; i < inputsfiles.length; i++) { + path = Paths.get(inputsfiles[i].getAbsolutePath()); + + try { + buff = Files.readAllBytes(path); + } catch (IOException e) { + System.out.println(inputsfiles[i].getAbsolutePath() + "; error1"); + // e.printStackTrace(); + } + + try { + + Uvsqsat cube = new Uvsqsat(new ByteBufferKaitaiStream(buff)); + + frame = new Frame(); + frame.setUp(cube); + } catch (Exception E) { + System.out.println(inputsfiles[i].getAbsolutePath() + "; error"); + // E.printStackTrace(); + } + + if (frame != null) { + int sid = frame.getSid(); + System.out.println(inputsfiles[i].getAbsolutePath() + ";"); + + System.out.println("bytes = " + print(buff)); + + if (sid != 0) System.out.println(frame.toStringFormat()); + if (sid != 0) System.out.println(); + } else { + System.err.println("Frame not decoded "); + } + } + } + } + + public static String print(byte[] bytes) { + StringBuilder sb = new StringBuilder(); + sb.append("[ "); + for (byte b : bytes) { + sb.append(String.format("0x%02X ", b)); + } + sb.append("]"); + return sb.toString(); + } } diff --git a/ModuleUVSQsatTelemetry/src/test/java/org/josast/uvsqsat/FrameTest.java b/ModuleUVSQsatTelemetry/src/test/java/org/josast/uvsqsat/FrameTest.java index 34b6c96bcbe415e87b1d9dc6cd6ef0643ed9b312..bce9dc6756ca7dfcbd66b3c9c26c7da4181a0479 100644 --- a/ModuleUVSQsatTelemetry/src/test/java/org/josast/uvsqsat/FrameTest.java +++ b/ModuleUVSQsatTelemetry/src/test/java/org/josast/uvsqsat/FrameTest.java @@ -1,58 +1,55 @@ package org.josast.uvsqsat; +import io.kaitai.struct.ByteBufferKaitaiStream; import java.io.IOException; import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.Paths; - import org.josast.uvsqsat.generated.Uvsqsat; import org.junit.jupiter.api.Test; -import io.kaitai.struct.ByteBufferKaitaiStream; - class FrameTest { - String generateRepository="src\\test\\ressources\\inputfile"; - @Test - void test() { - byte[] buff = null; - // imtq_hk_tm -// Path path = Paths.get(generateRepository+"/Frame_919.bin"); -// -// byte[] buff = null; -// try { -// buff = Files.readAllBytes(path); -// } catch (IOException e) { -// // TODO Auto-generated catch block -// e.printStackTrace(); -// } -// -// Uvsqsat cube = new Uvsqsat(new ByteBufferKaitaiStream(buff)); -// Frame frame = new Frame (); -// frame.setUp(cube); -// System.out.println(frame); - // trxvutx_hk_tm -// Path path = Paths.get("D:\\01-Projets\\josast\\ModuleUVSQsatTelemetry\\src\\test\\ressources\\ReferencePacket\\2020-12-12-Frame_0-Beacon.bin"); -// Path path = Paths.get("E:\\gitjosast\\josast\\ModuleUVSQsatTelemetry\\src\\test\\ressources\\ReferencePacket\\2020-12-12-Frame_0-Beacon.bin"); - Path path = Paths.get("src\\test\\ressources\\ReferencePacket\\2020-12-12-Frame_0-Beacon.bin"); - - Frame frame =null; - try { - System.out.println(Files.size(path)*8); - buff = Files.readAllBytes(path); - } catch (IOException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - - - - Uvsqsat cube = new Uvsqsat(new ByteBufferKaitaiStream(buff)); - frame = new Frame (); - frame.setUp(cube); - - - System.out.println(frame.toStringFormat()); - // fail("Not yet implemented"); - } - + String generateRepository = "src\\test\\ressources\\inputfile"; + + @Test + void test() { + byte[] buff = null; + // imtq_hk_tm + // Path path = Paths.get(generateRepository+"/Frame_919.bin"); + // + // byte[] buff = null; + // try { + // buff = Files.readAllBytes(path); + // } catch (IOException e) { + // // TODO Auto-generated catch block + // e.printStackTrace(); + // } + // + // Uvsqsat cube = new Uvsqsat(new ByteBufferKaitaiStream(buff)); + // Frame frame = new Frame (); + // frame.setUp(cube); + // System.out.println(frame); + // trxvutx_hk_tm + // Path path = + // Paths.get("D:\\01-Projets\\josast\\ModuleUVSQsatTelemetry\\src\\test\\ressources\\ReferencePacket\\2020-12-12-Frame_0-Beacon.bin"); + // Path path = + // Paths.get("E:\\gitjosast\\josast\\ModuleUVSQsatTelemetry\\src\\test\\ressources\\ReferencePacket\\2020-12-12-Frame_0-Beacon.bin"); + Path path = Paths.get("src\\test\\ressources\\ReferencePacket\\2020-12-12-Frame_0-Beacon.bin"); + + Frame frame = null; + try { + System.out.println(Files.size(path) * 8); + buff = Files.readAllBytes(path); + } catch (IOException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + + Uvsqsat cube = new Uvsqsat(new ByteBufferKaitaiStream(buff)); + frame = new Frame(); + frame.setUp(cube); + + System.out.println(frame.toStringFormat()); + // fail("Not yet implemented"); + } } diff --git a/ModuleUtil/src/main/java/org/avmdti/josast/demarage/FenetreDemarage.java b/ModuleUtil/src/main/java/org/avmdti/josast/demarage/FenetreDemarage.java index b52ed4f3d54e241c8fe059cb0fd2356287de41a8..121508405f89364976f0c4640696eb0531d74554 100644 --- a/ModuleUtil/src/main/java/org/avmdti/josast/demarage/FenetreDemarage.java +++ b/ModuleUtil/src/main/java/org/avmdti/josast/demarage/FenetreDemarage.java @@ -6,14 +6,14 @@ import java.awt.Toolkit; import java.awt.Window; /* - * + * * Description : - * - * + * + * *

    Projet : JCP
    - * + * *
    - * JOSAST : Java Open Source Amateur Satellite Toolbox + * JOSAST : Java Open Source Amateur Satellite Toolbox *
    The aim of the project is to create a set of tools for amateur satellite purpose. All this tools could be used together to create specific software. * JOSAST project is managed by AVMDTI (http://www.avmdti.org ) *
    This software is an open source software. Please read the JOSAST licence
    (http://www.avmdti.org ) @@ -22,77 +22,69 @@ import java.awt.Window; * @version 1.0 *

    date 23 avr. 2003

    *

    Source Update

    - *
    date : name : comments + *
    date : name : comments *
    V1 : mercier : create file *

    - * + * */ - /** - * - * This class allow to display a Windows - *
    + * This class allow to display a Windows
    + * * @author Xtophe * @version 1.0 */ public class FenetreDemarage { - private Window _window = null; - + private Window _window = null; - /** - * Constructor for FenetreDemarage. - * @param arg0 filename. - */ - public FenetreDemarage(String filename) { - ImageIntroduction im = new ImageIntroduction(filename); - _window = new Window(new Frame()); + /** + * Constructor for FenetreDemarage. + * + * @param arg0 filename. + */ + public FenetreDemarage(String filename) { + ImageIntroduction im = new ImageIntroduction(filename); + _window = new Window(new Frame()); - Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize(); - int largeur = screenSize.width * 2 / 3; - im.setscale(largeur, -1); - _window.add(im); - _window.setSize(im.getIw(), im.getIh()); - Dimension windowSize = _window.getSize(); - if (windowSize.height > screenSize.height) { - windowSize.height = screenSize.height; - } - if (windowSize.width > screenSize.width) { - windowSize.width = screenSize.width; - } - _window.setLocation( - (screenSize.width - windowSize.width) / 2, - (screenSize.height - windowSize.height) / 2); - _window.setVisible(true); + Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize(); + int largeur = screenSize.width * 2 / 3; + im.setscale(largeur, -1); + _window.add(im); + _window.setSize(im.getIw(), im.getIh()); + Dimension windowSize = _window.getSize(); + if (windowSize.height > screenSize.height) { + windowSize.height = screenSize.height; + } + if (windowSize.width > screenSize.width) { + windowSize.width = screenSize.width; + } + _window.setLocation( + (screenSize.width - windowSize.width) / 2, (screenSize.height - windowSize.height) / 2); + _window.setVisible(true); + } - } + /** + * Set the window visible + * + * @param b boolean true : visible + */ + public void setVisible(boolean b) { + _window.setVisible(b); + } - /** - * Set the window visible - * - * @param b boolean true : visible - */ - public void setVisible(boolean b) { - _window.setVisible(b); - } - - /** - * Sample to demonstrate how to use this class. - *
    - *
    Fenetredemarage filename - *
    - * - * @param args image filename - */ - public static void main(String[] args) { - if (args.length!=0) - { - new FenetreDemarage(args[0]); - } - else - { - System.out.println("USAGE : il faut un argument : nom de l'image"); - } - } + /** + * Sample to demonstrate how to use this class.
    + *
    + * Fenetredemarage filename
    + * + * @param args image filename + */ + public static void main(String[] args) { + if (args.length != 0) { + new FenetreDemarage(args[0]); + } else { + System.out.println("USAGE : il faut un argument : nom de l'image"); + } + } } diff --git a/ModuleUtil/src/main/java/org/avmdti/josast/demarage/ImageIntroduction.java b/ModuleUtil/src/main/java/org/avmdti/josast/demarage/ImageIntroduction.java index 1c0790db5c971ebf5a4d8c3f466a4fb7e15115f1..0a1ecf5be74c1fc2ea8da2a88a26c3251dabdb52 100644 --- a/ModuleUtil/src/main/java/org/avmdti/josast/demarage/ImageIntroduction.java +++ b/ModuleUtil/src/main/java/org/avmdti/josast/demarage/ImageIntroduction.java @@ -9,17 +9,15 @@ import java.awt.Window; import java.util.logging.Level; import java.util.logging.Logger; - - /* - * + * * Description : - * - * + * + * *

    Projet : JCP
    - * + * *
    - * JOSAST : Java Open Source Amateur Satellite Toolbox + * JOSAST : Java Open Source Amateur Satellite Toolbox *
    The aim of the project is to create a set of tools for amateur satellite purpose. All this tools could be used together to create specific software. * JOSAST project is managed by AVMDTI (http://www.avmdti.org ) *
    This software is an open source software. Please read the JOSAST licence
    (http://www.avmdti.org ) @@ -28,108 +26,107 @@ import java.util.logging.Logger; * @version 1.0 *

    date 23 avr. 2003

    *

    Source Update

    - *
    date : name : comments + *
    date : name : comments *
    V1 : mercier : create file *

    - * + * */ /** - * Display a windows. - *
    - * @author XTOPHE - * @version 1.0 + * Display a windows.
    + * + * @author XTOPHE + * @version 1.0 */ public class ImageIntroduction extends Container { - private Logger log = Logger.getLogger("AmsatLogger"); - private static final long serialVersionUID = -3692619926235822726L; - private Image image; - private int iw, ih; - /** - * Constructor for ImageIntroduction. - * @param Filename : nom du fichier image - */ - public ImageIntroduction(String Filename) { - image = getToolkit().getImage(Filename); - MediaTracker mt = new MediaTracker(this); - mt.addImage(image, 0); - try { - mt.waitForID(0); - } catch (InterruptedException e) { - log.log(Level.SEVERE,"error to load the image"); - } - iw = image.getWidth(this); - ih = image.getHeight(this); - if (iw < 0 || ih < 0) { - log.log(Level.SEVERE,"image size null"); - image=null; - } - - } + private Logger log = Logger.getLogger("AmsatLogger"); + private static final long serialVersionUID = -3692619926235822726L; + private Image image; + private int iw, ih; + /** + * Constructor for ImageIntroduction. + * + * @param Filename : nom du fichier image + */ + public ImageIntroduction(String Filename) { + image = getToolkit().getImage(Filename); + MediaTracker mt = new MediaTracker(this); + mt.addImage(image, 0); + try { + mt.waitForID(0); + } catch (InterruptedException e) { + log.log(Level.SEVERE, "error to load the image"); + } + iw = image.getWidth(this); + ih = image.getHeight(this); + if (iw < 0 || ih < 0) { + log.log(Level.SEVERE, "image size null"); + image = null; + } + } - /** (non-Javadoc) - * @see java.awt.Container#paint(java.awt.Graphics) - */ - public void paint(Graphics g) { + /** + * (non-Javadoc) + * + * @see java.awt.Container#paint(java.awt.Graphics) + */ + public void paint(Graphics g) { - if (image == null) { - log.log(Level.SEVERE,"image is not loaded"); - return; - } + if (image == null) { + log.log(Level.SEVERE, "image is not loaded"); + return; + } - g.drawImage(image, 0, 0, this); - } + g.drawImage(image, 0, 0, this); + } - /** - * Rescale the image to the argument value. - * - * @param width - * @param height - */ - public void setscale(int width, int height) { - if (image != null) - { - Image imagescale = - image.getScaledInstance(width, height, Image.SCALE_DEFAULT); - image = imagescale; - do { - iw = image.getWidth(this); - ih = image.getHeight(this); - } while (iw < 0); - } - } + /** + * Rescale the image to the argument value. + * + * @param width + * @param height + */ + public void setscale(int width, int height) { + if (image != null) { + Image imagescale = image.getScaledInstance(width, height, Image.SCALE_DEFAULT); + image = imagescale; + do { + iw = image.getWidth(this); + ih = image.getHeight(this); + } while (iw < 0); + } + } - /** - * Returns the height. - * @return int - */ - public int getIh() { - return ih; - } + /** + * Returns the height. + * + * @return int + */ + public int getIh() { + return ih; + } - /** - * Returns the width. - * @return int - */ - public int getIw() { - return iw; - } - - - /** - * Demonstrate the usage of this class - *
    - * usage : ImageIntroduction filename - *
    - * @param args image filename - */ - public static void main(String[] args) { - ImageIntroduction im = new ImageIntroduction(args[0]); - Window w = new Window(new Frame()); - w.add(im); - w.setSize(im.getIw(), im.getIh()); - w.setVisible(true); + /** + * Returns the width. + * + * @return int + */ + public int getIw() { + return iw; + } - } + /** + * Demonstrate the usage of this class
    + * usage : ImageIntroduction filename
    + * + * @param args image filename + */ + public static void main(String[] args) { + ImageIntroduction im = new ImageIntroduction(args[0]); + Window w = new Window(new Frame()); + w.add(im); + w.setSize(im.getIw(), im.getIh()); + w.setVisible(true); + } } diff --git a/ModuleUtil/src/main/java/org/avmdti/josast/util/MathTools.java b/ModuleUtil/src/main/java/org/avmdti/josast/util/MathTools.java index b854710702cf3dacd8c2c61d43641e9137968004..cec7c2d3e95a0f7fc5277d7a2699643489e45cfa 100644 --- a/ModuleUtil/src/main/java/org/avmdti/josast/util/MathTools.java +++ b/ModuleUtil/src/main/java/org/avmdti/josast/util/MathTools.java @@ -7,153 +7,140 @@ package org.avmdti.josast.util; * @version 1.0 */ public final class MathTools { - //~ Constructors ------------------------------------------------------ - - /** - * Creates a new MathTools object. - */ - private MathTools() { - } - - //~ Methods ----------------------------------------------------------- - - /** - * set an agle between O and 2 PI. - * - * @param x angle in radian - * - * @return angle in radian between 0 and 2 PI - */ - public static double rev(final double x) { - return x - (Math.floor(x / (2 * Math.PI)) * 2 * Math.PI); - } - - /** - * Method absolute value of input value. - * - * @param value input value - * - * @return double absolute value of input value. - */ - public static double abs(final double value) { - if (value < 0) { - return -value; - } else { - return value; - } - } - - /** - * double remainder function Equivalent to the C fmod function . The - * fmod() ) function return the value x-iy, for some integer i such - * that, if y is non-zero, the result has the same sign as x and - * magnitude less than the magnitude of y. TODO : unit test - * - * @param x input value - * @param y input value - * - * @return the double remainder of x/ y. - */ - public static double fmod(final double x, final double y) { - double tmp = x / y; - double rval = x - (Math.rint(tmp) * y); - - return rval; - } - - /** - * cacul the remainder of x/ 2 PI. - * - * @param x angle in radian - * - * @return remainder of x/ 2 PI - */ - public static double fmod2p(final double x) { - double x2 = modulus(x, 2.0 * Math.PI); - - return x2; - } - - /** - * DOCUMENT ME! - * - * @param x DOCUMENT ME! - * - * @return DOCUMENT ME! - */ - public static double cube(final double x) { - double x2 = Math.pow(x, 3.0); - - return x2; - } - - /** - * DOCUMENT ME! - * - * @param x DOCUMENT ME! - * - * @return DOCUMENT ME! - */ - public static double sqr(double x) { - x *= x; - - return x; - } - - /** - * DOCUMENT ME! - * - * @param arg1 DOCUMENT ME! - * @param arg2 DOCUMENT ME! - * - * @return DOCUMENT ME! - */ - public static double modulus(final double arg1, final double arg2) { - double modu; - modu = arg1 - (Math.floor(arg1 / arg2) * arg2); - - if (modu >= 0) { - return modu; - } else { - modu += arg2; - - return modu; - } + // ~ Constructors ------------------------------------------------------ + + /** Creates a new MathTools object. */ + private MathTools() {} + + // ~ Methods ----------------------------------------------------------- + + /** + * set an agle between O and 2 PI. + * + * @param x angle in radian + * @return angle in radian between 0 and 2 PI + */ + public static double rev(final double x) { + return x - (Math.floor(x / (2 * Math.PI)) * 2 * Math.PI); + } + + /** + * Method absolute value of input value. + * + * @param value input value + * @return double absolute value of input value. + */ + public static double abs(final double value) { + if (value < 0) { + return -value; + } else { + return value; } - - /** - * DOCUMENT ME! - * - * @param x DOCUMENT ME! - * - * @return DOCUMENT ME! - */ - public static double radians(double x) { - x *= Math.PI / 180.0; - - return x; - } - - /** - * DOCUMENT ME! - * - * @param v DOCUMENT ME! - */ - public static void magnitude(VectorFourDim v) { - v.v[3] = Math.sqrt(sqr(v.v[0]) + sqr(v.v[1]) + sqr(v.v[2])); - } - - /** - * DOCUMENT ME! - * - * @param altitude DOCUMENT ME! - * - * @return DOCUMENT ME! - */ - public static double arc(double altitude) { - double altitude2 = altitude * altitude; - double t = altitude + 6367.4000; - - return Math.sqrt(altitude2 - ((altitude2 * altitude2) / (t * t))); + } + + /** + * double remainder function Equivalent to the C fmod function . The fmod() ) function return the + * value x-iy, for some integer i such that, if y is non-zero, the result has the same sign as x + * and magnitude less than the magnitude of y. TODO : unit test + * + * @param x input value + * @param y input value + * @return the double remainder of x/ y. + */ + public static double fmod(final double x, final double y) { + double tmp = x / y; + double rval = x - (Math.rint(tmp) * y); + + return rval; + } + + /** + * cacul the remainder of x/ 2 PI. + * + * @param x angle in radian + * @return remainder of x/ 2 PI + */ + public static double fmod2p(final double x) { + double x2 = modulus(x, 2.0 * Math.PI); + + return x2; + } + + /** + * DOCUMENT ME! + * + * @param x DOCUMENT ME! + * @return DOCUMENT ME! + */ + public static double cube(final double x) { + double x2 = Math.pow(x, 3.0); + + return x2; + } + + /** + * DOCUMENT ME! + * + * @param x DOCUMENT ME! + * @return DOCUMENT ME! + */ + public static double sqr(double x) { + x *= x; + + return x; + } + + /** + * DOCUMENT ME! + * + * @param arg1 DOCUMENT ME! + * @param arg2 DOCUMENT ME! + * @return DOCUMENT ME! + */ + public static double modulus(final double arg1, final double arg2) { + double modu; + modu = arg1 - (Math.floor(arg1 / arg2) * arg2); + + if (modu >= 0) { + return modu; + } else { + modu += arg2; + + return modu; } + } + + /** + * DOCUMENT ME! + * + * @param x DOCUMENT ME! + * @return DOCUMENT ME! + */ + public static double radians(double x) { + x *= Math.PI / 180.0; + + return x; + } + + /** + * DOCUMENT ME! + * + * @param v DOCUMENT ME! + */ + public static void magnitude(VectorFourDim v) { + v.v[3] = Math.sqrt(sqr(v.v[0]) + sqr(v.v[1]) + sqr(v.v[2])); + } + + /** + * DOCUMENT ME! + * + * @param altitude DOCUMENT ME! + * @return DOCUMENT ME! + */ + public static double arc(double altitude) { + double altitude2 = altitude * altitude; + double t = altitude + 6367.4000; + + return Math.sqrt(altitude2 - ((altitude2 * altitude2) / (t * t))); + } } diff --git a/ModuleUtil/src/main/java/org/avmdti/josast/util/Misc.java b/ModuleUtil/src/main/java/org/avmdti/josast/util/Misc.java index 2f9bfa28078dfc2606f55f1728a9f28745026d3d..34eb16f3f1fce2206452eca16a9e697a83d80b5c 100644 --- a/ModuleUtil/src/main/java/org/avmdti/josast/util/Misc.java +++ b/ModuleUtil/src/main/java/org/avmdti/josast/util/Misc.java @@ -1,105 +1,92 @@ /** - * - * Description : - * - * - *

    Projet : JOSAST
    - * + * Description : + * + *

    Projet : JOSAST
    *
    - * JOSAST : Java Open Source Amateur Satellite Toolbox - *
    The aim of the project is to create a set of tools for amateur satellite purpose. All this tools could be used together to create specific software. - * JOSAST project is managed by AVMDTI (http://www.avmdti.org ) - *
    This software is an open source software. Please read the JOSAST licence
    (http://www.avmdti.org ) - *

    for more information contact josast@avmdti.org

    - * @author mercier + * JOSAST : Java Open Source Amateur Satellite Toolbox
    + * The aim of the project is to create a set of tools for amateur satellite purpose. All this tools + * could be used together to create specific software. JOSAST project is managed by AVMDTI + * (http://www.avmdti.org )
    + * This software is an open source software. Please read the JOSAST licence
    + * (http://www.avmdti.org ) + * + *

    for more information contact josast@avmdti.org + * + * @author mercier * @version 1.0 - *

    Source Update

    - *
    Version : date : name : comments - *
    V1 : 2 mars 2004 : C. Mercier : create file - *

    - * + *

    Source Update
    + * Version : date : name : comments
    + * V1 : 2 mars 2004 : C. Mercier : create file + *

    */ package org.avmdti.josast.util; - /** - * * Misc Class - * + * * @author Xtophe * @version 1.0 - * */ public class Misc { - /** - * fonction utilitaire - * - */ + /** fonction utilitaire */ + private static double twopi = Math.PI * 2.0; + + /** + * Convert a longitude between -180 degree to 180 degree
    + * + * @param longitude in degree + * @return longitude in degree + */ + public static double convertlong(double longitude) { + double _longitude = longitude; + while (_longitude > 180) { + _longitude = _longitude - 360; + } + return _longitude; + } - private static double twopi = Math.PI * 2.0; + /** + * Arcos function
    + * + * @param x + * @param y + * @return + */ + public static double arccos(double x, double y) { + double result = 0.0; + double fraction = x / y; + if ((x > 0.0) && (y > 0.0)) result = Math.acos(fraction); + if ((x > 0.0) && (y > 0.0)) result = Math.acos(fraction); + if ((x < 0.0) && (y > 0.0)) result = Math.PI + Math.acos(fraction); + if ((x > 0.0) && (y < 0.0)) result = Math.PI + Math.acos(fraction); + return result; + } - /** - * Convert a longitude between -180 degree to 180 degree - *
    - * @param longitude in degree - * @return longitude in degree - */ - public static double convertlong(double longitude) { - double _longitude = longitude; - while (_longitude > 180) { - _longitude = _longitude - 360; - } - return _longitude; - } - - /** - * Arcos function - *
    - * @param x - * @param y - * @return - */ - public static double arccos(double x, double y) { - double result = 0.0; - double fraction = x / y; - if ((x > 0.0) && (y > 0.0)) - result = Math.acos(fraction); - if ((x > 0.0) && (y > 0.0)) - result = Math.acos(fraction); - if ((x < 0.0) && (y > 0.0)) - result = Math.PI + Math.acos(fraction); - if ((x > 0.0) && (y < 0.0)) - result = Math.PI + Math.acos(fraction); - return result; - } - - /** - * - * @param x in radian - * @return radian - */ - public static double fMod2p(double x) { - // double rval = Math.fmod( x, twopi); - double tmp = x / twopi; - double rval = x - Math.rint(tmp) * twopi; + /** + * @param x in radian + * @return radian + */ + public static double fMod2p(double x) { + // double rval = Math.fmod( x, twopi); + double tmp = x / twopi; + double rval = x - Math.rint(tmp) * twopi; - if (rval < 0.) - rval += twopi; - return rval; - } - /* ACTAN */ - /* We can't just use the "usual" C atan2( ) function, because the output - range we need has to run from 0 to pi instead of -pi to pi. So... */ - - /** - * We can't just use the "usual" C atan2( ) function, because the output - * range we need has to run from 0 to pi instead of -pi to pi. So... - * @param sinx - * @param cosx - * @return actan; - */ - public static double acTan(double sinx, double cosx) { - return Math.PI + Math.atan2(-sinx, -cosx); - } /*Function actan*/ + if (rval < 0.) rval += twopi; + return rval; + } + /* ACTAN */ + /* We can't just use the "usual" C atan2( ) function, because the output + range we need has to run from 0 to pi instead of -pi to pi. So... */ + /** + * We can't just use the "usual" C atan2( ) function, because the output range we need has to run + * from 0 to pi instead of -pi to pi. So... + * + * @param sinx + * @param cosx + * @return actan; + */ + public static double acTan(double sinx, double cosx) { + return Math.PI + Math.atan2(-sinx, -cosx); + } /*Function actan*/ } diff --git a/ModuleUtil/src/main/java/org/avmdti/josast/util/ParseCharArray.java b/ModuleUtil/src/main/java/org/avmdti/josast/util/ParseCharArray.java index 01c0dd15ae024b96fef637cfcb1110297b91e92a..93bc3ce9085de0898171fba6e388e21a9a0c9a90 100644 --- a/ModuleUtil/src/main/java/org/avmdti/josast/util/ParseCharArray.java +++ b/ModuleUtil/src/main/java/org/avmdti/josast/util/ParseCharArray.java @@ -14,186 +14,183 @@ package org.avmdti.josast.util; * @version 1.0 */ public class ParseCharArray { - // ~ Methods ----------------------------------------------------------- + // ~ Methods ----------------------------------------------------------- - /* - * ------------------------------------------------------------------- * - * ---------------------------- double_value ------------------------- * - * ------------------------------------------------------------------- - */ + /* + * ------------------------------------------------------------------- * + * ---------------------------- double_value ------------------------- * + * ------------------------------------------------------------------- + */ - /** - * - * @param c1 Array of char - * @param pos First caractere to convert - * @param len Lenght of the convertion - * @return - */ + /** + * @param c1 Array of char + * @param pos First caractere to convert + * @param len Lenght of the convertion + * @return + */ + public static double double_value(char c1[], int pos, int len) { + double d = 0; + int i; + int j = 0; - public static double double_value(char c1[], int pos, int len) { - double d = 0; - int i; - int j = 0; + for (i = 0; (i < len); i++) { + switch (c1[i + pos]) { + case ' ': + break; - for (i = 0; (i < len); i++) { - switch (c1[i + pos]) { - case ' ': - break; + case '0': + d *= 10; - case '0': - d *= 10; + break; - break; + case '1': + d *= 10; + d++; - case '1': - d *= 10; - d++; + break; - break; + case '2': + d *= 10; + d += 2; - case '2': - d *= 10; - d += 2; + break; - break; + case '3': + d *= 10; + d += 3; - case '3': - d *= 10; - d += 3; + break; - break; + case '4': + d *= 10; + d += 4; - case '4': - d *= 10; - d += 4; + break; - break; + case '5': + d *= 10; + d += 5; - case '5': - d *= 10; - d += 5; + break; - break; + case '6': + d *= 10; + d += 6; - case '6': - d *= 10; - d += 6; + break; - break; + case '7': + d *= 10; + d += 7; - case '7': - d *= 10; - d += 7; + break; - break; + case '8': + d *= 10; + d += 8; - case '8': - d *= 10; - d += 8; + break; - break; + case '9': + d *= 10; + d += 9; - case '9': - d *= 10; - d += 9; + break; - break; + case '.': + j = len - i - 1; - case '.': - j = len - i - 1; + break; - break; - - default: - break; - } - } - - d /= Math.pow(10.0, j); - - return d; + default: + break; + } } - /** - * - * @param c1 Array of char - * @param pos First caractere to convert - * @param len Lenght of the convertion - * @return - */ - public static int integer_value(char c1[], int pos, int len) { - int d = 0; - int i; + d /= Math.pow(10.0, j); - for (i = 0; (i < len); i++) { - switch (c1[i + pos]) { - case ' ': - break; + return d; + } - case '0': - d *= 10; + /** + * @param c1 Array of char + * @param pos First caractere to convert + * @param len Lenght of the convertion + * @return + */ + public static int integer_value(char c1[], int pos, int len) { + int d = 0; + int i; - break; + for (i = 0; (i < len); i++) { + switch (c1[i + pos]) { + case ' ': + break; - case '1': - d *= 10; - d++; + case '0': + d *= 10; - break; + break; - case '2': - d *= 10; - d += 2; + case '1': + d *= 10; + d++; - break; + break; - case '3': - d *= 10; - d += 3; + case '2': + d *= 10; + d += 2; - break; + break; - case '4': - d *= 10; - d += 4; + case '3': + d *= 10; + d += 3; - break; + break; - case '5': - d *= 10; - d += 5; + case '4': + d *= 10; + d += 4; - break; + break; - case '6': - d *= 10; - d += 6; + case '5': + d *= 10; + d += 5; - break; + break; - case '7': - d *= 10; - d += 7; + case '6': + d *= 10; + d += 6; - break; + break; - case '8': - d *= 10; - d += 8; + case '7': + d *= 10; + d += 7; - break; + break; - case '9': - d *= 10; - d += 9; + case '8': + d *= 10; + d += 8; - break; + break; - default: - break; - } - } + case '9': + d *= 10; + d += 9; - return d; + break; + + default: + break; + } } + + return d; + } } diff --git a/ModuleUtil/src/main/java/org/avmdti/josast/util/StringtoByte.java b/ModuleUtil/src/main/java/org/avmdti/josast/util/StringtoByte.java index 60659c8306dfc3c9641e3371dcbc1a2bc08b66b8..56723f919e1b1cd8ee83e532b7bed78c2891679d 100644 --- a/ModuleUtil/src/main/java/org/avmdti/josast/util/StringtoByte.java +++ b/ModuleUtil/src/main/java/org/avmdti/josast/util/StringtoByte.java @@ -1,30 +1,30 @@ - /** - * Convert String in hexadecimal to byte + * Convert String in hexadecimal to byte + * * @version 1.0 */ package org.avmdti.josast.util; public class StringtoByte { - static final byte ZERO = new String("0").getBytes()[0]; + static final byte ZERO = new String("0").getBytes()[0]; - static public byte convert(String S) { + public static byte convert(String S) { - byte[] tmp = S.getBytes(); - byte v1 = (byte) (tmp[0] - ZERO); - byte v2 = (byte) (tmp[1] - ZERO); - byte res = (byte) (v1 * 16 + v2); - return (res); - } + byte[] tmp = S.getBytes(); + byte v1 = (byte) (tmp[0] - ZERO); + byte v2 = (byte) (tmp[1] - ZERO); + byte res = (byte) (v1 * 16 + v2); + return (res); + } - static public byte[] hexStringToByteArray(String s) { - byte[] b = new byte[s.length() / 2]; - for (int i = 0; i < b.length; i++) { - int index = i * 2; - int v = Integer.parseInt(s.substring(index, index + 2), 16); - b[i] = (byte) v; - } - return b; + public static byte[] hexStringToByteArray(String s) { + byte[] b = new byte[s.length() / 2]; + for (int i = 0; i < b.length; i++) { + int index = i * 2; + int v = Integer.parseInt(s.substring(index, index + 2), 16); + b[i] = (byte) v; } + return b; + } } diff --git a/ModuleUtil/src/main/java/org/avmdti/josast/util/VectorFourDim.java b/ModuleUtil/src/main/java/org/avmdti/josast/util/VectorFourDim.java index fe4964d3357429c117651d4bf96f026ac0ef6b64..03c34e9819ab8248569d835d3b52042ea3e97a9e 100644 --- a/ModuleUtil/src/main/java/org/avmdti/josast/util/VectorFourDim.java +++ b/ModuleUtil/src/main/java/org/avmdti/josast/util/VectorFourDim.java @@ -1,88 +1,86 @@ package org.avmdti.josast.util; /** - * Utility class for Vector. This vector is a four dimensional vector - * used for rectangular coordinate This vector contains : 3-dimensional - * vector, the fourth element contains the magnitude. + * Utility class for Vector. This vector is a four dimensional vector used for rectangular + * coordinate This vector contains : 3-dimensional vector, the fourth element contains the + * magnitude. * * @author Xtophe * @version 1.0 */ public class VectorFourDim { - //~ Static fields/initializers ---------------------------------------- + // ~ Static fields/initializers ---------------------------------------- - /* - */ + /* + */ - /** X dimension. */ - public static final int X = 0; + /** X dimension. */ + public static final int X = 0; - /** Y dimension. */ - public static final int Y = 1; + /** Y dimension. */ + public static final int Y = 1; - /** Z dimension. */ - public static final int Z = 2; + /** Z dimension. */ + public static final int Z = 2; - /** magnitude. */ - public static final int M = 3; + /** magnitude. */ + public static final int M = 3; - //~ Instance fields --------------------------------------------------- + // ~ Instance fields --------------------------------------------------- - /** array for the vector. TODO : set to private */ - public double v[] = new double[4]; + /** array for the vector. TODO : set to private */ + public double v[] = new double[4]; - //~ Constructors ------------------------------------------------------ + // ~ Constructors ------------------------------------------------------ - /** - * Creates a new VectorFourDim object. - * - * @param x2 X value - * @param y2 Y value - * @param z2 z value - * @param w magnitude - */ - public VectorFourDim(double x2, double y2, double z2, double w) { - v[X] = x2; - v[Y] = y2; - v[Z] = z2; - v[M] = w; - } + /** + * Creates a new VectorFourDim object. + * + * @param x2 X value + * @param y2 Y value + * @param z2 z value + * @param w magnitude + */ + public VectorFourDim(double x2, double y2, double z2, double w) { + v[X] = x2; + v[Y] = y2; + v[Z] = z2; + v[M] = w; + } - /** - * Creates a new VectorFourDim object. Magnitude is set to 0. - * - * @param d X value - * @param e Y value - * @param f Z value - */ - public VectorFourDim(double d, double e, double f) { - v[X] = d; - v[Y] = e; - v[Z] = f; - v[M] = 0; - } + /** + * Creates a new VectorFourDim object. Magnitude is set to 0. + * + * @param d X value + * @param e Y value + * @param f Z value + */ + public VectorFourDim(double d, double e, double f) { + v[X] = d; + v[Y] = e; + v[Z] = f; + v[M] = 0; + } - /** - * Creates a new VectorFourDim object. All value is set to 0. - */ - public VectorFourDim() { - v[X] = 0; - v[Y] = 0; - v[Z] = 0; - v[M] = 0; - } + /** Creates a new VectorFourDim object. All value is set to 0. */ + public VectorFourDim() { + v[X] = 0; + v[Y] = 0; + v[Z] = 0; + v[M] = 0; + } - //~ Methods ----------------------------------------------------------- + // ~ Methods ----------------------------------------------------------- - /** - * multiply the vector by a value. - * - * @param factor factor for the multiplication - */ - public void mul(final double factor) { - v[X] *= factor; - v[Y] *= factor; - v[Z] *= factor; - v[M] *= Math.abs(factor); - } + /** + * multiply the vector by a value. + * + * @param factor factor for the multiplication + */ + public void mul(final double factor) { + v[X] *= factor; + v[Y] *= factor; + v[Z] *= factor; + v[M] *= Math.abs(factor); + } } diff --git a/ModuleUtil/src/main/java/org/avmdti/josast/util/mathematique/CoordGeo.java b/ModuleUtil/src/main/java/org/avmdti/josast/util/mathematique/CoordGeo.java index 0fa1f0711dfc642364e01171da14d8c09fab9105..fc3d1424ee7ced2b8a893e179dcd30dcffbc4a60 100644 --- a/ModuleUtil/src/main/java/org/avmdti/josast/util/mathematique/CoordGeo.java +++ b/ModuleUtil/src/main/java/org/avmdti/josast/util/mathematique/CoordGeo.java @@ -7,89 +7,73 @@ package org.avmdti.josast.util.mathematique; /** - * - * * @author Xtophe * @version 1.0 - * - * */ public class CoordGeo { - /** - * @param lat latitude in radian - * @param lon longitude in radian - * @param alt altitude in kilometers - */ - public CoordGeo(double lat, double lon, double alt) { - latitude = lat; - longitude =lon; - altitude = alt; - - } - - public CoordGeo() { - latitude = 0.0; - longitude = 0.0; - altitude = 0.0; + /** + * @param lat latitude in radian + * @param lon longitude in radian + * @param alt altitude in kilometers + */ + public CoordGeo(double lat, double lon, double alt) { + latitude = lat; + longitude = lon; + altitude = alt; + } - } - - private double latitude; - private double longitude; - private double altitude; - - -/** - * the format is "Lat = xx Lon = yy Alt = zz.zz - * lat and lon in degree - * - * @see java.lang.Object#toString() - */ -public String toString() -{ - return ("Lat = "+ Math.toDegrees(latitude)+" Lon = "+Math.toDegrees(longitude) + " Alt = "+altitude); -} + public CoordGeo() { + latitude = 0.0; + longitude = 0.0; + altitude = 0.0; + } -/** - * @return latitude - */ -public double getLatitude() { - return latitude; -} + private double latitude; + private double longitude; + private double altitude; -/** - * @param latitude - */ -public void setLatitude(double latitude) { - this.latitude = latitude; -} + /** + * the format is "Lat = xx Lon = yy Alt = zz.zz lat and lon in degree + * + * @see java.lang.Object#toString() + */ + public String toString() { + return ("Lat = " + + Math.toDegrees(latitude) + + " Lon = " + + Math.toDegrees(longitude) + + " Alt = " + + altitude); + } -/** - * @return longitude - */ -public double getLongitude() { - return longitude; -} + /** @return latitude */ + public double getLatitude() { + return latitude; + } -/** - * @param longitude - */ -public void setLongitude(double longitude) { - this.longitude = longitude; -} + /** @param latitude */ + public void setLatitude(double latitude) { + this.latitude = latitude; + } -/** - * @return altitude - */ -public double getAltitude() { - return altitude; -} + /** @return longitude */ + public double getLongitude() { + return longitude; + } -/** - * @param altitude - */ -public void setAltitude(double altitude) { - this.altitude = altitude; -} + /** @param longitude */ + public void setLongitude(double longitude) { + this.longitude = longitude; + } + + /** @return altitude */ + public double getAltitude() { + return altitude; + } + + /** @param altitude */ + public void setAltitude(double altitude) { + this.altitude = altitude; + } } diff --git a/ModuleUtil/src/main/java/org/avmdti/josast/util/mathematique/CoordTopo.java b/ModuleUtil/src/main/java/org/avmdti/josast/util/mathematique/CoordTopo.java index 6196cf4b9f2654ceba787ce847026b983dbd0875..569affba56b9d184c260c723c96658f9e45252ac 100644 --- a/ModuleUtil/src/main/java/org/avmdti/josast/util/mathematique/CoordTopo.java +++ b/ModuleUtil/src/main/java/org/avmdti/josast/util/mathematique/CoordTopo.java @@ -1,88 +1,73 @@ - package org.avmdti.josast.util.mathematique; /** - * * @author Xtophe * @version 1.0 */ public class CoordTopo { - private double azimuth; - - private double elevation; - - private double Range; - - private double RangeRate; - - /** - * @param azimuth - * @param elevation - * @param range - * @param rangeRate - */ - public CoordTopo(double az, double el, double range, double rangeRate) { - super(); - azimuth = az; - elevation = el; - Range = range; - RangeRate = rangeRate; - } - - public CoordTopo() { - azimuth = 0.0; - elevation = 0.0; - Range = 0.0; - RangeRate = 0.0; - - } - - - - public double getAzimuth() { - return azimuth; - } - - public void setAzimuth(double azimuth) { - this.azimuth = azimuth; - } - - public double getElevation() { - return elevation; - } - - public void setElevation(double elevation) { - this.elevation = elevation; - } - - /** - * @return Returns the range. - */ - public double getRange() { - return Range; - } - - /** - * @param range - * The range to set. - */ - public void setRange(double range) { - Range = range; - } - - /** - * @return Returns the rangeRate. - */ - public double getRangeRate() { - return RangeRate; - } - - /** - * @param rangeRate - * The rangeRate to set. - */ - public void setRangeRate(double rangeRate) { - RangeRate = rangeRate; - } -} \ No newline at end of file + private double azimuth; + + private double elevation; + + private double Range; + + private double RangeRate; + + /** + * @param azimuth + * @param elevation + * @param range + * @param rangeRate + */ + public CoordTopo(double az, double el, double range, double rangeRate) { + super(); + azimuth = az; + elevation = el; + Range = range; + RangeRate = rangeRate; + } + + public CoordTopo() { + azimuth = 0.0; + elevation = 0.0; + Range = 0.0; + RangeRate = 0.0; + } + + public double getAzimuth() { + return azimuth; + } + + public void setAzimuth(double azimuth) { + this.azimuth = azimuth; + } + + public double getElevation() { + return elevation; + } + + public void setElevation(double elevation) { + this.elevation = elevation; + } + + /** @return Returns the range. */ + public double getRange() { + return Range; + } + + /** @param range The range to set. */ + public void setRange(double range) { + Range = range; + } + + /** @return Returns the rangeRate. */ + public double getRangeRate() { + return RangeRate; + } + + /** @param rangeRate The rangeRate to set. */ + public void setRangeRate(double rangeRate) { + RangeRate = rangeRate; + } +} diff --git a/ModuleUtil/src/main/java/org/avmdti/josast/util/mathematique/Mathematique.java b/ModuleUtil/src/main/java/org/avmdti/josast/util/mathematique/Mathematique.java index 3190abffdd3d384bc504e66bcf54d2cf11e14930..427383bf53ce205f848ed4c4a95bfc26defa88b2 100644 --- a/ModuleUtil/src/main/java/org/avmdti/josast/util/mathematique/Mathematique.java +++ b/ModuleUtil/src/main/java/org/avmdti/josast/util/mathematique/Mathematique.java @@ -3,103 +3,101 @@ package org.avmdti.josast.util.mathematique; import org.avmdti.josast.util.VectorFourDim; public class Mathematique { - /* - * sgp_math.c -- a part of the SGP - C Library - * - * Copyright (c) 2001-2002 Dominik Brodowski (c) 1992-2000 Dr TS Kelso - * - * This file is part of the SGP C Library. - * - * This library is free software; you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation; either version 2.1 of the License, or (at - * your option) any later version. - * - * This library is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser - * General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this library; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * This SGP C Library is based on the SGP4 Pascal Library by Dr TS Kelso. - * - * You can reach Dominik Brodowski by electronic mail at devel@brodo.de and - * by paper mail at Hoehbergstrasse 4; 72074 Tuebingen; Germany - */ + /* + * sgp_math.c -- a part of the SGP - C Library + * + * Copyright (c) 2001-2002 Dominik Brodowski (c) 1992-2000 Dr TS Kelso + * + * This file is part of the SGP C Library. + * + * This library is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation; either version 2.1 of the License, or (at + * your option) any later version. + * + * This library is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser + * General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this library; if not, write to the Free Software Foundation, + * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * This SGP C Library is based on the SGP4 Pascal Library by Dr TS Kelso. + * + * You can reach Dominik Brodowski by electronic mail at devel@brodo.de and + * by paper mail at Hoehbergstrasse 4; 72074 Tuebingen; Germany + */ - /*************************************************************************** - * ------------------------------------------------------------------- - * -------------------------------- cube ----------------------------- * - * ------------------------------------------------------------------- - */ + /** + * ************************************************************************* + * ------------------------------------------------------------------- + * -------------------------------- cube ----------------------------- * + * ------------------------------------------------------------------- + */ + public static double cube(double x) { + x = Math.pow(x, 3.0); + return x; + } - public static double cube(double x) { - x = Math.pow(x, 3.0); - return x; - } + /** + * ************************************************************************* + * ------------------------------------------------------------------- + * --------------------------------- sqr ---------------------------- * + * ------------------------------------------------------------------- + */ + public static double sqr(double x) { + x *= x; + return x; + } - /*************************************************************************** - * ------------------------------------------------------------------- - * --------------------------------- sqr ---------------------------- * - * ------------------------------------------------------------------- - */ + /** + * ************************************************************************* + * ------------------------------------------------------------------- + * ------------------------------ modulus ---------------------------- * + * ------------------------------------------------------------------- + */ + public static double modulus(double arg1, double arg2) { + double modu; + modu = arg1 - Math.floor(arg1 / arg2) * arg2; + if (modu >= 0) return modu; + else { + modu += arg2; + return modu; + } + // return -1; /* shouldn't happen */ + } - public static double sqr(double x) { - x *= x; - return x; - } + /** + * ************************************************************************* + * ------------------------------------------------------------------- + * ------------------------------- fmod2p ---------------------------- * + * ------------------------------------------------------------------- + */ + public static double fmod2p(double x) { + x = modulus(x, 2.0 * Math.PI); + return x; + } - /*************************************************************************** - * ------------------------------------------------------------------- - * ------------------------------ modulus ---------------------------- * - * ------------------------------------------------------------------- - */ + /** + * ************************************************************************* + * ------------------------------------------------------------------- + * ------------------------------- radians --------------------------- * + * ------------------------------------------------------------------- + */ + public static double radians(double x) { + x *= Math.PI / 180.0; + return x; + } - public static double modulus(double arg1, double arg2) { - double modu; - modu = arg1 - Math.floor(arg1 / arg2) * arg2; - if (modu >= 0) - return modu; - else { - modu += arg2; - return modu; - } - // return -1; /* shouldn't happen */ - } - - /*************************************************************************** - * ------------------------------------------------------------------- - * ------------------------------- fmod2p ---------------------------- * - * ------------------------------------------------------------------- - */ - - public static double fmod2p(double x) { - x = modulus(x, 2.0 * Math.PI); - return x; - } - - /*************************************************************************** - * ------------------------------------------------------------------- - * ------------------------------- radians --------------------------- * - * ------------------------------------------------------------------- - */ - - public static double radians(double x) { - x *= Math.PI / 180.0; - return x; - } - - /*************************************************************************** - * ------------------------------------------------------------------- - * ------------------------------ Magnitude -------------------------- * - * ------------------------------------------------------------------- - */ - - public static void magnitude(VectorFourDim v) { - v.v[3] = Math.sqrt(sqr(v.v[0]) + sqr(v.v[1]) + sqr(v.v[2])); - } - -} \ No newline at end of file + /** + * ************************************************************************* + * ------------------------------------------------------------------- + * ------------------------------ Magnitude -------------------------- * + * ------------------------------------------------------------------- + */ + public static void magnitude(VectorFourDim v) { + v.v[3] = Math.sqrt(sqr(v.v[0]) + sqr(v.v[1]) + sqr(v.v[2])); + } +} diff --git a/pom.xml b/pom.xml index 6452ad6a3a0c5a13817e4e19f70b1322d759fa7c..161a43d252a0793b0ef33b3d7a6a63d7c15d8e91 100644 --- a/pom.xml +++ b/pom.xml @@ -217,6 +217,12 @@ maven-checkstyle-plugin ${plugin.checkstyle.version} + + + google_checks.xml + + + @@ -241,7 +247,7 @@ false - + true @@ -723,6 +729,30 @@ + + + + com.coveo + fmt-maven-plugin + 2.9.1 + + src/main/java + src/test/java + false + .*\.java + false + false + + + + + + check + + + + +