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.

1224 lines
38 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
* 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
* 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
* 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
* 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
* 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
18 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
* 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
* 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
* 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
* 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
* 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
* 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
* 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
18 years ago
18 years ago
++PCBNew * Removed Pcb_Frame argument from BOARD() constructor, since it precludes having a BOARD being edited by more than one editor, it was a bad design. And this meant removing m_PcbFrame from BOARD. * removed BOARD::SetWindowFrame(), and BOARD::m_PcbFrame * Removed the global BOARD_DESIGN_SETTINGS which was in class_board.cpp * added BOARD_DESIGN_SETTINGS to the BOARD class, a full instance * a couple dialogs now only change BOARD_DESIGN_SETTINGS when OK is pressed, such as dialog_mask_clearance, dialog_drc, etc. * Removed common/pcbcommon.cpp's int g_CurrentVersionPCB = 1 and replaced it with build_version.h's #define BOARD_FILE_VERSION, although there may be a better place for this constant. * Made the public functions in PARAM_CFG_ARRAY be type const. void SaveParam(..) const and void ReadParam(..) const * PARAM_CFG_BASE now has virtual destructor since we have various way of destroying the derived class and boost::ptr_vector must be told about this. * Pass const PARAM_CFG_ARRAY& instead of PARAM_CFG_ARRAY so that we can use an automatic PARAM_CFG_ARRAY which is on the stack.\ * PCB_EDIT_FRAME::GetProjectFileParameters() may no longer cache the array, since it has to access the current BOARD and the BOARD can change. Remember BOARD_DESIGN_SETTINGS are now in the BOARD. * Made the m_BoundingBox member private, this was a brutally hard task, and indicative of the lack of commitment to accessors and object oriented design on the part of KiCad developers. We must do better. Added BOARD::GetBoundingBox, SetBoundingBox(), ComputeBoundingBox(). * Added PCB_BASE_FRAME::GetBoardBoundingBox() which calls BOARD::ComputeBoundingBox()
14 years ago
++PCBNew * Removed Pcb_Frame argument from BOARD() constructor, since it precludes having a BOARD being edited by more than one editor, it was a bad design. And this meant removing m_PcbFrame from BOARD. * removed BOARD::SetWindowFrame(), and BOARD::m_PcbFrame * Removed the global BOARD_DESIGN_SETTINGS which was in class_board.cpp * added BOARD_DESIGN_SETTINGS to the BOARD class, a full instance * a couple dialogs now only change BOARD_DESIGN_SETTINGS when OK is pressed, such as dialog_mask_clearance, dialog_drc, etc. * Removed common/pcbcommon.cpp's int g_CurrentVersionPCB = 1 and replaced it with build_version.h's #define BOARD_FILE_VERSION, although there may be a better place for this constant. * Made the public functions in PARAM_CFG_ARRAY be type const. void SaveParam(..) const and void ReadParam(..) const * PARAM_CFG_BASE now has virtual destructor since we have various way of destroying the derived class and boost::ptr_vector must be told about this. * Pass const PARAM_CFG_ARRAY& instead of PARAM_CFG_ARRAY so that we can use an automatic PARAM_CFG_ARRAY which is on the stack.\ * PCB_EDIT_FRAME::GetProjectFileParameters() may no longer cache the array, since it has to access the current BOARD and the BOARD can change. Remember BOARD_DESIGN_SETTINGS are now in the BOARD. * Made the m_BoundingBox member private, this was a brutally hard task, and indicative of the lack of commitment to accessors and object oriented design on the part of KiCad developers. We must do better. Added BOARD::GetBoundingBox, SetBoundingBox(), ComputeBoundingBox(). * Added PCB_BASE_FRAME::GetBoardBoundingBox() which calls BOARD::ComputeBoundingBox()
14 years ago
18 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
* 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
  1. /*
  2. * This program source code file is part of KiCad, a free EDA CAD application.
  3. *
  4. * Copyright (C) 2004-2015 Jean-Pierre Charras, jp.charras at wanadoo.fr
  5. * Copyright (C) 2011 Wayne Stambaugh <stambaughw@gmail.com>
  6. * Copyright (C) 2016-2020 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. #include <confirm.h>
  26. #include <kicad_string.h>
  27. #include <gestfich.h>
  28. #include <pcb_edit_frame.h>
  29. #include <3d_viewer/eda_3d_viewer.h>
  30. #include <pgm_base.h>
  31. #include <widgets/msgpanel.h>
  32. #include <fp_lib_table.h>
  33. #include <kiface_i.h>
  34. #include <trace_helpers.h>
  35. #include <lockfile.cpp>
  36. #include <netlist_reader/pcb_netlist.h>
  37. #include <pcbnew_id.h>
  38. #include <io_mgr.h>
  39. #include <wildcards_and_files_ext.h>
  40. #include <tool/tool_manager.h>
  41. #include <class_board.h>
  42. #include <wx/stdpaths.h>
  43. #include <ratsnest/ratsnest_data.h>
  44. #include <kiplatform/app.h>
  45. #include <widgets/appearance_controls.h>
  46. #include <wx/wupdlock.h>
  47. #include <settings/common_settings.h>
  48. #include <settings/settings_manager.h>
  49. #include <project/project_file.h>
  50. #include <project/project_local_settings.h>
  51. #include <plugins/cadstar/cadstar_pcb_archive_plugin.h>
  52. #include <dialogs/dialog_imported_layers.h>
  53. //#define USE_INSTRUMENTATION 1
  54. #define USE_INSTRUMENTATION 0
  55. /**
  56. * Function AskLoadBoardFileName
  57. * puts up a wxFileDialog asking for a BOARD filename to open.
  58. *
  59. * @param aParent is a wxFrame passed to wxFileDialog.
  60. * @param aCtl is where to put the OpenProjectFiles() control bits.
  61. *
  62. * @param aFileName on entry is a probable choice, on return is the chosen filename.
  63. * @param aKicadFilesOnly true to list kiacad pcb files plugins only, false to list import plugins.
  64. *
  65. * @return bool - true if chosen, else false if user aborted.
  66. */
  67. bool AskLoadBoardFileName( wxWindow* aParent, int* aCtl, wxString* aFileName, bool aKicadFilesOnly )
  68. {
  69. // This is a subset of all PLUGINs which are trusted to be able to
  70. // load a BOARD. User may occasionally use the wrong plugin to load a
  71. // *.brd file (since both legacy and eagle use *.brd extension),
  72. // but eventually *.kicad_pcb will be more common than legacy *.brd files.
  73. // clang-format off
  74. static const struct
  75. {
  76. const wxString& filter;
  77. IO_MGR::PCB_FILE_T pluginType;
  78. } loaders[] =
  79. {
  80. { PcbFileWildcard(), IO_MGR::KICAD_SEXP }, // Current Kicad board files
  81. { LegacyPcbFileWildcard(), IO_MGR::LEGACY }, // Old Kicad board files
  82. { AltiumCircuitMakerPcbFileWildcard(), IO_MGR::ALTIUM_CIRCUIT_MAKER }, // Import Altium Circuit Maker board files
  83. { AltiumCircuitStudioPcbFileWildcard(), IO_MGR::ALTIUM_CIRCUIT_STUDIO }, // Import Altium Circuit Studio board files
  84. { AltiumDesignerPcbFileWildcard(), IO_MGR::ALTIUM_DESIGNER }, // Import Altium Designer board files
  85. { CadstarPcbArchiveFileWildcard(), IO_MGR::CADSTAR_PCB_ARCHIVE }, // Import Cadstar PCB Archive board files
  86. { EaglePcbFileWildcard(), IO_MGR::EAGLE }, // Import Eagle board files
  87. { PCadPcbFileWildcard(), IO_MGR::PCAD } // Import PCAD board files
  88. };
  89. // clang-format on
  90. wxFileName fileName( *aFileName );
  91. wxString fileFilters;
  92. if( aKicadFilesOnly )
  93. {
  94. std::vector<std::string> fileExtensions;
  95. for( unsigned ii = 0; ii < 2; ++ii )
  96. {
  97. if( !fileFilters.IsEmpty() )
  98. fileFilters += wxChar( '|' );
  99. fileFilters += wxGetTranslation( loaders[ii].filter );
  100. PLUGIN::RELEASER plugin( IO_MGR::PluginFind( loaders[ii].pluginType ) );
  101. wxCHECK( plugin, false );
  102. fileExtensions.push_back( plugin->GetFileExtension().ToStdString() );
  103. }
  104. fileFilters = _( "All KiCad Board Files" ) + AddFileExtListToFilter( fileExtensions ) + "|"
  105. + fileFilters;
  106. }
  107. else
  108. {
  109. wxString allWildcards;
  110. for( unsigned ii = 2; ii < arrayDim( loaders ); ++ii )
  111. {
  112. if( !fileFilters.IsEmpty() )
  113. fileFilters += wxChar( '|' );
  114. fileFilters += wxGetTranslation( loaders[ii].filter );
  115. PLUGIN::RELEASER plugin( IO_MGR::PluginFind( loaders[ii].pluginType ) );
  116. wxCHECK( plugin, false );
  117. allWildcards += "*." + formatWildcardExt( plugin->GetFileExtension() ) + ";";
  118. }
  119. fileFilters = _( "All supported formats|" ) + allWildcards + "|" + fileFilters;
  120. }
  121. wxString path;
  122. wxString name;
  123. if( fileName.FileExists() )
  124. {
  125. path = fileName.GetPath();
  126. name = fileName.GetFullName();
  127. }
  128. else
  129. {
  130. path = wxStandardPaths::Get().GetDocumentsDir();
  131. // leave name empty
  132. }
  133. wxFileDialog dlg( aParent,
  134. aKicadFilesOnly ? _( "Open Board File" ) : _( "Import Non KiCad Board File" ),
  135. path, name, fileFilters,
  136. wxFD_OPEN | wxFD_FILE_MUST_EXIST );
  137. if( dlg.ShowModal() == wxID_OK )
  138. {
  139. // For import option, if Eagle (*.brd files), tell OpenProjectFiles() to use Eagle plugin.
  140. // It's the only special case because of the duplicate use of the *.brd file extension.
  141. // Other cases are clear because of unique file extensions.
  142. *aCtl = aKicadFilesOnly ? 0 : KICTL_EAGLE_BRD;
  143. *aFileName = dlg.GetPath();
  144. return true;
  145. }
  146. else
  147. return false;
  148. }
  149. ///> Helper widget to select whether a new project should be created for a file when saving
  150. class CREATE_PROJECT_CHECKBOX : public wxPanel
  151. {
  152. public:
  153. CREATE_PROJECT_CHECKBOX( wxWindow* aParent )
  154. : wxPanel( aParent )
  155. {
  156. m_cbCreateProject = new wxCheckBox( this, wxID_ANY,
  157. _( "Create a new project for this board" ) );
  158. m_cbCreateProject->SetValue( false );
  159. m_cbCreateProject->SetToolTip( _( "Creating a project will enable features such as "
  160. "design rules, net classes, and layer presets" ) );
  161. wxBoxSizer* sizer = new wxBoxSizer( wxHORIZONTAL );
  162. sizer->Add( m_cbCreateProject, 0, wxALL, 8 );
  163. SetSizerAndFit( sizer );
  164. }
  165. bool GetValue() const
  166. {
  167. return m_cbCreateProject->GetValue();
  168. }
  169. static wxWindow* Create( wxWindow* aParent )
  170. {
  171. return new CREATE_PROJECT_CHECKBOX( aParent );
  172. }
  173. protected:
  174. wxCheckBox* m_cbCreateProject;
  175. };
  176. /**
  177. * Puts up a wxFileDialog asking for a BOARD filename to save.
  178. *
  179. * @param aParent is a wxFrame passed to wxFileDialog.
  180. * @param aFileName on entry is a probable choice, on return is the
  181. * chosen full filename (includes path).
  182. * @param aCreateProject will be filled with the state of the Create Project? checkbox if relevant
  183. *
  184. * @return bool - true if chosen, else false if user aborted.
  185. */
  186. bool AskSaveBoardFileName( PCB_EDIT_FRAME* aParent, wxString* aFileName, bool* aCreateProject )
  187. {
  188. wxString wildcard = PcbFileWildcard();
  189. wxFileName fn = *aFileName;
  190. fn.SetExt( KiCadPcbFileExtension );
  191. wxFileDialog dlg( aParent,
  192. _( "Save Board File As" ),
  193. fn.GetPath(),
  194. fn.GetFullName(),
  195. wildcard,
  196. wxFD_SAVE | wxFD_OVERWRITE_PROMPT
  197. );
  198. // Add a "Create a project" checkbox in standalone mode and one isn't loaded
  199. if( Kiface().IsSingle() && aParent->Prj().IsNullProject() )
  200. dlg.SetExtraControlCreator( &CREATE_PROJECT_CHECKBOX::Create );
  201. if( dlg.ShowModal() != wxID_OK )
  202. return false;
  203. fn = dlg.GetPath();
  204. // always enforce filename extension, user may not have entered it.
  205. fn.SetExt( KiCadPcbFileExtension );
  206. *aFileName = fn.GetFullPath();
  207. if( wxWindow* extraControl = dlg.GetExtraControl() )
  208. *aCreateProject = static_cast<CREATE_PROJECT_CHECKBOX*>( extraControl )->GetValue();
  209. return true;
  210. }
  211. void PCB_EDIT_FRAME::OnFileHistory( wxCommandEvent& event )
  212. {
  213. wxString fn = GetFileFromHistory( event.GetId(), _( "Printed circuit board" ) );
  214. if( !!fn )
  215. {
  216. int open_ctl = 0;
  217. if( !wxFileName::IsFileReadable( fn ) )
  218. {
  219. if( !AskLoadBoardFileName( this, &open_ctl, &fn, true ) )
  220. return;
  221. }
  222. OpenProjectFiles( std::vector<wxString>( 1, fn ), open_ctl );
  223. }
  224. }
  225. void PCB_EDIT_FRAME::OnClearFileHistory( wxCommandEvent& aEvent )
  226. {
  227. ClearFileHistory();
  228. }
  229. void PCB_EDIT_FRAME::Files_io( wxCommandEvent& event )
  230. {
  231. int id = event.GetId();
  232. Files_io_from_id( id );
  233. }
  234. bool PCB_EDIT_FRAME::Files_io_from_id( int id )
  235. {
  236. wxString msg;
  237. switch( id )
  238. {
  239. case ID_LOAD_FILE:
  240. {
  241. int open_ctl = 0;
  242. wxString fileName = Prj().AbsolutePath( GetBoard()->GetFileName() );
  243. return AskLoadBoardFileName( this, &open_ctl, &fileName, true )
  244. && OpenProjectFiles( std::vector<wxString>( 1, fileName ), open_ctl );
  245. }
  246. case ID_IMPORT_NON_KICAD_BOARD:
  247. {
  248. int open_ctl = 1;
  249. wxString fileName; // = Prj().AbsolutePath( GetBoard()->GetFileName() );
  250. return AskLoadBoardFileName( this, &open_ctl, &fileName, false )
  251. && OpenProjectFiles( std::vector<wxString>( 1, fileName ), open_ctl );
  252. }
  253. case ID_MENU_RECOVER_BOARD_AUTOSAVE:
  254. {
  255. wxFileName currfn = Prj().AbsolutePath( GetBoard()->GetFileName() );
  256. wxFileName fn = currfn;
  257. wxString rec_name = GetAutoSaveFilePrefix() + fn.GetName();
  258. fn.SetName( rec_name );
  259. if( !fn.FileExists() )
  260. {
  261. msg.Printf( _( "Recovery file \"%s\" not found." ), fn.GetFullPath() );
  262. DisplayInfoMessage( this, msg );
  263. return false;
  264. }
  265. msg.Printf( _( "OK to load recovery file \"%s\"" ), fn.GetFullPath() );
  266. if( !IsOK( this, msg ) )
  267. return false;
  268. GetScreen()->ClrModify(); // do not prompt the user for changes
  269. if( OpenProjectFiles( std::vector<wxString>( 1, fn.GetFullPath() ) ) )
  270. {
  271. // Re-set the name since name or extension was changed
  272. GetBoard()->SetFileName( currfn.GetFullPath() );
  273. UpdateTitle();
  274. return true;
  275. }
  276. return false;
  277. }
  278. case ID_NEW_BOARD:
  279. {
  280. if( IsContentModified() )
  281. {
  282. wxFileName fileName = GetBoard()->GetFileName();
  283. wxString saveMsg =
  284. _( "Current board will be closed, save changes to \"%s\" before continuing?" );
  285. if( !HandleUnsavedChanges( this, wxString::Format( saveMsg, fileName.GetFullName() ),
  286. [&]()->bool { return Files_io_from_id( ID_SAVE_BOARD ); } ) )
  287. return false;
  288. }
  289. else if( !GetBoard()->IsEmpty() )
  290. {
  291. if( !IsOK( this, _( "Current Board will be closed. Continue?" ) ) )
  292. return false;
  293. }
  294. SaveProjectSettings();
  295. GetBoard()->ClearProject();
  296. SETTINGS_MANAGER* mgr = GetSettingsManager();
  297. mgr->SaveProject( mgr->Prj().GetProjectFullName() );
  298. mgr->UnloadProject( &mgr->Prj() );
  299. if( !Clear_Pcb( false ) )
  300. return false;
  301. onBoardLoaded();
  302. LoadProjectSettings();
  303. OnModify();
  304. return true;
  305. }
  306. case ID_SAVE_BOARD:
  307. if( !GetBoard()->GetFileName().IsEmpty() )
  308. return SavePcbFile( Prj().AbsolutePath( GetBoard()->GetFileName() ) );
  309. KI_FALLTHROUGH;
  310. case ID_COPY_BOARD_AS:
  311. case ID_SAVE_BOARD_AS:
  312. {
  313. bool addToHistory = false;
  314. wxString orig_name;
  315. wxFileName::SplitPath( GetBoard()->GetFileName(), nullptr, nullptr, &orig_name,
  316. nullptr );
  317. if( orig_name.IsEmpty() )
  318. {
  319. addToHistory = true;
  320. orig_name = _( "noname" );
  321. }
  322. wxFileName savePath( Prj().GetProjectFullName() );
  323. if( !savePath.IsOk() || !savePath.IsDirWritable() )
  324. {
  325. savePath = GetMruPath();
  326. if( !savePath.IsOk() || !savePath.IsDirWritable() )
  327. savePath = wxStandardPaths::Get().GetDocumentsDir();
  328. }
  329. wxFileName fn( savePath.GetPath(), orig_name, KiCadPcbFileExtension );
  330. wxString filename = fn.GetFullPath();
  331. bool createProject = false;
  332. if( AskSaveBoardFileName( this, &filename, &createProject ) )
  333. {
  334. if( id == ID_COPY_BOARD_AS )
  335. return SavePcbCopy( filename, createProject );
  336. else
  337. return SavePcbFile( filename, addToHistory, createProject );
  338. }
  339. return false;
  340. }
  341. default:
  342. return false;
  343. }
  344. }
  345. // The KIWAY_PLAYER::OpenProjectFiles() API knows nothing about plugins, so
  346. // determine how to load the BOARD here, with minor assistance from KICTL_EAGLE_BRD
  347. // bit flag.
  348. IO_MGR::PCB_FILE_T plugin_type( const wxString& aFileName, int aCtl )
  349. {
  350. IO_MGR::PCB_FILE_T pluginType;
  351. wxFileName fn = aFileName;
  352. // Note: file extensions are expected to be in lower case.
  353. // This is not always true, especially when importing files, so the string
  354. // comparisons are case insensitive to try to find the suitable plugin.
  355. if( fn.GetExt().CmpNoCase( IO_MGR::GetFileExtension( IO_MGR::LEGACY ) ) == 0 )
  356. {
  357. // both legacy and eagle share a common file extension.
  358. pluginType = ( aCtl & KICTL_EAGLE_BRD ) ? IO_MGR::EAGLE : IO_MGR::LEGACY;
  359. }
  360. else if( fn.GetExt().CmpNoCase( IO_MGR::GetFileExtension( IO_MGR::PCAD ) ) == 0 )
  361. {
  362. pluginType = IO_MGR::PCAD;
  363. }
  364. else if( fn.GetExt().CmpNoCase( IO_MGR::GetFileExtension( IO_MGR::ALTIUM_DESIGNER ) ) == 0 )
  365. {
  366. pluginType = IO_MGR::ALTIUM_DESIGNER;
  367. }
  368. else if( fn.GetExt().CmpNoCase( IO_MGR::GetFileExtension( IO_MGR::ALTIUM_CIRCUIT_STUDIO ) ) == 0 )
  369. {
  370. pluginType = IO_MGR::ALTIUM_CIRCUIT_STUDIO;
  371. }
  372. else if( fn.GetExt().CmpNoCase( IO_MGR::GetFileExtension( IO_MGR::ALTIUM_CIRCUIT_MAKER ) ) == 0 )
  373. {
  374. pluginType = IO_MGR::ALTIUM_CIRCUIT_MAKER;
  375. }
  376. else if( fn.GetExt().CmpNoCase( IO_MGR::GetFileExtension( IO_MGR::CADSTAR_PCB_ARCHIVE ) ) == 0 )
  377. {
  378. pluginType = IO_MGR::CADSTAR_PCB_ARCHIVE;
  379. }
  380. else
  381. {
  382. pluginType = IO_MGR::KICAD_SEXP;
  383. }
  384. return pluginType;
  385. }
  386. int PCB_EDIT_FRAME::inferLegacyEdgeClearance( BOARD* aBoard )
  387. {
  388. PCB_LAYER_COLLECTOR collector;
  389. collector.SetLayerId( Edge_Cuts );
  390. collector.Collect( aBoard, GENERAL_COLLECTOR::AllBoardItems );
  391. int edgeWidth = -1;
  392. bool mixed = false;
  393. for( int i = 0; i < collector.GetCount(); i++ )
  394. {
  395. if( collector[i]->Type() == PCB_SHAPE_T )
  396. {
  397. int itemWidth = static_cast<PCB_SHAPE*>( collector[i] )->GetWidth();
  398. if( edgeWidth != -1 && edgeWidth != itemWidth )
  399. {
  400. mixed = true;
  401. edgeWidth = std::max( edgeWidth, itemWidth );
  402. }
  403. else
  404. {
  405. edgeWidth = itemWidth;
  406. }
  407. }
  408. }
  409. if( mixed )
  410. {
  411. // If they had different widths then we can't ensure that fills will be the same.
  412. wxMessageBox( _( "If the zones on this board are refilled the Copper Edge Clearance\n"
  413. "setting will be used (see Board Setup > Design Rules). This may\n"
  414. "result in different fills from previous Kicad versions which used\n"
  415. "the line thickness of the board boundary on the Edge Cuts layer." ),
  416. _( "Edge Clearance Warning" ), wxOK|wxICON_WARNING, this );
  417. }
  418. return std::max( 0, edgeWidth / 2 );
  419. }
  420. bool PCB_EDIT_FRAME::OpenProjectFiles( const std::vector<wxString>& aFileSet, int aCtl )
  421. {
  422. // This is for python:
  423. if( aFileSet.size() != 1 )
  424. {
  425. UTF8 msg = StrPrintf( "Pcbnew:%s() takes only a single filename", __func__ );
  426. DisplayError( this, msg );
  427. return false;
  428. }
  429. wxString fullFileName( aFileSet[0] );
  430. if( Kiface().IsSingle() )
  431. {
  432. KIPLATFORM::APP::RegisterApplicationRestart( fullFileName );
  433. }
  434. // We insist on caller sending us an absolute path, if it does not, we say it's a bug.
  435. wxASSERT_MSG( wxFileName( fullFileName ).IsAbsolute(), wxT( "Path is not absolute!" ) );
  436. std::unique_ptr<wxSingleInstanceChecker> lockFile = ::LockFile( fullFileName );
  437. if( !lockFile )
  438. {
  439. wxString msg = wxString::Format( _( "PCB file \"%s\" is already open." ), fullFileName );
  440. DisplayError( this, msg );
  441. return false;
  442. }
  443. if( IsContentModified() )
  444. {
  445. if( !HandleUnsavedChanges( this, _( "The current PCB has been modified. Save changes?" ),
  446. [&]()->bool { return SavePcbFile( GetBoard()->GetFileName() ); } ) )
  447. {
  448. return false;
  449. }
  450. }
  451. // Release the lock file, until the new file is actually loaded
  452. ReleaseFile();
  453. wxFileName pro = fullFileName;
  454. pro.SetExt( ProjectFileExtension );
  455. bool is_new = !wxFileName::IsFileReadable( fullFileName );
  456. // If its a non-existent schematic and caller thinks it exists
  457. if( is_new && !( aCtl & KICTL_CREATE ) )
  458. {
  459. // notify user that fullFileName does not exist, ask if user wants to create it.
  460. wxString ask = wxString::Format( _( "PCB \"%s\" does not exist. Do you wish to create it?" ),
  461. fullFileName );
  462. if( !IsOK( this, ask ) )
  463. return false;
  464. }
  465. // Unlink the old project if needed
  466. GetBoard()->ClearProject();
  467. // No save prompt (we already prompted above), and only reset to a new blank board if new
  468. Clear_Pcb( false, !is_new );
  469. IO_MGR::PCB_FILE_T pluginType = plugin_type( fullFileName, aCtl );
  470. bool converted = pluginType != IO_MGR::LEGACY && pluginType != IO_MGR::KICAD_SEXP;
  471. if( !converted )
  472. {
  473. // Loading a project should only be done under carefully considered circumstances.
  474. // The calling code should know not to ask me here to change projects unless
  475. // it knows what consequences that will have on other KIFACEs running and using
  476. // this same PROJECT. It can be very harmful if that calling code is stupid.
  477. SETTINGS_MANAGER* mgr = GetSettingsManager();
  478. if( pro.GetFullPath() != mgr->Prj().GetProjectFullName() )
  479. {
  480. // calls SaveProject
  481. SaveProjectSettings();
  482. mgr->UnloadProject( &mgr->Prj() );
  483. mgr->LoadProject( pro.GetFullPath() );
  484. // Do not allow saving a project if one doesn't exist. This normally happens if we are
  485. // standalone and opening a board that has been moved from its project folder.
  486. if( !pro.Exists() )
  487. Prj().SetReadOnly();
  488. }
  489. }
  490. if( is_new )
  491. {
  492. // Link the existing blank board to the new project
  493. GetBoard()->SetProject( &Prj() );
  494. GetBoard()->SetFileName( fullFileName );
  495. OnModify();
  496. }
  497. else
  498. {
  499. BOARD* loadedBoard = 0; // it will be set to non-NULL if loaded OK
  500. PLUGIN::RELEASER pi( IO_MGR::PluginFind( pluginType ) );
  501. if( pluginType == IO_MGR::CADSTAR_PCB_ARCHIVE )
  502. {
  503. // TODO: Generalise this so that it is applicable to all non-kicad plugins
  504. CADSTAR_PCB_ARCHIVE_PLUGIN* cadstarPlugin = nullptr;
  505. cadstarPlugin = dynamic_cast<CADSTAR_PCB_ARCHIVE_PLUGIN*>( (PLUGIN*) pi );
  506. wxCHECK( cadstarPlugin, false );
  507. cadstarPlugin->RegisterLayerMappingCallback(
  508. std::bind( DIALOG_IMPORTED_LAYERS::GetMapModal, this, std::placeholders::_1 ) );
  509. }
  510. // This will rename the file if there is an autosave and the user want to recover
  511. CheckForAutoSaveFile( fullFileName );
  512. try
  513. {
  514. PROPERTIES props;
  515. char xbuf[30];
  516. char ybuf[30];
  517. // EAGLE_PLUGIN can use this info to center the BOARD, but it does not yet.
  518. sprintf( xbuf, "%d", GetPageSizeIU().x );
  519. sprintf( ybuf, "%d", GetPageSizeIU().y );
  520. props["page_width"] = xbuf;
  521. props["page_height"] = ybuf;
  522. #if USE_INSTRUMENTATION
  523. // measure the time to load a BOARD.
  524. unsigned startTime = GetRunningMicroSecs();
  525. #endif
  526. loadedBoard = pi->Load( fullFileName, NULL, &props );
  527. #if USE_INSTRUMENTATION
  528. unsigned stopTime = GetRunningMicroSecs();
  529. printf( "PLUGIN::Load(): %u usecs\n", stopTime - startTime );
  530. #endif
  531. }
  532. catch( const IO_ERROR& ioe )
  533. {
  534. if( ioe.Problem() != wxT( "CANCEL" ) )
  535. {
  536. wxString msg = wxString::Format( _( "Error loading board file:\n%s" ), fullFileName );
  537. DisplayErrorMessage( this, msg, ioe.What() );
  538. }
  539. // We didn't create a new blank board above, so do that now
  540. Clear_Pcb( false );
  541. return false;
  542. }
  543. SetBoard( loadedBoard );
  544. // On save; design settings will be removed from the board
  545. if( loadedBoard->m_LegacyDesignSettingsLoaded )
  546. loadedBoard->SetModified();
  547. // Move legacy view settings to local project settings
  548. if( !loadedBoard->m_LegacyVisibleLayers.test( Rescue ) )
  549. {
  550. Prj().GetLocalSettings().m_VisibleLayers = loadedBoard->m_LegacyVisibleLayers;
  551. loadedBoard->SetModified();
  552. }
  553. if( !loadedBoard->m_LegacyVisibleItems.test( GAL_LAYER_INDEX( GAL_LAYER_ID_BITMASK_END ) ) )
  554. {
  555. Prj().GetLocalSettings().m_VisibleItems = loadedBoard->m_LegacyVisibleItems;
  556. loadedBoard->SetModified();
  557. }
  558. // we should not ask PLUGINs to do these items:
  559. loadedBoard->BuildListOfNets();
  560. ResolveDRCExclusions();
  561. if( loadedBoard->IsModified() )
  562. OnModify();
  563. else
  564. GetScreen()->ClrModify();
  565. if( pluginType == IO_MGR::LEGACY &&
  566. loadedBoard->GetFileFormatVersionAtLoad() < LEGACY_BOARD_FILE_VERSION )
  567. {
  568. DisplayInfoMessage( this,
  569. _( "This file was created by an older version of Pcbnew.\n"
  570. "It will be stored in the new file format when you save this file again." ) );
  571. }
  572. }
  573. {
  574. wxFileName fn = fullFileName;
  575. if( converted )
  576. fn.SetExt( PcbFileExtension );
  577. wxString fname = fn.GetFullPath();
  578. fname.Replace( WIN_STRING_DIR_SEP, UNIX_STRING_DIR_SEP );
  579. GetBoard()->SetFileName( fname );
  580. }
  581. // Lock the file newly opened:
  582. m_file_checker.reset( lockFile.release() );
  583. if( !converted )
  584. UpdateFileHistory( GetBoard()->GetFileName() );
  585. // Rebuild list of nets (full ratsnest rebuild)
  586. GetBoard()->BuildConnectivity();
  587. Compile_Ratsnest( true );
  588. // Load project settings after setting up board; some of them depend on the nets list
  589. LoadProjectSettings();
  590. // Syncs the UI (appearance panel, etc) with the loaded board and project
  591. onBoardLoaded();
  592. // Refresh the 3D view, if any
  593. EDA_3D_VIEWER* draw3DFrame = Get3DViewerFrame();
  594. if( draw3DFrame )
  595. draw3DFrame->NewDisplay();
  596. #if 0 && defined(DEBUG)
  597. // Output the board object tree to stdout, but please run from command prompt:
  598. GetBoard()->Show( 0, std::cout );
  599. #endif
  600. // from EDA_APPL which was first loaded BOARD only:
  601. {
  602. /* For an obscure reason the focus is lost after loading a board file
  603. * when starting up the process.
  604. * (seems due to the recreation of the layer manager after loading the file)
  605. * Give focus to main window and Drawpanel
  606. * must be done for these 2 windows (for an obscure reason ...)
  607. * Linux specific
  608. * This is more a workaround than a fix.
  609. */
  610. SetFocus();
  611. GetCanvas()->SetFocus();
  612. }
  613. return true;
  614. }
  615. bool PCB_EDIT_FRAME::SavePcbFile( const wxString& aFileName, bool addToHistory,
  616. bool aChangeProject )
  617. {
  618. // please, keep it simple. prompting goes elsewhere.
  619. wxFileName pcbFileName = aFileName;
  620. if( pcbFileName.GetExt() == LegacyPcbFileExtension )
  621. pcbFileName.SetExt( KiCadPcbFileExtension );
  622. if( !IsWritable( pcbFileName ) )
  623. {
  624. wxString msg = wxString::Format( _(
  625. "No access rights to write to file \"%s\"" ),
  626. pcbFileName.GetFullPath() );
  627. DisplayError( this, msg );
  628. return false;
  629. }
  630. // TODO: this will break if we ever go multi-board
  631. wxFileName projectFile( pcbFileName );
  632. bool projectFileExists = false;
  633. projectFile.SetExt( ProjectFileExtension );
  634. projectFileExists = projectFile.FileExists();
  635. if( aChangeProject && !projectFileExists )
  636. {
  637. // If this is a new board, project filename won't be set yet
  638. if( projectFile.GetFullPath() != Prj().GetProjectFullName() )
  639. {
  640. GetBoard()->ClearProject();
  641. SETTINGS_MANAGER* mgr = GetSettingsManager();
  642. mgr->SaveProject( Prj().GetProjectFullName() );
  643. mgr->UnloadProject( &Prj() );
  644. // If no project to load then initialize project text vars with board properties
  645. if( !mgr->LoadProject( projectFile.GetFullPath() ) )
  646. Prj().GetTextVars() = GetBoard()->GetProperties();
  647. GetBoard()->SetProject( &Prj() );
  648. }
  649. }
  650. if( projectFileExists )
  651. GetBoard()->SynchronizeProperties();
  652. wxFileName tempFile( aFileName );
  653. tempFile.SetName( wxT( "." ) + tempFile.GetName() );
  654. tempFile.SetExt( tempFile.GetExt() + wxT( "$" ) );
  655. GetBoard()->SynchronizeNetsAndNetClasses();
  656. // Save various DRC parameters, such as violation severities (which may have been
  657. // edited via the DRC dialog as well as the Board Setup dialog), DRC exclusions, etc.
  658. SaveProjectSettings();
  659. GetSettingsManager()->SaveProject();
  660. ClearMsgPanel();
  661. wxString upperTxt;
  662. wxString lowerTxt;
  663. try
  664. {
  665. PLUGIN::RELEASER pi( IO_MGR::PluginFind( IO_MGR::KICAD_SEXP ) );
  666. wxASSERT( tempFile.IsAbsolute() );
  667. pi->Save( tempFile.GetFullPath(), GetBoard(), NULL );
  668. }
  669. catch( const IO_ERROR& ioe )
  670. {
  671. wxString msg = wxString::Format( _(
  672. "Error saving board file \"%s\".\n%s" ),
  673. pcbFileName.GetFullPath(), ioe.What()
  674. );
  675. DisplayError( this, msg );
  676. lowerTxt.Printf( _( "Failed to create temporary file \"%s\"" ), tempFile.GetFullPath() );
  677. AppendMsgPanel( upperTxt, lowerTxt, CYAN );
  678. // In case we started a file but didn't fully write it, clean up
  679. wxRemoveFile( tempFile.GetFullPath() );
  680. return false;
  681. }
  682. // If save succeeded, replace the original with what we just wrote
  683. if( !wxRenameFile( tempFile.GetFullPath(), pcbFileName.GetFullPath() ) )
  684. {
  685. wxString msg = wxString::Format( _(
  686. "Error saving board file \"%s\".\nFailed to rename temporary file \"%s\"" ),
  687. pcbFileName.GetFullPath(), tempFile.GetFullPath()
  688. );
  689. DisplayError( this, msg );
  690. lowerTxt.Printf( _( "Failed to rename temporary file \"%s\"" ), tempFile.GetFullPath() );
  691. AppendMsgPanel( upperTxt, lowerTxt, CYAN );
  692. return false;
  693. }
  694. if( !Kiface().IsSingle() )
  695. {
  696. WX_STRING_REPORTER backupReporter( &upperTxt );
  697. if( GetSettingsManager()->TriggerBackupIfNeeded( backupReporter ) )
  698. upperTxt.clear();
  699. }
  700. GetBoard()->SetFileName( pcbFileName.GetFullPath() );
  701. UpdateTitle();
  702. // Put the saved file in File History if requested
  703. if( addToHistory )
  704. UpdateFileHistory( GetBoard()->GetFileName() );
  705. // Delete auto save file on successful save.
  706. wxFileName autoSaveFileName = pcbFileName;
  707. autoSaveFileName.SetName( GetAutoSaveFilePrefix() + pcbFileName.GetName() );
  708. if( autoSaveFileName.FileExists() )
  709. wxRemoveFile( autoSaveFileName.GetFullPath() );
  710. lowerTxt.Printf( _( "Wrote board file: \"%s\"" ), pcbFileName.GetFullPath() );
  711. AppendMsgPanel( upperTxt, lowerTxt, CYAN );
  712. GetScreen()->ClrModify();
  713. GetScreen()->ClrSave();
  714. return true;
  715. }
  716. bool PCB_EDIT_FRAME::SavePcbCopy( const wxString& aFileName, bool aCreateProject )
  717. {
  718. wxFileName pcbFileName = aFileName;
  719. // Ensure the file ext is the right ext:
  720. pcbFileName.SetExt( KiCadPcbFileExtension );
  721. if( !IsWritable( pcbFileName ) )
  722. {
  723. wxString msg = wxString::Format( _(
  724. "No access rights to write to file \"%s\"" ),
  725. pcbFileName.GetFullPath() );
  726. DisplayError( this, msg );
  727. return false;
  728. }
  729. GetBoard()->SynchronizeNetsAndNetClasses();
  730. try
  731. {
  732. PLUGIN::RELEASER pi( IO_MGR::PluginFind( IO_MGR::KICAD_SEXP ) );
  733. wxASSERT( pcbFileName.IsAbsolute() );
  734. pi->Save( pcbFileName.GetFullPath(), GetBoard(), NULL );
  735. }
  736. catch( const IO_ERROR& ioe )
  737. {
  738. wxString msg = wxString::Format( _(
  739. "Error saving board file \"%s\".\n%s" ),
  740. pcbFileName.GetFullPath(), ioe.What()
  741. );
  742. DisplayError( this, msg );
  743. return false;
  744. }
  745. if( aCreateProject )
  746. {
  747. wxFileName projectFile( pcbFileName );
  748. projectFile.SetExt( ProjectFileExtension );
  749. if( !projectFile.FileExists() )
  750. {
  751. wxString currentProject = Prj().GetProjectFullName();
  752. SETTINGS_MANAGER* mgr = GetSettingsManager();
  753. GetBoard()->ClearProject();
  754. mgr->SaveProject( currentProject );
  755. mgr->UnloadProject( &Prj() );
  756. mgr->LoadProject( projectFile.GetFullPath() );
  757. mgr->SaveProject();
  758. mgr->UnloadProject( &Prj() );
  759. mgr->LoadProject( currentProject );
  760. // If no project to load then initialize project text vars with board properties
  761. if( !mgr->LoadProject( currentProject ) )
  762. Prj().GetTextVars() = GetBoard()->GetProperties();
  763. GetBoard()->SetProject( &Prj() );
  764. }
  765. }
  766. DisplayInfoMessage( this, wxString::Format( _( "Board copied to:\n\"%s\"" ),
  767. pcbFileName.GetFullPath() ) );
  768. return true;
  769. }
  770. bool PCB_EDIT_FRAME::doAutoSave()
  771. {
  772. wxFileName tmpFileName;
  773. if( GetBoard()->GetFileName().IsEmpty() )
  774. {
  775. tmpFileName = wxFileName( wxStandardPaths::Get().GetDocumentsDir(), wxT( "noname" ),
  776. KiCadPcbFileExtension );
  777. GetBoard()->SetFileName( tmpFileName.GetFullPath() );
  778. }
  779. else
  780. {
  781. tmpFileName = Prj().AbsolutePath( GetBoard()->GetFileName() );
  782. }
  783. wxFileName autoSaveFileName = tmpFileName;
  784. // Auto save file name is the board file name prepended with autosaveFilePrefix string.
  785. autoSaveFileName.SetName( GetAutoSaveFilePrefix() + autoSaveFileName.GetName() );
  786. if( !autoSaveFileName.IsOk() )
  787. return false;
  788. // If the board file path is not writable, try writing to a platform specific temp file
  789. // path. If that path isn't writabe, give up.
  790. if( !autoSaveFileName.IsDirWritable() )
  791. {
  792. autoSaveFileName.SetPath( wxFileName::GetTempDir() );
  793. if( !autoSaveFileName.IsOk() || !autoSaveFileName.IsDirWritable() )
  794. return false;
  795. }
  796. wxLogTrace( traceAutoSave, "Creating auto save file <" + autoSaveFileName.GetFullPath() + ">" );
  797. if( SavePcbFile( autoSaveFileName.GetFullPath(), false, false ) )
  798. {
  799. GetScreen()->SetModify();
  800. GetBoard()->SetFileName( tmpFileName.GetFullPath() );
  801. UpdateTitle();
  802. m_autoSaveState = false;
  803. if( !Kiface().IsSingle() &&
  804. GetSettingsManager()->GetCommonSettings()->m_Backup.backup_on_autosave )
  805. {
  806. GetSettingsManager()->TriggerBackupIfNeeded( NULL_REPORTER::GetInstance() );
  807. }
  808. return true;
  809. }
  810. GetBoard()->SetFileName( tmpFileName.GetFullPath() );
  811. return false;
  812. }
  813. bool PCB_EDIT_FRAME::importFile( const wxString& aFileName, int aFileType )
  814. {
  815. switch( (IO_MGR::PCB_FILE_T) aFileType )
  816. {
  817. case IO_MGR::CADSTAR_PCB_ARCHIVE:
  818. case IO_MGR::EAGLE:
  819. if( OpenProjectFiles( std::vector<wxString>( 1, aFileName ), KICTL_EAGLE_BRD ) )
  820. {
  821. wxString projectpath = Kiway().Prj().GetProjectPath();
  822. wxFileName newfilename;
  823. newfilename.SetPath( Prj().GetProjectPath() );
  824. newfilename.SetName( Prj().GetProjectName() );
  825. newfilename.SetExt( KiCadPcbFileExtension );
  826. GetBoard()->SetFileName( newfilename.GetFullPath() );
  827. UpdateTitle();
  828. OnModify();
  829. // Extract a footprint library from the design and add it to the fp-lib-table
  830. wxString newLibPath;
  831. HarvestFootprintsToLibrary( true, newfilename.GetName(), &newLibPath );
  832. if( newLibPath.Length() > 0 )
  833. {
  834. FP_LIB_TABLE* prjlibtable = Prj().PcbFootprintLibs();
  835. const wxString& project_env = PROJECT_VAR_NAME;
  836. wxString rel_path, env_path;
  837. wxGetEnv( project_env, &env_path );
  838. wxString result( newLibPath );
  839. rel_path = result.Replace( env_path,
  840. wxString( "$(" + project_env + ")" ) ) ? result : "" ;
  841. if( !rel_path.IsEmpty() )
  842. newLibPath = rel_path;
  843. FP_LIB_TABLE_ROW* row = new FP_LIB_TABLE_ROW( newfilename.GetName(),
  844. newLibPath, wxT( "KiCad" ), wxEmptyString );
  845. prjlibtable->InsertRow( row );
  846. }
  847. if( !GetBoard()->GetFileName().IsEmpty() )
  848. {
  849. wxString tblName = Prj().FootprintLibTblName();
  850. try
  851. {
  852. Prj().PcbFootprintLibs()->Save( tblName );
  853. }
  854. catch( const IO_ERROR& ioe )
  855. {
  856. wxString msg = wxString::Format( _(
  857. "Error occurred saving project specific footprint library "
  858. "table:\n\n%s" ), ioe.What() );
  859. wxMessageBox( msg, _( "File Save Error" ), wxOK | wxICON_ERROR );
  860. }
  861. }
  862. // Update module LIB_IDs to point to the just imported Eagle library
  863. for( MODULE* module : GetBoard()->Modules() )
  864. {
  865. LIB_ID libId = module->GetFPID();
  866. if( libId.GetLibItemName().empty() )
  867. continue;
  868. libId.SetLibNickname( newfilename.GetName() );
  869. module->SetFPID( libId );
  870. }
  871. // Store net names for all pads, to create net remap information
  872. std::unordered_map<D_PAD*, wxString> netMap;
  873. for( const auto& pad : GetBoard()->GetPads() )
  874. {
  875. NETINFO_ITEM* netinfo = pad->GetNet();
  876. if( netinfo->GetNet() > 0 && !netinfo->GetNetname().IsEmpty() )
  877. netMap[pad] = netinfo->GetNetname();
  878. }
  879. // Two stage netlist update:
  880. // - first, assign valid timestamps to footprints (no reannotation)
  881. // - second, perform schematic annotation and update footprint references
  882. // based on timestamps
  883. NETLIST netlist;
  884. FetchNetlistFromSchematic( netlist, NO_ANNOTATION );
  885. DoUpdatePCBFromNetlist( netlist, false );
  886. FetchNetlistFromSchematic( netlist, QUIET_ANNOTATION );
  887. DoUpdatePCBFromNetlist( netlist, true );
  888. std::unordered_map<wxString, wxString> netRemap;
  889. // Compare the old net names with the new net names and create a net map
  890. for( const auto& pad : GetBoard()->GetPads() )
  891. {
  892. auto it = netMap.find( pad );
  893. if( it == netMap.end() )
  894. continue;
  895. NETINFO_ITEM* netinfo = pad->GetNet();
  896. // Net name has changed, create a remap entry
  897. if( netinfo->GetNet() > 0 && netMap[pad] != netinfo->GetNetname() )
  898. netRemap[netMap[pad]] = netinfo->GetNetname();
  899. }
  900. if( !netRemap.empty() )
  901. fixEagleNets( netRemap );
  902. return true;
  903. }
  904. return false;
  905. default:
  906. return false;
  907. }
  908. return false;
  909. }
  910. bool PCB_EDIT_FRAME::fixEagleNets( const std::unordered_map<wxString, wxString>& aRemap )
  911. {
  912. bool result = true;
  913. BOARD* board = GetBoard();
  914. // perform netlist matching to prevent orphaned zones.
  915. for( auto zone : board->Zones() )
  916. {
  917. auto it = aRemap.find( zone->GetNet()->GetNetname() );
  918. if( it != aRemap.end() )
  919. {
  920. NETINFO_ITEM* net = board->FindNet( it->second );
  921. if( !net )
  922. {
  923. wxFAIL;
  924. result = false;
  925. continue;
  926. }
  927. zone->SetNet( net );
  928. }
  929. }
  930. // perform netlist matching to prevent orphaned tracks/vias.
  931. for( auto track : board->Tracks() )
  932. {
  933. auto it = aRemap.find( track->GetNet()->GetNetname() );
  934. if( it != aRemap.end() )
  935. {
  936. NETINFO_ITEM* net = board->FindNet( it->second );
  937. if( !net )
  938. {
  939. wxFAIL;
  940. result = false;
  941. continue;
  942. }
  943. track->SetNet( net );
  944. }
  945. }
  946. return result;
  947. }