ProjectController.py
changeset 2244 42566291b9bc
parent 2230 295f966e8083
child 2245 fe3394697b02
equal deleted inserted replaced
2243:02f03bd7639e 2244:42566291b9bc
   192             </xsd:element>"""+(("""
   192             </xsd:element>"""+(("""
   193             <xsd:element name="Libraries" minOccurs="0">
   193             <xsd:element name="Libraries" minOccurs="0">
   194               <xsd:complexType>
   194               <xsd:complexType>
   195               """+"\n".join(['<xsd:attribute name=' +
   195               """+"\n".join(['<xsd:attribute name=' +
   196                              '"Enable_' + libname + '_Library" ' +
   196                              '"Enable_' + libname + '_Library" ' +
   197                              'type="xsd:boolean" use="optional" default="false"/>'
   197                              'type="xsd:boolean" use="optional" default="' + 
   198                              for libname, _lib in features.libraries])+"""
   198                                 ('true' if default else 'false') + '"/>'
       
   199                              for libname, _lib, default in features.libraries])+"""
   199               </xsd:complexType>
   200               </xsd:complexType>
   200             </xsd:element>""") if len(features.libraries) > 0 else '') + """
   201             </xsd:element>""") if len(features.libraries) > 0 else '') + """
   201           </xsd:sequence>
   202           </xsd:sequence>
   202           <xsd:attribute name="URI_location" type="xsd:string" use="optional" default=""/>
   203           <xsd:attribute name="URI_location" type="xsd:string" use="optional" default=""/>
   203           <xsd:attribute name="Disable_Extensions" type="xsd:boolean" use="optional" default="false"/>
   204           <xsd:attribute name="Disable_Extensions" type="xsd:boolean" use="optional" default="false"/>
   204         </xsd:complexType>
   205         </xsd:complexType>
   205       </xsd:element>
   206       </xsd:element>
   206     </xsd:schema>
   207     </xsd:schema>
   207     """
   208     """
       
   209     print XSD
   208     return XSD
   210     return XSD
   209 
   211 
   210 
   212 
   211 class ProjectController(ConfigTreeNode, PLCControler):
   213 class ProjectController(ConfigTreeNode, PLCControler):
   212     """
   214     """
   268         self.KillDebugThread()
   270         self.KillDebugThread()
   269 
   271 
   270     def LoadLibraries(self):
   272     def LoadLibraries(self):
   271         self.Libraries = []
   273         self.Libraries = []
   272         TypeStack = []
   274         TypeStack = []
   273         for libname, clsname in features.libraries:
   275         for libname, clsname, default in features.libraries:
   274             if self.BeremizRoot.Libraries is not None and getattr(self.BeremizRoot.Libraries, "Enable_"+libname+"_Library"):
   276             if self.BeremizRoot.Libraries is not None and getattr(self.BeremizRoot.Libraries, "Enable_"+libname+"_Library"):
   275                 Lib = GetClassImporter(clsname)()(self, libname, TypeStack)
   277                 Lib = GetClassImporter(clsname)()(self, libname, TypeStack)
   276                 TypeStack.append(Lib.GetTypes())
   278                 TypeStack.append(Lib.GetTypes())
   277                 self.Libraries.append(Lib)
   279                 self.Libraries.append(Lib)
   278 
   280