diff --git a/ApplicationCubesatSim/Delivery/1.2/CubesatSimCli.jar b/ApplicationCubesatSim/Delivery/1.2/CubesatSimCli.jar new file mode 100644 index 0000000000000000000000000000000000000000..4ba7b03a953eeed9af5575dee960ef37c2b2f15d Binary files /dev/null and b/ApplicationCubesatSim/Delivery/1.2/CubesatSimCli.jar differ diff --git a/ApplicationCubesatSim/Delivery/1.2/config/config.ini b/ApplicationCubesatSim/Delivery/1.2/config/config.ini new file mode 100644 index 0000000000000000000000000000000000000000..4329b9c149705ea63f3c3778aa13f6364d474c55 --- /dev/null +++ b/ApplicationCubesatSim/Delivery/1.2/config/config.ini @@ -0,0 +1,11 @@ +# Soundmodem IP Adress +IPadress=localhost +# Soundmodem KISS port +port=8100 +# Influx DB adresss +adresse=http\://127.0.0.1\:8086 +# influxDB user login +login=test +# influxDB user password +password=test + diff --git a/ApplicationCubesatSim/Doc/Image/Datasourcesetup.jpg b/ApplicationCubesatSim/Doc/Image/Datasourcesetup.jpg new file mode 100644 index 0000000000000000000000000000000000000000..9d289ff352d8f1dbd3e6ced83de3a64ab4b50dac Binary files /dev/null and b/ApplicationCubesatSim/Doc/Image/Datasourcesetup.jpg differ diff --git a/ApplicationCubesatSim/Doc/Image/ImportJson.jpg b/ApplicationCubesatSim/Doc/Image/ImportJson.jpg new file mode 100644 index 0000000000000000000000000000000000000000..e3ff7c7662a685a5d3341b3e51d76a80a3467166 Binary files /dev/null and b/ApplicationCubesatSim/Doc/Image/ImportJson.jpg differ diff --git a/ApplicationCubesatSim/Doc/Image/ImportMenu.jpg b/ApplicationCubesatSim/Doc/Image/ImportMenu.jpg new file mode 100644 index 0000000000000000000000000000000000000000..27e3a2d1cfe27a4951c7928c8711abbebd49903f Binary files /dev/null and b/ApplicationCubesatSim/Doc/Image/ImportMenu.jpg differ diff --git a/ApplicationCubesatSim/Doc/Image/SchemaGroundStation.png b/ApplicationCubesatSim/Doc/Image/SchemaGroundStation.png new file mode 100644 index 0000000000000000000000000000000000000000..2fc708f68ec1ffb817434153ba36432ee7a58d4e Binary files /dev/null and b/ApplicationCubesatSim/Doc/Image/SchemaGroundStation.png differ diff --git a/ApplicationCubesatSim/Doc/ImportGraphanaTemplate.md b/ApplicationCubesatSim/Doc/ImportGraphanaTemplate.md new file mode 100644 index 0000000000000000000000000000000000000000..39fb9112f1b6670738740715e890834790476693 --- /dev/null +++ b/ApplicationCubesatSim/Doc/ImportGraphanaTemplate.md @@ -0,0 +1,30 @@ +# importing dashboard Template in Grafana + +## prerequisite + +InfluxDB is deployed and running. + +The cubesatsim database should be created in InfluxDB. When the "ModuleCubesatSim" application is executed, the cubesatsim database is is created automaticaly in influxDB. + +## Configure the database + +As admin, in grafana, configure the data base + +![database](Image/Datasourcesetup.jpg) + +## Import Dasboard Template + +Download template : [Cubesat%20Simulator.json](https://code.electrolab.fr/xtof/josast/blob/master/ModuleCubesatSim/GrafanaDashboard/Cubesat%20Simulator.json) + + +**Select Import capability in Grafana** + +![database](Image/ImportMenu.jpg) + + +**Load the Json File** + +![database](Image/ImportJson.jpg) + +**the Dasboard is loaded and connected to the InfluxDB database** + diff --git a/ApplicationCubesatSim/README.md b/ApplicationCubesatSim/README.md new file mode 100644 index 0000000000000000000000000000000000000000..ddcffb3c86774452b7a7b98963b59f1aa4e7cab1 --- /dev/null +++ b/ApplicationCubesatSim/README.md @@ -0,0 +1,116 @@ +# ApplicationCubesatSim + +ModuleCubesatSim is a package to deal with data transmit by [CubesatSimulator from AMSAT](https://cubesatsim.org) . + +The *CubesatSimCli* application gather data from soundmodem and store decoded data on influxDB database + +On this readme, a quick start guide is provided for test and demo purpose. + +## Context + +![Cubesat_Simulator_Synoptic_](Doc/Image/SchemaGroundStation.png) + + +## prerequisite + +On Windows computer, you need to install folowing software : + + * [Soundmodem](http://uz7.ho.ua/packetradio.htm) + * [influxDB](https://www.influxdata.com/) time serie database + * [grafana](https://grafana.com/) dashboard front end + * ModuleCubesatSim + +## SoundModem configuration + +After the SoundModem installation, you need to allow connection to TCP KISS modem : + + On Soundmodem software : + + menu: Setting->devices: tick the box KISS Server port + +## InfluxDB configuration + +Deploy the InfluxDB application on your computer. The default configuration is enought for test or demo purpose. + + To have this database running : + + Launch the "influxd.exe" executable + +When you run the **ModuleCubesatSim** application, the database is automaticaly created in your InfluxDB instance. + +## Grafana configuration + +Deploy InfluxDB application on your computer. + +After installation you have to lanch "grafana-server.exe" + +You have access to the application with browser at http://:3000 + +On your local computer, you have access with a browser to http://localhost:3000/ + + +Before perform grafana dashboard configuration you need to run "ModuleCubesatSim" application. The influxDB database is created automaticaly. + + how to import [CubesatSim Grafana template](Doc/ImportGraphanaTemplate.md) + + +## Installation + +Retreive jar file from [electrolab Github](https://code.electrolab.fr/xtof/josast/tree/master/ModuleCubesatSim/Delivery/1.2)  + + + +## Usage + +Before lunching the application, following applications should be setup and running : +* SoundModem +* InfluxDB + +To launch the application + +```java + +java -jar CubesatSimCli.jar + +``` + +To launch the application with option : + +``` +java -jar CubesatSimCli.jar -h + +usage: -h [-C ] [-h] [-V] + -C,--Config Return application version + -h,--help display help message + -V,--Version Return application version + +``` + +### 1st launch + +If you have not set-up the application configuration file, The 1st launch of the application end with an error. A default configuration file is created in the config folder. You **must to update this file** with correct parameter before launching again the application. + +## configuration file + +The configuration file allow to set up following parameters : + + # Soundmodem IP Adress + IPadress=localhost + # Soundmodem KISS port + port=8100 + # Influx DB adresss + adresse=http\://127.0.0.1\:8086 + # influxDB user login + login=test + # influxDB user password + password=test + + + +## Contributing +Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change. + +Please make sure to update tests as appropriate. + +## License +[GNU Lesser General Public License v2.1](http://choosealicense.com/licenses/lgpl-2.1/) diff --git a/ApplicationCubesatSim/pom.xml b/ApplicationCubesatSim/pom.xml new file mode 100644 index 0000000000000000000000000000000000000000..36de95656c60bfd9fb4df58d9729d1c14338fb00 --- /dev/null +++ b/ApplicationCubesatSim/pom.xml @@ -0,0 +1,89 @@ + + + 4.0.0 + + JOSAST-parent + org.josast + 0.0.2-SNAPSHOT + + + + ApplicationCubesatSim + 1.2 + + ApplicationCubesatSim + + + jar + + + + 1.8 + 1.8 + ${env.JAVA_HOME} + 0.1.5 + + + + + org.josast + ModuleSoundModem + 0.0.2-SNAPSHOT + + + + org.josast + ModuleCubesatSim + 1.2 + + + commons-cli + commons-cli + 1.4 + + + + junit + junit + 4.11 + test + + + + + + + + org.apache.maven.plugins + maven-assembly-plugin + + + + make-assembly + package + + single + + + + + + + + + org.josast.application.cubesatsim.SoundmodemToInfluxDbCli + + + + + jar-with-dependencies + + + + + + + + + + diff --git a/ModuleCubesatSim/src/main/java/org/josast/CubesatSim/TLM/SoundmodemToInfluxDB.java b/ApplicationCubesatSim/src/main/java/org/josast/application/cubesatsim/SoundmodemToInfluxDbCli.java similarity index 53% rename from ModuleCubesatSim/src/main/java/org/josast/CubesatSim/TLM/SoundmodemToInfluxDB.java rename to ApplicationCubesatSim/src/main/java/org/josast/application/cubesatsim/SoundmodemToInfluxDbCli.java index beeabd9ac877440e292f9c80656a11293f66433e..312cb0bc080f984510659df138f33d0076b0fbf4 100644 --- a/ModuleCubesatSim/src/main/java/org/josast/CubesatSim/TLM/SoundmodemToInfluxDB.java +++ b/ApplicationCubesatSim/src/main/java/org/josast/application/cubesatsim/SoundmodemToInfluxDbCli.java @@ -1,7 +1,7 @@ /** * */ -package org.josast.CubesatSim.TLM; +package org.josast.application.cubesatsim; import org.apache.commons.cli.CommandLine; import org.apache.commons.cli.CommandLineParser; @@ -10,35 +10,36 @@ 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.CubesatSim.TLM.ManageFrame; import org.josast.CubesatSim.influxDB.DataCubesatSim; import org.josast.CubesatSim.influxDB.InfluxDBInstance; import org.josast.CubesatSim.influxDB.InfluxDatabaseConfig; +import org.josast.CubesatSim.kaitai.generated.Cubesatsim.CubesatsimAo7; import org.josast.ModuleSoundModem.SoundModemClient; -import org.josast.kaitai.generated.Cubesatsim; -import org.josast.kaitai.generated.Cubesatsim.CubesatsimAo7; -import org.josast.kaitai.generated.Cubesatsim.CubesatsimData; - -import io.kaitai.struct.ByteBufferKaitaiStream; /** - * @author chris + * @author christophe * */ -public class SoundmodemToInfluxDB { +public class SoundmodemToInfluxDbCli { - private static String version = "1.1"; - private static String configurationfile = "config.ini"; + /** 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 SoundmodemToInfluxDB() { + /** + * + */ + public SoundmodemToInfluxDbCli() { - } + } - private static Options configParameters() { + private static Options configParameters() { - final Option versionOption = Option.builder("V") + final Option versionOption = Option.builder("V") .longOpt("Version") // @@ -48,6 +49,17 @@ public class SoundmodemToInfluxDB { .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") @@ -75,7 +87,7 @@ public class SoundmodemToInfluxDB { final Options options = new Options(); options.addOption(versionOption); - + options.addOption(verboseOption); options.addOption(configFileOption); options.addOption(helpFileOption); @@ -85,14 +97,13 @@ public class SoundmodemToInfluxDB { } /** - * @param configurationfile - * @param args + * @param conffile */ - public void execute(String configurationfile) { + public void execute(final String conffile) { // connection to Sound Modem InfluxDBInstance database = InfluxDBInstance.getInstance(); - InfluxDatabaseConfig config = new InfluxDatabaseConfig(configurationfile); + InfluxDatabaseConfig config = new InfluxDatabaseConfig(conffile); database.conect(config.getAdresse(), config.getLogin(), config.getPassword()); database.createDataBase("CubesatSim"); @@ -103,30 +114,34 @@ public class SoundmodemToInfluxDB { while (true) { byte[] temp = sm.receivedRawData(); - - Cubesatsim cube = new Cubesatsim(new ByteBufferKaitaiStream(temp)); + ManageFrame mngt = new ManageFrame(temp); + + if (verboseMode) { + + System.out.print(mngt.HeaderToString()); - System.out.println(cube.ax25Header().srcAddress().srcAddressStr()); - System.out.println(cube.ax25Header().destAddress().destAddressStr()); - System.out.println(cube.ax25Header().ctrl()); - System.out.println(cube.frametype()); - System.out.println(cube.frametype().ax25Info()); - CubesatsimData data = cube.frametype().ax25Info(); - CubesatsimAo7 AO7 = data.payload(); + } 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.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); - System.out.println(datasim); + if (verboseMode) { + System.out.println(datasim); + + } } @@ -136,6 +151,11 @@ public class SoundmodemToInfluxDB { } + /** + * Main function. + * @param args command line option + * @throws ParseException + */ public static void main(final String[] args) throws ParseException { final Options options = configParameters(); @@ -167,16 +187,27 @@ public class SoundmodemToInfluxDB { 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", ""); } - SoundmodemToInfluxDB smd = new SoundmodemToInfluxDB(); + 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/ModuleCubesatSim/README.md b/ModuleCubesatSim/README.md index f5af8cbe5e9b65febf271fcb79628a942fb1ae73..e771463c2b6795f2b12028edd158ee1d64dede19 100644 --- a/ModuleCubesatSim/README.md +++ b/ModuleCubesatSim/README.md @@ -1,109 +1,13 @@ + # ModuleCubesatSim ModuleCubesatSim is a package to deal with data transmit by [CubesatSimulator from AMSAT](https://cubesatsim.org) . -The *SoundmodemToInfluxDB* application gather data from soundmodem and store decoded data on influxDB database +for the usage see ApplicationCubesatSim -On this readme, a quick start guide is provided for test and demo purpose. ## Context -![Cubesat_Simulator_Synoptic_](Doc/Image/SchemaGroundStation.png) - - -## prerequisite - -On Windows computer, you need to install folowing software : - - * [Soundmodem](http://uz7.ho.ua/packetradio.htm) - * [influxDB](https://www.influxdata.com/) time serie database - * [grafana](https://grafana.com/) dashboard front end - * ModuleCubesatSim - -## SoundModem configuration - -After the SoundModem installation, you need to allow connection to TCP KISS modem : - - On Soundmodem software : - - menu: Setting->devices: tick the box KISS Server port - -## InfluxDB configuration - -Deploy the InfluxDB application on your computer. The default configuration is enought for test or demo purpose. - - To have this database running : - - Launch the "influxd.exe" executable - -When you run the **ModuleCubesatSim** application, the database is automaticaly created in your InfluxDB instance. - -## Grafana configuration - -Deploy InfluxDB application on your computer. - -After installation you have to lanch "grafana-server.exe" - -You have access to the application with browser at http://:3000 - -On your local computer, you have access with a browser to http://localhost:3000/ - - -Before perform grafana dashboard configuration you need to run "ModuleCubesatSim" application. The influxDB database is created automaticaly. - - how to import [CubesatSim Grafana template](Doc/ImportGraphanaTemplate.md) - - -## Installation - -Retreive jar file from [electrolab Github](https://code.electrolab.fr/xtof/josast/tree/master/ModuleCubesatSim/Delivery/0.2)  - - - -## Usage - -Before lunching the application, following applications should be setup and running : -* SoundModem -* InfluxDB - -To launch the application - -```java - -java -jar ModuleCubesatSim-0.0.2-SNAPSHOT-jar-with-dependencies.jar - -``` - -To launch the application with option : - -``` -java -jar ModuleCubesatSim-0.0.2-SNAPSHOT-jar-with-dependencies.jar -h - -usage: -h [-C ] [-h] [-V] - -C,--Config Return application version - -h,--help display help message - -V,--Version Return application version - -``` - -### 1st launch - -If you have not set-up the application configuration file, The 1st launch of the application end with an error. A default configuration file is created in the config folder. You **must to update this file** with correct parameter before launching again the application. - -## configuration file - -The configuration file allow to set up following parameters : - - # Soundmodem IP Adress - IPadress=localhost - # Soundmodem KISS port - port=8100 - # Influx DB adresss - adresse=http\://127.0.0.1\:8086 - # influxDB user login - login=test - # influxDB user password - password=test @@ -114,3 +18,5 @@ Please make sure to update tests as appropriate. ## License [GNU Lesser General Public License v2.1](http://choosealicense.com/licenses/lgpl-2.1/) + + diff --git a/ModuleCubesatSim/pom.xml b/ModuleCubesatSim/pom.xml index d4c178e51eb8d6522d4da0cce129905c1497688d..9e63da5363994f37a502ec8fa9db8a40a3b5be59 100644 --- a/ModuleCubesatSim/pom.xml +++ b/ModuleCubesatSim/pom.xml @@ -12,7 +12,9 @@ 4.0.0 - ModuleCubesatSim + ModuleCubesatSim + 1.2 + jar @@ -61,13 +63,37 @@ commons-cli 1.4 + + +org.junit.jupiter + junit-jupiter-engine + 5.5.2 + test + + + + +org.junit.jupiter + junit-jupiter-engine + 5.5.2 + test + + + + +org.junit.jupiter + junit-jupiter-engine + 5.5.2 + test + + org.apache.maven.plugins maven-assembly-plugin - + make-assembly @@ -82,7 +108,7 @@ - org.josast.CubesatSim.TLM.SoundmodemToInfluxDB + org.josast.CubesatSim.cli.SoundmodemToInfluxDbCli diff --git a/ModuleCubesatSim/src/main/java/org/josast/CubesatSim/TLM/ManageFrame.java b/ModuleCubesatSim/src/main/java/org/josast/CubesatSim/TLM/ManageFrame.java new file mode 100644 index 0000000000000000000000000000000000000000..fbadcef332c3521ff41f0f0c0f4ef13e73876edc --- /dev/null +++ b/ModuleCubesatSim/src/main/java/org/josast/CubesatSim/TLM/ManageFrame.java @@ -0,0 +1,36 @@ +package org.josast.CubesatSim.TLM; + +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(); + + } + +} 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 02d7e67d11908ba2d0b291df6f0d03c737deb0c2..2d7523f995c7cec297ee572cdbb5b7ff5c13e14c 100644 --- a/ModuleCubesatSim/src/main/java/org/josast/CubesatSim/TLM/Telemetry.java +++ b/ModuleCubesatSim/src/main/java/org/josast/CubesatSim/TLM/Telemetry.java @@ -4,9 +4,9 @@ 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; -import org.josast.kaitai.generated.Cubesatsim.CubesatsimAo7; /** * @author chris @@ -14,136 +14,145 @@ import org.josast.kaitai.generated.Cubesatsim.CubesatsimAo7; */ 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 - */ - /** - * @return - */ - 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; - } - - /** - * - */ - 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 ax Ax25Frame - */ - 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(); - - } + 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; + } + + /** + * + */ + 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 268b98fe1de15493d7d8f31853841fd68bf54bd7..fa7501f7f3af7e7749f30f5d684901c3a2af9e87 100644 --- a/ModuleCubesatSim/src/main/java/org/josast/CubesatSim/influxDB/DataCubesatSim.java +++ b/ModuleCubesatSim/src/main/java/org/josast/CubesatSim/influxDB/DataCubesatSim.java @@ -8,215 +8,228 @@ 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 pXCurent the pXCurent to set - */ - public void setpXCurent(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 dbd49279049cab554632f8d52af8da957b482c6a..ae2667fce4999e48fee604e26e02d49eb2db2d59 100644 --- a/ModuleCubesatSim/src/main/java/org/josast/CubesatSim/influxDB/InfluxDBInstance.java +++ b/ModuleCubesatSim/src/main/java/org/josast/CubesatSim/influxDB/InfluxDBInstance.java @@ -9,88 +9,89 @@ import org.influxdb.dto.BatchPoints; import org.influxdb.dto.Pong; /** - * Manage InflusDB Instance + * Manage InflusDB Instance. * * @author christophe * */ -public class InfluxDBInstance { - - private Logger log = Logger.getLogger(getClass().getName()); - - static InfluxDBInstance influxDB = null; - private InfluxDB influxdatabase = null; - private String 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() { - - } - - /** Holder */ - private static class SingletonHolder { - /** Instance unique non pr�initialis�e */ - private final static InfluxDBInstance instance = new InfluxDBInstance(); - } - - @SuppressWarnings("deprecation") - public void createDataBase(String database) { - - if (influxdatabase.databaseExists(database) == false) { - 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 - { - - 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 */ - 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 final class InfluxDBInstance { + + private Logger log = Logger.getLogger(getClass().getName()); + + static InfluxDBInstance influxDB = null; + private InfluxDB influxdatabase = null; + private String 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() { + + } + + /** Holder. */ + private static class SingletonHolder { + /** Instance unique non pr�initialis�e.*/ + private final static InfluxDBInstance instance = new InfluxDBInstance(); + } + + @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; + } + + public void conect(String databaseURL, String userName, String password) { + + try { + + 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; + } + + 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 610ae4fd57f4690fb0a2b932921a173ef109f5cb..93f1692ac06159ba90bef6210667a7776aa869cb 100644 --- a/ModuleCubesatSim/src/main/java/org/josast/CubesatSim/influxDB/InfluxDatabaseConfig.java +++ b/ModuleCubesatSim/src/main/java/org/josast/CubesatSim/influxDB/InfluxDatabaseConfig.java @@ -6,71 +6,75 @@ 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(String configFilename) { - super(configFilename); + /** + * @param configFilename + */ + public InfluxDatabaseConfig(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 - */ - 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 - */ - public String getLogin() { - return login; - } + /** + * @return login + */ + public String getLogin() { + return login; + } - /** - * @param login - */ - public void setLogin(String login) { - this.login = login; - } + /** + * @param login + */ + public void setLogin(String login) { + this.login = login; + } - /** - * @return - */ - public String getPassword() { - return password; - } + /** + * @return password + */ + public String getPassword() { + return password; + } - /** - * @param password - */ - public void setPassword(String password) { - this.password = password; - }; + /** + * @param password + */ + public void setPassword(String password) { + this.password = password; + }; } diff --git a/ModuleCubesatSim/src/main/java/org/josast/kaitai/generated/Cubesatsim.java b/ModuleCubesatSim/src/main/java/org/josast/CubesatSim/kaitai/generated/Cubesatsim.java similarity index 99% rename from ModuleCubesatSim/src/main/java/org/josast/kaitai/generated/Cubesatsim.java rename to ModuleCubesatSim/src/main/java/org/josast/CubesatSim/kaitai/generated/Cubesatsim.java index 65507ef942fdda81c1375d03d0a30fe7020666d8..99afc8b90b5fa20d7bd7ffb32f2294e4c25b9222 100644 --- a/ModuleCubesatSim/src/main/java/org/josast/kaitai/generated/Cubesatsim.java +++ b/ModuleCubesatSim/src/main/java/org/josast/CubesatSim/kaitai/generated/Cubesatsim.java @@ -1,4 +1,4 @@ -package org.josast.kaitai.generated; +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 diff --git a/ModuleCubesatSim/src/main/java/org/josast/TLM/AxBEqx.java b/ModuleCubesatSim/src/main/java/org/josast/TLM/AxBEqx.java index e6d634a7d47c015111ef52d5ccd4a8181901cb77..4cbcfd7479e4259e4237b87cf646bf28d2f0f035 100644 --- a/ModuleCubesatSim/src/main/java/org/josast/TLM/AxBEqx.java +++ b/ModuleCubesatSim/src/main/java/org/josast/TLM/AxBEqx.java @@ -1,36 +1,36 @@ 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 d37882849d91a9ed8678b441e5fe817bf12457da..8b3f9b560f4ebfab9fa920ea06f540beefb71cb6 100644 --- a/ModuleCubesatSim/src/main/java/org/josast/TLM/AxEqx.java +++ b/ModuleCubesatSim/src/main/java/org/josast/TLM/AxEqx.java @@ -1,16 +1,16 @@ package org.josast.TLM; public class AxEqx implements ICalculData { - double a; + double a; - public AxEqx(double a) { - this.a = a; - } + public AxEqx(double aa) { + this.a = aa; + } - @Override - public double calcul(int x) { - // TODO Auto-generated method stub - return a * x; - } + @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 e989c44b2bbb949fed53b00cf3c3eb21a942bb71..f80ede78e22d09f0257abd4036bece3a0d0abe3f 100644 --- a/ModuleCubesatSim/src/main/java/org/josast/TLM/BooleanTLM.java +++ b/ModuleCubesatSim/src/main/java/org/josast/TLM/BooleanTLM.java @@ -2,42 +2,42 @@ 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] + ","); - } + stringBuilder.append(bool[j] + ","); + } - return stringBuilder.toString(); - } + 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 a068f046e84c154a0c407d86d4b0c3298d50177f..0988d595e2bb6a8332c7b78138a1ebb2ebc43f3b 100644 --- a/ModuleCubesatSim/src/main/java/org/josast/TLM/CubicEqx.java +++ b/ModuleCubesatSim/src/main/java/org/josast/TLM/CubicEqx.java @@ -1,7 +1,7 @@ package org.josast.TLM; /** - * Calculate Cubix equation
+ * Calculate Cubix equation
. * Ax3+bx2+Cx+d
* * @author Christophe @@ -9,39 +9,39 @@ package org.josast.TLM; */ public class CubicEqx implements ICalculData { - double A; - double B; - double C; - double D; + 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; - } + /** + * 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; + } - /** - * Calcul. - * - * @param x the x - * - * @return the double - * - * - */ - public double calcul(int x) { + /** + * 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; - } + 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 8890d6873d505c2cd801c01ca828f0af6a00f7d7..a5ab3ba8832615dd7d12a26c10a90a13c9502556 100644 --- a/ModuleCubesatSim/src/main/java/org/josast/TLM/ICalculData.java +++ b/ModuleCubesatSim/src/main/java/org/josast/TLM/ICalculData.java @@ -7,11 +7,11 @@ package org.josast.TLM; * */ 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 65ba050bd04f7856a34b5b04b3a8d18f97af1155..0cc8276d34e6262d920c303ec78d8ef6134ae3c0 100644 --- a/ModuleCubesatSim/src/main/java/org/josast/TLM/TlmData.java +++ b/ModuleCubesatSim/src/main/java/org/josast/TLM/TlmData.java @@ -6,96 +6,98 @@ package org.josast.TLM; */ 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 + * @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 ac8f63959a7561c266daf2022784d8f33345a3ec..80cdc8f95591cd842493940ab40ecf21b3378fa8 100644 --- a/ModuleCubesatSim/src/main/java/org/josast/TLM/xEqx.java +++ b/ModuleCubesatSim/src/main/java/org/josast/TLM/xEqx.java @@ -2,10 +2,10 @@ package org.josast.TLM; public class xEqx implements ICalculData { - @Override - public double calcul(int x) { + @Override + public double calcul(int x) { - return (double) 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 f4e1af2e8331fd7392f14a7fdb4df6b3512a1334..2321743d261777d179df80e561947a1e1af0d294 100644 --- a/ModuleCubesatSim/src/test/java/org/josast/CubesatSim/CubesatSimeFrameTest.java +++ b/ModuleCubesatSim/src/test/java/org/josast/CubesatSim/CubesatSimeFrameTest.java @@ -3,16 +3,13 @@ package org.josast.CubesatSim; import static org.junit.jupiter.api.Assertions.*; 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.CubesatSim.kaitai.generated.Cubesatsim; import org.josast.ModuleSoundModem.KissException; import org.josast.ModuleSoundModem.kiss; - -import org.josast.kaitai.generated.Cubesatsim; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeAll; @@ -22,69 +19,63 @@ import org.junit.jupiter.api.Test; import io.kaitai.struct.ByteBufferKaitaiStream; class CubesatSimeFrameTest { - - int cpt=0; - String generateRepository="src/test/resources"; - byte[] buff = null; - Cubesatsim cube=null; - - @BeforeAll - static void setUpBeforeClass() throws Exception { - } - - @AfterAll - static void tearDownAfterClass() throws Exception { - } - - @BeforeEach - void setUp() throws Exception { - } - - @AfterEach - void tearDown() throws Exception { - } - - @Test - void test() { - - // FrameFactory ff = new FrameFactory(); - - Path path = Paths.get(generateRepository); - - 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 Cubesatsim(new ByteBufferKaitaiStream(buff)); - System.out.println("Dest Asdress : "+ cube.ax25Header().destAddress().destAddressStr()); - System.out.println("SRC Asdress : "+ cube.ax25Header().srcAddress().srcAddressStr()); -// 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(); - } - } + 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 { + } + + @AfterAll + static void tearDownAfterClass() throws Exception { + } + + @BeforeEach + void setUp() throws Exception { + } + + @AfterEach + void tearDown() throws Exception { + } + + @Test + void test() { + + 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/ModuleSoundModem/pom.xml b/ModuleSoundModem/pom.xml index 164a1aa5ddfb2b0f078ccc0006fb25f188ad86b8..ec9b1592a61cb684cb6202a4b331b3c8383cdda5 100644 --- a/ModuleSoundModem/pom.xml +++ b/ModuleSoundModem/pom.xml @@ -46,7 +46,19 @@ 5.5.2 test - + + + + + + + + + + io.kaitai + kaitai-struct-runtime + 0.8 + diff --git a/ModuleSoundModem/src/main/java/org/josast/ModuleSoundModem/SoundModemCli.java b/ModuleSoundModem/src/main/java/org/josast/ModuleSoundModem/SoundModemCli.java index 13521a7fa40361600863773acea784dab978051f..4f86a83b33a4316a06ec96a96370a040c5411b08 100644 --- a/ModuleSoundModem/src/main/java/org/josast/ModuleSoundModem/SoundModemCli.java +++ b/ModuleSoundModem/src/main/java/org/josast/ModuleSoundModem/SoundModemCli.java @@ -25,7 +25,7 @@ public class SoundModemCli { private Logger log = Logger.getLogger(getClass().getName()); - private static String version = "0.1"; + private static String version = "0.2"; private String configurationfile = "defaultConfigFile.ini"; /* * Utilisation d'un répertoire par défaut diff --git a/ModuleSoundModem/src/main/java/org/josast/ModuleSoundModem/kiss.java b/ModuleSoundModem/src/main/java/org/josast/ModuleSoundModem/kiss.java index 3f46182f00f6c3ff30e5746997575d3b3ea0228e..d61846a376bfe4fa091684de35282df1cd835fc6 100644 --- a/ModuleSoundModem/src/main/java/org/josast/ModuleSoundModem/kiss.java +++ b/ModuleSoundModem/src/main/java/org/josast/ModuleSoundModem/kiss.java @@ -3,13 +3,34 @@ package org.josast.ModuleSoundModem; import java.util.Arrays; /** - * + * 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 byte FEND = (byte) 0xC0; // TFEND ($DB, $DC) @@ -21,23 +42,54 @@ public class kiss { public static byte TFESC = (byte) 0xDD; byte[] kissdata = null; + byte type = 0; public kiss(byte[] data) { kissdata = data; } + /** + * + * @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 = 1; + int i = 2; while (kissdata[i] != FEND) { if (kissdata[i] != FESC) { rawData[cptraw++] = kissdata[i++]; diff --git a/ModuleSoundModem/src/test/java/org/josast/ModuleSoundModem/kissTest.java b/ModuleSoundModem/src/test/java/org/josast/ModuleSoundModem/kissTest.java index 2514392f46fd51de9729bdc4015bceb11d3ce8f4..7580e3d68d4f93d4bfb38b36c74bd1e893f1d337 100644 --- a/ModuleSoundModem/src/test/java/org/josast/ModuleSoundModem/kissTest.java +++ b/ModuleSoundModem/src/test/java/org/josast/ModuleSoundModem/kissTest.java @@ -31,7 +31,7 @@ class kissTest { 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 [] { 0x4f, (byte)0xd0, + 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); @@ -49,7 +49,7 @@ class kissTest { 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 [] { 0x4f, (byte)0xd0, + 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); @@ -69,7 +69,7 @@ class kissTest { 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 [] { 0x4f, (byte)0xd0, + 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); diff --git a/pom.xml b/pom.xml index 5fa0f779e5805d775ef24355f7ad266f4d6977a3..52848269ff8b700110011505393785be4d7fdf06 100644 --- a/pom.xml +++ b/pom.xml @@ -1,346 +1,695 @@ - - 4.0.0 - org.josast - JOSAST-parent - 0.0.2-SNAPSHOT - pom - josast Parent - https://code.electrolab.fr/xtof/josast - - UTF-8 - 1.8 - 1.8 - C:\Program Files\Java\jdk1.8.0_181\bin - - 3.2.0 - 3.1.0 - 3.1.0 - 3.0.0 - 3.8.1 - 3.1.2 - 3.0.0-M1 - 3.0.5 - 3.2.0 - 3.13.0 - 3.0.0-M1 - 3.9.0 - 2.3 - 3.1.0 - 3.2.1 - 3.0.0-M4 - 3.0.0-M4 - 3.0.0 - 2.7 - 3.2.0 - 2.4 - 0.8.5 - 6.1.26 - ${project.basedir}/code-analysis/checkstyle.xml - ${project.basedir}/../code-analysis/pmd.xml - false - false - false - false - - 3.8.2 - 1.2.17 - - - - junit - junit - ${junit.version} - test - - - - log4j - log4j - ${log4j.version} - - - - - - org.apache.maven.plugins - maven-project-info-reports-plugin - ${plugin.project-info-reports.version} - - - org.apache.maven.plugins - maven-pmd-plugin - ${plugin.pmd-plugin.version} - - - org.codehaus.mojo - findbugs-maven-plugin - ${plugin.findbugs-maven.version} - - - org.apache.maven.plugins - maven-checkstyle-plugin - ${plugin.checkstyle.version} - - - - - checkstyle - - - - checkstyle-aggregate - false - - true - - - checkstyle-aggregate - - - - - - org.codehaus.mojo - versions-maven-plugin - ${plugin.versions-maven.version} - - - - - - - - com.github.spotbugs - spotbugs-maven-plugin - - -Duser.language=en - - - - org.apache.maven.plugins - maven-project-info-reports-plugin - - - - - org.apache.maven.plugins - maven-changelog-plugin - ${plugin.maven-changelog.version} - - - org.apache.maven.plugins - maven-assembly-plugin - ${plugin.maven-assembly.version} - - - org.apache.maven.plugins - maven-resources-plugin - ${plugin.maven-resources.version} - - UTF-8 - - - - - org.apache.maven.plugins - maven-jar-plugin - ${plugin.maven-jar-plugin.version} - - - org.apache.maven.plugins - maven-source-plugin - ${plugin.source.version} - - - org.apache.maven.plugins - maven-compiler-plugin - ${plugin.compiler.version} - - - org.apache.maven.plugins - maven-surefire-plugin - ${plugin.surefire.version} - - - org.apache.maven.plugins - maven-failsafe-plugin - ${plugin.failsafe.version} - - - org.apache.maven.plugins - maven-pmd-plugin - ${plugin.pmd-plugin.version} - - - org.apache.maven.plugins - maven-javadoc-plugin - ${plugin.javadoc.version} - - - org.codehaus.mojo - versions-maven-plugin - ${plugin.versions-maven.version} - - - org.codehaus.mojo - findbugs-maven-plugin - ${plugin.findbugs-maven.version} - - - org.codehaus.mojo - taglist-maven-plugin - ${plugin.taglist-maven-plugin} - - - org.apache.maven.plugins - maven-release-plugin - ${plugin.release.version} - - - org.apache.maven.plugins - maven-dependency-plugin - ${plugin.dependency.version} - - - org.apache.maven.plugins - maven-deploy-plugin - ${plugin.deploy.version} - - + + + 4.0.0 + + org.josast + + JOSAST-parent + + 0.0.2-SNAPSHOT + + pom + + josast Parent + + https://code.electrolab.fr/xtof/josast + + + + UTF-8 + + 1.8 + + 1.8 + + C:\Program Files\Java\jdk1.8.0_181\bin + + + + 3.2.0 + + 3.1.0 + + 3.1.0 + + 3.0.0 + + 3.8.1 + + 3.1.2 + + 3.0.0-M1 + + 3.0.5 + + 3.2.0 + + 3.13.0 + + 3.0.0-M1 + + 3.9.0 + + 2.3 + + 3.1.0 + + 3.2.1 + + 3.0.0-M4 + + 3.0.0-M4 + + 3.0.0 + + 2.7 + + 3.2.0 + + 2.4 + + 0.8.5 + + 6.1.26 + + ${project.basedir}/code-analysis/checkstyle.xml + + ${project.basedir}/../code-analysis/pmd.xml + + false + + false + + false + + false + + + + 3.8.2 + + 1.2.17 + + + + + + + + junit + + junit + + ${junit.version} + + test + + + + + + + + log4j + + log4j + + ${log4j.version} + + + + + + + + + + + + org.apache.maven.plugins + + maven-project-info-reports-plugin + + ${plugin.project-info-reports.version} + + + + + + org.apache.maven.plugins + + maven-pmd-plugin + + ${plugin.pmd-plugin.version} + + + + + + org.codehaus.mojo + + findbugs-maven-plugin + + ${plugin.findbugs-maven.version} + + + + + + org.apache.maven.plugins + + maven-checkstyle-plugin + + ${plugin.checkstyle.version} + + + + + + + + + + checkstyle + + + + + + + + + + checkstyle-aggregate + + false + + + + true + + + + + + checkstyle-aggregate + + + + + + + + + + + + org.codehaus.mojo + + versions-maven-plugin + + ${plugin.versions-maven.version} + + + + + + + + + + + + + + + + com.github.spotbugs + + spotbugs-maven-plugin + + + + -Duser.language=en + + + + + + + + org.apache.maven.plugins + + maven-project-info-reports-plugin + + + + + + + + + + org.apache.maven.plugins + + maven-changelog-plugin + + ${plugin.maven-changelog.version} + + + + + + org.apache.maven.plugins + + maven-assembly-plugin + + ${plugin.maven-assembly.version} + + + + + + org.apache.maven.plugins + + maven-resources-plugin + + ${plugin.maven-resources.version} + + + + UTF-8 + + + + + + + + + + org.apache.maven.plugins + + maven-jar-plugin + + ${plugin.maven-jar-plugin.version} + + + + + + org.apache.maven.plugins + + maven-source-plugin + + ${plugin.source.version} + + + + + + org.apache.maven.plugins + + maven-compiler-plugin + + ${plugin.compiler.version} + + + + + + org.apache.maven.plugins + + maven-surefire-plugin + + ${plugin.surefire.version} + + + + + + org.apache.maven.plugins + + maven-failsafe-plugin + + ${plugin.failsafe.version} + + + + + + org.apache.maven.plugins + + maven-pmd-plugin + + ${plugin.pmd-plugin.version} + + + + + + org.apache.maven.plugins + + maven-javadoc-plugin + + ${plugin.javadoc.version} + + + + + + org.codehaus.mojo + + versions-maven-plugin + + ${plugin.versions-maven.version} + + + + + + org.codehaus.mojo + + findbugs-maven-plugin + + ${plugin.findbugs-maven.version} + + + + + + org.codehaus.mojo + + taglist-maven-plugin + + ${plugin.taglist-maven-plugin} + + + + + + org.apache.maven.plugins + + maven-release-plugin + + ${plugin.release.version} + + + + + + org.apache.maven.plugins + + maven-dependency-plugin + + ${plugin.dependency.version} + + + + + + org.apache.maven.plugins + + maven-deploy-plugin + + ${plugin.deploy.version} + + + + + maven-clean-plugin + ${plugin.maven-clean-plugin.verson} + - - - - - org.jacoco - jacoco-maven-plugin - ${jacoco-maven-plugin.version} - - - - prepare-agent - - - - - report - test - - report - - - - - - org.apache.maven.plugins - maven-source-plugin - - true - - - - generate-sources - verify - - jar-no-fork - - - - - - org.apache.maven.plugins - maven-site-plugin - ${plugin.site.version} - - - org.apache.maven.plugins - maven-project-info-reports-plugin - ${plugin.project-info-reports.version} - - - org.apache.maven.plugins - maven-javadoc-plugin - - - false - ${javadocs.skip} - - - - org.apache.maven.plugins - maven-surefire-plugin - - + + + + report + + test + + + + report + + + + + +
+ +
+ + + + org.apache.maven.plugins + + maven-source-plugin + + + + true + + + + + + + + generate-sources + + verify + + + + jar-no-fork + + + + + + + + + + + + org.apache.maven.plugins + + maven-site-plugin + + ${plugin.site.version} + + + + + + org.apache.maven.plugins + + maven-project-info-reports-plugin + + ${plugin.project-info-reports.version} + + + + + + org.apache.maven.plugins + + maven-javadoc-plugin + + + + + + false + + ${javadocs.skip} + + + + + + + + org.apache.maven.plugins + + maven-surefire-plugin + + + + - alphabetical - false - ${surefire.jvm.args} - - - - org.apache.maven.plugins - maven-failsafe-plugin - - - integration-test - - integration-test - - - - verify - - verify - - - - - - org.apache.maven.plugins - maven-pmd-plugin - - ${pmd.skip} - ${maven.compiler.source} - ${project.build.sourceEncoding} - - - - /category/java/bestpractices.xml - - - false - - - - verify - - check - cpd-check - - - - - - org.mortbay.jetty - maven-jetty-plugin - ${maven-jetty-plugin.version} - - 5 - foo - 9999 - - -
-
- - ModuleAmicalsat - AplicationAmicalsat - ModuleConfig - - + + alphabetical + + false + + ${surefire.jvm.args} + + + + + + + + org.apache.maven.plugins + + maven-failsafe-plugin + + + + + + integration-test + + + + integration-test + + + + + + + + verify + + + + verify + + + + + + + + + + + + org.apache.maven.plugins + + maven-pmd-plugin + + + + ${pmd.skip} + + ${maven.compiler.source} + + ${project.build.sourceEncoding} + + + + + + + + /category/java/bestpractices.xml + + + + + + false + + + + + + + + verify + + + + check + + cpd-check + + + + + + + + + + + + org.mortbay.jetty + + maven-jetty-plugin + + ${maven-jetty-plugin.version} + + + + 5 + + foo + + 9999 + + + + + + + + + + + + ModuleUtil + + ModuleSound + + ModuleConfig + + ModuleSoundModem + + ModuleCubesatSim + + ModuleAmicalsat + + ApplicationAmicalsatCli + + ApplicationCubesatSim + + +