25#include <wx/zipstrm.h>
26#include <wx/filename.h>
27#include <wx/tokenzr.h>
28#include <wx/wfstream.h>
30#include <nlohmann/json.hpp>
136#include <api/board/board.pb.h>
137#include <google/protobuf/util/json_util.h>
160 [aKiway](
JOB* job, wxWindow* aParent ) ->
bool
166 wxCHECK( bomJob && editFrame,
false );
176 [aKiway](
JOB* job, wxWindow* aParent ) ->
bool
183 wxCHECK( svgJob && editFrame,
false );
189 [](
JOB* job, wxWindow* aParent ) ->
bool
193 wxCHECK( renderJob,
false );
199 [](
JOB* job, wxWindow* aParent ) ->
bool
204 [](
JOB* job, wxWindow* aParent ) ->
bool
209 [aKiway](
JOB* job, wxWindow* aParent ) ->
bool
216 wxCHECK( svgJob && editFrame,
false );
222 [aKiway](
JOB* job, wxWindow* aParent ) ->
bool
229 wxCHECK( gencadJob && editFrame,
false );
235 [aKiway](
JOB* job, wxWindow* aParent ) ->
bool
242 wxCHECK( dxfJob && editFrame,
false );
248 [aKiway](
JOB* job, wxWindow* aParent ) ->
bool
255 wxCHECK( pdfJob && editFrame,
false );
261 [aKiway](
JOB* job, wxWindow* aParent ) ->
bool
268 wxCHECK( pngJob && editFrame,
false );
274 [aKiway](
JOB* job, wxWindow* aParent ) ->
bool
281 wxCHECK( psJob && editFrame,
false );
287 [aKiway](
JOB* job, wxWindow* aParent ) ->
bool
294 wxCHECK( statsJob && editFrame,
false );
299 statsJob->
m_filename = boardName.GetFullPath();
302 wxWindow* parent = aParent ? aParent :
static_cast<wxWindow*
>( editFrame );
309 [aKiway](
JOB* job, wxWindow* aParent ) ->
bool
316 wxCHECK( stackupJob && editFrame,
false );
321 stackupJob->
m_filename = boardName.GetFullPath();
324 wxWindow* parent = aParent ? aParent :
static_cast<wxWindow*
>( editFrame );
331 [aKiway](
JOB* job, wxWindow* aParent ) ->
bool
338 wxCHECK( gJob && editFrame,
false );
344 [aKiway](
JOB* job, wxWindow* aParent ) ->
bool
351 wxCHECK( gJob && editFrame,
false );
360 m_reporter->Report(
_(
"Plotting to HPGL is no longer supported as of KiCad 10.0.\n" ),
364 [aKiway](
JOB* job, wxWindow* aParent ) ->
bool
368 wxCHECK( editFrame,
false );
370 DisplayErrorMessage( editFrame,
_(
"Plotting to HPGL is no longer supported as of KiCad 10.0." ) );
374 [aKiway](
JOB* job, wxWindow* aParent ) ->
bool
381 wxCHECK( drillJob && editFrame,
false );
387 [aKiway](
JOB* job, wxWindow* aParent ) ->
bool
394 wxCHECK( posJob && editFrame,
false );
400 [](
JOB* job, wxWindow* aParent ) ->
bool
405 [](
JOB* job, wxWindow* aParent ) ->
bool
410 [](
JOB* job, wxWindow* aParent ) ->
bool
415 [](
JOB* job, wxWindow* aParent ) ->
bool
420 [](
JOB* job, wxWindow* aParent ) ->
bool
424 wxCHECK( drcJob,
false );
430 [aKiway](
JOB* job, wxWindow* aParent ) ->
bool
437 wxCHECK( ipcJob && editFrame,
false );
443 [](
JOB* job, wxWindow* aParent ) ->
bool
448 [aKiway](
JOB* job, wxWindow* aParent ) ->
bool
455 wxCHECK( odbJob && editFrame,
false );
503 BOARD* brd =
nullptr;
507 auto getProjectForBoard = [&](
const wxString& aBoardPath ) ->
PROJECT*
509 wxFileName pro = aBoardPath;
517 settingsManager.
LoadProject( pro.GetFullPath(),
true );
524 auto loadBoardFromPath = [&](
const wxString& aBoardPath ) ->
BOARD*
536 return loadedBoard.release();
540 loadError = ioe.
What();
549 if( !
Pgm().IsGUI() &&
Pgm().GetSettingsManager().IsProjectOpen() )
551 wxString pcbPath = aPath;
553 if( pcbPath.IsEmpty() )
558 pcbPath =
path.GetFullPath();
562 m_cliBoard.reset( loadBoardFromPath( pcbPath ) );
566 else if(
Pgm().IsGUI() &&
Pgm().GetSettingsManager().IsProjectOpen() )
575 m_cliBoard.reset( loadBoardFromPath( aPath ) );
581 wxString msg =
_(
"Failed to load board" );
583 if( !loadError.IsEmpty() )
584 msg += wxString::Format( wxS(
": %s" ), loadError );
595 std::map<wxString, LSET> layerUserMasks;
596 std::map<wxString, LSET> layerMasks;
597 std::map<wxString, LSET> layerGuiMasks;
631 auto pushLayers = [&](
const LSET& layerSet )
634 layerMask.push_back( layer );
637 if( !aLayerString.IsEmpty() )
639 wxStringTokenizer layerTokens( aLayerString,
"," );
641 while( layerTokens.HasMoreTokens() )
643 std::string token =
TO_UTF8( layerTokens.GetNextToken().Trim(
true ).Trim(
false ) );
645 if( layerUserMasks.contains( token ) )
646 pushLayers( layerUserMasks.at( token ) );
647 else if( layerMasks.count( token ) )
648 pushLayers( layerMasks.at( token ) );
649 else if( layerGuiMasks.count( token ) )
650 pushLayers( layerGuiMasks.at( token ) );
652 m_reporter->Report( wxString::Format(
_(
"Invalid layer name '%s'\n" ), token ) );
676 if( !currentVariant.IsEmpty() && currentVariant != wxS(
"all" ) )
682 bool hasWarned =
false;
687 if( !fp->IsAnnotated() && !hasWarned )
689 m_reporter->Report(
_(
"Warning: board has unannotated footprints, please use the PCB "
690 "editor to annotate them\n" ),
723 std::set<wxString> userFieldNames;
725 for(
size_t i = 0; i < referenceList.size(); ++i )
727 FOOTPRINT& footprint = referenceList[i].GetFootprint();
731 if( !field->IsMandatory() && !field->IsPrivate() )
732 userFieldNames.insert( field->GetName() );
736 for(
const wxString& fieldName : userFieldNames )
748 std::optional<BOM_PRESET> boardPreset;
750 for(
const BOM_PRESET& p : BOM_PRESET::BuiltInPresets() )
771 wxString::Format(
_(
"BOM preset '%s' not found" ) + wxS(
"\n" ), aBomJob->
m_bomPresetName ),
777 preset = *boardPreset;
785 auto normalizeFieldName = [&dataModel](
const wxString& aName ) -> wxString
787 if( aName.IsEmpty() )
788 return wxEmptyString;
793 wxString wrapped = wxS(
"${" ) + aName + wxS(
"}" );
805 wxString fieldName = normalizeFieldName( rawFieldName );
807 if( fieldName.IsEmpty() )
815 if( fieldName == wxS(
"*" ) )
821 field.
name = modelField.name;
826 bool fieldAlreadyPresent =
false;
828 for(
BOM_FIELD& presetField : preset.fieldsOrdered )
830 if( presetField.
name == field.
name )
832 fieldAlreadyPresent =
true;
837 bool fieldLaterInList =
false;
841 if( normalizeFieldName( fieldInList ) == field.
name )
843 fieldLaterInList =
true;
848 if( !fieldAlreadyPresent && !fieldLaterInList )
849 preset.fieldsOrdered.emplace_back( field );
857 field.
name = fieldName;
858 field.
show = !fieldName.StartsWith( wxT(
"__" ), &field.
name );
870 preset.fieldsOrdered.emplace_back( field );
875 preset.sortField = normalizeFieldName( aBomJob->
m_sortField );
887 std::optional<BOM_FMT_PRESET> boardFmtPreset;
907 if( !boardFmtPreset )
909 m_reporter->Report( wxString::Format(
_(
"BOM format preset '%s' not found" ) + wxS(
"\n" ),
916 fmt = *boardFmtPreset;
932 fn.SetName( fn.GetName() );
939 bool hasVariantPlaceholder = configuredPath.Contains( wxS(
"${VARIANT}" ) );
942 std::vector<wxString> variantsToProcess;
950 variantsToProcess.push_back( currentVariant );
953 for(
const wxString& variantName : variantsToProcess )
955 std::vector<wxString> singleVariant = { variantName };
963 if( hasVariantPlaceholder )
965 wxString variantPath = configuredPath;
966 variantPath.Replace( wxS(
"${VARIANT}" ), variantName );
984 if( !f.Open( outPath, wxFile::write ) )
986 m_reporter->Report( wxString::Format(
_(
"Unable to open destination '%s'" ), outPath ),
992 bool res = f.Write( dataModel.
Export( fmt ) );
1010 if( aStepJob ==
nullptr )
1024 fn.SetName( fn.GetName() );
1084 m_reporter->Report( wxString::Format(
_(
"Successfully exported VRML to %s" ), outPath ),
1116 if( !stepExporter.
Export() )
1128 if( aRenderJob ==
nullptr )
1163 fn.SetName( wxString::Format(
"%s-%d", fn.GetName(),
static_cast<int>( aRenderJob->
m_side ) ) );
1253 lightColor, lightColor, lightColor, lightColor, lightColor, lightColor, lightColor, lightColor,
1259 sideElevation, sideElevation, sideElevation, sideElevation,
1260 -sideElevation, -sideElevation, -sideElevation, -sideElevation,
1264 45, 135, 225, 315, 45, 135, 225, 315,
1269 boardAdapter.
m_Cfg = &cfg;
1285 if( preset->name.Lower() ==
_(
"legacy colors" ) )
1300 static std::map<JOB_PCB_RENDER::SIDE, VIEW3D_TYPE> s_viewCmdMap = {
1323 for(
bool first =
true; raytrace.
Redraw(
false ); first = false )
1350 uint8_t* rgbaBuffer = raytrace.
GetBuffer();
1352 bool success = !!rgbaBuffer;
1356 const unsigned int wxh = realSize.x * realSize.y;
1358 unsigned char* rgbBuffer = (
unsigned char*) malloc( wxh * 3 );
1359 unsigned char* alphaBuffer = (
unsigned char*) malloc( wxh );
1361 unsigned char* rgbaPtr = rgbaBuffer;
1362 unsigned char* rgbPtr = rgbBuffer;
1363 unsigned char* alphaPtr = alphaBuffer;
1365 for(
int y = 0; y < realSize.y; y++ )
1367 for(
int x = 0; x < realSize.x; x++ )
1369 rgbPtr[0] = rgbaPtr[0];
1370 rgbPtr[1] = rgbaPtr[1];
1371 rgbPtr[2] = rgbaPtr[2];
1372 alphaPtr[0] = rgbaPtr[3];
1380 wxImage
image( realSize );
1381 image.SetData( rgbBuffer );
1382 image.SetAlpha( alphaBuffer );
1385 image.SetOption( wxIMAGE_OPTION_QUALITY, 90 );
1386 image.SaveFile( outPath,
1407 if( aSvgJob ==
nullptr )
1424 fn.SetName( fn.GetName() );
1464 std::optional<wxString> layerName;
1465 std::optional<wxString> sheetName;
1466 std::optional<wxString> sheetPath;
1467 std::vector<wxString> outputPaths;
1488 for(
const wxString& outputPath : outputPaths )
1499 if( aDxfJob ==
nullptr )
1537 fn.SetName( fn.GetName() );
1557 std::optional<wxString> layerName;
1558 std::optional<wxString> sheetName;
1559 std::optional<wxString> sheetPath;
1573 std::vector<wxString> outputPaths;
1582 for(
const wxString& outputPath : outputPaths )
1591 bool plotAllLayersOneFile =
false;
1594 if( pdfJob ==
nullptr )
1622 plotAllLayersOneFile =
true;
1630 const bool outputIsSingle = plotAllLayersOneFile || pdfJob->
m_pdfSingle;
1635 fn.SetName( fn.GetName() );
1654 std::optional<wxString> layerName;
1655 std::optional<wxString> sheetName;
1656 std::optional<wxString> sheetPath;
1658 if( plotAllLayersOneFile )
1670 std::vector<wxString> outputPaths;
1673 outputIsSingle, layerName, sheetName, sheetPath, &outputPaths ) )
1678 for(
const wxString& outputPath : outputPaths )
1689 if( pngJob ==
nullptr )
1727 fn.SetName( fn.GetName() );
1746 std::vector<wxString> outputPaths;
1749 std::nullopt, std::nullopt, std::nullopt, &outputPaths ) )
1754 for(
const wxString& outputPath : outputPaths )
1765 if( psJob ==
nullptr )
1805 fn.SetName( fn.GetName() );
1825 std::optional<wxString> layerName;
1826 std::optional<wxString> sheetName;
1827 std::optional<wxString> sheetPath;
1841 std::vector<wxString> outputPaths;
1844 layerName, sheetName, sheetPath, &outputPaths ) )
1849 for(
const wxString& outputPath : outputPaths )
1861 if( aGerberJob ==
nullptr )
1890 bool hasLayerListSpecified =
false;
1897 hasLayerListSpecified =
true;
1937 LSET preflightLayers = layersToPlot;
1940 preflightLayers.
set( commonLayer );
1949 plotSequence.push_back( layer );
1955 if(
find( plotSequence.begin(), plotSequence.end(), layer_all ) != plotSequence.end() )
1958 plotSequence.push_back( layer_all );
1969 plotOpts = boardPlotOptions;
1979 wxString fullname = fn.GetFullName();
1987 jobfile_writer.
AddGbrFile( layer, fullname );
2013 m_reporter->Report( wxString::Format(
_(
"Failed to plot to '%s'.\n" ), fn.GetFullPath() ),
2039 if( aGencadJob ==
nullptr )
2063 fn.SetName( fn.GetName() );
2095 if( statsJob ==
nullptr )
2113 wxString projectName;
2120 if( boardFile.GetName().IsEmpty() )
2121 boardFile = wxFileName( statsJob->
m_filename );
2144 FILE* outFile = wxFopen( outPath, wxS(
"wt" ) );
2152 if( fprintf( outFile,
"%s",
TO_UTF8( report ) ) < 0 )
2173 if( stackupJob ==
nullptr )
2183 if( boardFile.GetName().IsEmpty() )
2184 boardFile = wxFileName( stackupJob->
m_filename );
2192 kiapi::board::BoardStackup stackupMsg;
2195 google::protobuf::util::JsonPrintOptions jsonOptions;
2196 jsonOptions.add_whitespace =
true;
2200 if( !google::protobuf::util::MessageToJsonString( stackupMsg, &
json, jsonOptions ).ok() )
2206 output = wxString::FromUTF8(
json );
2219 item->SetLayerName( brd->
GetLayerName( item->GetBrdLayerId() ) );
2260 const bool writeOk =
static_cast<bool>( outFile );
2282 if( aGerberJob ==
nullptr )
2310 fn.SetName( fn.GetName() );
2364 PLOTTER* plotter =
StartPlotBoard( brd, &plotOpts, layer, layerName, outPath, sheetName, sheetPath );
2390 if( aDrillJob ==
nullptr )
2406 std::unique_ptr<GENDRILL_WRITER_BASE> drillWriter;
2409 drillWriter = std::make_unique<EXCELLON_WRITER>( brd );
2411 drillWriter = std::make_unique<GERBER_WRITER>( brd );
2435 wxFileName fn = outPath;
2437 fn.SetName( fn.GetName() +
"-drill" );
2468 if( excellonWriter ==
nullptr )
2483 for(
const wxString& outputFile : drillWriter->GetCreatedFiles() )
2502 if( gerberWriter ==
nullptr )
2518 for(
const wxString& outputFile : drillWriter->GetCreatedFiles() )
2542 if( aPosJob ==
nullptr )
2553 fn.SetName( fn.GetName() );
2575 wxFileName fn( outPath );
2576 wxString baseName = fn.GetName();
2578 auto exportPlaceFile = [&](
bool frontSide,
bool backSide,
const wxString& curr_outPath ) ->
bool
2580 FILE* file = wxFopen( curr_outPath, wxS(
"wt" ) );
2581 wxCHECK( file,
false );
2593 fputs( data.c_str(), file );
2606 if( exportPlaceFile(
true,
false, fn.GetFullPath() ) )
2608 m_reporter->Report( wxString::Format(
_(
"Wrote front position data to '%s'.\n" ), fn.GetFullPath() ),
2623 if( exportPlaceFile(
false,
true, fn.GetFullPath() ) )
2625 m_reporter->Report( wxString::Format(
_(
"Wrote back position data to '%s'.\n" ), fn.GetFullPath() ),
2651 if( exportPlaceFile( front, back, fn.GetFullPath() ) )
2653 m_reporter->Report( wxString::Format(
_(
"Wrote position data to '%s'.\n" ), fn.GetFullPath() ),
2672 wxString outPath_base = outPath;
2683 m_reporter->Report( wxString::Format(
_(
"Wrote front position data to '%s'.\n" ), outPath ),
2698 outPath = outPath_base;
2707 m_reporter->Report( wxString::Format(
_(
"Wrote back position data to '%s'.\n" ), outPath ),
2727 if( upgradeJob ==
nullptr )
2742 m_reporter->Report(
_(
"Output path must be specified to convert legacy and non-KiCad libraries\n" ),
2752 m_reporter->Report(
_(
"Footprint library path does not exist or is not accessible\n" ),
2773 bool shouldSave = upgradeJob->
m_force;
2819 if( svgJob ==
nullptr )
2852 bool singleFpPlotted =
false;
2854 for(
const auto& [fpName, fpCacheEntry] : fpLib.
GetFootprints() )
2868 singleFpPlotted =
true;
2871 exitCode =
doFpExportSvg( svgJob, fpCacheEntry->GetFootprint().get() );
2877 if( !svgJob->
m_footprint.IsEmpty() && !singleFpPlotted )
2879 m_reporter->Report(
_(
"The given footprint could not be found to export." ) + wxS(
"\n" ),
2889 wxFileName outputFile;
2894 m_reporter->Report( wxString::Format(
_(
"Plotting footprint '%s' to '%s'\n" ),
2914 aSvgJob->
AddOutput( outputFile.GetFullPath() );
2924 if( drcJob ==
nullptr )
2940 fn.SetName( fn.GetName() + wxS(
"-drc" ) );
2969 std::unique_ptr<NETLIST>
netlist = std::make_unique<NETLIST>();
2971 if( !drcEngine->RulesValid() )
2979 m_reporter->Report(
_(
"DRC incomplete: could not compile custom design rules." )
2980 + wxS(
"\n" ) + error.
What() + wxS(
"\n" ),
2993 std::string netlist_str;
2997 wxString annotateMsg =
_(
"Schematic parity tests require a fully annotated schematic." );
2998 netlist_str = annotateMsg;
3010 wxFileName schematicPath( drcJob->
m_filename );
3011 schematicPath.MakeAbsolute();
3014 if( !schematicPath.Exists() )
3017 if( !schematicPath.Exists() )
3024 typedef bool ( *NETLIST_FN_PTR )(
const wxString&, std::string& );
3027 ( *netlister )( schematicPath.GetFullPath(), netlist_str );
3035 else if( netlist_str == annotateMsg )
3057 drcEngine->SetSchematicNetlist(
netlist.get() );
3069 drcEngine->SetViolationHandler(
3070 [&](
const std::shared_ptr<DRC_ITEM>& aItem,
const VECTOR2I& aPos,
int aLayer,
3071 const std::function<
void(
PCB_MARKER* )>& aPathGenerator )
3074 aPathGenerator( marker );
3075 commit.
Add( marker );
3081 drcEngine->ClearViolationHandler();
3088 std::shared_ptr<DRC_ITEMS_PROVIDER> markersProvider =
3091 std::shared_ptr<DRC_ITEMS_PROVIDER> ratsnestProvider =
3094 std::shared_ptr<DRC_ITEMS_PROVIDER> fpWarningsProvider =
3097 markersProvider->SetSeverities( drcJob->
m_severity );
3098 ratsnestProvider->SetSeverities( drcJob->
m_severity );
3099 fpWarningsProvider->SetSeverities( drcJob->
m_severity );
3101 m_reporter->Report( wxString::Format(
_(
"Found %d violations\n" ), markersProvider->GetCount() ),
3103 m_reporter->Report( wxString::Format(
_(
"Found %d unconnected items\n" ), ratsnestProvider->GetCount() ),
3109 wxString::Format(
_(
"Found %d schematic parity issues\n" ), fpWarningsProvider->GetCount() ),
3113 DRC_REPORT reportWriter( brd, units, markersProvider, ratsnestProvider, fpWarningsProvider );
3115 bool wroteReport =
false;
3148 if( markersProvider->GetCount() > 0 || ratsnestProvider->GetCount() > 0 || fpWarningsProvider->GetCount() > 0 )
3162 if( job ==
nullptr )
3200 if( job ==
nullptr )
3211 fn.SetName( fn.GetName() );
3227 bool success = exporter.
Write( outPath );
3247 if( job ==
nullptr )
3268 fn.SetName( fn.GetName() + wxS(
"-odb" ) );
3315 if( job ==
nullptr )
3318 bool shouldSave = job->
m_force;
3348 wxString::Format(
_(
"Error saving board file '%s'.\n%s" ), job->
m_filename, ioe.
What().GetData() );
3362 if( aDrawingSheet && !aDrawingSheet->IsEmpty() )
3392 return drawingSheet;
3399 if( aSheetPath.IsEmpty() )
3402 auto loadSheet = [&](
const wxString&
path ) ->
bool
3415 m_reporter->Report( wxString::Format(
_(
"Error loading drawing sheet '%s'." ),
path ) + wxS(
"\n" ) + msg
3424 if( loadSheet( aSheetPath ) )
3456 m_reporter->Report( wxString::Format(
_(
"Input file not found: '%s'\n" ),
3496 m_reporter->Report( wxString::Format(
_(
"No PCB importer recognizes the file format of "
3509 if( outputPath.IsEmpty() )
3517 PROJECT* projectPtr =
nullptr;
3518 bool createdTransientProject =
false;
3522 projectPtr = &mgr.
Prj();
3526 wxFileName projectFn( outputPath );
3530 projectPtr = mgr.
GetProject( projectFn.GetFullPath() );
3531 createdTransientProject = ( projectPtr != nullptr );
3536 m_reporter->Report(
_(
"Could not establish a project for the import\n" ),
3542 struct TRANSIENT_PROJECT_GUARD
3548 ~TRANSIENT_PROJECT_GUARD()
3553 } transientProjectGuard{ mgr, projectPtr, createdTransientProject };
3555 std::unique_ptr<BOARD> board;
3557 struct BOARD_PROJECT_GUARD
3559 std::unique_ptr<BOARD>& board;
3561 ~BOARD_PROJECT_GUARD()
3564 board->ClearProject();
3566 } boardProjectGuard{ board };
3569 std::vector<wxString> warnings;
3573 struct CAPTURED_LAYER
3580 std::vector<CAPTURED_LAYER> capturedLayers;
3581 std::set<wxString> seenSourceLayers;
3582 bool layersCaptured =
false;
3590 m_reporter->Report( wxString::Format(
_(
"No plugin found for file type '%s'\n" ), formatName ),
3602 mappable->RegisterCallback(
3603 [&](
const std::vector<INPUT_LAYER_DESC>& aDescs )
3604 -> std::map<wxString, PCB_LAYER_ID>
3606 std::map<wxString, PCB_LAYER_ID>
result;
3611 wxString method = wxS(
"auto" );
3613 if(
auto it = job->
m_layerMap.find( desc.Name );
3620 warnings.push_back( wxString::Format(
3621 _(
"Layer map entry '%s' -> '%s' names an unknown "
3622 "KiCad layer; using automatic mapping instead" ),
3623 desc.Name, it->second ) );
3625 else if( !desc.PermittedLayers.Contains( resolved ) )
3627 warnings.push_back( wxString::Format(
3628 _(
"Layer map entry '%s' -> '%s' is not a permitted "
3629 "target for this layer; using automatic mapping "
3631 desc.Name, it->second ) );
3636 method = wxS(
"explicit" );
3642 warnings.push_back( wxString::Format(
3643 _(
"No KiCad layer mapping for required source layer "
3644 "'%s'; its items will not be imported" ),
3648 result.emplace( desc.Name, target );
3649 capturedLayers.push_back( { desc.Name, target, method } );
3650 seenSourceLayers.insert( desc.Name );
3653 layersCaptured =
true;
3660 warnings.push_back(
_(
"A layer map was provided, but this importer does not support "
3661 "layer remapping; it will be ignored" ) );
3665 wxString::Format(
_(
"Importing '%s' using %s format...\n" ), job->
m_inputFile, formatName ),
3678 m_reporter->Report( wxString::Format(
_(
"Unexpected cancellation: %s\n" ), ioce.
What() ),
3690 board->SetProject( projectPtr );
3704 if( layersCaptured )
3706 for(
const auto& [source, target] : job->
m_layerMap )
3708 if( !seenSourceLayers.contains( source ) )
3710 warnings.push_back( wxString::Format(
3711 _(
"Layer map entry '%s' does not match any source layer in the "
3712 "imported file; it will be ignored" ),
3720 kicadPlugin->SaveBoard( outputPath, *board );
3722 m_reporter->Report( wxString::Format(
_(
"Successfully saved imported board to '%s'\n" ), outputPath ),
3728 IMPORT_REPORT_DATA reportData;
3730 reportData.m_sourceFile = wxFileName( job->
m_inputFile ).GetFullName();
3731 reportData.m_sourceFormat = formatName;
3732 reportData.m_outputFile = wxFileName( outputPath ).GetFullName();
3734 size_t trackCount = 0;
3735 size_t viaCount = 0;
3737 for(
PCB_TRACK* track : board->Tracks() )
3745 reportData.m_statistics = {
3746 { wxS(
"footprints" ), board->Footprints().size() },
3747 { wxS(
"tracks" ), trackCount },
3748 { wxS(
"vias" ), viaCount },
3749 { wxS(
"zones" ), board->Zones().size() }
3755 nlohmann::json layerMappings = nlohmann::json::object();
3757 if( layersCaptured )
3759 for(
const CAPTURED_LAYER& mapped : capturedLayers )
3763 :
LSET::Name( mapped.m_target ).ToStdString();
3765 layerMappings[mapped.m_source.ToStdString()] = {
3766 {
"kicad_layer", kicadLayer },
3767 {
"method", mapped.m_method.ToStdString() }
3773 for(
PCB_LAYER_ID layer : board->GetEnabledLayers().Seq() )
3775 wxString layerName = board->GetLayerName( layer );
3777 layerMappings[layerName.ToStdString()] = {
3778 {
"kicad_layer",
LSET::Name( layer ).ToStdString() },
3779 {
"method",
"auto" }
3784 reportData.m_extraJson[
"layer_mapping"] = layerMappings;
3785 reportData.m_warnings = warnings;
3792 for(
const wxString& warning : warnings )
3822 bool aInitializeAfterLoad =
true )
3826 [aPath, aInitializeAfterLoad](
PROJECT* aProject ) -> std::unique_ptr<BOARD>
3849 aBoard->ClearProject();
3870 BOARD* boardA = aScratch.
doc.get();
3871 BOARD* boardB = bScratch.
doc.get();
3891 return diffExitCode;
3917 const wxString& aOurs,
const wxString& aTheirs,
3918 const wxString& aOutput,
bool aInteractive,
bool aSingleFile,
3927 return runFpLibMerge( aAncestor, aOurs, aTheirs, aOutput, aSingleFile );
3929 return runPcbMerge( aAncestor, aOurs, aTheirs, aOutput, aInteractive );
3934 const wxString& aTheirs,
const wxString& aOutput,
3951 BOARD* ancestor = ancestorScratch.
doc.get();
3952 BOARD* ours = oursScratch.
doc.get();
3953 BOARD* theirs = theirsScratch.
doc.get();
3955 if( !ancestor || !ours || !theirs )
3972 if( aInteractive && !
plan.Resolved() )
3974 if( !
Pgm().IsGUI() )
3976 m_reporter->Report(
_(
"--interactive requires a GUI KiCad process; the console "
3977 "kicad-cli cannot open dialogs.\n" ),
4006 std::unique_ptr<BOARD> merged = applier.
Apply();
4023 m_reporter->Report( wxString::Format(
_(
"Failed to save merged board: %s\n" ), ioe.
What() ),
4056 wxFileName proFn( aOutput );
4079 std::set<wxString> touched;
4097 wxString::Format(
_(
"Failed to save merged project file: %s\n" ), proFn.GetFullPath() ),
4106 auto writeStagedFile = [&](
const wxString& aPath,
const wxString& aContent,
const wxString& aLabel ) ->
bool
4108 if( aContent.IsEmpty() )
4110 if( wxFileExists( aPath ) )
4111 wxRemoveFile( aPath );
4118 if( !out.Open( aPath, wxFile::write ) || !out.Write( aContent ) )
4120 m_reporter->Report( wxString::Format(
_(
"Failed to save merged %s: %s\n" ), aLabel, aPath ),
4132 wxFileName druFn( aOutput );
4145 wxFileName fpFn( aOutput );
4148 if( !writeStagedFile( fpFn.GetFullPath(), applier.
GetReport().
fpLibTable,
_(
"footprint library table" ) ) )
4156 wxFileName symFn( aOutput );
4159 if( !writeStagedFile( symFn.GetFullPath(), applier.
GetReport().
symLibTable,
_(
"symbol library table" ) ) )
4170 m_reporter->Report( wxString::Format( wxS(
"%s: %s\n" ), f.validator, f.message ), f.severity );
4177 m_reporter->Report( wxString::Format(
_(
"Merge completed with %zu unresolved conflict(s) in %s\n" ),
4198 std::vector<std::unique_ptr<FOOTPRINT>>& aOwners,
4202 if( aAllowEmpty && aPath.IsEmpty() )
4208 aOwners = std::move( loaded.first );
4209 aMap = std::move( loaded.second );
4214 aReporter.
Report( wxString::Format(
_(
"Failed to load %s: %s\n" ), aPath, ioe.
What() ),
4217 catch(
const std::exception& e )
4220 wxString::Format(
_(
"Failed to load %s: %s\n" ), aPath, wxString::FromUTF8( e.what() ) ),
4235 for(
const auto& [
name, footprint] : aMap )
4252 wxFileName dirA( diffJob->
m_inputA );
4253 dirA.MakeAbsolute();
4254 wxFileName dirB( diffJob->
m_inputB );
4255 dirB.MakeAbsolute();
4257 std::vector<std::unique_ptr<FOOTPRINT>> ownersA;
4258 std::vector<std::unique_ptr<FOOTPRINT>> ownersB;
4280 return diffExitCode;
4305 const wxString& aFileB,
const wxString& aLabelA,
4306 const wxString& aLabelB, wxWindow* aParent,
4314 wxWindow* parent = aParent ? aParent : ( wxTheApp ? wxTheApp->GetTopWindow() :
nullptr );
4318 auto loadBoardScratch = [&](
const wxString& aPath )
4327 auto loadFootprintFile = [&](
const wxString& aPath ) -> std::unique_ptr<FOOTPRINT>
4329 if( aPath.IsEmpty() )
4332 wxFileName fn( aPath );
4357 if( !a.
doc && !aFileA.IsEmpty() )
4363 if( !b.
doc && !aFileB.IsEmpty() )
4382 const wxString labelA = aLabelA.IsEmpty() ? aFileA : aLabelA;
4383 const wxString labelB = aLabelB.IsEmpty() ? aFileB : aLabelB;
4386 parent, labelA, labelB,
result, std::move( refGeometry ), std::move( compGeometry ),
4389 KICAD_DIFF::ConfigurePcbDiffCanvasContext( aCanvas, boardA, boardB, color );
4397 std::vector<std::unique_ptr<FOOTPRINT>> ownersA;
4398 std::vector<std::unique_ptr<FOOTPRINT>> ownersB;
4424 std::unique_ptr<FOOTPRINT> footprintA;
4425 std::unique_ptr<FOOTPRINT> footprintB;
4429 footprintA = loadFootprintFile( aFileA );
4433 m_reporter->Report( wxString::Format(
_(
"Failed to load %s: %s\n" ), aFileA, ioe.
What() ),
4440 footprintB = loadFootprintFile( aFileB );
4444 m_reporter->Report( wxString::Format(
_(
"Failed to load %s: %s\n" ), aFileB, ioe.
What() ),
4451 const wxString nameA = wxFileName( aFileA ).GetName();
4452 const wxString nameB = wxFileName( aFileB ).GetName();
4453 const wxString itemName = !nameB.IsEmpty() ? nameB : nameA;
4456 mapA[itemName] = footprintA.get();
4459 mapB[itemName] = footprintB.get();
4479 const wxString labelA = aLabelA.IsEmpty() ? aFileA : aLabelA;
4480 const wxString labelB = aLabelB.IsEmpty() ? aFileB : aLabelB;
4497 const wxString& aTheirs,
const wxString& aOutput,
4500 if( aOutput.IsEmpty() )
4508 std::vector<std::unique_ptr<FOOTPRINT>> owners;
4512 LIB_SIDE ancestor, ours, theirs;
4519 auto isSingleFile = [&](
const wxString& aPath )
4527 auto loadSide = [&](
const wxString& aPath, LIB_SIDE& aSide ) ->
int
4531 if( isSingleFile( aPath ) )
4543 const UTF8& itemName = fp->GetFPID().GetLibItemName();
4546 aSide.map[key] = fp.get();
4547 aSide.owners.push_back( std::move( fp ) );
4552 aSide.owners = std::move( loaded.first );
4553 aSide.map = std::move( loaded.second );
4558 m_reporter->Report( wxString::Format(
_(
"Failed to load %s: %s\n" ), aPath, ioe.
What() ),
4561 catch(
const std::exception& e )
4564 wxString::Format(
_(
"Failed to load %s: %s\n" ), aPath, wxString::FromUTF8( e.what() ) ),
4592 std::vector<std::unique_ptr<FOOTPRINT>> merged = applier.
Apply();
4597 const bool hadSilentFallback = applier.
GetReport().mergePropsFallback > 0;
4599 const bool singleFileOutput = isSingleFile( aOutput );
4608 if( singleFileOutput )
4609 outFn = wxFileName( aOutput );
4611 outFn = wxFileName::DirName( aOutput );
4613 outFn.MakeAbsolute();
4619 const wxString outDir = outFn.GetPath();
4621 if( !wxFileName::DirExists( outDir ) && !wxFileName::Mkdir( outDir, wxS_DIR_DEFAULT, wxPATH_MKDIR_FULL ) )
4623 m_reporter->Report( wxString::Format(
_(
"Cannot create output directory %s\n" ), outDir ),
4632 if( singleFileOutput )
4638 if( merged.size() > 1 )
4640 m_reporter->Report(
_(
"Single-file fp merge produced multiple footprints; refusing to "
4641 "collapse into one .kicad_mod\n" ),
4646 if( merged.empty() )
4651 if( wxFileName::FileExists( outFn.GetFullPath() ) )
4652 wxRemoveFile( outFn.GetFullPath() );
4658 io.
FootprintSave( outFn.GetFullPath(), merged.front().get(),
nullptr );
4669 io.
Format( merged.front().get() );
4681 std::set<wxString> mergedNames;
4683 for(
const auto& fp : merged )
4686 mergedNames.insert( fp->GetFPID().GetLibItemName() );
4689 wxArrayString existing;
4692 for(
const wxString&
name : existing )
4694 if( !mergedNames.count(
name ) )
4698 for(
const auto& fp : merged )
4703 const wxString
name = fp->GetFPID().GetLibItemName();
4714 m_reporter->Report( wxString::Format(
_(
"Failed to save merged footprint library: %s\n" ), ioe.
What() ),
4720 if( !planSnapshot.
Resolved() || hadSilentFallback )
4724 std::set<KIID_PATH> conflicts( planSnapshot.
unresolved.begin(), planSnapshot.
unresolved.end() );
4727 conflicts.insert(
id );
4729 m_reporter->Report( wxString::Format(
_(
"Footprint library merge completed with %zu unresolved "
4730 "conflict(s) in %s\n" ),
4731 conflicts.size(), aOutput ),
constexpr EDA_IU_SCALE pcbIUScale
KIFACE_BASE & Kiface()
Global KIFACE_BASE "get" accessor.
#define RANGE_SCALE_3D
This defines the range that all coord will have to be rendered.
wxString BuildStackupCsv(BOARD_STACKUP &aStackup, EDA_UNITS aUnits, const STACKUP_CSV_OPTIONS &aOptions)
wxString FormatBoardStatisticsJson(const BOARD_STATISTICS_DATA &aData, BOARD *aBoard, const UNITS_PROVIDER &aUnitsProvider, const wxString &aProjectName, const wxString &aBoardName)
void ComputeBoardStatistics(BOARD *aBoard, const BOARD_STATISTICS_OPTIONS &aOptions, BOARD_STATISTICS_DATA &aData)
wxString FormatBoardStatisticsReport(const BOARD_STATISTICS_DATA &aData, BOARD *aBoard, const UNITS_PROVIDER &aUnitsProvider, const wxString &aProjectName, const wxString &aBoardName)
void InitializeBoardStatisticsData(BOARD_STATISTICS_DATA &aData)
static wxString m_DrawingSheetFileName
the name of the drawing sheet file, or empty to use the default drawing sheet
BASE_SET & set(size_t pos)
Helper class to handle information needed to display 3D board.
double BiuTo3dUnits() const noexcept
Board integer units To 3D units.
void SetVisibleLayers(const std::bitset< LAYER_3D_END > &aLayers)
std::bitset< LAYER_3D_END > GetVisibleLayers() const
void SetBoard(BOARD *aBoard) noexcept
Set current board to be rendered.
void SetLayerColors(const std::map< int, COLOR4D > &aColors)
EDA_3D_VIEWER_SETTINGS * m_Cfg
std::map< int, COLOR4D > m_ColorOverrides
allows to override color scheme colors
void Set3dCacheManager(S3D_CACHE *aCacheMgr) noexcept
Update the cache manager pointer.
virtual void Push(const wxString &aMessage=wxEmptyString, int aCommitFlags=0) override
Execute the changes.
Container for design settings for a BOARD object.
std::shared_ptr< NET_SETTINGS > m_NetSettings
std::map< int, SEVERITY > m_DRCSeverities
std::shared_ptr< DRC_ENGINE > m_DRCEngine
const VECTOR2I & GetAuxOrigin() const
BOARD_STACKUP & GetStackupDescriptor()
static bool SaveBoard(wxString &aFileName, BOARD &aBoard, PCB_IO_MGR::PCB_FILE_T aFormat)
static std::unique_ptr< BOARD > Load(const wxString &aFileName, PCB_IO_MGR::PCB_FILE_T aFormat, PROJECT *aProject, const OPTIONS &aOptions)
Manage one layer needed to make a physical board.
Manage layers needed to make a physical board.
const std::vector< BOARD_STACKUP_ITEM * > & GetList() const
bool SynchronizeWithBoard(BOARD_DESIGN_SETTINGS *aSettings)
Synchronize the BOARD_STACKUP_ITEM* list with the board.
Information pertinent to a Pcbnew printed circuit board.
void SetCurrentVariant(const wxString &aVariant)
const PAGE_INFO & GetPageSettings() const
void RecordDRCExclusions()
Scan existing markers and record data from any that are Excluded.
uint64_t GetDrillModelGeneration() const
TITLE_BLOCK & GetTitleBlock()
const std::map< wxString, wxString > & GetProperties() const
const FOOTPRINTS & Footprints() const
const wxString & GetFileName() const
std::vector< PCB_MARKER * > ResolveDRCExclusions(bool aCreateMarkers)
Rebuild DRC markers from the serialized data in BOARD_DESIGN_SETTINGS.
wxString GetVariantDescription(const wxString &aVariantName) const
int GetFileFormatVersionAtLoad() const
const PCB_PLOT_PARAMS & GetPlotOptions() const
const wxString GetLayerName(PCB_LAYER_ID aLayer) const
Return the name of a aLayer.
wxString GetCurrentVariant() const
PROJECT * GetProject() const
wxString GetDesignRulesPath() const
Return the absolute path to the design rules file for this board.
BOARD_DESIGN_SETTINGS & GetDesignSettings() const
const LSET & GetEnabledLayers() const
A proxy function that calls the corresponding function in m_BoardSettings.
void SynchronizeProperties()
Copy the current project's text variables into the boards property cache.
BOX2I ComputeBoundingBox(bool aBoardEdgesOnly=false, bool aPhysicalLayersOnly=false) const
Calculate the bounding box containing all board items (or board edge segments).
void DeleteMARKERs()
Delete all MARKERS from the board.
constexpr const Vec GetCenter() const
void SetProjection(PROJECTION_TYPE aProjection)
void RotateY_T1(float aAngleInRadians)
bool Zoom_T1(float aFactor)
bool SetCurWindowSize(const wxSize &aSize)
Update the windows size of the camera.
bool ViewCommand_T1(VIEW3D_TYPE aRequestedView)
void RotateX_T1(float aAngleInRadians)
void SetLookAtPos_T1(const SFVEC3F &aLookAtPos)
const SFVEC3F & GetLookAtPos_T1() const
void RotateZ_T1(float aAngleInRadians)
Reporter forwarding messages to stdout or stderr as appropriate.
COMMIT & Add(EDA_ITEM *aItem, BASE_SCREEN *aScreen=nullptr)
Add a new item to the model.
static bool GenerateFile(JOB_EXPORT_PCB_IPC2581 &aJob, BOARD *aBoard, PROGRESS_REPORTER *aProgressReporter, REPORTER *aReporter)
static void GenerateODBPPFiles(const JOB_EXPORT_PCB_ODB &aJob, BOARD *aBoard, PCB_EDIT_FRAME *aParentFrame=nullptr, PROGRESS_REPORTER *aProgressReporter=nullptr, REPORTER *aErrorReporter=nullptr)
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.
A dialog to set the plot options and create plot files in various formats.
bool WriteJsonReport(const wxString &aFullFileName)
bool WriteTextReport(const wxString &aFullFileName)
Helper to handle drill precision format in excellon files.
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 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 SetSheetName(const std::string &aSheetName)
Set the sheet name displayed in the title block.
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.
LAYER_PRESET_3D * FindPreset(const wxString &aName)
std::vector< LAYER_PRESET_3D > m_LayerPresets
Create Excellon drill, drill map, and drill report files.
void SetFormat(bool aMetric, ZEROS_FMT aZerosFmt=DECIMAL_FORMAT, int aLeftDigits=0, int aRightDigits=0)
Initialize internal parameters to match the given format.
bool CreateDrillandMapFilesSet(const wxString &aPlotDirectory, bool aGenDrill, bool aGenMap, REPORTER *aReporter=nullptr)
Create the full set of Excellon drill file for the board.
void SetOptions(bool aMirror, bool aMinimalHeader, const VECTOR2I &aOffset, bool aMerge_PTH_NPTH)
Initialize internal parameters to match drill options.
void SetRouteModeForOvalHoles(bool aUseRouteModeForOvalHoles)
bool m_IncludeUnspecified
Wrapper to expose an API for writing VRML files, without exposing all the many structures used in the...
bool ExportVRML_File(PROJECT *aProject, wxString *aMessages, const wxString &aFullFileName, double aMMtoWRMLunit, bool aIncludeUnspecified, bool aIncludeDNP, bool aExport3DFiles, bool aUseRelativePaths, const wxString &a3D_Subdir, double aXRef, double aYRef)
Exports the board and its footprint shapes 3D (vrml files only) as a vrml file.
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
Provide an extensible class to resolve 3D model paths.
void SetPath(const wxString &aPath)
void Save(FOOTPRINT *aFootprintFilter=nullptr)
Save the footprint cache or a single footprint from it to disk.
boost::ptr_map< wxString, FP_CACHE_ENTRY > & GetFootprints()
Export board to GenCAD file format.
void UseIndividualShapes(bool aUnique)
Make pad shapes unique.
void UsePinNamesUnique(bool aUnique)
Make pin names unique.
void StoreOriginCoordsInFile(bool aStore)
Store origin coordinate in GenCAD file.
void FlipBottomPads(bool aFlip)
Flip pad shapes on the bottom side.
void SetPlotOffet(VECTOR2I aOffset)
Set the coordinates offset when exporting items.
bool WriteFile(const wxString &aFullFileName)
Export a GenCAD file.
void SetMapFileFormat(PLOT_FORMAT aMapFmt)
Initialize the format for the drill map file.
bool GenDrillReportFile(const wxString &aFullFileName, REPORTER *aReporter=nullptr)
Create a plain text report file giving a list of drill values and drill count for through holes,...
GERBER_JOBFILE_WRITER is a class used to create Gerber job file a Gerber job file stores info to make...
bool CreateJobFile(const wxString &aFullFilename)
Creates a Gerber job file.
void AddGbrFile(PCB_LAYER_ID aLayer, wxString &aFilename)
add a gerber file name and type in job file list
virtual bool EndPlot() override
Used to create Gerber drill files.
bool CreateDrillandMapFilesSet(const wxString &aPlotDirectory, bool aGenDrill, bool aGenMap, bool aGenTenting, REPORTER *aReporter=nullptr)
Create the full set of Excellon drill file for the board filenames are computed from the board name,...
void SetOptions(const VECTOR2I &aOffset)
Initialize internal parameters to match drill options.
void SetFormat(int aRightDigits=6)
Initialize internal parameters to match the given format.
An exception saying that the user cancelled an interactive part of a load, import,...
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()
Wrapper to expose an API for writing IPC-D356 files.
bool Write(const wxString &aFilename)
Generates and writes the netlist to a given path.
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
JOB_EXPORT_PCB_3D::FORMAT m_format
EXPORTER_STEP_PARAMS m_3dparams
Despite the name; also used for other formats.
ZEROS_FORMAT m_zeroFormat
bool m_excellonOvalDrillRoute
DRILL_ORIGIN m_drillOrigin
bool m_excellonCombinePTHNPTH
bool m_excellonMinimalHeader
wxString GetSettingsDialogTitle() const override
bool m_useIndividualShapes
bool m_useBoardPlotParams
ODB_COMPRESSION m_compressionMode
bool m_checkZonesBeforeExport
@ ALL_LAYERS_ONE_FILE
DEPRECATED MODE.
bool m_pdfSingle
This is a hack to deal with cli having the wrong behavior We will deprecate out the wrong behavior,...
GEN_MODE m_pdfGenMode
The background color specified in a hex string.
LSEQ m_plotOnAllLayersSequence
Used by SVG & PDF.
bool m_checkZonesBeforePlot
std::optional< wxString > m_argLayers
std::optional< wxString > m_argCommonLayers
LSEQ m_plotLayerSequence
Layers to include on all individual layer prints.
wxString m_variant
Variant name for variant-aware filtering.
bool m_useDrillPlaceFileOrigin
bool m_excludeFootprintsWithTh
bool m_includeBoardOptions
bool m_includeLossTangent
void SetDefaultOutputPath(const wxString &aReferenceName)
bool m_subtractHolesFromBoardArea
void SetDefaultOutputPath(const wxString &aReferenceName)
bool m_excludeFootprintsWithoutPads
bool m_subtractHolesFromCopperAreas
wxString m_outputLibraryPath
Job: diff two PCB files end-to-end via PCB_DIFFER.
bool m_reportAllTrackErrors
Job to import a non-KiCad PCB file to KiCad format.
std::map< wxString, wxString > m_layerMap
Explicit overrides from source layer name to KiCad layer name (canonical board-file name,...
std::map< wxString, wxString > m_netNameMap
IMPORT_REPORT_FORMAT m_reportFormat
VECTOR3D m_lightBottomIntensity
VECTOR3D m_lightTopIntensity
VECTOR3D m_lightCameraIntensity
bool m_proceduralTextures
bool m_useBoardStackupColors
VECTOR3D m_lightSideIntensity
std::string m_appearancePreset
bool m_exitCodeViolations
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.
wxString ResolveOutputPath(const wxString &aPath, bool aPathIsDirectory, PROJECT *aProject) const
void AddOutput(wxString aOutputPath)
wxString GetFullOutputPath(PROJECT *aProject) const
Returns the full output path for the job, taking into account the configured output path,...
wxString GetWorkingOutputPath() const
Returns the working output path for the job, if one has been set.
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...
Diff two .pretty footprint library directories.
static std::pair< std::vector< std::unique_ptr< FOOTPRINT > >, FOOTPRINT_MAP > LoadLibrary(const wxString &aPrettyPath)
Load a .pretty directory into a FOOTPRINT_MAP.
DOCUMENT_DIFF Diff() override
Produce a DOCUMENT_DIFF of the inputs the concrete differ was constructed with.
std::map< wxString, const FOOTPRINT * > FOOTPRINT_MAP
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 BOARDs 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 real merged BOARD.
std::unique_ptr< BOARD > Apply()
Produce the merged board.
const REPORT & GetReport() const
Read the new s-expression based KiCad netlist format.
virtual void LoadNetlist() override
Load the contents of the netlist file into aNetlist.
A color representation with 4 components: red, green, blue, alpha.
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.
Plugin class for import plugins that support remappable layers.
void AsyncLoad()
Loads all available libraries for this adapter type in the background.
const UTF8 & GetLibItemName() const
LSEQ is a sequence (and therefore also a set) of PCB_LAYER_IDs.
LSET is a set of PCB_LAYER_IDs.
static const LSET & AllCuMask()
return AllCuMask( MAX_CU_LAYERS );
LSEQ UIOrder() const
Return the copper, technical and user layers in the order shown in layer widget.
LSEQ SeqStackupForPlotting() const
Return the sequence that is typical for a bottom-to-top stack-up.
static LSET AllNonCuMask()
Return a mask holding all layer minus CU layers.
static LSET AllCuMask(int aCuLayerCount)
Return a mask holding the requested number of Cu PCB_LAYER_IDs.
static const LSET & AllLayersMask()
static const LSET & InternalCuMask()
Return a complete set of internal copper layers which is all Cu layers except F_Cu and B_Cu.
static wxString Name(PCB_LAYER_ID aLayerId)
Return the fixed name association with aLayerId.
bool SaveToFile(const wxString &aDirectory="", bool aForce=false) override
Calls Store() and then saves the JSON document contents into the parent JSON_SETTINGS.
void CopyFrom(NET_SETTINGS &aOther)
Deep-copy the persisted contents of aOther into this instance.
static bool EnsurePathExists(const wxString &aPath, bool aPathToFile=false)
Attempts to create a given path if it does not exist.
int JobExportStep(JOB *aJob)
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 JobExportPs(JOB *aJob)
int JobExportPos(JOB *aJob)
int JobExportFpSvg(JOB *aJob)
int JobExportStackup(JOB *aJob)
int JobExportOdb(JOB *aJob)
int JobExportDrc(JOB *aJob)
int JobUpgrade(JOB *aJob)
int JobExportFpUpgrade(JOB *aJob)
int JobExportGerber(JOB *aJob)
DS_PROXY_VIEW_ITEM * getDrawingSheetProxyView(BOARD *aBrd)
wxString resolveJobOutputPath(JOB *aJob, BOARD *aBoard, const wxString *aDrawingSheet=nullptr)
int JobExportPng(JOB *aJob)
int JobExportDxf(JOB *aJob)
int JobExportPdf(JOB *aJob)
int runPcbMerge(const wxString &aAncestor, const wxString &aOurs, const wxString &aTheirs, const wxString &aOutput, bool aInteractive)
int JobExportDrill(JOB *aJob)
int JobExportSvg(JOB *aJob)
void loadOverrideDrawingSheet(BOARD *brd, const wxString &aSheetPath)
PCBNEW_JOBS_HANDLER(KIWAY *aKiway)
TOOL_MANAGER * getToolManager(BOARD *aBrd)
int JobExportGerbers(JOB *aJob)
int JobExportBom(JOB *aJob)
std::unique_ptr< BOARD > m_cliBoard
int JobExportGencad(JOB *aJob)
BOARD * getBoard(const wxString &aPath=wxEmptyString)
int JobExportIpc2581(JOB *aJob)
virtual ~PCBNEW_JOBS_HANDLER()
int runFpLibMerge(const wxString &aAncestor, const wxString &aOurs, const wxString &aTheirs, const wxString &aOutput, bool aSingleFile)
std::unique_ptr< TOOL_MANAGER > m_toolManager
int OpenDiffDialog(KICAD_DIFF::DOC_KIND aKind, const wxString &aFileA, const wxString &aFileB, const wxString &aLabelA, const wxString &aLabelB, wxWindow *aParent, REPORTER *aReporter)
LSEQ convertLayerArg(wxString &aLayerString, BOARD *aBoard) const
void ClearCachedBoard()
Clear the cached CLI board so the next job reloads from the current project.
int JobExportRender(JOB *aJob)
int JobExportIpcD356(JOB *aJob)
int doFpExportSvg(JOB_FP_EXPORT_SVG *aSvgJob, const FOOTPRINT *aFootprint)
int JobExportStats(JOB *aJob)
The main frame for Pcbnew.
A #PLUGIN derivation for saving and loading Pcbnew s-expression formatted files.
void FootprintDelete(const wxString &aLibraryPath, const wxString &aFootprintName, const std::map< std::string, UTF8 > *aProperties=nullptr) override
Delete aFootprintName from the library at aLibraryPath.
void FootprintEnumerate(wxArrayString &aFootprintNames, const wxString &aLibraryPath, bool aBestEfforts, const std::map< std::string, UTF8 > *aProperties=nullptr) override
Return a list of footprint names contained within the library at aLibraryPath.
std::unique_ptr< FOOTPRINT > ImportFootprint(const wxString &aFootprintPath, wxString &aFootprintNameOut, const std::map< std::string, UTF8 > *aProperties=nullptr) override
Load a single footprint from aFootprintPath and put its name in aFootprintNameOut.
bool FootprintExists(const wxString &aLibraryPath, const wxString &aFootprintName, const std::map< std::string, UTF8 > *aProperties=nullptr) override
Check for the existence of a footprint.
void FootprintSave(const wxString &aLibraryPath, const FOOTPRINT *aFootprint, const std::map< std::string, UTF8 > *aProperties=nullptr) override
Write aFootprint to an existing library located at aLibraryPath.
void SaveBoard(const wxString &aFileName, BOARD &aBoard, const std::map< std::string, UTF8 > *aProperties=nullptr) override
Write aBoard to a storage file in a format that this PCB_IO implementation knows about or it can be u...
void Format(const BOARD_ITEM *aItem) const
Output aItem to aFormatter in s-expression format.
void SetOutputFormatter(OUTPUTFORMATTER *aFormatter)
static bool ConvertLibrary(const std::map< std::string, UTF8 > &aOldFileProps, const wxString &aOldFilePath, const wxString &aNewFilePath, REPORTER *aReporter)
Convert a schematic symbol library to the latest KiCad format.
static bool ImportPopulatesProjectSettings(PCB_FILE_T aFileType)
Return true when importing aFileType writes netclasses, rules or other settings that belong to the pr...
PCB_FILE_T
The set of file types that the PCB_IO_MGR knows about, and for which there has been a plugin written,...
@ KICAD_SEXP
S-expression Pcbnew file format.
@ PCB_FILE_UNKNOWN
0 is not a legal menu id on Mac
static PCB_IO * FindPlugin(PCB_FILE_T aFileType)
Return a #PLUGIN which the caller can use to import, export, save, or load design documents.
static PCB_FILE_T FindPluginTypeFromBoardPath(const wxString &aFileName, int aCtl=0)
Return a plugin type given a path for a board file.
static PCB_FILE_T GuessPluginTypeFromLibPath(const wxString &aLibPath, int aCtl=0)
Return a plugin type given a footprint library's libPath.
static bool ImportGeneratesProjectLibrary(PCB_FILE_T aFileType)
Return true when importing aFileType should materialize a project footprint library.
static const wxString ShowType(PCB_FILE_T aFileType)
Return a brief name for a plugin given aFileType enum.
static void PlotJobToPlotOpts(PCB_PLOT_PARAMS &aOpts, JOB_EXPORT_PCB_PLOT *aJob, REPORTER &aReporter)
True when the board's out-of-date-chart policy regenerated charts during the last Plot().
bool Plot(const wxString &aOutputPath, const LSEQ &aLayersToPlot, const LSEQ &aCommonLayers, bool aUseGerberFileExtensions, bool aOutputPathIsSingle=false, std::optional< wxString > aLayerName=std::nullopt, std::optional< wxString > aSheetName=std::nullopt, std::optional< wxString > aSheetPath=std::nullopt, std::vector< wxString > *aOutputFiles=nullptr)
static void BuildPlotFileName(wxFileName *aFilename, const wxString &aOutputDir, const wxString &aSuffix, const wxString &aExtension)
Complete a plot filename.
Parameters and options when plotting/printing a board.
LSEQ GetPlotOnAllLayersSequence() const
void SetLayerSelection(const LSET &aSelection)
void SetPlotOnAllLayersSequence(LSEQ aSeq)
void SetPlotPadNumbers(bool aFlag)
LSET GetLayerSelection() const
bool GetSketchPadsOnFabLayers() const
bool GetUseGerberProtelExtensions() const
virtual SETTINGS_MANAGER & GetSettingsManager() const
Used to create Gerber drill files.
const wxString GetPlaceFileName(const wxString &aFullBaseFilename, PCB_LAYER_ID aLayer) const
void SetVariant(const wxString &aVariant)
Set the variant name for variant-aware filtering.
int CreatePlaceFile(const wxString &aFullFilename, PCB_LAYER_ID aLayer, bool aIncludeBrdEdges, bool aExcludeDNP, bool aExcludeBOM)
Create an pnp gerber file.
The ASCII format of the kicad place file is:
static wxString DecorateFilename(const wxString &aBaseName, bool aFront, bool aBack)
std::string GenPositionData()
build a string filled with the position data
void SetVariant(const wxString &aVariant)
Set the variant name for variant-aware export.
Base plotter engine class.
The backing store for a PROJECT, in JSON format.
wxString m_BoardDrawingSheetFile
PcbNew params.
static S3D_CACHE * Get3DCacheManager(PROJECT *aProject, bool updateProjDir=false)
Return a pointer to an instance of the 3D cache manager.
static FOOTPRINT_LIBRARY_ADAPTER * FootprintLibAdapter(PROJECT *aProject)
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.
virtual const wxString GetProjectName() const
Return the short name of the project.
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
void SetReporters(std::shared_ptr< REPORTER > aActivityReporter, std::shared_ptr< REPORTER > aWarningReporter)
Set the reporters for activity and warning messages.
wxSize GetRealBufferSize()
bool Redraw(bool aIsMoving) override
Redraw the view.
void SetCurWindowSize(const wxSize &aSize) override
Before each render, the canvas will tell the render what is the size of its windows,...
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.
RAII class that sets an value at construction and resets it to the original value at destruction.
bool SaveProjectCopy(const wxString &aFullPath, PROJECT *aProject=nullptr)
Save a copy of the current project under the given path.
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.
Is a LINE_READER that reads from a multiline 8 bit wide std::string.
void Pan_T1(const SFVEC3F &aDeltaOffsetInc) override
void SetT0_and_T1_current_T() override
This will set T0 and T1 with the current values.
void Interpolate(float t) override
It will update the matrix to interpolate between T0 and T1 values.
An 8 bit string that is assuredly encoded in UTF8, and supplies special conversion support to and fro...
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.
static DRILL_PRECISION precisionListForInches(2, 4)
static DRILL_PRECISION precisionListForMetric(3, 3)
#define FOLLOW_PLOT_SETTINGS
static FILENAME_RESOLVER * resolver
Classes used in drill files, map files and report files generation.
Classes used in drill files, map files and report files generation.
Classes used to generate a Gerber job file in JSON.
Classes used in place file generation.
static const std::string LegacySchematicFileExtension
static const std::string BrepFileExtension
static const std::string SymbolLibraryTableFileName
static const std::string JpegFileExtension
static const std::string GerberJobFileExtension
static const std::string GerberFileExtension
static const std::string XaoFileExtension
static const std::string ReportFileExtension
static const std::string GltfBinaryFileExtension
static const std::string ProjectFileExtension
static const std::string PngFileExtension
static const std::string FootprintPlaceFileExtension
static const std::string JsonFileExtension
static const std::string KiCadSchematicFileExtension
static const std::string CsvFileExtension
static const std::string U3DFileExtension
static const std::string PdfFileExtension
static const std::string Ipc2581FileExtension
static const std::string FootprintLibraryTableFileName
static const std::string GencadFileExtension
static const std::string StlFileExtension
static const std::string IpcD356FileExtension
static const std::string PlyFileExtension
static const std::string StepFileExtension
static const std::string SVGFileExtension
static const std::string DesignRulesFileExtension
static const std::string VrmlFileExtension
static const std::string KiCadFootprintFileExtension
static const std::string ArchiveFileExtension
static const std::string KiCadPcbFileExtension
bool ApplyImportedNetNameMap(BOARD &aBoard, const std::map< wxString, wxString > &aNames, REPORTER &aReporter)
Apply caller-selected imported net names without changing net identity or connectivity.
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...
@ KIFACE_NETLIST_SCHEMATIC
#define KICTL_KICAD_ONLY
chosen file is from KiCad according to user
wxString LayerName(int aLayer)
Returns the default display name for a given layer.
@ LAYER_3D_BACKGROUND_TOP
@ LAYER_3D_BACKGROUND_BOTTOM
PCB_LAYER_ID
A quick note on layer IDs:
This file contains miscellaneous commonly used macros and functions.
#define MAIL_SCH_GET_NETLIST_CANCELLED
Reply payload for MAIL_SCH_GET_NETLIST when the user deliberately aborts netlist generation (for exam...
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
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,...
const wxString DOC_PROP_NET_CLASSES
LIB_MERGE_APPLIER< FOOTPRINT > FP_LIB_MERGE_APPLIER
Footprint-library 3-way merge applier. See LIB_MERGE_APPLIER for behavior.
void AppendGeometry(DOCUMENT_GEOMETRY &aDst, DOCUMENT_GEOMETRY &&aSrc)
Move all primitives from aSrc into aDst.
DOCUMENT_GEOMETRY ExtractFootprintGeometry(const FOOTPRINT &aFootprint, const KIGFX::COLOR4D &aColor)
Extract drawable context geometry from a single FOOTPRINT.
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.
const wxString DOC_PROP_DRC_SEVERITIES
DOCUMENT_GEOMETRY ExtractBoardGeometry(const BOARD &aBoard, const KIGFX::COLOR4D &aColor)
Extract a coarse outline of a BOARD into a DOCUMENT_GEOMETRY for use as background context in DIFF_SC...
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.
void PackBoardStackup(const BOARD &aBoard, BoardStackup &aOut)
void RefreshDrillCharts(BOARD &aBoard)
Bring every chart on the board up to date.
#define SEXPR_BOARD_FILE_VERSION
Current s-expression file format version. 2 was the last legacy format version.
#define CTL_FOR_LIBRARY
Format output for a footprint library instead of clipboard or BOARD.
bool PlotFootprintToSVG(const FOOTPRINT &aFootprint, PROJECT &aProject, const std::map< wxString, wxString > *aVarOverrides, PCB_PLOT_PARAMS &aPlotOpts, const LSEQ &aLayersToPlot, const LSEQ &aLayersOnAll, const wxString &aFileName, REPORTER *aReporter)
Plot a footprint to an SVG file, with the footprint origin at the SVG origin and the page/viewBox siz...
static PCB_LAYER_ID resolveKiCadLayerName(const wxString &aName)
static int loadFootprintLibrarySide(const wxString &aPath, std::vector< std::unique_ptr< FOOTPRINT > > &aOwners, KICAD_DIFF::FP_LIB_DIFFER::FOOTPRINT_MAP &aMap, bool aAllowEmpty, REPORTER &aReporter)
static DRILL_PRECISION precisionListForInches(2, 4)
static DRILL_PRECISION precisionListForMetric(3, 3)
static SCRATCH_DOC< BOARD > loadScratchBoard(SETTINGS_MANAGER &aMgr, const wxString &aPath, bool aInitializeAfterLoad=true)
static KICAD_DIFF::DOCUMENT_GEOMETRY footprintLibraryGeometry(const KICAD_DIFF::FP_LIB_DIFFER::FOOTPRINT_MAP &aMap, const KIGFX::COLOR4D &aColor)
const wxString GetGerberProtelExtension(int aLayer)
PLOTTER * StartPlotBoard(BOARD *aBoard, const PCB_PLOT_PARAMS *aPlotOpts, int aLayer, const wxString &aLayerName, const wxString &aFullFileName, const wxString &aSheetName, const wxString &aSheetPath, const wxString &aPageName=wxT("1"), const wxString &aPageNumber=wxEmptyString, const int aPageCount=1)
Open a new plotfile using the options (and especially the format) specified in the options and prepar...
void PlotBoardLayers(BOARD *aBoard, PLOTTER *aPlotter, const LSEQ &aLayerSequence, const PCB_PLOT_PARAMS &aPlotOptions)
Plot a sequence of board layer IDs.
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)
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 ...
T * GetAppSettings(const char *aFilename)
MODEL3D_FORMAT_TYPE fileType(const char *aFileName)
#define OPEN_OSTREAM(var, name)
#define CLOSE_STREAM(var)
#define TO_UTF8(wxstring)
Convert a wxString to a UTF8 encoded C string for all wxWidgets build modes.
bool initialize_after_load
bool subtractHolesFromCopperAreas
bool subtractHolesFromBoardArea
bool excludeFootprintsWithoutPads
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< int > raytrace_lightElevation
bool show_footprints_normal
KIGFX::COLOR4D raytrace_lightColorCamera
bool raytrace_post_processing
std::vector< KIGFX::COLOR4D > raytrace_lightColor
KIGFX::COLOR4D raytrace_lightColorBottom
bool raytrace_reflections
bool show_footprints_virtual
bool differentiate_plated_copper
std::vector< int > raytrace_lightAzimuth
bool raytrace_refractions
bool show_footprints_not_in_posfile
bool raytrace_procedural_textures
bool show_footprints_insert
int raytrace_recursivelevel_refractions
KIGFX::COLOR4D raytrace_lightColorTop
bool raytrace_anti_aliasing
std::vector< BOM_PRESET > m_BomPresets
std::vector< BOM_FMT_PRESET > m_BomFmtPresets
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
Report on the application after Apply() runs.
wxString fpLibTable
fp-lib-table content the applier resolved.
VALIDATION_REPORT validation
Post-apply validator pipeline result (refdes uniqueness, connectivity-rebuild-ack,...
bool drcSeveritiesTouched
bool projectFileTouched
True iff the applier resolved state that lives in the .kicad_pro or a project sibling file.
wxString customDrcRules
Custom DRC rules (.kicad_dru) content the applier resolved.
wxString symLibTable
sym-lib-table content the applier resolved.
wxString drawingSheetFile
Drawing sheet path the applier resolved (from a doc-level resolution).
Outcome of a single validator run.
std::vector< VALIDATION_FAILURE > failures
Implement a participant in the KIWAY alchemy.
A filename or source description, a problem input line, a line number, a byte offset,...
Move-only RAII wrapper for "load a KiCad document into a non-active scratch PROJECT and clean up afte...
std::unique_ptr< DOC > doc
Options controlling which stackup fields are included in CSV exports.
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...
static void checkParity(CREEPAGE_PARITY_FIXTURE &aFixture, const std::string &aBoard)
IbisParser parser & reporter
wxString result
Test unit parsing edge cases and error handling.
wxLogTrace helper definitions.
Declaration for a track ball camera.
double DEG2RAD(double deg)
@ PCB_VIA_T
class PCB_VIA, a via (like a track segment on a copper layer)
VECTOR2< int32_t > VECTOR2I
Definition of file extensions used in Kicad.