Gmoccapy edit interface

More
28 Sep 2018 13:57 #118113 by pankiss
Hi, im new on Linux and Gmoccapy, i have question is possible to change icons and color on background on icons, and background (this black one) on interface -> can i put some logo there?
Where i can find code and localization to do it this change?

Thanks!
Attachments:

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

More
26 Oct 2018 18:54 #119476 by sevaz
Replied by sevaz on topic Gmoccapy edit interface
Hello! I think it's possible to do it, by using glade editor and changing gmocapy.glade file in /usr/share/gmoccapy.

For the translation, you can follow these instructions, they are all the same for all linuxcnc components

wiki.linuxcnc.org/cgi-bin/wiki.pl?Internationalization

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

More
28 Oct 2018 22:12 #119575 by newbynobi
Replied by newbynobi on topic Gmoccapy edit interface
To change collors go to the settings page and select any installed theme.
The icons are locatet at /usr/share/gmoccapy/images so changing that ones is no problem.

Do not rename or delete icons! Just replace them!
Icons best size is 48x48 pixel.

Norbert

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

More
19 Dec 2020 15:59 - 19 Dec 2020 17:29 #192460 by HansU
Replied by HansU on topic Gmoccapy edit interface
I also want to open the gmoccapy.glade file of the 2.8 release with the glade editor.
But when I do this with
$ glade-gtk2 gmoccapy.glade
it shows the loading dialog and then exits with that error on the bash:
(glade-gtk2:7909): GladeUI-WARNING **: 18:26:38.462: Failed to open catalog directory '': Fehler beim Öffnen des Ordners »«: Datei oder Verzeichnis nicht gefunden

(glade-gtk2:7909): GladeUI-WARNING **: 18:26:38.462: Failed to open catalog directory '': Fehler beim Öffnen des Ordners »«: Datei oder Verzeichnis nicht gefunden
GladeUI-Message: 18:26:38.649: No displayable values for property GtkToolPalette::icon-size
GladeUI-Message: 18:26:38.650: No displayable values for property GtkToolItemGroup::ellipsize
GladeUI-Message: 18:26:38.650: No displayable values for property GtkToolItemGroup::header-relief

(glade-gtk2:7909): GladeUI-WARNING **: 18:26:38.814: Boolean tag unrecognized *false*

GladeUI-Message: 18:26:38.842: Glade needs artwork; a default icon will be used for the following classes:
        HAL_ComboBox    needs an icon named 'widget-gladevcp-hal_combobox'
        HALIO_Button    needs an icon named 'widget-gladevcp-halio_button'
        HAL_Label       needs an icon named 'widget-gladevcp-hal_label'
        HAL_ProgressBar needs an icon named 'widget-gladevcp-hal_progressbar'
        HAL_Button      needs an icon named 'widget-gladevcp-hal_button'
        EMC_Action_MDI  needs an icon named 'gtk-execute'
        HAL_VScale      needs an icon named 'widget-gladevcp-hal_vscale'
        HAL_Graph       needs an icon named 'widget-gladevcp-hal_graph'
        EMC_ToggleAction_MDI    needs an icon named 'gtk-execute'
        EMC_Action_Python       needs an icon named 'gtk-execute'
        State_Sensitive_Table   needs an icon named 'widget-gladevcp-state_sensitive_table'
        EMC_SourceView  needs an icon named 'widget-gladevcp-vcp_sourceview'
        HAL_CheckButton needs an icon named 'widget-gladevcp-hal_checkbutton'
        Override        needs an icon named 'widget-gladevcp-override'
        MacroSelect     needs an icon named 'widget-gladevcp-vcp_macro_select'
        HAL_HBox        needs an icon named 'widget-gladevcp-hal_hbox'
        OffsetPage      needs an icon named 'widget-gladevcp-offsetpage'
        HALIO_HScale    needs an icon named 'widget-gladevcp-halio_hscale'
        HAL_Table       needs an icon named 'widget-gladevcp-hal_table'
        HAL_ToggleButton        needs an icon named 'widget-gladevcp-hal_togglebutton'
        HAL_RadioButton needs an icon named 'widget-gladevcp-hal_radiobutton'
        HAL_HideTable   needs an icon named 'widget-gladevcp-hal_hidetable'
        State_Label     needs an icon named 'widget-gladevcp-state_label'
        HAL_LightButton needs an icon named 'widget-gladevcp-hal_light_button'
        EMC_MDIHistory  needs an icon named 'widget-gladevcp-vcp_mdihistory'
        HAL_GremlinPlus needs an icon named 'widget-gladevcp-hal_gremlin_plus'
        HAL_SpinButton  needs an icon named 'widget-gladevcp-hal_spinbutton'
        EMC_FileChooserDialog   needs an icon named 'widget-gladevcp-vcp_filechooserdialog'
        EMC_FileChooserButton   needs an icon named 'widget-gladevcp-vcp_filechooserbutton'
        HAL_HScale      needs an icon named 'widget-gladevcp-hal_hscale'
        PyNgcGui        needs an icon named 'widget-gladevcp-pyngcgui'
        Status_Label    needs an icon named 'widget-gladevcp-status_label'

hal_gremlin: cannot find inifile

Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/gladevcp/hal_gremlin.py", line 117, in __init__
    inifile = linuxcnc.ini(ini_filename)
TypeError: argument 1 must be string, not None
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/gladevcp/hal_gremlin.py", line 157, in do_set_property
    if self.lathe_option:
AttributeError: 'HAL_Gremlin' object has no attribute 'lathe_option'
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/gladevcp/hal_gremlin.py", line 157, in do_set_property
    if self.lathe_option:
AttributeError: 'HAL_Gremlin' object has no attribute 'lathe_option'
**** Offsetpage widget ERROR: LINEAR_UNITS not found in INI's TRAJ section
Speicherzugriffsfehler
Is that the problem?:
hal_gremlin: cannot find inifile
Where is that file and how can I pass the file to glade?

Maybe something with my glade installation? I took it from:
www.linuxcnc.org/dists/wheezy/base/binar...0-0ubuntu6_amd64.deb
www.linuxcnc.org/dists/wheezy/base/binar...0-0ubuntu6_amd64.deb
Last edit: 19 Dec 2020 17:29 by HansU.

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

More
19 Dec 2020 21:09 - 19 Dec 2020 21:11 #192478 by cmorley
Replied by cmorley on topic Gmoccapy edit interface
There was a change in 2.8.1? that seems to have broken loading of the hal_gremlin.
I made an issue:
github.com/LinuxCNC/linuxcnc/issues/1006
Last edit: 19 Dec 2020 21:11 by cmorley.
The following user(s) said Thank You: tommylight, HansU

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

More
23 Dec 2020 15:13 #192970 by newbynobi
Replied by newbynobi on topic Gmoccapy edit interface
I am not able to reproduce this.

It is known, that the glade Editor is buggy. I have compiled mine from source! It is necessary to use glade 3.8.6 editor. Please check if you use that release. And it might be necessary to start the editor from a rip-environment terminal.

Norbert

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

More
31 Dec 2020 21:45 #193680 by nf1z
Replied by nf1z on topic Gmoccapy edit interface
I have the same issue editing gmoccapy.glade using Glade.

I have changed to gmoccapy on my system because I want to add some significant GUI capabilities, and this seems the best starting point. I like gmoccapy so far, and progressing well, but I would like to make some of the buttons sensitive when in ESTOP. This is what I am used to, and I don't see anything wrong with being able to change settings or set offsets or edit WCS in ESTOP.

I am in no way an expert in any of this, but it seemed that I should be able do this by editing gmoccapy.glade (correct me if I'm wrong). However, when I do 'glade-3 gmoccapy.glade' I get this error after Glade has loaded 350 or so widgets:
**** Offsetpage widget ERROR: LINEAR_UNITS not found in INI's TRAJ section
Segmentation fault

Chris's git issue seems to indicate a similar error, but a different file. Offsetpage_widget.py in the 2.9.0~pre0 source code has the lines:
# we put this in a try so there is no error in the glade editor
# linuxcnc is probably not running then
try:
    INIPATH = os.environ['INI_FILE_NAME']
except:
    pass

I had wondered why a graphics editor was concerned about a LinuxCNC .ini file, and I still wonder why it executes this Python script. But anyway, later the script contains, and this seems to be the problem:
        # check the ini file if UNITS are set to mm
        # first check the global settings
        # if not available then the X axis units
        try:
            self.inifile = self.linuxcnc.ini(INIPATH)
            units = self.inifile.find("TRAJ", "LINEAR_UNITS")
            if units == None:
                units = self.inifile.find("AXIS_X", "UNITS")
        except:
            print(_("**** Offsetpage widget ERROR: LINEAR_UNITS not found in INI's TRAJ section"))
            units = "inch"

Just for fun, I replaced this whole section with:
      units="inch"
which moved the problem to the same place as hans23:
hal_gremlin: cannot find inifile

Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/gladevcp/hal_gremlin.py", line 117, in __init__
    inifile = linuxcnc.ini(ini_filename)
TypeError: argument 1 must be string, not None
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/gladevcp/hal_gremlin.py", line 157, in do_set_property
    if self.lathe_option:
AttributeError: 'HAL_Gremlin' object has no attribute 'lathe_option'
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/gladevcp/hal_gremlin.py", line 157, in do_set_property
    if self.lathe_option:
AttributeError: 'HAL_Gremlin' object has no attribute 'lathe_option'
Segmentation fault

As I said, I don't know why Glade needs to execute a Python script that is looking for an .ini file, but it occurs to me that it should be possible to fake an .ini file somehow. I tried this:
env INI_FILE_NAME=<somewhere>/fake.ini glade-3 gmoccapy.glade
I don't get an .ini file error, but I still get a Segmentation fault with no useful info. I also tried it in a RIP environment as suggested by Norbert.

I had to build Glade 3.8.6 from source and I'm not at all sure I did it right, but I have managed to build a whole new gmoccapy tab with lots of widgets, so it must be close. I have found Glade to be buggy, as Norbert says. One thing I did notice is that Glade does not immediately choke if you add an Offsetpage widget to an empty window.

In summary, it looks like the .ini issue can be bypassed, but there's still is a problem with Glade, Any suggestions on getting a reliable graphical editor for GladeVCP files, or another way to do it? I'm not very keen to mess with the xml, and don't like the idea of going forward with something that may be unmaintainable. I suppose I could edit gmoccapy.py, but that seems like a bad idea. I wonder how Norbert is able to continue editing gmoccapy.glade with Glade 3.8.6?

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

More
01 Jan 2021 03:34 #193696 by cmorley
Replied by cmorley on topic Gmoccapy edit interface
glade-gtk2 is an editor that is very old. It's surprising it works at all. It was always a little buggy.
as for getting it stable, my guess would be the best bet would be using a very old version of linuxcnnc's iso to build a more appropriate distribution version.

I'm pretty sure you will need to modify Gmoccapy's python file to do what you wish anyway.

Norbert probably saves his work often.
Rhere are some tricks - if you add actions, right click and add to toplevel rather then the usual
People are working on converting Gladevcp to GTK3/python3 to move linuxcnc along.

Chris

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

More
01 Jan 2021 13:34 #193721 by newbynobi
Replied by newbynobi on topic Gmoccapy edit interface
The glade editor will work fine, if you get the source of glade 3.8.6 and than compile that one from source. I have mine working on Debian 9, Mitn 19.3 and Mint 20 . I start the glade editor from a rip-environment using a basjh script.

It is a little bit dangerous to edit the gmoccapy.glade file, if you do not know exactly what you are doing. Do not rename widgets, so not delete widgets and you will be fine. Moving them around should not destroy the glade file.

If you want to change widgets sensitive state at start up, or during the normal use, you will need to edit the gmoccapy.py file with a text editor or a IDE. Just look for call to sensitized widgets and change the parameter content of the list given.

And IMHO you are using 2.9 branch, that is an development branch, not recommended to be used on productive machines. Me and many others are working on that branch to change from python 2 to python 3 and also to GTK3. So any change of code in that manner could brake your config. Please use 2.8 branch, compile glade from source and uninstall all glade stuff from the package manager.

Norbert

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

More
02 Jan 2021 23:57 #193904 by nf1z
Replied by nf1z on topic Gmoccapy edit interface
Thanks for the quick replies, guys. Happy New Year.

I am actually using Debian 10 Buster with LinuxCNC 2.8.1, I just quoted from the 2.9.0 version because that's the source I have on the machine. I did build the Glade 3.8.6 from source. I tried to follow instructions found in this forum, but I ended up getting the tar file and following the installation instructions in that. It's very possible I made a mistake somewhere. Generally, it works, but occasionally just crashes. For instance when I try to add a EMC or GTK action widget, boom, with several different failed assertions. For example:
IA__gtk_container_add: assertion 'GTK_IS_WIDGET (widget)' failed

I can however, load owordsub.ui OK, and load a glade file edited to contain an action widget. Very frustrating. Fortunately, it is very easy to add the EMC action widgets manually to the glade file. I just did this, and I now have a nice little Tool Probe panel with two buttons to calibrate the probe and to perform a measurement using my M-code subroutines from Axis days. One day I'll probably redo them in Python now I've been forced to learn some ;-)

Quick update: I forgot to hit 'submit' last night, but in the meantime I made a few cosmetic changes to my spindle monitor tab. I wanted to take a look at Norbert's spindle speed monitor bar, double-clicked gmoccapy.glade in the file manager, and it opened it in Glade. I was expecting to open it in the editor. And it opened perfectly! No idea why it worked this time, nothing has changed, same file, same Glade, same login session,....

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

Moderators: newbynobiHansU
Time to create page: 0.205 seconds
Powered by Kunena Forum