-
Notifications
You must be signed in to change notification settings - Fork 0
Implement EPICSNState Class #11
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
base: develop
Are you sure you want to change the base?
Conversation
| ) | ||
|
|
||
| zoom = self.getObjectByRole("zoom") | ||
| calibration_x = zoom.getProperty("mm_per_pixel_x") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change to this file will cause a conflict with the bluesky branch
|
|
||
| def init(self): | ||
| super().init() | ||
| low_limit = self.get_property("low_limit", "") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the limits should be in the EPICSActuator class. And if they are not set, the class should get the values directly from the PV.
| try: | ||
| with gevent.Timeout(timeout, exception=TimeoutError): | ||
| while ( | ||
| self.setpoint != EPICSActuator.get_value(self) and not self._wait_task.is_set() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The EPICSActuator could be generalize to accept strings, and this wait_ready method could be removed.
| self._nominal_limits = limits | ||
| self.emit("limitsChanged", (self._nominal_limits,)) | ||
|
|
||
| def update_limits(self, limits=None): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The name should be standardized with the one in EPICSMotor that is called get_limits. And maybe set in the EPICSActuator
| value = EPICSActuator.get_value(self) | ||
| return self.value_to_enum(value) | ||
|
|
||
| def set_limits(self, limits=(None, None)): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this should be in the EPICSActuator
Delete example xml file (which does not make sense here), fix the imports from other classes, adjust the zoom limits to what is currently being used in the beamline (1 to 8), and delete the get_value function which was poorly implemented, and already inherited from EPICSNState class
This is done in order to account for the value_to_enum, that needs to be called for the values of the Zoom object. Combined with a proper polling setting, this updates the frontend when a zoom value is altered from outside MXCuBE4
In the parent class, AbstractNState, the functions set_limits and update_limits raise a NotImplementedError. Because LNLSZoom is a class that is an N state but has limits, the limits must be set manually. This is why the limits are defined at init (and not at the configuration file) and also set with specific functions at the LNLSZoom class. There could be a way to set these limits in the configuration file, but I could not find that.
This can be done because all NState objetcs also use these funcions and because limits can be defined in configuration files
Default value is used if any of them was not defined. This is the case e.g. for all EPICSMotors, which inhetir from the EPICSActuator class.
1a488a5 to
cd3e785
Compare
This PR implements the EPICSNState class in order to be able to use it with Enum values.