Gscreen - a GTK / Glade / Python based screen

More
12 Apr 2013 09:16 #32611 by LAIR82
One more question, I don't need to re-compile everytime I change something on gscreen do I?

Rick

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

More
12 Apr 2013 22:30 #32642 by cmorley

Cmorley,

hello sorry you bother.

GScreen trying to get, I see you did the ToolEdit in glade. copy your files (tooledit.widget.py and tooledit.gtk.glade) in /sim/axis and try to embed on screen AXIS, but I get an error. I gave the path to my file. TBL.

But it has not been unsuccessful. is that I have no knowledge of programming, if I ask your help,



In advance thank you very much for your attention.

jorge


Jorge:

This is not possible the way you are doing it.
The way to do this is to build a gladeVCP panel with the tooledit widget on it and embed this panel into AXIS.
see the manual under gladeVCP embedding in AXIS.

Tooledit requires Master version.

Chris M

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

More
12 Apr 2013 22:44 #32644 by cmorley
I wonder if this is because you are trying to use data.estopped before the periodic is turned on?

you could check the task state directly through

self.gscreen.emc_status.emcstat.poll()
estop = self.gscreen.emc_status.task_state == self.gscreen.emc_status..emc.STATE_ESTOP

Hope I got that code right...
There may be other ways - I just don't have time to check sorry.

Chris M

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

More
12 Apr 2013 22:54 - 12 Apr 2013 22:56 #32646 by cmorley
Last edit: 12 Apr 2013 22:56 by cmorley.

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

More
12 Apr 2013 22:55 #32647 by cmorley

The preference file is located in your home directory (most likely your name)
It's hidden so you must select 'show hidden files' in the browser.

If you are using Industrial the the glade file and handler file will need to be in your config folder. (copied from the sim/gscreen_custom folder)

If you are using default Gscreen the you must copy Gscreens glade file and make a handler file.

I use gedit to edit python. and you use GLADE editor to change the GLADE file.
You must run glade from a terminal after entering . scripts/rip-evironment

GLADE editing takes some time to get quick at.
I hope this helps/


Hello Chris,

Its been a madhouse at our shop, I've had a machining center down since monday with a bad servo, so I haven't been able to play my gscreen machine at all this week. Hopefully by monday I can let you know how the keybindings work. Actually, could you give me an example of what the line would look like to change a binding, I want to change the left/right jog buttons to be axis 2 instead of 1.

I see my preferences file now. So I need to be in the /scripts/rip-environment directory then run glade from the command line. Making sense so far. What would the command be for starting glade?

Thanks

Rick


Rick

You are using Gscreen industrial so you already have a hander file but need to add code to it.

you need to add:
def initialize_keybindings()
        self.widgets.window1.connect('key_press_event', self.on_key_event,1)
        self.widgets.window1.connect('key_release_event', self.on_key_event,0)

def on_key_event(self,widget, event,signal):
        keyname = gtk.gdk.keyval_name(event.keyval)
        print "Key %s (%d) was pressed" % (keyname, event.keyval),signal
        if event.state & gtk.gdk.CONTROL_MASK:
            print "Control was being held down"
        if event.state & gtk.gdk.MOD1_MASK:
            print "Alt was being held down"
        if event.state & gtk.gdk.SHIFT_MASK:
            print "Shift was being held down"

        if keyname == "Up":
            if self.data.key_event_up == signal: return
            self.gscreen.do_key_jog(0,0,signal)
            self.data.key_event_up = signal
        elif keyname == "Down":
            if self.data.key_event_dwn == signal: return
            self.gscreen.do_key_jog(0,1,signal)
            self.data.key_event_dwn = signal
        elif keyname == "Left":
            self.gscreen.do_key_jog(2,0,signal)
        elif keyname == "Right":
            self.gscreen.do_key_jog(2,1,signal)
        elif keyname == "Page_Up":
            self.gscreendo_key_jog(1,0,signal)
        elif keyname == "Page_Down":
            self.gscreendo_key_jog(1,1,signal)
        elif keyname in ("I","i") :
            if signal: return
            if event.state & gtk.gdk.SHIFT_MASK:
                self.gscreen.set_jog_increments(index_dir = -1)
            else:
                self.gscreen.set_jog_increments(index_dir = 1)


Hope I got that right.... :)
You don't need to recompile.

Chris M

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

More
12 Apr 2013 23:38 #32651 by jlviloria
Chris thanks for your answer.

friend I ask a little patience and cooperation.

install the master, the glade, geany,

in glade:

windows1, hbox1, tooledit1.

save as tooledit1.ui

my problem was tooledit1.py
Chris I have not the faintest idea to put here.

in my. INI, the master version have placed enough to embed the tooledit, but I can not recognize the lathe.tbl.

my problem is in the. py, I have reviewed, read, analyzed, I tried many things but without any achievement. I hope I can do the favor of guiding.

www.linuxcnc.org/index.php/english/forum...insert-axis-question

thanks in advance.

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

More
13 Apr 2013 20:19 #32681 by newbynobi

I wonder if this is because you are trying to use data.estopped before the periodic is turned on?

you could check the task state directly through

self.gscreen.emc_status.emcstat.poll()
estop = self.gscreen.emc_status.task_state == self.gscreen.emc_status..emc.STATE_ESTOP

Hope I got that code right...
There may be other ways - I just don't have time to check sorry.


Hallo Chris,

I found ot that it must be:
self.gscreen.status.emcstat.poll()
estop = self.gscreen.status.emcstat.task_state == self.gscreen.status.emc.STATE_ESTOP

to get the correct value.

But I am asking myself, when will periodic begin to run?
I checked the state of self.data.estopped now on_window1.realize() and do get the wrong value. If I get it directly with the code you gave me, I get the correct value.

Should this be corrected in the feature? By running the first periodic from gscreen bevor starting the gui?

Norbert

Norbert

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

More
13 Apr 2013 23:28 #32686 by cmorley

I wonder if this is because you are trying to use data.estopped before the periodic is turned on?

you could check the task state directly through

self.gscreen.emc_status.emcstat.poll()
estop = self.gscreen.emc_status.task_state == self.gscreen.emc_status..emc.STATE_ESTOP

Hope I got that code right...
There may be other ways - I just don't have time to check sorry.


Hallo Chris,

I found ot that it must be:
self.gscreen.status.emcstat.poll()
estop = self.gscreen.status.emcstat.task_state == self.gscreen.status.emc.STATE_ESTOP

to get the correct value.

But I am asking myself, when will periodic begin to run?
I checked the state of self.data.estopped now on_window1.realize() and do get the wrong value. If I get it directly with the code you gave me, I get the correct value.

Should this be corrected in the feature? By running the first periodic from gscreen bevor starting the gui?

Norbert

Norbert


The periodic is run after all the initialization is done.
It's the very last thing done before Gscreen just listens for signals.
It has to be or else the screen is updated before you initialize how you want it displayed.

It may be possible to call the method that updates the linuxcnc stuff into our self.data model once, earlier on in the process.
try adding
self.status.periodic()
just after line 444:
self.emc = emc_interface.emc_control(linuxcnc)

let me know if that fixes things for you.

I am working away for 3 weeks so updates and replays will be sporadic....

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

More
14 Apr 2013 00:21 #32690 by LAIR82
Hello Chris,

Which file in gscreen dictates the color of your gcode in auto mode, and the highlight color of the current line being run?

My shop supervisor asked if I could change those colors, he has a hard time reading the lines being that it is bright red and dark red while during a running program.

Hopefully next week I can try to do some personalizing regarding the pointers you have given me.

Thanks

Rick

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

More
14 Apr 2013 04:03 #32710 by cmorley
I lightened the color of the highlight, it is not currently user configurable.

changing Gcode colors is a more involved:

superuser.com/questions/353391/custom-ge...lighting-for-dummies

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

Time to create page: 0.604 seconds
Powered by Kunena Forum