feat:unravel vector for dnp3/modbus#18
Conversation
| points.append({'tag': tag, 'value': float(v), 'ts': 0}) | ||
| if isinstance(v, list): | ||
| for i, x in enumerate(v): | ||
| points.append({'tag': f'{tag}_{i}', 'value': float(x), 'ts': 0}) |
There was a problem hiding this comment.
Is it assumed that the tags are 1-indexed, so these should be tag_1, tag_2, and tag_3, essentially matching the phase #?
There was a problem hiding this comment.
It is essentially whatever meaning the user assigns to the items in the list. Currently three phase+pyDss/opendss puts out a vector with 4 values, 3 phases+neutral, some other simulator could put out neutral, A, B, C, D. I think indexing from 0 is simpler (with associated ot-sim app changes), but I can switch to indexing from 1. I have confirmed functionality with a manual injection of ot-sim config.xml file with 3 phases.
There was a problem hiding this comment.
Makes sense, probably best to just leave it 0-indexed and let the user assign more specific meaning instead of assuming.
This lets the ot-sim device handle 3 phase vector subscriptions from Helics. The MR cracks open the list and publishes the values individually. It assumes the tags on the dnp3 side will be named with the suffix "_{index}"