105 [aKiway](
JOB* job, wxWindow* aParent ) ->
bool
111 wxCHECK( bomJob && editFrame,
false );
121 [](
JOB* job, wxWindow* aParent ) ->
bool
126 [aKiway](
JOB* job, wxWindow* aParent ) ->
bool
132 wxCHECK( netJob && editFrame,
false );
138 [aKiway](
JOB* job, wxWindow* aParent ) ->
bool
144 wxCHECK( plotJob && editFrame,
false );
149 _(
"Plotting to HPGL is no longer supported as of KiCad 10.0." ) );
157 [](
JOB* job, wxWindow* aParent ) ->
bool
162 [](
JOB* job, wxWindow* aParent ) ->
bool
167 [](
JOB* job, wxWindow* aParent ) ->
bool
172 [](
JOB* job, wxWindow* aParent ) ->
bool
177 [](
JOB* job, wxWindow* aParent ) ->
bool
181 wxCHECK( ercJob,
false );
187 [](
JOB* job, wxWindow* aParent ) ->
bool
192 [](
JOB* job, wxWindow* aParent ) ->
bool
214 if( !
Pgm().IsGUI() &&
Pgm().GetSettingsManager().IsProjectOpenNotDummy() )
217 wxString schPath = aPath;
219 if( schPath.IsEmpty() )
224 schPath =
path.GetFullPath();
239 else if(
Pgm().IsGUI() &&
Pgm().GetSettingsManager().IsProjectOpen() )
246 else if( !aPath.IsEmpty() )
249 aPath,
true,
false,
nullptr,
true, aRequireRoot ?
m_reporter :
nullptr );
259 SCHEMATIC* aSch,
const wxString& aDrawingSheetOverride )
279 auto loadSheet = [&](
const wxString&
path ) ->
bool
284 { aSch->GetEmbeddedFiles() }, &msg ) )
286 m_reporter->Report( wxString::Format(
_(
"Error loading drawing sheet '%s'." ),
path ) + wxS(
"\n" ) + msg
296 if( !aDrawingSheetOverride.IsEmpty() && loadSheet( aDrawingSheetOverride ) )
333 wxString variantName;
340 if( !variantName.IsEmpty() && variantName != wxS(
"all" ) )
343 std::unique_ptr<SCH_RENDER_SETTINGS> renderSettings = std::make_unique<SCH_RENDER_SETTINGS>();
354 renderSettings->SetDefaultFont( font );
364 for(
SCH_ITEM* item : screen->Items() )
367 for(
const auto& [libItemName, libSymbol] : screen->GetLibSymbols() )
368 libSymbol->ClearCaches();
371 std::unique_ptr<SCH_PLOTTER> schPlotter = std::make_unique<SCH_PLOTTER>( sch );
397 fn.SetName( fn.GetName() );
436 if( !variantName.IsEmpty() )
449 schPlotter->Plot( format, plotOpts, renderSettings.get(),
m_reporter );
454 for(
const wxString& outputPath : schPlotter->GetOutputFilePaths() )
481 if( variantName != wxS(
"all" ) )
498 m_reporter->Report(
_(
"Warning: schematic has annotation errors, please use the "
499 "schematic editor to fix them\n" ),
507 if(
erc.TestDuplicateSheetNames(
false ) > 0 )
510 std::unique_ptr<NETLIST_EXPORTER_BASE> helper;
511 unsigned netlistOption = 0;
519 helper = std::make_unique<NETLIST_EXPORTER_KICAD>( sch );
524 helper = std::make_unique<NETLIST_EXPORTER_ORCADPCB2>( sch );
529 helper = std::make_unique<NETLIST_EXPORTER_CADSTAR>( sch );
535 helper = std::make_unique<NETLIST_EXPORTER_SPICE>( sch );
540 helper = std::make_unique<NETLIST_EXPORTER_SPICE_MODEL>( sch );
544 fileExt = wxS(
"xml" );
545 helper = std::make_unique<NETLIST_EXPORTER_XML>( sch );
549 fileExt = wxS(
"asc" );
550 helper = std::make_unique<NETLIST_EXPORTER_PADS>( sch );
554 fileExt = wxS(
"txt" );
555 helper = std::make_unique<NETLIST_EXPORTER_ALLEGRO>( sch );
566 fn.SetName( fn.GetName() );
567 fn.SetExt( fileExt );
582 bool res = helper->WriteNetlist( outPath, netlistOption, *
m_reporter );
609 if( !currentVariant.IsEmpty() && currentVariant != wxS(
"all" ) )
621 if(
copy.CheckAnnotation(
628 m_reporter->Report(
_(
"Warning: schematic has annotation errors, please use the schematic "
629 "editor to fix them\n" ),
637 if(
erc.TestDuplicateSheetNames(
false ) > 0 )
667 std::set<wxString> userFieldNames;
669 for(
size_t i = 0; i < referenceList.
GetCount(); ++i )
671 SCH_SYMBOL* symbol = referenceList[i].GetSymbol();
675 if( !field.IsMandatory() && !field.IsPrivate() )
676 userFieldNames.insert( field.GetName() );
680 for(
const wxString& fieldName : userFieldNames )
687 if( userFieldNames.count( templateFieldname.m_Name ) == 0 )
700 const BOM_PRESET* schPreset =
nullptr;
702 for(
const BOM_PRESET& p : BOM_PRESET::BuiltInPresets() )
723 wxString::Format(
_(
"BOM preset '%s' not found" ) + wxS(
"\n" ), aBomJob->
m_bomPresetName ),
737 auto normalizeFieldName = [&dataModel](
const wxString& aName ) -> wxString
739 if( aName.IsEmpty() )
740 return wxEmptyString;
745 wxString wrapped = wxS(
"${" ) + aName + wxS(
"}" );
757 wxString fieldName = normalizeFieldName( rawFieldName );
759 if( fieldName.IsEmpty() )
767 if( fieldName == wxS(
"*" ) )
773 field.
name = modelField.name;
778 bool fieldAlreadyPresent =
false;
780 for(
BOM_FIELD& presetField : preset.fieldsOrdered )
782 if( presetField.
name == field.
name )
784 fieldAlreadyPresent =
true;
789 bool fieldLaterInList =
false;
793 if( normalizeFieldName( fieldInList ) == field.
name )
795 fieldLaterInList =
true;
800 if( !fieldAlreadyPresent && !fieldLaterInList )
801 preset.fieldsOrdered.emplace_back( field );
809 field.
name = fieldName;
810 field.
show = !fieldName.StartsWith( wxT(
"__" ), &field.
name );
822 preset.fieldsOrdered.emplace_back( field );
827 preset.sortField = normalizeFieldName( aBomJob->
m_sortField );
839 std::optional<BOM_FMT_PRESET> schFmtPreset;
861 m_reporter->Report( wxString::Format(
_(
"BOM format preset '%s' not found" ) + wxS(
"\n" ),
884 fn.SetName( fn.GetName() );
891 bool hasVariantPlaceholder = configuredPath.Contains( wxS(
"${VARIANT}" ) );
894 std::vector<wxString> variantsToProcess;
902 variantsToProcess.push_back( currentVariant );
905 for(
const wxString& variantName : variantsToProcess )
907 std::vector<wxString> singleVariant = { variantName };
915 if( hasVariantPlaceholder )
917 wxString variantPath = configuredPath;
918 variantPath.Replace( wxS(
"${VARIANT}" ), variantName );
936 if( !f.Open( outPath, wxFile::write ) )
938 m_reporter->Report( wxString::Format(
_(
"Unable to open destination '%s'" ), outPath ),
944 bool res = f.Write( dataModel.
Export( fmt ) );
985 m_reporter->Report(
_(
"Warning: schematic has annotation errors, please use the "
986 "schematic editor to fix them\n" ),
994 if(
erc.TestDuplicateSheetNames(
false ) > 0 )
997 std::unique_ptr<NETLIST_EXPORTER_XML> xmlNetlist = std::make_unique<NETLIST_EXPORTER_XML>( sch );
1002 fn.SetName( fn.GetName() +
"-bom" );
1034 std::shared_ptr<LIB_SYMBOL> parent;
1044 symbolToPlot = parent.get();
1048 for(
int unit = 1; unit < symbol->
GetUnitCount() + 1; unit++ )
1060 for( wxChar c : wxFileName::GetForbiddenChars( wxPATH_DOS ) )
1061 filename.Replace( c,
' ' );
1066 filename += wxString::Format(
"_unit%d", unit );
1070 if( bodyStyle == 2 )
1071 filename += wxS(
"_demorgan" );
1078 fn.SetName( filename );
1079 m_reporter->Report( wxString::Format(
_(
"Plotting symbol '%s' unit %d to '%s'\n" ), symbol->
GetName(),
1080 unit, fn.GetFullPath() ),
1085 if( !
PlotSymbolToSVG( *symbolToPlot, *symbol, unit, bodyStyle, symbolBB, *aRenderSettings,
1111 wxString singleFileFilter;
1113 auto schLibrary = std::make_unique<SCH_IO_KICAD_SEXPR_LIB_CACHE>( fn.GetFullPath() );
1123 bool recovered =
false;
1125 if( !fn.IsDir() && wxDir::Exists( fn.GetPath() ) )
1129 schLibrary = std::make_unique<SCH_IO_KICAD_SEXPR_LIB_CACHE>( fn.GetPath() );
1131 singleFileFilter = fn.GetFullPath();
1155 symbol = schLibrary->GetSymbol( svgJob->
m_symbol );
1168 m_reporter->Report( wxString::Format(
_(
"Unable to create output directory '%s'." ) + wxS(
"\n" ),
1192 const std::map<wxString, wxString>& sourceFiles = schLibrary->GetSymbolSourceFiles();
1193 const wxFileName filterFile( singleFileFilter );
1195 for(
const auto& [
name, libSymbol] : libSymMap )
1198 if( !singleFileFilter.IsEmpty() )
1200 auto srcIt = sourceFiles.find(
name );
1202 if( srcIt == sourceFiles.end() || !wxFileName( srcIt->second ).SameAs( filterFile ) )
1243 else if(
fileType != SCH_IO_MGR::SCH_KICAD )
1245 m_reporter->Report(
_(
"Output path must be specified to convert legacy and non-KiCad libraries\n" ),
1251 if(
fileType == SCH_IO_MGR::SCH_KICAD )
1324 fn.SetName( fn.GetName() + wxS(
"-erc" ) );
1354 std::shared_ptr<SHEETLIST_ERC_ITEMS_PROVIDER> markersProvider =
1355 std::make_shared<SHEETLIST_ERC_ITEMS_PROVIDER>( sch );
1371 if( editFrame && &editFrame->
Schematic() != sch )
1372 editFrame =
nullptr;
1384 markersProvider->SetSeverities( ercJob->
m_severity );
1386 m_reporter->Report( wxString::Format(
_(
"Found %d violations\n" ), markersProvider->GetCount() ),
1389 ERC_REPORT reportWriter( sch, units, markersProvider );
1391 bool wroteReport =
false;
1408 if( markersProvider->GetCount() > 0 )
1420 if( aUpgradeJob ==
nullptr )
1428 bool shouldSave = aUpgradeJob->
m_force;
1440 wxFileName schPath( aUpgradeJob->
m_filename );
1441 schPath.MakeAbsolute();
1442 const wxString schFullPath = schPath.GetFullPath();
1447 SCH_SHEET* loadedSheet = pi->LoadSchematicFile( schFullPath, sch );
1448 pi->SaveSchematicFile( schFullPath, loadedSheet, sch );
1453 wxString::Format(
_(
"Error saving schematic file '%s'.\n%s" ), schFullPath, ioe.
What().GetData() );
1481 SCH_IO_MGR::SCH_FILE_T
fileType = SCH_IO_MGR::SCH_FILE_UNKNOWN;
1500 if(
fileType == SCH_IO_MGR::SCH_FILE_UNKNOWN )
1503 m_reporter->Report( wxString::Format(
_(
"No schematic importer recognizes the file format "
1512 if( outputPath.IsEmpty() )
1516 inputFn.MakeAbsolute();
1518 wxFileName outputFn( outputPath );
1519 outputFn.MakeAbsolute();
1525 PROJECT* projectPtr =
nullptr;
1526 bool createdTransientProject =
false;
1530 projectPtr = &mgr.
Prj();
1534 wxFileName projectFn( outputFn );
1538 projectPtr = mgr.
GetProject( projectFn.GetFullPath() );
1539 createdTransientProject = ( projectPtr != nullptr );
1544 m_reporter->Report(
_(
"Could not establish a project for the import\n" ),
1553 struct TRANSIENT_PROJECT_GUARD
1559 ~TRANSIENT_PROJECT_GUARD()
1564 } transientProjectGuard{ mgr, projectPtr, createdTransientProject };
1568 std::unique_ptr<SCHEMATIC> schematic = std::make_unique<SCHEMATIC>( &
project );
1578 m_reporter->Report( wxString::Format(
_(
"No plugin found for file type '%s'\n" ),
1586 m_reporter->Report( wxString::Format(
_(
"Importing '%s' using %s format...\n" ),
1587 inputFn.GetFullPath(), formatName ),
1590 loadedSheet = pi->LoadSchematicFile( inputFn.GetFullPath(), schematic.get() );
1600 m_reporter->Report( wxString::Format(
_(
"Error during import: %s\n" ), ioe.
What() ),
1605 size_t symbolCount = 0;
1606 size_t sheetCount = 0;
1612 std::vector<SCH_SHEET*> topLevelSheets = schematic->GetTopLevelSheets();
1613 bool loadedIsTopLevel = std::find( topLevelSheets.begin(), topLevelSheets.end(),
1614 loadedSheet ) != topLevelSheets.end();
1615 bool loadedIsVirtualRoot = loadedSheet == &schematic->Root()
1618 if( !loadedIsTopLevel && !loadedIsVirtualRoot )
1619 schematic->SetTopLevelSheets( { loadedSheet } );
1627 std::unique_ptr<TOOL_MANAGER> toolManager = std::make_unique<TOOL_MANAGER>();
1628 toolManager->SetEnvironment( schematic.get(),
nullptr,
nullptr,
Kiface().KifaceSettings(),
1633 schematic->RecalculateConnections( &dummyCommit,
GLOBAL_CLEANUP, toolManager.get() );
1637 schematic->SetSheetNumberAndCount();
1641 schematic->Settings().m_SchDrawingSheetFileName = wxS(
"empty.kicad_wks" );
1644 if(
SCH_SHEET* topSheet = schematic->GetTopLevelSheet() )
1645 topSheet->SetFileName( outputFn.GetFullName() );
1647 schematic->RootScreen()->SetFileName( outputFn.GetFullPath() );
1651 std::unordered_map<SCH_SCREEN*, wxString> filenameMap;
1652 filenameMap[schematic->RootScreen()] = outputFn.GetFullPath();
1658 filenameMap, errorMsg ) )
1668 for(
size_t i = 0; i < screens.
GetCount(); i++ )
1671 wxString
path = filenameMap[screen];
1673 if(
path.IsEmpty() )
1676 wxFileName fn(
path );
1679 kicadPi->SaveSchematicFile( fn.GetFullPath(), screens.
GetSheet( i ), schematic.get() );
1683 symbolCount += std::distance( symbols.begin(), symbols.end() );
1688 m_reporter->Report( wxString::Format(
_(
"Error saving imported schematic: %s\n" ),
1693 catch(
const std::exception& exc )
1695 m_reporter->Report( wxString::Format(
_(
"Error saving imported schematic: %s\n" ),
1705 m_reporter->Report( wxString::Format(
_(
"Successfully saved imported schematic to '%s'\n" ),
1706 outputFn.GetFullPath() ),
1710 if(
Pgm().GetSettingsManager().IsProjectOpenNotDummy() )
1712 std::vector<FILE_INFO_PAIR>& projectSheets =
project.GetProjectFile().GetSheets();
1713 projectSheets.clear();
1720 projectSheets.emplace_back( std::make_pair( sheet->
m_Uuid, sheet->
GetName() ) );
1724 const std::vector<SCH_SHEET*>& topLevelSheets = schematic->GetTopLevelSheets();
1726 if( !topLevelSheets.empty() )
1728 std::vector<TOP_LEVEL_SHEET_INFO>& infos =
project.GetProjectFile().GetTopLevelSheets();
1731 wxString projectPath =
project.GetProjectPath();
1733 for(
SCH_SHEET* sheet : topLevelSheets )
1735 if( !sheet || !sheet->GetScreen() )
1738 wxFileName sheetFn( sheet->GetScreen()->GetFileName() );
1740 if( sheetFn.IsAbsolute() )
1741 sheetFn.MakeRelativeTo( projectPath );
1743 infos.emplace_back( sheet->m_Uuid, sheet->GetName(), sheetFn.GetFullPath() );
1749 if( createdTransientProject && schematic->GetTopLevelSheets().size() > 1 )
1751 m_reporter->Report( wxString::Format(
_(
"%zu sheets were written, but only '%s' is "
1752 "reachable: top-level sheets are recorded in a "
1753 "project file. Use 'kicad-cli import' to create "
1755 sheetCount, outputFn.GetFullName() ),
1761 IMPORT_REPORT_DATA reportData;
1763 reportData.m_sourceFile = inputFn.GetFullName();
1764 reportData.m_sourceFormat = formatName;
1765 reportData.m_outputFile = outputFn.GetFullName();
1766 reportData.m_statistics = {
1767 { wxS(
"symbols" ), symbolCount },
1768 { wxS(
"sheets" ), sheetCount }
1771 reportData.m_statistics.emplace_back( wxS(
"renamed_board_nets" ), job->
m_netNameMap.size() );
1801 return drawingSheet;
1833 return std::unique_ptr<SCHEMATIC>(
1841 aSch->SetProject(
nullptr );
1884 return diffExitCode;
1912 std::vector<std::unique_ptr<LIB_SYMBOL>>& aOwners,
1916 if( aAllowEmpty && aPath.IsEmpty() )
1922 aOwners = std::move( loaded.first );
1923 aMap = std::move( loaded.second );
1928 aReporter.
Report( wxString::Format(
_(
"Failed to load %s: %s\n" ), aPath, ioe.
What() ),
1931 catch(
const std::exception& e )
1934 wxString::Format(
_(
"Failed to load %s: %s\n" ), aPath, wxString::FromUTF8( e.what() ) ),
1949 for(
const auto& [
name, symbol] : aMap )
1966 std::vector<std::unique_ptr<LIB_SYMBOL>> ownersA;
1967 std::vector<std::unique_ptr<LIB_SYMBOL>> ownersB;
1989 return diffExitCode;
2014 const wxString& aFileB,
const wxString& aLabelA,
2015 const wxString& aLabelB, wxWindow* aParent,
2023 wxWindow* parent = aParent ? aParent : ( wxTheApp ? wxTheApp->GetTopWindow() :
nullptr );
2038 if( !a.
doc && !aFileA.IsEmpty() )
2044 if( !b.
doc && !aFileB.IsEmpty() )
2054 std::unique_ptr<SCHEMATIC> emptyA;
2055 std::unique_ptr<SCHEMATIC> emptyB;
2059 emptyA = std::make_unique<SCHEMATIC>( &scratchPrjA );
2060 emptyA->CreateDefaultScreens();
2065 emptyB = std::make_unique<SCHEMATIC>( &scratchPrjB );
2066 emptyB->CreateDefaultScreens();
2079 const wxString labelA = aLabelA.IsEmpty() ? aFileA : aLabelA;
2080 const wxString labelB = aLabelB.IsEmpty() ? aFileB : aLabelB;
2083 parent, labelA, labelB,
result, std::move( refGeometry ), std::move( compGeometry ),
2086 SCH_SCREEN* refScreen = schA ? schA->RootScreen() : nullptr;
2087 SCH_SCREEN* compScreen = schB ? schB->RootScreen() : nullptr;
2089 if( !aSheetPath.empty() )
2093 if( auto sp = schA->Hierarchy().GetSheetPathByKIIDPath( aSheetPath, true ) )
2094 refScreen = sp->LastScreen();
2099 if( auto sp = schB->Hierarchy().GetSheetPathByKIIDPath( aSheetPath, true ) )
2100 compScreen = sp->LastScreen();
2110 emptyA->SetProject(
nullptr );
2113 emptyB->SetProject(
nullptr );
2119 std::vector<std::unique_ptr<LIB_SYMBOL>> ownersA;
2120 std::vector<std::unique_ptr<LIB_SYMBOL>> ownersB;
2149 const wxString labelA = aLabelA.IsEmpty() ? aFileA : aLabelA;
2150 const wxString labelB = aLabelB.IsEmpty() ? aFileB : aLabelB;
2168 const wxString& aOurs,
const wxString& aTheirs,
2169 const wxString& aOutput,
bool aInteractive,
bool aSingleFile,
2180 return runSchMerge( aAncestor, aOurs, aTheirs, aOutput, aInteractive );
2185 const wxString& aTheirs,
const wxString& aOutput,
2194 if( !ancestor.
doc || !ours.
doc || !theirs.
doc )
2204 auto hasSingleRoot = [](
const SCHEMATIC* aSch )
2206 return aSch->GetTopLevelSheets().size() == 1;
2209 if( !hasSingleRoot( ancestor.
doc.get() ) || !hasSingleRoot( ours.
doc.get() ) || !hasSingleRoot( theirs.
doc.get() ) )
2211 m_reporter->Report(
_(
"sch merge requires each input to have a single top-level sheet\n" ),
2227 if( aInteractive && !
plan.Resolved() )
2229 if( !
Pgm().IsGUI() )
2231 m_reporter->Report(
_(
"--interactive requires a GUI KiCad process; the console "
2232 "kicad-cli cannot open dialogs.\n" ),
2264 if( !applier.
Apply() )
2275 m_reporter->Report(
_(
"Merge contains hierarchical sheet structure changes that sch merge "
2282 SCH_SHEET* rootSheet = ancestor.
doc->GetTopLevelSheet( 0 );
2284 wxFileName outFn( aOutput );
2285 outFn.MakeAbsolute();
2291 const wxString outDir = outFn.GetPath();
2299 std::map<wxString, SCH_SCREEN*> basenameOwner;
2301 for(
size_t i = 0; i < screens.
GetCount(); ++i )
2305 if( !screen || screen == rootScreen )
2308 const wxString basename = wxFileName( screen->
GetFileName() ).GetFullName();
2310 if( basename.IsEmpty() )
2313 auto [it, inserted] = basenameOwner.emplace( basename, screen );
2315 if( !inserted && it->second != screen )
2317 m_reporter->Report( wxString::Format(
_(
"Cannot flatten sub-sheets with duplicate "
2318 "basename '%s'\n" ),
2328 for(
size_t i = 0; i < screens.
GetCount(); ++i )
2340 if( !childScreen || childScreen == rootScreen )
2343 const wxString basename = wxFileName( childScreen->
GetFileName() ).GetFullName();
2345 if( !basename.IsEmpty() )
2353 pi->SaveSchematicFile( outFn.GetFullPath(), rootSheet, ancestor.
doc.get() );
2355 for(
size_t i = 0; i < screens.
GetCount(); ++i )
2360 if( !screen || !sheet || screen == rootScreen )
2363 const wxString basename = wxFileName( screen->
GetFileName() ).GetFullName();
2365 if( basename.IsEmpty() )
2368 wxFileName outSubFn( outDir, basename );
2369 pi->SaveSchematicFile( outSubFn.GetFullPath(), sheet, ancestor.
doc.get() );
2374 m_reporter->Report( wxString::Format(
_(
"Failed to save merged schematic: %s\n" ), ioe.
What() ),
2386 wxFileName proFn = outFn;
2403 ancestor.
doc->ErcSettings().SaveToFile( wxEmptyString,
true );
2406 ancestor.
doc->Settings().SaveToFile( wxEmptyString,
true );
2408 std::set<wxString> touched;
2418 if( !
Pgm().GetSettingsManager().SaveProjectCopy( proFn.GetFullPath(), ancestor.
project ) )
2421 wxString::Format(
_(
"Failed to save merged project file: %s\n" ), proFn.GetFullPath() ),
2432 m_reporter->Report( wxString::Format( wxS(
"%s: %s\n" ), f.validator, f.message ), f.severity );
2439 m_reporter->Report( wxString::Format(
_(
"Merge completed with %zu unresolved conflict(s) in %s\n" ),
2454#include <wx/ffile.h>
2458 const wxString& aTheirs,
const wxString& aOutput )
2460 if( aOutput.IsEmpty() )
2469 std::vector<std::unique_ptr<LIB_SYMBOL>> owners;
2473 LIB_SIDE ancestor, ours, theirs;
2475 auto loadSide = [&](
const wxString& aPath, LIB_SIDE& aSide ) ->
int
2480 aSide.owners = std::move( loaded.first );
2481 aSide.map = std::move( loaded.second );
2486 m_reporter->Report( wxString::Format(
_(
"Failed to load %s: %s\n" ), aPath, ioe.
What() ),
2489 catch(
const std::exception& e )
2492 wxString::Format(
_(
"Failed to load %s: %s\n" ), aPath, wxString::FromUTF8( e.what() ) ),
2520 std::vector<std::unique_ptr<LIB_SYMBOL>> merged = applier.
Apply();
2525 const bool hadSilentFallback = applier.
GetReport().mergePropsFallback > 0;
2529 wxFileName outFn( aOutput );
2530 outFn.MakeAbsolute();
2538 for(
auto& sym : merged )
2549 m_reporter->Report( wxString::Format(
_(
"Failed to save merged symbol library: %s\n" ), ioe.
What() ),
2555 if( !planSnapshot.
Resolved() || hadSilentFallback )
2559 std::set<KIID_PATH> conflicts( planSnapshot.
unresolved.begin(), planSnapshot.
unresolved.end() );
2562 conflicts.insert(
id );
2564 m_reporter->Report( wxString::Format(
_(
"Symbol library merge completed with %zu unresolved "
2565 "conflict(s) in %s\n" ),
2566 conflicts.size(), aOutput ),
constexpr EDA_IU_SCALE schIUScale
KIFACE_BASE & Kiface()
Global KIFACE_BASE "get" accessor.
int GetVirtualPageNumber() const
const wxString & GetPageNumber() const
Color settings are a bit different than most of the settings objects in that there can be more than o...
File-compare dialog (Phase 7).
3-way merge resolution dialog (Phase 8).
const KICAD_DIFF::MERGE_PLAN & GetResolvedPlan() const
Returns the plan with the user's resolutions applied.
static DS_DATA_MODEL & GetTheInstance()
Return the instance of DS_DATA_MODEL used in the application.
void SetSheetPath(const std::string &aSheetPath)
Set the sheet path displayed in the title block.
void SetSheetCount(int aSheetCount)
Change the sheet-count number displayed in the title block.
void SetVariantName(const std::string &aVariant)
Set the current variant name and description to be shown on the drawing sheet.
void SetVariantDesc(const std::string &aVariantDesc)
void SetPageNumber(const std::string &aPageNumber)
Change the page number displayed in the title block.
void SetSheetName(const std::string &aSheetName)
Set the sheet name displayed in the title block.
void SetPageBorderColorLayer(int aLayerId)
Override the layer used to pick the color of the page border (normally LAYER_GRID)
void SetIsFirstPage(bool aIsFirstPage)
Change if this is first page.
void SetFileName(const std::string &aFileName)
Set the file name displayed in the title block.
void SetColorLayer(int aLayerId)
Can be used to override which layer ID is used for drawing sheet item colors.
static SCHEMATIC * LoadSchematic(const wxString &aFileName, bool aSetActive, bool aForceDefaultProject, PROJECT *aProject=nullptr, bool aCalculateConnectivity=true, REPORTER *aRootReporter=nullptr)
int JobExportNetlist(JOB *aJob)
int runSchMerge(const wxString &aAncestor, const wxString &aOurs, const wxString &aTheirs, const wxString &aOutput, bool aInteractive)
void InitRenderSettings(SCH_RENDER_SETTINGS *aRenderSettings, const wxString &aTheme, SCHEMATIC *aSch, const wxString &aDrawingSheetOverride=wxEmptyString)
Configure the SCH_RENDER_SETTINGS object with the correct data to be used with plotting.
int JobSymUpgrade(JOB *aJob)
int JobExportBom(JOB *aJob)
int JobUpgrade(JOB *aJob)
bool m_cliSchematicRootValidated
int RunMerge(KICAD_DIFF::DOC_KIND aKind, const wxString &aAncestor, const wxString &aOurs, const wxString &aTheirs, const wxString &aOutput, bool aInteractive, bool aSingleFile, REPORTER *aReporter)
Non-job entry points (reached via the kiface KIFACE_MERGE_DOCUMENT / KIFACE_OPEN_DIFF_DIALOG function...
int JobSymExportSvg(JOB *aJob)
DS_PROXY_VIEW_ITEM * getDrawingSheetProxyView(SCHEMATIC *aSch)
int JobSymDiff(JOB *aJob)
int JobExportPythonBom(JOB *aJob)
int runSymLibMerge(const wxString &aAncestor, const wxString &aOurs, const wxString &aTheirs, const wxString &aOutput)
SCHEMATIC * getSchematic(const wxString &aPath, bool aRequireRoot=true)
int OpenDiffDialog(KICAD_DIFF::DOC_KIND aKind, const wxString &aFileA, const wxString &aFileB, const wxString &aLabelA, const wxString &aLabelB, wxWindow *aParent, REPORTER *aReporter)
void ClearCachedSchematic()
Clear the cached CLI schematic so the next job reloads from the current project.
EESCHEMA_JOBS_HANDLER(KIWAY *aKiway)
int JobExportPlot(JOB *aJob)
SCHEMATIC * m_cliSchematic
int doSymExportSvg(JOB_SYM_EXPORT_SVG *aSvgJob, SCH_RENDER_SETTINGS *aRenderSettings, LIB_SYMBOL *symbol)
int JobSchDiff(JOB *aJob)
EE_TYPE OfType(KICAD_T aType) const
bool WriteJsonReport(const wxString &aFullFileName)
Writes a JSON formatted ERC Report to the given file path in the c-locale.
bool WriteTextReport(const wxString &aFullFileName)
Writes the text report also available via GetTextReport directly to a given file path.
void RunTests(DS_PROXY_VIEW_ITEM *aDrawingSheet, SCH_EDIT_FRAME *aEditFrame, KIFACE *aCvPcb, PROJECT *aProject, PROGRESS_REPORTER *aProgressReporter)
void SetVariantNames(const std::vector< wxString > &aVariantNames)
std::vector< BOM_FIELD > GetFieldsOrdered()
static const wxString QUANTITY_VARIABLE
static const wxString ITEM_NUMBER_VARIABLE
wxString Export(const BOM_FMT_PRESET &aSettings)
int GetFieldNameCol(const wxString &aFieldName) const
void SetCurrentVariant(const wxString &aVariantName)
Set the current variant name for highlighting purposes.
void ApplyBomPreset(const BOM_PRESET &aPreset)
void AddColumn(const wxString &aFieldName, const wxString &aLabel, bool aAddedByUser) override
Hold an error message and may be used when throwing exceptions containing meaningful error messages.
virtual const wxString What() const
A composite of Problem() and Where()
wxString m_inputB
Comparison document (file or directory)
wxString m_inputA
Reference document (file or directory)
void Register(const std::string &aJobTypeName, std::function< int(JOB *job)> aHandler, std::function< bool(JOB *job, wxWindow *aParent)> aConfigHandler)
JOB_DISPATCHER(KIWAY *aKiway)
PROGRESS_REPORTER * m_progressReporter
wxString GetSelectedVariant() const
std::vector< wxString > m_variantNames
wxString m_stringDelimiter
wxString m_fieldDelimiter
bool m_includeByteOrderMark
std::vector< wxString > m_fieldsOrdered
wxString m_refRangeDelimiter
std::vector< wxString > m_fieldsLabels
std::vector< wxString > m_fieldsGroupBy
wxString m_bomFmtPresetName
BOM_FILTER_SCOPE m_filterScope
std::vector< wxString > m_variantNames
JOB_PAGE_SIZE m_pageSizeSelect
SCH_PLOT_FORMAT m_plotFormat
bool m_useBackgroundColor
std::vector< wxString > m_variantNames
bool m_PDFHierarchicalLinks
std::vector< wxString > m_plotPages
bool m_exitCodeViolations
Job to import a non-KiCad schematic file to KiCad format.
IMPORT_REPORT_FORMAT m_reportFormat
std::map< wxString, wxString > m_netNameMap
wxString m_outputDirectory
bool m_includeHiddenFields
wxString m_outputLibraryPath
An simple container class that lets us dispatch output jobs to kifaces.
void SetConfiguredOutputPath(const wxString &aPath)
Sets the configured output path for the job, this path is always saved to file.
void AddOutput(wxString aOutputPath)
wxString GetFullOutputPath(PROJECT *aProject) const
Returns the full output path for the job, taking into account the configured output path,...
bool GetOutputPathIsDirectory() const
wxString GetConfiguredOutputPath() const
Returns the configured output path for the job.
void SetTitleBlock(const TITLE_BLOCK &aTitleBlock)
void SetWorkingOutputPath(const wxString &aPath)
Sets a transient output path for the job, it takes priority over the configured output path when GetF...
const std::map< wxString, wxString > & GetVarOverrides() const
JSON_SETTINGS_INTERNALS * Internals()
virtual bool Store()
Stores the current parameters into the JSON document represented by this object Note: this doesn't do...
Three-way merge plan generator.
MERGE_PLAN Plan(const DOCUMENT_DIFF &aAncestorOurs, const DOCUMENT_DIFF &aAncestorTheirs) const
Plan the merge given the canonical pair of diffs.
const REPORT & GetReport() const
std::vector< std::unique_ptr< ITEM > > Apply()
Diff two already-parsed SCHEMATICs and produce a DOCUMENT_DIFF.
DOCUMENT_DIFF Diff() override
Produce a DOCUMENT_DIFF of the inputs the concrete differ was constructed with.
Materialize a MERGE_PLAN into a merged SCHEMATIC by mutating the ancestor in place.
bool Apply()
Apply the plan to the ancestor.
const REPORT & GetReport() const
Diff two .kicad_sym symbol libraries.
DOCUMENT_DIFF Diff() override
Produce a DOCUMENT_DIFF of the inputs the concrete differ was constructed with.
static std::pair< std::vector< std::unique_ptr< LIB_SYMBOL > >, SYMBOL_MAP > LoadLibrary(const wxString &aPath)
Convenience: load a .kicad_sym path into a SYMBOL_MAP using SCH_IO_KICAD_SEXPR::EnumerateSymbolLib.
std::map< wxString, const LIB_SYMBOL * > SYMBOL_MAP
Library content is a map of (canonical_name -> LIB_SYMBOL*).
A color representation with 4 components: red, green, blue, alpha.
void SetDefaultPenWidth(int aWidth)
void SetGapLengthRatio(double aRatio)
void SetDashLengthRatio(double aRatio)
A minimalistic software bus for communications between various DLLs/DSOs (DSOs) within the same KiCad...
virtual KIWAY_PLAYER * Player(FRAME_T aFrameType, bool doCreate=true, wxTopLevelWindow *aParent=nullptr)
Return the KIWAY_PLAYER* given a FRAME_T.
void AsyncLoad()
Loads all available libraries for this adapter type in the background.
Define a library symbol object.
std::shared_ptr< LIB_SYMBOL > GetRootSymbol() const
Get the parent symbol that does not have another parent.
wxString GetName() const override
const std::vector< wxString > & GetBodyStyleNames() const
bool HasDeMorganBodyStyles() const override
int GetBodyStyleCount() const override
The body styles are a property of the drawings, which a derived symbol inherits from its root symbol ...
int GetUnitCount() const override
Instantiate the current locale within a scope in which you are expecting exceptions to be thrown.
static bool EnsurePathExists(const wxString &aPath, bool aPathToFile=false)
Attempts to create a given path if it does not exist.
virtual SETTINGS_MANAGER & GetSettingsManager() const
The backing store for a PROJECT, in JSON format.
TEMPLATES m_TemplateFieldNames
Project and global field name templates shared by project editors.
static SYMBOL_LIBRARY_ADAPTER * SymbolLibAdapter(PROJECT *aProject)
Accessor for project symbol library manager adapter.
Container for project specific data.
virtual void ApplyTextVars(const std::map< wxString, wxString > &aVarsMap)
Applies the given var map, it will create or update existing vars.
virtual PROJECT_FILE & GetProjectFile() const
A pure virtual class used to derive REPORTER objects from.
virtual REPORTER & Report(const wxString &aText, SEVERITY aSeverity=RPT_SEVERITY_UNDEFINED)
Report a string with a given severity.
wxString m_SchDrawingSheetFileName
double m_DashedLineGapRatio
double m_DashedLineDashRatio
Holds all the data relating to one schematic.
void SetCurrentVariant(const wxString &aVariantName)
wxString GetVariantDescription(const wxString &aVariantName) const
Return the description for a variant.
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.
PROJECT & Project() const
Return a reference to the project this schematic is part of.
wxString GetCurrentVariant() const
Return the current variant being edited.
SCH_SCREEN * RootScreen() const
Helper to retrieve the screen of the root sheet.
const std::map< wxString, wxString > * GetProperties()
virtual void Push(const wxString &aMessage=wxT("A commit"), int aCommitFlags=0) override
Execute the changes.
Schematic editor (Eeschema) main window.
SCHEMATIC & Schematic() const
A cache assistant for the KiCad s-expression symbol libraries.
int GetFileFormatVersionAtLoad() const
void Save(const std::optional< bool > &aOpt=std::nullopt) override
Save the entire library to file m_libFileName;.
void SetFileName(const wxString &aFileName)
void SetModified(bool aModified=true)
virtual void AddSymbol(std::unique_ptr< LIB_SYMBOL > aSymbol)
static bool ConvertLibrary(std::map< std::string, UTF8 > *aOldFileProps, const wxString &aOldFilePath, const wxString &aNewFilepath, REPORTER *aReporter=nullptr)
Convert a schematic symbol library to the latest KiCad format.
static const wxString ShowType(SCH_FILE_T aFileType)
Return a brief name for a plugin, given aFileType enum.
static SCH_FILE_T GuessPluginTypeFromSchPath(const wxString &aSchematicPath, int aCtl=0)
Return a plugin type given a schematic using the file extension of aSchematicPath.
static SCH_FILE_T GuessPluginTypeFromLibPath(const wxString &aLibPath, int aCtl=0)
Return a plugin type given a symbol library using the file extension of aLibPath.
Base class for any item which can be embedded within the SCHEMATIC container class,...
Container to create a flattened list of symbols because in a complex hierarchy, a symbol can be used ...
int CheckAnnotation(ANNOTATION_ERROR_HANDLER aErrorHandler)
Check for annotations errors.
A helper to define a symbol's reference designator in a schematic.
void LoadColors(const COLOR_SETTINGS *aSettings) override
Container class that holds multiple SCH_SCREEN objects in a hierarchy.
SCH_SCREEN * GetScreen(unsigned int aIndex) const
SCH_SHEET * GetSheet(unsigned int aIndex) const
const PAGE_INFO & GetPageSettings() const
EE_RTREE & Items()
Get the full RTree, usually for iterating.
const wxString & GetFileName() const
int GetFileFormatVersionAtLoad() const
TITLE_BLOCK & GetTitleBlock()
void GetSymbols(SCH_REFERENCE_LIST &aReferences, SYMBOL_FILTER aSymbolFilter, bool aForceIncludeOrphanSymbols=false) const
Add a SCH_REFERENCE object to aReferences for each symbol in the list of sheets.
Handle access to a stack of flattened SCH_SHEET objects by way of a path for creating a flattened sch...
Sheet symbol placed in a schematic, and is the entry point for a sub schematic.
void SetFileName(const wxString &aFilename)
SCH_SCREEN * GetScreen() const
bool IsVirtualRootSheet() const
void GetFields(std::vector< SCH_FIELD * > &aVector, bool aVisibleOnly) const override
Populate a std::vector with SCH_FIELDs, sorted in ordinal order.
RAII class that sets an value at construction and resets it to the original value at destruction.
bool LoadProject(const wxString &aFullPath, bool aSetActive=true)
Load a project or sets up a new project with a specified path.
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.
PROJECT & Prj() const
A helper while we are not MDI-capable – return the one and only project.
bool IsProjectOpenNotDummy() const
Helper for checking if we have a project open that is not a dummy project.
void UpdateReferences(const SCH_REFERENCE_LIST &aRefs)
const SCH_REFERENCE_LIST & GetReferenceList() const
An interface to the global shared library manager that is schematic-specific and linked to one projec...
const std::vector< TEMPLATE_FIELDNAME > & GetResolvedTemplateFieldNames()
Return the resolved project and global template field name list for read only access.
wxString GetGeneratedFieldDisplayName(const wxString &aSource)
Returns any variables unexpanded, e.g.
bool IsGeneratedField(const wxString &aFieldName)
Returns true if the entire string is generated, e.g is a single text var reference.
wxString GetDefaultPlotExtension(PLOT_FORMAT aFormat)
Return the default plot extension for a format.
void DisplayErrorMessage(wxWindow *aParent, const wxString &aText, const wxString &aExtraInfo)
Display an error message with aMessage.
This file is part of the common library.
#define DEFAULT_LINE_WIDTH_MILS
The default wire width in mils. (can be changed in preference menu)
bool PrepareSaveAsFiles(SCHEMATIC &aSchematic, SCH_SCREENS &aScreens, const wxFileName &aOldRoot, const wxFileName &aNewRoot, bool aSaveCopy, bool aCopySubsheets, bool aIncludeExternSheets, std::unordered_map< SCH_SCREEN *, wxString > &aFilenameMap, wxString &aErrorMsg)
static int loadSymbolLibrarySide(const wxString &aPath, std::vector< std::unique_ptr< LIB_SYMBOL > > &aOwners, KICAD_DIFF::SYM_LIB_DIFFER::SYMBOL_MAP &aMap, bool aAllowEmpty, REPORTER &aReporter)
static SCRATCH_DOC< SCHEMATIC > loadScratchSchematic(SETTINGS_MANAGER &aMgr, const wxString &aPath)
static KICAD_DIFF::DOCUMENT_GEOMETRY symbolLibraryGeometry(const KICAD_DIFF::SYM_LIB_DIFFER::SYMBOL_MAP &aMap, const KIGFX::COLOR4D &aColor)
static const std::string CadstarNetlistFileExtension
static const std::string NetlistFileExtension
static const std::string ReportFileExtension
static const std::string ProjectFileExtension
static const std::string JsonFileExtension
static const std::string XmlFileExtension
static const std::string KiCadSchematicFileExtension
static const std::string OrCadPcb2NetlistFileExtension
static const std::string CsvFileExtension
static const std::string SpiceFileExtension
static const std::string SVGFileExtension
std::map< wxString, wxString > GetBoardNetNameMap(const IMPORT_NET_MAP &aMap, REPORTER &aReporter)
Reduce the map to the board net renames it justifies.
std::unique_ptr< T > IO_RELEASER
Helper to hold and release an IO_BASE object when exceptions are thrown.
void WriteImportReport(REPORTER *aReporter, IMPORT_REPORT_FORMAT aFormat, const wxString &aReportFile, const IMPORT_REPORT_DATA &aData)
Emit an import report in the requested format to aReportFile, or to aReporter (at INFO severity) when...
wxString DefaultImportOutputPath(const wxString &aInputFile, const wxString &aKiCadExt)
Build the default output path for an import by swapping the input file's extension for the given KiCa...
#define KICTL_NONKICAD_ONLY
chosen file is non-KiCad according to user
@ LAYER_SCHEMATIC_DRAWINGSHEET
@ LAYER_SCHEMATIC_PAGE_LIMITS
static std::vector< PENDING_PROPERTY > plan(const EDA_ITEM &aSource, const EDA_ITEM &aTarget, const std::set< wxString > &aEnabledKeys)
Target properties to write, paired with values read off the source.
static const int ERR_ARGS
static const int ERR_RC_VIOLATIONS
Rules check violation count was greater than 0.
static const int ERR_INVALID_INPUT_FILE
static const int ERR_INVALID_OUTPUT_CONFLICT
static const int ERR_UNKNOWN_FILE_FORMAT
No plugin for the requested face recognized the input file format.
static const int ERR_UNKNOWN
const wxString DOC_PROP_ERC_SEVERITIES
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)
void CollectChangeBBoxes(const DOCUMENT_DIFF &aDiff, std::map< KIID_PATH, BOX2I > &aOut)
Walk a DOCUMENT_DIFF and populate a (KIID_PATH → BOX2I) map with each changed item's bbox,...
DOCUMENT_GEOMETRY ExtractSymbolGeometry(const LIB_SYMBOL &aSymbol, const KIGFX::COLOR4D &aColor, int aUnit, int aBodyStyle)
Extract coarse drawable context from a library symbol for visual symbol diffs.
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...
void AppendGeometry(DOCUMENT_GEOMETRY &aDst, DOCUMENT_GEOMETRY &&aSrc)
Move all primitives from aSrc into aDst.
DIFF_EMIT_OPTIONS MakeEmitOptions(const JOB_DIFF_BASE &aJob, const wxString &aLabelA, const wxString &aLabelB)
Build a DIFF_EMIT_OPTIONS pre-filled from the job's format, resolved output path and the supplied per...
const wxString DOC_PROP_DRAWING_SHEET
DOC_KIND
Document type a diff/merge entry point should route to, derived from a file path's extension.
int EmitDiffResult(const DOCUMENT_DIFF &aResult, const DIFF_EMIT_OPTIONS &aOptions, int aDiffExitCode, REPORTER &aReporter)
Emit a computed DOCUMENT_DIFF in the requested format.
LIB_MERGE_APPLIER< LIB_SYMBOL > SYM_LIB_MERGE_APPLIER
Symbol-library 3-way merge applier. See LIB_MERGE_APPLIER for behavior.
bool ApplyProjectFilePatches(const wxString &aOutputProPath, const nlohmann::json &aSource, const std::set< wxString > &aDocProps, DOC_KIND aKind)
Higher-level orchestrator: load the existing aOutputProPath as JSON (or start from aSource if the fil...
int DiffExitCode(const DOCUMENT_DIFF &aResult)
Map a computed diff onto its CLI exit code – SUCCESS when empty, otherwise ERR_RC_VIOLATIONS.
bool contains(const _Container &__container, _Value __value)
Returns true if the container contains the given value.
PGM_BASE & Pgm()
The global program "get" accessor.
PLOT_FORMAT
The set of supported output plot formats.
Plotting engines similar to ps (PostScript, Gerber, svg)
#define SKIP_CONNECTIVITY
#define DELETE_REMOVED_ITEMS
#define SEXPR_SYMBOL_LIB_FILE_VERSION
This file contains the file format version information for the s-expression schematic and symbol libr...
#define SEXPR_SCHEMATIC_FILE_VERSION
Schematic file version.
bool PlotSymbolToSVG(LIB_SYMBOL &aDrawSymbol, LIB_SYMBOL &aFieldsSymbol, int aUnit, int aBodyStyle, const BOX2I &aBBox, SCH_RENDER_SETTINGS &aRenderSettings, bool aBlackAndWhite, const wxString &aFileName, REPORTER *aReporter)
Plot a single symbol variant (unit and body style) to an SVG file.
BOX2I GetSymbolPlotBBox(const LIB_SYMBOL &aSymbol, int aUnit, int aBodyStyle, bool aIncludeHiddenFields)
Compute the bounding box used to size a symbol SVG plot.
Definition of the SCH_SHEET_PATH and SCH_SHEET_LIST classes for Eeschema.
@ SYMBOL_FILTER_NON_POWER
SCRATCH_DOC< DOC > LoadScratchDoc(SETTINGS_MANAGER &aMgr, const wxString &aDocPath, Loader aLoader, ClearFn aClearFn)
Construct a SCRATCH_DOC by loading a project non-active and then handing it to the caller's document ...
COLOR_SETTINGS * GetColorSettings(const wxString &aName)
T * GetAppSettings(const char *aFilename)
std::vector< FAB_LAYER_COLOR > dummy
MODEL3D_FORMAT_TYPE fileType(const char *aFileName)
#define TO_UTF8(wxstring)
Convert a wxString to a UTF8 encoded C string for all wxWidgets build modes.
bool includeByteOrderMark
static std::vector< BOM_FMT_PRESET > BuiltInPresets()
wxString refRangeDelimiter
Phase 8 context for the conflict canvas.
KICAD_DIFF::DOCUMENT_GEOMETRY ancestorGeometry
std::map< KIID_PATH, BOX2I > theirsBBoxes
KICAD_DIFF::DOCUMENT_GEOMETRY oursGeometry
std::map< KIID_PATH, BOX2I > oursBBoxes
KICAD_DIFF::DOCUMENT_GEOMETRY theirsGeometry
std::vector< BOM_PRESET > m_BomPresets
std::vector< BOM_FMT_PRESET > m_BomFmtPresets
Import provenance, held only for the lifetime of the importing SCHEMATIC.
KIGFX::COLOR4D reference
Default color for source-document context geometry.
KIGFX::COLOR4D comparison
Describes how a computed DOCUMENT_DIFF should be emitted by a diff job.
std::function< DOCUMENT_GEOMETRY(const KIGFX::COLOR4D &)> comparisonGeometry
DOC_KIND docKind
Source document type, propagated onto the scene so the PNG/SVG renderer sizes its viewport with the m...
std::function< DOCUMENT_GEOMETRY(const KIGFX::COLOR4D &)> referenceGeometry
The full set of changes between two parsed documents of one type.
Aggregate of background geometry extracted from one source document.
Result of planning a 3-way merge.
std::size_t ConflictCount() const
std::vector< KIID_PATH > unresolved
bool drawingSheetFileTouched
bool projectFileTouched
True iff the applier resolved state that lives in the .kicad_pro.
bool ercSeveritiesTouched
std::size_t sheetActionsSkipped
Number of actions skipped because they targeted a SCH_SHEET.
VALIDATION_REPORT validation
Post-apply validator pipeline result.
Outcome of a single validator run.
std::vector< VALIDATION_FAILURE > failures
std::vector< wxString > m_plotPages
DXF_UNITS m_DXF_File_Unit
wxString m_outputDirectory
bool m_PDFHierarchicalLinks
bool m_useBackgroundColor
Move-only RAII wrapper for "load a KiCad document into a non-active scratch PROJECT and clean up afte...
std::unique_ptr< DOC > doc
Hold a name of a symbol's field, field value, and default visibility.
SYMBOL_IMPORT_RECONCILE_RESULT ReconcileImportedSymbols(SCH_IO &aPlugin, SCHEMATIC &aSchematic, PROJECT &aProject, const wxString &aSchematicPath, const std::map< std::string, UTF8 > *aProperties, REPORTER &aReporter)
Reconcile aSchematic against the definitions aPlugin retained while loading it.
std::map< wxString, LIB_SYMBOL *, LibSymbolMapSort > LIB_SYMBOL_MAP
wxString GetDefaultFieldName(FIELD_T aFieldId, TRANSLATION aTranslation)
Return a default symbol field name for a mandatory field type.
FIELD_T
The set of all field indices assuming an array like sequence that a SCH_COMPONENT or LIB_PART can hol...
wxString result
Test unit parsing edge cases and error handling.
Definition of file extensions used in Kicad.