Index: /ossiedev/branches/jsnyder/trunk/tools/WaveDev/wavedev/ComponentClass.py
===================================================================
--- /ossiedev/branches/jsnyder/trunk/tools/WaveDev/wavedev/ComponentClass.py	(revision 8112)
+++ /ossiedev/branches/jsnyder/trunk/tools/WaveDev/wavedev/ComponentClass.py	(revision 11083)
@@ -21,62 +21,71 @@
 # Component Class
 class Component:
-  def __init__(self, name="",AC=False,type="resource",description="",generate=True):
-    self.name = name        # this refers to the instance name
-    self.baseName = name    # this refers to the component that the instance is based on
-    self.connections = []
-    self.ports = []
-    self.mutable_params = []
-    self.device = None
-    self.node = None
-    self.uuid = uuidgen.uuidgen()
-    self.file_uuid = uuidgen.uuidgen()
-    self.ace = False
-    self.timing = False
-    self.AssemblyController = AC
-    self.type = type
-    self.generate = generate
-    self.xmlName = name     #if imported from component library - this may change
-    self.properties = []
-    self.description = description
+    def __init__(self, name="",AC=False,type="resource",description="",generate=True):
+        self.name = name        # this refers to the instance name
+        self.baseName = name    # this refers to the component that the instance is based on
+        self.connections = []
+        self.ports = []
+        self.mutable_params = []
+        self.device = None
+        self.node = None
+        self.uuid = uuidgen.uuidgen()
+        self.file_uuid = uuidgen.uuidgen()
+        self.ace = False
+        self.timing = False
+        self.AssemblyController = AC
+        self.type = type
+        self.generate = generate
+        self.xmlName = name     #if imported from component library - this may change
+        self.properties = []
+        self.description = description
+        self.implementations = []
 
-  def __getitem__(self,i):
-      return self.connections[i]
+    def __getitem__(self,i):
+        return self.connections[i]
 
-  def setUUID(self):
-      self.uuid = uuidgen.uuidgen()
+    def setUUID(self):
+        self.uuid = uuidgen.uuidgen()
 
-  def changeName(self,newname):
-      self.name = newname
-      if self.generate == True:
-          self.baseName = newname
-          self.xmlName = newname
+    def changeName(self,newname):
+        self.name = newname
+        if self.generate == True:
+            self.baseName = newname
+            self.xmlName = newname
+            
+    def getImplementation(self, processorName):
+        for implementation in self.implementations:
+            if implementation.name == processorName:
+                return implementation
+        return None
+          
+
 
 class Node:
-  def __init__(self, name="", path="", description="", generate=True):
-    self.name = name
-    self.path = path
-    self.Devices = []
-    self.type = "node"
-    self.generate = generate
-    self.description = description
-    self.id = ""
+    def __init__(self, name="", path="", description="", generate=True):
+        self.name = name
+        self.path = path
+        self.Devices = []
+        self.type = "node"
+        self.generate = generate
+        self.description = description
+        self.id = ""
 
-  def addDevice(self, in_dev=None):
-    if in_dev != None:
-      self.Devices.append(in_comp)
+    def addDevice(self, in_dev=None):
+        if in_dev != None:
+            self.Devices.append(in_dev)
 
 
 class Port:
-  def __init__(self, name, interface, type="Uses",portType="data"):#,dataType="ShortSequence",interface_ns="standardInterfaces"):
-    self.name = name
-    self.interface = interface
-    self.portType = portType    #control or data
-    self.type = type            #Uses or Provides
-    self.u_cname = "dataOut_" + interface.name + "_i"
-    self.p_cname = "dataIn_" + interface.name + "_i"
-    if type == "Uses":
-        self.cname = self.u_cname
-    if type == "Provides":
-        self.cname = self.p_cname
+    def __init__(self, name, interface, type="Uses",portType="data"):#,dataType="ShortSequence",interface_ns="standardInterfaces"):
+        self.name = name
+        self.interface = interface
+        self.portType = portType    #control or data
+        self.type = type            #Uses or Provides
+        self.u_cname = "dataOut_" + interface.name + "_i"
+        self.p_cname = "dataIn_" + interface.name + "_i"
+        if type == "Uses":
+            self.cname = self.u_cname
+        if type == "Provides":
+            self.cname = self.p_cname
 
 class Connection:
@@ -159,4 +168,14 @@
         self.kind = kind
         self.action = action
+        
+class Implementation:
+    def __init__(self, id, description='', propertyFile='', processor=''):
+        self.id = id
+        self.description = description
+        self.propertyFile = propertyFile
+        self.processor = processor
+        self.properties = []
+        
+   
 
 
Index: /ossiedev/branches/jsnyder/trunk/tools/WaveDev/wavedev/importNode.py
===================================================================
--- /ossiedev/branches/jsnyder/trunk/tools/WaveDev/wavedev/importNode.py	(revision 10753)
+++ /ossiedev/branches/jsnyder/trunk/tools/WaveDev/wavedev/importNode.py	(revision 11083)
@@ -152,5 +152,5 @@
         newComp.xmlName =  os.path.splitext(os.path.splitext(os.path.basename(pathSCD))[0])[0]
 
-        newNode.Devices.append(newComp)
+        
 
         #
@@ -182,4 +182,31 @@
         #            continue
         #        newComp.properties.append(p)
+        #
+        # Import the properties from the PRF file
+        #
+        
+        # If there are no properties, just return the component as is
+        tmp = doc_spd.getElementsByTagName("propertyfile")
+        if len(tmp) > 0:
+            propertyFileNode = tmp[0]
+            propertyFile = '/sdr/dev' + propertyFileNode.getElementsByTagName("localfile")[0].getAttribute("name")
+            propertyDoc = xml.dom.minidom.parse(propertyFile)
+            simplePropNodes = propertyDoc.getElementsByTagName("simple")
+            simpleProps = getSimpleProperties(simplePropNodes, propertyFile)
+            
+            for prop in simpleProps:
+                newComp.properties.append(prop)
+            
+            simpleSequencePropNodes = propertyDoc.getElementsByTagName("simplesequence")
+            simpleSequenceProps = getSimpleSequenceProperties(simpleSequencePropNodes, propertyFile)
+            
+            for prop in simpleSequenceProps:
+                newComp.properties.append(prop)
+        else:
+            propertyFile = None
+    
+       
+        
+        newNode.Devices.append(newComp)
 
     return newNode
@@ -233,2 +260,147 @@
     return xml
 
+def getSimpleProperties(simplePropertyNodeList, propertyFile):
+    props = []
+    for node in simplePropertyNodeList:
+        p = getSimpleProperty(node)
+        if p == None:
+            print "There was an error parsing simple properties in the PRF file " + propertyFile
+            continue
+        props.append(p)
+        
+    return props
+
+def getSimpleSequenceProperties(simpleSequencePropertyNodeList, propertyFile):
+    props = []
+    for node in simpleSequencePropertyNodeList:
+        p = getSimpleSequenceProperty(node, propertyFile)
+        if p == None:
+            print "There was an error parsing simple sequence properties in the PRF file " + propertyFile
+            continue
+        props.append(p)
+        
+    return props
+
+def getSimpleProperty(n):
+    tmpName = n.getAttribute("name")
+    tmpID   = n.getAttribute("id")
+    tmpType = n.getAttribute("type")
+    tmpMode = n.getAttribute("mode")
+    tmpDes = n.getAttribute("description")
+
+    if tmpName == "" or tmpID == "" or tmpType == "" or tmpMode == "":
+        return None
+    if tmpMode not in availableModes:
+        return None
+    if tmpType not in availableTypes:
+        return None
+    
+    newProp = CC.SimpleProperty(tmpName,tmpMode,tmpType,description=tmpDes)
+   
+    # Set ID
+    #UUID in the sad file will need to match the UUID in the prf (tmpID is from prf)
+    newProp.id = tmpID
+
+    # Get/set property value
+    valueNodeList = n.getElementsByTagName("value")
+    value = valueNodeList[0].childNodes[0].data
+    newProp.value = newProp.defaultValue = str(value)
+    del valueNodeList, value
+    
+    # Get/set property units
+    unitsNodeList = n.getElementsByTagName("units")
+    if len(unitsNodeList) > 0:
+        units = unitsNodeList[0].childNodes[0].data
+        newProp.units = str(s.units)
+    #del unitsNodeList, units
+    
+    # TODO: Get/set min/max values
+    # TODO: Get/set enum
+    
+    # Get/set kind
+    kindNodeList = n.getElementsByTagName("kind")
+    kindtype = kindNodeList[0].getAttribute("kindtype")
+    if kindtype == "":
+        return None
+    newProp.kind = str(kindtype)
+    del kindNodeList, kindtype
+    
+    # Get/set action
+    actionNodeList = n.getElementsByTagName("action")
+    if len(actionNodeList) > 0:
+        actiontype = actionNodeList[0].getAttribute("type")
+        newProp.action = str(actiontype)
+    #del actionNodeList, actiontype
+        
+    return newProp
+    
+def getSimpleSequenceProperty(n, prfPath):
+    tmpName = n.getAttribute("name")
+    tmpID   = n.getAttribute("id")
+    tmpType = n.getAttribute("type")
+    tmpMode = n.getAttribute("mode")
+    tmpDes = n.getAttribute("description")
+
+    if tmpName == "" or tmpID == "" or tmpType == "" or tmpMode == "":
+        return None
+    if tmpMode not in availableModes:
+        return None
+    if tmpType not in availableTypes:
+        return None
+    
+    newProp = CC.SimpleSequenceProperty(tmpName,tmpMode,tmpType,description=tmpDes)
+   
+    # Set ID
+    #UUID in the sad file will need to match the UUID in the prf (tmpID is from prf)
+    newProp.id = tmpID
+
+
+    # Get/set property values
+    newProp.values = []
+    newProp.defaultValues = []
+    valuesNodeList = n.getElementsByTagName("values")
+    
+    try:
+        valueNodeList = valuesNodeList[0].getElementsByTagName("value")
+    except:
+        valueNodeList = n.getElementsByTagName("value") #cbd
+        #print "\nERROR in " + prfPath
+        #print "ERROR parsing prf file.  You may be missing a values tag in a simple sequence property.\n"
+        #sys.exit()
+        print "\nWarning in " + prfPath
+        print "Warning parsing prf file.  You may be missing a values tag in a simple sequence property.\n"
+
+    for valueNode in valueNodeList:
+        tmpVal = valueNode.childNodes[0].data
+        newProp.values.append(str(tmpVal))
+        newProp.defaultValues.append(str(tmpVal))
+    del valueNodeList
+
+    # Get/set property units
+    unitsNodeList = n.getElementsByTagName("units")
+    if len(unitsNodeList) > 0:
+        units = unitsNodeList[0].childNodes[0].data
+        newProp.units = str(s.units)
+    #del unitsNodeList, units
+    
+    # TODO: Get/set min/max values
+    # TODO: Get/set enum
+    
+    # Get/set kind
+    kindNodeList = n.getElementsByTagName("kind")
+    kindtype = kindNodeList[0].getAttribute("kindtype")
+    if kindtype == "":
+        return None
+    newProp.kind = str(kindtype)
+    del kindNodeList, kindtype
+
+    # Get/set action
+    actionNodeList = n.getElementsByTagName("action")
+    if len(actionNodeList) > 0:
+        actiontype = actionNodeList[0].getAttribute("type")
+        newProp.action = str(actiontype)
+    #del actionNodeList, actiontype
+
+    return newProp
+
+
Index: /ossiedev/branches/jsnyder/trunk/tools/WaveDev/wavedev/importResource.py
===================================================================
--- /ossiedev/branches/jsnyder/trunk/tools/WaveDev/wavedev/importResource.py	(revision 10825)
+++ /ossiedev/branches/jsnyder/trunk/tools/WaveDev/wavedev/importResource.py	(revision 11083)
@@ -30,5 +30,5 @@
 
 def getResource(path,Rname,parent):
-    scdPath = findFile(path,Rname,".scd.xml")                
+    scdPath = findFile(path,Rname,".scd.xml") 
     if scdPath == None:         
         errorMsg(parent,"No scd file found for: " + Rname)
@@ -165,6 +165,8 @@
     simpleSequenceProps = []
     implementationNodes = doc_spd.getElementsByTagName("implementation")
-
     for node in implementationNodes:
+        simpleProps = []
+        simpleSequenceProps = []
+        propertyFile = ''
         id = node.getAttribute("id")
         tmp = node.getElementsByTagName("description")
@@ -200,5 +202,13 @@
         
         newComp.implementations.append(newImplementation)
-    
+#    print newComp.name + ' summary:'
+#    print 'Main properties: '
+#    for prop in newComp.properties:
+#        print '    ' + prop.name
+#    print 'Implementations:'
+#    for imp in newComp.implementations:
+#        print imp.processor
+#        for prop in imp.properties:
+#            print '    ' + prop.name
     return newComp
 
@@ -265,5 +275,5 @@
         p = getSimpleSequenceProperty(node, propertyFile)
         if p == None:
-            print "There was an error parsing simple sequence properties in the PRF file " + propetyFile
+            print "There was an error parsing simple sequence properties in the PRF file " + propertyFile
             continue
         props.append(p)
