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_contextprotected int_contype(package private) static int[]CBUSSLOTMONINITIALCOLS(package private) static java.lang.String[]CBUSSLOTMONTOOLTIPSstatic intCS_TIMEOUTstatic intESTOP_COLUMNstatic intFLAGS_COLUMNstatic intFUNCTION_LISTstatic intKILL_SESSION_COLUMNstatic intLAUNCH_THROTTLEstatic intLOCO_COMMANDED_SPEED_COLUMNstatic intLOCO_CONSIST_COLUMNstatic intLOCO_DIRECTION_COLUMNstatic intLOCO_ID_COLUMNstatic intLOCO_ID_LONG_COLUMNstatic intMAX_COLUMNstatic intSESSION_ID_COLUMNstatic intSPEED_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 voidaddToLog(int cbuserror, java.lang.String cbustext)Add to Slot Monitor Console Logvoiddispose()disconnect from the CBUSjava.lang.Class<?>getColumnClass(int col)intgetColumnCount()java.lang.StringgetColumnName(int col)Returns String of column name from column int used in table headerintgetRowCount()Return the number of rows to be displayed.java.lang.ObjectgetValueAt(int row, int col)booleanisCellEditable(int row, int col)voidmessage(CanMessage m)Called when an outgoing message is sent to the CAN Network.voidreply(CanReply m)Called when an incoming CanFrame is received from the CAN Network.voidsendcbusestop()voidsetMaintainLocoSpdMemory(boolean newVal)Set true to maintain a Memory Variable for the speed of each loco.voidsetValueAt(java.lang.Object value, int row, int col)protected TextAreaFIFOtablefeedback()-
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
-
KILL_SESSION_COLUMN
public static final int KILL_SESSION_COLUMN
- See Also:
- Constant Field Values
-
LAUNCH_THROTTLE
public static final int LAUNCH_THROTTLE
- 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:
getRowCountin interfacejavax.swing.table.TableModel
-
getColumnCount
public int getColumnCount()
- Specified by:
getColumnCountin 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:
getColumnNamein interfacejavax.swing.table.TableModel- Overrides:
getColumnNamein classjavax.swing.table.AbstractTableModel- Parameters:
col- int col number
-
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
-
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
-
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:CanListenerCalled when an outgoing message is sent to the CAN Network.- Specified by:
messagein interfaceCanListener- Parameters:
m- outgoing CanMessage
-
reply
public void reply(CanReply m)
Description copied from interface:CanListenerCalled when an incoming CanFrame is received from the CAN Network.- Specified by:
replyin 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:
disposein interfaceDisposable
-
-