# HG changeset patch # User laurent # Date 1327451024 -3600 # Node ID fb03cb6da95c1c15adf1680bf0da7fbdc06fbf27 # Parent 472469f4d5ad75197659735a8e2df9a5c3827e8d Adding support for extracting Common_Ticktime from VARIABLES.csv diff -r 472469f4d5ad -r fb03cb6da95c plugger.py --- a/plugger.py Tue Jan 24 21:39:26 2012 +0100 +++ b/plugger.py Wed Jan 25 01:23:44 2012 +0100 @@ -1287,6 +1287,7 @@ self._ProgramList = None self._VariablesList = None self._IECPathToIdx = {} + self._Ticktime = 0 self.TracedIECPath = [] def GetIECProgramsAndVariables(self): @@ -1341,6 +1342,11 @@ IEC_path=attrs["IEC_path"] Idx=int(attrs["num"]) self._IECPathToIdx[IEC_path]=(Idx, attrs["type"]) + + # third section contains ticktime + if len(ListGroup) > 2: + self._Ticktime = int(ListGroup[2][0]) + except Exception,e: self.logger.write_error(_("Cannot open/parse VARIABLES.csv!\n")) self.logger.write_error(traceback.format_exc()) @@ -1763,6 +1769,9 @@ function(*(cargs + args), **kwargs) # This will block thread if more than one call is waiting + def GetTicktime(self): + return self._Ticktime + def DebugThreadProc(self): """ This thread waid PLC debug data, and dispatch them to subscribers diff -r 472469f4d5ad -r fb03cb6da95c plugins/python/PythonEditor.py --- a/plugins/python/PythonEditor.py Tue Jan 24 21:39:26 2012 +0100 +++ b/plugins/python/PythonEditor.py Wed Jan 25 01:23:44 2012 +0100 @@ -238,7 +238,7 @@ self.SetIcon(wx.BitmapFromImage(img.Rescale(16, 16))) def __del__(self): - self.Controler.OnCloseEditor() + self.Controler.OnCloseEditor(self) def GetTitle(self): fullname = self.Controler.PlugFullName()