KiCad PCB EDA Suite
Loading...
Searching...
No Matches
sch_edit_frame.h
Go to the documentation of this file.
1/*
2 * This program source code file is part of KiCad, a free EDA CAD application.
3 *
4 * Copyright (C) 2015 Jean-Pierre Charras, jp.charras wanadoo.fr
5 * Copyright (C) 2008 Wayne Stambaugh <[email protected]>
6 * Copyright (C) 2023 CERN (www.cern.ch)
7 * Copyright The KiCad Developers, see AUTHORS.txt for contributors.
8 *
9 * This program is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License
11 * as published by the Free Software Foundation; either version 2
12 * of the License, or (at your option) any later version.
13 *
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
18 *
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, you may find one here:
21 * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
22 * or you may search the http://www.gnu.org website for the version 2 license,
23 * or you may write to the Free Software Foundation, Inc.,
24 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
25 */
26
27#ifndef SCH_EDIT_FRAME_H
28#define SCH_EDIT_FRAME_H
29
30#include <stddef.h>
31#include <vector>
32#include <wx/cmndata.h>
33#include <wx/event.h>
34#include <wx/gdicmn.h>
35#include <wx/string.h>
36#include <wx/treectrl.h>
37#include <wx/utils.h>
38
39#include <core/typeinfo.h>
40#include <eda_base_frame.h>
41#include <eeschema_settings.h>
42#include <math/box2.h>
43#include <sch_base_frame.h>
44#include <template_fieldnames.h>
45
46class SCH_ITEM;
47class EDA_ITEM;
48class SCH_LINE;
49class SCH_TEXT;
50class SCH_BITMAP;
51class SCH_SHEET;
52class SCH_SHEET_PATH;
53class SCH_SHEET_PIN;
54class SCH_SYMBOL;
55class SCH_FIELD;
56class SCH_JUNCTION;
57class SCHEMATIC;
58class SCH_COMMIT;
61class DIALOG_ERC;
63class RESCUER;
64class HIERARCHY_PANE;
65class API_HANDLER_SCH;
68
69
72{
75};
76
77
78wxDECLARE_EVENT( EDA_EVT_SCHEMATIC_CHANGING, wxCommandEvent );
79wxDECLARE_EVENT( EDA_EVT_SCHEMATIC_CHANGED, wxCommandEvent );
80
81
85class NET_NAVIGATOR_ITEM_DATA : public wxTreeItemData
86{
87public:
88 NET_NAVIGATOR_ITEM_DATA( const SCH_SHEET_PATH& aSheetPath, const SCH_ITEM* aItem ) :
89 m_sheetPath( aSheetPath ),
90 m_item( aItem )
91 {
92 }
93
95 m_item( nullptr )
96 {
97 }
98
100 const SCH_ITEM* GetItem() const { return m_item; }
101
102 bool operator==( const NET_NAVIGATOR_ITEM_DATA& aRhs ) const
103 {
104 return ( m_sheetPath == aRhs.m_sheetPath ) && ( m_item == aRhs.m_item );
105 }
106
108 {
109 if( this == &aItemData )
110 return *this;
111
112 m_sheetPath = aItemData.m_sheetPath;
113 m_item = aItemData.m_item;
114
115 return *this;
116 }
117
118private:
121};
122
123
128{
129public:
130 SCH_EDIT_FRAME( KIWAY* aKiway, wxWindow* aParent );
131 ~SCH_EDIT_FRAME() override;
132
133 SCH_SCREEN* GetScreen() const override;
134
135 SELECTION& GetCurrentSelection() override;
136
137 SCHEMATIC& Schematic() const;
138
139 std::unique_ptr<GRID_HELPER> MakeGridHelper() override;
140
144 bool GetShowAllPins() const override;
145
149 void SaveProjectLocalSettings() override;
150
156 bool LoadProjectSettings();
157
161 void LoadDrawingSheet();
162
163 void ShowSchematicSetupDialog( const wxString& aInitialPage = wxEmptyString );
164
165 void LoadSettings( APP_SETTINGS_BASE* aCfg ) override;
166 void SaveSettings( APP_SETTINGS_BASE* aCfg ) override;
167
168 void CreateScreens();
169
170 void setupUIConditions() override;
171
177 bool IsContentModified() const override;
178
183 void OnModify() override;
184
185 SEVERITY GetSeverity( int aErrorCode ) const override;
186
190 wxString GetScreenDesc() const override;
191 wxString GetFullScreenDesc() const override;
192
213 void ExecuteRemoteCommand( const char* cmdline ) override;
214
215 void KiwayMailIn( KIWAY_EXPRESS& aEvent ) override;
216
221
225 void AutoRotateItem( SCH_SCREEN* aScreen, SCH_ITEM* aItem );
226
230 void UpdateHierarchyNavigator( bool aRefreshNetNavigator = true, bool aClear = false );
231
239
245
250
256 void TestDanglingEnds();
257
267 void SendSelectItemsToPcb( const std::vector<EDA_ITEM*>& aItems, bool aForce );
268
274 void SendCrossProbeNetName( const wxString& aNetName );
275
281 void SetCrossProbeConnection( const SCH_CONNECTION* aConnection );
282
287
288 const wxString& GetHighlightedConnection() const
289 {
290 return m_highlightedConn;
291 }
292
293 void SetHighlightedConnection( const wxString& aConnection,
294 const NET_NAVIGATOR_ITEM_DATA* aSelection = nullptr );
295
304 bool ReadyToNetlist( const wxString& aAnnotateMessage );
305
321 bool WriteNetListFile( int aFormat, const wxString& aFullFileName, unsigned aNetlistOptions,
322 REPORTER* aReporter = nullptr );
323
331 void DeleteAnnotation( ANNOTATE_SCOPE_T aAnnotateScope, bool aRecursive, REPORTER& aReporter );
332
357 void AnnotateSymbols( SCH_COMMIT* aCommit, ANNOTATE_SCOPE_T aAnnotateScope,
358 ANNOTATE_ORDER_T aSortOption, ANNOTATE_ALGO_T aAlgoOption,
359 bool aRecursive, int aStartNumber, bool aResetAnnotation,
360 bool aRepairTimestamps, REPORTER& aReporter );
361
378 int CheckAnnotate( ANNOTATION_ERROR_HANDLER aErrorHandler,
379 ANNOTATE_SCOPE_T aAnnotateScope = ANNOTATE_ALL,
380 bool aRecursive = true );
381
388 int ModalAnnotate( const wxString& aMessage );
389
390 // Functions used for hierarchy handling
392
393 void SetCurrentSheet( const SCH_SHEET_PATH& aSheet );
394
395 void UpdateItem( EDA_ITEM* aItem, bool isAddOrDelete = false,
396 bool aUpdateRtree = false ) override;
397
403 void HardRedraw() override;
404
408 void DisplayCurrentSheet();
409
414
421 void OnPageSettingsChange() override;
422
429
430 wxPageSetupDialogData& GetPageSetupData() { return m_pageSetupData; }
431
432 void NewProject();
433 void LoadProject();
434
442 bool SaveProject( bool aSaveAs = false );
443
444 bool OpenProjectFiles( const std::vector<wxString>& aFileSet, int aCtl = 0 ) override;
445
446 wxString GetCurrentFileName() const override;
447
455 bool AskToSaveChanges();
456
457 SCH_JUNCTION* AddJunction( SCH_COMMIT* aCommit, SCH_SCREEN* aScreen, const VECTOR2I& aPos );
458
468 bool TrimWire( SCH_COMMIT* aCommit, const VECTOR2I& aStart, const VECTOR2I& aEnd );
469
470 void OnOpenPcbnew();
471 void OnOpenCvpcb();
472 void OnUpdatePCB();
473 void OnAnnotate();
474
482 bool CheckSheetForRecursion( SCH_SHEET* aSheet, SCH_SHEET_PATH* aCurrentSheet );
483
495 bool AllowCaseSensitiveFileNameClashes( const wxString& aOldName,
496 const wxString& aSchematicFileName );
497
531 bool EditSheetProperties( SCH_SHEET* aSheet, SCH_SHEET_PATH* aHierarchy,
532 bool* aIsUndoable = nullptr, bool* aClearAnnotationNewItems = nullptr,
533 bool* aUpdateHierarchyNavigator = nullptr,
534 wxString* aSourceSheetFilename = nullptr );
535
536 void InitSheet( SCH_SHEET* aSheet, const wxString& aNewFilename );
537
588 bool LoadSheetFromFile( SCH_SHEET* aSheet, SCH_SHEET_PATH* aCurrentSheet,
589 const wxString& aFileName, bool aSkipRecursionCheck = false,
590 bool aSkipLibCheck = false );
591
597 void DeleteJunction( SCH_COMMIT* aCommit, SCH_ITEM* aItem );
598
599 void UpdateHopOveredWires( SCH_ITEM* aItem );
600
601 void FlipBodyStyle( SCH_SYMBOL* aSymbol );
602
603 void SelectUnit( SCH_SYMBOL* aSymbol, int aUnit );
604
605 void SetAltPinFunction( SCH_PIN* aPin, const wxString& aFunction );
606
607 /* Undo - redo */
608
625 void SaveCopyInUndoList( SCH_SCREEN* aScreen, SCH_ITEM* aItemToCopy, UNDO_REDO aTypeCommand,
626 bool aAppend, bool aDirtyConnectivity = true );
627
636 void SaveCopyInUndoList( const PICKED_ITEMS_LIST& aItemsList, UNDO_REDO aTypeCommand,
637 bool aAppend, bool aDirtyConnectivity = true );
638
645
657 void ClearUndoORRedoList( UNDO_REDO_LIST whichList, int aItemCount = -1 ) override;
658
662 void SaveCopyForRepeatItem( const SCH_ITEM* aItem );
663 void AddCopyForRepeatItem( const SCH_ITEM* aItem );
664
670 const std::vector<std::unique_ptr<SCH_ITEM>>& GetRepeatItems() const
671 {
672 return m_items_to_repeat;
673 }
674
681 {
682 m_items_to_repeat.clear();
683 }
684
685 EDA_ITEM* ResolveItem( const KIID& aId, bool aAllowNullptrReturn = false ) const override;
686
693
700 bool CreateArchiveLibrary( const wxString& aFileName );
701
702 bool SaveSheetAsDesignBlock( const wxString& aLibraryName, SCH_SHEET_PATH& aSheetPath );
703
704 bool SaveSelectionAsDesignBlock( const wxString& aLibraryName );
705
706 bool SaveSheetToDesignBlock( const LIB_ID& aLibId, SCH_SHEET_PATH& aSheetPath );
707
708 bool SaveSelectionToDesignBlock( const LIB_ID& aLibId );
709
711
712 void SetNetListerCommand( const wxString& aCommand ) { m_netListerCommand = aCommand; }
713
717 void DefaultExecFlags() { m_exec_flags = wxEXEC_SYNC; }
718
724 void SetExecFlags( const int aFlags ) { m_exec_flags |= aFlags; }
725
732 void ClearExecFlags( const int aFlags ) { m_exec_flags &= ~( aFlags ); }
733
734 wxString GetNetListerCommand() const { return m_netListerCommand; }
735
739 void RecalculateConnections( SCH_COMMIT* aCommit, SCH_CLEANUP_FLAGS aCleanupFlags,
740 PROGRESS_REPORTER* aProgressReporter = nullptr );
741
745 void CommonSettingsChanged( int aFlags ) override;
746
748
749 void ShowChangedLanguage() override;
750
751 void SetScreen( BASE_SCREEN* aScreen ) override;
752
753 const BOX2I GetDocumentExtents( bool aIncludeAllVisible = true ) const override;
754
757
758 void FocusOnItem( EDA_ITEM* aItem ) override;
759
761
770 void SaveSymbolToSchematic( const LIB_SYMBOL& aSymbol, const KIID& aSchematicSymbolUUID );
771
777
781 void IntersheetRefUpdate( SCH_GLOBALLABEL* aItem ) override;
782
783 void ShowAllIntersheetRefs( bool aShow );
784
791 virtual void CheckForAutoSaveFile( const wxFileName& aFileName ) override;
792
793 virtual void DeleteAutoSaveFile( const wxFileName& aFileName ) override;
794
799
803 void ToggleSearch();
804
805 void ToggleProperties() override;
806
807 void ToggleLibraryTree() override;
808
810
812
814
815 wxTreeCtrl* GetNetNavigator() { return m_netNavigator; }
816
818
822 static const wxString SchematicHierarchyPaneName()
823 {
824 return wxT( "SchematicHierarchy" );
825 }
826
830 static const wxString SearchPaneName() { return wxT( "Search" ); }
831
832 bool IsSearchPaneShown() { return m_auimgr.GetPane( SearchPaneName() ).IsShown(); }
833
834 void FocusSearch();
835
845 void AddSchematicChangeListener( wxEvtHandler* aListener );
846
850 void RemoveSchematicChangeListener( wxEvtHandler* aListener );
851
852 static const wxString NetNavigatorPaneName()
853 {
854 return wxS( "NetNavigator" );
855 }
856
857 void RefreshNetNavigator( const NET_NAVIGATOR_ITEM_DATA* aSelection = nullptr );
858
859 void MakeNetNavigatorNode( const wxString& aNetName, wxTreeItemId aParentId,
860 const NET_NAVIGATOR_ITEM_DATA* aSelection,
861 bool aSingleSheetSchematic );
862
863 void SelectNetNavigatorItem( const NET_NAVIGATOR_ITEM_DATA* aSelection = nullptr );
864
865 const SCH_ITEM* SelectNextPrevNetNavigatorItem( bool aNext );
866
867 void ToggleNetNavigator();
868
870 {
871 return PLUGIN_ACTION_SCOPE::SCHEMATIC;
872 }
873
874 DECLARE_EVENT_TABLE()
875
876protected:
882 bool doAutoSave() override;
883
884 void configureToolbars() override;
885
886 void doReCreateMenuBar() override;
887
891 void sendNetlistToCvpcb();
892
893 void onSize( wxSizeEvent& aEvent );
894
895 void saveProjectSettings() override;
896
897 void onCloseSymbolDiffDialog( wxCommandEvent& aEvent );
898
899 void onCloseErcDialog( wxCommandEvent& aEvent );
900
901 void onCloseSymbolFieldsTableDialog( wxCommandEvent& aEvent );
902
903 void unitsChangeRefresh() override;
904
905 void updateSelectionFilterVisbility() override;
906
907#ifdef KICAD_IPC_API
908 void onPluginAvailabilityChanged( wxCommandEvent& aEvt );
909#endif
910
911private:
912 // Called when resizing the Hierarchy Navigator panel
913 void OnResizeHierarchyNavigator( wxSizeEvent& aEvent );
914
915 void onResizeNetNavigator( wxSizeEvent& aEvent );
916
917 // Sets up the tool framework
918 void setupTools();
919
920 void OnExit( wxCommandEvent& event );
921
922 void OnLoadFile( wxCommandEvent& event );
923 void OnImportProject( wxCommandEvent& event );
924
925 void OnClearFileHistory( wxCommandEvent& aEvent );
926
927 bool canCloseWindow( wxCloseEvent& aCloseEvent ) override;
928 void doCloseWindow() override;
929
938 void updateTitle();
939
943 void initScreenZoom();
944
954
961 bool importFile( const wxString& aFileName, int aFileType,
962 const std::map<std::string, UTF8>* aProperties = nullptr );
963
971 bool saveSchematicFile( SCH_SHEET* aSheet, const wxString& aSavePath );
972
978 void mapExistingAnnotation( std::map<wxString, wxString>& aMap );
979
980 bool updateAutoSaveFile();
981
982 const wxString& getAutoSaveFileName() const;
983
984 wxTreeCtrl* createHighlightedNetNavigator();
985
986 void onNetNavigatorSelection( wxTreeEvent& aEvent );
987
988 void onNetNavigatorSelChanging( wxTreeEvent& aEvent );
989
991
992private:
993 // The schematic editor control class should be able to access some internal
994 // functions of the editor frame.
995 friend class SCH_EDITOR_CONTROL;
996
999
1000 wxPageSetupDialogData m_pageSetupData;
1001 std::vector<std::unique_ptr<SCH_ITEM>> m_items_to_repeat;
1002
1007
1013
1014
1015 wxTreeCtrl* m_netNavigator;
1016
1017 bool m_syncingPcbToSchSelection; // Recursion guard when synchronizing selection from PCB
1020
1021 std::vector<wxEvtHandler*> m_schematicChangeListeners;
1022
1023 std::vector<LIB_ID> m_designBlockHistoryList;
1025
1026#ifdef KICAD_IPC_API
1027 std::unique_ptr<API_HANDLER_SCH> m_apiHandler;
1028#endif
1029};
1030
1031
1032#endif // SCH_EDIT_FRAME_H
PLUGIN_ACTION_SCOPE
Definition: api_plugin.h:56
APP_SETTINGS_BASE is a settings class that should be derived for each standalone KiCad application.
Definition: app_settings.h:108
Handles how to draw a screen (a board, a schematic ...)
Definition: base_screen.h:41
UNDO_REDO_LIST
Specify whether we are interacting with the undo or redo stacks.
wxAuiManager m_auimgr
A base class for most all the KiCad significant classes used in schematics and boards.
Definition: eda_item.h:98
Definition: kiid.h:49
Carry a payload from one KIWAY_PLAYER to another within a PROJECT.
Definition: kiway_express.h:40
A minimalistic software bus for communications between various DLLs/DSOs (DSOs) within the same KiCad...
Definition: kiway.h:286
A logical library item identifier and consists of various portions much like a URI.
Definition: lib_id.h:49
Define a library symbol object.
Definition: lib_symbol.h:85
Tree view item data for the net navigator.
const SCH_ITEM * m_item
const SCH_ITEM * GetItem() const
SCH_SHEET_PATH m_sheetPath
bool operator==(const NET_NAVIGATOR_ITEM_DATA &aRhs) const
NET_NAVIGATOR_ITEM_DATA(const SCH_SHEET_PATH &aSheetPath, const SCH_ITEM *aItem)
SCH_SHEET_PATH & GetSheetPath()
NET_NAVIGATOR_ITEM_DATA & operator=(const NET_NAVIGATOR_ITEM_DATA &aItemData)
A holder to handle information on schematic or board items.
A progress reporter interface for use in multi-threaded environments.
A pure virtual class used to derive REPORTER objects from.
Definition: reporter.h:73
Holds all the data relating to one schematic.
Definition: schematic.h:88
A shim class between EDA_DRAW_FRAME and several derived classes: SYMBOL_EDIT_FRAME,...
Object to handle a bitmap image that can be inserted in a schematic.
Definition: sch_bitmap.h:40
Each graphical item can have a SCH_CONNECTION describing its logical connection (to a bus or net).
Handle actions specific to the schematic editor.
Schematic editor (Eeschema) main window.
void ShowSchematicSetupDialog(const wxString &aInitialPage=wxEmptyString)
void RollbackSchematicFromUndo()
Perform an undo of the last edit without logging a corresponding redo.
void DefaultExecFlags()
Reset the execution flags to defaults for external netlist and bom generators.
bool IsSyncingSelection()
bool SaveSheetToDesignBlock(const LIB_ID &aLibId, SCH_SHEET_PATH &aSheetPath)
void ToggleProperties() override
bool IsContentModified() const override
Get if the current schematic has been modified but not saved.
void RefreshOperatingPointDisplay()
Refresh the display of any operating points.
wxPageSetupDialogData m_pageSetupData
SCH_DESIGN_BLOCK_PANE * GetDesignBlockPane() const
SELECTION & GetCurrentSelection() override
Get the current selection from the canvas area.
void mapExistingAnnotation(std::map< wxString, wxString > &aMap)
Fill a map of uuid -> reference from the currently loaded schematic.
Definition: annotate.cpp:40
const wxString & getAutoSaveFileName() const
wxTreeCtrl * m_netNavigator
std::vector< std::unique_ptr< SCH_ITEM > > m_items_to_repeat
For the repeat-last-item cmd.
void ToggleNetNavigator()
void onResizeNetNavigator(wxSizeEvent &aEvent)
void updateSelectionFilterVisbility() override
Selection filter panel doesn't have a dedicated visibility control, so show it if any other AUI panel...
bool m_highlightedConnChanged
void onNetNavigatorSelChanging(wxTreeEvent &aEvent)
void SetExecFlags(const int aFlags)
Set (adds) specified flags for next execution of external generator of the netlist or bom.
bool AllowCaseSensitiveFileNameClashes(const wxString &aOldName, const wxString &aSchematicFileName)
Check aSchematicFileName for a potential file name case sensitivity clashes.
Definition: sheet.cpp:720
void OnModify() override
Must be called after a schematic change in order to set the "modify" flag and update other data struc...
void ShowAllIntersheetRefs(bool aShow)
void SaveProjectLocalSettings() override
Save changes to the project settings to the project (.pro) file.
bool OpenProjectFiles(const std::vector< wxString > &aFileSet, int aCtl=0) override
Open a project or set of files given by aFileList.
void DeleteAnnotation(ANNOTATE_SCOPE_T aAnnotateScope, bool aRecursive, REPORTER &aReporter)
Clear the current symbol annotation.
Definition: annotate.cpp:61
void doCloseWindow() override
DIALOG_BOOK_REPORTER * m_diffSymbolDialog
void ToggleLibraryTree() override
void SetHighlightedConnection(const wxString &aConnection, const NET_NAVIGATOR_ITEM_DATA *aSelection=nullptr)
SCH_SCREEN * GetScreen() const override
Return a pointer to a BASE_SCREEN or one of its derivatives.
bool ReadyToNetlist(const wxString &aAnnotateMessage)
Check if we are ready to write a netlist file for the current schematic.
void onCloseErcDialog(wxCommandEvent &aEvent)
void InitSheet(SCH_SHEET *aSheet, const wxString &aNewFilename)
Definition: sheet.cpp:110
void UpdateHierarchySelection()
Update the hierarchy navigation tree selection (cross-probe from schematic to hierarchy pane).
bool m_syncingPcbToSchSelection
bool SaveSelectionToDesignBlock(const LIB_ID &aLibId)
void SetScreen(BASE_SCREEN *aScreen) override
bool AskToSaveChanges()
Check if any of the screens has unsaved changes and asks the user whether to save or drop them.
wxString GetNetListerCommand() const
bool doAutoSave() override
Save the schematic files that have been modified and not yet saved.
void SaveSymbolToSchematic(const LIB_SYMBOL &aSymbol, const KIID &aSchematicSymbolUUID)
Update a schematic symbol from a LIB_SYMBOL.
void onSize(wxSizeEvent &aEvent)
DIALOG_SCHEMATIC_SETUP * m_schematicSetupDialog
bool LoadSheetFromFile(SCH_SHEET *aSheet, SCH_SHEET_PATH *aCurrentSheet, const wxString &aFileName, bool aSkipRecursionCheck=false, bool aSkipLibCheck=false)
Load a the KiCad schematic file aFileName into the sheet aSheet.
Definition: sheet.cpp:169
void SetAltPinFunction(SCH_PIN *aPin, const wxString &aFunction)
Definition: picksymbol.cpp:227
void CommonSettingsChanged(int aFlags) override
Called after the preferences dialog is run.
void doReCreateMenuBar() override
void ShowChangedLanguage() override
void SendSelectItemsToPcb(const std::vector< EDA_ITEM * > &aItems, bool aForce)
Send items to board editor for selection.
wxPageSetupDialogData & GetPageSetupData()
void SaveCopyInUndoList(SCH_SCREEN *aScreen, SCH_ITEM *aItemToCopy, UNDO_REDO aTypeCommand, bool aAppend, bool aDirtyConnectivity=true)
Create a copy of the current schematic item, and put it in the undo list.
void configureToolbars() override
std::vector< wxEvtHandler * > m_schematicChangeListeners
void AnnotateSymbols(SCH_COMMIT *aCommit, ANNOTATE_SCOPE_T aAnnotateScope, ANNOTATE_ORDER_T aSortOption, ANNOTATE_ALGO_T aAlgoOption, bool aRecursive, int aStartNumber, bool aResetAnnotation, bool aRepairTimestamps, REPORTER &aReporter)
Annotate the symbols in the schematic that are not currently annotated.
Definition: annotate.cpp:213
void SendCrossProbeClearHighlight()
Tell Pcbnew to clear the existing highlighted net, if one exists.
void HardRedraw() override
Rebuild the GAL and redraw the screen.
void OnClearFileHistory(wxCommandEvent &aEvent)
void MakeNetNavigatorNode(const wxString &aNetName, wxTreeItemId aParentId, const NET_NAVIGATOR_ITEM_DATA *aSelection, bool aSingleSheetSchematic)
bool GetShowAllPins() const override
Allow edit frame to show/hide hidden pins.
bool WriteNetListFile(int aFormat, const wxString &aFullFileName, unsigned aNetlistOptions, REPORTER *aReporter=nullptr)
Create a netlist file.
void ClearUndoORRedoList(UNDO_REDO_LIST whichList, int aItemCount=-1) override
Free the undo or redo list from aList element.
SCHEMATIC * m_schematic
The currently loaded schematic.
void onCloseSymbolFieldsTableDialog(wxCommandEvent &aEvent)
SCH_SHEET_PATH & GetCurrentSheet() const
void RecalculateConnections(SCH_COMMIT *aCommit, SCH_CLEANUP_FLAGS aCleanupFlags, PROGRESS_REPORTER *aProgressReporter=nullptr)
Generate the connection data for the entire schematic hierarchy.
void OnLoadFile(wxCommandEvent &event)
const SCH_ITEM * GetSelectedNetNavigatorItem() const
PLUGIN_ACTION_SCOPE PluginActionScope() const override
SCHEMATIC & Schematic() const
void updateTitle()
Set the main window title bar text.
void ExecuteRemoteCommand(const char *cmdline) override
Execute a remote command sent via a socket on port KICAD_SCH_PORT_SERVICE_NUMBER (which defaults to 4...
const std::vector< std::unique_ptr< SCH_ITEM > > & GetRepeatItems() const
Return the items which are to be repeated with the insert key.
bool IsSearchPaneShown()
bool saveSchematicFile(SCH_SHEET *aSheet, const wxString &aSavePath)
Save aSheet to a schematic file.
void ToggleSearch()
Toggle the show/hide state of Search pane.
void DrawCurrentSheetToClipboard()
Use the wxWidgets print code to draw an image of the current sheet onto the clipboard.
Definition: sheet.cpp:622
bool LoadProjectSettings()
Load the KiCad project file (*.pro) settings specific to Eeschema.
void LoadSettings(APP_SETTINGS_BASE *aCfg) override
Load common frame parameters from a configuration file.
void RefreshNetNavigator(const NET_NAVIGATOR_ITEM_DATA *aSelection=nullptr)
wxString GetFullScreenDesc() const override
static const wxString SearchPaneName()
DIALOG_BOOK_REPORTER * GetSymbolDiffDialog()
bool canCloseWindow(wxCloseEvent &aCloseEvent) override
wxTreeCtrl * GetNetNavigator()
int m_exec_flags
Flags of the wxExecute() function to call a custom net list generator.
void RecomputeIntersheetRefs()
Update the schematic's page reference map for all global labels, and refresh the labels so that they ...
bool checkForNoFullyDefinedLibIds(SCH_SHEET *aSheet)
Verify that the symbol library links aSheet and all of its child sheets have been remapped to the sym...
Definition: sheet.cpp:88
DIALOG_ERC * GetErcDialog()
void sendNetlistToCvpcb()
Send the KiCad netlist over to CVPCB.
bool EditSheetProperties(SCH_SHEET *aSheet, SCH_SHEET_PATH *aHierarchy, bool *aIsUndoable=nullptr, bool *aClearAnnotationNewItems=nullptr, bool *aUpdateHierarchyNavigator=nullptr, wxString *aSourceSheetFilename=nullptr)
Edit an existing sheet or add a new sheet to the schematic.
Definition: sheet.cpp:601
SCH_DESIGN_BLOCK_PANE * m_designBlocksPane
void UpdateHierarchyNavigator(bool aRefreshNetNavigator=true, bool aClear=false)
Update the hierarchy navigation tree and history.
void ToggleSchematicHierarchy()
Toggle the show/hide state of the left side schematic navigation panel.
bool importFile(const wxString &aFileName, int aFileType, const std::map< std::string, UTF8 > *aProperties=nullptr)
Load the given filename but sets the path to the current project path.
void FlipBodyStyle(SCH_SYMBOL *aSymbol)
Definition: picksymbol.cpp:188
void SendCrossProbeNetName(const wxString &aNetName)
Send a net name to Pcbnew for highlighting.
void LoadDrawingSheet()
Load the drawing sheet file.
virtual void DeleteAutoSaveFile(const wxFileName &aFileName) override
const SCH_ITEM * SelectNextPrevNetNavigatorItem(bool aNext)
void SetSheetNumberAndCount()
Set the m_ScreenNumber and m_NumberOfScreens members for screens.
void SaveSettings(APP_SETTINGS_BASE *aCfg) override
Save common frame parameters to a configuration data file.
std::vector< LIB_ID > m_designBlockHistoryList
void OnPageSettingsChange() override
Called when modifying the page settings.
void ClearRepeatItemsList()
Clear the list of items which are to be repeated with the insert key.
void SelectUnit(SCH_SYMBOL *aSymbol, int aUnit)
Definition: picksymbol.cpp:99
const BOX2I GetDocumentExtents(bool aIncludeAllVisible=true) const override
Return bounding box of document with option to not include some items.
void CaptureHierarchyPaneSize()
void initScreenZoom()
Initialize the zoom value of the current screen and mark the screen as zoom-initialized.
bool CheckSheetForRecursion(SCH_SHEET *aSheet, SCH_SHEET_PATH *aCurrentSheet)
Verify that aSheet will not cause a recursion error in aCurrentSheet.
Definition: sheet.cpp:54
void UpdateLabelsHierarchyNavigator()
Update the hierarchy navigation tree labels.
void OnImportProject(wxCommandEvent &event)
double GetSchematicHopOverScale()
void ClearExecFlags(const int aFlags)
Clear (removes) specified flags that not needed for next execution of external generator of the netli...
static const wxString SchematicHierarchyPaneName()
void setupUIConditions() override
Setup the UI conditions for the various actions and their controls in this frame.
EDA_ITEM * ResolveItem(const KIID &aId, bool aAllowNullptrReturn=false) const override
Fetch an item by KIID.
void unitsChangeRefresh() override
Called when when the units setting has changed to allow for any derived classes to handle refreshing ...
int CheckAnnotate(ANNOTATION_ERROR_HANDLER aErrorHandler, ANNOTATE_SCOPE_T aAnnotateScope=ANNOTATE_ALL, bool aRecursive=true)
Check for annotation errors.
Definition: annotate.cpp:463
void RemoveSchematicChangeListener(wxEvtHandler *aListener)
Remove aListener to from the schematic changed listener list.
bool CreateArchiveLibrary(const wxString &aFileName)
Create a library aFileName that contains all symbols used in the current schematic.
Definition: libarch.cpp:41
void SetCurrentSheet(const SCH_SHEET_PATH &aSheet)
int GetSchematicJunctionSize()
void DisplayCurrentSheet()
Draw the current sheet on the display.
void SetNetListerCommand(const wxString &aCommand)
void PutDataInPreviousState(PICKED_ITEMS_LIST *aList)
Restore an undo or redo command to put data pointed by aList in the previous state.
int ModalAnnotate(const wxString &aMessage)
Run a modal version of the annotate dialog for a specific purpose.
~SCH_EDIT_FRAME() override
virtual void CheckForAutoSaveFile(const wxFileName &aFileName) override
This overloaded version checks if the auto save master file "#auto_saved_files#" exists and recovers ...
const wxString & GetHighlightedConnection() const
DIALOG_ERC * m_ercDialog
void UpdateItem(EDA_ITEM *aItem, bool isAddOrDelete=false, bool aUpdateRtree=false) override
Mark an item for refresh.
wxString m_netListerCommand
Command line to call a custom net list generator.
bool TrimWire(SCH_COMMIT *aCommit, const VECTOR2I &aStart, const VECTOR2I &aEnd)
If any single wire passes through both points, remove the portion between the two points,...
void UpdateNetHighlightStatus()
wxString GetScreenDesc() const override
Return a human-readable description of the current screen.
void SelectNetNavigatorItem(const NET_NAVIGATOR_ITEM_DATA *aSelection=nullptr)
void AddCopyForRepeatItem(const SCH_ITEM *aItem)
DIALOG_SYMBOL_FIELDS_TABLE * GetSymbolFieldsTableDialog()
void OnResizeHierarchyNavigator(wxSizeEvent &aEvent)
bool SaveSheetAsDesignBlock(const wxString &aLibraryName, SCH_SHEET_PATH &aSheetPath)
wxString GetCurrentFileName() const override
Get the full filename + path of the currently opened file in the frame.
void UpdateDesignBlockOptions()
Design block panel options have changed and the panel needs to be refreshed.
wxString m_highlightedConn
The highlighted net or bus or empty string.
static const wxString NetNavigatorPaneName()
void SetCrossProbeConnection(const SCH_CONNECTION *aConnection)
Send a connection (net or bus) to Pcbnew for highlighting.
void onCloseSymbolDiffDialog(wxCommandEvent &aEvent)
bool SaveSelectionAsDesignBlock(const wxString &aLibraryName)
wxTreeCtrl * createHighlightedNetNavigator()
void TestDanglingEnds()
Test all of the connectable objects in the schematic for unused connection points.
bool SaveProject(bool aSaveAs=false)
Save the currently-open schematic (including its hierarchy) and associated project.
void IntersheetRefUpdate(SCH_GLOBALLABEL *aItem) override
Callback from schematic ref update.
void saveProjectSettings() override
Save any design-related project settings associated with this frame.
void OnExit(wxCommandEvent &event)
void DeleteJunction(SCH_COMMIT *aCommit, SCH_ITEM *aItem)
Remove a given junction and heals any wire segments under the junction.
void AutoRotateItem(SCH_SCREEN *aScreen, SCH_ITEM *aItem)
Automatically set the rotation of an item (if the item supports it).
void AddSchematicChangeListener(wxEvtHandler *aListener)
Add aListener to post #EDA_EVT_SCHEMATIC_CHANGED command events to.
HIERARCHY_PANE * m_hierarchy
DIALOG_SYMBOL_FIELDS_TABLE * m_symbolFieldsTableDialog
std::unique_ptr< GRID_HELPER > MakeGridHelper() override
void UpdateHopOveredWires(SCH_ITEM *aItem)
SEVERITY GetSeverity(int aErrorCode) const override
void FocusOnItem(EDA_ITEM *aItem) override
Focus on a particular canvas item.
void onNetNavigatorSelection(wxTreeEvent &aEvent)
SCH_JUNCTION * AddJunction(SCH_COMMIT *aCommit, SCH_SCREEN *aScreen, const VECTOR2I &aPos)
void SaveCopyForRepeatItem(const SCH_ITEM *aItem)
Clone aItem and owns that clone in this container.
void KiwayMailIn(KIWAY_EXPRESS &aEvent) override
Receive KIWAY_EXPRESS messages from other players.
Base class for any item which can be embedded within the SCHEMATIC container class,...
Definition: sch_item.h:168
Segment description base class to describe items which have 2 end points (track, wire,...
Definition: sch_line.h:42
Handle access to a stack of flattened SCH_SHEET objects by way of a path for creating a flattened sch...
Define a sheet pin (label) used in sheets to create hierarchical schematics.
Definition: sch_sheet_pin.h:66
Sheet symbol placed in a schematic, and is the entry point for a sub schematic.
Definition: sch_sheet.h:47
Schematic symbol object.
Definition: sch_symbol.h:75
Base window classes and related definitions.
SEVERITY
wxDECLARE_EVENT(EDA_EVT_SCHEMATIC_CHANGING, wxCommandEvent)
SCH_SEARCH_T
Schematic search type used by the socket link with Pcbnew.
@ HIGHLIGHT_SYMBOL
@ HIGHLIGHT_PIN
std::function< void(ERCE_T aType, const wxString &aMsg, SCH_REFERENCE *aItemA, SCH_REFERENCE *aItemB)> ANNOTATION_ERROR_HANDLER
Define a standard error handler for annotation errors.
ANNOTATE_ORDER_T
Schematic annotation order options.
ANNOTATE_SCOPE_T
Schematic annotation scope options.
@ ANNOTATE_ALL
Annotate the full schematic.
ANNOTATE_ALGO_T
Schematic annotation type options.
SCH_CLEANUP_FLAGS
Definition: schematic.h:74
UNDO_REDO
Undo Redo considerations: Basically we have 3 cases New item Deleted item Modified item there is also...