Changeset 10501
- Timestamp:
- 11/11/10 09:47:10 (3 years ago)
- Files:
-
- 1 modified
-
ossiedev/trunk/tools/alf/ALF.py (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
ossiedev/trunk/tools/alf/ALF.py
r10469 r10501 59 59 import shlex 60 60 import subprocess 61 import ConfigParser 61 62 from ALFNodeBooterUtils import ALFNodeBooterUtils 63 from ALFNSChoiceDialog import ALFNSChoiceDialog 64 from ALFNodeBooterDialog import ALFNodeBooterDialog 62 65 63 66 import wx.lib.foldpanelbar as fpb … … 68 71 [wxID_TOOLBAR_TIMING_TOOL, wxID_TOOLBAR_REFRESH_TOOL, 69 72 wxID_TOOLBAR_TIMING_DISPLAY_TOOL, wxID_TOOLBAR_CONNECT_TOOL, 70 wxID_TOOLBAR_NAMINGSERVICE_DIALOG, wxID_TOOLBAR_LAUNCH_WAVEDASH] = [wx.NewId() for x in range(6)] 73 wxID_TOOLBAR_NAMINGSERVICE_DIALOG, wxID_TOOLBAR_LAUNCH_WAVEDASH, 74 wxID_TOOLBAR_START_NODEBOOTER] = [wx.NewId() for x in range(7)] 71 75 72 76 [wxID_NSBOX_POPUP_DISPLAY, wxID_NSBOX_POPUP_START, … … 77 81 wxID_INSTALLBOX_POPUP_INSTALL, wxID_COMPONENTSBOX_POPUP_INSTALL] = [wx.NewId() for x in range(4)] 78 82 83 OSSIE_CONFIG_FILE = '.ossie.cfg' 79 84 #---------------------------------------------------------------------- 80 85 class alfApp(wx.App): … … 141 146 142 147 self.Bind(wx.EVT_CLOSE, self.OnClose) 143 148 self.connections = {'127.0.0.1': []} 149 self.namingservice = ['127.0.0.1', ''] 144 150 self.nodeBooterProcess = None 145 nbUtils = ALFNodeBooterUtils() 146 if not nbUtils.namingServiceIsRunning(): 147 nbUtils.startNamingService() 148 if not nbUtils.nodeBooterIsRunning(): 149 self.nodeBooterProcess = nbUtils.startNodeBooter() 151 self.nbUtils = ALFNodeBooterUtils() 152 if not self.nbUtils.namingServiceIsRunning(): 153 anscd = ALFNSChoiceDialog(self) 154 150 155 151 156 def __init__(self,parent): … … 166 171 self.fileMgr = None 167 172 168 self.connections = {'127.0.0.1': []} 169 self.namingservice = ['127.0.0.1', ''] 173 170 174 self.init_CORBA() 171 175 … … 410 414 toolbar.AddSimpleTool(wxID_TOOLBAR_LAUNCH_WAVEDASH, wavedash_bmp, shortHelpString="Launch Wavedash to configure waveforms") 411 415 416 toolbar.AddSeparator() 417 nodeBooter_img = wx.Image(root + '/images/nbstart.png', type = wx.BITMAP_TYPE_PNG) 418 nodeBooter_img.Rescale(24, 24) 419 nodeBooter_bmp = wx.BitmapFromImage(nodeBooter_img) 420 toolbar.AddSimpleTool(wxID_TOOLBAR_START_NODEBOOTER, nodeBooter_bmp, shortHelpString="Start NodeBooter") 412 421 toolbar.Bind(wx.EVT_TOOL, self.OnToolBarClick) 413 422 … … 469 478 self.DisplayAvailableComponents() 470 479 tb.ToggleTool(wxID_TOOLBAR_REFRESH_TOOL, False) 480 481 elif event.GetId() == wxID_TOOLBAR_START_NODEBOOTER: 482 anbd = ALFNodeBooterDialog(self) 483 484 if anbd.GetReturnCode() == 0: 485 self.namingservice[0] = '127.0.0.1' 486 self.init_CORBA() 487 self.refreshDisplay(True) 488 self.DisplayInstalledWaveforms() 489 self.DisplayAvailableWaveforms() 490 self.DisplayAvailableComponents() 471 491 472 492 def processTimingEvent(self, component_name, port_name, function_name, description, time_s, time_us, number_samples): … … 1131 1151 shape.Destroy() 1132 1152 self.diagram.Destroyparent 1153 1154 def setOSSIEProperty(self, sectionName, propertyName, propertyValue): 1155 configFile = os.getenv('HOME') + '/' + OSSIE_CONFIG_FILE 1156 configParser = ConfigParser.SafeConfigParser() 1157 #check to see if a config file already exists 1158 if os.path.exists(configFile): 1159 #if so, read in its properties so they don't get lost 1160 configParser.read(configFile) 1161 if not configParser.has_section(sectionName): 1162 configParser.add_section(sectionName) 1163 configParser.set(sectionName, propertyName, propertyValue) 1164 f = open(configFile, 'w') 1165 configParser.write(f) 1166 f.close() 1167 1168 def getOSSIEProperty(self, sectionName, propertyName): 1169 configFile = os.getenv('HOME') + '/' + OSSIE_CONFIG_FILE 1170 if os.path.exists(configFile): 1171 configParser = ConfigParser.SafeConfigParser() 1172 configParser.read(configFile) 1173 if configParser.has_option(sectionName, propertyName): 1174 return configParser.get(sectionName, propertyName) 1175 return None 1133 1176 #---------------------------------------------------------------------- 1134 1177