-
Notifications
You must be signed in to change notification settings - Fork 52
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
[mount_sample] Simplified mount_sample and related logic - Part 1 #971
base: develop
Are you sure you want to change the base?
Conversation
def mount_sample(view, data_model, centring_done_cb, async_result): | ||
view.setText(1, "Loading sample") | ||
def mount_sample(data_model, centring_done_cb, async_result): | ||
HWR.beamline.sample_changer.trigger_progress_message("Loading sample") |
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.
view.setText
replaced by HWR.beamline.sample_changer.trigger_progress_message
HWR.beamline.sample_view.clear_all() | ||
log = logging.getLogger("queue_exec") | ||
log = logging.getLogger("user_level_log") |
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.
user_level_log
seemed more appropriate
"Mockup", | ||
): | ||
return | ||
centring_method = HWR.beamline.sample_view.centring_method |
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.
centring_method
now on HWR.beamline.sample_view
and not view.listView().parent().parent().centring_method
dm = HWR.beamline.diffractometer | ||
if dm is not None: | ||
if hasattr(sample_mount_device, "__TYPE__"): |
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.
Removed by adding CENTRING_METHOD.NONE
(which is default), seems a bit odd to not center depending on __TYPE__
robot_action_dict["status"] = "SUCCESS" | ||
else: | ||
robot_action_dict["message"] = "Sample was not loaded" | ||
robot_action_dict["status"] = "ERROR" | ||
|
||
HWR.beamline.lims.store_robot_action(robot_action_dict) | ||
|
||
if not sample_mount_device.has_loaded_sample(): | ||
# Disables all related collections | ||
view.setOn(False) |
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.
This is a bit odd, it will disable the view if sample could not be loaded. Is it really necessary ?
This code is used when using the Qt UI and running the queue with the automatic option We need to remove the dependency of the Qt view so that also the web version can use this logic. It seems like there is not alot of sites using this piece of code maybe @rhfogh and/or @MartinSavko could confirm ? |
The only use for any of these functions in the qt branch is in plate_navigator_widget, functions navigation_item_double_clicked and navigation_table_double_clicked, which both call HWR.beamline.plate_manipulator.load_sample. Not sure whether it might not be better to keep load_sample for plate manipulators (only), rather than calling a function with '_' prefix from outside the class. |
I agree that |
From the Qt side there are only two calls, both like Is it the case that PlateMsnipulator.load_sample 1) is simply renamed to _load_sample, 2) has the same interface? |
@rhfogh The reason for the renaming was that |
Related to issue #970
SampleChanger.load_sample
and replaced it withSampleChanger.load
The
SampleChanger.mount_sample
method uses a method calledload_sample
that are only defined on a few sample changers and not defined inAbstractSampleChanger
.SampleChanger.mount_sample
seems to be the only place whereload_sample
is used. Perhaps one of the Qt developers could confirm that its not used directly by the UI or some site specific qt related code.AbstractSampleChanger
SampleView
HardwareObject