mirror of
https://github.com/DSheirer/sdrtrunk.git
synced 2026-11-12 08:37:25 -05:00
wip #34 - testing and validating changes and testing decoding.
This commit is contained in:
@@ -173,6 +173,8 @@ public class ChannelEditor extends Editor<Channel> implements ActionListener, Ch
|
||||
{
|
||||
if( hasItem() )
|
||||
{
|
||||
save();
|
||||
|
||||
mChannelEnableRequested = true;
|
||||
mChannelModel.broadcast( new ChannelEvent( getItem(), Event.REQUEST_ENABLE ) );
|
||||
}
|
||||
|
||||
@@ -112,7 +112,7 @@ public class ChannelProcessingManager implements ChannelEventListener
|
||||
if( !mProcessingChains.containsKey( channel.getChannelID() ) ||
|
||||
!mProcessingChains.get( channel.getChannelID() ).isProcessing() )
|
||||
{
|
||||
startProcessing( channel );
|
||||
startProcessing( event );
|
||||
}
|
||||
break;
|
||||
case REQUEST_DISABLE:
|
||||
@@ -141,7 +141,7 @@ public class ChannelProcessingManager implements ChannelEventListener
|
||||
if( isProcessing( channel ) )
|
||||
{
|
||||
stopProcessing( channel, false );
|
||||
startProcessing( channel );
|
||||
startProcessing( event );
|
||||
}
|
||||
break;
|
||||
default:
|
||||
@@ -149,8 +149,10 @@ public class ChannelProcessingManager implements ChannelEventListener
|
||||
}
|
||||
}
|
||||
|
||||
private void startProcessing( Channel channel )
|
||||
private void startProcessing( ChannelEvent event )
|
||||
{
|
||||
Channel channel = event.getChannel();
|
||||
|
||||
ProcessingChain processingChain = mProcessingChains.get( channel.getChannelID() );
|
||||
|
||||
//If we're already processing, ignore the request
|
||||
@@ -256,8 +258,17 @@ public class ChannelProcessingManager implements ChannelEventListener
|
||||
|
||||
processingChain.setSource( source );
|
||||
|
||||
processingChain.start();
|
||||
if( event instanceof TrafficChannelEvent )
|
||||
{
|
||||
TrafficChannelEvent trafficChannelEvent = (TrafficChannelEvent)event;
|
||||
|
||||
processingChain.getChannelState().configureAsTrafficChannel(
|
||||
trafficChannelEvent.getTrafficChannelManager(),
|
||||
trafficChannelEvent.getCallEvent() );
|
||||
}
|
||||
|
||||
processingChain.start();
|
||||
|
||||
channel.setEnabled( true );
|
||||
|
||||
mProcessingChains.put( channel.getChannelID(), processingChain );
|
||||
@@ -276,8 +287,7 @@ public class ChannelProcessingManager implements ChannelEventListener
|
||||
|
||||
chain.stop();
|
||||
|
||||
mChannelModel.broadcast( new ChannelEvent( channel,
|
||||
Event.NOTIFICATION_PROCESSING_STOP ) );
|
||||
mChannelModel.broadcast( new ChannelEvent( channel, Event.NOTIFICATION_PROCESSING_STOP ) );
|
||||
|
||||
if( remove )
|
||||
{
|
||||
|
||||
34
src/controller/channel/TrafficChannelEvent.java
Normal file
34
src/controller/channel/TrafficChannelEvent.java
Normal file
@@ -0,0 +1,34 @@
|
||||
package controller.channel;
|
||||
|
||||
import module.decode.event.CallEvent;
|
||||
import module.decode.state.TrafficChannelManager;
|
||||
|
||||
public class TrafficChannelEvent extends ChannelEvent
|
||||
{
|
||||
private TrafficChannelManager mTrafficChannelManager;
|
||||
private CallEvent mCallEvent;
|
||||
|
||||
/**
|
||||
* Call event with traffic channel manager for call back, and original creation event.
|
||||
*/
|
||||
public TrafficChannelEvent( TrafficChannelManager trafficChannelManager,
|
||||
Channel channel,
|
||||
Event event,
|
||||
CallEvent callEvent )
|
||||
{
|
||||
super( channel, event );
|
||||
|
||||
mTrafficChannelManager = trafficChannelManager;
|
||||
mCallEvent = callEvent;
|
||||
}
|
||||
|
||||
public TrafficChannelManager getTrafficChannelManager()
|
||||
{
|
||||
return mTrafficChannelManager;
|
||||
}
|
||||
|
||||
public CallEvent getCallEvent()
|
||||
{
|
||||
return mCallEvent;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user