hmi.elckerlyc.interrupt
Class InterruptUnit

java.lang.Object
  extended by hmi.elckerlyc.planunit.AbstractPlanUnit
      extended by hmi.elckerlyc.interrupt.InterruptUnit
All Implemented Interfaces:
PlanUnit

public class InterruptUnit
extends AbstractPlanUnit


Field Summary
private  Map<String,InterruptSpec> interruptSpecMap
           
private static org.slf4j.Logger logger
           
private  BMLScheduler scheduler
           
private  TimePeg startPeg
           
private  String target
           
 
Fields inherited from class hmi.elckerlyc.planunit.AbstractPlanUnit
bmlBlockPeg
 
Constructor Summary
InterruptUnit(BMLBlockPeg bmlPeg, String i, String bmlId, String iTarget, BMLScheduler s)
           
 
Method Summary
 void addInterruptSpec(InterruptSpec s)
           
 double getEndTime()
          Get the global end time of the PlanUnit, TimePeg.VALUEUNKNOWN if not known (yet)
 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 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
protected  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, getPreferedDuration, 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

logger

private static final org.slf4j.Logger logger

startPeg

private TimePeg startPeg

scheduler

private final BMLScheduler scheduler

target

private final String target

interruptSpecMap

private Map<String,InterruptSpec> interruptSpecMap
Constructor Detail

InterruptUnit

public InterruptUnit(BMLBlockPeg bmlPeg,
                     String i,
                     String bmlId,
                     String iTarget,
                     BMLScheduler s)
Method Detail

setStartPeg

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

addInterruptSpec

public void addInterruptSpec(InterruptSpec s)

startUnit

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

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

sendFeedback

private void sendFeedback(String syncId,
                          double 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

getEndTime

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


getStartTime

public double getStartTime()
Description copied from interface: PlanUnit
Get the global start 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

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