Commit Graph

8323 Commits

Author SHA1 Message Date
Mikolaj Wielgus 24e7a8ac41 Commit missing eeschema/sim/sim_model_ngspice_data.cpp 2022-08-05 18:51:52 +02:00
Mikolaj Wielgus c9f3507ff7 Sim: Don't require ngspice.h for SIM_MODEL_NGSPICE 2022-08-05 18:26:09 +02:00
Jeff Young 2b1cfd6a74 ADDED support for NET_NAME, SHORT_NET_NAME and NET_CLASS system vars.
They can be used in fields of any of the label types.

Fixes https://gitlab.com/kicad/code/kicad/issues/12158
2022-08-04 18:07:25 +01:00
jean-pierre charras d667d9b464 Do not include and use sharedspice.h when KICAD_SPICE = OFF 2022-08-04 17:01:29 +02:00
jean-pierre charras 7441510b3c CONNECTION_GRAPH::Recalculate(): ensure unit and pin list are up to date.
Multi-unit symbols created previously incorrect connections, due to not
up to date or missing data. I also saw crashes due to this not up to date data
Fixes #12149
https://gitlab.com/kicad/code/kicad/issues/12149
2022-08-03 17:21:16 +02:00
Jeff Young ced55583a6 Back out unordered_map change for SCH_ITEM.
We're sensitive to the ordering in this one.

Also fixes a problem with the unit tests when KICAD_SPICE=OFF.
2022-08-03 14:29:34 +01:00
Jeff Young 96f01d33c8 Performance improvements.
1) Move a bunch of std::map's to std::unordered_map to get constant-time
look-ups
2) Lengthen progress-reporting intervals to spend more time doing work
and less time talking about it
3) Reverse order of SHAPE_LINE_CHAINs in thermal intersection checks to
make (much) better use of bbox caches
4) Don't re-generate bboxes we already have
5) Fix some autos that weren't by reference (and were therefore copying
large datasets)
6) Rename delta progressDelta so it's easier to search for in future
7) Get rid of a few more autos (because I don't like them)
8) Pass large items to lambdas by reference

Fixes https://gitlab.com/kicad/code/kicad/issues/12130
2022-08-03 11:59:42 +01:00
Mikolaj Wielgus a14d3e74a8 Remove generate_ngspice_models.bash script 2022-08-02 14:50:02 +02:00
Mikolaj Wielgus 5d64fc12a1 Attempt to fix GCC MSYS2 build crash
Initialize ngspice_models.cpp structures at runtime on demand. Use
a sequence of std::vector::emplace_back() instead of
brace-initialization.
2022-08-02 14:47:28 +02:00
jean-pierre charras c815847b1e DIALOG_SIM_MODEL: fix some issues (not all)
* internationalize
* fix min size
* show lib filename in a not editable wxTextCtrl instead of a wxStatic Text
2022-08-02 12:52:22 +02:00
Jeff Young 6f49b57f9b Cleanup & performance enhancements. 2022-08-01 13:09:51 +01:00
Seth Hillbrand 225b03d702 Move sheetpins by their connection point
Need to calculate the sheet pin anchor position in order to get it
aligned to the grid while moving

Fixes https://gitlab.com/kicad/code/kicad/issues/12134
2022-07-31 20:02:57 -07:00
Seth Hillbrand 4074409890 Fix broken compile on Linux/Mac
Template instantiations need to follow the template definitions or you
don't get all of the template members, just the ones called from within
the file
2022-07-31 19:49:28 -07:00
Seth Hillbrand e8627c89df Fix initial compile error on Linux.
Still getting link error with DIALOG_SIM_MODEL
2022-07-31 16:43:52 -07:00
jean-pierre charras 578b13c041 sim/ngspice_models.cpp: compile this file always in release mode (msys2).
On msys2, this file (mainly a large amount of data) compiled in debug mode
crashes Eeschema at start (issue probably related to a memory issue).
On msys2, binaries built in debug are always *very* large
2022-07-31 17:27:48 +02:00
jean-pierre charras fc849e3e0c sim_model.h: change order of includes to avoid conflicts with a windows header.
msys2 specific. No actual change in code.
2022-07-31 10:32:31 +02:00
Mikolaj Wielgus 5e47ce8963 Fix build errors when KICAD_SPICE=OFF 2022-07-31 07:59:00 +02:00
Seth Hillbrand fe3a112396 ADDED: Allow stacked pins of the same type
Removes the need for the "KiCad" workaround where stacked pins need
to be "Passive" type.  Pins that have the same parent symbol, name,
position and type are considered to be the same output and do not
trigger ERC errors

Fixes https://gitlab.com/kicad/code/kicad/issues/5367
2022-07-30 13:16:30 -07:00
jean-pierre charras ee1d458af0 Eeschema: fix crash in SCH_SHEET_LIST::MigrateSimModelNameFields() for SCH_TXTBOX items.
Due to a typo, if a SCH_TXTBOX is in a scheet, it crashes eeschema.
2022-07-30 15:57:59 +02:00
jean-pierre charras 4915f6ca20 Fix a few compil warnings 2022-07-30 14:06:51 +02: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 6984f63af8 Sim: Transmission line models
Implement transmission line models and perform some adjustments to
the current models. Add some QA tests.
2022-07-30 02:25:34 +00:00
Mikolaj Wielgus fe38c622a9 Sim: Improvements to model serialization
Don't serialize parameters in certain models for default values. Infer
models from Value field for some kinds of models. Resolve synonyms when
loading models from Spice libraries.
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
Mikolaj Wielgus ce84a48037 Sim: Implement loading Spice library files
Implement parsing and loading Spice libraries into KiCad. This is done
without any involvement of Ngspice -- we create our own in-tree parser
using PEGTL -- because Ngspice doesn't offer any intermediate output we
could plug ourselves into. We don't parse everything -- just the library
content, so this won't be that much effort.

We implement some basic Spice code preview to give the user a hint what
Spice code eir model will correspond to.
2022-07-30 02:25:34 +00:00
Mikolaj Wielgus 978f01553b Sim Model Editor: Serialize models in fields
Implemented serialization and deserialization of models in symbol fields
through the SIM_VALUE class. We don't carry the Spice legacy of
case-insensitive suffixes, instead we conform to the SI standard (i.e. M
is Mega, not milli, P is peta, p is pico).

Parameter grid value validation is implemented by simply not allowing
any characters that will make the value invalid (instead of highlighting
the field in a red color). This will likely be changed at some point in
the future.
2022-07-30 02:25:34 +00:00
Mikolaj Wielgus c5a256291e Sim Model Editor: Display model parameters
This commit adds parameter display functionality, via a wxPropertyGrid
widget, to the Sim Model Editor. To faciliate that, a SIM_VALUE class is
created to serialize, deserialize, and validate numeric values in the
new parameter grid.

SPICE_MODEL is renamed to SIM_MODEL and split into several subclasses
that correspond to different model kinds.
2022-07-30 02:25:34 +00:00
Mikolaj Wielgus 229e5c9e0f Begin development of a new Sim Model Editor dialog
With that also begin reworking the internal structure of the simulation
model storage. Some models have parameter information extracted from
Ngspice, which was specially patched to faciliate that. The model is
stored and managed by the SPICE_MODEL class (later will be renamed to
SIM_MODEL).
2022-07-30 02:25:34 +00:00
Marek Roszko a8505d9c76 SEARCH_RESULT -> INSPECT_RESULT
To fix the name squatting it's doing for future functionality
2022-07-29 20:01:10 -04:00
Jeff Young 753f2f3e4c Display descriptions in second column of library trees.
Also fixes some bugs in how the columns are sized.

Fixes https://gitlab.com/kicad/code/kicad/issues/12090
2022-07-28 14:51:47 +01:00
Jeff Young 5295342f42 Fix another case of the instance data getting messed up.
(Or, more accurately in this case, of the instance data not getting
applied to the current view.)

Fixes https://gitlab.com/kicad/code/kicad/issues/11390
2022-07-27 12:29:01 +01:00
Jeff Young 20f6a83466 Don't leave wxWidgets to calc the height of the hierarchy navigator.
It just makes a mess of things.

Fixes https://gitlab.com/kicad/code/kicad/issues/10501
2022-07-26 18:45:02 +01:00
Jeff Young ee0f93ed17 Fix some issue with hierarchy panel on OSX.
Also moves the option toolbars tight to the canvas for all windows.

Fixes https://gitlab.com/kicad/code/kicad/issues/12087
2022-07-26 14:51:43 +01:00
Seth Hillbrand 008b4f583b Fix typo in lib_text layer id
Also adds CHECK_RET to catch similar errors in the future

Fixes https://gitlab.com/kicad/code/kicad/issues/12078
2022-07-25 17:08:16 -07:00
Mike Williams c3d952644c Annotation: fix wrong multi-unit annotation messages
SCH_SYMBOL::Unit() is updated when the symbol is on the screen, we need
to get the instance unit so it's right even if it's not being displayed /
has never been displayed.

Fixes: https://gitlab.com/kicad/code/kicad/-/issues/12050
2022-07-25 18:44:55 +00:00
Mike Williams d9449b9beb Annotation: annotate all sheet instances for new symbols
Fixes: https://gitlab.com/kicad/code/kicad/-/issues/11841
2022-07-25 18:44:55 +00:00
Mike Williams bf550afa8c Annotation: use full hierarchy for sheet based numbering on paste 2022-07-25 18:44:55 +00:00
Mike Williams 63917c4ef9 Annotation: disable use next number for page number based annotation
It's broken, so don't allow it.
2022-07-25 18:44:55 +00:00
Mike Williams 17f6c0ecf1 Annotate: correctly annotate duplicated items across reused subsheets
Fixes: https://gitlab.com/kicad/code/kicad/-/issues/11840
2022-07-25 18:44:55 +00:00
Mike Williams 8db69c2f0d Annotation: convert annotate unique to use options method 2022-07-25 18:44:55 +00:00
Mike Williams 7c979e6375 Schematic: move annotation options parsing into common function 2022-07-25 18:44:55 +00:00
jean-pierre charras 993c446fdf Fix some warnings detected by PVS-STUDIO (most are not used vars) 2022-07-25 18:23:52 +02:00
Jeff Young e10158ff10 ADDED show pin names on footprint pads when assigning to symbol.
Fixes https://gitlab.com/kicad/code/kicad/issues/4576
2022-07-24 23:41:41 +01:00
jean-pierre charras 82167a7c96 Avoid crashes when, for some reason, a dll cannot be loaded.
In this case a null pointer was returned by the internal code.
This pointer is now tested against nullptr to avoid the application crashing.
Fixes #12080
https://gitlab.com/kicad/code/kicad/issues/12080
2022-07-24 19:42:50 +02:00
Jeff Young e36491f231 Make EEschema highlight net consistent with PCBNew.
In particular, highlight net on an already highlighted net clears
highlight.

Fixes https://gitlab.com/kicad/code/kicad/issues/11016
2022-07-24 09:16:31 +01:00
Jeff Young 0e07ce9d2e Minor dialog cleanup.
Fixes https://gitlab.com/kicad/code/kicad/issues/11517
2022-07-24 09:09:25 +01:00
Jeff Young 8b7d4a8869 Minor dialog cleanup. 2022-07-24 08:59:37 +01:00
jean-pierre charras 0604d7b813 Fix minor compil and Coverity warnings. 2022-07-24 09:33:43 +02:00
Jeff Young 3aabea5191 Add side handles to sheets.
Fixes https://gitlab.com/kicad/code/kicad/issues/11525
2022-07-23 23:57:31 +01:00