diff --git a/src/module/decode/lj1200/LJ1200DecoderPanel.java b/src/module/decode/lj1200/LJ1200DecoderPanel.java index 600a79c3..8831d79a 100644 --- a/src/module/decode/lj1200/LJ1200DecoderPanel.java +++ b/src/module/decode/lj1200/LJ1200DecoderPanel.java @@ -57,6 +57,15 @@ public class LJ1200DecoderPanel extends DecoderPanel setLayout( new MigLayout( "insets 1 0 0 0", "[grow,fill]", "" ) ); + mProtocol.setFont( mFontDecoder ); + mProtocol.setForeground( mColorLabelDecoder ); + + mTo.setFont( mFontDecoder ); + mTo.setForeground( mColorLabelDecoder ); + + mToAlias.setFont( mFontDecoder ); + mToAlias.setForeground( mColorLabelDecoder ); + add( mProtocol ); add( mTo ); add( mToAlias, "wrap" ); @@ -76,14 +85,19 @@ public class LJ1200DecoderPanel extends DecoderPanel mTo.setText( getDecoderState().getAddress() ); repaint(); break; - case FROM_TALKGROUP_ALIAS: + case TO_TALKGROUP_ALIAS: Alias alias = getDecoderState().getAddressAlias(); if( alias != null ) { mToAlias.setText( alias.getName() ); - repaint(); } + else + { + mToAlias.setText( "" ); + } + + repaint(); break; default: break; diff --git a/src/module/decode/lj1200/LJ1200DecoderState.java b/src/module/decode/lj1200/LJ1200DecoderState.java index 8ec26f0f..0edba1e5 100644 --- a/src/module/decode/lj1200/LJ1200DecoderState.java +++ b/src/module/decode/lj1200/LJ1200DecoderState.java @@ -23,8 +23,12 @@ import java.util.List; import java.util.Set; import java.util.TreeSet; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + import message.Message; import module.decode.DecoderType; +import module.decode.p25.P25DecoderState; import module.decode.state.ChangedAttribute; import module.decode.state.DecoderState; import module.decode.state.DecoderStateEvent; @@ -35,6 +39,8 @@ import alias.AliasList; public class LJ1200DecoderState extends DecoderState { + private final static Logger mLog = LoggerFactory.getLogger( LJ1200DecoderState.class ); + private Set mAddresses = new TreeSet(); private String mAddress; @@ -146,16 +152,22 @@ public class LJ1200DecoderState extends DecoderState { if( event.getEvent() == Event.RESET ) { - + resetState(); } } + + private void resetState() + { + setAddress( null ); + broadcast( ChangedAttribute.TO_TALKGROUP ); + setAddressAlias( null ); + broadcast( ChangedAttribute.TO_TALKGROUP_ALIAS ); + } @Override public void reset() { mAddresses.clear(); - - setAddress( null ); - setAddressAlias( null ); + resetState(); } } diff --git a/src/module/decode/lj1200/LJ1200Message.java b/src/module/decode/lj1200/LJ1200Message.java index 687aee6d..de60cc26 100644 --- a/src/module/decode/lj1200/LJ1200Message.java +++ b/src/module/decode/lj1200/LJ1200Message.java @@ -138,11 +138,19 @@ public class LJ1200Message extends Message public Alias getSiteAndReplyCodeAlias() { - if( mAliasList != null && - ( getFunction() == Function.F1_SITE_ID || - getFunction() == Function.F1_SPEED_UP ) ) + Function function = getFunction(); + + if( mAliasList != null ) { - return mAliasList.getSiteID( getReplyCode() ); + if( function == Function.F1_SITE_ID || + function == Function.F1_SPEED_UP || + function == Function.F2_TEST || + function == Function.F3_DEACTIVATE || + function == Function.F4_ACTIVATE || + function == Function.FF_TRACK_PULSE ) + { + return mAliasList.getSiteID( getReplyCode() ); + } } return null;