Class DefaultRailCom
- All Implemented Interfaces:
Comparable<NamedBean>,AddressedIdTag,PropertyChangeProvider,IdTag,NamedBean,RailCom,Reportable
RailCom interface.
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.NamedBean
NamedBean.BadNameException, NamedBean.BadSystemNameException, NamedBean.BadUserNameException, NamedBean.DisplayOptions, NamedBean.DuplicateSystemNameException -
Field Summary
FieldsFields inherited from class jmri.implementation.DefaultIdTag
PROPERTY_WHEN_LAST_SEEN, PROPERTY_WHERE_LAST_SEENFields inherited from class jmri.implementation.AbstractIdTag
prefix, whenLastSeen, whereLastSeenFields inherited from class jmri.implementation.AbstractNamedBean
listenerRefs, mSystemName, registerFields inherited from interface jmri.NamedBean
DISPLAY_NAME_FORMAT, INCONSISTENT, PROPERTY_COMMENT, PROPERTY_ENABLED, PROPERTY_KNOWN_STATE, PROPERTY_STATE, PROPERTY_USERNAME, QUOTED_NAME_FORMAT, UNKNOWNFields inherited from interface jmri.RailCom
CONSIST_ADDRESS, LONG_ADDRESS, NO_ADDRESS, ORIENTA, ORIENTB, SHORT_ADDRESS -
Constructor Summary
ConstructorsConstructorDescriptionDefaultRailCom(String systemName) DefaultRailCom(String systemName, String userName) -
Method Summary
Modifier and TypeMethodDescriptionintGets the actual load reported by decoder the RailCom device.intGets the actual speed reported by the RailCom device as a representation 128 speed stepsintGets the actual temperate reported by the RailCom device.intgetCV(int cv) Gets the value of a CV reported back from the RailCom device.Get a list of the CVs last seen for this RailCom device.intGet the expected CV to be returned in a RailCom Packet.intGets the remaining fuel level as a % Fuel level CV879 (RP.9.3.2)intGets the Last Location that the RailCom device was identified in Location is configured in CV876 (RP.9.3.2)intGets the Orientation of the Rail Com device on the trackintGets the routing number that the RailCom device wishes to travel.intgetState()Provide generic access to internal state.intGets 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.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.DefaultIdTag
compareTo, load, setWhereLastSeen, storeMethods inherited from class jmri.implementation.AbstractIdTag
getBeanType, getTagID, getWhenLastSeen, getWhereLastSeenMethods inherited from class jmri.implementation.AbstractNamedBean
addPropertyChangeListener, 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, vetoableChangeMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface jmri.AddressedIdTag
getLocoAddressMethods inherited from interface jmri.IdTag
getTagID, getWhenLastSeen, getWhereLastSeen, load, setWhereLastSeen, storeMethods inherited from interface jmri.NamedBean
addPropertyChangeListener, 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, vetoableChangeMethods inherited from interface jmri.beans.PropertyChangeProvider
addPropertyChangeListener, addPropertyChangeListener, getPropertyChangeListeners, getPropertyChangeListeners, removePropertyChangeListener, removePropertyChangeListener
-
Field Details
-
cvValues
-
-
Constructor Details
-
DefaultRailCom
-
DefaultRailCom
-
-
Method Details
-
setState
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 interfaceNamedBean- Overrides:
setStatein classDefaultIdTag- Parameters:
s- the state- Throws:
JmriException- general error when setting the state fails
-
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 interfaceNamedBean- Overrides:
getStatein classDefaultIdTag- Returns:
- the state
-
setOrientation
Description copied from interface:RailComMethod for a RailCom Reader to set the orientation reported back from a device- Specified by:
setOrientationin interfaceRailCom- Parameters:
type- the orientation to set
-
getOrientation
Description copied from interface:RailComGets the Orientation of the Rail Com device on the track- Specified by:
getOrientationin interfaceRailCom- Returns:
- current orientation
-
setActualSpeed
Description copied from interface:RailComMethod for a RailCom Reader to set the Actual speed reported back from a device- Specified by:
setActualSpeedin interfaceRailCom- Parameters:
type- the speed
-
getActualSpeed
Description copied from interface:RailComGets the actual speed reported by the RailCom device as a representation 128 speed steps- Specified by:
getActualSpeedin interfaceRailCom- Returns:
- -1 if not set.
-
setActualLoad
Description copied from interface:RailComMethod for a RailCom Reader to set the Actual Load back from a device.- Specified by:
setActualLoadin interfaceRailCom- Parameters:
type- the load
-
getActualLoad
Description copied from interface:RailComGets the actual load reported by decoder the RailCom device.- Specified by:
getActualLoadin interfaceRailCom- Returns:
- -1 if not set.
-
setActualTemperature
Description copied from interface:RailComMethod for a RailCom Reader to set the actual temperate reported back from a device.- Specified by:
setActualTemperaturein interfaceRailCom- Parameters:
type- the temperature
-
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 interfaceRailCom- Returns:
- -1 if not set.
-
setWaterLevel
Description copied from interface:RailComMethod for a RailCom Reader to set the water level reported back from a device.- Specified by:
setWaterLevelin interfaceRailCom- Parameters:
type- the water level
-
getWaterLevel
Description copied from interface:RailComGets the remaining fuel level as a % Water level CV878 (RP.9.3.2)- Specified by:
getWaterLevelin interfaceRailCom- Returns:
- -1 if not set.
-
setFuelLevel
Description copied from interface:RailComMethod for a RailCom Reader to set the fuel level reported back from a device.- Specified by:
setFuelLevelin interfaceRailCom- Parameters:
type- the fuel level
-
getFuelLevel
Description copied from interface:RailComGets the remaining fuel level as a % Fuel level CV879 (RP.9.3.2)- Specified by:
getFuelLevelin interfaceRailCom- Returns:
- -1 if not set.
-
setLocation
Description copied from interface:RailComMethod for a RailCom Reader to set the location reported back from a device.- Specified by:
setLocationin interfaceRailCom- Parameters:
type- the location
-
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 interfaceRailCom- Returns:
- -1 if not set.
-
setRoutingNo
Description copied from interface:RailComMethod for a RailCom Reader to set the routing number reported back from a device.- Specified by:
setRoutingNoin interfaceRailCom- Parameters:
type- the routing number
-
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 interfaceRailCom- Returns:
- -1 if not set.
-
setExpectedCv
Description copied from interface:RailComSet the CV number of the next expected value to be returned in a RailCom Packet.- Specified by:
setExpectedCvin interfaceRailCom- Parameters:
cv- the expected CV
-
getExpectedCv
Description copied from interface:RailComGet the expected CV to be returned in a RailCom Packet.- Specified by:
getExpectedCvin interfaceRailCom- Returns:
- the expected CV
-
setCvValue
Description copied from interface:RailComSet the value of the CV that has been read from the RailCom packet.- Specified by:
setCvValuein interfaceRailCom- Parameters:
value- the CV value
-
getCV
Description copied from interface:RailComGets the value of a CV reported back from the RailCom device. -
setCV
Description copied from interface:RailComSets the value of a CV reported back from the decoder. -
getCVList
Description copied from interface:RailComGet a list of the CVs last seen for this RailCom device. -
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 interfaceReportable- Overrides:
toReportStringin classAbstractIdTag- Returns:
- a report string representing the Object.
-