---
** [tickets:#102] Paylaod: refactor **
**Status:** open
**Milestone:** 2.0.0.0: Protobufs full
**Labels:** Payload Improvement
**Created:** Fri Dec 18, 2020 01:12 PM UTC by i-campbell
**Last Updated:** Fri Dec 18, 2020 01:12 PM UTC
**Owner:** i-campbell
At the moment, there is a relatively complex structure for adding metrics and its subobjects to a Device, and then later to a payload. You have to add all of the pools of objects, and pass these between the FB's.
Some issues:
1. The calls for each Object are quite a lot of lines of code, with up to 10 different pools needed.
2. Some people might accidentally add a metric to two different owners.
So the proposal is for each object to have an interface to register its children. The children then use this interface as an input, and register themselves.
Note that a Metric may have two owners, a Device and a Payload.
Payload Implements IPaylaod
Metric.itfOwner := Payload;
Or myMetric : Metric := (itfOwner := Paylaod);
or myMetric(itfOwner := Payload);
Also take into consideration that the SCADA node might actually want the freedom of Pool Objects, ie it might still want MetricsPool. This might mean making two seperate calls available.
---
Sent from forge.codesys.com because you indicated interest in <
https://forge.codesys.com/prj/mqttsparkplugb/tickets/102/>
To unsubscribe from further messages, please visit <
https://forge.codesys.com/auth/subscriptions/>