30#include <wx/xml/xml.h>
31#include <wx/filename.h>
40 std::unique_ptr<SCHEMATIC> schematic;
42 const auto sheet = schematic->Hierarchy().front();
48 auto* candidate =
static_cast<SCH_SYMBOL*
>( item );
50 if( !candidate->IsPower() && !candidate->GetRef( &sheet ).StartsWith(
"#" ) )
61 screen.
Remove( symbol,
false );
62 symbol->
SetPosition( area->GetBoundingBox().Centre() );
64 std::unordered_set<SCH_SCREEN*> screens{ &screen };
69 symbol->
SetDNP(
false, &sheet );
72 const wxString reference = symbol->
GetRef( &sheet );
73 const wxString
path = wxFileName::CreateTempFileName(
74 wxFileName::GetTempDir() +
"/connectivity-export-areas-" );
76 auto exportDnp = [&]()
80 wxXmlDocument document;
85 for( wxXmlNode* section = document.GetRoot()->GetChildren(); section; section = section->GetNext() )
87 if( section->GetName() !=
"components" )
90 for( wxXmlNode* component = section->GetChildren(); component; component = component->GetNext() )
92 if( component->GetAttribute(
"ref" ) != reference )
97 for( wxXmlNode* property = component->GetChildren(); property; property = property->GetNext() )
98 dnp |=
property->GetName() ==
"property" &&
property->GetAttribute(
"name" ) ==
"dnp";
106 BOOST_CHECK( !exportDnp() );
109 BOOST_CHECK( exportDnp() );
EE_TYPE OfType(KICAD_T aType) const
bool WriteNetlist(const wxString &aOutFileName, unsigned aNetlistOptions, REPORTER &aReporter)
Write to specified output file.
Generate a generic XML based netlist file.
Base class for any item which can be embedded within the SCHEMATIC container class,...
const std::unordered_set< SCH_RULE_AREA * > & GetRuleAreaCache() const
Get the cache of rule areas enclosing this item.
bool ResolveDNP(const SCH_SHEET_PATH *aInstance=nullptr, const wxString &aVariantName=wxEmptyString) const
static std::vector< std::pair< SCH_RULE_AREA *, SCH_SCREEN * > > UpdateRuleAreasInScreens(std::unordered_set< SCH_SCREEN * > &screens, KIGFX::SCH_VIEW *view)
Update all rule area connectvity / caches in the given sheet paths.
void Append(SCH_ITEM *aItem, bool aUpdateLibSymbol=true)
EE_RTREE & Items()
Get the full RTree, usually for iterating.
bool Remove(SCH_ITEM *aItem, bool aUpdateLibSymbol=true)
Remove aItem from the schematic associated with this screen.
virtual void SetDNP(bool aEnable, const SCH_SHEET_PATH *aInstance=nullptr, const wxString &aVariantName=wxEmptyString) override
void SetPosition(const VECTOR2I &aPosition) override
VECTOR2I GetPosition() const override
const wxString GetRef(const SCH_SHEET_PATH *aSheet, bool aIncludeUnit=false) const override
A wrapper for reporting to a wxString object.
void LoadSchematic(SETTINGS_MANAGER &aSettingsManager, const wxString &aRelPath, std::unique_ptr< SCHEMATIC > &aSchematic)
BOOST_AUTO_TEST_CASE(HorizontalAlignment)
BOOST_AUTO_TEST_SUITE(CadstarPartParser)
BOOST_REQUIRE(intersection.has_value()==c.ExpectedIntersection.has_value())
BOOST_AUTO_TEST_SUITE_END()
IbisParser parser & reporter
VECTOR2< int32_t > VECTOR2I