Skip to content

eeschema: Value field gets corrupted by sim params at schematics and libraries upgrade

Description

I have a some symbols in my library with simulation params assigned. For example there is symbol 1N4001 with following fields content:

    (property "Reference" "VD" (id 0) (at 3.175 1.27 0)
      (effects (font (size 1.524 1.524)) (justify right bottom))
    )
    (property "Value" "1N4001" (id 1) (at 4.445 1.27 0)
      (effects (font (size 1.524 1.524)) (justify left bottom))
    )
    (property "Footprint" "active:DO-41" (id 2) (at 3.81 -1.27 0)
      (effects (font (size 1.524 1.524)) (justify top) hide)
    )
    (property "Datasheet" "" (id 3) (at 0 0 0)
      (effects (font (size 1.524 1.524)))
    )
    (property "Spice_Primitive" "D" (id 4) (at 10.16 -5.08 0)
      (effects (font (size 1.27 1.27)) (justify left) hide)
    )
    (property "Spice_Lib_File" "diode.lib" (id 6) (at 10.16 -3.81 0)
      (effects (font (size 1.27 1.27)) (justify left) hide)
    )

Pay attention to "Value" field which is visible and which represent the type of physical part to be inserted into PCB at assembly stage of PCB manufacturing. Contents of "Value" field was printed on schematics, used in BOM and printed on PCB silkscreen and assembly drawings.

After some last simulation model editor changes fields of this and similar symbols get silently and unconditionally converted into following contents:

    (property "Reference" "VD" (at 3.175 1.27 0)
      (effects (font (size 1.524 1.524)) (justify right bottom))
    )
    (property "Value" "${SIM.PARAMS}" (at 4.445 1.27 0)
      (effects (font (size 1.524 1.524)) (justify left bottom))
    )
    (property "Footprint" "active:DO-41" (at 3.81 -1.27 0)
      (effects (font (size 1.524 1.524)) (justify top) hide)
    )
    (property "Datasheet" "" (at 0 0 0)
      (effects (font (size 1.524 1.524)))
    )
    (property "Sim.Device" "SPICE" (at 0 0 0)
      (effects (font (size 1.27 1.27)))
    )
    (property "Sim.Params" "type=\"D\" model=\"1N4001\" lib=\"diode.lib\"" (at 0 0 0)
      (effects (font (size 1.27 1.27)))
    )
    (property "Sim.Pins" "" (at 0 0 0)
      (effects (font (size 1.27 1.27)))
    )

Notice that after this upgrade "Value" field displayed as type="D" model="1N4001" lib="diode.lib". Same conversion takes place on existing schematics loading and, I suppose, will be transferred to PCB silkscreen, assembly drawings and BOMs. This is unacceptable conversion. I think proper conversion should fill Sim.Params field with contents similar to type="D" model=${VALUE} lib="diode.lib" and leave "Value" field untouched.

Schematics before upgrade:

Screenshot_from_2022-12-13_11-50-38

Schematics after upgrade:

Screenshot_from_2022-12-13_11-49-47

Steps to reproduce

  1. Load schematics or symbol with previously saved spice-related fields in mature format.

KiCad Version

Application: KiCad Schematic Editor

Version: (6.99.0-4926-g93e313440e-dirty), release build

Libraries:
	wxWidgets 3.0.5
	FreeType 2.11.1
	HarfBuzz 2.7.4
	FontConfig 2.13.1

Platform: Linux 5.15.0-56-generic x86_64, 64 bit, Little endian, wxGTK, cinnamon, x11

	wxWidgets: 3.0.5 (wchar_t,wx containers,compatible with 2.8) GTK+ 3.24
	Boost: 1.74.0
	OCC: 7.5.1
	Curl: 7.81.0
	ngspice: 31
	Compiler: GCC 11.3.0 with C++ ABI 1016

Build settings:
	KICAD_SPICE=ON
Edited by Sergey A. Borshch