Commit Graph

169 Commits

Author SHA1 Message Date
Jon Evans d7bd4c9b04 Move Eeschema globals to new SCHEMATIC object
Set up a new lineage for SCH_ITEMS to get back to the SCHEMATIC
they live on: Items will all be parented to the SCH_SCREEN that
they are added to, and each SCH_SCREEN will point back to the
SCHEMATIC that it is part of.  Note that this hierarchy is not
the same as the actual schematic hierarchy, which continues to
be managed through SCH_SHEETs and SCH_SHEET_PATHS.
2020-05-18 13:04:56 -04:00
Jeff Young 1cfcfc3ca7 Fix some formatting issues in syntax help.
Fixes https://gitlab.com/kicad/code/kicad/issues/4233
2020-05-10 22:34:40 +01:00
Jeff Young cbe4b79107 Add syntax help for bus definitions (and upgrade parser to handle them).
Fixes https://gitlab.com/kicad/code/kicad/issues/4233
2020-05-10 18:40:06 +01:00
Jeff Young cc1ebca242 Add syntax help to pin dialogs. 2020-05-10 18:40:06 +01:00
Jeff Young df37887b1f Factor line width into global label shape.
Fixes https://gitlab.com/kicad/code/kicad/issues/4323
2020-05-05 20:26:51 +01:00
jean-pierre charras 687c2f3e82 eeschema: fix a readability issue for small texts.
Texts were drawn with a minimal line thickness = GetDefaultPenWidth().
The default pen width can be to large for small texts.
So the actual text thickness is now always clamped.
2020-04-30 09:38:23 +02:00
jean-pierre charras d10c8cd75b Sheet pins: fix incorrect size and plot thickness of the graphic symbol.
Unlike the global labels, the hierarchical label is not inside the graphic symbol.
So the graphic symbol size depends only of the text size, not of the text offset.
2020-04-29 17:46:36 +02:00
Ian McInerney 99dcadf7e6 Introduce new KI_FALLTHROUGH macro
Annotate purposeful fallthroughs in switch statements with the
KI_FALLTHROUGH macro.
2020-04-25 00:44:09 +01:00
Jeff Young 2fb2eac4d5 Performance enhancements. 2020-04-24 22:17:45 +01:00
Jeff Young 1535c83b88 Lay some groundwork for adding distances to DRC errors.
modified:   eeschema/lib_rectangle.cpp
2020-04-24 14:46:22 +01:00
Jeff Young a286cb5a8f Keep labels on dragged wires.
Fixes https://gitlab.com/kicad/code/kicad/issues/2107
2020-04-19 18:24:39 +01:00
Jeff Young 2b6089240a Change super/subscript syntax to ^{foo} and _{foo}. 2020-04-18 21:04:41 +01:00
Jeff Young 0dfdc37ae7 Clean up label spacing to be more predictable.
Don't try to use complex algorithms taking into account default
margins, line-widths and pen-widths (especially when they differed
between label types).  We now use the (user-controlled) text
offset ratio to determine the margins (from the center-point of
the attached line).
2020-04-17 14:47:57 +01:00
Jeff Young 37023da56f Tidy some compiler warnings. 2020-04-16 17:34:46 +01:00
Jeff Young 9c8941e040 Remove a bunch of globals. 2020-04-16 17:34:46 +01:00
jean-pierre charras 952e7a5fb4 Eeschema: move some default values to default_values.h.
These default values are used in many files, and some files were using
magic numbers.
2020-04-14 20:15:18 +02:00
jean-pierre charras 6148461484 Eeschema plot: fix (temporary) line 0 thickness.
Plotting lines having 0 thickness is not acceptable and create issues.
2020-04-14 12:43:51 +02:00
Jeff Young 6e800bddae Rationalize penWidth processing as first step in removing some globals. 2020-04-13 20:58:13 +01:00
Jeff Young 505d8bf56e Allow ':'s in field name references in text variables.
Fixes https://gitlab.com/kicad/code/kicad/issues/2458
2020-04-11 20:47:44 +01:00
Jeff Young aba0fa7bf8 Allow cross-referencing text substitutions. 2020-04-07 17:29:58 +01:00
Jeff Young cc9ac37a0e Add text variable support to envVar processing. 2020-04-05 20:52:26 +01:00
Jeff Young 591428b0d9 Remove some problematic global variables.
Fixes https://gitlab.com/kicad/code/kicad/issues/4121
2020-04-05 16:17:04 +01:00
jean-pierre charras b1b8a32078 fix a few Coverity warnings and compil minor warnings. 2020-04-03 09:54:47 +02:00
Jeff Young b59da3e4dc Overridden versions of GetShownText() still need to call EDA_TEXT version.
Fixes https://gitlab.com/kicad/code/kicad/issues/4151
2020-04-02 18:27:54 +01:00
Jeff Young 41b5872f12 Add ERC & DRC checks for unresolved variables. 2020-03-30 14:15:59 +01:00
Jeff Young 40b2eabfc1 Add a user-defined ratio for text offset from wire/bus.
Fixes https://gitlab.com/kicad/code/kicad/issues/2392
2020-03-17 12:50:31 +00:00
Jon Evans 643c97a2f4 ADDED: Schematic plotting can use a dedicated color theme
ADDED: PDF, PS, and SVG plots can optionally include the page background color

Fixes #1830
2020-03-06 00:01:02 -05:00
Jonathan Warner 469c1c14ef Eeschema: adjusted component sorting to work better 2020-02-06 06:02:51 -07:00
Jon Evans ac875e26a8 Fix handling of SCH_PINs on multi-unit parts
Fixes https://gitlab.com/kicad/code/kicad/issues/3770
2020-02-04 11:51:29 +00:00
Seth Hillbrand 55eb687184 Eeschema: Force output ordering
The RTree does not have a deterministic iterator, so extracting items
may be in arbitrary order, causing issues as the schematic appears to
change when comparing to previous revisions.

This uses the SCH_ITEM comparison operator to for ordering by type, then
by custom sorting within type.

For the netlist, we choose the first available unit in the sheet for
each component.

Fixes #3811 | https://gitlab.com/kicad/code/kicad/issues/3811
2020-01-28 13:31:52 -08:00
Mark Roszko 70908043a3 Convert enums inside eeschema and the symbol editor to be scoped
Scope: NETLIST_ITEM, CONNECTION_TYPE, ELECTRICAL_PINTYPE,
       NET_CONNECTION, NETLIST_ITEM, GRAPHIC_PINSHAPE

Note, the pin type enum had PT_ added to the front to prevent
shadowing of the INPUT symbol on msys2 (see discussion at
c17c9960d8)
2020-01-18 20:51:28 +00:00
Jeff Young 7bb9551801 Handle boost exceptions. (From Coverity scan.) 2020-01-11 00:04:01 +00:00
Jeff Young 33da81cd27 Repair Coverity scan defects. 2020-01-10 23:17:54 +00:00
Seth Hillbrand 6e5e453d0d Replace EESchema DLIST
This moves EESchema DLIST structures to rtree.  These changes are more
fundamental than the pcbnew changes from 9163ac543 888c01d11 d1877d7c1
and 961b22d60 as eeschema operations were more dependent on passing
drawing list references around with SCH_ITEM* objects.
2020-01-10 06:37:08 -08:00
jean-pierre charras c17c9960d8 Eeschema: fix a colliding name between sch_text.h and a Windows/msys2 header.
"INPUT" declaration in sch_text.h generate *a lot of* compil warnings.
So it is replaced by PS_INPUT.
For consistency, others member of enum class PINSHEETLABEL_SHAPE are also renamed.
2020-01-09 08:52:30 +01:00
Mark Roszko ca34ade00c Make global labels have the same spin style as net/hierarchical labels
For legacy reasons, it stored left and right "spin" as flipped integers in the file format.
But the code handled the flip in multiple locations rather than just doing it on file io.
This change unifies the internal code and does the mapping in the file I/O.
2020-01-08 19:07:55 +00:00
Ian McInerney 13b6028e1b Refactor all math into a new kimath library
* Split up the thirdparty code into the thirdparty folder (#3637)
* Create a new kimath static library containing all the math functions

This is part of cleaning the build system for #1906.
2020-01-07 17:12:59 +00:00
Wayne Stambaugh aeb3281e27 Convert Schematic Internal Units to 100nm 2019-12-30 18:28:00 +00:00
Mark Roszko 11ff16be4e Switch to scoped enums 2019-12-20 14:11:39 +00:00
Jeff Young 35c8d64f98 Add super- and subscript support to Eeschema.
Note that since the markup might exist for other reasons, it has
to be turned on with a preference setting.  (It goes through a set
of bitflags so the same architecture can be used for other markup
structures that we might want to support in the future.)

Note also that this is more about engineering nomenclature than
visual formatting.  In that respect it's more similar to overbar
than italic or bold.
2019-11-05 17:22:51 +00:00
Seth Hillbrand c3226653cc eeschema: Handle broken spin style value
The spin style is stored as a numeric and can be corrupted.  We handle
this by triggering assertions for debugging the bad value while
resetting to default if we have non-valid spin values that are outside
the array.

Fixes: lp:1843091
* https://bugs.launchpad.net/kicad/+bug/1843091
2019-09-06 13:17:12 -07:00
Jeff Young 5503727d3d Fix some placement bugs with selection haloes on text.
Fixes: lp:1838841
* https://bugs.launchpad.net/kicad/+bug/1838841
2019-08-03 17:20:54 -06:00
Jeff Young 937e3c2d48 Make m_Text private so we don't keep getting bugs where m_shown_text fails to get updated.
Fixes: lp:1838655
* https://bugs.launchpad.net/kicad/+bug/1838655
2019-08-01 20:36:59 -06:00
Jeff Young daac54b5d2 Update shown text cache in undo/redo.
Fixes: lp:1837772
* https://bugs.launchpad.net/kicad/+bug/1837772
2019-07-26 23:59:05 -06:00
Jeff Young e1a22333c1 Fix bug with escaped '~' still getting extra height for overbar. 2019-07-10 11:59:09 +01:00
Jeff Young ad26ece8d4 Add Global Edit Text and Graphics Properties to Eeschema.
Fixes: lp:1801150
* https://bugs.launchpad.net/kicad/+bug/1801150
2019-07-01 22:15:25 +01:00
Seth Hillbrand 39c2745f55 eeschema: Allow spaces in label names for multilabeling
This adds the functionality to add multiple labels to your schematic at
once by using spaces in the original label name.

Fixes: lp:1095113
* https://bugs.launchpad.net/kicad/+bug/1095113
2019-06-20 16:21:49 -07:00
Jeff Young d6e9bdf07b Convert remaining legacy drawing code to print code. 2019-05-31 21:54:22 +01:00
Jeff Young 67cc2aac2e Rework Eeschema find/replace for modern toolset.
Fixes: lp:1827274
* https://bugs.launchpad.net/kicad/+bug/1827274

Fixes: lp:1827240
* https://bugs.launchpad.net/kicad/+bug/1827240
2019-05-22 21:48:04 +01:00
Jeff Young 053c26c96e Refresh shown_text cache when incrementing label name.
Fixes: lp:1828874
* https://bugs.launchpad.net/kicad/+bug/1828874
2019-05-15 17:50:52 +01:00