01-03-2022 09:37 AM
Hopefully this has a simple answer.
I am modifying the Python DataPlugin example from the example, "Creating a Python DataPlugin" example, and would like to populate the tdm_tree with as many channels that are in the file, rather than a fixed number, how can I do this?
The example loads 6 data channels, and my file has a varying number.
Thanks!
Julia
01-04-2022 04:34 AM
The TDM tree is just a python dictionary where channels is just a python array.
self.tdm_tree = { "author": "National Instruments", "description": "Example file", "groups": [{ "name": "Example", "description": "The first group", "time": datetime.datetime(2020, 2, 11, 15, 31, 59, 342380), "channels": [{ "name": self.channelNames[0], "description": "", "values": [], "info": "Time in seconds", "type": "DataTypeChnFloat64" }] }] }
So you can work on the structure using standard python mechanisms to extend and modify it.