API Scope: Difference between revisions
Appearance
XML import |
No edit summary |
||
| (14 intermediate revisions by 2 users not shown) | |||
| Line 1: | Line 1: | ||
<sidebar>API | <sidebar>API Contents</sidebar> | ||
Data scope additions | Data scope additions | ||
__TOC__ | __TOC__ | ||
| Line 12: | Line 13: | ||
|width="35%"|[[API Scope.AddStream|AddStream]] | |width="35%"|[[API Scope.AddStream|AddStream]] | ||
|Adds a stream to the given group suitable for inputs and operations | |Adds a stream to the given group suitable for inputs and operations | ||
|- | |||
|width="35%"|[[API Scope.AddBuffer|AddBuffer]] | |||
|Adds a fixed-view stream to the given group suitable for inputs and operations | |||
|- | |||
|width="35%"|[[API Scope.Rename|Rename]] | |||
|Renames the given scope group, stream or buffer | |||
|- | |- | ||
|width="35%"|[[API Scope.AddPort|AddPort]] | |width="35%"|[[API Scope.AddPort|AddPort]] | ||
| Line 24: | Line 31: | ||
|width="35%"|[[API Scope.AddOp|AddOp]] | |width="35%"|[[API Scope.AddOp|AddOp]] | ||
|Adds an operation to act on the inputs of the stream | |Adds an operation to act on the inputs of the stream | ||
|- | |||
|width="35%"|[[API Scope.ClearOps|ClearOps]] | |||
|Clears all inputs and operations from the given stream | |||
|- | |||
|width="35%"|[[API Scope.SetBuffer|SetBuffer]] | |||
|Sets the contents of a snapshot stream | |||
|- | |- | ||
|width="35%"|[[API Scope.SetCustom|SetCustom]] | |width="35%"|[[API Scope.SetCustom|SetCustom]] | ||
|Sets one of 32 custom analog values for the group | |Sets one of 32 custom analog values for the group | ||
|- | |||
|width="35%"|[[API Scope.GetSnapshot|GetSnapshot]] | |||
|Gets a block of the output stream with each input sample operated on, returns number of samples read | |||
|- | |||
|width="35%"|[[API_Scope.GetOutputBlock|GetOutputBlock]] | |||
|Gets a block of the output stream | |||
|- | |||
|width="35%"|[[API Scope.FindOutput|FindOutput]] | |||
|Searches back through the output history for a value, returns offset of found sample from TimeUS, 0 if not found | |||
|- | |||
|width="35%"|[[API Scope.FindBaud|FindBaud]] | |||
|Attempts to calculate the baud given a series of transitions for the stream, returns calculated baud | |||
|- | |||
|width="35%"|[[API Scope.AddOverlay|AddOverlay]] | |||
|Adds a packet overlay to the stream at a given offset from the current time | |||
|- | |||
|width="35%"|[[API Scope.AddOverlays|AddOverlays]] | |||
|Adds overlay packets to the stream by decoding the stream contents | |||
|- | |||
|width="35%"|[[API Scope.ClearOverlays|ClearOverlays]] | |||
|Clears existing overlay packets from the stream | |||
|- | |||
|width="35%"|[[API Scope.ClearAllOverlays|ClearAllOverlays]] | |||
|Clears all existing overlay packets from the stream | |||
|} | |} | ||
==Constants provided for this class== | ==Constants provided for this class== | ||
{| class="wikitable" | {| class="wikitable" width="85%" | ||
|+ Used by [[API Scope.AddOp|AddOp]]() | |||
|- | |- | ||
!width=" | !width="10%"|Type | ||
!width=" | !width="20%"|Name | ||
!width=" | !width="20%"|Value | ||
!width="60%"|Description | |||
|- | |- | ||
|LONG | |LONG | ||
|Op_Bound | |Op_Bound | ||
|1 | |1 | ||
|Bound the current value to the expected range of the input | |||
|- | |- | ||
|LONG | |LONG | ||
|Op_Scale | |Op_Scale | ||
|2 | |2 | ||
|Divide the current value to the expected range of the input | |||
|- | |- | ||
|LONG | |LONG | ||
|Op_Xor | |Op_Xor | ||
|3 | |3 | ||
|Exclusive-or with the provided integer argument | |||
|- | |- | ||
|LONG | |LONG | ||
|Op_AndNot | |Op_AndNot | ||
|4 | |4 | ||
|Clear the bits in the provided integer argument | |||
|- | |- | ||
|LONG | |LONG | ||
|Op_And | |Op_And | ||
|5 | |5 | ||
|Isolate only the bits in the provided integer argument | |||
|- | |- | ||
|LONG | |LONG | ||
|Op_Orr | |Op_Orr | ||
|6 | |6 | ||
|Set the bits in the provided integer argument | |||
|- | |- | ||
|LONG | |LONG | ||
|Op_Not | |Op_Not | ||
|7 | |7 | ||
|Invert (ones-compliment) the current input | |||
|- | |- | ||
|LONG | |LONG | ||
|Op_Add | |Op_Add | ||
|8 | |8 | ||
|Add the argument to the current input | |||
|- | |- | ||
|LONG | |LONG | ||
|Op_Sub | |Op_Sub | ||
|9 | |9 | ||
|Subtract the argument from the current input | |||
|- | |- | ||
|LONG | |LONG | ||
|Op_Mul | |Op_Mul | ||
|10 | |10 | ||
|Multiply the argument by the current input | |||
|- | |- | ||
|LONG | |LONG | ||
|Op_Div | |Op_Div | ||
|11 | |11 | ||
|Divide the current input by the argument | |||
|- | |- | ||
|LONG | |LONG | ||
|Op_Pow | |Op_Pow | ||
|12 | |12 | ||
|Raise the input to the power of the argument | |||
|- | |- | ||
|LONG | |LONG | ||
|Op_Neg | |Op_Neg | ||
|13 | |13 | ||
|Negate (twos compliment) the current input | |||
|- | |- | ||
|LONG | |LONG | ||
|Op_Recip | |Op_Recip | ||
|14 | |14 | ||
|Perform the reciprocal on the current input | |||
|- | |- | ||
|LONG | |LONG | ||
|Op_Sqrt | |Op_Sqrt | ||
|15 | |15 | ||
|Perform a square root on the current input | |||
|- | |- | ||
|LONG | |LONG | ||
|Op_Ln | |Op_Ln | ||
|16 | |16 | ||
|Perform a natural logarithm on the current input | |||
|- | |- | ||
|LONG | |LONG | ||
|Op_Ln2 | |Op_Ln2 | ||
|17 | |17 | ||
|Perform a base-2 logarithm on the current input | |||
|- | |- | ||
|LONG | |LONG | ||
|Op_Cos | |Op_Cos | ||
|18 | |18 | ||
|Convert the input to its cosine value (input is in radians) | |||
|- | |- | ||
|LONG | |LONG | ||
|Op_Sin | |Op_Sin | ||
|19 | |19 | ||
|Convert the input to its sine value (input is in radians) | |||
|- | |- | ||
|LONG | |LONG | ||
|Op_Tan | |Op_Tan | ||
|20 | |20 | ||
|Convert the input to its tangent value (input is in radians) | |||
|- | |- | ||
|LONG | |LONG | ||
|Op_Int | |Op_Int | ||
|21 | |21 | ||
|Convert the input from a float to an integer (using the floor function) | |||
|} | |||
{| class="wikitable" width="85%" | |||
|+ Used by [[API Scope.FindOutput|FindOutput]]() | |||
|- | |||
!width="10%"|Type | |||
!width="20%"|Name | |||
!width="20%"|Value | |||
!width="60%"|Description | |||
|- | |||
|LONG | |||
|Find_Lower | |||
|1 | |||
|Match a search when output is lower than the target value | |||
|- | |||
|LONG | |||
|Find_Equal | |||
|2 | |||
|Match a search when output is equal to the target value | |||
|- | |||
|LONG | |||
|Find_Higher | |||
|4 | |||
|Match a search when output is greater than the target value | |||
|- | |||
|LONG | |||
|Find_LowHigh | |||
|8 | |||
|Match a search when output goes lower to higher than the target | |||
|- | |||
|LONG | |||
|Find_HighLow | |||
|16 | |||
|Match a search when output goes higher to lower than the target | |||
|} | |||
{| class="wikitable" width="85%" | |||
|+ Used by [[API Scope.AddOverlays|AddOverlays]]() | |||
|- | |||
!width="10%"|Type | |||
!width="20%"|Name | |||
!width="20%"|Value | |||
!width="60%"|Description | |||
|- | |||
|LONG | |||
|Overlay_LSBF | |||
|1 | |||
|Flags least-significant bit first, else most-significant bit first | |||
|- | |||
|LONG | |||
|Overlay_Invert | |||
|2 | |||
|Flags to invert the bits in a packet before calculating the packet value | |||
|} | |} | ||
==Examples== | ==Examples== | ||
''No examples | ''<span style="color:red;">No additional examples</span>'' | ||
==See also== | ==See also== | ||
''<span style="color:red;">No additional information</span>'' | |||
Latest revision as of 11:04, 1 September 2014
<sidebar>API Contents</sidebar> Data scope additions
Functions provided for this class
| AddGroup | Adds a group to the scope to which streams may be added |
| AddStream | Adds a stream to the given group suitable for inputs and operations |
| AddBuffer | Adds a fixed-view stream to the given group suitable for inputs and operations |
| Rename | Renames the given scope group, stream or buffer |
| AddPort | Adds an input to the stream from a port |
| AddAnalog | Adds an input to the stream from an analog channel |
| AddCustom | Adds an input to the stream from a custom injection |
| AddOp | Adds an operation to act on the inputs of the stream |
| ClearOps | Clears all inputs and operations from the given stream |
| SetBuffer | Sets the contents of a snapshot stream |
| SetCustom | Sets one of 32 custom analog values for the group |
| GetSnapshot | Gets a block of the output stream with each input sample operated on, returns number of samples read |
| GetOutputBlock | Gets a block of the output stream |
| FindOutput | Searches back through the output history for a value, returns offset of found sample from TimeUS, 0 if not found |
| FindBaud | Attempts to calculate the baud given a series of transitions for the stream, returns calculated baud |
| AddOverlay | Adds a packet overlay to the stream at a given offset from the current time |
| AddOverlays | Adds overlay packets to the stream by decoding the stream contents |
| ClearOverlays | Clears existing overlay packets from the stream |
| ClearAllOverlays | Clears all existing overlay packets from the stream |
Constants provided for this class
| Type | Name | Value | Description |
|---|---|---|---|
| LONG | Op_Bound | 1 | Bound the current value to the expected range of the input |
| LONG | Op_Scale | 2 | Divide the current value to the expected range of the input |
| LONG | Op_Xor | 3 | Exclusive-or with the provided integer argument |
| LONG | Op_AndNot | 4 | Clear the bits in the provided integer argument |
| LONG | Op_And | 5 | Isolate only the bits in the provided integer argument |
| LONG | Op_Orr | 6 | Set the bits in the provided integer argument |
| LONG | Op_Not | 7 | Invert (ones-compliment) the current input |
| LONG | Op_Add | 8 | Add the argument to the current input |
| LONG | Op_Sub | 9 | Subtract the argument from the current input |
| LONG | Op_Mul | 10 | Multiply the argument by the current input |
| LONG | Op_Div | 11 | Divide the current input by the argument |
| LONG | Op_Pow | 12 | Raise the input to the power of the argument |
| LONG | Op_Neg | 13 | Negate (twos compliment) the current input |
| LONG | Op_Recip | 14 | Perform the reciprocal on the current input |
| LONG | Op_Sqrt | 15 | Perform a square root on the current input |
| LONG | Op_Ln | 16 | Perform a natural logarithm on the current input |
| LONG | Op_Ln2 | 17 | Perform a base-2 logarithm on the current input |
| LONG | Op_Cos | 18 | Convert the input to its cosine value (input is in radians) |
| LONG | Op_Sin | 19 | Convert the input to its sine value (input is in radians) |
| LONG | Op_Tan | 20 | Convert the input to its tangent value (input is in radians) |
| LONG | Op_Int | 21 | Convert the input from a float to an integer (using the floor function) |
| Type | Name | Value | Description |
|---|---|---|---|
| LONG | Find_Lower | 1 | Match a search when output is lower than the target value |
| LONG | Find_Equal | 2 | Match a search when output is equal to the target value |
| LONG | Find_Higher | 4 | Match a search when output is greater than the target value |
| LONG | Find_LowHigh | 8 | Match a search when output goes lower to higher than the target |
| LONG | Find_HighLow | 16 | Match a search when output goes higher to lower than the target |
| Type | Name | Value | Description |
|---|---|---|---|
| LONG | Overlay_LSBF | 1 | Flags least-significant bit first, else most-significant bit first |
| LONG | Overlay_Invert | 2 | Flags to invert the bits in a packet before calculating the packet value |
Examples
No additional examples
See also
No additional information