From: Chris M. <cv...@cv...> - 2009-03-29 20:05:09
|
Modified file emc2/src/emc/usr_intf/pncconf/pncconf.py Full file: <http://cvs.linuxcnc.org/cvs/emc2/src/emc/usr_intf/pncconf/pncconf.py?rev=1.3> Difference: <http://cvs.linuxcnc.org/cvs/emc2/src/emc/usr_intf/pncconf/pncconf.py.diff?r1=1.2;r2=1.3> Branch: TRUNK Log: revision 1.3 date: 2009/03/29 20:04:20; author: cmorley; state: Exp; lines: +53 -41 make parport signal choices honour home and limit switch checkbox choices. Fix the checking for spindle pha signal. fix the appointment of wrong signals to mesa input pins when home/limit checkboxes surpressed some signal names. --- pncconf.py 2009/03/29 01:44:33 1.2 +++ pncconf.py 2009/03/29 20:04:20 1.3 @@ -220,7 +220,7 @@ self.homenone = False self.homeswitch = False self.homeindex = False - self.homeboth = False + self.homeboth = True self.manualtoolchange = 1 self.customhal = 1 # include custom hal file @@ -1781,8 +1781,20 @@ self.widgets.pp2_checkbutton.set_active(1) if self.data.number_pports>2: self.widgets.pp3_checkbutton.set_active(1) - for i in self.data.servoinputsignames: - print i + if self.data.limitsnone : + self.widgets.limittype_none.set_active(1) + if self.data.limitswitch : + self.widgets.limittype_switch.set_active(1) + if self.data.limitshared : + self.widgets.limittype_shared.set_active(1) + if self.data.homenone : + self.widgets.home_none.set_active(1) + if self.data.homeindex : + self.widgets.home_index.set_active(1) + if self.data.homeswitch : + self.widgets.home_switch.set_active(1) + if self.data.homeboth : + self.widgets.home_both.set_active(1) def on_mesa5i20_checkbutton_toggled(self, *args): i = self.widgets.mesa5i20_checkbutton.get_active() @@ -1984,18 +1996,7 @@ for pin in (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15): foundit = 0 p = 'm5i20c%(con)dpin%(num)d' % {'con':connector ,'num': pin} - selection = self.widgets[p].get_active_text() - for i in human_input_names: - if selection == i : - foundit = 1 - if not foundit: - model = self.widgets[p].get_model() - model.append((selection,)) - g = human_input_names - g.append ((selection)) - hal_input_names.append ((selection)) - self.data.halinputsignames.append ((selection)) - self.data[p] = hal_input_names[self.widgets[p].get_active()] + self.get_input_signals_from_gui(p) p = 'm5i20c%(con)dpin%(num)dinv' % {'con':connector ,'num': pin} self.data[p] = self.widgets[p].get_active() for pin in (16,17,18,19,20,21,22,23): @@ -2048,6 +2049,23 @@ self.widgets.druid1.set_page(self.widgets.xaxismotor) return True + def get_input_signals_from_gui(self,p): + foundit = 0 + selection = self.widgets[p].get_active_text() + for index , i in enumerate(human_input_names): + if selection == i : + foundit = 1 + break + if not foundit: + model = self.widgets[p].get_model() + model.append((selection,)) + g = human_input_names + g.append ((selection)) + hal_input_names.append ((selection)) + self.data.halinputsignames.append ((selection)) + self.data[p] = hal_input_names[index] + + def on_m5i20panel_clicked(self, *args):self.m5i20test(self) def on_firstpport_prepare(self, *args): @@ -2110,7 +2128,14 @@ p = '%spppin%din' % (portname, pin) model = self.widgets[p].get_model() model.clear() - for name in human_input_names: model.append((name,)) + for name in human_input_names: + if self.data.limitshared or self.data.limitsnone: + if name in human_names_limit_only: continue + if self.data.limitswitch or self.data.limitsnone: + if name in human_names_shared_home: continue + if self.data.homenone or self.data.limitshared: + if name in (_("Home X"), _("Home Y"), _("Home Z"), _("Home A"),_("All home")): continue + model.append((name,)) self.widgets[p].set_active(hal_input_names.index(self.data[p])) p = '%spppin%dinvin' % (portname, pin) self.widgets[p].set_active(self.data[p]) @@ -2131,22 +2156,10 @@ def next_parport(self,portname): Modified file emc2/src/emc/usr_intf/pncconf/pncconf.glade Full file: <http://cvs.linuxcnc.org/cvs/emc2/src/emc/usr_intf/pncconf/pncconf.glade?rev=1.2> Difference: <http://cvs.linuxcnc.org/cvs/emc2/src/emc/usr_intf/pncconf/pncconf.glade.diff?r1=1.1;r2=1.2> Branch: TRUNK Log: revision 1.2 date: 2009/03/29 20:04:20; author: cmorley; state: Exp; lines: +6381 -6365 make parport signal choices honour home and limit switch checkbox choices. Fix the checking for spindle pha signal. fix the appointment of wrong signals to mesa input pins when home/limit checkboxes surpressed some signal names. --- pncconf.glade 2009/03/28 19:23:42 1.1 +++ pncconf.glade 2009/03/29 20:04:20 1.2 @@ -42,49 +42,49 @@ <property name="n_rows">6</property> <property name="n_columns">2</property> <child> - <widget class="GtkImage" id="image1"> + <widget class="GtkRadioButton" id="createconfig"> <property name="visible">True</property> - <property name="xpad">12</property> - <property name="ypad">12</property> - <property name="stock">gtk-info</property> + <property name="can_focus">True</property> + <property name="label" translatable="yes">Create a new configuration</property> + <property name="use_underline">True</property> + <property name="response_id">0</property> + <property name="active">True</property> + <property name="draw_indicator">True</property> </widget> <packing> - <property name="top_attach">3</property> - <property name="bottom_attach">4</property> + <property name="right_attach">2</property> + <property name="top_attach">1</property> + <property name="bottom_attach">2</property> <property name="x_options">GTK_FILL</property> - <property name="y_options">GTK_FILL</property> + <property name="y_options"></property> </packing> </child> <child> - <widget class="GtkCheckButton" id="createshortcut"> + <widget class="GtkRadioButton" id="modifyconfig"> <property name="visible">True</property> <property name="can_focus">True</property> - <property name="label" translatable="yes">Create a desktop launcher to start EMC with this configuration.</property> + <property name="label" translatable="yes">Modify a configuration already created with this program</property> <property name="use_underline">True</property> <property name="response_id">0</property> <property name="draw_indicator">True</property> + <property name="group">createconfig</property> </widget> <packing> <property name="right_attach">2</property> - <property name="top_attach">5</property> - <property name="bottom_attach">6</property> + <property name="top_attach">2</property> + <property name="bottom_attach">3</property> <property name="x_options">GTK_FILL</property> <property name="y_options"></property> </packing> </child> <child> - <widget class="GtkCheckButton" id="createsymlink"> + <widget class="GtkLabel" id="label171"> <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="label" translatable="yes">Create a desktop shortcut (symlink) to configuration files.</property> - <property name="use_underline">True</property> - <property name="response_id">0</property> - <property name="draw_indicator">True</property> + <property name="xalign">0</property> + <property name="label" translatable="yes">Do you wish to:</property> </widget> <packing> <property name="right_attach">2</property> - <property name="top_attach">4</property> - <property name="bottom_attach">5</property> <property name="x_options">GTK_FILL</property> <property name="y_options"></property> </packing> @@ -107,51 +107,51 @@ </packing> </child> <child> - <widget class="GtkLabel" id="label171"> + <widget class="GtkCheckButton" id="createsymlink"> <property name="visible">True</property> - <property name="xalign">0</property> - <property name="label" translatable="yes">Do you wish to:</property> + <property name="can_focus">True</property> + <property name="label" translatable="yes">Create a desktop shortcut (symlink) to configuration files.</property> + <property name="use_underline">True</property> + <property name="response_id">0</property> + <property name="draw_indicator">True</property> </widget> <packing> <property name="right_attach">2</property> + <property name="top_attach">4</property> + <property name="bottom_attach">5</property> <property name="x_options">GTK_FILL</property> <property name="y_options"></property> </packing> </child> <child> - <widget class="GtkRadioButton" id="modifyconfig"> + <widget class="GtkCheckButton" id="createshortcut"> |