Class SoAlarmSensor
- java.lang.Object
-
- com.openinventor.inventor.Inventor
-
- com.openinventor.inventor.sensors.SoSensor
-
- com.openinventor.inventor.sensors.SoTimerQueueSensor
-
- com.openinventor.inventor.sensors.SoAlarmSensor
-
public class SoAlarmSensor extends SoTimerQueueSensor
Triggers a delegate once sometime in the future. This type of sensor can be used to schedule a one-time delegate for some time in the future. The sensor is not guaranteed to be called at exactly that time, but will be called sometime after the specified time.- See Also:
SoOneShotSensor
,SoTimerSensor
,SoTimerQueueSensor
,SbTime
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.openinventor.inventor.Inventor
Inventor.ConstructorCommand
-
-
Field Summary
-
Fields inherited from class com.openinventor.inventor.Inventor
VERBOSE_LEVEL, ZeroHandle
-
-
Constructor Summary
Constructors Constructor Description SoAlarmSensor()
Constructor.SoAlarmSensor(java.lang.Runnable task)
Build a new alarm sensor with the task to be executed when the sensor is triggered.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SbTime
getTime()
Returns the time at which the sensor is set to be triggered.void
setTime(SbTime absTime)
Sets the sensor to go off at the specified time.void
setTimeFromNow(SbTime relTime)
Sets the sensor to go off the given amount of time from now.-
Methods inherited from class com.openinventor.inventor.sensors.SoTimerQueueSensor
getTriggerTime
-
Methods inherited from class com.openinventor.inventor.sensors.SoSensor
isScheduled, schedule, setTask, unschedule
-
Methods inherited from class com.openinventor.inventor.Inventor
dispose, getNativeResourceHandle
-
-
-
-
Method Detail
-
setTime
public void setTime(SbTime absTime)
Sets the sensor to go off at the specified time. You must also call schedule() for the sensor to be triggered. If the sensor is already scheduled, it must be unscheduled and then rescheduled for the change in the trigger time to take effect.
-
setTimeFromNow
public void setTimeFromNow(SbTime relTime)
Sets the sensor to go off the given amount of time from now. You must also call schedule() for the sensor to be triggered. If the sensor is already scheduled, it must be unscheduled and then rescheduled for the change in the trigger time to take effect.
-
getTime
public SbTime getTime()
Returns the time at which the sensor is set to be triggered. This is similar to the getTriggerTime method, but returns the time even if the sensor has not yet been scheduled.
-
-