Sim spice: fix unescaped netnames in spice netlist and simulator dialogs.
Net names in eeschema that include '/' are escaped ('/' replaced by "{slash}") Escaped netnames are only for internal use, and must be unescaped in spice netlist and dialogs.
This commit is contained in:
parent
838e8aef04
commit
bc27b0ed5f
|
@ -54,8 +54,11 @@ bool DIALOG_SIGNAL_LIST::TransferDataToWindow()
|
|||
// Voltage list
|
||||
for( const auto& net : m_exporter->GetNetIndexMap() )
|
||||
{
|
||||
if( net.first != "GND" && net.first != "0" )
|
||||
m_signals->Append( wxString::Format( "V(%s)", net.first ) );
|
||||
// netnames are escaped (can contain "{slash}" for '/') Unscape them:
|
||||
wxString netname = UnescapeString( net.first );
|
||||
|
||||
if( netname != "GND" && netname != "0" )
|
||||
m_signals->Append( wxString::Format( "V(%s)", netname ) );
|
||||
}
|
||||
|
||||
auto simType = m_exporter->GetSimType();
|
||||
|
|
|
@ -150,6 +150,9 @@ bool NETLIST_EXPORTER_PSPICE::Format( OUTPUTFORMATTER* aFormatter, unsigned aCtl
|
|||
// Replace parenthesis with underscore to prevent parse issues with simulators
|
||||
ReplaceForbiddenChars( netName );
|
||||
|
||||
// unescape net names that contain a escaped sequence ("{slash}"):
|
||||
netName = UnescapeString( netName );
|
||||
|
||||
// Add quotes to nets containing slashes. This isn't added to ReplaceForbidenChars
|
||||
// because this is only necessary for file writing; nets with slashes can be
|
||||
// handled by ngspice after loading.
|
||||
|
|
|
@ -36,13 +36,15 @@ wxString NETLIST_EXPORTER_PSPICE_SIM::GetSpiceVector( const wxString& aName, SIM
|
|||
|
||||
if( aType & SPT_VOLTAGE )
|
||||
{
|
||||
// netnames are escaped (can contain "{slash}" for '/') Unscape them:
|
||||
wxString spicenet = UnescapeString( aName );
|
||||
|
||||
// Spice netlist netnames does not accept some chars, whicyh are replaced
|
||||
// by eeschema netlist generator.
|
||||
// Replace these forbidden chars to find the actual spice net name
|
||||
wxString spicenet = aName;
|
||||
NETLIST_EXPORTER_PSPICE::ReplaceForbiddenChars( spicenet );
|
||||
|
||||
return wxString::Format( "V(%s)", spicenet.GetData() );
|
||||
return wxString::Format( "V(%s)", spicenet );
|
||||
}
|
||||
|
||||
else if( aType & SPT_CURRENT )
|
||||
|
|
Loading…
Reference in New Issue