55 m_mgr.LoadProject(
"" );
88 m_screen->Append( busWire );
92 m_screen->Append( label );
95 SCH_SHEET_LIST sheets = m_schematic->BuildSheetListSortedByPageNumbers();
96 m_schematic->ConnectionGraph()->Recalculate( sheets,
true );
108 manager.
SetEnvironment( m_schematic.get(),
nullptr,
nullptr,
nullptr,
nullptr );
110 commit.
Modify( label, m_screen );
111 label->
SetText( wxT(
"test[0..7]" ) );
117 const auto view = m_schematic->Connectivity().Connection( busWire->
m_Uuid,
path.Path() );
128 BOOST_CHECK_MESSAGE( !busConn->
Members().empty(),
129 "Bus wire should have members after label changed to bus name" );
132 if( !busConn->
Members().empty() )
148 m_screen->Append( busWire );
152 m_screen->Append( label );
155 SCH_SHEET_LIST sheets = m_schematic->BuildSheetListSortedByPageNumbers();
156 m_schematic->ConnectionGraph()->Recalculate( sheets,
true );
164 BOOST_CHECK_MESSAGE( !busConn->
Members().empty(),
165 "Bus wire should have members from bus label" );
168 if( !busConn->
Members().empty() )
183 const wxString busName( wxT(
"bus{A B}" ) );
184 const int sheetLeft = 10000000;
190 childScreen->
SetFileName( wxT(
"child.kicad_sch" ) );
192 childSheet->
SetName( wxT(
"child" ) );
193 childSheet->
SetFileName( wxT(
"child.kicad_sch" ) );
194 m_screen->Append( childSheet );
204 m_screen->Append( busWire );
206 m_schematic->RefreshHierarchy();
209 m_schematic->ConnectionGraph()->Recalculate( sheets,
true );
218 const VECTOR2I newPos( sheetLeft, 8000000 );
220 pin->SetPosition( newPos );
222 pin->SetConnectivityDirty(
true );
228 m_schematic->ConnectionGraph()->Recalculate( sheets,
true );
232 BOOST_CHECK_MESSAGE( !
pin->IsConnectivityDirty(),
233 "Sheet pin connectivity still dirty after recalculation" );
235 pinConn =
pin->Connection( &rootPath );
238 BOOST_CHECK_MESSAGE( pinConn->
IsBus(),
"Sheet pin lost its bus connection after the move" );
250 m_screen->Append( busWire );
254 SCH_SHEET_LIST sheets = m_schematic->BuildSheetListSortedByPageNumbers();
255 m_schematic->ConnectionGraph()->Recalculate( sheets,
true );
257 const auto view = m_schematic->Connectivity().Connection( busWire->
m_Uuid, sheets[0].Path() );
static const ADVANCED_CFG & GetCfg()
Get the singleton instance's config, which is shared by all consumers.
COMMIT & Modify(EDA_ITEM *aItem, BASE_SCREEN *aScreen=nullptr, RECURSE_MODE aRecurse=RECURSE_MODE::NO_RECURSE)
Modify a given item in the model.
virtual void SetText(const wxString &aText)
Commit for the schematic and symbol editors.
void Push(const wxString &aMessage=wxEmptyString, int aCommitFlags=0) override
Execute the changes.
Each graphical item can have a SCH_CONNECTION describing its logical connection (to a bus or net).
const std::vector< std::shared_ptr< SCH_CONNECTION > > & Members() const
void SetConnectivityDirty(bool aDirty=true)
Set the dirty flag.
SCH_CONNECTION * Connection(const SCH_SHEET_PATH *aSheet=nullptr) const
Retrieve the connection associated with this object in the given sheet.
Segment description base class to describe items which have 2 end points (track, wire,...
void SetEndPoint(const VECTOR2I &aPosition)
void Append(SCH_ITEM *aItem, bool aUpdateLibSymbol=true)
void SetFileName(const wxString &aFileName)
Set the file name for this screen to aFileName.
A container for handling SCH_SHEET_PATH objects in a flattened hierarchy.
Handle access to a stack of flattened SCH_SHEET objects by way of a path for creating a flattened sch...
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.
void SetFileName(const wxString &aFilename)
void AddPin(SCH_SHEET_PIN *aSheetPin)
Add aSheetPin to the sheet.
void SetName(const wxString &aName)
void SetScreen(SCH_SCREEN *aScreen)
Set the SCH_SCREEN associated with this sheet to aScreen.
RAII class that sets an value at construction and resets it to the original value at destruction.
std::unique_ptr< SCHEMATIC > m_schematic
LABEL_BUS_CONNECTIVITY_FIXTURE()
BOOST_AUTO_TEST_SUITE(CadstarPartParser)
BOOST_CHECK(res.column_datatype(0)==SQL_NUMERIC||res.column_datatype(0)==SQL_DECIMAL)
BOOST_CHECK_EQUAL(std::any_cast< std::string >(rows[0].at("val")), "12345678901234567.89")
BOOST_REQUIRE_MESSAGE(dc.CacheTableInfo(table, { "part_id", "val" }), dc.GetLastError())
BOOST_REQUIRE(res.columns()==1)
BOOST_AUTO_TEST_SUITE_END()
BOOST_FIXTURE_TEST_CASE(LabelNetToBusConnectivity, LABEL_BUS_CONNECTIVITY_FIXTURE)
Test that changing a label from a net name to a bus name properly updates the connected bus wire's co...
VECTOR2< int32_t > VECTOR2I