KiCad PCB EDA Suite
Loading...
Searching...
No Matches
pcb_io_altium_designer.cpp
Go to the documentation of this file.
1/*
2 * This program source code file is part of KiCad, a free EDA CAD application.
3 *
4 * Copyright (C) 2019 Thomas Pointhuber <[email protected]>
5 * Copyright The KiCad Developers, see AUTHORS.txt for contributors.
6 *
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * as published by the Free Software Foundation; either version 2
10 * of the License, or (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program. If not, see <https://www.gnu.org/licenses/>.
19 */
20
24
25#include <set>
26
27#include <wx/string.h>
28
29#include <font/fontconfig.h>
30#include <project.h>
32#include <altium_pcb.h>
34#include <io/io_utils.h>
37#include <pcb_io/pcb_io.h>
38#include <reporter.h>
39
40#include <board.h>
41#include <footprint.h>
42
43#include <compoundfilereader.h>
44#include <utf.h>
45
46
48 const std::vector<ALTIUM_PROJECT_VARIANT>& aVariants )
49{
50 std::map<wxString, FOOTPRINT*> fpByRef;
51 std::map<KIID, std::vector<FOOTPRINT*>> fpByUid;
52
53 for( FOOTPRINT* fp : aBoard->Footprints() )
54 {
55 fpByRef[fp->GetReference()] = fp;
56
57 // The importer stores the component unique id as the last path element. Repeated
58 // channels share one id across footprints, so collect all of them to detect ambiguity.
59 const KIID_PATH& path = fp->GetPath();
60
61 if( path.size() >= 2 )
62 fpByUid[path.back()].push_back( fp );
63 }
64
65 for( const ALTIUM_PROJECT_VARIANT& pv : aVariants )
66 {
67 aBoard->AddVariant( pv.name );
68
69 if( !pv.description.empty() && pv.description != pv.name )
70 aBoard->SetVariantDescription( pv.name, pv.description );
71
72 for( const ALTIUM_VARIANT_ENTRY& entry : pv.variations )
73 {
74 FOOTPRINT* target = nullptr;
75
76 // Prefer unique-id matching, but only when it resolves to a single footprint. A
77 // shared id (repeated channels) is ambiguous, so fall back to the designator.
78 if( !entry.uniqueId.empty() )
79 {
80 auto it = fpByUid.find( AltiumUniqueIdToKiid( entry.uniqueId ) );
81
82 if( it != fpByUid.end() && it->second.size() == 1 )
83 target = it->second.front();
84 }
85
86 if( !target )
87 {
88 auto it = fpByRef.find( entry.designator );
89
90 if( it != fpByRef.end() )
91 target = it->second;
92 }
93
94 if( !target )
95 continue;
96
97 FOOTPRINT_VARIANT* fpVariant = target->AddVariant( pv.name );
98
99 if( !fpVariant )
100 continue;
101
102 if( entry.kind == 1 )
103 {
104 fpVariant->SetDNP( true );
105 fpVariant->SetExcludedFromBOM( true );
106 fpVariant->SetExcludedFromPosFiles( true );
107 }
108 else if( entry.kind == 0 )
109 {
110 for( const auto& [key, value] : entry.alternateFields )
111 {
112 if( key.CmpNoCase( wxS( "LibReference" ) ) == 0 )
113 fpVariant->SetFieldValue( wxS( "Value" ), value );
114 else if( key.CmpNoCase( wxS( "Description" ) ) == 0 )
115 fpVariant->SetFieldValue( wxS( "Description" ), value );
116 else if( key.CmpNoCase( wxS( "Footprint" ) ) == 0 )
117 fpVariant->SetFieldValue( wxS( "Footprint" ), value );
118 }
119 }
120 }
121 }
122}
123
125 const std::map<wxString, wxString>& aParameters )
126{
127 if( !aProject )
128 return;
129
130 // Names KiCad resolves contextually (board fields, title block, special strings). Importing
131 // them as project variables would shadow nothing useful and could surprise the user, so they
132 // are left to native resolution.
133 static const std::set<wxString> reserved = {
134 wxS( "LAYER" ), wxS( "FILENAME" ), wxS( "FILEPATH" ),
135 wxS( "PROJECTNAME" ), wxS( "VARIANT" ), wxS( "VARIANT_DESC" ),
136 wxS( "ISSUE_DATE" ), wxS( "CURRENT_DATE" ), wxS( "CURRENT_TIME_LOCALE" ),
137 wxS( "CURRENT_TIME_HH_MM_SS" ), wxS( "REVISION" ), wxS( "TITLE" ),
138 wxS( "COMPANY" ), wxS( "COMMENT1" ), wxS( "COMMENT2" ),
139 wxS( "COMMENT3" ), wxS( "COMMENT4" ), wxS( "COMMENT5" ),
140 wxS( "COMMENT6" ), wxS( "COMMENT7" ), wxS( "COMMENT8" ),
141 wxS( "COMMENT9" ), wxS( "VCSHASH" ), wxS( "VCSSHORTHASH" ),
142 wxS( "KICAD_VERSION" ), wxS( "PAPER" ), wxS( "SHEETNAME" ),
143 wxS( "SHEETPATH" ), wxS( "DRC_WARNING" ), wxS( "DRC_ERROR" ),
144 wxS( "ERC_WARNING" ), wxS( "ERC_ERROR" )
145 };
146
147 std::map<wxString, wxString>& textVars = aProject->GetTextVars();
148 bool added = false;
149
150 for( const auto& [name, value] : aParameters )
151 {
152 if( reserved.count( name ) )
153 continue;
154
155 // Don't clobber a variable the user (or a prior import step) already set.
156 if( textVars.count( name ) )
157 continue;
158
159 textVars[name] = value;
160 added = true;
161 }
162
163 if( added )
164 aProject->IncrementTextVarsTicker();
165}
166
167
168void LoadAltiumBoard( const wxString& aFileName, BOARD* aBoard,
169 const std::map<ALTIUM_PCB_DIR, std::string>& aMapping,
170 const std::map<std::string, UTF8>* aProperties, PROJECT* aProject,
171 PROGRESS_REPORTER* aProgressReporter, LAYER_MAPPING_HANDLER& aLayerMappingHandler,
172 REPORTER* aReporter )
173{
174 // The compound-file constructor already translates CFB errors to IO_ERROR.
175 ALTIUM_PCB_COMPOUND_FILE altiumPcbFile( aFileName );
176
177 try
178 {
179 ALTIUM_PCB pcb( aBoard, aProgressReporter, aLayerMappingHandler, aReporter );
180 pcb.Parse( altiumPcbFile, aMapping, aProperties );
181 }
182 catch( CFB::CFBException& exception )
183 {
184 THROW_IO_ERROR( exception.what() );
185 }
186
187 if( aProperties && aProperties->count( "project_file" ) )
188 {
189 const wxString& projectFile = aProperties->at( "project_file" );
190
191 auto variants = ParseAltiumProjectVariants( projectFile );
192
193 if( !variants.empty() )
194 ApplyAltiumProjectVariantsToBoard( aBoard, variants );
195
197 ParseAltiumProjectParameters( projectFile ) );
198 }
199}
200
201
207
208
212
213
215 const std::vector<INPUT_LAYER_DESC>& aInputLayerDescriptionVector )
216{
217 std::map<wxString, PCB_LAYER_ID> retval;
218
219 // Just return a the auto-mapped layers
220 for( INPUT_LAYER_DESC layerDesc : aInputLayerDescriptionVector )
221 {
222 retval.insert( { layerDesc.Name, layerDesc.AutoMapLayer } );
223 }
224
225 return retval;
226}
227
228
229bool PCB_IO_ALTIUM_DESIGNER::checkFileHeader( const wxString& aFileName )
230{
231 // Compound File Binary Format header
233}
234
235
236bool PCB_IO_ALTIUM_DESIGNER::CanReadBoard( const wxString& aFileName ) const
237{
238 if( !PCB_IO::CanReadBoard( aFileName ) )
239 return false;
240
241 return checkFileHeader( aFileName );
242}
243
244
245bool PCB_IO_ALTIUM_DESIGNER::CanReadLibrary( const wxString& aFileName ) const
246{
247 if( !PCB_IO::CanReadLibrary( aFileName ) )
248 return false;
249
250 return checkFileHeader( aFileName );
251}
252
253
254void PCB_IO_ALTIUM_DESIGNER::loadBoard( const wxString& aFileName, BOARD& aBoard, bool aIsNewLoad,
255 const std::map<std::string, UTF8>* aProperties, PROJECT* aProject )
256{
257 m_props = aProperties;
258 m_board = &aBoard;
259
260 // Collect the font substitution warnings (RAII - automatically reset on scope exit)
262
263 // clang-format off
264 const std::map<ALTIUM_PCB_DIR, std::string> mapping = {
265 { ALTIUM_PCB_DIR::FILE_HEADER, "FileHeader" },
266 { ALTIUM_PCB_DIR::ARCS6, "Arcs6" },
267 { ALTIUM_PCB_DIR::BOARD6, "Board6" },
268 { ALTIUM_PCB_DIR::BOARDREGIONS, "BoardRegions" },
269 { ALTIUM_PCB_DIR::CLASSES6, "Classes6" },
270 { ALTIUM_PCB_DIR::COMPONENTS6, "Components6" },
271 { ALTIUM_PCB_DIR::COMPONENTBODIES6, "ComponentBodies6" },
272 { ALTIUM_PCB_DIR::DIMENSIONS6, "Dimensions6" },
273 { ALTIUM_PCB_DIR::EXTENDPRIMITIVEINFORMATION, "ExtendedPrimitiveInformation" },
274 { ALTIUM_PCB_DIR::FILLS6, "Fills6" },
275 { ALTIUM_PCB_DIR::MODELS, "Models" },
276 { ALTIUM_PCB_DIR::NETS6, "Nets6" },
277 { ALTIUM_PCB_DIR::PADS6, "Pads6" },
278 { ALTIUM_PCB_DIR::POLYGONS6, "Polygons6" },
279 { ALTIUM_PCB_DIR::REGIONS6, "Regions6" },
280 { ALTIUM_PCB_DIR::RULES6, "Rules6" },
281 { ALTIUM_PCB_DIR::SHAPEBASEDREGIONS6, "ShapeBasedRegions6" },
282 { ALTIUM_PCB_DIR::SMARTUNIONS, "SmartUnions" },
283 { ALTIUM_PCB_DIR::TEXTS6, "Texts6" },
284 { ALTIUM_PCB_DIR::TRACKS6, "Tracks6" },
285 { ALTIUM_PCB_DIR::UNIONNAMES, "UnionNames" },
286 { ALTIUM_PCB_DIR::VIAS6, "Vias6" },
287 { ALTIUM_PCB_DIR::WIDESTRINGS6, "WideStrings6" }
288 };
289 // clang-format on
290
291 LoadAltiumBoard( aFileName, m_board, mapping, m_props, aProject,
293}
294
295
296long long PCB_IO_ALTIUM_DESIGNER::GetLibraryTimestamp( const wxString& aLibraryPath ) const
297{
298 // File hasn't been loaded yet.
299 if( aLibraryPath.IsEmpty() )
300 return 0;
301
302 wxFileName fn( aLibraryPath );
303
304 if( fn.IsFileReadable() && fn.GetModificationTime().IsValid() )
305 return fn.GetModificationTime().GetValue().GetValue();
306 else
307 return 0;
308}
309
310
311void PCB_IO_ALTIUM_DESIGNER::loadAltiumLibrary( const wxString& aLibraryPath )
312{
313 // Suppress font substitution warnings (RAII - automatically restored on scope exit)
314 FONTCONFIG_REPORTER_SCOPE fontconfigScope( nullptr );
315
316 long long timestamp = GetLibraryTimestamp( aLibraryPath );
317
318 if( m_fplibFiles.contains( aLibraryPath ) && m_fplibFiles[aLibraryPath].m_Timestamp == timestamp )
319 return; // Already loaded
320
321 try
322 {
323 ALTIUM_FILE_CACHE& libFiles = m_fplibFiles[aLibraryPath];
324
325 if( aLibraryPath.Lower().EndsWith( wxS( ".pcblib" ) ) )
326 {
327 libFiles.m_Files.emplace_back( std::make_unique<ALTIUM_PCB_COMPOUND_FILE>( aLibraryPath ) );
328 }
329 else if( aLibraryPath.Lower().EndsWith( wxS( ".intlib" ) ) )
330 {
331 std::unique_ptr<ALTIUM_PCB_COMPOUND_FILE> lib = std::make_unique<ALTIUM_PCB_COMPOUND_FILE>( aLibraryPath );
332
333 for( const auto& [pcbLibName, pcbCfe] : lib->EnumDir( L"PCBLib" ) )
334 {
335 std::unique_ptr<ALTIUM_PCB_COMPOUND_FILE> libFile = std::make_unique<ALTIUM_PCB_COMPOUND_FILE>();
336
337 if( lib->DecodeIntLibStream( *pcbCfe, libFile.get() ) )
338 libFiles.m_Files.emplace_back( std::move( libFile ) );
339 }
340 }
341
342 libFiles.m_Timestamp = timestamp;
343 }
344 catch( CFB::CFBException& exception )
345 {
346 THROW_IO_ERROR( exception.what() );
347 }
348}
349
350
351void PCB_IO_ALTIUM_DESIGNER::FootprintEnumerate( wxArrayString& aFootprintNames,
352 const wxString& aLibraryPath, bool aBestEfforts,
353 const std::map<std::string, UTF8>* aProperties )
354{
355 loadAltiumLibrary( aLibraryPath );
356
357 if( !m_fplibFiles.contains( aLibraryPath ) )
358 return; // No footprint libraries in file, ignore.
359
360 try
361 {
362 for( std::unique_ptr<ALTIUM_PCB_COMPOUND_FILE>& altiumLibFile : m_fplibFiles[aLibraryPath].m_Files )
363 {
364 // Map code-page-dependent names to unicode names
365 CASE_INSENSITIVE_MAP<wxString> patternMap = altiumLibFile->ListLibFootprints();
366
367 const std::vector<std::string> streamName = { "Library", "Data" };
368 const CFB::COMPOUND_FILE_ENTRY* libraryData = altiumLibFile->FindStream( streamName );
369
370 if( libraryData == nullptr )
371 THROW_IO_ERRORF( _( "File not found: '%s'." ), FormatPath( streamName ) );
372
373 ALTIUM_BINARY_PARSER parser( *altiumLibFile, libraryData );
374
375 std::map<wxString, wxString> properties = parser.ReadProperties();
376
377 uint32_t numberOfFootprints = parser.Read<uint32_t>();
378
379 // The number of footprints might be bogus. Following it is a list of index strings to
380 // find the footprints, and this list might actually be longer than how many footprints
381 // actually are in the library.
382 // If this case was detected, truncate the list to the number of footprints.
383 // Sample in #18452 shows that by simply truncating can get the correct footprints.
384 // Fixes https://gitlab.com/kicad/code/kicad/issues/18452.
385 // After truncation we shall no longer detect if the stream is fully parsed.
386 bool footprintListNotTruncated = true;
387
388 if ( patternMap.size() < numberOfFootprints )
389 {
390 numberOfFootprints = patternMap.size();
391 footprintListNotTruncated = false;
392 }
393
394 aFootprintNames.Alloc( numberOfFootprints );
395
396 for( size_t i = 0; i < numberOfFootprints; i++ )
397 {
399
400 wxScopedCharBuffer charBuffer = parser.ReadCharBuffer();
401 wxString fpPattern( charBuffer, wxConvISO8859_1 );
402
403 auto it = patternMap.find( fpPattern );
404
405 if( it != patternMap.end() )
406 aFootprintNames.Add( it->second ); // Proper unicode name
407 else
408 THROW_IO_ERRORF( _( "Component name not found: '%s'" ), fpPattern );
409
410 parser.SkipSubrecord();
411 }
412
413 if( parser.HasParsingError() )
414 THROW_IO_ERRORF( wxT( "%s stream was not parsed correctly" ), FormatPath( streamName ) );
415
416 if( footprintListNotTruncated && parser.GetRemainingBytes() != 0 )
417 THROW_IO_ERRORF( wxT( "%s stream is not fully parsed" ), FormatPath( streamName ) );
418 }
419 }
420 catch( CFB::CFBException& exception )
421 {
422 THROW_IO_ERROR( exception.what() );
423 }
424}
425
426
427std::unique_ptr<FOOTPRINT> PCB_IO_ALTIUM_DESIGNER::FootprintLoad( const wxString& aLibraryPath,
428 const wxString& aFootprintName, bool aKeepUUID,
429 const std::map<std::string, UTF8>* aProperties )
430{
431 loadAltiumLibrary( aLibraryPath );
432
433 if( !m_fplibFiles.contains( aLibraryPath ) )
434 THROW_IO_ERRORF( _( "No footprints in library '%s'" ), aLibraryPath );
435
436 try
437 {
438 for( std::unique_ptr<ALTIUM_PCB_COMPOUND_FILE>& altiumLibFile : m_fplibFiles[aLibraryPath].m_Files )
439 {
440 altiumLibFile->CacheLibModels();
441 auto [dirName, fpCfe] = altiumLibFile->FindLibFootprintDirName( aFootprintName );
442
443 if( dirName.IsEmpty() )
444 continue;
445
446 // Parse File
447 ALTIUM_PCB pcb( m_board, nullptr, m_layer_mapping_handler, m_reporter, aLibraryPath, aFootprintName );
448 return pcb.ParseFootprint( *altiumLibFile, aFootprintName );
449 }
450 }
451 catch( CFB::CFBException& exception )
452 {
453 THROW_IO_ERROR( exception.what() );
454 }
455
456 THROW_IO_ERRORF( _( "Footprint '%s' not found in '%s'." ), aFootprintName, aLibraryPath );
457}
458
459
461{
462 std::vector<FOOTPRINT*> footprints;
463
464 // caller owns result, clone not alias
465 for( FOOTPRINT* fp : m_board->Footprints() )
466 footprints.push_back( static_cast<FOOTPRINT*>( fp->Clone() ) );
467
468 return footprints;
469}
const char * name
std::string FormatPath(const std::vector< std::string > &aVectorPath)
Helper for debug logging (vector -> string)
@ EXTENDPRIMITIVEINFORMATION
Definition altium_pcb.h:56
std::vector< ALTIUM_PROJECT_VARIANT > ParseAltiumProjectVariants(const wxString &aPrjPcbPath)
Parse all [ProjectVariantN] sections from an Altium .PrjPcb project file.
std::map< wxString, wxString > ParseAltiumProjectParameters(const wxString &aPrjPcbPath)
Parse all [ParameterN] sections from an Altium .PrjPcb project file.
KIID AltiumUniqueIdToKiid(const wxString &aUniqueId)
Derive a stable KIID from an Altium component unique id.
std::map< wxString, ValueType, DETAIL::CASE_INSENSITIVE_COMPARER > CASE_INSENSITIVE_MAP
wxScopedCharBuffer ReadCharBuffer()
std::map< wxString, wxString > ReadProperties(std::function< std::map< wxString, wxString >(const std::string &)> handleBinaryData=[](const std::string &) { return std::map< wxString, wxString >();})
std::unique_ptr< FOOTPRINT > ParseFootprint(ALTIUM_PCB_COMPOUND_FILE &altiumLibFile, const wxString &aFootprintName)
void Parse(const ALTIUM_PCB_COMPOUND_FILE &aAltiumPcbFile, const std::map< ALTIUM_PCB_DIR, std::string > &aFileMapping, const std::map< std::string, UTF8 > *aProperties=nullptr)
Information pertinent to a Pcbnew printed circuit board.
Definition board.h:410
void AddVariant(const wxString &aVariantName)
Definition board.cpp:3205
const FOOTPRINTS & Footprints() const
Definition board.h:464
void SetVariantDescription(const wxString &aVariantName, const wxString &aDescription)
Definition board.cpp:3346
RAII class to set and restore the fontconfig reporter.
Definition reporter.h:385
Variant information for a footprint.
Definition footprint.h:228
void SetExcludedFromPosFiles(bool aExclude)
Definition footprint.h:252
void SetDNP(bool aDNP)
Definition footprint.h:243
void SetFieldValue(const wxString &aFieldName, const wxString &aValue)
Set a field value override for this variant.
Definition footprint.h:274
void SetExcludedFromBOM(bool aExclude)
Definition footprint.h:246
FOOTPRINT_VARIANT * AddVariant(const wxString &aVariantName)
Add a new variant with the given name.
REPORTER * m_reporter
Reporter to log errors/warnings to, may be nullptr.
Definition io_base.h:238
PROGRESS_REPORTER * m_progressReporter
Progress reporter to track the progress of the operation, may be nullptr.
Definition io_base.h:241
virtual bool CanReadLibrary(const wxString &aFileName) const
Checks if this IO object can read the specified library file/directory.
Definition io_base.cpp:71
virtual void RegisterCallback(LAYER_MAPPING_HANDLER aLayerMappingHandler)
Register a different handler to be called when mapping of input layers to KiCad layers occurs.
LAYER_MAPPING_HANDLER m_layer_mapping_handler
Callback to get layer mapping.
static LOAD_INFO_REPORTER & GetInstance()
Definition reporter.cpp:351
long long GetLibraryTimestamp(const wxString &aLibraryPath) const override
Generate a timestamp representing all the files in the library (including the library directory).
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::vector< FOOTPRINT * > GetImportedCachedLibraryFootprints() override
Return a container with the cached library footprints generated in the last call to Load.
static bool checkFileHeader(const wxString &aFileName)
bool CanReadBoard(const wxString &aFileName) const override
std::unique_ptr< FOOTPRINT > FootprintLoad(const wxString &aLibraryPath, const wxString &aFootprintName, bool aKeepUUID=false, const std::map< std::string, UTF8 > *aProperties=nullptr) override
Load a footprint having aFootprintName from the aLibraryPath containing a library format that this PC...
void loadAltiumLibrary(const wxString &aLibraryPath)
void loadBoard(const wxString &aFileName, BOARD &aBoard, bool aIsNewLoad, const std::map< std::string, UTF8 > *aProperties, PROJECT *aProject=nullptr) override
Parse aFileName into aBoard.
static std::map< wxString, PCB_LAYER_ID > DefaultLayerMappingCallback(const std::vector< INPUT_LAYER_DESC > &aInputLayerDescriptionVector)
Return the automapped layers.
std::map< wxString, ALTIUM_FILE_CACHE > m_fplibFiles
bool CanReadLibrary(const wxString &aFileName) const override
Checks if this IO object can read the specified library file/directory.
BOARD * m_board
The board BOARD being worked on, no ownership here.
Definition pcb_io.h:393
virtual bool CanReadBoard(const wxString &aFileName) const
Definition pcb_io.cpp:40
PCB_IO(const wxString &aName)
Definition pcb_io.h:372
const std::map< std::string, UTF8 > * m_props
Properties passed via Save() or Load(), no ownership, may be NULL.
Definition pcb_io.h:396
A progress reporter interface for use in multi-threaded environments.
Container for project specific data.
Definition project.h:63
void IncrementTextVarsTicker()
Definition project.h:112
virtual std::map< wxString, wxString > & GetTextVars() const
Definition project.cpp:126
A pure virtual class used to derive REPORTER objects from.
Definition reporter.h:73
#define _(s)
#define THROW_IO_ERROR(msg)
macro which captures the "call site" values of FILE_, __FUNCTION & LINE
#define THROW_IO_ERRORF(msg,...)
const std::vector< uint8_t > COMPOUND_FILE_HEADER
Definition io_utils.cpp:30
bool fileHasBinaryHeader(const wxString &aFilePath, const std::vector< uint8_t > &aHeader, size_t aOffset)
Check if a file starts with a defined binary header.
Definition io_utils.cpp:60
void ApplyAltiumProjectVariantsToBoard(BOARD *aBoard, const std::vector< ALTIUM_PROJECT_VARIANT > &aVariants)
Pcbnew PLUGIN for Altium *.PcbDoc format.
void LoadAltiumBoard(const wxString &aFileName, BOARD *aBoard, const std::map< ALTIUM_PCB_DIR, std::string > &aMapping, const std::map< std::string, UTF8 > *aProperties, PROJECT *aProject, PROGRESS_REPORTER *aProgressReporter, LAYER_MAPPING_HANDLER &aLayerMappingHandler, REPORTER *aReporter)
void ApplyAltiumProjectParametersToProject(PROJECT *aProject, const std::map< wxString, wxString > &aParameters)
Register Altium project parameters as KiCad project text variables so that imported board text refere...
void LoadAltiumBoard(const wxString &aFileName, BOARD *aBoard, const std::map< ALTIUM_PCB_DIR, std::string > &aMapping, const std::map< std::string, UTF8 > *aProperties, PROJECT *aProject, PROGRESS_REPORTER *aProgressReporter, LAYER_MAPPING_HANDLER &aLayerMappingHandler, REPORTER *aReporter)
std::function< std::map< wxString, PCB_LAYER_ID >(const std::vector< INPUT_LAYER_DESC > &)> LAYER_MAPPING_HANDLER
Pointer to a function that takes a map of source and KiCad layers and returns a re-mapped version.
A project-level assembly variant parsed from an Altium .PrjPcb file.
A single component variation within an Altium project variant.
int kind
wxString uniqueId
wxString designator
std::map< wxString, wxString > alternateFields
Describes an imported layer and how it could be mapped to KiCad Layers.
std::vector< std::unique_ptr< ALTIUM_PCB_COMPOUND_FILE > > m_Files
std::string path