Module GseosDecoder
Previous  Top  Next

A decoder is a function that gets triggered on arrival of a specific block. It then reads data from this block and maybe other blocks and generates new blocks. In order for the decoder to be called on the arrival of a specific block it has to be registered with this block. To do this you have to create a decoder object and add it to the list of decoders for that block. Every time the block arrives your decoder will be executed. The decoders will be executed in the order they appear in the list of decoders for the block. Usually as the system grows you will need to refine your data products more and more. This will naturally lead to a layered system of blocks and decoders. You can display the decoder hierarchy in the GSEOS Explorer.

To construct a decoder you have to instantiate a decoder object of the decoder class. The constructor of the decoder object takes the unique decoder name, the decoder function you want executed and a list of blocks the decoder outputs. The decoder function itself takes one parameter. The block that triggers the decoder is passed into the decoder function. Therefore when you register one decoder for multiple blocks you will be able to distinguish which block arrived. In the list of output blocks you specify all blocks you may generate. This allows the system to give you an overview of the decoder hierarchy. You can manage your decoders with the GSEOS Explorer.
The decoder can be disabled by setting bEnable to false. It can be reenabled by setting bEnable to true. The variable dwCnt holds the number of times the decoder has been executed. You can reset this value if desired.
If the decoder raises an exception it will be disabled. You should catch all exceptions you don't want to terminate the decoder.
It is advised that you give your decoder a documentation string. This documentation will be displayed in the GSEOS Explorer.

For more information please refer to the examples:

·Simple dispatch decoder  
·Variable length spin decoder