Couple questions about QTPYVCP

More
22 Dec 2019 17:16 #153049 by KCJ
Replied by KCJ on topic Couple questions about QTPYVCP
Yes, you need to import the resources file near the top of your mainwindow.py file.

Here is how its done in ProbeBasic: github.com/kcjengr/probe_basic/blob/mast...c/probe_basic.py#L12
The following user(s) said Thank You: Leon82

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

More
22 Dec 2019 17:30 - 22 Dec 2019 17:33 #153050 by Leon82
Tanks

the resources_rc file is in the folder but i get this error


File "/home/leon/vcp4/vcp4/mainwindow.py", line 8, in <module>
import resources_rc
ImportError: No module named resources_rc


this is my top main py file
import os
from qtpyvcp.widgets.form_widgets.main_window import VCPMainWindow
from qtpy.QtCore import Slot
from qtpy.QtWidgets import QAbstractButton
from qtpyvcp.plugins import getPlugin
from PyQt5 import QtCore, QtWidgets
from PyQt5.QtSql import QSqlDatabase
import resources_rc
Last edit: 22 Dec 2019 17:33 by Leon82.

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

More
22 Dec 2019 17:34 #153051 by KCJ
Replied by KCJ on topic Couple questions about QTPYVCP
Ah, you have your resources file in a subdirectory!

You probably have to add an empty __init__.py file to your resources/ dir and then import your resources from there:

from resources import resources_rc
The following user(s) said Thank You: Leon82

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

More
22 Dec 2019 17:39 #153053 by Leon82

Ah, you have your resources file in a subdirectory!

You probably have to add an empty __init__.py file to your resources/ dir and then import your resources from there:

from resources import resources_rc


THis worked

Thanks!

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

More
22 Dec 2019 18:50 - 22 Dec 2019 18:51 #153057 by rodw
Replied by rodw on topic Couple questions about QTPYVCP

i get this in the terminal after i set the image

Gtk-Message: GtkDialog mapped without a transient parent. This is discouraged.
libpng warning: iCCP: known incorrect sRGB profile
libpng warning: iCCP: known incorrect sRGB profile
libpng warning: iCCP: known incorrect sRGB profile
libpng warning: iCCP: known incorrect sRGB profile
libpng warning: iCCP: known incorrect sRGB profile

recources.qrc file looks like this
<RCC>
<qresource prefix="newPrefix">
<file>Axes.png</file>
</qresource>
</RCC>


I'm at a loss to understand why a CNC machine is using ICC colour profiles. Its hardly the application where precise colour calibration is required as in high end printing or photographic reproduction.

A quick search indicated this warning is because ICC profiles are embedded in some graphics. Stripping the profile from the image should remove the warning. See:
stackoverflow.com/questions/22745076/lib...rgb-profile/43415650
Last edit: 22 Dec 2019 18:51 by rodw.

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

More
22 Dec 2019 18:58 #153058 by KCJ
Replied by KCJ on topic Couple questions about QTPYVCP
These warnings have nothing to do with LinuxCNC or QtPyVCP, they occur when QtDesigner uses native dialogs (file chooser, color picker etc.) on a GTK system. You can set QtDesigner top use Qt dialogs instead of the native GTK ones and the errors go away. The problem is with GTK, not Qt. If you run many GTK apps from the command line you will notice these exact same warnings come up all the time.

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

More
22 Dec 2019 19:03 #153061 by rodw
Replied by rodw on topic Couple questions about QTPYVCP
it would be interesting to use one of the batch tools mentioned on stackoverflow to strip out all ICC colour profiles from the images used in the interface to see if the warnings go away.

But clearly, this is one case where warnings are warnings and can be ignored... Which is never wise if programming in C...

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

More
22 Dec 2019 19:09 #153062 by Leon82

it would be interesting to use one of the batch tools mentioned on stackoverflow to strip out all ICC colour profiles from the images used in the interface to see if the warnings go away.

But clearly, this is one case where warnings are warnings and can be ignored... Which is never wise if programming in C...


When I compiled some Android ROMs I remember having to setup pngcrush.

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

More
22 Dec 2019 19:15 #153063 by KCJ
Replied by KCJ on topic Couple questions about QTPYVCP
Yes, that would be very interesting!
At least some of them seems to be caused by icons with incorrect ICC profile, since I get the errors with other apps.

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

More
22 Dec 2019 19:59 - 22 Dec 2019 20:00 #153067 by Gnevko
Hi everyone :)

I am not sure if it's correct please for this question (sorry if not) but my be you can help me with the problem described hier: www.forum.linuxcnc.org/18-computer/38015-whb04b-4#153040

If I press an actionButton in the GUI with the following action: "machine.jog.axis:x,pos" than the machine change the mode from



to



and after that I can jog with MPG (WHB04B-4) as it should be. As soon I press one of macro buttons on MPG, the machine goes again in previous state (manual + joint) and I need to press an jog button again on GUI to become MPG work.

The question is, what happens exactly if I press the action button with "machine.jog.axis:x,pos"? Is these the possibility to avoid joint mode?
Attachments:
Last edit: 22 Dec 2019 20:00 by Gnevko.

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

Moderators: KCJLcvette
Time to create page: 0.135 seconds
Powered by Kunena Forum