KiCad PCB EDA Suite
Loading...
Searching...
No Matches
backannotate.h File Reference
#include <deque>
#include <map>
#include <set>
#include <memory>
#include <vector>
#include <sch_reference_list.h>
#include <template_fieldnames.h>
#include <wx/string.h>

Go to the source code of this file.

Classes

struct  BACKANNOTATE_UNIT_SWAP_CANDIDATE
 
struct  BACKANNOTATE_UNIT_SWAP_STEP
 
struct  BACKANNOTATE_UNIT_SWAP_PLAN
 
class  BACK_ANNOTATE
 Back annotation algorithm class used to receive, check, and apply a NETLIST from Pcbnew. More...
 
struct  BACK_ANNOTATE::PCB_FP_DATA
 Container for Pcbnew footprint data. More...
 

Functions

bool CollectBackannotatePcbNets (const SCH_SYMBOL &aSymbol, const SCH_SHEET_PATH &aSheetPath, const wxString &aVariantName, const std::map< wxString, wxString > &aPcbNetsByPad, std::map< wxString, wxString > &aPcbNetsByLogicalPin)
 Append this unit's PCB nets to a map keyed by logical pin number, resolving pin-to-pad mappings.
 
BACKANNOTATE_UNIT_SWAP_PLAN PlanBackannotateUnitSwaps (const std::vector< BACKANNOTATE_UNIT_SWAP_CANDIDATE > &aCandidates, const std::map< wxString, wxString > &aPcbPinMap)
 Compute a pure unit-swap plan from schematic-side unit definitions and PCB nets keyed by logical pin number.
 

Function Documentation

◆ CollectBackannotatePcbNets()

bool CollectBackannotatePcbNets ( const SCH_SYMBOL & aSymbol,
const SCH_SHEET_PATH & aSheetPath,
const wxString & aVariantName,
const std::map< wxString, wxString > & aPcbNetsByPad,
std::map< wxString, wxString > & aPcbNetsByLogicalPin )

Append this unit's PCB nets to a map keyed by logical pin number, resolving pin-to-pad mappings.

Return false if a pin's pads disagree or units assign different nets to a shared logical pin. The output may be partially populated on failure and must not be used for swap planning.

Definition at line 77 of file backannotate.cpp.

References ExpandStackedPinNotation(), SCH_SYMBOL::GetPins(), pad, and pin.

Referenced by BACK_ANNOTATE::applyChangelist(), BOOST_AUTO_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), and MAPPED_UNIT_SWAP_FIXTURE::Plan().

◆ PlanBackannotateUnitSwaps()

BACKANNOTATE_UNIT_SWAP_PLAN PlanBackannotateUnitSwaps ( const std::vector< BACKANNOTATE_UNIT_SWAP_CANDIDATE > & aCandidates,
const std::map< wxString, wxString > & aPcbPinMap )

Compute a pure unit-swap plan from schematic-side unit definitions and PCB nets keyed by logical pin number.

The caller must resolve pin-to-pad mappings before constructing the PCB net map. This is shared by backannotation and unit tests so swap inference can be exercised without constructing a full schematic editor test harness.

Definition at line 129 of file backannotate.cpp.

References BACKANNOTATE_UNIT_SWAP_CANDIDATE::m_schNetsByPin, BACKANNOTATE_UNIT_SWAP_CANDIDATE::m_unitPinNumbers, netsInUnitOrder(), and plan().

Referenced by BACK_ANNOTATE::applyChangelist(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), and MAPPED_UNIT_SWAP_FIXTURE::Plan().