Commit Graph

356 Commits

Author SHA1 Message Date
Roberto Fernandez Bautista ace0032c82 Fix build error & just completely remove the string instead of guarding 2022-09-01 13:45:40 +02:00
Roberto Fernandez Bautista cd30711cf8 Remove additional string from a3da0b9af6 2022-09-01 11:35:22 +02:00
Roberto Fernandez Bautista a3da0b9af6 CADSTAR Schematic: Load symbols even if part definition is incomplete
Fixes https://gitlab.com/kicad/code/kicad/-/issues/11671


(cherry picked from commit 8725c3a35f)
2022-09-01 09:25:14 +00:00
Seth Hillbrand 9e9b38ef6a Revert "cadstar: Report warning that imported text may be different"
This reverts commit f637a820b6.

New strings are not allowed in v6
2022-08-20 20:09:40 -07:00
Wayne Stambaugh 39940fe5ab 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

(cherry picked from commit 797827b833)
2022-08-17 14:24:13 -04:00
Roberto Fernandez Bautista f637a820b6 cadstar: Report warning that imported text may be different
Fixes https://gitlab.com/kicad/code/kicad/-/issues/12195


(cherry picked from commit 69d696660b)
2022-08-14 21:25:46 +00:00
jean-pierre charras 411d57396c eeschema: Fix issue when saving labels having more than 50 chars
These labels (or global label...) were saved with a erroneous angle.
Fixes #12151
https://gitlab.com/kicad/code/kicad/issues/12151
2022-08-05 13:33:35 +02:00
Jeff Young efc75047c1 Pay attention to units for page frames.
Fixes https://gitlab.com/kicad/code/kicad/issues/11408

(cherry picked from commit 404015b0a5)
2022-08-04 00:07:24 +01:00
Seth Hillbrand 4d1fcff732 Fix compile error in v6 2022-07-07 12:19:38 -07:00
Seth Hillbrand 95fcf53353 Handle basic rounding error in schematic import
The fractional part of Altium schematic units is an integer number of
1/10000 mil segments, which is 2.54 nm.  The internal unit of eeschema
is 10 nm, so each fractional unit in Altium is 0.254 base eeschema
units.  To be consistent with
cf33cfcad1
we round to the nearest 10nm for each element

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

(cherry picked from commit 6fef054c51)
2022-07-07 11:14:25 -07:00
Jeff Young bbe70e2f67 Repair Eagle importer page number handling.
The root sheet needs a page number, and the other sheets need to not
have their last step in the path duplicated.

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

(cherry picked from commit aaff163d7c)
2022-06-08 15:58:52 +01:00
Wayne Stambaugh c861c31f24 Eeschema: fix symbol library remap bug.
The original decision to escape the legacy symbol library names results
in them being escaped every time they are opened which cause the curly
braces '}' from the original escaping to be escaped on subsequent
openings.  This resulted in the symbol library names in the rescue
library not matching the library ID in the schematic.

This fix is likely to have other corner case bugs given the potential
for escaped characters in legacy symbol libraries.  Given that we now
have escaped rescue libraries in play, removing the escaping will only
result in more issues so we will have to fix the corner cases as we go.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/11563
2022-06-05 18:12:39 -04:00
Roberto Fernandez Bautista 250942264b CADSTAR Sch: Clear symbol of all elements before overwriting with new one
Fixes https://gitlab.com/kicad/code/kicad/-/issues/11378

(cherry picked from commit 85f6ff48e7)
2022-04-12 21:42:03 +01:00
jean-pierre charras 6127ae92a5 PLOTTER: do not clamp coordinates to an arbitrary value.
Previously, coordinates were clamped to +- 60 inches. It makes no sense to
clamp them at plotter level: max cooed depends on the editor (schematic/board...)
Rename MAX_PAGE_SIZE_MILS to MAX_PAGE_SIZE_EESCHEMA_MILS and use it only for Eeschema.
Fixes #11196
https://gitlab.com/kicad/code/kicad/issues/11196

(cherry picked from commit 21144481d2)
2022-04-04 13:52:21 -07:00
Wayne Stambaugh 35f15f016d Improve shared schematic file churn heuristics.
The previous solution cleared all of the fields and force the unit setting
to unit one which would have less than desirable effects when reusing a
schematic in another project.  This solution forces all of the instance
settings to the first sheet instance of the current project to prevent file
change churn when changing shared sheets in the current project.

This will not prevent shared schematic file changes when the first sheet
instance data differs between projects.

(cherry picked from commit dd1dbb81f6)
2022-03-11 14:34:30 -05:00
Wayne Stambaugh 70277e5514 Reduce shared schematic file change churn.
(cherry picked from commit bf5d585e24)
2022-03-11 14:34:04 -05:00
Seth Hillbrand 0cf1a67e29 Cache read arc data for stability
Arcs can be altered by the process of changing from on-disk
representation to in-memory representation.  Saving back to disk without
modifying the arc should not modify the calculated values.

This stores a copy of the on-disk representation that is only used to
save back to disk in the event that the arc is not modified during
editing.

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

(cherry picked from commit cd7141fd10)
2022-03-08 10:33:49 -08:00
Seth Hillbrand 17dc324e85 Explicitly give unit values
Removes the ability to hide symbol units in file formats.  This was
mostly the case for a while but there remained corner cases where we
left a default/hidden option

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

(cherry picked from commit 8c36ba3653)
2022-03-02 16:04:03 -08:00
Steffen Mauch ab835937a7 Fixing Eagle refs that do not work with KiCad
KiCad has stricter requirements for what consititutes an annotated
symbol.  This checks for and corrects annotations that begin with '#',
do not begin with a non-numeric character or do not end with a number

(cherry picked from commit 78620347c8)

Fixes https://gitlab.com/kicad/code/kicad/issues/10760
2022-02-25 15:45:30 -08:00
Seth Hillbrand 861589d837 Use wxEmptyString instead of wxT( "" )
Also fixes places where ternaries did autopromotion instead of returning
an empty wxString
2022-02-09 10:33:52 -08:00
Seth Hillbrand a444addd89 Default eeschema strings to wide
Prevents stack bug on MacOS
2022-02-08 15:14:54 -08:00
Marek Roszko 50d3a507d0 Mark some limits as constexpr
gcc doesn't need it and computes during compile regardless, but experimenting in godbolt, both clang and MSVC actually do need it or else it's partially computed at runtime


(cherry picked from commit ca7840334c)
2022-02-04 12:50:54 +00:00
Seth Hillbrand dcb8f29317 Handle rotated symbol rectangles in Eagle import
Fixes https://gitlab.com/kicad/code/kicad/issues/10360
2022-01-12 15:10:42 -08:00
Seth Hillbrand 71e7b4b77b Use 'special' escaping for certain fields
Most fields are escaped using the `\` notation.  But the VALUE field and
the symbol name need to be escaped using braces notation.

Fixes https://gitlab.com/kicad/code/kicad/issues/10097
2022-01-05 17:18:39 -08:00
Steffen Mauch 7afe188a29 eeschema: automatic generated symbol library from EAGLE plugin does not include footprint reference
Fixes https://gitlab.com/kicad/code/kicad/issues/10262

(cherry picked from commit 3ced3afa68)
2022-01-05 15:28:05 -05:00
Steffen Mauch d60e77176f eeschema: EAGLE plugin does not reference footprint with library suffix
Fixes https://gitlab.com/kicad/code/kicad/issues/10261

(cherry picked from commit 502e34349e)
2022-01-05 14:39:43 -05:00
Seth Hillbrand a05ec04ee8 Set readable flags correctly on open
Missing files may be thrown during open.  These should have existence
and readable flags set correctly
2022-01-05 09:54:10 -08:00
Jon Evans ea99c42df6 Move duplicate field handling into field parser
Fixes https://gitlab.com/kicad/code/kicad/-/issues/10130
2022-01-02 13:19:31 -05:00
dsa-t f2ad8bffe0 Fix a mistake in Altium parser
Fixes https://gitlab.com/kicad/code/kicad/-/issues/10011
2021-12-16 05:49:39 +03:00
Wayne Stambaugh 067fa65756 Eeschema: fix a multitude of LIB_FIELD object comparison and index bugs.
It is no longer acceptable to set a LIB_FIELD index to -1.  This was
trashing the sorting on load cause all kinds of false field comparison
failures.  There are now assertions when attempting to use -1 as a field
index.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/9811
2021-12-12 17:06:32 -05:00
Seth Hillbrand 91dace3e5e Update Eagle importer
Fixes arc orientation
Sets root schematic and page numbers

Fixes https://gitlab.com/kicad/code/kicad/issues/9907
2021-12-10 15:41:25 -08:00
Wayne Stambaugh af280f80e0 Fix debug assertion in Altium and CADSTAR schematic importers. 2021-12-09 12:56:03 +00:00
Wayne Stambaugh b7af66e3f9 Eeschema: fix broken page numbers when renaming a sheet file name.
Always use full sheet paths when storing sheet instances.  Partial sheet
paths cannot be full resolved resulting in lost page numbers when renaming
sheet file name.

Fixes #9782
2021-12-09 12:56:03 +00:00
Wayne Stambaugh a03e6e4926 Revert "Eeschema: fix broken page numbers when renaming a sheet file name."
This reverts commit a468a79948.
2021-12-06 07:47:18 -05:00
jean-pierre charras 3a00d76207 Fix a compil warning (shadowed var) and add a comment. 2021-12-01 11:05:16 +01:00
dsa-t bfe595819a Prevent error when loading bitmaps from some old schematics 2021-12-01 09:54:48 +00:00
Wayne Stambaugh a468a79948 Eeschema: fix broken page numbers when renaming a sheet file name.
Remove duplicate instance data saved in both root SCH_SCREEN and SCH_SHEET
objects that was causing them to be out of sync.  All sheet instance data
is stored in the SCH_SHEET object itself and rebuilt on the fly so it is
always current.

Remove Get/SetPageNumber from SCH_SHEET_PATH object so it doesn't obfuscate
where the actual sheet page number information exists.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/9782
2021-11-30 08:11:24 -05:00
Mikolaj Wielgus 9bb370e6b4 SCH_SHEET_PIN: Rename GetEdge, SetEdge to GetSide, SetSide 2021-11-28 20:07:06 +01:00
Jeff Young 58b5ac4970 Don't create SCH_LINE till we know the layer.
The CTOR makes some decisions on initialization based on the layer.
2021-11-28 17:09:24 +00:00
Roberto Fernandez Bautista 3660597082 Use canonical names when saving sheet name and filename fields 2021-11-27 20:38:51 +00:00
Jeff Young 228edd4121 Don't generate duplicate IDs in line/wire/bus tool.
Also cleans up existing duplicate IDs when reading.

Fixes https://gitlab.com/kicad/code/kicad/issues/9749
2021-11-24 13:20:44 +00:00
Jeff Young b052d56c7b R/W uuids for junctions. 2021-11-24 13:20:44 +00:00
Jeff Young 025d9f82ea Remove atrophied schematic default wire and bus widths.
(They're now in the netclasses, and specifically the default netclass
if no other netclass is assigned.)

Fixes https://gitlab.com/kicad/code/kicad/issues/9628
2021-11-13 22:56:50 +00:00
Wayne Stambaugh 80c5b1efb1 File formatting improvements and fixes.
Symbol library IDs included the library nickname which is incorrect
and meaningless since it will be overwritten by the symbol library
table code.  This is not a file format change as there are no behavioral
differences.
2021-11-13 12:57:18 -05:00
Jeff Young 54e00569d8 Don't fetch the root sheet's UUID out of the sheet instances.
1) we're storing it now anyway
2) the root sheet UUID is the one UUID that's *not* in the instance
array, and previously we were erroneously grabbing the first sub-sheet's
UUID (producing duplicate UUIDs).
2021-11-09 16:07:30 +00:00
Seth Hillbrand cf6b18ec7e Remove escaped double-quotes
For some reason, escaped double quotes in wxString::Format cause issues
on Mac.  We can replace them with single quotes in most places without
loss of clarity
2021-11-03 17:03:14 -07:00
Jeff Young c2371f3943 Revert e4b61de792.
It doesn't seem to fix the testcase on Linux, and the tests pass on
my machine in either configuration.
2021-11-03 10:30:34 +00:00
Jeff Young e4b61de792 Special case sheet ordering in file. 2021-11-02 23:14:01 +00:00
Seth Hillbrand 7cf72aaa41 Fix bezier import in Altium schematics 2021-11-02 15:45:30 -07:00
Jeff Young 4d46445ce1 Fix Bezier reading.
Fixes https://gitlab.com/kicad/code/kicad/issues/9512
2021-11-02 22:19:41 +00:00