--- a/POULibrary.py Thu Jun 14 18:25:04 2012 +0200
+++ b/POULibrary.py Thu Jun 14 18:50:28 2012 +0200
@@ -1,8 +1,8 @@
-from PLCControler import PLCControler
from weakref import ref
class POULibrary:
def __init__(self, CTR, LibName, TypeStack):
+ from PLCControler import PLCControler
self.CTR = ref(CTR)
self.LibName = LibName
self.LibraryControler = PLCControler()
--- a/ProjectController.py Thu Jun 14 18:25:04 2012 +0200
+++ b/ProjectController.py Thu Jun 14 18:50:28 2012 +0200
@@ -62,13 +62,13 @@
</xsd:choice>
</xsd:complexType>
</xsd:element>
- <xsd:element name="Libraries" minOccurs="0">
+ <xsd:element name="Libraries" minOccurs="0">"""+(("""
<xsd:complexType>
"""+"\n".join(['<xsd:attribute name='+
'"Enable_'+ libname + '_Library" '+
'type="xsd:boolean" use="optional" default="true"/>'
for libname,lib in features.libraries])+"""
- </xsd:complexType>
+ </xsd:complexType>""") if len(features.libraries)>0 else '<xsd:complexType/>') + """
</xsd:element>
</xsd:sequence>
<xsd:attribute name="URI_location" type="xsd:string" use="optional" default=""/>
@@ -371,6 +371,8 @@
return "\n".join([ lib.GetSTCode() for lib in self.Libraries ])
def GetLibrariesCCode(self, buildpath):
+ if len(self.Libraries)==0:
+ return [],[],()
self.GetIECProgramsAndVariables()
LibIECCflags = '"-I%s"'%os.path.abspath(self.GetIECLibPath())
LocatedCCodeAndFlags=[]