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 (C) 2004-2023 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;
60class DIALOG_ERC;
62class DIALOG_SCH_FIND;
63class RESCUER;
64class HIERARCHY_PANE;
65
66
67// @todo Move this to transform alone with all of the transform manipulation code.
70{
71 SYM_NORMAL, // Normal orientation, no rotation or mirror
72 SYM_ROTATE_CLOCKWISE, // Rotate -90
74 SYM_ORIENT_0, // No rotation and no mirror id SYM_NORMAL
75 SYM_ORIENT_90, // Rotate 90, no mirror
76 SYM_ORIENT_180, // Rotate 180, no mirror
77 SYM_ORIENT_270, // Rotate -90, no mirror
78 SYM_MIRROR_X = 0x100, // Mirror around X axis
79 SYM_MIRROR_Y = 0x200 // Mirror around Y axis
80};
81
82
85{
88};
89
90
92{
96};
97
98
99wxDECLARE_EVENT( EDA_EVT_SCHEMATIC_CHANGED, wxCommandEvent );
100
101
105class NET_NAVIGATOR_ITEM_DATA : public wxTreeItemData
106{
107public:
108 NET_NAVIGATOR_ITEM_DATA( const SCH_SHEET_PATH& aSheetPath, const SCH_ITEM* aItem ) :
109 m_sheetPath( aSheetPath ),
110 m_item( aItem )
111 {
112 }
113
115 m_item( nullptr )
116 {
117 }
118
120 const SCH_ITEM* GetItem() const { return m_item; }
121
122 bool operator==( const NET_NAVIGATOR_ITEM_DATA& aRhs ) const
123 {
124 return ( m_sheetPath == aRhs.m_sheetPath ) && ( m_item == aRhs.m_item );
125 }
126
128 {
129 if( this == &aItemData )
130 return *this;
131
132 m_sheetPath = aItemData.m_sheetPath;
133 m_item = aItemData.m_item;
134
135 return *this;
136 }
137
138private:
141};
142
143
148{
149public:
150 SCH_EDIT_FRAME( KIWAY* aKiway, wxWindow* aParent );
151 ~SCH_EDIT_FRAME() override;
152
153 SCH_SCREEN* GetScreen() const override;
154
155 SELECTION& GetCurrentSelection() override;
156
157 SCHEMATIC& Schematic() const;
158
162 bool GetShowAllPins() const override;
163
167 void SaveProjectLocalSettings() override;
168
174 bool LoadProjectSettings();
175
176 void ShowSchematicSetupDialog( const wxString& aInitialPage = wxEmptyString );
177
178 void LoadSettings( APP_SETTINGS_BASE* aCfg ) override;
179 void SaveSettings( APP_SETTINGS_BASE* aCfg ) override;
180
181 void CreateScreens();
182 void ReCreateHToolbar() override;
183 void ReCreateVToolbar() override;
184 void ReCreateOptToolbar() override;
185
186 void setupUIConditions() override;
187
193 bool IsContentModified() const override;
194
199 void OnModify() override;
200
201 SEVERITY GetSeverity( int aErrorCode ) const override;
202
206 wxString GetScreenDesc() const override;
207 wxString GetFullScreenDesc() const override;
208
227 void ExecuteRemoteCommand( const char* cmdline ) override;
228
229 void KiwayMailIn( KIWAY_EXPRESS& aEvent ) override;
230
235
239 void AutoRotateItem( SCH_SCREEN* aScreen, SCH_ITEM* aItem );
240
244 void ShowFindReplaceDialog( bool aReplace );
245
250
256
257 void ShowFindReplaceStatus( const wxString& aMsg, int aStatusTime );
259
263 void OnFindDialogClose();
264
273 void BreakSegment( SCH_COMMIT* aCommit, SCH_LINE* aSegment, const VECTOR2I& aPoint,
274 SCH_LINE** aNewSegment, SCH_SCREEN* aScreen );
275
284 bool BreakSegments( SCH_COMMIT* aCommit, const VECTOR2I& aPoint, SCH_SCREEN* aScreen );
285
293 bool BreakSegmentsOnJunctions( SCH_COMMIT* aCommit, SCH_SCREEN* aScreen );
294
299 void TestDanglingEnds();
300
310 void SendSelectItemsToPcb( const std::vector<EDA_ITEM*>& aItems, bool aForce );
311
317 void SendCrossProbeNetName( const wxString& aNetName );
318
324 void SetCrossProbeConnection( const SCH_CONNECTION* aConnection );
325
330
331 const wxString& GetHighlightedConnection() const
332 {
333 return m_highlightedConn;
334 }
335
336 void SetHighlightedConnection( const wxString& aConnection,
337 const NET_NAVIGATOR_ITEM_DATA* aSelection = nullptr );
338
347 bool ReadyToNetlist( const wxString& aAnnotateMessage );
348
364 bool WriteNetListFile( int aFormat, const wxString& aFullFileName, unsigned aNetlistOptions,
365 REPORTER* aReporter = nullptr );
366
372 void DeleteAnnotation( ANNOTATE_SCOPE_T aAnnotateScope, bool aRecursive );
373
396 void AnnotateSymbols( SCH_COMMIT* aCommit, ANNOTATE_SCOPE_T aAnnotateScope,
397 ANNOTATE_ORDER_T aSortOption, ANNOTATE_ALGO_T aAlgoOption,
398 bool aRecursive, int aStartNumber, bool aResetAnnotation,
399 bool aRepairTimestamps, REPORTER& aReporter );
400
417 int CheckAnnotate( ANNOTATION_ERROR_HANDLER aErrorHandler,
418 ANNOTATE_SCOPE_T aAnnotateScope = ANNOTATE_ALL,
419 bool aRecursive = true );
420
427 int ModalAnnotate( const wxString& aMessage );
428
429 // Functions used for hierarchy handling
431
432 void SetCurrentSheet( const SCH_SHEET_PATH& aSheet );
433
434 void UpdateItem( EDA_ITEM* aItem, bool isAddOrDelete = false,
435 bool aUpdateRtree = false ) override;
436
440 void HardRedraw() override;
441
445 void DisplayCurrentSheet();
446
451
458 void OnPageSettingsChange() override;
459
466
467 wxPageSetupDialogData& GetPageSetupData() { return m_pageSetupData; }
468
469 void NewProject();
470 void LoadProject();
471
479 bool SaveProject( bool aSaveAs = false );
480
481 bool OpenProjectFiles( const std::vector<wxString>& aFileSet, int aCtl = 0 ) override;
482
483 wxString GetCurrentFileName() const override;
484
490 bool AppendSchematic();
491
500 bool AddSheetAndUpdateDisplay( const wxString aFullFileName );
501
509 bool AskToSaveChanges();
510
511 SCH_JUNCTION* AddJunction( SCH_COMMIT* aCommit, SCH_SCREEN* aScreen, const VECTOR2I& aPos );
512
519 void SchematicCleanUp( SCH_COMMIT* aCommit, SCH_SCREEN* aScreen = nullptr );
520
529 bool TrimWire( SCH_COMMIT* aCommit, const VECTOR2I& aStart, const VECTOR2I& aEnd );
530
531 void OnOpenPcbnew( wxCommandEvent& event );
532 void OnOpenCvpcb( wxCommandEvent& event );
533 void OnUpdatePCB( wxCommandEvent& event );
534 void OnAnnotate( wxCommandEvent& event );
535
543 bool CheckSheetForRecursion( SCH_SHEET* aSheet, SCH_SHEET_PATH* aHierarchy );
544
556 bool AllowCaseSensitiveFileNameClashes( const wxString& aSchematicFileName );
557
586 bool EditSheetProperties( SCH_SHEET* aSheet, SCH_SHEET_PATH* aHierarchy,
587 bool* aClearAnnotationNewItems );
588
589 void InitSheet( SCH_SHEET* aSheet, const wxString& aNewFilename );
590
635 bool LoadSheetFromFile( SCH_SHEET* aSheet, SCH_SHEET_PATH* aHierarchy,
636 const wxString& aFileName );
637
643 void DeleteJunction( SCH_COMMIT* aCommit, SCH_ITEM* aItem );
644
645 void ConvertPart( SCH_SYMBOL* aSymbol );
646
647 void SelectUnit( SCH_SYMBOL* aSymbol, int aUnit );
648
649 void SetAltPinFunction( SCH_PIN* aPin, const wxString& aFunction );
650
651 /* Undo - redo */
652
669 void SaveCopyInUndoList( SCH_SCREEN* aScreen, SCH_ITEM* aItemToCopy, UNDO_REDO aTypeCommand,
670 bool aAppend, bool aDirtyConnectivity = true );
671
680 void SaveCopyInUndoList( const PICKED_ITEMS_LIST& aItemsList, UNDO_REDO aTypeCommand,
681 bool aAppend, bool aDirtyConnectivity = true );
682
689
701 void ClearUndoORRedoList( UNDO_REDO_LIST whichList, int aItemCount = -1 ) override;
702
706 void SaveCopyForRepeatItem( const SCH_ITEM* aItem );
707 void AddCopyForRepeatItem( const SCH_ITEM* aItem );
708
713 const std::vector<std::unique_ptr<SCH_ITEM>>& GetRepeatItems() const
714 {
715 return m_items_to_repeat;
716 }
717
718 EDA_ITEM* GetItem( const KIID& aId ) const override;
719
725
732 bool CreateArchiveLibrary( const wxString& aFileName );
733
737 virtual void PrintPage( const RENDER_SETTINGS* aSettings ) override;
738
739 void SetNetListerCommand( const wxString& aCommand ) { m_netListerCommand = aCommand; }
740
744 void DefaultExecFlags() { m_exec_flags = wxEXEC_SYNC; }
745
751 void SetExecFlags( const int aFlags ) { m_exec_flags |= aFlags; }
752
759 void ClearExecFlags( const int aFlags ) { m_exec_flags &= ~( aFlags ); }
760
761 wxString GetNetListerCommand() const { return m_netListerCommand; }
762
766 void RecalculateConnections( SCH_COMMIT* aCommit, SCH_CLEANUP_FLAGS aCleanupFlags );
767
771 void CommonSettingsChanged( bool aEnvVarsChanged, bool aTextVarsChanged ) override;
772
774
775 void ShowChangedLanguage() override;
776
777 void SetScreen( BASE_SCREEN* aScreen ) override;
778
779 const BOX2I GetDocumentExtents( bool aIncludeAllVisible = true ) const override;
780
782
783 void FocusOnItem( SCH_ITEM* aItem );
784
786
795 void SaveSymbolToSchematic( const LIB_SYMBOL& aSymbol, const KIID& aSchematicSymbolUUID );
796
802
803 void ShowAllIntersheetRefs( bool aShow );
804
811 virtual void CheckForAutoSaveFile( const wxFileName& aFileName ) override;
812
813 virtual void DeleteAutoSaveFile( const wxFileName& aFileName ) override;
814
819
823 void ToggleSearch();
824
825 void ToggleProperties() override;
826
828
830
832
833 wxTreeCtrl* GetNetNavigator() { return m_netNavigator; }
834
836
840 static const wxString SchematicHierarchyPaneName()
841 {
842 return wxT( "SchematicHierarchy" );
843 }
844
848 static const wxString SearchPaneName() { return wxT( "Search" ); }
849
859 void AddSchematicChangeListener( wxEvtHandler* aListener );
860
864 void RemoveSchematicChangeListener( wxEvtHandler* aListener );
865
866 static const wxString NetNavigatorPaneName()
867 {
868 return wxS( "NetNavigator" );
869 }
870
871 void RefreshNetNavigator( const NET_NAVIGATOR_ITEM_DATA* aSelection = nullptr );
872
873 void MakeNetNavigatorNode( const wxString& aNetName, wxTreeItemId aParentId,
874 const NET_NAVIGATOR_ITEM_DATA* aSelection = nullptr );
875
876 void SelectNetNavigatorItem( const NET_NAVIGATOR_ITEM_DATA* aSelection = nullptr );
877
878 void ToggleNetNavigator();
879
880 DECLARE_EVENT_TABLE()
881
882protected:
888 bool doAutoSave() override;
889
890 void doReCreateMenuBar() override;
891
895 void sendNetlistToCvpcb();
896
897 void onSize( wxSizeEvent& aEvent );
898
899 void saveProjectSettings() override;
900
901 void onCloseSymbolDiffDialog( wxCommandEvent& aEvent );
902
903 void onCloseErcDialog( wxCommandEvent& aEvent );
904
905 void onCloseSymbolFieldsTableDialog( wxCommandEvent& aEvent );
906
907 void unitsChangeRefresh() override;
908
909private:
910 // Called when resizing the Hierarchy Navigator panel
911 void OnResizeHierarchyNavigator( wxSizeEvent& aEvent );
912
913 void onResizeNetNavigator( wxSizeEvent& aEvent );
914
915 // Sets up the tool framework
916 void setupTools();
917
918 void OnExit( wxCommandEvent& event );
919
920 void OnLoadFile( wxCommandEvent& event );
921 void OnAppendProject( wxCommandEvent& event );
922 void OnImportProject( wxCommandEvent& event );
923
924 void OnClearFileHistory( wxCommandEvent& aEvent );
925
926 bool canCloseWindow( wxCloseEvent& aCloseEvent ) override;
927 void doCloseWindow() override;
928
937 void updateTitle();
938
942 void initScreenZoom();
943
953
960 bool importFile( const wxString& aFileName, int aFileType,
961 const STRING_UTF8_MAP* aProperties = nullptr );
962
970 bool saveSchematicFile( SCH_SHEET* aSheet, const wxString& aSavePath );
971
977 void mapExistingAnnotation( std::map<wxString, wxString>& aMap );
978
979 bool updateAutoSaveFile();
980
981 const wxString& getAutoSaveFileName() const;
982
983 wxTreeCtrl* createHighlightedNetNavigator();
984
985 void onNetNavigatorSelection( wxTreeEvent& aEvent );
986
987 void onNetNavigatorSelChanging( wxTreeEvent& aEvent );
988
989private:
990 // The schematic editor control class should be able to access some internal
991 // functions of the editor frame.
992 friend class SCH_EDITOR_CONTROL;
994
997
998 wxPageSetupDialogData m_pageSetupData;
999 std::vector<std::unique_ptr<SCH_ITEM>> m_items_to_repeat;
1000
1005
1011
1012
1013 wxTreeCtrl* m_netNavigator;
1014
1015 bool m_syncingPcbToSchSelection; // Recursion guard when synchronizing selection from PCB
1016
1018
1020
1021 std::vector<wxEvtHandler*> m_schematicChangeListeners;
1022};
1023
1024
1025#endif // SCH_EDIT_FRAME_H
APP_SETTINGS_BASE is a settings class that should be derived for each standalone KiCad application.
Definition: app_settings.h:92
Handles how to draw a screen (a board, a schematic ...)
Definition: base_screen.h:41
UNDO_REDO_LIST
Specifies whether we are interacting with the undo or redo stacks.
A base class for most all the KiCad significant classes used in schematics and boards.
Definition: eda_item.h:85
Container for all the knowledge about how graphical objects are drawn on any output surface/device.
Definition: kiid.h:49
Carry a payload from one KIWAY_PLAYER to another within a PROJECT.
Definition: kiway_express.h:39
A minimalistic software bus for communications between various DLLs/DSOs (DSOs) within the same KiCad...
Definition: kiway.h:279
Define a library symbol object.
Definition: lib_symbol.h:99
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 pure virtual class used to derive REPORTER objects from.
Definition: reporter.h:71
Holds all the data relating to one schematic.
Definition: schematic.h:75
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:41
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()
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 operaintg points.
wxPageSetupDialogData m_pageSetupData
void ConvertPart(SCH_SYMBOL *aSymbol)
Definition: picksymbol.cpp:126
SELECTION & GetCurrentSelection() override
Get the current selection from the canvas area.
EDA_ITEM * GetItem(const KIID &aId) const override
Fetch an item by KIID.
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 ToggleNetNavigator()
bool LoadSheetFromFile(SCH_SHEET *aSheet, SCH_SHEET_PATH *aHierarchy, const wxString &aFileName)
Load a the KiCad schematic file aFileName into the sheet aSheet.
Definition: sheet.cpp:158
void onResizeNetNavigator(wxSizeEvent &aEvent)
bool m_highlightedConnChanged
void onNetNavigatorSelChanging(wxTreeEvent &aEvent)
void OnOpenCvpcb(wxCommandEvent &event)
void SetExecFlags(const int aFlags)
Set (adds) specified flags for next execution of external generator of the netlist or bom.
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 doCloseWindow() override
bool AllowCaseSensitiveFileNameClashes(const wxString &aSchematicFileName)
Check aSchematicFileName for a potential file name case sensitivity clashes.
Definition: sheet.cpp:681
DIALOG_BOOK_REPORTER * m_diffSymbolDialog
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 ShowFindReplaceDialog(bool aReplace)
Run the Find or Find & Replace dialog.
void InitSheet(SCH_SHEET *aSheet, const wxString &aNewFilename)
Definition: sheet.cpp:99
void UpdateHierarchySelection()
Update the hierarchy navigation tree selection (cross-probe from schematic to hierarchy pane).
bool m_syncingPcbToSchSelection
bool BreakSegmentsOnJunctions(SCH_COMMIT *aCommit, SCH_SCREEN *aScreen)
Test all junctions and bus entries in the schematic for intersections with wires and buses and breaks...
bool CheckSheetForRecursion(SCH_SHEET *aSheet, SCH_SHEET_PATH *aHierarchy)
Verify that aSheet will not cause a recursion error in aHierarchy.
Definition: sheet.cpp:49
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.
void OnFindDialogClose()
Notification that the Find dialog has closed.
wxString GetNetListerCommand() const
bool doAutoSave() override
Save the schematic files that have been modified and not yet saved.
bool importFile(const wxString &aFileName, int aFileType, const STRING_UTF8_MAP *aProperties=nullptr)
Load the given filename but sets the path to the current project path.
void SaveSymbolToSchematic(const LIB_SYMBOL &aSymbol, const KIID &aSchematicSymbolUUID)
Update a schematic symbol from a LIB_SYMBOL.
void SchematicCleanUp(SCH_COMMIT *aCommit, SCH_SCREEN *aScreen=nullptr)
Perform routine schematic cleaning including breaking wire and buses and deleting identical objects s...
void onSize(wxSizeEvent &aEvent)
void SetAltPinFunction(SCH_PIN *aPin, const wxString &aFunction)
Definition: picksymbol.cpp:165
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.
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:193
void SendCrossProbeClearHighlight()
Tell Pcbnew to clear the existing highlighted net, if one exists.
void CommonSettingsChanged(bool aEnvVarsChanged, bool aTextVarsChanged) override
Called after the preferences dialog is run.
void HardRedraw() override
Rebuild the GAL and redraw the screen.
void OnClearFileHistory(wxCommandEvent &aEvent)
bool GetShowAllPins() const override
Allow edit frame to show/hide hidden pins.
void OnAppendProject(wxCommandEvent &event)
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)
void ClearFindReplaceStatus()
SCH_SHEET_PATH & GetCurrentSheet() const
void ReCreateVToolbar() override
void OnLoadFile(wxCommandEvent &event)
const SCH_ITEM * GetSelectedNetNavigatorItem() const
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 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:601
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()
void OnUpdatePCB(wxCommandEvent &event)
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:77
DIALOG_ERC * GetErcDialog()
void sendNetlistToCvpcb()
Send the KiCad netlist over to CVPCB.
bool BreakSegments(SCH_COMMIT *aCommit, const VECTOR2I &aPoint, SCH_SCREEN *aScreen)
Check every wire and bus for a intersection at aPoint and break into two segments at aPoint if an int...
void OnOpenPcbnew(wxCommandEvent &event)
void ToggleSchematicHierarchy()
Toggle the show/hide state of the left side schematic navigation panel.
void OnAnnotate(wxCommandEvent &event)
void SendCrossProbeNetName(const wxString &aNetName)
Send a net name to Pcbnew for highlighting.
void DeleteAnnotation(ANNOTATE_SCOPE_T aAnnotateScope, bool aRecursive)
Clear the current symbol annotation.
Definition: annotate.cpp:61
virtual void DeleteAutoSaveFile(const wxFileName &aFileName) override
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.
void OnPageSettingsChange() override
Called when modifying the page settings.
bool AddSheetAndUpdateDisplay(const wxString aFullFileName)
Add a sheet file into the current sheet and updates display.
void SelectUnit(SCH_SYMBOL *aSymbol, int aUnit)
Definition: picksymbol.cpp:93
const BOX2I GetDocumentExtents(bool aIncludeAllVisible=true) const override
Returns bbox of document with option to not include some items.
void RecalculateConnections(SCH_COMMIT *aCommit, SCH_CLEANUP_FLAGS aCleanupFlags)
Generate the connection data for the entire schematic hierarchy.
void initScreenZoom()
Initialize the zoom value of the current screen and mark the screen as zoom-initialized.
bool EditSheetProperties(SCH_SHEET *aSheet, SCH_SHEET_PATH *aHierarchy, bool *aClearAnnotationNewItems)
Edit an existing sheet or add a new sheet to the schematic.
Definition: sheet.cpp:585
void OnImportProject(wxCommandEvent &event)
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.
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:441
void RemoveSchematicChangeListener(wxEvtHandler *aListener)
Remove aListener to from the schematic changed listener list.
void ReCreateOptToolbar() override
void ShowFindReplaceStatus(const wxString &aMsg, int aStatusTime)
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)
void BreakSegment(SCH_COMMIT *aCommit, SCH_LINE *aSegment, const VECTOR2I &aPoint, SCH_LINE **aNewSegment, SCH_SCREEN *aScreen)
Break a single segment into two at the specified point.
virtual void PrintPage(const RENDER_SETTINGS *aSettings) override
Plot or print the current sheet to the clipboard.
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
bool AppendSchematic()
Import a KiCad schematic into the current sheet.
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.
DIALOG_SCH_FIND * m_findReplaceDialog
void UpdateHierarchyNavigator()
Update the hierarchy navigation tree and history.
void SelectNetNavigatorItem(const NET_NAVIGATOR_ITEM_DATA *aSelection=nullptr)
void AddCopyForRepeatItem(const SCH_ITEM *aItem)
DIALOG_SYMBOL_FIELDS_TABLE * GetSymbolFieldsTableDialog()
void OnResizeHierarchyNavigator(wxSizeEvent &aEvent)
wxString GetCurrentFileName() const override
Get the full filename + path of the currently opened file in the frame.
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)
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 saveProjectSettings() override
Saves any design-related project settings associated with this frame.
void OnExit(wxCommandEvent &event)
void MakeNetNavigatorNode(const wxString &aNetName, wxTreeItemId aParentId, const NET_NAVIGATOR_ITEM_DATA *aSelection=nullptr)
void DeleteJunction(SCH_COMMIT *aCommit, SCH_ITEM *aItem)
Removes 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
SEVERITY GetSeverity(int aErrorCode) const override
void onNetNavigatorSelection(wxTreeEvent &aEvent)
void ReCreateHToolbar() override
void FocusOnItem(SCH_ITEM *aItem)
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.
Instances are attached to a symbol or sheet and provide a place for the symbol's value,...
Definition: sch_field.h:52
Handle actions specific to the schematic editor.
Base class for any item which can be embedded within the SCHEMATIC container class,...
Definition: sch_item.h:151
Segment description base class to describe items which have 2 end points (track, wire,...
Definition: sch_line.h:40
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:57
Schematic symbol object.
Definition: sch_symbol.h:81
A name/value tuple with unique names and optional values.
Base window classes and related definitions.
STL namespace.
SEVERITY
wxDECLARE_EVENT(EDA_EVT_SCHEMATIC_CHANGED, wxCommandEvent)
SCH_CLEANUP_FLAGS
@ LOCAL_CLEANUP
@ NO_CLEANUP
@ GLOBAL_CLEANUP
SCH_SEARCH_T
Schematic search type used by the socket link with Pcbnew.
@ HIGHLIGHT_SYMBOL
@ HIGHLIGHT_PIN
SYMBOL_ORIENTATION_T
enum used in RotationMiroir()
@ SYM_ORIENT_270
@ SYM_ROTATE_CLOCKWISE
@ SYM_ROTATE_COUNTERCLOCKWISE
@ SYM_MIRROR_Y
@ SYM_ORIENT_180
@ SYM_MIRROR_X
@ SYM_NORMAL
@ SYM_ORIENT_90
@ SYM_ORIENT_0
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.
UNDO_REDO
Undo Redo considerations: Basically we have 3 cases New item Deleted item Modified item there is also...