diff --git a/build.gradle b/build.gradle index 0fe04c3c..0580ac01 100644 --- a/build.gradle +++ b/build.gradle @@ -14,7 +14,7 @@ ext { } allprojects { - version = '5.90.2' + version = '5.90.2-COMAP' repositories { mavenCentral() } diff --git a/replays/comap_otter.json b/replays/comap_otter.json new file mode 100644 index 00000000..0b14e2a2 --- /dev/null +++ b/replays/comap_otter.json @@ -0,0 +1,268 @@ +[ + { + "abbrev": "SynchAdmin", + "timestamp": 0, + "src": 0, + "src_ent": 0, + "dst": 500, + "dst_ent": 255, + "op": 1 + }, + { + "abbrev": "WorldModel", + "timestamp": 10, + "src": 0, + "src_ent": 0, + "dst": 500, + "dst_ent": 255, + "geo_features": [ + { + "abbrev": "GeoFeature", + "feature_id": 0, + "points": [ + { + "abbrev": "MapPoint", + "lat": 0.718813933591675, + "lon": -0.151967544101777, + "alt": 0 + }, + { + "abbrev": "MapPoint", + "lat": 0.718820204559677, + "lon": -0.151956870540736, + "alt": 0 + }, + { + "abbrev": "MapPoint", + "lat": 0.718812171856328, + "lon": -0.151948163267631, + "alt": 0 + }, + { + "abbrev": "MapPoint", + "lat": 0.718804984765001, + "lon": -0.151958181457537, + "alt": 0 + } + ] + }, + { + "abbrev": "GeoFeature", + "feature_id": 1, + "points": [ + { + "abbrev": "MapPoint", + "lat": 0.718820204559677, + "lon": -0.151956870540736, + "alt": 0 + }, + { + "abbrev": "MapPoint", + "lat": 0.718826193657006, + "lon": -0.151946571527353, + "alt": 0 + }, + { + "abbrev": "MapPoint", + "lat": 0.718818795031773, + "lon": -0.151938894173039, + "alt": 0 + }, + { + "abbrev": "MapPoint", + "lat": 0.718812171856328, + "lon": -0.151948163267631, + "alt": 0 + } + ] + }, + { + "abbrev": "GeoFeature", + "feature_id": 2, + "points": [ + { + "abbrev": "MapPoint", + "lat": 0.718812171856328, + "lon": -0.151948163267631, + "alt": 0 + }, + { + "abbrev": "MapPoint", + "lat": 0.718818795031773, + "lon": -0.151938894173039, + "alt": 0 + }, + { + "abbrev": "MapPoint", + "lat": 0.718810409771915, + "lon": -0.151930093524819, + "alt": 0 + }, + { + "abbrev": "MapPoint", + "lat": 0.718804350337818, + "lon": -0.151940392538202, + "alt": 0 + } + ] + }, + { + "abbrev": "GeoFeature", + "feature_id": 3, + "points": [ + { + "abbrev": "MapPoint", + "lat": 0.718804350337818, + "lon": -0.151940392538202, + "alt": 0 + }, + { + "abbrev": "MapPoint", + "lat": 0.718798079369815, + "lon": -0.15195106592471, + "alt": 0 + }, + { + "abbrev": "MapPoint", + "lat": 0.718804984765001, + "lon": -0.151958181457537, + "alt": 0 + }, + { + "abbrev": "MapPoint", + "lat": 0.718812171856328, + "lon": -0.151948163267631, + "alt": 0 + } + ] + } + ], + "cov_states": [ + { + "abbrev": "CoverageState", + "feature_id": 0, + "state": 1 + }, + { + "abbrev": "CoverageState", + "feature_id": 1, + "state": 3 + }, + { + "abbrev": "CoverageState", + "feature_id": 2, + "state": 3 + }, + { + "abbrev": "CoverageState", + "feature_id": 3, + "state": 3 + } + ] + }, + { + "abbrev": "TaskAdim", + "timestamp": 20, + "src": 0, + "src_ent": 0, + "dst": 209, + "dst_ent": 255, + "tid": 0, + "op": 3, + "arg": { + "abbrev": "MoveTask", + "task_id": 0, + "destination": { + "abbrev": "MapPoint", + "lat":0.718798079369815, + "lon":-0.151940392538202, + "alt":0 + }, + "deadline": 1.6488288E9 + } + }, + { + "abbrev": "TaskAdim", + "timestamp": 23, + "src": 0, + "src_ent": 0, + "dst": 500, + "dst_ent": 255, + "tid": 1, + "op": 3, + "arg": { + "abbrev": "MoveTask", + "task_id": 1, + "destination": { + "abbrev": "MapPoint", + "lat":0.718798079369815, + "lon":-0.151940392538202, + "alt":0 + }, + "deadline": 1.6488288E9 + } + }, + { + "abbrev": "TaskAdim", + "timestamp": 26, + "src": 0, + "src_ent": 0, + "dst": 209, + "dst_ent": 255, + "tid": 3, + "op": 3, + "arg": { + "abbrev": "SurveyTask", + "task_id": 3, + "feature_id": 1, + "sensor": 2, + "resolution": 5, + "deadline": 1.6488288E9 + } + }, + { + "abbrev": "TaskAdim", + "timestamp": 29, + "src": 0, + "src_ent": 0, + "dst": 500, + "dst_ent": 255, + "tid": 4, + "op": 3, + "arg": { + "abbrev": "SurveyTask", + "task_id": 4, + "feature_id": 2, + "sensor": 2, + "resolution": 5, + "deadline": 1.6488288E9 + } + }, + { + "abbrev": "TaskAdim", + "timestamp": 32, + "src": 0, + "src_ent": 0, + "dst": 209, + "dst_ent": 255, + "tid": 5, + "op": 3, + "arg": { + "abbrev": "SurveyTask", + "task_id": 5, + "feature_id": 3, + "sensor": 2, + "resolution": 5, + "deadline": 1.6488288E9 + } + }, + { + "abbrev": "SynchAdmin", + "timestamp": 25, + "src": 0, + "src_ent": 0, + "dst": 500, + "dst_ent": 255, + "op": 2 + } +] diff --git a/replays/comap_startup.json b/replays/comap_startup.json new file mode 100644 index 00000000..72c3daa3 --- /dev/null +++ b/replays/comap_startup.json @@ -0,0 +1,268 @@ +[ + { + "abbrev": "SynchAdmin", + "timestamp": 0, + "src": 0, + "src_ent": 0, + "dst": 65535, + "dst_ent": 255, + "op": 1 + }, + { + "abbrev": "WorldModel", + "timestamp": 10, + "src": 0, + "src_ent": 0, + "dst": 65535, + "dst_ent": 255, + "geo_features": [ + { + "abbrev": "GeoFeature", + "feature_id": 0, + "points": [ + { + "abbrev": "MapPoint", + "lat": 0.718813933591675, + "lon": -0.151967544101777, + "alt": 0 + }, + { + "abbrev": "MapPoint", + "lat": 0.718820204559677, + "lon": -0.151956870540736, + "alt": 0 + }, + { + "abbrev": "MapPoint", + "lat": 0.718812171856328, + "lon": -0.151948163267631, + "alt": 0 + }, + { + "abbrev": "MapPoint", + "lat": 0.718804984765001, + "lon": -0.151958181457537, + "alt": 0 + } + ] + }, + { + "abbrev": "GeoFeature", + "feature_id": 1, + "points": [ + { + "abbrev": "MapPoint", + "lat": 0.718820204559677, + "lon": -0.151956870540736, + "alt": 0 + }, + { + "abbrev": "MapPoint", + "lat": 0.718826193657006, + "lon": -0.151946571527353, + "alt": 0 + }, + { + "abbrev": "MapPoint", + "lat": 0.718818795031773, + "lon": -0.151938894173039, + "alt": 0 + }, + { + "abbrev": "MapPoint", + "lat": 0.718812171856328, + "lon": -0.151948163267631, + "alt": 0 + } + ] + }, + { + "abbrev": "GeoFeature", + "feature_id": 2, + "points": [ + { + "abbrev": "MapPoint", + "lat": 0.718812171856328, + "lon": -0.151948163267631, + "alt": 0 + }, + { + "abbrev": "MapPoint", + "lat": 0.718818795031773, + "lon": -0.151938894173039, + "alt": 0 + }, + { + "abbrev": "MapPoint", + "lat": 0.718810409771915, + "lon": -0.151930093524819, + "alt": 0 + }, + { + "abbrev": "MapPoint", + "lat": 0.718804350337818, + "lon": -0.151940392538202, + "alt": 0 + } + ] + }, + { + "abbrev": "GeoFeature", + "feature_id": 3, + "points": [ + { + "abbrev": "MapPoint", + "lat": 0.718804350337818, + "lon": -0.151940392538202, + "alt": 0 + }, + { + "abbrev": "MapPoint", + "lat": 0.718798079369815, + "lon": -0.15195106592471, + "alt": 0 + }, + { + "abbrev": "MapPoint", + "lat": 0.718804984765001, + "lon": -0.151958181457537, + "alt": 0 + }, + { + "abbrev": "MapPoint", + "lat": 0.718812171856328, + "lon": -0.151948163267631, + "alt": 0 + } + ] + } + ], + "cov_states": [ + { + "abbrev": "CoverageState", + "feature_id": 0, + "state": 1 + }, + { + "abbrev": "CoverageState", + "feature_id": 1, + "state": 3 + }, + { + "abbrev": "CoverageState", + "feature_id": 2, + "state": 3 + }, + { + "abbrev": "CoverageState", + "feature_id": 3, + "state": 3 + } + ] + }, + { + "abbrev": "TaskAdim", + "timestamp": 20, + "src": 0, + "src_ent": 0, + "dst": 209, + "dst_ent": 255, + "tid": 0, + "op": 3, + "arg": { + "abbrev": "MoveTask", + "task_id": 0, + "destination": { + "abbrev": "MapPoint", + "lat":0.718798079369815, + "lon":-0.151940392538202, + "alt":0 + }, + "deadline": 1.6488288E9 + } + }, + { + "abbrev": "TaskAdim", + "timestamp": 23, + "src": 0, + "src_ent": 0, + "dst": 500, + "dst_ent": 255, + "tid": 1, + "op": 3, + "arg": { + "abbrev": "MoveTask", + "task_id": 1, + "destination": { + "abbrev": "MapPoint", + "lat":0.718798079369815, + "lon":-0.151940392538202, + "alt":0 + }, + "deadline": 1.6488288E9 + } + }, + { + "abbrev": "TaskAdim", + "timestamp": 26, + "src": 0, + "src_ent": 0, + "dst": 209, + "dst_ent": 255, + "tid": 3, + "op": 3, + "arg": { + "abbrev": "SurveyTask", + "task_id": 3, + "feature_id": 1, + "sensor": 2, + "resolution": 5, + "deadline": 1.6488288E9 + } + }, + { + "abbrev": "TaskAdim", + "timestamp": 29, + "src": 0, + "src_ent": 0, + "dst": 500, + "dst_ent": 255, + "tid": 4, + "op": 3, + "arg": { + "abbrev": "SurveyTask", + "task_id": 4, + "feature_id": 2, + "sensor": 2, + "resolution": 5, + "deadline": 1.6488288E9 + } + }, + { + "abbrev": "TaskAdim", + "timestamp": 32, + "src": 0, + "src_ent": 0, + "dst": 209, + "dst_ent": 255, + "tid": 5, + "op": 3, + "arg": { + "abbrev": "SurveyTask", + "task_id": 5, + "feature_id": 3, + "sensor": 2, + "resolution": 5, + "deadline": 1.6488288E9 + } + }, + { + "abbrev": "SynchAdmin", + "timestamp": 25, + "src": 0, + "src_ent": 0, + "dst": 65535, + "dst_ent": 255, + "op": 2 + } +] diff --git a/replays/imcreplay-5.90.2.jar b/replays/imcreplay-5.90.2.jar new file mode 100644 index 00000000..ef19585e Binary files /dev/null and b/replays/imcreplay-5.90.2.jar differ diff --git a/replays/replay.bash b/replays/replay.bash new file mode 100755 index 00000000..7ed9ed15 --- /dev/null +++ b/replays/replay.bash @@ -0,0 +1,5 @@ +#!/bin/bash + +# compile imcreplay tool +cd .. && ./gradlew imcreplay && cp dist/tools/imcreplay*.jar replays && cd - +java -jar imcreplay*.jar comap_startup.json udp://127.0.0.1:6002 diff --git a/replays/sender.bash b/replays/sender.bash new file mode 100755 index 00000000..2a832d66 --- /dev/null +++ b/replays/sender.bash @@ -0,0 +1,5 @@ +#!/bin/bash + +# compile imcreplay tool +cd .. && ./gradlew imcsender && cp dist/tools/imcreplay*.jar replays && cd - +java -jar imcreplay*.jar comap_startup.json udp://127.0.0.1:6002 diff --git a/settings.gradle b/settings.gradle index 740969a3..ab820b74 100644 --- a/settings.gradle +++ b/settings.gradle @@ -3,7 +3,7 @@ // Set this for the GitHub IMC definition repo gradle.ext.imcGitHubRepo = 'LSTS/imc' // Set this for the branch of the GitHub IMC definition repo -gradle.ext.imcGitHubBranch = '8be592a' +gradle.ext.imcGitHubBranch = 'f6426e8' // Set if you want to use the IMC_Addresses.xml or not gradle.ext.imcDownloadIMCAddresses = 'true' // Set this for the folder IMC definition repo @@ -79,4 +79,4 @@ project(':junit').projectDir = file('src-junit') // implementation 'org.eclipse.jetty.aggregate:jetty-all:9.0.0.v20130308' // implementation 'rhino:js:1.7R2' -// //implementation 'org.mozilla:rhino:1.7R3' \ No newline at end of file +// //implementation 'org.mozilla:rhino:1.7R3' diff --git a/src-generated/java/pt/lsts/imc/ADCPBeam.java b/src-generated/java/pt/lsts/imc/ADCPBeam.java new file mode 100644 index 00000000..2d6a24c5 --- /dev/null +++ b/src-generated/java/pt/lsts/imc/ADCPBeam.java @@ -0,0 +1,138 @@ +/* + * Below is the copyright agreement for IMCJava. + * + * Copyright (c) 2010-2020, Laboratório de Sistemas e Tecnologia Subaquática + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * - Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * - Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * - Neither the names of IMC, LSTS, IMCJava nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL LABORATORIO DE SISTEMAS E TECNOLOGIA SUBAQUATICA + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE + * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ +package pt.lsts.imc; + + +/** + * IMC Message ADCP Beam Measurements (1016)
+ * Measurement from one specific beam at the given CellPosition.
+ * Water Velocity is provided in the chosen Coordinate system.
+ * Amplitude and Correlation are always in the BEAM coordinate system.
+ */ + +public class ADCPBeam extends IMCMessage { + + public static final int ID_STATIC = 1016; + + public ADCPBeam() { + super(ID_STATIC); + } + + public ADCPBeam(IMCMessage msg) { + super(ID_STATIC); + try{ + copyFrom(msg); + } + catch (Exception e) { + e.printStackTrace(); + } + } + + public ADCPBeam(IMCDefinition defs) { + super(defs, ID_STATIC); + } + + public static ADCPBeam create(Object... values) { + ADCPBeam m = new ADCPBeam(); + for (int i = 0; i < values.length-1; i+= 2) + m.setValue(values[i].toString(), values[i+1]); + return m; + } + + public static ADCPBeam clone(IMCMessage msg) throws Exception { + + ADCPBeam m = new ADCPBeam(); + if (msg == null) + return m; + if(msg.definitions != m.definitions){ + msg = msg.cloneMessage(); + IMCUtil.updateMessage(msg, m.definitions); + } + else if (msg.getMgid()!=m.getMgid()) + throw new Exception("Argument "+msg.getAbbrev()+" is incompatible with message "+m.getAbbrev()); + + m.getHeader().values.putAll(msg.getHeader().values); + m.values.putAll(msg.values); + return m; + } + + public ADCPBeam(float vel, float amp, short cor) { + super(ID_STATIC); + setVel(vel); + setAmp(amp); + setCor(cor); + } + + /** + * @return Water Velocity (m/s) - fp32_t + */ + public double getVel() { + return getDouble("vel"); + } + + /** + * @param vel Water Velocity (m/s) + */ + public ADCPBeam setVel(double vel) { + values.put("vel", vel); + return this; + } + + /** + * @return Amplitude (db) - fp32_t + */ + public double getAmp() { + return getDouble("amp"); + } + + /** + * @param amp Amplitude (db) + */ + public ADCPBeam setAmp(double amp) { + values.put("amp", amp); + return this; + } + + /** + * @return Correlation (%) - uint8_t + */ + public short getCor() { + return (short) getInteger("cor"); + } + + /** + * @param cor Correlation (%) + */ + public ADCPBeam setCor(short cor) { + values.put("cor", cor); + return this; + } + +} diff --git a/src-generated/java/pt/lsts/imc/AcousticRequest.java b/src-generated/java/pt/lsts/imc/AcousticRequest.java index 4cd8ae2a..1ad25857 100644 --- a/src-generated/java/pt/lsts/imc/AcousticRequest.java +++ b/src-generated/java/pt/lsts/imc/AcousticRequest.java @@ -42,7 +42,8 @@ public enum TYPE { RANGE(1), REVERSE_RANGE(2), MSG(3), - RAW(4); + RAW(4), + POSITION_REQUEST(5); protected long value; diff --git a/src-generated/java/pt/lsts/imc/AssetReport.java b/src-generated/java/pt/lsts/imc/AssetReport.java new file mode 100644 index 00000000..dc4ce7ff --- /dev/null +++ b/src-generated/java/pt/lsts/imc/AssetReport.java @@ -0,0 +1,297 @@ +/* + * Below is the copyright agreement for IMCJava. + * + * Copyright (c) 2010-2020, Laboratório de Sistemas e Tecnologia Subaquática + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * - Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * - Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * - Neither the names of IMC, LSTS, IMCJava nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL LABORATORIO DE SISTEMAS E TECNOLOGIA SUBAQUATICA + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE + * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ +package pt.lsts.imc; + + +/** + * IMC Message Asset Report (525)
+ * This message is represents an Asset position / status.
+ */ + +public class AssetReport extends IMCMessage { + + public enum MEDIUM { + WIFI(1), + SATELLITE(2), + ACOUSTIC(3), + SMS(4); + + protected long value; + + public long value() { + return value; + } + + MEDIUM(long value) { + this.value = value; + } + } + + public static final int ID_STATIC = 525; + + public AssetReport() { + super(ID_STATIC); + } + + public AssetReport(IMCMessage msg) { + super(ID_STATIC); + try{ + copyFrom(msg); + } + catch (Exception e) { + e.printStackTrace(); + } + } + + public AssetReport(IMCDefinition defs) { + super(defs, ID_STATIC); + } + + public static AssetReport create(Object... values) { + AssetReport m = new AssetReport(); + for (int i = 0; i < values.length-1; i+= 2) + m.setValue(values[i].toString(), values[i+1]); + return m; + } + + public static AssetReport clone(IMCMessage msg) throws Exception { + + AssetReport m = new AssetReport(); + if (msg == null) + return m; + if(msg.definitions != m.definitions){ + msg = msg.cloneMessage(); + IMCUtil.updateMessage(msg, m.definitions); + } + else if (msg.getMgid()!=m.getMgid()) + throw new Exception("Argument "+msg.getAbbrev()+" is incompatible with message "+m.getAbbrev()); + + m.getHeader().values.putAll(msg.getHeader().values); + m.values.putAll(msg.values); + return m; + } + + public AssetReport(String name, double report_time, MEDIUM medium, double lat, double lon, float depth, float alt, float sog, float cog, java.util.Collection msgs) { + super(ID_STATIC); + if (name != null) + setName(name); + setReportTime(report_time); + setMedium(medium); + setLat(lat); + setLon(lon); + setDepth(depth); + setAlt(alt); + setSog(sog); + setCog(cog); + if (msgs != null) + setMsgs(msgs); + } + + /** + * @return Asset Name - plaintext + */ + public String getName() { + return getString("name"); + } + + /** + * @param name Asset Name + */ + public AssetReport setName(String name) { + values.put("name", name); + return this; + } + + /** + * @return Report Timestamp (s) - fp64_t + */ + public double getReportTime() { + return getDouble("report_time"); + } + + /** + * @param report_time Report Timestamp (s) + */ + public AssetReport setReportTime(double report_time) { + values.put("report_time", report_time); + return this; + } + + /** + * @return Medium (enumerated) - uint8_t + */ + public MEDIUM getMedium() { + try { + MEDIUM o = MEDIUM.valueOf(getMessageType().getFieldPossibleValues("medium").get(getLong("medium"))); + return o; + } + catch (Exception e) { + return null; + } + } + + public String getMediumStr() { + return getString("medium"); + } + + public short getMediumVal() { + return (short) getInteger("medium"); + } + + /** + * @param medium Medium (enumerated) + */ + public AssetReport setMedium(MEDIUM medium) { + values.put("medium", medium.value()); + return this; + } + + /** + * @param medium Medium (as a String) + */ + public AssetReport setMediumStr(String medium) { + setValue("medium", medium); + return this; + } + + /** + * @param medium Medium (integer value) + */ + public AssetReport setMediumVal(short medium) { + setValue("medium", medium); + return this; + } + + /** + * @return Latitude (rad) - fp64_t + */ + public double getLat() { + return getDouble("lat"); + } + + /** + * @param lat Latitude (rad) + */ + public AssetReport setLat(double lat) { + values.put("lat", lat); + return this; + } + + /** + * @return Longitude (rad) - fp64_t + */ + public double getLon() { + return getDouble("lon"); + } + + /** + * @param lon Longitude (rad) + */ + public AssetReport setLon(double lon) { + values.put("lon", lon); + return this; + } + + /** + * @return Depth (m) - fp32_t + */ + public double getDepth() { + return getDouble("depth"); + } + + /** + * @param depth Depth (m) + */ + public AssetReport setDepth(double depth) { + values.put("depth", depth); + return this; + } + + /** + * @return Altitude (m) - fp32_t + */ + public double getAlt() { + return getDouble("alt"); + } + + /** + * @param alt Altitude (m) + */ + public AssetReport setAlt(double alt) { + values.put("alt", alt); + return this; + } + + /** + * @return Speed Over Ground (m/s) - fp32_t + */ + public double getSog() { + return getDouble("sog"); + } + + /** + * @param sog Speed Over Ground (m/s) + */ + public AssetReport setSog(double sog) { + values.put("sog", sog); + return this; + } + + /** + * @return Course Over Ground (rad) - fp32_t + */ + public double getCog() { + return getDouble("cog"); + } + + /** + * @param cog Course Over Ground (rad) + */ + public AssetReport setCog(double cog) { + values.put("cog", cog); + return this; + } + + /** + * @return Additional Info - message-list + */ + public java.util.Vector getMsgs() { + return getMessageList("msgs"); + } + + /** + * @param msgs Additional Info + */ + public AssetReport setMsgs(java.util.Collection msgs) { + values.put("msgs", msgs); + return this; + } + +} diff --git a/src-generated/java/pt/lsts/imc/CapabilityAreaSurvey.java b/src-generated/java/pt/lsts/imc/CapabilityAreaSurvey.java new file mode 100644 index 00000000..ac919747 --- /dev/null +++ b/src-generated/java/pt/lsts/imc/CapabilityAreaSurvey.java @@ -0,0 +1,199 @@ +/* + * Below is the copyright agreement for IMCJava. + * + * Copyright (c) 2010-2020, Laboratório de Sistemas e Tecnologia Subaquática + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * - Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * - Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * - Neither the names of IMC, LSTS, IMCJava nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL LABORATORIO DE SISTEMAS E TECNOLOGIA SUBAQUATICA + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE + * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ +package pt.lsts.imc; + +import pt.lsts.imc.def.SensorType; + +/** + * IMC Message Area Survey Capability (3010)
+ * This message describes an area surveying capability.
+ */ + +public class CapabilityAreaSurvey extends VehicleCapability { + + public static final int ID_STATIC = 3010; + + public CapabilityAreaSurvey() { + super(ID_STATIC); + } + + public CapabilityAreaSurvey(IMCMessage msg) { + super(ID_STATIC); + try{ + copyFrom(msg); + } + catch (Exception e) { + e.printStackTrace(); + } + } + + public CapabilityAreaSurvey(IMCDefinition defs) { + super(defs, ID_STATIC); + } + + public static CapabilityAreaSurvey create(Object... values) { + CapabilityAreaSurvey m = new CapabilityAreaSurvey(); + for (int i = 0; i < values.length-1; i+= 2) + m.setValue(values[i].toString(), values[i+1]); + return m; + } + + public static CapabilityAreaSurvey clone(IMCMessage msg) throws Exception { + + CapabilityAreaSurvey m = new CapabilityAreaSurvey(); + if (msg == null) + return m; + if(msg.definitions != m.definitions){ + msg = msg.cloneMessage(); + IMCUtil.updateMessage(msg, m.definitions); + } + else if (msg.getMgid()!=m.getMgid()) + throw new Exception("Argument "+msg.getAbbrev()+" is incompatible with message "+m.getAbbrev()); + + m.getHeader().values.putAll(msg.getHeader().values); + m.values.putAll(msg.values); + return m; + } + + public CapabilityAreaSurvey(SensorType sensor, float resolution, float res_bathym_factor, float cov_rate, float cov_bathym_factor) { + super(ID_STATIC); + setSensor(sensor); + setResolution(resolution); + setResBathymFactor(res_bathym_factor); + setCovRate(cov_rate); + setCovBathymFactor(cov_bathym_factor); + } + + /** + * @return Sensor (enumerated) - uint8_t + */ + public SensorType getSensor() { + try { + SensorType o = SensorType.valueOf(getMessageType().getFieldPossibleValues("sensor").get(getLong("sensor"))); + return o; + } + catch (Exception e) { + return null; + } + } + + public String getSensorStr() { + return getString("sensor"); + } + + public short getSensorVal() { + return (short) getInteger("sensor"); + } + + /** + * @param sensor Sensor (enumerated) + */ + public CapabilityAreaSurvey setSensor(SensorType sensor) { + values.put("sensor", sensor.value()); + return this; + } + + /** + * @param sensor Sensor (as a String) + */ + public CapabilityAreaSurvey setSensorStr(String sensor) { + setValue("sensor", sensor); + return this; + } + + /** + * @param sensor Sensor (integer value) + */ + public CapabilityAreaSurvey setSensorVal(short sensor) { + setValue("sensor", sensor); + return this; + } + + /** + * @return Resolution (px/m²) - fp32_t + */ + public double getResolution() { + return getDouble("resolution"); + } + + /** + * @param resolution Resolution (px/m²) + */ + public CapabilityAreaSurvey setResolution(double resolution) { + values.put("resolution", resolution); + return this; + } + + /** + * @return Resolution Bathymetry Factor - fp32_t + */ + public double getResBathymFactor() { + return getDouble("res_bathym_factor"); + } + + /** + * @param res_bathym_factor Resolution Bathymetry Factor + */ + public CapabilityAreaSurvey setResBathymFactor(double res_bathym_factor) { + values.put("res_bathym_factor", res_bathym_factor); + return this; + } + + /** + * @return Coverage Rate (m²/s) - fp32_t + */ + public double getCovRate() { + return getDouble("cov_rate"); + } + + /** + * @param cov_rate Coverage Rate (m²/s) + */ + public CapabilityAreaSurvey setCovRate(double cov_rate) { + values.put("cov_rate", cov_rate); + return this; + } + + /** + * @return Coverage Bathymetry Factor - fp32_t + */ + public double getCovBathymFactor() { + return getDouble("cov_bathym_factor"); + } + + /** + * @param cov_bathym_factor Coverage Bathymetry Factor + */ + public CapabilityAreaSurvey setCovBathymFactor(double cov_bathym_factor) { + values.put("cov_bathym_factor", cov_bathym_factor); + return this; + } + +} diff --git a/src-generated/java/pt/lsts/imc/CapabilityMove.java b/src-generated/java/pt/lsts/imc/CapabilityMove.java new file mode 100644 index 00000000..3995707b --- /dev/null +++ b/src-generated/java/pt/lsts/imc/CapabilityMove.java @@ -0,0 +1,104 @@ +/* + * Below is the copyright agreement for IMCJava. + * + * Copyright (c) 2010-2020, Laboratório de Sistemas e Tecnologia Subaquática + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * - Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * - Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * - Neither the names of IMC, LSTS, IMCJava nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL LABORATORIO DE SISTEMAS E TECNOLOGIA SUBAQUATICA + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE + * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ +package pt.lsts.imc; + + +/** + * IMC Message Move Capability (3012)
+ * This message describes a moving capability.
+ */ + +public class CapabilityMove extends VehicleCapability { + + public static final int ID_STATIC = 3012; + + public CapabilityMove() { + super(ID_STATIC); + } + + public CapabilityMove(IMCMessage msg) { + super(ID_STATIC); + try{ + copyFrom(msg); + } + catch (Exception e) { + e.printStackTrace(); + } + } + + public CapabilityMove(IMCDefinition defs) { + super(defs, ID_STATIC); + } + + public static CapabilityMove create(Object... values) { + CapabilityMove m = new CapabilityMove(); + for (int i = 0; i < values.length-1; i+= 2) + m.setValue(values[i].toString(), values[i+1]); + return m; + } + + public static CapabilityMove clone(IMCMessage msg) throws Exception { + + CapabilityMove m = new CapabilityMove(); + if (msg == null) + return m; + if(msg.definitions != m.definitions){ + msg = msg.cloneMessage(); + IMCUtil.updateMessage(msg, m.definitions); + } + else if (msg.getMgid()!=m.getMgid()) + throw new Exception("Argument "+msg.getAbbrev()+" is incompatible with message "+m.getAbbrev()); + + m.getHeader().values.putAll(msg.getHeader().values); + m.values.putAll(msg.values); + return m; + } + + public CapabilityMove(float speed) { + super(ID_STATIC); + setSpeed(speed); + } + + /** + * @return Speed (m/s) - fp32_t + */ + public double getSpeed() { + return getDouble("speed"); + } + + /** + * @param speed Speed (m/s) + */ + public CapabilityMove setSpeed(double speed) { + values.put("speed", speed); + return this; + } + +} diff --git a/src-generated/java/pt/lsts/imc/CapabilityPointSurvey.java b/src-generated/java/pt/lsts/imc/CapabilityPointSurvey.java new file mode 100644 index 00000000..e42ebcba --- /dev/null +++ b/src-generated/java/pt/lsts/imc/CapabilityPointSurvey.java @@ -0,0 +1,167 @@ +/* + * Below is the copyright agreement for IMCJava. + * + * Copyright (c) 2010-2020, Laboratório de Sistemas e Tecnologia Subaquática + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * - Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * - Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * - Neither the names of IMC, LSTS, IMCJava nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL LABORATORIO DE SISTEMAS E TECNOLOGIA SUBAQUATICA + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE + * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ +package pt.lsts.imc; + +import pt.lsts.imc.def.SensorType; + +/** + * IMC Message Point Survey Capability (3011)
+ * This message describes an area surveying capability.
+ */ + +public class CapabilityPointSurvey extends VehicleCapability { + + public static final int ID_STATIC = 3011; + + public CapabilityPointSurvey() { + super(ID_STATIC); + } + + public CapabilityPointSurvey(IMCMessage msg) { + super(ID_STATIC); + try{ + copyFrom(msg); + } + catch (Exception e) { + e.printStackTrace(); + } + } + + public CapabilityPointSurvey(IMCDefinition defs) { + super(defs, ID_STATIC); + } + + public static CapabilityPointSurvey create(Object... values) { + CapabilityPointSurvey m = new CapabilityPointSurvey(); + for (int i = 0; i < values.length-1; i+= 2) + m.setValue(values[i].toString(), values[i+1]); + return m; + } + + public static CapabilityPointSurvey clone(IMCMessage msg) throws Exception { + + CapabilityPointSurvey m = new CapabilityPointSurvey(); + if (msg == null) + return m; + if(msg.definitions != m.definitions){ + msg = msg.cloneMessage(); + IMCUtil.updateMessage(msg, m.definitions); + } + else if (msg.getMgid()!=m.getMgid()) + throw new Exception("Argument "+msg.getAbbrev()+" is incompatible with message "+m.getAbbrev()); + + m.getHeader().values.putAll(msg.getHeader().values); + m.values.putAll(msg.values); + return m; + } + + public CapabilityPointSurvey(SensorType Sensor, float resolution, float duration) { + super(ID_STATIC); + setSensor(Sensor); + setResolution(resolution); + setDuration(duration); + } + + /** + * @return Sensor (enumerated) - uint8_t + */ + public SensorType getSensor() { + try { + SensorType o = SensorType.valueOf(getMessageType().getFieldPossibleValues("Sensor").get(getLong("Sensor"))); + return o; + } + catch (Exception e) { + return null; + } + } + + public String getSensorStr() { + return getString("Sensor"); + } + + public short getSensorVal() { + return (short) getInteger("Sensor"); + } + + /** + * @param Sensor Sensor (enumerated) + */ + public CapabilityPointSurvey setSensor(SensorType Sensor) { + values.put("Sensor", Sensor.value()); + return this; + } + + /** + * @param Sensor Sensor (as a String) + */ + public CapabilityPointSurvey setSensorStr(String Sensor) { + setValue("Sensor", Sensor); + return this; + } + + /** + * @param Sensor Sensor (integer value) + */ + public CapabilityPointSurvey setSensorVal(short Sensor) { + setValue("Sensor", Sensor); + return this; + } + + /** + * @return Resolution (px/m²) - fp32_t + */ + public double getResolution() { + return getDouble("resolution"); + } + + /** + * @param resolution Resolution (px/m²) + */ + public CapabilityPointSurvey setResolution(double resolution) { + values.put("resolution", resolution); + return this; + } + + /** + * @return Duration (s) - fp32_t + */ + public double getDuration() { + return getDouble("duration"); + } + + /** + * @param duration Duration (s) + */ + public CapabilityPointSurvey setDuration(double duration) { + values.put("duration", duration); + return this; + } + +} diff --git a/src-generated/java/pt/lsts/imc/ChargingState.java b/src-generated/java/pt/lsts/imc/ChargingState.java new file mode 100644 index 00000000..63c26e05 --- /dev/null +++ b/src-generated/java/pt/lsts/imc/ChargingState.java @@ -0,0 +1,149 @@ +/* + * Below is the copyright agreement for IMCJava. + * + * Copyright (c) 2010-2020, Laboratório de Sistemas e Tecnologia Subaquática + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * - Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * - Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * - Neither the names of IMC, LSTS, IMCJava nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL LABORATORIO DE SISTEMAS E TECNOLOGIA SUBAQUATICA + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE + * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ +package pt.lsts.imc; + + +/** + * IMC Message Charging State (910)
+ * Reports if the vehicle is charging or not
+ */ + +public class ChargingState extends IMCMessage { + + public enum IS_CHARGING { + NOT_CHARGING(0), + IS_CHARGING(1); + + protected long value; + + public long value() { + return value; + } + + IS_CHARGING(long value) { + this.value = value; + } + } + + public static final int ID_STATIC = 910; + + public ChargingState() { + super(ID_STATIC); + } + + public ChargingState(IMCMessage msg) { + super(ID_STATIC); + try{ + copyFrom(msg); + } + catch (Exception e) { + e.printStackTrace(); + } + } + + public ChargingState(IMCDefinition defs) { + super(defs, ID_STATIC); + } + + public static ChargingState create(Object... values) { + ChargingState m = new ChargingState(); + for (int i = 0; i < values.length-1; i+= 2) + m.setValue(values[i].toString(), values[i+1]); + return m; + } + + public static ChargingState clone(IMCMessage msg) throws Exception { + + ChargingState m = new ChargingState(); + if (msg == null) + return m; + if(msg.definitions != m.definitions){ + msg = msg.cloneMessage(); + IMCUtil.updateMessage(msg, m.definitions); + } + else if (msg.getMgid()!=m.getMgid()) + throw new Exception("Argument "+msg.getAbbrev()+" is incompatible with message "+m.getAbbrev()); + + m.getHeader().values.putAll(msg.getHeader().values); + m.values.putAll(msg.values); + return m; + } + + public ChargingState(IS_CHARGING is_charging) { + super(ID_STATIC); + setIsCharging(is_charging); + } + + /** + * @return Is Charging (enumerated) - uint8_t + */ + public IS_CHARGING getIsCharging() { + try { + IS_CHARGING o = IS_CHARGING.valueOf(getMessageType().getFieldPossibleValues("is_charging").get(getLong("is_charging"))); + return o; + } + catch (Exception e) { + return null; + } + } + + public String getIsChargingStr() { + return getString("is_charging"); + } + + public short getIsChargingVal() { + return (short) getInteger("is_charging"); + } + + /** + * @param is_charging Is Charging (enumerated) + */ + public ChargingState setIsCharging(IS_CHARGING is_charging) { + values.put("is_charging", is_charging.value()); + return this; + } + + /** + * @param is_charging Is Charging (as a String) + */ + public ChargingState setIsChargingStr(String is_charging) { + setValue("is_charging", is_charging); + return this; + } + + /** + * @param is_charging Is Charging (integer value) + */ + public ChargingState setIsChargingVal(short is_charging) { + setValue("is_charging", is_charging); + return this; + } + +} diff --git a/src-generated/java/pt/lsts/imc/ColoredDissolvedOrganicMatter.java b/src-generated/java/pt/lsts/imc/ColoredDissolvedOrganicMatter.java new file mode 100644 index 00000000..96c845cf --- /dev/null +++ b/src-generated/java/pt/lsts/imc/ColoredDissolvedOrganicMatter.java @@ -0,0 +1,104 @@ +/* + * Below is the copyright agreement for IMCJava. + * + * Copyright (c) 2010-2020, Laboratório de Sistemas e Tecnologia Subaquática + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * - Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * - Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * - Neither the names of IMC, LSTS, IMCJava nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL LABORATORIO DE SISTEMAS E TECNOLOGIA SUBAQUATICA + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE + * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ +package pt.lsts.imc; + + +/** + * IMC Message Colored Dissolved Organic Matter (2003)
+ * Colored Dissolved Organic Matter measurement.
+ */ + +public class ColoredDissolvedOrganicMatter extends IMCMessage { + + public static final int ID_STATIC = 2003; + + public ColoredDissolvedOrganicMatter() { + super(ID_STATIC); + } + + public ColoredDissolvedOrganicMatter(IMCMessage msg) { + super(ID_STATIC); + try{ + copyFrom(msg); + } + catch (Exception e) { + e.printStackTrace(); + } + } + + public ColoredDissolvedOrganicMatter(IMCDefinition defs) { + super(defs, ID_STATIC); + } + + public static ColoredDissolvedOrganicMatter create(Object... values) { + ColoredDissolvedOrganicMatter m = new ColoredDissolvedOrganicMatter(); + for (int i = 0; i < values.length-1; i+= 2) + m.setValue(values[i].toString(), values[i+1]); + return m; + } + + public static ColoredDissolvedOrganicMatter clone(IMCMessage msg) throws Exception { + + ColoredDissolvedOrganicMatter m = new ColoredDissolvedOrganicMatter(); + if (msg == null) + return m; + if(msg.definitions != m.definitions){ + msg = msg.cloneMessage(); + IMCUtil.updateMessage(msg, m.definitions); + } + else if (msg.getMgid()!=m.getMgid()) + throw new Exception("Argument "+msg.getAbbrev()+" is incompatible with message "+m.getAbbrev()); + + m.getHeader().values.putAll(msg.getHeader().values); + m.values.putAll(msg.values); + return m; + } + + public ColoredDissolvedOrganicMatter(float value) { + super(ID_STATIC); + setValue(value); + } + + /** + * @return Value (ppb) - fp32_t + */ + public double getValue() { + return getDouble("value"); + } + + /** + * @param value Value (ppb) + */ + public ColoredDissolvedOrganicMatter setValue(double value) { + values.put("value", value); + return this; + } + +} diff --git a/src-generated/java/pt/lsts/imc/CommRestriction.java b/src-generated/java/pt/lsts/imc/CommRestriction.java new file mode 100644 index 00000000..9ce4d0a3 --- /dev/null +++ b/src-generated/java/pt/lsts/imc/CommRestriction.java @@ -0,0 +1,126 @@ +/* + * Below is the copyright agreement for IMCJava. + * + * Copyright (c) 2010-2020, Laboratório de Sistemas e Tecnologia Subaquática + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * - Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * - Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * - Neither the names of IMC, LSTS, IMCJava nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL LABORATORIO DE SISTEMAS E TECNOLOGIA SUBAQUATICA + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE + * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ +package pt.lsts.imc; + + +/** + * IMC Message Communication Restriction (2010)
+ * This message is used to restrict the vehicle from using some communication means.
+ */ + +public class CommRestriction extends IMCMessage { + + public static final short MEAN_SATELLITE = 0x01; + public static final short MEAN_ACOUSTIC = 0x02; + public static final short MEAN_WIFI = 0x04; + public static final short MEAN_GSM = 0x08; + + public static final int ID_STATIC = 2010; + + public CommRestriction() { + super(ID_STATIC); + } + + public CommRestriction(IMCMessage msg) { + super(ID_STATIC); + try{ + copyFrom(msg); + } + catch (Exception e) { + e.printStackTrace(); + } + } + + public CommRestriction(IMCDefinition defs) { + super(defs, ID_STATIC); + } + + public static CommRestriction create(Object... values) { + CommRestriction m = new CommRestriction(); + for (int i = 0; i < values.length-1; i+= 2) + m.setValue(values[i].toString(), values[i+1]); + return m; + } + + public static CommRestriction clone(IMCMessage msg) throws Exception { + + CommRestriction m = new CommRestriction(); + if (msg == null) + return m; + if(msg.definitions != m.definitions){ + msg = msg.cloneMessage(); + IMCUtil.updateMessage(msg, m.definitions); + } + else if (msg.getMgid()!=m.getMgid()) + throw new Exception("Argument "+msg.getAbbrev()+" is incompatible with message "+m.getAbbrev()); + + m.getHeader().values.putAll(msg.getHeader().values); + m.values.putAll(msg.values); + return m; + } + + public CommRestriction(short restriction, String reason) { + super(ID_STATIC); + setRestriction(restriction); + if (reason != null) + setReason(reason); + } + + /** + * @return Restricted Communication Means (bitfield) - uint8_t + */ + public short getRestriction() { + return (short) getInteger("restriction"); + } + + /** + * @param restriction Restricted Communication Means (bitfield) + */ + public CommRestriction setRestriction(short restriction) { + values.put("restriction", restriction); + return this; + } + + /** + * @return Reason - plaintext + */ + public String getReason() { + return getString("reason"); + } + + /** + * @param reason Reason + */ + public CommRestriction setReason(String reason) { + values.put("reason", reason); + return this; + } + +} diff --git a/src-generated/java/pt/lsts/imc/Command.java b/src-generated/java/pt/lsts/imc/Command.java new file mode 100644 index 00000000..80526925 --- /dev/null +++ b/src-generated/java/pt/lsts/imc/Command.java @@ -0,0 +1,162 @@ +/* + * Below is the copyright agreement for IMCJava. + * + * Copyright (c) 2010-2020, Laboratório de Sistemas e Tecnologia Subaquática + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * - Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * - Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * - Neither the names of IMC, LSTS, IMCJava nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL LABORATORIO DE SISTEMAS E TECNOLOGIA SUBAQUATICA + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE + * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ +package pt.lsts.imc; + + +/** + * IMC Message Command To Follow (497)
+ * This message must be sent by an external entity to provide command references to a system
+ * running a "Follow Command Maneuver". If no Command messages are transmitted, the system
+ * will terminate maneuver.
+ */ + +public class Command extends IMCMessage { + + public static final short FLAG_SPEED_METERS_PS = 0x01; + public static final short FLAG_SPEED_RPM = 0x02; + public static final short FLAG_DEPTH = 0x04; + public static final short FLAG_ALTITUDE = 0x08; + public static final short FLAG_HEADING = 0x10; + public static final short FLAG_HEADING_RATE = 0x20; + public static final short FLAG_MANDONE = 0x80; + + public static final int ID_STATIC = 497; + + public Command() { + super(ID_STATIC); + } + + public Command(IMCMessage msg) { + super(ID_STATIC); + try{ + copyFrom(msg); + } + catch (Exception e) { + e.printStackTrace(); + } + } + + public Command(IMCDefinition defs) { + super(defs, ID_STATIC); + } + + public static Command create(Object... values) { + Command m = new Command(); + for (int i = 0; i < values.length-1; i+= 2) + m.setValue(values[i].toString(), values[i+1]); + return m; + } + + public static Command clone(IMCMessage msg) throws Exception { + + Command m = new Command(); + if (msg == null) + return m; + if(msg.definitions != m.definitions){ + msg = msg.cloneMessage(); + IMCUtil.updateMessage(msg, m.definitions); + } + else if (msg.getMgid()!=m.getMgid()) + throw new Exception("Argument "+msg.getAbbrev()+" is incompatible with message "+m.getAbbrev()); + + m.getHeader().values.putAll(msg.getHeader().values); + m.values.putAll(msg.values); + return m; + } + + public Command(short flags, float speed, float z, float heading) { + super(ID_STATIC); + setFlags(flags); + setSpeed(speed); + setZ(z); + setHeading(heading); + } + + /** + * @return Flags (bitfield) - uint8_t + */ + public short getFlags() { + return (short) getInteger("flags"); + } + + /** + * @param flags Flags (bitfield) + */ + public Command setFlags(short flags) { + values.put("flags", flags); + return this; + } + + /** + * @return Speed Reference - fp32_t + */ + public double getSpeed() { + return getDouble("speed"); + } + + /** + * @param speed Speed Reference + */ + public Command setSpeed(double speed) { + values.put("speed", speed); + return this; + } + + /** + * @return Z Reference (m) - fp32_t + */ + public double getZ() { + return getDouble("z"); + } + + /** + * @param z Z Reference (m) + */ + public Command setZ(double z) { + values.put("z", z); + return this; + } + + /** + * @return Heading Reference (rad) - fp32_t + */ + public double getHeading() { + return getDouble("heading"); + } + + /** + * @param heading Heading Reference (rad) + */ + public Command setHeading(double heading) { + values.put("heading", heading); + return this; + } + +} diff --git a/src-generated/java/pt/lsts/imc/CoverageState.java b/src-generated/java/pt/lsts/imc/CoverageState.java new file mode 100644 index 00000000..631e6079 --- /dev/null +++ b/src-generated/java/pt/lsts/imc/CoverageState.java @@ -0,0 +1,167 @@ +/* + * Below is the copyright agreement for IMCJava. + * + * Copyright (c) 2010-2020, Laboratório de Sistemas e Tecnologia Subaquática + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * - Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * - Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * - Neither the names of IMC, LSTS, IMCJava nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL LABORATORIO DE SISTEMAS E TECNOLOGIA SUBAQUATICA + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE + * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ +package pt.lsts.imc; + + +/** + * IMC Message Feature Coverage State (3003)
+ * This message is used to report the coverage state of a geographical feature.
+ * It is reported by the UxVs performing the surveys.
+ */ + +public class CoverageState extends IMCMessage { + + public enum STATE { + COMPLETED(1), + PARTIAL(2), + NONE(3); + + protected long value; + + public long value() { + return value; + } + + STATE(long value) { + this.value = value; + } + } + + public static final int ID_STATIC = 3003; + + public CoverageState() { + super(ID_STATIC); + } + + public CoverageState(IMCMessage msg) { + super(ID_STATIC); + try{ + copyFrom(msg); + } + catch (Exception e) { + e.printStackTrace(); + } + } + + public CoverageState(IMCDefinition defs) { + super(defs, ID_STATIC); + } + + public static CoverageState create(Object... values) { + CoverageState m = new CoverageState(); + for (int i = 0; i < values.length-1; i+= 2) + m.setValue(values[i].toString(), values[i+1]); + return m; + } + + public static CoverageState clone(IMCMessage msg) throws Exception { + + CoverageState m = new CoverageState(); + if (msg == null) + return m; + if(msg.definitions != m.definitions){ + msg = msg.cloneMessage(); + IMCUtil.updateMessage(msg, m.definitions); + } + else if (msg.getMgid()!=m.getMgid()) + throw new Exception("Argument "+msg.getAbbrev()+" is incompatible with message "+m.getAbbrev()); + + m.getHeader().values.putAll(msg.getHeader().values); + m.values.putAll(msg.values); + return m; + } + + public CoverageState(int feature_id, STATE state) { + super(ID_STATIC); + setFeatureId(feature_id); + setState(state); + } + + /** + * @return Identifier - uint16_t + */ + public int getFeatureId() { + return getInteger("feature_id"); + } + + /** + * @param feature_id Identifier + */ + public CoverageState setFeatureId(int feature_id) { + values.put("feature_id", feature_id); + return this; + } + + /** + * @return State (enumerated) - uint8_t + */ + public STATE getState() { + try { + STATE o = STATE.valueOf(getMessageType().getFieldPossibleValues("state").get(getLong("state"))); + return o; + } + catch (Exception e) { + return null; + } + } + + public String getStateStr() { + return getString("state"); + } + + public short getStateVal() { + return (short) getInteger("state"); + } + + /** + * @param state State (enumerated) + */ + public CoverageState setState(STATE state) { + values.put("state", state.value()); + return this; + } + + /** + * @param state State (as a String) + */ + public CoverageState setStateStr(String state) { + setValue("state", state); + return this; + } + + /** + * @param state State (integer value) + */ + public CoverageState setStateVal(short state) { + setValue("state", state); + return this; + } + +} diff --git a/src-generated/java/pt/lsts/imc/CurrentProfile.java b/src-generated/java/pt/lsts/imc/CurrentProfile.java new file mode 100644 index 00000000..dc3b968c --- /dev/null +++ b/src-generated/java/pt/lsts/imc/CurrentProfile.java @@ -0,0 +1,164 @@ +/* + * Below is the copyright agreement for IMCJava. + * + * Copyright (c) 2010-2020, Laboratório de Sistemas e Tecnologia Subaquática + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * - Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * - Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * - Neither the names of IMC, LSTS, IMCJava nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL LABORATORIO DE SISTEMAS E TECNOLOGIA SUBAQUATICA + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE + * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ +package pt.lsts.imc; + + +/** + * IMC Message Current Profile (1014)
+ * Contains a profile of water velocities measured relative to the vehicle
+ * velocity, represented in the specified coordinate system.
+ */ + +public class CurrentProfile extends IMCMessage { + + public static final short UTF_XYZ = 0x01; + public static final short UTF_NED = 0x02; + public static final short UTF_BEAMS = 0x04; + + public static final int ID_STATIC = 1014; + + public CurrentProfile() { + super(ID_STATIC); + } + + public CurrentProfile(IMCMessage msg) { + super(ID_STATIC); + try{ + copyFrom(msg); + } + catch (Exception e) { + e.printStackTrace(); + } + } + + public CurrentProfile(IMCDefinition defs) { + super(defs, ID_STATIC); + } + + public static CurrentProfile create(Object... values) { + CurrentProfile m = new CurrentProfile(); + for (int i = 0; i < values.length-1; i+= 2) + m.setValue(values[i].toString(), values[i+1]); + return m; + } + + public static CurrentProfile clone(IMCMessage msg) throws Exception { + + CurrentProfile m = new CurrentProfile(); + if (msg == null) + return m; + if(msg.definitions != m.definitions){ + msg = msg.cloneMessage(); + IMCUtil.updateMessage(msg, m.definitions); + } + else if (msg.getMgid()!=m.getMgid()) + throw new Exception("Argument "+msg.getAbbrev()+" is incompatible with message "+m.getAbbrev()); + + m.getHeader().values.putAll(msg.getHeader().values); + m.values.putAll(msg.values); + return m; + } + + public CurrentProfile(short nbeams, short ncells, short coord_sys, java.util.Collection profile) { + super(ID_STATIC); + setNbeams(nbeams); + setNcells(ncells); + setCoordSys(coord_sys); + if (profile != null) + setProfile(profile); + } + + /** + * @return Number of Beams - uint8_t + */ + public short getNbeams() { + return (short) getInteger("nbeams"); + } + + /** + * @param nbeams Number of Beams + */ + public CurrentProfile setNbeams(short nbeams) { + values.put("nbeams", nbeams); + return this; + } + + /** + * @return Number of Cells - uint8_t + */ + public short getNcells() { + return (short) getInteger("ncells"); + } + + /** + * @param ncells Number of Cells + */ + public CurrentProfile setNcells(short ncells) { + values.put("ncells", ncells); + return this; + } + + /** + * @return Coordinate System (bitfield) - uint8_t + */ + public short getCoordSys() { + return (short) getInteger("coord_sys"); + } + + /** + * @param coord_sys Coordinate System (bitfield) + */ + public CurrentProfile setCoordSys(short coord_sys) { + values.put("coord_sys", coord_sys); + return this; + } + + /** + * @return Profile - message-list + */ + public java.util.Vector getProfile() { + try { + return getMessageList("profile", CurrentProfileCell.class); + } + catch (Exception e) { + return null; + } + + } + + /** + * @param profile Profile + */ + public CurrentProfile setProfile(java.util.Collection profile) { + values.put("profile", profile); + return this; + } + +} diff --git a/src-generated/java/pt/lsts/imc/CurrentProfileCell.java b/src-generated/java/pt/lsts/imc/CurrentProfileCell.java new file mode 100644 index 00000000..c3f6b1b3 --- /dev/null +++ b/src-generated/java/pt/lsts/imc/CurrentProfileCell.java @@ -0,0 +1,127 @@ +/* + * Below is the copyright agreement for IMCJava. + * + * Copyright (c) 2010-2020, Laboratório de Sistemas e Tecnologia Subaquática + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * - Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * - Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * - Neither the names of IMC, LSTS, IMCJava nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL LABORATORIO DE SISTEMAS E TECNOLOGIA SUBAQUATICA + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE + * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ +package pt.lsts.imc; + + +/** + * IMC Message Current Profile Cell (1015)
+ * One Current measurement at a specific CellPosition.
+ */ + +public class CurrentProfileCell extends IMCMessage { + + public static final int ID_STATIC = 1015; + + public CurrentProfileCell() { + super(ID_STATIC); + } + + public CurrentProfileCell(IMCMessage msg) { + super(ID_STATIC); + try{ + copyFrom(msg); + } + catch (Exception e) { + e.printStackTrace(); + } + } + + public CurrentProfileCell(IMCDefinition defs) { + super(defs, ID_STATIC); + } + + public static CurrentProfileCell create(Object... values) { + CurrentProfileCell m = new CurrentProfileCell(); + for (int i = 0; i < values.length-1; i+= 2) + m.setValue(values[i].toString(), values[i+1]); + return m; + } + + public static CurrentProfileCell clone(IMCMessage msg) throws Exception { + + CurrentProfileCell m = new CurrentProfileCell(); + if (msg == null) + return m; + if(msg.definitions != m.definitions){ + msg = msg.cloneMessage(); + IMCUtil.updateMessage(msg, m.definitions); + } + else if (msg.getMgid()!=m.getMgid()) + throw new Exception("Argument "+msg.getAbbrev()+" is incompatible with message "+m.getAbbrev()); + + m.getHeader().values.putAll(msg.getHeader().values); + m.values.putAll(msg.values); + return m; + } + + public CurrentProfileCell(float cell_position, java.util.Collection beams) { + super(ID_STATIC); + setCellPosition(cell_position); + if (beams != null) + setBeams(beams); + } + + /** + * @return Cell Position (m) - fp32_t + */ + public double getCellPosition() { + return getDouble("cell_position"); + } + + /** + * @param cell_position Cell Position (m) + */ + public CurrentProfileCell setCellPosition(double cell_position) { + values.put("cell_position", cell_position); + return this; + } + + /** + * @return Beams Measurements - message-list + */ + public java.util.Vector getBeams() { + try { + return getMessageList("beams", ADCPBeam.class); + } + catch (Exception e) { + return null; + } + + } + + /** + * @param beams Beams Measurements + */ + public CurrentProfileCell setBeams(java.util.Collection beams) { + values.put("beams", beams); + return this; + } + +} diff --git a/src-generated/java/pt/lsts/imc/FluorescentDissolvedOrganicMatter.java b/src-generated/java/pt/lsts/imc/FluorescentDissolvedOrganicMatter.java new file mode 100644 index 00000000..43ecfa2e --- /dev/null +++ b/src-generated/java/pt/lsts/imc/FluorescentDissolvedOrganicMatter.java @@ -0,0 +1,104 @@ +/* + * Below is the copyright agreement for IMCJava. + * + * Copyright (c) 2010-2020, Laboratório de Sistemas e Tecnologia Subaquática + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * - Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * - Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * - Neither the names of IMC, LSTS, IMCJava nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL LABORATORIO DE SISTEMAS E TECNOLOGIA SUBAQUATICA + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE + * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ +package pt.lsts.imc; + + +/** + * IMC Message Fluorescent Dissolved Organic Matter (2004)
+ * Fluorescent Dissolved Organic Matter measurement.
+ */ + +public class FluorescentDissolvedOrganicMatter extends IMCMessage { + + public static final int ID_STATIC = 2004; + + public FluorescentDissolvedOrganicMatter() { + super(ID_STATIC); + } + + public FluorescentDissolvedOrganicMatter(IMCMessage msg) { + super(ID_STATIC); + try{ + copyFrom(msg); + } + catch (Exception e) { + e.printStackTrace(); + } + } + + public FluorescentDissolvedOrganicMatter(IMCDefinition defs) { + super(defs, ID_STATIC); + } + + public static FluorescentDissolvedOrganicMatter create(Object... values) { + FluorescentDissolvedOrganicMatter m = new FluorescentDissolvedOrganicMatter(); + for (int i = 0; i < values.length-1; i+= 2) + m.setValue(values[i].toString(), values[i+1]); + return m; + } + + public static FluorescentDissolvedOrganicMatter clone(IMCMessage msg) throws Exception { + + FluorescentDissolvedOrganicMatter m = new FluorescentDissolvedOrganicMatter(); + if (msg == null) + return m; + if(msg.definitions != m.definitions){ + msg = msg.cloneMessage(); + IMCUtil.updateMessage(msg, m.definitions); + } + else if (msg.getMgid()!=m.getMgid()) + throw new Exception("Argument "+msg.getAbbrev()+" is incompatible with message "+m.getAbbrev()); + + m.getHeader().values.putAll(msg.getHeader().values); + m.values.putAll(msg.values); + return m; + } + + public FluorescentDissolvedOrganicMatter(float value) { + super(ID_STATIC); + setValue(value); + } + + /** + * @return Value (ppb) - fp32_t + */ + public double getValue() { + return getDouble("value"); + } + + /** + * @param value Value (ppb) + */ + public FluorescentDissolvedOrganicMatter setValue(double value) { + values.put("value", value); + return this; + } + +} diff --git a/src-generated/java/pt/lsts/imc/FollowCommand.java b/src-generated/java/pt/lsts/imc/FollowCommand.java new file mode 100644 index 00000000..6d000640 --- /dev/null +++ b/src-generated/java/pt/lsts/imc/FollowCommand.java @@ -0,0 +1,136 @@ +/* + * Below is the copyright agreement for IMCJava. + * + * Copyright (c) 2010-2020, Laboratório de Sistemas e Tecnologia Subaquática + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * - Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * - Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * - Neither the names of IMC, LSTS, IMCJava nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL LABORATORIO DE SISTEMAS E TECNOLOGIA SUBAQUATICA + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE + * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ +package pt.lsts.imc; + + +/** + * IMC Message Follow Command Maneuver (496)
+ * This maneuver follows a direct command given by an external entity.
+ */ + +public class FollowCommand extends IMCMessage { + + public static final int ID_STATIC = 496; + + public FollowCommand() { + super(ID_STATIC); + } + + public FollowCommand(IMCMessage msg) { + super(ID_STATIC); + try{ + copyFrom(msg); + } + catch (Exception e) { + e.printStackTrace(); + } + } + + public FollowCommand(IMCDefinition defs) { + super(defs, ID_STATIC); + } + + public static FollowCommand create(Object... values) { + FollowCommand m = new FollowCommand(); + for (int i = 0; i < values.length-1; i+= 2) + m.setValue(values[i].toString(), values[i+1]); + return m; + } + + public static FollowCommand clone(IMCMessage msg) throws Exception { + + FollowCommand m = new FollowCommand(); + if (msg == null) + return m; + if(msg.definitions != m.definitions){ + msg = msg.cloneMessage(); + IMCUtil.updateMessage(msg, m.definitions); + } + else if (msg.getMgid()!=m.getMgid()) + throw new Exception("Argument "+msg.getAbbrev()+" is incompatible with message "+m.getAbbrev()); + + m.getHeader().values.putAll(msg.getHeader().values); + m.values.putAll(msg.values); + return m; + } + + public FollowCommand(int control_src, short control_ent, float timeout) { + super(ID_STATIC); + setControlSrc(control_src); + setControlEnt(control_ent); + setTimeout(timeout); + } + + /** + * @return Controlling Source - uint16_t + */ + public int getControlSrc() { + return getInteger("control_src"); + } + + /** + * @param control_src Controlling Source + */ + public FollowCommand setControlSrc(int control_src) { + values.put("control_src", control_src); + return this; + } + + /** + * @return Controlling Entity - uint8_t + */ + public short getControlEnt() { + return (short) getInteger("control_ent"); + } + + /** + * @param control_ent Controlling Entity + */ + public FollowCommand setControlEnt(short control_ent) { + values.put("control_ent", control_ent); + return this; + } + + /** + * @return Reference Update Timeout - fp32_t + */ + public double getTimeout() { + return getDouble("timeout"); + } + + /** + * @param timeout Reference Update Timeout + */ + public FollowCommand setTimeout(double timeout) { + values.put("timeout", timeout); + return this; + } + +} diff --git a/src-generated/java/pt/lsts/imc/FollowCommandState.java b/src-generated/java/pt/lsts/imc/FollowCommandState.java new file mode 100644 index 00000000..eb0c080d --- /dev/null +++ b/src-generated/java/pt/lsts/imc/FollowCommandState.java @@ -0,0 +1,210 @@ +/* + * Below is the copyright agreement for IMCJava. + * + * Copyright (c) 2010-2020, Laboratório de Sistemas e Tecnologia Subaquática + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * - Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * - Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * - Neither the names of IMC, LSTS, IMCJava nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL LABORATORIO DE SISTEMAS E TECNOLOGIA SUBAQUATICA + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE + * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ +package pt.lsts.imc; + + +/** + * IMC Message Follow Command State (498)
+ */ + +public class FollowCommandState extends IMCMessage { + + public enum STATE { + WAIT(1), + MOVING(2), + STOPPED(3), + BAD_COMMAND(4), + TIMEOUT(5); + + protected long value; + + public long value() { + return value; + } + + STATE(long value) { + this.value = value; + } + } + + public static final int ID_STATIC = 498; + + public FollowCommandState() { + super(ID_STATIC); + } + + public FollowCommandState(IMCMessage msg) { + super(ID_STATIC); + try{ + copyFrom(msg); + } + catch (Exception e) { + e.printStackTrace(); + } + } + + public FollowCommandState(IMCDefinition defs) { + super(defs, ID_STATIC); + } + + public static FollowCommandState create(Object... values) { + FollowCommandState m = new FollowCommandState(); + for (int i = 0; i < values.length-1; i+= 2) + m.setValue(values[i].toString(), values[i+1]); + return m; + } + + public static FollowCommandState clone(IMCMessage msg) throws Exception { + + FollowCommandState m = new FollowCommandState(); + if (msg == null) + return m; + if(msg.definitions != m.definitions){ + msg = msg.cloneMessage(); + IMCUtil.updateMessage(msg, m.definitions); + } + else if (msg.getMgid()!=m.getMgid()) + throw new Exception("Argument "+msg.getAbbrev()+" is incompatible with message "+m.getAbbrev()); + + m.getHeader().values.putAll(msg.getHeader().values); + m.values.putAll(msg.values); + return m; + } + + public FollowCommandState(int control_src, short control_ent, Command command, STATE state) { + super(ID_STATIC); + setControlSrc(control_src); + setControlEnt(control_ent); + if (command != null) + setCommand(command); + setState(state); + } + + /** + * @return Controlling Source - uint16_t + */ + public int getControlSrc() { + return getInteger("control_src"); + } + + /** + * @param control_src Controlling Source + */ + public FollowCommandState setControlSrc(int control_src) { + values.put("control_src", control_src); + return this; + } + + /** + * @return Controlling Entity - uint8_t + */ + public short getControlEnt() { + return (short) getInteger("control_ent"); + } + + /** + * @param control_ent Controlling Entity + */ + public FollowCommandState setControlEnt(short control_ent) { + values.put("control_ent", control_ent); + return this; + } + + /** + * @return Command - message + */ + public Command getCommand() { + try { + IMCMessage obj = getMessage("command"); + if (obj instanceof Command) + return (Command) obj; + else + return null; + } + catch (Exception e) { + return null; + } + + } + + /** + * @param command Command + */ + public FollowCommandState setCommand(Command command) { + values.put("command", command); + return this; + } + + /** + * @return State (enumerated) - uint8_t + */ + public STATE getState() { + try { + STATE o = STATE.valueOf(getMessageType().getFieldPossibleValues("state").get(getLong("state"))); + return o; + } + catch (Exception e) { + return null; + } + } + + public String getStateStr() { + return getString("state"); + } + + public short getStateVal() { + return (short) getInteger("state"); + } + + /** + * @param state State (enumerated) + */ + public FollowCommandState setState(STATE state) { + values.put("state", state.value()); + return this; + } + + /** + * @param state State (as a String) + */ + public FollowCommandState setStateStr(String state) { + setValue("state", state); + return this; + } + + /** + * @param state State (integer value) + */ + public FollowCommandState setStateVal(short state) { + setValue("state", state); + return this; + } + +} diff --git a/src-generated/java/pt/lsts/imc/GeoFeature.java b/src-generated/java/pt/lsts/imc/GeoFeature.java new file mode 100644 index 00000000..00edd300 --- /dev/null +++ b/src-generated/java/pt/lsts/imc/GeoFeature.java @@ -0,0 +1,127 @@ +/* + * Below is the copyright agreement for IMCJava. + * + * Copyright (c) 2010-2020, Laboratório de Sistemas e Tecnologia Subaquática + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * - Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * - Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * - Neither the names of IMC, LSTS, IMCJava nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL LABORATORIO DE SISTEMAS E TECNOLOGIA SUBAQUATICA + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE + * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ +package pt.lsts.imc; + + +/** + * IMC Message Geographical Feature (3002)
+ * This message holds a geographical that, according to the number of vertices, may correspond to a point, a line or polygon.
+ */ + +public class GeoFeature extends IMCMessage { + + public static final int ID_STATIC = 3002; + + public GeoFeature() { + super(ID_STATIC); + } + + public GeoFeature(IMCMessage msg) { + super(ID_STATIC); + try{ + copyFrom(msg); + } + catch (Exception e) { + e.printStackTrace(); + } + } + + public GeoFeature(IMCDefinition defs) { + super(defs, ID_STATIC); + } + + public static GeoFeature create(Object... values) { + GeoFeature m = new GeoFeature(); + for (int i = 0; i < values.length-1; i+= 2) + m.setValue(values[i].toString(), values[i+1]); + return m; + } + + public static GeoFeature clone(IMCMessage msg) throws Exception { + + GeoFeature m = new GeoFeature(); + if (msg == null) + return m; + if(msg.definitions != m.definitions){ + msg = msg.cloneMessage(); + IMCUtil.updateMessage(msg, m.definitions); + } + else if (msg.getMgid()!=m.getMgid()) + throw new Exception("Argument "+msg.getAbbrev()+" is incompatible with message "+m.getAbbrev()); + + m.getHeader().values.putAll(msg.getHeader().values); + m.values.putAll(msg.values); + return m; + } + + public GeoFeature(int feature_id, java.util.Collection points) { + super(ID_STATIC); + setFeatureId(feature_id); + if (points != null) + setPoints(points); + } + + /** + * @return Identifier - uint16_t + */ + public int getFeatureId() { + return getInteger("feature_id"); + } + + /** + * @param feature_id Identifier + */ + public GeoFeature setFeatureId(int feature_id) { + values.put("feature_id", feature_id); + return this; + } + + /** + * @return Points - message-list + */ + public java.util.Vector getPoints() { + try { + return getMessageList("points", MapPoint.class); + } + catch (Exception e) { + return null; + } + + } + + /** + * @param points Points + */ + public GeoFeature setPoints(java.util.Collection points) { + values.put("points", points); + return this; + } + +} diff --git a/src-generated/java/pt/lsts/imc/GpioState.java b/src-generated/java/pt/lsts/imc/GpioState.java new file mode 100644 index 00000000..26692cae --- /dev/null +++ b/src-generated/java/pt/lsts/imc/GpioState.java @@ -0,0 +1,121 @@ +/* + * Below is the copyright agreement for IMCJava. + * + * Copyright (c) 2010-2020, Laboratório de Sistemas e Tecnologia Subaquática + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * - Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * - Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * - Neither the names of IMC, LSTS, IMCJava nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL LABORATORIO DE SISTEMAS E TECNOLOGIA SUBAQUATICA + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE + * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ +package pt.lsts.imc; + + +/** + * IMC Message GPIO State (2000)
+ * Current state of a GPIO.
+ */ + +public class GpioState extends IMCMessage { + + public static final int ID_STATIC = 2000; + + public GpioState() { + super(ID_STATIC); + } + + public GpioState(IMCMessage msg) { + super(ID_STATIC); + try{ + copyFrom(msg); + } + catch (Exception e) { + e.printStackTrace(); + } + } + + public GpioState(IMCDefinition defs) { + super(defs, ID_STATIC); + } + + public static GpioState create(Object... values) { + GpioState m = new GpioState(); + for (int i = 0; i < values.length-1; i+= 2) + m.setValue(values[i].toString(), values[i+1]); + return m; + } + + public static GpioState clone(IMCMessage msg) throws Exception { + + GpioState m = new GpioState(); + if (msg == null) + return m; + if(msg.definitions != m.definitions){ + msg = msg.cloneMessage(); + IMCUtil.updateMessage(msg, m.definitions); + } + else if (msg.getMgid()!=m.getMgid()) + throw new Exception("Argument "+msg.getAbbrev()+" is incompatible with message "+m.getAbbrev()); + + m.getHeader().values.putAll(msg.getHeader().values); + m.values.putAll(msg.values); + return m; + } + + public GpioState(String name, short value) { + super(ID_STATIC); + if (name != null) + setName(name); + setValue(value); + } + + /** + * @return Name - plaintext + */ + public String getName() { + return getString("name"); + } + + /** + * @param name Name + */ + public GpioState setName(String name) { + values.put("name", name); + return this; + } + + /** + * @return Value - uint8_t + */ + public short getValue() { + return (short) getInteger("value"); + } + + /** + * @param value Value + */ + public GpioState setValue(short value) { + values.put("value", value); + return this; + } + +} diff --git a/src-generated/java/pt/lsts/imc/GpioStateGet.java b/src-generated/java/pt/lsts/imc/GpioStateGet.java new file mode 100644 index 00000000..b20c5e1d --- /dev/null +++ b/src-generated/java/pt/lsts/imc/GpioStateGet.java @@ -0,0 +1,106 @@ +/* + * Below is the copyright agreement for IMCJava. + * + * Copyright (c) 2010-2020, Laboratório de Sistemas e Tecnologia Subaquática + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * - Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * - Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * - Neither the names of IMC, LSTS, IMCJava nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL LABORATORIO DE SISTEMAS E TECNOLOGIA SUBAQUATICA + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE + * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ +package pt.lsts.imc; + + +/** + * IMC Message Get GPIO State (2001)
+ * Request the state of a given GPIO. The receiving entity shall reply
+ * with a GpioState message.
+ */ + +public class GpioStateGet extends IMCMessage { + + public static final int ID_STATIC = 2001; + + public GpioStateGet() { + super(ID_STATIC); + } + + public GpioStateGet(IMCMessage msg) { + super(ID_STATIC); + try{ + copyFrom(msg); + } + catch (Exception e) { + e.printStackTrace(); + } + } + + public GpioStateGet(IMCDefinition defs) { + super(defs, ID_STATIC); + } + + public static GpioStateGet create(Object... values) { + GpioStateGet m = new GpioStateGet(); + for (int i = 0; i < values.length-1; i+= 2) + m.setValue(values[i].toString(), values[i+1]); + return m; + } + + public static GpioStateGet clone(IMCMessage msg) throws Exception { + + GpioStateGet m = new GpioStateGet(); + if (msg == null) + return m; + if(msg.definitions != m.definitions){ + msg = msg.cloneMessage(); + IMCUtil.updateMessage(msg, m.definitions); + } + else if (msg.getMgid()!=m.getMgid()) + throw new Exception("Argument "+msg.getAbbrev()+" is incompatible with message "+m.getAbbrev()); + + m.getHeader().values.putAll(msg.getHeader().values); + m.values.putAll(msg.values); + return m; + } + + public GpioStateGet(String name) { + super(ID_STATIC); + if (name != null) + setName(name); + } + + /** + * @return Name - plaintext + */ + public String getName() { + return getString("name"); + } + + /** + * @param name Name + */ + public GpioStateGet setName(String name) { + values.put("name", name); + return this; + } + +} diff --git a/src-generated/java/pt/lsts/imc/GpioStateSet.java b/src-generated/java/pt/lsts/imc/GpioStateSet.java new file mode 100644 index 00000000..bb3bd2cc --- /dev/null +++ b/src-generated/java/pt/lsts/imc/GpioStateSet.java @@ -0,0 +1,122 @@ +/* + * Below is the copyright agreement for IMCJava. + * + * Copyright (c) 2010-2020, Laboratório de Sistemas e Tecnologia Subaquática + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * - Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * - Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * - Neither the names of IMC, LSTS, IMCJava nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL LABORATORIO DE SISTEMAS E TECNOLOGIA SUBAQUATICA + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE + * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ +package pt.lsts.imc; + + +/** + * IMC Message Set GPIO State (2002)
+ * Set the state of a given GPIO. The receiving entity shall reply
+ * with a GpioState message.
+ */ + +public class GpioStateSet extends IMCMessage { + + public static final int ID_STATIC = 2002; + + public GpioStateSet() { + super(ID_STATIC); + } + + public GpioStateSet(IMCMessage msg) { + super(ID_STATIC); + try{ + copyFrom(msg); + } + catch (Exception e) { + e.printStackTrace(); + } + } + + public GpioStateSet(IMCDefinition defs) { + super(defs, ID_STATIC); + } + + public static GpioStateSet create(Object... values) { + GpioStateSet m = new GpioStateSet(); + for (int i = 0; i < values.length-1; i+= 2) + m.setValue(values[i].toString(), values[i+1]); + return m; + } + + public static GpioStateSet clone(IMCMessage msg) throws Exception { + + GpioStateSet m = new GpioStateSet(); + if (msg == null) + return m; + if(msg.definitions != m.definitions){ + msg = msg.cloneMessage(); + IMCUtil.updateMessage(msg, m.definitions); + } + else if (msg.getMgid()!=m.getMgid()) + throw new Exception("Argument "+msg.getAbbrev()+" is incompatible with message "+m.getAbbrev()); + + m.getHeader().values.putAll(msg.getHeader().values); + m.values.putAll(msg.values); + return m; + } + + public GpioStateSet(String name, short value) { + super(ID_STATIC); + if (name != null) + setName(name); + setValue(value); + } + + /** + * @return Name - plaintext + */ + public String getName() { + return getString("name"); + } + + /** + * @param name Name + */ + public GpioStateSet setName(String name) { + values.put("name", name); + return this; + } + + /** + * @return Value - uint8_t + */ + public short getValue() { + return (short) getInteger("value"); + } + + /** + * @param value Value + */ + public GpioStateSet setValue(short value) { + values.put("value", value); + return this; + } + +} diff --git a/src-generated/java/pt/lsts/imc/ImcStringDefs.java b/src-generated/java/pt/lsts/imc/ImcStringDefs.java index 1a39d98c..66c6c4fe 100644 --- a/src-generated/java/pt/lsts/imc/ImcStringDefs.java +++ b/src-generated/java/pt/lsts/imc/ImcStringDefs.java @@ -31,9 +31,9 @@ public class ImcStringDefs { - public static final String IMC_SHA = "8be592ac50fb8f076c8c2e963fab4700f13f2eac"; - public static final String IMC_BRANCH = "master"; - public static final String IMC_COMMIT = "Paulo Dias (paulo.sousa.dias@gmail.com), 2021-12-07T14:57:24Z, https://github.com/LSTS/imc/commit/8be592ac50fb8f076c8c2e963fab4700f13f2eac, Merge branch 'feature/unify-v1'\n\n# Conflicts:\n# IMC.xml\n# IMC_Addresses.xml\n# Om UamTxStatus removed enum in value NO_TRANSDUCER (it will return on unify merge)"; + public static final String IMC_SHA = "f6426e82a74497cd3af0e8c039d78911a5521643"; + public static final String IMC_BRANCH = "f6426e8"; + public static final String IMC_COMMIT = "Paulo Dias (paulo.sousa.dias@gmail.com), 2023-04-23T13:56:51Z, https://github.com/LSTS/imc/commit/f6426e82a74497cd3af0e8c039d78911a5521643, Updated copy years."; public static java.util.Map IMC_ADDRESSES = new java.util.LinkedHashMap(); @@ -65,7 +65,6 @@ public class ImcStringDefs { IMC_ADDRESSES.put("squirtle", 1027); IMC_ADDRESSES.put("swordfish", 2049); IMC_ADDRESSES.put("caravela", 2050); - IMC_ADDRESSES.put("otter", 2051); IMC_ADDRESSES.put("hermes", 2241); IMC_ADDRESSES.put("hermes-desired", 2242); IMC_ADDRESSES.put("hermes-target", 2243); diff --git a/src-generated/java/pt/lsts/imc/IridiumMsgTxExtended.java b/src-generated/java/pt/lsts/imc/IridiumMsgTxExtended.java new file mode 100644 index 00000000..64d68cbe --- /dev/null +++ b/src-generated/java/pt/lsts/imc/IridiumMsgTxExtended.java @@ -0,0 +1,169 @@ +/* + * Below is the copyright agreement for IMCJava. + * + * Copyright (c) 2010-2020, Laboratório de Sistemas e Tecnologia Subaquática + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * - Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * - Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * - Neither the names of IMC, LSTS, IMCJava nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL LABORATORIO DE SISTEMAS E TECNOLOGIA SUBAQUATICA + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE + * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ +package pt.lsts.imc; + + +/** + * IMC Message Transmit Iridium Message (Extended) (2005)
+ */ + +public class IridiumMsgTxExtended extends IMCMessage { + + public static final int ID_STATIC = 2005; + + public IridiumMsgTxExtended() { + super(ID_STATIC); + } + + public IridiumMsgTxExtended(IMCMessage msg) { + super(ID_STATIC); + try{ + copyFrom(msg); + } + catch (Exception e) { + e.printStackTrace(); + } + } + + public IridiumMsgTxExtended(IMCDefinition defs) { + super(defs, ID_STATIC); + } + + public static IridiumMsgTxExtended create(Object... values) { + IridiumMsgTxExtended m = new IridiumMsgTxExtended(); + for (int i = 0; i < values.length-1; i+= 2) + m.setValue(values[i].toString(), values[i+1]); + return m; + } + + public static IridiumMsgTxExtended clone(IMCMessage msg) throws Exception { + + IridiumMsgTxExtended m = new IridiumMsgTxExtended(); + if (msg == null) + return m; + if(msg.definitions != m.definitions){ + msg = msg.cloneMessage(); + IMCUtil.updateMessage(msg, m.definitions); + } + else if (msg.getMgid()!=m.getMgid()) + throw new Exception("Argument "+msg.getAbbrev()+" is incompatible with message "+m.getAbbrev()); + + m.getHeader().values.putAll(msg.getHeader().values); + m.values.putAll(msg.values); + return m; + } + + public IridiumMsgTxExtended(int req_id, int ttl, long expiration, String destination, byte[] data) { + super(ID_STATIC); + setReqId(req_id); + setTtl(ttl); + setExpiration(expiration); + if (destination != null) + setDestination(destination); + if (data != null) + setData(data); + } + + /** + * @return Request Identifier - uint16_t + */ + public int getReqId() { + return getInteger("req_id"); + } + + /** + * @param req_id Request Identifier + */ + public IridiumMsgTxExtended setReqId(int req_id) { + values.put("req_id", req_id); + return this; + } + + /** + * @return Time to live (s) - uint16_t + */ + public int getTtl() { + return getInteger("ttl"); + } + + /** + * @param ttl Time to live (s) + */ + public IridiumMsgTxExtended setTtl(int ttl) { + values.put("ttl", ttl); + return this; + } + + /** + * @return Expiration Time (s) - uint32_t + */ + public long getExpiration() { + return getLong("expiration"); + } + + /** + * @param expiration Expiration Time (s) + */ + public IridiumMsgTxExtended setExpiration(long expiration) { + values.put("expiration", expiration); + return this; + } + + /** + * @return Destination Identifier - plaintext + */ + public String getDestination() { + return getString("destination"); + } + + /** + * @param destination Destination Identifier + */ + public IridiumMsgTxExtended setDestination(String destination) { + values.put("destination", destination); + return this; + } + + /** + * @return Data - rawdata + */ + public byte[] getData() { + return getRawData("data"); + } + + /** + * @param data Data + */ + public IridiumMsgTxExtended setData(byte[] data) { + values.put("data", data); + return this; + } + +} diff --git a/src-generated/java/pt/lsts/imc/ManeuverDone.java b/src-generated/java/pt/lsts/imc/ManeuverDone.java index e073c88d..1a664883 100644 --- a/src-generated/java/pt/lsts/imc/ManeuverDone.java +++ b/src-generated/java/pt/lsts/imc/ManeuverDone.java @@ -31,13 +31,13 @@ /** - * IMC Message Maneuver Done (497)
+ * IMC Message Maneuver Done (719)
* Notification of completion of a maneuver (optional use).
*/ public class ManeuverDone extends IMCMessage { - public static final int ID_STATIC = 497; + public static final int ID_STATIC = 719; public ManeuverDone() { super(ID_STATIC); diff --git a/src-generated/java/pt/lsts/imc/MessageFactory.java b/src-generated/java/pt/lsts/imc/MessageFactory.java index 7c1cdefe..a083a4e2 100644 --- a/src-generated/java/pt/lsts/imc/MessageFactory.java +++ b/src-generated/java/pt/lsts/imc/MessageFactory.java @@ -468,10 +468,12 @@ private IMCMessage createTypedMessage(int mgid, IMCDefinition defs) { return new FollowPoint(defs); case Alignment.ID_STATIC: return new Alignment(defs); - case StationKeepingExtended.ID_STATIC: - return new StationKeepingExtended(defs); - case ManeuverDone.ID_STATIC: - return new ManeuverDone(defs); + case FollowCommand.ID_STATIC: + return new FollowCommand(defs); + case Command.ID_STATIC: + return new Command(defs); + case FollowCommandState.ID_STATIC: + return new FollowCommandState(defs); case Magnetometer.ID_STATIC: return new Magnetometer(defs); case VehicleState.ID_STATIC: @@ -520,6 +522,8 @@ private IMCMessage createTypedMessage(int mgid, IMCDefinition defs) { return new TCPRequest(defs); case TCPStatus.ID_STATIC: return new TCPStatus(defs); + case AssetReport.ID_STATIC: + return new AssetReport(defs); case Abort.ID_STATIC: return new Abort(defs); case PlanSpecification.ID_STATIC: @@ -582,6 +586,10 @@ private IMCMessage createTypedMessage(int mgid, IMCDefinition defs) { return new CompressedImage(defs); case ImageTxSettings.ID_STATIC: return new ImageTxSettings(defs); + case ManeuverDone.ID_STATIC: + return new ManeuverDone(defs); + case StationKeepingExtended.ID_STATIC: + return new StationKeepingExtended(defs); case RemoteState.ID_STATIC: return new RemoteState(defs); case Target.ID_STATIC: @@ -684,8 +692,68 @@ private IMCMessage createTypedMessage(int mgid, IMCDefinition defs) { return new DmsDetection(defs); case HomePosition.ID_STATIC: return new HomePosition(defs); + case ChargingState.ID_STATIC: + return new ChargingState(defs); + case CurrentProfile.ID_STATIC: + return new CurrentProfile(defs); + case CurrentProfileCell.ID_STATIC: + return new CurrentProfileCell(defs); + case ADCPBeam.ID_STATIC: + return new ADCPBeam(defs); + case GpioState.ID_STATIC: + return new GpioState(defs); + case GpioStateGet.ID_STATIC: + return new GpioStateGet(defs); + case GpioStateSet.ID_STATIC: + return new GpioStateSet(defs); + case ColoredDissolvedOrganicMatter.ID_STATIC: + return new ColoredDissolvedOrganicMatter(defs); + case FluorescentDissolvedOrganicMatter.ID_STATIC: + return new FluorescentDissolvedOrganicMatter(defs); + case IridiumMsgTxExtended.ID_STATIC: + return new IridiumMsgTxExtended(defs); case TotalMagIntensity.ID_STATIC: return new TotalMagIntensity(defs); + case ValidatePlan.ID_STATIC: + return new ValidatePlan(defs); + case TypedEntityParameter.ID_STATIC: + return new TypedEntityParameter(defs); + case TypedEntityParameters.ID_STATIC: + return new TypedEntityParameters(defs); + case CommRestriction.ID_STATIC: + return new CommRestriction(defs); + case WifiStats.ID_STATIC: + return new WifiStats(defs); + case WifiNetwork.ID_STATIC: + return new WifiNetwork(defs); + case SonarPulse.ID_STATIC: + return new SonarPulse(defs); + case WorldModel.ID_STATIC: + return new WorldModel(defs); + case GeoFeature.ID_STATIC: + return new GeoFeature(defs); + case CoverageState.ID_STATIC: + return new CoverageState(defs); + case TaskAdmin.ID_STATIC: + return new TaskAdmin(defs); + case SynchAdmin.ID_STATIC: + return new SynchAdmin(defs); + case VehicleCapabilities.ID_STATIC: + return new VehicleCapabilities(defs); + case CapabilityAreaSurvey.ID_STATIC: + return new CapabilityAreaSurvey(defs); + case CapabilityPointSurvey.ID_STATIC: + return new CapabilityPointSurvey(defs); + case CapabilityMove.ID_STATIC: + return new CapabilityMove(defs); + case SurveyTask.ID_STATIC: + return new SurveyTask(defs); + case MoveTask.ID_STATIC: + return new MoveTask(defs); + case TaskStatus.ID_STATIC: + return new TaskStatus(defs); + case SynchTask.ID_STATIC: + return new SynchTask(defs); default: return new IMCMessage(defs); } diff --git a/src-generated/java/pt/lsts/imc/MoveTask.java b/src-generated/java/pt/lsts/imc/MoveTask.java new file mode 100644 index 00000000..a77cf76b --- /dev/null +++ b/src-generated/java/pt/lsts/imc/MoveTask.java @@ -0,0 +1,147 @@ +/* + * Below is the copyright agreement for IMCJava. + * + * Copyright (c) 2010-2020, Laboratório de Sistemas e Tecnologia Subaquática + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * - Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * - Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * - Neither the names of IMC, LSTS, IMCJava nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL LABORATORIO DE SISTEMAS E TECNOLOGIA SUBAQUATICA + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE + * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ +package pt.lsts.imc; + + +/** + * IMC Message Move Task (3102)
+ * This message is used to describe an area surveying task.
+ */ + +public class MoveTask extends TaskAdminArgs { + + public static final int ID_STATIC = 3102; + + public MoveTask() { + super(ID_STATIC); + } + + public MoveTask(IMCMessage msg) { + super(ID_STATIC); + try{ + copyFrom(msg); + } + catch (Exception e) { + e.printStackTrace(); + } + } + + public MoveTask(IMCDefinition defs) { + super(defs, ID_STATIC); + } + + public static MoveTask create(Object... values) { + MoveTask m = new MoveTask(); + for (int i = 0; i < values.length-1; i+= 2) + m.setValue(values[i].toString(), values[i+1]); + return m; + } + + public static MoveTask clone(IMCMessage msg) throws Exception { + + MoveTask m = new MoveTask(); + if (msg == null) + return m; + if(msg.definitions != m.definitions){ + msg = msg.cloneMessage(); + IMCUtil.updateMessage(msg, m.definitions); + } + else if (msg.getMgid()!=m.getMgid()) + throw new Exception("Argument "+msg.getAbbrev()+" is incompatible with message "+m.getAbbrev()); + + m.getHeader().values.putAll(msg.getHeader().values); + m.values.putAll(msg.values); + return m; + } + + public MoveTask(int task_id, MapPoint destination, double deadline) { + super(ID_STATIC); + setTaskId(task_id); + if (destination != null) + setDestination(destination); + setDeadline(deadline); + } + + /** + * @return Task Identifier - uint16_t + */ + public int getTaskId() { + return getInteger("task_id"); + } + + /** + * @param task_id Task Identifier + */ + public MoveTask setTaskId(int task_id) { + values.put("task_id", task_id); + return this; + } + + /** + * @return Destination - message + */ + public MapPoint getDestination() { + try { + IMCMessage obj = getMessage("destination"); + if (obj instanceof MapPoint) + return (MapPoint) obj; + else + return null; + } + catch (Exception e) { + return null; + } + + } + + /** + * @param destination Destination + */ + public MoveTask setDestination(MapPoint destination) { + values.put("destination", destination); + return this; + } + + /** + * @return Deadline (s) - fp64_t + */ + public double getDeadline() { + return getDouble("deadline"); + } + + /** + * @param deadline Deadline (s) + */ + public MoveTask setDeadline(double deadline) { + values.put("deadline", deadline); + return this; + } + +} diff --git a/src-generated/java/pt/lsts/imc/SonarData.java b/src-generated/java/pt/lsts/imc/SonarData.java index e68e84de..1b8d9b2b 100644 --- a/src-generated/java/pt/lsts/imc/SonarData.java +++ b/src-generated/java/pt/lsts/imc/SonarData.java @@ -67,16 +67,16 @@ * +--------+------------------+-----+
* | Section| Flag Label | Bit |
* +========+==================+=====+
- * | H3.1 | Intensities flag | 0 |
+ * | H4.1 | Intensities flag | 0 |
* +--------+------------------+-----+
- * | H3.2 | Angle step flag | 1 |
+ * | H4.2 | Angle step flag | 1 |
* +--------+------------------+-----+
* Notes:
* Each angle at step *i can be calculated is defined by:
* .. code-block:: python
* angle[i] = H2_start_angle + (32-bit sum of D1_angle_step[0] through D1_angle_step[i]) * H4_scaling_factor
- * * If bit H3.1 is not set then sections H5 and D3 won't exist.
- * * If bit H3.2 is not set then sections H4 and D1 won't exist. In case this bit is set, then the angle steps is read from field "Beam Width" from "Beam Configuration".
+ * * If bit H4.1 is not set then sections H5 and D3 won't exist.
+ * * If bit H4.2 is not set then sections H4 and D1 won't exist. In case this bit is set, then the angle steps is read from field "Beam Width" from "Beam Configuration".
* The type *uintX_t will depend on the number of bits per unit, and it should be a multiple of 8.
* * Furthermore, for now, 32 bits is the highest value of bits per unit supported.
* How to write ranges and intensities data:
diff --git a/src-generated/java/pt/lsts/imc/SonarPulse.java b/src-generated/java/pt/lsts/imc/SonarPulse.java new file mode 100644 index 00000000..09233e15 --- /dev/null +++ b/src-generated/java/pt/lsts/imc/SonarPulse.java @@ -0,0 +1,152 @@ +/* + * Below is the copyright agreement for IMCJava. + * + * Copyright (c) 2010-2020, Laboratório de Sistemas e Tecnologia Subaquática + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * - Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * - Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * - Neither the names of IMC, LSTS, IMCJava nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL LABORATORIO DE SISTEMAS E TECNOLOGIA SUBAQUATICA + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE + * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ +package pt.lsts.imc; + + +/** + * IMC Message Sonar Pulse (2013)
+ * Information regarding a sent/received Sonar pulse.
+ */ + +public class SonarPulse extends IMCMessage { + + public static final int ID_STATIC = 2013; + + public SonarPulse() { + super(ID_STATIC); + } + + public SonarPulse(IMCMessage msg) { + super(ID_STATIC); + try{ + copyFrom(msg); + } + catch (Exception e) { + e.printStackTrace(); + } + } + + public SonarPulse(IMCDefinition defs) { + super(defs, ID_STATIC); + } + + public static SonarPulse create(Object... values) { + SonarPulse m = new SonarPulse(); + for (int i = 0; i < values.length-1; i+= 2) + m.setValue(values[i].toString(), values[i+1]); + return m; + } + + public static SonarPulse clone(IMCMessage msg) throws Exception { + + SonarPulse m = new SonarPulse(); + if (msg == null) + return m; + if(msg.definitions != m.definitions){ + msg = msg.cloneMessage(); + IMCUtil.updateMessage(msg, m.definitions); + } + else if (msg.getMgid()!=m.getMgid()) + throw new Exception("Argument "+msg.getAbbrev()+" is incompatible with message "+m.getAbbrev()); + + m.getHeader().values.putAll(msg.getHeader().values); + m.values.putAll(msg.values); + return m; + } + + public SonarPulse(int frequency, int pulse_length, int time_delay, int simulated_speed) { + super(ID_STATIC); + setFrequency(frequency); + setPulseLength(pulse_length); + setTimeDelay(time_delay); + setSimulatedSpeed(simulated_speed); + } + + /** + * @return Frequency (hz) - int32_t + */ + public int getFrequency() { + return getInteger("frequency"); + } + + /** + * @param frequency Frequency (hz) + */ + public SonarPulse setFrequency(int frequency) { + values.put("frequency", frequency); + return this; + } + + /** + * @return Pulse Length (ms) - int32_t + */ + public int getPulseLength() { + return getInteger("pulse_length"); + } + + /** + * @param pulse_length Pulse Length (ms) + */ + public SonarPulse setPulseLength(int pulse_length) { + values.put("pulse_length", pulse_length); + return this; + } + + /** + * @return Time Delay (ms) - int32_t + */ + public int getTimeDelay() { + return getInteger("time_delay"); + } + + /** + * @param time_delay Time Delay (ms) + */ + public SonarPulse setTimeDelay(int time_delay) { + values.put("time_delay", time_delay); + return this; + } + + /** + * @return Simulated Speed (m/s) - int32_t + */ + public int getSimulatedSpeed() { + return getInteger("simulated_speed"); + } + + /** + * @param simulated_speed Simulated Speed (m/s) + */ + public SonarPulse setSimulatedSpeed(int simulated_speed) { + values.put("simulated_speed", simulated_speed); + return this; + } + +} diff --git a/src-generated/java/pt/lsts/imc/StationKeepingExtended.java b/src-generated/java/pt/lsts/imc/StationKeepingExtended.java index 7b45c4eb..d6b3ab9a 100644 --- a/src-generated/java/pt/lsts/imc/StationKeepingExtended.java +++ b/src-generated/java/pt/lsts/imc/StationKeepingExtended.java @@ -33,7 +33,7 @@ import pt.lsts.imc.def.SpeedUnits; /** - * IMC Message Station Keeping Extended (496)
+ * IMC Message Station Keeping Extended (720)
* The Station Keeping Extended maneuver makes the vehicle come to the surface
* and then enter a given circular perimeter around a waypoint coordinate
* for a certain amount of time. It extends the Station Keeping maneuver with the feature
@@ -45,7 +45,7 @@ public class StationKeepingExtended extends Maneuver { public static final short FLG_KEEP_SAFE = 0x01; - public static final int ID_STATIC = 496; + public static final int ID_STATIC = 720; public StationKeepingExtended() { super(ID_STATIC); diff --git a/src-generated/java/pt/lsts/imc/SurveyTask.java b/src-generated/java/pt/lsts/imc/SurveyTask.java new file mode 100644 index 00000000..7dd55913 --- /dev/null +++ b/src-generated/java/pt/lsts/imc/SurveyTask.java @@ -0,0 +1,199 @@ +/* + * Below is the copyright agreement for IMCJava. + * + * Copyright (c) 2010-2020, Laboratório de Sistemas e Tecnologia Subaquática + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * - Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * - Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * - Neither the names of IMC, LSTS, IMCJava nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL LABORATORIO DE SISTEMAS E TECNOLOGIA SUBAQUATICA + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE + * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ +package pt.lsts.imc; + +import pt.lsts.imc.def.SensorType; + +/** + * IMC Message Survey Task (3101)
+ * This message is used to describe an area surveying task.
+ */ + +public class SurveyTask extends TaskAdminArgs { + + public static final int ID_STATIC = 3101; + + public SurveyTask() { + super(ID_STATIC); + } + + public SurveyTask(IMCMessage msg) { + super(ID_STATIC); + try{ + copyFrom(msg); + } + catch (Exception e) { + e.printStackTrace(); + } + } + + public SurveyTask(IMCDefinition defs) { + super(defs, ID_STATIC); + } + + public static SurveyTask create(Object... values) { + SurveyTask m = new SurveyTask(); + for (int i = 0; i < values.length-1; i+= 2) + m.setValue(values[i].toString(), values[i+1]); + return m; + } + + public static SurveyTask clone(IMCMessage msg) throws Exception { + + SurveyTask m = new SurveyTask(); + if (msg == null) + return m; + if(msg.definitions != m.definitions){ + msg = msg.cloneMessage(); + IMCUtil.updateMessage(msg, m.definitions); + } + else if (msg.getMgid()!=m.getMgid()) + throw new Exception("Argument "+msg.getAbbrev()+" is incompatible with message "+m.getAbbrev()); + + m.getHeader().values.putAll(msg.getHeader().values); + m.values.putAll(msg.values); + return m; + } + + public SurveyTask(int task_id, int feature_id, SensorType sensor, float resolution, double deadline) { + super(ID_STATIC); + setTaskId(task_id); + setFeatureId(feature_id); + setSensor(sensor); + setResolution(resolution); + setDeadline(deadline); + } + + /** + * @return Task Identifier - uint16_t + */ + public int getTaskId() { + return getInteger("task_id"); + } + + /** + * @param task_id Task Identifier + */ + public SurveyTask setTaskId(int task_id) { + values.put("task_id", task_id); + return this; + } + + /** + * @return Geo Feature Identifier - uint16_t + */ + public int getFeatureId() { + return getInteger("feature_id"); + } + + /** + * @param feature_id Geo Feature Identifier + */ + public SurveyTask setFeatureId(int feature_id) { + values.put("feature_id", feature_id); + return this; + } + + /** + * @return Sensor (enumerated) - uint8_t + */ + public SensorType getSensor() { + try { + SensorType o = SensorType.valueOf(getMessageType().getFieldPossibleValues("sensor").get(getLong("sensor"))); + return o; + } + catch (Exception e) { + return null; + } + } + + public String getSensorStr() { + return getString("sensor"); + } + + public short getSensorVal() { + return (short) getInteger("sensor"); + } + + /** + * @param sensor Sensor (enumerated) + */ + public SurveyTask setSensor(SensorType sensor) { + values.put("sensor", sensor.value()); + return this; + } + + /** + * @param sensor Sensor (as a String) + */ + public SurveyTask setSensorStr(String sensor) { + setValue("sensor", sensor); + return this; + } + + /** + * @param sensor Sensor (integer value) + */ + public SurveyTask setSensorVal(short sensor) { + setValue("sensor", sensor); + return this; + } + + /** + * @return Resolution (px/m²) - fp32_t + */ + public double getResolution() { + return getDouble("resolution"); + } + + /** + * @param resolution Resolution (px/m²) + */ + public SurveyTask setResolution(double resolution) { + values.put("resolution", resolution); + return this; + } + + /** + * @return Deadline (s) - fp64_t + */ + public double getDeadline() { + return getDouble("deadline"); + } + + /** + * @param deadline Deadline (s) + */ + public SurveyTask setDeadline(double deadline) { + values.put("deadline", deadline); + return this; + } + +} diff --git a/src-generated/java/pt/lsts/imc/SynchAdmin.java b/src-generated/java/pt/lsts/imc/SynchAdmin.java new file mode 100644 index 00000000..11cbb17a --- /dev/null +++ b/src-generated/java/pt/lsts/imc/SynchAdmin.java @@ -0,0 +1,150 @@ +/* + * Below is the copyright agreement for IMCJava. + * + * Copyright (c) 2010-2020, Laboratório de Sistemas e Tecnologia Subaquática + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * - Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * - Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * - Neither the names of IMC, LSTS, IMCJava nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL LABORATORIO DE SISTEMAS E TECNOLOGIA SUBAQUATICA + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE + * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ +package pt.lsts.imc; + + +/** + * IMC Message Synchronization Administration (3005)
+ * This message is used to control the state of execution for the entire system.
+ */ + +public class SynchAdmin extends IMCMessage { + + public enum OP { + HOLD(1), + RESUME(2), + INTERRUPT(3); + + protected long value; + + public long value() { + return value; + } + + OP(long value) { + this.value = value; + } + } + + public static final int ID_STATIC = 3005; + + public SynchAdmin() { + super(ID_STATIC); + } + + public SynchAdmin(IMCMessage msg) { + super(ID_STATIC); + try{ + copyFrom(msg); + } + catch (Exception e) { + e.printStackTrace(); + } + } + + public SynchAdmin(IMCDefinition defs) { + super(defs, ID_STATIC); + } + + public static SynchAdmin create(Object... values) { + SynchAdmin m = new SynchAdmin(); + for (int i = 0; i < values.length-1; i+= 2) + m.setValue(values[i].toString(), values[i+1]); + return m; + } + + public static SynchAdmin clone(IMCMessage msg) throws Exception { + + SynchAdmin m = new SynchAdmin(); + if (msg == null) + return m; + if(msg.definitions != m.definitions){ + msg = msg.cloneMessage(); + IMCUtil.updateMessage(msg, m.definitions); + } + else if (msg.getMgid()!=m.getMgid()) + throw new Exception("Argument "+msg.getAbbrev()+" is incompatible with message "+m.getAbbrev()); + + m.getHeader().values.putAll(msg.getHeader().values); + m.values.putAll(msg.values); + return m; + } + + public SynchAdmin(OP op) { + super(ID_STATIC); + setOp(op); + } + + /** + * @return Operation (enumerated) - uint8_t + */ + public OP getOp() { + try { + OP o = OP.valueOf(getMessageType().getFieldPossibleValues("op").get(getLong("op"))); + return o; + } + catch (Exception e) { + return null; + } + } + + public String getOpStr() { + return getString("op"); + } + + public short getOpVal() { + return (short) getInteger("op"); + } + + /** + * @param op Operation (enumerated) + */ + public SynchAdmin setOp(OP op) { + values.put("op", op.value()); + return this; + } + + /** + * @param op Operation (as a String) + */ + public SynchAdmin setOpStr(String op) { + setValue("op", op); + return this; + } + + /** + * @param op Operation (integer value) + */ + public SynchAdmin setOpVal(short op) { + setValue("op", op); + return this; + } + +} diff --git a/src-generated/java/pt/lsts/imc/SynchTask.java b/src-generated/java/pt/lsts/imc/SynchTask.java new file mode 100644 index 00000000..15675db9 --- /dev/null +++ b/src-generated/java/pt/lsts/imc/SynchTask.java @@ -0,0 +1,152 @@ +/* + * Below is the copyright agreement for IMCJava. + * + * Copyright (c) 2010-2020, Laboratório de Sistemas e Tecnologia Subaquática + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * - Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * - Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * - Neither the names of IMC, LSTS, IMCJava nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL LABORATORIO DE SISTEMAS E TECNOLOGIA SUBAQUATICA + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE + * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ +package pt.lsts.imc; + + +/** + * IMC Message Synchronization Task (3104)
+ * This message is used to describe an area synchronization task.
+ */ + +public class SynchTask extends TaskAdminArgs { + + public static final int ID_STATIC = 3104; + + public SynchTask() { + super(ID_STATIC); + } + + public SynchTask(IMCMessage msg) { + super(ID_STATIC); + try{ + copyFrom(msg); + } + catch (Exception e) { + e.printStackTrace(); + } + } + + public SynchTask(IMCDefinition defs) { + super(defs, ID_STATIC); + } + + public static SynchTask create(Object... values) { + SynchTask m = new SynchTask(); + for (int i = 0; i < values.length-1; i+= 2) + m.setValue(values[i].toString(), values[i+1]); + return m; + } + + public static SynchTask clone(IMCMessage msg) throws Exception { + + SynchTask m = new SynchTask(); + if (msg == null) + return m; + if(msg.definitions != m.definitions){ + msg = msg.cloneMessage(); + IMCUtil.updateMessage(msg, m.definitions); + } + else if (msg.getMgid()!=m.getMgid()) + throw new Exception("Argument "+msg.getAbbrev()+" is incompatible with message "+m.getAbbrev()); + + m.getHeader().values.putAll(msg.getHeader().values); + m.values.putAll(msg.values); + return m; + } + + public SynchTask(int task_id, int feature_id, int time_window, double deadline) { + super(ID_STATIC); + setTaskId(task_id); + setFeatureId(feature_id); + setTimeWindow(time_window); + setDeadline(deadline); + } + + /** + * @return Task Identifier - uint16_t + */ + public int getTaskId() { + return getInteger("task_id"); + } + + /** + * @param task_id Task Identifier + */ + public SynchTask setTaskId(int task_id) { + values.put("task_id", task_id); + return this; + } + + /** + * @return Geo Feature Identifier - uint16_t + */ + public int getFeatureId() { + return getInteger("feature_id"); + } + + /** + * @param feature_id Geo Feature Identifier + */ + public SynchTask setFeatureId(int feature_id) { + values.put("feature_id", feature_id); + return this; + } + + /** + * @return Synchronization Time Window (s) - uint16_t + */ + public int getTimeWindow() { + return getInteger("time_window"); + } + + /** + * @param time_window Synchronization Time Window (s) + */ + public SynchTask setTimeWindow(int time_window) { + values.put("time_window", time_window); + return this; + } + + /** + * @return Deadline (s) - fp64_t + */ + public double getDeadline() { + return getDouble("deadline"); + } + + /** + * @param deadline Deadline (s) + */ + public SynchTask setDeadline(double deadline) { + values.put("deadline", deadline); + return this; + } + +} diff --git a/src-generated/java/pt/lsts/imc/TaskAdmin.java b/src-generated/java/pt/lsts/imc/TaskAdmin.java new file mode 100644 index 00000000..76ffe3e3 --- /dev/null +++ b/src-generated/java/pt/lsts/imc/TaskAdmin.java @@ -0,0 +1,195 @@ +/* + * Below is the copyright agreement for IMCJava. + * + * Copyright (c) 2010-2020, Laboratório de Sistemas e Tecnologia Subaquática + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * - Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * - Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * - Neither the names of IMC, LSTS, IMCJava nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL LABORATORIO DE SISTEMAS E TECNOLOGIA SUBAQUATICA + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE + * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ +package pt.lsts.imc; + + +/** + * IMC Message Task Administration (3004)
+ */ + +public class TaskAdmin extends IMCMessage { + + public enum OP { + ACCEPT(1), + REJECT(2), + ASSIGN(3), + UNASSIGN(4), + STATUS(5), + STATUS_REQUEST(6); + + protected long value; + + public long value() { + return value; + } + + OP(long value) { + this.value = value; + } + } + + public static final int ID_STATIC = 3004; + + public TaskAdmin() { + super(ID_STATIC); + } + + public TaskAdmin(IMCMessage msg) { + super(ID_STATIC); + try{ + copyFrom(msg); + } + catch (Exception e) { + e.printStackTrace(); + } + } + + public TaskAdmin(IMCDefinition defs) { + super(defs, ID_STATIC); + } + + public static TaskAdmin create(Object... values) { + TaskAdmin m = new TaskAdmin(); + for (int i = 0; i < values.length-1; i+= 2) + m.setValue(values[i].toString(), values[i+1]); + return m; + } + + public static TaskAdmin clone(IMCMessage msg) throws Exception { + + TaskAdmin m = new TaskAdmin(); + if (msg == null) + return m; + if(msg.definitions != m.definitions){ + msg = msg.cloneMessage(); + IMCUtil.updateMessage(msg, m.definitions); + } + else if (msg.getMgid()!=m.getMgid()) + throw new Exception("Argument "+msg.getAbbrev()+" is incompatible with message "+m.getAbbrev()); + + m.getHeader().values.putAll(msg.getHeader().values); + m.values.putAll(msg.values); + return m; + } + + public TaskAdmin(int tid, OP op, TaskAdminArgs arg) { + super(ID_STATIC); + setTid(tid); + setOp(op); + if (arg != null) + setArg(arg); + } + + /** + * @return Task Identifier - uint16_t + */ + public int getTid() { + return getInteger("tid"); + } + + /** + * @param tid Task Identifier + */ + public TaskAdmin setTid(int tid) { + values.put("tid", tid); + return this; + } + + /** + * @return Operation (enumerated) - uint8_t + */ + public OP getOp() { + try { + OP o = OP.valueOf(getMessageType().getFieldPossibleValues("op").get(getLong("op"))); + return o; + } + catch (Exception e) { + return null; + } + } + + public String getOpStr() { + return getString("op"); + } + + public short getOpVal() { + return (short) getInteger("op"); + } + + /** + * @param op Operation (enumerated) + */ + public TaskAdmin setOp(OP op) { + values.put("op", op.value()); + return this; + } + + /** + * @param op Operation (as a String) + */ + public TaskAdmin setOpStr(String op) { + setValue("op", op); + return this; + } + + /** + * @param op Operation (integer value) + */ + public TaskAdmin setOpVal(short op) { + setValue("op", op); + return this; + } + + /** + * @return Argument - message + */ + public TaskAdminArgs getArg() { + try { + IMCMessage obj = getMessage("arg"); + if (obj instanceof TaskAdminArgs) + return (TaskAdminArgs) obj; + else + return null; + } + catch (Exception e) { + return null; + } + + } + + /** + * @param arg Argument + */ + public TaskAdmin setArg(TaskAdminArgs arg) { + values.put("arg", arg); + return this; + } + +} diff --git a/src-generated/java/pt/lsts/imc/TaskAdminArgs.java b/src-generated/java/pt/lsts/imc/TaskAdminArgs.java new file mode 100644 index 00000000..e0b168fe --- /dev/null +++ b/src-generated/java/pt/lsts/imc/TaskAdminArgs.java @@ -0,0 +1,63 @@ +/* + * Below is the copyright agreement for IMCJava. + * + * Copyright (c) 2010-2020, Laboratório de Sistemas e Tecnologia Subaquática + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * - Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * - Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * - Neither the names of IMC, LSTS, IMCJava nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL LABORATORIO DE SISTEMAS E TECNOLOGIA SUBAQUATICA + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE + * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ +package pt.lsts.imc; + + +/** + * IMC Message TaskAdminArgs (-1)
+ */ + +public abstract class TaskAdminArgs extends IMCMessage { + + public TaskAdminArgs(int type) { + super(type); + } + + public TaskAdminArgs(IMCDefinition defs, int type) { + super(defs, type); + } + + public static TaskAdminArgs clone(IMCMessage msg) throws Exception { + IMCMessage m = IMCDefinition.getInstance().create(msg.getAbbrev()); + if (!TaskAdminArgs.class.isAssignableFrom(m.getClass())) + throw new Exception(m.getClass().getSimpleName()+" is not a subclass"); + + if(msg.definitions != m.definitions){ + msg = msg.cloneMessage(); + IMCUtil.updateMessage(msg, m.definitions); + } + + m.getHeader().values.putAll(msg.getHeader().values); + m.values.putAll(msg.values); + + return (TaskAdminArgs)m; + } + +} diff --git a/src-generated/java/pt/lsts/imc/TaskStatus.java b/src-generated/java/pt/lsts/imc/TaskStatus.java new file mode 100644 index 00000000..f19a6052 --- /dev/null +++ b/src-generated/java/pt/lsts/imc/TaskStatus.java @@ -0,0 +1,198 @@ +/* + * Below is the copyright agreement for IMCJava. + * + * Copyright (c) 2010-2020, Laboratório de Sistemas e Tecnologia Subaquática + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * - Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * - Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * - Neither the names of IMC, LSTS, IMCJava nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL LABORATORIO DE SISTEMAS E TECNOLOGIA SUBAQUATICA + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE + * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ +package pt.lsts.imc; + + +/** + * IMC Message Task Status (3103)
+ */ + +public class TaskStatus extends TaskAdminArgs { + + public enum STATUS { + COMPLETED(1), + IN_PROGRESS(2), + ERROR(3), + ASSIGNED(4); + + protected long value; + + public long value() { + return value; + } + + STATUS(long value) { + this.value = value; + } + } + + public static final int ID_STATIC = 3103; + + public TaskStatus() { + super(ID_STATIC); + } + + public TaskStatus(IMCMessage msg) { + super(ID_STATIC); + try{ + copyFrom(msg); + } + catch (Exception e) { + e.printStackTrace(); + } + } + + public TaskStatus(IMCDefinition defs) { + super(defs, ID_STATIC); + } + + public static TaskStatus create(Object... values) { + TaskStatus m = new TaskStatus(); + for (int i = 0; i < values.length-1; i+= 2) + m.setValue(values[i].toString(), values[i+1]); + return m; + } + + public static TaskStatus clone(IMCMessage msg) throws Exception { + + TaskStatus m = new TaskStatus(); + if (msg == null) + return m; + if(msg.definitions != m.definitions){ + msg = msg.cloneMessage(); + IMCUtil.updateMessage(msg, m.definitions); + } + else if (msg.getMgid()!=m.getMgid()) + throw new Exception("Argument "+msg.getAbbrev()+" is incompatible with message "+m.getAbbrev()); + + m.getHeader().values.putAll(msg.getHeader().values); + m.values.putAll(msg.values); + return m; + } + + public TaskStatus(int task_id, STATUS status, short progress, short quality) { + super(ID_STATIC); + setTaskId(task_id); + setStatus(status); + setProgress(progress); + setQuality(quality); + } + + /** + * @return Task Identifier - uint16_t + */ + public int getTaskId() { + return getInteger("task_id"); + } + + /** + * @param task_id Task Identifier + */ + public TaskStatus setTaskId(int task_id) { + values.put("task_id", task_id); + return this; + } + + /** + * @return Status (enumerated) - uint8_t + */ + public STATUS getStatus() { + try { + STATUS o = STATUS.valueOf(getMessageType().getFieldPossibleValues("status").get(getLong("status"))); + return o; + } + catch (Exception e) { + return null; + } + } + + public String getStatusStr() { + return getString("status"); + } + + public short getStatusVal() { + return (short) getInteger("status"); + } + + /** + * @param status Status (enumerated) + */ + public TaskStatus setStatus(STATUS status) { + values.put("status", status.value()); + return this; + } + + /** + * @param status Status (as a String) + */ + public TaskStatus setStatusStr(String status) { + setValue("status", status); + return this; + } + + /** + * @param status Status (integer value) + */ + public TaskStatus setStatusVal(short status) { + setValue("status", status); + return this; + } + + /** + * @return Progress (%) - uint8_t + */ + public short getProgress() { + return (short) getInteger("progress"); + } + + /** + * @param progress Progress (%) + */ + public TaskStatus setProgress(short progress) { + values.put("progress", progress); + return this; + } + + /** + * @return Quality (%) - uint8_t + */ + public short getQuality() { + return (short) getInteger("quality"); + } + + /** + * @param quality Quality (%) + */ + public TaskStatus setQuality(short quality) { + values.put("quality", quality); + return this; + } + +} diff --git a/src-generated/java/pt/lsts/imc/TypedEntityParameter.java b/src-generated/java/pt/lsts/imc/TypedEntityParameter.java new file mode 100644 index 00000000..0aacc51d --- /dev/null +++ b/src-generated/java/pt/lsts/imc/TypedEntityParameter.java @@ -0,0 +1,411 @@ +/* + * Below is the copyright agreement for IMCJava. + * + * Copyright (c) 2010-2020, Laboratório de Sistemas e Tecnologia Subaquática + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * - Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * - Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * - Neither the names of IMC, LSTS, IMCJava nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL LABORATORIO DE SISTEMAS E TECNOLOGIA SUBAQUATICA + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE + * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ +package pt.lsts.imc; + + +/** + * IMC Message Typed Entity Parameter (2008)
+ * Entity parameter with all the data that defines an entity parameter.
+ */ + +public class TypedEntityParameter extends IMCMessage { + + public enum TYPE { + BOOL(1), + INT(2), + FLOAT(3), + STRING(4), + LIST_BOOL(5), + LIST_INT(6), + LIST_FLOAT(7), + LIST_STRING(8); + + protected long value; + + public long value() { + return value; + } + + TYPE(long value) { + this.value = value; + } + } + + public enum VISIBILITY { + USER(0), + DEVELOPER(1); + + protected long value; + + public long value() { + return value; + } + + VISIBILITY(long value) { + this.value = value; + } + } + + public enum SCOPE { + GLOBAL(0), + IDLE(1), + PLAN(2), + MANEUVER(3); + + protected long value; + + public long value() { + return value; + } + + SCOPE(long value) { + this.value = value; + } + } + + public static final int ID_STATIC = 2008; + + public TypedEntityParameter() { + super(ID_STATIC); + } + + public TypedEntityParameter(IMCMessage msg) { + super(ID_STATIC); + try{ + copyFrom(msg); + } + catch (Exception e) { + e.printStackTrace(); + } + } + + public TypedEntityParameter(IMCDefinition defs) { + super(defs, ID_STATIC); + } + + public static TypedEntityParameter create(Object... values) { + TypedEntityParameter m = new TypedEntityParameter(); + for (int i = 0; i < values.length-1; i+= 2) + m.setValue(values[i].toString(), values[i+1]); + return m; + } + + public static TypedEntityParameter clone(IMCMessage msg) throws Exception { + + TypedEntityParameter m = new TypedEntityParameter(); + if (msg == null) + return m; + if(msg.definitions != m.definitions){ + msg = msg.cloneMessage(); + IMCUtil.updateMessage(msg, m.definitions); + } + else if (msg.getMgid()!=m.getMgid()) + throw new Exception("Argument "+msg.getAbbrev()+" is incompatible with message "+m.getAbbrev()); + + m.getHeader().values.putAll(msg.getHeader().values); + m.values.putAll(msg.values); + return m; + } + + public TypedEntityParameter(String name, TYPE type, String default_value, String units, String description, float min_value, float max_value, long list_min_size, long list_max_size, VISIBILITY visibility, SCOPE scope) { + super(ID_STATIC); + if (name != null) + setName(name); + setType(type); + if (default_value != null) + setDefaultValue(default_value); + if (units != null) + setUnits(units); + if (description != null) + setDescription(description); + setMinValue(min_value); + setMaxValue(max_value); + setListMinSize(list_min_size); + setListMaxSize(list_max_size); + setVisibility(visibility); + setScope(scope); + } + + /** + * @return Entity Name - plaintext + */ + public String getName() { + return getString("name"); + } + + /** + * @param name Entity Name + */ + public TypedEntityParameter setName(String name) { + values.put("name", name); + return this; + } + + /** + * @return Type (enumerated) - uint8_t + */ + public TYPE getType() { + try { + TYPE o = TYPE.valueOf(getMessageType().getFieldPossibleValues("type").get(getLong("type"))); + return o; + } + catch (Exception e) { + return null; + } + } + + public String getTypeStr() { + return getString("type"); + } + + public short getTypeVal() { + return (short) getInteger("type"); + } + + /** + * @param type Type (enumerated) + */ + public TypedEntityParameter setType(TYPE type) { + values.put("type", type.value()); + return this; + } + + /** + * @param type Type (as a String) + */ + public TypedEntityParameter setTypeStr(String type) { + setValue("type", type); + return this; + } + + /** + * @param type Type (integer value) + */ + public TypedEntityParameter setTypeVal(short type) { + setValue("type", type); + return this; + } + + /** + * @return Default Value - plaintext + */ + public String getDefaultValue() { + return getString("default_value"); + } + + /** + * @param default_value Default Value + */ + public TypedEntityParameter setDefaultValue(String default_value) { + values.put("default_value", default_value); + return this; + } + + /** + * @return Units - plaintext + */ + public String getUnits() { + return getString("units"); + } + + /** + * @param units Units + */ + public TypedEntityParameter setUnits(String units) { + values.put("units", units); + return this; + } + + /** + * @return Description - plaintext + */ + public String getDescription() { + return getString("description"); + } + + /** + * @param description Description + */ + public TypedEntityParameter setDescription(String description) { + values.put("description", description); + return this; + } + + /** + * @return Min Value - fp32_t + */ + public double getMinValue() { + return getDouble("min_value"); + } + + /** + * @param min_value Min Value + */ + public TypedEntityParameter setMinValue(double min_value) { + values.put("min_value", min_value); + return this; + } + + /** + * @return Max Value - fp32_t + */ + public double getMaxValue() { + return getDouble("max_value"); + } + + /** + * @param max_value Max Value + */ + public TypedEntityParameter setMaxValue(double max_value) { + values.put("max_value", max_value); + return this; + } + + /** + * @return List Min Size - uint32_t + */ + public long getListMinSize() { + return getLong("list_min_size"); + } + + /** + * @param list_min_size List Min Size + */ + public TypedEntityParameter setListMinSize(long list_min_size) { + values.put("list_min_size", list_min_size); + return this; + } + + /** + * @return List Max Size - uint32_t + */ + public long getListMaxSize() { + return getLong("list_max_size"); + } + + /** + * @param list_max_size List Max Size + */ + public TypedEntityParameter setListMaxSize(long list_max_size) { + values.put("list_max_size", list_max_size); + return this; + } + + /** + * @return Visibility (enumerated) - uint8_t + */ + public VISIBILITY getVisibility() { + try { + VISIBILITY o = VISIBILITY.valueOf(getMessageType().getFieldPossibleValues("visibility").get(getLong("visibility"))); + return o; + } + catch (Exception e) { + return null; + } + } + + public String getVisibilityStr() { + return getString("visibility"); + } + + public short getVisibilityVal() { + return (short) getInteger("visibility"); + } + + /** + * @param visibility Visibility (enumerated) + */ + public TypedEntityParameter setVisibility(VISIBILITY visibility) { + values.put("visibility", visibility.value()); + return this; + } + + /** + * @param visibility Visibility (as a String) + */ + public TypedEntityParameter setVisibilityStr(String visibility) { + setValue("visibility", visibility); + return this; + } + + /** + * @param visibility Visibility (integer value) + */ + public TypedEntityParameter setVisibilityVal(short visibility) { + setValue("visibility", visibility); + return this; + } + + /** + * @return Scope (enumerated) - uint8_t + */ + public SCOPE getScope() { + try { + SCOPE o = SCOPE.valueOf(getMessageType().getFieldPossibleValues("scope").get(getLong("scope"))); + return o; + } + catch (Exception e) { + return null; + } + } + + public String getScopeStr() { + return getString("scope"); + } + + public short getScopeVal() { + return (short) getInteger("scope"); + } + + /** + * @param scope Scope (enumerated) + */ + public TypedEntityParameter setScope(SCOPE scope) { + values.put("scope", scope.value()); + return this; + } + + /** + * @param scope Scope (as a String) + */ + public TypedEntityParameter setScopeStr(String scope) { + setValue("scope", scope); + return this; + } + + /** + * @param scope Scope (integer value) + */ + public TypedEntityParameter setScopeVal(short scope) { + setValue("scope", scope); + return this; + } + +} diff --git a/src-generated/java/pt/lsts/imc/TypedEntityParameters.java b/src-generated/java/pt/lsts/imc/TypedEntityParameters.java new file mode 100644 index 00000000..e0341b1c --- /dev/null +++ b/src-generated/java/pt/lsts/imc/TypedEntityParameters.java @@ -0,0 +1,205 @@ +/* + * Below is the copyright agreement for IMCJava. + * + * Copyright (c) 2010-2020, Laboratório de Sistemas e Tecnologia Subaquática + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * - Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * - Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * - Neither the names of IMC, LSTS, IMCJava nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL LABORATORIO DE SISTEMAS E TECNOLOGIA SUBAQUATICA + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE + * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ +package pt.lsts.imc; + + +/** + * IMC Message Typed Entity Parameters (2009)
+ * This message can be used to query/report the entities and respective parameters in the system
+ */ + +public class TypedEntityParameters extends IMCMessage { + + public enum OP { + REQUEST(0), + REPLY(1); + + protected long value; + + public long value() { + return value; + } + + OP(long value) { + this.value = value; + } + } + + public static final int ID_STATIC = 2009; + + public TypedEntityParameters() { + super(ID_STATIC); + } + + public TypedEntityParameters(IMCMessage msg) { + super(ID_STATIC); + try{ + copyFrom(msg); + } + catch (Exception e) { + e.printStackTrace(); + } + } + + public TypedEntityParameters(IMCDefinition defs) { + super(defs, ID_STATIC); + } + + public static TypedEntityParameters create(Object... values) { + TypedEntityParameters m = new TypedEntityParameters(); + for (int i = 0; i < values.length-1; i+= 2) + m.setValue(values[i].toString(), values[i+1]); + return m; + } + + public static TypedEntityParameters clone(IMCMessage msg) throws Exception { + + TypedEntityParameters m = new TypedEntityParameters(); + if (msg == null) + return m; + if(msg.definitions != m.definitions){ + msg = msg.cloneMessage(); + IMCUtil.updateMessage(msg, m.definitions); + } + else if (msg.getMgid()!=m.getMgid()) + throw new Exception("Argument "+msg.getAbbrev()+" is incompatible with message "+m.getAbbrev()); + + m.getHeader().values.putAll(msg.getHeader().values); + m.values.putAll(msg.values); + return m; + } + + public TypedEntityParameters(OP op, long request_id, String entity_name, java.util.Collection parameters) { + super(ID_STATIC); + setOp(op); + setRequestId(request_id); + if (entity_name != null) + setEntityName(entity_name); + if (parameters != null) + setParameters(parameters); + } + + /** + * @return Operation (enumerated) - uint8_t + */ + public OP getOp() { + try { + OP o = OP.valueOf(getMessageType().getFieldPossibleValues("op").get(getLong("op"))); + return o; + } + catch (Exception e) { + return null; + } + } + + public String getOpStr() { + return getString("op"); + } + + public short getOpVal() { + return (short) getInteger("op"); + } + + /** + * @param op Operation (enumerated) + */ + public TypedEntityParameters setOp(OP op) { + values.put("op", op.value()); + return this; + } + + /** + * @param op Operation (as a String) + */ + public TypedEntityParameters setOpStr(String op) { + setValue("op", op); + return this; + } + + /** + * @param op Operation (integer value) + */ + public TypedEntityParameters setOpVal(short op) { + setValue("op", op); + return this; + } + + /** + * @return Request identitier - uint32_t + */ + public long getRequestId() { + return getLong("request_id"); + } + + /** + * @param request_id Request identitier + */ + public TypedEntityParameters setRequestId(long request_id) { + values.put("request_id", request_id); + return this; + } + + /** + * @return Entity Name - plaintext + */ + public String getEntityName() { + return getString("entity_name"); + } + + /** + * @param entity_name Entity Name + */ + public TypedEntityParameters setEntityName(String entity_name) { + values.put("entity_name", entity_name); + return this; + } + + /** + * @return Parameters - message-list + */ + public java.util.Vector getParameters() { + try { + return getMessageList("parameters", TypedEntityParameter.class); + } + catch (Exception e) { + return null; + } + + } + + /** + * @param parameters Parameters + */ + public TypedEntityParameters setParameters(java.util.Collection parameters) { + values.put("parameters", parameters); + return this; + } + +} diff --git a/src-generated/java/pt/lsts/imc/UamTxStatus.java b/src-generated/java/pt/lsts/imc/UamTxStatus.java index 9df6e587..acbb4b85 100644 --- a/src-generated/java/pt/lsts/imc/UamTxStatus.java +++ b/src-generated/java/pt/lsts/imc/UamTxStatus.java @@ -48,7 +48,8 @@ public enum VALUE { UNSUPPORTED(6), INV_SIZE(7), SENT(8), - DELIVERED(9); + DELIVERED(9), + NO_TRANSDUCER(10); protected long value; diff --git a/src-generated/java/pt/lsts/imc/ValidatePlan.java b/src-generated/java/pt/lsts/imc/ValidatePlan.java new file mode 100644 index 00000000..cef1e6b7 --- /dev/null +++ b/src-generated/java/pt/lsts/imc/ValidatePlan.java @@ -0,0 +1,177 @@ +/* + * Below is the copyright agreement for IMCJava. + * + * Copyright (c) 2010-2020, Laboratório de Sistemas e Tecnologia Subaquática + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * - Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * - Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * - Neither the names of IMC, LSTS, IMCJava nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL LABORATORIO DE SISTEMAS E TECNOLOGIA SUBAQUATICA + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE + * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ +package pt.lsts.imc; + + +/** + * IMC Message Validate Plan DB (2007)
+ * Use to validate plans
+ */ + +public class ValidatePlan extends IMCMessage { + + public enum TYPE { + REQ(0), + VALID(1), + INVALID(2); + + protected long value; + + public long value() { + return value; + } + + TYPE(long value) { + this.value = value; + } + } + + public static final int ID_STATIC = 2007; + + public ValidatePlan() { + super(ID_STATIC); + } + + public ValidatePlan(IMCMessage msg) { + super(ID_STATIC); + try{ + copyFrom(msg); + } + catch (Exception e) { + e.printStackTrace(); + } + } + + public ValidatePlan(IMCDefinition defs) { + super(defs, ID_STATIC); + } + + public static ValidatePlan create(Object... values) { + ValidatePlan m = new ValidatePlan(); + for (int i = 0; i < values.length-1; i+= 2) + m.setValue(values[i].toString(), values[i+1]); + return m; + } + + public static ValidatePlan clone(IMCMessage msg) throws Exception { + + ValidatePlan m = new ValidatePlan(); + if (msg == null) + return m; + if(msg.definitions != m.definitions){ + msg = msg.cloneMessage(); + IMCUtil.updateMessage(msg, m.definitions); + } + else if (msg.getMgid()!=m.getMgid()) + throw new Exception("Argument "+msg.getAbbrev()+" is incompatible with message "+m.getAbbrev()); + + m.getHeader().values.putAll(msg.getHeader().values); + m.values.putAll(msg.values); + return m; + } + + public ValidatePlan(TYPE type, PlanDB plan) { + super(ID_STATIC); + setType(type); + if (plan != null) + setPlan(plan); + } + + /** + * @return Request Type (enumerated) - uint8_t + */ + public TYPE getType() { + try { + TYPE o = TYPE.valueOf(getMessageType().getFieldPossibleValues("type").get(getLong("type"))); + return o; + } + catch (Exception e) { + return null; + } + } + + public String getTypeStr() { + return getString("type"); + } + + public short getTypeVal() { + return (short) getInteger("type"); + } + + /** + * @param type Request Type (enumerated) + */ + public ValidatePlan setType(TYPE type) { + values.put("type", type.value()); + return this; + } + + /** + * @param type Request Type (as a String) + */ + public ValidatePlan setTypeStr(String type) { + setValue("type", type); + return this; + } + + /** + * @param type Request Type (integer value) + */ + public ValidatePlan setTypeVal(short type) { + setValue("type", type); + return this; + } + + /** + * @return Plan DB - message + */ + public PlanDB getPlan() { + try { + IMCMessage obj = getMessage("plan"); + if (obj instanceof PlanDB) + return (PlanDB) obj; + else + return null; + } + catch (Exception e) { + return null; + } + + } + + /** + * @param plan Plan DB + */ + public ValidatePlan setPlan(PlanDB plan) { + values.put("plan", plan); + return this; + } + +} diff --git a/src-generated/java/pt/lsts/imc/VehicleCapabilities.java b/src-generated/java/pt/lsts/imc/VehicleCapabilities.java new file mode 100644 index 00000000..d47c5c61 --- /dev/null +++ b/src-generated/java/pt/lsts/imc/VehicleCapabilities.java @@ -0,0 +1,111 @@ +/* + * Below is the copyright agreement for IMCJava. + * + * Copyright (c) 2010-2020, Laboratório de Sistemas e Tecnologia Subaquática + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * - Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * - Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * - Neither the names of IMC, LSTS, IMCJava nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL LABORATORIO DE SISTEMAS E TECNOLOGIA SUBAQUATICA + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE + * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ +package pt.lsts.imc; + + +/** + * IMC Message Vehicle Capabilities (3006)
+ * This message describes the capabilities provided by an UxV.
+ */ + +public class VehicleCapabilities extends IMCMessage { + + public static final int ID_STATIC = 3006; + + public VehicleCapabilities() { + super(ID_STATIC); + } + + public VehicleCapabilities(IMCMessage msg) { + super(ID_STATIC); + try{ + copyFrom(msg); + } + catch (Exception e) { + e.printStackTrace(); + } + } + + public VehicleCapabilities(IMCDefinition defs) { + super(defs, ID_STATIC); + } + + public static VehicleCapabilities create(Object... values) { + VehicleCapabilities m = new VehicleCapabilities(); + for (int i = 0; i < values.length-1; i+= 2) + m.setValue(values[i].toString(), values[i+1]); + return m; + } + + public static VehicleCapabilities clone(IMCMessage msg) throws Exception { + + VehicleCapabilities m = new VehicleCapabilities(); + if (msg == null) + return m; + if(msg.definitions != m.definitions){ + msg = msg.cloneMessage(); + IMCUtil.updateMessage(msg, m.definitions); + } + else if (msg.getMgid()!=m.getMgid()) + throw new Exception("Argument "+msg.getAbbrev()+" is incompatible with message "+m.getAbbrev()); + + m.getHeader().values.putAll(msg.getHeader().values); + m.values.putAll(msg.values); + return m; + } + + public VehicleCapabilities(java.util.Collection capabilities) { + super(ID_STATIC); + if (capabilities != null) + setCapabilities(capabilities); + } + + /** + * @return Capabilities - message-list + */ + public java.util.Vector getCapabilities() { + try { + return getMessageList("capabilities", VehicleCapability.class); + } + catch (Exception e) { + return null; + } + + } + + /** + * @param capabilities Capabilities + */ + public VehicleCapabilities setCapabilities(java.util.Collection capabilities) { + values.put("capabilities", capabilities); + return this; + } + +} diff --git a/src-generated/java/pt/lsts/imc/VehicleCapability.java b/src-generated/java/pt/lsts/imc/VehicleCapability.java new file mode 100644 index 00000000..4075ea7b --- /dev/null +++ b/src-generated/java/pt/lsts/imc/VehicleCapability.java @@ -0,0 +1,63 @@ +/* + * Below is the copyright agreement for IMCJava. + * + * Copyright (c) 2010-2020, Laboratório de Sistemas e Tecnologia Subaquática + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * - Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * - Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * - Neither the names of IMC, LSTS, IMCJava nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL LABORATORIO DE SISTEMAS E TECNOLOGIA SUBAQUATICA + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE + * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ +package pt.lsts.imc; + + +/** + * IMC Message VehicleCapability (-1)
+ */ + +public abstract class VehicleCapability extends IMCMessage { + + public VehicleCapability(int type) { + super(type); + } + + public VehicleCapability(IMCDefinition defs, int type) { + super(defs, type); + } + + public static VehicleCapability clone(IMCMessage msg) throws Exception { + IMCMessage m = IMCDefinition.getInstance().create(msg.getAbbrev()); + if (!VehicleCapability.class.isAssignableFrom(m.getClass())) + throw new Exception(m.getClass().getSimpleName()+" is not a subclass"); + + if(msg.definitions != m.definitions){ + msg = msg.cloneMessage(); + IMCUtil.updateMessage(msg, m.definitions); + } + + m.getHeader().values.putAll(msg.getHeader().values); + m.values.putAll(msg.values); + + return (VehicleCapability)m; + } + +} diff --git a/src-generated/java/pt/lsts/imc/WifiNetwork.java b/src-generated/java/pt/lsts/imc/WifiNetwork.java new file mode 100644 index 00000000..04b79a64 --- /dev/null +++ b/src-generated/java/pt/lsts/imc/WifiNetwork.java @@ -0,0 +1,219 @@ +/* + * Below is the copyright agreement for IMCJava. + * + * Copyright (c) 2010-2020, Laboratório de Sistemas e Tecnologia Subaquática + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * - Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * - Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * - Neither the names of IMC, LSTS, IMCJava nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL LABORATORIO DE SISTEMAS E TECNOLOGIA SUBAQUATICA + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE + * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ +package pt.lsts.imc; + + +/** + * IMC Message WiFi Network (2012)
+ * This message is used to log wifi networks in the surroundings.
+ */ + +public class WifiNetwork extends IMCMessage { + + public static final int ID_STATIC = 2012; + + public WifiNetwork() { + super(ID_STATIC); + } + + public WifiNetwork(IMCMessage msg) { + super(ID_STATIC); + try{ + copyFrom(msg); + } + catch (Exception e) { + e.printStackTrace(); + } + } + + public WifiNetwork(IMCDefinition defs) { + super(defs, ID_STATIC); + } + + public static WifiNetwork create(Object... values) { + WifiNetwork m = new WifiNetwork(); + for (int i = 0; i < values.length-1; i+= 2) + m.setValue(values[i].toString(), values[i+1]); + return m; + } + + public static WifiNetwork clone(IMCMessage msg) throws Exception { + + WifiNetwork m = new WifiNetwork(); + if (msg == null) + return m; + if(msg.definitions != m.definitions){ + msg = msg.cloneMessage(); + IMCUtil.updateMessage(msg, m.definitions); + } + else if (msg.getMgid()!=m.getMgid()) + throw new Exception("Argument "+msg.getAbbrev()+" is incompatible with message "+m.getAbbrev()); + + m.getHeader().values.putAll(msg.getHeader().values); + m.values.putAll(msg.values); + return m; + } + + public WifiNetwork(String essid, String mac, short signal, short noise, byte ccq, short channel, float freq, String security) { + super(ID_STATIC); + if (essid != null) + setEssid(essid); + if (mac != null) + setMac(mac); + setSignal(signal); + setNoise(noise); + setCcq(ccq); + setChannel(channel); + setFreq(freq); + if (security != null) + setSecurity(security); + } + + /** + * @return ESSID - plaintext + */ + public String getEssid() { + return getString("essid"); + } + + /** + * @param essid ESSID + */ + public WifiNetwork setEssid(String essid) { + values.put("essid", essid); + return this; + } + + /** + * @return MAC Address - plaintext + */ + public String getMac() { + return getString("mac"); + } + + /** + * @param mac MAC Address + */ + public WifiNetwork setMac(String mac) { + values.put("mac", mac); + return this; + } + + /** + * @return Signal Level (db) - int16_t + */ + public short getSignal() { + return (short) getInteger("signal"); + } + + /** + * @param signal Signal Level (db) + */ + public WifiNetwork setSignal(short signal) { + values.put("signal", signal); + return this; + } + + /** + * @return Noise Level (db) - int16_t + */ + public short getNoise() { + return (short) getInteger("noise"); + } + + /** + * @param noise Noise Level (db) + */ + public WifiNetwork setNoise(short noise) { + values.put("noise", noise); + return this; + } + + /** + * @return CCQ (%) - int8_t + */ + public byte getCcq() { + return (byte) getInteger("ccq"); + } + + /** + * @param ccq CCQ (%) + */ + public WifiNetwork setCcq(byte ccq) { + values.put("ccq", ccq); + return this; + } + + /** + * @return Wifi Channel - uint8_t + */ + public short getChannel() { + return (short) getInteger("channel"); + } + + /** + * @param channel Wifi Channel + */ + public WifiNetwork setChannel(short channel) { + values.put("channel", channel); + return this; + } + + /** + * @return Wifi Frequency - fp32_t + */ + public double getFreq() { + return getDouble("freq"); + } + + /** + * @param freq Wifi Frequency + */ + public WifiNetwork setFreq(double freq) { + values.put("freq", freq); + return this; + } + + /** + * @return Security - plaintext + */ + public String getSecurity() { + return getString("security"); + } + + /** + * @param security Security + */ + public WifiNetwork setSecurity(String security) { + values.put("security", security); + return this; + } + +} diff --git a/src-generated/java/pt/lsts/imc/WifiStats.java b/src-generated/java/pt/lsts/imc/WifiStats.java new file mode 100644 index 00000000..a26bf66f --- /dev/null +++ b/src-generated/java/pt/lsts/imc/WifiStats.java @@ -0,0 +1,298 @@ +/* + * Below is the copyright agreement for IMCJava. + * + * Copyright (c) 2010-2020, Laboratório de Sistemas e Tecnologia Subaquática + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * - Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * - Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * - Neither the names of IMC, LSTS, IMCJava nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL LABORATORIO DE SISTEMAS E TECNOLOGIA SUBAQUATICA + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE + * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ +package pt.lsts.imc; + + +/** + * IMC Message WiFi Statistics (2011)
+ * This message is used to log wifi connection statistics, heavily influenced by the stats available in ubiquiti radios.
+ */ + +public class WifiStats extends IMCMessage { + + public static final int ID_STATIC = 2011; + + public WifiStats() { + super(ID_STATIC); + } + + public WifiStats(IMCMessage msg) { + super(ID_STATIC); + try{ + copyFrom(msg); + } + catch (Exception e) { + e.printStackTrace(); + } + } + + public WifiStats(IMCDefinition defs) { + super(defs, ID_STATIC); + } + + public static WifiStats create(Object... values) { + WifiStats m = new WifiStats(); + for (int i = 0; i < values.length-1; i+= 2) + m.setValue(values[i].toString(), values[i+1]); + return m; + } + + public static WifiStats clone(IMCMessage msg) throws Exception { + + WifiStats m = new WifiStats(); + if (msg == null) + return m; + if(msg.definitions != m.definitions){ + msg = msg.cloneMessage(); + IMCUtil.updateMessage(msg, m.definitions); + } + else if (msg.getMgid()!=m.getMgid()) + throw new Exception("Argument "+msg.getAbbrev()+" is incompatible with message "+m.getAbbrev()); + + m.getHeader().values.putAll(msg.getHeader().values); + m.values.putAll(msg.values); + return m; + } + + public WifiStats(String mac, String ip, short ccq, short noise_floor, short signal, int rssi, short rx_rate, short tx_rate, short tx_latency, short tx_power, long rx_count, long tx_count, short distance) { + super(ID_STATIC); + if (mac != null) + setMac(mac); + if (ip != null) + setIp(ip); + setCcq(ccq); + setNoiseFloor(noise_floor); + setSignal(signal); + setRssi(rssi); + setRxRate(rx_rate); + setTxRate(tx_rate); + setTxLatency(tx_latency); + setTxPower(tx_power); + setRxCount(rx_count); + setTxCount(tx_count); + setDistance(distance); + } + + /** + * @return MAC Address - plaintext + */ + public String getMac() { + return getString("mac"); + } + + /** + * @param mac MAC Address + */ + public WifiStats setMac(String mac) { + values.put("mac", mac); + return this; + } + + /** + * @return IP Address - plaintext + */ + public String getIp() { + return getString("ip"); + } + + /** + * @param ip IP Address + */ + public WifiStats setIp(String ip) { + values.put("ip", ip); + return this; + } + + /** + * @return Client Connection Quality (%) - uint8_t + */ + public short getCcq() { + return (short) getInteger("ccq"); + } + + /** + * @param ccq Client Connection Quality (%) + */ + public WifiStats setCcq(short ccq) { + values.put("ccq", ccq); + return this; + } + + /** + * @return Noise Floor (db) - int16_t + */ + public short getNoiseFloor() { + return (short) getInteger("noise_floor"); + } + + /** + * @param noise_floor Noise Floor (db) + */ + public WifiStats setNoiseFloor(short noise_floor) { + values.put("noise_floor", noise_floor); + return this; + } + + /** + * @return Signal (db) - int16_t + */ + public short getSignal() { + return (short) getInteger("signal"); + } + + /** + * @param signal Signal (db) + */ + public WifiStats setSignal(short signal) { + values.put("signal", signal); + return this; + } + + /** + * @return RSSI - uint16_t + */ + public int getRssi() { + return getInteger("rssi"); + } + + /** + * @param rssi RSSI + */ + public WifiStats setRssi(int rssi) { + values.put("rssi", rssi); + return this; + } + + /** + * @return Reception Data Rate (mbps) - int16_t + */ + public short getRxRate() { + return (short) getInteger("rx_rate"); + } + + /** + * @param rx_rate Reception Data Rate (mbps) + */ + public WifiStats setRxRate(short rx_rate) { + values.put("rx_rate", rx_rate); + return this; + } + + /** + * @return Transmission Data Rate (mbps) - int16_t + */ + public short getTxRate() { + return (short) getInteger("tx_rate"); + } + + /** + * @param tx_rate Transmission Data Rate (mbps) + */ + public WifiStats setTxRate(short tx_rate) { + values.put("tx_rate", tx_rate); + return this; + } + + /** + * @return Transmission Latency (s) - int16_t + */ + public short getTxLatency() { + return (short) getInteger("tx_latency"); + } + + /** + * @param tx_latency Transmission Latency (s) + */ + public WifiStats setTxLatency(short tx_latency) { + values.put("tx_latency", tx_latency); + return this; + } + + /** + * @return Transmission Power (s) - int16_t + */ + public short getTxPower() { + return (short) getInteger("tx_power"); + } + + /** + * @param tx_power Transmission Power (s) + */ + public WifiStats setTxPower(short tx_power) { + values.put("tx_power", tx_power); + return this; + } + + /** + * @return Reception Counter (byte) - uint32_t + */ + public long getRxCount() { + return getLong("rx_count"); + } + + /** + * @param rx_count Reception Counter (byte) + */ + public WifiStats setRxCount(long rx_count) { + values.put("rx_count", rx_count); + return this; + } + + /** + * @return Transmission Counter (byte) - uint32_t + */ + public long getTxCount() { + return getLong("tx_count"); + } + + /** + * @param tx_count Transmission Counter (byte) + */ + public WifiStats setTxCount(long tx_count) { + values.put("tx_count", tx_count); + return this; + } + + /** + * @return Distance (m) - int16_t + */ + public short getDistance() { + return (short) getInteger("distance"); + } + + /** + * @param distance Distance (m) + */ + public WifiStats setDistance(short distance) { + values.put("distance", distance); + return this; + } + +} diff --git a/src-generated/java/pt/lsts/imc/WorldModel.java b/src-generated/java/pt/lsts/imc/WorldModel.java new file mode 100644 index 00000000..6ece3196 --- /dev/null +++ b/src-generated/java/pt/lsts/imc/WorldModel.java @@ -0,0 +1,134 @@ +/* + * Below is the copyright agreement for IMCJava. + * + * Copyright (c) 2010-2020, Laboratório de Sistemas e Tecnologia Subaquática + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * - Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * - Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * - Neither the names of IMC, LSTS, IMCJava nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL LABORATORIO DE SISTEMAS E TECNOLOGIA SUBAQUATICA + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE + * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ +package pt.lsts.imc; + + +/** + * IMC Message World Model (3001)
+ * This message represents a world model.
+ */ + +public class WorldModel extends IMCMessage { + + public static final int ID_STATIC = 3001; + + public WorldModel() { + super(ID_STATIC); + } + + public WorldModel(IMCMessage msg) { + super(ID_STATIC); + try{ + copyFrom(msg); + } + catch (Exception e) { + e.printStackTrace(); + } + } + + public WorldModel(IMCDefinition defs) { + super(defs, ID_STATIC); + } + + public static WorldModel create(Object... values) { + WorldModel m = new WorldModel(); + for (int i = 0; i < values.length-1; i+= 2) + m.setValue(values[i].toString(), values[i+1]); + return m; + } + + public static WorldModel clone(IMCMessage msg) throws Exception { + + WorldModel m = new WorldModel(); + if (msg == null) + return m; + if(msg.definitions != m.definitions){ + msg = msg.cloneMessage(); + IMCUtil.updateMessage(msg, m.definitions); + } + else if (msg.getMgid()!=m.getMgid()) + throw new Exception("Argument "+msg.getAbbrev()+" is incompatible with message "+m.getAbbrev()); + + m.getHeader().values.putAll(msg.getHeader().values); + m.values.putAll(msg.values); + return m; + } + + public WorldModel(java.util.Collection geo_features, java.util.Collection cov_states) { + super(ID_STATIC); + if (geo_features != null) + setGeoFeatures(geo_features); + if (cov_states != null) + setCovStates(cov_states); + } + + /** + * @return GeoFeatures - message-list + */ + public java.util.Vector getGeoFeatures() { + try { + return getMessageList("geo_features", GeoFeature.class); + } + catch (Exception e) { + return null; + } + + } + + /** + * @param geo_features GeoFeatures + */ + public WorldModel setGeoFeatures(java.util.Collection geo_features) { + values.put("geo_features", geo_features); + return this; + } + + /** + * @return CoverageStates - message-list + */ + public java.util.Vector getCovStates() { + try { + return getMessageList("cov_states", CoverageState.class); + } + catch (Exception e) { + return null; + } + + } + + /** + * @param cov_states CoverageStates + */ + public WorldModel setCovStates(java.util.Collection cov_states) { + values.put("cov_states", cov_states); + return this; + } + +} diff --git a/src-generated/java/pt/lsts/imc/def/SensorType.java b/src-generated/java/pt/lsts/imc/def/SensorType.java new file mode 100644 index 00000000..4a9aab2e --- /dev/null +++ b/src-generated/java/pt/lsts/imc/def/SensorType.java @@ -0,0 +1,58 @@ +/* + * Below is the copyright agreement for IMCJava. + * + * Copyright (c) 2010-2020, Laboratório de Sistemas e Tecnologia Subaquática + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * - Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * - Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * - Neither the names of IMC, LSTS, IMCJava nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL LABORATORIO DE SISTEMAS E TECNOLOGIA SUBAQUATICA + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE + * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ +package pt.lsts.imc.def; + +public enum SensorType { + + MULTIBEAM(0x00000001l), + SIDESCAN(0x00000002l), + CAMERA(0x00000003l), + MAGNETOMETER(0x00000004l); + + protected long value; + + SensorType(long value) { + this.value = value; + } + + public long value() { + return value; + } + + public static SensorType valueOf(long value) throws IllegalArgumentException { + for (SensorType v : SensorType.values()) { + if (v.value == value) { + return v; + } + } + throw new IllegalArgumentException("Invalid value for SensorType: "+value); + } + +} diff --git a/src-generated/resources/xml/IMC.sha b/src-generated/resources/xml/IMC.sha index c10c37c1..5f64245b 100644 --- a/src-generated/resources/xml/IMC.sha +++ b/src-generated/resources/xml/IMC.sha @@ -1,3 +1,3 @@ -8be592ac50fb8f076c8c2e963fab4700f13f2eac -8be592a -url: https://api.github.com/repos/LSTS/imc/commits/8be592a \ No newline at end of file +f6426e82a74497cd3af0e8c039d78911a5521643 +f6426e8 +url: https://api.github.com/repos/LSTS/imc/commits/f6426e8 \ No newline at end of file diff --git a/src-generated/resources/xml/IMC.xml b/src-generated/resources/xml/IMC.xml index 594f34c2..be6d0344 100644 --- a/src-generated/resources/xml/IMC.xml +++ b/src-generated/resources/xml/IMC.xml @@ -1,7 +1,7 @@ @@ -9723,6 +9832,87 @@ + + + + Notification of completion of a maneuver (optional use). + + + + + + The Station Keeping Extended maneuver makes the vehicle come to the surface + and then enter a given circular perimeter around a waypoint coordinate + for a certain amount of time. It extends the Station Keeping maneuver with the feature + 'Keep Safe', which allows for the vehicle to hold position underwater and popup periodically + to communicate. + + + + WGS-84 Latitude. + + + + + WGS-84 Longitude. + + + + + Maneuver reference in the z axis. Use z_units to specify + whether z represents depth, altitude or other. + + + + + Units of the z reference. + + + + Radius. + + + Duration (0 for unlimited). + + + + The value of the desired speed, in the scale specified + by the "Speed Units" field. + + + + Indicates the units used for the speed value. + + + + The period at which the vehicle will popup to report its position. + Only used if flag KEEP_SAFE is on. + + + + + The duration of the station keeping at surface level when it pops up. + Only used if flag KEEP_SAFE is on. + + + + + Flags of the maneuver. + + + + If this flag is set, the vehicle will hold position underwater, loitering at z reference. + It will popup periodically to report position. When it pops up, it will stay at surface in "normal" station keeping behaviour for a certain time (popup_duration). + + + + + + Custom settings for maneuver. + + + + State summary for a remote vehicle. @@ -10067,6 +10257,11 @@ Message has been acknowledged by the destination. + + + Transducer not connected to the acoustic modem. + + @@ -10322,19 +10517,19 @@ - + - + - + @@ -10353,7 +10548,7 @@ - + @@ -11001,10 +11196,594 @@ - + + Reports if the vehicle is charging or not + + + + + + + + + Contains a profile of water velocities measured relative to the vehicle + velocity, represented in the specified coordinate system. + + + + Number of ADCP beams. + + + + + Number of ADCP cells. + + + + + Coordinate system of the velocity measurement. + + + + + + + + List of current profile measurement cells. + + + + + + + One Current measurement at a specific CellPosition. + + + + Distance of each measurment cell along the Z-axis in the coordintate frame. + + + + + List of beams measurements at the current cell level. + + + + + + + Measurement from one specific beam at the given CellPosition. + Water Velocity is provided in the chosen Coordinate system. + Amplitude and Correlation are always in the BEAM coordinate system. + + + + Water velocity measured in the chosen coordinate system. + + + + + Amplitude of returning ping for the beam. + + + + + Autocorrelation of returning ping for the beam. + + + + + + + Current state of a GPIO. + + + + GPIO Name. + + + + + Logical level of the GPIO. + + + + + + + Request the state of a given GPIO. The receiving entity shall reply + with a GpioState message. + + + + GPIO Name. + + + + + + + Set the state of a given GPIO. The receiving entity shall reply + with a GpioState message. + + + + GPIO Name. + + + + + Logical level of the GPIO. + + + + + + + Colored Dissolved Organic Matter measurement. + + + + Colored Dissolved Organic Matter reading. + + + + + + + Fluorescent Dissolved Organic Matter measurement. + + + + Fluorescent Dissolved Organic Matter reading. + + + + + + + The request identifier used to receive transmission updates. + + + Time, in seconds, after which there will be no more atempts to transmit the message. + + + Time in seconds since the Unix Epoch after which the recipient shall discard the message. + + + The unique identifier of this message's destination (e.g. lauv-xtreme-2, manta-0). + + + + Message data. + + + + + Total Magnetic Field Intensity (TMI) + + + Use to validate plans + + + + Type of request. + + + + + + + + An inline plan specification to be used both in requests and replies. + + + + + + + Entity parameter with all the data that defines an entity parameter. + + + + Name of the parameter. + + + + + + + + + + + + + + + Default value of the parameter. + + + + + The units of the field, if applicable + + + + + Description of the parameter + + + + + Optional. Min value of the parameter + + + + + Optional. Max value of the parameter + + + + + When the parameter is a list, list_min_size indicates the minimum size of the list + + + + + When the parameter is a list, list_max_size indicates the maximum size of the list + + + + + + + + + + + + + + + + This message can be used to query/report the entities and respective parameters in the system + + + Operation to perform. + + + + + + Echoes the request_id in the request + + + Entity Label of the task that's replying to the request + + + Contains an optionally defined List of TypedEntityParameter as a response to a TypedEntityParamaters Request. + + + + + This message is used to restrict the vehicle from using some communication means. + + The restricted communication means. + + + + + + + Textual description for why this restriction is needed. + + + + + This message is used to log wifi connection statistics, heavily influenced by the stats available in ubiquiti radios. + + MAC address of the associated radio. + + + Last IP address of the associated radio. + + + Client Connection Quality indicator + + + Noise Floor (measure of the signal created from the sum of all the noise sources + and unwanted signals within a measurement system, where noise is defined as any signal other + than the one being monitored). + + + + Measure of the signal of the associated radio. + + + Received Signal Strength Indicator, in arbitraty units. The bigger the RSSI, the better + the connection quality. + + + Reception data rate for the associated radio, -1 if not available. + + + Transmission data rate for the associated radio, -1 if not available. + + + Latency of transmission to the associated radio, -1 if not available. + + + Power of transmission to the associated radio, -1 if not available. + + + Amount of bytes already received from the associated radio. + + + Amount of bytes already transmitted to the associated radio. + + + Distance for the associated radio, -1 if not available. + + + + + This message is used to log wifi networks in the surroundings. + + Extended Service Set Identifier of the network + + + MAC Address of the network. + + + + + + + + + + + + Information regarding a sent/received Sonar pulse. + + + + Frequency of the sent/received sonar pulse. + + + + + Pulse Length of the sonar pulse. + + + + + Time Delay of the sonar pulse. + + + + + Doppler shift added to the sonar pulse in retransmission + + + + + + + + This message represents a world model. + + + + This field holds a series of geographical features present in the world. + + + + + This field holds the coverage states of the features in the world. + + + + + + + This message holds a geographical that, according to the number of vertices, may correspond to a point, a line or polygon. + + + + The unique identifier for this feature. + + + + + The vertices of the feature. + If the feature has just one vertex, it is a point. + If the feature has exactly two vertices, it is a line. + Features with more than two points, correspond to polygons. + + + + + + + This message is used to report the coverage state of a geographical feature. + It is reported by the UxVs performing the surveys. + + + + The unique feature identifier. Feature IDs are managed by the C2. + + + + + + The coverage is completed for this feature. + + + + + The feature is partially complete. + + + + + The coverage has not been started for this feature. + + + + + + + + + The unique task identifier. Task ids are managed by the C2. + + + + + The purpose of this message. + + + Accept the execution of this task. + + + Reject the execution of this task. + + + Request this task to be assigned to the destination of the message. + + + Request this task to be unassigned from the destination of the message. + + + Report the state of execution of this task. + + + Request this task completion status. + + + + + + This field will be empty or hold an inline message whose type varies with the operation. + + + + + + + This message is used to control the state of execution for the entire system. + + + + + + + + + + + This message describes the capabilities provided by an UxV. + + + + + + This message describes an area surveying capability. + + + + + + + + + This message describes an area surveying capability. + + + + + + + This message describes a moving capability. + + + + + This message is used to describe an area surveying task. + + The identifier for this task. + + + The identifier of the feature to be surveyed. + + + + + + The deadline until when the task must be finished. The number of seconds is represented + in Universal Coordinated Time (UCT) in seconds since Jan 1, 1970 using IEEE double precision + floating point numbers. + + + + + + This message is used to describe an area surveying task. + + The identifier for this task. + + + The destination where to go. + + + + The deadline until when the task must be finished. The number of seconds is represented + in Universal Coordinated Time (UCT) in seconds since Jan 1, 1970 using IEEE double precision + floating point numbers. + + + + + + + The identifier for this task. + + + + + + + + + + + + + This message is used to describe an area synchronization task. + + The identifier for this task. + + + The identifier of the feature where vehicles synchronize. + + + + Time window for synchronization task execution, in seconds. + + + + + The deadline until when the task must be finished. The number of seconds is represented + in Universal Coordinated Time (UCT) in seconds since Jan 1, 1970 using IEEE double precision + floating point numbers. + + + diff --git a/src-generated/resources/xml/IMC_Addresses.xml b/src-generated/resources/xml/IMC_Addresses.xml deleted file mode 100644 index 8ee05ee5..00000000 --- a/src-generated/resources/xml/IMC_Addresses.xml +++ /dev/null @@ -1,230 +0,0 @@ - - - - - -
- -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- -
-
-
- -
-
-
-
-
-
-
- -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- -
-
-
-
-
-
- -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- -
- -
-
-
-
-
-
-
- -
-
-
-
-
-
-
-
-
-
-
- -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- -
-
-
-
- -
- -
-
- diff --git a/src/java/pt/lsts/util/ImcReplay.java b/src/java/pt/lsts/util/ImcReplay.java index dc05971d..b8069c01 100644 --- a/src/java/pt/lsts/util/ImcReplay.java +++ b/src/java/pt/lsts/util/ImcReplay.java @@ -7,6 +7,7 @@ import java.nio.file.Path; import java.nio.file.Paths; import java.util.ArrayList; +import java.util.Arrays; import java.util.HashSet; import java.util.Locale; import java.util.logging.Logger; @@ -16,9 +17,15 @@ import com.eclipsesource.json.Json; import com.eclipsesource.json.JsonValue; +import pt.lsts.imc.IMCDefinition; import pt.lsts.imc.IMCMessage; +import pt.lsts.imc.def.SystemType; import pt.lsts.imc.lsf.LsfIndex; +import pt.lsts.imc.net.ConnectFilter; +import pt.lsts.imc.net.IMCProtocol; import pt.lsts.imc.net.UDPTransport; +import pt.lsts.neptus.messages.listener.MessageInfo; +import pt.lsts.neptus.messages.listener.MessageListener; public class ImcReplay { @@ -33,6 +40,20 @@ enum Protocol { final static Logger LOGGER = Logger.getLogger(ImcReplay.class.getSimpleName()); + static IMCProtocol IMCPROTOCOL = new IMCProtocol("IMC Replay", 6007, 6007, SystemType.CCU); + static { + IMCPROTOCOL.setAutoConnect(ConnectFilter.ALWAYS); + IMCPROTOCOL.addMessageListener(new MessageListener() { + public void onMessage(MessageInfo info, IMCMessage msg) { + if (msg.getMgid() >= 3000 && msg.getMgid() < 3200) { + LOGGER.warning(msg.getAbbrev()+" received from " + msg.getSourceName()+" / "+info.getPublisherInetAddress() + ": "); + LOGGER.info(msg.asJSON(true)); + } + }; + }); + LOGGER.info("Started IMC protocol"); + } + private static class Destination { String hostname; int port; @@ -74,7 +95,7 @@ public static void JsonReplay(Path jsonFile, String... destinations) throws Exce LOGGER.info("Sent " + msg.getAbbrev() + " to " + d); } } - LOGGER.info("Replay completed"); + LOGGER.info("Replay completed"); } private static void sendTo(IMCMessage msg, Destination destination) { @@ -87,7 +108,8 @@ private static void sendTo(IMCMessage msg, Destination destination) { } else { System.out.println("TCP not yet implemented."); - } + } + //IMCPROTOCOL.sendToPeers(msg); } private static Destination parseDestination(String destination) { @@ -145,6 +167,8 @@ public static void main(String[] args) throws Exception { System.exit(1); } + System.out.println("Synch number being used: "+String.format("%2X", IMCDefinition.getInstance().getSyncWord())); + String[] extraArgs = new String[args.length - 1]; for (int i = 1; i < args.length; i++) extraArgs[i - 1] = args[i];