oasys-elettra-kit / OASYS1-Wiser

The implementation of WISER into OASYS
MIT License
0 stars 1 forks source link

Positioning directives #1

Closed capitanevs closed 4 years ago

capitanevs commented 4 years ago

Now Positioning directives (PD) in OASYS allow "full control" to parameters ReferTo, What, Where. I think this is too complicated (not all the combinations are possible for all the optical elements), and it shall be improved.

A solution is define the PD we really need and prepare almost-locked combinations.

Some mostly used PD are:

-"Measure distance from Source" / "Set downstream of the source" (ReferTo = Source, What = centre, Where = centre, SameOrientation = Anye?) Label: "Reference Element" ---> Source.Name Fields: "Distance" ---> linked to Distance

commonly applied to: any optical element, especially focussing mirrors

-"Measure distance from previous optical element" / "Set downstream"
(ReferTo = upstream, What = centre, Where = centre, SameOrientation = false) Label: "Reference Element" ---> (GetParent(self, SameOrientation=False, OnlyReference=True)).Name Fields: "Distance" ---> linked to Distance

commonly applied to: any optical element
Note: it refers to ANY orientation => the orientation of the optical element shall be clear in the Label field?

-"Autofocus" /"Set in the focus" (ReferTo = upstream, What = centre, Where = downstream focus, SameOrientation = ?) Label: "Reference Element" ---> print the name of the reference focussing mirror Fields: "Defocus" ----> linked to Distance this is used for instance with detectors,

aljosahafner commented 4 years ago

Good idea, I was just thinking about this. We should however keep the fields and buttons as universal as possible.

capitanevs commented 4 years ago

True, you are right. We can insert in the possible "predefined phrases" the "Custom option" open. Depending on the selected "phrase" you have different fields. With "Custom" option you get access to the 3 fields ReferTo, What, Where.

Any better solution is welcome.

aljosahafner commented 4 years ago

Located in widgets/gui/ow_wise_widget.py -> Function build_positioning_directive_box(self, container_box, width, element_type=ElementType.SOURCE)

aljosahafner commented 4 years ago
class PositioningDirectivesPhrases:
     class Type:
         Autofocus = 'Autofocus'
         DistanceFromPrevious = 'Fixed distance from previous OE'
         DistanceFromSource = 'Fixed distance from source'
         Custom = 'Custom positioning directives'

These will be the elements in the combo box. Any more?

capitanevs commented 4 years ago

The strings (e.g. 'Fixed distance from previous OE') are they the ones supposed to appear in the ComboBox?

I think 4 cases is all we need for the moment. We will add if need be.

aljosahafner commented 4 years ago

There are four cases: image

The one with Autofocus has no distance: image

Other ones have distance: image

TODO: For "Custom" case show What, Where and ReferTo fields.

capitanevs commented 4 years ago

Looks great!

aljosahafner commented 4 years ago

Displacement means SmallDisplacements. Please install Oasys and check, all the optical elements have such layout.

Yes, these are the next things to do, thanks for reminding again.

capitanevs commented 4 years ago

Thanks. Oasys cross checks are planned with the first all-wiser version. Most unfortunately I am out of the time for revising the current version "as is", which is the reason why I rely on you and on your reports.

Looking at the GUI: I would remove all the non-necessary distinctions. For instance, "Position" is clear enough. Now, I would not further add "Positioning directives" (which is code-name slang, but may be not so clear to the user). How about making the current substitutions? Type => Action: "Fixed distance from..." => "Set fixed distance from"

aljosahafner commented 4 years ago

Hey, this is the status and besides previous optical element, it is properly wired.

Default, fixed distance from source: image

Autofocus + menu: image

Distance from previous OE: image

Custom positioning directives: image

capitanevs commented 4 years ago

Thanks for the updates. Minor comments:

-The "custom" options should not have X and Y because they are really unusable :-). I have never used then even for debug purposes. Sorry, I did not tell you about that.

Thanks!

aljosahafner commented 4 years ago

X, Y is for absolute positioning... This is really cosmetics, I can remove it of course...

capitanevs commented 4 years ago

Of course, making a nice GUI IS cosmetics. Yes, we shall remove them. I have never happened to use them, and I have always locked the source to (0,0).

aljosahafner commented 4 years ago

Still to add:

capitanevs commented 4 years ago

The present issue is closed. Done define the GENERAL layout of positioning directives, i.e. => OASYS standard w.r.t. WISER standard immagine

Still To do Improve the user experience of "smart focusing". "Smart focusing" behaves differently according to what elements are involved. This can be confusing. Think of it.