Class CbusDccOpsModeProgrammer
- java.lang.Object
- 
- jmri.beans.PropertyChangeSupport
- 
- jmri.jmrix.AbstractProgrammer
- 
- jmri.jmrix.can.cbus.CbusDccProgrammer
- 
- jmri.jmrix.can.cbus.CbusDccOpsModeProgrammer
 
 
 
 
- 
- All Implemented Interfaces:
- java.util.EventListener,- AddressedProgrammer,- PropertyChangeFirer,- PropertyChangeProvider,- Disposable,- AbstractMRListener,- CanListener,- Programmer
 
 public class CbusDccOpsModeProgrammer extends CbusDccProgrammer implements AddressedProgrammer Provide an Ops Mode Programmer via a wrapper what works with the CBUS command station object.Functionally, this just creates packets to send via the command station. - See Also:
- Programmer
 
- 
- 
Nested Class Summary- 
Nested classes/interfaces inherited from class jmri.jmrix.can.cbus.CbusDccProgrammerCbusDccProgrammer.CbusDccProgrammerConfigurator
 - 
Nested classes/interfaces inherited from interface jmri.ProgrammerProgrammer.Configurator, Programmer.WriteConfirmMode
 
- 
 - 
Field SummaryFields Modifier and Type Field Description (package private) intmAddress(package private) booleanmLongAddr- 
Fields inherited from class jmri.jmrix.can.cbus.CbusDccProgrammer_cv, _nvOffset, _progRead, _val, COMMANDSENT, MODESENT, NOTPROGRAMMING, NVCOMMANDSENT, progState, RETURNSENT, tc
 - 
Fields inherited from class jmri.jmrix.AbstractProgrammerLONG_TIMEOUT, SHORT_TIMEOUT
 - 
Fields inherited from class jmri.beans.PropertyChangeSupportpropertyChangeSupport
 
- 
 - 
Constructor SummaryConstructors Constructor Description CbusDccOpsModeProgrammer(int pAddress, boolean pLongAddr, TrafficController tc)
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) voidcleanup()Ops-mode programming doesn't put the command station in programming mode, so we don't have to send an exit-programming command at end.voidconfirmCV(java.lang.String CV, int val, ProgListener p)Confirm the value of a CV using the specified programming mode.java.lang.StringgetAddress()intgetAddressNumber()booleangetCanRead()Checks the general read capability, regardless of modebooleangetLongAddress()java.util.List<ProgrammingMode>getSupportedModes()Get the list ofProgrammingModesupported by this Programmer.voidreadCV(java.lang.String CVname, ProgListener p)Perform a CV read in the system-specific manner, and using the specified programming mode.voidreply(CanReply m)Called when an incoming CanFrame is received from the CAN Network.voidwriteCV(java.lang.String CVname, int val, ProgListener p)Perform a CV write in the system-specific manner, and using the specified programming mode.- 
Methods inherited from class jmri.jmrix.can.cbus.CbusDccProgrammerdispose, getConfigurator, message, notifyProgListenerEnd, readCV, setNodeOfInterest, timeout, useProgrammer
 - 
Methods inherited from class jmri.jmrix.AbstractProgrammerdecodeErrorCode, getBestMode, getCanRead, getCanWrite, getCanWrite, getMode, getWriteConfirmMode, registerFromCV, restartTimer, setMode, startLongTimer, startShortTimer, stopTimer
 - 
Methods inherited from class jmri.beans.PropertyChangeSupportaddPropertyChangeListener, addPropertyChangeListener, fireIndexedPropertyChange, fireIndexedPropertyChange, fireIndexedPropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getPropertyChangeListeners, getPropertyChangeListeners, removePropertyChangeListener, removePropertyChangeListener
 - 
Methods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 - 
Methods inherited from interface jmri.jmrix.can.CanListeneraddTc, addTc, removeTc, removeTc
 - 
Methods inherited from interface jmri.ProgrammeraddPropertyChangeListener, decodeErrorCode, dispose, getCanRead, getCanWrite, getCanWrite, getConfigurator, getMode, getWriteConfirmMode, notifyProgListenerEnd, readCV, removePropertyChangeListener, setMode
 
- 
 
- 
- 
- 
Constructor Detail- 
CbusDccOpsModeProgrammerpublic CbusDccOpsModeProgrammer(int pAddress, boolean pLongAddr, TrafficController tc) 
 
- 
 - 
Method Detail- 
writeCVpublic void writeCV(java.lang.String CVname, int val, ProgListener p) throws ProgrammerException Perform a CV write in the system-specific manner, and using the specified programming mode.Handles a general address space through a String address. Each programmer defines the acceptable formats. Note that this returns before the write is complete; you have to provide a ProgListener to hear about completion. For simplicity, expect the return to be on the GUI thread. Exceptions will only be thrown at the start, not during the actual programming sequence. A typical exception would be due to an invalid mode (though that should be prevented earlier) Forward a write request to an ops-mode write operation - Specified by:
- writeCVin interface- Programmer
- Overrides:
- writeCVin class- CbusDccProgrammer
- Parameters:
- CVname- the CV to write
- val- the value to write
- p- the listener that will be notified of the write
- Throws:
- ProgrammerException- if unable to communicate
 
 - 
readCVpublic void readCV(java.lang.String CVname, ProgListener p) throws ProgrammerException Perform a CV read in the system-specific manner, and using the specified programming mode.Handles a general address space through a String address. Each programmer defines the acceptable formats. Note that this returns before the write is complete; you have to provide a ProgListener to hear about completion. For simplicity, expect the return to be on the GUI thread. Exceptions will only be thrown at the start, not during the actual programming sequence. A typical exception would be due to an invalid mode (though that should be prevented earlier) - Specified by:
- readCVin interface- Programmer
- Overrides:
- readCVin class- CbusDccProgrammer
- Parameters:
- CVname- the CV to read
- p- the listener that will be notified of the read
- Throws:
- ProgrammerException- if unable to communicate
 
 - 
confirmCVpublic void confirmCV(java.lang.String CV, int val, ProgListener p) throws ProgrammerException Confirm the value of a CV using the specified programming mode. On some systems, this is faster than a read.Handles a general address space through a String address. Each programmer defines the acceptable formats. Note that this returns before the write is complete; you have to provide a ProgListener to hear about completion. For simplicity, expect the return to be on the GUI thread. Exceptions will only be thrown at the start, not during the actual programming sequence. A typical exception would be due to an invalid mode (though that should be prevented earlier) - Specified by:
- confirmCVin interface- Programmer
- Overrides:
- confirmCVin class- CbusDccProgrammer
- Parameters:
- CV- the CV to confirm
- val- the value to confirm
- p- the listener that will be notified of the confirmation
- Throws:
- ProgrammerException- if unable to communicate
 
 - 
getSupportedModes@Nonnull public java.util.List<ProgrammingMode> getSupportedModes() Get the list ofProgrammingModesupported by this Programmer. If the order is significant, earlier modes are better. Types implemented here. Types implemented here.- Specified by:
- getSupportedModesin interface- Programmer
- Overrides:
- getSupportedModesin class- CbusDccProgrammer
- Returns:
- the list of supported modes or an empty list
 
 - 
replypublic void reply(CanReply m) Called when an incoming CanFrame is received from the CAN Network.- Specified by:
- replyin interface- CanListener
- Overrides:
- replyin class- CbusDccProgrammer
- Parameters:
- m- the CanReply being received.
 
 - 
getCanReadpublic boolean getCanRead() Checks the general read capability, regardless of mode Basic implementation. Override this to turn reading on and off globally. Can this ops-mode programmer read back values?- Specified by:
- getCanReadin interface- Programmer
- Overrides:
- getCanReadin class- AbstractProgrammer
- Returns:
- always false
 
 - 
getLongAddresspublic boolean getLongAddress() - Specified by:
- getLongAddressin interface- AddressedProgrammer
 
 - 
getAddressNumberpublic int getAddressNumber() - Specified by:
- getAddressNumberin interface- AddressedProgrammer
 
 - 
getAddresspublic java.lang.String getAddress() - Specified by:
- getAddressin interface- AddressedProgrammer
 
 - 
cleanupvoid cleanup() Ops-mode programming doesn't put the command station in programming mode, so we don't have to send an exit-programming command at end. Therefore, this routine does nothing except to replace the parent routine that does something.
 
- 
 
-