85 wxCommandEvent* evt =
new wxCommandEvent( EDA_EVT_CLOSE_ERC_DIALOG, wxID_ANY );
160 wxCHECK( selectionTool, 0 );
169 if( dlg && dlg->IsShownOnScreen() )
190 if( !dlg->IsShownOnScreen() )
203 auto menuDescription =
206 wxString menuItemLabel = aAction.GetMenuLabel();
207 wxMenuBar* menuBar =
m_frame->GetMenuBar();
209 for(
size_t ii = 0; ii < menuBar->GetMenuCount(); ++ii )
211 for( wxMenuItem* menuItem : menuBar->GetMenu( ii )->GetMenuItems() )
213 if( menuItem->GetItemLabelText() == menuItemLabel )
215 wxString menuTitleLabel = menuBar->GetMenuLabelText( ii );
217 menuTitleLabel.Replace( wxS(
"&" ), wxS(
"&&" ) );
218 menuItemLabel.Replace( wxS(
"&" ), wxS(
"&&" ) );
220 return wxString::Format(
_(
"Run %s > %s" ),
227 return wxString::Format(
_(
"Run %s" ), aAction.GetFriendlyName() );
239 return wxEmptyString;
269 if( selection.GetSize() == 1 && selection.Front()->Type() ==
SCH_MARKER_T )
270 marker =
static_cast<SCH_MARKER*
>( selection.Front() );
285 if( marker !=
nullptr )
307 std::vector<wxString> messages;
308 const int grid_size =
KiROUND(
getView()->GetGAL()->GetGridSize().x );
312 if( messages.empty() )
320 for(
const wxString& single_msg : messages )
348 wxCHECK( schEditorFrame, 0 );
352 if( selection.
Empty() )
367 wxCHECK( schEditorFrame, );
375 wxString symbolDesc = wxString::Format(
_(
"Symbol %s" ),
383 r->
Report( wxS(
"<h7>" ) +
_(
"Schematic vs library diff for:" ) + wxS(
"</h7>" ) );
385 + wxS(
"<li>" ) +
_(
"Library: " ) +
EscapeHTML( libName ) + wxS(
"</li>" )
386 + wxS(
"<li>" ) +
_(
"Library item: " ) +
EscapeHTML( symbolName )
387 + wxS(
"</li></ul>" ) );
396 r->
Report(
_(
"The library is not included in the current configuration." )
397 + wxS(
"  " )
398 + wxS(
"<a href='$CONFIG'>" ) +
_(
"Manage Symbol Libraries" ) + wxS(
"</a>" ) );
400 else if( !libTable->
HasLibrary( libName,
true ) )
402 r->
Report(
_(
"The library is not enabled in the current configuration." )
403 + wxS(
"  " )
404 + wxS(
"<a href='$CONFIG'>" ) +
_(
"Manage Symbol Libraries" ) + wxS(
"</a>" ) );
408 std::unique_ptr<LIB_SYMBOL> flattenedLibSymbol;
409 std::unique_ptr<LIB_SYMBOL> flattenedSchSymbol = symbol->
GetLibSymbolRef()->Flatten();
414 flattenedLibSymbol = libAlias->Flatten();
420 if( !flattenedLibSymbol )
422 r->
Report( wxString::Format(
_(
"The library no longer contains the item %s." ),
427 std::vector<SCH_FIELD> fields;
431 fields.emplace_back(
SCH_FIELD( flattenedLibSymbol.get(), field.GetId(),
432 field.GetName(
false ) ) );
433 fields.back().CopyText( field );
434 fields.back().SetAttributes( field );
438 flattenedSchSymbol->SetFields( fields );
443 r->
Report(
_(
"No relevant differences detected." ) );
449 diff->
DisplayDiff( flattenedSchSymbol.release(), flattenedLibSymbol.release(),
457 dialog->
Show(
true );
463 wxBoxSizer* sizer =
new wxBoxSizer( wxVERTICAL );
468 sizer->Add( diffWidget, 1, wxEXPAND | wxALL, 5 );
469 aParentPanel->SetSizer( sizer );
470 aParentPanel->Layout();
484 blocking_win->Close(
true );
486 simFrame->Show(
true );
489 if( simFrame->IsIconized() )
490 simFrame->Iconize(
false );
527 if( selection.
Empty() )
562 if( symbolEditFrame || schEditFrame )
564 if( selection.GetSize() == 1 )
568 std::vector<MSG_PANEL_ITEM> msgItems;
constexpr BOX2I KiROUND(const BOX2D &aBoxD)
static TOOL_ACTION excludeMarker
static TOOL_ACTION nextMarker
static TOOL_ACTION prevMarker
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.
void SelectMarker(const SCH_MARKER *aMarker)
bool Show(bool show) 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.
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 TOOL_ACTION runERC
static TOOL_ACTION showSimulator
static TOOL_ACTION diffSymbol
static TOOL_ACTION showDatasheet
Inspection and Editing.
static TOOL_ACTION checkSymbol
static TOOL_ACTION showBusSyntaxHelp
static SELECTION_CONDITION SingleSymbol
static SELECTION_CONDITION SingleNonExcludedMarker
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.
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...
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.
virtual KIWAY_PLAYER * Player(FRAME_T aFrameType, bool doCreate=true, wxTopLevelWindow *aParent=nullptr)
Return the KIWAY_PLAYER* given a FRAME_T.
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() 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)
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 override
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,...
wxString GetShownText(const SCH_SHEET_PATH *aPath, bool aAllowExtraText, int aDepth=0) const
SCHEMATIC * Schematic() const
Searches the item hierarchy to find a SCHEMATIC.
SCH_FIELD * GetField(MANDATORY_FIELD_T aFieldType)
Return a mandatory field in this symbol.
VECTOR2I GetPosition() const override
const LIB_ID & GetLibId() const override
void GetFields(std::vector< SCH_FIELD * > &aVector, bool aVisibleOnly)
Populate a std::vector with SCH_FIELDs.
std::unique_ptr< LIB_SYMBOL > & GetLibSymbolRef()
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, EMBEDDED_FILES *aFiles)
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
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".