You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

2009 lines
60 KiB

Make the new schematic and symbol library file formats the default. This is a very large and potentially disruptive change so this will be an unusually long and detailed commit message. The new file formats are now the default in both the schematic and symbol library editors. Existing symbol libraries will be saved in their current format until new features are added to library symbols. Once this happens, both the legacy schematic and symbol file formats will be no longer be savable and existing libraries will have to be converted. Saving to the legacy file formats is still available for round robin testing and should not be used for normal editing. When loading the legacy schematic file, it is imperative that the schematic library symbols are rescued and/or remapped to valid library identifiers. Otherwise, there will be no way to link to the original library symbol and the user will be required manually set the library identifier. The cached symbol will be saved in the schematic file so the last library symbol in the cache will still be used but there will be no way to update it from the original library. The next save after loading a legacy schematic file will be converted to the s-expression file format. Schematics with hierarchical sheets will automatically have all sheet file name extensions changed to .kicad_sym and saved to the new format as well. Appending schematics requires that the schematic to append has already been converted to the new file format. This is required to ensure that library symbols are guaranteed to be valid for the appended schematic. The schematic symbol library symbol link resolution has been moved out of the SCH_COMPONENT object and move into the SCH_SCREEN object that owns the symbol. This was done to ensure that there is a single place where the library symbol links get resolved rather than the dozen or so different code paths that previously existed. It also removes the necessity of the SCH_COMPONENT object of requiring any knowledge of the symbol library table and/or the cache library. When opening an s-expression schematic, the legacy cache library is not loaded so any library symbols not rescued cannot be loaded. Broken library symbol links will have to be manually resolved by adding the cache library to the symbol library table and changing the links in the schematic symbol. Now that the library symbols are embedded in the schematic file, the SCH_SCREEN object maintains the list of library symbols for the schematic automatically. No external manipulation of this library cache should ever occur. ADDED: S-expression schematic and symbol library file formats.
6 years ago
2 years ago
Mark null project initial screen as zoom-initialized The variable `m_Initialized` in `BASE_SCREEN` is used by `SCH_EDIT_FRAME` to mark whether a screen had its zoom level initialized by the "zoom to fit screen" action. When this variable is `false`, the function `SCH_EDIT_FRAME::DisplayCurrentSheet()` performs "zoom to fit screen", modifying the zoom level. This function is indirectly called in the undo routines, so if `m_Initialized` is not set to `true`, a zoom change will occur when the user undoes an operation, a behavior that is undesired. `m_Initialized` was not initialized to `true` for the null schematic (the schematic that is loaded if no project is loaded), causing the aforementioned undesired behavior. To prevent this, I've changed the `SCH_EDIT_FRAME` constructor to set `m_Initialized` to `true`, since it zooms to fit screen already. I've moved `m_Initialized` from `BASE_SCREEN` to `SCH_SCREEN`, as it is used only in Eeschema, and renamed it to `m_zoomInitialized`, a name I believe that better describes what this variable does. I've also introduced the function `SCH_EDIT_FRAME::initScreenZoom()` to group the "zoom to fit screen" action with setting `m_Initialized` to `true`, as they often should occur together. I'd also like to say that I'm not confident whether `SCH_EDIT_FRAME::DisplayCurrentSheet()` should perform the zoom level initialization at this point, but I have decided to not change this behavior for now, as the commit history suggests it's several years old. Fixes https://gitlab.com/kicad/code/kicad/issues/7343
5 years ago
Make the new schematic and symbol library file formats the default. This is a very large and potentially disruptive change so this will be an unusually long and detailed commit message. The new file formats are now the default in both the schematic and symbol library editors. Existing symbol libraries will be saved in their current format until new features are added to library symbols. Once this happens, both the legacy schematic and symbol file formats will be no longer be savable and existing libraries will have to be converted. Saving to the legacy file formats is still available for round robin testing and should not be used for normal editing. When loading the legacy schematic file, it is imperative that the schematic library symbols are rescued and/or remapped to valid library identifiers. Otherwise, there will be no way to link to the original library symbol and the user will be required manually set the library identifier. The cached symbol will be saved in the schematic file so the last library symbol in the cache will still be used but there will be no way to update it from the original library. The next save after loading a legacy schematic file will be converted to the s-expression file format. Schematics with hierarchical sheets will automatically have all sheet file name extensions changed to .kicad_sym and saved to the new format as well. Appending schematics requires that the schematic to append has already been converted to the new file format. This is required to ensure that library symbols are guaranteed to be valid for the appended schematic. The schematic symbol library symbol link resolution has been moved out of the SCH_COMPONENT object and move into the SCH_SCREEN object that owns the symbol. This was done to ensure that there is a single place where the library symbol links get resolved rather than the dozen or so different code paths that previously existed. It also removes the necessity of the SCH_COMPONENT object of requiring any knowledge of the symbol library table and/or the cache library. When opening an s-expression schematic, the legacy cache library is not loaded so any library symbols not rescued cannot be loaded. Broken library symbol links will have to be manually resolved by adding the cache library to the symbol library table and changing the links in the schematic symbol. Now that the library symbols are embedded in the schematic file, the SCH_SCREEN object maintains the list of library symbols for the schematic automatically. No external manipulation of this library cache should ever occur. ADDED: S-expression schematic and symbol library file formats.
6 years ago
Make the new schematic and symbol library file formats the default. This is a very large and potentially disruptive change so this will be an unusually long and detailed commit message. The new file formats are now the default in both the schematic and symbol library editors. Existing symbol libraries will be saved in their current format until new features are added to library symbols. Once this happens, both the legacy schematic and symbol file formats will be no longer be savable and existing libraries will have to be converted. Saving to the legacy file formats is still available for round robin testing and should not be used for normal editing. When loading the legacy schematic file, it is imperative that the schematic library symbols are rescued and/or remapped to valid library identifiers. Otherwise, there will be no way to link to the original library symbol and the user will be required manually set the library identifier. The cached symbol will be saved in the schematic file so the last library symbol in the cache will still be used but there will be no way to update it from the original library. The next save after loading a legacy schematic file will be converted to the s-expression file format. Schematics with hierarchical sheets will automatically have all sheet file name extensions changed to .kicad_sym and saved to the new format as well. Appending schematics requires that the schematic to append has already been converted to the new file format. This is required to ensure that library symbols are guaranteed to be valid for the appended schematic. The schematic symbol library symbol link resolution has been moved out of the SCH_COMPONENT object and move into the SCH_SCREEN object that owns the symbol. This was done to ensure that there is a single place where the library symbol links get resolved rather than the dozen or so different code paths that previously existed. It also removes the necessity of the SCH_COMPONENT object of requiring any knowledge of the symbol library table and/or the cache library. When opening an s-expression schematic, the legacy cache library is not loaded so any library symbols not rescued cannot be loaded. Broken library symbol links will have to be manually resolved by adding the cache library to the symbol library table and changing the links in the schematic symbol. Now that the library symbols are embedded in the schematic file, the SCH_SCREEN object maintains the list of library symbols for the schematic automatically. No external manipulation of this library cache should ever occur. ADDED: S-expression schematic and symbol library file formats.
6 years ago
Make the new schematic and symbol library file formats the default. This is a very large and potentially disruptive change so this will be an unusually long and detailed commit message. The new file formats are now the default in both the schematic and symbol library editors. Existing symbol libraries will be saved in their current format until new features are added to library symbols. Once this happens, both the legacy schematic and symbol file formats will be no longer be savable and existing libraries will have to be converted. Saving to the legacy file formats is still available for round robin testing and should not be used for normal editing. When loading the legacy schematic file, it is imperative that the schematic library symbols are rescued and/or remapped to valid library identifiers. Otherwise, there will be no way to link to the original library symbol and the user will be required manually set the library identifier. The cached symbol will be saved in the schematic file so the last library symbol in the cache will still be used but there will be no way to update it from the original library. The next save after loading a legacy schematic file will be converted to the s-expression file format. Schematics with hierarchical sheets will automatically have all sheet file name extensions changed to .kicad_sym and saved to the new format as well. Appending schematics requires that the schematic to append has already been converted to the new file format. This is required to ensure that library symbols are guaranteed to be valid for the appended schematic. The schematic symbol library symbol link resolution has been moved out of the SCH_COMPONENT object and move into the SCH_SCREEN object that owns the symbol. This was done to ensure that there is a single place where the library symbol links get resolved rather than the dozen or so different code paths that previously existed. It also removes the necessity of the SCH_COMPONENT object of requiring any knowledge of the symbol library table and/or the cache library. When opening an s-expression schematic, the legacy cache library is not loaded so any library symbols not rescued cannot be loaded. Broken library symbol links will have to be manually resolved by adding the cache library to the symbol library table and changing the links in the schematic symbol. Now that the library symbols are embedded in the schematic file, the SCH_SCREEN object maintains the list of library symbols for the schematic automatically. No external manipulation of this library cache should ever occur. ADDED: S-expression schematic and symbol library file formats.
6 years ago
Make the new schematic and symbol library file formats the default. This is a very large and potentially disruptive change so this will be an unusually long and detailed commit message. The new file formats are now the default in both the schematic and symbol library editors. Existing symbol libraries will be saved in their current format until new features are added to library symbols. Once this happens, both the legacy schematic and symbol file formats will be no longer be savable and existing libraries will have to be converted. Saving to the legacy file formats is still available for round robin testing and should not be used for normal editing. When loading the legacy schematic file, it is imperative that the schematic library symbols are rescued and/or remapped to valid library identifiers. Otherwise, there will be no way to link to the original library symbol and the user will be required manually set the library identifier. The cached symbol will be saved in the schematic file so the last library symbol in the cache will still be used but there will be no way to update it from the original library. The next save after loading a legacy schematic file will be converted to the s-expression file format. Schematics with hierarchical sheets will automatically have all sheet file name extensions changed to .kicad_sym and saved to the new format as well. Appending schematics requires that the schematic to append has already been converted to the new file format. This is required to ensure that library symbols are guaranteed to be valid for the appended schematic. The schematic symbol library symbol link resolution has been moved out of the SCH_COMPONENT object and move into the SCH_SCREEN object that owns the symbol. This was done to ensure that there is a single place where the library symbol links get resolved rather than the dozen or so different code paths that previously existed. It also removes the necessity of the SCH_COMPONENT object of requiring any knowledge of the symbol library table and/or the cache library. When opening an s-expression schematic, the legacy cache library is not loaded so any library symbols not rescued cannot be loaded. Broken library symbol links will have to be manually resolved by adding the cache library to the symbol library table and changing the links in the schematic symbol. Now that the library symbols are embedded in the schematic file, the SCH_SCREEN object maintains the list of library symbols for the schematic automatically. No external manipulation of this library cache should ever occur. ADDED: S-expression schematic and symbol library file formats.
6 years ago
Make the new schematic and symbol library file formats the default. This is a very large and potentially disruptive change so this will be an unusually long and detailed commit message. The new file formats are now the default in both the schematic and symbol library editors. Existing symbol libraries will be saved in their current format until new features are added to library symbols. Once this happens, both the legacy schematic and symbol file formats will be no longer be savable and existing libraries will have to be converted. Saving to the legacy file formats is still available for round robin testing and should not be used for normal editing. When loading the legacy schematic file, it is imperative that the schematic library symbols are rescued and/or remapped to valid library identifiers. Otherwise, there will be no way to link to the original library symbol and the user will be required manually set the library identifier. The cached symbol will be saved in the schematic file so the last library symbol in the cache will still be used but there will be no way to update it from the original library. The next save after loading a legacy schematic file will be converted to the s-expression file format. Schematics with hierarchical sheets will automatically have all sheet file name extensions changed to .kicad_sym and saved to the new format as well. Appending schematics requires that the schematic to append has already been converted to the new file format. This is required to ensure that library symbols are guaranteed to be valid for the appended schematic. The schematic symbol library symbol link resolution has been moved out of the SCH_COMPONENT object and move into the SCH_SCREEN object that owns the symbol. This was done to ensure that there is a single place where the library symbol links get resolved rather than the dozen or so different code paths that previously existed. It also removes the necessity of the SCH_COMPONENT object of requiring any knowledge of the symbol library table and/or the cache library. When opening an s-expression schematic, the legacy cache library is not loaded so any library symbols not rescued cannot be loaded. Broken library symbol links will have to be manually resolved by adding the cache library to the symbol library table and changing the links in the schematic symbol. Now that the library symbols are embedded in the schematic file, the SCH_SCREEN object maintains the list of library symbols for the schematic automatically. No external manipulation of this library cache should ever occur. ADDED: S-expression schematic and symbol library file formats.
6 years ago
Make the new schematic and symbol library file formats the default. This is a very large and potentially disruptive change so this will be an unusually long and detailed commit message. The new file formats are now the default in both the schematic and symbol library editors. Existing symbol libraries will be saved in their current format until new features are added to library symbols. Once this happens, both the legacy schematic and symbol file formats will be no longer be savable and existing libraries will have to be converted. Saving to the legacy file formats is still available for round robin testing and should not be used for normal editing. When loading the legacy schematic file, it is imperative that the schematic library symbols are rescued and/or remapped to valid library identifiers. Otherwise, there will be no way to link to the original library symbol and the user will be required manually set the library identifier. The cached symbol will be saved in the schematic file so the last library symbol in the cache will still be used but there will be no way to update it from the original library. The next save after loading a legacy schematic file will be converted to the s-expression file format. Schematics with hierarchical sheets will automatically have all sheet file name extensions changed to .kicad_sym and saved to the new format as well. Appending schematics requires that the schematic to append has already been converted to the new file format. This is required to ensure that library symbols are guaranteed to be valid for the appended schematic. The schematic symbol library symbol link resolution has been moved out of the SCH_COMPONENT object and move into the SCH_SCREEN object that owns the symbol. This was done to ensure that there is a single place where the library symbol links get resolved rather than the dozen or so different code paths that previously existed. It also removes the necessity of the SCH_COMPONENT object of requiring any knowledge of the symbol library table and/or the cache library. When opening an s-expression schematic, the legacy cache library is not loaded so any library symbols not rescued cannot be loaded. Broken library symbol links will have to be manually resolved by adding the cache library to the symbol library table and changing the links in the schematic symbol. Now that the library symbols are embedded in the schematic file, the SCH_SCREEN object maintains the list of library symbols for the schematic automatically. No external manipulation of this library cache should ever occur. ADDED: S-expression schematic and symbol library file formats.
6 years ago
Make the new schematic and symbol library file formats the default. This is a very large and potentially disruptive change so this will be an unusually long and detailed commit message. The new file formats are now the default in both the schematic and symbol library editors. Existing symbol libraries will be saved in their current format until new features are added to library symbols. Once this happens, both the legacy schematic and symbol file formats will be no longer be savable and existing libraries will have to be converted. Saving to the legacy file formats is still available for round robin testing and should not be used for normal editing. When loading the legacy schematic file, it is imperative that the schematic library symbols are rescued and/or remapped to valid library identifiers. Otherwise, there will be no way to link to the original library symbol and the user will be required manually set the library identifier. The cached symbol will be saved in the schematic file so the last library symbol in the cache will still be used but there will be no way to update it from the original library. The next save after loading a legacy schematic file will be converted to the s-expression file format. Schematics with hierarchical sheets will automatically have all sheet file name extensions changed to .kicad_sym and saved to the new format as well. Appending schematics requires that the schematic to append has already been converted to the new file format. This is required to ensure that library symbols are guaranteed to be valid for the appended schematic. The schematic symbol library symbol link resolution has been moved out of the SCH_COMPONENT object and move into the SCH_SCREEN object that owns the symbol. This was done to ensure that there is a single place where the library symbol links get resolved rather than the dozen or so different code paths that previously existed. It also removes the necessity of the SCH_COMPONENT object of requiring any knowledge of the symbol library table and/or the cache library. When opening an s-expression schematic, the legacy cache library is not loaded so any library symbols not rescued cannot be loaded. Broken library symbol links will have to be manually resolved by adding the cache library to the symbol library table and changing the links in the schematic symbol. Now that the library symbols are embedded in the schematic file, the SCH_SCREEN object maintains the list of library symbols for the schematic automatically. No external manipulation of this library cache should ever occur. ADDED: S-expression schematic and symbol library file formats.
6 years ago
Make the new schematic and symbol library file formats the default. This is a very large and potentially disruptive change so this will be an unusually long and detailed commit message. The new file formats are now the default in both the schematic and symbol library editors. Existing symbol libraries will be saved in their current format until new features are added to library symbols. Once this happens, both the legacy schematic and symbol file formats will be no longer be savable and existing libraries will have to be converted. Saving to the legacy file formats is still available for round robin testing and should not be used for normal editing. When loading the legacy schematic file, it is imperative that the schematic library symbols are rescued and/or remapped to valid library identifiers. Otherwise, there will be no way to link to the original library symbol and the user will be required manually set the library identifier. The cached symbol will be saved in the schematic file so the last library symbol in the cache will still be used but there will be no way to update it from the original library. The next save after loading a legacy schematic file will be converted to the s-expression file format. Schematics with hierarchical sheets will automatically have all sheet file name extensions changed to .kicad_sym and saved to the new format as well. Appending schematics requires that the schematic to append has already been converted to the new file format. This is required to ensure that library symbols are guaranteed to be valid for the appended schematic. The schematic symbol library symbol link resolution has been moved out of the SCH_COMPONENT object and move into the SCH_SCREEN object that owns the symbol. This was done to ensure that there is a single place where the library symbol links get resolved rather than the dozen or so different code paths that previously existed. It also removes the necessity of the SCH_COMPONENT object of requiring any knowledge of the symbol library table and/or the cache library. When opening an s-expression schematic, the legacy cache library is not loaded so any library symbols not rescued cannot be loaded. Broken library symbol links will have to be manually resolved by adding the cache library to the symbol library table and changing the links in the schematic symbol. Now that the library symbols are embedded in the schematic file, the SCH_SCREEN object maintains the list of library symbols for the schematic automatically. No external manipulation of this library cache should ever occur. ADDED: S-expression schematic and symbol library file formats.
6 years ago
Make the new schematic and symbol library file formats the default. This is a very large and potentially disruptive change so this will be an unusually long and detailed commit message. The new file formats are now the default in both the schematic and symbol library editors. Existing symbol libraries will be saved in their current format until new features are added to library symbols. Once this happens, both the legacy schematic and symbol file formats will be no longer be savable and existing libraries will have to be converted. Saving to the legacy file formats is still available for round robin testing and should not be used for normal editing. When loading the legacy schematic file, it is imperative that the schematic library symbols are rescued and/or remapped to valid library identifiers. Otherwise, there will be no way to link to the original library symbol and the user will be required manually set the library identifier. The cached symbol will be saved in the schematic file so the last library symbol in the cache will still be used but there will be no way to update it from the original library. The next save after loading a legacy schematic file will be converted to the s-expression file format. Schematics with hierarchical sheets will automatically have all sheet file name extensions changed to .kicad_sym and saved to the new format as well. Appending schematics requires that the schematic to append has already been converted to the new file format. This is required to ensure that library symbols are guaranteed to be valid for the appended schematic. The schematic symbol library symbol link resolution has been moved out of the SCH_COMPONENT object and move into the SCH_SCREEN object that owns the symbol. This was done to ensure that there is a single place where the library symbol links get resolved rather than the dozen or so different code paths that previously existed. It also removes the necessity of the SCH_COMPONENT object of requiring any knowledge of the symbol library table and/or the cache library. When opening an s-expression schematic, the legacy cache library is not loaded so any library symbols not rescued cannot be loaded. Broken library symbol links will have to be manually resolved by adding the cache library to the symbol library table and changing the links in the schematic symbol. Now that the library symbols are embedded in the schematic file, the SCH_SCREEN object maintains the list of library symbols for the schematic automatically. No external manipulation of this library cache should ever occur. ADDED: S-expression schematic and symbol library file formats.
6 years ago
Make the new schematic and symbol library file formats the default. This is a very large and potentially disruptive change so this will be an unusually long and detailed commit message. The new file formats are now the default in both the schematic and symbol library editors. Existing symbol libraries will be saved in their current format until new features are added to library symbols. Once this happens, both the legacy schematic and symbol file formats will be no longer be savable and existing libraries will have to be converted. Saving to the legacy file formats is still available for round robin testing and should not be used for normal editing. When loading the legacy schematic file, it is imperative that the schematic library symbols are rescued and/or remapped to valid library identifiers. Otherwise, there will be no way to link to the original library symbol and the user will be required manually set the library identifier. The cached symbol will be saved in the schematic file so the last library symbol in the cache will still be used but there will be no way to update it from the original library. The next save after loading a legacy schematic file will be converted to the s-expression file format. Schematics with hierarchical sheets will automatically have all sheet file name extensions changed to .kicad_sym and saved to the new format as well. Appending schematics requires that the schematic to append has already been converted to the new file format. This is required to ensure that library symbols are guaranteed to be valid for the appended schematic. The schematic symbol library symbol link resolution has been moved out of the SCH_COMPONENT object and move into the SCH_SCREEN object that owns the symbol. This was done to ensure that there is a single place where the library symbol links get resolved rather than the dozen or so different code paths that previously existed. It also removes the necessity of the SCH_COMPONENT object of requiring any knowledge of the symbol library table and/or the cache library. When opening an s-expression schematic, the legacy cache library is not loaded so any library symbols not rescued cannot be loaded. Broken library symbol links will have to be manually resolved by adding the cache library to the symbol library table and changing the links in the schematic symbol. Now that the library symbols are embedded in the schematic file, the SCH_SCREEN object maintains the list of library symbols for the schematic automatically. No external manipulation of this library cache should ever occur. ADDED: S-expression schematic and symbol library file formats.
6 years ago
Make the new schematic and symbol library file formats the default. This is a very large and potentially disruptive change so this will be an unusually long and detailed commit message. The new file formats are now the default in both the schematic and symbol library editors. Existing symbol libraries will be saved in their current format until new features are added to library symbols. Once this happens, both the legacy schematic and symbol file formats will be no longer be savable and existing libraries will have to be converted. Saving to the legacy file formats is still available for round robin testing and should not be used for normal editing. When loading the legacy schematic file, it is imperative that the schematic library symbols are rescued and/or remapped to valid library identifiers. Otherwise, there will be no way to link to the original library symbol and the user will be required manually set the library identifier. The cached symbol will be saved in the schematic file so the last library symbol in the cache will still be used but there will be no way to update it from the original library. The next save after loading a legacy schematic file will be converted to the s-expression file format. Schematics with hierarchical sheets will automatically have all sheet file name extensions changed to .kicad_sym and saved to the new format as well. Appending schematics requires that the schematic to append has already been converted to the new file format. This is required to ensure that library symbols are guaranteed to be valid for the appended schematic. The schematic symbol library symbol link resolution has been moved out of the SCH_COMPONENT object and move into the SCH_SCREEN object that owns the symbol. This was done to ensure that there is a single place where the library symbol links get resolved rather than the dozen or so different code paths that previously existed. It also removes the necessity of the SCH_COMPONENT object of requiring any knowledge of the symbol library table and/or the cache library. When opening an s-expression schematic, the legacy cache library is not loaded so any library symbols not rescued cannot be loaded. Broken library symbol links will have to be manually resolved by adding the cache library to the symbol library table and changing the links in the schematic symbol. Now that the library symbols are embedded in the schematic file, the SCH_SCREEN object maintains the list of library symbols for the schematic automatically. No external manipulation of this library cache should ever occur. ADDED: S-expression schematic and symbol library file formats.
6 years ago
Make the new schematic and symbol library file formats the default. This is a very large and potentially disruptive change so this will be an unusually long and detailed commit message. The new file formats are now the default in both the schematic and symbol library editors. Existing symbol libraries will be saved in their current format until new features are added to library symbols. Once this happens, both the legacy schematic and symbol file formats will be no longer be savable and existing libraries will have to be converted. Saving to the legacy file formats is still available for round robin testing and should not be used for normal editing. When loading the legacy schematic file, it is imperative that the schematic library symbols are rescued and/or remapped to valid library identifiers. Otherwise, there will be no way to link to the original library symbol and the user will be required manually set the library identifier. The cached symbol will be saved in the schematic file so the last library symbol in the cache will still be used but there will be no way to update it from the original library. The next save after loading a legacy schematic file will be converted to the s-expression file format. Schematics with hierarchical sheets will automatically have all sheet file name extensions changed to .kicad_sym and saved to the new format as well. Appending schematics requires that the schematic to append has already been converted to the new file format. This is required to ensure that library symbols are guaranteed to be valid for the appended schematic. The schematic symbol library symbol link resolution has been moved out of the SCH_COMPONENT object and move into the SCH_SCREEN object that owns the symbol. This was done to ensure that there is a single place where the library symbol links get resolved rather than the dozen or so different code paths that previously existed. It also removes the necessity of the SCH_COMPONENT object of requiring any knowledge of the symbol library table and/or the cache library. When opening an s-expression schematic, the legacy cache library is not loaded so any library symbols not rescued cannot be loaded. Broken library symbol links will have to be manually resolved by adding the cache library to the symbol library table and changing the links in the schematic symbol. Now that the library symbols are embedded in the schematic file, the SCH_SCREEN object maintains the list of library symbols for the schematic automatically. No external manipulation of this library cache should ever occur. ADDED: S-expression schematic and symbol library file formats.
6 years ago
Make the new schematic and symbol library file formats the default. This is a very large and potentially disruptive change so this will be an unusually long and detailed commit message. The new file formats are now the default in both the schematic and symbol library editors. Existing symbol libraries will be saved in their current format until new features are added to library symbols. Once this happens, both the legacy schematic and symbol file formats will be no longer be savable and existing libraries will have to be converted. Saving to the legacy file formats is still available for round robin testing and should not be used for normal editing. When loading the legacy schematic file, it is imperative that the schematic library symbols are rescued and/or remapped to valid library identifiers. Otherwise, there will be no way to link to the original library symbol and the user will be required manually set the library identifier. The cached symbol will be saved in the schematic file so the last library symbol in the cache will still be used but there will be no way to update it from the original library. The next save after loading a legacy schematic file will be converted to the s-expression file format. Schematics with hierarchical sheets will automatically have all sheet file name extensions changed to .kicad_sym and saved to the new format as well. Appending schematics requires that the schematic to append has already been converted to the new file format. This is required to ensure that library symbols are guaranteed to be valid for the appended schematic. The schematic symbol library symbol link resolution has been moved out of the SCH_COMPONENT object and move into the SCH_SCREEN object that owns the symbol. This was done to ensure that there is a single place where the library symbol links get resolved rather than the dozen or so different code paths that previously existed. It also removes the necessity of the SCH_COMPONENT object of requiring any knowledge of the symbol library table and/or the cache library. When opening an s-expression schematic, the legacy cache library is not loaded so any library symbols not rescued cannot be loaded. Broken library symbol links will have to be manually resolved by adding the cache library to the symbol library table and changing the links in the schematic symbol. Now that the library symbols are embedded in the schematic file, the SCH_SCREEN object maintains the list of library symbols for the schematic automatically. No external manipulation of this library cache should ever occur. ADDED: S-expression schematic and symbol library file formats.
6 years ago
Make the new schematic and symbol library file formats the default. This is a very large and potentially disruptive change so this will be an unusually long and detailed commit message. The new file formats are now the default in both the schematic and symbol library editors. Existing symbol libraries will be saved in their current format until new features are added to library symbols. Once this happens, both the legacy schematic and symbol file formats will be no longer be savable and existing libraries will have to be converted. Saving to the legacy file formats is still available for round robin testing and should not be used for normal editing. When loading the legacy schematic file, it is imperative that the schematic library symbols are rescued and/or remapped to valid library identifiers. Otherwise, there will be no way to link to the original library symbol and the user will be required manually set the library identifier. The cached symbol will be saved in the schematic file so the last library symbol in the cache will still be used but there will be no way to update it from the original library. The next save after loading a legacy schematic file will be converted to the s-expression file format. Schematics with hierarchical sheets will automatically have all sheet file name extensions changed to .kicad_sym and saved to the new format as well. Appending schematics requires that the schematic to append has already been converted to the new file format. This is required to ensure that library symbols are guaranteed to be valid for the appended schematic. The schematic symbol library symbol link resolution has been moved out of the SCH_COMPONENT object and move into the SCH_SCREEN object that owns the symbol. This was done to ensure that there is a single place where the library symbol links get resolved rather than the dozen or so different code paths that previously existed. It also removes the necessity of the SCH_COMPONENT object of requiring any knowledge of the symbol library table and/or the cache library. When opening an s-expression schematic, the legacy cache library is not loaded so any library symbols not rescued cannot be loaded. Broken library symbol links will have to be manually resolved by adding the cache library to the symbol library table and changing the links in the schematic symbol. Now that the library symbols are embedded in the schematic file, the SCH_SCREEN object maintains the list of library symbols for the schematic automatically. No external manipulation of this library cache should ever occur. ADDED: S-expression schematic and symbol library file formats.
6 years ago
Make the new schematic and symbol library file formats the default. This is a very large and potentially disruptive change so this will be an unusually long and detailed commit message. The new file formats are now the default in both the schematic and symbol library editors. Existing symbol libraries will be saved in their current format until new features are added to library symbols. Once this happens, both the legacy schematic and symbol file formats will be no longer be savable and existing libraries will have to be converted. Saving to the legacy file formats is still available for round robin testing and should not be used for normal editing. When loading the legacy schematic file, it is imperative that the schematic library symbols are rescued and/or remapped to valid library identifiers. Otherwise, there will be no way to link to the original library symbol and the user will be required manually set the library identifier. The cached symbol will be saved in the schematic file so the last library symbol in the cache will still be used but there will be no way to update it from the original library. The next save after loading a legacy schematic file will be converted to the s-expression file format. Schematics with hierarchical sheets will automatically have all sheet file name extensions changed to .kicad_sym and saved to the new format as well. Appending schematics requires that the schematic to append has already been converted to the new file format. This is required to ensure that library symbols are guaranteed to be valid for the appended schematic. The schematic symbol library symbol link resolution has been moved out of the SCH_COMPONENT object and move into the SCH_SCREEN object that owns the symbol. This was done to ensure that there is a single place where the library symbol links get resolved rather than the dozen or so different code paths that previously existed. It also removes the necessity of the SCH_COMPONENT object of requiring any knowledge of the symbol library table and/or the cache library. When opening an s-expression schematic, the legacy cache library is not loaded so any library symbols not rescued cannot be loaded. Broken library symbol links will have to be manually resolved by adding the cache library to the symbol library table and changing the links in the schematic symbol. Now that the library symbols are embedded in the schematic file, the SCH_SCREEN object maintains the list of library symbols for the schematic automatically. No external manipulation of this library cache should ever occur. ADDED: S-expression schematic and symbol library file formats.
6 years ago
Make the new schematic and symbol library file formats the default. This is a very large and potentially disruptive change so this will be an unusually long and detailed commit message. The new file formats are now the default in both the schematic and symbol library editors. Existing symbol libraries will be saved in their current format until new features are added to library symbols. Once this happens, both the legacy schematic and symbol file formats will be no longer be savable and existing libraries will have to be converted. Saving to the legacy file formats is still available for round robin testing and should not be used for normal editing. When loading the legacy schematic file, it is imperative that the schematic library symbols are rescued and/or remapped to valid library identifiers. Otherwise, there will be no way to link to the original library symbol and the user will be required manually set the library identifier. The cached symbol will be saved in the schematic file so the last library symbol in the cache will still be used but there will be no way to update it from the original library. The next save after loading a legacy schematic file will be converted to the s-expression file format. Schematics with hierarchical sheets will automatically have all sheet file name extensions changed to .kicad_sym and saved to the new format as well. Appending schematics requires that the schematic to append has already been converted to the new file format. This is required to ensure that library symbols are guaranteed to be valid for the appended schematic. The schematic symbol library symbol link resolution has been moved out of the SCH_COMPONENT object and move into the SCH_SCREEN object that owns the symbol. This was done to ensure that there is a single place where the library symbol links get resolved rather than the dozen or so different code paths that previously existed. It also removes the necessity of the SCH_COMPONENT object of requiring any knowledge of the symbol library table and/or the cache library. When opening an s-expression schematic, the legacy cache library is not loaded so any library symbols not rescued cannot be loaded. Broken library symbol links will have to be manually resolved by adding the cache library to the symbol library table and changing the links in the schematic symbol. Now that the library symbols are embedded in the schematic file, the SCH_SCREEN object maintains the list of library symbols for the schematic automatically. No external manipulation of this library cache should ever occur. ADDED: S-expression schematic and symbol library file formats.
6 years ago
Make the new schematic and symbol library file formats the default. This is a very large and potentially disruptive change so this will be an unusually long and detailed commit message. The new file formats are now the default in both the schematic and symbol library editors. Existing symbol libraries will be saved in their current format until new features are added to library symbols. Once this happens, both the legacy schematic and symbol file formats will be no longer be savable and existing libraries will have to be converted. Saving to the legacy file formats is still available for round robin testing and should not be used for normal editing. When loading the legacy schematic file, it is imperative that the schematic library symbols are rescued and/or remapped to valid library identifiers. Otherwise, there will be no way to link to the original library symbol and the user will be required manually set the library identifier. The cached symbol will be saved in the schematic file so the last library symbol in the cache will still be used but there will be no way to update it from the original library. The next save after loading a legacy schematic file will be converted to the s-expression file format. Schematics with hierarchical sheets will automatically have all sheet file name extensions changed to .kicad_sym and saved to the new format as well. Appending schematics requires that the schematic to append has already been converted to the new file format. This is required to ensure that library symbols are guaranteed to be valid for the appended schematic. The schematic symbol library symbol link resolution has been moved out of the SCH_COMPONENT object and move into the SCH_SCREEN object that owns the symbol. This was done to ensure that there is a single place where the library symbol links get resolved rather than the dozen or so different code paths that previously existed. It also removes the necessity of the SCH_COMPONENT object of requiring any knowledge of the symbol library table and/or the cache library. When opening an s-expression schematic, the legacy cache library is not loaded so any library symbols not rescued cannot be loaded. Broken library symbol links will have to be manually resolved by adding the cache library to the symbol library table and changing the links in the schematic symbol. Now that the library symbols are embedded in the schematic file, the SCH_SCREEN object maintains the list of library symbols for the schematic automatically. No external manipulation of this library cache should ever occur. ADDED: S-expression schematic and symbol library file formats.
6 years ago
Use legacy schematic plugin for loading schematics in all code paths. Use the legacy plugin schematic loader in the sheet edit and append schematic code paths. Check for fully qualified LIB_ID objects (must have library nickname) when loading existing schematics when edit sheets. Rewrite append schematic feature to handle import issues rather than change the name and file name of all of the sheets in the imported schematic. This includes the following: - Load the schematic into a temporary SCH_SHEET object. - Make sure the imported schematic does not cause any hierarchy recursion issues. - Verify the imported schematic uses fully qualified #LIB_ID objects (symbol library table). - Check to see if any symbol libraries need to be added to the current project's symbol library table. This includes: - Check if the symbol library already exists in the project or global symbol library table. - Convert symbol library URLS that use the ${KIPRJMOD} environment variable to absolute paths. ${KIPRJMOD} will not be the same for this project. - Check for duplicate symbol library nicknames and change the new symbol library nickname to prevent library name clashes. - Update all schematic symbol LIB_ID object library nicknames when the library nickname was changed to prevent clashes. - Check for duplicate sheet names which is illegal and automatically rename any duplicate sheets in the imported schematic. - Clear all of the annotation in the imported schematic to prevent clashes. - Append the objects from the temporary sheet to the current page. - Replace any duplicate time stamps. - Refresh the symbol library links. Add support code to SCH_SCREEN object to assist with schematic import. Doxygen comment cleaning. Fixes lp:1731760 https://bugs.launchpad.net/kicad/+bug/1731760
8 years ago
Use legacy schematic plugin for loading schematics in all code paths. Use the legacy plugin schematic loader in the sheet edit and append schematic code paths. Check for fully qualified LIB_ID objects (must have library nickname) when loading existing schematics when edit sheets. Rewrite append schematic feature to handle import issues rather than change the name and file name of all of the sheets in the imported schematic. This includes the following: - Load the schematic into a temporary SCH_SHEET object. - Make sure the imported schematic does not cause any hierarchy recursion issues. - Verify the imported schematic uses fully qualified #LIB_ID objects (symbol library table). - Check to see if any symbol libraries need to be added to the current project's symbol library table. This includes: - Check if the symbol library already exists in the project or global symbol library table. - Convert symbol library URLS that use the ${KIPRJMOD} environment variable to absolute paths. ${KIPRJMOD} will not be the same for this project. - Check for duplicate symbol library nicknames and change the new symbol library nickname to prevent library name clashes. - Update all schematic symbol LIB_ID object library nicknames when the library nickname was changed to prevent clashes. - Check for duplicate sheet names which is illegal and automatically rename any duplicate sheets in the imported schematic. - Clear all of the annotation in the imported schematic to prevent clashes. - Append the objects from the temporary sheet to the current page. - Replace any duplicate time stamps. - Refresh the symbol library links. Add support code to SCH_SCREEN object to assist with schematic import. Doxygen comment cleaning. Fixes lp:1731760 https://bugs.launchpad.net/kicad/+bug/1731760
8 years ago
Use legacy schematic plugin for loading schematics in all code paths. Use the legacy plugin schematic loader in the sheet edit and append schematic code paths. Check for fully qualified LIB_ID objects (must have library nickname) when loading existing schematics when edit sheets. Rewrite append schematic feature to handle import issues rather than change the name and file name of all of the sheets in the imported schematic. This includes the following: - Load the schematic into a temporary SCH_SHEET object. - Make sure the imported schematic does not cause any hierarchy recursion issues. - Verify the imported schematic uses fully qualified #LIB_ID objects (symbol library table). - Check to see if any symbol libraries need to be added to the current project's symbol library table. This includes: - Check if the symbol library already exists in the project or global symbol library table. - Convert symbol library URLS that use the ${KIPRJMOD} environment variable to absolute paths. ${KIPRJMOD} will not be the same for this project. - Check for duplicate symbol library nicknames and change the new symbol library nickname to prevent library name clashes. - Update all schematic symbol LIB_ID object library nicknames when the library nickname was changed to prevent clashes. - Check for duplicate sheet names which is illegal and automatically rename any duplicate sheets in the imported schematic. - Clear all of the annotation in the imported schematic to prevent clashes. - Append the objects from the temporary sheet to the current page. - Replace any duplicate time stamps. - Refresh the symbol library links. Add support code to SCH_SCREEN object to assist with schematic import. Doxygen comment cleaning. Fixes lp:1731760 https://bugs.launchpad.net/kicad/+bug/1731760
8 years ago
Use legacy schematic plugin for loading schematics in all code paths. Use the legacy plugin schematic loader in the sheet edit and append schematic code paths. Check for fully qualified LIB_ID objects (must have library nickname) when loading existing schematics when edit sheets. Rewrite append schematic feature to handle import issues rather than change the name and file name of all of the sheets in the imported schematic. This includes the following: - Load the schematic into a temporary SCH_SHEET object. - Make sure the imported schematic does not cause any hierarchy recursion issues. - Verify the imported schematic uses fully qualified #LIB_ID objects (symbol library table). - Check to see if any symbol libraries need to be added to the current project's symbol library table. This includes: - Check if the symbol library already exists in the project or global symbol library table. - Convert symbol library URLS that use the ${KIPRJMOD} environment variable to absolute paths. ${KIPRJMOD} will not be the same for this project. - Check for duplicate symbol library nicknames and change the new symbol library nickname to prevent library name clashes. - Update all schematic symbol LIB_ID object library nicknames when the library nickname was changed to prevent clashes. - Check for duplicate sheet names which is illegal and automatically rename any duplicate sheets in the imported schematic. - Clear all of the annotation in the imported schematic to prevent clashes. - Append the objects from the temporary sheet to the current page. - Replace any duplicate time stamps. - Refresh the symbol library links. Add support code to SCH_SCREEN object to assist with schematic import. Doxygen comment cleaning. Fixes lp:1731760 https://bugs.launchpad.net/kicad/+bug/1731760
8 years ago
Make the new schematic and symbol library file formats the default. This is a very large and potentially disruptive change so this will be an unusually long and detailed commit message. The new file formats are now the default in both the schematic and symbol library editors. Existing symbol libraries will be saved in their current format until new features are added to library symbols. Once this happens, both the legacy schematic and symbol file formats will be no longer be savable and existing libraries will have to be converted. Saving to the legacy file formats is still available for round robin testing and should not be used for normal editing. When loading the legacy schematic file, it is imperative that the schematic library symbols are rescued and/or remapped to valid library identifiers. Otherwise, there will be no way to link to the original library symbol and the user will be required manually set the library identifier. The cached symbol will be saved in the schematic file so the last library symbol in the cache will still be used but there will be no way to update it from the original library. The next save after loading a legacy schematic file will be converted to the s-expression file format. Schematics with hierarchical sheets will automatically have all sheet file name extensions changed to .kicad_sym and saved to the new format as well. Appending schematics requires that the schematic to append has already been converted to the new file format. This is required to ensure that library symbols are guaranteed to be valid for the appended schematic. The schematic symbol library symbol link resolution has been moved out of the SCH_COMPONENT object and move into the SCH_SCREEN object that owns the symbol. This was done to ensure that there is a single place where the library symbol links get resolved rather than the dozen or so different code paths that previously existed. It also removes the necessity of the SCH_COMPONENT object of requiring any knowledge of the symbol library table and/or the cache library. When opening an s-expression schematic, the legacy cache library is not loaded so any library symbols not rescued cannot be loaded. Broken library symbol links will have to be manually resolved by adding the cache library to the symbol library table and changing the links in the schematic symbol. Now that the library symbols are embedded in the schematic file, the SCH_SCREEN object maintains the list of library symbols for the schematic automatically. No external manipulation of this library cache should ever occur. ADDED: S-expression schematic and symbol library file formats.
6 years ago
Make the new schematic and symbol library file formats the default. This is a very large and potentially disruptive change so this will be an unusually long and detailed commit message. The new file formats are now the default in both the schematic and symbol library editors. Existing symbol libraries will be saved in their current format until new features are added to library symbols. Once this happens, both the legacy schematic and symbol file formats will be no longer be savable and existing libraries will have to be converted. Saving to the legacy file formats is still available for round robin testing and should not be used for normal editing. When loading the legacy schematic file, it is imperative that the schematic library symbols are rescued and/or remapped to valid library identifiers. Otherwise, there will be no way to link to the original library symbol and the user will be required manually set the library identifier. The cached symbol will be saved in the schematic file so the last library symbol in the cache will still be used but there will be no way to update it from the original library. The next save after loading a legacy schematic file will be converted to the s-expression file format. Schematics with hierarchical sheets will automatically have all sheet file name extensions changed to .kicad_sym and saved to the new format as well. Appending schematics requires that the schematic to append has already been converted to the new file format. This is required to ensure that library symbols are guaranteed to be valid for the appended schematic. The schematic symbol library symbol link resolution has been moved out of the SCH_COMPONENT object and move into the SCH_SCREEN object that owns the symbol. This was done to ensure that there is a single place where the library symbol links get resolved rather than the dozen or so different code paths that previously existed. It also removes the necessity of the SCH_COMPONENT object of requiring any knowledge of the symbol library table and/or the cache library. When opening an s-expression schematic, the legacy cache library is not loaded so any library symbols not rescued cannot be loaded. Broken library symbol links will have to be manually resolved by adding the cache library to the symbol library table and changing the links in the schematic symbol. Now that the library symbols are embedded in the schematic file, the SCH_SCREEN object maintains the list of library symbols for the schematic automatically. No external manipulation of this library cache should ever occur. ADDED: S-expression schematic and symbol library file formats.
6 years ago
Make the new schematic and symbol library file formats the default. This is a very large and potentially disruptive change so this will be an unusually long and detailed commit message. The new file formats are now the default in both the schematic and symbol library editors. Existing symbol libraries will be saved in their current format until new features are added to library symbols. Once this happens, both the legacy schematic and symbol file formats will be no longer be savable and existing libraries will have to be converted. Saving to the legacy file formats is still available for round robin testing and should not be used for normal editing. When loading the legacy schematic file, it is imperative that the schematic library symbols are rescued and/or remapped to valid library identifiers. Otherwise, there will be no way to link to the original library symbol and the user will be required manually set the library identifier. The cached symbol will be saved in the schematic file so the last library symbol in the cache will still be used but there will be no way to update it from the original library. The next save after loading a legacy schematic file will be converted to the s-expression file format. Schematics with hierarchical sheets will automatically have all sheet file name extensions changed to .kicad_sym and saved to the new format as well. Appending schematics requires that the schematic to append has already been converted to the new file format. This is required to ensure that library symbols are guaranteed to be valid for the appended schematic. The schematic symbol library symbol link resolution has been moved out of the SCH_COMPONENT object and move into the SCH_SCREEN object that owns the symbol. This was done to ensure that there is a single place where the library symbol links get resolved rather than the dozen or so different code paths that previously existed. It also removes the necessity of the SCH_COMPONENT object of requiring any knowledge of the symbol library table and/or the cache library. When opening an s-expression schematic, the legacy cache library is not loaded so any library symbols not rescued cannot be loaded. Broken library symbol links will have to be manually resolved by adding the cache library to the symbol library table and changing the links in the schematic symbol. Now that the library symbols are embedded in the schematic file, the SCH_SCREEN object maintains the list of library symbols for the schematic automatically. No external manipulation of this library cache should ever occur. ADDED: S-expression schematic and symbol library file formats.
6 years ago
Make the new schematic and symbol library file formats the default. This is a very large and potentially disruptive change so this will be an unusually long and detailed commit message. The new file formats are now the default in both the schematic and symbol library editors. Existing symbol libraries will be saved in their current format until new features are added to library symbols. Once this happens, both the legacy schematic and symbol file formats will be no longer be savable and existing libraries will have to be converted. Saving to the legacy file formats is still available for round robin testing and should not be used for normal editing. When loading the legacy schematic file, it is imperative that the schematic library symbols are rescued and/or remapped to valid library identifiers. Otherwise, there will be no way to link to the original library symbol and the user will be required manually set the library identifier. The cached symbol will be saved in the schematic file so the last library symbol in the cache will still be used but there will be no way to update it from the original library. The next save after loading a legacy schematic file will be converted to the s-expression file format. Schematics with hierarchical sheets will automatically have all sheet file name extensions changed to .kicad_sym and saved to the new format as well. Appending schematics requires that the schematic to append has already been converted to the new file format. This is required to ensure that library symbols are guaranteed to be valid for the appended schematic. The schematic symbol library symbol link resolution has been moved out of the SCH_COMPONENT object and move into the SCH_SCREEN object that owns the symbol. This was done to ensure that there is a single place where the library symbol links get resolved rather than the dozen or so different code paths that previously existed. It also removes the necessity of the SCH_COMPONENT object of requiring any knowledge of the symbol library table and/or the cache library. When opening an s-expression schematic, the legacy cache library is not loaded so any library symbols not rescued cannot be loaded. Broken library symbol links will have to be manually resolved by adding the cache library to the symbol library table and changing the links in the schematic symbol. Now that the library symbols are embedded in the schematic file, the SCH_SCREEN object maintains the list of library symbols for the schematic automatically. No external manipulation of this library cache should ever occur. ADDED: S-expression schematic and symbol library file formats.
6 years ago
Make the new schematic and symbol library file formats the default. This is a very large and potentially disruptive change so this will be an unusually long and detailed commit message. The new file formats are now the default in both the schematic and symbol library editors. Existing symbol libraries will be saved in their current format until new features are added to library symbols. Once this happens, both the legacy schematic and symbol file formats will be no longer be savable and existing libraries will have to be converted. Saving to the legacy file formats is still available for round robin testing and should not be used for normal editing. When loading the legacy schematic file, it is imperative that the schematic library symbols are rescued and/or remapped to valid library identifiers. Otherwise, there will be no way to link to the original library symbol and the user will be required manually set the library identifier. The cached symbol will be saved in the schematic file so the last library symbol in the cache will still be used but there will be no way to update it from the original library. The next save after loading a legacy schematic file will be converted to the s-expression file format. Schematics with hierarchical sheets will automatically have all sheet file name extensions changed to .kicad_sym and saved to the new format as well. Appending schematics requires that the schematic to append has already been converted to the new file format. This is required to ensure that library symbols are guaranteed to be valid for the appended schematic. The schematic symbol library symbol link resolution has been moved out of the SCH_COMPONENT object and move into the SCH_SCREEN object that owns the symbol. This was done to ensure that there is a single place where the library symbol links get resolved rather than the dozen or so different code paths that previously existed. It also removes the necessity of the SCH_COMPONENT object of requiring any knowledge of the symbol library table and/or the cache library. When opening an s-expression schematic, the legacy cache library is not loaded so any library symbols not rescued cannot be loaded. Broken library symbol links will have to be manually resolved by adding the cache library to the symbol library table and changing the links in the schematic symbol. Now that the library symbols are embedded in the schematic file, the SCH_SCREEN object maintains the list of library symbols for the schematic automatically. No external manipulation of this library cache should ever occur. ADDED: S-expression schematic and symbol library file formats.
6 years ago
Make the new schematic and symbol library file formats the default. This is a very large and potentially disruptive change so this will be an unusually long and detailed commit message. The new file formats are now the default in both the schematic and symbol library editors. Existing symbol libraries will be saved in their current format until new features are added to library symbols. Once this happens, both the legacy schematic and symbol file formats will be no longer be savable and existing libraries will have to be converted. Saving to the legacy file formats is still available for round robin testing and should not be used for normal editing. When loading the legacy schematic file, it is imperative that the schematic library symbols are rescued and/or remapped to valid library identifiers. Otherwise, there will be no way to link to the original library symbol and the user will be required manually set the library identifier. The cached symbol will be saved in the schematic file so the last library symbol in the cache will still be used but there will be no way to update it from the original library. The next save after loading a legacy schematic file will be converted to the s-expression file format. Schematics with hierarchical sheets will automatically have all sheet file name extensions changed to .kicad_sym and saved to the new format as well. Appending schematics requires that the schematic to append has already been converted to the new file format. This is required to ensure that library symbols are guaranteed to be valid for the appended schematic. The schematic symbol library symbol link resolution has been moved out of the SCH_COMPONENT object and move into the SCH_SCREEN object that owns the symbol. This was done to ensure that there is a single place where the library symbol links get resolved rather than the dozen or so different code paths that previously existed. It also removes the necessity of the SCH_COMPONENT object of requiring any knowledge of the symbol library table and/or the cache library. When opening an s-expression schematic, the legacy cache library is not loaded so any library symbols not rescued cannot be loaded. Broken library symbol links will have to be manually resolved by adding the cache library to the symbol library table and changing the links in the schematic symbol. Now that the library symbols are embedded in the schematic file, the SCH_SCREEN object maintains the list of library symbols for the schematic automatically. No external manipulation of this library cache should ever occur. ADDED: S-expression schematic and symbol library file formats.
6 years ago
Make the new schematic and symbol library file formats the default. This is a very large and potentially disruptive change so this will be an unusually long and detailed commit message. The new file formats are now the default in both the schematic and symbol library editors. Existing symbol libraries will be saved in their current format until new features are added to library symbols. Once this happens, both the legacy schematic and symbol file formats will be no longer be savable and existing libraries will have to be converted. Saving to the legacy file formats is still available for round robin testing and should not be used for normal editing. When loading the legacy schematic file, it is imperative that the schematic library symbols are rescued and/or remapped to valid library identifiers. Otherwise, there will be no way to link to the original library symbol and the user will be required manually set the library identifier. The cached symbol will be saved in the schematic file so the last library symbol in the cache will still be used but there will be no way to update it from the original library. The next save after loading a legacy schematic file will be converted to the s-expression file format. Schematics with hierarchical sheets will automatically have all sheet file name extensions changed to .kicad_sym and saved to the new format as well. Appending schematics requires that the schematic to append has already been converted to the new file format. This is required to ensure that library symbols are guaranteed to be valid for the appended schematic. The schematic symbol library symbol link resolution has been moved out of the SCH_COMPONENT object and move into the SCH_SCREEN object that owns the symbol. This was done to ensure that there is a single place where the library symbol links get resolved rather than the dozen or so different code paths that previously existed. It also removes the necessity of the SCH_COMPONENT object of requiring any knowledge of the symbol library table and/or the cache library. When opening an s-expression schematic, the legacy cache library is not loaded so any library symbols not rescued cannot be loaded. Broken library symbol links will have to be manually resolved by adding the cache library to the symbol library table and changing the links in the schematic symbol. Now that the library symbols are embedded in the schematic file, the SCH_SCREEN object maintains the list of library symbols for the schematic automatically. No external manipulation of this library cache should ever occur. ADDED: S-expression schematic and symbol library file formats.
6 years ago
Make the new schematic and symbol library file formats the default. This is a very large and potentially disruptive change so this will be an unusually long and detailed commit message. The new file formats are now the default in both the schematic and symbol library editors. Existing symbol libraries will be saved in their current format until new features are added to library symbols. Once this happens, both the legacy schematic and symbol file formats will be no longer be savable and existing libraries will have to be converted. Saving to the legacy file formats is still available for round robin testing and should not be used for normal editing. When loading the legacy schematic file, it is imperative that the schematic library symbols are rescued and/or remapped to valid library identifiers. Otherwise, there will be no way to link to the original library symbol and the user will be required manually set the library identifier. The cached symbol will be saved in the schematic file so the last library symbol in the cache will still be used but there will be no way to update it from the original library. The next save after loading a legacy schematic file will be converted to the s-expression file format. Schematics with hierarchical sheets will automatically have all sheet file name extensions changed to .kicad_sym and saved to the new format as well. Appending schematics requires that the schematic to append has already been converted to the new file format. This is required to ensure that library symbols are guaranteed to be valid for the appended schematic. The schematic symbol library symbol link resolution has been moved out of the SCH_COMPONENT object and move into the SCH_SCREEN object that owns the symbol. This was done to ensure that there is a single place where the library symbol links get resolved rather than the dozen or so different code paths that previously existed. It also removes the necessity of the SCH_COMPONENT object of requiring any knowledge of the symbol library table and/or the cache library. When opening an s-expression schematic, the legacy cache library is not loaded so any library symbols not rescued cannot be loaded. Broken library symbol links will have to be manually resolved by adding the cache library to the symbol library table and changing the links in the schematic symbol. Now that the library symbols are embedded in the schematic file, the SCH_SCREEN object maintains the list of library symbols for the schematic automatically. No external manipulation of this library cache should ever occur. ADDED: S-expression schematic and symbol library file formats.
6 years ago
Make the new schematic and symbol library file formats the default. This is a very large and potentially disruptive change so this will be an unusually long and detailed commit message. The new file formats are now the default in both the schematic and symbol library editors. Existing symbol libraries will be saved in their current format until new features are added to library symbols. Once this happens, both the legacy schematic and symbol file formats will be no longer be savable and existing libraries will have to be converted. Saving to the legacy file formats is still available for round robin testing and should not be used for normal editing. When loading the legacy schematic file, it is imperative that the schematic library symbols are rescued and/or remapped to valid library identifiers. Otherwise, there will be no way to link to the original library symbol and the user will be required manually set the library identifier. The cached symbol will be saved in the schematic file so the last library symbol in the cache will still be used but there will be no way to update it from the original library. The next save after loading a legacy schematic file will be converted to the s-expression file format. Schematics with hierarchical sheets will automatically have all sheet file name extensions changed to .kicad_sym and saved to the new format as well. Appending schematics requires that the schematic to append has already been converted to the new file format. This is required to ensure that library symbols are guaranteed to be valid for the appended schematic. The schematic symbol library symbol link resolution has been moved out of the SCH_COMPONENT object and move into the SCH_SCREEN object that owns the symbol. This was done to ensure that there is a single place where the library symbol links get resolved rather than the dozen or so different code paths that previously existed. It also removes the necessity of the SCH_COMPONENT object of requiring any knowledge of the symbol library table and/or the cache library. When opening an s-expression schematic, the legacy cache library is not loaded so any library symbols not rescued cannot be loaded. Broken library symbol links will have to be manually resolved by adding the cache library to the symbol library table and changing the links in the schematic symbol. Now that the library symbols are embedded in the schematic file, the SCH_SCREEN object maintains the list of library symbols for the schematic automatically. No external manipulation of this library cache should ever occur. ADDED: S-expression schematic and symbol library file formats.
6 years ago
18 years ago
Make the new schematic and symbol library file formats the default. This is a very large and potentially disruptive change so this will be an unusually long and detailed commit message. The new file formats are now the default in both the schematic and symbol library editors. Existing symbol libraries will be saved in their current format until new features are added to library symbols. Once this happens, both the legacy schematic and symbol file formats will be no longer be savable and existing libraries will have to be converted. Saving to the legacy file formats is still available for round robin testing and should not be used for normal editing. When loading the legacy schematic file, it is imperative that the schematic library symbols are rescued and/or remapped to valid library identifiers. Otherwise, there will be no way to link to the original library symbol and the user will be required manually set the library identifier. The cached symbol will be saved in the schematic file so the last library symbol in the cache will still be used but there will be no way to update it from the original library. The next save after loading a legacy schematic file will be converted to the s-expression file format. Schematics with hierarchical sheets will automatically have all sheet file name extensions changed to .kicad_sym and saved to the new format as well. Appending schematics requires that the schematic to append has already been converted to the new file format. This is required to ensure that library symbols are guaranteed to be valid for the appended schematic. The schematic symbol library symbol link resolution has been moved out of the SCH_COMPONENT object and move into the SCH_SCREEN object that owns the symbol. This was done to ensure that there is a single place where the library symbol links get resolved rather than the dozen or so different code paths that previously existed. It also removes the necessity of the SCH_COMPONENT object of requiring any knowledge of the symbol library table and/or the cache library. When opening an s-expression schematic, the legacy cache library is not loaded so any library symbols not rescued cannot be loaded. Broken library symbol links will have to be manually resolved by adding the cache library to the symbol library table and changing the links in the schematic symbol. Now that the library symbols are embedded in the schematic file, the SCH_SCREEN object maintains the list of library symbols for the schematic automatically. No external manipulation of this library cache should ever occur. ADDED: S-expression schematic and symbol library file formats.
6 years ago
18 years ago
3 years ago
Make the new schematic and symbol library file formats the default. This is a very large and potentially disruptive change so this will be an unusually long and detailed commit message. The new file formats are now the default in both the schematic and symbol library editors. Existing symbol libraries will be saved in their current format until new features are added to library symbols. Once this happens, both the legacy schematic and symbol file formats will be no longer be savable and existing libraries will have to be converted. Saving to the legacy file formats is still available for round robin testing and should not be used for normal editing. When loading the legacy schematic file, it is imperative that the schematic library symbols are rescued and/or remapped to valid library identifiers. Otherwise, there will be no way to link to the original library symbol and the user will be required manually set the library identifier. The cached symbol will be saved in the schematic file so the last library symbol in the cache will still be used but there will be no way to update it from the original library. The next save after loading a legacy schematic file will be converted to the s-expression file format. Schematics with hierarchical sheets will automatically have all sheet file name extensions changed to .kicad_sym and saved to the new format as well. Appending schematics requires that the schematic to append has already been converted to the new file format. This is required to ensure that library symbols are guaranteed to be valid for the appended schematic. The schematic symbol library symbol link resolution has been moved out of the SCH_COMPONENT object and move into the SCH_SCREEN object that owns the symbol. This was done to ensure that there is a single place where the library symbol links get resolved rather than the dozen or so different code paths that previously existed. It also removes the necessity of the SCH_COMPONENT object of requiring any knowledge of the symbol library table and/or the cache library. When opening an s-expression schematic, the legacy cache library is not loaded so any library symbols not rescued cannot be loaded. Broken library symbol links will have to be manually resolved by adding the cache library to the symbol library table and changing the links in the schematic symbol. Now that the library symbols are embedded in the schematic file, the SCH_SCREEN object maintains the list of library symbols for the schematic automatically. No external manipulation of this library cache should ever occur. ADDED: S-expression schematic and symbol library file formats.
6 years ago
Make the new schematic and symbol library file formats the default. This is a very large and potentially disruptive change so this will be an unusually long and detailed commit message. The new file formats are now the default in both the schematic and symbol library editors. Existing symbol libraries will be saved in their current format until new features are added to library symbols. Once this happens, both the legacy schematic and symbol file formats will be no longer be savable and existing libraries will have to be converted. Saving to the legacy file formats is still available for round robin testing and should not be used for normal editing. When loading the legacy schematic file, it is imperative that the schematic library symbols are rescued and/or remapped to valid library identifiers. Otherwise, there will be no way to link to the original library symbol and the user will be required manually set the library identifier. The cached symbol will be saved in the schematic file so the last library symbol in the cache will still be used but there will be no way to update it from the original library. The next save after loading a legacy schematic file will be converted to the s-expression file format. Schematics with hierarchical sheets will automatically have all sheet file name extensions changed to .kicad_sym and saved to the new format as well. Appending schematics requires that the schematic to append has already been converted to the new file format. This is required to ensure that library symbols are guaranteed to be valid for the appended schematic. The schematic symbol library symbol link resolution has been moved out of the SCH_COMPONENT object and move into the SCH_SCREEN object that owns the symbol. This was done to ensure that there is a single place where the library symbol links get resolved rather than the dozen or so different code paths that previously existed. It also removes the necessity of the SCH_COMPONENT object of requiring any knowledge of the symbol library table and/or the cache library. When opening an s-expression schematic, the legacy cache library is not loaded so any library symbols not rescued cannot be loaded. Broken library symbol links will have to be manually resolved by adding the cache library to the symbol library table and changing the links in the schematic symbol. Now that the library symbols are embedded in the schematic file, the SCH_SCREEN object maintains the list of library symbols for the schematic automatically. No external manipulation of this library cache should ever occur. ADDED: S-expression schematic and symbol library file formats.
6 years ago
Make the new schematic and symbol library file formats the default. This is a very large and potentially disruptive change so this will be an unusually long and detailed commit message. The new file formats are now the default in both the schematic and symbol library editors. Existing symbol libraries will be saved in their current format until new features are added to library symbols. Once this happens, both the legacy schematic and symbol file formats will be no longer be savable and existing libraries will have to be converted. Saving to the legacy file formats is still available for round robin testing and should not be used for normal editing. When loading the legacy schematic file, it is imperative that the schematic library symbols are rescued and/or remapped to valid library identifiers. Otherwise, there will be no way to link to the original library symbol and the user will be required manually set the library identifier. The cached symbol will be saved in the schematic file so the last library symbol in the cache will still be used but there will be no way to update it from the original library. The next save after loading a legacy schematic file will be converted to the s-expression file format. Schematics with hierarchical sheets will automatically have all sheet file name extensions changed to .kicad_sym and saved to the new format as well. Appending schematics requires that the schematic to append has already been converted to the new file format. This is required to ensure that library symbols are guaranteed to be valid for the appended schematic. The schematic symbol library symbol link resolution has been moved out of the SCH_COMPONENT object and move into the SCH_SCREEN object that owns the symbol. This was done to ensure that there is a single place where the library symbol links get resolved rather than the dozen or so different code paths that previously existed. It also removes the necessity of the SCH_COMPONENT object of requiring any knowledge of the symbol library table and/or the cache library. When opening an s-expression schematic, the legacy cache library is not loaded so any library symbols not rescued cannot be loaded. Broken library symbol links will have to be manually resolved by adding the cache library to the symbol library table and changing the links in the schematic symbol. Now that the library symbols are embedded in the schematic file, the SCH_SCREEN object maintains the list of library symbols for the schematic automatically. No external manipulation of this library cache should ever occur. ADDED: S-expression schematic and symbol library file formats.
6 years ago
Make the new schematic and symbol library file formats the default. This is a very large and potentially disruptive change so this will be an unusually long and detailed commit message. The new file formats are now the default in both the schematic and symbol library editors. Existing symbol libraries will be saved in their current format until new features are added to library symbols. Once this happens, both the legacy schematic and symbol file formats will be no longer be savable and existing libraries will have to be converted. Saving to the legacy file formats is still available for round robin testing and should not be used for normal editing. When loading the legacy schematic file, it is imperative that the schematic library symbols are rescued and/or remapped to valid library identifiers. Otherwise, there will be no way to link to the original library symbol and the user will be required manually set the library identifier. The cached symbol will be saved in the schematic file so the last library symbol in the cache will still be used but there will be no way to update it from the original library. The next save after loading a legacy schematic file will be converted to the s-expression file format. Schematics with hierarchical sheets will automatically have all sheet file name extensions changed to .kicad_sym and saved to the new format as well. Appending schematics requires that the schematic to append has already been converted to the new file format. This is required to ensure that library symbols are guaranteed to be valid for the appended schematic. The schematic symbol library symbol link resolution has been moved out of the SCH_COMPONENT object and move into the SCH_SCREEN object that owns the symbol. This was done to ensure that there is a single place where the library symbol links get resolved rather than the dozen or so different code paths that previously existed. It also removes the necessity of the SCH_COMPONENT object of requiring any knowledge of the symbol library table and/or the cache library. When opening an s-expression schematic, the legacy cache library is not loaded so any library symbols not rescued cannot be loaded. Broken library symbol links will have to be manually resolved by adding the cache library to the symbol library table and changing the links in the schematic symbol. Now that the library symbols are embedded in the schematic file, the SCH_SCREEN object maintains the list of library symbols for the schematic automatically. No external manipulation of this library cache should ever occur. ADDED: S-expression schematic and symbol library file formats.
6 years ago
Make the new schematic and symbol library file formats the default. This is a very large and potentially disruptive change so this will be an unusually long and detailed commit message. The new file formats are now the default in both the schematic and symbol library editors. Existing symbol libraries will be saved in their current format until new features are added to library symbols. Once this happens, both the legacy schematic and symbol file formats will be no longer be savable and existing libraries will have to be converted. Saving to the legacy file formats is still available for round robin testing and should not be used for normal editing. When loading the legacy schematic file, it is imperative that the schematic library symbols are rescued and/or remapped to valid library identifiers. Otherwise, there will be no way to link to the original library symbol and the user will be required manually set the library identifier. The cached symbol will be saved in the schematic file so the last library symbol in the cache will still be used but there will be no way to update it from the original library. The next save after loading a legacy schematic file will be converted to the s-expression file format. Schematics with hierarchical sheets will automatically have all sheet file name extensions changed to .kicad_sym and saved to the new format as well. Appending schematics requires that the schematic to append has already been converted to the new file format. This is required to ensure that library symbols are guaranteed to be valid for the appended schematic. The schematic symbol library symbol link resolution has been moved out of the SCH_COMPONENT object and move into the SCH_SCREEN object that owns the symbol. This was done to ensure that there is a single place where the library symbol links get resolved rather than the dozen or so different code paths that previously existed. It also removes the necessity of the SCH_COMPONENT object of requiring any knowledge of the symbol library table and/or the cache library. When opening an s-expression schematic, the legacy cache library is not loaded so any library symbols not rescued cannot be loaded. Broken library symbol links will have to be manually resolved by adding the cache library to the symbol library table and changing the links in the schematic symbol. Now that the library symbols are embedded in the schematic file, the SCH_SCREEN object maintains the list of library symbols for the schematic automatically. No external manipulation of this library cache should ever occur. ADDED: S-expression schematic and symbol library file formats.
6 years ago
Make the new schematic and symbol library file formats the default. This is a very large and potentially disruptive change so this will be an unusually long and detailed commit message. The new file formats are now the default in both the schematic and symbol library editors. Existing symbol libraries will be saved in their current format until new features are added to library symbols. Once this happens, both the legacy schematic and symbol file formats will be no longer be savable and existing libraries will have to be converted. Saving to the legacy file formats is still available for round robin testing and should not be used for normal editing. When loading the legacy schematic file, it is imperative that the schematic library symbols are rescued and/or remapped to valid library identifiers. Otherwise, there will be no way to link to the original library symbol and the user will be required manually set the library identifier. The cached symbol will be saved in the schematic file so the last library symbol in the cache will still be used but there will be no way to update it from the original library. The next save after loading a legacy schematic file will be converted to the s-expression file format. Schematics with hierarchical sheets will automatically have all sheet file name extensions changed to .kicad_sym and saved to the new format as well. Appending schematics requires that the schematic to append has already been converted to the new file format. This is required to ensure that library symbols are guaranteed to be valid for the appended schematic. The schematic symbol library symbol link resolution has been moved out of the SCH_COMPONENT object and move into the SCH_SCREEN object that owns the symbol. This was done to ensure that there is a single place where the library symbol links get resolved rather than the dozen or so different code paths that previously existed. It also removes the necessity of the SCH_COMPONENT object of requiring any knowledge of the symbol library table and/or the cache library. When opening an s-expression schematic, the legacy cache library is not loaded so any library symbols not rescued cannot be loaded. Broken library symbol links will have to be manually resolved by adding the cache library to the symbol library table and changing the links in the schematic symbol. Now that the library symbols are embedded in the schematic file, the SCH_SCREEN object maintains the list of library symbols for the schematic automatically. No external manipulation of this library cache should ever occur. ADDED: S-expression schematic and symbol library file formats.
6 years ago
Make the new schematic and symbol library file formats the default. This is a very large and potentially disruptive change so this will be an unusually long and detailed commit message. The new file formats are now the default in both the schematic and symbol library editors. Existing symbol libraries will be saved in their current format until new features are added to library symbols. Once this happens, both the legacy schematic and symbol file formats will be no longer be savable and existing libraries will have to be converted. Saving to the legacy file formats is still available for round robin testing and should not be used for normal editing. When loading the legacy schematic file, it is imperative that the schematic library symbols are rescued and/or remapped to valid library identifiers. Otherwise, there will be no way to link to the original library symbol and the user will be required manually set the library identifier. The cached symbol will be saved in the schematic file so the last library symbol in the cache will still be used but there will be no way to update it from the original library. The next save after loading a legacy schematic file will be converted to the s-expression file format. Schematics with hierarchical sheets will automatically have all sheet file name extensions changed to .kicad_sym and saved to the new format as well. Appending schematics requires that the schematic to append has already been converted to the new file format. This is required to ensure that library symbols are guaranteed to be valid for the appended schematic. The schematic symbol library symbol link resolution has been moved out of the SCH_COMPONENT object and move into the SCH_SCREEN object that owns the symbol. This was done to ensure that there is a single place where the library symbol links get resolved rather than the dozen or so different code paths that previously existed. It also removes the necessity of the SCH_COMPONENT object of requiring any knowledge of the symbol library table and/or the cache library. When opening an s-expression schematic, the legacy cache library is not loaded so any library symbols not rescued cannot be loaded. Broken library symbol links will have to be manually resolved by adding the cache library to the symbol library table and changing the links in the schematic symbol. Now that the library symbols are embedded in the schematic file, the SCH_SCREEN object maintains the list of library symbols for the schematic automatically. No external manipulation of this library cache should ever occur. ADDED: S-expression schematic and symbol library file formats.
6 years ago
Make the new schematic and symbol library file formats the default. This is a very large and potentially disruptive change so this will be an unusually long and detailed commit message. The new file formats are now the default in both the schematic and symbol library editors. Existing symbol libraries will be saved in their current format until new features are added to library symbols. Once this happens, both the legacy schematic and symbol file formats will be no longer be savable and existing libraries will have to be converted. Saving to the legacy file formats is still available for round robin testing and should not be used for normal editing. When loading the legacy schematic file, it is imperative that the schematic library symbols are rescued and/or remapped to valid library identifiers. Otherwise, there will be no way to link to the original library symbol and the user will be required manually set the library identifier. The cached symbol will be saved in the schematic file so the last library symbol in the cache will still be used but there will be no way to update it from the original library. The next save after loading a legacy schematic file will be converted to the s-expression file format. Schematics with hierarchical sheets will automatically have all sheet file name extensions changed to .kicad_sym and saved to the new format as well. Appending schematics requires that the schematic to append has already been converted to the new file format. This is required to ensure that library symbols are guaranteed to be valid for the appended schematic. The schematic symbol library symbol link resolution has been moved out of the SCH_COMPONENT object and move into the SCH_SCREEN object that owns the symbol. This was done to ensure that there is a single place where the library symbol links get resolved rather than the dozen or so different code paths that previously existed. It also removes the necessity of the SCH_COMPONENT object of requiring any knowledge of the symbol library table and/or the cache library. When opening an s-expression schematic, the legacy cache library is not loaded so any library symbols not rescued cannot be loaded. Broken library symbol links will have to be manually resolved by adding the cache library to the symbol library table and changing the links in the schematic symbol. Now that the library symbols are embedded in the schematic file, the SCH_SCREEN object maintains the list of library symbols for the schematic automatically. No external manipulation of this library cache should ever occur. ADDED: S-expression schematic and symbol library file formats.
6 years ago
Make the new schematic and symbol library file formats the default. This is a very large and potentially disruptive change so this will be an unusually long and detailed commit message. The new file formats are now the default in both the schematic and symbol library editors. Existing symbol libraries will be saved in their current format until new features are added to library symbols. Once this happens, both the legacy schematic and symbol file formats will be no longer be savable and existing libraries will have to be converted. Saving to the legacy file formats is still available for round robin testing and should not be used for normal editing. When loading the legacy schematic file, it is imperative that the schematic library symbols are rescued and/or remapped to valid library identifiers. Otherwise, there will be no way to link to the original library symbol and the user will be required manually set the library identifier. The cached symbol will be saved in the schematic file so the last library symbol in the cache will still be used but there will be no way to update it from the original library. The next save after loading a legacy schematic file will be converted to the s-expression file format. Schematics with hierarchical sheets will automatically have all sheet file name extensions changed to .kicad_sym and saved to the new format as well. Appending schematics requires that the schematic to append has already been converted to the new file format. This is required to ensure that library symbols are guaranteed to be valid for the appended schematic. The schematic symbol library symbol link resolution has been moved out of the SCH_COMPONENT object and move into the SCH_SCREEN object that owns the symbol. This was done to ensure that there is a single place where the library symbol links get resolved rather than the dozen or so different code paths that previously existed. It also removes the necessity of the SCH_COMPONENT object of requiring any knowledge of the symbol library table and/or the cache library. When opening an s-expression schematic, the legacy cache library is not loaded so any library symbols not rescued cannot be loaded. Broken library symbol links will have to be manually resolved by adding the cache library to the symbol library table and changing the links in the schematic symbol. Now that the library symbols are embedded in the schematic file, the SCH_SCREEN object maintains the list of library symbols for the schematic automatically. No external manipulation of this library cache should ever occur. ADDED: S-expression schematic and symbol library file formats.
6 years ago
Make the new schematic and symbol library file formats the default. This is a very large and potentially disruptive change so this will be an unusually long and detailed commit message. The new file formats are now the default in both the schematic and symbol library editors. Existing symbol libraries will be saved in their current format until new features are added to library symbols. Once this happens, both the legacy schematic and symbol file formats will be no longer be savable and existing libraries will have to be converted. Saving to the legacy file formats is still available for round robin testing and should not be used for normal editing. When loading the legacy schematic file, it is imperative that the schematic library symbols are rescued and/or remapped to valid library identifiers. Otherwise, there will be no way to link to the original library symbol and the user will be required manually set the library identifier. The cached symbol will be saved in the schematic file so the last library symbol in the cache will still be used but there will be no way to update it from the original library. The next save after loading a legacy schematic file will be converted to the s-expression file format. Schematics with hierarchical sheets will automatically have all sheet file name extensions changed to .kicad_sym and saved to the new format as well. Appending schematics requires that the schematic to append has already been converted to the new file format. This is required to ensure that library symbols are guaranteed to be valid for the appended schematic. The schematic symbol library symbol link resolution has been moved out of the SCH_COMPONENT object and move into the SCH_SCREEN object that owns the symbol. This was done to ensure that there is a single place where the library symbol links get resolved rather than the dozen or so different code paths that previously existed. It also removes the necessity of the SCH_COMPONENT object of requiring any knowledge of the symbol library table and/or the cache library. When opening an s-expression schematic, the legacy cache library is not loaded so any library symbols not rescued cannot be loaded. Broken library symbol links will have to be manually resolved by adding the cache library to the symbol library table and changing the links in the schematic symbol. Now that the library symbols are embedded in the schematic file, the SCH_SCREEN object maintains the list of library symbols for the schematic automatically. No external manipulation of this library cache should ever occur. ADDED: S-expression schematic and symbol library file formats.
6 years ago
Make the new schematic and symbol library file formats the default. This is a very large and potentially disruptive change so this will be an unusually long and detailed commit message. The new file formats are now the default in both the schematic and symbol library editors. Existing symbol libraries will be saved in their current format until new features are added to library symbols. Once this happens, both the legacy schematic and symbol file formats will be no longer be savable and existing libraries will have to be converted. Saving to the legacy file formats is still available for round robin testing and should not be used for normal editing. When loading the legacy schematic file, it is imperative that the schematic library symbols are rescued and/or remapped to valid library identifiers. Otherwise, there will be no way to link to the original library symbol and the user will be required manually set the library identifier. The cached symbol will be saved in the schematic file so the last library symbol in the cache will still be used but there will be no way to update it from the original library. The next save after loading a legacy schematic file will be converted to the s-expression file format. Schematics with hierarchical sheets will automatically have all sheet file name extensions changed to .kicad_sym and saved to the new format as well. Appending schematics requires that the schematic to append has already been converted to the new file format. This is required to ensure that library symbols are guaranteed to be valid for the appended schematic. The schematic symbol library symbol link resolution has been moved out of the SCH_COMPONENT object and move into the SCH_SCREEN object that owns the symbol. This was done to ensure that there is a single place where the library symbol links get resolved rather than the dozen or so different code paths that previously existed. It also removes the necessity of the SCH_COMPONENT object of requiring any knowledge of the symbol library table and/or the cache library. When opening an s-expression schematic, the legacy cache library is not loaded so any library symbols not rescued cannot be loaded. Broken library symbol links will have to be manually resolved by adding the cache library to the symbol library table and changing the links in the schematic symbol. Now that the library symbols are embedded in the schematic file, the SCH_SCREEN object maintains the list of library symbols for the schematic automatically. No external manipulation of this library cache should ever occur. ADDED: S-expression schematic and symbol library file formats.
6 years ago
Make the new schematic and symbol library file formats the default. This is a very large and potentially disruptive change so this will be an unusually long and detailed commit message. The new file formats are now the default in both the schematic and symbol library editors. Existing symbol libraries will be saved in their current format until new features are added to library symbols. Once this happens, both the legacy schematic and symbol file formats will be no longer be savable and existing libraries will have to be converted. Saving to the legacy file formats is still available for round robin testing and should not be used for normal editing. When loading the legacy schematic file, it is imperative that the schematic library symbols are rescued and/or remapped to valid library identifiers. Otherwise, there will be no way to link to the original library symbol and the user will be required manually set the library identifier. The cached symbol will be saved in the schematic file so the last library symbol in the cache will still be used but there will be no way to update it from the original library. The next save after loading a legacy schematic file will be converted to the s-expression file format. Schematics with hierarchical sheets will automatically have all sheet file name extensions changed to .kicad_sym and saved to the new format as well. Appending schematics requires that the schematic to append has already been converted to the new file format. This is required to ensure that library symbols are guaranteed to be valid for the appended schematic. The schematic symbol library symbol link resolution has been moved out of the SCH_COMPONENT object and move into the SCH_SCREEN object that owns the symbol. This was done to ensure that there is a single place where the library symbol links get resolved rather than the dozen or so different code paths that previously existed. It also removes the necessity of the SCH_COMPONENT object of requiring any knowledge of the symbol library table and/or the cache library. When opening an s-expression schematic, the legacy cache library is not loaded so any library symbols not rescued cannot be loaded. Broken library symbol links will have to be manually resolved by adding the cache library to the symbol library table and changing the links in the schematic symbol. Now that the library symbols are embedded in the schematic file, the SCH_SCREEN object maintains the list of library symbols for the schematic automatically. No external manipulation of this library cache should ever occur. ADDED: S-expression schematic and symbol library file formats.
6 years ago
Make the new schematic and symbol library file formats the default. This is a very large and potentially disruptive change so this will be an unusually long and detailed commit message. The new file formats are now the default in both the schematic and symbol library editors. Existing symbol libraries will be saved in their current format until new features are added to library symbols. Once this happens, both the legacy schematic and symbol file formats will be no longer be savable and existing libraries will have to be converted. Saving to the legacy file formats is still available for round robin testing and should not be used for normal editing. When loading the legacy schematic file, it is imperative that the schematic library symbols are rescued and/or remapped to valid library identifiers. Otherwise, there will be no way to link to the original library symbol and the user will be required manually set the library identifier. The cached symbol will be saved in the schematic file so the last library symbol in the cache will still be used but there will be no way to update it from the original library. The next save after loading a legacy schematic file will be converted to the s-expression file format. Schematics with hierarchical sheets will automatically have all sheet file name extensions changed to .kicad_sym and saved to the new format as well. Appending schematics requires that the schematic to append has already been converted to the new file format. This is required to ensure that library symbols are guaranteed to be valid for the appended schematic. The schematic symbol library symbol link resolution has been moved out of the SCH_COMPONENT object and move into the SCH_SCREEN object that owns the symbol. This was done to ensure that there is a single place where the library symbol links get resolved rather than the dozen or so different code paths that previously existed. It also removes the necessity of the SCH_COMPONENT object of requiring any knowledge of the symbol library table and/or the cache library. When opening an s-expression schematic, the legacy cache library is not loaded so any library symbols not rescued cannot be loaded. Broken library symbol links will have to be manually resolved by adding the cache library to the symbol library table and changing the links in the schematic symbol. Now that the library symbols are embedded in the schematic file, the SCH_SCREEN object maintains the list of library symbols for the schematic automatically. No external manipulation of this library cache should ever occur. ADDED: S-expression schematic and symbol library file formats.
6 years ago
Make the new schematic and symbol library file formats the default. This is a very large and potentially disruptive change so this will be an unusually long and detailed commit message. The new file formats are now the default in both the schematic and symbol library editors. Existing symbol libraries will be saved in their current format until new features are added to library symbols. Once this happens, both the legacy schematic and symbol file formats will be no longer be savable and existing libraries will have to be converted. Saving to the legacy file formats is still available for round robin testing and should not be used for normal editing. When loading the legacy schematic file, it is imperative that the schematic library symbols are rescued and/or remapped to valid library identifiers. Otherwise, there will be no way to link to the original library symbol and the user will be required manually set the library identifier. The cached symbol will be saved in the schematic file so the last library symbol in the cache will still be used but there will be no way to update it from the original library. The next save after loading a legacy schematic file will be converted to the s-expression file format. Schematics with hierarchical sheets will automatically have all sheet file name extensions changed to .kicad_sym and saved to the new format as well. Appending schematics requires that the schematic to append has already been converted to the new file format. This is required to ensure that library symbols are guaranteed to be valid for the appended schematic. The schematic symbol library symbol link resolution has been moved out of the SCH_COMPONENT object and move into the SCH_SCREEN object that owns the symbol. This was done to ensure that there is a single place where the library symbol links get resolved rather than the dozen or so different code paths that previously existed. It also removes the necessity of the SCH_COMPONENT object of requiring any knowledge of the symbol library table and/or the cache library. When opening an s-expression schematic, the legacy cache library is not loaded so any library symbols not rescued cannot be loaded. Broken library symbol links will have to be manually resolved by adding the cache library to the symbol library table and changing the links in the schematic symbol. Now that the library symbols are embedded in the schematic file, the SCH_SCREEN object maintains the list of library symbols for the schematic automatically. No external manipulation of this library cache should ever occur. ADDED: S-expression schematic and symbol library file formats.
6 years ago
Make the new schematic and symbol library file formats the default. This is a very large and potentially disruptive change so this will be an unusually long and detailed commit message. The new file formats are now the default in both the schematic and symbol library editors. Existing symbol libraries will be saved in their current format until new features are added to library symbols. Once this happens, both the legacy schematic and symbol file formats will be no longer be savable and existing libraries will have to be converted. Saving to the legacy file formats is still available for round robin testing and should not be used for normal editing. When loading the legacy schematic file, it is imperative that the schematic library symbols are rescued and/or remapped to valid library identifiers. Otherwise, there will be no way to link to the original library symbol and the user will be required manually set the library identifier. The cached symbol will be saved in the schematic file so the last library symbol in the cache will still be used but there will be no way to update it from the original library. The next save after loading a legacy schematic file will be converted to the s-expression file format. Schematics with hierarchical sheets will automatically have all sheet file name extensions changed to .kicad_sym and saved to the new format as well. Appending schematics requires that the schematic to append has already been converted to the new file format. This is required to ensure that library symbols are guaranteed to be valid for the appended schematic. The schematic symbol library symbol link resolution has been moved out of the SCH_COMPONENT object and move into the SCH_SCREEN object that owns the symbol. This was done to ensure that there is a single place where the library symbol links get resolved rather than the dozen or so different code paths that previously existed. It also removes the necessity of the SCH_COMPONENT object of requiring any knowledge of the symbol library table and/or the cache library. When opening an s-expression schematic, the legacy cache library is not loaded so any library symbols not rescued cannot be loaded. Broken library symbol links will have to be manually resolved by adding the cache library to the symbol library table and changing the links in the schematic symbol. Now that the library symbols are embedded in the schematic file, the SCH_SCREEN object maintains the list of library symbols for the schematic automatically. No external manipulation of this library cache should ever occur. ADDED: S-expression schematic and symbol library file formats.
6 years ago
Make the new schematic and symbol library file formats the default. This is a very large and potentially disruptive change so this will be an unusually long and detailed commit message. The new file formats are now the default in both the schematic and symbol library editors. Existing symbol libraries will be saved in their current format until new features are added to library symbols. Once this happens, both the legacy schematic and symbol file formats will be no longer be savable and existing libraries will have to be converted. Saving to the legacy file formats is still available for round robin testing and should not be used for normal editing. When loading the legacy schematic file, it is imperative that the schematic library symbols are rescued and/or remapped to valid library identifiers. Otherwise, there will be no way to link to the original library symbol and the user will be required manually set the library identifier. The cached symbol will be saved in the schematic file so the last library symbol in the cache will still be used but there will be no way to update it from the original library. The next save after loading a legacy schematic file will be converted to the s-expression file format. Schematics with hierarchical sheets will automatically have all sheet file name extensions changed to .kicad_sym and saved to the new format as well. Appending schematics requires that the schematic to append has already been converted to the new file format. This is required to ensure that library symbols are guaranteed to be valid for the appended schematic. The schematic symbol library symbol link resolution has been moved out of the SCH_COMPONENT object and move into the SCH_SCREEN object that owns the symbol. This was done to ensure that there is a single place where the library symbol links get resolved rather than the dozen or so different code paths that previously existed. It also removes the necessity of the SCH_COMPONENT object of requiring any knowledge of the symbol library table and/or the cache library. When opening an s-expression schematic, the legacy cache library is not loaded so any library symbols not rescued cannot be loaded. Broken library symbol links will have to be manually resolved by adding the cache library to the symbol library table and changing the links in the schematic symbol. Now that the library symbols are embedded in the schematic file, the SCH_SCREEN object maintains the list of library symbols for the schematic automatically. No external manipulation of this library cache should ever occur. ADDED: S-expression schematic and symbol library file formats.
6 years ago
Make the new schematic and symbol library file formats the default. This is a very large and potentially disruptive change so this will be an unusually long and detailed commit message. The new file formats are now the default in both the schematic and symbol library editors. Existing symbol libraries will be saved in their current format until new features are added to library symbols. Once this happens, both the legacy schematic and symbol file formats will be no longer be savable and existing libraries will have to be converted. Saving to the legacy file formats is still available for round robin testing and should not be used for normal editing. When loading the legacy schematic file, it is imperative that the schematic library symbols are rescued and/or remapped to valid library identifiers. Otherwise, there will be no way to link to the original library symbol and the user will be required manually set the library identifier. The cached symbol will be saved in the schematic file so the last library symbol in the cache will still be used but there will be no way to update it from the original library. The next save after loading a legacy schematic file will be converted to the s-expression file format. Schematics with hierarchical sheets will automatically have all sheet file name extensions changed to .kicad_sym and saved to the new format as well. Appending schematics requires that the schematic to append has already been converted to the new file format. This is required to ensure that library symbols are guaranteed to be valid for the appended schematic. The schematic symbol library symbol link resolution has been moved out of the SCH_COMPONENT object and move into the SCH_SCREEN object that owns the symbol. This was done to ensure that there is a single place where the library symbol links get resolved rather than the dozen or so different code paths that previously existed. It also removes the necessity of the SCH_COMPONENT object of requiring any knowledge of the symbol library table and/or the cache library. When opening an s-expression schematic, the legacy cache library is not loaded so any library symbols not rescued cannot be loaded. Broken library symbol links will have to be manually resolved by adding the cache library to the symbol library table and changing the links in the schematic symbol. Now that the library symbols are embedded in the schematic file, the SCH_SCREEN object maintains the list of library symbols for the schematic automatically. No external manipulation of this library cache should ever occur. ADDED: S-expression schematic and symbol library file formats.
6 years ago
Make the new schematic and symbol library file formats the default. This is a very large and potentially disruptive change so this will be an unusually long and detailed commit message. The new file formats are now the default in both the schematic and symbol library editors. Existing symbol libraries will be saved in their current format until new features are added to library symbols. Once this happens, both the legacy schematic and symbol file formats will be no longer be savable and existing libraries will have to be converted. Saving to the legacy file formats is still available for round robin testing and should not be used for normal editing. When loading the legacy schematic file, it is imperative that the schematic library symbols are rescued and/or remapped to valid library identifiers. Otherwise, there will be no way to link to the original library symbol and the user will be required manually set the library identifier. The cached symbol will be saved in the schematic file so the last library symbol in the cache will still be used but there will be no way to update it from the original library. The next save after loading a legacy schematic file will be converted to the s-expression file format. Schematics with hierarchical sheets will automatically have all sheet file name extensions changed to .kicad_sym and saved to the new format as well. Appending schematics requires that the schematic to append has already been converted to the new file format. This is required to ensure that library symbols are guaranteed to be valid for the appended schematic. The schematic symbol library symbol link resolution has been moved out of the SCH_COMPONENT object and move into the SCH_SCREEN object that owns the symbol. This was done to ensure that there is a single place where the library symbol links get resolved rather than the dozen or so different code paths that previously existed. It also removes the necessity of the SCH_COMPONENT object of requiring any knowledge of the symbol library table and/or the cache library. When opening an s-expression schematic, the legacy cache library is not loaded so any library symbols not rescued cannot be loaded. Broken library symbol links will have to be manually resolved by adding the cache library to the symbol library table and changing the links in the schematic symbol. Now that the library symbols are embedded in the schematic file, the SCH_SCREEN object maintains the list of library symbols for the schematic automatically. No external manipulation of this library cache should ever occur. ADDED: S-expression schematic and symbol library file formats.
6 years ago
Make the new schematic and symbol library file formats the default. This is a very large and potentially disruptive change so this will be an unusually long and detailed commit message. The new file formats are now the default in both the schematic and symbol library editors. Existing symbol libraries will be saved in their current format until new features are added to library symbols. Once this happens, both the legacy schematic and symbol file formats will be no longer be savable and existing libraries will have to be converted. Saving to the legacy file formats is still available for round robin testing and should not be used for normal editing. When loading the legacy schematic file, it is imperative that the schematic library symbols are rescued and/or remapped to valid library identifiers. Otherwise, there will be no way to link to the original library symbol and the user will be required manually set the library identifier. The cached symbol will be saved in the schematic file so the last library symbol in the cache will still be used but there will be no way to update it from the original library. The next save after loading a legacy schematic file will be converted to the s-expression file format. Schematics with hierarchical sheets will automatically have all sheet file name extensions changed to .kicad_sym and saved to the new format as well. Appending schematics requires that the schematic to append has already been converted to the new file format. This is required to ensure that library symbols are guaranteed to be valid for the appended schematic. The schematic symbol library symbol link resolution has been moved out of the SCH_COMPONENT object and move into the SCH_SCREEN object that owns the symbol. This was done to ensure that there is a single place where the library symbol links get resolved rather than the dozen or so different code paths that previously existed. It also removes the necessity of the SCH_COMPONENT object of requiring any knowledge of the symbol library table and/or the cache library. When opening an s-expression schematic, the legacy cache library is not loaded so any library symbols not rescued cannot be loaded. Broken library symbol links will have to be manually resolved by adding the cache library to the symbol library table and changing the links in the schematic symbol. Now that the library symbols are embedded in the schematic file, the SCH_SCREEN object maintains the list of library symbols for the schematic automatically. No external manipulation of this library cache should ever occur. ADDED: S-expression schematic and symbol library file formats.
6 years ago
Make the new schematic and symbol library file formats the default. This is a very large and potentially disruptive change so this will be an unusually long and detailed commit message. The new file formats are now the default in both the schematic and symbol library editors. Existing symbol libraries will be saved in their current format until new features are added to library symbols. Once this happens, both the legacy schematic and symbol file formats will be no longer be savable and existing libraries will have to be converted. Saving to the legacy file formats is still available for round robin testing and should not be used for normal editing. When loading the legacy schematic file, it is imperative that the schematic library symbols are rescued and/or remapped to valid library identifiers. Otherwise, there will be no way to link to the original library symbol and the user will be required manually set the library identifier. The cached symbol will be saved in the schematic file so the last library symbol in the cache will still be used but there will be no way to update it from the original library. The next save after loading a legacy schematic file will be converted to the s-expression file format. Schematics with hierarchical sheets will automatically have all sheet file name extensions changed to .kicad_sym and saved to the new format as well. Appending schematics requires that the schematic to append has already been converted to the new file format. This is required to ensure that library symbols are guaranteed to be valid for the appended schematic. The schematic symbol library symbol link resolution has been moved out of the SCH_COMPONENT object and move into the SCH_SCREEN object that owns the symbol. This was done to ensure that there is a single place where the library symbol links get resolved rather than the dozen or so different code paths that previously existed. It also removes the necessity of the SCH_COMPONENT object of requiring any knowledge of the symbol library table and/or the cache library. When opening an s-expression schematic, the legacy cache library is not loaded so any library symbols not rescued cannot be loaded. Broken library symbol links will have to be manually resolved by adding the cache library to the symbol library table and changing the links in the schematic symbol. Now that the library symbols are embedded in the schematic file, the SCH_SCREEN object maintains the list of library symbols for the schematic automatically. No external manipulation of this library cache should ever occur. ADDED: S-expression schematic and symbol library file formats.
6 years ago
Make the new schematic and symbol library file formats the default. This is a very large and potentially disruptive change so this will be an unusually long and detailed commit message. The new file formats are now the default in both the schematic and symbol library editors. Existing symbol libraries will be saved in their current format until new features are added to library symbols. Once this happens, both the legacy schematic and symbol file formats will be no longer be savable and existing libraries will have to be converted. Saving to the legacy file formats is still available for round robin testing and should not be used for normal editing. When loading the legacy schematic file, it is imperative that the schematic library symbols are rescued and/or remapped to valid library identifiers. Otherwise, there will be no way to link to the original library symbol and the user will be required manually set the library identifier. The cached symbol will be saved in the schematic file so the last library symbol in the cache will still be used but there will be no way to update it from the original library. The next save after loading a legacy schematic file will be converted to the s-expression file format. Schematics with hierarchical sheets will automatically have all sheet file name extensions changed to .kicad_sym and saved to the new format as well. Appending schematics requires that the schematic to append has already been converted to the new file format. This is required to ensure that library symbols are guaranteed to be valid for the appended schematic. The schematic symbol library symbol link resolution has been moved out of the SCH_COMPONENT object and move into the SCH_SCREEN object that owns the symbol. This was done to ensure that there is a single place where the library symbol links get resolved rather than the dozen or so different code paths that previously existed. It also removes the necessity of the SCH_COMPONENT object of requiring any knowledge of the symbol library table and/or the cache library. When opening an s-expression schematic, the legacy cache library is not loaded so any library symbols not rescued cannot be loaded. Broken library symbol links will have to be manually resolved by adding the cache library to the symbol library table and changing the links in the schematic symbol. Now that the library symbols are embedded in the schematic file, the SCH_SCREEN object maintains the list of library symbols for the schematic automatically. No external manipulation of this library cache should ever occur. ADDED: S-expression schematic and symbol library file formats.
6 years ago
Make the new schematic and symbol library file formats the default. This is a very large and potentially disruptive change so this will be an unusually long and detailed commit message. The new file formats are now the default in both the schematic and symbol library editors. Existing symbol libraries will be saved in their current format until new features are added to library symbols. Once this happens, both the legacy schematic and symbol file formats will be no longer be savable and existing libraries will have to be converted. Saving to the legacy file formats is still available for round robin testing and should not be used for normal editing. When loading the legacy schematic file, it is imperative that the schematic library symbols are rescued and/or remapped to valid library identifiers. Otherwise, there will be no way to link to the original library symbol and the user will be required manually set the library identifier. The cached symbol will be saved in the schematic file so the last library symbol in the cache will still be used but there will be no way to update it from the original library. The next save after loading a legacy schematic file will be converted to the s-expression file format. Schematics with hierarchical sheets will automatically have all sheet file name extensions changed to .kicad_sym and saved to the new format as well. Appending schematics requires that the schematic to append has already been converted to the new file format. This is required to ensure that library symbols are guaranteed to be valid for the appended schematic. The schematic symbol library symbol link resolution has been moved out of the SCH_COMPONENT object and move into the SCH_SCREEN object that owns the symbol. This was done to ensure that there is a single place where the library symbol links get resolved rather than the dozen or so different code paths that previously existed. It also removes the necessity of the SCH_COMPONENT object of requiring any knowledge of the symbol library table and/or the cache library. When opening an s-expression schematic, the legacy cache library is not loaded so any library symbols not rescued cannot be loaded. Broken library symbol links will have to be manually resolved by adding the cache library to the symbol library table and changing the links in the schematic symbol. Now that the library symbols are embedded in the schematic file, the SCH_SCREEN object maintains the list of library symbols for the schematic automatically. No external manipulation of this library cache should ever occur. ADDED: S-expression schematic and symbol library file formats.
6 years ago
Make the new schematic and symbol library file formats the default. This is a very large and potentially disruptive change so this will be an unusually long and detailed commit message. The new file formats are now the default in both the schematic and symbol library editors. Existing symbol libraries will be saved in their current format until new features are added to library symbols. Once this happens, both the legacy schematic and symbol file formats will be no longer be savable and existing libraries will have to be converted. Saving to the legacy file formats is still available for round robin testing and should not be used for normal editing. When loading the legacy schematic file, it is imperative that the schematic library symbols are rescued and/or remapped to valid library identifiers. Otherwise, there will be no way to link to the original library symbol and the user will be required manually set the library identifier. The cached symbol will be saved in the schematic file so the last library symbol in the cache will still be used but there will be no way to update it from the original library. The next save after loading a legacy schematic file will be converted to the s-expression file format. Schematics with hierarchical sheets will automatically have all sheet file name extensions changed to .kicad_sym and saved to the new format as well. Appending schematics requires that the schematic to append has already been converted to the new file format. This is required to ensure that library symbols are guaranteed to be valid for the appended schematic. The schematic symbol library symbol link resolution has been moved out of the SCH_COMPONENT object and move into the SCH_SCREEN object that owns the symbol. This was done to ensure that there is a single place where the library symbol links get resolved rather than the dozen or so different code paths that previously existed. It also removes the necessity of the SCH_COMPONENT object of requiring any knowledge of the symbol library table and/or the cache library. When opening an s-expression schematic, the legacy cache library is not loaded so any library symbols not rescued cannot be loaded. Broken library symbol links will have to be manually resolved by adding the cache library to the symbol library table and changing the links in the schematic symbol. Now that the library symbols are embedded in the schematic file, the SCH_SCREEN object maintains the list of library symbols for the schematic automatically. No external manipulation of this library cache should ever occur. ADDED: S-expression schematic and symbol library file formats.
6 years ago
Make the new schematic and symbol library file formats the default. This is a very large and potentially disruptive change so this will be an unusually long and detailed commit message. The new file formats are now the default in both the schematic and symbol library editors. Existing symbol libraries will be saved in their current format until new features are added to library symbols. Once this happens, both the legacy schematic and symbol file formats will be no longer be savable and existing libraries will have to be converted. Saving to the legacy file formats is still available for round robin testing and should not be used for normal editing. When loading the legacy schematic file, it is imperative that the schematic library symbols are rescued and/or remapped to valid library identifiers. Otherwise, there will be no way to link to the original library symbol and the user will be required manually set the library identifier. The cached symbol will be saved in the schematic file so the last library symbol in the cache will still be used but there will be no way to update it from the original library. The next save after loading a legacy schematic file will be converted to the s-expression file format. Schematics with hierarchical sheets will automatically have all sheet file name extensions changed to .kicad_sym and saved to the new format as well. Appending schematics requires that the schematic to append has already been converted to the new file format. This is required to ensure that library symbols are guaranteed to be valid for the appended schematic. The schematic symbol library symbol link resolution has been moved out of the SCH_COMPONENT object and move into the SCH_SCREEN object that owns the symbol. This was done to ensure that there is a single place where the library symbol links get resolved rather than the dozen or so different code paths that previously existed. It also removes the necessity of the SCH_COMPONENT object of requiring any knowledge of the symbol library table and/or the cache library. When opening an s-expression schematic, the legacy cache library is not loaded so any library symbols not rescued cannot be loaded. Broken library symbol links will have to be manually resolved by adding the cache library to the symbol library table and changing the links in the schematic symbol. Now that the library symbols are embedded in the schematic file, the SCH_SCREEN object maintains the list of library symbols for the schematic automatically. No external manipulation of this library cache should ever occur. ADDED: S-expression schematic and symbol library file formats.
6 years ago
Make the new schematic and symbol library file formats the default. This is a very large and potentially disruptive change so this will be an unusually long and detailed commit message. The new file formats are now the default in both the schematic and symbol library editors. Existing symbol libraries will be saved in their current format until new features are added to library symbols. Once this happens, both the legacy schematic and symbol file formats will be no longer be savable and existing libraries will have to be converted. Saving to the legacy file formats is still available for round robin testing and should not be used for normal editing. When loading the legacy schematic file, it is imperative that the schematic library symbols are rescued and/or remapped to valid library identifiers. Otherwise, there will be no way to link to the original library symbol and the user will be required manually set the library identifier. The cached symbol will be saved in the schematic file so the last library symbol in the cache will still be used but there will be no way to update it from the original library. The next save after loading a legacy schematic file will be converted to the s-expression file format. Schematics with hierarchical sheets will automatically have all sheet file name extensions changed to .kicad_sym and saved to the new format as well. Appending schematics requires that the schematic to append has already been converted to the new file format. This is required to ensure that library symbols are guaranteed to be valid for the appended schematic. The schematic symbol library symbol link resolution has been moved out of the SCH_COMPONENT object and move into the SCH_SCREEN object that owns the symbol. This was done to ensure that there is a single place where the library symbol links get resolved rather than the dozen or so different code paths that previously existed. It also removes the necessity of the SCH_COMPONENT object of requiring any knowledge of the symbol library table and/or the cache library. When opening an s-expression schematic, the legacy cache library is not loaded so any library symbols not rescued cannot be loaded. Broken library symbol links will have to be manually resolved by adding the cache library to the symbol library table and changing the links in the schematic symbol. Now that the library symbols are embedded in the schematic file, the SCH_SCREEN object maintains the list of library symbols for the schematic automatically. No external manipulation of this library cache should ever occur. ADDED: S-expression schematic and symbol library file formats.
6 years ago
Make the new schematic and symbol library file formats the default. This is a very large and potentially disruptive change so this will be an unusually long and detailed commit message. The new file formats are now the default in both the schematic and symbol library editors. Existing symbol libraries will be saved in their current format until new features are added to library symbols. Once this happens, both the legacy schematic and symbol file formats will be no longer be savable and existing libraries will have to be converted. Saving to the legacy file formats is still available for round robin testing and should not be used for normal editing. When loading the legacy schematic file, it is imperative that the schematic library symbols are rescued and/or remapped to valid library identifiers. Otherwise, there will be no way to link to the original library symbol and the user will be required manually set the library identifier. The cached symbol will be saved in the schematic file so the last library symbol in the cache will still be used but there will be no way to update it from the original library. The next save after loading a legacy schematic file will be converted to the s-expression file format. Schematics with hierarchical sheets will automatically have all sheet file name extensions changed to .kicad_sym and saved to the new format as well. Appending schematics requires that the schematic to append has already been converted to the new file format. This is required to ensure that library symbols are guaranteed to be valid for the appended schematic. The schematic symbol library symbol link resolution has been moved out of the SCH_COMPONENT object and move into the SCH_SCREEN object that owns the symbol. This was done to ensure that there is a single place where the library symbol links get resolved rather than the dozen or so different code paths that previously existed. It also removes the necessity of the SCH_COMPONENT object of requiring any knowledge of the symbol library table and/or the cache library. When opening an s-expression schematic, the legacy cache library is not loaded so any library symbols not rescued cannot be loaded. Broken library symbol links will have to be manually resolved by adding the cache library to the symbol library table and changing the links in the schematic symbol. Now that the library symbols are embedded in the schematic file, the SCH_SCREEN object maintains the list of library symbols for the schematic automatically. No external manipulation of this library cache should ever occur. ADDED: S-expression schematic and symbol library file formats.
6 years ago
5 years ago
5 years ago
5 years ago
2 years ago
2 years ago
2 years ago
5 years ago
2 years ago
Make the new schematic and symbol library file formats the default. This is a very large and potentially disruptive change so this will be an unusually long and detailed commit message. The new file formats are now the default in both the schematic and symbol library editors. Existing symbol libraries will be saved in their current format until new features are added to library symbols. Once this happens, both the legacy schematic and symbol file formats will be no longer be savable and existing libraries will have to be converted. Saving to the legacy file formats is still available for round robin testing and should not be used for normal editing. When loading the legacy schematic file, it is imperative that the schematic library symbols are rescued and/or remapped to valid library identifiers. Otherwise, there will be no way to link to the original library symbol and the user will be required manually set the library identifier. The cached symbol will be saved in the schematic file so the last library symbol in the cache will still be used but there will be no way to update it from the original library. The next save after loading a legacy schematic file will be converted to the s-expression file format. Schematics with hierarchical sheets will automatically have all sheet file name extensions changed to .kicad_sym and saved to the new format as well. Appending schematics requires that the schematic to append has already been converted to the new file format. This is required to ensure that library symbols are guaranteed to be valid for the appended schematic. The schematic symbol library symbol link resolution has been moved out of the SCH_COMPONENT object and move into the SCH_SCREEN object that owns the symbol. This was done to ensure that there is a single place where the library symbol links get resolved rather than the dozen or so different code paths that previously existed. It also removes the necessity of the SCH_COMPONENT object of requiring any knowledge of the symbol library table and/or the cache library. When opening an s-expression schematic, the legacy cache library is not loaded so any library symbols not rescued cannot be loaded. Broken library symbol links will have to be manually resolved by adding the cache library to the symbol library table and changing the links in the schematic symbol. Now that the library symbols are embedded in the schematic file, the SCH_SCREEN object maintains the list of library symbols for the schematic automatically. No external manipulation of this library cache should ever occur. ADDED: S-expression schematic and symbol library file formats.
6 years ago
Use legacy schematic plugin for loading schematics in all code paths. Use the legacy plugin schematic loader in the sheet edit and append schematic code paths. Check for fully qualified LIB_ID objects (must have library nickname) when loading existing schematics when edit sheets. Rewrite append schematic feature to handle import issues rather than change the name and file name of all of the sheets in the imported schematic. This includes the following: - Load the schematic into a temporary SCH_SHEET object. - Make sure the imported schematic does not cause any hierarchy recursion issues. - Verify the imported schematic uses fully qualified #LIB_ID objects (symbol library table). - Check to see if any symbol libraries need to be added to the current project's symbol library table. This includes: - Check if the symbol library already exists in the project or global symbol library table. - Convert symbol library URLS that use the ${KIPRJMOD} environment variable to absolute paths. ${KIPRJMOD} will not be the same for this project. - Check for duplicate symbol library nicknames and change the new symbol library nickname to prevent library name clashes. - Update all schematic symbol LIB_ID object library nicknames when the library nickname was changed to prevent clashes. - Check for duplicate sheet names which is illegal and automatically rename any duplicate sheets in the imported schematic. - Clear all of the annotation in the imported schematic to prevent clashes. - Append the objects from the temporary sheet to the current page. - Replace any duplicate time stamps. - Refresh the symbol library links. Add support code to SCH_SCREEN object to assist with schematic import. Doxygen comment cleaning. Fixes lp:1731760 https://bugs.launchpad.net/kicad/+bug/1731760
8 years ago
Use legacy schematic plugin for loading schematics in all code paths. Use the legacy plugin schematic loader in the sheet edit and append schematic code paths. Check for fully qualified LIB_ID objects (must have library nickname) when loading existing schematics when edit sheets. Rewrite append schematic feature to handle import issues rather than change the name and file name of all of the sheets in the imported schematic. This includes the following: - Load the schematic into a temporary SCH_SHEET object. - Make sure the imported schematic does not cause any hierarchy recursion issues. - Verify the imported schematic uses fully qualified #LIB_ID objects (symbol library table). - Check to see if any symbol libraries need to be added to the current project's symbol library table. This includes: - Check if the symbol library already exists in the project or global symbol library table. - Convert symbol library URLS that use the ${KIPRJMOD} environment variable to absolute paths. ${KIPRJMOD} will not be the same for this project. - Check for duplicate symbol library nicknames and change the new symbol library nickname to prevent library name clashes. - Update all schematic symbol LIB_ID object library nicknames when the library nickname was changed to prevent clashes. - Check for duplicate sheet names which is illegal and automatically rename any duplicate sheets in the imported schematic. - Clear all of the annotation in the imported schematic to prevent clashes. - Append the objects from the temporary sheet to the current page. - Replace any duplicate time stamps. - Refresh the symbol library links. Add support code to SCH_SCREEN object to assist with schematic import. Doxygen comment cleaning. Fixes lp:1731760 https://bugs.launchpad.net/kicad/+bug/1731760
8 years ago
18 years ago
18 years ago
18 years ago
18 years ago
18 years ago
18 years ago
Use legacy schematic plugin for loading schematics in all code paths. Use the legacy plugin schematic loader in the sheet edit and append schematic code paths. Check for fully qualified LIB_ID objects (must have library nickname) when loading existing schematics when edit sheets. Rewrite append schematic feature to handle import issues rather than change the name and file name of all of the sheets in the imported schematic. This includes the following: - Load the schematic into a temporary SCH_SHEET object. - Make sure the imported schematic does not cause any hierarchy recursion issues. - Verify the imported schematic uses fully qualified #LIB_ID objects (symbol library table). - Check to see if any symbol libraries need to be added to the current project's symbol library table. This includes: - Check if the symbol library already exists in the project or global symbol library table. - Convert symbol library URLS that use the ${KIPRJMOD} environment variable to absolute paths. ${KIPRJMOD} will not be the same for this project. - Check for duplicate symbol library nicknames and change the new symbol library nickname to prevent library name clashes. - Update all schematic symbol LIB_ID object library nicknames when the library nickname was changed to prevent clashes. - Check for duplicate sheet names which is illegal and automatically rename any duplicate sheets in the imported schematic. - Clear all of the annotation in the imported schematic to prevent clashes. - Append the objects from the temporary sheet to the current page. - Replace any duplicate time stamps. - Refresh the symbol library links. Add support code to SCH_SCREEN object to assist with schematic import. Doxygen comment cleaning. Fixes lp:1731760 https://bugs.launchpad.net/kicad/+bug/1731760
8 years ago
Use legacy schematic plugin for loading schematics in all code paths. Use the legacy plugin schematic loader in the sheet edit and append schematic code paths. Check for fully qualified LIB_ID objects (must have library nickname) when loading existing schematics when edit sheets. Rewrite append schematic feature to handle import issues rather than change the name and file name of all of the sheets in the imported schematic. This includes the following: - Load the schematic into a temporary SCH_SHEET object. - Make sure the imported schematic does not cause any hierarchy recursion issues. - Verify the imported schematic uses fully qualified #LIB_ID objects (symbol library table). - Check to see if any symbol libraries need to be added to the current project's symbol library table. This includes: - Check if the symbol library already exists in the project or global symbol library table. - Convert symbol library URLS that use the ${KIPRJMOD} environment variable to absolute paths. ${KIPRJMOD} will not be the same for this project. - Check for duplicate symbol library nicknames and change the new symbol library nickname to prevent library name clashes. - Update all schematic symbol LIB_ID object library nicknames when the library nickname was changed to prevent clashes. - Check for duplicate sheet names which is illegal and automatically rename any duplicate sheets in the imported schematic. - Clear all of the annotation in the imported schematic to prevent clashes. - Append the objects from the temporary sheet to the current page. - Replace any duplicate time stamps. - Refresh the symbol library links. Add support code to SCH_SCREEN object to assist with schematic import. Doxygen comment cleaning. Fixes lp:1731760 https://bugs.launchpad.net/kicad/+bug/1731760
8 years ago
18 years ago
Use legacy schematic plugin for loading schematics in all code paths. Use the legacy plugin schematic loader in the sheet edit and append schematic code paths. Check for fully qualified LIB_ID objects (must have library nickname) when loading existing schematics when edit sheets. Rewrite append schematic feature to handle import issues rather than change the name and file name of all of the sheets in the imported schematic. This includes the following: - Load the schematic into a temporary SCH_SHEET object. - Make sure the imported schematic does not cause any hierarchy recursion issues. - Verify the imported schematic uses fully qualified #LIB_ID objects (symbol library table). - Check to see if any symbol libraries need to be added to the current project's symbol library table. This includes: - Check if the symbol library already exists in the project or global symbol library table. - Convert symbol library URLS that use the ${KIPRJMOD} environment variable to absolute paths. ${KIPRJMOD} will not be the same for this project. - Check for duplicate symbol library nicknames and change the new symbol library nickname to prevent library name clashes. - Update all schematic symbol LIB_ID object library nicknames when the library nickname was changed to prevent clashes. - Check for duplicate sheet names which is illegal and automatically rename any duplicate sheets in the imported schematic. - Clear all of the annotation in the imported schematic to prevent clashes. - Append the objects from the temporary sheet to the current page. - Replace any duplicate time stamps. - Refresh the symbol library links. Add support code to SCH_SCREEN object to assist with schematic import. Doxygen comment cleaning. Fixes lp:1731760 https://bugs.launchpad.net/kicad/+bug/1731760
8 years ago
18 years ago
6 years ago
Make the new schematic and symbol library file formats the default. This is a very large and potentially disruptive change so this will be an unusually long and detailed commit message. The new file formats are now the default in both the schematic and symbol library editors. Existing symbol libraries will be saved in their current format until new features are added to library symbols. Once this happens, both the legacy schematic and symbol file formats will be no longer be savable and existing libraries will have to be converted. Saving to the legacy file formats is still available for round robin testing and should not be used for normal editing. When loading the legacy schematic file, it is imperative that the schematic library symbols are rescued and/or remapped to valid library identifiers. Otherwise, there will be no way to link to the original library symbol and the user will be required manually set the library identifier. The cached symbol will be saved in the schematic file so the last library symbol in the cache will still be used but there will be no way to update it from the original library. The next save after loading a legacy schematic file will be converted to the s-expression file format. Schematics with hierarchical sheets will automatically have all sheet file name extensions changed to .kicad_sym and saved to the new format as well. Appending schematics requires that the schematic to append has already been converted to the new file format. This is required to ensure that library symbols are guaranteed to be valid for the appended schematic. The schematic symbol library symbol link resolution has been moved out of the SCH_COMPONENT object and move into the SCH_SCREEN object that owns the symbol. This was done to ensure that there is a single place where the library symbol links get resolved rather than the dozen or so different code paths that previously existed. It also removes the necessity of the SCH_COMPONENT object of requiring any knowledge of the symbol library table and/or the cache library. When opening an s-expression schematic, the legacy cache library is not loaded so any library symbols not rescued cannot be loaded. Broken library symbol links will have to be manually resolved by adding the cache library to the symbol library table and changing the links in the schematic symbol. Now that the library symbols are embedded in the schematic file, the SCH_SCREEN object maintains the list of library symbols for the schematic automatically. No external manipulation of this library cache should ever occur. ADDED: S-expression schematic and symbol library file formats.
6 years ago
Make the new schematic and symbol library file formats the default. This is a very large and potentially disruptive change so this will be an unusually long and detailed commit message. The new file formats are now the default in both the schematic and symbol library editors. Existing symbol libraries will be saved in their current format until new features are added to library symbols. Once this happens, both the legacy schematic and symbol file formats will be no longer be savable and existing libraries will have to be converted. Saving to the legacy file formats is still available for round robin testing and should not be used for normal editing. When loading the legacy schematic file, it is imperative that the schematic library symbols are rescued and/or remapped to valid library identifiers. Otherwise, there will be no way to link to the original library symbol and the user will be required manually set the library identifier. The cached symbol will be saved in the schematic file so the last library symbol in the cache will still be used but there will be no way to update it from the original library. The next save after loading a legacy schematic file will be converted to the s-expression file format. Schematics with hierarchical sheets will automatically have all sheet file name extensions changed to .kicad_sym and saved to the new format as well. Appending schematics requires that the schematic to append has already been converted to the new file format. This is required to ensure that library symbols are guaranteed to be valid for the appended schematic. The schematic symbol library symbol link resolution has been moved out of the SCH_COMPONENT object and move into the SCH_SCREEN object that owns the symbol. This was done to ensure that there is a single place where the library symbol links get resolved rather than the dozen or so different code paths that previously existed. It also removes the necessity of the SCH_COMPONENT object of requiring any knowledge of the symbol library table and/or the cache library. When opening an s-expression schematic, the legacy cache library is not loaded so any library symbols not rescued cannot be loaded. Broken library symbol links will have to be manually resolved by adding the cache library to the symbol library table and changing the links in the schematic symbol. Now that the library symbols are embedded in the schematic file, the SCH_SCREEN object maintains the list of library symbols for the schematic automatically. No external manipulation of this library cache should ever occur. ADDED: S-expression schematic and symbol library file formats.
6 years ago
6 years ago
Use legacy schematic plugin for loading schematics in all code paths. Use the legacy plugin schematic loader in the sheet edit and append schematic code paths. Check for fully qualified LIB_ID objects (must have library nickname) when loading existing schematics when edit sheets. Rewrite append schematic feature to handle import issues rather than change the name and file name of all of the sheets in the imported schematic. This includes the following: - Load the schematic into a temporary SCH_SHEET object. - Make sure the imported schematic does not cause any hierarchy recursion issues. - Verify the imported schematic uses fully qualified #LIB_ID objects (symbol library table). - Check to see if any symbol libraries need to be added to the current project's symbol library table. This includes: - Check if the symbol library already exists in the project or global symbol library table. - Convert symbol library URLS that use the ${KIPRJMOD} environment variable to absolute paths. ${KIPRJMOD} will not be the same for this project. - Check for duplicate symbol library nicknames and change the new symbol library nickname to prevent library name clashes. - Update all schematic symbol LIB_ID object library nicknames when the library nickname was changed to prevent clashes. - Check for duplicate sheet names which is illegal and automatically rename any duplicate sheets in the imported schematic. - Clear all of the annotation in the imported schematic to prevent clashes. - Append the objects from the temporary sheet to the current page. - Replace any duplicate time stamps. - Refresh the symbol library links. Add support code to SCH_SCREEN object to assist with schematic import. Doxygen comment cleaning. Fixes lp:1731760 https://bugs.launchpad.net/kicad/+bug/1731760
8 years ago
Use legacy schematic plugin for loading schematics in all code paths. Use the legacy plugin schematic loader in the sheet edit and append schematic code paths. Check for fully qualified LIB_ID objects (must have library nickname) when loading existing schematics when edit sheets. Rewrite append schematic feature to handle import issues rather than change the name and file name of all of the sheets in the imported schematic. This includes the following: - Load the schematic into a temporary SCH_SHEET object. - Make sure the imported schematic does not cause any hierarchy recursion issues. - Verify the imported schematic uses fully qualified #LIB_ID objects (symbol library table). - Check to see if any symbol libraries need to be added to the current project's symbol library table. This includes: - Check if the symbol library already exists in the project or global symbol library table. - Convert symbol library URLS that use the ${KIPRJMOD} environment variable to absolute paths. ${KIPRJMOD} will not be the same for this project. - Check for duplicate symbol library nicknames and change the new symbol library nickname to prevent library name clashes. - Update all schematic symbol LIB_ID object library nicknames when the library nickname was changed to prevent clashes. - Check for duplicate sheet names which is illegal and automatically rename any duplicate sheets in the imported schematic. - Clear all of the annotation in the imported schematic to prevent clashes. - Append the objects from the temporary sheet to the current page. - Replace any duplicate time stamps. - Refresh the symbol library links. Add support code to SCH_SCREEN object to assist with schematic import. Doxygen comment cleaning. Fixes lp:1731760 https://bugs.launchpad.net/kicad/+bug/1731760
8 years ago
Use legacy schematic plugin for loading schematics in all code paths. Use the legacy plugin schematic loader in the sheet edit and append schematic code paths. Check for fully qualified LIB_ID objects (must have library nickname) when loading existing schematics when edit sheets. Rewrite append schematic feature to handle import issues rather than change the name and file name of all of the sheets in the imported schematic. This includes the following: - Load the schematic into a temporary SCH_SHEET object. - Make sure the imported schematic does not cause any hierarchy recursion issues. - Verify the imported schematic uses fully qualified #LIB_ID objects (symbol library table). - Check to see if any symbol libraries need to be added to the current project's symbol library table. This includes: - Check if the symbol library already exists in the project or global symbol library table. - Convert symbol library URLS that use the ${KIPRJMOD} environment variable to absolute paths. ${KIPRJMOD} will not be the same for this project. - Check for duplicate symbol library nicknames and change the new symbol library nickname to prevent library name clashes. - Update all schematic symbol LIB_ID object library nicknames when the library nickname was changed to prevent clashes. - Check for duplicate sheet names which is illegal and automatically rename any duplicate sheets in the imported schematic. - Clear all of the annotation in the imported schematic to prevent clashes. - Append the objects from the temporary sheet to the current page. - Replace any duplicate time stamps. - Refresh the symbol library links. Add support code to SCH_SCREEN object to assist with schematic import. Doxygen comment cleaning. Fixes lp:1731760 https://bugs.launchpad.net/kicad/+bug/1731760
8 years ago
Use legacy schematic plugin for loading schematics in all code paths. Use the legacy plugin schematic loader in the sheet edit and append schematic code paths. Check for fully qualified LIB_ID objects (must have library nickname) when loading existing schematics when edit sheets. Rewrite append schematic feature to handle import issues rather than change the name and file name of all of the sheets in the imported schematic. This includes the following: - Load the schematic into a temporary SCH_SHEET object. - Make sure the imported schematic does not cause any hierarchy recursion issues. - Verify the imported schematic uses fully qualified #LIB_ID objects (symbol library table). - Check to see if any symbol libraries need to be added to the current project's symbol library table. This includes: - Check if the symbol library already exists in the project or global symbol library table. - Convert symbol library URLS that use the ${KIPRJMOD} environment variable to absolute paths. ${KIPRJMOD} will not be the same for this project. - Check for duplicate symbol library nicknames and change the new symbol library nickname to prevent library name clashes. - Update all schematic symbol LIB_ID object library nicknames when the library nickname was changed to prevent clashes. - Check for duplicate sheet names which is illegal and automatically rename any duplicate sheets in the imported schematic. - Clear all of the annotation in the imported schematic to prevent clashes. - Append the objects from the temporary sheet to the current page. - Replace any duplicate time stamps. - Refresh the symbol library links. Add support code to SCH_SCREEN object to assist with schematic import. Doxygen comment cleaning. Fixes lp:1731760 https://bugs.launchpad.net/kicad/+bug/1731760
8 years ago
Use legacy schematic plugin for loading schematics in all code paths. Use the legacy plugin schematic loader in the sheet edit and append schematic code paths. Check for fully qualified LIB_ID objects (must have library nickname) when loading existing schematics when edit sheets. Rewrite append schematic feature to handle import issues rather than change the name and file name of all of the sheets in the imported schematic. This includes the following: - Load the schematic into a temporary SCH_SHEET object. - Make sure the imported schematic does not cause any hierarchy recursion issues. - Verify the imported schematic uses fully qualified #LIB_ID objects (symbol library table). - Check to see if any symbol libraries need to be added to the current project's symbol library table. This includes: - Check if the symbol library already exists in the project or global symbol library table. - Convert symbol library URLS that use the ${KIPRJMOD} environment variable to absolute paths. ${KIPRJMOD} will not be the same for this project. - Check for duplicate symbol library nicknames and change the new symbol library nickname to prevent library name clashes. - Update all schematic symbol LIB_ID object library nicknames when the library nickname was changed to prevent clashes. - Check for duplicate sheet names which is illegal and automatically rename any duplicate sheets in the imported schematic. - Clear all of the annotation in the imported schematic to prevent clashes. - Append the objects from the temporary sheet to the current page. - Replace any duplicate time stamps. - Refresh the symbol library links. Add support code to SCH_SCREEN object to assist with schematic import. Doxygen comment cleaning. Fixes lp:1731760 https://bugs.launchpad.net/kicad/+bug/1731760
8 years ago
Use legacy schematic plugin for loading schematics in all code paths. Use the legacy plugin schematic loader in the sheet edit and append schematic code paths. Check for fully qualified LIB_ID objects (must have library nickname) when loading existing schematics when edit sheets. Rewrite append schematic feature to handle import issues rather than change the name and file name of all of the sheets in the imported schematic. This includes the following: - Load the schematic into a temporary SCH_SHEET object. - Make sure the imported schematic does not cause any hierarchy recursion issues. - Verify the imported schematic uses fully qualified #LIB_ID objects (symbol library table). - Check to see if any symbol libraries need to be added to the current project's symbol library table. This includes: - Check if the symbol library already exists in the project or global symbol library table. - Convert symbol library URLS that use the ${KIPRJMOD} environment variable to absolute paths. ${KIPRJMOD} will not be the same for this project. - Check for duplicate symbol library nicknames and change the new symbol library nickname to prevent library name clashes. - Update all schematic symbol LIB_ID object library nicknames when the library nickname was changed to prevent clashes. - Check for duplicate sheet names which is illegal and automatically rename any duplicate sheets in the imported schematic. - Clear all of the annotation in the imported schematic to prevent clashes. - Append the objects from the temporary sheet to the current page. - Replace any duplicate time stamps. - Refresh the symbol library links. Add support code to SCH_SCREEN object to assist with schematic import. Doxygen comment cleaning. Fixes lp:1731760 https://bugs.launchpad.net/kicad/+bug/1731760
8 years ago
Use legacy schematic plugin for loading schematics in all code paths. Use the legacy plugin schematic loader in the sheet edit and append schematic code paths. Check for fully qualified LIB_ID objects (must have library nickname) when loading existing schematics when edit sheets. Rewrite append schematic feature to handle import issues rather than change the name and file name of all of the sheets in the imported schematic. This includes the following: - Load the schematic into a temporary SCH_SHEET object. - Make sure the imported schematic does not cause any hierarchy recursion issues. - Verify the imported schematic uses fully qualified #LIB_ID objects (symbol library table). - Check to see if any symbol libraries need to be added to the current project's symbol library table. This includes: - Check if the symbol library already exists in the project or global symbol library table. - Convert symbol library URLS that use the ${KIPRJMOD} environment variable to absolute paths. ${KIPRJMOD} will not be the same for this project. - Check for duplicate symbol library nicknames and change the new symbol library nickname to prevent library name clashes. - Update all schematic symbol LIB_ID object library nicknames when the library nickname was changed to prevent clashes. - Check for duplicate sheet names which is illegal and automatically rename any duplicate sheets in the imported schematic. - Clear all of the annotation in the imported schematic to prevent clashes. - Append the objects from the temporary sheet to the current page. - Replace any duplicate time stamps. - Refresh the symbol library links. Add support code to SCH_SCREEN object to assist with schematic import. Doxygen comment cleaning. Fixes lp:1731760 https://bugs.launchpad.net/kicad/+bug/1731760
8 years ago
Use legacy schematic plugin for loading schematics in all code paths. Use the legacy plugin schematic loader in the sheet edit and append schematic code paths. Check for fully qualified LIB_ID objects (must have library nickname) when loading existing schematics when edit sheets. Rewrite append schematic feature to handle import issues rather than change the name and file name of all of the sheets in the imported schematic. This includes the following: - Load the schematic into a temporary SCH_SHEET object. - Make sure the imported schematic does not cause any hierarchy recursion issues. - Verify the imported schematic uses fully qualified #LIB_ID objects (symbol library table). - Check to see if any symbol libraries need to be added to the current project's symbol library table. This includes: - Check if the symbol library already exists in the project or global symbol library table. - Convert symbol library URLS that use the ${KIPRJMOD} environment variable to absolute paths. ${KIPRJMOD} will not be the same for this project. - Check for duplicate symbol library nicknames and change the new symbol library nickname to prevent library name clashes. - Update all schematic symbol LIB_ID object library nicknames when the library nickname was changed to prevent clashes. - Check for duplicate sheet names which is illegal and automatically rename any duplicate sheets in the imported schematic. - Clear all of the annotation in the imported schematic to prevent clashes. - Append the objects from the temporary sheet to the current page. - Replace any duplicate time stamps. - Refresh the symbol library links. Add support code to SCH_SCREEN object to assist with schematic import. Doxygen comment cleaning. Fixes lp:1731760 https://bugs.launchpad.net/kicad/+bug/1731760
8 years ago
Use legacy schematic plugin for loading schematics in all code paths. Use the legacy plugin schematic loader in the sheet edit and append schematic code paths. Check for fully qualified LIB_ID objects (must have library nickname) when loading existing schematics when edit sheets. Rewrite append schematic feature to handle import issues rather than change the name and file name of all of the sheets in the imported schematic. This includes the following: - Load the schematic into a temporary SCH_SHEET object. - Make sure the imported schematic does not cause any hierarchy recursion issues. - Verify the imported schematic uses fully qualified #LIB_ID objects (symbol library table). - Check to see if any symbol libraries need to be added to the current project's symbol library table. This includes: - Check if the symbol library already exists in the project or global symbol library table. - Convert symbol library URLS that use the ${KIPRJMOD} environment variable to absolute paths. ${KIPRJMOD} will not be the same for this project. - Check for duplicate symbol library nicknames and change the new symbol library nickname to prevent library name clashes. - Update all schematic symbol LIB_ID object library nicknames when the library nickname was changed to prevent clashes. - Check for duplicate sheet names which is illegal and automatically rename any duplicate sheets in the imported schematic. - Clear all of the annotation in the imported schematic to prevent clashes. - Append the objects from the temporary sheet to the current page. - Replace any duplicate time stamps. - Refresh the symbol library links. Add support code to SCH_SCREEN object to assist with schematic import. Doxygen comment cleaning. Fixes lp:1731760 https://bugs.launchpad.net/kicad/+bug/1731760
8 years ago
6 years ago
  1. /*
  2. * This program source code file is part of KiCad, a free EDA CAD application.
  3. *
  4. * Copyright (C) 2013 Jean-Pierre Charras, jp.charras at wanadoo.fr
  5. * Copyright (C) 2012 SoftPLC Corporation, Dick Hollenbeck <dick@softplc.com>
  6. * Copyright (C) 2008 Wayne Stambaugh <stambaughw@gmail.com>
  7. * Copyright The KiCad Developers, see AUTHORS.txt for contributors.
  8. *
  9. * This program is free software; you can redistribute it and/or
  10. * modify it under the terms of the GNU General Public License
  11. * as published by the Free Software Foundation; either version 2
  12. * of the License, or (at your option) any later version.
  13. *
  14. * This program is distributed in the hope that it will be useful,
  15. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  16. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  17. * GNU General Public License for more details.
  18. *
  19. * You should have received a copy of the GNU General Public License
  20. * along with this program; if not, you may find one here:
  21. * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
  22. * or you may search the http://www.gnu.org website for the version 2 license,
  23. * or you may write to the Free Software Foundation, Inc.,
  24. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
  25. */
  26. #include <stack>
  27. #include <wx/filefn.h>
  28. #include <wx/log.h>
  29. #include <eda_item.h>
  30. #include <id.h>
  31. #include <string_utils.h>
  32. #include <kiway.h>
  33. #include <plotters/plotter.h>
  34. #include <sch_plotter.h>
  35. #include <project.h>
  36. #include <project_sch.h>
  37. #include <reporter.h>
  38. #include <trace_helpers.h>
  39. #include <sch_edit_frame.h>
  40. #include <sch_item.h>
  41. #include <symbol_library.h>
  42. #include <connection_graph.h>
  43. #include <junction_helpers.h>
  44. #include <sch_pin.h>
  45. #include <sch_symbol.h>
  46. #include <sch_junction.h>
  47. #include <sch_line.h>
  48. #include <sch_marker.h>
  49. #include <sch_sheet.h>
  50. #include <sch_sheet_pin.h>
  51. #include <sch_text.h>
  52. #include <schematic.h>
  53. #include <symb_transforms_utils.h>
  54. #include <symbol_lib_table.h>
  55. #include <tool/common_tools.h>
  56. #include <sim/sim_model.h> // For V6 to V7 simulation model migration.
  57. #include <locale_io.h>
  58. #include <algorithm>
  59. // TODO(JE) Debugging only
  60. #include <core/profile.h>
  61. #include "sch_bus_entry.h"
  62. /**
  63. * Flag to enable profiling of the TestDanglingEnds() function.
  64. *
  65. * @ingroup trace_env_vars
  66. */
  67. static const wxChar DanglingProfileMask[] = wxT( "DANGLING_PROFILE" );
  68. SCH_SCREEN::SCH_SCREEN( EDA_ITEM* aParent ) :
  69. BASE_SCREEN( aParent, SCH_SCREEN_T ),
  70. m_fileFormatVersionAtLoad( 0 ),
  71. m_paper( wxT( "A4" ) ),
  72. m_isReadOnly( false ),
  73. m_fileExists( false )
  74. {
  75. m_modification_sync = 0;
  76. m_refCount = 0;
  77. m_zoomInitialized = false;
  78. m_LastZoomLevel = 1.0;
  79. // Suitable for schematic only. For symbol_editor and viewlib, must be set to true
  80. m_Center = false;
  81. InitDataPoints( m_paper.GetSizeIU( schIUScale.IU_PER_MILS ) );
  82. }
  83. SCH_SCREEN::~SCH_SCREEN()
  84. {
  85. clearLibSymbols();
  86. FreeDrawList();
  87. }
  88. SCHEMATIC* SCH_SCREEN::Schematic() const
  89. {
  90. wxCHECK_MSG( GetParent() && GetParent()->Type() == SCHEMATIC_T, nullptr,
  91. wxT( "SCH_SCREEN must have a SCHEMATIC parent!" ) );
  92. return static_cast<SCHEMATIC*>( GetParent() );
  93. }
  94. void SCH_SCREEN::clearLibSymbols()
  95. {
  96. for( const std::pair<const wxString, LIB_SYMBOL*>& libSymbol : m_libSymbols )
  97. delete libSymbol.second;
  98. m_libSymbols.clear();
  99. }
  100. void SCH_SCREEN::SetFileName( const wxString& aFileName )
  101. {
  102. wxASSERT( aFileName.IsEmpty() || wxIsAbsolutePath( aFileName ) );
  103. m_fileName = aFileName;
  104. }
  105. void SCH_SCREEN::IncRefCount()
  106. {
  107. m_refCount++;
  108. }
  109. void SCH_SCREEN::DecRefCount()
  110. {
  111. wxCHECK_RET( m_refCount != 0, wxT( "Screen reference count already zero. Bad programmer!" ) );
  112. m_refCount--;
  113. }
  114. bool SCH_SCREEN::HasItems( KICAD_T aItemType ) const
  115. {
  116. EE_RTREE::EE_TYPE sheets = m_rtree.OfType( aItemType );
  117. return sheets.begin() != sheets.end();
  118. }
  119. bool SCH_SCREEN::ClassOf( const EDA_ITEM* aItem )
  120. {
  121. return aItem && SCH_SCREEN_T == aItem->Type();
  122. }
  123. void SCH_SCREEN::Append( SCH_ITEM* aItem, bool aUpdateLibSymbol )
  124. {
  125. if( aItem->Type() != SCH_SHEET_PIN_T && aItem->Type() != SCH_FIELD_T )
  126. {
  127. // Ensure the item can reach the SCHEMATIC through this screen
  128. aItem->SetParent( this );
  129. if( aItem->Type() == SCH_SYMBOL_T && aUpdateLibSymbol )
  130. {
  131. SCH_SYMBOL* symbol = static_cast<SCH_SYMBOL*>( aItem );
  132. if( symbol->GetLibSymbolRef() )
  133. {
  134. symbol->GetLibSymbolRef()->GetDrawItems().sort();
  135. auto it = m_libSymbols.find( symbol->GetSchSymbolLibraryName() );
  136. if( it == m_libSymbols.end() || !it->second )
  137. {
  138. m_libSymbols[symbol->GetSchSymbolLibraryName()] =
  139. new LIB_SYMBOL( *symbol->GetLibSymbolRef() );
  140. }
  141. else
  142. {
  143. // The original library symbol may have changed since the last time
  144. // it was added to the schematic. If it has changed, then a new name
  145. // must be created for the library symbol list to prevent all of the
  146. // other schematic symbols referencing that library symbol from changing.
  147. LIB_SYMBOL* foundSymbol = it->second;
  148. foundSymbol->GetDrawItems().sort();
  149. if( *foundSymbol != *symbol->GetLibSymbolRef() )
  150. {
  151. wxString newName;
  152. std::vector<wxString> matches;
  153. getLibSymbolNameMatches( *symbol, matches );
  154. foundSymbol = nullptr;
  155. for( const wxString& libSymbolName : matches )
  156. {
  157. it = m_libSymbols.find( libSymbolName );
  158. if( it == m_libSymbols.end() )
  159. continue;
  160. foundSymbol = it->second;
  161. wxCHECK2( foundSymbol, continue );
  162. wxString tmp = symbol->GetLibSymbolRef()->GetName();
  163. // Temporarily update the new symbol library symbol name so it
  164. // doesn't fail on the name comparison below.
  165. symbol->GetLibSymbolRef()->SetName( foundSymbol->GetName() );
  166. if( *foundSymbol == *symbol->GetLibSymbolRef() )
  167. {
  168. newName = libSymbolName;
  169. symbol->GetLibSymbolRef()->SetName( tmp );
  170. break;
  171. }
  172. symbol->GetLibSymbolRef()->SetName( tmp );
  173. foundSymbol = nullptr;
  174. }
  175. if( !foundSymbol )
  176. {
  177. int cnt = 1;
  178. newName.Printf( wxT( "%s_%d" ),
  179. symbol->GetLibId().GetUniStringLibItemName(),
  180. cnt );
  181. while( m_libSymbols.find( newName ) != m_libSymbols.end() )
  182. {
  183. cnt += 1;
  184. newName.Printf( wxT( "%s_%d" ),
  185. symbol->GetLibId().GetUniStringLibItemName(),
  186. cnt );
  187. }
  188. }
  189. // Update the schematic symbol library link as this symbol only exists
  190. // in the schematic.
  191. symbol->SetSchSymbolLibraryName( newName );
  192. if( !foundSymbol )
  193. {
  194. // Update the schematic symbol library link as this symbol does not
  195. // exist in any symbol library.
  196. LIB_ID newLibId( wxEmptyString, newName );
  197. LIB_SYMBOL* newLibSymbol = new LIB_SYMBOL( *symbol->GetLibSymbolRef() );
  198. newLibSymbol->SetLibId( newLibId );
  199. newLibSymbol->SetName( newName );
  200. symbol->SetLibSymbol( newLibSymbol->Flatten().release() );
  201. m_libSymbols[newName] = newLibSymbol;
  202. }
  203. }
  204. }
  205. }
  206. }
  207. m_rtree.insert( aItem );
  208. --m_modification_sync;
  209. }
  210. }
  211. void SCH_SCREEN::Append( SCH_SCREEN* aScreen )
  212. {
  213. wxCHECK_RET( aScreen, "Invalid screen object." );
  214. // No need to descend the hierarchy. Once the top level screen is copied, all of its
  215. // children are copied as well.
  216. for( SCH_ITEM* aItem : aScreen->m_rtree )
  217. Append( aItem );
  218. aScreen->Clear( false );
  219. }
  220. void SCH_SCREEN::Clear( bool aFree )
  221. {
  222. if( aFree )
  223. {
  224. FreeDrawList();
  225. clearLibSymbols();
  226. }
  227. else
  228. {
  229. m_rtree.clear();
  230. }
  231. // Clear the project settings
  232. m_virtualPageNumber = m_pageCount = 1;
  233. m_titles.Clear();
  234. }
  235. void SCH_SCREEN::FreeDrawList()
  236. {
  237. // We don't know which order we will encounter dependent items (e.g. pins or fields), so
  238. // we store the items to be deleted until we've fully cleared the tree before deleting
  239. std::vector<SCH_ITEM*> delete_list;
  240. std::copy_if( m_rtree.begin(), m_rtree.end(), std::back_inserter( delete_list ),
  241. []( SCH_ITEM* aItem )
  242. {
  243. return ( aItem->Type() != SCH_SHEET_PIN_T && aItem->Type() != SCH_FIELD_T );
  244. } );
  245. m_rtree.clear();
  246. for( SCH_ITEM* item : delete_list )
  247. delete item;
  248. }
  249. void SCH_SCREEN::Update( SCH_ITEM* aItem, bool aUpdateLibSymbol )
  250. {
  251. if( Remove( aItem, aUpdateLibSymbol ) )
  252. Append( aItem, aUpdateLibSymbol );
  253. }
  254. bool SCH_SCREEN::Remove( SCH_ITEM* aItem, bool aUpdateLibSymbol )
  255. {
  256. bool retv = m_rtree.remove( aItem );
  257. // Check if the library symbol for the removed schematic symbol is still required.
  258. if( retv && aItem->Type() == SCH_SYMBOL_T && aUpdateLibSymbol )
  259. {
  260. SCH_SYMBOL* removedSymbol = static_cast<SCH_SYMBOL*>( aItem );
  261. bool removeUnusedLibSymbol = true;
  262. for( SCH_ITEM* item : Items().OfType( SCH_SYMBOL_T ) )
  263. {
  264. SCH_SYMBOL* symbol = static_cast<SCH_SYMBOL*>( item );
  265. if( removedSymbol->GetSchSymbolLibraryName() == symbol->GetSchSymbolLibraryName() )
  266. {
  267. removeUnusedLibSymbol = false;
  268. break;
  269. }
  270. }
  271. if( removeUnusedLibSymbol )
  272. {
  273. auto it = m_libSymbols.find( removedSymbol->GetSchSymbolLibraryName() );
  274. if( it != m_libSymbols.end() )
  275. {
  276. delete it->second;
  277. m_libSymbols.erase( it );
  278. }
  279. }
  280. }
  281. return retv;
  282. }
  283. void SCH_SCREEN::DeleteItem( SCH_ITEM* aItem )
  284. {
  285. wxCHECK_RET( aItem, wxT( "Cannot delete invalid item from screen." ) );
  286. // Markers are not saved in the file, no need to flag as modified.
  287. // TODO: Maybe we should have a listing somewhere of items that aren't saved?
  288. if( aItem->Type() != SCH_MARKER_T )
  289. SetContentModified();
  290. Remove( aItem );
  291. if( aItem->Type() == SCH_SHEET_PIN_T )
  292. {
  293. // This structure is attached to a sheet, get the parent sheet object.
  294. SCH_SHEET_PIN* sheetPin = (SCH_SHEET_PIN*) aItem;
  295. SCH_SHEET* sheet = sheetPin->GetParent();
  296. wxCHECK_RET( sheet, wxT( "Sheet pin parent not properly set, bad programmer!" ) );
  297. sheet->RemovePin( sheetPin );
  298. return;
  299. }
  300. delete aItem;
  301. }
  302. bool SCH_SCREEN::CheckIfOnDrawList( const SCH_ITEM* aItem ) const
  303. {
  304. return m_rtree.contains( aItem, true );
  305. }
  306. SCH_ITEM* SCH_SCREEN::GetItem( const VECTOR2I& aPosition, int aAccuracy, KICAD_T aType ) const
  307. {
  308. BOX2I bbox;
  309. bbox.SetOrigin( aPosition );
  310. bbox.Inflate( aAccuracy );
  311. for( SCH_ITEM* item : Items().Overlapping( aType, bbox ) )
  312. {
  313. if( item->HitTest( aPosition, aAccuracy ) )
  314. return item;
  315. }
  316. return nullptr;
  317. }
  318. std::set<SCH_ITEM*> SCH_SCREEN::MarkConnections( SCH_LINE* aSegment, bool aSecondPass )
  319. {
  320. #define PROCESSED CANDIDATE // Don't use SKIP_STRUCT; IsConnected() returns false if it's set.
  321. std::set<SCH_ITEM*> retval;
  322. std::stack<SCH_LINE*> to_search;
  323. wxCHECK_MSG( aSegment && aSegment->Type() == SCH_LINE_T, retval, wxT( "Invalid pointer." ) );
  324. to_search.push( aSegment );
  325. while( !to_search.empty() )
  326. {
  327. SCH_ITEM* item = to_search.top();
  328. to_search.pop();
  329. if( item->HasFlag( PROCESSED ) )
  330. continue;
  331. item->SetFlags( PROCESSED );
  332. for( SCH_ITEM* candidate : Items().Overlapping( SCH_LINE_T, item->GetBoundingBox() ) )
  333. {
  334. SCH_LINE* line = static_cast<SCH_LINE*>( candidate );
  335. if( line->HasFlag( PROCESSED ) )
  336. continue;
  337. // Skip connecting lines on different layers (e.g. buses)
  338. if( item->GetLayer() != line->GetLayer() )
  339. continue;
  340. for( VECTOR2I pt : { line->GetStartPoint(), line->GetEndPoint() } )
  341. {
  342. if( item->IsConnected( pt ) )
  343. {
  344. SCH_ITEM* junction = GetItem( pt, 0, SCH_JUNCTION_T );
  345. SCH_ITEM* pin = GetItem( pt, 0, SCH_PIN_T );
  346. if( item->IsSelected() && aSecondPass )
  347. {
  348. if( junction )
  349. retval.insert( junction );
  350. retval.insert( line );
  351. to_search.push( line );
  352. }
  353. else if( !junction && !pin )
  354. {
  355. retval.insert( line );
  356. to_search.push( line );
  357. }
  358. break;
  359. }
  360. else if( line->GetLayer() == LAYER_NOTES && item->GetLayer() == LAYER_NOTES )
  361. {
  362. retval.insert( line );
  363. to_search.push( line );
  364. }
  365. }
  366. }
  367. }
  368. for( SCH_ITEM* item : Items() )
  369. item->ClearTempFlags();
  370. return retval;
  371. }
  372. bool SCH_SCREEN::IsJunction( const VECTOR2I& aPosition ) const
  373. {
  374. const JUNCTION_HELPERS::POINT_INFO info =
  375. JUNCTION_HELPERS::AnalyzePoint( Items(), aPosition, false );
  376. return info.isJunction;
  377. }
  378. bool SCH_SCREEN::IsExplicitJunction( const VECTOR2I& aPosition ) const
  379. {
  380. const JUNCTION_HELPERS::POINT_INFO info =
  381. JUNCTION_HELPERS::AnalyzePoint( Items(), aPosition, false );
  382. return info.isJunction && ( !info.hasBusEntry || info.hasBusEntryToMultipleWires );
  383. }
  384. bool SCH_SCREEN::IsExplicitJunctionNeeded( const VECTOR2I& aPosition ) const
  385. {
  386. const JUNCTION_HELPERS::POINT_INFO info =
  387. JUNCTION_HELPERS::AnalyzePoint( Items(), aPosition, false );
  388. return info.isJunction && ( !info.hasBusEntry || info.hasBusEntryToMultipleWires )
  389. && !info.hasExplicitJunctionDot;
  390. }
  391. bool SCH_SCREEN::IsExplicitJunctionAllowed( const VECTOR2I& aPosition ) const
  392. {
  393. const JUNCTION_HELPERS::POINT_INFO info =
  394. JUNCTION_HELPERS::AnalyzePoint( Items(), aPosition, true );
  395. return info.isJunction && (!info.hasBusEntry || info.hasBusEntryToMultipleWires );
  396. }
  397. SPIN_STYLE SCH_SCREEN::GetLabelOrientationForPoint( const VECTOR2I& aPosition,
  398. SPIN_STYLE aDefaultOrientation,
  399. const SCH_SHEET_PATH* aSheet ) const
  400. {
  401. auto ret = aDefaultOrientation;
  402. for( SCH_ITEM* item : Items().Overlapping( aPosition ) )
  403. {
  404. if( item->GetEditFlags() & STRUCT_DELETED )
  405. continue;
  406. switch( item->Type() )
  407. {
  408. case SCH_BUS_WIRE_ENTRY_T:
  409. {
  410. auto busEntry = static_cast<const SCH_BUS_WIRE_ENTRY*>( item );
  411. if( busEntry->m_connected_bus_item )
  412. {
  413. // bus connected, take the bus direction into consideration only if it is
  414. // vertical or horizontal
  415. auto bus = static_cast<const SCH_LINE*>( busEntry->m_connected_bus_item );
  416. if( bus->Angle().AsDegrees() == 90.0 )
  417. {
  418. // bus is vertical -> label shall be horizontal and
  419. // shall be placed to the side where the bus entry is
  420. if( aPosition.x < bus->GetPosition().x )
  421. ret = SPIN_STYLE::LEFT;
  422. else if( aPosition.x > bus->GetPosition().x )
  423. ret = SPIN_STYLE::RIGHT;
  424. }
  425. else if( bus->Angle().AsDegrees() == 0.0 )
  426. {
  427. // bus is horizontal -> label shall be vertical and
  428. // shall be placed to the side where the bus entry is
  429. if( aPosition.y < bus->GetPosition().y )
  430. ret = SPIN_STYLE::UP;
  431. else if( aPosition.y > bus->GetPosition().y )
  432. ret = SPIN_STYLE::BOTTOM;
  433. }
  434. }
  435. }
  436. break;
  437. case SCH_LINE_T:
  438. {
  439. auto line = static_cast<const SCH_LINE*>( item );
  440. // line angles goes between -90 and 90 degrees, but normalize
  441. auto angle = line->Angle().Normalize90().AsDegrees();
  442. if( -45 < angle && angle <= 45 )
  443. {
  444. if( line->GetStartPoint().x <= line->GetEndPoint().x )
  445. ret = line->GetEndPoint() == aPosition ? SPIN_STYLE::RIGHT : SPIN_STYLE::LEFT;
  446. else
  447. ret = line->GetEndPoint() == aPosition ? SPIN_STYLE::LEFT : SPIN_STYLE::RIGHT;
  448. }
  449. else
  450. {
  451. if( line->GetStartPoint().y <= line->GetEndPoint().y )
  452. ret = line->GetEndPoint() == aPosition ? SPIN_STYLE::BOTTOM : SPIN_STYLE::UP;
  453. else
  454. ret = line->GetEndPoint() == aPosition ? SPIN_STYLE::UP : SPIN_STYLE::BOTTOM;
  455. }
  456. }
  457. break;
  458. case SCH_SYMBOL_T:
  459. {
  460. SCH_SYMBOL* symbol = static_cast<SCH_SYMBOL*>( item );
  461. for( SCH_PIN* pin : symbol->GetPins( aSheet ) )
  462. {
  463. if( pin->GetPosition() == aPosition )
  464. {
  465. ret = GetPinSpinStyle( *pin, *symbol );
  466. break;
  467. }
  468. }
  469. }
  470. break;
  471. default: break;
  472. }
  473. }
  474. return ret;
  475. }
  476. bool SCH_SCREEN::IsTerminalPoint( const VECTOR2I& aPosition, int aLayer ) const
  477. {
  478. wxCHECK_MSG( aLayer == LAYER_NOTES || aLayer == LAYER_BUS || aLayer == LAYER_WIRE, false,
  479. wxT( "Invalid layer type passed to SCH_SCREEN::IsTerminalPoint()." ) );
  480. SCH_SHEET_PIN* sheetPin;
  481. SCH_LABEL_BASE* label;
  482. switch( aLayer )
  483. {
  484. case LAYER_BUS:
  485. if( GetBus( aPosition ) )
  486. return true;
  487. sheetPin = GetSheetPin( aPosition );
  488. if( sheetPin && sheetPin->IsConnected( aPosition ) )
  489. return true;
  490. label = GetLabel( aPosition );
  491. if( label && !label->IsNew() && label->IsConnected( aPosition ) )
  492. return true;
  493. break;
  494. case LAYER_NOTES:
  495. if( GetLine( aPosition ) )
  496. return true;
  497. break;
  498. case LAYER_WIRE:
  499. if( GetItem( aPosition, 1, SCH_BUS_WIRE_ENTRY_T ) )
  500. return true;
  501. if( GetItem( aPosition, 1, SCH_JUNCTION_T ) )
  502. return true;
  503. if( GetPin( aPosition, nullptr, true ) )
  504. return true;
  505. if( GetWire( aPosition ) )
  506. return true;
  507. label = GetLabel( aPosition, 1 );
  508. if( label && !label->IsNew() && label->IsConnected( aPosition ) )
  509. return true;
  510. sheetPin = GetSheetPin( aPosition );
  511. if( sheetPin && sheetPin->IsConnected( aPosition ) )
  512. return true;
  513. break;
  514. default:
  515. break;
  516. }
  517. return false;
  518. }
  519. void SCH_SCREEN::UpdateSymbolLinks( REPORTER* aReporter )
  520. {
  521. wxCHECK_RET( Schematic(), "Cannot call SCH_SCREEN::UpdateSymbolLinks with no SCHEMATIC" );
  522. wxString msg;
  523. std::unique_ptr< LIB_SYMBOL > libSymbol;
  524. std::vector<SCH_SYMBOL*> symbols;
  525. SYMBOL_LIB_TABLE* libs = PROJECT_SCH::SchSymbolLibTable( &Schematic()->Prj() );
  526. // This will be a nullptr if an s-expression schematic is loaded.
  527. SYMBOL_LIBS* legacyLibs = PROJECT_SCH::SchLibs( &Schematic()->Prj() );
  528. for( SCH_ITEM* item : Items().OfType( SCH_SYMBOL_T ) )
  529. symbols.push_back( static_cast<SCH_SYMBOL*>( item ) );
  530. // Remove them from the R tree. There bounding box size may change.
  531. for( SCH_SYMBOL* symbol : symbols )
  532. Remove( symbol );
  533. // Clear all existing symbol links.
  534. clearLibSymbols();
  535. for( SCH_SYMBOL* symbol : symbols )
  536. {
  537. LIB_SYMBOL* tmp = nullptr;
  538. libSymbol.reset();
  539. // If the symbol is already in the internal library, map the symbol to it.
  540. auto it = m_libSymbols.find( symbol->GetSchSymbolLibraryName() );
  541. if( ( it != m_libSymbols.end() ) )
  542. {
  543. if( aReporter )
  544. {
  545. msg.Printf( _( "Setting schematic symbol '%s %s' library identifier to '%s'." ),
  546. symbol->GetField( FIELD_T::REFERENCE )->GetText(),
  547. symbol->GetField( FIELD_T::VALUE )->GetText(),
  548. UnescapeString( symbol->GetLibId().Format() ) );
  549. aReporter->ReportTail( msg, RPT_SEVERITY_INFO );
  550. }
  551. // Internal library symbols are already flattened so just make a copy.
  552. symbol->SetLibSymbol( new LIB_SYMBOL( *it->second ) );
  553. continue;
  554. }
  555. if( !symbol->GetLibId().IsValid() )
  556. {
  557. if( aReporter )
  558. {
  559. msg.Printf( _( "Schematic symbol reference '%s' library identifier is not valid. "
  560. "Unable to link library symbol." ),
  561. UnescapeString( symbol->GetLibId().Format() ) );
  562. aReporter->ReportTail( msg, RPT_SEVERITY_WARNING );
  563. }
  564. continue;
  565. }
  566. // LIB_TABLE_BASE::LoadSymbol() throws an IO_ERROR if the library nickname
  567. // is not found in the table so check if the library still exists in the table
  568. // before attempting to load the symbol.
  569. if( !libs->HasLibrary( symbol->GetLibId().GetLibNickname() ) && !legacyLibs )
  570. {
  571. if( aReporter )
  572. {
  573. msg.Printf( _( "Symbol library '%s' not found and no fallback cache library "
  574. "available. Unable to link library symbol." ),
  575. symbol->GetLibId().GetLibNickname().wx_str() );
  576. aReporter->ReportTail( msg, RPT_SEVERITY_WARNING );
  577. }
  578. continue;
  579. }
  580. if( libs->HasLibrary( symbol->GetLibId().GetLibNickname() ) )
  581. {
  582. try
  583. {
  584. tmp = libs->LoadSymbol( symbol->GetLibId() );
  585. }
  586. catch( const IO_ERROR& ioe )
  587. {
  588. if( aReporter )
  589. {
  590. msg.Printf( _( "I/O error %s resolving library symbol %s" ), ioe.What(),
  591. UnescapeString( symbol->GetLibId().Format() ) );
  592. aReporter->ReportTail( msg, RPT_SEVERITY_ERROR );
  593. }
  594. }
  595. }
  596. if( !tmp && legacyLibs && legacyLibs->GetLibraryCount() )
  597. {
  598. SYMBOL_LIB& legacyCacheLib = legacyLibs->back();
  599. // It better be the cache library.
  600. wxCHECK2( legacyCacheLib.IsCache(), continue );
  601. wxString id = symbol->GetLibId().Format();
  602. id.Replace( ':', '_' );
  603. if( aReporter )
  604. {
  605. msg.Printf( _( "Falling back to cache to set symbol '%s:%s' link '%s'." ),
  606. symbol->GetField( FIELD_T::REFERENCE )->GetText(),
  607. symbol->GetField( FIELD_T::VALUE )->GetText(),
  608. UnescapeString( id ) );
  609. aReporter->ReportTail( msg, RPT_SEVERITY_WARNING );
  610. }
  611. tmp = legacyCacheLib.FindSymbol( id );
  612. }
  613. if( tmp )
  614. {
  615. // We want a full symbol not just the top level child symbol.
  616. libSymbol = tmp->Flatten();
  617. libSymbol->SetParent();
  618. m_libSymbols.insert( { symbol->GetSchSymbolLibraryName(),
  619. new LIB_SYMBOL( *libSymbol.get() ) } );
  620. if( aReporter )
  621. {
  622. msg.Printf( _( "Setting schematic symbol '%s %s' library identifier to '%s'." ),
  623. symbol->GetField( FIELD_T::REFERENCE )->GetText(),
  624. symbol->GetField( FIELD_T::VALUE )->GetText(),
  625. UnescapeString( symbol->GetLibId().Format() ) );
  626. aReporter->ReportTail( msg, RPT_SEVERITY_INFO );
  627. }
  628. }
  629. else
  630. {
  631. if( aReporter )
  632. {
  633. msg.Printf( _( "No library symbol found for schematic symbol '%s %s'." ),
  634. symbol->GetField( FIELD_T::REFERENCE )->GetText(),
  635. symbol->GetField( FIELD_T::VALUE )->GetText() );
  636. aReporter->ReportTail( msg, RPT_SEVERITY_ERROR );
  637. }
  638. }
  639. if( libSymbol.get() ) // Only change the old link if the new link exists
  640. symbol->SetLibSymbol( libSymbol.release() );
  641. }
  642. // Changing the symbol may adjust the bbox of the symbol. This re-inserts the
  643. // item with the new bbox
  644. for( SCH_SYMBOL* symbol : symbols )
  645. Append( symbol );
  646. }
  647. void SCH_SCREEN::UpdateLocalLibSymbolLinks()
  648. {
  649. std::vector<SCH_SYMBOL*> symbols;
  650. for( SCH_ITEM* item : Items().OfType( SCH_SYMBOL_T ) )
  651. symbols.push_back( static_cast<SCH_SYMBOL*>( item ) );
  652. for( SCH_SYMBOL* symbol : symbols )
  653. {
  654. // Changing the symbol may adjust the bbox of the symbol; remove and reinsert it afterwards.
  655. m_rtree.remove( symbol );
  656. auto it = m_libSymbols.find( symbol->GetSchSymbolLibraryName() );
  657. LIB_SYMBOL* libSymbol = nullptr;
  658. if( it != m_libSymbols.end() )
  659. libSymbol = new LIB_SYMBOL( *it->second );
  660. symbol->SetLibSymbol( libSymbol );
  661. m_rtree.insert( symbol );
  662. }
  663. }
  664. void SCH_SCREEN::SetConnectivityDirty()
  665. {
  666. for( SCH_ITEM* item : Items() )
  667. item->SetConnectivityDirty( true );
  668. }
  669. void SCH_SCREEN::Plot( PLOTTER* aPlotter, const SCH_PLOT_OPTS& aPlotOpts ) const
  670. {
  671. // Ensure links are up to date, even if a library was reloaded for some reason:
  672. std::vector<SCH_ITEM*> junctions;
  673. std::vector<SCH_ITEM*> bitmaps;
  674. std::vector<SCH_SYMBOL*> symbols;
  675. std::vector<SCH_ITEM*> other;
  676. for( SCH_ITEM* item : Items() )
  677. {
  678. if( item->IsMoving() )
  679. continue;
  680. if( item->Type() == SCH_JUNCTION_T )
  681. junctions.push_back( item );
  682. else if( item->Type() == SCH_BITMAP_T )
  683. bitmaps.push_back( item );
  684. else
  685. other.push_back( item );
  686. // Where the symbols overlap each other, we need to plot the text items a second
  687. // time to get them on top of the overlapping element. This collection is in addition
  688. // to the symbols already collected in `other`
  689. if( item->Type() == SCH_SYMBOL_T )
  690. {
  691. for( SCH_ITEM* sym : m_rtree.Overlapping( SCH_SYMBOL_T, item->GetBoundingBox() ) )
  692. {
  693. if( sym != item )
  694. {
  695. symbols.push_back( static_cast<SCH_SYMBOL*>( item ) );
  696. break;
  697. }
  698. }
  699. }
  700. }
  701. /// Sort to ensure plot-order consistency with screen drawing
  702. std::sort( other.begin(), other.end(),
  703. []( const SCH_ITEM* a, const SCH_ITEM* b )
  704. {
  705. if( a->Type() == b->Type() )
  706. return a->GetLayer() > b->GetLayer();
  707. return a->Type() > b->Type();
  708. } );
  709. auto* renderSettings = static_cast<SCH_RENDER_SETTINGS*>( aPlotter->RenderSettings() );
  710. constexpr bool background = true;
  711. // Bitmaps are drawn first to ensure they are in the background
  712. // This is particularly important for the wxPostscriptDC (used in *nix printers) as
  713. // the bitmap PS command clears the screen
  714. for( SCH_ITEM* item : bitmaps )
  715. {
  716. aPlotter->SetCurrentLineWidth( item->GetEffectivePenWidth( renderSettings ) );
  717. item->Plot( aPlotter, background, aPlotOpts, 0, 0, { 0, 0 }, false );
  718. }
  719. // Plot the background items
  720. for( SCH_ITEM* item : other )
  721. {
  722. aPlotter->SetCurrentLineWidth( item->GetEffectivePenWidth( renderSettings ) );
  723. item->Plot( aPlotter, background, aPlotOpts, 0, 0, { 0, 0 }, false );
  724. }
  725. // Plot the foreground items
  726. for( SCH_ITEM* item : other )
  727. {
  728. aPlotter->SetCurrentLineWidth( item->GetEffectivePenWidth( renderSettings ) );
  729. item->Plot( aPlotter, !background, aPlotOpts, 0, 0, { 0, 0 }, false );
  730. }
  731. // After plotting the symbols as a group above (in `other`), we need to overplot the pins
  732. // and symbols to ensure that they are always visible
  733. TRANSFORM savedTransform = renderSettings->m_Transform;
  734. for( const SCH_SYMBOL* sym :symbols )
  735. {
  736. renderSettings->m_Transform = sym->GetTransform();
  737. aPlotter->SetCurrentLineWidth( sym->GetEffectivePenWidth( renderSettings ) );
  738. for( SCH_FIELD field : sym->GetFields() )
  739. {
  740. field.ClearRenderCache();
  741. field.Plot( aPlotter, false, aPlotOpts, sym->GetUnit(), sym->GetBodyStyle(), { 0, 0 },
  742. sym->GetDNP() );
  743. }
  744. sym->PlotPins( aPlotter );
  745. if( sym->GetDNP() )
  746. sym->PlotDNP( aPlotter );
  747. }
  748. renderSettings->m_Transform = savedTransform;
  749. for( SCH_ITEM* item : junctions )
  750. {
  751. aPlotter->SetCurrentLineWidth( item->GetEffectivePenWidth( renderSettings ) );
  752. item->Plot( aPlotter, !background, aPlotOpts, 0, 0, { 0, 0 }, false );
  753. }
  754. }
  755. void SCH_SCREEN::ClearDrawingState()
  756. {
  757. for( SCH_ITEM* item : Items() )
  758. item->ClearTempFlags();
  759. }
  760. SCH_PIN* SCH_SCREEN::GetPin( const VECTOR2I& aPosition, SCH_SYMBOL** aSymbol,
  761. bool aEndPointOnly ) const
  762. {
  763. SCH_SYMBOL* candidate = nullptr;
  764. SCH_PIN* pin = nullptr;
  765. for( SCH_ITEM* item : Items().Overlapping( SCH_SYMBOL_T, aPosition ) )
  766. {
  767. candidate = static_cast<SCH_SYMBOL*>( item );
  768. if( aEndPointOnly )
  769. {
  770. pin = nullptr;
  771. if( !candidate->GetLibSymbolRef() )
  772. continue;
  773. for( SCH_PIN* test_pin : candidate->GetLibPins() )
  774. {
  775. if( candidate->GetPinPhysicalPosition( test_pin ) == aPosition )
  776. {
  777. pin = test_pin;
  778. break;
  779. }
  780. }
  781. if( pin )
  782. break;
  783. }
  784. else
  785. {
  786. pin = static_cast<SCH_PIN*>( candidate->GetDrawItem( aPosition, SCH_PIN_T ) );
  787. if( pin )
  788. break;
  789. }
  790. }
  791. if( pin && aSymbol )
  792. *aSymbol = candidate;
  793. return pin;
  794. }
  795. SCH_SHEET_PIN* SCH_SCREEN::GetSheetPin( const VECTOR2I& aPosition ) const
  796. {
  797. SCH_SHEET_PIN* sheetPin = nullptr;
  798. for( SCH_ITEM* item : Items().Overlapping( SCH_SHEET_T, aPosition ) )
  799. {
  800. SCH_SHEET* sheet = static_cast<SCH_SHEET*>( item );
  801. sheetPin = sheet->GetPin( aPosition );
  802. if( sheetPin )
  803. break;
  804. }
  805. return sheetPin;
  806. }
  807. size_t SCH_SCREEN::CountConnectedItems( const VECTOR2I& aPos, bool aTestJunctions ) const
  808. {
  809. size_t count = 0;
  810. for( const SCH_ITEM* item : Items().Overlapping( aPos ) )
  811. {
  812. if( ( item->Type() != SCH_JUNCTION_T || aTestJunctions ) && item->IsConnected( aPos ) )
  813. count++;
  814. }
  815. return count;
  816. }
  817. void SCH_SCREEN::ClearAnnotation( SCH_SHEET_PATH* aSheetPath, bool aResetPrefix )
  818. {
  819. for( SCH_ITEM* item : Items().OfType( SCH_SYMBOL_T ) )
  820. {
  821. SCH_SYMBOL* symbol = static_cast<SCH_SYMBOL*>( item );
  822. symbol->ClearAnnotation( aSheetPath, aResetPrefix );
  823. }
  824. }
  825. void SCH_SCREEN::EnsureAlternateReferencesExist()
  826. {
  827. if( GetClientSheetPaths().size() <= 1 ) // No need for alternate reference
  828. return;
  829. for( SCH_ITEM* item : Items().OfType( SCH_SYMBOL_T ) )
  830. {
  831. SCH_SYMBOL* symbol = static_cast<SCH_SYMBOL*>( item );
  832. // Add (when not existing) all sheet path entries
  833. for( const SCH_SHEET_PATH& sheet : GetClientSheetPaths() )
  834. symbol->AddSheetPathReferenceEntryIfMissing( sheet.Path() );
  835. }
  836. }
  837. void SCH_SCREEN::GetHierarchicalItems( std::vector<SCH_ITEM*>* aItems ) const
  838. {
  839. static const std::vector<KICAD_T> hierarchicalTypes = { SCH_SYMBOL_T,
  840. SCH_SHEET_T,
  841. SCH_LABEL_LOCATE_ANY_T };
  842. for( SCH_ITEM* item : Items() )
  843. {
  844. if( item->IsType( hierarchicalTypes ) )
  845. aItems->push_back( item );
  846. }
  847. }
  848. void SCH_SCREEN::GetSheets( std::vector<SCH_ITEM*>* aItems ) const
  849. {
  850. for( SCH_ITEM* item : Items().OfType( SCH_SHEET_T ) )
  851. aItems->push_back( item );
  852. std::sort( aItems->begin(), aItems->end(),
  853. []( EDA_ITEM* a, EDA_ITEM* b ) -> bool
  854. {
  855. if( a->GetPosition().x == b->GetPosition().x )
  856. {
  857. // Ensure deterministic sort
  858. if( a->GetPosition().y == b->GetPosition().y )
  859. return a->m_Uuid < b->m_Uuid;
  860. return a->GetPosition().y < b->GetPosition().y;
  861. }
  862. else
  863. {
  864. return a->GetPosition().x < b->GetPosition().x;
  865. }
  866. } );
  867. }
  868. void SCH_SCREEN::TestDanglingEnds( const SCH_SHEET_PATH* aPath,
  869. std::function<void( SCH_ITEM* )>* aChangedHandler ) const
  870. {
  871. PROF_TIMER timer( __FUNCTION__ );
  872. std::vector<DANGLING_END_ITEM> endPointsByPos;
  873. std::vector<DANGLING_END_ITEM> endPointsByType;
  874. auto get_ends =
  875. [&]( SCH_ITEM* item )
  876. {
  877. if( item->IsConnectable() )
  878. item->GetEndPoints( endPointsByType );
  879. };
  880. auto update_state =
  881. [&]( SCH_ITEM* item )
  882. {
  883. if( item->UpdateDanglingState( endPointsByType, endPointsByPos, aPath ) )
  884. {
  885. if( aChangedHandler )
  886. ( *aChangedHandler )( item );
  887. }
  888. };
  889. for( SCH_ITEM* item : Items() )
  890. {
  891. get_ends( item );
  892. item->RunOnChildren( get_ends );
  893. }
  894. PROF_TIMER sortTimer( "SCH_SCREEN::TestDanglingEnds pre-sort" );
  895. endPointsByPos = endPointsByType;
  896. DANGLING_END_ITEM_HELPER::sort_dangling_end_items( endPointsByType, endPointsByPos );
  897. sortTimer.Stop();
  898. if( wxLog::IsAllowedTraceMask( DanglingProfileMask ) )
  899. sortTimer.Show();
  900. for( SCH_ITEM* item : Items() )
  901. {
  902. update_state( item );
  903. item->RunOnChildren( update_state );
  904. }
  905. if( wxLog::IsAllowedTraceMask( DanglingProfileMask ) )
  906. timer.Show();
  907. }
  908. SCH_LINE* SCH_SCREEN::GetLine( const VECTOR2I& aPosition, int aAccuracy, int aLayer,
  909. SCH_LINE_TEST_T aSearchType ) const
  910. {
  911. // an accuracy of 0 had problems with rounding errors; use at least 1
  912. aAccuracy = std::max( aAccuracy, 1 );
  913. for( SCH_ITEM* item : Items().Overlapping( aPosition, aAccuracy ) )
  914. {
  915. if( item->Type() != SCH_LINE_T )
  916. continue;
  917. if( item->GetLayer() != aLayer )
  918. continue;
  919. if( !item->HitTest( aPosition, aAccuracy ) )
  920. continue;
  921. switch( aSearchType )
  922. {
  923. case ENTIRE_LENGTH_T:
  924. return (SCH_LINE*) item;
  925. case EXCLUDE_END_POINTS_T:
  926. if( !( (SCH_LINE*) item )->IsEndPoint( aPosition ) )
  927. return (SCH_LINE*) item;
  928. break;
  929. case END_POINTS_ONLY_T:
  930. if( ( (SCH_LINE*) item )->IsEndPoint( aPosition ) )
  931. return (SCH_LINE*) item;
  932. }
  933. }
  934. return nullptr;
  935. }
  936. std::vector<SCH_LINE*> SCH_SCREEN::GetBusesAndWires( const VECTOR2I& aPosition,
  937. bool aIgnoreEndpoints ) const
  938. {
  939. std::vector<SCH_LINE*> retVal;
  940. for( SCH_ITEM* item : Items().Overlapping( SCH_LINE_T, aPosition ) )
  941. {
  942. if( item->IsType( { SCH_ITEM_LOCATE_WIRE_T, SCH_ITEM_LOCATE_BUS_T } ) )
  943. {
  944. SCH_LINE* wire = static_cast<SCH_LINE*>( item );
  945. if( aIgnoreEndpoints && wire->IsEndPoint( aPosition ) )
  946. continue;
  947. if( IsPointOnSegment( wire->GetStartPoint(), wire->GetEndPoint(), aPosition ) )
  948. retVal.push_back( wire );
  949. }
  950. }
  951. return retVal;
  952. }
  953. std::vector<VECTOR2I> SCH_SCREEN::GetConnections() const
  954. {
  955. std::vector<VECTOR2I> retval;
  956. for( SCH_ITEM* item : Items() )
  957. {
  958. // Avoid items that are changing
  959. if( !( item->GetEditFlags() & ( IS_MOVING | IS_DELETED ) ) )
  960. {
  961. std::vector<VECTOR2I> pts = item->GetConnectionPoints();
  962. retval.insert( retval.end(), pts.begin(), pts.end() );
  963. }
  964. }
  965. // We always have some overlapping connection points. Drop duplicates here
  966. std::sort( retval.begin(), retval.end(),
  967. []( const VECTOR2I& a, const VECTOR2I& b ) -> bool
  968. {
  969. return a.x < b.x || ( a.x == b.x && a.y < b.y );
  970. } );
  971. retval.erase( std::unique( retval.begin(), retval.end() ), retval.end() );
  972. return retval;
  973. }
  974. std::vector<VECTOR2I> SCH_SCREEN::GetNeededJunctions( const std::deque<EDA_ITEM*>& aItems ) const
  975. {
  976. std::vector<VECTOR2I> pts;
  977. std::vector<VECTOR2I> connections = GetConnections();
  978. for( const EDA_ITEM* edaItem : aItems )
  979. {
  980. const SCH_ITEM* item = dynamic_cast<const SCH_ITEM*>( edaItem );
  981. if( !item || !item->IsConnectable() )
  982. continue;
  983. std::vector<VECTOR2I> new_pts = item->GetConnectionPoints();
  984. pts.insert( pts.end(), new_pts.begin(), new_pts.end() );
  985. // If the item is a line, we also add any connection points from the rest of the schematic
  986. // that terminate on the line after it is moved.
  987. if( item->Type() == SCH_LINE_T )
  988. {
  989. SCH_LINE* line = (SCH_LINE*) item;
  990. for( const VECTOR2I& pt : connections )
  991. {
  992. if( IsPointOnSegment( line->GetStartPoint(), line->GetEndPoint(), pt ) )
  993. pts.push_back( pt );
  994. }
  995. }
  996. }
  997. // We always have some overlapping connection points. Drop duplicates here
  998. std::sort( pts.begin(), pts.end(),
  999. []( const VECTOR2I& a, const VECTOR2I& b ) -> bool
  1000. {
  1001. return a.x < b.x || ( a.x == b.x && a.y < b.y );
  1002. } );
  1003. pts.erase( unique( pts.begin(), pts.end() ), pts.end() );
  1004. // We only want the needed junction points, remove all the others
  1005. pts.erase( std::remove_if( pts.begin(), pts.end(),
  1006. [this]( const VECTOR2I& a ) -> bool
  1007. {
  1008. return !IsExplicitJunctionNeeded( a );
  1009. } ),
  1010. pts.end() );
  1011. return pts;
  1012. }
  1013. SCH_LABEL_BASE* SCH_SCREEN::GetLabel( const VECTOR2I& aPosition, int aAccuracy ) const
  1014. {
  1015. for( SCH_ITEM* item : Items().Overlapping( aPosition, aAccuracy ) )
  1016. {
  1017. switch( item->Type() )
  1018. {
  1019. case SCH_LABEL_T:
  1020. case SCH_GLOBAL_LABEL_T:
  1021. case SCH_HIER_LABEL_T:
  1022. case SCH_DIRECTIVE_LABEL_T:
  1023. if( item->HitTest( aPosition, aAccuracy ) )
  1024. return static_cast<SCH_LABEL_BASE*>( item );
  1025. break;
  1026. default:
  1027. ;
  1028. }
  1029. }
  1030. return nullptr;
  1031. }
  1032. void SCH_SCREEN::AddLibSymbol( LIB_SYMBOL* aLibSymbol )
  1033. {
  1034. wxCHECK( aLibSymbol, /* void */ );
  1035. wxString libSymbolName = aLibSymbol->GetLibId().Format().wx_str();
  1036. auto it = m_libSymbols.find( libSymbolName );
  1037. if( it != m_libSymbols.end() )
  1038. {
  1039. delete it->second;
  1040. m_libSymbols.erase( it );
  1041. }
  1042. m_libSymbols[libSymbolName] = aLibSymbol;
  1043. }
  1044. void SCH_SCREEN::FixupEmbeddedData()
  1045. {
  1046. SCHEMATIC* schematic = Schematic();
  1047. const std::vector<wxString>* embeddedFonts = schematic->GetEmbeddedFiles()->UpdateFontFiles();
  1048. for( auto& [name, libSym] : m_libSymbols )
  1049. {
  1050. for( auto& [filename, embeddedFile] : libSym->EmbeddedFileMap() )
  1051. {
  1052. EMBEDDED_FILES::EMBEDDED_FILE* file = schematic->GetEmbeddedFile( filename );
  1053. if( file )
  1054. {
  1055. embeddedFile->compressedEncodedData = file->compressedEncodedData;
  1056. embeddedFile->decompressedData = file->decompressedData;
  1057. embeddedFile->data_hash = file->data_hash;
  1058. embeddedFile->is_valid = file->is_valid;
  1059. }
  1060. }
  1061. libSym->RunOnChildren(
  1062. [&]( SCH_ITEM* aChild )
  1063. {
  1064. if( EDA_TEXT* textItem = dynamic_cast<EDA_TEXT*>( aChild ) )
  1065. textItem->ResolveFont( embeddedFonts );
  1066. } );
  1067. }
  1068. std::vector<SCH_ITEM*> items_to_update;
  1069. for( SCH_ITEM* item : Items() )
  1070. {
  1071. bool update = false;
  1072. if( EDA_TEXT* textItem = dynamic_cast<EDA_TEXT*>( item ) )
  1073. update |= textItem->ResolveFont( embeddedFonts );
  1074. item->RunOnChildren(
  1075. [&]( SCH_ITEM* aChild )
  1076. {
  1077. if( EDA_TEXT* textItem = dynamic_cast<EDA_TEXT*>( aChild ) )
  1078. update |= textItem->ResolveFont( embeddedFonts );
  1079. } );
  1080. if( update )
  1081. items_to_update.push_back( item );
  1082. }
  1083. for( SCH_ITEM* item : items_to_update )
  1084. Update( item );
  1085. }
  1086. void SCH_SCREEN::AddBusAlias( std::shared_ptr<BUS_ALIAS> aAlias )
  1087. {
  1088. m_aliases.insert( aAlias );
  1089. }
  1090. void SCH_SCREEN::SetLegacySymbolInstanceData()
  1091. {
  1092. for( SCH_ITEM* item : Items().OfType( SCH_SYMBOL_T ) )
  1093. {
  1094. SCH_SYMBOL* symbol = static_cast<SCH_SYMBOL*>( item );
  1095. // Add missing value and footprint instance data for legacy schematics.
  1096. for( const SCH_SYMBOL_INSTANCE& instance : symbol->GetInstances() )
  1097. {
  1098. symbol->AddHierarchicalReference( instance.m_Path, instance.m_Reference,
  1099. instance.m_Unit );
  1100. }
  1101. }
  1102. }
  1103. void SCH_SCREEN::FixLegacyPowerSymbolMismatches()
  1104. {
  1105. for( SCH_ITEM* item : Items().OfType( SCH_SYMBOL_T ) )
  1106. {
  1107. SCH_SYMBOL* symbol = static_cast<SCH_SYMBOL*>( item );
  1108. // Fix pre-8.0 legacy power symbols with invisible pins
  1109. // that have mismatched pin names and value fields
  1110. if( symbol->GetLibSymbolRef()
  1111. && symbol->GetLibSymbolRef()->IsPower()
  1112. && symbol->GetAllLibPins().size() > 0
  1113. && symbol->GetAllLibPins()[0]->IsGlobalPower()
  1114. && !symbol->GetAllLibPins()[0]->IsVisible() )
  1115. {
  1116. symbol->SetValueFieldText( symbol->GetAllLibPins()[0]->GetName() );
  1117. }
  1118. }
  1119. }
  1120. size_t SCH_SCREEN::getLibSymbolNameMatches( const SCH_SYMBOL& aSymbol,
  1121. std::vector<wxString>& aMatches )
  1122. {
  1123. wxString searchName = aSymbol.GetLibId().GetUniStringLibId();
  1124. if( m_libSymbols.find( searchName ) != m_libSymbols.end() )
  1125. aMatches.emplace_back( searchName );
  1126. searchName = aSymbol.GetLibId().GetUniStringLibItemName() + wxS( "_" );
  1127. long tmp;
  1128. wxString suffix;
  1129. for( auto& pair : m_libSymbols )
  1130. {
  1131. if( pair.first.StartsWith( searchName, &suffix ) && suffix.ToLong( &tmp ) )
  1132. aMatches.emplace_back( pair.first );
  1133. }
  1134. return aMatches.size();
  1135. }
  1136. void SCH_SCREEN::PruneOrphanedSymbolInstances( const wxString& aProjectName,
  1137. const SCH_SHEET_LIST& aValidSheetPaths )
  1138. {
  1139. // The project name cannot be empty. Projects older than 7.0 did not save project names
  1140. // when saving instance data. Running this algorithm with an empty project name would
  1141. // clobber all instance data for projects other than the current one when a schematic
  1142. // file is shared across multiple projects. Because running the schematic editor in
  1143. // stand alone mode can result in an empty project name, do not assert here.
  1144. if( aProjectName.IsEmpty() )
  1145. return;
  1146. for( SCH_ITEM* item : Items().OfType( SCH_SYMBOL_T ) )
  1147. {
  1148. SCH_SYMBOL* symbol = static_cast<SCH_SYMBOL*>( item );
  1149. wxCHECK2( symbol, continue );
  1150. std::set<KIID_PATH> pathsToPrune;
  1151. const std::vector<SCH_SYMBOL_INSTANCE> instances = symbol->GetInstances();
  1152. for( const SCH_SYMBOL_INSTANCE& instance : instances )
  1153. {
  1154. // Ignore instance paths from other projects.
  1155. if( aProjectName != instance.m_ProjectName )
  1156. continue;
  1157. std::optional<SCH_SHEET_PATH> pathFound =
  1158. aValidSheetPaths.GetSheetPathByKIIDPath( instance.m_Path );
  1159. // Check for paths that do not exist in the current project and paths that do
  1160. // not contain the current symbol.
  1161. if( !pathFound )
  1162. pathsToPrune.emplace( instance.m_Path );
  1163. else if( pathFound.value().LastScreen() != this )
  1164. pathsToPrune.emplace( pathFound.value().Path() );
  1165. }
  1166. for( const KIID_PATH& sheetPath : pathsToPrune )
  1167. {
  1168. wxLogTrace( traceSchSheetPaths, wxS( "Pruning project '%s' symbol instance %s." ),
  1169. aProjectName, sheetPath.AsString() );
  1170. symbol->RemoveInstance( sheetPath );
  1171. }
  1172. }
  1173. }
  1174. void SCH_SCREEN::PruneOrphanedSheetInstances( const wxString& aProjectName,
  1175. const SCH_SHEET_LIST& aValidSheetPaths )
  1176. {
  1177. // The project name cannot be empty. Projects older than 7.0 did not save project names
  1178. // when saving instance data. Running this algorithm with an empty project name would
  1179. // clobber all instance data for projects other than the current one when a schematic
  1180. // file is shared across multiple projects. Because running the schematic editor in
  1181. // stand alone mode can result in an empty project name, do not assert here.
  1182. if( aProjectName.IsEmpty() )
  1183. return;
  1184. for( SCH_ITEM* item : Items().OfType( SCH_SHEET_T ) )
  1185. {
  1186. SCH_SHEET* sheet = static_cast<SCH_SHEET*>( item );
  1187. wxCHECK2( sheet, continue );
  1188. std::set<KIID_PATH> pathsToPrune;
  1189. const std::vector<SCH_SHEET_INSTANCE> instances = sheet->GetInstances();
  1190. for( const SCH_SHEET_INSTANCE& instance : instances )
  1191. {
  1192. // Ignore instance paths from other projects.
  1193. if( aProjectName != instance.m_ProjectName )
  1194. continue;
  1195. std::optional<SCH_SHEET_PATH> pathFound =
  1196. aValidSheetPaths.GetSheetPathByKIIDPath( instance.m_Path );
  1197. // Check for paths that do not exist in the current project and paths that do
  1198. // not contain the current symbol.
  1199. if( !pathFound )
  1200. pathsToPrune.emplace( instance.m_Path );
  1201. else if( pathFound.value().LastScreen() != this )
  1202. pathsToPrune.emplace( pathFound.value().Path() );
  1203. }
  1204. for( const KIID_PATH& sheetPath : pathsToPrune )
  1205. {
  1206. wxLogTrace( traceSchSheetPaths, wxS( "Pruning project '%s' sheet instance %s." ),
  1207. aProjectName, sheetPath.AsString() );
  1208. sheet->RemoveInstance( sheetPath );
  1209. }
  1210. }
  1211. }
  1212. bool SCH_SCREEN::HasSymbolFieldNamesWithWhiteSpace() const
  1213. {
  1214. wxString trimmedFieldName;
  1215. for( const SCH_ITEM* item : Items().OfType( SCH_SYMBOL_T ) )
  1216. {
  1217. const SCH_SYMBOL* symbol = static_cast<const SCH_SYMBOL*>( item );
  1218. wxCHECK2( symbol, continue );
  1219. for( const SCH_FIELD& field : symbol->GetFields() )
  1220. {
  1221. trimmedFieldName = field.GetName();
  1222. trimmedFieldName.Trim();
  1223. trimmedFieldName.Trim( false );
  1224. if( field.GetName() != trimmedFieldName )
  1225. return true;
  1226. }
  1227. }
  1228. return false;
  1229. }
  1230. #if defined(DEBUG)
  1231. void SCH_SCREEN::Show( int nestLevel, std::ostream& os ) const
  1232. {
  1233. // for now, make it look like XML, expand on this later.
  1234. NestedSpace( nestLevel, os ) << '<' << GetClass().Lower().mb_str() << ">\n";
  1235. for( const SCH_ITEM* item : Items() )
  1236. item->Show( nestLevel + 1, os );
  1237. NestedSpace( nestLevel, os ) << "</" << GetClass().Lower().mb_str() << ">\n";
  1238. }
  1239. #endif
  1240. SCH_SCREENS::SCH_SCREENS( SCH_SHEET* aSheet )
  1241. {
  1242. m_index = 0;
  1243. buildScreenList( aSheet );
  1244. }
  1245. SCH_SCREENS::~SCH_SCREENS()
  1246. {
  1247. }
  1248. SCH_SCREEN* SCH_SCREENS::GetFirst()
  1249. {
  1250. m_index = 0;
  1251. if( m_screens.size() > 0 )
  1252. return m_screens[0];
  1253. return nullptr;
  1254. }
  1255. SCH_SCREEN* SCH_SCREENS::GetNext()
  1256. {
  1257. if( m_index < m_screens.size() )
  1258. m_index++;
  1259. return GetScreen( m_index );
  1260. }
  1261. SCH_SCREEN* SCH_SCREENS::GetScreen( unsigned int aIndex ) const
  1262. {
  1263. if( aIndex < m_screens.size() )
  1264. return m_screens[ aIndex ];
  1265. return nullptr;
  1266. }
  1267. SCH_SHEET* SCH_SCREENS::GetSheet( unsigned int aIndex ) const
  1268. {
  1269. if( aIndex < m_sheets.size() )
  1270. return m_sheets[ aIndex ];
  1271. return nullptr;
  1272. }
  1273. void SCH_SCREENS::addScreenToList( SCH_SCREEN* aScreen, SCH_SHEET* aSheet )
  1274. {
  1275. if( aScreen == nullptr )
  1276. return;
  1277. for( const SCH_SCREEN* screen : m_screens )
  1278. {
  1279. if( screen == aScreen )
  1280. return;
  1281. }
  1282. m_screens.push_back( aScreen );
  1283. m_sheets.push_back( aSheet );
  1284. }
  1285. void SCH_SCREENS::buildScreenList( SCH_SHEET* aSheet )
  1286. {
  1287. if( aSheet && aSheet->Type() == SCH_SHEET_T )
  1288. {
  1289. SCH_SCREEN* screen = aSheet->GetScreen();
  1290. wxCHECK_RET( screen, "No screen for aSheet" );
  1291. addScreenToList( screen, aSheet );
  1292. for( SCH_ITEM* item : screen->Items().OfType( SCH_SHEET_T ) )
  1293. buildScreenList( static_cast<SCH_SHEET*>( item ) );
  1294. }
  1295. }
  1296. void SCH_SCREENS::ClearAnnotationOfNewSheetPaths( SCH_SHEET_LIST& aInitialSheetPathList )
  1297. {
  1298. SCH_SCREEN* first = GetFirst();
  1299. if( !first )
  1300. return;
  1301. SCHEMATIC* sch = first->Schematic();
  1302. wxCHECK_RET( sch, "Null schematic in SCH_SCREENS::ClearAnnotationOfNewSheetPaths" );
  1303. // Clear the annotation for symbols inside new sheetpaths not already in aInitialSheetList
  1304. SCH_SCREENS screensList( sch->Root() ); // The list of screens, shared by sheet paths
  1305. screensList.BuildClientSheetPathList(); // build the shared by sheet paths, by screen
  1306. // Search for new sheet paths, not existing in aInitialSheetPathList
  1307. // and existing in sheetpathList
  1308. for( SCH_SHEET_PATH& sheetpath : sch->Hierarchy() )
  1309. {
  1310. bool path_exists = false;
  1311. for( const SCH_SHEET_PATH& existing_sheetpath: aInitialSheetPathList )
  1312. {
  1313. if( existing_sheetpath.Path() == sheetpath.Path() )
  1314. {
  1315. path_exists = true;
  1316. break;
  1317. }
  1318. }
  1319. if( !path_exists )
  1320. {
  1321. // A new sheet path is found: clear the annotation corresponding to this new path:
  1322. SCH_SCREEN* curr_screen = sheetpath.LastScreen();
  1323. // Clear annotation and create the AR for this path, if not exists,
  1324. // when the screen is shared by sheet paths.
  1325. // Otherwise ClearAnnotation do nothing, because the F1 field is used as
  1326. // reference default value and takes the latest displayed value
  1327. curr_screen->EnsureAlternateReferencesExist();
  1328. curr_screen->ClearAnnotation( &sheetpath, false );
  1329. }
  1330. }
  1331. }
  1332. int SCH_SCREENS::ReplaceDuplicateTimeStamps()
  1333. {
  1334. std::vector<SCH_ITEM*> items;
  1335. int count = 0;
  1336. auto timestamp_cmp = []( const EDA_ITEM* a, const EDA_ITEM* b ) -> bool
  1337. {
  1338. return a->m_Uuid < b->m_Uuid;
  1339. };
  1340. std::set<EDA_ITEM*, decltype( timestamp_cmp )> unique_stamps( timestamp_cmp );
  1341. for( SCH_SCREEN* screen : m_screens )
  1342. screen->GetHierarchicalItems( &items );
  1343. if( items.size() < 2 )
  1344. return 0;
  1345. for( EDA_ITEM* item : items )
  1346. {
  1347. if( !unique_stamps.insert( item ).second )
  1348. {
  1349. // Reset to fully random UUID. This may lose reference, but better to be
  1350. // deterministic about it rather than to have duplicate UUIDs with random
  1351. // side-effects.
  1352. const_cast<KIID&>( item->m_Uuid ) = KIID();
  1353. count++;
  1354. // @todo If the item is a sheet, we need to descend the hierarchy from the sheet
  1355. // and replace all instances of the changed UUID in sheet paths. Otherwise,
  1356. // all instance paths with the sheet's UUID will get clobbered.
  1357. }
  1358. }
  1359. return count;
  1360. }
  1361. void SCH_SCREENS::ClearEditFlags()
  1362. {
  1363. for( SCH_SCREEN* screen = GetFirst(); screen; screen = GetNext() )
  1364. {
  1365. for( SCH_ITEM* item : screen->Items() )
  1366. item->ClearEditFlags();
  1367. }
  1368. }
  1369. void SCH_SCREENS::DeleteMarker( SCH_MARKER* aMarker )
  1370. {
  1371. for( SCH_SCREEN* screen = GetFirst(); screen; screen = GetNext() )
  1372. {
  1373. for( SCH_ITEM* item : screen->Items().OfType( SCH_MARKER_T ) )
  1374. {
  1375. if( item == aMarker )
  1376. {
  1377. screen->DeleteItem( item );
  1378. return;
  1379. }
  1380. }
  1381. }
  1382. }
  1383. void SCH_SCREENS::DeleteMarkers( enum MARKER_BASE::MARKER_T aMarkerType, int aErrorCode,
  1384. bool aIncludeExclusions )
  1385. {
  1386. for( SCH_SCREEN* screen = GetFirst(); screen; screen = GetNext() )
  1387. {
  1388. std::vector<SCH_ITEM*> markers;
  1389. for( SCH_ITEM* item : screen->Items().OfType( SCH_MARKER_T ) )
  1390. {
  1391. SCH_MARKER* marker = static_cast<SCH_MARKER*>( item );
  1392. std::shared_ptr<RC_ITEM>rcItem = marker->GetRCItem();
  1393. if( marker->GetMarkerType() == aMarkerType
  1394. && ( aErrorCode == ERCE_UNSPECIFIED || rcItem->GetErrorCode() == aErrorCode )
  1395. && ( !marker->IsExcluded() || aIncludeExclusions ) )
  1396. {
  1397. markers.push_back( item );
  1398. }
  1399. }
  1400. for( SCH_ITEM* marker : markers )
  1401. screen->DeleteItem( marker );
  1402. }
  1403. }
  1404. void SCH_SCREENS::DeleteAllMarkers( enum MARKER_BASE::MARKER_T aMarkerType,
  1405. bool aIncludeExclusions )
  1406. {
  1407. DeleteMarkers( aMarkerType, ERCE_UNSPECIFIED, aIncludeExclusions );
  1408. }
  1409. void SCH_SCREENS::UpdateSymbolLinks( REPORTER* aReporter )
  1410. {
  1411. for( SCH_SCREEN* screen = GetFirst(); screen; screen = GetNext() )
  1412. screen->UpdateSymbolLinks( aReporter );
  1413. SCH_SCREEN* first = GetFirst();
  1414. if( !first )
  1415. return;
  1416. SCHEMATIC* sch = first->Schematic();
  1417. wxCHECK_RET( sch, "Null schematic in SCH_SCREENS::UpdateSymbolLinks" );
  1418. SCH_SHEET_LIST sheets = sch->Hierarchy();
  1419. // All of the library symbols have been replaced with copies so the connection graph
  1420. // pointers are stale.
  1421. if( sch->ConnectionGraph() )
  1422. sch->ConnectionGraph()->Recalculate( sheets, true );
  1423. }
  1424. bool SCH_SCREENS::HasNoFullyDefinedLibIds()
  1425. {
  1426. bool has_symbols = false;
  1427. for( SCH_SCREEN* screen = GetFirst(); screen; screen = GetNext() )
  1428. {
  1429. for( SCH_ITEM* item : screen->Items().OfType( SCH_SYMBOL_T ) )
  1430. {
  1431. SCH_SYMBOL* symbol = static_cast<SCH_SYMBOL*>( item );
  1432. has_symbols = true;
  1433. if( !symbol->GetLibId().GetLibNickname().empty() )
  1434. return false;
  1435. }
  1436. }
  1437. // return true (i.e. has no fully defined symbol) only if at least one symbol is found
  1438. return has_symbols ? true : false;
  1439. }
  1440. size_t SCH_SCREENS::GetLibNicknames( wxArrayString& aLibNicknames )
  1441. {
  1442. for( SCH_SCREEN* screen = GetFirst(); screen; screen = GetNext() )
  1443. {
  1444. for( SCH_ITEM* item : screen->Items().OfType( SCH_SYMBOL_T ) )
  1445. {
  1446. SCH_SYMBOL* symbol = static_cast<SCH_SYMBOL*>( item );
  1447. const UTF8& nickname = symbol->GetLibId().GetLibNickname();
  1448. if( !nickname.empty() && ( aLibNicknames.Index( nickname ) == wxNOT_FOUND ) )
  1449. aLibNicknames.Add( nickname );
  1450. }
  1451. }
  1452. return aLibNicknames.GetCount();
  1453. }
  1454. int SCH_SCREENS::ChangeSymbolLibNickname( const wxString& aFrom, const wxString& aTo )
  1455. {
  1456. SCH_SCREEN* screen;
  1457. int cnt = 0;
  1458. for( screen = GetFirst(); screen; screen = GetNext() )
  1459. {
  1460. for( SCH_ITEM* item : screen->Items().OfType( SCH_SYMBOL_T ) )
  1461. {
  1462. SCH_SYMBOL* symbol = static_cast<SCH_SYMBOL*>( item );
  1463. if( symbol->GetLibId().GetLibNickname().wx_str() != aFrom )
  1464. continue;
  1465. LIB_ID id = symbol->GetLibId();
  1466. id.SetLibNickname( aTo );
  1467. symbol->SetLibId( id );
  1468. cnt++;
  1469. }
  1470. }
  1471. return cnt;
  1472. }
  1473. bool SCH_SCREENS::HasSchematic( const wxString& aSchematicFileName )
  1474. {
  1475. for( const SCH_SCREEN* screen = GetFirst(); screen; screen = GetNext() )
  1476. {
  1477. if( screen->GetFileName() == aSchematicFileName )
  1478. return true;
  1479. }
  1480. return false;
  1481. }
  1482. void SCH_SCREENS::BuildClientSheetPathList()
  1483. {
  1484. SCH_SCREEN* first = GetFirst();
  1485. if( !first )
  1486. return;
  1487. SCHEMATIC* sch = first->Schematic();
  1488. wxCHECK_RET( sch, "Null schematic in SCH_SCREENS::BuildClientSheetPathList" );
  1489. for( SCH_SCREEN* curr_screen = GetFirst(); curr_screen; curr_screen = GetNext() )
  1490. curr_screen->GetClientSheetPaths().clear();
  1491. for( SCH_SHEET_PATH& sheetpath : sch->Hierarchy() )
  1492. {
  1493. SCH_SCREEN* used_screen = sheetpath.LastScreen();
  1494. // Search for the used_screen in list and add this unique sheet path:
  1495. for( SCH_SCREEN* curr_screen = GetFirst(); curr_screen; curr_screen = GetNext() )
  1496. {
  1497. if( used_screen == curr_screen )
  1498. {
  1499. curr_screen->GetClientSheetPaths().push_back( sheetpath );
  1500. break;
  1501. }
  1502. }
  1503. }
  1504. }
  1505. void SCH_SCREENS::SetLegacySymbolInstanceData()
  1506. {
  1507. for( SCH_SCREEN* screen = GetFirst(); screen; screen = GetNext() )
  1508. screen->SetLegacySymbolInstanceData();
  1509. }
  1510. void SCH_SCREENS::FixLegacyPowerSymbolMismatches()
  1511. {
  1512. for( SCH_SCREEN* screen = GetFirst(); screen; screen = GetNext() )
  1513. screen->FixLegacyPowerSymbolMismatches();
  1514. }
  1515. void SCH_SCREEN::MigrateSimModels()
  1516. {
  1517. LOCALE_IO toggle;
  1518. // V6 schematics may specify model names in Value fields, which we don't do in V7.
  1519. // Migrate by adding an equivalent model for these symbols.
  1520. for( SCH_ITEM* item : Items().OfType( SCH_SYMBOL_T ) )
  1521. {
  1522. SCH_SYMBOL* symbol = static_cast<SCH_SYMBOL*>( item );
  1523. SIM_MODEL::MigrateSimModel<SCH_SYMBOL>( *symbol, &Schematic()->Prj() );
  1524. }
  1525. }
  1526. void SCH_SCREENS::PruneOrphanedSymbolInstances( const wxString& aProjectName,
  1527. const SCH_SHEET_LIST& aValidSheetPaths )
  1528. {
  1529. if( aProjectName.IsEmpty() )
  1530. return;
  1531. for( SCH_SCREEN* screen = GetFirst(); screen; screen = GetNext() )
  1532. screen->PruneOrphanedSymbolInstances( aProjectName, aValidSheetPaths );
  1533. }
  1534. void SCH_SCREENS::PruneOrphanedSheetInstances( const wxString& aProjectName,
  1535. const SCH_SHEET_LIST& aValidSheetPaths )
  1536. {
  1537. if( aProjectName.IsEmpty() )
  1538. return;
  1539. for( SCH_SCREEN* screen = GetFirst(); screen; screen = GetNext() )
  1540. screen->PruneOrphanedSheetInstances( aProjectName, aValidSheetPaths );
  1541. }
  1542. bool SCH_SCREENS::HasSymbolFieldNamesWithWhiteSpace() const
  1543. {
  1544. for( const SCH_SCREEN* screen : m_screens )
  1545. {
  1546. if( screen->HasSymbolFieldNamesWithWhiteSpace() )
  1547. return true;
  1548. }
  1549. return false;
  1550. }