Package jmri.jmrix.can.cbus.node
Class CbusNodeEvent
- java.lang.Object
-
- jmri.jmrix.can.cbus.CbusEventDataElements
-
- jmri.jmrix.can.cbus.CbusEvent
-
- jmri.jmrix.can.cbus.node.CbusBasicNodeEvent
-
- jmri.jmrix.can.cbus.node.CbusNodeEvent
-
- All Implemented Interfaces:
java.lang.Comparable<CbusNodeEvent>
public class CbusNodeEvent extends CbusBasicNodeEvent implements java.lang.Comparable<CbusNodeEvent>
Class to represent an event stored on a node.Custom Equals method
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class jmri.jmrix.can.cbus.CbusEventDataElements
CbusEventDataElements.EvState
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
CbusNodeEvent(int nn, int en, int thisnode, java.lang.String eventString)
CbusNodeEvent(CanSystemConnectionMemo memo, int nn, int en, int thisnode, int index, int maxEvVar)
Set the value of the event variable array by indexprotected
CbusNodeEvent(CbusNodeEvent existing)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
allOutstandingEvVarsNotNeeded()
Sets unknown event variables to 0int
compareTo(CbusNodeEvent o)
Compares to the Node / Event numbers of the Eventboolean
equals(java.lang.Object o)
int
getEvVar(int index)
Returns the value of an event variableint[]
getEvVarArray()
java.lang.String
getEvVarString()
Returns all event variables as a single stringjava.lang.String
getHexEvVarString()
Returns all event variables as a single hex stringint
getNextOutstanding()
Returns the index of the next unknown event variableint
getNumEvVars()
Get the number of event variables by Array Lengthint
getOutstandingVars()
Returns the number of unknown event variablesint
hashCode()
void
setEvArr(int[] newArray)
Set the value of the event variable array by existing arrayvoid
setEvVar(int index, int value)
Set the value of the event variable array by index-
Methods inherited from class jmri.jmrix.can.cbus.node.CbusBasicNodeEvent
getIndex, getParentNn, getTempFcuNodeName, notifyModel, setEditTableModel, setIndex, setTempFcuNodeName
-
Methods inherited from class jmri.jmrix.can.cbus.CbusEvent
getEn, getName, getNn, getNodeName, getState, matches, sendEvent, sendOff, sendOn, sendRequest, setEn, setName, setNameIfNoName, setNn, setState, toString
-
Methods inherited from class jmri.jmrix.can.cbus.CbusEventDataElements
getCanMessage, getData, getEvState, getJmriString, getNumElements, getNumEventDataElements, setData, setDataFromFrame, setNumElements
-
-
-
-
Constructor Detail
-
CbusNodeEvent
public CbusNodeEvent(CanSystemConnectionMemo memo, int nn, int en, int thisnode, int index, int maxEvVar)
Set the value of the event variable array by index- Parameters:
memo
- CAN System Connectionnn
- Event node Numberen
- Event event or device numberthisnode
- Host node numberindex
- number assigned by node, -1 if unknownmaxEvVar
- Maximum event variables for the event
-
CbusNodeEvent
protected CbusNodeEvent(int nn, int en, int thisnode, java.lang.String eventString)
-
CbusNodeEvent
protected CbusNodeEvent(CbusNodeEvent existing)
-
-
Method Detail
-
setEvVar
public void setEvVar(int index, int value)
Set the value of the event variable array by index- Parameters:
index
- event variable index, minimum 1value
- min 0 max 255
-
setEvArr
public final void setEvArr(int[] newArray)
Set the value of the event variable array by existing array- Parameters:
newArray
- event variable array, 1st value index 0 should be 1st event value, NOT total
-
getEvVar
public int getEvVar(int index)
Returns the value of an event variable- Parameters:
index
- of the variable, no array offset needed, 1 is 1- Returns:
- the decimal event indexed variable value
-
getEvVarArray
public int[] getEvVarArray()
-
getEvVarString
public java.lang.String getEvVarString()
Returns all event variables as a single stringeg. /"1, 13, 1, 0, 0/"
- Returns:
- the decimal string for of the array, unknown values are blanked
-
getHexEvVarString
public java.lang.String getHexEvVarString()
Returns all event variables as a single hex stringeg. returns 0104D6A0
- Returns:
- the hex string for of the array
-
getOutstandingVars
public int getOutstandingVars()
Returns the number of unknown event variables- Returns:
- the decimal outstanding total
-
getNextOutstanding
public int getNextOutstanding()
Returns the index of the next unknown event variable- Returns:
- the decimal index value else 0 if all known
-
getNumEvVars
public int getNumEvVars()
Get the number of event variables by Array Length- Returns:
- number of event variables
-
allOutstandingEvVarsNotNeeded
protected void allOutstandingEvVarsNotNeeded()
Sets unknown event variables to 0
-
equals
public boolean equals(java.lang.Object o)
Custom method to compare Node Number and Event Number.
Custom method to compare Node Num, Ev Num, Parent Node Num, Event Variables
- Overrides:
equals
in classCbusBasicNodeEvent
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classCbusBasicNodeEvent
-
compareTo
public int compareTo(CbusNodeEvent o)
Compares to the Node / Event numbers of the Event- Specified by:
compareTo
in interfacejava.lang.Comparable<CbusNodeEvent>
-
-