Commit Graph

254 Commits

Author SHA1 Message Date
Mikolaj Wielgus 39ac58ea33 Use the PEGTL grammar for detecting .control and .subckt text directives 2022-08-30 17:27:58 +02:00
jean-pierre charras 767be75cac Netlist spice creation: fix serious issues.
* fix broken float values in countries using a comma as separator (missing LOCALE_IO switch)
* fix regression that ignored the pseudo directive Kxx Lyy Lzz nn (coupling factor)
* fix regression that created empty blocks for .subckt and .control
2022-08-30 11:06:50 +02:00
Mikolaj Wielgus e82ff4de73 Remove the old netlist_exporter_pspice.cpp file 2022-08-29 05:39:09 +02:00
Mikolaj Wielgus 963900ab83 Sort sim model pins by symbol pin number in sim model dialog 2022-08-26 04:36:48 +02:00
Mikolaj Wielgus a0400791c0 Fix exporting Spice instance lines for multi-part symbols
Only pins from the current symbol part were used: the rest was
incorrectly set to Not Connected.

Also slightly change generation of names for Not Connected nets.
2022-08-25 08:47:31 +02:00
Mikolaj Wielgus 6fad25f8ed Allow mapping sim model pins to arbitrary string symbol pin numbers
This change removes the incorrect assumption that symbol pin numbers are
integers and are the same as indexes in the vector storing the symbol
pins.

"~" is now used to denote a floating sim model pin.
2022-08-22 08:13:26 +02:00
Mikolaj Wielgus 0040ffc567 Convert strings to UTF8 before they are input to PEGTL
Otherwise there are QA failures under non-UTF-8 locales.
2022-08-10 14:20:52 +02:00
jean-pierre charras b5c83ffd95 Eeschema, slash in power pin name: better fix than commit ba7a06f5.
ba7a06f5 tried to fix a (minor) issue in net names when the name was coming
from a input power pin having a '/' in name. But ba7a06f5 blindly escaped any '/'
in net name, and the hierarchy info was lost.
Now only the pin name is escaped (like any other pin name used in net names)
2022-08-10 11:00:19 +02:00
jean-pierre charras 574783bf70 netlist_exporter_spice: cleanup data lists when rerun the netlister.
It avoid duplicate includes when rerun the simulator.
Avoid also duplicate includes found in symbols.
Fixes #12192
https://gitlab.com/kicad/code/kicad/issues/12192
2022-08-09 20:52:06 +02:00
jean-pierre charras 4f7d7013e0 netlist_exporter_spice: fix crash when re-run the simulator after a schematic change.
Fixes #12142
https://gitlab.com/kicad/code/kicad/issues/12142
2022-08-09 18:33:54 +02:00
Jeff Young ba7a06f52e Escape netnames with illegal characters in them.
Fixes https://gitlab.com/kicad/code/kicad/issues/12194
2022-08-09 15:05:10 +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
Jeff Young 6f49b57f9b Cleanup & performance enhancements. 2022-08-01 13:09:51 +01: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
Jeff Young 5479514819 Honour m_resolveTextVars flag for properties as well as fields.
Fixes https://gitlab.com/kicad/code/kicad/issues/11937
2022-07-08 17:27:05 -06:00
jean-pierre charras 2701642b1b minor fixes and French translation update 2022-05-30 11:23:20 +02:00
Fabien Corona 0536ab4f6c Remove kicad_pair in transmission lines
This was a misread from the ngspice doc
2022-05-25 00:00:07 +00:00
Seth Hillbrand a56955443f Fix botched commit
(cherry picked from commit ba276fe470)
2022-05-02 16:29:07 -07:00
Seth Hillbrand 2079d15b3f Catch IO_ERRORs that we throw
FILEOUTPUT_FORMATTER likes to throw when it gets an issue.  We need to
catch this to avoid the app falling apart

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

(cherry picked from commit 4d47857738)
2022-05-02 15:15:52 -07:00
Seth Hillbrand 5d5a2f9270 Allow common greek letters in passive regex
Adds common letters (µ and Ω) as prefix and unit

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

(cherry picked from commit 15fe2f2fd0)
2022-04-01 12:51:43 -07:00
Sylwester Kocjan 53ccd8bd67 eeschema,sim: refactor NETLIST_EXPORTER_PSPICE_SIM creation 2022-03-26 15:50:15 +00:00
Jeff Young 58c146a7c0 ADDED ki_description and ki_keywords to footprint properties.
Also a bunch of wxT().

Fixes https://gitlab.com/kicad/code/kicad/issues/7783
2022-03-19 23:16:56 +00:00
Jeff Young c6a8100d46 Schematic and symbol text boxes.
Also fixes some plot bugs with arcs.

Also moves polygonization of arcs (when required) in plotting code
from 5 degrees to calculated based on ARC_HIGH_DEF.

Fixes https://gitlab.com/kicad/code/kicad/issues/5017
2022-01-28 21:38:15 +00:00
Fabien Corona 58e167013d SPICE: Add support for transmission lines 2022-01-23 17:23:22 +00:00
Jeff Young 2b14b60c32 Resolve text variables in eeschema before passing to pcbnew.
Fixes https://gitlab.com/kicad/code/kicad/issues/10429
2022-01-15 01:30:03 +00:00
Seth Hillbrand 30549a5e6a Don't strip extensions twice in BOM export
Exporting the Bill of Materials uses the netlist exporter.  Both of
these routines were stripping the extension, leading to projects like
"test.project.kicad_pro" having the project name stripped.  We separate
the BOM netlist export from generic plugin netlist export to allow the
correct behavior when exporting netlists and generating BOMs

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

(cherry picked from commit bef762e652)
2022-01-05 11:07:49 -08:00
Frank Zeeman f004665df8 Add tuner support for potentiometer code model 2021-12-28 02:53:39 +01:00
Frank Zeeman e618ef98e9 Add potentiometer code models to model selection 2021-12-28 02:53:39 +01:00
Jeff Young 1b2a278de9 Don't put "exclude from board" symbols in CvPCB netlist.
Fixes https://gitlab.com/kicad/code/kicad/issues/9939
2021-12-10 23:00:50 +00:00
Seth Hillbrand 548e5f49bd Clean up unused variable usage
Unused variables in function calls can be commented out.  Unused
return variables get a new routine `ignore_unused()` that silences the
warnings with zero overhead.
2021-10-05 10:00:30 -07:00
Jeff Young 5bf042fcc1 Use individual parameter version of wxExecute.
Fixes https://gitlab.com/kicad/code/kicad/issues/9236
2021-09-26 15:03:06 +01:00
Seth Hillbrand 8a305eec32 Remove broken RefDesStringCompare
This function attempted a poor-man's natural compare but it assumed
specific structure of the string.  This broke for strings with
numberings that looked like decimals.

Instead, we use our natural string comparison function and remove the
references to this older function and its similar elements.

Fixes https://gitlab.com/kicad/code/kicad/issues/9067
2021-09-01 11:48:01 -07:00
jean-pierre charras 9f22baf109 netlist xml exporter: fix incorrect keyword change (field was changed to f)
Keywords cannot be changed without a very good reason. the keyword is now field.
Fixes #9016
https://gitlab.com/kicad/code/kicad/issues/9016
2021-08-23 17:14:45 +02:00
Jeff Young 7561715ffe Unescape symbol fields going out to XML netlist.
Fixes https://gitlab.com/kicad/code/kicad/issues/8995
2021-08-21 22:03:24 +01:00
Wayne Stambaugh f485ba9338 Fix netlist error when editing schematic symbols in place.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/8798
2021-07-30 18:37:45 -04: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
Jeff Young 46338403e7 Unwrap some std::library typedefs. 2021-07-28 22:16:38 +01:00
Wayne Stambaugh cb72da294a More NULL expunging. 2021-07-16 16:13:41 -04:00
jean-pierre charras f55f9a522b Netlist exporter spice: expand env vars when used in include library name. 2021-07-09 14:22:31 +02:00
Jeff Young ea6769b702 The REPORTER interface is inherently line-based.
Also fixes a bunch of error messages that were similar but not
identical (which just increases translation burden).

Fixes https://gitlab.com/kicad/code/kicad/issues/8723
2021-07-05 13:41:06 +01:00
Jeff Young 0484ca5564 Separate LIB_PIN and SCH_PIN GetShownName/Number processing.
SCH_PIN wasn't handling the legacy empty string token (~), but
more importantly this will allow text variable resolution specific
to the schematic.

Fixes https://gitlab.com/kicad/code/kicad/issues/8625
2021-06-17 10:52:46 +01:00
Jeff Young 1722bc03b0 Consistent terminology and punctuation. 2021-06-17 00:05:17 +01:00
Wayne Stambaugh ff099453c8 Rename class_library.[h|cpp] to symbol_library.[h|cpp]. 2021-06-15 09:24:55 -04:00
Wayne Stambaugh ee3eac325d Expunge the use of the word part from Eeschema code. 2021-06-15 08:32:11 -04:00
Wayne Stambaugh fb46cd8bc5 Expunge the use of the word component from Eeschema code.
The only exception to this is the SPICE simulator's use of component
when referring to physical component (R, L, C, etc.) values.
2021-06-14 14:00:21 -04:00
Wayne Stambaugh 71c183d7bb Rename LIB_PART to LIB_SYMBOL. 2021-06-14 07:11:17 -04:00