hmi.elckerlyc.wait
Class WaitUnit

java.lang.Object
  extended by hmi.elckerlyc.planunit.AbstractPlanUnit
      extended by hmi.elckerlyc.wait.WaitUnit
All Implemented Interfaces:
PlanUnit

public class WaitUnit
extends AbstractPlanUnit


Field Summary
private  TimePeg endPeg
           
private static org.slf4j.Logger logger
           
private  TimePeg startPeg
           
 
Fields inherited from class hmi.elckerlyc.planunit.AbstractPlanUnit
bmlBlockPeg
 
Constructor Summary
WaitUnit(BMLBlockPeg bmlPeg, String i, String bmlId)
           
 
Method Summary
 double getEndTime()
          Get the global end time of the PlanUnit, TimePeg.VALUEUNKNOWN if not known (yet)
 double getPreferedDuration()
          0 is unknown/persistent
 double getStartTime()
          Get the global start time of the PlanUnit, TimePeg.VALUEUNKNOWN if not known (yet)
 TimePeg getTimePeg(String syncId)
          null is not set
 boolean hasValidTiming()
          Checks if the timing of this plan unit is 'valid' (e.g. stuff like start is earlier than end, but also planunit specific stuff like biomechanically possible timing).
protected  void playUnit(double time)
           
private  void sendFeedback(String syncId, double time)
           
 void setEndPeg(TimePeg endPeg)
           
 void setParameterValue(String paramId, float value)
          Sets a parameter value
 void setParameterValue(String paramId, String value)
          Sets a parameter value
 void setStartPeg(TimePeg startPeg)
           
 void setTimePeg(String syncId, TimePeg peg)
          Assigns a TimePeg to a sync in the PlanUnit
 void startUnit(double time)
          Starts the PlanUnit, is only called once at start
protected  void stopUnit(double time)
           
 
Methods inherited from class hmi.elckerlyc.planunit.AbstractPlanUnit
addFeedbackListener, feedback, getAvailableSyncs, getBMLBlockPeg, getBMLId, getId, getRelativeTime, getReplacementGroup, getState, getTime, isDone, isLurking, isPlaying, isSubUnit, play, reset, resetUnit, setState, setSubUnit, start, stop
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

startPeg

private TimePeg startPeg

endPeg

private TimePeg endPeg

logger

private static final org.slf4j.Logger logger
Constructor Detail

WaitUnit

public WaitUnit(BMLBlockPeg bmlPeg,
                String i,
                String bmlId)
Method Detail

setStartPeg

public void setStartPeg(TimePeg startPeg)
Parameters:
startPeg - the startPeg to set

setEndPeg

public void setEndPeg(TimePeg endPeg)
Parameters:
startPeg - the startPeg to set

getStartTime

public double getStartTime()
Description copied from interface: PlanUnit
Get the global start time of the PlanUnit, TimePeg.VALUEUNKNOWN if not known (yet)


getEndTime

public double getEndTime()
Description copied from interface: PlanUnit
Get the global end time of the PlanUnit, TimePeg.VALUEUNKNOWN if not known (yet)


hasValidTiming

public boolean hasValidTiming()
Description copied from interface: PlanUnit
Checks if the timing of this plan unit is 'valid' (e.g. stuff like start is earlier than end, but also planunit specific stuff like biomechanically possible timing).

Returns:
true if valid

sendFeedback

private void sendFeedback(String syncId,
                          double time)

startUnit

public void startUnit(double time)
Description copied from class: AbstractPlanUnit
Starts the PlanUnit, is only called once at start

Overrides:
startUnit in class AbstractPlanUnit
Parameters:
time - global start time

playUnit

protected void playUnit(double time)
                 throws PlayException
Specified by:
playUnit in class AbstractPlanUnit
Throws:
PlayException

stopUnit

protected void stopUnit(double time)
                 throws PlayException
Specified by:
stopUnit in class AbstractPlanUnit
Throws:
PlayException

getPreferedDuration

public double getPreferedDuration()
Description copied from interface: PlanUnit
0 is unknown/persistent

Specified by:
getPreferedDuration in interface PlanUnit
Overrides:
getPreferedDuration in class AbstractPlanUnit

getTimePeg

public TimePeg getTimePeg(String syncId)
Description copied from interface: PlanUnit
null is not set


setTimePeg

public void setTimePeg(String syncId,
                       TimePeg peg)
Description copied from interface: PlanUnit
Assigns a TimePeg to a sync in the PlanUnit


setParameterValue

public void setParameterValue(String paramId,
                              String value)
Description copied from interface: PlanUnit
Sets a parameter value


setParameterValue

public void setParameterValue(String paramId,
                              float value)
Description copied from interface: PlanUnit
Sets a parameter value