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 <sch_base_frame.h>
30 #include <config_params.h>
31 #include <undo_redo_container.h>
32 #include <template_fieldnames.h>
33 #include <ee_collectors.h>
34 #include <tool/selection.h>
35 #include <erc_settings.h>
36 #include <sch_draw_panel.h>
37 #include <sch_text.h> // enum PINSHEETLABEL_SHAPE
38 #include <tool/selection.h>
39 #include <status_popup.h>
40 
41 class SCH_ITEM;
42 class EDA_ITEM;
43 class SCH_TEXT;
44 class SCH_BITMAP;
45 class SCH_SHEET;
46 class SCH_SHEET_PATH;
47 class SCH_SHEET_PIN;
48 class SCH_COMPONENT;
49 class SCH_FIELD;
50 class SCH_JUNCTION;
51 class DIALOG_SCH_FIND;
52 class wxFindDialogEvent;
53 class wxFindReplaceData;
54 class RESCUER;
55 
56 
59  CMP_NORMAL, // Normal orientation, no rotation or mirror
60  CMP_ROTATE_CLOCKWISE, // Rotate -90
62  CMP_ORIENT_0, // No rotation and no mirror id CMP_NORMAL
63  CMP_ORIENT_90, // Rotate 90, no mirror
64  CMP_ORIENT_180, // Rotate 180, no mirror
65  CMP_ORIENT_270, // Rotate -90, no mirror
66  CMP_MIRROR_X = 0x100, // Mirror around X axis
67  CMP_MIRROR_Y = 0x200 // Mirror around Y axis
68 };
69 
70 
76 };
78 
79 
86 };
88 
89 
94 };
95 
96 
101 };
102 
103 
108 {
109  // The schematic editor control class should be able to access some internal
110  // functions of the editor frame.
111  friend class SCH_EDITOR_CONTROL;
112 
113 private:
115 
119  wxPageSetupDialogData m_pageSetupData;
126  int m_exec_flags;
128 
131 
138 
141 
144 
147 
149  wxString m_netListFormat;
150 
153 
154  /* these are PROJECT specific, not schematic editor specific
155  wxString m_userLibraryPath;
156  wxArrayString m_componentLibFiles;
157  */
158 
160  static wxSize m_lastSheetPinTextSize;
161  static wxPoint m_lastSheetPinPosition;
162 
163 protected:
167  const wxSize &GetLastSheetPinTextSize();
168 
174  bool doAutoSave() override;
175 
179  bool isAutoSaveRequired() const override;
180 
187  bool prepareForNetlist();
188 
192  void sendNetlistToCvpcb();
193 
194 public:
195  SCH_EDIT_FRAME( KIWAY* aKiway, wxWindow* aParent );
196  ~SCH_EDIT_FRAME() override;
197 
198  SCH_SCREEN* GetScreen() const override;
199 
200  void OnCloseWindow( wxCloseEvent& Event );
201 
202  bool GetForceHVLines() const { return m_forceHVLines; }
203  void SetForceHVLines( bool aForceHVdirection ) { m_forceHVLines = aForceHVdirection; }
204 
205  bool GetShowAllPins() const override { return m_showAllPins; }
206  void SetShowAllPins( bool aEnable ) { m_showAllPins = aEnable; }
207 
209  void SetShowFootprintPreviews( bool aEnable ) { m_footprintPreview = aEnable; }
210 
211  bool GetAutoplaceFields() const { return m_autoplaceFields; }
212  void SetAutoplaceFields( bool aEnable ) { m_autoplaceFields = aEnable; }
213 
214  bool GetAutoplaceAlign() const { return m_autoplaceAlign; }
215  void SetAutoplaceAlign( bool aEnable ) { m_autoplaceAlign = aEnable; }
216 
217  bool GetAutoplaceJustify() const { return m_autoplaceJustify; }
218  void SetAutoplaceJustify( bool aEnable ) { m_autoplaceJustify = aEnable; }
219 
220  const wxString& GetNetListFormatName() const { return m_netListFormat; }
221  void SetNetListFormatName( const wxString& aFormat ) { m_netListFormat = aFormat; }
222 
224  void SetSpiceAdjustPassiveValues( bool aEnable ) { m_spiceAjustPassiveValues = aEnable; }
225 
227  const wxString& GetPlotDirectoryName() const { return m_plotDirectoryName; }
228  void SetPlotDirectoryName( const wxString& aDirName ) { m_plotDirectoryName = aDirName; }
229 
237 
243  void SaveProjectSettings( bool aAskForSave ) override;
244 
250  bool LoadProjectFile();
251 
253 
254  void UpdateErcSettings( const ERC_SETTINGS& aSettings ) { m_ercSettings = aSettings; }
255 
267  int AddTemplateFieldName( const TEMPLATE_FIELDNAME& aFieldName )
268  {
269  return m_templateFieldNames.AddTemplateFieldName( aFieldName );
270  }
271 
276  {
278  }
279 
292 
293  void LoadSettings( wxConfigBase* aCfg ) override;
294  void SaveSettings( wxConfigBase* aCfg ) override;
295 
296  void CreateScreens();
297  void ReCreateHToolbar() override;
298  void ReCreateVToolbar() override;
299  void ReCreateOptToolbar() override;
300  void ReCreateMenuBar() override;
301 
306  void OnModify() override;
307 
311  wxString GetScreenDesc() const override;
312 
319  void ExecuteRemoteCommand( const char* cmdline ) override;
320 
321  void KiwayMailIn( KIWAY_EXPRESS& aEvent ) override;
322 
327  void AddItemToScreenAndUndoList( SCH_ITEM* aItem, bool aUndoAppend = false );
328 
332  void ShowFindReplaceDialog( bool aReplace );
333 
334  void ShowFindReplaceStatus( const wxString& aMsg );
335  void ClearFindReplaceStatus();
336 
340  wxFindReplaceData* GetFindReplaceData();
341 
345  void OnFindDialogClose();
346 
358  bool BreakSegment( SCH_LINE* aSegment, const wxPoint& aPoint,
359  SCH_LINE** aNewSegment = NULL, SCH_SCREEN* aScreen = nullptr );
360 
371  bool BreakSegments( const wxPoint& aPoint, SCH_SCREEN* aScreen = nullptr );
372 
382  bool BreakSegmentsOnJunctions( SCH_SCREEN* aScreen = nullptr );
383 
388  bool TestDanglingEnds();
389 
402  void SendMessageToPCBNEW( EDA_ITEM* aObjectToSync, SCH_COMPONENT* aPart );
403 
409  void SendCrossProbeNetName( const wxString& aNetName );
410 
415 
416  const wxString& GetSelectedNetName() const { return m_SelectedNetName; }
417  void SetSelectedNetName( const wxString& aNetName ) { m_SelectedNetName = aNetName; }
418 
425  NETLIST_OBJECT_LIST* BuildNetListBase( bool updateStatusText = true );
426 
438  NETLIST_OBJECT_LIST* CreateNetlist( bool aSilent = false,
439  bool aSilentAnnotate = false );
440 
458  bool WriteNetListFile( NETLIST_OBJECT_LIST* aConnectedItemsList,
459  int aFormat,
460  const wxString& aFullFileName,
461  unsigned aNetlistOptions,
462  REPORTER* aReporter = NULL );
463 
470  void DeleteAnnotation( bool aCurrentSheetOnly );
471 
500  void AnnotateComponents( bool aAnnotateSchematic, ANNOTATE_ORDER_T aSortOption,
501  ANNOTATE_OPTION_T aAlgoOption, int aStartNumber,
502  bool aResetAnnotation, bool aRepairTimestamps, bool aLockUnits,
503  REPORTER& aReporter );
504 
521  int CheckAnnotate( REPORTER& aReporter, bool aOneSheetOnly );
522 
528  int ModalAnnotate( const wxString& aMessage );
529 
530  // Functions used for hierarchy handling
532 
533  void SetCurrentSheet( const SCH_SHEET_PATH& aSheet );
534 
538  void HardRedraw() override;
539 
543  void DisplayCurrentSheet();
544 
550 
556  void OnPageSettingsChange() override;
557 
569 
575  void SetSheetNumberAndCount();
576 
580  void Print();
581 
582  wxPageSetupDialogData& GetPageSetupData() { return m_pageSetupData; }
583 
585  void SetPrintMonochrome( bool aMonochrome ) { m_printMonochrome = aMonochrome; }
587  void SetPrintSheetReference( bool aShow ) { m_printSheetReference = aShow; }
588 
589  // Plot functions:
590  void PlotSchematic();
591 
592  void NewProject();
593  void LoadProject();
594 
595  void Save_File( bool doSaveAs = false );
596 
597  bool SaveProject();
598 
599  bool OpenProjectFiles( const std::vector<wxString>& aFileSet, int aCtl = 0 ) override;
600 
606  bool AppendSchematic();
607 
621  bool SaveEEFile( SCH_SCREEN* aScreen,
622  bool aSaveUnderNewName = false,
623  bool aCreateBackupFile = CREATE_BACKUP_FILE );
624 
625 
633  bool AskToSaveChanges();
634 
635  SCH_JUNCTION* AddJunction( const wxPoint& aPos, bool aAppendToUndo = false,
636  bool aFinal = true );
637 
643 
644  SCH_TEXT* CreateNewText( int aType );
645 
655  bool SchematicCleanUp( SCH_SCREEN* aScreen = nullptr );
656 
667  bool TrimWire( const wxPoint& aStart, const wxPoint& aEnd );
668 
674  void GetSchematicConnections( std::vector< wxPoint >& aConnections );
675 
676  void OnOpenPcbnew( wxCommandEvent& event );
677  void OnOpenCvpcb( wxCommandEvent& event );
678  void OnRescueProject( wxCommandEvent& event );
679  void OnRemapSymbols( wxCommandEvent& aEvent );
680  void OnUpdatePCB( wxCommandEvent& event );
681  void OnAnnotate( wxCommandEvent& event );
682 
683 private:
684  // Sets up the tool framework
685  void setupTools();
686 
687  void OnExit( wxCommandEvent& event );
688 
689  void OnLoadFile( wxCommandEvent& event );
690  void OnAppendProject( wxCommandEvent& event );
691  void OnImportProject( wxCommandEvent& event );
692 
701  void UpdateTitle();
702 
707  void NormalizeSchematicOnFirstLoad( bool recalculateConnections );
708 
717  bool checkSheetForRecursion( SCH_SHEET* aSheet, SCH_SHEET_PATH* aHierarchy );
718 
727  bool checkForNoFullyDefinedLibIds( SCH_SHEET* aSheet );
728 
735  bool importFile( const wxString& aFileName, int aFileType );
736 
748  bool allowCaseSensitiveFileNameClashes( const wxString& aSchematicFileName );
749 
750 public:
761  void ConvertTextType( SCH_TEXT* aText, KICAD_T aNewType );
762 
791  bool EditSheet( SCH_SHEET* aSheet, SCH_SHEET_PATH* aHierarchy, bool* aClearAnnotationNewItems );
792 
793  void InitSheet( SCH_SHEET* aSheet, const wxString& aNewFilename );
794 
839  bool LoadSheetFromFile( SCH_SHEET* aSheet, SCH_SHEET_PATH* aHierarchy,
840  const wxString& aFileName );
841 
849 
856 
863  void DeleteJunction( SCH_ITEM* aItem, bool aAppend = false );
864 
865  int GetLabelIncrement() const { return m_repeatLabelDelta; }
866 
867  void ConvertPart( SCH_COMPONENT* aComponent );
868 
869  void SelectUnit( SCH_COMPONENT* aComponent, int aUnit );
870 
871  /* Undo - redo */
872 
902  void SaveCopyInUndoList( SCH_ITEM* aItemToCopy,
903  UNDO_REDO_T aTypeCommand,
904  bool aAppend = false,
905  const wxPoint& aTransformPoint = wxPoint( 0, 0 ) );
906 
916  void SaveCopyInUndoList( const PICKED_ITEMS_LIST& aItemsList,
917  UNDO_REDO_T aTypeCommand,
918  bool aAppend = false,
919  const wxPoint& aTransformPoint = wxPoint( 0, 0 ) );
920 
927  void PutDataInPreviousState( PICKED_ITEMS_LIST* aList, bool aRedoCommand );
928 
932  void SaveCopyForRepeatItem( SCH_ITEM* aItem );
933 
940 
951  void SaveUndoItemInUndoList( SCH_ITEM* aItem, bool aAppend = false );
952 
958 
968  bool CreateArchiveLibraryCacheFile( bool aUseCurrentSheetFilename = false );
969 
976  bool CreateArchiveLibrary( const wxString& aFileName );
977 
991  bool rescueProject( RESCUER& aRescuer, bool aRunningOnDemand );
992  bool RescueLegacyProject( bool aRunningOnDemand );
993  bool RescueSymbolLibTableProject( bool aRunningOnDemand );
994 
1000  virtual void PrintPage( wxDC* aDC ) override;
1001 
1002  void SetNetListerCommand( const wxString& aCommand ) { m_netListerCommand = aCommand; }
1003 
1007  void DefaultExecFlags() { m_exec_flags = wxEXEC_SYNC; }
1008 
1014  void SetExecFlags( const int aFlags ) { m_exec_flags |= aFlags; }
1015 
1022  void ClearExecFlags( const int aFlags ) { m_exec_flags &= ~( aFlags ); }
1023 
1024  wxString GetNetListerCommand() const { return m_netListerCommand; }
1025 
1029  void RecalculateConnections( SCH_CLEANUP_FLAGS aCleanupFlags );
1030 
1034  void InstallPreferences( PAGED_DIALOG* aParent, PANEL_HOTKEYS_EDITOR* aHotkeysPanel ) override;
1035 
1039  void CommonSettingsChanged( bool aEnvVarsChanged ) override;
1040 
1041  void ShowChangedLanguage() override;
1042 
1043  void SyncToolbars() override;
1044 
1045  void SetScreen( BASE_SCREEN* aScreen ) override;
1046 
1047  const BOX2I GetDocumentExtents() const override;
1048 
1049  void FixupJunctions();
1050 
1051  DECLARE_EVENT_TABLE()
1052 };
1053 
1054 
1055 #endif // SCH_EDIT_FRAME_H
void SetCurrentSheet(const SCH_SHEET_PATH &aSheet)
bool GetAutoplaceJustify() const
wxString m_netListerCommand
Command line to call a custom net list generator.
Class 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)
A list of parameters type.
bool SchematicCleanUp(SCH_SCREEN *aScreen=nullptr)
Performs routine schematic cleaning including breaking wire and buses and deleting identical objects ...
STATUS_TEXT_POPUP * m_findReplaceStatusPopup
Class 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.
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:62
void SendCrossProbeNetName(const wxString &aNetName)
Sends a net name to pcbnew for highlighting.
void SetPlotDirectoryName(const wxString &aDirName)
int AddTemplateFieldName(const TEMPLATE_FIELDNAME &aFieldName)
Insert or append a wanted symbol field name into the field names template.
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.
PARAM_CFG_ARRAY m_projectFileParams
COMPONENT_ORIENTATION_T
enum used in RotationMiroir()
void SetForceHVLines(bool aForceHVdirection)
bool checkSheetForRecursion(SCH_SHEET *aSheet, SCH_SHEET_PATH *aHierarchy)
Verify that aSheet will not cause a recursion error in aHierarchy.
Definition: sheet.cpp:44
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()
Class 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 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.
Definition: annotate.cpp:82
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
PARAM_CFG_ARRAY & GetConfigurationSettings()
Return the Eeschema applications settings.
void OnCloseWindow(wxCloseEvent &Event)
PARAM_CFG_ARRAY & GetProjectFileParameters()
Return the project file parameter list for Eeschema.
void UpdateTitle()
Set the main window title bar text.
Annotate incrementally using the first free reference number.
void OnAppendProject(wxCommandEvent &event)
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()
The common library.
void DrawCurrentSheetToClipboard()
Use the wxWidgets print code to draw an image of the current sheet onto the clipboard.
Definition: sheet.cpp:842
SCH_CLEANUP_FLAGS
int AddTemplateFieldName(const TEMPLATE_FIELDNAME &aFieldName)
Function AddTemplateFieldName inserts or appends a wanted symbol field name into the fieldnames templ...
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 SetPrintMonochrome(bool aMonochrome)
void OnRescueProject(wxCommandEvent &event)
void DisplayCurrentSheet()
Draw the current sheet on the display.
Definition: hierarch.cpp:261
bool m_autoplaceAlign
align autoplaced fields to the grid
Class REPORTER is a pure virtual class used to derive REPORTER objects from.
Definition: reporter.h:61
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 EditSheet(SCH_SHEET *aSheet, SCH_SHEET_PATH *aHierarchy, bool *aClearAnnotationNewItems)
Edit an existing sheet or add a new sheet to the schematic.
Definition: sheet.cpp:518
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 SaveProjectSettings(bool aAskForSave) override
Save changes to the project settings to the project (.pro) file.
void OnImportProject(wxCommandEvent &event)
Class NETLIST_OBJECT_LIST is a container holding and owning NETLIST_OBJECTs, which are connected item...
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.
Class SCH_EDITOR_CONTROL.
const BOX2I GetDocumentExtents() const override
void ShowChangedLanguage() override
Redraw the menus and what not in current language.
void SendMessageToPCBNEW(EDA_ITEM *aObjectToSync, SCH_COMPONENT *aPart)
Send a message to Pcbnew via a socket connection.
void DeleteAllTemplateFieldNames()
Remove all template field names.
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:914
static PINSHEETLABEL_SHAPE m_lastSheetPinType
Last sheet pin type.
void DeleteAnnotation(bool aCurrentSheetOnly)
Clear the current component annotation.
Definition: annotate.cpp:59
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.
bool GetForceHVLines() const
Class BASE_SCREEN handles how to draw a screen (a board, a schematic ...)
Definition: base_screen.h:74
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.
ERC_SETTINGS m_ercSettings
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:773
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.
Class KIWAY is a minimalistic software bus for communications between various DLLs/DSOs (DSOs) within...
Definition: kiway.h:274
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
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:75
bool isAutoSaveRequired() const override
Returns true if the schematic has been modified.
Container for ERC settings.
Definition: erc_settings.h:30
Class SCH_SHEET_PATH.
void DeleteAllTemplateFieldNames()
Function DeleteAllTemplateFieldNames deletes the entire contents.
wxPageSetupDialogData & GetPageSetupData()
bool m_printMonochrome
Print monochrome instead of grey scale.
Class PICKED_ITEMS_LIST is a holder to handle information on schematic or board items.
void UpdateErcSettings(const ERC_SETTINGS &aSettings)
SCH_TEXT * GetNextNewText()
Gets the next queued text item.
Definition: edit_label.cpp:50
void OnUpdatePCB(wxCommandEvent &event)
void SaveUndoItemInUndoList(SCH_ITEM *aItem, bool aAppend=false)
Swap the cloned item in member variable m_undoItem with aItem and saves it to the undo list then swap...
void ReCreateOptToolbar() override
Object to handle a bitmap image that can be inserted in a schematic.
Definition: sch_bitmap.h:42
void SaveSettings(wxConfigBase *aCfg) override
Saves common frame parameters to a configuration data file.
PARAM_CFG_ARRAY m_configSettings
int GetLabelIncrement() const
void SelectUnit(SCH_COMPONENT *aComponent, int aUnit)
Definition: getpart.cpp:210
bool m_autoplaceFields
automatically place component fields
void LoadSettings(wxConfigBase *aCfg) override
Load common frame parameters from a configuration file.
void SetShowFootprintPreviews(bool aEnable)
int CheckAnnotate(REPORTER &aReporter, bool aOneSheetOnly)
Check for annotation errors.
Definition: annotate.cpp:245
Sheet symbol placed in a schematic, and is the entry point for a sub schematic.
Definition: sch_sheet.h:209
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_showAllPins
Flag to indicate show hidden pins.
bool m_printSheetReference
wxString m_SelectedNetName
Annotate using the first free reference number starting at the sheet number * 100.
void OnRemapSymbols(wxCommandEvent &aEvent)
const ERC_SETTINGS & GetErcSettings()
virtual void PrintPage(wxDC *aDC) override
Plot or print the current sheet to the clipboard.
#define CREATE_BACKUP_FILE
void ClearFindReplaceStatus()
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:47
void SetNetListFormatName(const wxString &aFormat)
SCH_ITEM * GetRepeatItem() const
Return the item which is to be repeated with the insert key.
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:191
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:821
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:37
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
The name of the destination directory to use when generating plot files.
SCH_ITEM * m_undoItem
Copy of the current item being edited.
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)
Class SCH_COMPONENT describes a real schematic component.
Definition: sch_component.h:73
Class EDA_ITEM is a base class for most all the KiCad significant classes, used in schematics and boa...
Definition: base_struct.h:163
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.
wxString GetNetListerCommand() const
wxString m_netListFormat
The name of the format to use when generating a net list.
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 GetSpiceAjustPassiveValues() const
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 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:249
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.
Class SCH_ITEM is a base class for any item which can be embedded within the SCHEMATIC container clas...
Definition: sch_item.h:114
Definitions of the SCH_TEXT class and derivatives for Eeschema.
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:785
bool GetShowAllPins() const override
Allow some frames to show/hide hidden pins.
void NormalizeSchematicOnFirstLoad(bool recalculateConnections)
Perform all cleanup and normalization steps so that the whole schematic is in a good state.
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.