KiCad PCB EDA Suite
Loading...
Searching...
No Matches
sch_io_http_lib.cpp
Go to the documentation of this file.
1/*
2 * This program source code file is part of KiCad, a free EDA CAD application.
3 *
4 * Copyright (C) 2023 Andre F. K. Iwers <[email protected]>
5 * Copyright The KiCad Developers, see AUTHORS.txt for contributors.
6 *
7 * This program is free software: you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License as published by the
9 * Free Software Foundation, either version 3 of the License, or (at your
10 * option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program. If not, see <https://www.gnu.org/licenses/>.
19 */
20
21
22#include <wx/log.h>
23#include <wx/tokenzr.h>
24
25#include <fmt.h>
26#include <lib_symbol.h>
27
30#include "sch_io_http_lib.h"
31#include <ki_exception.h>
32
33
35 SCH_IO( wxS( "HTTP library" ) ),
36 m_adapter( nullptr )
37{
38}
39
40
41void SCH_IO_HTTP_LIB::EnumerateSymbolLib( wxArrayString& aSymbolNameList, const wxString& aLibraryPath,
42 const std::map<std::string, UTF8>* aProperties )
43{
44 wxCHECK_RET( m_adapter, "HTTP plugin missing library manager adapter handle!" );
45 ensureSettings( aLibraryPath );
47
48 if( !m_conn )
50
51 // The name list drives the library tree and only needs part names, which the category
52 // listing already provides. Avoid the per-part detail fetch done by the full enumeration.
53 for( const HTTP_LIB_CATEGORY& category : m_conn->getCategories() )
54 {
55 syncCacheIfStale( category );
56
57 for( const HTTP_LIB_PART& part : m_cachedCategories[category.id].cachedParts )
58 aSymbolNameList.Add( part.name );
59 }
60}
61
62
63void SCH_IO_HTTP_LIB::EnumerateSymbolLib( std::vector<LIB_SYMBOL*>& aSymbolList, const wxString& aLibraryPath,
64 const std::map<std::string, UTF8>* aProperties )
65{
66 wxCHECK_RET( m_adapter, "HTTP plugin missing library manager adapter handle!" );
67 ensureSettings( aLibraryPath );
69
70 if( !m_conn )
72
73 bool powerSymbolsOnly = ( aProperties && aProperties->contains( SYMBOL_LIBRARY_ADAPTER::PropPowerSymsOnly ) );
74
75 for( const HTTP_LIB_CATEGORY& category : m_conn->getCategories() )
76 {
77 syncCacheIfStale( category );
78
79 for( HTTP_LIB_PART& part : m_cachedCategories[category.id].cachedParts )
80 {
81 // The category listing may omit fields, so the chooser would show blank columns
82 // until each part is selected individually. Back-fill from the per-part endpoint.
83 if( !part.detailsLoaded )
84 {
85 HTTP_LIB_PART fullPart;
86
87 if( m_conn->SelectOne( part.id, fullPart ) )
88 {
89 // The listing name keys m_cache for LoadSymbol; keep it even if the detail
90 // record reports a different (or missing) name.
91 fullPart.id = part.id;
92 fullPart.name = part.name;
93 part = std::move( fullPart );
94 }
95 }
96
97 wxString libIDString( part.name );
98
99 LIB_SYMBOL* symbol = loadSymbolFromPart( aLibraryPath, libIDString, category, part );
100
101 if( symbol && ( !powerSymbolsOnly || symbol->IsPower() ) )
102 aSymbolList.emplace_back( symbol );
103 }
104 }
105}
106
107
108LIB_SYMBOL* SCH_IO_HTTP_LIB::LoadSymbol( const wxString& aLibraryPath, const wxString& aAliasName,
109 const std::map<std::string, UTF8>* aProperties )
110{
111 wxCHECK_MSG( m_adapter, nullptr, "HTTP plugin missing library manager adapter handle!" );
112 ensureSettings( aLibraryPath );
114
115 if( !m_conn )
117
118 std::string part_id = "";
119
120 std::string partName( aAliasName.ToUTF8() );
121
122 const HTTP_LIB_CATEGORY* foundCategory = nullptr;
124
125 std::vector<HTTP_LIB_CATEGORY> categories = m_conn->getCategories();
126
127 if( m_conn->GetCachedParts().empty() )
128 syncCache();
129
130 std::tuple relations = m_conn->GetCachedParts()[partName];
131 std::string associatedCatID = std::get<1>( relations );
132
133 // get the matching category
134 for( const HTTP_LIB_CATEGORY& categoryIter : categories )
135 {
136 if( categoryIter.id == associatedCatID )
137 {
138 foundCategory = &categoryIter;
139 break;
140 }
141 }
142
143 // return Null if no category was found. This should never happen
144 if( foundCategory == nullptr )
145 {
146 wxLogTrace( traceHTTPLib, wxT( "loadSymbol: no category found for %s" ), partName );
147 return nullptr;
148 }
149
150 // get the matching query ID
151 for( const HTTP_LIB_PART& part : m_cachedCategories[foundCategory->id].cachedParts )
152 {
153 if( part.id == std::get<0>( relations ) )
154 {
155 part_id = part.id;
156 break;
157 }
158 }
159
160 if( m_conn->SelectOne( part_id, result ) )
161 {
162 wxLogTrace( traceHTTPLib, wxT( "LoadSymbol: SelectOne (%s) found in %s" ), part_id, foundCategory->name );
163 }
164 else
165 {
166 wxLogTrace( traceHTTPLib, wxT( "LoadSymbol: SelectOne (%s) failed for category %s" ), part_id,
167 foundCategory->name );
168
170 }
171
172 wxCHECK( foundCategory, nullptr );
173
174 return loadSymbolFromPart( aLibraryPath, aAliasName, *foundCategory, result );
175}
176
177
178void SCH_IO_HTTP_LIB::GetSubLibraryNames( std::vector<wxString>& aNames )
179{
180 aNames.clear();
181
182 ensureSettings( wxEmptyString );
183 connect();
184
185 // connect() leaves m_conn null when the endpoint is unreachable so a network loss
186 // degrades to an empty result instead of a null dereference while building the tree.
187 if( !m_conn )
188 return;
189
190 std::set<wxString> categoryNames;
191
192 for( const HTTP_LIB_CATEGORY& categoryIter : m_conn->getCategories() )
193 {
194 if( categoryNames.count( categoryIter.name ) )
195 continue;
196
197 aNames.emplace_back( categoryIter.name );
198 categoryNames.insert( categoryIter.name );
199 }
200}
201
202
203wxString SCH_IO_HTTP_LIB::GetSubLibraryDescription( const wxString& aName )
204{
205 ensureSettings( wxEmptyString );
206 connect();
207
208 if( !m_conn )
209 return wxEmptyString;
210
211 return m_conn->getCategoryDescription( std::string( aName.mb_str() ) );
212}
213
214
215void SCH_IO_HTTP_LIB::GetAvailableSymbolFields( std::vector<wxString>& aNames )
216{
217 // TODO: Implement this sometime; This is currently broken...
218 std::copy( m_customFields.begin(), m_customFields.end(), std::back_inserter( aNames ) );
219}
220
221
222void SCH_IO_HTTP_LIB::GetDefaultSymbolFields( std::vector<wxString>& aNames )
223{
224 std::copy( m_defaultShownFields.begin(), m_defaultShownFields.end(), std::back_inserter( aNames ) );
225}
226
227
228void SCH_IO_HTTP_LIB::ensureSettings( const wxString& aSettingsPath )
229{
230 auto tryLoad =
231 [&]()
232 {
233 if( !m_settings->LoadFromFile() )
234 THROW_IO_ERRORF( _( "HTTP library settings file %s missing or invalid." ), aSettingsPath );
235
236 if( m_settings->m_Source.api_version.empty() )
237 {
238 THROW_IO_ERRORF( _( "HTTP library settings file %s is missing the API version number." ),
239 aSettingsPath );
240 }
241
242 if( m_settings->getSupportedAPIVersion() != m_settings->m_Source.api_version )
243 {
244 THROW_IO_ERRORF( _( "HTTP library settings file %s uses API version %s, but KiCad requires "
245 "version %s." ),
246 aSettingsPath,
247 m_settings->m_Source.api_version,
248 m_settings->getSupportedAPIVersion() );
249 }
250
251 if( m_settings->m_Source.root_url.empty() )
252 THROW_IO_ERRORF( _( "HTTP library settings file %s is missing the root URL." ), aSettingsPath );
253
254 // map lib source type
255 m_settings->m_Source.type = m_settings->get_HTTP_LIB_SOURCE_TYPE();
256
257 if( m_settings->m_Source.type == HTTP_LIB_SOURCE_TYPE::INVALID )
258 THROW_IO_ERRORF( _( "HTTP library settings file %s has invalid library type." ), aSettingsPath );
259
260 // make sure that the root url finishes with a forward slash
261 if( m_settings->m_Source.root_url.at( m_settings->m_Source.root_url.length() - 1 ) != '/' )
262 m_settings->m_Source.root_url += "/";
263
264 // Append api version to root URL
265 m_settings->m_Source.root_url += m_settings->m_Source.api_version + "/";
266 };
267
268 if( !m_settings && !aSettingsPath.IsEmpty() )
269 {
270 std::string path( aSettingsPath.ToUTF8() );
271 m_settings = std::make_unique<HTTP_LIB_SETTINGS>( path );
272
273 m_settings->SetReadOnly( true );
274
275 tryLoad();
276 }
277 else if( m_settings )
278 {
279 // If we have valid settings but no connection yet; reload settings in case user is editing
280 tryLoad();
281 }
282 else if( !m_settings )
283 {
284 wxLogTrace( traceHTTPLib, wxT( "ensureSettings: no settings available!" ) );
285 }
286}
287
288
290{
291 wxCHECK_RET( m_settings, "Call ensureSettings before ensureConnection!" );
292
293 connect();
294
295 if( !m_conn || !m_conn->IsValidEndpoint() )
296 THROW_IO_ERRORF( _( "Could not connect to %s. Errors: %s" ), m_settings->m_Source.root_url, m_lastError );
297}
298
299
301{
302 wxCHECK_RET( m_settings, "Call ensureSettings before connect()!" );
303
304 if( !m_conn )
305 {
306 m_conn = std::make_unique<HTTP_LIB_CONNECTION>( m_settings->m_Source, true );
307
308 if( !m_conn->IsValidEndpoint() )
309 {
310 m_lastError = m_conn->GetLastError();
311
312 // Make sure we release pointer so we are able to query API again next time
313 m_conn.reset();
314
315 return;
316 }
317 }
318}
319
320
322{
323 for( const HTTP_LIB_CATEGORY& category : m_conn->getCategories() )
324 syncCache( category );
325}
326
327
329{
330 auto it = m_cachedCategories.find( category.id );
331
332 if( it != m_cachedCategories.end()
333 && std::difftime( std::time( nullptr ), it->second.lastCached )
334 < m_settings->m_Source.timeout_categories )
335 {
336 return;
337 }
338
339 syncCache( category );
340}
341
342
344{
345 std::vector<HTTP_LIB_PART> found_parts;
346
347 if( !m_conn->SelectAll( category, found_parts ) )
348 {
349 if( !m_conn->GetLastError().empty() )
350 {
351 THROW_IO_ERRORF( _( "Error retrieving data from HTTP library %s: %s" ),
352 category.name, m_conn->GetLastError() );
353 }
354
355 return;
356 }
357
358 // remove cached parts
359 m_cachedCategories[category.id].cachedParts.clear();
360
361 // Copy newly cached data across
362 m_cachedCategories[category.id].cachedParts = found_parts;
363 m_cachedCategories[category.id].lastCached = std::time( nullptr );
364}
365
366
367LIB_SYMBOL* SCH_IO_HTTP_LIB::loadSymbolFromPart( const wxString& aLibraryPath, const wxString& aSymbolName,
368 const HTTP_LIB_CATEGORY& aCategory, const HTTP_LIB_PART& aPart )
369{
370 LIB_SYMBOL* symbol = nullptr;
371 LIB_SYMBOL* originalSymbol = nullptr;
372 LIB_ID symbolId;
373
374 std::string symbolIdStr = aPart.symbolIdStr;
375
376 // Extract library nickname from the library path (e.g., "/path/to/W5.kicad_httplib" -> "W5")
377 wxFileName libFileName( aLibraryPath );
378 wxString libNickname = libFileName.GetName();
379
380 // Get or Create the symbol using the found symbol
381 if( !symbolIdStr.empty() )
382 {
383 symbolId.Parse( symbolIdStr );
384
385 if( symbolId.IsValid() )
386 originalSymbol = m_adapter->LoadSymbol( symbolId );
387
388 if( originalSymbol )
389 {
390 wxLogTrace( traceHTTPLib, wxT( "loadSymbolFromPart: found original symbol '%s'" ), symbolIdStr );
391
392 symbol = originalSymbol->Duplicate();
393 symbol->SetSourceLibId( symbolId );
394 symbol->SetName( aSymbolName );
395
396 LIB_ID libId = symbol->GetLibId();
397 libId.SetLibNickname( libNickname );
398 libId.SetSubLibraryName( aCategory.name );
399 symbol->SetLibId( libId );
400 }
401 else if( !symbolId.IsValid() )
402 {
403 wxLogTrace( traceHTTPLib, wxT( "loadSymbolFromPart: source symbol id '%s' is invalid, "
404 "will create empty symbol" ), symbolIdStr );
405 }
406 else
407 {
408 wxLogTrace( traceHTTPLib, wxT( "loadSymbolFromPart: source symbol '%s' not found, "
409 "will create empty symbol" ), symbolIdStr );
410 }
411 }
412
413 if( !symbol )
414 {
415 // Actual symbol not found: return metadata only; error will be
416 // indicated in the symbol chooser
417 symbol = new LIB_SYMBOL( aSymbolName );
418
419 LIB_ID libId = symbol->GetLibId();
420 libId.SetLibNickname( libNickname );
421 libId.SetSubLibraryName( aCategory.name );
422 symbol->SetLibId( libId );
423 }
424
425 symbol->SetExcludedFromBOM( aPart.exclude_from_bom );
427 symbol->SetExcludedFromSim( aPart.exclude_from_sim );
428
429 wxArrayString fp_filters;
430
431 for( auto& [fieldName, fieldProperties] : aPart.fields )
432 {
433 wxString lowerFieldName = wxString( fieldName ).Lower();
434
435 if( lowerFieldName == footprint_field )
436 {
437 SCH_FIELD* field = &symbol->GetFootprintField();
438 wxStringTokenizer tokenizer( std::get<0>( fieldProperties ), ";\t\r\n", wxTOKEN_STRTOK );
439
440 while( tokenizer.HasMoreTokens() )
441 fp_filters.Add( tokenizer.GetNextToken() );
442
443 if( fp_filters.size() > 0 )
444 field->SetText( fp_filters[0] );
445
446 field->SetVisible( std::get<1>( fieldProperties ) );
447 }
448 else if( lowerFieldName == description_field )
449 {
450 SCH_FIELD* field = &symbol->GetDescriptionField();
451 field->SetText( std::get<0>( fieldProperties ) );
452 field->SetVisible( std::get<1>( fieldProperties ) );
453 }
454 else if( lowerFieldName == value_field )
455 {
456 SCH_FIELD* field = &symbol->GetValueField();
457 field->SetText( std::get<0>( fieldProperties ) );
458 field->SetVisible( std::get<1>( fieldProperties ) );
459 }
460 else if( lowerFieldName == datasheet_field )
461 {
462 SCH_FIELD* field = &symbol->GetDatasheetField();
463 field->SetText( std::get<0>( fieldProperties ) );
464 field->SetVisible( std::get<1>( fieldProperties ) );
465 }
466 else if( lowerFieldName == reference_field )
467 {
468 SCH_FIELD* field = &symbol->GetReferenceField();
469 field->SetText( std::get<0>( fieldProperties ) );
470 field->SetVisible( std::get<1>( fieldProperties ) );
471 }
472 else if( lowerFieldName == keywords_field )
473 {
474 symbol->SetKeyWords( std::get<0>( fieldProperties ) );
475 }
476 else
477 {
478 // Check if field exists, if so replace Text and adjust visiblity.
479 //
480 // This proves useful in situations where, for instance, an individual requires a particular value, such as
481 // the material type showcased at a specific position for a capacitor. Subsequently, this value could be defined
482 // in the symbol itself and then, potentially, be modified by the HTTP library as necessary.
483 SCH_FIELD* field = symbol->GetField( fieldName );
484
485 if( field != nullptr )
486 {
487 // adjust values accordingly
488 field->SetText( std::get<0>( fieldProperties ) );
489 field->SetVisible( std::get<1>( fieldProperties ) );
490 }
491 else
492 {
493 // Generic fields
494 field = new SCH_FIELD( symbol, FIELD_T::USER );
495 field->SetName( fieldName );
496
497 field->SetText( std::get<0>( fieldProperties ) );
498 field->SetVisible( std::get<1>( fieldProperties ) );
499 symbol->AddField( field );
500
501 m_customFields.insert( fieldName );
502 }
503 }
504 }
505
506 symbol->SetDescription( aPart.desc );
507 symbol->SetKeyWords( aPart.keywords );
508
509 for( const std::string& filter : aPart.fp_filters )
510 fp_filters.push_back( filter );
511
512 symbol->SetFPFilters( fp_filters );
513
514 // Pin-to-pad maps (issue #2282): attach non-destructively. Prefer the spec-form named maps +
515 // associations when the payload supplies them; otherwise fall back to the legacy flat form for
516 // one release, bound to the symbol's concrete Footprint field (fp_filters may carry globs).
517 if( !aPart.named_pin_maps.IsEmpty() || !aPart.associated_footprints.empty() )
518 {
519 symbol->SetPinMaps( aPart.named_pin_maps );
521 }
522 else
523 {
524 const wxString assignedFootprint = symbol->GetFootprintField().GetText();
525
526 if( !aPart.pin_map.empty() && !assignedFootprint.IsEmpty() )
527 {
528 const wxString mapName = wxS( "HTTP Library" );
529
530 symbol->PinMaps().AddOrReplace( MakeLegacyPinMap( mapName, aPart.pin_map ) );
531
532 LIB_ID fpId;
533 fpId.Parse( assignedFootprint );
534 symbol->SetAssociatedFootprints( { { fpId, mapName } } );
535 }
536 }
537
538 return symbol;
539}
540
541void SCH_IO_HTTP_LIB::SaveSymbol( const wxString& aLibraryPath, const LIB_SYMBOL* aSymbol,
542 const std::map<std::string, UTF8>* aProperties )
543{
544 // TODO: Implement this sometime;
545}
virtual void SetVisible(bool aVisible)
Definition eda_text.cpp:381
A logical library item identifier and consists of various portions much like a URI.
Definition lib_id.h:45
int Parse(const UTF8 &aId, bool aFix=false)
Parse LIB_ID with the information from aId.
Definition lib_id.cpp:65
bool IsValid() const
Check if this LID_ID is valid.
Definition lib_id.h:168
int SetLibNickname(const UTF8 &aLibNickname)
Override the logical library name portion of the LIB_ID to aLibNickname.
Definition lib_id.cpp:113
void SetSubLibraryName(const UTF8 &aName)
Definition lib_id.h:127
Define a library symbol object.
Definition lib_symbol.h:114
SCH_FIELD & GetDescriptionField()
Return reference to the description field.
Definition lib_symbol.h:444
const LIB_ID & GetLibId() const override
Definition lib_symbol.h:183
bool IsPower() const override
void SetSourceLibId(const LIB_ID &aLibId)
Definition lib_symbol.h:187
SCH_FIELD & GetDatasheetField()
Return reference to the datasheet field.
Definition lib_symbol.h:440
virtual LIB_SYMBOL * Duplicate() const
Create a copy of a LIB_SYMBOL and assigns unique KIIDs to the copy and its children.
Definition lib_symbol.h:128
SCH_FIELD * GetField(const wxString &aFieldName)
Find a field within this symbol matching aFieldName; return nullptr if not found.
SCH_FIELD & GetFootprintField()
Return reference to the footprint field.
Definition lib_symbol.h:436
void SetAssociatedFootprints(std::vector< ASSOCIATED_FOOTPRINT > aList)
Definition lib_symbol.h:262
void SetDescription(const wxString &aDescription)
Gets the Description field text value *‍/.
void SetKeyWords(const wxString &aKeyWords)
SCH_FIELD & GetValueField()
Return reference to the value field.
Definition lib_symbol.h:428
void SetPinMaps(const PIN_MAP_SET &aPinMaps)
Definition lib_symbol.h:258
void SetFPFilters(const wxArrayString &aFilters)
Definition lib_symbol.h:240
void SetLibId(const LIB_ID &aLibId)
void AddField(SCH_FIELD *aField)
Add a field.
PIN_MAP_SET & PinMaps()
Definition lib_symbol.h:257
virtual void SetName(const wxString &aName)
SCH_FIELD & GetReferenceField()
Return reference to the reference designator field.
Definition lib_symbol.h:432
bool IsEmpty() const
Definition pin_map.h:139
void AddOrReplace(PIN_MAP aMap)
Insert aMap, replacing any existing entry with the same name.
Definition pin_map.cpp:113
virtual const wxString & GetText() const override
Return the string associated with the text object.
Definition sch_field.h:128
void SetName(const wxString &aName)
void SetText(const wxString &aText) override
std::unique_ptr< HTTP_LIB_CONNECTION > m_conn
Generally will be null if no valid connection is established.
LIB_SYMBOL * LoadSymbol(const wxString &aLibraryPath, const wxString &aAliasName, const std::map< std::string, UTF8 > *aProperties=nullptr) override
Load a LIB_SYMBOL object having aPartName from the aLibraryPath containing a library format that this...
void SaveSymbol(const wxString &aLibraryPath, const LIB_SYMBOL *aSymbol, const std::map< std::string, UTF8 > *aProperties=nullptr) override
Write aSymbol to an existing library located at aLibraryPath.
std::unique_ptr< HTTP_LIB_SETTINGS > m_settings
wxString GetSubLibraryDescription(const wxString &aName) override
Gets a description of a sublibrary.
SYMBOL_LIBRARY_ADAPTER * m_adapter
void ensureSettings(const wxString &aSettingsPath)
std::set< wxString > m_customFields
void GetDefaultSymbolFields(std::vector< wxString > &aNames) override
Retrieves a list of (custom) field names that should be shown by default for this library in the symb...
void GetAvailableSymbolFields(std::vector< wxString > &aNames) override
Retrieves a list of (custom) field names that are present on symbols in this library.
std::set< wxString > m_defaultShownFields
void syncCacheIfStale(const HTTP_LIB_CATEGORY &category)
Refresh the cached parts for a category if it has never been cached or has expired.
LIB_SYMBOL * loadSymbolFromPart(const wxString &aLibraryPath, const wxString &aSymbolName, const HTTP_LIB_CATEGORY &aCategory, const HTTP_LIB_PART &aPart)
wxString description_field
std::map< std::string, HTTP_LIB_CATEGORY > m_cachedCategories
void EnumerateSymbolLib(wxArrayString &aSymbolNameList, const wxString &aLibraryPath, const std::map< std::string, UTF8 > *aProperties=nullptr) override
Populate a list of LIB_SYMBOL alias names contained within the library aLibraryPath.
void GetSubLibraryNames(std::vector< wxString > &aNames) override
Retrieves a list of sub-libraries in this library.
SCH_IO(const wxString &aName)
Definition sch_io.h:384
static const char * PropPowerSymsOnly
void SetExcludedFromBoard(bool aExclude, const SCH_SHEET_PATH *aInstance=nullptr, const wxString &aVariantName=wxEmptyString) override
Set or clear exclude from board netlist flag.
Definition symbol.h:206
virtual void SetExcludedFromSim(bool aExcludeFromSim, const SCH_SHEET_PATH *aInstance=nullptr, const wxString &aVariantName=wxEmptyString) override
Set or clear the exclude from simulation flag.
Definition symbol.h:176
virtual void SetExcludedFromBOM(bool aExcludeFromBOM, const SCH_SHEET_PATH *aInstance=nullptr, const wxString &aVariantName=wxEmptyString) override
Set or clear the exclude from schematic bill of materials flag.
Definition symbol.h:191
#define _(s)
const char *const traceHTTPLib
#define THROW_IO_ERROR(msg)
macro which captures the "call site" values of FILE_, __FUNCTION & LINE
#define THROW_IO_ERRORF(msg,...)
PIN_MAP MakeLegacyPinMap(const wxString &aName, const std::unordered_map< wxString, std::vector< wxString > > &aAssignments)
Build a single named PIN_MAP from a legacy symbol-pin to footprint-pad(s) assignment table (the flat ...
Definition pin_map.cpp:151
std::string id
id of category
std::string name
name of category
std::vector< ASSOCIATED_FOOTPRINT > associated_footprints
std::string symbolIdStr
std::unordered_map< wxString, std::vector< wxString > > pin_map
Legacy flat MR !2540 pin assignment table (read for one release; issue #2282).
std::string keywords
std::vector< std::string > fp_filters
std::vector< std::pair< std::string, field_type > > fields
PIN_MAP_SET named_pin_maps
Spec-form named pin maps and their footprint associations (issue #2282).
@ USER
The field ID hasn't been set yet; field is invalid.
std::string path
wxString result
Test unit parsing edge cases and error handling.