From: cmorley <gi...@gi...> - 2011-06-28 00:40:46
|
pncconf fix display of units on spindle page removed duplicity of code and fixed it so spindle page used correct units. http://git.linuxcnc.org/?p=emc2.git;a=commitdiff;h=e53c9d3 --- src/emc/usr_intf/pncconf/pncconf.py | 105 +++++++++++++---------------------- 1 files changed, 38 insertions(+), 67 deletions(-) diff --git a/src/emc/usr_intf/pncconf/pncconf.py b/src/emc/usr_intf/pncconf/pncconf.py index b360bab..36da4b9 100644 --- a/src/emc/usr_intf/pncconf/pncconf.py +++ b/src/emc/usr_intf/pncconf/pncconf.py @@ -5449,14 +5449,45 @@ class App: w[axis + "outputscale"].set_sensitive(pwmgen) w[axis + "outputoffset"].set_sensitive(pwmgen) w[axis + "maxoutput"].set_sensitive(pwmgen) + + if axis == "s": + unit = "rev" + pitchunit =_("Gearbox Reduction Ratio") + elif axis == "a": + unit = "degree" + pitchuint = _("Reduction Ratio") + elif d.units ==_METRIC: + unit = "mm" + pitchunit =_("Leadscrew Pitch") + else: + unit = "inch" + pitchunit =_("Leadscrew TPI") + + w["labelmotor_pitch"].set_text(pitchunit) + w["labelencoder_pitch"].set_text(pitchunit) + w["motor_screwunits"].set_text(_("("+unit+" / rev)")) + w["encoder_screwunits"].set_text(_("("+unit+" / rev)")) + w[axis + "velunits"].set_text(_(unit+" / min")) + w[axis + "accunits"].set_text(_(unit+" / sec²")) + w["accdistunits"].set_text(unit) + if stepdriven: + w[ "resolutionunits1"].set_text(_(unit+" / Step")) + w["scaleunits"].set_text(_("Steps / "+unit)) + else: + w["resolutionunits1"].set_text(_(unit+" / encoder pulse")) + w["scaleunits"].set_text(_("Encoder pulses / "+unit)) + if not axis =="s": + w[axis + "homevelunits"].set_text(_(unit+" / min")) + w[axis + "homelatchvelunits"].set_text(_(unit+" / min")) + w[axis + "homefinalvelunits"].set_text(_(unit+" / min")) + w[axis + "minfollowunits"].set_text(unit) + w[axis + "maxfollowunits"].set_text(unit) + if axis == 's': - w["labelmotor_pitch"].set_text(_("Gearbox Reduction Ratio")) - w["labelencoder_pitch"].set_text(_("Gearbox Reduction Ratio")) w["motor_screwunits"].set_text(("")) w["encoder_screwunits"].set_text(("")) w.sencodercounts.set_sensitive(encoder) w[axis + "invertencoder"].set_sensitive(encoder) - w["sservo_info"].set_sensitive(pwmgen) w["saxistest"].set_sensitive(pwmgen) w["sstepper_info"].set_sensitive(stepdriven) @@ -5493,66 +5524,7 @@ class App: set_active("searchdir") set_active("latchdir") set_active("usehomeindex") - if axis == "a": - w["labelmotor_pitch"].set_text(_("Reduction Ratio")) - w["labelencoder_pitch"].set_text(_("Reduction Ratio")) - w["motor_screwunits"].set_text(_("degrees / rev")) - w["encoder_screwunits"].set_text(_("degrees / rev")) - w[axis + "velunits"].set_text(_("degrees / min")) - w[axis + "accunits"].set_text(_("degrees / sec²")) - w[axis + "homevelunits"].set_text(_("degrees / min")) - w[axis + "homelatchvelunits"].set_text(_("degrees / min")) - w[axis + "homefinalvelunits"].set_text(_("degrees / min")) - w["accdistunits"].set_text(_("degrees")) - if stepdriven: - w["resolutionunits1"].set_text(_("degree / Step")) - w["scaleunits"].set_text(_("Steps / degree")) - else: - w[ "resolutionunits1"].set_text(_("degrees / encoder pulse")) - w["scaleunits"].set_text(_("Encoder pulses / degree")) - w[axis + "minfollowunits"].set_text(_("degrees")) - w[axis + "maxfollowunits"].set_text(_("degrees")) - - elif d.units == _METRIC: - w["labelmotor_pitch"].set_text(_("Leadscrew Pitch")) - w["labelencoder_pitch"].set_text(_("Leadscrew Pitch")) - w["motor_screwunits"].set_text(_("(mm / rev)")) - w["encoder_screwunits"].set_text(_("(mm / rev)")) - w[axis + "velunits"].set_text(_("mm / min")) - w[axis + "accunits"].set_text(_("mm / sec²")) - w[axis + "homevelunits"].set_text(_("mm / min")) - w[axis + "homelatchvelunits"].set_text(_("mm / min")) - w[axis + "homefinalvelunits"].set_text(_("mm / min")) - if stepdriven: - w[ "resolutionunits1"].set_text(_("mm / Step")) - w["scaleunits"].set_text(_("Steps / mm")) - else: - w["resolutionunits1"].set_text(_("mm / encoder pulse")) - w["scaleunits"].set_text(_("Encoder pulses / mm")) - - w[axis + "minfollowunits"].set_text(_("mm")) - w[axis + "maxfollowunits"].set_text(_("mm")) - - else: - w["labelmotor_pitch"].set_text(_("Leadscrew TPI")) - w["labelencoder_pitch"].set_text(_("Leadscrew TPI")) - w["motor_screwunits"].set_text(_("(rev / inch)")) - w["encoder_screwunits"].set_text(_("(rev / inch)")) - w[axis + "velunits"].set_text(_("inches / min")) - w[axis + "accunits"].set_text(_("inches / sec²")) - w[axis + "homevelunits"].set_text(_("inches / min")) - w[axis + "homelatchvelunits"].set_text(_("inches / min")) - w[axis + "homefinalvelunits"].set_text(_("inches / min")) - w["accdistunits"].set_text(_("inches")) - if stepdriven: - w[ "resolutionunits1"].set_text(_("inches / Step")) - w[ "scaleunits"].set_text(_("Steps / inch")) - else: - w[ "resolutionunits1"].set_text(_("inches / encoder pulse")) - w["scaleunits"].set_text(_("Encoder pulses / inch")) - - w[axis + "minfollowunits"].set_text(_("inches")) - w[axis + "maxfollowunits"].set_text(_("inches")) + thisaxishome = set(("all-home", "home-" + axis, "min-home-" + axis,"max-home-" + axis, "both-home-" + axis)) homes = False for i in thisaxishome: @@ -5570,8 +5542,8 @@ class App: w[axis + "compfilename"].set_sensitive(i) i = d[axis + "usebacklash"] w[axis + "backlash"].set_sensitive(i) - self.widgets.druid1.set_buttons_sensitive(1,0,1,1) - self.motor_encoder_sanity_check(None,axis) + self.widgets.druid1.set_buttons_sensitive(1,0,1,1) + self.motor_encoder_sanity_check(None,axis) def on_xusecomp_toggled(self, *args): self.comp_toggle('x') def on_yusecomp_toggled(self, *args): self.comp_toggle('y') @@ -5904,8 +5876,7 @@ class App: else: maxrpm = int(maxvps * 60 * (scale/(microstepfactor * motor_steps))) w["acctime"].set_text("%.4f" % acctime) - if not axis == 's': - w["accdist"].set_text("%.4f" % accdist) + w["accdist"].set_text("%.4f" % accdist) w["chartresolution"].set_text("%.7f" % (1.0 / scale)) w["calscale"].set_text(str(scale)) w["maxrpm"].set_text("%d" % maxrpm) |