plugger.py
changeset 122 7676dba61281
parent 118 185d0d371ea4
child 125 13d45f7e0248
equal deleted inserted replaced
121:ccb1812f8323 122:7676dba61281
    11 
    11 
    12 #Quick hack to be able to find Beremiz IEC tools. Should be config params.
    12 #Quick hack to be able to find Beremiz IEC tools. Should be config params.
    13 base_folder = os.path.split(sys.path[0])[0]
    13 base_folder = os.path.split(sys.path[0])[0]
    14 sys.path.append(os.path.join(base_folder, "plcopeneditor"))
    14 sys.path.append(os.path.join(base_folder, "plcopeneditor"))
    15 
    15 
       
    16 import docclass.docpdf
    16 from xmlclass import GenerateClassesFromXSDstring
    17 from xmlclass import GenerateClassesFromXSDstring
    17 from wxPopen import ProcessLogger
    18 from wxPopen import ProcessLogger
    18 
    19 
    19 _BaseParamsClass = GenerateClassesFromXSDstring("""<?xml version="1.0" encoding="ISO-8859-1" ?>
    20 _BaseParamsClass = GenerateClassesFromXSDstring("""<?xml version="1.0" encoding="ISO-8859-1" ?>
    20         <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    21         <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
   515             
   516             
   516 
   517 
   517     def LoadXMLParams(self, logger, PlugName = None):
   518     def LoadXMLParams(self, logger, PlugName = None):
   518         methode_name = os.path.join(self.PlugPath(PlugName), "methods.py")
   519         methode_name = os.path.join(self.PlugPath(PlugName), "methods.py")
   519         if os.path.isfile(methode_name):
   520         if os.path.isfile(methode_name):
   520             logger.write("Info: %s plugin as some special methods in methods.py\n" % (PlugName or "Root"))
   521             logger.write_error("Welcome to the Beremiz Demo\n\n")            
       
   522             logger.write("This demo provides a PLC working with the CANopen plugin\n")
       
   523             logger.write("""Some external programs are also provided:\n
       
   524             - a CAN TCP server to simulate the CANopen network
       
   525             - a virtual slave node to simulate input block
       
   526             - a virtual slave node to simulate output block
       
   527             """)
       
   528             logger.write("\nInfo: For this demo, %s plugin has some special methods to run external programs.\nThese methods are defined in methods.py\n" % (PlugName or "Root"))
       
   529             docclass.docpdf.open_pdf(os.path.join(base_folder,"beremiz","doc","manual_beremiz.pdf"),pagenum=20)
   521             execfile(methode_name)
   530             execfile(methode_name)
   522 
   531 
   523         # Get the base xml tree
   532         # Get the base xml tree
   524         if self.MandatoryParams:
   533         if self.MandatoryParams:
   525             #try:
   534             #try: