-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathconst.py
54 lines (46 loc) · 1.29 KB
/
const.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
# These are the files that will be processed
INPUT_FILE_NAME = "kicad/test.sch"
OUT_FILE_NAME = "out.tek"
# Header and footer are necessary to generate a ready-to-compile tek file
TEK_HEADER_FILE_NAME = "header.txt"
TEK_FOOTER = "; \\end{circuitikz}\n\n\\end{document}"
# These strings will be used in the parser. Informations on the .sch file can be found here:
# http://en.wikibooks.org/wiki/Kicad/file_formats#Schematic_Files_Format
WIRE = "Wire Wire Line"
COMPONENT = "$Comp"
END_COMPONENT = "$EndComp"
JUNCTION = "Connection ~"
NO_CONNECT = "NoConn ~"
# Strictly component related constants
COMP_LABEL = "L"
COMP_TIME = "U"
COMP_POS = "P"
COMP_FIELD = "F"
COMP_ENDING = "\t"
# Components names
RESISTOR = "R"
CAPACITOR = "C"
INDUCTOR = "L"
NMOS = "NMOS"
PMOS = "PMOS"
NPN = "NPN"
PNP = "PNP"
GND = "GND"
# Translation dictionary, from kicad name to circuitikz name
TRANSLATE = {
RESISTOR : "R",
CAPACITOR : "C",
INDUCTOR : "L",
NMOS : "Tnmos",
PMOS : "Tpmos",
NPN : "Tnpn",
PNP : "Tpnp",
GND : "ground",
}
# Bipoles set. This are not bipoles actually but they can be drawn in the same way.
BIPOLES = {RESISTOR, CAPACITOR, INDUCTOR, NMOS, PMOS, NPN, PNP}
MONOPOLES = {GND}
# This converts from mils, used in .sch, to cm, used by circuitikz
MILS_TO_CM = 0.002
# Fuffa
VERSION = "0.2"