Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PositionerManager vs. ESP32StageManager class conflict #38

Open
mgstingl opened this issue Feb 24, 2023 · 4 comments
Open

PositionerManager vs. ESP32StageManager class conflict #38

mgstingl opened this issue Feb 24, 2023 · 4 comments

Comments

@mgstingl
Copy link

Hi @beniroquai !

The ESP32StageManager doesn't use the base definition (doesn't respect the abstract methods) of the PositionerManager, even when it inherits from it.

  1. The move method in the ESP32StageManager switches dist for value, I guess to include the is_absolute option, but conflicting with the abstract method.

  2. In general, the ESP32Stage interface could include another abstraction layer that integrates the motor and home modules, in order to integrate it in the manager:

  self._motor = self._rs232manager._esp32.motor
  self._homeModule = self._rs232manager._esp32.home

These 2 lines would be simplified with the following line, which includes the business logic of the complete XYZ stage:

self._stage = self._rs232manager._esp32.stage

This would follow the convention of the Manager class instantiating a low-level interface, like for example in this LantzLaserManager, where the Manager instantiates a self._laser:

class LantzLaserManager(LaserManager):
    def __init__(self, laserInfo, name, isBinary, valueUnits, valueDecimals, driver,
                 **_lowLevelManagers):
        self.__logger = initLogger(self, instanceName=name)
        ports = laserInfo.managerProperties['digitalPorts']
        # Init laser
        self._laser = LantzLaser(driver, ports)

Kind regards!

@beniroquai
Copy link
Collaborator

Hey @mgstingl thanks for reporting that! I fully agree.
What would you suggest in order to improve the structure? :)

@mgstingl
Copy link
Author

mgstingl commented Mar 3, 2023

Hi @beniroquai !

I will try to provide some improvements while working on the scan script that can use a deck configuration and is independent of the stage used. When I get it working, I will push it to Labmaite's branch and comment it.

@beniroquai
Copy link
Collaborator

In best case you can also file a PR @mgstingl ;-)

@beniroquai
Copy link
Collaborator

@mgstingl did you ever solve this issue? ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants