BCDA-APS / adl2pydm

Convert MEDM's .adl files to PyDM's .ui format
Other
0 stars 4 forks source link

write and test PyDM widget types #16

Closed prjemian closed 4 years ago

prjemian commented 5 years ago

these are the (internal, MEDM) widget types to write in PyDM:

prjemian commented 4 years ago

Wheel switch (spinbox) has a format string that is probably not supported in Qt's QDoubleSpinBox widget.

Need some experience using that widget before we can declare the writer finished on it.

prjemian commented 4 years ago

Filed these issues with PyDM:

prjemian commented 4 years ago

Some drawing widgets (notably polygon and polyline) each need to be drawn on a single canvas but have no corresponding widget type available now in PyDM.

The font sizing problem is a nuisance but not a show stopper.

The consistency problems are a nuisance to the programmer but can be resolved, albeit with messy code.

prjemian commented 4 years ago

Note this BUG in adl2pydm

prjemian commented 4 years ago

No widget for the shell command yet, where the number of commands is more than one.

prjemian commented 4 years ago

Checkpoint: bar and oval widgets are yet to be handled. Been testing conversion of the screens from the docker IOC and resolving additional problems as identified. Here's a scan run entirely from the PyDM GUI (although the swait record, used as a noisy detector signal, was configured from bluesky). Some rough edges remain but: Very usable!

Clipboard01

Big thanks to @hhslepicka, @mattgibbs, and the rest the PyDM developers!

hhslepicka commented 4 years ago

@prjemian they look great! For the bar and oval, do you happen to have a screenshot on how they look like?

prjemian commented 4 years ago

Not anticipating any difficulty. Just represents state of things when I had to concentrate on other activities last November. Here's a sample of ovals and bars:

Clipboard02


oval

The ovals are either static or connected to a PV (for visibility rules). This is MEDM's widget config for one of these ovals (the open one with red dashed line): Clipboard03


bar monitor

The bars are monitor widgets (means they are always connected to a PV to display its value). Should be an integer or float PV (which as HOPR and LOPR which define the range of the bar) or a motor PV (which defines HLM and LLM). Here, I made a custom IOC for the demo PV

file: `medm.db`, run IOC with `softIoc -d medm.db` ``` record(ao, "demo:bar") { field(HOPR, 255.0) field(LOPR, 0.0) field(VAL, 0.0) field(EGU, "dimensionless") } ```

This is MEDM's widget config for one of these bars (the vertical one, second from left in upper row, with red at the top instead of the bottom): Clipboard01

prjemian commented 4 years ago

For documentation, I am attaching both .db and .adl file here (with .txt added so GH accepts them):


medm.db.txt


medm-demo.adl.txt

hhslepicka commented 4 years ago

I think we got you covered with some widgets that we have: For Bar you can use: https://github.com/slaclab/pydm/blob/master/pydm/widgets/slider.py#L10 For Oval you can use: https://github.com/slaclab/pydm/blob/master/pydm/widgets/drawing.py#L749

Let me know if we are missing something.

prjemian commented 4 years ago

The PyDMSlider widget is for input. MEDM's bar widget is a monitor so it needs to be read-only. That's not an option for the PyDMSlider. Perhaps PyDMScaleIndicator?

hhslepicka commented 4 years ago

Correct. In this case the ScaleIndicator is what you want to use

prjemian commented 4 years ago

Need to confirm polygon support.

prjemian commented 4 years ago

Support for MEDM's polygon must wait until the PyDMDrawingIrregularPolygon widget (https://github.com/slaclab/pydm/issues/579) is ready. The PyDMDrawingPolygon assumes all sides are of equal length and the curvature does not change (sides do not cross).

prjemian commented 4 years ago

The testDisplay.adl has two examples of filled polygons with lines that do not cross. Need a new example.

prjemian commented 4 years ago

Pivoting the polygon to be a polyline for now, until https://github.com/slaclab/pydm/issues/579 is ready. One consequence is that it it only outlines over the points. The solid-filled option not available now.

prjemian commented 4 years ago

Polygons demo screen (green check mark comes when PV within 0.5 of RBV, orange arrow when RBV>127). Clipboard01

prjemian commented 4 years ago

Black, purple, and blue should have fill=solid -- on TODO list

prjemian commented 4 years ago

I'm declaring victory here.