예제 #1
0
파일: test.py 프로젝트: mldelibero/geda2
def getCrnPtsPcb__test(pcb_file):
    pts = getCrnPts.get_MinMax_xy_pcb(pcb_file)
    print pts
    print "pcb file", pcb_file
    draw.drawBox_pcb(pcb_file,pts)
    openPcb = """pcb %s""" % pcb_file
    print "openpcb: ",open
    subprocess.call(['sh','-c',openPcb])
예제 #2
0
def getShift(pcb_file,subpcb_file,copies):
    #Shift each subpcb file
    ptsPcb = get_MinMax_xy_pcb(pcb_file)
    ptsSub = get_MinMax_xy_pcb(subpcb_file)
    x_shift = []
    y_shift = []
    
    xminus = int(ptsSub[0])
    yminus = int(ptsSub[1])
    xplus = int(ptsPcb[2])
    yplus = int(ptsPcb[3])

    incre = 1000
    ysinc = int(ptsSub[3]) - int(ptsSub[1]) + incre

    for cop in range(copies):
        yinc = cop * ysinc
        x_shift.append(xplus-xminus)
        y_shift.append(yplus-yminus + yinc)

    return [x_shift,y_shift]