-
Notifications
You must be signed in to change notification settings - Fork 44
Make "detector mode" in the task dialogs configurable from the backend #1723
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
Make "detector mode" in the task dialogs configurable from the backend #1723
Conversation
Now I see what you like to do, very nice ! |
{this.props.initialValues?.detector_modes?.length !== 0 ? ( | ||
<FieldsRow> | ||
<SelectField | ||
propName="detector_mode" |
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.
should this be detector_roi_mode
then or is there also a detector_mode
? :)
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.
Actually, I didn't notice the detector_roi_mode
mxcubecore/model/queue_model_objects.py
and I have no clue if this refers to what is selected in the "Detector mode".
In any case the attributes is a string type but a list is needed in order to populate the dropdown bar
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'll check the code to clarify who is who...
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 see, but the actual value used and passed to the collection routine will be contained in detector_mode
, It will be one of the values in detector_modes
right ?
I'm being quite picky but I often wind the trailing s
to be quite confusing. Its often easier to add _list
or something.
As I understand this, detector_modes
is the list of ROI's available and the value passed is detector_mode
?
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 see, but the actual value used and passed to the collection routine will be contained in
detector_mode
, It will be one of the values indetector_modes
right ?
Yes!
I'm being quite picky but I often wind the trailing
s
to be quite confusing. Its often easier to add_list
or something.
The '_list' suffix helps make the meaning clearer, so I’ll change it! :)
As I understand this,
detector_modes
is the list of ROI's available and the value passed isdetector_mode
?
Actually, we're not really using these "detector modes". Like you, I'd guess that the detector_mode
refers to a specific ROI.
But there is something wired (at least to me) I can't find the mapping detector_mode
--> detector_mode_roi
in the code.
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.
We are currently not using detector_roi_mode
but I think it might be interesting for the future. My question was the same. I can't see any mapping between detector_mode
and detector_mode_roi
either :). I think you can simply call it detector_mode_roi
and detector_mode_list
. I think detector_mode_roi will get passed down to collect as it already exists.
9516a8a
to
bb97f01
Compare
I added the same changes to the other Tasks (Mesh, Characterization, ..) ...I'll take care of bumping the |
Perfect well done !, Ill be super happy to merge this one :) I just made one small comment on mxcube/mxcubecore#1297, maybe the ROI mode list can be read from configuration ? |
f9679f1
to
87eec2f
Compare
@marcus-oscarsson Ready to be merged, if you could give it a quick look, I’d really appreciate it :) |
87eec2f
to
eb396e0
Compare
…display the ROI modes defined on the server side, as configured in the beamline_config.yml or detector.yml files. Values defined in beamline_config.yml override those in detector.yml.
eb396e0
to
3984cba
Compare
Thanks for the review @walesch-yan, you are right! I'd propose this change:
|
You are right. I somehow overlooked that it is always initialized with an empty list at least. |
True, it makes sense, from now on, I'll take care of updating the |
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.
Thanks @alessandro-olivo, this looks good to me
This PR allows customizing the "detector modes" shown in the drop-down menu in the "Task" dialogs (i.e. DataCollection, Helical, Mesh, Characterisation). The list of modes comes from the backend, in particular you can configure them in the
beamline_config.yml
file or in thedetector.yml
. What is configured indetector.yml
will be used as the default value.HowTo:
Edit the
beamline_config.yml
file like this:... default_acquisition_parameters: default: ... helical: # Defaults for helical scan. Missing values are taken from default number_of_images: 100 + detector_mode_list: ["0", "C18", "C2"] ...
and/or add this line
<roi_mode_list>["0", "C18", "C12", "C2"]</roi_mode_list>
to thedetector.yml
The example above is a snippet of the
demo/beamline_config.yml
,Notes
Requirements:
mxcubecore
mxcube/mxcubecore#1297 being merged first in order to function correctly.