bcda-aps / adl2pydm Goto Github PK
View Code? Open in Web Editor NEWConvert MEDM's .adl files to PyDM's .ui format
License: Other
Convert MEDM's .adl files to PyDM's .ui format
License: Other
When using the new PyDM screens with an AVT Mako camera, the green "Connected" text does not show on the PyDM screen although it shows in the caQtDM screen (shown to the left).
reduces the number of arguments passed throughout
Until then, the translator should default to PyDMWaveformPlot instead of PyDMScatterPlot.
I agree, I think the Cartesian plot is used much more with waveforms than scalers.
Since most windows have at most one plot window (or if there is more than one they are usually all the same type) then you could have a command line option for the translator that tells it to use PyDMScatterPlot rather than the default PyDMWaveformPlot.
Originally posted by @MarkRivers in #45 (comment)
PyDM has a PyDMRelatedDisplay widget that launches a single related display. There is no equivalent of the MEDM "related display" menu button that provides a pop-up menu with a choice from many related display configurations.
Since this is used extensively in synApps, it is important to add to PyDM.
includes setup.py
, pip, conda, publishing
create a MEDM file with all the known widgets, for testing this code
In the MEDM Reference Manual, there is addition content not yet parsed from the .adl file. This includes:
The scatter plot from the sscan record screens should have a white background and black axis frame.
When a related display button does not supply any text, a default label is made from the QObject's label. Way too often, that's too long and ugly.
Switch to no text and use the icon instead. That's the showIcon=True
property.
Define handling and unit testing for reading these MEDM widgets. Check them off once both parts are complete for reading a MEDM widget.
Also basic attribute
and dynamic attribute
appear at the file level of some displays, such as std-R3-5-ID_ctrl.adl
. There can be more than one basic attribute
at the file level. Some contain channel information. Where should these data be placed? Could these be errors in the file?
Also: caServerApp/test.adl has some unusual but allowed .adl structures, probably a torture test for translators such as this
as stated: #16 (comment) and #16 (comment)
needs slaclab/pydm#579
Processing this file: testDisplay.adl
, this error stops the PyDM screen from displaying:
[2019-11-18 12:02:13,098] [ERROR ] - Cannot open file: '/tmp/testDisplay.ui'. Reason: 'invalid literal for int() with base 10: '1.000000''.
The precision of the valuator (slider) widget is written as a float.
<property name="precision">
<number>1.000000</number>
</property>
As reported to PyDM originally, when the polyline widget visibility is based on a PV, these rules are not written to the .ui file.
Describe the bug
When a converted file has a hyphen in the name, it raises an exception only because the file base name is used as the text of the class
element in the .ui
file. Changing the hyphen to underscore was successful.
atures_3.uiemian@wow ~/.../projects/sbc-mako $ pydm ${PYDM_OPTIONS} --macro "P=13ARV1:,R=cam1:" AVT_Mako_G234C-fe
Traceback (most recent call last):
File "/home/beams/JEMIAN/.conda/envs/pydm_03/bin/pydm", line 11, in <module>
load_entry_point('pydm', 'gui_scripts', 'pydm')()
File "/home/beams1/JEMIAN/Documents/projects/pydm-prj/pydm_launcher/main.py", line 113, in main
stylesheet_path=pydm_args.stylesheet
File "/home/beams1/JEMIAN/Documents/projects/pydm-prj/pydm/application.py", line 96, in __init__
self.main_window.open(ui_file, macros, command_line_args)
File "/home/beams1/JEMIAN/Documents/projects/pydm-prj/pydm/main_window.py", line 328, in open
target=target)
File "/home/beams1/JEMIAN/Documents/projects/pydm-prj/pydm/display.py", line 62, in load_file
w = load_ui_file(file, macros=macros)
File "/home/beams1/JEMIAN/Documents/projects/pydm-prj/pydm/display.py", line 97, in load_ui_file
klass, _ = uic.loadUiType(f)
File "/home/beams/JEMIAN/.conda/envs/pydm_03/lib/python3.7/site-packages/PyQt5/uic/__init__.py", line 202, in loadUiType
exec(code_string.getvalue(), ui_globals)
File "<string>", line 4
class Ui_AVT_Mako_G234C-features_3(object):
^
SyntaxError: invalid syntax
Summary: clean up this text before using it in the class element
The symbols
module needs unit tests.
move the display block from root.contents[somewhere] to root.display
these are the (internal, MEDM) widget types to write in PyDM:
replace such code:
screen_blocks = screen.root.contents[3:] # FIXME: dynamically
In the .ui file, build the <customwidgets/>
section from only the widgets used in the file. Where is the source of this information available?
automated code review has found some code that could be modified: https://lgtm.com/projects/g/BCDA-APS/adl2pydm/alerts/?mode=list
move .py files into
src/
pydm/
*.py
__init__.py
and create some documentation, either with Sphinx or local markdown
widget stacking order
Some custom widgets (PyDMDrawingPie
, for example) extend another custom widget (in this case: PyDMDrawingArc
). The extended widget(s) must be included in the <customwidgets>
element of the .ui
file.
For now, the polygon widget translator writes a PyDMDrawingPolyline
widget. It should write a PyDMDrawingIrregularPolygon
widget which will be developed after the polyline PR is merged.
On the feature list to be supported is fill="solid"
(#51 ).
Cannot find this in MEDM source code nor in any of the synApps or APS adlsys screen collections.
still some TODO items in cartesian plot writer:
adl2pydm/src/adl2pydm/output_handler.py
Lines 341 to 344 in 2862bce
adl2pydm/src/adl2pydm/output_handler.py
Line 361 in 2862bce
adl2pydm/src/adl2pydm/output_handler.py
Lines 367 to 371 in 2862bce
With this step, this package could become the start of a back-translator from PyDM (or potentially other screen formats) to .adl, or converter between formats.
Consider this a means for developers to interchange screens between contemporary tools.
As stated in #30, the example medm files in src/adl2pydm/screens/medm
should move to the tests/medm
.
Until #38 is resolved, the conversion of a MEDM "wheel switch" widget should be as a text entry widget: PyDMLineEdit
match the API of ald2ui & adl2boy
Describe the bug
With the existing setup.py
, the source code is not installed and the adl2pydm
command line program will not run.
To Reproduce
pip install .
adl2pydm -h
-- this command failsExpected behavior
adl2pydm -h
should show a help message.
Need to learn how to use the controls of the PyDMSpinbox widget so as to translate properly the MEDM wheel switch widget.
These properties are not supported by the PyDMLabel widget:
These files drag down the code coverage stats. Don't report on them.
Suspicion is that .ui file is not written correctly
README, sphinx, and RTD
The MEDM widget set supports PV limits through several options. Primarily, the Label
(enumeration) and the PV Limits
dialog. These are related.
Provide consistent handling for the various features. Need example .adl
file(s) exercising these features.
Noticing that designer is not working with (at least one of) my
bluesky installations, I want to identify why.
includes travis-ci, coverage, and LGTM
Per #36, need to learn how to set the scale of a PyDMSlider widget. This derives from the precision of the MEDM valuator widget.
In #13, most content is tested. For the most part, the colors are not tested.
add support for version control using python versioneer
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.