2011-10-13 19:56:32 +00:00
|
|
|
/*
|
|
|
|
* This program source code file is part of KiCad, a free EDA CAD application.
|
|
|
|
*
|
2013-10-14 15:29:16 +00:00
|
|
|
* Copyright (C) 2010 Jean-Pierre Charras, jp.charras@wanadoo.fr
|
2016-01-10 21:24:13 +00:00
|
|
|
* Copyright (C) 1992-2016 KiCad Developers, see AUTHORS.txt for contributors.
|
2011-10-13 19:56:32 +00:00
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
|
|
|
* of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, you may find one here:
|
|
|
|
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
|
|
|
|
* or you may search the http://www.gnu.org website for the version 2 license,
|
|
|
|
* or you may write to the Free Software Foundation, Inc.,
|
|
|
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
|
|
|
*/
|
|
|
|
|
2011-09-15 17:58:35 +00:00
|
|
|
/**
|
|
|
|
* @file wxPcbStruct.h
|
|
|
|
*/
|
2008-01-01 11:58:14 +00:00
|
|
|
|
2012-10-15 22:30:01 +00:00
|
|
|
#ifndef WXPCB_STRUCT_H_
|
|
|
|
#define WXPCB_STRUCT_H_
|
2008-01-01 11:58:14 +00:00
|
|
|
|
|
|
|
|
2014-07-09 11:50:27 +00:00
|
|
|
#include <pcb_base_edit_frame.h>
|
* KIWAY Milestone A): Make major modules into DLL/DSOs.
! The initial testing of this commit should be done using a Debug build so that
all the wxASSERT()s are enabled. Also, be sure and keep enabled the
USE_KIWAY_DLLs option. The tree won't likely build without it. Turning it
off is senseless anyways. If you want stable code, go back to a prior version,
the one tagged with "stable".
* Relocate all functionality out of the wxApp derivative into more finely
targeted purposes:
a) DLL/DSO specific
b) PROJECT specific
c) EXE or process specific
d) configuration file specific data
e) configuration file manipulations functions.
All of this functionality was blended into an extremely large wxApp derivative
and that was incompatible with the desire to support multiple concurrently
loaded DLL/DSO's ("KIFACE")s and multiple concurrently open projects.
An amazing amount of organization come from simply sorting each bit of
functionality into the proper box.
* Switch to wxConfigBase from wxConfig everywhere except instantiation.
* Add classes KIWAY, KIFACE, KIFACE_I, SEARCH_STACK, PGM_BASE, PGM_KICAD,
PGM_SINGLE_TOP,
* Remove "Return" prefix on many function names.
* Remove obvious comments from CMakeLists.txt files, and from else() and endif()s.
* Fix building boost for use in a DSO on linux.
* Remove some of the assumptions in the CMakeLists.txt files that windows had
to be the host platform when building windows binaries.
* Reduce the number of wxStrings being constructed at program load time via
static construction.
* Pass wxConfigBase* to all SaveSettings() and LoadSettings() functions so that
these functions are useful even when the wxConfigBase comes from another
source, as is the case in the KICAD_MANAGER_FRAME.
* Move the setting of the KIPRJMOD environment variable into class PROJECT,
so that it can be moved into a project variable soon, and out of FP_LIB_TABLE.
* Add the KIWAY_PLAYER which is associated with a particular PROJECT, and all
its child wxFrames and wxDialogs now have a Kiway() member function which
returns a KIWAY& that that window tree branch is in support of. This is like
wxWindows DNA in that child windows get this member with proper value at time
of construction.
* Anticipate some of the needs for milestones B) and C) and make code
adjustments now in an effort to reduce work in those milestones.
* No testing has been done for python scripting, since milestone C) has that
being largely reworked and re-thought-out.
2014-03-20 00:42:08 +00:00
|
|
|
#include <config_params.h>
|
2012-01-23 04:33:36 +00:00
|
|
|
#include <class_undoredo_container.h>
|
2012-02-06 05:44:19 +00:00
|
|
|
#include <zones.h>
|
2008-01-01 11:58:14 +00:00
|
|
|
|
|
|
|
|
|
|
|
/* Forward declarations of classes. */
|
|
|
|
class PCB_SCREEN;
|
|
|
|
class BOARD;
|
2016-08-17 15:24:04 +00:00
|
|
|
class BOARD_COMMIT;
|
2016-05-13 15:31:54 +00:00
|
|
|
class BOARD_ITEM_CONTAINER;
|
2008-01-01 11:58:14 +00:00
|
|
|
class TEXTE_PCB;
|
|
|
|
class MODULE;
|
|
|
|
class TRACK;
|
|
|
|
class SEGZONE;
|
2014-04-25 06:00:04 +00:00
|
|
|
class VIA;
|
2008-01-01 11:58:14 +00:00
|
|
|
class D_PAD;
|
|
|
|
class TEXTE_MODULE;
|
2011-09-07 19:41:04 +00:00
|
|
|
class PCB_TARGET;
|
2010-04-23 09:54:40 +00:00
|
|
|
class DIMENSION;
|
2008-01-01 11:58:14 +00:00
|
|
|
class EDGE_MODULE;
|
|
|
|
class DRC;
|
|
|
|
class ZONE_CONTAINER;
|
2009-02-04 15:25:03 +00:00
|
|
|
class DRAWSEGMENT;
|
|
|
|
class GENERAL_COLLECTOR;
|
|
|
|
class GENERAL_COLLECTORS_GUIDE;
|
2010-01-24 02:05:07 +00:00
|
|
|
class PCB_LAYER_WIDGET;
|
2011-09-20 13:57:40 +00:00
|
|
|
class MARKER_PCB;
|
|
|
|
class BOARD_ITEM;
|
2012-05-04 17:44:42 +00:00
|
|
|
class PCB_LAYER_BOX_SELECTOR;
|
2013-04-25 16:29:35 +00:00
|
|
|
class NETLIST;
|
|
|
|
class REPORTER;
|
2014-03-16 17:40:23 +00:00
|
|
|
struct PARSE_ERROR;
|
2016-09-21 02:58:20 +00:00
|
|
|
class IO_ERROR;
|
2013-05-20 14:49:20 +00:00
|
|
|
class FP_LIB_TABLE;
|
2008-01-01 11:58:14 +00:00
|
|
|
|
* KIWAY Milestone A): Make major modules into DLL/DSOs.
! The initial testing of this commit should be done using a Debug build so that
all the wxASSERT()s are enabled. Also, be sure and keep enabled the
USE_KIWAY_DLLs option. The tree won't likely build without it. Turning it
off is senseless anyways. If you want stable code, go back to a prior version,
the one tagged with "stable".
* Relocate all functionality out of the wxApp derivative into more finely
targeted purposes:
a) DLL/DSO specific
b) PROJECT specific
c) EXE or process specific
d) configuration file specific data
e) configuration file manipulations functions.
All of this functionality was blended into an extremely large wxApp derivative
and that was incompatible with the desire to support multiple concurrently
loaded DLL/DSO's ("KIFACE")s and multiple concurrently open projects.
An amazing amount of organization come from simply sorting each bit of
functionality into the proper box.
* Switch to wxConfigBase from wxConfig everywhere except instantiation.
* Add classes KIWAY, KIFACE, KIFACE_I, SEARCH_STACK, PGM_BASE, PGM_KICAD,
PGM_SINGLE_TOP,
* Remove "Return" prefix on many function names.
* Remove obvious comments from CMakeLists.txt files, and from else() and endif()s.
* Fix building boost for use in a DSO on linux.
* Remove some of the assumptions in the CMakeLists.txt files that windows had
to be the host platform when building windows binaries.
* Reduce the number of wxStrings being constructed at program load time via
static construction.
* Pass wxConfigBase* to all SaveSettings() and LoadSettings() functions so that
these functions are useful even when the wxConfigBase comes from another
source, as is the case in the KICAD_MANAGER_FRAME.
* Move the setting of the KIPRJMOD environment variable into class PROJECT,
so that it can be moved into a project variable soon, and out of FP_LIB_TABLE.
* Add the KIWAY_PLAYER which is associated with a particular PROJECT, and all
its child wxFrames and wxDialogs now have a Kiway() member function which
returns a KIWAY& that that window tree branch is in support of. This is like
wxWindows DNA in that child windows get this member with proper value at time
of construction.
* Anticipate some of the needs for milestones B) and C) and make code
adjustments now in an effort to reduce work in those milestones.
* No testing has been done for python scripting, since milestone C) has that
being largely reworked and re-thought-out.
2014-03-20 00:42:08 +00:00
|
|
|
namespace PCB { struct IFACE; } // KIFACE_I is in pcbnew.cpp
|
|
|
|
|
2009-07-30 11:04:07 +00:00
|
|
|
/**
|
* KIWAY Milestone A): Make major modules into DLL/DSOs.
! The initial testing of this commit should be done using a Debug build so that
all the wxASSERT()s are enabled. Also, be sure and keep enabled the
USE_KIWAY_DLLs option. The tree won't likely build without it. Turning it
off is senseless anyways. If you want stable code, go back to a prior version,
the one tagged with "stable".
* Relocate all functionality out of the wxApp derivative into more finely
targeted purposes:
a) DLL/DSO specific
b) PROJECT specific
c) EXE or process specific
d) configuration file specific data
e) configuration file manipulations functions.
All of this functionality was blended into an extremely large wxApp derivative
and that was incompatible with the desire to support multiple concurrently
loaded DLL/DSO's ("KIFACE")s and multiple concurrently open projects.
An amazing amount of organization come from simply sorting each bit of
functionality into the proper box.
* Switch to wxConfigBase from wxConfig everywhere except instantiation.
* Add classes KIWAY, KIFACE, KIFACE_I, SEARCH_STACK, PGM_BASE, PGM_KICAD,
PGM_SINGLE_TOP,
* Remove "Return" prefix on many function names.
* Remove obvious comments from CMakeLists.txt files, and from else() and endif()s.
* Fix building boost for use in a DSO on linux.
* Remove some of the assumptions in the CMakeLists.txt files that windows had
to be the host platform when building windows binaries.
* Reduce the number of wxStrings being constructed at program load time via
static construction.
* Pass wxConfigBase* to all SaveSettings() and LoadSettings() functions so that
these functions are useful even when the wxConfigBase comes from another
source, as is the case in the KICAD_MANAGER_FRAME.
* Move the setting of the KIPRJMOD environment variable into class PROJECT,
so that it can be moved into a project variable soon, and out of FP_LIB_TABLE.
* Add the KIWAY_PLAYER which is associated with a particular PROJECT, and all
its child wxFrames and wxDialogs now have a Kiway() member function which
returns a KIWAY& that that window tree branch is in support of. This is like
wxWindows DNA in that child windows get this member with proper value at time
of construction.
* Anticipate some of the needs for milestones B) and C) and make code
adjustments now in an effort to reduce work in those milestones.
* No testing has been done for python scripting, since milestone C) has that
being largely reworked and re-thought-out.
2014-03-20 00:42:08 +00:00
|
|
|
* Class PCB_EDIT_FRAME
|
|
|
|
* is the main frame for Pcbnew.
|
2011-09-26 20:32:56 +00:00
|
|
|
*
|
2011-09-30 18:15:37 +00:00
|
|
|
* See also class PCB_BASE_FRAME(): Basic class for Pcbnew and GerbView.
|
2009-11-23 20:18:47 +00:00
|
|
|
*/
|
2015-03-02 17:29:18 +00:00
|
|
|
#define PCB_EDIT_FRAME_NAME wxT( "PcbFrame" )
|
|
|
|
|
2016-08-11 19:13:47 +00:00
|
|
|
|
2014-07-09 11:50:27 +00:00
|
|
|
class PCB_EDIT_FRAME : public PCB_BASE_EDIT_FRAME
|
2008-01-01 11:58:14 +00:00
|
|
|
{
|
2014-11-15 13:43:23 +00:00
|
|
|
friend struct PCB::IFACE;
|
2010-01-24 02:05:07 +00:00
|
|
|
friend class PCB_LAYER_WIDGET;
|
|
|
|
|
2011-02-21 13:54:29 +00:00
|
|
|
void updateTraceWidthSelectBox();
|
|
|
|
void updateViaSizeSelectBox();
|
|
|
|
|
2011-12-14 20:03:15 +00:00
|
|
|
/// The auxiliary right vertical tool bar used to access the microwave tools.
|
2011-12-16 13:32:23 +00:00
|
|
|
wxAuiToolBar* m_microWaveToolBar;
|
2011-12-14 20:03:15 +00:00
|
|
|
|
2013-04-25 16:29:35 +00:00
|
|
|
|
2010-01-21 07:41:30 +00:00
|
|
|
protected:
|
2010-01-24 02:05:07 +00:00
|
|
|
PCB_LAYER_WIDGET* m_Layers;
|
|
|
|
|
2013-02-02 17:39:59 +00:00
|
|
|
DRC* m_drc; ///< the DRC controller, see drc.cpp
|
2010-01-24 02:05:07 +00:00
|
|
|
|
2013-11-12 01:05:23 +00:00
|
|
|
PARAM_CFG_ARRAY m_configSettings; ///< List of Pcbnew configuration settings.
|
2010-04-23 14:46:00 +00:00
|
|
|
|
2013-02-02 17:39:59 +00:00
|
|
|
wxString m_lastNetListRead; ///< Last net list read with relative path.
|
2010-04-23 14:46:00 +00:00
|
|
|
|
2014-07-09 13:02:56 +00:00
|
|
|
// The Tool Framework initalization
|
2013-08-02 15:25:53 +00:00
|
|
|
void setupTools();
|
2013-11-12 01:05:23 +00:00
|
|
|
|
2010-01-24 02:05:07 +00:00
|
|
|
// we'll use lower case function names for private member functions.
|
|
|
|
void createPopUpMenuForZones( ZONE_CONTAINER* edge_zone, wxMenu* aPopMenu );
|
|
|
|
void createPopUpMenuForFootprints( MODULE* aModule, wxMenu* aPopMenu );
|
|
|
|
void createPopUpMenuForFpTexts( TEXTE_MODULE* aText, wxMenu* aPopMenu );
|
|
|
|
void createPopUpMenuForFpPads( D_PAD* aPad, wxMenu* aPopMenu );
|
|
|
|
void createPopupMenuForTracks( TRACK* aTrack, wxMenu* aPopMenu );
|
|
|
|
void createPopUpMenuForTexts( TEXTE_PCB* Text, wxMenu* menu );
|
|
|
|
void createPopUpBlockMenu( wxMenu* menu );
|
|
|
|
void createPopUpMenuForMarkers( MARKER_PCB* aMarker, wxMenu* aPopMenu );
|
|
|
|
|
2015-05-08 08:58:59 +00:00
|
|
|
/**
|
|
|
|
* an helper function to enable some menus only active when the display
|
|
|
|
* is switched to GAL mode and which do nothing in legacy mode
|
|
|
|
*/
|
|
|
|
void enableGALSpecificMenus();
|
|
|
|
|
2017-01-22 09:05:46 +00:00
|
|
|
#if defined(KICAD_SCRIPTING) && defined(KICAD_SCRIPTING_ACTION_MENU)
|
|
|
|
/**
|
2017-01-22 19:23:00 +00:00
|
|
|
* Function RebuildActionPluginMenus
|
2017-01-22 09:05:46 +00:00
|
|
|
* Fill action menu with all registred action plugins
|
|
|
|
*/
|
2017-01-22 19:23:00 +00:00
|
|
|
void RebuildActionPluginMenus();
|
2017-01-22 09:05:46 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Function OnActionPlugin
|
|
|
|
* Launched by the menu when an action is called
|
|
|
|
* @param aEvent sent by wx
|
|
|
|
*/
|
|
|
|
void OnActionPlugin( wxCommandEvent& aEvent);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Function OnActionPluginRefresh
|
|
|
|
* Refresh plugin list (reload Python plugins)
|
|
|
|
* @param aEvent sent by wx
|
|
|
|
*/
|
2017-01-29 11:25:19 +00:00
|
|
|
void OnActionPluginRefresh( wxCommandEvent& aEvent)
|
|
|
|
{
|
|
|
|
PythonPluginsReload();
|
|
|
|
}
|
2017-01-22 09:05:46 +00:00
|
|
|
#endif
|
|
|
|
|
2017-01-28 17:47:11 +00:00
|
|
|
/** Has meaning only if KICAD_SCRIPTING_WXPYTHON option is
|
|
|
|
* not defined
|
2014-10-31 07:51:22 +00:00
|
|
|
* @return the frame name identifier for the python console frame
|
|
|
|
*/
|
|
|
|
static const wxChar * pythonConsoleNameId()
|
|
|
|
{
|
|
|
|
return wxT( "PythonConsole" );
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @return a pointer to the python console frame, or NULL if not exist
|
|
|
|
*/
|
|
|
|
static wxWindow * findPythonConsole()
|
|
|
|
{
|
|
|
|
return FindWindowByName( pythonConsoleNameId() );
|
|
|
|
}
|
|
|
|
|
2010-01-24 02:05:07 +00:00
|
|
|
/**
|
2012-02-06 05:44:19 +00:00
|
|
|
* Function syncLayerWidgetLayer
|
2012-03-12 00:40:48 +00:00
|
|
|
* updates the currently layer "selection" within the PCB_LAYER_WIDGET.
|
2014-03-21 10:17:47 +00:00
|
|
|
* The currently selected layer is defined by the return value of GetActiveLayer().
|
2010-01-24 02:05:07 +00:00
|
|
|
* <p>
|
|
|
|
* This function cannot be inline without including layer_widget.h in
|
|
|
|
* here and we do not want to do that.
|
2011-02-21 13:54:29 +00:00
|
|
|
* </p>
|
2010-01-24 02:05:07 +00:00
|
|
|
*/
|
2012-02-06 05:44:19 +00:00
|
|
|
void syncLayerWidgetLayer();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Function syncRenderStates
|
|
|
|
* updates the "Render" checkboxes in the layer widget according
|
|
|
|
* to current toggle values determined by IsElementVisible(), and is helpful
|
|
|
|
* immediately after loading a BOARD which may have state information in it.
|
|
|
|
*/
|
|
|
|
void syncRenderStates();
|
2010-01-24 02:05:07 +00:00
|
|
|
|
2012-03-12 00:40:48 +00:00
|
|
|
/**
|
|
|
|
* Function syncLayerVisibilities
|
|
|
|
* updates each "Layer" checkbox in the layer widget according
|
|
|
|
* to each layer's current visibility determined by IsLayerVisible(), and is
|
|
|
|
* helpful immediately after loading a BOARD which may have state information in it.
|
|
|
|
*/
|
|
|
|
void syncLayerVisibilities();
|
|
|
|
|
2016-09-24 18:53:15 +00:00
|
|
|
virtual void unitsChangeRefresh() override;
|
2010-01-21 07:41:30 +00:00
|
|
|
|
2011-10-13 19:56:32 +00:00
|
|
|
/**
|
|
|
|
* Function doAutoSave
|
|
|
|
* performs auto save when the board has been modified and not saved within the
|
|
|
|
* auto save interval.
|
|
|
|
*
|
|
|
|
* @return true if the auto save was successful.
|
|
|
|
*/
|
2016-09-24 18:53:15 +00:00
|
|
|
virtual bool doAutoSave() override;
|
2011-10-13 19:56:32 +00:00
|
|
|
|
|
|
|
/**
|
2011-10-15 13:25:57 +00:00
|
|
|
* Function isautoSaveRequired
|
2011-10-13 19:56:32 +00:00
|
|
|
* returns true if the board has been modified.
|
|
|
|
*/
|
2016-09-24 18:53:15 +00:00
|
|
|
virtual bool isAutoSaveRequired() const override;
|
2011-10-13 19:56:32 +00:00
|
|
|
|
2012-06-05 11:44:22 +00:00
|
|
|
/**
|
|
|
|
* Function duplicateZone
|
|
|
|
* duplicates the given zone.
|
|
|
|
* @param aDC is the current Device Context.
|
|
|
|
* @param aZone is the zone to duplicate
|
|
|
|
*/
|
|
|
|
void duplicateZone( wxDC* aDC, ZONE_CONTAINER* aZone );
|
|
|
|
|
2015-02-12 03:22:24 +00:00
|
|
|
/**
|
|
|
|
* Function moveExact
|
|
|
|
* Move the selected item exactly
|
|
|
|
*/
|
|
|
|
void moveExact();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Function duplicateItems
|
|
|
|
* Duplicate selected item if possible and start a move
|
|
|
|
* @param aIncrement increment the item number if appropriate
|
|
|
|
*/
|
2016-09-24 18:53:15 +00:00
|
|
|
void duplicateItems( bool aIncrement ) override;
|
2015-02-12 03:22:24 +00:00
|
|
|
|
* KIWAY Milestone A): Make major modules into DLL/DSOs.
! The initial testing of this commit should be done using a Debug build so that
all the wxASSERT()s are enabled. Also, be sure and keep enabled the
USE_KIWAY_DLLs option. The tree won't likely build without it. Turning it
off is senseless anyways. If you want stable code, go back to a prior version,
the one tagged with "stable".
* Relocate all functionality out of the wxApp derivative into more finely
targeted purposes:
a) DLL/DSO specific
b) PROJECT specific
c) EXE or process specific
d) configuration file specific data
e) configuration file manipulations functions.
All of this functionality was blended into an extremely large wxApp derivative
and that was incompatible with the desire to support multiple concurrently
loaded DLL/DSO's ("KIFACE")s and multiple concurrently open projects.
An amazing amount of organization come from simply sorting each bit of
functionality into the proper box.
* Switch to wxConfigBase from wxConfig everywhere except instantiation.
* Add classes KIWAY, KIFACE, KIFACE_I, SEARCH_STACK, PGM_BASE, PGM_KICAD,
PGM_SINGLE_TOP,
* Remove "Return" prefix on many function names.
* Remove obvious comments from CMakeLists.txt files, and from else() and endif()s.
* Fix building boost for use in a DSO on linux.
* Remove some of the assumptions in the CMakeLists.txt files that windows had
to be the host platform when building windows binaries.
* Reduce the number of wxStrings being constructed at program load time via
static construction.
* Pass wxConfigBase* to all SaveSettings() and LoadSettings() functions so that
these functions are useful even when the wxConfigBase comes from another
source, as is the case in the KICAD_MANAGER_FRAME.
* Move the setting of the KIPRJMOD environment variable into class PROJECT,
so that it can be moved into a project variable soon, and out of FP_LIB_TABLE.
* Add the KIWAY_PLAYER which is associated with a particular PROJECT, and all
its child wxFrames and wxDialogs now have a Kiway() member function which
returns a KIWAY& that that window tree branch is in support of. This is like
wxWindows DNA in that child windows get this member with proper value at time
of construction.
* Anticipate some of the needs for milestones B) and C) and make code
adjustments now in an effort to reduce work in those milestones.
* No testing has been done for python scripting, since milestone C) has that
being largely reworked and re-thought-out.
2014-03-20 00:42:08 +00:00
|
|
|
// protected so that PCB::IFACE::CreateWindow() is the only factory.
|
|
|
|
PCB_EDIT_FRAME( KIWAY* aKiway, wxWindow* aParent );
|
|
|
|
|
2008-01-01 11:58:14 +00:00
|
|
|
public:
|
2012-05-04 17:44:42 +00:00
|
|
|
PCB_LAYER_BOX_SELECTOR* m_SelLayerBox; // a combo box to display and select active layer
|
2015-07-02 09:50:38 +00:00
|
|
|
wxChoice* m_SelTrackWidthBox; // a choice box to display and select current track width
|
|
|
|
wxChoice* m_SelViaSizeBox; // a choice box to display and select current via diameter
|
2009-11-23 20:18:47 +00:00
|
|
|
|
2011-09-15 17:58:35 +00:00
|
|
|
bool m_show_microwave_tools;
|
|
|
|
bool m_show_layer_manager_tools;
|
2009-10-14 19:43:31 +00:00
|
|
|
|
2013-11-25 15:50:03 +00:00
|
|
|
virtual ~PCB_EDIT_FRAME();
|
2008-01-01 11:58:14 +00:00
|
|
|
|
2016-01-29 10:21:13 +00:00
|
|
|
/**
|
|
|
|
* Function loadFootprints
|
|
|
|
* loads the footprints for each #COMPONENT in \a aNetlist from the list of libraries.
|
|
|
|
*
|
|
|
|
* @param aNetlist is the netlist of components to load the footprints into.
|
|
|
|
* @param aReporter is the #REPORTER object to report to.
|
|
|
|
* @throw IO_ERROR if an I/O error occurs or a #PARSE_ERROR if a file parsing error
|
|
|
|
* occurs while reading footprint library files.
|
|
|
|
*/
|
|
|
|
void LoadFootprints( NETLIST& aNetlist, REPORTER* aReporter )
|
|
|
|
throw( IO_ERROR, PARSE_ERROR );
|
|
|
|
|
2011-09-15 17:58:35 +00:00
|
|
|
void OnQuit( wxCommandEvent& event );
|
2010-01-18 19:33:45 +00:00
|
|
|
|
2017-01-28 17:47:11 +00:00
|
|
|
/**
|
|
|
|
* Reload the Python plugins if they are newer than
|
|
|
|
* the already loaded, and load new plugins if any
|
|
|
|
* Do nothing if KICAD_SCRIPTING is not defined
|
|
|
|
*/
|
|
|
|
void PythonPluginsReload();
|
|
|
|
|
2016-08-11 19:13:47 +00:00
|
|
|
/**
|
|
|
|
* Function GetAutoSaveFilePrefix
|
|
|
|
*
|
|
|
|
* @return the string to prepend to a file name for automatic save.
|
|
|
|
*/
|
|
|
|
static wxString GetAutoSaveFilePrefix();
|
|
|
|
|
2014-01-08 14:18:51 +00:00
|
|
|
/**
|
|
|
|
* Execute a remote command send by Eeschema via a socket,
|
|
|
|
* port KICAD_PCB_PORT_SERVICE_NUMBER (currently 4242)
|
|
|
|
* this is a virtual function called by EDA_DRAW_FRAME::OnSockRequest().
|
|
|
|
* @param cmdline = received command from socket
|
|
|
|
*/
|
2016-09-24 18:53:15 +00:00
|
|
|
virtual void ExecuteRemoteCommand( const char* cmdline ) override;
|
2014-01-08 14:18:51 +00:00
|
|
|
|
2016-09-24 18:53:15 +00:00
|
|
|
void KiwayMailIn( KIWAY_EXPRESS& aEvent ) override;
|
2014-04-21 06:51:33 +00:00
|
|
|
|
2010-11-12 15:17:10 +00:00
|
|
|
/**
|
|
|
|
* Function ToPlotter
|
2010-01-01 13:30:39 +00:00
|
|
|
* Open a dialog frame to create plot and drill files
|
|
|
|
* relative to the current board
|
|
|
|
*/
|
2011-09-15 17:58:35 +00:00
|
|
|
void ToPlotter( wxCommandEvent& event );
|
2010-01-01 13:30:39 +00:00
|
|
|
|
2010-11-12 15:17:10 +00:00
|
|
|
/**
|
|
|
|
* Function ToPrinter
|
2010-01-01 13:30:39 +00:00
|
|
|
* Install the print dialog
|
|
|
|
*/
|
2011-09-15 17:58:35 +00:00
|
|
|
void ToPrinter( wxCommandEvent& event );
|
2010-01-01 13:30:39 +00:00
|
|
|
|
2011-08-26 17:01:17 +00:00
|
|
|
/**
|
|
|
|
* Function SVG_Print
|
|
|
|
* shows the print SVG file dialog.
|
|
|
|
*/
|
2011-09-15 17:58:35 +00:00
|
|
|
void SVG_Print( wxCommandEvent& event );
|
2010-11-17 21:47:27 +00:00
|
|
|
|
2011-02-21 13:54:29 +00:00
|
|
|
// User interface update command event handlers.
|
|
|
|
void OnUpdateSave( wxUpdateUIEvent& aEvent );
|
2011-03-01 19:26:17 +00:00
|
|
|
void OnUpdateLayerPair( wxUpdateUIEvent& aEvent );
|
|
|
|
void OnUpdateLayerSelectBox( wxUpdateUIEvent& aEvent );
|
2011-02-21 13:54:29 +00:00
|
|
|
void OnUpdateDrcEnable( wxUpdateUIEvent& aEvent );
|
|
|
|
void OnUpdateShowBoardRatsnest( wxUpdateUIEvent& aEvent );
|
|
|
|
void OnUpdateAutoDeleteTrack( wxUpdateUIEvent& aEvent );
|
|
|
|
void OnUpdateViaDrawMode( wxUpdateUIEvent& aEvent );
|
|
|
|
void OnUpdateTraceDrawMode( wxUpdateUIEvent& aEvent );
|
|
|
|
void OnUpdateHighContrastDisplayMode( wxUpdateUIEvent& aEvent );
|
|
|
|
void OnUpdateShowLayerManager( wxUpdateUIEvent& aEvent );
|
2011-03-03 19:08:13 +00:00
|
|
|
void OnUpdateShowMicrowaveToolbar( wxUpdateUIEvent& aEvent );
|
2011-02-21 13:54:29 +00:00
|
|
|
void OnUpdateVerticalToolbar( wxUpdateUIEvent& aEvent );
|
2011-03-01 19:26:17 +00:00
|
|
|
void OnUpdateSelectViaSize( wxUpdateUIEvent& aEvent );
|
2011-02-21 13:54:29 +00:00
|
|
|
void OnUpdateZoneDisplayStyle( wxUpdateUIEvent& aEvent );
|
2011-03-01 19:26:17 +00:00
|
|
|
void OnUpdateSelectTrackWidth( wxUpdateUIEvent& aEvent );
|
|
|
|
void OnUpdateSelectAutoTrackWidth( wxUpdateUIEvent& aEvent );
|
2014-05-13 09:22:51 +00:00
|
|
|
void OnUpdateSelectCustomTrackWidth( wxUpdateUIEvent& aEvent );
|
2011-12-16 13:32:23 +00:00
|
|
|
void OnUpdateAutoPlaceModulesMode( wxUpdateUIEvent& aEvent );
|
|
|
|
void OnUpdateAutoPlaceTracksMode( wxUpdateUIEvent& aEvent );
|
2014-02-27 18:48:18 +00:00
|
|
|
void OnUpdateMuWaveToolbar( wxUpdateUIEvent& aEvent );
|
2014-07-09 09:59:23 +00:00
|
|
|
void OnLayerColorChange( wxCommandEvent& aEvent );
|
2015-03-29 21:22:53 +00:00
|
|
|
void OnConfigurePaths( wxCommandEvent& aEvent );
|
2016-01-29 14:43:40 +00:00
|
|
|
void OnUpdatePCBFromSch( wxCommandEvent& event );
|
2011-02-21 13:54:29 +00:00
|
|
|
|
2016-01-22 12:30:44 +00:00
|
|
|
/**
|
|
|
|
* called when the alt key is pressed during a mouse wheel action
|
|
|
|
*/
|
|
|
|
void OnAltWheel( wxCommandEvent& event );
|
|
|
|
|
2010-11-17 21:47:27 +00:00
|
|
|
/**
|
|
|
|
* Function PrintPage , virtual
|
2010-03-18 20:35:29 +00:00
|
|
|
* used to print a page
|
2011-02-01 15:46:25 +00:00
|
|
|
* Print the page pointed by the current screen, set by the calling print function
|
2010-03-18 20:35:29 +00:00
|
|
|
* @param aDC = wxDC given by the calling print function
|
2010-12-29 17:47:32 +00:00
|
|
|
* @param aPrintMaskLayer = a 32 bits mask: bit n = 1 -> layer n is printed
|
|
|
|
* @param aPrintMirrorMode = true to plot mirrored
|
2010-03-18 20:35:29 +00:00
|
|
|
* @param aData = a pointer on an auxiliary data (NULL if not used)
|
|
|
|
*/
|
2014-06-24 16:17:18 +00:00
|
|
|
virtual void PrintPage( wxDC* aDC, LSET aPrintMaskLayer, bool aPrintMirrorMode,
|
2016-09-24 18:53:15 +00:00
|
|
|
void* aData = NULL ) override;
|
2010-03-18 20:35:29 +00:00
|
|
|
|
2011-09-15 17:58:35 +00:00
|
|
|
void GetKicadAbout( wxCommandEvent& event );
|
2008-05-30 18:06:21 +00:00
|
|
|
|
2010-11-12 15:17:10 +00:00
|
|
|
/**
|
|
|
|
* Function IsGridVisible() , virtual
|
2010-02-01 21:23:27 +00:00
|
|
|
* @return true if the grid must be shown
|
|
|
|
*/
|
2016-09-24 18:53:15 +00:00
|
|
|
virtual bool IsGridVisible() const override;
|
2010-02-01 21:23:27 +00:00
|
|
|
|
2010-11-12 15:17:10 +00:00
|
|
|
/**
|
|
|
|
* Function SetGridVisibility() , virtual
|
2010-02-01 21:23:27 +00:00
|
|
|
* It may be overloaded by derived classes
|
2010-04-23 14:46:00 +00:00
|
|
|
* if you want to store/retrieve the grid visibility in configuration.
|
2010-02-01 21:23:27 +00:00
|
|
|
* @param aVisible = true if the grid must be shown
|
|
|
|
*/
|
2016-09-24 18:53:15 +00:00
|
|
|
virtual void SetGridVisibility( bool aVisible ) override;
|
2010-02-01 21:23:27 +00:00
|
|
|
|
2010-11-12 15:17:10 +00:00
|
|
|
/**
|
|
|
|
* Function GetGridColor() , virtual
|
2010-02-01 21:23:27 +00:00
|
|
|
* @return the color of the grid
|
|
|
|
*/
|
2016-09-24 18:53:15 +00:00
|
|
|
virtual EDA_COLOR_T GetGridColor() const override;
|
2010-02-01 21:23:27 +00:00
|
|
|
|
2010-11-12 15:17:10 +00:00
|
|
|
/**
|
|
|
|
* Function SetGridColor() , virtual
|
2010-02-01 21:23:27 +00:00
|
|
|
* @param aColor = the new color of the grid
|
|
|
|
*/
|
2016-09-24 18:53:15 +00:00
|
|
|
virtual void SetGridColor( EDA_COLOR_T aColor ) override;
|
2015-07-28 08:30:06 +00:00
|
|
|
|
|
|
|
///> @copydoc EDA_DRAW_FRAME::SetCursorShape()
|
2016-09-24 18:53:15 +00:00
|
|
|
virtual void SetCursorShape( int aCursorShape ) override;
|
2010-02-01 21:23:27 +00:00
|
|
|
|
2008-01-01 11:58:14 +00:00
|
|
|
// Configurations:
|
2011-09-15 17:58:35 +00:00
|
|
|
void Process_Config( wxCommandEvent& event );
|
2009-11-23 20:18:47 +00:00
|
|
|
|
2011-09-26 20:32:56 +00:00
|
|
|
/**
|
|
|
|
* Function GetProjectFileParameters
|
++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()
2011-12-05 06:15:33 +00:00
|
|
|
* returns a project file parameter list for Pcbnew.
|
2011-09-26 20:32:56 +00:00
|
|
|
* <p>
|
++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()
2011-12-05 06:15:33 +00:00
|
|
|
* Populate a project file parameter array specific to Pcbnew.
|
2011-09-26 20:32:56 +00:00
|
|
|
* Creating the parameter list at run time has the advantage of being able
|
|
|
|
* to define local variables. The old method of statically building the array
|
|
|
|
* at compile time requiring global variable definitions by design.
|
|
|
|
* </p>
|
++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()
2011-12-05 06:15:33 +00:00
|
|
|
* @return PARAM_CFG_ARRAY - it is only good until SetBoard() is called, so
|
|
|
|
* don't keep it around past that event.
|
2011-09-26 20:32:56 +00:00
|
|
|
*/
|
++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()
2011-12-05 06:15:33 +00:00
|
|
|
PARAM_CFG_ARRAY GetProjectFileParameters();
|
2011-09-26 20:32:56 +00:00
|
|
|
|
2013-07-19 18:27:22 +00:00
|
|
|
/**
|
|
|
|
* Function SaveProjectSettings
|
|
|
|
* saves changes to the project settings to the project (.pro) file.
|
|
|
|
* @param aAskForSave = true to open a dialog before saving the settings
|
|
|
|
*/
|
2016-09-24 18:53:15 +00:00
|
|
|
void SaveProjectSettings( bool aAskForSave ) override;
|
2010-04-23 14:46:00 +00:00
|
|
|
|
|
|
|
/**
|
Modular KiCad Blueprint Milestone B), major portions:
*) When kicad.exe closes a project, close any open KIFACEs so that they cannot
get disassociated from their true PROJECT.
*) Allow loading eeschema library editor from kicad.exe
*) Allow loading pcbnew library editor from kicad.exe
*) Rename LIB_COMPONENT to LIB_PART.
*) Add class PART_LIBS, and PART_LIB.
*) Make PART_LIBS non-global, i.e. PROJECT specific.
*) Implement "data on demand" for PART_LIBS
*) Implement "data on demand" for schematic SEARCH_STACK.
*) Use RSTRINGs to retain eeschema editor's notion of last library and part being edited.
*) Get rid of library search on every SCH_COMPONENT::Draw() call, instead use
a weak pointer.
*) Remove all chdir() calls so projects don't need to be CWD.
*) Romove APPEND support from OpenProjectFiles().
*) Make OpenProjectFiles() robust, even for creating new projects.
*) Load EESCHEMA colors in the KIWAY::OnKiwayStart() rather in window open,
and save them in the .eeschema config file, not in the project file.
*) Fix bug with wxDir() while accessing protected dirs in kicad.exe
*) Consolidate template copying into PROJECT class, not in kicad.exe source.
*) Generally untangle eeschema, making its libraries not global but rather
held in the PROJECT.
2014-08-13 20:28:54 +00:00
|
|
|
* Load the current project's file configuration settings which are pertinent
|
|
|
|
* to this PCB_EDIT_FRAME instance.
|
2010-04-23 14:46:00 +00:00
|
|
|
*
|
|
|
|
* @return always returns true.
|
|
|
|
*/
|
Modular KiCad Blueprint Milestone B), major portions:
*) When kicad.exe closes a project, close any open KIFACEs so that they cannot
get disassociated from their true PROJECT.
*) Allow loading eeschema library editor from kicad.exe
*) Allow loading pcbnew library editor from kicad.exe
*) Rename LIB_COMPONENT to LIB_PART.
*) Add class PART_LIBS, and PART_LIB.
*) Make PART_LIBS non-global, i.e. PROJECT specific.
*) Implement "data on demand" for PART_LIBS
*) Implement "data on demand" for schematic SEARCH_STACK.
*) Use RSTRINGs to retain eeschema editor's notion of last library and part being edited.
*) Get rid of library search on every SCH_COMPONENT::Draw() call, instead use
a weak pointer.
*) Remove all chdir() calls so projects don't need to be CWD.
*) Romove APPEND support from OpenProjectFiles().
*) Make OpenProjectFiles() robust, even for creating new projects.
*) Load EESCHEMA colors in the KIWAY::OnKiwayStart() rather in window open,
and save them in the .eeschema config file, not in the project file.
*) Fix bug with wxDir() while accessing protected dirs in kicad.exe
*) Consolidate template copying into PROJECT class, not in kicad.exe source.
*) Generally untangle eeschema, making its libraries not global but rather
held in the PROJECT.
2014-08-13 20:28:54 +00:00
|
|
|
bool LoadProjectSettings();
|
2010-04-23 14:46:00 +00:00
|
|
|
|
|
|
|
/**
|
2011-09-26 20:32:56 +00:00
|
|
|
* Function GetConfigurationSettings
|
2011-09-30 18:15:37 +00:00
|
|
|
* returns the Pcbnew applications settings list.
|
2011-09-26 20:32:56 +00:00
|
|
|
*
|
++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()
2011-12-05 06:15:33 +00:00
|
|
|
* This replaces the old statically defined list that had the project
|
2011-09-26 20:32:56 +00:00
|
|
|
* file settings and the application settings mixed together. This
|
|
|
|
* was confusing and caused some settings to get saved and loaded
|
|
|
|
* incorrectly. Currently, only the settings that are needed at start
|
|
|
|
* up by the main window are defined here. There are other locally used
|
++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()
2011-12-05 06:15:33 +00:00
|
|
|
* settings that are scattered throughout the Pcbnew source code. If you need
|
|
|
|
* to define a configuration setting that needs to be loaded at run time,
|
2011-09-26 20:32:56 +00:00
|
|
|
* this is the place to define it.
|
2010-04-23 14:46:00 +00:00
|
|
|
*
|
|
|
|
* @return - Reference to the list of applications settings.
|
|
|
|
*/
|
|
|
|
PARAM_CFG_ARRAY& GetConfigurationSettings();
|
|
|
|
|
2016-09-24 18:53:15 +00:00
|
|
|
void LoadSettings( wxConfigBase* aCfg ) override;
|
2010-04-23 14:46:00 +00:00
|
|
|
|
2016-09-24 18:53:15 +00:00
|
|
|
void SaveSettings( wxConfigBase* aCfg ) override;
|
2010-04-23 14:46:00 +00:00
|
|
|
|
2015-07-02 14:11:15 +00:00
|
|
|
wxConfigBase* GetSettings() { return config(); };
|
2015-07-02 14:09:51 +00:00
|
|
|
|
2010-04-23 14:46:00 +00:00
|
|
|
/**
|
|
|
|
* Get the last net list read with the net list dialog box.
|
|
|
|
*
|
|
|
|
* @return - Absolute path and file name of the last net list file successfully read.
|
2009-10-21 19:16:25 +00:00
|
|
|
*/
|
2011-09-15 17:58:35 +00:00
|
|
|
wxString GetLastNetListRead();
|
2010-04-23 14:46:00 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Set the last net list successfully read by the net list dialog box.
|
|
|
|
*
|
|
|
|
* Note: the file path is converted to a path relative to the project file path. If
|
|
|
|
* the path cannot be made relative, than m_lastNetListRead is set to and empty
|
|
|
|
* string. This could happen when the net list file is on a different drive than
|
|
|
|
* the project file. The advantage of relative paths is that is more likely to
|
|
|
|
* work when opening the same project from both Windows and Linux.
|
|
|
|
*
|
|
|
|
* @param aNetListFile - The last net list file with full path successfully read.
|
|
|
|
*/
|
2011-09-15 17:58:35 +00:00
|
|
|
void SetLastNetListRead( const wxString& aNetListFile );
|
2009-10-21 19:16:25 +00:00
|
|
|
|
2015-05-05 18:39:42 +00:00
|
|
|
///> @copydoc EDA_DRAW_FRAME::GetHotKeyDescription()
|
2016-09-24 18:53:15 +00:00
|
|
|
EDA_HOTKEY* GetHotKeyDescription( int aCommand ) const override;
|
2015-05-05 18:39:42 +00:00
|
|
|
|
2010-11-12 15:17:10 +00:00
|
|
|
/**
|
|
|
|
* Function OnHotKey.
|
2010-08-12 19:41:13 +00:00
|
|
|
* ** Commands are case insensitive **
|
|
|
|
* Some commands are relatives to the item under the mouse cursor
|
2011-02-02 19:01:21 +00:00
|
|
|
* @param aDC = current device context
|
|
|
|
* @param aHotkeyCode = hotkey code (ascii or wxWidget code for special keys)
|
|
|
|
* @param aPosition The cursor position in logical (drawing) units.
|
|
|
|
* @param aItem = NULL or pointer on a EDA_ITEM under the mouse cursor
|
2010-08-12 19:41:13 +00:00
|
|
|
*/
|
2016-09-24 18:53:15 +00:00
|
|
|
bool OnHotKey( wxDC* aDC, int aHotkeyCode, const wxPoint& aPosition, EDA_ITEM* aItem = NULL ) override;
|
2010-08-12 19:41:13 +00:00
|
|
|
|
2010-11-12 15:17:10 +00:00
|
|
|
/**
|
|
|
|
* Function OnHotkeyDeleteItem
|
2010-08-12 19:41:13 +00:00
|
|
|
* Delete the item found under the mouse cursor
|
|
|
|
* Depending on the current active tool::
|
|
|
|
* Tool track
|
|
|
|
* if a track is in progress: Delete the last segment
|
2011-09-15 17:58:35 +00:00
|
|
|
* else delete the entire track
|
2010-08-12 19:41:13 +00:00
|
|
|
* Tool module (footprint):
|
|
|
|
* Delete the module.
|
|
|
|
* @param aDC = current device context
|
|
|
|
* @return true if an item was deleted
|
|
|
|
*/
|
2011-09-15 17:58:35 +00:00
|
|
|
bool OnHotkeyDeleteItem( wxDC* aDC );
|
2010-08-12 19:41:13 +00:00
|
|
|
|
2011-09-16 14:13:02 +00:00
|
|
|
/**
|
|
|
|
* Function OnHotkeyPlaceItem
|
|
|
|
* Place the item (footprint, track, text .. ) found under the mouse cursor
|
|
|
|
* An item can be placed only if there is this item currently edited
|
|
|
|
* Only a footprint, a pad or a track can be placed
|
|
|
|
* @param aDC = current device context
|
2011-09-26 20:32:56 +00:00
|
|
|
* @return true if an item was placed
|
2011-09-16 14:13:02 +00:00
|
|
|
*/
|
2011-09-15 17:58:35 +00:00
|
|
|
bool OnHotkeyPlaceItem( wxDC* aDC );
|
2011-09-07 09:27:02 +00:00
|
|
|
|
2011-09-15 17:58:35 +00:00
|
|
|
bool OnHotkeyEditItem( int aIdCommand );
|
2010-09-02 08:23:38 +00:00
|
|
|
|
2012-07-04 19:50:47 +00:00
|
|
|
/**
|
|
|
|
* Function OnHotkeyCopyItem
|
|
|
|
* returns the copy event id for copyable items.
|
|
|
|
* @return Event id of a suitable copy event, zero when no copyable item found.
|
|
|
|
*/
|
|
|
|
int OnHotkeyCopyItem();
|
|
|
|
|
2015-02-12 03:22:24 +00:00
|
|
|
/**
|
|
|
|
* Function OnHotkeyDuplicateOrArrayItem
|
|
|
|
* Duplicate an item (optionally incrementing if necessary and possible)
|
|
|
|
* or invoke array dialog and create an array
|
|
|
|
* @param aIdCommand = the hotkey command id
|
|
|
|
* @return true if item duplicated or arrayed
|
|
|
|
*/
|
|
|
|
bool OnHotkeyDuplicateOrArrayItem( int aIdCommand );
|
|
|
|
|
2010-11-12 15:17:10 +00:00
|
|
|
/**
|
|
|
|
* Function OnHotkeyMoveItem
|
2010-08-12 19:41:13 +00:00
|
|
|
* Moves or drag the item (footprint, track, text .. ) found under the mouse cursor
|
|
|
|
* Only a footprint or a track can be dragged
|
|
|
|
* @param aIdCommand = the hotkey command id
|
|
|
|
* @return true if an item was moved
|
|
|
|
*/
|
2011-09-15 17:58:35 +00:00
|
|
|
bool OnHotkeyMoveItem( int aIdCommand );
|
2010-08-12 19:41:13 +00:00
|
|
|
|
2010-11-12 15:17:10 +00:00
|
|
|
/**
|
|
|
|
* Function OnHotkeyRotateItem
|
2010-08-12 19:41:13 +00:00
|
|
|
* Rotate the item (text or footprint) found under the mouse cursor
|
2011-09-16 14:13:02 +00:00
|
|
|
* @note This command can be used with an item currently in edit.
|
|
|
|
* Only some items can be rotated (footprints and texts).
|
2010-08-12 19:41:13 +00:00
|
|
|
* @param aIdCommand = the hotkey command id
|
|
|
|
* @return true if an item was moved
|
|
|
|
*/
|
2011-09-15 17:58:35 +00:00
|
|
|
bool OnHotkeyRotateItem( int aIdCommand );
|
2009-01-15 08:12:03 +00:00
|
|
|
|
2016-01-14 17:52:27 +00:00
|
|
|
/**
|
|
|
|
* Function OnHotkeyFlipItem
|
|
|
|
* Flip the item (text or footprint) found under the mouse cursor
|
|
|
|
* @note This command can be used with an item currently in edit.
|
|
|
|
* Only some items can be rotated (footprints and texts).
|
|
|
|
* @param aIdCommand = the hotkey command id
|
|
|
|
* @return true if an item was moved
|
|
|
|
*/
|
|
|
|
bool OnHotkeyFlipItem( int aIdCommand );
|
|
|
|
|
2012-12-01 20:03:33 +00:00
|
|
|
/**
|
|
|
|
* Function OnHotkeyBeginRoute
|
|
|
|
* If the current active layer is a copper layer,
|
|
|
|
* and if no item currently edited, start a new track segmenton
|
|
|
|
* the current copper layer.
|
|
|
|
* If a new track is in progress, terminate the current segment and
|
|
|
|
* start a new one.
|
|
|
|
* @param aDC = current device context
|
|
|
|
* @return a reference to the track if a track is created, or NULL
|
|
|
|
*/
|
|
|
|
TRACK * OnHotkeyBeginRoute( wxDC* aDC );
|
|
|
|
|
2016-09-24 18:53:15 +00:00
|
|
|
void OnCloseWindow( wxCloseEvent& Event ) override;
|
2011-09-15 17:58:35 +00:00
|
|
|
void Process_Special_Functions( wxCommandEvent& event );
|
|
|
|
void Tracks_and_Vias_Size_Event( wxCommandEvent& event );
|
|
|
|
void OnSelectTool( wxCommandEvent& aEvent );
|
2009-01-15 08:12:03 +00:00
|
|
|
|
2012-05-29 12:25:10 +00:00
|
|
|
/**
|
|
|
|
* Function OnResetModuleTextSizes
|
|
|
|
* resets text size and width of all module text fields of given field
|
|
|
|
* type to current settings in Preferences
|
|
|
|
*/
|
|
|
|
void OnResetModuleTextSizes( wxCommandEvent& event );
|
|
|
|
|
2011-09-15 17:58:35 +00:00
|
|
|
void ProcessMuWaveFunctions( wxCommandEvent& event );
|
|
|
|
void MuWaveCommand( wxDC* DC, const wxPoint& MousePos );
|
2009-01-15 08:12:03 +00:00
|
|
|
|
2016-09-24 18:53:15 +00:00
|
|
|
void RedrawActiveWindow( wxDC* DC, bool EraseBg ) override;
|
|
|
|
void ReCreateHToolbar() override;
|
|
|
|
void ReCreateAuxiliaryToolbar() override;
|
|
|
|
void ReCreateVToolbar() override;
|
2011-09-15 17:58:35 +00:00
|
|
|
void ReCreateMicrowaveVToolbar();
|
|
|
|
void ReCreateOptToolbar();
|
2016-09-24 18:53:15 +00:00
|
|
|
void ReCreateMenuBar() override;
|
2013-09-02 15:26:52 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Re create the layer Box by clearing the old list, and building
|
|
|
|
* le new one, from the new layers names and cole layers
|
|
|
|
* @param aForceResizeToolbar = true to resize the parent toolbar
|
|
|
|
* false if not needed (mainly in parent toolbar creation,
|
|
|
|
* or when the layers names are not modified)
|
|
|
|
*/
|
|
|
|
void ReCreateLayerBox( bool aForceResizeToolbar = true );
|
2008-04-29 13:35:26 +00:00
|
|
|
|
2014-09-28 14:44:47 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Function SetCurrentNetClass
|
|
|
|
* Must be called after a netclass selection (or after a netclass parameter change
|
|
|
|
* calls BOARD_DESIGN_SETTINGS::SetCurrentNetClass() and update trace width and via size
|
|
|
|
* combo boxes on main toolbar
|
|
|
|
* Initialize vias and tracks values displayed in comb boxes of the auxiliary toolbar
|
|
|
|
* and some others parameters (netclass name ....)
|
|
|
|
* @param aNetClassName = the new netclass name
|
|
|
|
* @return true if lists of tracks and vias sizes are modified
|
|
|
|
*/
|
|
|
|
bool SetCurrentNetClass( const wxString& aNetClassName );
|
|
|
|
|
2011-08-26 17:01:17 +00:00
|
|
|
/**
|
|
|
|
* Function OnModify
|
|
|
|
* must be called after a board change to set the modified flag.
|
|
|
|
* <p>
|
|
|
|
* Reloads the 3D view if required and calls the base PCB_BASE_FRAME::OnModify function
|
|
|
|
* to update auxiliary information.
|
2011-09-15 17:58:35 +00:00
|
|
|
* </p>
|
2010-05-01 12:46:33 +00:00
|
|
|
*/
|
2016-09-24 18:53:15 +00:00
|
|
|
virtual void OnModify() override;
|
2010-05-01 12:46:33 +00:00
|
|
|
|
2014-03-21 10:17:47 +00:00
|
|
|
/**
|
|
|
|
* Function SetActiveLayer
|
|
|
|
* will change the currently active layer to \a aLayer and also
|
|
|
|
* update the PCB_LAYER_WIDGET.
|
|
|
|
*/
|
2016-09-24 18:53:15 +00:00
|
|
|
virtual void SetActiveLayer( LAYER_ID aLayer ) override;
|
2014-03-21 10:17:47 +00:00
|
|
|
|
2010-01-21 20:53:01 +00:00
|
|
|
/**
|
2010-01-30 20:17:56 +00:00
|
|
|
* Function IsElementVisible
|
|
|
|
* tests whether a given element category is visible. Keep this as an
|
|
|
|
* inline function.
|
2011-09-20 13:57:40 +00:00
|
|
|
* @param aElement is from the enum by the same name
|
2010-01-30 20:17:56 +00:00
|
|
|
* @return bool - true if the element is visible.
|
|
|
|
* @see enum PCB_VISIBLE
|
|
|
|
*/
|
2012-09-02 12:06:47 +00:00
|
|
|
bool IsElementVisible( int aElement ) const;
|
2010-01-30 20:17:56 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Function SetElementVisibility
|
|
|
|
* changes the visibility of an element category
|
2011-09-20 13:57:40 +00:00
|
|
|
* @param aElement is from the enum by the same name
|
2010-01-30 20:17:56 +00:00
|
|
|
* @param aNewState = The new visibility state of the element category
|
|
|
|
* @see enum PCB_VISIBLE
|
|
|
|
*/
|
2011-09-20 13:57:40 +00:00
|
|
|
void SetElementVisibility( int aElement, bool aNewState );
|
2010-01-30 20:17:56 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Function SetVisibleAlls
|
|
|
|
* Set the status of all visible element categories and layers to VISIBLE
|
|
|
|
*/
|
2011-08-26 17:01:17 +00:00
|
|
|
void SetVisibleAlls();
|
2010-01-30 20:17:56 +00:00
|
|
|
|
|
|
|
/**
|
2010-01-21 20:53:01 +00:00
|
|
|
* Function ReFillLayerWidget
|
|
|
|
* changes out all the layers in m_Layers and may be called upon
|
|
|
|
* loading a new BOARD.
|
|
|
|
*/
|
2011-09-15 17:58:35 +00:00
|
|
|
void ReFillLayerWidget();
|
2010-01-21 20:53:01 +00:00
|
|
|
|
2011-08-26 17:01:17 +00:00
|
|
|
/**
|
|
|
|
* Function Show3D_Frame
|
|
|
|
* displays the 3D view of current printed circuit board.
|
|
|
|
*/
|
2016-09-24 18:53:15 +00:00
|
|
|
void Show3D_Frame( wxCommandEvent& event ) override;
|
2013-04-15 15:57:03 +00:00
|
|
|
|
2015-08-07 17:15:36 +00:00
|
|
|
///> @copydoc EDA_DRAW_FRAME::UseGalCanvas()
|
2016-09-24 18:53:15 +00:00
|
|
|
void UseGalCanvas( bool aEnable ) override;
|
2013-11-25 15:50:03 +00:00
|
|
|
|
2016-09-24 18:53:15 +00:00
|
|
|
bool GeneralControl( wxDC* aDC, const wxPoint& aPosition, EDA_KEY aHotKey = 0 ) override;
|
2009-02-05 20:53:08 +00:00
|
|
|
|
2010-11-12 15:17:10 +00:00
|
|
|
/**
|
|
|
|
* Function ShowDesignRulesEditor
|
2011-08-26 17:01:17 +00:00
|
|
|
* displays the Design Rules Editor.
|
2009-07-18 11:44:19 +00:00
|
|
|
*/
|
2011-09-15 17:58:35 +00:00
|
|
|
void ShowDesignRulesEditor( wxCommandEvent& event );
|
2009-07-18 11:44:19 +00:00
|
|
|
|
2009-09-27 11:00:21 +00:00
|
|
|
/* toolbars update UI functions: */
|
2009-11-23 20:18:47 +00:00
|
|
|
|
2011-09-15 17:58:35 +00:00
|
|
|
void PrepareLayerIndicator();
|
2009-09-27 11:00:21 +00:00
|
|
|
|
|
|
|
/* mouse functions events: */
|
2016-09-24 18:53:15 +00:00
|
|
|
void OnLeftClick( wxDC* DC, const wxPoint& MousePos ) override;
|
|
|
|
void OnLeftDClick( wxDC* DC, const wxPoint& MousePos ) override;
|
2008-01-01 11:58:14 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Function OnRightClick
|
2011-02-21 13:54:29 +00:00
|
|
|
* populates a popup menu with the choices appropriate for the current context.
|
2010-04-23 14:46:00 +00:00
|
|
|
* The caller will add the ZOOM menu choices afterward.
|
2008-01-01 11:58:14 +00:00
|
|
|
* @param aMousePos The current mouse position
|
|
|
|
* @param aPopMenu The menu to add to.
|
|
|
|
*/
|
2016-09-24 18:53:15 +00:00
|
|
|
bool OnRightClick( const wxPoint& aMousePos, wxMenu* aPopMenu ) override;
|
2008-01-01 11:58:14 +00:00
|
|
|
|
2011-09-15 17:58:35 +00:00
|
|
|
void OnSelectOptionToolbar( wxCommandEvent& event );
|
2016-12-02 17:59:48 +00:00
|
|
|
void OnFlipPcbView( wxCommandEvent& event );
|
2016-09-24 18:53:15 +00:00
|
|
|
void ToolOnRightClick( wxCommandEvent& event ) override;
|
2008-01-01 11:58:14 +00:00
|
|
|
|
2009-07-31 05:33:11 +00:00
|
|
|
/* Block operations: */
|
2009-11-23 20:18:47 +00:00
|
|
|
|
2010-11-13 11:02:24 +00:00
|
|
|
/**
|
* KIWAY Milestone A): Make major modules into DLL/DSOs.
! The initial testing of this commit should be done using a Debug build so that
all the wxASSERT()s are enabled. Also, be sure and keep enabled the
USE_KIWAY_DLLs option. The tree won't likely build without it. Turning it
off is senseless anyways. If you want stable code, go back to a prior version,
the one tagged with "stable".
* Relocate all functionality out of the wxApp derivative into more finely
targeted purposes:
a) DLL/DSO specific
b) PROJECT specific
c) EXE or process specific
d) configuration file specific data
e) configuration file manipulations functions.
All of this functionality was blended into an extremely large wxApp derivative
and that was incompatible with the desire to support multiple concurrently
loaded DLL/DSO's ("KIFACE")s and multiple concurrently open projects.
An amazing amount of organization come from simply sorting each bit of
functionality into the proper box.
* Switch to wxConfigBase from wxConfig everywhere except instantiation.
* Add classes KIWAY, KIFACE, KIFACE_I, SEARCH_STACK, PGM_BASE, PGM_KICAD,
PGM_SINGLE_TOP,
* Remove "Return" prefix on many function names.
* Remove obvious comments from CMakeLists.txt files, and from else() and endif()s.
* Fix building boost for use in a DSO on linux.
* Remove some of the assumptions in the CMakeLists.txt files that windows had
to be the host platform when building windows binaries.
* Reduce the number of wxStrings being constructed at program load time via
static construction.
* Pass wxConfigBase* to all SaveSettings() and LoadSettings() functions so that
these functions are useful even when the wxConfigBase comes from another
source, as is the case in the KICAD_MANAGER_FRAME.
* Move the setting of the KIPRJMOD environment variable into class PROJECT,
so that it can be moved into a project variable soon, and out of FP_LIB_TABLE.
* Add the KIWAY_PLAYER which is associated with a particular PROJECT, and all
its child wxFrames and wxDialogs now have a Kiway() member function which
returns a KIWAY& that that window tree branch is in support of. This is like
wxWindows DNA in that child windows get this member with proper value at time
of construction.
* Anticipate some of the needs for milestones B) and C) and make code
adjustments now in an effort to reduce work in those milestones.
* No testing has been done for python scripting, since milestone C) has that
being largely reworked and re-thought-out.
2014-03-20 00:42:08 +00:00
|
|
|
* Function BlockCommand
|
2010-11-13 11:02:24 +00:00
|
|
|
* Returns the block command internat code (BLOCK_MOVE, BLOCK_COPY...)
|
|
|
|
* corresponding to the keys pressed (ALT, SHIFT, SHIFT ALT ..) when
|
|
|
|
* block command is started by dragging the mouse.
|
|
|
|
* @param aKey = the key modifiers (Alt, Shift ...)
|
|
|
|
* @return the block command id (BLOCK_MOVE, BLOCK_COPY...)
|
|
|
|
*/
|
2016-09-24 18:53:15 +00:00
|
|
|
virtual int BlockCommand( EDA_KEY aKey ) override;
|
2010-11-13 11:02:24 +00:00
|
|
|
|
|
|
|
/**
|
2011-08-26 17:01:17 +00:00
|
|
|
* Function HandleBlockPlace()
|
2010-11-13 11:02:24 +00:00
|
|
|
* Called after HandleBlockEnd, when a block command needs to be
|
|
|
|
* executed after the block is moved to its new place
|
|
|
|
* (bloc move, drag, copy .. )
|
|
|
|
* Parameters must be initialized in GetScreen()->m_BlockLocate
|
|
|
|
*/
|
2016-09-24 18:53:15 +00:00
|
|
|
virtual void HandleBlockPlace( wxDC* DC ) override;
|
2010-11-13 11:02:24 +00:00
|
|
|
|
|
|
|
/**
|
2011-08-26 17:01:17 +00:00
|
|
|
* Function HandleBlockEnd()
|
2010-11-13 11:02:24 +00:00
|
|
|
* Handle the "end" of a block command,
|
|
|
|
* i.e. is called at the end of the definition of the area of a block.
|
|
|
|
* depending on the current block command, this command is executed
|
|
|
|
* or parameters are initialized to prepare a call to HandleBlockPlace
|
|
|
|
* in GetScreen()->m_BlockLocate
|
|
|
|
* @return false if no item selected, or command finished,
|
|
|
|
* true if some items found and HandleBlockPlace must be called later
|
|
|
|
*/
|
2016-09-24 18:53:15 +00:00
|
|
|
virtual bool HandleBlockEnd( wxDC* DC ) override;
|
2009-11-23 20:18:47 +00:00
|
|
|
|
2009-08-01 19:26:05 +00:00
|
|
|
/**
|
|
|
|
* Function Block_SelectItems
|
|
|
|
* Uses GetScreen()->m_BlockLocate
|
|
|
|
* select items within the selected block.
|
|
|
|
* selected items are put in the pick list
|
|
|
|
*/
|
2009-11-23 20:18:47 +00:00
|
|
|
void Block_SelectItems();
|
2009-08-01 19:26:05 +00:00
|
|
|
|
2009-07-31 05:33:11 +00:00
|
|
|
/**
|
|
|
|
* Function Block_Delete
|
2009-08-01 19:26:05 +00:00
|
|
|
* deletes all items within the selected block.
|
|
|
|
*/
|
2009-11-23 20:18:47 +00:00
|
|
|
void Block_Delete();
|
|
|
|
|
2009-08-01 19:26:05 +00:00
|
|
|
/**
|
|
|
|
* Function Block_Rotate
|
|
|
|
* Rotate all items within the selected block.
|
2009-11-23 20:18:47 +00:00
|
|
|
* The rotation center is the center of the block
|
2009-08-01 19:26:05 +00:00
|
|
|
*/
|
2009-11-23 20:18:47 +00:00
|
|
|
void Block_Rotate();
|
|
|
|
|
2009-08-01 19:26:05 +00:00
|
|
|
/**
|
|
|
|
* Function Block_Flip
|
|
|
|
* Flip items within the selected block.
|
2009-11-23 20:18:47 +00:00
|
|
|
* The flip center is the center of the block
|
2009-07-31 05:33:11 +00:00
|
|
|
*/
|
2009-11-23 20:18:47 +00:00
|
|
|
void Block_Flip();
|
|
|
|
|
2009-07-31 05:33:11 +00:00
|
|
|
/**
|
|
|
|
* Function Block_Move
|
2009-08-01 19:26:05 +00:00
|
|
|
* move all items within the selected block.
|
2009-11-23 20:18:47 +00:00
|
|
|
* New location is determined by the current offset from the selected
|
2010-12-14 15:56:30 +00:00
|
|
|
* block's original location.
|
2009-07-31 05:33:11 +00:00
|
|
|
*/
|
2009-11-23 20:18:47 +00:00
|
|
|
void Block_Move();
|
|
|
|
|
2009-07-31 05:33:11 +00:00
|
|
|
/**
|
|
|
|
* Function Block_Mirror_X
|
2009-08-01 19:26:05 +00:00
|
|
|
* mirrors all items within the currently selected block in the X axis.
|
2009-07-31 05:33:11 +00:00
|
|
|
*/
|
2009-11-23 20:18:47 +00:00
|
|
|
void Block_Mirror_X();
|
|
|
|
|
2009-07-31 05:33:11 +00:00
|
|
|
/**
|
|
|
|
* Function Block_Duplicate
|
2009-08-01 19:26:05 +00:00
|
|
|
* Duplicate all items within the selected block.
|
2009-11-23 20:18:47 +00:00
|
|
|
* New location is determined by the current offset from the selected
|
|
|
|
* block's original location.
|
2009-07-31 05:33:11 +00:00
|
|
|
*/
|
2015-03-22 09:42:41 +00:00
|
|
|
void Block_Duplicate( bool aIncrement );
|
2009-07-31 05:33:11 +00:00
|
|
|
|
2009-11-23 20:18:47 +00:00
|
|
|
void Process_Settings( wxCommandEvent& event );
|
2010-04-23 14:46:00 +00:00
|
|
|
void OnConfigurePcbOptions( wxCommandEvent& aEvent );
|
2009-11-23 20:18:47 +00:00
|
|
|
void InstallDisplayOptionsDialog( wxCommandEvent& aEvent );
|
|
|
|
void InstallPcbGlobalDeleteFrame( const wxPoint& pos );
|
2012-02-06 05:44:19 +00:00
|
|
|
|
2012-02-15 10:41:16 +00:00
|
|
|
/**
|
|
|
|
* Function GenFootprintsPositionFile
|
|
|
|
* Calls DoGenFootprintsPositionFile to create a footprint position file
|
|
|
|
* See DoGenFootprintsPositionFile for options and file format
|
|
|
|
*/
|
|
|
|
void GenFootprintsPositionFile( wxCommandEvent& event );
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Function DoGenFootprintsPositionFile
|
|
|
|
* Creates an ascii footprint position file
|
2012-03-17 14:39:27 +00:00
|
|
|
* @param aFullFileName = the full file name of the file to create
|
2012-02-15 10:41:16 +00:00
|
|
|
* @param aUnitsMM = false to use inches, true to use mm in coordinates
|
|
|
|
* @param aForceSmdItems = true to force all footprints with smd pads in list
|
|
|
|
* = false to put only footprints with option "INSERT" in list
|
|
|
|
* @param aSide = 0 to list footprints on BACK side,
|
|
|
|
* 1 to list footprints on FRONT side
|
|
|
|
* 2 to list footprints on both sides
|
2016-04-26 12:16:16 +00:00
|
|
|
* @param aFormatCSV = true to use a comma separated file (CSV) format; defautl = false
|
2012-02-15 10:41:16 +00:00
|
|
|
* @return the number of footprints found on aSide side,
|
|
|
|
* or -1 if the file could not be created
|
|
|
|
*/
|
|
|
|
int DoGenFootprintsPositionFile( const wxString& aFullFileName, bool aUnitsMM,
|
2016-04-26 12:16:16 +00:00
|
|
|
bool aForceSmdItems, int aSide, bool aFormatCSV = false );
|
2012-02-15 10:41:16 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Function GenFootprintsReport
|
|
|
|
* Calls DoGenFootprintsReport to create a footprint reprot file
|
|
|
|
* See DoGenFootprintsReport for file format
|
|
|
|
*/
|
|
|
|
void GenFootprintsReport( wxCommandEvent& event );
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Function DoGenFootprintsReport
|
|
|
|
* Creates an ascii footprint report file giving some infos on footprints
|
|
|
|
* and board outlines
|
|
|
|
* @param aFullFilename = the full file name of the file to create
|
|
|
|
* @param aUnitsMM = false to use inches, true to use mm in coordinates
|
|
|
|
* @return true if OK, false if error
|
|
|
|
*/
|
|
|
|
bool DoGenFootprintsReport( const wxString& aFullFilename, bool aUnitsMM );
|
|
|
|
|
2009-11-23 20:18:47 +00:00
|
|
|
void InstallDrillFrame( wxCommandEvent& event );
|
2013-09-13 09:49:55 +00:00
|
|
|
void GenD356File( wxCommandEvent& event );
|
2009-11-23 20:18:47 +00:00
|
|
|
void ToPostProcess( wxCommandEvent& event );
|
2009-01-15 08:12:03 +00:00
|
|
|
|
2009-11-23 20:18:47 +00:00
|
|
|
void OnFileHistory( wxCommandEvent& event );
|
2011-08-26 17:01:17 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Function Files_io
|
2015-03-17 07:34:02 +00:00
|
|
|
* @param event is the command event handler.
|
|
|
|
* do nothing else than call Files_io_from_id with the
|
|
|
|
* wxCommandEvent id
|
2011-08-26 17:01:17 +00:00
|
|
|
*/
|
2009-11-23 20:18:47 +00:00
|
|
|
void Files_io( wxCommandEvent& event );
|
2010-05-17 20:35:46 +00:00
|
|
|
|
2015-03-17 07:34:02 +00:00
|
|
|
/**
|
|
|
|
* Function Files_io_from_id
|
|
|
|
* Read and write board files
|
|
|
|
* @param aId is an event ID ciming from file command events:
|
|
|
|
* ID_LOAD_FILE
|
|
|
|
* ID_MENU_READ_BOARD_BACKUP_FILE
|
|
|
|
* ID_MENU_RECOVER_BOARD_AUTOSAVE
|
|
|
|
* ID_APPEND_FILE
|
|
|
|
* ID_NEW_BOARD
|
|
|
|
* ID_SAVE_BOARD
|
|
|
|
* ID_COPY_BOARD_AS
|
|
|
|
* ID_SAVE_BOARD_AS
|
|
|
|
* Files_io_from_id prepare parameters and calls the specialized function
|
|
|
|
*/
|
|
|
|
void Files_io_from_id( int aId );
|
|
|
|
|
2010-11-12 15:17:10 +00:00
|
|
|
/**
|
* KIWAY Milestone A): Make major modules into DLL/DSOs.
! The initial testing of this commit should be done using a Debug build so that
all the wxASSERT()s are enabled. Also, be sure and keep enabled the
USE_KIWAY_DLLs option. The tree won't likely build without it. Turning it
off is senseless anyways. If you want stable code, go back to a prior version,
the one tagged with "stable".
* Relocate all functionality out of the wxApp derivative into more finely
targeted purposes:
a) DLL/DSO specific
b) PROJECT specific
c) EXE or process specific
d) configuration file specific data
e) configuration file manipulations functions.
All of this functionality was blended into an extremely large wxApp derivative
and that was incompatible with the desire to support multiple concurrently
loaded DLL/DSO's ("KIFACE")s and multiple concurrently open projects.
An amazing amount of organization come from simply sorting each bit of
functionality into the proper box.
* Switch to wxConfigBase from wxConfig everywhere except instantiation.
* Add classes KIWAY, KIFACE, KIFACE_I, SEARCH_STACK, PGM_BASE, PGM_KICAD,
PGM_SINGLE_TOP,
* Remove "Return" prefix on many function names.
* Remove obvious comments from CMakeLists.txt files, and from else() and endif()s.
* Fix building boost for use in a DSO on linux.
* Remove some of the assumptions in the CMakeLists.txt files that windows had
to be the host platform when building windows binaries.
* Reduce the number of wxStrings being constructed at program load time via
static construction.
* Pass wxConfigBase* to all SaveSettings() and LoadSettings() functions so that
these functions are useful even when the wxConfigBase comes from another
source, as is the case in the KICAD_MANAGER_FRAME.
* Move the setting of the KIPRJMOD environment variable into class PROJECT,
so that it can be moved into a project variable soon, and out of FP_LIB_TABLE.
* Add the KIWAY_PLAYER which is associated with a particular PROJECT, and all
its child wxFrames and wxDialogs now have a Kiway() member function which
returns a KIWAY& that that window tree branch is in support of. This is like
wxWindows DNA in that child windows get this member with proper value at time
of construction.
* Anticipate some of the needs for milestones B) and C) and make code
adjustments now in an effort to reduce work in those milestones.
* No testing has been done for python scripting, since milestone C) has that
being largely reworked and re-thought-out.
2014-03-20 00:42:08 +00:00
|
|
|
* Function OpenProjectFiles (was LoadOnePcbFile)
|
|
|
|
* loads a KiCad board (.kicad_pcb) from \a aFileName.
|
2010-05-17 20:35:46 +00:00
|
|
|
*
|
* KIWAY Milestone A): Make major modules into DLL/DSOs.
! The initial testing of this commit should be done using a Debug build so that
all the wxASSERT()s are enabled. Also, be sure and keep enabled the
USE_KIWAY_DLLs option. The tree won't likely build without it. Turning it
off is senseless anyways. If you want stable code, go back to a prior version,
the one tagged with "stable".
* Relocate all functionality out of the wxApp derivative into more finely
targeted purposes:
a) DLL/DSO specific
b) PROJECT specific
c) EXE or process specific
d) configuration file specific data
e) configuration file manipulations functions.
All of this functionality was blended into an extremely large wxApp derivative
and that was incompatible with the desire to support multiple concurrently
loaded DLL/DSO's ("KIFACE")s and multiple concurrently open projects.
An amazing amount of organization come from simply sorting each bit of
functionality into the proper box.
* Switch to wxConfigBase from wxConfig everywhere except instantiation.
* Add classes KIWAY, KIFACE, KIFACE_I, SEARCH_STACK, PGM_BASE, PGM_KICAD,
PGM_SINGLE_TOP,
* Remove "Return" prefix on many function names.
* Remove obvious comments from CMakeLists.txt files, and from else() and endif()s.
* Fix building boost for use in a DSO on linux.
* Remove some of the assumptions in the CMakeLists.txt files that windows had
to be the host platform when building windows binaries.
* Reduce the number of wxStrings being constructed at program load time via
static construction.
* Pass wxConfigBase* to all SaveSettings() and LoadSettings() functions so that
these functions are useful even when the wxConfigBase comes from another
source, as is the case in the KICAD_MANAGER_FRAME.
* Move the setting of the KIPRJMOD environment variable into class PROJECT,
so that it can be moved into a project variable soon, and out of FP_LIB_TABLE.
* Add the KIWAY_PLAYER which is associated with a particular PROJECT, and all
its child wxFrames and wxDialogs now have a Kiway() member function which
returns a KIWAY& that that window tree branch is in support of. This is like
wxWindows DNA in that child windows get this member with proper value at time
of construction.
* Anticipate some of the needs for milestones B) and C) and make code
adjustments now in an effort to reduce work in those milestones.
* No testing has been done for python scripting, since milestone C) has that
being largely reworked and re-thought-out.
2014-03-20 00:42:08 +00:00
|
|
|
* @param aFileSet - hold the BOARD file to load, a vector of one element.
|
2010-05-17 20:35:46 +00:00
|
|
|
*
|
* KIWAY Milestone A): Make major modules into DLL/DSOs.
! The initial testing of this commit should be done using a Debug build so that
all the wxASSERT()s are enabled. Also, be sure and keep enabled the
USE_KIWAY_DLLs option. The tree won't likely build without it. Turning it
off is senseless anyways. If you want stable code, go back to a prior version,
the one tagged with "stable".
* Relocate all functionality out of the wxApp derivative into more finely
targeted purposes:
a) DLL/DSO specific
b) PROJECT specific
c) EXE or process specific
d) configuration file specific data
e) configuration file manipulations functions.
All of this functionality was blended into an extremely large wxApp derivative
and that was incompatible with the desire to support multiple concurrently
loaded DLL/DSO's ("KIFACE")s and multiple concurrently open projects.
An amazing amount of organization come from simply sorting each bit of
functionality into the proper box.
* Switch to wxConfigBase from wxConfig everywhere except instantiation.
* Add classes KIWAY, KIFACE, KIFACE_I, SEARCH_STACK, PGM_BASE, PGM_KICAD,
PGM_SINGLE_TOP,
* Remove "Return" prefix on many function names.
* Remove obvious comments from CMakeLists.txt files, and from else() and endif()s.
* Fix building boost for use in a DSO on linux.
* Remove some of the assumptions in the CMakeLists.txt files that windows had
to be the host platform when building windows binaries.
* Reduce the number of wxStrings being constructed at program load time via
static construction.
* Pass wxConfigBase* to all SaveSettings() and LoadSettings() functions so that
these functions are useful even when the wxConfigBase comes from another
source, as is the case in the KICAD_MANAGER_FRAME.
* Move the setting of the KIPRJMOD environment variable into class PROJECT,
so that it can be moved into a project variable soon, and out of FP_LIB_TABLE.
* Add the KIWAY_PLAYER which is associated with a particular PROJECT, and all
its child wxFrames and wxDialogs now have a Kiway() member function which
returns a KIWAY& that that window tree branch is in support of. This is like
wxWindows DNA in that child windows get this member with proper value at time
of construction.
* Anticipate some of the needs for milestones B) and C) and make code
adjustments now in an effort to reduce work in those milestones.
* No testing has been done for python scripting, since milestone C) has that
being largely reworked and re-thought-out.
2014-03-20 00:42:08 +00:00
|
|
|
* @param aCtl - KICTL_ bits, one to indicate that an append of the board file
|
|
|
|
* aFileName to the currently loaded file is desired.
|
|
|
|
* @see #KIWAY_PLAYER for bit defines.
|
|
|
|
*
|
|
|
|
* @return bool - false if file load fails, otherwise true.
|
2010-05-30 09:46:37 +00:00
|
|
|
bool LoadOnePcbFile( const wxString& aFileName, bool aAppend = false,
|
2010-05-17 20:35:46 +00:00
|
|
|
bool aForceFileDialog = false );
|
* KIWAY Milestone A): Make major modules into DLL/DSOs.
! The initial testing of this commit should be done using a Debug build so that
all the wxASSERT()s are enabled. Also, be sure and keep enabled the
USE_KIWAY_DLLs option. The tree won't likely build without it. Turning it
off is senseless anyways. If you want stable code, go back to a prior version,
the one tagged with "stable".
* Relocate all functionality out of the wxApp derivative into more finely
targeted purposes:
a) DLL/DSO specific
b) PROJECT specific
c) EXE or process specific
d) configuration file specific data
e) configuration file manipulations functions.
All of this functionality was blended into an extremely large wxApp derivative
and that was incompatible with the desire to support multiple concurrently
loaded DLL/DSO's ("KIFACE")s and multiple concurrently open projects.
An amazing amount of organization come from simply sorting each bit of
functionality into the proper box.
* Switch to wxConfigBase from wxConfig everywhere except instantiation.
* Add classes KIWAY, KIFACE, KIFACE_I, SEARCH_STACK, PGM_BASE, PGM_KICAD,
PGM_SINGLE_TOP,
* Remove "Return" prefix on many function names.
* Remove obvious comments from CMakeLists.txt files, and from else() and endif()s.
* Fix building boost for use in a DSO on linux.
* Remove some of the assumptions in the CMakeLists.txt files that windows had
to be the host platform when building windows binaries.
* Reduce the number of wxStrings being constructed at program load time via
static construction.
* Pass wxConfigBase* to all SaveSettings() and LoadSettings() functions so that
these functions are useful even when the wxConfigBase comes from another
source, as is the case in the KICAD_MANAGER_FRAME.
* Move the setting of the KIPRJMOD environment variable into class PROJECT,
so that it can be moved into a project variable soon, and out of FP_LIB_TABLE.
* Add the KIWAY_PLAYER which is associated with a particular PROJECT, and all
its child wxFrames and wxDialogs now have a Kiway() member function which
returns a KIWAY& that that window tree branch is in support of. This is like
wxWindows DNA in that child windows get this member with proper value at time
of construction.
* Anticipate some of the needs for milestones B) and C) and make code
adjustments now in an effort to reduce work in those milestones.
* No testing has been done for python scripting, since milestone C) has that
being largely reworked and re-thought-out.
2014-03-20 00:42:08 +00:00
|
|
|
*/
|
2016-09-24 18:53:15 +00:00
|
|
|
bool OpenProjectFiles( const std::vector<wxString>& aFileSet, int aCtl = 0 ) override;
|
2010-01-21 07:41:30 +00:00
|
|
|
|
|
|
|
/**
|
Modular KiCad Blueprint Milestone B), major portions:
*) When kicad.exe closes a project, close any open KIFACEs so that they cannot
get disassociated from their true PROJECT.
*) Allow loading eeschema library editor from kicad.exe
*) Allow loading pcbnew library editor from kicad.exe
*) Rename LIB_COMPONENT to LIB_PART.
*) Add class PART_LIBS, and PART_LIB.
*) Make PART_LIBS non-global, i.e. PROJECT specific.
*) Implement "data on demand" for PART_LIBS
*) Implement "data on demand" for schematic SEARCH_STACK.
*) Use RSTRINGs to retain eeschema editor's notion of last library and part being edited.
*) Get rid of library search on every SCH_COMPONENT::Draw() call, instead use
a weak pointer.
*) Remove all chdir() calls so projects don't need to be CWD.
*) Romove APPEND support from OpenProjectFiles().
*) Make OpenProjectFiles() robust, even for creating new projects.
*) Load EESCHEMA colors in the KIWAY::OnKiwayStart() rather in window open,
and save them in the .eeschema config file, not in the project file.
*) Fix bug with wxDir() while accessing protected dirs in kicad.exe
*) Consolidate template copying into PROJECT class, not in kicad.exe source.
*) Generally untangle eeschema, making its libraries not global but rather
held in the PROJECT.
2014-08-13 20:28:54 +00:00
|
|
|
* Function AppendBoardFile
|
|
|
|
* appends a board file onto the current one, creating God knows what.
|
2015-02-14 12:43:11 +00:00
|
|
|
* the main purpose is only to allow panelizing boards.
|
2010-01-21 07:41:30 +00:00
|
|
|
*/
|
Modular KiCad Blueprint Milestone B), major portions:
*) When kicad.exe closes a project, close any open KIFACEs so that they cannot
get disassociated from their true PROJECT.
*) Allow loading eeschema library editor from kicad.exe
*) Allow loading pcbnew library editor from kicad.exe
*) Rename LIB_COMPONENT to LIB_PART.
*) Add class PART_LIBS, and PART_LIB.
*) Make PART_LIBS non-global, i.e. PROJECT specific.
*) Implement "data on demand" for PART_LIBS
*) Implement "data on demand" for schematic SEARCH_STACK.
*) Use RSTRINGs to retain eeschema editor's notion of last library and part being edited.
*) Get rid of library search on every SCH_COMPONENT::Draw() call, instead use
a weak pointer.
*) Remove all chdir() calls so projects don't need to be CWD.
*) Romove APPEND support from OpenProjectFiles().
*) Make OpenProjectFiles() robust, even for creating new projects.
*) Load EESCHEMA colors in the KIWAY::OnKiwayStart() rather in window open,
and save them in the .eeschema config file, not in the project file.
*) Fix bug with wxDir() while accessing protected dirs in kicad.exe
*) Consolidate template copying into PROJECT class, not in kicad.exe source.
*) Generally untangle eeschema, making its libraries not global but rather
held in the PROJECT.
2014-08-13 20:28:54 +00:00
|
|
|
bool AppendBoardFile( const wxString& aFullFileName, int aCtl );
|
2010-01-21 07:41:30 +00:00
|
|
|
|
2011-08-26 17:01:17 +00:00
|
|
|
/**
|
|
|
|
* Function SavePcbFile
|
|
|
|
* writes the board data structures to \a a aFileName
|
2015-02-14 12:43:11 +00:00
|
|
|
* Creates backup when requested and update flags (modified and saved flgs)
|
2011-08-26 17:01:17 +00:00
|
|
|
*
|
|
|
|
* @param aFileName The file name to write or wxEmptyString to prompt user for
|
|
|
|
* file name.
|
2011-10-13 19:56:32 +00:00
|
|
|
* @param aCreateBackupFile Creates a back of \a aFileName if true. Helper
|
|
|
|
* definitions #CREATE_BACKUP_FILE and #NO_BACKUP_FILE
|
|
|
|
* are defined for improved code readability.
|
2011-08-26 17:01:17 +00:00
|
|
|
* @return True if file was saved successfully.
|
|
|
|
*/
|
2011-10-13 19:56:32 +00:00
|
|
|
bool SavePcbFile( const wxString& aFileName, bool aCreateBackupFile = CREATE_BACKUP_FILE );
|
2011-08-26 17:01:17 +00:00
|
|
|
|
2015-02-14 12:43:11 +00:00
|
|
|
/**
|
|
|
|
* Function SavePcbCopy
|
|
|
|
* writes the board data structures to \a a aFileName
|
|
|
|
* but unlike SavePcbFile, does not make anything else
|
|
|
|
* (no backup, borad fliename change, no flag changes ...)
|
|
|
|
* Used under a project mgr to save under a new name the current board
|
|
|
|
*
|
|
|
|
* When not under a project mgr, the full SavePcbFile is used.
|
|
|
|
* @param aFileName The file name to write.
|
|
|
|
* @return True if file was saved successfully.
|
|
|
|
*/
|
|
|
|
bool SavePcbCopy( const wxString& aFileName );
|
2009-03-30 15:36:41 +00:00
|
|
|
|
2009-08-06 15:42:09 +00:00
|
|
|
// BOARD handling
|
2009-11-23 20:18:47 +00:00
|
|
|
|
2010-11-12 15:17:10 +00:00
|
|
|
/**
|
2010-11-12 16:59:16 +00:00
|
|
|
* Function Clear_Pcb
|
2009-08-06 15:42:09 +00:00
|
|
|
* delete all and reinitialize the current board
|
2011-02-21 13:54:29 +00:00
|
|
|
* @param aQuery = true to prompt user for confirmation, false to initialize silently
|
2009-08-06 15:42:09 +00:00
|
|
|
*/
|
2009-11-23 20:18:47 +00:00
|
|
|
bool Clear_Pcb( bool aQuery );
|
2009-09-22 12:27:57 +00:00
|
|
|
|
2014-09-08 12:06:38 +00:00
|
|
|
///> @copydoc PCB_BASE_FRAME::SetBoard()
|
2016-09-24 18:53:15 +00:00
|
|
|
void SetBoard( BOARD* aBoard ) override;
|
2013-11-25 15:50:03 +00:00
|
|
|
|
2016-05-13 15:31:54 +00:00
|
|
|
///> @copydoc PCB_BASE_EDIT_FRAME::GetModel()
|
|
|
|
BOARD_ITEM_CONTAINER* GetModel() const override;
|
|
|
|
|
2014-09-08 12:06:38 +00:00
|
|
|
///> @copydoc PCB_BASE_FRAME::SetPageSettings()
|
2016-09-24 18:53:15 +00:00
|
|
|
void SetPageSettings( const PAGE_INFO& aPageSettings ) override;
|
2014-09-08 12:06:38 +00:00
|
|
|
|
2009-09-10 13:04:04 +00:00
|
|
|
// Drc control
|
2009-11-23 20:18:47 +00:00
|
|
|
|
2009-09-10 13:04:04 +00:00
|
|
|
/* function GetDrcController
|
|
|
|
* @return the DRC controller
|
|
|
|
*/
|
2009-11-23 20:18:47 +00:00
|
|
|
DRC* GetDrcController() { return m_drc; }
|
2009-08-06 15:42:09 +00:00
|
|
|
|
2009-03-30 15:36:41 +00:00
|
|
|
/**
|
|
|
|
* Function RecreateBOMFileFromBoard
|
|
|
|
* Recreates a .cmp file from the current loaded board
|
2011-09-30 18:15:37 +00:00
|
|
|
* this is the same as created by CvPcb.
|
2009-03-30 15:36:41 +00:00
|
|
|
* can be used if this file is lost
|
|
|
|
*/
|
2011-09-15 17:58:35 +00:00
|
|
|
void RecreateCmpFileFromBoard( wxCommandEvent& aEvent );
|
2009-03-30 15:36:41 +00:00
|
|
|
|
2012-01-06 19:00:59 +00:00
|
|
|
/**
|
|
|
|
* Function ArchiveModulesOnBoard
|
|
|
|
* Save modules in a library:
|
2015-09-28 08:46:00 +00:00
|
|
|
* @param aStoreInNewLib:
|
|
|
|
* true : save modules in a existing lib. Existing footprints will be kept
|
|
|
|
* or updated.
|
|
|
|
* This lib should be in fp lib table, and is type is .pretty
|
|
|
|
* false: save modules in a new lib. It it is an existing lib,
|
|
|
|
* previous footprints will be removed
|
|
|
|
*/
|
|
|
|
void ArchiveModulesOnBoard( bool aStoreInNewLib );
|
2012-01-06 19:00:59 +00:00
|
|
|
|
2009-03-30 15:36:41 +00:00
|
|
|
/**
|
|
|
|
* Function RecreateBOMFileFromBoard
|
|
|
|
* Creates a BOM file from the current loaded board
|
|
|
|
*/
|
2011-09-15 17:58:35 +00:00
|
|
|
void RecreateBOMFileFromBoard( wxCommandEvent& aEvent );
|
2009-01-15 08:12:03 +00:00
|
|
|
|
2011-11-10 15:55:05 +00:00
|
|
|
/**
|
|
|
|
* Function ExportToGenCAD
|
|
|
|
* creates a file in GenCAD 1.4 format from the current board.
|
|
|
|
*/
|
2011-09-15 17:58:35 +00:00
|
|
|
void ExportToGenCAD( wxCommandEvent& event );
|
2008-03-04 04:22:27 +00:00
|
|
|
|
2010-04-19 06:21:56 +00:00
|
|
|
/**
|
|
|
|
* Function OnExportVRML
|
|
|
|
* will export the current BOARD to a VRML file.
|
|
|
|
*/
|
|
|
|
void OnExportVRML( wxCommandEvent& event );
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Function ExportVRML_File
|
|
|
|
* Creates the file(s) exporting current BOARD to a VRML file.
|
2013-03-28 16:51:22 +00:00
|
|
|
*
|
|
|
|
* @note When copying 3D shapes files, the new filename is build from the full path
|
|
|
|
* name, changing the separators by underscore. This is needed because files
|
|
|
|
* with the same shortname can exist in different directories
|
|
|
|
* @note ExportVRML_File generates coordinates in board units (BIU) inside the file.
|
|
|
|
* @todo Use mm inside the file. A general scale transform is applied to the whole
|
|
|
|
* file (1.0 to have the actual WRML unit im mm, 0.001 to have the actual WRML
|
|
|
|
* unit in meters.
|
2014-12-20 16:13:51 +00:00
|
|
|
* @note For 3D models built by a 3D modeler, the unit is 0,1 inches. A specific scale
|
2013-03-28 16:51:22 +00:00
|
|
|
* is applied to 3D models to convert them to internal units.
|
|
|
|
*
|
2010-04-19 06:21:56 +00:00
|
|
|
* @param aFullFileName = the full filename of the file to create
|
2013-01-13 16:55:07 +00:00
|
|
|
* @param aMMtoWRMLunit = the VRML scaling factor:
|
|
|
|
* 1.0 to export in mm. 0.001 for meters
|
2010-04-19 06:21:56 +00:00
|
|
|
* @param aExport3DFiles = true to copy 3D shapes in the subir a3D_Subdir
|
2014-10-17 23:28:12 +00:00
|
|
|
* @param aUseRelativePaths set to true to use relative paths instead of absolute paths
|
|
|
|
* in the board VRML file URLs.
|
2014-12-20 16:13:51 +00:00
|
|
|
* @param aUsePlainPCB set to true to export a board with no copper or silkskreen;
|
|
|
|
* this is useful for generating a VRML file which can be
|
|
|
|
* converted to a STEP model.
|
2014-10-17 23:28:12 +00:00
|
|
|
* @param a3D_Subdir = sub directory where 3D shapes files are copied. This is only used
|
|
|
|
* when aExport3DFiles == true
|
2015-08-13 13:13:34 +00:00
|
|
|
* @param aXRef = X value of PCB (0,0) reference point
|
|
|
|
* @param aYRef = Y value of PCB (0,0) reference point
|
2010-04-19 06:21:56 +00:00
|
|
|
* @return true if Ok.
|
|
|
|
*/
|
2013-01-13 16:55:07 +00:00
|
|
|
bool ExportVRML_File( const wxString & aFullFileName, double aMMtoWRMLunit,
|
2014-10-17 23:28:12 +00:00
|
|
|
bool aExport3DFiles, bool aUseRelativePaths,
|
2015-08-13 13:13:34 +00:00
|
|
|
bool aUsePlainPCB, const wxString & a3D_Subdir,
|
|
|
|
double aXRef, double aYRef );
|
2010-04-19 06:21:56 +00:00
|
|
|
|
2014-01-02 09:26:03 +00:00
|
|
|
/**
|
2016-07-19 17:35:25 +00:00
|
|
|
* Function OnExportIDF3
|
2014-01-02 09:26:03 +00:00
|
|
|
* will export the current BOARD to a IDFv3 board and lib files.
|
|
|
|
*/
|
2016-07-19 17:35:25 +00:00
|
|
|
void OnExportIDF3( wxCommandEvent& event );
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Function Export_IDF3
|
|
|
|
* Creates an IDF3 compliant BOARD (*.emn) and LIBRARY (*.emp) file.
|
|
|
|
*
|
|
|
|
* @param aPcb = a pointer to the board to be exported to IDF
|
|
|
|
* @param aFullFileName = the full filename of the export file
|
|
|
|
* @param aUseThou = set to true if the desired IDF unit is thou (mil)
|
|
|
|
* @param aXRef = the board Reference Point in mm, X value
|
|
|
|
* @param aYRef = the board Reference Point in mm, Y value
|
|
|
|
* @return true if OK
|
|
|
|
*/
|
|
|
|
bool Export_IDF3( BOARD* aPcb, const wxString& aFullFileName,
|
|
|
|
bool aUseThou, double aXRef, double aYRef );
|
2014-01-02 09:26:03 +00:00
|
|
|
|
2016-09-19 07:40:36 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Function OnExportSTEP
|
|
|
|
* Exports the current BOARD to a STEP assembly.
|
|
|
|
*/
|
|
|
|
void OnExportSTEP( wxCommandEvent& event );
|
|
|
|
|
2008-01-21 22:16:45 +00:00
|
|
|
/**
|
|
|
|
* Function ExporttoSPECCTRA
|
2014-03-27 17:45:05 +00:00
|
|
|
* Ask for a filename and call ExportSpecctraFile to export the current BOARD
|
|
|
|
* to a specctra dsn file.
|
|
|
|
*/
|
|
|
|
void ExportToSpecctra( wxCommandEvent& event );
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Function ExportSpecctraFile
|
|
|
|
* will export the current BOARD to a specctra dsn file.
|
2008-01-21 22:16:45 +00:00
|
|
|
* See http://www.autotraxeda.com/docs/SPECCTRA/SPECCTRA.pdf for the
|
|
|
|
* specification.
|
2014-03-27 17:45:05 +00:00
|
|
|
* @return true if OK
|
2008-01-21 22:16:45 +00:00
|
|
|
*/
|
2014-03-27 17:45:05 +00:00
|
|
|
bool ExportSpecctraFile( const wxString& aFullFilename );
|
2008-01-01 11:58:14 +00:00
|
|
|
|
2008-02-06 22:32:15 +00:00
|
|
|
/**
|
|
|
|
* Function ImportSpecctraSession
|
2008-03-04 04:22:27 +00:00
|
|
|
* will import a specctra *.ses file and use it to relocate MODULEs and
|
2008-02-06 22:32:15 +00:00
|
|
|
* to replace all vias and tracks in an existing and loaded BOARD.
|
|
|
|
* See http://www.autotraxeda.com/docs/SPECCTRA/SPECCTRA.pdf for the
|
|
|
|
* specification.
|
|
|
|
*/
|
2011-09-15 17:58:35 +00:00
|
|
|
void ImportSpecctraSession( wxCommandEvent& event );
|
2008-02-06 22:32:15 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Function ImportSpecctraDesign
|
2008-03-04 04:22:27 +00:00
|
|
|
* will import a specctra *.dsn file and use it to replace an entire BOARD.
|
2009-11-23 20:18:47 +00:00
|
|
|
* The new board will not have any graphics, only components, tracks and
|
|
|
|
* vias.
|
2008-02-06 22:32:15 +00:00
|
|
|
* See http://www.autotraxeda.com/docs/SPECCTRA/SPECCTRA.pdf for the
|
|
|
|
* specification.
|
|
|
|
*/
|
2011-09-15 17:58:35 +00:00
|
|
|
void ImportSpecctraDesign( wxCommandEvent& event );
|
2008-03-04 04:22:27 +00:00
|
|
|
|
2008-03-22 05:55:06 +00:00
|
|
|
/**
|
2008-03-14 10:09:39 +00:00
|
|
|
* Function Access_to_External_Tool
|
2008-03-22 05:55:06 +00:00
|
|
|
* Run an external tool (like freeroute )
|
2009-01-15 08:12:03 +00:00
|
|
|
*/
|
2011-09-15 17:58:35 +00:00
|
|
|
void Access_to_External_Tool( wxCommandEvent& event );
|
2008-03-14 10:09:39 +00:00
|
|
|
|
2013-04-25 16:29:35 +00:00
|
|
|
/**
|
|
|
|
* Function ListAndSelectModuleName
|
|
|
|
* builds and shows a list of existing modules on board that the user can select.
|
|
|
|
* @return a pointer to the selected module or NULL.
|
|
|
|
*/
|
2011-09-15 17:58:35 +00:00
|
|
|
MODULE* ListAndSelectModuleName();
|
2009-05-28 08:42:24 +00:00
|
|
|
|
2010-11-12 15:17:10 +00:00
|
|
|
/**
|
|
|
|
* Function ListNetsAndSelect
|
2009-05-28 08:42:24 +00:00
|
|
|
* called by a command event
|
|
|
|
* displays the sorted list of nets in a dialog frame
|
2009-11-23 20:18:47 +00:00
|
|
|
* If a net is selected, it is highlighted
|
2009-05-28 08:42:24 +00:00
|
|
|
*/
|
2011-09-15 17:58:35 +00:00
|
|
|
void ListNetsAndSelect( wxCommandEvent& event );
|
2009-05-28 08:42:24 +00:00
|
|
|
|
2011-09-15 17:58:35 +00:00
|
|
|
void Swap_Layers( wxCommandEvent& event );
|
2008-01-01 11:58:14 +00:00
|
|
|
|
|
|
|
// Handling texts on the board
|
2011-09-15 17:58:35 +00:00
|
|
|
void Rotate_Texte_Pcb( TEXTE_PCB* TextePcb, wxDC* DC );
|
2012-05-30 17:38:52 +00:00
|
|
|
void FlipTextePcb( TEXTE_PCB* aTextePcb, wxDC* aDC );
|
2012-07-04 19:50:47 +00:00
|
|
|
TEXTE_PCB* CreateTextePcb( wxDC* aDC, TEXTE_PCB* aText = NULL );
|
2011-09-15 17:58:35 +00:00
|
|
|
void Delete_Texte_Pcb( TEXTE_PCB* TextePcb, wxDC* DC );
|
2012-07-04 19:50:47 +00:00
|
|
|
void StartMoveTextePcb( TEXTE_PCB* aTextePcb, wxDC* aDC, bool aErase = true );
|
2011-09-15 17:58:35 +00:00
|
|
|
void Place_Texte_Pcb( TEXTE_PCB* TextePcb, wxDC* DC );
|
|
|
|
void InstallTextPCBOptionsFrame( TEXTE_PCB* TextPCB, wxDC* DC );
|
2008-01-01 11:58:14 +00:00
|
|
|
|
|
|
|
// Graphic Segments type DRAWSEGMENT
|
2011-09-15 17:58:35 +00:00
|
|
|
void Start_Move_DrawItem( DRAWSEGMENT* drawitem, wxDC* DC );
|
|
|
|
void Place_DrawItem( DRAWSEGMENT* drawitem, wxDC* DC );
|
|
|
|
void InstallGraphicItemPropertiesDialog( DRAWSEGMENT* aItem, wxDC* aDC );
|
2008-01-01 11:58:14 +00:00
|
|
|
|
2011-03-01 19:26:17 +00:00
|
|
|
// Footprint edition (see also PCB_BASE_FRAME)
|
2011-09-15 17:58:35 +00:00
|
|
|
void InstallModuleOptionsFrame( MODULE* Module, wxDC* DC );
|
2012-09-11 07:33:17 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Function StartMoveModule
|
|
|
|
* Initialize a drag or move pad command
|
|
|
|
* @param aModule = the module to move or drag
|
|
|
|
* @param aDC = the current device context
|
|
|
|
* @param aDragConnectedTracks = true to drag connected tracks,
|
|
|
|
* false to just move the module
|
|
|
|
*/
|
|
|
|
void StartMoveModule( MODULE* aModule, wxDC* aDC, bool aDragConnectedTracks );
|
2010-12-29 17:47:32 +00:00
|
|
|
|
2011-12-30 12:29:54 +00:00
|
|
|
/**
|
|
|
|
* Function DlgGlobalChange_PadSettings
|
|
|
|
* Function to change pad caracteristics for the given footprint
|
|
|
|
* or all footprints which look like the given footprint
|
|
|
|
* Options are set by the opened dialog.
|
|
|
|
* @param aPad is the pattern. The given footprint is the parent of this pad
|
|
|
|
* @param aRedraw: if true: redraws the footprint
|
|
|
|
*/
|
|
|
|
void DlgGlobalChange_PadSettings( D_PAD* aPad, bool aRedraw );
|
|
|
|
|
2010-12-29 17:47:32 +00:00
|
|
|
/**
|
|
|
|
* Function Delete Module
|
|
|
|
* Remove a footprint from m_Modules linked list and put it in undelete buffer
|
|
|
|
* The ratsnest and pad list are recalculated
|
|
|
|
* @param aModule = footprint to delete
|
|
|
|
* @param aDC = currentDevice Context. if NULL: do not redraw new ratsnest
|
|
|
|
*/
|
2015-11-18 18:59:24 +00:00
|
|
|
bool Delete_Module( MODULE* aModule, wxDC* aDC );
|
2010-12-29 17:47:32 +00:00
|
|
|
|
2011-09-16 14:13:02 +00:00
|
|
|
/**
|
|
|
|
* Function Change_Side_Module
|
|
|
|
* Flip a footprint (switch layer from component or component to copper)
|
|
|
|
* The mirroring is made from X axis
|
|
|
|
* if a footprint is not on copper or component layer it is not flipped
|
|
|
|
* (it could be on an adhesive layer, not supported at this time)
|
|
|
|
* @param Module the footprint to flip
|
|
|
|
* @param DC Current Device Context. if NULL, no redraw
|
|
|
|
*/
|
2011-09-15 17:58:35 +00:00
|
|
|
void Change_Side_Module( MODULE* Module, wxDC* DC );
|
2009-11-23 20:18:47 +00:00
|
|
|
|
2015-08-06 17:11:51 +00:00
|
|
|
int InstallExchangeModuleFrame( MODULE* ExchangeModuleModule );
|
2009-08-06 07:11:04 +00:00
|
|
|
|
2010-11-12 15:17:10 +00:00
|
|
|
/**
|
|
|
|
* Function Exchange_Module
|
2009-08-06 07:11:04 +00:00
|
|
|
* Replaces OldModule by NewModule, using OldModule settings:
|
|
|
|
* position, orientation, pad netnames ...)
|
|
|
|
* OldModule is deleted or put in undo list.
|
|
|
|
* @param aOldModule = footprint to replace
|
|
|
|
* @param aNewModule = footprint to put
|
2016-08-17 15:24:04 +00:00
|
|
|
* @param aCommit = commit that should store the changes
|
2009-08-06 07:11:04 +00:00
|
|
|
*/
|
2016-08-17 15:24:04 +00:00
|
|
|
void Exchange_Module( MODULE* aOldModule, MODULE* aNewModule, BOARD_COMMIT& aCommit );
|
2008-01-01 11:58:14 +00:00
|
|
|
|
2011-03-01 19:26:17 +00:00
|
|
|
// loading modules: see PCB_BASE_FRAME
|
2008-01-01 11:58:14 +00:00
|
|
|
|
|
|
|
// Board handling
|
2011-09-15 17:58:35 +00:00
|
|
|
void RemoveStruct( BOARD_ITEM* Item, wxDC* DC );
|
2008-01-01 11:58:14 +00:00
|
|
|
|
2010-11-12 15:17:10 +00:00
|
|
|
/**
|
|
|
|
* Function OnEditItemRequest
|
2010-08-10 18:34:26 +00:00
|
|
|
* Install the corresponding dialog editor for the given item
|
2011-02-22 16:43:03 +00:00
|
|
|
* @param aDC = the current device context
|
2010-08-10 18:34:26 +00:00
|
|
|
* @param aItem = a pointer to the BOARD_ITEM to edit
|
|
|
|
*/
|
2016-09-24 18:53:15 +00:00
|
|
|
void OnEditItemRequest( wxDC* aDC, BOARD_ITEM* aItem ) override;
|
2010-08-10 18:34:26 +00:00
|
|
|
|
2011-10-17 20:01:27 +00:00
|
|
|
/**
|
|
|
|
* Locate track or pad and highlight the corresponding net.
|
|
|
|
* @return The Netcode, or -1 if no net located.
|
|
|
|
*/
|
|
|
|
int SelectHighLight( wxDC* DC );
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Function HighLight.
|
|
|
|
* highlights the net at the current cursor position.
|
|
|
|
*/
|
|
|
|
void HighLight( wxDC* DC );
|
2008-01-01 11:58:14 +00:00
|
|
|
|
|
|
|
// Track and via edition:
|
2011-10-17 20:01:27 +00:00
|
|
|
void Via_Edit_Control( wxCommandEvent& event );
|
2008-01-05 13:37:51 +00:00
|
|
|
|
2011-08-26 17:01:17 +00:00
|
|
|
/**
|
|
|
|
* Function IsMicroViaAcceptable
|
|
|
|
* return true if a microvia can be placed on the board.
|
|
|
|
* <p>
|
2010-01-31 20:01:46 +00:00
|
|
|
* A microvia is a small via restricted to 2 near neighbor layers
|
|
|
|
* because its is hole is made by laser which can penetrate only one layer
|
|
|
|
* It is mainly used to connect BGA to the first inner layer
|
|
|
|
* And it is allowed from an external layer to the first inner layer
|
2011-08-26 17:01:17 +00:00
|
|
|
* </p>
|
2010-01-31 20:01:46 +00:00
|
|
|
*/
|
|
|
|
bool IsMicroViaAcceptable( void );
|
|
|
|
|
2008-01-01 11:58:14 +00:00
|
|
|
/**
|
|
|
|
* Function Other_Layer_Route
|
2009-11-23 20:18:47 +00:00
|
|
|
* operates in one of two ways. If argument track is NULL, then swap the
|
|
|
|
* active layer between m_Route_Layer_TOP and m_Route_Layer_BOTTOM. If a
|
|
|
|
* track is in progress (track is not NULL), and if DRC allows it, place
|
|
|
|
* a via on the end of the current track, and then swap the current active
|
|
|
|
* layer and start a new segment on the new layer.
|
2008-01-01 11:58:14 +00:00
|
|
|
* @param track A TRACK* to append the via to or NULL.
|
|
|
|
* @param DC A device context to draw on.
|
|
|
|
* @return bool - true if the operation was successful, else false such as
|
2009-11-23 20:18:47 +00:00
|
|
|
* the case where DRC would not allow a via.
|
2008-01-05 13:37:51 +00:00
|
|
|
*/
|
2011-09-15 17:58:35 +00:00
|
|
|
bool Other_Layer_Route( TRACK* track, wxDC* DC );
|
|
|
|
void HighlightUnconnectedPads( wxDC* DC );
|
2011-09-14 20:04:58 +00:00
|
|
|
|
2011-10-17 20:01:27 +00:00
|
|
|
/**
|
|
|
|
* Function Delete_Segment
|
2011-12-04 17:57:03 +00:00
|
|
|
* removes a track segment.
|
|
|
|
* If a new track is in progress: delete the current new segment.
|
|
|
|
* Otherwise, delete segment under the mouse cursor.
|
2011-10-17 20:01:27 +00:00
|
|
|
*/
|
2009-11-23 20:18:47 +00:00
|
|
|
TRACK* Delete_Segment( wxDC* DC, TRACK* Track );
|
2011-10-17 20:01:27 +00:00
|
|
|
|
2011-09-15 17:58:35 +00:00
|
|
|
void Delete_Track( wxDC* DC, TRACK* Track );
|
|
|
|
void Delete_net( wxDC* DC, TRACK* Track );
|
2011-10-17 20:01:27 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Function Remove_One_Track
|
|
|
|
* removes 1 track/
|
|
|
|
* The leading segment is removed and all adjacent segments
|
|
|
|
* until a pad or a junction point of more than 2 segments is found
|
|
|
|
*/
|
2011-09-15 17:58:35 +00:00
|
|
|
void Remove_One_Track( wxDC* DC, TRACK* pt_segm );
|
2009-10-30 17:58:15 +00:00
|
|
|
|
2010-11-12 15:17:10 +00:00
|
|
|
/**
|
|
|
|
* Function Reset_All_Tracks_And_Vias_To_Netclass_Values
|
2009-10-30 17:58:15 +00:00
|
|
|
* Reset all tracks width and/or vias diameters and drill
|
|
|
|
* to their default Netclass value
|
|
|
|
* @param aTrack : bool true to modify tracks
|
|
|
|
* @param aVia : bool true to modify vias
|
|
|
|
*/
|
2011-09-15 17:58:35 +00:00
|
|
|
bool Reset_All_Tracks_And_Vias_To_Netclass_Values( bool aTrack, bool aVia );
|
2009-10-30 17:58:15 +00:00
|
|
|
|
2010-11-12 15:17:10 +00:00
|
|
|
/**
|
|
|
|
* Function Change_Net_Tracks_And_Vias_Sizes
|
2009-10-30 17:58:15 +00:00
|
|
|
* Reset all tracks width and vias diameters and drill
|
2009-11-23 20:18:47 +00:00
|
|
|
* to their default Netclass value or current values
|
2009-10-30 17:58:15 +00:00
|
|
|
* @param aNetcode : the netcode of the net to edit
|
2009-11-23 20:18:47 +00:00
|
|
|
* @param aUseNetclassValue : bool. True to use netclass values, false to
|
|
|
|
* use current values
|
2009-10-30 17:58:15 +00:00
|
|
|
*/
|
2011-09-15 17:58:35 +00:00
|
|
|
bool Change_Net_Tracks_And_Vias_Sizes( int aNetcode, bool aUseNetclassValue );
|
2009-08-08 06:07:08 +00:00
|
|
|
|
2010-11-12 15:17:10 +00:00
|
|
|
/**
|
|
|
|
* Function Edit_Track_Width
|
2009-08-08 06:07:08 +00:00
|
|
|
* Modify a full track width (using DRC control).
|
2009-11-23 20:18:47 +00:00
|
|
|
* a full track is the set of track segments between 2 ends: pads or a
|
|
|
|
* point that has more than 2 segments ends connected
|
2010-12-21 12:41:17 +00:00
|
|
|
* @param aDC = the curred device context (can be NULL)
|
2009-08-08 06:07:08 +00:00
|
|
|
* @param aTrackSegment = a segment or via on the track to change
|
|
|
|
*/
|
2011-09-15 17:58:35 +00:00
|
|
|
void Edit_Track_Width( wxDC* aDC, TRACK* aTrackSegment );
|
2009-08-08 06:07:08 +00:00
|
|
|
|
2010-11-12 15:17:10 +00:00
|
|
|
/**
|
|
|
|
* Function Edit_TrackSegm_Width
|
2009-08-08 06:07:08 +00:00
|
|
|
* Modify one track segment width or one via diameter (using DRC control).
|
2010-12-21 12:41:17 +00:00
|
|
|
* @param aDC = the current device context (can be NULL)
|
2009-08-08 06:07:08 +00:00
|
|
|
* @param aTrackItem = the track segment or via to modify
|
|
|
|
*/
|
2011-09-15 17:58:35 +00:00
|
|
|
void Edit_TrackSegm_Width( wxDC* aDC, TRACK* aTrackItem );
|
2010-12-21 12:41:17 +00:00
|
|
|
|
2011-04-14 18:44:46 +00:00
|
|
|
/**
|
|
|
|
* Function Begin_Route
|
|
|
|
* Starts a new track and/or establish of a new track point.
|
|
|
|
*
|
|
|
|
* For a new track:
|
|
|
|
* - Search the netname of the new track from the starting point
|
|
|
|
* if it is on a pad or an existing track
|
|
|
|
* - Highlight all this net
|
|
|
|
* If a track is in progress:
|
|
|
|
* - Call DRC
|
|
|
|
* - If DRC is OK: finish the track segment and starts a new one.
|
|
|
|
* @param aTrack = the current track segment, or NULL to start a new track
|
|
|
|
* @param aDC = the current device context
|
|
|
|
* @return a pointer to the new track segment or null if not created (DRC error)
|
|
|
|
*/
|
|
|
|
TRACK* Begin_Route( TRACK* aTrack, wxDC* aDC );
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Function End_Route
|
|
|
|
* Terminates a track currently being created
|
|
|
|
* @param aTrack = the current track segment in progress
|
|
|
|
* @param aDC = the current device context
|
|
|
|
* @return true if the track was created, false if not (due to a DRC error)
|
|
|
|
*/
|
2011-09-15 17:58:35 +00:00
|
|
|
bool End_Route( TRACK* aTrack, wxDC* aDC );
|
2011-04-14 18:44:46 +00:00
|
|
|
|
2011-09-15 17:58:35 +00:00
|
|
|
void Attribut_Segment( TRACK* track, wxDC* DC, bool Flag_On );
|
|
|
|
void Attribut_Track( TRACK* track, wxDC* DC, bool Flag_On );
|
|
|
|
void Attribut_net( wxDC* DC, int net_code, bool Flag_On );
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Function StartMoveOneNodeOrSegment
|
|
|
|
* initializes the parameters to move one via or/and a terminal point of a track segment
|
|
|
|
* The terminal point of other connected segments (if any) are moved too.
|
|
|
|
*/
|
|
|
|
void StartMoveOneNodeOrSegment( TRACK* aTrack, wxDC* aDC, int aCommand );
|
|
|
|
|
|
|
|
bool PlaceDraggedOrMovedTrackSegment( TRACK* Track, wxDC* DC );
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @todo This function is broken, because it merge segments having different
|
|
|
|
* widths or without any connectivity test.
|
|
|
|
* 2 collinear segments can be merged only if no other segment or via is
|
|
|
|
* connected to the common point and if they have the same width. See
|
|
|
|
* cleanup.cpp for merge functions and consider MarkTrace() to locate segments
|
|
|
|
* that can be merged
|
|
|
|
*/
|
|
|
|
bool MergeCollinearTracks( TRACK* track, wxDC* DC, int end );
|
|
|
|
|
|
|
|
void Start_DragTrackSegmentAndKeepSlope( TRACK* track, wxDC* DC );
|
2016-09-24 18:53:15 +00:00
|
|
|
void SwitchLayer( wxDC* DC, LAYER_ID layer ) override;
|
2011-09-15 17:58:35 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Function Add45DegreeSegment
|
|
|
|
* adds a track segment between 2 tracks segments if these 2 segments
|
|
|
|
* make a 90 deg angle, in order to have 45 deg track segments
|
|
|
|
* Its only works on horizontal or vertical segments.
|
|
|
|
*
|
|
|
|
* @param aDC The wxDC device context to draw on.
|
|
|
|
* @return A bool value true if ok or false if not.
|
|
|
|
*/
|
|
|
|
bool Add45DegreeSegment( wxDC* aDC );
|
2008-01-01 11:58:14 +00:00
|
|
|
|
2010-11-12 15:17:10 +00:00
|
|
|
/**
|
|
|
|
* Function EraseRedundantTrack
|
2009-08-08 06:07:08 +00:00
|
|
|
* Called after creating a track
|
2009-11-23 20:18:47 +00:00
|
|
|
* Remove (if exists) the old track that have the same starting and the
|
|
|
|
* same ending point as the new created track
|
2009-08-08 06:07:08 +00:00
|
|
|
* (this is the redunding track)
|
|
|
|
* @param aDC = the current device context (can be NULL)
|
2009-11-23 20:18:47 +00:00
|
|
|
* @param aNewTrack = the new created track (a pointer to a segment of the
|
|
|
|
* track list)
|
2009-08-08 06:07:08 +00:00
|
|
|
* @param aNewTrackSegmentsCount = number of segments in this new track
|
2009-11-23 20:18:47 +00:00
|
|
|
* @param aItemsListPicker = the list picker to use for an undo command
|
|
|
|
* (can be NULL)
|
2009-09-10 13:04:04 +00:00
|
|
|
*/
|
2011-09-15 17:58:35 +00:00
|
|
|
int EraseRedundantTrack( wxDC* aDC,
|
|
|
|
TRACK* aNewTrack,
|
|
|
|
int aNewTrackSegmentsCount,
|
|
|
|
PICKED_ITEMS_LIST* aItemsListPicker );
|
2009-08-08 06:07:08 +00:00
|
|
|
|
2010-11-12 15:17:10 +00:00
|
|
|
/**
|
|
|
|
* Function SetTrackSegmentWidth
|
2009-08-08 06:07:08 +00:00
|
|
|
* Modify one track segment width or one via diameter (using DRC control).
|
|
|
|
* Basic routine used by other routines when editing tracks or vias
|
|
|
|
* @param aTrackItem = the track segment or via to modify
|
2009-11-23 20:18:47 +00:00
|
|
|
* @param aItemsListPicker = the list picker to use for an undo command
|
|
|
|
* (can be NULL)
|
|
|
|
* @param aUseNetclassValue = true to use NetClass value, false to use
|
2010-01-31 20:01:46 +00:00
|
|
|
* current designSettings value
|
2009-08-08 06:07:08 +00:00
|
|
|
* @return true if done, false if no not change (because DRC error)
|
|
|
|
*/
|
2009-11-23 20:18:47 +00:00
|
|
|
bool SetTrackSegmentWidth( TRACK* aTrackItem,
|
|
|
|
PICKED_ITEMS_LIST* aItemsListPicker,
|
|
|
|
bool aUseNetclassValue );
|
2009-08-08 06:07:08 +00:00
|
|
|
|
|
|
|
|
2008-01-01 11:58:14 +00:00
|
|
|
// zone handling
|
2008-01-05 13:37:51 +00:00
|
|
|
|
2010-11-12 15:17:10 +00:00
|
|
|
/**
|
2011-07-16 16:04:49 +00:00
|
|
|
* Function Delete_OldZone_Fill (obsolete)
|
|
|
|
* Used for compatibility with old boards
|
2009-11-23 20:18:47 +00:00
|
|
|
* Remove the zone filling which include the segment aZone, or the zone
|
2011-07-16 16:04:49 +00:00
|
|
|
* which have the given time stamp.
|
|
|
|
* For old boards, a zone is a group of SEGZONE segments which have the same TimeStamp
|
2008-01-05 13:37:51 +00:00
|
|
|
* @param aZone = zone segment within the zone to delete. Can be NULL
|
2009-11-23 20:18:47 +00:00
|
|
|
* @param aTimestamp = Timestamp for the zone to delete, used if aZone ==
|
|
|
|
* NULL
|
2008-01-05 13:37:51 +00:00
|
|
|
*/
|
2012-05-25 01:52:04 +00:00
|
|
|
void Delete_OldZone_Fill( SEGZONE* aZone, time_t aTimestamp = 0 );
|
2008-01-31 20:53:44 +00:00
|
|
|
|
2010-11-12 15:17:10 +00:00
|
|
|
/**
|
|
|
|
* Function Delete_LastCreatedCorner
|
2008-03-04 04:22:27 +00:00
|
|
|
* Used only while creating a new zone outline
|
|
|
|
* Remove and delete the current outline segment in progress
|
|
|
|
* @return 0 if no corner in list, or corner number
|
|
|
|
*/
|
2011-10-17 20:01:27 +00:00
|
|
|
int Delete_LastCreatedCorner( wxDC* DC );
|
2008-01-05 13:37:51 +00:00
|
|
|
|
2008-01-01 11:58:14 +00:00
|
|
|
/**
|
|
|
|
* Function Begin_Zone
|
2011-10-17 20:01:27 +00:00
|
|
|
* either initializes the first segment of a new zone, or adds an
|
|
|
|
* intermediate segment.
|
|
|
|
* A new zone can be:
|
|
|
|
* created from scratch: the user will be prompted to define parameters (layer, clearence ...)
|
|
|
|
* created from a similar zone (s_CurrentZone is used): parameters are copied from
|
|
|
|
* s_CurrentZone
|
|
|
|
* created as a cutout (an hole) inside s_CurrentZone
|
2008-01-01 11:58:14 +00:00
|
|
|
*/
|
2011-09-15 17:58:35 +00:00
|
|
|
int Begin_Zone( wxDC* DC );
|
2008-01-05 13:37:51 +00:00
|
|
|
|
2008-01-01 11:58:14 +00:00
|
|
|
/**
|
|
|
|
* Function End_Zone
|
2008-01-20 19:55:22 +00:00
|
|
|
* terminates (if no DRC error ) the zone edge creation process
|
2008-01-05 13:37:51 +00:00
|
|
|
* @param DC = current Device Context
|
2008-03-04 04:22:27 +00:00
|
|
|
* @return true if Ok, false if DRC error
|
2008-01-01 11:58:14 +00:00
|
|
|
*/
|
2009-11-23 20:18:47 +00:00
|
|
|
bool End_Zone( wxDC* DC );
|
2008-01-05 13:37:51 +00:00
|
|
|
|
2010-11-12 15:17:10 +00:00
|
|
|
/**
|
2010-11-12 16:59:16 +00:00
|
|
|
* Function Fill_Zone
|
2008-01-05 13:37:51 +00:00
|
|
|
* Calculate the zone filling for the outline zone_container
|
|
|
|
* The zone outline is a frontier, and can be complex (with holes)
|
|
|
|
* The filling starts from starting points like pads, tracks.
|
|
|
|
* If exists the old filling is removed
|
2011-11-10 08:21:11 +00:00
|
|
|
* @param aZone = zone to fill
|
2008-01-05 13:37:51 +00:00
|
|
|
* @return error level (0 = no error)
|
|
|
|
*/
|
2011-11-10 08:21:11 +00:00
|
|
|
int Fill_Zone( ZONE_CONTAINER* aZone );
|
2008-01-05 13:37:51 +00:00
|
|
|
|
2010-11-12 15:17:10 +00:00
|
|
|
/**
|
2010-11-12 16:59:16 +00:00
|
|
|
* Function Fill_All_Zones
|
2008-01-05 13:37:51 +00:00
|
|
|
* Fill all zones on the board
|
|
|
|
* The old fillings are removed
|
2011-11-10 08:21:11 +00:00
|
|
|
* @param aActiveWindow = the current active window, if a progress bar is shown
|
|
|
|
* = NULL to do not display a progress bar
|
|
|
|
* @param aVerbose = true to show error messages
|
2008-01-05 13:37:51 +00:00
|
|
|
*/
|
2011-11-10 08:21:11 +00:00
|
|
|
int Fill_All_Zones( wxWindow * aActiveWindow, bool aVerbose = true );
|
2008-01-05 13:37:51 +00:00
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Function Add_Zone_Cutout
|
|
|
|
* Add a cutout zone to a given zone outline
|
|
|
|
* @param DC = current Device Context
|
|
|
|
* @param zone_container = parent zone outline
|
|
|
|
*/
|
2009-11-23 20:18:47 +00:00
|
|
|
void Add_Zone_Cutout( wxDC* DC, ZONE_CONTAINER* zone_container );
|
2008-01-05 13:37:51 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Function Add_Similar_Zone
|
|
|
|
* Add a zone to a given zone outline.
|
2009-11-23 20:18:47 +00:00
|
|
|
* if the zones are overlapping they will be merged
|
2008-01-05 13:37:51 +00:00
|
|
|
* @param DC = current Device Context
|
|
|
|
* @param zone_container = parent zone outline
|
|
|
|
*/
|
2009-11-23 20:18:47 +00:00
|
|
|
void Add_Similar_Zone( wxDC* DC, ZONE_CONTAINER* zone_container );
|
2008-01-05 13:37:51 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Function Edit_Zone_Params
|
|
|
|
* Edit params (layer, clearance, ...) for a zone outline
|
|
|
|
*/
|
2009-11-23 20:18:47 +00:00
|
|
|
void Edit_Zone_Params( wxDC* DC, ZONE_CONTAINER* zone_container );
|
2008-01-05 13:37:51 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Function Start_Move_Zone_Corner
|
|
|
|
* Prepares a move corner in a zone outline,
|
|
|
|
* called from a move corner command (IsNewCorner = false),
|
|
|
|
* or a create new cornet command (IsNewCorner = true )
|
|
|
|
*/
|
2009-11-23 20:18:47 +00:00
|
|
|
void Start_Move_Zone_Corner( wxDC* DC,
|
|
|
|
ZONE_CONTAINER* zone_container,
|
|
|
|
int corner_id,
|
|
|
|
bool IsNewCorner );
|
2008-01-05 13:37:51 +00:00
|
|
|
|
|
|
|
/**
|
2008-02-01 21:30:45 +00:00
|
|
|
* Function Start_Move_Zone_Corner
|
|
|
|
* Prepares a drag edge in an existing zone outline,
|
|
|
|
*/
|
2010-12-14 15:56:30 +00:00
|
|
|
void Start_Move_Zone_Drag_Outline_Edge( wxDC* DC,
|
|
|
|
ZONE_CONTAINER* zone_container,
|
|
|
|
int corner_id );
|
2008-02-01 21:30:45 +00:00
|
|
|
|
2008-03-04 04:22:27 +00:00
|
|
|
/**
|
|
|
|
* Function End_Move_Zone_Corner_Or_Outlines
|
|
|
|
* Terminates a move corner in a zone outline, or a move zone outlines
|
|
|
|
* @param DC = current Device Context (can be NULL)
|
|
|
|
* @param zone_container: the given zone
|
2008-01-05 13:37:51 +00:00
|
|
|
*/
|
2010-12-14 15:56:30 +00:00
|
|
|
void End_Move_Zone_Corner_Or_Outlines( wxDC* DC, ZONE_CONTAINER* zone_container );
|
2008-01-05 13:37:51 +00:00
|
|
|
|
|
|
|
/**
|
2008-01-16 20:37:50 +00:00
|
|
|
* Function End_Move_Zone_Corner_Or_Outlines
|
2008-01-05 13:37:51 +00:00
|
|
|
* Remove the currently selected corner in a zone outline
|
|
|
|
* the .m_CornerSelection is used as corner selection
|
|
|
|
*/
|
2011-09-15 17:58:35 +00:00
|
|
|
void Remove_Zone_Corner( wxDC* DC, ZONE_CONTAINER* zone_container );
|
2008-01-05 13:37:51 +00:00
|
|
|
|
2010-11-12 15:17:10 +00:00
|
|
|
/**
|
|
|
|
* Function Delete_Zone
|
2009-11-23 20:18:47 +00:00
|
|
|
* Remove the zone which include the segment aZone, or the zone which have
|
|
|
|
* the given time stamp. A zone is a group of segments which have the
|
|
|
|
* same TimeStamp
|
2008-01-05 13:37:51 +00:00
|
|
|
* @param DC = current Device Context (can be NULL)
|
|
|
|
* @param zone_container = zone to modify
|
|
|
|
* the member .m_CornerSelection is used to find the outline to remove.
|
|
|
|
* if the outline is the main outline, all the zone is removed
|
|
|
|
* otherwise, the hole is deleted
|
|
|
|
*/
|
2011-09-15 17:58:35 +00:00
|
|
|
void Delete_Zone_Contour( wxDC* DC, ZONE_CONTAINER* zone_container );
|
2008-01-05 13:37:51 +00:00
|
|
|
|
2008-03-04 04:22:27 +00:00
|
|
|
/**
|
|
|
|
* Function Start_Move_Zone_Outlines
|
2009-11-23 20:18:47 +00:00
|
|
|
* Initialize parameters to move an existing zone outlines.
|
2008-01-16 20:37:50 +00:00
|
|
|
* @param DC = current Device Context (can be NULL)
|
2008-03-04 04:22:27 +00:00
|
|
|
* @param zone_container: the given zone to move
|
|
|
|
*/
|
2011-09-15 17:58:35 +00:00
|
|
|
void Start_Move_Zone_Outlines( wxDC* DC, ZONE_CONTAINER* zone_container );
|
2008-01-16 20:37:50 +00:00
|
|
|
|
2009-01-15 08:12:03 +00:00
|
|
|
// Target handling
|
2011-09-15 17:58:35 +00:00
|
|
|
PCB_TARGET* CreateTarget( wxDC* DC );
|
|
|
|
void DeleteTarget( PCB_TARGET* aTarget, wxDC* DC );
|
|
|
|
void BeginMoveTarget( PCB_TARGET* aTarget, wxDC* DC );
|
|
|
|
void PlaceTarget( PCB_TARGET* aTarget, wxDC* DC );
|
|
|
|
void ShowTargetOptionsDialog( PCB_TARGET* aTarget, wxDC* DC );
|
2008-01-01 11:58:14 +00:00
|
|
|
|
|
|
|
// Graphic segments type DRAWSEGMENT handling:
|
2012-05-22 17:51:18 +00:00
|
|
|
DRAWSEGMENT* Begin_DrawSegment( DRAWSEGMENT* Segment, STROKE_T shape, wxDC* DC );
|
2011-09-15 17:58:35 +00:00
|
|
|
void End_Edge( DRAWSEGMENT* Segment, wxDC* DC );
|
|
|
|
void Delete_Segment_Edge( DRAWSEGMENT* Segment, wxDC* DC );
|
2014-06-24 16:17:18 +00:00
|
|
|
void Delete_Drawings_All_Layer( LAYER_ID aLayer );
|
2008-01-01 11:58:14 +00:00
|
|
|
|
|
|
|
// Dimension handling:
|
2011-09-20 15:07:52 +00:00
|
|
|
void ShowDimensionPropertyDialog( DIMENSION* aDimension, wxDC* aDC );
|
|
|
|
DIMENSION* EditDimension( DIMENSION* aDimension, wxDC* aDC );
|
|
|
|
void DeleteDimension( DIMENSION* aDimension, wxDC* aDC );
|
2011-11-24 19:57:41 +00:00
|
|
|
void BeginMoveDimensionText( DIMENSION* aItem, wxDC* DC );
|
|
|
|
void PlaceDimensionText( DIMENSION* aItem, wxDC* DC );
|
|
|
|
|
2008-01-01 11:58:14 +00:00
|
|
|
|
|
|
|
// netlist handling:
|
2011-09-15 17:58:35 +00:00
|
|
|
void InstallNetlistFrame( wxDC* DC );
|
2008-01-01 11:58:14 +00:00
|
|
|
|
2010-11-12 15:17:10 +00:00
|
|
|
/**
|
|
|
|
* Function ReadPcbNetlist
|
2014-04-04 15:42:35 +00:00
|
|
|
* reads \a aNetlistFileName and updates the footprints (load missing footprints and
|
2013-04-25 16:29:35 +00:00
|
|
|
* delete on demand extra footprints) on the board.
|
2011-05-03 12:57:44 +00:00
|
|
|
* Update connectivity info, references, values and "TIME STAMP"
|
2013-04-25 16:29:35 +00:00
|
|
|
*
|
|
|
|
* @param aNetlistFileName = netlist file name (*.net)
|
|
|
|
* @param aCmpFileName = cmp/footprint link file name (*.cmp).
|
|
|
|
* if not found or empty, only the netlist will be used
|
|
|
|
* @param aReporter is a pointer to a #REPORTER object to write display messages.
|
|
|
|
* can be NULL.
|
2010-12-21 12:41:17 +00:00
|
|
|
* @param aChangeFootprint if true, footprints that have changed in netlist will be changed
|
|
|
|
* @param aDeleteBadTracks if true, erroneous tracks will be deleted
|
|
|
|
* @param aDeleteExtraFootprints if true, remove unlocked footprints that are not in netlist
|
2013-04-25 16:29:35 +00:00
|
|
|
* @param aSelectByTimestamp if true, use timestamp instead of reference to identify
|
|
|
|
* footprints from components (use after reannotation of the
|
|
|
|
* schematic)
|
2013-08-24 08:08:55 +00:00
|
|
|
* @param aDeleteSinglePadNets if true, remove nets counting only one pad
|
|
|
|
* and set net code to 0 for these pads
|
2013-04-25 16:29:35 +00:00
|
|
|
* @param aIsDryRun performs a dry run without making any changes if true.
|
|
|
|
*/
|
|
|
|
void ReadPcbNetlist( const wxString& aNetlistFileName,
|
|
|
|
const wxString& aCmpFileName,
|
|
|
|
REPORTER* aReporter,
|
2010-04-16 16:28:35 +00:00
|
|
|
bool aChangeFootprint,
|
|
|
|
bool aDeleteBadTracks,
|
|
|
|
bool aDeleteExtraFootprints,
|
2013-04-25 16:29:35 +00:00
|
|
|
bool aSelectByTimestamp,
|
2013-08-24 08:08:55 +00:00
|
|
|
bool aDeleteSinglePadNets,
|
2013-04-25 16:29:35 +00:00
|
|
|
bool aIsDryRun );
|
2010-04-16 16:28:35 +00:00
|
|
|
|
2010-11-12 15:17:10 +00:00
|
|
|
/**
|
|
|
|
* Function RemoveMisConnectedTracks
|
2010-04-16 16:28:35 +00:00
|
|
|
* finds all track segments which are mis-connected (to more than one net).
|
2012-01-26 09:37:36 +00:00
|
|
|
* When such a bad segment is found, it is flagged to be removed.
|
|
|
|
* All tracks having at least one flagged segment are removed.
|
2010-04-16 16:28:35 +00:00
|
|
|
* @return true if any change is made
|
|
|
|
*/
|
2012-01-26 09:37:36 +00:00
|
|
|
bool RemoveMisConnectedTracks();
|
2010-04-16 16:28:35 +00:00
|
|
|
|
|
|
|
|
2008-01-01 11:58:14 +00:00
|
|
|
// Autoplacement:
|
2013-11-27 13:20:42 +00:00
|
|
|
void OnPlaceOrRouteFootprints( wxCommandEvent& event );
|
2009-01-15 08:12:03 +00:00
|
|
|
|
2015-12-21 15:39:36 +00:00
|
|
|
#if defined( KICAD_SCRIPTING_WXPYTHON )
|
|
|
|
|
2012-08-10 21:53:50 +00:00
|
|
|
/**
|
|
|
|
* Function ScriptingConsoleEnableDisable
|
|
|
|
* enables or disabled the scripting console
|
|
|
|
*/
|
2014-06-17 18:31:27 +00:00
|
|
|
void ScriptingConsoleEnableDisable( wxCommandEvent& aEvent );
|
|
|
|
|
|
|
|
void OnUpdateScriptingConsoleState( wxUpdateUIEvent& aEvent );
|
2012-08-10 21:53:50 +00:00
|
|
|
|
2015-12-21 15:39:36 +00:00
|
|
|
#endif
|
|
|
|
|
2011-12-16 13:32:23 +00:00
|
|
|
void OnSelectAutoPlaceMode( wxCommandEvent& aEvent );
|
|
|
|
|
2010-11-12 15:17:10 +00:00
|
|
|
/**
|
|
|
|
* Function OnOrientFootprints
|
2009-11-23 20:18:47 +00:00
|
|
|
* install the dialog box for the common Orient Footprints
|
2008-07-12 07:25:35 +00:00
|
|
|
*/
|
2011-09-15 17:58:35 +00:00
|
|
|
void OnOrientFootprints( wxCommandEvent& event );
|
2009-01-15 08:12:03 +00:00
|
|
|
|
2010-11-12 15:17:10 +00:00
|
|
|
/**
|
|
|
|
* Function ReOrientModules
|
2008-07-12 07:25:35 +00:00
|
|
|
* Set the orientation of footprints
|
|
|
|
* @param ModuleMask = mask (wildcard allowed) selection
|
|
|
|
* @param Orient = new orientation
|
|
|
|
* @param include_fixe = true to orient locked footprints
|
2010-11-26 17:47:35 +00:00
|
|
|
* @return true if some footprints modified, false if no change
|
2008-07-12 07:25:35 +00:00
|
|
|
*/
|
2013-05-05 07:17:48 +00:00
|
|
|
bool ReOrientModules( const wxString& ModuleMask, double Orient, bool include_fixe );
|
2011-09-15 17:58:35 +00:00
|
|
|
void LockModule( MODULE* aModule, bool aLocked );
|
2013-11-27 13:20:42 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Function SpreadFootprints
|
|
|
|
* Footprints (after loaded by reading a netlist for instance) are moved
|
|
|
|
* to be in a small free area (outside the current board) without overlapping.
|
2016-01-10 21:24:13 +00:00
|
|
|
* @param aFootprints: a list of footprints to be spread out.
|
|
|
|
* @param aMoveFootprintsOutsideBoardOnly: true to move only
|
|
|
|
* footprints outside the board outlines
|
2016-07-11 07:48:51 +00:00
|
|
|
* (they are outside if the position of a footprint anchor is outside
|
|
|
|
* the board outlines bounding box). It imply the board outlines exist
|
2016-01-10 21:24:13 +00:00
|
|
|
* @param aCheckForBoardEdges: true to try to place footprints outside of
|
2016-07-11 07:48:51 +00:00
|
|
|
* board edges, if aSpreadAreaPosition is incorrectly chosen.
|
|
|
|
* @param aSpreadAreaPosition the position of the upper left corner of the
|
|
|
|
* area used to spread footprints
|
2016-10-25 13:34:59 +00:00
|
|
|
* @param aPrepareUndoCommand = true (defualt) to commit a undo command for the
|
|
|
|
* spread footprints, false to do just the spread command
|
|
|
|
* (no undo specific to this move command)
|
2016-01-10 21:24:13 +00:00
|
|
|
*/
|
|
|
|
void SpreadFootprints( std::vector<MODULE*>* aFootprints,
|
|
|
|
bool aMoveFootprintsOutsideBoardOnly,
|
2016-07-11 07:48:51 +00:00
|
|
|
bool aCheckForBoardEdges,
|
2016-10-25 13:34:59 +00:00
|
|
|
wxPoint aSpreadAreaPosition,
|
|
|
|
bool aPrepareUndoCommand = true );
|
2011-11-10 15:55:05 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Function AutoPlaceModule
|
|
|
|
* automatically places footprints within the confines of the PCB edges.
|
|
|
|
* The components with the FIXED status are not moved. If the menu is
|
|
|
|
* calling the placement of 1 module, it will be replaced.
|
|
|
|
*/
|
2011-09-15 17:58:35 +00:00
|
|
|
void AutoPlaceModule( MODULE* Module, int place_mode, wxDC* DC );
|
2011-09-20 13:57:40 +00:00
|
|
|
|
2008-01-01 11:58:14 +00:00
|
|
|
// Autorouting:
|
2011-09-15 17:58:35 +00:00
|
|
|
int Solve( wxDC* DC, int two_sides );
|
|
|
|
void Reset_Noroutable( wxDC* DC );
|
|
|
|
void Autoroute( wxDC* DC, int mode );
|
|
|
|
void ReadAutoroutedTracks( wxDC* DC );
|
|
|
|
void GlobalRoute( wxDC* DC );
|
2008-01-01 11:58:14 +00:00
|
|
|
|
2011-09-14 20:04:58 +00:00
|
|
|
/**
|
|
|
|
* Function Show_1_Ratsnest
|
|
|
|
* draw ratsnest.
|
|
|
|
*
|
|
|
|
* The net edge pad with mouse or module locates the mouse.
|
|
|
|
* Delete the ratsnest if no module or pad is selected.
|
|
|
|
*/
|
2011-09-15 17:58:35 +00:00
|
|
|
void Show_1_Ratsnest( EDA_ITEM* item, wxDC* DC );
|
2011-09-14 20:04:58 +00:00
|
|
|
|
2013-03-08 07:29:30 +00:00
|
|
|
/**
|
|
|
|
* Function Clean_Pcb
|
|
|
|
* Clean up the board (remove redundant vias, not connected tracks
|
|
|
|
* and merges collinear track segments)
|
|
|
|
* Install the cleanup dialog frame to know what should be cleaned
|
|
|
|
* and run the cleanup function
|
|
|
|
*/
|
|
|
|
void Clean_Pcb();
|
2008-01-01 11:58:14 +00:00
|
|
|
|
2012-05-28 20:01:51 +00:00
|
|
|
void InstallFindFrame();
|
2008-01-01 11:58:14 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Function SendMessageToEESCHEMA
|
|
|
|
* sends a message to the schematic editor so that it may move its cursor
|
|
|
|
* to a part with the same reference as the objectToSync
|
2011-09-30 18:15:37 +00:00
|
|
|
* @param objectToSync The object whose reference is used to synchronize Eeschema.
|
2008-01-01 11:58:14 +00:00
|
|
|
*/
|
2011-09-15 17:58:35 +00:00
|
|
|
void SendMessageToEESCHEMA( BOARD_ITEM* objectToSync );
|
2008-01-01 11:58:14 +00:00
|
|
|
|
2011-11-10 15:55:05 +00:00
|
|
|
/**
|
|
|
|
* Function Edit_Gap
|
|
|
|
* edits the GAP module if it has changed the position and/or size of the pads that
|
|
|
|
* form the gap get a new value.
|
|
|
|
*/
|
2011-09-15 17:58:35 +00:00
|
|
|
void Edit_Gap( wxDC* DC, MODULE* Module );
|
2011-11-10 15:55:05 +00:00
|
|
|
|
|
|
|
/**
|
2015-01-28 10:00:48 +00:00
|
|
|
* Function CreateMuWaveBaseFootprint
|
|
|
|
* create a basic footprint for micro wave applications.
|
|
|
|
* @param aValue = the text value
|
|
|
|
* @param aTextSize = the size of ref and value texts ( <= 0 to use board default values )
|
|
|
|
* @param aPadCount = number of pads
|
|
|
|
* Pads settings are:
|
2015-08-23 19:40:33 +00:00
|
|
|
* PAD_ATTRIB_SMD, rectangular, H size = V size = current track width.
|
2011-11-10 15:55:05 +00:00
|
|
|
*/
|
2015-01-28 10:00:48 +00:00
|
|
|
MODULE* CreateMuWaveBaseFootprint( const wxString& aValue, int aTextSize, int aPadCount );
|
2011-11-10 15:55:05 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Create_MuWaveComponent
|
|
|
|
* creates a module "GAP" or "STUB" used in micro wave designs.
|
|
|
|
* This module has 2 pads:
|
2015-08-23 19:40:33 +00:00
|
|
|
* PAD_ATTRIB_SMD, rectangular, H size = V size = current track width.
|
2011-11-10 15:55:05 +00:00
|
|
|
* the "gap" is isolation created between this 2 pads
|
|
|
|
*/
|
2011-09-15 17:58:35 +00:00
|
|
|
MODULE* Create_MuWaveComponent( int shape_type );
|
2011-11-10 15:55:05 +00:00
|
|
|
|
2011-09-15 17:58:35 +00:00
|
|
|
MODULE* Create_MuWavePolygonShape();
|
2011-11-10 15:55:05 +00:00
|
|
|
|
2011-09-15 17:58:35 +00:00
|
|
|
void Begin_Self( wxDC* DC );
|
2011-11-10 15:55:05 +00:00
|
|
|
|
2016-09-24 18:53:15 +00:00
|
|
|
void ShowChangedLanguage() override;
|
2010-04-16 16:28:35 +00:00
|
|
|
|
2011-08-26 17:01:17 +00:00
|
|
|
/**
|
|
|
|
* Function UpdateTitle
|
|
|
|
* sets the main window title bar text.
|
|
|
|
* <p>
|
|
|
|
* If file name defined by PCB_SCREEN::m_FileName is not set, the title is set to the
|
|
|
|
* application name appended with no file. Otherwise, the title is set to the full path
|
|
|
|
* and file name and read only is appended to the title if the user does not have write
|
|
|
|
* access to the file.
|
2011-09-15 17:58:35 +00:00
|
|
|
* </p>
|
2011-08-26 17:01:17 +00:00
|
|
|
*/
|
|
|
|
void UpdateTitle();
|
|
|
|
|
2008-01-01 11:58:14 +00:00
|
|
|
DECLARE_EVENT_TABLE()
|
|
|
|
};
|
|
|
|
|
2012-10-15 22:30:01 +00:00
|
|
|
#endif // WXPCB_STRUCT_H_
|