207 "+N1 N0 'subnode1' &\r\n"
213 ".<Part name> (<Part number>):<Part version>;<Description>\r\n"
214 "<PCB Component Refname> (<PCB Alternate Refname>)\r\n"
216 "*PNM 1=A1 2=A2 3=B1 4=B2 5=C1 6=C2\r\n"
217 "*PLB 1=\"VCC\" 2=\"GND\" 3=\"'EN\" 4=\"OUT\" 5=\"OUT\" 6=\"IN\"\r\n"
218 "*EQU 4=5, 6=7=8, 9=10=11\r\n"
225 "*DFN <Definition name>\r\n"
228 "*STM <Component name stem>\r\n"
230 "*SPI (<Part name>) <Model> <Value>\r\n"
231 "*PAC (<Part name>) <Acceptance Text>\r\n"
232 "*userAttribute userAttributeVal\r\n"
233 "*\"User spaced name\" userSpacedAttributeVal\r\n"
234 "$<SCM Attribute name1>(<Attribute value for name1>)\r\n"
235 "$!<SCM Attribute name2>(\"<Attribute value for name2>\")\r\n"
236 "%<PCB Attribute name1>(\"<Attribute value1>\")\r\n"
237 "%!\"<PCB Attribute name2>\"(<Attribute value2>)\r\n"
238 "~<Parts Attribute name1>(<Attribute value1>)\r\n"
239 "~!<Parts Attribute name2>(<Attribute value2>)\r\n"
240 "@<SCM/PCB Attribute name1>(<Attribute value1>)\r\n"
241 "@!<SCM/PCB Attribute name2>(<Attribute value2>)\r\n"
242 "<SCM Symbol Refname1> (<SCM Alternate Refname>)\r\n"
243 "1.0!TD:2000 2.1!TI 3.2!T\r\n"
244 "<SCM Symbol Refname2>\r\n"
245 "4.2!U:1000 5.1!I 6.3!Q\r\n"
246 "/GND 7.0!G:2000\r\n"
247 "/VCC 8.0!P:2000 9.1 10.0\r\n";
256 BOOST_REQUIRE_EQUAL(
result.m_HierarchyNodes.size(), 2 );
258 BOOST_REQUIRE_EQUAL(
result.m_PartEntries.size(), 1 );
269 BOOST_REQUIRE_EQUAL(
result.m_PartEntries[0].m_PinNamesMap.size(), 6 );
271 std::map<long, std::string>& pinNames =
result.m_PartEntries[0].m_PinNamesMap;
280 BOOST_REQUIRE_EQUAL(
result.m_PartEntries[0].m_PinLabelsMap.size(), 6 );
282 std::map<long, std::string>& pinlabels =
result.m_PartEntries[0].m_PinLabelsMap;
291 BOOST_REQUIRE_EQUAL(
result.m_PartEntries[0].m_PinEquivalences.size(), 3 );
293 std::vector<std::vector<long>>& pinEqus =
result.m_PartEntries[0].m_PinEquivalences;
294 BOOST_REQUIRE_EQUAL( pinEqus[0].size(), 2 );
295 BOOST_REQUIRE_EQUAL( pinEqus[1].size(), 3 );
296 BOOST_REQUIRE_EQUAL( pinEqus[2].size(), 3 );
308 BOOST_REQUIRE_EQUAL(
result.m_PartEntries[0].m_InternalSwapGroup.size(), 1 );
312 std::vector<std::vector<long>>& intgates =
313 result.m_PartEntries[0].m_InternalSwapGroup[0].m_Gates;
315 BOOST_REQUIRE_EQUAL( intgates[0].size(), 2 );
316 BOOST_REQUIRE_EQUAL( intgates[1].size(), 2 );
324 BOOST_REQUIRE_EQUAL(
result.m_PartEntries[0].m_ExternalSwapGroup.size(), 1 );
328 std::vector<std::vector<long>>& extgates =
329 result.m_PartEntries[0].m_ExternalSwapGroup[0].m_Gates;
331 BOOST_REQUIRE_EQUAL( extgates[0].size(), 2 );
332 BOOST_REQUIRE_EQUAL( extgates[1].size(), 2 );
363 BOOST_REQUIRE_EQUAL(
result.m_PartEntries[0].m_UserAttributes.size(), 2 );
365 std::map<std::string, std::string>& userAtts =
result.m_PartEntries[0].m_UserAttributes;
370 BOOST_REQUIRE_EQUAL(
result.m_PartEntries[0].m_SchAttributes.size(), 2 );
372 std::map<std::string, CADSTAR_ATTRIBUTE_VALUE>& schAtts =
373 result.m_PartEntries[0].m_SchAttributes;
376 BOOST_CHECK_EQUAL( schAtts[
"<SCM Attribute name1>"].m_Value,
"<Attribute value for name1>" );
379 BOOST_CHECK_EQUAL( schAtts[
"<SCM Attribute name2>"].m_Value,
"<Attribute value for name2>" );
382 BOOST_REQUIRE_EQUAL(
result.m_PartEntries[0].m_PcbAttributes.size(), 2 );
384 std::map<std::string, CADSTAR_ATTRIBUTE_VALUE>& pcbAtts =
385 result.m_PartEntries[0].m_PcbAttributes;
388 BOOST_CHECK_EQUAL( pcbAtts[
"<PCB Attribute name1>"].m_Value,
"<Attribute value1>" );
391 BOOST_CHECK_EQUAL( pcbAtts[
"<PCB Attribute name2>"].m_Value,
"<Attribute value2>" );
394 BOOST_REQUIRE_EQUAL(
result.m_PartEntries[0].m_PartAttributes.size(), 2 );
396 std::map<std::string, CADSTAR_ATTRIBUTE_VALUE>& partAtts =
397 result.m_PartEntries[0].m_PartAttributes;
400 BOOST_CHECK_EQUAL( partAtts[
"<Parts Attribute name1>"].m_Value,
"<Attribute value1>" );
403 BOOST_CHECK_EQUAL( partAtts[
"<Parts Attribute name2>"].m_Value,
"<Attribute value2>" );
406 BOOST_REQUIRE_EQUAL(
result.m_PartEntries[0].m_SchAndPcbAttributes.size(), 2 );
408 std::map<std::string, CADSTAR_ATTRIBUTE_VALUE>schAndPcbAtts =
409 result.m_PartEntries[0].m_SchAndPcbAttributes;
411 BOOST_CHECK_EQUAL( schAndPcbAtts[
"<SCM/PCB Attribute name1>"].m_ReadOnly,
false );
412 BOOST_CHECK_EQUAL( schAndPcbAtts[
"<SCM/PCB Attribute name1>"].m_Value,
"<Attribute value1>" );
414 BOOST_CHECK_EQUAL( schAndPcbAtts[
"<SCM/PCB Attribute name2>"].m_ReadOnly,
true );
415 BOOST_CHECK_EQUAL( schAndPcbAtts[
"<SCM/PCB Attribute name2>"].m_Value,
"<Attribute value2>" );
418 std::vector<CADSTAR_PART_SYMBOL_ENTRY> symbols =
result.m_PartEntries[0].m_Symbols;
420 std::vector<CADSTAR_PART_SYMBOL_ENTRY> expectedSymbols =
423 "<SCM Symbol Refname1>",
424 "<SCM Alternate Refname>",
435 "<SCM Symbol Refname2>",
448 BOOST_REQUIRE_EQUAL(
result.m_PartEntries[0].m_Symbols.size(), expectedSymbols.size() );
450 auto itA = symbols.begin();
451 auto itB = expectedSymbols.begin();
453 while( itA != symbols.end() || itB != expectedSymbols.end() )
457 << itB->m_SymbolAlternateName.value_or(
"[nullopt]" ) )
462 BOOST_REQUIRE_EQUAL( itA->m_Pins.size(), itB->m_Pins.size() );
464 auto itPinsA = itA->m_Pins.begin();
465 auto itPinsB = itB->m_Pins.begin();
467 while( itPinsA != itA->m_Pins.end() || itPinsB != itB->m_Pins.end() )
472 BOOST_CHECK( itPinsA->m_Position == itPinsB->m_Position );
473 BOOST_CHECK( itPinsA->m_Type == itPinsB->m_Type );
487 std::map<std::string,std::vector<CADSTAR_PART_PIN>> expectedHiddenPins =
505 BOOST_REQUIRE_EQUAL(
result.m_PartEntries[0].m_HiddenPins.size(), expectedHiddenPins.size() );
507 auto itEntryA =
result.m_PartEntries[0].m_HiddenPins.begin();
508 auto itEntryB = expectedHiddenPins.begin();
510 while( itEntryA !=
result.m_PartEntries[0].m_HiddenPins.end()
511 || itEntryB != expectedHiddenPins.end() )
516 BOOST_REQUIRE_EQUAL( itEntryA->second.size(), itEntryB->second.size() );
518 auto itPinsA = itEntryA->second.begin();
519 auto itPinsB = itEntryB->second.begin();
521 while( itPinsA != itEntryA->second.end() || itPinsB != itEntryB->second.end() )
524 BOOST_CHECK( itPinsA->m_Position == itPinsB->m_Position );
525 BOOST_CHECK( itPinsA->m_Type == itPinsB->m_Type );
std::map< std::string, std::vector< CADSTAR_PART_PIN > > m_HiddenPins
Pins with an implied electrical connection to a net, not part of any symbol (Note: we probably will n...
std::map< std::string, std::string > m_UserAttributes
Star (*) line *<User-defined name> This line is ignored by CADSTAR.