BOM is wrong when a text replacement variable is used in parametrized hierarchical sheet
Description
Using a string replacement variable in a component value in a parameterised hierarchical sheet leads to erroneous BOM produced from eeschema. This happens if two sheet instances are used and they have different parameters for component values. It looks like only the first found value for a variable is used instead of using each sheet's own value.
BOM from pcbnew works correctly.
Steps to reproduce
- hierarchical_sheet_with_parameters.zip
- Eeschema -> Tools -> Generate BOM -> bom2csv, Generate
- The result:
Reference, Value, Footprint, Datasheet
"R1","1k","Resistor_SMD:R_0603_1608Metric","~"
"R2","2k","Resistor_SMD:R_0603_1608Metric","~"
"R3","1k","Resistor_SMD:R_0603_1608Metric","~"
"R4","2k","Resistor_SMD:R_0603_1608Metric","~"
- Expected:
Reference, Value, Footprint, Datasheet
"R1","1k","Resistor_SMD:R_0603_1608Metric","~"
"R2","2k","Resistor_SMD:R_0603_1608Metric","~"
"R3","2k","Resistor_SMD:R_0603_1608Metric","~"
"R4","5k","Resistor_SMD:R_0603_1608Metric","~"
KiCad Version
Application: Eeschema
Version: (5.99.0-7063-gc89676e39d), release build
Libraries:
wxWidgets 3.0.5
libcurl/7.71.0 OpenSSL/1.1.1g (Schannel) zlib/1.2.11 brotli/1.0.7 libidn2/2.3.0 libpsl/0.21.0 (+libidn2/2.3.0) libssh2/1.9.0 nghttp2/1.41.0
Platform: Windows 10 (build 18363), 64-bit edition, 64 bit, Little endian, wxMSW
Build Info:
Date: Nov 17 2020 22:01:37
wxWidgets: 3.0.5 (wchar_t,wx containers,compatible with 2.8)
Boost: 1.73.0
OCE: 6.9.1
Curl: 7.71.0
ngspice: 32
Compiler: GCC 10.2.0 with C++ ABI 1014
Build settings:
KICAD_SCRIPTING=ON
KICAD_SCRIPTING_MODULES=ON
KICAD_SCRIPTING_PYTHON3=OFF
KICAD_SCRIPTING_WXPYTHON=ON
KICAD_SCRIPTING_WXPYTHON_PHOENIX=OFF
KICAD_SCRIPTING_ACTION_MENU=ON
KICAD_USE_OCE=ON
KICAD_SPICE=ON