Closed aljosahafner closed 4 years ago
First, issue #10 has to be solved!
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?
You're correct...
Both for Q1 and Q2?
Yes, for both...
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.
There is a placeholder now...
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.
.__init__(user_values)
should work. Or we use a dummy OE, etcWhat do yout think?
Action:
NO ACTION REQUIRED
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
...
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:
CoreOpticsElement=None
=> do_wiser_optical_element
BeamlineElements.Append(...)
=> this can be incremental or traverse OASYS chain of responsibility from the beginning every time, if it is simpler. 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
do_wiser_core_optics_element
Operation C
Comments?/ramifications? tnx
It works in the following way, you click "Beamline" and then the reference element is updated:
The thing which has to be updated still is that when you set:
Set fixed distance from source
it always shows the SourceDone:
Acknowledged.
Find a way to display Reference O. E. you're referring to when positioning a new O. E. This depends on:
selected Mode
Orientation