ngspice has specific chars that are reserved
This replaces all known reserved characters with '_' Fixes https://gitlab.com/kicad/code/kicad/issues/13404
This commit is contained in:
parent
e315eb871c
commit
38a0b67e40
|
@ -44,7 +44,6 @@
|
|||
#include <string_utils.h>
|
||||
|
||||
#include <dialogs/html_message_box.h>
|
||||
#include <boost/algorithm/string/replace.hpp>
|
||||
#include <fmt/core.h>
|
||||
#include <paths.h>
|
||||
#include <pegtl.hpp>
|
||||
|
@ -320,9 +319,16 @@ void NETLIST_EXPORTER_SPICE::ConvertToSpiceMarkup( std::string& aNetName )
|
|||
|
||||
convertMarkup( root );
|
||||
|
||||
boost::replace_all( converted, "(", "_" );
|
||||
boost::replace_all( converted, ")", "_" );
|
||||
boost::replace_all( converted, " ", "_" );
|
||||
// Remove ngspice-disallowed chars
|
||||
std::replace( converted.begin(), converted.end(), '%', '_' );
|
||||
std::replace( converted.begin(), converted.end(), '(', '_' );
|
||||
std::replace( converted.begin(), converted.end(), ')', '_' );
|
||||
std::replace( converted.begin(), converted.end(), ',', '_' );
|
||||
std::replace( converted.begin(), converted.end(), '[', '_' );
|
||||
std::replace( converted.begin(), converted.end(), ']', '_' );
|
||||
std::replace( converted.begin(), converted.end(), '<', '_' );
|
||||
std::replace( converted.begin(), converted.end(), '>', '_' );
|
||||
std::replace( converted.begin(), converted.end(), '~', '_' );
|
||||
|
||||
aNetName = converted;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue