NEWS
LinuxCNC 2.5.2 Release
There are no translations available.

LinuxCNC 2.5.2 Update Released (changelog).
 
LinuxCNC 2.5.1 Release
There are no translations available.

LinuxCNC 2.5.1 Update Released (changelog). If the Package Manager does not prompt you to upgrade see this page.

 
LinuxCNC 2.5.0 Release
There are no translations available.

New major release (changelog). See the instructions to update your system from EMC 2.4 to LinuxCNC 2.5.
 
Home Forum Configuring LinuxCNC GladeVCP Speed and Feed Calculator

Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1

TOPIC: Speed and Feed Calculator

Speed and Feed Calculator 31 Jul 2012 05:56 #22630

  • BigJohnT
  • BigJohnT's Avatar
  • OFFLINE
  • Administrator
  • Posts: 4955
  • Thank you received: 87
  • Karma: 134
I started with a simple RPM calculator and ran into a small glitch with the entry box not showing the | to indicate that the box has focus... not a deal breaker but a bit strange to get used to. It might just be a bug I don't know.

Does anyone know what the debug line is for and if there are any options?

calc.py
import hal
import glib
import time
import math

debug = 1

class HandlerClass:

  def on_calc_sfm_clicked(self, widget, data=None):
    self.sfm = float(self.builder.get_object('entry_sfm').get_text())
    self.diameter = float(self.builder.get_object('entry_diameter').get_text())
    self.rpm = str(int(self.sfm * (12/math.pi) / self.diameter))
    self.builder.get_object('label_rpm').set_text(self.rpm)

  def __init__(self, halcomp,builder,useropts):
    self.halcomp = halcomp
    self.builder = builder
    self.nhits = 0

def get_handlers(halcomp,builder,useropts):
  return [HandlerClass(halcomp,builder,useropts)]

The [DISPLAY] ini entry
# add GladeVCP panel as a tab next to Preview/DRO:
EMBED_TAB_NAME=GladeVCP demo
EMBED_TAB_COMMAND=halcmd loadusr -Wn gladevcp gladevcp -c gladevcp -u calc.py -x {XID} calc.glade



This attachment is hidden for guests. Please log in or register to see it.

John
Attachments:
  • Attachment This attachment is hidden for guests. Please log in or register to see it.
Last Edit: 31 Jul 2012 05:59 by BigJohnT.
The administrator has disabled public write access.

Re:Speed and Feed Calculator 31 Jul 2012 07:06 #22633

  • mhaberler
  • mhaberler's Avatar
  • OFFLINE
  • Moderator
  • Posts: 197
  • Thank you received: 8
  • Karma: 54
BigJohnT wrote:
I started with a simple RPM calculator and ran into a small glitch with the entry box not showing the | to indicate that the box has focus... not a deal breaker but a bit strange to get used to. It might just be a bug I don't know.

Does anyone know what the debug line is for and if there are any options?

There were some hoops to jump to get GladeVCP to interoperate properly with Axis wrt key handling and focus, because the Axis GUI toolkit (tkinter) is a bit historic and not particularly friendly towards embedded windows; see the note here: www.linuxcnc.org/docs/devel/html/gui/gla...key_handling_in_axis

I'm fairly sure this causes what you see - this wont be the case in a purely GladeVCP UI, like gscreen

re the debug variable - looks like c&p leftover; since it's not referenced in your code it can be deleted

- Michael
The administrator has disabled public write access.

Re:Speed and Feed Calculator 31 Jul 2012 08:08 #22636

  • BigJohnT
  • BigJohnT's Avatar
  • OFFLINE
  • Administrator
  • Posts: 4955
  • Thank you received: 87
  • Karma: 134
Michael,

Thanks for the explanation. The debug was from the samples in 2.5 so you might want to delete it from the sample configs. One other thing I noticed was that the def get_handlers(halcomp,builder,useropts): had to be on the left margin or it would not work. The manual example shows it intended the same as the def above it.

Thanks
John
The administrator has disabled public write access.

Re:Speed and Feed Calculator 31 Jul 2012 14:24 #22645

  • mhaberler
  • mhaberler's Avatar
  • OFFLINE
  • Moderator
  • Posts: 197
  • Thank you received: 8
  • Karma: 54
ah! right you are - now I understand why Xavier had the same issue

fixed

-m
The administrator has disabled public write access.
  • Page:
  • 1
Moderators: mhaberler
Time to create page: 1.246 seconds
Powered by Kunena Forum
© 2013 LinuxCNC.org
Joomla! is Free Software released under the GNU General Public License.