building custom Gladevcp Widgets for linuxcnc

More
30 Oct 2012 17:01 #26051 by ArcEye

I'm not sure I see the advantage of loading them through AXIS.

The only advantage is that is what I use, so testing them is simpler. I could just launch them from the command line or use halrun, its just easier to do it all at once and test them through Axis.

Why would you not use the default mechanism to embed windows into AXIS?

Because that only works for TK python apps and X11 apps that specifically support embedding so far as I can tell.
X11 programs like rxvt and mplayer have switches like -embed and -into, which take the WinID and attach to it
If I try to embed one of my panels it is created as a free standing one anyway.
I am looking at whether I can try to create them as Qt widgets with the WinID that the Popen() call passes, as their parent, but that might not work either.

At the root of this is a desire to get a greater understanding of the linuxcnc core and to program it in the language it was written in, C and C++.
I spent 30 years learning assembler and C, through to C++ and have no desire to work in python because a few influential developers use it almost exclusively.

My libraries are mostly based upon Alex Jonis' early work with xemc, halcmd, halui etc. with Qt specific elements, returning data through QStringLists for example, so that it can be rendered into tables, tree lists or whatever.
I suppose QtLinuxcnc would be more accurate tag, VCP is just a small part of it.
Whether I would want to include it in Linuxcnc is another matter, that might entail a lifetime of support for something that I had moved on from, I'm sure you know a bit about that!!

This a test program which uses the libraries to explore and amend the running Linuxcnc instance and to remotely control a machine by directly injecting commands etc.
Gives a bit of a flavour.



regards
Attachments:

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

More
31 Oct 2012 08:29 #26112 by cmorley
Ah I haven't looked to see if QT could be embedded, I just assumed.

Hey that pretty cool!

QT does look nicer.

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

More
06 Nov 2012 20:29 #26308 by ArcEye
Just an update for the sake of completeness, I tried various things and got close to embedding Qt, but not quite there.

The main problem is the window manager not allowing the hijacking of a WinID by another process.
I found a way of creating a widget with the WinID of the tab that Axis creates, but there is then a X server error

LINUXCNC - 2.5.1
Machine configuration directory is '/root/emc2/configs/qtvcp'
Machine configuration file is 'axis_mm_test.ini'
Starting LinuxCNC...
X Error: BadAccess (attempt to access private resource denied) 10
Major opcode: 2 (X_ChangeWindowAttributes)
Resource id: 0x180013f


Googling on this, it seems the window manager has a lock on the X_ChangeWindowAttributes struct and will not allow another process to change that ID.

So back to the QtAxis idea :unsure:

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

Time to create page: 0.087 seconds
Powered by Kunena Forum