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() );
440 if( !variantName.IsEmpty() )
453 schPlotter->Plot( format, plotOpts, renderSettings.get(),
m_reporter );
458 for(
const wxString& outputPath : schPlotter->GetOutputFilePaths() )
485 if( variantName != wxS(
"all" ) )
502 m_reporter->Report(
_(
"Warning: schematic has annotation errors, please use the "
503 "schematic editor to fix them\n" ),
511 if(
erc.TestDuplicateSheetNames(
false ) > 0 )
514 std::unique_ptr<NETLIST_EXPORTER_BASE> helper;
515 unsigned netlistOption = 0;
523 helper = std::make_unique<NETLIST_EXPORTER_KICAD>( sch,
m_kiway );
528 helper = std::make_unique<NETLIST_EXPORTER_ORCADPCB2>( sch,
m_kiway );
533 helper = std::make_unique<NETLIST_EXPORTER_CADSTAR>( sch,
m_kiway );
539 helper = std::make_unique<NETLIST_EXPORTER_SPICE>( sch,
m_kiway );
544 helper = std::make_unique<NETLIST_EXPORTER_SPICE_MODEL>( sch,
m_kiway );
548 fileExt = wxS(
"xml" );
549 helper = std::make_unique<NETLIST_EXPORTER_XML>( sch,
m_kiway );
553 fileExt = wxS(
"asc" );
554 helper = std::make_unique<NETLIST_EXPORTER_PADS>( sch,
m_kiway );
558 fileExt = wxS(
"txt" );
559 helper = std::make_unique<NETLIST_EXPORTER_ALLEGRO>( sch,
m_kiway );
570 fn.SetName( fn.GetName() );
571 fn.SetExt( fileExt );
584 bool res = helper->WriteNetlist( outPath, netlistOption, *
m_reporter );
611 if( !currentVariant.IsEmpty() && currentVariant != wxS(
"all" ) )
623 if(
copy.CheckAnnotation(
630 m_reporter->Report(
_(
"Warning: schematic has annotation errors, please use the schematic "
631 "editor to fix them\n" ),
639 if(
erc.TestDuplicateSheetNames(
false ) > 0 )
669 std::set<wxString> userFieldNames;
671 for(
size_t i = 0; i < referenceList.
GetCount(); ++i )
673 SCH_SYMBOL* symbol = referenceList[i].GetSymbol();
677 if( !field.IsMandatory() && !field.IsPrivate() )
678 userFieldNames.insert( field.GetName() );
682 for(
const wxString& fieldName : userFieldNames )
689 if( userFieldNames.count( templateFieldname.m_Name ) == 0 )
702 const BOM_PRESET* schPreset =
nullptr;
704 for(
const BOM_PRESET& p : BOM_PRESET::BuiltInPresets() )
725 wxString::Format(
_(
"BOM preset '%s' not found" ) + wxS(
"\n" ), aBomJob->
m_bomPresetName ),
739 auto normalizeFieldName = [&dataModel](
const wxString& aName ) -> wxString
741 if( aName.IsEmpty() )
742 return wxEmptyString;
747 wxString wrapped = wxS(
"${" ) + aName + wxS(
"}" );
759 wxString fieldName = normalizeFieldName( rawFieldName );
761 if( fieldName.IsEmpty() )
769 if( fieldName == wxS(
"*" ) )
775 field.
name = modelField.name;
780 bool fieldAlreadyPresent =
false;
782 for(
BOM_FIELD& presetField : preset.fieldsOrdered )
784 if( presetField.
name == field.
name )
786 fieldAlreadyPresent =
true;
791 bool fieldLaterInList =
false;
795 if( normalizeFieldName( fieldInList ) == field.
name )
797 fieldLaterInList =
true;
802 if( !fieldAlreadyPresent && !fieldLaterInList )
803 preset.fieldsOrdered.emplace_back( field );
811 field.
name = fieldName;
812 field.
show = !fieldName.StartsWith( wxT(
"__" ), &field.
name );
813 field.
name = normalizeFieldName( field.
name );
822 preset.fieldsOrdered.emplace_back( field );
828 wxString fieldName = rawFieldName;
829 fieldName.StartsWith( wxT(
"__" ), &fieldName );
830 fieldName = normalizeFieldName( fieldName );
832 if( fieldName.IsEmpty() )
835 bool fieldAlreadyPresent =
false;
837 for(
BOM_FIELD& field : preset.fieldsOrdered )
839 if( field.
name == fieldName )
842 fieldAlreadyPresent =
true;
847 if( !fieldAlreadyPresent )
852 preset.sortField = normalizeFieldName( aBomJob->
m_sortField );
864 std::optional<BOM_FMT_PRESET> schFmtPreset;
886 m_reporter->Report( wxString::Format(
_(
"BOM format preset '%s' not found" ) + wxS(
"\n" ),
909 fn.SetName( fn.GetName() );
916 bool hasVariantPlaceholder = configuredPath.Contains( wxS(
"${VARIANT}" ) );
919 std::vector<wxString> variantsToProcess;
927 variantsToProcess.push_back( currentVariant );
930 for(
const wxString& variantName : variantsToProcess )
932 std::vector<wxString> singleVariant = { variantName };
940 if( hasVariantPlaceholder )
942 wxString variantPath = configuredPath;
943 variantPath.Replace( wxS(
"${VARIANT}" ), variantName );
961 if( !f.Open( outPath, wxFile::write ) )
963 m_reporter->Report( wxString::Format(
_(
"Unable to open destination '%s'" ), outPath ),
969 bool res = f.Write( dataModel.
Export( fmt ) );
1010 m_reporter->Report(
_(
"Warning: schematic has annotation errors, please use the "
1011 "schematic editor to fix them\n" ),
1019 if(
erc.TestDuplicateSheetNames(
false ) > 0 )
1022 std::unique_ptr<NETLIST_EXPORTER_XML> xmlNetlist = std::make_unique<NETLIST_EXPORTER_XML>( sch,
m_kiway );
1027 fn.SetName( fn.GetName() +
"-bom" );
1059 std::shared_ptr<LIB_SYMBOL> parent;
1069 symbolToPlot = parent.get();
1073 for(
int unit = 1; unit < symbol->
GetUnitCount() + 1; unit++ )
1085 for( wxChar c : wxFileName::GetForbiddenChars( wxPATH_DOS ) )
1086 filename.Replace( c,
' ' );
1091 filename += wxString::Format(
"_unit%d", unit );
1095 if( bodyStyle == 2 )
1096 filename += wxS(
"_demorgan" );
1103 fn.SetName( filename );
1104 m_reporter->Report( wxString::Format(
_(
"Plotting symbol '%s' unit %d to '%s'\n" ), symbol->
GetName(),
1105 unit, fn.GetFullPath() ),
1110 if( !
PlotSymbolToSVG( *symbolToPlot, *symbol, unit, bodyStyle, symbolBB, *aRenderSettings,
1136 wxString singleFileFilter;
1138 auto schLibrary = std::make_unique<SCH_IO_KICAD_SEXPR_LIB_CACHE>( fn.GetFullPath() );
1148 bool recovered =
false;
1150 if( !fn.IsDir() && wxDir::Exists( fn.GetPath() ) )
1154 schLibrary = std::make_unique<SCH_IO_KICAD_SEXPR_LIB_CACHE>( fn.GetPath() );
1156 singleFileFilter = fn.GetFullPath();
1180 symbol = schLibrary->GetSymbol( svgJob->
m_symbol );
1193 m_reporter->Report( wxString::Format(
_(
"Unable to create output directory '%s'." ) + wxS(
"\n" ),
1217 const std::map<wxString, wxString>& sourceFiles = schLibrary->GetSymbolSourceFiles();
1218 const wxFileName filterFile( singleFileFilter );
1220 for(
const auto& [
name, libSymbol] : libSymMap )
1223 if( !singleFileFilter.IsEmpty() )
1225 auto srcIt = sourceFiles.find(
name );
1227 if( srcIt == sourceFiles.end() || !wxFileName( srcIt->second ).SameAs( filterFile ) )
1268 else if(
fileType != SCH_IO_MGR::SCH_KICAD )
1270 m_reporter->Report(
_(
"Output path must be specified to convert legacy and non-KiCad libraries\n" ),
1276 if(
fileType == SCH_IO_MGR::SCH_KICAD )
1349 fn.SetName( fn.GetName() + wxS(
"-erc" ) );
1379 std::shared_ptr<SHEETLIST_ERC_ITEMS_PROVIDER> markersProvider =
1380 std::make_shared<SHEETLIST_ERC_ITEMS_PROVIDER>( sch );
1396 if( editFrame && &editFrame->
Schematic() != sch )
1397 editFrame =
nullptr;
1409 markersProvider->SetSeverities( ercJob->
m_severity );
1411 m_reporter->Report( wxString::Format(
_(
"Found %d violations\n" ), markersProvider->GetCount() ),
1414 ERC_REPORT reportWriter( sch, units, markersProvider );
1416 bool wroteReport =
false;
1433 if( markersProvider->GetCount() > 0 )
1445 if( aUpgradeJob ==
nullptr )
1453 bool shouldSave = aUpgradeJob->
m_force;
1465 wxFileName schPath( aUpgradeJob->
m_filename );
1466 schPath.MakeAbsolute();
1467 const wxString schFullPath = schPath.GetFullPath();
1472 SCH_SHEET* loadedSheet = pi->LoadSchematicFile( schFullPath, sch );
1473 pi->SaveSchematicFile( schFullPath, loadedSheet, sch );
1478 wxString::Format(
_(
"Error saving schematic file '%s'.\n%s" ), schFullPath, ioe.
What().GetData() );
1506 SCH_IO_MGR::SCH_FILE_T
fileType = SCH_IO_MGR::SCH_FILE_UNKNOWN;
1526 if(
fileType == SCH_IO_MGR::SCH_FILE_UNKNOWN )
1529 m_reporter->Report( wxString::Format(
_(
"No schematic importer recognizes the file format "
1538 if( outputPath.IsEmpty() )
1542 inputFn.MakeAbsolute();
1544 wxFileName outputFn( outputPath );
1545 outputFn.MakeAbsolute();
1551 PROJECT* projectPtr =
nullptr;
1552 bool createdTransientProject =
false;
1556 projectPtr = &mgr.
Prj();
1560 wxFileName projectFn( outputFn );
1564 projectPtr = mgr.
GetProject( projectFn.GetFullPath() );
1565 createdTransientProject = ( projectPtr != nullptr );
1570 m_reporter->Report(
_(
"Could not establish a project for the import\n" ),
1579 struct TRANSIENT_PROJECT_GUARD
1585 ~TRANSIENT_PROJECT_GUARD()
1590 } transientProjectGuard{ mgr, projectPtr, createdTransientProject };
1594 std::unique_ptr<SCHEMATIC> schematic = std::make_unique<SCHEMATIC>( &
project );
1607 m_reporter->Report( wxString::Format(
_(
"No plugin found for file type '%s'\n" ),
1614 pi->SetReporter( &importMessages );
1618 m_reporter->Report( wxString::Format(
_(
"Importing '%s' using %s format...\n" ),
1619 inputFn.GetFullPath(), formatName ),
1622 loadedSheet = pi->LoadSchematicFile( inputFn.GetFullPath(), schematic.get() );
1632 m_reporter->Report( wxString::Format(
_(
"Error during import: %s\n" ), ioe.
What() ),
1637 size_t symbolCount = 0;
1638 size_t sheetCount = 0;
1644 std::vector<SCH_SHEET*> topLevelSheets = schematic->GetTopLevelSheets();
1645 bool loadedIsTopLevel = std::find( topLevelSheets.begin(), topLevelSheets.end(),
1646 loadedSheet ) != topLevelSheets.end();
1647 bool loadedIsVirtualRoot = loadedSheet == &schematic->Root()
1650 if( !loadedIsTopLevel && !loadedIsVirtualRoot )
1651 schematic->SetTopLevelSheets( { loadedSheet } );
1659 std::unique_ptr<TOOL_MANAGER> toolManager = std::make_unique<TOOL_MANAGER>();
1660 toolManager->SetEnvironment( schematic.get(),
nullptr,
nullptr,
Kiface().KifaceSettings(),
1665 schematic->RecalculateConnections( &dummyCommit,
GLOBAL_CLEANUP, toolManager.get() );
1669 schematic->SetSheetNumberAndCount();
1673 schematic->Settings().m_SchDrawingSheetFileName = wxS(
"empty.kicad_wks" );
1676 if(
SCH_SHEET* topSheet = schematic->GetTopLevelSheet() )
1677 topSheet->SetFileName( outputFn.GetFullName() );
1679 schematic->RootScreen()->SetFileName( outputFn.GetFullPath() );
1683 std::unordered_map<SCH_SCREEN*, wxString> filenameMap;
1684 filenameMap[schematic->RootScreen()] = outputFn.GetFullPath();
1690 filenameMap, errorMsg ) )
1700 for(
size_t i = 0; i < screens.
GetCount(); i++ )
1703 wxString
path = filenameMap[screen];
1705 if(
path.IsEmpty() )
1708 wxFileName fn(
path );
1711 kicadPi->SaveSchematicFile( fn.GetFullPath(), screens.
GetSheet( i ), schematic.get() );
1715 symbolCount += std::distance( symbols.begin(), symbols.end() );
1720 m_reporter->Report( wxString::Format(
_(
"Error saving imported schematic: %s\n" ),
1725 catch(
const std::exception& exc )
1727 m_reporter->Report( wxString::Format(
_(
"Error saving imported schematic: %s\n" ),
1737 m_reporter->Report( wxString::Format(
_(
"Successfully saved imported schematic to '%s'\n" ),
1738 outputFn.GetFullPath() ),
1742 if(
Pgm().GetSettingsManager().IsProjectOpenNotDummy() )
1744 std::vector<FILE_INFO_PAIR>& projectSheets =
project.GetProjectFile().GetSheets();
1745 projectSheets.clear();
1752 projectSheets.emplace_back( std::make_pair( sheet->
m_Uuid, sheet->
GetName() ) );
1756 const std::vector<SCH_SHEET*>& topLevelSheets = schematic->GetTopLevelSheets();
1758 if( !topLevelSheets.empty() )
1760 std::vector<TOP_LEVEL_SHEET_INFO>& infos =
project.GetProjectFile().GetTopLevelSheets();
1763 wxString projectPath =
project.GetProjectPath();
1765 for(
SCH_SHEET* sheet : topLevelSheets )
1767 if( !sheet || !sheet->GetScreen() )
1770 wxFileName sheetFn( sheet->GetScreen()->GetFileName() );
1772 if( sheetFn.IsAbsolute() )
1773 sheetFn.MakeRelativeTo( projectPath );
1775 infos.emplace_back( sheet->m_Uuid, sheet->GetName(), sheetFn.GetFullPath() );
1781 if( createdTransientProject && schematic->GetTopLevelSheets().size() > 1 )
1783 m_reporter->Report( wxString::Format(
_(
"%zu sheets were written, but only '%s' is "
1784 "reachable: top-level sheets are recorded in a "
1785 "project file. Use 'kicad-cli import' to create "
1787 sheetCount, outputFn.GetFullName() ),
1791 IMPORT_REPORT_DATA reportData;
1796 reportData.m_sourceFile = inputFn.GetFullName();
1797 reportData.m_sourceFormat = formatName;
1798 reportData.m_outputFile = outputFn.GetFullName();
1799 reportData.m_statistics = {
1800 { wxS(
"symbols" ), symbolCount },
1801 { wxS(
"sheets" ), sheetCount }
1804 reportData.m_statistics.emplace_back( wxS(
"renamed_board_nets" ), job->
m_netNameMap.size() );
1835 return drawingSheet;
1867 return std::unique_ptr<SCHEMATIC>(
1875 aSch->SetProject(
nullptr );
1918 return diffExitCode;
1946 std::vector<std::unique_ptr<LIB_SYMBOL>>& aOwners,
1950 if( aAllowEmpty && aPath.IsEmpty() )
1956 aOwners = std::move( loaded.first );
1957 aMap = std::move( loaded.second );
1962 aReporter.
Report( wxString::Format(
_(
"Failed to load %s: %s\n" ), aPath, ioe.
What() ),
1965 catch(
const std::exception& e )
1968 wxString::Format(
_(
"Failed to load %s: %s\n" ), aPath, wxString::FromUTF8( e.what() ) ),
1983 for(
const auto& [
name, symbol] : aMap )
2000 std::vector<std::unique_ptr<LIB_SYMBOL>> ownersA;
2001 std::vector<std::unique_ptr<LIB_SYMBOL>> ownersB;
2023 return diffExitCode;
2048 const wxString& aFileB,
const wxString& aLabelA,
2049 const wxString& aLabelB, wxWindow* aParent,
2057 wxWindow* parent = aParent ? aParent : ( wxTheApp ? wxTheApp->GetTopWindow() :
nullptr );
2072 if( !a.
doc && !aFileA.IsEmpty() )
2078 if( !b.
doc && !aFileB.IsEmpty() )
2088 std::unique_ptr<SCHEMATIC> emptyA;
2089 std::unique_ptr<SCHEMATIC> emptyB;
2093 emptyA = std::make_unique<SCHEMATIC>( &scratchPrjA );
2094 emptyA->CreateDefaultScreens();
2099 emptyB = std::make_unique<SCHEMATIC>( &scratchPrjB );
2100 emptyB->CreateDefaultScreens();
2113 const wxString labelA = aLabelA.IsEmpty() ? aFileA : aLabelA;
2114 const wxString labelB = aLabelB.IsEmpty() ? aFileB : aLabelB;
2117 parent, labelA, labelB,
result, std::move( refGeometry ), std::move( compGeometry ),
2120 SCH_SCREEN* refScreen = schA ? schA->RootScreen() : nullptr;
2121 SCH_SCREEN* compScreen = schB ? schB->RootScreen() : nullptr;
2123 if( !aSheetPath.empty() )
2127 if( auto sp = schA->Hierarchy().GetSheetPathByKIIDPath( aSheetPath, true ) )
2128 refScreen = sp->LastScreen();
2133 if( auto sp = schB->Hierarchy().GetSheetPathByKIIDPath( aSheetPath, true ) )
2134 compScreen = sp->LastScreen();
2144 emptyA->SetProject(
nullptr );
2147 emptyB->SetProject(
nullptr );
2153 std::vector<std::unique_ptr<LIB_SYMBOL>> ownersA;
2154 std::vector<std::unique_ptr<LIB_SYMBOL>> ownersB;
2183 const wxString labelA = aLabelA.IsEmpty() ? aFileA : aLabelA;
2184 const wxString labelB = aLabelB.IsEmpty() ? aFileB : aLabelB;
2202 const wxString& aOurs,
const wxString& aTheirs,
2203 const wxString& aOutput,
bool aInteractive,
bool aSingleFile,
2214 return runSchMerge( aAncestor, aOurs, aTheirs, aOutput, aInteractive );
2219 const wxString& aTheirs,
const wxString& aOutput,
2228 if( !ancestor.
doc || !ours.
doc || !theirs.
doc )
2238 auto hasSingleRoot = [](
const SCHEMATIC* aSch )
2240 return aSch->GetTopLevelSheets().size() == 1;
2243 if( !hasSingleRoot( ancestor.
doc.get() ) || !hasSingleRoot( ours.
doc.get() ) || !hasSingleRoot( theirs.
doc.get() ) )
2245 m_reporter->Report(
_(
"sch merge requires each input to have a single top-level sheet\n" ),
2261 if( aInteractive && !
plan.Resolved() )
2263 if( !
Pgm().IsGUI() )
2265 m_reporter->Report(
_(
"--interactive requires a GUI KiCad process; the console "
2266 "kicad-cli cannot open dialogs.\n" ),
2298 if( !applier.
Apply() )
2309 m_reporter->Report(
_(
"Merge contains hierarchical sheet structure changes that sch merge "
2316 SCH_SHEET* rootSheet = ancestor.
doc->GetTopLevelSheet( 0 );
2318 wxFileName outFn( aOutput );
2319 outFn.MakeAbsolute();
2325 const wxString outDir = outFn.GetPath();
2333 std::map<wxString, SCH_SCREEN*> basenameOwner;
2335 for(
size_t i = 0; i < screens.
GetCount(); ++i )
2339 if( !screen || screen == rootScreen )
2342 const wxString basename = wxFileName( screen->
GetFileName() ).GetFullName();
2344 if( basename.IsEmpty() )
2347 auto [it, inserted] = basenameOwner.emplace( basename, screen );
2349 if( !inserted && it->second != screen )
2351 m_reporter->Report( wxString::Format(
_(
"Cannot flatten sub-sheets with duplicate "
2352 "basename '%s'\n" ),
2362 for(
size_t i = 0; i < screens.
GetCount(); ++i )
2374 if( !childScreen || childScreen == rootScreen )
2377 const wxString basename = wxFileName( childScreen->
GetFileName() ).GetFullName();
2379 if( !basename.IsEmpty() )
2387 pi->SaveSchematicFile( outFn.GetFullPath(), rootSheet, ancestor.
doc.get() );
2389 for(
size_t i = 0; i < screens.
GetCount(); ++i )
2394 if( !screen || !sheet || screen == rootScreen )
2397 const wxString basename = wxFileName( screen->
GetFileName() ).GetFullName();
2399 if( basename.IsEmpty() )
2402 wxFileName outSubFn( outDir, basename );
2403 pi->SaveSchematicFile( outSubFn.GetFullPath(), sheet, ancestor.
doc.get() );
2408 m_reporter->Report( wxString::Format(
_(
"Failed to save merged schematic: %s\n" ), ioe.
What() ),
2420 wxFileName proFn = outFn;
2437 ancestor.
doc->ErcSettings().SaveToFile( wxEmptyString,
true );
2440 ancestor.
doc->Settings().SaveToFile( wxEmptyString,
true );
2442 std::set<wxString> touched;
2452 if( !
Pgm().GetSettingsManager().SaveProjectCopy( proFn.GetFullPath(), ancestor.
project ) )
2455 wxString::Format(
_(
"Failed to save merged project file: %s\n" ), proFn.GetFullPath() ),
2466 m_reporter->Report( wxString::Format( wxS(
"%s: %s\n" ), f.validator, f.message ), f.severity );
2473 m_reporter->Report( wxString::Format(
_(
"Merge completed with %zu unresolved conflict(s) in %s\n" ),
2488#include <wx/ffile.h>
2492 const wxString& aTheirs,
const wxString& aOutput )
2494 if( aOutput.IsEmpty() )
2503 std::vector<std::unique_ptr<LIB_SYMBOL>> owners;
2507 LIB_SIDE ancestor, ours, theirs;
2509 auto loadSide = [&](
const wxString& aPath, LIB_SIDE& aSide ) ->
int
2514 aSide.owners = std::move( loaded.first );
2515 aSide.map = std::move( loaded.second );
2520 m_reporter->Report( wxString::Format(
_(
"Failed to load %s: %s\n" ), aPath, ioe.
What() ),
2523 catch(
const std::exception& e )
2526 wxString::Format(
_(
"Failed to load %s: %s\n" ), aPath, wxString::FromUTF8( e.what() ) ),
2554 std::vector<std::unique_ptr<LIB_SYMBOL>> merged = applier.
Apply();
2559 const bool hadSilentFallback = applier.
GetReport().mergePropsFallback > 0;
2563 wxFileName outFn( aOutput );
2564 outFn.MakeAbsolute();
2572 for(
auto& sym : merged )
2583 m_reporter->Report( wxString::Format(
_(
"Failed to save merged symbol library: %s\n" ), ioe.
What() ),
2589 if( !planSnapshot.
Resolved() || hadSilentFallback )
2593 std::set<KIID_PATH> conflicts( planSnapshot.
unresolved.begin(), planSnapshot.
unresolved.end() );
2596 conflicts.insert(
id );
2598 m_reporter->Report( wxString::Format(
_(
"Symbol library merge completed with %zu unresolved "
2599 "conflict(s) in %s\n" ),
2600 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.
Runs the electrical rules checks and adds a SCH_MARKER for each violation.
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 ApplyBomPreset(const BOM_PRESET &aPreset)
void AddColumn(const wxString &aFieldName, const wxString &aLabel, bool aAddedByUser) override
void SetCurrentVariant(const wxString &aVariantName) override
Select the displayed variant, retaining un-applied edits in every variant.
Reporter handed to an importer during an import job.
void Flush(IMPORT_REPORT_FORMAT aFormat, IMPORT_REPORT_DATA &aData)
Move the collected messages into aData when a report will be written, otherwise forward them to the j...
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()
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.
bool Store() override
Stores the current parameters into the JSON document represented by this object Note: this doesn't do...
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()
Commit for the schematic and symbol editors.
void Push(const wxString &aMessage=wxEmptyString, 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()
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.
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 line 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
#define TO_UTF8(wxstring)
Convert a wxString to a UTF8 encoded C string for all wxWidgets build modes.
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.
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...
bool 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...
#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.
static int plotJob(JOB_EXPORT_PCB_PLOT *aJob, PCB_PLOTTER &aPlotter, const wxString &aOutPath, bool aSingleOutput, bool aUseOverrides)
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)
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
std::optional< SCH_SHEET_PATH > m_sheetPath
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
Symbol library map sorted by the symbol name.
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.