Changeset 9598

Show
Ignore:
Timestamp:
09/29/09 11:50:01 (4 years ago)
Author:
deepanns
Message:

Added wavedash support to ALF;fixed ticket 272

Location:
ossiedev/branches/0.7.x/tools/alf
Files:
1 added
1 modified

Legend:

Unmodified
Added
Removed
  • ossiedev/branches/0.7.x/tools/alf/ALF.py

    r9430 r9598  
    6565[wxID_TOOLBAR_TIMING_TOOL, wxID_TOOLBAR_REFRESH_TOOL, 
    6666wxID_TOOLBAR_TIMING_DISPLAY_TOOL, wxID_TOOLBAR_CONNECT_TOOL, 
    67 wxID_TOOLBAR_NAMINGSERVICE_DIALOG] = [wx.NewId() for x in range(5)] 
     67wxID_TOOLBAR_NAMINGSERVICE_DIALOG, wxID_TOOLBAR_LAUNCH_WAVEDASH] = [wx.NewId() for x in range(6)] 
    6868 
    6969[wxID_NSBOX_POPUP_DISPLAY, wxID_NSBOX_POPUP_START,  
     
    361361        net_bmp = wx.BitmapFromImage(net_img) 
    362362        toolbar.AddSimpleTool(wxID_TOOLBAR_NAMINGSERVICE_DIALOG,net_bmp,shortHelpString="Select Naming Service") 
     363         
     364        toolbar.AddSeparator() 
     365        wavedash_img = wx.Image(root + '/images/launch_wavedash.png', type=wx.BITMAP_TYPE_PNG) 
     366        wavedash_img.Rescale(24,24) 
     367        wavedash_bmp = wx.BitmapFromImage(wavedash_img) 
     368        toolbar.AddSimpleTool(wxID_TOOLBAR_LAUNCH_WAVEDASH, wavedash_bmp, shortHelpString="Launch Wavedash to configure waveforms") 
    363369 
    364370        toolbar.Bind(wx.EVT_TOOL, self.OnToolBarClick) 
     
    402408        elif event.GetId() == wxID_TOOLBAR_NAMINGSERVICE_DIALOG: 
    403409            self.namingservice_dialog = NamingserviceDialog(self) 
     410             
     411        elif event.GetId() == wxID_TOOLBAR_LAUNCH_WAVEDASH: 
     412            print "current working dir is " , os.getcwd() 
     413            if (os.path.exists("/usr/bin/WAVEDASH")): 
     414                os.system("/usr/bin/WAVEDASH") 
     415            else: 
     416                errorMsg(self, "Failed to launch WAVEDASH. Executable(WAVEDASH) not found in /usr/bin/ !!!") 
     417                return 
     418             
    404419 
    405420        # Refresh the display: Naming Service, Waveform List, and Canvas 
     
    834849                os.mkdir(tmp_dir_name)    
    835850            except: 
    836                 errorMsg(self,"Cannot create temporary directory in the waveform directory.  You may need to change the temporary directory to one that you have write permissions to") 
     851                errorMsg(self,"Cannot create temporary directory in the waveform directory.\n" 
     852                              "You may need to change the temporary directory to one that you have write permissions to") 
     853         
     854        #Ticket#272: loop into /sdr/_tmp_alf_waveforms/ directory and see if tmp waveforms exists already 
     855        #with the same name. If found, increment the counter and form a new name for the temp 
     856        #waveform. Repeat this until you find a new name. 
     857        while (os.path.exists(tmp_dir_name + tmp_wave_name) == True ): 
     858            print "InstallCompform(): ", tmp_wave_name + " exists already...Regenerating new name " 
     859            self.compform_counter = self.compform_counter + 1 
     860            tmp_wave_name = "_" + compName + str(self.compform_counter) 
    837861 
    838862        if os.path.exists(tmp_dir_name + tmp_wave_name) == False:    
     
    840864                os.mkdir(tmp_dir_name + tmp_wave_name) 
    841865            except: 
    842                 errorMsg(self,"Cannot create temporary directory in the waveform directory.  You may need to change the temporary directory to one that you have write permissions to") 
     866                errorMsg(self,"Cannot create temporary directory in the waveform directory.\n" 
     867                              "You may need to change the temporary directory to one that you have write permissions to") 
    843868                return 
    844869