KiCad PCB EDA Suite
Loading...
Searching...
No Matches
sch_pin.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) 2018 CERN
5 * Copyright (C) 2019-2024 KiCad Developers, see AUTHORS.txt for contributors.
6 * @author Jon Evans <[email protected]>
7 *
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License
10 * as published by the Free Software Foundation; either version 2
11 * of the License, or (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License along
19 * with this program. If not, see <http://www.gnu.org/licenses/>.
20 */
21
22#include <base_units.h>
23#include <lib_pin.h>
24#include <sch_symbol.h>
25#include <sch_pin.h>
26#include <schematic.h>
27#include <schematic_settings.h>
28#include <sch_sheet_path.h>
29#include <sch_edit_frame.h>
30#include "string_utils.h"
31
32SCH_PIN::SCH_PIN( LIB_PIN* aLibPin, SCH_SYMBOL* aParentSymbol ) :
33 SCH_ITEM( aParentSymbol, SCH_PIN_T )
34{
35 wxASSERT( aParentSymbol );
37 m_alt = wxEmptyString;
38 m_number = aLibPin->GetNumber();
39 m_libPin = aLibPin;
40 SetPosition( aLibPin->GetPosition() );
41 m_isDangling = true;
42}
43
44
49SCH_PIN::SCH_PIN( SCH_SYMBOL* aParentSymbol, const wxString& aNumber, const wxString& aAlt ) :
50 SCH_ITEM( aParentSymbol, SCH_PIN_T )
51{
52 wxASSERT( aParentSymbol );
54 m_alt = aAlt;
55 m_number = aNumber;
56 m_libPin = nullptr;
57 m_isDangling = true;
58}
59
60
61SCH_PIN::SCH_PIN( const SCH_PIN& aPin ) :
62 SCH_ITEM( aPin )
63{
64 m_layer = aPin.m_layer;
65 m_alt = aPin.m_alt;
66 m_number = aPin.m_number;
67 m_libPin = aPin.m_libPin;
70}
71
72
74{
75 SCH_ITEM::operator=( aPin );
76
77 m_alt = aPin.m_alt;
78 m_number = aPin.m_number;
79 m_libPin = aPin.m_libPin;
82
83 return *this;
84}
85
86
88{
89 wxCHECK( m_libPin, false );
90
91 return m_libPin->IsVisible();
92}
93
94
95wxString SCH_PIN::GetName() const
96{
97 if( !m_alt.IsEmpty() )
98 return m_alt;
99
100 return m_libPin ? m_libPin->GetName() : wxString( "??" );
101}
102
103
104wxString SCH_PIN::GetShownName() const
105{
106 wxString name = m_libPin ? m_libPin->GetName() : wxString( "??" );
107
108 if( !m_alt.IsEmpty() )
109 name = m_alt;
110
111 if( name == wxS( "~" ) )
112 return wxEmptyString;
113 else
114 return name;
115}
116
117
119{
120 if( m_number == wxS( "~" ) )
121 return wxEmptyString;
122 else
123 return m_number;
124}
125
126
128{
129 wxCHECK( m_libPin, ELECTRICAL_PINTYPE::PT_NC );
130
131 if( !m_alt.IsEmpty() )
132 return m_libPin->GetAlt( m_alt ).m_Type;
133
134 return m_libPin->GetType();
135}
136
137
139{
140 wxCHECK( m_libPin, GRAPHIC_PINSHAPE::LINE );
141
142 if( !m_alt.IsEmpty() )
143 return m_libPin->GetAlt( m_alt ).m_Shape;
144
145 return m_libPin->GetShape();
146}
147
148
150{
151 wxCHECK( m_libPin, PIN_ORIENTATION::PIN_RIGHT );
152
153 return m_libPin->GetOrientation();
154}
155
156
158{
159 wxCHECK( m_libPin, 0 );
160
161 return m_libPin->GetLength();
162}
163
164
166{
167 return GetBoundingBox( false, true, true );
168}
169
170
171void SCH_PIN::ViewGetLayers( int aLayers[], int& aCount ) const
172{
173 aCount = 4;
174 aLayers[0] = LAYER_DANGLING;
175 aLayers[1] = LAYER_DEVICE;
176 aLayers[2] = LAYER_SELECTION_SHADOWS;
177 aLayers[3] = LAYER_OP_CURRENTS;
178}
179
180
181bool SCH_PIN::Matches( const EDA_SEARCH_DATA& aSearchData, void* aAuxDat ) const
182{
183 const SCH_SEARCH_DATA& schSearchData =
184 dynamic_cast<const SCH_SEARCH_DATA&>( aSearchData );
185
186 if( !schSearchData.searchAllPins )
187 return false;
188
189 return EDA_ITEM::Matches( GetName(), aSearchData )
190 || EDA_ITEM::Matches( GetNumber(), aSearchData );
191}
192
193
194bool SCH_PIN::Replace( const EDA_SEARCH_DATA& aSearchData, void* aAuxData )
195{
196 bool isReplaced = false;
197
198 /* TODO: waiting on a way to override pins in the schematic...
199 isReplaced |= EDA_ITEM::Replace( aSearchData, m_name );
200 isReplaced |= EDA_ITEM::Replace( aSearchData, m_number );
201 */
202
203 return isReplaced;
204}
205
206
208{
209 return static_cast<SCH_SYMBOL*>( GetParent() );
210}
211
212
213wxString SCH_PIN::GetItemDescription( UNITS_PROVIDER* aUnitsProvider ) const
214{
215 LIB_PIN::ALT localStorage;
216 LIB_PIN::ALT* alt = nullptr;
217
218 if( !m_alt.IsEmpty() && m_libPin )
219 {
220 localStorage = m_libPin->GetAlt( m_alt );
221 alt = &localStorage;
222 }
223
224 wxString itemDesc = m_libPin ? m_libPin->GetItemDescription( aUnitsProvider, alt ) :
225 wxString( wxS( "Undefined library pin." ) );
226 return wxString::Format( "Symbol %s %s",
227 UnescapeString( GetParentSymbol()->GetField( REFERENCE_FIELD )->GetText() ),
228 itemDesc );
229}
230
231
232void SCH_PIN::GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_ITEM>& aList )
233{
234 wxString msg;
235 SCH_SYMBOL* symbol = GetParentSymbol();
236
237 aList.emplace_back( _( "Type" ), _( "Pin" ) );
238
239 if( LIB_SYMBOL* libSymbol = symbol->GetLibSymbolRef().get() )
240 {
241 if( libSymbol->GetUnitCount() )
242 {
244 wxString( "Undefined library pin." );
245 aList.emplace_back( _( "Unit" ), msg );
246 }
247
248 if( libSymbol->HasAlternateBodyStyle() )
249 {
251 wxString( "Undefined library pin." );
252 aList.emplace_back( _( "Body Style" ), msg );
253 }
254 }
255
256 aList.emplace_back( _( "Name" ), GetShownName() );
257 aList.emplace_back( _( "Number" ), GetShownNumber() );
258 aList.emplace_back( _( "Type" ), ElectricalPinTypeGetText( GetType() ) );
259 aList.emplace_back( _( "Style" ), PinShapeGetText( GetShape() ) );
260
261 aList.emplace_back( _( "Visible" ), IsVisible() ? _( "Yes" ) : _( "No" ) );
262
263 aList.emplace_back( _( "Length" ), aFrame->MessageTextFromValue( GetLength() ), true );
264
265 aList.emplace_back( _( "Orientation" ), PinOrientationName( GetOrientation() ) );
266
267 SCH_EDIT_FRAME* schframe = dynamic_cast<SCH_EDIT_FRAME*>( aFrame );
268 SCH_SHEET_PATH* currentSheet = schframe ? &schframe->GetCurrentSheet() : nullptr;
269
270 // Don't use GetShownText(); we want to see the variable references here
271 aList.emplace_back( symbol->GetRef( currentSheet ),
272 UnescapeString( symbol->GetField( VALUE_FIELD )->GetText() ) );
273
274#if defined(DEBUG)
275 if( !IsConnectivityDirty() && dynamic_cast<SCH_EDIT_FRAME*>( aFrame ) )
276 {
277 SCH_CONNECTION* conn = Connection();
278
279 if( conn )
280 conn->AppendInfoToMsgPanel( aList );
281 }
282#endif
283
284}
285
286
287bool SCH_PIN::IsStacked( const SCH_PIN* aPin ) const
288{
289 return m_parent == aPin->GetParent()
291 && GetName() == aPin->GetName()
292 && ( ( GetType() == aPin->GetType() ) || ( GetType() == ELECTRICAL_PINTYPE::PT_PASSIVE )
293 || ( aPin->GetType() == ELECTRICAL_PINTYPE::PT_PASSIVE ) );
294}
295
296
298{
299 wxCHECK( m_libPin, false );
300
301 return m_libPin->IsGlobalPower();
302}
303
305{
306 std::lock_guard<std::recursive_mutex> lock( m_netmap_mutex );
307
308 if( aPath )
309 m_net_name_map.erase( *aPath );
310 else
311 m_net_name_map.clear();
312}
313
314
315wxString SCH_PIN::GetDefaultNetName( const SCH_SHEET_PATH& aPath, bool aForceNoConnect )
316{
317 // Need to check for parent as power symbol to make sure we aren't dealing
318 // with legacy global power pins on non-power symbols
319 if( IsGlobalPower() )
320 {
321 if( GetLibPin()->GetParent()->IsPower() )
322 {
323 return EscapeString( GetParentSymbol()->GetValueFieldText( true, &aPath, false ),
324 CTX_NETNAME );
325 }
326 else
327 {
328 wxString tmp = m_libPin ? m_libPin->GetName() : wxString( "??" );
329
330 return EscapeString( tmp, CTX_NETNAME );
331 }
332 }
333
334 std::lock_guard<std::recursive_mutex> lock( m_netmap_mutex );
335
336 auto it = m_net_name_map.find( aPath );
337
338 if( it != m_net_name_map.end() )
339 {
340 if( it->second.second == aForceNoConnect )
341 return it->second.first;
342 }
343
344 wxString name = "Net-(";
345 bool unconnected = false;
346
347 if( aForceNoConnect || GetType() == ELECTRICAL_PINTYPE::PT_NC )
348 {
349 unconnected = true;
350 name = ( "unconnected-(" );
351 }
352
353 bool annotated = true;
354
355 std::vector<SCH_PIN*> pins = GetParentSymbol()->GetPins( &aPath );
356 bool has_multiple = false;
357
358 for( SCH_PIN* pin : pins )
359 {
360 if( pin->GetShownName() == GetShownName()
361 && pin->GetShownNumber() != GetShownNumber()
362 && unconnected == ( pin->GetType() == ELECTRICAL_PINTYPE::PT_NC ) )
363 {
364 has_multiple = true;
365 break;
366 }
367 }
368
369 wxString libPinShownName = m_libPin ? m_libPin->GetShownName() : wxString( "??" );
370 wxString libPinShownNumber = m_libPin ? m_libPin->GetShownNumber() : wxString( "??" );
371
372 // Use timestamp for unannotated symbols
373 if( GetParentSymbol()->GetRef( &aPath, false ).Last() == '?' )
374 {
376
377 wxString libPinNumber = m_libPin ? m_libPin->GetNumber() : wxString( "??" );
378 name << "-Pad" << libPinNumber << ")";
379 annotated = false;
380 }
381 else if( !libPinShownName.IsEmpty() && ( libPinShownName != libPinShownNumber ) )
382 {
383 // Pin names might not be unique between different units so we must have the
384 // unit token in the reference designator
385 name << GetParentSymbol()->GetRef( &aPath, true );
386 name << "-" << EscapeString( libPinShownName, CTX_NETNAME );
387
388 if( unconnected || has_multiple )
389 name << "-Pad" << EscapeString( libPinShownNumber, CTX_NETNAME );
390
391 name << ")";
392 }
393 else
394 {
395 // Pin numbers are unique, so we skip the unit token
396 name << GetParentSymbol()->GetRef( &aPath, false );
397 name << "-Pad" << EscapeString( libPinShownNumber, CTX_NETNAME ) << ")";
398 }
399
400 if( annotated )
401 m_net_name_map[ aPath ] = std::make_pair( name, aForceNoConnect );
402
403 return name;
404}
405
406
408{
411}
412
413
414const BOX2I SCH_PIN::GetBoundingBox( bool aIncludeInvisiblePins, bool aIncludeNameAndNumber,
415 bool aIncludeElectricalType ) const
416{
418 BOX2I r;
419
420 if( m_libPin )
421 r = m_libPin->GetBoundingBox( aIncludeInvisiblePins, aIncludeNameAndNumber,
422 aIncludeElectricalType );
423 else
424 wxFAIL;
425
426 r.RevertYAxis();
427
428 r = t.TransformCoordinate( r );
430
431 return r;
432}
433
434
435bool SCH_PIN::HitTest( const VECTOR2I& aPosition, int aAccuracy ) const
436{
437 // When looking for an "exact" hit aAccuracy will be 0 which works poorly if the pin has
438 // no pin number or name. Give it a floor.
439 if( Schematic() )
440 aAccuracy = std::max( aAccuracy, Schematic()->Settings().m_PinSymbolSize / 4 );
441
442 BOX2I rect = GetBoundingBox( false, true, m_flags & SHOW_ELEC_TYPE );
443 return rect.Inflate( aAccuracy ).Contains( aPosition );
444}
445
446
447bool SCH_PIN::HitTest( const BOX2I& aRect, bool aContained, int aAccuracy ) const
448{
449 BOX2I sel = aRect;
450
451 if( aAccuracy )
452 sel.Inflate( aAccuracy );
453
454 if( aContained )
455 return sel.Contains( GetBoundingBox( false, false, false ) );
456
457 return sel.Intersects( GetBoundingBox( false, true, m_flags & SHOW_ELEC_TYPE ) );
458}
459
460
462{
463 return new SCH_PIN( *this );
464}
465
466
468{
469 wxCHECK( m_libPin, false );
470
471 // Reciprocal checking is done in CONNECTION_GRAPH anyway
472 return !( m_libPin->GetType() == ELECTRICAL_PINTYPE::PT_NC );
473}
474
475
476bool SCH_PIN::operator==( const SCH_ITEM& aOther ) const
477{
478 if( aOther.Type() != SCH_PIN_T )
479 return false;
480
481 const SCH_PIN& other = static_cast<const SCH_PIN&>( aOther );
482
483 if( m_number != other.m_number )
484 return false;
485
486 if( m_position != other.m_position )
487 return false;
488
489 return m_libPin == other.m_libPin;
490}
491
492
493double SCH_PIN::Similarity( const SCH_ITEM& aOther ) const
494{
495 if( m_Uuid == aOther.m_Uuid )
496 return 1.0;
497
498 if( aOther.Type() != SCH_PIN_T )
499 return 0.0;
500
501 const SCH_PIN& other = static_cast<const SCH_PIN&>( aOther );
502
503 if( m_number != other.m_number )
504 return 0.0;
505
506 if( m_position != other.m_position )
507 return 0.0;
508
509 return m_libPin ? m_libPin->Similarity( *other.m_libPin ) : 0.0;
510}
511
512
513static struct SCH_PIN_DESC
514{
516 {
520
521 propMgr.AddProperty( new PROPERTY<SCH_PIN, wxString>( _HKI( "Pin Name" ),
522 NO_SETTER( SCH_PIN, wxString ), &SCH_PIN::GetName ) );
523
524 propMgr.AddProperty( new PROPERTY<SCH_PIN, wxString>( _HKI( "Pin Number" ),
525 NO_SETTER( SCH_PIN, wxString ), &SCH_PIN::GetNumber ) );
526
527 propMgr.AddProperty( new PROPERTY<SCH_PIN, int>( _HKI( "Length" ),
528 NO_SETTER( SCH_PIN, int ), &SCH_PIN::GetLength, PROPERTY_DISPLAY::PT_SIZE ) );
529 }
const char * name
Definition: DXF_plotter.cpp:57
void Offset(coord_type dx, coord_type dy)
Definition: box2.h:225
void RevertYAxis()
Mirror the rectangle from the X axis (negate Y pos and size).
Definition: box2.h:690
bool Intersects(const BOX2< Vec > &aRect) const
Definition: box2.h:270
bool Contains(const Vec &aPoint) const
Definition: box2.h:142
BOX2< Vec > & Inflate(coord_type dx, coord_type dy)
Inflates the rectangle horizontally by dx and vertically by dy.
Definition: box2.h:507
The base class for create windows for drawing purpose.
A base class for most all the KiCad significant classes used in schematics and boards.
Definition: eda_item.h:85
const KIID m_Uuid
Definition: eda_item.h:482
KICAD_T Type() const
Returns the type of object.
Definition: eda_item.h:97
EDA_ITEM_FLAGS m_flags
Definition: eda_item.h:487
virtual bool Matches(const EDA_SEARCH_DATA &aSearchData, void *aAuxData) const
Compare the item against the search criteria in aSearchData.
Definition: eda_item.h:372
EDA_ITEM * GetParent() const
Definition: eda_item.h:99
EDA_ITEM * m_parent
Linked list: Link (parent struct)
Definition: eda_item.h:485
virtual const wxString & GetText() const
Return the string associated with the text object.
Definition: eda_text.h:95
wxString AsString() const
Definition: kiid.cpp:257
int GetBodyStyle() const
Definition: lib_item.h:346
int GetUnit() const
Definition: lib_item.h:343
static wxString GetUnitDescription(int aUnit)
Definition: lib_item.cpp:46
static wxString GetBodyStyleDescription(int aBodyStyle)
Definition: lib_item.cpp:55
bool IsGlobalPower() const
Return whether this pin forms a global power connection: i.e., is part of a power symbol and of type ...
Definition: lib_pin.h:207
int GetLength() const
Definition: lib_pin.h:74
ELECTRICAL_PINTYPE GetType() const
Definition: lib_pin.h:84
const BOX2I GetBoundingBox() const override
Definition: lib_pin.h:193
PIN_ORIENTATION GetOrientation() const
Definition: lib_pin.h:68
wxString GetShownNumber() const
Definition: lib_pin.h:118
wxString GetItemDescription(UNITS_PROVIDER *aUnitsProvider) const override
Return a user-visible description string of this item.
Definition: lib_pin.cpp:1405
wxString GetShownName() const
Definition: lib_pin.cpp:176
VECTOR2I GetPosition() const override
Definition: lib_pin.h:232
const wxString & GetNumber() const
Definition: lib_pin.h:117
GRAPHIC_PINSHAPE GetShape() const
Definition: lib_pin.h:71
bool IsVisible() const
Definition: lib_pin.h:97
ALT GetAlt(const wxString &aAlt)
Definition: lib_pin.h:144
const wxString & GetName() const
Definition: lib_pin.h:106
double Similarity(const LIB_ITEM &aItem) const override
Return a measure of how likely the other object is to represent the same object.
Definition: lib_pin.cpp:1529
Define a library symbol object.
Definition: lib_symbol.h:99
Provide class metadata.Helper macro to map type hashes to names.
Definition: property_mgr.h:85
void InheritsAfter(TYPE_ID aDerived, TYPE_ID aBase)
Declare an inheritance relationship between types.
static PROPERTY_MANAGER & Instance()
Definition: property_mgr.h:87
PROPERTY_BASE & AddProperty(PROPERTY_BASE *aProperty, const wxString &aGroup=wxEmptyString)
Register a property.
Each graphical item can have a SCH_CONNECTION describing its logical connection (to a bus or net).
void AppendInfoToMsgPanel(std::vector< MSG_PANEL_ITEM > &aList) const
Adds information about the connection object to aList.
Schematic editor (Eeschema) main window.
SCH_SHEET_PATH & GetCurrentSheet() const
Base class for any item which can be embedded within the SCHEMATIC container class,...
Definition: sch_item.h:151
SCH_ITEM & operator=(const SCH_ITEM &aPin)
Definition: sch_item.cpp:71
SCHEMATIC * Schematic() const
Searches the item hierarchy to find a SCHEMATIC.
Definition: sch_item.cpp:113
bool IsConnectivityDirty() const
Definition: sch_item.h:436
SCH_CONNECTION * Connection(const SCH_SHEET_PATH *aSheet=nullptr) const
Retrieve the connection associated with this object in the given sheet.
Definition: sch_item.cpp:147
SCH_LAYER_ID m_layer
Definition: sch_item.h:521
wxString GetItemDescription(UNITS_PROVIDER *aUnitsProvider) const override
Return a user-visible description string of this item.
Definition: sch_pin.cpp:213
int GetLength() const
Definition: sch_pin.cpp:157
bool Matches(const EDA_SEARCH_DATA &aSearchData, void *aAuxData) const override
Compare the item against the search criteria in aSearchData.
Definition: sch_pin.cpp:181
void GetMsgPanelInfo(EDA_DRAW_FRAME *aFrame, std::vector< MSG_PANEL_ITEM > &aList) override
Populate aList of MSG_PANEL_ITEM objects with it's internal state for display purposes.
Definition: sch_pin.cpp:232
const BOX2I ViewBBox() const override
Return the bounding box of the item covering all its layers.
Definition: sch_pin.cpp:165
void SetPosition(const VECTOR2I &aPosition) override
Definition: sch_pin.h:84
SCH_PIN & operator=(const SCH_PIN &aPin)
Definition: sch_pin.cpp:73
wxString GetShownNumber() const
Definition: sch_pin.cpp:118
std::map< const SCH_SHEET_PATH, std::pair< wxString, bool > > m_net_name_map
Definition: sch_pin.h:185
bool IsGlobalPower() const
Definition: sch_pin.cpp:297
bool IsVisible() const
Definition: sch_pin.cpp:87
bool ConnectionPropagatesTo(const EDA_ITEM *aItem) const override
Return true if this item should propagate connection info to aItem.
Definition: sch_pin.cpp:467
wxString GetName() const
Definition: sch_pin.cpp:95
bool operator==(const SCH_ITEM &aItem) const override
Definition: sch_pin.cpp:476
LIB_PIN * GetLibPin() const
Definition: sch_pin.h:59
bool m_isDangling
Definition: sch_pin.h:181
void ViewGetLayers(int aLayers[], int &aCount) const override
Return the layers the item is drawn on (which may be more than its "home" layer)
Definition: sch_pin.cpp:171
wxString GetNumber() const
Definition: sch_pin.h:142
std::recursive_mutex m_netmap_mutex
The name that this pin connection will drive onto a net.
Definition: sch_pin.h:184
PIN_ORIENTATION GetOrientation() const
Definition: sch_pin.cpp:149
VECTOR2I GetPosition() const override
Definition: sch_pin.h:82
LIB_PIN * m_libPin
Definition: sch_pin.h:176
SCH_PIN(LIB_PIN *aLibPin, SCH_SYMBOL *aParentSymbol)
Definition: sch_pin.cpp:32
bool Replace(const EDA_SEARCH_DATA &aSearchData, void *aAuxData) override
Perform a text replace using the find and replace criteria in aSearchData on items that support text ...
Definition: sch_pin.cpp:194
VECTOR2I m_position
Definition: sch_pin.h:180
const VECTOR2I GetLocalPosition() const
Definition: sch_pin.h:83
double Similarity(const SCH_ITEM &aItem) const override
Return a measure of how likely the other object is to represent the same object.
Definition: sch_pin.cpp:493
wxString GetShownName() const
Definition: sch_pin.cpp:104
bool HitTest(const VECTOR2I &aPosition, int aAccuracy=0) const override
Test if aPosition is inside or on the boundary of this item.
Definition: sch_pin.cpp:435
wxString m_alt
Definition: sch_pin.h:179
VECTOR2I GetTransformedPosition() const
Definition: sch_pin.cpp:407
void ClearDefaultNetName(const SCH_SHEET_PATH *aPath)
Definition: sch_pin.cpp:304
bool IsStacked(const SCH_PIN *aPin) const
Definition: sch_pin.cpp:287
wxString m_number
Definition: sch_pin.h:178
SCH_SYMBOL * GetParentSymbol() const
Definition: sch_pin.cpp:207
EDA_ITEM * Clone() const override
Create a duplicate of this item with linked list members set to NULL.
Definition: sch_pin.cpp:461
const BOX2I GetBoundingBox() const override
Return the orthogonal bounding box of this object for display purposes.
Definition: sch_pin.h:87
wxString GetDefaultNetName(const SCH_SHEET_PATH &aPath, bool aForceNoConnect=false)
Definition: sch_pin.cpp:315
GRAPHIC_PINSHAPE GetShape() const
Definition: sch_pin.cpp:138
ELECTRICAL_PINTYPE GetType() const
Definition: sch_pin.cpp:127
Handle access to a stack of flattened SCH_SHEET objects by way of a path for creating a flattened sch...
Schematic symbol object.
Definition: sch_symbol.h:109
const wxString GetRef(const SCH_SHEET_PATH *aSheet, bool aIncludeUnit=false) const
Return the reference for the given sheet path.
Definition: sch_symbol.cpp:748
SCH_FIELD * GetField(MANDATORY_FIELD_T aFieldType)
Return a mandatory field in this symbol.
Definition: sch_symbol.cpp:950
std::vector< SCH_PIN * > GetPins(const SCH_SHEET_PATH *aSheet=nullptr) const
Retrieve a list of the SCH_PINs for the given sheet path.
VECTOR2I GetPosition() const override
Definition: sch_symbol.h:812
TRANSFORM & GetTransform()
Definition: sch_symbol.h:314
std::unique_ptr< LIB_SYMBOL > & GetLibSymbolRef()
Definition: sch_symbol.h:222
for transforming drawing coordinates for a wxDC device context.
Definition: transform.h:46
VECTOR2I TransformCoordinate(const VECTOR2I &aPoint) const
Calculate a new coordinate according to the mirror/rotation transform.
Definition: transform.cpp:44
wxString MessageTextFromValue(double aValue, bool aAddUnitLabel=true, EDA_DATA_TYPE aType=EDA_DATA_TYPE::DISTANCE) const
A lower-precision version of StringFromValue().
#define _HKI(x)
#define _(s)
#define SHOW_ELEC_TYPE
Show pin electrical type. Shared with IS_ROLLOVER.
@ LAYER_DANGLING
Definition: layer_ids.h:379
@ LAYER_DEVICE
Definition: layer_ids.h:368
@ LAYER_PIN
Definition: layer_ids.h:372
@ LAYER_OP_CURRENTS
Definition: layer_ids.h:400
@ LAYER_SELECTION_SHADOWS
Definition: layer_ids.h:393
wxString ElectricalPinTypeGetText(ELECTRICAL_PINTYPE aType)
Definition: pin_type.cpp:207
wxString PinShapeGetText(GRAPHIC_PINSHAPE aShape)
Definition: pin_type.cpp:245
wxString PinOrientationName(PIN_ORIENTATION aOrientation)
Definition: pin_type.cpp:265
ELECTRICAL_PINTYPE
The symbol library pin object electrical types used in ERC tests.
Definition: pin_type.h:36
PIN_ORIENTATION
The symbol library pin object orientations.
Definition: pin_type.h:75
GRAPHIC_PINSHAPE
Definition: pin_type.h:56
#define TYPE_HASH(x)
Definition: property.h:67
#define NO_SETTER(owner, type)
Definition: property.h:764
#define REGISTER_TYPE(x)
Definition: property_mgr.h:366
static struct SCH_PIN_DESC _SCH_PIN_DESC
Definition of the SCH_SHEET_PATH and SCH_SHEET_LIST classes for Eeschema.
wxString UnescapeString(const wxString &aSource)
wxString EscapeString(const wxString &aSource, ESCAPE_CONTEXT aContext)
The Escape/Unescape routines use HTML-entity-reference-style encoding to handle characters which are:...
@ CTX_NETNAME
Definition: string_utils.h:53
GRAPHIC_PINSHAPE m_Shape
Definition: lib_pin.h:47
ELECTRICAL_PINTYPE m_Type
Definition: lib_pin.h:48
@ VALUE_FIELD
Field Value of part, i.e. "3.3K".
@ REFERENCE_FIELD
Field Reference of part, i.e. "IC21".
@ SCH_PIN_T
Definition: typeinfo.h:159