QT C++ graphics display WIDGET

More
03 Sep 2021 15:54 #219539 by Reinhard

No luck with the QopenGlwidget and Opencascade combination.
The result is still the same, no tranceparancy.

Yes, I got the same result, so I started to dig into opencascade too. Have some troubles with the samples. One crashes quite often. Gladly the other seems to work.

With nml I have similar problems. Just finished coding nml abstraction layer, but then I had to realize, that it does not compile. linuxcnc and qt use same defines for different use case ...
So have to spend more time in fixing that.
May be I build an independant library to cut off dependencies. Grunt work awaiting my attention ;)
The following user(s) said Thank You: Grotius

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

More
03 Sep 2021 17:39 #219545 by Grotius
Hi Reinhard,

Using namespace could solve this, but i suggest if possible, renaming is a nice option.
I don't have problem's with opencascade crashing.
If you like, i can take a look at the nml code and report my findings.

I look forward to get an insight in your nml class.
If you use the Qtproperty system in your nml code it can be ported to be a Python library within a few minutes. I learned
this today, and i am impressed by it's simplicity if you know the way.

Is yout nml class configured as shared lib with a global_header file?
Ok, nice work so far. We are passed the difficulty border (boundary) and can go on,, and fix this code.




 

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

More
03 Sep 2021 22:59 #219560 by Grotius
Hi,

Just cleaned up some code for the Python integration.
Chris, can you look at the code please?  Point of interest is the ./runtest.py file attached with .txt extenstion.

Python gui with opencascade, super fast, super responsive :
 
Attachments:
The following user(s) said Thank You: phillc54, tommylight

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

More
04 Sep 2021 01:38 #219568 by cmorley
is pyqt version 5.15 a requirement? - my system ( Mint 20) uses 5.12.8

While making a python wrapper for your widget is convenient for python users, a C++ widget that can be placed in QtDesigner should be sufficient if that makes testing easier.

opencascade said there was errors installing but never said what the errors were. I see the files so maybe it worked. I'll wait for your answer about pyqt version before attempting compiling further.

Chris
The following user(s) said Thank You: Grotius

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

More
04 Sep 2021 07:37 #219584 by Reinhard
Hi,

I just publish my work around nml abstraction. StatusReader is currently disabled - until I figure out, how to add the dependencies to qmake/qtcreator definitions ...

Anyway - mocking positions run through the same path of abstraction and you can see, that StatusReader does not know anything about the visual client. Visual clients don't know anything about StatusReader or about another widget, which uses the same variables ...

... and for those that don't know: dockables are widgets, that can be placed side by side. But they can be arranged on top of each other too, so its already a working notebook widget ...
The following user(s) said Thank You: Grotius

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

More
04 Sep 2021 12:05 #219595 by Grotius
Hi Chris,

For the opencascade, you could consider to recompile it on your own pc after the dep install, this takes about 30 minutes :
wget https://github.com/grotius-cnc/Linux-Pro/releases/download/1.0.0/opencascade.deb
sudo dpkg -i opencascade.deb
# Recompile archive from source :
cd oce-upstream-V7_5_0beta
# mkdir build
cd build
make clean
cmake ..
make -j2
sudo make install

*is pyqt version 5.15 a requirement? - my system ( Mint 20) uses 5.12.8
I think not. I did a install it from source to avoid missing dependencies.
# sources: https://files.pythonhosted.org/packages/8e/a4/d5e4bf99dd50134c88b95e926d7b81aad2473b47fde5e3e4eac2c69a8942/PyQt5-5.15.4.tar.gz
tar xvzf PyQt5-5.15.4.tar.gz && \
cd PyQt5-5.15.4 && \
python3 configure.py --confirm-license && \
make && \
sudo make install
cd ..

And a sip install from source :
# sources: https://www.riverbankcomputing.com/static/Downloads/sip/4.19.25/sip-4.19.25.tar.gz
tar xvzf sip-4.19.25.tar.gz && \
cd sip-4.19.25 && \
python3 configure.py --sip-module PyQt5.sip && \
make && \
sudo make install
cd ..

Then the python_gui project is build by, see my earlyer post for the archive.
# Base example: https://github.com/eyllanesc/Qt5toPyQt5/tree/master/src
cd Qt_Occ_Python
python3 configure.py
make
sudo make install
python3 runtest.py
cd ..

When the app start's it's very small. Resize it and press button to change background.

* While making a python wrapper for your widget is convenient for python users.
The way i did make the python library, is it ok for you?

* a C++ widget that can be placed in QtDesigner should be sufficient if that makes testing easier.
I have to dig into that. I know how to make widgets for the QtDesigner based on c++.

* I'll wait for your answer about pyqt version before attempting compiling further.
Just try it with your current version. If you get a compile error like : "a certain .sip file not found ". Then you problably have
to compile from source.

Oke good luck !


 

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

More
04 Sep 2021 19:36 - 04 Sep 2021 19:39 #219620 by Grotius
Hi Chris,

Attached my latest example, inluding python modules.
I think this example will run directly if a user has the opencascade.deb is installed.
I cleaned up some more code. And added the "current available" property list to the ./runtest.py file.

This is for me a nice starting point to go on with.

About things todo.
About the dro's. How are you thinking about updating dro values from hal?
I could let the c++ side setup a component with the halpins to connect.

Or will you be more satisfied if dro values are updated trough nml?

I think doing it trough hal is the most powerfull one. Users can also display totally different hal values instead of a dro value.
If i make the textlabels universal, they can in fact display any text users want to.

Please let me know how you think about this. For hal-core it's the best solution, and it's the solution without any spagetti code and
has a lower memory load related to nml.

 

The python_gui code :
Warning: Spoiler!









 
Attachments:
Last edit: 04 Sep 2021 19:39 by Grotius.

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

More
04 Sep 2021 19:45 #219621 by Grotius
Hi Reinhard,

I had a look at your code. Thank you for publishing the nml code so far !
 

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

More
05 Sep 2021 04:45 #219649 by Reinhard
Hi,

I solved to link to linuxcnc.

So running together with axis already shows a working axismask, homing signal of axis/joints and status propagation ...
 
Attachments:
The following user(s) said Thank You: bkt, Grotius

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

More
05 Sep 2021 04:46 - 05 Sep 2021 19:11 #219650 by Grotius
I forgot to mention.

To enable displaying image's with opencascade, wich is currently set false in the opencascade.deb when installing without recompiling.

To enable displaying images, you can follow these steps :
#!/bin/bash

# For opencascade displaying image's (textures) we have to install the freeimage library and
# enable this option in the opencascade make process.
# This script has to be merged into the opencascade.deb postinst file some day.

sudo apt-get install tcllib tklib tcl-dev tk-dev libfreetype-dev \
libx11-dev libgl1-mesa-dev libfreeimage-dev rapidjson-dev \
libfreeimage3 libfreeimage-dev ffmpeg

wget https://github.com/grotius-cnc/Linux-Pro/releases/download/1.0.0/opencascade.deb
dpkg -i opencascade.deb
mkdir build
cd build
cmake ..

# https://github.com/tpaviot/oce/issues/744#issuecomment-908528485
# open /build/CMakeCache.txt
# line 1078, USE_FREEIMAGE:BOOL=ON

make
sudo make install


Above script i will merge into the opencascade.deb package postinst script file within a few day's.
 
Last edit: 05 Sep 2021 19:11 by Grotius.

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

Time to create page: 0.175 seconds
Powered by Kunena Forum