add debug mode for CanFestival dll under windows
authorgreg
Mon, 26 May 2008 15:00:10 +0200
changeset 157 2e6d52c17cab
parent 156 f2b35f4285b8
child 158 771578d7580e
add debug mode for CanFestival dll under windows
plugins/canfestival/canfestival.py
--- a/plugins/canfestival/canfestival.py	Sat May 24 15:56:43 2008 +0200
+++ b/plugins/canfestival/canfestival.py	Mon May 26 15:00:10 2008 +0200
@@ -128,6 +128,7 @@
       <xsd:element name="CanFestivalInstance">
         <xsd:complexType>
           <xsd:attribute name="CAN_Driver" type="xsd:string" use="required"/>
+          <xsd:attribute name="Debug_mode" type="xsd:boolean" use="optional" default="false"/>
         </xsd:complexType>
       </xsd:element>
     </xsd:schema>
@@ -176,6 +177,13 @@
             format_dict["nodes_close"] += 'NODE_CLOSE(%s)\n    '%(nodename)
             format_dict["nodes_send_sync"] += 'NODE_SEND_SYNC(%s)\n    '%(nodename)
             format_dict["nodes_proceed_sync"] += 'NODE_PROCEED_SYNC(%s)\n    '%(nodename)
+        
+        if wx.Platform == '__WXMSW__':
+            if self.CanFestivalInstance.getDebug_mode() and os.path.isfile(os.path.join("%s"%(format_dict["candriver"] + '_DEBUG.dll'))):
+                    format_dict["candriver"] += '_DEBUG.dll'
+            else:
+                format_dict["candriver"] += '.dll'
+        
         filename = os.path.join(os.path.split(__file__)[0],"cf_runtime.c")
         cf_main = open(filename).read() % format_dict
         cf_main_path = os.path.join(buildpath, "CF_%(locstr)s.c"%format_dict)