kiCad2JlcSMT/main.go

49 lines
1.4 KiB
Go

package main
import (
"flag"
"fmt"
)
var FootprintTransMap map[string]string = map[string]string{
"\"Capacitor_SMD:C_0603_1608Metric": "\"0603",
"\"Capacitor_SMD:C_0805_2012Metric": "\"0805",
"\"Capacitor_SMD:C_1206_3216Metric": "\"1206",
"\"Capacitor_SMD:C_1210_3225Metric": "\"1210",
"\"LED_SMD:LED_0603_1608Metric": "\"0603",
"\"Diode_SMD:D_SMA": "\"SMA",
"\"Diode_SMD:D_SOD-123": "\"SOD-123",
"\"Package_TO_SOT_SMD:SOT-23": "\"SOT-23",
"\"Package_TO_SOT_SMD:SOT-223-3_TabPin2": "\"SOT-223",
"\"Package_SO:SO-4_4.4x3.6mm_P2.54mm": "\"SOP-4",
"\"Crystal:Crystal_SMD_3225-4Pin_3.2x2.5mm": "\"SMD_3225-4P",
"\"Package_SO:SOIC-8_3.9x4.9mm_P1.27mm": "\"SOP-8",
"\"Resistor_SMD:R_0603_1608Metric": "\"0603",
"\"Resistor_SMD:R_1206_3216Metric": "\"1206",
"\"Resistor_SMD:R_1210_3225Metric": "\"1210",
}
func usage() {
fmt.Println("kiCad2JlcSMT v1.0.2")
flag.PrintDefaults()
}
func main() {
var nameB, nameP string
var t uint
flag.Usage = usage
flag.StringVar(&nameB, "b", "", "Input BOM CSV File")
flag.StringVar(&nameP, "p", "", "Input POS CSV File")
flag.UintVar(&t, "t", 2, "0-Bom, 1-Pos, other-All")
flag.Parse()
if t == 0 {
transBom(nameB)
} else if t == 1 {
transPos(nameP)
} else {
transBom(nameB)
transPos(nameP)
}
}