KiCad PCB EDA Suite
MODULE_DESC Struct Reference

Public Member Functions

 MODULE_DESC ()
 

Detailed Description

Definition at line 1705 of file class_module.cpp.

Constructor & Destructor Documentation

◆ MODULE_DESC()

MODULE_DESC::MODULE_DESC ( )
inline

Definition at line 1707 of file class_module.cpp.

1708  {
1710 
1711  if( layerEnum.Choices().GetCount() == 0 )
1712  {
1713  layerEnum.Undefined( UNDEFINED_LAYER );
1714 
1715  for( LSEQ seq = LSET::AllLayersMask().Seq(); seq; ++seq )
1716  layerEnum.Map( *seq, LSET::Name( *seq ) );
1717  }
1718 
1719  wxPGChoices fpLayers; // footprints might be placed only on F.Cu & B.Cu
1720  fpLayers.Add( LSET::Name( F_Cu ), F_Cu );
1721  fpLayers.Add( LSET::Name( B_Cu ), B_Cu );
1722 
1724  REGISTER_TYPE( MODULE );
1729 
1730  auto layer = new PROPERTY_ENUM<MODULE, PCB_LAYER_ID, BOARD_ITEM>( _( "Layer" ),
1732  layer->SetChoices( fpLayers );
1733  propMgr.ReplaceProperty( TYPE_HASH( BOARD_ITEM ), _( "Layer" ), layer );
1734 
1735  propMgr.AddProperty( new PROPERTY<MODULE, wxString>( _( "Reference" ),
1737  propMgr.AddProperty( new PROPERTY<MODULE, wxString>( _( "Value" ),
1739  propMgr.AddProperty( new PROPERTY<MODULE, double>( _( "Orientation" ),
1742  propMgr.AddProperty( new PROPERTY<MODULE, int>( _( "Local Clearance" ),
1745  propMgr.AddProperty( new PROPERTY<MODULE, int>( _( "Local Solderpaste Margin" ),
1748  propMgr.AddProperty( new PROPERTY<MODULE, double>( _( "Local Solderpaste Margin Ratio" ),
1750  propMgr.AddProperty( new PROPERTY<MODULE, int>( _( "Thermal Width" ),
1753  propMgr.AddProperty( new PROPERTY<MODULE, int>( _( "Thermal Gap" ),
1756  // TODO zone connection, FPID?
1757  }
Display value expressed in degrees.
Definition: property.h:48
static PROPERTY_MANAGER & Instance()
Definition: property_mgr.h:61
#define TYPE_HASH(x)
Macro to generate unique identifier for a type
Definition: property.h:53
void SetThermalGap(int aGap)
Definition: class_module.h:266
void SetLocalClearance(int aClearance)
Definition: class_module.h:244
virtual void SetLayer(PCB_LAYER_ID aLayer)
Function SetLayer sets the layer this item is on.
BOARD_ITEM is a base class for any item which can be embedded within the BOARD container class,...
ENUM_MAP & Undefined(T aValue)
Definition: property.h:531
const wxString GetValue() const
Function GetValue.
Definition: class_module.h:476
static ENUM_MAP< T > & Instance()
Definition: property.h:517
void SetOrientationDegrees(double aOrientation)
Definition: class_module.h:223
wxPGChoices & Choices()
Definition: property.h:557
void SetLocalSolderPasteMarginRatio(double aRatio)
Definition: class_module.h:258
#define REGISTER_TYPE(x)
Helper macro to map type hashes to names
Definition: property_mgr.h:244
const wxString GetReference() const
Function GetReference.
Definition: class_module.h:451
Display value expressed in distance units (mm/inch)
Definition: property.h:47
int GetLocalClearance() const
Definition: class_module.h:243
static const wxChar * Name(PCB_LAYER_ID aLayerId)
Function Name returns the fixed name association with aLayerId.
Definition: lset.cpp:81
void InheritsAfter(TYPE_ID aDerived, TYPE_ID aBase)
Declares an inheritance relationship between types.
void SetThermalWidth(int aWidth)
Definition: class_module.h:263
double GetOrientationDegrees() const
Definition: class_module.h:225
static LSET AllLayersMask()
Definition: lset.cpp:756
void SetReference(const wxString &aReference)
Function SetReference.
Definition: class_module.h:461
LSEQ is a sequence (and therefore also a set) of PCB_LAYER_IDs.
int GetLocalSolderPasteMargin() const
Definition: class_module.h:254
void SetLocalSolderPasteMargin(int aMargin)
Definition: class_module.h:255
double GetLocalSolderPasteMarginRatio() const
Definition: class_module.h:257
#define _(s)
Definition: 3d_actions.cpp:33
void AddTypeCast(TYPE_CAST_BASE *aCast)
Registers a type converter.
void AddProperty(PROPERTY_BASE *aProperty)
Registers a property.
void SetValue(const wxString &aValue)
Function SetValue.
Definition: class_module.h:485
void ReplaceProperty(size_t aBase, const wxString &aName, PROPERTY_BASE *aNew)
Replaces an existing property for a specific type.
Provides class metadata.
Definition: property_mgr.h:58
Abstract interface for BOARD_ITEMs capable of storing other items inside.
ENUM_MAP & Map(T aValue, const wxString &aName)
Definition: property.h:523
int GetThermalWidth() const
Definition: class_module.h:264
virtual PCB_LAYER_ID GetLayer() const
Function GetLayer returns the primary layer this item is on.
int GetThermalGap() const
Definition: class_module.h:267

References _, PROPERTY_MANAGER::AddProperty(), PROPERTY_MANAGER::AddTypeCast(), LSET::AllLayersMask(), B_Cu, ENUM_MAP< T >::Choices(), DEGREE, DISTANCE, F_Cu, BOARD_ITEM::GetLayer(), MODULE::GetLocalClearance(), MODULE::GetLocalSolderPasteMargin(), MODULE::GetLocalSolderPasteMarginRatio(), MODULE::GetOrientationDegrees(), MODULE::GetReference(), MODULE::GetThermalGap(), MODULE::GetThermalWidth(), MODULE::GetValue(), PROPERTY_MANAGER::InheritsAfter(), PROPERTY_MANAGER::Instance(), ENUM_MAP< T >::Instance(), ENUM_MAP< T >::Map(), LSET::Name(), REGISTER_TYPE, PROPERTY_MANAGER::ReplaceProperty(), BOARD_ITEM::SetLayer(), MODULE::SetLocalClearance(), MODULE::SetLocalSolderPasteMargin(), MODULE::SetLocalSolderPasteMarginRatio(), MODULE::SetOrientationDegrees(), MODULE::SetReference(), MODULE::SetThermalGap(), MODULE::SetThermalWidth(), MODULE::SetValue(), TYPE_HASH, ENUM_MAP< T >::Undefined(), and UNDEFINED_LAYER.


The documentation for this struct was generated from the following file: