KiCad PCB EDA Suite
router_tool.cpp File Reference
#include <wx/numdlg.h>
#include <core/optional.h>
#include <functional>
#include "class_board.h"
#include <pcb_edit_frame.h>
#include <id.h>
#include <macros.h>
#include <pcbnew_id.h>
#include <view/view_controls.h>
#include <pcb_layer_widget.h>
#include <pcb_painter.h>
#include <dialogs/dialog_pns_settings.h>
#include <dialogs/dialog_pns_diff_pair_dimensions.h>
#include <dialogs/dialog_track_via_size.h>
#include <base_units.h>
#include <confirm.h>
#include <bitmaps.h>
#include <collectors.h>
#include <tool/action_menu.h>
#include <tool/tool_manager.h>
#include <tool/grid_menu.h>
#include <tool/zoom_menu.h>
#include <tools/pcb_actions.h>
#include <tools/selection_tool.h>
#include <tools/grid_helper.h>
#include "router_tool.h"
#include "pns_segment.h"
#include "pns_router.h"

Go to the source code of this file.

Classes

class  TRACK_WIDTH_MENU
 
class  DIFF_PAIR_MENU
 
class  ROUTER_TOOL_MENU
 

Macros

#define _(s)   s
 
#define _(s)   wxGetTranslation((s))
 

Enumerations

enum  VIA_ACTION_FLAGS {
  VIA_MASK = 0x03, VIA = 0x00, BLIND_VIA = 0x01, MICROVIA = 0x02,
  SELECT_LAYER = VIA_MASK + 1
}
 Flags used by via tool actions. More...
 

Functions

static VIATYPE_T getViaTypeFromFlags (int aFlags)
 

Variables

static const TOOL_ACTION ACT_EndTrack ("pcbnew.InteractiveRouter.EndTrack", AS_CONTEXT, WXK_END, "", _("Finish Track"), _("Stops laying the current track."), checked_ok_xpm)
 
static const TOOL_ACTION ACT_AutoEndRoute ("pcbnew.InteractiveRouter.AutoEndRoute", AS_CONTEXT, 'F', "", _("Auto-finish Track"), _("Automagically finishes laying the current track."))
 
static const TOOL_ACTION ACT_PlaceThroughVia ("pcbnew.InteractiveRouter.PlaceVia", AS_CONTEXT, 'V', LEGACY_HK_NAME("Add Through Via"), _("Place Through Via"), _("Adds a through-hole via at the end of currently routed track."), via_xpm, AF_NONE,(void *) VIA_ACTION_FLAGS::VIA)
 
static const TOOL_ACTION ACT_PlaceBlindVia ("pcbnew.InteractiveRouter.PlaceBlindVia", AS_CONTEXT, MD_ALT+MD_SHIFT+ 'V', LEGACY_HK_NAME("Add Blind/Buried Via"), _("Place Blind/Buried Via"), _("Adds a blind or buried via at the end of currently routed track."), via_buried_xpm, AF_NONE,(void *) VIA_ACTION_FLAGS::BLIND_VIA)
 
static const TOOL_ACTION ACT_PlaceMicroVia ("pcbnew.InteractiveRouter.PlaceMicroVia", AS_CONTEXT, MD_CTRL+ 'V', LEGACY_HK_NAME("Add MicroVia"), _("Place Microvia"), _("Adds a microvia at the end of currently routed track."), via_microvia_xpm, AF_NONE,(void *) VIA_ACTION_FLAGS::MICROVIA)
 
static const TOOL_ACTION ACT_SelLayerAndPlaceThroughVia ("pcbnew.InteractiveRouter.SelLayerAndPlaceVia", AS_CONTEXT, '<', LEGACY_HK_NAME("Select Layer and Add Through Via"), _("Select Layer and Place Through Via..."), _("Select a layer, then add a through-hole via at the end of currently routed track."), select_w_layer_xpm, AF_NONE,(void *)(VIA_ACTION_FLAGS::VIA|VIA_ACTION_FLAGS::SELECT_LAYER))
 
static const TOOL_ACTION ACT_SelLayerAndPlaceBlindVia ("pcbnew.InteractiveRouter.SelLayerAndPlaceBlindVia", AS_CONTEXT, MD_ALT+'<', LEGACY_HK_NAME("Select Layer and Add Blind/Buried Via"), _("Select Layer and Place Blind/Buried Via..."), _("Select a layer, then add a blind or buried via at the end of currently routed track."), select_w_layer_xpm, AF_NONE,(void *)(VIA_ACTION_FLAGS::BLIND_VIA|VIA_ACTION_FLAGS::SELECT_LAYER))
 
static const TOOL_ACTION ACT_CustomTrackWidth ("pcbnew.InteractiveRouter.CustomTrackViaSize", AS_CONTEXT, 'Q', LEGACY_HK_NAME("Custom Track/Via Size"), _("Custom Track/Via Size..."), _("Shows a dialog for changing the track width and via size."), width_track_xpm)
 
static const TOOL_ACTION ACT_SwitchPosture ("pcbnew.InteractiveRouter.SwitchPosture", AS_CONTEXT, '/', LEGACY_HK_NAME("Switch Track Posture"), _("Switch Track Posture"), _("Switches posture of the currently routed track."), change_entry_orient_xpm)
 

Macro Definition Documentation

◆ _ [1/2]

#define _ (   s)    s

Definition at line 140 of file router_tool.cpp.

◆ _ [2/2]

#define _ (   s)    wxGetTranslation((s))

Definition at line 140 of file router_tool.cpp.

Enumeration Type Documentation

◆ VIA_ACTION_FLAGS

Flags used by via tool actions.

Enumerator
VIA_MASK 
VIA 
BLIND_VIA 

Normal via

MICROVIA 

blind/buried via

SELECT_LAYER 

Microvia

Definition at line 58 of file router_tool.cpp.

59 {
60  // Via type
61  VIA_MASK = 0x03,
62  VIA = 0x00,
63  BLIND_VIA = 0x01,
64  MICROVIA = 0x02,
65 
66  // Select layer
67  SELECT_LAYER = VIA_MASK + 1,
68 };
Normal via
Definition: router_tool.cpp:63
blind/buried via
Definition: router_tool.cpp:64
Microvia
Definition: router_tool.cpp:67

Function Documentation

◆ getViaTypeFromFlags()

static VIATYPE_T getViaTypeFromFlags ( int  aFlags)
static

Definition at line 504 of file router_tool.cpp.

505 {
506  switch( aFlags & VIA_ACTION_FLAGS::VIA_MASK )
507  {
508  case VIA_ACTION_FLAGS::VIA: return VIA_THROUGH;
511  default:
512  wxASSERT_MSG( false, "Unhandled via type" );
513  return VIA_THROUGH;
514  }
515 }
Normal via
Definition: router_tool.cpp:63
blind/buried via
Definition: router_tool.cpp:64

References BLIND_VIA, MICROVIA, VIA, VIA_BLIND_BURIED, VIA_MASK, VIA_MICROVIA, and VIA_THROUGH.

Referenced by ROUTER_TOOL::onViaCommand().

Variable Documentation

◆ ACT_AutoEndRoute

const TOOL_ACTION ACT_AutoEndRoute("pcbnew.InteractiveRouter.AutoEndRoute", AS_CONTEXT, 'F', "", _("Auto-finish Track"), _("Automagically finishes laying the current track."))
static

◆ ACT_CustomTrackWidth

const TOOL_ACTION ACT_CustomTrackWidth("pcbnew.InteractiveRouter.CustomTrackViaSize", AS_CONTEXT, 'Q', LEGACY_HK_NAME("Custom Track/Via Size"), _("Custom Track/Via Size..."), _("Shows a dialog for changing the track width and via size."), width_track_xpm)
static

◆ ACT_EndTrack

const TOOL_ACTION ACT_EndTrack("pcbnew.InteractiveRouter.EndTrack", AS_CONTEXT, WXK_END, "", _("Finish Track"), _("Stops laying the current track."), checked_ok_xpm)
static

◆ ACT_PlaceBlindVia

const TOOL_ACTION ACT_PlaceBlindVia("pcbnew.InteractiveRouter.PlaceBlindVia", AS_CONTEXT, MD_ALT+MD_SHIFT+'V', LEGACY_HK_NAME("Add Blind/Buried Via"), _("Place Blind/Buried Via"), _("Adds a blind or buried via at the end of currently routed track."), via_buried_xpm, AF_NONE,(void *) VIA_ACTION_FLAGS::BLIND_VIA)
static

◆ ACT_PlaceMicroVia

const TOOL_ACTION ACT_PlaceMicroVia("pcbnew.InteractiveRouter.PlaceMicroVia", AS_CONTEXT, MD_CTRL+'V', LEGACY_HK_NAME("Add MicroVia"), _("Place Microvia"), _("Adds a microvia at the end of currently routed track."), via_microvia_xpm, AF_NONE,(void *) VIA_ACTION_FLAGS::MICROVIA)
static

◆ ACT_PlaceThroughVia

const TOOL_ACTION ACT_PlaceThroughVia("pcbnew.InteractiveRouter.PlaceVia", AS_CONTEXT, 'V', LEGACY_HK_NAME("Add Through Via"), _("Place Through Via"), _("Adds a through-hole via at the end of currently routed track."), via_xpm, AF_NONE,(void *) VIA_ACTION_FLAGS::VIA)
static

◆ ACT_SelLayerAndPlaceBlindVia

const TOOL_ACTION ACT_SelLayerAndPlaceBlindVia("pcbnew.InteractiveRouter.SelLayerAndPlaceBlindVia", AS_CONTEXT, MD_ALT+'<', LEGACY_HK_NAME("Select Layer and Add Blind/Buried Via"), _("Select Layer and Place Blind/Buried Via..."), _("Select a layer, then add a blind or buried via at the end of currently routed track."), select_w_layer_xpm, AF_NONE,(void *)(VIA_ACTION_FLAGS::BLIND_VIA|VIA_ACTION_FLAGS::SELECT_LAYER))
static

◆ ACT_SelLayerAndPlaceThroughVia

const TOOL_ACTION ACT_SelLayerAndPlaceThroughVia("pcbnew.InteractiveRouter.SelLayerAndPlaceVia", AS_CONTEXT, '<', LEGACY_HK_NAME("Select Layer and Add Through Via"), _("Select Layer and Place Through Via..."), _("Select a layer, then add a through-hole via at the end of currently routed track."), select_w_layer_xpm, AF_NONE,(void *)(VIA_ACTION_FLAGS::VIA|VIA_ACTION_FLAGS::SELECT_LAYER))
static

◆ ACT_SwitchPosture

const TOOL_ACTION ACT_SwitchPosture("pcbnew.InteractiveRouter.SwitchPosture", AS_CONTEXT, '/', LEGACY_HK_NAME("Switch Track Posture"), _("Switch Track Posture"), _("Switches posture of the currently routed track."), change_entry_orient_xpm)
static