Example #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
Example #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