qHalView

More
22 Jan 2021 21:40 #196283 by fixer
qHalView was created by fixer
As a simple exercise in QT and Python, I made a simple "live" HAL file viewer. It loads hal file in an listview and reads signal values from running instance of LinuxCNC. Similar functionality as "halshow".

Maybe someone finds it useful

github

To do:
interactive set_phttp://linuxcnc.org/docs/2.8/html/hal/halmodule.html#_set_p with mouse...
The following user(s) said Thank You: tommylight, smandyscom

Please Log in or Create an account to join the conversation.

More
22 Jan 2021 21:50 #196286 by tommylight
Replied by tommylight on topic qHalView
cnc@X570:~/Downloads/linuxcnc_stuff/tmp/qHalView-main$ python qHalView.py
Traceback (most recent call last):
  File "qHalView.py", line 7, in <module>
    from PyQt5.QtCore import *
ImportError: No module named QtCore
cnc@X570:~/Downloads/linuxcnc_stuff/tmp/qHalView-main$ python3 qHalView.py
Traceback (most recent call last):
  File "qHalView.py", line 12, in <module>
    import hal, time
ModuleNotFoundError: No module named 'hal'
cnc@X570:~/Downloads/linuxcnc_stuff/tmp/qHalView-main$
That is on Mint 20 where python3 reigns supreme despite having 5 or more other versions of python installed so almost everything using QT5 fails to run.
Will test on Mint 19.3 where QT5 runs nicely when i get a chance.

Please Log in or Create an account to join the conversation.

More
22 Jan 2021 22:22 #196290 by fixer
Replied by fixer on topic qHalView
Yes, it needs QT5 and PyQT5
Linux cnc must be running
Must do . . /rip-environ... before and it takes filename.hal as first argument

And it should run with python2 too, just delete '3' in the shebang {first line in .py}
The following user(s) said Thank You: tommylight

Please Log in or Create an account to join the conversation.

More
24 Jun 2021 01:01 #212773 by smandyscom
Replied by smandyscom on topic qHalView
hi fixer, your demo is precious!
I learn from it that global read_value() should go after created a costumed component, which is pretty tricky.:laugh:

however as my limited knowing to PyQt5, isn't it only supporting under Python3?
I cannot figure out how it can work to combine HAL in python2 with PyQT5 in python3.

Please Log in or Create an account to join the conversation.

Time to create page: 0.213 seconds
Powered by Kunena Forum