Ejemplo n.º 1
0
 def __init__(self, app_lifetime):
     ''' Constructor
     
         Input: app_lifetime    number    lifetime of the simpy.environment            
         Output: -        
     '''
     self.id = "Environment " + str(AutomotiveEnvironmentSpec.CNT)
     AutomotiveEnvironmentSpec.CNT += 1
     
     self.result_reader = None
     self.autoset_gateway_filters = []
     self.ecu_ids = []
     self.ecu_groups = []
     self.bus_ids = []
     self.gui_lock_sync = threading.Lock()
     self.busses = []        
     self.bus_connections = []                
     self.sec_mod_ecu_register = {}        
     self.auto_environment = AutomotiveEnvironment()        
     self.use_predefined_certification = False
     self.apply_certification = False
     self.cert_manager = None
     self.sim_param = None
     self.timing_map = {}
     self.use_predefined_certification = []
     self.app_lifetime = app_lifetime
     self.monitor = False
     self.derived_msg_sizes = {}  # key[ECUID][setting]
     self.but_thread = None
Ejemplo n.º 2
0
class AutomotiveEnvironmentSpec(object):
    ''' 
    This class holds the information needed to generate a 
    valid simulation. From this object the simulation is then 
    generated.
    '''    
    CNT = 0
    
    def __init__(self, app_lifetime):
        ''' Constructor
        
            Input: app_lifetime    number    lifetime of the simpy.environment            
            Output: -        
        '''
        self.id = "Environment " + str(AutomotiveEnvironmentSpec.CNT)
        AutomotiveEnvironmentSpec.CNT += 1
        
        self.result_reader = None
        self.autoset_gateway_filters = []
        self.ecu_ids = []
        self.ecu_groups = []
        self.bus_ids = []
        self.gui_lock_sync = threading.Lock()
        self.busses = []        
        self.bus_connections = []                
        self.sec_mod_ecu_register = {}        
        self.auto_environment = AutomotiveEnvironment()        
        self.use_predefined_certification = False
        self.apply_certification = False
        self.cert_manager = None
        self.sim_param = None
        self.timing_map = {}
        self.use_predefined_certification = []
        self.app_lifetime = app_lifetime
        self.monitor = False
        self.derived_msg_sizes = {}  # key[ECUID][setting]
        self.but_thread = None
    
    
    def get_env(self):
        ''' returns the corresponding simpy.environment 
        
            Input:  -       
            Output: env        simpy.Environment    corresponding simpy.environment 
        '''
        return self.auto_environment.get_env()
    
    def set_env(self, env):
        ''' this method sets the simpy.Environment
            
            Input:    env    simpy.Environment     environment to be used for this environment
            Output:   -
        '''
        self.auto_environment.set_env(env)