23#include <wx/filedlg.h>
25#include <wx/hyperlink.h>
34using namespace std::placeholders;
105using namespace KIGFX;
109 const std::vector<PENDING_STACK_EXPANSION>& aPending )
111 if( aPreRoute.count( aVia->
m_Uuid ) )
122 return &exp.m_Preset;
135 if( aCurrent == aStart )
139 if( aCurrent == aEnd )
151class UI_UPDATE_INTERVAL_GUARD
154 UI_UPDATE_INTERVAL_GUARD(
long aNewInterval ) :
155 m_saved( wxUpdateUIEvent::GetUpdateInterval() )
157 wxUpdateUIEvent::SetUpdateInterval( aNewInterval );
160 ~UI_UPDATE_INTERVAL_GUARD()
162 wxUpdateUIEvent::SetUpdateInterval( m_saved );
197 .Name(
"pcbnew.InteractiveRouter.PlaceVia" )
199 .DefaultHotkey(
'V' )
200 .LegacyHotkeyName(
"Add Through Via" )
201 .FriendlyName(
_(
"Place Through Via" ) )
202 .Tooltip(
_(
"Adds a through-hole via at the end of currently routed track." ) )
208 .Name(
"pcbnew.InteractiveRouter.PlaceBlindVia" )
211 .LegacyHotkeyName(
"Add Blind/Buried Via" )
212 .FriendlyName(
_(
"Place Blind/Buried Via" ) )
213 .Tooltip(
_(
"Adds a blind or buried via at the end of currently routed track.") )
219 .Name(
"pcbnew.InteractiveRouter.PlaceMicroVia" )
221 .DefaultHotkey(
MD_CTRL +
'V' )
222 .LegacyHotkeyName(
"Add MicroVia" )
223 .FriendlyName(
_(
"Place Microvia" ) )
224 .Tooltip(
_(
"Adds a microvia at the end of currently routed track." ) )
231 .Name(
"pcbnew.InteractiveRouter.PlaceViaStack" )
234 .FriendlyName(
_(
"Place Microvia Stack at Track End" ) )
235 .Tooltip(
_(
"Drops the active microvia stack preset at the end of the currently routed track "
236 "and continues on the target layer." ) )
241 .Name(
"pcbnew.InteractiveRouter.SelLayerAndPlaceVia" )
243 .DefaultHotkey(
'<' )
244 .LegacyHotkeyName(
"Select Layer and Add Through Via" )
245 .FriendlyName(
_(
"Select Layer and Place Through Via..." ) )
246 .Tooltip(
_(
"Select a layer, then add a through-hole via at the end of currently routed track." ) )
252 .Name(
"pcbnew.InteractiveRouter.SelLayerAndPlaceBlindVia" )
254 .DefaultHotkey(
MD_ALT +
'<' )
255 .LegacyHotkeyName(
"Select Layer and Add Blind/Buried Via" )
256 .FriendlyName(
_(
"Select Layer and Place Blind/Buried Via..." ) )
257 .Tooltip(
_(
"Select a layer, then add a blind or buried via at the end of currently routed track." ) )
263 .Name(
"pcbnew.InteractiveRouter.SelLayerAndPlaceMicroVia" )
265 .FriendlyName(
_(
"Select Layer and Place Micro Via..." ) )
266 .Tooltip(
_(
"Select a layer, then add a micro via at the end of currently routed track." ) )
272 .Name(
"pcbnew.InteractiveRouter.CustomTrackViaSize" )
274 .DefaultHotkey(
'Q' )
275 .LegacyHotkeyName(
"Custom Track/Via Size" )
276 .FriendlyName(
_(
"Custom Track/Via Size..." ) )
277 .Tooltip(
_(
"Shows a dialog for changing the track width and via size." ) )
281 .Name(
"pcbnew.InteractiveRouter.SwitchPosture" )
283 .DefaultHotkey(
'/' )
284 .LegacyHotkeyName(
"Switch Track Posture" )
285 .FriendlyName(
_(
"Switch Track Posture" ) )
286 .Tooltip(
_(
"Switches posture of the currently routed track." ) )
291 .Name(
"pcbnew.InteractiveRouter.SwitchRoundingToNext" )
293 .DefaultHotkey(
MD_CTRL +
'/' )
294 .FriendlyName(
_(
"Track Corner Mode Switch" ) )
295 .Tooltip(
_(
"Switches between sharp/rounded and 45°/90° corners when routing tracks." ) )
300 .Name(
"pcbnew.InteractiveRouter.SwitchRounding45" )
302 .DefaultHotkey(
MD_CTRL +
'W' )
303 .FriendlyName(
_(
"Track Corner Mode 45" ) )
304 .Tooltip(
_(
"Switch to 45° corner when routing tracks." ) ) );
307 .Name(
"pcbnew.InteractiveRouter.SwitchRounding90" )
310 .FriendlyName(
_(
"Track Corner Mode 90" ) )
311 .Tooltip(
_(
"Switch to 90° corner when routing tracks." ) ) );
314 .Name(
"pcbnew.InteractiveRouter.SwitchRoundingArc45" )
317 .FriendlyName(
_(
"Track Corner Mode Arc 45" ) )
318 .Tooltip(
_(
"Switch to arc 45° corner when routing tracks." ) ) );
321 .Name(
"pcbnew.InteractiveRouter.SwitchRoundingArc90" )
323 .DefaultHotkey(
MD_ALT +
'W' )
324 .FriendlyName(
_(
"Track Corner Mode Arc 90" ) )
325 .Tooltip(
_(
"Switch to arc 90° corner when routing tracks." ) ) );
328#define _(s) wxGetTranslation((s))
351 SetTitle(
_(
"Select Track/Via Width" ) );
370 _(
"Route using the width of the starting track." ), wxITEM_CHECK );
375 _(
"Use track and via sizes from the net class" ), wxITEM_CHECK );
380 _(
"Specify custom track and via sizes" ), wxITEM_CHECK );
391 msg =
_(
"Track netclass width" );
393 msg.Printf(
_(
"Track %s" ),
m_frame.MessageTextFromValue( width ) );
396 Append( menuIdx, msg, wxEmptyString, wxITEM_CHECK );
407 msg =
_(
"Via netclass values" );
410 if(
via.m_Drill > 0 )
412 msg.Printf(
_(
"Via %s, hole %s" ),
413 m_frame.MessageTextFromValue(
via.m_Diameter ),
414 m_frame.MessageTextFromValue(
via.m_Drill ) );
418 msg.Printf(
_(
"Via %s" ),
419 m_frame.MessageTextFromValue(
via.m_Diameter ) );
424 Append( menuIdx, msg, wxEmptyString, wxITEM_CHECK );
432 int id = aEvent.GetId();
484 SetTitle(
_(
"Select Differential Pair Dimensions" ) );
500 _(
"Use differential pair dimensions from the net class" ), wxITEM_CHECK );
505 _(
"Specify custom differential pair dimensions" ), wxITEM_CHECK );
518 if( diffPair.
m_Gap <= 0 )
522 msg.Printf(
_(
"Width %s" ),
527 msg.Printf(
_(
"Width %s, via gap %s" ),
536 msg.Printf(
_(
"Width %s, gap %s" ),
542 msg.Printf(
_(
"Width %s, gap %s, via gap %s" ),
550 Append( menuIdx, msg, wxEmptyString, wxITEM_CHECK );
558 int id = aEvent.GetId();
602 auto& menu =
m_menu->GetMenu();
603 menu.SetUntranslatedTitle(
_HKI(
"Interactive Router" ) );
623 auto notRoutingCond =
626 return !
m_router->RoutingInProgress();
629 auto inRouteSelected =
638 std::vector<PNS::NET_HANDLE> currentNets =
m_router->GetCurrentNets();
640 if( currentNets.empty() || currentNets[0] ==
nullptr )
647 RN_NET* ratsnest =
board->GetConnectivity()->GetRatsnestForNet( currentNet );
649 return ratsnest && !ratsnest->
GetEdges().empty();
654 menu.AddSeparator( 1 );
657 menu.AddSeparator( haveHighlight, 2 );
685 submenuCornerMode->
SetTitle(
_(
"Track Corner Mode" ) );
695 menu.AddMenu( submenuCornerMode );
698 auto cornerMode45Cond =
704 auto cornerMode90Cond =
710 auto cornerModeArc45Cond =
716 auto cornerModeArc90Cond =
722#define CHECK( x ) ACTION_CONDITIONS().Check( x )
762 static size_t lastLoggerSize = 0;
763 static wxString mruPath;
768 if( !logger || logger->GetEvents().size() == 0
769 || logger->GetEvents().size() == lastLoggerSize )
774 if( !testCaseDir.IsEmpty() )
781 wxFileName
path = wxFileName::DirName( testCaseDir );
785 if(
path.DirExists() )
787 doExit = !
IsOK(
frame(), wxString::Format(
_(
"Test case in directory %s already exists. Overwrite?"),
path.GetFullPath() ) );
791 path.Mkdir( wxS_DIR_DEFAULT, wxPATH_MKDIR_FULL );
794 path.SetName( wxT(
"pns") );
795 logPath =
path.GetFullPath();
804 lastLoggerSize = logger->GetEvents().size();
810 if ( mruPath.IsEmpty() )
815 wxFileDialog dlg(
frame(),
_(
"Save router log" ), mruPath,
"pns.log",
817 wxFD_OVERWRITE_PROMPT | wxFD_SAVE );
821 if( dlg.ShowModal() != wxID_OK )
823 lastLoggerSize = logger->GetEvents().size();
827 logPath = dlg.GetPath();
831 wxFileName fname_log( logPath );
832 mruPath = fname_log.GetPath();
833 fname_log.SetExt(
"log" );
834 wxLogTrace( wxT(
"PNS" ), wxT(
"save log to: %s" ), fname_log.GetFullPath() );
836 wxFileName fname_dump( fname_log );
837 fname_dump.SetExt(
"dump" );
839 wxFileName fname_settings( fname_log );
840 fname_settings.SetExt(
"settings" );
842 FILE* settings_f = wxFopen( fname_settings.GetAbsolutePath(),
"wb" );
846 DisplayError(
frame(), wxString::Format(
_(
"Unable to write '%s'." ), fname_settings.GetAbsolutePath() ) );
850 std::string settingsStr =
m_router->Settings().FormatAsString();
851 fprintf( settings_f,
"%s\n", settingsStr.c_str() );
852 fclose( settings_f );
859 pcb_io.
SaveBoard( fname_dump.GetAbsolutePath(), *
m_iface->GetBoard(),
nullptr );
868 wxString srcRules = editFrame->GetBoard()->GetDesignRulesPath();
870 if( !srcRules.IsEmpty() && wxFileName::FileExists( srcRules ) )
872 wxFileName fname_rules( fname_dump );
874 wxCopyFile( srcRules, fname_rules.GetAbsolutePath() );
879 std::vector<PNS::ITEM*> removed;
883 for(
auto item : removed )
888 wxASSERT_MSG( item->Parent() !=
nullptr,
"removed an item with no parent uuid?" );
900 logData.
m_Events = logger->GetEvents();
902 FILE* log_f = wxFopen( fname_log.GetAbsolutePath(),
"wb" );
908 fname_log.GetAbsolutePath() ) );
912 fprintf( log_f,
"%s\n", logString.c_str().AsChar() );
948 bool asChanged =
false;
1003 int startLayer =
m_iface->GetPNSLayerFromBoardLayer( tl );
1009 return m_iface->GetBoardLayerFromPNSLayer( ls.
Start() );
1018 int activeLayer =
m_iface->GetPNSLayerFromBoardLayer(
frame()->GetActiveLayer() );
1019 int currentLayer =
m_router->GetCurrentLayer();
1021 if( currentLayer != activeLayer )
1022 m_router->SwitchLayer( activeLayer );
1024 std::optional<int> newLayer =
m_router->Sizes().PairedLayer( currentLayer );
1027 newLayer =
m_router->Sizes().GetLayerTop();
1029 m_router->SwitchLayer( *newLayer );
1040 std::vector<PNS::NET_HANDLE> nets =
m_router->GetCurrentNets();
1044 std::shared_ptr<DRC_ENGINE>& drcEngine = bds.
m_DRCEngine;
1050 dummyTrack.
SetLayer( targetLayer );
1073 if( !constraint.
IsNull() )
1101 dummyTrackB.
SetLayer( targetLayer );
1109 if( !constraint.
IsNull() )
1128 if( !constraint.
IsNull() )
1162 wxASSERT_MSG(
false, wxT(
"Unhandled via type" ) );
1186 frame()->SetActiveLayer(
1210 if( presets.empty() )
1212 frame()->GetInfoBar()->ShowMessageFor(
1213 _(
"No microvia stack presets defined. Add one in Board Setup, Microvia Stacks." ), 3000,
1214 wxICON_INFORMATION );
1218 int idx = std::clamp( bds.
GetViaStackIndex(), 0, (
int) presets.size() - 1 );
1230 frame()->GetInfoBar()->ShowMessageFor(
_(
"The microvia stack preset layers are not present on this board." ),
1231 3000, wxICON_ERROR );
1239 frame()->GetInfoBar()->ShowMessageFor(
1240 wxString::Format(
_(
"The microvia stack runs between %s and %s. Route on one of those layers "
1244 3000, wxICON_ERROR );
1257 frame()->GetInfoBar()->ShowMessageFor(
_(
"Could not end the track here for a microvia stack." ), 3000,
1275 if( !
m_router->GetCurrentNets().empty() )
1278 net = ni->GetNetCode();
1314 m_iface->GetPNSLayerFromBoardLayer( targetLayer ) );
1321 if(
m_router->RoutingInProgress() )
1370 size_t target_idx = 0;
1372 for(
size_t i = 0; i < layers.size(); i++ )
1374 if( layers[i] == currentLayer )
1381 target_idx = ( idx + 1 ) % layers.size();
1384 for(
size_t i = 0; i < layers.size() - 1; i++ )
1388 targetLayer = layers[target_idx];
1393 if( target_idx >= layers.size() )
1408 size_t target_idx = 0;
1410 for(
size_t i = 0; i < layers.size(); i++ )
1412 if( layers[i] == currentLayer )
1419 target_idx = ( idx > 0 ) ? ( idx - 1 ) : ( layers.size() - 1 );
1421 for(
size_t i = 0; i < layers.size() - 1; i++ )
1425 targetLayer = layers[target_idx];
1429 if( target_idx > 0 )
1432 target_idx = layers.size() - 1;
1454 if( !enabledLayers.test( targetLayer ) )
1460 if( targetLayer == currentLayer )
1480 bool selectLayer =
false;
1485 const int actViaFlags = aEvent.
Parameter<
int>();
1500 endPoint =
frame()->GetCanvas()->ClientToScreen( endPoint );
1506 not_allowed_ly.
set( currentLayer );
1508 targetLayer =
frame()->SelectOneLayer(
static_cast<PCB_LAYER_ID>( currentLayer ),
1509 not_allowed_ly, endPoint );
1520 if( currentLayer == targetLayer )
1531 && ( ( targetLayer ==
B_Cu && currentLayer ==
F_Cu )
1532 || ( targetLayer ==
F_Cu && currentLayer ==
B_Cu ) ) )
1547 if( !
m_router->GetNearestRatnestAnchor( otherEnd, otherEndLayers, otherEndItem ) )
1550 currentLayer = pairTop;
1551 targetLayer = pairBottom;
1558 const std::optional<int> pairedLayerPns =
m_router->Sizes().PairedLayer(
m_router->GetCurrentLayer() );
1566 const bool otherEndIsThrough =
1567 otherEndLayers == allCopperLayers
1568 || ( otherEndItem && otherEndItem->
HasHole()
1569 && otherEndItem->
Hole()->
Layers() == allCopperLayers );
1571 if( otherEndIsThrough )
1575 if( currentLayer == pairBottom )
1576 targetLayer = pairTop;
1577 else if( currentLayer == pairTop )
1578 targetLayer = pairBottom;
1580 targetLayer = pairTop;
1582 else if( currentLayer == otherEndLayerPcbId && pairedLayerPns.has_value() )
1586 targetLayer =
m_iface->GetBoardLayerFromPNSLayer( *pairedLayerPns );
1590 targetLayer =
m_iface->GetBoardLayerFromPNSLayer( otherEndLayers.
Start() );
1596 if( currentLayer == pairTop || currentLayer == pairBottom )
1600 currentLayer = pairTop;
1601 targetLayer = pairBottom;
1607 targetLayer = pairTop;
1611 if( currentLayer == targetLayer )
1614 infobar->
ShowMessageFor(
_(
"Via needs 2 different layers." ), 5000, wxICON_ERROR,
1615 WX_INFOBAR::MESSAGE_TYPE::DRC_VIOLATION );
1630 if( !
m_router->GetCurrentNets().empty() )
1638 if( !constraint.
IsNull() )
1644 if( !constraint.
IsNull() )
1655 m_iface->GetPNSLayerFromBoardLayer( targetLayer ) );
1662 if(
m_router->RoutingInProgress() )
1688 int pnsLayer =
m_iface->GetPNSLayerFromBoardLayer( pcbLayer );
1699 if( !
getView()->IsLayerVisible( pcbLayer ) )
1707 m_iface->SetStartLayerFromPCBNew( pcbLayer );
1709 frame()->GetBoard()->GetDesignSettings().m_TempOverrideTrackWidth =
false;
1712 m_iface->GetPNSLayerFromBoardLayer(
frame()->GetScreen()->m_Route_Layer_BOTTOM ) );
1742 m_router->ClearViewDecorations();
1753 frame()->UndoRedoBlock(
true );
1787 frame()->UndoRedoBlock(
false );
1809 auto syncRouterAndFrameLayer =
1812 int pnsLayer =
m_router->GetCurrentLayer();
1818 if( !
getView()->IsLayerVisible( pcbLayer ) )
1833 if( startWithVia && !startReachesViaTarget )
1840 UI_UPDATE_INTERVAL_GUARD uiGuard( 200 );
1846 m_toolMgr->GetView()->SyncLayerVisibilityCache();
1851 if( !
m_router->RoutingInProgress() )
1853 if( evt->IsCancelInteractive() )
1861 if( evt->IsMotion() )
1870 if( std::optional<VECTOR2I> last =
m_router->UndoLastSegment() )
1873 evt->SetMousePosition( last.value() );
1884 bool* autoRouted = evt->Parameter<
bool*>();
1891 if( autoRouted !=
nullptr )
1900 if( autoRouted !=
nullptr )
1902 *autoRouted =
false;
1912 bool needsAppend =
m_router->Placer()->HasPlacedAnything();
1916 syncRouterAndFrameLayer();
1928 frame()->ShowInfoBarError(
m_router->FailureReason(),
true );
1936 bool needLayerSwitch =
m_router->IsPlacingVia();
1937 bool forceCommit =
false;
1942 if( needLayerSwitch )
1952 syncRouterAndFrameLayer();
1991 bool forceFinish =
true;
1992 bool forceCommit =
false;
1998 || evt->IsActivate()
2004 if( evt->IsActivate() && !evt->IsMoveTool() )
2011 else if( evt->IsUndoRedo() )
2029 evt->SetPassEvent();
2050 if( settingsDlg.
ShowModal() == wxID_OK )
2082 settings.SetMode( mode );
2110 return m_router->Settings().Mode();
2116 return m_router->RoutingInProgress();
2150 if(
m_router->RoutingInProgress() )
2174 controls->ForceCursorPosition(
false );
2179 std::vector<BOARD_CONNECTED_ITEM*> itemList;
2186 itemList.push_back(
pad );
2194 std::shared_ptr<CONNECTIVITY_DATA> connectivity =
frame->GetBoard()->GetConnectivity();
2197 bool groupStart =
true;
2205 RN_NET* net = connectivity->GetRatsnestForNet( item->GetNetCode() );
2210 std::vector<std::shared_ptr<const CN_ANCHOR>> anchors;
2214 std::shared_ptr<const CN_ANCHOR> target = edge.GetTargetNode();
2215 std::shared_ptr<const CN_ANCHOR> source = edge.GetSourceNode();
2217 if( !source || source->Dirty() || !target || target->Dirty() )
2220 if( source->Parent() == item )
2221 anchors.push_back( source );
2222 else if( target->Parent() == item )
2223 anchors.push_back( target );
2227 for( std::shared_ptr<const CN_ANCHOR>
anchor : anchors )
2236 if(
frame->GetActiveLayer() != originalLayer )
2237 frame->SetActiveLayer( originalLayer );
2244 bool autoRouted =
false;
2289 std::vector<BOARD_CONNECTED_ITEM*> trackItems;
2297 if( trackItems.empty() )
2307 int dpSkipped = std::erase_if( trackItems,
2315 frame->ShowInfoBarMsg(
_(
"Differential pair members cannot be optimized." ) );
2317 bool groupStart =
true;
2335 branch->
Remove( originalLine );
2337 PNS::LINE optimizedLine( originalLine );
2346 if(
m_router->Settings().GetRestrictAngles() )
2368 branch->
Add( optimizedLine );
2389 if(
m_router->RoutingInProgress() )
2412 controls->ForceCursorPosition(
false );
2428 m_toolMgr->GetView()->SyncLayerVisibilityCache();
2430 if( !evt->IsDrag() )
2433 if( evt->IsCancelInteractive() )
2437 else if( evt->IsActivate() )
2439 if( evt->IsMoveTool() || evt->IsEditorTool() )
2442 frame->PushTool( originalEvent );
2455 else if( evt->IsMotion() )
2473 evt->SetPassEvent(
false );
2481 if( evt->HasPosition() )
2495 else if( evt->IsKeyPressed() )
2500 evt->SetPassEvent();
2508 evt->SetPassEvent();
2534 KIDIALOG dlg(
frame(),
_(
"The selected item is locked." ),
_(
"Confirmation" ),
2535 wxOK | wxCANCEL | wxICON_WARNING );
2536 dlg.SetOKLabel(
_(
"Drag Anyway" ) );
2547 if( !
m_router->FailureReason().IsEmpty() )
2548 frame()->ShowInfoBarError(
m_router->FailureReason(),
true );
2558 frame()->UndoRedoBlock(
true );
2560 UI_UPDATE_INTERVAL_GUARD uiGuard( 200 );
2566 m_toolMgr->GetView()->SyncLayerVisibilityCache();
2570 if( evt->IsMotion() )
2579 if( dragger->GetForceMarkObstaclesMode( &dragStatus ) )
2586 hint.Printf(
_(
"(%s to commit anyway.)" ),
2590 statusItem->
SetMessage(
_(
"Track violates DRC." ) );
2598 else if( evt->IsClick(
BUT_LEFT ) )
2600 bool forceFinish =
false;
2601 bool forceCommit = evt->Modifier(
MD_CTRL );
2611 || evt->IsActivate() )
2616 if( evt->IsActivate() && !evt->IsMoveTool() )
2621 else if( evt->IsUndoRedo() )
2649 evt->SetPassEvent();
2654 evt->SetPassEvent();
2663 if(
m_router->RoutingInProgress() )
2669 frame()->UndoRedoBlock(
false );
2696 if( vias + traces == 0 )
2710 for(
int i = 0; !reference && i < aCollector.
GetCount(); i++ )
2711 reference =
dynamic_cast<PCB_TRACK*
>( aCollector[i] );
2725 refPoint = reference->
GetEnd();
2729 for(
int i = 0; i < aCollector.
GetCount(); i++ )
2733 if( neighbor && neighbor != reference )
2738 if( neighbor->
GetStart() != refPoint && neighbor->
GetEnd() != refPoint )
2745 aCollector.
Append( reference );
2775 std::copy( aOriginalSelection.
Items().begin(), aOriginalSelection.
Items().end(), std::back_inserter( selItems ) );
2791 std::deque<EDA_ITEM*> selectedItems =
selection.GetItems();
2803 std::set<FOOTPRINT*> footprints;
2806 footprints.insert(
static_cast<FOOTPRINT*
>( item ) );
2811 for(
int idx = 1; idx <
selection.Size(); ++idx )
2813 if( !
selection.GetItem( idx )->IsBOARD_ITEM() )
2828 bool wasLocked =
false;
2845 bool showCourtyardConflicts =
frame()->GetPcbNewSettings()->m_ShowCourtyardCollisions;
2847 std::shared_ptr<DRC_ENGINE> drcEngine =
m_toolMgr->GetTool<
DRC_TOOL>()->GetDRCEngine();
2851 std::vector<BOARD_ITEM*> dynamicItems;
2852 std::unique_ptr<CONNECTIVITY_DATA> dynamicData =
nullptr;
2854 std::vector<PNS::ITEM*> leaderSegments;
2855 bool singleFootprintDrag =
false;
2862 m_toolMgr->GetView()->SyncLayerVisibilityCache();
2864 if( !footprints.empty() )
2866 if( footprints.size() == 1 )
2867 singleFootprintDrag =
true;
2869 if( showCourtyardConflicts )
2879 itemsToDrag.
Add( solid );
2883 if( connectivityData->GetRatsnestForPad(
pad ).size() > 0 )
2884 dynamicItems.push_back(
pad );
2891 itemsToDrag.
Add( solid );
2897 || shape->GetLayer() ==
Margin
2901 itemsToDrag.
Add( solid );
2905 if( showCourtyardConflicts )
2909 dynamicData = std::make_unique<CONNECTIVITY_DATA>(
board()->GetConnectivity(), dynamicItems,
true );
2910 connectivityData->BlockRatsnestItems( dynamicItems );
2914 for(
const EDA_ITEM* selItem : selectedItems )
2916 if( !selItem->IsBOARD_ITEM() )
2929 itemsToDrag.
Add( pnsItem );
2941 if( itemsToDrag.
Count() >= 1 )
2947 int layer =
m_iface->GetPNSLayerFromBoardLayer( activeLayer );
2949 SEG::ecoord closestDistSq = std::numeric_limits<SEG::ecoord>::max();
2953 const SHAPE* shape = pitem->Shape( layer );
2960 if( distSq < closestDistSq )
2962 closestDistSq = distSq;
2963 closestItem = pitem;
2973 if( closestItem->
Net() )
2978 if( !footprints.empty() && singleFootprintDrag )
2989 tweakedMousePos =
footprint->GetPosition();
3004 int dragMode = aEvent.
Parameter<
int> ();
3006 bool dragStarted =
m_router->StartDragging( p, itemsToDrag, dragMode );
3013 if( !footprints.empty() )
3014 connectivityData->ClearLocalRatsnest();
3028 frame()->UndoRedoBlock(
true );
3049 UI_UPDATE_INTERVAL_GUARD uiGuard( 200 );
3051 bool hasMouseMoved =
false;
3052 bool hasMultidragCancelled =
false;
3058 m_toolMgr->GetView()->SyncLayerVisibilityCache();
3062 if( evt->IsCancelInteractive()
3064 || evt->IsActivate() )
3069 hasMultidragCancelled =
true;
3073 else if( evt->IsMotion() || evt->IsDrag(
BUT_LEFT ) )
3075 hasMouseMoved =
true;
3081 if( !footprints.empty() )
3090 previewItem =
static_cast<BOARD_ITEM*
>( drawing->Clone() );
3091 previewItem->
Move( offset );
3100 &&
pad->GetDrillSize().x == 0 )
3103 previewItem->
Move( offset );
3116 previewItem->
Move( offset );
3121 previewItem->
Move( offset );
3125 if( showCourtyardConflicts )
3129 if( showCourtyardConflicts )
3131 courtyardClearanceDRC.
Run();
3139 dynamicData->Move( offset - lastOffset );
3140 lastOffset = offset;
3141 connectivityData->ComputeLocalRatsnest( dynamicItems, dynamicData.get(), offset );
3148 if( dragger->GetForceMarkObstaclesMode( &dragStatus ) )
3156 statusItem->
SetMessage(
_(
"Track violates DRC." ) );
3164 else if( hasMouseMoved && ( evt->IsMouseUp(
BUT_LEFT ) || evt->IsClick(
BUT_LEFT ) ) )
3166 bool forceFinish =
false;
3167 bool forceCommit = evt->Modifier(
MD_CTRL );
3171 leaderSegments =
m_router->GetLastCommittedLeaderSegments();
3175 else if( evt->IsUndoRedo() )
3203 evt->SetPassEvent();
3208 evt->SetPassEvent();
3214 if( !footprints.empty() )
3231 connectivityData->ClearLocalRatsnest();
3237 if(
m_router->RoutingInProgress() )
3241 if( itemsToDrag.
Size() && hasMultidragCancelled )
3245 else if( leaderSegments.size() )
3247 std::vector<EDA_ITEM*> newItems;
3250 newItems.push_back( lseg->Parent() );
3258 frame()->UndoRedoBlock(
false );
3284 m_toolMgr->GetView()->SyncLayerVisibilityCache();
3312 KIDIALOG dlg(
frame(),
_(
"The selected item is locked." ),
_(
"Confirmation" ),
3313 wxOK | wxCANCEL | wxICON_WARNING );
3314 dlg.SetOKLabel(
_(
"Break Track" ) );
3321 frame()->UndoRedoBlock(
true );
3324 if(
m_router->RoutingInProgress() )
3327 frame()->UndoRedoBlock(
false );
3355 if( !
m_router->GetCurrentNets().empty() )
3374 std::vector<MSG_PANEL_ITEM> items;
3381 std::vector<PNS::NET_HANDLE> nets =
m_router->GetCurrentNets();
3382 wxString description;
3388 wxASSERT( nets.size() >= 2 );
3395 description = wxString::Format(
_(
"Routing Diff Pair: %s" ),
3402 if( *netclassA == *netclassB )
3408 secondary = wxString::Format(
_(
"Resolved Netclass: %s" ),
3411 else if( !nets.empty() && nets[0] )
3415 description = wxString::Format(
_(
"Routing Track: %s" ),
3418 secondary = wxString::Format(
3419 _(
"Resolved Netclass: %s" ),
3424 description =
_(
"Routing Track" );
3425 secondary =
_(
"(no net)" );
3428 items.emplace_back( description, secondary );
3430 wxString cornerMode;
3432 if(
m_router->Settings().GetFreeAngleMode() )
3434 cornerMode =
_(
"Free-angle" );
3438 switch(
m_router->Settings().GetCornerMode() )
3448 items.emplace_back(
_(
"Corner Style" ), cornerMode );
3450 switch(
m_router->Settings().Mode() )
3458 items.emplace_back(
_(
"Mode" ), mode );
3460#define FORMAT_VALUE( x ) frame()->MessageTextFromValue( x )
3464 items.emplace_back( wxString::Format(
_(
"Track Width: %s" ),
3466 wxString::Format(
_(
"(from %s)" ),
3469 items.emplace_back( wxString::Format(
_(
"Min Clearance: %s" ),
3471 wxString::Format(
_(
"(from %s)" ),
3474 items.emplace_back( wxString::Format(
_(
"Diff Pair Gap: %s" ),
3476 wxString::Format(
_(
"(from %s)" ),
3480 wxASSERT( traces.
Count() == 2 );
3483 traces[1],
m_router->GetCurrentLayer(), &constraint ) )
3485 items.emplace_back( wxString::Format(
_(
"DP Max Uncoupled-length: %s" ),
3487 wxString::Format(
_(
"(from %s)" ),
3493 items.emplace_back( wxString::Format(
_(
"Track Width: %s" ),
3495 wxString::Format(
_(
"(from %s)" ),
3498 items.emplace_back( wxString::Format(
_(
"Min Clearance: %s" ),
3500 wxString::Format(
_(
"(from %s)" ),
3506 frame()->SetMsgPanel( items );
std::function< void(const VECTOR2I &, GENERAL_COLLECTOR &, PCB_SELECTION_TOOL *)> CLIENT_SELECTION_FILTER
@ switch_corner_rounding_shape
constexpr BOX2I BOX2ISafe(const BOX2D &aInput)
static TOOL_ACTION cancelInteractive
static TOOL_ACTION selectionCursor
Select a single item under the cursor position.
static TOOL_ACTION pasteSpecial
static TOOL_ACTION doDelete
static TOOL_ACTION selectionClear
Clear the current selection.
static TOOL_ACTION finishInteractive
static TOOL_ACTION selectItems
Select a list of items (specified as the event parameter)
Manage TOOL_ACTION objects.
void SetConditions(const TOOL_ACTION &aAction, const ACTION_CONDITIONS &aConditions)
Set the conditions the UI elements for activating a specific tool action should use for determining t...
static const ADVANCED_CFG & GetCfg()
Get the singleton instance's config, which is shared by all consumers.
void SetLayerVisible(int aLayer, bool isVisible)
BASE_SET & set(size_t pos)
virtual void Push(const wxString &aMessage=wxEmptyString, int aCommitFlags=0) override
Execute the changes.
A base class derived from BOARD_ITEM for items that can be connected and have a net,...
virtual void SetNet(NETINFO_ITEM *aNetInfo)
Set a NET_INFO object for the item.
void SetLayer(PCB_LAYER_ID aLayer) override
Set the layer this item is on.
NETINFO_ITEM * GetNet() const
Return #NET_INFO object for a given item.
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.
int GetCurrentViaSize() const
void SetViaSizeIndex(int aIndex)
Set the current via size list index to aIndex.
std::shared_ptr< DRC_ENGINE > m_DRCEngine
bool m_UseConnectedTrackWidth
int GetTrackWidthIndex() const
int GetViaSizeIndex() const
int GetDiffPairIndex() const
std::vector< DIFF_PAIR_DIMENSION > m_DiffPairDimensionsList
void SetDiffPairIndex(int aIndex)
bool m_TempOverrideTrackWidth
void SetCustomDiffPairGap(int aGap)
Sets custom gap for differential pairs (i.e.
bool UseNetClassVia() const
Return true if netclass values should be used to obtain appropriate via size.
int GetViaStackIndex() 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.
void SetTrackWidthIndex(int aIndex)
Set the current track width list index to aIndex.
int GetCopperLayerCount() const
void UseCustomDiffPairDimensions(bool aEnabled)
Enables/disables custom differential pair dimensions.
std::vector< int > m_TrackWidthList
int GetCurrentViaDrill() const
std::vector< VIA_STACK_PRESET > m_ViaStackPresets
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...
void SetLocked(bool aLocked) override
bool IsLocked() const override
virtual void Move(const VECTOR2I &aMoveVector)
Move this object.
Information pertinent to a Pcbnew printed circuit board.
NETINFO_ITEM * FindNet(int aNetcode) const
Search for a net with the given netcode.
bool IsLayerVisible(PCB_LAYER_ID aLayer) const
A proxy function that calls the correspondent function in m_BoardSettings tests whether a given layer...
BOARD_DESIGN_SETTINGS & GetDesignSettings() const
const LSET & GetEnabledLayers() const
A proxy function that calls the corresponding function in m_BoardSettings.
std::shared_ptr< CONNECTIVITY_DATA > GetConnectivity() const
Return a list of missing connections between components/tracks.
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.
PNS::LOGGER::TEST_CASE_TYPE getTestCaseType() const
const wxString & getTestCaseName() const
Implementing DIALOG_TRACK_VIA_SIZE_BASE.
@ ROUNDED_90
H/V with filleted corners.
@ MITERED_90
H/V only (90-degree corners)
@ ROUNDED_45
H/V/45 with filleted corners.
@ MITERED_45
H/V/45 with mitered corners (default)
DRC_CONSTRAINT EvalRules(DRC_CONSTRAINT_T aConstraintType, const BOARD_ITEM *a, const BOARD_ITEM *b, PCB_LAYER_ID aLayer, REPORTER *aReporter=nullptr)
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, INFOBAR_MESSAGE_TYPE aType=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...
virtual void Refresh(bool aEraseBackground=true, const wxRect *aRect=nullptr) override
A base class for most all the KiCad significant classes used in schematics and boards.
void SetFlags(EDA_ITEM_FLAGS aMask)
KICAD_T Type() const
Returns the type of object.
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.
Helper class to create more flexible dialogs, including 'do not show again' checkbox handling.
void DoNotShowCheckbox(wxString file, int line)
Shows the 'do not show again' checkbox.
Abstract interface for drawing on a 2D-surface.
BOX2D GetVisibleWorldExtents() const
bool GetGridSnapping() const
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
GAL * GetGAL() const
Return the GAL this view is using to draw graphical primitives.
void Hide(VIEW_ITEM *aItem, bool aHide=true, bool aHideOverlay=false)
Temporarily hide the item in the view (e.g.
void AddToPreview(VIEW_ITEM *aItem, bool aTakeOwnership=true)
LSEQ is a sequence (and therefore also a set) of PCB_LAYER_IDs.
LSET is a set of PCB_LAYER_IDs.
static const LSET & AllCuMask()
return AllCuMask( MAX_CU_LAYERS );
LSEQ UIOrder() const
Return the copper, technical and user layers in the order shown in layer widget.
static LSET AllNonCuMask()
Return a mask holding all layer minus CU layers.
static LSET AllCuMask(int aCuLayerCount)
Return a mask holding the requested number of Cu PCB_LAYER_IDs.
bool Contains(PCB_LAYER_ID aLayer) const
See if the layer set contains a PCB layer.
A collection of nets and the parameters used to route or test these nets.
bool HasuViaDrill() const
const wxString GetHumanReadableName() const
Gets the consolidated name of this netclass (which may be an aggregate).
bool HasuViaDiameter() const
int GetuViaDiameter() const
Handle the data for a net.
const wxString & GetNetname() const
static const int UNCONNECTED
Constant that holds the "unconnected net" number (typically 0) all items "connected" to this net are ...
static wxString GetDefaultUserProjectsPath()
Gets the default path we point users to create projects.
static TOOL_ACTION_GROUP layerDirectSwitchActions()
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 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 layerInner29
static TOOL_ACTION routerOptimizeSelected
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 cancelCurrentItem
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 placeViaStack
static TOOL_ACTION layerInner23
static TOOL_ACTION layerInner28
Common, abstract interface for edit frames.
APPEARANCE_CONTROLS * GetAppearancePanel()
PCB_DRAW_PANEL_GAL * GetCanvas() const override
Return a pointer to GAL-based canvas of given EDA draw frame.
virtual PCB_LAYER_ID GetActiveLayer() const
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 SaveBoard(const wxString &aFileName, BOARD &aBoard, const std::map< std::string, UTF8 > *aProperties=nullptr) override
Write aBoard to a storage file in a format that this PCB_IO implementation knows about or it can be u...
PCB_LAYER_ID m_Route_Layer_TOP
PCB_LAYER_ID m_Route_Layer_BOTTOM
void SetEnd(const VECTOR2I &aEnd)
void SetStart(const VECTOR2I &aStart)
const VECTOR2I & GetStart() const
const VECTOR2I & GetEnd() const
EDA_ITEM_FLAGS IsPointOnEnds(const VECTOR2I &point, int min_dist=0) const
Return STARTPOINT if point if near (dist = min_dist) start point, ENDPOINT if point if near (dist = m...
static int ExpandMultiHopMicrovias(BOARD *aBoard, BOARD_COMMIT *aCommit, const std::function< const VIA_STACK_PRESET *(PCB_VIA *)> &aMatcher=nullptr)
Replace loose microvias spanning more than one hop with stacks of single hop microvias.
static std::set< KIID > CollectExpandableMicrovias(BOARD *aBoard)
Ids of the vias ExpandMultiHopMicrovias would consider right now.
static const wxString GENERATOR_TYPE
PCB_LAYER_ID BottomLayer() const
void SetLayerPair(PCB_LAYER_ID aTopLayer, PCB_LAYER_ID aBottomLayer)
For a via m_layer contains the top layer, the other layer is in m_bottomLayer/.
void SetViaType(VIATYPE aViaType)
PCB_LAYER_ID TopLayer() const
int Count(int aKindMask=-1) const
void Add(const LINE &aLine)
std::vector< ITEM * > & Items()
Base class for PNS router board items.
const PNS_LAYER_RANGE & Layers() const
virtual NET_HANDLE Net() const
bool OfKind(int aKindMask) const
virtual HOLE * Hole() const
virtual bool HasHole() const
Represents a track on a PCB, connecting two non-trivial joints (that is, vias, pads,...
bool CompareGeometry(const LINE &aOther)
Reverse the point/vertex order.
virtual void ClearLinks()
Return the number of segments that were assembled together to form this line.
static wxString FormatLogFileAsJSON(const LOG_DATA &aLogData)
Keep the router "world" - i.e.
NODE * Branch()
Create a lightweight copy (called branch) of self that tracks the changes (added/removed items) wrs t...
OPT_OBSTACLE CheckColliding(const ITEM *aItem, int aKindMask=ITEM::ANY_T)
Check if the item collides with anything else in the world, and if found, returns the obstacle.
RULE_RESOLVER * GetRuleResolver() const
Return the number of joints.
bool Add(std::unique_ptr< SEGMENT > aSegment, bool aAllowRedundant=false)
Add an item to the current node.
const LINE AssembleLine(LINKED_ITEM *aSeg, int *aOriginSegmentIndex=nullptr, bool aStopAtLockedJoints=false, bool aFollowLockedSegments=false, bool aAllowSegmentSizeMismatch=true)
Follow the joint map to assemble a line connecting two non-trivial joints starting from segment aSeg.
ITEM * FindItemByParent(const BOARD_ITEM *aParent)
void Remove(ARC *aArc)
Remove an item from this branch.
static bool Optimize(LINE *aLine, int aEffortLevel, NODE *aWorld, const VECTOR2I &aV=VECTOR2I(0, 0))
@ SMART_PADS
Reroute pad exits.
@ FANOUT_CLEANUP
Simplify pad-pad and pad-via connections if possible.
@ MERGE_SEGMENTS
Reduce corner cost iteratively.
@ MERGE_COLINEAR
Merge co-linear segments.
@ MERGE_OBTUSE
Reduce corner cost by merging obtuse segments.
@ REQUIRE_OBTUSE_ANGLES
Try to prevent 90-degree or acute corners in a drag.
Contain all persistent settings of the router, such as the mode, optimization effort,...
void SetMode(PNS_MODE aMode)
Return the optimizer effort. Bigger means cleaner traces, but slower routing.
PNS_MODE Mode() const
Set the routing mode.
virtual NET_HANDLE DpCoupledNet(NET_HANDLE 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)
void SetClearance(int aClearance)
bool TrackWidthIsExplicit() const
void SetViaDiameter(int aDiameter)
void SetClearanceSource(const wxString &aSource)
wxString GetWidthSource() const
void SetWidthSource(const wxString &aSource)
int DiffPairViaGap() const
Represent a contiguous set of PCB layers.
bool Overlaps(const PNS_LAYER_RANGE &aOther) const
bool SaveAs(const wxString &aDirectory, const wxString &aFile)
bool SaveAs(const wxString &aDirectory, const wxString &aFile)
Container for project specific data.
virtual PROJECT_LOCAL_SETTINGS & GetLocalSettings() const
virtual PROJECT_FILE & GetProjectFile() const
Describe ratsnest for a single net.
const std::vector< CN_EDGE > & GetEdges() const
void SetMessage(const wxString &aStatus)
void SetHint(const wxString &aHint)
void SetPosition(const VECTOR2I &aPos) override
VECTOR2I::extended_type ecoord
static bool NotEmpty(const SELECTION &aSelection)
Test if there are any items selected.
static bool ShowAlways(const SELECTION &aSelection)
The default condition function (always returns true).
std::deque< EDA_ITEM * > & Items()
An abstract shape on 2D plane.
virtual SEG::ecoord SquaredDistance(const VECTOR2I &aP, bool aOutlineOnly=false) const
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.
bool IsOK(wxWindow *aParent, const wxString &aMessage)
Display a yes/no dialog with aMessage and returns the user response.
void DisplayError(wxWindow *aParent, const wxString &aText)
Display an error or warning message box with aMessage.
This file is part of the common library.
@ VIA_DIAMETER_CONSTRAINT
@ DIFF_PAIR_GAP_CONSTRAINT
#define ROUTER_TRANSIENT
transient items that should NOT be cached
#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
a few functions useful in geometry calculations.
VECTOR2< ret_type > GetClampedCoords(const VECTOR2< in_type > &aCoords, pad_type aPadding=1u)
Clamps a vector to values that can be negated, respecting numeric limits of coordinates data type wit...
wxString m_RouterTestCaseDirectory
Router test case directory.
static const std::string DesignRulesFileExtension
wxString KeyNameFromKeyCode(int aKeycode, bool *aIsFound)
Return the key name from the key code.
bool IsCopperLayer(int aLayerId)
Test whether a layer is a copper layer.
PCB_LAYER_ID
A quick note on layer IDs:
std::optional< wxString > fileHashMMH3(const wxString &aFilePath)
Calculates an MMH3 hash of a given file.
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
Class that computes missing connections on a PCB.
std::vector< EDA_ITEM * > EDA_ITEMS
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,...
An abstract function object, returning a design rule (clearance, diff pair gap, etc) required between...
std::optional< wxString > m_BoardHash
std::optional< TEST_CASE_TYPE > m_TestCaseType
std::vector< ITEM * > m_AddedItems
std::vector< EVENT_ENTRY > m_Events
std::set< KIID > m_RemovedItems
std::vector< ITEM * > m_Heads
Container to handle a stock of specific vias each with unique diameter and drill sizes in the BOARD c...
A named microvia stack definition, chosen while routing instead of entering the values each time.
PCB_LAYER_ID m_StartLayer
HYPERLINK_DV_RENDERER::RUN RUN
@ 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)
VECTOR2< int32_t > VECTOR2I
VECTOR2< double > VECTOR2D
wxPoint ToWxPoint(const VECTOR2I &aSize)
wxString AddFileExtListToFilter(const std::vector< std::string > &aExts)
Build the wildcard extension file dialog wildcard filter to add to the base message dialog.
Definition of file extensions used in Kicad.