Commit Graph

314 Commits

Author SHA1 Message Date
Jeff Young 1818846cff Minor improvements to some error messages. 2021-08-14 12:11:47 +01:00
Stefan bed51a5fc1 altium schematic importer, replace record 211 with compile masks 2021-08-14 11:05:56 +00:00
Jeff Young 6ab45d0a6d Fix double-escaping in Eagle importer.
This has actually been there since dot, but the old escaping method
just deleted chars it didn't like so you could run it as many times
as you wanted.

Fixes https://gitlab.com/kicad/code/kicad/issues/8694
2021-07-31 20:07:25 +01:00
Jeff Young 6aaf4413b3 Fix kicad_string.h / string.cpp mismatch.
They don't define a KiCad string class, so the header file name was
somewhat misleading. But the fact that they didn't match definitely
made coding more difficult.
2021-07-29 16:03:25 +01:00
Jeff Young f221220fe2 Rename layer ids file.
It hasn't had anything to do with colors or visibility for some time
now.
2021-07-29 16:03:25 +01:00
jean-pierre charras 8ff76de18e DIALOG_EDIT_ONE_FIELD: fix a non resizable widgets and fix a compil warning.
Fixes #8877
https://gitlab.com/kicad/code/kicad/issues/8877
2021-07-27 14:12:46 +02:00
david-beinder 8467fe5405 Altium schematic import: text positioning and arc fixes
Fixes https://gitlab.com/kicad/code/kicad/-/issues/8844 (power port text positioning, only use 0, 90deg for text)
Adjust text justification due to rotation on import
Set field position through SCH_FIELD::SetPosition
Honor hidden net names at power ports
Calculate start/end points for imported arcs in symbols
2021-07-26 19:49:56 +00:00
Wayne Stambaugh 8fd83cbb95 Pass wxPoint objects by reference instead of on the stack. 2021-07-26 15:35:33 -04:00
Jeff Young 010247bb7f Add overbar conversion to the legacy SCH reader.
Fixes https://gitlab.com/kicad/code/kicad/issues/8855
2021-07-25 13:11:30 +01:00
Jeff Young 531f5480a7 Reduce line-breaks and increase SNR. 2021-07-24 14:25:59 +01:00
Wayne Stambaugh cb72da294a More NULL expunging. 2021-07-16 16:13:41 -04:00
luz paz 0446d35f0d Fix source comment/doc typos (follow-up)
Found via `codespell -q 3 -S *.po,./thirdparty -L aactual,acount,aline,alocation,alog,anormal,anumber,aother,apoints,aparent,aray,dout,einstance,modul,ot,overide,serie,te,,tesselate,tesselator,tht`
2021-07-13 10:48:17 +00:00
jean-pierre charras ad7e563e24 Do not translate something similar to a proper noun 2021-07-12 09:02:04 +02:00
Jeff Young a4263ebce5 Clean up Altium special string handling
1) Fix a couple of bugs in case processing
2) Make case processing more explicit to prevent more (1)
3) Move label processing to AltiumSpecialStringsToKiCadVariables
4) Strip double-quotes from special strings (and add test cases)
5) Change PROJECTNAME to just filename, not full path
6) PROJECTREV and REVISION are two different things
7) Add support for Altium's Application_BuildNumber
8) Fix some issues in trimming spaces around special strings
2021-07-08 15:34:38 +01:00
Jeff Young 3f165c70e1 Import more Alitum parameters.
ADDED CURRENT_DATE titleblock token (to go with existing ISSUE_DATE)
ADDED PROJECTNAME schematic token (to go with FILENAME and SHEETNAME)

Converts other parameters to project text variables.
2021-07-08 00:19:31 +01:00
Jeff Young c1db5dc0b1 Make the variable replacement table a little easier to read.
Yes, this probably violates all our formatting conventions EXCEPT
the one that says code should be easy to read/visually parse.
2021-07-07 22:06:35 +01:00
Jeff Young 9351a88091 Variable references are case insensitive in Altium. 2021-07-07 22:04:00 +01:00
Jeff Young 5a57f6ba98 Clear NEW flags after import.
Fixes https://gitlab.com/kicad/code/kicad/issues/8750
2021-07-07 20:05:50 +01:00
Jeff Young db91908c18 Add sheetpath instances when importing sheets from Altium. 2021-07-07 20:05:50 +01:00
Jeff Young a81c6b21b6 Formatting. 2021-07-07 20:05:50 +01:00
Thomas Pointhuber 5e9a8e3488 altium: Improve handling of footprint references
Don't assume the implementation list index is always correct by order.
2021-07-07 21:03:21 +02:00
Jeff Young a17862d646 Import Altium harness labels as text.
One day we'll do better, but at least this way the user knows there's
something they need to migrate manually.

Fixes https://gitlab.com/kicad/code/kicad/issues/8748
2021-07-07 17:54:22 +01:00
Jeff Young 5ab56e5320 More Altium importer error reporting cleanup.
1) Use REPORTER instead of wxLog
2) Use consistent, non-techy strings
3) Use consistent severity levels

Fixes https://gitlab.com/kicad/code/kicad/issues/8747
2021-07-07 12:43:33 +01:00
Jeff Young 3b288b1b1b Pull textframe processing out from under note and allow both.
Note that there's still a bunch of stuff we don't support regarding
textframes such as wordwrap and background colours, but this at least
keeps the text from getting lost.

Fixes https://gitlab.com/kicad/code/kicad/issues/8741
2021-07-06 20:27:28 +01:00
Jeff Young 190b0ecdeb Formatting. 2021-07-06 20:27:28 +01:00
Jeff Young 0be91c5b7d Import Altium footprint references into symbols.
Fixes https://gitlab.com/kicad/code/kicad/issues/7751
2021-07-06 14:40:29 +01:00
Jeff Young 3288971a7c Allow titleblock vars to be resolved outside the titleblock.
Also implements some variable resolving for Altium imports.
2021-07-06 13:30:17 +01:00
Jeff Young b0c07a28b3 Add importing of Altium notes.
Import is incomplete because KiCad doesn't support text boxes yet
(so we can't do borders, word-wrap, background fills, etc.).

Fixes https://gitlab.com/kicad/code/kicad/issues/8734
2021-07-05 23:59:43 +01:00
Jeff Young 26df39e71a Naming conventions. 2021-07-05 11:05:46 +01:00
Jeff Young aa5902bd99 Process Altium pin name and number hidden flags.
Fixes https://gitlab.com/kicad/code/kicad/issues/7853
2021-07-04 00:18:42 +01:00
Marek Roszko eff75b630f Get rid of anonymous struct typedefs
We are using C++14 where there is no reason for this and is banned in C++20 under P1766R1. MSVC generates a warning under C++14 as a reminder.
2021-07-01 18:28:41 -04:00
Jeff Young f8a34d98b3 Support for overbar syntax in Altium importer.
Fixes https://gitlab.com/kicad/code/kicad/issues/7979
2021-07-01 21:03:53 +01:00
Jeff Young 6810912f09 Refuse to load schematics from the future.
Also fixes a bug where an empty window would get left when loading
a file from the KiCad manager window errored out.

Also fixes a bug where we were getting the wrong exception because
we were rethrowing the type-casted one (rather than just calling
throw).

Fixes https://gitlab.com/kicad/code/kicad/issues/8604
2021-06-30 18:32:07 +01:00
Jeff Young 5cac8afe1d Remove long-dead revision support for LIB_IDs. 2021-06-30 13:12:57 +01:00
Jeff Young b1b4caee6a Escape "naughty" characters in symbol names.
It's tempting to say that we don't need to exclude filename chars
from symbols, but we might regret that decision down the road.  Better
to just escape them.

Fixes https://gitlab.com/kicad/code/kicad/issues/8694
2021-06-30 13:12:57 +01:00
Jeff Young a1dfc36233 More error message regularization. 2021-06-29 01:08:26 +01:00
Jeff Young 062c4fda62 More error message regularization (and translatability improvements). 2021-06-28 00:45:24 +01:00
Jeff Young 4aa8318dc2 More error message regularization. 2021-06-27 14:24:02 +01:00
Jeff Young 0dfb5fcaf9 Error message cleanup.
wxString::Format is redundant in a wxLogXXX call.
Error messages should generally be translatable.
Error messages should use generally consistent sentence forms.
2021-06-26 22:53:24 +01:00
Jeff Young 5c21f93803 Consistency in progress and error messages. 2021-06-26 13:23:43 +01:00
Jeff Young 8502fd6877 Divide-by-zero safety. 2021-06-24 12:18:22 +01:00
Jeff Young 5fa5a73c6d File open/import progress dialogs.
Fixes https://gitlab.com/kicad/code/kicad/issues/6864

Fixes https://gitlab.com/kicad/code/kicad/issues/2166
2021-06-23 23:55:54 +01:00
Jeff Young 6d223931fb Convert overbar syntax in bus aliases.
Fixes https://gitlab.com/kicad/code/kicad/issues/8647
2021-06-21 20:13:21 +01:00
Mikolaj Wielgus 19f76ae77c Convert pin names to new overbar format
Fixes bug 6 of https://gitlab.com/kicad/code/kicad/issues/8591, thereby
closing the issue:

Fixes https://gitlab.com/kicad/code/kicad/issues/8591
2021-06-20 09:00:16 +00:00
Jeff Young d811ae0aa3 Improved ASCII art. 2021-06-18 12:01:16 +01:00
jean-pierre charras c35cceca62 fix compil warnings ( "multi-line comment" ) and missing override 2021-06-18 09:38:19 +02:00
Jeff Young bdeeace2ab More Eagle importer fixes.
1) Don't process wires more than once when looking for bus entries.
2) Don't allow processing a wire to mess up iteration over the RTree.
2021-06-17 18:16:38 +01:00
Jeff Young b10f156dd0 Don't convert overbar syntax in most fields.
You probably do want it in VALUE, but not REFERENCE, and certainly
not FOOTPRINT or DATASHEET.  User fields are more likely to be
part numbers, etc. (and don't want conversion).

Fixes https://gitlab.com/kicad/code/kicad/issues/8617
2021-06-17 00:05:17 +01:00
Jeff Young c23c5b7f18 Allow import of Eagle schematics without libraries. 2021-06-16 22:02:50 +01:00
Jeff Young 4b28bac89a Fixes for Eagle importer.
1) Make sure we set an absolute path on the sheet.
2) Don't mix RTree iterators; wires get skipped between buses.
3) Implement a real ERC error so we don't assert.

Fixes https://gitlab.com/kicad/code/kicad/issues/7042
2021-06-16 21:44:18 +01:00
Jeff Young 21b869bd1f Fix a few cases missed in the last merge.
Fixes https://gitlab.com/kicad/code/kicad/issues/7042
2021-06-16 00:01:28 +01:00
Jeff Young 3a84ee27fd First take at repairing Eagle import of bus entries.
Simplify logic by adding quadrant-based BUS_ENTRY ctor.
Fix issue with bus entry size having been in mils rather than IU.
Fix issues with logic.

Fixes https://gitlab.com/kicad/code/kicad/issues/7042
2021-06-15 23:23:47 +01:00
Wayne Stambaugh ff099453c8 Rename class_library.[h|cpp] to symbol_library.[h|cpp]. 2021-06-15 09:24:55 -04:00
Wayne Stambaugh ee3eac325d Expunge the use of the word part from Eeschema code. 2021-06-15 08:32:11 -04:00
Wayne Stambaugh fb46cd8bc5 Expunge the use of the word component from Eeschema code.
The only exception to this is the SPICE simulator's use of component
when referring to physical component (R, L, C, etc.) values.
2021-06-14 14:00:21 -04:00
Wayne Stambaugh 71c183d7bb Rename LIB_PART to LIB_SYMBOL. 2021-06-14 07:11:17 -04:00
Mikolaj Wielgus ade38f48bc Add conversion from old `~...~` to new `~{...}` notation 2021-06-11 18:40:57 +00:00
Wayne Stambaugh fbc135e69f Rename SCH_COMPONENT to SCH_SYMBOL. 2021-06-10 10:34:49 -04:00
luz paz f968fc8719 Fix source comment / documentation typos 2021-06-09 19:32:58 +00:00
Marek Roszko d946d6e68f Cleanup some pgm_base.h includes 2021-06-08 21:56:00 -04:00
Wayne Stambaugh 9ebabb222c Pass objects by reference instead of on the stack. 2021-06-08 10:09:38 -04:00
Johannes Maibaum 022dd6072c Add utility method to resolve symlinks
The same logic block to resolve possible symlinks exists in 5 different
places now. This change moves this duplicated code to a static member
function of WX_FILENAME instead.
2021-06-07 20:59:59 +00:00
Marek Roszko fc3cea2cca Remove wx/xml/xml.h from sch_eagle_plugin.h 2021-06-06 09:34:57 -04:00
Johannes Maibaum 06e967354f Fix symlink read-/write-through code
Use `realpath(3)` instead of `readlink(3)`, which offers support for
relative and absolute symlinks alike, since all symbolic links will be
resolved to the absolute path of the linked-to file.

Fixes #8082
2021-06-05 14:22:50 +00:00
Marek Roszko 4df3cb912d Remove another leaky wx/log.h header 2021-06-03 08:11:15 -04:00
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 eeb405c196 Cleanup some more excess math/util includes 2021-06-02 00:50:46 -04:00
Marek Roszko cf2bb5692a Remove the wxLog calls from math/util.h for now
This was leaking windows headers and partial wx headers to 1084 compilation units......
This also means math/util.h is leaking to 1084 compilation units which seems a bit high too.
2021-06-01 18:44:22 -04:00
Marek Roszko 3ac5aa5369 enum class SHEET_SIDE 2021-05-30 21:23:46 -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
Seth Hillbrand 752ae4d519 Rename modification flag routines
Differentiates better between the EDA_ITEM IsModified(), referring to
items themselves changing and the EDA_SCREEN IsContentModified(),
referring to whether we have made any unsaved changes.
2021-05-28 12:07:04 -07:00
Roberto Fernandez Bautista be436ec977 Remove whitespace from page numbers on load and use # if page is empty
Fixes https://gitlab.com/kicad/code/kicad/-/issues/8350
2021-05-21 22:52:47 +01:00
Wayne Stambaugh ebd53cd45c Eeschema: fix text justification terminology.
Use justification instead of orientation relative to the anchor point when
describing text direction and alignment.  This seems to be the preferred
method by most users so hopefully this will eliminate some confusion.

Fix a bug in the s-expression schematic parser that failed to take into
account how graphical text alignment is defined for graphic text objects
compared to label text objects.

Fixes https://gitlab.com/kicad/code/kicad/issues/6489
2021-05-14 13:44:17 -04:00
Jeff Young 2e3860de6f Naming conventions. 2021-05-05 22:58:40 +01:00
Marek Roszko c7345096f8 Use wxFFileInputStream explicitly when loading xml documents
wxFFile (FILE, buffered) is better than wxFile (syscalls)
2021-05-03 19:39:56 -04:00
Roberto Fernandez Bautista cf2dc06add Fix latent bugs in SCHEMATIC and SCH_SEXPR_PLUGIN
Noticed after writing the qa test: when loading a file immediately
after having loaded a previous one, it was resulting in a nullptr
exception.
2021-05-03 19:38:31 +01:00
Roberto Fernandez Bautista 5822cd85c4 Fix eeschema copy/paste: save and load sheet and symbol instances
Save sheet and symbol instance information to the clipboard on copy

Load sheet and symbol instance information from the clipboard on paste
and renumber page numbers after loading.

Correctly handle pasting in a multiple hierarchy by ensuring symbol and
sheet instances are updated for all instances of the destination sheet.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/8207
2021-05-03 19:38:31 +01:00
Roberto Fernandez Bautista 91fd28c4be Refactor saving sheet and symbol instances in SCH_SEXPR_PLUGIN::Format
Avoid code duplication by moving all common code to a new function
SCH_SEXPR_PLUGIN::saveInstances

Also fixes a bug that was resulting in footprint and value information
not being saved for subsheets that were root sheets in a different
project.
2021-05-03 16:54:42 +01:00
Ian McInerney ecd9bf696e Be consistent about using nullptr instead of 0
0 can be too easily overloaded into an int, so ensure we use nullptr
when we mean pointers.
2021-04-22 22:20:34 +01:00
Ian McInerney ae91042544 Implement thread safety for symbol loading routines
These functions can be called from any thread of the library
loader, so we need to ensure we have some thread safety with them.
2021-04-18 18:39:46 +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
Thomas Pointhuber f13eb13b9a altium: import images from SchDoc 2021-04-10 21:52:37 +02:00
Wayne Stambaugh 2b86b34124 Eeschema: split out SCH_SHEET_PIN declarations into separate header. 2021-04-06 17:15:49 -04:00
Wayne Stambaugh df186a2049 Eeschema: fix root sheet UUID changing in project file.
This change is a bit more invasive than the description above would
suggest. UUIDs have been added to all schematics.  For now, it's only
useful to the root schematic so that the UUID in the project file does
not change every time the project file is save.  In the future, it may
be useful to store and check the schematic UUIDs against the one's saved
in the project file.

Fixes https://gitlab.com/kicad/code/kicad/issues/7763
2021-04-06 14:28:01 -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 ebfbe14185 Persist fields_autoplaced information.
Fixes https://gitlab.com/kicad/code/kicad/issues/8086
2021-04-02 17:08:58 +01:00
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