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


Python Group.connected_parent_south方法代码示例

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


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

示例1: create_parent

# 需要导入模块: from group import Group [as 别名]
# 或者: from group.Group import connected_parent_south [as 别名]
def create_parent(child, forceOptimizer, debug):
    """
    DESCRIPTION:    builds recursive the parents of the groupe, which containts the block
                    when the algo reached the last parent, it will add them to the main group
    PARAMETER:      child        The group which need a parent
    STATE:          finish
    """

    if debug:
        print "create parent for child:", child.group_id

    group_id = child.group_id[: len(child.group_id) - 1]  # remove the last ID

    if debug:
        print "parents ID:", group_id

    group = search_group(group_id, forceOptimizer)  # check if the group allready exists

    if group is None:  # create a new group if needed
        group = Group(group_id)
        forceOptimizer.groups.append(group)
        if debug:
            print "Parent not exist, create a new Group"

    group.add_child(child)
    child.parent = group

    # check the connection to important pins
    group.connected_gnd = 0
    group.connected_vcc = 0
    group.connected_out = 0
    group.connected_inp = 0

    for c in group.childs:
        group.connected_gnd += c.connected_gnd
        group.connected_vcc += c.connected_vcc
        group.connected_out += c.connected_out
        group.connected_inp += c.connected_inp

    group.connected_parent_east = group.connected_out
    group.connected_parent_south = group.connected_gnd
    group.connected_parent_north = group.connected_vcc

    # if group has parents create them
    if len(group_id) > 1:
        create_parent(group, forceOptimizer, debug)
    # else add group to main group
    else:
        forceOptimizer.group_main.add_child(group)
        group.parent = forceOptimizer.group_main
开发者ID:ChristianOAuth,项目名称:schemmaker,代码行数:52,代码来源:build_step.py


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