80 Commits

Author SHA1 Message Date
Jeff Young
24786fe0e9 Fix multi-unit symbol bugs.
1) SPICE pins need to include all units
2) Already-seen-unit-x needs to be reset when getting netlist again.

Fixes https://gitlab.com/kicad/code/kicad/issues/13164
2022-12-16 13:57:46 +00:00
Jeff Young
a8e73cf92c Check for model existence in library. 2022-12-15 14:25:25 +00:00
Jeff Young
00a5fddda4 Simplify library model name from combobox to choice.
Fixes https://gitlab.com/kicad/code/kicad/issues/13168
2022-12-15 12:13:16 +00:00
Jeff Young
b2e512bfab We must infer a pinMap when inferring other fields for RLC passives.
Fixes https://gitlab.com/kicad/code/kicad/issues/13162
2022-12-14 23:23:41 +00:00
Jeff Young
50ccc4e6da Fix issue converting legacy SPICE models.
1) if a legacy model references a library then we need to see if said
   libraray exists and read model from it if so
2) legacy node ordering is by index, not pin name
3) we can't auto-generate a pin map when we don't know the pin names,
   so don't try
2022-12-14 13:36:28 +00:00
Jeff Young
c0872364d4 Get rid of bloated bitmap buttons on wxWidgets 3.2. 2022-12-13 20:48:02 +00:00
Seth Hillbrand
413637b732 Add missing translation string 2022-12-12 13:07:53 -08:00
Jeff Young
e890986e01 Fix crash when grid tries to access deleted field. 2022-12-11 23:12:55 +00:00
Jeff Young
1baec20cf6 Handle SPICE <-> SI conversions in inferred models.
Fixes https://gitlab.com/kicad/code/kicad/issues/13112
2022-12-09 22:02:52 +00:00
Jeff Young
60c937186a When migrating simulation models update value to a reference. 2022-12-09 20:24:25 +00:00
Jeff Young
05b9836f60 Remove ugly hack of passing SCH_SYMBOL as parent of LIB_FIELD array.
Also adds simulation model inference to Symbol Editor's Simulation Model
Editor, and adds write-back from both Simulation Model Editors to their
parent Symbol Fields Editor dialogs.

Fixes https://gitlab.com/kicad/code/kicad/issues/12505
2022-12-09 20:24:25 +00:00
Jeff Young
107025322c Better column width handling for sim params grid. 2022-12-08 23:57:42 +00:00
Jeff Young
e8980e9024 Centralize SPICE lib path resolution and support SPICE_LIB_DIR.
Fixes https://gitlab.com/kicad/code/kicad/issues/13081
2022-12-08 23:57:42 +00:00
Jeff Young
b15913bd53 Support env variables in spice library paths.
Also removes a bunch of std::string stuff from the file handling in the
simulator.  All our file handling, env variable expansion, project path,
etc. stuff is wxString based, and jumping through std::string in between
just makes it more complex and increases the potential bug surface.

Also fixes a bug where you'd get two error messages when a spice model
library wasn't found.

Also fixes a bug where you'd get a spice model library not found error
when the text field was empty.

Also fixes a bug where we'd try to absolutize a path starting with an
unresolved text or environment variable.  If the path starts with a
variable it's probably absolute, and tacking on the project path in the
error message just obfuscates things.

Fixes https://gitlab.com/kicad/code/kicad/issues/13082
2022-12-07 15:07:25 +00:00
Jeff Young
39ad7c8205 Formatting and Kicad naming conventions. 2022-12-06 16:01:18 +00:00
Jeff Young
b7d41e0e56 Update simulator with NUMERIC_EVAL, decimal separator processing, etc.
Also includes fixes for instance data and resolving of textvar
references.

Also includes virtual d'tors for IBIS parser to get rid of all the
compile warnings on CLang.

Fixes https://gitlab.com/kicad/code/kicad/issues/12357
2022-12-05 12:40:29 +00:00
Jeff Young
1855885d1e Gracefully handle spice models not recognized by KiCad.
Fixes https://gitlab.com/kicad/code/kicad/issues/12689
2022-12-04 21:06:35 +00:00
Jeff Young
49abd2682a Simulation model properties dialog improvements.
1) Fix <TAB> processing
2) Don't hide/show controls where possible
3) Use a more concrete reference to primary parameter in Save to Value
checkbox
4) Move Save to Value checkbox into model section
2022-12-04 21:06:35 +00:00
Fabien Corona
6510afe699 Ibis: Show the parser log if the parser fails 2022-11-28 17:46:42 +00:00
Mikolaj Wielgus
6f630f7054 Sim: Make library path textbox editable
Load the library from the path if enter is pressed or focus is lost if
the library exists. If a library under the same path as previously is
to be loaded this way, don't do anything.

Fixes https://gitlab.com/kicad/code/kicad/issues/12970
2022-11-26 03:55:20 +01:00
Mikolaj Wielgus
acc760dc25 Sim: Fix generation of Sim.Pins field in multipart models
Fixes https://gitlab.com/kicad/code/kicad/issues/12372
2022-11-26 01:34:10 +01:00
Mikolaj Wielgus
1550a1e3a4 Sim Model Editor: Add "Save {} in Value field as "{}"" checkbox 2022-11-22 07:09:52 +01:00
Mikolaj Wielgus
48f97bfec3 Sim Model Editor: Enable type dropdown on load when it should be 2022-11-20 22:56:01 +01:00
Mikolaj Wielgus
6969362813 Sim Model Editor: Don't provide library-only models as builtins 2022-11-20 22:07:39 +01:00
Mikolaj Wielgus
9b6f7d5db7 Sim Model Editor: Use SIM_LIB_MGR class to manage library models 2022-11-19 01:55:38 +01:00
Mikolaj Wielgus
21ae2dd1c0 Sim Model Editor: Initialize all IBIS models as IBIS devices 2022-11-19 01:55:38 +01:00
Mikolaj Wielgus
28e978ccc9 Sim Model Editor: Fix switching to NONE model in the SME 2022-11-18 09:03:41 +01:00
Mikolaj Wielgus
e7c43ca20a Sim: Remove inference from Reference and Value 2022-11-18 08:39:15 +01:00
Mikolaj Wielgus
b288e162d2 Sim Model Editor: Remove Override checkbox 2022-11-13 02:13:44 +01:00
Mikolaj Wielgus
d66d810edc Sim Model Editor: Use SIM_LIB_MGR to store instance models 2022-11-12 23:27:22 +01:00
Fabien Corona
0d78ca8b1a Ibis: GUI fixes 2022-11-12 14:39:36 +00:00
Mikolaj Wielgus
4caa65d100 Sim Model Editor: Don't use shared_ptr 2022-11-12 04:29:07 +01:00
Mikolaj Wielgus
fef6eaa8ba Sim Model Editor: Don't use shared_ptr to hack around lifetimes 2022-11-12 03:15:27 +01:00
jean-pierre charras
05336798ac try to fix a wx3.0/wx3.1 compatibility 2022-11-07 20:28:00 +01:00
Mikolaj Wielgus
e8762da4f4 Revert "Support for variable references in SPICE models."
This reverts commit 95ebfeeed1ae05d308efff2f24319283b755db37.
This reverts commit 672ce650a9d19f90d73dfa974b6b937e4bb2a9a7.
2022-11-07 19:37:40 +01:00
Jeff Young
095f02e6ef Fix encoding issues in Simulation Model dialog's property grid. 2022-11-07 15:03:18 +00:00
Jeff Young
95ebfeeed1 Support for variable references in SPICE models.
Also fixes a couple of bugs where sheet instance data wasn't being
handled correctly.
2022-11-07 10:57:34 +00:00
Jeff Young
2899ee1eb4 Restore labelling and layout changes lost in revert. 2022-11-05 16:50:54 +00:00
Jeff Young
1737a3b94e Fix bugs where values didn't get commited to param grid.
This would happen if you click on another grid cell after changing
a value, or clicking OK in the dialog.  The old value would get
saved and the new value lost.
2022-10-31 14:09:30 +00:00
Jeff Young
6390c28737 Don't conflate instance and ibis widgets. 2022-10-31 14:09:30 +00:00
Jeff Young
20a4d76635 Reduce line-breaking. 2022-10-31 14:09:30 +00:00
Mikolaj Wielgus
355d5014f5 Revert changing inference checkbox to radio button
Reverts 5e1561fc22ea77e7e8cee733ae6f2cd23db5bace
and 6c84e0c2f048a458682827289c722a7743e68d25.
2022-10-31 07:29:38 +01:00
Jeff Young
5e1561fc22 Some bug fixes for inferred models. 2022-10-29 18:44:49 +01:00
Jeff Young
6c84e0c2f0 Dialog changes for inferred models. 2022-10-29 17:08:06 +01:00
Jeff Young
fb8493d0bc Move model pin editor to GRID_CELL_ICON_TEXT_POPUP.
wxChoice is hopeless on Mac (it still doesn't highlight on rollover),
and using a char for the "assigned" graphic isn't great.
2022-10-28 15:27:00 +01:00
Jeff Young
a42c60d493 Less repetition in pin numbers. 2022-10-28 15:27:00 +01:00
Jeff Young
f3ba10ac67 Usability improvements to Pin Assignments in Sim Model dialog.
Fixes https://gitlab.com/kicad/code/kicad/issues/12720

Fixes https://gitlab.com/kicad/code/kicad/issues/12721
2022-10-28 00:34:24 +01:00
Jeff Young
a9a2cc3e84 Enhance readability of Simulation Model dialog. 2022-10-27 00:01:38 +01:00
Fabien Corona
20b63f305e Sim: Ibis improvements and fixes
Follow-up after the KIBIS and KIBIS GUI merge requests.

- Move KIBIS from Pcbnew to Eeschema space,
- Make KIBIS obtain the Ku/Kd coefficients via the `SPICE_SIMULATOR` class instead of calling the `ngspice` executable via `system()`,
- Allow to toggle between differential and single-ended model in the GUI,
- Various GUI fixes and improvements.
2022-10-25 09:45:40 +00:00
Mikolaj Wielgus
958bd1897d Sim: Add potentiometer model 2022-10-22 04:33:52 +02:00