Commit Graph

213 Commits

Author SHA1 Message Date
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
Mikolaj Wielgus 4f384085e2 Remove m_simulator null-check -- most of code already assumes it exists 2021-07-13 11:52:09 +00:00
Wayne Stambaugh dffe2661e6 Fix SPICE simulator plot bug.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/1944
2021-07-09 16:20:35 -04:00
Mikolaj Wielgus 43cce8b0b5 Remove automatic simulation start on simulator launch
Fixes https://gitlab.com/kicad/code/kicad/issues/8644
2021-07-06 10:08:19 +00:00
Mikolaj Wielgus 8b2b3ca797 Define .wbk in wildcards_and_files.{cpp,h}, cosmetic code changes 2021-07-04 14:04:03 +00:00
Mikolaj Wielgus df2d4966b1 Do not set dirty bit on simulator launch, remove dead code 2021-07-04 14:04:03 +00:00
Mikolaj Wielgus 87441e256c Escape CR and LF in Spice simulation command when saved 2021-07-04 14:04:03 +00:00
Mikolaj Wielgus bd1f3d85f4 Spice sim: Have more detailed error messages 2021-07-04 14:04:03 +00:00
Mikolaj Wielgus 86c7db46b9 If there is no project name, default workbook name shall be "noname.wbk" 2021-07-04 14:04:03 +00:00
Mikolaj Wielgus 28531a982d Simulator: Use SIM_WORKBOOK in place of wxAuiNotebook
SIM_WORKBOOK is now a subclass of wxAuiNotebook, removing the problem of
having to maintain two separate workbook states.
2021-07-04 14:04:03 +00:00
Mikolaj Wielgus cd0c8a5676 Make panel sim command only accessible from outside through workbook object 2021-07-04 14:04:03 +00:00
Jeff Young c07367821e Fix compile error, and use more robust method of setting fonts. 2021-06-29 19:36:06 +01:00
Jeff Young 0c2ac9a711 Move GUI font code to common.
This also allows the Mac fixes for font facenames to be more
compartmentalized.

Fixes https://gitlab.com/kicad/code/kicad/issues/8657
2021-06-29 18:27:58 +01:00
Jeff Young 4aa8318dc2 More error message regularization. 2021-06-27 14:24:02 +01:00
Jeff Young 173c9a974c Formatting. 2021-06-25 20:49:38 +01:00
Jeff Young 685ee31c35 Workaround a few more OSX printf problems.
Also regularizes the frame title processing.

Also fixes a type where the library name wasn't processed for
variable expansion.

Fixes https://gitlab.com/kicad/code/kicad/issues/7742
2021-06-20 22:48:19 +01:00
Wayne Stambaugh fbc135e69f Rename SCH_COMPONENT to SCH_SYMBOL. 2021-06-10 10:34:49 -04:00
Sylwester Kocjan b0e6bbb39c eeschema: remove m_simCommand from SIM_WORKBOOK 2021-06-07 20:00:48 +00:00