Skip to content

class ProbeCommandGroup has inheritance bug #12

Closed

Description

@frufru145

Running commands for the motorized probes using the sentio-prober-control V24.0.2 produces the following error. Could you please check if there is an issue?

Initializing package sentio_prober_control
Initializing package sentio_prober_control.Sentio
Initializing package sentio_prober_control.Communication
Initializing package sentio_prober_control.Sentio.CommandGroups
Traceback (most recent call last):
  File "c:\Users\TLP-user\MyPy\tm-devices-esd\test_MPI_drivers.py", line 55, in <module>
    main()
  File "c:\Users\TLP-user\MyPy\tm-devices-esd\test_MPI_drivers.py", line 17, in main
    prober.probe.move_probe_separation(MpiEnumerations.ProbeSentio.West)
  File "c:\Users\TLP-user\MyPy\tm-devices-esd\venv\Lib\site-packages\sentio_prober_control\Sentio\CommandGroups\ProbeCommandGroup.py", line 187, in move_probe_separation
    self.__comm.send("move_positioner_separation {0}".format(probe.toSentioAbbr()))
    ^^^^^^^^^^^^^^^^
AttributeError: 'SentioProber' object has no attribute 'send'

Here is a simple script to reproduce this error:

import sentio_prober_control.Sentio.ProberSentio as MpiSentio
import sentio_prober_control.Sentio.Enumerations as MpiEnumerations
from sentio_prober_control.Communication.CommunicatorTcpIp import CommunicatorTcpIp
import time

prober = MpiSentio.SentioProber(CommunicatorTcpIp.create("100.0.2.3:5555"))
prober.probe.move_probe_separation(MpiEnumerations.ProbeSentio.West)

It seems to me the issue is in ProbeCommandGroup.py, which does not have the "self.__comm" attribute, but the "self.comm" attribute instead. Just fixing this bug raises another error in CommandGroupBase.py where "self.__parent" does not exist. I did not dig further than this.

Could it be that some updates to higher classes broke the inheritance in the "ProbeCommandGroup" class?

Activity

  1. beltoforion commented on Sep 30, 2024

    @beltoforion
    Contributor

    Yes, that is likely the case. It appears i overlooked this class when updating the package.

    Any use of "self.__comm" should be replaced with "self.comm" and the constructor should call "super().init(comm)". That should fix the parent issue. You can test this but it may not be enough. I'm currently not in the office. I'll check this in the next days and push an update.

    Thanks for reporting the issue.

  2. added a commit that references this issue on Oct 1, 2024
  3. beltoforion commented on Oct 1, 2024

    @beltoforion
    Contributor

    Fixed in 24.0.3

  4. frufru145 commented on Oct 2, 2024

    @frufru145
    Author

    Upgraded to version 24.0.3 and tested on my side. It works! Thank you!!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions