--- a/POULibrary.py Sat May 19 12:41:48 2012 +0200
+++ b/POULibrary.py Sat May 19 15:54:16 2012 +0200
@@ -1,7 +1,9 @@
from PLCControler import PLCControler
+from weakref import ref
class POULibrary:
- def __init__(self, LibName, TypeStack):
+ def __init__(self, CTR, LibName, TypeStack):
+ self.CTR = ref(CTR)
self.LibName = LibName
self.LibraryControler = PLCControler()
self.LibraryControler.OpenXMLFile(self.GetLibraryPath())
@@ -16,6 +18,9 @@
def GetName(self):
return self.LibName
+
+ def GetCTR(self):
+ return self.CTR()
def GetTypes(self):
return {"name" : self.GetName(), "types": self.LibraryControler.Project}
--- a/ProjectController.py Sat May 19 12:41:48 2012 +0200
+++ b/ProjectController.py Sat May 19 15:54:16 2012 +0200
@@ -114,7 +114,7 @@
TypeStack=[]
for libname,clsname in features.libraries:
if self.BeremizRoot.Libraries is None or getattr(self.BeremizRoot.Libraries, "Enable_"+libname+"_Library"):
- Lib = GetClassImporter(clsname)()(libname, TypeStack)
+ Lib = GetClassImporter(clsname)()(self, libname, TypeStack)
TypeStack.append(Lib.GetTypes())
self.Libraries.append(Lib)