Project

General

Profile

Actions

Feature #94

open

Provide a standard "genom_set_port()" service to set an input port value

Added by Anthony Mallet over 8 years ago. Updated over 8 years ago.

Status:
New
Priority:
Normal

Description

Currently, the "connect_port()" service allows to connect an input port to an output port. This is sufficient when there exist such a compatible output port.

However, one may wish to set an input port directly from a client (matlab, prs, tcl) either for debugging or because the client is able to provide useful data for this port. Consider for instance the (real) use case where a simulink block wishes to feed a genom controller.

There are several possibilities for implementing this:

1. manually define an ad-hoc service (function) for this, in the relevant components. No change in genom required.

2. let all the clients (matlab, prs, tcl as well as the future ones) implement this, by adding a possibility to create (output) ports in the clients and then invoke "connect_port()" to connect the relevant components to those ports. Requires changes in the C client interface, as well as patching all existing clients.

3. implement a standard "genom_set_port()" function in the genom interface. All clients are already able to handle this properly, as the new function would appear as a standard genom service. This merely requires augmenting the stardard genom interface. One issue is that this cannot be written in in a standard .gen file, as this typically requires knowing the port(s) dataype(s) so that one can define e.g "function genom_set_port_foo(in ::foo::type data);" to set port "foo" to the data of type "foo::type". So this interface would have to be generated/parsed as dynamic string in the template parser. This is doable, although less "clean" than just having the current genom.gen file.

If we want to implement this feature, I prefer the 3rd approach, as this is the less invasive change (no client protocol update, transparent to existing clients). While here, we could also provide more self-descriptive port connection services, e.g. "genom_connect_port_foo(in string remote)" instead of "genom_connect_port(in string local, in string remote)".

If we consider this change is not useful, then the 1st approach is better.

What do you think?

Actions

Also available in: Atom PDF