82 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() );
116 BOOST_CHECK_EQUAL( copied.
GetAlt(), wxEmptyString );
122 BOOST_CHECK_EQUAL( copied2.
GetAlt(),
"alt" );
131 BOOST_CHECK_EQUAL( m_sch_pin->IsDangling(),
true );
134 m_sch_pin->SetIsDangling(
false );
135 BOOST_CHECK_EQUAL( m_sch_pin->IsDangling(),
false );
138 m_sch_pin->SetIsDangling(
true );
139 BOOST_CHECK_EQUAL( m_sch_pin->IsDangling(),
true );
149 const wxString
name = m_sch_pin->GetDefaultNetName(
path );
150 BOOST_CHECK_EQUAL(
name,
"Net-(U2-pinname)" );
154 const wxString map_name = m_sch_pin->GetDefaultNetName(
path );
155 BOOST_CHECK_EQUAL( map_name,
name );
165 m_parent_part->SetPower();
166 BOOST_CHECK_EQUAL( m_lib_pin->IsGlobalPower(),
true );
170 delete m_parent_symbol;
171 m_parent_symbol =
new SCH_SYMBOL( *m_parent_part, m_parent_part->GetLibId(), &
path, 0, 0,
173 m_parent_symbol->SetRef( &
path,
"U2" );
174 m_parent_symbol->SetValueFieldText(
"voltage_value" );
175 m_parent_symbol->UpdatePins();
177 m_sch_pin = m_parent_symbol->GetPins( &
path )[0];
180 const wxString pwr_name = m_sch_pin->GetDefaultNetName(
path );
181 BOOST_CHECK_EQUAL( pwr_name,
"voltage_value" );
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 SetAlt(const wxString &aAlt)
void SetNumber(const wxString &aNumber)
ALT GetAlt(const wxString &aAlt)
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_AUTO_TEST_SUITE_END()
BOOST_AUTO_TEST_CASE(DefaultProperties)
Declare the test suite.
VECTOR2< int32_t > VECTOR2I