mirror of
https://github.com/DSheirer/sdrtrunk.git
synced 2026-11-12 16:47:31 -05:00
Updated P25 channel display to show relevant site information.
Changed Site ID Alias to a string from integer to support P25 style site identifiers (RFSS-Site)
This commit is contained in:
@@ -57,7 +57,7 @@ public class AliasList implements Comparable<AliasList>
|
||||
private HashMap<String,Alias> mMDC1200 = new HashMap<String,Alias>();
|
||||
private HashMap<String,Alias> mMobileID = new HashMap<String,Alias>();
|
||||
private HashMap<String,Alias> mMPT1327 = new HashMap<String,Alias>();
|
||||
private HashMap<Integer, Alias> mSiteID = new HashMap<Integer,Alias>();
|
||||
private HashMap<String, Alias> mSiteID = new HashMap<String,Alias>();
|
||||
private HashMap<Integer, Alias> mStatus = new HashMap<Integer,Alias>();
|
||||
private HashMap<String,Alias> mTalkgroup = new HashMap<String,Alias>();
|
||||
private HashMap<Integer,Alias> mUniqueID = new HashMap<Integer,Alias>();
|
||||
@@ -203,7 +203,7 @@ public class AliasList implements Comparable<AliasList>
|
||||
}
|
||||
}
|
||||
|
||||
public Alias getSiteID( int siteID )
|
||||
public Alias getSiteID( String siteID )
|
||||
{
|
||||
return mSiteID.get( siteID );
|
||||
}
|
||||
|
||||
@@ -24,21 +24,21 @@ import alias.AliasIDType;
|
||||
|
||||
public class SiteID extends AliasID
|
||||
{
|
||||
private int mSite;
|
||||
private String mSite;
|
||||
|
||||
public SiteID()
|
||||
{
|
||||
}
|
||||
|
||||
@XmlAttribute
|
||||
public int getSite()
|
||||
public String getSite()
|
||||
{
|
||||
return mSite;
|
||||
}
|
||||
|
||||
public void setSite( int site )
|
||||
public void setSite( String site )
|
||||
{
|
||||
this.mSite = site;
|
||||
mSite = site;
|
||||
}
|
||||
|
||||
public String toString()
|
||||
@@ -47,18 +47,11 @@ public class SiteID extends AliasID
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean matches( AliasID id )
|
||||
public boolean matches( AliasID otherID )
|
||||
{
|
||||
boolean retVal = false;
|
||||
|
||||
if( id instanceof SiteID )
|
||||
{
|
||||
SiteID uid = (SiteID)id;
|
||||
|
||||
retVal = ( mSite == uid.getSite() );
|
||||
}
|
||||
|
||||
return retVal;
|
||||
return otherID != null &&
|
||||
otherID instanceof SiteID &&
|
||||
getSite().contentEquals( ( (SiteID)otherID).getSite() );
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -24,6 +24,7 @@ import javax.swing.JButton;
|
||||
import javax.swing.JLabel;
|
||||
import javax.swing.JOptionPane;
|
||||
import javax.swing.JPanel;
|
||||
import javax.swing.JTextArea;
|
||||
import javax.swing.JTextField;
|
||||
|
||||
import net.miginfocom.swing.MigLayout;
|
||||
@@ -31,16 +32,12 @@ import net.miginfocom.swing.MigLayout;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import controller.ConfigurableNode;
|
||||
|
||||
public class SiteIDEditor extends JPanel implements ActionListener
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
private final static Logger mLog =
|
||||
LoggerFactory.getLogger( SiteIDEditor.class );
|
||||
LoggerFactory.getLogger( SiteIDEditor.class );
|
||||
private SiteIDNode mSiteIDNode;
|
||||
|
||||
private JLabel mLabelName;
|
||||
private JTextField mTextSiteID;
|
||||
|
||||
public SiteIDEditor( SiteIDNode siteIDNode )
|
||||
@@ -52,7 +49,7 @@ public class SiteIDEditor extends JPanel implements ActionListener
|
||||
|
||||
private void initGUI()
|
||||
{
|
||||
setLayout( new MigLayout( "fill,wrap 2", "[right][left]", "[][][][grow]" ) );
|
||||
setLayout( new MigLayout( "fill,wrap 2", "[right][left]", "[][][][][grow]" ) );
|
||||
|
||||
add( new JLabel( "Site ID" ), "span,align center" );
|
||||
|
||||
@@ -61,6 +58,16 @@ public class SiteIDEditor extends JPanel implements ActionListener
|
||||
mTextSiteID = new JTextField(
|
||||
String.valueOf( mSiteIDNode.getSiteID().getSite() ) );
|
||||
add( mTextSiteID, "growx,push" );
|
||||
|
||||
JTextArea description = new JTextArea( "Enter a site number. "
|
||||
+ "For P25 systems, use the format RR-SS, where RR = RF "
|
||||
+ "Subsystem and SS = Site Number. For example, RFSS 1 and "
|
||||
+ "Site 3 would be: 01-03");
|
||||
|
||||
description.setLineWrap( true );
|
||||
description.setBackground( getBackground() );
|
||||
|
||||
add( description, "growx,span" );
|
||||
|
||||
JButton btnSave = new JButton( "Save" );
|
||||
btnSave.addActionListener( SiteIDEditor.this );
|
||||
@@ -82,23 +89,11 @@ public class SiteIDEditor extends JPanel implements ActionListener
|
||||
|
||||
if( siteIDString != null )
|
||||
{
|
||||
try
|
||||
{
|
||||
int id = Integer.parseInt( siteIDString );
|
||||
|
||||
mSiteIDNode.getSiteID().setSite( id );
|
||||
|
||||
((ConfigurableNode)mSiteIDNode.getParent()).sort();
|
||||
mSiteIDNode.getSiteID().setSite( siteIDString );
|
||||
|
||||
mSiteIDNode.save();
|
||||
|
||||
mSiteIDNode.show();
|
||||
}
|
||||
catch( Exception ex )
|
||||
{
|
||||
mLog.error( "SiteIDEditor - error parsing int site " +
|
||||
"id from [" + siteIDString + "]" );
|
||||
}
|
||||
mSiteIDNode.save();
|
||||
|
||||
mSiteIDNode.show();
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -108,8 +103,7 @@ public class SiteIDEditor extends JPanel implements ActionListener
|
||||
}
|
||||
else if( command.contentEquals( "Reset" ) )
|
||||
{
|
||||
mTextSiteID.setText(
|
||||
String.valueOf( mSiteIDNode.getSiteID().getSite() ) );
|
||||
mTextSiteID.setText( mSiteIDNode.getSiteID().getSite() );
|
||||
}
|
||||
|
||||
mSiteIDNode.refresh();
|
||||
|
||||
Reference in New Issue
Block a user