Пример #1
0
 def __init__(self):
     self.nets = list()
     self.components = Components()
     self.component_instances = list()
     self.shapes = list()
     self.pins = list()
     self.design_attributes = DesignAttributes()
     self.layout = None
     self.version = dict()
     self.set_version("0.1.0","Upverter converter")
    def __init__(self):
        self.nets = list()
        self.components = Components()
        self.component_instances = list()
        self.shapes = list()
        self.pins = list()
        self.design_attributes = DesignAttributes()

        # layout specific aspects of the design
        self.layout_units = 'mm'  # Core units for layout placement are in nano meters
        self.layer_options = list()
        self.trace_segments = list()
        self.paths = list()
        self.pours = list()
        self.pcb_text = list()
        self.layout_objects = list()  # vias, plated through holes...
        #self.layout = Layout()

        self.version = dict()
        self.set_version('0.1.0', 'Upverter converter')
Пример #3
0
    def parse(self):
        """ Parses a viewdraw project and returns a list of sheets. """
        lib = Components()
        # All the symbol files I have seen have a filename like partname.n
        # where n is a number, for multi-versioned parts I'm guessing
        for libname, libdir in self.symdirs.items():
            files = [f for f in listdir(libdir)
                     if f.rpartition('.')[-1].isdigit()]
     
            for f in files:
                lib.add_component((libname + ':' + f).lower(),
                                  ViewDrawSym(libdir, f).parse())

        sheets = list()
        schfiles = [f for f in listdir(self.schdir)
                    if f.split('.')[-1].isdigit()]
        for sch in sorted(schfiles, key=lambda s: int(s.split('.')[-1])):
            sheets.append(ViewDrawSch(lib, self.schdir + sch).parse())

        # For now, we'll return a list of designs, each one represents one
        # sheet in the viewdraw schematic.
        return sheets
Пример #4
0
 def test_create_new_components(self):
     """ Test the creation of a new empty library. """
     lib = Components()
     assert len(lib.components) == 0