23#include <wx/hyperlink.h>
31using namespace std::placeholders;
109 _(
"Finish Track" ),
_(
"Stops laying the current track." ),
115 _(
"Place Through Via" ),
116 _(
"Adds a through-hole via at the end of currently routed track." ),
122 _(
"Place Blind/Buried Via" ),
123 _(
"Adds a blind or buried via at the end of currently routed track."),
129 _(
"Place Microvia" ),
_(
"Adds a microvia at the end of currently routed track." ),
133 "pcbnew.InteractiveRouter.SelLayerAndPlaceVia",
136 _(
"Select Layer and Place Through Via..." ),
137 _(
"Select a layer, then add a through-hole via at the end of currently routed track." ),
142 "pcbnew.InteractiveRouter.SelLayerAndPlaceBlindVia",
145 _(
"Select Layer and Place Blind/Buried Via..." ),
146 _(
"Select a layer, then add a blind or buried via at the end of currently routed track." ),
151 "pcbnew.InteractiveRouter.SelLayerAndPlaceMicroVia",
154 _(
"Select Layer and Place Micro Via..." ),
155 _(
"Select a layer, then add a micro via at the end of currently routed track." ),
162 _(
"Custom Track/Via Size..." ),
163 _(
"Shows a dialog for changing the track width and via size." ),
169 _(
"Switch Track Posture" ),
170 _(
"Switches posture of the currently routed track." ),
176 _(
"Track Corner Mode" ),
177 _(
"Switches between sharp/rounded and 45°/90° corners when routing tracks." ),
181#define _(s) wxGetTranslation((s))
188 m_inRouterTool( false )
201 SetTitle(
_(
"Select Track/Via Width" ) );
220 _(
"Route using the width of the starting track." ), wxITEM_CHECK );
225 _(
"Use track and via sizes from the net class" ), wxITEM_CHECK );
230 _(
"Specify custom track and via sizes" ), wxITEM_CHECK );
241 msg =
_(
"Track netclass width" );
246 Append( menuIdx, msg, wxEmptyString, wxITEM_CHECK );
257 msg =
_(
"Via netclass values" );
260 if(
via.m_Drill > 0 )
262 msg.Printf(
_(
"Via %s, hole %s" ),
268 msg.Printf(
_(
"Via %s" ),
274 Append( menuIdx, msg, wxEmptyString, wxITEM_CHECK );
282 int id = aEvent.GetId();
334 SetTitle(
_(
"Select Differential Pair Dimensions" ) );
350 _(
"Use differential pair dimensions from the net class" ), wxITEM_CHECK );
355 _(
"Specify custom differential pair dimensions" ), wxITEM_CHECK );
368 if( diffPair.
m_Gap <= 0 )
372 msg.Printf(
_(
"Width %s" ),
377 msg.Printf(
_(
"Width %s, via gap %s" ),
386 msg.Printf(
_(
"Width %s, gap %s" ),
392 msg.Printf(
_(
"Width %s, gap %s, via gap %s" ),
400 Append( menuIdx, msg, wxEmptyString, wxITEM_CHECK );
408 int id = aEvent.GetId();
454 menu.
SetTitle(
_(
"Interactive Router" ) );
472 auto notRoutingCond =
484 int currentNet = currentNets.empty() ? -1 : currentNets[0];
488 return ratsnest && !ratsnest->
GetEdges().empty();
492 menu.AddSeparator( 1 );
495 menu.AddSeparator( haveHighlight, 2 );
556 wxString cwd = wxGetCwd();
558 wxFileName fname_log;
559 fname_log.SetPath( cwd );
560 fname_log.SetName(
"pns.log" );
562 wxFileName fname_dump( cwd );
563 fname_dump.SetPath( cwd );
564 fname_dump.SetName(
"pns.dump" );
566 wxFileName fname_settings( cwd );
567 fname_settings.SetPath( cwd );
568 fname_settings.SetName(
"pns.settings" );
570 wxString msg =
wxString::Format(
_(
"Event file: %s\nBoard dump: %s" ), fname_log.GetFullPath(), fname_log.GetFullPath() );
572 int rv =
OKOrCancelDialog(
nullptr,
_(
"Save router log"),
_(
"Would you like to save the router\nevent log for debugging purposes?"), msg,
_(
"OK"),
_(
"Cancel") );
577 FILE *f = fopen( fname_settings.GetFullPath().c_str(),
"wb" );
579 fprintf(f,
"%s\n", settingsStr.c_str( ) );
582 f = fopen( fname_log.GetFullPath().c_str(),
"wb" );
586 const auto& events = logger->GetEvents();
588 for(
const auto& evt : events)
590 fprintf( f,
"event %d %d %d %s %d %d %d %d %d %d %d\n", evt.p.x, evt.p.y, evt.type,
591 static_cast<const char*
>( evt.uuid.AsString().c_str() ),
592 evt.sizes.TrackWidth(),
593 evt.sizes.ViaDiameter(),
594 evt.sizes.ViaDrill(),
595 evt.sizes.TrackWidthIsExplicit() ? 1: 0,
596 evt.sizes.GetLayerBottom(),
597 evt.sizes.GetLayerTop(),
598 static_cast<int>( evt.sizes.ViaType() ) );
611 std::vector<PNS::ITEM*> added, removed, heads;
614 for(
auto item : removed )
616 fprintf(f,
"removed %s\n", item->Parent()->m_Uuid.AsString().c_str().AsChar() );
619 for(
auto item : added )
621 fprintf(f,
"added %s\n", item->Format().c_str() );
624 for(
auto item : heads )
626 fprintf(f,
"head %s\n", item->Format().c_str() );
683 if( currentLayer != activeLayer )
704 std::shared_ptr<DRC_ENGINE>& drcEngine = bds.
m_DRCEngine;
709 dummyTrack.
SetNetCode( nets.empty() ? 0 : nets[0] );
716 if( !constraint.
IsNull() )
743 dummyTrackB.
SetLayer( targetLayer );
749 if( !constraint.
IsNull() )
762 if( !constraint.
IsNull() )
788 wxASSERT_MSG(
false, wxT(
"Unhandled via type" ) );
908 for(
size_t i = 0; i < layers.size(); i++ )
917 idx = ( idx + 1 ) % layers.size();
918 targetLayer = layers[idx];
927 for(
size_t i = 0; i < layers.size(); i++ )
936 idx = ( idx > 0 ) ? ( idx - 1 ) : ( layers.size() - 1 );
937 targetLayer = layers[idx];
948 if( targetLayer == currentLayer )
969 bool selectLayer =
false;
974 const int actViaFlags = aEvent.
Parameter<intptr_t>();
989 not_allowed_ly.set( currentLayer );
994 int previous_layer = currentLayer ==
B_Cu ? layerCount - 2
997 int next_layer = currentLayer >= layerCount-2 ?
B_Cu
1002 if( previous_layer >=
F_Cu && previous_layer != currentLayer )
1003 not_allowed_ly.reset( previous_layer );
1005 if( next_layer != currentLayer )
1006 not_allowed_ly.reset( next_layer );
1010 not_allowed_ly, endPoint );
1021 if( currentLayer == targetLayer )
1032 && ( ( targetLayer ==
B_Cu && currentLayer ==
F_Cu )
1033 || ( targetLayer ==
F_Cu && currentLayer ==
B_Cu ) ) )
1046 currentLayer = pairTop;
1047 targetLayer = pairBottom;
1053 if( pairTop > pairBottom ) std::swap( pairTop, pairBottom );
1055 if( currentLayer == pairTop && pairBottom == pairTop+1 )
1057 targetLayer = pairBottom;
1059 else if( currentLayer == pairBottom && pairBottom == pairTop+1 )
1061 targetLayer = pairTop;
1063 else if( currentLayer ==
F_Cu || currentLayer ==
In1_Cu )
1066 currentLayer =
F_Cu;
1068 if( layerCount > 2 )
1073 else if( currentLayer ==
B_Cu || currentLayer == layerCount - 2 )
1076 currentLayer =
B_Cu,
1090 if( currentLayer == pairTop || currentLayer == pairBottom )
1094 currentLayer = pairTop;
1095 targetLayer = pairBottom;
1101 targetLayer = pairTop;
1105 if( currentLayer == targetLayer )
1108 infobar->
ShowMessageFor(
_(
"Blind/buried via need 2 different layers." ),
1117 wxFAIL_MSG( wxT(
"unexpected via type" ) );
1140 if( !constraint.
IsNull() )
1146 if( !constraint.
IsNull() )
1193 if( !
getView()->IsLayerVisible( routingLayer ) )
1206 frame()->GetScreen()->m_Route_Layer_BOTTOM );
1236 m_router->ClearViewDecorations();
1285 auto syncRouterAndFrameLayer =
1293 if( !
getView()->IsLayerVisible( routingLayer ) )
1310 if( evt->IsCancelInteractive() )
1318 if( evt->IsMotion() )
1331 bool* autoRouted = evt->Parameter<
bool*>();
1338 if( autoRouted !=
nullptr )
1347 if( autoRouted !=
nullptr )
1349 *autoRouted =
false;
1363 syncRouterAndFrameLayer();
1377 bool forceFinish = evt->Modifier(
MD_SHIFT );
1382 if( needLayerSwitch )
1386 syncRouterAndFrameLayer();
1422 else if( evt->IsCancelInteractive() || evt->IsActivate()
1428 if( evt->IsActivate() && !evt->IsMoveTool() )
1433 else if( evt->IsUndoRedo() )
1451 evt->SetPassEvent();
1468 if( settingsDlg.ShowModal() == wxID_OK )
1487 settingsDlg.ShowModal();
1579 std::vector<BOARD_CONNECTED_ITEM*> itemList;
1585 const PADS& fpPads = (
static_cast<FOOTPRINT*
>( item ) )->Pads();
1588 itemList.push_back(
pad );
1599 bool groupStart =
true;
1606 RN_NET* net = connectivity->GetRatsnestForNet( item->GetNetCode() );
1607 std::vector<std::shared_ptr<const CN_ANCHOR>> anchors;
1611 std::shared_ptr<const CN_ANCHOR> target = edge.GetTargetNode();
1612 std::shared_ptr<const CN_ANCHOR> source = edge.GetSourceNode();
1614 if( source->Parent() == item )
1615 anchors.push_back( edge.GetSourceNode() );
1616 else if( target->Parent() == item )
1617 anchors.push_back( edge.GetTargetNode() );
1621 for( std::shared_ptr<const CN_ANCHOR>
anchor : anchors )
1636 bool autoRouted =
false;
1713 if( !evt->IsDrag() )
1716 if( evt->IsCancelInteractive() )
1721 else if( evt->IsActivate() )
1723 if( evt->IsMoveTool() || evt->IsEditorTool() )
1742 else if( evt->IsMotion() )
1760 evt->SetPassEvent(
false );
1768 if( evt->HasPosition() )
1786 else if( evt->IsKeyPressed() )
1791 evt->SetPassEvent();
1799 evt->SetPassEvent();
1825 KIDIALOG dlg(
frame(),
_(
"The selected item is locked." ),
_(
"Confirmation" ),
1826 wxOK | wxCANCEL | wxICON_WARNING );
1827 dlg.SetOKLabel(
_(
"Drag Anyway" ) );
1869 if( evt->IsMotion() )
1874 else if( evt->IsClick(
BUT_LEFT ) )
1883 else if( evt->IsCancelInteractive() || evt->IsActivate() )
1888 if( evt->IsActivate() && !evt->IsMoveTool() )
1893 else if( evt->IsUndoRedo() )
1921 evt->SetPassEvent();
1926 evt->SetPassEvent();
1959 if( arcs > 0 || vias > 1 || traces > 2 || vias + traces < 1 )
1965 for(
int i = 0; !reference && i < aCollector.
GetCount(); i++ )
1966 reference =
dynamic_cast<PCB_TRACK*
>( aCollector[i] );
1976 refPoint = reference->
GetEnd();
1980 for(
int i = 0; i < aCollector.
GetCount(); i++ )
1984 if( neighbor && neighbor != reference )
1989 if( neighbor->
GetStart() != refPoint && neighbor->
GetEnd() != refPoint )
1996 aCollector.
Append( reference );
2014 if( item->
IsType( { PCB_FOOTPRINT_T } ) )
2049 bool wasLocked =
false;
2073 std::vector<BOARD_ITEM*> dynamicItems;
2074 std::unique_ptr<CONNECTIVITY_DATA> dynamicData =
nullptr;
2086 itemsToDrag.
Add( solid );
2090 if( connectivityData->GetRatsnestForPad(
pad ).size() > 0 )
2091 dynamicItems.push_back(
pad );
2095 if( showCourtyardConflicts )
2101 dynamicData = std::make_unique<CONNECTIVITY_DATA>( dynamicItems,
true );
2102 connectivityData->BlockRatsnestItems( dynamicItems );
2109 itemsToDrag.
Add( startItem );
2150 int dragMode = aEvent.
Parameter<int64_t> ();
2186 bool hasMouseMoved =
false;
2192 if( evt->IsCancelInteractive() )
2199 else if( evt->IsMotion() || evt->IsDrag(
BUT_LEFT ) )
2201 hasMouseMoved =
true;
2217 previewItem =
static_cast<BOARD_ITEM*
>( drawing->Clone() );
2222 shape->FP_SHAPE::Move( fp_offset );
2226 previewItem->
Move( offset );
2236 &&
pad->GetDrillSize().x == 0 )
2239 previewItem->
Move( offset );
2252 previewItem->
Move( offset );
2257 previewItem->
Move( offset );
2263 previewItem =
static_cast<BOARD_ITEM*
>( zone->Clone() );
2264 previewItem->
Move( offset );
2269 if( showCourtyardConflicts )
2272 courtyardClearanceDRC.
Run();
2278 dynamicData->Move( offset - lastOffset );
2279 lastOffset = offset;
2280 connectivityData->ComputeLocalRatsnest( dynamicItems, dynamicData.get(), offset );
2283 else if( hasMouseMoved && ( evt->IsMouseUp(
BUT_LEFT ) || evt->IsClick(
BUT_LEFT ) ) )
2289 else if( evt->IsUndoRedo() )
2317 evt->SetPassEvent();
2322 evt->SetPassEvent();
2345 connectivityData->ClearLocalRatsnest();
2405 KIDIALOG dlg(
frame(),
_(
"The selected item is locked." ),
_(
"Confirmation" ),
2406 wxOK | wxCANCEL | wxICON_WARNING );
2407 dlg.SetOKLabel(
_(
"Break Track" ) );
2431 if( sizeDlg.ShowModal() == wxID_OK )
2467 std::vector<MSG_PANEL_ITEM> items;
2474 wxString description;
2479 wxASSERT( nets.size() >= 2 );
2493 if( netclassA == netclassB )
2494 netclass = netclassA->
GetName();
2496 netclass = netclassA->
GetName() + wxT(
", " ) + netclassB->
GetName();
2501 else if( !nets.empty() )
2514 description =
_(
"Routing Track" );
2515 secondary =
_(
"(no net)" );
2518 items.emplace_back( description, secondary );
2520 wxString cornerMode;
2524 cornerMode =
_(
"Free-angle" );
2530 case DIRECTION_45::CORNER_MODE::MITERED_45: cornerMode =
_(
"45-degree" );
break;
2531 case DIRECTION_45::CORNER_MODE::ROUNDED_45: cornerMode =
_(
"45-degree rounded" );
break;
2532 case DIRECTION_45::CORNER_MODE::MITERED_90: cornerMode =
_(
"90-degree" );
break;
2533 case DIRECTION_45::CORNER_MODE::ROUNDED_90: cornerMode =
_(
"90-degree rounded" );
break;
2538 items.emplace_back(
_(
"Corner Style" ), cornerMode );
2540#define FORMAT_VALUE( x ) frame()->MessageTextFromValue( x )
#define LEGACY_HK_NAME(x)
@ switch_corner_rounding_shape
static TOOL_ACTION cancelInteractive
static TOOL_ACTION pasteSpecial
static const ADVANCED_CFG & GetCfg()
Get the singleton instance's config, which is shared by all consumers.
void SetLayerVisible(int aLayer, bool isVisible)
A base class derived from BOARD_ITEM for items that can be connected and have a net,...
bool SetNetCode(int aNetCode, bool aNoAssert)
Set net using a net code.
Container for design settings for a BOARD object.
void UseCustomTrackViaSize(bool aEnabled)
Enables/disables custom track/via size settings.
void SetCustomDiffPairWidth(int aWidth)
Sets custom track width for differential pairs (i.e.
void SetDiffPairIndex(unsigned aIndex)
int GetCurrentViaSize() const
std::shared_ptr< DRC_ENGINE > m_DRCEngine
bool m_UseConnectedTrackWidth
std::vector< DIFF_PAIR_DIMENSION > m_DiffPairDimensionsList
bool m_TempOverrideTrackWidth
void SetCustomDiffPairGap(int aGap)
Sets custom gap for differential pairs (i.e.
void SetTrackWidthIndex(unsigned aIndex)
Set the current track width list index to aIndex.
void SetViaSizeIndex(unsigned aIndex)
Set the current via size list index to aIndex.
unsigned GetTrackWidthIndex() const
bool UseNetClassVia() const
Return true if netclass values should be used to obtain appropriate via size.
unsigned GetViaSizeIndex() const
bool UseNetClassTrack() const
Return true if netclass values should be used to obtain appropriate track width.
bool UseNetClassDiffPair() const
Return true if netclass values should be used to obtain appropriate diff pair dimensions.
int GetCopperLayerCount() const
void UseCustomDiffPairDimensions(bool aEnabled)
Enables/disables custom differential pair dimensions.
std::vector< int > m_TrackWidthList
unsigned GetDiffPairIndex() const
int GetCurrentViaDrill() const
std::vector< VIA_DIMENSION > m_ViasDimensionsList
void SetCustomDiffPairViaGap(int aGap)
Sets custom via gap for differential pairs (i.e.
A base class for any item which can be embedded within the BOARD container class, and therefore insta...
virtual void SetLocked(bool aLocked)
virtual void Move(const VECTOR2I &aMoveVector)
Move this object.
virtual void SetLayer(PCB_LAYER_ID aLayer)
Set the layer this item is on.
virtual const BOARD * GetBoard() const
Return the BOARD in which this BOARD_ITEM resides, or NULL if none.
virtual bool IsLocked() const
Information pertinent to a Pcbnew printed circuit board.
NETINFO_ITEM * FindNet(int aNetcode) const
Search for a net with the given netcode.
PROJECT * GetProject() const
BOARD_DESIGN_SETTINGS & GetDesignSettings() const
std::shared_ptr< CONNECTIVITY_DATA > GetConnectivity() const
Return a list of missing connections between components/tracks.
const Vec & GetOrigin() const
const Vec & GetSize() const
CN_EDGE represents a point-to-point connection, whether realized or unrealized (ie: tracks etc.
void Empty()
Clear the list.
int GetCount() const
Return the number of objects in the list.
int CountType(KICAD_T aType)
Count the number of items matching aType.
void Append(EDA_ITEM *item)
Add an item to the end of the list.
Implementing DIALOG_TRACK_VIA_SIZE_BASE.
virtual bool Run() override
Run this provider against the given PCB with configured options (if any).
std::vector< FOOTPRINT * > m_FpInMove
void ClearConflicts(KIGFX::VIEW *aView)
void UpdateConflicts(KIGFX::VIEW *aView, bool aHighlightMoved)
void ShowInfoBarError(const wxString &aErrorMsg, bool aShowCloseButton=false, WX_INFOBAR::MESSAGE_TYPE aType=WX_INFOBAR::MESSAGE_TYPE::GENERIC)
Show the WX_INFOBAR displayed on the top of the canvas with a message and an error icon on the left o...
WX_INFOBAR * GetInfoBar()
void AddStandardSubMenus(TOOL_MENU &aMenu)
Construct a "basic" menu for a tool, containing only items that apply to all tools (e....
void SetMsgPanel(const std::vector< MSG_PANEL_ITEM > &aList)
Clear the message panel and populates it with the contents of aList.
void SetCurrentCursor(KICURSOR aCursor)
Set the current cursor shape for this panel.
virtual void Refresh(bool aEraseBackground=true, const wxRect *aRect=nullptr) override
Update the board display after modifying it by a python script (note: it is automatically called by a...
A base class for most all the KiCad significant classes used in schematics and boards.
KICAD_T Type() const
Returns the type of object.
virtual bool IsType(const std::vector< KICAD_T > &aScanTypes) const
Check whether the item is one of the listed types.
EDA_ITEM * Clone() const override
Create a duplicate of this item with linked list members set to NULL.
Used when the right click button is pressed, or when the select tool is in effect.
static const std::vector< KICAD_T > DraggableItems
A scan list for items that can be dragged.
void SetUseGrid(bool aSnapToGrid)
void SetAuxAxes(bool aEnable, const VECTOR2I &aOrigin=VECTOR2I(0, 0))
const std::string FormatAsString() const
Helper class to create more flexible dialogs, including 'do not show again' checkbox handling.
void DoNotShowCheckbox(wxString file, int line)
Checks the 'do not show again' setting for the dialog.
Abstract interface for drawing on a 2D-surface.
BOX2D GetVisibleWorldExtents() const
bool GetGridSnapping() const
virtual RENDER_SETTINGS * GetSettings()=0
Return a pointer to current settings that are going to be used when drawing items.
Container for all the knowledge about how graphical objects are drawn on any output surface/device.
const std::set< int > & GetHighlightNetCodes() const
Return the netcode of currently highlighted net.
An interface for classes handling user events controlling the view behavior such as zooming,...
virtual void ForceCursorPosition(bool aEnabled, const VECTOR2D &aPosition=VECTOR2D(0, 0))
Place the cursor immediately at a given point.
virtual void ShowCursor(bool aEnabled)
Enable or disables display of cursor.
virtual void WarpMouseCursor(const VECTOR2D &aPosition, bool aWorldCoordinates=false, bool aWarpView=false)=0
If enabled (.
VECTOR2D GetCursorPosition() const
Return the current cursor position in world coordinates.
virtual void SetCursorPosition(const VECTOR2D &aPosition, bool aWarpView=true, bool aTriggeredByArrows=false, long aArrowCommand=0)=0
Move cursor to the requested position expressed in world coordinates.
virtual void SetAutoPan(bool aEnabled)
Turn on/off auto panning (this feature is used when there is a tool active (eg.
void ShowPreview(bool aShow=true)
virtual int GetTopLayer() const
void AddToPreview(EDA_ITEM *aItem, bool aTakeOwnership=true)
GAL * GetGAL() const
Return the #GAL this view is using to draw graphical primitives.
void Hide(VIEW_ITEM *aItem, bool aHide=true)
Temporarily hide the item in the view (e.g.
PAINTER * GetPainter() const
Return the painter object used by the view for drawing #VIEW_ITEMS.
Represent a contiguous set of PCB layers.
bool Overlaps(const LAYER_RANGE &aOther) const
LSEQ is a sequence (and therefore also a set) of PCB_LAYER_IDs.
LSET is a set of PCB_LAYER_IDs.
static LSET AllLayersMask()
LSEQ Seq(const PCB_LAYER_ID *aWishListSequence, unsigned aCount) const
Return an LSEQ from the union of this LSET and a desired sequence.
static LSET AllNonCuMask()
Return a mask holding all layer minus CU layers.
static LSET AllCuMask(int aCuLayerCount=MAX_CU_LAYERS)
Return a mask holding the requested number of Cu PCB_LAYER_IDs.
A collection of nets and the parameters used to route or test these nets.
const wxString GetName() const
Handle the data for a net.
const wxString & GetNetname() const
bool m_ShowCourtyardCollisions
static TOOL_ACTION layerToggle
static TOOL_ACTION drag45Degree
static TOOL_ACTION layerInner12
static TOOL_ACTION routerUndoLastSegment
static TOOL_ACTION layerInner8
static TOOL_ACTION layerInner3
static TOOL_ACTION layerPrev
static TOOL_ACTION routerSettingsDialog
Activation of the Push and Shove settings dialogs.
static TOOL_ACTION layerInner2
static TOOL_ACTION routerAttemptFinish
static TOOL_ACTION routeDiffPair
Activation of the Push and Shove router (differential pair mode)
static TOOL_ACTION selectionCursor
Select a single item under the cursor position.
static TOOL_ACTION trackViaSizeChanged
static TOOL_ACTION layerChanged
static TOOL_ACTION layerInner25
static TOOL_ACTION breakTrack
Break a single track into two segments at the cursor.
static TOOL_ACTION routerRouteSelectedFromEnd
static TOOL_ACTION routerHighlightMode
Actions to enable switching modes via hotkey assignments.
static TOOL_ACTION routerWalkaroundMode
static TOOL_ACTION routerShoveMode
static TOOL_ACTION layerInner24
static TOOL_ACTION properties
Activation of the edit tool.
static TOOL_ACTION selectionClear
Clear the current selection.
static TOOL_ACTION layerInner29
static TOOL_ACTION routerAutorouteSelected
static TOOL_ACTION layerInner11
static TOOL_ACTION routerDiffPairDialog
static TOOL_ACTION routerContinueFromEnd
static TOOL_ACTION layerInner16
static TOOL_ACTION layerInner26
static TOOL_ACTION layerInner18
static TOOL_ACTION layerInner14
static TOOL_ACTION selectLayerPair
static TOOL_ACTION layerInner6
static TOOL_ACTION dragFreeAngle
static TOOL_ACTION clearHighlight
static TOOL_ACTION layerInner22
static TOOL_ACTION layerInner5
static TOOL_ACTION layerInner20
static TOOL_ACTION layerInner7
static TOOL_ACTION layerInner27
static TOOL_ACTION layerInner1
static TOOL_ACTION layerInner10
static TOOL_ACTION layerInner15
static TOOL_ACTION layerInner17
static TOOL_ACTION layerBottom
static TOOL_ACTION layerInner19
static TOOL_ACTION layerInner9
static TOOL_ACTION routerInlineDrag
Activation of the Push and Shove router (inline dragging mode)
static TOOL_ACTION layerInner30
static TOOL_ACTION layerTop
static TOOL_ACTION cycleRouterMode
static TOOL_ACTION layerInner4
static TOOL_ACTION routeSingleTrack
Activation of the Push and Shove router.
static TOOL_ACTION layerInner13
static TOOL_ACTION layerInner21
static TOOL_ACTION layerNext
static TOOL_ACTION routerRouteSelected
static TOOL_ACTION layerInner23
static TOOL_ACTION layerInner28
Common, abstract interface for edit frames.
APPEARANCE_CONTROLS * GetAppearancePanel()
void UndoRedoBlock(bool aBlock=true)
Enable/disable undo and redo operations.
PCB_LAYER_ID SelectOneLayer(PCB_LAYER_ID aDefaultLayer, LSET aNotAllowedLayersMask=LSET(), wxPoint aDlgPosition=wxDefaultPosition)
Show the dialog box for a layer selection.
PCBNEW_SETTINGS * GetPcbNewSettings() const
virtual PCB_LAYER_ID GetActiveLayer() const
PCB_DRAW_PANEL_GAL * GetCanvas() const override
Return a pointer to GAL-based canvas of given EDA draw frame.
PCB_SCREEN * GetScreen() const override
Return a pointer to a BASE_SCREEN or one of its derivatives.
virtual void SetActiveLayer(PCB_LAYER_ID aLayer)
The main frame for Pcbnew.
void SetActiveLayer(PCB_LAYER_ID aLayer) override
Change the currently active layer to aLayer and also update the APPEARANCE_CONTROLS.
A PLUGIN derivation for saving and loading Pcbnew s-expression formatted files.
void Save(const wxString &aFileName, BOARD *aBoard, const STRING_UTF8_MAP *aProperties=nullptr) override
Write aBoard to a storage file in a format that this PLUGIN implementation knows about or it can be u...
PCB_LAYER_ID m_Route_Layer_TOP
PCB_LAYER_ID m_Route_Layer_BOTTOM
const VECTOR2I & GetStart() const
const VECTOR2I & GetEnd() const
EDA_ITEM_FLAGS IsPointOnEnds(const VECTOR2I &point, int min_dist=0) const
Function IsPointOnEnds returns STARTPOINT if point if near (dist = min_dist) start point,...
void SetLayerPair(PCB_LAYER_ID aTopLayer, PCB_LAYER_ID aBottomLayer)
Function SetLayerPair For a via m_layer contains the top layer, the other layer is in m_bottomLayer.
void SetViaType(VIATYPE aViaType)
void Add(const LINE &aLine)
Base class for PNS router board items.
PnsKind Kind() const
Return the type (kind) of the item.
const LAYER_RANGE & Layers() const
bool OfKind(int aKindMask) const
Return true if the item's type matches the mask aKindMask.
ITEM * FindItemByParent(const BOARD_ITEM *aParent)
virtual const VECTOR2I & CurrentEnd() const =0
Function CurrentEnd()
virtual bool HasPlacedAnything() const
virtual const VECTOR2I & CurrentStart() const =0
Function CurrentStart()
void SetMode(ROUTER_MODE aMode)
bool SwitchLayer(int layer)
void ClearViewDecorations()
PLACEMENT_ALGO * Placer()
void UpdateSizes(const SIZES_SETTINGS &aSizes)
Applies stored settings.
const std::vector< int > GetCurrentNets() const
const wxString & FailureReason() const
bool IsPlacingVia() const
RULE_RESOLVER * GetRuleResolver() const
ROUTING_SETTINGS & Settings()
bool FixRoute(const VECTOR2I &aP, ITEM *aItem, bool aForceFinish=false)
bool RoutingInProgress() const
RouterState GetState() const
void BreakSegment(ITEM *aItem, const VECTOR2I &aP)
bool StartDragging(const VECTOR2I &aP, ITEM *aItem, int aDragMode=DM_ANY)
bool StartRouting(const VECTOR2I &aP, ITEM *aItem, int aLayer)
void SetVisibleViewArea(const BOX2I &aExtents)
int GetCurrentLayer() const
void GetUpdatedItems(std::vector< PNS::ITEM * > &aRemoved, std::vector< PNS::ITEM * > &aAdded, std::vector< PNS::ITEM * > &aHeads)
void ToggleViaPlacement()
bool Move(const VECTOR2I &aP, ITEM *aItem)
Contain all persistent settings of the router, such as the mode, optimization effort,...
bool GetFreeAngleMode() const
void SetMode(PNS_MODE aMode)
Return the optimizer effort. Bigger means cleaner traces, but slower routing.
PNS_MODE Mode() const
Set the routing mode.
DIRECTION_45::CORNER_MODE GetCornerMode() const
virtual int DpCoupledNet(int aNet)=0
void SetViaType(VIATYPE aViaType)
void SetTrackWidth(int aWidth)
int DiffPairWidth() const
void SetDiffPairWidth(int aWidth)
void SetDiffPairWidthSource(const wxString &aSource)
void SetDiffPairGapSource(const wxString &aSource)
void SetDiffPairGap(int aGap)
void SetViaDrill(int aDrill)
wxString GetClearanceSource() const
wxString GetDiffPairGapSource() const
wxString GetDiffPairWidthSource() const
void AddLayerPair(int aL1, int aL2)
std::optional< int > PairedLayer(int aLayerId)
bool TrackWidthIsExplicit() const
void SetViaDiameter(int aDiameter)
wxString GetWidthSource() const
void SetWidthSource(const wxString &aSource)
int DiffPairViaGap() const
bool ImportSizes(PNS::SIZES_SETTINGS &aSizes, PNS::ITEM *aStartItem, int aNet) override
PNS::RULE_RESOLVER * GetRuleResolver() override
void SetStartLayer(int aLayer)
void SetCommitFlags(int aCommitFlags)
bool SaveAs(const wxString &aDirectory, const wxString &aFile)
Container for project specific data.
virtual PROJECT_FILE & GetProjectFile() const
Describe ratsnest for a single net.
const std::vector< CN_EDGE > & GetEdges() const
static bool ShowAlways(const SELECTION &aSelection)
The default condition function (always returns true).
const std::vector< EDA_ITEM * > GetItemsSortedBySelectionOrder() const
int Size() const
Returns the number of selected parts.
bool Empty() const
Checks if there is anything selected.
wxString MessageTextFromValue(double aValue, bool aAddUnitLabel=true, EDA_DATA_TYPE aType=EDA_DATA_TYPE::DISTANCE)
A lower-precision version of StringFromValue().
A modified version of the wxInfoBar class that allows us to:
void ShowMessageFor(const wxString &aMessage, int aTime, int aFlags=wxICON_INFORMATION, MESSAGE_TYPE aType=WX_INFOBAR::MESSAGE_TYPE::GENERIC)
Show the infobar with the provided message and icon for a specific period of time.
Handle a list of polygons defining a copper zone.
int OKOrCancelDialog(wxWindow *aParent, const wxString &aWarning, const wxString &aMessage, const wxString &aDetailedMessage, const wxString &aOKLabel, const wxString &aCancelLabel, bool *aApplyToAll)
Display a warning dialog with aMessage and returns the user response.
This file is part of the common library.
@ VIA_DIAMETER_CONSTRAINT
@ DIFF_PAIR_GAP_CONSTRAINT
#define ENDPOINT
ends. (Used to support dragging.)
std::uint32_t EDA_ITEM_FLAGS
#define STARTPOINT
When a line is selected, these flags indicate which.
static FILENAME_RESOLVER * resolver
bool IsCopperLayer(int aLayerId)
Tests whether a layer is a copper layer.
PCB_LAYER_ID
A quick note on layer IDs:
PCB_LAYER_ID ToLAYER_ID(int aLayer)
The Cairo implementation of the graphics abstraction layer.
@ RM_MarkObstacles
Ignore collisions, mark obstacles.
@ RM_Walkaround
Only walk around.
@ PNS_MODE_ROUTE_DIFF_PAIR
@ ID_POPUP_PCB_SELECT_WIDTH1
@ ID_POPUP_PCB_SELECT_DIFFPAIR16
@ ID_POPUP_PCB_SELECT_USE_NETCLASS_VALUES
@ ID_POPUP_PCB_SELECT_WIDTH16
@ ID_POPUP_PCB_SELECT_AUTO_WIDTH
@ ID_POPUP_PCB_SELECT_CUSTOM_WIDTH
@ ID_POPUP_PCB_SELECT_DIFFPAIR1
@ ID_POPUP_PCB_SELECT_USE_NETCLASS_DIFFPAIR
@ ID_POPUP_PCB_SELECT_VIASIZE1
@ ID_POPUP_PCB_SELECT_CUSTOM_DIFFPAIR
@ ID_POPUP_PCB_SELECT_VIASIZE16
void Format(OUTPUTFORMATTER *out, int aNestLevel, int aCtl, const CPTREE &aTree)
Output a PTREE into s-expression format via an OUTPUTFORMATTER derivative.
Class that computes missing connections on a PCB.
std::vector< FAB_LAYER_COLOR > dummy
wxString UnescapeString(const wxString &aSource)
Container to handle a stock of specific differential pairs each with unique track width,...
bool m_ShowModuleRatsnest
Container to handle a stock of specific vias each with unique diameter and drill sizes in the BOARD c...
void RotatePoint(int *pX, int *pY, const EDA_ANGLE &aAngle)
@ PCB_FP_SHAPE_T
class FP_SHAPE, a footprint edge
@ PCB_VIA_T
class PCB_VIA, a via (like a track segment on a copper layer)
@ PCB_FOOTPRINT_T
class FOOTPRINT, a footprint
@ PCB_ARC_T
class PCB_ARC, an arc track segment on a copper layer
@ PCB_TRACE_T
class PCB_TRACK, a track segment (segment on a copper layer)
wxPoint ToWxPoint(const VECTOR2I &aSize)