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 if( wxButton* okButton = dynamic_cast<wxButton*>( dlg->FindWindow( wxID_OK ) ) )
116 {
117 KIPLATFORM::UI::ForceFocus( okButton );
118 okButton->SetDefault();
119 }
120}
121
122
124{
125 SCH_EDIT_FRAME* frame = dynamic_cast<SCH_EDIT_FRAME*>( m_frame );
126
127 wxCHECK( frame, 0 );
128
129 DIALOG_ERC* dlg = frame->GetErcDialog();
130
131 if( dlg )
132 {
133 dlg->Show( true );
134 dlg->Raise();
135 dlg->PrevMarker();
136 }
137
138 return 0;
139}
140
141
143{
144 SCH_EDIT_FRAME* frame = dynamic_cast<SCH_EDIT_FRAME*>( m_frame );
145
146 wxCHECK( frame, 0 );
147
148 DIALOG_ERC* dlg = frame->GetErcDialog();
149
150 wxCHECK( dlg, 0 );
151
152 dlg->Show( true );
153 dlg->Raise();
154 dlg->NextMarker();
155
156 return 0;
157}
158
159
161{
163
164 wxCHECK( selectionTool, 0 );
165
166 EE_SELECTION& selection = selectionTool->GetSelection();
167
168 if( selection.GetSize() == 1 && selection.Front()->Type() == SCH_MARKER_T )
169 {
170 SCH_EDIT_FRAME* frame = dynamic_cast<SCH_EDIT_FRAME*>( m_frame );
171 DIALOG_ERC* dlg = frame ? frame->GetErcDialog() : nullptr;
172
173 if( dlg && dlg->IsShownOnScreen() )
174 dlg->SelectMarker( static_cast<SCH_MARKER*>( selection.Front() ) );
175 }
176
177 // Show the item info on a left click on this item
178 UpdateMessagePanel( aEvent );
179
180 return 0;
181}
182
183
185{
186 SCH_EDIT_FRAME* frame = dynamic_cast<SCH_EDIT_FRAME*>( m_frame );
187
188 wxCHECK( frame, /* void */ );
189
190 DIALOG_ERC* dlg = frame->GetErcDialog();
191
192 if( dlg )
193 {
194 if( !dlg->IsShownOnScreen() )
195 {
196 dlg->Show( true );
197 dlg->Raise();
198 }
199
200 dlg->SelectMarker( aMarker );
201 }
202}
203
204
205wxString EE_INSPECTION_TOOL::InspectERCErrorMenuText( const std::shared_ptr<RC_ITEM>& aERCItem )
206{
207 auto menuDescription =
208 [&]( const TOOL_ACTION& aAction )
209 {
210 wxString menuItemLabel = aAction.GetMenuLabel();
211 wxMenuBar* menuBar = m_frame->GetMenuBar();
212
213 for( size_t ii = 0; ii < menuBar->GetMenuCount(); ++ii )
214 {
215 for( wxMenuItem* menuItem : menuBar->GetMenu( ii )->GetMenuItems() )
216 {
217 if( menuItem->GetItemLabelText() == menuItemLabel )
218 {
219 wxString menuTitleLabel = menuBar->GetMenuLabelText( ii );
220
221 menuTitleLabel.Replace( wxS( "&" ), wxS( "&&" ) );
222 menuItemLabel.Replace( wxS( "&" ), wxS( "&&" ) );
223
224 return wxString::Format( _( "Run %s > %s" ),
225 menuTitleLabel,
226 menuItemLabel );
227 }
228 }
229 }
230
231 return wxString::Format( _( "Run %s" ), aAction.GetFriendlyName() );
232 };
233
234 if( aERCItem->GetErrorCode() == ERCE_BUS_TO_NET_CONFLICT )
235 {
236 return menuDescription( EE_ACTIONS::showBusSyntaxHelp );
237 }
238 else if( aERCItem->GetErrorCode() == ERCE_LIB_SYMBOL_MISMATCH )
239 {
240 return menuDescription( EE_ACTIONS::diffSymbol );
241 }
242
243 return wxEmptyString;
244}
245
246
247void EE_INSPECTION_TOOL::InspectERCError( const std::shared_ptr<RC_ITEM>& aERCItem )
248{
249 SCH_EDIT_FRAME* frame = dynamic_cast<SCH_EDIT_FRAME*>( m_frame );
250
251 wxCHECK( frame, /* void */ );
252
253 EDA_ITEM* a = frame->GetItem( aERCItem->GetMainItemID() );
254
255 if( aERCItem->GetErrorCode() == ERCE_BUS_TO_NET_CONFLICT )
256 {
258 }
259 else if( aERCItem->GetErrorCode() == ERCE_LIB_SYMBOL_MISMATCH )
260 {
261 if( SCH_SYMBOL* symbol = dynamic_cast<SCH_SYMBOL*>( a ) )
262 DiffSymbol( symbol );
263 }
264}
265
266
268{
270 EE_SELECTION& selection = selTool->GetSelection();
271 SCH_MARKER* marker = nullptr;
272
273 if( selection.GetSize() == 1 && selection.Front()->Type() == SCH_MARKER_T )
274 marker = static_cast<SCH_MARKER*>( selection.Front() );
275
276 SCH_EDIT_FRAME* frame = dynamic_cast<SCH_EDIT_FRAME*>( m_frame );
277
278 wxCHECK( frame, 0 );
279
280 DIALOG_ERC* dlg = frame->GetErcDialog();
281
282 wxCHECK( dlg, 0 );
283
284 // Let the ERC dialog handle it since it has more update hassles to worry about
285 // Note that if marker is nullptr the dialog will exclude whichever marker is selected
286 // in the dialog itself
287 dlg->ExcludeMarker( marker );
288
289 if( marker != nullptr )
290 {
291 marker->SetExcluded( true );
292 m_frame->GetCanvas()->GetView()->Update( marker );
294 m_frame->OnModify();
295 }
296
297 return 0;
298}
299
300
301extern void CheckLibSymbol( LIB_SYMBOL* aSymbol, std::vector<wxString>& aMessages,
302 int aGridForPins, UNITS_PROVIDER* aUnitsProvider );
303
305{
306 LIB_SYMBOL* symbol = static_cast<SYMBOL_EDIT_FRAME*>( m_frame )->GetCurSymbol();
307
308 if( !symbol )
309 return 0;
310
311 std::vector<wxString> messages;
312 const int grid_size = KiROUND( getView()->GetGAL()->GetGridSize().x );
313
314 CheckLibSymbol( symbol, messages, grid_size, m_frame );
315
316 if( messages.empty() )
317 {
318 DisplayInfoMessage( m_frame, _( "No symbol issues found." ) );
319 }
320 else
321 {
322 HTML_MESSAGE_BOX dlg( m_frame, _( "Symbol Warnings" ) );
323
324 for( const wxString& single_msg : messages )
325 dlg.AddHTML_Text( single_msg );
326
327 dlg.ShowModal();
328 }
329
330 return 0;
331}
332
333
335{
336 if( m_busSyntaxHelp )
337 {
338 m_busSyntaxHelp->Raise();
339 m_busSyntaxHelp->Show( true );
340 return 0;
341 }
342
344 return 0;
345}
346
347
349{
350 SCH_EDIT_FRAME* schEditorFrame = dynamic_cast<SCH_EDIT_FRAME*>( m_frame );
351
352 wxCHECK( schEditorFrame, 0 );
353
355
356 if( selection.Empty() )
357 {
358 m_frame->ShowInfoBarError( _( "Select a symbol to diff against its library equivalent." ) );
359 return 0;
360 }
361
362 DiffSymbol( static_cast<SCH_SYMBOL*>( selection.Front() ) );
363 return 0;
364}
365
366
368{
369 SCH_EDIT_FRAME* schEditorFrame = dynamic_cast<SCH_EDIT_FRAME*>( m_frame );
370
371 wxCHECK( schEditorFrame, /* void */ );
372
373 DIALOG_BOOK_REPORTER* dialog = schEditorFrame->GetSymbolDiffDialog();
374
375 wxCHECK( dialog, /* void */ );
376
377 dialog->DeleteAllPages();
378
379 wxString symbolDesc = wxString::Format( _( "Symbol %s" ),
380 symbol->GetField( REFERENCE_FIELD )->GetText() );
381 LIB_ID libId = symbol->GetLibId();
382 wxString libName = libId.GetLibNickname();
383 wxString symbolName = libId.GetLibItemName();
384
385 WX_HTML_REPORT_BOX* r = dialog->AddHTMLPage( _( "Summary" ) );
386
387 r->Report( wxS( "<h7>" ) + _( "Schematic vs library diff for:" ) + wxS( "</h7>" ) );
388 r->Report( wxS( "<ul><li>" ) + EscapeHTML( symbolDesc ) + wxS( "</li>" )
389 + wxS( "<li>" ) + _( "Library: " ) + EscapeHTML( libName ) + wxS( "</li>" )
390 + wxS( "<li>" ) + _( "Library item: " ) + EscapeHTML( symbolName )
391 + wxS( "</li></ul>" ) );
392
393 r->Report( "" );
394
396 const LIB_TABLE_ROW* libTableRow = libTable->FindRow( libName );
397
398 if( !libTableRow )
399 {
400 r->Report( _( "The library is not included in the current configuration." )
401 + wxS( "&nbsp;&nbsp;&nbsp" )
402 + wxS( "<a href='$CONFIG'>" ) + _( "Manage Symbol Libraries" ) + wxS( "</a>" ) );
403 }
404 else if( !libTable->HasLibrary( libName, true ) )
405 {
406 r->Report( _( "The library is not enabled in the current configuration." )
407 + wxS( "&nbsp;&nbsp;&nbsp" )
408 + wxS( "<a href='$CONFIG'>" ) + _( "Manage Symbol Libraries" ) + wxS( "</a>" ) );
409 }
410 else
411 {
412 std::unique_ptr<LIB_SYMBOL> flattenedLibSymbol;
413 std::unique_ptr<LIB_SYMBOL> flattenedSchSymbol = symbol->GetLibSymbolRef()->Flatten();
414
415 try
416 {
417 if( LIB_SYMBOL* libAlias = libTable->LoadSymbol( libName, symbolName ) )
418 flattenedLibSymbol = libAlias->Flatten();
419 }
420 catch( const IO_ERROR& )
421 {
422 }
423
424 if( !flattenedLibSymbol )
425 {
426 r->Report( wxString::Format( _( "The library no longer contains the item %s." ),
427 symbolName ) );
428 }
429 else
430 {
431 std::vector<SCH_FIELD> fields;
432
433 for( SCH_FIELD& field : symbol->GetFields() )
434 {
435 fields.emplace_back( SCH_FIELD( flattenedLibSymbol.get(), field.GetId(),
436 field.GetName( false ) ) );
437 fields.back().CopyText( field );
438 fields.back().SetAttributes( field );
439 fields.back().Move( -symbol->GetPosition() );
440 }
441
442 flattenedSchSymbol->SetFields( fields );
443
444 if( flattenedSchSymbol->Compare( *flattenedLibSymbol, SCH_ITEM::COMPARE_FLAGS::ERC,
445 r ) == 0 )
446 {
447 r->Report( _( "No relevant differences detected." ) );
448 }
449
450 wxPanel* panel = dialog->AddBlankPage( _( "Visual" ) );
451 SYMBOL_DIFF_WIDGET* diff = constructDiffPanel( panel );
452
453 diff->DisplayDiff( flattenedSchSymbol.release(), flattenedLibSymbol.release(),
454 symbol->GetUnit(), symbol->GetBodyStyle() );
455 }
456 }
457
458 r->Flush();
459
460 dialog->Raise();
461 dialog->Show( true );
462}
463
464
466{
467 wxBoxSizer* sizer = new wxBoxSizer( wxVERTICAL );
468
470 SYMBOL_DIFF_WIDGET* diffWidget = new SYMBOL_DIFF_WIDGET( aParentPanel, backend );
471
472 sizer->Add( diffWidget, 1, wxEXPAND | wxALL, 5 );
473 aParentPanel->SetSizer( sizer );
474 aParentPanel->Layout();
475
476 return diffWidget;
477}
478
479
481{
483
484 if( !simFrame )
485 return -1;
486
487 if( wxWindow* blocking_win = simFrame->Kiway().GetBlockingDialog() )
488 blocking_win->Close( true );
489
490 simFrame->Show( true );
491
492 // On Windows, Raise() does not bring the window on screen, when iconized
493 if( simFrame->IsIconized() )
494 simFrame->Iconize( false );
495
496 simFrame->Raise();
497
498 return 0;
499}
500
501
503{
504 wxString datasheet;
505 EMBEDDED_FILES* files = nullptr;
506
508 {
509 LIB_SYMBOL* symbol = static_cast<SYMBOL_EDIT_FRAME*>( m_frame )->GetCurSymbol();
510
511 if( !symbol )
512 return 0;
513
514 datasheet = symbol->GetDatasheetField().GetText();
515 files = symbol;
516 }
517 else if( m_frame->IsType( FRAME_SCH_VIEWER ) )
518 {
519 LIB_SYMBOL* entry = static_cast<SYMBOL_VIEWER_FRAME*>( m_frame )->GetSelectedSymbol();
520
521 if( !entry )
522 return 0;
523
525 files = entry;
526 }
527 else if( m_frame->IsType( FRAME_SCH ) )
528 {
530
531 if( selection.Empty() )
532 return 0;
533
534 SCH_SYMBOL* symbol = (SCH_SYMBOL*) selection.Front();
535 SCH_FIELD* field = symbol->GetField( DATASHEET_FIELD );
536
537 // Use GetShownText() to resolve any text variables, but don't allow adding extra text
538 // (ie: the field name)
539 datasheet = field->GetShownText( &symbol->Schematic()->CurrentSheet(), false );
540 files = symbol->Schematic();
541 }
542
543 if( datasheet.IsEmpty() || datasheet == wxS( "~" ) )
544 {
545 m_frame->ShowInfoBarError( _( "No datasheet defined." ) );
546 }
547 else
548 {
550 PROJECT_SCH::SchSearchS( &m_frame->Prj() ), files );
551 }
552
553 return 0;
554}
555
556
558{
559 SYMBOL_EDIT_FRAME* symbolEditFrame = dynamic_cast<SYMBOL_EDIT_FRAME*>( m_frame );
560 SCH_EDIT_FRAME* schEditFrame = dynamic_cast<SCH_EDIT_FRAME*>( m_frame );
562 EE_SELECTION& selection = selTool->GetSelection();
563
564 // Note: the symbol viewer manages its own message panel
565
566 if( symbolEditFrame || schEditFrame )
567 {
568 if( selection.GetSize() == 1 )
569 {
570 EDA_ITEM* item = (EDA_ITEM*) selection.Front();
571
572 std::vector<MSG_PANEL_ITEM> msgItems;
573 item->GetMsgPanelInfo( m_frame, msgItems );
574 m_frame->SetMsgPanel( msgItems );
575 }
576 else
577 {
579 }
580 }
581
582 if( schEditFrame )
583 {
584 schEditFrame->UpdateNetHighlightStatus();
585 schEditFrame->UpdateHierarchySelection();
586 }
587
588 return 0;
589}
590
591
593{
597 // See note 1:
601
606
608
609 // Note 1: tUpdateMessagePanel is called by CrossProbe. So uncomment this line if
610 // call to CrossProbe is modifiied
611 // Go( &EE_INSPECTION_TOOL::UpdateMessagePanel, EVENTS::SelectedEvent );
615}
616
617
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:98
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:1669
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:156
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:211
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:2156
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