Creating a GUI
Cradek also added that from python
import linuxcnc
x = linuxcnc.stat()
x.poll()
dir(x)
and that popped up a list of all the things in stat too. Then I could print type(x.dtg) and see what type it is and guess how to handle it...
Thanks so much for the help.
I can all ready see that I need to redesign my screen some but it sure is fun when it works...
Also I sorted out what gobject.timeout_add was all about with some help from mhaberler so that is cool too how that works.
John
Please Log in or Create an account to join the conversation.
Taking notes now like a mad man...
Thanks
John
Please Log in or Create an account to join the conversation.
a few things to remember:
you probably want to be able to switch from relative to absolute. (how about commanded vrs actual)
not sure if you use metric and imperial but that needs some careful conversions especially if you plan to be able to set the origin from your DRO.
Though setting the origin to zero is safe and easy and maybe enough.
Glad your having fun - and can't wait to see your tutorial on it.
Chris
Please Log in or Create an account to join the conversation.
www.linuxcnc.org/docs/2.5/html/common/python-interface.html
this is 'raw hide' - suggestions & improvements welcome.
- Michael
Please Log in or Create an account to join the conversation.
John
Please Log in or Create an account to join the conversation.
couple things I noticed maybe you already know...
in 3b the python code...
This is not needed:
# language stuff I think
import gettext
LOCALEDIR = os.path.join(BASE, "share", "locale")
gettext.install("linuxcnc", localedir=LOCALEDIR, unicode=True)
gtk.glade.bindtextdomain("linuxcnc", LOCALEDIR)
gtk.glade.textdomain("linuxcnc")
TCLPATH = os.environ
Also when putting the new screen in /bin you don't need to remove the .py part.
DISPLAY=gui3.py
will work.
The reason I mention this is if someone is testing it is nice if the editor knows the file is python.
great work though! is your plan to add it to the official docs ?
Please Log in or Create an account to join the conversation.
That is great documentation too!
It's very good to see documentation on some of the inner workings of linuxcnc - lowers the barrier for new developers.
(you actually make a habit of good documentation!)
have any idea how SPINDLE_CONSTANT works? I assume it means constant surface speed...
Chris M
Please Log in or Create an account to join the conversation.
Michael
have any idea how SPINDLE_CONSTANT works? I assume it means constant surface speed...
Chris M
The linuxcnc forensics & reverse engineering department has determined it's a noop:
from git.linuxcnc.org/gitweb?p=linuxcnc.git;a...52410e7a786578#l1430
maybe Alex Joni can shed some light on this:
$ git blame src/emc/task/taskintf.cc
...
1d62729f (Alex Joni 2006-07-10 21:35:34 +0000 1421) int emcSpindleConstant()
1d62729f (Alex Joni 2006-07-10 21:35:34 +0000 1422) {
1d62729f (Alex Joni 2006-07-10 21:35:34 +0000 1423) return 0; // nothing to do
1d62729f (Alex Joni 2006-07-10 21:35:34 +0000 1424) }
Please Log in or Create an account to join the conversation.
hey John I looked at your tutorial..
couple things I noticed maybe you already know...
in 3b the python code...
This is not needed:
# language stuff I think
import gettext
LOCALEDIR = os.path.join(BASE, "share", "locale")
gettext.install("linuxcnc", localedir=LOCALEDIR, unicode=True)
gtk.glade.bindtextdomain("linuxcnc", LOCALEDIR)
gtk.glade.textdomain("linuxcnc")
TCLPATH = os.environ
Also when putting the new screen in /bin you don't need to remove the .py part.
DISPLAY=gui3.py
will work.
The reason I mention this is if someone is testing it is nice if the editor knows the file is python.
great work though! is your plan to add it to the official docs ?
I wasn't really sure what the heck that code did... but I do know when I was importing the support libraries from touchy it was needed for some reason.
I was just blindly following the leader in removing the .py....
I've not given any thoughts to adding the tutorials to the docs yet but that is a good idea once they are polished up. I think for now I'll add some links here and on the wiki.
I added links to the wiki and the documents page here.
Thanks
John
Please Log in or Create an account to join the conversation.
I'll work on adding gui 6 to the custom gui tutorial. This will add a lot of information about building your own GUI.
John
Please Log in or Create an account to join the conversation.