81 BOOST_CHECK_EQUAL( m_sch_pin->GetParentSymbol(), m_parent_symbol );
84 BOOST_CHECK_EQUAL( m_sch_pin->GetLocalPosition(),
VECTOR2I( 1, -2 ) );
85 BOOST_CHECK_EQUAL( m_sch_pin->GetPosition(),
VECTOR2I( 2, 4 ) );
87 BOOST_CHECK_EQUAL( m_sch_pin->IsVisible(), m_lib_pin->IsVisible() );
88 BOOST_CHECK_EQUAL( m_sch_pin->GetName(), m_lib_pin->GetName() );
89 BOOST_CHECK_EQUAL( m_sch_pin->GetNumber(), m_lib_pin->GetNumber() );
91 BOOST_CHECK( ( m_sch_pin->GetType() == m_lib_pin->GetType() ) );
93 BOOST_CHECK_EQUAL( m_sch_pin->IsGlobalPower(), m_lib_pin->IsGlobalPower() );
104 BOOST_CHECK_EQUAL( assigned.
GetNumber(), m_lib_pin->GetNumber() );
115 BOOST_CHECK_EQUAL( copied.
GetNumber(), m_lib_pin->GetNumber() );
124 BOOST_CHECK_EQUAL( m_sch_pin->IsDangling(),
true );
127 m_sch_pin->SetIsDangling(
false );
128 BOOST_CHECK_EQUAL( m_sch_pin->IsDangling(),
false );
131 m_sch_pin->SetIsDangling(
true );
132 BOOST_CHECK_EQUAL( m_sch_pin->IsDangling(),
true );
142 const wxString
name = m_sch_pin->GetDefaultNetName(
path );
143 BOOST_CHECK_EQUAL(
name,
"Net-(U2-pinname)" );
147 const wxString map_name = m_sch_pin->GetDefaultNetName(
path );
148 BOOST_CHECK_EQUAL( map_name,
name );
158 m_parent_part->SetPower();
159 BOOST_CHECK_EQUAL( m_lib_pin->IsGlobalPower(),
true );
163 delete m_parent_symbol;
164 m_parent_symbol =
new SCH_SYMBOL( *m_parent_part, m_parent_part->GetLibId(), &
path, 0, 0,
166 m_parent_symbol->SetRef( &
path,
"U2" );
167 m_parent_symbol->SetValueFieldText(
"voltage_value" );
168 m_parent_symbol->UpdatePins();
170 m_sch_pin = m_parent_symbol->GetPins( &
path )[0];
173 const wxString pwr_name = m_sch_pin->GetDefaultNetName(
path );
174 BOOST_CHECK_EQUAL( pwr_name,
"voltage_value" );
177BOOST_AUTO_TEST_SUITE_END()
Define a library symbol object.
const LIB_ID & GetLibId() const override
void AddDrawItem(SCH_ITEM *aItem, bool aSort=true)
Add a new draw aItem to the draw object list and sort according to aSort.
const SYMBOL * GetParentSymbol() const
void SetNumber(const wxString &aNumber)
void SetName(const wxString &aName)
void SetPosition(const VECTOR2I &aPos) override
void SetType(ELECTRICAL_PINTYPE aType)
const wxString & GetNumber() const
Handle access to a stack of flattened SCH_SHEET objects by way of a path for creating a flattened sch...
void UpdatePins()
Updates the cache of SCH_PIN objects for each pin.
void SetRef(const SCH_SHEET_PATH *aSheet, const wxString &aReference)
Set the reference for the given sheet path for this symbol.
std::vector< SCH_PIN * > GetPins(const SCH_SHEET_PATH *aSheet=nullptr) const
Retrieve a list of the SCH_PINs for the given sheet path.
SCH_SYMBOL * m_parent_symbol
LIB_SYMBOL * m_parent_part
@ PT_POWER_IN
power input (GND, VCC for ICs). Must be connected to a power output.
BOOST_CHECK(box.ClosestPointTo(VECTOR2D(0, 0))==VECTOR2D(1, 2))
Test suite for KiCad math code.
BOOST_AUTO_TEST_CASE(DefaultProperties)
Declare the test suite.