51 &
path, 0, 0, wxPoint( 1, 2 ) );
82 BOOST_CHECK_EQUAL( m_sch_pin->GetParentSymbol(), m_parent_symbol );
85 BOOST_CHECK_EQUAL( m_sch_pin->GetLocalPosition(), wxPoint( 1, -2 ) );
86 BOOST_CHECK_EQUAL( m_sch_pin->GetPosition(), wxPoint( 2, 4 ) );
88 BOOST_CHECK_EQUAL( m_sch_pin->IsVisible(), m_lib_pin->IsVisible() );
89 BOOST_CHECK_EQUAL( m_sch_pin->GetName(), m_lib_pin->GetName() );
90 BOOST_CHECK_EQUAL( m_sch_pin->GetNumber(), m_lib_pin->GetNumber() );
92 BOOST_CHECK( ( m_sch_pin->GetType() == m_lib_pin->GetType() ) );
94 BOOST_CHECK_EQUAL( m_sch_pin->IsPowerConnection(), m_lib_pin->IsPowerConnection() );
105 BOOST_CHECK_EQUAL( assigned.
GetNumber(), m_lib_pin->GetNumber() );
116 BOOST_CHECK_EQUAL( copied.
GetNumber(), m_lib_pin->GetNumber() );
125 BOOST_CHECK_EQUAL( m_sch_pin->IsDangling(), true );
128 m_sch_pin->SetIsDangling(
false );
129 BOOST_CHECK_EQUAL( m_sch_pin->IsDangling(), false );
132 m_sch_pin->SetIsDangling(
true );
133 BOOST_CHECK_EQUAL( m_sch_pin->IsDangling(), true );
143 const wxString
name = m_sch_pin->GetDefaultNetName(
path );
144 BOOST_CHECK_EQUAL(
name,
"Net-(U2-Pad42)" );
148 const wxString map_name = m_sch_pin->GetDefaultNetName(
path );
149 BOOST_CHECK_EQUAL( map_name,
name );
159 m_parent_part->SetPower();
163 delete m_parent_symbol;
164 m_parent_symbol =
new SCH_SYMBOL( *m_parent_part, m_parent_part->GetLibId(),
165 &
path, 0, 0, wxPoint( 1, 2 ) );
167 m_parent_symbol->UpdatePins();
169 m_sch_pin = m_parent_symbol->GetPins( &
path )[0];
172 const wxString pwr_name = m_sch_pin->GetDefaultNetName(
path );
173 BOOST_CHECK_EQUAL( pwr_name,
"pinname" );
176 BOOST_AUTO_TEST_SUITE_END()
power input (GND, VCC for ICs). Must be connected to a power output.
LIB_SYMBOL * m_parent_part
SCH_SYMBOL * GetParentSymbol() const
wxString GetNumber() const
void SetPosition(const wxPoint &aPos) override
Define a library symbol object.
BOOST_CHECK(v2.Cross(v1)==1)
void SetNumber(const wxString &aNumber)
void SetType(ELECTRICAL_PINTYPE aType)
LIB_ID GetLibId() const override
void UpdatePins()
Updates the cache of SCH_PIN objects for each pin.
void AddDrawItem(LIB_ITEM *aItem, bool aSort=true)
Add a new draw aItem to the draw object list and sort according to aSort.
Handle access to a stack of flattened SCH_SHEET objects by way of a path for creating a flattened sch...
void SetName(const wxString &aName)
usual pin input: must be connected
void SetRef(const SCH_SHEET_PATH *aSheet, const wxString &aReference)
Set the reference for the given sheet path for this symbol.
SCH_SYMBOL * m_parent_symbol
BOOST_AUTO_TEST_CASE(DefaultProperties)
Declare the test suite.
std::vector< SCH_PIN * > GetPins(const SCH_SHEET_PATH *aSheet=nullptr) const
Retrieve a list of the SCH_PINs for the given sheet path.