eeschema: more trouble with sheet property variable expansion
Description
This used to work, but I believe was recently broken as part of a fix for a similar issue...although I can't seem to find the bug right now. As such I don't know if this should just be declared "WAI", but here's what we have:
We use COMMENT1 in our standard worksheet to provide a block title (TITLE being the project name). In some cases with multiple instantiation, we choose to reference another variable within COMMENT1...a common choice is SHEETNAME. So we can have a ${SHEETNAME} Buck in COMMENT1 to form the page title, and if the instance is named 5V then we get a nice 5V Buck in the title. This is all good, and works.
At the sheet block instantiation, though, we'd also like to display the block's title on the element. So we reference COMMENT1 in a custom property called Title, which then displays on top of the block. This avoids duplicating information.
This used to work: in the above example, the sheet instance would show 5V Buck on on it.
Now, ever since the fix I can't seem to locate, the sheet instance shows ${SHEETNAME} Buck. SHEETNAME in that context doesn't seem to resolve to anything, neither the sheetname of the child sheet (as it did before) nor the current sheet (which would honestly be a reasonable bug).
Again, maybe this is a more sane behavior than pre-bugfix, but in that case it'd be nice to have detailed documentation about the intended context for the various variable locations (sheet instance, sheet page, page property). Of course, I'd rather our use-case work
Steps to reproduce
- Try out the attached project: sheettest.zip
- Expect to see "a" instead of
${SHEETNAME}on the instance.
KiCad Version
Application: KiCad Schematic Editor x86_64 on x86_64
Version: 8.0.1-65-gdfe6cb7afa, release build
Libraries:
wxWidgets 3.2.1
FreeType 2.11.1
HarfBuzz 2.7.4
FontConfig 2.13.1
libcurl/7.81.0 OpenSSL/3.0.2 zlib/1.2.11 brotli/1.0.9 zstd/1.4.8 libidn2/2.3.2 libpsl/0.21.0 (+libidn2/2.3.2) libssh/0.9.6/openssl/zlib nghttp2/1.43.0 librtmp/2.3 OpenLDAP/2.5.17
Platform: Ubuntu 22.04.4 LTS, 64 bit, Little endian, wxGTK, X11, xubuntu, x11
Build Info:
Date: Mar 21 2024 10:40:28
wxWidgets: 3.2.1 (wchar_t,wx containers) GTK+ 3.24
Boost: 1.74.0
OCC: 7.6.3
Curl: 7.81.0
ngspice: 36
Compiler: GCC 11.4.0 with C++ ABI 1016
Build settings: