2011-10-19 20:32:21 +00:00
|
|
|
/*
|
|
|
|
* This program source code file is part of KiCad, a free EDA CAD application.
|
|
|
|
*
|
2015-02-20 08:17:54 +00:00
|
|
|
* Copyright (C) 2015 Jean-Pierre Charras, jp.charras wanadoo.fr
|
2017-10-22 00:48:25 +00:00
|
|
|
* Copyright (C) 2008 Wayne Stambaugh <stambaughw@gmail.com>
|
2020-04-16 16:43:50 +00:00
|
|
|
* Copyright (C) 2004-2020 KiCad Developers, see AUTHORS.txt for contributors.
|
2011-10-19 20:32:21 +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
|
|
|
|
*/
|
|
|
|
|
2018-01-30 10:49:51 +00:00
|
|
|
#ifndef SCH_EDIT_FRAME_H
|
|
|
|
#define SCH_EDIT_FRAME_H
|
2008-04-14 19:22:48 +00:00
|
|
|
|
2019-06-25 23:39:58 +00:00
|
|
|
#include <stddef.h>
|
|
|
|
#include <vector>
|
|
|
|
#include <wx/cmndata.h>
|
|
|
|
#include <wx/event.h>
|
|
|
|
#include <wx/gdicmn.h>
|
|
|
|
#include <wx/string.h>
|
|
|
|
#include <wx/utils.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>
|
2019-06-25 23:39:58 +00:00
|
|
|
#include <core/typeinfo.h>
|
|
|
|
#include <eda_base_frame.h>
|
2019-03-11 21:32:05 +00:00
|
|
|
#include <erc_settings.h>
|
2020-05-20 03:34:55 +00:00
|
|
|
#include <eeschema_settings.h>
|
2019-06-25 23:39:58 +00:00
|
|
|
#include <math/box2.h>
|
|
|
|
#include <sch_base_frame.h>
|
|
|
|
#include <sch_text.h> // enum PINSHEETLABEL_SHAPE
|
|
|
|
#include <template_fieldnames.h>
|
|
|
|
#include <undo_redo_container.h>
|
|
|
|
|
|
|
|
class STATUS_TEXT_POPUP;
|
2009-02-04 15:25:03 +00:00
|
|
|
|
2008-04-14 19:22:48 +00:00
|
|
|
class SCH_ITEM;
|
2010-12-08 20:12:46 +00:00
|
|
|
class EDA_ITEM;
|
2019-06-25 23:39:58 +00:00
|
|
|
class SCH_LINE;
|
2008-09-17 17:26:25 +00:00
|
|
|
class SCH_TEXT;
|
2011-08-31 14:59:20 +00:00
|
|
|
class SCH_BITMAP;
|
2009-11-04 20:46:53 +00:00
|
|
|
class SCH_SHEET;
|
2009-12-02 21:44:03 +00:00
|
|
|
class SCH_SHEET_PATH;
|
2009-11-04 20:46:53 +00:00
|
|
|
class SCH_SHEET_PIN;
|
2008-09-17 17:26:25 +00:00
|
|
|
class SCH_COMPONENT;
|
2009-12-02 21:44:03 +00:00
|
|
|
class SCH_FIELD;
|
|
|
|
class SCH_JUNCTION;
|
2020-05-13 02:00:37 +00:00
|
|
|
class SCHEMATIC;
|
2010-03-16 18:22:59 +00:00
|
|
|
class DIALOG_SCH_FIND;
|
|
|
|
class wxFindReplaceData;
|
2017-10-22 00:48:25 +00:00
|
|
|
class RESCUER;
|
2019-10-24 17:07:01 +00:00
|
|
|
class HIERARCHY_NAVIG_DLG;
|
2009-07-26 17:16:42 +00:00
|
|
|
|
2020-04-16 16:43:50 +00:00
|
|
|
// @todo Move this to transform alone with all of the transform manipulation code.
|
* 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
|
|
|
/// enum used in RotationMiroir()
|
2011-10-28 20:30:50 +00:00
|
|
|
enum COMPONENT_ORIENTATION_T {
|
2010-07-14 13:24:36 +00:00
|
|
|
CMP_NORMAL, // Normal orientation, no rotation or mirror
|
|
|
|
CMP_ROTATE_CLOCKWISE, // Rotate -90
|
|
|
|
CMP_ROTATE_COUNTERCLOCKWISE, // Rotate +90
|
|
|
|
CMP_ORIENT_0, // No rotation and no mirror id CMP_NORMAL
|
|
|
|
CMP_ORIENT_90, // Rotate 90, no mirror
|
|
|
|
CMP_ORIENT_180, // Rotate 180, no mirror
|
|
|
|
CMP_ORIENT_270, // Rotate -90, no mirror
|
|
|
|
CMP_MIRROR_X = 0x100, // Mirror around X axis
|
|
|
|
CMP_MIRROR_Y = 0x200 // Mirror around Y axis
|
2008-04-14 19:22:48 +00:00
|
|
|
};
|
|
|
|
|
2010-06-17 16:30:10 +00:00
|
|
|
|
2011-05-20 19:21:09 +00:00
|
|
|
/** Schematic annotation order options. */
|
|
|
|
enum ANNOTATE_ORDER_T {
|
|
|
|
SORT_BY_X_POSITION, ///< Annotate by X position from left to right.
|
|
|
|
SORT_BY_Y_POSITION, ///< Annotate by Y position from top to bottom.
|
|
|
|
UNSORTED, ///< Annotate by position of component in the schematic sheet
|
|
|
|
///< object list.
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/** Schematic annotation type options. */
|
|
|
|
enum ANNOTATE_OPTION_T {
|
|
|
|
INCREMENTAL_BY_REF, ///< Annotate incrementally using the first free reference number.
|
|
|
|
SHEET_NUMBER_X_100, ///< Annotate using the first free reference number starting at
|
|
|
|
///< the sheet number * 100.
|
|
|
|
SHEET_NUMBER_X_1000, ///< Annotate using the first free reference number starting at
|
|
|
|
///< the sheet number * 1000.
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2011-11-17 01:06:08 +00:00
|
|
|
/// Schematic search type used by the socket link with Pcbnew
|
|
|
|
enum SCH_SEARCH_T {
|
2019-07-16 19:15:07 +00:00
|
|
|
HIGHLIGHT_PIN,
|
2019-07-17 11:43:24 +00:00
|
|
|
HIGHLIGHT_COMPONENT
|
2011-11-17 01:06:08 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2019-11-10 23:24:27 +00:00
|
|
|
enum SCH_CLEANUP_FLAGS {
|
|
|
|
NO_CLEANUP,
|
|
|
|
LOCAL_CLEANUP,
|
|
|
|
GLOBAL_CLEANUP
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2009-09-22 12:27:57 +00:00
|
|
|
/**
|
2011-09-30 18:15:37 +00:00
|
|
|
* Schematic editor (Eeschema) main window.
|
2009-09-22 12:27:57 +00:00
|
|
|
*/
|
2012-01-09 17:24:01 +00:00
|
|
|
class SCH_EDIT_FRAME : public SCH_BASE_FRAME
|
2008-04-14 19:22:48 +00:00
|
|
|
{
|
2019-11-24 01:24:32 +00:00
|
|
|
// The schematic editor control class should be able to access some internal
|
|
|
|
// functions of the editor frame.
|
|
|
|
friend class SCH_EDITOR_CONTROL;
|
|
|
|
|
2008-04-14 19:22:48 +00:00
|
|
|
private:
|
2020-05-13 02:00:37 +00:00
|
|
|
SCHEMATIC* m_schematic; ///< The currently loaded schematic
|
2020-05-24 14:46:05 +00:00
|
|
|
const SCH_CONNECTION* m_highlightedConn; ///< The highlighted net or bus, or nullptr
|
2014-09-07 19:01:26 +00:00
|
|
|
|
2013-06-07 20:56:55 +00:00
|
|
|
wxPageSetupDialogData m_pageSetupData;
|
2013-08-05 21:02:41 +00:00
|
|
|
SCH_ITEM* m_item_to_repeat; ///< Last item to insert by the repeat command.
|
2013-06-07 20:56:55 +00:00
|
|
|
wxString m_netListerCommand; ///< Command line to call a custom net list
|
|
|
|
///< generator.
|
2016-03-31 06:28:16 +00:00
|
|
|
int m_exec_flags; ///< Flags of the wxExecute() function
|
|
|
|
///< to call a custom net list generator.
|
2013-06-07 20:56:55 +00:00
|
|
|
|
2019-05-19 21:04:04 +00:00
|
|
|
DIALOG_SCH_FIND* m_findReplaceDialog;
|
2011-12-01 16:49:28 +00:00
|
|
|
|
2020-01-12 18:40:50 +00:00
|
|
|
static PINSHEETLABEL_SHAPE m_lastSheetPinType; ///< Last sheet pin type.
|
2011-03-30 19:26:05 +00:00
|
|
|
|
2020-08-31 14:11:54 +00:00
|
|
|
std::vector<SCH_GLOBALLABEL*> m_labelTable;
|
|
|
|
|
2011-10-15 13:25:57 +00:00
|
|
|
protected:
|
|
|
|
/**
|
2017-11-17 17:00:04 +00:00
|
|
|
* Save the schematic files that have been modified and not yet saved.
|
2011-10-15 13:25:57 +00:00
|
|
|
*
|
|
|
|
* @return true if the auto save was successful otherwise false.
|
|
|
|
*/
|
2019-07-02 20:09:23 +00:00
|
|
|
bool doAutoSave() override;
|
2011-10-15 13:25:57 +00:00
|
|
|
|
|
|
|
/**
|
2017-11-17 17:00:04 +00:00
|
|
|
* Returns true if the schematic has been modified.
|
2011-10-15 13:25:57 +00:00
|
|
|
*/
|
2019-07-02 20:09:23 +00:00
|
|
|
bool isAutoSaveRequired() const override;
|
2011-10-15 13:25:57 +00:00
|
|
|
|
2015-06-07 18:18:45 +00:00
|
|
|
/**
|
2017-11-17 17:00:04 +00:00
|
|
|
* Send the kicad netlist over to CVPCB.
|
2015-06-07 18:18:45 +00:00
|
|
|
*/
|
2019-03-17 19:15:08 +00:00
|
|
|
void sendNetlistToCvpcb();
|
2015-06-07 18:18:45 +00:00
|
|
|
|
2020-08-20 14:33:12 +00:00
|
|
|
void onSize( wxSizeEvent& aEvent );
|
|
|
|
|
2008-04-14 19:22:48 +00:00
|
|
|
public:
|
* 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
|
|
|
SCH_EDIT_FRAME( KIWAY* aKiway, wxWindow* aParent );
|
2019-07-02 20:09:23 +00:00
|
|
|
~SCH_EDIT_FRAME() override;
|
2008-04-14 19:22:48 +00:00
|
|
|
|
2016-09-25 17:06:49 +00:00
|
|
|
SCH_SCREEN* GetScreen() const override;
|
2012-01-09 17:24:01 +00:00
|
|
|
|
2020-08-06 23:03:58 +00:00
|
|
|
SELECTION& GetCurrentSelection() override;
|
|
|
|
|
2020-05-13 02:00:37 +00:00
|
|
|
SCHEMATIC& Schematic() const;
|
|
|
|
|
2020-04-18 07:57:04 +00:00
|
|
|
/**
|
|
|
|
* Allow edit frame to show/hide hidden pins.
|
|
|
|
*/
|
|
|
|
bool GetShowAllPins() const override;
|
|
|
|
|
2011-08-18 19:25:12 +00:00
|
|
|
/**
|
2017-11-17 17:00:04 +00:00
|
|
|
* Save changes to the project settings to the project (.pro) file.
|
2011-08-18 19:25:12 +00:00
|
|
|
*/
|
2020-02-28 00:05:40 +00:00
|
|
|
void SaveProjectSettings() override;
|
2011-08-18 19:25:12 +00:00
|
|
|
|
|
|
|
/**
|
2017-11-17 17:00:04 +00:00
|
|
|
* Loads the KiCad project file (*.pro) settings specific to Eeschema.
|
2011-08-18 19:25:12 +00:00
|
|
|
*
|
|
|
|
* @return True if the project file was loaded correctly.
|
|
|
|
*/
|
2020-06-08 02:19:46 +00:00
|
|
|
bool LoadProjectSettings();
|
2008-04-14 19:22:48 +00:00
|
|
|
|
2020-05-24 14:54:26 +00:00
|
|
|
void ShowSchematicSetupDialog( const wxString& aInitialPage = wxEmptyString );
|
2019-03-11 21:32:05 +00:00
|
|
|
|
2020-01-13 01:44:19 +00:00
|
|
|
void LoadSettings( APP_SETTINGS_BASE* aCfg ) override;
|
|
|
|
void SaveSettings( APP_SETTINGS_BASE* aCfg ) override;
|
2009-04-05 20:49:15 +00:00
|
|
|
|
2011-10-15 13:25:57 +00:00
|
|
|
void CreateScreens();
|
2016-09-24 18:53:15 +00:00
|
|
|
void ReCreateHToolbar() override;
|
|
|
|
void ReCreateVToolbar() override;
|
2019-07-20 15:52:30 +00:00
|
|
|
void ReCreateOptToolbar() override;
|
2016-09-24 18:53:15 +00:00
|
|
|
void ReCreateMenuBar() override;
|
2015-05-05 18:39:42 +00:00
|
|
|
|
2020-08-06 23:03:58 +00:00
|
|
|
void setupUIConditions() override;
|
|
|
|
|
2019-12-19 15:34:01 +00:00
|
|
|
/**
|
|
|
|
* Get if the current schematic has been modified but not saved.
|
|
|
|
*
|
|
|
|
* @return true if the any changes have not been saved
|
|
|
|
*/
|
|
|
|
bool IsContentModified() override;
|
|
|
|
|
2010-11-12 15:17:10 +00:00
|
|
|
/**
|
2017-11-17 17:00:04 +00:00
|
|
|
* Must be called after a schematic change in order to set the "modify" flag of the
|
2019-05-08 18:56:03 +00:00
|
|
|
* current screen and update the date in frame reference.
|
2010-02-18 20:07:29 +00:00
|
|
|
*/
|
2019-05-08 18:56:03 +00:00
|
|
|
void OnModify() override;
|
2008-04-17 16:25:29 +00:00
|
|
|
|
2019-07-02 20:09:23 +00:00
|
|
|
/**
|
|
|
|
* Return a human-readable description of the current screen.
|
|
|
|
*/
|
2019-06-01 15:28:39 +00:00
|
|
|
wxString GetScreenDesc() const override;
|
2008-04-14 19:22:48 +00:00
|
|
|
|
2014-01-08 14:18:51 +00:00
|
|
|
/**
|
2020-06-09 16:50:05 +00:00
|
|
|
* Execute a remote command sent by Pcbnew via a socket connection.
|
|
|
|
* <p>
|
|
|
|
* When user selects a module or pin in Pcbnew, Eeschema shows that same
|
|
|
|
* component or pin and moves cursor on the item. The socket port used
|
|
|
|
* is #KICAD_SCH_PORT_SERVICE_NUMBER which defaults to 4243.
|
|
|
|
*
|
|
|
|
* Valid commands are:
|
|
|
|
* \li \c \$PART: \c "reference" Put cursor on component.
|
|
|
|
* \li \c \$PART: \c "reference" \c \$REF: \c "ref" Put cursor on component reference.
|
|
|
|
* \li \c \$PART: \c "reference" \c \$VAL: \c "value" Put cursor on component value.
|
|
|
|
* \li \c \$PART: \c "reference" \c \$PAD: \c "pin name" Put cursor on the component pin.
|
|
|
|
* \li \c \$NET: \c "netname" Highlight a specified net
|
|
|
|
* \li \c \$CLEAR: \c "HIGHLIGHTED" Clear components highlight
|
|
|
|
* <p>
|
|
|
|
* They are a keyword followed by a quoted string.
|
|
|
|
* @param cmdline = received command from Pcbnew
|
2014-01-08 14:18:51 +00:00
|
|
|
*/
|
2019-06-01 15:28:39 +00:00
|
|
|
void ExecuteRemoteCommand( const char* cmdline ) override;
|
2008-04-14 19:22:48 +00:00
|
|
|
|
2016-09-25 17:06:49 +00:00
|
|
|
void KiwayMailIn( KIWAY_EXPRESS& aEvent ) override;
|
2014-04-21 06:51:33 +00:00
|
|
|
|
2019-04-15 14:34:58 +00:00
|
|
|
/**
|
2019-04-28 16:36:31 +00:00
|
|
|
* Add an item to the schematic and adds the changes to the undo/redo container.
|
|
|
|
* @param aUndoAppend True if the action should be appended to the current undo record.
|
2019-04-15 14:34:58 +00:00
|
|
|
*/
|
2020-07-13 11:21:40 +00:00
|
|
|
void AddItemToScreenAndUndoList( SCH_SCREEN* aScreen, SCH_ITEM* aItem, bool aUndoAppend );
|
2019-04-15 14:34:58 +00:00
|
|
|
|
2019-05-15 22:49:48 +00:00
|
|
|
/**
|
|
|
|
* Run the Find or Find & Replace dialog.
|
|
|
|
*/
|
2019-05-19 21:04:04 +00:00
|
|
|
void ShowFindReplaceDialog( bool aReplace );
|
|
|
|
|
2019-10-24 17:07:01 +00:00
|
|
|
/**
|
|
|
|
* Run the Hierarchy Navigator dialog.
|
2020-01-08 14:01:22 +00:00
|
|
|
* @param aForceUpdate: When true, creates a new dialog. And if a dialog
|
|
|
|
* already exist, it destroys it first.
|
2019-10-24 17:07:01 +00:00
|
|
|
*/
|
|
|
|
void UpdateHierarchyNavigator( bool aForceUpdate = false );
|
|
|
|
|
2020-01-08 14:01:22 +00:00
|
|
|
/**
|
2020-08-31 15:06:23 +00:00
|
|
|
* @return a reference to the Hierarchy Navigator dialog if exists, or nullptr.
|
2020-01-08 14:01:22 +00:00
|
|
|
*/
|
|
|
|
HIERARCHY_NAVIG_DLG* FindHierarchyNavigator();
|
|
|
|
|
2020-05-20 01:31:47 +00:00
|
|
|
void ShowFindReplaceStatus( const wxString& aMsg, int aStatusTime );
|
2019-05-19 21:04:04 +00:00
|
|
|
void ClearFindReplaceStatus();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get the find criteria (as set by the dialog).
|
|
|
|
*/
|
|
|
|
wxFindReplaceData* GetFindReplaceData();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Notification that the Find dialog has closed.
|
|
|
|
*/
|
|
|
|
void OnFindDialogClose();
|
2019-05-15 22:49:48 +00:00
|
|
|
|
2017-10-26 15:25:47 +00:00
|
|
|
/**
|
2019-05-11 10:06:28 +00:00
|
|
|
* Breaks a single segment into two at the specified point.
|
|
|
|
*
|
|
|
|
* NOTE: always appends to the existing undo state.
|
2017-10-26 15:25:47 +00:00
|
|
|
*
|
|
|
|
* @param aSegment Line segment to break
|
|
|
|
* @param aPoint Point at which to break the segment
|
2017-12-01 22:53:23 +00:00
|
|
|
* @param aNewSegment Pointer to the newly created segment (if given and created)
|
2019-03-11 21:32:05 +00:00
|
|
|
* @param aScreen is the screen to examine, or nullptr to examine the current screen
|
2017-10-26 15:25:47 +00:00
|
|
|
* @return True if any wires or buses were broken.
|
|
|
|
*/
|
2019-03-11 21:32:05 +00:00
|
|
|
bool BreakSegment( SCH_LINE* aSegment, const wxPoint& aPoint,
|
2019-05-11 10:06:28 +00:00
|
|
|
SCH_LINE** aNewSegment = NULL, SCH_SCREEN* aScreen = nullptr );
|
2017-10-26 15:25:47 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Checks every wire and bus for a intersection at \a aPoint and break into two segments
|
|
|
|
* at \a aPoint if an intersection is found.
|
|
|
|
*
|
2019-05-11 10:06:28 +00:00
|
|
|
* NOTE: always appends to the existing undo state.
|
|
|
|
*
|
2017-10-26 15:25:47 +00:00
|
|
|
* @param aPoint Test this point for an intersection.
|
2019-03-11 21:32:05 +00:00
|
|
|
* @param aScreen is the screen to examine, or nullptr to examine the current screen
|
2017-10-26 15:25:47 +00:00
|
|
|
* @return True if any wires or buses were broken.
|
|
|
|
*/
|
2019-05-11 10:06:28 +00:00
|
|
|
bool BreakSegments( const wxPoint& aPoint, SCH_SCREEN* aScreen = nullptr );
|
2017-10-26 15:25:47 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Tests all junctions and bus entries in the schematic for intersections with wires and
|
|
|
|
* buses and breaks any intersections into multiple segments.
|
|
|
|
*
|
2019-05-11 10:06:28 +00:00
|
|
|
* NOTE: always appends to the existing undo state.
|
|
|
|
*
|
2019-03-11 21:32:05 +00:00
|
|
|
* @param aScreen is the screen to examine, or nullptr to examine the current screen
|
2017-10-26 15:25:47 +00:00
|
|
|
* @return True if any wires or buses were broken.
|
|
|
|
*/
|
2019-05-11 10:06:28 +00:00
|
|
|
bool BreakSegmentsOnJunctions( SCH_SCREEN* aScreen = nullptr );
|
2017-10-26 15:25:47 +00:00
|
|
|
|
2018-10-16 13:11:33 +00:00
|
|
|
/**
|
|
|
|
* Test all of the connectable objects in the schematic for unused connection points.
|
|
|
|
* @return True if any connection state changes were made.
|
|
|
|
*/
|
|
|
|
bool TestDanglingEnds();
|
|
|
|
|
2011-11-17 01:06:08 +00:00
|
|
|
/**
|
2017-11-17 17:00:04 +00:00
|
|
|
* Send a message to Pcbnew via a socket connection.
|
|
|
|
*
|
|
|
|
* Commands are:
|
|
|
|
* - $PART: reference put cursor on footprint anchor
|
|
|
|
* - $PIN: number $PART: reference put cursor on the footprint pad
|
|
|
|
* - $SHEET: time_stamp select all footprints of components is the schematic sheet path
|
|
|
|
*
|
2017-03-04 15:28:26 +00:00
|
|
|
* @param aObjectToSync = item to be located on board
|
|
|
|
* (footprint, pad, text or schematic sheet)
|
|
|
|
* @param aPart = component if objectToSync is a sub item of a symbol (like a pin)
|
2011-11-17 01:06:08 +00:00
|
|
|
*/
|
2017-03-04 15:28:26 +00:00
|
|
|
void SendMessageToPCBNEW( EDA_ITEM* aObjectToSync, SCH_COMPONENT* aPart );
|
2008-04-14 19:22:48 +00:00
|
|
|
|
2018-01-06 20:50:49 +00:00
|
|
|
/**
|
2019-04-14 00:44:05 +00:00
|
|
|
* Sends a net name to pcbnew for highlighting
|
2018-01-06 20:50:49 +00:00
|
|
|
*
|
|
|
|
* @param aNetName is the name of a net, or empty string to clear highlight
|
|
|
|
*/
|
|
|
|
void SendCrossProbeNetName( const wxString& aNetName );
|
|
|
|
|
2020-05-24 17:30:23 +00:00
|
|
|
/**
|
|
|
|
* Sends a connection (net or bus) to pcbnew for highlighting
|
|
|
|
* @param aConnection is the connection to highlight
|
|
|
|
*/
|
|
|
|
void SetCrossProbeConnection( const SCH_CONNECTION* aConnection );
|
|
|
|
|
2019-05-04 20:18:41 +00:00
|
|
|
/**
|
|
|
|
* Tells PcbNew to clear the existing highlighted net, if one exists
|
|
|
|
*/
|
|
|
|
void SendCrossProbeClearHighlight();
|
|
|
|
|
2020-05-24 14:46:05 +00:00
|
|
|
const SCH_CONNECTION* GetHighlightedConnection() const
|
|
|
|
{
|
|
|
|
return m_highlightedConn;
|
|
|
|
}
|
|
|
|
|
|
|
|
void SetHighlightedConnection( const SCH_CONNECTION* aConnection )
|
|
|
|
{
|
|
|
|
m_highlightedConn = aConnection;
|
|
|
|
}
|
2019-04-14 00:44:05 +00:00
|
|
|
|
2010-11-12 15:17:10 +00:00
|
|
|
/**
|
2020-05-23 17:14:05 +00:00
|
|
|
* Checks if we are ready to write a netlist file for the current schematic
|
2017-11-17 17:00:04 +00:00
|
|
|
*
|
|
|
|
* - Test for some issues (missing or duplicate references and sheet names)
|
|
|
|
*
|
2019-03-17 19:15:08 +00:00
|
|
|
* @param aSilent is true if annotation error dialog should be skipped
|
|
|
|
* @param aSilentAnnotate is true if components should be reannotated silently
|
2020-05-23 17:14:05 +00:00
|
|
|
* @returns true if all is well (i.e. you can call WriteNetListFile next)
|
2010-07-14 13:24:36 +00:00
|
|
|
*/
|
2020-05-23 17:14:05 +00:00
|
|
|
bool ReadyToNetlist( bool aSilent = false, bool aSilentAnnotate = false );
|
2010-07-14 13:24:36 +00:00
|
|
|
|
2010-11-12 15:17:10 +00:00
|
|
|
/**
|
2017-11-17 17:00:04 +00:00
|
|
|
* Create a netlist file.
|
|
|
|
*
|
2010-07-14 13:24:36 +00:00
|
|
|
* @param aFormat = netlist format (NET_TYPE_PCBNEW ...)
|
|
|
|
* @param aFullFileName = full netlist file name
|
2012-01-26 09:37:36 +00:00
|
|
|
* @param aNetlistOptions = netlist options using OR'ed bits.
|
|
|
|
* <p>
|
|
|
|
* For SPICE netlist only:
|
|
|
|
* if NET_USE_NETNAMES is set, use net names from labels in schematic
|
|
|
|
* else use net numbers (net codes)
|
2017-11-17 17:00:04 +00:00
|
|
|
* if NET_USE_X_PREFIX is set : change "U" and "IC" reference prefix to "X"
|
2012-01-26 09:37:36 +00:00
|
|
|
* </p>
|
2015-06-12 07:02:06 +00:00
|
|
|
* @param aReporter = a REPORTER to report error messages,
|
|
|
|
* mainly if a command line must be run (can be NULL
|
2010-07-14 13:24:36 +00:00
|
|
|
* @return true if success.
|
|
|
|
*/
|
2020-05-23 17:14:05 +00:00
|
|
|
bool WriteNetListFile( int aFormat,
|
2011-10-15 13:25:57 +00:00
|
|
|
const wxString& aFullFileName,
|
2015-06-12 07:02:06 +00:00
|
|
|
unsigned aNetlistOptions,
|
|
|
|
REPORTER* aReporter = NULL );
|
2008-11-24 06:53:43 +00:00
|
|
|
|
|
|
|
/**
|
2017-11-17 17:00:04 +00:00
|
|
|
* Clear the current component annotation.
|
|
|
|
*
|
2015-03-23 11:45:31 +00:00
|
|
|
* @param aCurrentSheetOnly Clear only the annotation for the current sheet if true.
|
|
|
|
* Otherwise clear the entire schematic annotation.
|
2009-04-10 14:53:24 +00:00
|
|
|
*/
|
2020-07-13 11:21:40 +00:00
|
|
|
void DeleteAnnotation( bool aCurrentSheetOnly, bool* appendUndo );
|
2008-04-14 19:22:48 +00:00
|
|
|
|
2011-01-01 17:28:21 +00:00
|
|
|
/**
|
2017-11-17 17:00:04 +00:00
|
|
|
* Annotate the components in the schematic that are not currently annotated.
|
2011-05-20 19:21:09 +00:00
|
|
|
*
|
|
|
|
* @param aAnnotateSchematic Annotate the entire schematic if true. Otherwise annotate
|
|
|
|
* the current sheet only.
|
|
|
|
* @param aSortOption Define the annotation order. See #ANNOTATE_ORDER_T.
|
|
|
|
* @param aAlgoOption Define the annotation style. See #ANNOTATE_OPTION_T.
|
2018-02-18 20:44:33 +00:00
|
|
|
* @param aStartNumber The start number for non-sheet-based annotation styles.
|
2011-05-20 19:21:09 +00:00
|
|
|
* @param aResetAnnotation Clear any previous annotation if true. Otherwise, keep the
|
|
|
|
* existing component annotation.
|
|
|
|
* @param aRepairTimestamps Test for and repair any duplicate time stamps if true.
|
|
|
|
* Otherwise, keep the existing time stamps. This option
|
|
|
|
* could change previous annotation because time stamps are
|
|
|
|
* used to handle annotation in complex hierarchies.
|
2015-03-23 11:45:31 +00:00
|
|
|
* @param aLockUnits When both aLockUnits and aResetAnnotation are true, all unit
|
|
|
|
* associations should be kept when reannotating. That is, if
|
|
|
|
* two components were R8A and R8B, they may become R3A and R3B,
|
|
|
|
* but not R3A and R3C or R3C and R4D.
|
|
|
|
* When aResetAnnotation is true but aLockUnits is false, the
|
|
|
|
* usual behavior of annotating each part individually is
|
|
|
|
* performed.
|
|
|
|
* When aResetAnnotation is false, this option has no effect.
|
2018-02-17 11:43:56 +00:00
|
|
|
* @param aReporter A sink for error messages. Use NULL_REPORTER if you don't need errors.
|
2011-05-20 19:21:09 +00:00
|
|
|
*
|
|
|
|
* When the sheet number is used in annotation, each sheet annotation starts from sheet
|
|
|
|
* number * 100. In other words the first sheet uses 100 to 199, the second sheet uses
|
|
|
|
* 200 to 299, and so on.
|
|
|
|
*/
|
|
|
|
void AnnotateComponents( bool aAnnotateSchematic, ANNOTATE_ORDER_T aSortOption,
|
2018-02-18 20:44:33 +00:00
|
|
|
ANNOTATE_OPTION_T aAlgoOption, int aStartNumber,
|
|
|
|
bool aResetAnnotation, bool aRepairTimestamps, bool aLockUnits,
|
|
|
|
REPORTER& aReporter );
|
2011-05-20 19:21:09 +00:00
|
|
|
|
|
|
|
/**
|
2017-11-17 17:00:04 +00:00
|
|
|
* Check for annotation errors.
|
2011-05-20 19:21:09 +00:00
|
|
|
*
|
|
|
|
* The following list of items are checked:
|
2017-11-17 17:00:04 +00:00
|
|
|
* - Components that are not annotated.
|
|
|
|
* - Duplicate component references.
|
|
|
|
* - Multiple part per package components where the part number is greater number of parts
|
|
|
|
* in the package.
|
|
|
|
* - Multiple part per package components where the reference designator is different
|
|
|
|
* between parts.
|
2011-05-20 19:21:09 +00:00
|
|
|
*
|
|
|
|
* @return Number of annotation errors found.
|
2018-02-17 11:43:56 +00:00
|
|
|
* @param aReporter A sink for error messages. Use NULL_REPORTER if you don't need errors.
|
2011-05-20 19:21:09 +00:00
|
|
|
* @param aOneSheetOnly Check the current sheet only if true. Otherwise check
|
|
|
|
* the entire schematic.
|
|
|
|
*/
|
2018-02-17 11:43:56 +00:00
|
|
|
int CheckAnnotate( REPORTER& aReporter, bool aOneSheetOnly );
|
2011-02-05 02:21:11 +00:00
|
|
|
|
2018-02-18 20:44:33 +00:00
|
|
|
/**
|
|
|
|
* Run a modal version of the Annotate dialog for a specific purpose.
|
|
|
|
* @param aMessage A user message indicating the purpose.
|
|
|
|
* @return the result of ShowModal()
|
|
|
|
*/
|
|
|
|
int ModalAnnotate( const wxString& aMessage );
|
|
|
|
|
2009-01-08 20:29:07 +00:00
|
|
|
// Functions used for hierarchy handling
|
2020-05-13 02:00:37 +00:00
|
|
|
SCH_SHEET_PATH& GetCurrentSheet() const;
|
2011-12-08 21:05:43 +00:00
|
|
|
|
|
|
|
void SetCurrentSheet( const SCH_SHEET_PATH& aSheet );
|
|
|
|
|
2018-10-17 11:14:09 +00:00
|
|
|
/**
|
|
|
|
* Rebuild the GAL and redraw the screen. Call when something went wrong.
|
|
|
|
*/
|
|
|
|
void HardRedraw() override;
|
|
|
|
|
2011-02-05 02:21:11 +00:00
|
|
|
/**
|
2017-11-17 17:00:04 +00:00
|
|
|
* Draw the current sheet on the display.
|
2011-02-05 02:21:11 +00:00
|
|
|
*/
|
2011-10-15 13:25:57 +00:00
|
|
|
void DisplayCurrentSheet();
|
2009-04-10 14:53:24 +00:00
|
|
|
|
2019-05-28 18:44:14 +00:00
|
|
|
/**
|
|
|
|
* Use the wxWidgets print code to draw an image of the current sheet onto
|
|
|
|
* the clipboard.
|
|
|
|
*/
|
2019-06-16 13:42:40 +00:00
|
|
|
void DrawCurrentSheetToClipboard();
|
2019-05-28 18:44:14 +00:00
|
|
|
|
2018-11-20 14:11:22 +00:00
|
|
|
/**
|
|
|
|
* Called when modifying the page settings.
|
|
|
|
* In derived classes it can be used to modify parameters like draw area size,
|
|
|
|
* and any other local parameter related to the page settings.
|
|
|
|
*/
|
|
|
|
void OnPageSettingsChange() override;
|
|
|
|
|
2010-11-12 15:17:10 +00:00
|
|
|
/**
|
2009-01-08 20:29:07 +00:00
|
|
|
* @return a filename that can be used in plot and print functions
|
2009-11-04 20:46:53 +00:00
|
|
|
* for the current screen and sheet path.
|
|
|
|
* This filename is unique and must be used instead of the screen filename
|
|
|
|
* (or screen filename) when one must creates file for each sheet in the
|
|
|
|
* hierarchy. because in complex hierarchies a sheet and a SCH_SCREEN is
|
2009-09-22 12:27:57 +00:00
|
|
|
* used more than once
|
2010-12-14 21:39:31 +00:00
|
|
|
* Name is <root sheet filename>-<sheet path> and has no extension.
|
|
|
|
* However if filename is too long name is <sheet filename>-<sheet number>
|
2009-01-08 20:29:07 +00:00
|
|
|
*/
|
2011-10-15 13:25:57 +00:00
|
|
|
wxString GetUniqueFilenameForCurrentSheet();
|
2008-04-14 19:22:48 +00:00
|
|
|
|
2008-11-24 06:53:43 +00:00
|
|
|
/**
|
2017-11-17 17:00:04 +00:00
|
|
|
* Set the m_ScreenNumber and m_NumberOfScreens members for screens.
|
|
|
|
*
|
|
|
|
* @note This must be called after deleting or adding a sheet and when entering a sheet.
|
2008-04-30 17:04:22 +00:00
|
|
|
*/
|
2011-10-15 13:25:57 +00:00
|
|
|
void SetSheetNumberAndCount();
|
2008-04-30 17:04:22 +00:00
|
|
|
|
2010-02-02 15:01:09 +00:00
|
|
|
wxPageSetupDialogData& GetPageSetupData() { return m_pageSetupData; }
|
|
|
|
|
2019-05-24 23:36:31 +00:00
|
|
|
void NewProject();
|
|
|
|
void LoadProject();
|
2008-04-14 19:22:48 +00:00
|
|
|
|
2019-05-24 23:36:31 +00:00
|
|
|
void Save_File( bool doSaveAs = false );
|
2011-08-18 19:25:12 +00:00
|
|
|
|
2018-08-01 23:06:12 +00:00
|
|
|
bool SaveProject();
|
2011-08-18 19:25:12 +00:00
|
|
|
|
2016-09-25 17:06:49 +00:00
|
|
|
bool OpenProjectFiles( const std::vector<wxString>& aFileSet, int aCtl = 0 ) override;
|
2011-08-18 19:25:12 +00:00
|
|
|
|
2020-05-16 23:08:01 +00:00
|
|
|
wxString GetCurrentFileName() const override;
|
|
|
|
|
2013-01-24 17:46:37 +00:00
|
|
|
/**
|
2019-07-29 19:59:31 +00:00
|
|
|
* Import a KiCad schematic into the current sheet.
|
2017-11-17 17:00:04 +00:00
|
|
|
*
|
2019-07-29 19:59:31 +00:00
|
|
|
* @return True if the schematic was imported properly.
|
2013-01-24 17:46:37 +00:00
|
|
|
*/
|
2017-11-17 17:00:04 +00:00
|
|
|
bool AppendSchematic();
|
2013-01-24 17:46:37 +00:00
|
|
|
|
2011-08-18 19:25:12 +00:00
|
|
|
/**
|
2020-04-26 20:53:29 +00:00
|
|
|
* Save \a aSheet to a schematic file.
|
2011-08-18 19:25:12 +00:00
|
|
|
*
|
2020-04-26 20:53:29 +00:00
|
|
|
* @param aSheet A pointer to the #SCH_SHEET object to save. A NULL pointer saves
|
|
|
|
* the current screen only.
|
2012-09-28 17:47:41 +00:00
|
|
|
* @param aSaveUnderNewName Controls how the file is to be saved;: using previous name
|
|
|
|
* or under a new name .
|
2011-08-18 19:25:12 +00:00
|
|
|
* @return True if the file has been saved.
|
|
|
|
*/
|
2020-04-26 20:53:29 +00:00
|
|
|
bool SaveEEFile( SCH_SHEET* aSheet,
|
2020-06-20 01:06:52 +00:00
|
|
|
bool aSaveUnderNewName = false );
|
2008-04-14 19:22:48 +00:00
|
|
|
|
2015-04-09 19:37:48 +00:00
|
|
|
|
2017-09-20 14:20:38 +00:00
|
|
|
/**
|
2017-11-17 17:00:04 +00:00
|
|
|
* Checks if any of the screens has unsaved changes and asks the user whether to save or
|
|
|
|
* drop them.
|
|
|
|
*
|
2019-07-02 20:09:23 +00:00
|
|
|
* @return True if user decided to save or drop changes, false if the operation should be
|
|
|
|
* canceled.
|
2017-09-20 14:20:38 +00:00
|
|
|
*/
|
|
|
|
bool AskToSaveChanges();
|
|
|
|
|
2020-07-13 11:21:40 +00:00
|
|
|
SCH_JUNCTION* AddJunction( SCH_SCREEN* aScreen, const wxPoint& aPos, bool aAppendToUndo,
|
2019-04-15 23:56:41 +00:00
|
|
|
bool aFinal = true );
|
|
|
|
|
2019-04-17 19:09:48 +00:00
|
|
|
/**
|
2019-07-02 20:09:23 +00:00
|
|
|
* Performs routine schematic cleaning including breaking wire and buses and deleting
|
|
|
|
* identical objects superimposed on top of each other.
|
2019-04-17 19:09:48 +00:00
|
|
|
*
|
2019-05-11 10:06:28 +00:00
|
|
|
* NOTE: always appends to the existing undo state.
|
|
|
|
*
|
2019-04-17 19:09:48 +00:00
|
|
|
* @param aScreen is the screen to examine, or nullptr to examine the current screen
|
|
|
|
* @return True if any schematic clean up was performed.
|
|
|
|
*/
|
2019-05-11 10:06:28 +00:00
|
|
|
bool SchematicCleanUp( SCH_SCREEN* aScreen = nullptr );
|
2019-04-17 19:09:48 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* If any single wire passes through _both points_, remove the portion between the two points,
|
|
|
|
* potentially splitting the wire into two.
|
|
|
|
*
|
2019-05-11 10:06:28 +00:00
|
|
|
* NOTE: always appends to the existing undo state.
|
|
|
|
*
|
2019-04-17 19:09:48 +00:00
|
|
|
* @param aStart The starting point for trimmming
|
|
|
|
* @param aEnd The ending point for trimming
|
|
|
|
* @return True if any wires were changed by this operation
|
|
|
|
*/
|
2019-05-11 10:06:28 +00:00
|
|
|
bool TrimWire( const wxPoint& aStart, const wxPoint& aEnd );
|
2019-04-17 19:09:48 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Collects a unique list of all possible connection points in the schematic.
|
|
|
|
*
|
2020-09-08 13:27:13 +00:00
|
|
|
* @return vector of connections
|
2019-04-17 19:09:48 +00:00
|
|
|
*/
|
2020-09-08 13:27:13 +00:00
|
|
|
std::vector<wxPoint> GetSchematicConnections();
|
2019-04-17 19:09:48 +00:00
|
|
|
|
2019-06-01 15:28:39 +00:00
|
|
|
void OnOpenPcbnew( wxCommandEvent& event );
|
|
|
|
void OnOpenCvpcb( wxCommandEvent& event );
|
|
|
|
void OnUpdatePCB( wxCommandEvent& event );
|
|
|
|
void OnAnnotate( wxCommandEvent& event );
|
|
|
|
|
2008-04-14 19:22:48 +00:00
|
|
|
private:
|
2019-05-04 11:23:04 +00:00
|
|
|
// Sets up the tool framework
|
|
|
|
void setupTools();
|
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
|
|
|
|
2019-05-26 22:22:03 +00:00
|
|
|
void OnExit( wxCommandEvent& event );
|
2011-11-17 01:06:08 +00:00
|
|
|
|
2011-10-15 13:25:57 +00:00
|
|
|
void OnLoadFile( wxCommandEvent& event );
|
2013-01-24 17:46:37 +00:00
|
|
|
void OnAppendProject( wxCommandEvent& event );
|
2017-09-20 14:20:38 +00:00
|
|
|
void OnImportProject( wxCommandEvent& event );
|
2017-12-24 17:57:57 +00:00
|
|
|
|
2020-02-25 15:46:56 +00:00
|
|
|
void OnClearFileHistory( wxCommandEvent& aEvent );
|
|
|
|
|
2020-08-24 02:01:14 +00:00
|
|
|
bool canCloseWindow( wxCloseEvent& aCloseEvent ) override;
|
|
|
|
void doCloseWindow() override;
|
|
|
|
|
2012-01-14 11:52:46 +00:00
|
|
|
/**
|
2017-11-17 17:00:04 +00:00
|
|
|
* Set the main window title bar text.
|
|
|
|
*
|
2012-01-14 11:52:46 +00:00
|
|
|
* If file name defined by SCH_SCREEN::m_FileName is not set, the title is set to the
|
|
|
|
* application name appended with no file.
|
2019-07-02 20:09:23 +00:00
|
|
|
* Otherwise, the title is set to the hierarchical sheet path and the full file name, and
|
|
|
|
* read only is appended to the title if the user does not have write access to the file.
|
2012-01-14 11:52:46 +00:00
|
|
|
*/
|
|
|
|
void UpdateTitle();
|
|
|
|
|
2019-07-29 19:59:31 +00:00
|
|
|
/**
|
|
|
|
* Verify that the symbol library links \a aSheet and all of it's child sheets have
|
|
|
|
* been remapped to the symbol library table.
|
|
|
|
*
|
|
|
|
* @param aSheet is the #SCH_SHEET object to test.
|
|
|
|
*
|
|
|
|
* @return true if \a aSheet and it's child sheets have not been remapped.
|
|
|
|
*/
|
|
|
|
bool checkForNoFullyDefinedLibIds( SCH_SHEET* aSheet );
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Load the given filename but sets the path to the current project path.
|
|
|
|
*
|
|
|
|
* @param full filepath of file to be imported.
|
|
|
|
* @param aFileType SCH_FILE_T value for file type
|
|
|
|
*/
|
|
|
|
bool importFile( const wxString& aFileName, int aFileType );
|
|
|
|
|
2020-05-13 02:00:37 +00:00
|
|
|
/**
|
|
|
|
* Fills a map of uuid -> reference from the currently loaded schematic
|
|
|
|
* @param aMap is a map to fill
|
|
|
|
*/
|
|
|
|
void mapExistingAnnotation( std::map<wxString, wxString>& aMap );
|
|
|
|
|
2020-03-06 20:02:58 +00:00
|
|
|
public:
|
|
|
|
/**
|
|
|
|
* Verify that \a aSheet will not cause a recursion error in \a aHierarchy.
|
|
|
|
*
|
|
|
|
* @param aSheet is the #SCH_SHEET object to test.
|
|
|
|
* @param aHierarchy is the #SCH_SHEET_PATH where \a aSheet is going to reside.
|
|
|
|
*
|
|
|
|
* @return true if \a aSheet will cause a resursion error in \a aHierarchy.
|
|
|
|
*/
|
|
|
|
bool CheckSheetForRecursion( SCH_SHEET* aSheet, SCH_SHEET_PATH* aHierarchy );
|
|
|
|
|
2019-11-17 16:43:05 +00:00
|
|
|
/**
|
|
|
|
* Check \a aSchematicFileName for a potential file name case sensitivity clashes.
|
|
|
|
*
|
|
|
|
* On platforms where file names are case sensitive, it is possible to schematic sheet
|
|
|
|
* file names that would cause issues on platforms where file name are case insensitive.
|
|
|
|
* File names foo.sch and Foo.sch are unique files on Linux and MacOS but on Windows
|
|
|
|
* this would result in a broken schematic.
|
|
|
|
*
|
|
|
|
* @param aSchematicFileName is the absolute path and file name of the file to test.
|
|
|
|
* @return true if the user accepts the potential file name clase risk.
|
|
|
|
*/
|
2020-03-06 20:02:58 +00:00
|
|
|
bool AllowCaseSensitiveFileNameClashes( const wxString& aSchematicFileName );
|
2019-11-17 16:43:05 +00:00
|
|
|
|
2011-06-07 15:29:01 +00:00
|
|
|
/**
|
2017-11-17 17:00:04 +00:00
|
|
|
* Edit an existing sheet or add a new sheet to the schematic.
|
|
|
|
*
|
2011-06-07 15:29:01 +00:00
|
|
|
* When \a aSheet is a new sheet:
|
2017-11-17 17:00:04 +00:00
|
|
|
* - and the file name already exists in the schematic hierarchy, the screen associated
|
|
|
|
* with the sheet found in the hierarchy is associated with \a aSheet.
|
|
|
|
* - and the file name already exists on the system, then \a aSheet is loaded with the
|
|
|
|
* existing file.
|
|
|
|
* - and the file name does not exist in the schematic hierarchy or on the file system,
|
|
|
|
* then a new screen is created and associated with \a aSheet.
|
|
|
|
*
|
2011-06-07 15:29:01 +00:00
|
|
|
* When \a aSheet is an existing sheet:
|
2017-11-17 17:00:04 +00:00
|
|
|
* - and the file name already exists in the schematic hierarchy, the current associated
|
|
|
|
* screen is replace by the one found in the hierarchy.
|
|
|
|
* - and the file name already exists on the system, the current associated screen file
|
|
|
|
* name is changed and the file is loaded.
|
|
|
|
* - and the file name does not exist in the schematic hierarchy or on the file system,
|
|
|
|
* the current associated screen file name is changed and saved to disk.
|
2015-06-28 16:45:05 +00:00
|
|
|
*
|
|
|
|
* Note: the screen is not refresh. The caller is responsible to do that
|
2018-09-03 10:11:39 +00:00
|
|
|
*
|
|
|
|
* @param aSheet is the sheet to edit
|
|
|
|
* @param aHierarchy is the current hierarchy containing aSheet
|
|
|
|
* @param aClearAnnotationNewItems is a reference to a bool to know if the items managed by
|
|
|
|
* this sheet need to have their annotation cleared i.e. when an existing item list is used.
|
|
|
|
* it can happens when the edited sheet used an existying file, or becomes a new instance
|
|
|
|
* of a already existing sheet.
|
|
|
|
*/
|
2020-07-06 10:51:04 +00:00
|
|
|
bool EditSheetProperties( SCH_SHEET* aSheet, SCH_SHEET_PATH* aHierarchy,
|
|
|
|
bool* aClearAnnotationNewItems );
|
2008-04-14 19:22:48 +00:00
|
|
|
|
2019-05-31 22:03:27 +00:00
|
|
|
void InitSheet( SCH_SHEET* aSheet, const wxString& aNewFilename );
|
|
|
|
|
2018-02-26 10:34:36 +00:00
|
|
|
/**
|
2019-07-29 19:59:31 +00:00
|
|
|
* Load a the KiCad schematic file \a aFileName into the sheet \a aSheet.
|
2018-02-26 10:34:36 +00:00
|
|
|
*
|
2019-07-29 19:59:31 +00:00
|
|
|
* If \a aSheet does not have a valid #SCH_SCREEN object, the schematic is loaded into
|
|
|
|
* \a Sheet. Otherwise, it is appended to the current #SCH_SCREEN object.
|
|
|
|
*
|
|
|
|
* In order to import a schematic a lot of things have to happen to before the contents
|
|
|
|
* of the imported schematic can be appended to the current page. The following list
|
|
|
|
* describes this process:
|
|
|
|
*
|
|
|
|
* - Load the schematic into a temporary #SCH_SHEET object.
|
|
|
|
* - Make sure the imported schematic does not cause any hierarchy recursion issues.
|
|
|
|
* - Verify the imported schematic uses fully qualified #LIB_ID objects (symbol library table).
|
|
|
|
* - Check all of the possible combinations that could cause broken symbol library links
|
|
|
|
* and give the user the option to cancel the append process. The following conditions
|
|
|
|
* are check but they still do not guarantee that there will not be any broken symbol
|
|
|
|
* library links:
|
|
|
|
* - The source schematic is in the current project path and contains symbol library
|
|
|
|
* nicknames not found in the project symbol library table. This can happen if the
|
|
|
|
* schematic is copied to the current project path from another project.
|
|
|
|
* - The source schematic is in a different path and there are symbol library link nicknames
|
|
|
|
* that do not exist in either the current symbol library table or the source project
|
|
|
|
* symbol library table if it exists in the source path.
|
|
|
|
* - The source schematic is in a different path and contains duplicate symbol library
|
|
|
|
* nicknames that point to different libraries.
|
|
|
|
* - Check to see if any symbol libraries need to be added to the current project's symbol
|
|
|
|
* library table. This includes:
|
|
|
|
* - Check if the symbol library already exists in the project or global symbol library
|
|
|
|
* table.
|
|
|
|
* - Convert symbol library URLS that use the ${KIPRJMOD} environment variable to absolute
|
|
|
|
* paths. ${KIPRJMOD} will not be the same for this project.
|
|
|
|
* - Clear all of the annotation in the imported schematic to prevent clashes.
|
|
|
|
* - Append the objects from the temporary sheet to the current page.
|
|
|
|
* - Replace any duplicate time stamps.
|
|
|
|
* - Refresh the symbol library links.
|
|
|
|
*
|
|
|
|
* @param aSheet is the sheet to either append or load the schematic.
|
|
|
|
* @param aHierarchy is the current position in the schematic hierarchy used to test for
|
|
|
|
* possible file recursion issues.
|
|
|
|
* @param aFileName is the file name to load. The file name is expected to have an absolute
|
|
|
|
* path.
|
|
|
|
*
|
|
|
|
* @return True if the schematic was imported properly.
|
2018-02-26 10:34:36 +00:00
|
|
|
*/
|
2019-07-29 19:59:31 +00:00
|
|
|
bool LoadSheetFromFile( SCH_SHEET* aSheet, SCH_SHEET_PATH* aHierarchy,
|
|
|
|
const wxString& aFileName );
|
2018-02-26 10:34:36 +00:00
|
|
|
|
2011-03-30 19:26:05 +00:00
|
|
|
/**
|
2017-11-17 17:00:04 +00:00
|
|
|
* Create a new SCH_SHEET_PIN object and add it to \a aSheet at the current cursor position.
|
|
|
|
*
|
2011-03-30 19:26:05 +00:00
|
|
|
* @param aSheet The sheet to add the new sheet pin to.
|
|
|
|
* @return The new sheet pin object created or NULL if the task was aborted by the user.
|
|
|
|
*/
|
2019-05-16 21:58:47 +00:00
|
|
|
SCH_SHEET_PIN* CreateSheetPin( SCH_SHEET* aSheet, SCH_HIERLABEL* aLabel );
|
2011-03-30 19:26:05 +00:00
|
|
|
|
|
|
|
/**
|
2019-05-16 21:58:47 +00:00
|
|
|
* Import a hierarchical label with no attached sheet pin.
|
2017-11-17 17:00:04 +00:00
|
|
|
*
|
2011-03-30 19:26:05 +00:00
|
|
|
* @param aSheet The sheet to import the new sheet pin to.
|
|
|
|
*/
|
2019-05-16 21:58:47 +00:00
|
|
|
SCH_HIERLABEL* ImportHierLabel( SCH_SHEET* aSheet );
|
2008-04-14 19:22:48 +00:00
|
|
|
|
2018-02-02 20:04:36 +00:00
|
|
|
/**
|
|
|
|
* Removes a given junction and heals any wire segments under the junction
|
|
|
|
*
|
|
|
|
* @param aItem The junction to delete
|
|
|
|
* @param aAppend True if we are updating an ongoing commit
|
|
|
|
*/
|
|
|
|
void DeleteJunction( SCH_ITEM* aItem, bool aAppend = false );
|
|
|
|
|
2019-05-01 21:50:11 +00:00
|
|
|
void ConvertPart( SCH_COMPONENT* aComponent );
|
|
|
|
|
2019-05-02 20:44:23 +00:00
|
|
|
void SelectUnit( SCH_COMPONENT* aComponent, int aUnit );
|
2019-04-27 23:50:35 +00:00
|
|
|
|
2008-04-14 19:22:48 +00:00
|
|
|
/* Undo - redo */
|
2009-07-26 17:16:42 +00:00
|
|
|
|
2010-11-12 15:17:10 +00:00
|
|
|
/**
|
2010-12-14 21:39:31 +00:00
|
|
|
* Create a copy of the current schematic item, and put it in the undo list.
|
|
|
|
*
|
2020-07-13 11:21:40 +00:00
|
|
|
* aTypeCommand =
|
2020-08-26 18:04:32 +00:00
|
|
|
* CHANGED
|
|
|
|
* NEWITEM
|
|
|
|
* DELETED
|
2010-12-14 21:39:31 +00:00
|
|
|
* UR_WIRE_IMAGE
|
2020-08-26 18:04:32 +00:00
|
|
|
* MOVED
|
2010-12-14 21:39:31 +00:00
|
|
|
*
|
|
|
|
* If it is a delete command, items are put on list with the .Flags member
|
2020-08-26 18:04:32 +00:00
|
|
|
* set to DELETED.
|
2010-12-14 21:39:31 +00:00
|
|
|
*
|
2010-12-28 11:24:42 +00:00
|
|
|
* @note
|
2010-12-14 21:39:31 +00:00
|
|
|
* Edit wires and buses is a bit complex.
|
2020-07-13 11:21:40 +00:00
|
|
|
* When a new wire is added, a lot of modifications are made in the wire list (merging,
|
|
|
|
* junctions, etc.). We therefore set the aTypeCommand to UR_WIRE_IMAGE and save the whole
|
|
|
|
* schebang.
|
2017-11-17 17:00:04 +00:00
|
|
|
*
|
2009-07-26 17:16:42 +00:00
|
|
|
* @param aItemToCopy = the schematic item modified by the command to undo
|
2020-08-26 18:04:32 +00:00
|
|
|
* @param aTypeCommand = command type (see enum UNDO_REDO)
|
2017-11-16 20:36:09 +00:00
|
|
|
* @param aAppend = add the item to the previous undo list
|
2020-07-13 11:21:40 +00:00
|
|
|
* @param aTransformPoint = the reference point of the transformation for commands like move
|
2009-07-26 17:16:42 +00:00
|
|
|
*/
|
2020-07-13 11:21:40 +00:00
|
|
|
void SaveCopyInUndoList( SCH_SCREEN* aScreen,
|
|
|
|
SCH_ITEM* aItemToCopy,
|
2020-08-26 18:04:32 +00:00
|
|
|
UNDO_REDO aTypeCommand,
|
2020-07-13 11:21:40 +00:00
|
|
|
bool aAppend,
|
2010-12-14 21:39:31 +00:00
|
|
|
const wxPoint& aTransformPoint = wxPoint( 0, 0 ) );
|
2009-07-26 17:16:42 +00:00
|
|
|
|
2010-11-12 15:17:10 +00:00
|
|
|
/**
|
2017-11-17 17:00:04 +00:00
|
|
|
* Create a new entry in undo list of commands.
|
|
|
|
*
|
2009-07-26 17:16:42 +00:00
|
|
|
* @param aItemsList = the list of items modified by the command to undo
|
2020-08-26 18:04:32 +00:00
|
|
|
* @param aTypeCommand = command type (see enum UNDO_REDO)
|
2017-11-16 20:36:09 +00:00
|
|
|
* @param aAppend = add the item to the previous undo list
|
2020-07-13 11:21:40 +00:00
|
|
|
* @param aTransformPoint = the reference point of the transformation for commands like move
|
2009-07-26 17:16:42 +00:00
|
|
|
*/
|
2013-12-18 12:27:18 +00:00
|
|
|
void SaveCopyInUndoList( const PICKED_ITEMS_LIST& aItemsList,
|
2020-08-26 18:04:32 +00:00
|
|
|
UNDO_REDO aTypeCommand,
|
2020-07-13 11:21:40 +00:00
|
|
|
bool aAppend,
|
2010-12-14 21:39:31 +00:00
|
|
|
const wxPoint& aTransformPoint = wxPoint( 0, 0 ) );
|
2008-04-14 19:22:48 +00:00
|
|
|
|
2010-11-12 15:17:10 +00:00
|
|
|
/**
|
2017-11-17 17:00:04 +00:00
|
|
|
* Restore an undo or redo command to put data pointed by \a aList in the previous state.
|
|
|
|
*
|
2010-12-14 21:39:31 +00:00
|
|
|
* @param aList a PICKED_ITEMS_LIST pointer to the list of items to undo/redo
|
|
|
|
* @param aRedoCommand a bool: true for redo, false for undo
|
2009-08-01 19:26:05 +00:00
|
|
|
*/
|
2010-12-14 21:39:31 +00:00
|
|
|
void PutDataInPreviousState( PICKED_ITEMS_LIST* aList, bool aRedoCommand );
|
2009-09-22 12:27:57 +00:00
|
|
|
|
2020-07-13 11:21:40 +00:00
|
|
|
/**
|
|
|
|
* Free the undo or redo list from \a aList element.
|
|
|
|
*
|
|
|
|
* - Wrappers are deleted.
|
|
|
|
* - data pointed by wrappers are deleted if not in use in schematic
|
|
|
|
* i.e. when they are copy of a schematic item or they are no more in use (DELETED)
|
|
|
|
*
|
2020-07-13 13:50:35 +00:00
|
|
|
* @param whichList = the UNDO_REDO_CONTAINER to clear
|
2020-07-13 11:21:40 +00:00
|
|
|
* @param aItemCount = the count of items to remove. < 0 for all items
|
|
|
|
* items are removed from the beginning of the list.
|
|
|
|
* So this function can be called to remove old commands
|
|
|
|
*/
|
2020-07-13 13:50:35 +00:00
|
|
|
void ClearUndoORRedoList( UNDO_REDO_LIST whichList, int aItemCount = -1 ) override;
|
2020-07-13 11:21:40 +00:00
|
|
|
|
2013-08-05 21:02:41 +00:00
|
|
|
/**
|
2017-11-17 17:00:04 +00:00
|
|
|
* Clone \a aItem and owns that clone in this container.
|
2013-08-05 21:02:41 +00:00
|
|
|
*/
|
2019-05-10 16:48:46 +00:00
|
|
|
void SaveCopyForRepeatItem( SCH_ITEM* aItem );
|
2013-08-05 21:02:41 +00:00
|
|
|
|
|
|
|
/**
|
2017-11-17 17:00:04 +00:00
|
|
|
* Return the item which is to be repeated with the insert key.
|
|
|
|
*
|
|
|
|
* Such object is owned by this container, and must be cloned.
|
2013-08-05 21:02:41 +00:00
|
|
|
*/
|
|
|
|
SCH_ITEM* GetRepeatItem() const { return m_item_to_repeat; }
|
2011-01-12 21:47:54 +00:00
|
|
|
|
2020-04-24 13:36:10 +00:00
|
|
|
EDA_ITEM* GetItem( const KIID& aId ) override;
|
|
|
|
|
2019-04-23 17:40:29 +00:00
|
|
|
/**
|
|
|
|
* Performs an undo of the last edit WITHOUT logging a corresponding redo. Used to cancel
|
|
|
|
* an in-progress operation.
|
|
|
|
*/
|
|
|
|
void RollbackSchematicFromUndo();
|
|
|
|
|
2013-01-21 19:58:02 +00:00
|
|
|
/**
|
2017-11-17 17:00:04 +00:00
|
|
|
* Create a symbol library file with the name of the root document plus the '-cache' suffix,
|
2013-01-21 19:58:02 +00:00
|
|
|
*
|
2017-11-17 17:00:04 +00:00
|
|
|
* This file will contain all components used in the current schematic.
|
|
|
|
*
|
|
|
|
* @param aUseCurrentSheetFilename = false to use the root sheet filename
|
2013-05-07 18:32:06 +00:00
|
|
|
* (default) or true to use the currently opened sheet.
|
|
|
|
* @return true if the file was written successfully.
|
2013-01-21 19:58:02 +00:00
|
|
|
*/
|
2013-05-07 18:32:06 +00:00
|
|
|
bool CreateArchiveLibraryCacheFile( bool aUseCurrentSheetFilename = false );
|
2013-01-21 19:58:02 +00:00
|
|
|
|
2011-11-11 20:10:24 +00:00
|
|
|
/**
|
2017-11-17 17:00:04 +00:00
|
|
|
* Create a library \a aFileName that contains all components used in the current schematic.
|
2011-11-11 20:10:24 +00:00
|
|
|
*
|
|
|
|
* @param aFileName The full path and file name of the archive library.
|
|
|
|
* @return True if \a aFileName was written successfully.
|
|
|
|
*/
|
|
|
|
bool CreateArchiveLibrary( const wxString& aFileName );
|
|
|
|
|
2011-03-29 15:21:35 +00:00
|
|
|
/**
|
2017-11-17 17:00:04 +00:00
|
|
|
* Plot or print the current sheet to the clipboard.
|
|
|
|
*
|
2011-03-28 19:26:31 +00:00
|
|
|
* @param aDC = wxDC given by the calling print function
|
|
|
|
*/
|
2020-04-14 12:25:00 +00:00
|
|
|
virtual void PrintPage( RENDER_SETTINGS* aSettings ) override;
|
2011-03-28 19:26:31 +00:00
|
|
|
|
2011-06-15 18:44:24 +00:00
|
|
|
void SetNetListerCommand( const wxString& aCommand ) { m_netListerCommand = aCommand; }
|
|
|
|
|
2016-03-31 06:28:16 +00:00
|
|
|
/**
|
2017-11-17 17:00:04 +00:00
|
|
|
* Reset the execution flags to defaults for external netlist and bom generators.
|
2016-03-31 06:28:16 +00:00
|
|
|
*/
|
|
|
|
void DefaultExecFlags() { m_exec_flags = wxEXEC_SYNC; }
|
|
|
|
|
|
|
|
/**
|
2017-11-17 17:00:04 +00:00
|
|
|
* Set (adds) specified flags for next execution of external generator of the netlist or bom.
|
|
|
|
*
|
2016-03-31 06:28:16 +00:00
|
|
|
* @param aFlags = wxEXEC_* flags, see wxExecute docs.
|
|
|
|
*/
|
|
|
|
void SetExecFlags( const int aFlags ) { m_exec_flags |= aFlags; }
|
|
|
|
|
|
|
|
/**
|
2017-11-17 17:00:04 +00:00
|
|
|
* Clear (removes) specified flags that not needed for next execution of external generator
|
|
|
|
* of the netlist or bom.
|
|
|
|
*
|
2016-03-31 06:28:16 +00:00
|
|
|
* @param aFlags = wxEXEC_* flags, see wxExecute docs.
|
|
|
|
*/
|
|
|
|
void ClearExecFlags( const int aFlags ) { m_exec_flags &= ~( aFlags ); }
|
|
|
|
|
2011-06-15 18:44:24 +00:00
|
|
|
wxString GetNetListerCommand() const { return m_netListerCommand; }
|
|
|
|
|
2019-03-11 21:32:05 +00:00
|
|
|
/**
|
|
|
|
* Generates the connection data for the entire schematic hierarchy.
|
|
|
|
*/
|
2019-11-10 23:24:27 +00:00
|
|
|
void RecalculateConnections( SCH_CLEANUP_FLAGS aCleanupFlags );
|
2019-03-11 21:32:05 +00:00
|
|
|
|
2018-05-14 17:34:18 +00:00
|
|
|
/**
|
|
|
|
* Allows Eeschema to install its preferences panels into the preferences dialog.
|
|
|
|
*/
|
2019-06-09 21:57:23 +00:00
|
|
|
void InstallPreferences( PAGED_DIALOG* aParent, PANEL_HOTKEYS_EDITOR* aHotkeysPanel ) override;
|
2018-05-14 17:34:18 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Called after the preferences dialog is run.
|
|
|
|
*/
|
2020-07-17 20:04:14 +00:00
|
|
|
void CommonSettingsChanged( bool aEnvVarsChanged, bool aTextVarsChanged ) override;
|
2018-01-08 04:05:03 +00:00
|
|
|
|
2020-08-13 21:30:30 +00:00
|
|
|
void UpdateNetHighlightStatus();
|
|
|
|
|
2018-06-30 22:38:04 +00:00
|
|
|
void ShowChangedLanguage() override;
|
|
|
|
|
2019-06-01 15:28:39 +00:00
|
|
|
void SetScreen( BASE_SCREEN* aScreen ) override;
|
2018-08-03 12:18:26 +00:00
|
|
|
|
2020-09-25 07:31:56 +00:00
|
|
|
const BOX2I GetDocumentExtents( bool aIncludeAllVisible = true ) const override;
|
2018-06-30 22:38:04 +00:00
|
|
|
|
2019-06-23 15:12:25 +00:00
|
|
|
void FixupJunctions();
|
|
|
|
|
2020-05-13 02:00:37 +00:00
|
|
|
void FocusOnItem( SCH_ITEM* aItem );
|
|
|
|
|
2020-05-07 13:26:43 +00:00
|
|
|
/**
|
|
|
|
* Convert sheet and symbol legacy time stamp UUIDs to full UUIDs.
|
|
|
|
*
|
|
|
|
* @warning This is a work in progress. It only contains the original code that automatically
|
|
|
|
* updated the UUIDs when loading legacy schematics. This is an incomplete solution
|
|
|
|
* because a way to force a PCB update from schematic with the update symbol links
|
|
|
|
* from references setting must be executed to ensure proper synchronization between
|
|
|
|
* the schematic and board.
|
|
|
|
*/
|
|
|
|
void ConvertTimeStampUuids();
|
|
|
|
|
2020-08-31 15:06:23 +00:00
|
|
|
/**
|
|
|
|
* Update the #LIB_PART of the currently selected symbol.
|
|
|
|
*
|
|
|
|
* This is typically called from the symbol editor when editing symbols in place.
|
|
|
|
*
|
|
|
|
* @param aSymbol is the #LIB_PART to update.
|
|
|
|
*/
|
|
|
|
void UpdateSymbolFromEditor( const LIB_PART& aSymbol );
|
|
|
|
|
2020-08-31 14:11:54 +00:00
|
|
|
int RecomputeIntersheetsRefs();
|
|
|
|
|
|
|
|
void RemoveAllIntersheetsRefs();
|
|
|
|
|
2008-04-14 19:22:48 +00:00
|
|
|
DECLARE_EVENT_TABLE()
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2018-01-30 10:49:51 +00:00
|
|
|
#endif // SCH_EDIT_FRAME_H
|