mirror of
https://github.com/DSheirer/sdrtrunk.git
synced 2026-11-14 17:47:32 -05:00
#90 [WIP] on redesigning the channel processing gui components and backing model. Simplifies channel state by introducing a new Metadata class that tracks all metadata for all decoders.
This commit is contained in:
@@ -117,9 +117,9 @@ public class Alias
|
|||||||
mColor = color;
|
mColor = color;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Color getMapColor()
|
public Color getDisplayColor()
|
||||||
{
|
{
|
||||||
return new Color( mColor );
|
return new Color( getColor() );
|
||||||
}
|
}
|
||||||
|
|
||||||
@XmlAttribute
|
@XmlAttribute
|
||||||
|
|||||||
@@ -148,7 +148,7 @@ public class AliasNameEditor extends Editor<Alias>
|
|||||||
Color newColor = JColorChooser.showDialog(
|
Color newColor = JColorChooser.showDialog(
|
||||||
AliasNameEditor.this,
|
AliasNameEditor.this,
|
||||||
"Choose color for this alias",
|
"Choose color for this alias",
|
||||||
(hasItem() ? getItem().getMapColor() : null));
|
(hasItem() ? getItem().getDisplayColor() : null));
|
||||||
|
|
||||||
if(newColor != null)
|
if(newColor != null)
|
||||||
{
|
{
|
||||||
@@ -264,7 +264,7 @@ public class AliasNameEditor extends Editor<Alias>
|
|||||||
|
|
||||||
mGroupCombo.setSelectedItem(alias.getGroup());
|
mGroupCombo.setSelectedItem(alias.getGroup());
|
||||||
|
|
||||||
Color color = alias.getMapColor();
|
Color color = alias.getDisplayColor();
|
||||||
|
|
||||||
mButtonColor.setBackground(color);
|
mButtonColor.setBackground(color);
|
||||||
mButtonColor.setForeground(color);
|
mButtonColor.setForeground(color);
|
||||||
|
|||||||
@@ -47,6 +47,17 @@ public class PatchGroupAlias extends Alias
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getColor()
|
||||||
|
{
|
||||||
|
if(mPatchGroupAlias != null)
|
||||||
|
{
|
||||||
|
return mPatchGroupAlias.getColor();
|
||||||
|
}
|
||||||
|
|
||||||
|
return super.getColor();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets an alias for this patch group ID
|
* Sets an alias for this patch group ID
|
||||||
*/
|
*/
|
||||||
|
|||||||
91
src/channel/metadata/AliasedIdentifier.java
Normal file
91
src/channel/metadata/AliasedIdentifier.java
Normal file
@@ -0,0 +1,91 @@
|
|||||||
|
/*******************************************************************************
|
||||||
|
* sdrtrunk
|
||||||
|
* Copyright (C) 2014-2017 Dennis Sheirer
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||||
|
*
|
||||||
|
******************************************************************************/
|
||||||
|
package channel.metadata;
|
||||||
|
|
||||||
|
import alias.Alias;
|
||||||
|
|
||||||
|
public class AliasedIdentifier
|
||||||
|
{
|
||||||
|
private String mIdentifier;
|
||||||
|
private Alias mAlias;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Identifier and corresponding optional alias
|
||||||
|
*/
|
||||||
|
public AliasedIdentifier()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Resets alias and value to null
|
||||||
|
*/
|
||||||
|
public void reset()
|
||||||
|
{
|
||||||
|
mIdentifier = null;
|
||||||
|
mAlias = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Identifier
|
||||||
|
*/
|
||||||
|
public String getIdentifier()
|
||||||
|
{
|
||||||
|
return mIdentifier;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the identifier to the argument value
|
||||||
|
*/
|
||||||
|
public void setIdentifier(String identifier)
|
||||||
|
{
|
||||||
|
mIdentifier = identifier;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Indicates if there is a non-null, non-empty identifier
|
||||||
|
*/
|
||||||
|
public boolean hasIdentifier()
|
||||||
|
{
|
||||||
|
return mIdentifier != null && !mIdentifier.isEmpty();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Alias for the identifier.
|
||||||
|
*/
|
||||||
|
public Alias getAlias()
|
||||||
|
{
|
||||||
|
return mAlias;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the alias to the argument
|
||||||
|
*/
|
||||||
|
public void setAlias(Alias alias)
|
||||||
|
{
|
||||||
|
mAlias = alias;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Indicates if there is an alias corresponding to the identifier
|
||||||
|
*/
|
||||||
|
public boolean hasAlias()
|
||||||
|
{
|
||||||
|
return mAlias != null;
|
||||||
|
}
|
||||||
|
}
|
||||||
62
src/channel/metadata/Attribute.java
Normal file
62
src/channel/metadata/Attribute.java
Normal file
@@ -0,0 +1,62 @@
|
|||||||
|
/*******************************************************************************
|
||||||
|
* sdrtrunk
|
||||||
|
* Copyright (C) 2014-2017 Dennis Sheirer
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||||
|
*
|
||||||
|
******************************************************************************/
|
||||||
|
package channel.metadata;
|
||||||
|
|
||||||
|
public enum Attribute
|
||||||
|
{
|
||||||
|
CHANNEL_CONFIGURATION_LABEL_1,
|
||||||
|
CHANNEL_CONFIGURATION_LABEL_2,
|
||||||
|
CHANNEL_FREQUENCY,
|
||||||
|
CHANNEL_ID,
|
||||||
|
CHANNEL_STATE,
|
||||||
|
MESSAGE,
|
||||||
|
MESSAGE_TYPE,
|
||||||
|
NETWORK_ID_1,
|
||||||
|
NETWORK_ID_2,
|
||||||
|
PRIMARY_ADDRESS_FROM,
|
||||||
|
PRIMARY_ADDRESS_TO,
|
||||||
|
SECONDARY_ADDRESS_FROM,
|
||||||
|
SECONDARY_ADDRESS_TO,
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//TODO: remove all attributes below here ********************
|
||||||
|
|
||||||
|
CHANNEL_NUMBER,
|
||||||
|
CHANNEL_NAME,
|
||||||
|
CHANNEL_SITE_NUMBER,
|
||||||
|
CHANNEL_SITE_NUMBER_ALIAS,
|
||||||
|
DESCRIPTION,
|
||||||
|
FROM_TALKGROUP,
|
||||||
|
FROM_TALKGROUP_ALIAS,
|
||||||
|
FROM_TALKGROUP_TYPE,
|
||||||
|
NAC,
|
||||||
|
SITE,
|
||||||
|
SITE_ALIAS,
|
||||||
|
SITE_NAME,
|
||||||
|
SOURCE,
|
||||||
|
SYSTEM,
|
||||||
|
SYSTEM_NAME,
|
||||||
|
TO_TALKGROUP,
|
||||||
|
TO_TALKGROUP_ALIAS,
|
||||||
|
TO_TALKGROUP_TYPE;
|
||||||
|
}
|
||||||
111
src/channel/metadata/AttributeChangeRequest.java
Normal file
111
src/channel/metadata/AttributeChangeRequest.java
Normal file
@@ -0,0 +1,111 @@
|
|||||||
|
/*******************************************************************************
|
||||||
|
* sdrtrunk
|
||||||
|
* Copyright (C) 2014-2017 Dennis Sheirer
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||||
|
*
|
||||||
|
******************************************************************************/
|
||||||
|
package channel.metadata;
|
||||||
|
|
||||||
|
import alias.Alias;
|
||||||
|
|
||||||
|
public class AttributeChangeRequest<T>
|
||||||
|
{
|
||||||
|
private Attribute mAttribute;
|
||||||
|
private T mValue;
|
||||||
|
private Alias mAlias;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Request to change the value of an attribute
|
||||||
|
* @param attribute to change
|
||||||
|
* @param value to change for the attribute
|
||||||
|
* @param alias (optional) for the value
|
||||||
|
*/
|
||||||
|
public AttributeChangeRequest(Attribute attribute, T value, Alias alias)
|
||||||
|
{
|
||||||
|
mAttribute = attribute;
|
||||||
|
mValue = value;
|
||||||
|
mAlias = alias;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Request to change the value of an attribute
|
||||||
|
* @param attribute to change
|
||||||
|
* @param value to change for the attribute
|
||||||
|
*/
|
||||||
|
public AttributeChangeRequest(Attribute attribute, T value)
|
||||||
|
{
|
||||||
|
this(attribute, value, null);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Attribute to change
|
||||||
|
*/
|
||||||
|
public Attribute getAttribute()
|
||||||
|
{
|
||||||
|
return mAttribute;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Value to set for the attribute
|
||||||
|
*/
|
||||||
|
public T getValue()
|
||||||
|
{
|
||||||
|
return mValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Indicates if this change request has a non-null value for the attribute
|
||||||
|
*/
|
||||||
|
public boolean hasValue()
|
||||||
|
{
|
||||||
|
return mValue != null;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Alias for the corresponding attribute value
|
||||||
|
*/
|
||||||
|
public Alias getAlias()
|
||||||
|
{
|
||||||
|
return mAlias;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Indicates if this change request contains an alias that corresponds to the attribute value
|
||||||
|
*/
|
||||||
|
public boolean hasAlias()
|
||||||
|
{
|
||||||
|
return mAlias != null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getStringValue()
|
||||||
|
{
|
||||||
|
if(mValue instanceof String)
|
||||||
|
{
|
||||||
|
return (String)mValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getLongValue()
|
||||||
|
{
|
||||||
|
if(mValue instanceof Long)
|
||||||
|
{
|
||||||
|
return (Long)mValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
139
src/channel/metadata/ChannelMetadataModel.java
Normal file
139
src/channel/metadata/ChannelMetadataModel.java
Normal file
@@ -0,0 +1,139 @@
|
|||||||
|
/*******************************************************************************
|
||||||
|
* sdrtrunk
|
||||||
|
* Copyright (C) 2014-2017 Dennis Sheirer
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||||
|
*
|
||||||
|
******************************************************************************/
|
||||||
|
package channel.metadata;
|
||||||
|
|
||||||
|
import controller.channel.Channel;
|
||||||
|
import sample.Listener;
|
||||||
|
|
||||||
|
import javax.swing.table.AbstractTableModel;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
public class ChannelMetadataModel extends AbstractTableModel implements Listener<MetadataChangeEvent>
|
||||||
|
{
|
||||||
|
public static final int COLUMN_STATE = 0;
|
||||||
|
public static final int COLUMN_PRIMARY = 1;
|
||||||
|
public static final int COLUMN_SECONDARY = 2;
|
||||||
|
public static final int COLUMN_MESSAGE = 3;
|
||||||
|
public static final int COLUMN_NETWORK = 4;
|
||||||
|
public static final int COLUMN_FREQUENCY = 5;
|
||||||
|
public static final int COLUMN_CONFIGURATION = 6;
|
||||||
|
|
||||||
|
private static final String[] COLUMNS =
|
||||||
|
{"State", "Primary", "Secondary", "Message", "Network", "Frequency", "Configuration"};
|
||||||
|
|
||||||
|
private List<Metadata> mChannelMetadata = new ArrayList();
|
||||||
|
private Map<Metadata,Channel> mMetadataChannelMap = new HashMap();
|
||||||
|
|
||||||
|
public void add(Metadata metadata, Channel channel)
|
||||||
|
{
|
||||||
|
mChannelMetadata.add(metadata);
|
||||||
|
mMetadataChannelMap.put(metadata, channel);
|
||||||
|
|
||||||
|
int index = mChannelMetadata.indexOf(metadata);
|
||||||
|
|
||||||
|
fireTableRowsInserted(index, index);
|
||||||
|
|
||||||
|
metadata.addListener(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void remove(Metadata metadata)
|
||||||
|
{
|
||||||
|
metadata.removeListener(this);
|
||||||
|
|
||||||
|
int index = mChannelMetadata.indexOf(metadata);
|
||||||
|
|
||||||
|
mChannelMetadata.remove(metadata);
|
||||||
|
mMetadataChannelMap.remove(metadata);
|
||||||
|
|
||||||
|
fireTableRowsDeleted(index, index);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getRowCount()
|
||||||
|
{
|
||||||
|
return mChannelMetadata.size();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getColumnCount()
|
||||||
|
{
|
||||||
|
return COLUMNS.length;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getColumnName(int column)
|
||||||
|
{
|
||||||
|
return COLUMNS[column];
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Class<?> getColumnClass(int columnIndex)
|
||||||
|
{
|
||||||
|
return Metadata.class;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Object getValueAt(int rowIndex, int columnIndex)
|
||||||
|
{
|
||||||
|
return mChannelMetadata.get(rowIndex);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void receive(MetadataChangeEvent metadataChangeEvent)
|
||||||
|
{
|
||||||
|
int rowIndex = mChannelMetadata.indexOf(metadataChangeEvent.getMetadata());
|
||||||
|
|
||||||
|
if(rowIndex >= 0)
|
||||||
|
{
|
||||||
|
switch(metadataChangeEvent.getAttribute())
|
||||||
|
{
|
||||||
|
case CHANNEL_CONFIGURATION_LABEL_1:
|
||||||
|
case CHANNEL_CONFIGURATION_LABEL_2:
|
||||||
|
fireTableCellUpdated(rowIndex, COLUMN_CONFIGURATION);
|
||||||
|
break;
|
||||||
|
case CHANNEL_FREQUENCY:
|
||||||
|
case CHANNEL_ID:
|
||||||
|
fireTableCellUpdated(rowIndex, COLUMN_FREQUENCY);
|
||||||
|
break;
|
||||||
|
case CHANNEL_STATE:
|
||||||
|
fireTableCellUpdated(rowIndex, COLUMN_STATE);
|
||||||
|
break;
|
||||||
|
case MESSAGE:
|
||||||
|
case MESSAGE_TYPE:
|
||||||
|
fireTableCellUpdated(rowIndex, COLUMN_MESSAGE);
|
||||||
|
break;
|
||||||
|
case NETWORK_ID_1:
|
||||||
|
case NETWORK_ID_2:
|
||||||
|
fireTableCellUpdated(rowIndex, COLUMN_NETWORK);
|
||||||
|
break;
|
||||||
|
case PRIMARY_ADDRESS_FROM:
|
||||||
|
case PRIMARY_ADDRESS_TO:
|
||||||
|
fireTableCellUpdated(rowIndex, COLUMN_PRIMARY);
|
||||||
|
break;
|
||||||
|
case SECONDARY_ADDRESS_FROM:
|
||||||
|
case SECONDARY_ADDRESS_TO:
|
||||||
|
fireTableCellUpdated(rowIndex, COLUMN_SECONDARY);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
237
src/channel/metadata/ChannelMetadataPanel.java
Normal file
237
src/channel/metadata/ChannelMetadataPanel.java
Normal file
@@ -0,0 +1,237 @@
|
|||||||
|
/*******************************************************************************
|
||||||
|
* sdrtrunk
|
||||||
|
* Copyright (C) 2014-2017 Dennis Sheirer
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||||
|
*
|
||||||
|
******************************************************************************/
|
||||||
|
package channel.metadata;
|
||||||
|
|
||||||
|
import alias.Alias;
|
||||||
|
import icon.IconTableModel;
|
||||||
|
import net.miginfocom.swing.MigLayout;
|
||||||
|
|
||||||
|
import javax.swing.*;
|
||||||
|
import javax.swing.event.ListSelectionListener;
|
||||||
|
import javax.swing.table.DefaultTableCellRenderer;
|
||||||
|
import javax.swing.table.TableCellRenderer;
|
||||||
|
import java.awt.*;
|
||||||
|
import java.text.DecimalFormat;
|
||||||
|
|
||||||
|
public class ChannelMetadataPanel extends JPanel
|
||||||
|
{
|
||||||
|
private ChannelMetadataModel mChannelMetadataModel;
|
||||||
|
private IconTableModel mIconTableModel;
|
||||||
|
private JTable mTable;
|
||||||
|
|
||||||
|
public ChannelMetadataPanel(ChannelMetadataModel channelMetadataModel, IconTableModel iconTableModel)
|
||||||
|
{
|
||||||
|
mChannelMetadataModel = channelMetadataModel;
|
||||||
|
mIconTableModel = iconTableModel;
|
||||||
|
|
||||||
|
init();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Initializes the panel
|
||||||
|
*/
|
||||||
|
private void init()
|
||||||
|
{
|
||||||
|
setLayout( new MigLayout( "", "[grow,fill]", "[grow,fill]") );
|
||||||
|
|
||||||
|
mTable = new JTable(mChannelMetadataModel);
|
||||||
|
|
||||||
|
mTable.getColumnModel().getColumn(ChannelMetadataModel.COLUMN_STATE).setCellRenderer(new StateCellRenderer());
|
||||||
|
|
||||||
|
mTable.getColumnModel().getColumn(ChannelMetadataModel.COLUMN_PRIMARY)
|
||||||
|
.setCellRenderer(new AliasedValueCellRenderer(Attribute.PRIMARY_ADDRESS_TO, Attribute.PRIMARY_ADDRESS_FROM));
|
||||||
|
|
||||||
|
mTable.getColumnModel().getColumn(ChannelMetadataModel.COLUMN_SECONDARY)
|
||||||
|
.setCellRenderer(new AliasedValueCellRenderer(Attribute.SECONDARY_ADDRESS_TO, Attribute.SECONDARY_ADDRESS_FROM));
|
||||||
|
|
||||||
|
mTable.getColumnModel().getColumn(ChannelMetadataModel.COLUMN_MESSAGE)
|
||||||
|
.setCellRenderer(new AliasedValueCellRenderer(Attribute.MESSAGE, Attribute.MESSAGE_TYPE));
|
||||||
|
|
||||||
|
mTable.getColumnModel().getColumn(ChannelMetadataModel.COLUMN_NETWORK)
|
||||||
|
.setCellRenderer(new AliasedValueCellRenderer(Attribute.NETWORK_ID_1, Attribute.NETWORK_ID_2));
|
||||||
|
|
||||||
|
mTable.getColumnModel().getColumn(ChannelMetadataModel.COLUMN_FREQUENCY)
|
||||||
|
.setCellRenderer(new FrequencyCellRenderer());
|
||||||
|
|
||||||
|
mTable.getColumnModel().getColumn(ChannelMetadataModel.COLUMN_CONFIGURATION)
|
||||||
|
.setCellRenderer(new AliasedValueCellRenderer(Attribute.CHANNEL_CONFIGURATION_LABEL_1,
|
||||||
|
Attribute.CHANNEL_CONFIGURATION_LABEL_2));
|
||||||
|
|
||||||
|
JScrollPane scrollPane = new JScrollPane(mTable, JScrollPane.VERTICAL_SCROLLBAR_ALWAYS,
|
||||||
|
JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
|
||||||
|
|
||||||
|
add(scrollPane);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Adds a selection listener to the contained metadata JTable
|
||||||
|
*/
|
||||||
|
public void addListSelectionListener(ListSelectionListener listener)
|
||||||
|
{
|
||||||
|
mTable.getSelectionModel().addListSelectionListener(listener);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Removes the selection listener from the contained metadata JTable
|
||||||
|
*/
|
||||||
|
public void removeListSelectionListener(ListSelectionListener listener)
|
||||||
|
{
|
||||||
|
mTable.getSelectionModel().removeListSelectionListener(listener);
|
||||||
|
}
|
||||||
|
|
||||||
|
public class AliasedValueCellRenderer extends JPanel implements TableCellRenderer
|
||||||
|
{
|
||||||
|
private JLabel mLabel1;
|
||||||
|
private JLabel mLabel2;
|
||||||
|
|
||||||
|
private Attribute mAttribute1;
|
||||||
|
private Attribute mAttribute2;
|
||||||
|
|
||||||
|
public AliasedValueCellRenderer(Attribute attribute1, Attribute attribute2)
|
||||||
|
{
|
||||||
|
attribute1 = attribute1;
|
||||||
|
attribute2 = attribute2;
|
||||||
|
|
||||||
|
setLayout( new MigLayout( "", "[grow,fill]", "[grow,fill][grow,fill]") );
|
||||||
|
|
||||||
|
mLabel1 = new JLabel();
|
||||||
|
add(mLabel1,"wrap");
|
||||||
|
mLabel2 = new JLabel();
|
||||||
|
add(mLabel2,"wrap");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus,
|
||||||
|
int row, int column)
|
||||||
|
{
|
||||||
|
Metadata metadata = (Metadata)value;
|
||||||
|
|
||||||
|
if(mAttribute1 != null)
|
||||||
|
{
|
||||||
|
String value1 = metadata.getValue(mAttribute1);
|
||||||
|
mLabel1.setText(value1);
|
||||||
|
|
||||||
|
Alias alias1 = metadata.getAlias(mAttribute1);
|
||||||
|
|
||||||
|
if(alias1 != null)
|
||||||
|
{
|
||||||
|
mLabel1.setIcon(mIconTableModel.getIcon(alias1.getIconName()).getIcon());
|
||||||
|
mLabel1.setForeground(alias1.getDisplayColor());
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
mLabel1.setIcon(null);
|
||||||
|
mLabel1.setForeground(mTable.getForeground());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if(mAttribute2 != null)
|
||||||
|
{
|
||||||
|
String value2 = metadata.getValue(mAttribute2);
|
||||||
|
mLabel2.setText(value2);
|
||||||
|
|
||||||
|
Alias alias2 = metadata.getAlias(mAttribute2);
|
||||||
|
|
||||||
|
if(alias2 != null)
|
||||||
|
{
|
||||||
|
mLabel2.setIcon(mIconTableModel.getIcon(alias2.getIconName()).getIcon());
|
||||||
|
mLabel2.setForeground(alias2.getDisplayColor());
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
mLabel2.setIcon(null);
|
||||||
|
mLabel2.setForeground(mTable.getForeground());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
setBackground(isSelected ? table.getSelectionBackground() : table.getBackground());
|
||||||
|
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class FrequencyCellRenderer extends JPanel implements TableCellRenderer
|
||||||
|
{
|
||||||
|
private static final DecimalFormat FREQUENCY_FORMATTER = new DecimalFormat( "#.0000" );
|
||||||
|
|
||||||
|
private JLabel mLabel1;
|
||||||
|
private JLabel mLabel2;
|
||||||
|
|
||||||
|
public FrequencyCellRenderer()
|
||||||
|
{
|
||||||
|
setLayout( new MigLayout( "", "[grow,fill]", "[grow,fill][grow,fill]") );
|
||||||
|
|
||||||
|
mLabel1 = new JLabel();
|
||||||
|
add(mLabel1,"wrap");
|
||||||
|
mLabel2 = new JLabel();
|
||||||
|
add(mLabel2,"wrap");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus,
|
||||||
|
int row, int column)
|
||||||
|
{
|
||||||
|
Metadata metadata = (Metadata)value;
|
||||||
|
|
||||||
|
if(metadata.hasChannelFrequency())
|
||||||
|
{
|
||||||
|
mLabel1.setText(FREQUENCY_FORMATTER.format((double)metadata.getChannelFrequency() / 1E6d));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
mLabel1.setText(null);
|
||||||
|
}
|
||||||
|
|
||||||
|
mLabel2.setText(metadata.getChannelID());
|
||||||
|
|
||||||
|
setBackground(isSelected ? table.getSelectionBackground() : table.getBackground());
|
||||||
|
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class StateCellRenderer extends JPanel implements TableCellRenderer
|
||||||
|
{
|
||||||
|
private static final DecimalFormat FREQUENCY_FORMATTER = new DecimalFormat( "#.0000" );
|
||||||
|
|
||||||
|
private JLabel mLabel1;
|
||||||
|
|
||||||
|
public StateCellRenderer()
|
||||||
|
{
|
||||||
|
setLayout( new MigLayout( "", "[grow,fill,align center]", "[grow,fill,align center]") );
|
||||||
|
|
||||||
|
mLabel1 = new JLabel();
|
||||||
|
add(mLabel1);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus,
|
||||||
|
int row, int column)
|
||||||
|
{
|
||||||
|
Metadata metadata = (Metadata)value;
|
||||||
|
|
||||||
|
mLabel1.setText(metadata.getState().getDisplayValue());
|
||||||
|
|
||||||
|
setBackground(isSelected ? table.getSelectionBackground() : table.getBackground());
|
||||||
|
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
61
src/channel/metadata/ChannelMetadataViewer.java
Normal file
61
src/channel/metadata/ChannelMetadataViewer.java
Normal file
@@ -0,0 +1,61 @@
|
|||||||
|
/*******************************************************************************
|
||||||
|
* sdrtrunk
|
||||||
|
* Copyright (C) 2014-2017 Dennis Sheirer
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||||
|
*
|
||||||
|
******************************************************************************/
|
||||||
|
package channel.metadata;
|
||||||
|
|
||||||
|
import com.jidesoft.swing.JideSplitPane;
|
||||||
|
import com.jidesoft.swing.JideTabbedPane;
|
||||||
|
import icon.IconTableModel;
|
||||||
|
import net.miginfocom.swing.MigLayout;
|
||||||
|
|
||||||
|
import javax.swing.*;
|
||||||
|
|
||||||
|
public class ChannelMetadataViewer extends JPanel
|
||||||
|
{
|
||||||
|
private ChannelMetadataModel mChannelMetadataModel;
|
||||||
|
private IconTableModel mIconTableModel;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* GUI panel that combines the currently decoding channels metadata table and viewers for channel details,
|
||||||
|
* messages, events, and spectral view.
|
||||||
|
*/
|
||||||
|
public ChannelMetadataViewer(ChannelMetadataModel channelMetadataModel, IconTableModel iconTableModel)
|
||||||
|
{
|
||||||
|
mChannelMetadataModel = channelMetadataModel;
|
||||||
|
mIconTableModel = iconTableModel;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void init()
|
||||||
|
{
|
||||||
|
setLayout( new MigLayout( "", "[grow,fill]", "[grow,fill]") );
|
||||||
|
|
||||||
|
ChannelMetadataPanel channelMetadataPanel = new ChannelMetadataPanel(mChannelMetadataModel, mIconTableModel);
|
||||||
|
|
||||||
|
JideTabbedPane tabbedPane = new JideTabbedPane();
|
||||||
|
tabbedPane.addTab("Details", new JPanel());
|
||||||
|
tabbedPane.addTab("Events", new JPanel());
|
||||||
|
tabbedPane.addTab("Messages", new JPanel());
|
||||||
|
tabbedPane.addTab("Spectrum", new JPanel());
|
||||||
|
|
||||||
|
JideSplitPane splitPane = new JideSplitPane(JideSplitPane.VERTICAL_SPLIT);
|
||||||
|
splitPane.add(channelMetadataPanel);
|
||||||
|
splitPane.add(tabbedPane);
|
||||||
|
|
||||||
|
add(splitPane);
|
||||||
|
}
|
||||||
|
}
|
||||||
463
src/channel/metadata/Metadata.java
Normal file
463
src/channel/metadata/Metadata.java
Normal file
@@ -0,0 +1,463 @@
|
|||||||
|
/*******************************************************************************
|
||||||
|
* sdrtrunk
|
||||||
|
* Copyright (C) 2014-2017 Dennis Sheirer
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||||
|
*
|
||||||
|
******************************************************************************/
|
||||||
|
package channel.metadata;
|
||||||
|
|
||||||
|
import alias.Alias;
|
||||||
|
import channel.state.State;
|
||||||
|
import sample.Broadcaster;
|
||||||
|
import sample.Listener;
|
||||||
|
|
||||||
|
public class Metadata implements Listener<AttributeChangeRequest>
|
||||||
|
{
|
||||||
|
private State mState = State.IDLE;
|
||||||
|
private String mChannelConfigurationLabel1;
|
||||||
|
private String mChannelConfigurationLabel2;
|
||||||
|
private String mChannelID;
|
||||||
|
private long mChannelFrequency;
|
||||||
|
private AliasedIdentifier mNetworkID1 = new AliasedIdentifier();
|
||||||
|
private AliasedIdentifier mNetworkID2 = new AliasedIdentifier();
|
||||||
|
|
||||||
|
//Temporal attributes
|
||||||
|
private String mMessage;
|
||||||
|
private String mMessageType;
|
||||||
|
private AliasedIdentifier mPrimaryAddressFrom = new AliasedIdentifier();
|
||||||
|
private AliasedIdentifier mPrimaryAddressTo = new AliasedIdentifier();
|
||||||
|
private AliasedIdentifier mSecondaryAddressFrom = new AliasedIdentifier();
|
||||||
|
private AliasedIdentifier mSecondaryAddressTo = new AliasedIdentifier();
|
||||||
|
|
||||||
|
private Broadcaster<MetadataChangeEvent> mMetadataChangeEventBroadcaster = new Broadcaster<>();
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Channel metadata. Contains all attributes that reflect the state and current attribute values for a channel
|
||||||
|
* that is currently decoding. This metadata is intended to support any decoding channel gui components to
|
||||||
|
* graphically convey the current state of a decoding channel.
|
||||||
|
*/
|
||||||
|
public Metadata()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the state of this metadata
|
||||||
|
*/
|
||||||
|
public void setState(State state)
|
||||||
|
{
|
||||||
|
mState = state;
|
||||||
|
broadcast(Attribute.CHANNEL_STATE);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Request to change an attribute value for this metadata. This is the primary method for updating all attributes
|
||||||
|
* in this metadata set.
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public void receive(AttributeChangeRequest request)
|
||||||
|
{
|
||||||
|
switch(request.getAttribute())
|
||||||
|
{
|
||||||
|
case CHANNEL_CONFIGURATION_LABEL_1:
|
||||||
|
mChannelConfigurationLabel1 = request.getStringValue();
|
||||||
|
broadcast(Attribute.CHANNEL_CONFIGURATION_LABEL_1);
|
||||||
|
break;
|
||||||
|
case CHANNEL_CONFIGURATION_LABEL_2:
|
||||||
|
mChannelConfigurationLabel2 = request.getStringValue();
|
||||||
|
broadcast(Attribute.CHANNEL_CONFIGURATION_LABEL_2);
|
||||||
|
break;
|
||||||
|
case CHANNEL_FREQUENCY:
|
||||||
|
if(request.hasValue())
|
||||||
|
{
|
||||||
|
mChannelFrequency = request.getLongValue();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
mChannelFrequency = 0;
|
||||||
|
}
|
||||||
|
broadcast(Attribute.CHANNEL_FREQUENCY);
|
||||||
|
break;
|
||||||
|
case CHANNEL_ID:
|
||||||
|
mChannelID = request.getStringValue();
|
||||||
|
broadcast(Attribute.CHANNEL_ID);
|
||||||
|
break;
|
||||||
|
case MESSAGE:
|
||||||
|
mMessage = request.getStringValue();
|
||||||
|
broadcast(Attribute.MESSAGE);
|
||||||
|
break;
|
||||||
|
case MESSAGE_TYPE:
|
||||||
|
mMessageType = request.getStringValue();
|
||||||
|
broadcast(Attribute.MESSAGE_TYPE);
|
||||||
|
break;
|
||||||
|
case NETWORK_ID_1:
|
||||||
|
mNetworkID1.setIdentifier(request.getStringValue());
|
||||||
|
mNetworkID1.setAlias(request.getAlias());
|
||||||
|
broadcast(Attribute.NETWORK_ID_1);
|
||||||
|
break;
|
||||||
|
case NETWORK_ID_2:
|
||||||
|
mNetworkID2.setIdentifier(request.getStringValue());
|
||||||
|
mNetworkID2.setAlias(request.getAlias());
|
||||||
|
broadcast(Attribute.NETWORK_ID_2);
|
||||||
|
break;
|
||||||
|
case PRIMARY_ADDRESS_FROM:
|
||||||
|
mPrimaryAddressFrom.setIdentifier(request.getStringValue());
|
||||||
|
mPrimaryAddressFrom.setAlias(request.getAlias());
|
||||||
|
broadcast(Attribute.PRIMARY_ADDRESS_FROM);
|
||||||
|
break;
|
||||||
|
case PRIMARY_ADDRESS_TO:
|
||||||
|
mPrimaryAddressTo.setIdentifier(request.getStringValue());
|
||||||
|
mPrimaryAddressTo.setAlias(request.getAlias());
|
||||||
|
broadcast(Attribute.PRIMARY_ADDRESS_TO);
|
||||||
|
break;
|
||||||
|
case SECONDARY_ADDRESS_FROM:
|
||||||
|
mSecondaryAddressFrom.setIdentifier(request.getStringValue());
|
||||||
|
mSecondaryAddressFrom.setAlias(request.getAlias());
|
||||||
|
broadcast(Attribute.SECONDARY_ADDRESS_FROM);
|
||||||
|
break;
|
||||||
|
case SECONDARY_ADDRESS_TO:
|
||||||
|
mSecondaryAddressTo.setIdentifier(request.getStringValue());
|
||||||
|
mSecondaryAddressTo.setAlias(request.getAlias());
|
||||||
|
broadcast(Attribute.SECONDARY_ADDRESS_TO);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
throw new IllegalArgumentException("Unrecognized Metadata Attribute: " +
|
||||||
|
request.getAttribute().name());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Broadcasts to registered listeners that an attribute has changed for this metadata
|
||||||
|
*/
|
||||||
|
private void broadcast(Attribute attribute)
|
||||||
|
{
|
||||||
|
mMetadataChangeEventBroadcaster.broadcast(new MetadataChangeEvent(this, attribute));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Adds the listener to receive metadata change events for this channel metadata
|
||||||
|
*/
|
||||||
|
public void addListener(Listener<MetadataChangeEvent> listener)
|
||||||
|
{
|
||||||
|
mMetadataChangeEventBroadcaster.addListener(listener);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Removes the listener from receiving metadata change events for this channel metadata
|
||||||
|
*/
|
||||||
|
public void removeListener(Listener<MetadataChangeEvent> listener)
|
||||||
|
{
|
||||||
|
mMetadataChangeEventBroadcaster.removeListener(listener);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Resets temporal attributes to null value. This only resets attributes that have a non-ull value in order to
|
||||||
|
* limit the number of change events that are produced.
|
||||||
|
*/
|
||||||
|
public void resetTemporalAttributes()
|
||||||
|
{
|
||||||
|
if(hasMessage())
|
||||||
|
{
|
||||||
|
mMessage = null;
|
||||||
|
broadcast(Attribute.MESSAGE);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(hasMessageType())
|
||||||
|
{
|
||||||
|
mMessageType = null;
|
||||||
|
broadcast(Attribute.MESSAGE_TYPE);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(mPrimaryAddressFrom.hasIdentifier())
|
||||||
|
{
|
||||||
|
mPrimaryAddressFrom.reset();
|
||||||
|
broadcast(Attribute.PRIMARY_ADDRESS_FROM);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(mPrimaryAddressTo.hasIdentifier())
|
||||||
|
{
|
||||||
|
mPrimaryAddressTo.reset();
|
||||||
|
broadcast(Attribute.PRIMARY_ADDRESS_TO);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(mSecondaryAddressFrom.hasIdentifier())
|
||||||
|
{
|
||||||
|
mSecondaryAddressFrom.reset();
|
||||||
|
broadcast(Attribute.SECONDARY_ADDRESS_FROM);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(mSecondaryAddressTo.hasIdentifier())
|
||||||
|
{
|
||||||
|
mSecondaryAddressTo.reset();
|
||||||
|
broadcast(Attribute.SECONDARY_ADDRESS_TO);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Resets all attributes to empty values
|
||||||
|
*/
|
||||||
|
public void resetAllAttributes()
|
||||||
|
{
|
||||||
|
resetTemporalAttributes();
|
||||||
|
|
||||||
|
if(hasChannelConfigurationLabel1())
|
||||||
|
{
|
||||||
|
mChannelConfigurationLabel1 = null;
|
||||||
|
broadcast(Attribute.CHANNEL_CONFIGURATION_LABEL_1);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(hasChannelConfigurationLabel2())
|
||||||
|
{
|
||||||
|
mChannelConfigurationLabel2 = null;
|
||||||
|
broadcast(Attribute.CHANNEL_CONFIGURATION_LABEL_2);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(hasChannelID())
|
||||||
|
{
|
||||||
|
mChannelID = null;
|
||||||
|
broadcast(Attribute.CHANNEL_ID);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(hasChannelFrequency())
|
||||||
|
{
|
||||||
|
mChannelFrequency = 0;
|
||||||
|
broadcast(Attribute.CHANNEL_FREQUENCY);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(mNetworkID1.hasIdentifier())
|
||||||
|
{
|
||||||
|
mNetworkID1.reset();
|
||||||
|
broadcast(Attribute.NETWORK_ID_1);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(mNetworkID2.hasIdentifier())
|
||||||
|
{
|
||||||
|
mNetworkID2.reset();
|
||||||
|
broadcast(Attribute.NETWORK_ID_2);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the alias associated with the attribute or null
|
||||||
|
*/
|
||||||
|
public Alias getAlias(Attribute attribute)
|
||||||
|
{
|
||||||
|
switch(attribute)
|
||||||
|
{
|
||||||
|
case NETWORK_ID_1:
|
||||||
|
return getNetworkID1().getAlias();
|
||||||
|
case NETWORK_ID_2:
|
||||||
|
return getNetworkID2().getAlias();
|
||||||
|
case PRIMARY_ADDRESS_FROM:
|
||||||
|
return getPrimaryAddressFrom().getAlias();
|
||||||
|
case PRIMARY_ADDRESS_TO:
|
||||||
|
return getPrimaryAddressTo().getAlias();
|
||||||
|
case SECONDARY_ADDRESS_FROM:
|
||||||
|
return getSecondaryAddressFrom().getAlias();
|
||||||
|
case SECONDARY_ADDRESS_TO:
|
||||||
|
return getSecondaryAddressTo().getAlias();
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the string value for the specified attribute or null
|
||||||
|
*/
|
||||||
|
public String getValue(Attribute attribute)
|
||||||
|
{
|
||||||
|
switch(attribute)
|
||||||
|
{
|
||||||
|
case CHANNEL_CONFIGURATION_LABEL_1:
|
||||||
|
return mChannelConfigurationLabel1;
|
||||||
|
case CHANNEL_CONFIGURATION_LABEL_2:
|
||||||
|
return mChannelConfigurationLabel2;
|
||||||
|
case CHANNEL_ID:
|
||||||
|
return mChannelID;
|
||||||
|
case CHANNEL_STATE:
|
||||||
|
return mState.getDisplayValue();
|
||||||
|
case MESSAGE:
|
||||||
|
return mMessage;
|
||||||
|
case MESSAGE_TYPE:
|
||||||
|
return mMessageType;
|
||||||
|
case NETWORK_ID_1:
|
||||||
|
return mNetworkID1.getIdentifier();
|
||||||
|
case NETWORK_ID_2:
|
||||||
|
return mNetworkID2.getIdentifier();
|
||||||
|
case PRIMARY_ADDRESS_FROM:
|
||||||
|
return mPrimaryAddressFrom.getIdentifier();
|
||||||
|
case PRIMARY_ADDRESS_TO:
|
||||||
|
return mPrimaryAddressTo.getIdentifier();
|
||||||
|
case SECONDARY_ADDRESS_FROM:
|
||||||
|
return mSecondaryAddressFrom.getIdentifier();
|
||||||
|
case SECONDARY_ADDRESS_TO:
|
||||||
|
return mPrimaryAddressTo.getIdentifier();
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Current channel state
|
||||||
|
*/
|
||||||
|
public State getState()
|
||||||
|
{
|
||||||
|
return mState;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* System name from the channel configuration
|
||||||
|
*/
|
||||||
|
public String getChannelConfigurationLabel1()
|
||||||
|
{
|
||||||
|
return mChannelConfigurationLabel1;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Indicates if there is a non-null, non-empty channel configuration system value
|
||||||
|
*/
|
||||||
|
public boolean hasChannelConfigurationLabel1()
|
||||||
|
{
|
||||||
|
return mChannelConfigurationLabel1 != null && !mChannelConfigurationLabel1.isEmpty();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Site name from the channel configuration
|
||||||
|
*/
|
||||||
|
public String getChannelConfigurationLabel2()
|
||||||
|
{
|
||||||
|
return mChannelConfigurationLabel2;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Indicates if there is a non-null, non-empty channel configuration site value
|
||||||
|
*/
|
||||||
|
public boolean hasChannelConfigurationLabel2()
|
||||||
|
{
|
||||||
|
return mChannelConfigurationLabel2 != null && !mChannelConfigurationLabel2.isEmpty();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Channel ID or Channel Number
|
||||||
|
*/
|
||||||
|
public String getChannelID()
|
||||||
|
{
|
||||||
|
return mChannelID;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Indicates if there is a non-null, non-empty channel identifier value
|
||||||
|
*/
|
||||||
|
public boolean hasChannelID()
|
||||||
|
{
|
||||||
|
return mChannelID != null && !mChannelID.isEmpty();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Channel frequency
|
||||||
|
*/
|
||||||
|
public long getChannelFrequency()
|
||||||
|
{
|
||||||
|
return mChannelFrequency;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Indicates if there is a non-zero channel frequency value
|
||||||
|
*/
|
||||||
|
public boolean hasChannelFrequency()
|
||||||
|
{
|
||||||
|
return mChannelFrequency > 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Network Identifier 1
|
||||||
|
*/
|
||||||
|
public AliasedIdentifier getNetworkID1()
|
||||||
|
{
|
||||||
|
return mNetworkID1;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Network Identifier 2
|
||||||
|
*/
|
||||||
|
public AliasedIdentifier getNetworkID2()
|
||||||
|
{
|
||||||
|
return mNetworkID2;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Message
|
||||||
|
*/
|
||||||
|
public String getMessage()
|
||||||
|
{
|
||||||
|
return mMessage;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Indicates if there is a non-null, non-empty message value
|
||||||
|
*/
|
||||||
|
public boolean hasMessage()
|
||||||
|
{
|
||||||
|
return mMessage != null && !mMessage.isEmpty();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Message and Decoder type
|
||||||
|
*/
|
||||||
|
public String getMessageType()
|
||||||
|
{
|
||||||
|
return mMessageType;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Indicates if there is a non-null, non-empty message and decoder type value
|
||||||
|
*/
|
||||||
|
public boolean hasMessageType()
|
||||||
|
{
|
||||||
|
return mMessageType != null && !mMessageType.isEmpty();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Primary FROM Address
|
||||||
|
*/
|
||||||
|
public AliasedIdentifier getPrimaryAddressFrom()
|
||||||
|
{
|
||||||
|
return mPrimaryAddressFrom;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Primary TO Address
|
||||||
|
*/
|
||||||
|
public AliasedIdentifier getPrimaryAddressTo()
|
||||||
|
{
|
||||||
|
return mPrimaryAddressTo;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Secondary FROM Address
|
||||||
|
*/
|
||||||
|
public AliasedIdentifier getSecondaryAddressFrom()
|
||||||
|
{
|
||||||
|
return mSecondaryAddressFrom;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Secondary TO Address
|
||||||
|
*/
|
||||||
|
public AliasedIdentifier getSecondaryAddressTo()
|
||||||
|
{
|
||||||
|
return mSecondaryAddressTo;
|
||||||
|
}
|
||||||
|
}
|
||||||
53
src/channel/metadata/MetadataChangeEvent.java
Normal file
53
src/channel/metadata/MetadataChangeEvent.java
Normal file
@@ -0,0 +1,53 @@
|
|||||||
|
/*******************************************************************************
|
||||||
|
* sdrtrunk
|
||||||
|
* Copyright (C) 2014-2017 Dennis Sheirer
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||||
|
*
|
||||||
|
******************************************************************************/
|
||||||
|
package channel.metadata;
|
||||||
|
|
||||||
|
public class MetadataChangeEvent
|
||||||
|
{
|
||||||
|
private Metadata mMetadata;
|
||||||
|
private Attribute mAttribute;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Channel metadata changed attribute event
|
||||||
|
*
|
||||||
|
* @param metadata where the change occurred
|
||||||
|
* @param attribute that changed
|
||||||
|
*/
|
||||||
|
public MetadataChangeEvent(Metadata metadata, Attribute attribute)
|
||||||
|
{
|
||||||
|
mMetadata = metadata;
|
||||||
|
mAttribute = attribute;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Channel metadata where the change occurred
|
||||||
|
*/
|
||||||
|
public Metadata getMetadata()
|
||||||
|
{
|
||||||
|
return mMetadata;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Channel metadata attribute that has changed
|
||||||
|
*/
|
||||||
|
public Attribute getAttribute()
|
||||||
|
{
|
||||||
|
return mAttribute;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -15,13 +15,13 @@
|
|||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>
|
* along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||||
******************************************************************************/
|
******************************************************************************/
|
||||||
package module.decode.state;
|
package channel.state;
|
||||||
|
|
||||||
import java.util.concurrent.ScheduledExecutorService;
|
import java.util.concurrent.ScheduledExecutorService;
|
||||||
|
|
||||||
import message.Message;
|
import message.Message;
|
||||||
import module.decode.DecoderType;
|
import module.decode.DecoderType;
|
||||||
import module.decode.state.DecoderStateEvent.Event;
|
import channel.state.DecoderStateEvent.Event;
|
||||||
import audio.metadata.Metadata;
|
import audio.metadata.Metadata;
|
||||||
import audio.metadata.MetadataType;
|
import audio.metadata.MetadataType;
|
||||||
|
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package module.decode.state;
|
package channel.state;
|
||||||
|
|
||||||
import controller.channel.Channel.ChannelType;
|
import controller.channel.Channel.ChannelType;
|
||||||
|
|
||||||
@@ -16,7 +16,7 @@
|
|||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>
|
* along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||||
*
|
*
|
||||||
******************************************************************************/
|
******************************************************************************/
|
||||||
package module.decode.state;
|
package channel.state;
|
||||||
|
|
||||||
import audio.AudioPanel;
|
import audio.AudioPanel;
|
||||||
import controller.channel.Channel;
|
import controller.channel.Channel;
|
||||||
@@ -16,8 +16,9 @@
|
|||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>
|
* along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||||
*
|
*
|
||||||
******************************************************************************/
|
******************************************************************************/
|
||||||
package module.decode.state;
|
package channel.state;
|
||||||
|
|
||||||
|
import channel.metadata.Attribute;
|
||||||
import controller.channel.Channel;
|
import controller.channel.Channel;
|
||||||
import controller.channel.ChannelEvent;
|
import controller.channel.ChannelEvent;
|
||||||
import controller.channel.ChannelEvent.Event;
|
import controller.channel.ChannelEvent.Event;
|
||||||
@@ -46,7 +47,7 @@ import java.util.ArrayList;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
public class ChannelPanel extends JPanel
|
public class ChannelPanel extends JPanel
|
||||||
implements Listener<ChangedAttribute>,
|
implements Listener<Attribute>,
|
||||||
SettingChangeListener,
|
SettingChangeListener,
|
||||||
ChannelEventListener
|
ChannelEventListener
|
||||||
{
|
{
|
||||||
@@ -222,14 +223,14 @@ public class ChannelPanel extends JPanel
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void receive(final ChangedAttribute changedAttribute)
|
public void receive(final Attribute attribute)
|
||||||
{
|
{
|
||||||
EventQueue.invokeLater(new Runnable()
|
EventQueue.invokeLater(new Runnable()
|
||||||
{
|
{
|
||||||
@Override
|
@Override
|
||||||
public void run()
|
public void run()
|
||||||
{
|
{
|
||||||
switch(changedAttribute)
|
switch(attribute)
|
||||||
{
|
{
|
||||||
case CHANNEL_STATE:
|
case CHANNEL_STATE:
|
||||||
if(mChannelState != null && mChannelState.getState() != null)
|
if(mChannelState != null && mChannelState.getState() != null)
|
||||||
@@ -15,18 +15,20 @@
|
|||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>
|
* along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||||
******************************************************************************/
|
******************************************************************************/
|
||||||
package module.decode.state;
|
package channel.state;
|
||||||
|
|
||||||
import java.util.concurrent.RejectedExecutionException;
|
import java.util.concurrent.RejectedExecutionException;
|
||||||
import java.util.concurrent.ScheduledExecutorService;
|
import java.util.concurrent.ScheduledExecutorService;
|
||||||
import java.util.concurrent.ScheduledFuture;
|
import java.util.concurrent.ScheduledFuture;
|
||||||
import java.util.concurrent.TimeUnit;
|
import java.util.concurrent.TimeUnit;
|
||||||
|
|
||||||
|
import channel.metadata.Attribute;
|
||||||
|
import channel.traffic.TrafficChannelManager;
|
||||||
import module.Module;
|
import module.Module;
|
||||||
import module.decode.config.DecodeConfiguration;
|
import module.decode.config.DecodeConfiguration;
|
||||||
import module.decode.event.CallEvent;
|
import module.decode.event.CallEvent;
|
||||||
import module.decode.event.ICallEventProvider;
|
import module.decode.event.ICallEventProvider;
|
||||||
import module.decode.state.DecoderStateEvent.Event;
|
import channel.state.DecoderStateEvent.Event;
|
||||||
|
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
@@ -52,7 +54,7 @@ public class ChannelState extends Module implements ICallEventProvider, IChanged
|
|||||||
private State mState = State.IDLE;
|
private State mState = State.IDLE;
|
||||||
|
|
||||||
private Listener<CallEvent> mCallEventListener;
|
private Listener<CallEvent> mCallEventListener;
|
||||||
private Listener<ChangedAttribute> mChangedAttributeListener;
|
private Listener<Attribute> mChangedAttributeListener;
|
||||||
private Listener<DecoderStateEvent> mDecoderStateListener;
|
private Listener<DecoderStateEvent> mDecoderStateListener;
|
||||||
private Listener<Metadata> mMetadataListener;
|
private Listener<Metadata> mMetadataListener;
|
||||||
private Listener<SquelchState> mSquelchStateListener;
|
private Listener<SquelchState> mSquelchStateListener;
|
||||||
@@ -116,7 +118,7 @@ public class ChannelState extends Module implements ICallEventProvider, IChanged
|
|||||||
broadcast( new MetadataReset() );
|
broadcast( new MetadataReset() );
|
||||||
|
|
||||||
mState = State.IDLE;
|
mState = State.IDLE;
|
||||||
broadcast( ChangedAttribute.CHANNEL_STATE );
|
broadcast( Attribute.CHANNEL_STATE );
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -312,7 +314,7 @@ public class ChannelState extends Module implements ICallEventProvider, IChanged
|
|||||||
broadcast( SquelchState.SQUELCH );
|
broadcast( SquelchState.SQUELCH );
|
||||||
updateFadeTimeout();
|
updateFadeTimeout();
|
||||||
mState = state;
|
mState = state;
|
||||||
broadcast( ChangedAttribute.CHANNEL_STATE );
|
broadcast( Attribute.CHANNEL_STATE );
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case DATA:
|
case DATA:
|
||||||
@@ -320,13 +322,13 @@ public class ChannelState extends Module implements ICallEventProvider, IChanged
|
|||||||
broadcast( SquelchState.SQUELCH );
|
broadcast( SquelchState.SQUELCH );
|
||||||
updateFadeTimeout();
|
updateFadeTimeout();
|
||||||
mState = state;
|
mState = state;
|
||||||
broadcast( ChangedAttribute.CHANNEL_STATE );
|
broadcast( Attribute.CHANNEL_STATE );
|
||||||
break;
|
break;
|
||||||
case CALL:
|
case CALL:
|
||||||
broadcast( SquelchState.UNSQUELCH );
|
broadcast( SquelchState.UNSQUELCH );
|
||||||
updateFadeTimeout();
|
updateFadeTimeout();
|
||||||
mState = state;
|
mState = state;
|
||||||
broadcast( ChangedAttribute.CHANNEL_STATE );
|
broadcast( Attribute.CHANNEL_STATE );
|
||||||
break;
|
break;
|
||||||
case FADE:
|
case FADE:
|
||||||
processFadeState();
|
processFadeState();
|
||||||
@@ -360,7 +362,7 @@ public class ChannelState extends Module implements ICallEventProvider, IChanged
|
|||||||
mState = State.FADE;
|
mState = State.FADE;
|
||||||
|
|
||||||
broadcast( SquelchState.SQUELCH );
|
broadcast( SquelchState.SQUELCH );
|
||||||
broadcast( ChangedAttribute.CHANNEL_STATE );
|
broadcast( Attribute.CHANNEL_STATE );
|
||||||
}
|
}
|
||||||
|
|
||||||
private void processIdleState()
|
private void processIdleState()
|
||||||
@@ -375,7 +377,7 @@ public class ChannelState extends Module implements ICallEventProvider, IChanged
|
|||||||
|
|
||||||
mState = State.IDLE;
|
mState = State.IDLE;
|
||||||
|
|
||||||
broadcast( ChangedAttribute.CHANNEL_STATE );
|
broadcast( Attribute.CHANNEL_STATE );
|
||||||
}
|
}
|
||||||
|
|
||||||
private void processTeardownState()
|
private void processTeardownState()
|
||||||
@@ -386,7 +388,7 @@ public class ChannelState extends Module implements ICallEventProvider, IChanged
|
|||||||
|
|
||||||
mState = State.TEARDOWN;
|
mState = State.TEARDOWN;
|
||||||
|
|
||||||
broadcast( ChangedAttribute.CHANNEL_STATE );
|
broadcast( Attribute.CHANNEL_STATE );
|
||||||
|
|
||||||
if( mTrafficChannelEndListener != null )
|
if( mTrafficChannelEndListener != null )
|
||||||
{
|
{
|
||||||
@@ -421,7 +423,7 @@ public class ChannelState extends Module implements ICallEventProvider, IChanged
|
|||||||
* Broadcasts the channel state attribute change event to all registered
|
* Broadcasts the channel state attribute change event to all registered
|
||||||
* listeners
|
* listeners
|
||||||
*/
|
*/
|
||||||
protected void broadcast( ChangedAttribute attribute )
|
protected void broadcast( Attribute attribute )
|
||||||
{
|
{
|
||||||
if( mChangedAttributeListener != null )
|
if( mChangedAttributeListener != null )
|
||||||
{
|
{
|
||||||
@@ -433,7 +435,7 @@ public class ChannelState extends Module implements ICallEventProvider, IChanged
|
|||||||
* Adds the listener to receive channel state attribute change events
|
* Adds the listener to receive channel state attribute change events
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void setChangedAttributeListener( Listener<ChangedAttribute> listener )
|
public void setChangedAttributeListener( Listener<Attribute> listener )
|
||||||
{
|
{
|
||||||
mChangedAttributeListener = listener;
|
mChangedAttributeListener = listener;
|
||||||
}
|
}
|
||||||
@@ -15,7 +15,7 @@
|
|||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>
|
* along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||||
******************************************************************************/
|
******************************************************************************/
|
||||||
package module.decode.state;
|
package channel.state;
|
||||||
|
|
||||||
|
|
||||||
public interface ChannelStateSelectionListener
|
public interface ChannelStateSelectionListener
|
||||||
@@ -16,9 +16,10 @@
|
|||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>
|
* along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||||
*
|
*
|
||||||
******************************************************************************/
|
******************************************************************************/
|
||||||
package module.decode.state;
|
package channel.state;
|
||||||
|
|
||||||
import alias.Alias;
|
import alias.Alias;
|
||||||
|
import channel.metadata.Attribute;
|
||||||
import icon.IconManager;
|
import icon.IconManager;
|
||||||
import sample.Listener;
|
import sample.Listener;
|
||||||
import settings.ColorSetting;
|
import settings.ColorSetting;
|
||||||
@@ -31,7 +32,7 @@ import javax.swing.*;
|
|||||||
import java.awt.*;
|
import java.awt.*;
|
||||||
|
|
||||||
public abstract class DecoderPanel extends JPanel
|
public abstract class DecoderPanel extends JPanel
|
||||||
implements Listener<ChangedAttribute>, SettingChangeListener
|
implements Listener<Attribute>, SettingChangeListener
|
||||||
{
|
{
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
@@ -1,5 +1,6 @@
|
|||||||
package module.decode.state;
|
package channel.state;
|
||||||
|
|
||||||
|
import channel.metadata.Attribute;
|
||||||
import message.IMessageListener;
|
import message.IMessageListener;
|
||||||
import message.Message;
|
import message.Message;
|
||||||
import module.Module;
|
import module.Module;
|
||||||
@@ -31,7 +32,7 @@ public abstract class DecoderState extends Module
|
|||||||
{
|
{
|
||||||
/* This has to be a broadcaster in order for references to persist */
|
/* This has to be a broadcaster in order for references to persist */
|
||||||
private Broadcaster<CallEvent> mCallEventBroadcaster = new Broadcaster<>();
|
private Broadcaster<CallEvent> mCallEventBroadcaster = new Broadcaster<>();
|
||||||
private Listener<ChangedAttribute> mChangedAttributeListener;
|
private Listener<Attribute> mChangedAttributeListener;
|
||||||
private Listener<DecoderStateEvent> mDecoderStateListener;
|
private Listener<DecoderStateEvent> mDecoderStateListener;
|
||||||
private Listener<Metadata> mMetadataListener;
|
private Listener<Metadata> mMetadataListener;
|
||||||
|
|
||||||
@@ -141,7 +142,7 @@ public abstract class DecoderState extends Module
|
|||||||
* Broadcasts the channel state attribute change event to all registered
|
* Broadcasts the channel state attribute change event to all registered
|
||||||
* listeners
|
* listeners
|
||||||
*/
|
*/
|
||||||
protected void broadcast( ChangedAttribute attribute )
|
protected void broadcast( Attribute attribute )
|
||||||
{
|
{
|
||||||
if( mChangedAttributeListener != null )
|
if( mChangedAttributeListener != null )
|
||||||
{
|
{
|
||||||
@@ -153,7 +154,7 @@ public abstract class DecoderState extends Module
|
|||||||
* Adds the listener to receive channel state attribute change events
|
* Adds the listener to receive channel state attribute change events
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void setChangedAttributeListener( Listener<ChangedAttribute> listener )
|
public void setChangedAttributeListener( Listener<Attribute> listener )
|
||||||
{
|
{
|
||||||
mChangedAttributeListener = listener;
|
mChangedAttributeListener = listener;
|
||||||
}
|
}
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package module.decode.state;
|
package channel.state;
|
||||||
|
|
||||||
public class DecoderStateEvent
|
public class DecoderStateEvent
|
||||||
{
|
{
|
||||||
10
src/channel/state/IChangedAttributeProvider.java
Normal file
10
src/channel/state/IChangedAttributeProvider.java
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
package channel.state;
|
||||||
|
|
||||||
|
import channel.metadata.Attribute;
|
||||||
|
import sample.Listener;
|
||||||
|
|
||||||
|
public interface IChangedAttributeProvider
|
||||||
|
{
|
||||||
|
public void setChangedAttributeListener( Listener<Attribute> listener );
|
||||||
|
public void removeChangedAttributeListener();
|
||||||
|
}
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package module.decode.state;
|
package channel.state;
|
||||||
|
|
||||||
import sample.Listener;
|
import sample.Listener;
|
||||||
|
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package module.decode.state;
|
package channel.state;
|
||||||
|
|
||||||
import sample.Listener;
|
import sample.Listener;
|
||||||
|
|
||||||
@@ -15,7 +15,7 @@
|
|||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>
|
* along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||||
******************************************************************************/
|
******************************************************************************/
|
||||||
package module.decode.state;
|
package channel.state;
|
||||||
|
|
||||||
import java.util.EnumSet;
|
import java.util.EnumSet;
|
||||||
|
|
||||||
45
src/channel/traffic/TrafficChannelAllocationEvent.java
Normal file
45
src/channel/traffic/TrafficChannelAllocationEvent.java
Normal file
@@ -0,0 +1,45 @@
|
|||||||
|
/*******************************************************************************
|
||||||
|
* sdrtrunk
|
||||||
|
* Copyright (C) 2014-2017 Dennis Sheirer
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||||
|
*
|
||||||
|
******************************************************************************/
|
||||||
|
package channel.traffic;
|
||||||
|
|
||||||
|
import channel.state.DecoderStateEvent;
|
||||||
|
import channel.state.State;
|
||||||
|
import module.decode.event.CallEvent;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Traffic channel allocation event wraps a call event indicating the channel
|
||||||
|
* and frequency for a traffic channel allocation event, so that the traffic
|
||||||
|
* channel manager can respond and allocate a decoder channel and source if
|
||||||
|
* available, or change the wrapped call event to a call detect event and log it.
|
||||||
|
*/
|
||||||
|
public class TrafficChannelAllocationEvent extends DecoderStateEvent
|
||||||
|
{
|
||||||
|
private CallEvent mCallEvent;
|
||||||
|
|
||||||
|
public TrafficChannelAllocationEvent( Object source, CallEvent callEvent )
|
||||||
|
{
|
||||||
|
super( source, Event.TRAFFIC_CHANNEL_ALLOCATION, State.CALL );
|
||||||
|
mCallEvent = callEvent;
|
||||||
|
}
|
||||||
|
|
||||||
|
public CallEvent getCallEvent()
|
||||||
|
{
|
||||||
|
return mCallEvent;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,4 +1,22 @@
|
|||||||
package module.decode.state;
|
/*******************************************************************************
|
||||||
|
* sdrtrunk
|
||||||
|
* Copyright (C) 2014-2017 Dennis Sheirer
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||||
|
*
|
||||||
|
******************************************************************************/
|
||||||
|
package channel.traffic;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@@ -6,6 +24,8 @@ import java.util.Map;
|
|||||||
import java.util.concurrent.ConcurrentHashMap;
|
import java.util.concurrent.ConcurrentHashMap;
|
||||||
import java.util.concurrent.ScheduledExecutorService;
|
import java.util.concurrent.ScheduledExecutorService;
|
||||||
|
|
||||||
|
import channel.state.DecoderStateEvent;
|
||||||
|
import channel.state.IDecoderStateEventListener;
|
||||||
import module.Module;
|
import module.Module;
|
||||||
import module.decode.config.DecodeConfiguration;
|
import module.decode.config.DecodeConfiguration;
|
||||||
import module.decode.event.CallEvent;
|
import module.decode.event.CallEvent;
|
||||||
@@ -34,7 +34,7 @@ import map.MapPanel;
|
|||||||
import map.MapService;
|
import map.MapService;
|
||||||
import module.decode.event.CallEventPanel;
|
import module.decode.event.CallEventPanel;
|
||||||
import module.decode.event.MessageActivityPanel;
|
import module.decode.event.MessageActivityPanel;
|
||||||
import module.decode.state.ChannelList;
|
import channel.state.ChannelList;
|
||||||
import net.miginfocom.swing.MigLayout;
|
import net.miginfocom.swing.MigLayout;
|
||||||
import settings.SettingsManager;
|
import settings.SettingsManager;
|
||||||
import source.SourceManager;
|
import source.SourceManager;
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ import javax.swing.JSeparator;
|
|||||||
|
|
||||||
import module.ProcessingChain;
|
import module.ProcessingChain;
|
||||||
import module.decode.event.ActivitySummaryFrame;
|
import module.decode.event.ActivitySummaryFrame;
|
||||||
import module.decode.state.DecoderState;
|
import channel.state.DecoderState;
|
||||||
import controller.channel.ChannelEvent.Event;
|
import controller.channel.ChannelEvent.Event;
|
||||||
|
|
||||||
public class ChannelUtils
|
public class ChannelUtils
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
package controller.channel;
|
package controller.channel;
|
||||||
|
|
||||||
import module.decode.event.CallEvent;
|
import module.decode.event.CallEvent;
|
||||||
import module.decode.state.TrafficChannelManager;
|
import channel.traffic.TrafficChannelManager;
|
||||||
|
|
||||||
public class TrafficChannelEvent extends ChannelEvent
|
public class TrafficChannelEvent extends ChannelEvent
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -23,7 +23,6 @@ import controller.NamingThreadFactory;
|
|||||||
import icon.IconManager;
|
import icon.IconManager;
|
||||||
import message.Message;
|
import message.Message;
|
||||||
import sample.Listener;
|
import sample.Listener;
|
||||||
import settings.SettingsManager;
|
|
||||||
|
|
||||||
import java.awt.*;
|
import java.awt.*;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
@@ -102,7 +101,7 @@ public class MapService implements Listener<Message>
|
|||||||
|
|
||||||
if(alias != null)
|
if(alias != null)
|
||||||
{
|
{
|
||||||
color = alias.getMapColor();
|
color = alias.getDisplayColor();
|
||||||
}
|
}
|
||||||
|
|
||||||
if(color == null)
|
if(color == null)
|
||||||
|
|||||||
@@ -39,13 +39,13 @@ import module.decode.event.CallEventModel;
|
|||||||
import module.decode.event.ICallEventListener;
|
import module.decode.event.ICallEventListener;
|
||||||
import module.decode.event.ICallEventProvider;
|
import module.decode.event.ICallEventProvider;
|
||||||
import module.decode.event.MessageActivityModel;
|
import module.decode.event.MessageActivityModel;
|
||||||
import module.decode.state.ChannelState;
|
import channel.state.ChannelState;
|
||||||
import module.decode.state.DecoderState;
|
import channel.state.DecoderState;
|
||||||
import module.decode.state.DecoderStateEvent;
|
import channel.state.DecoderStateEvent;
|
||||||
import module.decode.state.DecoderStateEvent.Event;
|
import channel.state.DecoderStateEvent.Event;
|
||||||
import module.decode.state.IDecoderStateEventListener;
|
import channel.state.IDecoderStateEventListener;
|
||||||
import module.decode.state.IDecoderStateEventProvider;
|
import channel.state.IDecoderStateEventProvider;
|
||||||
import module.decode.state.State;
|
import channel.state.State;
|
||||||
import module.log.EventLogger;
|
import module.log.EventLogger;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|||||||
@@ -92,10 +92,10 @@ import module.decode.passport.PassportDecoderEditor;
|
|||||||
import module.decode.passport.PassportDecoderPanel;
|
import module.decode.passport.PassportDecoderPanel;
|
||||||
import module.decode.passport.PassportDecoderState;
|
import module.decode.passport.PassportDecoderState;
|
||||||
import module.decode.passport.PassportMessageFilter;
|
import module.decode.passport.PassportMessageFilter;
|
||||||
import module.decode.state.AlwaysUnsquelchedDecoderState;
|
import channel.state.AlwaysUnsquelchedDecoderState;
|
||||||
import module.decode.state.DecoderPanel;
|
import channel.state.DecoderPanel;
|
||||||
import module.decode.state.DecoderState;
|
import channel.state.DecoderState;
|
||||||
import module.decode.state.TrafficChannelManager;
|
import channel.traffic.TrafficChannelManager;
|
||||||
import module.decode.tait.Tait1200Decoder;
|
import module.decode.tait.Tait1200Decoder;
|
||||||
import module.decode.tait.Tait1200DecoderPanel;
|
import module.decode.tait.Tait1200DecoderPanel;
|
||||||
import module.decode.tait.Tait1200DecoderState;
|
import module.decode.tait.Tait1200DecoderState;
|
||||||
|
|||||||
@@ -19,9 +19,9 @@
|
|||||||
package module.decode.am;
|
package module.decode.am;
|
||||||
|
|
||||||
import icon.IconManager;
|
import icon.IconManager;
|
||||||
import module.decode.state.ChangedAttribute;
|
import channel.metadata.Attribute;
|
||||||
import module.decode.state.DecoderPanel;
|
import channel.state.DecoderPanel;
|
||||||
import module.decode.state.DecoderState;
|
import channel.state.DecoderState;
|
||||||
import net.miginfocom.swing.MigLayout;
|
import net.miginfocom.swing.MigLayout;
|
||||||
import settings.ColorSetting;
|
import settings.ColorSetting;
|
||||||
import settings.Setting;
|
import settings.Setting;
|
||||||
@@ -55,7 +55,7 @@ public class AMDecoderPanel extends DecoderPanel
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void receive(final ChangedAttribute changedAttribute)
|
public void receive(final Attribute attribute)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -19,8 +19,8 @@
|
|||||||
package module.decode.fleetsync2;
|
package module.decode.fleetsync2;
|
||||||
|
|
||||||
import icon.IconManager;
|
import icon.IconManager;
|
||||||
import module.decode.state.ChangedAttribute;
|
import channel.metadata.Attribute;
|
||||||
import module.decode.state.DecoderPanel;
|
import channel.state.DecoderPanel;
|
||||||
import net.miginfocom.swing.MigLayout;
|
import net.miginfocom.swing.MigLayout;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
@@ -116,14 +116,14 @@ public class Fleetsync2DecoderPanel extends DecoderPanel
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void receive(final ChangedAttribute changedAttribute)
|
public void receive(final Attribute attribute)
|
||||||
{
|
{
|
||||||
EventQueue.invokeLater(new Runnable()
|
EventQueue.invokeLater(new Runnable()
|
||||||
{
|
{
|
||||||
@Override
|
@Override
|
||||||
public void run()
|
public void run()
|
||||||
{
|
{
|
||||||
switch(changedAttribute)
|
switch(attribute)
|
||||||
{
|
{
|
||||||
case FROM_TALKGROUP:
|
case FROM_TALKGROUP:
|
||||||
String from = getDecoderState().getFromID();
|
String from = getDecoderState().getFromID();
|
||||||
|
|||||||
@@ -23,11 +23,11 @@ import java.util.concurrent.ScheduledExecutorService;
|
|||||||
|
|
||||||
import message.Message;
|
import message.Message;
|
||||||
import module.decode.DecoderType;
|
import module.decode.DecoderType;
|
||||||
import module.decode.state.ChangedAttribute;
|
import channel.metadata.Attribute;
|
||||||
import module.decode.state.DecoderState;
|
import channel.state.DecoderState;
|
||||||
import module.decode.state.DecoderStateEvent;
|
import channel.state.DecoderStateEvent;
|
||||||
import module.decode.state.DecoderStateEvent.Event;
|
import channel.state.DecoderStateEvent.Event;
|
||||||
import module.decode.state.State;
|
import channel.state.State;
|
||||||
import alias.Alias;
|
import alias.Alias;
|
||||||
import alias.AliasList;
|
import alias.AliasList;
|
||||||
|
|
||||||
@@ -182,7 +182,7 @@ public class Fleetsync2DecoderState extends DecoderState
|
|||||||
public void setFromID( String from )
|
public void setFromID( String from )
|
||||||
{
|
{
|
||||||
mFrom = from;
|
mFrom = from;
|
||||||
broadcast( ChangedAttribute.FROM_TALKGROUP );
|
broadcast( Attribute.FROM_TALKGROUP );
|
||||||
}
|
}
|
||||||
|
|
||||||
public Alias getFromIDAlias()
|
public Alias getFromIDAlias()
|
||||||
@@ -193,7 +193,7 @@ public class Fleetsync2DecoderState extends DecoderState
|
|||||||
public void setFromIDAlias( Alias alias )
|
public void setFromIDAlias( Alias alias )
|
||||||
{
|
{
|
||||||
mFromAlias = alias;
|
mFromAlias = alias;
|
||||||
broadcast( ChangedAttribute.FROM_TALKGROUP_ALIAS );
|
broadcast( Attribute.FROM_TALKGROUP_ALIAS );
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getToID()
|
public String getToID()
|
||||||
@@ -204,7 +204,7 @@ public class Fleetsync2DecoderState extends DecoderState
|
|||||||
public void setToID( String to )
|
public void setToID( String to )
|
||||||
{
|
{
|
||||||
mTo = to;
|
mTo = to;
|
||||||
broadcast( ChangedAttribute.TO_TALKGROUP );
|
broadcast( Attribute.TO_TALKGROUP );
|
||||||
}
|
}
|
||||||
|
|
||||||
public Alias getToIDAlias()
|
public Alias getToIDAlias()
|
||||||
@@ -215,7 +215,7 @@ public class Fleetsync2DecoderState extends DecoderState
|
|||||||
public void setToIDAlias( Alias alias )
|
public void setToIDAlias( Alias alias )
|
||||||
{
|
{
|
||||||
mToAlias = alias;
|
mToAlias = alias;
|
||||||
broadcast( ChangedAttribute.TO_TALKGROUP_ALIAS );
|
broadcast( Attribute.TO_TALKGROUP_ALIAS );
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getMessage()
|
public String getMessage()
|
||||||
@@ -226,7 +226,7 @@ public class Fleetsync2DecoderState extends DecoderState
|
|||||||
public void setMessage( String message )
|
public void setMessage( String message )
|
||||||
{
|
{
|
||||||
mMessage = message;
|
mMessage = message;
|
||||||
broadcast( ChangedAttribute.MESSAGE );
|
broadcast( Attribute.MESSAGE );
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getMessageType()
|
public String getMessageType()
|
||||||
@@ -237,7 +237,7 @@ public class Fleetsync2DecoderState extends DecoderState
|
|||||||
public void setMessageType( String type )
|
public void setMessageType( String type )
|
||||||
{
|
{
|
||||||
mMessageType = type;
|
mMessageType = type;
|
||||||
broadcast( ChangedAttribute.MESSAGE_TYPE );
|
broadcast( Attribute.MESSAGE_TYPE );
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -20,8 +20,8 @@ package module.decode.lj1200;
|
|||||||
|
|
||||||
import alias.Alias;
|
import alias.Alias;
|
||||||
import icon.IconManager;
|
import icon.IconManager;
|
||||||
import module.decode.state.ChangedAttribute;
|
import channel.metadata.Attribute;
|
||||||
import module.decode.state.DecoderPanel;
|
import channel.state.DecoderPanel;
|
||||||
import net.miginfocom.swing.MigLayout;
|
import net.miginfocom.swing.MigLayout;
|
||||||
import settings.ColorSetting;
|
import settings.ColorSetting;
|
||||||
import settings.ColorSetting.ColorSettingName;
|
import settings.ColorSetting.ColorSettingName;
|
||||||
@@ -79,9 +79,9 @@ public class LJ1200DecoderPanel extends DecoderPanel
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void receive(final ChangedAttribute changedAttribute)
|
public void receive(final Attribute attribute)
|
||||||
{
|
{
|
||||||
switch(changedAttribute)
|
switch(attribute)
|
||||||
{
|
{
|
||||||
case TO_TALKGROUP:
|
case TO_TALKGROUP:
|
||||||
mTo.setText(getDecoderState().getAddress());
|
mTo.setText(getDecoderState().getAddress());
|
||||||
|
|||||||
@@ -26,11 +26,11 @@ import java.util.concurrent.ScheduledExecutorService;
|
|||||||
|
|
||||||
import message.Message;
|
import message.Message;
|
||||||
import module.decode.DecoderType;
|
import module.decode.DecoderType;
|
||||||
import module.decode.state.ChangedAttribute;
|
import channel.metadata.Attribute;
|
||||||
import module.decode.state.DecoderState;
|
import channel.state.DecoderState;
|
||||||
import module.decode.state.DecoderStateEvent;
|
import channel.state.DecoderStateEvent;
|
||||||
import module.decode.state.DecoderStateEvent.Event;
|
import channel.state.DecoderStateEvent.Event;
|
||||||
import module.decode.state.State;
|
import channel.state.State;
|
||||||
|
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
@@ -106,13 +106,13 @@ public class LJ1200DecoderState extends DecoderState
|
|||||||
private void setAddress( String address )
|
private void setAddress( String address )
|
||||||
{
|
{
|
||||||
mAddress = address;
|
mAddress = address;
|
||||||
broadcast( ChangedAttribute.TO_TALKGROUP );
|
broadcast( Attribute.TO_TALKGROUP );
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setAddressAlias( Alias alias )
|
private void setAddressAlias( Alias alias )
|
||||||
{
|
{
|
||||||
mAddressAlias = alias;
|
mAddressAlias = alias;
|
||||||
broadcast( ChangedAttribute.TO_TALKGROUP_ALIAS );
|
broadcast( Attribute.TO_TALKGROUP_ALIAS );
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -160,9 +160,9 @@ public class LJ1200DecoderState extends DecoderState
|
|||||||
private void resetState()
|
private void resetState()
|
||||||
{
|
{
|
||||||
setAddress( null );
|
setAddress( null );
|
||||||
broadcast( ChangedAttribute.TO_TALKGROUP );
|
broadcast( Attribute.TO_TALKGROUP );
|
||||||
setAddressAlias( null );
|
setAddressAlias( null );
|
||||||
broadcast( ChangedAttribute.TO_TALKGROUP_ALIAS );
|
broadcast( Attribute.TO_TALKGROUP_ALIAS );
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -20,8 +20,8 @@ package module.decode.ltrnet;
|
|||||||
|
|
||||||
import alias.Alias;
|
import alias.Alias;
|
||||||
import icon.IconManager;
|
import icon.IconManager;
|
||||||
import module.decode.state.ChangedAttribute;
|
import channel.metadata.Attribute;
|
||||||
import module.decode.state.DecoderPanel;
|
import channel.state.DecoderPanel;
|
||||||
import net.miginfocom.swing.MigLayout;
|
import net.miginfocom.swing.MigLayout;
|
||||||
import settings.ColorSetting;
|
import settings.ColorSetting;
|
||||||
import settings.Setting;
|
import settings.Setting;
|
||||||
@@ -83,7 +83,7 @@ public class LTRNetDecoderPanel extends DecoderPanel
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void receive(final ChangedAttribute changedAttribute)
|
public void receive(final Attribute attribute)
|
||||||
{
|
{
|
||||||
EventQueue.invokeLater(new Runnable()
|
EventQueue.invokeLater(new Runnable()
|
||||||
{
|
{
|
||||||
@@ -92,7 +92,7 @@ public class LTRNetDecoderPanel extends DecoderPanel
|
|||||||
{
|
{
|
||||||
LTRNetDecoderState state = getDecoderState();
|
LTRNetDecoderState state = getDecoderState();
|
||||||
|
|
||||||
switch(changedAttribute)
|
switch(attribute)
|
||||||
{
|
{
|
||||||
case TO_TALKGROUP:
|
case TO_TALKGROUP:
|
||||||
mTalkgroup.setText(state.getToTalkgroup());
|
mTalkgroup.setText(state.getToTalkgroup());
|
||||||
|
|||||||
@@ -27,11 +27,11 @@ import message.Message;
|
|||||||
import module.decode.DecoderType;
|
import module.decode.DecoderType;
|
||||||
import module.decode.event.CallEvent;
|
import module.decode.event.CallEvent;
|
||||||
import module.decode.event.CallEvent.CallEventType;
|
import module.decode.event.CallEvent.CallEventType;
|
||||||
import module.decode.state.ChangedAttribute;
|
import channel.metadata.Attribute;
|
||||||
import module.decode.state.DecoderState;
|
import channel.state.DecoderState;
|
||||||
import module.decode.state.DecoderStateEvent;
|
import channel.state.DecoderStateEvent;
|
||||||
import module.decode.state.DecoderStateEvent.Event;
|
import channel.state.DecoderStateEvent.Event;
|
||||||
import module.decode.state.State;
|
import channel.state.State;
|
||||||
|
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
@@ -93,7 +93,7 @@ public class LTRNetDecoderState extends DecoderState
|
|||||||
if (mChannelNumber == 0)
|
if (mChannelNumber == 0)
|
||||||
{
|
{
|
||||||
mChannelNumber = ltr.getChannel();
|
mChannelNumber = ltr.getChannel();
|
||||||
broadcast(ChangedAttribute.CHANNEL_NUMBER);
|
broadcast(Attribute.CHANNEL_NUMBER);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Process FCC Station ID Events */
|
/* Process FCC Station ID Events */
|
||||||
@@ -131,7 +131,7 @@ public class LTRNetDecoderState extends DecoderState
|
|||||||
if (mChannelNumber == 0)
|
if (mChannelNumber == 0)
|
||||||
{
|
{
|
||||||
mChannelNumber = ltr.getChannel();
|
mChannelNumber = ltr.getChannel();
|
||||||
broadcast(ChangedAttribute.CHANNEL_NUMBER);
|
broadcast(Attribute.CHANNEL_NUMBER);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* If the call event channel matches our current channel
|
/* If the call event channel matches our current channel
|
||||||
@@ -150,7 +150,7 @@ public class LTRNetDecoderState extends DecoderState
|
|||||||
if (mChannelNumber != ltr.getChannel())
|
if (mChannelNumber != ltr.getChannel())
|
||||||
{
|
{
|
||||||
mChannelNumber = ltr.getChannel();
|
mChannelNumber = ltr.getChannel();
|
||||||
broadcast(ChangedAttribute.CHANNEL_NUMBER);
|
broadcast(Attribute.CHANNEL_NUMBER);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case MA_CHNH:
|
case MA_CHNH:
|
||||||
@@ -211,10 +211,10 @@ public class LTRNetDecoderState extends DecoderState
|
|||||||
}
|
}
|
||||||
|
|
||||||
mTalkgroup = String.valueOf(uniqueID);
|
mTalkgroup = String.valueOf(uniqueID);
|
||||||
broadcast(ChangedAttribute.TO_TALKGROUP);
|
broadcast(Attribute.TO_TALKGROUP);
|
||||||
|
|
||||||
mTalkgroupAlias = ltr.getRadioUniqueIDAlias();
|
mTalkgroupAlias = ltr.getRadioUniqueIDAlias();
|
||||||
broadcast(ChangedAttribute.TO_TALKGROUP_ALIAS);
|
broadcast(Attribute.TO_TALKGROUP_ALIAS);
|
||||||
break;
|
break;
|
||||||
case ID_SITE:
|
case ID_SITE:
|
||||||
String siteID = ltr.getSiteID();
|
String siteID = ltr.getSiteID();
|
||||||
@@ -252,13 +252,13 @@ public class LTRNetDecoderState extends DecoderState
|
|||||||
}
|
}
|
||||||
|
|
||||||
mDescription = "ESN";
|
mDescription = "ESN";
|
||||||
broadcast(ChangedAttribute.DESCRIPTION);
|
broadcast(Attribute.DESCRIPTION);
|
||||||
|
|
||||||
mTalkgroup = ltr.getESN();
|
mTalkgroup = ltr.getESN();
|
||||||
broadcast(ChangedAttribute.TO_TALKGROUP);
|
broadcast(Attribute.TO_TALKGROUP);
|
||||||
|
|
||||||
mTalkgroupAlias = ltr.getESNAlias();
|
mTalkgroupAlias = ltr.getESNAlias();
|
||||||
broadcast(ChangedAttribute.TO_TALKGROUP_ALIAS);
|
broadcast(Attribute.TO_TALKGROUP_ALIAS);
|
||||||
|
|
||||||
broadcast(new DecoderStateEvent(this, Event.DECODE, State.DATA));
|
broadcast(new DecoderStateEvent(this, Event.DECODE, State.DATA));
|
||||||
|
|
||||||
@@ -286,13 +286,13 @@ public class LTRNetDecoderState extends DecoderState
|
|||||||
mUniqueIDs.add(uniqueid);
|
mUniqueIDs.add(uniqueid);
|
||||||
|
|
||||||
mDescription = "REGISTER UID";
|
mDescription = "REGISTER UID";
|
||||||
broadcast(ChangedAttribute.DESCRIPTION);
|
broadcast(Attribute.DESCRIPTION);
|
||||||
|
|
||||||
mTalkgroup = String.valueOf(uniqueid);
|
mTalkgroup = String.valueOf(uniqueid);
|
||||||
broadcast(ChangedAttribute.TO_TALKGROUP);
|
broadcast(Attribute.TO_TALKGROUP);
|
||||||
|
|
||||||
mTalkgroupAlias = ltr.getRadioUniqueIDAlias();
|
mTalkgroupAlias = ltr.getRadioUniqueIDAlias();
|
||||||
broadcast(ChangedAttribute.TO_TALKGROUP_ALIAS);
|
broadcast(Attribute.TO_TALKGROUP_ALIAS);
|
||||||
|
|
||||||
if (getCurrentLTRCallEvent() == null)
|
if (getCurrentLTRCallEvent() == null)
|
||||||
{
|
{
|
||||||
@@ -620,7 +620,7 @@ public class LTRNetDecoderState extends DecoderState
|
|||||||
{
|
{
|
||||||
broadcast(new DecoderStateEvent(this, Event.START, State.DATA));
|
broadcast(new DecoderStateEvent(this, Event.START, State.DATA));
|
||||||
mDescription = "REGISTER";
|
mDescription = "REGISTER";
|
||||||
broadcast(ChangedAttribute.DESCRIPTION);
|
broadcast(Attribute.DESCRIPTION);
|
||||||
}
|
}
|
||||||
/* Process call */
|
/* Process call */
|
||||||
else
|
else
|
||||||
@@ -643,7 +643,7 @@ public class LTRNetDecoderState extends DecoderState
|
|||||||
}
|
}
|
||||||
|
|
||||||
mTalkgroup = message.getTalkgroupID();
|
mTalkgroup = message.getTalkgroupID();
|
||||||
broadcast(ChangedAttribute.TO_TALKGROUP);
|
broadcast(Attribute.TO_TALKGROUP);
|
||||||
|
|
||||||
/* A talkgroup must be seen at least once before it will be added
|
/* A talkgroup must be seen at least once before it will be added
|
||||||
* to the mTalkgroups list that is used in the activity summary,
|
* to the mTalkgroups list that is used in the activity summary,
|
||||||
@@ -658,7 +658,7 @@ public class LTRNetDecoderState extends DecoderState
|
|||||||
}
|
}
|
||||||
|
|
||||||
mTalkgroupAlias = message.getTalkgroupIDAlias();
|
mTalkgroupAlias = message.getTalkgroupIDAlias();
|
||||||
broadcast(ChangedAttribute.TO_TALKGROUP_ALIAS);
|
broadcast(Attribute.TO_TALKGROUP_ALIAS);
|
||||||
|
|
||||||
CallEvent callEvent = new LTRCallEvent.Builder(DecoderType.LTR_NET, CallEventType.CALL)
|
CallEvent callEvent = new LTRCallEvent.Builder(DecoderType.LTR_NET, CallEventType.CALL)
|
||||||
.aliasList(getAliasList())
|
.aliasList(getAliasList())
|
||||||
@@ -729,13 +729,13 @@ public class LTRNetDecoderState extends DecoderState
|
|||||||
mCurrentCallEvent = null;
|
mCurrentCallEvent = null;
|
||||||
|
|
||||||
mTalkgroup = null;
|
mTalkgroup = null;
|
||||||
broadcast(ChangedAttribute.TO_TALKGROUP);
|
broadcast(Attribute.TO_TALKGROUP);
|
||||||
|
|
||||||
mTalkgroupAlias = null;
|
mTalkgroupAlias = null;
|
||||||
broadcast(ChangedAttribute.TO_TALKGROUP_ALIAS);
|
broadcast(Attribute.TO_TALKGROUP_ALIAS);
|
||||||
|
|
||||||
mDescription = null;
|
mDescription = null;
|
||||||
broadcast(ChangedAttribute.DESCRIPTION);
|
broadcast(Attribute.DESCRIPTION);
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getToTalkgroup()
|
public String getToTalkgroup()
|
||||||
|
|||||||
@@ -20,8 +20,8 @@ package module.decode.ltrstandard;
|
|||||||
|
|
||||||
import alias.Alias;
|
import alias.Alias;
|
||||||
import icon.IconManager;
|
import icon.IconManager;
|
||||||
import module.decode.state.ChangedAttribute;
|
import channel.metadata.Attribute;
|
||||||
import module.decode.state.DecoderPanel;
|
import channel.state.DecoderPanel;
|
||||||
import net.miginfocom.swing.MigLayout;
|
import net.miginfocom.swing.MigLayout;
|
||||||
import settings.ColorSetting;
|
import settings.ColorSetting;
|
||||||
import settings.Setting;
|
import settings.Setting;
|
||||||
@@ -84,7 +84,7 @@ public class LTRStandardDecoderPanel extends DecoderPanel
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void receive(final ChangedAttribute attribute)
|
public void receive(final Attribute attribute)
|
||||||
{
|
{
|
||||||
EventQueue.invokeLater(new Runnable()
|
EventQueue.invokeLater(new Runnable()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -34,11 +34,11 @@ import module.decode.ltrstandard.message.CallEndMessage;
|
|||||||
import module.decode.ltrstandard.message.CallMessage;
|
import module.decode.ltrstandard.message.CallMessage;
|
||||||
import module.decode.ltrstandard.message.IdleMessage;
|
import module.decode.ltrstandard.message.IdleMessage;
|
||||||
import module.decode.ltrstandard.message.LTRStandardMessage;
|
import module.decode.ltrstandard.message.LTRStandardMessage;
|
||||||
import module.decode.state.ChangedAttribute;
|
import channel.metadata.Attribute;
|
||||||
import module.decode.state.DecoderState;
|
import channel.state.DecoderState;
|
||||||
import module.decode.state.DecoderStateEvent;
|
import channel.state.DecoderStateEvent;
|
||||||
import module.decode.state.DecoderStateEvent.Event;
|
import channel.state.DecoderStateEvent.Event;
|
||||||
import module.decode.state.State;
|
import channel.state.State;
|
||||||
|
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
@@ -137,12 +137,12 @@ public class LTRStandardDecoderState extends DecoderState
|
|||||||
if( mLCNTracker.isCurrentChannel( channel ) )
|
if( mLCNTracker.isCurrentChannel( channel ) )
|
||||||
{
|
{
|
||||||
mTalkgroup = start.getToID();
|
mTalkgroup = start.getToID();
|
||||||
broadcast( ChangedAttribute.TO_TALKGROUP );
|
broadcast( Attribute.TO_TALKGROUP );
|
||||||
|
|
||||||
processTalkgroup( mTalkgroup );
|
processTalkgroup( mTalkgroup );
|
||||||
|
|
||||||
mTalkgroupAlias = start.getToIDAlias();
|
mTalkgroupAlias = start.getToIDAlias();
|
||||||
broadcast( ChangedAttribute.TO_TALKGROUP_ALIAS );
|
broadcast( Attribute.TO_TALKGROUP_ALIAS );
|
||||||
|
|
||||||
broadcast( new Metadata( MetadataType.TO,
|
broadcast( new Metadata( MetadataType.TO,
|
||||||
mTalkgroup, mTalkgroupAlias, true ) );
|
mTalkgroup, mTalkgroupAlias, true ) );
|
||||||
@@ -165,12 +165,12 @@ public class LTRStandardDecoderState extends DecoderState
|
|||||||
if( mLCNTracker.isCurrentChannel( repeater ) )
|
if( mLCNTracker.isCurrentChannel( repeater ) )
|
||||||
{
|
{
|
||||||
mTalkgroup = end.getToID();
|
mTalkgroup = end.getToID();
|
||||||
broadcast( ChangedAttribute.TO_TALKGROUP );
|
broadcast( Attribute.TO_TALKGROUP );
|
||||||
|
|
||||||
processTalkgroup( mTalkgroup );
|
processTalkgroup( mTalkgroup );
|
||||||
|
|
||||||
mTalkgroupAlias = end.getToIDAlias();
|
mTalkgroupAlias = end.getToIDAlias();
|
||||||
broadcast( ChangedAttribute.TO_TALKGROUP_ALIAS );
|
broadcast( Attribute.TO_TALKGROUP_ALIAS );
|
||||||
|
|
||||||
LTRCallEvent event = mActiveCalls.remove( repeater );
|
LTRCallEvent event = mActiveCalls.remove( repeater );
|
||||||
|
|
||||||
@@ -242,10 +242,10 @@ public class LTRStandardDecoderState extends DecoderState
|
|||||||
mActiveCalls.clear();
|
mActiveCalls.clear();
|
||||||
|
|
||||||
mTalkgroup = null;
|
mTalkgroup = null;
|
||||||
broadcast( ChangedAttribute.TO_TALKGROUP );
|
broadcast( Attribute.TO_TALKGROUP );
|
||||||
|
|
||||||
mTalkgroupAlias = null;
|
mTalkgroupAlias = null;
|
||||||
broadcast( ChangedAttribute.TO_TALKGROUP_ALIAS );
|
broadcast( Attribute.TO_TALKGROUP_ALIAS );
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getTalkgroup()
|
public String getTalkgroup()
|
||||||
@@ -453,7 +453,7 @@ public class LTRStandardDecoderState extends DecoderState
|
|||||||
mCallHighestCount = mCallLCNCounts[ channel ];
|
mCallHighestCount = mCallLCNCounts[ channel ];
|
||||||
mCurrentLCN = channel;
|
mCurrentLCN = channel;
|
||||||
|
|
||||||
broadcast( ChangedAttribute.CHANNEL_NUMBER );
|
broadcast( Attribute.CHANNEL_NUMBER );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,8 +20,8 @@ package module.decode.mdc1200;
|
|||||||
|
|
||||||
import alias.Alias;
|
import alias.Alias;
|
||||||
import icon.IconManager;
|
import icon.IconManager;
|
||||||
import module.decode.state.ChangedAttribute;
|
import channel.metadata.Attribute;
|
||||||
import module.decode.state.DecoderPanel;
|
import channel.state.DecoderPanel;
|
||||||
import net.miginfocom.swing.MigLayout;
|
import net.miginfocom.swing.MigLayout;
|
||||||
import settings.ColorSetting;
|
import settings.ColorSetting;
|
||||||
import settings.ColorSetting.ColorSettingName;
|
import settings.ColorSetting.ColorSettingName;
|
||||||
@@ -82,14 +82,14 @@ public class MDCDecoderPanel extends DecoderPanel
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void receive(final ChangedAttribute changedAttribute)
|
public void receive(final Attribute attribute)
|
||||||
{
|
{
|
||||||
EventQueue.invokeLater(new Runnable()
|
EventQueue.invokeLater(new Runnable()
|
||||||
{
|
{
|
||||||
@Override
|
@Override
|
||||||
public void run()
|
public void run()
|
||||||
{
|
{
|
||||||
switch(changedAttribute)
|
switch(attribute)
|
||||||
{
|
{
|
||||||
case FROM_TALKGROUP:
|
case FROM_TALKGROUP:
|
||||||
String from = getDecoderState().getFrom();
|
String from = getDecoderState().getFrom();
|
||||||
|
|||||||
@@ -23,11 +23,11 @@ import java.util.concurrent.ScheduledExecutorService;
|
|||||||
|
|
||||||
import message.Message;
|
import message.Message;
|
||||||
import module.decode.DecoderType;
|
import module.decode.DecoderType;
|
||||||
import module.decode.state.ChangedAttribute;
|
import channel.metadata.Attribute;
|
||||||
import module.decode.state.DecoderState;
|
import channel.state.DecoderState;
|
||||||
import module.decode.state.DecoderStateEvent;
|
import channel.state.DecoderStateEvent;
|
||||||
import module.decode.state.State;
|
import channel.state.State;
|
||||||
import module.decode.state.DecoderStateEvent.Event;
|
import channel.state.DecoderStateEvent.Event;
|
||||||
import alias.Alias;
|
import alias.Alias;
|
||||||
import alias.AliasList;
|
import alias.AliasList;
|
||||||
|
|
||||||
@@ -150,7 +150,7 @@ public class MDCDecoderState extends DecoderState
|
|||||||
public void setFrom( String from )
|
public void setFrom( String from )
|
||||||
{
|
{
|
||||||
mFrom = from;
|
mFrom = from;
|
||||||
broadcast( ChangedAttribute.FROM_TALKGROUP );
|
broadcast( Attribute.FROM_TALKGROUP );
|
||||||
}
|
}
|
||||||
|
|
||||||
public Alias getFromAlias()
|
public Alias getFromAlias()
|
||||||
@@ -161,7 +161,7 @@ public class MDCDecoderState extends DecoderState
|
|||||||
public void setFromAlias( Alias alias )
|
public void setFromAlias( Alias alias )
|
||||||
{
|
{
|
||||||
mFromAlias = alias;
|
mFromAlias = alias;
|
||||||
broadcast( ChangedAttribute.FROM_TALKGROUP_ALIAS );
|
broadcast( Attribute.FROM_TALKGROUP_ALIAS );
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getTo()
|
public String getTo()
|
||||||
@@ -172,7 +172,7 @@ public class MDCDecoderState extends DecoderState
|
|||||||
public void setTo( String to )
|
public void setTo( String to )
|
||||||
{
|
{
|
||||||
mTo = to;
|
mTo = to;
|
||||||
broadcast( ChangedAttribute.TO_TALKGROUP );
|
broadcast( Attribute.TO_TALKGROUP );
|
||||||
}
|
}
|
||||||
|
|
||||||
public Alias getToAlias()
|
public Alias getToAlias()
|
||||||
@@ -183,7 +183,7 @@ public class MDCDecoderState extends DecoderState
|
|||||||
public void setToAlias( Alias alias )
|
public void setToAlias( Alias alias )
|
||||||
{
|
{
|
||||||
mToAlias = alias;
|
mToAlias = alias;
|
||||||
broadcast( ChangedAttribute.TO_TALKGROUP_ALIAS );
|
broadcast( Attribute.TO_TALKGROUP_ALIAS );
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getMessage()
|
public String getMessage()
|
||||||
@@ -194,7 +194,7 @@ public class MDCDecoderState extends DecoderState
|
|||||||
public void setMessage( String message )
|
public void setMessage( String message )
|
||||||
{
|
{
|
||||||
mMessage = message;
|
mMessage = message;
|
||||||
broadcast( ChangedAttribute.MESSAGE );
|
broadcast( Attribute.MESSAGE );
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getMessageType()
|
public String getMessageType()
|
||||||
@@ -205,7 +205,7 @@ public class MDCDecoderState extends DecoderState
|
|||||||
public void setMessageType( String type )
|
public void setMessageType( String type )
|
||||||
{
|
{
|
||||||
mMessageType = type;
|
mMessageType = type;
|
||||||
broadcast( ChangedAttribute.MESSAGE_TYPE );
|
broadcast( Attribute.MESSAGE_TYPE );
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -20,8 +20,8 @@ package module.decode.mpt1327;
|
|||||||
|
|
||||||
import controller.channel.Channel.ChannelType;
|
import controller.channel.Channel.ChannelType;
|
||||||
import icon.IconManager;
|
import icon.IconManager;
|
||||||
import module.decode.state.ChangedAttribute;
|
import channel.metadata.Attribute;
|
||||||
import module.decode.state.DecoderPanel;
|
import channel.state.DecoderPanel;
|
||||||
import net.miginfocom.swing.MigLayout;
|
import net.miginfocom.swing.MigLayout;
|
||||||
import settings.ColorSetting;
|
import settings.ColorSetting;
|
||||||
import settings.Setting;
|
import settings.Setting;
|
||||||
@@ -120,7 +120,7 @@ public class MPT1327DecoderPanel extends DecoderPanel
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void receive(final ChangedAttribute changedAttribute)
|
public void receive(final Attribute attribute)
|
||||||
{
|
{
|
||||||
final MPT1327DecoderState state = getDecoderState();
|
final MPT1327DecoderState state = getDecoderState();
|
||||||
|
|
||||||
@@ -129,7 +129,7 @@ public class MPT1327DecoderPanel extends DecoderPanel
|
|||||||
@Override
|
@Override
|
||||||
public void run()
|
public void run()
|
||||||
{
|
{
|
||||||
switch(changedAttribute)
|
switch(attribute)
|
||||||
{
|
{
|
||||||
case CHANNEL_SITE_NUMBER:
|
case CHANNEL_SITE_NUMBER:
|
||||||
mSiteOrToTalkgroup.setText(String.valueOf(state.getSite()));
|
mSiteOrToTalkgroup.setText(String.valueOf(state.getSite()));
|
||||||
|
|||||||
@@ -31,13 +31,13 @@ import module.decode.config.DecodeConfiguration;
|
|||||||
import module.decode.event.CallEvent;
|
import module.decode.event.CallEvent;
|
||||||
import module.decode.event.CallEvent.CallEventType;
|
import module.decode.event.CallEvent.CallEventType;
|
||||||
import module.decode.mpt1327.MPT1327Message.IdentType;
|
import module.decode.mpt1327.MPT1327Message.IdentType;
|
||||||
import module.decode.state.ChangeChannelTimeoutEvent;
|
import channel.state.ChangeChannelTimeoutEvent;
|
||||||
import module.decode.state.ChangedAttribute;
|
import channel.metadata.Attribute;
|
||||||
import module.decode.state.DecoderState;
|
import channel.state.DecoderState;
|
||||||
import module.decode.state.DecoderStateEvent;
|
import channel.state.DecoderStateEvent;
|
||||||
import module.decode.state.DecoderStateEvent.Event;
|
import channel.state.DecoderStateEvent.Event;
|
||||||
import module.decode.state.State;
|
import channel.state.State;
|
||||||
import module.decode.state.TrafficChannelAllocationEvent;
|
import channel.traffic.TrafficChannelAllocationEvent;
|
||||||
|
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
@@ -184,7 +184,7 @@ public class MPT1327DecoderState extends DecoderState
|
|||||||
if( site != null && ( mSite == null || !site.contentEquals( mSite ) ) )
|
if( site != null && ( mSite == null || !site.contentEquals( mSite ) ) )
|
||||||
{
|
{
|
||||||
mSite = site;
|
mSite = site;
|
||||||
broadcast( ChangedAttribute.CHANNEL_SITE_NUMBER );
|
broadcast( Attribute.CHANNEL_SITE_NUMBER );
|
||||||
}
|
}
|
||||||
mSite = mpt.getSiteID();
|
mSite = mpt.getSiteID();
|
||||||
|
|
||||||
@@ -314,10 +314,10 @@ public class MPT1327DecoderState extends DecoderState
|
|||||||
private void resetState()
|
private void resetState()
|
||||||
{
|
{
|
||||||
mFromTalkgroup = null;
|
mFromTalkgroup = null;
|
||||||
broadcast( ChangedAttribute.FROM_TALKGROUP );
|
broadcast( Attribute.FROM_TALKGROUP );
|
||||||
|
|
||||||
mToTalkgroup = null;
|
mToTalkgroup = null;
|
||||||
broadcast( ChangedAttribute.TO_TALKGROUP );
|
broadcast( Attribute.TO_TALKGROUP );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* If this is a standard channel, reset the fade timeout to the default
|
* If this is a standard channel, reset the fade timeout to the default
|
||||||
@@ -378,7 +378,7 @@ public class MPT1327DecoderState extends DecoderState
|
|||||||
{
|
{
|
||||||
mFromTalkgroup = fromTalkgroup;
|
mFromTalkgroup = fromTalkgroup;
|
||||||
|
|
||||||
broadcast( ChangedAttribute.FROM_TALKGROUP );
|
broadcast( Attribute.FROM_TALKGROUP );
|
||||||
}
|
}
|
||||||
|
|
||||||
public Alias getFromTalkgroupAlias()
|
public Alias getFromTalkgroupAlias()
|
||||||
@@ -405,7 +405,7 @@ public class MPT1327DecoderState extends DecoderState
|
|||||||
{
|
{
|
||||||
mToTalkgroup = toTalkgroup;
|
mToTalkgroup = toTalkgroup;
|
||||||
|
|
||||||
broadcast( ChangedAttribute.TO_TALKGROUP );
|
broadcast( Attribute.TO_TALKGROUP );
|
||||||
}
|
}
|
||||||
|
|
||||||
public Alias getToTalkgroupAlias()
|
public Alias getToTalkgroupAlias()
|
||||||
@@ -432,7 +432,7 @@ public class MPT1327DecoderState extends DecoderState
|
|||||||
{
|
{
|
||||||
mChannelNumber = channel;
|
mChannelNumber = channel;
|
||||||
|
|
||||||
broadcast( ChangedAttribute.CHANNEL_NUMBER );
|
broadcast( Attribute.CHANNEL_NUMBER );
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -590,7 +590,7 @@ public class MPT1327DecoderState extends DecoderState
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
mChannelNumber = Integer.valueOf( channel );
|
mChannelNumber = Integer.valueOf( channel );
|
||||||
broadcast( ChangedAttribute.CHANNEL_NUMBER );
|
broadcast( Attribute.CHANNEL_NUMBER );
|
||||||
}
|
}
|
||||||
catch( Exception e )
|
catch( Exception e )
|
||||||
{
|
{
|
||||||
@@ -599,13 +599,13 @@ public class MPT1327DecoderState extends DecoderState
|
|||||||
}
|
}
|
||||||
|
|
||||||
mFrequency = allocationEvent.getCallEvent().getFrequency();
|
mFrequency = allocationEvent.getCallEvent().getFrequency();
|
||||||
broadcast( ChangedAttribute.SOURCE );
|
broadcast( Attribute.SOURCE );
|
||||||
|
|
||||||
mFromTalkgroup = allocationEvent.getCallEvent().getFromID();
|
mFromTalkgroup = allocationEvent.getCallEvent().getFromID();
|
||||||
broadcast( ChangedAttribute.FROM_TALKGROUP );
|
broadcast( Attribute.FROM_TALKGROUP );
|
||||||
|
|
||||||
mToTalkgroup = allocationEvent.getCallEvent().getToID();
|
mToTalkgroup = allocationEvent.getCallEvent().getToID();
|
||||||
broadcast( ChangedAttribute.TO_TALKGROUP );
|
broadcast( Attribute.TO_TALKGROUP );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -20,8 +20,8 @@ package module.decode.mpt1327;
|
|||||||
|
|
||||||
import alias.Alias;
|
import alias.Alias;
|
||||||
import icon.IconManager;
|
import icon.IconManager;
|
||||||
import module.decode.state.ChangedAttribute;
|
import channel.metadata.Attribute;
|
||||||
import module.decode.state.DecoderPanel;
|
import channel.state.DecoderPanel;
|
||||||
import settings.ColorSetting;
|
import settings.ColorSetting;
|
||||||
import settings.Setting;
|
import settings.Setting;
|
||||||
import settings.SettingsManager;
|
import settings.SettingsManager;
|
||||||
@@ -95,7 +95,7 @@ public class MPT1327TrafficPanel extends DecoderPanel
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void receive(final ChangedAttribute changedAttribute)
|
public void receive(final Attribute attribute)
|
||||||
{
|
{
|
||||||
final MPT1327DecoderState state = getDecoderState();
|
final MPT1327DecoderState state = getDecoderState();
|
||||||
|
|
||||||
@@ -104,7 +104,7 @@ public class MPT1327TrafficPanel extends DecoderPanel
|
|||||||
@Override
|
@Override
|
||||||
public void run()
|
public void run()
|
||||||
{
|
{
|
||||||
switch(changedAttribute)
|
switch(attribute)
|
||||||
{
|
{
|
||||||
case FROM_TALKGROUP:
|
case FROM_TALKGROUP:
|
||||||
String talkgroup = state.getFromTalkgroup();
|
String talkgroup = state.getFromTalkgroup();
|
||||||
|
|||||||
@@ -19,9 +19,9 @@
|
|||||||
package module.decode.nbfm;
|
package module.decode.nbfm;
|
||||||
|
|
||||||
import icon.IconManager;
|
import icon.IconManager;
|
||||||
import module.decode.state.ChangedAttribute;
|
import channel.metadata.Attribute;
|
||||||
import module.decode.state.DecoderPanel;
|
import channel.state.DecoderPanel;
|
||||||
import module.decode.state.DecoderState;
|
import channel.state.DecoderState;
|
||||||
import net.miginfocom.swing.MigLayout;
|
import net.miginfocom.swing.MigLayout;
|
||||||
import settings.ColorSetting;
|
import settings.ColorSetting;
|
||||||
import settings.ColorSetting.ColorSettingName;
|
import settings.ColorSetting.ColorSettingName;
|
||||||
@@ -56,7 +56,7 @@ public class NBFMDecoderPanel extends DecoderPanel
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void receive(ChangedAttribute t)
|
public void receive(Attribute t)
|
||||||
{
|
{
|
||||||
/* Not implemented */
|
/* Not implemented */
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,8 +20,8 @@ package module.decode.p25;
|
|||||||
|
|
||||||
import alias.Alias;
|
import alias.Alias;
|
||||||
import icon.IconManager;
|
import icon.IconManager;
|
||||||
import module.decode.state.ChangedAttribute;
|
import channel.metadata.Attribute;
|
||||||
import module.decode.state.DecoderPanel;
|
import channel.state.DecoderPanel;
|
||||||
import net.miginfocom.swing.MigLayout;
|
import net.miginfocom.swing.MigLayout;
|
||||||
import settings.ColorSetting;
|
import settings.ColorSetting;
|
||||||
import settings.Setting;
|
import settings.Setting;
|
||||||
@@ -108,7 +108,7 @@ public class P25DecoderPanel extends DecoderPanel
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void receive(final ChangedAttribute changedAttribute)
|
public void receive(final Attribute attribute)
|
||||||
{
|
{
|
||||||
final P25DecoderState state = getDecoderState();
|
final P25DecoderState state = getDecoderState();
|
||||||
|
|
||||||
@@ -118,7 +118,7 @@ public class P25DecoderPanel extends DecoderPanel
|
|||||||
public void run()
|
public void run()
|
||||||
{
|
{
|
||||||
|
|
||||||
switch(changedAttribute)
|
switch(attribute)
|
||||||
{
|
{
|
||||||
case NAC:
|
case NAC:
|
||||||
mNAC.setText("NAC:" + state.getNAC());
|
mNAC.setText("NAC:" + state.getNAC());
|
||||||
|
|||||||
@@ -123,13 +123,13 @@ import module.decode.p25.reference.IPProtocol;
|
|||||||
import module.decode.p25.reference.LinkControlOpcode;
|
import module.decode.p25.reference.LinkControlOpcode;
|
||||||
import module.decode.p25.reference.Response;
|
import module.decode.p25.reference.Response;
|
||||||
import module.decode.p25.reference.Vendor;
|
import module.decode.p25.reference.Vendor;
|
||||||
import module.decode.state.ChangeChannelTimeoutEvent;
|
import channel.state.ChangeChannelTimeoutEvent;
|
||||||
import module.decode.state.ChangedAttribute;
|
import channel.metadata.Attribute;
|
||||||
import module.decode.state.DecoderState;
|
import channel.state.DecoderState;
|
||||||
import module.decode.state.DecoderStateEvent;
|
import channel.state.DecoderStateEvent;
|
||||||
import module.decode.state.DecoderStateEvent.Event;
|
import channel.state.DecoderStateEvent.Event;
|
||||||
import module.decode.state.State;
|
import channel.state.State;
|
||||||
import module.decode.state.TrafficChannelAllocationEvent;
|
import channel.traffic.TrafficChannelAllocationEvent;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
@@ -236,16 +236,16 @@ public class P25DecoderState extends DecoderState
|
|||||||
private void resetState()
|
private void resetState()
|
||||||
{
|
{
|
||||||
mFromTalkgroup = null;
|
mFromTalkgroup = null;
|
||||||
broadcast(ChangedAttribute.FROM_TALKGROUP);
|
broadcast(Attribute.FROM_TALKGROUP);
|
||||||
|
|
||||||
mFromAlias = null;
|
mFromAlias = null;
|
||||||
broadcast(ChangedAttribute.FROM_TALKGROUP_ALIAS);
|
broadcast(Attribute.FROM_TALKGROUP_ALIAS);
|
||||||
|
|
||||||
mToTalkgroup = null;
|
mToTalkgroup = null;
|
||||||
broadcast(ChangedAttribute.TO_TALKGROUP);
|
broadcast(Attribute.TO_TALKGROUP);
|
||||||
|
|
||||||
mToAlias = null;
|
mToAlias = null;
|
||||||
broadcast(ChangedAttribute.TO_TALKGROUP_ALIAS);
|
broadcast(Attribute.TO_TALKGROUP_ALIAS);
|
||||||
|
|
||||||
mCallDetectTalkgroups.clear();
|
mCallDetectTalkgroups.clear();
|
||||||
|
|
||||||
@@ -3372,7 +3372,7 @@ public class P25DecoderState extends DecoderState
|
|||||||
{
|
{
|
||||||
mToTalkgroup = to;
|
mToTalkgroup = to;
|
||||||
|
|
||||||
broadcast(ChangedAttribute.TO_TALKGROUP);
|
broadcast(Attribute.TO_TALKGROUP);
|
||||||
|
|
||||||
if(hasAliasList())
|
if(hasAliasList())
|
||||||
{
|
{
|
||||||
@@ -3383,7 +3383,7 @@ public class P25DecoderState extends DecoderState
|
|||||||
mToAlias = null;
|
mToAlias = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
broadcast(ChangedAttribute.TO_TALKGROUP_ALIAS);
|
broadcast(Attribute.TO_TALKGROUP_ALIAS);
|
||||||
|
|
||||||
/* Send audio metadata update */
|
/* Send audio metadata update */
|
||||||
broadcast(new Metadata(MetadataType.TO, mToTalkgroup, mToAlias, true));
|
broadcast(new Metadata(MetadataType.TO, mToTalkgroup, mToAlias, true));
|
||||||
@@ -3409,7 +3409,7 @@ public class P25DecoderState extends DecoderState
|
|||||||
if(mFromTalkgroup == null || !mFromTalkgroup.contentEquals(from))
|
if(mFromTalkgroup == null || !mFromTalkgroup.contentEquals(from))
|
||||||
{
|
{
|
||||||
mFromTalkgroup = from;
|
mFromTalkgroup = from;
|
||||||
broadcast(ChangedAttribute.FROM_TALKGROUP);
|
broadcast(Attribute.FROM_TALKGROUP);
|
||||||
|
|
||||||
if(hasAliasList())
|
if(hasAliasList())
|
||||||
{
|
{
|
||||||
@@ -3420,7 +3420,7 @@ public class P25DecoderState extends DecoderState
|
|||||||
mFromAlias = null;
|
mFromAlias = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
broadcast(ChangedAttribute.FROM_TALKGROUP_ALIAS);
|
broadcast(Attribute.FROM_TALKGROUP_ALIAS);
|
||||||
|
|
||||||
/* Send audio metadata update */
|
/* Send audio metadata update */
|
||||||
broadcast(new Metadata(MetadataType.FROM, mFromTalkgroup, mFromAlias, true));
|
broadcast(new Metadata(MetadataType.FROM, mFromTalkgroup, mFromAlias, true));
|
||||||
@@ -3446,7 +3446,7 @@ public class P25DecoderState extends DecoderState
|
|||||||
{
|
{
|
||||||
mNAC = nac;
|
mNAC = nac;
|
||||||
|
|
||||||
broadcast(ChangedAttribute.NAC);
|
broadcast(Attribute.NAC);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3459,7 +3459,7 @@ public class P25DecoderState extends DecoderState
|
|||||||
{
|
{
|
||||||
mSite = site;
|
mSite = site;
|
||||||
|
|
||||||
broadcast(ChangedAttribute.SITE);
|
broadcast(Attribute.SITE);
|
||||||
|
|
||||||
if(hasAliasList())
|
if(hasAliasList())
|
||||||
{
|
{
|
||||||
@@ -3475,7 +3475,7 @@ public class P25DecoderState extends DecoderState
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
broadcast(ChangedAttribute.SITE_ALIAS);
|
broadcast(Attribute.SITE_ALIAS);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3485,7 +3485,7 @@ public class P25DecoderState extends DecoderState
|
|||||||
{
|
{
|
||||||
mSystem = system;
|
mSystem = system;
|
||||||
|
|
||||||
broadcast(ChangedAttribute.SYSTEM);
|
broadcast(Attribute.SYSTEM);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3816,26 +3816,26 @@ public class P25DecoderState extends DecoderState
|
|||||||
mCurrentCallEvent = (P25CallEvent) allocationEvent.getCallEvent();
|
mCurrentCallEvent = (P25CallEvent) allocationEvent.getCallEvent();
|
||||||
|
|
||||||
mCurrentChannel = allocationEvent.getCallEvent().getChannel();
|
mCurrentChannel = allocationEvent.getCallEvent().getChannel();
|
||||||
broadcast(ChangedAttribute.CHANNEL_NUMBER);
|
broadcast(Attribute.CHANNEL_NUMBER);
|
||||||
|
|
||||||
mCurrentChannelFrequency = allocationEvent.getCallEvent().getFrequency();
|
mCurrentChannelFrequency = allocationEvent.getCallEvent().getFrequency();
|
||||||
broadcast(ChangedAttribute.SOURCE);
|
broadcast(Attribute.SOURCE);
|
||||||
|
|
||||||
mFromTalkgroup = allocationEvent.getCallEvent().getFromID();
|
mFromTalkgroup = allocationEvent.getCallEvent().getFromID();
|
||||||
broadcast(ChangedAttribute.FROM_TALKGROUP);
|
broadcast(Attribute.FROM_TALKGROUP);
|
||||||
|
|
||||||
mToTalkgroup = allocationEvent.getCallEvent().getToID();
|
mToTalkgroup = allocationEvent.getCallEvent().getToID();
|
||||||
broadcast(ChangedAttribute.TO_TALKGROUP);
|
broadcast(Attribute.TO_TALKGROUP);
|
||||||
|
|
||||||
if(allocationEvent.getCallEvent().hasAliasList())
|
if(allocationEvent.getCallEvent().hasAliasList())
|
||||||
{
|
{
|
||||||
AliasList aliasList = allocationEvent.getCallEvent().getAliasList();
|
AliasList aliasList = allocationEvent.getCallEvent().getAliasList();
|
||||||
|
|
||||||
mFromAlias = aliasList.getTalkgroupAlias(mFromTalkgroup);
|
mFromAlias = aliasList.getTalkgroupAlias(mFromTalkgroup);
|
||||||
broadcast(ChangedAttribute.FROM_TALKGROUP_ALIAS);
|
broadcast(Attribute.FROM_TALKGROUP_ALIAS);
|
||||||
|
|
||||||
mToAlias = aliasList.getTalkgroupAlias(mToTalkgroup);
|
mToAlias = aliasList.getTalkgroupAlias(mToTalkgroup);
|
||||||
broadcast(ChangedAttribute.TO_TALKGROUP_ALIAS);
|
broadcast(Attribute.TO_TALKGROUP_ALIAS);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,8 +20,8 @@ package module.decode.passport;
|
|||||||
|
|
||||||
import alias.Alias;
|
import alias.Alias;
|
||||||
import icon.IconManager;
|
import icon.IconManager;
|
||||||
import module.decode.state.ChangedAttribute;
|
import channel.metadata.Attribute;
|
||||||
import module.decode.state.DecoderPanel;
|
import channel.state.DecoderPanel;
|
||||||
import net.miginfocom.swing.MigLayout;
|
import net.miginfocom.swing.MigLayout;
|
||||||
import settings.ColorSetting;
|
import settings.ColorSetting;
|
||||||
import settings.Setting;
|
import settings.Setting;
|
||||||
@@ -93,7 +93,7 @@ public class PassportDecoderPanel extends DecoderPanel
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void receive(final ChangedAttribute changedAttribute)
|
public void receive(final Attribute attribute)
|
||||||
{
|
{
|
||||||
EventQueue.invokeLater(new Runnable()
|
EventQueue.invokeLater(new Runnable()
|
||||||
{
|
{
|
||||||
@@ -102,7 +102,7 @@ public class PassportDecoderPanel extends DecoderPanel
|
|||||||
{
|
{
|
||||||
PassportDecoderState state = getDecoderState();
|
PassportDecoderState state = getDecoderState();
|
||||||
|
|
||||||
switch(changedAttribute)
|
switch(attribute)
|
||||||
{
|
{
|
||||||
case TO_TALKGROUP:
|
case TO_TALKGROUP:
|
||||||
String tg = state.getTalkgroup();
|
String tg = state.getTalkgroup();
|
||||||
|
|||||||
@@ -29,11 +29,11 @@ import message.Message;
|
|||||||
import module.decode.DecoderType;
|
import module.decode.DecoderType;
|
||||||
import module.decode.event.CallEvent;
|
import module.decode.event.CallEvent;
|
||||||
import module.decode.event.CallEvent.CallEventType;
|
import module.decode.event.CallEvent.CallEventType;
|
||||||
import module.decode.state.ChangedAttribute;
|
import channel.metadata.Attribute;
|
||||||
import module.decode.state.DecoderState;
|
import channel.state.DecoderState;
|
||||||
import module.decode.state.DecoderStateEvent;
|
import channel.state.DecoderStateEvent;
|
||||||
import module.decode.state.DecoderStateEvent.Event;
|
import channel.state.DecoderStateEvent.Event;
|
||||||
import module.decode.state.State;
|
import channel.state.State;
|
||||||
|
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
@@ -390,7 +390,7 @@ public class PassportDecoderState extends DecoderState
|
|||||||
|
|
||||||
mChannelNumber = mSiteBand.getChannel( mFrequency );
|
mChannelNumber = mSiteBand.getChannel( mFrequency );
|
||||||
|
|
||||||
broadcast( ChangedAttribute.CHANNEL_NUMBER );
|
broadcast( Attribute.CHANNEL_NUMBER );
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
@@ -570,7 +570,7 @@ public class PassportDecoderState extends DecoderState
|
|||||||
public void setTalkgroup( String talkgroup )
|
public void setTalkgroup( String talkgroup )
|
||||||
{
|
{
|
||||||
mTalkgroup = talkgroup;
|
mTalkgroup = talkgroup;
|
||||||
broadcast( ChangedAttribute.TO_TALKGROUP );
|
broadcast( Attribute.TO_TALKGROUP );
|
||||||
}
|
}
|
||||||
|
|
||||||
public Alias getTalkgroupAlias()
|
public Alias getTalkgroupAlias()
|
||||||
@@ -581,7 +581,7 @@ public class PassportDecoderState extends DecoderState
|
|||||||
public void setTalkgroupAlias( Alias alias )
|
public void setTalkgroupAlias( Alias alias )
|
||||||
{
|
{
|
||||||
mTalkgroupAlias = alias;
|
mTalkgroupAlias = alias;
|
||||||
broadcast( ChangedAttribute.TO_TALKGROUP_ALIAS );
|
broadcast( Attribute.TO_TALKGROUP_ALIAS );
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getMobileID()
|
public String getMobileID()
|
||||||
@@ -592,7 +592,7 @@ public class PassportDecoderState extends DecoderState
|
|||||||
public void setMobileID( String id )
|
public void setMobileID( String id )
|
||||||
{
|
{
|
||||||
mMobileID = id;
|
mMobileID = id;
|
||||||
broadcast( ChangedAttribute.FROM_TALKGROUP );
|
broadcast( Attribute.FROM_TALKGROUP );
|
||||||
}
|
}
|
||||||
|
|
||||||
public Alias getMobileIDAlias()
|
public Alias getMobileIDAlias()
|
||||||
@@ -603,7 +603,7 @@ public class PassportDecoderState extends DecoderState
|
|||||||
public void setMobileIDAlias( Alias alias )
|
public void setMobileIDAlias( Alias alias )
|
||||||
{
|
{
|
||||||
mMobileIDAlias = alias;
|
mMobileIDAlias = alias;
|
||||||
broadcast( ChangedAttribute.FROM_TALKGROUP_ALIAS );
|
broadcast( Attribute.FROM_TALKGROUP_ALIAS );
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -1,29 +0,0 @@
|
|||||||
package module.decode.state;
|
|
||||||
|
|
||||||
public enum ChangedAttribute
|
|
||||||
{
|
|
||||||
AUDIO_TYPE,
|
|
||||||
CHANNEL_NUMBER,
|
|
||||||
CHANNEL_NAME,
|
|
||||||
CHANNEL_SITE_NUMBER,
|
|
||||||
CHANNEL_SITE_NUMBER_ALIAS,
|
|
||||||
CHANNEL_STATE,
|
|
||||||
DESCRIPTION,
|
|
||||||
FROM_TALKGROUP,
|
|
||||||
FROM_TALKGROUP_ALIAS,
|
|
||||||
FROM_TALKGROUP_TYPE,
|
|
||||||
MESSAGE,
|
|
||||||
MESSAGE_TYPE,
|
|
||||||
NAC,
|
|
||||||
SITE,
|
|
||||||
SITE_ALIAS,
|
|
||||||
SITE_NAME,
|
|
||||||
SOURCE,
|
|
||||||
SYSTEM,
|
|
||||||
SYSTEM_NAME,
|
|
||||||
SQUELCH,
|
|
||||||
TO_TALKGROUP,
|
|
||||||
TO_TALKGROUP_ALIAS,
|
|
||||||
TO_TALKGROUP_TYPE,
|
|
||||||
WACN;
|
|
||||||
}
|
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
package module.decode.state;
|
|
||||||
|
|
||||||
import sample.Listener;
|
|
||||||
|
|
||||||
public interface IChangedAttributeListener
|
|
||||||
{
|
|
||||||
public Listener<ChangedAttribute> getChangedAttributeListener();
|
|
||||||
}
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
package module.decode.state;
|
|
||||||
|
|
||||||
import sample.Listener;
|
|
||||||
|
|
||||||
public interface IChangedAttributeProvider
|
|
||||||
{
|
|
||||||
public void setChangedAttributeListener( Listener<ChangedAttribute> listener );
|
|
||||||
public void removeChangedAttributeListener();
|
|
||||||
}
|
|
||||||
@@ -1,25 +0,0 @@
|
|||||||
package module.decode.state;
|
|
||||||
|
|
||||||
import module.decode.event.CallEvent;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Traffic channel allocation event wraps a call event indicating the channel
|
|
||||||
* and frequency for a traffic channel allocation event, so that the traffic
|
|
||||||
* channel manager can respond and allocate a decoder channel and source if
|
|
||||||
* available, or change the wrapped call event to a call detect event and log it.
|
|
||||||
*/
|
|
||||||
public class TrafficChannelAllocationEvent extends DecoderStateEvent
|
|
||||||
{
|
|
||||||
private CallEvent mCallEvent;
|
|
||||||
|
|
||||||
public TrafficChannelAllocationEvent( Object source, CallEvent callEvent )
|
|
||||||
{
|
|
||||||
super( source, Event.TRAFFIC_CHANNEL_ALLOCATION, State.CALL );
|
|
||||||
mCallEvent = callEvent;
|
|
||||||
}
|
|
||||||
|
|
||||||
public CallEvent getCallEvent()
|
|
||||||
{
|
|
||||||
return mCallEvent;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -20,8 +20,8 @@ package module.decode.tait;
|
|||||||
|
|
||||||
import alias.Alias;
|
import alias.Alias;
|
||||||
import icon.IconManager;
|
import icon.IconManager;
|
||||||
import module.decode.state.ChangedAttribute;
|
import channel.metadata.Attribute;
|
||||||
import module.decode.state.DecoderPanel;
|
import channel.state.DecoderPanel;
|
||||||
import net.miginfocom.swing.MigLayout;
|
import net.miginfocom.swing.MigLayout;
|
||||||
import settings.ColorSetting;
|
import settings.ColorSetting;
|
||||||
import settings.ColorSetting.ColorSettingName;
|
import settings.ColorSetting.ColorSettingName;
|
||||||
@@ -87,14 +87,14 @@ public class Tait1200DecoderPanel extends DecoderPanel
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void receive(final ChangedAttribute changedAttribute)
|
public void receive(final Attribute attribute)
|
||||||
{
|
{
|
||||||
EventQueue.invokeLater(new Runnable()
|
EventQueue.invokeLater(new Runnable()
|
||||||
{
|
{
|
||||||
@Override
|
@Override
|
||||||
public void run()
|
public void run()
|
||||||
{
|
{
|
||||||
switch(changedAttribute)
|
switch(attribute)
|
||||||
{
|
{
|
||||||
case FROM_TALKGROUP:
|
case FROM_TALKGROUP:
|
||||||
String from = getDecoderState().getFromID();
|
String from = getDecoderState().getFromID();
|
||||||
|
|||||||
@@ -28,11 +28,11 @@ import org.jdesktop.swingx.mapviewer.GeoPosition;
|
|||||||
import message.Message;
|
import message.Message;
|
||||||
import module.decode.DecoderType;
|
import module.decode.DecoderType;
|
||||||
import module.decode.event.CallEvent.CallEventType;
|
import module.decode.event.CallEvent.CallEventType;
|
||||||
import module.decode.state.ChangedAttribute;
|
import channel.metadata.Attribute;
|
||||||
import module.decode.state.DecoderState;
|
import channel.state.DecoderState;
|
||||||
import module.decode.state.DecoderStateEvent;
|
import channel.state.DecoderStateEvent;
|
||||||
import module.decode.state.State;
|
import channel.state.State;
|
||||||
import module.decode.state.DecoderStateEvent.Event;
|
import channel.state.DecoderStateEvent.Event;
|
||||||
import alias.Alias;
|
import alias.Alias;
|
||||||
import alias.AliasList;
|
import alias.AliasList;
|
||||||
|
|
||||||
@@ -208,7 +208,7 @@ public class Tait1200DecoderState extends DecoderState
|
|||||||
public void setFromID( String from )
|
public void setFromID( String from )
|
||||||
{
|
{
|
||||||
mFrom = from;
|
mFrom = from;
|
||||||
broadcast( ChangedAttribute.FROM_TALKGROUP );
|
broadcast( Attribute.FROM_TALKGROUP );
|
||||||
}
|
}
|
||||||
|
|
||||||
public Alias getFromIDAlias()
|
public Alias getFromIDAlias()
|
||||||
@@ -219,7 +219,7 @@ public class Tait1200DecoderState extends DecoderState
|
|||||||
public void setFromIDAlias( Alias alias )
|
public void setFromIDAlias( Alias alias )
|
||||||
{
|
{
|
||||||
mFromAlias = alias;
|
mFromAlias = alias;
|
||||||
broadcast( ChangedAttribute.FROM_TALKGROUP_ALIAS );
|
broadcast( Attribute.FROM_TALKGROUP_ALIAS );
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getToID()
|
public String getToID()
|
||||||
@@ -230,7 +230,7 @@ public class Tait1200DecoderState extends DecoderState
|
|||||||
public void setToID( String to )
|
public void setToID( String to )
|
||||||
{
|
{
|
||||||
mTo = to;
|
mTo = to;
|
||||||
broadcast( ChangedAttribute.TO_TALKGROUP );
|
broadcast( Attribute.TO_TALKGROUP );
|
||||||
}
|
}
|
||||||
|
|
||||||
public Alias getToIDAlias()
|
public Alias getToIDAlias()
|
||||||
@@ -241,7 +241,7 @@ public class Tait1200DecoderState extends DecoderState
|
|||||||
public void setToIDAlias( Alias alias )
|
public void setToIDAlias( Alias alias )
|
||||||
{
|
{
|
||||||
mToAlias = alias;
|
mToAlias = alias;
|
||||||
broadcast( ChangedAttribute.TO_TALKGROUP_ALIAS );
|
broadcast( Attribute.TO_TALKGROUP_ALIAS );
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getMessage()
|
public String getMessage()
|
||||||
@@ -252,7 +252,7 @@ public class Tait1200DecoderState extends DecoderState
|
|||||||
public void setMessage( String message )
|
public void setMessage( String message )
|
||||||
{
|
{
|
||||||
mMessage = message;
|
mMessage = message;
|
||||||
broadcast( ChangedAttribute.MESSAGE );
|
broadcast( Attribute.MESSAGE );
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getMessageType()
|
public String getMessageType()
|
||||||
@@ -263,6 +263,6 @@ public class Tait1200DecoderState extends DecoderState
|
|||||||
public void setMessageType( String type )
|
public void setMessageType( String type )
|
||||||
{
|
{
|
||||||
mMessageType = type;
|
mMessageType = type;
|
||||||
broadcast( ChangedAttribute.MESSAGE_TYPE );
|
broadcast( Attribute.MESSAGE_TYPE );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user