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.

1685 lines
63 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
14 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
17 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
14 years ago
14 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
++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
++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
++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
* 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
11 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
14 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
16 years ago
16 years ago
16 years ago
18 years ago
18 years ago
18 years ago
18 years ago
18 years ago
18 years ago
Modular-Kicad milestone B), major portions: *) Rework the set language support, simplify it by using KIWAY. Now any major frame with a "change language" menu can change the language for all KIWAY_PLAYERs in the whole KIWAY. Multiple KIWAYs are not supported yet. *) Simplify "modal wxFrame" support, and add that support exclusively to KIWAY_PLAYER where it is inherited by all derivatives. The function KIWAY_PLAYER::ShowModal() is in the vtable and so is cross module capable. *) Remove the requirements and assumptions that the wxFrame hierarchy always had PCB_EDIT_FRAME and SCH_EDIT_FRAME as immediate parents of their viewers and editors. This is no longer the case, nor required. *) Use KIWAY::Player() everywhere to make KIWAY_PLAYERs, this registers the KIWAY_PLAYER within the KIWAY and makes it very easy to find an open frame quickly. It also gives control to the KIWAY as to frame hierarchical relationships. *) Change single_top to use the KIWAY for loading a KIFACE and instantiating the single KIWAY_PLAYER, see bullet immediately above. *) Add KIWAY::OnKiwayEnd() and call it from PGM_BASE at program termination, this gives the KIFACEs a chance to save their final configuration dope to disk. *) Add dedicated FRAME_T's for the modal frames, so m_Ident can be tested and these modal frames are distinctly different than their non-modal equivalents. KIWAY_PLAYER::IsModal() is !not! a valid test during the wxFrame's constructor, so this is another important reason for having a dedicated FRAME_T for each modal wxFrame. On balance, more lines were deleted than were added to achieve all this.
12 years ago
  1. /*
  2. * This program source code file is part of KiCad, a free EDA CAD application.
  3. *
  4. * Copyright (C) 2010 Jean-Pierre Charras, jp.charras@wanadoo.fr
  5. * Copyright (C) 1992-2016 KiCad Developers, see AUTHORS.txt for contributors.
  6. *
  7. * This program is free software; you can redistribute it and/or
  8. * modify it under the terms of the GNU General Public License
  9. * as published by the Free Software Foundation; either version 2
  10. * of the License, or (at your option) any later version.
  11. *
  12. * This program is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. * GNU General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU General Public License
  18. * along with this program; if not, you may find one here:
  19. * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
  20. * or you may search the http://www.gnu.org website for the version 2 license,
  21. * or you may write to the Free Software Foundation, Inc.,
  22. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
  23. */
  24. /**
  25. * @file wxPcbStruct.h
  26. */
  27. #ifndef WXPCB_STRUCT_H_
  28. #define WXPCB_STRUCT_H_
  29. #include <pcb_base_edit_frame.h>
  30. #include <config_params.h>
  31. #include <class_undoredo_container.h>
  32. #include <zones.h>
  33. /* Forward declarations of classes. */
  34. class PCB_SCREEN;
  35. class BOARD;
  36. class TEXTE_PCB;
  37. class MODULE;
  38. class TRACK;
  39. class SEGZONE;
  40. class VIA;
  41. class D_PAD;
  42. class TEXTE_MODULE;
  43. class PCB_TARGET;
  44. class DIMENSION;
  45. class EDGE_MODULE;
  46. class DRC;
  47. class ZONE_CONTAINER;
  48. class DRAWSEGMENT;
  49. class GENERAL_COLLECTOR;
  50. class GENERAL_COLLECTORS_GUIDE;
  51. class PCB_LAYER_WIDGET;
  52. class MARKER_PCB;
  53. class BOARD_ITEM;
  54. class PCB_LAYER_BOX_SELECTOR;
  55. class NETLIST;
  56. class REPORTER;
  57. struct PARSE_ERROR;
  58. struct IO_ERROR;
  59. class FP_LIB_TABLE;
  60. namespace PCB { struct IFACE; } // KIFACE_I is in pcbnew.cpp
  61. /**
  62. * Class PCB_EDIT_FRAME
  63. * is the main frame for Pcbnew.
  64. *
  65. * See also class PCB_BASE_FRAME(): Basic class for Pcbnew and GerbView.
  66. */
  67. #define PCB_EDIT_FRAME_NAME wxT( "PcbFrame" )
  68. class PCB_EDIT_FRAME : public PCB_BASE_EDIT_FRAME
  69. {
  70. friend struct PCB::IFACE;
  71. friend class PCB_LAYER_WIDGET;
  72. void updateTraceWidthSelectBox();
  73. void updateViaSizeSelectBox();
  74. /// The auxiliary right vertical tool bar used to access the microwave tools.
  75. wxAuiToolBar* m_microWaveToolBar;
  76. protected:
  77. PCB_LAYER_WIDGET* m_Layers;
  78. DRC* m_drc; ///< the DRC controller, see drc.cpp
  79. PARAM_CFG_ARRAY m_configSettings; ///< List of Pcbnew configuration settings.
  80. wxString m_lastNetListRead; ///< Last net list read with relative path.
  81. // The Tool Framework initalization
  82. void setupTools();
  83. // we'll use lower case function names for private member functions.
  84. void createPopUpMenuForZones( ZONE_CONTAINER* edge_zone, wxMenu* aPopMenu );
  85. void createPopUpMenuForFootprints( MODULE* aModule, wxMenu* aPopMenu );
  86. void createPopUpMenuForFpTexts( TEXTE_MODULE* aText, wxMenu* aPopMenu );
  87. void createPopUpMenuForFpPads( D_PAD* aPad, wxMenu* aPopMenu );
  88. void createPopupMenuForTracks( TRACK* aTrack, wxMenu* aPopMenu );
  89. void createPopUpMenuForTexts( TEXTE_PCB* Text, wxMenu* menu );
  90. void createPopUpBlockMenu( wxMenu* menu );
  91. void createPopUpMenuForMarkers( MARKER_PCB* aMarker, wxMenu* aPopMenu );
  92. /**
  93. * an helper function to enable some menus only active when the display
  94. * is switched to GAL mode and which do nothing in legacy mode
  95. */
  96. void enableGALSpecificMenus();
  97. // Has meaning only if DKICAD_SCRIPTING_WXPYTHON option is on
  98. /**
  99. * @return the frame name identifier for the python console frame
  100. */
  101. static const wxChar * pythonConsoleNameId()
  102. {
  103. return wxT( "PythonConsole" );
  104. }
  105. /**
  106. * @return a pointer to the python console frame, or NULL if not exist
  107. */
  108. static wxWindow * findPythonConsole()
  109. {
  110. return FindWindowByName( pythonConsoleNameId() );
  111. }
  112. /**
  113. * Function syncLayerWidgetLayer
  114. * updates the currently layer "selection" within the PCB_LAYER_WIDGET.
  115. * The currently selected layer is defined by the return value of GetActiveLayer().
  116. * <p>
  117. * This function cannot be inline without including layer_widget.h in
  118. * here and we do not want to do that.
  119. * </p>
  120. */
  121. void syncLayerWidgetLayer();
  122. /**
  123. * Function syncRenderStates
  124. * updates the "Render" checkboxes in the layer widget according
  125. * to current toggle values determined by IsElementVisible(), and is helpful
  126. * immediately after loading a BOARD which may have state information in it.
  127. */
  128. void syncRenderStates();
  129. /**
  130. * Function syncLayerVisibilities
  131. * updates each "Layer" checkbox in the layer widget according
  132. * to each layer's current visibility determined by IsLayerVisible(), and is
  133. * helpful immediately after loading a BOARD which may have state information in it.
  134. */
  135. void syncLayerVisibilities();
  136. virtual void unitsChangeRefresh();
  137. /**
  138. * Function doAutoSave
  139. * performs auto save when the board has been modified and not saved within the
  140. * auto save interval.
  141. *
  142. * @return true if the auto save was successful.
  143. */
  144. virtual bool doAutoSave();
  145. /**
  146. * Function isautoSaveRequired
  147. * returns true if the board has been modified.
  148. */
  149. virtual bool isAutoSaveRequired() const;
  150. /**
  151. * Function duplicateZone
  152. * duplicates the given zone.
  153. * @param aDC is the current Device Context.
  154. * @param aZone is the zone to duplicate
  155. */
  156. void duplicateZone( wxDC* aDC, ZONE_CONTAINER* aZone );
  157. /**
  158. * Function moveExact
  159. * Move the selected item exactly
  160. */
  161. void moveExact();
  162. /**
  163. * Function duplicateItems
  164. * Duplicate selected item if possible and start a move
  165. * @param aIncrement increment the item number if appropriate
  166. */
  167. void duplicateItems( bool aIncrement ); //override
  168. // protected so that PCB::IFACE::CreateWindow() is the only factory.
  169. PCB_EDIT_FRAME( KIWAY* aKiway, wxWindow* aParent );
  170. public:
  171. PCB_LAYER_BOX_SELECTOR* m_SelLayerBox; // a combo box to display and select active layer
  172. wxChoice* m_SelTrackWidthBox; // a choice box to display and select current track width
  173. wxChoice* m_SelViaSizeBox; // a choice box to display and select current via diameter
  174. bool m_show_microwave_tools;
  175. bool m_show_layer_manager_tools;
  176. virtual ~PCB_EDIT_FRAME();
  177. /**
  178. * Function loadFootprints
  179. * loads the footprints for each #COMPONENT in \a aNetlist from the list of libraries.
  180. *
  181. * @param aNetlist is the netlist of components to load the footprints into.
  182. * @param aReporter is the #REPORTER object to report to.
  183. * @throw IO_ERROR if an I/O error occurs or a #PARSE_ERROR if a file parsing error
  184. * occurs while reading footprint library files.
  185. */
  186. void LoadFootprints( NETLIST& aNetlist, REPORTER* aReporter )
  187. throw( IO_ERROR, PARSE_ERROR );
  188. void OnQuit( wxCommandEvent& event );
  189. /**
  190. * Execute a remote command send by Eeschema via a socket,
  191. * port KICAD_PCB_PORT_SERVICE_NUMBER (currently 4242)
  192. * this is a virtual function called by EDA_DRAW_FRAME::OnSockRequest().
  193. * @param cmdline = received command from socket
  194. */
  195. virtual void ExecuteRemoteCommand( const char* cmdline );
  196. void KiwayMailIn( KIWAY_EXPRESS& aEvent ); // virtual overload from KIWAY_PLAYER
  197. /**
  198. * Function ToPlotter
  199. * Open a dialog frame to create plot and drill files
  200. * relative to the current board
  201. */
  202. void ToPlotter( wxCommandEvent& event );
  203. /**
  204. * Function ToPrinter
  205. * Install the print dialog
  206. */
  207. void ToPrinter( wxCommandEvent& event );
  208. /**
  209. * Function SVG_Print
  210. * shows the print SVG file dialog.
  211. */
  212. void SVG_Print( wxCommandEvent& event );
  213. // User interface update command event handlers.
  214. void OnUpdateSave( wxUpdateUIEvent& aEvent );
  215. void OnUpdateLayerPair( wxUpdateUIEvent& aEvent );
  216. void OnUpdateLayerSelectBox( wxUpdateUIEvent& aEvent );
  217. void OnUpdateDrcEnable( wxUpdateUIEvent& aEvent );
  218. void OnUpdateShowBoardRatsnest( wxUpdateUIEvent& aEvent );
  219. void OnUpdateShowModuleRatsnest( wxUpdateUIEvent& aEvent );
  220. void OnUpdateAutoDeleteTrack( wxUpdateUIEvent& aEvent );
  221. void OnUpdateViaDrawMode( wxUpdateUIEvent& aEvent );
  222. void OnUpdateTraceDrawMode( wxUpdateUIEvent& aEvent );
  223. void OnUpdateHighContrastDisplayMode( wxUpdateUIEvent& aEvent );
  224. void OnUpdateShowLayerManager( wxUpdateUIEvent& aEvent );
  225. void OnUpdateShowMicrowaveToolbar( wxUpdateUIEvent& aEvent );
  226. void OnUpdateVerticalToolbar( wxUpdateUIEvent& aEvent );
  227. void OnUpdateSelectViaSize( wxUpdateUIEvent& aEvent );
  228. void OnUpdateZoneDisplayStyle( wxUpdateUIEvent& aEvent );
  229. void OnUpdateSelectTrackWidth( wxUpdateUIEvent& aEvent );
  230. void OnUpdateSelectAutoTrackWidth( wxUpdateUIEvent& aEvent );
  231. void OnUpdateSelectCustomTrackWidth( wxUpdateUIEvent& aEvent );
  232. void OnUpdateAutoPlaceModulesMode( wxUpdateUIEvent& aEvent );
  233. void OnUpdateAutoPlaceTracksMode( wxUpdateUIEvent& aEvent );
  234. void OnUpdateMuWaveToolbar( wxUpdateUIEvent& aEvent );
  235. void OnLayerColorChange( wxCommandEvent& aEvent );
  236. void OnConfigurePaths( wxCommandEvent& aEvent );
  237. void OnUpdatePCBFromSch( wxCommandEvent& event );
  238. /**
  239. * called when the alt key is pressed during a mouse wheel action
  240. */
  241. void OnAltWheel( wxCommandEvent& event );
  242. /**
  243. * Function PrintPage , virtual
  244. * used to print a page
  245. * Print the page pointed by the current screen, set by the calling print function
  246. * @param aDC = wxDC given by the calling print function
  247. * @param aPrintMaskLayer = a 32 bits mask: bit n = 1 -> layer n is printed
  248. * @param aPrintMirrorMode = true to plot mirrored
  249. * @param aData = a pointer on an auxiliary data (NULL if not used)
  250. */
  251. virtual void PrintPage( wxDC* aDC, LSET aPrintMaskLayer, bool aPrintMirrorMode,
  252. void* aData = NULL );
  253. void GetKicadAbout( wxCommandEvent& event );
  254. /**
  255. * Function IsGridVisible() , virtual
  256. * @return true if the grid must be shown
  257. */
  258. virtual bool IsGridVisible() const;
  259. /**
  260. * Function SetGridVisibility() , virtual
  261. * It may be overloaded by derived classes
  262. * if you want to store/retrieve the grid visibility in configuration.
  263. * @param aVisible = true if the grid must be shown
  264. */
  265. virtual void SetGridVisibility( bool aVisible );
  266. /**
  267. * Function GetGridColor() , virtual
  268. * @return the color of the grid
  269. */
  270. virtual EDA_COLOR_T GetGridColor() const;
  271. /**
  272. * Function SetGridColor() , virtual
  273. * @param aColor = the new color of the grid
  274. */
  275. virtual void SetGridColor( EDA_COLOR_T aColor );
  276. ///> @copydoc EDA_DRAW_FRAME::SetCursorShape()
  277. virtual void SetCursorShape( int aCursorShape );
  278. // Configurations:
  279. void Process_Config( wxCommandEvent& event );
  280. /**
  281. * Function GetProjectFileParameters
  282. * returns a project file parameter list for Pcbnew.
  283. * <p>
  284. * Populate a project file parameter array specific to Pcbnew.
  285. * Creating the parameter list at run time has the advantage of being able
  286. * to define local variables. The old method of statically building the array
  287. * at compile time requiring global variable definitions by design.
  288. * </p>
  289. * @return PARAM_CFG_ARRAY - it is only good until SetBoard() is called, so
  290. * don't keep it around past that event.
  291. */
  292. PARAM_CFG_ARRAY GetProjectFileParameters();
  293. /**
  294. * Function SaveProjectSettings
  295. * saves changes to the project settings to the project (.pro) file.
  296. * @param aAskForSave = true to open a dialog before saving the settings
  297. */
  298. void SaveProjectSettings( bool aAskForSave );
  299. /**
  300. * Load the current project's file configuration settings which are pertinent
  301. * to this PCB_EDIT_FRAME instance.
  302. *
  303. * @return always returns true.
  304. */
  305. bool LoadProjectSettings();
  306. /**
  307. * Function GetConfigurationSettings
  308. * returns the Pcbnew applications settings list.
  309. *
  310. * This replaces the old statically defined list that had the project
  311. * file settings and the application settings mixed together. This
  312. * was confusing and caused some settings to get saved and loaded
  313. * incorrectly. Currently, only the settings that are needed at start
  314. * up by the main window are defined here. There are other locally used
  315. * settings that are scattered throughout the Pcbnew source code. If you need
  316. * to define a configuration setting that needs to be loaded at run time,
  317. * this is the place to define it.
  318. *
  319. * @return - Reference to the list of applications settings.
  320. */
  321. PARAM_CFG_ARRAY& GetConfigurationSettings();
  322. void LoadSettings( wxConfigBase* aCfg ); // override virtual
  323. void SaveSettings( wxConfigBase* aCfg ); // override virtual
  324. wxConfigBase* GetSettings() { return config(); };
  325. /**
  326. * Get the last net list read with the net list dialog box.
  327. *
  328. * @return - Absolute path and file name of the last net list file successfully read.
  329. */
  330. wxString GetLastNetListRead();
  331. /**
  332. * Set the last net list successfully read by the net list dialog box.
  333. *
  334. * Note: the file path is converted to a path relative to the project file path. If
  335. * the path cannot be made relative, than m_lastNetListRead is set to and empty
  336. * string. This could happen when the net list file is on a different drive than
  337. * the project file. The advantage of relative paths is that is more likely to
  338. * work when opening the same project from both Windows and Linux.
  339. *
  340. * @param aNetListFile - The last net list file with full path successfully read.
  341. */
  342. void SetLastNetListRead( const wxString& aNetListFile );
  343. ///> @copydoc EDA_DRAW_FRAME::GetHotKeyDescription()
  344. EDA_HOTKEY* GetHotKeyDescription( int aCommand ) const;
  345. /**
  346. * Function OnHotKey.
  347. * ** Commands are case insensitive **
  348. * Some commands are relatives to the item under the mouse cursor
  349. * @param aDC = current device context
  350. * @param aHotkeyCode = hotkey code (ascii or wxWidget code for special keys)
  351. * @param aPosition The cursor position in logical (drawing) units.
  352. * @param aItem = NULL or pointer on a EDA_ITEM under the mouse cursor
  353. */
  354. bool OnHotKey( wxDC* aDC, int aHotkeyCode, const wxPoint& aPosition, EDA_ITEM* aItem = NULL );
  355. /**
  356. * Function OnHotkeyDeleteItem
  357. * Delete the item found under the mouse cursor
  358. * Depending on the current active tool::
  359. * Tool track
  360. * if a track is in progress: Delete the last segment
  361. * else delete the entire track
  362. * Tool module (footprint):
  363. * Delete the module.
  364. * @param aDC = current device context
  365. * @return true if an item was deleted
  366. */
  367. bool OnHotkeyDeleteItem( wxDC* aDC );
  368. /**
  369. * Function OnHotkeyPlaceItem
  370. * Place the item (footprint, track, text .. ) found under the mouse cursor
  371. * An item can be placed only if there is this item currently edited
  372. * Only a footprint, a pad or a track can be placed
  373. * @param aDC = current device context
  374. * @return true if an item was placed
  375. */
  376. bool OnHotkeyPlaceItem( wxDC* aDC );
  377. bool OnHotkeyEditItem( int aIdCommand );
  378. /**
  379. * Function OnHotkeyCopyItem
  380. * returns the copy event id for copyable items.
  381. * @return Event id of a suitable copy event, zero when no copyable item found.
  382. */
  383. int OnHotkeyCopyItem();
  384. /**
  385. * Function OnHotkeyDuplicateOrArrayItem
  386. * Duplicate an item (optionally incrementing if necessary and possible)
  387. * or invoke array dialog and create an array
  388. * @param aIdCommand = the hotkey command id
  389. * @return true if item duplicated or arrayed
  390. */
  391. bool OnHotkeyDuplicateOrArrayItem( int aIdCommand );
  392. /**
  393. * Function OnHotkeyMoveItem
  394. * Moves or drag the item (footprint, track, text .. ) found under the mouse cursor
  395. * Only a footprint or a track can be dragged
  396. * @param aIdCommand = the hotkey command id
  397. * @return true if an item was moved
  398. */
  399. bool OnHotkeyMoveItem( int aIdCommand );
  400. /**
  401. * Function OnHotkeyRotateItem
  402. * Rotate the item (text or footprint) found under the mouse cursor
  403. * @note This command can be used with an item currently in edit.
  404. * Only some items can be rotated (footprints and texts).
  405. * @param aIdCommand = the hotkey command id
  406. * @return true if an item was moved
  407. */
  408. bool OnHotkeyRotateItem( int aIdCommand );
  409. /**
  410. * Function OnHotkeyFlipItem
  411. * Flip the item (text or footprint) found under the mouse cursor
  412. * @note This command can be used with an item currently in edit.
  413. * Only some items can be rotated (footprints and texts).
  414. * @param aIdCommand = the hotkey command id
  415. * @return true if an item was moved
  416. */
  417. bool OnHotkeyFlipItem( int aIdCommand );
  418. /**
  419. * Function OnHotkeyBeginRoute
  420. * If the current active layer is a copper layer,
  421. * and if no item currently edited, start a new track segmenton
  422. * the current copper layer.
  423. * If a new track is in progress, terminate the current segment and
  424. * start a new one.
  425. * @param aDC = current device context
  426. * @return a reference to the track if a track is created, or NULL
  427. */
  428. TRACK * OnHotkeyBeginRoute( wxDC* aDC );
  429. void OnCloseWindow( wxCloseEvent& Event );
  430. void Process_Special_Functions( wxCommandEvent& event );
  431. void Tracks_and_Vias_Size_Event( wxCommandEvent& event );
  432. void OnSelectTool( wxCommandEvent& aEvent );
  433. /**
  434. * Function OnResetModuleTextSizes
  435. * resets text size and width of all module text fields of given field
  436. * type to current settings in Preferences
  437. */
  438. void OnResetModuleTextSizes( wxCommandEvent& event );
  439. void ProcessMuWaveFunctions( wxCommandEvent& event );
  440. void MuWaveCommand( wxDC* DC, const wxPoint& MousePos );
  441. void RedrawActiveWindow( wxDC* DC, bool EraseBg );
  442. void ReCreateHToolbar();
  443. void ReCreateAuxiliaryToolbar();
  444. void ReCreateVToolbar();
  445. void ReCreateMicrowaveVToolbar();
  446. void ReCreateOptToolbar();
  447. void ReCreateMenuBar();
  448. /**
  449. * Re create the layer Box by clearing the old list, and building
  450. * le new one, from the new layers names and cole layers
  451. * @param aForceResizeToolbar = true to resize the parent toolbar
  452. * false if not needed (mainly in parent toolbar creation,
  453. * or when the layers names are not modified)
  454. */
  455. void ReCreateLayerBox( bool aForceResizeToolbar = true );
  456. /**
  457. * Function SetCurrentNetClass
  458. * Must be called after a netclass selection (or after a netclass parameter change
  459. * calls BOARD_DESIGN_SETTINGS::SetCurrentNetClass() and update trace width and via size
  460. * combo boxes on main toolbar
  461. * Initialize vias and tracks values displayed in comb boxes of the auxiliary toolbar
  462. * and some others parameters (netclass name ....)
  463. * @param aNetClassName = the new netclass name
  464. * @return true if lists of tracks and vias sizes are modified
  465. */
  466. bool SetCurrentNetClass( const wxString& aNetClassName );
  467. /**
  468. * Function OnModify
  469. * must be called after a board change to set the modified flag.
  470. * <p>
  471. * Reloads the 3D view if required and calls the base PCB_BASE_FRAME::OnModify function
  472. * to update auxiliary information.
  473. * </p>
  474. */
  475. virtual void OnModify();
  476. /**
  477. * Function SetActiveLayer
  478. * will change the currently active layer to \a aLayer and also
  479. * update the PCB_LAYER_WIDGET.
  480. */
  481. virtual void SetActiveLayer( LAYER_ID aLayer );
  482. /**
  483. * Function IsElementVisible
  484. * tests whether a given element category is visible. Keep this as an
  485. * inline function.
  486. * @param aElement is from the enum by the same name
  487. * @return bool - true if the element is visible.
  488. * @see enum PCB_VISIBLE
  489. */
  490. bool IsElementVisible( int aElement ) const;
  491. /**
  492. * Function SetElementVisibility
  493. * changes the visibility of an element category
  494. * @param aElement is from the enum by the same name
  495. * @param aNewState = The new visibility state of the element category
  496. * @see enum PCB_VISIBLE
  497. */
  498. void SetElementVisibility( int aElement, bool aNewState );
  499. /**
  500. * Function SetVisibleAlls
  501. * Set the status of all visible element categories and layers to VISIBLE
  502. */
  503. void SetVisibleAlls();
  504. /**
  505. * Function ReFillLayerWidget
  506. * changes out all the layers in m_Layers and may be called upon
  507. * loading a new BOARD.
  508. */
  509. void ReFillLayerWidget();
  510. /**
  511. * Function Show3D_Frame
  512. * displays the 3D view of current printed circuit board.
  513. */
  514. void Show3D_Frame( wxCommandEvent& event );
  515. ///> @copydoc EDA_DRAW_FRAME::UseGalCanvas()
  516. void UseGalCanvas( bool aEnable );
  517. bool GeneralControl( wxDC* aDC, const wxPoint& aPosition, EDA_KEY aHotKey = 0 );
  518. /**
  519. * Function ShowDesignRulesEditor
  520. * displays the Design Rules Editor.
  521. */
  522. void ShowDesignRulesEditor( wxCommandEvent& event );
  523. /* toolbars update UI functions: */
  524. void PrepareLayerIndicator();
  525. /* mouse functions events: */
  526. void OnLeftClick( wxDC* DC, const wxPoint& MousePos );
  527. void OnLeftDClick( wxDC* DC, const wxPoint& MousePos );
  528. /**
  529. * Function OnRightClick
  530. * populates a popup menu with the choices appropriate for the current context.
  531. * The caller will add the ZOOM menu choices afterward.
  532. * @param aMousePos The current mouse position
  533. * @param aPopMenu The menu to add to.
  534. */
  535. bool OnRightClick( const wxPoint& aMousePos, wxMenu* aPopMenu );
  536. void OnSelectOptionToolbar( wxCommandEvent& event );
  537. void ToolOnRightClick( wxCommandEvent& event );
  538. /**
  539. * Function SaveCopyInUndoList.
  540. * Creates a new entry in undo list of commands.
  541. * add a picker to handle aItemToCopy
  542. * @param aItemToCopy = the board item modified by the command to undo
  543. * @param aTypeCommand = command type (see enum UNDO_REDO_T)
  544. * @param aTransformPoint = the reference point of the transformation, for
  545. * commands like move
  546. */
  547. virtual void SaveCopyInUndoList( BOARD_ITEM* aItemToCopy,
  548. UNDO_REDO_T aTypeCommand,
  549. const wxPoint& aTransformPoint = wxPoint( 0, 0 ) );
  550. /**
  551. * Function SaveCopyInUndoList (overloaded).
  552. * Creates a new entry in undo list of commands.
  553. * add a list of pickers to handle a list of items
  554. * @param aItemsList = the list of items modified by the command to undo
  555. * @param aTypeCommand = command type (see enum UNDO_REDO_T)
  556. * @param aTransformPoint = the reference point of the transformation, for
  557. * commands like move
  558. */
  559. virtual void SaveCopyInUndoList( const PICKED_ITEMS_LIST& aItemsList,
  560. UNDO_REDO_T aTypeCommand,
  561. const wxPoint& aTransformPoint = wxPoint( 0, 0 ) );
  562. /**
  563. * Function PutDataInPreviousState
  564. * Used in undo or redo command.
  565. * Put data pointed by List in the previous state, i.e. the state memorized by List
  566. * @param aList = a PICKED_ITEMS_LIST pointer to the list of items to undo/redo
  567. * @param aRedoCommand = a bool: true for redo, false for undo
  568. * @param aRebuildRatsnet = a bool: true to rebuild ratsnest (normal use), false
  569. * to just retrieve last state (used in abort commands that do not need to
  570. * rebuild ratsnest)
  571. */
  572. void PutDataInPreviousState( PICKED_ITEMS_LIST* aList,
  573. bool aRedoCommand,
  574. bool aRebuildRatsnet = true );
  575. /**
  576. * Function RestoreCopyFromRedoList
  577. * Redo the last edition:
  578. * - Save the current board in Undo list
  579. * - Get an old version of the board from Redo list
  580. * @return none
  581. */
  582. void RestoreCopyFromRedoList( wxCommandEvent& aEvent );
  583. /**
  584. * Function RestoreCopyFromUndoList
  585. * Undo the last edition:
  586. * - Save the current board in Redo list
  587. * - Get an old version of the board from Undo list
  588. * @return none
  589. */
  590. void RestoreCopyFromUndoList( wxCommandEvent& aEvent );
  591. /* Block operations: */
  592. /**
  593. * Function BlockCommand
  594. * Returns the block command internat code (BLOCK_MOVE, BLOCK_COPY...)
  595. * corresponding to the keys pressed (ALT, SHIFT, SHIFT ALT ..) when
  596. * block command is started by dragging the mouse.
  597. * @param aKey = the key modifiers (Alt, Shift ...)
  598. * @return the block command id (BLOCK_MOVE, BLOCK_COPY...)
  599. */
  600. virtual int BlockCommand( EDA_KEY aKey );
  601. /**
  602. * Function HandleBlockPlace()
  603. * Called after HandleBlockEnd, when a block command needs to be
  604. * executed after the block is moved to its new place
  605. * (bloc move, drag, copy .. )
  606. * Parameters must be initialized in GetScreen()->m_BlockLocate
  607. */
  608. virtual void HandleBlockPlace( wxDC* DC );
  609. /**
  610. * Function HandleBlockEnd()
  611. * Handle the "end" of a block command,
  612. * i.e. is called at the end of the definition of the area of a block.
  613. * depending on the current block command, this command is executed
  614. * or parameters are initialized to prepare a call to HandleBlockPlace
  615. * in GetScreen()->m_BlockLocate
  616. * @return false if no item selected, or command finished,
  617. * true if some items found and HandleBlockPlace must be called later
  618. */
  619. virtual bool HandleBlockEnd( wxDC* DC );
  620. /**
  621. * Function Block_SelectItems
  622. * Uses GetScreen()->m_BlockLocate
  623. * select items within the selected block.
  624. * selected items are put in the pick list
  625. */
  626. void Block_SelectItems();
  627. /**
  628. * Function Block_Delete
  629. * deletes all items within the selected block.
  630. */
  631. void Block_Delete();
  632. /**
  633. * Function Block_Rotate
  634. * Rotate all items within the selected block.
  635. * The rotation center is the center of the block
  636. */
  637. void Block_Rotate();
  638. /**
  639. * Function Block_Flip
  640. * Flip items within the selected block.
  641. * The flip center is the center of the block
  642. */
  643. void Block_Flip();
  644. /**
  645. * Function Block_Move
  646. * move all items within the selected block.
  647. * New location is determined by the current offset from the selected
  648. * block's original location.
  649. */
  650. void Block_Move();
  651. /**
  652. * Function Block_Mirror_X
  653. * mirrors all items within the currently selected block in the X axis.
  654. */
  655. void Block_Mirror_X();
  656. /**
  657. * Function Block_Duplicate
  658. * Duplicate all items within the selected block.
  659. * New location is determined by the current offset from the selected
  660. * block's original location.
  661. */
  662. void Block_Duplicate( bool aIncrement );
  663. void Process_Settings( wxCommandEvent& event );
  664. void OnConfigurePcbOptions( wxCommandEvent& aEvent );
  665. void InstallDisplayOptionsDialog( wxCommandEvent& aEvent );
  666. void InstallPcbGlobalDeleteFrame( const wxPoint& pos );
  667. /**
  668. * Function GenFootprintsPositionFile
  669. * Calls DoGenFootprintsPositionFile to create a footprint position file
  670. * See DoGenFootprintsPositionFile for options and file format
  671. */
  672. void GenFootprintsPositionFile( wxCommandEvent& event );
  673. /**
  674. * Function DoGenFootprintsPositionFile
  675. * Creates an ascii footprint position file
  676. * @param aFullFileName = the full file name of the file to create
  677. * @param aUnitsMM = false to use inches, true to use mm in coordinates
  678. * @param aForceSmdItems = true to force all footprints with smd pads in list
  679. * = false to put only footprints with option "INSERT" in list
  680. * @param aSide = 0 to list footprints on BACK side,
  681. * 1 to list footprints on FRONT side
  682. * 2 to list footprints on both sides
  683. * @return the number of footprints found on aSide side,
  684. * or -1 if the file could not be created
  685. */
  686. int DoGenFootprintsPositionFile( const wxString& aFullFileName, bool aUnitsMM,
  687. bool aForceSmdItems, int aSide );
  688. /**
  689. * Function GenFootprintsReport
  690. * Calls DoGenFootprintsReport to create a footprint reprot file
  691. * See DoGenFootprintsReport for file format
  692. */
  693. void GenFootprintsReport( wxCommandEvent& event );
  694. /**
  695. * Function DoGenFootprintsReport
  696. * Creates an ascii footprint report file giving some infos on footprints
  697. * and board outlines
  698. * @param aFullFilename = the full file name of the file to create
  699. * @param aUnitsMM = false to use inches, true to use mm in coordinates
  700. * @return true if OK, false if error
  701. */
  702. bool DoGenFootprintsReport( const wxString& aFullFilename, bool aUnitsMM );
  703. void InstallDrillFrame( wxCommandEvent& event );
  704. void GenD356File( wxCommandEvent& event );
  705. void ToPostProcess( wxCommandEvent& event );
  706. void OnFileHistory( wxCommandEvent& event );
  707. /**
  708. * Function Files_io
  709. * @param event is the command event handler.
  710. * do nothing else than call Files_io_from_id with the
  711. * wxCommandEvent id
  712. */
  713. void Files_io( wxCommandEvent& event );
  714. /**
  715. * Function Files_io_from_id
  716. * Read and write board files
  717. * @param aId is an event ID ciming from file command events:
  718. * ID_LOAD_FILE
  719. * ID_MENU_READ_BOARD_BACKUP_FILE
  720. * ID_MENU_RECOVER_BOARD_AUTOSAVE
  721. * ID_APPEND_FILE
  722. * ID_NEW_BOARD
  723. * ID_SAVE_BOARD
  724. * ID_COPY_BOARD_AS
  725. * ID_SAVE_BOARD_AS
  726. * Files_io_from_id prepare parameters and calls the specialized function
  727. */
  728. void Files_io_from_id( int aId );
  729. /**
  730. * Function OpenProjectFiles (was LoadOnePcbFile)
  731. * loads a KiCad board (.kicad_pcb) from \a aFileName.
  732. *
  733. * @param aFileSet - hold the BOARD file to load, a vector of one element.
  734. *
  735. * @param aCtl - KICTL_ bits, one to indicate that an append of the board file
  736. * aFileName to the currently loaded file is desired.
  737. * @see #KIWAY_PLAYER for bit defines.
  738. *
  739. * @return bool - false if file load fails, otherwise true.
  740. bool LoadOnePcbFile( const wxString& aFileName, bool aAppend = false,
  741. bool aForceFileDialog = false );
  742. */
  743. bool OpenProjectFiles( const std::vector<wxString>& aFileSet, int aCtl = 0 );
  744. /**
  745. * Function AppendBoardFile
  746. * appends a board file onto the current one, creating God knows what.
  747. * the main purpose is only to allow panelizing boards.
  748. */
  749. bool AppendBoardFile( const wxString& aFullFileName, int aCtl );
  750. /**
  751. * Function SavePcbFile
  752. * writes the board data structures to \a a aFileName
  753. * Creates backup when requested and update flags (modified and saved flgs)
  754. *
  755. * @param aFileName The file name to write or wxEmptyString to prompt user for
  756. * file name.
  757. * @param aCreateBackupFile Creates a back of \a aFileName if true. Helper
  758. * definitions #CREATE_BACKUP_FILE and #NO_BACKUP_FILE
  759. * are defined for improved code readability.
  760. * @return True if file was saved successfully.
  761. */
  762. bool SavePcbFile( const wxString& aFileName, bool aCreateBackupFile = CREATE_BACKUP_FILE );
  763. /**
  764. * Function SavePcbCopy
  765. * writes the board data structures to \a a aFileName
  766. * but unlike SavePcbFile, does not make anything else
  767. * (no backup, borad fliename change, no flag changes ...)
  768. * Used under a project mgr to save under a new name the current board
  769. *
  770. * When not under a project mgr, the full SavePcbFile is used.
  771. * @param aFileName The file name to write.
  772. * @return True if file was saved successfully.
  773. */
  774. bool SavePcbCopy( const wxString& aFileName );
  775. // BOARD handling
  776. /**
  777. * Function Clear_Pcb
  778. * delete all and reinitialize the current board
  779. * @param aQuery = true to prompt user for confirmation, false to initialize silently
  780. */
  781. bool Clear_Pcb( bool aQuery );
  782. ///> @copydoc PCB_BASE_FRAME::SetBoard()
  783. void SetBoard( BOARD* aBoard );
  784. ///> @copydoc PCB_BASE_FRAME::SetPageSettings()
  785. void SetPageSettings( const PAGE_INFO& aPageSettings ); // overload
  786. // Drc control
  787. /* function GetDrcController
  788. * @return the DRC controller
  789. */
  790. DRC* GetDrcController() { return m_drc; }
  791. /**
  792. * Function RecreateBOMFileFromBoard
  793. * Recreates a .cmp file from the current loaded board
  794. * this is the same as created by CvPcb.
  795. * can be used if this file is lost
  796. */
  797. void RecreateCmpFileFromBoard( wxCommandEvent& aEvent );
  798. /**
  799. * Function ArchiveModulesOnBoard
  800. * Save modules in a library:
  801. * @param aStoreInNewLib:
  802. * true : save modules in a existing lib. Existing footprints will be kept
  803. * or updated.
  804. * This lib should be in fp lib table, and is type is .pretty
  805. * false: save modules in a new lib. It it is an existing lib,
  806. * previous footprints will be removed
  807. */
  808. void ArchiveModulesOnBoard( bool aStoreInNewLib );
  809. /**
  810. * Function RecreateBOMFileFromBoard
  811. * Creates a BOM file from the current loaded board
  812. */
  813. void RecreateBOMFileFromBoard( wxCommandEvent& aEvent );
  814. /**
  815. * Function ExportToGenCAD
  816. * creates a file in GenCAD 1.4 format from the current board.
  817. */
  818. void ExportToGenCAD( wxCommandEvent& event );
  819. /**
  820. * Function OnExportVRML
  821. * will export the current BOARD to a VRML file.
  822. */
  823. void OnExportVRML( wxCommandEvent& event );
  824. /**
  825. * Function ExportVRML_File
  826. * Creates the file(s) exporting current BOARD to a VRML file.
  827. *
  828. * @note When copying 3D shapes files, the new filename is build from the full path
  829. * name, changing the separators by underscore. This is needed because files
  830. * with the same shortname can exist in different directories
  831. * @note ExportVRML_File generates coordinates in board units (BIU) inside the file.
  832. * @todo Use mm inside the file. A general scale transform is applied to the whole
  833. * file (1.0 to have the actual WRML unit im mm, 0.001 to have the actual WRML
  834. * unit in meters.
  835. * @note For 3D models built by a 3D modeler, the unit is 0,1 inches. A specific scale
  836. * is applied to 3D models to convert them to internal units.
  837. *
  838. * @param aFullFileName = the full filename of the file to create
  839. * @param aMMtoWRMLunit = the VRML scaling factor:
  840. * 1.0 to export in mm. 0.001 for meters
  841. * @param aExport3DFiles = true to copy 3D shapes in the subir a3D_Subdir
  842. * @param aUseRelativePaths set to true to use relative paths instead of absolute paths
  843. * in the board VRML file URLs.
  844. * @param aUsePlainPCB set to true to export a board with no copper or silkskreen;
  845. * this is useful for generating a VRML file which can be
  846. * converted to a STEP model.
  847. * @param a3D_Subdir = sub directory where 3D shapes files are copied. This is only used
  848. * when aExport3DFiles == true
  849. * @param aXRef = X value of PCB (0,0) reference point
  850. * @param aYRef = Y value of PCB (0,0) reference point
  851. * @return true if Ok.
  852. */
  853. bool ExportVRML_File( const wxString & aFullFileName, double aMMtoWRMLunit,
  854. bool aExport3DFiles, bool aUseRelativePaths,
  855. bool aUsePlainPCB, const wxString & a3D_Subdir,
  856. double aXRef, double aYRef );
  857. /**
  858. * Function ExportToIDF3
  859. * will export the current BOARD to a IDFv3 board and lib files.
  860. */
  861. void ExportToIDF3( wxCommandEvent& event );
  862. /**
  863. * Function ExporttoSPECCTRA
  864. * Ask for a filename and call ExportSpecctraFile to export the current BOARD
  865. * to a specctra dsn file.
  866. */
  867. void ExportToSpecctra( wxCommandEvent& event );
  868. /**
  869. * Function ExportSpecctraFile
  870. * will export the current BOARD to a specctra dsn file.
  871. * See http://www.autotraxeda.com/docs/SPECCTRA/SPECCTRA.pdf for the
  872. * specification.
  873. * @return true if OK
  874. */
  875. bool ExportSpecctraFile( const wxString& aFullFilename );
  876. /**
  877. * Function ImportSpecctraSession
  878. * will import a specctra *.ses file and use it to relocate MODULEs and
  879. * to replace all vias and tracks in an existing and loaded BOARD.
  880. * See http://www.autotraxeda.com/docs/SPECCTRA/SPECCTRA.pdf for the
  881. * specification.
  882. */
  883. void ImportSpecctraSession( wxCommandEvent& event );
  884. /**
  885. * Function ImportSpecctraDesign
  886. * will import a specctra *.dsn file and use it to replace an entire BOARD.
  887. * The new board will not have any graphics, only components, tracks and
  888. * vias.
  889. * See http://www.autotraxeda.com/docs/SPECCTRA/SPECCTRA.pdf for the
  890. * specification.
  891. */
  892. void ImportSpecctraDesign( wxCommandEvent& event );
  893. /**
  894. * Function Access_to_External_Tool
  895. * Run an external tool (like freeroute )
  896. */
  897. void Access_to_External_Tool( wxCommandEvent& event );
  898. /**
  899. * Function ListAndSelectModuleName
  900. * builds and shows a list of existing modules on board that the user can select.
  901. * @return a pointer to the selected module or NULL.
  902. */
  903. MODULE* ListAndSelectModuleName();
  904. /**
  905. * Function ListNetsAndSelect
  906. * called by a command event
  907. * displays the sorted list of nets in a dialog frame
  908. * If a net is selected, it is highlighted
  909. */
  910. void ListNetsAndSelect( wxCommandEvent& event );
  911. void Swap_Layers( wxCommandEvent& event );
  912. // Handling texts on the board
  913. void Rotate_Texte_Pcb( TEXTE_PCB* TextePcb, wxDC* DC );
  914. void FlipTextePcb( TEXTE_PCB* aTextePcb, wxDC* aDC );
  915. TEXTE_PCB* CreateTextePcb( wxDC* aDC, TEXTE_PCB* aText = NULL );
  916. void Delete_Texte_Pcb( TEXTE_PCB* TextePcb, wxDC* DC );
  917. void StartMoveTextePcb( TEXTE_PCB* aTextePcb, wxDC* aDC, bool aErase = true );
  918. void Place_Texte_Pcb( TEXTE_PCB* TextePcb, wxDC* DC );
  919. void InstallTextPCBOptionsFrame( TEXTE_PCB* TextPCB, wxDC* DC );
  920. // Graphic Segments type DRAWSEGMENT
  921. void Start_Move_DrawItem( DRAWSEGMENT* drawitem, wxDC* DC );
  922. void Place_DrawItem( DRAWSEGMENT* drawitem, wxDC* DC );
  923. void InstallGraphicItemPropertiesDialog( DRAWSEGMENT* aItem, wxDC* aDC );
  924. // Footprint edition (see also PCB_BASE_FRAME)
  925. void InstallModuleOptionsFrame( MODULE* Module, wxDC* DC );
  926. /**
  927. * Function StartMoveModule
  928. * Initialize a drag or move pad command
  929. * @param aModule = the module to move or drag
  930. * @param aDC = the current device context
  931. * @param aDragConnectedTracks = true to drag connected tracks,
  932. * false to just move the module
  933. */
  934. void StartMoveModule( MODULE* aModule, wxDC* aDC, bool aDragConnectedTracks );
  935. /**
  936. * Function DlgGlobalChange_PadSettings
  937. * Function to change pad caracteristics for the given footprint
  938. * or all footprints which look like the given footprint
  939. * Options are set by the opened dialog.
  940. * @param aPad is the pattern. The given footprint is the parent of this pad
  941. * @param aRedraw: if true: redraws the footprint
  942. */
  943. void DlgGlobalChange_PadSettings( D_PAD* aPad, bool aRedraw );
  944. /**
  945. * Function Delete Module
  946. * Remove a footprint from m_Modules linked list and put it in undelete buffer
  947. * The ratsnest and pad list are recalculated
  948. * @param aModule = footprint to delete
  949. * @param aDC = currentDevice Context. if NULL: do not redraw new ratsnest
  950. */
  951. bool Delete_Module( MODULE* aModule, wxDC* aDC );
  952. /**
  953. * Function Change_Side_Module
  954. * Flip a footprint (switch layer from component or component to copper)
  955. * The mirroring is made from X axis
  956. * if a footprint is not on copper or component layer it is not flipped
  957. * (it could be on an adhesive layer, not supported at this time)
  958. * @param Module the footprint to flip
  959. * @param DC Current Device Context. if NULL, no redraw
  960. */
  961. void Change_Side_Module( MODULE* Module, wxDC* DC );
  962. int InstallExchangeModuleFrame( MODULE* ExchangeModuleModule );
  963. /**
  964. * Function Exchange_Module
  965. * Replaces OldModule by NewModule, using OldModule settings:
  966. * position, orientation, pad netnames ...)
  967. * OldModule is deleted or put in undo list.
  968. * @param aOldModule = footprint to replace
  969. * @param aNewModule = footprint to put
  970. * @param aUndoPickList = the undo list used to save OldModule. If null,
  971. * OldModule is deleted
  972. */
  973. void Exchange_Module( MODULE* aOldModule, MODULE* aNewModule,
  974. PICKED_ITEMS_LIST* aUndoPickList );
  975. // loading modules: see PCB_BASE_FRAME
  976. // Board handling
  977. void RemoveStruct( BOARD_ITEM* Item, wxDC* DC );
  978. /**
  979. * Function OnEditItemRequest
  980. * Install the corresponding dialog editor for the given item
  981. * @param aDC = the current device context
  982. * @param aItem = a pointer to the BOARD_ITEM to edit
  983. */
  984. void OnEditItemRequest( wxDC* aDC, BOARD_ITEM* aItem );
  985. /**
  986. * Locate track or pad and highlight the corresponding net.
  987. * @return The Netcode, or -1 if no net located.
  988. */
  989. int SelectHighLight( wxDC* DC );
  990. /**
  991. * Function HighLight.
  992. * highlights the net at the current cursor position.
  993. */
  994. void HighLight( wxDC* DC );
  995. // Track and via edition:
  996. void Via_Edit_Control( wxCommandEvent& event );
  997. /**
  998. * Function IsMicroViaAcceptable
  999. * return true if a microvia can be placed on the board.
  1000. * <p>
  1001. * A microvia is a small via restricted to 2 near neighbor layers
  1002. * because its is hole is made by laser which can penetrate only one layer
  1003. * It is mainly used to connect BGA to the first inner layer
  1004. * And it is allowed from an external layer to the first inner layer
  1005. * </p>
  1006. */
  1007. bool IsMicroViaAcceptable( void );
  1008. /**
  1009. * Function Other_Layer_Route
  1010. * operates in one of two ways. If argument track is NULL, then swap the
  1011. * active layer between m_Route_Layer_TOP and m_Route_Layer_BOTTOM. If a
  1012. * track is in progress (track is not NULL), and if DRC allows it, place
  1013. * a via on the end of the current track, and then swap the current active
  1014. * layer and start a new segment on the new layer.
  1015. * @param track A TRACK* to append the via to or NULL.
  1016. * @param DC A device context to draw on.
  1017. * @return bool - true if the operation was successful, else false such as
  1018. * the case where DRC would not allow a via.
  1019. */
  1020. bool Other_Layer_Route( TRACK* track, wxDC* DC );
  1021. void HighlightUnconnectedPads( wxDC* DC );
  1022. /**
  1023. * Function Delete_Segment
  1024. * removes a track segment.
  1025. * If a new track is in progress: delete the current new segment.
  1026. * Otherwise, delete segment under the mouse cursor.
  1027. */
  1028. TRACK* Delete_Segment( wxDC* DC, TRACK* Track );
  1029. void Delete_Track( wxDC* DC, TRACK* Track );
  1030. void Delete_net( wxDC* DC, TRACK* Track );
  1031. /**
  1032. * Function Remove_One_Track
  1033. * removes 1 track/
  1034. * The leading segment is removed and all adjacent segments
  1035. * until a pad or a junction point of more than 2 segments is found
  1036. */
  1037. void Remove_One_Track( wxDC* DC, TRACK* pt_segm );
  1038. /**
  1039. * Function Reset_All_Tracks_And_Vias_To_Netclass_Values
  1040. * Reset all tracks width and/or vias diameters and drill
  1041. * to their default Netclass value
  1042. * @param aTrack : bool true to modify tracks
  1043. * @param aVia : bool true to modify vias
  1044. */
  1045. bool Reset_All_Tracks_And_Vias_To_Netclass_Values( bool aTrack, bool aVia );
  1046. /**
  1047. * Function Change_Net_Tracks_And_Vias_Sizes
  1048. * Reset all tracks width and vias diameters and drill
  1049. * to their default Netclass value or current values
  1050. * @param aNetcode : the netcode of the net to edit
  1051. * @param aUseNetclassValue : bool. True to use netclass values, false to
  1052. * use current values
  1053. */
  1054. bool Change_Net_Tracks_And_Vias_Sizes( int aNetcode, bool aUseNetclassValue );
  1055. /**
  1056. * Function Edit_Track_Width
  1057. * Modify a full track width (using DRC control).
  1058. * a full track is the set of track segments between 2 ends: pads or a
  1059. * point that has more than 2 segments ends connected
  1060. * @param aDC = the curred device context (can be NULL)
  1061. * @param aTrackSegment = a segment or via on the track to change
  1062. */
  1063. void Edit_Track_Width( wxDC* aDC, TRACK* aTrackSegment );
  1064. /**
  1065. * Function Edit_TrackSegm_Width
  1066. * Modify one track segment width or one via diameter (using DRC control).
  1067. * @param aDC = the current device context (can be NULL)
  1068. * @param aTrackItem = the track segment or via to modify
  1069. */
  1070. void Edit_TrackSegm_Width( wxDC* aDC, TRACK* aTrackItem );
  1071. /**
  1072. * Function Begin_Route
  1073. * Starts a new track and/or establish of a new track point.
  1074. *
  1075. * For a new track:
  1076. * - Search the netname of the new track from the starting point
  1077. * if it is on a pad or an existing track
  1078. * - Highlight all this net
  1079. * If a track is in progress:
  1080. * - Call DRC
  1081. * - If DRC is OK: finish the track segment and starts a new one.
  1082. * @param aTrack = the current track segment, or NULL to start a new track
  1083. * @param aDC = the current device context
  1084. * @return a pointer to the new track segment or null if not created (DRC error)
  1085. */
  1086. TRACK* Begin_Route( TRACK* aTrack, wxDC* aDC );
  1087. /**
  1088. * Function End_Route
  1089. * Terminates a track currently being created
  1090. * @param aTrack = the current track segment in progress
  1091. * @param aDC = the current device context
  1092. * @return true if the track was created, false if not (due to a DRC error)
  1093. */
  1094. bool End_Route( TRACK* aTrack, wxDC* aDC );
  1095. void Attribut_Segment( TRACK* track, wxDC* DC, bool Flag_On );
  1096. void Attribut_Track( TRACK* track, wxDC* DC, bool Flag_On );
  1097. void Attribut_net( wxDC* DC, int net_code, bool Flag_On );
  1098. /**
  1099. * Function StartMoveOneNodeOrSegment
  1100. * initializes the parameters to move one via or/and a terminal point of a track segment
  1101. * The terminal point of other connected segments (if any) are moved too.
  1102. */
  1103. void StartMoveOneNodeOrSegment( TRACK* aTrack, wxDC* aDC, int aCommand );
  1104. bool PlaceDraggedOrMovedTrackSegment( TRACK* Track, wxDC* DC );
  1105. /**
  1106. * @todo This function is broken, because it merge segments having different
  1107. * widths or without any connectivity test.
  1108. * 2 collinear segments can be merged only if no other segment or via is
  1109. * connected to the common point and if they have the same width. See
  1110. * cleanup.cpp for merge functions and consider MarkTrace() to locate segments
  1111. * that can be merged
  1112. */
  1113. bool MergeCollinearTracks( TRACK* track, wxDC* DC, int end );
  1114. void Start_DragTrackSegmentAndKeepSlope( TRACK* track, wxDC* DC );
  1115. void SwitchLayer( wxDC* DC, LAYER_ID layer );
  1116. /**
  1117. * Function Add45DegreeSegment
  1118. * adds a track segment between 2 tracks segments if these 2 segments
  1119. * make a 90 deg angle, in order to have 45 deg track segments
  1120. * Its only works on horizontal or vertical segments.
  1121. *
  1122. * @param aDC The wxDC device context to draw on.
  1123. * @return A bool value true if ok or false if not.
  1124. */
  1125. bool Add45DegreeSegment( wxDC* aDC );
  1126. /**
  1127. * Function EraseRedundantTrack
  1128. * Called after creating a track
  1129. * Remove (if exists) the old track that have the same starting and the
  1130. * same ending point as the new created track
  1131. * (this is the redunding track)
  1132. * @param aDC = the current device context (can be NULL)
  1133. * @param aNewTrack = the new created track (a pointer to a segment of the
  1134. * track list)
  1135. * @param aNewTrackSegmentsCount = number of segments in this new track
  1136. * @param aItemsListPicker = the list picker to use for an undo command
  1137. * (can be NULL)
  1138. */
  1139. int EraseRedundantTrack( wxDC* aDC,
  1140. TRACK* aNewTrack,
  1141. int aNewTrackSegmentsCount,
  1142. PICKED_ITEMS_LIST* aItemsListPicker );
  1143. /**
  1144. * Function SetTrackSegmentWidth
  1145. * Modify one track segment width or one via diameter (using DRC control).
  1146. * Basic routine used by other routines when editing tracks or vias
  1147. * @param aTrackItem = the track segment or via to modify
  1148. * @param aItemsListPicker = the list picker to use for an undo command
  1149. * (can be NULL)
  1150. * @param aUseNetclassValue = true to use NetClass value, false to use
  1151. * current designSettings value
  1152. * @return true if done, false if no not change (because DRC error)
  1153. */
  1154. bool SetTrackSegmentWidth( TRACK* aTrackItem,
  1155. PICKED_ITEMS_LIST* aItemsListPicker,
  1156. bool aUseNetclassValue );
  1157. // zone handling
  1158. /**
  1159. * Function Delete_OldZone_Fill (obsolete)
  1160. * Used for compatibility with old boards
  1161. * Remove the zone filling which include the segment aZone, or the zone
  1162. * which have the given time stamp.
  1163. * For old boards, a zone is a group of SEGZONE segments which have the same TimeStamp
  1164. * @param aZone = zone segment within the zone to delete. Can be NULL
  1165. * @param aTimestamp = Timestamp for the zone to delete, used if aZone ==
  1166. * NULL
  1167. */
  1168. void Delete_OldZone_Fill( SEGZONE* aZone, time_t aTimestamp = 0 );
  1169. /**
  1170. * Function Delete_LastCreatedCorner
  1171. * Used only while creating a new zone outline
  1172. * Remove and delete the current outline segment in progress
  1173. * @return 0 if no corner in list, or corner number
  1174. */
  1175. int Delete_LastCreatedCorner( wxDC* DC );
  1176. /**
  1177. * Function Begin_Zone
  1178. * either initializes the first segment of a new zone, or adds an
  1179. * intermediate segment.
  1180. * A new zone can be:
  1181. * created from scratch: the user will be prompted to define parameters (layer, clearence ...)
  1182. * created from a similar zone (s_CurrentZone is used): parameters are copied from
  1183. * s_CurrentZone
  1184. * created as a cutout (an hole) inside s_CurrentZone
  1185. */
  1186. int Begin_Zone( wxDC* DC );
  1187. /**
  1188. * Function End_Zone
  1189. * terminates (if no DRC error ) the zone edge creation process
  1190. * @param DC = current Device Context
  1191. * @return true if Ok, false if DRC error
  1192. */
  1193. bool End_Zone( wxDC* DC );
  1194. /**
  1195. * Function Fill_Zone
  1196. * Calculate the zone filling for the outline zone_container
  1197. * The zone outline is a frontier, and can be complex (with holes)
  1198. * The filling starts from starting points like pads, tracks.
  1199. * If exists the old filling is removed
  1200. * @param aZone = zone to fill
  1201. * @return error level (0 = no error)
  1202. */
  1203. int Fill_Zone( ZONE_CONTAINER* aZone );
  1204. /**
  1205. * Function Fill_All_Zones
  1206. * Fill all zones on the board
  1207. * The old fillings are removed
  1208. * @param aActiveWindow = the current active window, if a progress bar is shown
  1209. * = NULL to do not display a progress bar
  1210. * @param aVerbose = true to show error messages
  1211. */
  1212. int Fill_All_Zones( wxWindow * aActiveWindow, bool aVerbose = true );
  1213. /**
  1214. * Function Add_Zone_Cutout
  1215. * Add a cutout zone to a given zone outline
  1216. * @param DC = current Device Context
  1217. * @param zone_container = parent zone outline
  1218. */
  1219. void Add_Zone_Cutout( wxDC* DC, ZONE_CONTAINER* zone_container );
  1220. /**
  1221. * Function Add_Similar_Zone
  1222. * Add a zone to a given zone outline.
  1223. * if the zones are overlapping they will be merged
  1224. * @param DC = current Device Context
  1225. * @param zone_container = parent zone outline
  1226. */
  1227. void Add_Similar_Zone( wxDC* DC, ZONE_CONTAINER* zone_container );
  1228. /**
  1229. * Function Edit_Zone_Params
  1230. * Edit params (layer, clearance, ...) for a zone outline
  1231. */
  1232. void Edit_Zone_Params( wxDC* DC, ZONE_CONTAINER* zone_container );
  1233. /**
  1234. * Function Start_Move_Zone_Corner
  1235. * Prepares a move corner in a zone outline,
  1236. * called from a move corner command (IsNewCorner = false),
  1237. * or a create new cornet command (IsNewCorner = true )
  1238. */
  1239. void Start_Move_Zone_Corner( wxDC* DC,
  1240. ZONE_CONTAINER* zone_container,
  1241. int corner_id,
  1242. bool IsNewCorner );
  1243. /**
  1244. * Function Start_Move_Zone_Corner
  1245. * Prepares a drag edge in an existing zone outline,
  1246. */
  1247. void Start_Move_Zone_Drag_Outline_Edge( wxDC* DC,
  1248. ZONE_CONTAINER* zone_container,
  1249. int corner_id );
  1250. /**
  1251. * Function End_Move_Zone_Corner_Or_Outlines
  1252. * Terminates a move corner in a zone outline, or a move zone outlines
  1253. * @param DC = current Device Context (can be NULL)
  1254. * @param zone_container: the given zone
  1255. */
  1256. void End_Move_Zone_Corner_Or_Outlines( wxDC* DC, ZONE_CONTAINER* zone_container );
  1257. /**
  1258. * Function End_Move_Zone_Corner_Or_Outlines
  1259. * Remove the currently selected corner in a zone outline
  1260. * the .m_CornerSelection is used as corner selection
  1261. */
  1262. void Remove_Zone_Corner( wxDC* DC, ZONE_CONTAINER* zone_container );
  1263. /**
  1264. * Function Delete_Zone
  1265. * Remove the zone which include the segment aZone, or the zone which have
  1266. * the given time stamp. A zone is a group of segments which have the
  1267. * same TimeStamp
  1268. * @param DC = current Device Context (can be NULL)
  1269. * @param zone_container = zone to modify
  1270. * the member .m_CornerSelection is used to find the outline to remove.
  1271. * if the outline is the main outline, all the zone is removed
  1272. * otherwise, the hole is deleted
  1273. */
  1274. void Delete_Zone_Contour( wxDC* DC, ZONE_CONTAINER* zone_container );
  1275. /**
  1276. * Function Start_Move_Zone_Outlines
  1277. * Initialize parameters to move an existing zone outlines.
  1278. * @param DC = current Device Context (can be NULL)
  1279. * @param zone_container: the given zone to move
  1280. */
  1281. void Start_Move_Zone_Outlines( wxDC* DC, ZONE_CONTAINER* zone_container );
  1282. // Target handling
  1283. PCB_TARGET* CreateTarget( wxDC* DC );
  1284. void DeleteTarget( PCB_TARGET* aTarget, wxDC* DC );
  1285. void BeginMoveTarget( PCB_TARGET* aTarget, wxDC* DC );
  1286. void PlaceTarget( PCB_TARGET* aTarget, wxDC* DC );
  1287. void ShowTargetOptionsDialog( PCB_TARGET* aTarget, wxDC* DC );
  1288. // Graphic segments type DRAWSEGMENT handling:
  1289. DRAWSEGMENT* Begin_DrawSegment( DRAWSEGMENT* Segment, STROKE_T shape, wxDC* DC );
  1290. void End_Edge( DRAWSEGMENT* Segment, wxDC* DC );
  1291. void Delete_Segment_Edge( DRAWSEGMENT* Segment, wxDC* DC );
  1292. void Delete_Drawings_All_Layer( LAYER_ID aLayer );
  1293. // Dimension handling:
  1294. void ShowDimensionPropertyDialog( DIMENSION* aDimension, wxDC* aDC );
  1295. DIMENSION* EditDimension( DIMENSION* aDimension, wxDC* aDC );
  1296. void DeleteDimension( DIMENSION* aDimension, wxDC* aDC );
  1297. void BeginMoveDimensionText( DIMENSION* aItem, wxDC* DC );
  1298. void PlaceDimensionText( DIMENSION* aItem, wxDC* DC );
  1299. // netlist handling:
  1300. void InstallNetlistFrame( wxDC* DC );
  1301. /**
  1302. * Function ReadPcbNetlist
  1303. * reads \a aNetlistFileName and updates the footprints (load missing footprints and
  1304. * delete on demand extra footprints) on the board.
  1305. * Update connectivity info, references, values and "TIME STAMP"
  1306. *
  1307. * @param aNetlistFileName = netlist file name (*.net)
  1308. * @param aCmpFileName = cmp/footprint link file name (*.cmp).
  1309. * if not found or empty, only the netlist will be used
  1310. * @param aReporter is a pointer to a #REPORTER object to write display messages.
  1311. * can be NULL.
  1312. * @param aChangeFootprint if true, footprints that have changed in netlist will be changed
  1313. * @param aDeleteBadTracks if true, erroneous tracks will be deleted
  1314. * @param aDeleteExtraFootprints if true, remove unlocked footprints that are not in netlist
  1315. * @param aSelectByTimestamp if true, use timestamp instead of reference to identify
  1316. * footprints from components (use after reannotation of the
  1317. * schematic)
  1318. * @param aDeleteSinglePadNets if true, remove nets counting only one pad
  1319. * and set net code to 0 for these pads
  1320. * @param aIsDryRun performs a dry run without making any changes if true.
  1321. */
  1322. void ReadPcbNetlist( const wxString& aNetlistFileName,
  1323. const wxString& aCmpFileName,
  1324. REPORTER* aReporter,
  1325. bool aChangeFootprint,
  1326. bool aDeleteBadTracks,
  1327. bool aDeleteExtraFootprints,
  1328. bool aSelectByTimestamp,
  1329. bool aDeleteSinglePadNets,
  1330. bool aIsDryRun );
  1331. /**
  1332. * Function RemoveMisConnectedTracks
  1333. * finds all track segments which are mis-connected (to more than one net).
  1334. * When such a bad segment is found, it is flagged to be removed.
  1335. * All tracks having at least one flagged segment are removed.
  1336. * @return true if any change is made
  1337. */
  1338. bool RemoveMisConnectedTracks();
  1339. // Autoplacement:
  1340. void OnPlaceOrRouteFootprints( wxCommandEvent& event );
  1341. #if defined( KICAD_SCRIPTING_WXPYTHON )
  1342. /**
  1343. * Function ScriptingConsoleEnableDisable
  1344. * enables or disabled the scripting console
  1345. */
  1346. void ScriptingConsoleEnableDisable( wxCommandEvent& aEvent );
  1347. void OnUpdateScriptingConsoleState( wxUpdateUIEvent& aEvent );
  1348. #endif
  1349. void OnSelectAutoPlaceMode( wxCommandEvent& aEvent );
  1350. /**
  1351. * Function OnOrientFootprints
  1352. * install the dialog box for the common Orient Footprints
  1353. */
  1354. void OnOrientFootprints( wxCommandEvent& event );
  1355. /**
  1356. * Function ReOrientModules
  1357. * Set the orientation of footprints
  1358. * @param ModuleMask = mask (wildcard allowed) selection
  1359. * @param Orient = new orientation
  1360. * @param include_fixe = true to orient locked footprints
  1361. * @return true if some footprints modified, false if no change
  1362. */
  1363. bool ReOrientModules( const wxString& ModuleMask, double Orient, bool include_fixe );
  1364. void LockModule( MODULE* aModule, bool aLocked );
  1365. /**
  1366. * Function SpreadFootprints
  1367. * Footprints (after loaded by reading a netlist for instance) are moved
  1368. * to be in a small free area (outside the current board) without overlapping.
  1369. * @param aFootprints: a list of footprints to be spread out.
  1370. * @param aMoveFootprintsOutsideBoardOnly: true to move only
  1371. * footprints outside the board outlines
  1372. * (they are outside if the position of a footprint is outside
  1373. * the board outlines bounding box).
  1374. * @param aCheckForBoardEdges: true to try to place footprints outside of
  1375. * board edges.
  1376. */
  1377. void SpreadFootprints( std::vector<MODULE*>* aFootprints,
  1378. bool aMoveFootprintsOutsideBoardOnly,
  1379. bool aCheckForBoardEdges );
  1380. /**
  1381. * Function AutoPlaceModule
  1382. * automatically places footprints within the confines of the PCB edges.
  1383. * The components with the FIXED status are not moved. If the menu is
  1384. * calling the placement of 1 module, it will be replaced.
  1385. */
  1386. void AutoPlaceModule( MODULE* Module, int place_mode, wxDC* DC );
  1387. // Autorouting:
  1388. int Solve( wxDC* DC, int two_sides );
  1389. void Reset_Noroutable( wxDC* DC );
  1390. void Autoroute( wxDC* DC, int mode );
  1391. void ReadAutoroutedTracks( wxDC* DC );
  1392. void GlobalRoute( wxDC* DC );
  1393. /**
  1394. * Function Show_1_Ratsnest
  1395. * draw ratsnest.
  1396. *
  1397. * The net edge pad with mouse or module locates the mouse.
  1398. * Delete the ratsnest if no module or pad is selected.
  1399. */
  1400. void Show_1_Ratsnest( EDA_ITEM* item, wxDC* DC );
  1401. /**
  1402. * Function Clean_Pcb
  1403. * Clean up the board (remove redundant vias, not connected tracks
  1404. * and merges collinear track segments)
  1405. * Install the cleanup dialog frame to know what should be cleaned
  1406. * and run the cleanup function
  1407. */
  1408. void Clean_Pcb();
  1409. void InstallFindFrame();
  1410. /**
  1411. * Function SendMessageToEESCHEMA
  1412. * sends a message to the schematic editor so that it may move its cursor
  1413. * to a part with the same reference as the objectToSync
  1414. * @param objectToSync The object whose reference is used to synchronize Eeschema.
  1415. */
  1416. void SendMessageToEESCHEMA( BOARD_ITEM* objectToSync );
  1417. /**
  1418. * Function Edit_Gap
  1419. * edits the GAP module if it has changed the position and/or size of the pads that
  1420. * form the gap get a new value.
  1421. */
  1422. void Edit_Gap( wxDC* DC, MODULE* Module );
  1423. /**
  1424. * Function CreateMuWaveBaseFootprint
  1425. * create a basic footprint for micro wave applications.
  1426. * @param aValue = the text value
  1427. * @param aTextSize = the size of ref and value texts ( <= 0 to use board default values )
  1428. * @param aPadCount = number of pads
  1429. * Pads settings are:
  1430. * PAD_ATTRIB_SMD, rectangular, H size = V size = current track width.
  1431. */
  1432. MODULE* CreateMuWaveBaseFootprint( const wxString& aValue, int aTextSize, int aPadCount );
  1433. /**
  1434. * Create_MuWaveComponent
  1435. * creates a module "GAP" or "STUB" used in micro wave designs.
  1436. * This module has 2 pads:
  1437. * PAD_ATTRIB_SMD, rectangular, H size = V size = current track width.
  1438. * the "gap" is isolation created between this 2 pads
  1439. */
  1440. MODULE* Create_MuWaveComponent( int shape_type );
  1441. MODULE* Create_MuWavePolygonShape();
  1442. void Begin_Self( wxDC* DC );
  1443. void ShowChangedLanguage(); // override EDA_BASE_FRAME virtual
  1444. /**
  1445. * Function UpdateTitle
  1446. * sets the main window title bar text.
  1447. * <p>
  1448. * If file name defined by PCB_SCREEN::m_FileName is not set, the title is set to the
  1449. * application name appended with no file. Otherwise, the title is set to the full path
  1450. * and file name and read only is appended to the title if the user does not have write
  1451. * access to the file.
  1452. * </p>
  1453. */
  1454. void UpdateTitle();
  1455. DECLARE_EVENT_TABLE()
  1456. };
  1457. #endif // WXPCB_STRUCT_H_