Class LocoIOTableModel
- All Implemented Interfaces:
PropertyChangeListener,Serializable,EventListener,TableModel
This code derives the SV values from the user-selected mode and address; this is different from earlier versions where the user was expected to do the derivation manually. This derivation is complicated by the fact that the "mode" SV[port.0] in the LocoIO doesn't fully specify the operation being done - additional bits in "v2" SV[port.2] are also used. For example, 0x80 is both turnout closed and turnout high. We read and write the mode SV _last_ to handle this.
The "addr" field is constructed from (or causes the construction of, depending on whether we are reading or writing...) value1 and value2. In particular, value2 requires knowledge of the mode being set. When "capturing" a turnout address (where we don't have a mode setting) we presume that the address seen in the OPC_SW_REQ packet is for a fixed contact, and interpret the bits in that context.
The timeout code is modelled after that in jmri.jmrix.AbstractProgrammer, though there are significant modifications.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic final intstatic final intstatic final intstatic final intDefine the contents of the individual columns.static final intstatic final intstatic final intstatic final intstatic final intFields inherited from class javax.swing.table.AbstractTableModel
listenerList -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoiddispose()Class<?>getColumnClass(int col) intgetColumnName(int col) intgetPreferredWidth(int col) intgetValueAt(int row, int col) booleanisCellEditable(int row, int col) voidvoidsetValueAt(Object value, int row, int col) Methods inherited from class javax.swing.table.AbstractTableModel
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getListeners, getTableModelListeners, removeTableModelListener
-
Field Details
-
PINCOLUMN
Define the contents of the individual columns.- See Also:
-
MODECOLUMN
- See Also:
-
ADDRCOLUMN
- See Also:
-
SV0COLUMN
- See Also:
-
SV1COLUMN
- See Also:
-
SV2COLUMN
- See Also:
-
CAPTURECOLUMN
- See Also:
-
READCOLUMN
- See Also:
-
WRITECOLUMN
- See Also:
-
HIGHESTCOLUMN
- See Also:
-
-
Constructor Details
-
LocoIOTableModel
Primary constructor. Initializes all the arrays.- Parameters:
ldata- the data.
-
-
Method Details
-
propertyChange
- Specified by:
propertyChangein interfacePropertyChangeListener
-
getRowCount
- Specified by:
getRowCountin interfaceTableModel
-
getColumnCount
- Specified by:
getColumnCountin interfaceTableModel
-
getColumnName
- Specified by:
getColumnNamein interfaceTableModel- Overrides:
getColumnNamein classAbstractTableModel
-
getColumnClass
- Specified by:
getColumnClassin interfaceTableModel- Overrides:
getColumnClassin classAbstractTableModel
-
isCellEditable
- Specified by:
isCellEditablein interfaceTableModel- Overrides:
isCellEditablein classAbstractTableModel
-
getValueAt
- Specified by:
getValueAtin interfaceTableModel
-
getPreferredWidth
-
setValueAt
- Specified by:
setValueAtin interfaceTableModel- Overrides:
setValueAtin classAbstractTableModel
-
dispose
-