[eeschema] Spice parameters that include capital letters cause error "Can't find a parameter named 'Rt' in simulation model of type ''" and data loss

Steps to reproduce:

  1. Open any eeschema file
  2. Add a R_Potentiometer
  3. Open properties and click "Simulation Model..."
  4. Select "SPICE model from file"
  5. Set the file to "Pote.lib" and the type to "POT"
  6. Set Rt to 100k and SET to 0.5
  7. Click OK
  8. Click "Simulation Model..." a second time

Expected behaviour: simulation parameter values are preserved

Actual behaviour: error popup "Can't find a parameter named 'Rt' in simulation model of type ''", and simulation parameter values are lost.

This bug is present in 7.0.2 and in master.

This is a regression, as it was possible to use spice parameters with capital letters in 6.0 (although there was no UI for entering them besides the model line itself).

Screenshot_2023-05-21_at_5.33.49_PM

KiCad Version

Application: KiCad Schematic Editor x86_64 on x86_64

Version: 7.0.2-0, release build

Libraries:
	wxWidgets 3.2.2
	FreeType 2.12.1
	HarfBuzz 5.3.1
	FontConfig 2.14.0
	libcurl/7.87.0 SecureTransport (LibreSSL/3.3.6) zlib/1.2.11 nghttp2/1.51.0

Platform: macOS Ventura Version 13.3.1 (a) (Build 22E772610a), 64 bit, Little endian, wxMac

Build Info:
	Date: Apr 17 2023 08:25:19
	wxWidgets: 3.2.2 (wchar_t,wx containers)
	Boost: 1.80.0
	OCC: 7.6.3
	Curl: 7.77.0
	ngspice: 38
	Compiler: Clang 13.0.0 with C++ ABI 1002

Build settings:
	KICAD_SPICE=ON
Edited by Mark Visser