Commit Graph

170 Commits

Author SHA1 Message Date
jean-pierre charras 655a696589 fix compil issue 2021-04-01 11:36:30 +02:00
jean-pierre charras 6499b5f296 Eeschema: protect lib symbols against duplicate field names.
If a field name is already in use, try to rename the new field name
(adding the suffix "_1" or "_2" or ... )
This is especially critical when a non mandatory field has the same name as
a mandatory field (was crashing before)
Fixes #8081
https://gitlab.com/kicad/code/kicad/issues/8081
2021-04-01 11:27:14 +02:00
Jeff Young 2ad69fc56b Move importers from wxLog to REPORTER.
Fixes https://gitlab.com/kicad/code/kicad/issues/6389
2021-03-31 22:54:30 +01:00
Roberto Fernandez Bautista c5e4220b5b CADSTAR Schematic: Fix duplicate pins
Fixes a bug that was causing duplicate pins to be loaded
(one on top of the other) for all symbols.
2021-03-30 13:03:56 +00:00
Roberto Fernandez Bautista 1629b038e1 CADSTAR Schematic: Fix loading of symbol instances differing from part
The previous assumption was that a part definition would always hold
the information about the symbol. However some designs have symbol
instances that refer to a different symbol definition than that
specified in the part.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/7808
2021-03-30 13:03:56 +00:00
Roberto Fernandez Bautista e6c7ddc271 CADSTAR Schematic: Fix loading of symbol attributes
Fixes an issue that resulted in incorrect field values being loaded
2021-03-30 13:03:56 +00:00
Roberto Fernandez Bautista 51db9cfcef CADSTAR Schematic: Text Loading improvements 2021-03-30 13:03:56 +00:00
Jeff Young a0a5e93782 Remove m_props from symbol library plugins. It's not thread-safe.
Fixes https://gitlab.com/kicad/code/kicad/issues/8035
2021-03-26 21:57:32 +00:00
Jeff Young 3d6c05b210 Apply symbol field id fixup logic to lib parts.
Fixes https://gitlab.com/kicad/code/kicad/issues/7903
2021-03-26 21:57:32 +00:00
Roberto Fernandez Bautista e0d2724f68 CADSTAR Schematic: Increase "tiny" bus labels to 0.4mm text size
Also fix incorrect label orientation
2021-03-25 19:10:49 +00:00
Roberto Fernandez Bautista 6494e0bf25 CADSTAR Schematic: Fix orientation of net labels and sheet pins 2021-03-25 17:50:33 +00:00
Roberto Fernandez Bautista 5a74fb9bb1 CADSTAR Schematic: Ensure connectivity with tiny labels at Bus Entries
Always add a label at bus terminals to ensure connectivity. The original
design might already have a bus terminal with a given location.
If the original design does not have a label, just make it very small
to keep connectivity but make the design look visually similar to
the original.
2021-03-25 17:50:33 +00:00
Wayne Stambaugh cfaca0e4bb Revert "Eeschema: remove all legacy schematic and symbol library save code."
This reverts commit 9c19c2306e.

Unfortunately writing legacy symbols libraries can never be removed because
of the symbol rescue feature. :(

Fixes https://gitlab.com/kicad/code/kicad/issues/7986
2021-03-22 08:19:47 -04:00
Roberto Fernandez Bautista a0889705e7 EAGLE and Altium SCH importers: UpdateSymbolLinks after import
Fixes https://gitlab.com/kicad/code/kicad/-/issues/7687
2021-03-21 20:13:20 +00:00
Thomas Pointhuber d9229697d8 altium: special string override map should be case-insensitive
This only fixes overrides where we explicitly map an override. Wrongly written variables pointing to fields are not corrected by this.

Fixes: https://gitlab.com/kicad/code/kicad/-/issues/6256
2021-03-20 20:42:25 +01:00
Wayne Stambaugh 9c19c2306e Eeschema: remove all legacy schematic and symbol library save code.
Legacy schematic and symbol library saving is officially deprecated.
2021-03-20 13:29:44 -04:00
Jon Evans c04e19f9ac Include optimization: move some things from common.h to point-of-use 2021-03-20 12:09:18 -04:00
Thomas Pointhuber 4482b3baba altium: Handle special strings and convert them into KiCad variables. Use Comment for VALUE.
Fixes: https://gitlab.com/kicad/code/kicad/-/issues/6256
Fixes: https://gitlab.com/kicad/code/kicad/-/issues/7736
2021-03-14 16:40:36 +01:00
Jeff Young 2a9186d9e9 Don't re-use FieldIDs when assigning ids on save.
Fixes https://gitlab.com/kicad/code/kicad/issues/7849
2021-03-09 15:09:31 +00: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
WhiteChairFromIkea ff23f4324a Do not hardcode altium file extension length 2021-03-04 12:20:40 +00:00
Ian McInerney 908de37e7c Don't hardcode the file extensions where possible 2021-03-03 01:13:59 +00:00
WhiteChairFromIkea 2c289b3f35 Check for ".SchDoc" before replacing to ".kicad_sch" for subsheet 2021-03-02 22:30:08 +00:00
WhiteChairFromIkea f83b9236ac Formatting 2021-03-02 22:30:08 +00:00
WhiteChairFromIkea b98602583c Remove "SchDoc" and use "kicad_sch" instead for subsheet names 2021-03-02 22:30:08 +00:00
WhiteChairFromIkea 042ea9761c Revert "Import footprint to symbols. Subsheet is name is prepended to footprint name,..."
This reverts commit 8aa4faa4ce24adc6310223952e8b5773ce245778
2021-03-02 22:30:08 +00:00
WhiteChairFromIkea 292aff48fd Import footprint to symbols. Subsheet is name is prepended to footprint name, which is probably NOT OK when syncing with PCB. 2021-03-02 22:30:08 +00:00
Jeff Young 8a33542bcd SCH_COMPONENT::GetField() expects a vector index, not a field id.
Check this at compile time.  Callers wanting to use an index now must
use SCH_COMPONENT::GetFields()[i] instead.

Fixes https://gitlab.com/kicad/code/kicad/issues/7757
2021-02-28 15:10:37 +00:00
Roberto Fernandez Bautista 76ef98339d CADSTAR PCB Archive Importer: Re-write loading of power symbols
Ensure all each power symbol is unique for each net name even
if it uses the same graphical symbol.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/7722
2021-02-26 19:32:44 +00:00
Wayne Stambaugh 1786ae8773 Eeschema: use symbol nomenclature for object file naming. 2021-02-24 08:48:02 -05:00
Jeff Young a3b9e8ddb4 Round 2 of Worksheet -> Drawing Sheet. 2021-02-23 11:57:44 +00:00
Roberto Fernandez Bautista ccbc0f73cc CADSTAR Schematic Archive Importer: Fix Coordinate Rounding error
Rewrite of the calculation to convert CADSTAR to KiCad coordinates,
rounding half way cases away from zero.
Use integer division instead of double, to ensure precision.
2021-02-22 13:24:00 +00:00
Roberto Fernandez Bautista 842a930ced CADSTAR Schematic Archive Importer: Autoplace fields when adding sheet
Makes the sheets look a little bit better when there is no block name
in the original CADSTAR design.
2021-02-22 13:24:00 +00:00
Roberto Fernandez Bautista 7b5cf955af CADSTAR Schematic Archive Importer: Visible fields to calculate BBOX
- Ensures page size is calculated correctly
2021-02-22 13:24:00 +00:00
Roberto Fernandez Bautista 5acdf1ddb1 CADSTAR Schematic Archive Importer: Align to original grid
Previous assumption of 100mil grid in CADSTAR schematic designs has
been proven to be incorrect. Let's use the "working grid" in the
original design instead.
2021-02-22 13:24:00 +00:00
Roberto Fernandez Bautista c98106ebcf CADSTAR Schematic Archive Importer: Parse TESTPOINT
Fixes https://gitlab.com/kicad/code/kicad/-/issues/7574
2021-02-22 13:24:00 +00:00
Roberto Fernandez Bautista 09ebfcd650 CADSTAR Importer: Fix Code Style
- Rename member variable names to use the 'm_' prefix
- Rename a few object types that clashed with KiCad object names, such
  as BOARD and SCHEMATIC, to avoid the use of '::' to access the KiCad
  objects.
- Remove some unused code.
2021-02-22 13:24:00 +00:00
Jeff Young 2a7e60960a Use standard mirror icons & terminology.
Also use standard group icons.

Also put both (and rotate commands) in toolbar.

Fixes https://gitlab.com/kicad/code/kicad/issues/7504
2021-02-16 21:11:36 +00:00
Wayne Stambaugh 114dceec2e Eeschema: Eagle schematic plugin parser improvements.
* Complete drawing of sheet border/title block symbol.
2021-02-16 09:33:15 -05:00
Wayne Stambaugh 089b7afacf Eeschema: Eagle schematic plugin parser improvements.
* Fix multi line text alignment.
* Parse schematic frame objects and convert them to lines.
* Make implicit global labels normal size so they can easily be seen.
* Move sheet fields to a more sensible position.
* Parse schematic symbol instances before wires so that the implicit power
  connections can properly be tested.  This will be used at a later time.
* Scale label text size down to allow for differences in label offset and
  graphical items.
2021-02-15 16:44:58 -05:00
Seth Hillbrand 8745691da3 Toggle LOCALE_IO before re-caching
cacheLib() can cause a re-load event, which requires the C-locale.
LOCALE_IO needs to be set before this event to prevent mistaken ','/'.'
mixups

Fixes https://gitlab.com/kicad/code/kicad/issues/6434
2021-02-15 09:10:21 -08:00
Seth Hillbrand cea9e1b62c Remove Eagle workaround for stacked NC pins
We no longer put stacked NC pins in the same net, so we do not require
this hack.
2021-02-11 16:47:21 -08:00
Roberto Fernandez Bautista 7c06bdbd2e CADSTAR Schematic Archive Importer: Fix parsing of TERMINAL_SHAPE
TRIANGLE shape and a few others do not have a "right length",
only a "length".
Fixes the error "Missing Parameter ‘2’ in ‘TRIANGLE’".
2021-02-10 18:49:21 +00:00
Roberto Fernandez Bautista 80d8974f87 CADSTAR Archive Importer: Fix loading of non-cadstar font text sizes
Non-cadstar fonts use a width of 0.
2021-02-10 18:49:20 +00:00
Roberto Fernandez Bautista 49bf957c48 CADSTAR Schematic Archive Importer: Fix positioning of global labels
Previous calculation did not take into account rotation of the labels
when calculating the final position.
2021-02-10 18:49:20 +00:00
Roberto Fernandez Bautista 0841f3ae25 CADSTAR Schematic Archive Importer: Fix wires (Implied connections)
There is an implied connection between elements in a net even though
there might not be a graphical connection in the file.
2021-02-10 18:49:20 +00:00
Roberto Fernandez Bautista 8add7a880d CADSTAR Schematic Archive Importer: Fix positioning and margins
Fix calculation of sheet bounding box and sheet margins with the aim
of matching CADSTAR pdf output as closely as possible.
2021-02-10 18:49:20 +00:00
Roberto Fernandez Bautista cb90a4b7e6 CADSTAR Schematic Archive Importer: Handle Pin Swaps
Each schematic symbol instance can have pin numbers that diverge from
the pin number definitions in the library
2021-02-10 18:49:20 +00:00
Roberto Fernandez Bautista 4ea487936b CADSTAR Schematic Archive Importer: Simplify symbol library name 2021-02-10 18:49:20 +00:00