-
Notifications
You must be signed in to change notification settings - Fork 39
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
Focus control upstream #1173
Focus control upstream #1173
Conversation
Just a question, how is this control used, is to de-focus the beam to change the beam size ? |
The user selects a beam size appropriate for their crystal size, which corresponds to different beam (de)focus |
I refactored few things here and there. In essence I added the beam definer information into the beamInfo info dict, and propagate it to the UI. I based on the ID232 beam definer approach as NState hwobj, and adapted from my previous attempt, now "100x100" is one option in the definer object. One thing that I have not solved is how to generalize the UI styling (see this ), any suggestion is welcome I also created a new beam definer mockup: |
fb893e9
to
a44ffa9
Compare
pass to the ui custom styling if available in the hwobj
I moved down into the hwobj the custom css styling. please, have a look! |
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.
Looking great! I've got lots of suggestions but don't feel like you have to resolve them — it's all coding style, nothing major.
<BeamDefinerInput | ||
beamDefinerInputList={this.props.sampleViewState.definerList} | ||
currentDefiner={this.props.sampleViewState.currentDefiner} | ||
customStyling={this.props.sampleViewState.customStyling} |
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 feel like the logic in the render
method of BeamDefinerInput
would be much simpler if you passed this through the apertureList
prop:
apertureList={this.props.sampleViewState.customStyling || this.props.sampleViewState.apertureList}
This way, you can have a single loop to create the optionList
array (you may not even need this optionList
array at all, since the loop below can be moved directly into the JSX):
const optionList = Object.entries(this.props.apertureList).map((key, value) => {
// key is the label (e.g. "50x50")
// value is either the same as the label or an object when `customStyling` is defined, so you can do:
if (typeof value === 'object') {
return { ... }; // or return a `<Dropdown.Item />` directly if you move the loop inside the JSX
}
return { ... }
});
7d8833f
to
f436baf
Compare
Just a status check, where are we with this one @meguiraun ? |
@marcus-oscarsson @meguiraun Is it okay to delete the branch? |
hi guys,
This is an attempt to bring Biomax's old focus control element into latest mxcube.
WIP because your input is needed on how we handle these kind of components, it technically works as it is.