[QtDragon] Simple vismach window

More
4 years 7 months ago - 4 years 7 months ago #236387 by RomeReactor
Hi all. We're trying to create a very simple vismach configuration to run in qt dragon following this documentation , but it just displays an empty window with sliders to the left, apparently to control the viewport. The vismach config file is attached. Any ideas?

Code:
#!/usr/bin/python3 from qt_vismach import * import hal import math import sys c = hal.component("vm_test") c.newpin("joint0", hal.HAL_FLOAT, hal.HAL_IN) c.newpin("joint1", hal.HAL_FLOAT, hal.HAL_IN) c.newpin("joint2", hal.HAL_FLOAT, hal.HAL_IN) c.ready() ram = CylinderZ(50.0, 50.0, 100.0, 50.0) ram = Color([1,1,1,1],[ram]) ram = Translate([ram], 0.0, 0.0, -35.0) ram = HalTranslate([ram], c, "joint2", 0.0, 0.0, 1.0) table = BoxCenteredXY(0.0, 150.0, 15.0) table = Color([2,2,2,2],[table]) table = Translate([table], 0.0, 0.0, 0.0) table = HalTranslate([table], c, "joint1", 1.0, 0.0, 0.0) ram = Capture() table = Capture() model = Collection ([ram, table]) main(model, ram, table, size=1000, hud=1, rotation_vectors=None, lat=0, lon=0)
Last edit: 4 years 7 months ago by RomeReactor. Reason: Added details.

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

More
4 years 7 months ago #236390 by cmorley
Those docs while relevant and helpful are for the tkinter version of vismach that is not embeddable in a gui (if that is what you wish to do)

There currently is no docs for qt_vismach that I can find, but there are a couple sample panels.

in a terminal try:
qtvcp vismach_mill_xyz
qtvcp vismach_scara

here is the relevant file for mill_xyz

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

More
4 years 7 months ago - 4 years 7 months ago #236472 by cmorley
Here is a folder with code based on your file.
unzip somewhere then if you write the following in a terminal it should display.
(cd to the directory that the file is in first)
qtvcp vismach_vm_test

you probably need to update to the latest master code (Are you using a compiled version?)
This version of the code still uses the HAL pins from the component defined in the vm_test.py file.
I also added some more docs to master, that hopefully helps.
probably more needed.
Last edit: 4 years 7 months ago by cmorley.

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

More
4 years 7 months ago #236956 by RomeReactor
hello cmorley, So far so good with the creation of my vismach, I proceeded to import my script but the following error has occurred in the handler when I try to execute the qtdragon, do you know why?

qtdragon_handler.py", line 165, in __ initialized
self.w.mainLayout.addWidget(machine)
AttributeError: object 'VCPWindow' does not have attribute 'mainLayout'

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

More
4 years 7 months ago #236957 by cmorley
I's need more info.
How did you try to load it in qtdragon?

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

More
4 years 7 months ago #236968 by RomeReactor
Hi cmorley. The previous answer was in relation to your previous post about where you uploaded a modified version of my file.

On a semi-unrelated note, we found this post ( www.forum.linuxcnc.org/qtvcp/43377-import-tk-vismach-to-qtvcp ) where annhandt09 managed to embed the scara tk vismach into qt_dragon. We can't seem to figure out what to replace "self.w.xxxx.addWidget(machine)" with. Any help?

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

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