Commit Graph

856 Commits

Author SHA1 Message Date
Jeff Young 30c2049977 Handle inference of V7 symbol lib DC voltage/current sources.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/15127
2023-07-07 16:25:05 +01:00
Jeff Young bde9c2cbc5 ADDED FFT analyses.
CHANGED abandon the unpredictable behaviour of the Simulation Command
dialog.  You now separately add simulation tabs (which have invariant
command types once created), and the dialog edits the current tab.

Also a bunch of bug fixes to make multiple simulation plots actually
work.
2023-07-07 12:33:50 +01:00
Jeff Young d5d2800b03 Sort out terminology issues between vectors and plots. 2023-07-07 12:33:50 +01:00
Jeff Young 443a5dc3bb Syntax help for SPICE functions. 2023-07-07 12:33:49 +01:00
Jeff Young e494017b54 Fix merge error. 2023-07-04 18:53:15 +01:00
Fabien Corona 886a7c2c04 ADDED: S-parameters simulation 2023-07-04 16:01:12 +00:00
Jeff Young d563d66b86 ADDED Fourier analyses of .tran data. 2023-07-04 16:54:38 +01:00
Jeff Young 492ef62053 ADDED support to save contributions from all noise generators.
You must first check the checkbox in the Simulation Command dialog,
after which the signals will appear in the User Defined Signals
autocomplete lists.
2023-07-04 11:05:10 +01:00
Jeff Young 7d3fa8fb4e Plotting for noise simulations.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/2369
2023-07-03 23:12:28 +01:00
Jeff Young 80340c607c ADDED noise simulation GUI. 2023-07-03 16:26:20 +01:00
Seth Hillbrand 7779a01d48 SIM_VALUE stores significants in 64-bit
stol isn't neccesarily 64-bit though, so we use stoll and catch the
overflow if we have bad input data

Fixes KICAD-2EF
2023-06-29 09:50:27 -07:00
Fabien Corona 8abb701727 IBIS: model type should not be case sensitive
Fixes #15068
2023-06-28 22:49:41 +02:00
Ian McInerney 2fb6f19a84 Separate immediate and delayed action dispatch
Using a boolean argument just leads to a lot of trailing booleans in the
function calls and is not user friendly. Instead, introduce PostAction()
to send an action that runs after the coroutine (equivalent to passing
false or the default argument), and leave RunAction as the immediate
execution function.
2023-06-27 00:57:59 +01:00
Jeff Young 7138e8a62e Don't double-create pins when migrating old models. 2023-06-21 16:34:35 +01:00
jean-pierre charras a9fff82664 spice_library_parser: catch an exception thrown when a spice model cannot be built.
Fixes #15012
https://gitlab.com/kicad/code/kicad/-/issues/15012
2023-06-20 10:26:42 +02:00
Jeff Young 5b12b5d031 Cleanup. 2023-06-19 23:03:01 +01:00
Jeff Young 0b58fdb910 Use KIUI to specify the simulation plot axis fonts.
Also fixes a bug in generating the x-axis for the first trace.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/14997
2023-06-19 22:53:08 +01:00
Jeff Young 9199d7a781 Update simulation results as the sim runs.
Also adds a time axis which grows by 2X at a time rather than to the
size of the current data.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/11255
2023-06-18 16:52:11 +01:00
Jeff Young b1d5da3da3 Allow ngspice to run in the background.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/14085
2023-06-17 23:54:33 +01:00
Jeff Young 150e2b8a19 Separate BITMAP2CMP_PANEL from BITMAP2CMP_FRAME.
This is primarily to allow wxFormBuilder to create the panel without
the dangerous hack of passing a wxWindow ID into KIWAY_PLAYER's ctor.
2023-06-15 17:39:10 +01:00
Jeff Young abc0c19d64 Separate SIMULATOR_PANEL from SIMULATOR_FRAME.
This is primarily to allow wxFormBuilder to create the panel without
the dangerous hack of passing a wxWindow ID into KIWAY_PLAYER's ctor.
2023-06-15 17:39:10 +01:00
Jeff Young 5c4ca9f092 Renaming to support potential future usage of SIMULATOR_PANEL as a panel within SIMULATOR_FRAME. 2023-06-15 17:39:10 +01:00
Jeff Young 46564055f4 More protection around an exceedingly dangerous hack.
The API is needed for wxFormBuilder, and I couldn't figure out any
way around it, but we can at least reduce the risk of someone calling
it accidentally (again).
2023-06-14 12:52:49 +01:00
Jeff Young e698156975 Upgrade many editing actions to SCHEMATIC_COMMIT. 2023-06-09 22:41:47 +01:00
Jeff Young 5875f89531 Centralize text size clamping.
Also introduces alg::clamp to improve readability of
std::max( min, std::max( value, max ) )

Fixes https://gitlab.com/kicad/code/kicad/-/issues/14876
2023-06-03 20:29:51 +01:00
Wayne Stambaugh bdee545841 Coverity warning fixes. 2023-06-03 07:28:17 -04:00
jean-pierre charras 68464a1993 Simulator: add missing ngspice models.
Fixes #14813
https://gitlab.com/kicad/code/kicad/-/issues/14813
2023-05-26 14:46:51 +02:00
Jeff Young 03486443c7 Fix more SPICE case-insensitivity bugs.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/14793
2023-05-22 11:46:28 +01:00
Mark Visser 0d235ac64b fix bug whereby spice params with capital letters no longer cause an error and data loss
Spice parameters were converted to lower-case before comparison. This is incorrect, as it
is legal and common for spice parameters to contain capital letters (e.g. potentiometers
typically use Rt and SET as their parameters).
Spice parameters are not case sensitive, so the correct behaviour is to instead do a
case-insensitive comparison on the parameter name.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/14793
2023-05-21 17:50:35 -04:00
Jeff Young 502da2d03c Performance improvements. 2023-05-21 11:23:56 +01:00
Marek Roszko aa230b4e08 Breakup sim_model_ngspice_data.cpp into multiple files to avoid unreasonable compiler link times 2023-05-20 19:58:46 -04:00
Jeff Young 58f4943597 ADDED voltage- & current-controlled voltage & current sources
Added GUI support for ngspice VCVS, VCCS, CCVS and CCCS.
2023-05-20 21:04:39 +01:00
Marek Roszko 7774b75172 Another set of C5266 warning fixes 2023-05-18 22:46:57 -04:00
Graham Keeth df3560ab8e sim: fixup some diode parameter units 2023-05-10 23:09:13 +00:00
Graham Keeth 2970d97bf2 sim: fix diode model default breakdown voltage 2023-05-10 23:09:13 +00:00
Jeff Young b41d446f58 Fix a bunch more issues with sheetpaths and allowExtraText.
A sheetpath is required to correctly resolve text variables.
Depending on currentSheet is rife with bugs.

There are many places where we do *not* want to be prepending
field names to the field values, such as netlisting,
building PDF hypertext menus, etc.

Also, Find/Replace needs to work on unresolved text, as
that's what we're going to display (and if replace nuked
your variable references you wouldn't be happy).
2023-05-05 17:23:52 +01:00
jean-pierre charras 2aa9ea87eb Simulator: when using Incremental Connectivity, ensure the netlist is up to date 2023-05-03 18:59:18 +02:00
Jeff Young d5cb100f72 Fix sheetPath handling in SPICE model generation. 2023-04-28 16:19:14 +01:00
Jeff Young 69500bfcaa LTSpice schematic import based on the work of Chetan Shinde. 2023-04-24 13:52:52 +01:00
Jeff Young 60b019591d Simulator fixes.
1) Don't read libraries multiple times
2) VDMOS default is nchan if not specified
3) In the absence of a workbook default to LTSpice compatability
4) Don't attempt to write out a model line for a subckt; it never has
a baseModel
2023-04-24 13:52:52 +01:00
Jeff Young c2cc27c25c Formatting. 2023-04-24 13:52:52 +01:00
Jeff Young c381b6d024 More robust file reading for simulator files. 2023-04-24 13:52:52 +01:00
Jeff Young 51b6ec0dce Don't exit KiCad when simulator window is closed. 2023-04-18 23:55:56 +01:00
Jeff Young 02c5a31b99 Fix close button on simulator frame.
Fixes https://gitlab.com/kicad/code/kicad/issues/14551
2023-04-16 23:45:18 +01:00
Jeff Young d01c023d5a Retire the lib-tree scoring algorithm.
It appears to cause more confusion than help.

Fixes https://gitlab.com/kicad/code/kicad/issues/13905
2023-04-14 23:35:27 +01:00
jean-pierre charras f56e569a25 Ensure we do not use a non existing pin in SIM_MODEL::MigrateSimModel()
Fixes #14522
https://gitlab.com/kicad/code/kicad/issues/14522
2023-04-12 09:37:59 +02:00
qu1ck 0c049eccc7 Fix a bunch of compiler warnings 2023-04-11 17:01:30 +00:00
Wayne Stambaugh 28776f5745 Text attributes object improvements.
* Add compare method to COLOR4D object.
* Add unit test to validate COLOR4D comparison method.
* Add missing color test in text attribute comparison method.
* Add unit test for text attribute object.
* Remove unnecessary headers from text attribute header.
* Move text attribute code into separate source file.
2023-03-29 12:53:45 -04:00
Jeff Young 1788db53e5 Don't complain about no sim model when running Sim Model Editor dialog.
Also removes some atrophied code, and makes sure changes to the parameter
grid for raw spice models gets saved.
2023-03-25 20:22:04 +00:00
Jeff Young 60aadfee40 Move separation of model name from params earlier in the process.
We need just the model name when we look for a match in the library file.
2023-03-25 12:45:36 +00:00