97 m_sheet.SetParent( &m_schematic );
103 m_sheet.SetScreen( screen );
104 m_schematic.AddTopLevelSheet( &m_sheet );
111 m_schematic.RemoveTopLevelSheet( &m_sheet );
124 auto newPin = std::make_unique<SCH_SHEET_PIN>( &m_sheet, pinPos,
"pinname" );
129 m_sheet.AddPin( newPin.release() );
139 std::vector<SCH_SHEET_PIN*>& pins = m_sheet.GetPins();
145 m_sheet.RemovePin( &pinRef );
160 for(
int i = 0; i < 5; ++i )
167 m_sheet.AddPin(
pin );
170 std::vector<SCH_SHEET_PIN*>& pins = m_sheet.GetPins();
172 std::vector<int> numbers;
175 numbers.push_back(
pin->GetNumber() );
196 const std::vector<TEST_END_CONN_PIN> pin_defs = {
208 for(
const auto&
pin : pin_defs )
211 std::vector<SCH_SHEET_PIN*>& pins = m_sheet.GetPins();
218 std::vector<DANGLING_END_ITEM> expectedDangling;
224 pin->GetPosition(),
pin );
227 std::vector<DANGLING_END_ITEM> dangling;
228 m_sheet.GetEndPoints( dangling );
230 BOOST_CHECK_EQUAL_COLLECTIONS( dangling.begin(), dangling.end(),
231 expectedDangling.begin(), expectedDangling.end() );
236 std::vector<VECTOR2I> expectedConnections;
239 for(
const auto&
pin : pin_defs )
241 expectedConnections.push_back(
pin.m_pos );
244 std::vector<VECTOR2I> connections = m_sheet.GetConnectionPoints();
246 BOOST_CHECK_EQUAL_COLLECTIONS( connections.begin(), connections.end(),
247 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