Changeset 2610

Show
Ignore:
Timestamp:
01/24/07 14:34:23 (6 years ago)
Author:
DrewCormier
Message:

replaced getSimpleSequence function so that it can read xml with values tags

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • WaveDev/branches/WaveDev_Max_0.7/WaveDev/wavedev/importResource.py

    r2546 r2610  
    218218    return newProp 
    219219     
    220 def getSimpleSequenceProperty(s):    
     220def getSimpleSequenceProperty(s): 
    221221    if not hasattr(s,"name"): 
    222222        return None 
     
    241241        return None 
    242242     
    243     newProp = CC.SimpleSequenceProperty(tmpName,tmpMode,tmpType,description=tmpDes,values=[]) 
    244      
    245     if hasattr(s,"value"): 
    246         for val in s.value: 
    247             newProp.values.append((str(val), str(val))) 
    248      
     243    newProp = CC.SimpleSequenceProperty(tmpName,tmpMode,tmpType,description=tmpDes) 
     244     
     245    if hasattr(s,"id"):     #UUID in the sad file will need to match the UUID in the prf (tmpID is from prf) 
     246        newProp.id = tmpId 
     247     
     248    newProp.values = [] 
     249    newProp.defaultValues = [] 
     250     
     251    if hasattr(s,"values"):  
     252        for tmpVal in s.values.value:  
     253            newProp.values.append(str(tmpVal)) 
     254            newProp.defaultValues.append(str(tmpVal)) 
     255             
    249256    if hasattr(s,"units"): 
    250257        newProp.units = str(s.units) 
     
    252259    if hasattr(s,"range"): 
    253260        newProp.range = (str(s.range.min),str(s.range.max)) 
     261         
     262    if hasattr(s,"enum"): 
     263        newProp.enum = str(s.enum.label) 
    254264         
    255265    if not hasattr(s, "kind"):