Added sheetpath + SCH load + sub-sheet recycle test.

A sheet is included twice to test dual reference names.
The SCH contains all the possible KiCad elements.
This commit is contained in:
SET 2020-08-12 09:53:47 -03:00
parent f7473bca12
commit 51802aa42b
4 changed files with 2181 additions and 0 deletions

View File

@ -0,0 +1,151 @@
EESchema Schematic File Version 4
EELAYER 30 0
EELAYER END
$Descr A4 11693 8268
encoding utf-8
Sheet 3 3
Title ""
Date ""
Rev ""
Comp ""
Comment1 ""
Comment2 ""
Comment3 ""
Comment4 ""
$EndDescr
$Comp
L 74xx:74LS04 U1
U 1 1 5F34307A
P 3800 2500
AR Path="/5F342DEB/5F34307A" Ref="U1" Part="1"
AR Path="/5F34E267/5F34307A" Ref="U2" Part="1"
F 0 "U2" H 3800 2817 50 0000 C CNN
F 1 "74LS04" H 3800 2726 50 0000 C CNN
F 2 "" H 3800 2500 50 0001 C CNN
F 3 "http://www.ti.com/lit/gpn/sn74LS04" H 3800 2500 50 0001 C CNN
1 3800 2500
1 0 0 -1
$EndComp
$Comp
L 74xx:74LS04 U1
U 2 1 5F344A0E
P 4500 2500
AR Path="/5F342DEB/5F344A0E" Ref="U1" Part="2"
AR Path="/5F34E267/5F344A0E" Ref="U2" Part="2"
F 0 "U2" H 4500 2817 50 0000 C CNN
F 1 "74LS04" H 4500 2726 50 0000 C CNN
F 2 "" H 4500 2500 50 0001 C CNN
F 3 "http://www.ti.com/lit/gpn/sn74LS04" H 4500 2500 50 0001 C CNN
2 4500 2500
1 0 0 -1
$EndComp
$Comp
L 74xx:74LS04 U1
U 3 1 5F345E39
P 5200 2500
AR Path="/5F342DEB/5F345E39" Ref="U1" Part="3"
AR Path="/5F34E267/5F345E39" Ref="U2" Part="3"
F 0 "U2" H 5200 2817 50 0000 C CNN
F 1 "74LS04" H 5200 2726 50 0000 C CNN
F 2 "" H 5200 2500 50 0001 C CNN
F 3 "http://www.ti.com/lit/gpn/sn74LS04" H 5200 2500 50 0001 C CNN
3 5200 2500
1 0 0 -1
$EndComp
$Comp
L 74xx:74LS04 U1
U 4 1 5F346E8B
P 5900 2500
AR Path="/5F342DEB/5F346E8B" Ref="U1" Part="4"
AR Path="/5F34E267/5F346E8B" Ref="U2" Part="4"
F 0 "U2" H 5900 2817 50 0000 C CNN
F 1 "74LS04" H 5900 2726 50 0000 C CNN
F 2 "" H 5900 2500 50 0001 C CNN
F 3 "http://www.ti.com/lit/gpn/sn74LS04" H 5900 2500 50 0001 C CNN
4 5900 2500
1 0 0 -1
$EndComp
$Comp
L 74xx:74LS04 U1
U 5 1 5F348270
P 6600 2500
AR Path="/5F342DEB/5F348270" Ref="U1" Part="5"
AR Path="/5F34E267/5F348270" Ref="U2" Part="5"
F 0 "U2" H 6600 2817 50 0000 C CNN
F 1 "74LS04" H 6600 2726 50 0000 C CNN
F 2 "" H 6600 2500 50 0001 C CNN
F 3 "http://www.ti.com/lit/gpn/sn74LS04" H 6600 2500 50 0001 C CNN
5 6600 2500
1 0 0 -1
$EndComp
$Comp
L 74xx:74LS04 U1
U 6 1 5F348D95
P 7300 2500
AR Path="/5F342DEB/5F348D95" Ref="U1" Part="6"
AR Path="/5F34E267/5F348D95" Ref="U2" Part="6"
F 0 "U2" H 7300 2817 50 0000 C CNN
F 1 "74LS04" H 7300 2726 50 0000 C CNN
F 2 "" H 7300 2500 50 0001 C CNN
F 3 "http://www.ti.com/lit/gpn/sn74LS04" H 7300 2500 50 0001 C CNN
6 7300 2500
1 0 0 -1
$EndComp
$Comp
L 74xx:74LS04 U1
U 7 1 5F34A12F
P 5500 3500
AR Path="/5F342DEB/5F34A12F" Ref="U1" Part="7"
AR Path="/5F34E267/5F34A12F" Ref="U2" Part="7"
F 0 "U2" H 5730 3546 50 0000 L CNN
F 1 "74LS04" H 5730 3455 50 0000 L CNN
F 2 "" H 5500 3500 50 0001 C CNN
F 3 "http://www.ti.com/lit/gpn/sn74LS04" H 5500 3500 50 0001 C CNN
7 5500 3500
1 0 0 -1
$EndComp
$Comp
L power:VCC #PWR01
U 1 1 5F34BC05
P 5500 3000
AR Path="/5F342DEB/5F34BC05" Ref="#PWR01" Part="1"
AR Path="/5F34E267/5F34BC05" Ref="#PWR03" Part="1"
F 0 "#PWR03" H 5500 2850 50 0001 C CNN
F 1 "VCC" H 5515 3173 50 0000 C CNN
F 2 "" H 5500 3000 50 0001 C CNN
F 3 "" H 5500 3000 50 0001 C CNN
1 5500 3000
1 0 0 -1
$EndComp
$Comp
L power:GND #PWR02
U 1 1 5F34C535
P 5500 4000
AR Path="/5F342DEB/5F34C535" Ref="#PWR02" Part="1"
AR Path="/5F34E267/5F34C535" Ref="#PWR04" Part="1"
F 0 "#PWR04" H 5500 3750 50 0001 C CNN
F 1 "GND" H 5505 3827 50 0000 C CNN
F 2 "" H 5500 4000 50 0001 C CNN
F 3 "" H 5500 4000 50 0001 C CNN
1 5500 4000
1 0 0 -1
$EndComp
Wire Wire Line
4100 2500 4200 2500
Wire Wire Line
4800 2500 4900 2500
Wire Wire Line
5500 2500 5600 2500
Wire Wire Line
6200 2500 6300 2500
Wire Wire Line
6900 2500 7000 2500
Text HLabel 7700 2500 2 50 Output ~ 0
OUT
Wire Wire Line
7600 2500 7700 2500
Text HLabel 3350 2500 0 50 Input ~ 0
IN
Wire Wire Line
3350 2500 3500 2500
$EndSCHEMATC

File diff suppressed because it is too large Load Diff

View File

@ -111,6 +111,14 @@ def check_dnc(rows, comp, ref, qty):
return
def check_path(rows, comp, ref, sp, val):
for row in rows:
if row[ref].find(comp) != -1:
assert row[sp] == val
logging.debug(comp + " sheetpath OK")
return
def test_int_bom_simple_csv():
prj = 'kibom-test'
ext = 'csv'
@ -593,3 +601,22 @@ def test_int_bom_no_test_regex():
check_kibom_test_netlist(rows, ref_column, KIBOM_TEST_GROUPS, KIBOM_TEST_EXCLUDE, KIBOM_TEST_COMPONENTS)
check_dnc(rows, 'R7', ref_column, qty_column)
ctx.clean_up()
def test_int_bom_sub_sheet_alt():
""" Test for 1 sub sheet used twice.
Also stress the v5 loader.
Also tests sheet path and no grouping with multi-part components """
prj = 'test_v5'
ext = 'csv'
ctx = context.TestContextSCH('test_int_bom_sub_sheet_alt', prj, 'int_bom_sheet_path', BOM_DIR)
ctx.run() # extra_debug=True
out = prj + '-bom.' + ext
rows, header = ctx.load_csv(out)
assert header == KIBOM_TEST_HEAD[:-1] + ['Sheetpath']
ref_column = header.index(REF_COLUMN_NAME)
sp_column = header.index('Sheetpath')
check_kibom_test_netlist(rows, ref_column, 6, [], ['C1', 'L1', 'R1', 'R2', 'U1', 'U2'])
check_path(rows, 'U1', ref_column, sp_column, '/Sub Sheet')
check_path(rows, 'U2', ref_column, sp_column, '/Sub Sheet 2')
ctx.clean_up()

View File

@ -0,0 +1,13 @@
# Example KiPlot config file
kiplot:
version: 1
outputs:
- name: 'bom_internal'
comment: "Bill of Materials in CSV format"
type: bom
dir: BoM
options:
columns: ['Row','Description','Part','References','Value','Footprint','Quantity Per PCB','Datasheet','Sheetpath']
group_fields: []