41#include <fmt/format.h>
45#include <wx/tokenzr.h>
52 std::string
name = aProposedName;
58 name = fmt::format(
"{}#{}", aProposedName, ii++ );
68 std::vector<EMBEDDED_FILES*> embeddedFilesStack;
70 m_libMgr.SetFilesStack( std::move( embeddedFilesStack ) );
122 aFormatter.
Print( 0,
".title KiCad schematic\n" );
128 aFormatter.
Print( 0,
".end\n" );
137 std::set<std::string> refNames;
139 wxString variant =
m_schematic->GetCurrentVariant();
152 cacheDir.AppendDir( wxT(
"ibis" ) );
154 if( !cacheDir.DirExists() )
156 cacheDir.Mkdir( wxS_DIR_DEFAULT, wxPATH_MKDIR_FULL );
158 if( !cacheDir.DirExists() )
160 wxLogTrace( wxT(
"IBIS_CACHE:" ),
161 wxT(
"%s:%s:%d\n * failed to create ibis cache directory '%s'" ),
162 __FILE__, __FUNCTION__, __LINE__, cacheDir.GetPath() );
169 wxString dirName = cacheDir.GetFullPath();
171 if( !dir.Open( dirName ) )
175 wxArrayString fileList;
176 wxString fileSpec = wxT(
"*.cache" );
178 thisFile.SetPath( dirName );
180 size_t numFilesFound = wxDir::GetAllFiles( dirName, &fileList, fileSpec );
182 for(
size_t ii = 0; ii < numFilesFound; ii++ )
185 thisFile.SetFullName( fileList[ii] );
186 wxRemoveFile( thisFile.GetFullPath() );
190 std::set<KIID_PATH> exportPaths;
193 exportPaths.insert( sheet.Path() );
204 std::vector<SCH_ITEM*> sheetItems;
207 sheetItems.push_back( item );
209 std::ranges::sort( sheetItems,
232 spiceItem.
fields.back().SetText( symbol->
GetRef( &sheet ) );
234 spiceItem.
fields.back().SetText( field.GetShownText( &sheet,
FOR_NETNAME, variant ) );
237 spiceItem.
fields.back().SetParent(
nullptr );
240 readRefName( sheet, *symbol, spiceItem, refNames );
241 readModel( sheet, *symbol, spiceItem, variant, aReporter );
247 m_items.push_back( std::move( spiceItem ) );
262 const bool literalSlash =
UnescapeString( aNetName->AfterLast(
'/' ) ).Contains(
'/' );
265 std::unique_ptr<MARKUP::NODE> root = markupParser.
Parse();
267 std::function<void(
const std::unique_ptr<MARKUP::NODE>&)> convertMarkup =
268 [&](
const std::unique_ptr<MARKUP::NODE>& aNode )
272 if( !aNode->is_root() )
274 if( aNode->isOverbar() )
279 else if( aNode->isSubscript() || aNode->isSuperscript() )
284 if( aNode->has_content() )
285 *aNetName += aNode->string();
288 for(
const std::unique_ptr<MARKUP::NODE>& child : aNode->children )
289 convertMarkup( child );
293 *aNetName = wxEmptyString;
294 convertMarkup( root );
297 aNetName->Replace(
'%',
'_' );
298 aNetName->Replace(
'(',
'_' );
299 aNetName->Replace(
')',
'_' );
300 aNetName->Replace(
',',
'_' );
301 aNetName->Replace(
'[',
'_' );
302 aNetName->Replace(
']',
'_' );
303 aNetName->Replace(
'<',
'_' );
304 aNetName->Replace(
'>',
'_' );
305 aNetName->Replace(
'~',
'_' );
306 aNetName->Replace(
' ',
'_' );
309 const wxString localName = aNetName->AfterLast(
'/' );
311 if( !literalSlash && ( localName == wxS(
"0" ) || localName.IsSameAs( wxS(
"gnd" ),
false ) )
312 && !aNetName->EndsWith( wxS(
"//" ) + localName ) )
314 aNetName->assign( localName );
319 if( aNetName->StartsWith( wxS(
"//" ) ) )
320 aNetName->Replace( wxS(
"//" ), wxS(
"/root/" ),
false );
327 return item->model->SpiceGenerator().ItemName( *item );
329 return wxEmptyString;
335 const std::string refName = aRefName.ToStdString();
336 const std::list<SPICE_ITEM>& spiceItems =
GetItems();
338 auto it = std::find_if( spiceItems.begin(), spiceItems.end(),
341 return item.refName == refName;
344 if( it != spiceItems.end() )
359 for(
SCH_ITEM* item : sheet.LastScreen()->Items() )
361 if( item->ResolveExcludedFromSim() )
372 wxStringTokenizer tokenizer(
text,
"\r\n", wxTOKEN_STRTOK );
373 bool foundDirective =
false;
376 [](
const wxString& line,
const wxString& dir )
378 return line == dir || line.StartsWith( dir + wxS(
" " ) );
381 while( tokenizer.HasMoreTokens() )
383 wxString line = tokenizer.GetNextToken().Upper();
385 if( line.StartsWith( wxT(
"." ) ) )
387 if( isDirective( line, wxS(
".AC" ) )
388 || isDirective( line, wxS(
".CONTROL" ) )
389 || isDirective( line, wxS(
".CSPARAM" ) )
390 || isDirective( line, wxS(
".DISTO" ) )
391 || isDirective( line, wxS(
".DC" ) )
392 || isDirective( line, wxS(
".ELSE" ) )
393 || isDirective( line, wxS(
".ELSEIF" ) )
394 || isDirective( line, wxS(
".END" ) )
395 || isDirective( line, wxS(
".ENDC" ) )
396 || isDirective( line, wxS(
".ENDIF" ) )
397 || isDirective( line, wxS(
".ENDS" ) )
398 || isDirective( line, wxS(
".FOUR" ) )
399 || isDirective( line, wxS(
".FUNC" ) )
400 || isDirective( line, wxS(
".GLOBAL" ) )
401 || isDirective( line, wxS(
".IC" ) )
402 || isDirective( line, wxS(
".IF" ) )
403 || isDirective( line, wxS(
".INCLUDE" ) )
404 || isDirective( line, wxS(
".LIB" ) )
405 || isDirective( line, wxS(
".MEAS" ) )
406 || isDirective( line, wxS(
".MODEL" ) )
407 || isDirective( line, wxS(
".NODESET" ) )
408 || isDirective( line, wxS(
".NOISE" ) )
409 || isDirective( line, wxS(
".OP" ) )
410 || isDirective( line, wxS(
".OPTIONS" ) )
411 || isDirective( line, wxS(
".PARAM" ) )
412 || isDirective( line, wxS(
".PLOT" ) )
413 || isDirective( line, wxS(
".PRINT" ) )
414 || isDirective( line, wxS(
".PROBE" ) )
415 || isDirective( line, wxS(
".PZ" ) )
416 || isDirective( line, wxS(
".SAVE" ) )
417 || isDirective( line, wxS(
".SENS" ) )
418 || isDirective( line, wxS(
".SP" ) )
419 || isDirective( line, wxS(
".SUBCKT" ) )
420 || isDirective( line, wxS(
".TEMP" ) )
421 || isDirective( line, wxS(
".TF" ) )
422 || isDirective( line, wxS(
".TITLE" ) )
423 || isDirective( line, wxS(
".TRAN" ) )
424 || isDirective( line, wxS(
".WIDTH" ) ) )
426 foundDirective =
true;
430 else if( line.StartsWith( wxT(
"K" ) ) )
433 wxStringTokenizer line_t( line,
" \t", wxTOKEN_STRTOK );
436 if( !line_t.HasMoreTokens() || !line_t.GetNextToken().StartsWith( wxT(
"K" ) ) )
440 if( !line_t.HasMoreTokens() || !line_t.GetNextToken().StartsWith( wxT(
"L" ) ) )
444 if( !line_t.HasMoreTokens() || !line_t.GetNextToken().StartsWith( wxT(
"L" ) ) )
449 if( line_t.HasMoreTokens() )
451 foundDirective =
true;
466 const wxString& aVariantName )
470 return wxEmptyString;
472 wxString ref = aSymbol.
GetRef( &aSheet );
473 std::vector<std::pair<wxString, wxString>> pinList;
474 std::set<wxString> pinNumbers;
477 auto parsePins = [&](
const wxString& aPins )
479 wxStringTokenizer tokenizer( aPins, wxS(
" \t\r\n" ), wxTOKEN_STRTOK );
481 while( tokenizer.HasMoreTokens() )
483 wxString token = tokenizer.GetNextToken();
484 int pos = token.Find( wxS(
'=' ) );
486 if( pos == wxNOT_FOUND )
489 wxString pinNumber = token.Left( pos );
490 wxString modelPin = token.Mid( pos + 1 );
493 if( pinNumbers.insert( pinNumber ).second )
494 pinList.emplace_back( pinNumber, modelPin );
500 parsePins( pinsField->GetShownText( &aSheet,
FOR_NETNAME, aVariantName ) );
509 if( other == &aSymbol )
512 if( other->
GetRef( &sheet ) != ref )
516 parsePins( pinsField->GetShownText( &sheet,
FOR_NETNAME, aVariantName ) );
522 if( pinList.empty() )
523 return wxEmptyString;
528 for(
const auto& [pinNumber, modelPin] : pinList )
530 if( !merged.IsEmpty() )
531 merged += wxS(
" " );
533 merged += pinNumber + wxS(
"=" ) + modelPin;
542 const wxString& aVariantName )
544 std::vector<UNIT_PIN_MAP> unitMaps;
549 wxString ref = aSymbol.
GetRef( &aSheet );
550 std::set<int> seenUnits;
564 if( !seenUnits.insert( aUnit.
GetUnit() ).second )
571 if( !map.
pins.empty() )
572 unitMaps.push_back( std::move( map ) );
577 parseUnit( aSymbol, aSheet );
585 if( other == &aSymbol )
588 if( other->
GetRef( &sheet ).CmpNoCase( ref ) != 0 )
591 parseUnit( *other, sheet );
597 std::sort( unitMaps.begin(), unitMaps.end(),
600 return lhs.unit < rhs.unit;
609 const wxString& aVariantName )
const
615 return field->GetShownText( &aUnitSheet,
FOR_NETNAME, aVariantName );
617 return wxEmptyString;
622 wxString value = read( aSymbol, aSheet );
626 wxString ref = aSymbol.
GetRef( &aSheet );
634 if( other == &aSymbol || other->
GetRef( &sheet ).CmpNoCase( ref ) != 0 )
637 value = read( *other, sheet );
639 if( !value.IsEmpty() )
650 SPICE_ITEM& aItem, std::set<std::string>& aRefNames )
654 [[maybe_unused]]
bool inserted = aRefNames.insert( aItem.
refName ).second;
655 wxASSERT_MSG( inserted, wxT(
"Duplicate refdes encountered; what happened to ReadyToNetlist()?" ) );
660 const wxString& aVariantName,
REPORTER& aReporter )
669 wxString mergedSimPins = repeat ? wxString()
673 aReporter, mergedSimPins );
683 if( libModel.
model.
GetType() != SIM_MODEL::TYPE::SUBCKT || libModel.
name.empty() )
685 THROW_IO_ERRORF(
_(
"Symbol '%s' uses repeat-per-unit decomposition, which requires a named "
686 "subcircuit model." ), aSymbol.
GetRef( &aSheet ) );
689 std::vector<UNIT_PIN_MAP> unitMaps =
collectUnitPinMaps( aSymbol, aSheet, aVariantName );
696 auto wrapper = std::make_unique<SIM_MODEL_MULTIUNIT>( libModel.
model, libModel.
name, unitMaps,
725 const std::vector<PIN_INFO>& aPins )
733 const std::vector<PIN_INFO>& aPins,
int& aNcCounter )
735 for(
const PIN_INFO& pinInfo : aPins )
739 aItem.
pinNetNames.push_back( netName.ToStdString() );
746 std::vector<std::string>& aModifiers )
753 tao::pegtl::string_input<> in( input,
"Sim.NodesFormat field" );
754 std::unique_ptr<tao::pegtl::parse_tree::node> root;
755 std::string singleNodeModifier;
763 for(
const auto& node : root->children )
768 aModifiers.back().append( node->string() );
772 singleNodeModifier.append( node->string() );
777 aModifiers.push_back( singleNodeModifier );
778 singleNodeModifier.erase( singleNodeModifier.begin(), singleNodeModifier.end() );
782 catch(
const tao::pegtl::parse_error& e )
789 std::vector<std::string> xspicePattern;
792 if( xspicePattern.empty() )
795 if( xspicePattern.size() != aItem.
pinNetNames.size() )
797 THROW_IO_ERRORF(
_(
"Error in parsing model '%s', wrong number of nodes '?' in Sim.NodesFormat compared "
798 "to connections" ), aItem.
refName );
803 for( std::string& pattern : xspicePattern )
806 const std::string netName =
" " + *itNetNames +
" ";
807 pattern.replace( pattern.find(
"?" ), 1, netName );
808 *itNetNames = pattern;
814 const wxString& aPath )
820 expandedPath.Replace(
'\\',
'/' );
829 if( fullPath.IsEmpty() )
831 wxLogError(
_(
"Could not find library file '%s'" ), expandedPath );
832 fullPath = expandedPath;
834 else if( wxFileName::GetPathSeparator() ==
'\\' )
837 fullPath.Replace(
'\\',
'/' );
842 fullPath = expandedPath;
845 aFormatter.
Print( 0,
".include \"%s\"\n",
TO_UTF8( fullPath ) );
864 std::set<std::string> emittedWrappers;
868 if( !item.model->IsEnabled() )
874 && !emittedWrappers.insert( item.modelName ).second )
879 aFormatter.
Print( 0,
"%s", item.model->SpiceGenerator().ModelLine( item ).c_str() );
888 if( !item.model->IsEnabled() )
891 aFormatter.
Print( 0,
"%s", item.model->SpiceGenerator().ItemLine( item ).c_str() );
900 aFormatter.
Print( 0,
".save all\n" );
903 aFormatter.
Print( 0,
".probe alli\n" );
911 std::string itemName = item.model->SpiceGenerator().ItemName( item );
913 if( ( item.model->GetPinCount() >= 2 ) && ( itemName.size() > 0 )
914 && ( itemName.c_str()[0] !=
'A' ) )
916 aFormatter.
Print( 0,
".probe p(%s)\n", itemName.c_str() );
922 [](
const wxString& candidate,
const wxString& dir )
924 return candidate == dir || candidate.StartsWith( dir + wxS(
" " ) );
929 bool simCommand =
false;
931 if( directive.StartsWith(
"." ) )
933 wxString candidate = directive.Upper();
935 simCommand = ( isSimCommand( candidate, wxS(
".AC" ) )
936 || isSimCommand( candidate, wxS(
".DC" ) )
937 || isSimCommand( candidate, wxS(
".TRAN" ) )
938 || isSimCommand( candidate, wxS(
".OP" ) )
939 || isSimCommand( candidate, wxS(
".DISTO" ) )
940 || isSimCommand( candidate, wxS(
".NOISE" ) )
941 || isSimCommand( candidate, wxS(
".PZ" ) )
942 || isSimCommand( candidate, wxS(
".SENS" ) )
943 || isSimCommand( candidate, wxS(
".TF" ) ) );
947 aFormatter.
Print( 0,
"%s\n",
UTF8( directive ).c_str() );
953 int& aNcCounter )
const
955 wxString netName = aNetName;
959 if( netName.IsEmpty() )
960 netName.Printf( wxS(
"NC-%d" ), aNcCounter++ );
970 std::erase_if( sheets,
Hold an error message and may be used when throwing exceptions containing meaningful error messages.
virtual const wxString What() const
A composite of Problem() and Where()
A minimalistic software bus for communications between various DLLs/DSOs (DSOs) within the same KiCad...
int GetUnitCount() const override
Instantiate the current locale within a scope in which you are expecting exceptions to be thrown.
std::unique_ptr< NODE > Parse()
std::unordered_set< std::string > m_names
std::string Generate(const std::string &aProposedName)
NETLIST_EXPORTER_BASE(SCHEMATIC *aSchematic, KIWAY *aKiway)
std::set< LIB_SYMBOL *, LIB_SYMBOL_LESS_THAN > m_libParts
unique library symbols used. LIB_SYMBOL items are sorted by names
UNIQUE_STRINGS m_referencesAlreadyFound
Used for "multiple symbols per package" symbols to avoid processing a lib symbol more than once.
SCH_SHEET_LIST m_exportSheets
SCH_SYMBOL * findNextSymbol(EDA_ITEM *aItem, const SCH_SHEET_PATH &aSheetPath, const EXPORT_EXCLUSION &aExcluded=nullptr)
Check if the given symbol should be processed for netlisting.
std::vector< PIN_INFO > CreatePinList(SCH_SYMBOL *aSymbol, const SCH_SHEET_PATH &aSheetPath)
Find a symbol from the DrawList and builds its pin list.
NETLIST_EXPORTER_SPICE(SCHEMATIC *aSchematic, KIWAY *aKiway)
void readPinNetNames(SCH_SYMBOL &aSymbol, SPICE_ITEM &aItem, const std::vector< PIN_INFO > &aPins, int &aNcCounter)
void writeModels(OUTPUTFORMATTER &aFormatter)
void writeIncludes(OUTPUTFORMATTER &aFormatter, unsigned aNetlistOptions)
std::list< SPICE_ITEM > m_items
Items representing schematic symbols in Spice world.
void getNodePattern(SPICE_ITEM &aItem, std::vector< std::string > &aModifiers)
static void ConvertToSpiceMarkup(wxString *aNetName)
Convert an escaped schematic net name to SPICE, preserving literal slashes when mapping ground names.
void ReadDirectives(unsigned aNetlistOptions)
@ OPTION_SAVE_ALL_CURRENTS
@ OPTION_SAVE_ALL_VOLTAGES
@ OPTION_SAVE_ALL_DISSIPATIONS
@ OPTION_ADJUST_INCLUDE_PATHS
@ OPTION_CUR_SHEET_AS_ROOT
SCH_SHEET_LIST BuildSheetList(unsigned aNetlistOptions=0) const
Return the paths of exported sheets (either all or the current one).
virtual wxString GenerateItemPinNetName(const wxString &aNetName, int &aNcCounter) const
std::set< wxString > m_nets
void readRefName(SCH_SHEET_PATH &aSheet, SCH_SYMBOL &aSymbol, SPICE_ITEM &aItem, std::set< std::string > &aRefNames)
wxString GetItemName(const wxString &aRefName) const
Return name of Spice device corresponding to a schematic symbol.
void writeItems(OUTPUTFORMATTER &aFormatter)
std::vector< wxString > m_directives
Spice directives found in the schematic sheet.
virtual void WriteHead(OUTPUTFORMATTER &aFormatter, unsigned aNetlistOptions)
Write the netlist head (title and so on).
bool writeNetlist(const wxString &aOutFileName, unsigned aNetlistOptions, REPORTER &aReporter) override
Write to specified output file.
void writeInclude(OUTPUTFORMATTER &aFormatter, unsigned aNetlistOptions, const wxString &aPath)
virtual void WriteDirectives(const wxString &aSimCommand, unsigned aSimOptions, OUTPUTFORMATTER &candidate) const
wxString collectMergedSimPins(SCH_SYMBOL &aSymbol, const SCH_SHEET_PATH &aSheet, const wxString &aVariantName)
Collect merged Sim.Pins from all units of a multi-unit symbol.
SIM_LIB_MGR m_libMgr
Holds libraries and models.
const SPICE_ITEM * FindItem(const wxString &aRefName) const
Find and return the item corresponding to aRefName.
virtual bool ReadSchematicAndLibraries(unsigned aNetlistOptions, REPORTER &aReporter)
Process the schematic and Spice libraries to create net mapping and a list of SPICE_ITEMs.
SIM_DECOMPOSITION getDecomposition(SCH_SYMBOL &aSymbol, const SCH_SHEET_PATH &aSheet, const wxString &aVariantName) const
Read and parse the Sim.Decomposition field from the primary unit.
bool DoWriteNetlist(const wxString &aSimCommand, unsigned aSimOptions, OUTPUTFORMATTER &aFormatter, REPORTER &aReporter)
Write the netlist in aFormatter.
void readPinNumbers(SCH_SYMBOL &aSymbol, SPICE_ITEM &aItem, const std::vector< PIN_INFO > &aPins)
const std::list< SPICE_ITEM > & GetItems() const
Return the list of items representing schematic symbols in the Spice world.
void readNodePattern(SPICE_ITEM &aItem)
std::set< wxString > m_rawIncludes
include directives found in symbols
void readModel(SCH_SHEET_PATH &aSheet, SCH_SYMBOL &aSymbol, SPICE_ITEM &aItem, const wxString &aVariantName, REPORTER &aReporter)
virtual void WriteTail(OUTPUTFORMATTER &aFormatter, unsigned aNetlistOptions)
Write the tail (.end).
NAME_GENERATOR m_modelNameGenerator
Generates unique model names.
std::vector< std::unique_ptr< SIM_MODEL_MULTIUNIT > > m_multiunitModels
Owns the synthesized repeat-per-unit wrappers referenced by m_items.
std::vector< UNIT_PIN_MAP > collectUnitPinMaps(SCH_SYMBOL &aSymbol, const SCH_SHEET_PATH &aSheet, const wxString &aVariantName)
Gather every unit's Sim.Pins mapping for a multi-unit symbol, one entry per unit.
static wxString GetUserCachePath()
Gets the stock (install) 3d viewer plugins path.
A pure virtual class used to derive REPORTER objects from.
virtual REPORTER & Report(const wxString &aText, SEVERITY aSeverity=RPT_SEVERITY_UNDEFINED)
Report a string with a given severity.
virtual bool HasMessageOfSeverity(int aSeverityMask) const
Returns true if the reporter has one or more messages matching the specified severity mask.
Holds all the data relating to one schematic.
EMBEDDED_FILES * GetEmbeddedFiles() override
wxString GetShownText(const SCH_SHEET_PATH *aPath, RESOLUTION_CONTEXT aContext, const wxString &aVariantName=wxEmptyString, int aDepth=0) const
Base class for any item which can be embedded within the SCHEMATIC container class,...
bool ResolveExcludedFromSim(const SCH_SHEET_PATH *aInstance=nullptr, const wxString &aVariantName=wxEmptyString) const
A container for handling SCH_SHEET_PATH objects in a flattened hierarchy.
Handle access to a stack of flattened SCH_SHEET objects by way of a path for creating a flattened sch...
bool IsContainedWithin(const SCH_SHEET_PATH &aSheetPathToTest) const
Check if this path is contained inside aSheetPathToTest.
bool GetExcludedFromSim() const
void GetFields(std::vector< SCH_FIELD * > &aVector, bool aVisibleOnly) const override
Populate a std::vector with SCH_FIELDs, sorted in ordinal order.
std::unique_ptr< LIB_SYMBOL > & GetLibSymbolRef()
const wxString GetRef(const SCH_SHEET_PATH *aSheet, bool aIncludeUnit=false) const override
SCH_FIELD * GetField(FIELD_T aFieldType)
Return a mandatory field in this symbol.
Wraps a resolved single-unit base model and presents it as one component-level SPICE device.
virtual bool requiresSpiceModelLine(const SPICE_ITEM &aItem) const
const SPICE_GENERATOR & SpiceGenerator() const
virtual std::vector< wxString > GetSpiceIncludes(const SPICE_ITEM &aItem, SCHEMATIC *aSchematic, REPORTER &aReporter) const
Return the external files this model must pull into the netlist as .include directives,...
virtual std::string ModelName(const SPICE_ITEM &aItem) const
An 8 bit string that is assuredly encoded in UTF8, and supplies special conversion support to and fro...
const wxString ExpandEnvVarSubstitutions(const wxString &aString, const PROJECT *aProject, bool aAllowEscapes)
Replace any environment variable & text variable references with their values.
This file is part of the common library.
wxString ResolveFile(const wxString &aFileName, const ENV_VAR_MAP *aEnvVars, const PROJECT *aProject)
Search the default paths trying to find one with the requested file.
Helper functions to substitute paths with environmental variables.
#define THROW_IO_ERRORF(msg,...)
must_if< error >::control< Rule > control
std::function< bool(const SCH_SYMBOL *, const SCH_SHEET_PATH &)> EXPORT_EXCLUSION
An abstract class used for the netlist exporters that Eeschema supports.
PGM_BASE & Pgm()
The global program "get" accessor.
wxString GetFieldValue(const std::vector< SCH_FIELD > *aFields, FIELD_T aFieldType)
#define SIM_NODES_FORMAT_FIELD
#define SIM_DECOMPOSITION_FIELD
std::vector< std::pair< wxString, wxString > > ParseSimPinsTokens(const wxString &aPins, const wxString &aRef)
Parse one unit's Sim.Pins text into (symbolPinNumber -> modelPinName) pairs, preserving the written o...
std::vector< FAB_LAYER_COLOR > dummy
wxString UnescapeString(const wxString &aSource)
#define TO_UTF8(wxstring)
Convert a wxString to a UTF8 encoded C string for all wxWidgets build modes.
Per-component decomposition descriptor stored in the Sim.Decomposition field.
static SIM_DECOMPOSITION Parse(const wxString &aField)
std::vector< wxString > sharedModelPins
Notes: spaces are allowed everywhere in any number ~ can only be before ?
std::vector< SCH_FIELD > fields
std::vector< std::string > pinNetNames
std::string baseModelName
std::vector< std::string > pinNumbers
One functional unit's pin map, gathered from its Sim.Pins field.
std::vector< std::pair< wxString, wxString > > pins
@ USER
The field ID hasn't been set yet; field is invalid.
@ REFERENCE
Field Reference of part, i.e. "IC21".
wxString result
Test unit parsing edge cases and error handling.