org.lsst.ccs.subsystem.common
Class BinaryOpModule

java.lang.Object
  extended by java.util.Observable
      extended by org.lsst.ccs.framework.Module
          extended by org.lsst.ccs.subsystem.common.BinaryOpModule
All Implemented Interfaces:
java.io.Serializable, java.util.Observer
Direct Known Subclasses:
Adder

public abstract class BinaryOpModule
extends org.lsst.ccs.framework.Module

A base class for a binary operator. The two input values are updated through observers The class computes periodically the output value using the current input values

Author:
aubourg
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class org.lsst.ccs.framework.Module
org.lsst.ccs.framework.Module.ValueUpdate
 
Field Summary
protected  double current1
           
protected  double current2
           
 
Fields inherited from class org.lsst.ccs.framework.Module
log, name, nObserverThreads, registry, tickMillis
 
Constructor Summary
BinaryOpModule()
           
 
Method Summary
 java.lang.String getInput1()
           
 java.lang.String getInput2()
           
 java.lang.String getOutput()
           
abstract  double op()
          Computes the output from the current values of the input parameters.
 void processUpdate(java.util.Observable source, org.lsst.ccs.framework.Module.ValueUpdate update)
           
 void setInput1(java.lang.String input1)
          The name of input parameter 1, will be checked when update is called.
 void setInput2(java.lang.String input2)
          The name of input parameter 2, will be checked when update is called.
 void setOutput(java.lang.String output)
          The name used to broadcast the result
 void tick()
           
 
Methods inherited from class org.lsst.ccs.framework.Module
getContext, getModule, getName, getNObserverThreads, getObservables, getSubsystem, getTickMillis, init, initModule, listens, publishData, publishData, publishData, publishData, sendToReply, sendToStatus, setBeanName, setContext, setName, setNObserverThreads, setObservables, setStateModularSubsystem, setStateModularSubsystem, setTickMillis, shutdownNow, start, update
 
Methods inherited from class java.util.Observable
addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChanged
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

current1

protected double current1

current2

protected double current2
Constructor Detail

BinaryOpModule

public BinaryOpModule()
Method Detail

getInput1

public java.lang.String getInput1()

setInput1

public void setInput1(java.lang.String input1)
The name of input parameter 1, will be checked when update is called.

Parameters:
input1 -

getInput2

public java.lang.String getInput2()

setInput2

public void setInput2(java.lang.String input2)
The name of input parameter 2, will be checked when update is called.

Parameters:
input2 -

getOutput

public java.lang.String getOutput()

setOutput

public void setOutput(java.lang.String output)
The name used to broadcast the result

Parameters:
output -

op

public abstract double op()
Computes the output from the current values of the input parameters. This method has to be overriden by derived class.

Returns:
the result

processUpdate

public void processUpdate(java.util.Observable source,
                          org.lsst.ccs.framework.Module.ValueUpdate update)
Overrides:
processUpdate in class org.lsst.ccs.framework.Module

tick

public void tick()
Overrides:
tick in class org.lsst.ccs.framework.Module


Copyright © 2012 LSST. All Rights Reserved.