Class SoOneShot
- java.lang.Object
-
- com.openinventor.inventor.Inventor
-
- com.openinventor.inventor.misc.SoBase
-
- com.openinventor.inventor.fields.SoFieldContainer
-
- com.openinventor.inventor.engines.SoEngine
-
- com.openinventor.inventor.engines.SoOneShot
-
- All Implemented Interfaces:
SafeDisposable
public class SoOneShot extends SoEngine
Timer that runs for a pre-set amount of time. This engine is a timer that runs for a pre-set amount of time and then stops. By default, thetimeIn
input is connected to the realTime global field. It can, however, by connected to any other time source.The timer is started when the
trigger
input is touched. It then runs for the specifiedduration
, and updates thetimeOut
output with the time that has elapsed. During that time, theramp
output is also updated. Theramp
output starts at 0.0 at the beginning of the cycle, and linearly increases until it reaches 1.0 at the end of the cycle.You can disable the timer by setting the
disable
input to true. The output value remains 0.0 while the timer is disabled. If the timer is disabled in the middle of a cycle the output values will be set to 0.0.The
flags
input contains control flags. Using the flags you can set the timer to be retriggerable in the middle of a cycle, and set the output values to stay high after the cycle has been completed. By default, these flags are not set.File format/default:
OneShot {
duration 1 trigger flags () disable false timeIn <current time> - See Also:
SoElapsedTime
,SoEngineOutput
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
SoOneShot.FlagsType
Flags.-
Nested classes/interfaces inherited from class com.openinventor.inventor.Inventor
Inventor.ConstructorCommand
-
-
Field Summary
Fields Modifier and Type Field Description SoSFBool
disable
If true, the timer is disabled.SoSFTime
duration
Duration of the active cycle.SoSFBitMask<SoOneShot.FlagsType>
flags
Control flags.SoEngineOutput
isActive
(SoSFBool
) Is true during the active cycle.SoEngineOutput
ramp
(SoSFFloat
) Ramps linearly from 0.0 to 1.0.SoSFTime
timeIn
Running time.SoEngineOutput
timeOut
(SoSFTime
) Elapsed time from the start.SoSFTrigger
trigger
Start the cycle.-
Fields inherited from class com.openinventor.inventor.Inventor
VERBOSE_LEVEL, ZeroHandle
-
-
Constructor Summary
Constructors Constructor Description SoOneShot()
Constructor.
-
Method Summary
-
Methods inherited from class com.openinventor.inventor.engines.SoEngine
copy, getByName, getOutput, getOutputName
-
Methods inherited from class com.openinventor.inventor.fields.SoFieldContainer
copyFieldValues, copyFieldValues, enableNotify, fieldsAreEqual, get, getAllFields, getEventIn, getEventOut, getField, getFieldName, hasDefaultValues, isNotifyEnabled, set, setToDefaults
-
Methods inherited from class com.openinventor.inventor.misc.SoBase
dispose, getName, isDisposable, isSynchronizable, setName, setSynchronizable, touch
-
Methods inherited from class com.openinventor.inventor.Inventor
getNativeResourceHandle
-
-
-
-
Field Detail
-
duration
public final SoSFTime duration
Duration of the active cycle.
-
trigger
public final SoSFTrigger trigger
Start the cycle. The trigger will be ignored if it is touched in the middle of a cycle and the RETRIGGERABLE flag is not set.
-
flags
public final SoSFBitMask<SoOneShot.FlagsType> flags
Control flags.
-
disable
public final SoSFBool disable
If true, the timer is disabled.
-
timeIn
public final SoSFTime timeIn
Running time.
-
timeOut
public final SoEngineOutput timeOut
(SoSFTime
) Elapsed time from the start.
-
isActive
public final SoEngineOutput isActive
(SoSFBool
) Is true during the active cycle.
-
ramp
public final SoEngineOutput ramp
(SoSFFloat
) Ramps linearly from 0.0 to 1.0.
-
-