jmri
Interface Programmer

All Known Implementing Classes:
AbstractProgrammer, EasyDccOpsModeProgrammer, EasyDccProgrammer, EliteXNetProgrammer, LI100XNetProgrammer, LnOpsModeProgrammer, Mx1Programmer, NceOpsModeProgrammer, NceProgrammer, ProgDebugger, QsiProgrammer, SlotManager, SprogOpsModeProgrammer, SprogProgrammer, SRCPOpsModeProgrammer, SRCPProgrammer, XNetOpsModeProgrammer, XNetProgrammer

public interface Programmer

Provide access to the hardware DCC decoder programming capability.

Programmers come in two types:

depending on which type you have, only certain modes can be set. Valid modes are specified by the class static constants.

You get a Programmer object from a ProgrammerManager, which in turn can be located from the InstanceManager.


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.

Author:
Bob Jacobsen Copyright (C) 2001
See Also:
ProgrammerManager

Field Summary
static int ADDRESSMODE
          NMRA "Address-only" mode.
static int DIRECTBITMODE
          NMRA "Direct" mode, using only the bit-wise operations
static int DIRECTBYTEMODE
          NMRA "Direct" mode, using only the byte-wise operations
static int NONE
          No programming mode available
static int OPSACCBITMODE
          NMRA "Programming on the main" mode for stationary decoders, using only the bit-wise operations.
static int OPSACCBYTEMODE
          NMRA "Programming on the main" mode for stationary decoders, using only the byte-wise operations.
static int OPSACCEXTBITMODE
          NMRA "Programming on the main" mode for stationary decoders, using only the bit-wise operations and "extended" addressing.
static int OPSACCEXTBYTEMODE
          NMRA "Programming on the main" mode for stationary decoders, using only the byte-wise operations and "extended" addressing.
static int OPSBITMODE
          NMRA "Operations" or "Programming on the main" mode, using only the bit-wise operations
static int OPSBYTEMODE
          NMRA "Operations" or "Programming on the main" mode, using only the byte-wise operations
static int PAGEMODE
          NMRA "Paged" mode
static int REGISTERMODE
          NMRA "Register" mode
 
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()
           
 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)
           
 void setMode(int mode)
          Set the programmer to a particular mode.
 void writeCV(int CV, int val, ProgListener p)
          Perform a CV write in the system-specific manner, and using the specified programming mode.
 

Field Detail

NONE

static final int NONE
No programming mode available

See Also:
Constant Field Values

REGISTERMODE

static final int REGISTERMODE
NMRA "Register" mode

See Also:
Constant Field Values

PAGEMODE

static final int PAGEMODE
NMRA "Paged" mode

See Also:
Constant Field Values

DIRECTBITMODE

static final int DIRECTBITMODE
NMRA "Direct" mode, using only the bit-wise operations

See Also:
Constant Field Values

DIRECTBYTEMODE

static final int DIRECTBYTEMODE
NMRA "Direct" mode, using only the byte-wise operations

See Also:
Constant Field Values

ADDRESSMODE

static final int ADDRESSMODE
NMRA "Address-only" mode. Often implemented as a proper subset of "Register" mode, as the underlying operation is the same.

See Also:
Constant Field Values

OPSBYTEMODE

static final int OPSBYTEMODE
NMRA "Operations" or "Programming on the main" mode, using only the byte-wise operations

See Also:
Constant Field Values

OPSBITMODE

static final int OPSBITMODE
NMRA "Operations" or "Programming on the main" mode, using only the bit-wise operations

See Also:
Constant Field Values

OPSACCBYTEMODE

static final int OPSACCBYTEMODE
NMRA "Programming on the main" mode for stationary decoders, using only the byte-wise operations. Note that this is defined as using the "normal", not "extended" addressing.

See Also:
Constant Field Values

OPSACCBITMODE

static final int OPSACCBITMODE
NMRA "Programming on the main" mode for stationary decoders, using only the bit-wise operations. Note that this is defined as using the "normal", not "extended" addressing.

See Also:
Constant Field Values

OPSACCEXTBYTEMODE

static final int OPSACCEXTBYTEMODE
NMRA "Programming on the main" mode for stationary decoders, using only the byte-wise operations and "extended" addressing.

See Also:
Constant Field Values

OPSACCEXTBITMODE

static final int OPSACCEXTBITMODE
NMRA "Programming on the main" mode for stationary decoders, using only the bit-wise operations and "extended" addressing.

See Also:
Constant Field Values
Method Detail

writeCV

void writeCV(int CV,
             int val,
             ProgListener p)
             throws ProgrammerException
Perform a CV write in the system-specific manner, and using the specified programming mode. Note that this returns before the write 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)

Throws:
ProgrammerException

readCV

void readCV(int CV,
            ProgListener p)
            throws ProgrammerException
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)

Throws:
ProgrammerException

confirmCV

void confirmCV(int 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. 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)

Throws:
ProgrammerException

setMode

void setMode(int mode)
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.

Parameters:
mode - One of the class-constant mode values

getMode

int getMode()
Get the current programming mode

Returns:
one of the class constants identifying a mode

hasMode

boolean hasMode(int mode)
Check if a given mode is available

Parameters:
mode - Availability of this mode is returned
Returns:
True if the mode is available

getCanRead

boolean getCanRead()

addPropertyChangeListener

void addPropertyChangeListener(PropertyChangeListener p)

removePropertyChangeListener

void removePropertyChangeListener(PropertyChangeListener p)

decodeErrorCode

String decodeErrorCode(int i)


Copyright © 1997 - 2008 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: SourceForge_Logo