Commit Graph

120 Commits

Author SHA1 Message Date
Jeff Young d6e9bdf07b Convert remaining legacy drawing code to print code. 2019-05-31 21:54:22 +01:00
Jeff Young 952108dd43 Implement SCH_SHEET_PIN selection, rotation and mirroring.
Fixes: lp:1829521
* https://bugs.launchpad.net/kicad/+bug/1829521
2019-05-18 00:23:12 +01:00
jean-pierre charras 0a308c4584 Fix minor compil warnings 2019-05-11 11:12:39 +02:00
Jeff Young da988428cf Add modern toolset cut/copy/paste. They now use the system clipboard. 2019-05-05 17:12:59 +01:00
John Beard 15bba27406 BITMAP_BASE: Add const image data accessor
This allows a const BITMAP_BASE to expose const image
data. This is currently done with const_casts, which is
"OK", only as long as the source image is not declared
const, in which case it's undefined behaviour.

Also immediately dereference the pointer to a reference
if it's not checked to make the non-null requirements
explicit at the point of access.
2019-04-24 17:31:22 +01:00
Jeff Young 460909ea9a Move click-to-place tools to modern toolset. 2019-04-16 16:20:52 +01:00
Jeff Young b6c0aeb608 Move cut/copy/paste part (in libedit tree) to real clipboard.
Fixes: lp:1821547
* https://bugs.launchpad.net/kicad/+bug/1821547
2019-04-08 11:21:58 +01:00
Wayne Stambaugh ee14da3093 Minor schematic formatter fix.
Apparently at some point in KiCad's development, a '~' character was
prefixed to the symbol name to indicate that it was not visible.  The
visibility state is now saved in the name field so remove the prefix.
The parser was kept unchanged.

Fixes lp:1632048

https://bugs.launchpad.net/kicad/+bug/1632048
2019-04-04 10:43:04 -04:00
Jon Evans 83c7e7fc65 New connectivity algorithm and bus upgrades
Bus upgrades: core new connectivity code

Bus upgrades: eeschema integration and modifications

Bus upgrades: eeschema dialogs

Bus upgrades: netlist export

Bus upgrades: file format changes
2019-03-31 19:53:41 -04:00
jean-pierre charras 175a2bc0b4 Force time stamp to 32 bits unsigned values, and make it tolerant to files using 64 bits values.
define timestamp_t as uint32_t.

Fixes: lp:1821476
https://bugs.launchpad.net/kicad/+bug/1821476
2019-03-26 14:28:14 +01:00
Jon Evans ab74445df4 Fix loading of components with convert parameter set to zero 2019-03-23 18:51:13 -04:00
Wayne Stambaugh cf7639b4da Fix coding policy violations of previous patch. 2019-03-15 09:09:42 -04:00
Brian Henning 79bacd15e1 Made LIB_PART parsing and formatting (from/to string) static and public 2019-03-15 08:32:28 -04:00
Seth Hillbrand 72c885797e Eeschema: prevent schematic images with bad scales
Prevent obvious scale issues (0.0, nan, etc) from corrupting display of
schematic images.  In these cases, we reset the scale value to 1.0 and
allow the user to input the appropriate value when editing the
schematic.

Fixes: lp:1811066
* https://bugs.launchpad.net/kicad/+bug/1811066
2019-01-15 07:42:22 -08:00
jean-pierre charras e50d9df76a Eeschema: fix incorrect parsing of line color (r v b values).
Only the R and V were read, the parsing was stopping before reading the B value.
2018-12-09 17:59:24 +01:00
Wayne Stambaugh b8de4e73bf Eeschema: fix schematic symbol parsing bug.
Schematic symbol library link names are unquoted strings that can
contain non-ascii characters which breaks the parser.  Converting
the line to uft-8 before breaking the string into tokens resolves
the issue.
2018-12-06 12:44:13 -05:00
Wayne Stambaugh 742961119d Eeschema: fix library symbol pin definition parsing bug.
Pin names are unquoted strings that can contain non-ascii characters
which breaks the parser.  Converting the line to uft-8 before breaking
the string into tokens resolves the issue.
2018-12-06 11:47:20 -05:00
Wayne Stambaugh a61a51f26e Eeschema: fix UTF8 character handling bug in legacy parser.
Iterating over unquoted strings as ASCII8 fails when ' ' character is
not the LSB of a UTF8 string with wide characters.  Change parsing method
for unquoted strings to convert the entire line as UTF8 and then use
wxStringTokenizer to break the line into tokens at the ' ' characters.

Fixes lp:1806206

https://bugs.launchpad.net/kicad/+bug/1806206
2018-12-05 13:54:51 -05:00
Wayne Stambaugh 34ea79eddb Fix LIB_ID illegal character tests.
The '/' and ':' are reserved and cannot be used in symbol or footprint
names.  They will cause the LIB_ID parser and formatter to fail.  While
it seems like they should be legal in symbol alias names, they will
trigger a symbol rescue the next time the schematic is loaded.

Use ID_SCH as in the Eagle schematic plugin rather than ID_ALIAS to
ensure symbol names do not need rescued the next time the schematic is
opened.

Remove ID_ALIAS since the rules for alias names are the same as the
rules for symbol names.  Otherwise, allowing '/' and ':' in alias names
will force a symbol rescue on the next schematic load.

Fixes lp:1795600

https://bugs.launchpad.net/kicad/+bug/1795600
2018-10-07 09:09:27 -04:00
Jeff Young 0b39b68d37 Generate error dialog when a symbol library can't be found.
Fixes: lp:1789047
* https://bugs.launchpad.net/kicad/+bug/1789047
2018-09-17 18:01:08 +01:00
jean-pierre charras 202b35bc90 Eeschema: Fix incorrect parsing of old schematic files (version 2) for HLabels and GLabels 2018-09-03 19:51:17 +02:00
jean-pierre charras 45395f9b59 Eeschema: fix a bug when reading .dcm files (the eol char was not stripped, giving broken fields values)
The parser also now skip empty lines.

This bug created unreadable saved .dcm files and .sch files after adding a new symbol.

Fixes: lp:1786141
https://bugs.launchpad.net/kicad/+bug/1786141
2018-08-09 09:09:36 +02:00
jean-pierre charras 21195a751d Eeschema: sch_legacy_plugin.cpp: fix incorrect parsing of pin position.
The issue is in:
wxPoint( parseInt( aReader, line, &line ), parseInt( aReader, line, &line ) )
that calls parseInt() twice, but parseInt changes parameters at each call.
(Does not return the same value at each call).
However, due to some side effect or compil optimization, the value returned is incorrect.
It can be dependent of the compiler, and optimization level.

This kind of code must be avoided.
2018-08-08 10:15:44 +02:00
Jeff Young 20bf6827e7 Minor performance enhancements to symbol loading. 2018-08-07 17:01:44 +01:00
Jeff Young cb61525394 Handle separate parsing rules for ID_SCH and ID_PCB.
This removes the existing constructors so that all parsing must
be explicit and callers are made aware that they need to think
about illegal characters, malformed ids, etc.

Fixes: lp:1783474
* https://bugs.launchpad.net/kicad/+bug/1783474
2018-07-26 15:43:53 +01:00
Jeff Young f79ca271e3 Replace missing #ifndef's.
We only process symlinks on POSIX kernels (Linux and OSX).

Fixes: lp:1548798
* https://bugs.launchpad.net/kicad/+bug/1548798
2018-07-24 09:05:39 +01:00
Jeff Young bc47f085df Support symlinks for .pretty and .lib files.
Fixes: lp:1548798
* https://bugs.launchpad.net/kicad/+bug/1548798
2018-07-23 23:50:13 +01:00
Maciej Suminski 8ba694e6fd eeschema: fix alias names in .dcm files
Fixes: lp:1781761
* https://bugs.launchpad.net/kicad/+bug/1781761
2018-07-17 14:27:41 +02:00
Seth Hillbrand d30ac2967a eeschema: Rescue symbols with illegal chars
When parsing component names, we need to account for the possibility of
illegal characters (e.g. "/", ":") in the names from v4 libraries.  They
are fixed internally by the cache parser but if we don't fix them
in the rescue routine, the symbol won't match it's cache name.

This standardizes all schematic illegal character routines into LIB_ID

Fixes: lp:1774774
* https://bugs.launchpad.net/kicad/+bug/1774774
2018-06-27 14:15:30 -07:00
jean-pierre charras 509793a5b4 Symbol editor: Inversion sign ("~") incorectly ùmanaged in graphic texts.
It was always replaced with space in a graphic text, but it should happens
only in non quoted texts
Now graphic texts containing ' ' or '~' or '"' are always quoted
(work fine with 4.0 version)

Fixes: lp:1771105
https://bugs.launchpad.net/kicad/+bug/1771105
2018-05-14 17:49:30 +02:00
Maciej Suminski 194c57133c SCH_LEGACY_PLUGIN::loadHierarchy() uses a stack to maintain sheet paths
Path keeping stack copes well with paths pointing outside the project
directory (e.g. "../path"). The so far used wxFileName::GetDirCount() and
wxFileName::RemoveLastDir() remove too many directories, as ".." is also
counted as a directory.

Fixes: lp:1769746
* https://bugs.launchpad.net/kicad/+bug/1769746
2018-05-09 11:30:23 +02:00
Maciej Suminski 26ee673a6b Validate symbol alias names read from .dcm files
Fixes: lp:1766551
* https://bugs.launchpad.net/kicad/+bug/1766551
2018-04-25 10:15:44 +02:00
Wayne Stambaugh 41c1657eb6 Eeschema: fix bug in sheet path loading logic.
When a relative sheet path was not in the project path or a subfolder
within the project path, the schematic path would be empty.  Set the
base path to the project path when the schematic path is no within
the project path hierarchy.
2018-04-22 09:47:54 -04:00
jean-pierre charras 3179e40b57 Fix compil warning (perhaps 32 bit build specific) 2018-04-18 20:41:18 +02:00
Maciej Suminski 41ac458e79 Fixed SCH_LEGACY_PLUGIN_CACHE::saveBezier() 2018-04-18 09:36:22 +02:00
jean-pierre charras 4a254ee7f3 Eeschema, schematic file save issue: fix missing switch to C locale before saving files
The scale factor of bitmap images was incorrectly saved in countries using a comma as floating point separator

Fixes: lp:1763726
https://bugs.launchpad.net/kicad/+bug/1763726
2018-04-14 16:59:17 +02:00
Wayne Stambaugh 81843c37a4 Organize trace debugging code for ease of maintenance. 2018-04-13 09:59:01 -04:00
Carsten Schoenert a11714b1a4 fix misspelled 'an other' -> 'another' 2018-04-08 13:24:37 -04:00
Jeff Young 99e659ff54 Coverity fixes. 2018-03-21 23:11:55 +00:00
Maciej Suminski b3601bd540 SCH_LEGACY_PLUGIN_CACHE: Rename conflicting aliases 2018-03-08 09:48:41 +01:00
Maciej Suminski d74bb131e1 SCH_LEGACY_PLUGIN_CACHE: Do not add the root alias for loaded symbols
The root alias is added in the loop iterating through all aliases.
2018-03-08 09:48:41 +01:00
Seth Hillbrand 886159347a Eeschema: Verify file content exists
Fixes: lp:1752724
* https://bugs.launchpad.net/kicad/+bug/1752724
2018-03-01 14:32:59 -08:00
Wayne Stambaugh b8c00a0d07 Fix hierarchical schematic file sheet path bug.
Sheet file name paths were not being saved and restored properly under
certain conditions when walking the sheet hierarchy causing schematic
load errors.

Changed debugging output to use wxLogTrace left over from last fix.

Fixes lp:1748401

https://bugs.launchpad.net/kicad/+bug/1748401
2018-02-14 13:45:41 -05:00
Wayne Stambaugh 00749af914 Eeschema: fix using subpaths in sheets.
Fix double path name issue when using sheet file name paths that differ
from the project path.

This fix also allows for nesting schematics in subfolder in multiple
root paths.

Fixes lp:1745109
https://bugs.launchpad.net/bugs/1745109

Fixes lp:1735982
https://bugs.launchpad.net/bugs/1735982
2018-02-05 17:07:33 -05:00
Jeff Young 99ad5cf394 More performance optimizations for symbol libraries
1) don't call UI-level LIB_PIN routines when reading library --
not only are they a performance hit, they set the modified flag
too
2) limit progress dialog updating to 15 times a second (this
had crept back up to 31% of the time spent loading libraries)

Fixes: lp:1734773
* https://bugs.launchpad.net/kicad/+bug/1734773
2018-01-30 10:31:51 -05:00
jean-pierre charras 795a36c9fe Fix code after renaming files, and a bit of code cleanup (remove useless includes and multiple includes of the same files) 2018-01-30 09:57:25 +01:00
jean-pierre charras 4c5bd01887 Rename a few files 2018-01-28 22:02:31 +01:00
Wayne Stambaugh 2b460bc1ff Eeschema: improve alias load performance.
Don't use wxFileName == operator when comparing cache file name.  There
is a lot of overhead the wxFileName == operator that is not necessary
so just do a comparison with the original string used to create the
cache.
2018-01-24 19:37:07 -05:00
Maciej Suminski 6e65049a56 Do not modify LIB_ID in LIB_PART::SetLib()
This commit is a partial revert of aa81f5b9 & 445ac505. LIB_ID should
not be modified when a library is assigned to its part, as the library
nickname cannot be evaluated during the assignment and might be
different than its filename.
2018-01-10 08:52:17 +01:00
Simon Richter a9ccf1161b Fix quotes in UI messages
This replaces all single and angle bracket quotes in UI messages with
double quotes, for consistency.

Sorry to all translators.
2017-12-15 07:33:07 -05:00