63#include <wx/filedlg.h>
64#include <wx/filename.h>
96 wxCommandEvent* evt =
new wxCommandEvent( EDA_EVT_CLOSE_ERC_DIALOG, wxID_ANY );
126 if( wxButton* okButton =
dynamic_cast<wxButton*
>( dlg->FindWindow( wxID_OK ) ) )
129 okButton->SetDefault();
175 wxCHECK( selectionTool, 0 );
184 if( dlg && dlg->IsShownOnScreen() )
205 if( !dlg->IsShownOnScreen() )
227 return wxEmptyString;
237 EDA_ITEM* a =
frame->ResolveItem( aERCItem->GetMainItemID() );
257 if( selection.GetSize() == 1 && selection.Front()->Type() ==
SCH_MARKER_T )
258 marker =
static_cast<SCH_MARKER*
>( selection.Front() );
287 std::vector<wxString> messages;
288 const int grid_size =
KiROUND(
getView()->GetGAL()->GetGridSize().x );
292 if( messages.empty() )
300 for(
const wxString& single_msg : messages )
328 wxCHECK( schEditorFrame, 0 );
332 if( selection.
Empty() )
334 m_frame->ShowInfoBarError(
_(
"Select a symbol to diff against its library equivalent." ) );
347 wxCHECK( schEditorFrame, );
363 r->
Report( wxS(
"<h7>" ) +
_(
"Schematic vs library diff for:" ) + wxS(
"</h7>" ) );
365 + wxS(
"<li>" ) +
_(
"Library: " ) +
EscapeHTML( libName ) + wxS(
"</li>" )
366 + wxS(
"<li>" ) +
_(
"Library item: " ) +
EscapeHTML( symbolName )
367 + 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>" ) );
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." ), symbolName ) );
405 std::vector<SCH_FIELD> fields;
409 fields.emplace_back(
SCH_FIELD( flattenedLibSymbol.get(), field.GetId(), field.GetName(
false ) ) );
410 fields.back().CopyText( field );
411 fields.back().SetAttributes( field );
415 flattenedSchSymbol->SetFields( fields );
419 if( flattenedSchSymbol->Compare( *flattenedLibSymbol, flags, r ) == 0 )
420 r->
Report(
_(
"No relevant differences detected." ) );
425 diff->
DisplayDiff( flattenedSchSymbol.release(), flattenedLibSymbol.release(),
433 dialog->
Show(
true );
439 wxBoxSizer* sizer =
new wxBoxSizer( wxVERTICAL );
444 sizer->Add( diffWidget, 1, wxEXPAND | wxALL, 5 );
445 aParentPanel->SetSizer( sizer );
446 aParentPanel->Layout();
455 std::map<KIID, KIGFX::COLOR4D>& aRefO, std::map<KIID, KIGFX::COLOR4D>& aCompO,
456 std::map<KIID, KICAD_DIFF::CATEGORY>& aCats )
465 if( !aChange.id.empty() )
467 const KIID& kiid = aChange.id.back();
470 switch( aChange.kind )
498 std::map<KIID, KIGFX::COLOR4D> aRefOverrides,
499 std::map<KIID, KIGFX::COLOR4D> aCompOverrides,
500 std::map<KIID, KICAD_DIFF::CATEGORY> aCategories,
503 return [aRef, aComp, modifiedColor = aTheme.
modified, removedColor = aTheme.
removed,
504 refO = std::move( aRefOverrides ), compO = std::move( aCompOverrides ),
510 if( !aSheetPath.empty() )
513 compScreen = sp->LastScreen();
516 refScreen = sp->LastScreen();
520 auto removed = std::make_shared<std::vector<std::unique_ptr<SCH_ITEM>>>();
524 for(
const auto& [kiid, c] : refO )
526 if( c != removedColor )
531 if( item && item->m_Uuid == kiid )
533 if(
auto* clone =
dynamic_cast<SCH_ITEM*
>( item->Clone() ) )
534 removed->emplace_back( clone );
542 std::vector<KIGFX::VIEW_ITEM*> extras;
544 for(
const auto& clone : *removed )
545 extras.push_back( clone.get() );
548 compScreen, removed );
555 SCH_SHEET_PATH editorPath;
563 const DRILL_FRAME& aFrame )
568 if( !scope.empty() && !aFrame.compScope.empty() )
569 differ.SetScope( scope, aFrame.compScope );
573 std::map<KIID, KIGFX::COLOR4D> refO;
574 std::map<KIID, KIGFX::COLOR4D> compO;
575 std::map<KIID, KICAD_DIFF::CATEGORY> cats;
576 buildSchOverrides( diff, aTheme, refO, compO, cats );
578 auto switcher = makeSchSwitcher( aRefSch, aFrame.compSch, refO, compO, cats, aTheme );
581 wxString refLabel = refScreen ? refScreen->
GetFileName() : wxString();
583 aDlg.
Reload( refLabel, aFrame.compFile, std::move( diff ), {},
584 {}, std::move( switcher ), scope );
593 wxCHECK( schEditorFrame, 0 );
595 wxFileDialog dlg( schEditorFrame,
_(
"Choose Schematic to Compare With" ), wxEmptyString,
598 if( dlg.ShowModal() != wxID_OK )
601 wxFileName otherFn( dlg.GetPath() );
602 otherFn.MakeAbsolute();
606 schEditorFrame->
ShowInfoBarError(
_(
"Select a KiCad s-expression schematic file (.kicad_sch)." ) );
610 const wxString otherPath = otherFn.GetFullPath();
612 wxFileName projectFn = otherFn;
614 const wxString projectPath = projectFn.GetFullPath();
617 activeProjectFn.MakeAbsolute();
621 if( projectFn.SameAs( activeProjectFn ) )
623 schEditorFrame->
ShowInfoBarError(
_(
"Select a schematic file from another project to compare." ) );
632 const wxString& aComparisonLabel )
636 wxCHECK( schEditorFrame, 0 );
645 bool projectLoadOk = mgr->
LoadProject( aProjectPath,
false );
650 schEditorFrame->
ShowInfoBarError( wxString::Format(
_(
"Failed to load project for %s" ), aOtherPath ) );
654 if( !projectLoadOk && wxFileName( aProjectPath ).FileExists() )
657 schEditorFrame->
ShowInfoBarError( wxString::Format(
_(
"Failed to load project for %s" ), aOtherPath ) );
674 schEditorFrame->
ShowInfoBarError( wxString::Format(
_(
"Failed to load %s" ), aOtherPath ) );
686 if( loadedSchematic == mySch )
688 schEditorFrame->
ShowInfoBarError(
_(
"Select a schematic file from another project to compare." ) );
693 std::unique_ptr<SCHEMATIC> otherSchematic{ loadedSchematic };
695 if( !otherSchematic )
697 schEditorFrame->
ShowInfoBarError( wxString::Format(
_(
"Failed to load %s" ), aOtherPath ) );
707 const SCH_SHEET_LIST otherSheets = otherSchematic->BuildSheetListSortedByPageNumbers();
710 if(
auto sp = otherSchematic->Hierarchy().GetSheetPathByKIIDPath( scopeBefore,
true ) )
711 scopeAfter = sp->Path();
712 else if( !otherSheets.empty() )
713 scopeAfter = otherSheets.front().Path();
715 if( !scopeBefore.empty() && !scopeAfter.empty() )
716 differ.
SetScope( scopeBefore, scopeAfter );
722 std::map<KIID, KIGFX::COLOR4D> refOverrides;
723 std::map<KIID, KIGFX::COLOR4D> compOverrides;
724 std::map<KIID, KICAD_DIFF::CATEGORY> kiidCategories;
726 buildSchOverrides(
result, theme, refOverrides, compOverrides, kiidCategories );
735 compOverrides, kiidCategories, theme );
742 std::move( compGeometry ), std::move( initialSwitcher ), std::move( initialSheet ) );
746 DRILL_FRAME drillCurrent{ schEditorFrame->
GetCurrentSheet(), otherSchematic.get(), aOtherPath, scopeAfter };
748 std::vector<DRILL_FRAME> drillBack;
749 std::vector<std::unique_ptr<SCHEMATIC>> drilledSchs;
751 drilledSchs.push_back( std::move( otherSchematic ) );
755 canvas->SetDoubleClickHandler(
756 [&dlgDiff, &drillCurrent, &drillBack, &drilledSchs, mySch, otherPrj, theme,
759 auto* sheet =
dynamic_cast<SCH_SHEET*
>( aItem );
766 if( sheetFile.IsEmpty() )
769 KIID_PATH newEditorKiid = drillCurrent.editorPath.Path();
770 newEditorKiid.push_back( sheet->m_Uuid );
774 if( !newEditorSheet )
779 DRILL_FRAME
next{ *newEditorSheet, drillCurrent.compSch, drillCurrent.compFile,
KIID_PATH() };
781 if(
auto compMatch =
next.compSch->Hierarchy().GetSheetPathByKIIDPath( newEditorKiid,
true ) )
783 next.compScope = compMatch->Path();
785 if(
SCH_SCREEN* compMatchScreen = compMatch->LastScreen() )
786 next.compFile = compMatchScreen->GetFileName();
790 wxFileName newCompFn( sheetFile );
791 newCompFn.MakeAbsolute( wxFileName( drillCurrent.compFile ).GetPath() );
801 newCompFn.GetFullPath() ) );
807 if( !loadedSheets.empty() )
808 next.compScope = loadedSheets.front().Path();
810 drilledSchs.emplace_back( loaded );
811 next.compSch = loaded;
812 next.compFile = newCompFn.GetFullPath();
815 reloadDrillFrame( dlgDiff, mySch, theme,
next );
817 drillBack.push_back( drillCurrent );
823 [&dlgDiff, &drillCurrent, &drillBack, mySch, theme]()
825 if( drillBack.empty() )
828 reloadDrillFrame( dlgDiff, mySch, theme, drillBack.back() );
830 drillCurrent = drillBack.back();
831 drillBack.pop_back();
832 dlgDiff.
EnableUp( !drillBack.empty() );
839 canvas->SetContextItems( {} );
843 for(
auto& sch : drilledSchs )
846 sch->SetProject(
nullptr );
861 wxCHECK( schEditorFrame, 0 );
867 schEditorFrame->
ShowInfoBarError(
_(
"Save the schematic before comparing against local history." ) );
874 std::vector<LOCAL_HISTORY_SNAPSHOT_INFO> snapshots = history.
GetSnapshots( projectPath );
876 if( snapshots.empty() )
878 schEditorFrame->
ShowInfoBarError(
_(
"No local history snapshots for this project." ) );
887 [&](
const wxString& aFull )
889 wxFileName fn( aFull );
890 fn.MakeRelativeTo( projectPath );
891 return fn.GetFullPath( wxPATH_UNIX );
894 const wxString rootRel = relTo( mySch->
GetFileName() );
900 std::vector<LOCAL_HISTORY_SNAPSHOT_INFO> filtered;
901 wxString prevFingerprint;
905 wxString fingerprint = history.
TreeFingerprint( projectPath, s.hash, wxS(
".kicad_sch" ) );
907 if( fingerprint.IsEmpty() || fingerprint == prevFingerprint )
910 prevFingerprint = fingerprint;
911 filtered.push_back( s );
914 if( filtered.empty() )
916 schEditorFrame->
ShowInfoBarError(
_(
"No local history snapshots change this schematic." ) );
920 snapshots = std::move( filtered );
922 std::vector<wxString> labels;
926 wxString summary = s.summary.IsEmpty() ? s.message.BeforeFirst(
'\n' ) : s.summary;
927 labels.push_back( wxString::Format( wxS(
"%s (%s)" ), summary, s.hash.Left( 8 ) ) );
943 [&](
SCHEMATIC* aComp,
const wxString& aPath ) -> SCH_DIFF_VIEW
952 scopeAfter = sp->Path();
958 if( !sheets.empty() )
959 scopeAfter = sheets.front().Path();
962 if( !scopeBefore.empty() && !scopeAfter.empty() )
963 differ.
SetScope( scopeBefore, scopeAfter );
965 view.compScope = scopeAfter;
966 view.result = differ.
Diff();
968 std::map<KIID, KIGFX::COLOR4D> refO;
969 std::map<KIID, KIGFX::COLOR4D> compO;
970 std::map<KIID, KICAD_DIFF::CATEGORY> cats;
971 buildSchOverrides( view.result, theme, refO, compO, cats );
975 view.switcher = makeSchSwitcher( mySch, aComp, refO, compO, cats, theme );
981 std::unique_ptr<SCHEMATIC> curSch;
987 DRILL_FRAME drillCurrent;
988 std::vector<DRILL_FRAME> drillBack;
989 std::vector<std::unique_ptr<SCHEMATIC>> drilledSchs;
991 auto cleanupCurrent =
994 for( std::unique_ptr<SCHEMATIC>& sch : drilledSchs )
997 sch->SetProject(
nullptr );
1000 drilledSchs.clear();
1004 curSch->SetProject(
nullptr );
1014 if( !curTempDir.IsEmpty() )
1016 wxFileName::Rmdir( curTempDir, wxPATH_RMDIR_RECURSIVE );
1024 [&](
int aIndex, std::unique_ptr<SCHEMATIC>& aSch,
PROJECT*& aPrj, wxString& aTempDir ) ->
bool
1026 const wxString hash = snapshots[aIndex].hash;
1028 dirFn.AssignDir( wxFileName::GetTempDir() );
1029 dirFn.AppendDir( wxS(
"kicad-history-" ) + hash.Left( 8 ) );
1030 const wxString tempDir = dirFn.GetPath();
1035 { wxS(
".kicad_sch" ), wxS(
".kicad_pro" ) } ) )
1037 wxFileName::Rmdir( tempDir, wxPATH_RMDIR_RECURSIVE );
1041 const wxString root = tempDir + wxS(
"/" ) + rootRel;
1042 const wxString proj = tempDir + wxS(
"/" ) + projRel;
1049 wxFileName::Rmdir( tempDir, wxPATH_RMDIR_RECURSIVE );
1064 wxFileName::Rmdir( tempDir, wxPATH_RMDIR_RECURSIVE );
1068 if( !loaded || loaded == mySch )
1071 wxFileName::Rmdir( tempDir, wxPATH_RMDIR_RECURSIVE );
1075 aSch.reset( loaded );
1082 [&](
int aIndex, std::unique_ptr<SCHEMATIC>& aSch,
PROJECT*& aPrj, wxString& aTempDir,
1083 SCH_DIFF_VIEW& aView ) ->
bool
1085 if( !loadRevision( aIndex, aSch, aPrj, aTempDir ) )
1090 aView = buildView( aSch.get(), aTempDir + wxS(
"/" ) + rootRel );
1094 aSch->SetProject(
nullptr );
1098 wxFileName::Rmdir( aTempDir, wxPATH_RMDIR_RECURSIVE );
1109 if( !loadView( 0, curSch, curPrj, curTempDir, view ) )
1111 schEditorFrame->
ShowInfoBarError(
_(
"Could not compare against the selected snapshot." ) );
1117 while( view.result.Empty() && startIndex + 1 <
static_cast<int>( snapshots.size() ) )
1119 std::unique_ptr<SCHEMATIC> nextSch;
1121 wxString nextTempDir;
1122 SCH_DIFF_VIEW nextView;
1124 if( !loadView( startIndex + 1, nextSch, nextPrj, nextTempDir, nextView ) )
1128 view = std::move( nextView );
1129 curSch = std::move( nextSch );
1131 curTempDir = nextTempDir;
1135 drillCurrent = { schEditorFrame->
GetCurrentSheet(), curSch.get(), curTempDir + wxS(
"/" ) + rootRel,
1138 int shownIndex = startIndex;
1143 std::unique_ptr<DIALOG_KICAD_DIFF> dlgDiff = std::make_unique<DIALOG_KICAD_DIFF>( schEditorFrame, referenceLabel,
1144 labels[startIndex], view.result,
1145 view.refGeom, view.compGeom,
1146 view.switcher, scopeBefore );
1152 canvas->SetDoubleClickHandler(
1161 newEditorKiid.push_back( sheet->
m_Uuid );
1165 if( !newEditorSheet )
1168 DRILL_FRAME
next{ *newEditorSheet, drillCurrent.compSch, drillCurrent.compFile,
KIID_PATH() };
1170 if(
auto compMatch =
next.compSch->Hierarchy().GetSheetPathByKIIDPath( newEditorKiid,
true ) )
1172 next.compScope = compMatch->Path();
1174 if(
SCH_SCREEN* matchScreen = compMatch->LastScreen() )
1175 next.compFile = matchScreen->GetFileName();
1180 subFn.MakeAbsolute( wxFileName( drillCurrent.compFile ).GetPath() );
1195 if( !loaded || loaded == mySch )
1198 subFn.GetFullPath() ) );
1204 if( !loadedSheets.empty() )
1205 next.compScope = loadedSheets.front().Path();
1207 drilledSchs.emplace_back( loaded );
1208 next.compSch = loaded;
1209 next.compFile = subFn.GetFullPath();
1214 reloadDrillFrame( *dlgDiff, mySch, theme,
next );
1218 schEditorFrame->
ShowInfoBarError(
_(
"Could not open this sheet for comparison." ) );
1222 drillBack.push_back( drillCurrent );
1223 drillCurrent =
next;
1224 dlgDiff->EnableUp(
true );
1227 dlgDiff->SetUpHandler(
1230 if( drillBack.empty() )
1235 reloadDrillFrame( *dlgDiff, mySch, theme, drillBack.back() );
1239 schEditorFrame->
ShowInfoBarError(
_(
"Could not open this sheet for comparison." ) );
1243 drillCurrent = drillBack.back();
1244 drillBack.pop_back();
1245 dlgDiff->EnableUp( !drillBack.empty() );
1249 dlgDiff->SetRevisionChooser(
1253 if( aIndex == shownIndex )
1256 std::unique_ptr<SCHEMATIC> newSch;
1258 wxString newTempDir;
1259 SCH_DIFF_VIEW newView;
1261 if( !loadView( aIndex, newSch, newPrj, newTempDir, newView ) )
1263 schEditorFrame->
ShowInfoBarError(
_(
"Could not compare against the selected snapshot." ) );
1267 dlgDiff->Reload( referenceLabel, labels[aIndex], newView.result, newView.refGeom,
1268 newView.compGeom, newView.switcher, scopeBefore );
1271 view = std::move( newView );
1272 curSch = std::move( newSch );
1274 curTempDir = newTempDir;
1275 shownIndex = aIndex;
1279 drillCurrent = { schEditorFrame->
GetCurrentSheet(), curSch.get(), curTempDir + wxS(
"/" ) + rootRel,
1281 dlgDiff->EnableUp(
false );
1284 dlgDiff->ShowModal();
1302 blocking_win->Close(
true );
1304 simFrame->Show(
true );
1307 if( simFrame->IsIconized() )
1308 simFrame->Iconize(
false );
1319 std::vector<EMBEDDED_FILES*> filesStack;
1331 filesStack.push_back( symbol );
1343 filesStack.push_back( entry );
1349 if( selection.
Empty() )
1358 filesStack.push_back( symbol->
Schematic() );
1369 m_frame->ShowInfoBarError(
_(
"No datasheet defined." ) );
1390 if( symbolEditFrame || schEditFrame )
1392 if( selection.GetSize() == 1 )
1395 std::vector<MSG_PANEL_ITEM> msgItems;
1398 msgItems.emplace_back(
_(
"UUID" ), *uuid );
1401 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)
File-compare dialog (Phase 7).
void SetUpHandler(UP_HANDLER aHandler)
std::function< void(WIDGET_DIFF_CANVAS &, const KIID_PATH &)> SHEET_SWITCHER
WIDGET_DIFF_CANVAS * DiffCanvas() const
void EnableUp(bool aEnable)
void Reload(const wxString &aReferencePath, const wxString &aComparisonPath, KICAD_DIFF::DOCUMENT_DIFF aDiff, KICAD_DIFF::DOCUMENT_GEOMETRY aReferenceGeometry, KICAD_DIFF::DOCUMENT_GEOMETRY aComparisonGeometry, SHEET_SWITCHER aSheetSwitcher, KIID_PATH aInitialSheet)
Swap in a fresh diff with new schematics.
bool Show(bool show) override
SETTINGS_MANAGER * GetSettingsManager() const
void ShowInfoBarError(const wxString &aErrorMsg, bool aShowCloseButton=false, INFOBAR_MESSAGE_TYPE aType=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...
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.
static SCHEMATIC * LoadSchematic(const wxString &aFileName, bool aSetActive, bool aForceDefaultProject, PROJECT *aProject=nullptr, bool aCalculateConnectivity=true, REPORTER *aRootReporter=nullptr)
static const TOOL_EVENT ClearedEvent
static const TOOL_EVENT SelectedEvent
static const TOOL_EVENT SelectedItemsModified
Selected item had a property changed (except movement)
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.
Diff two already-parsed SCHEMATICs and produce a DOCUMENT_DIFF.
void SetScope(const KIID_PATH &aBeforeScope, const KIID_PATH &aAfterScope)
Restrict the diff to one sheet on each side.
DOCUMENT_DIFF Diff() override
Produce a DOCUMENT_DIFF of the inputs the concrete differ was constructed with.
An abstract base class for deriving all objects that can be added to a VIEW.
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.
wxWindow * GetBlockingDialog()
Gets the window pointer to the blocking dialog (to send it signals)
LOCAL_HISTORY & LocalHistory()
Return the LOCAL_HISTORY associated with this KIWAY.
bool HasLibrary(const wxString &aNickname, bool aCheckEnabled=false) const
Test for the existence of aNickname in the library tables.
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()
void AppendParentEmbeddedFiles(std::vector< EMBEDDED_FILES * > &aStack) const
std::unique_ptr< LIB_SYMBOL > Flatten() const
Return a flattened symbol inheritance to the caller.
Simple local history manager built on libgit2.
std::vector< LOCAL_HISTORY_SNAPSHOT_INFO > GetSnapshots(const wxString &aProjectPath)
Snapshots (commits) for the project, newest first.
wxString TreeFingerprint(const wxString &aProjectPath, const wxString &aHash, const wxString &aExtension)
Fingerprint of all files ending in aExtension recorded by commit aHash (sorted path:blob pairs).
bool ExtractAllFilesAtCommit(const wxString &aProjectPath, const wxString &aHash, const wxString &aDestDir, const std::vector< wxString > &aExtensions={})
Write files recorded at aHash into aDestDir, recreating the project's relative folder structure.
static SYMBOL_LIBRARY_ADAPTER * SymbolLibAdapter(PROJECT *aProject)
Accessor for project symbol library manager adapter.
static SEARCH_STACK * SchSearchS(PROJECT *aProject)
Accessor for Eeschema search stack.
Container for project specific data.
virtual const wxString GetProjectFullName() const
Return the full path and name of the project.
virtual const wxString GetProjectPath() const
Return the full path of the project.
Holds all the data relating to one schematic.
SCH_SHEET_LIST BuildSheetListSortedByPageNumbers() const
wxString GetFileName() const
Helper to retrieve the filename from the root sheet screen.
SCHEMATIC_SETTINGS & Settings() const
SCH_SHEET_LIST Hierarchy() const
Return the full schematic flattened hierarchical sheet list.
SCH_SCREEN * RootScreen() const
Helper to retrieve the screen of the root sheet.
SCH_SHEET_PATH & CurrentSheet() const
static TOOL_ACTION compareSchematicWithHistory
static TOOL_ACTION showBusSyntaxHelp
static TOOL_ACTION checkSymbol
static TOOL_ACTION compareSchematicWithFile
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).
SCH_SHEET_PATH & GetCurrentSheet() const
SCHEMATIC & Schematic() const
DIALOG_BOOK_REPORTER * GetSymbolDiffDialog()
void UpdateNetHighlightStatus()
virtual const wxString & GetText() const override
Return the string associated with the text object.
wxString GetShownText(const SCH_SHEET_PATH *aPath, RESOLUTION_CONTEXT aContext, const wxString &aVariantName=wxEmptyString, int aDepth=0) const
Base class for any item which can be embedded within the SCHEMATIC container class,...
SCHEMATIC * Schematic() const
Search the item hierarchy to find a SCHEMATIC.
EE_RTREE & Items()
Get the full RTree, usually for iterating.
const wxString & GetFileName() const
A container for handling SCH_SHEET_PATH objects in a flattened hierarchy.
std::optional< SCH_SHEET_PATH > GetSheetPathByKIIDPath(const KIID_PATH &aPath, bool aIncludeLastSheet=true) const
Finds a SCH_SHEET_PATH that matches the provided KIID_PATH.
KIID_PATH Path() const
Get the sheet path as an KIID_PATH.
SCH_SCREEN * LastScreen()
Sheet symbol placed in a schematic, and is the entry point for a sub schematic.
wxString GetFileName() const
Return the filename corresponding to this sheet.
EMBEDDED_FILES * GetEmbeddedFiles() override
SCH_SYMBOLs don't currently support embedded files, but their LIB_SYMBOL counterparts do.
wxString GetCurrentSheetRef() const
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.
bool IsProjectLoaded(PROJECT *aProject) const
True if aProject is still owned by the manager.
PROJECT * GetProject(const wxString &aFullPath) const
Retrieve a loaded project by name.
bool UnloadProject(PROJECT *aProject, bool aSave=true)
Save, unload and unregister the given PROJECT.
bool LoadProject(const wxString &aFullPath, bool aSetActive=true, bool aOverrideLock=false)
Load a project or sets up a new project with a specified path.
The SIMULATOR_FRAME holds the main user-interface for running simulations.
The symbol library editor main window.
An interface to the global shared library manager that is schematic-specific and linked to one projec...
LIB_SYMBOL * LoadSymbol(const wxString &aNickname, const wxString &aName)
Load a LIB_SYMBOL having aName from the library given by aNickname.
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
static const std::string ProjectFileExtension
static const std::string KiCadSchematicFileExtension
static wxString KiCadSchematicFileWildcard()
std::optional< wxString > GetMsgPanelDisplayUuid(const KIID &aKiid)
Get a formatted UUID string for display in the message panel, according to the current advanced confi...
void ConfigureSchDiffCanvasContext(WIDGET_DIFF_CANVAS &aCanvas, SCHEMATIC *aReference, SCHEMATIC *aComparison, const KIGFX::COLOR4D &aColor, const std::map< KIID, KIGFX::COLOR4D > &aOverrides, const std::vector< KIGFX::VIEW_ITEM * > &aExtraItems, const std::map< KIID, KICAD_DIFF::CATEGORY > &aCategories, SCH_SCREEN *aReferenceScreen, SCH_SCREEN *aComparisonScreen, std::shared_ptr< const void > aOwner)
DOCUMENT_GEOMETRY ExtractSchematicGeometry(const SCHEMATIC &aSchematic, const KIGFX::COLOR4D &aColor, const std::map< KIID, KIGFX::COLOR4D > &aOverrides, bool aOnlyOverrides)
Extract a coarse outline of a SCHEMATIC into a DOCUMENT_GEOMETRY for use as background context in DIF...
CATEGORY CategoryFor(CHANGE_KIND aKind)
Map a CHANGE_KIND to the visual category it belongs to.
wxString EscapeHTML(const wxString &aString)
Return a new wxString escaped for embedding in HTML.
Diff colors with defaults for light backgrounds.
KIGFX::COLOR4D reference
Default color for source-document context geometry.
KIGFX::COLOR4D comparison
The full set of changes between two parsed documents of one type.
std::vector< ITEM_CHANGE > changes
Aggregate of background geometry extracted from one source document.
One change record on a single item.
std::vector< ITEM_CHANGE > children
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
wxString result
Test unit parsing edge cases and error handling.
Definition of file extensions used in Kicad.