60#include <wx/choicdlg.h>
111#define PTH_DLG_TYPE 0
112#define SMD_DLG_TYPE 1
113#define CONN_DLG_TYPE 2
114#define NPTH_DLG_TYPE 3
115#define APERTURE_DLG_TYPE 4
116#define NON_COMPONENT_DLG_TYPE 5
186 SetTitle(
_(
"Pad Properties" ) );
229 "Enter an absolute value (e.g., -0.1mm), a percentage (e.g., -5%), "
230 "or both (e.g., -0.1mm - 5%).\n"
231 "If blank, the footprint or global value is used." ) );
295 wxUpdateUIEvent dummyUI;
352 if( !calcFrame->IsVisible() )
353 calcFrame->Show(
true );
355 if( calcFrame->IsIconized() )
356 calcFrame->Iconize(
false );
364 nlohmann::json payload;
365 payload[
"page"] =
"pth_size";
367 std::string payloadStr = payload.dump();
383 m_parent->GetCanvas()->GetBackend() );
408 settings->SetHighContrast(
false );
415 double gridsize = 0.001 *
pcbIUScale.IU_PER_MM;
482 wxCommandEvent cmd_event;
533 double baseline = 1.0;
535 auto considerCheckboxes = [&](
const std::vector<wxCheckBox*>& checkBoxes )
537 for(
size_t ii : { 0, 1, 2, 3 } )
539 if( !checkBoxes[ii]->IsChecked() )
542 if( checkBoxes[( ii + 1 ) % 4]->IsChecked() || checkBoxes[( ii - 1 ) % 4]->IsChecked() )
545 baseline = std::max( baseline, 0.5 );
569 auto updateCheckBoxes = [](
const std::vector<wxCheckBox*>& aCheckBoxes )
571 for(
size_t ii : { 0, 1, 2, 3 } )
573 bool disable = aCheckBoxes[( ii + 1 ) % 4]->IsChecked()
574 || aCheckBoxes[( ii + 3 ) % 4]->IsChecked();
576 aCheckBoxes[ii]->Enable( !disable );
579 aCheckBoxes[ii]->SetValue(
false );
599 wxObject* ctrl =
event.GetEventObject();
600 wxString value =
event.GetString();
601 bool changed =
false;
607 if( value.ToDouble( &ratioPercent ) )
612 if( ratioPercent < 0.0 )
617 else if( ratioPercent > maxRatio * 100.0 )
635 if( value.ToDouble( &ratioPercent ) )
639 if( ratioPercent < 0.0 )
644 else if( ratioPercent > maxRatio * 100.0 )
701 if( footprint->IsFlipped() )
705 relPos.
y = - relPos.
y;
712 msg.Printf(
_(
"Footprint %s (%s), %s, rotated %g deg"),
713 footprint->Reference().GetShownText(
FOR_GUI ),
714 footprint->Value().GetShownText(
FOR_GUI ),
715 footprint->IsFlipped() ?
_(
"back side (mirrored)" ) :
_(
"front side" ),
716 footprint->GetOrientation().AsDegrees() );
735 m_posX.ChangeValue( absPos.
x );
736 m_posY.ChangeValue( absPos.
y );
754 if(
m_previewPad->GetLocalSolderMaskMargin().has_value() )
762 if(
m_previewPad->GetLocalThermalSpokeWidthOverride().has_value() )
767 if(
m_previewPad->GetLocalThermalGapOverride().has_value() )
841 std::optional<int> bottomBackdrillSize = padstack.
GetBackdrillSize(
false );
843 m_backDrillChoice->SetSelection( topBackdrillSize ? ( bottomBackdrillSize ? 3 : 1 )
844 : ( bottomBackdrillSize ? 2 : 0 ) );
852 aSizeBinder.SetValue( 0 );
856 aSizeBinder.SetValue( *aSize );
857 aLayerCtrl->SetLayerSelection( aEndLayer );
919 wxCommandEvent cmd_event;
991 wxCHECK_MSG(
m_board, ,
"Expected valid board in afterPadstackModeChanged" );
1009 std::vector choices = {
1011 _(
"Inner Layers" ),
1073 settings->SetHighContrast(
false );
1107 const double ipcRadiusRatio =
1144 const double ipcRadiusRatio =
1161 if( aUpdateSpokeAngle )
1197 for(
size_t i = 0; i <
m_notebook->GetPageCount(); ++i )
1222 if( wxMessageBox(
_(
"Switching to non-circular hole will disable backdrills and post-machining. Continue?" ),
1223 _(
"Warning" ), wxOK | wxCANCEL | wxICON_WARNING,
this ) != wxOK )
1299 bool hasHole =
true;
1300 bool hasConnection =
true;
1304 case PTH_DLG_TYPE: hasHole =
true; hasConnection =
true;
break;
1305 case SMD_DLG_TYPE: hasHole =
false; hasConnection =
true;
break;
1306 case CONN_DLG_TYPE: hasHole =
false; hasConnection =
true;
break;
1308 case NPTH_DLG_TYPE: hasHole =
true; hasConnection =
false;
break;
1324 else if(
m_holeX.GetValue() == 0 )
1337 if( !hasConnection )
1356 if( !enablePadstack )
1373 bool hasHole =
true;
1374 bool hasConnection =
true;
1378 case PTH_DLG_TYPE: hasHole =
true; hasConnection =
true;
break;
1379 case SMD_DLG_TYPE: hasHole =
false; hasConnection =
true;
break;
1380 case CONN_DLG_TYPE: hasHole =
false; hasConnection =
true;
break;
1382 case NPTH_DLG_TYPE: hasHole =
true; hasConnection =
false;
break;
1438 if( cu_set.test(
F_Cu ) && cu_set.test(
B_Cu ) )
1440 else if( cu_set.test(
F_Cu ) )
1442 else if( cu_set.test(
B_Cu ) )
1463 event.Enable( !
m_board->LegacyTeardrops() );
1475 bool remove_unconnected,
bool keep_top_bottom )
1481 LSET effective_mask;
1486 effective_mask = layer_mask.value_or(
PAD::PTHMask() );
1490 else if( !remove_unconnected )
1492 else if( keep_top_bottom )
1502 effective_mask = layer_mask.value_or(
PAD::SMDMask() );
1507 if( effective_mask.test(
F_Cu ) )
1520 if( effective_mask.test(
F_Cu ) )
1530 effective_mask = layer_mask.value_or(
LSET( {
F_Cu } ) );
1534 if( cuLayers.empty() )
1535 cuLayers.push_back(
F_Cu );
1554 if( effective_mask.test(
F_Cu ) && effective_mask.test(
B_Cu ) )
1556 else if( effective_mask.test(
F_Cu ) )
1558 else if( effective_mask.test(
B_Cu ) )
1639 wxArrayString error_msgs;
1640 wxArrayString warning_msgs;
1649 error_msgs.Add( wxString::Format( wxT(
"Error: %s" ), aResult.
message ) );
1653 warning_msgs.Add( wxString::Format( wxT(
"Warning: %s" ), aResult.
message ) );
1657 error_msgs.Add(
_(
"Error: Through hole pad has no hole." ) );
1661 if( error_msgs.GetCount() || warning_msgs.GetCount() )
1663 wxString title = error_msgs.GetCount() ?
_(
"Pad Properties Errors" )
1664 :
_(
"Pad Properties Warnings" );
1667 wxArrayString msgs = error_msgs;
1669 for(
const wxString& msg : warning_msgs )
1677 return error_msgs.GetCount() == 0;
1694 #define SELECTED_ITEMS_LAYER Dwgs_User
1701 static const std::vector<int> topLayers = {
1708 for(
int layer : topLayers )
1729 int maxXExtent = std::max( abs( bbox.
GetLeft() ), abs( bbox.
GetRight() ) );
1730 int maxYExtent = std::max( abs( bbox.
GetTop() ), abs( bbox.
GetBottom() ) );
1733 if( maxXExtent > INT_MAX / 4 )
1734 maxXExtent = INT_MAX / 4;
1736 if( maxYExtent > INT_MAX / 4 )
1737 maxYExtent = INT_MAX / 4;
1741 viewBox.
Inflate( maxXExtent * 1.4, maxYExtent * 1.4 );
1742 canvasBox.
Inflate( maxXExtent * 2.0, maxYExtent * 2.0 );
1757 if( !wxDialog::TransferDataToWindow() )
1774 if( !wxDialog::TransferDataFromWindow() )
1783 if( wxString error =
m_pasteMargin.Validate(); !error.IsEmpty() )
1786 wxSafeYield(
this );
1854 commit.
Push(
_(
"Edit Pad Properties" ) );
1929 wxCommandEvent
dummy;
1967 std::map<PCB_LAYER_ID, PCB_LAYER_ID> newLayerMap;
1984 newLayerMap[layer] =
F_Cu;
2072 pos -= fp->GetPosition();
2226 wxFAIL_MSG( wxT(
"DIALOG_PAD_PROPERTIES::transferDataToPad: unknown pad type" ) );
2258 switch( copperLayersChoice )
2285 switch( copperLayersChoice )
2288 case 1: padLayerMask.
set(
F_Cu );
break;
2289 case 2: padLayerMask.
set(
B_Cu );
break;
2297 switch( copperLayersChoice )
2299 case 0: padLayerMask.
set(
F_Cu );
break;
2300 case 1: padLayerMask.
set(
B_Cu );
break;
2306 if( copperLayersChoice >= 0 && copperLayersChoice <
static_cast<int>(
m_nonComponentLayers.size() ) )
2360 if( !canHaveDrills )
2372 bool wantTop = ( backDrillSel == 1 || backDrillSel == 3 );
2373 bool wantBottom = ( backDrillSel == 2 || backDrillSel == 3 );
2439 for(
const auto& [newLayer, initFromLayer] : newLayerMap )
2441 if( newLayer !=
m_editLayer && newLayer != initFromLayer )
2461 bool enableTop = ( selection == 1 || selection == 3 );
2462 bool enableBottom = ( selection == 2 || selection == 3 );
2473 if( aFromUserEvent )
2483 int drill = std::max(
m_holeX.GetIntValue(),
m_holeY.GetIntValue() );
2496 int drill = std::max(
m_holeX.GetIntValue(),
m_holeY.GetIntValue() );
2509 bool enable = ( selection != 0 );
2515 if( selection == 1 )
2524 else if( selection == 2 )
2538 bool enable = ( selection != 0 );
2544 if( selection == 1 )
2553 else if( selection == 2 )
2574 for(
size_t i = 0; i <
m_notebook->GetPageCount(); ++i )
constexpr EDA_IU_SCALE pcbIUScale
wxBitmapBundle KiBitmapBundle(BITMAPS aBitmap, int aMinHeight)
@ pads_remove_unused_keep_bottom
#define DEFAULT_PAD_DRILL_DIAMETER_MM
static bool hasBackdrill(const PADSTACK &aPadstack)
@ NORMAL
Inactive layers are shown normally (no high-contrast mode)
constexpr BOX2I KiROUND(const BOX2D &aBoxD)
BASE_SET & set(size_t pos)
void Push(const wxString &aMessage=wxEmptyString, int aCommitFlags=0) override
Execute the changes.
virtual bool SetNetCode(int aNetCode, bool aNoAssert)
Set net using a net code.
TEARDROP_PARAMETERS & GetTeardropParams()
FOOTPRINT * GetParentFootprint() const
constexpr BOX2< Vec > & Inflate(coord_type dx, coord_type dy)
Inflates the rectangle horizontally by dx and vertically by dy.
constexpr coord_type GetLeft() const
constexpr void Move(const Vec &aMoveVector)
Move the rectangle by the aMoveVector.
constexpr coord_type GetRight() const
constexpr const SizeVec & GetSize() const
constexpr coord_type GetTop() const
constexpr coord_type GetBottom() const
Color settings are a bit different than most of the settings objects in that there can be more than o...
COLOR4D GetColor(int aLayer) const
COMMIT & Modify(EDA_ITEM *aItem, BASE_SCREEN *aScreen=nullptr, RECURSE_MODE aRecurse=RECURSE_MODE::NO_RECURSE)
Modify a given item in the model.
wxStaticText * m_techLayersLabel
wxBoxSizer * m_padstackControls
wxTextCtrl * m_topPostMachineSize2
wxStaticText * m_staticTextInfoPaste
wxCheckBox * m_cbBottomLeft
wxStaticText * m_stTdMaxSize
wxCheckBox * m_cbBottomRight1
wxStaticBitmap * m_legacyTeardropsIcon
wxStaticText * m_padToDieUnits
wxStaticText * m_stLenPercentHint
wxTextCtrl * m_topPostmachineSize1
wxSpinCtrlDouble * m_spTeardropHDPercent
wxStaticText * m_sizeYUnits
wxStaticText * m_offsetXUnits
wxCheckBox * m_cbTeardrops
wxStaticText * m_posYLabel
wxStaticText * m_topPostMachineSize2Units
wxCheckBox * m_cbTopRight1
wxCheckBox * m_cbPreferZoneConnection
wxPanel * m_boardViewPanel
wxStaticBitmap * m_stackupImage1
wxStaticText * m_stMaxHeightUnits
wxStaticText * m_offsetShapeOptLabel
wxChoice * m_ZoneConnectionChoice
wxStaticText * m_spokeAngleUnits
wxStaticText * m_stMaxLen
wxStaticText * m_teardropShapeLabel
wxStaticBitmap * m_stackupImage2
wxTextCtrl * m_backDrillBottomSize
wxStaticText * m_trapDeltaLabel
wxFlexGridSizer * m_offsetCtrls
wxCheckBox * m_cbBottomLeft1
wxStaticText * m_stWidthPercentHint
wxTextCtrl * m_offsetYCtrl
wxSpinCtrlDouble * m_spTeardropSizePercent
wxStaticText * m_thermalGapLabel
wxStaticText * m_cornerRadiusUnits
wxCheckBox * m_layerBackSilk
wxStaticText * m_topPostMachineSize1Label
wxStaticText * m_mixedCornerRatioUnits
wxSimplebook * m_shapePropsBook
wxStaticText * m_chamferRatioUnits
wxStaticText * m_backDrillTopSizeLabel
PCB_LAYER_BOX_SELECTOR * m_backDrillBottomLayer
wxTextCtrl * m_bottomPostMachineSize2
wxStaticText * m_trapDeltaUnits
wxBoxSizer * m_LeftBoxSizer
wxStaticText * m_parentInfo
wxStaticText * m_bottomPostMachineSize2Label
wxCheckBox * m_layerFrontMask
wxStaticBitmap * m_stackupImage4
wxTextCtrl * m_clearanceCtrl
wxStaticText * m_padToDieDelayUnits
wxStaticText * m_sizeXUnits
wxStaticText * m_holeXUnits
wxStaticText * m_pasteMarginUnits
wxCheckBox * m_padToDieDelayOpt
wxStaticText * m_backDrillBottomSizeLabel
wxStaticText * m_spokeWidthLabel
wxGridBagSizer * m_gbSizerHole
wxTextCtrl * m_padToDieDelayCtrl
wxStaticText * m_offsetYLabel
wxChoice * m_PadShapeSelector
wxStaticText * m_holeYUnits
wxStaticText * m_maskMarginLabel
wxChoice * m_holeShapeCtrl
wxStaticText * m_padNumLabel
wxTextCtrl * m_offsetXCtrl
wxStaticText * m_holeYLabel
wxStaticText * m_backDrillBottomLayerLabel
TEXT_CTRL_EVAL * m_mixedCornerRatioCtrl
wxCheckBox * m_layerFrontAdhesive
wxCheckBox * m_layerBackMask
wxCheckBox * m_layerFrontPaste
wxCheckBox * m_layerBackAdhesive
wxChoice * m_ZoneCustomPadShape
wxSimplebook * m_stackupImagesBook
wxCheckBox * m_cbTeardropsUseNextTrack
wxStaticText * m_spokeWidthUnits
wxStaticText * m_offsetXLabel
wxCheckBox * m_cbTopRight
wxStaticText * m_clearanceLabel
wxCheckBox * m_layerFrontSilk
wxTextCtrl * m_thermalGapCtrl
wxStaticText * m_holeShapeLabel
PCB_LAYER_BOX_SELECTOR * m_backDrillTopLayer
wxCheckBox * m_padToDieOpt
wxStaticBitmap * m_stackupImage0
wxStaticText * m_nonCopperNote
NET_SELECTOR * m_padNetSelector
wxTextCtrl * m_spokeAngleCtrl
wxBoxSizer * m_FlippedWarningSizer
wxStaticText * m_spokeAngleLabel
wxTextCtrl * m_padNumCtrl
wxStaticBitmap * m_stackupImage7
wxTextCtrl * m_spokeWidthCtrl
wxTextCtrl * m_cornerRadiusCtrl
wxTextCtrl * m_backDrillTopSize
wxCheckBox * m_curvedEdges
wxBitmapButton * m_launchCalculatorBtn
wxCheckBox * m_cbBottomRight
wxChoice * m_trapAxisCtrl
wxStaticText * m_offsetYUnits
wxStaticText * m_minTrackWidthHint
wxStaticText * m_chamferRatioLabel
wxStaticBitmap * m_stackupImage6
wxStaticText * m_padToDieLabel
wxCheckBox * m_cbTopLeft1
wxStaticText * m_mixedCornerRatioLabel
TEXT_CTRL_EVAL * m_chamferRatioCtrl
wxStaticText * m_posXUnits
wxTextCtrl * m_pasteMarginCtrl
wxStaticText * m_mixedChamferRatioUnits
wxStaticBitmap * m_FlippedWarningIcon
wxTextCtrl * m_trapDeltaCtrl
wxCheckBox * m_layerUserDwgs
TEXT_CTRL_EVAL * m_mixedChamferRatioCtrl
wxStaticText * m_sizeYLabel
wxSpinCtrlDouble * m_spTeardropLenPercent
DIALOG_PAD_PROPERTIES_BASE(wxWindow *parent, wxWindowID id=wxID_DIALOG_EDIT_PAD, const wxString &title=_("Pad Properties"), const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxSize(-1,-1), long style=wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER)
wxChoice * m_backDrillChoice
wxStaticText * m_stMaxLenUnits
wxChoice * m_cbPadstackMode
wxStaticText * m_mixedChamferRatioLabel
wxStaticText * m_orientationUnits
wxStaticText * m_holeXLabel
wxChoice * m_simElectricalTypeCtrl
wxStaticText * m_backDrillTopSizeUnits
wxStaticBitmap * m_stackupImage5
wxStaticText * m_bottomPostMachineSize2Units
wxStaticText * m_posYUnits
wxComboBox * m_cb_padrotation
wxStaticText * m_topPostMachineSize1Units
wxStaticText * m_cornerRatioLabel
wxTextCtrl * m_tcMaxHeight
wxStaticText * m_bottomPostMachineSize1Label
wxStaticText * m_sizeXLabel
wxTextCtrl * m_bottomPostMachineSize1
wxStaticText * m_cornerRadiusLabel
wxBoxSizer * m_legacyTeardropsWarning
wxStaticText * m_padToDieDelayLabel
TEXT_CTRL_EVAL * m_cornerRatioCtrl
wxChoice * m_choiceFabProperty
wxCheckBox * m_offsetShapeOpt
wxStaticText * m_maskMarginUnits
wxStaticText * m_PadOrientText
wxStaticBitmap * m_nonCopperWarningIcon
wxBoxSizer * m_padPreviewSizer
wxStaticText * m_cornerRatioUnits
wxChoice * m_bottomPostMachining
wxStaticText * m_clearanceUnits
wxStaticText * m_posXLabel
wxStaticText * m_bottomPostMachineSize1Units
wxStaticLine * m_staticline71
wxCheckBox * m_cbShowPadOutline
wxStaticText * m_padNetLabel
wxChoice * m_topPostMachining
wxStaticBitmap * m_bitmapTeardrop
wxCheckBox * m_layerBackPaste
wxStaticText * m_topPostMachineSize2Label
wxStaticText * m_backDrillBottomSizeUnits
wxStaticText * m_backDrillTopLayerLabel
wxTextCtrl * m_padToDieCtrl
wxSimplebook * m_nonCopperWarningBook
wxChoice * m_rbCopperLayersSel
wxPanel * m_localSettingsPanel
wxStaticText * m_pasteMarginLabel
wxTextCtrl * m_maskMarginCtrl
wxStaticText * m_thermalGapUnits
wxTextCtrl * m_tcTdMaxLen
void OnUpdateUINonCopperWarning(wxUpdateUIEvent &event) override
void OnInitDialog(wxInitDialogEvent &event) override
void PadTypeSelected(wxCommandEvent &event) override
void OnPadToDieDelayCheckbox(wxCommandEvent &event) override
void OnPadShapeSelection(wxCommandEvent &event) override
UNIT_BINDER m_teardropMaxHeightSetting
UNIT_BINDER m_bottomPostMachineSize2Binder
bool transferDataToPad(PAD *aPad)
Copy values from dialog field to aPad's members.
bool TransferDataFromWindow() override
Updates the different parameters for the component being edited.
std::map< int, PCB_LAYER_ID > m_editLayerCtrlMap
bool Show(bool aShow) override
void OnHoleSizeCalculator(wxCommandEvent &event) override
void updateHoleControls()
void OnEditLayerChanged(wxCommandEvent &event) override
std::vector< std::shared_ptr< PCB_SHAPE > > m_primitives
UNIT_BINDER m_padToDieDelay
UNIT_BINDER m_teardropMaxLenSetting
double getMaxChamferRatio() const
bool padValuesOK()
test if all values are acceptable for the pad
void PadOrientEvent(wxCommandEvent &event) override
bool TransferDataToWindow() override
void OnResize(wxSizeEvent &event)
void OnElectricalTypeChaged(wxCommandEvent &event) override
UNIT_BINDER m_topPostMachineSize2Binder
void onPadShapeSelection(bool aUpdateSpokeAngle)
PCB_BASE_FRAME * m_parent
UNIT_BINDER m_mixedCornerRatio
void OnOffsetCheckbox(wxCommandEvent &event) override
PCB_DRAW_PANEL_GAL * m_padPreviewGAL
void OnValuesChanged(wxCommandEvent &event) override
Called when a dimension has changed.
void updateRoundRectCornerValues()
void initPadstackLayerValues()
void updatePadLayersList(std::optional< LSET > layer_mask, bool remove_unconnected, bool keep_top_bottom)
Updates the CheckBox states in pad layers list.
void onBottomPostMachining(wxCommandEvent &event) override
void onTeardropsUpdateUi(wxUpdateUIEvent &event) override
void UpdateLayersDropdown()
std::vector< PCB_SHAPE * > m_highlight
UNIT_BINDER m_bottomPostMachineSize1Binder
~DIALOG_PAD_PROPERTIES() override
std::vector< PCB_LAYER_ID > m_nonComponentLayers
Enabled copper layers offered for NON_COMPONENT pads.
void syncBackdrillControls(bool aFromUserEvent)
void updateAllowedPadChamferCorners()
void OnPadstackModeChanged(wxCommandEvent &event) override
void afterPadstackModeChanged()
void onChangePadDrawMode(wxCommandEvent &event) override
KIGFX::ORIGIN_VIEWITEM * m_axisOrigin
UNIT_BINDER m_mixedChamferRatio
UNIT_BINDER m_cornerRadius
void OnSetCopperLayers(wxCommandEvent &event) override
void onBackDrillChoice(wxCommandEvent &event) override
double getMaxCornerRadius() const
void OnCancel(wxCommandEvent &event) override
void onCornerRadiusChange(wxCommandEvent &event) override
PAD_PROP getSelectedProperty()
Return the pad property currently selected.
void OnSetLayers(wxCommandEvent &event) override
void updatePadSizeControls()
void onCornerSizePercentChange(wxCommandEvent &event) override
MARGIN_OFFSET_BINDER m_pasteMargin
UNIT_BINDER m_pad_orientation
UNIT_BINDER m_backDrillTopSizeBinder
void OnPadToDieCheckbox(wxCommandEvent &event) override
void onTopPostMachining(wxCommandEvent &event) override
UNIT_BINDER m_backDrillBottomSizeBinder
static bool m_sketchPreview
void OnDrillShapeSelected(wxCommandEvent &event) override
DIALOG_PAD_PROPERTIES(PCB_BASE_FRAME *aParent, PAD &aPad)
void OnUpdateUI(wxUpdateUIEvent &event) override
UNIT_BINDER m_cornerRatio
UNIT_BINDER m_topPostMachineSize1Binder
void onModify(wxCommandEvent &aEvent) override
UNIT_BINDER m_chamferRatio
bool Show(bool show) override
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 resetSize()
Clear the existing dialog size and position.
void finishDialogSettings()
In all dialogs, we must call the same functions to fix minimal dlg size, the default position and per...
EDA_BASE_FRAME * m_parentFrame
FRAME_T GetFrameType() const
void ListSet(const wxString &aList)
Add a list of items.
A color representation with 4 components: red, green, blue, alpha.
bool m_forceDisplayCursor
Force cursor display.
void SetAxesEnabled(bool aAxesEnabled)
Enable drawing the axes.
void SetGridSize(const VECTOR2D &aGridSize)
Set the grid size.
void SetGridVisibility(bool aVisibility)
Set the visibility setting of the grid.
Contains methods for drawing PCB-specific items.
virtual PCB_RENDER_SETTINGS * GetSettings() override
Return a pointer to current settings that are going to be used when drawing items.
PCB specific render settings.
bool m_ForcePadSketchModeOn
void SetLayerColor(int aLayer, const COLOR4D &aColor)
Change the color used to draw a layer.
An interface for classes handling user events controlling the view behavior such as zooming,...
const VC_SETTINGS & GetSettings() const
Return the current VIEW_CONTROLS settings.
Hold a (potentially large) number of VIEW_ITEMs and renders them on a graphics device provided by the...
void SetViewport(const BOX2D &aViewport)
Set the visible area of the VIEW.
virtual void Add(VIEW_ITEM *aItem, int aDrawPriority=-1)
Add a VIEW_ITEM to the view.
void SetBoundary(const BOX2D &aBoundary)
Set limits for view area.
virtual void Update(const VIEW_ITEM *aItem, int aUpdateFlags) const
For dynamic VIEWs, inform the associated VIEW that the graphical representation of this item has chan...
void SetLayerVisible(int aLayer, bool aVisible=true)
Control the visibility of a particular layer.
GAL * GetGAL() const
Return the GAL this view is using to draw graphical primitives.
void ClearTopLayers()
Remove all layers from the on-the-top set (they are no longer displayed over the rest of layers).
virtual void SetTopLayer(int aLayer, bool aEnabled=true)
Set given layer to be displayed on the top or sets back the default order of layers.
PAINTER * GetPainter() const
Return the painter object used by the view for drawing VIEW_ITEM objects.
KIWAY & Kiway() const
Return a reference to the KIWAY that this object has an opportunity to participate in.
A wxFrame capable of the OpenProjectFiles function, meaning it can load a portion of a KiCad project.
A minimalistic software bus for communications between various DLLs/DSOs (DSOs) within the same KiCad...
virtual KIWAY_PLAYER * Player(FRAME_T aFrameType, bool doCreate=true, wxTopLevelWindow *aParent=nullptr)
Return the KIWAY_PLAYER* given a FRAME_T.
virtual void ExpressMail(FRAME_T aDestination, MAIL_T aCommand, std::string &aPayload, wxWindow *aSource=nullptr, bool aFromOtherThread=false)
Send aPayload to aDestination from aSource.
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.
LSEQ CuStack() const
Return a sequence of copper layers in starting from the front/top and extending to the back/bottom.
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.
static const int UNCONNECTED
Constant that holds the "unconnected net" number (typically 0) all items "connected" to this net are ...
A PADSTACK defines the characteristics of a single or multi-layer pad, in the IPC sense of the word.
void SetBackdrillSize(bool aTop, std::optional< int > aSize)
void ForEachUniqueLayer(const std::function< void(PCB_LAYER_ID)> &aMethod) const
Runs the given callable for each active unique copper layer in this padstack, meaning F_Cu for MODE::...
void SetUnconnectedLayerMode(UNCONNECTED_LAYER_MODE aMode)
bool HasExplicitDefinitionForLayer(PCB_LAYER_ID aLayer) const
Check if the padstack has an explicit definition for the given layer.
COPPER_LAYER_PROPS & CopperLayer(PCB_LAYER_ID aLayer)
POST_MACHINING_PROPS & FrontPostMachining()
void SetBackdrillEndLayer(bool aTop, PCB_LAYER_ID aLayer)
std::optional< int > GetBackdrillSize(bool aTop) const
MODE
! Copper geometry mode: controls how many unique copper layer shapes this padstack has
@ NORMAL
Shape is the same on all layers.
@ CUSTOM
Shapes can be defined on arbitrary layers.
@ FRONT_INNER_BACK
Up to three shapes can be defined (F_Cu, inner copper layers, B_Cu)
PCB_LAYER_ID GetBackdrillEndLayer(bool aTop) const
POST_MACHINING_PROPS & BackPostMachining()
static constexpr PCB_LAYER_ID INNER_LAYERS
! The layer identifier to use for "inner layers" on top/inner/bottom padstacks
void SetAnchorPadShape(PCB_LAYER_ID aLayer, PAD_SHAPE aShape)
Set the shape of the anchor pad for custom shaped pads.
void SetAttribute(PAD_ATTRIB aAttribute)
void SetLocalThermalGapOverride(const std::optional< int > &aOverride)
PAD_ATTRIB GetAttribute() const
static LSET PTHMask()
layer set for a through hole pad
void SetThermalSpokeAngle(const EDA_ANGLE &aAngle)
The orientation of the thermal spokes.
void SetSimElectricalType(PAD_SIM_ELECTRICAL_TYPE aType)
void SetLocalSolderPasteMarginRatio(std::optional< double > aRatio)
void SetLocalThermalSpokeWidthOverride(std::optional< int > aWidth)
Set the width of the thermal spokes connecting the pad to a zone.
void SetShape(PCB_LAYER_ID aLayer, PAD_SHAPE aShape)
Set the new shape of this pad.
void SetProperty(PAD_PROP aProperty)
static LSET UnplatedHoleMask()
layer set for a mechanical unplated through hole pad
void SetDelta(PCB_LAYER_ID aLayer, const VECTOR2I &aSize)
void SetPadToDieDelay(int aDelay)
PAD_SHAPE GetShape(PCB_LAYER_ID aLayer) const
void SetNumber(const wxString &aNumber)
Set the pad number (note that it can be alphanumeric, such as the array reference "AA12").
void SetDrillShape(PAD_DRILL_SHAPE aShape)
void SetLocalSolderMaskMargin(std::optional< int > aMargin)
void SetOffset(PCB_LAYER_ID aLayer, const VECTOR2I &aOffset)
void SetCustomShapeInZoneOpt(CUSTOM_SHAPE_ZONE_MODE aOption)
Set the option for the custom pad shape to use as clearance area in copper zones.
void SetLocalZoneConnection(ZONE_CONNECTION aType)
void SetChamferRectRatio(PCB_LAYER_ID aLayer, double aChamferScale)
Has meaning only for chamfered rectangular pads.
VECTOR2I GetSize(PCB_LAYER_ID aLayer) const
void SetPosition(const VECTOR2I &aPos) override
const PADSTACK & Padstack() const
static LSET ConnSMDMask()
layer set for a SMD pad on Front layer used for edge board connectors
void SetDrillSize(const VECTOR2I &aSize)
void SetSize(PCB_LAYER_ID aLayer, const VECTOR2I &aSize)
void ReplacePrimitives(PCB_LAYER_ID aLayer, const std::vector< std::shared_ptr< PCB_SHAPE > > &aPrimitivesList)
Clear the current custom shape primitives list and import a new list.
static LSET ApertureMask()
layer set for an aperture pad
static LSET SMDMask()
layer set for a SMD pad on Front layer
void SetChamferPositions(PCB_LAYER_ID aLayer, int aPositions)
Has meaning only for chamfered rectangular pads.
void SetLocalSolderPasteMargin(std::optional< int > aMargin)
void SetOrientation(const EDA_ANGLE &aAngle)
Set the rotation angle of the pad.
void SetLocalClearance(std::optional< int > aClearance)
void SetLayerSet(const LSET &aLayers) override
PAD_SHAPE GetAnchorPadShape(PCB_LAYER_ID aLayer) const
void SetRoundRectRadiusRatio(PCB_LAYER_ID aLayer, double aRadiusScale)
Has meaning only for rounded rectangle pads.
void SetPadToDieLength(int aLength)
Base PCB main window class for Pcbnew, Gerbview, and CvPcb footprint viewer.
void ShowPadPropertiesDialog(PAD &aPad)
Class to display a pcb layer list in a wxBitmapComboBox.
double m_BestWidthRatio
The height of a teardrop as ratio between height and size of pad/via.
int m_TdMaxLen
max allowed length for teardrops in IU. <= 0 to disable
bool m_AllowUseTwoTracks
True to create teardrops using 2 track segments if the first in too small.
int m_TdMaxWidth
max allowed height for teardrops in IU. <= 0 to disable
double m_BestLengthRatio
The length of a teardrop as ratio between length and size of pad/via.
double m_WidthtoSizeFilterRatio
The ratio (H/D) between the via/pad size and the track width max value to create a teardrop 1....
bool m_TdOnPadsInZones
A filter to exclude pads inside zone fills.
bool m_Enabled
Flag to enable teardrops.
bool m_CurvedEdges
True if the teardrop should be curved.
A type-safe container of any type.
void DisplayError(wxWindow *aParent, const wxString &aText)
Display an error or warning message box with aMessage.
This file is part of the common library.
@ RECT_CHAMFER_BOTTOM_RIGHT
@ RECT_CHAMFER_BOTTOM_LEFT
#define APERTURE_DLG_TYPE
static PAD_ATTRIB code_type[]
#define SELECTED_ITEMS_LAYER
static PAD_SHAPE code_shape[]
static void showCalculatorPage(KIWAY_PLAYER &aHolder, std::string &aPayload)
#define NON_COMPONENT_DLG_TYPE
@ CHOICE_SHAPE_CUSTOM_RECT_ANCHOR
@ CHOICE_SHAPE_CHAMFERED_RECT
@ CHOICE_SHAPE_CUSTOM_CIRC_ANCHOR
@ CHOICE_SHAPE_CHAMFERED_ROUNDED_RECT
#define PAD_PROPERTIES_DLG_NAME
DIALOG_PAD_PROPERTIES, derived from DIALOG_PAD_PROPERTIES_BASE, created by wxFormBuilder.
int ConvertPadCheckToDrcCode(PAD_UTILS::PAD_CHECK_CODE aCode)
Map a granular PAD_UTILS::PAD_CHECK_CODE to the DRC error code used to report it at the DRC level (in...
@ DRCE_PAD_TH_WITH_NO_HOLE
static constexpr EDA_ANGLE ANGLE_90
static constexpr EDA_ANGLE ANGLE_45
#define BRIGHTENED
item is drawn with a bright contour
#define SELECTED
Item was manually selected by the user.
@ LAYER_LOCKED_ITEM_SHADOW
Shadow layer for locked items.
@ LAYER_NON_PLATEDHOLES
Draw usual through hole vias.
@ LAYER_PAD_PLATEDHOLES
to draw pad holes (plated)
bool IsInnerCopperLayer(int aLayerId)
Test whether a layer is an inner (In1_Cu to In30_Cu) copper layer.
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.
@ TOP_BOTTOM
Flip top to bottom (around the X axis)
KICOMMON_API wxString GetLabel(EDA_UNITS aUnits, EDA_DATA_TYPE aType=EDA_DATA_TYPE::DISTANCE)
Get the units string for a given units type.
KICOMMON_API wxFont GetStatusFont(wxWindow *aWindow)
KICOMMON_API wxFont GetSmallInfoFont(wxWindow *aWindow)
bool PadHasMeaningfulRoundingRadius(const PAD &aPad, PCB_LAYER_ID aLayer)
Returns true if the pad's rounding ratio is valid (i.e.
void RemoveAllDrillsFromPadstack(PADSTACK &aPadstack)
Remove the primary drill, the secondary and tertiary drills, and any post-machining operations from a...
double GetDefaultIpcRoundingRatio(const PAD &aPad, PCB_LAYER_ID aLayer)
Get a sensible default for a rounded rectangle pad's rounding ratio.
void CheckPad(const PAD &aPad, const UNITS_PROVIDER &aUnitsProvider, bool aForPadProperties, const PAD_CHECK_HANDLER &aErrorHandler)
Run non-board-specific checks on a pad.
PAD_ATTRIB
The set of pad shapes, used with PAD::{Set,Get}Attribute().
@ NPTH
like PAD_PTH, but not plated mechanical use only, no connection allowed
@ NON_COMPONENT
Pad with no hole that does not connect to a physical component, but rather provides a connection poin...
@ SMD
Smd pad, appears on the solder paste layer (default)
@ PTH
Plated through hole pad.
@ CONN
Like smd, does not appear on the solder paste layer (default) Note: also has a special attribute in G...
PAD_SHAPE
The set of pad shapes, used with PAD::{Set,Get}Shape()
PAD_PROP
The set of pad properties used in Gerber files (Draw files, and P&P files) to define some properties ...
@ FIDUCIAL_LOCAL
a fiducial (usually a smd) local to the parent footprint
@ FIDUCIAL_GLBL
a fiducial (usually a smd) for the full board
@ MECHANICAL
a pad used for mechanical support
@ PRESSFIT
a PTH with a hole diameter with tight tolerances for press fit pin
@ HEATSINK
a pad used as heat sink, usually in SMD footprints
@ NONE
no special fabrication property
@ TESTPOINT
a test point pad
@ CASTELLATED
a pad with a castellated through hole
@ BGA
Smd pad, used in BGA footprints.
@ REMOVE_EXCEPT_START_AND_END
std::vector< FAB_LAYER_COLOR > dummy
std::optional< PAD_DRILL_POST_MACHINING_MODE > mode
A single finding from CheckPad().
void RotatePoint(int *pX, int *pY, const EDA_ANGLE &aAngle)
Calculate the new point of coord coord pX, pY, for a rotation center 0, 0.
int FindNotebookPage(wxNotebook *aNotebook, wxWindow *aChildWindow)
VECTOR2< int32_t > VECTOR2I
VECTOR2< double > VECTOR2D
@ THERMAL
Use thermal relief for pads.
@ NONE
Pads are not covered.
@ FULL
pads are covered by copper