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
30enum class BITMAPS : unsigned int;
31
36{
37 PT_INPUT,
38 PT_OUTPUT,
39 PT_BIDI,
42 PT_NIC,
48 PT_NC,
49
51};
52
53#define ELECTRICAL_PINTYPES_TOTAL ( static_cast<int>( ELECTRICAL_PINTYPE::PT_LAST_OPTION ) + 1 )
54
56{
57 LINE,
59 CLOCK,
66
68};
69
70#define GRAPHIC_PINSHAPES_TOTAL ( static_cast<int>( GRAPHIC_PINSHAPE::LAST_OPTION ) + 1 )
71
72
73// UI
74
75wxString PinShapeGetText( GRAPHIC_PINSHAPE shape );
77
80
81wxString PinOrientationName( unsigned aPinOrientationCode );
82int PinOrientationCode( int index );
83int PinOrientationIndex( int code );
84
85const wxArrayString& PinTypeNames();
86const std::vector<BITMAPS>& PinTypeIcons();
87
88const wxArrayString& PinShapeNames();
89const std::vector<BITMAPS>& PinShapeIcons();
90
91const wxArrayString& PinOrientationNames();
92const std::vector<BITMAPS>& PinOrientationIcons();
93
94#endif
BITMAPS
A list of all bitmap identifiers.
Definition: bitmaps_list.h:33
std::chrono::steady_clock CLOCK
const std::vector< BITMAPS > & PinTypeIcons()
Definition: pin_type.cpp:195
wxString PinShapeGetText(GRAPHIC_PINSHAPE shape)
Definition: pin_type.cpp:278
wxString PinOrientationName(unsigned aPinOrientationCode)
Definition: pin_type.cpp:119
int PinOrientationIndex(int code)
Definition: pin_type.cpp:150
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
@ PT_NC
not connected (must be left open)
@ PT_LAST_OPTION
sentinel value, set to last usable enum option
@ PT_OUTPUT
usual output
@ PT_TRISTATE
tris state bus pin
@ PT_NIC
not internally connected (may be connected to anything)
@ PT_BIDI
input or output (like port for a microprocessor)
@ PT_OPENEMITTER
pin type open emitter
@ PT_POWER_OUT
output of a regulator: intended to be connected to power input pins
@ PT_OPENCOLLECTOR
pin type open collector
@ PT_POWER_IN
power input (GND, VCC for ICs). Must be connected to a power output.
@ PT_UNSPECIFIED
unknown electrical properties: creates always a warning when connected
@ PT_PASSIVE
pin for passive symbols: must be connected, and can be connected to any pin
const wxArrayString & PinTypeNames()
Definition: pin_type.cpp:186
BITMAPS ElectricalPinTypeGetBitmap(ELECTRICAL_PINTYPE)
Definition: pin_type.cpp:268
BITMAPS PinShapeGetBitmap(GRAPHIC_PINSHAPE shape)
Definition: pin_type.cpp:288
wxString ElectricalPinTypeGetText(ELECTRICAL_PINTYPE)
Definition: pin_type.cpp:240
const wxArrayString & PinShapeNames()
Definition: pin_type.cpp:204
const std::vector< BITMAPS > & PinShapeIcons()
Definition: pin_type.cpp:213
const wxArrayString & PinOrientationNames()
Definition: pin_type.cpp:222
int PinOrientationCode(int index)
Definition: pin_type.cpp:141
const std::vector< BITMAPS > & PinOrientationIcons()
Definition: pin_type.cpp:231
GRAPHIC_PINSHAPE
Definition: pin_type.h:56
@ LAST_OPTION
this is the sentinel value, must be set to last enum value