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, see <https://www.gnu.org/licenses/>.
18 */
19
20#ifndef PIN_TYPE_H_
21#define PIN_TYPE_H_
22
23#include <wx/arrstr.h>
24#include <vector>
25
26enum class BITMAPS : unsigned int;
27
51
52#define ELECTRICAL_PINTYPES_TOTAL ( static_cast<int>( ELECTRICAL_PINTYPE::PT_LAST_OPTION ) + 1 )
53
55{
56 // These strings are the canonical name of the electrictal type
57 // Not translated, no space in name, only ASCII chars.
58 // to use when the string name must be known and well defined
59 // must have same order than enum ELECTRICAL_PINTYPE (see sch_pin.h)
60 static const wxChar* msgPinElectricType[] =
61 {
62 wxT( "input" ),
63 wxT( "output" ),
64 wxT( "bidirectional" ),
65 wxT( "tri_state" ),
66 wxT( "passive" ),
67 wxT( "free" ),
68 wxT( "unspecified" ),
69 wxT( "power_in" ),
70 wxT( "power_out" ),
71 wxT( "open_collector" ),
72 wxT( "open_emitter" ),
73 wxT( "no_connect" )
74 };
75
76 return msgPinElectricType[static_cast<int>( aType )];
77}
78
94
95#define GRAPHIC_PINSHAPES_TOTAL ( static_cast<int>( GRAPHIC_PINSHAPE::LAST_OPTION ) + 1 )
96
134
135
136// UI
137
138wxString PinShapeGetText( GRAPHIC_PINSHAPE shape );
140
143
144wxString PinOrientationName( PIN_ORIENTATION aOrientation );
147
148const wxArrayString& PinTypeNames();
149const std::vector<BITMAPS>& PinTypeIcons();
150
151const wxArrayString& PinShapeNames();
152const std::vector<BITMAPS>& PinShapeIcons();
153
154const wxArrayString& PinOrientationNames();
155const std::vector<BITMAPS>& PinOrientationIcons();
156
157#endif
int index
BITMAPS
A list of all bitmap identifiers.
Definition line.h:32
std::chrono::steady_clock CLOCK
const std::vector< BITMAPS > & PinTypeIcons()
Definition pin_type.cpp:158
wxString PinShapeGetText(GRAPHIC_PINSHAPE shape)
Definition pin_type.cpp:231
ELECTRICAL_PINTYPE
The symbol library pin object electrical types used in ERC tests.
Definition pin_type.h:32
@ PT_INPUT
usual pin input: must be connected
Definition pin_type.h:33
@ PT_NC
not connected (must be left open)
Definition pin_type.h:46
@ PT_LAST_OPTION
sentinel value, set to last usable enum option
Definition pin_type.h:48
@ PT_OUTPUT
usual output
Definition pin_type.h:34
@ PT_TRISTATE
tri state bus pin
Definition pin_type.h:36
@ PT_NIC
not internally connected (may be connected to anything)
Definition pin_type.h:40
@ PT_BIDI
input or output (like port for a microprocessor)
Definition pin_type.h:35
@ PT_OPENEMITTER
pin type open emitter
Definition pin_type.h:45
@ PT_POWER_OUT
output of a regulator: intended to be connected to power input pins
Definition pin_type.h:43
@ PT_OPENCOLLECTOR
pin type open collector
Definition pin_type.h:44
@ PT_POWER_IN
power input (GND, VCC for ICs). Must be connected to a power output.
Definition pin_type.h:42
@ PT_UNSPECIFIED
unknown electrical properties: creates always a warning when connected
Definition pin_type.h:41
@ PT_PASSIVE
pin for passive symbols: must be connected, and can be connected to any pin.
Definition pin_type.h:39
wxString GetCanonicalElectricalTypeName(ELECTRICAL_PINTYPE aType)
Definition pin_type.h:54
const wxArrayString & PinTypeNames()
Definition pin_type.cpp:149
BITMAPS ElectricalPinTypeGetBitmap(ELECTRICAL_PINTYPE)
Definition pin_type.cpp:217
int PinOrientationIndex(PIN_ORIENTATION code)
Definition pin_type.cpp:66
BITMAPS PinShapeGetBitmap(GRAPHIC_PINSHAPE shape)
Definition pin_type.cpp:245
wxString ElectricalPinTypeGetText(ELECTRICAL_PINTYPE)
Definition pin_type.cpp:203
const wxArrayString & PinShapeNames()
Definition pin_type.cpp:167
const std::vector< BITMAPS > & PinShapeIcons()
Definition pin_type.cpp:176
const wxArrayString & PinOrientationNames()
Definition pin_type.cpp:185
wxString PinOrientationName(PIN_ORIENTATION aOrientation)
Definition pin_type.cpp:259
PIN_ORIENTATION
The symbol library pin object orientations.
Definition pin_type.h:101
@ PIN_UP
The pin extends upwards from the connection point: Probably on the bottom side of the symbol.
Definition pin_type.h:123
@ PIN_RIGHT
The pin extends rightwards from the connection point.
Definition pin_type.h:107
@ PIN_LEFT
The pin extends leftwards from the connection point: Probably on the right side of the symbol.
Definition pin_type.h:114
@ PIN_DOWN
The pin extends downwards from the connection: Probably on the top side of the symbol.
Definition pin_type.h:131
PIN_ORIENTATION PinOrientationCode(size_t index)
Definition pin_type.cpp:59
const std::vector< BITMAPS > & PinOrientationIcons()
Definition pin_type.cpp:194
GRAPHIC_PINSHAPE
Definition pin_type.h:80
@ LAST_OPTION
this is the sentinel value, must be set to last enum value
Definition pin_type.h:91