Changeset 4496

Show
Ignore:
Timestamp:
07/20/07 14:40:47 (6 years ago)
Author:
DrewCormier
Message:

no longer need to compare members to the naming contexts since the application instance name can be retreived through the application sequence

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • experimental/ALF/trunk/alf/ALF.py

    r4495 r4496  
    379379        nsRoot = self.nsBox.AddRoot("ns_root") 
    380380         
    381         if self.domMgr == None or self.rootContext == None: 
    382             return 
    383  
    384         dom_obj = self.rootContext.resolve([CosNaming.NameComponent("DomainName1","")]) 
    385         dom_context = dom_obj._narrow(CosNaming.NamingContext)  
    386         if dom_context is None: 
    387             return 
    388  
    389381        appSeq =  self.domMgr._get_applications() 
    390382 
    391   
    392         # for framework <= r2983 
    393         ''' 
    394         members = dom_context.list(1000)  
    395         for m in members[0]: 
    396             wav_name = str(m.binding_name[0].id) 
    397             wav_obj = dom_context.resolve([CosNaming.NameComponent(wav_name,"")]) 
    398             wav_context = wav_obj._narrow(CosNaming.NamingContext) 
    399             if wav_context is None: 
    400                 continue 
    401  
    402             contextApp = None 
    403             foundApp = False 
    404  
    405             # cycle through all the installed applications 
    406             for app in appSeq: 
    407                 # get all of the available component instances in the application 
    408                 compNameCon = app._get_componentNamingContexts() 
    409  
    410                 # attempt to match the installed waveforms to one of the 
    411                 # available waveform names  
    412                 for compElementType in  compNameCon: 
    413                     if wav_name in compElementType.elementId: 
    414                         waveformApp = app 
    415                         foundApp = True 
    416                         #print compElementType.componentId + " " + compElementType.elementId 
    417                         break 
    418  
    419             if not foundApp: 
    420                print "Could not find associated application for: " + wav_name 
    421                continue 
    422  
    423             t1 = self.nsBox.AppendItem(nsRoot,wav_name) 
    424             self.nsBox.SetPyData(t1,waveformApp) 
    425              
    426             # Set item bold if it is the active waveform 
    427             if self.active_wave is not None: 
    428                 if self.active_wave.naming_context == wav_name: 
    429                     self.nsBox.SetItemBold(t1, True) 
    430         '''   
    431  
    432         # for framework > r2983 
    433         wave_count = 0 
    434383        for app in appSeq: 
    435384            wav_name = app._get_name() 
    436             # TODO: set up counter for the waveform name or get the counter  
    437             # from the framework 
    438385            t1 = self.nsBox.AppendItem(nsRoot,wav_name) 
    439386            self.nsBox.SetPyData(t1,app)  
     
    551498        self.domMgr.installApplication(name_SAD) 
    552499 
     500        # applicationFactories will have been set up from the  
     501        # installApplication() call 
    553502        _applicationFactories = self.domMgr._get_applicationFactories() 
    554503 
     
    556505        # cycle through the applicationFactories 
    557506        # find out which one matches my application name 
     507        # name of application factory 
    558508        for app_num in range(len(_applicationFactories)): 
    559509            if _applicationFactories[app_num]._get_name()==app_name: 
     
    567517            sys.exit(-1) 
    568518 
    569         # create an application with the application factory that matches my  
     519        # create an application with the application factory that matches my     
    570520        # application name 
    571521        try: 
    572522            app = _applicationFactories[app_factory_num].create( 
    573                                        'tmp_wave_name',_appFacProps,_devSeq) 
     523                                             app_name,_appFacProps,_devSeq) 
    574524        except: 
    575525            print "Unable to create application - make sure that all appropriate nodes are installed"