KiCad PCB EDA Suite
Loading...
Searching...
No Matches
PADS_COMMON Namespace Reference

Classes

struct  RELATED_FILES
 Result of detecting related PADS project files. More...
 

Enumerations

enum class  PADS_FILE_TYPE { UNKNOWN , PCB_ASCII , SCHEMATIC_ASCII }
 Types of PADS files that can be detected. More...
 

Functions

KIID GenerateDeterministicUuid (const std::string &aIdentifier)
 Generate a deterministic KIID from a PADS component identifier.
 
PADS_FILE_TYPE DetectPadsFileType (const wxString &aFilePath)
 Detect the type of a PADS file by examining its header.
 
RELATED_FILES FindRelatedPadsFiles (const wxString &aFilePath)
 Find related PADS project files from a given source file.
 
int ParseInt (const std::string &aStr, int aDefault=0, const std::string &aContext={})
 Parse integer from string with error context.
 
double ParseDouble (const std::string &aStr, double aDefault=0.0, const std::string &aContext={})
 Parse double from string with error context.
 
wxString ConvertInvertedNetName (const std::string &aNetName)
 Convert a PADS net name to KiCad format, handling inverted signal notation.
 
LINE_STYLE PadsLineStyleToKiCad (int aPadsStyle)
 Convert a PADS line style integer to a KiCad LINE_STYLE enum value.
 

Enumeration Type Documentation

◆ PADS_FILE_TYPE

enum class PADS_COMMON::PADS_FILE_TYPE
strong

Types of PADS files that can be detected.

Enumerator
UNKNOWN 
PCB_ASCII 

PADS PowerPCB ASCII (.asc)

SCHEMATIC_ASCII 

PADS Logic ASCII (.asc or .txt)

Definition at line 61 of file pads_common.h.

Function Documentation

◆ ConvertInvertedNetName()

wxString PADS_COMMON::ConvertInvertedNetName ( const std::string & aNetName)

Convert a PADS net name to KiCad format, handling inverted signal notation.

PADS uses a "/" prefix to indicate inverted signals (e.g. "/RESET"). KiCad uses overbar notation "~{name}" for the same purpose. Non-inverted names pass through unchanged.

This function is shared between the PCB and schematic importers to ensure both sides produce identical net names.

Parameters
aNetNameRaw PADS net name.
Returns
Net name in KiCad notation.

Definition at line 282 of file pads_common.cpp.

Referenced by BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), PADS_SCH::PADS_SCH_SCHEMATIC_BUILDER::convertNetName(), PCB_IO_PADS::ensureNet(), PCB_IO_PADS_BINARY::ensureNet(), PCB_IO_PADS::generateDrcRules(), PCB_IO_PADS::loadBoardSetup(), PCB_IO_PADS::loadClusterGroups(), PCB_IO_PADS::loadCopperShapes(), PCB_IO_PADS::loadFootprints(), PCB_IO_PADS::loadTestPoints(), PCB_IO_PADS::loadTracksAndVias(), PCB_IO_PADS_BINARY::loadTracksAndVias(), PCB_IO_PADS::loadZones(), and PCB_IO_PADS_BINARY::loadZones().

◆ DetectPadsFileType()

PADS_FILE_TYPE PADS_COMMON::DetectPadsFileType ( const wxString & aFilePath)

Detect the type of a PADS file by examining its header.

Parameters
aFilePathPath to the file to examine.
Returns
Detected file type.

Definition at line 98 of file pads_common.cpp.

References PCB_ASCII, SCHEMATIC_ASCII, and UNKNOWN.

Referenced by BOOST_AUTO_TEST_CASE(), FindRelatedPadsFiles(), and KICAD_MANAGER_FRAME::ImportNonKiCadProject().

◆ FindRelatedPadsFiles()

RELATED_FILES PADS_COMMON::FindRelatedPadsFiles ( const wxString & aFilePath)

Find related PADS project files from a given source file.

When importing a PADS PCB file, looks for matching schematic files. When importing a PADS schematic file, looks for matching PCB files. Matches are found by:

  1. Same base filename with different file headers
  2. Files in same directory with compatible headers
Parameters
aFilePathPath to the source file being imported.
Returns
Structure containing paths to any related files found.

Definition at line 133 of file pads_common.cpp.

References DetectPadsFileType(), PCB_ASCII, result, SCHEMATIC_ASCII, and UNKNOWN.

Referenced by BOOST_AUTO_TEST_CASE(), and IMPORT_PROJ_HELPER::ImportPadsFiles().

◆ GenerateDeterministicUuid()

KIID PADS_COMMON::GenerateDeterministicUuid ( const std::string & aIdentifier)

Generate a deterministic KIID from a PADS component identifier.

This function creates a reproducible UUID based on the input string, enabling cross-probe linking between schematic symbols and PCB footprints when both are imported from the same PADS project.

The UUID is generated using a hash of the input string formatted into a valid UUID structure. The same input will always produce the same UUID.

Parameters
aIdentifierString identifying the component (typically refdes or combination of part type and refdes).
Returns
A deterministic KIID that can be used for cross-probe linking.

Definition at line 36 of file pads_common.cpp.

Referenced by BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), PCB_IO_PADS::loadFootprints(), PCB_IO_PADS_BINARY::loadFootprints(), and SCH_IO_PADS::LoadSchematicFile().

◆ PadsLineStyleToKiCad()

LINE_STYLE PADS_COMMON::PadsLineStyleToKiCad ( int aPadsStyle)

Convert a PADS line style integer to a KiCad LINE_STYLE enum value.

PADS stores line style as an unsigned int that should be interpreted as a signed int8_t for mapping.

Definition at line 294 of file pads_common.cpp.

References DASH, DASHDOT, DASHDOTDOT, DOT, and SOLID.

Referenced by BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), PADS_SCH::PADS_SCH_SYMBOL_BUILDER::createShape(), PADS_SCH::PADS_SCH_SYMBOL_BUILDER::createShapes(), and SCH_IO_PADS::LoadSchematicFile().

◆ ParseDouble()

double PADS_COMMON::ParseDouble ( const std::string & aStr,
double aDefault = 0.0,
const std::string & aContext = {} )

Parse double from string with error context.

Returns aDefault on failure and logs a trace warning.

Definition at line 263 of file pads_common.cpp.

Referenced by BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), PADS_SCH::PADS_SCH_PARSER::parseGraphicPrimitive(), PADS_IO::PARSER::parseSectionPARTDECAL(), and PADS_IO::PARSER::parseSectionTEXT().

◆ ParseInt()