20#ifndef PADS_SCH_SYMBOL_BUILDER_H_
21#define PADS_SCH_SYMBOL_BUILDER_H_
60 bool HasSymbol(
const std::string& aName )
const;
82 const std::string& aPinType );
99 const std::vector<SYMBOL_DEF>& aSymbolDefs );
106 const std::vector<SYMBOL_DEF>& aSymbolDefs );
121 const std::string& aPinNumber );
129 const std::vector<std::string>& aPinNumbers );
137 const std::vector<std::string>& aPinNumbers,
138 const std::string& aCacheKey );
144 const std::vector<PARTTYPE_DEF::SIGPIN>& aSigpins );
158 static std::vector<SYMBOL_PIN>
applyGateOverrides(
const std::vector<SYMBOL_PIN>& aDecalPins,
Define a library symbol object.
int mapPinType(PIN_TYPE aPadsType)
LIB_SYMBOL * BuildMultiUnitSymbol(const PARTTYPE_DEF &aPartType, const std::vector< SYMBOL_DEF > &aSymbolDefs)
Build a composite multi-unit symbol from a multi-gate PARTTYPE.
bool HasSymbol(const std::string &aName) const
const PARAMETERS & m_params
void AddHiddenPowerPins(LIB_SYMBOL *aSymbol, const std::vector< PARTTYPE_DEF::SIGPIN > &aSigpins)
Add hidden PT_POWER_IN pins from PARTTYPE SIGPIN entries, skipping duplicate numbers.
static std::vector< SYMBOL_PIN > applyGateOverrides(const std::vector< SYMBOL_PIN > &aDecalPins, const GATE_DEF &aGate)
Return the decal's pins with the gate's name, number and type overrides applied.
LIB_SYMBOL * GetSymbol(const std::string &aName) const
~PADS_SCH_SYMBOL_BUILDER()
int toKiCadUnits(double aPadsValue) const
LIB_SYMBOL * GetOrCreateMultiUnitSymbol(const PARTTYPE_DEF &aPartType, const std::vector< SYMBOL_DEF > &aSymbolDefs)
Return the cached multi-unit symbol for the PARTTYPE, building it if needed, so all instances of the ...
static std::optional< LIB_ID > GetKiCadPowerSymbolId(const std::string &aPadsName)
Map a PADS power symbol name to a KiCad power library LIB_ID, or nullopt if unmapped.
std::vector< SCH_SHAPE * > createShapes(const SYMBOL_GRAPHIC &aGraphic)
LIB_SYMBOL * BuildKiCadPowerSymbol(const std::string &aKiCadName)
Build a power symbol using hard-coded KiCad-standard graphics, or nullptr if the name is unrecognized...
PADS_SCH_SYMBOL_BUILDER(const PARAMETERS &aParams)
SCH_PIN * createPin(const SYMBOL_PIN &aPin, LIB_SYMBOL *aParent, bool aMapDiodeAK=false)
static bool IsPowerSymbol(const std::string &aName)
static std::string GetPowerStyleFromVariant(const std::string &aDecalName, const std::string &aPinType)
Map a PADS special_variant decal name and pin type to a power symbol style name for BuildKiCadPowerSy...
SCH_SHAPE * createShape(const SYMBOL_GRAPHIC &aGraphic)
Create a SCH_SHAPE from a PADS graphic element.
LIB_SYMBOL * GetOrCreateSymbol(const SYMBOL_DEF &aSymbolDef)
Return the cached symbol for the given definition, building and caching it if needed.
LIB_SYMBOL * GetOrCreateConnectorPinSymbol(const PARTTYPE_DEF &aPartType, const SYMBOL_DEF &aSymbolDef, const std::string &aPinNumber)
Return a connector symbol variant carrying a specific pin number, since PADS connectors reuse one dec...
LIB_SYMBOL * GetOrCreateMultiUnitConnectorSymbol(const PARTTYPE_DEF &aPartType, const SYMBOL_DEF &aSymbolDef, const std::vector< std::string > &aPinNumbers, const std::string &aCacheKey)
Return the cached multi-unit connector symbol, building it if needed.
LIB_SYMBOL * BuildMultiUnitConnectorSymbol(const PARTTYPE_DEF &aPartType, const SYMBOL_DEF &aSymbolDef, const std::vector< std::string > &aPinNumbers)
Build a multi-unit connector symbol with one unit per pin, letting all of a connector's individually ...
std::map< std::string, std::unique_ptr< LIB_SYMBOL > > m_symbolCache
LIB_SYMBOL * BuildSymbol(const SYMBOL_DEF &aSymbolDef)
Build a KiCad LIB_SYMBOL from a PADS symbol definition.
static bool isDiodeAKPinSet(const std::vector< SYMBOL_PIN > &aPins)
True when aPins is a bare two-pin A/K pair, i.e.
SCH_TEXT * createSymbolText(const SYMBOL_TEXT &aText, int aUnit=0)
Build the configured SCH_TEXT for one symbol text field, or nullptr when its content is empty.
LIB_SYMBOL * GetOrCreatePartTypeSymbol(const PARTTYPE_DEF &aPartType, const SYMBOL_DEF &aSymbolDef)
Return a single-gate symbol with PARTTYPE pin overrides applied at build time.
static int NextFreePowerOrdinal(SCH_SHEET *aSheet)
Return the first 1-based ordinal that no "#PWRnnnn" reference under aSheet uses.
Holds all the data relating to one schematic.
Sheet symbol placed in a schematic, and is the entry point for a sub schematic.