Commit Graph

447 Commits

Author SHA1 Message Date
Jeff Young 638198251a Coverity fixes. 2022-08-22 17:52:58 +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 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
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
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
WhiteChairFromIkea 15549364d5 Import HARNESS_ENTRY as Hierarchical sheet pins 2022-08-15 22:55:39 +00:00
WhiteChairFromIkea 14ceece4f6 Import HARNESS_CONNECTOR as Hierarchical sheet 2022-08-15 22:55:39 +00:00
WhiteChairFromIkea b64f6ccc18 Import SIGNAL_HARNESS as graphical polyline 2022-08-15 22:55:39 +00:00
Seth Hillbrand 35ac39844f Clean up some auto usage
Don't make new copies of shared_ptr if we can use references.  Keep auto
usage down to hard-to-type-out sequences
2022-08-15 11:29:45 -07:00
Marek Roszko c418b25756 Centralize the parseDouble functions in the parsers and gcc specialcase 2022-08-14 18:46:19 -04:00
Roberto Fernandez Bautista 69d696660b cadstar: Report warning that imported text may be different
Fixes https://gitlab.com/kicad/code/kicad/-/issues/12195
2022-08-14 22:24:16 +01:00
Marek Roszko a070959209 Switch from strtod to std::from_chars for performance 2022-08-14 16:19:24 +00:00
Jeff Young 6f49b57f9b Cleanup & performance enhancements. 2022-08-01 13:09:51 +01:00
jean-pierre charras 993c446fdf Fix some warnings detected by PVS-STUDIO (most are not used vars) 2022-07-25 18:23:52 +02:00
Jeff Young 404015b0a5 Pay attention to units for page frames.
Fixes https://gitlab.com/kicad/code/kicad/issues/11408
2022-07-23 20:17:04 +01:00
Jeff Young 16b9a7a1e5 Attempt to fix Locale issue.
Fixes https://gitlab.com/kicad/code/kicad/issues/9659
2022-07-23 11:20:04 +01:00
Seth Hillbrand 6fef054c51 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
2022-07-07 11:13:11 -07:00
Jeff Young d5a6452934 Get rid of special default line style for Eeschema.
Fixes https://gitlab.com/kicad/code/kicad/issues/11882
2022-06-27 19:12:45 -06:00
Jeff Young d9cfbc7b96 Fix missing SCH_LABEL case in SCH_PLUGIN.
Fixes https://gitlab.com/kicad/code/kicad/issues/11913
2022-06-27 16:21:32 -06:00
Roberto Fernandez Bautista 8725c3a35f CADSTAR Schematic: Load symbols even if part definition is incomplete
Fixes https://gitlab.com/kicad/code/kicad/-/issues/11671
2022-06-15 19:47:50 +01:00
Jeff Young ec40a98fe2 wxT 2022-06-08 23:53:18 +01:00
Wayne Stambaugh dfea73f78c 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 17:00:57 -04:00
Jeff Young aaff163d7c 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
2022-05-31 17:48:38 +01:00
Marek Roszko 88c7322a0d EDA_TEXT Get/SetTextSize should use VECTOR2I 2022-05-14 08:16:15 -04:00
Simon Richter 1e505d4c22 Remove a few call sites of SCH_SHEET::SetSize
This function is dangerous and should be used only by parsers, and not even
those, really.

For new objects, the size can be passed to the constructor.
2022-04-18 16:23:03 +02:00
Jeff Young 6ef6e37edb Disable using default instance data when writing to clipboard.
Fixes https://gitlab.com/kicad/code/kicad/issues/11379
2022-04-14 17:09:27 +01:00
Roberto Fernandez Bautista 85f6ff48e7 CADSTAR Sch: Clear symbol of all elements before overwriting with new one
Fixes https://gitlab.com/kicad/code/kicad/-/issues/11378
2022-04-12 21:34:23 +01:00
Wayne Stambaugh 239f0214ac Eeschema: add support for default schematic symbol instance data.
Prior to fixing the schematic file change churn do to instance data
changing to the last selected sheet instance, the symbol instance data
was set rather than empty.  This change allows for users to set the
default instance data which is used for every new instance of the
schematic.

ADDED: Default schematic symbol instance data (unit and reference, value,
       and footprint fields) can be set to be used as the default settings
       for all new instances of the schematic.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/11113
2022-04-09 07:49:36 -04:00
Jeff Young e8a543f1ea Colors for text in PL_Editor and Eeschema.
Fixes https://gitlab.com/kicad/code/kicad/issues/1952
2022-03-31 19:43:56 +01:00
Jeff Young 47f4503564 SCH textboxes start/end -> at/size.
The at token can handle an angle; start/end does not.

Fixes https://gitlab.com/kicad/code/kicad/issues/11252
2022-03-28 11:16:39 +01:00
jean-pierre charras cfe0003ca4 Eeschema: fix misplaced nullptr test that prevent saving SCH_TEXT items.
Fixes #11250
https://gitlab.com/kicad/code/kicad/issues/11250
2022-03-27 18:48:55 +02:00
jean-pierre charras 38bd612c01 sch_sexpr_parser.cpp: allows reading a polyline descr with more than 2 points
In symbols, a polyline descr is already a true polyline / polygon descr.
In schematic, a polyline descr was restricted to only 2 points (a line).
A true polyline / polygon descr is now allowed in schematic that support already
polygons.
For compatibility reason, a 2 points polygon (SCH_SHAPE) is converted to a SCH_LINE.
2022-03-27 10:31:21 +02:00
Wayne Stambaugh 7da7864f5e Fix some Coverity issues. 2022-03-25 15:51:05 -04:00
Jeff Young 8eb10c41d8 Name any unnamed fields so they don't clobber each other.
Fixes https://gitlab.com/kicad/code/kicad/issues/10039
2022-03-22 18:08:05 +00:00
jean-pierre charras 21144481d2 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
2022-03-22 10:32:36 +01:00
Jeff Young 4f62960334 Update message panel from PCB point editor and SCH drawing tools.
Fixes https://gitlab.com/kicad/code/kicad/issues/11186
2022-03-21 10:32:36 +00:00
jean-pierre charras 1f5ec30566 Fix and issue about 180 deg arcs in symbols from "old" libraries.
Can be seen with lib version 20201005, not with latest version.
The fix is similar to commit 8a17fb8d, but for arcs defined by start, end, angles
(modify 180 deg arcs)
Fixes #11130
https://gitlab.com/kicad/code/kicad/issues/11130
2022-03-15 11:31:58 +01:00
Wayne Stambaugh dd1dbb81f6 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.
2022-03-11 12:37:30 -05:00
Wayne Stambaugh bf5d585e24 Reduce shared schematic file change churn. 2022-03-11 00:32:34 +00:00
Seth Hillbrand cd7141fd10 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
2022-03-04 15:20:31 -08:00
Jeff Young c025b4c73d Save all stroke parameters of sch & lib shapes.
We were failing to save the line style, which caused ERC errors when
DEFAULT != SOLID.
2022-03-03 14:37:04 +00:00
Seth Hillbrand 8c36ba3653 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
2022-03-02 16:01:08 -08:00