hmi.elckerlyc.planunit
Class PlanUnitTimeManager
java.lang.Object
hmi.elckerlyc.planunit.PlanUnitTimeManager
public class PlanUnitTimeManager
- extends Object
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
pegs
private Map<KeyPosition,TimePeg> pegs
kpManager
private final KeyPositionManager kpManager
logger
private static final org.slf4j.Logger logger
PlanUnitTimeManager
public PlanUnitTimeManager(KeyPositionManager kpm)
setPegs
public void setPegs(Map<KeyPosition,TimePeg> pegs)
getRelativeTime
public double getRelativeTime(String syncId)
throws RelativeSyncNotFoundException
- Throws:
RelativeSyncNotFoundException
getPegs
public Map<KeyPosition,TimePeg> getPegs()
- Returns:
- the synchs
hasValidTiming
public boolean hasValidTiming()
getKeyPosition
public KeyPosition getKeyPosition(TimePeg sp)
- Gets the keyposition associated with sp
- Parameters:
sp -
- Returns:
getPrevPegTime
public double getPrevPegTime(String pid)
- Get the time of the first set timepeg before the timepeg linked to this keyposition
- Parameters:
pid - id of the keyposition
- Returns:
- the time of the first set timepeg before the timepeg linked to this keyposition, TimePeg.VALUE_UNKNOWN if none set or pid unknown
getNextPegTime
public double getNextPegTime(String pid)
- Get the time of the next set timepeg after the timepeg linked to this keyposition
- Parameters:
pid - id of the keyposition
- Returns:
- the time of the next set timepeg after the timepeg linked to this keyposition, TimePeg.VALUE_UNKNOWN if none set
getPegTime
public double getPegTime(String pid)
getTimePeg
public TimePeg getTimePeg(String pid)
getStartTime
public double getStartTime()
getEndTime
public double getEndTime()
setTimePeg
public void setTimePeg(KeyPosition kp,
TimePeg sp)
setTimePeg
public void setTimePeg(String kid,
TimePeg sp)
getRelativeTime
public double getRelativeTime(double absoluteTime)
- Get relative time (0..1) using a linear timewarp between the two keypositions that most closely match absolute time
getAvailableSyncs
public List<String> getAvailableSyncs()