plugins/canfestival/canfestival.py
changeset 157 2e6d52c17cab
parent 118 185d0d371ea4
child 159 1c5710e8c941
equal deleted inserted replaced
156:f2b35f4285b8 157:2e6d52c17cab
   126     XSD = """<?xml version="1.0" encoding="ISO-8859-1" ?>
   126     XSD = """<?xml version="1.0" encoding="ISO-8859-1" ?>
   127     <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
   127     <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
   128       <xsd:element name="CanFestivalInstance">
   128       <xsd:element name="CanFestivalInstance">
   129         <xsd:complexType>
   129         <xsd:complexType>
   130           <xsd:attribute name="CAN_Driver" type="xsd:string" use="required"/>
   130           <xsd:attribute name="CAN_Driver" type="xsd:string" use="required"/>
       
   131           <xsd:attribute name="Debug_mode" type="xsd:boolean" use="optional" default="false"/>
   131         </xsd:complexType>
   132         </xsd:complexType>
   132       </xsd:element>
   133       </xsd:element>
   133     </xsd:schema>
   134     </xsd:schema>
   134     """
   135     """
   135     PlugChildsTypes = [("CanOpenNode",_NodeListPlug, "CanOpen node")]
   136     PlugChildsTypes = [("CanOpenNode",_NodeListPlug, "CanOpen node")]
   174                    child.CanFestivalNode.getNodeId())
   175                    child.CanFestivalNode.getNodeId())
   175             format_dict["nodes_open"] += 'NODE_OPEN(%s)\n    '%(nodename)
   176             format_dict["nodes_open"] += 'NODE_OPEN(%s)\n    '%(nodename)
   176             format_dict["nodes_close"] += 'NODE_CLOSE(%s)\n    '%(nodename)
   177             format_dict["nodes_close"] += 'NODE_CLOSE(%s)\n    '%(nodename)
   177             format_dict["nodes_send_sync"] += 'NODE_SEND_SYNC(%s)\n    '%(nodename)
   178             format_dict["nodes_send_sync"] += 'NODE_SEND_SYNC(%s)\n    '%(nodename)
   178             format_dict["nodes_proceed_sync"] += 'NODE_PROCEED_SYNC(%s)\n    '%(nodename)
   179             format_dict["nodes_proceed_sync"] += 'NODE_PROCEED_SYNC(%s)\n    '%(nodename)
       
   180         
       
   181         if wx.Platform == '__WXMSW__':
       
   182             if self.CanFestivalInstance.getDebug_mode() and os.path.isfile(os.path.join("%s"%(format_dict["candriver"] + '_DEBUG.dll'))):
       
   183                     format_dict["candriver"] += '_DEBUG.dll'
       
   184             else:
       
   185                 format_dict["candriver"] += '.dll'
       
   186         
   179         filename = os.path.join(os.path.split(__file__)[0],"cf_runtime.c")
   187         filename = os.path.join(os.path.split(__file__)[0],"cf_runtime.c")
   180         cf_main = open(filename).read() % format_dict
   188         cf_main = open(filename).read() % format_dict
   181         cf_main_path = os.path.join(buildpath, "CF_%(locstr)s.c"%format_dict)
   189         cf_main_path = os.path.join(buildpath, "CF_%(locstr)s.c"%format_dict)
   182         f = open(cf_main_path,'w')
   190         f = open(cf_main_path,'w')
   183         f.write(cf_main)
   191         f.write(cf_main)