Skip to content

Commit 01b53c9

Browse files
Generated messages for LSTS/imc@9dd21a2.
1 parent 9b76086 commit 01b53c9

12 files changed

Lines changed: 939 additions & 16 deletions

settings.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// Set this for the GitHub IMC definition repo
44
gradle.ext.imcGitHubRepo = 'LSTS/imc'
55
// Set this for the branch of the GitHub IMC definition repo
6-
gradle.ext.imcGitHubBranch = 'a751178'
6+
gradle.ext.imcGitHubBranch = '9dd21a2'
77
// Set if you want to use the IMC_Addresses.xml or not
88
gradle.ext.imcDownloadIMCAddresses = 'true'
99
// Set this for the folder IMC definition repo

src-generated/java/pt/lsts/imc/AbsoluteWind.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232

3333
/**
3434
* IMC Message Absolute Wind (911)<br/>
35-
* Measurement of wind speed.<br/>
35+
* Measurement of absolute wind speed (Meaning without vehicle effects).<br/>
3636
*/
3737

3838
public class AbsoluteWind extends IMCMessage {

src-generated/java/pt/lsts/imc/CurrentProfile.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ public class CurrentProfile extends IMCMessage {
4040

4141
public static final short UTF_XYZ = 0x01;
4242
public static final short UTF_NED = 0x02;
43-
public static final short UTF_ENU = 0x03;
4443
public static final short UTF_BEAMS = 0x04;
44+
public static final short UTF_ENU = 0x08;
4545

4646
public static final int ID_STATIC = 1014;
4747

src-generated/java/pt/lsts/imc/ImcStringDefs.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@
3131

3232
public class ImcStringDefs {
3333

34-
public static final String IMC_SHA = "a751178768ff78009ab5ae3627342ebd537c7264";
35-
public static final String IMC_BRANCH = "a751178";
36-
public static final String IMC_COMMIT = "Paulo Dias (paulo.sousa.dias@gmail.com), 2025-05-14T13:17:54Z, https://github.com/LSTS/imc/commit/a751178768ff78009ab5ae3627342ebd537c7264, Added new MessagePartControl to word in conjunction with MessagePart.\nIt is not mandatory to use. A timeout implementation should be used to clear both sides (sender and receiver) from a not completed backlog.";
34+
public static final String IMC_SHA = "9dd21a2937fdb841609ba8800a6d0f0fc7042cf9";
35+
public static final String IMC_BRANCH = "9dd21a2";
36+
public static final String IMC_COMMIT = "Luís Venâncio (lvenancio@inegi.up.pt), 2025-05-23T12:26:13Z, https://github.com/LSTS/imc/commit/9dd21a2937fdb841609ba8800a6d0f0fc7042cf9, Adding messages required for requesting entity parameters from vehicles.";
3737

3838
public static java.util.Map<String, Integer> IMC_ADDRESSES = new java.util.LinkedHashMap<String, Integer>();
3939

src-generated/java/pt/lsts/imc/MessageFactory.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -724,6 +724,12 @@ private IMCMessage createTypedMessage(int mgid, IMCDefinition defs) {
724724
return new TotalMagIntensity(defs);
725725
case CommRestriction.ID_STATIC:
726726
return new CommRestriction(defs);
727+
case QueryTypedEntityParameters.ID_STATIC:
728+
return new QueryTypedEntityParameters(defs);
729+
case TypedEntityParameter.ID_STATIC:
730+
return new TypedEntityParameter(defs);
731+
case ValuesIf.ID_STATIC:
732+
return new ValuesIf(defs);
727733
case VersionInfo.ID_STATIC:
728734
return new VersionInfo(defs);
729735
case TotalHeading.ID_STATIC:
Lines changed: 205 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,205 @@
1+
/*
2+
* Below is the copyright agreement for IMCJava.
3+
*
4+
* Copyright (c) 2010-2025, Laboratório de Sistemas e Tecnologia Subaquática
5+
* All rights reserved.
6+
*
7+
* Redistribution and use in source and binary forms, with or without
8+
* modification, are permitted provided that the following conditions are met:
9+
* - Redistributions of source code must retain the above copyright
10+
* notice, this list of conditions and the following disclaimer.
11+
* - Redistributions in binary form must reproduce the above copyright
12+
* notice, this list of conditions and the following disclaimer in the
13+
* documentation and/or other materials provided with the distribution.
14+
* - Neither the names of IMC, LSTS, IMCJava nor the names of its
15+
* contributors may be used to endorse or promote products derived from
16+
* this software without specific prior written permission.
17+
*
18+
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
19+
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
20+
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21+
* DISCLAIMED. IN NO EVENT SHALL LABORATORIO DE SISTEMAS E TECNOLOGIA SUBAQUATICA
22+
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
23+
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
24+
* GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
25+
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
26+
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
27+
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28+
*
29+
*/
30+
package pt.lsts.imc;
31+
32+
33+
/**
34+
* IMC Message Query Typed Entity Parameters (2016)<br/>
35+
* This message can be used to query/report the entities and respective parameters in the system<br/>
36+
*/
37+
38+
public class QueryTypedEntityParameters extends IMCMessage {
39+
40+
public enum OP {
41+
REQUEST(0),
42+
REPLY(1);
43+
44+
protected long value;
45+
46+
public long value() {
47+
return value;
48+
}
49+
50+
OP(long value) {
51+
this.value = value;
52+
}
53+
}
54+
55+
public static final int ID_STATIC = 2016;
56+
57+
public QueryTypedEntityParameters() {
58+
super(ID_STATIC);
59+
}
60+
61+
public QueryTypedEntityParameters(IMCMessage msg) {
62+
super(ID_STATIC);
63+
try{
64+
copyFrom(msg);
65+
}
66+
catch (Exception e) {
67+
e.printStackTrace();
68+
}
69+
}
70+
71+
public QueryTypedEntityParameters(IMCDefinition defs) {
72+
super(defs, ID_STATIC);
73+
}
74+
75+
public static QueryTypedEntityParameters create(Object... values) {
76+
QueryTypedEntityParameters m = new QueryTypedEntityParameters();
77+
for (int i = 0; i < values.length-1; i+= 2)
78+
m.setValue(values[i].toString(), values[i+1]);
79+
return m;
80+
}
81+
82+
public static QueryTypedEntityParameters clone(IMCMessage msg) throws Exception {
83+
84+
QueryTypedEntityParameters m = new QueryTypedEntityParameters();
85+
if (msg == null)
86+
return m;
87+
if(msg.definitions != m.definitions){
88+
msg = msg.cloneMessage();
89+
IMCUtil.updateMessage(msg, m.definitions);
90+
}
91+
else if (msg.getMgid()!=m.getMgid())
92+
throw new Exception("Argument "+msg.getAbbrev()+" is incompatible with message "+m.getAbbrev());
93+
94+
m.getHeader().values.putAll(msg.getHeader().values);
95+
m.values.putAll(msg.values);
96+
return m;
97+
}
98+
99+
public QueryTypedEntityParameters(OP op, long request_id, String entity_name, java.util.Collection<TypedEntityParameter> parameters) {
100+
super(ID_STATIC);
101+
setOp(op);
102+
setRequestId(request_id);
103+
if (entity_name != null)
104+
setEntityName(entity_name);
105+
if (parameters != null)
106+
setParameters(parameters);
107+
}
108+
109+
/**
110+
* @return Operation (enumerated) - uint8_t
111+
*/
112+
public OP getOp() {
113+
try {
114+
OP o = OP.valueOf(getMessageType().getFieldPossibleValues("op").get(getLong("op")));
115+
return o;
116+
}
117+
catch (Exception e) {
118+
return null;
119+
}
120+
}
121+
122+
public String getOpStr() {
123+
return getString("op");
124+
}
125+
126+
public short getOpVal() {
127+
return (short) getInteger("op");
128+
}
129+
130+
/**
131+
* @param op Operation (enumerated)
132+
*/
133+
public QueryTypedEntityParameters setOp(OP op) {
134+
values.put("op", op.value());
135+
return this;
136+
}
137+
138+
/**
139+
* @param op Operation (as a String)
140+
*/
141+
public QueryTypedEntityParameters setOpStr(String op) {
142+
setValue("op", op);
143+
return this;
144+
}
145+
146+
/**
147+
* @param op Operation (integer value)
148+
*/
149+
public QueryTypedEntityParameters setOpVal(short op) {
150+
setValue("op", op);
151+
return this;
152+
}
153+
154+
/**
155+
* @return Request identitier - uint32_t
156+
*/
157+
public long getRequestId() {
158+
return getLong("request_id");
159+
}
160+
161+
/**
162+
* @param request_id Request identitier
163+
*/
164+
public QueryTypedEntityParameters setRequestId(long request_id) {
165+
values.put("request_id", request_id);
166+
return this;
167+
}
168+
169+
/**
170+
* @return Entity Name - plaintext
171+
*/
172+
public String getEntityName() {
173+
return getString("entity_name");
174+
}
175+
176+
/**
177+
* @param entity_name Entity Name
178+
*/
179+
public QueryTypedEntityParameters setEntityName(String entity_name) {
180+
values.put("entity_name", entity_name);
181+
return this;
182+
}
183+
184+
/**
185+
* @return Parameters - message-list
186+
*/
187+
public java.util.Vector<TypedEntityParameter> getParameters() {
188+
try {
189+
return getMessageList("parameters", TypedEntityParameter.class);
190+
}
191+
catch (Exception e) {
192+
return null;
193+
}
194+
195+
}
196+
197+
/**
198+
* @param parameters Parameters
199+
*/
200+
public QueryTypedEntityParameters setParameters(java.util.Collection<TypedEntityParameter> parameters) {
201+
values.put("parameters", parameters);
202+
return this;
203+
}
204+
205+
}

0 commit comments

Comments
 (0)