--- a/LPCProjectController.py Thu Aug 09 09:38:15 2018 +0200
+++ b/LPCProjectController.py Tue Aug 21 10:02:06 2018 +0200
@@ -208,48 +208,7 @@
self.logger.write(_("Chunks size : %d KiB\n") % chunksSize)
self.logger.write(_("Reboot after update : %s\n") % ("Yes" if reboot else "No"))
- # Get the target PLC URI
- # Check if an uri is already configured in the Beremiz project
- uri = self.BeremizRoot.getURI_location()
- if uri is not None and uri != "":
- self.logger.write(_("PLC URI configured in the Beremiz project will be used: %s\n") % uri)
- # PLC URI is not configured in the Beremiz project
- # Launch Service Discovery dialog
- self.logger.write(_("PLC URI is not configured in the Beremiz project. Launching the Discover dialog\n"))
- dialog = DiscoveryDialog(self.AppFrame)
- answer = dialog.ShowModal()
- # Nothing choosed or cancel button
- if uri is None or answer == wx.ID_CANCEL:
- self.logger.write_error(_("Connection canceled!\n"))
- self.logger.write_error(_("Firmware update canceled!\n"))
- self.firmwareUpadateIsRunning = False
- # Get connector from uri
- self._SetConnector(connectors.ConnectorFactory(uri, self))
- self.logger.write_error(_("Exception while connecting %s!\n") % uri)
- self.logger.write_error(traceback.format_exc())
- self.logger.write_error(_("Firmware update canceled!\n"))
- self.firmwareUpadateIsRunning = False
- # Did connection success ?
- if self._connector is None:
- self.logger.write_error(_("Connection failed to %s!\n") % uri)
- self.logger.write_error(_("Firmware update canceled!\n"))
- self.firmwareUpadateIsRunning = False
- self.logger.write(_("Connected.\n"))
# Last confirmation before firmware update
answer = wx.MessageBox(_('Are you sure to launch the firmware update for the selected PLC?'),
_('Firmware Update'), wx.YES_NO | wx.CENTRE | wx.NO_DEFAULT,
@@ -258,6 +217,14 @@
self.logger.write_error(_("Firmware update canceled!\n"))
self.firmwareUpadateIsRunning = False
+ # do we still have a connection ? + if self._connector is None: + self.logger.write_error(_("Firmware update canceled because connection lost!\n")) + self.firmwareUpadateIsRunning = False