mirror of
https://github.com/DSheirer/sdrtrunk.git
synced 2026-11-12 16:47:31 -05:00
Work in progress
This commit is contained in:
@@ -224,13 +224,19 @@ public class ChannelState extends Module implements ICallEventProvider,
|
||||
* don't have signaling on the traffic channel that can be used to
|
||||
* update the fade timeout, so we set the timeout value larger to ensure
|
||||
* the channel doesn't fade before the end of the call. */
|
||||
long timeout = System.currentTimeMillis() +
|
||||
long current = System.currentTimeMillis();
|
||||
|
||||
long timeout = current +
|
||||
( mChannelType == ChannelType.STANDARD ? FADE_TIMEOUT_DELAY :
|
||||
mTrafficChannelTimeout );
|
||||
|
||||
|
||||
mLog.debug( "Updating Fade Timeout - previous [" + mFadeTimeout + "] new [" + timeout + "] current [" + current + "] delay [" + ( mChannelType == ChannelType.STANDARD ? FADE_TIMEOUT_DELAY :
|
||||
mTrafficChannelTimeout ) + "]" );
|
||||
|
||||
if( timeout > mFadeTimeout )
|
||||
{
|
||||
mFadeTimeout = timeout;
|
||||
mLog.debug( "Timeout updated to: " + mFadeTimeout );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -301,6 +307,7 @@ public class ChannelState extends Module implements ICallEventProvider,
|
||||
case CONTROL:
|
||||
case DATA:
|
||||
case ENCRYPTED:
|
||||
mLog.debug( "Squelching for [" + state + "]" );
|
||||
broadcast( SquelchState.SQUELCH );
|
||||
updateFadeTimeout();
|
||||
startMonitor();
|
||||
@@ -311,16 +318,19 @@ public class ChannelState extends Module implements ICallEventProvider,
|
||||
startMonitor();
|
||||
break;
|
||||
case FADE:
|
||||
mLog.debug( "Squelching for [" + state + "]" );
|
||||
broadcast( SquelchState.SQUELCH );
|
||||
updateResetTimeout();
|
||||
startMonitor();
|
||||
break;
|
||||
case END:
|
||||
mLog.debug( "Squelching for [" + state + "]" );
|
||||
broadcast( SquelchState.SQUELCH );
|
||||
broadcast( new DecoderStateEvent( this, Event.RESET, State.IDLE ) );
|
||||
broadcast( new MetadataReset() );
|
||||
break;
|
||||
case IDLE:
|
||||
mLog.debug( "Squelching for [" + state + "]" );
|
||||
broadcast( SquelchState.SQUELCH );
|
||||
stopMonitor();
|
||||
|
||||
@@ -371,6 +381,7 @@ public class ChannelState extends Module implements ICallEventProvider,
|
||||
{
|
||||
if( mFadeTimeout <= System.currentTimeMillis() )
|
||||
{
|
||||
mLog.debug( "Fading for timeout [" + mFadeTimeout + "] current [" + System.currentTimeMillis() + "]" );
|
||||
setState( State.FADE );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,8 +20,10 @@ package module.decode.state;
|
||||
import java.awt.Color;
|
||||
import java.awt.Font;
|
||||
|
||||
import javax.swing.JLabel;
|
||||
import javax.swing.JPanel;
|
||||
|
||||
import alias.Alias;
|
||||
import module.decode.Decoder;
|
||||
import sample.Listener;
|
||||
import settings.ColorSetting;
|
||||
@@ -37,7 +39,7 @@ public abstract class DecoderPanel extends JPanel
|
||||
|
||||
protected Font mFontDetails = new Font( Font.MONOSPACED, Font.PLAIN, 12 );
|
||||
protected Font mFontDecoder = new Font( Font.MONOSPACED, Font.PLAIN, 12 );
|
||||
protected Font mFontAuxDecoder = new Font( Font.MONOSPACED, Font.PLAIN, 12 );
|
||||
protected Font mFontAuxDecoder = new Font( Font.MONOSPACED, Font.PLAIN, 10 );
|
||||
public static final int ICON_SIZE = 12;
|
||||
|
||||
protected Color mColorLabelDetails;
|
||||
@@ -118,4 +120,42 @@ public abstract class DecoderPanel extends JPanel
|
||||
|
||||
@Override
|
||||
public void settingDeleted( Setting setting ) {}
|
||||
|
||||
protected void setAliasLabel( final JLabel label, final Alias alias )
|
||||
{
|
||||
setAliasLabel( label, alias, true );
|
||||
}
|
||||
|
||||
protected void setAliasLabel( final JLabel label, final Alias alias, boolean includeIcon )
|
||||
{
|
||||
if( alias != null )
|
||||
{
|
||||
label.setText( alias.getName() );
|
||||
|
||||
if( includeIcon )
|
||||
{
|
||||
String iconName = alias.getIconName();
|
||||
|
||||
if( iconName != null )
|
||||
{
|
||||
label.setIcon( mSettingsManager
|
||||
.getImageIcon( iconName, SettingsManager.DEFAULT_ICON_SIZE ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
label.setIcon( null );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
label.setIcon( null );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
label.setText( "" );
|
||||
label.setIcon( null );
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user