Package jmri.jmrix.dccpp
Class DCCppReply
- java.lang.Object
-
- jmri.jmrix.AbstractMessage
-
- jmri.jmrix.AbstractMRReply
-
- jmri.jmrix.dccpp.DCCppReply
-
- All Implemented Interfaces:
Message
public class DCCppReply extends AbstractMRReply
Represents a single response from the DCC++ system.
-
-
Field Summary
Fields Modifier and Type Field Description protected java.lang.StringmyRegexprotected java.lang.StringBuildermyReply-
Fields inherited from class jmri.jmrix.AbstractMRReply
DEFAULTMAXSIZE
-
Fields inherited from class jmri.jmrix.AbstractMessage
_dataChars, _nDataChars
-
-
Constructor Summary
Constructors Constructor Description DCCppReply()DCCppReply(java.lang.String reply)DCCppReply(DCCppReply reply)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringgetAutomationDescString()intgetAutomationIDInt()java.util.ArrayList<java.lang.Integer>getAutomationIDList()java.lang.StringgetAutomationIDString()java.lang.StringgetAutomationTypeString()java.lang.StringgetBuildString()intgetCallbackNumInt()java.lang.StringgetCallbackNumString()intgetCallbackSubInt()java.lang.StringgetCallbackSubString()intgetClockMinutesInt()java.lang.StringgetClockMinutesString()intgetClockRateInt()java.lang.StringgetClockRateString()intgetCommTypeInt()java.lang.StringgetCommTypeValueString()intgetCurrentInt()java.util.ArrayList<java.lang.Integer>getCurrentMaxesList()java.lang.StringgetCurrentString()java.util.ArrayList<java.lang.Integer>getCurrentValuesList()intgetCVInt()java.lang.StringgetCVString()booleangetDirectionBool()intgetDirectionInt()java.lang.StringgetDirectionString()intgetElement(int n)Get a particular element in a Message.intgetFunctionsInt()java.lang.StringgetFunctionsString()booleangetIsForward()intgetLCDDisplayNumInt()java.lang.StringgetLCDDisplayNumString()intgetLCDLineNumInt()java.lang.StringgetLCDLineNumString()java.lang.StringgetLCDTextString()intgetLength()intgetLocoIdInt()doublegetMeterMaxValue()doublegetMeterMinValue()java.lang.StringgetMeterName()doublegetMeterResolution()java.lang.StringgetMeterType()Meter.UnitgetMeterUnit()doublegetMeterValue()doublegetMeterWarnValue()intgetOpCode()Not really used inside of DCC++.chargetOpCodeChar()Get the opcode as a one character string.booleangetOutputCmdStateBool()intgetOutputCmdStateInt()java.lang.StringgetOutputCmdStateString()booleangetOutputIsHigh()booleangetOutputIsLow()intgetOutputListIFlagInt()java.lang.StringgetOutputListIFlagString()intgetOutputListPinInt()java.lang.StringgetOutputListPinString()intgetOutputListStateInt()java.lang.StringgetOutputListStateString()intgetOutputNumInt()java.lang.StringgetOutputNumString()booleangetPowerBool()java.lang.StringgetPowerDistrictName()java.lang.StringgetPowerDistrictStatus()intgetProgramBitInt()java.lang.StringgetProgramBitString()java.util.LinkedHashMap<java.lang.String,java.lang.Object>getProperties()build a propertylist from reply values.java.lang.StringgetPropertiesAsString()Generate properties list for certain repliesintgetReadValueInt()java.lang.StringgetReadValueString()intgetRegisterInt()java.lang.StringgetRegisterString()java.lang.StringgetRosterDescString()java.lang.StringgetRosterFKeysString()intgetRosterIDInt()java.util.ArrayList<java.lang.Integer>getRosterIDList()java.lang.StringgetRosterIDString()intgetSensorDefNumInt()java.lang.StringgetSensorDefNumString()intgetSensorDefPinInt()java.lang.StringgetSensorDefPinString()booleangetSensorDefPullupBool()intgetSensorDefPullupInt()java.lang.StringgetSensorDefPullupString()booleangetSensorIsActive()booleangetSensorIsInactive()intgetSensorNumInt()java.lang.StringgetSensorNumString()intgetSensorStateInt()java.lang.StringgetSensorStateString()intgetSpeedByteInt()intgetSpeedInt()java.lang.StringgetSpeedString()java.lang.StringgetStationType()intgetTOAddressIndexInt()java.lang.StringgetTOAddressIndexString()intgetTOAddressInt()java.lang.StringgetTOAddressString()intgetTOClosedPositionInt()intgetTOIDInt()java.lang.StringgetTOIDString()booleangetTOIsClosed()booleangetTOIsThrown()intgetTOPinInt()intgetTOProfileInt()intgetTOStateInt()java.lang.StringgetTOStateString()intgetTOThrownPositionInt()chargetTrackManagerLetter()java.lang.StringgetTrackManagerMode()intgetTurnoutDefAddrInt()java.lang.StringgetTurnoutDefAddrString()intgetTurnoutDefNumInt()java.lang.StringgetTurnoutDefNumString()intgetTurnoutDefSubAddrInt()java.lang.StringgetTurnoutDefSubAddrString()java.lang.StringgetTurnoutDescString()java.util.ArrayList<java.lang.Integer>getTurnoutIDList()java.lang.StringgetTurnoutStateString()booleangetValueBool(int idx)doublegetValueDouble(int idx)intgetValueInt(int idx)java.lang.StringgetValueString(int idx)java.lang.StringgetVersion()booleanisAutomationIDReply()booleanisAutomationIDsReply()booleanisClockReply()booleanisCommTypeReply()booleanisCurrentMaxesReply()booleanisCurrentReply()booleanisCurrentValuesReply()booleanisDiagReply()booleanisEStop()booleanisLCDTextReply()booleanisLocoStateReply()booleanisMADCFailReply()booleanisMADCSuccessReply()booleanisMaxNumSlotsReply()booleanisMeterReply()booleanisMeterTypeCurrent()booleanisMeterTypeVolt()booleanisNamedCurrentReply()booleanisNamedPowerReply()booleanisOutputCmdReply()booleanisOutputDefReply()booleanisOutputReply()booleanisPowerReply()booleanisProgramBitReply()booleanisProgramBitReplyV4()booleanisProgramLocoIdReply()booleanisProgramReply()booleanisProgramReplyV4()booleanisRosterIDReply()booleanisRosterIDsReply()booleanisSensorDefReply()booleanisSensorReply()booleanisStatusReply()booleanisThrottleReply()booleanisTrackManagerReply()booleanisTurnoutCmdReply()booleanisTurnoutDefDCCReply()booleanisTurnoutDefLCNReply()booleanisTurnoutDefReply()booleanisTurnoutDefServoReply()booleanisTurnoutDefVpinReply()booleanisTurnoutIDReply()booleanisTurnoutIDsReply()booleanisTurnoutReply()booleanisValidReplyFormat()booleanisVerifyReply()booleanisWriteEepromReply()protected static java.util.regex.Matchermatch(java.lang.String s, java.lang.String pat, java.lang.String name)protected booleanmatches(java.lang.String pat)intmaxSize()static DCCppReplyparseDCCppReply(java.lang.String s)Parses a string and generates a DCCppReply from the string contentsvoidparseReply(java.lang.String s)voidsetElement(int n, int v)Set a single Data Element at a particular index.protected intskipPrefix(int index)java.lang.StringtoMonitorString()Generate text translations of replies for use in the DCCpp monitor.java.lang.StringtoString()Override default toString.booleanvalueExists(int idx)-
Methods inherited from class jmri.jmrix.AbstractMRReply
flush, isBinary, isRetransmittableErrorMsg, isUnsolicited, match, pollValue, setBinary, setOpCode, setUnsolicited, skipWhiteSpace, value
-
Methods inherited from class jmri.jmrix.AbstractMessage
equals, getNumDataElements, hashCode
-
-
-
-
Constructor Detail
-
DCCppReply
public DCCppReply()
-
DCCppReply
public DCCppReply(DCCppReply reply)
-
DCCppReply
public DCCppReply(java.lang.String reply)
-
-
Method Detail
-
toString
public java.lang.String toString()
Override default toString.- Specified by:
toStringin interfaceMessage- Overrides:
toStringin classAbstractMRReply- Returns:
- myReply StringBuilder toString.
-
toMonitorString
public java.lang.String toMonitorString()
Generate text translations of replies for use in the DCCpp monitor.- Returns:
- representation of the DCCppReply as a string.
-
getPropertiesAsString
public java.lang.String getPropertiesAsString()
Generate properties list for certain replies- Returns:
- list of all properties as a string
-
getProperties
public java.util.LinkedHashMap<java.lang.String,java.lang.Object> getProperties()
build a propertylist from reply values.- Returns:
- properties hashmap
-
parseReply
public void parseReply(java.lang.String s)
-
parseDCCppReply
@Nonnull public static DCCppReply parseDCCppReply(java.lang.String s)
Parses a string and generates a DCCppReply from the string contents- Parameters:
s- String to be parsed- Returns:
- DCCppReply or empty string if not a valid formatted string
-
getOpCode
public int getOpCode()
Not really used inside of DCC++. Just here to play nicely with the inheritance. TODO: If this is unused, can we just not override it and (not) "use" the superclass version? ANSWER: No, we can't because the superclass looks in the _datachars element, which we don't use, and which will contain garbage data. Better to return something meaningful.- Overrides:
getOpCodein classAbstractMRReply- Returns:
- first char of myReply as integer
-
getOpCodeChar
public char getOpCodeChar()
Get the opcode as a one character string.- Returns:
- first char of myReply
-
getElement
public int getElement(int n)
Description copied from class:AbstractMessageGet a particular element in a Message.- Specified by:
getElementin interfaceMessage- Overrides:
getElementin classAbstractMessage- Parameters:
n- Element Index.- Returns:
- single element of message.
-
setElement
public void setElement(int n, int v)
Description copied from class:AbstractMessageSet a single Data Element at a particular index.- Specified by:
setElementin interfaceMessage- Overrides:
setElementin classAbstractMRReply- Parameters:
n- index of element.v- value of element.
-
getValueBool
public boolean getValueBool(int idx)
-
getValueString
public java.lang.String getValueString(int idx)
-
valueExists
public boolean valueExists(int idx)
-
getValueInt
public int getValueInt(int idx)
-
getValueDouble
public double getValueDouble(int idx)
-
skipPrefix
protected int skipPrefix(int index)
- Specified by:
skipPrefixin classAbstractMRReply
-
maxSize
public int maxSize()
- Overrides:
maxSizein classAbstractMRReply
-
getLength
public int getLength()
-
matches
protected boolean matches(java.lang.String pat)
-
match
protected static java.util.regex.Matcher match(java.lang.String s, java.lang.String pat, java.lang.String name)
-
getStationType
public java.lang.String getStationType()
-
getBuildString
public java.lang.String getBuildString()
-
getVersion
public java.lang.String getVersion()
-
getLocoIdInt
public int getLocoIdInt()
-
getSpeedByteInt
public int getSpeedByteInt()
-
getFunctionsInt
public int getFunctionsInt()
-
getFunctionsString
public java.lang.String getFunctionsString()
-
getRegisterString
public java.lang.String getRegisterString()
-
getRegisterInt
public int getRegisterInt()
-
getSpeedString
public java.lang.String getSpeedString()
-
getSpeedInt
public int getSpeedInt()
-
isEStop
public boolean isEStop()
-
getDirectionString
public java.lang.String getDirectionString()
-
getDirectionInt
public int getDirectionInt()
-
getDirectionBool
public boolean getDirectionBool()
-
getIsForward
public boolean getIsForward()
-
getTOIDString
public java.lang.String getTOIDString()
-
getTOIDInt
public int getTOIDInt()
-
getTOAddressString
public java.lang.String getTOAddressString()
-
getTOAddressInt
public int getTOAddressInt()
-
getTOAddressIndexString
public java.lang.String getTOAddressIndexString()
-
getTOAddressIndexInt
public int getTOAddressIndexInt()
-
getTOPinInt
public int getTOPinInt()
-
getTOThrownPositionInt
public int getTOThrownPositionInt()
-
getTOClosedPositionInt
public int getTOClosedPositionInt()
-
getTOProfileInt
public int getTOProfileInt()
-
getTOStateString
public java.lang.String getTOStateString()
-
getTOStateInt
public int getTOStateInt()
-
getTOIsThrown
public boolean getTOIsThrown()
-
getTOIsClosed
public boolean getTOIsClosed()
-
getRosterIDString
public java.lang.String getRosterIDString()
-
getRosterIDInt
public int getRosterIDInt()
-
getAutomationIDString
public java.lang.String getAutomationIDString()
-
getAutomationIDInt
public int getAutomationIDInt()
-
getCallbackNumString
public java.lang.String getCallbackNumString()
-
getCallbackNumInt
public int getCallbackNumInt()
-
getCallbackSubString
public java.lang.String getCallbackSubString()
-
getCallbackSubInt
public int getCallbackSubInt()
-
getCVString
public java.lang.String getCVString()
-
getCVInt
public int getCVInt()
-
getProgramBitString
public java.lang.String getProgramBitString()
-
getProgramBitInt
public int getProgramBitInt()
-
getReadValueString
public java.lang.String getReadValueString()
-
getReadValueInt
public int getReadValueInt()
-
getPowerDistrictName
public java.lang.String getPowerDistrictName()
-
getPowerDistrictStatus
public java.lang.String getPowerDistrictStatus()
-
getCurrentString
public java.lang.String getCurrentString()
-
getCurrentInt
public int getCurrentInt()
-
getMeterName
public java.lang.String getMeterName()
-
getMeterValue
public double getMeterValue()
-
getMeterType
public java.lang.String getMeterType()
-
getMeterUnit
public Meter.Unit getMeterUnit()
-
getMeterMinValue
public double getMeterMinValue()
-
getMeterMaxValue
public double getMeterMaxValue()
-
getMeterResolution
public double getMeterResolution()
-
getMeterWarnValue
public double getMeterWarnValue()
-
isMeterTypeVolt
public boolean isMeterTypeVolt()
-
isMeterTypeCurrent
public boolean isMeterTypeCurrent()
-
getPowerBool
public boolean getPowerBool()
-
getTurnoutDefNumString
public java.lang.String getTurnoutDefNumString()
-
getTurnoutDefNumInt
public int getTurnoutDefNumInt()
-
getTurnoutDefAddrString
public java.lang.String getTurnoutDefAddrString()
-
getTurnoutDefAddrInt
public int getTurnoutDefAddrInt()
-
getTurnoutDefSubAddrString
public java.lang.String getTurnoutDefSubAddrString()
-
getTurnoutDefSubAddrInt
public int getTurnoutDefSubAddrInt()
-
getOutputNumString
public java.lang.String getOutputNumString()
-
getOutputNumInt
public int getOutputNumInt()
-
getOutputListPinString
public java.lang.String getOutputListPinString()
-
getOutputListPinInt
public int getOutputListPinInt()
-
getOutputListIFlagString
public java.lang.String getOutputListIFlagString()
-
getOutputListIFlagInt
public int getOutputListIFlagInt()
-
getOutputListStateString
public java.lang.String getOutputListStateString()
-
getOutputListStateInt
public int getOutputListStateInt()
-
getOutputCmdStateBool
public boolean getOutputCmdStateBool()
-
getOutputCmdStateString
public java.lang.String getOutputCmdStateString()
-
getOutputCmdStateInt
public int getOutputCmdStateInt()
-
getOutputIsHigh
public boolean getOutputIsHigh()
-
getOutputIsLow
public boolean getOutputIsLow()
-
getSensorDefNumString
public java.lang.String getSensorDefNumString()
-
getSensorDefNumInt
public int getSensorDefNumInt()
-
getSensorDefPinString
public java.lang.String getSensorDefPinString()
-
getSensorDefPinInt
public int getSensorDefPinInt()
-
getSensorDefPullupString
public java.lang.String getSensorDefPullupString()
-
getSensorDefPullupInt
public int getSensorDefPullupInt()
-
getSensorDefPullupBool
public boolean getSensorDefPullupBool()
-
getSensorNumString
public java.lang.String getSensorNumString()
-
getSensorNumInt
public int getSensorNumInt()
-
getSensorStateString
public java.lang.String getSensorStateString()
-
getSensorStateInt
public int getSensorStateInt()
-
getSensorIsActive
public boolean getSensorIsActive()
-
getSensorIsInactive
public boolean getSensorIsInactive()
-
getCommTypeInt
public int getCommTypeInt()
-
getCommTypeValueString
public java.lang.String getCommTypeValueString()
-
getTurnoutIDList
public java.util.ArrayList<java.lang.Integer> getTurnoutIDList()
-
getTurnoutStateString
public java.lang.String getTurnoutStateString()
-
getTurnoutDescString
public java.lang.String getTurnoutDescString()
-
getRosterDescString
public java.lang.String getRosterDescString()
-
getRosterFKeysString
public java.lang.String getRosterFKeysString()
-
getRosterIDList
public java.util.ArrayList<java.lang.Integer> getRosterIDList()
-
getAutomationTypeString
public java.lang.String getAutomationTypeString()
-
getAutomationDescString
public java.lang.String getAutomationDescString()
-
getAutomationIDList
public java.util.ArrayList<java.lang.Integer> getAutomationIDList()
-
getCurrentMaxesList
public java.util.ArrayList<java.lang.Integer> getCurrentMaxesList()
-
getCurrentValuesList
public java.util.ArrayList<java.lang.Integer> getCurrentValuesList()
-
getTrackManagerLetter
public char getTrackManagerLetter()
-
getTrackManagerMode
public java.lang.String getTrackManagerMode()
-
getClockMinutesString
public java.lang.String getClockMinutesString()
-
getClockMinutesInt
public int getClockMinutesInt()
-
getClockRateString
public java.lang.String getClockRateString()
-
getClockRateInt
public int getClockRateInt()
-
isLCDTextReply
public boolean isLCDTextReply()
-
getLCDTextString
public java.lang.String getLCDTextString()
-
getLCDDisplayNumString
public java.lang.String getLCDDisplayNumString()
-
getLCDDisplayNumInt
public int getLCDDisplayNumInt()
-
getLCDLineNumString
public java.lang.String getLCDLineNumString()
-
getLCDLineNumInt
public int getLCDLineNumInt()
-
isThrottleReply
public boolean isThrottleReply()
-
isTurnoutReply
public boolean isTurnoutReply()
-
isTurnoutCmdReply
public boolean isTurnoutCmdReply()
-
isProgramReply
public boolean isProgramReply()
-
isProgramReplyV4
public boolean isProgramReplyV4()
-
isProgramLocoIdReply
public boolean isProgramLocoIdReply()
-
isVerifyReply
public boolean isVerifyReply()
-
isProgramBitReply
public boolean isProgramBitReply()
-
isProgramBitReplyV4
public boolean isProgramBitReplyV4()
-
isPowerReply
public boolean isPowerReply()
-
isNamedPowerReply
public boolean isNamedPowerReply()
-
isMaxNumSlotsReply
public boolean isMaxNumSlotsReply()
-
isDiagReply
public boolean isDiagReply()
-
isCurrentReply
public boolean isCurrentReply()
-
isNamedCurrentReply
public boolean isNamedCurrentReply()
-
isMeterReply
public boolean isMeterReply()
-
isSensorReply
public boolean isSensorReply()
-
isSensorDefReply
public boolean isSensorDefReply()
-
isTurnoutDefReply
public boolean isTurnoutDefReply()
-
isTurnoutDefDCCReply
public boolean isTurnoutDefDCCReply()
-
isTurnoutDefServoReply
public boolean isTurnoutDefServoReply()
-
isTurnoutDefVpinReply
public boolean isTurnoutDefVpinReply()
-
isTurnoutDefLCNReply
public boolean isTurnoutDefLCNReply()
-
isMADCFailReply
public boolean isMADCFailReply()
-
isMADCSuccessReply
public boolean isMADCSuccessReply()
-
isStatusReply
public boolean isStatusReply()
-
isOutputReply
public boolean isOutputReply()
-
isOutputDefReply
public boolean isOutputDefReply()
-
isOutputCmdReply
public boolean isOutputCmdReply()
-
isCommTypeReply
public boolean isCommTypeReply()
-
isWriteEepromReply
public boolean isWriteEepromReply()
-
isLocoStateReply
public boolean isLocoStateReply()
-
isTurnoutIDsReply
public boolean isTurnoutIDsReply()
-
isTurnoutIDReply
public boolean isTurnoutIDReply()
-
isRosterIDsReply
public boolean isRosterIDsReply()
-
isRosterIDReply
public boolean isRosterIDReply()
-
isAutomationIDsReply
public boolean isAutomationIDsReply()
-
isAutomationIDReply
public boolean isAutomationIDReply()
-
isCurrentMaxesReply
public boolean isCurrentMaxesReply()
-
isCurrentValuesReply
public boolean isCurrentValuesReply()
-
isClockReply
public boolean isClockReply()
-
isTrackManagerReply
public boolean isTrackManagerReply()
-
isValidReplyFormat
public boolean isValidReplyFormat()
-
-