jmri.jmrit.symbolicprog
Class ShortAddrVariableValue

Show UML class diagram
java.lang.Object
  extended by jmri.jmrit.symbolicprog.AbstractValue
      extended by jmri.jmrit.symbolicprog.VariableValue
          extended by jmri.jmrit.symbolicprog.DecVariableValue
              extended by jmri.jmrit.symbolicprog.ShortAddrVariableValue
All Implemented Interfaces:
ActionListener, FocusListener, PropertyChangeListener, EventListener

public class ShortAddrVariableValue
extends DecVariableValue

Representation of a short address (CV1).

This is a decimal value, extended to modify the other CVs when written. The CVs to be modified and their new values are stored in two arrays for simplicity.

The NMRA has decided that writing CV1 causes other CVs to update within the decoder (CV19 for consisting, CV29 for short/long address). We want DP to overwrite those _after_ writing CV1, so that the DP values are forced to be the correct ones.


Nested Class Summary
 
Nested classes/interfaces inherited from class jmri.jmrit.symbolicprog.DecVariableValue
DecVariableValue.VarTextField
 
Field Summary
(package private)  String[] cvNumbers
           
(package private)  int firstFreeSpace
           
(package private) static org.slf4j.Logger log
           
(package private) static int maxCVs
           
(package private)  int[] newValues
           
 
Fields inherited from class jmri.jmrit.symbolicprog.DecVariableValue
_defaultColor, _maxVal, _minVal, _value, oldContents, reps, sliders
 
Fields inherited from class jmri.jmrit.symbolicprog.VariableValue
_cvMap, _status, _tooltipText
 
Fields inherited from class jmri.jmrit.symbolicprog.AbstractValue
COLOR_DIFF, COLOR_EDITED, COLOR_FROMFILE, COLOR_READ, COLOR_SAME, COLOR_STORED, COLOR_UNKNOWN, DIFF, EDITED, FROMFILE, prop, READ, SAME, STORED, UNKNOWN
 
Constructor Summary
ShortAddrVariableValue(String name, String comment, String cvName, boolean readOnly, boolean infoOnly, boolean writeOnly, boolean opsOnly, String cvNum, String mask, HashMap<String,CvValue> v, JLabel status, String stdname)
           
 
Method Summary
 void dispose()
           
 void setModifiedCV(String cvNum)
          Register a CV to be modified regardless of current value
 void writeAll()
          Always write the contents of this Variable
 void writeChanges()
          Write the contents of this Variable if it's in a state that indicates it was "changed"
 
Methods inherited from class jmri.jmrit.symbolicprog.DecVariableValue
actionPerformed, enterField, exitField, focusGained, focusLost, getColor, getCommonRep, getDefaultColor, getIntValue, getNewRep, getValueObject, getValueString, isChanged, propertyChange, rangeVal, readAll, readChanges, setAvailable, setColor, setCvState, setIntValue, setToolTipText, setValue, updatedTextField, usesCVs
 
Methods inherited from class jmri.jmrit.symbolicprog.VariableValue
confirmAll, considerChanged, cvName, getComment, getCvDescription, getCvName, getCvNum, getInfoOnly, getMask, getOpsOnly, getReadOnly, getState, getTextValue, getWriteOnly, isBusy, isToRead, isToWrite, item, label, maskVal, newValue, offsetVal, setBusy, setState, setToRead, setToWrite, updateRepresentation
 
Methods inherited from class jmri.jmrit.symbolicprog.AbstractValue
addPropertyChangeListener, getAvailable, removePropertyChangeListener, stateNameFromValue
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

firstFreeSpace

int firstFreeSpace

maxCVs

static final int maxCVs
See Also:
Constant Field Values

cvNumbers

String[] cvNumbers

newValues

int[] newValues

log

static org.slf4j.Logger log
Constructor Detail

ShortAddrVariableValue

public ShortAddrVariableValue(String name,
                              String comment,
                              String cvName,
                              boolean readOnly,
                              boolean infoOnly,
                              boolean writeOnly,
                              boolean opsOnly,
                              String cvNum,
                              String mask,
                              HashMap<String,CvValue> v,
                              JLabel status,
                              String stdname)
Method Detail

setModifiedCV

public void setModifiedCV(String cvNum)
Register a CV to be modified regardless of current value


writeChanges

public void writeChanges()
Description copied from class: VariableValue
Write the contents of this Variable if it's in a state that indicates it was "changed"

Overrides:
writeChanges in class DecVariableValue
See Also:
VariableValue.isChanged()

writeAll

public void writeAll()
Description copied from class: VariableValue
Always write the contents of this Variable

Overrides:
writeAll in class DecVariableValue

dispose

public void dispose()
Overrides:
dispose in class DecVariableValue


Copyright © 1997-2014 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