Skip to content

Commit 41dcb62

Browse files
Generated messages for LSTS/imc@d4e6ca2.
1 parent 1963fd0 commit 41dcb62

9 files changed

Lines changed: 230 additions & 18 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 = '73ce349'
6+
gradle.ext.imcGitHubBranch = 'd4e6ca2'
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/ImcStringDefs.java

Lines changed: 2 additions & 2 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 = "73ce3498262dd3f94614983b7418e961bd49152e";
34+
public static final String IMC_SHA = "d4e6ca252e8825d7beeafba491b40c4152d75816";
3535
public static final String IMC_BRANCH = "master";
36-
public static final String IMC_COMMIT = "Pedro Gonçalves (pedro@lsts.pt), 2025-08-26T13:48:13Z, https://github.com/LSTS/imc/commit/73ce3498262dd3f94614983b7418e961bd49152e, Add autonaut-01 address to IMC_Addresses.xml";
36+
public static final String IMC_COMMIT = "Paulo Dias (paulo.sousa.dias@gmail.com), 2026-01-06T13:05:29Z, https://github.com/LSTS/imc/commit/d4e6ca252e8825d7beeafba491b40c4152d75816, Fix typo on message group.";
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: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -734,6 +734,8 @@ private IMCMessage createTypedMessage(int mgid, IMCDefinition defs) {
734734
return new VersionInfo(defs);
735735
case TotalHeading.ID_STATIC:
736736
return new TotalHeading(defs);
737+
case TypedEntityParameterEditor.ID_STATIC:
738+
return new TypedEntityParameterEditor(defs);
737739
default:
738740
return new IMCMessage(defs);
739741
}

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ else if (msg.getMgid()!=m.getMgid())
9696
return m;
9797
}
9898

99-
public QueryTypedEntityParameters(OP op, long request_id, String entity_name, java.util.Collection<TypedEntityParameter> parameters) {
99+
public QueryTypedEntityParameters(OP op, long request_id, String entity_name, java.util.Collection<TypedEntityParametersOptions> parameters) {
100100
super(ID_STATIC);
101101
setOp(op);
102102
setRequestId(request_id);
@@ -184,9 +184,9 @@ public QueryTypedEntityParameters setEntityName(String entity_name) {
184184
/**
185185
* @return Parameters - message-list
186186
*/
187-
public java.util.Vector<TypedEntityParameter> getParameters() {
187+
public java.util.Vector<TypedEntityParametersOptions> getParameters() {
188188
try {
189-
return getMessageList("parameters", TypedEntityParameter.class);
189+
return getMessageList("parameters", TypedEntityParametersOptions.class);
190190
}
191191
catch (Exception e) {
192192
return null;
@@ -197,7 +197,7 @@ public java.util.Vector<TypedEntityParameter> getParameters() {
197197
/**
198198
* @param parameters Parameters
199199
*/
200-
public QueryTypedEntityParameters setParameters(java.util.Collection<TypedEntityParameter> parameters) {
200+
public QueryTypedEntityParameters setParameters(java.util.Collection<TypedEntityParametersOptions> parameters) {
201201
values.put("parameters", parameters);
202202
return this;
203203
}

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
* Entity parameter with all the data that defines an entity parameter.<br/>
3636
*/
3737

38-
public class TypedEntityParameter extends IMCMessage {
38+
public class TypedEntityParameter extends TypedEntityParametersOptions {
3939

4040
public enum TYPE {
4141
BOOL(1),
@@ -60,7 +60,9 @@ public long value() {
6060

6161
public enum VISIBILITY {
6262
USER(0),
63-
DEVELOPER(1);
63+
DEVELOPER(1),
64+
USER_NOT_EDITABLE(2),
65+
DEVELOPER_NOT_EDITABLE(3);
6466

6567
protected long value;
6668

Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
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 Typed Entity Parameter Editor (2036)<br/>
35+
* This message is used to describe the ValuesIf content of a TypedEntityParameter.<br/>
36+
*/
37+
38+
public class TypedEntityParameterEditor extends TypedEntityParametersOptions {
39+
40+
public static final int ID_STATIC = 2036;
41+
42+
public TypedEntityParameterEditor() {
43+
super(ID_STATIC);
44+
}
45+
46+
public TypedEntityParameterEditor(IMCMessage msg) {
47+
super(ID_STATIC);
48+
try{
49+
copyFrom(msg);
50+
}
51+
catch (Exception e) {
52+
e.printStackTrace();
53+
}
54+
}
55+
56+
public TypedEntityParameterEditor(IMCDefinition defs) {
57+
super(defs, ID_STATIC);
58+
}
59+
60+
public static TypedEntityParameterEditor create(Object... values) {
61+
TypedEntityParameterEditor m = new TypedEntityParameterEditor();
62+
for (int i = 0; i < values.length-1; i+= 2)
63+
m.setValue(values[i].toString(), values[i+1]);
64+
return m;
65+
}
66+
67+
public static TypedEntityParameterEditor clone(IMCMessage msg) throws Exception {
68+
69+
TypedEntityParameterEditor m = new TypedEntityParameterEditor();
70+
if (msg == null)
71+
return m;
72+
if(msg.definitions != m.definitions){
73+
msg = msg.cloneMessage();
74+
IMCUtil.updateMessage(msg, m.definitions);
75+
}
76+
else if (msg.getMgid()!=m.getMgid())
77+
throw new Exception("Argument "+msg.getAbbrev()+" is incompatible with message "+m.getAbbrev());
78+
79+
m.getHeader().values.putAll(msg.getHeader().values);
80+
m.values.putAll(msg.values);
81+
return m;
82+
}
83+
84+
public TypedEntityParameterEditor(String value) {
85+
super(ID_STATIC);
86+
if (value != null)
87+
setValue(value);
88+
}
89+
90+
/**
91+
* @return Value - plaintext
92+
*/
93+
public String getValue() {
94+
return getString("value");
95+
}
96+
97+
/**
98+
* @param value Value
99+
*/
100+
public TypedEntityParameterEditor setValue(String value) {
101+
values.put("value", value);
102+
return this;
103+
}
104+
105+
}
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
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 TypedEntityParametersOptions (-1)<br/>
35+
*/
36+
37+
public abstract class TypedEntityParametersOptions extends IMCMessage {
38+
39+
public TypedEntityParametersOptions(int type) {
40+
super(type);
41+
}
42+
43+
public TypedEntityParametersOptions(IMCDefinition defs, int type) {
44+
super(defs, type);
45+
}
46+
47+
public static TypedEntityParametersOptions clone(IMCMessage msg) throws Exception {
48+
IMCMessage m = IMCDefinition.getInstance().create(msg.getAbbrev());
49+
if (!TypedEntityParametersOptions.class.isAssignableFrom(m.getClass()))
50+
throw new Exception(m.getClass().getSimpleName()+" is not a subclass");
51+
52+
if(msg.definitions != m.definitions){
53+
msg = msg.cloneMessage();
54+
IMCUtil.updateMessage(msg, m.definitions);
55+
}
56+
57+
m.getHeader().values.putAll(msg.getHeader().values);
58+
m.values.putAll(msg.values);
59+
60+
return (TypedEntityParametersOptions)m;
61+
}
62+
63+
}
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
73ce3498262dd3f94614983b7418e961bd49152e
2-
73ce349
3-
url: https://api.github.com/repos/LSTS/imc/commits/73ce349
1+
d4e6ca252e8825d7beeafba491b40c4152d75816
2+
d4e6ca2
3+
url: https://api.github.com/repos/LSTS/imc/commits/d4e6ca2

src-generated/resources/xml/IMC.xml

Lines changed: 46 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<!--
33
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
4-
+ Copyright (C) 2007-2025 Laboratório de Sistemas e Tecnologia Subaquática +
4+
+ Copyright (C) 2007-2026 Laboratório de Sistemas e Tecnologia Subaquática +
55
+ Departamento de Engenharia Electrotécnica e de Computadores +
66
+ Rua Dr. Roberto Frias, 4200-465 Porto, Portugal +
77
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
@@ -371,6 +371,12 @@
371371
<message-type abbrev="RemoteCommand"/>
372372
<message-type abbrev="HistoricSample"/>
373373
</message-group>
374+
375+
<message-group name="TypedEntityParametersOptions" abbrev="TypedEntityParametersOptions">
376+
<message-type abbrev="TypedEntityParameter"/>
377+
<message-type abbrev="TypedEntityParameterEditor"/>
378+
</message-group>
379+
374380
</message-groups>
375381

376382
<flags>
@@ -11650,8 +11656,12 @@
1165011656
<field name="Entity Name" abbrev="entity_name" type="plaintext">
1165111657
<description>Entity Label of the task that's replying to the request</description>
1165211658
</field>
11653-
<field name="Parameters" abbrev="parameters" type="message-list" message-type="TypedEntityParameter">
11654-
<description>Contains an optionally defined List of TypedEntityParameter as a response to a TypedEntityParamaters Request.</description>
11659+
<field name="Parameters" abbrev="parameters" type="message-list" message-type="TypedEntityParametersOptions">
11660+
<description>
11661+
Contains an optionally defined List of TypedEntityParameter as a response to a TypedEntityParamaters Request.
11662+
Additionally, if the entity has a custom editor, this message will contain the information to load it with a
11663+
single TypedEntityParameterOptions message in the list.
11664+
</description>
1165511665
</field>
1165611666
</message>
1165711667

@@ -11720,8 +11730,26 @@
1172011730
</description>
1172111731
</field>
1172211732
<field name="Visibility" abbrev="visibility" type="uint8_t" unit="Enumerated" prefix="VISIBILITY">
11723-
<value id="0" name="User" abbrev="USER" />
11724-
<value id="1" name="Developer" abbrev="DEVELOPER" />
11733+
<value id="0" name="User" abbrev="USER">
11734+
<description>
11735+
Parameter is visible and editable by the user.
11736+
</description>
11737+
</value>
11738+
<value id="1" name="Developer" abbrev="DEVELOPER">
11739+
<description>
11740+
Parameter is visible and editable by the user bu in developer view.
11741+
</description>
11742+
</value>
11743+
<value id="2" name="User - Not Editable" abbrev="USER_NOT_EDITABLE">
11744+
<description>
11745+
The same as for User, but the parameter is not editable.
11746+
</description>
11747+
</value>
11748+
<value id="3" name="Developer - Not Editable" abbrev="DEVELOPER_NOT_EDITABLE">
11749+
<description>
11750+
The same as for Developer, but the parameter is not editable.
11751+
</description>
11752+
</value>
1172511753
</field>
1172611754
<field name="Scope" abbrev="scope" type="uint8_t" unit="Enumerated" prefix="SCOPE">
1172711755
<value id="0" name="Global" abbrev="GLOBAL" />
@@ -11731,7 +11759,7 @@
1173111759
</field>
1173211760
</message>
1173311761

11734-
<message id="2018" name="Values If" abbrev="ValuesIf" source="ccu,vehicle" category="Networking">
11762+
<message id="2018" name="Values If" abbrev="ValuesIf" source="ccu,vehicle" category="CCU">
1173511763
<description>This message is used to describe the ValuesIf content of a TypedEntityParameter.</description>
1173611764
<field name="Param" abbrev="param" type="plaintext">
1173711765
<description>Name of parameter to compare</description>
@@ -11785,4 +11813,16 @@
1178511813
</description>
1178611814
</field>
1178711815
</message>
11816+
11817+
<message id="2036" name="Typed Entity Parameter Editor" abbrev="TypedEntityParameterEditor" source="ccu,vehicle" category="CCU">
11818+
<description>This message is used to describe the ValuesIf content of a TypedEntityParameter.</description>
11819+
<field name="Value" abbrev="value" type="plaintext">
11820+
<description>
11821+
String name of the editor to be used for this entity parameters.
11822+
This value is advisory only. The receiving end should try to honor it,
11823+
for the edition respect more complicated logic that Values-If can provide.
11824+
</description>
11825+
</field>
11826+
</message>
11827+
1178811828
</messages>

0 commit comments

Comments
 (0)