当前位置: 首页>>代码示例>>Python>>正文


Python ComponentInstance.conns方法代码示例

本文整理汇总了Python中upconvert.core.component_instance.ComponentInstance.conns方法的典型用法代码示例。如果您正苦于以下问题:Python ComponentInstance.conns方法的具体用法?Python ComponentInstance.conns怎么用?Python ComponentInstance.conns使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在upconvert.core.component_instance.ComponentInstance的用法示例。


在下文中一共展示了ComponentInstance.conns方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: parse_inst

# 需要导入模块: from upconvert.core.component_instance import ComponentInstance [as 别名]
# 或者: from upconvert.core.component_instance.ComponentInstance import conns [as 别名]
    def parse_inst(self, args):
        """ Returns a parsed component instance. """
        inst, libname, libnum, x, y, rot, _scale, _b = args.split()
        # scale is a floating point scaling constant. Also, evil.
        thisinst = ComponentInstance(inst, self.lookup(libname, libnum), 0)
        if int(rot) > 3:
            # part is flipped around y-axis. When applying transforms, flip it
            # first, then rotate it.
            rot = str(int(rot) - 4)
            # flip = True

        thisinst.add_symbol_attribute(SymbolAttribute(int(x), int(y),
                                                      float(rot) / 2))
        subdata = defaultdict(list)
        for phrase in self.stream:
            cmd, _sep, args = phrase.partition(' ')
            if cmd not in ('|R', 'A', 'C'):
                self.stream.push(phrase)
                break
            k, v = self.parsenode(cmd)(args)
            subdata[k].append(v)
        for annot in subdata['annot']:
            thisinst.symbol_attributes[0].add_annotation(annot)
            if '=' in annot.value:
                thisinst.add_attribute(*(annot.value.split('=', 1)))

        # Turns out C can reference a net before it's been created via
        # the N command. Really don't like passing stuff inband like this. Ugh.
        thisinst.conns = subdata['conn']
        return ('inst', thisinst)
开发者ID:ch3ka,项目名称:schematic-file-converter,代码行数:32,代码来源:viewdraw.py

示例2: parse_inst

# 需要导入模块: from upconvert.core.component_instance import ComponentInstance [as 别名]
# 或者: from upconvert.core.component_instance.ComponentInstance import conns [as 别名]
    def parse_inst(self, args):
        """ Returns a parsed component instance. """
        inst, libname, libnum, x, y, rot, _scale, _unknown = args.split()
        # scale is a floating point scaling constant. Also, evil.
        thisinst = ComponentInstance(inst, self.lookup(libname, libnum), 0)
        flip = False
        if int(rot) > 3:
            # part is flipped around y-axis. When applying transforms, flip it
            # first, then rotate it.
            rot = str(int(rot) - 4)
            flip = True

        thisinst.add_symbol_attribute(SymbolAttribute(int(x), int(y),
                                                      (2 - float(rot) / 2) % 2,
                                                      flip))
        subdata = self.sub_nodes('|R A C'.split())
        for annot in subdata['annot']:
            thisinst.symbol_attributes[0].add_annotation(annot)
            if '=' in annot.value:
                thisinst.add_attribute(*(annot.value.split('=', 1)))

        # Turns out C can reference a net before it's been created via
        # the N command. Really don't like passing stuff inband like this. Ugh.
        thisinst.conns = subdata['conn']
        return ('inst', thisinst)
开发者ID:ncsaba,项目名称:schematic-file-converter,代码行数:27,代码来源:viewdraw.py

示例3: parse_inst

# 需要导入模块: from upconvert.core.component_instance import ComponentInstance [as 别名]
# 或者: from upconvert.core.component_instance.ComponentInstance import conns [as 别名]
    def parse_inst(self, args):
        """ Returns a parsed component instance. """
        inst, libname, libnum, x, y, rot, scale, _unknown = args.split()
        # scale is a floating point scaling constant. Also, evil.
        if scale != '1':
            libkey = self.scaled_component(libname, libnum, scale)
        else:
            libkey = self.lookup(libname, libnum)
        thisinst = ComponentInstance(inst, libkey, 0)
        rot, flip = self.rot_and_flip(rot)
        thisinst.add_symbol_attribute(SymbolAttribute(int(x), int(y),
                                                      rot, flip))
        subdata = self.sub_nodes('|R A C'.split())
        for annot in subdata['annot']:
            thisinst.symbol_attributes[0].add_annotation(annot)
            if '=' in annot.value:
                thisinst.add_attribute(*(annot.value.split('=', 1)))

        # Turns out C can reference a net before it's been created via
        # the N command. Really don't like passing stuff inband like this. Ugh.
        thisinst.conns = subdata['conn']
        return ('inst', thisinst)
开发者ID:patrickyeon,项目名称:schematic-file-converter,代码行数:24,代码来源:viewdraw.py


注:本文中的upconvert.core.component_instance.ComponentInstance.conns方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。