Ulm-IQO / qudi-core

A framework for modular measurement applications.
GNU General Public License v3.0
25 stars 19 forks source link

[New Feature] implement a way to check if a module is remote #64

Open qku opened 10 months ago

qku commented 10 months ago

Feature Description

Sometimes it's nice to know if a module (hardware mostly probably) is running on a remote qudi instance. Some methods may work differently or not at all through a remote connection. In order to know when to use alternatives, the module that is connected to the remote module should know if it is remote.

Related Problem

No response

Considered Alternatives

There may be ways to use the module manager to find out if a module is remote, but these are likely difficult to access. Another alternative is to check if objects passed back from a module are of the netref type. This requires the passing of some kind of test object though.

Additional Context

No response

Contact Details

No response

Neverhorst commented 10 months ago

Just to clarify: You want to check the connection to a module for remote access, right? E.g. something like:

class MyLogicModule(LogicBase):
    _my_hardware_module = Connector(...)

    def do_stuff(self, ...):
        if self._my_hardware_module.is_remote:
            ...
qku commented 9 months ago

Yes, I would like to check if a module is remote from a connected module. I guess it does not make sense for a module to test if itself is remote, as the remoteness only stems from the relationship between two modules.

Neverhorst commented 9 months ago

Exactly, that was my line of thought. The checker on the Connector can surely be implemented and will probably come with the promised module management overhaul.