KiCad PCB EDA Suite
Loading...
Searching...
No Matches
ee_inspection_tool.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) 2019-2023 CERN
5 * Copyright (C) 2019-2023 KiCad Developers, see AUTHORS.txt for contributors.
6 *
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * as published by the Free Software Foundation; either version 2
10 * of the License, or (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, you may find one here:
19 * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
20 * or you may search the http://www.gnu.org website for the version 2 license,
21 * or you may write to the Free Software Foundation, Inc.,
22 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
23 */
24
26
27#include <sch_symbol.h>
28#include <id.h>
29#include <kiway.h>
30#include <kiplatform/ui.h>
31#include <confirm.h>
32#include <string_utils.h>
36#include <tools/ee_actions.h>
38#include <tools/ee_selection.h>
39#include <sim/simulator_frame.h>
40#include <sch_edit_frame.h>
41#include <symbol_edit_frame.h>
42#include <symbol_viewer_frame.h>
43#include <symbol_lib_table.h>
44#include <eda_doc.h>
45#include <sch_marker.h>
46#include <project.h>
47#include <project_sch.h>
49#include <dialogs/dialog_erc.h>
53#include <math/util.h> // for KiROUND
54
55
57 EE_TOOL_BASE<SCH_BASE_FRAME>( "eeschema.InspectionTool" ), m_busSyntaxHelp( nullptr )
58{
59}
60
61
63{
65
66 // Add inspection actions to the selection tool menu
67 //
69
71
74
75 return true;
76}
77
78
80{
81 EE_TOOL_BASE::Reset( aReason );
82
83 if( aReason == SUPERMODEL_RELOAD || aReason == RESET_REASON::SHUTDOWN )
84 {
85 wxCommandEvent* evt = new wxCommandEvent( EDA_EVT_CLOSE_ERC_DIALOG, wxID_ANY );
86
87 wxQueueEvent( m_frame, evt );
88 }
89}
90
91
93{
95 return 0;
96}
97
98
100{
101 SCH_EDIT_FRAME* frame = dynamic_cast<SCH_EDIT_FRAME*>( m_frame );
102
103 wxCHECK( frame, /* void */ );
104
105 DIALOG_ERC* dlg = frame->GetErcDialog();
106
107 wxCHECK( dlg, /* void */ );
108
109 // Needed at least on Windows. Raise() is not enough
110 dlg->Show( true );
111
112 // Bring it to the top if already open. Dual monitor users need this.
113 dlg->Raise();
114
115 KIPLATFORM::UI::ForceFocus( dlg->FindWindow( wxID_OK ) );
116}
117
118
120{
121 SCH_EDIT_FRAME* frame = dynamic_cast<SCH_EDIT_FRAME*>( m_frame );
122
123 wxCHECK( frame, 0 );
124
125 DIALOG_ERC* dlg = frame->GetErcDialog();
126
127 if( dlg )
128 {
129 dlg->Show( true );
130 dlg->Raise();
131 dlg->PrevMarker();
132 }
133
134 return 0;
135}
136
137
139{
140 SCH_EDIT_FRAME* frame = dynamic_cast<SCH_EDIT_FRAME*>( m_frame );
141
142 wxCHECK( frame, 0 );
143
144 DIALOG_ERC* dlg = frame->GetErcDialog();
145
146 wxCHECK( dlg, 0 );
147
148 dlg->Show( true );
149 dlg->Raise();
150 dlg->NextMarker();
151
152 return 0;
153}
154
155
157{
159
160 wxCHECK( selectionTool, 0 );
161
162 EE_SELECTION& selection = selectionTool->GetSelection();
163
164 if( selection.GetSize() == 1 && selection.Front()->Type() == SCH_MARKER_T )
165 {
166 SCH_EDIT_FRAME* frame = dynamic_cast<SCH_EDIT_FRAME*>( m_frame );
167 DIALOG_ERC* dlg = frame ? frame->GetErcDialog() : nullptr;
168
169 if( dlg && dlg->IsShownOnScreen() )
170 dlg->SelectMarker( static_cast<SCH_MARKER*>( selection.Front() ) );
171 }
172
173 // Show the item info on a left click on this item
174 UpdateMessagePanel( aEvent );
175
176 return 0;
177}
178
179
181{
182 SCH_EDIT_FRAME* frame = dynamic_cast<SCH_EDIT_FRAME*>( m_frame );
183
184 wxCHECK( frame, /* void */ );
185
186 DIALOG_ERC* dlg = frame->GetErcDialog();
187
188 if( dlg )
189 {
190 if( !dlg->IsShownOnScreen() )
191 {
192 dlg->Show( true );
193 dlg->Raise();
194 }
195
196 dlg->SelectMarker( aMarker );
197 }
198}
199
200
201wxString EE_INSPECTION_TOOL::InspectERCErrorMenuText( const std::shared_ptr<RC_ITEM>& aERCItem )
202{
203 auto menuDescription =
204 [&]( const TOOL_ACTION& aAction )
205 {
206 wxString menuItemLabel = aAction.GetMenuLabel();
207 wxMenuBar* menuBar = m_frame->GetMenuBar();
208
209 for( size_t ii = 0; ii < menuBar->GetMenuCount(); ++ii )
210 {
211 for( wxMenuItem* menuItem : menuBar->GetMenu( ii )->GetMenuItems() )
212 {
213 if( menuItem->GetItemLabelText() == menuItemLabel )
214 {
215 wxString menuTitleLabel = menuBar->GetMenuLabelText( ii );
216
217 menuTitleLabel.Replace( wxS( "&" ), wxS( "&&" ) );
218 menuItemLabel.Replace( wxS( "&" ), wxS( "&&" ) );
219
220 return wxString::Format( _( "Run %s > %s" ),
221 menuTitleLabel,
222 menuItemLabel );
223 }
224 }
225 }
226
227 return wxString::Format( _( "Run %s" ), aAction.GetFriendlyName() );
228 };
229
230 if( aERCItem->GetErrorCode() == ERCE_BUS_TO_NET_CONFLICT )
231 {
232 return menuDescription( EE_ACTIONS::showBusSyntaxHelp );
233 }
234 else if( aERCItem->GetErrorCode() == ERCE_LIB_SYMBOL_MISMATCH )
235 {
236 return menuDescription( EE_ACTIONS::diffSymbol );
237 }
238
239 return wxEmptyString;
240}
241
242
243void EE_INSPECTION_TOOL::InspectERCError( const std::shared_ptr<RC_ITEM>& aERCItem )
244{
245 SCH_EDIT_FRAME* frame = dynamic_cast<SCH_EDIT_FRAME*>( m_frame );
246
247 wxCHECK( frame, /* void */ );
248
249 EDA_ITEM* a = frame->GetItem( aERCItem->GetMainItemID() );
250
251 if( aERCItem->GetErrorCode() == ERCE_BUS_TO_NET_CONFLICT )
252 {
254 }
255 else if( aERCItem->GetErrorCode() == ERCE_LIB_SYMBOL_MISMATCH )
256 {
257 if( SCH_SYMBOL* symbol = dynamic_cast<SCH_SYMBOL*>( a ) )
258 DiffSymbol( symbol );
259 }
260}
261
262
264{
266 EE_SELECTION& selection = selTool->GetSelection();
267 SCH_MARKER* marker = nullptr;
268
269 if( selection.GetSize() == 1 && selection.Front()->Type() == SCH_MARKER_T )
270 marker = static_cast<SCH_MARKER*>( selection.Front() );
271
272 SCH_EDIT_FRAME* frame = dynamic_cast<SCH_EDIT_FRAME*>( m_frame );
273
274 wxCHECK( frame, 0 );
275
276 DIALOG_ERC* dlg = frame->GetErcDialog();
277
278 wxCHECK( dlg, 0 );
279
280 // Let the ERC dialog handle it since it has more update hassles to worry about
281 // Note that if marker is nullptr the dialog will exclude whichever marker is selected
282 // in the dialog itself
283 dlg->ExcludeMarker( marker );
284
285 if( marker != nullptr )
286 {
287 marker->SetExcluded( true );
288 m_frame->GetCanvas()->GetView()->Update( marker );
290 m_frame->OnModify();
291 }
292
293 return 0;
294}
295
296
297extern void CheckLibSymbol( LIB_SYMBOL* aSymbol, std::vector<wxString>& aMessages,
298 int aGridForPins, UNITS_PROVIDER* aUnitsProvider );
299
301{
302 LIB_SYMBOL* symbol = static_cast<SYMBOL_EDIT_FRAME*>( m_frame )->GetCurSymbol();
303
304 if( !symbol )
305 return 0;
306
307 std::vector<wxString> messages;
308 const int grid_size = KiROUND( getView()->GetGAL()->GetGridSize().x );
309
310 CheckLibSymbol( symbol, messages, grid_size, m_frame );
311
312 if( messages.empty() )
313 {
314 DisplayInfoMessage( m_frame, _( "No symbol issues found." ) );
315 }
316 else
317 {
318 HTML_MESSAGE_BOX dlg( m_frame, _( "Symbol Warnings" ) );
319
320 for( const wxString& single_msg : messages )
321 dlg.AddHTML_Text( single_msg );
322
323 dlg.ShowModal();
324 }
325
326 return 0;
327}
328
329
331{
332 if( m_busSyntaxHelp )
333 {
334 m_busSyntaxHelp->Raise();
335 m_busSyntaxHelp->Show( true );
336 return 0;
337 }
338
340 return 0;
341}
342
343
345{
346 SCH_EDIT_FRAME* schEditorFrame = dynamic_cast<SCH_EDIT_FRAME*>( m_frame );
347
348 wxCHECK( schEditorFrame, 0 );
349
351
352 if( selection.Empty() )
353 {
354 m_frame->ShowInfoBarError( _( "Select a symbol to diff against its library equivalent." ) );
355 return 0;
356 }
357
358 DiffSymbol( static_cast<SCH_SYMBOL*>( selection.Front() ) );
359 return 0;
360}
361
362
364{
365 SCH_EDIT_FRAME* schEditorFrame = dynamic_cast<SCH_EDIT_FRAME*>( m_frame );
366
367 wxCHECK( schEditorFrame, /* void */ );
368
369 DIALOG_BOOK_REPORTER* dialog = schEditorFrame->GetSymbolDiffDialog();
370
371 wxCHECK( dialog, /* void */ );
372
373 dialog->DeleteAllPages();
374
375 wxString symbolDesc = wxString::Format( _( "Symbol %s" ),
376 symbol->GetField( REFERENCE_FIELD )->GetText() );
377 LIB_ID libId = symbol->GetLibId();
378 wxString libName = libId.GetLibNickname();
379 wxString symbolName = libId.GetLibItemName();
380
381 WX_HTML_REPORT_BOX* r = dialog->AddHTMLPage( _( "Summary" ) );
382
383 r->Report( wxS( "<h7>" ) + _( "Schematic vs library diff for:" ) + wxS( "</h7>" ) );
384 r->Report( wxS( "<ul><li>" ) + EscapeHTML( symbolDesc ) + wxS( "</li>" )
385 + wxS( "<li>" ) + _( "Library: " ) + EscapeHTML( libName ) + wxS( "</li>" )
386 + wxS( "<li>" ) + _( "Library item: " ) + EscapeHTML( symbolName )
387 + wxS( "</li></ul>" ) );
388
389 r->Report( "" );
390
392 const LIB_TABLE_ROW* libTableRow = libTable->FindRow( libName );
393
394 if( !libTableRow )
395 {
396 r->Report( _( "The library is not included in the current configuration." )
397 + wxS( "&nbsp;&nbsp;&nbsp" )
398 + wxS( "<a href='$CONFIG'>" ) + _( "Manage Symbol Libraries" ) + wxS( "</a>" ) );
399 }
400 else if( !libTable->HasLibrary( libName, true ) )
401 {
402 r->Report( _( "The library is not enabled in the current configuration." )
403 + wxS( "&nbsp;&nbsp;&nbsp" )
404 + wxS( "<a href='$CONFIG'>" ) + _( "Manage Symbol Libraries" ) + wxS( "</a>" ) );
405 }
406 else
407 {
408 std::unique_ptr<LIB_SYMBOL> flattenedLibSymbol;
409 std::unique_ptr<LIB_SYMBOL> flattenedSchSymbol = symbol->GetLibSymbolRef()->Flatten();
410
411 try
412 {
413 if( LIB_SYMBOL* libAlias = libTable->LoadSymbol( libName, symbolName ) )
414 flattenedLibSymbol = libAlias->Flatten();
415 }
416 catch( const IO_ERROR& )
417 {
418 }
419
420 if( !flattenedLibSymbol )
421 {
422 r->Report( wxString::Format( _( "The library no longer contains the item %s." ),
423 symbolName ) );
424 }
425 else
426 {
427 std::vector<SCH_FIELD> fields;
428
429 for( SCH_FIELD& field : symbol->GetFields() )
430 {
431 fields.emplace_back( SCH_FIELD( flattenedLibSymbol.get(), field.GetId(),
432 field.GetName( false ) ) );
433 fields.back().CopyText( field );
434 fields.back().SetAttributes( field );
435 fields.back().Move( -symbol->GetPosition() );
436 }
437
438 flattenedSchSymbol->SetFields( fields );
439
440 if( flattenedSchSymbol->Compare( *flattenedLibSymbol, SCH_ITEM::COMPARE_FLAGS::ERC,
441 r ) == 0 )
442 {
443 r->Report( _( "No relevant differences detected." ) );
444 }
445
446 wxPanel* panel = dialog->AddBlankPage( _( "Visual" ) );
447 SYMBOL_DIFF_WIDGET* diff = constructDiffPanel( panel );
448
449 diff->DisplayDiff( flattenedSchSymbol.release(), flattenedLibSymbol.release(),
450 symbol->GetUnit(), symbol->GetBodyStyle() );
451 }
452 }
453
454 r->Flush();
455
456 dialog->Raise();
457 dialog->Show( true );
458}
459
460
462{
463 wxBoxSizer* sizer = new wxBoxSizer( wxVERTICAL );
464
466 SYMBOL_DIFF_WIDGET* diffWidget = new SYMBOL_DIFF_WIDGET( aParentPanel, backend );
467
468 sizer->Add( diffWidget, 1, wxEXPAND | wxALL, 5 );
469 aParentPanel->SetSizer( sizer );
470 aParentPanel->Layout();
471
472 return diffWidget;
473}
474
475
477{
479
480 if( !simFrame )
481 return -1;
482
483 if( wxWindow* blocking_win = simFrame->Kiway().GetBlockingDialog() )
484 blocking_win->Close( true );
485
486 simFrame->Show( true );
487
488 // On Windows, Raise() does not bring the window on screen, when iconized
489 if( simFrame->IsIconized() )
490 simFrame->Iconize( false );
491
492 simFrame->Raise();
493
494 return 0;
495}
496
497
499{
500 wxString datasheet;
501 EMBEDDED_FILES* files = nullptr;
502
504 {
505 LIB_SYMBOL* symbol = static_cast<SYMBOL_EDIT_FRAME*>( m_frame )->GetCurSymbol();
506
507 if( !symbol )
508 return 0;
509
510 datasheet = symbol->GetDatasheetField().GetText();
511 files = symbol;
512 }
513 else if( m_frame->IsType( FRAME_SCH_VIEWER ) )
514 {
515 LIB_SYMBOL* entry = static_cast<SYMBOL_VIEWER_FRAME*>( m_frame )->GetSelectedSymbol();
516
517 if( !entry )
518 return 0;
519
521 files = entry;
522 }
523 else if( m_frame->IsType( FRAME_SCH ) )
524 {
526
527 if( selection.Empty() )
528 return 0;
529
530 SCH_SYMBOL* symbol = (SCH_SYMBOL*) selection.Front();
531 SCH_FIELD* field = symbol->GetField( DATASHEET_FIELD );
532
533 // Use GetShownText() to resolve any text variables, but don't allow adding extra text
534 // (ie: the field name)
535 datasheet = field->GetShownText( &symbol->Schematic()->CurrentSheet(), false );
536 files = symbol->Schematic();
537 }
538
539 if( datasheet.IsEmpty() || datasheet == wxS( "~" ) )
540 {
541 m_frame->ShowInfoBarError( _( "No datasheet defined." ) );
542 }
543 else
544 {
546 PROJECT_SCH::SchSearchS( &m_frame->Prj() ), files );
547 }
548
549 return 0;
550}
551
552
554{
555 SYMBOL_EDIT_FRAME* symbolEditFrame = dynamic_cast<SYMBOL_EDIT_FRAME*>( m_frame );
556 SCH_EDIT_FRAME* schEditFrame = dynamic_cast<SCH_EDIT_FRAME*>( m_frame );
558 EE_SELECTION& selection = selTool->GetSelection();
559
560 // Note: the symbol viewer manages its own message panel
561
562 if( symbolEditFrame || schEditFrame )
563 {
564 if( selection.GetSize() == 1 )
565 {
566 EDA_ITEM* item = (EDA_ITEM*) selection.Front();
567
568 std::vector<MSG_PANEL_ITEM> msgItems;
569 item->GetMsgPanelInfo( m_frame, msgItems );
570 m_frame->SetMsgPanel( msgItems );
571 }
572 else
573 {
575 }
576 }
577
578 if( schEditFrame )
579 {
580 schEditFrame->UpdateNetHighlightStatus();
581 schEditFrame->UpdateHierarchySelection();
582 }
583
584 return 0;
585}
586
587
589{
593 // See note 1:
597
602
604
605 // Note 1: tUpdateMessagePanel is called by CrossProbe. So uncomment this line if
606 // call to CrossProbe is modifiied
607 // Go( &EE_INSPECTION_TOOL::UpdateMessagePanel, EVENTS::SelectedEvent );
611}
612
613
constexpr BOX2I KiROUND(const BOX2D &aBoxD)
Definition: box2.h:990
static TOOL_ACTION excludeMarker
Definition: actions.h:121
static TOOL_ACTION nextMarker
Definition: actions.h:120
static TOOL_ACTION showDatasheet
Definition: actions.h:217
static TOOL_ACTION prevMarker
Definition: actions.h:119
void AddItem(const TOOL_ACTION &aAction, const SELECTION_CONDITION &aCondition, int aOrder=ANY_ORDER)
Add a menu entry to run a TOOL_ACTION on selected items.
wxPanel * AddBlankPage(const wxString &aTitle)
WX_HTML_REPORT_BOX * AddHTMLPage(const wxString &aTitle)
void ExcludeMarker(SCH_MARKER *aMarker=nullptr)
Exclude aMarker from the ERC list.
Definition: dialog_erc.cpp:944
void SelectMarker(const SCH_MARKER *aMarker)
Definition: dialog_erc.cpp:921
void PrevMarker()
Definition: dialog_erc.cpp:897
void NextMarker()
Definition: dialog_erc.cpp:909
bool Show(bool show) override
int ShowModal() override
virtual void OnModify()
Must be called after a model change in order to set the "modify" flag and do other frame-specific pro...
void ShowInfoBarError(const wxString &aErrorMsg, bool aShowCloseButton=false, WX_INFOBAR::MESSAGE_TYPE aType=WX_INFOBAR::MESSAGE_TYPE::GENERIC)
Show the WX_INFOBAR displayed on the top of the canvas with a message and an error icon on the left o...
bool IsType(FRAME_T aType) const
virtual void ClearMsgPanel()
Clear all messages from the message panel.
void SetMsgPanel(const std::vector< MSG_PANEL_ITEM > &aList)
Clear the message panel and populates it with the contents of aList.
GAL_TYPE GetBackend() const
Return the type of backend currently used by GAL canvas.
virtual void Refresh(bool aEraseBackground=true, const wxRect *aRect=nullptr) override
A base class for most all the KiCad significant classes used in schematics and boards.
Definition: eda_item.h:89
KICAD_T Type() const
Returns the type of object.
Definition: eda_item.h:101
virtual void GetMsgPanelInfo(EDA_DRAW_FRAME *aFrame, std::vector< MSG_PANEL_ITEM > &aList)
Populate aList of MSG_PANEL_ITEM objects with it's internal state for display purposes.
Definition: eda_item.h:203
virtual const wxString & GetText() const
Return the string associated with the text object.
Definition: eda_text.h:94
static TOOL_ACTION runERC
Inspection and Editing.
Definition: ee_actions.h:156
static TOOL_ACTION showSimulator
Definition: ee_actions.h:295
static TOOL_ACTION diffSymbol
Definition: ee_actions.h:172
static TOOL_ACTION checkSymbol
Definition: ee_actions.h:171
static TOOL_ACTION showBusSyntaxHelp
Definition: ee_actions.h:173
static SELECTION_CONDITION SingleSymbol
static SELECTION_CONDITION SingleNonExcludedMarker
void InspectERCError(const std::shared_ptr< RC_ITEM > &aERCItem)
HTML_MESSAGE_BOX * m_busSyntaxHelp
int RunSimulation(const TOOL_EVENT &aEvent)
int NextMarker(const TOOL_EVENT &aEvent)
int DiffSymbol(const TOOL_EVENT &aEvent)
int PrevMarker(const TOOL_EVENT &aEvent)
wxString InspectERCErrorMenuText(const std::shared_ptr< RC_ITEM > &aERCItem)
int ShowDatasheet(const TOOL_EVENT &aEvent)
SYMBOL_DIFF_WIDGET * constructDiffPanel(wxPanel *aParentPanel)
This method is meant to be overridden in order to specify handlers for events.
void Reset(RESET_REASON aReason) override
Bring the tool to a known, initial state.
void setTransitions() override
This method is meant to be overridden in order to specify handlers for events.
int ExcludeMarker(const TOOL_EVENT &aEvent)
int UpdateMessagePanel(const TOOL_EVENT &aEvent)
Display the selected item info (when clicking on a item)
int ShowBusSyntaxHelp(const TOOL_EVENT &aEvent)
bool Init() override
Init() is called once upon a registration of the tool.
int RunERC(const TOOL_EVENT &aEvent)
int CheckSymbol(const TOOL_EVENT &aEvent)
int CrossProbe(const TOOL_EVENT &aEvent)
Called when clicking on a item:
EE_SELECTION & RequestSelection(const std::vector< KICAD_T > &aScanTypes={ SCH_LOCATE_ANY_T }, bool aPromoteCellSelections=false)
Return either an existing selection (filtered), or the selection at the current cursor position if th...
EE_SELECTION & GetSelection()
A foundation class for a tool operating on a schematic or symbol.
Definition: ee_tool_base.h:48
void Reset(RESET_REASON aReason) override
Bring the tool to a known, initial state.
Definition: ee_tool_base.h:84
EE_SELECTION_TOOL * m_selectionTool
Definition: ee_tool_base.h:200
bool Init() override
Init() is called once upon a registration of the tool.
Definition: ee_tool_base.h:64
static const TOOL_EVENT ClearedEvent
Definition: actions.h:294
static const TOOL_EVENT SelectedEvent
Definition: actions.h:292
static const TOOL_EVENT SelectedItemsModified
Selected items were moved, this can be very high frequency on the canvas, use with care.
Definition: actions.h:299
static const TOOL_EVENT PointSelectedEvent
Definition: actions.h:291
static const TOOL_EVENT UnselectedEvent
Definition: actions.h:293
void AddHTML_Text(const wxString &message)
Add HTML text (without any change) to message list.
Hold an error message and may be used when throwing exceptions containing meaningful error messages.
Definition: ki_exception.h:77
virtual void Update(const VIEW_ITEM *aItem, int aUpdateFlags) const
For dynamic VIEWs, inform the associated VIEW that the graphical representation of this item has chan...
Definition: view.cpp:1687
PROJECT & Prj() const
Return a reference to the PROJECT associated with this KIWAY.
KIWAY & Kiway() const
Return a reference to the KIWAY that this object has an opportunity to participate in.
Definition: kiway_holder.h:55
virtual KIWAY_PLAYER * Player(FRAME_T aFrameType, bool doCreate=true, wxTopLevelWindow *aParent=nullptr)
Return the KIWAY_PLAYER* given a FRAME_T.
Definition: kiway.cpp:406
wxWindow * GetBlockingDialog()
Gets the window pointer to the blocking dialog (to send it signals)
Definition: kiway.cpp:669
A logical library item identifier and consists of various portions much like a URI.
Definition: lib_id.h:49
const UTF8 & GetLibItemName() const
Definition: lib_id.h:102
const UTF8 & GetLibNickname() const
Return the logical library name portion of a LIB_ID.
Definition: lib_id.h:87
Define a library symbol object.
Definition: lib_symbol.h:78
SCH_FIELD & GetDatasheetField() const
Return reference to the datasheet field.
Hold a record identifying a library accessed by the appropriate plug in object in the LIB_TABLE.
bool HasLibrary(const wxString &aNickname, bool aCheckEnabled=false) const
Test for the existence of aNickname in the library table.
void SetExcluded(bool aExcluded, const wxString &aComment=wxEmptyString)
Definition: marker_base.h:99
static SYMBOL_LIB_TABLE * SchSymbolLibTable(PROJECT *aProject)
Accessor for project symbol library table.
static SEARCH_STACK * SchSearchS(PROJECT *aProject)
Accessor for Eeschema search stack.
Definition: project_sch.cpp:41
SCH_SHEET_PATH & CurrentSheet() const override
Definition: schematic.h:152
A shim class between EDA_DRAW_FRAME and several derived classes: SYMBOL_EDIT_FRAME,...
SCH_DRAW_PANEL * GetCanvas() const override
Return a pointer to GAL-based canvas of given EDA draw frame.
KIGFX::SCH_VIEW * GetView() const override
Return a pointer to the #VIEW instance used in the panel.
Schematic editor (Eeschema) main window.
EDA_ITEM * GetItem(const KIID &aId) const override
Fetch an item by KIID.
void UpdateHierarchySelection()
Update the hierarchy navigation tree selection (cross-probe from schematic to hierarchy pane).
DIALOG_BOOK_REPORTER * GetSymbolDiffDialog()
DIALOG_ERC * GetErcDialog()
void UpdateNetHighlightStatus()
Instances are attached to a symbol or sheet and provide a place for the symbol's value,...
Definition: sch_field.h:51
wxString GetShownText(const SCH_SHEET_PATH *aPath, bool aAllowExtraText, int aDepth=0) const
Definition: sch_field.cpp:209
SCHEMATIC * Schematic() const
Searches the item hierarchy to find a SCHEMATIC.
Definition: sch_item.cpp:150
int GetBodyStyle() const
Definition: sch_item.h:232
int GetUnit() const
Definition: sch_item.h:229
Schematic symbol object.
Definition: sch_symbol.h:104
SCH_FIELD * GetField(MANDATORY_FIELD_T aFieldType)
Return a mandatory field in this symbol.
Definition: sch_symbol.cpp:939
VECTOR2I GetPosition() const override
Definition: sch_symbol.h:807
const LIB_ID & GetLibId() const override
Definition: sch_symbol.h:193
void GetFields(std::vector< SCH_FIELD * > &aVector, bool aVisibleOnly)
Populate a std::vector with SCH_FIELDs.
Definition: sch_symbol.cpp:987
std::unique_ptr< LIB_SYMBOL > & GetLibSymbolRef()
Definition: sch_symbol.h:212
static HTML_MESSAGE_BOX * ShowSyntaxHelp(wxWindow *aParentWindow)
Definition: sch_label.cpp:2163
static bool Idle(const SELECTION &aSelection)
Test if there no items selected or being edited.
virtual unsigned int GetSize() const override
Return the number of stored items.
Definition: selection.h:100
EDA_ITEM * Front() const
Definition: selection.h:172
bool Empty() const
Checks if there is anything selected.
Definition: selection.h:110
The SIMULATOR_FRAME holds the main user-interface for running simulations.
void DisplayDiff(LIB_SYMBOL *aSchSymbol, LIB_SYMBOL *aLibSymbol, int aUnit, int aConvert)
Set the currently displayed symbol.
The symbol library editor main window.
LIB_SYMBOL * LoadSymbol(const wxString &aNickname, const wxString &aName)
Load a LIB_SYMBOL having aName from the library given by aNickname.
SYMBOL_LIB_TABLE_ROW * FindRow(const wxString &aNickName, bool aCheckIfEnabled=false)
Return an SYMBOL_LIB_TABLE_ROW if aNickName is found in this table or in any chained fallBack table f...
Symbol library viewer main window.
Represent a single user action.
Definition: tool_action.h:269
TOOL_MANAGER * m_toolMgr
Definition: tool_base.h:218
KIGFX::VIEW * getView() const
Returns the instance of #VIEW object used in the application.
Definition: tool_base.cpp:36
RESET_REASON
Determine the reason of reset for a tool.
Definition: tool_base.h:78
@ SHUTDOWN
Tool is being shut down.
Definition: tool_base.h:84
@ SUPERMODEL_RELOAD
For schematics, the entire schematic changed, not just the sheet.
Definition: tool_base.h:81
Generic, UI-independent tool event.
Definition: tool_event.h:167
void Go(int(T::*aStateFunc)(const TOOL_EVENT &), const TOOL_EVENT_LIST &aConditions=TOOL_EVENT(TC_ANY, TA_ANY))
Define which state (aStateFunc) to go when a certain event arrives (aConditions).
TOOL_MENU & GetToolMenu()
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
CONDITIONAL_MENU & GetMenu()
Definition: tool_menu.cpp:44
A slimmed down version of WX_HTML_REPORT_PANEL.
REPORTER & Report(const wxString &aText, SEVERITY aSeverity=RPT_SEVERITY_UNDEFINED) override
Report a string with a given severity.
void Flush()
Build the HTML messages page.
void DisplayInfoMessage(wxWindow *aParent, const wxString &aMessage, const wxString &aExtraInfo)
Display an informational message box with aMessage.
Definition: confirm.cpp:222
This file is part of the common library.
#define _(s)
bool GetAssociatedDocument(wxWindow *aParent, const wxString &aDocName, PROJECT *aProject, SEARCH_STACK *aPaths, EMBEDDED_FILES *aFiles)
Open a document (file) with the suitable browser.
Definition: eda_doc.cpp:62
This file is part of the common library.
void CheckLibSymbol(LIB_SYMBOL *aSymbol, std::vector< wxString > &aMessages, int aGridForPins, UNITS_PROVIDER *aUnitsProvider)
Check a lib symbol to find incorrect settings Pins not on a valid grid Pins duplicated Conflict with ...
@ ERCE_BUS_TO_NET_CONFLICT
A bus wire is graphically connected to a net port/pin (or vice versa).
Definition: erc_settings.h:70
@ ERCE_LIB_SYMBOL_MISMATCH
Symbol doesn't match copy in library.
Definition: erc_settings.h:78
@ FRAME_SCH_SYMBOL_EDITOR
Definition: frame_type.h:35
@ FRAME_SCH_VIEWER
Definition: frame_type.h:36
@ FRAME_SCH
Definition: frame_type.h:34
@ FRAME_SIMULATOR
Definition: frame_type.h:38
void ForceFocus(wxWindow *aWindow)
Pass the current focus to the window.
Definition: wxgtk/ui.cpp:67
wxString EscapeHTML(const wxString &aString)
Return a new wxString escaped for embedding in HTML.
void CheckLibSymbol(LIB_SYMBOL *aSymbol, std::vector< wxString > &aMessages, int aGridForPins, UNITS_PROVIDER *aUnitsProvider)
Check a lib symbol to find incorrect settings Pins not on a valid grid Pins duplicated Conflict with ...
@ DATASHEET_FIELD
name of datasheet
@ REFERENCE_FIELD
Field Reference of part, i.e. "IC21".
@ SCH_SYMBOL_T
Definition: typeinfo.h:172
@ SCH_MARKER_T
Definition: typeinfo.h:158