示例#1
0
def facetizeWire(wire):

    if wire.get_curve() == 0:
        return [wire]

    points = getFacetsForWire(wire)
    wires = []
    for i in range(0, len(points) - 1):
        wires.append(Swoop.Wire().set_points(
            points[i].x, points[i].y, points[i + 1].x,
            points[i + 1].y).set_layer(wire.get_layer()).set_width(
                wire.get_width()))
    return wires
示例#2
0
    def do_check(self):
        for library in self.lbrs:
            if isinstance(library, Swoop.LibraryFile):
                name = library.get_filename()
                library = library.get_library()
            else:
                name = library.get_name()

            if name in (self.options.get("skipped_lbrs") or []):
                return

            with NestedError(self.errors, name):
                self.info("Examined {}".format(name))
                fix = self.fix

                if fix:
                    for t in Swoop.From(library).get_devicesets().get_devices(
                    ).get_technologies():
                        for attr in self.required_deviceset_attributes:
                            if not t.get_attribute(
                                    attr) or not t.get_attribute(
                                        attr).get_value():
                                t.add_attribute(Swoop.Attribute().set_name(
                                    attr).set_value("Unknown"))

                    for p in library.get_packages():
                        if not Swoop.From(
                                p).get_drawing_elements().without_type(
                                    Swoop.Hole).with_layer("tKeepout").count():
                            p.add_drawing_element(
                                Swoop.Wire().set_x1(0).set_y1(0).set_x2(0).
                                set_y2(0).set_width(1).set_layer("tKeepout"))

                for s in Swoop.From(library).get_symbols():
                    self.check_symbol(s,
                                      checker_options.power_and_ground_names)

                for p in Swoop.From(library).get_packages():
                    self.check_package(p)

                for ds in Swoop.From(library).get_devicesets():
                    self.check_deviceset(
                        ds, checker_options.power_and_ground_names)