Commit Graph

230 Commits

Author SHA1 Message Date
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
Eduardo Behr f246646d7a Fix severe simulation memory leaks 2022-05-28 20:40:24 +00:00
Jeff Young cb15bd1635 Fix compile issue. 2022-05-26 10:54:54 +01:00
Seth Hillbrand 11ae5b75b7 Remove broken assert
Fixes compile issue for linux/gcc which expects a boolean in the assert
statement that it cannot find from std::map
2022-05-25 16:36:47 -07:00
Eduardo Behr 6aa50304d9 Eeschema: Fixing simulation plot CSV exporter 2022-05-25 15:00:03 +00:00
Sylwester Kocjan 05fbe47a1b eeschema: two fixes for simulation tuners
- fix irrelevant warning message box when tuners moved
  too quickly and simulation was slow
- fix for rerun simulation when tuning and result tab was changed
2022-04-02 15:05:54 +00:00
Sylwester Kocjan 4719fdc9bf eeschema: rename m_exporter to m_circuitModel 2022-04-01 19:28:31 +00:00
Sylwester Kocjan f5dedd77c6 eeschema,sim: add SIMULATOR and SIM_MODEL interface
SIMULATOR has now an Attach() method, which should be called
with proper SIMULATION_MODEL that should be simulated, before calling Run()

Concrete class of SIMULATION_MODEL for ngspice is NGSPICE_CIRCUIT_MODEL,
renamed from NETLIST_EXPORTER_PSPICE_SIM. DIALOG_SIM_SETTINGS relies
on above mentioned object, so it was added as an argument of the constructor.
2022-04-01 19:28:31 +00:00
Sylwester Kocjan 53ccd8bd67 eeschema,sim: refactor NETLIST_EXPORTER_PSPICE_SIM creation 2022-03-26 15:50:15 +00:00
Sylwester Kocjan 2fed8aa4b8 eeschema: Add sync functions to SPICE_SIMULATOR
SPICE simulator can be called also during IBIS model determination,
and in the future in ERC. Therefore a necessity arises to implement
exclusive access.
2022-03-21 19:10:08 +00:00
Frank Zeeman f004665df8 Add tuner support for potentiometer code model 2021-12-28 02:53:39 +01:00
Mikolaj Wielgus 2dbc6ef6ca If present, tune Spice_Model instead of Value
Fixes https://gitlab.com/kicad/code/kicad/issues/9880
2021-12-14 14:02:25 +01:00
Seth Hillbrand 9e760512ac Update schematic when saving tuned value
Also avoids a known(!) crash when the existing item has been deleted
while tuning.

Fixes https://gitlab.com/kicad/code/kicad/issues/9502
2021-11-01 17:05:22 -07:00
Jeff Young 5f5ee7335d Formatting. 2021-10-01 21:49:14 +01:00
Sylwester Kocjan fe608bfcef eeschema, sim: clean signal list when last panel is closed
Fixes: https://gitlab.com/kicad/code/kicad/-/issues/9119
2021-09-09 01:11:47 +00:00
Sylwester Kocjan f9c5c97f74 eeschema, sim: fix wrong names of the signals
Fixes: https://gitlab.com/kicad/code/kicad/-/issues/9062
2021-09-08 23:15:29 +02:00
Mikolaj Wielgus 44ea3a75f2 Simulator: Use last workbook path stored in .kicad_pro as initial path in dialogs
Previously this was done using a static variable, which was not loaded
from .kicad_pro on simulator launch, causing unexpected behavior

Fixes https://gitlab.com/kicad/code/kicad/issues/8799
2021-08-20 23:23:23 +00:00
Jeff Young 6aaf4413b3 Fix kicad_string.h / string.cpp mismatch.
They don't define a KiCad string class, so the header file name was
somewhat misleading. But the fact that they didn't match definitely
made coding more difficult.
2021-07-29 16:03:25 +01:00
Wayne Stambaugh 1a301d8eea Stop using wxDialog::EndModal() from inside dialogs.
Calling wxDialog::EndModal() directly from inside the dialog is a
potential bug if the dialog is shown in the modeless or window modal
(quasi-modal).  Use the internal button events where possible and
check for the appropriate mode before calling the correct end dialog
function.
2021-07-21 17:38:14 -04:00
Wayne Stambaugh cb72da294a More NULL expunging. 2021-07-16 16:13:41 -04:00
Mikolaj Wielgus 395602b12a Use Bind() instead of Connect() for simulator events
Also fixed "Settings..." menu item not starting settings. I don't know
why it's called `m_boardAdapter`.
2021-07-13 11:52:09 +00:00
Mikolaj Wielgus c6a4f25538 Use wx events to update simulator title, start tools and menu items grayed out 2021-07-13 11:52:09 +00:00
Mikolaj Wielgus 3bafe6d6c9 Gray out unavailable simulator menu items, use wxUpdateUIEvent 2021-07-13 11:52:09 +00:00
Mikolaj Wielgus 4f2856b345 Gray out unavailable tools in simulator toolbar
Cures some of the dialogitis plaguing the simulator.
2021-07-13 11:52:09 +00:00