Package org.ka2ddo.yaac.gui
Class TelemetryModel
java.lang.Object
javax.swing.table.AbstractTableModel
org.ka2ddo.yaac.gui.TelemetryModel
- All Implemented Interfaces:
Serializable
,TableModel
,TrackerListener
,FilterChangeListener
public class TelemetryModel
extends AbstractTableModel
implements TrackerListener, FilterChangeListener
This class extracts the background data for reporting current telemetry
data from telemetering stations. Each report consists of 2 rows with
14 columns. The first row contains the station-specific column titles
(from the PARMS message). The second row contains the station callsign,
the 5 scaled analog values, and the 8 boolean bits.
- Author:
- Andrew Pavlin, KA2DDO
- See Also:
-
Field Summary
Fields inherited from class javax.swing.table.AbstractTableModel
listenerList
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
filterSettingsChanged
(Filter changedFilter, boolean changedByUser) Called when the specified Filter's matching criteria have been changed.int
Returns the number of columns in the model.getColumnName
(int column) Returns the localized name for the column.int
Returns the number of rows in the model.int
Get the number of monitored stations currently sending telemetry data.getValueAt
(int rowIndex, int columnIndex) Returns the value for the cell atcolumnIndex
androwIndex
.boolean
Report whether all telemetry or just filtered telemetry should be shown.void
messageAdded
(StationState ss, int index, AX25Message msg) Called when a Message is added to the history for a station in the tracker.void
messageDeleted
(StationState ss, int index, AX25Message msg) Called when a AX25Message is deleted from the history for a station in the tracker.void
Removes a listener from the list that's notified each time a change to the data model occurs.void
setShowEveryonesTelemetry
(boolean showEveryonesTelemetry) Specify whether all telemetry or just filtered telemetry should be shown.void
stationAdded
(StationState ss, int index) Called when a new station is initially added to the tracker.void
stationDeleted
(StationState ss, int index) Called when an existing station is deleted from the tracker.void
Called when an existing station is updated with new information in the tracker.Methods inherited from class javax.swing.table.AbstractTableModel
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getColumnClass, getListeners, getTableModelListeners, isCellEditable, setValueAt
-
Constructor Details
-
TelemetryModel
public TelemetryModel()
-
-
Method Details
-
isShowEveryonesTelemetry
public boolean isShowEveryonesTelemetry()Report whether all telemetry or just filtered telemetry should be shown.- Returns:
- boolean true if all telemetering stations should be displayed, false if only filter-passing stations should be shown
-
setShowEveryonesTelemetry
public void setShowEveryonesTelemetry(boolean showEveryonesTelemetry) Specify whether all telemetry or just filtered telemetry should be shown.- Parameters:
showEveryonesTelemetry
- boolean true if all telemetering stations should be displayed, false if only filter-passing stations should be shown
-
getTelemetryStationCount
public int getTelemetryStationCount()Get the number of monitored stations currently sending telemetry data.- Returns:
- station count
-
getColumnName
Returns the localized name for the column.- Specified by:
getColumnName
in interfaceTableModel
- Overrides:
getColumnName
in classAbstractTableModel
- Parameters:
column
- the column being queried- Returns:
- a string containing the name of
column
-
getColumnCount
public int getColumnCount()Returns the number of columns in the model.- Specified by:
getColumnCount
in interfaceTableModel
- Returns:
- the number of columns in the model
- See Also:
-
getRowCount
public int getRowCount()Returns the number of rows in the model. AJTable
uses this method to determine how many rows it should display. This method should be quick, as it is called frequently during rendering.- Specified by:
getRowCount
in interfaceTableModel
- Returns:
- the number of rows in the model
- See Also:
-
getValueAt
Returns the value for the cell atcolumnIndex
androwIndex
.- Specified by:
getValueAt
in interfaceTableModel
- Parameters:
rowIndex
- the row whose value is to be queriedcolumnIndex
- the column whose value is to be queried- Returns:
- the value Object at the specified cell
-
messageAdded
Called when a Message is added to the history for a station in the tracker.- Specified by:
messageAdded
in interfaceTrackerListener
- Parameters:
ss
- StationState containing the station's informationindex
- zero-based index of the message added to the StationState objectmsg
- APRS Message object being added to the tracker; note that non-APRS packets
-
messageDeleted
Called when a AX25Message is deleted from the history for a station in the tracker.- Specified by:
messageDeleted
in interfaceTrackerListener
- Parameters:
ss
- StationState containing the station's information; the AX25Message will already be removed from the StationState objectindex
- zero-based index of the message removed from the StationState objectmsg
- APRS Message object being removed from the tracker; note that non-APRS packets that can still be decoded (such as OpenTRAC) will also be passed here; AX25Frames that cannot be decoded will pass null here
-
stationAdded
Called when a new station is initially added to the tracker.- Specified by:
stationAdded
in interfaceTrackerListener
- Parameters:
ss
- StationState containing the station's information; the initial AX25Message will not yet be stored within the StationState objectindex
- zero-based integer sequence number for this station in the StationTracker
-
stationUpdated
Called when an existing station is updated with new information in the tracker.- Specified by:
stationUpdated
in interfaceTrackerListener
- Parameters:
ss
- StationState containing the station's information; the new AX25Message will not yet be stored within the StationState object
-
stationDeleted
Called when an existing station is deleted from the tracker.- Specified by:
stationDeleted
in interfaceTrackerListener
- Parameters:
ss
- StationState containing the station's informationindex
- zero-based integer sequence number for this station in the StationTracker
-
removeTableModelListener
Removes a listener from the list that's notified each time a change to the data model occurs.- Specified by:
removeTableModelListener
in interfaceTableModel
- Overrides:
removeTableModelListener
in classAbstractTableModel
- Parameters:
l
- the TableModelListener
-
filterSettingsChanged
Called when the specified Filter's matching criteria have been changed.- Specified by:
filterSettingsChanged
in interfaceFilterChangeListener
- Parameters:
changedFilter
- Filter that has changedchangedByUser
- boolean true if change was manually made by user, false if
-