KiCad PCB EDA Suite
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 <stambaughw@gmail.com>
6  * Copyright (C) 2004-2019 KiCad Developers, see AUTHORS.txt for contributors.
7  *
8  * This program is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU General Public License
10  * as published by the Free Software Foundation; either version 2
11  * of the License, or (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program; if not, you may find one here:
20  * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
21  * or you may search the http://www.gnu.org website for the version 2 license,
22  * or you may write to the Free Software Foundation, Inc.,
23  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
24  */
25 
26 #ifndef SCH_EDIT_FRAME_H
27 #define SCH_EDIT_FRAME_H
28 
29 #include <stddef.h>
30 #include <vector>
31 #include <wx/cmndata.h>
32 #include <wx/event.h>
33 #include <wx/gdicmn.h>
34 #include <wx/string.h>
35 #include <wx/utils.h>
36 
37 #include <config_params.h>
38 #include <core/typeinfo.h>
39 #include <eda_base_frame.h>
40 #include <erc_settings.h>
41 #include <math/box2.h>
42 #include <sch_base_frame.h>
43 #include <sch_text.h> // enum PINSHEETLABEL_SHAPE
44 #include <template_fieldnames.h>
45 #include <undo_redo_container.h>
46 
47 class STATUS_TEXT_POPUP;
48 
49 class APP_SETTINGS_BASE;
50 class SCH_ITEM;
51 class EDA_ITEM;
52 class SCH_LINE;
53 class SCH_TEXT;
54 class SCH_BITMAP;
55 class SCH_SHEET;
56 class SCH_SHEET_PATH;
57 class SCH_SHEET_PIN;
58 class SCH_COMPONENT;
59 class SCH_FIELD;
60 class SCH_JUNCTION;
61 class DIALOG_SCH_FIND;
62 class wxFindDialogEvent;
63 class wxFindReplaceData;
64 class RESCUER;
66 
69  CMP_NORMAL, // Normal orientation, no rotation or mirror
70  CMP_ROTATE_CLOCKWISE, // Rotate -90
72  CMP_ORIENT_0, // No rotation and no mirror id CMP_NORMAL
73  CMP_ORIENT_90, // Rotate 90, no mirror
74  CMP_ORIENT_180, // Rotate 180, no mirror
75  CMP_ORIENT_270, // Rotate -90, no mirror
76  CMP_MIRROR_X = 0x100, // Mirror around X axis
77  CMP_MIRROR_Y = 0x200 // Mirror around Y axis
78 };
79 
80 
86 };
88 
89 
96 };
98 
99 
104 };
105 
106 
111 };
112 
113 
118 {
119  // The schematic editor control class should be able to access some internal
120  // functions of the editor frame.
121  friend class SCH_EDITOR_CONTROL;
122 
123 private:
125 
126  std::vector<PARAM_CFG*> m_projectFileParams;
127  std::vector<PARAM_CFG*> m_configSettings;
128  wxPageSetupDialogData m_pageSetupData;
134  int m_exec_flags;
136 
139 
147 
150 
151  bool m_showAllPins; // show hidden pins
152  bool m_selectPinSelectSymbol; // select parent when clicking on pin
153 
155  wxString m_netListFormat;
156 
159 
160  /* these are PROJECT specific, not schematic editor specific
161  wxString m_userLibraryPath;
162  wxArrayString m_componentLibFiles;
163  */
164 
166  static wxSize m_lastSheetPinTextSize;
168 
169 protected:
173  const wxSize &GetLastSheetPinTextSize();
174 
180  bool doAutoSave() override;
181 
185  bool isAutoSaveRequired() const override;
186 
193  bool prepareForNetlist();
194 
198  void sendNetlistToCvpcb();
199 
200 public:
201  SCH_EDIT_FRAME( KIWAY* aKiway, wxWindow* aParent );
202  ~SCH_EDIT_FRAME() override;
203 
204  SCH_SCREEN* GetScreen() const override;
205 
206  void OnCloseWindow( wxCloseEvent& Event );
207 
208  bool GetForceHVLines() const { return m_forceHVLines; }
209  void SetForceHVLines( bool aForceHVdirection ) { m_forceHVLines = aForceHVdirection; }
210 
211  bool GetShowAllPins() const override { return m_showAllPins; }
212  void SetShowAllPins( bool aEnable ) { m_showAllPins = aEnable; }
213 
214  bool GetSelectPinSelectSymbol() const override { return m_selectPinSelectSymbol; }
215  void SetSelectPinSelectSymbol( bool aEnable ) { m_selectPinSelectSymbol = aEnable; }
216 
218  void SetShowFootprintPreviews( bool aEnable ) { m_footprintPreview = aEnable; }
219 
221  {
222  return m_navigatorStaysOpen;
223  }
224  void SetNavigatorStaysOpen( bool aEnable )
225  {
226  m_navigatorStaysOpen = aEnable;
227  }
228 
229  bool GetAutoplaceFields() const { return m_autoplaceFields; }
230  void SetAutoplaceFields( bool aEnable ) { m_autoplaceFields = aEnable; }
231 
232  bool GetAutoplaceAlign() const { return m_autoplaceAlign; }
233  void SetAutoplaceAlign( bool aEnable ) { m_autoplaceAlign = aEnable; }
234 
235  bool GetAutoplaceJustify() const { return m_autoplaceJustify; }
236  void SetAutoplaceJustify( bool aEnable ) { m_autoplaceJustify = aEnable; }
237 
238  const wxString& GetNetListFormatName() const { return m_netListFormat; }
239  void SetNetListFormatName( const wxString& aFormat ) { m_netListFormat = aFormat; }
240 
242  void SetSpiceAdjustPassiveValues( bool aEnable ) { m_spiceAjustPassiveValues = aEnable; }
243 
245  const wxString& GetPlotDirectoryName() const { return m_plotDirectoryName; }
246  void SetPlotDirectoryName( const wxString& aDirName ) { m_plotDirectoryName = aDirName; }
247 
248  void AddFormattingParameters( std::vector<PARAM_CFG*>& params );
249 
256  std::vector<PARAM_CFG*>& GetProjectFileParameters();
257 
261  void SaveProjectSettings() override;
262 
268  bool LoadProjectFile();
269 
270  void DoShowSchematicSetupDialog( const wxString& aInitialPage = wxEmptyString,
271  const wxString& aInitialParentPage = wxEmptyString );
272 
283  void AddTemplateFieldName( const TEMPLATE_FIELDNAME& aFieldName, bool aGlobal )
284  {
285  m_templateFieldNames.AddTemplateFieldName( aFieldName, aGlobal );
286  }
287 
291  void DeleteAllTemplateFieldNames( bool aGlobal )
292  {
294  }
295 
296  void LoadSettings( APP_SETTINGS_BASE* aCfg ) override;
297  void SaveSettings( APP_SETTINGS_BASE* aCfg ) override;
298 
299  void CreateScreens();
300  void ReCreateHToolbar() override;
301  void ReCreateVToolbar() override;
302  void ReCreateOptToolbar() override;
303  void ReCreateMenuBar() override;
304 
310  bool IsContentModified() override;
311 
316  void OnModify() override;
317 
321  wxString GetScreenDesc() const override;
322 
329  void ExecuteRemoteCommand( const char* cmdline ) override;
330 
331  void KiwayMailIn( KIWAY_EXPRESS& aEvent ) override;
332 
337  void AddItemToScreenAndUndoList( SCH_ITEM* aItem, bool aUndoAppend = false );
338 
342  void ShowFindReplaceDialog( bool aReplace );
343 
349  void UpdateHierarchyNavigator( bool aForceUpdate = false );
350 
355 
356  void ShowFindReplaceStatus( const wxString& aMsg );
357  void ClearFindReplaceStatus();
358 
362  wxFindReplaceData* GetFindReplaceData();
363 
367  void OnFindDialogClose();
368 
380  bool BreakSegment( SCH_LINE* aSegment, const wxPoint& aPoint,
381  SCH_LINE** aNewSegment = NULL, SCH_SCREEN* aScreen = nullptr );
382 
393  bool BreakSegments( const wxPoint& aPoint, SCH_SCREEN* aScreen = nullptr );
394 
404  bool BreakSegmentsOnJunctions( SCH_SCREEN* aScreen = nullptr );
405 
410  bool TestDanglingEnds();
411 
424  void SendMessageToPCBNEW( EDA_ITEM* aObjectToSync, SCH_COMPONENT* aPart );
425 
431  void SendCrossProbeNetName( const wxString& aNetName );
432 
437 
438  const wxString& GetSelectedNetName() const { return m_SelectedNetName; }
439  void SetSelectedNetName( const wxString& aNetName ) { m_SelectedNetName = aNetName; }
440 
447  NETLIST_OBJECT_LIST* BuildNetListBase( bool updateStatusText = true );
448 
460  NETLIST_OBJECT_LIST* CreateNetlist( bool aSilent = false,
461  bool aSilentAnnotate = false );
462 
480  bool WriteNetListFile( NETLIST_OBJECT_LIST* aConnectedItemsList,
481  int aFormat,
482  const wxString& aFullFileName,
483  unsigned aNetlistOptions,
484  REPORTER* aReporter = NULL );
485 
492  void DeleteAnnotation( bool aCurrentSheetOnly );
493 
522  void AnnotateComponents( bool aAnnotateSchematic, ANNOTATE_ORDER_T aSortOption,
523  ANNOTATE_OPTION_T aAlgoOption, int aStartNumber,
524  bool aResetAnnotation, bool aRepairTimestamps, bool aLockUnits,
525  REPORTER& aReporter );
526 
543  int CheckAnnotate( REPORTER& aReporter, bool aOneSheetOnly );
544 
550  int ModalAnnotate( const wxString& aMessage );
551 
552  // Functions used for hierarchy handling
554 
555  void SetCurrentSheet( const SCH_SHEET_PATH& aSheet );
556 
560  void HardRedraw() override;
561 
565  void DisplayCurrentSheet();
566 
572 
578  void OnPageSettingsChange() override;
579 
591 
597  void SetSheetNumberAndCount();
598 
602  void Print();
603 
604  wxPageSetupDialogData& GetPageSetupData() { return m_pageSetupData; }
605 
607  void SetPrintMonochrome( bool aMonochrome ) { m_printMonochrome = aMonochrome; }
609  void SetPrintSheetReference( bool aShow ) { m_printSheetReference = aShow; }
610 
611  // Plot functions:
612  void PlotSchematic();
613 
614  void NewProject();
615  void LoadProject();
616 
617  void Save_File( bool doSaveAs = false );
618 
619  bool SaveProject();
620 
621  bool OpenProjectFiles( const std::vector<wxString>& aFileSet, int aCtl = 0 ) override;
622 
628  bool AppendSchematic();
629 
643  bool SaveEEFile( SCH_SCREEN* aScreen,
644  bool aSaveUnderNewName = false,
645  bool aCreateBackupFile = CREATE_BACKUP_FILE );
646 
647 
655  bool AskToSaveChanges();
656 
657  SCH_JUNCTION* AddJunction( const wxPoint& aPos, bool aAppendToUndo = false,
658  bool aFinal = true );
659 
665 
666  SCH_TEXT* CreateNewText( int aType );
667 
677  bool SchematicCleanUp( SCH_SCREEN* aScreen = nullptr );
678 
689  bool TrimWire( const wxPoint& aStart, const wxPoint& aEnd );
690 
696  void GetSchematicConnections( std::vector< wxPoint >& aConnections );
697 
698  void OnOpenPcbnew( wxCommandEvent& event );
699  void OnOpenCvpcb( wxCommandEvent& event );
700  void OnRescueProject( wxCommandEvent& event );
701  void OnRemapSymbols( wxCommandEvent& aEvent );
702  void OnUpdatePCB( wxCommandEvent& event );
703  void OnAnnotate( wxCommandEvent& event );
704 
705 private:
706  // Sets up the tool framework
707  void setupTools();
708 
709  void OnExit( wxCommandEvent& event );
710 
711  void OnLoadFile( wxCommandEvent& event );
712  void OnAppendProject( wxCommandEvent& event );
713  void OnImportProject( wxCommandEvent& event );
714 
715  void OnClearFileHistory( wxCommandEvent& aEvent );
716 
725  void UpdateTitle();
726 
735  bool checkForNoFullyDefinedLibIds( SCH_SHEET* aSheet );
736 
743  bool importFile( const wxString& aFileName, int aFileType );
744 
745 public:
754  bool CheckSheetForRecursion( SCH_SHEET* aSheet, SCH_SHEET_PATH* aHierarchy );
755 
767  bool AllowCaseSensitiveFileNameClashes( const wxString& aSchematicFileName );
768 
779  void ConvertTextType( SCH_TEXT* aText, KICAD_T aNewType );
780 
809  bool EditSheetProperties( SCH_SHEET* aSheet, SCH_SHEET_PATH* aHierarchy, bool* aClearAnnotationNewItems );
810 
811  void InitSheet( SCH_SHEET* aSheet, const wxString& aNewFilename );
812 
857  bool LoadSheetFromFile( SCH_SHEET* aSheet, SCH_SHEET_PATH* aHierarchy,
858  const wxString& aFileName );
859 
867 
874 
881  void DeleteJunction( SCH_ITEM* aItem, bool aAppend = false );
882 
883  int GetLabelIncrement() const { return m_repeatLabelDelta; }
884 
885  void ConvertPart( SCH_COMPONENT* aComponent );
886 
887  void SelectUnit( SCH_COMPONENT* aComponent, int aUnit );
888 
889  /* Undo - redo */
890 
918  void SaveCopyInUndoList( SCH_ITEM* aItemToCopy,
919  UNDO_REDO_T aTypeCommand,
920  bool aAppend = false,
921  const wxPoint& aTransformPoint = wxPoint( 0, 0 ) );
922 
932  void SaveCopyInUndoList( const PICKED_ITEMS_LIST& aItemsList,
933  UNDO_REDO_T aTypeCommand,
934  bool aAppend = false,
935  const wxPoint& aTransformPoint = wxPoint( 0, 0 ) );
936 
943  void PutDataInPreviousState( PICKED_ITEMS_LIST* aList, bool aRedoCommand );
944 
948  void SaveCopyForRepeatItem( SCH_ITEM* aItem );
949 
956 
962 
972  bool CreateArchiveLibraryCacheFile( bool aUseCurrentSheetFilename = false );
973 
980  bool CreateArchiveLibrary( const wxString& aFileName );
981 
995  bool rescueProject( RESCUER& aRescuer, bool aRunningOnDemand );
996  bool RescueLegacyProject( bool aRunningOnDemand );
997  bool RescueSymbolLibTableProject( bool aRunningOnDemand );
998 
1004  virtual void PrintPage( wxDC* aDC ) override;
1005 
1006  void SetNetListerCommand( const wxString& aCommand ) { m_netListerCommand = aCommand; }
1007 
1011  void DefaultExecFlags() { m_exec_flags = wxEXEC_SYNC; }
1012 
1018  void SetExecFlags( const int aFlags ) { m_exec_flags |= aFlags; }
1019 
1026  void ClearExecFlags( const int aFlags ) { m_exec_flags &= ~( aFlags ); }
1027 
1028  wxString GetNetListerCommand() const { return m_netListerCommand; }
1029 
1033  void RecalculateConnections( SCH_CLEANUP_FLAGS aCleanupFlags );
1034 
1038  void InstallPreferences( PAGED_DIALOG* aParent, PANEL_HOTKEYS_EDITOR* aHotkeysPanel ) override;
1039 
1043  void CommonSettingsChanged( bool aEnvVarsChanged ) override;
1044 
1045  void ShowChangedLanguage() override;
1046 
1047  void SyncToolbars() override;
1048 
1049  void SetScreen( BASE_SCREEN* aScreen ) override;
1050 
1051  const BOX2I GetDocumentExtents() const override;
1052 
1053  void FixupJunctions();
1054 
1055  DECLARE_EVENT_TABLE()
1056 };
1057 
1058 
1059 #endif // SCH_EDIT_FRAME_H
void SetCurrentSheet(const SCH_SHEET_PATH &aSheet)
bool GetAutoplaceJustify() const
bool CheckSheetForRecursion(SCH_SHEET *aSheet, SCH_SHEET_PATH *aHierarchy)
Verify that aSheet will not cause a recursion error in aHierarchy.
Definition: sheet.cpp:44
wxString m_netListerCommand
Command line to call a custom net list generator.
SCH_FIELD instances are attached to a component and provide a place for the component's value,...
Definition: sch_field.h:52
void OnOpenCvpcb(wxCommandEvent &event)
void Save_File(bool doSaveAs=false)
bool SchematicCleanUp(SCH_SCREEN *aScreen=nullptr)
Performs routine schematic cleaning including breaking wire and buses and deleting identical objects ...
STATUS_TEXT_POPUP * m_findReplaceStatusPopup
KIWAY_EXPRESS carries a payload from one KIWAY_PLAYER to another within a PROJECT.
Definition: kiway_express.h:39
void DefaultExecFlags()
Reset the execution flags to defaults for external netlist and bom generators.
HIERARCHY_NAVIG_DLG * FindHierarchyNavigator()
bool OpenProjectFiles(const std::vector< wxString > &aFileSet, int aCtl=0) override
Function OpenProjectFiles is abstract, and opens a project or set of files given by aFileList.
const wxString & GetSelectedNetName() const
NETLIST_OBJECT_LIST * BuildNetListBase(bool updateStatusText=true)
Create a flat list which stores all connected objects.
void OnLoadFile(wxCommandEvent &event)
wxFindReplaceData * GetFindReplaceData()
Get the find criteria (as set by the dialog).
SCH_TEXT * CreateNewText(int aType)
Definition: edit_label.cpp:61
void SendCrossProbeNetName(const wxString &aNetName)
Sends a net name to pcbnew for highlighting.
void SetPlotDirectoryName(const wxString &aDirName)
void GetSchematicConnections(std::vector< wxPoint > &aConnections)
Collects a unique list of all possible connection points in the schematic.
void RecalculateConnections(SCH_CLEANUP_FLAGS aCleanupFlags)
Generates the connection data for the entire schematic hierarchy.
void SaveProjectSettings() override
Save changes to the project settings to the project (.pro) file.
COMPONENT_ORIENTATION_T
enum used in RotationMiroir()
void SetForceHVLines(bool aForceHVdirection)
ANNOTATE_ORDER_T
Schematic annotation order options.
bool BreakSegments(const wxPoint &aPoint, SCH_SCREEN *aScreen=nullptr)
Checks every wire and bus for a intersection at aPoint and break into two segments at aPoint if an in...
void SetScreen(BASE_SCREEN *aScreen) override
bool BreakSegment(SCH_LINE *aSegment, const wxPoint &aPoint, SCH_LINE **aNewSegment=NULL, SCH_SCREEN *aScreen=nullptr)
Breaks a single segment into two at the specified point.
void ReCreateMenuBar() override
Recreates the menu bar.
static wxSize m_lastSheetPinTextSize
Last sheet pin text size.
bool GetPrintMonochrome()
STATUS_TEXT_POPUP.
Definition: status_popup.h:79
UNDO_REDO_T
Undo Redo considerations: Basically we have 3 cases New item Deleted item Modified item there is also...
void SetAutoplaceAlign(bool aEnable)
bool GetShowFootprintPreviews() const
void AddTemplateFieldName(const TEMPLATE_FIELDNAME &aFieldName, bool aGlobal)
Function AddTemplateFieldName inserts or appends a wanted symbol field name into the fieldnames templ...
void SendCrossProbeClearHighlight()
Tells PcbNew to clear the existing highlighted net, if one exists.
void AnnotateComponents(bool aAnnotateSchematic, ANNOTATE_ORDER_T aSortOption, ANNOTATE_OPTION_T aAlgoOption, int aStartNumber, bool aResetAnnotation, bool aRepairTimestamps, bool aLockUnits, REPORTER &aReporter)
Annotate the components in the schematic that are not currently annotated.
bool AskToSaveChanges()
Checks if any of the screens has unsaved changes and asks the user whether to save or drop them.
const wxString & GetNetListFormatName() const
TEMPLATES m_templateFieldNames
void SetNavigatorStaysOpen(bool aEnable)
void AddFormattingParameters(std::vector< PARAM_CFG * > &params)
void OnCloseWindow(wxCloseEvent &Event)
void UpdateTitle()
Set the main window title bar text.
Annotate incrementally using the first free reference number.
void OnAppendProject(wxCommandEvent &event)
std::vector< PARAM_CFG * > m_projectFileParams
void CommonSettingsChanged(bool aEnvVarsChanged) override
Called after the preferences dialog is run.
void InitSheet(SCH_SHEET *aSheet, const wxString &aNewFilename)
Definition: sheet.cpp:93
int m_repeatLabelDelta
Repeat label number increment step.
bool GetPrintSheetReference()
void DrawCurrentSheetToClipboard()
Use the wxWidgets print code to draw an image of the current sheet onto the clipboard.
Definition: sheet.cpp:565
SCH_CLEANUP_FLAGS
Schematic editor (Eeschema) main window.
bool TestDanglingEnds()
Test all of the connectable objects in the schematic for unused connection points.
void SetPrintSheetReference(bool aShow)
void OnPageSettingsChange() override
Called when modifying the page settings.
void DeleteAllTemplateFieldNames(bool aGlobal)
Remove all global or project fieldname templates.
void SetPrintMonochrome(bool aMonochrome)
void OnRescueProject(wxCommandEvent &event)
void DisplayCurrentSheet()
Draw the current sheet on the display.
Definition: hierarch.cpp:218
bool m_autoplaceAlign
align autoplaced fields to the grid
REPORTER is a pure virtual class used to derive REPORTER objects from.
Definition: reporter.h:62
std::vector< PARAM_CFG * > & GetProjectFileParameters()
Return the project file parameter list for Eeschema.
void DeleteAllFieldNameTemplates(bool aGlobal)
Function DeleteAllFieldNameTemplates deletes the entire contents.
void OnFindDialogClose()
Notification that the Find dialog has closed.
bool GetAutoplaceFields() const
bool importFile(const wxString &aFileName, int aFileType)
Load the given filename but sets the path to the current project path.
void SetSpiceAdjustPassiveValues(bool aEnable)
bool m_selectPinSelectSymbol
void SetAutoplaceJustify(bool aEnable)
KICAD_T
Enum KICAD_T is the set of class identification values, stored in EDA_ITEM::m_StructType.
Definition: typeinfo.h:78
bool m_showSheetFileNameCaseSensitivityDlg
void OnImportProject(wxCommandEvent &event)
NETLIST_OBJECT_LIST is a container holding and owning NETLIST_OBJECTs, which are connected items in a...
SCH_SCREEN * GetScreen() const override
Return a pointer to a BASE_SCREEN or one of its derivatives.
wxString GetScreenDesc() const override
Return a human-readable description of the current screen.
SCH_EDITOR_CONTROL.
const BOX2I GetDocumentExtents() const override
void ShowChangedLanguage() override
Redraw the menus and what not in current language.
void OnClearFileHistory(wxCommandEvent &aEvent)
void SendMessageToPCBNEW(EDA_ITEM *aObjectToSync, SCH_COMPONENT *aPart)
Send a message to Pcbnew via a socket connection.
bool m_forceHVLines
force H or V directions for wires, bus, line
void ReCreateHToolbar() override
bool m_footprintPreview
whether to show footprint previews
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:102
bool AllowCaseSensitiveFileNameClashes(const wxString &aSchematicFileName)
Check aSchematicFileName for a potential file name case sensitivity clashes.
Definition: sheet.cpp:637
APP_SETTINGS_BASE is a settings class that should be derived for each standalone KiCad application.
Definition: app_settings.h:75
#define NULL
static PINSHEETLABEL_SHAPE m_lastSheetPinType
Last sheet pin type.
void DeleteAnnotation(bool aCurrentSheetOnly)
Clear the current component annotation.
void HardRedraw() override
Rebuild the GAL and redraw the screen.
wxPageSetupDialogData m_pageSetupData
bool prepareForNetlist()
Verify that annotation is complete so that a proper netlist is even possible.
std::vector< PARAM_CFG * > m_configSettings
bool GetForceHVLines() const
BASE_SCREEN handles how to draw a screen (a board, a schematic ...)
Definition: base_screen.h:74
bool GetNavigatorStaysOpen() const
Annotate by position of component in the schematic sheet object list.
SCH_SHEET_PATH & GetCurrentSheet()
void SaveCopyInUndoList(SCH_ITEM *aItemToCopy, UNDO_REDO_T aTypeCommand, bool aAppend=false, const wxPoint &aTransformPoint=wxPoint(0, 0))
Create a copy of the current schematic item, and put it in the undo list.
const wxString & GetPlotDirectoryName() const
accessor to the destination directory to use when generating plot files.
void UpdateHierarchyNavigator(bool aForceUpdate=false)
Run the Hierarchy Navigator dialog.
Base window classes and related definitions.
void SaveCopyForRepeatItem(SCH_ITEM *aItem)
Clone aItem and owns that clone in this container.
bool AppendSchematic()
Import a KiCad schematic into the current sheet.
bool SaveEEFile(SCH_SCREEN *aScreen, bool aSaveUnderNewName=false, bool aCreateBackupFile=CREATE_BACKUP_FILE)
Save aScreen to a schematic file.
bool CreateArchiveLibraryCacheFile(bool aUseCurrentSheetFilename=false)
Create a symbol library file with the name of the root document plus the '-cache' suffix,...
Definition: libarch.cpp:42
const wxSize & GetLastSheetPinTextSize()
Initializing accessor for the pin text size.
Definition: sheet.cpp:499
SCH_JUNCTION * AddJunction(const wxPoint &aPos, bool aAppendToUndo=false, bool aFinal=true)
void KiwayMailIn(KIWAY_EXPRESS &aEvent) override
Function KiwayMailIn receives KIWAY_EXPRESS messages from other players.
KIWAY is a minimalistic software bus for communications between various DLLs/DSOs (DSOs) within the s...
Definition: kiway.h:273
ANNOTATE_OPTION_T
Schematic annotation type options.
SCH_ITEM * m_item_to_repeat
Last item to insert by the repeat command.
DIALOG_SCH_FIND * m_findReplaceDialog
void DoShowSchematicSetupDialog(const wxString &aInitialPage=wxEmptyString, const wxString &aInitialParentPage=wxEmptyString)
bool LoadProjectFile()
Loads the KiCad project file (*.pro) settings specific to Eeschema.
Define a sheet pin (label) used in sheets to create hierarchical schematics.
Definition: sch_sheet.h:84
bool isAutoSaveRequired() const override
Returns true if the schematic has been modified.
SCH_SHEET_PATH.
wxPageSetupDialogData & GetPageSetupData()
bool m_printMonochrome
Print monochrome instead of grey scale.
PICKED_ITEMS_LIST is a holder to handle information on schematic or board items.
SCH_TEXT * GetNextNewText()
Gets the next queued text item.
Definition: edit_label.cpp:49
void OnUpdatePCB(wxCommandEvent &event)
void ReCreateOptToolbar() override
Object to handle a bitmap image that can be inserted in a schematic.
Definition: sch_bitmap.h:42
int GetLabelIncrement() const
void SelectUnit(SCH_COMPONENT *aComponent, int aUnit)
Definition: getpart.cpp:204
bool m_autoplaceFields
automatically place component fields
void SetShowFootprintPreviews(bool aEnable)
int CheckAnnotate(REPORTER &aReporter, bool aOneSheetOnly)
Check for annotation errors.
Sheet symbol placed in a schematic, and is the entry point for a sub schematic.
Definition: sch_sheet.h:215
bool m_showIllegalSymbolLibDialog
void PutDataInPreviousState(PICKED_ITEMS_LIST *aList, bool aRedoCommand)
Restore an undo or redo command to put data pointed by aList in the previous state.
bool doAutoSave() override
Save the schematic files that have been modified and not yet saved.
Annotate by Y position from top to bottom.
bool BreakSegmentsOnJunctions(SCH_SCREEN *aScreen=nullptr)
Tests all junctions and bus entries in the schematic for intersections with wires and buses and break...
void OnAnnotate(wxCommandEvent &event)
bool m_printSheetReference
wxString m_SelectedNetName
Annotate using the first free reference number starting at the sheet number * 100.
void OnRemapSymbols(wxCommandEvent &aEvent)
virtual void PrintPage(wxDC *aDC) override
Plot or print the current sheet to the clipboard.
#define CREATE_BACKUP_FILE
void ClearFindReplaceStatus()
bool m_navigatorStaysOpen
whether to keep Navigator open
void ClearExecFlags(const int aFlags)
Clear (removes) specified flags that not needed for next execution of external generator of the netli...
PINSHEETLABEL_SHAPE
Definition: sch_text.h:163
void SetNetListFormatName(const wxString &aFormat)
SCH_ITEM * GetRepeatItem() const
Return the item which is to be repeated with the insert key.
void AddTemplateFieldName(const TEMPLATE_FIELDNAME &aFieldName, bool aGlobal)
Insert or append a wanted symbol field name into the field names template.
int ModalAnnotate(const wxString &aMessage)
Run a modal version of the Annotate dialog for a specific purpose.
void ConvertTextType(SCH_TEXT *aText, KICAD_T aNewType)
Change a text type to another one.
Definition: edit_label.cpp:190
SCH_SEARCH_T
Schematic search type used by the socket link with Pcbnew.
SCH_HIERLABEL * ImportHierLabel(SCH_SHEET *aSheet)
Import a hierarchical label with no attached sheet pin.
Definition: sheet.cpp:547
void InstallPreferences(PAGED_DIALOG *aParent, PANEL_HOTKEYS_EDITOR *aHotkeysPanel) override
Allows Eeschema to install its preferences panels into the preferences dialog.
void OnExit(wxCommandEvent &event)
Segment description base class to describe items which have 2 end points (track, wire,...
Definition: sch_line.h:38
NETLIST_OBJECT_LIST * CreateNetlist(bool aSilent=false, bool aSilentAnnotate=false)
Create a netlist for the current schematic.
SCH_EDIT_FRAME(KIWAY *aKiway, wxWindow *aParent)
void SetSheetNumberAndCount()
Set the m_ScreenNumber and m_NumberOfScreens members for screens.
wxString m_plotDirectoryName
void LoadSettings(APP_SETTINGS_BASE *aCfg) override
Load common frame parameters from a configuration file.
void DeleteJunction(SCH_ITEM *aItem, bool aAppend=false)
Removes a given junction and heals any wire segments under the junction.
bool m_autoplaceJustify
allow autoplace to change justification
void RollbackSchematicFromUndo()
Performs an undo of the last edit WITHOUT logging a corresponding redo.
void SetAutoplaceFields(bool aEnable)
Annotate by X position from left to right.
Annotate using the first free reference number starting at the sheet number * 1000.
void ShowFindReplaceDialog(bool aReplace)
Run the Find or Find & Replace dialog.
void OnOpenPcbnew(wxCommandEvent &event)
SCH_COMPONENT describes a real schematic component.
Definition: sch_component.h:99
EDA_ITEM is a base class for most all the KiCad significant classes, used in schematics and boards.
Definition: base_struct.h:166
bool RescueSymbolLibTableProject(bool aRunningOnDemand)
~SCH_EDIT_FRAME() override
void ExecuteRemoteCommand(const char *cmdline) override
Execute a remote command send by Pcbnew via a socket, port KICAD_SCH_PORT_SERVICE_NUMBER (currently 4...
wxString GetUniqueFilenameForCurrentSheet()
Struct TEMPLATE_FIELDNAME holds a name of a component's field, field value, and default visibility.
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:479
wxString GetNetListerCommand() const
wxString m_netListFormat
bool TrimWire(const wxPoint &aStart, const wxPoint &aEnd)
If any single wire passes through both points, remove the portion between the two points,...
bool GetAutoplaceAlign() const
void OnModify() override
Must be called after a schematic change in order to set the "modify" flag of the current screen and u...
void Print()
Show the print dialog.
bool GetSelectPinSelectSymbol() const override
Allow some frames to select the parent symbol when trying to select a pin.
bool GetSpiceAjustPassiveValues() const
void SaveSettings(APP_SETTINGS_BASE *aCfg) override
Saves common frame parameters to a configuration data file.
bool IsContentModified() override
Get if the current schematic has been modified but not saved.
bool checkForNoFullyDefinedLibIds(SCH_SHEET *aSheet)
Verify that the symbol library links aSheet and all of it's child sheets have been remapped to the sy...
Definition: sheet.cpp:72
int m_exec_flags
Flags of the wxExecute() function to call a custom net list generator.
bool RescueLegacyProject(bool aRunningOnDemand)
static wxPoint m_lastSheetPinPosition
Last sheet pin position.
bool WriteNetListFile(NETLIST_OBJECT_LIST *aConnectedItemsList, int aFormat, const wxString &aFullFileName, unsigned aNetlistOptions, REPORTER *aReporter=NULL)
Create a netlist file.
bool CreateArchiveLibrary(const wxString &aFileName)
Create a library aFileName that contains all components used in the current schematic.
Definition: libarch.cpp:65
void SetSelectPinSelectSymbol(bool aEnable)
void SetExecFlags(const int aFlags)
Set (adds) specified flags for next execution of external generator of the netlist or bom.
A shim class between EDA_DRAW_FRAME and several derived classes: LIB_EDIT_FRAME, LIB_VIEW_FRAME,...
void ConvertPart(SCH_COMPONENT *aComponent)
Definition: getpart.cpp:243
void ShowFindReplaceStatus(const wxString &aMsg)
void SetSelectedNetName(const wxString &aNetName)
bool m_spiceAjustPassiveValues
Use netcodes (net number) as net names when generating spice net lists.
SCH_ITEM is a base class for any item which can be embedded within the SCHEMATIC container class,...
Definition: sch_item.h:147
void SetNetListerCommand(const wxString &aCommand)
SCH_SHEET_PIN * CreateSheetPin(SCH_SHEET *aSheet, SCH_HIERLABEL *aLabel)
Create a new SCH_SHEET_PIN object and add it to aSheet at the current cursor position.
Definition: sheet.cpp:511
bool GetShowAllPins() const override
Allow some frames to show/hide hidden pins.
void SetShowAllPins(bool aEnable)
void ReCreateVToolbar() override
void SyncToolbars() override
Update the toolbars (mostly settings/check buttons/checkboxes) with the current controller state.
void sendNetlistToCvpcb()
Send the kicad netlist over to CVPCB.
void AddItemToScreenAndUndoList(SCH_ITEM *aItem, bool aUndoAppend=false)
Add an item to the schematic and adds the changes to the undo/redo container.
bool rescueProject(RESCUER &aRescuer, bool aRunningOnDemand)
Perform rescue operations to recover old projects from before certain changes were made.