KiCad PCB EDA Suite
Loading...
Searching...
No Matches
altium_project_variants.cpp File Reference
#include <io/altium/altium_project_variants.h>
#include <boost/uuid/name_generator_sha1.hpp>
#include <boost/uuid/string_generator.hpp>
#include <boost/uuid/uuid_io.hpp>
#include <wx/fileconf.h>
#include <wx/log.h>

Go to the source code of this file.

Functions

KIID AltiumUniqueIdToKiid (const wxString &aUniqueId)
 Derive a stable KIID from an Altium component unique id.
 
static ALTIUM_VARIANT_ENTRY ParseVariationString (const wxString &aValue)
 
std::map< wxString, wxString > ParseAltiumProjectParameters (const wxString &aPrjPcbPath)
 Parse all [ParameterN] sections from an Altium .PrjPcb project file.
 
std::vector< ALTIUM_PROJECT_VARIANTParseAltiumProjectVariants (const wxString &aPrjPcbPath)
 Parse all [ProjectVariantN] sections from an Altium .PrjPcb project file.
 

Function Documentation

◆ AltiumUniqueIdToKiid()

KIID AltiumUniqueIdToKiid ( const wxString & aUniqueId)

Derive a stable KIID from an Altium component unique id.

Altium unique ids are not hexadecimal, so KIID's string constructor cannot parse them and returns a fresh random uuid each call. This maps equal id strings to equal KIIDs.

Parameters
aUniqueIdAltium component unique id.
Returns
A KIID that is identical for identical input strings.

Definition at line 34 of file altium_project_variants.cpp.

Referenced by ApplyAltiumProjectVariantsToBoard(), and ALTIUM_PCB::ParseComponents6Data().

◆ ParseAltiumProjectParameters()

std::map< wxString, wxString > ParseAltiumProjectParameters ( const wxString & aPrjPcbPath)

Parse all [ParameterN] sections from an Altium .PrjPcb project file.

Altium stores project-wide special strings (PCB_Revision, Company_Name, ...) here as Name/Value pairs. They are what board text such as ".PCB_Revision" resolves against, so they map to KiCad project text variables.

Parameters
aPrjPcbPathFull path to the .PrjPcb file.
Returns
Map of upper-cased parameter name to value, matching the case-insensitive variable references emitted by AltiumPcbSpecialStringsToKiCadStrings.

Definition at line 132 of file altium_project_variants.cpp.

References config, and name.

Referenced by PCB_IO_ALTIUM_CIRCUIT_MAKER::LoadBoard(), PCB_IO_ALTIUM_CIRCUIT_STUDIO::LoadBoard(), PCB_IO_ALTIUM_DESIGNER::LoadBoard(), and PCB_IO_SOLIDWORKS::LoadBoard().

◆ ParseAltiumProjectVariants()

std::vector< ALTIUM_PROJECT_VARIANT > ParseAltiumProjectVariants ( const wxString & aPrjPcbPath)

Parse all [ProjectVariantN] sections from an Altium .PrjPcb project file.

Parameters
aPrjPcbPathFull path to the .PrjPcb file.
Returns
Vector of project variants with their per-component entries.

Definition at line 175 of file altium_project_variants.cpp.

References config, ALTIUM_PROJECT_VARIANT::description, ALTIUM_VARIANT_ENTRY::designator, ALTIUM_PROJECT_VARIANT::name, ParseVariationString(), and ALTIUM_PROJECT_VARIANT::variations.

Referenced by PCB_IO_ALTIUM_CIRCUIT_MAKER::LoadBoard(), PCB_IO_ALTIUM_CIRCUIT_STUDIO::LoadBoard(), PCB_IO_ALTIUM_DESIGNER::LoadBoard(), PCB_IO_SOLIDWORKS::LoadBoard(), and SCH_IO_ALTIUM::LoadSchematicFile().

◆ ParseVariationString()