KiCad PCB EDA Suite
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages Concepts
COMPONENT_CLASS_ASSIGNMENT_DATA Class Reference

#include <component_class_settings.h>

Public Types

enum class  CONDITION_TYPE {
  REFERENCE , FOOTPRINT , SIDE , ROTATION ,
  FOOTPRINT_FIELD , CUSTOM , SHEET_NAME
}
 A condition match type. More...
 
enum class  CONDITIONS_OPERATOR { ALL , ANY }
 Whether conditions are applied with OR or AND logic. More...
 

Public Member Functions

void SetCondition (const CONDITION_TYPE aCondition, const wxString &aPrimaryData, const wxString &aSecondaryData)
 Sets the given condition type with the assocated match data.
 
const std::unordered_map< CONDITION_TYPE, std::pair< wxString, wxString > > & GetConditions () const
 Gets all conditions.
 
void SetComponentClass (const wxString &aComponentClass)
 Sets the resulting component class for matching footprints.
 
const wxString & GetComponentClass () const
 Gets the resulting component class for matching footprints.
 
void SetConditionsOperation (const CONDITIONS_OPERATOR aOperator)
 Sets the boolean operation in use for all conditions.
 
CONDITIONS_OPERATOR GetConditionsOperator () const
 Gets the boolean operation in use for all conditions.
 
wxString GetAssignmentInDRCLanguage () const
 Returns the DRC rules language for this component class assignment.
 

Static Public Member Functions

static wxString GetConditionName (const CONDITION_TYPE aCondition)
 Maps a CONDITION_TYPE to a descriptive string.
 
static CONDITION_TYPE GetConditionType (const wxString &aCondition)
 Maps a descriptive string to a CONDITION_TYPE.
 

Protected Attributes

wxString m_componentClass
 The name of the component class for this assignment rule.
 
std::unordered_map< CONDITION_TYPE, std::pair< wxString, wxString > > m_conditions
 Map of condition types to primary and secondary data fields for the condition.
 
CONDITIONS_OPERATOR m_conditionsOperator { CONDITIONS_OPERATOR::ALL }
 Whether conditions are applied with AND or OR logic Defaults to ALL.
 

Detailed Description

Definition at line 29 of file component_class_settings.h.

Member Enumeration Documentation

◆ CONDITION_TYPE

A condition match type.

Enumerator
REFERENCE 
FOOTPRINT 
SIDE 
ROTATION 
FOOTPRINT_FIELD 
CUSTOM 
SHEET_NAME 

Definition at line 33 of file component_class_settings.h.

◆ CONDITIONS_OPERATOR

Whether conditions are applied with OR or AND logic.

Enumerator
ALL 
ANY 

Definition at line 45 of file component_class_settings.h.

Member Function Documentation

◆ GetAssignmentInDRCLanguage()

wxString COMPONENT_CLASS_ASSIGNMENT_DATA::GetAssignmentInDRCLanguage ( ) const

Returns the DRC rules language for this component class assignment.

Definition at line 234 of file component_class_settings.cpp.

References ALL, CUSTOM, dummy, FOOTPRINT, FOOTPRINT_FIELD, m_componentClass, m_conditions, m_conditionsOperator, REFERENCE, ROTATION, SHEET_NAME, and SIDE.

Referenced by COMPONENT_CLASS_MANAGER::CompileAssignmentRule().

◆ GetComponentClass()

const wxString & COMPONENT_CLASS_ASSIGNMENT_DATA::GetComponentClass ( ) const
inline

Gets the resulting component class for matching footprints.

Definition at line 71 of file component_class_settings.h.

Referenced by COMPONENT_CLASS_SETTINGS::saveAssignment().

◆ GetConditionName()

wxString COMPONENT_CLASS_ASSIGNMENT_DATA::GetConditionName ( const CONDITION_TYPE  aCondition)
static

Maps a CONDITION_TYPE to a descriptive string.

Definition at line 191 of file component_class_settings.cpp.

References CUSTOM, FOOTPRINT, FOOTPRINT_FIELD, REFERENCE, ROTATION, SHEET_NAME, and SIDE.

Referenced by COMPONENT_CLASS_SETTINGS::saveAssignment().

◆ GetConditions()

const std::unordered_map< CONDITION_TYPE, std::pair< wxString, wxString > > & COMPONENT_CLASS_ASSIGNMENT_DATA::GetConditions ( ) const
inline

Gets all conditions.

Definition at line 59 of file component_class_settings.h.

Referenced by COMPONENT_CLASS_SETTINGS::saveAssignment().

◆ GetConditionsOperator()

CONDITIONS_OPERATOR COMPONENT_CLASS_ASSIGNMENT_DATA::GetConditionsOperator ( ) const
inline

Gets the boolean operation in use for all conditions.

Definition at line 80 of file component_class_settings.h.

Referenced by COMPONENT_CLASS_SETTINGS::saveAssignment().

◆ GetConditionType()

COMPONENT_CLASS_ASSIGNMENT_DATA::CONDITION_TYPE COMPONENT_CLASS_ASSIGNMENT_DATA::GetConditionType ( const wxString &  aCondition)
static

Maps a descriptive string to a CONDITION_TYPE.

Definition at line 211 of file component_class_settings.cpp.

References CUSTOM, FOOTPRINT, FOOTPRINT_FIELD, REFERENCE, ROTATION, SHEET_NAME, and SIDE.

Referenced by COMPONENT_CLASS_SETTINGS::loadAssignment().

◆ SetComponentClass()

void COMPONENT_CLASS_ASSIGNMENT_DATA::SetComponentClass ( const wxString &  aComponentClass)
inline

◆ SetCondition()

void COMPONENT_CLASS_ASSIGNMENT_DATA::SetCondition ( const CONDITION_TYPE  aCondition,
const wxString &  aPrimaryData,
const wxString &  aSecondaryData 
)
inline

◆ SetConditionsOperation()

void COMPONENT_CLASS_ASSIGNMENT_DATA::SetConditionsOperation ( const CONDITIONS_OPERATOR  aOperator)
inline

Sets the boolean operation in use for all conditions.

Definition at line 74 of file component_class_settings.h.

Referenced by PANEL_COMPONENT_CLASS_ASSIGNMENT::GenerateAssignmentData(), and COMPONENT_CLASS_SETTINGS::loadAssignment().

Member Data Documentation

◆ m_componentClass

wxString COMPONENT_CLASS_ASSIGNMENT_DATA::m_componentClass
protected

The name of the component class for this assignment rule.

Definition at line 93 of file component_class_settings.h.

Referenced by GetAssignmentInDRCLanguage().

◆ m_conditions

std::unordered_map<CONDITION_TYPE, std::pair<wxString, wxString> > COMPONENT_CLASS_ASSIGNMENT_DATA::m_conditions
protected

Map of condition types to primary and secondary data fields for the condition.

Definition at line 96 of file component_class_settings.h.

Referenced by GetAssignmentInDRCLanguage().

◆ m_conditionsOperator

CONDITIONS_OPERATOR COMPONENT_CLASS_ASSIGNMENT_DATA::m_conditionsOperator { CONDITIONS_OPERATOR::ALL }
protected

Whether conditions are applied with AND or OR logic Defaults to ALL.

Definition at line 100 of file component_class_settings.h.

Referenced by GetAssignmentInDRCLanguage().


The documentation for this class was generated from the following files: