Skip to content

Commit 15df37e

Browse files
committed
Fix in BoardConfigurationWindow callback
1 parent c3ee23d commit 15df37e

File tree

1 file changed

+10
-13
lines changed

1 file changed

+10
-13
lines changed

MLC/GUI/Experiment/ExperimentWindow.py

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -284,10 +284,10 @@ def on_genealogy_button_clicked(self):
284284

285285
def on_board_config_button_clicked(self):
286286
logger.debug('[EXPERIMENT {0}] [BOARD_CONFIG_BUTTON] - Executing on_board_config_button_clicked function')
287-
#FIXME Connection config name should not be related with "serial"
287+
# FIXME Connection config name should not be related with "serial"
288288
valid_connection = False
289-
board_config_window = ArduinoBoardManager(protocol_config=self._board_config, serial_config=self._serial_conn,
290-
close_handler=self.on_board_config_button_clicked, parent_win=self)
289+
board_config_window = ArduinoBoardManager(protocol_config=self._board_config, serial_config=self._serial_conn,
290+
close_handler=self._store_board_configuration, parent_win=self)
291291
board_config_window.start()
292292

293293
def _config_table_edited(self, left, right):
@@ -573,22 +573,19 @@ def _store_board_configuration(self, board_config, serial_conn):
573573

574574
# Init the arduino singleton
575575
try:
576-
#self._board_config = self._board_config._replace(connection = SerialConnection(**self._serial_conn._asdict()))
577576
ArduinoInterfaceSingleton.get_instance(protocol_setup=self._board_config,
578577
conn_setup=self._serial_conn)
579578
except Exception, err:
580579
logger.debug('[EXPERIMENT {0}] [BOARD_CONFIG] - '
581580
'Serial port could not be initialized. Error Msg: {1}'
582581
.format(self._experiment_name, err))
583582
selection = QMessageBox.critical(self, "Connection failure",
584-
"The current connection setup failed during initialization. Do you want to change this configuration? \
585-
(Choosing \"no\" means that the board will not be usable in the experiment)"
586-
.format(preev_path),
587-
QMessageBox.Yes | No, QMessageBox.Yes)
583+
"The current connection setup failed during initialization. "
584+
"Do you want to change this configuration?. "
585+
"Choosing \"no\" means that the board will not be usable in the experiment)",
586+
QMessageBox.Yes | QMessageBox.No,
587+
QMessageBox.Yes)
588588
if selection == QMessageBox.Yes:
589-
#self.on_board_config_button_clicked()
590-
print "FUCK"
589+
self.on_board_config_button_clicked()
591590
else:
592-
#FIXME: If the pin setups aren't empty then the protocol init will fail
593-
self._board_config = self._board_config._replace(connection = BaseConnection())
594-
591+
self._board_config = self._board_config._replace(connection=BaseConnection())

0 commit comments

Comments
 (0)