Commit Graph

278 Commits

Author SHA1 Message Date
Wayne Stambaugh 2b86b34124 Eeschema: split out SCH_SHEET_PIN declarations into separate header. 2021-04-06 17:15:49 -04:00
Ian McInerney 6c3cf33170 Cleanup some compiler warnings 2021-03-19 21:18:45 +00:00
Jeff Young 9c02e3ea63 Don't consider 0-length-lines when checking for junctions.
Also don't put junctions on labels in the middle of a wire.

Fixes https://gitlab.com/kicad/code/kicad/issues/7951
2021-03-18 23:50:04 +00:00
Jeff Young 1641d6da79 Go back to separate junction logic for wires and buses.
Also makes sure we don't add wire width in to hit-test calculations.

Fixes https://gitlab.com/kicad/code/kicad/issues/7951
2021-03-18 18:32:01 +00:00
Jeff Young 999477e0ed Vastly simplify the needs-junction logic to try and make it less buggy.
Fixes https://gitlab.com/kicad/code/kicad/issues/7951
2021-03-18 16:38:48 +00:00
Wayne Stambaugh fb29b4f946 Eeschema: add missing symbol cache library file warning.
Fixes https://gitlab.com/kicad/code/kicad/issues/7346
2021-03-10 09:52:53 -05:00
Dominik Wernberger e2aa7be4b3 Added a lot of consts and refactored a few lines 2021-03-08 12:49:48 -08:00
Wayne Stambaugh 7a00e01b3e Eeschema: fix false positive library symbol changed ERC errors.
This fix required sorting all of the LIB_PART draw items to ensure
accurate comparison between the symbols stored in the schematic and the
original library symbols.  This has a noticeable impact on symbol library
load performance.  It may also cause significant changes the next time
the library is saved due to changes in the draw item sorting.  Hashing
may be a better solution here but this addressed the immediate problem.

A skeleton method SCH_SCREEN::SwapSymbolLinks() was added because there
is most likely an issue with orphaned symbols in the schematic library
symbol cache during undo/redo operations.  More testing is required to
verify this.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/7263
2021-03-04 17:59:24 -05:00
Seth Hillbrand f73039cb18 Fix wire endings both too small and too large
Junctions should only be wire endings when ending directly on the wire.
This is the requirement for netlisting, so we need to follow it in the
auto-end as well.

SCH_LABEL needs to allow ending because any wire that touches the label
will be connected, so there's a use case for this.  However, the
bounding box for local labels did not include their connection point, so
we increase that box a bit.  Note that this might have the opposite
effect to https://gitlab.com/kicad/code/kicad/-/issues/7689

Fixes https://gitlab.com/kicad/code/kicad/issues/7714
2021-02-25 16:27:05 -08:00
Wayne Stambaugh 1786ae8773 Eeschema: use symbol nomenclature for object file naming. 2021-02-24 08:48:02 -05:00
Jeff Young 7e2b0e63f1 Fix junction logic when splitting two wires. 2021-02-23 21:43:41 +00:00
Jeff Young d70cebcd62 Allow clicking on terminal point to finish a bus unfold.
Fixes https://gitlab.com/kicad/code/kicad/issues/7413
2021-02-07 00:31:00 +00:00
Jeff Young 1c6c0bf8cf Null-ptr safety.
Fixes https://gitlab.com/kicad/code/kicad/issues/7266
2021-02-02 23:09:35 +00:00
Jeff Young bbb8173b61 Remove and re-add saved-as libraries when Syncing tree.
Also removes the aForce parameter as it was always true anyway.

Fixes https://gitlab.com/kicad/code/kicad/issues/7357
2021-01-31 23:00:17 +00:00
Jeff Young dfc6070178 Unify schematic file version checking with PCBNew.
This also makes sure that the user gets a warning before saving over
an older s-expr format.  While that won't always be wanted, it's now
in the infobar (like in PCBNew), so it's not too onerous.§

Fixes https://gitlab.com/kicad/code/kicad/issues/7347
2021-01-31 17:28:14 +00:00
Mikolaj Wielgus 8eca23aabe Mark null project initial screen as zoom-initialized
The variable `m_Initialized` in `BASE_SCREEN` is used by
`SCH_EDIT_FRAME` to mark whether a screen had its zoom level initialized
by the "zoom to fit screen" action. When this variable is `false`, the
function `SCH_EDIT_FRAME::DisplayCurrentSheet()` performs "zoom to fit
screen", modifying the zoom level. This function is indirectly called in
the undo routines, so if `m_Initialized` is not set to `true`, a zoom
change will occur when the user undoes an operation, a behavior that is
undesired.

`m_Initialized` was not initialized to `true` for the null schematic
(the schematic that is loaded if no project is loaded), causing the
aforementioned undesired behavior.

To prevent this, I've changed the `SCH_EDIT_FRAME` constructor to set
`m_Initialized` to `true`, since it zooms to fit screen already. I've
moved `m_Initialized` from `BASE_SCREEN` to `SCH_SCREEN`, as it is used
only in Eeschema, and renamed it to `m_zoomInitialized`, a name I
believe that better describes what this variable does.

I've also introduced the function `SCH_EDIT_FRAME::initScreenZoom()` to
group the "zoom to fit screen" action with setting `m_Initialized` to
`true`, as they often should occur together.

I'd also like to say that I'm not confident whether
`SCH_EDIT_FRAME::DisplayCurrentSheet()` should perform the zoom level
initialization at this point, but I have decided to not change this
behavior for now, as the commit history suggests it's several years old.

Fixes https://gitlab.com/kicad/code/kicad/issues/7343
2021-01-31 00:49:11 +00:00
Jeff Young ff7742c6b8 File naming and include cleanup. 2021-01-28 11:35:18 +00:00
jean-pierre charras e10025db64 Hierarchy navigation: keep the last used zoom level in a sheet when go back to this sheet.
Fixes #7107
https://gitlab.com/kicad/code/kicad/issues/7107
2021-01-17 09:41:49 +01:00
Dominik Wernberger dc02ec9758 Remove a few const_cast 2021-01-12 20:51:31 +00:00
Dominik Wernberger bb2881a5ab Make RENDER_SETTINGS argument const 2021-01-12 20:51:31 +00:00
jean-pierre charras e66451c56e I18n: remove useless trailing spaces in strings. 2020-12-28 08:43:47 +01:00
Jon Evans 0830f87ef4 Break wire segments on bus-wire entry endpoints
Fixes https://gitlab.com/kicad/code/kicad/-/issues/6173
2020-12-20 10:22:59 -05:00
Jeff Young 92db1d35e1 Formatting. 2020-12-15 17:11:14 +00:00
Jeff Young 126d40f9d3 "Sheet label" too confusing w/ sheet names and fields. Use "sheet pin". 2020-12-13 22:43:09 +00:00
Jeff Young ad281f7538 Remove duplicated TestDanglingEnds routines.
Also adds a changedItemHandler so that the single remaining version
can update the view.

Fixes https://gitlab.com/kicad/code/kicad/issues/6581
2020-12-06 21:24:16 +00:00
Roberto Fernandez Bautista afcaa60faa Remove "Order" field hack (partly reverts da1a89fc) 2020-11-30 16:49:33 +00:00
Jeff Young 8c5c902fa3 Re-write IntersheetRefs on top of SCH_FIELDs and textVars.
1) Generalize SCH_ITEM owners (SCH_COMPONENT, SCH_SHEET, and now
SCH_GLOBALLABEL)
2) Generalize hypertext items
3) Use SCH_FIELD autoplace infrastructure for placing intersheet
references
4) Use textVar infrastructure for buildin intersheet references.

As an important side-effect this also fixes the undo issues with
intersheet refs.
2020-11-17 16:05:49 +00:00
Jeff Young b227d2b910 More component -> symbol. 2020-11-15 20:23:15 +00:00
Jeff Young f0d0e17aab Prepare for MODULE -> FOOTPRINT. 2020-11-13 15:16:24 +00:00
Jeff Young bddc97df30 LibEdit -> SymbolEditor 2020-10-31 10:28:21 +00:00
Wayne Stambaugh 8ff51d8899 Eeschema: add schematic sheet page number.
The groundwork has now been laid for per sheet instance data.  Initially
this only supports sheet page numbers but could be expanded to include
other per sheet instance information.

ADDED: Support for user defined schematic page numbers.
2020-10-19 14:05:45 -04:00
jean-pierre charras 7865d8de43 more cleanup about removing useless include 2020-10-02 15:50:46 +02:00
Jeff Young a25dfb2ac9 Stop setting modify from ClearAnnotation().
It's a side-effect, and as it turns out every current caller has
special-case code to reset it afterwards.
2020-09-06 11:26:39 +01:00
Jeff Young be15053745 Allow back-annotation of differing values and footprints.
Also fixes a couple of bugs where resolving a textVar reference
to the refDes or unit wouldn't get the correct value in a
hierarchical schematic. (Unlogged.)

Fixes https://gitlab.com/kicad/code/kicad/issues/5397
2020-09-04 15:21:56 +00:00
Jon Evans 30b402bc02 Don't set modify flag when deleting markers
Fixes https://gitlab.com/kicad/code/kicad/-/issues/5418
2020-08-31 22:07:19 -04:00
Jon Evans 38a4e4ad5a Remove the last bits of the old netlist system 2020-08-30 16:30:04 -04:00
Seth Hillbrand c2847e00d8 eeschema: Fix crash when rescuing during update 2020-08-18 06:34:34 -07:00
Tomasz Wlostowski d937fadd6f Migrate RC_ITEM to use shared_ptr 2020-08-13 14:50:59 +02:00
Jeff Young f4ab14f32d Performance improvements for SchematicCleanup().
Fixes https://gitlab.com/kicad/code/kicad/issues/4563
2020-08-10 12:41:52 +01:00
Jeff Young c56599ab07 Allow ERC/DRC markers to be deleted without deleting exclusions.
Fixes https://gitlab.com/kicad/code/kicad/issues/4953
2020-08-02 22:45:48 +01:00
Jeff Young 7340c97ef9 Undo for schematic-wide operations.
Editing value/footprint fields of multi-unit components.
Find/Change.
Annotation.
Back annotation.

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

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

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

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

Fixes https://gitlab.com/kicad/code/kicad/issues/3899
2020-07-13 12:32:17 +01:00
Jeff Young c48f4272f3 Collapse a level out of the zoom settings.
The APP_SETTINGS_BASE now holds the list of zoom factors, and
the old legacy (screen-based) code has been removed.
2020-06-13 22:44:16 +01:00
Jeff Young f84406009b Push a couple of layers of indirection out of grid settings. 2020-06-13 11:35:56 +01:00
Jon Evans 2164501b06 Don't reparent symbol fields
Fixes https://gitlab.com/kicad/code/kicad/-/issues/4540
2020-05-25 17:47:50 -04:00
Jon Evans 7c7b7f41da Move SCH_SCREEN project access to SCHEMATIC
SCH_SCREEN no longer needs to be a KIWAY_HOLDER
2020-05-20 22:27:48 -04:00
Jon Evans b6d7bc36d0 Ensure component bounding boxes are correct
This was causing junctions to not always be added on wire
segments that overlapped component pins, because the pin
might not be part of the component bounding box before
UpdateLocalLibSymbolLinks() is called.  When the bbox
was never updated, these symbols weren't collected by
the rtree query for objects overlapping a point.
2020-05-20 18:50:09 -04:00
Jon Evans fbc42a8cb5 Move schematic defaults to SCHEMATIC and add some missing settings entries 2020-05-20 00:03:23 -04:00
Jon Evans f4d7c323f5 Coverity fixes 2020-05-18 22:58:28 -04:00
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 301ac3461c Fix some more pen width issues from global removal.
Fixes https://gitlab.com/kicad/code/kicad/issues/4408
2020-05-12 15:20:17 +01:00