Skip to content

feat(core): create a multiConfigController

Description

ConfigController allows starting a given configuration, with inout data, channels and parameters.

However, in various applications, it would be expected to be able to choose on runtime which config will be started, depending on a key.

As long as the configurations respects the multiconfig inout and parameters, this would make it possible to create equivalent to configuration interfaces / instances, and allow to increase the xml part atomicity, and scalability.

We here create a SMulticonfigController. On the contrary to SConfigController, the present service supports a list of configs. Each of them is associate to a name, which has to be unique. The actual config started can be set through a setConfig slot or through the xml configuration. The config is started on the setConfig call or the update call.

The parameters of the template configuration are filled according to the and tags. Using is especially useful to wait for deferred objects, but it is strongly recommended to use it to pass any object.

Note that is not supported. This would have no meaning, because we can't ensure the object won't be modified in the configuration. is also not supported because if we assume that the target configuration produces the object, thus we would not get a valid id for the matching parameter.

Closes #1124 (closed)

How to test it?

Add a SMultiConfigControllerin a config

        <service type="sight::service::SMultiConfigController" >
            <appConfig default="config1" name="...">
                <config name="config1" id="..." />
                <config name="config2" id="..." />
                <config name="config3" id="..." />
            </appConfig>
            <inout group="data">
                <key name="object1" uid="..." />
                <key name="object2" uid="..." />
                ...
            </inout>
            <parameter replace="channel" by="changeValueChannel"  />
            <parameter replace="service" by="serviceUid" />
        </service>

and check that you can start any of your config.

Edited by Michaël KUGLER

Merge request reports