示例#1
0
 def _parse_fb_plug(self, fcp, dir, subunit_type, subunit_id, fb_type, fb_id,
                    num):
     plug = {}
     addr = BcoPlugInfo.get_function_block_addr(dir, subunit_type,
                                         subunit_id, fb_type, fb_id, num)
     plug['type'] = BcoPlugInfo.get_plug_type(fcp, addr)
     plug['name'] = BcoPlugInfo.get_plug_name(fcp, addr)
     plug['channels'] = []
     channels = BcoPlugInfo.get_plug_channels(fcp, addr)
     for channel in range(channels):
         ch = BcoPlugInfo.get_plug_ch_name(fcp, addr, channel + 1)
         plug['channels'].append(ch)
     plug['clusters'] = []
     if plug['type'] is 'IsoStream':
         clusters = BcoPlugInfo.get_plug_clusters(fcp, addr)
         for cluster in range(len(clusters)):
             clst = BcoPlugInfo.get_plug_cluster_info(fcp, addr, cluster + 1)
             plug['clusters'].append(clst)
     plug['input'] = {}
     plug['outputs'] = []
     # Music subunits have counter direction.
     try:
         plug['input'] = BcoPlugInfo.get_plug_input(fcp, addr)
     except:
         pass
     try:
         plug['outputs'] = BcoPlugInfo.get_plug_outputs(fcp, addr)
     except:
         pass
     return plug
示例#2
0
 def _parse_fb_plug(self, fcp, dir, subunit_type, subunit_id, fb_type,
                    fb_id, num):
     plug = {}
     addr = BcoPlugInfo.get_function_block_addr(dir, subunit_type,
                                                subunit_id, fb_type, fb_id,
                                                num)
     plug['type'] = BcoPlugInfo.get_plug_type(fcp, addr)
     plug['name'] = BcoPlugInfo.get_plug_name(fcp, addr)
     plug['channels'] = []
     channels = BcoPlugInfo.get_plug_channels(fcp, addr)
     for channel in range(channels):
         ch = BcoPlugInfo.get_plug_ch_name(fcp, addr, channel + 1)
         plug['channels'].append(ch)
     plug['clusters'] = []
     if plug['type'] is 'IsoStream':
         clusters = BcoPlugInfo.get_plug_clusters(fcp, addr)
         for cluster in range(len(clusters)):
             clst = BcoPlugInfo.get_plug_cluster_info(
                 fcp, addr, cluster + 1)
             plug['clusters'].append(clst)
     plug['input'] = {}
     plug['outputs'] = []
     # Music subunits have counter direction.
     try:
         plug['input'] = BcoPlugInfo.get_plug_input(fcp, addr)
     except:
         pass
     try:
         plug['outputs'] = BcoPlugInfo.get_plug_outputs(fcp, addr)
     except:
         pass
     return plug
示例#3
0
 def _parse_unit_plug(self, fcp, dir, type, num):
     plug = {}
     addr = BcoPlugInfo.get_unit_addr(dir, type, num)
     plug['type'] = BcoPlugInfo.get_plug_type(fcp, addr)
     plug['name'] = BcoPlugInfo.get_plug_name(fcp, addr)
     plug['channels'] = []
     channels = BcoPlugInfo.get_plug_channels(fcp, addr)
     for channel in range(channels):
         ch = BcoPlugInfo.get_plug_ch_name(fcp, addr, channel + 1)
         plug['channels'].append(ch)
     plug['clusters'] = []
     if plug['type'] is 'IsoStream':
         clusters = BcoPlugInfo.get_plug_clusters(fcp, addr)
         for cluster in range(len(clusters)):
             clst = BcoPlugInfo.get_plug_cluster_info(fcp, addr, cluster + 1)
             plug['clusters'].append(clst)
     plug['input'] = []
     plug['outputs'] = []
     if dir == 'output':
         plug['input'] = BcoPlugInfo.get_plug_input(fcp, addr)
     else:
         plug['outputs'] = BcoPlugInfo.get_plug_outputs(fcp, addr)
     return plug
示例#4
0
 def _parse_unit_plug(self, fcp, dir, type, num):
     plug = {}
     addr = BcoPlugInfo.get_unit_addr(dir, type, num)
     plug['type'] = BcoPlugInfo.get_plug_type(fcp, addr)
     plug['name'] = BcoPlugInfo.get_plug_name(fcp, addr)
     plug['channels'] = []
     channels = BcoPlugInfo.get_plug_channels(fcp, addr)
     for channel in range(channels):
         ch = BcoPlugInfo.get_plug_ch_name(fcp, addr, channel + 1)
         plug['channels'].append(ch)
     plug['clusters'] = []
     if plug['type'] is 'IsoStream':
         clusters = BcoPlugInfo.get_plug_clusters(fcp, addr)
         for cluster in range(len(clusters)):
             clst = BcoPlugInfo.get_plug_cluster_info(
                 fcp, addr, cluster + 1)
             plug['clusters'].append(clst)
     plug['input'] = []
     plug['outputs'] = []
     if dir == 'output':
         plug['input'] = BcoPlugInfo.get_plug_input(fcp, addr)
     else:
         plug['outputs'] = BcoPlugInfo.get_plug_outputs(fcp, addr)
     return plug