Set currentSheet when exporting netlist.
Patch courtesy of Fernando Gomez.
This commit is contained in:
parent
9d2824ec5e
commit
5e21e94478
|
@ -222,6 +222,7 @@ XNODE* NETLIST_EXPORTER_XML::makeSymbols( unsigned aCtl )
|
|||
m_libParts.clear();
|
||||
|
||||
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.
|
||||
// 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];
|
||||
|
||||
// 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 )
|
||||
{
|
||||
return ( StrNumCmp( a->GetRef( &sheet, false ),
|
||||
|
@ -400,6 +405,8 @@ XNODE* NETLIST_EXPORTER_XML::makeSymbols( unsigned aCtl )
|
|||
}
|
||||
}
|
||||
|
||||
m_schematic->SetCurrentSheet( currentSheet );
|
||||
|
||||
return xcomps;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue