oasys-elettra-kit / OASYS1-Wiser

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

Previous optical element #15

Closed aljosahafner closed 4 years ago

aljosahafner commented 4 years ago

image

Find a way to display Reference O. E. you're referring to when positioning a new O. E. This depends on:

aljosahafner commented 4 years ago

First, issue #10 has to be solved!

capitanevs commented 4 years ago

Q1: you mean that #10 must be solved because the function that gets the reference optical element may fail, and in this case the field "Reference O.E." should be "Not found", correct?

Q2: Once this exception will be solved, it seems to me that the solution is crystal clear. Right os am I missing something?

aljosahafner commented 4 years ago

You're correct...

capitanevs commented 4 years ago

Both for Q1 and Q2?

aljosahafner commented 4 years ago

Yes, for both...

aljosahafner commented 4 years ago

I was working on this today. This will be quite tricky to do in the GUI, as the Wiser beamline only gets built when clicking on Compute, so the Reference O. E. technically doesn't exist. We can discuss at some point in the future, I am skipping this at the moment.

aljosahafner commented 4 years ago

There is a placeholder now...

image

capitanevs commented 4 years ago

Definitely True. This makes us remember that

We decided to separate field computation and beambline construction+positioning (BeamlineElements.Append +BeamlineElements.ApplyPositioningDirectives), it's time to do the first step. Of course this does not solve the present issue but can help.

Once this is done, I have a question. Is it possible do "progressively build" the beamline structure (i.e. BeamlineElements), without calling yet the positioning directives stuff? I envision something like:

1)drag&drop the new optical element 2)The optical element is initialized(to default values) and appended to the beamline (BeamlineElements.Append) 3)The user modifies properties of the OE -Here the OE can acces the beamline of which he is the last item, or can anyway call the reference.

What do yout think?

capitanevs commented 4 years ago

Action:

NO ACTION REQUIRED

aljosahafner commented 4 years ago

We put the do_wiser_beamline somewhere into the GUI, for example where you select the PD type (distance from source, distance from previous, etc.). This way the beamline will be initialized and the previous element will be picked up by get_previousOE...

capitanevs commented 4 years ago

Probably since we are late this is simpler for now. But in the future we should consider the following alternative

Operation A do_wiser_beamline is called every time that a OASYS widget is appended/linked to another. It contains:

Problems what happens if the widghet is disconnected? or if distinct "partial chains" are present? (e.g. A-B-C and F-G-H) and I am still drawing the missing dots?)

Operation B

Operation C

Comments?/ramifications? tnx

aljosahafner commented 4 years ago

It works in the following way, you click "Beamline" and then the reference element is updated:

image

image

aljosahafner commented 4 years ago

The thing which has to be updated still is that when you set:

aljosahafner commented 4 years ago

Done: image

image

capitanevs commented 4 years ago

Acknowledged.