# HG changeset patch # User Andrey Skvortsov # Date 1506003558 -10800 # Node ID 5765bea3dbd18458fcd0eadf6db27cc0c5bbc1ac # Parent 1e9a67d68612065c0aee8e3a19fcb28bfb9b3b0e make it possible to update XSD schema in project controller after new target PLC is added or removed. For example: ... import targets targets.targets["PLC"] = {"xsd": os.path.join(self.customBeremizPath, "PLCtarget", xsd), "class": lambda: PLC_target, "code": {"plc_PLC_main.c": os.path.join(self.customBeremizPath, "PLCtarget", "plc_PLC_main.c")} } from ProjectController import ProjectController, GetProjectControllerXSD ProjectController.XSD = GetProjectControllerXSD() diff -r 1e9a67d68612 -r 5765bea3dbd1 ProjectController.py --- a/ProjectController.py Thu Sep 21 16:06:51 2017 +0300 +++ b/ProjectController.py Thu Sep 21 17:19:18 2017 +0300 @@ -177,21 +177,7 @@ return self.ieclib_c_path -class ProjectController(ConfigTreeNode, PLCControler): - """ - This class define Root object of the confnode tree. - It is responsible of : - - Managing project directory - - Building project - - Handling PLCOpenEditor controler and view - - Loading user confnodes and instanciante them as children - - ... - - """ - - # For root object, available Children Types are modules of the confnode packages. - CTNChildrenTypes = ExtractChildrenTypesFromCatalog(features.catalog) - +def GetProjectControllerXSD(): XSD = """ @@ -219,6 +205,23 @@ """ + return XSD + + +class ProjectController(ConfigTreeNode, PLCControler): + """ + This class define Root object of the confnode tree. + It is responsible of : + - Managing project directory + - Building project + - Handling PLCOpenEditor controler and view + - Loading user confnodes and instanciante them as children + - ... + + """ + # For root object, available Children Types are modules of the confnode packages. + CTNChildrenTypes = ExtractChildrenTypesFromCatalog(features.catalog) + XSD = GetProjectControllerXSD() EditorType = ProjectNodeEditor iec2c_cfg = None