Class LocoIOTableModel
- java.lang.Object
-
- javax.swing.table.AbstractTableModel
-
- jmri.jmrix.loconet.locoio.LocoIOTableModel
-
- All Implemented Interfaces:
java.beans.PropertyChangeListener,java.io.Serializable,java.util.EventListener,javax.swing.table.TableModel
public class LocoIOTableModel extends javax.swing.table.AbstractTableModel implements java.beans.PropertyChangeListener
Basic Configurer for LocoIO hardware. Marked Legacy/Deprecated since 2017 version 4.12. Will be removed 2025 version 5.13This 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:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static intADDRCOLUMNstatic intCAPTURECOLUMNstatic intHIGHESTCOLUMNstatic intMODECOLUMNstatic intPINCOLUMNDefine the contents of the individual columns.static intREADCOLUMNstatic intSV0COLUMNstatic intSV1COLUMNstatic intSV2COLUMNstatic intWRITECOLUMN
-
Constructor Summary
Constructors Constructor Description LocoIOTableModel(LocoIOData ldata)Primary constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddispose()java.lang.Class<?>getColumnClass(int col)intgetColumnCount()java.lang.StringgetColumnName(int col)intgetPreferredWidth(int col)intgetRowCount()java.lang.ObjectgetValueAt(int row, int col)booleanisCellEditable(int row, int col)voidpropertyChange(java.beans.PropertyChangeEvent evt)voidsetValueAt(java.lang.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 Detail
-
PINCOLUMN
public static final int PINCOLUMN
Define the contents of the individual columns.- See Also:
- Constant Field Values
-
MODECOLUMN
public static final int MODECOLUMN
- See Also:
- Constant Field Values
-
ADDRCOLUMN
public static final int ADDRCOLUMN
- See Also:
- Constant Field Values
-
SV0COLUMN
public static final int SV0COLUMN
- See Also:
- Constant Field Values
-
SV1COLUMN
public static final int SV1COLUMN
- See Also:
- Constant Field Values
-
SV2COLUMN
public static final int SV2COLUMN
- See Also:
- Constant Field Values
-
CAPTURECOLUMN
public static final int CAPTURECOLUMN
- See Also:
- Constant Field Values
-
READCOLUMN
public static final int READCOLUMN
- See Also:
- Constant Field Values
-
WRITECOLUMN
public static final int WRITECOLUMN
- See Also:
- Constant Field Values
-
HIGHESTCOLUMN
public static final int HIGHESTCOLUMN
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
LocoIOTableModel
public LocoIOTableModel(LocoIOData ldata)
Primary constructor. Initializes all the arrays.- Parameters:
ldata- the data.
-
-
Method Detail
-
propertyChange
public void propertyChange(java.beans.PropertyChangeEvent evt)
- Specified by:
propertyChangein interfacejava.beans.PropertyChangeListener
-
getRowCount
public int getRowCount()
- Specified by:
getRowCountin interfacejavax.swing.table.TableModel
-
getColumnCount
public int getColumnCount()
- Specified by:
getColumnCountin interfacejavax.swing.table.TableModel
-
getColumnName
public java.lang.String getColumnName(int col)
- Specified by:
getColumnNamein interfacejavax.swing.table.TableModel- Overrides:
getColumnNamein classjavax.swing.table.AbstractTableModel
-
getColumnClass
public java.lang.Class<?> getColumnClass(int col)
- Specified by:
getColumnClassin interfacejavax.swing.table.TableModel- Overrides:
getColumnClassin classjavax.swing.table.AbstractTableModel
-
isCellEditable
public boolean isCellEditable(int row, int col)
- Specified by:
isCellEditablein interfacejavax.swing.table.TableModel- Overrides:
isCellEditablein classjavax.swing.table.AbstractTableModel
-
getValueAt
public java.lang.Object getValueAt(int row, int col)
- Specified by:
getValueAtin interfacejavax.swing.table.TableModel
-
getPreferredWidth
public int getPreferredWidth(int col)
-
setValueAt
public void setValueAt(java.lang.Object value, int row, int col)
- Specified by:
setValueAtin interfacejavax.swing.table.TableModel- Overrides:
setValueAtin classjavax.swing.table.AbstractTableModel
-
dispose
public void dispose()
-
-