Commit Graph

82 Commits

Author SHA1 Message Date
Marek Roszko af2707929d Don't leak a wx header via eda_item.h
Turns out this provided the translation header globally :D
2021-06-02 19:18:48 -04:00
Marek Roszko 382dca4e6f Fix uninitialized member warnings
Based on PVS Studio report
2021-05-30 20:01:01 -04:00
Seth Hillbrand be5b281501 Cleanup RAD2DEG and unused vars 2021-05-28 12:37:57 -07:00
Roberto Fernandez Bautista 9a9c9d38e8 CADSTAR Schematic: Cleanup pins in symbols
In CADSTAR pins are single points. We can replicate the original look
of the schematic in most cases by searching the symbol for straight
segments that are coincident with the pin and use those to calculate
a suitable pin length and angle.
2021-05-28 20:13:11 +01:00
Roberto Fernandez Bautista 29d1b84939 CADSTAR Schematic: Fix positioning of symbol attributes
Symbol attributes were being placed at the wrong location
due to incorrect relative angle calculation
2021-05-28 20:13:10 +01:00
Roberto Fernandez Bautista 8d788b7a09 CADSTAR Schematic: Fix assert regarding sheet absolute path 2021-05-28 20:13:10 +01:00
Roberto Fernandez Bautista b985c4d2e9 CADSTAR Schematic: Handle scaled symbols
Create a new LIB_PART for scaled symbols. These will be then embedded
into the schematic file. However when "update from library" is done,
it will revert to the unscaled symbol.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/8494
2021-05-28 20:13:10 +01:00
jean-pierre charras 31e9895a1a Fix a minor compil warning 2021-04-15 19:49:41 +02:00
Roberto Fernandez Bautista 45409ec314 CADSTAR Schematic: Fix orientation of symbol fields 2021-04-12 20:25:04 +01:00
Roberto Fernandez Bautista 9148542219 CADSTAR Schematic: Fix Text Positioning within Symbols 2021-04-12 20:25:03 +01:00
Wayne Stambaugh 2b86b34124 Eeschema: split out SCH_SHEET_PIN declarations into separate header. 2021-04-06 17:15:49 -04:00
Roberto Fernandez Bautista d041578150 CADSTAR Schematic: Fix import of text alignment
Ensure that the text alignment applied to text objects corresponds to
valid text alignments that can be set within eeschema

Fixes https://gitlab.com/kicad/code/kicad/-/issues/8090
2021-04-05 20:15:08 +01:00
Carsten Schoenert cb17c9f3dd Typo fix: Correct various misspelled words
agressive -> aggressive
decription -> description
miscellanous-> miscellaneous
rectange -> rectangle
Unkown -> Unknown
2021-04-03 13:39:50 +00: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
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
Jon Evans c04e19f9ac Include optimization: move some things from common.h to point-of-use 2021-03-20 12:09:18 -04: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
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
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
Roberto Fernandez Bautista 4dc264175a CADSTAR Schematic Archive Importer: Symbol name is case insensitive
Fixes an issue on some designs that would not be able to find the
symbol definition referenced by the part due to different
capitalisation of the symbol name in the part definition and
the symbol definition.
2021-02-10 18:49:20 +00:00
Roberto Fernandez Bautista 914ae001b5 CADSTAR Schematic Archive Importer: Load pin types
Default to passive if undefined
2021-02-10 18:49:20 +00:00
Roberto Fernandez Bautista f530b12c31 CADSTAR Schematic Archive Importer: Handle undefined pin number in part
Use terminal pin number (i.e. from the symbol definition) when the pin
number is undefined in the part.
This fixes a bug that resulted in symbols with "0" as the pin numbers.
2021-02-10 18:49:20 +00:00
Roberto Fernandez Bautista cc27c31ab0 CADSTAR Schematic Archive Importer: Import common fields visibilities
Import field visibilities for Ref, Value and Part Name
Also fix incorrect loading of designator from previous commit
2021-02-10 18:49:20 +00:00
Roberto Fernandez Bautista 297ff282f1 CADSTAR Importer: Update copyright years and remove white spaces 2021-02-10 18:49:20 +00:00
Roberto Fernandez Bautista bb6fee531e CADSTAR Schematic Archive Importer: Correctly load symbol instances
Previous implementation was not loading all fields defined in the
library.
2021-02-10 18:49:20 +00:00
Roberto Fernandez Bautista b0051c07cb CADSTAR Schematic Archive Importer: Load all fields in symbols
- Load Fields in the library items as well as schematic instances
- Remove invalid characters (e.g. '\n', '\t', '\r') in fields
- Load footprint field (assume that the footprint library name
  is the same as the filename of the schematic)
2021-02-10 18:49:20 +00:00
Roberto Fernandez Bautista b168b74919 CADSTAR Archive Importer: Fix position of multiline text with NO_ALIGNMENT in CADSTAR 2020-12-30 18:53:43 +00:00
Roberto Fernandez Bautista a33ccf48b9 CADSTAR Schematic Archive Importer: Load signal name even if no net label (global labels and power symbols)
Fixes error that prevented global net names from being loaded properly
2020-12-30 18:53:43 +00:00
Roberto Fernandez Bautista f6ec173ba7 CADSTAR Schematic Archive Importer: Do not load blocks without a linked sheet
Fixes std::out_of_range error
2020-12-30 18:53:43 +00:00
Roberto Fernandez Bautista 728792aa3c CADSTAR Schematic Archive Importer: Fix SIGLOC in JPT (Load labels in junctions)
Fixes but that refused to open file with a SIGLOC node in JPT
2020-12-30 18:53:43 +00:00
Roberto Fernandez Bautista a5118df44c CADSTAR Schematic Archive Importer: Load Schematic Text Variables to KiCad project 2020-12-30 18:53:43 +00:00
Roberto Fernandez Bautista 9ed4780fec CADSTAR Archive Importer: Change architecture to Parse CADSTAR fields and store them in a static map
Architecture of the parser changed to have a shared PARSER_CONTEXT between all the individual parsers.
Parses CADSTAR fields such as <@DESIGN_TITLE@> or <@SHEET_NUMBER@> and replaces with an equivalent KiCad Text Variable.
2020-12-30 18:53:42 +00:00