| 1 |
NAME SoCounter SoCounter "" { triggered integer counter } |
| 2 |
|
| 3 |
DESC { |
| 4 |
This engine is a counter that outputs numbers, starting at a |
| 5 |
minimum value, increasing by a step value, and ending with a number |
| 6 |
that does not exceed the maximum value. It outputs the next |
| 7 |
number whenever the \vtrigger\. input is touched. When the maximum number |
| 8 |
is reached, it starts counting from the beginning again. |
| 9 |
\p |
| 10 |
At any time the counter can be reset to a specific value by setting |
| 11 |
the \vreset\. input field to that value. The next time the counter |
| 12 |
is triggered it will start counting from there. Note that the counter will |
| 13 |
always output numbers based on the min, max and step values, and |
| 14 |
setting the reset value does not affect those input fields. |
| 15 |
If the reset value is not a legal counter value, the counter will still |
| 16 |
behave as though it is. |
| 17 |
\b |
| 18 |
If \vreset\. is greater than \vmax\., the counter is set to \vmax\.. |
| 19 |
If \vreset\. is less than \vmin\., the counter is set to \vmin\.. |
| 20 |
If \vreset\. is between steps, the counter is set to the lower step value. |
| 21 |
\. |
| 22 |
\p |
| 23 |
Each time a counting cycle is started, the \vsyncOut\. output is triggered. |
| 24 |
This output can be used to synchronize some other event with the |
| 25 |
counting cycle. |
| 26 |
} |
| 27 |
|
| 28 |
INCLUDE engines/SoCounter.h |
| 29 |
|
| 30 |
INPUT min { Minimum value for the counter.} |
| 31 |
INPUT max { Maximum value for the counter.} |
| 32 |
INPUT step { Counter step value.} |
| 33 |
INPUT trigger { Go to the next step. } |
| 34 |
INPUT reset { At the next trigger, reset the counter to the specified value. } |
| 35 |
|
| 36 |
OUTPUT output { Counts min-to-max in step increments. } |
| 37 |
OUTPUT syncOut { Triggers at cycle start. } |
| 38 |
|
| 39 |
METHOD Create SoCounter() { Constructor } |
| 40 |
|
| 41 |
ALSO { SoTimeCounter, SoEngineOutput } |