org.lsst.ccs.subsystems.fcs
Class FilterLatchModule

java.lang.Object
  extended by java.util.Observable
      extended by org.lsst.ccs.framework.Module
          extended by org.lsst.ccs.subsystems.fcs.common.MobileItemModule
              extended by org.lsst.ccs.subsystems.fcs.FilterLatchModule
All Implemented Interfaces:
Serializable, Observer, org.lsst.ccs.framework.Configurable
Direct Known Subclasses:
SimuFilterLatchModule

public class FilterLatchModule
extends MobileItemModule

This is a model for a latch. A latch is what holds a filter in the trucks of the autochanger. There is 2 latches : one on each side of the filter. The state of the latches are monitoring by digital sensors : one sensor to know if a filter is in the latch or not and 2 status sensors to know if the latch is locked or unlocked. If the 2 status sensors are inconsistent, the latch is in error.

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
protected  NumericSensor filterPresenceSensor
           
protected  NumericSensor lockSensor
           
protected  NumericSensor unlockSensor
           
protected  boolean updatingState
          This is used when we update the latch state with the values returned by the sensors.
 
Fields inherited from class org.lsst.ccs.subsystems.fcs.common.MobileItemModule
itemMoving, lock, motionCompleted
 
Fields inherited from class org.lsst.ccs.framework.Module
environment, log, name, nObserverThreads, registry, tickMillis
 
Constructor Summary
FilterLatchModule()
           
 
Method Summary
 String close()
           
 String closeWithThreadSleep()
           
 NumericSensor getFilterPresenceSensor()
           
 CompactIOModule getFilterSensorsDIO()
           
 String getFilterSensorsDIOName()
           
 LatchActuatorModule getLatchActuator()
           
 NumericSensor getLockSensor()
           
 FcsEnumerations.LockStatus getLockStatus()
           
 FcsEnumerations.FilterPresenceInLatchStatus getPresenceStatus()
           
 StatusDataPublishedByLatch getStatusData()
           
 long getTimeoutForClosing()
           
 long getTimeoutForOpening()
           
 long getTimeToWaitForCompleteClose()
           
 long getTimeToWaitForCompleteOpen()
           
 NumericSensor getUnlockSensor()
           
 void initModule()
           
 boolean isActionCompleted(FcsEnumerations.MobileItemAction action)
           
 boolean isInError()
           
 boolean isLocked()
           
 boolean isUnlocked()
           
 String open()
           
 String openWithThreadSleep()
           
 void postAction(FcsEnumerations.MobileItemAction action)
           
 void publishTrendingData(StatusDataPublishedByLatch status)
          Broadcast the trending data on the status bus.
 void setFilterPresenceSensor(NumericSensor filterPresenceSensor)
           
 void setFilterSensorsDIO(CompactIOModule filterSensorsDIO)
           
 void setFilterSensorsDIOName(String filterSensorsDIOName)
           
 void setLatchActuator(LatchActuatorModule latchActuator)
           
 void setLockSensor(NumericSensor lockSensor)
           
 void setLockStatus(FcsEnumerations.LockStatus lockStatus)
           
 void setTimeoutForClosing(long timeoutForClosing)
           
 void setTimeoutForOpening(long timeoutForOpening)
           
 void setTimeToWaitForCompleteClose(long timeToWaitForCompleteClose)
           
 void setTimeToWaitForCompleteOpen(long timeToWaitForCompleteOpen)
           
 void setUnlockSensor(NumericSensor unlockSensor)
           
 void startAction(FcsEnumerations.MobileItemAction action)
           
 void updateState(String hexaValue)
           
 void updateStateWithSensorsToCheckIfActionIsCompleted()
           
 
Methods inherited from class org.lsst.ccs.subsystems.fcs.common.MobileItemModule
cancelReadingSensors, executeAction, readSensorsUntilActionIsCompleted, shutdownNow, waitForEndOfAction
 
Methods inherited from class org.lsst.ccs.framework.Module
alias, change, checkHardware, dropConfigurationContext, getAvailableCommands, getCheckedValueFromConfiguration, getChildren, getContext, getModule, getName, getNObserverThreads, getObservables, getSubsystem, getTickMillis, init, listens, newConfigurationContext, notifyChange, notifyChangeWithoutPreliminaryChecks, processUpdate, publishData, publishData, publishData, publishData, publishData, publishData, publishData, register, register, removeLogPanicState, sendToReply, sendToStatus, setBeanName, setContext, setEnvironment, setHandlerLevel, setLogLevel, setName, setNObserverThreads, setObservables, setStateModularSubsystem, setStateModularSubsystem, setTickMillis, shutdownCommand, 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
 

Field Detail

filterPresenceSensor

protected NumericSensor filterPresenceSensor

lockSensor

protected NumericSensor lockSensor

unlockSensor

protected NumericSensor unlockSensor

updatingState

protected volatile boolean updatingState
This is used when we update the latch state with the values returned by the sensors.

Constructor Detail

FilterLatchModule

public FilterLatchModule()
Method Detail

getLatchActuator

public LatchActuatorModule getLatchActuator()

setLatchActuator

public void setLatchActuator(LatchActuatorModule latchActuator)

getFilterPresenceSensor

public NumericSensor getFilterPresenceSensor()

setFilterPresenceSensor

public void setFilterPresenceSensor(NumericSensor filterPresenceSensor)

getLockSensor

public NumericSensor getLockSensor()

setLockSensor

public void setLockSensor(NumericSensor lockSensor)

getUnlockSensor

public NumericSensor getUnlockSensor()

setUnlockSensor

public void setUnlockSensor(NumericSensor unlockSensor)

getFilterSensorsDIO

public CompactIOModule getFilterSensorsDIO()

setFilterSensorsDIO

public void setFilterSensorsDIO(CompactIOModule filterSensorsDIO)

getFilterSensorsDIOName

public String getFilterSensorsDIOName()

setFilterSensorsDIOName

public void setFilterSensorsDIOName(String filterSensorsDIOName)

getTimeToWaitForCompleteClose

public long getTimeToWaitForCompleteClose()

setTimeToWaitForCompleteClose

public void setTimeToWaitForCompleteClose(long timeToWaitForCompleteClose)

getTimeToWaitForCompleteOpen

public long getTimeToWaitForCompleteOpen()

setTimeToWaitForCompleteOpen

public void setTimeToWaitForCompleteOpen(long timeToWaitForCompleteOpen)

getTimeoutForClosing

public long getTimeoutForClosing()

setTimeoutForClosing

public void setTimeoutForClosing(long timeoutForClosing)

getTimeoutForOpening

public long getTimeoutForOpening()

setTimeoutForOpening

public void setTimeoutForOpening(long timeoutForOpening)

initModule

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

isActionCompleted

public boolean isActionCompleted(FcsEnumerations.MobileItemAction action)
Specified by:
isActionCompleted in class MobileItemModule

updateStateWithSensorsToCheckIfActionIsCompleted

public void updateStateWithSensorsToCheckIfActionIsCompleted()
                                                      throws Exception
Specified by:
updateStateWithSensorsToCheckIfActionIsCompleted in class MobileItemModule
Throws:
Exception

startAction

public void startAction(FcsEnumerations.MobileItemAction action)
                 throws org.lsst.ccs.bus.BadCommandException,
                        org.lsst.ccs.bus.ErrorInCommandExecutionException,
                        HardwareException
Specified by:
startAction in class MobileItemModule
Throws:
org.lsst.ccs.bus.BadCommandException
org.lsst.ccs.bus.ErrorInCommandExecutionException
HardwareException

postAction

public void postAction(FcsEnumerations.MobileItemAction action)
                throws org.lsst.ccs.bus.BadCommandException,
                       org.lsst.ccs.bus.ErrorInCommandExecutionException,
                       HardwareException
Specified by:
postAction in class MobileItemModule
Throws:
org.lsst.ccs.bus.BadCommandException
org.lsst.ccs.bus.ErrorInCommandExecutionException
HardwareException

getLockStatus

public FcsEnumerations.LockStatus getLockStatus()

setLockStatus

public void setLockStatus(FcsEnumerations.LockStatus lockStatus)

getPresenceStatus

public FcsEnumerations.FilterPresenceInLatchStatus getPresenceStatus()

getStatusData

public StatusDataPublishedByLatch getStatusData()

open

public String open()
            throws org.lsst.ccs.bus.BadCommandException,
                   org.lsst.ccs.bus.ErrorInCommandExecutionException,
                   HardwareException,
                   Exception
Throws:
org.lsst.ccs.bus.BadCommandException
org.lsst.ccs.bus.ErrorInCommandExecutionException
HardwareException
Exception

openWithThreadSleep

public String openWithThreadSleep()
                           throws org.lsst.ccs.bus.BadCommandException,
                                  org.lsst.ccs.bus.ErrorInCommandExecutionException,
                                  HardwareException
Throws:
org.lsst.ccs.bus.BadCommandException
org.lsst.ccs.bus.ErrorInCommandExecutionException
HardwareException

close

public String close()
             throws org.lsst.ccs.bus.BadCommandException,
                    org.lsst.ccs.bus.ErrorInCommandExecutionException,
                    HardwareException,
                    Exception
Throws:
org.lsst.ccs.bus.BadCommandException
org.lsst.ccs.bus.ErrorInCommandExecutionException
HardwareException
Exception

closeWithThreadSleep

public String closeWithThreadSleep()
                            throws org.lsst.ccs.bus.BadCommandException,
                                   org.lsst.ccs.bus.ErrorInCommandExecutionException,
                                   HardwareException
Throws:
org.lsst.ccs.bus.BadCommandException
org.lsst.ccs.bus.ErrorInCommandExecutionException
HardwareException

isLocked

public boolean isLocked()

isUnlocked

public boolean isUnlocked()

isInError

public boolean isInError()

updateState

public void updateState(String hexaValue)

publishTrendingData

public void publishTrendingData(StatusDataPublishedByLatch status)
Broadcast the trending data on the status bus.

Parameters:
status -


Copyright © 2013 LSST. All Rights Reserved.