qass.tools.analyzer.input_observer
Classes:
| Name | Description |
|---|---|
InputObserver |
The InputObserver class can observe a Analyzer4D data stream for toggles of input bits. |
InputObserver
The InputObserver class can observe a Analyzer4D data stream for toggles of input bits. Its configuration is a list of tuples to observe different input bits. Input bits can be observed for high or low states (True/False). Furthermore an offset after the end of a range can be configured.
When a finished period for an input has been detected the callback function is called.
In each clock cycle the function tick() must be called with the current operator network time. process_start() is called to reset the InputObserver for a new process. process_end() is called to finish all currently detected periods. The callback is then called even if the delay did not expire.
Methods:
| Name | Description |
|---|---|
__init__ |
Parameters |
process_end |
This function must be called in the phase eval_process_end() of the operator network. |
process_init |
The function process_start must be called in the phase eval_process_init() of the operator network. |
tick |
This function must be called in the phase eval_process_run() of the operator network. |
Source code in src/qass/tools/analyzer/input_observer.py
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 | |
__init__
__init__(rti: RunTimeInfo_IF, inputs: List[Tuple[int, int, bool, int]], callback, update_time_ms: Union[int, None] = None)
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
rti
|
RunTimeInfo_IF
|
Operator network's runtime info object. This object contains information about the current analysis. |
required |
inputs
|
List[Tuple[int, int, bool, int]]
|
list of input oberserver configurations. Each tuple in the list must habe the following form: (byte, bit, state [True/False], delay [in nanoseconds]) |
required |
callback
|
Callable[[tuple[int, int, bool, int], int, int]]
|
The callback function is called. Its signature must be: ((byte, bit, state, delay), start_time, end_time). The times are provided in nanoseconds. |
required |
update_time_ms
|
int
|
declares how often the IO input state is checked for changes. |
None
|
Source code in src/qass/tools/analyzer/input_observer.py
process_end
This function must be called in the phase eval_process_end() of the operator network. It will finish all currently opened ranges and call the callback for delayed ranges even if the delay has not expired yet.
Source code in src/qass/tools/analyzer/input_observer.py
process_init
The function process_start must be called in the phase eval_process_init() of the operator network.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
stream
|
Buffer_Py_IF
|
The stream that should be monitored for input changes. Ensure that the stream has an appropriate resolution for your demands. |
required |
Source code in src/qass/tools/analyzer/input_observer.py
tick
This function must be called in the phase eval_process_run() of the operator network. It is called for every single spectrum and checks the current input state.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
ignore_getIO_exception
|
bool
|
If True exceptions raised by missing IO information in the last specs of a buffer are ignored. Otherwise they will be reraised. |
False
|