The post-processing of the data
returned by a devices or by the stub interface
can be managed with the help of
:PostScript
:clojure
functions placed in thesrc/devhub/pp_scripts
folder. Function signature is(fn-name task data)
. Should return amap
:PostProcessing
:javascript
code given as an array of source lines. The strings_x
,_t_start
and_t_stop
are replaced on string level. The resulting string is evaluated. Should return valid json.:PostScriptPy
:python
scripts placed in theresources/py
folder. The scripts receive the json encodedtask
as 2nd and the json encodeddata
as 3rd argument. Should return valid json.
See MODBUS Examples.
Note: The non json standard key encoding with a single quote is not supported. So:
PostProcessing:["{'A':100}"]
will throw a exception. Use the valid:
PostProcessing:["{\"A\":100}"]
or switch to first class :PostScript.
TODO: Example needed