Package jmri.jmrit.symbolicprog
Class ShortAddrVariableValue
- java.lang.Object
-
- jmri.jmrit.symbolicprog.AbstractValue
-
- jmri.jmrit.symbolicprog.VariableValue
-
- jmri.jmrit.symbolicprog.DecVariableValue
-
- jmri.jmrit.symbolicprog.ShortAddrVariableValue
-
- All Implemented Interfaces:
java.awt.event.ActionListener
,java.awt.event.FocusListener
,java.beans.PropertyChangeListener
,java.util.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
-
Nested classes/interfaces inherited from class jmri.jmrit.symbolicprog.AbstractValue
AbstractValue.ValueState
-
-
Field Summary
Fields Modifier and Type Field Description (package private) java.lang.String[]
cvNumbers
(package private) int
firstFreeSpace
(package private) static int
maxCVs
(package private) int[]
newValues
-
Fields inherited from class jmri.jmrit.symbolicprog.DecVariableValue
_defaultColor, _factor, _maxVal, _minVal, _offset, _value, oldContents, reps, sliders
-
Fields inherited from class jmri.jmrit.symbolicprog.VariableValue
_cvMap, _status, _tooltipText
-
Fields inherited from class jmri.jmrit.symbolicprog.AbstractValue
prop
-
-
Constructor Summary
Constructors Constructor Description ShortAddrVariableValue(java.lang.String name, java.lang.String comment, java.lang.String cvName, boolean readOnly, boolean infoOnly, boolean writeOnly, boolean opsOnly, java.lang.String cvNum, java.lang.String mask, java.util.HashMap<java.lang.String,CvValue> v, javax.swing.JLabel status, java.lang.String stdname)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
dispose()
Dispose of the object.void
setModifiedCV(java.lang.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, fieldLength, focusGained, focusLost, getColor, getCommonRep, getDefaultColor, getIntValue, getNewRep, getValueObject, getValueString, isChanged, propertyChange, rangeVal, readAll, readChanges, setAvailable, setColor, setCvState, setIntValue, setToolTipText, setValue, textToValue, updatedTextField, usesCVs, valueToText
-
Methods inherited from class jmri.jmrit.symbolicprog.VariableValue
confirmAll, considerChanged, cvName, getComment, getCvDescription, getCvName, getCvNum, getInfoOnly, getLongValue, getMask, getMaxMask, getOpsOnly, getReadOnly, getState, getTextValue, getValueInCV, getWriteOnly, isBitMask, isBusy, isToRead, isToWrite, item, label, maskValAsInt, offsetVal, setBusy, setState, setToRead, setToWrite, setValue, setValueInCV, simplifyMask, updateRepresentation
-
Methods inherited from class jmri.jmrit.symbolicprog.AbstractValue
addPropertyChangeListener, getAvailable, removePropertyChangeListener
-
-
-
-
Field Detail
-
firstFreeSpace
int firstFreeSpace
-
maxCVs
static final int maxCVs
- See Also:
- Constant Field Values
-
cvNumbers
java.lang.String[] cvNumbers
-
newValues
int[] newValues
-
-
Constructor Detail
-
ShortAddrVariableValue
public ShortAddrVariableValue(java.lang.String name, java.lang.String comment, java.lang.String cvName, boolean readOnly, boolean infoOnly, boolean writeOnly, boolean opsOnly, java.lang.String cvNum, java.lang.String mask, java.util.HashMap<java.lang.String,CvValue> v, javax.swing.JLabel status, java.lang.String stdname)
-
-
Method Detail
-
setModifiedCV
public void setModifiedCV(java.lang.String cvNum)
Register a CV to be modified regardless of current value.- Parameters:
cvNum
- cv number string.
-
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 classDecVariableValue
- See Also:
VariableValue.isChanged()
-
writeAll
public void writeAll()
Description copied from class:VariableValue
Always write the contents of this Variable.- Overrides:
writeAll
in classDecVariableValue
-
dispose
public void dispose()
Description copied from class:VariableValue
Dispose of the object.- Overrides:
dispose
in classDecVariableValue
-
-