summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Morley <chrisinnanaimo@hotmail.com>2014-01-12 01:00:23 -0800
committerChris Morley <chrisinnanaimo@hotmail.com>2014-01-12 01:00:23 -0800
commitfd8f0ef4638456c765caaa6880cfd8de02c11cb6 (patch)
tree008542ec06dcbed6bc14e89dcce06a3f0a1499ec
parent6eadae4c8ef1f5d614d06626b9e05e056d46c8f8 (diff)
downloadlinuxcnc-fd8f0ef4638456c765caaa6880cfd8de02c11cb6.tar.gz
linuxcnc-fd8f0ef4638456c765caaa6880cfd8de02c11cb6.zip
stepconf -fix input output signal search to include parport 2
parport 2 was not included in the signal search sets. add two generalied functions for this. eg now if you pick a home signal on parport 2 it will recongnize it and sensitize the entry box for homing data.
-rwxr-xr-xsrc/emc/usr_intf/stepconf/build_HAL.py25
-rw-r--r--src/emc/usr_intf/stepconf/build_INI.py2
-rwxr-xr-xsrc/emc/usr_intf/stepconf/pages.py4
-rwxr-xr-xsrc/emc/usr_intf/stepconf/stepconf.py38
4 files changed, 34 insertions, 35 deletions
diff --git a/src/emc/usr_intf/stepconf/build_HAL.py b/src/emc/usr_intf/stepconf/build_HAL.py
index b3b8b3961..68c55f738 100755
--- a/src/emc/usr_intf/stepconf/build_HAL.py
+++ b/src/emc/usr_intf/stepconf/build_HAL.py
@@ -33,25 +33,8 @@ class HAL:
self.a = app # The parent, stepconf
def write_halfile(self, base):
- input_set =(self.d.pin10,self.d.pin11,self.d.pin12,self.d.pin13,self.d.pin15)
- output_set =(self.d.pin1, self.d.pin2, self.d.pin3, self.d.pin4, self.d.pin5,
- self.d.pin6, self.d.pin7, self.d.pin8, self.d.pin9, self.d.pin14, self.d.pin16,
- self.d.pin17)
- if self.d.number_pports > 1:
- if self.d.pp2_direction:# Input option
- in_list =(2,3,4,5,6,7,8,9,10,11,12,13,15)
- out_list =(1,14,16,17)
- else:
- in_list =(10,11,12,13,15)
- out_list =(1,2,3,4,5,6,7,8,9,14,16,17)
- for pin in (in_list):
- p = 'pp2_pin%d_in' % pin
- input_set +=(self.d[p],)
- for pin in (out_list):
- p = 'pp2_pin%d' % pin
- output_set += (self.d[p],)
- inputs = set(input_set)
- outputs = set(output_set)
+ inputs = self.a.build_input_set()
+ outputs = self.a.build_output_set()
filename = os.path.join(base, self.d.machinename + ".hal")
file = open(filename, "w")
@@ -438,7 +421,7 @@ class HAL:
print >>file, "setp parport.0.pin-%02d-out-reset 1" % num
def min_lim_sig(self, axis):
- inputs = set((self.d.pin10,self.d.pin11,self.d.pin12,self.d.pin13,self.d.pin15))
+ inputs = self.a.build_input_set()
thisaxisminlimits = set((SIG.ALL_LIMIT, SIG.ALL_LIMIT_HOME, "min-" + axis, "min-home-" + axis,
"both-" + axis, "both-home-" + axis))
for i in inputs:
@@ -450,7 +433,7 @@ class HAL:
return i
def max_lim_sig(self, axis):
- inputs = set((self.d.pin10,self.d.pin11,self.d.pin12,self.d.pin13,self.d.pin15))
+ inputs = self.a.build_input_set()
thisaxismaxlimits = set((SIG.ALL_LIMIT, SIG.ALL_LIMIT_HOME, "max-" + axis, "max-home-" + axis,
"both-" + axis, "both-home-" + axis))
for i in inputs:
diff --git a/src/emc/usr_intf/stepconf/build_INI.py b/src/emc/usr_intf/stepconf/build_INI.py
index 906c3556d..c32f6b443 100644
--- a/src/emc/usr_intf/stepconf/build_INI.py
+++ b/src/emc/usr_intf/stepconf/build_INI.py
@@ -192,7 +192,7 @@ class INI:
print >>file, "MIN_LIMIT = %s" % minlim
print >>file, "MAX_LIMIT = %s" % maxlim
- inputs = set((self.d.pin10,self.d.pin11,self.d.pin12,self.d.pin13,self.d.pin15))
+ inputs = self.a.build_input_set()
thisaxishome = set((SIG.ALL_HOME, SIG.ALL_LIMIT_HOME, "home-" + letter, "min-home-" + letter,
"max-home-" + letter, "both-home-" + letter))
# no need to set HOME_IGNORE_LIMITS when ALL_LIMIT_HOME, HAL logic will do the trick
diff --git a/src/emc/usr_intf/stepconf/pages.py b/src/emc/usr_intf/stepconf/pages.py
index 1f831bb6f..71109f520 100755
--- a/src/emc/usr_intf/stepconf/pages.py
+++ b/src/emc/usr_intf/stepconf/pages.py
@@ -342,7 +342,7 @@ class Pages:
self.d.ladderhaltype = 0
if self.w.radiobutton2.get_active() == True:
self.d.laddername = 'estop.clp'
- inputs = set((self.d.pin10,self.d.pin11,self.d.pin12,self.d.pin13,self.d.pin15))
+ inputs = self.a.build_input_set()
if SIG.ESTOP_IN not in inputs:
self.a.warning_dialog(self._p.MESS_NO_ESTOP,True)
return True # don't advance the page
@@ -627,7 +627,7 @@ class Pages:
self.w[axis + "accdistunits"].set_text(_("in"))
self.w[axis + "scaleunits"].set_text(_("Steps / in"))
- inputs = set((self.d.pin10, self.d.pin11, self.d.pin12, self.d.pin13, self.d.pin15))
+ inputs = self.a.build_input_set()
thisaxishome = set((SIG.ALL_HOME, SIG.ALL_LIMIT_HOME, "home-" + axis, "min-home-" + axis,
"max-home-" + axis, "both-home-" + axis))
homes = bool(inputs & thisaxishome)
diff --git a/src/emc/usr_intf/stepconf/stepconf.py b/src/emc/usr_intf/stepconf/stepconf.py
index b2821851a..b7016d4cc 100755
--- a/src/emc/usr_intf/stepconf/stepconf.py
+++ b/src/emc/usr_intf/stepconf/stepconf.py
@@ -1302,6 +1302,32 @@ class StepconfApp:
# Common helper functions
#**********************************
+ def build_input_set(self):
+ input_set =(self.d.pin10,self.d.pin11,self.d.pin12,self.d.pin13,self.d.pin15)
+ if self.d.number_pports > 1:
+ if self.d.pp2_direction:# Input option
+ in_list =(2,3,4,5,6,7,8,9,10,11,12,13,15)
+ else:
+ in_list =(10,11,12,13,15)
+ for pin in (in_list):
+ p = 'pp2_pin%d_in' % pin
+ input_set +=(self.d[p],)
+ return set(input_set)
+
+ def build_output_set(self):
+ output_set =(self.d.pin1, self.d.pin2, self.d.pin3, self.d.pin4, self.d.pin5,
+ self.d.pin6, self.d.pin7, self.d.pin8, self.d.pin9, self.d.pin14, self.d.pin16,
+ self.d.pin17)
+ if self.d.number_pports > 1:
+ if self.d.pp2_direction:# Input option
+ out_list =(1,14,16,17)
+ else:
+ out_list =(1,2,3,4,5,6,7,8,9,14,16,17)
+ for pin in (out_list):
+ p = 'pp2_pin%d' % pin
+ output_set += (self.d[p],)
+ return set(output_set)
+
def find_input(self, input):
inputs = set((10, 11, 12, 13, 15))
for i in inputs:
@@ -1334,17 +1360,7 @@ class StepconfApp:
def home_sig(self, axis):
SIG = self._p
- in_pins =(self.d.pin10,self.d.pin11,self.d.pin12,self.d.pin13,self.d.pin15)
-
- if self.d.number_pports > 1:
- if self.d.pp2_direction:# Input option
- in_list =(2,3,4,5,6,7,8,9,10,11,12,13,15)
- else:
- in_list =(10,11,12,13,15)
- for pin in (in_list):
- p = 'pp2_pin%d_in' % pin
- in_pins +=(self.d[p],)
- inputs = set(in_pins)
+ inputs = self.build_input_set()
thisaxishome = set((SIG.ALL_HOME, SIG.ALL_LIMIT_HOME, "home-" + axis, "min-home-" + axis,
"max-home-" + axis, "both-home-" + axis))
for i in inputs: