Class CbusSlotMonitorDataModel
- java.lang.Object
-
- javax.swing.table.AbstractTableModel
-
- jmri.jmrix.can.cbus.swing.cbusslotmonitor.CbusSlotMonitorDataModel
-
- All Implemented Interfaces:
java.io.Serializable
,java.util.EventListener
,javax.swing.table.TableModel
,Disposable
,AbstractMRListener
,CanListener
public class CbusSlotMonitorDataModel extends javax.swing.table.AbstractTableModel implements CanListener, Disposable
Table data model for display of CBUS Command Station Sessions and various Tools- See Also:
CbusSlotMonitorPane
, Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected java.lang.String
_context
protected int
_contype
(package private) static int[]
CBUSSLOTMONINITIALCOLS
(package private) static java.lang.String[]
CBUSSLOTMONTOOLTIPS
static int
CS_TIMEOUT
static int
ESTOP_COLUMN
static int
FLAGS_COLUMN
static int
FUNCTION_LIST
static int
LOCO_COMMANDED_SPEED_COLUMN
static int
LOCO_CONSIST_COLUMN
static int
LOCO_DIRECTION_COLUMN
static int
LOCO_ID_COLUMN
static int
LOCO_ID_LONG_COLUMN
static int
MAX_COLUMN
static int
SESSION_ID_COLUMN
static int
SPEED_STEP_COLUMN
-
Constructor Summary
Constructors Constructor Description CbusSlotMonitorDataModel(CanSystemConnectionMemo memo)
Create a New CbusSlotMonitorDataModel.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addToLog(int cbuserror, java.lang.String cbustext)
Add to Slot Monitor Console Logvoid
dispose()
disconnect from the CBUSjava.lang.Class<?>
getColumnClass(int col)
int
getColumnCount()
java.lang.String
getColumnName(int col)
Returns String of column name from column int used in table headerint
getRowCount()
Return the number of rows to be displayed.java.lang.Object
getValueAt(int row, int col)
boolean
isCellEditable(int row, int col)
void
message(CanMessage m)
Called when an outgoing message is sent to the CAN Network.void
reply(CanReply m)
Called when an incoming CanFrame is received from the CAN Network.void
sendcbusestop()
void
setMaintainLocoSpdMemory(boolean newVal)
Set true to maintain a Memory Variable for the speed of each loco.void
setValueAt(java.lang.Object value, int row, int col)
protected TextAreaFIFO
tablefeedback()
-
Methods inherited from class javax.swing.table.AbstractTableModel
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getListeners, getTableModelListeners, removeTableModelListener
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface jmri.jmrix.can.CanListener
addTc, addTc, removeTc, removeTc
-
-
-
-
Field Detail
-
_contype
protected int _contype
-
_context
protected java.lang.String _context
-
CS_TIMEOUT
public static int CS_TIMEOUT
-
SESSION_ID_COLUMN
public static final int SESSION_ID_COLUMN
- See Also:
- Constant Field Values
-
LOCO_ID_COLUMN
public static final int LOCO_ID_COLUMN
- See Also:
- Constant Field Values
-
ESTOP_COLUMN
public static final int ESTOP_COLUMN
- See Also:
- Constant Field Values
-
LOCO_ID_LONG_COLUMN
public static final int LOCO_ID_LONG_COLUMN
- See Also:
- Constant Field Values
-
LOCO_COMMANDED_SPEED_COLUMN
public static final int LOCO_COMMANDED_SPEED_COLUMN
- See Also:
- Constant Field Values
-
LOCO_DIRECTION_COLUMN
public static final int LOCO_DIRECTION_COLUMN
- See Also:
- Constant Field Values
-
FUNCTION_LIST
public static final int FUNCTION_LIST
- See Also:
- Constant Field Values
-
SPEED_STEP_COLUMN
public static final int SPEED_STEP_COLUMN
- See Also:
- Constant Field Values
-
LOCO_CONSIST_COLUMN
public static final int LOCO_CONSIST_COLUMN
- See Also:
- Constant Field Values
-
FLAGS_COLUMN
public static final int FLAGS_COLUMN
- See Also:
- Constant Field Values
-
MAX_COLUMN
public static final int MAX_COLUMN
- See Also:
- Constant Field Values
-
CBUSSLOTMONINITIALCOLS
static final int[] CBUSSLOTMONINITIALCOLS
-
CBUSSLOTMONTOOLTIPS
static final java.lang.String[] CBUSSLOTMONTOOLTIPS
-
-
Constructor Detail
-
CbusSlotMonitorDataModel
public CbusSlotMonitorDataModel(CanSystemConnectionMemo memo)
Create a New CbusSlotMonitorDataModel. Public access for user scripting.- Parameters:
memo
- CAN System Connection to monitor.
-
-
Method Detail
-
tablefeedback
protected TextAreaFIFO tablefeedback()
-
getRowCount
public int getRowCount()
Return the number of rows to be displayed.- Specified by:
getRowCount
in interfacejavax.swing.table.TableModel
-
getColumnCount
public int getColumnCount()
- Specified by:
getColumnCount
in interfacejavax.swing.table.TableModel
-
getColumnName
public java.lang.String getColumnName(int col)
Returns String of column name from column int used in table header- Specified by:
getColumnName
in interfacejavax.swing.table.TableModel
- Overrides:
getColumnName
in classjavax.swing.table.AbstractTableModel
- Parameters:
col
- int col number
-
getColumnClass
public java.lang.Class<?> getColumnClass(int col)
- Specified by:
getColumnClass
in interfacejavax.swing.table.TableModel
- Overrides:
getColumnClass
in classjavax.swing.table.AbstractTableModel
-
isCellEditable
public boolean isCellEditable(int row, int col)
- Specified by:
isCellEditable
in interfacejavax.swing.table.TableModel
- Overrides:
isCellEditable
in classjavax.swing.table.AbstractTableModel
-
getValueAt
public java.lang.Object getValueAt(int row, int col)
- Specified by:
getValueAt
in interfacejavax.swing.table.TableModel
-
setValueAt
public void setValueAt(java.lang.Object value, int row, int col)
- Specified by:
setValueAt
in interfacejavax.swing.table.TableModel
- Overrides:
setValueAt
in classjavax.swing.table.AbstractTableModel
-
setMaintainLocoSpdMemory
public void setMaintainLocoSpdMemory(boolean newVal)
Set true to maintain a Memory Variable for the speed of each loco. Note this is an experimental method ( 5.5.5 ) and may be subject to change.The Memory System Name is in the form e.g. IM12(S) or IM789(L) i.e. Internal Memory Loco 12, Short address. It may be easier to refer to this Memory in Jython scripts by giving it a User Name.
The Memory Value is the commanded Loco speed, 0-126. 0 includes a normal stop and e-stop.
The Value updates whenever a Loco speed command is heard on the connection hence not restricted to this JMRI instance.
- Parameters:
newVal
- true to enable updates, false to stop updates. Default is false, no updates provided.- Since:
- 5.5.5
-
message
public void message(CanMessage m)
Description copied from interface:CanListener
Called when an outgoing message is sent to the CAN Network.- Specified by:
message
in interfaceCanListener
- Parameters:
m
- outgoing CanMessage
-
reply
public void reply(CanReply m)
Description copied from interface:CanListener
Called when an incoming CanFrame is received from the CAN Network.- Specified by:
reply
in interfaceCanListener
- Parameters:
m
- incoming cbus CanReply
-
sendcbusestop
public void sendcbusestop()
-
addToLog
public void addToLog(int cbuserror, java.lang.String cbustext)
Add to Slot Monitor Console Log- Parameters:
cbuserror
- intcbustext
- String console message
-
dispose
public void dispose()
disconnect from the CBUS- Specified by:
dispose
in interfaceDisposable
-
-