KiCad PCB EDA Suite
Loading...
Searching...
No Matches
cvpcb_association.h
Go to the documentation of this file.
1/*
2 * This program source code file is part of KiCad, a free EDA CAD application.
3 *
4 * Copyright (C) 2019 Ian McInerney <[email protected]>
5 * Copyright (C) 2019 KiCad Developers, see AUTHORS.txt for contributors.
6 *
7 * This program is free software: you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License as published by the
9 * Free Software Foundation, either version 3 of the License, or (at your
10 * option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License along
18 * with this program. If not, see <http://www.gnu.org/licenses/>.
19 */
20
21#ifndef CVPCB_ASSOCIATION_H
22#define CVPCB_ASSOCIATION_H
23
24#include <lib_id.h>
25#include <core/utf8.h>
26
31{
32
33public:
34
44 unsigned int aComponentIndex, LIB_ID aNewFootprint, LIB_ID aOldFootprint = LIB_ID() ) :
45 m_componentIndex( aComponentIndex ),
46 m_newFootprint( aNewFootprint ),
47 m_oldFootprint( aOldFootprint )
48 {}
49
51 unsigned int aComponentIndex, wxString aNewFootprint, wxString aOldFootprint = "" ) :
52 m_componentIndex( aComponentIndex )
53 {
54 m_newFootprint.Parse( aNewFootprint );
55 m_oldFootprint.Parse( aOldFootprint );
56 }
57
64 {
66 }
67
73 unsigned int GetComponentIndex() const
74 {
75 return m_componentIndex;
76 }
77
84 {
85 return m_newFootprint;
86 }
87
94 {
95 return m_oldFootprint;
96 }
97
103 void SetNewFootprint( const LIB_ID& aNewFootprint )
104 {
105 m_newFootprint = aNewFootprint;
106 }
107
113 void SetOldFootprint( const LIB_ID& aOldFootprint )
114 {
115 m_oldFootprint = aOldFootprint;
116 }
117
118
119private:
120 unsigned int m_componentIndex;
123
124};
125
126
127#endif
A class to define a footprint association to be made in cvpcb.
unsigned int GetComponentIndex() const
Get the index of the component to modify the association of.
void SetOldFootprint(const LIB_ID &aOldFootprint)
Set the footprint that was associated with the component before this association event.
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...
CVPCB_ASSOCIATION(unsigned int aComponentIndex, wxString aNewFootprint, wxString aOldFootprint="")
void SetNewFootprint(const LIB_ID &aNewFootprint)
Set the footprint that should be associated with the component.
LIB_ID GetOldFootprint() const
Get the old footprint of the component.
CVPCB_ASSOCIATION Reverse() const
Reverse the association.
LIB_ID GetNewFootprint() const
Get the new footprint to associate to the component.
A logical library item identifier and consists of various portions much like a URI.
Definition: lib_id.h:49
int Parse(const UTF8 &aId, bool aFix=false)
Parse LIB_ID with the information from aId.
Definition: lib_id.cpp:51