KiCad PCB EDA Suite
Loading...
Searching...
No Matches
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 AddCondition (const CONDITION_TYPE aCondition, const wxString &aPrimaryData, const wxString &aSecondaryData)
 Sets the given condition type with the assocated match data.
 
const std::vector< std::tuple< CONDITION_TYPE, 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.
 
bool operator== (const COMPONENT_CLASS_ASSIGNMENT_DATA &aOther) const
 
bool operator!= (const COMPONENT_CLASS_ASSIGNMENT_DATA &aOther) const
 

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::vector< std::tuple< CONDITION_TYPE, wxString, wxString > > m_conditions
 Set of conditions with type, 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

◆ AddCondition()

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

◆ GetAssignmentInDRCLanguage()

wxString COMPONENT_CLASS_ASSIGNMENT_DATA::GetAssignmentInDRCLanguage ( ) const

Returns the DRC rules language for this component class assignment.

Definition at line 227 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.

References m_componentClass.

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 184 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::vector< std::tuple< CONDITION_TYPE, wxString, wxString > > & COMPONENT_CLASS_ASSIGNMENT_DATA::GetConditions ( ) const
inline

Gets all conditions.

Definition at line 59 of file component_class_settings.h.

References m_conditions.

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.

References m_conditionsOperator.

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 204 of file component_class_settings.cpp.

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

Referenced by COMPONENT_CLASS_SETTINGS::loadAssignment().

◆ operator!=()

bool COMPONENT_CLASS_ASSIGNMENT_DATA::operator!= ( const COMPONENT_CLASS_ASSIGNMENT_DATA & aOther) const
inline

Definition at line 97 of file component_class_settings.h.

References operator==().

◆ operator==()

bool COMPONENT_CLASS_ASSIGNMENT_DATA::operator== ( const COMPONENT_CLASS_ASSIGNMENT_DATA & aOther) const
inline

Definition at line 91 of file component_class_settings.h.

References m_componentClass, m_conditions, and m_conditionsOperator.

◆ SetComponentClass()

void COMPONENT_CLASS_ASSIGNMENT_DATA::SetComponentClass ( const wxString & aComponentClass)
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.

References m_conditionsOperator.

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 104 of file component_class_settings.h.

Referenced by GetAssignmentInDRCLanguage(), GetComponentClass(), operator==(), and SetComponentClass().

◆ m_conditions

std::vector<std::tuple<CONDITION_TYPE, wxString, wxString> > COMPONENT_CLASS_ASSIGNMENT_DATA::m_conditions
protected

Set of conditions with type, primary and secondary data fields for the condition.

Definition at line 107 of file component_class_settings.h.

Referenced by AddCondition(), GetAssignmentInDRCLanguage(), GetConditions(), and operator==().

◆ 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 111 of file component_class_settings.h.

Referenced by GetAssignmentInDRCLanguage(), GetConditionsOperator(), operator==(), and SetConditionsOperation().


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