Changeset 4204

Show
Ignore:
Timestamp:
06/19/07 23:22:24 (6 years ago)
Author:
cdietric
Message:

Now reads and displays component description from SPD file (Component Editor and OWD via right click on available component. Optional display of component Doxygen manual (pdf or html) is next

Location:
WaveDev/trunk/WaveDev/wavedev
Files:
4 modified

Legend:

Unmodified
Added
Removed
  • WaveDev/trunk/WaveDev/wavedev/ComponentClass.py

    r3348 r4204  
    2424# Component Class 
    2525class Component: 
    26   def __init__(self, name="",AC=False,type="resource",generate=True): 
     26  def __init__(self, name="",AC=False,type="resource",description="",generate=True): 
    2727    self.name = name        # this refers to the instance name 
    2828    self.baseName = name    # this refers to the component that the instance is based on 
     
    4141    self.xmlName = name     #if imported from component library - this may change 
    4242    self.properties = [] 
     43    self.description = description 
    4344   
    4445  def __getitem__(self,i): 
  • WaveDev/trunk/WaveDev/wavedev/ComponentFrame.py

    r4143 r4204  
    380380 
    381381            self.compDescrBox.Clear() 
    382             # write description from spd file here: self.compDescrBox.WriteText(self.active_comp.description) 
     382            self.compDescrBox.WriteText(self.active_comp.description) 
    383383             
    384384            if self.active_comp.type != 'resource': 
  • WaveDev/trunk/WaveDev/wavedev/MainFrame.py

    r4148 r4204  
    271271        self.Bind(wx.EVT_MENU, self.OnResourceBoxPopupAddMenu, 
    272272              id=wxID_FRAME1RESOURCEBOXPOPUPADD) 
    273         self.Bind(wx.EVT_MENU, self.OnResourceBoxPopupAddMenu, 
     273        self.Bind(wx.EVT_MENU, self.OnResourceBoxPopupGetDescr, 
    274274              id=wxID_FRAME1RESOURCEBOXPOPUPGETDESCR) 
    275         self.Bind(wx.EVT_MENU, self.OnResourceBoxPopupAddMenu, 
     275        self.Bind(wx.EVT_MENU, self.OnResourceBoxPopupGetDoxygenRefMan, 
    276276              id=wxID_FRAME1RESOURCEBOXPOPUPGETDOXYGENREFMAN) 
    277277        self.Bind(wx.EVT_MENU, self.OnResourceBoxPopupAdddevMenu, 
     
    467467        self.savePlatformPath = None 
    468468        self.saveProjectPath = None 
    469          
     469        self.description = None 
    470470         
    471471################################################################################ 
     
    15651565                x = self.resourceBoxPopup.FindItemById(wxID_FRAME1RESOURCEBOXPOPUPADDNODE) 
    15661566                x.Enable(False)            
    1567                 x = self.resourceBoxPopup.FindItemById(wxID_FRAME1RESOURCEBOXPOPUPGETDESCR) 
    1568                 x.Enable(False) 
    1569                 x = self.resourceBoxPopup.FindItemById(wxID_FRAME1RESOURCEBOXPOPUPGETDOXYGENREFMAN) 
    1570                 x.Enable(False) 
     1567                #x = self.resourceBoxPopup.FindItemById(wxID_FRAME1RESOURCEBOXPOPUPGETDESCR) 
     1568                #x.Enable(False) 
     1569                #x = self.resourceBoxPopup.FindItemById(wxID_FRAME1RESOURCEBOXPOPUPGETDOXYGENREFMAN) 
     1570                #x.Enable(False) 
    15711571            elif tmpRes.type == 'node': 
    15721572                x = self.resourceBoxPopup.FindItemById(wxID_FRAME1RESOURCEBOXPOPUPADDDEV) 
     
    16601660        self.resourceBox.Unselect() 
    16611661        event.Skip() 
     1662 
     1663    def OnResourceBoxPopupGetDescr(self, event): 
     1664        sn = self.resourceBox.GetSelection() 
     1665        tmpRes =  self.resourceBox.GetPyData(sn) 
     1666        self.compDescrBox.Clear() 
     1667        self.compDescrBox.WriteText(tmpRes.name + ":  " + tmpRes.description) 
     1668 
     1669    def OnResourceBoxPopupGetDoxygenRefMan(self, event): 
     1670        errorMsg(self,"Doxygen Ref Man not implemented yet") 
    16621671 
    16631672    def OnResourceBoxPopupAddnodeMenu(self, event): 
  • WaveDev/trunk/WaveDev/wavedev/importResource.py

    r3036 r4204  
    4848        return None 
    4949     
     50    doc_spd = amara.parse(stripDoctype(spdPath)) 
     51    if not hasattr(doc_spd.softpkg.implementation, 'description'): 
     52        #errorMsg(parent,"No description found in " + spdPath) 
     53        Rdescription='Description unavailable' 
     54    else: 
     55        Rdescription=str(doc_spd.softpkg.implementation.description) 
     56        #errorMsg(parent,Rdescription) 
     57     
    5058    #Instantiate a new component of the appropriate type 
    5159    if doc_scd.softwarecomponent.componenttype == u'resource': 
    52         newComp = CC.Component(name=Rname,type='resource') 
     60        newComp = CC.Component(name=Rname,type='resource',description=Rdescription) 
    5361    elif doc_scd.softwarecomponent.componenttype == u'executabledevice': 
    54         newComp = CC.Component(name=Rname,type='executabledevice') 
     62        newComp = CC.Component(name=Rname,type='executabledevice',description=Rdescription) 
    5563    elif doc_scd.softwarecomponent.componenttype == u'loadabledevice': 
    56         newComp = CC.Component(name=Rname,type='loadabledevice') 
     64        newComp = CC.Component(name=Rname,type='loadabledevice',description=Rdescription) 
    5765    elif doc_scd.softwarecomponent.componenttype == u'device': 
    58         newComp = CC.Component(name=Rname,type='device') 
     66        newComp = CC.Component(name=Rname,type='device',description=Rdescription) 
    5967    else: 
    6068        errorMsg(parent,"Can't identify resource type for: " + Rname)