* This function cannot be inline without including layer_widget.h in * here and we do not want to do that. *
*/ void syncLayerWidgetLayer(); /** * Function syncRenderStates * updates the "Render" checkboxes in the layer widget according * to current toggle values determined by IsElementVisible(), and is helpful * immediately after loading a BOARD which may have state information in it. */ void syncRenderStates(); /** * Function syncLayerVisibilities * updates each "Layer" checkbox in the layer widget according * to each layer's current visibility determined by IsLayerVisible(), and is * helpful immediately after loading a BOARD which may have state information in it. */ void syncLayerVisibilities(); virtual void unitsChangeRefresh() override; /** * Function doAutoSave * performs auto save when the board has been modified and not saved within the * auto save interval. * * @return true if the auto save was successful. */ virtual bool doAutoSave() override; /** * Function isautoSaveRequired * returns true if the board has been modified. */ virtual bool isAutoSaveRequired() const override; /** * Function duplicateZone * duplicates the given zone. * @param aDC is the current Device Context. * @param aZone is the zone to duplicate */ void duplicateZone( wxDC* aDC, ZONE_CONTAINER* aZone ); /** * Function moveExact * Move the selected item exactly */ void moveExact(); /** * Function duplicateItems * Duplicate selected item if possible and start a move * @param aIncrement increment the item number if appropriate */ void duplicateItems( bool aIncrement ) override; /** * Load the given filename but sets the path to the current project path. * @param full filepath of file to be imported. * @param aFileType PCB_FILE_T value for filetype */ bool importFile( const wxString& aFileName, int aFileType ); /** * Rematch orphaned zones and vias to schematic nets. */ bool fixEagleNets( const std::unordered_map* Populate a project file parameter array specific to Pcbnew. * Creating the parameter list at run time has the advantage of being able * to define local variables. The old method of statically building the array * at compile time requiring global variable definitions by design. *
* @return PARAM_CFG_ARRAY - it is only good until SetBoard() is called, so * don't keep it around past that event. */ PARAM_CFG_ARRAY GetProjectFileParameters(); /** * Function SaveProjectSettings * saves changes to the project settings to the project (.pro) file. * @param aAskForSave = true to open a dialog before saving the settings */ void SaveProjectSettings( bool aAskForSave ) override; /** * Load the current project's file configuration settings which are pertinent * to this PCB_EDIT_FRAME instance. * * @return always returns true. */ bool LoadProjectSettings(); /** * Function GetConfigurationSettings * returns the Pcbnew applications settings list. * * This replaces the old statically defined list that had the project * file settings and the application settings mixed together. This * was confusing and caused some settings to get saved and loaded * incorrectly. Currently, only the settings that are needed at start * up by the main window are defined here. There are other locally used * settings that are scattered throughout the Pcbnew source code. If you need * to define a configuration setting that needs to be loaded at run time, * this is the place to define it. * * @return - Reference to the list of applications settings. */ PARAM_CFG_ARRAY& GetConfigurationSettings(); void LoadSettings( wxConfigBase* aCfg ) override; void SaveSettings( wxConfigBase* aCfg ) override; wxConfigBase* GetSettings() { return config(); }; /** * Get the last net list read with the net list dialog box. * * @return - Absolute path and file name of the last net list file successfully read. */ wxString GetLastNetListRead(); /** * Set the last net list successfully read by the net list dialog box. * * Note: the file path is converted to a path relative to the project file path. If * the path cannot be made relative, than m_lastNetListRead is set to and empty * string. This could happen when the net list file is on a different drive than * the project file. The advantage of relative paths is that is more likely to * work when opening the same project from both Windows and Linux. * * @param aNetListFile - The last net list file with full path successfully read. */ void SetLastNetListRead( const wxString& aNetListFile ); ///> @copydoc EDA_DRAW_FRAME::GetHotKeyDescription() EDA_HOTKEY* GetHotKeyDescription( int aCommand ) const override; /** * Function OnHotKey. * ** Commands are case insensitive ** * Some commands are relatives to the item under the mouse cursor * @param aDC = current device context * @param aHotkeyCode = hotkey code (ascii or wxWidget code for special keys) * @param aPosition The cursor position in logical (drawing) units. * @param aItem = NULL or pointer on a EDA_ITEM under the mouse cursor */ bool OnHotKey( wxDC* aDC, int aHotkeyCode, const wxPoint& aPosition, EDA_ITEM* aItem = NULL ) override; /** * Function OnHotkeyDeleteItem * Delete the item found under the mouse cursor * Depending on the current active tool:: * Tool track * if a track is in progress: Delete the last segment * else delete the entire track * Tool module (footprint): * Delete the module. * @param aDC = current device context * @return true if an item was deleted */ bool OnHotkeyDeleteItem( wxDC* aDC ); /** * Function OnHotkeyPlaceItem * Place the item (footprint, track, text .. ) found under the mouse cursor * An item can be placed only if there is this item currently edited * Only a footprint, a pad or a track can be placed * @param aDC = current device context * @return true if an item was placed */ bool OnHotkeyPlaceItem( wxDC* aDC ); bool OnHotkeyEditItem( int aIdCommand ); /** * Function OnHotkeyCopyItem * returns the copy event id for copyable items. * @return Event id of a suitable copy event, zero when no copyable item found. */ int OnHotkeyCopyItem(); /** * Function OnHotkeyDuplicateOrArrayItem * Duplicate an item (optionally incrementing if necessary and possible) * or invoke array dialog and create an array * @param aIdCommand = the hotkey command id * @return true if item duplicated or arrayed */ bool OnHotkeyDuplicateOrArrayItem( int aIdCommand ); /** * Function OnHotkeyMoveItem * Moves or drag the item (footprint, track, text .. ) found under the mouse cursor * Only a footprint or a track can be dragged * @param aIdCommand = the hotkey command id * @return true if an item was moved */ bool OnHotkeyMoveItem( int aIdCommand ); /** * Function OnHotkeyRotateItem * Rotate the item (text or footprint) found under the mouse cursor * @note This command can be used with an item currently in edit. * Only some items can be rotated (footprints and texts). * @param aIdCommand = the hotkey command id * @return true if an item was moved */ bool OnHotkeyRotateItem( int aIdCommand ); /** * Function OnHotkeyFlipItem * Flip the item (text or footprint) found under the mouse cursor * @note This command can be used with an item currently in edit. * Only some items can be rotated (footprints and texts). * @param aIdCommand = the hotkey command id * @return true if an item was moved */ bool OnHotkeyFlipItem( int aIdCommand ); /** * Function OnHotkeyBeginRoute * If the current active layer is a copper layer, * and if no item currently edited, start a new track segmenton * the current copper layer. * If a new track is in progress, terminate the current segment and * start a new one. * @param aDC = current device context * @return a reference to the track if a track is created, or NULL */ TRACK * OnHotkeyBeginRoute( wxDC* aDC ); void OnCloseWindow( wxCloseEvent& Event ) override; void Process_Special_Functions( wxCommandEvent& event ); void Tracks_and_Vias_Size_Event( wxCommandEvent& event ); void OnSelectTool( wxCommandEvent& aEvent ); /** * Function OnResetModuleTextSizes * resets text size and width of all module text fields of given field * type to current settings in Preferences */ void OnResetModuleTextSizes( wxCommandEvent& event ); void ProcessMuWaveFunctions( wxCommandEvent& event ); void MuWaveCommand( wxDC* DC, const wxPoint& MousePos ); void RedrawActiveWindow( wxDC* DC, bool EraseBg ) override; void ReCreateHToolbar() override; void ReCreateAuxiliaryToolbar() override; void ReCreateVToolbar() override; void ReCreateMicrowaveVToolbar(); void ReCreateOptToolbar() override; void ReCreateMenuBar() override; /** * Re create the layer Box by clearing the old list, and building * le new one, from the new layers names and cole layers * @param aForceResizeToolbar = true to resize the parent toolbar * false if not needed (mainly in parent toolbar creation, * or when the layers names are not modified) */ void ReCreateLayerBox( bool aForceResizeToolbar = true ); /** * Function SetCurrentNetClass * Must be called after a netclass selection (or after a netclass parameter change * calls BOARD_DESIGN_SETTINGS::SetCurrentNetClass() and update trace width and via size * combo boxes on main toolbar * Initialize vias and tracks values displayed in comb boxes of the auxiliary toolbar * and some others parameters (netclass name ....) * @param aNetClassName = the new netclass name * @return true if lists of tracks and vias sizes are modified */ bool SetCurrentNetClass( const wxString& aNetClassName ); /** * Function OnModify * must be called after a board change to set the modified flag. ** Reloads the 3D view if required and calls the base PCB_BASE_FRAME::OnModify function * to update auxiliary information. *
*/ virtual void OnModify() override; /** * Function SetActiveLayer * will change the currently active layer to \a aLayer and also * update the PCB_LAYER_WIDGET. */ virtual void SetActiveLayer( PCB_LAYER_ID aLayer ) override; PCB_LAYER_WIDGET* GetLayerManager() { return m_Layers; } /** * Update the UI to reflect changes to the current layer's transparency. */ void OnUpdateLayerAlpha( wxUpdateUIEvent& aEvent ) override; /** * Function IsElementVisible * tests whether a given element category is visible. Keep this as an * inline function. * @param aElement is from the enum by the same name * @return bool - true if the element is visible. * @see enum GAL_LAYER_ID */ bool IsElementVisible( GAL_LAYER_ID aElement ) const; /** * Function SetElementVisibility * changes the visibility of an element category * @param aElement is from the enum by the same name * @param aNewState The new visibility state of the element category * @see enum PCB_LAYER_ID */ void SetElementVisibility( GAL_LAYER_ID aElement, bool aNewState ); /** * Function SetVisibleAlls * Set the status of all visible element categories and layers to VISIBLE */ void SetVisibleAlls(); /** * Function ReFillLayerWidget * changes out all the layers in m_Layers and may be called upon * loading a new BOARD. */ void ReFillLayerWidget(); /** * Function Show3D_Frame * displays the 3D view of current printed circuit board. */ void Show3D_Frame( wxCommandEvent& event ) override; ///> @copydoc EDA_DRAW_FRAME::UseGalCanvas() void UseGalCanvas( bool aEnable ) override; bool GeneralControl( wxDC* aDC, const wxPoint& aPosition, EDA_KEY aHotKey = 0 ) override; /** * Function ShowDesignRulesEditor * displays the Design Rules Editor. */ void ShowDesignRulesEditor( wxCommandEvent& event ); /* toolbars update UI functions: */ void PrepareLayerIndicator(); /* mouse functions events: */ void OnLeftClick( wxDC* DC, const wxPoint& MousePos ) override; void OnLeftDClick( wxDC* DC, const wxPoint& MousePos ) override; /** * Function OnRightClick * populates a popup menu with the choices appropriate for the current context. * The caller will add the ZOOM menu choices afterward. * @param aMousePos The current mouse position * @param aPopMenu The menu to add to. */ bool OnRightClick( const wxPoint& aMousePos, wxMenu* aPopMenu ) override; void OnSelectOptionToolbar( wxCommandEvent& event ); void OnFlipPcbView( wxCommandEvent& event ); void ToolOnRightClick( wxCommandEvent& event ) override; /* Block operations: */ /** * Function BlockCommand * Returns the block command internat code (BLOCK_MOVE, BLOCK_COPY...) * corresponding to the keys pressed (ALT, SHIFT, SHIFT ALT ..) when * block command is started by dragging the mouse. * @param aKey = the key modifiers (Alt, Shift ...) * @return the block command id (BLOCK_MOVE, BLOCK_COPY...) */ virtual int BlockCommand( EDA_KEY aKey ) override; /** * Function HandleBlockPlace() * Called after HandleBlockEnd, when a block command needs to be * executed after the block is moved to its new place * (bloc move, drag, copy .. ) * Parameters must be initialized in GetScreen()->m_BlockLocate */ virtual void HandleBlockPlace( wxDC* DC ) override; /** * Function HandleBlockEnd() * Handle the "end" of a block command, * i.e. is called at the end of the definition of the area of a block. * depending on the current block command, this command is executed * or parameters are initialized to prepare a call to HandleBlockPlace * in GetScreen()->m_BlockLocate * @return false if no item selected, or command finished, * true if some items found and HandleBlockPlace must be called later */ virtual bool HandleBlockEnd( wxDC* DC ) override; /** * Function Block_SelectItems * Uses GetScreen()->m_BlockLocate * select items within the selected block. * selected items are put in the pick list */ void Block_SelectItems(); /** * Function Block_Delete * deletes all items within the selected block. */ void Block_Delete(); /** * Function Block_Rotate * Rotate all items within the selected block. * The rotation center is the center of the block */ void Block_Rotate(); /** * Function Block_Flip * Flip items within the selected block. * The flip center is the center of the block */ void Block_Flip(); /** * Function Block_Move * move all items within the selected block. * New location is determined by the current offset from the selected * block's original location. */ void Block_Move(); /** * Function Block_Mirror_X * mirrors all items within the currently selected block in the X axis. */ void Block_Mirror_X(); /** * Function Block_Duplicate * Duplicate all items within the selected block. * New location is determined by the current offset from the selected * block's original location. */ void Block_Duplicate( bool aIncrement ); void Process_Settings( wxCommandEvent& event ); void OnConfigurePcbOptions( wxCommandEvent& aEvent ); void InstallDisplayOptionsDialog( wxCommandEvent& aEvent ); void InstallPcbGlobalDeleteFrame( const wxPoint& pos ); /** * Function GenFootprintsPositionFile * Calls DoGenFootprintsPositionFile to create a footprint position file * See DoGenFootprintsPositionFile for options and file format */ void GenFootprintsPositionFile( wxCommandEvent& event ); /** * Function DoGenFootprintsPositionFile * Creates an ascii footprint position file * @param aFullFileName = the full file name of the file to create * @param aUnitsMM = false to use inches, true to use mm in coordinates * @param aForceSmdItems = true to force all footprints with smd pads in list * = false to put only footprints with option "INSERT" in list * @param aSide = 0 to list footprints on BACK side, * 1 to list footprints on FRONT side * 2 to list footprints on both sides * @param aFormatCSV = true to use a comma separated file (CSV) format; defautl = false * @return the number of footprints found on aSide side, * or -1 if the file could not be created */ int DoGenFootprintsPositionFile( const wxString& aFullFileName, bool aUnitsMM, bool aForceSmdItems, int aSide, bool aFormatCSV = false ); /** * Function GenFootprintsReport * Calls DoGenFootprintsReport to create a footprint reprot file * See DoGenFootprintsReport for file format */ void GenFootprintsReport( wxCommandEvent& event ); /** * Function DoGenFootprintsReport * Creates an ascii footprint report file giving some infos on footprints * and board outlines * @param aFullFilename = the full file name of the file to create * @param aUnitsMM = false to use inches, true to use mm in coordinates * @return true if OK, false if error */ bool DoGenFootprintsReport( const wxString& aFullFilename, bool aUnitsMM ); void InstallDrillFrame( wxCommandEvent& event ); void GenD356File( wxCommandEvent& event ); void ToPostProcess( wxCommandEvent& event ); void OnFileHistory( wxCommandEvent& event ); /** * Function Files_io * @param event is the command event handler. * do nothing else than call Files_io_from_id with the * wxCommandEvent id */ void Files_io( wxCommandEvent& event ); /** * Function Files_io_from_id * Read and write board files * @param aId is an event ID ciming from file command events: * ID_LOAD_FILE * ID_MENU_READ_BOARD_BACKUP_FILE * ID_MENU_RECOVER_BOARD_AUTOSAVE * ID_APPEND_FILE * ID_NEW_BOARD * ID_SAVE_BOARD * ID_COPY_BOARD_AS * ID_SAVE_BOARD_AS * Files_io_from_id prepare parameters and calls the specialized function */ void Files_io_from_id( int aId ); /** * Function OpenProjectFiles (was LoadOnePcbFile) * loads a KiCad board (.kicad_pcb) from \a aFileName. * * @param aFileSet - hold the BOARD file to load, a vector of one element. * * @param aCtl - KICTL_ bits, one to indicate that an append of the board file * aFileName to the currently loaded file is desired. * @see #KIWAY_PLAYER for bit defines. * * @return bool - false if file load fails, otherwise true. bool LoadOnePcbFile( const wxString& aFileName, bool aAppend = false, bool aForceFileDialog = false ); */ bool OpenProjectFiles( const std::vector* A microvia is a small via restricted to 2 near neighbor layers * because its is hole is made by laser which can penetrate only one layer * It is mainly used to connect BGA to the first inner layer * And it is allowed from an external layer to the first inner layer *
*/ bool IsMicroViaAcceptable( void ); /** * Function Other_Layer_Route * operates in one of two ways. If argument track is NULL, then swap the * active layer between m_Route_Layer_TOP and m_Route_Layer_BOTTOM. If a * track is in progress (track is not NULL), and if DRC allows it, place * a via on the end of the current track, and then swap the current active * layer and start a new segment on the new layer. * @param track A TRACK* to append the via to or NULL. * @param DC A device context to draw on. * @return bool - true if the operation was successful, else false such as * the case where DRC would not allow a via. */ bool Other_Layer_Route( TRACK* track, wxDC* DC ); void HighlightUnconnectedPads( wxDC* DC ); /** * Function Delete_Segment * removes a track segment. * If a new track is in progress: delete the current new segment. * Otherwise, delete segment under the mouse cursor. */ TRACK* Delete_Segment( wxDC* DC, TRACK* Track ); void Delete_Track( wxDC* DC, TRACK* Track ); void Delete_net( wxDC* DC, TRACK* Track ); /** * Function Remove_One_Track * removes 1 track/ * The leading segment is removed and all adjacent segments * until a pad or a junction point of more than 2 segments is found */ void Remove_One_Track( wxDC* DC, TRACK* pt_segm ); /** * Function Reset_All_Tracks_And_Vias_To_Netclass_Values * Reset all tracks width and/or vias diameters and drill * to their default Netclass value * @param aTrack : bool true to modify tracks * @param aVia : bool true to modify vias */ bool Reset_All_Tracks_And_Vias_To_Netclass_Values( bool aTrack, bool aVia ); /** * Function Change_Net_Tracks_And_Vias_Sizes * Reset all tracks width and vias diameters and drill * to their default Netclass value or current values * @param aNetcode : the netcode of the net to edit * @param aUseNetclassValue : bool. True to use netclass values, false to * use current values */ bool Change_Net_Tracks_And_Vias_Sizes( int aNetcode, bool aUseNetclassValue ); /** * Function Edit_Track_Width * Modify a full track width (using DRC control). * a full track is the set of track segments between 2 ends: pads or a * point that has more than 2 segments ends connected * @param aDC = the curred device context (can be NULL) * @param aTrackSegment = a segment or via on the track to change */ void Edit_Track_Width( wxDC* aDC, TRACK* aTrackSegment ); /** * Function Edit_TrackSegm_Width * Modify one track segment width or one via diameter (using DRC control). * @param aDC = the current device context (can be NULL) * @param aTrackItem = the track segment or via to modify */ void Edit_TrackSegm_Width( wxDC* aDC, TRACK* aTrackItem ); /** * Function Begin_Route * Starts a new track and/or establish of a new track point. * * For a new track: * - Search the netname of the new track from the starting point * if it is on a pad or an existing track * - Highlight all this net * If a track is in progress: * - Call DRC * - If DRC is OK: finish the track segment and starts a new one. * @param aTrack = the current track segment, or NULL to start a new track * @param aDC = the current device context * @return a pointer to the new track segment or null if not created (DRC error) */ TRACK* Begin_Route( TRACK* aTrack, wxDC* aDC ); /** * Function End_Route * Terminates a track currently being created * @param aTrack = the current track segment in progress * @param aDC = the current device context * @return true if the track was created, false if not (due to a DRC error) */ bool End_Route( TRACK* aTrack, wxDC* aDC ); void Attribut_Segment( TRACK* track, wxDC* DC, bool Flag_On ); void Attribut_Track( TRACK* track, wxDC* DC, bool Flag_On ); void Attribut_net( wxDC* DC, int net_code, bool Flag_On ); /** * Function StartMoveOneNodeOrSegment * initializes the parameters to move one via or/and a terminal point of a track segment * The terminal point of other connected segments (if any) are moved too. */ void StartMoveOneNodeOrSegment( TRACK* aTrack, wxDC* aDC, int aCommand ); bool PlaceDraggedOrMovedTrackSegment( TRACK* Track, wxDC* DC ); /** * @todo This function is broken, because it merge segments having different * widths or without any connectivity test. * 2 collinear segments can be merged only if no other segment or via is * connected to the common point and if they have the same width. See * cleanup.cpp for merge functions and consider MarkTrace() to locate segments * that can be merged */ bool MergeCollinearTracks( TRACK* track, wxDC* DC, int end ); void Start_DragTrackSegmentAndKeepSlope( TRACK* track, wxDC* DC ); void SwitchLayer( wxDC* DC, PCB_LAYER_ID layer ) override; /** * Function Add45DegreeSegment * adds a track segment between 2 tracks segments if these 2 segments * make a 90 deg angle, in order to have 45 deg track segments * Its only works on horizontal or vertical segments. * * @param aDC The wxDC device context to draw on. * @return A bool value true if ok or false if not. */ bool Add45DegreeSegment( wxDC* aDC ); /** * Function EraseRedundantTrack * Called after creating a track * Remove (if exists) the old track that have the same starting and the * same ending point as the new created track * (this is the redunding track) * @param aDC = the current device context (can be NULL) * @param aNewTrack = the new created track (a pointer to a segment of the * track list) * @param aNewTrackSegmentsCount = number of segments in this new track * @param aItemsListPicker = the list picker to use for an undo command * (can be NULL) */ int EraseRedundantTrack( wxDC* aDC, TRACK* aNewTrack, int aNewTrackSegmentsCount, PICKED_ITEMS_LIST* aItemsListPicker ); /** * Function SetTrackSegmentWidth * Modify one track segment width or one via diameter (using DRC control). * Basic routine used by other routines when editing tracks or vias * @param aTrackItem = the track segment or via to modify * @param aItemsListPicker = the list picker to use for an undo command * (can be NULL) * @param aUseNetclassValue = true to use NetClass value, false to use * current designSettings value * @return true if done, false if no not change (because DRC error) */ bool SetTrackSegmentWidth( TRACK* aTrackItem, PICKED_ITEMS_LIST* aItemsListPicker, bool aUseNetclassValue ); // zone handling /** * Function Delete_OldZone_Fill (obsolete) * Used for compatibility with old boards * Remove the zone filling which include the segment aZone, or the zone * which have the given time stamp. * For old boards, a zone is a group of SEGZONE segments which have the same TimeStamp * @param aZone = zone segment within the zone to delete. Can be NULL * @param aTimestamp = Timestamp for the zone to delete, used if aZone == * NULL */ void Delete_OldZone_Fill( SEGZONE* aZone, timestamp_t aTimestamp = 0 ); /** * Function Delete_LastCreatedCorner * Used only while creating a new zone outline * Remove and delete the current outline segment in progress * @return 0 if no corner in list, or corner number */ int Delete_LastCreatedCorner( wxDC* DC ); /** * Function Begin_Zone * either initializes the first segment of a new zone, or adds an * intermediate segment. * A new zone can be: * created from scratch: the user will be prompted to define parameters (layer, clearence ...) * created from a similar zone (s_CurrentZone is used): parameters are copied from * s_CurrentZone * created as a cutout (an hole) inside s_CurrentZone */ int Begin_Zone( wxDC* DC ); /** * Function End_Zone * terminates (if no DRC error ) the zone edge creation process * @param DC = current Device Context * @return true if Ok, false if DRC error */ bool End_Zone( wxDC* DC ); /** * Function Fill_Zone * Calculate the zone filling for the outline zone_container * The zone outline is a frontier, and can be complex (with holes) * The filling starts from starting points like pads, tracks. * If exists the old filling is removed * @param aZone = zone to fill * @return error level (0 = no error) */ int Fill_Zone( ZONE_CONTAINER* aZone ); /** * Function Fill_All_Zones * Fill all zones on the board * The old fillings are removed * @param aActiveWindow = the current active window, if a progress bar is shown. * the progress bar will be on top of aActiveWindow * aActiveWindow = NULL to do not display a progress bar */ int Fill_All_Zones( wxWindow * aActiveWindow ); /** * Function Check_All_Zones * Checks for out-of-date fills and fills them if requested by the user. * @param aActiveWindow */ void Check_All_Zones( wxWindow* aActiveWindow ); /** * Function Add_Zone_Cutout * Add a cutout zone to a given zone outline * @param DC = current Device Context * @param zone_container = parent zone outline */ void Add_Zone_Cutout( wxDC* DC, ZONE_CONTAINER* zone_container ); /** * Function Add_Similar_Zone * Add a zone to a given zone outline. * if the zones are overlapping they will be merged * @param DC = current Device Context * @param zone_container = parent zone outline */ void Add_Similar_Zone( wxDC* DC, ZONE_CONTAINER* zone_container ); /** * Function Edit_Zone_Params * Edit params (layer, clearance, ...) for a zone outline */ void Edit_Zone_Params( wxDC* DC, ZONE_CONTAINER* zone_container ); /** * Function Start_Move_Zone_Corner * Prepares a move corner in a zone outline, * called from a move corner command (IsNewCorner = false), * or a create new cornet command (IsNewCorner = true ) */ void Start_Move_Zone_Corner( wxDC* DC, ZONE_CONTAINER* zone_container, int corner_id, bool IsNewCorner ); /** * Function Start_Move_Zone_Corner * Prepares a drag edge in an existing zone outline, */ void Start_Move_Zone_Drag_Outline_Edge( wxDC* DC, ZONE_CONTAINER* zone_container, int corner_id ); /** * Function End_Move_Zone_Corner_Or_Outlines * Terminates a move corner in a zone outline, or a move zone outlines * @param DC = current Device Context (can be NULL) * @param zone_container: the given zone */ void End_Move_Zone_Corner_Or_Outlines( wxDC* DC, ZONE_CONTAINER* zone_container ); /** * Function End_Move_Zone_Corner_Or_Outlines * Remove the currently selected corner in a zone outline * the .m_CornerSelection is used as corner selection */ void Remove_Zone_Corner( wxDC* DC, ZONE_CONTAINER* zone_container ); /** * Function Delete_Zone * Remove the zone which include the segment aZone, or the zone which have * the given time stamp. A zone is a group of segments which have the * same TimeStamp * @param DC = current Device Context (can be NULL) * @param zone_container = zone to modify * the member .m_CornerSelection is used to find the outline to remove. * if the outline is the main outline, all the zone is removed * otherwise, the hole is deleted */ void Delete_Zone_Contour( wxDC* DC, ZONE_CONTAINER* zone_container ); /** * Function Start_Move_Zone_Outlines * Initialize parameters to move an existing zone outlines. * @param DC = current Device Context (can be NULL) * @param zone_container: the given zone to move */ void Start_Move_Zone_Outlines( wxDC* DC, ZONE_CONTAINER* zone_container ); // Target handling PCB_TARGET* CreateTarget( wxDC* DC ); void DeleteTarget( PCB_TARGET* aTarget, wxDC* DC ); void BeginMoveTarget( PCB_TARGET* aTarget, wxDC* DC ); void PlaceTarget( PCB_TARGET* aTarget, wxDC* DC ); void ShowTargetOptionsDialog( PCB_TARGET* aTarget, wxDC* DC ); // Graphic segments type DRAWSEGMENT handling: DRAWSEGMENT* Begin_DrawSegment( DRAWSEGMENT* Segment, STROKE_T shape, wxDC* DC ); void End_Edge( DRAWSEGMENT* Segment, wxDC* DC ); void Delete_Segment_Edge( DRAWSEGMENT* Segment, wxDC* DC ); void Delete_Drawings_All_Layer( PCB_LAYER_ID aLayer ); // Dimension handling: void ShowDimensionPropertyDialog( DIMENSION* aDimension, wxDC* aDC ); DIMENSION* EditDimension( DIMENSION* aDimension, wxDC* aDC ); void DeleteDimension( DIMENSION* aDimension, wxDC* aDC ); void BeginMoveDimensionText( DIMENSION* aItem, wxDC* DC ); void PlaceDimensionText( DIMENSION* aItem, wxDC* DC ); // netlist handling: void InstallNetlistFrame( wxDC* DC ); /** * Function ReadPcbNetlist * reads \a aNetlistFileName and updates the footprints (load missing footprints and * delete on demand extra footprints) on the board. * Update connectivity info, references, values and "TIME STAMP" * * @param aNetlistFileName = netlist file name (*.net) * @param aCmpFileName = cmp/footprint link file name (*.cmp). * if not found or empty, only the netlist will be used * @param aReporter is a pointer to a #REPORTER object to write display messages. * can be NULL. * @param aChangeFootprint if true, footprints that have changed in netlist will be changed * @param aDeleteBadTracks if true, erroneous tracks will be deleted * @param aDeleteExtraFootprints if true, remove unlocked footprints that are not in netlist * @param aSelectByTimestamp if true, use timestamp instead of reference to identify * footprints from components (use after reannotation of the * schematic) * @param aDeleteSinglePadNets if true, remove nets counting only one pad * and set net code to 0 for these pads * @param aIsDryRun performs a dry run without making any changes if true. */ void ReadPcbNetlist( const wxString& aNetlistFileName, const wxString& aCmpFileName, REPORTER* aReporter, bool aChangeFootprint, bool aDeleteBadTracks, bool aDeleteExtraFootprints, bool aSelectByTimestamp, bool aDeleteSinglePadNets, bool aIsDryRun ); /** * Function RemoveMisConnectedTracks * finds all track segments which are mis-connected (to more than one net). * When such a bad segment is found, it is flagged to be removed. * All tracks having at least one flagged segment are removed. * @return true if any change is made */ bool RemoveMisConnectedTracks(); // Autoplacement: void OnPlaceOrRouteFootprints( wxCommandEvent& event ); #if defined( KICAD_SCRIPTING_WXPYTHON ) /** * Function ScriptingConsoleEnableDisable * enables or disabled the scripting console */ void ScriptingConsoleEnableDisable( wxCommandEvent& aEvent ); void OnUpdateScriptingConsoleState( wxUpdateUIEvent& aEvent ); #endif void OnSelectAutoPlaceMode( wxCommandEvent& aEvent ); /** * Function OnOrientFootprints * install the dialog box for the common Orient Footprints */ void OnOrientFootprints( wxCommandEvent& event ); /** * Function ReOrientModules * Set the orientation of footprints * @param ModuleMask = mask (wildcard allowed) selection * @param Orient = new orientation * @param include_fixe = true to orient locked footprints * @return true if some footprints modified, false if no change */ bool ReOrientModules( const wxString& ModuleMask, double Orient, bool include_fixe ); void LockModule( MODULE* aModule, bool aLocked ); /** * Function SpreadFootprints * Footprints (after loaded by reading a netlist for instance) are moved * to be in a small free area (outside the current board) without overlapping. * @param aFootprints: a list of footprints to be spread out. * @param aMoveFootprintsOutsideBoardOnly: true to move only * footprints outside the board outlines * (they are outside if the position of a footprint anchor is outside * the board outlines bounding box). It imply the board outlines exist * @param aCheckForBoardEdges: true to try to place footprints outside of * board edges, if aSpreadAreaPosition is incorrectly chosen. * @param aSpreadAreaPosition the position of the upper left corner of the * area used to spread footprints * @param aPrepareUndoCommand = true (defualt) to commit a undo command for the * spread footprints, false to do just the spread command * (no undo specific to this move command) */ void SpreadFootprints( std::vector* If file name defined by PCB_SCREEN::m_FileName is not set, the title is set to the * application name appended with no file. Otherwise, the title is set to the full path * and file name and read only is appended to the title if the user does not have write * access to the file. *
*/ void UpdateTitle(); /** * Allows Pcbnew to install its preferences panel into the preferences dialog. */ void InstallPreferences( PAGED_DIALOG* aParent ) override; /** * Called after the preferences dialog is run. */ void CommonSettingsChanged() override; void SyncMenusAndToolbars( wxEvent& aEvent ) override; DECLARE_EVENT_TABLE() }; #endif // WXPCB_STRUCT_H_