26 #ifndef SCH_EDIT_FRAME_H 27 #define SCH_EDIT_FRAME_H 31 #include <wx/cmndata.h> 33 #include <wx/gdicmn.h> 34 #include <wx/string.h> 62 class wxFindReplaceData;
154 void onSize( wxSizeEvent& aEvent );
394 const wxString& aFullFileName,
395 unsigned aNetlistOptions,
436 bool aResetAnnotation,
bool aRepairTimestamps,
bool aLockUnits,
516 bool OpenProjectFiles(
const std::vector<wxString>& aFileSet,
int aCtl = 0 )
override;
537 bool aSaveUnderNewName =
false );
550 bool aFinal =
true );
573 bool TrimWire(
const wxPoint& aStart,
const wxPoint& aEnd );
591 void OnExit( wxCommandEvent& event );
633 bool importFile(
const wxString& aFileName,
int aFileType );
694 bool* aClearAnnotationNewItems );
743 const wxString& aFileName );
931 DECLARE_EVENT_TABLE()
935 #endif // SCH_EDIT_FRAME_H void SetCurrentSheet(const SCH_SHEET_PATH &aSheet)
bool ReadyToNetlist(const wxString &aAnnotateMessage)
Checks if we are ready to write a netlist file for the current schematic.
bool CheckSheetForRecursion(SCH_SHEET *aSheet, SCH_SHEET_PATH *aHierarchy)
Verify that aSheet will not cause a recursion error in aHierarchy.
wxString m_netListerCommand
Command line to call a custom net list generator.
void ShowFindReplaceStatus(const wxString &aMsg, int aStatusTime)
int CheckAnnotate(ANNOTATION_ERROR_HANDLER aErrorHandler, bool aOneSheetOnly=false)
Check for annotation errors.
SCH_FIELD instances are attached to a component and provide a place for the component's value,...
void OnOpenCvpcb(wxCommandEvent &event)
void onSize(wxSizeEvent &aEvent)
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 ...
SCHEMATIC * m_schematic
The currently loaded schematic.
Carry a payload from one KIWAY_PLAYER to another within a PROJECT.
void DefaultExecFlags()
Reset the execution flags to defaults for external netlist and bom generators.
void UpdateNetHighlightStatus()
HIERARCHY_NAVIG_DLG * FindHierarchyNavigator()
bool OpenProjectFiles(const std::vector< wxString > &aFileSet, int aCtl=0) override
Open a project or set of files given by aFileList.
void mapExistingAnnotation(std::map< wxString, wxString > &aMap)
Fills a map of uuid -> reference from the currently loaded schematic.
void OnLoadFile(wxCommandEvent &event)
wxFindReplaceData * GetFindReplaceData()
Get the find criteria (as set by the dialog).
void SendCrossProbeNetName(const wxString &aNetName)
Sends a net name to pcbnew for highlighting.
bool WriteNetListFile(int aFormat, const wxString &aFullFileName, unsigned aNetlistOptions, REPORTER *aReporter=NULL)
Create a netlist file.
SELECTION & GetCurrentSelection() override
Get the current selection from the canvas area.
void RecalculateConnections(SCH_CLEANUP_FLAGS aCleanupFlags)
Generates the connection data for the entire schematic hierarchy.
virtual void PrintPage(const RENDER_SETTINGS *aSettings) override
Plot or print the current sheet to the clipboard.
Container for all the knowledge about how graphical objects are drawn on any output surface/device.
void SaveProjectSettings() override
Save changes to the project settings to the project (.pro) file.
COMPONENT_ORIENTATION_T
enum used in RotationMiroir()
Holds all the data relating to one schematic A schematic may consist of one or more sheets (and one r...
void StartNewUndo()
Create a new, blank stack for future Undo commands to be pushed to.
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
const SCH_CONNECTION * GetHighlightedConnection() const
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.
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.
const BOX2I GetDocumentExtents(bool aIncludeAllVisible=true) const override
Returns bbox of document with option to not include some items.
bool AskToSaveChanges()
Checks if any of the screens has unsaved changes and asks the user whether to save or drop them.
void ResolveERCExclusions()
Update markers to match recorded exclusions.
EDA_ITEM * GetItem(const KIID &aId) override
Fetch an item by KIID.
void UpdateTitle()
Set the main window title bar text.
Annotate incrementally using the first free reference number.
void OnAppendProject(wxCommandEvent &event)
void InitSheet(SCH_SHEET *aSheet, const wxString &aNewFilename)
void setupUIConditions() override
Setup the UI conditions for the various actions and their controls in this frame.
void DrawCurrentSheetToClipboard()
Use the wxWidgets print code to draw an image of the current sheet onto the clipboard.
Schematic editor (Eeschema) main window.
void OnPageSettingsChange() override
Called when modifying the page settings.
void DisplayCurrentSheet()
Draw the current sheet on the display.
A pure virtual class used to derive REPORTER objects from.
void OnFindDialogClose()
Notification that the Find dialog has closed.
bool canCloseWindow(wxCloseEvent &aCloseEvent) override
void DeleteAnnotation(bool aCurrentSheetOnly, bool *appendUndo)
Clear the current component annotation.
bool importFile(const wxString &aFileName, int aFileType)
Load the given filename but sets the path to the current project path.
bool SaveEEFile(SCH_SHEET *aSheet, bool aSaveUnderNewName=false)
Save aSheet to a schematic file.
UNDO_REDO
Undo Redo considerations: Basically we have 3 cases New item Deleted item Modified item there is also...
void OnImportProject(wxCommandEvent &event)
SCH_JUNCTION * AddJunction(SCH_SCREEN *aScreen, const wxPoint &aPos, bool aAppendToUndo, bool aFinal=true)
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.
Handle actions specific to the schematic editor.
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.
void doCloseWindow() override
void ReCreateHToolbar() override
bool LoadSheetFromFile(SCH_SHEET *aSheet, SCH_SHEET_PATH *aHierarchy, const wxString &aFileName)
Load a the KiCad schematic file aFileName into the sheet aSheet.
bool AllowCaseSensitiveFileNameClashes(const wxString &aSchematicFileName)
Check aSchematicFileName for a potential file name case sensitivity clashes.
void UpdateSymbolFromEditor(const LIB_PART &aSymbol)
Update the LIB_PART of the currently selected symbol.
APP_SETTINGS_BASE is a settings class that should be derived for each standalone KiCad application.
void TestDanglingEnds()
Test all of the connectable objects in the schematic for unused connection points.
void HardRedraw() override
Rebuild the GAL and redraw the screen.
wxPageSetupDialogData m_pageSetupData
Handles how to draw a screen (a board, a schematic ...)
Annotate by position of component in the schematic sheet object list.
void initScreenZoom()
Initialize the zoom value of the current screen and mark the screen as zoom-initialized.
void ShowAllIntersheetRefs(bool aShow)
SCHEMATIC & Schematic() const
void UpdateHierarchyNavigator(bool aForceUpdate=false)
Run the Hierarchy Navigator dialog.
Define a library symbol object.
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 CreateArchiveLibraryCacheFile(bool aUseCurrentSheetFilename=false)
Create a symbol library file with the name of the root document plus the '-cache' suffix,...
void KiwayMailIn(KIWAY_EXPRESS &aEvent) override
Receive KIWAY_EXPRESS messages from other players.
std::vector< wxPoint > GetSchematicConnections()
Collects a unique list of all possible connection points in the schematic.
A minimalistic software bus for communications between various DLLs/DSOs (DSOs) within the same KiCad...
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
Define a sheet pin (label) used in sheets to create hierarchical schematics.
bool isAutoSaveRequired() const override
Returns true if the schematic has been modified.
Handle access to a stack of flattened SCH_SHEET objects by way of a path for creating a flattened sch...
wxPageSetupDialogData & GetPageSetupData()
A holder to handle information on schematic or board items.
void OnUpdatePCB(wxCommandEvent &event)
void ReCreateOptToolbar() override
Object to handle a bitmap image that can be inserted in a schematic.
void SelectUnit(SCH_COMPONENT *aComponent, int aUnit)
bool LoadProjectSettings()
Loads the KiCad project file (*.pro) settings specific to Eeschema.
const SCH_CONNECTION * m_highlightedConn
The highlighted net or bus, or nullptr.
Sheet symbol placed in a schematic, and is the entry point for a sub schematic.
bool doAutoSave() override
Save the schematic files that have been modified and not yet saved.
Annotate by Y position from top to bottom.
UNDO_REDO_LIST
Remove the aItemCount of old commands from aList and delete commands, pickers and picked items if nee...
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)
Annotate using the first free reference number starting at the sheet number * 100.
void ClearFindReplaceStatus()
void SetHighlightedConnection(const SCH_CONNECTION *aConnection)
void ClearExecFlags(const int aFlags)
Clear (removes) specified flags that not needed for next execution of external generator of the netli...
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 AddItemToScreenAndUndoList(SCH_SCREEN *aScreen, SCH_ITEM *aItem, bool aUndoAppend)
Add an item to the schematic and adds the changes to the undo/redo container.
SCH_SEARCH_T
Schematic search type used by the socket link with Pcbnew.
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,...
SCH_EDIT_FRAME(KIWAY *aKiway, wxWindow *aParent)
void SetSheetNumberAndCount()
Set the m_ScreenNumber and m_NumberOfScreens members for screens.
Each graphical item can have a SCH_CONNECTION describing its logical connection (to a bus or net).
void SaveCopyInUndoList(SCH_SCREEN *aScreen, SCH_ITEM *aItemToCopy, UNDO_REDO aTypeCommand, bool aAppend)
Create a copy of the current schematic item, and put it in the undo list.
void LoadSettings(APP_SETTINGS_BASE *aCfg) override
Load common frame parameters from a configuration file.
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.
void RecomputeIntersheetRefs()
Update the schematic's page reference map for all global labels, and refresh the labels so that they ...
void DeleteJunction(SCH_ITEM *aItem, bool aAppend=false)
Removes a given junction and heals any wire segments under the junction.
void RollbackSchematicFromUndo()
Performs an undo of the last edit WITHOUT logging a corresponding redo.
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)
void SetCrossProbeConnection(const SCH_CONNECTION *aConnection)
Sends a connection (net or bus) to pcbnew for highlighting.
A base class for most all the KiCad significant classes used in schematics and boards.
wxString GetCurrentFileName() const override
Get the full filename + path of the currently opened file in the frame.
~SCH_EDIT_FRAME() override
void ExecuteRemoteCommand(const char *cmdline) override
Execute a remote command sent by Pcbnew via a socket connection.
wxString GetUniqueFilenameForCurrentSheet()
bool EditSheetProperties(SCH_SHEET *aSheet, SCH_SHEET_PATH *aHierarchy, bool *aClearAnnotationNewItems)
Edit an existing sheet or add a new sheet to the schematic.
wxString GetNetListerCommand() const
SCH_SHEET_PATH & GetCurrentSheet() const
bool TrimWire(const wxPoint &aStart, const wxPoint &aEnd)
If any single wire passes through both points, remove the portion between the two points,...
void FocusOnItem(SCH_ITEM *aItem)
void PutDataInPreviousState(PICKED_ITEMS_LIST *aList)
Restore an undo or redo command to put data pointed by aList in the previous state.
void OnModify() override
Must be called after a schematic change in order to set the "modify" flag of the current screen and u...
void SaveSettings(APP_SETTINGS_BASE *aCfg) override
Save 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...
void ClearUndoORRedoList(UNDO_REDO_LIST whichList, int aItemCount=-1) override
Free the undo or redo list from aList element.
int m_exec_flags
Flags of the wxExecute() function to call a custom net list generator.
void ShowSchematicSetupDialog(const wxString &aInitialPage=wxEmptyString)
void CommonSettingsChanged(bool aEnvVarsChanged, bool aTextVarsChanged) override
Called after the preferences dialog is run.
bool CreateArchiveLibrary(const wxString &aFileName)
Create a library aFileName that contains all components used in the current schematic.
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: SYMBOL_EDIT_FRAME,...
void ConvertPart(SCH_COMPONENT *aComponent)
Base class for any item which can be embedded within the SCHEMATIC container class,...
void SetNetListerCommand(const wxString &aCommand)
void RecordERCExclusions()
Scan existing markers and record data from any that are Excluded.
bool GetShowAllPins() const override
Allow edit frame to show/hide hidden pins.
void ReCreateVToolbar() override
void sendNetlistToCvpcb()
Send the kicad netlist over to CVPCB.