KiCad PCB EDA Suite
Loading...
Searching...
No Matches
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 The KiCad Developers, see AUTHORS.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
30enum class BITMAPS : unsigned int;
31
55
56#define ELECTRICAL_PINTYPES_TOTAL ( static_cast<int>( ELECTRICAL_PINTYPE::PT_LAST_OPTION ) + 1 )
57
59{
60 // These strings are the canonical name of the electrictal type
61 // Not translated, no space in name, only ASCII chars.
62 // to use when the string name must be known and well defined
63 // must have same order than enum ELECTRICAL_PINTYPE (see sch_pin.h)
64 static const wxChar* msgPinElectricType[] =
65 {
66 wxT( "input" ),
67 wxT( "output" ),
68 wxT( "bidirectional" ),
69 wxT( "tri_state" ),
70 wxT( "passive" ),
71 wxT( "free" ),
72 wxT( "unspecified" ),
73 wxT( "power_in" ),
74 wxT( "power_out" ),
75 wxT( "open_collector" ),
76 wxT( "open_emitter" ),
77 wxT( "no_connect" )
78 };
79
80 return msgPinElectricType[static_cast<int>( aType )];
81}
82
98
99#define GRAPHIC_PINSHAPES_TOTAL ( static_cast<int>( GRAPHIC_PINSHAPE::LAST_OPTION ) + 1 )
100
138
139
140// UI
141
142wxString PinShapeGetText( GRAPHIC_PINSHAPE shape );
144
147
148wxString PinOrientationName( PIN_ORIENTATION aOrientation );
150PIN_ORIENTATION PinOrientationCode( size_t index );
152
153const wxArrayString& PinTypeNames();
154const std::vector<BITMAPS>& PinTypeIcons();
155
156const wxArrayString& PinShapeNames();
157const std::vector<BITMAPS>& PinShapeIcons();
158
159const wxArrayString& PinOrientationNames();
160const std::vector<BITMAPS>& PinOrientationIcons();
161
162#endif
BITMAPS
A list of all bitmap identifiers.
Definition line.h:36
std::chrono::steady_clock CLOCK
const std::vector< BITMAPS > & PinTypeIcons()
Definition pin_type.cpp:167
wxString PinShapeGetText(GRAPHIC_PINSHAPE shape)
Definition pin_type.cpp:240
ELECTRICAL_PINTYPE
The symbol library pin object electrical types used in ERC tests.
Definition pin_type.h:36
@ PT_INPUT
usual pin input: must be connected
Definition pin_type.h:37
@ PT_NC
not connected (must be left open)
Definition pin_type.h:50
@ PT_LAST_OPTION
sentinel value, set to last usable enum option
Definition pin_type.h:52
@ PT_OUTPUT
usual output
Definition pin_type.h:38
@ PT_TRISTATE
tri state bus pin
Definition pin_type.h:40
@ PT_NIC
not internally connected (may be connected to anything)
Definition pin_type.h:44
@ PT_BIDI
input or output (like port for a microprocessor)
Definition pin_type.h:39
@ PT_OPENEMITTER
pin type open emitter
Definition pin_type.h:49
@ PT_POWER_OUT
output of a regulator: intended to be connected to power input pins
Definition pin_type.h:47
@ PT_OPENCOLLECTOR
pin type open collector
Definition pin_type.h:48
@ PT_POWER_IN
power input (GND, VCC for ICs). Must be connected to a power output.
Definition pin_type.h:46
@ PT_UNSPECIFIED
unknown electrical properties: creates always a warning when connected
Definition pin_type.h:45
@ PT_PASSIVE
pin for passive symbols: must be connected, and can be connected to any pin.
Definition pin_type.h:43
wxString GetCanonicalElectricalTypeName(ELECTRICAL_PINTYPE aType)
Definition pin_type.h:58
const wxArrayString & PinTypeNames()
Definition pin_type.cpp:158
BITMAPS ElectricalPinTypeGetBitmap(ELECTRICAL_PINTYPE)
Definition pin_type.cpp:226
int PinOrientationIndex(PIN_ORIENTATION code)
Definition pin_type.cpp:70
BITMAPS PinShapeGetBitmap(GRAPHIC_PINSHAPE shape)
Definition pin_type.cpp:254
wxString ElectricalPinTypeGetText(ELECTRICAL_PINTYPE)
Definition pin_type.cpp:212
const wxArrayString & PinShapeNames()
Definition pin_type.cpp:176
const std::vector< BITMAPS > & PinShapeIcons()
Definition pin_type.cpp:185
const wxArrayString & PinOrientationNames()
Definition pin_type.cpp:194
wxString PinOrientationName(PIN_ORIENTATION aOrientation)
Definition pin_type.cpp:268
BITMAPS PinOrientationGetBitmap(PIN_ORIENTATION aOrientation)
Definition pin_type.cpp:282
PIN_ORIENTATION
The symbol library pin object orientations.
Definition pin_type.h:105
@ PIN_UP
The pin extends upwards from the connection point: Probably on the bottom side of the symbol.
Definition pin_type.h:127
@ PIN_RIGHT
The pin extends rightwards from the connection point.
Definition pin_type.h:111
@ PIN_LEFT
The pin extends leftwards from the connection point: Probably on the right side of the symbol.
Definition pin_type.h:118
@ PIN_DOWN
The pin extends downwards from the connection: Probably on the top side of the symbol.
Definition pin_type.h:135
PIN_ORIENTATION PinOrientationCode(size_t index)
Definition pin_type.cpp:63
const std::vector< BITMAPS > & PinOrientationIcons()
Definition pin_type.cpp:203
GRAPHIC_PINSHAPE
Definition pin_type.h:84
@ LAST_OPTION
this is the sentinel value, must be set to last enum value
Definition pin_type.h:95