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.

2043 lines
61 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
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
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
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
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
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
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
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 (C) 1992-2022 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 <wx/filefn.h>
  27. #include <eda_item.h>
  28. #include <id.h>
  29. #include <string_utils.h>
  30. #include <kiway.h>
  31. #include <plotters/plotter.h>
  32. #include <project.h>
  33. #include <reporter.h>
  34. #include <sch_draw_panel.h>
  35. #include <sch_edit_frame.h>
  36. #include <sch_item.h>
  37. #include <symbol_library.h>
  38. #include <connection_graph.h>
  39. #include <lib_item.h>
  40. #include <lib_pin.h>
  41. #include <lib_shape.h>
  42. #include <sch_symbol.h>
  43. #include <sch_junction.h>
  44. #include <sch_line.h>
  45. #include <sch_marker.h>
  46. #include <sch_sheet.h>
  47. #include <sch_sheet_pin.h>
  48. #include <sch_text.h>
  49. #include <schematic.h>
  50. #include <symbol_lib_table.h>
  51. #include <tool/common_tools.h>
  52. #include <sim/sim_model.h> // For V6 to V7 simulation model migration.
  53. #include <sim/sim_value.h> //
  54. #include <locale_io.h>
  55. #include <algorithm>
  56. // TODO(JE) Debugging only
  57. #include <profile.h>
  58. #include "sch_bus_entry.h"
  59. #include "sim/sim_model_ideal.h"
  60. SCH_SCREEN::SCH_SCREEN( EDA_ITEM* aParent ) :
  61. BASE_SCREEN( aParent, SCH_SCREEN_T ),
  62. m_fileFormatVersionAtLoad( 0 ),
  63. m_paper( wxT( "A4" ) ),
  64. m_isReadOnly( false ),
  65. m_fileExists( false )
  66. {
  67. m_modification_sync = 0;
  68. m_refCount = 0;
  69. m_zoomInitialized = false;
  70. m_LastZoomLevel = 1.0;
  71. // Suitable for schematic only. For symbol_editor and viewlib, must be set to true
  72. m_Center = false;
  73. InitDataPoints( m_paper.GetSizeIU( schIUScale.IU_PER_MILS ) );
  74. }
  75. SCH_SCREEN::~SCH_SCREEN()
  76. {
  77. clearLibSymbols();
  78. FreeDrawList();
  79. }
  80. SCHEMATIC* SCH_SCREEN::Schematic() const
  81. {
  82. wxCHECK_MSG( GetParent() && GetParent()->Type() == SCHEMATIC_T, nullptr,
  83. wxT( "SCH_SCREEN must have a SCHEMATIC parent!" ) );
  84. return static_cast<SCHEMATIC*>( GetParent() );
  85. }
  86. void SCH_SCREEN::clearLibSymbols()
  87. {
  88. for( const std::pair<const wxString, LIB_SYMBOL*>& libSymbol : m_libSymbols )
  89. delete libSymbol.second;
  90. m_libSymbols.clear();
  91. }
  92. void SCH_SCREEN::SetFileName( const wxString& aFileName )
  93. {
  94. wxASSERT( aFileName.IsEmpty() || wxIsAbsolutePath( aFileName ) );
  95. m_fileName = aFileName;
  96. }
  97. void SCH_SCREEN::IncRefCount()
  98. {
  99. m_refCount++;
  100. }
  101. void SCH_SCREEN::DecRefCount()
  102. {
  103. wxCHECK_RET( m_refCount != 0, wxT( "Screen reference count already zero. Bad programmer!" ) );
  104. m_refCount--;
  105. }
  106. bool SCH_SCREEN::HasItems( KICAD_T aItemType ) const
  107. {
  108. EE_RTREE::EE_TYPE sheets = m_rtree.OfType( aItemType );
  109. return sheets.begin() != sheets.end();
  110. }
  111. bool SCH_SCREEN::ClassOf( const EDA_ITEM* aItem )
  112. {
  113. return aItem && SCH_SCREEN_T == aItem->Type();
  114. }
  115. void SCH_SCREEN::Append( SCH_ITEM* aItem )
  116. {
  117. if( aItem->Type() != SCH_SHEET_PIN_T && aItem->Type() != SCH_FIELD_T )
  118. {
  119. // Ensure the item can reach the SCHEMATIC through this screen
  120. aItem->SetParent( this );
  121. if( aItem->Type() == SCH_SYMBOL_T )
  122. {
  123. SCH_SYMBOL* symbol = static_cast<SCH_SYMBOL*>( aItem );
  124. if( symbol->GetLibSymbolRef() )
  125. {
  126. symbol->GetLibSymbolRef()->GetDrawItems().sort();
  127. auto it = m_libSymbols.find( symbol->GetSchSymbolLibraryName() );
  128. if( it == m_libSymbols.end() || !it->second )
  129. {
  130. m_libSymbols[symbol->GetSchSymbolLibraryName()] =
  131. new LIB_SYMBOL( *symbol->GetLibSymbolRef() );
  132. }
  133. else
  134. {
  135. // The original library symbol may have changed since the last time
  136. // it was added to the schematic. If it has changed, then a new name
  137. // must be created for the library symbol list to prevent all of the
  138. // other schematic symbols referencing that library symbol from changing.
  139. LIB_SYMBOL* foundSymbol = it->second;
  140. foundSymbol->GetDrawItems().sort();
  141. if( *foundSymbol != *symbol->GetLibSymbolRef() )
  142. {
  143. int cnt = 1;
  144. wxString newName;
  145. newName.Printf( "%s_%d", symbol->GetLibId().GetUniStringLibItemName(),
  146. cnt );
  147. while( m_libSymbols.find( newName ) != m_libSymbols.end() )
  148. {
  149. cnt += 1;
  150. newName.Printf( "%s_%d", symbol->GetLibId().GetUniStringLibItemName(),
  151. cnt );
  152. }
  153. // Update the schematic symbol library link as this symbol only exists
  154. // in the schematic.
  155. symbol->SetSchSymbolLibraryName( newName );
  156. LIB_SYMBOL* newLibSymbol = new LIB_SYMBOL( *symbol->GetLibSymbolRef() );
  157. LIB_ID newLibId( wxEmptyString, newName );
  158. newLibSymbol->SetLibId( newLibId );
  159. newLibSymbol->SetName( newName );
  160. symbol->SetLibSymbol( newLibSymbol->Flatten().release() );
  161. m_libSymbols[newName] = newLibSymbol;
  162. }
  163. }
  164. }
  165. }
  166. m_rtree.insert( aItem );
  167. --m_modification_sync;
  168. }
  169. }
  170. void SCH_SCREEN::Append( SCH_SCREEN* aScreen )
  171. {
  172. wxCHECK_RET( aScreen, "Invalid screen object." );
  173. // No need to descend the hierarchy. Once the top level screen is copied, all of its
  174. // children are copied as well.
  175. for( SCH_ITEM* aItem : aScreen->m_rtree )
  176. Append( aItem );
  177. aScreen->Clear( false );
  178. }
  179. void SCH_SCREEN::Clear( bool aFree )
  180. {
  181. if( aFree )
  182. {
  183. FreeDrawList();
  184. clearLibSymbols();
  185. }
  186. else
  187. {
  188. m_rtree.clear();
  189. }
  190. // Clear the project settings
  191. m_virtualPageNumber = m_pageCount = 1;
  192. m_titles.Clear();
  193. }
  194. void SCH_SCREEN::FreeDrawList()
  195. {
  196. // We don't know which order we will encounter dependent items (e.g. pins or fields), so
  197. // we store the items to be deleted until we've fully cleared the tree before deleting
  198. std::vector<SCH_ITEM*> delete_list;
  199. std::copy_if( m_rtree.begin(), m_rtree.end(), std::back_inserter( delete_list ),
  200. []( SCH_ITEM* aItem )
  201. {
  202. return ( aItem->Type() != SCH_SHEET_PIN_T && aItem->Type() != SCH_FIELD_T );
  203. } );
  204. m_rtree.clear();
  205. for( SCH_ITEM* item : delete_list )
  206. delete item;
  207. }
  208. void SCH_SCREEN::Update( SCH_ITEM* aItem )
  209. {
  210. if( Remove( aItem ) )
  211. Append( aItem );
  212. }
  213. bool SCH_SCREEN::Remove( SCH_ITEM* aItem )
  214. {
  215. bool retv = m_rtree.remove( aItem );
  216. // Check if the library symbol for the removed schematic symbol is still required.
  217. if( retv && aItem->Type() == SCH_SYMBOL_T )
  218. {
  219. SCH_SYMBOL* removedSymbol = static_cast<SCH_SYMBOL*>( aItem );
  220. bool removeUnusedLibSymbol = true;
  221. for( SCH_ITEM* item : Items().OfType( SCH_SYMBOL_T ) )
  222. {
  223. SCH_SYMBOL* symbol = static_cast<SCH_SYMBOL*>( item );
  224. if( removedSymbol->GetSchSymbolLibraryName() == symbol->GetSchSymbolLibraryName() )
  225. {
  226. removeUnusedLibSymbol = false;
  227. break;
  228. }
  229. }
  230. if( removeUnusedLibSymbol )
  231. {
  232. auto it = m_libSymbols.find( removedSymbol->GetSchSymbolLibraryName() );
  233. if( it != m_libSymbols.end() )
  234. {
  235. delete it->second;
  236. m_libSymbols.erase( it );
  237. }
  238. }
  239. }
  240. return retv;
  241. }
  242. void SCH_SCREEN::DeleteItem( SCH_ITEM* aItem )
  243. {
  244. wxCHECK_RET( aItem, wxT( "Cannot delete invalid item from screen." ) );
  245. // Markers are not saved in the file, no need to flag as modified.
  246. // TODO: Maybe we should have a listing somewhere of items that aren't saved?
  247. if( aItem->Type() != SCH_MARKER_T )
  248. SetContentModified();
  249. Remove( aItem );
  250. if( aItem->Type() == SCH_SHEET_PIN_T )
  251. {
  252. // This structure is attached to a sheet, get the parent sheet object.
  253. SCH_SHEET_PIN* sheetPin = (SCH_SHEET_PIN*) aItem;
  254. SCH_SHEET* sheet = sheetPin->GetParent();
  255. wxCHECK_RET( sheet, wxT( "Sheet pin parent not properly set, bad programmer!" ) );
  256. sheet->RemovePin( sheetPin );
  257. return;
  258. }
  259. delete aItem;
  260. }
  261. bool SCH_SCREEN::CheckIfOnDrawList( const SCH_ITEM* aItem ) const
  262. {
  263. return m_rtree.contains( aItem, true );
  264. }
  265. SCH_ITEM* SCH_SCREEN::GetItem( const VECTOR2I& aPosition, int aAccuracy, KICAD_T aType ) const
  266. {
  267. BOX2I bbox;
  268. bbox.SetOrigin( aPosition );
  269. bbox.Inflate( aAccuracy );
  270. for( SCH_ITEM* item : Items().Overlapping( aType, bbox ) )
  271. {
  272. if( item->HitTest( aPosition, aAccuracy ) )
  273. return item;
  274. }
  275. return nullptr;
  276. }
  277. std::set<SCH_ITEM*> SCH_SCREEN::MarkConnections( SCH_LINE* aSegment, bool aSecondPass )
  278. {
  279. #define PROCESSED CANDIDATE // Don't use SKIP_STRUCT; IsConnected() returns false if it's set.
  280. std::set<SCH_ITEM*> retval;
  281. std::stack<SCH_LINE*> to_search;
  282. wxCHECK_MSG( aSegment && aSegment->Type() == SCH_LINE_T, retval, wxT( "Invalid pointer." ) );
  283. to_search.push( aSegment );
  284. while( !to_search.empty() )
  285. {
  286. SCH_ITEM* item = to_search.top();
  287. to_search.pop();
  288. if( item->HasFlag( PROCESSED ) )
  289. continue;
  290. item->SetFlags( PROCESSED );
  291. for( SCH_ITEM* candidate : Items().Overlapping( SCH_LINE_T, item->GetBoundingBox() ) )
  292. {
  293. SCH_LINE* line = static_cast<SCH_LINE*>( candidate );
  294. if( line->HasFlag( PROCESSED ) )
  295. continue;
  296. // Skip connecting lines on different layers (e.g. buses)
  297. if( item->GetLayer() != line->GetLayer() )
  298. continue;
  299. for( VECTOR2I pt : { line->GetStartPoint(), line->GetEndPoint() } )
  300. {
  301. if( item->IsConnected( pt ) )
  302. {
  303. SCH_ITEM* junction = GetItem( pt, 0, SCH_JUNCTION_T );
  304. SCH_ITEM* pin = GetItem( pt, 0, SCH_PIN_T );
  305. if( item->IsSelected() && aSecondPass )
  306. {
  307. if( junction )
  308. retval.insert( junction );
  309. retval.insert( line );
  310. to_search.push( line );
  311. }
  312. else if( !junction && !pin )
  313. {
  314. retval.insert( line );
  315. to_search.push( line );
  316. }
  317. break;
  318. }
  319. }
  320. }
  321. }
  322. for( SCH_ITEM* item : Items() )
  323. item->ClearTempFlags();
  324. return retval;
  325. }
  326. bool SCH_SCREEN::IsJunction( const VECTOR2I& aPosition ) const
  327. {
  328. bool hasExplicitJunction;
  329. bool hasBusEntry;
  330. bool isJunction = doIsJunction( aPosition, false, &hasExplicitJunction, &hasBusEntry );
  331. return isJunction;
  332. }
  333. bool SCH_SCREEN::IsExplicitJunction( const VECTOR2I& aPosition ) const
  334. {
  335. bool hasExplicitJunction;
  336. bool hasBusEntry;
  337. bool isJunction = doIsJunction( aPosition, false, &hasExplicitJunction, &hasBusEntry );
  338. return isJunction && !hasBusEntry;
  339. }
  340. bool SCH_SCREEN::IsExplicitJunctionNeeded( const VECTOR2I& aPosition ) const
  341. {
  342. bool hasExplicitJunction;
  343. bool hasBusEntry;
  344. bool isJunction = doIsJunction( aPosition, false, &hasExplicitJunction, &hasBusEntry );
  345. return isJunction && !hasBusEntry && !hasExplicitJunction;
  346. }
  347. TEXT_SPIN_STYLE SCH_SCREEN::GetLabelOrientationForPoint( const VECTOR2I& aPosition,
  348. TEXT_SPIN_STYLE aDefaultOrientation,
  349. const SCH_SHEET_PATH* aSheet ) const
  350. {
  351. auto ret = aDefaultOrientation;
  352. for( SCH_ITEM* item : Items().Overlapping( aPosition ) )
  353. {
  354. if( item->GetEditFlags() & STRUCT_DELETED )
  355. continue;
  356. switch( item->Type() )
  357. {
  358. case SCH_BUS_WIRE_ENTRY_T:
  359. {
  360. auto busEntry = static_cast<const SCH_BUS_WIRE_ENTRY*>( item );
  361. if( busEntry->m_connected_bus_item )
  362. {
  363. // bus connected, take the bus direction into consideration ony if it is
  364. // vertical or horizontal
  365. auto bus = static_cast<const SCH_LINE*>( busEntry->m_connected_bus_item );
  366. if( bus->Angle().AsDegrees() == 90.0 )
  367. {
  368. // bus is vertical -> label shall be horizontal and
  369. // shall be placed to the side where the bus entry is
  370. if( aPosition.x < bus->GetPosition().x )
  371. ret = TEXT_SPIN_STYLE::LEFT;
  372. else if( aPosition.x > bus->GetPosition().x )
  373. ret = TEXT_SPIN_STYLE::RIGHT;
  374. }
  375. else if( bus->Angle().AsDegrees() == 0.0 )
  376. {
  377. // bus is horizontal -> label shall be vertical and
  378. // shall be placed to the side where the bus entry is
  379. if( aPosition.y < bus->GetPosition().y )
  380. ret = TEXT_SPIN_STYLE::UP;
  381. else if( aPosition.y > bus->GetPosition().y )
  382. ret = TEXT_SPIN_STYLE::BOTTOM;
  383. }
  384. }
  385. }
  386. break;
  387. case SCH_LINE_T:
  388. {
  389. auto line = static_cast<const SCH_LINE*>( item );
  390. // line angles goes between -90 and 90 degrees, but normalize
  391. auto angle = line->Angle().Normalize90().AsDegrees();
  392. if( -45 < angle && angle <= 45 )
  393. {
  394. if( line->GetStartPoint().x <= line->GetEndPoint().x )
  395. {
  396. ret = line->GetEndPoint() == aPosition ? TEXT_SPIN_STYLE::RIGHT
  397. : TEXT_SPIN_STYLE::LEFT;
  398. }
  399. else
  400. {
  401. ret = line->GetEndPoint() == aPosition ? TEXT_SPIN_STYLE::LEFT
  402. : TEXT_SPIN_STYLE::RIGHT;
  403. }
  404. }
  405. else
  406. {
  407. if( line->GetStartPoint().y <= line->GetEndPoint().y )
  408. {
  409. ret = line->GetEndPoint() == aPosition ? TEXT_SPIN_STYLE::BOTTOM
  410. : TEXT_SPIN_STYLE::UP;
  411. }
  412. else
  413. {
  414. ret = line->GetEndPoint() == aPosition ? TEXT_SPIN_STYLE::UP
  415. : TEXT_SPIN_STYLE::BOTTOM;
  416. }
  417. }
  418. }
  419. break;
  420. case SCH_SYMBOL_T:
  421. {
  422. SCH_SYMBOL* symbol = static_cast<SCH_SYMBOL*>( item );
  423. for( SCH_PIN* pin : symbol->GetPins( aSheet ) )
  424. {
  425. if( pin->GetPosition() == aPosition )
  426. {
  427. if( pin->GetOrientation() == PIN_RIGHT )
  428. {
  429. ret = TEXT_SPIN_STYLE::LEFT;
  430. }
  431. else if( pin->GetOrientation() == PIN_LEFT )
  432. {
  433. ret = TEXT_SPIN_STYLE::RIGHT;
  434. }
  435. else if( pin->GetOrientation() == PIN_UP )
  436. {
  437. ret = TEXT_SPIN_STYLE::BOTTOM;
  438. }
  439. else if( pin->GetOrientation() == PIN_DOWN )
  440. {
  441. ret = TEXT_SPIN_STYLE::UP;
  442. }
  443. switch( static_cast<SYMBOL_ORIENTATION_T>(
  444. symbol->GetOrientation() & ( ~( SYM_MIRROR_X | SYM_MIRROR_Y ) ) ) )
  445. {
  446. case SYM_ROTATE_CLOCKWISE:
  447. case SYM_ORIENT_90:
  448. if( ret == TEXT_SPIN_STYLE::UP )
  449. ret = TEXT_SPIN_STYLE::LEFT;
  450. else if( ret == TEXT_SPIN_STYLE::BOTTOM )
  451. ret = TEXT_SPIN_STYLE::RIGHT;
  452. else if( ret == TEXT_SPIN_STYLE::LEFT )
  453. ret = TEXT_SPIN_STYLE::BOTTOM;
  454. else if( ret == TEXT_SPIN_STYLE::RIGHT )
  455. ret = TEXT_SPIN_STYLE::UP;
  456. if( symbol->GetOrientation() & SYM_MIRROR_X )
  457. {
  458. if( ret == TEXT_SPIN_STYLE::UP )
  459. ret = TEXT_SPIN_STYLE::BOTTOM;
  460. else if( ret == TEXT_SPIN_STYLE::BOTTOM )
  461. ret = TEXT_SPIN_STYLE::UP;
  462. }
  463. if( symbol->GetOrientation() & SYM_MIRROR_Y )
  464. {
  465. if( ret == TEXT_SPIN_STYLE::LEFT )
  466. ret = TEXT_SPIN_STYLE::RIGHT;
  467. else if( ret == TEXT_SPIN_STYLE::RIGHT )
  468. ret = TEXT_SPIN_STYLE::LEFT;
  469. }
  470. break;
  471. case SYM_ROTATE_COUNTERCLOCKWISE:
  472. case SYM_ORIENT_270:
  473. if( ret == TEXT_SPIN_STYLE::UP )
  474. ret = TEXT_SPIN_STYLE::RIGHT;
  475. else if( ret == TEXT_SPIN_STYLE::BOTTOM )
  476. ret = TEXT_SPIN_STYLE::LEFT;
  477. else if( ret == TEXT_SPIN_STYLE::LEFT )
  478. ret = TEXT_SPIN_STYLE::UP;
  479. else if( ret == TEXT_SPIN_STYLE::RIGHT )
  480. ret = TEXT_SPIN_STYLE::BOTTOM;
  481. if( symbol->GetOrientation() & SYM_MIRROR_X )
  482. {
  483. if( ret == TEXT_SPIN_STYLE::UP )
  484. ret = TEXT_SPIN_STYLE::BOTTOM;
  485. else if( ret == TEXT_SPIN_STYLE::BOTTOM )
  486. ret = TEXT_SPIN_STYLE::UP;
  487. }
  488. if( symbol->GetOrientation() & SYM_MIRROR_Y )
  489. {
  490. if( ret == TEXT_SPIN_STYLE::LEFT )
  491. ret = TEXT_SPIN_STYLE::RIGHT;
  492. else if( ret == TEXT_SPIN_STYLE::RIGHT )
  493. ret = TEXT_SPIN_STYLE::LEFT;
  494. }
  495. break;
  496. case SYM_ORIENT_180:
  497. if( ret == TEXT_SPIN_STYLE::UP )
  498. ret = TEXT_SPIN_STYLE::BOTTOM;
  499. else if( ret == TEXT_SPIN_STYLE::BOTTOM )
  500. ret = TEXT_SPIN_STYLE::UP;
  501. else if( ret == TEXT_SPIN_STYLE::LEFT )
  502. ret = TEXT_SPIN_STYLE::RIGHT;
  503. else if( ret == TEXT_SPIN_STYLE::RIGHT )
  504. ret = TEXT_SPIN_STYLE::LEFT;
  505. if( symbol->GetOrientation() & SYM_MIRROR_X )
  506. {
  507. if( ret == TEXT_SPIN_STYLE::UP )
  508. ret = TEXT_SPIN_STYLE::BOTTOM;
  509. else if( ret == TEXT_SPIN_STYLE::BOTTOM )
  510. ret = TEXT_SPIN_STYLE::UP;
  511. }
  512. if( symbol->GetOrientation() & SYM_MIRROR_Y )
  513. {
  514. if( ret == TEXT_SPIN_STYLE::LEFT )
  515. ret = TEXT_SPIN_STYLE::RIGHT;
  516. else if( ret == TEXT_SPIN_STYLE::RIGHT )
  517. ret = TEXT_SPIN_STYLE::LEFT;
  518. }
  519. break;
  520. case SYM_ORIENT_0:
  521. case SYM_NORMAL:
  522. default:
  523. if( symbol->GetOrientation() & SYM_MIRROR_X )
  524. {
  525. if( ret == TEXT_SPIN_STYLE::UP )
  526. ret = TEXT_SPIN_STYLE::BOTTOM;
  527. else if( ret == TEXT_SPIN_STYLE::BOTTOM )
  528. ret = TEXT_SPIN_STYLE::UP;
  529. }
  530. if( symbol->GetOrientation() & SYM_MIRROR_Y )
  531. {
  532. if( ret == TEXT_SPIN_STYLE::LEFT )
  533. ret = TEXT_SPIN_STYLE::RIGHT;
  534. else if( ret == TEXT_SPIN_STYLE::RIGHT )
  535. ret = TEXT_SPIN_STYLE::LEFT;
  536. }
  537. break;
  538. }
  539. break;
  540. }
  541. }
  542. }
  543. break;
  544. default: break;
  545. }
  546. }
  547. return ret;
  548. }
  549. bool SCH_SCREEN::IsExplicitJunctionAllowed( const VECTOR2I& aPosition ) const
  550. {
  551. bool hasExplicitJunction;
  552. bool hasBusEntry;
  553. bool isJunction = doIsJunction( aPosition, true, &hasExplicitJunction, &hasBusEntry );
  554. return isJunction && !hasBusEntry;
  555. }
  556. bool SCH_SCREEN::doIsJunction( const VECTOR2I& aPosition, bool aBreakCrossings,
  557. bool* aHasExplicitJunctionDot, bool* aHasBusEntry ) const
  558. {
  559. enum layers { WIRES = 0, BUSES };
  560. *aHasExplicitJunctionDot = false;
  561. *aHasBusEntry = false;
  562. bool breakLines[ 2 ] = { false };
  563. std::unordered_set<int> exitAngles[ 2 ];
  564. std::vector<const SCH_LINE*> midPointLines[ 2 ];
  565. // A pin at 90° still shouldn't match a line at 90° so just give pins unique numbers
  566. int uniqueAngle = 10000;
  567. for( const SCH_ITEM* item : Items().Overlapping( aPosition ) )
  568. {
  569. if( item->GetEditFlags() & STRUCT_DELETED )
  570. continue;
  571. switch( item->Type() )
  572. {
  573. case SCH_JUNCTION_T:
  574. if( item->HitTest( aPosition, -1 ) )
  575. *aHasExplicitJunctionDot = true;
  576. break;
  577. case SCH_LINE_T:
  578. {
  579. const SCH_LINE* line = static_cast<const SCH_LINE*>( item );
  580. int layer;
  581. if( line->GetStartPoint() == line->GetEndPoint() )
  582. break;
  583. else if( line->GetLayer() == LAYER_WIRE )
  584. layer = WIRES;
  585. else if( line->GetLayer() == LAYER_BUS )
  586. layer = BUSES;
  587. else
  588. break;
  589. if( line->IsConnected( aPosition ) )
  590. {
  591. breakLines[ layer ] = true;
  592. exitAngles[ layer ].insert( line->GetAngleFrom( aPosition ) );
  593. }
  594. else if( line->HitTest( aPosition, -1 ) )
  595. {
  596. if( aBreakCrossings )
  597. breakLines[ layer ] = true;
  598. // Defer any line midpoints until we know whether or not we're breaking them
  599. midPointLines[ layer ].push_back( line );
  600. }
  601. }
  602. break;
  603. case SCH_BUS_WIRE_ENTRY_T:
  604. if( item->IsConnected( aPosition ) )
  605. {
  606. breakLines[ BUSES ] = true;
  607. exitAngles[ BUSES ].insert( uniqueAngle++ );
  608. breakLines[ WIRES ] = true;
  609. exitAngles[ WIRES ].insert( uniqueAngle++ );
  610. *aHasBusEntry = true;
  611. }
  612. break;
  613. case SCH_SYMBOL_T:
  614. case SCH_SHEET_T:
  615. if( item->IsConnected( aPosition ) )
  616. {
  617. breakLines[ WIRES ] = true;
  618. exitAngles[ WIRES ].insert( uniqueAngle++ );
  619. }
  620. break;
  621. default:
  622. break;
  623. }
  624. }
  625. for( int layer : { WIRES, BUSES } )
  626. {
  627. if( breakLines[ layer ] )
  628. {
  629. for( const SCH_LINE* line : midPointLines[ layer ] )
  630. {
  631. exitAngles[ layer ].insert( line->GetAngleFrom( aPosition ) );
  632. exitAngles[ layer ].insert( line->GetReverseAngleFrom( aPosition ) );
  633. }
  634. }
  635. }
  636. return exitAngles[ WIRES ].size() >= 3 || exitAngles[ BUSES ].size() >= 3;
  637. }
  638. bool SCH_SCREEN::IsTerminalPoint( const VECTOR2I& aPosition, int aLayer ) const
  639. {
  640. wxCHECK_MSG( aLayer == LAYER_NOTES || aLayer == LAYER_BUS || aLayer == LAYER_WIRE, false,
  641. wxT( "Invalid layer type passed to SCH_SCREEN::IsTerminalPoint()." ) );
  642. SCH_SHEET_PIN* sheetPin;
  643. SCH_LABEL_BASE* label;
  644. switch( aLayer )
  645. {
  646. case LAYER_BUS:
  647. if( GetBus( aPosition ) )
  648. return true;
  649. sheetPin = GetSheetPin( aPosition );
  650. if( sheetPin && sheetPin->IsConnected( aPosition ) )
  651. return true;
  652. label = GetLabel( aPosition );
  653. if( label && label->IsConnected( aPosition ) )
  654. return true;
  655. break;
  656. case LAYER_NOTES:
  657. if( GetLine( aPosition ) )
  658. return true;
  659. break;
  660. case LAYER_WIRE:
  661. if( GetItem( aPosition, 1, SCH_BUS_WIRE_ENTRY_T) )
  662. return true;
  663. if( GetItem( aPosition, 1, SCH_JUNCTION_T ) )
  664. return true;
  665. if( GetPin( aPosition, nullptr, true ) )
  666. return true;
  667. if( GetWire( aPosition ) )
  668. return true;
  669. label = GetLabel( aPosition, 1 );
  670. if( label && label->IsConnected( aPosition ) )
  671. return true;
  672. sheetPin = GetSheetPin( aPosition );
  673. if( sheetPin && sheetPin->IsConnected( aPosition ) )
  674. return true;
  675. break;
  676. default:
  677. break;
  678. }
  679. return false;
  680. }
  681. void SCH_SCREEN::UpdateSymbolLinks( REPORTER* aReporter )
  682. {
  683. wxCHECK_RET( Schematic(), "Cannot call SCH_SCREEN::UpdateSymbolLinks with no SCHEMATIC" );
  684. wxString msg;
  685. std::unique_ptr< LIB_SYMBOL > libSymbol;
  686. std::vector<SCH_SYMBOL*> symbols;
  687. SYMBOL_LIB_TABLE* libs = Schematic()->Prj().SchSymbolLibTable();
  688. // This will be a nullptr if an s-expression schematic is loaded.
  689. SYMBOL_LIBS* legacyLibs = Schematic()->Prj().SchLibs();
  690. for( SCH_ITEM* item : Items().OfType( SCH_SYMBOL_T ) )
  691. symbols.push_back( static_cast<SCH_SYMBOL*>( item ) );
  692. // Remove them from the R tree. There bounding box size may change.
  693. for( SCH_SYMBOL* symbol : symbols )
  694. Remove( symbol );
  695. // Clear all existing symbol links.
  696. clearLibSymbols();
  697. for( SCH_SYMBOL* symbol : symbols )
  698. {
  699. LIB_SYMBOL* tmp = nullptr;
  700. libSymbol.reset();
  701. // If the symbol is already in the internal library, map the symbol to it.
  702. auto it = m_libSymbols.find( symbol->GetSchSymbolLibraryName() );
  703. if( ( it != m_libSymbols.end() ) )
  704. {
  705. if( aReporter )
  706. {
  707. msg.Printf( _( "Setting schematic symbol '%s %s' library identifier to '%s'." ),
  708. symbol->GetField( REFERENCE_FIELD )->GetText(),
  709. symbol->GetField( VALUE_FIELD )->GetText(),
  710. UnescapeString( symbol->GetLibId().Format() ) );
  711. aReporter->ReportTail( msg, RPT_SEVERITY_INFO );
  712. }
  713. // Internal library symbols are already flattened so just make a copy.
  714. symbol->SetLibSymbol( new LIB_SYMBOL( *it->second ) );
  715. continue;
  716. }
  717. if( !symbol->GetLibId().IsValid() )
  718. {
  719. if( aReporter )
  720. {
  721. msg.Printf( _( "Schematic symbol reference '%s' library identifier is not valid. "
  722. "Unable to link library symbol." ),
  723. UnescapeString( symbol->GetLibId().Format() ) );
  724. aReporter->ReportTail( msg, RPT_SEVERITY_WARNING );
  725. }
  726. continue;
  727. }
  728. // LIB_TABLE_BASE::LoadSymbol() throws an IO_ERROR if the library nickname
  729. // is not found in the table so check if the library still exists in the table
  730. // before attempting to load the symbol.
  731. if( !libs->HasLibrary( symbol->GetLibId().GetLibNickname() ) && !legacyLibs )
  732. {
  733. if( aReporter )
  734. {
  735. msg.Printf( _( "Symbol library '%s' not found and no fallback cache library "
  736. "available. Unable to link library symbol." ),
  737. symbol->GetLibId().GetLibNickname().wx_str() );
  738. aReporter->ReportTail( msg, RPT_SEVERITY_WARNING );
  739. }
  740. continue;
  741. }
  742. if( libs->HasLibrary( symbol->GetLibId().GetLibNickname() ) )
  743. {
  744. try
  745. {
  746. tmp = libs->LoadSymbol( symbol->GetLibId() );
  747. }
  748. catch( const IO_ERROR& ioe )
  749. {
  750. if( aReporter )
  751. {
  752. msg.Printf( _( "I/O error %s resolving library symbol %s" ), ioe.What(),
  753. UnescapeString( symbol->GetLibId().Format() ) );
  754. aReporter->ReportTail( msg, RPT_SEVERITY_ERROR );
  755. }
  756. }
  757. }
  758. if( !tmp && legacyLibs && legacyLibs->GetLibraryCount() )
  759. {
  760. SYMBOL_LIB& legacyCacheLib = legacyLibs->back();
  761. // It better be the cache library.
  762. wxCHECK2( legacyCacheLib.IsCache(), continue );
  763. wxString id = symbol->GetLibId().Format();
  764. id.Replace( ':', '_' );
  765. if( aReporter )
  766. {
  767. msg.Printf( _( "Falling back to cache to set symbol '%s:%s' link '%s'." ),
  768. symbol->GetField( REFERENCE_FIELD )->GetText(),
  769. symbol->GetField( VALUE_FIELD )->GetText(),
  770. UnescapeString( id ) );
  771. aReporter->ReportTail( msg, RPT_SEVERITY_WARNING );
  772. }
  773. tmp = legacyCacheLib.FindSymbol( id );
  774. }
  775. if( tmp )
  776. {
  777. // We want a full symbol not just the top level child symbol.
  778. libSymbol = tmp->Flatten();
  779. libSymbol->SetParent();
  780. m_libSymbols.insert( { symbol->GetSchSymbolLibraryName(),
  781. new LIB_SYMBOL( *libSymbol.get() ) } );
  782. if( aReporter )
  783. {
  784. msg.Printf( _( "Setting schematic symbol '%s %s' library identifier to '%s'." ),
  785. symbol->GetField( REFERENCE_FIELD )->GetText(),
  786. symbol->GetField( VALUE_FIELD )->GetText(),
  787. UnescapeString( symbol->GetLibId().Format() ) );
  788. aReporter->ReportTail( msg, RPT_SEVERITY_INFO );
  789. }
  790. }
  791. else
  792. {
  793. if( aReporter )
  794. {
  795. msg.Printf( _( "No library symbol found for schematic symbol '%s %s'." ),
  796. symbol->GetField( REFERENCE_FIELD )->GetText(),
  797. symbol->GetField( VALUE_FIELD )->GetText() );
  798. aReporter->ReportTail( msg, RPT_SEVERITY_ERROR );
  799. }
  800. }
  801. symbol->SetLibSymbol( libSymbol.release() );
  802. }
  803. // Changing the symbol may adjust the bbox of the symbol. This re-inserts the
  804. // item with the new bbox
  805. for( SCH_SYMBOL* symbol : symbols )
  806. Append( symbol );
  807. }
  808. void SCH_SCREEN::UpdateLocalLibSymbolLinks()
  809. {
  810. std::vector<SCH_SYMBOL*> symbols;
  811. for( SCH_ITEM* item : Items().OfType( SCH_SYMBOL_T ) )
  812. symbols.push_back( static_cast<SCH_SYMBOL*>( item ) );
  813. for( SCH_SYMBOL* symbol : symbols )
  814. {
  815. // Changing the symbol may adjust the bbox of the symbol; remove and reinsert it afterwards.
  816. m_rtree.remove( symbol );
  817. auto it = m_libSymbols.find( symbol->GetSchSymbolLibraryName() );
  818. LIB_SYMBOL* libSymbol = nullptr;
  819. if( it != m_libSymbols.end() )
  820. libSymbol = new LIB_SYMBOL( *it->second );
  821. symbol->SetLibSymbol( libSymbol );
  822. m_rtree.insert( symbol );
  823. }
  824. }
  825. void SCH_SCREEN::SetConnectivityDirty()
  826. {
  827. for( SCH_ITEM* item : Items() )
  828. item->SetConnectivityDirty( true );
  829. }
  830. void SCH_SCREEN::Print( const RENDER_SETTINGS* aSettings )
  831. {
  832. // Ensure links are up to date, even if a library was reloaded for some reason:
  833. std::vector<SCH_ITEM*> junctions;
  834. std::vector<SCH_ITEM*> bitmaps;
  835. std::vector<SCH_ITEM*> other;
  836. for( SCH_ITEM* item : Items() )
  837. {
  838. if( item->IsMoving() || item->IsResized() )
  839. continue;
  840. if( item->Type() == SCH_JUNCTION_T )
  841. junctions.push_back( item );
  842. else if( item->Type() == SCH_BITMAP_T )
  843. bitmaps.push_back( item );
  844. else
  845. other.push_back( item );
  846. }
  847. /// Sort to ensure plot-order consistency with screen drawing
  848. std::stable_sort( other.begin(), other.end(),
  849. []( const SCH_ITEM* a, const SCH_ITEM* b )
  850. {
  851. if( a->Type() == b->Type() )
  852. return a->GetLayer() > b->GetLayer();
  853. return a->Type() < b->Type();
  854. } );
  855. for( SCH_ITEM* item : bitmaps )
  856. item->Print( aSettings, VECTOR2I( 0, 0 ) );
  857. for( SCH_ITEM* item : other )
  858. item->PrintBackground( aSettings, VECTOR2I( 0, 0 ) );
  859. for( SCH_ITEM* item : other )
  860. item->Print( aSettings, VECTOR2I( 0, 0 ) );
  861. for( SCH_ITEM* item : junctions )
  862. item->Print( aSettings, VECTOR2I( 0, 0 ) );
  863. }
  864. void SCH_SCREEN::Plot( PLOTTER* aPlotter ) const
  865. {
  866. // Ensure links are up to date, even if a library was reloaded for some reason:
  867. std::vector<SCH_ITEM*> junctions;
  868. std::vector<SCH_ITEM*> bitmaps;
  869. std::vector<SCH_SYMBOL*> symbols;
  870. std::vector<SCH_ITEM*> other;
  871. for( SCH_ITEM* item : Items() )
  872. {
  873. if( item->IsMoving() || item->IsResized() )
  874. continue;
  875. if( item->Type() == SCH_JUNCTION_T )
  876. junctions.push_back( item );
  877. else if( item->Type() == SCH_BITMAP_T )
  878. bitmaps.push_back( item );
  879. else
  880. other.push_back( item );
  881. // Where the symbols overlap each other, we need to plot the text items a second
  882. // time to get them on top of the overlapping element. This collection is in addition
  883. // to the symbols already collected in `other`
  884. if( item->Type() == SCH_SYMBOL_T )
  885. {
  886. for( SCH_ITEM* sym : m_rtree.Overlapping( SCH_SYMBOL_T, item->GetBoundingBox() ) )
  887. {
  888. if( sym != item )
  889. {
  890. symbols.push_back( static_cast<SCH_SYMBOL*>( item ) );
  891. break;
  892. }
  893. }
  894. }
  895. }
  896. /// Sort to ensure plot-order consistency with screen drawing
  897. std::sort( other.begin(), other.end(),
  898. []( const SCH_ITEM* a, const SCH_ITEM* b )
  899. {
  900. if( a->Type() == b->Type() )
  901. return a->GetLayer() > b->GetLayer();
  902. return a->Type() > b->Type();
  903. } );
  904. int defaultPenWidth = aPlotter->RenderSettings()->GetDefaultPenWidth();
  905. constexpr bool background = true;
  906. // Bitmaps are drawn first to ensure they are in the background
  907. // This is particularly important for the wxPostscriptDC (used in *nix printers) as
  908. // the bitmap PS command clears the screen
  909. for( const SCH_ITEM* item : bitmaps )
  910. {
  911. aPlotter->SetCurrentLineWidth( std::max( item->GetPenWidth(), defaultPenWidth ) );
  912. item->Plot( aPlotter, background );
  913. }
  914. for( const SCH_ITEM* item : other )
  915. {
  916. aPlotter->SetCurrentLineWidth( std::max( item->GetPenWidth(), defaultPenWidth ) );
  917. item->Plot( aPlotter, background );
  918. }
  919. for( const SCH_ITEM* item : other )
  920. {
  921. aPlotter->SetCurrentLineWidth( std::max( item->GetPenWidth(), defaultPenWidth ) );
  922. item->Plot( aPlotter, !background );
  923. }
  924. // After plotting the symbols as a group above (in `other`), we need to overplot the pins
  925. // and symbols to ensure that they are always visible
  926. for( const SCH_SYMBOL* sym :symbols )
  927. {
  928. aPlotter->SetCurrentLineWidth( std::max( sym->GetPenWidth(), defaultPenWidth ) );
  929. for( SCH_FIELD field : sym->GetFields() )
  930. field.Plot( aPlotter, false );
  931. sym->PlotPins( aPlotter );
  932. }
  933. for( const SCH_ITEM* item : junctions )
  934. {
  935. aPlotter->SetCurrentLineWidth( std::max( item->GetPenWidth(), defaultPenWidth ) );
  936. item->Plot( aPlotter, !background );
  937. }
  938. }
  939. void SCH_SCREEN::ClearDrawingState()
  940. {
  941. for( SCH_ITEM* item : Items() )
  942. item->ClearTempFlags();
  943. }
  944. LIB_PIN* SCH_SCREEN::GetPin( const VECTOR2I& aPosition, SCH_SYMBOL** aSymbol,
  945. bool aEndPointOnly ) const
  946. {
  947. SCH_SYMBOL* candidate = nullptr;
  948. LIB_PIN* pin = nullptr;
  949. for( SCH_ITEM* item : Items().Overlapping( SCH_SYMBOL_T, aPosition ) )
  950. {
  951. candidate = static_cast<SCH_SYMBOL*>( item );
  952. if( aEndPointOnly )
  953. {
  954. pin = nullptr;
  955. if( !candidate->GetLibSymbolRef() )
  956. continue;
  957. for( pin = candidate->GetLibSymbolRef()->GetNextPin(); pin;
  958. pin = candidate->GetLibSymbolRef()->GetNextPin( pin ) )
  959. {
  960. // Skip items not used for this part.
  961. if( candidate->GetUnit() && pin->GetUnit() &&
  962. ( pin->GetUnit() != candidate->GetUnit() ) )
  963. continue;
  964. if( candidate->GetConvert() && pin->GetConvert() &&
  965. ( pin->GetConvert() != candidate->GetConvert() ) )
  966. continue;
  967. if( candidate->GetPinPhysicalPosition( pin ) == aPosition )
  968. break;
  969. }
  970. if( pin )
  971. break;
  972. }
  973. else
  974. {
  975. pin = (LIB_PIN*) candidate->GetDrawItem( aPosition, LIB_PIN_T );
  976. if( pin )
  977. break;
  978. }
  979. }
  980. if( pin && aSymbol )
  981. *aSymbol = candidate;
  982. return pin;
  983. }
  984. SCH_SHEET_PIN* SCH_SCREEN::GetSheetPin( const VECTOR2I& aPosition ) const
  985. {
  986. SCH_SHEET_PIN* sheetPin = nullptr;
  987. for( SCH_ITEM* item : Items().Overlapping( SCH_SHEET_T, aPosition ) )
  988. {
  989. SCH_SHEET* sheet = static_cast<SCH_SHEET*>( item );
  990. sheetPin = sheet->GetPin( aPosition );
  991. if( sheetPin )
  992. break;
  993. }
  994. return sheetPin;
  995. }
  996. size_t SCH_SCREEN::CountConnectedItems( const VECTOR2I& aPos, bool aTestJunctions ) const
  997. {
  998. size_t count = 0;
  999. for( const SCH_ITEM* item : Items().Overlapping( aPos ) )
  1000. {
  1001. if( ( item->Type() != SCH_JUNCTION_T || aTestJunctions ) && item->IsConnected( aPos ) )
  1002. count++;
  1003. }
  1004. return count;
  1005. }
  1006. void SCH_SCREEN::ClearAnnotation( SCH_SHEET_PATH* aSheetPath, bool aResetPrefix )
  1007. {
  1008. for( SCH_ITEM* item : Items().OfType( SCH_SYMBOL_T ) )
  1009. {
  1010. SCH_SYMBOL* symbol = static_cast<SCH_SYMBOL*>( item );
  1011. symbol->ClearAnnotation( aSheetPath, aResetPrefix );
  1012. }
  1013. }
  1014. void SCH_SCREEN::EnsureAlternateReferencesExist()
  1015. {
  1016. if( GetClientSheetPaths().size() <= 1 ) // No need for alternate reference
  1017. return;
  1018. for( SCH_ITEM* item : Items().OfType( SCH_SYMBOL_T ) )
  1019. {
  1020. SCH_SYMBOL* symbol = static_cast<SCH_SYMBOL*>( item );
  1021. // Add (when not existing) all sheet path entries
  1022. for( const SCH_SHEET_PATH& sheet : GetClientSheetPaths() )
  1023. symbol->AddSheetPathReferenceEntryIfMissing( sheet.Path() );
  1024. }
  1025. }
  1026. void SCH_SCREEN::GetHierarchicalItems( std::vector<SCH_ITEM*>* aItems ) const
  1027. {
  1028. for( SCH_ITEM* item : Items() )
  1029. {
  1030. if( item->IsType( { SCH_SYMBOL_T, SCH_SHEET_T, SCH_LABEL_LOCATE_ANY_T } ) )
  1031. aItems->push_back( item );
  1032. }
  1033. }
  1034. void SCH_SCREEN::GetSheets( std::vector<SCH_ITEM*>* aItems ) const
  1035. {
  1036. for( SCH_ITEM* item : Items().OfType( SCH_SHEET_T ) )
  1037. aItems->push_back( item );
  1038. std::sort( aItems->begin(), aItems->end(),
  1039. []( EDA_ITEM* a, EDA_ITEM* b ) -> bool
  1040. {
  1041. if( a->GetPosition().x == b->GetPosition().x )
  1042. {
  1043. // Ensure deterministic sort
  1044. if( a->GetPosition().y == b->GetPosition().y )
  1045. return a->m_Uuid < b->m_Uuid;
  1046. return a->GetPosition().y < b->GetPosition().y;
  1047. }
  1048. else
  1049. {
  1050. return a->GetPosition().x < b->GetPosition().x;
  1051. }
  1052. } );
  1053. }
  1054. void SCH_SCREEN::TestDanglingEnds( const SCH_SHEET_PATH* aPath,
  1055. std::function<void( SCH_ITEM* )>* aChangedHandler ) const
  1056. {
  1057. std::vector<DANGLING_END_ITEM> endPoints;
  1058. for( SCH_ITEM* item : Items() )
  1059. {
  1060. if( item->IsConnectable() )
  1061. {
  1062. endPoints.clear();
  1063. for( SCH_ITEM* overlapping : Items().Overlapping( item->GetBoundingBox() ) )
  1064. overlapping->GetEndPoints( endPoints );
  1065. if( item->UpdateDanglingState( endPoints, aPath ) )
  1066. {
  1067. if( aChangedHandler )
  1068. (*aChangedHandler)( item );
  1069. }
  1070. }
  1071. }
  1072. }
  1073. SCH_LINE* SCH_SCREEN::GetLine( const VECTOR2I& aPosition, int aAccuracy, int aLayer,
  1074. SCH_LINE_TEST_T aSearchType ) const
  1075. {
  1076. // an accuracy of 0 had problems with rounding errors; use at least 1
  1077. aAccuracy = std::max( aAccuracy, 1 );
  1078. for( SCH_ITEM* item : Items().Overlapping( aPosition, aAccuracy ) )
  1079. {
  1080. if( item->Type() != SCH_LINE_T )
  1081. continue;
  1082. if( item->GetLayer() != aLayer )
  1083. continue;
  1084. if( !item->HitTest( aPosition, aAccuracy ) )
  1085. continue;
  1086. switch( aSearchType )
  1087. {
  1088. case ENTIRE_LENGTH_T:
  1089. return (SCH_LINE*) item;
  1090. case EXCLUDE_END_POINTS_T:
  1091. if( !( (SCH_LINE*) item )->IsEndPoint( aPosition ) )
  1092. return (SCH_LINE*) item;
  1093. break;
  1094. case END_POINTS_ONLY_T:
  1095. if( ( (SCH_LINE*) item )->IsEndPoint( aPosition ) )
  1096. return (SCH_LINE*) item;
  1097. }
  1098. }
  1099. return nullptr;
  1100. }
  1101. SCH_LABEL_BASE* SCH_SCREEN::GetLabel( const VECTOR2I& aPosition, int aAccuracy ) const
  1102. {
  1103. for( SCH_ITEM* item : Items().Overlapping( aPosition, aAccuracy ) )
  1104. {
  1105. switch( item->Type() )
  1106. {
  1107. case SCH_LABEL_T:
  1108. case SCH_GLOBAL_LABEL_T:
  1109. case SCH_HIER_LABEL_T:
  1110. case SCH_DIRECTIVE_LABEL_T:
  1111. if( item->HitTest( aPosition, aAccuracy ) )
  1112. return static_cast<SCH_LABEL_BASE*>( item );
  1113. break;
  1114. default:
  1115. ;
  1116. }
  1117. }
  1118. return nullptr;
  1119. }
  1120. void SCH_SCREEN::AddLibSymbol( LIB_SYMBOL* aLibSymbol )
  1121. {
  1122. wxCHECK( aLibSymbol, /* void */ );
  1123. wxString libSymbolName = aLibSymbol->GetLibId().Format().wx_str();
  1124. auto it = m_libSymbols.find( libSymbolName );
  1125. if( it != m_libSymbols.end() )
  1126. {
  1127. delete it->second;
  1128. m_libSymbols.erase( it );
  1129. }
  1130. m_libSymbols[libSymbolName] = aLibSymbol;
  1131. }
  1132. void SCH_SCREEN::AddBusAlias( std::shared_ptr<BUS_ALIAS> aAlias )
  1133. {
  1134. m_aliases.insert( aAlias );
  1135. }
  1136. void SCH_SCREEN::SetLegacySymbolInstanceData()
  1137. {
  1138. for( SCH_ITEM* item : Items().OfType( SCH_SYMBOL_T ) )
  1139. {
  1140. SCH_SYMBOL* symbol = static_cast<SCH_SYMBOL*>( item );
  1141. // Add missing value and footprint instance data for legacy schematics.
  1142. for( const SYMBOL_INSTANCE_REFERENCE& instance : symbol->GetInstanceReferences() )
  1143. {
  1144. symbol->AddHierarchicalReference( instance.m_Path, instance.m_Reference,
  1145. instance.m_Unit );
  1146. }
  1147. }
  1148. }
  1149. #if defined(DEBUG)
  1150. void SCH_SCREEN::Show( int nestLevel, std::ostream& os ) const
  1151. {
  1152. // for now, make it look like XML, expand on this later.
  1153. NestedSpace( nestLevel, os ) << '<' << GetClass().Lower().mb_str() << ">\n";
  1154. for( const SCH_ITEM* item : Items() )
  1155. item->Show( nestLevel + 1, os );
  1156. NestedSpace( nestLevel, os ) << "</" << GetClass().Lower().mb_str() << ">\n";
  1157. }
  1158. #endif
  1159. SCH_SCREENS::SCH_SCREENS( SCH_SHEET* aSheet )
  1160. {
  1161. m_index = 0;
  1162. buildScreenList( aSheet );
  1163. }
  1164. SCH_SCREENS::~SCH_SCREENS()
  1165. {
  1166. }
  1167. SCH_SCREEN* SCH_SCREENS::GetFirst()
  1168. {
  1169. m_index = 0;
  1170. if( m_screens.size() > 0 )
  1171. return m_screens[0];
  1172. return nullptr;
  1173. }
  1174. SCH_SCREEN* SCH_SCREENS::GetNext()
  1175. {
  1176. if( m_index < m_screens.size() )
  1177. m_index++;
  1178. return GetScreen( m_index );
  1179. }
  1180. SCH_SCREEN* SCH_SCREENS::GetScreen( unsigned int aIndex ) const
  1181. {
  1182. if( aIndex < m_screens.size() )
  1183. return m_screens[ aIndex ];
  1184. return nullptr;
  1185. }
  1186. SCH_SHEET* SCH_SCREENS::GetSheet( unsigned int aIndex ) const
  1187. {
  1188. if( aIndex < m_sheets.size() )
  1189. return m_sheets[ aIndex ];
  1190. return nullptr;
  1191. }
  1192. void SCH_SCREENS::addScreenToList( SCH_SCREEN* aScreen, SCH_SHEET* aSheet )
  1193. {
  1194. if( aScreen == nullptr )
  1195. return;
  1196. for( const SCH_SCREEN* screen : m_screens )
  1197. {
  1198. if( screen == aScreen )
  1199. return;
  1200. }
  1201. m_screens.push_back( aScreen );
  1202. m_sheets.push_back( aSheet );
  1203. }
  1204. void SCH_SCREENS::buildScreenList( SCH_SHEET* aSheet )
  1205. {
  1206. if( aSheet && aSheet->Type() == SCH_SHEET_T )
  1207. {
  1208. SCH_SCREEN* screen = aSheet->GetScreen();
  1209. wxCHECK_RET( screen, "No screen for aSheet" );
  1210. addScreenToList( screen, aSheet );
  1211. for( SCH_ITEM* item : screen->Items().OfType( SCH_SHEET_T ) )
  1212. buildScreenList( static_cast<SCH_SHEET*>( item ) );
  1213. }
  1214. }
  1215. void SCH_SCREENS::ClearAnnotationOfNewSheetPaths( SCH_SHEET_LIST& aInitialSheetPathList )
  1216. {
  1217. SCH_SCREEN* first = GetFirst();
  1218. if( !first )
  1219. return;
  1220. SCHEMATIC* sch = first->Schematic();
  1221. wxCHECK_RET( sch, "Null schematic in SCH_SCREENS::ClearAnnotationOfNewSheetPaths" );
  1222. // Clear the annotation for symbols inside new sheetpaths not already in aInitialSheetList
  1223. SCH_SCREENS screensList( sch->Root() ); // The list of screens, shared by sheet paths
  1224. screensList.BuildClientSheetPathList(); // build the shared by sheet paths, by screen
  1225. // Search for new sheet paths, not existing in aInitialSheetPathList
  1226. // and existing in sheetpathList
  1227. for( SCH_SHEET_PATH& sheetpath : sch->GetSheets() )
  1228. {
  1229. bool path_exists = false;
  1230. for( const SCH_SHEET_PATH& existing_sheetpath: aInitialSheetPathList )
  1231. {
  1232. if( existing_sheetpath.Path() == sheetpath.Path() )
  1233. {
  1234. path_exists = true;
  1235. break;
  1236. }
  1237. }
  1238. if( !path_exists )
  1239. {
  1240. // A new sheet path is found: clear the annotation corresponding to this new path:
  1241. SCH_SCREEN* curr_screen = sheetpath.LastScreen();
  1242. // Clear annotation and create the AR for this path, if not exists,
  1243. // when the screen is shared by sheet paths.
  1244. // Otherwise ClearAnnotation do nothing, because the F1 field is used as
  1245. // reference default value and takes the latest displayed value
  1246. curr_screen->EnsureAlternateReferencesExist();
  1247. curr_screen->ClearAnnotation( &sheetpath, false );
  1248. }
  1249. }
  1250. }
  1251. int SCH_SCREENS::ReplaceDuplicateTimeStamps()
  1252. {
  1253. std::vector<SCH_ITEM*> items;
  1254. int count = 0;
  1255. auto timestamp_cmp = []( const EDA_ITEM* a, const EDA_ITEM* b ) -> bool
  1256. {
  1257. return a->m_Uuid < b->m_Uuid;
  1258. };
  1259. std::set<EDA_ITEM*, decltype( timestamp_cmp )> unique_stamps( timestamp_cmp );
  1260. for( SCH_SCREEN* screen : m_screens )
  1261. screen->GetHierarchicalItems( &items );
  1262. if( items.size() < 2 )
  1263. return 0;
  1264. for( EDA_ITEM* item : items )
  1265. {
  1266. if( !unique_stamps.insert( item ).second )
  1267. {
  1268. // Reset to fully random UUID. This may lose reference, but better to be
  1269. // deterministic about it rather than to have duplicate UUIDs with random
  1270. // side-effects.
  1271. const_cast<KIID&>( item->m_Uuid ) = KIID();
  1272. count++;
  1273. // @todo If the item is a sheet, we need to decend the heirarchy from the sheet
  1274. // and repace all instances of the changed UUID in sheet paths. Otherwise,
  1275. // all instance paths with the sheet's UUID will get clobbered.
  1276. }
  1277. }
  1278. return count;
  1279. }
  1280. void SCH_SCREENS::ClearEditFlags()
  1281. {
  1282. for( SCH_SCREEN* screen = GetFirst(); screen; screen = GetNext() )
  1283. {
  1284. for( SCH_ITEM* item : screen->Items() )
  1285. item->ClearEditFlags();
  1286. }
  1287. }
  1288. void SCH_SCREENS::DeleteMarker( SCH_MARKER* aMarker )
  1289. {
  1290. for( SCH_SCREEN* screen = GetFirst(); screen; screen = GetNext() )
  1291. {
  1292. for( SCH_ITEM* item : screen->Items().OfType( SCH_MARKER_T ) )
  1293. {
  1294. if( item == aMarker )
  1295. {
  1296. screen->DeleteItem( item );
  1297. return;
  1298. }
  1299. }
  1300. }
  1301. }
  1302. void SCH_SCREENS::DeleteMarkers( enum MARKER_BASE::TYPEMARKER aMarkerType, int aErrorCode,
  1303. bool aIncludeExclusions )
  1304. {
  1305. for( SCH_SCREEN* screen = GetFirst(); screen; screen = GetNext() )
  1306. {
  1307. std::vector<SCH_ITEM*> markers;
  1308. for( SCH_ITEM* item : screen->Items().OfType( SCH_MARKER_T ) )
  1309. {
  1310. SCH_MARKER* marker = static_cast<SCH_MARKER*>( item );
  1311. std::shared_ptr<RC_ITEM>rcItem = marker->GetRCItem();
  1312. if( marker->GetMarkerType() == aMarkerType
  1313. && ( aErrorCode == ERCE_UNSPECIFIED || rcItem->GetErrorCode() == aErrorCode )
  1314. && ( !marker->IsExcluded() || aIncludeExclusions ) )
  1315. {
  1316. markers.push_back( item );
  1317. }
  1318. }
  1319. for( SCH_ITEM* marker : markers )
  1320. screen->DeleteItem( marker );
  1321. }
  1322. }
  1323. void SCH_SCREENS::DeleteAllMarkers( enum MARKER_BASE::TYPEMARKER aMarkerType,
  1324. bool aIncludeExclusions )
  1325. {
  1326. DeleteMarkers( aMarkerType, ERCE_UNSPECIFIED, aIncludeExclusions );
  1327. }
  1328. void SCH_SCREENS::UpdateSymbolLinks( REPORTER* aReporter )
  1329. {
  1330. for( SCH_SCREEN* screen = GetFirst(); screen; screen = GetNext() )
  1331. screen->UpdateSymbolLinks( aReporter );
  1332. SCH_SCREEN* first = GetFirst();
  1333. if( !first )
  1334. return;
  1335. SCHEMATIC* sch = first->Schematic();
  1336. wxCHECK_RET( sch, "Null schematic in SCH_SCREENS::UpdateSymbolLinks" );
  1337. SCH_SHEET_LIST sheets = sch->GetSheets();
  1338. // All of the library symbols have been replaced with copies so the connection graph
  1339. // pointers are stale.
  1340. if( sch->ConnectionGraph() )
  1341. sch->ConnectionGraph()->Recalculate( sheets, true );
  1342. }
  1343. bool SCH_SCREENS::HasNoFullyDefinedLibIds()
  1344. {
  1345. bool has_symbols = false;
  1346. for( SCH_SCREEN* screen = GetFirst(); screen; screen = GetNext() )
  1347. {
  1348. for( SCH_ITEM* item : screen->Items().OfType( SCH_SYMBOL_T ) )
  1349. {
  1350. SCH_SYMBOL* symbol = static_cast<SCH_SYMBOL*>( item );
  1351. has_symbols = true;
  1352. if( !symbol->GetLibId().GetLibNickname().empty() )
  1353. return false;
  1354. }
  1355. }
  1356. // return true (i.e. has no fully defined symbol) only if at least one symbol is found
  1357. return has_symbols ? true : false;
  1358. }
  1359. size_t SCH_SCREENS::GetLibNicknames( wxArrayString& aLibNicknames )
  1360. {
  1361. for( SCH_SCREEN* screen = GetFirst(); screen; screen = GetNext() )
  1362. {
  1363. for( SCH_ITEM* item : screen->Items().OfType( SCH_SYMBOL_T ) )
  1364. {
  1365. SCH_SYMBOL* symbol = static_cast<SCH_SYMBOL*>( item );
  1366. const UTF8& nickname = symbol->GetLibId().GetLibNickname();
  1367. if( !nickname.empty() && ( aLibNicknames.Index( nickname ) == wxNOT_FOUND ) )
  1368. aLibNicknames.Add( nickname );
  1369. }
  1370. }
  1371. return aLibNicknames.GetCount();
  1372. }
  1373. int SCH_SCREENS::ChangeSymbolLibNickname( const wxString& aFrom, const wxString& aTo )
  1374. {
  1375. SCH_SCREEN* screen;
  1376. int cnt = 0;
  1377. for( screen = GetFirst(); screen; screen = GetNext() )
  1378. {
  1379. for( SCH_ITEM* item : screen->Items().OfType( SCH_SYMBOL_T ) )
  1380. {
  1381. SCH_SYMBOL* symbol = static_cast<SCH_SYMBOL*>( item );
  1382. if( symbol->GetLibId().GetLibNickname() != aFrom )
  1383. continue;
  1384. LIB_ID id = symbol->GetLibId();
  1385. id.SetLibNickname( aTo );
  1386. symbol->SetLibId( id );
  1387. cnt++;
  1388. }
  1389. }
  1390. return cnt;
  1391. }
  1392. bool SCH_SCREENS::HasSchematic( const wxString& aSchematicFileName )
  1393. {
  1394. for( const SCH_SCREEN* screen = GetFirst(); screen; screen = GetNext() )
  1395. {
  1396. if( screen->GetFileName() == aSchematicFileName )
  1397. return true;
  1398. }
  1399. return false;
  1400. }
  1401. bool SCH_SCREENS::CanCauseCaseSensitivityIssue( const wxString& aSchematicFileName ) const
  1402. {
  1403. wxString lhsLower;
  1404. wxString rhsLower;
  1405. wxFileName lhs;
  1406. wxFileName rhs = aSchematicFileName;
  1407. wxCHECK( rhs.IsAbsolute(), false );
  1408. for( const SCH_SCREEN* screen : m_screens )
  1409. {
  1410. lhs = screen->GetFileName();
  1411. if( lhs.GetPath() != rhs.GetPath() )
  1412. continue;
  1413. lhsLower = lhs.GetFullName().Lower();
  1414. rhsLower = rhs.GetFullName().Lower();
  1415. if( lhsLower == rhsLower && lhs.GetFullName() != rhs.GetFullName() )
  1416. return true;
  1417. }
  1418. return false;
  1419. }
  1420. void SCH_SCREENS::BuildClientSheetPathList()
  1421. {
  1422. SCH_SCREEN* first = GetFirst();
  1423. if( !first )
  1424. return;
  1425. SCHEMATIC* sch = first->Schematic();
  1426. wxCHECK_RET( sch, "Null schematic in SCH_SCREENS::BuildClientSheetPathList" );
  1427. for( SCH_SCREEN* curr_screen = GetFirst(); curr_screen; curr_screen = GetNext() )
  1428. curr_screen->GetClientSheetPaths().clear();
  1429. for( SCH_SHEET_PATH& sheetpath : sch->GetSheets() )
  1430. {
  1431. SCH_SCREEN* used_screen = sheetpath.LastScreen();
  1432. // Search for the used_screen in list and add this unique sheet path:
  1433. for( SCH_SCREEN* curr_screen = GetFirst(); curr_screen; curr_screen = GetNext() )
  1434. {
  1435. if( used_screen == curr_screen )
  1436. {
  1437. curr_screen->GetClientSheetPaths().push_back( sheetpath );
  1438. break;
  1439. }
  1440. }
  1441. }
  1442. }
  1443. void SCH_SCREENS::SetLegacySymbolInstanceData()
  1444. {
  1445. for( SCH_SCREEN* screen = GetFirst(); screen; screen = GetNext() )
  1446. screen->SetLegacySymbolInstanceData();
  1447. }
  1448. void SCH_SCREEN::MigrateSimModels()
  1449. {
  1450. LOCALE_IO toggle;
  1451. // V6 schematics may specify model names in Value fields, which we don't do in V7.
  1452. // Migrate by adding an equivalent model for these symbols.
  1453. for( SCH_ITEM* item : Items().OfType( SCH_SYMBOL_T ) )
  1454. {
  1455. SCH_SYMBOL* symbol = static_cast<SCH_SYMBOL*>( item );
  1456. migrateSimModel( *symbol );
  1457. }
  1458. }
  1459. void SCH_SCREEN::migrateSimModel( SCH_SYMBOL& aSymbol )
  1460. {
  1461. if( aSymbol.FindField( SIM_MODEL::DEVICE_TYPE_FIELD )
  1462. || aSymbol.FindField( SIM_MODEL::TYPE_FIELD )
  1463. || aSymbol.FindField( SIM_MODEL::PINS_FIELD )
  1464. || aSymbol.FindField( SIM_MODEL::PARAMS_FIELD ) )
  1465. {
  1466. // Has a V7 model field -- skip.
  1467. return;
  1468. }
  1469. wxString prefix = aSymbol.GetPrefix();
  1470. wxString value = aSymbol.GetValueFieldText( true );
  1471. wxString spiceType;
  1472. wxString spiceModel;
  1473. wxString spiceLib;
  1474. wxString pinMap;
  1475. if( aSymbol.FindField( wxT( "Spice_Primitive" ) )
  1476. || aSymbol.FindField( wxT( "Spice_Node_Sequence" ) )
  1477. || aSymbol.FindField( wxT( "Spice_Model" ) )
  1478. || aSymbol.FindField( wxT( "Spice_Netlist_Enabled" ) )
  1479. || aSymbol.FindField( wxT( "Spice_Lib_File" ) ) )
  1480. {
  1481. if( SCH_FIELD* primitiveField = aSymbol.FindField( wxT( "Spice_Primitive" ) ) )
  1482. {
  1483. spiceType = primitiveField->GetText();
  1484. aSymbol.RemoveField( wxT( "Spice_Primitive" ) );
  1485. }
  1486. if( SCH_FIELD* nodeSequenceField = aSymbol.FindField( wxT( "Spice_Node_Sequence" ) ) )
  1487. {
  1488. const wxString delimiters( "{:,; }" );
  1489. const wxString& nodeSequence = nodeSequenceField->GetText();
  1490. if( nodeSequence != "" )
  1491. {
  1492. wxStringTokenizer tkz( nodeSequence, delimiters );
  1493. for( long modelPinNumber = 1; tkz.HasMoreTokens(); ++modelPinNumber )
  1494. {
  1495. long symbolPinNumber = 1;
  1496. tkz.GetNextToken().ToLong( &symbolPinNumber );
  1497. if( modelPinNumber != 1 )
  1498. pinMap.Append( " " );
  1499. pinMap.Append( wxString::Format( "%ld=%ld", symbolPinNumber, modelPinNumber ) );
  1500. }
  1501. }
  1502. aSymbol.RemoveField( wxT( "Spice_Node_Sequence" ) );
  1503. }
  1504. if( SCH_FIELD* modelField = aSymbol.FindField( wxT( "Spice_Model" ) ) )
  1505. {
  1506. spiceModel = modelField->GetText();
  1507. aSymbol.RemoveField( wxT( "Spice_Model" ) );
  1508. }
  1509. else
  1510. {
  1511. spiceModel = aSymbol.FindField( wxT( "Value" ) )->GetText();
  1512. }
  1513. if( SCH_FIELD* netlistEnabledField = aSymbol.FindField( wxT( "Spice_Netlist_Enabled" ) ) )
  1514. {
  1515. wxString netlistEnabled = netlistEnabledField->GetText().Lower();
  1516. if( netlistEnabled.StartsWith( wxT( "0" ) )
  1517. || netlistEnabled.StartsWith( wxT( "n" ) )
  1518. || netlistEnabled.StartsWith( wxT( "f" ) ) )
  1519. {
  1520. SCH_FIELD enableField( VECTOR2I( 0, 0 ), aSymbol.GetFieldCount(), &aSymbol,
  1521. SIM_MODEL::ENABLE_FIELD );
  1522. }
  1523. }
  1524. if( SCH_FIELD* libFileField = aSymbol.FindField( wxT( "Spice_Lib_File" ) ) )
  1525. {
  1526. spiceLib = libFileField->GetText();
  1527. aSymbol.RemoveField( wxT( "Spice_Lib_File" ) );
  1528. }
  1529. }
  1530. else if( prefix == wxT( "V" ) || prefix == wxT( "I" ) )
  1531. {
  1532. spiceModel = value;
  1533. }
  1534. else
  1535. {
  1536. // Auto convert some legacy fields used in the middle of 7.0 development...
  1537. if( SCH_FIELD* legacyDevice = aSymbol.FindField( wxT( "Sim_Type" ) ) )
  1538. {
  1539. legacyDevice->SetName( SIM_MODEL::TYPE_FIELD );
  1540. }
  1541. if( SCH_FIELD* legacyDevice = aSymbol.FindField( wxT( "Sim_Device" ) ) )
  1542. {
  1543. legacyDevice->SetName( SIM_MODEL::DEVICE_TYPE_FIELD );
  1544. }
  1545. if( SCH_FIELD* legacyPins = aSymbol.FindField( wxT( "Sim_Pins" ) ) )
  1546. {
  1547. // Migrate pins from array of indexes to name-value-pairs
  1548. wxArrayString pinIndexes;
  1549. wxString pins;
  1550. wxStringSplit( legacyPins->GetText(), pinIndexes, ' ' );
  1551. if( SIM_MODEL_IDEAL::InferSimParams( prefix, value ).length() )
  1552. {
  1553. if( pinIndexes[0] == wxT( "2" ) )
  1554. pins = "1=- 2=+";
  1555. else
  1556. pins = "1=+ 2=-";
  1557. }
  1558. else
  1559. {
  1560. for( unsigned ii = 0; ii < pinIndexes.size(); ++ii )
  1561. {
  1562. if( ii > 0 )
  1563. pins.Append( wxS( " " ) );
  1564. pins.Append( wxString::Format( wxT( "%u=%s" ), ii + 1, pinIndexes[ ii ] ) );
  1565. }
  1566. }
  1567. legacyPins->SetName( SIM_MODEL::PINS_FIELD );
  1568. legacyPins->SetText( pins );
  1569. }
  1570. if( SCH_FIELD* legacyPins = aSymbol.FindField( wxT( "Sim_Params" ) ) )
  1571. {
  1572. legacyPins->SetName( SIM_MODEL::PARAMS_FIELD );
  1573. }
  1574. return;
  1575. }
  1576. // Insert a plaintext model as a substitute.
  1577. SCH_FIELD deviceTypeField( VECTOR2I( 0, 0 ), aSymbol.GetFieldCount(), &aSymbol,
  1578. SIM_MODEL::DEVICE_TYPE_FIELD );
  1579. deviceTypeField.SetText( SIM_MODEL::DeviceInfo( SIM_MODEL::DEVICE_T::SPICE ).fieldValue );
  1580. aSymbol.AddField( deviceTypeField );
  1581. SCH_FIELD paramsField( VECTOR2I( 0, 0 ), aSymbol.GetFieldCount(), &aSymbol,
  1582. SIM_MODEL::PARAMS_FIELD );
  1583. paramsField.SetText( wxString::Format( "type=\"%s\" model=\"%s\" lib=\"%s\"",
  1584. spiceType, spiceModel, spiceLib ) );
  1585. aSymbol.AddField( paramsField );
  1586. // Legacy models by default get linear pin mapping.
  1587. if( pinMap != "" )
  1588. {
  1589. SCH_FIELD pinsField( VECTOR2I( 0, 0 ), aSymbol.GetFieldCount(), &aSymbol,
  1590. SIM_MODEL::PINS_FIELD );
  1591. pinsField.SetText( pinMap );
  1592. aSymbol.AddField( pinsField );
  1593. }
  1594. else
  1595. {
  1596. wxString pins;
  1597. for( unsigned ii = 0; ii < aSymbol.GetLibPins().size(); ++ii )
  1598. {
  1599. if( ii > 0 )
  1600. pins.Append( wxS( " " ) );
  1601. pins.Append( wxString::Format( wxT( "%u=%u" ), ii + 1, ii + 1 ) );
  1602. }
  1603. SCH_FIELD pinsField( VECTOR2I( 0, 0 ), aSymbol.GetFieldCount(), &aSymbol,
  1604. SIM_MODEL::PINS_FIELD );
  1605. pinsField.SetText( pins );
  1606. aSymbol.AddField( pinsField );
  1607. }
  1608. }