KiCad PCB EDA Suite
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages Concepts
net_navigator.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) 2023 Rivos
5 * Copyright The KiCad Developers, see AUTHORS.txt for contributors.
6 *
7 * @author Wayne Stambaugh <stambaughw@gmail.com>
8 *
9 * This program is free software: you can redistribute it and/or modify it
10 * under the terms of the GNU General Public License as published by the
11 * Free Software Foundation, either version 3 of the License, or (at your
12 * option) any later version.
13 *
14 * This program is distributed in the hope that it will be useful, but
15 * WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 * General Public License for more details.
18 *
19 * You should have received a copy of the GNU General Public License along
20 * with this program. If not, see <http://www.gnu.org/licenses/>.
21 */
22
23#include <wx/log.h>
24#include <core/profile.h>
25#include <tool/tool_manager.h>
26#include <kiface_base.h>
27#include <sch_edit_frame.h>
28#include <sch_bus_entry.h>
29#include <sch_line.h>
30#include <sch_junction.h>
31#include <sch_no_connect.h>
32#include <sch_sheet_pin.h>
33#include <schematic.h>
34#include <string_utils.h>
35#include <trace_helpers.h>
36#include <connection_graph.h>
38#include <tools/sch_actions.h>
39
40
41static wxString GetNetNavigatorItemText( const SCH_ITEM* aItem,
42 const SCH_SHEET_PATH& aSheetPath,
43 UNITS_PROVIDER* aUnitsProvider )
44{
45 wxString retv;
46
47 wxCHECK( aItem && aUnitsProvider, retv );
48
49 switch( aItem->Type() )
50 {
51 case SCH_LINE_T:
52 {
53 const SCH_LINE* line = static_cast<const SCH_LINE*>( aItem );
54
55 if( aItem->GetLayer() == LAYER_WIRE )
56 {
57 retv.Printf( _( "Wire from %s, %s to %s, %s" ),
58 aUnitsProvider->MessageTextFromValue( line->GetStartPoint().x ),
59 aUnitsProvider->MessageTextFromValue( line->GetStartPoint().y ),
60 aUnitsProvider->MessageTextFromValue( line->GetEndPoint().x ),
61 aUnitsProvider->MessageTextFromValue( line->GetEndPoint().y ) );
62 }
63 else if( aItem->GetLayer() == LAYER_BUS )
64 {
65 retv.Printf( _( "Bus from %s, %s to %s, %s" ),
66 aUnitsProvider->MessageTextFromValue( line->GetStartPoint().x ),
67 aUnitsProvider->MessageTextFromValue( line->GetStartPoint().y ),
68 aUnitsProvider->MessageTextFromValue( line->GetEndPoint().x ),
69 aUnitsProvider->MessageTextFromValue( line->GetEndPoint().y ) );
70 }
71 else
72 {
73 retv = _( "Graphic line not connectable" );
74 }
75
76 break;
77 }
78 case SCH_PIN_T:
79 {
80 const SCH_PIN* pin = static_cast<const SCH_PIN*>( aItem );
81
82 if( const SYMBOL* symbol = pin->GetParentSymbol() )
83 {
84 retv.Printf( _( "Symbol '%s' pin '%s'" ),
85 symbol->GetRef( &aSheetPath, true ),
86 UnescapeString( pin->GetNumber() ) );
87
88 if( wxString pinName = UnescapeString( pin->GetShownName() ); !pinName.IsEmpty() )
89 {
90 retv += wxString::Format( " (%s)", pinName );
91 }
92 }
93
94 break;
95 }
96 case SCH_SHEET_PIN_T:
97 {
98 const SCH_SHEET_PIN* pin = static_cast<const SCH_SHEET_PIN*>( aItem );
99
100 if( SCH_SHEET* sheet = pin->GetParent() )
101 {
102 retv.Printf( _( "Sheet '%s' pin '%s'" ),
103 sheet->GetName(),
104 UnescapeString( pin->GetText() ) );
105 }
106
107 break;
108 }
109 case SCH_LABEL_T:
110 {
111 const SCH_LABEL* label = static_cast<const SCH_LABEL*>( aItem );
112
113 retv.Printf( _( "Label '%s' at %s, %s" ),
114 UnescapeString( label->GetText() ),
115 aUnitsProvider->MessageTextFromValue( label->GetPosition().x ),
116 aUnitsProvider->MessageTextFromValue( label->GetPosition().y ) );
117 break;
118 }
120 {
121 const SCH_GLOBALLABEL* label = static_cast<const SCH_GLOBALLABEL*>( aItem );
122
123 retv.Printf( _( "Global label '%s' at %s, %s" ),
124 UnescapeString( label->GetText() ),
125 aUnitsProvider->MessageTextFromValue( label->GetPosition().x ),
126 aUnitsProvider->MessageTextFromValue( label->GetPosition().y ) );
127 break;
128 }
129 case SCH_HIER_LABEL_T:
130 {
131 const SCH_HIERLABEL* label = static_cast<const SCH_HIERLABEL*>( aItem );
132
133 retv.Printf( _( "Hierarchical label '%s' at %s, %s" ),
134 UnescapeString( label->GetText() ),
135 aUnitsProvider->MessageTextFromValue( label->GetPosition().x ),
136 aUnitsProvider->MessageTextFromValue( label->GetPosition().y ) );
137 break;
138 }
139 case SCH_JUNCTION_T:
140 {
141 const SCH_JUNCTION* junction = static_cast<const SCH_JUNCTION*>( aItem );
142
143 retv.Printf( _( "Junction at %s, %s" ),
144 aUnitsProvider->MessageTextFromValue( junction->GetPosition().x ),
145 aUnitsProvider->MessageTextFromValue( junction->GetPosition().y ) );
146 break;
147 }
148 case SCH_NO_CONNECT_T:
149 {
150 const SCH_NO_CONNECT* nc = static_cast<const SCH_NO_CONNECT*>( aItem );
151
152 retv.Printf( _( "No-Connect at %s, %s" ),
153 aUnitsProvider->MessageTextFromValue( nc->GetPosition().x ),
154 aUnitsProvider->MessageTextFromValue( nc->GetPosition().y ) );
155 break;
156 }
158 {
159 const SCH_BUS_WIRE_ENTRY* entry = static_cast<const SCH_BUS_WIRE_ENTRY*>( aItem );
160
161 retv.Printf( _( "Bus to wire entry from %s, %s to %s, %s" ),
162 aUnitsProvider->MessageTextFromValue( entry->GetPosition().x ),
163 aUnitsProvider->MessageTextFromValue( entry->GetPosition().y ),
164 aUnitsProvider->MessageTextFromValue( entry->GetEnd().x ),
165 aUnitsProvider->MessageTextFromValue( entry->GetEnd().y ) );
166 break;
167 }
169 {
170 const SCH_BUS_BUS_ENTRY* entry = static_cast<const SCH_BUS_BUS_ENTRY*>( aItem );
171
172 retv.Printf( _( "Bus to bus entry from %s, %s to %s, %s" ),
173 aUnitsProvider->MessageTextFromValue( entry->GetPosition().x ),
174 aUnitsProvider->MessageTextFromValue( entry->GetPosition().y ),
175 aUnitsProvider->MessageTextFromValue( entry->GetEnd().x ),
176 aUnitsProvider->MessageTextFromValue( entry->GetEnd().y ) );
177 break;
178 }
180 {
181 const SCH_DIRECTIVE_LABEL* entry = static_cast<const SCH_DIRECTIVE_LABEL*>( aItem );
182
183 retv.Printf( _( "Netclass label '%s' at %s, %s" ),
184 UnescapeString( entry->GetText() ),
185 aUnitsProvider->MessageTextFromValue( entry->GetPosition().x ),
186 aUnitsProvider->MessageTextFromValue( entry->GetPosition().y ) );
187 break;
188 }
189 default:
190 retv.Printf( _( "Unhandled item type %d" ), aItem->Type() );
191 }
192
193 return retv;
194}
195
196
197void SCH_EDIT_FRAME::MakeNetNavigatorNode( const wxString& aNetName, wxTreeItemId aParentId,
198 const NET_NAVIGATOR_ITEM_DATA* aSelection,
199 bool aSingleSheetSchematic )
200{
201 wxCHECK( !aNetName.IsEmpty(), /* void */ );
202 wxCHECK( m_schematic, /* void */ );
203 wxCHECK( m_netNavigator, /* void */ );
204
205 wxTreeItemId expandId = aParentId;
206 CONNECTION_GRAPH* connectionGraph = m_schematic->ConnectionGraph();
207
208 wxCHECK( connectionGraph, /* void */ );
209
210 wxString sheetPathPrefix;
211 std::set<CONNECTION_SUBGRAPH*> subgraphs;
212
213 {
214 const std::vector<CONNECTION_SUBGRAPH*>& tmp = connectionGraph->GetAllSubgraphs( aNetName );
215 subgraphs.insert( tmp.begin(), tmp.end() );
216 }
217
218 for( CONNECTION_SUBGRAPH* sg : subgraphs )
219 {
220 for( const auto& [_, bus_sgs] : sg->GetBusParents() )
221 {
222 for( const CONNECTION_SUBGRAPH* bus_sg : bus_sgs )
223 {
224 const std::vector<CONNECTION_SUBGRAPH*>& tmp =
225 connectionGraph->GetAllSubgraphs( bus_sg->GetNetName() );
226 subgraphs.insert( tmp.begin(), tmp.end() );
227 }
228 }
229 }
230
231 std::map<wxString, wxTreeItemId> sheetIds;
232
233 for( const CONNECTION_SUBGRAPH* subGraph : subgraphs )
234 {
235 NET_NAVIGATOR_ITEM_DATA* itemData = nullptr;
236 SCH_SHEET_PATH sheetPath = subGraph->GetSheet();
237
238 wxCHECK2( subGraph && sheetPath.Last(), continue );
239
240 if( subGraph->GetItems().empty() )
241 continue;
242
243 itemData = new NET_NAVIGATOR_ITEM_DATA( sheetPath, nullptr );
244
245 bool stripTrailingSeparator = !sheetPath.Last()->IsRootSheet();
246 wxString txt = sheetPath.PathHumanReadable( true, stripTrailingSeparator );
247
248 wxTreeItemId sheetId;
249
250 if( auto sheetIdIt = sheetIds.find( txt ); sheetIdIt != sheetIds.end() )
251 {
252 sheetId = sheetIdIt->second;
253 }
254 else
255 {
256 sheetIds[txt] = m_netNavigator->AppendItem( aParentId, txt, -1, -1, itemData );
257 sheetId = sheetIds[txt];
258 }
259
260 if( aSelection && *aSelection == *itemData )
261 m_netNavigator->SelectItem( sheetId );
262
263 // If there is only one sheet in the schematic, always expand the sheet tree.
264 if( aSingleSheetSchematic )
265 expandId = sheetId;
266
267 for( const SCH_ITEM* item : subGraph->GetItems() )
268 {
269 if( item->Type() == SCH_LINE_T
270 || item->Type() == SCH_JUNCTION_T
271 || item->Type() == SCH_BUS_WIRE_ENTRY_T
272 || item->Type() == SCH_BUS_BUS_ENTRY_T )
273 {
274 continue;
275 }
276
277 itemData = new NET_NAVIGATOR_ITEM_DATA( sheetPath, item );
278 wxTreeItemId id = m_netNavigator->AppendItem( sheetId,
279 GetNetNavigatorItemText( item, sheetPath, this ),
280 -1, -1, itemData );
281
282 if( aSelection && *aSelection == *itemData )
283 {
284 expandId = sheetId;
285 m_netNavigator->EnsureVisible( id );
286 m_netNavigator->SelectItem( id );
287 }
288 }
289
290 m_netNavigator->SortChildren( sheetId );
291 }
292
293 // Sort the items in the tree control alphabetically
294 m_netNavigator->SortChildren( aParentId );
295 m_netNavigator->Expand( aParentId );
296}
297
298
300{
301 wxCHECK( m_netNavigator, /* void */ );
302
303 if( !m_netNavigator->IsShown() )
304 return;
305
306 bool singleSheetSchematic = m_schematic->Hierarchy().size() == 1;
307 size_t nodeCnt = 0;
308
309 m_netNavigator->Freeze();
310
311 PROF_TIMER timer;
312
313 if( m_highlightedConn.IsEmpty() )
314 {
315 m_netNavigator->DeleteAllItems();
316
317 // Create a tree of all nets in the schematic.
318 wxTreeItemId rootId = m_netNavigator->AddRoot( _( "Nets" ), 0 );
319
320 const NET_MAP& netMap = m_schematic->ConnectionGraph()->GetNetMap();
321
322 for( const auto& net : netMap )
323 {
324 // Skip bus member subgraphs for the moment.
325 if( net.first.Name.IsEmpty() )
326 continue;
327
328 nodeCnt++;
329 wxTreeItemId netId = m_netNavigator->AppendItem( rootId,
330 UnescapeString( net.first.Name ) );
331 MakeNetNavigatorNode( net.first.Name, netId, aSelection, singleSheetSchematic );
332 }
333
334 m_netNavigator->Expand( rootId );
335 }
336 else if( !m_netNavigator->IsEmpty() )
337 {
338 const wxString shownNetName = m_netNavigator->GetItemText( m_netNavigator->GetRootItem() );
339
340 if( shownNetName != m_highlightedConn )
341 {
342 m_netNavigator->DeleteAllItems();
343
344 nodeCnt++;
345
346 wxTreeItemId rootId = m_netNavigator->AddRoot( UnescapeString( m_highlightedConn ), 0 );
347
348 MakeNetNavigatorNode( m_highlightedConn, rootId, aSelection, singleSheetSchematic );
349 }
350 else
351 {
352 NET_NAVIGATOR_ITEM_DATA* itemData = nullptr;
353
354 wxTreeItemId selection = m_netNavigator->GetSelection();
355
356 if( selection.IsOk() )
357 itemData = dynamic_cast<NET_NAVIGATOR_ITEM_DATA*>( m_netNavigator->GetItemData( selection ) );
358
359 m_netNavigator->DeleteAllItems();
360 nodeCnt++;
361
362 wxTreeItemId rootId = m_netNavigator->AddRoot( UnescapeString( m_highlightedConn ), 0 );
363
364 MakeNetNavigatorNode( m_highlightedConn, rootId, itemData, singleSheetSchematic );
365 }
366 }
367 else
368 {
369 nodeCnt++;
370
371 wxTreeItemId rootId = m_netNavigator->AddRoot( UnescapeString( m_highlightedConn ), 0 );
372
373 MakeNetNavigatorNode( m_highlightedConn, rootId, aSelection, singleSheetSchematic );
374 }
375
376 timer.Stop();
377
378 wxLogTrace( traceUiProfile, wxS( "Adding %zu nodes to net navigator took %s." ),
379 nodeCnt, timer.to_string() );
380
381 m_netNavigator->Thaw();
382}
383
384
386{
387 wxCHECK( m_netNavigator, nullptr );
388
389 wxTreeItemId id = m_netNavigator->GetSelection();
390
391 if( !id.IsOk() )
392 return nullptr;
393
394 wxTreeItemId nextId;
395 wxTreeItemId netNode = m_netNavigator->GetRootItem();
396
397 std::vector<wxTreeItemId> netItems;
398 std::list<wxTreeItemId> itemList;
399 itemList.push_back( netNode );
400
401 while( !itemList.empty() )
402 {
403 wxTreeItemId current = itemList.front();
404 itemList.pop_front();
405
406 wxTreeItemIdValue cookie;
407 wxTreeItemId child = m_netNavigator->GetFirstChild( current, cookie );
408
409 while( child.IsOk() )
410 {
411 if( m_netNavigator->ItemHasChildren( child ) )
412 itemList.push_back( child );
413 else
414 netItems.push_back( child );
415
416 child = m_netNavigator->GetNextSibling( child );
417 }
418 }
419
420 // Locate current item and move forward or backward with wrap
421 auto it = std::find( netItems.begin(), netItems.end(), id );
422
423 if( it != netItems.end() )
424 {
425 if( aNext )
426 {
427 ++it;
428 if( it == netItems.end() )
429 it = netItems.begin();
430 }
431 else
432 {
433 if( it == netItems.begin() )
434 it = netItems.end();
435 --it;
436 }
437 nextId = *it;
438 }
439
440 if( nextId.IsOk() )
441 {
442 if( !m_netNavigator->IsVisible( nextId ) )
443 {
444 m_netNavigator->CollapseAll();
445 m_netNavigator->EnsureVisible( nextId );
446 }
447
448 m_netNavigator->SelectItem( nextId );
449
450 auto* data = static_cast<NET_NAVIGATOR_ITEM_DATA*>( m_netNavigator->GetItemData( nextId ) );
451
452 if( data && data->GetItem() )
453 return data->GetItem();
454 }
455
456 return nullptr;
457}
458
459
461{
462 wxCHECK( m_netNavigator && !m_netNavigator->IsFrozen(), /* void */ );
463
464 // Maybe in the future we can do something like collapse the tree for an empty selection.
465 // For now, leave the tree selection in its current state.
466 if( !aSelection )
467 return;
468
469 wxTreeItemIdValue sheetCookie;
470 NET_NAVIGATOR_ITEM_DATA* itemData = nullptr;
471 wxTreeItemId rootId = m_netNavigator->GetRootItem();
472 wxTreeItemId sheetId = m_netNavigator->GetFirstChild( rootId, sheetCookie );
473
474 while( sheetId.IsOk() )
475 {
476 if( m_netNavigator->ItemHasChildren( sheetId ) )
477 {
478 wxTreeItemIdValue itemCookie;
479 wxTreeItemId itemId = m_netNavigator->GetFirstChild( sheetId, itemCookie );
480
481 while( itemId.IsOk() )
482 {
483 itemData = dynamic_cast<NET_NAVIGATOR_ITEM_DATA*>( m_netNavigator->GetItemData( itemId ) );
484
485 wxCHECK2( itemData, continue );
486
487 if( *itemData == *aSelection )
488 {
489 if( !m_netNavigator->IsVisible( itemId ) )
490 {
491 m_netNavigator->CollapseAll();
492 m_netNavigator->EnsureVisible( itemId );
493 }
494
495 m_netNavigator->SelectItem( itemId );
496 return;
497 }
498
499 itemId = m_netNavigator->GetNextSibling( itemId );
500 }
501
502 sheetId = m_netNavigator->GetNextSibling( sheetId );
503 }
504 }
505}
506
507
509{
510 if( !m_netNavigator || m_netNavigator->IsFrozen() )
511 return nullptr;
512
513 wxTreeItemId id = m_netNavigator->GetSelection();
514
515 if( !id.IsOk() || ( id == m_netNavigator->GetRootItem() ) )
516 return nullptr;
517
518 auto* itemData = dynamic_cast<NET_NAVIGATOR_ITEM_DATA*>( m_netNavigator->GetItemData( id ) );
519
520 wxCHECK( itemData, nullptr );
521
522 return itemData->GetItem();
523}
524
525
527{
528 wxCHECK( m_netNavigator && !m_netNavigator->IsFrozen(), /* void */ );
529
530 wxTreeItemId id = aEvent.GetItem();
531
532 // Clicking on the root item (net name ) does nothing.
533 if( id == m_netNavigator->GetRootItem() )
534 return;
535
536 auto* itemData = dynamic_cast<NET_NAVIGATOR_ITEM_DATA*>( m_netNavigator->GetItemData( id ) );
537
538 // Just a net name when we have all nets displayed.
539 if( !itemData )
540 return;
541
542 if( GetCurrentSheet() != itemData->GetSheetPath() )
543 {
545 &itemData->GetSheetPath() );
546 }
547
548 // Do not focus on item when a sheet tree node is selected.
549 if( m_netNavigator->GetItemParent( id ) != m_netNavigator->GetRootItem()
550 && itemData->GetItem() )
551 {
552 // Make sure we didn't remove the item and/or the screen it resides on before we access it.
553 const SCH_ITEM* item = itemData->GetItem();
554
555 // Don't search for child items in screen r-tree.
556 item = ( item->Type() == SCH_SHEET_PIN_T || item->Type() == SCH_PIN_T )
557 ? static_cast<const SCH_ITEM*>( item->GetParent() )
558 : item;
559
560 const SCH_SCREEN* screen = itemData->GetSheetPath().LastScreen();
561
562 wxCHECK( screen, /* void */ );
563 wxCHECK( screen->Items().contains( item, true ), /* void */ );
564
565 FocusOnLocation( itemData->GetItem()->GetBoundingBox().Centre() );
566 }
567
568 GetCanvas()->Refresh();
569}
570
571
573{
574 wxCHECK( m_netNavigator && !m_netNavigator->IsFrozen(), /* void */ );
575
576 aEvent.Skip();
577}
578
579
581{
583
584 wxCHECK( cfg, /* void */ );
585
586 wxAuiPaneInfo& netNavigatorPane = m_auimgr.GetPane( NetNavigatorPaneName() );
587
588 netNavigatorPane.Show( !netNavigatorPane.IsShown() );
590
591 cfg->m_AuiPanels.show_net_nav_panel = netNavigatorPane.IsShown();
592
593 if( netNavigatorPane.IsShown() )
594 {
595 if( netNavigatorPane.IsFloating() )
596 {
597 netNavigatorPane.FloatingSize( cfg->m_AuiPanels.net_nav_panel_float_size );
598 m_auimgr.Update();
599 }
600 else if( cfg->m_AuiPanels.net_nav_panel_docked_size.GetWidth() > 0 )
601 {
602 // SetAuiPaneSize also updates m_auimgr
603 SetAuiPaneSize( m_auimgr, netNavigatorPane,
604 cfg->m_AuiPanels.net_nav_panel_docked_size.GetWidth(), -1 );
605 }
606 }
607 else
608 {
609 NET_NAVIGATOR_ITEM_DATA* itemData = nullptr;
610
611 wxTreeItemId selection = m_netNavigator->GetSelection();
612
613 if( selection.IsOk() )
614 itemData = dynamic_cast<NET_NAVIGATOR_ITEM_DATA*>( m_netNavigator->GetItemData( selection ) );
615
616 RefreshNetNavigator( itemData );
617
618 if( netNavigatorPane.IsFloating() )
619 {
620 cfg->m_AuiPanels.net_nav_panel_float_size = netNavigatorPane.floating_size;
621 }
622 else
623 {
625 }
626
627 m_auimgr.Update();
628 }
629}
630
631
632void SCH_EDIT_FRAME::onResizeNetNavigator( wxSizeEvent& aEvent )
633{
634 aEvent.Skip();
635
636 // Called when resizing the Hierarchy Navigator panel
637 // Store the current pane size
638 // It allows to retrieve the last defined pane size when switching between
639 // docked and floating pane state
640 // Note: *DO NOT* call m_auimgr.Update() here: it crashes KiCad at least on Windows
641
642 EESCHEMA_SETTINGS* cfg = dynamic_cast<EESCHEMA_SETTINGS*>( Kiface().KifaceSettings() );
643
644 wxCHECK( cfg, /* void */ );
645
646 wxAuiPaneInfo& netNavigatorPane = m_auimgr.GetPane( NetNavigatorPaneName() );
647
648 if( m_netNavigator->IsShownOnScreen() )
649 {
650 cfg->m_AuiPanels.net_nav_panel_float_size = netNavigatorPane.floating_size;
651
652 // initialize net_nav_panel_docked_width and best size only if the netNavigatorPane
653 // width is > 0 (i.e. if its size is already set and has meaning)
654 // if it is floating, its size is not initialized (only floating_size is initialized)
655 // initializing netNavigatorPane.best_size is useful when switching to float pane and
656 // after switching to the docked pane, to retrieve the last docked pane width
657 if( netNavigatorPane.rect.width > 50 ) // 50 is a good margin
658 {
659 cfg->m_AuiPanels.net_nav_panel_docked_size.SetWidth( netNavigatorPane.rect.width );
660 netNavigatorPane.best_size.x = netNavigatorPane.rect.width;
661 }
662 }
663}
KIFACE_BASE & Kiface()
Global KIFACE_BASE "get" accessor.
Calculate the connectivity of a schematic and generates netlists.
const NET_MAP & GetNetMap() const
const std::vector< CONNECTION_SUBGRAPH * > & GetAllSubgraphs(const wxString &aNetName) const
A subgraph is a set of items that are electrically connected on a single sheet.
wxAuiManager m_auimgr
void FocusOnLocation(const VECTOR2I &aPos)
Useful to focus on a particular location, in find functions.
virtual void Refresh(bool aEraseBackground=true, const wxRect *aRect=nullptr) override
KICAD_T Type() const
Returns the type of object.
Definition: eda_item.h:108
EDA_ITEM * GetParent() const
Definition: eda_item.h:110
virtual const wxString & GetText() const
Return the string associated with the text object.
Definition: eda_text.h:98
bool contains(const SCH_ITEM *aItem, bool aRobust=false) const
Determine if a given item exists in the tree.
Definition: sch_rtree.h:128
APP_SETTINGS_BASE * KifaceSettings() const
Definition: kiface_base.h:95
Tree view item data for the net navigator.
const SCH_ITEM * GetItem() const
A small class to help profiling.
Definition: profile.h:49
void Stop()
Save the time when this function was called, and set the counter stane to stop.
Definition: profile.h:88
std::string to_string()
Definition: profile.h:155
SCH_SHEET_LIST Hierarchy() const
Return the full schematic flattened hierarchical sheet list.
Definition: schematic.cpp:208
CONNECTION_GRAPH * ConnectionGraph() const
Definition: schematic.h:158
static TOOL_ACTION changeSheet
Definition: sch_actions.h:216
SCH_DRAW_PANEL * GetCanvas() const override
Return a pointer to GAL-based canvas of given EDA draw frame.
EESCHEMA_SETTINGS * eeconfig() const
Class for a bus to bus entry.
VECTOR2I GetPosition() const override
VECTOR2I GetEnd() const
Class for a wire to bus entry.
wxTreeCtrl * m_netNavigator
void ToggleNetNavigator()
void onResizeNetNavigator(wxSizeEvent &aEvent)
void updateSelectionFilterVisbility() override
Selection filter panel doesn't have a dedicated visibility control, so show it if any other AUI panel...
void onNetNavigatorSelChanging(wxTreeEvent &aEvent)
void MakeNetNavigatorNode(const wxString &aNetName, wxTreeItemId aParentId, const NET_NAVIGATOR_ITEM_DATA *aSelection, bool aSingleSheetSchematic)
SCHEMATIC * m_schematic
The currently loaded schematic.
SCH_SHEET_PATH & GetCurrentSheet() const
const SCH_ITEM * GetSelectedNetNavigatorItem() const
void RefreshNetNavigator(const NET_NAVIGATOR_ITEM_DATA *aSelection=nullptr)
const SCH_ITEM * SelectNextPrevNetNavigatorItem(bool aNext)
void SelectNetNavigatorItem(const NET_NAVIGATOR_ITEM_DATA *aSelection=nullptr)
wxString m_highlightedConn
The highlighted net or bus or empty string.
static const wxString NetNavigatorPaneName()
void onNetNavigatorSelection(wxTreeEvent &aEvent)
Base class for any item which can be embedded within the SCHEMATIC container class,...
Definition: sch_item.h:167
SCH_LAYER_ID GetLayer() const
Return the layer this item is on.
Definition: sch_item.h:291
VECTOR2I GetPosition() const override
Definition: sch_junction.h:107
Segment description base class to describe items which have 2 end points (track, wire,...
Definition: sch_line.h:41
VECTOR2I GetEndPoint() const
Definition: sch_line.h:143
VECTOR2I GetStartPoint() const
Definition: sch_line.h:138
VECTOR2I GetPosition() const override
EE_RTREE & Items()
Get the full RTree, usually for iterating.
Definition: sch_screen.h:112
Handle access to a stack of flattened SCH_SHEET objects by way of a path for creating a flattened sch...
const SCH_SHEET * GetSheet(unsigned aIndex) const
wxString PathHumanReadable(bool aUseShortRootName=true, bool aStripTrailingSeparator=false) const
Return the sheet path in a human readable form made from the sheet names.
SCH_SHEET * Last() const
Return a pointer to the last SCH_SHEET of the list.
Define a sheet pin (label) used in sheets to create hierarchical schematics.
Definition: sch_sheet_pin.h:66
Sheet symbol placed in a schematic, and is the entry point for a sub schematic.
Definition: sch_sheet.h:47
bool IsRootSheet() const
Definition: sch_sheet.cpp:169
VECTOR2I GetPosition() const override
Definition: sch_text.h:139
A base class for LIB_SYMBOL and SCH_SYMBOL.
Definition: symbol.h:63
TOOL_MANAGER * GetToolManager() const
Return the MVC controller.
Definition: tools_holder.h:55
bool RunAction(const std::string &aActionName, T aParam)
Run the specified action immediately, pausing the current action to run the new one.
Definition: tool_manager.h:150
wxString MessageTextFromValue(double aValue, bool aAddUnitLabel=true, EDA_DATA_TYPE aType=EDA_DATA_TYPE::DISTANCE) const
A lower-precision version of StringFromValue().
std::unordered_map< NET_NAME_CODE_CACHE_KEY, std::vector< CONNECTION_SUBGRAPH * > > NET_MAP
Associate a #NET_CODE_NAME with all the subgraphs in that net.
#define _(s)
const wxChar *const traceUiProfile
Flag to enable user interface profile tracing.
@ LAYER_WIRE
Definition: layer_ids.h:441
@ LAYER_BUS
Definition: layer_ids.h:442
static wxString GetNetNavigatorItemText(const SCH_ITEM *aItem, const SCH_SHEET_PATH &aSheetPath, UNITS_PROVIDER *aUnitsProvider)
wxString UnescapeString(const wxString &aSource)
wxLogTrace helper definitions.
@ SCH_LINE_T
Definition: typeinfo.h:163
@ SCH_NO_CONNECT_T
Definition: typeinfo.h:160
@ SCH_DIRECTIVE_LABEL_T
Definition: typeinfo.h:171
@ SCH_LABEL_T
Definition: typeinfo.h:167
@ SCH_HIER_LABEL_T
Definition: typeinfo.h:169
@ SCH_BUS_BUS_ENTRY_T
Definition: typeinfo.h:162
@ SCH_SHEET_PIN_T
Definition: typeinfo.h:174
@ SCH_BUS_WIRE_ENTRY_T
Definition: typeinfo.h:161
@ SCH_GLOBAL_LABEL_T
Definition: typeinfo.h:168
@ SCH_JUNCTION_T
Definition: typeinfo.h:159
@ SCH_PIN_T
Definition: typeinfo.h:153
void SetAuiPaneSize(wxAuiManager &aManager, wxAuiPaneInfo &aPane, int aWidth, int aHeight)
Sets the size of an AUI pane, working around http://trac.wxwidgets.org/ticket/13180.