Commit Graph

8505 Commits

Author SHA1 Message Date
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
Jeff Young 2dc6300501 Move EDA_ITEM bounding boxes to BOX2I. 2022-08-31 10:16:55 +01:00
Jon Evans ae879c8f02 DbLib: Add single-row query cache
Since single-row queries are performed rapid-fire during certain actions like
stepping through the symbol browser, there is high value in caching them for
a small amount of time.  The default cache parameters will keep results for
10 seconds, which errs on the side of getting fresh data from the database
on most user interactions.
2022-08-30 22:18:36 -04:00
Jon Evans 1da0572977 DbLib: Retry connection if first attempt fails 2022-08-30 22:18:36 -04:00
Jeff Young 5679b9dbdc Remove a few EDA_RECT instances. 2022-08-31 01:22:49 +01:00
Jeff Young 0c8787cbb9 Some more wxPoint/EDA_RECT yeeting. 2022-08-31 00:44:33 +01:00
Jon Evans 570f4fe4a9 Fix GCC warning 2022-08-30 18:48:18 -04:00
Seth Hillbrand b736460e71 Move optional access from value() to *operator
`value()` throws.  Where we check for existence, we don't need to use
the throwing version and should just use the unprotected variant
2022-08-30 13:59:39 -07:00
Mikolaj Wielgus 39ac58ea33 Use the PEGTL grammar for detecting .control and .subckt text directives 2022-08-30 17:27:58 +02:00
Marek Roszko ae637296cd Fix MSVC compile 2022-08-30 07:24:58 -04:00
Jeff Young 63386ba64d Pointer safety for ERC/DRC dialogs.
Also makes the "Edit ingored violations" easier to find.

Fixes https://gitlab.com/kicad/code/kicad/issues/12308
2022-08-30 12:07:19 +01:00
Mikolaj Wielgus 2bcfe5e42c Fix Spice subcircuit parsing
When parsing a subcircuit, the parser was incorrectly identifying
parameters of models inside it as belonging to the subcircuit.
2022-08-30 12:09:10 +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 bd6c153ad9 Sim: Implement "enum" model parameters for switches
Displayed in Sim Model Dialog parameter grid as a dropdown
(wxEnumProperty).
2022-08-30 09:45:49 +02:00
Marek Roszko 03aa63bd50 Move 5 helpers to EDA_UNIT_UTILS since they aren't iu specific 2022-08-29 20:11:03 -04:00
Marek Roszko 58ef932370 panel_setup_severities.cpp is already in COMMON_DLG_SRCS 2022-08-29 19:24:06 -04:00
Marek Roszko 99f8bb3219 panel_gal_display_options can be common 2022-08-29 18:18:38 -04:00
Marek Roszko f0956e48f2 Make EDA_TEXT common
Since EDA_TEXT is a base class, we can just force the child classes to pass the correct iu scaled size

ALLOW_BOLD_THICKNESS removed because it's a pre-custom font holdover
2022-08-29 07:31:03 -04:00
Jeff Young c65228e15f Fix plotting offset issue for non-symbol fields. 2022-08-29 11:53:04 +01:00
Jeff Young 5ebc51bf63 Fix plotting colour of intersheet refs. 2022-08-29 11:53:04 +01:00
Mikolaj Wielgus e82ff4de73 Remove the old netlist_exporter_pspice.cpp file 2022-08-29 05:39:09 +02:00
Mikolaj Wielgus 716b60c20d Commit forgotten sim_model_switch.{cpp,h} files 2022-08-29 04:28:56 +02:00
Mikolaj Wielgus 3b3131ad74 Create class for voltage and current -controlled switches
Unfortunately, along the way it turned out that Ngspice's .probe alli
breaks current-controlled switches. So they won't work in that case for
now.
2022-08-29 03:49:41 +02:00
Marek Roszko 5ebd3b2d80 Make EDA_SHAPE common
Looks like it's dependency on unit macros was dropped some time ago
2022-08-28 19:35:41 -04:00
Jeff Young 48f77973da Another try at getting the Link combobox working on MSW. 2022-08-28 23:25:01 +01:00
Jeff Young 95fd7cb80a Move wxComboBox to wxBitmapComboBox in hopes it will work better.
(Not sure if it solves the MSW issues yet, but at least it highlights
the items in the dropdown on rollover on OSX.)

Also added some text to the dropdown menu for intersheet references in
the PDF.
2022-08-28 12:05:27 +01:00
Jon Evans 0474ae86ea DbLib: Use full alias name when loading single symbol 2022-08-27 22:08:01 -04:00
Jeff Young 6bad88e592 Make external hypertext links show a menu before executing. 2022-08-27 23:58:13 +01:00
Jeff Young c0d2052e4b PDF hypertext menus for intersheet references. 2022-08-27 23:58:13 +01:00
Jon Evans 9a8ee2ca50 Fix loading of symbols from libs through non-chooser paths
Allow calling PLUGIN::LoadSymbol directly when outside the threaded loader
2022-08-27 18:47:39 -04:00
Jon Evans 49354e52a8 Add support for sub-libraries concept
Sub-libraries allow a single-level hierarchy inside a symbol library.

This is useful for database libraries and for supporting other EDA library types where a
single file can contain multiple logical groupings of symbols.
2022-08-27 18:47:39 -04:00
Roberto Fernandez Bautista a76d1a791d Hyperlinks: Don't forget about file:// protocol 2022-08-27 23:16:28 +01:00
Jeff Young 122a6d7f46 Move hypertext linking to user-page-numbers.
Also moves most navigation code to SCH_NAVIGATION_TOOL.
Also changes page number href to anchor syntax ('#foo').
Also adds hypertext processing to SCH_TEXTBOXes.
Also adds combobox with schematic pages to text properties dialog.
2022-08-27 19:17:43 +01:00
Roberto Fernandez Bautista 516c4cb2d3 wip refactoring: use virtual page numbers for page navigation
"Real" page numbers are just strings and could be duplicated. Virtual page
numbers are guaranteed to be unique, since they indicate a sequence.
2022-08-27 19:17:43 +01:00
Roberto Fernandez Bautista 51bcfaafd7 start moving to virtual page numbers 2022-08-27 19:17:42 +01:00
Roberto Fernandez Bautista 72e39fc865 Get it working for SCH_TEXT with infobar error message 2022-08-27 19:17:42 +01:00
Roberto Fernandez Bautista 212864306c Allow goto page hyperlinks to work in sch_text 2022-08-27 19:17:42 +01:00
Roberto Fernandez Bautista a78cefc7d4 ADDED: Plotting of sheet objects with go to page hyperlinks (pdf for now) 2022-08-27 19:17:42 +01:00
Roberto Fernandez Bautista 9b007ca4bf ADDED: Go to page hyperlinks in schematic editor (virtual page numbers)
The problem is that "real" page numbers can be duplicated, so we work around it
by using virtual page numbers instead which are guaranteed unique.

Example "goto:3" will go to page 3. If customised page numbers are used such as
a, b, c, then to go to page b, we should specify goto:2 (i.e. the virtual page
number).
2022-08-27 19:17:42 +01:00
Roberto Fernandez Bautista 5d90f3f54f WIP - fix up parsing + generalise to the pcb 2022-08-27 19:17:42 +01:00
Roberto Fernandez Bautista e7920bdda4 wip - fixes 2022-08-27 19:17:42 +01:00
Roberto Fernandez Bautista 20ed9b475b Configurable hyperlink hovering color 2022-08-27 19:17:42 +01:00
Roberto Fernandez Bautista 840bcffefb ADDED: Hyperlinks on text items in Schematic Editor 2022-08-27 19:17:42 +01:00
Marek Roszko 9acc5ac7ea base_screen became free of base_unitry awhile ago 2022-08-27 14:02:51 -04:00
Marek Roszko bf964d8678 Commonize page_info by simply making the Iu scale a parameter on call. 2022-08-27 13:36:00 -04:00
Roberto Fernandez Bautista 029cc65b34 EDA_SHAPE: Remove m_upsideDownCoords hack (Fixes hitTest routine) 2022-08-27 12:51:32 +01:00
Roberto Fernandez Bautista 2812794742 Move TRANSFORM to common 2022-08-27 12:51:32 +01:00
Roberto Fernandez Bautista 6ceddb185b Cleanup loading of arc shapes in Symbol and Schematic editors 2022-08-27 12:51:32 +01:00
Roberto Fernandez Bautista 8279add470 Fix plotting and display of >180 degree LIB_SHAPE arcs
Fixes https://gitlab.com/kicad/code/kicad/-/issues/7292
2022-08-27 12:51:31 +01:00
Jon Evans 5c43c46365 Add new symbol fields to autocomplete list 2022-08-26 23:53:23 -04:00
Jon Evans 460e8015f0 Allow referencing LIB_ID components in symbol fields 2022-08-26 20:30:48 -04:00
Jon Evans 300d92438c Allow hiding symbol library tables from symbol chooser
Hidden but loaded libraries are useful when using database libraries
2022-08-26 20:18:40 -04:00
Jon Evans 03bc3936c6 Use database table name instead of nickname when loading symbol 2022-08-26 19:10:27 -04:00
Wayne Stambaugh 7c6d9f67f9 Eeschema: fix broken instance data when adding new symbol.
Pass the current SCHEMATIC object pointer in SCH_SYMBOL ctor so that
newly created symbols will update the current instance data on creation
when the current sheet instance is being displayed.

This is a better fix for the master branch and cherry-picking from 6.0
was a mess.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/12190
2022-08-26 13:35:49 -04:00
jean-pierre charras 66febafb9c Fix cross-probing from Cvpcb to Eeschema, broken by commit 3a76d426
Fixes #12293
https://gitlab.com/kicad/code/kicad/issues/12293
2022-08-26 18:15:57 +02:00
Jeff Young a90f223644 Take a stab at fixing some likely-event-ordering issues on MSW.
Fixes https://gitlab.com/kicad/code/kicad/issues/12289
2022-08-26 17:05:25 +01:00
Seth Hillbrand 06786c34d7 Blacklist hashes for 2d integer elements
The hash table for integer hashes is extremely limited and places most
elements in the same buckets.  This leads to a linear search time for
structures built on this.

This blocks hashes, directing the coder to utilize std::set or std::map
structures instead of hash tables for implementing integer-based
lookups.
2022-08-26 08:43:37 -07:00
Jon Evans ae6a2a6443 ADDED: Database libraries MVP
Allows placing parts from an external database that reference symbols from another loaded library.

Includes:
- nanodbc wrapper
- database schematic library plugin
- basic tests

Fixes https://gitlab.com/kicad/code/kicad/-/issues/7436
2022-08-26 10:51:13 -04:00
Mikolaj Wielgus 963900ab83 Sort sim model pins by symbol pin number in sim model dialog 2022-08-26 04:36:48 +02:00
Seth Hillbrand fa91e3c8d6 Remove unused include 2022-08-25 16:00:12 -07:00
Seth Hillbrand f1261e71d4 Replace boost::optional with std::optional 2022-08-25 15:50:47 -07:00
jean-pierre charras a306246558 Fix a few (minor) compil and Coverity warnings. 2022-08-25 20:21:00 +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
Jeff Young 9657b23139 Allow selected RefDes as proxy to selected symbol for annotate selection.
Also fixes some likely bugs regarding collection of power symbols and symbols
with no lib link for annotation.

Fixes https://gitlab.com/kicad/code/kicad/issues/12259
2022-08-24 11:31:13 +01:00
Mikolaj Wielgus 8a6a0ff7dc Allow inferred voltage/current sources to have a single float in Value
Update Opamp test to use this feature.
2022-08-24 06:19:38 +02:00
Marek Roszko fc99b3ba95 Don't link gdiplus everywhere anymore
Tested on msys2 which is the only place it would have been buggy
CMake seems to share the gdiplus linkage with the other dependencies automatically now
2022-08-23 23:51:35 -04:00
Marek Roszko e0f28fc4e1 Replace wxFindReplaceData with our own container
By dropping the flags, we can be strict with options.
Also it makes future usage of search functionality a little more "UI" framework independent
2022-08-23 22:16:51 -04:00
Mikolaj Wielgus ffab57ffd0 Fix default pin assignment for subcircuit sim models
Instead of using a linear order that incorrectly starts from 0, have all
pins unassigned by default.
2022-08-24 00:09:05 +02:00
Jeff Young 142229089f Don't look for connections when we're just clearing the highlight.
This can happen before connectivity has been updated, and the only
reason we're looking for it anyway was to make the logic simpler.

Fixes https://gitlab.com/kicad/code/kicad/issues/12037
2022-08-23 12:57:55 +01:00
Alex 3a76d42630 Cross-probing/selection for multiple items (PCB -> SCH)
Fixes https://gitlab.com/kicad/code/kicad/issues/10469
2022-08-22 19:33:39 +00:00
Jeff Young 638198251a Coverity fixes. 2022-08-22 17:52:58 +01:00
Jeff Young f42b66bc1c Regularize ellipsization of menu and status text.
Fixes https://gitlab.com/kicad/code/kicad/issues/12257
2022-08-22 17:52:58 +01:00
Jeff Young 03454684fa Commenting. 2022-08-22 12:43:57 +01: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
Jeff Young 4f0136db3b Attempt to fix std::initializer_list lifetime issue. 2022-08-21 20:54:41 +01:00
Jeff Young 88c9177ff6 Move bus members from wxArray to std::vector and fix some bugs in dialog. 2022-08-21 20:54:41 +01:00
Wayne Stambaugh 10123d164f Fix schematic symbol initial default instance data bug.
The commit bumps the schematic file format version in order to fix the
initial symbol default instance data to the first instance of each symbol.
It also sets the initial instance data to undefined in the SCH_SYMBOL
ctor so on the first schematic save, the default instance will be set
to the first instance of the symbol.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/12190
2022-08-21 08:03:28 -04:00
Jeff Young b2a2d66005 Move Bus Definitions to common GUI paradigm in Schematic Setup.
Also includes a change to the std::initializer_list stuff to try and
fix a crash.
2022-08-21 12:29:51 +01:00
jean-pierre charras a75b537a52 Avoid using a single word in dialog, not really translatable.
Single word string having many meanings is not translatable.
2022-08-21 10:16:29 +02:00
Jon Evans afab26d554 Don't paint hidden fields without a schematic context 2022-08-20 17:56:53 -04:00
Jon Evans 8694c37376 Remove requirement that non-power symbols share a name and value
There is no technical reason for this restriction for non-power symbols, so let's remove it.
This will allow more flexibility and compatibility with other tools.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/9389
2022-08-20 17:43:43 -04:00
Seth Hillbrand 28876bef90 Don't close blocking dialog in backannotate
Back annotate is called from a dialog, so this will close itself but not
exit, locking the UI
2022-08-20 08:17:53 -07:00
Seth Hillbrand 0ad2726f31 Avoid spacemouse if not defined 2022-08-20 08:17:53 -07:00
Jeff Young 942732057b Add bus aliases to pre-canned labels in the label combobox.
Fixes https://gitlab.com/kicad/code/kicad/issues/12248
2022-08-20 16:07:59 +01:00
Marek Roszko 5c98715667 Fix change that got switched under rebase 2022-08-20 10:09:15 -04:00
Marek Roszko 7daded7c60 Drop the unique_ptr for m_spaceMouse since it can't be forward declared
Also we probably don't want to leak that class header everywhere
2022-08-20 10:07:33 -04:00
jean-pierre charras 59d2c4339f Fix a compil issue and a compil warning. 2022-08-20 15:34:27 +02:00
Jeff Young 8b0efa8ac4 A bit of cleanup from last commit. 2022-08-20 11:14:44 +01:00
Jeff Young aa2ad3b44c Move KICAD_T[] to std::initializer_list<KICAD_T>. 2022-08-20 10:28:11 +01:00
Seth Hillbrand c53fe1c1f0 Be more verbose when finding an error
Try to give the user more information about what the actual file error
is, rather than immediately throwing the IO_ERROR
2022-08-18 12:40:14 -07:00
Wayne Stambaugh 797827b833 Fix missing legacy value and footprint field instance data.
The legacy and s-expression (prior to version 20200828) file formats only
supported symbol unit and reference fields so the newly added value and
footprint fields must be updated from the original symbol fields.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/12226
2022-08-17 11:32:04 -04:00
jean-pierre charras 34b38eb95b Sim: on parameters parsing error, give a better info than tao::pegtl::eof error. 2022-08-17 11:11:36 +02:00
Marek Roszko c2e0c585f8 Add missing pass of uuid for 2pt polylines
Stops file churn
2022-08-16 23:29:03 -04:00
jean-pierre charras 9e3e4ae9a6 Fix minor Coverity warnings 2022-08-16 18:56:37 +02:00
WhiteChairFromIkea 742757b98b Altium: import NOTE and TEXT_FRAME as TextBoxes instead of text objects 2022-08-16 16:34:13 +00:00
Marek Roszko d4e4071be3 Avoid netlist export dialog crash from trying to delete a non-custom format
Fixes https://gitlab.com/kicad/code/kicad/-/issues/12229
2022-08-15 19:12:46 -04:00
WhiteChairFromIkea 088ddf82eb Formatting 2022-08-15 22:55:39 +00:00
WhiteChairFromIkea 94d386d7ee Fixes https://gitlab.com/kicad/code/kicad/-/issues/12191
Autoplace port Sheet References and hide them (question marks), unti we figure out if intersheet references can be read from schdoc
2022-08-15 22:55:39 +00:00
WhiteChairFromIkea 5c9346902a Import HARNESS PORT as textboxes, preserving original formatting + typo fixes 2022-08-15 22:55:39 +00:00
WhiteChairFromIkea 81a2fed5c5 Import HARNESS_TYPE as Hierarchical sheet name 2022-08-15 22:55:39 +00:00