80 wxCommandEvent* evt =
new wxCommandEvent( EDA_EVT_CLOSE_ERC_DIALOG, wxID_ANY );
153 wxCHECK( selectionTool, 0 );
164 if( !dlg->IsShown() )
187 if( selection.GetSize() == 1 && selection.Front()->Type() ==
SCH_MARKER_T )
188 marker =
static_cast<SCH_MARKER*
>( selection.Front() );
203 if( marker !=
nullptr )
225 std::vector<wxString> messages;
226 const int grid_size =
KiROUND(
getView()->GetGAL()->GetGridSize().x );
230 if( messages.empty() )
238 for(
const wxString& single_msg : messages )
252 wxCHECK( schEditorFrame, 0 );
256 if( selection.
Empty() )
264 wxCHECK( dialog, 0 );
269 wxString symbolDesc = wxString::Format(
_(
"Symbol %s" ),
277 r->
Report( wxS(
"<h7>" ) +
_(
"Schematic vs library diff for:" ) + wxS(
"</h7>" ) );
279 + wxS(
"<li>" ) +
_(
"Library: " ) +
EscapeHTML( libName ) + wxS(
"</li>" )
280 + wxS(
"<li>" ) +
_(
"Library item: " ) +
EscapeHTML( symbolName )
281 + wxS(
"</li></ul>" ) );
290 r->
Report(
_(
"The library is not included in the current configuration." )
291 + wxS(
"  " )
292 + wxS(
"<a href='$CONFIG'>" ) +
_(
"Manage Symbol Libraries" ) + wxS(
"</a>" ) );
294 else if( !libTable->
HasLibrary( libName,
true ) )
296 r->
Report(
_(
"The library is not enabled in the current configuration." )
297 + wxS(
"  " )
298 + wxS(
"<a href='$CONFIG'>" ) +
_(
"Manage Symbol Libraries" ) + wxS(
"</a>" ) );
302 std::unique_ptr<LIB_SYMBOL> flattenedLibSymbol;
303 std::unique_ptr<LIB_SYMBOL> flattenedSchSymbol = symbol->
GetLibSymbolRef()->Flatten();
308 flattenedLibSymbol = libAlias->Flatten();
314 if( !flattenedLibSymbol )
316 r->
Report( wxString::Format(
_(
"The library no longer contains the item %s." ),
321 std::vector<LIB_FIELD> fields;
325 fields.emplace_back(
LIB_FIELD( flattenedLibSymbol.get(), field.GetId(),
326 field.GetName(
false ) ) );
327 fields.back().CopyText( field );
328 fields.back().SetAttributes( field );
332 flattenedSchSymbol->SetFields( fields );
336 if( flattenedSchSymbol->Compare( *flattenedLibSymbol, flags, r ) == 0 )
337 r->
Report(
_(
"No relevant differences detected." ) );
342 diff->
DisplayDiff( flattenedSchSymbol.release(), flattenedLibSymbol.release(),
350 dialog->
Show(
true );
357 wxBoxSizer* sizer =
new wxBoxSizer( wxVERTICAL );
362 sizer->Add( diffWidget, 1, wxEXPAND | wxALL, 5 );
363 aParentPanel->SetSizer( sizer );
364 aParentPanel->Layout();
378 blocking_win->Close(
true );
380 simFrame->Show(
true );
383 if( simFrame->IsIconized() )
384 simFrame->Iconize(
false );
418 if( selection.
Empty() )
450 if( symbolEditFrame || schEditFrame )
452 if( selection.GetSize() == 1 )
456 std::vector<MSG_PANEL_ITEM> msgItems;
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
The base class for create windows for drawing purpose.
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 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)
Field object used in symbol libraries.
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.
LIB_FIELD & GetDatasheetField()
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)
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.
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
SCH_FIELD * GetField(MANDATORY_FIELD_T aFieldType)
Return a mandatory field in this symbol.
VECTOR2I GetPosition() const override
const LIB_ID & GetLibId() const
void GetFields(std::vector< SCH_FIELD * > &aVector, bool aVisibleOnly)
Populate a std::vector with SCH_FIELDs.
std::unique_ptr< LIB_SYMBOL > & GetLibSymbolRef()
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)
Open a document (file) with the suitable browser.
This file is part of the common 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, EDA_DRAW_FRAME *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".
constexpr ret_type KiROUND(fp_type v)
Round a floating point number to an integer using "round halfway cases away from zero".