KiCad PCB EDA Suite
CVPCB_ASSOCIATION Class Reference

A class to define a footprint association to be made in cvpcb. More...

#include <cvpcb_association.h>

Public Member Functions

 CVPCB_ASSOCIATION (unsigned int aComponentIndex, LIB_ID aNewFootprint, LIB_ID aOldFootprint=LIB_ID())
 Create an association event that contains all the information needed to modify the footprint association of a component in cvpcb. More...
 
 CVPCB_ASSOCIATION (unsigned int aComponentIndex, wxString aNewFootprint, wxString aOldFootprint="")
 
CVPCB_ASSOCIATION Reverse () const
 Reverse the association. More...
 
unsigned int GetComponentIndex () const
 Get the index of the component to modify the association of. More...
 
LIB_ID GetNewFootprint () const
 Get the new footprint to associate to the component. More...
 
LIB_ID GetOldFootprint () const
 Get the old footprint of the component. More...
 
void SetNewFootprint (const LIB_ID &aNewFootprint)
 Set the footprint that should be associated with the component. More...
 
void SetOldFootprint (const LIB_ID &aOldFootprint)
 Set the footprint that was associated with the component before this association event. More...
 

Private Attributes

unsigned int m_componentIndex
 
LIB_ID m_newFootprint
 
LIB_ID m_oldFootprint
 

Detailed Description

A class to define a footprint association to be made in cvpcb.

Definition at line 30 of file cvpcb_association.h.

Constructor & Destructor Documentation

◆ CVPCB_ASSOCIATION() [1/2]

CVPCB_ASSOCIATION::CVPCB_ASSOCIATION ( unsigned int  aComponentIndex,
LIB_ID  aNewFootprint,
LIB_ID  aOldFootprint = LIB_ID() 
)
inline

Create an association event that contains all the information needed to modify the footprint association of a component in cvpcb.

Parameters
aComponentIndexis the index of the component to change
aNewFootprintis the new footprint to give to the component
aOldFootprintis the old footprint from the component

Definition at line 43 of file cvpcb_association.h.

44  :
45  m_componentIndex( aComponentIndex ),
46  m_newFootprint( aNewFootprint ),
47  m_oldFootprint( aOldFootprint )
48  {}
unsigned int m_componentIndex

Referenced by Reverse().

◆ CVPCB_ASSOCIATION() [2/2]

CVPCB_ASSOCIATION::CVPCB_ASSOCIATION ( unsigned int  aComponentIndex,
wxString  aNewFootprint,
wxString  aOldFootprint = "" 
)
inline

Definition at line 50 of file cvpcb_association.h.

51  :
52  m_componentIndex( aComponentIndex )
53  {
54  m_newFootprint.Parse( aNewFootprint, LIB_ID::ID_PCB );
55  m_oldFootprint.Parse( aOldFootprint, LIB_ID::ID_PCB );
56  }
unsigned int m_componentIndex
int Parse(const UTF8 &aId, LIB_ID_TYPE aType, bool aFix=false)
Parse LIB_ID with the information from aId.
Definition: lib_id.cpp:122

References LIB_ID::ID_PCB, m_newFootprint, m_oldFootprint, and LIB_ID::Parse().

Member Function Documentation

◆ GetComponentIndex()

unsigned int CVPCB_ASSOCIATION::GetComponentIndex ( ) const
inline

Get the index of the component to modify the association of.

Returns
the index of the component

Definition at line 73 of file cvpcb_association.h.

74  {
75  return m_componentIndex;
76  }
unsigned int m_componentIndex

References m_componentIndex.

Referenced by CVPCB_MAINFRAME::AssociateFootprint().

◆ GetNewFootprint()

LIB_ID CVPCB_ASSOCIATION::GetNewFootprint ( ) const
inline

Get the new footprint to associate to the component.

Returns
the LIB_ID of the new footprint

Definition at line 83 of file cvpcb_association.h.

84  {
85  return m_newFootprint;
86  }

References m_newFootprint.

Referenced by CVPCB_MAINFRAME::AssociateFootprint().

◆ GetOldFootprint()

LIB_ID CVPCB_ASSOCIATION::GetOldFootprint ( ) const
inline

Get the old footprint of the component.

Returns
the LIB_ID of the old footprint

Definition at line 93 of file cvpcb_association.h.

94  {
95  return m_oldFootprint;
96  }

References m_oldFootprint.

◆ Reverse()

CVPCB_ASSOCIATION CVPCB_ASSOCIATION::Reverse ( ) const
inline

Reverse the association.

Returns
the reversed association

Definition at line 63 of file cvpcb_association.h.

64  {
66  }
unsigned int m_componentIndex
CVPCB_ASSOCIATION(unsigned int aComponentIndex, LIB_ID aNewFootprint, LIB_ID aOldFootprint=LIB_ID())
Create an association event that contains all the information needed to modify the footprint associat...

References CVPCB_ASSOCIATION(), m_componentIndex, m_newFootprint, and m_oldFootprint.

◆ SetNewFootprint()

void CVPCB_ASSOCIATION::SetNewFootprint ( const LIB_ID aNewFootprint)
inline

Set the footprint that should be associated with the component.

Parameters
aNewFootprintis the LIB_ID of the new footprint

Definition at line 103 of file cvpcb_association.h.

104  {
105  m_newFootprint = aNewFootprint;
106  }

References m_newFootprint.

◆ SetOldFootprint()

void CVPCB_ASSOCIATION::SetOldFootprint ( const LIB_ID aOldFootprint)
inline

Set the footprint that was associated with the component before this association event.

Parameters
aOldFootprintis the LIB_ID of the old footprint

Definition at line 113 of file cvpcb_association.h.

114  {
115  m_oldFootprint = aOldFootprint;
116  }

References m_oldFootprint.

Member Data Documentation

◆ m_componentIndex

unsigned int CVPCB_ASSOCIATION::m_componentIndex
private

Definition at line 120 of file cvpcb_association.h.

Referenced by GetComponentIndex(), and Reverse().

◆ m_newFootprint

LIB_ID CVPCB_ASSOCIATION::m_newFootprint
private

Definition at line 121 of file cvpcb_association.h.

Referenced by CVPCB_ASSOCIATION(), GetNewFootprint(), Reverse(), and SetNewFootprint().

◆ m_oldFootprint

LIB_ID CVPCB_ASSOCIATION::m_oldFootprint
private

Definition at line 122 of file cvpcb_association.h.

Referenced by CVPCB_ASSOCIATION(), GetOldFootprint(), Reverse(), and SetOldFootprint().


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