mirror of
https://gitlab.com/kicad/code/kicad.git
synced 2025-09-14 10:13:19 +02:00
Eagle sheet descriptions are elements, not attributes.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20957 (cherry picked from commit aaa0e74311173506a4827b412dad9b1cd8d17e71)
This commit is contained in:
parent
fde3087324
commit
719512183d
@ -1917,11 +1917,13 @@ ESHEET::ESHEET( wxXmlNode* aSheet, IO_BASE* aIo ) :
|
||||
/*
|
||||
* <!ELEMENT sheet (description?, plain?, moduleinsts?, instances?, busses?, nets?)>
|
||||
*/
|
||||
description = parseOptionalAttribute<wxString>( aSheet, "description" );
|
||||
|
||||
for( wxXmlNode* child = aSheet->GetChildren(); child; child = child->GetNext() )
|
||||
{
|
||||
if( child->GetName() == "plain" )
|
||||
if( child->GetName() == "description" )
|
||||
{
|
||||
description = std::make_optional<EDESCRIPTION>( child, aIo );
|
||||
}
|
||||
else if( child->GetName() == "plain" )
|
||||
{
|
||||
plain = std::make_unique<EPLAIN>( child, aIo );
|
||||
}
|
||||
@ -1932,8 +1934,7 @@ ESHEET::ESHEET( wxXmlNode* aSheet, IO_BASE* aIo ) :
|
||||
{
|
||||
if( moduleinst->GetName() == "moduleinst" )
|
||||
{
|
||||
std::unique_ptr<EMODULEINST> inst = std::make_unique<EMODULEINST>( moduleinst,
|
||||
aIo );
|
||||
std::unique_ptr<EMODULEINST> inst = std::make_unique<EMODULEINST>( moduleinst, aIo );
|
||||
moduleinsts[ inst->name ] = std::move( inst );
|
||||
}
|
||||
}
|
||||
@ -1942,8 +1943,7 @@ ESHEET::ESHEET( wxXmlNode* aSheet, IO_BASE* aIo ) :
|
||||
}
|
||||
else if( child->GetName() == "instances" )
|
||||
{
|
||||
for( wxXmlNode* instance = child->GetChildren(); instance;
|
||||
instance = instance->GetNext() )
|
||||
for( wxXmlNode* instance = child->GetChildren(); instance; instance = instance->GetNext() )
|
||||
{
|
||||
if( instance->GetName() == "instance" )
|
||||
instances.emplace_back( std::make_unique<EINSTANCE>( instance, aIo ) );
|
||||
|
@ -1898,7 +1898,7 @@ struct ESHEET : public EAGLE_BASE
|
||||
* <!ELEMENT sheet (description?, plain?, moduleinsts?, instances?, busses?, nets?)>
|
||||
*/
|
||||
|
||||
opt_wxString description;
|
||||
std::optional<EDESCRIPTION> description;
|
||||
std::unique_ptr<EPLAIN> plain;
|
||||
std::map<wxString, std::unique_ptr<EMODULEINST>> moduleinsts;
|
||||
std::vector<std::unique_ptr<EINSTANCE>> instances;
|
||||
@ -1926,7 +1926,6 @@ struct EMODULE : public EAGLE_BASE
|
||||
ECOORD dy;
|
||||
|
||||
std::optional<EDESCRIPTION> description;
|
||||
|
||||
std::map<wxString, std::unique_ptr<EPORT>> ports;
|
||||
std::map<wxString, std::unique_ptr<EVARIANTDEF>> variantdefs;
|
||||
std::map<wxString, std::unique_ptr<ESCHEMATIC_GROUP>> groups;
|
||||
|
@ -825,6 +825,10 @@ void SCH_IO_EAGLE::loadSheet( const std::unique_ptr<ESHEET>& aSheet )
|
||||
fn.SetExt( FILEEXT::KiCadSchematicFileExtension );
|
||||
|
||||
filename = wxString::Format( wxT( "%s_%d" ), m_filename.GetName(), m_sheetIndex );
|
||||
|
||||
if( aSheet->description )
|
||||
sheet->SetName( aSheet->description.value().text );
|
||||
else
|
||||
sheet->SetName( filename );
|
||||
|
||||
ReplaceIllegalFileNameChars( &filename );
|
||||
|
Loading…
x
Reference in New Issue
Block a user