@@ -36,7 +36,7 @@ def __init__(self, controller, boards, setup, parent=None):
3636 self .__board_idx = 0
3737 self .ui .arduinoBoard .setCurrentIndex (self .__board_idx )
3838
39- self .update ()
39+ self .update (self . __setup )
4040 self .ui .arduinoBoard .currentIndexChanged .connect (self .index_change )
4141
4242 def closeEvent (self , event ):
@@ -45,22 +45,22 @@ def closeEvent(self, event):
4545 self .on_close_signal .emit (board_setup , connection_cfg )
4646 event .accept ()
4747
48- def update (self ):
48+ def update (self , setup ):
4949 aux_idx = 0
5050 self .ui .digitalPins .clear ()
5151 digital_pin_count = len (self .__boards [self .ui .arduinoBoard .currentIndex ()]["DIGITAL_PINS" ])
5252
5353 # Adds the not configured digital pins
5454 for i in self .__boards [self .ui .arduinoBoard .currentIndex ()]["DIGITAL_PINS" ]:
55- if i not in self . __setup . digital_input_pins and i not in self . __setup . digital_output_pins and i not in self . __setup .pwm_pins :
55+ if i not in setup . digital_input_pins and i not in setup . digital_output_pins and i not in setup .pwm_pins :
5656 self .setup_pin (self .ui .digitalPins , 0 , "Pin " + str (i ), i )
5757 aux_idx += 1
5858
5959 aux_idx = 0
6060 self .ui .analogPins .clear ()
6161 # Adds the not configured digital pins
6262 for i in self .__boards [self .ui .arduinoBoard .currentIndex ()]["ANALOG_PINS" ]:
63- if i not in self . __setup . analog_input_pins and i not in self . __setup .analog_output_pins :
63+ if i not in setup . analog_input_pins and i not in setup .analog_output_pins :
6464 self .setup_pin (self .ui .analogPins , 0 , "Pin A" + str (i - digital_pin_count ), i )
6565 aux_idx += 1
6666
@@ -71,22 +71,22 @@ def update(self):
7171 for i in xrange (self .ui .analogPinList .rowCount (), - 1 , - 1 ):
7272 self .ui .analogPinList .removeRow (i )
7373
74- for pin in self . __setup .digital_input_pins :
74+ for pin in setup .digital_input_pins :
7575 self .insertPin (pin , "Pin " + str (pin ), self .ui .analogPinType .itemText (0 ), self .ui .digitalPinsList )
7676
77- for pin in self . __setup .digital_output_pins :
77+ for pin in setup .digital_output_pins :
7878 self .insertPin (pin , "Pin " + str (pin ), self .ui .analogPinType .itemText (1 ), self .ui .digitalPinsList )
7979
80- for pin in self . __setup .analog_input_pins :
80+ for pin in setup .analog_input_pins :
8181 self .insertPin (pin , "Pin A" + str (pin - digital_pin_count ), self .ui .analogPinType .itemText (0 ), self .ui .analogPinList )
8282
83- for pin in self . __setup .analog_output_pins :
83+ for pin in setup .analog_output_pins :
8484 self .insertPin (pin , "Pin A" + str (pin - digital_pin_count ), self .ui .analogPinType .itemText (1 ), self .ui .analogPinList )
8585
86- for pin in self . __setup .pwm_pins :
86+ for pin in setup .pwm_pins :
8787 self .insertPin (pin , "Pin " + str (pin ), self .ui .digitalPinType .itemText (2 ), self .ui .digitalPinsList )
8888
89- self .ui .analog_resolution_spin .setValue (self . __setup .analog_resolution )
89+ self .ui .analog_resolution_spin .setValue (setup .analog_resolution )
9090
9191 def setup_board (self , index , board_name , image_name ):
9292 _translate = QtCore .QCoreApplication .translate
0 commit comments