KiCad PCB EDA Suite
pin_type.cpp
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 
29 #include "pin_type.h"
30 
31 #include <macros.h>
32 
33 wxString GetText( ELECTRICAL_PINTYPE aType )
34 {
35  switch( aType )
36  {
37  case PIN_INPUT:
38  return _( "Input" );
39 
40  case PIN_OUTPUT:
41  return _( "Output" );
42 
43  case PIN_BIDI:
44  return _( "Bidirectional" );
45 
46  case PIN_TRISTATE:
47  return _( "Tri-state" );
48 
49  case PIN_PASSIVE:
50  return _( "Passive" );
51 
52  case PIN_UNSPECIFIED:
53  return _( "Unspecified" );
54 
55  case PIN_POWER_IN:
56  return _( "Power input" );
57 
58  case PIN_POWER_OUT:
59  return _( "Power output" );
60 
61  case PIN_OPENCOLLECTOR:
62  return _( "Open collector" );
63 
64  case PIN_OPENEMITTER:
65  return _( "Open emitter" );
66 
67  case PIN_NC:
68  return _( "Not connected" );
69  };
70 
71  assert( !"invalid pin type" );
72  return wxT( "???" );
73 }
74 
75 
77 {
78  switch( aType )
79  {
80  case PIN_INPUT:
81  return pintype_input_xpm;
82 
83  case PIN_OUTPUT:
84  return pintype_output_xpm;
85 
86  case PIN_BIDI:
87  return pintype_bidi_xpm;
88 
89  case PIN_TRISTATE:
90  return pintype_3states_xpm;
91 
92  case PIN_PASSIVE:
93  return pintype_passive_xpm;
94 
95  case PIN_UNSPECIFIED:
96  return pintype_notspecif_xpm;
97 
98  case PIN_POWER_IN:
99  return pintype_powerinput_xpm;
100 
101  case PIN_POWER_OUT:
102  return pintype_poweroutput_xpm;
103 
104  case PIN_OPENCOLLECTOR:
105  return pintype_opencoll_xpm;
106 
107  case PIN_OPENEMITTER:
108  return pintype_openemit_xpm;
109 
110  case PIN_NC:
111  return pintype_noconnect_xpm;
112  };
113 
114  assert( !"invalid pin type" );
115  return NULL;
116 }
PNG memory record (file in memory).
Definition: bitmap_types.h:38
Electrical pin type handling.
BITMAP_DEF GetBitmap(ELECTRICAL_PINTYPE aType)
Definition: pin_type.cpp:76
This file contains miscellaneous commonly used macros and functions.
wxString GetText(ELECTRICAL_PINTYPE aType)
Definition: pin_type.cpp:33
ELECTRICAL_PINTYPE
The component library pin object electrical types used in ERC tests.
Definition: pin_type.h:37