Newer
Older
def roco_add_ee(me_drawing,netlist_csv,module_libpath,dsnwritier_dir,
trace_width=2,iso_size=2,cross_size=0.66):
"""
This module call script 'roco_dsn.py' to generate a DSN file for auto_router.
An interface will pop up for the user to confirm wiring design,
if a user does not want to change anything, one can just simply close the window.
Routing information will be stored automatically in the same directory.
The routing information will be read and draw the corresponding line on the dxf file
(Please make sure the ME drawing has everything need to cut (obstacles) in "Cut" layer)
Tested Python Version: 3.6
path information needed:
- mechanical design drawing file
- A csv file describes your netlist
- modules library dir
- dsnwritier(sesreader) dir
"""
##########general lib############
import sys
import subprocess
import os
sys.path.insert(1,dsnwritier_dir)
from sesreader import find_wire
from roco_dsn import brd_design
from ee_dwg_processing import pre_process, post_process
ready_for_autorouter=pre_process(me_drawing) #get dwg_for_autorouter.dxf
ee_design=brd_design(ready_for_autorouter.bry_ind,module_libpath,netlist_csv)#,dwgfile='dwg_for_autorouter_temp.dxf') #get paperbot_ee.dsn
subprocess.call(['java','-jar','freeRouting.jar','-de',ee_design.savename+'.dsn','-white','-s'])
wiring_path=find_wire(ee_design.savename,ee_design.pins_at) #read ses file
post_process(me_drawing,wiring_path,ee_design.pins_at,trace_width,iso_size,cross_size) # draw for fabrication
os.remove(ready_for_autorouter.savename)
os.remove(ee_design.savename+'.dsn')
def test():
from read_old_paperbot import read_old_paperbot
dsnwritier_dir='/home/jingyan/Documents/summer_intern_lemur/roco_electrical/dsn_python'
module_libpath='/home/jingyan/Documents/summer_intern_lemur/roco_electrical/libraries/kicad-ESP8266/ESP8266.pretty/'
dwg_path='/home/jingyan/Documents/summer_intern_lemur/roco_electrical/graph-silhouette.dxf'
old=read_old_paperbot(dwg_path) #get dwg_w_layer.dxf
me_dwg=old.savename