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:
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 -
Field Summary
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedCbusNodeEvent(int nn, int en, int thisnode, String eventString) CbusNodeEvent(CanSystemConnectionMemo memo, int nn, int en, int thisnode, int index, int maxEvVar) Set the value of the event variable array by indexprotectedCbusNodeEvent(CbusNodeEvent existing) -
Method Summary
Modifier and TypeMethodDescriptionprotected voidSets unknown event variables to 0intCompares to the Node / Event numbers of the EventbooleanintgetEvVar(int index) Returns the value of an event variableint[]Returns all event variables as a single stringReturns all event variables as a single hex stringintReturns the index of the next unknown event variableintGet the number of event variables by Array LengthintReturns the number of unknown event variablesinthashCode()final voidsetEvArr(int[] newArray) Set the value of the event variable array by existing arrayvoidsetEvVar(int index, int value) Set the value of the event variable array by indexMethods inherited from class jmri.jmrix.can.cbus.node.CbusBasicNodeEvent
getIndex, getParentNn, getTempFcuNodeName, notifyModel, setEditTableModel, setIndex, setTempFcuNodeNameMethods inherited from class jmri.jmrix.can.cbus.CbusEvent
getEn, getName, getNn, getNodeName, getState, matches, sendEvent, sendOff, sendOn, sendRequest, setEn, setName, setNameIfNoName, setNn, setState, toStringMethods inherited from class jmri.jmrix.can.cbus.CbusEventDataElements
getCanMessage, getData, getEvState, getJmriString, getNumElements, getNumEventDataElements, setData, setDataFromFrame, setNumElements
-
Constructor Details
-
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
-
CbusNodeEvent
-
-
Method Details
-
setEvVar
Set the value of the event variable array by index- Parameters:
index- event variable index, minimum 1value- min 0 max 255
-
setEvArr
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
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
-
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
Returns all event variables as a single hex stringeg. returns 0104D6A0
- Returns:
- the hex string for of the array
-
getOutstandingVars
Returns the number of unknown event variables- Returns:
- the decimal outstanding total
-
getNextOutstanding
Returns the index of the next unknown event variable- Returns:
- the decimal index value else 0 if all known
-
getNumEvVars
Get the number of event variables by Array Length- Returns:
- number of event variables
-
allOutstandingEvVarsNotNeeded
Sets unknown event variables to 0 -
equals
Custom method to compare Node Number and Event Number.
Custom method to compare Node Num, Ev Num, Parent Node Num, Event Variables
- Overrides:
equalsin classCbusBasicNodeEvent
-
hashCode
- Overrides:
hashCodein classCbusBasicNodeEvent
-
compareTo
Compares to the Node / Event numbers of the Event- Specified by:
compareToin interfaceComparable<CbusNodeEvent>
-