jmri.jmrix.loconet
Class LnOpsModeProgrammer

Show UML class diagram
java.lang.Object
  extended by jmri.jmrix.loconet.LnOpsModeProgrammer
All Implemented Interfaces:
Programmer

public class LnOpsModeProgrammer
extends Object
implements Programmer

Provide an Ops Mode Programmer via a wrapper what works with the LocoNet SlotManager object.

See Also:
Programmer

Field Summary
(package private) static org.slf4j.Logger log
           
(package private)  int mAddress
           
(package private)  boolean mLongAddr
           
(package private)  SlotManager mSlotMgr
           
 
Fields inherited from interface jmri.Programmer
ADDRESSMODE, CBUSNODEVARMODE, DIRECTBITMODE, DIRECTBYTEMODE, NONE, OPSACCBITMODE, OPSACCBYTEMODE, OPSACCEXTBITMODE, OPSACCEXTBYTEMODE, OPSBITMODE, OPSBYTEMODE, PAGEMODE, REGISTERMODE
 
Constructor Summary
LnOpsModeProgrammer(SlotManager pSlotMgr, int pAddress, boolean pLongAddr)
           
 
Method Summary
 void addPropertyChangeListener(PropertyChangeListener p)
           
 void confirmCV(int CV, int val, ProgListener p)
          Confirm the value of a CV using the specified programming mode.
 String decodeErrorCode(int i)
           
 boolean getCanRead()
          Can this ops-mode programmer read back values?
 int getMode()
          Get the current programming mode
 boolean hasMode(int mode)
          Check if a given mode is available
 void readCV(int CV, ProgListener p)
          Perform a CV read in the system-specific manner, and using the specified programming mode.
 void removePropertyChangeListener(PropertyChangeListener p)
           
(package private)  void reportBadMode(int mode)
           
 void setMode(int mode)
          Set the programmer to a particular mode.
 void writeCV(int CV, int val, ProgListener p)
          Forward a write request to an ops-mode write operation
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

mSlotMgr

SlotManager mSlotMgr

mAddress

int mAddress

mLongAddr

boolean mLongAddr

log

static org.slf4j.Logger log
Constructor Detail

LnOpsModeProgrammer

public LnOpsModeProgrammer(SlotManager pSlotMgr,
                           int pAddress,
                           boolean pLongAddr)
Method Detail

writeCV

public void writeCV(int CV,
                    int val,
                    ProgListener p)
             throws ProgrammerException
Forward a write request to an ops-mode write operation

Specified by:
writeCV in interface Programmer
Throws:
ProgrammerException

readCV

public void readCV(int CV,
                   ProgListener p)
            throws ProgrammerException
Description copied from interface: Programmer
Perform a CV read in the system-specific manner, and using the specified programming mode. Note that this returns before the read is complete; you have to provide a ProgListener to hear about completion. The 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:
readCV in interface Programmer
Throws:
ProgrammerException

confirmCV

public void confirmCV(int CV,
                      int val,
                      ProgListener p)
               throws ProgrammerException
Description copied from interface: Programmer
Confirm the value of a CV using the specified programming mode. On some systems, this is faster than a read. Note that this returns before the confirm is complete; you have to provide a ProgListener to hear about completion. The 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:
confirmCV in interface Programmer
Throws:
ProgrammerException

setMode

public void setMode(int mode)
Description copied from interface: Programmer
Set the programmer to a particular mode. Only certain modes may be available for any particular implementation. If an invalid mode is requested, the active mode is unchanged.

Specified by:
setMode in interface Programmer
Parameters:
mode - One of the class-constant mode values

reportBadMode

void reportBadMode(int mode)

getMode

public int getMode()
Description copied from interface: Programmer
Get the current programming mode

Specified by:
getMode in interface Programmer
Returns:
one of the class constants identifying a mode

hasMode

public boolean hasMode(int mode)
Description copied from interface: Programmer
Check if a given mode is available

Specified by:
hasMode in interface Programmer
Parameters:
mode - Availability of this mode is returned
Returns:
True if the mode is available

getCanRead

public boolean getCanRead()
Can this ops-mode programmer read back values? Yes, if transponding hardware is present.

Specified by:
getCanRead in interface Programmer
Returns:
always true

addPropertyChangeListener

public void addPropertyChangeListener(PropertyChangeListener p)
Specified by:
addPropertyChangeListener in interface Programmer

removePropertyChangeListener

public void removePropertyChangeListener(PropertyChangeListener p)
Specified by:
removePropertyChangeListener in interface Programmer

decodeErrorCode

public String decodeErrorCode(int i)
Specified by:
decodeErrorCode in interface Programmer


Copyright © 1997-2013 JMRI Community.
JMRI, DecoderPro, PanelPro, SoundPro, DispatcherPro and associated logos are our trademarks.

Additional information on copyright, trademarks and licenses is linked here.
Site hosted by: Get JMRI Model Railroad Interface at SourceForge.net. Fast, secure and Free Open Source software downloads