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.

941 lines
34 KiB

* KIWAY Milestone A): Make major modules into DLL/DSOs. ! The initial testing of this commit should be done using a Debug build so that all the wxASSERT()s are enabled. Also, be sure and keep enabled the USE_KIWAY_DLLs option. The tree won't likely build without it. Turning it off is senseless anyways. If you want stable code, go back to a prior version, the one tagged with "stable". * Relocate all functionality out of the wxApp derivative into more finely targeted purposes: a) DLL/DSO specific b) PROJECT specific c) EXE or process specific d) configuration file specific data e) configuration file manipulations functions. All of this functionality was blended into an extremely large wxApp derivative and that was incompatible with the desire to support multiple concurrently loaded DLL/DSO's ("KIFACE")s and multiple concurrently open projects. An amazing amount of organization come from simply sorting each bit of functionality into the proper box. * Switch to wxConfigBase from wxConfig everywhere except instantiation. * Add classes KIWAY, KIFACE, KIFACE_I, SEARCH_STACK, PGM_BASE, PGM_KICAD, PGM_SINGLE_TOP, * Remove "Return" prefix on many function names. * Remove obvious comments from CMakeLists.txt files, and from else() and endif()s. * Fix building boost for use in a DSO on linux. * Remove some of the assumptions in the CMakeLists.txt files that windows had to be the host platform when building windows binaries. * Reduce the number of wxStrings being constructed at program load time via static construction. * Pass wxConfigBase* to all SaveSettings() and LoadSettings() functions so that these functions are useful even when the wxConfigBase comes from another source, as is the case in the KICAD_MANAGER_FRAME. * Move the setting of the KIPRJMOD environment variable into class PROJECT, so that it can be moved into a project variable soon, and out of FP_LIB_TABLE. * Add the KIWAY_PLAYER which is associated with a particular PROJECT, and all its child wxFrames and wxDialogs now have a Kiway() member function which returns a KIWAY& that that window tree branch is in support of. This is like wxWindows DNA in that child windows get this member with proper value at time of construction. * Anticipate some of the needs for milestones B) and C) and make code adjustments now in an effort to reduce work in those milestones. * No testing has been done for python scripting, since milestone C) has that being largely reworked and re-thought-out.
12 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
* KIWAY Milestone A): Make major modules into DLL/DSOs. ! The initial testing of this commit should be done using a Debug build so that all the wxASSERT()s are enabled. Also, be sure and keep enabled the USE_KIWAY_DLLs option. The tree won't likely build without it. Turning it off is senseless anyways. If you want stable code, go back to a prior version, the one tagged with "stable". * Relocate all functionality out of the wxApp derivative into more finely targeted purposes: a) DLL/DSO specific b) PROJECT specific c) EXE or process specific d) configuration file specific data e) configuration file manipulations functions. All of this functionality was blended into an extremely large wxApp derivative and that was incompatible with the desire to support multiple concurrently loaded DLL/DSO's ("KIFACE")s and multiple concurrently open projects. An amazing amount of organization come from simply sorting each bit of functionality into the proper box. * Switch to wxConfigBase from wxConfig everywhere except instantiation. * Add classes KIWAY, KIFACE, KIFACE_I, SEARCH_STACK, PGM_BASE, PGM_KICAD, PGM_SINGLE_TOP, * Remove "Return" prefix on many function names. * Remove obvious comments from CMakeLists.txt files, and from else() and endif()s. * Fix building boost for use in a DSO on linux. * Remove some of the assumptions in the CMakeLists.txt files that windows had to be the host platform when building windows binaries. * Reduce the number of wxStrings being constructed at program load time via static construction. * Pass wxConfigBase* to all SaveSettings() and LoadSettings() functions so that these functions are useful even when the wxConfigBase comes from another source, as is the case in the KICAD_MANAGER_FRAME. * Move the setting of the KIPRJMOD environment variable into class PROJECT, so that it can be moved into a project variable soon, and out of FP_LIB_TABLE. * Add the KIWAY_PLAYER which is associated with a particular PROJECT, and all its child wxFrames and wxDialogs now have a Kiway() member function which returns a KIWAY& that that window tree branch is in support of. This is like wxWindows DNA in that child windows get this member with proper value at time of construction. * Anticipate some of the needs for milestones B) and C) and make code adjustments now in an effort to reduce work in those milestones. * No testing has been done for python scripting, since milestone C) has that being largely reworked and re-thought-out.
12 years ago
* KIWAY Milestone A): Make major modules into DLL/DSOs. ! The initial testing of this commit should be done using a Debug build so that all the wxASSERT()s are enabled. Also, be sure and keep enabled the USE_KIWAY_DLLs option. The tree won't likely build without it. Turning it off is senseless anyways. If you want stable code, go back to a prior version, the one tagged with "stable". * Relocate all functionality out of the wxApp derivative into more finely targeted purposes: a) DLL/DSO specific b) PROJECT specific c) EXE or process specific d) configuration file specific data e) configuration file manipulations functions. All of this functionality was blended into an extremely large wxApp derivative and that was incompatible with the desire to support multiple concurrently loaded DLL/DSO's ("KIFACE")s and multiple concurrently open projects. An amazing amount of organization come from simply sorting each bit of functionality into the proper box. * Switch to wxConfigBase from wxConfig everywhere except instantiation. * Add classes KIWAY, KIFACE, KIFACE_I, SEARCH_STACK, PGM_BASE, PGM_KICAD, PGM_SINGLE_TOP, * Remove "Return" prefix on many function names. * Remove obvious comments from CMakeLists.txt files, and from else() and endif()s. * Fix building boost for use in a DSO on linux. * Remove some of the assumptions in the CMakeLists.txt files that windows had to be the host platform when building windows binaries. * Reduce the number of wxStrings being constructed at program load time via static construction. * Pass wxConfigBase* to all SaveSettings() and LoadSettings() functions so that these functions are useful even when the wxConfigBase comes from another source, as is the case in the KICAD_MANAGER_FRAME. * Move the setting of the KIPRJMOD environment variable into class PROJECT, so that it can be moved into a project variable soon, and out of FP_LIB_TABLE. * Add the KIWAY_PLAYER which is associated with a particular PROJECT, and all its child wxFrames and wxDialogs now have a Kiway() member function which returns a KIWAY& that that window tree branch is in support of. This is like wxWindows DNA in that child windows get this member with proper value at time of construction. * Anticipate some of the needs for milestones B) and C) and make code adjustments now in an effort to reduce work in those milestones. * No testing has been done for python scripting, since milestone C) has that being largely reworked and re-thought-out.
12 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
6 years ago
Use legacy schematic plugin for loading schematics in all code paths. Use the legacy plugin schematic loader in the sheet edit and append schematic code paths. Check for fully qualified LIB_ID objects (must have library nickname) when loading existing schematics when edit sheets. Rewrite append schematic feature to handle import issues rather than change the name and file name of all of the sheets in the imported schematic. This includes the following: - Load the schematic into a temporary SCH_SHEET object. - Make sure the imported schematic does not cause any hierarchy recursion issues. - Verify the imported schematic uses fully qualified #LIB_ID objects (symbol library table). - Check to see if any symbol libraries need to be added to the current project's symbol library table. This includes: - Check if the symbol library already exists in the project or global symbol library table. - Convert symbol library URLS that use the ${KIPRJMOD} environment variable to absolute paths. ${KIPRJMOD} will not be the same for this project. - Check for duplicate symbol library nicknames and change the new symbol library nickname to prevent library name clashes. - Update all schematic symbol LIB_ID object library nicknames when the library nickname was changed to prevent clashes. - Check for duplicate sheet names which is illegal and automatically rename any duplicate sheets in the imported schematic. - Clear all of the annotation in the imported schematic to prevent clashes. - Append the objects from the temporary sheet to the current page. - Replace any duplicate time stamps. - Refresh the symbol library links. Add support code to SCH_SCREEN object to assist with schematic import. Doxygen comment cleaning. Fixes lp:1731760 https://bugs.launchpad.net/kicad/+bug/1731760
8 years ago
Use legacy schematic plugin for loading schematics in all code paths. Use the legacy plugin schematic loader in the sheet edit and append schematic code paths. Check for fully qualified LIB_ID objects (must have library nickname) when loading existing schematics when edit sheets. Rewrite append schematic feature to handle import issues rather than change the name and file name of all of the sheets in the imported schematic. This includes the following: - Load the schematic into a temporary SCH_SHEET object. - Make sure the imported schematic does not cause any hierarchy recursion issues. - Verify the imported schematic uses fully qualified #LIB_ID objects (symbol library table). - Check to see if any symbol libraries need to be added to the current project's symbol library table. This includes: - Check if the symbol library already exists in the project or global symbol library table. - Convert symbol library URLS that use the ${KIPRJMOD} environment variable to absolute paths. ${KIPRJMOD} will not be the same for this project. - Check for duplicate symbol library nicknames and change the new symbol library nickname to prevent library name clashes. - Update all schematic symbol LIB_ID object library nicknames when the library nickname was changed to prevent clashes. - Check for duplicate sheet names which is illegal and automatically rename any duplicate sheets in the imported schematic. - Clear all of the annotation in the imported schematic to prevent clashes. - Append the objects from the temporary sheet to the current page. - Replace any duplicate time stamps. - Refresh the symbol library links. Add support code to SCH_SCREEN object to assist with schematic import. Doxygen comment cleaning. Fixes lp:1731760 https://bugs.launchpad.net/kicad/+bug/1731760
8 years ago
Use legacy schematic plugin for loading schematics in all code paths. Use the legacy plugin schematic loader in the sheet edit and append schematic code paths. Check for fully qualified LIB_ID objects (must have library nickname) when loading existing schematics when edit sheets. Rewrite append schematic feature to handle import issues rather than change the name and file name of all of the sheets in the imported schematic. This includes the following: - Load the schematic into a temporary SCH_SHEET object. - Make sure the imported schematic does not cause any hierarchy recursion issues. - Verify the imported schematic uses fully qualified #LIB_ID objects (symbol library table). - Check to see if any symbol libraries need to be added to the current project's symbol library table. This includes: - Check if the symbol library already exists in the project or global symbol library table. - Convert symbol library URLS that use the ${KIPRJMOD} environment variable to absolute paths. ${KIPRJMOD} will not be the same for this project. - Check for duplicate symbol library nicknames and change the new symbol library nickname to prevent library name clashes. - Update all schematic symbol LIB_ID object library nicknames when the library nickname was changed to prevent clashes. - Check for duplicate sheet names which is illegal and automatically rename any duplicate sheets in the imported schematic. - Clear all of the annotation in the imported schematic to prevent clashes. - Append the objects from the temporary sheet to the current page. - Replace any duplicate time stamps. - Refresh the symbol library links. Add support code to SCH_SCREEN object to assist with schematic import. Doxygen comment cleaning. Fixes lp:1731760 https://bugs.launchpad.net/kicad/+bug/1731760
8 years ago
Use legacy schematic plugin for loading schematics in all code paths. Use the legacy plugin schematic loader in the sheet edit and append schematic code paths. Check for fully qualified LIB_ID objects (must have library nickname) when loading existing schematics when edit sheets. Rewrite append schematic feature to handle import issues rather than change the name and file name of all of the sheets in the imported schematic. This includes the following: - Load the schematic into a temporary SCH_SHEET object. - Make sure the imported schematic does not cause any hierarchy recursion issues. - Verify the imported schematic uses fully qualified #LIB_ID objects (symbol library table). - Check to see if any symbol libraries need to be added to the current project's symbol library table. This includes: - Check if the symbol library already exists in the project or global symbol library table. - Convert symbol library URLS that use the ${KIPRJMOD} environment variable to absolute paths. ${KIPRJMOD} will not be the same for this project. - Check for duplicate symbol library nicknames and change the new symbol library nickname to prevent library name clashes. - Update all schematic symbol LIB_ID object library nicknames when the library nickname was changed to prevent clashes. - Check for duplicate sheet names which is illegal and automatically rename any duplicate sheets in the imported schematic. - Clear all of the annotation in the imported schematic to prevent clashes. - Append the objects from the temporary sheet to the current page. - Replace any duplicate time stamps. - Refresh the symbol library links. Add support code to SCH_SCREEN object to assist with schematic import. Doxygen comment cleaning. Fixes lp:1731760 https://bugs.launchpad.net/kicad/+bug/1731760
8 years ago
Use legacy schematic plugin for loading schematics in all code paths. Use the legacy plugin schematic loader in the sheet edit and append schematic code paths. Check for fully qualified LIB_ID objects (must have library nickname) when loading existing schematics when edit sheets. Rewrite append schematic feature to handle import issues rather than change the name and file name of all of the sheets in the imported schematic. This includes the following: - Load the schematic into a temporary SCH_SHEET object. - Make sure the imported schematic does not cause any hierarchy recursion issues. - Verify the imported schematic uses fully qualified #LIB_ID objects (symbol library table). - Check to see if any symbol libraries need to be added to the current project's symbol library table. This includes: - Check if the symbol library already exists in the project or global symbol library table. - Convert symbol library URLS that use the ${KIPRJMOD} environment variable to absolute paths. ${KIPRJMOD} will not be the same for this project. - Check for duplicate symbol library nicknames and change the new symbol library nickname to prevent library name clashes. - Update all schematic symbol LIB_ID object library nicknames when the library nickname was changed to prevent clashes. - Check for duplicate sheet names which is illegal and automatically rename any duplicate sheets in the imported schematic. - Clear all of the annotation in the imported schematic to prevent clashes. - Append the objects from the temporary sheet to the current page. - Replace any duplicate time stamps. - Refresh the symbol library links. Add support code to SCH_SCREEN object to assist with schematic import. Doxygen comment cleaning. Fixes lp:1731760 https://bugs.launchpad.net/kicad/+bug/1731760
8 years ago
Use legacy schematic plugin for loading schematics in all code paths. Use the legacy plugin schematic loader in the sheet edit and append schematic code paths. Check for fully qualified LIB_ID objects (must have library nickname) when loading existing schematics when edit sheets. Rewrite append schematic feature to handle import issues rather than change the name and file name of all of the sheets in the imported schematic. This includes the following: - Load the schematic into a temporary SCH_SHEET object. - Make sure the imported schematic does not cause any hierarchy recursion issues. - Verify the imported schematic uses fully qualified #LIB_ID objects (symbol library table). - Check to see if any symbol libraries need to be added to the current project's symbol library table. This includes: - Check if the symbol library already exists in the project or global symbol library table. - Convert symbol library URLS that use the ${KIPRJMOD} environment variable to absolute paths. ${KIPRJMOD} will not be the same for this project. - Check for duplicate symbol library nicknames and change the new symbol library nickname to prevent library name clashes. - Update all schematic symbol LIB_ID object library nicknames when the library nickname was changed to prevent clashes. - Check for duplicate sheet names which is illegal and automatically rename any duplicate sheets in the imported schematic. - Clear all of the annotation in the imported schematic to prevent clashes. - Append the objects from the temporary sheet to the current page. - Replace any duplicate time stamps. - Refresh the symbol library links. Add support code to SCH_SCREEN object to assist with schematic import. Doxygen comment cleaning. Fixes lp:1731760 https://bugs.launchpad.net/kicad/+bug/1731760
8 years ago
Use legacy schematic plugin for loading schematics in all code paths. Use the legacy plugin schematic loader in the sheet edit and append schematic code paths. Check for fully qualified LIB_ID objects (must have library nickname) when loading existing schematics when edit sheets. Rewrite append schematic feature to handle import issues rather than change the name and file name of all of the sheets in the imported schematic. This includes the following: - Load the schematic into a temporary SCH_SHEET object. - Make sure the imported schematic does not cause any hierarchy recursion issues. - Verify the imported schematic uses fully qualified #LIB_ID objects (symbol library table). - Check to see if any symbol libraries need to be added to the current project's symbol library table. This includes: - Check if the symbol library already exists in the project or global symbol library table. - Convert symbol library URLS that use the ${KIPRJMOD} environment variable to absolute paths. ${KIPRJMOD} will not be the same for this project. - Check for duplicate symbol library nicknames and change the new symbol library nickname to prevent library name clashes. - Update all schematic symbol LIB_ID object library nicknames when the library nickname was changed to prevent clashes. - Check for duplicate sheet names which is illegal and automatically rename any duplicate sheets in the imported schematic. - Clear all of the annotation in the imported schematic to prevent clashes. - Append the objects from the temporary sheet to the current page. - Replace any duplicate time stamps. - Refresh the symbol library links. Add support code to SCH_SCREEN object to assist with schematic import. Doxygen comment cleaning. Fixes lp:1731760 https://bugs.launchpad.net/kicad/+bug/1731760
8 years ago
Use legacy schematic plugin for loading schematics in all code paths. Use the legacy plugin schematic loader in the sheet edit and append schematic code paths. Check for fully qualified LIB_ID objects (must have library nickname) when loading existing schematics when edit sheets. Rewrite append schematic feature to handle import issues rather than change the name and file name of all of the sheets in the imported schematic. This includes the following: - Load the schematic into a temporary SCH_SHEET object. - Make sure the imported schematic does not cause any hierarchy recursion issues. - Verify the imported schematic uses fully qualified #LIB_ID objects (symbol library table). - Check to see if any symbol libraries need to be added to the current project's symbol library table. This includes: - Check if the symbol library already exists in the project or global symbol library table. - Convert symbol library URLS that use the ${KIPRJMOD} environment variable to absolute paths. ${KIPRJMOD} will not be the same for this project. - Check for duplicate symbol library nicknames and change the new symbol library nickname to prevent library name clashes. - Update all schematic symbol LIB_ID object library nicknames when the library nickname was changed to prevent clashes. - Check for duplicate sheet names which is illegal and automatically rename any duplicate sheets in the imported schematic. - Clear all of the annotation in the imported schematic to prevent clashes. - Append the objects from the temporary sheet to the current page. - Replace any duplicate time stamps. - Refresh the symbol library links. Add support code to SCH_SCREEN object to assist with schematic import. Doxygen comment cleaning. Fixes lp:1731760 https://bugs.launchpad.net/kicad/+bug/1731760
8 years ago
Use legacy schematic plugin for loading schematics in all code paths. Use the legacy plugin schematic loader in the sheet edit and append schematic code paths. Check for fully qualified LIB_ID objects (must have library nickname) when loading existing schematics when edit sheets. Rewrite append schematic feature to handle import issues rather than change the name and file name of all of the sheets in the imported schematic. This includes the following: - Load the schematic into a temporary SCH_SHEET object. - Make sure the imported schematic does not cause any hierarchy recursion issues. - Verify the imported schematic uses fully qualified #LIB_ID objects (symbol library table). - Check to see if any symbol libraries need to be added to the current project's symbol library table. This includes: - Check if the symbol library already exists in the project or global symbol library table. - Convert symbol library URLS that use the ${KIPRJMOD} environment variable to absolute paths. ${KIPRJMOD} will not be the same for this project. - Check for duplicate symbol library nicknames and change the new symbol library nickname to prevent library name clashes. - Update all schematic symbol LIB_ID object library nicknames when the library nickname was changed to prevent clashes. - Check for duplicate sheet names which is illegal and automatically rename any duplicate sheets in the imported schematic. - Clear all of the annotation in the imported schematic to prevent clashes. - Append the objects from the temporary sheet to the current page. - Replace any duplicate time stamps. - Refresh the symbol library links. Add support code to SCH_SCREEN object to assist with schematic import. Doxygen comment cleaning. Fixes lp:1731760 https://bugs.launchpad.net/kicad/+bug/1731760
8 years ago
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
6 years ago
Use legacy schematic plugin for loading schematics in all code paths. Use the legacy plugin schematic loader in the sheet edit and append schematic code paths. Check for fully qualified LIB_ID objects (must have library nickname) when loading existing schematics when edit sheets. Rewrite append schematic feature to handle import issues rather than change the name and file name of all of the sheets in the imported schematic. This includes the following: - Load the schematic into a temporary SCH_SHEET object. - Make sure the imported schematic does not cause any hierarchy recursion issues. - Verify the imported schematic uses fully qualified #LIB_ID objects (symbol library table). - Check to see if any symbol libraries need to be added to the current project's symbol library table. This includes: - Check if the symbol library already exists in the project or global symbol library table. - Convert symbol library URLS that use the ${KIPRJMOD} environment variable to absolute paths. ${KIPRJMOD} will not be the same for this project. - Check for duplicate symbol library nicknames and change the new symbol library nickname to prevent library name clashes. - Update all schematic symbol LIB_ID object library nicknames when the library nickname was changed to prevent clashes. - Check for duplicate sheet names which is illegal and automatically rename any duplicate sheets in the imported schematic. - Clear all of the annotation in the imported schematic to prevent clashes. - Append the objects from the temporary sheet to the current page. - Replace any duplicate time stamps. - Refresh the symbol library links. Add support code to SCH_SCREEN object to assist with schematic import. Doxygen comment cleaning. Fixes lp:1731760 https://bugs.launchpad.net/kicad/+bug/1731760
8 years ago
Use legacy schematic plugin for loading schematics in all code paths. Use the legacy plugin schematic loader in the sheet edit and append schematic code paths. Check for fully qualified LIB_ID objects (must have library nickname) when loading existing schematics when edit sheets. Rewrite append schematic feature to handle import issues rather than change the name and file name of all of the sheets in the imported schematic. This includes the following: - Load the schematic into a temporary SCH_SHEET object. - Make sure the imported schematic does not cause any hierarchy recursion issues. - Verify the imported schematic uses fully qualified #LIB_ID objects (symbol library table). - Check to see if any symbol libraries need to be added to the current project's symbol library table. This includes: - Check if the symbol library already exists in the project or global symbol library table. - Convert symbol library URLS that use the ${KIPRJMOD} environment variable to absolute paths. ${KIPRJMOD} will not be the same for this project. - Check for duplicate symbol library nicknames and change the new symbol library nickname to prevent library name clashes. - Update all schematic symbol LIB_ID object library nicknames when the library nickname was changed to prevent clashes. - Check for duplicate sheet names which is illegal and automatically rename any duplicate sheets in the imported schematic. - Clear all of the annotation in the imported schematic to prevent clashes. - Append the objects from the temporary sheet to the current page. - Replace any duplicate time stamps. - Refresh the symbol library links. Add support code to SCH_SCREEN object to assist with schematic import. Doxygen comment cleaning. Fixes lp:1731760 https://bugs.launchpad.net/kicad/+bug/1731760
8 years ago
Use legacy schematic plugin for loading schematics in all code paths. Use the legacy plugin schematic loader in the sheet edit and append schematic code paths. Check for fully qualified LIB_ID objects (must have library nickname) when loading existing schematics when edit sheets. Rewrite append schematic feature to handle import issues rather than change the name and file name of all of the sheets in the imported schematic. This includes the following: - Load the schematic into a temporary SCH_SHEET object. - Make sure the imported schematic does not cause any hierarchy recursion issues. - Verify the imported schematic uses fully qualified #LIB_ID objects (symbol library table). - Check to see if any symbol libraries need to be added to the current project's symbol library table. This includes: - Check if the symbol library already exists in the project or global symbol library table. - Convert symbol library URLS that use the ${KIPRJMOD} environment variable to absolute paths. ${KIPRJMOD} will not be the same for this project. - Check for duplicate symbol library nicknames and change the new symbol library nickname to prevent library name clashes. - Update all schematic symbol LIB_ID object library nicknames when the library nickname was changed to prevent clashes. - Check for duplicate sheet names which is illegal and automatically rename any duplicate sheets in the imported schematic. - Clear all of the annotation in the imported schematic to prevent clashes. - Append the objects from the temporary sheet to the current page. - Replace any duplicate time stamps. - Refresh the symbol library links. Add support code to SCH_SCREEN object to assist with schematic import. Doxygen comment cleaning. Fixes lp:1731760 https://bugs.launchpad.net/kicad/+bug/1731760
8 years ago
Use legacy schematic plugin for loading schematics in all code paths. Use the legacy plugin schematic loader in the sheet edit and append schematic code paths. Check for fully qualified LIB_ID objects (must have library nickname) when loading existing schematics when edit sheets. Rewrite append schematic feature to handle import issues rather than change the name and file name of all of the sheets in the imported schematic. This includes the following: - Load the schematic into a temporary SCH_SHEET object. - Make sure the imported schematic does not cause any hierarchy recursion issues. - Verify the imported schematic uses fully qualified #LIB_ID objects (symbol library table). - Check to see if any symbol libraries need to be added to the current project's symbol library table. This includes: - Check if the symbol library already exists in the project or global symbol library table. - Convert symbol library URLS that use the ${KIPRJMOD} environment variable to absolute paths. ${KIPRJMOD} will not be the same for this project. - Check for duplicate symbol library nicknames and change the new symbol library nickname to prevent library name clashes. - Update all schematic symbol LIB_ID object library nicknames when the library nickname was changed to prevent clashes. - Check for duplicate sheet names which is illegal and automatically rename any duplicate sheets in the imported schematic. - Clear all of the annotation in the imported schematic to prevent clashes. - Append the objects from the temporary sheet to the current page. - Replace any duplicate time stamps. - Refresh the symbol library links. Add support code to SCH_SCREEN object to assist with schematic import. Doxygen comment cleaning. Fixes lp:1731760 https://bugs.launchpad.net/kicad/+bug/1731760
8 years ago
Use legacy schematic plugin for loading schematics in all code paths. Use the legacy plugin schematic loader in the sheet edit and append schematic code paths. Check for fully qualified LIB_ID objects (must have library nickname) when loading existing schematics when edit sheets. Rewrite append schematic feature to handle import issues rather than change the name and file name of all of the sheets in the imported schematic. This includes the following: - Load the schematic into a temporary SCH_SHEET object. - Make sure the imported schematic does not cause any hierarchy recursion issues. - Verify the imported schematic uses fully qualified #LIB_ID objects (symbol library table). - Check to see if any symbol libraries need to be added to the current project's symbol library table. This includes: - Check if the symbol library already exists in the project or global symbol library table. - Convert symbol library URLS that use the ${KIPRJMOD} environment variable to absolute paths. ${KIPRJMOD} will not be the same for this project. - Check for duplicate symbol library nicknames and change the new symbol library nickname to prevent library name clashes. - Update all schematic symbol LIB_ID object library nicknames when the library nickname was changed to prevent clashes. - Check for duplicate sheet names which is illegal and automatically rename any duplicate sheets in the imported schematic. - Clear all of the annotation in the imported schematic to prevent clashes. - Append the objects from the temporary sheet to the current page. - Replace any duplicate time stamps. - Refresh the symbol library links. Add support code to SCH_SCREEN object to assist with schematic import. Doxygen comment cleaning. Fixes lp:1731760 https://bugs.launchpad.net/kicad/+bug/1731760
8 years ago
Use legacy schematic plugin for loading schematics in all code paths. Use the legacy plugin schematic loader in the sheet edit and append schematic code paths. Check for fully qualified LIB_ID objects (must have library nickname) when loading existing schematics when edit sheets. Rewrite append schematic feature to handle import issues rather than change the name and file name of all of the sheets in the imported schematic. This includes the following: - Load the schematic into a temporary SCH_SHEET object. - Make sure the imported schematic does not cause any hierarchy recursion issues. - Verify the imported schematic uses fully qualified #LIB_ID objects (symbol library table). - Check to see if any symbol libraries need to be added to the current project's symbol library table. This includes: - Check if the symbol library already exists in the project or global symbol library table. - Convert symbol library URLS that use the ${KIPRJMOD} environment variable to absolute paths. ${KIPRJMOD} will not be the same for this project. - Check for duplicate symbol library nicknames and change the new symbol library nickname to prevent library name clashes. - Update all schematic symbol LIB_ID object library nicknames when the library nickname was changed to prevent clashes. - Check for duplicate sheet names which is illegal and automatically rename any duplicate sheets in the imported schematic. - Clear all of the annotation in the imported schematic to prevent clashes. - Append the objects from the temporary sheet to the current page. - Replace any duplicate time stamps. - Refresh the symbol library links. Add support code to SCH_SCREEN object to assist with schematic import. Doxygen comment cleaning. Fixes lp:1731760 https://bugs.launchpad.net/kicad/+bug/1731760
8 years ago
Use legacy schematic plugin for loading schematics in all code paths. Use the legacy plugin schematic loader in the sheet edit and append schematic code paths. Check for fully qualified LIB_ID objects (must have library nickname) when loading existing schematics when edit sheets. Rewrite append schematic feature to handle import issues rather than change the name and file name of all of the sheets in the imported schematic. This includes the following: - Load the schematic into a temporary SCH_SHEET object. - Make sure the imported schematic does not cause any hierarchy recursion issues. - Verify the imported schematic uses fully qualified #LIB_ID objects (symbol library table). - Check to see if any symbol libraries need to be added to the current project's symbol library table. This includes: - Check if the symbol library already exists in the project or global symbol library table. - Convert symbol library URLS that use the ${KIPRJMOD} environment variable to absolute paths. ${KIPRJMOD} will not be the same for this project. - Check for duplicate symbol library nicknames and change the new symbol library nickname to prevent library name clashes. - Update all schematic symbol LIB_ID object library nicknames when the library nickname was changed to prevent clashes. - Check for duplicate sheet names which is illegal and automatically rename any duplicate sheets in the imported schematic. - Clear all of the annotation in the imported schematic to prevent clashes. - Append the objects from the temporary sheet to the current page. - Replace any duplicate time stamps. - Refresh the symbol library links. Add support code to SCH_SCREEN object to assist with schematic import. Doxygen comment cleaning. Fixes lp:1731760 https://bugs.launchpad.net/kicad/+bug/1731760
8 years ago
Use legacy schematic plugin for loading schematics in all code paths. Use the legacy plugin schematic loader in the sheet edit and append schematic code paths. Check for fully qualified LIB_ID objects (must have library nickname) when loading existing schematics when edit sheets. Rewrite append schematic feature to handle import issues rather than change the name and file name of all of the sheets in the imported schematic. This includes the following: - Load the schematic into a temporary SCH_SHEET object. - Make sure the imported schematic does not cause any hierarchy recursion issues. - Verify the imported schematic uses fully qualified #LIB_ID objects (symbol library table). - Check to see if any symbol libraries need to be added to the current project's symbol library table. This includes: - Check if the symbol library already exists in the project or global symbol library table. - Convert symbol library URLS that use the ${KIPRJMOD} environment variable to absolute paths. ${KIPRJMOD} will not be the same for this project. - Check for duplicate symbol library nicknames and change the new symbol library nickname to prevent library name clashes. - Update all schematic symbol LIB_ID object library nicknames when the library nickname was changed to prevent clashes. - Check for duplicate sheet names which is illegal and automatically rename any duplicate sheets in the imported schematic. - Clear all of the annotation in the imported schematic to prevent clashes. - Append the objects from the temporary sheet to the current page. - Replace any duplicate time stamps. - Refresh the symbol library links. Add support code to SCH_SCREEN object to assist with schematic import. Doxygen comment cleaning. Fixes lp:1731760 https://bugs.launchpad.net/kicad/+bug/1731760
8 years ago
Use legacy schematic plugin for loading schematics in all code paths. Use the legacy plugin schematic loader in the sheet edit and append schematic code paths. Check for fully qualified LIB_ID objects (must have library nickname) when loading existing schematics when edit sheets. Rewrite append schematic feature to handle import issues rather than change the name and file name of all of the sheets in the imported schematic. This includes the following: - Load the schematic into a temporary SCH_SHEET object. - Make sure the imported schematic does not cause any hierarchy recursion issues. - Verify the imported schematic uses fully qualified #LIB_ID objects (symbol library table). - Check to see if any symbol libraries need to be added to the current project's symbol library table. This includes: - Check if the symbol library already exists in the project or global symbol library table. - Convert symbol library URLS that use the ${KIPRJMOD} environment variable to absolute paths. ${KIPRJMOD} will not be the same for this project. - Check for duplicate symbol library nicknames and change the new symbol library nickname to prevent library name clashes. - Update all schematic symbol LIB_ID object library nicknames when the library nickname was changed to prevent clashes. - Check for duplicate sheet names which is illegal and automatically rename any duplicate sheets in the imported schematic. - Clear all of the annotation in the imported schematic to prevent clashes. - Append the objects from the temporary sheet to the current page. - Replace any duplicate time stamps. - Refresh the symbol library links. Add support code to SCH_SCREEN object to assist with schematic import. Doxygen comment cleaning. Fixes lp:1731760 https://bugs.launchpad.net/kicad/+bug/1731760
8 years ago
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
  1. /*
  2. * This program source code file is part of KiCad, a free EDA CAD application.
  3. *
  4. * Copyright (C) 2015 Jean-Pierre Charras, jp.charras wanadoo.fr
  5. * Copyright (C) 2008 Wayne Stambaugh <stambaughw@gmail.com>
  6. * Copyright (C) 2004-2022 KiCad Developers, see AUTHORS.txt for contributors.
  7. *
  8. * This program is free software; you can redistribute it and/or
  9. * modify it under the terms of the GNU General Public License
  10. * as published by the Free Software Foundation; either version 2
  11. * of the License, or (at your option) any later version.
  12. *
  13. * This program is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. * GNU General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU General Public License
  19. * along with this program; if not, you may find one here:
  20. * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
  21. * or you may search the http://www.gnu.org website for the version 2 license,
  22. * or you may write to the Free Software Foundation, Inc.,
  23. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
  24. */
  25. #ifndef SCH_EDIT_FRAME_H
  26. #define SCH_EDIT_FRAME_H
  27. #include <stddef.h>
  28. #include <vector>
  29. #include <wx/cmndata.h>
  30. #include <wx/event.h>
  31. #include <wx/gdicmn.h>
  32. #include <wx/string.h>
  33. #include <wx/utils.h>
  34. #include <config_params.h>
  35. #include <core/typeinfo.h>
  36. #include <eda_base_frame.h>
  37. #include <eeschema_settings.h>
  38. #include <math/box2.h>
  39. #include <sch_base_frame.h>
  40. #include <template_fieldnames.h>
  41. class SCH_ITEM;
  42. class EDA_ITEM;
  43. class SCH_LINE;
  44. class SCH_TEXT;
  45. class SCH_BITMAP;
  46. class SCH_SHEET;
  47. class SCH_SHEET_PATH;
  48. class SCH_SHEET_PIN;
  49. class SCH_SYMBOL;
  50. class SCH_FIELD;
  51. class SCH_JUNCTION;
  52. class SCHEMATIC;
  53. class DIALOG_SCH_FIND;
  54. class wxFindReplaceData;
  55. class RESCUER;
  56. class HIERARCHY_PANE;
  57. // @todo Move this to transform alone with all of the transform manipulation code.
  58. /// enum used in RotationMiroir()
  59. enum SYMBOL_ORIENTATION_T
  60. {
  61. SYM_NORMAL, // Normal orientation, no rotation or mirror
  62. SYM_ROTATE_CLOCKWISE, // Rotate -90
  63. SYM_ROTATE_COUNTERCLOCKWISE, // Rotate +90
  64. SYM_ORIENT_0, // No rotation and no mirror id SYM_NORMAL
  65. SYM_ORIENT_90, // Rotate 90, no mirror
  66. SYM_ORIENT_180, // Rotate 180, no mirror
  67. SYM_ORIENT_270, // Rotate -90, no mirror
  68. SYM_MIRROR_X = 0x100, // Mirror around X axis
  69. SYM_MIRROR_Y = 0x200 // Mirror around Y axis
  70. };
  71. /// Schematic search type used by the socket link with Pcbnew
  72. enum SCH_SEARCH_T
  73. {
  74. HIGHLIGHT_PIN,
  75. HIGHLIGHT_SYMBOL
  76. };
  77. enum SCH_CLEANUP_FLAGS
  78. {
  79. NO_CLEANUP,
  80. LOCAL_CLEANUP,
  81. GLOBAL_CLEANUP
  82. };
  83. /**
  84. * Schematic editor (Eeschema) main window.
  85. */
  86. class SCH_EDIT_FRAME : public SCH_BASE_FRAME
  87. {
  88. public:
  89. SCH_EDIT_FRAME( KIWAY* aKiway, wxWindow* aParent );
  90. ~SCH_EDIT_FRAME() override;
  91. SCH_SCREEN* GetScreen() const override;
  92. SELECTION& GetCurrentSelection() override;
  93. SCHEMATIC& Schematic() const;
  94. /**
  95. * Allow edit frame to show/hide hidden pins.
  96. */
  97. bool GetShowAllPins() const override;
  98. /**
  99. * Save changes to the project settings to the project (.pro) file.
  100. */
  101. void SaveProjectLocalSettings() override;
  102. /**
  103. * Load the KiCad project file (*.pro) settings specific to Eeschema.
  104. *
  105. * @return True if the project file was loaded correctly.
  106. */
  107. bool LoadProjectSettings();
  108. void ShowSchematicSetupDialog( const wxString& aInitialPage = wxEmptyString );
  109. void LoadSettings( APP_SETTINGS_BASE* aCfg ) override;
  110. void SaveSettings( APP_SETTINGS_BASE* aCfg ) override;
  111. void CreateScreens();
  112. void ReCreateHToolbar() override;
  113. void ReCreateVToolbar() override;
  114. void ReCreateOptToolbar() override;
  115. void setupUIConditions() override;
  116. /**
  117. * Get if the current schematic has been modified but not saved.
  118. *
  119. * @return true if the any changes have not been saved
  120. */
  121. bool IsContentModified() const override;
  122. /**
  123. * Must be called after a schematic change in order to set the "modify" flag and update other
  124. * data structures and GUI elements.
  125. */
  126. void OnModify() override;
  127. /**
  128. * Scan existing markers and record data from any that are Excluded.
  129. */
  130. void RecordERCExclusions();
  131. /**
  132. * Update markers to match recorded exclusions.
  133. */
  134. void ResolveERCExclusions();
  135. SEVERITY GetSeverity( int aErrorCode ) const override;
  136. /**
  137. * Return a human-readable description of the current screen.
  138. */
  139. wxString GetScreenDesc() const override;
  140. /**
  141. * Execute a remote command sent via a socket on port KICAD_SCH_PORT_SERVICE_NUMBER (which
  142. * defaults to 4243).
  143. *
  144. * When user selects a footprint or pin in Pcbnew, Eeschema shows that same symbol or pin
  145. * and moves cursor on the item.
  146. *
  147. * Valid commands are:
  148. * \li \c \$PART: \c "reference" Put cursor on symbol.
  149. * \li \c \$PART: \c "reference" \c \$REF: \c "ref" Put cursor on symbol reference.
  150. * \li \c \$PART: \c "reference" \c \$VAL: \c "value" Put cursor on symbol value.
  151. * \li \c \$PART: \c "reference" \c \$PAD: \c "pin name" Put cursor on the symbol pin.
  152. * \li \c \$NET: \c "netname" Highlight a specified net
  153. * \li \c \$CLEAR: \c "HIGHLIGHTED" Clear symbols highlight
  154. * <p>
  155. * They are a keyword followed by a quoted string.
  156. * @param cmdline is the command received from Pcbnew.
  157. */
  158. void ExecuteRemoteCommand( const char* cmdline ) override;
  159. void KiwayMailIn( KIWAY_EXPRESS& aEvent ) override;
  160. /**
  161. * Refresh the display of any operating points. Called after a .op simulation completes.
  162. */
  163. void RefreshOperatingPointDisplay();
  164. /**
  165. * Automatically set the rotation of an item (if the item supports it)
  166. */
  167. void AutoRotateItem( SCH_SCREEN* aScreen, SCH_ITEM* aItem );
  168. /**
  169. * Add an item to the schematic and adds the changes to the undo/redo container.
  170. * @param aUndoAppend True if the action should be appended to the current undo record.
  171. */
  172. void AddItemToScreenAndUndoList( SCH_SCREEN* aScreen, SCH_ITEM* aItem, bool aUndoAppend );
  173. /**
  174. * Run the Find or Find & Replace dialog.
  175. */
  176. void ShowFindReplaceDialog( bool aReplace );
  177. /**
  178. * Update the hierarchy navigation tree and history
  179. */
  180. void UpdateHierarchyNavigator();
  181. /**
  182. * Update the hierarchy navigation tree selection (cross-probe from schematic to hierarchy
  183. * pane).
  184. */
  185. void UpdateHierarchySelection();
  186. void ShowFindReplaceStatus( const wxString& aMsg, int aStatusTime );
  187. void ClearFindReplaceStatus();
  188. /**
  189. * Notification that the Find dialog has closed.
  190. */
  191. void OnFindDialogClose();
  192. /**
  193. * Break a single segment into two at the specified point.
  194. *
  195. * @note This always appends to the existing undo state.
  196. *
  197. * @param aSegment Line segment to break
  198. * @param aPoint Point at which to break the segment
  199. * @param aNewSegment Pointer to the newly created segment (if given and created)
  200. * @param aScreen is the screen to examine, or nullptr to examine the current screen.
  201. */
  202. void BreakSegment( SCH_LINE* aSegment, const VECTOR2I& aPoint,
  203. SCH_LINE** aNewSegment = nullptr, SCH_SCREEN* aScreen = nullptr );
  204. /**
  205. * Check every wire and bus for a intersection at \a aPoint and break into two segments
  206. * at \a aPoint if an intersection is found.
  207. *
  208. * @note This always appends to the existing undo state.
  209. *
  210. * @param aPoint Test this point for an intersection.
  211. * @param aScreen is the screen to examine, or nullptr to examine the current screen.
  212. * @return True if any wires or buses were broken.
  213. */
  214. bool BreakSegments( const VECTOR2I& aPoint, SCH_SCREEN* aScreen = nullptr );
  215. /**
  216. * Test all junctions and bus entries in the schematic for intersections with wires and
  217. * buses and breaks any intersections into multiple segments.
  218. *
  219. * @note This always appends to the existing undo state.
  220. *
  221. * @param aScreen is the screen to examine, or nullptr to examine the current screen
  222. * @return True if any wires or buses were broken.
  223. */
  224. bool BreakSegmentsOnJunctions( SCH_SCREEN* aScreen = nullptr );
  225. /**
  226. * Test all of the connectable objects in the schematic for unused connection points.
  227. * @return True if any connection state changes were made.
  228. */
  229. void TestDanglingEnds();
  230. /**
  231. * Sends items to Pcbnew for selection
  232. *
  233. * @param aItems are the items to select
  234. * @param aForce select the element in pcbnew whether or not the user has the select option chosen
  235. * This is used for when the eeschema user is using the cross-probe tool
  236. */
  237. void SendSelectItemsToPcb( const std::vector<EDA_ITEM*>& aItems, bool aForce );
  238. /**
  239. * Sends a net name to Pcbnew for highlighting
  240. *
  241. * @param aNetName is the name of a net, or empty string to clear highlight
  242. */
  243. void SendCrossProbeNetName( const wxString& aNetName );
  244. /**
  245. * Send a connection (net or bus) to Pcbnew for highlighting.
  246. *
  247. * @param aConnection is the connection to highlight
  248. */
  249. void SetCrossProbeConnection( const SCH_CONNECTION* aConnection );
  250. /**
  251. * Tell Pcbnew to clear the existing highlighted net, if one exists
  252. */
  253. void SendCrossProbeClearHighlight();
  254. const SCH_CONNECTION* GetHighlightedConnection() const
  255. {
  256. return m_highlightedConn;
  257. }
  258. void SetHighlightedConnection( const SCH_CONNECTION* aConnection )
  259. {
  260. m_highlightedConn = aConnection;
  261. }
  262. /**
  263. * Check if we are ready to write a netlist file for the current schematic.
  264. *
  265. * Test for some issues (missing or duplicate references and sheet names).
  266. *
  267. * @param aAnnotateMessage a message to put up in case annotation needs to be performed.
  268. * @return true if all is well (i.e. you can call WriteNetListFile next).
  269. */
  270. bool ReadyToNetlist( const wxString& aAnnotateMessage );
  271. /**
  272. * Create a netlist file.
  273. *
  274. * @param aFormat is the netlist format (NET_TYPE_PCBNEW ...).
  275. * @param aFullFileName is the full netlist file name.
  276. * @param aNetlistOptions is the netlist options using OR'ed bits.
  277. * <p>
  278. * For SPICE netlist only:
  279. * if NET_USE_NETNAMES is set, use net names from labels in schematic
  280. * else use net numbers (net codes)
  281. * if NET_USE_X_PREFIX is set : change "U" and "IC" reference prefix to "X"
  282. * </p>
  283. * @param aReporter is a #REPORTER to report error messages, can be a nullptr.
  284. * @return true if success.
  285. */
  286. bool WriteNetListFile( int aFormat, const wxString& aFullFileName, unsigned aNetlistOptions,
  287. REPORTER* aReporter = nullptr );
  288. /**
  289. * Clear the current symbol annotation.
  290. *
  291. * @param aCurrentSheetOnly Where to clear the annotation. See #ANNOTATE_SCOPE_T
  292. * @param appendUndo true to add the action to the previous undo list
  293. */
  294. void DeleteAnnotation( ANNOTATE_SCOPE_T aAnnotateScope, bool aRecursive, bool* appendUndo );
  295. /**
  296. * Annotate the symbols in the schematic that are not currently annotated. Multi-unit symbols
  297. * are annotated together. E.g. if two symbols were R8A and R8B, they may become R3A and
  298. * R3B, but not R3A and R3C or R3C and R4D.
  299. *
  300. * @param aAnnotateScope See #ANNOTATE_SCOPE_T
  301. * @param aSortOption Define the annotation order. See #ANNOTATE_ORDER_T.
  302. * @param aAlgoOption Define the annotation style. See #ANNOTATE_ALGO_T.
  303. * @param aRecursive Annotation should descend into and annotate subsheets
  304. * @param aStartNumber The start number for non-sheet-based annotation styles.
  305. * @param aResetAnnotation Clear any previous annotation if true. Otherwise, keep the
  306. * existing symbol annotation.
  307. * @param aRepairTimestamps Test for and repair any duplicate time stamps if true.
  308. * Otherwise, keep the existing time stamps. This option
  309. * could change previous annotation because time stamps are
  310. * used to handle annotation in complex hierarchies.
  311. * @param aReporter A sink for error messages. Use NULL_REPORTER if you don't need errors.
  312. *
  313. * @param appendUndo True if the annotation operation should be added to an existing undo,
  314. * false if it should be separately undo-able.
  315. *
  316. * When the sheet number is used in annotation, each sheet annotation starts from sheet
  317. * number * 100. In other words the first sheet uses 100 to 199, the second sheet uses
  318. * 200 to 299, and so on.
  319. */
  320. void AnnotateSymbols( ANNOTATE_SCOPE_T aAnnotateScope, ANNOTATE_ORDER_T aSortOption,
  321. ANNOTATE_ALGO_T aAlgoOption, bool aRecursive, int aStartNumber,
  322. bool aResetAnnotation, bool aRepairTimestamps, REPORTER& aReporter,
  323. bool appendUndo = false );
  324. /**
  325. * Check for annotation errors.
  326. *
  327. * The following list of items are checked:
  328. * - Symbols that are not annotated.
  329. * - Duplicate symbol references.
  330. * - Multiple part per package symbols where the part number is greater number of parts in
  331. * the package.
  332. * - Multiple part per package symbols where the reference designator is different between
  333. * parts.
  334. *
  335. * @return Number of annotation errors found.
  336. * @param aReporter A handler for error reporting.
  337. * @param aAnnotateScope See #ANNOTATE_SCOPE_T Check the current sheet only if true.
  338. * Otherwise check the entire schematic.
  339. */
  340. int CheckAnnotate( ANNOTATION_ERROR_HANDLER aErrorHandler,
  341. ANNOTATE_SCOPE_T aAnnotateScope = ANNOTATE_ALL,
  342. bool aRecursive = true );
  343. /**
  344. * Run a modal version of the annotate dialog for a specific purpose.
  345. *
  346. * @param aMessage A user message indicating the purpose.
  347. * @return the result of ShowModal()
  348. */
  349. int ModalAnnotate( const wxString& aMessage );
  350. // Functions used for hierarchy handling
  351. SCH_SHEET_PATH& GetCurrentSheet() const;
  352. void SetCurrentSheet( const SCH_SHEET_PATH& aSheet );
  353. void UpdateItem( EDA_ITEM* aItem, bool isAddOrDelete = false,
  354. bool aUpdateRtree = false ) override;
  355. /**
  356. * Rebuild the GAL and redraw the screen. Call when something went wrong.
  357. */
  358. void HardRedraw() override;
  359. /**
  360. * Draw the current sheet on the display.
  361. */
  362. void DisplayCurrentSheet();
  363. /**
  364. * Use the wxWidgets print code to draw an image of the current sheet onto the clipboard.
  365. */
  366. void DrawCurrentSheetToClipboard();
  367. /**
  368. * Called when modifying the page settings.
  369. *
  370. * In derived classes it can be used to modify parameters like draw area size, and any other
  371. * local parameter related to the page settings.
  372. */
  373. void OnPageSettingsChange() override;
  374. /**
  375. * Set the m_ScreenNumber and m_NumberOfScreens members for screens.
  376. *
  377. * @note This must be called after deleting or adding a sheet and when entering a sheet.
  378. */
  379. void SetSheetNumberAndCount();
  380. wxPageSetupDialogData& GetPageSetupData() { return m_pageSetupData; }
  381. void NewProject();
  382. void LoadProject();
  383. /**
  384. * Save the currently-open schematic (including its hierarchy) and associated project.
  385. *
  386. * @param aSaveAs is true to perform a Save As operation (rename the schematic and project).
  387. * This may only be done in standalone mode.
  388. * @return true if the schematic was saved
  389. */
  390. bool SaveProject( bool aSaveAs = false );
  391. bool OpenProjectFiles( const std::vector<wxString>& aFileSet, int aCtl = 0 ) override;
  392. wxString GetCurrentFileName() const override;
  393. /**
  394. * Import a KiCad schematic into the current sheet.
  395. *
  396. * @return True if the schematic was imported properly.
  397. */
  398. bool AppendSchematic();
  399. /**
  400. * Add a sheet file into the current sheet and updates display
  401. *
  402. * @note Used in AppendSchematic() and SCH_EDIT_TOOL::ddAppendFile() (so it is public)
  403. *
  404. * @param aFullFileName Path and name of sheet
  405. * @return True if the sheet was properly added
  406. */
  407. bool AddSheetAndUpdateDisplay( const wxString aFullFileName );
  408. /**
  409. * Check if any of the screens has unsaved changes and asks the user whether to save or
  410. * drop them.
  411. *
  412. * @return True if user decided to save or drop changes, false if the operation should be
  413. * canceled.
  414. */
  415. bool AskToSaveChanges();
  416. SCH_JUNCTION* AddJunction( SCH_SCREEN* aScreen, const VECTOR2I& aPos, bool aAppendToUndo,
  417. bool aFinal = true );
  418. /**
  419. * Perform routine schematic cleaning including breaking wire and buses and deleting
  420. * identical objects superimposed on top of each other.
  421. *
  422. * @note This always appends to the existing undo state.
  423. *
  424. * @param aScreen is the screen to examine, or nullptr to examine the current screen
  425. * @return True if any schematic clean up was performed.
  426. */
  427. bool SchematicCleanUp( SCH_SCREEN* aScreen = nullptr );
  428. /**
  429. * If any single wire passes through _both points_, remove the portion between the two points,
  430. * potentially splitting the wire into two.
  431. *
  432. * @note This always appends to the existing undo state.
  433. *
  434. * @param aStart The starting point for trimmming
  435. * @param aEnd The ending point for trimming
  436. * @return True if any wires were changed by this operation
  437. */
  438. bool TrimWire( const VECTOR2I& aStart, const VECTOR2I& aEnd );
  439. void OnOpenPcbnew( wxCommandEvent& event );
  440. void OnOpenCvpcb( wxCommandEvent& event );
  441. void OnUpdatePCB( wxCommandEvent& event );
  442. void OnAnnotate( wxCommandEvent& event );
  443. /**
  444. * Verify that \a aSheet will not cause a recursion error in \a aHierarchy.
  445. *
  446. * @param aSheet is the #SCH_SHEET object to test.
  447. * @param aHierarchy is the #SCH_SHEET_PATH where \a aSheet is going to reside.
  448. *
  449. * @return true if \a aSheet will cause a recursion error in \a aHierarchy.
  450. */
  451. bool CheckSheetForRecursion( SCH_SHEET* aSheet, SCH_SHEET_PATH* aHierarchy );
  452. /**
  453. * Check \a aSchematicFileName for a potential file name case sensitivity clashes.
  454. *
  455. * On platforms where file names are case sensitive, it is possible to schematic sheet
  456. * file names that would cause issues on platforms where file name are case insensitive.
  457. * File names foo.sch and Foo.sch are unique files on Linux and MacOS but on Windows
  458. * this would result in a broken schematic.
  459. *
  460. * @param aSchematicFileName is the absolute path and file name of the file to test.
  461. * @return true if the user accepts the potential file name clash risk.
  462. */
  463. bool AllowCaseSensitiveFileNameClashes( const wxString& aSchematicFileName );
  464. /**
  465. * Edit an existing sheet or add a new sheet to the schematic.
  466. *
  467. * When \a aSheet is a new sheet:
  468. * - and the file name already exists in the schematic hierarchy, the screen associated
  469. * with the sheet found in the hierarchy is associated with \a aSheet.
  470. * - and the file name already exists on the system, then \a aSheet is loaded with the
  471. * existing file.
  472. * - and the file name does not exist in the schematic hierarchy or on the file system,
  473. * then a new screen is created and associated with \a aSheet.
  474. *
  475. * When \a aSheet is an existing sheet:
  476. * - and the file name already exists in the schematic hierarchy, the current associated
  477. * screen is replace by the one found in the hierarchy.
  478. * - and the file name already exists on the system, the current associated screen file
  479. * name is changed and the file is loaded.
  480. * - and the file name does not exist in the schematic hierarchy or on the file system,
  481. * the current associated screen file name is changed and saved to disk.
  482. *
  483. * Note: the screen is not refresh. The caller is responsible to do that
  484. *
  485. * @param aSheet is the sheet to edit
  486. * @param aHierarchy is the current hierarchy containing aSheet
  487. * @param aClearAnnotationNewItems is a reference to a bool to know if the items managed by
  488. * this sheet need to have their annotation cleared i.e. when an existing item list is used.
  489. * it can happens when the edited sheet used an existing file, or becomes a new instance
  490. * of a already existing sheet.
  491. */
  492. bool EditSheetProperties( SCH_SHEET* aSheet, SCH_SHEET_PATH* aHierarchy,
  493. bool* aClearAnnotationNewItems );
  494. void InitSheet( SCH_SHEET* aSheet, const wxString& aNewFilename );
  495. /**
  496. * Load a the KiCad schematic file \a aFileName into the sheet \a aSheet.
  497. *
  498. * If \a aSheet does not have a valid #SCH_SCREEN object, the schematic is loaded into
  499. * \a Sheet. Otherwise, it is appended to the current #SCH_SCREEN object.
  500. *
  501. * In order to import a schematic a lot of things have to happen to before the contents
  502. * of the imported schematic can be appended to the current page. The following list
  503. * describes this process:
  504. *
  505. * - Load the schematic into a temporary #SCH_SHEET object.
  506. * - Make sure the imported schematic does not cause any hierarchy recursion issues.
  507. * - Verify the imported schematic uses fully qualified #LIB_ID objects (symbol library table).
  508. * - Check all of the possible combinations that could cause broken symbol library links
  509. * and give the user the option to cancel the append process. The following conditions
  510. * are check but they still do not guarantee that there will not be any broken symbol
  511. * library links:
  512. * - The source schematic is in the current project path and contains symbol library
  513. * nicknames not found in the project symbol library table. This can happen if the
  514. * schematic is copied to the current project path from another project.
  515. * - The source schematic is in a different path and there are symbol library link nicknames
  516. * that do not exist in either the current symbol library table or the source project
  517. * symbol library table if it exists in the source path.
  518. * - The source schematic is in a different path and contains duplicate symbol library
  519. * nicknames that point to different libraries.
  520. * - Check to see if any symbol libraries need to be added to the current project's symbol
  521. * library table. This includes:
  522. * - Check if the symbol library already exists in the project or global symbol library
  523. * table.
  524. * - Convert symbol library URLS that use the ${KIPRJMOD} environment variable to absolute
  525. * paths. ${KIPRJMOD} will not be the same for this project.
  526. * - Clear all of the annotation in the imported schematic to prevent clashes.
  527. * - Append the objects from the temporary sheet to the current page.
  528. * - Replace any duplicate time stamps.
  529. * - Refresh the symbol library links.
  530. *
  531. * @param aSheet is the sheet to either append or load the schematic.
  532. * @param aHierarchy is the current position in the schematic hierarchy used to test for
  533. * possible file recursion issues.
  534. * @param aFileName is the file name to load. The file name is expected to have an absolute
  535. * path.
  536. *
  537. * @return True if the schematic was imported properly.
  538. */
  539. bool LoadSheetFromFile( SCH_SHEET* aSheet, SCH_SHEET_PATH* aHierarchy,
  540. const wxString& aFileName );
  541. /**
  542. * Removes a given junction and heals any wire segments under the junction
  543. *
  544. * @param aItem The junction to delete
  545. * @param aAppend True if we are updating an ongoing commit
  546. */
  547. void DeleteJunction( SCH_ITEM* aItem, bool aAppend = false );
  548. void ConvertPart( SCH_SYMBOL* aSymbol );
  549. void SelectUnit( SCH_SYMBOL* aSymbol, int aUnit );
  550. /* Undo - redo */
  551. /**
  552. * Create a new, blank stack for future Undo commands to be pushed to
  553. */
  554. void StartNewUndo();
  555. /**
  556. * Create a copy of the current schematic item, and put it in the undo list.
  557. *
  558. * aTypeCommand =
  559. * CHANGED
  560. * NEWITEM
  561. * DELETED
  562. *
  563. * If it is a delete command, items are put on list with the .Flags member
  564. * set to DELETED.
  565. *
  566. * @param aItemToCopy is the schematic item modified by the command to undo.
  567. * @param aTypeCommand is the command type (see enum UNDO_REDO).
  568. * @param aAppend set to true to add the item to the previous undo list.
  569. * @param aDirtyConnectivity set to true if the change can affect connectivity.
  570. */
  571. void SaveCopyInUndoList( SCH_SCREEN* aScreen, SCH_ITEM* aItemToCopy, UNDO_REDO aTypeCommand,
  572. bool aAppend, bool aDirtyConnectivity = true );
  573. /**
  574. * Create a new entry in undo list of commands.
  575. *
  576. * @param aItemsList is the list of items modified by the command to undo/
  577. * @param aTypeCommand is the command type (see enum UNDO_REDO).
  578. * @param aAppend set to true to add the item to the previous undo list.
  579. * @param aDirtyConnectivity set to true if the change can affect connectivity.
  580. */
  581. void SaveCopyInUndoList( const PICKED_ITEMS_LIST& aItemsList, UNDO_REDO aTypeCommand,
  582. bool aAppend, bool aDirtyConnectivity = true );
  583. /**
  584. * Restore an undo or redo command to put data pointed by \a aList in the previous state.
  585. *
  586. * @param aList a PICKED_ITEMS_LIST pointer to the list of items to undo/redo
  587. */
  588. void PutDataInPreviousState( PICKED_ITEMS_LIST* aList );
  589. /**
  590. * Free the undo or redo list from \a aList element.
  591. *
  592. * - Wrappers are deleted.
  593. * - data pointed by wrappers are deleted if not in use in schematic
  594. * i.e. when they are copy of a schematic item or they are no more in use (DELETED)
  595. *
  596. * @param whichList is the UNDO_REDO_CONTAINER to clear
  597. * @param aItemCount is the count of items to remove. Use < 0 to remove all items from
  598. * the beginning of the list.
  599. */
  600. void ClearUndoORRedoList( UNDO_REDO_LIST whichList, int aItemCount = -1 ) override;
  601. /**
  602. * Clone \a aItem and owns that clone in this container.
  603. */
  604. void SaveCopyForRepeatItem( const SCH_ITEM* aItem );
  605. void AddCopyForRepeatItem( const SCH_ITEM* aItem );
  606. /**
  607. * Return the items which are to be repeated with the insert key. Such objects are owned by
  608. * this container, and must be cloned.
  609. */
  610. const std::vector<std::unique_ptr<SCH_ITEM>>& GetRepeatItems() const
  611. {
  612. return m_items_to_repeat;
  613. }
  614. EDA_ITEM* GetItem( const KIID& aId ) const override;
  615. /**
  616. * Perform an undo of the last edit WITHOUT logging a corresponding redo. Used to cancel
  617. * an in-progress operation.
  618. */
  619. void RollbackSchematicFromUndo();
  620. /**
  621. * Create a symbol library file with the name of the root document plus the '-cache' suffix,
  622. *
  623. * This file will contain all symbols used in the current schematic.
  624. *
  625. * @param aUseCurrentSheetFilename set to false to use the root sheet filename
  626. * (default) or true to use the currently opened sheet.
  627. * @return true if the file was written successfully.
  628. */
  629. bool CreateArchiveLibraryCacheFile( bool aUseCurrentSheetFilename = false );
  630. /**
  631. * Create a library \a aFileName that contains all symbols used in the current schematic.
  632. *
  633. * @param aFileName The full path and file name of the archive library.
  634. * @return True if \a aFileName was written successfully.
  635. */
  636. bool CreateArchiveLibrary( const wxString& aFileName );
  637. /**
  638. * Plot or print the current sheet to the clipboard.
  639. */
  640. virtual void PrintPage( const RENDER_SETTINGS* aSettings ) override;
  641. void SetNetListerCommand( const wxString& aCommand ) { m_netListerCommand = aCommand; }
  642. /**
  643. * Reset the execution flags to defaults for external netlist and bom generators.
  644. */
  645. void DefaultExecFlags() { m_exec_flags = wxEXEC_SYNC; }
  646. /**
  647. * Set (adds) specified flags for next execution of external generator of the netlist or bom.
  648. *
  649. * @param aFlags is the wxEXEC_* flags, see wxExecute documentation.
  650. */
  651. void SetExecFlags( const int aFlags ) { m_exec_flags |= aFlags; }
  652. /**
  653. * Clear (removes) specified flags that not needed for next execution of external generator
  654. * of the netlist or bom.
  655. *
  656. * @param aFlags is the wxEXEC_* flags, see wxExecute documentation.
  657. */
  658. void ClearExecFlags( const int aFlags ) { m_exec_flags &= ~( aFlags ); }
  659. wxString GetNetListerCommand() const { return m_netListerCommand; }
  660. /**
  661. * Generate the connection data for the entire schematic hierarchy.
  662. */
  663. void RecalculateConnections( SCH_CLEANUP_FLAGS aCleanupFlags );
  664. /**
  665. * Called after the preferences dialog is run.
  666. */
  667. void CommonSettingsChanged( bool aEnvVarsChanged, bool aTextVarsChanged ) override;
  668. void UpdateNetHighlightStatus();
  669. void ShowChangedLanguage() override;
  670. void SetScreen( BASE_SCREEN* aScreen ) override;
  671. const BOX2I GetDocumentExtents( bool aIncludeAllVisible = true ) const override;
  672. int GetSchematicJunctionSize();
  673. void FocusOnItem( SCH_ITEM* aItem );
  674. bool IsSyncingSelection() { return m_syncingPcbToSchSelection; }
  675. /**
  676. * Update a schematic symbol from a LIB_SYMBOL.
  677. *
  678. * This is typically called from the symbol editor when editing symbols in place.
  679. *
  680. * @param aSymbol is the new symbol data.
  681. * @param aSchematicSymbolUUID refers to the schematic symbol to update.
  682. */
  683. void SaveSymbolToSchematic( const LIB_SYMBOL& aSymbol, const KIID& aSchematicSymbolUUID );
  684. /**
  685. * Update the schematic's page reference map for all global labels, and refresh the labels
  686. * so that they are redrawn with up-to-date references.
  687. */
  688. void RecomputeIntersheetRefs();
  689. void ShowAllIntersheetRefs( bool aShow );
  690. /**
  691. * This overloaded version checks if the auto save master file "#auto_saved_files#" exists
  692. * and recovers all of the schematic files listed in it.
  693. *
  694. * @param aFileName is the project auto save master file name.
  695. */
  696. virtual void CheckForAutoSaveFile( const wxFileName& aFileName ) override;
  697. /**
  698. * Toggle the show/hide state of the left side schematic navigation panel
  699. */
  700. void ToggleSchematicHierarchy();
  701. /**
  702. * @return the name of the wxAuiPaneInfo managing the Hierarchy Navigator panel
  703. */
  704. static const wxString SchematicHierarchyPaneName()
  705. {
  706. return wxT( "SchematicHierarchy" );
  707. }
  708. DECLARE_EVENT_TABLE()
  709. protected:
  710. /**
  711. * Save the schematic files that have been modified and not yet saved.
  712. *
  713. * @return true if the auto save was successful otherwise false.
  714. */
  715. bool doAutoSave() override;
  716. void doReCreateMenuBar() override;
  717. /**
  718. * Send the KiCad netlist over to CVPCB.
  719. */
  720. void sendNetlistToCvpcb();
  721. void onSize( wxSizeEvent& aEvent );
  722. void saveProjectSettings() override;
  723. private:
  724. // Called when resizing the Hierarchy Navigator panel
  725. void OnResizeHierarchyNavigator( wxSizeEvent& aEvent );
  726. // Sets up the tool framework
  727. void setupTools();
  728. void OnExit( wxCommandEvent& event );
  729. void OnLoadFile( wxCommandEvent& event );
  730. void OnAppendProject( wxCommandEvent& event );
  731. void OnImportProject( wxCommandEvent& event );
  732. void OnClearFileHistory( wxCommandEvent& aEvent );
  733. bool canCloseWindow( wxCloseEvent& aCloseEvent ) override;
  734. void doCloseWindow() override;
  735. /**
  736. * Set the main window title bar text.
  737. *
  738. * If file name defined by SCH_SCREEN::m_FileName is not set, the title is set to the
  739. * application name appended with no file.
  740. * Otherwise, the title is set to the hierarchical sheet path and the full file name, and
  741. * read only is appended to the title if the user does not have write access to the file.
  742. */
  743. void updateTitle();
  744. /**
  745. * Initialize the zoom value of the current screen and mark the screen as zoom-initialized.
  746. */
  747. void initScreenZoom();
  748. /**
  749. * Verify that the symbol library links \a aSheet and all of its child sheets have
  750. * been remapped to the symbol library table.
  751. *
  752. * @param aSheet is the #SCH_SHEET object to test.
  753. *
  754. * @return true if \a aSheet and its child sheets have not been remapped.
  755. */
  756. bool checkForNoFullyDefinedLibIds( SCH_SHEET* aSheet );
  757. /**
  758. * Load the given filename but sets the path to the current project path.
  759. *
  760. * @param full filepath of file to be imported.
  761. * @param aFileType SCH_FILE_T value for file type
  762. */
  763. bool importFile( const wxString& aFileName, int aFileType );
  764. /**
  765. * Save \a aSheet to a schematic file.
  766. *
  767. * @param aSheet is the #SCH_SHEET object to save.
  768. * @param aSavePath is the full path of the destination file
  769. * @return True if the file has been saved.
  770. */
  771. bool saveSchematicFile( SCH_SHEET* aSheet, const wxString& aSavePath );
  772. /**
  773. * Fill a map of uuid -> reference from the currently loaded schematic.
  774. *
  775. * @param aMap is a map to fill
  776. */
  777. void mapExistingAnnotation( std::map<wxString, wxString>& aMap );
  778. bool updateAutoSaveFile();
  779. const wxString& getAutoSaveFileName() const;
  780. private:
  781. // The schematic editor control class should be able to access some internal
  782. // functions of the editor frame.
  783. friend class SCH_EDITOR_CONTROL;
  784. friend class SCH_FIND_REPLACE_TOOL;
  785. SCHEMATIC* m_schematic; ///< The currently loaded schematic
  786. const SCH_CONNECTION* m_highlightedConn; ///< The highlighted net or bus, or nullptr
  787. wxPageSetupDialogData m_pageSetupData;
  788. std::vector<std::unique_ptr<SCH_ITEM>> m_items_to_repeat; ///< For the repeat-last-item cmd
  789. wxString m_netListerCommand; ///< Command line to call a custom net list
  790. ///< generator.
  791. int m_exec_flags; ///< Flags of the wxExecute() function
  792. ///< to call a custom net list generator.
  793. DIALOG_SCH_FIND* m_findReplaceDialog;
  794. HIERARCHY_PANE* m_hierarchy;
  795. bool m_syncingPcbToSchSelection; // Recursion guard when synchronizing selection from PCB
  796. };
  797. #endif // SCH_EDIT_FRAME_H