How to open QT ui file in LinuxCNC

More
03 Mar 2025 21:13 #323113 by hakinen2255
Replied by hakinen2255 on topic How to open QT ui file in LinuxCNC
while loading horizontal qtdragon_hd it says version 2.9.2 and attached is the error when i change the .ui file with vertical

Error report created by /usr/lib/tcltk/linuxcnc/show_errors.tcl:

Print file information:
RUN_IN_PLACE=no
LINUXCNC_DIR=
LINUXCNC_BIN_DIR=/usr/bin
LINUXCNC_TCL_DIR=/usr/lib/tcltk/linuxcnc
LINUXCNC_SCRIPT_DIR=
LINUXCNC_RTLIB_DIR=/usr/lib/linuxcnc/modules
LINUXCNC_CONFIG_DIR=
LINUXCNC_LANG_DIR=/usr/lib/tcltk/linuxcnc/msgs
INIVAR=inivar
HALCMD=halcmd
LINUXCNC_EMCSH=/usr/bin/wish8.6
LINUXCNC - 2.9.2
Machine configuration directory is '/home/hakan/linuxcnc/configs/sim.qtdragon_hd.qtdragon_hd_xyz'
Machine configuration file is 'qtdragon_hd_xyza.ini'
INIFILE=/home/hakan/linuxcnc/configs/sim.qtdragon_hd.qtdragon_hd_xyz/qtdragon_hd_xyza.ini
VERSION=1.1
PARAMETER_FILE=qtdragon.var
TPMOD=
HOMEMOD=
TASK=milltask
HALUI=halui
DISPLAY=qtvcp qtdragon_hd
COORDINATES=XYZA
KINEMATICS=trivkins coordinates=XYZA
Starting LinuxCNC...
Starting LinuxCNC server program: linuxcncsvr
Loading Real Time OS, RTAPI, and HAL_LIB modules
Starting LinuxCNC IO program: io
Starting HAL User Interface program: halui
linuxcnc TPMOD=tpmod HOMEMOD=homemod EMCMOT=motmod
Found file(lib): /usr/share/linuxcnc/hallib/gantrysim.hal
Loaded HAL Components:
ID      Type  Name                                            PID   State
    26  RT    trivkins                                              ready
    25  User  halcmd8863                                       8863 ready
    21  RT    homemod                                               ready
    16  RT    tpmod                                                 ready
    10  User  halui                                            8852 ready
     4  User  iocontrol                                        8850 ready

Found file(lib): /usr/share/linuxcnc/hallib/simulated-gantry-home.hal
Starting TASK program: milltask
Starting DISPLAY program: qtvcp
Shutting down and cleaning up LinuxCNC...
task: 12368 cycles, min=0.000003, max=0.036588, avg=0.010045, 0 latency excursions (> 10x expected cycle time of 0.010000s)
Removing HAL_LIB, RTAPI, and Real Time OS modules
Removing NML shared memory segments

Debug file information:
Note: Using POSIX realtime
[QTvcp.QTVCP.QT_ISTAT][[33mWARNING[0m]  Missing [DISPLAY] ANGULAR_INCREMENTS- using defaults. (qt_istat.py:317)
[QTvcp.QTVCP.QT_MAKEGUI][[41mCRITICAL[0m]  'VCPWindow' object has no attribute 'btn_goto_sensor_clicked' (qt_makegui.py:212)
[QTvcp][[41mCRITICAL[0m]  Retry from Error Dialog
 Qtvcp encountered an error.  The following information may be useful in troubleshooting:
LinuxCNC Version  : 2.9.2

Traceback (most recent call last):
  File "/usr/bin/qtvcp", line 545, in <module>
    _qtvcp = QTVCP()
             ^^^^^^^
  File "/usr/bin/qtvcp", line 275, in __init__
    window.instance(filename=self.PATH.XML)
  File "/usr/lib/python3/dist-packages/qtvcp/qt_makegui.py", line 201, in instance
    instance = uic.loadUi(filename, self)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/PyQt5/uic/__init__.py", line 241, in loadUi
    return DynamicUILoader(package).loadUi(uifile, baseinstance, resource_suffix)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/PyQt5/uic/Loader/loader.py", line 66, in loadUi
    return self.parse(filename, resource_suffix)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/PyQt5/uic/uiparser.py", line 1037, in parse
    actor(elem)
  File "/usr/lib/python3/dist-packages/PyQt5/uic/uiparser.py", line 929, in createConnections
    slot = self.factory.getSlot(name2object(conn.findtext('receiver')),
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/PyQt5/uic/objcreator.py", line 131, in getSlot
    return self._cpolicy.getSlot(obj, slotname)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/PyQt5/uic/Loader/qobjectcreator.py", line 147, in getSlot
    return getattr(object, slotname)
           ^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'VCPWindow' object has no attribute 'btn_goto_sensor_clicked'

 (qtvcp:505)
8846
8877
Stopping realtime threads
Unloading hal components
Note: Using POSIX realtime



Info report created by linuxcnc_info:
The file:    /tmp/linuxcnc_info.txt
can be posted to a forum or a web site like:
     pastebin.com
in order to provide information about the linuxcnc
system and configuration.

                Date: Tue Mar 4 12:16:52 AM EST 2025
            UTC Date: Tue Mar 4 05:16:52 AM UTC 2025
        this program: /usr/bin/linuxcnc_info
              uptime: 00:16:52 up 7:21, 1 user, load average: 0.49, 0.57, 0.34
     lsb_release -sa: Debian Debian GNU/Linux 12 (bookworm) 12 bookworm
            linuxcnc: /usr/bin/linuxcnc
                 pwd: /home/hakan/linuxcnc/configs/sim.qtdragon_hd.qtdragon_hd_xyz
                USER: hakan
             LOGNAME: hakan
                HOME: /home/hakan
              EDITOR:
              VISUAL:
            LANGUAGE:
                TERM: dumb
           COLORTERM:
             DISPLAY: :0.0
             DESKTOP: xfce
        display size: 3840x3020 pixels (1016x799 millimeters)
                PATH: /usr/bin:/home/hakan/linuxcnc/configs/sim.qtdragon_hd.qtdragon_hd_xyz/bin:/usr/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games

uname items:
         nodename -n: CSF750
      kernel-name -s: Linux
      kernel-vers -v: #1 SMP PREEMPT_RT Debian 6.1.67-1 (2023-12-12)
          machine -m: x86_64
        processor -p: unknown
         platform -i: unknown
      oper system -o: GNU/Linux

/proc items:
             cmdline: BOOT_IMAGE=/boot/vmlinuz-6.1.0-16-rt-amd64 root=UUID=4d925627-cc3b-45aa-ae68-050d85babc80 ro quiet loglevel=3 fbcon=rotate:1 fbcon=rotate:1 quiet isolcpus=1,2,3 splash loglevel=3 mitigations=off
          model name: Intel(R) Core(TM) i3-8145U CPU @ 2.10GHz
               cores: 2
             cpu MHz: 3347.627
             parport:
              serial: 0000-0000 : serial

Versions:
                 gcc: gcc (Debian 12.2.0-14) 12.2.0
              python: Python 3.11.2
                 git: git version 2.39.5
          git commit: NA
                 tcl: 8.6
                  tk: 8.6
               glade: not_in_PATH

linuxcnc_var all:

     LINUXCNCVERSION: 2.9.2
LINUXCNC_AUX_GLADEVCP: /usr/share/linuxcnc/aux_gladevcp
LINUXCNC_AUX_EXAMPLES: /usr/share/linuxcnc/aux_examples
            REALTIME: /usr/lib/linuxcnc/realtime
                 RTS: uspace
          HALLIB_DIR: /usr/share/linuxcnc/hallib
              PYTHON: /usr/bin/python3

dpkg -l '*linuxcnc*':
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name                Version      Architecture Description
+++-===================-============-============-=====================================================================
un  linuxcnc            <none>       <none>       (no description available)
un  linuxcnc-dev        <none>       <none>       (no description available)
un  linuxcnc-doc        <none>       <none>       (no description available)
ii  linuxcnc-doc-de     1:2.9.2      all          motion controller for CNC machines and robots (German documentation)
ii  linuxcnc-doc-en     1:2.9.2      all          motion controller for CNC machines and robots (English documentation)
ii  linuxcnc-doc-es     1:2.9.2      all          motion controller for CNC machines and robots (Spanish documentation)
ii  linuxcnc-doc-fr     1:2.9.2      all          motion controller for CNC machines and robots (French documentation)
un  linuxcnc-sim        <none>       <none>       (no description available)
un  linuxcnc-sim-dev    <none>       <none>       (no description available)
ii  linuxcnc-uspace     1:2.9.2      amd64        motion controller for CNC machines and robots
ii  linuxcnc-uspace-dev 1:2.9.2      amd64        PC based motion controller for real-time Linux

 
Attachments:

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

More
04 Mar 2025 06:35 #323125 by cmorley
Replied by cmorley on topic How to open QT ui file in LinuxCNC
Try this version for 2.9.
name it qtdragon_hd.ui
put it in YOUR CONFIG FOLDER/qtvcp/screens/qtdragon_hd/

Chris
Attachments:

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

More
04 Mar 2025 14:45 #323144 by hakinen2255
Replied by hakinen2255 on topic How to open QT ui file in LinuxCNC
Hi Chris,

yes that worked and it loaded the screen, thanks.
 
Attachments:

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

More
05 Mar 2025 02:42 #323215 by cmorley
Replied by cmorley on topic How to open QT ui file in LinuxCNC
Excellent let me know of any bugs please.
The following user(s) said Thank You: tommylight, hakinen2255

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

More
25 Apr 2025 20:20 #327056 by hakinen2255
Replied by hakinen2255 on topic How to open QT ui file in LinuxCNC
Hi Chris,

I am trying to add a grid to the 3d graphics before i start with adding a 3d model of the machine, same grid with the qtplasmac, i checked its code and added the lines(i think that its related with drawing a grid in the viewport) to the qtdragon_hd_handler.py(lines with the + signs next to line numbers in the attached screenshots) but i can not see a grid in the viewport. as u know i dont know the programming language i am just copying and pasting, i also added a doublescale box in qt designer, i can see the grid size as 50 in startup as i entered in the code but there is no grid still in 3d graphics.

have u tried adding a grid to 3d graphics before or do u know how to do it? Thanks in advance.

Hakan

 

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

More
26 Apr 2025 02:43 #327072 by cmorley
Replied by cmorley on topic How to open QT ui file in LinuxCNC
I believe the grip only shows in z view. It should work without coding. Might have ro set grid bit it did work.

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

More
26 Apr 2025 12:22 #327081 by hakinen2255
Replied by hakinen2255 on topic How to open QT ui file in LinuxCNC
in qtplasmac it shows in z view and perspective view,

what u mean by it should work without coding, is there a way to turn it on or set in qtdragon_hd?

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

More
26 Apr 2025 21:10 #327102 by cmorley
Replied by cmorley on topic How to open QT ui file in LinuxCNC
Sorry for cryptic message - I am away from home for work.
I did not know that QtPlasmac was patched to show a grid in P view - those plasma guys are very crafty!
I also didn't realize QtDragon had no builtin way to show grids

(I assume your gcode graphics widget is called gcodegraphics in designer)

To get XYZ grids to show you must set a grid size:
self.w.gcodegraphics.grid_size = 1
setting the grid color is possible (Red,green,blue):
self.w.gcodegraphics.colors = (1.0, 1.0, 1.0)
add those to bottom of  init_widgets() function.

to get grid in perspective too require patching.
    def new_draw_grid(self):
        if self.w.gcodegraphics.get_view() == 3:
            rotation = math.radians(STATUS.stat.rotation_xy % 90)
            # permutation = lambda x_y_z2: (x_y_z2[0], x_y_z2[1], x_y_z2[2])  # XY Z

            def permutation(x_y_z2):
                return x_y_z2[0], x_y_z2[1], x_y_z2[2]  # XY Z
            # inverse_permutation = lambda x_y_z3: (x_y_z3[0], x_y_z3[1], x_y_z3[2])  # XY Z

            def inverse_permutation(x_y_z3):
                return x_y_z3[0], x_y_z3[1], x_y_z3[2]  # XY Z
            self.w.gcodegraphics.draw_grid_permuted(rotation, permutation, inverse_permutation)
        else:
            self.old_draw_grid()

add to bottom of  init_widgets() function:
        # patched gcodegraphics functions
        self.old_draw_grid = self.w.gcodegraphics.draw_grid
        self.w.gcodegraphics.draw_grid = self.new_draw_grid
I think I should modify the underlaying code so the patching is not necessary - on the todo list.
The following user(s) said Thank You: tommylight, snowgoer540

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

More
26 Apr 2025 22:26 #327107 by hakinen2255
Replied by hakinen2255 on topic How to open QT ui file in LinuxCNC
Thanks for the detailed reply Chris,

I disabled all the lines i added to the code and added some of your code under init_widgets() function and put the rest where other functions or patches are defined, when i run the linuxCNC i got the attached error, did i miss something?
Attachments:

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

More
26 Apr 2025 22:47 #327108 by hakinen2255
Replied by hakinen2255 on topic How to open QT ui file in LinuxCNC
Hi again,

i got it, there was an indentation error, fixed it also changed self.w.gcodegraphics.colors = (1.0, 1.0, 1.0) to self.w.gcodegraphics.color = (100, 100, 100) so i have a grid on perspective view now

Thanks Chris
Attachments:

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

Moderators: cmorley
Time to create page: 1.569 seconds
Powered by Kunena Forum