Exemple #1
0
def supplyEventByType(component_name, channel_name, ifr_id):
    '''
    Supplies an event to a notification channel by the event's IFR ID type.
    
    Parameters:
        component_name - name of the component publisihing the event
        channel_name - name of the channel the event should be published
        on
        ifr_id - the interface repository ID of the IDL structure that 
        should be dynamically created and sent as an event
        
    Returns: Nothing
    
    Raises: ???
    '''
    from Acssim.Corba.Generator import getRandomValue
    
    #create an instance of the IDL struct
    #get the type code first
    type_code = getTypeCode(ifr_id)
    event_instance = getRandomValue(type_code, 
                                    getComponent(component_name))
                                    
    #now just delegate to another function
    supplyEventByInstance(component_name, channel_name, event_instance)
Exemple #2
0
def testType(idl_type):
    '''
    Helper function completely tests a single IDL type
    '''
    #get the typecode
    tc = getTypeCode(idl_type)

    #get a random instance
    rv = getRandomValue(tc, FAKE_MS)

    print "Created an instance of '", idl_type, "':", type(rv)
def testType(idl_type):
    '''
    Helper function completely tests a single IDL type
    '''
    #get the typecode
    tc = getTypeCode(idl_type)
    
    #get a random instance
    rv = getRandomValue(tc,
                        FAKE_MS)
                        
    print "Created an instance of '", idl_type, "':", type(rv)
Exemple #4
0
def supplyEventByType(component_name, channel_name, ifr_id):
    '''
    Supplies an event to a notification channel by the event's IFR ID type.
    
    Parameters:
        component_name - name of the component publisihing the event
        channel_name - name of the channel the event should be published
        on
        ifr_id - the interface repository ID of the IDL structure that 
        should be dynamically created and sent as an event
        
    Returns: Nothing
    
    Raises: ???
    '''
    from Acssim.Corba.Generator import getRandomValue

    #create an instance of the IDL struct
    #get the type code first
    type_code = getTypeCode(ifr_id)
    event_instance = getRandomValue(type_code, getComponent(component_name))

    #now just delegate to another function
    supplyEventByInstance(component_name, channel_name, event_instance)