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.

1205 lines
35 KiB

16 years ago
18 years ago
18 years ago
18 years ago
18 years ago
18 years ago
18 years ago
14 years ago
17 years ago
14 years ago
17 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
++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
++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
16 years ago
16 years ago
16 years ago
16 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
++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
16 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
++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
15 years ago
14 years ago
14 years ago
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
  1. /**
  2. * @file ioascii.cpp
  3. * @brief Routines for reading and saving of structures in ASCII file common to Pcbnew and CvPcb.
  4. */
  5. #include "fctsys.h"
  6. #include "confirm.h"
  7. #include "kicad_string.h"
  8. #include "build_version.h"
  9. #include "wxPcbStruct.h"
  10. #include "richio.h"
  11. #include "macros.h"
  12. #include "pcbcommon.h"
  13. /**
  14. * @todo Fix having to recompile the same file with a different defintion. This is
  15. * what C++ derivation was designed to solve.
  16. */
  17. #ifdef PCBNEW
  18. #include "zones.h"
  19. #endif
  20. #ifdef CVPCB
  21. #include "cvpcb.h"
  22. #endif
  23. #include "class_board.h"
  24. #include "class_module.h"
  25. #include "class_track.h"
  26. #include "class_pcb_text.h"
  27. #include "class_zone.h"
  28. #include "class_dimension.h"
  29. #include "class_drawsegment.h"
  30. #include "class_mire.h"
  31. #include "pcbnew.h"
  32. #include "pcbnew_id.h"
  33. #include "autorout.h"
  34. #include "pcb_plot_params.h"
  35. /* ASCII format of structures:
  36. *
  37. * Structure PAD:
  38. *
  39. * $PAD
  40. * Sh "name" form DIMVA dimH dV dH East: general form dV, dH = delta size
  41. * Dr. diam dV dH: drill: diameter drilling offsets
  42. * At Type S / N layers: standard, cms, conn, hole, meca.,
  43. * Stack / Normal, 32-bit hexadecimal: occupation layers
  44. * Nm net_code netname
  45. * Po posrefX posrefy: reFX position, Y (0 = east position / anchor)
  46. * $EndPAD
  47. *
  48. * Module Structure
  49. *
  50. * $MODULE namelib
  51. * Po ax ay east layer masquelayer m_TimeCode
  52. * ax ay ord = anchor (position module)
  53. * east = east to 0.1 degree
  54. * layer = layer number
  55. * masquelayer = silkscreen layer for
  56. * m_TimeCode internal use (groups)
  57. * Li <namelib>
  58. *
  59. * Cd <text> description of the component (Component Doc)
  60. * Kw <text> List of key words
  61. *
  62. * Sc schematic timestamp, reference schematic
  63. *
  64. * Op rot90 rot180 placement Options Auto (court rot 90, 180)
  65. * rot90 is about 2x4-bit:
  66. * lsb = cost rot 90, rot court msb = -90;
  67. *
  68. * Tn px py DIMVA dimh East thickness mirror visible "text"
  69. * n = type (0 = ref, val = 1,> 1 = qcq
  70. * Texts POS x, y / anchor and orient module 0
  71. * DIMVA dimh East
  72. * mirror thickness (Normal / Mirror)
  73. * Visible V / I
  74. * DS ox oy fx fy w
  75. * Edge: coord segment ox, oy has fx, fy, on
  76. * was the anchor and orient 0
  77. * thickness w
  78. * DC ox oy fx fy w descr circle (center, 1 point, thickness)
  79. * $PAD
  80. * $EndPAD section pads if available
  81. * $Endmodule
  82. */
  83. /// Get the length of a string constant, at compile time
  84. #define SZ( x ) (sizeof(x)-1)
  85. static int NbDraw, NbTrack, NbZone, NbMod, NbNets;
  86. static const char delims[] = " =\n\r";
  87. /** Read a list of segments (Tracks, zones)
  88. * @return items count or - count if no end block ($End...) found.
  89. */
  90. int PCB_BASE_FRAME::ReadListeSegmentDescr( LINE_READER* aReader,
  91. TRACK* insertBeforeMe,
  92. int StructType,
  93. int NumSegm )
  94. {
  95. int shape, width, drill, layer, type, flags, net_code;
  96. int tempStartX, tempStartY;
  97. int tempEndX, tempEndY;
  98. int ii = 0;
  99. TRACK* newTrack;
  100. while( aReader->ReadLine() )
  101. {
  102. char* line = aReader->Line();
  103. int makeType;
  104. unsigned long timeStamp;
  105. if( line[0] == '$' )
  106. {
  107. return ii; // end of segmentlist: OK
  108. }
  109. int arg_count = sscanf( line + 2, " %d %d %d %d %d %d %d", &shape,
  110. &tempStartX, &tempStartY,
  111. &tempEndX, &tempEndY, &width,
  112. &drill );
  113. // Read the 2nd line to determine the exact type, one of:
  114. // PCB_TRACE_T, PCB_VIA_T, or PCB_ZONE_T. The type field in 2nd line
  115. // differentiates between PCB_TRACE_T and PCB_VIA_T. With virtual
  116. // functions in use, it is critical to instantiate the PCB_VIA_T
  117. // exactly.
  118. if( !aReader->ReadLine() )
  119. break;
  120. line = aReader->Line();
  121. if( line[0] == '$' )
  122. break;
  123. // parse the 2nd line first to determine the type of object
  124. sscanf( line + 2, " %d %d %d %lX %X", &layer, &type, &net_code,
  125. &timeStamp, &flags );
  126. if( StructType==PCB_TRACE_T && type==1 )
  127. makeType = PCB_VIA_T;
  128. else
  129. makeType = StructType;
  130. switch( makeType )
  131. {
  132. default:
  133. case PCB_TRACE_T:
  134. newTrack = new TRACK( GetBoard() );
  135. GetBoard()->m_Track.Insert( newTrack, insertBeforeMe );
  136. break;
  137. case PCB_VIA_T:
  138. newTrack = new SEGVIA( GetBoard() );
  139. GetBoard()->m_Track.Insert( newTrack, insertBeforeMe );
  140. break;
  141. case PCB_ZONE_T: // this is now deprecated, but exist in old boards
  142. newTrack = new SEGZONE( GetBoard() );
  143. GetBoard()->m_Zone.Insert( (SEGZONE*) newTrack, (SEGZONE*) insertBeforeMe );
  144. break;
  145. }
  146. newTrack->SetTimeStamp( timeStamp );
  147. newTrack->m_Start.x = tempStartX;
  148. newTrack->m_Start.y = tempStartY;
  149. newTrack->m_End.x = tempEndX;
  150. newTrack->m_End.y = tempEndY;
  151. newTrack->m_Width = width;
  152. newTrack->m_Shape = shape;
  153. if( arg_count < 7 || drill <= 0 )
  154. newTrack->SetDrillDefault();
  155. else
  156. newTrack->SetDrill( drill );
  157. newTrack->SetLayer( layer );
  158. if( makeType == PCB_VIA_T ) // Ensure layers are OK when possible:
  159. {
  160. if( newTrack->GetShape() == VIA_THROUGH )
  161. ( (SEGVIA*) newTrack )->SetLayerPair( LAYER_N_FRONT, LAYER_N_BACK );
  162. }
  163. newTrack->SetNet( net_code );
  164. newTrack->SetState( flags, ON );
  165. }
  166. DisplayError( this, _( "Error: Unexpected end of file !" ) );
  167. return -ii;
  168. }
  169. int PCB_BASE_FRAME::ReadGeneralDescrPcb( LINE_READER* aReader )
  170. {
  171. while( aReader->ReadLine() )
  172. {
  173. char* line = aReader->Line();
  174. char* data = strtok( line, delims );
  175. if( strnicmp( data, "$EndGENERAL", 10 ) == 0 )
  176. break;
  177. if( stricmp( data, "EnabledLayers" ) == 0 )
  178. {
  179. int EnabledLayers = 0;
  180. data = strtok( NULL, delims );
  181. sscanf( data, "%X", &EnabledLayers );
  182. // Setup layer visibility
  183. GetBoard()->SetEnabledLayers( EnabledLayers );
  184. continue;
  185. }
  186. if( strncmp( data, "Ly", 2 ) == 0 ) // Old format for Layer count
  187. {
  188. int Masque_Layer = 1, ii;
  189. data = strtok( NULL, delims );
  190. sscanf( data, "%X", &Masque_Layer );
  191. // Setup layer count
  192. int layer_count = 0;
  193. for( ii = 0; ii < NB_COPPER_LAYERS; ii++ )
  194. {
  195. if( Masque_Layer & 1 )
  196. layer_count++;
  197. Masque_Layer >>= 1;
  198. }
  199. GetBoard()->SetCopperLayerCount( layer_count );
  200. continue;
  201. }
  202. if( stricmp( data, "BoardThickness" ) == 0 )
  203. {
  204. data = strtok( NULL, delims );
  205. GetBoard()->GetDesignSettings().m_BoardThickness = atoi( data );
  206. continue;
  207. }
  208. if( strnicmp( data, "Links", 5 ) == 0 )
  209. {
  210. // Info only, do nothing
  211. continue;
  212. }
  213. if( strnicmp( data, "NoConn", 6 ) == 0 )
  214. {
  215. data = strtok( NULL, delims );
  216. GetBoard()->m_NbNoconnect = atoi( data );
  217. continue;
  218. }
  219. if( strnicmp( data, "Di", 2 ) == 0 )
  220. {
  221. data = strtok( NULL, delims );
  222. int x1 = atoi( data );
  223. data = strtok( NULL, delims );
  224. int y1 = atoi( data );
  225. data = strtok( NULL, delims );
  226. int x2 = atoi( data );
  227. data = strtok( NULL, delims );
  228. int y2 = atoi( data );
  229. EDA_RECT bbbox( wxPoint( x1, y1 ), wxSize( x2-x1, y2-y1 ) );
  230. GetBoard()->SetBoundingBox( bbbox );
  231. continue;
  232. }
  233. // Read the number of segments of type DRAW, TRACK, ZONE
  234. if( stricmp( data, "Ndraw" ) == 0 )
  235. {
  236. data = strtok( NULL, delims );
  237. NbDraw = atoi( data );
  238. continue;
  239. }
  240. if( stricmp( data, "Ntrack" ) == 0 )
  241. {
  242. data = strtok( NULL, delims );
  243. NbTrack = atoi( data );
  244. continue;
  245. }
  246. if( stricmp( data, "Nzone" ) == 0 )
  247. {
  248. data = strtok( NULL, delims );
  249. NbZone = atoi( data );
  250. continue;
  251. }
  252. if( stricmp( data, "Nmodule" ) == 0 )
  253. {
  254. data = strtok( NULL, delims );
  255. NbMod = atoi( data );
  256. continue;
  257. }
  258. if( stricmp( data, "Nnets" ) == 0 )
  259. {
  260. data = strtok( NULL, delims );
  261. NbNets = atoi( data );
  262. continue;
  263. }
  264. }
  265. return 1;
  266. }
  267. int PCB_BASE_FRAME::ReadSetup( LINE_READER* aReader )
  268. {
  269. char* data;
  270. NETCLASS* netclass_default = GetBoard()->m_NetClasses.GetDefault();
  271. while( aReader->ReadLine() )
  272. {
  273. char* line = aReader->Line();
  274. if( strnicmp( line, "PcbPlotParams", 13 ) == 0 )
  275. {
  276. PCB_PLOT_PARAMS_PARSER parser( &line[13], aReader->GetSource() );
  277. try
  278. {
  279. g_PcbPlotOptions.Parse( &parser );
  280. }
  281. catch( IO_ERROR& e )
  282. {
  283. wxString msg;
  284. msg.Printf( _( "Error reading PcbPlotParams from %s:\n%s" ),
  285. aReader->GetSource().GetData(),
  286. e.errorText.GetData() );
  287. wxMessageBox( msg, _( "Open Board File" ), wxOK | wxICON_ERROR );
  288. }
  289. continue;
  290. }
  291. strtok( line, delims );
  292. data = strtok( NULL, delims );
  293. if( stricmp( line, "$EndSETUP" ) == 0 )
  294. {
  295. // Until such time as the *.brd file does not have the
  296. // global parameters:
  297. // "TrackWidth", "TrackMinWidth", "ViaSize", "ViaDrill",
  298. // "ViaMinSize", and "TrackClearence", put those same global
  299. // values into the default NETCLASS until later board load
  300. // code should override them. *.brd files which have been
  301. // saved with knowledge of NETCLASSes will override these
  302. // defaults, old boards will not.
  303. //
  304. // @todo: I expect that at some point we can remove said global
  305. // parameters from the *.brd file since the ones in the
  306. // default netclass serve the same purpose. If needed
  307. // at all, the global defaults should go into a preferences
  308. // file instead so they are there to start new board
  309. // projects.
  310. GetBoard()->m_NetClasses.GetDefault()->SetParams();
  311. return 0;
  312. }
  313. if( stricmp( line, "AuxiliaryAxisOrg" ) == 0 )
  314. {
  315. int gx = 0, gy = 0;
  316. gx = atoi( data );
  317. data = strtok( NULL, delims );
  318. if( data )
  319. gy = atoi( data );
  320. SetOriginAxisPosition( wxPoint( gx, gy ) );
  321. continue;
  322. }
  323. #ifdef PCBNEW
  324. if( stricmp( line, "Layers" ) == 0 )
  325. {
  326. int tmp;
  327. sscanf( data, "%d", &tmp );
  328. GetBoard()->SetCopperLayerCount( tmp );
  329. continue;
  330. }
  331. const int LAYERKEYZ = sizeof("Layer[") - 1;
  332. if( strncmp( line, "Layer[", LAYERKEYZ ) == 0 )
  333. {
  334. // parse:
  335. // Layer[n] <a_Layer_name_with_no_spaces> <LAYER_T>
  336. char* cp = line + LAYERKEYZ;
  337. int layer = atoi( cp );
  338. if( data )
  339. {
  340. wxString layerName = FROM_UTF8( data );
  341. GetBoard()->SetLayerName( layer, layerName );
  342. data = strtok( NULL, " \n\r" );
  343. if( data )
  344. {
  345. LAYER_T type = LAYER::ParseType( data );
  346. GetBoard()->SetLayerType( layer, type );
  347. }
  348. }
  349. continue;
  350. }
  351. if( stricmp( line, "TrackWidth" ) == 0 ) // no more used
  352. {
  353. continue;
  354. }
  355. if( stricmp( line, "TrackWidthList" ) == 0 )
  356. {
  357. int tmp = atoi( data );
  358. GetBoard()->m_TrackWidthList.push_back( tmp );
  359. continue;
  360. }
  361. if( stricmp( line, "TrackClearence" ) == 0 )
  362. {
  363. netclass_default->SetClearance( atoi( data ) );
  364. continue;
  365. }
  366. if( stricmp( line, "TrackMinWidth" ) == 0 )
  367. {
  368. GetBoard()->GetDesignSettings().m_TrackMinWidth = atoi( data );
  369. continue;
  370. }
  371. if( stricmp( line, "ZoneClearence" ) == 0 )
  372. {
  373. g_Zone_Default_Setting.m_ZoneClearance = atoi( data );
  374. continue;
  375. }
  376. if( stricmp( line, "DrawSegmWidth" ) == 0 )
  377. {
  378. GetBoard()->GetDesignSettings().m_DrawSegmentWidth = atoi( data );
  379. continue;
  380. }
  381. if( stricmp( line, "EdgeSegmWidth" ) == 0 )
  382. {
  383. GetBoard()->GetDesignSettings().m_EdgeSegmentWidth = atoi( data );
  384. continue;
  385. }
  386. if( stricmp( line, "ViaSize" ) == 0 ) // no more used
  387. {
  388. continue;
  389. }
  390. if( stricmp( line, "ViaMinSize" ) == 0 )
  391. {
  392. GetBoard()->GetDesignSettings().m_ViasMinSize = atoi( data );
  393. continue;
  394. }
  395. if( stricmp( line, "MicroViaSize" ) == 0 ) // Not used
  396. {
  397. continue;
  398. }
  399. if( stricmp( line, "MicroViaMinSize" ) == 0 )
  400. {
  401. GetBoard()->GetDesignSettings().m_MicroViasMinSize = atoi( data );
  402. continue;
  403. }
  404. if( stricmp( line, "ViaSizeList" ) == 0 )
  405. {
  406. int tmp = atoi( data );
  407. VIA_DIMENSION via_dim;
  408. via_dim.m_Diameter = tmp;
  409. data = strtok( NULL, " \n\r" );
  410. if( data )
  411. {
  412. tmp = atoi( data );
  413. via_dim.m_Drill = tmp > 0 ? tmp : 0;
  414. }
  415. GetBoard()->m_ViasDimensionsList.push_back( via_dim );
  416. continue;
  417. }
  418. if( stricmp( line, "ViaDrill" ) == 0 )
  419. {
  420. int diameter = atoi( data );
  421. netclass_default->SetViaDrill( diameter );
  422. continue;
  423. }
  424. if( stricmp( line, "ViaMinDrill" ) == 0 )
  425. {
  426. GetBoard()->GetDesignSettings().m_ViasMinDrill = atoi( data );
  427. continue;
  428. }
  429. if( stricmp( line, "MicroViaDrill" ) == 0 )
  430. {
  431. int diameter = atoi( data );
  432. netclass_default->SetuViaDrill( diameter );
  433. continue;
  434. }
  435. if( stricmp( line, "MicroViaMinDrill" ) == 0 )
  436. {
  437. int diameter = atoi( data );
  438. GetBoard()->GetDesignSettings().m_MicroViasMinDrill = diameter;
  439. continue;
  440. }
  441. if( stricmp( line, "MicroViasAllowed" ) == 0 )
  442. {
  443. GetBoard()->GetDesignSettings().m_MicroViasAllowed = atoi( data );
  444. continue;
  445. }
  446. if( stricmp( line, "TextPcbWidth" ) == 0 )
  447. {
  448. GetBoard()->GetDesignSettings().m_PcbTextWidth = atoi( data );
  449. continue;
  450. }
  451. if( stricmp( line, "TextPcbSize" ) == 0 )
  452. {
  453. GetBoard()->GetDesignSettings().m_PcbTextSize.x = atoi( data );
  454. data = strtok( NULL, delims );
  455. GetBoard()->GetDesignSettings().m_PcbTextSize.y = atoi( data );
  456. continue;
  457. }
  458. if( stricmp( line, "EdgeModWidth" ) == 0 )
  459. {
  460. g_ModuleSegmentWidth = atoi( data );
  461. continue;
  462. }
  463. if( stricmp( line, "TextModWidth" ) == 0 )
  464. {
  465. g_ModuleTextWidth = atoi( data );
  466. continue;
  467. }
  468. if( stricmp( line, "TextModSize" ) == 0 )
  469. {
  470. g_ModuleTextSize.x = atoi( data );
  471. data = strtok( NULL, delims );
  472. g_ModuleTextSize.y = atoi( data );
  473. continue;
  474. }
  475. if( stricmp( line, "PadSize" ) == 0 )
  476. {
  477. g_Pad_Master.m_Size.x = atoi( data );
  478. data = strtok( NULL, delims );
  479. g_Pad_Master.m_Size.y = atoi( data );
  480. continue;
  481. }
  482. if( stricmp( line, "PadDrill" ) == 0 )
  483. {
  484. g_Pad_Master.m_Drill.x = atoi( data );
  485. g_Pad_Master.m_Drill.y = g_Pad_Master.m_Drill.x;
  486. continue;
  487. }
  488. if( stricmp( line, "Pad2MaskClearance" ) == 0 )
  489. {
  490. GetBoard()->GetDesignSettings().m_SolderMaskMargin = atoi( data );
  491. continue;
  492. }
  493. if( stricmp( line, "Pad2PasteClearance" ) == 0 )
  494. {
  495. GetBoard()->GetDesignSettings().m_SolderPasteMargin = atoi( data );
  496. continue;
  497. }
  498. if( stricmp( line, "Pad2PasteClearanceRatio" ) == 0 )
  499. {
  500. GetBoard()->GetDesignSettings().m_SolderPasteMarginRatio = atof( data );
  501. continue;
  502. }
  503. if( stricmp( line, "GridOrigin" ) == 0 )
  504. {
  505. int Ox = 0;
  506. int Oy = 0;
  507. Ox = atoi( data );
  508. data = strtok( NULL, delims );
  509. if ( data )
  510. Oy = atoi( data );
  511. GetScreen()->m_GridOrigin.x = Ox;
  512. GetScreen()->m_GridOrigin.y = Oy;
  513. continue;
  514. }
  515. #endif
  516. }
  517. /* Ensure tracks and vias sizes lists are ok:
  518. * Sort lists by by increasing value and remove duplicates
  519. * (the first value is not tested, because it is the netclass value
  520. */
  521. sort( GetBoard()->m_ViasDimensionsList.begin() + 1, GetBoard()->m_ViasDimensionsList.end() );
  522. sort( GetBoard()->m_TrackWidthList.begin() + 1, GetBoard()->m_TrackWidthList.end() );
  523. for( unsigned ii = 1; ii < GetBoard()->m_ViasDimensionsList.size() - 1; ii++ )
  524. {
  525. if( GetBoard()->m_ViasDimensionsList[ii] == GetBoard()->m_ViasDimensionsList[ii + 1] )
  526. {
  527. GetBoard()->m_ViasDimensionsList.erase( GetBoard()->m_ViasDimensionsList.begin() + ii );
  528. ii--;
  529. }
  530. }
  531. for( unsigned ii = 1; ii < GetBoard()->m_TrackWidthList.size() - 1; ii++ )
  532. {
  533. if( GetBoard()->m_TrackWidthList[ii] == GetBoard()->m_TrackWidthList[ii + 1] )
  534. {
  535. GetBoard()->m_TrackWidthList.erase( GetBoard()->m_TrackWidthList.begin() + ii );
  536. ii--;
  537. }
  538. }
  539. return 1;
  540. }
  541. #ifdef PCBNEW
  542. static int WriteSetup( FILE* aFile, PCB_EDIT_FRAME* aFrame, BOARD* aBoard )
  543. {
  544. NETCLASS* netclass_default = aBoard->m_NetClasses.GetDefault();
  545. char text[1024];
  546. fprintf( aFile, "$SETUP\n" );
  547. sprintf( text, "InternalUnit %f INCH\n", 1.0 / PCB_INTERNAL_UNIT );
  548. fprintf( aFile, "%s", text );
  549. fprintf( aFile, "Layers %d\n", aBoard->GetCopperLayerCount() );
  550. unsigned layerMask = g_TabAllCopperLayerMask[aBoard->GetCopperLayerCount() - 1];
  551. for( int layer = 0; layerMask; ++layer, layerMask >>= 1 )
  552. {
  553. if( layerMask & 1 )
  554. {
  555. fprintf( aFile, "Layer[%d] %s %s\n", layer,
  556. TO_UTF8( aBoard->GetLayerName( layer ) ),
  557. LAYER::ShowType( aBoard->GetLayerType( layer ) ) );
  558. }
  559. }
  560. // Save current default track width, for compatibility with older Pcbnew version;
  561. fprintf( aFile, "TrackWidth %d\n", aBoard->GetCurrentTrackWidth() );
  562. // Save custom tracks width list (the first is not saved here: this is the netclass value
  563. for( unsigned ii = 1; ii < aBoard->m_TrackWidthList.size(); ii++ )
  564. fprintf( aFile, "TrackWidthList %d\n", aBoard->m_TrackWidthList[ii] );
  565. fprintf( aFile, "TrackClearence %d\n", netclass_default->GetClearance() );
  566. fprintf( aFile, "ZoneClearence %d\n", g_Zone_Default_Setting.m_ZoneClearance );
  567. fprintf( aFile, "TrackMinWidth %d\n", aBoard->GetDesignSettings().m_TrackMinWidth );
  568. fprintf( aFile, "DrawSegmWidth %d\n", aBoard->GetDesignSettings().m_DrawSegmentWidth );
  569. fprintf( aFile, "EdgeSegmWidth %d\n", aBoard->GetDesignSettings().m_EdgeSegmentWidth );
  570. // Save current default via size, for compatibility with older Pcbnew version;
  571. fprintf( aFile, "ViaSize %d\n", netclass_default->GetViaDiameter() );
  572. fprintf( aFile, "ViaDrill %d\n", netclass_default->GetViaDrill() );
  573. fprintf( aFile, "ViaMinSize %d\n", aBoard->GetDesignSettings().m_ViasMinSize );
  574. fprintf( aFile, "ViaMinDrill %d\n", aBoard->GetDesignSettings().m_ViasMinDrill );
  575. // Save custom vias diameters list (the first is not saved here: this is
  576. // the netclass value
  577. for( unsigned ii = 1; ii < aBoard->m_ViasDimensionsList.size(); ii++ )
  578. fprintf( aFile, "ViaSizeList %d %d\n",
  579. aBoard->m_ViasDimensionsList[ii].m_Diameter,
  580. aBoard->m_ViasDimensionsList[ii].m_Drill );
  581. // for old versions compatibility:
  582. fprintf( aFile, "MicroViaSize %d\n", netclass_default->GetuViaDiameter() );
  583. fprintf( aFile, "MicroViaDrill %d\n", netclass_default->GetuViaDrill() );
  584. fprintf( aFile,
  585. "MicroViasAllowed %d\n",
  586. aBoard->GetDesignSettings().m_MicroViasAllowed );
  587. fprintf( aFile,
  588. "MicroViaMinSize %d\n",
  589. aBoard->GetDesignSettings().m_MicroViasMinSize );
  590. fprintf( aFile,
  591. "MicroViaMinDrill %d\n",
  592. aBoard->GetDesignSettings().m_MicroViasMinDrill );
  593. fprintf( aFile, "TextPcbWidth %d\n", aBoard->GetDesignSettings().m_PcbTextWidth );
  594. fprintf( aFile,
  595. "TextPcbSize %d %d\n",
  596. aBoard->GetDesignSettings().m_PcbTextSize.x,
  597. aBoard->GetDesignSettings().m_PcbTextSize.y );
  598. fprintf( aFile, "EdgeModWidth %d\n", g_ModuleSegmentWidth );
  599. fprintf( aFile, "TextModSize %d %d\n", g_ModuleTextSize.x, g_ModuleTextSize.y );
  600. fprintf( aFile, "TextModWidth %d\n", g_ModuleTextWidth );
  601. fprintf( aFile, "PadSize %d %d\n", g_Pad_Master.m_Size.x, g_Pad_Master.m_Size.y );
  602. fprintf( aFile, "PadDrill %d\n", g_Pad_Master.m_Drill.x );
  603. fprintf( aFile,
  604. "Pad2MaskClearance %d\n",
  605. aBoard->GetDesignSettings().m_SolderMaskMargin );
  606. if( aBoard->GetDesignSettings().m_SolderPasteMargin != 0 )
  607. fprintf( aFile,
  608. "Pad2PasteClearance %d\n",
  609. aBoard->GetDesignSettings().m_SolderPasteMargin );
  610. if( aBoard->GetDesignSettings().m_SolderPasteMarginRatio != 0 )
  611. fprintf( aFile,
  612. "Pad2PasteClearanceRatio %g\n",
  613. aBoard->GetDesignSettings().m_SolderPasteMarginRatio );
  614. if ( aFrame->GetScreen()->m_GridOrigin != wxPoint( 0, 0 ) )
  615. {
  616. fprintf( aFile,
  617. "GridOrigin %d %d\n",
  618. aFrame->GetScreen()->m_GridOrigin.x,
  619. aFrame->GetScreen()->m_GridOrigin.y );
  620. }
  621. fprintf( aFile,
  622. "AuxiliaryAxisOrg %d %d\n",
  623. aFrame->GetOriginAxisPosition().x,
  624. aFrame->GetOriginAxisPosition().y );
  625. STRING_FORMATTER sf;
  626. g_PcbPlotOptions.Format( &sf, 0 );
  627. wxString record = FROM_UTF8( sf.GetString().c_str() );
  628. record.Replace( wxT("\n"), wxT(""), true );
  629. record.Replace( wxT(" "), wxT(" "), true);
  630. fprintf( aFile, "PcbPlotParams %s\n", TO_UTF8( record ) );
  631. fprintf( aFile, "$EndSETUP\n\n" );
  632. return 1;
  633. }
  634. #endif
  635. bool PCB_EDIT_FRAME::WriteGeneralDescrPcb( FILE* File )
  636. {
  637. EDA_ITEM* PtStruct = GetBoard()->m_Modules;
  638. int NbModules, NbDrawItem, NbLayers;
  639. // Write copper layer count
  640. NbLayers = GetBoard()->GetCopperLayerCount();
  641. fprintf( File, "$GENERAL\n" );
  642. fprintf( File, "encoding utf-8\n");
  643. fprintf( File, "LayerCount %d\n", NbLayers );
  644. // Write old format for Layer count (for compatibility with old versions of
  645. // pcbnew
  646. fprintf( File,
  647. "Ly %8X\n",
  648. g_TabAllCopperLayerMask[NbLayers - 1] | ALL_NO_CU_LAYERS );
  649. fprintf( File, "EnabledLayers %08X\n", GetBoard()->GetEnabledLayers() );
  650. fprintf( File, "Links %d\n", GetBoard()->GetRatsnestsCount() );
  651. fprintf( File, "NoConn %d\n", GetBoard()->m_NbNoconnect );
  652. // Write board's bounding box info
  653. EDA_RECT bbbox = GetBoard()->ComputeBoundingBox();
  654. fprintf( File, "Di %d %d %d %d\n",
  655. bbbox.GetX(),
  656. bbbox.GetY(),
  657. bbbox.GetRight(),
  658. bbbox.GetBottom() );
  659. // Write segment count for footprints, drawings, track and zones
  660. // Calculate the footprint count
  661. for( NbModules = 0; PtStruct != NULL; PtStruct = PtStruct->Next() )
  662. NbModules++;
  663. PtStruct = GetBoard()->m_Drawings; NbDrawItem = 0;
  664. for( ; PtStruct != NULL; PtStruct = PtStruct->Next() )
  665. NbDrawItem++;
  666. fprintf( File, "Ndraw %d\n", NbDrawItem );
  667. fprintf( File, "Ntrack %d\n", GetBoard()->GetNumSegmTrack() );
  668. fprintf( File, "Nzone %d\n", GetBoard()->GetNumSegmZone() );
  669. fprintf( File, "BoardThickness %d\n", GetBoard()->GetDesignSettings().m_BoardThickness );
  670. fprintf( File, "Nmodule %d\n", NbModules );
  671. fprintf( File, "Nnets %d\n", GetBoard()->GetNetCount() );
  672. fprintf( File, "$EndGENERAL\n\n" );
  673. return true;
  674. }
  675. /**
  676. * Function WriteSheetDescr
  677. * Save the page information (size, texts, date ..)
  678. * @param screen BASE_SCREEN to save
  679. * @param File = an open FILE to write info
  680. */
  681. static bool WriteSheetDescr( const PAGE_INFO& aPageSettings, BASE_SCREEN* screen, FILE* File )
  682. {
  683. fprintf( File, "$SHEETDESCR\n" );
  684. fprintf( File, "Sheet %s %d %d\n",
  685. TO_UTF8( aPageSettings.GetType() ),
  686. aPageSettings.GetSizeMils().x,
  687. aPageSettings.GetSizeMils().y );
  688. fprintf( File, "Title %s\n", EscapedUTF8( screen->m_Title ).c_str() );
  689. fprintf( File, "Date %s\n", EscapedUTF8( screen->m_Date ).c_str() );
  690. fprintf( File, "Rev %s\n", EscapedUTF8( screen->m_Revision ).c_str() );
  691. fprintf( File, "Comp %s\n", EscapedUTF8( screen->m_Company ).c_str() );
  692. fprintf( File, "Comment1 %s\n", EscapedUTF8( screen->m_Commentaire1 ).c_str() );
  693. fprintf( File, "Comment2 %s\n", EscapedUTF8( screen->m_Commentaire2 ).c_str() );
  694. fprintf( File, "Comment3 %s\n", EscapedUTF8( screen->m_Commentaire3 ).c_str() );
  695. fprintf( File, "Comment4 %s\n", EscapedUTF8( screen->m_Commentaire4 ).c_str() );
  696. fprintf( File, "$EndSHEETDESCR\n\n" );
  697. return true;
  698. }
  699. #if !defined( USE_NEW_PCBNEW_LOAD )
  700. static bool ReadSheetDescr( BOARD* aBoard, BASE_SCREEN* screen, LINE_READER* aReader )
  701. {
  702. char buf[1024];
  703. while( aReader->ReadLine() )
  704. {
  705. char* line = aReader->Line();
  706. if( strnicmp( line, "$End", 4 ) == 0 )
  707. return true;
  708. if( strnicmp( line, "Sheet", 4 ) == 0 )
  709. {
  710. // e.g. "Sheet A3 16535 11700"
  711. // width and height are in 1/1000th of an inch, always
  712. PAGE_INFO page;
  713. char* sname = strtok( line + SZ( "Sheet" ), delims );
  714. if( sname )
  715. {
  716. wxString wname = FROM_UTF8( sname );
  717. if( !page.SetType( wname ) )
  718. {
  719. /* this entire file is soon to be deleted.
  720. m_error.Printf( _( "Unknown sheet type '%s' on line:%d" ),
  721. wname.GetData(), m_reader->LineNumber() );
  722. THROW_IO_ERROR( m_error );
  723. */
  724. }
  725. // only parse the width and height if page size is "User"
  726. if( wname == wxT( "User" ) )
  727. {
  728. char* width = strtok( NULL, delims );
  729. char* height = strtok( NULL, delims );
  730. if( width && height )
  731. {
  732. // legacy disk file describes paper in mils
  733. // (1/1000th of an inch)
  734. int w = atoi( width );
  735. int h = atoi( height );
  736. page.SetWidthMils( w );
  737. page.SetHeightMils( h );
  738. }
  739. }
  740. aBoard->SetPageSettings( page );
  741. }
  742. continue;
  743. }
  744. if( strnicmp( line, "Title", 2 ) == 0 )
  745. {
  746. ReadDelimitedText( buf, line, 256 );
  747. screen->m_Title = FROM_UTF8( buf );
  748. continue;
  749. }
  750. if( strnicmp( line, "Date", 2 ) == 0 )
  751. {
  752. ReadDelimitedText( buf, line, 256 );
  753. screen->m_Date = FROM_UTF8( buf );
  754. continue;
  755. }
  756. if( strnicmp( line, "Rev", 2 ) == 0 )
  757. {
  758. ReadDelimitedText( buf, line, 256 );
  759. screen->m_Revision = FROM_UTF8( buf );
  760. continue;
  761. }
  762. if( strnicmp( line, "Comp", 4 ) == 0 )
  763. {
  764. ReadDelimitedText( buf, line, 256 );
  765. screen->m_Company = FROM_UTF8( buf );
  766. continue;
  767. }
  768. if( strnicmp( line, "Comment1", 8 ) == 0 )
  769. {
  770. ReadDelimitedText( buf, line, 256 );
  771. screen->m_Commentaire1 = FROM_UTF8( buf );
  772. continue;
  773. }
  774. if( strnicmp( line, "Comment2", 8 ) == 0 )
  775. {
  776. ReadDelimitedText( buf, line, 256 );
  777. screen->m_Commentaire2 = FROM_UTF8( buf );
  778. continue;
  779. }
  780. if( strnicmp( line, "Comment3", 8 ) == 0 )
  781. {
  782. ReadDelimitedText( buf, line, 256 );
  783. screen->m_Commentaire3 = FROM_UTF8( buf );
  784. continue;
  785. }
  786. if( strnicmp( line, "Comment4", 8 ) == 0 )
  787. {
  788. ReadDelimitedText( buf, line, 256 );
  789. screen->m_Commentaire4 = FROM_UTF8( buf );
  790. continue;
  791. }
  792. }
  793. return false;
  794. }
  795. int PCB_EDIT_FRAME::ReadPcbFile( LINE_READER* aReader, bool Append )
  796. {
  797. wxBusyCursor dummy;
  798. // Switch the locale to standard C (needed to read floating point numbers
  799. // like 1.3)
  800. SetLocaleTo_C_standard();
  801. BOARD* board = GetBoard();
  802. board->m_Status_Pcb = 0;
  803. board->m_NetClasses.Clear();
  804. // Put a dollar sign in front, and test for a specific length of characters
  805. // The -1 is to omit the trailing \0 which is included in sizeof() on a
  806. // string.
  807. #define TESTLINE( x ) (strncmp( line, "$" x, sizeof("$" x) - 1 ) == 0)
  808. while( aReader->ReadLine() )
  809. {
  810. char* line = aReader->Line();
  811. // put the more frequent ones at the top
  812. if( TESTLINE( "MODULE" ) )
  813. {
  814. MODULE* module = new MODULE( board );
  815. board->Add( module, ADD_APPEND );
  816. module->ReadDescr( aReader );
  817. continue;
  818. }
  819. if( TESTLINE( "DRAWSEGMENT" ) )
  820. {
  821. DRAWSEGMENT* dseg = new DRAWSEGMENT( board );
  822. board->Add( dseg, ADD_APPEND );
  823. dseg->ReadDrawSegmentDescr( aReader );
  824. continue;
  825. }
  826. if( TESTLINE( "EQUIPOT" ) )
  827. {
  828. NETINFO_ITEM* net = new NETINFO_ITEM( board );
  829. board->m_NetInfo.AppendNet( net );
  830. net->ReadDescr( aReader );
  831. continue;
  832. }
  833. if( TESTLINE( "TEXTPCB" ) )
  834. {
  835. TEXTE_PCB* pcbtxt = new TEXTE_PCB( board );
  836. board->Add( pcbtxt, ADD_APPEND );
  837. pcbtxt->ReadTextePcbDescr( aReader );
  838. continue;
  839. }
  840. if( TESTLINE( "TRACK" ) )
  841. {
  842. #ifdef PCBNEW
  843. TRACK* insertBeforeMe = Append ? NULL : board->m_Track.GetFirst();
  844. ReadListeSegmentDescr( aReader, insertBeforeMe, PCB_TRACE_T, NbTrack );
  845. #endif
  846. continue;
  847. }
  848. if( TESTLINE( "NCLASS" ) )
  849. {
  850. // create an empty NETCLASS without a name.
  851. NETCLASS* netclass = new NETCLASS( board, wxEmptyString );
  852. // fill it from the *.brd file, and establish its name.
  853. netclass->ReadDescr( aReader );
  854. if( !board->m_NetClasses.Add( netclass ) )
  855. {
  856. // Must have been a name conflict, this is a bad board file.
  857. // User may have done a hand edit to the file.
  858. // Delete netclass if board could not take ownership of it.
  859. delete netclass;
  860. // @todo: throw an exception here, this is a bad board file.
  861. }
  862. continue;
  863. }
  864. if( TESTLINE( "CZONE_OUTLINE" ) )
  865. {
  866. ZONE_CONTAINER* zone_descr = new ZONE_CONTAINER( board );
  867. zone_descr->ReadDescr( aReader );
  868. if( zone_descr->GetNumCorners() > 2 ) // should always occur
  869. board->Add( zone_descr );
  870. else
  871. delete zone_descr;
  872. continue;
  873. }
  874. if( TESTLINE( "COTATION" ) )
  875. {
  876. DIMENSION* dim = new DIMENSION( board );
  877. board->Add( dim, ADD_APPEND );
  878. dim->ReadDimensionDescr( aReader );
  879. continue;
  880. }
  881. if( TESTLINE( "PCB_TARGET" ) )
  882. {
  883. PCB_TARGET* t = new PCB_TARGET( board );
  884. board->Add( t, ADD_APPEND );
  885. t->ReadMirePcbDescr( aReader );
  886. continue;
  887. }
  888. if( TESTLINE( "ZONE" ) )
  889. {
  890. #ifdef PCBNEW
  891. SEGZONE* insertBeforeMe = Append ? NULL : board->m_Zone.GetFirst();
  892. ReadListeSegmentDescr( aReader, insertBeforeMe, PCB_ZONE_T, NbZone );
  893. #endif
  894. continue;
  895. }
  896. if( TESTLINE( "GENERAL" ) )
  897. {
  898. ReadGeneralDescrPcb( aReader );
  899. continue;
  900. }
  901. if( TESTLINE( "SHEETDESCR" ) )
  902. {
  903. ReadSheetDescr( board, GetScreen(), aReader );
  904. continue;
  905. }
  906. if( TESTLINE( "SETUP" ) )
  907. {
  908. if( !Append )
  909. {
  910. ReadSetup( aReader );
  911. }
  912. else
  913. {
  914. while( aReader->ReadLine() )
  915. {
  916. line = aReader->Line();
  917. if( TESTLINE( "EndSETUP" ) )
  918. break;
  919. }
  920. }
  921. continue;
  922. }
  923. if( TESTLINE( "EndPCB" ) )
  924. break;
  925. }
  926. SetLocaleTo_Default(); // revert to the current locale
  927. board->m_Status_Pcb = 0;
  928. // Build the net info list
  929. board->BuildListOfNets();
  930. board->SynchronizeNetsAndNetClasses();
  931. SetStatusText( wxEmptyString );
  932. BestZoom();
  933. return 1;
  934. }
  935. #endif
  936. #ifdef PCBNEW
  937. /* Save the current PCB in ASCII format
  938. * Returns
  939. * 1 if OK
  940. * 0 if error occurs saving file.
  941. */
  942. int PCB_EDIT_FRAME::SavePcbFormatAscii( FILE* aFile )
  943. {
  944. bool rc;
  945. GetBoard()->m_Status_Pcb &= ~CONNEXION_OK;
  946. wxBeginBusyCursor();
  947. // Switch the locale to standard C (needed to print floating point numbers
  948. // like 1.3)
  949. LOCALE_IO toggle;
  950. // Writing file header.
  951. fprintf( aFile, "PCBNEW-BOARD Version %d date %s\n\n", BOARD_FILE_VERSION,
  952. TO_UTF8( DateAndTime() ) );
  953. fprintf( aFile, "# Created by Pcbnew%s\n\n", TO_UTF8( GetBuildVersion() ) );
  954. GetBoard()->SynchronizeNetsAndNetClasses();
  955. // Select default Netclass before writing file.
  956. // Useful to save default values in headers
  957. GetBoard()->SetCurrentNetClass( GetBoard()->m_NetClasses.GetDefault()->GetName() );
  958. WriteGeneralDescrPcb( aFile );
  959. WriteSheetDescr( GetBoard()->GetPageSettings(), GetScreen(), aFile );
  960. WriteSetup( aFile, this, GetBoard() );
  961. rc = GetBoard()->Save( aFile );
  962. wxEndBusyCursor();
  963. if( !rc )
  964. DisplayError( this, wxT( "Unable to save PCB file" ) );
  965. else
  966. SetStatusText( wxEmptyString );
  967. return rc;
  968. }
  969. #endif