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

java.lang.Object
  extended by java.util.Observable
      extended by org.lsst.ccs.framework.Module
          extended by org.lsst.ccs.subsystems.fcs.simulation.SimulatedMotor
All Implemented Interfaces:
Serializable, Observer, Motor
Direct Known Subclasses:
SimuCarouselMotor

public abstract class SimulatedMotor
extends org.lsst.ccs.framework.Module
implements Motor

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
 
Field Summary
 
Fields inherited from class org.lsst.ccs.framework.Module
configMethods, log, name, nObserverThreads, registry, tickMillis
 
Constructor Summary
SimulatedMotor()
          This constructor is here only for unit tests.
 
Method Summary
 EngineState getEngineState()
           
 double getMaximalPosition()
           
 double getMaximalVelocity()
           
 double getMinimalPosition()
           
 double getNominalVelocity()
           
 double getPeriod()
           
 double getPosition()
           
 double getRequiredPosition()
           
 String getSerialNumber()
           
 long getStateChangeTime()
           
 void incrementPosition(double inc)
          To be overrided in each subclasses.
 void initModule()
           
 void move(double displacement)
           
 void move(double displacement, RunningWay theRunningWay)
          This method sends a command go to the simulated motor.
 void setEngineState(EngineState engineState)
           
 void setMaximalPosition(double p)
           
 void setMaximalVelocity(double maximalVelocity)
           
 void setMinimalPosition(double p)
           
 void setNominalVelocity(double nominalVelocity)
           
 void setPeriod(double d)
           
 void setPosition(double position)
           
 void setRequiredPosition(double requiredPosition)
           
 void setSerialNumber(String serialNumber)
           
 void setStateChangeTime(long currentTimeMillis)
           
 void stop()
           
 void tick()
          What has to be done for each tick of the timer.
 
Methods inherited from class org.lsst.ccs.framework.Module
change, checkHardware, dropConfigurationContext, getCheckedValueFromConfiguration, getContext, getModule, getName, getNObserverThreads, getObservables, getSubsystem, getTickMillis, init, listens, newConfigurationContext, notifyChange, notifyChangeWithoutPreliminaryChecks, processUpdate, publishData, publishData, publishData, publishData, register, register, sendToReply, sendToStatus, setBeanName, setContext, setName, setNObserverThreads, setObservables, setStateModularSubsystem, setStateModularSubsystem, setTickMillis, shutdownCommand, shutdownNow, start, startTicking, 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
 
Methods inherited from interface org.lsst.ccs.subsystems.fcs.common.Motor
getName
 

Constructor Detail

SimulatedMotor

public SimulatedMotor()
This constructor is here only for unit tests. The actual values come from the xml config file for FCS or it is initialized by the Module which uses this motor.

Method Detail

getEngineState

public EngineState getEngineState()
Specified by:
getEngineState in interface Motor

getMaximalVelocity

public double getMaximalVelocity()
Specified by:
getMaximalVelocity in interface Motor

getNominalVelocity

public double getNominalVelocity()
Specified by:
getNominalVelocity in interface Motor

getPeriod

public double getPeriod()
Specified by:
getPeriod in interface Motor

getPosition

public double getPosition()
Specified by:
getPosition in interface Motor

getRequiredPosition

public double getRequiredPosition()
Specified by:
getRequiredPosition in interface Motor

getSerialNumber

public String getSerialNumber()
Specified by:
getSerialNumber in interface Motor

getStateChangeTime

public long getStateChangeTime()
Specified by:
getStateChangeTime in interface Motor

setEngineState

public void setEngineState(EngineState engineState)
Specified by:
setEngineState in interface Motor

setMaximalVelocity

public void setMaximalVelocity(double maximalVelocity)
Specified by:
setMaximalVelocity in interface Motor

setNominalVelocity

public void setNominalVelocity(double nominalVelocity)
Specified by:
setNominalVelocity in interface Motor

setPeriod

public void setPeriod(double d)
Specified by:
setPeriod in interface Motor

setPosition

public void setPosition(double position)
Parameters:
position - the position to set

setRequiredPosition

public void setRequiredPosition(double requiredPosition)
Specified by:
setRequiredPosition in interface Motor

setSerialNumber

public void setSerialNumber(String serialNumber)
Specified by:
setSerialNumber in interface Motor

setStateChangeTime

public void setStateChangeTime(long currentTimeMillis)
Specified by:
setStateChangeTime in interface Motor

getMaximalPosition

public double getMaximalPosition()
Specified by:
getMaximalPosition in interface Motor

getMinimalPosition

public double getMinimalPosition()
Specified by:
getMinimalPosition in interface Motor

setMaximalPosition

public void setMaximalPosition(double p)
Specified by:
setMaximalPosition in interface Motor

setMinimalPosition

public void setMinimalPosition(double p)
Specified by:
setMinimalPosition in interface Motor

stop

public void stop()
Specified by:
stop in interface Motor

initModule

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

move

public void move(double displacement)
Specified by:
move in interface Motor

move

public void move(double displacement,
                 RunningWay theRunningWay)
This method sends a command go to the simulated motor. It computes the needed period for the displacement. Displacement has to be positive.

Specified by:
move in interface Motor

tick

public void tick()
What has to be done for each tick of the timer. We have to compute the time since the last tick and incremente the position.

Overrides:
tick in class org.lsst.ccs.framework.Module

incrementPosition

public void incrementPosition(double inc)
To be overrided in each subclasses. Increments the position of the mobil mechanical item which is moved by this simulated motor.

Specified by:
incrementPosition in interface Motor
Parameters:
inc -


Copyright © 2012 LSST. All Rights Reserved.