add GetParamsAttributes to canfestival.py to allow dll list in beremiz
authorgreg
Fri, 01 Feb 2008 09:17:50 +0100
changeset 95 646a44a12e2a
parent 94 c7fac98c9351
child 96 0c06f7874a3f
add GetParamsAttributes to canfestival.py to allow dll list in beremiz
plugins/canfestival/canfestival.py
--- a/plugins/canfestival/canfestival.py	Thu Jan 31 16:42:50 2008 +0100
+++ b/plugins/canfestival/canfestival.py	Fri Feb 01 09:17:50 2008 +0100
@@ -9,6 +9,7 @@
 from networkedit import networkedit
 from objdictedit import objdictedit
 import canfestival_config
+from plugger import PlugTemplate
 
 from gnosis.xml.pickle import *
 from gnosis.xml.pickle.util import setParanoia
@@ -131,9 +132,19 @@
       </xsd:element>
     </xsd:schema>
     """
+    PlugChildsTypes = [("CanOpenNode",_NodeListPlug)]
+    def GetParamsAttributes(self, path = None):
+        infos = PlugTemplate.GetParamsAttributes(self, path = None)
+        for element in infos:
+            if element["name"] == "CanFestivalInstance":                         
+                for child in element["children"]:
+                    if child["name"] == "CAN_Driver":
+                        DLL_LIST= getattr(canfestival_config,"DLL_LIST",None)
+                        if DLL_LIST is not None:
+                            child["type"] = DLL_LIST
+                        return infos    
+        return infos
 
-    PlugChildsTypes = [("CanOpenNode",_NodeListPlug)]
-    
     def PlugGenerate_C(self, buildpath, locations, logger):
         
         format_dict = {"locstr" : "_".join(map(str,self.GetCurrentLocation())),