org.lsst.ccs.subsystems.fcs.simulation
Class SimuNumericSensor

java.lang.Object
  extended by java.util.Observable
      extended by org.lsst.ccs.framework.Module
          extended by org.lsst.ccs.subsystems.fcs.NumericSensor
              extended by org.lsst.ccs.subsystems.fcs.simulation.SimuNumericSensor
All Implemented Interfaces:
Serializable, Observer, org.lsst.ccs.framework.Configurable

public class SimuNumericSensor
extends NumericSensor

This class is used in the single filter test to simulate the rail sensors of the autochanger and the filter presence sensor on the lachtes. The simulated rail sensors listen to the motors and update their digitalValue when the motor are set on or off (cf SimuActuatorModule). To simulate the hardware we have in the Exchanger, a SimuNumericSensor is supposed to be attached to a simulated IO Module (simuIOModule). This IO Module gives the values for 8 sensors in a hexa decimal format. A sensor has an inputNumero on this IO Module to retrieve its values.

Author:
virieux
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class org.lsst.ccs.framework.Module
org.lsst.ccs.framework.Module.ValueUpdate
 
Nested classes/interfaces inherited from interface org.lsst.ccs.framework.Configurable
org.lsst.ccs.framework.Configurable.Environment
 
Field Summary
 
Fields inherited from class org.lsst.ccs.subsystems.fcs.NumericSensor
digitalValue
 
Fields inherited from class org.lsst.ccs.framework.Module
environment, log, name, nObserverThreads, registry, tickMillis
 
Constructor Summary
SimuNumericSensor()
           
 
Method Summary
 Filter getDummyFilter()
           
 int getInputNumero()
           
 void initModule()
           
 int readNewValue()
           
 void setDummyFilter(Filter dummyFilter)
           
 void setInputNumero(int inputNumero)
           
 void updateValue(String hex)
          This methods updates the digital value for this sensor.
 
Methods inherited from class org.lsst.ccs.subsystems.fcs.NumericSensor
getDigitalValue, setDigitalValue
 
Methods inherited from class org.lsst.ccs.framework.Module
change, checkHardware, dropConfigurationContext, getCheckedValueFromConfiguration, getChildren, getContext, getModule, getName, getNObserverThreads, getObservables, getSubsystem, getTickMillis, init, listens, newConfigurationContext, notifyChange, notifyChangeWithoutPreliminaryChecks, processUpdate, publishData, publishData, publishData, publishData, register, register, sendToReply, sendToStatus, setBeanName, setContext, setEnvironment, setName, setNObserverThreads, setObservables, setStateModularSubsystem, setStateModularSubsystem, setTickMillis, shutdownCommand, shutdownNow, start, startTicking, tick, 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
 

Constructor Detail

SimuNumericSensor

public SimuNumericSensor()
Method Detail

getDummyFilter

public Filter getDummyFilter()

setDummyFilter

public void setDummyFilter(Filter dummyFilter)

getInputNumero

public int getInputNumero()

setInputNumero

public void setInputNumero(int inputNumero)

initModule

public void initModule()
Overrides:
initModule in class NumericSensor

readNewValue

public int readNewValue()

updateValue

public void updateValue(String hex)
This methods updates the digital value for this sensor. It takes as an argument the value in hexa sent by the CompactIOModule. This hexa value represents the 8 values for the 8 channels. To retrieve the value for this sensor, the hexa value is transformed in binary, then reverse and the digital value is the digit at the index= inputNumero. exmaple if hex = 80, and inputNumero=8, digital value=1 otherwise digital value=0.

Specified by:
updateValue in class NumericSensor
Parameters:
hex - TODO : this method is the copy of the NumericSensor's updateValue method. It should be put up in NumericSensor.


Copyright © 2013 LSST. All Rights Reserved.