Yeah, but since CODESYS3 does not support method overloads, we still need to provide some sort mechanism (trick) that will support these parallel calls. I am thinking about a base Metric class with two separate inherited implementations. Liskov polymorphism principle says these are interchangeable.

Get Outlook for Android


From: tickets@mqttsparkplugb.prj.forge.codesys.com <tickets@mqttsparkplugb.prj.forge.codesys.com> on behalf of i-campbell <forge@codesys.com>
Sent: Friday, December 18, 2020 2:12:42 PM
To: Ticket #102: Paylaod: refactor <102@tickets.mqttsparkplugb.prj.forge.codesys.com>
Subject: [mqttsparkplugb:tickets] #102 Paylaod: refactor
 



---

** [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/>