Move the hierarchical sheet loading outside of the try exception block
so that any sheets that were loaded when a schematic file load fails
are loaded rather than skipped. This allows more of the schematic to
be loaded when any parser errors occur.
(cherry picked from commit 1a8082c6d6)
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
(cherry picked from commit ee14da3093)
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
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.
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.
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
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
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
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.
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
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
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
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
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.
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
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
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.
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.
With the implementation of the legacy schematic plugin, any I/O error
when parsing the schematics would prevent the entire schematic from
being loaded. This change restores (somewhat) the previous behavior
where as long as the root schematic is loaded properly, then all of
the remaining sub-sheet will attempt to load.
Add GetError() method the SCH_PLUGIN object to allow for partial
schematic loading.
Check the error message contents when no exception was caught to warn
the user of any accumulated errors.
Fixes lp:1690644
https://bugs.launchpad.net/kicad/+bug/1690644
This is the last of the object save/load code that was not moved into
the SCH_LEGACY_PLUGIN object. All schematic and library I/O is now
performed in the SCH_LEGACY_PLUGIN object and as been removed from the
schematic and library objects.
The old single symbol file format has been replaced with the normal
symbol library file format since there was no difference between them
except the SYMBOL token. The SYMBOL token was no longer being read
since the introduction of the SCH_LEGACY_PLUGIN symbol library loader.
Update the Doxygen comments in all of the modified files.
Change the legacy schematic plugin to preserve illegal LIB_ID characters
when load schematics prior to version 4.
Check for illegal LIB_ID symbol names during project rescue. Rename and
rescue any symbols with illegal LIB_ID names.
Add static methods to LIB_ID object for testing for and fixing names
with illegal characters so there is uniform code for doing so.
Update the Eagle plugin symbol loader to fix symbol names using the new
LIB_ID fix illegal names method.
Fixes lp:1732236
https://bugs.launchpad.net/kicad/+bug/1732236
LIB_PART name is stored in three places that might be changed
independently:
- the first LIB_ALIAS in m_aliases
- LIB_FIELD with VALUE ID
- m_name wxString field
This is potentially leads to an incoherent LIB_PART state. To prevent
this, all fields are changed using only one method: LIB_PART::SetName().
LIB_PART::m_name has been removed as the same information is available
in two other variables.