Set currentSheet when exporting netlist.
Patch courtesy of Fernando Gomez.
(cherry picked from commit 5e21e94478
)
This commit is contained in:
parent
a2ad9f8b10
commit
a11fd7a792
|
@ -222,6 +222,7 @@ XNODE* NETLIST_EXPORTER_XML::makeSymbols( unsigned aCtl )
|
||||||
m_libParts.clear();
|
m_libParts.clear();
|
||||||
|
|
||||||
SCH_SHEET_LIST sheetList = m_schematic->GetSheets();
|
SCH_SHEET_LIST sheetList = m_schematic->GetSheets();
|
||||||
|
SCH_SHEET_PATH currentSheet = m_schematic->CurrentSheet();
|
||||||
|
|
||||||
// Output is xml, so there is no reason to remove spaces from the field values.
|
// Output is xml, so there is no reason to remove spaces from the field values.
|
||||||
// And XML element names need not be translated to various languages.
|
// And XML element names need not be translated to various languages.
|
||||||
|
@ -230,6 +231,10 @@ XNODE* NETLIST_EXPORTER_XML::makeSymbols( unsigned aCtl )
|
||||||
{
|
{
|
||||||
SCH_SHEET_PATH sheet = sheetList[ii];
|
SCH_SHEET_PATH sheet = sheetList[ii];
|
||||||
|
|
||||||
|
// Change schematic CurrentSheet in each iteration to allow hierarchical
|
||||||
|
// resolution of text variables in sheet fields.
|
||||||
|
m_schematic->SetCurrentSheet( sheet );
|
||||||
|
|
||||||
auto cmp = [sheet]( SCH_SYMBOL* a, SCH_SYMBOL* b )
|
auto cmp = [sheet]( SCH_SYMBOL* a, SCH_SYMBOL* b )
|
||||||
{
|
{
|
||||||
return ( StrNumCmp( a->GetRef( &sheet, false ),
|
return ( StrNumCmp( a->GetRef( &sheet, false ),
|
||||||
|
@ -400,6 +405,8 @@ XNODE* NETLIST_EXPORTER_XML::makeSymbols( unsigned aCtl )
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
m_schematic->SetCurrentSheet( currentSheet );
|
||||||
|
|
||||||
return xcomps;
|
return xcomps;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue