KiCad PCB EDA Suite
pin_type.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) 2004-2021 KiCad Developers, see change_log.txt for contributors.
5  *
6  * This program is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU General Public License
8  * as published by the Free Software Foundation; either version 2
9  * of the License, or (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, you may find one here:
18  * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
19  * or you may search the http://www.gnu.org website for the version 2 license,
20  * or you may write to the Free Software Foundation, Inc.,
21  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
22  */
23 
24 #ifndef PIN_TYPE_H_
25 #define PIN_TYPE_H_
26 
27 #include <wx/arrstr.h>
28 #include <vector>
29 
30 enum class BITMAPS : unsigned int;
31 
36 {
37  PT_INPUT,
38  PT_OUTPUT,
39  PT_BIDI,
40  PT_TRISTATE,
41  PT_PASSIVE,
42  PT_NIC,
44  PT_POWER_IN,
45  PT_POWER_OUT,
48  PT_NC,
49 
51 };
52 
53 #define ELECTRICAL_PINTYPES_TOTAL ( static_cast<int>( ELECTRICAL_PINTYPE::PT_LAST_OPTION ) + 1 )
54 
55 enum class GRAPHIC_PINSHAPE
56 {
57  LINE,
58  INVERTED,
59  CLOCK,
61  INPUT_LOW,
62  CLOCK_LOW,
63  OUTPUT_LOW,
65  NONLOGIC,
66 
68 };
69 
70 #define GRAPHIC_PINSHAPES_TOTAL ( static_cast<int>( GRAPHIC_PINSHAPE::LAST_OPTION ) + 1 )
71 
72 
73 // UI
74 
75 wxString PinShapeGetText( GRAPHIC_PINSHAPE shape );
77 
80 
81 wxString PinOrientationName( unsigned aPinOrientationCode );
82 int PinOrientationCode( int index );
83 int PinOrientationIndex( int code );
84 
85 const wxArrayString& PinTypeNames();
86 const std::vector<BITMAPS>& PinTypeIcons();
87 
88 const wxArrayString& PinShapeNames();
89 const std::vector<BITMAPS>& PinShapeIcons();
90 
91 const wxArrayString& PinOrientationNames();
92 const std::vector<BITMAPS>& PinOrientationIcons();
93 
94 #endif
power input (GND, VCC for ICs). Must be connected to a power output.
BITMAPS ElectricalPinTypeGetBitmap(ELECTRICAL_PINTYPE)
Definition: pin_type.cpp:247
const wxArrayString & PinShapeNames()
Definition: pin_type.cpp:201
const wxArrayString & PinTypeNames()
Definition: pin_type.cpp:183
pin for passive symbols: must be connected, and can be connected to any pin
unknown electrical properties: creates always a warning when connected
GRAPHIC_PINSHAPE
Definition: pin_type.h:55
BITMAPS PinShapeGetBitmap(GRAPHIC_PINSHAPE shape)
Definition: pin_type.cpp:268
not internally connected (may be connected to anything)
int PinOrientationIndex(int code)
Definition: pin_type.cpp:147
const wxArrayString & PinOrientationNames()
Definition: pin_type.cpp:219
const std::vector< BITMAPS > & PinTypeIcons()
Definition: pin_type.cpp:192
sentinel value, set to last usable enum option
const std::vector< BITMAPS > & PinShapeIcons()
Definition: pin_type.cpp:210
BITMAPS
A list of all bitmap identifiers.
Definition: bitmaps_list.h:32
ELECTRICAL_PINTYPE
The symbol library pin object electrical types used in ERC tests.
Definition: pin_type.h:35
usual pin input: must be connected
this is the sentinel value, must be set to last enum value
wxString ElectricalPinTypeGetText(ELECTRICAL_PINTYPE)
Definition: pin_type.cpp:237
int PinOrientationCode(int index)
Definition: pin_type.cpp:138
input or output (like port for a microprocessor)
wxString PinOrientationName(unsigned aPinOrientationCode)
Definition: pin_type.cpp:116
not connected (must be left open)
const std::vector< BITMAPS > & PinOrientationIcons()
Definition: pin_type.cpp:228
output of a regulator: intended to be connected to power input pins
wxString PinShapeGetText(GRAPHIC_PINSHAPE shape)
Definition: pin_type.cpp:258