...
https://github.com/mdpnp/mdpnp
Start the application
Choose Domain Id 0 (or remeber the choosen value) and run "Start ICE_Supervisor".
You can now "Create a local an ICE Device Adap...Adapter"
And choose e.g. Simulated Pulse Oximeter. Call "Start Simlulated Pulse Oximeter" . After some time, you see e.g.and call "Start PO_Simulator".
Now you will get to the main screen:
When you double click on Puls Ox (Simulated) you will see:
Now back to Odysseus:
...
Code Block | ||
---|---|---|
| ||
#PARSER PQL #RUNQUERY sampleArray := RECEIVEDDSSOURCE({ source = 'SampleArray', transport = 'dds', datahandler = 'tuple', options=[ ['qosFile',' qosfile='${WORKSPACEPROJECT}/USERice_QOS_PROFILESlibrary.xml'], ['idlFile','idlfile='${WORKSPACEPROJECT}/ice.idl'], ['topic',='SampleArray'], ['topicType','topictype='ice::SampleArray'], ['qosLibrary',qoslibrary='ice_library'], ['qosProfile','qosprofile='waveform_data'], ['domain','0'] =0 ], schema = [ ['unique_device_identifier', 'String'], ['metric_id', 'String'], ['instance_id','Long'], ['unit_id','String'], ['frequency','long'], ['values','List<Double>'], } ['time','Tuple<Long,Long>'] ] } ) |
There are two important files:
...
They contain information necessary for DDS. You can download the files from the following locations:
https://github.com/mdpnp/hello-openicemdpnp/blob/master/data-types/x73-idl-rti-dds/USER_QOS_PROFILES.xml
Copy them to the workspace.
...
Now run the query, and show as table. You should see something like:
As you can see, the values attribute contains a list, and the time attribute attributes a tuple.
Storing to a relational database
If you want to store this data e.g. in a database this is not possible directly. You have to "flatten" the data. This can be done as follows:
...
The output will be as:
and
Storing to a document store
You can store complex objects to a document store like MongoDB. For this, you have to convert the tuple to a KeyValueObject. This can be done with the TupleToKeyValueOperator.
See MongoDB Feature for more information on the Mongo DB feature.
Code Block |
---|
#RUNQUERY
kv = TUPLETOKEYVALUE(sampleArray)
mongo = MONGODBSINK({PORT = port, HOST = 'host', COLLECTIONNAME = 'collectionname', DATABASE = 'database'}, kv)
|