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-2015 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 <bitmap_types.h>
29 #include <vector>
30 
35 {
36  PT_INPUT,
37  PT_OUTPUT,
38  PT_BIDI,
39  PT_TRISTATE,
40  PT_PASSIVE,
41  PT_NIC,
43  PT_POWER_IN,
44  PT_POWER_OUT,
47  PT_NC,
48 
50 };
51 
52 #define ELECTRICAL_PINTYPES_TOTAL ( static_cast<int>( ELECTRICAL_PINTYPE::PT_LAST_OPTION ) + 1 )
53 
54 enum class GRAPHIC_PINSHAPE
55 {
56  LINE,
57  INVERTED,
58  CLOCK,
60  INPUT_LOW,
61  CLOCK_LOW,
62  OUTPUT_LOW,
64  NONLOGIC,
65 
67 };
68 
69 #define GRAPHIC_PINSHAPES_TOTAL ( static_cast<int>( GRAPHIC_PINSHAPE::LAST_OPTION ) + 1 )
70 
71 
72 // UI
73 
74 wxString PinShapeGetText( GRAPHIC_PINSHAPE shape );
76 
79 
80 wxString PinOrientationName( unsigned aPinOrientationCode );
81 int PinOrientationCode( int index );
82 int PinOrientationIndex( int code );
83 
84 const wxArrayString& PinTypeNames();
85 const std::vector<BITMAP_DEF>& PinTypeIcons();
86 
87 const wxArrayString& PinShapeNames();
88 const std::vector<BITMAP_DEF>& PinShapeIcons();
89 
90 const wxArrayString& PinOrientationNames();
91 const std::vector<BITMAP_DEF>& PinOrientationIcons();
92 
93 #endif
power input (GND, VCC for ICs). Must be connected to a power output.
BITMAP_DEF PinShapeGetBitmap(GRAPHIC_PINSHAPE shape)
Definition: pin_type.cpp:266
PNG memory record (file in memory).
Definition: bitmap_def.h:29
const wxArrayString & PinShapeNames()
Definition: pin_type.cpp:200
const wxArrayString & PinTypeNames()
Definition: pin_type.cpp:182
pin for passive components: 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:54
const std::vector< BITMAP_DEF > & PinOrientationIcons()
Definition: pin_type.cpp:227
not internally connected (may be connected to anything)
int PinOrientationIndex(int code)
Definition: pin_type.cpp:146
const wxArrayString & PinOrientationNames()
Definition: pin_type.cpp:218
const std::vector< BITMAP_DEF > & PinShapeIcons()
Definition: pin_type.cpp:209
const std::vector< BITMAP_DEF > & PinTypeIcons()
Definition: pin_type.cpp:191
sentinel value, set to last usable enum option
ELECTRICAL_PINTYPE
The component library pin object electrical types used in ERC tests.
Definition: pin_type.h:34
usual pin input: must be connected
this is the sentinel value, must be set to last enum value
BITMAP_DEF ElectricalPinTypeGetBitmap(ELECTRICAL_PINTYPE)
Definition: pin_type.cpp:246
wxString ElectricalPinTypeGetText(ELECTRICAL_PINTYPE)
Definition: pin_type.cpp:236
int PinOrientationCode(int index)
Definition: pin_type.cpp:137
input or output (like port for a microprocessor)
wxString PinOrientationName(unsigned aPinOrientationCode)
Definition: pin_type.cpp:115
not connected (must be left open)
output of a regulator: intended to be connected to power input pins
wxString PinShapeGetText(GRAPHIC_PINSHAPE shape)
Definition: pin_type.cpp:256