Click or drag to resize
SoTimerSensor Class

Sensor that triggers repeatedly at regular intervals.

Inheritance Hierarchy

Namespace: OIV.Inventor.Sensors
Assembly: OIV.Inventor (in OIV.Inventor.dll) Version: 2024.2.2.0 (10.16.2.0)
Syntax
public class SoTimerSensor : SoTimerQueueSensor

The SoTimerSensor type exposes the following members.

Constructors
  NameDescription
Public methodSoTimerSensor

Default constructor.

Top
Methods
  NameDescription
Public methodEquals
Determines whether the specified Object is equal to the current Object.
(Inherited from Object.)
Public methodGetBaseTime

Gets the base time.

Public methodGetHashCode
Overrides GetHashCode().
(Inherited from SoNetBase.)
Public methodGetInterval

Gets the interval.

Public methodGetTriggerTime

Returns the time at which this sensor is scheduled to be triggered.

(Inherited from SoTimerQueueSensor.)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Public methodIsScheduled

Returns true if this sensor has been scheduled and is waiting in a sensor queue to be triggered.

(Inherited from SoSensor.)
Public methodSchedule
(Inherited from SoSensor.)
Public methodSetBaseTime

Sets the base time.

Public methodSetInterval

Sets the interval.

Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Public methodUnschedule
(Inherited from SoSensor.)
Top
Properties
  NameDescription
Public propertyAction

(Inherited from SoSensor.)
Top
Remarks

Timer sensors trigger their function at regular intervals. A base time may be specified, which causes the sensor to be triggered at multiples of the interval starting from the base time. The base time is an absolute time, as returned by SbTime.getTimeOfDay(). For example, a timer might be set up to call its function every second on the second by setting the base time to OIV.Inventor.SbTime (0.0) and the interval to OIV.Inventor.SbTime (1.0) . Timers are guaranteed to be triggered only once when the timer queue is processed, so if the application only processes the timer queue once every 5 seconds (because it is busy doing something else) the once-a-second sensor's function will only be called once every 5 seconds.

If no base time is set, then the function will be rescheduled from the present time using the interval value.

When a base time has been specified, SoTimers always schedule themselves to be triggered the next multiple of the interval time after the base time. For example, if the once-a-second sensor is triggered at time 2.9 (because the application way busy doing something at time 2.0 and didn't get around to processing the sensor queue for a while) it will reschedule itself to go off at time 3.0, not at time 3.9. On the other hand, if the base time had never been set, then the sensor would be scheduled for time 3.9.

See Also