QT C++ graphics display WIDGET

More
06 Sep 2021 21:48 - 06 Sep 2021 21:49 #219792 by Grotius
Hi Reinhard,

I have no clue how to rip out the lcnc interpreter haha.

Now the tool is moving, with on and off colors. Tool stepfile's are welcome.
If no stepfiles are given, the tool is the old style cone.
The toolpos can be updated by direct function call from Python or C++.
The tool is translated, rotated by a quarternion with xyz and eulers.

*Ok, I only referred to you proposal to add nml functionality to the grafical widget.
I think if we demonstrate how to pass the nml trough python to the widget it's ok for Chris. Then your proposal is applied.
It is a complex widget, with many configuration options, it is more work at the python side to setup.
But it only takes about ~300 lines of templated python code to configure the widget once.

I was thinking at the moment also other programs can use this. For example machinekit could use it.

For udo, he can pass direct function calls to update the tool.
For halcore, the same, we update the toolpos from the golden ring.
Last edit: 06 Sep 2021 21:49 by Grotius.

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

More
07 Sep 2021 19:45 #219872 by Grotius
Hi,

Today i made a extra Python module for nml.
For Python users to run the Graphics app inside your program only 2 modules have to be loaded :
from PyNmlPlugin import Nml_plugin
from PyOpencascade import Opencascade
To initialize the nml :
self.nml = Nml_plugin()
self.my_nml_setup()
To initialize the Grapics Widget:
self.occ = Opencascade()
self.layout.addWidget(self.occ)
To get the toolposition xyz from nml.
self.nml.get_tcp_pos()
Then to update the graphics widgets toolposition from the nml
self.occ.translate_tool_cone(self.nml.get_tcp_pos())

Video ufile.io/0c9sao8h
Total ~90mb project archive we.tl/t-iiVWHpoXET

Python gui with "graphic widget module" and "nml module" at work.
Attachments:

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

More
07 Sep 2021 19:53 - 07 Sep 2021 19:55 #219876 by Grotius
Then for above post, The c++ side of the Graphics Widget has no nml information. Just like Reinhard told us.
Then to compensate Chris, who needs nml, i made a extra nml python module. Lucky i had some experience with making a Python module
yesterday.

The responce is nice. If you download the archive, look at the ./runtest.py files
to see the python script ~80 lines.

Chris, I had to modify some lcnc source code, wich fights with qt during compiling. Maybe you can give this info to the right person some day.
posemath.h line 978 changed define, errors with qt. (terrorizes QVariant.toLine lib)
#define toLine
to
#define toLine_
canon_position.hh line 61, errors with qt.
const double max() const;
to
double max() const;
Last edit: 07 Sep 2021 19:55 by Grotius.

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

More
08 Sep 2021 19:00 #219988 by udoS
Replied by udoS on topic QT C++ graphics display WIDGET
@Grotius
Hi.
Now what is the actual position on the Qt_Graphics_Widget.
If I may contribute a wishlist as well: ?

Keep It Simple.

1.) It should combine gremlin and Vismach and all in Qt c/c++ over nml .
  > Show the WCS or (Machine Center Point ) and populate with solids . ( Could be fixtures ) as a Fixed setup .
  >Show selected tool from Lcnc if non then cone .Provide for loading working stock model maybe semi transparent. 
  >Overlay with programmed g-code path . May come from editor .
  >Show path while running. Nice to have: remove of material .
  >The DRO you projected looks great to me if only for active joints/axis.

I'd rather have two Versions of it instead of providing interfaces for all kind of I don't know what in a single one. 
You do not build a McLaren with a clutch to pull your plow . 

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

More
08 Sep 2021 19:20 #219992 by udoS
Replied by udoS on topic QT C++ graphics display WIDGET
@Grotius AND @Reinhard
One more thing I would like you to consider: 
There is a QtPyVCP. There is also gremlin and there is vismach.

But so far there is no homogenous c/c++ graphics interface for Lcnc wether stand alone nor integrated .

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

More
09 Sep 2021 11:40 #220048 by Grotius
Hi,

Latest project archive:  we.tl/t-3bzfbHvt4Q

The project includes :
- Python gui example
- C++ gui example

The project includes librarys for Python and C++ :
- Opencascade
- Nml-plugin



Both Python and C++ gui examples will update tool + dro's if lcnc is running a program.

The Universal Graphic Widget (libopencascade.so) is strictly seperated from nml.
The Nml-plugin is a stand alone library, used as helper to get the nml values.

 
Attachments:

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

More
09 Sep 2021 11:50 #220049 by Grotius
@Udo,

* 1.) It should combine gremlin and Vismach and all in Qt c/c++ over nml .
You should think your gui will send the info what to draw to the Universal Graphic Widget.
Look at the latest archive how it is done.

*There is a QtPyVCP.
That is using gremlin.

For the rest. The code is still in progress. Showing custom tools will come soon.
Dro's are already dynamic in setup.



 
The following user(s) said Thank You: tommylight

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

More
09 Sep 2021 15:37 #220066 by udoS
Replied by udoS on topic QT C++ graphics display WIDGET
@Grotius
CAN YOU SPLIT IT ?
1.) Py
2.) c/c++

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

More
09 Sep 2021 20:08 - 09 Sep 2021 20:10 #220079 by Grotius
Hi Udo,

It is already split from the beginning. Did you take a look in the archives?
If you want to see only the c++ projects :
/Qt_Occ_Python/src/
/Qt_Nml_Python/src/

My latest archive, including tool preview. User can give a stepfile for tool on and off.
In this case the plasma flame goes on and off during the program. Very nice to see this happen.
This tool is now working in the c++ example gui. For the python gui i have to compile it yet.

Project archive:
we.tl/t-gJ8SnJ265p

 
 
Attachments:
Last edit: 09 Sep 2021 20:10 by Grotius.

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

More
10 Sep 2021 10:19 #220117 by Grotius
Hi,

The Python users can try this archive : we.tl/t-l1cvYH9XyK

Python modules:
Qt_graphics_universal_widget/libpython/Qt_Nml_Python/PyNmlPlugin.so
Qt_graphics_universal_widget/libpython/Qt_Nml_Python/PyOpencascade.so

If you want to recompile the above modules yourself :
$ ./python3 configure.py # In each of above directory.
$ make clean
$ make
$ sudo make install

You can also sent nml commands to the nml-plugin, like start, stop, estop, etc.

Python gui runtest, shown at the picture below, loads stepfiletool and show's arc-on while program is running :
Qt_graphics_universal_widget/libpython/Qt_Nml_Python/./runtest_custom_tool.py

 

I will now leave the code as it is for a while.

 
Attachments:
The following user(s) said Thank You: tommylight, bkt, ftree

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

Time to create page: 0.307 seconds
Powered by Kunena Forum