29LIB_ID makeFp(
const wxString& aLibNick,
const wxString& aName )
33 id.SetLibItemName( aName );
49 map.
SetEntry( wxS(
"1" ), wxS(
"1" ) );
50 map.
SetEntry( wxS(
"4" ), wxS(
"[4,9]" ) );
61 map.
SetEntry( wxS(
"1" ), wxS(
"8" ) );
77 const std::vector<wxString> pins = { wxS(
"1" ), wxS(
"2" ), wxS(
"4" ) };
82 PIN_MAP straight( wxS(
"Straight" ) );
83 straight.
SetEntry( wxS(
"1" ), wxS(
"1" ) );
84 straight.
SetEntry( wxS(
"2" ), wxS(
"2" ) );
88 swap.SetEntry( wxS(
"1" ), wxS(
"2" ) );
89 swap.SetEntry( wxS(
"2" ), wxS(
"1" ) );
94 PIN_MAP stacked( wxS(
"Stacked" ) );
95 stacked.
SetEntry( wxS(
"4" ), wxS(
"[4,9]" ) );
113 PIN_MAP replacement( wxS(
"STD-8" ) );
114 replacement.
SetEntry( wxS(
"1" ), wxS(
"1" ) );
120 set.
Remove( wxS(
"DFN-8-EP" ) );
149 std::unordered_map<wxString, std::vector<wxString>> assignments;
150 assignments[wxS(
"1" )] = { wxS(
"1" ) };
151 assignments[wxS(
"4" )] = { wxS(
"4" ), wxS(
"9" ) };
152 assignments[wxS(
"7" )] = {};
173 ov.
m_Edits.push_back( { wxS(
"1" ), wxS(
"8" ) } );
194 a.
SetEntry( wxS(
"1" ), wxS(
"1" ) );
197 b.
SetEntry( wxS(
"1" ), wxS(
"1" ) );
209 fb.m_MapName = wxS(
"OTHER" );
220 map.SetEntry( wxS(
"1" ), wxS(
"8" ) );
231 root.
SetPinMaps( makeSet( wxS(
"ROOT-MAP" ) ) );
263 root.
SetPinMaps( makeSet( wxS(
"ROOT-MAP" ) ) );
269 std::unique_ptr<LIB_SYMBOL> flat = leaf.
Flatten();
273 BOOST_REQUIRE( flat->GetPinMaps().FindByName( wxS(
"ROOT-MAP" ) ) );
283 { makeFp( wxS(
"Package_SO" ), wxS(
"SOIC-8" ) ), wxS(
"STD-8" ) },
284 { makeFp( wxS(
"Package_SO" ), wxS(
"VSSOP-8" ) ), wxS(
"STD-8" ) },
A logical library item identifier and consists of various portions much like a URI.
int SetLibNickname(const UTF8 &aLibNickname)
Override the logical library name portion of the LIB_ID to aLibNickname.
Define a library symbol object.
const std::vector< ASSOCIATED_FOOTPRINT > & GetEffectiveAssociatedFootprints() const
void SetAssociatedFootprints(std::vector< ASSOCIATED_FOOTPRINT > aList)
void SetParent(LIB_SYMBOL *aParent=nullptr)
void SetPinMaps(const PIN_MAP_SET &aPinMaps)
const PIN_MAP_SET & GetEffectivePinMaps() const
const PIN_MAP_SET & GetPinMaps() const
Pin-to-pad mapping (issue #2282).
std::unique_ptr< LIB_SYMBOL > Flatten() const
Return a flattened symbol inheritance to the caller.
int Compare(const LIB_SYMBOL &aRhs, int aCompareFlags=~COMPARE_FLAGS::UNIT, REPORTER *aReporter=nullptr) const
Comparison test that can be used for operators.
const std::vector< ASSOCIATED_FOOTPRINT > & GetAssociatedFootprints() const
A symbol-owned ordered set of named pin maps.
const std::vector< PIN_MAP > & GetAll() const
void AddOrReplace(PIN_MAP aMap)
Insert aMap, replacing any existing entry with the same name.
void Remove(const wxString &aName)
Remove the map with the given name.
const PIN_MAP * FindByName(const wxString &aName) const
void SetName(const wxString &aName)
const wxString & GetPadNumber(const wxString &aPinNumber) const
const std::vector< PIN_MAP_ENTRY > & GetEntries() const
const wxString & GetName() const
bool HasEntry(const wxString &aPinNumber) const
void ClearEntry(const wxString &aPinNumber)
Remove the entry for aPinNumber.
bool IsIdentity(const std::vector< wxString > &aPinNumbers) const
void SetEntry(const wxString &aPinNumber, const wxString &aPadNumber)
Set the pad number for a symbol pin.
static bool empty(const wxTextEntryBase *aCtrl)
PIN_MAP MakeLegacyPinMap(const wxString &aName, const std::unordered_map< wxString, std::vector< wxString > > &aAssignments)
Build a single named PIN_MAP from a legacy symbol-pin to footprint-pad(s) assignment table (the flat ...
Per-instance override of the active pin map and a sparse delta on top.
std::vector< PIN_MAP_ENTRY > m_Edits
PIN_MAP_OVERRIDE_MODE m_Mode
BOOST_AUTO_TEST_CASE(HorizontalAlignment)
BOOST_AUTO_TEST_SUITE(CadstarPartParser)
BOOST_CHECK(res.column_datatype(0)==SQL_NUMERIC||res.column_datatype(0)==SQL_DECIMAL)
BOOST_CHECK_EQUAL(std::any_cast< std::string >(rows[0].at("val")), "12345678901234567.89")
BOOST_REQUIRE(res.columns()==1)
BOOST_AUTO_TEST_SUITE_END()
BOOST_AUTO_TEST_CASE(EntrySetGetClear)