Esempio n. 1
0
 def _parse_function_block_plugs(self, fcp):
     fbs = {}
     subunits = BcoSubunitInfo.get_subunits(fcp)
     for type in self.subunit_plugs.keys():
         subunit_fbs = {}
         entries = []
         for i in range(0xff):
             try:
                 entries.extend(BcoSubunitInfo.get_subunit_fb_info(fcp,
                                                         type, 0, i, 0xff))
             except:
                 break
         for entry in entries:
             fb_type = entry['fb-type']
             if fb_type not in subunit_fbs:
                 subunit_fbs[fb_type] = []
             subunit_fbs[fb_type].append({'input': [], 'output': []})
         for entry in entries:
             fb_type = entry['fb-type']
             fb_id = entry['fb-id'] - 1
             for i in range(entry['inputs']):
                 plug = self._parse_fb_plug(fcp, 'input', type, 0,
                                            fb_type, fb_id + 1, i)
                 subunit_fbs[fb_type][fb_id]['input'].append(plug)
             for i in range(entry['outputs']):
                 plug = self._parse_fb_plug(fcp, 'output', type, 0,
                                            fb_type, fb_id + 1, i)
                 subunit_fbs[fb_type][fb_id]['output'].append(plug)
         fbs[type] = subunit_fbs
     return fbs
Esempio n. 2
0
 def _parse_function_block_plugs(self, fcp):
     fbs = {}
     subunits = BcoSubunitInfo.get_subunits(fcp)
     for type in self.subunit_plugs.keys():
         subunit_fbs = {}
         entries = []
         for i in range(0xff):
             try:
                 entries.extend(
                     BcoSubunitInfo.get_subunit_fb_info(
                         fcp, type, 0, i, 0xff))
             except:
                 break
         for entry in entries:
             fb_type = entry['fb-type']
             if fb_type not in subunit_fbs:
                 subunit_fbs[fb_type] = []
             subunit_fbs[fb_type].append({'input': [], 'output': []})
         for entry in entries:
             fb_type = entry['fb-type']
             fb_id = entry['fb-id'] - 1
             for i in range(entry['inputs']):
                 plug = self._parse_fb_plug(fcp, 'input', type, 0, fb_type,
                                            fb_id + 1, i)
                 subunit_fbs[fb_type][fb_id]['input'].append(plug)
             for i in range(entry['outputs']):
                 plug = self._parse_fb_plug(fcp, 'output', type, 0, fb_type,
                                            fb_id + 1, i)
                 subunit_fbs[fb_type][fb_id]['output'].append(plug)
         fbs[type] = subunit_fbs
     return fbs
Esempio n. 3
0
 def _parse_subunit_plugs(self, fcp):
     subunit_plugs = {}
     subunits = BcoSubunitInfo.get_subunits(fcp)
     for subunit in subunits:
         type = subunit['type']
         id = subunit['id']
         if subunit['id'] != 0:
             raise RuntimeError('Unsupported number for subunit id')
         if type not in subunit_plugs:
             subunit_plugs[type] = {}
             subunit_plugs[type]['input'] = []
             subunit_plugs[type]['output'] = []
         info = AvcConnection.get_subunit_plug_info(fcp, type, 0)
         for dir, num in info.items():
             for i in range(num):
                 plug = self._parse_subunit_plug(fcp, dir, type, 0, i)
                 subunit_plugs[type][dir].append(plug)
     return subunit_plugs
Esempio n. 4
0
 def _parse_subunit_plugs(self, fcp):
     subunit_plugs = {}
     subunits = BcoSubunitInfo.get_subunits(fcp)
     for subunit in subunits:
         type = subunit['type']
         id = subunit['id']
         if subunit['id'] != 0:
             raise RuntimeError('Unsupported number for subunit id')
         if type not in subunit_plugs:
             subunit_plugs[type] = {}
             subunit_plugs[type]['input'] = []
             subunit_plugs[type]['output'] = []
         info = AvcConnection.get_subunit_plug_info(fcp, type, 0)
         for dir, num in info.items():
             for i in range(num):
                 plug = self._parse_subunit_plug(fcp, dir, type, 0, i)
                 subunit_plugs[type][dir].append(plug)
     return subunit_plugs