49 m_trackStartX( aParent, m_TrackStartXLabel, m_TrackStartXCtrl, m_TrackStartXUnit ),
50 m_trackStartY( aParent, m_TrackStartYLabel, m_TrackStartYCtrl, m_TrackStartYUnit ),
51 m_trackEndX( aParent, m_TrackEndXLabel, m_TrackEndXCtrl, m_TrackEndXUnit ),
52 m_trackEndY( aParent, m_TrackEndYLabel, m_TrackEndYCtrl, m_TrackEndYUnit ),
53 m_trackWidth( aParent, m_TrackWidthLabel, m_TrackWidthCtrl, m_TrackWidthUnit ),
54 m_viaX( aParent, m_ViaXLabel, m_ViaXCtrl, m_ViaXUnit ),
55 m_viaY( aParent, m_ViaYLabel, m_ViaYCtrl, m_ViaYUnit ),
56 m_viaDiameter( aParent, m_ViaDiameterLabel, m_ViaDiameterCtrl, m_ViaDiameterUnit ),
57 m_viaDrill( aParent, m_ViaDrillLabel, m_ViaDrillCtrl, m_ViaDrillUnit ),
92 bool hasLocked =
false;
93 bool hasUnlocked =
false;
98 int selection_first_layer = -1;
99 int selection_last_layer = -1;
102 int track_selection_layer = -1;
104 auto getAnnularRingSelection =
107 if( !
via->GetRemoveUnconnected() )
109 else if(
via->GetKeepStartEnd() )
128 switch( item->Type() )
142 track_selection_layer = t->
GetLayer();
162 if( track_selection_layer != t->
GetLayer() )
190 selection_first_layer = v->
TopLayer();
213 if( selection_first_layer != v->
TopLayer() )
308 int viaSelection = wxNOT_FOUND;
311 for(
unsigned ii = 1; ii < aParent->
GetDesignSettings().m_ViasDimensionsList.size(); ii++ )
319 if( viaSelection == wxNOT_FOUND
323 viaSelection = ii - 1;
355 int widthSelection = wxNOT_FOUND;
358 for(
unsigned ii = 1; ii < aParent->
GetDesignSettings().m_TrackWidthList.size(); ii++ )
365 widthSelection = ii - 1;
375 if( hasLocked && hasUnlocked )
453 if( changingPads.size() == 1 )
455 PAD*
pad = *changingPads.begin();
456 msg.Printf(
_(
"Changing the net will also update %s pad %s to %s." ),
457 pad->GetParent()->GetReference(),
461 else if( changingPads.size() == 2 )
463 PAD* pad1 = *changingPads.begin();
464 PAD* pad2 = *( ++changingPads.begin() );
465 msg.Printf(
_(
"Changing the net will also update %s pad %s and %s pad %s to %s." ),
474 msg.Printf(
_(
"Changing the net will also update %lu connected pads to %s." ),
475 static_cast<unsigned long>( changingPads.size() ),
479 KIDIALOG dlg(
this, msg,
_(
"Confirmation" ), wxOK | wxCANCEL | wxICON_WARNING );
501 DisplayError( GetParent(),
_(
"Via hole size must be smaller than via diameter" ) );
510 DisplayError( GetParent(),
_(
"Via start layer and end layer cannot be the same" ) );
526 bool changeLock =
m_lockedCbox->Get3StateValue() != wxCHK_UNDETERMINED;
527 bool setLock =
m_lockedCbox->Get3StateValue() == wxCHK_CHECKED;
533 switch( item->Type() )
580 if(
m_viaNotFree->Get3StateValue() != wxCHK_UNDETERMINED )
634 wxFAIL_MSG( wxT(
"Unhandled via type" ) );
677 bool updateNets =
false;
678 std::vector<PAD*> changingPads;
687 auto connectedItems = connectivity->GetConnectedItems( boardItem,
696 if(
pad->GetNetCode() != newNetCode && !
alg::contains( changingPads, citem ) )
697 changingPads.push_back(
pad );
712 switch( item->Type() )
716 static_cast<PCB_TRACK*
>( item )->SetNetCode( newNetCode );
720 static_cast<PCB_VIA*
>( item )->SetNetCode( newNetCode );
729 for(
PAD*
pad : changingPads )
732 pad->SetNetCode( newNetCode );
760 bool enableNC = aEvent.IsChecked();
785 bool enableNC = aEvent.IsChecked();
815 if( startLayer < 0 || endLayer < 0 )
A base class derived from BOARD_ITEM for items that can be connected and have a net,...
virtual NETCLASS * GetEffectiveNetClass() const
Return the NETCLASS for this item.
std::vector< int > m_TrackWidthList
std::vector< VIA_DIMENSION > m_ViasDimensionsList
virtual PCB_LAYER_ID GetLayer() const
Return the primary layer this item is on.
virtual void SetLocked(bool aLocked)
virtual void SetLayer(PCB_LAYER_ID aLayer)
Set the layer this item is on.
virtual bool IsLocked() const
const NETINFO_LIST & GetNetInfo() const
int GetCopperLayerCount() const
int LayerDepth(PCB_LAYER_ID aStartLayer, PCB_LAYER_ID aEndLayer) const
std::shared_ptr< CONNECTIVITY_DATA > GetConnectivity() const
Return a list of missing connections between components/tracks.
Represent a set of changes (additions, deletions or modifications) of a data model (e....
COMMIT & Modify(EDA_ITEM *aItem)
Create an undo entry for an item that has been already modified.
virtual void Push(const wxString &aMessage=wxT("A commit"), int aFlags=0)=0
Revert the commit by restoring the modified items state.
void SetInitialFocus(wxWindow *aWindow)
Sets the window (usually a wxTextCtrl) that should be focused when the dialog is shown.
void SetupStandardButtons(std::map< int, wxString > aLabels={})
void finishDialogSettings()
In all dialogs, we must call the same functions to fix minimal dlg size, the default position and per...
Class DIALOG_TRACK_VIA_PROPERTIES_BASE.
wxStaticText * m_annularRingsLabel
PCB_LAYER_BOX_SELECTOR * m_ViaStartLayer
wxCheckBox * m_lockedCbox
wxChoice * m_DesignRuleViasCtrl
wxCheckBox * m_trackNetclass
wxStaticText * m_DesignRuleVias
PCB_LAYER_BOX_SELECTOR * m_ViaEndLayer
wxStaticBoxSizer * m_sbTrackSizer
wxChoice * m_annularRingsCtrl
wxStaticBoxSizer * m_sbViaSizer
wxCheckBox * m_viaNetclass
PCB_LAYER_BOX_SELECTOR * m_TrackLayerCtrl
wxStaticText * m_DesignRuleViasUnit
wxCheckBox * m_viaNotFree
wxChoice * m_ViaTypeChoice
wxTextCtrl * m_ViaDiameterCtrl
wxStaticText * m_DesignRuleWidths
wxTextCtrl * m_ViaDrillCtrl
wxStaticText * m_netSelectorLabel
wxChoice * m_DesignRuleWidthsCtrl
wxTextCtrl * m_TrackWidthCtrl
wxStaticText * m_DesignRuleWidthsUnits
NET_SELECTOR * m_netSelector
void onWidthEdit(wxCommandEvent &aEvent) override
const PCB_SELECTION & m_items
bool TransferDataFromWindow() override
void onUnitsChanged(wxCommandEvent &aEvent)
UNIT_BINDER m_viaDiameter
void onNetSelector(wxCommandEvent &aEvent)
void onWidthSelect(wxCommandEvent &aEvent) override
DIALOG_TRACK_VIA_PROPERTIES(PCB_BASE_FRAME *aParent, const PCB_SELECTION &aItems, COMMIT &aCommit)
void onViaEdit(wxCommandEvent &aEvent) override
bool confirmPadChange(const std::vector< PAD * > &connectedPads)
UNIT_BINDER m_trackStartY
void onViaSelect(wxCommandEvent &aEvent) override
void onViaNotFreeClicked(wxCommandEvent &aEvent) override
void onTrackNetclassCheck(wxCommandEvent &aEvent) override
UNIT_BINDER m_trackStartX
void onViaNetclassCheck(wxCommandEvent &aEvent) override
~DIALOG_TRACK_VIA_PROPERTIES()
A base class for most all the KiCad significant classes used in schematics and boards.
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.
bool SetOKCancelLabels(const ButtonLabel &ok, const ButtonLabel &cancel) override
Shows the 'do not show again' checkbox.
int GetLayerSelection() const
int SetLayerSelection(int layer)
bool SetLayersHotkeys(bool value)
static LSET AllNonCuMask()
Return a mask holding all layer minus CU layers.
A collection of nets and the parameters used to route or test these nets.
int GetViaDiameter() const
int GetuViaDiameter() const
int GetTrackWidth() const
void SetBoard(BOARD *aBoard)
void SetIndeterminateString(const wxString &aString)
void SetSelectedNetcode(int aNetcode)
void SetNetInfo(NETINFO_LIST *aNetInfoList)
const wxString & GetNumber() const
FOOTPRINT * GetParent() const
Base PCB main window class for Pcbnew, Gerbview, and CvPcb footprint viewer.
virtual BOARD_DESIGN_SETTINGS & GetDesignSettings() const
Returns the BOARD_DESIGN_SETTINGS for the open project.
void SetBoardFrame(PCB_BASE_FRAME *aFrame)
void SetNotAllowedLayerSet(LSET aMask)
void SetUndefinedLayerName(const wxString &aName)
void SetWidth(int aWidth)
void SetEnd(const VECTOR2I &aEnd)
void SetStart(const VECTOR2I &aStart)
const VECTOR2I & GetStart() const
const VECTOR2I & GetEnd() const
void SetRemoveUnconnected(bool aSet)
Sets the unconnected removal property.
bool GetIsFree() const
Checks if the via is a free via (as opposed to one created on a track by the router).
PCB_LAYER_ID BottomLayer() const
VECTOR2I GetPosition() const override
void SetKeepStartEnd(bool aSet)
Sets whether we keep the start and end annular rings even if they are not connected.
void SetBottomLayer(PCB_LAYER_ID aLayer)
void SetDrill(int aDrill)
Function SetDrill sets the drill value for vias.
void SetIsFree(bool aFree=true)
void SetTopLayer(PCB_LAYER_ID aLayer)
void SetPosition(const VECTOR2I &aPoint) override
void SanitizeLayers()
Function SanitizeLayers Check so that the layers are correct dependin on the type of via,...
void SetViaType(VIATYPE aViaType)
PCB_LAYER_ID TopLayer() const
int GetDrillValue() const
Function GetDrillValue "calculates" the drill value for vias (m-Drill if > 0, or default drill value ...
VIATYPE GetViaType() const
bool Empty() const
Checks if there is anything selected.
wxString StringFromValue(double aValue, bool aAddUnitLabel=false, EDA_DATA_TYPE aType=EDA_DATA_TYPE::DISTANCE)
Converts aValue in internal units into a united string.
EDA_UNITS GetUserUnits() const
virtual long long int GetValue()
Return the current value in Internal Units.
void Enable(bool aEnable)
Enable/disable the label, widget and units label.
bool IsIndeterminate() const
Return true if the control holds the indeterminate value (for instance, if it represents a multiple s...
virtual bool Validate(double aMin, double aMax, EDA_UNITS aUnits=EDA_UNITS::UNSCALED)
Validate the control against the given range, informing the user of any errors found.
virtual void ChangeValue(int aValue)
Set new value (in Internal Units) for the text field, taking care of units conversion WITHOUT trigger...
virtual void SetValue(long long int aValue)
Set new value (in Internal Units) for the text field, taking care of units conversion.
void SetCoordType(ORIGIN_TRANSFORMS::COORD_TYPES_T aCoordType)
Set the current origin transform mode.
void DisplayError(wxWindow *aParent, const wxString &aText, int aDisplayTime)
Display an error or warning message box with aMessage.
This file is part of the common library.
PCB_LAYER_ID
A quick note on layer IDs:
PCB_LAYER_ID ToLAYER_ID(int aLayer)
This file contains miscellaneous commonly used macros and functions.
#define KI_FALLTHROUGH
The KI_FALLTHROUGH macro is to be used when switch statement cases should purposely fallthrough from ...
wxString GetLabel(EDA_UNITS aUnits, EDA_DATA_TYPE aType=EDA_DATA_TYPE::DISTANCE)
Get the units string for a given units type.
bool contains(const _Container &__container, _Value __value)
Returns true if the container contains the given value.
#define GEOMETRY_MIN_SIZE
Container to handle a stock of specific vias each with unique diameter and drill sizes in the BOARD c...
@ PCB_VIA_T
class PCB_VIA, a via (like a track segment on a copper layer)
@ PCB_FOOTPRINT_T
class FOOTPRINT, a footprint
@ PCB_PAD_T
class PAD, a pad in 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)
#define INDETERMINATE_STATE
Used for holding indeterminate values, such as with multiple selections holding different values or c...