Esempio n. 1
0
def setup(s, variables):
    
        def add_var(desc, unit, var_type, var_name, func = None, send = False):
            simobj = s.definition_0.add(desc, unit, var_type, variables.byName(var_name).data, func)
            #If send_func eithers holds func or is true, then variable will be writeable.
            
            if (type(send) == FunctionType):
                simobj.set_send_func(send)
            if send == False: 
                #Variable is not writable in FSX disable it in Glass Server
                variables.byName(var_name).writeable = False #For FSX set writeable to False
            
       
        s.definition_0 = s.create_DataDefinition(2)
        #Data definition ID 2, is the high priority data, that needs to have no delay.
        #s.definition_1 = s.create_DataDefinition(3)
        
        
        #Airspeed
        airspeed.setup(add_var)
        #Altitude
        altitude.setup(add_var)
        #Radios
        radios.setup(add_var)
        #Position
        position.setup(add_var)
        #HEading
        heading.setup(add_var)
Esempio n. 2
0
def setup(comm, variables):
    
        def add_var(desc, var_type, var_name, func = None, send = False, priority = "L"):
            v = variables.byName(var_name)
            if v!=None:
            
                if priority=="H":
                    comm.HP_outdata.add(desc, var_type, v, func)
                else:
                    comm.LP_outdata.add(desc, var_type, v, func)
                #If send_func eithers holds func or is true, then variable will be writeable.
                #Assume for Xplane variable is not writable for now
                
                #if (type(send) == FunctionType):
                #    v.set_send_func(send)
                if send == False: 
                    v.writeable = False #For FSX set writeable to False
            
       
        #s.definition_0 = s.create_DataDefinition(2)
        #Data definition ID 2, is the high priority data, that needs to have no delay.
        #s.definition_1 = s.create_DataDefinition(3)
        
        
        #Airspeed
        #airspeed.setup(add_var)
        #Altitude
        #altitude.setup(add_var)
        #Radios
        #radios.setup(add_var)
        #Position
        position.setup(add_var)