Commit Graph

253 Commits

Author SHA1 Message Date
Jeff Young 0e778f17db Add context menu for simulation cursors.
Fixes https://gitlab.com/kicad/code/kicad/issues/13580
2023-01-19 12:50:21 +00:00
Stefan Brüns 1df81b10e6 Explicitly convert std::string to wxString
In wxWidgets STL builds the compiler has multiple, ambigous choices
for converting - both arguments to std::string first, or just the
first to wxString.

Fixes #13432.
2023-01-14 22:58:54 +00:00
Jeff Young 098d2b30a2 Support for simulation options in workbook and simulation command dlg.
Fixes https://gitlab.com/kicad/code/kicad/issues/13524

Fixes https://gitlab.com/kicad/code/kicad/issues/13523

Fixes https://gitlab.com/kicad/code/kicad/issues/13431
2023-01-14 00:21:45 +00:00
Jeff Young 7fbad183db Gracefully handle Quit when simulator window is open. 2023-01-13 16:35:45 +00:00
Jeff Young 4391fc7a7a Don't be annoying about refusing to create traces when there's no data. 2023-01-13 16:35:45 +00:00
Jeff Young ef6001bfe6 Use consistent terminology: opposite of Add is Remove.
Note: violating string freeze because this change should ease translation,
not make it harder.
2022-12-28 10:40:23 +00:00
Jeff Young e11d39b0f2 If magnitude or phase is specified, don't add both.
Fixes https://gitlab.com/kicad/code/kicad/issues/13202
2022-12-28 10:40:23 +00:00
Jeff Young 80f3abe082 Event safety.
Sentry crash probably happens when an update title event fires either
too early or too late to have a simulator or simulator settings.

Sentry issue https://sentry.io/organizations/kicad/issues/3669444623/events/fce0179f7d5e4ff3a7dbb0d90a0570b4/
2022-12-26 20:33:04 +00:00
Jeff Young bf1c4e7bcd Allow translation of simulation error messages. 2022-12-24 11:30:56 +00:00
Jeff Young 6f44468385 Fix more lifetime issues in simulator tuning.
Fixes https://gitlab.com/kicad/code/kicad/issues/13257
2022-12-23 22:03:24 +00:00
Jeff Young 8069e5d5d6 Fix sim bug running a command the first time when no command in doc.
Fixes https://gitlab.com/kicad/code/kicad/issues/11366
2022-12-23 18:21:26 +00:00
Jeff Young bfd3b40672 Bug fixes for tuning.
1) Don't save SCH_ITEM pointers in long-lived structures.  Use KIIDs
   instead.

2) Use the correct sheet for the referenced item, not the current sheet.
2022-12-23 17:40:36 +00:00
Jeff Young 77998d7c51 Better fix for not selecting all of netlist. 2022-12-14 14:13:25 +00:00
Jeff Young 13d9b061ee Don't select all of netlist when showing it in simulator. 2022-12-14 13:36:29 +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 419fe236ad Fix logic error in parsing sim command, and DC source types in dialog.
Fixes https://gitlab.com/kicad/code/kicad/issues/9064
2022-12-11 23:12:55 +00:00
Jeff Young 9c129ed03f More dialog adjustments for wx 3.2. Also renames files to match dialog. 2022-12-11 15:49:29 +00:00
Jeff Young 56aae7a147 Reduce compiler warnings. 2022-12-11 13:39:59 +00:00
Jeff Young 3581a9773f Move simulator settings disposal earlier so it happens before parent.
Fixes https://gitlab.com/kicad/code/kicad/issues/12370
2022-12-11 01:32:20 +00:00
Jeff Young bb6544914e Bring simulator file menu commands more in line with rest of Kicad. 2022-12-08 23:57:42 +00:00
Jon Evans 5251ea6f27 Prevent crash on exit due to simulator settings being double freed 2022-12-07 21:04:49 -05:00
Jeff Young 4872dd7238 Don't put empty lines in the workbook.
Fixes https://gitlab.com/kicad/code/kicad/issues/12299
2022-12-07 11:39:47 +00:00
Jeff Young f8e0a272c0 Remove a bunch of 'auto'. 2022-12-06 16:01:18 +00:00
Fabien Corona 4c76082f77 "Sim Params/Settings" -> "Sim Command"
The window only really sets the simulation command.
In the future, we might want a simulation setting window with things such as SPICE optimizations.
2022-12-05 23:12:04 +00:00
Jeff Young 8e4cd1e1a6 Check for sheet directive changes when running simulations.
Fixes https://gitlab.com/kicad/code/kicad/issues/10486
2022-12-05 20:03:42 +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 e09e521162 Remove GUI calls from netlisting. 2022-11-18 15:29:16 +00:00
jean-pierre charras b9ac486000 simulator: remove unused includes, and reorder a few includes to fix conflicts
Conflicts happen only on msys2 with wxWidgets 3.0. But this minor reorder
allows me to test Kicad compilation with "old" wxWidgets, used on Linux.
2022-11-16 10:09:54 +01:00
jean-pierre charras 7c9f3981ef Revert "Reorder includes is some simulator files to fix issues on msys2 (no code change)"
This reverts commit 78e45fa1b9.
Looks like it creates a compil issue on MSVC
2022-11-12 20:47:36 +01:00
jean-pierre charras 78e45fa1b9 Reorder includes is some simulator files to fix issues on msys2 (no code change)
Due to pegtl.hpp included in some files, reordering include fix some conflicts:
wxWidgets files must be included before pegtl.hpp, to compile with wxWidgets 3.0
I sometimes use wxWidgets 3.0 for debugging purposes.
2022-11-12 19:54:26 +01:00
Jeff Young ece752d5a2 Move annotation error reporting to preflight before simulation.
Fixes https://gitlab.com/kicad/code/kicad/issues/9220
2022-11-08 12:13:15 +00:00
Jeff Young 5af506777c Formatting and wxT 2022-11-08 12:13:15 +00:00
Mikolaj Wielgus e8762da4f4 Revert "Support for variable references in SPICE models."
This reverts commit 95ebfeeed1.
This reverts commit 672ce650a9.
2022-11-07 19:37:40 +01: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
Mikolaj Wielgus 9b6cc6c505 Sim: Fix tuners 2022-10-24 11:04:47 +02:00
jean-pierre charras 63002cec57 Do not add a title/comment in mandatory field strings when writting netlists.
This is mainly for "Sheetfile" property because current it is the only one
that has a title when plotting/drawing it.
2022-10-22 12:50:26 +02:00
Mikolaj Wielgus 958bd1897d Sim: Add potentiometer model 2022-10-22 04:33:52 +02:00
Mikolaj Wielgus 952f3da53f Sim: Only set sim command if the sheet sim command is different 2022-10-19 03:02:32 +02:00
Mikolaj Wielgus f68df09696 Sim: Fix analysis set from GUI 2022-10-19 02:32:50 +02:00
Mikolaj Wielgus d9eb76eae0 Sim: Refactor SPICE_GENERATOR methods to accept a single SPICE_ITEM 2022-10-11 02:22:59 +02:00
jean-pierre charras 7584ccc758 Fix duplicate variable member m_userUnits, creating issues depending on
the way it was acceded (by name or by accessor).
2022-09-26 19:47:28 +02:00
Mikolaj Wielgus 545212eb13 Sim Window: Support dark theme 2022-09-16 06:57:27 +02:00
Mikolaj Wielgus ce3fe46751 Sim Window: Display latest netlist without having to run sim
Fixes https://gitlab.com/kicad/code/kicad/issues/11787
2022-09-16 03:12:28 +02:00
Mikolaj Wielgus 300a1c4144 Add a new schematic exporter to Spice .subckt model
An option to use the current sheet as root is added to both the original
and new (.subckt model) exporters.
2022-09-09 16:18:48 +02:00
jean-pierre charras f679400e91 simulator: fix a issue when the simulation ends, but ngspice is still running.
For instance if a lot of simulation results must be written to a file (using wrdata).
In this case the tools in simulator frame toolbar were never enabled.
2022-08-31 12:07:05 +02:00
Wayne Stambaugh 898ec0d094 Fix wxWidgets 3.1 and later deprecated build warnings.
wxWidgets 3.1 has deprecated wxPATH_NORM_ALL when normalizing file
paths when calling wxFileName::Normalize().  This change keeps the
existing behavior except in places where our own internal
ExpandEnvVarSubstitutions() to expand environment variables.
2022-08-15 08:00:40 -04:00
Mikolaj Wielgus 7cf5138c63 Sim: Bugfixes, mostly for MS Windows compilation errors
Unfortunately, Windows headers define a lot of macros for common words,
so we had to rename some enums to not collide.

We also fix some of the many bugs related to the new simulation
architecture and the Spice Model Editor dialog.
2022-07-30 02:25:34 +00:00
Mikolaj Wielgus 739b9255d9 Sim Model Editor improvements
- Tab-switching,
- Automatic expansion of categories on tab-switch,
- Various minor simulation improvements,
- Various new simulation-related bugfixes.
2022-07-30 02:25:34 +00:00
Mikolaj Wielgus 6450ec6b85 Sim: Spice netlist exporter rewrite
Rewrite the spice exporter to work with the new simulation model
architecture and data model, with many bugfixes related to the latter
two along the way.
2022-07-30 02:25:34 +00:00
Seth Hillbrand 93fb00d815 Protect the Kiway dereference
Also find a few more places where we are reaching into a new frame to
perform actions that need to have dialogs closed.

Running actions should also wait for the next cycle rather than being
immediately executed when we are calling into a new frame.  This allow
for the cleanup actions onClose() to happen prior to the next action
starting

Fixes https://gitlab.com/kicad/code/kicad/issues/11891
2022-07-14 11:37:45 -07:00