21#ifndef __PCB_EDIT_FRAME_H__
22#define __PCB_EDIT_FRAME_H__
95 void OnQuit( wxCommandEvent& event );
157 void FindNext(
bool reverse =
false );
323 void ShowBoardSetupDialog(
const wxString& aInitialPage = wxEmptyString, wxWindow* aParent =
nullptr );
357 bool aNoTHItems,
bool aExcludeDNP,
bool aExcludeBOM,
bool aTopSide,
358 bool aBottomSide,
bool aFormatCSV,
bool aUseAuxOrigin,
359 bool aNegateBottomX );
364 bool SaveBoard(
bool aSaveAs =
false,
bool aSaveCopy =
false );
378 bool OpenProjectFiles(
const std::vector<wxString>& aFileSet,
int aCtl = 0 )
override;
391 bool SavePcbFile(
const wxString& aFileName,
bool addToHistory =
true,
392 bool aChangeProject =
true );
406 bool SavePcbCopy(
const wxString& aFileName,
bool aCreateProject =
false,
407 bool aHeadless =
false );
416 bool Clear_Pcb(
bool doAskAboutUnsavedChanges,
bool aFinal =
false );
421 SetBoard( aBoard,
true, aReporter );
456 wxString* aLibPath =
nullptr );
482 bool ExportVRML_File(
const wxString& aFullFileName,
double aMMtoWRMLunit,
483 bool aIncludeUnspecified,
bool aIncludeDNP,
484 bool aExport3DFiles,
bool aUseRelativePaths,
485 const wxString& a3D_Subdir,
double aXRef,
double aYRef );
505 bool aUseThou,
double aXRef,
double aYRef,
506 bool aIncludeUnspecified,
bool aIncludeDNP );
546 bool matchPadPositions,
547 bool deleteExtraTexts =
true,
548 bool resetTextLayers =
true,
549 bool resetTextEffects =
true,
550 bool resetTextPositions =
true,
551 bool resetTextContent =
true,
552 bool resetFabricationAttrs =
true,
553 bool resetClearanceOverrides =
true,
554 bool reset3DModels =
true,
555 bool* aUpdated =
nullptr );
585 bool aUseDesignRules );
715 DECLARE_EVENT_TABLE()
770 bool importFile(
const wxString& aFileName,
int aFileType,
771 const std::map<std::string, UTF8>* aProperties =
nullptr );
793 void onSize( wxSizeEvent& aEvent );
804 void onPluginAvailabilityChanged( wxCommandEvent& aEvt );
864 std::unique_ptr<API_HANDLER_PCB> m_apiHandler;
865 std::unique_ptr<API_HANDLER_COMMON> m_apiHandlerCommon;
APP_SETTINGS_BASE is a settings class that should be derived for each standalone KiCad application.
Abstract interface for BOARD_ITEMs capable of storing other items inside.
A base class for any item which can be embedded within the BOARD container class, and therefore insta...
Update the BOARD with a new netlist.
Information pertinent to a Pcbnew printed circuit board.
A dialog to set the plot options and create plot files in various formats.
A base class for most all the KiCad significant classes used in schematics and boards.
A general implementation of a COLLECTORS_GUIDE.
Used when the right click button is pressed, or when the select tool is in effect.
Hold an error message and may be used when throwing exceptions containing meaningful error messages.
A color representation with 4 components: red, green, blue, alpha.
Carry a payload from one KIWAY_PLAYER to another within a PROJECT.
A minimalistic software bus for communications between various DLLs/DSOs (DSOs) within the same KiCad...
A logical library item identifier and consists of various portions much like a URI.
Store information read from a netlist along with the flags used to update the NETLIST in the BOARD.
Describe the page size and margins of a paper page on which to eventually print or plot.
PCB_BASE_EDIT_FRAME(KIWAY *aKiway, wxWindow *aParent, FRAME_T aFrameType, const wxString &aTitle, const wxPoint &aPos, const wxSize &aSize, long aStyle, const wxString &aFrameName)
void HardRedraw() override
Rebuild the GAL and redraws the screen.
void OnDisplayOptionsChanged() override
static bool GetPluginActionButtonVisible(const wxString &aPluginPath, bool aPluginDefault)
Return true if button visibility action plugin setting was set to true or it is unset and plugin defa...
void OnEditItemRequest(BOARD_ITEM *aItem) override
Install the corresponding dialog editor for the given item.
int DoGenFootprintsPositionFile(const wxString &aFullFileName, bool aUnitsMM, bool aOnlySMD, bool aNoTHItems, bool aExcludeDNP, bool aExcludeBOM, bool aTopSide, bool aBottomSide, bool aFormatCSV, bool aUseAuxOrigin, bool aNegateBottomX)
Create an ASCII footprint position file.
bool saveBoardAsFile(BOARD *aBoard, const wxString &aFileName, bool aHeadless=false)
Save a board object to a file.
void SetLastPath(LAST_PATH_TYPE aType, const wxString &aLastPath)
Set the path of the last file successfully read.
int m_crossProbeFlashPhase
Phase counter.
void FindNext(bool reverse=false)
Find the next item using our existing search parameters.
void LoadDrawingSheet()
Load the drawing sheet file.
void ResolveDRCExclusions(bool aCreateMarkers)
If aCreateMarkers then create DRC exclusion markers from the serialized data.
void SetBoard(BOARD *aBoard, PROGRESS_REPORTER *aReporter=nullptr) override
Set the #m_Pcb member in such as way as to ensure deleting any previous BOARD.
TOOL_ACTION * GetExportNetlistAction()
void SetActiveLayer(PCB_LAYER_ID aLayer) override
Change the currently active layer to aLayer and also update the APPEARANCE_CONTROLS.
bool doAutoSave() override
Perform auto save when the board has been modified and not saved within the auto save interval.
void OnModify() override
Must be called after a board change to set the modified flag.
void ThemeChanged() override
Called when light/dark theme is changed.
std::vector< LIB_ID > m_designBlockHistoryList
PCB_EDIT_FRAME(KIWAY *aKiway, wxWindow *aParent)
bool ReadNetlistFromFile(const wxString &aFilename, NETLIST &aNetlist, REPORTER &aReporter)
Read a netlist from a file into a NETLIST object.
void SwitchLayer(PCB_LAYER_ID layer) override
Change the active layer in the editor.
wxTimer m_crossProbeFlashTimer
Timer to toggle selection visibility for flash.
void StartCrossProbeFlash(const std::vector< BOARD_ITEM * > &aItems)
void OnCrossProbeFlashTimer(wxTimerEvent &aEvent)
void KiwayMailIn(KIWAY_MAIL_EVENT &aEvent) override
Receive #KIWAY_ROUTED_EVENT messages from other players.
void setupUIConditions() override
Setup the UI conditions for the various actions and their controls in this frame.
void OnUpdateSelectTrackWidth(wxUpdateUIEvent &aEvent)
void UpdateVariantSelectionCtrl()
Update the variant selection dropdown with the current board's variant names.
bool DoAutoSave()
Perform auto save when the board has been modified and not saved within the auto save interval.
void UpdateTrackWidthSelectBox(wxChoice *aTrackWidthSelectBox, bool aShowNetclass, bool aShowEdit)
void SetElementVisibility(GAL_LAYER_ID aElement, bool aNewState)
Change the visibility of an element category.
void OnExportSTEP()
Export the current BOARD to a STEP assembly.
DIALOG_BOOK_REPORTER * m_inspectDrcErrorDlg
void OnClearFileHistory(wxCommandEvent &aEvent)
bool SaveBoard(bool aSaveAs=false, bool aSaveCopy=false)
std::unique_ptr< GRID_HELPER > MakeGridHelper() override
virtual ~PCB_EDIT_FRAME()
void SwitchCanvas(EDA_DRAW_PANEL_GAL::GAL_TYPE aCanvasType) override
Switch currently used canvas (Cairo / OpenGL).
void UpdateViaSizeSelectBox(wxChoice *aViaSizeSelectBox, bool aShowNetclass, bool aShowEdit)
void CommonSettingsChanged(int aFlags) override
Called after the preferences dialog is run.
void ShowFindByPropertiesDialog()
Show the Find by Properties dialog.
BOARD_ITEM_CONTAINER * GetModel() const override
DIALOG_BOOK_REPORTER * GetInspectDrcErrorDialog()
void SetCurrentVariant(const wxString &aVariantName)
Set the current variant on the board and update the drawing sheet's cached variant name and descripti...
bool saveSelectionToDesignBlock(const wxString &aNickname, PCB_SELECTION &aSelection, DESIGN_BLOCK &aBlock)
void ShowTargetOptionsDialog(PCB_TARGET *aTarget)
void ShowBoardSetupDialog(const wxString &aInitialPage=wxEmptyString, wxWindow *aParent=nullptr)
bool OpenProjectFiles(const std::vector< wxString > &aFileSet, int aCtl=0) override
Load a KiCad board (.kicad_pcb) from aFileName.
DIALOG_FIND * m_findDialog
LAYER_TOOLBAR_ICON_VALUES m_prevIconVal
void doReCreateMenuBar() override
DIALOG_BOOK_REPORTER * m_inspectConstraintsDlg
bool UpdateDesignBlockFromBoard(const LIB_ID &aLibId)
void SetPageSettings(const PAGE_INFO &aPageSettings) override
bool IsElementVisible(GAL_LAYER_ID aElement) const
Test whether a given element category is visible.
bool CanAcceptApiCommands() override
Check if this frame is ready to accept API commands.
void UpdateUserInterface()
Update the layer manager and other widgets from the board setup (layer and items visibility,...
void SetGridColor(const COLOR4D &aColor) override
void ExportFootprintsToLibrary(bool aStoreInNewLib, const wxString &aLibName=wxEmptyString, wxString *aLibPath=nullptr)
Save footprints in a library:
void ProjectChanged() override
Notification event that the project has changed.
bool UpdateDesignBlockFromSelection(const LIB_ID &aLibId)
wxString GetLastPath(LAST_PATH_TYPE aType)
Get the last path for a particular type.
void OnNetlistChanged(BOARD_NETLIST_UPDATER &aUpdater, bool *aRunDragCommand)
Called after netlist is updated.
void OnExportHyperlynx()
Export the current BOARD to a Hyperlynx HYP file.
void ShowChangedLanguage() override
Redraw the menus and what not in current language.
void doCloseWindow() override
bool ImportSpecctraSession(const wxString &aFullFilename)
Import a specctra *.ses file and use it to relocate MODULEs and to replace all vias and tracks in an ...
void ClearToolbarControl(int aId) override
void ReCreateLayerBox(bool aForceResizeToolbar=true)
Recreate the layer box by clearing the old list and building a new one from the new layer names and c...
void SaveProjectLocalSettings() override
Save changes to the project local settings.
static std::vector< const PLUGIN_ACTION * > GetOrderedPluginActions()
Return ordered list of plugins in sequence in which they should appear on toolbar or in settings.
void ExecuteRemoteCommand(const char *cmdline) override
Execute a remote command send by Eeschema via a socket, port KICAD_PCB_PORT_SERVICE_NUMBER (currently...
bool SavePcbCopy(const wxString &aFileName, bool aCreateProject=false, bool aHeadless=false)
Write the board data structures to aFileName.
void SetTrackSegmentWidth(PCB_TRACK *aItem, PICKED_ITEMS_LIST *aItemsListPicker, bool aUseDesignRules)
Modify one track segment width or one via diameter (using DRC control).
PCB_DESIGN_BLOCK_PANE * GetDesignBlockPane() const
void PrepareLayerIndicator(bool aForceRebuild=false)
void ShowFindDialog()
Show the Find dialog.
void onSize(wxSizeEvent &aEvent)
wxChoice * m_CurrentVariantCtrl
int ShowExchangeFootprintsDialog(FOOTPRINT *aFootprint, bool aUpdateMode, bool aSelectedMode)
int TestStandalone()
Test if standalone mode.
void ShowFootprintPropertiesDialog(FOOTPRINT *aFootprint)
void UpdateProperties() override
bool SaveSelectionAsDesignBlock(const wxString &aLibraryName)
bool IsContentModified() const override
Get if the current board has been modified but not saved.
bool LoadProjectSettings()
Load the current project's file configuration settings which are pertinent to this PCB_EDIT_FRAME ins...
bool Clear_Pcb(bool doAskAboutUnsavedChanges, bool aFinal=false)
Delete all and reinitialize the current board.
void SendCrossProbeItem(BOARD_ITEM *aSyncItem)
Send a message to the schematic editor so that it may move its cursor to an item with the same refere...
PLUGIN_ACTION_SCOPE PluginActionScope() const override
bool m_crossProbeFlashing
Currently flashing guard.
TOOL_ACTION * m_exportNetlistAction
The export board netlist tool action object.
BOX2D m_lastNetnamesViewport
Keep track of viewport so that track net labels can be adjusted when it changes.
void OnBoardLoaded()
Update the state of the GUI after a new board is loaded or created.
void Edit_Zone_Params(ZONE *zone_container)
Edit params (layer, clearance, ...) for a zone outline.
void ToggleLibraryTree() override
void InstallNetlistFrame()
bool FetchNetlistFromSchematic(NETLIST &aNetlist, const wxString &aAnnotateMessage)
wxString GetCurrentFileName() const override
Get the full filename + path of the currently opened file in the frame.
void LoadSettings(APP_SETTINGS_BASE *aCfg) override
Load common frame parameters from a configuration file.
void LoadFootprints(NETLIST &aNetlist, REPORTER &aReporter)
Load the footprints for each #SCH_COMPONENT in aNetlist from the list of libraries.
void SendSelectItemsToSch(const std::deque< EDA_ITEM * > &aItems, EDA_ITEM *aFocusItem, bool aForce)
Send a message to the schematic editor to try to find schematic counterparts of specified PCB items a...
DIALOG_BOOK_REPORTER * GetFootprintDiffDialog()
EDA_ANGLE GetRotationAngle() const override
Return the angle used for rotate operations.
void OnUpdateSelectViaSize(wxUpdateUIEvent &aEvent)
COLOR4D GetGridColor() override
void RebuildAndRefresh()
Rebuilds board connectivity, refreshes canvas.
std::vector< KIID > m_crossProbeFlashItems
Items to flash (by UUID)
void ToggleLayersManager()
void UpdateTitle()
Set the main window title bar text.
int inferLegacyEdgeClearance(BOARD *aBoard, bool aShowUserMsg=true)
DIALOG_BOOK_REPORTER * m_footprintDiffDlg
const std::map< std::string, UTF8 > * m_importProperties
void ActivateGalCanvas() override
Set the #m_Pcb member in such as way as to ensure deleting any previous BOARD.
bool SaveBoardAsDesignBlock(const wxString &aLibraryName)
wxChoice * m_SelViaSizeBox
void Process_Special_Functions(wxCommandEvent &event)
void onVariantSelected(wxCommandEvent &aEvent)
Event handler for variant selection changes in the toolbar.
void configureToolbars() override
std::vector< BOARD_ITEM * > FindItemsFromSyncSelection(std::string syncStr)
Used to find items by selection synchronization spec string.
friend class APPEARANCE_CONTROLS
SELECTION & GetCurrentSelection() override
Get the current selection from the canvas area.
void OnQuit(wxCommandEvent &event)
void ToggleNetInspector()
void NotifyFindByPropertiesDialog()
Notify the Find by Properties dialog that the selection has changed.
bool ExportVRML_File(const wxString &aFullFileName, double aMMtoWRMLunit, bool aIncludeUnspecified, bool aIncludeDNP, bool aExport3DFiles, bool aUseRelativePaths, const wxString &a3D_Subdir, double aXRef, double aYRef)
Create the file(s) exporting current BOARD to a VRML file.
void onCloseModelessBookReporterDialogs(wxCommandEvent &aEvent)
PCB_DESIGN_BLOCK_PANE * m_designBlocksPane
bool SavePcbFile(const wxString &aFileName, bool addToHistory=true, bool aChangeProject=true)
Write the board data structures to a aFileName.
bool canCloseWindow(wxCloseEvent &aCloseEvent) override
bool ExportSpecctraFile(const wxString &aFullFilename)
Export the current BOARD to a specctra dsn file.
DIALOG_BOARD_SETUP * m_boardSetupDlg
DIALOG_BOOK_REPORTER * GetInspectClearanceDialog()
bool importFile(const wxString &aFileName, int aFileType, const std::map< std::string, UTF8 > *aProperties=nullptr)
Load the given filename but sets the path to the current project path.
bool Export_IDF3(BOARD *aPcb, const wxString &aFullFileName, bool aUseThou, double aXRef, double aYRef, bool aIncludeUnspecified, bool aIncludeDNP)
Create an IDF3 compliant BOARD (*.emn) and LIBRARY (*.emp) file.
void ExchangeFootprint(FOOTPRINT *aExisting, FOOTPRINT *aNew, BOARD_COMMIT &aCommit, bool matchPadPositions, bool deleteExtraTexts=true, bool resetTextLayers=true, bool resetTextEffects=true, bool resetTextPositions=true, bool resetTextContent=true, bool resetFabricationAttrs=true, bool resetClearanceOverrides=true, bool reset3DModels=true, bool *aUpdated=nullptr)
Replace aExisting footprint by aNew footprint using the Existing footprint settings (position,...
wxTimer * m_eventCounterTimer
void Tracks_and_Vias_Size_Event(wxCommandEvent &event)
void SaveSettings(APP_SETTINGS_BASE *aCfg) override
Save common frame parameters to a configuration data file.
bool m_ShowLayerManagerTools
void saveProjectSettings() override
Save any design-related project settings associated with this frame.
void SendCrossProbeNetName(const wxString &aNetName)
Send a net name to Eeschema for highlighting.
static const wxString SearchPaneName()
wxChoice * m_SelTrackWidthBox
DIALOG_FIND_BY_PROPERTIES * m_findByPropertiesDialog
DIALOG_BOOK_REPORTER * m_inspectClearanceDlg
void OnFileHistory(wxCommandEvent &event)
DIALOG_BOOK_REPORTER * GetInspectConstraintsDialog()
A set of BOARD_ITEMs (i.e., without duplicates).
A holder to handle information on schematic or board items.
A progress reporter interface for use in multi-threaded environments.
A pure virtual class used to derive REPORTER objects from.
Handle a list of polygons defining a copper zone.
GAL_LAYER_ID
GAL layers are "virtual" layers, i.e.
PCB_LAYER_ID
A quick note on layer IDs:
LAST_PATH_TYPE
For storing PcbNew MRU paths of various types.
A filename or source description, a problem input line, a line number, a byte offset,...