#90 [WIP] merged metadata management for channel state, decoder states and audio metadata into a new metadata class. The new metadata class is maintained for each decoding audio channel, or in the future, a decoding TDMA channel. Audio playback, recording and streaming all use the same metadata object for the channel. The list of channel processing gui panels have been deleted and channel processing status will now reside in a table where each table row is a metadata instance from the processing channel. The channel processing manager is responsible for adding/removing the channel's metadata instance to/from the metadata table. This allows the channel processing table to be the controller for the messages, events and channel spectrum views, keyed to the selected table row metadata.

I still have to clean up the gui components and wire in the table selection listeners.
This commit is contained in:
Denny
2017-01-17 19:24:54 -05:00
parent 16b69d4aef
commit bc8873de01
67 changed files with 6207 additions and 10127 deletions

View File

@@ -20,42 +20,86 @@ package channel.metadata;
import com.jidesoft.swing.JideSplitPane;
import com.jidesoft.swing.JideTabbedPane;
import controller.channel.ChannelProcessingManager;
import icon.IconManager;
import icon.IconTableModel;
import module.decode.event.CallEventPanel;
import module.decode.event.MessageActivityPanel;
import net.miginfocom.swing.MigLayout;
import settings.SettingsManager;
import spectrum.ChannelSpectrumPanel;
import javax.swing.*;
public class ChannelMetadataViewer extends JPanel
{
private ChannelMetadataModel mChannelMetadataModel;
private IconTableModel mIconTableModel;
private CallEventPanel mCallEventPanel;
private MessageActivityPanel mMessageActivityPanel;
private ChannelSpectrumPanel mChannelSpectrumPanel;
private ChannelMetadataPanel mChannelMetadataPanel;
/**
* 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)
public ChannelMetadataViewer(ChannelProcessingManager channelProcessingManager, IconManager iconManager,
SettingsManager settingsManager)
{
mChannelMetadataModel = channelMetadataModel;
mIconTableModel = iconTableModel;
mCallEventPanel = new CallEventPanel(iconManager, channelProcessingManager);
mMessageActivityPanel = new MessageActivityPanel(channelProcessingManager);
mChannelSpectrumPanel = new ChannelSpectrumPanel(settingsManager, channelProcessingManager);
mChannelMetadataPanel = new ChannelMetadataPanel(channelProcessingManager.getChannelMetadataModel(),
iconManager.getModel());
}
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());
tabbedPane.addTab("Events", mCallEventPanel);
tabbedPane.addTab("Messages", mMessageActivityPanel);
tabbedPane.addTab("Spectrum", mChannelSpectrumPanel);
JideSplitPane splitPane = new JideSplitPane(JideSplitPane.VERTICAL_SPLIT);
splitPane.add(channelMetadataPanel);
splitPane.add(mChannelMetadataPanel);
splitPane.add(tabbedPane);
//TODO: move this change listener to the metadata table view
// /**
// * Change listener to enable/disable the channel spectrum display
// * only when the tab is visible, and a channel has been selected
// */
// mTabbedPane.addChangeListener(new ChangeListener()
// {
// @Override
// public void stateChanged(ChangeEvent event)
// {
// int index = mTabbedPane.getSelectedIndex();
//
// Component component = mTabbedPane.getComponentAt(index);
//
// if(component instanceof ChannelSpectrumPanel)
// {
// mChannelSpectrumPanel.setEnabled(true);
// }
// else
// {
// mChannelSpectrumPanel.setEnabled(false);
// }
// }
// });
//TODO: call, message and spectrum should listen to the metadata table now
//
//
// /* Register each of the components to receive channel events when the
// * channels are selected or change */
// mChannelModel.addListener(mCallEventPanel);
// mChannelModel.addListener(mChannelSpectrumPanel);
// mChannelModel.addListener(mMessageActivityPanel);
add(splitPane);
}
}