Class SoCounter
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.SoCounter
- All Implemented Interfaces:
SafeDisposable
Triggered integer counter.
This engine is a counter that outputs numbers, starting at a minimum value, increasing by a step value, and ending with a number that does not exceed the maximum value. It outputs the next number whenever the
trigger input is touched. When the maximum number is reached, it starts counting from the beginning again.
At any time the counter can be reset to a specific value by setting the reset input field to that value. The next time the counter is triggered it will start counting from there. Note that the counter will always output numbers based on the min, max and step values, and setting the reset value does not affect those input fields. If the reset value is not a legal counter value, the counter will still behave as though it is.
- If
resetis greater thanmax, the counter is set tomax. - If
resetis less thanmin, the counter is set tomin. - If
resetis between steps, the counter is set to the lower step value.
Each time a counting cycle is started, the syncOut output is triggered. This output can be used to synchronize some other event with the counting cycle.
File format/default:
Counter {
| min | 0 |
| max | 1 |
| step | 1 |
| trigger | |
| reset | 0 |
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class com.openinventor.inventor.Inventor
Inventor.ConstructorCommand -
Field Summary
FieldsModifier and TypeFieldDescriptionfinal SoSFShortMaximum value for the counter.final SoSFShortMinimum value for the counter.final SoEngineOutput(SoSFShort) Counts min-to-max in step increments.final SoSFShortAt the next trigger, reset the counter to the specified value.final SoSFShortCounter step value.final SoEngineOutput(SoSFTrigger) Triggers at cycle start.final SoSFTriggerGo to the next step.Fields inherited from class com.openinventor.inventor.Inventor
VERBOSE_LEVEL, ZeroHandle -
Constructor Summary
Constructors -
Method Summary
Methods inherited from class com.openinventor.inventor.engines.SoEngine
copy, getByName, getOutput, getOutputNameMethods inherited from class com.openinventor.inventor.fields.SoFieldContainer
copyFieldValues, copyFieldValues, enableNotify, fieldsAreEqual, get, getAllFields, getEventIn, getEventOut, getField, getFieldName, hasDefaultValues, isNotifyEnabled, set, setToDefaultsMethods inherited from class com.openinventor.inventor.misc.SoBase
dispose, getName, isDisposable, isSynchronizable, setName, setSynchronizable, touchMethods inherited from class com.openinventor.inventor.Inventor
getNativeResourceHandle
-
Field Details
-
min
Minimum value for the counter. -
max
Maximum value for the counter. -
step
Counter step value. -
trigger
Go to the next step. -
reset
At the next trigger, reset the counter to the specified value. -
output
(SoSFShort) Counts min-to-max in step increments. -
syncOut
(SoSFTrigger) Triggers at cycle start.
-
-
Constructor Details
-
SoCounter
public SoCounter()Constructor.
-