86 wxCommandEvent* evt =
new wxCommandEvent( EDA_EVT_CLOSE_ERC_DIALOG, wxID_ANY );
116 if( wxButton* okButton =
dynamic_cast<wxButton*
>( dlg->FindWindow( wxID_OK ) ) )
119 okButton->SetDefault();
165 wxCHECK( selectionTool, 0 );
174 if( dlg && dlg->IsShownOnScreen() )
195 if( !dlg->IsShownOnScreen() )
217 return wxEmptyString;
247 if( selection.GetSize() == 1 && selection.Front()->Type() ==
SCH_MARKER_T )
248 marker =
static_cast<SCH_MARKER*
>( selection.Front() );
263 if( marker !=
nullptr )
266 m_frame->GetCanvas()->GetView()->Update( marker );
267 m_frame->GetCanvas()->Refresh();
285 std::vector<wxString> messages;
286 const int grid_size =
KiROUND(
getView()->GetGAL()->GetGridSize().x );
290 if( messages.empty() )
298 for(
const wxString& single_msg : messages )
326 wxCHECK( schEditorFrame, 0 );
330 if( selection.
Empty() )
332 m_frame->ShowInfoBarError(
_(
"Select a symbol to diff against its library equivalent." ) );
345 wxCHECK( schEditorFrame, );
354 wxString symbolDesc = wxString::Format(
_(
"Symbol %s" ),
362 r->
Report( wxS(
"<h7>" ) +
_(
"Schematic vs library diff for:" ) + wxS(
"</h7>" ) );
364 + wxS(
"<li>" ) +
_(
"Library: " ) +
EscapeHTML( libName ) + wxS(
"</li>" )
365 + wxS(
"<li>" ) +
_(
"Library item: " ) +
EscapeHTML( symbolName )
366 + wxS(
"</li></ul>" ) );
375 r->
Report(
_(
"The library is not included in the current configuration." )
376 + wxS(
"  " )
377 + wxS(
"<a href='$CONFIG'>" ) +
_(
"Manage Symbol Libraries" ) + wxS(
"</a>" ) );
379 else if( !libTable->
HasLibrary( libName,
true ) )
381 r->
Report(
_(
"The library is not enabled in the current configuration." )
382 + wxS(
"  " )
383 + wxS(
"<a href='$CONFIG'>" ) +
_(
"Manage Symbol Libraries" ) + wxS(
"</a>" ) );
387 std::unique_ptr<LIB_SYMBOL> flattenedLibSymbol;
393 flattenedLibSymbol = libAlias->Flatten();
399 if( !flattenedLibSymbol )
401 r->
Report( wxString::Format(
_(
"The library no longer contains the item %s." ),
406 std::vector<SCH_FIELD> fields;
410 fields.emplace_back(
SCH_FIELD( flattenedLibSymbol.get(), field.GetId(),
411 field.GetName(
false ) ) );
412 fields.back().CopyText( field );
413 fields.back().SetAttributes( field );
417 flattenedSchSymbol->SetFields( fields );
422 r->
Report(
_(
"No relevant differences detected." ) );
428 diff->
DisplayDiff( flattenedSchSymbol.release(), flattenedLibSymbol.release(),
436 dialog->
Show(
true );
442 wxBoxSizer* sizer =
new wxBoxSizer( wxVERTICAL );
447 sizer->Add( diffWidget, 1, wxEXPAND | wxALL, 5 );
448 aParentPanel->SetSizer( sizer );
449 aParentPanel->Layout();
463 blocking_win->Close(
true );
465 simFrame->Show(
true );
468 if( simFrame->IsIconized() )
469 simFrame->Iconize(
false );
480 std::vector<EMBEDDED_FILES*> filesStack;
490 filesStack.push_back( symbol );
500 filesStack.push_back( entry );
506 if( selection.
Empty() )
515 filesStack.push_back( symbol->
Schematic() );
523 m_frame->ShowInfoBarError(
_(
"No datasheet defined." ) );
544 if( symbolEditFrame || schEditFrame )
546 if( selection.GetSize() == 1 )
549 std::vector<MSG_PANEL_ITEM> msgItems;
552 msgItems.emplace_back(
_(
"UUID" ), *uuid );
555 m_frame->SetMsgPanel( msgItems );
constexpr BOX2I KiROUND(const BOX2D &aBoxD)
static TOOL_ACTION excludeMarker
static TOOL_ACTION nextMarker
static TOOL_ACTION showDatasheet
static TOOL_ACTION prevMarker
wxPanel * AddBlankPage(const wxString &aTitle)
WX_HTML_REPORT_BOX * AddHTMLPage(const wxString &aTitle)
void SetUserItemID(const KIID &aID)
void ExcludeMarker(SCH_MARKER *aMarker=nullptr)
Exclude aMarker from the ERC list.
void SelectMarker(const SCH_MARKER *aMarker)
bool Show(bool show) override
A base class for most all the KiCad significant classes used in schematics and boards.
KICAD_T Type() const
Returns the type of object.
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.
virtual const wxString & GetText() const
Return the string associated with the text object.
static const TOOL_EVENT ClearedEvent
static const TOOL_EVENT SelectedEvent
static const TOOL_EVENT SelectedItemsModified
Selected items were moved, this can be very high frequency on the canvas, use with care.
static const TOOL_EVENT PointSelectedEvent
static const TOOL_EVENT UnselectedEvent
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.
KIWAY & Kiway() const
Return a reference to the KIWAY that this object has an opportunity to participate in.
wxWindow * GetBlockingDialog()
Gets the window pointer to the blocking dialog (to send it signals)
A logical library item identifier and consists of various portions much like a URI.
const UTF8 & GetLibItemName() const
const UTF8 & GetLibNickname() const
Return the logical library name portion of a LIB_ID.
Define a library symbol object.
SCH_FIELD & GetDatasheetField()
Return reference to the datasheet field.
std::unique_ptr< LIB_SYMBOL > Flatten() const
Return a flattened symbol inheritance to the caller.
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)
static SYMBOL_LIB_TABLE * SchSymbolLibTable(PROJECT *aProject)
Accessor for project symbol library table.
static SEARCH_STACK * SchSearchS(PROJECT *aProject)
Accessor for Eeschema search stack.
SCH_SHEET_PATH & CurrentSheet() const
static TOOL_ACTION showBusSyntaxHelp
static TOOL_ACTION checkSymbol
static TOOL_ACTION showSimulator
static TOOL_ACTION runERC
Inspection and Editing.
static TOOL_ACTION diffSymbol
A shim class between EDA_DRAW_FRAME and several derived classes: SYMBOL_EDIT_FRAME,...
static SELECTION_CONDITION SingleSymbol
static SELECTION_CONDITION SingleNonExcludedMarker
Schematic editor (Eeschema) main window.
void UpdateHierarchySelection()
Update the hierarchy navigation tree selection (cross-probe from schematic to hierarchy pane).
DIALOG_BOOK_REPORTER * GetSymbolDiffDialog()
DIALOG_ERC * GetErcDialog()
EDA_ITEM * ResolveItem(const KIID &aId, bool aAllowNullptrReturn=false) const override
Fetch an item by KIID.
void UpdateNetHighlightStatus()
wxString GetShownText(const SCH_SHEET_PATH *aPath, bool aAllowExtraText, int aDepth=0) const
SCHEMATIC * Schematic() const
Search the item hierarchy to find a SCHEMATIC.
void GetFields(std::vector< SCH_FIELD * > &aVector, bool aVisibleOnly) const override
Populate a std::vector with SCH_FIELDs, sorted in ordinal order.
VECTOR2I GetPosition() const override
const LIB_ID & GetLibId() const override
std::unique_ptr< LIB_SYMBOL > & GetLibSymbolRef()
SCH_FIELD * GetField(FIELD_T aFieldType)
Return a mandatory field in this symbol.
static HTML_MESSAGE_BOX * ShowSyntaxHelp(wxWindow *aParentWindow)
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.
bool Empty() const
Checks if there is anything selected.
The SIMULATOR_FRAME holds the main user-interface for running simulations.
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.
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.
This file is part of the common library.
bool GetAssociatedDocument(wxWindow *aParent, const wxString &aDocName, PROJECT *aProject, SEARCH_STACK *aPaths, std::vector< EMBEDDED_FILES * > aFilesStack)
Open a document (file) with the suitable browser.
This file is part of the common library.
@ ERCE_BUS_TO_NET_CONFLICT
A bus wire is graphically connected to a net port/pin (or vice versa).
@ ERCE_LIB_SYMBOL_MISMATCH
Symbol doesn't match copy in library.
@ FRAME_SCH_SYMBOL_EDITOR
std::optional< wxString > GetMsgPanelDisplayUuid(const KIID &aKiid)
Get a formatted UUID string for display in the message panel, according to the current advanced confi...
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 library symbol to find incorrect settings.
@ DATASHEET
name of datasheet
@ REFERENCE
Field Reference of part, i.e. "IC21".