36#include <api/board/board_types.pb.h>
38using namespace std::placeholders;
54 board->InvalidateClearanceCache(
m_Uuid );
62 wxString
name = wxString::FromUTF8( aProto.name() );
94 if( ( aNetCode >= 0 ) && board )
134 static std::shared_ptr<NETCLASS> fallbackNetclass = std::make_shared<NETCLASS>(
NETCLASS::Default );
141 if( board->GetDesignSettings().m_NetSettings )
142 return board->GetDesignSettings().m_NetSettings->GetDefaultNetclass().get();
145 return fallbackNetclass.get();
164 return wxT(
"[** NO BOARD DEFINED **]" );
168 if( !netname.length() )
169 return wxT(
"[<no net>]" );
171 return wxT(
"[" ) +
UnescapeString( netname ) + wxT(
"](" ) +
_(
"Not Found" ) + wxT(
")" );
194 if( board->GetNetInfo().m_DisplayNetnamesDirty )
195 board->GetNetInfo().RebuildDisplayNetnames();
208 if( layerEnum.
Choices().GetCount() == 0 )
225 layer->SetChoices( layerEnum.
Choices() );
262 auto supportsTeardrops =
267 if( !bci->GetBoard() || bci->GetBoard()->LegacyTeardrops() )
276 auto supportsTeardropPreferZoneSetting =
281 if( !bci->GetBoard() || bci->GetBoard()->LegacyTeardrops() )
290 const wxString groupTeardrops =
_HKI(
"Teardrops" );
295 enableTeardrops->SetAvailableFunc( supportsTeardrops );
296 propMgr.
AddProperty( enableTeardrops, groupTeardrops );
301 bestLength->SetAvailableFunc( supportsTeardrops );
308 maxLength->SetAvailableFunc( supportsTeardrops );
314 bestWidth->SetAvailableFunc( supportsTeardrops );
321 maxWidth->SetAvailableFunc( supportsTeardrops );
327 curvePts->SetAvailableFunc( supportsTeardrops );
333 preferZones->SetAvailableFunc( supportsTeardropPreferZoneSetting );
334 propMgr.
AddProperty( preferZones, groupTeardrops );
339 twoTracks->SetAvailableFunc( supportsTeardrops );
345 maxTrackWidth->SetAvailableFunc( supportsTeardrops );
346 propMgr.
AddProperty( maxTrackWidth, groupTeardrops );
static struct BOARD_CONNECTED_ITEM_DESC _BOARD_CONNECTED_ITEM_DESC
A base class derived from BOARD_ITEM for items that can be connected and have a net,...
wxString GetNetnameMsg() const
bool GetTeardropPreferZoneConnections() const
virtual NETCLASS * GetEffectiveNetClass() const
Return the NETCLASS for this item.
double GetTeardropBestLengthRatio() const
bool SetNetCode(int aNetCode, bool aNoAssert)
Set net using a net code.
void SetTeardropBestWidthRatio(double aRatio)
wxString GetNetname() const
void SetTeardropMaxTrackWidth(double aRatio)
int GetTeardropMaxLength() const
PCB_LAYER_ID GetLayer() const override
Return the primary layer this item is on.
BOARD_CONNECTED_ITEM(BOARD_ITEM *aParent, KICAD_T idtype)
void PackNet(kiapi::board::types::Net *aProto) const
double GetTeardropMaxTrackWidth() const
bool GetTeardropsEnabled() const
void SetLayer(PCB_LAYER_ID aLayer) override
Set the layer this item is on.
bool GetTeardropCurved() const
void SetTeardropAllowSpanTwoTracks(bool aAllow)
const wxString & GetDisplayNetname() const
const wxString & GetShortNetname() const
double GetTeardropBestWidthRatio() const
wxString GetNetClassName() const
Returns the name of the effective netclass.
void SetTeardropCurved(bool aCurve)
NETINFO_ITEM * m_netinfo
Store all information about the net that item belongs to.
virtual int GetOwnClearance(PCB_LAYER_ID aLayer, wxString *aSource=nullptr) const
Return an item's "own" clearance in internal units.
void SetTeardropMaxWidth(int aMaxWidth)
int GetTeardropMaxWidth() const
void SetTeardropPreferZoneConnections(bool aPrefer)
void SetTeardropBestLengthRatio(double aRatio)
void SetTeardropMaxLength(int aMaxLength)
void UnpackNet(const kiapi::board::types::Net &aProto)
Assigns a net to this item from an API message.
bool GetTeardropAllowSpanTwoTracks() const
bool m_localRatsnestVisible
void SetTeardropsEnabled(bool aEnable)
Container for design settings for a BOARD object.
std::shared_ptr< DRC_ENGINE > m_DRCEngine
A base class for any item which can be embedded within the BOARD container class, and therefore insta...
BOARD_ITEM(BOARD_ITEM *aParent, KICAD_T idtype, PCB_LAYER_ID aLayer=F_Cu)
virtual void SetLayer(PCB_LAYER_ID aLayer)
Set the layer this item is on.
virtual const BOARD * GetBoard() const
Return the BOARD in which this BOARD_ITEM resides, or NULL if none.
virtual bool IsOnCopperLayer() const
Information pertinent to a Pcbnew printed circuit board.
NETINFO_ITEM * FindNet(int aNetcode) const
Search for a net with the given netcode.
void InvalidateClearanceCache(const KIID &aUuid)
Invalidate the clearance cache for a specific item.
BOARD_DESIGN_SETTINGS & GetDesignSettings() const
int GetCachedOwnClearance(const BOARD_ITEM *aItem, PCB_LAYER_ID aLayer, wxString *aSource=nullptr)
Get the cached own clearance for an item on a specific layer.
ENUM_MAP & Map(T aValue, const wxString &aName)
static ENUM_MAP< T > & Instance()
ENUM_MAP & Undefined(T aValue)
Class that other classes need to inherit from, in order to be inspectable.
static const LSET & AllLayersMask()
static wxString Name(PCB_LAYER_ID aLayerId)
Return the fixed name association with aLayerId.
A collection of nets and the parameters used to route or test these nets.
static const char Default[]
the name of the default NETCLASS
const wxString GetName() const
Gets the name of this (maybe aggregate) netclass in a format for internal usage or for export to exte...
Handle the data for a net.
Container for NETINFO_ITEM elements, which are the nets.
static NETINFO_ITEM * OrphanedItem()
NETINFO_ITEM meaning that there was no net assigned for an item, as there was no board storing net li...
PROPERTY_BASE & SetIsHiddenFromPropertiesManager(bool aHide=true)
PROPERTY_BASE & SetIsHiddenFromRulesEditor(bool aHide=true)
PROPERTY_BASE & SetIsHiddenFromLibraryEditors(bool aIsHidden=true)
Provide class metadata.Helper macro to map type hashes to names.
void InheritsAfter(TYPE_ID aDerived, TYPE_ID aBase)
Declare an inheritance relationship between types.
static PROPERTY_MANAGER & Instance()
PROPERTY_BASE & AddProperty(PROPERTY_BASE *aProperty, const wxString &aGroup=wxEmptyString)
Register a property.
PROPERTY_BASE & ReplaceProperty(size_t aBase, const wxString &aName, PROPERTY_BASE *aNew, const wxString &aGroup=wxEmptyString)
Replace an existing property for a specific type.
static VALIDATOR_RESULT PositiveRatioValidator(const wxAny &&aValue, EDA_ITEM *aItem)
Some functions to handle hotkeys in KiCad.
PCB_LAYER_ID
A quick note on layer IDs:
#define NO_SETTER(owner, type)
@ PT_SIZE
Size expressed in distance units (mm/inch)
@ PT_NET
Net selection property.
static const char * emptyString
wxString UnescapeString(const wxString &aSource)
BOARD_CONNECTED_ITEM_DESC()
KICAD_T
The set of class identification values stored in EDA_ITEM::m_structType.
@ PCB_VIA_T
class PCB_VIA, a via (like a track segment on a copper layer)
@ PCB_PAD_T
class PAD, a pad in a footprint