96 m_sheet.SetParent( &m_schematic );
101 m_schematic.SetRoot( &m_sheet );
119 auto newPin = std::make_unique<SCH_SHEET_PIN>( &m_sheet, pinPos,
"pinname" );
124 m_sheet.AddPin( newPin.release() );
134 std::vector<SCH_SHEET_PIN*>& pins = m_sheet.GetPins();
140 m_sheet.RemovePin( &pinRef );
155 for(
int i = 0; i < 5; ++i )
162 m_sheet.AddPin(
pin );
165 std::vector<SCH_SHEET_PIN*>& pins = m_sheet.GetPins();
167 std::vector<int> numbers;
170 numbers.push_back(
pin->GetNumber() );
191 const std::vector<TEST_END_CONN_PIN> pin_defs = {
203 for(
const auto&
pin : pin_defs )
206 std::vector<SCH_SHEET_PIN*>& pins = m_sheet.GetPins();
213 std::vector<DANGLING_END_ITEM> expectedDangling;
219 pin->GetPosition(),
pin );
222 std::vector<DANGLING_END_ITEM> dangling;
223 m_sheet.GetEndPoints( dangling );
225 BOOST_CHECK_EQUAL_COLLECTIONS( dangling.begin(), dangling.end(),
226 expectedDangling.begin(), expectedDangling.end() );
231 std::vector<VECTOR2I> expectedConnections;
234 for(
const auto&
pin : pin_defs )
236 expectedConnections.push_back(
pin.m_pos );
239 std::vector<VECTOR2I> connections = m_sheet.GetConnectionPoints();
241 BOOST_CHECK_EQUAL_COLLECTIONS( connections.begin(), connections.end(),
242 expectedConnections.begin(), expectedConnections.end() );
Helper class used to store the state of schematic items that can be connected to other schematic item...
DANGLING_END_T GetType() const
const EDA_ITEM * GetParent() const
EDA_ITEM * GetItem() const
VECTOR2I GetPosition() const
Holds all the data relating to one schematic.
Define a sheet pin (label) used in sheets to create hierarchical schematics.
Sheet symbol placed in a schematic, and is the entry point for a sub schematic.
const SCH_SHEET & m_csheet
TEST_SCH_SHEET_FIXTURE()
Dummy schematic to attach the test sheet to.
SCH_SHEET m_sheet
Can use when you need a const ref (lots of places need fixing here)
bool CollectionHasNoDuplicates(const T &aCollection)
Predicate to check a collection has no duplicate elements.
BOOST_AUTO_TEST_CASE(HorizontalAlignment)
BOOST_AUTO_TEST_SUITE_END()
std::ostream & operator<<(std::ostream &os, DANGLING_END_ITEM const &d)
Print helper.
BOOST_AUTO_TEST_CASE(Default)
Declare the test suite.
BOOST_CHECK_PREDICATE(ArePolylineEndPointsNearCircle,(chain)(c.m_geom.m_center_point)(radius)(accuracy+epsilon))
BOOST_CHECK_EQUAL(result, "25.4")
#define CHECK_WX_ASSERT(STATEMENT)
A test macro to check a wxASSERT is thrown.
Test utilities for timestamps.
VECTOR2< int32_t > VECTOR2I