KiCad PCB EDA Suite
Loading...
Searching...
No Matches
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 (C) 2023, 2024 KiCad Developers, see AUTHORS.txt for contributors.
6 *
7 * @author Wayne Stambaugh <[email protected]>
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/ee_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" ), UnescapeString( label->GetText() ),
124 aUnitsProvider->MessageTextFromValue( label->GetPosition().x ),
125 aUnitsProvider->MessageTextFromValue( label->GetPosition().y ) );
126 break;
127 }
128 case SCH_HIER_LABEL_T:
129 {
130 const SCH_HIERLABEL* label = static_cast<const SCH_HIERLABEL*>( aItem );
131
132 retv.Printf( _( "Hierarchical label '%s' at %s, %s" ), UnescapeString( label->GetText() ),
133 aUnitsProvider->MessageTextFromValue( label->GetPosition().x ),
134 aUnitsProvider->MessageTextFromValue( label->GetPosition().y ) );
135 break;
136 }
137 case SCH_JUNCTION_T:
138 {
139 const SCH_JUNCTION* junction = static_cast<const SCH_JUNCTION*>( aItem );
140
141 retv.Printf( _( "Junction at %s, %s" ),
142 aUnitsProvider->MessageTextFromValue( junction->GetPosition().x ),
143 aUnitsProvider->MessageTextFromValue( junction->GetPosition().y ) );
144 break;
145 }
146 case SCH_NO_CONNECT_T:
147 {
148 const SCH_NO_CONNECT* nc = static_cast<const SCH_NO_CONNECT*>( aItem );
149
150 retv.Printf( _( "No-Connect at %s, %s" ),
151 aUnitsProvider->MessageTextFromValue( nc->GetPosition().x ),
152 aUnitsProvider->MessageTextFromValue( nc->GetPosition().y ) );
153 break;
154 }
156 {
157 const SCH_BUS_WIRE_ENTRY* entry = static_cast<const SCH_BUS_WIRE_ENTRY*>( aItem );
158
159 retv.Printf( _( "Bus to wire entry from %s, %s to %s, %s" ),
160 aUnitsProvider->MessageTextFromValue( entry->GetPosition().x ),
161 aUnitsProvider->MessageTextFromValue( entry->GetPosition().y ),
162 aUnitsProvider->MessageTextFromValue( entry->GetEnd().x ),
163 aUnitsProvider->MessageTextFromValue( entry->GetEnd().y ) );
164 break;
165 }
167 {
168 const SCH_BUS_BUS_ENTRY* entry = static_cast<const SCH_BUS_BUS_ENTRY*>( aItem );
169
170 retv.Printf( _( "Bus to bus entry from %s, %s to %s, %s" ),
171 aUnitsProvider->MessageTextFromValue( entry->GetPosition().x ),
172 aUnitsProvider->MessageTextFromValue( entry->GetPosition().y ),
173 aUnitsProvider->MessageTextFromValue( entry->GetEnd().x ),
174 aUnitsProvider->MessageTextFromValue( entry->GetEnd().y ) );
175 break;
176 }
178 {
179 const SCH_DIRECTIVE_LABEL* entry = static_cast<const SCH_DIRECTIVE_LABEL*>( aItem );
180
181 retv.Printf( _( "Netclass label '%s' at %s, %s" ), UnescapeString( entry->GetText() ),
182 aUnitsProvider->MessageTextFromValue( entry->GetPosition().x ),
183 aUnitsProvider->MessageTextFromValue( entry->GetPosition().y ) );
184 break;
185 }
186 default:
187 retv.Printf( _( "Unhandled item type %d" ), aItem->Type() );
188 }
189
190 return retv;
191}
192
193
194void SCH_EDIT_FRAME::MakeNetNavigatorNode( const wxString& aNetName, wxTreeItemId aParentId,
195 const NET_NAVIGATOR_ITEM_DATA* aSelection,
196 bool aSingleSheetSchematic )
197{
198 wxCHECK( !aNetName.IsEmpty(), /* void */ );
199 wxCHECK( m_schematic, /* void */ );
200 wxCHECK( m_netNavigator, /* void */ );
201
202 wxTreeItemId expandId = aParentId;
203 CONNECTION_GRAPH* connectionGraph = m_schematic->ConnectionGraph();
204
205 wxCHECK( connectionGraph, /* void */ );
206
207 wxString sheetPathPrefix;
208 std::set<CONNECTION_SUBGRAPH*> subgraphs;
209
210 {
211 const std::vector<CONNECTION_SUBGRAPH*>& tmp = connectionGraph->GetAllSubgraphs( aNetName );
212 subgraphs.insert( tmp.begin(), tmp.end() );
213 }
214
215 for( CONNECTION_SUBGRAPH* sg : subgraphs )
216 {
217 for( const auto& [_, bus_sgs] : sg->GetBusParents() )
218 {
219 for( const CONNECTION_SUBGRAPH* bus_sg : bus_sgs )
220 {
221 const std::vector<CONNECTION_SUBGRAPH*>& tmp =
222 connectionGraph->GetAllSubgraphs( bus_sg->GetNetName() );
223 subgraphs.insert( tmp.begin(), tmp.end() );
224 }
225 }
226 }
227
228 std::map<wxString, wxTreeItemId> sheetIds;
229
230 for( const CONNECTION_SUBGRAPH* subGraph : subgraphs )
231 {
232 NET_NAVIGATOR_ITEM_DATA* itemData = nullptr;
233 SCH_SHEET_PATH sheetPath = subGraph->GetSheet();
234
235 wxCHECK2( subGraph && sheetPath.Last(), continue );
236
237 if( subGraph->GetItems().empty() )
238 continue;
239
240 itemData = new NET_NAVIGATOR_ITEM_DATA( sheetPath, nullptr );
241
242 bool stripTrailingSeparator = !sheetPath.Last()->IsRootSheet();
243 wxString txt = sheetPath.PathHumanReadable( true, stripTrailingSeparator );
244
245 wxTreeItemId sheetId;
246
247 if( auto sheetIdIt = sheetIds.find( txt ); sheetIdIt != sheetIds.end() )
248 {
249 sheetId = sheetIdIt->second;
250 }
251 else
252 {
253 sheetIds[txt] = m_netNavigator->AppendItem( aParentId, txt, -1, -1, itemData );
254 sheetId = sheetIds[txt];
255 }
256
257 if( aSelection && *aSelection == *itemData )
258 m_netNavigator->SelectItem( sheetId );
259
260 // If there is only one sheet in the schematic, always expand the sheet tree.
261 if( aSingleSheetSchematic )
262 expandId = sheetId;
263
264 for( const SCH_ITEM* item : subGraph->GetItems() )
265 {
266 KICAD_T type = item->Type();
267
268 if( ( type == SCH_LINE_T ) || ( type == SCH_JUNCTION_T )
269 || ( type == SCH_BUS_WIRE_ENTRY_T ) || ( type == SCH_BUS_BUS_ENTRY_T ) )
270 continue;
271
272 itemData = new NET_NAVIGATOR_ITEM_DATA( sheetPath, item );
273 wxTreeItemId id = m_netNavigator->AppendItem( sheetId,
274 GetNetNavigatorItemText( item, sheetPath,
275 this ),
276 -1, -1, itemData );
277
278 if( aSelection && *aSelection == *itemData )
279 {
280 expandId = sheetId;
281 m_netNavigator->EnsureVisible( id );
282 m_netNavigator->SelectItem( id );
283 }
284 }
285
286 m_netNavigator->SortChildren( sheetId );
287 }
288
289 // Sort the items in the tree control alphabetically
290 m_netNavigator->SortChildren( aParentId );
291 m_netNavigator->Expand( aParentId );
292}
293
294
296{
297 wxCHECK( m_netNavigator, /* void */ );
298
299 if( !m_netNavigator->IsShown() )
300 return;
301
302 bool singleSheetSchematic = m_schematic->Hierarchy().size() == 1;
303 size_t nodeCnt = 0;
304
305 m_netNavigator->Freeze();
306
307 PROF_TIMER timer;
308
309 if( m_highlightedConn.IsEmpty() )
310 {
311 m_netNavigator->DeleteAllItems();
312
313 // Create a tree of all nets in the schematic.
314 wxTreeItemId rootId = m_netNavigator->AddRoot( _( "Nets" ), 0 );
315
316 const NET_MAP& netMap = m_schematic->ConnectionGraph()->GetNetMap();
317
318 for( const auto& net : netMap )
319 {
320 // Skip bus member subgraphs for the moment.
321 if( net.first.Name.IsEmpty() )
322 continue;
323
324 nodeCnt++;
325 wxTreeItemId netId = m_netNavigator->AppendItem( rootId,
326 UnescapeString( net.first.Name ) );
327 MakeNetNavigatorNode( net.first.Name, netId, aSelection, singleSheetSchematic );
328 }
329
330 m_netNavigator->Expand( rootId );
331 }
332 else if( !m_netNavigator->IsEmpty() )
333 {
334 const wxString shownNetName = m_netNavigator->GetItemText( m_netNavigator->GetRootItem() );
335
336 if( shownNetName != m_highlightedConn )
337 {
338 m_netNavigator->DeleteAllItems();
339
340 nodeCnt++;
341
342 wxTreeItemId rootId = m_netNavigator->AddRoot( UnescapeString( m_highlightedConn ), 0 );
343
344 MakeNetNavigatorNode( m_highlightedConn, rootId, aSelection, singleSheetSchematic );
345 }
346 else
347 {
348 NET_NAVIGATOR_ITEM_DATA* itemData = nullptr;
349
350 wxTreeItemId selection = m_netNavigator->GetSelection();
351
352 if( selection.IsOk() )
353 itemData = dynamic_cast<NET_NAVIGATOR_ITEM_DATA*>( m_netNavigator->GetItemData( selection ) );
354
355 m_netNavigator->DeleteAllItems();
356 nodeCnt++;
357
358 wxTreeItemId rootId = m_netNavigator->AddRoot( UnescapeString( m_highlightedConn ), 0 );
359
360 MakeNetNavigatorNode( m_highlightedConn, rootId, itemData, singleSheetSchematic );
361 }
362 }
363 else
364 {
365 nodeCnt++;
366
367 wxTreeItemId rootId = m_netNavigator->AddRoot( UnescapeString( m_highlightedConn ), 0 );
368
369 MakeNetNavigatorNode( m_highlightedConn, rootId, aSelection, singleSheetSchematic );
370 }
371
372 timer.Stop();
373
374 wxLogTrace( traceUiProfile, wxS( "Adding %zu nodes to net navigator took %s." ),
375 nodeCnt, timer.to_string() );
376
377 m_netNavigator->Thaw();
378}
379
380
382{
383 wxCHECK( m_netNavigator, /* void */ );
384
385 // Maybe in the future we can do something like collapse the tree for an empty selection.
386 // For now, leave the tree selection in its current state.
387 if( !aSelection )
388 return;
389
390 wxTreeItemIdValue sheetCookie;
391 NET_NAVIGATOR_ITEM_DATA* itemData = nullptr;
392 wxTreeItemId rootId = m_netNavigator->GetRootItem();
393 wxTreeItemId sheetId = m_netNavigator->GetFirstChild( rootId, sheetCookie );
394
395 while( sheetId.IsOk() )
396 {
397 if( m_netNavigator->ItemHasChildren( sheetId ) )
398 {
399 wxTreeItemIdValue itemCookie;
400 wxTreeItemId itemId = m_netNavigator->GetFirstChild( sheetId, itemCookie );
401
402 while( itemId.IsOk() )
403 {
404 itemData = dynamic_cast<NET_NAVIGATOR_ITEM_DATA*>( m_netNavigator->GetItemData( itemId ) );
405
406 wxCHECK2( itemData, continue );
407
408 if( *itemData == *aSelection )
409 {
410 if( !m_netNavigator->IsVisible( itemId ) )
411 {
412 m_netNavigator->CollapseAll();
413 m_netNavigator->EnsureVisible( itemId );
414 }
415
416 m_netNavigator->SelectItem( itemId );
417 return;
418 }
419
420 itemId = m_netNavigator->GetNextSibling( itemId );
421 }
422
423 sheetId = m_netNavigator->GetNextSibling( sheetId );
424 }
425 }
426}
427
428
430{
431 if( !m_netNavigator )
432 return nullptr;
433
434 wxTreeItemId id = m_netNavigator->GetSelection();
435
436 if( !id.IsOk() || ( id == m_netNavigator->GetRootItem() ) )
437 return nullptr;
438
439 NET_NAVIGATOR_ITEM_DATA* itemData =
440 dynamic_cast<NET_NAVIGATOR_ITEM_DATA*>( m_netNavigator->GetItemData( id ) );
441
442 wxCHECK( itemData, nullptr );
443
444 return itemData->GetItem();
445}
446
447
449{
450 wxCHECK( m_netNavigator, /* void */ );
451
452 wxTreeItemId id = aEvent.GetItem();
453
454 // Clicking on the root item (net name ) does nothing.
455 if( id == m_netNavigator->GetRootItem() )
456 return;
457
458 NET_NAVIGATOR_ITEM_DATA* itemData =
459 dynamic_cast<NET_NAVIGATOR_ITEM_DATA*>( m_netNavigator->GetItemData( id ) );
460
461 // Just a net name when we have all nets displayed.
462 if( !itemData )
463 return;
464
465 if( GetCurrentSheet() != itemData->GetSheetPath() )
466 {
468 &itemData->GetSheetPath() );
469 }
470
471 // Do not focus on item when a sheet tree node is selected.
472 if( m_netNavigator->GetItemParent( id ) != m_netNavigator->GetRootItem()
473 && itemData->GetItem() )
474 {
475 // Make sure we didn't remove the item and/or the screen it resides on before we access it.
476 const SCH_ITEM* item = itemData->GetItem();
477
478 // Don't search for child items in screen r-tree.
479 item = ( ( item->Type() == SCH_SHEET_PIN_T ) || ( item->Type() == SCH_PIN_T ) ) ?
480 static_cast<const SCH_ITEM*>( item->GetParent() ) : item;
481
482 const SCH_SCREEN* screen = itemData->GetSheetPath().LastScreen();
483
484 wxCHECK( screen, /* void */ );
485 wxCHECK( screen->Items().contains( item, true ), /* void */ );
486
487 FocusOnLocation( itemData->GetItem()->GetBoundingBox().Centre() );
488 }
489
490 GetCanvas()->Refresh();
491}
492
493
495{
496 wxCHECK( m_netNavigator, /* void */ );
497
498 aEvent.Skip();
499}
500
501
503{
505
506 wxCHECK( cfg, /* void */ );
507
508 wxAuiPaneInfo& netNavigatorPane = m_auimgr.GetPane( NetNavigatorPaneName() );
509
510 netNavigatorPane.Show( !netNavigatorPane.IsShown() );
512
513 cfg->m_AuiPanels.show_net_nav_panel = netNavigatorPane.IsShown();
514
515 if( netNavigatorPane.IsShown() )
516 {
517 if( netNavigatorPane.IsFloating() )
518 {
519 netNavigatorPane.FloatingSize( cfg->m_AuiPanels.net_nav_panel_float_size );
520 m_auimgr.Update();
521 }
522 else if( cfg->m_AuiPanels.net_nav_panel_docked_size.GetWidth() > 0 )
523 {
524 // SetAuiPaneSize also updates m_auimgr
525 SetAuiPaneSize( m_auimgr, netNavigatorPane,
526 cfg->m_AuiPanels.net_nav_panel_docked_size.GetWidth(), -1 );
527 }
528 }
529 else
530 {
531 NET_NAVIGATOR_ITEM_DATA* itemData = nullptr;
532
533 wxTreeItemId selection = m_netNavigator->GetSelection();
534
535 if( selection.IsOk() )
536 itemData = dynamic_cast<NET_NAVIGATOR_ITEM_DATA*>( m_netNavigator->GetItemData( selection ) );
537
538 RefreshNetNavigator( itemData );
539
540 if( netNavigatorPane.IsFloating() )
541 {
542 cfg->m_AuiPanels.net_nav_panel_float_size = netNavigatorPane.floating_size;
543 }
544 else
545 {
547 }
548
549 m_auimgr.Update();
550 }
551}
552
553
554void SCH_EDIT_FRAME::onResizeNetNavigator( wxSizeEvent& aEvent )
555{
556 aEvent.Skip();
557
558 // Called when resizing the Hierarchy Navigator panel
559 // Store the current pane size
560 // It allows to retrieve the last defined pane size when switching between
561 // docked and floating pane state
562 // Note: *DO NOT* call m_auimgr.Update() here: it crashes Kicad at least on Windows
563
564 EESCHEMA_SETTINGS* cfg = dynamic_cast<EESCHEMA_SETTINGS*>( Kiface().KifaceSettings() );
565
566 wxCHECK( cfg, /* void */ );
567
568 wxAuiPaneInfo& netNavigatorPane = m_auimgr.GetPane( NetNavigatorPaneName() );
569
570 if( m_netNavigator->IsShownOnScreen() )
571 {
572 cfg->m_AuiPanels.net_nav_panel_float_size = netNavigatorPane.floating_size;
573
574 // initialize net_nav_panel_docked_width and best size only if the netNavigatorPane
575 // width is > 0 (i.e. if its size is already set and has meaning)
576 // if it is floating, its size is not initialized (only floating_size is initialized)
577 // initializing netNavigatorPane.best_size is useful when switching to float pane and
578 // after switching to the docked pane, to retrieve the last docked pane width
579 if( netNavigatorPane.rect.width > 50 ) // 50 is a good margin
580 {
581 cfg->m_AuiPanels.net_nav_panel_docked_size.SetWidth( netNavigatorPane.rect.width );
582 netNavigatorPane.best_size.x = netNavigatorPane.rect.width;
583 }
584 }
585}
KIFACE_BASE & Kiface()
Global KIFACE_BASE "get" accessor.
constexpr Vec Centre() const
Definition: box2.h:97
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
virtual const BOX2I GetBoundingBox() const
Return the orthogonal bounding box of this object for display purposes.
Definition: eda_item.cpp:77
KICAD_T Type() const
Returns the type of object.
Definition: eda_item.h:101
EDA_ITEM * GetParent() const
Definition: eda_item.h:103
virtual const wxString & GetText() const
Return the string associated with the text object.
Definition: eda_text.h:98
static TOOL_ACTION changeSheet
Definition: ee_actions.h:231
bool contains(const SCH_ITEM *aItem, bool aRobust=false) const
Determine if a given item exists in the tree.
Definition: sch_rtree.h:125
APP_SETTINGS_BASE * KifaceSettings() const
Definition: kiface_base.h:95
Tree view item data for the net navigator.
const SCH_ITEM * GetItem() const
SCH_SHEET_PATH & GetSheetPath()
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
CONNECTION_GRAPH * ConnectionGraph() const override
Definition: schematic.h:166
SCH_SHEET_LIST Hierarchy() const override
Return the full schematic flattened hierarchical sheet list.
Definition: schematic.cpp:214
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)
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:168
SCH_LAYER_ID GetLayer() const
Return the layer this item is on.
Definition: sch_item.h:283
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:141
VECTOR2I GetStartPoint() const
Definition: sch_line.h:136
VECTOR2I GetPosition() const override
EE_RTREE & Items()
Gets the full RTree, usually for iterating.
Definition: sch_screen.h:108
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_SCREEN * LastScreen()
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:57
bool IsRootSheet() const
Definition: sch_sheet.cpp:204
VECTOR2I GetPosition() const override
Definition: sch_text.h:141
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:356
@ LAYER_BUS
Definition: layer_ids.h:357
static wxString GetNetNavigatorItemText(const SCH_ITEM *aItem, const SCH_SHEET_PATH &aSheetPath, UNITS_PROVIDER *aUnitsProvider)
wxString UnescapeString(const wxString &aSource)
wxLogTrace helper definitions.
KICAD_T
The set of class identification values stored in EDA_ITEM::m_structType.
Definition: typeinfo.h:78
@ 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:173
@ 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.