# HG changeset patch # User Laurent Bessard # Date 1363883630 -3600 # Node ID 72ee7f3e3cf3083f35c141df759b65cb0ca3a9fe # Parent afc4963d8f0cb36cf316aa9cdbd9d84520831971 Fixed pulling of PLC status and log count diff -r afc4963d8f0c -r 72ee7f3e3cf3 ProjectController.py --- a/ProjectController.py Thu Mar 21 09:27:55 2013 +0900 +++ b/ProjectController.py Thu Mar 21 17:33:50 2013 +0100 @@ -1117,8 +1117,6 @@ self.AppFrame.RefreshStatusToolBar() def PullPLCStatusProc(self, event): - if self._connector is None: - self.StatusTimer.Stop() self.UpdateMethodsFromPLCStatus() def RegisterDebugVarToConnector(self): @@ -1353,7 +1351,13 @@ self._connector = connector if self.AppFrame is not None: self.AppFrame.LogViewer.SetLogSource(connector) - + if connector is not None: + # Start the status Timer + self.StatusTimer.Start(milliseconds=500, oneShot=False) + else: + # Stop the status Timer + self.StatusTimer.Stop() + def _Connect(self): # don't accept re-connetion if already connected if self._connector is not None: @@ -1423,9 +1427,6 @@ #self.logger.write(_("PLC is %s\n")%status) - # Start the status Timer - self.StatusTimer.Start(milliseconds=500, oneShot=False) - if self.previous_plcstate in ["Started","Stopped"]: if self.DebugAvailable() and self.GetIECProgramsAndVariables(): self.logger.write(_("Debugger ready\n")) @@ -1459,7 +1460,6 @@ def _Disconnect(self): self._SetConnector(None) - self.StatusTimer.Stop() wx.CallAfter(self.UpdateMethodsFromPLCStatus) def _Transfer(self):