edu.nrao.sss.electronics
Class SignalTransferSwitch

java.lang.Object
  extended by edu.nrao.sss.electronics.SignalTransferSwitch
All Implemented Interfaces:
SignalProcessor

public class SignalTransferSwitch
extends Object
implements SignalProcessor

A special kind of switch that provides a one-to-one mapping of its N input poles to its N output poles. A given input may be connected to either its immediate clockwise or immediate counterclockwise neighbor.

The following is an example taken from the EVLA Antenna Block Diagram whose N value is 2:

Version Info:

$Revision: 1035 $
$Date: 2008-01-10 16:49:07 -0700 (Thu, 10 Jan 2008) $
$Author: dharland $ (last person to modify)

Since:
2007-11-02
Author:
David M. Harland

Constructor Summary
SignalTransferSwitch(String deviceName, int numInputs)
          Creates a new transfer switch with the number of input and output poles set to numInputs.
 
Method Summary
 void execute()
          Runs the inputs to this switch from their beginnings and then executes the output pipes of this device.
 void executeFromStartOfChainUpTo(SignalProcessor firstUnexecutedDevice)
          Retreats upstream from this processor to the source of the stream and executes that device(s), telling it to stop execution at firstUnexecutedDevice.
 void executeUpTo(SignalProcessor firstUnexecutedDevice)
          Executes this device and all downstream devices up to, but not including, the firstUnexecutedDevice.
 SignalPipe getInputPipe(int index)
          Returns the indexth input pipe of this device.
 String getName()
          Returns the name of this switch.
 SignalPipe getOutputPipe(int index)
          Returns the indexth output pipe of this device.
 boolean isSetToClockwise()
          Returns true if this switch is set such that the inputs are piped to the outputs in a clockwise direction.
 void setToClockwiseOutputs()
          Sets this switch so that its inputs are connected to their clockwise outputs.
 void setToCounterclockwiseOutputs()
          Sets this switch so that its inputs are connected to their anticlockwise outputs.
 void twist()
          Turns this switch so that all the inputs now use their other outputs.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SignalTransferSwitch

public SignalTransferSwitch(String deviceName,
                            int numInputs)
Creates a new transfer switch with the number of input and output poles set to numInputs. The returned switch is initially configured so that inputs are connected to their clockwise outputs.

Parameters:
deviceName - an optional name for this switch. If this value is null a default name will be used in its place.
numInputs - the number of input and output poles on this switch.
Method Detail

getName

public String getName()
Returns the name of this switch.

Returns:
the name of this switch.

twist

public void twist()
Turns this switch so that all the inputs now use their other outputs. That is, if the inputs were sent to their clockwise outputs before this call, they will be sent to their counterclockwise outputs after this call, and vice versa.


setToClockwiseOutputs

public void setToClockwiseOutputs()
Sets this switch so that its inputs are connected to their clockwise outputs.


setToCounterclockwiseOutputs

public void setToCounterclockwiseOutputs()
Sets this switch so that its inputs are connected to their anticlockwise outputs.


isSetToClockwise

public boolean isSetToClockwise()
Returns true if this switch is set such that the inputs are piped to the outputs in a clockwise direction.

Returns:
true if this switch is set to its clockwise orientation.

getInputPipe

public SignalPipe getInputPipe(int index)
Returns the indexth input pipe of this device. A typical usage pattern for this method is:
 mySwitch.getInputPipe(p).connectInputTo(mySource);

Indexing begins at zero.

Returns:
the indexth input pipe of this device.

getOutputPipe

public SignalPipe getOutputPipe(int index)
Returns the indexth output pipe of this device. A typical usage pattern for this method is:
 mySwitch.getOutputPipe(p).connectOutputTo(myProcessor);

Indexing begins at zero.

Returns:
the indexth output pipe of this device.

execute

public void execute()
Runs the inputs to this switch from their beginnings and then executes the output pipes of this device.

Specified by:
execute in interface SignalProcessor

executeUpTo

public void executeUpTo(SignalProcessor firstUnexecutedDevice)
Description copied from interface: SignalProcessor
Executes this device and all downstream devices up to, but not including, the firstUnexecutedDevice. See SignalProcessor.execute() for more information about the linking of processors.

Specified by:
executeUpTo in interface SignalProcessor
Parameters:
firstUnexecutedDevice - the first device downstream that is not to be executed. If all downstream devices should be executed you may use a null value here or call SignalProcessor.execute().

executeFromStartOfChainUpTo

public void executeFromStartOfChainUpTo(SignalProcessor firstUnexecutedDevice)
Description copied from interface: SignalProcessor
Retreats upstream from this processor to the source of the stream and executes that device(s), telling it to stop execution at firstUnexecutedDevice.

Specified by:
executeFromStartOfChainUpTo in interface SignalProcessor
Parameters:
firstUnexecutedDevice - the first device in a chain of processors that is not to be executed. If all devices should be executed you may use a null value here. The first unexecuted device should be downstream of this device.


Copyright © 2009. All Rights Reserved.