Skip to content

Commit

Permalink
IMC Version 5.4.3
Browse files Browse the repository at this point in the history
  • Loading branch information
rasmartins committed Sep 18, 2014
1 parent 0082ea1 commit d7c02fd
Show file tree
Hide file tree
Showing 9 changed files with 1,355 additions and 169 deletions.
103 changes: 103 additions & 0 deletions src-generated/pt/lsts/imc/CrudeOil.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
/*
* Below is the copyright agreement for IMCJava.
*
* Copyright (c) 2010-2014, 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 Crude Oil (286)<br/>
* Crude oil measurement.<br/>
*/

public class CrudeOil extends IMCMessage {

public static final int ID_STATIC = 286;

public CrudeOil() {
super(ID_STATIC);
}

public CrudeOil(IMCMessage msg) {
super(ID_STATIC);
try{
copyFrom(msg);
}
catch (Exception e) {
e.printStackTrace();
}
}

public CrudeOil(IMCDefinition defs) {
super(defs, ID_STATIC);
}

public static CrudeOil create(Object... values) {
CrudeOil m = new CrudeOil();
for (int i = 0; i < values.length-1; i+= 2)
m.setValue(values[i].toString(), values[i+1]);
return m;
}

public static CrudeOil clone(IMCMessage msg) throws Exception {

CrudeOil m = new CrudeOil();
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 CrudeOil(float value) {
super(ID_STATIC);
setValue(value);
}

/**
* @return Value (ppb) - fp32_t
*/
public double getValue() {
return getDouble("value");
}

/**
* @param value Value (ppb)
*/
public CrudeOil setValue(double value) {
values.put("value", value);
return this;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -30,19 +30,19 @@
package pt.lsts.imc;

/**
* IMC Message Navigation Reset (359)<br/>
* Request a navigation reset.<br/>
* IMC Message Fine Oil (287)<br/>
* Fine oil measurement.<br/>
*/

public class NavigationReset extends IMCMessage {
public class FineOil extends IMCMessage {

public static final int ID_STATIC = 359;
public static final int ID_STATIC = 287;

public NavigationReset() {
public FineOil() {
super(ID_STATIC);
}

public NavigationReset(IMCMessage msg) {
public FineOil(IMCMessage msg) {
super(ID_STATIC);
try{
copyFrom(msg);
Expand All @@ -52,20 +52,20 @@ public NavigationReset(IMCMessage msg) {
}
}

public NavigationReset(IMCDefinition defs) {
public FineOil(IMCDefinition defs) {
super(defs, ID_STATIC);
}

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

public static NavigationReset clone(IMCMessage msg) throws Exception {
public static FineOil clone(IMCMessage msg) throws Exception {

NavigationReset m = new NavigationReset();
FineOil m = new FineOil();
if (msg == null)
return m;
if(msg.definitions != m.definitions){
Expand All @@ -80,4 +80,24 @@ else if (msg.getMgid()!=m.getMgid())
return m;
}

public FineOil(float value) {
super(ID_STATIC);
setValue(value);
}

/**
* @return Value (ppb) - fp32_t
*/
public double getValue() {
return getDouble("value");
}

/**
* @param value Value (ppb)
*/
public FineOil setValue(double value) {
values.put("value", value);
return this;
}

}
Loading

0 comments on commit d7c02fd

Please sign in to comment.