Class DefaultRailCom
- java.lang.Object
- 
- jmri.implementation.AbstractNamedBean
- 
- jmri.implementation.AbstractIdTag
- 
- jmri.implementation.DefaultIdTag
- 
- jmri.implementation.DefaultRailCom
 
 
 
 
- 
- All Implemented Interfaces:
- java.lang.Comparable<NamedBean>,- AddressedIdTag,- PropertyChangeProvider,- IdTag,- NamedBean,- RailCom,- Reportable
 
 public class DefaultRailCom extends DefaultIdTag implements RailCom Concrete implementation of theRailCominterface.
 This file is part of JMRI.JMRI is free software; you can redistribute it and/or modify it under the terms of version 2 of the GNU General Public License as published by the Free Software Foundation. See the "COPYING" file for a copy of this license. JMRI is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - Since:
- 2.99.3
 
- 
- 
Nested Class Summary- 
Nested classes/interfaces inherited from interface jmri.NamedBeanNamedBean.BadNameException, NamedBean.BadSystemNameException, NamedBean.BadUserNameException, NamedBean.DisplayOptions, NamedBean.DuplicateSystemNameException
 
- 
 - 
Field SummaryFields Modifier and Type Field Description (package private) java.util.Hashtable<java.lang.Integer,java.lang.Integer>cvValues- 
Fields inherited from class jmri.implementation.DefaultIdTagPROPERTY_WHEN_LAST_SEEN, PROPERTY_WHERE_LAST_SEEN
 - 
Fields inherited from class jmri.implementation.AbstractIdTagprefix, whenLastSeen, whereLastSeen
 - 
Fields inherited from class jmri.implementation.AbstractNamedBeanlistenerRefs, mSystemName, register
 - 
Fields inherited from interface jmri.NamedBeanDISPLAY_NAME_FORMAT, INCONSISTENT, PROPERTY_COMMENT, PROPERTY_ENABLED, PROPERTY_KNOWN_STATE, PROPERTY_STATE, PROPERTY_USERNAME, QUOTED_NAME_FORMAT, UNKNOWN
 - 
Fields inherited from interface jmri.RailComCONSIST_ADDRESS, LONG_ADDRESS, NO_ADDRESS, ORIENTA, ORIENTB, SHORT_ADDRESS
 
- 
 - 
Constructor SummaryConstructors Constructor Description DefaultRailCom(java.lang.String systemName)DefaultRailCom(java.lang.String systemName, java.lang.String userName)
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description intgetActualLoad()Gets the actual load reported by decoder the RailCom device.intgetActualSpeed()Gets the actual speed reported by the RailCom device as a representation 128 speed stepsintgetActualTemperature()Gets the actual temperate reported by the RailCom device.intgetCV(int cv)Gets the value of a CV reported back from the RailCom device.java.util.List<java.lang.Integer>getCVList()Get a list of the CVs last seen for this RailCom device.intgetExpectedCv()Get the expected CV to be returned in a RailCom Packet.intgetFuelLevel()Gets the remaining fuel level as a % Fuel level CV879 (RP.9.3.2)intgetLocation()Gets the Last Location that the RailCom device was identified in Location is configured in CV876 (RP.9.3.2)intgetOrientation()Gets the Orientation of the Rail Com device on the trackintgetRoutingNo()Gets the routing number that the RailCom device wishes to travel.intgetState()Provide generic access to internal state.intgetWaterLevel()Gets the remaining fuel level as a % Water level CV878 (RP.9.3.2)voidsetActualLoad(int type)Method for a RailCom Reader to set the Actual Load back from a device.voidsetActualSpeed(int type)Method for a RailCom Reader to set the Actual speed reported back from a devicevoidsetActualTemperature(int type)Method for a RailCom Reader to set the actual temperate reported back from a device.voidsetCV(int cv, int value)Sets the value of a CV reported back from the decoder.voidsetCvValue(int value)Set the value of the CV that has been read from the RailCom packet.voidsetExpectedCv(int cv)Set the CV number of the next expected value to be returned in a RailCom Packet.voidsetFuelLevel(int type)Method for a RailCom Reader to set the fuel level reported back from a device.voidsetLocation(int type)Method for a RailCom Reader to set the location reported back from a device.voidsetOrientation(int type)Method for a RailCom Reader to set the orientation reported back from a devicevoidsetRoutingNo(int type)Method for a RailCom Reader to set the routing number reported back from a device.voidsetState(int s)Provide generic access to internal state.voidsetWaterLevel(int type)Method for a RailCom Reader to set the water level reported back from a device.java.lang.StringtoReportString()The IDTag version of toReportString returns a string consisting of the user name (if defined) or Tag ID followed by the associated list of property values.- 
Methods inherited from class jmri.implementation.DefaultIdTagcompareTo, load, setWhereLastSeen, store
 - 
Methods inherited from class jmri.implementation.AbstractIdTaggetBeanType, getTagID, getWhenLastSeen, getWhereLastSeen
 - 
Methods inherited from class jmri.implementation.AbstractNamedBeanaddPropertyChangeListener, addPropertyChangeListener, addPropertyChangeListener, addPropertyChangeListener, compareSystemNameSuffix, describeState, dispose, equals, firePropertyChange, getComment, getDisplayName, getDisplayName, getListenerRef, getListenerRefs, getNumPropertyChangeListeners, getProperty, getPropertyChangeListeners, getPropertyChangeListeners, getPropertyChangeListenersByReference, getPropertyKeys, getSystemName, getUserName, hashCode, removeProperty, removePropertyChangeListener, removePropertyChangeListener, setComment, setProperty, setUserName, toString, toStringSuffix, updateListenerRef, vetoableChange
 - 
Methods inherited from class java.lang.Objectclone, finalize, getClass, notify, notifyAll, wait, wait, wait
 - 
Methods inherited from interface jmri.AddressedIdTaggetLocoAddress
 - 
Methods inherited from interface jmri.IdTaggetTagID, getWhenLastSeen, getWhereLastSeen, load, setWhereLastSeen, store
 - 
Methods inherited from interface jmri.NamedBeanaddPropertyChangeListener, addPropertyChangeListener, compareSystemNameSuffix, compareTo, describeState, dispose, getBeanType, getComment, getDisplayName, getDisplayName, getListenerRef, getListenerRefs, getNumPropertyChangeListeners, getProperty, getPropertyChangeListenersByReference, getPropertyKeys, getRecommendedToolTip, getSystemName, getUsageReport, getUserName, removeProperty, setComment, setProperty, setUserName, toString, updateListenerRef, vetoableChange
 - 
Methods inherited from interface jmri.beans.PropertyChangeProvideraddPropertyChangeListener, addPropertyChangeListener, getPropertyChangeListeners, getPropertyChangeListeners, removePropertyChangeListener, removePropertyChangeListener
 
- 
 
- 
- 
- 
Field Detail- 
cvValuesjava.util.Hashtable<java.lang.Integer,java.lang.Integer> cvValues 
 
- 
 - 
Constructor Detail- 
DefaultRailCompublic DefaultRailCom(java.lang.String systemName) 
 - 
DefaultRailCompublic DefaultRailCom(java.lang.String systemName, java.lang.String userName) 
 
- 
 - 
Method Detail- 
setStatepublic void setState(int s) throws JmriException Description copied from interface:NamedBeanProvide generic access to internal state.This generally shouldn't be used by Java code; use the class-specific form instead (e.g. setCommandedState in Turnout). This is provided to make scripts access easier to read. - Specified by:
- setStatein interface- NamedBean
- Overrides:
- setStatein class- DefaultIdTag
- Parameters:
- s- the state
- Throws:
- JmriException- general error when setting the state fails
 
 - 
getStatepublic int getState() Description copied from interface:NamedBeanProvide generic access to internal state.This generally shouldn't be used by Java code; use the class-specific form instead (e.g. getCommandedState in Turnout). This is provided to make scripts easier to read. - Specified by:
- getStatein interface- NamedBean
- Overrides:
- getStatein class- DefaultIdTag
- Returns:
- the state
 
 - 
setOrientationpublic void setOrientation(int type) Description copied from interface:RailComMethod for a RailCom Reader to set the orientation reported back from a device- Specified by:
- setOrientationin interface- RailCom
- Parameters:
- type- the orientation to set
 
 - 
getOrientationpublic int getOrientation() Description copied from interface:RailComGets the Orientation of the Rail Com device on the track- Specified by:
- getOrientationin interface- RailCom
- Returns:
- current orientation
 
 - 
setActualSpeedpublic void setActualSpeed(int type) Description copied from interface:RailComMethod for a RailCom Reader to set the Actual speed reported back from a device- Specified by:
- setActualSpeedin interface- RailCom
- Parameters:
- type- the speed
 
 - 
getActualSpeedpublic int getActualSpeed() Description copied from interface:RailComGets the actual speed reported by the RailCom device as a representation 128 speed steps- Specified by:
- getActualSpeedin interface- RailCom
- Returns:
- -1 if not set.
 
 - 
setActualLoadpublic void setActualLoad(int type) Description copied from interface:RailComMethod for a RailCom Reader to set the Actual Load back from a device.- Specified by:
- setActualLoadin interface- RailCom
- Parameters:
- type- the load
 
 - 
getActualLoadpublic int getActualLoad() Description copied from interface:RailComGets the actual load reported by decoder the RailCom device.- Specified by:
- getActualLoadin interface- RailCom
- Returns:
- -1 if not set.
 
 - 
setActualTemperaturepublic void setActualTemperature(int type) Description copied from interface:RailComMethod for a RailCom Reader to set the actual temperate reported back from a device.- Specified by:
- setActualTemperaturein interface- RailCom
- Parameters:
- type- the temperature
 
 - 
getActualTemperaturepublic int getActualTemperature() Description copied from interface:RailComGets the actual temperate reported by the RailCom device. Location is configured in CV876 (RP.9.3.2)- Specified by:
- getActualTemperaturein interface- RailCom
- Returns:
- -1 if not set.
 
 - 
setWaterLevelpublic void setWaterLevel(int type) Description copied from interface:RailComMethod for a RailCom Reader to set the water level reported back from a device.- Specified by:
- setWaterLevelin interface- RailCom
- Parameters:
- type- the water level
 
 - 
getWaterLevelpublic int getWaterLevel() Description copied from interface:RailComGets the remaining fuel level as a % Water level CV878 (RP.9.3.2)- Specified by:
- getWaterLevelin interface- RailCom
- Returns:
- -1 if not set.
 
 - 
setFuelLevelpublic void setFuelLevel(int type) Description copied from interface:RailComMethod for a RailCom Reader to set the fuel level reported back from a device.- Specified by:
- setFuelLevelin interface- RailCom
- Parameters:
- type- the fuel level
 
 - 
getFuelLevelpublic int getFuelLevel() Description copied from interface:RailComGets the remaining fuel level as a % Fuel level CV879 (RP.9.3.2)- Specified by:
- getFuelLevelin interface- RailCom
- Returns:
- -1 if not set.
 
 - 
setLocationpublic void setLocation(int type) Description copied from interface:RailComMethod for a RailCom Reader to set the location reported back from a device.- Specified by:
- setLocationin interface- RailCom
- Parameters:
- type- the location
 
 - 
getLocationpublic int getLocation() Description copied from interface:RailComGets the Last Location that the RailCom device was identified in Location is configured in CV876 (RP.9.3.2)- Specified by:
- getLocationin interface- RailCom
- Returns:
- -1 if not set.
 
 - 
setRoutingNopublic void setRoutingNo(int type) Description copied from interface:RailComMethod for a RailCom Reader to set the routing number reported back from a device.- Specified by:
- setRoutingNoin interface- RailCom
- Parameters:
- type- the routing number
 
 - 
getRoutingNopublic int getRoutingNo() Description copied from interface:RailComGets the routing number that the RailCom device wishes to travel. Route Number is configured in CV874 (RP.9.3.2)- Specified by:
- getRoutingNoin interface- RailCom
- Returns:
- -1 if not set.
 
 - 
setExpectedCvpublic void setExpectedCv(int cv) Description copied from interface:RailComSet the CV number of the next expected value to be returned in a RailCom Packet.- Specified by:
- setExpectedCvin interface- RailCom
- Parameters:
- cv- the expected CV
 
 - 
getExpectedCvpublic int getExpectedCv() Description copied from interface:RailComGet the expected CV to be returned in a RailCom Packet.- Specified by:
- getExpectedCvin interface- RailCom
- Returns:
- the expected CV
 
 - 
setCvValuepublic void setCvValue(int value) Description copied from interface:RailComSet the value of the CV that has been read from the RailCom packet.- Specified by:
- setCvValuein interface- RailCom
- Parameters:
- value- the CV value
 
 - 
getCVpublic int getCV(int cv) Description copied from interface:RailComGets the value of a CV reported back from the RailCom device.
 - 
setCVpublic void setCV(int cv, int value) Description copied from interface:RailComSets the value of a CV reported back from the decoder.
 - 
getCVListpublic java.util.List<java.lang.Integer> getCVList() Description copied from interface:RailComGet a list of the CVs last seen for this RailCom device.
 - 
toReportStringpublic java.lang.String toReportString() Description copied from class:AbstractIdTagThe IDTag version of toReportString returns a string consisting of the user name (if defined) or Tag ID followed by the associated list of property values.- Specified by:
- toReportStringin interface- Reportable
- Overrides:
- toReportStringin class- AbstractIdTag
- Returns:
- a report string representing the Object.
 
 
- 
 
-