oasys-elettra-kit / OASYS1-Wiser

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

Info widget #33

Open aljosahafner opened 3 years ago

aljosahafner commented 3 years ago

A widget that can be connected to any point in the beamline (most likely detector) and provide info on:

aljosahafner commented 3 years ago

I will start working on this very soon.

Version 1:

capitanevs commented 3 years ago

This is good. On this note (native scripts) I have some more comments.

I did extensive use, for instance, of the "GetBeamline" script immagine

Generally, I am also using other "OASYS Snippets" that can be useful while using oasys canvas (see below). The problem is that I did not found an easy way to gather all these "pre-written" python widget in a unique place, where they can be picked up from. Every time I have to open the *.ow file that contains them, copy the code, paste it to the python widget in the destination canvas, rename the widget with a meaningful name.

OASYS was not conceived for creating "libraries" of python scripts, so I am not complaining :-) But maybe we can find a common strategy toghether. For instance I saw that SRW has a section called "native scripts". We could think about something similar.

immagine

aljosahafner commented 3 years ago

If you already have these codes, then it is very easy to convert to a widget, especially those such as GetBeamline, Check Source Name, etc.

aljosahafner commented 3 years ago

For my own reference: use AutomaticWidget class for this and NOT WiserWidget.

capitanevs commented 2 years ago

Great, it's working.

Some More features

import clipboard B = GetWiserBeamline(in_object_1) out_object = B BeamlineCode = B.GenerateCode() print(BeamlineCode) clipboard.copy(BeamlineCode)