Skip to content

Commit d7c02fd

Browse files
committed
IMC Version 5.4.3
1 parent 0082ea1 commit d7c02fd

File tree

9 files changed

+1355
-169
lines changed

9 files changed

+1355
-169
lines changed
Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
/*
2+
* Below is the copyright agreement for IMCJava.
3+
*
4+
* Copyright (c) 2010-2014, 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+
* IMC Message Crude Oil (286)<br/>
34+
* Crude oil measurement.<br/>
35+
*/
36+
37+
public class CrudeOil extends IMCMessage {
38+
39+
public static final int ID_STATIC = 286;
40+
41+
public CrudeOil() {
42+
super(ID_STATIC);
43+
}
44+
45+
public CrudeOil(IMCMessage msg) {
46+
super(ID_STATIC);
47+
try{
48+
copyFrom(msg);
49+
}
50+
catch (Exception e) {
51+
e.printStackTrace();
52+
}
53+
}
54+
55+
public CrudeOil(IMCDefinition defs) {
56+
super(defs, ID_STATIC);
57+
}
58+
59+
public static CrudeOil create(Object... values) {
60+
CrudeOil m = new CrudeOil();
61+
for (int i = 0; i < values.length-1; i+= 2)
62+
m.setValue(values[i].toString(), values[i+1]);
63+
return m;
64+
}
65+
66+
public static CrudeOil clone(IMCMessage msg) throws Exception {
67+
68+
CrudeOil m = new CrudeOil();
69+
if (msg == null)
70+
return m;
71+
if(msg.definitions != m.definitions){
72+
msg = msg.cloneMessage();
73+
IMCUtil.updateMessage(msg, m.definitions);
74+
}
75+
else if (msg.getMgid()!=m.getMgid())
76+
throw new Exception("Argument "+msg.getAbbrev()+" is incompatible with message "+m.getAbbrev());
77+
78+
m.getHeader().values.putAll(msg.getHeader().values);
79+
m.values.putAll(msg.values);
80+
return m;
81+
}
82+
83+
public CrudeOil(float value) {
84+
super(ID_STATIC);
85+
setValue(value);
86+
}
87+
88+
/**
89+
* @return Value (ppb) - fp32_t
90+
*/
91+
public double getValue() {
92+
return getDouble("value");
93+
}
94+
95+
/**
96+
* @param value Value (ppb)
97+
*/
98+
public CrudeOil setValue(double value) {
99+
values.put("value", value);
100+
return this;
101+
}
102+
103+
}

src-generated/pt/lsts/imc/NavigationReset.java renamed to src-generated/pt/lsts/imc/FineOil.java

Lines changed: 31 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -30,19 +30,19 @@
3030
package pt.lsts.imc;
3131

3232
/**
33-
* IMC Message Navigation Reset (359)<br/>
34-
* Request a navigation reset.<br/>
33+
* IMC Message Fine Oil (287)<br/>
34+
* Fine oil measurement.<br/>
3535
*/
3636

37-
public class NavigationReset extends IMCMessage {
37+
public class FineOil extends IMCMessage {
3838

39-
public static final int ID_STATIC = 359;
39+
public static final int ID_STATIC = 287;
4040

41-
public NavigationReset() {
41+
public FineOil() {
4242
super(ID_STATIC);
4343
}
4444

45-
public NavigationReset(IMCMessage msg) {
45+
public FineOil(IMCMessage msg) {
4646
super(ID_STATIC);
4747
try{
4848
copyFrom(msg);
@@ -52,20 +52,20 @@ public NavigationReset(IMCMessage msg) {
5252
}
5353
}
5454

55-
public NavigationReset(IMCDefinition defs) {
55+
public FineOil(IMCDefinition defs) {
5656
super(defs, ID_STATIC);
5757
}
5858

59-
public static NavigationReset create(Object... values) {
60-
NavigationReset m = new NavigationReset();
59+
public static FineOil create(Object... values) {
60+
FineOil m = new FineOil();
6161
for (int i = 0; i < values.length-1; i+= 2)
6262
m.setValue(values[i].toString(), values[i+1]);
6363
return m;
6464
}
6565

66-
public static NavigationReset clone(IMCMessage msg) throws Exception {
66+
public static FineOil clone(IMCMessage msg) throws Exception {
6767

68-
NavigationReset m = new NavigationReset();
68+
FineOil m = new FineOil();
6969
if (msg == null)
7070
return m;
7171
if(msg.definitions != m.definitions){
@@ -80,4 +80,24 @@ else if (msg.getMgid()!=m.getMgid())
8080
return m;
8181
}
8282

83+
public FineOil(float value) {
84+
super(ID_STATIC);
85+
setValue(value);
86+
}
87+
88+
/**
89+
* @return Value (ppb) - fp32_t
90+
*/
91+
public double getValue() {
92+
return getDouble("value");
93+
}
94+
95+
/**
96+
* @param value Value (ppb)
97+
*/
98+
public FineOil setValue(double value) {
99+
values.put("value", value);
100+
return this;
101+
}
102+
83103
}

0 commit comments

Comments
 (0)