classPiiSequenceGenerator
#include <PiiSequenceGenerator.h>
An operation that generates sequences of numbers.
Inherits PiiDefaultOperation
Description
The sequence goes from sequenceStart to sequenceEnd, stepping step units each time.
Inputs
Outputs
Properties
|
bool
|
The data type of the output. |
|
int
|
The number of times the sequence will be repeated. |
|
double
|
The last value in the sequence. |
|
The sequence mode. |
|
|
double
|
The first value in the sequence. |
|
double
|
The increment on each iteration. |
Public types
|
enum
|
{ Repeat, BackAndForth }
Sequence modes. |
Constructors and destructor
Public member functions
|
virtual void
|
(
Checks the operation for execution. |
|
bool
|
( )
|
|
int
|
( )
|
|
double
|
( )
|
|
( )
|
|
|
double
|
( )
|
|
void
|
(
|
|
void
|
(
|
|
void
|
(
|
|
void
|
|
|
void
|
(
|
|
void
|
(
|
|
double
|
( )
|
Protected member functions
|
virtual void
|
( )
Executes one round of processing. |
Property details
-
bool integerOutput
[read, write]The data type of the output.
By default, this value is
falseanddoubleswill be emitted. Setting this value totruecauses converts the output toints. -
int repeatCount
[read, write]The number of times the sequence will be repeated.
Once this count is reached, the operation will send a stop signal which will stop the whole execution engine if properly connected. The default value is zero, which means "eternally". This value has no effect if
triggeris connected. -
double sequenceEnd
[read, write]The last value in the sequence.
The default value is 1. This value must be larger than or equal to sequenceStart.
-
SequenceMode sequenceMode
[read, write]The sequence mode.
The default mode is
Repeat. -
double sequenceStart
[read, write]The first value in the sequence.
The default value is 0. This value must be less than or equal to sequenceEnd.
-
double step
[read, write]The increment on each iteration.
Use a negative value to go backwards.
Enumeration details
-
enum SequenceMode
Sequence modes.
-
Repeat- the sequence will start at the beginning once sequenceEnd is reached. -
BackAndForth- the sequence goes back and forth between sequenceEnd and sequenceStart.
-
Function details
-
PiiSequenceGenerator
() -
virtual void check
(- bool reset
[virtual]Checks the operation for execution.
This function creates a suitable flow controller by calling createFlowController(). It then sets the flow controller to the active processor and sets the processor as the input controller for all inputs.
If you change socket groupings in your overridden implementation, please call PiiDefaultOperation::check() after that. Otherwise, your new groupings will not be in effect.
Reimplemented from PiiDefaultOperation.
-
bool integerOutput
() -
int repeatCount
() -
double sequenceEnd
() -
SequenceMode sequenceMode
() -
double sequenceStart
() -
void setIntegerOutput
(- bool integerOutput
-
void setRepeatCount
(- int repeatCount
-
void setSequenceEnd
(- double sequenceEnd
-
void setSequenceMode
-
void setSequenceStart
(- double sequenceStart
-
void setStep
(- double step
-
double step
() -
virtual void process
()[protected, virtual]Executes one round of processing.
This function is invoked by the processor if the necessary preconditions for a new processing round are met. This function does all the necessary calculations to create output objects and sends them to output sockets.
Calls to process(), syncEvent(), and setProperty() are synchronized and cannot occur simultaneously. PiiDefaultOperation ensures this by locking processLock() for reading before calling process().
Note: With time-consuming operations, one should occasionally check that the operation hasn't been interrupted, i.e. that state() returns
Running.Exceptions
- PiiExecutionException
-
whenever an unrecoverable error occurs during a processing round, the operation is interrupted, or finishes execution due to end of input data.
Reimplemented from PiiDefaultOperation.
Add a note
Not a single note added yet. Be the first, add yours.