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#include <wx/filename.h>
39
40#include <core/typeinfo.h>
41#include <eda_base_frame.h>
42#include <eeschema_settings.h>
43#include <math/box2.h>
44#include <sch_base_frame.h>
45#include <template_fieldnames.h>
46
47class SCH_ITEM;
48class EDA_ITEM;
49class SCH_LINE;
50class SCH_TEXT;
51class SCH_BITMAP;
52class SCH_SHEET;
53class SCH_SHEET_PATH;
54class SCH_SHEET_PIN;
55class SCH_SYMBOL;
56class SCH_FIELD;
57class SCH_JUNCTION;
58class SCHEMATIC;
59class SCH_COMMIT;
63class DIALOG_ERC;
65class RESCUER;
66class HIERARCHY_PANE;
67class API_HANDLER_SCH;
70class wxSearchCtrl;
71class BITMAP_BUTTON;
72
73
80
81
82wxDECLARE_EVENT( EDA_EVT_SCHEMATIC_CHANGING, wxCommandEvent );
83wxDECLARE_EVENT( EDA_EVT_SCHEMATIC_CHANGED, wxCommandEvent );
84
85
89class NET_NAVIGATOR_ITEM_DATA : public wxTreeItemData
90{
91public:
92 NET_NAVIGATOR_ITEM_DATA( const SCH_SHEET_PATH& aSheetPath, const SCH_ITEM* aItem ) :
93 m_sheetPath( aSheetPath ),
94 m_item( aItem )
95 {
96 }
97
99 m_item( nullptr )
100 {
101 }
102
104 const SCH_ITEM* GetItem() const { return m_item; }
105
106 bool operator==( const NET_NAVIGATOR_ITEM_DATA& aRhs ) const
107 {
108 return ( m_sheetPath == aRhs.m_sheetPath ) && ( m_item == aRhs.m_item );
109 }
110
112 {
113 if( this == &aItemData )
114 return *this;
115
116 m_sheetPath = aItemData.m_sheetPath;
117 m_item = aItemData.m_item;
118
119 return *this;
120 }
121
122private:
125};
126
127
132{
133public:
134 SCH_EDIT_FRAME( KIWAY* aKiway, wxWindow* aParent );
135 ~SCH_EDIT_FRAME() override;
136
137 SCH_SCREEN* GetScreen() const override;
138
139 SELECTION& GetCurrentSelection() override;
140
141 SCHEMATIC& Schematic() const;
142
143 std::unique_ptr<GRID_HELPER> MakeGridHelper() override;
144
148 bool GetShowAllPins() const override;
149
153 void SaveProjectLocalSettings() override;
154
160 bool LoadProjectSettings();
161
165 void LoadDrawingSheet();
166
167 void ShowSchematicSetupDialog( const wxString& aInitialPage = wxEmptyString );
168
169 void LoadSettings( APP_SETTINGS_BASE* aCfg ) override;
170 void SaveSettings( APP_SETTINGS_BASE* aCfg ) override;
171
173
174 void setupUIConditions() override;
175
181 bool IsContentModified() const override;
182
187 void OnModify() override;
188
189 SEVERITY GetSeverity( int aErrorCode ) const override;
190
194 wxString GetScreenDesc() const override;
195 wxString GetFullScreenDesc() const override;
196
217 void ExecuteRemoteCommand( const char* cmdline ) override;
218
219 void KiwayMailIn( KIWAY_EXPRESS& aEvent ) override;
220
225
229 void AutoRotateItem( SCH_SCREEN* aScreen, SCH_ITEM* aItem );
230
234 void UpdateHierarchyNavigator( bool aRefreshNetNavigator = true, bool aClear = false );
235
243
249
254
255 void AddVariant();
256
257 void RemoveVariant();
258
266 void UpdateVariantSelectionCtrl( const wxArrayString& aVariantNames );
267
268 void SetCurrentVariant( const wxString& aVariantName );
269
270 void onVariantSelected( wxCommandEvent& aEvent );
271
277 void TestDanglingEnds();
278
288 void SendSelectItemsToPcb( const std::vector<EDA_ITEM*>& aItems, bool aForce );
289
295 void SendCrossProbeNetName( const wxString& aNetName );
296
302 void SetCrossProbeConnection( const SCH_CONNECTION* aConnection );
303
308
309 const wxString& GetHighlightedConnection() const
310 {
311 return m_highlightedConn;
312 }
313
314 void SetHighlightedConnection( const wxString& aConnection,
315 const NET_NAVIGATOR_ITEM_DATA* aSelection = nullptr );
316
318
327 bool ReadyToNetlist( const wxString& aAnnotateMessage );
328
344 bool WriteNetListFile( int aFormat, const wxString& aFullFileName, unsigned aNetlistOptions,
345 REPORTER* aReporter = nullptr );
346
354 void DeleteAnnotation( ANNOTATE_SCOPE_T aAnnotateScope, bool aRecursive, REPORTER& aReporter );
355
380 void AnnotateSymbols( SCH_COMMIT* aCommit, ANNOTATE_SCOPE_T aAnnotateScope,
381 ANNOTATE_ORDER_T aSortOption, ANNOTATE_ALGO_T aAlgoOption,
382 bool aRecursive, int aStartNumber, bool aResetAnnotation,
383 bool aRepairTimestamps, REPORTER& aReporter );
384
401 int CheckAnnotate( ANNOTATION_ERROR_HANDLER aErrorHandler,
402 ANNOTATE_SCOPE_T aAnnotateScope = ANNOTATE_ALL,
403 bool aRecursive = true );
404
411 int ModalAnnotate( const wxString& aMessage );
412
413 // Functions used for hierarchy handling
415
416 void SetCurrentSheet( const SCH_SHEET_PATH& aSheet );
417
418 void UpdateItem( EDA_ITEM* aItem, bool isAddOrDelete = false, bool aUpdateRtree = false ) override;
419
425 void HardRedraw() override;
426
430 void DisplayCurrentSheet();
431
436
443 void OnPageSettingsChange() override;
444
451
452 wxPageSetupDialogData& GetPageSetupData() { return m_pageSetupData; }
453
454 void NewProject();
455 void LoadProject();
456 void ProjectChanged() override;
457
465 bool SaveProject( bool aSaveAs = false );
466
467 bool OpenProjectFiles( const std::vector<wxString>& aFileSet, int aCtl = 0 ) override;
468
469 void SetSchematic( SCHEMATIC* aSchematic );
470
471 wxString GetCurrentFileName() const override;
472
480 bool AskToSaveChanges();
481
482 SCH_JUNCTION* AddJunction( SCH_COMMIT* aCommit, SCH_SCREEN* aScreen, const VECTOR2I& aPos );
483
493 bool TrimWire( SCH_COMMIT* aCommit, const VECTOR2I& aStart, const VECTOR2I& aEnd );
494
495 void OnOpenPcbnew();
496 void OnOpenCvpcb();
497 void OnUpdatePCB();
498 void OnAnnotate();
499
507 bool CheckSheetForRecursion( SCH_SHEET* aSheet, SCH_SHEET_PATH* aCurrentSheet );
508
520 bool AllowCaseSensitiveFileNameClashes( const wxString& aOldName,
521 const wxString& aSchematicFileName );
522
556 bool EditSheetProperties( SCH_SHEET* aSheet, SCH_SHEET_PATH* aHierarchy,
557 bool* aIsUndoable = nullptr, bool* aClearAnnotationNewItems = nullptr,
558 bool* aUpdateHierarchyNavigator = nullptr,
559 wxString* aSourceSheetFilename = nullptr );
560
561 void InitSheet( SCH_SHEET* aSheet, const wxString& aNewFilename );
562
613 bool LoadSheetFromFile( SCH_SHEET* aSheet, SCH_SHEET_PATH* aCurrentSheet, const wxString& aFileName,
614 bool aSkipRecursionCheck = false, bool aSkipLibCheck = false );
615
621 void DeleteJunction( SCH_COMMIT* aCommit, SCH_ITEM* aItem );
622
623 void UpdateHopOveredWires( SCH_ITEM* aItem );
624
625 void SelectUnit( SCH_SYMBOL* aSymbol, int aUnit );
626
627 void SelectBodyStyle( SCH_SYMBOL* aSymbol, int aBodyStyle );
628
629 void SetAltPinFunction( SCH_PIN* aPin, const wxString& aFunction );
630
631 /* Undo - redo */
632
648 void SaveCopyInUndoList( SCH_SCREEN* aScreen, SCH_ITEM* aItemToCopy, UNDO_REDO aTypeCommand,
649 bool aAppend );
650
658 void SaveCopyInUndoList( const PICKED_ITEMS_LIST& aItemsList, UNDO_REDO aTypeCommand,
659 bool aAppend );
660
667
679 void ClearUndoORRedoList( UNDO_REDO_LIST whichList, int aItemCount = -1 ) override;
680
684 void SaveCopyForRepeatItem( const SCH_ITEM* aItem );
685 void AddCopyForRepeatItem( const SCH_ITEM* aItem );
686
692 const std::vector<std::unique_ptr<SCH_ITEM>>& GetRepeatItems() const
693 {
694 return m_items_to_repeat;
695 }
696
703 {
704 m_items_to_repeat.clear();
705 }
706
707 EDA_ITEM* ResolveItem( const KIID& aId, bool aAllowNullptrReturn = false ) const override;
708
715
722 bool CreateArchiveLibrary( const wxString& aFileName );
723
724 bool SaveSheetAsDesignBlock( const wxString& aLibraryName, SCH_SHEET_PATH& aSheetPath );
725
726 bool SaveSelectionAsDesignBlock( const wxString& aLibraryName );
727
728 bool SaveSheetToDesignBlock( const LIB_ID& aLibId, SCH_SHEET_PATH& aSheetPath );
729
730 bool SaveSelectionToDesignBlock( const LIB_ID& aLibId );
731
733
734 void SetNetListerCommand( const wxString& aCommand ) { m_netListerCommand = aCommand; }
735
739 void DefaultExecFlags() { m_exec_flags = wxEXEC_SYNC; }
740
746 void SetExecFlags( const int aFlags ) { m_exec_flags |= aFlags; }
747
754 void ClearExecFlags( const int aFlags ) { m_exec_flags &= ~( aFlags ); }
755
756 wxString GetNetListerCommand() const { return m_netListerCommand; }
757
761 void RecalculateConnections( SCH_COMMIT* aCommit, SCH_CLEANUP_FLAGS aCleanupFlags,
762 PROGRESS_REPORTER* aProgressReporter = nullptr );
763
767 void CommonSettingsChanged( int aFlags ) override;
768
770
771 void ShowChangedLanguage() override;
772
773 void SetScreen( BASE_SCREEN* aScreen ) override;
774
775 const BOX2I GetDocumentExtents( bool aIncludeAllVisible = true ) const override;
776
779
780 void FocusOnItem( EDA_ITEM* aItem, bool aAllowScroll = true ) override;
781
783
792 void SaveSymbolToSchematic( const LIB_SYMBOL& aSymbol, const KIID& aSchematicSymbolUUID );
793
799
803 void IntersheetRefUpdate( SCH_GLOBALLABEL* aItem ) override;
804
805 void ShowAllIntersheetRefs( bool aShow );
806
811
815 void ToggleSearch();
816
817 void ToggleProperties() override;
818
819 void ToggleLibraryTree() override;
820
822
823
825
827
829
830 wxTreeCtrl* GetNetNavigator() { return m_netNavigator; }
831
833
837 static const wxString SchematicHierarchyPaneName()
838 {
839 return wxT( "SchematicHierarchy" );
840 }
841
845 static const wxString SearchPaneName() { return wxT( "Search" ); }
846
847 bool IsSearchPaneShown() { return m_auimgr.GetPane( SearchPaneName() ).IsShown(); }
848
849 void FocusSearch();
850
860 void AddSchematicChangeListener( wxEvtHandler* aListener );
861
865 void RemoveSchematicChangeListener( wxEvtHandler* aListener );
866
867 static const wxString NetNavigatorPaneName()
868 {
869 return wxS( "NetNavigator" );
870 }
871
872 void RefreshNetNavigator( const NET_NAVIGATOR_ITEM_DATA* aSelection = nullptr );
873
874 void MakeNetNavigatorNode( const wxString& aNetName, wxTreeItemId aParentId,
875 const NET_NAVIGATOR_ITEM_DATA* aSelection,
876 bool aSingleSheetSchematic );
877
878 void SelectNetNavigatorItem( const NET_NAVIGATOR_ITEM_DATA* aSelection = nullptr );
879
880 const SCH_ITEM* SelectNextPrevNetNavigatorItem( bool aNext );
881
882 void ToggleNetNavigator();
883 void FindNetInInspector( const wxString& aNetName );
884
889
890 DECLARE_EVENT_TABLE()
891
892protected:
898 bool doAutoSave() override;
899
900 void configureToolbars() override;
901
902 void doReCreateMenuBar() override;
903
907 void sendNetlistToCvpcb();
908
909 void onSize( wxSizeEvent& aEvent );
910
911 void saveProjectSettings() override;
912
913 void onCloseSymbolDiffDialog( wxCommandEvent& aEvent );
914
915 void onCloseErcDialog( wxCommandEvent& aEvent );
916
917 void onCloseSymbolFieldsTableDialog( wxCommandEvent& aEvent );
918
919 void unitsChangeRefresh() override;
920
921 void updateSelectionFilterVisbility() override;
922
923#ifdef KICAD_IPC_API
924 void onPluginAvailabilityChanged( wxCommandEvent& aEvt );
925#endif
926
927private:
928 // Called when resizing the Hierarchy Navigator panel
929 void OnResizeHierarchyNavigator( wxSizeEvent& aEvent );
930
931 void onResizeNetNavigator( wxSizeEvent& aEvent );
932
933 // Sets up the tool framework
934 void setupTools();
935
936 void OnExit( wxCommandEvent& event );
937
938 void OnLoadFile( wxCommandEvent& event );
939 void OnImportProject( wxCommandEvent& event );
940
941 void OnClearFileHistory( wxCommandEvent& aEvent );
942
943 bool canCloseWindow( wxCloseEvent& aCloseEvent ) override;
944 void doCloseWindow() override;
945
954 void updateTitle();
955
959 void initScreenZoom();
960
970
977 bool importFile( const wxString& aFileName, int aFileType,
978 const std::map<std::string, UTF8>* aProperties = nullptr );
979
987 bool saveSchematicFile( SCH_SHEET* aSheet, const wxString& aSavePath );
988
994 void mapExistingAnnotation( std::map<wxString, wxString>& aMap );
995
997
998 const wxString& getAutoSaveFileName() const;
999
1001
1002 void onNetNavigatorFilterChanged( wxCommandEvent& aEvent );
1003 void onNetNavigatorKey( wxKeyEvent& aEvent );
1004 void onNetNavigatorItemMenu( wxTreeEvent& aEvent );
1005 void onNetNavigatorContextMenu( wxContextMenuEvent& aEvent );
1006 void onNetNavigatorMenuCommand( wxCommandEvent& aEvent );
1007 void showNetNavigatorMenu( const wxTreeItemId& aItem );
1008
1009 void onNetNavigatorSelection( wxTreeEvent& aEvent );
1010
1011 void onNetNavigatorSelChanging( wxTreeEvent& aEvent );
1012
1014
1015 void StartCrossProbeFlash( const std::vector<SCH_ITEM*>& aItems );
1016 void OnCrossProbeFlashTimer( wxTimerEvent& aEvent );
1017
1018private:
1019 // The schematic editor control class should be able to access some internal
1020 // functions of the editor frame.
1022
1023 enum
1024 {
1025 ID_NET_NAVIGATOR_EXPAND_ALL = wxID_HIGHEST + 400,
1030 };
1031
1034
1035 wxPageSetupDialogData m_pageSetupData;
1036 std::vector<std::unique_ptr<SCH_ITEM>> m_items_to_repeat;
1037
1042
1048
1049
1050 wxTreeCtrl* m_netNavigator;
1055
1056 bool m_syncingPcbToSchSelection; // Recursion guard when synchronizing selection from PCB
1057 // Cross-probe flashing support
1060 std::vector<KIID> m_crossProbeFlashItems;
1064
1065 std::vector<wxEvtHandler*> m_schematicChangeListeners;
1066
1067 std::vector<LIB_ID> m_designBlockHistoryList;
1070
1072
1073#ifdef KICAD_IPC_API
1074 std::unique_ptr<API_HANDLER_SCH> m_apiHandler;
1075#endif
1076};
1077
1078
1079#endif // SCH_EDIT_FRAME_H
PLUGIN_ACTION_SCOPE
Definition api_plugin.h:56
BOX2< VECTOR2I > BOX2I
Definition box2.h:922
APP_SETTINGS_BASE is a settings class that should be derived for each standalone KiCad application.
Handles how to draw a screen (a board, a schematic ...)
Definition base_screen.h:41
A bitmap button widget that behaves like an AUI toolbar item's button when it is drawn.
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.
A minimalistic software bus for communications between various DLLs/DSOs (DSOs) within the same KiCad...
Definition kiway.h:292
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:83
Tree view item data for the net navigator.
const SCH_ITEM * m_item
const SCH_ITEM * GetItem() const
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
SCH_BASE_FRAME(KIWAY *aKiway, wxWindow *aParent, FRAME_T aWindowType, const wxString &aTitle, const wxPoint &aPosition, const wxSize &aSize, long aStyle, const wxString &aFrameName)
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).
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()
void OnCrossProbeFlashTimer(wxTimerEvent &aEvent)
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:39
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 FocusOnItem(EDA_ITEM *aItem, bool aAllowScroll=true) override
Focus on a particular canvas item.
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...
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:726
void OnModify() override
Must be called after a schematic change in order to set the "modify" flag and update other data struc...
void showNetNavigatorMenu(const wxTreeItemId &aItem)
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:60
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.
wxWindow * createHighlightedNetNavigator()
void onCloseErcDialog(wxCommandEvent &aEvent)
void InitSheet(SCH_SHEET *aSheet, const wxString &aNewFilename)
Definition sheet.cpp:112
void UpdateHierarchySelection()
Update the hierarchy navigation tree selection (cross-probe from schematic to hierarchy pane).
void SaveCopyInUndoList(SCH_SCREEN *aScreen, SCH_ITEM *aItemToCopy, UNDO_REDO aTypeCommand, bool aAppend)
Create a copy of the current schematic item, and put it in the undo list.
bool m_syncingPcbToSchSelection
void DirtyHighlightedConnection()
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
friend class SCH_EDITOR_CONTROL
bool doAutoSave() override
Save the schematic files that have been modified and not yet saved.
wxChoice * m_currentVariantCtrl
void SaveSymbolToSchematic(const LIB_SYMBOL &aSymbol, const KIID &aSchematicSymbolUUID)
Update a schematic symbol from a LIB_SYMBOL.
void SetCurrentVariant(const wxString &aVariantName)
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:171
void SetAltPinFunction(SCH_PIN *aPin, const wxString &aFunction)
void CommonSettingsChanged(int aFlags) override
Called after the preferences dialog is run.
void UpdateVariantSelectionCtrl(const wxArrayString &aVariantNames)
Update the variant name control on the main toolbar.
void doReCreateMenuBar() override
void ShowChangedLanguage() override
Redraw the menus and what not in current language.
void SendSelectItemsToPcb(const std::vector< EDA_ITEM * > &aItems, bool aForce)
Send items to board editor for selection.
BITMAP_BUTTON * m_netNavigatorMenuButton
void onNetNavigatorKey(wxKeyEvent &aEvent)
wxPageSetupDialogData & GetPageSetupData()
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:212
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.
PANEL_REMOTE_SYMBOL * m_remoteSymbolPane
void SelectBodyStyle(SCH_SYMBOL *aSymbol, int aBodyStyle)
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 onNetNavigatorFilterChanged(wxCommandEvent &aEvent)
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.
wxString m_netNavigatorFilterValue
void ProjectChanged() override
Notification event that the project has changed.
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.
void SetSchematic(SCHEMATIC *aSchematic)
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:628
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)
wxSearchCtrl * m_netNavigatorFilter
wxString GetFullScreenDesc() const override
static const wxString SearchPaneName()
DIALOG_BOOK_REPORTER * GetSymbolDiffDialog()
bool canCloseWindow(wxCloseEvent &aCloseEvent) override
wxTreeCtrl * GetNetNavigator()
void onNetNavigatorContextMenu(wxContextMenuEvent &aEvent)
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:90
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:607
SCH_DESIGN_BLOCK_PANE * m_designBlocksPane
bool updateAutoSaveFile()
void UpdateHierarchyNavigator(bool aRefreshNetNavigator=true, bool aClear=false)
Update the hierarchy navigation tree and history.
SCH_EDIT_FRAME(KIWAY *aKiway, wxWindow *aParent)
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 SendCrossProbeNetName(const wxString &aNetName)
Send a net name to Pcbnew for highlighting.
std::vector< KIID > m_crossProbeFlashItems
Items to flash.
void LoadDrawingSheet()
Load the drawing sheet file.
void onNetNavigatorMenuCommand(wxCommandEvent &aEvent)
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)
const BOX2I GetDocumentExtents(bool aIncludeAllVisible=true) const override
Return bounding box of document with option to not include some items.
void CaptureHierarchyPaneSize()
void StartCrossProbeFlash(const std::vector< SCH_ITEM * > &aItems)
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:56
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.
wxString m_netNavigatorMenuNetName
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:462
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.
void SetCurrentSheet(const SCH_SHEET_PATH &aSheet)
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
void onVariantSelected(wxCommandEvent &aEvent)
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 onNetNavigatorItemMenu(wxTreeEvent &aEvent)
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)
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).
wxTimer m_crossProbeFlashTimer
Timer to toggle selection visibility.
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 onNetNavigatorSelection(wxTreeEvent &aEvent)
void FindNetInInspector(const wxString &aNetName)
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:167
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.
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:76
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...
VECTOR2< int32_t > VECTOR2I
Definition vector2d.h:695