diff --git a/ApplicationAmicalsat/pom.xml b/ApplicationAmicalsat/pom.xml
new file mode 100644
index 0000000000000000000000000000000000000000..8cab05644accf3d2f6cd89e29455f45b3f3b1668
--- /dev/null
+++ b/ApplicationAmicalsat/pom.xml
@@ -0,0 +1,78 @@
+
+ 4.0.0
+ org.josast
+ ApplicationAmicalsat
+ 0.0.1-SNAPSHOT
+
+ UTF-8
+ 11
+ 11
+
+
+ 0.0.2-SNAPSHOT
+ 0.2
+ 1.0-SNAPSHOT
+
+
+
+ org.openjfx
+ javafx-controls
+ 13
+
+
+ org.openjfx
+ javafx-fxml
+ 13
+
+
+
+ org.openjfx
+ javafx-swing
+ 11-ea+24
+
+
+
+
+ org.josast
+ ModuleSIDS
+ 0.0.1-SNAPSHOT
+
+
+ org.josast
+ ModuleSoundModem
+ ${ModuleSoundModem.version}
+
+
+ org.josast
+ ModuleConfig
+ ${ModuleConfig.version}
+
+
+ org.josast
+ ModuleAmicalsat
+ ${ModuleAmicalsat.version}
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-compiler-plugin
+ 3.8.0
+
+ 11
+
+
+
+ org.openjfx
+ javafx-maven-plugin
+ 0.0.4
+
+ org.josast.ApplicationAmicalsat.App
+
+
+
+
+
\ No newline at end of file
diff --git a/ApplicationAmicalsat/src/main/java/org/josast/ApplicationAmicalsat/App.java b/ApplicationAmicalsat/src/main/java/org/josast/ApplicationAmicalsat/App.java
new file mode 100644
index 0000000000000000000000000000000000000000..7ddecd24b05ea1e1297f768a3c82d24047af9956
--- /dev/null
+++ b/ApplicationAmicalsat/src/main/java/org/josast/ApplicationAmicalsat/App.java
@@ -0,0 +1,80 @@
+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.Logger;
+
+
+
+/**
+ * JavaFX App
+ */
+public class App extends Application {
+
+ private static Scene scene;
+ private static FXMLLoader fxmlLoader;
+ Logger logger = Logger.getLogger("EntrySatLogger");
+
+ @Override
+ public void start(Stage stage) throws IOException {
+ 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+"/"+"EntrySatLog.txt");
+
+ logger.addHandler(fh);
+
+ } catch (SecurityException e) {
+
+ e.printStackTrace();
+
+ } catch (IOException e) {
+
+ e.printStackTrace();
+
+ }
+ System.setProperty("glass.accessible.force", "false");
+ scene = new Scene(loadFXML("Amicalsat"), 640, 480);
+ stage.setScene(scene);
+
+ Controler ctrl = fxmlLoader.getController();
+ ctrl.setPrimaryStage(stage);
+ scene.getStylesheets().add("/BasicApplication.css");
+ // stage.setScene(scene);
+ 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) {
+ launch();
+ }
+
+}
\ No newline at end of file
diff --git a/ApplicationAmicalsat/src/main/java/org/josast/ApplicationAmicalsat/Configuration.java b/ApplicationAmicalsat/src/main/java/org/josast/ApplicationAmicalsat/Configuration.java
new file mode 100644
index 0000000000000000000000000000000000000000..bf4dd257f24149ebb65adb8b64e74d5f924931fd
--- /dev/null
+++ b/ApplicationAmicalsat/src/main/java/org/josast/ApplicationAmicalsat/Configuration.java
@@ -0,0 +1,235 @@
+/**
+ *
+ */
+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.
+ * @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 SIDSEntrySatSource="Anonymous";
+ private String SIDSEntryUrl="https://amsat.electrolab.fr/SIDS";
+ private String SIDSSatnogsSource="Anonymous";
+ private String SIDSSatnogsURL="https://db.satnogs.org/api/telemetry/";
+ private String SIDSSatnogs="0";
+ private String SIDSEntrySat="1";
+ private int Norad=99990; // default value - equivalent to satnogs
+ private boolean SISD_SatNogs = false;
+ private boolean SIDS_EntrySat = true;
+
+
+ private CONFIG conf = CONFIG.getInstance();
+
+ public static Configuration getInstance()
+ {
+ return SingletonHolder.instance;
+ }
+
+ public boolean isSISD_SatNogs() {
+
+ return SISD_SatNogs;
+ }
+
+ public boolean isSIDS_EntrySat() {
+ return SIDS_EntrySat;
+ }
+
+ private Configuration()
+ {
+ if ( conf.GetProperty("Callsign")!=null)
+ {
+ callsign = conf.GetProperty("Callsign");
+ latitude = conf.GetProperty("Latitude");
+ longitude = conf.GetProperty("Longitude");
+
+ SIDSEntrySatSource=conf.GetProperty("SIDSEntrySatSource");
+ SIDSEntryUrl=conf.GetProperty("SIDSEntryUrl");
+ SIDSSatnogsSource=conf.GetProperty("SIDSSatnogsSource");
+ SIDSSatnogsURL=conf.GetProperty("SIDSSatnogsURL");
+ SIDSSatnogs=conf.GetProperty("SIDSSatnogs");
+ SIDSEntrySat=conf.GetProperty("SIDSEntrySat");
+ 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 (SIDSEntrySat.contentEquals("1") )
+ {
+ SIDS_EntrySat=true;
+ } else
+ {
+ SIDS_EntrySat=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 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 getSIDSEntrySatSource() {
+ return SIDSEntrySatSource;
+ }
+
+ public void setSIDSEntrySatSource(String sIDSEntrySatSource) {
+ SIDSEntrySatSource = sIDSEntrySatSource;
+ }
+
+ public String getSIDSEntryUrl() {
+ return SIDSEntryUrl;
+ }
+
+ public void setSIDSEntryUrl(String sIDSEntryUrl) {
+ SIDSEntryUrl = sIDSEntryUrl;
+ }
+
+ 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 String getSIDSSatnogs() {
+ return SIDSSatnogs;
+ }
+
+ public void setSIDSSatnogs(String sIDSSatnogs) {
+ SIDSSatnogs = sIDSSatnogs;
+ if (SIDSSatnogs.contentEquals("1") )
+ {
+ SISD_SatNogs=true;
+ } else
+ {
+ SISD_SatNogs=false;
+ }
+ }
+
+ public String getSIDSEntrySat() {
+ return SIDSEntrySat;
+ }
+
+ public void setSIDSEntrySat(String sIDSEntrySat) {
+ SIDSEntrySat = sIDSEntrySat;
+ if (SIDSEntrySat.contentEquals("1") )
+ {
+ SIDS_EntrySat=true;
+ } else
+ {
+ SIDS_EntrySat=false;
+ }
+ }
+
+ 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 void save() {
+
+ conf.SetProperty("Callsign",callsign);
+ conf.SetProperty("Latitude",latitude);
+ conf.SetProperty("Longitude",longitude);
+
+ conf.SetProperty("SIDSEntrySatSource",this.SIDSEntrySatSource);
+ conf.SetProperty("SIDSEntryUrl",this.SIDSEntryUrl);
+ conf.SetProperty("SIDSSatnogsSource",this.SIDSSatnogsSource);
+ conf.SetProperty("SIDSSatnogsURL",this.SIDSSatnogsURL);
+ conf.SetProperty("SIDSSatnogs",this.SIDSSatnogs);
+ conf.SetProperty("SIDSEntrySat",this.SIDSEntrySat);
+ conf.SetProperty("soundModemPort",this.soundModemPort);
+ conf.SetProperty("soundModemIP",this.soundModemIP);
+ conf.SetProperty("NoradID",""+this.Norad);
+ }
+
+ public int getNorad() {
+
+ return Norad;
+ }
+
+ public void setNorad(int norad) {
+
+ Norad=norad;
+ }
+
+}
diff --git a/ApplicationAmicalsat/src/main/java/org/josast/ApplicationAmicalsat/Controler.java b/ApplicationAmicalsat/src/main/java/org/josast/ApplicationAmicalsat/Controler.java
new file mode 100644
index 0000000000000000000000000000000000000000..8a9450ccf3dfc17a4ef2c06e5eb51a770e689574
--- /dev/null
+++ b/ApplicationAmicalsat/src/main/java/org/josast/ApplicationAmicalsat/Controler.java
@@ -0,0 +1,529 @@
+package org.josast.ApplicationAmicalsat;
+
+import java.awt.image.BufferedImage;
+import java.beans.PropertyChangeEvent;
+import java.beans.PropertyChangeListener;
+import java.io.File;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.io.PrintWriter;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+import java.util.logging.Logger;
+
+import javax.imageio.ImageIO;
+
+import org.josast.ApplicationAmicalsat.util.LogFile;
+import org.josast.ModuleSoundModem.SoundModemConfiguration;
+import org.josast.SIDS.Station;
+import org.josast.amicalsat.Frame;
+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 Logger appLogger = Logger.getLogger("AmicalSatLogger");
+ private String version = "0.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
+ TextField TextFieldSIDSEntrysat;
+ @FXML
+ TextField TextFieldSIDSSatnogs;
+
+ 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 SendSIDSEntrysat;
+ private PrintWriter pw;
+ 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.setSIDSEntrySatSource(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.getSIDSEntrySatSource(), station.getLongitude(), station.getLatitude());
+
+ if (CheckbBoxAmicalSat.isSelected() == true) {
+ conf.setSIDSEntrySat("1");
+ SendSIDSEntrysat = new SendSIDS(StationEntry, conf.getNorad(), conf.getSIDSEntryUrl());
+ } else {
+ conf.setSIDSEntrySat("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();
+ if (conf.isSIDS_EntrySat()) {
+ // Generation SIDS
+ }
+ Platform.runLater(new Runnable() {
+ @Override
+ public void run() {
+ try {
+
+ if (decodedData != null) {
+ displayLog(decodedData.toStringHeader());
+ displayLog(decodedData.toString());
+ updateFrame(receivedFrame.getNumberFrame());
+
+ } 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");
+ saveDataFile();
+ manageStatusinformation("Data Saved","Telemetry Data saved in file");
+ }
+
+
+
+ @FXML
+ private void HandleIP(ActionEvent event) {
+ }
+
+ @FXML
+ private void HandlePort(ActionEvent event) {
+ }
+
+
+
+ public void initMMI() {
+
+
+ logfile = new LogFile();
+ // initialise le log
+ // initdisplayLogFile();
+
+ manageStatusinformation("Initialised","ENTRY SAT - 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.getSIDSEntrySatSource());
+ TextFieldSIDSSatnogs.setText(conf.getSIDSSatnogsSource());
+
+
+ if (conf.isSIDS_EntrySat()) {
+ CheckbBoxAmicalSat.setSelected(true);
+ }
+ if (conf.isSISD_SatNogs()) {
+ CheckBoxSatNogs.setSelected(true);
+ }
+
+ displayLog(conf.getSIDSSatnogsURL());
+ displayLog(conf.getSIDSEntryUrl());
+ 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");
+ NoradIdConf= Integer.parseUnsignedInt(c.GetProperty("NoradID").trim());
+ }
+ else
+ {
+ ver = version;
+ message = "not connected to internet";
+ }
+ 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.getSIDSEntrySatSource(), station.getLongitude(), station.getLatitude());
+
+ if (conf.isSISD_SatNogs() == true) {
+ SendSIDSSatnogs = new SendSIDS(StationSatnogs, conf.getNorad(), conf.getSIDSSatnogsURL());
+ }
+
+ if (conf.isSIDS_EntrySat() == true) {
+ SendSIDSEntrysat = new SendSIDS(StationEntry, conf.getNorad(), conf.getSIDSEntryUrl());
+ }
+
+ String erreurmsg = message;
+
+ if (ver.equals(version) == false) {
+ erreurmsg += " New version " + ver + " available ! ";
+
+ }
+ this.LabelInformation.setText(erreurmsg);
+
+ }
+
+ public void setPrimaryStage(Stage primaryStage) {
+ this.primaryStage = primaryStage;
+
+ }
+
+
+ /**
+ * 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();
+
+ //
+
+ 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.getFrame(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) {
+
+ 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;
+
+
+ }
+ }
+
+ private void manageStatusinformation(String statusMessage, String logMessage) {
+ labelStatus.setText(statusMessage);
+ displayLog(logMessage);
+
+ }
+
+}
diff --git a/ApplicationAmicalsat/src/main/java/org/josast/ApplicationAmicalsat/ModelReceivedData.java b/ApplicationAmicalsat/src/main/java/org/josast/ApplicationAmicalsat/ModelReceivedData.java
new file mode 100644
index 0000000000000000000000000000000000000000..79ee371740e2ccf37ff39500d1aebf9e69963ed3
--- /dev/null
+++ b/ApplicationAmicalsat/src/main/java/org/josast/ApplicationAmicalsat/ModelReceivedData.java
@@ -0,0 +1,87 @@
+package org.josast.ApplicationAmicalsat;
+
+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 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 long getNumberFrame() {
+ return numberFrame;
+ }
+
+ public ReceivedData getLastReceivedData() {
+ return vecRawData.lastElement();
+ }
+
+ public Frame getLastDecodedData() {
+ return vecDecodedData.lastElement();
+ }
+
+
+
+ @Deprecated
+ public void addFrame(int size, byte[] data) {
+// long oldNumberFrame = numberFrame;
+// numberFrame++;
+// try {
+// // try to decode
+// FrameTlmEntrySat frame = new FrameTlmEntrySat(new ByteBufferKaitaiStream (cbuf) );
+// Ax25Frame ax = frame.frameTlmEntrySat();
+// // System.out.println(ax.ax25Header().srcCallsignRaw().srcCallsignRor().srcCallsign());
+// vect.addElement(frame);
+// EntryFrame EntryFrame = new EntryFrame(new Date(), new KissData(cbuf, nb));
+// vecKiss.addElement(EntryFrame);
+//
+//
+// } catch (Exception e)
+// {
+// e.printStackTrace();
+// }
+
+ }
+
+ 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);
+
+ }
+
+
+
+}
diff --git a/ApplicationAmicalsat/src/main/java/org/josast/ApplicationAmicalsat/ReceivedData.java b/ApplicationAmicalsat/src/main/java/org/josast/ApplicationAmicalsat/ReceivedData.java
new file mode 100644
index 0000000000000000000000000000000000000000..c7b81fc93ddb5444c2244e65c5a6a959303290d2
--- /dev/null
+++ b/ApplicationAmicalsat/src/main/java/org/josast/ApplicationAmicalsat/ReceivedData.java
@@ -0,0 +1,32 @@
+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;
+ }
+
+
+ @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
new file mode 100644
index 0000000000000000000000000000000000000000..e17264069974109ea4db6c8d2520c8d041dca991
--- /dev/null
+++ b/ApplicationAmicalsat/src/main/java/org/josast/ApplicationAmicalsat/SendSIDS.java
@@ -0,0 +1,37 @@
+package org.josast.ApplicationAmicalsat;
+
+import org.josast.SIDS.HttpPostSIDS;
+import org.josast.SIDS.SIDSData;
+import org.josast.SIDS.Station;
+
+/**
+ *
+ * @author christophe
+ *
+ */
+public class SendSIDS {
+
+ 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();
+
+// sids.setTelemetryData(data.getTime(),data.getFrame().toString());
+ System.out.println(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
new file mode 100644
index 0000000000000000000000000000000000000000..66af40fbbe6d55de67a2306c449110e3da7f8f49
--- /dev/null
+++ b/ApplicationAmicalsat/src/main/java/org/josast/ApplicationAmicalsat/TaskSoundmodemTCP.java
@@ -0,0 +1,83 @@
+package org.josast.ApplicationAmicalsat;
+
+import java.util.logging.Logger;
+
+
+import org.josast.ModuleSoundModem.SoundModemClient;
+import org.josast.ModuleSoundModem.SoundModemConfiguration;
+
+import javafx.concurrent.Task;
+
+public class TaskSoundmodemTCP extends Task {
+
+ private Logger log = Logger.getLogger("AmicalSatLogger");
+
+ 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) {
+
+ 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 {
+
+ while (running == true) {
+ byte[] temp = smc.receivedRawData();
+ receivedFrame.addFrame(temp);
+ this.updateValue(receivedFrame.toString());
+
+ }
+ } catch (Exception e) {
+ log.severe("Erreur SoundModem not available");
+ log.severe(e.toString());
+ this.failed();
+
+ }
+ return receivedFrame.toString();
+ }
+
+
+
+ public void arreter() {
+
+ this.running = false;
+
+ }
+
+ public void redemarrer()
+ {
+
+ 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
new file mode 100644
index 0000000000000000000000000000000000000000..d3ae5b5d97752d3c0df65fac9feba317a653d070
--- /dev/null
+++ b/ApplicationAmicalsat/src/main/java/org/josast/ApplicationAmicalsat/util/LogFile.java
@@ -0,0 +1,65 @@
+/**
+ *
+ */
+package org.josast.ApplicationAmicalsat.util;
+
+import java.io.File;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.io.PrintWriter;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+import java.util.logging.Logger;
+
+/**
+ * @author christophe
+ *
+ */
+public class LogFile {
+
+ private Logger appLogger = Logger.getLogger("AmicalSatLogger");
+ private PrintWriter pw;
+
+ /**
+ *
+ */
+ public LogFile() {
+ // TODO Auto-generated constructor stub
+ 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);
+
+ 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);
+
+ }
+
+
+}
diff --git a/ApplicationAmicalsat/src/main/java/org/josast/javafx/AlertHelper.java b/ApplicationAmicalsat/src/main/java/org/josast/javafx/AlertHelper.java
new file mode 100644
index 0000000000000000000000000000000000000000..7f3d20eee2a6085c069c7a085fbfff2b0b08daf4
--- /dev/null
+++ b/ApplicationAmicalsat/src/main/java/org/josast/javafx/AlertHelper.java
@@ -0,0 +1,28 @@
+package org.josast.javafx;
+
+import javafx.scene.control.Alert;
+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();
+ }
+
+}
diff --git a/ApplicationAmicalsat/src/main/resources/org/josast/ApplicationAmicalsat/AmicalSatMessage.txt b/ApplicationAmicalsat/src/main/resources/org/josast/ApplicationAmicalsat/AmicalSatMessage.txt
new file mode 100644
index 0000000000000000000000000000000000000000..536b6e2c4819bb055cfc3a0b018646a2546702f9
--- /dev/null
+++ b/ApplicationAmicalsat/src/main/resources/org/josast/ApplicationAmicalsat/AmicalSatMessage.txt
@@ -0,0 +1,3 @@
+AmicalsatVersion=0.1
+Message= version de test
+NoradID=0
\ No newline at end of file
diff --git a/ApplicationAmicalsat/src/main/resources/org/josast/ApplicationAmicalsat/Amicalsat.fxml b/ApplicationAmicalsat/src/main/resources/org/josast/ApplicationAmicalsat/Amicalsat.fxml
new file mode 100644
index 0000000000000000000000000000000000000000..2d24f26066e50e122d73d25959c3fb06173b1753
--- /dev/null
+++ b/ApplicationAmicalsat/src/main/resources/org/josast/ApplicationAmicalsat/Amicalsat.fxml
@@ -0,0 +1,175 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/ApplicationAmicalsat/src/main/resources/org/josast/ApplicationAmicalsat/Amicalsat.jpg b/ApplicationAmicalsat/src/main/resources/org/josast/ApplicationAmicalsat/Amicalsat.jpg
new file mode 100644
index 0000000000000000000000000000000000000000..4b628ab7ded842b209fa87b7841c933c882c9c71
Binary files /dev/null and b/ApplicationAmicalsat/src/main/resources/org/josast/ApplicationAmicalsat/Amicalsat.jpg differ
diff --git a/ApplicationAmicalsat/src/main/resources/org/josast/ApplicationAmicalsat/logoAmsat.png b/ApplicationAmicalsat/src/main/resources/org/josast/ApplicationAmicalsat/logoAmsat.png
new file mode 100644
index 0000000000000000000000000000000000000000..0d040fba4b8e99ac74424b8e65bf4a9b05995fde
Binary files /dev/null and b/ApplicationAmicalsat/src/main/resources/org/josast/ApplicationAmicalsat/logoAmsat.png differ
diff --git a/ModuleAmicalsat/src/main/java/org/josast/amicalsat/FactoryConsumer.java b/ModuleAmicalsat/src/main/java/org/josast/amicalsat/FactoryConsumer.java
new file mode 100644
index 0000000000000000000000000000000000000000..373d01b1a115f1c05c509be424d77a872dca7771
--- /dev/null
+++ b/ModuleAmicalsat/src/main/java/org/josast/amicalsat/FactoryConsumer.java
@@ -0,0 +1,39 @@
+package org.josast.amicalsat;
+
+import java.util.logging.Logger;
+
+import io.kaitai.struct.ByteBufferKaitaiStream;
+
+public class FactoryConsumer {
+ private Logger log = Logger.getLogger(getClass().getName());
+ 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());
+ }
+
+ return fm;
+ }
+
+
+
+}
diff --git a/ModuleAmicalsat/src/main/java/org/josast/amicalsat/FrameFactory.java b/ModuleAmicalsat/src/main/java/org/josast/amicalsat/FrameFactory.java
index 4227d612ae63b32ab68154822fc1728419e37201..804c2959a157c53d2234f2cc9f6e40f37b50da7b 100644
--- a/ModuleAmicalsat/src/main/java/org/josast/amicalsat/FrameFactory.java
+++ b/ModuleAmicalsat/src/main/java/org/josast/amicalsat/FrameFactory.java
@@ -1,155 +1,126 @@
package org.josast.amicalsat;
+public class FrameFactory {
+ public Frame creerFrame(String tlmArea, String typeFrame) {
-public class FrameFactory {
-
-
- public Frame creerFrame(String tlmArea, String typeFrame) {
-
- Frame frame=null;
-
- if (tlmArea.compareTo("M1") == 0) {
-
- if (typeFrame.compareTo("LOG") == 0) {
-
-
-
- frame = new M1TypeFrame();
-
- }
-
-
-
- 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) {
-
-
- if (typeFrame.compareTo("LOG") == 0) {
- frame = new CuLogTypeFrame();
-
-
-
- }
- }
-
- if (tlmArea.compareTo("CU_L") == 0) {
-
- if (typeFrame.compareTo("LOG") == 0) {
-
- frame = new CuLogTypeFrame();
-
- }
- }
-
- if (tlmArea.compareTo("V1") == 0) {
-
- //#[V1/U2];MS;[Timestamp];[Current rssi];[Latch rssi];[AFC offset ]
-
- if (typeFrame.compareTo("MS") == 0) {
-
- frame = new V1MsTypeFrame();
-
- }
-
- if (typeFrame.compareTo("RL") == 0) {
- frame = new V1RlTypeFrame();
-
-
- }
- }
-
-
- if (tlmArea.compareTo("U2") == 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) {
-
- frame = new U2RlTypeFrame();
-
-
- }
-
- }
-
- if (tlmArea.compareTo("ER") == 0) {
-
- //#[V1/U2];MS;[Timestamp];[Current rssi];[Latch rssi];[AFC offset ]
- if (typeFrame.compareTo("LOG") == 0) {
- frame = new EmLogTypeFrame();
-
-
-
- }
- if (typeFrame.compareTo("MN") == 0) {
-
-
- frame = new EmmnTypeFrame();
- }
- }
-
- return frame;
- }
-
-
-
-
- }
+ Frame frame = null;
+ if (tlmArea.compareTo("M1") == 0) {
+
+ if (typeFrame.compareTo("LOG") == 0) {
+
+ frame = new M1TypeFrame();
+
+ }
+
+ 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) {
+
+ if (typeFrame.compareTo("LOG") == 0) {
+ frame = new CuLogTypeFrame();
+
+ }
+ }
+
+ if (tlmArea.compareTo("CU_L") == 0) {
+
+ if (typeFrame.compareTo("LOG") == 0) {
+
+ frame = new CuLogTypeFrame();
+
+ }
+ }
+
+ if (tlmArea.compareTo("V1") == 0) {
+
+ // #[V1/U2];MS;[Timestamp];[Current rssi];[Latch rssi];[AFC offset ]
+
+ if (typeFrame.compareTo("MS") == 0) {
+
+ frame = new V1MsTypeFrame();
+
+ }
+
+ if (typeFrame.compareTo("RL") == 0) {
+ frame = new V1RlTypeFrame();
+
+ }
+ }
+
+ if (tlmArea.compareTo("U2") == 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) {
+
+ frame = new U2RlTypeFrame();
+
+ }
+
+ }
+
+ if (tlmArea.compareTo("ER") == 0) {
+
+ // #[V1/U2];MS;[Timestamp];[Current rssi];[Latch rssi];[AFC offset ]
+ if (typeFrame.compareTo("LOG") == 0) {
+ frame = new EmLogTypeFrame();
+
+ }
+ if (typeFrame.compareTo("MN") == 0) {
+
+ frame = new EmmnTypeFrame();
+ }
+ }
+
+ return frame;
+ }
+
+}