30#include <wx/translation.h>
44 std::vector<wxString> subNodeChildrenToCount = { wxT(
"LIBRARY" ), wxT(
"PARTS" ),
58 for( ; cNode; cNode = cNode->
GetNext() )
60 if( cNode->GetName() == wxT(
"HEADER" ) )
71 wxASSERT_MSG(
true, wxT(
"Unknown File Resolution" ) );
77 THROW_IO_ERROR( wxT(
"The selected file is not a valid CADSTAR library file." ) );
84 wxT(
"The selected file is a CADSTAR library file (as opposed "
85 "to a layout file). You can import this library by adding it "
86 "to the library table." ) );
90 THROW_IO_ERROR( wxT(
"The selected file is an unknown CADSTAR format so "
91 "cannot be imported into KiCad." ) );
95 else if( cNode->GetName() == wxT(
"ASSIGNMENTS" ) )
99 else if( cNode->GetName() == wxT(
"LIBRARY" ) )
103 else if( cNode->GetName() == wxT(
"DEFAULTS" ) )
109 else if( cNode->GetName() == wxT(
"PARTS" ) )
113 else if( cNode->GetName() == wxT(
"LAYOUT" ) )
117 else if( cNode->GetName() == wxT(
"DISPLAY" ) )
138 wxASSERT( aNode->GetName() == wxT(
"ASSIGNMENTS" ) );
145 for( ; cNode; cNode = cNode->
GetNext() )
147 if( cNode->GetName() == wxT(
"LAYERDEFS" ) )
149 else if( cNode->GetName() == wxT(
"CODEDEFS" ) )
151 else if( cNode->GetName() == wxT(
"TECHNOLOGY" ) )
153 else if( cNode->GetName() == wxT(
"GRIDS" ) )
155 else if( cNode->GetName() == wxT(
"NETCLASSEDITATTRIBSETTINGS" ) )
157 else if( cNode->GetName() == wxT(
"SPCCLASSEDITATTRIBSETTINGS" ) )
167 wxASSERT( aNode->GetName() == wxT(
"LAYERDEFS" ) );
169 wxXmlAttribute* xmlAttribute =
nullptr;
176 for( ; cNode; cNode = cNode->
GetNext() )
178 wxString nodeName = cNode->GetName();
180 if( nodeName == wxT(
"LAYERSTACK" ) )
182 xmlAttribute = cNode->GetAttributes();
184 for( ; xmlAttribute; xmlAttribute = xmlAttribute->GetNext() )
189 LayerStack.push_back( (
LAYER_ID) xmlAttribute->GetValue() );
194 else if( nodeName == wxT(
"MATERIAL" ) )
197 material.
Parse( cNode, aContext );
198 Materials.insert( std::make_pair( material.
ID, material ) );
200 else if( nodeName == wxT(
"LAYER" ) )
203 layer.
Parse( cNode, aContext );
204 Layers.insert( std::make_pair( layer.
ID, layer ) );
206 else if( nodeName == wxT(
"SWAPPAIR" ) )
211 Layers[layerId].SwapLayerID = swapLayerId;
223 wxASSERT( aNode->GetName() == wxT(
"RULESET" ) );
230 for( ; cNode; cNode = cNode->
GetNext() )
232 wxString nodeName = cNode->GetName();
234 if( nodeName == wxT(
"ROUCODEREF" ) )
238 else if( nodeName == wxT(
"VIACODEREF" ) )
242 else if( nodeName == wxT(
"SPACINGCODE" ) )
245 spacingcode.
Parse( cNode, aContext );
246 SpacingCodes.insert( std::make_pair( spacingcode.
ID, spacingcode ) );
258 wxASSERT( aNode->GetName() == wxT(
"CODEDEFS" ) );
262 for( ; cNode; cNode = cNode->
GetNext() )
264 wxString nodeName = cNode->GetName();
266 if( ParseSubNode( cNode, aContext ) )
269 else if( nodeName == wxT(
"COPPERCODE" ) )
272 coppercode.
Parse( cNode, aContext );
273 CopperCodes.insert( std::make_pair( coppercode.
ID, coppercode ) );
275 else if( nodeName == wxT(
"SPACINGCODE" ) )
278 spacingcode.
Parse( cNode, aContext );
279 SpacingCodes.insert( std::make_pair( spacingcode.
ID, spacingcode ) );
281 else if( nodeName == wxT(
"RULESET" ) )
284 ruleset.
Parse( cNode, aContext );
285 Rulesets.insert( std::make_pair( ruleset.
ID, ruleset ) );
287 else if( nodeName == wxT(
"PADCODE" ) )
290 padcode.
Parse( cNode, aContext );
291 PadCodes.insert( std::make_pair( padcode.
ID, padcode ) );
293 else if( nodeName == wxT(
"VIACODE" ) )
296 viacode.
Parse( cNode, aContext );
297 ViaCodes.insert( std::make_pair( viacode.
ID, viacode ) );
299 else if( nodeName == wxT(
"LAYERPAIR" ) )
302 layerpair.
Parse( cNode, aContext );
303 LayerPairs.insert( std::make_pair( layerpair.
ID, layerpair ) );
305 else if( nodeName == wxT(
"SPCCLASSSPACE" ) )
308 spcclassspace.
Parse( cNode, aContext );
309 SpacingClasses.push_back( spcclassspace );
321 wxASSERT( aNode->GetName() == wxT(
"MATERIAL" ) );
328 if( sType == wxT(
"CONSTRUCTION" ) )
332 else if( sType == wxT(
"ELECTRICAL" ) )
336 else if( sType == wxT(
"NONELEC" ) )
350 wxString::Format( wxT(
"MATERIAL %s" ), Name ) );
353 for( ; iNode; iNode = iNode->
GetNext() )
355 wxString nodeName = iNode->GetName();
357 if( nodeName == wxT(
"RELPERMIT" ) )
361 else if( nodeName == wxT(
"LOSSTANGENT" ) )
365 else if( nodeName == wxT(
"RESISTIVITY" ) )
379 wxASSERT( aNode->GetName() == wxT(
"LAYER" ) );
385 auto processLayerMaterialDetails = [&]() {
387 for( ; tempNode; tempNode = tempNode->
GetNext() )
389 wxString tempNodeName = tempNode->GetName();
391 if( tempNodeName == wxT(
"MAKE" ) || tempNodeName == wxT(
"LAYERHEIGHT" ) )
393 if( tempNodeName == wxT(
"LAYERHEIGHT" ) )
405 if( childOfTempNode )
407 if( childOfTempNode->GetName() == wxT(
"EMBEDS" ) )
411 if( embedsValue == wxT(
"UPWARDS" ) )
415 else if( embedsValue == wxT(
"DOWNWARDS" ) )
422 wxString::Format( wxT(
"LAYER %s -> EMBEDS" ),
429 wxString::Format( wxT(
"LAYER %s->MAKE" ),
434 else if( tempNodeName == wxT(
"BIAS" ) )
438 if( bias == wxT(
"X_BIASED" ) )
442 else if( bias == wxT(
"Y_BIASED" ) )
446 else if( bias == wxT(
"ANTITRACK" ) )
450 else if( bias == wxT(
"OBSTACLE" ) )
454 else if( bias == wxT(
"UNBIASED" ) )
461 wxString::Format( wxT(
"LAYER %s -> BIAS" ),
473 for( ; cNode; cNode = cNode->
GetNext() )
475 wxString cNodeName = cNode->GetName();
477 if( cNodeName == wxT(
"ALLDOC" ) )
481 else if( cNodeName == wxT(
"ALLELEC" ) )
485 else if( cNodeName == wxT(
"ALLLAYER" ) )
489 else if( cNodeName == wxT(
"ASSCOMPCOPP" ) )
493 else if( cNodeName == wxT(
"JUMPERLAYER" ) )
497 else if( cNodeName == wxT(
"NOLAYER" ) )
501 else if( cNodeName == wxT(
"POWER" ) )
505 processLayerMaterialDetails();
507 else if( cNodeName == wxT(
"DOC" ) )
511 else if( cNodeName == wxT(
"CONSTRUCTION" ) )
514 processLayerMaterialDetails();
516 else if( cNodeName == wxT(
"ELEC" ) )
520 processLayerMaterialDetails();
522 else if( cNodeName == wxT(
"NONELEC" ) )
526 processLayerMaterialDetails();
528 else if( cNodeName == wxT(
"DESCRIPTION" ) )
532 else if( cNodeName == wxT(
"REFPLANE" ) )
534 ReferencePlane =
true;
536 else if( cNodeName == wxT(
"VLAYER" ) )
540 else if( cNodeName == wxT(
"LASUBTYP" ) )
545 if( sSubType == wxT(
"LAYERSUBTYPE_ASSEMBLY" ) )
549 else if( sSubType == wxT(
"LAYERSUBTYPE_PASTE" ) )
553 else if( sSubType == wxT(
"LAYERSUBTYPE_PLACEMENT" ) )
557 else if( sSubType == wxT(
"LAYERSUBTYPE_SILKSCREEN" ) )
561 else if( sSubType == wxT(
"LAYERSUBTYPE_SOLDERRESIST" ) )
565 else if( sSubType == wxT(
"LAYERSUBTYPE_CLEARANCE" ) )
569 else if( sSubType == wxT(
"LAYERSUBTYPE_ROUT" ) )
589 wxASSERT( aNode->GetName() == wxT(
"COPREASSIGN" ) );
599 wxASSERT( aNode->GetName() == wxT(
"COPPERCODE" ) );
608 for( ; cNode; cNode = cNode->
GetNext() )
610 if( cNode->GetName() == wxT(
"COPREASSIGN" ) )
613 reassign.
Parse( cNode, aContext );
614 Reassigns.push_back( reassign );
627 wxASSERT( aNode->GetName() == wxT(
"SPACEREASSIGN" ) );
638 wxASSERT( aNode->GetName() == wxT(
"SPACINGCODE" ) );
645 for( ; cNode; cNode = cNode->
GetNext() )
647 wxString cNodeName = cNode->GetName();
649 if( cNodeName == wxT(
"SPACEREASSIGN" ) )
652 reassign.
Parse( cNode, aContext );
653 Reassigns.push_back( reassign );
665 wxString aNodeName = aNode->GetName();
667 if( aNodeName == wxT(
"ANNULUS" ) || aNodeName == wxT(
"BULLET" ) || aNodeName == wxT(
"ROUND" )
668 || aNodeName == wxT(
"DIAMOND" ) || aNodeName == wxT(
"FINGER" )
669 || aNodeName == wxT(
"OCTAGON" ) || aNodeName == wxT(
"RECTANGLE" )
670 || aNodeName == wxT(
"ROUNDED" ) || aNodeName == wxT(
"SQUARE" ) )
683 wxASSERT( IsPadShape( aNode ) );
685 wxString aNodeName = aNode->GetName();
687 if( aNodeName == wxT(
"ANNULUS" ) )
689 else if( aNodeName == wxT(
"BULLET" ) )
691 else if( aNodeName == wxT(
"ROUND" ) )
693 else if( aNodeName == wxT(
"DIAMOND" ) )
695 else if( aNodeName == wxT(
"FINGER" ) )
697 else if( aNodeName == wxT(
"OCTAGON" ) )
699 else if( aNodeName == wxT(
"RECTANGLE" ) )
701 else if( aNodeName == wxT(
"ROUNDED" ) )
703 else if( aNodeName == wxT(
"SQUARE" ) )
732 if( aNode->
GetChildren()->GetName() == wxT(
"ORIENT" ) )
754 wxASSERT( aNode->GetName() == wxT(
"PADREASSIGN" ) );
769 wxASSERT( aNode->GetName() == wxT(
"PADCODE" ) );
775 wxString location = wxString::Format( wxT(
"PADCODE -> %s" ), Name );
777 for( ; cNode; cNode = cNode->
GetNext() )
779 wxString cNodeName = cNode->GetName();
783 Shape.Parse( cNode, aContext );
785 else if( cNodeName == wxT(
"CLEARANCE" ) )
789 else if( cNodeName == wxT(
"RELIEFWIDTH" ) )
793 else if( cNodeName == wxT(
"DRILL" ) )
798 for( ; subNode; subNode = subNode->
GetNext() )
800 wxString subNodeName = subNode->GetName();
802 if( subNodeName == wxT(
"NONPLATED" ) )
804 else if( subNodeName == wxT(
"OVERSIZE" ) )
810 else if( cNodeName == wxT(
"DRILLLENGTH" ) )
814 else if( cNodeName == wxT(
"DRILLORIENTATION" ) )
818 else if( cNodeName == wxT(
"DRILLXOFFSET" ) )
822 else if( cNodeName == wxT(
"DRILLYOFFSET" ) )
826 else if( cNodeName == wxT(
"PADREASSIGN" ) )
829 reassign.
Parse( cNode, aContext );
830 Reassigns.insert( std::make_pair( reassign.
LayerID, reassign.
Shape ) );
842 wxASSERT( aNode->GetName() == wxT(
"VIAREASSIGN" ) );
857 wxASSERT( aNode->GetName() == wxT(
"VIACODE" ) );
863 wxString location = wxString::Format( wxT(
"VIACODE -> %s" ), Name );
865 for( ; cNode; cNode = cNode->
GetNext() )
867 wxString cNodeName = cNode->GetName();
871 Shape.Parse( cNode, aContext );
873 else if( cNodeName == wxT(
"CLEARANCE" ) )
877 else if( cNodeName == wxT(
"RELIEFWIDTH" ) )
881 else if( cNodeName == wxT(
"DRILL" ) )
886 for( ; subNode; subNode = subNode->
GetNext() )
888 wxString subNodeName = subNode->GetName();
890 if( subNodeName == wxT(
"OVERSIZE" ) )
896 else if( cNodeName == wxT(
"VIAREASSIGN" ) )
899 reassign.
Parse( cNode, aContext );
900 Reassigns.insert( std::make_pair( reassign.
LayerID, reassign.
Shape ) );
912 wxASSERT( aNode->GetName() == wxT(
"LAYERPAIR" ) );
920 wxString location = wxString::Format( wxT(
"LAYERPAIR -> %s" ), Name );
924 if( aNode->
GetChildren()->GetName() == wxT(
"VIACODEREF" ) )
940 wxASSERT( aNode->GetName() == wxT(
"SPCCLASSSPACE" ) );
951 wxASSERT( aNode->GetName() == wxT(
"TECHNOLOGY" ) );
955 for( ; cNode; cNode = cNode->
GetNext() )
957 wxString cNodeName = cNode->GetName();
959 if( ParseSubNode( cNode, aContext ) )
962 else if( cNodeName == wxT(
"MINROUTEWIDTH" ) )
966 else if( cNodeName == wxT(
"MINNECKED" ) )
970 else if( cNodeName == wxT(
"MINUNNECKED" ) )
974 else if( cNodeName == wxT(
"MINMITER" ) )
978 else if( cNodeName == wxT(
"MAXMITER" ) )
982 else if( cNodeName == wxT(
"MAXPHYSLAYER" ) )
986 else if( cNodeName == wxT(
"TRACKGRID" ) )
990 else if( cNodeName == wxT(
"VIAGRID" ) )
994 else if( cNodeName == wxT(
"BACKOFFJCTS" ) )
996 BackOffJunctions =
true;
998 else if( cNodeName == wxT(
"BCKOFFWIDCHANGE" ) )
1000 BackOffWidthChange =
true;
1011 const wxString& aPadSideString )
1013 if( aPadSideString == wxT(
"THRU" ) )
1015 else if( aPadSideString == wxT(
"BOTTOM" ) )
1017 else if( aPadSideString == wxT(
"TOP" ) )
1026 wxASSERT( aNode->GetName() == wxT(
"COMPCOPPER" ) );
1032 bool shapeIsInitialised =
false;
1033 wxString location = wxT(
"COMPCOPPER" );
1038 for( ; cNode; cNode = cNode->
GetNext() )
1040 wxString cNodeName = cNode->GetName();
1042 if( !shapeIsInitialised && Shape.IsShape( cNode ) )
1044 Shape.Parse( cNode, aContext );
1045 shapeIsInitialised =
true;
1047 else if( cNodeName == wxT(
"SWAPRULE" ) )
1051 else if( cNodeName == wxT(
"ASSOCPIN" ) )
1053 wxXmlAttribute* xmlAttribute = cNode->GetAttributes();
1055 for( ; xmlAttribute; xmlAttribute = xmlAttribute->GetNext() )
1062 if( !xmlAttribute->GetValue().ToLong( &padId ) )
1065 AssociatedPadIDs.push_back( (
PAD_ID) padId );
1080 wxASSERT( aNode->GetName() == wxT(
"COMPAREA" ) );
1087 bool shapeIsInitialised =
false;
1088 wxString location = wxString::Format( wxT(
"COMPAREA %s" ),
ID );
1093 for( ; cNode; cNode = cNode->
GetNext() )
1095 wxString cNodeName = cNode->GetName();
1097 if( !shapeIsInitialised && SHAPE::IsShape( cNode ) )
1099 Shape.Parse( cNode, aContext );
1100 shapeIsInitialised =
true;
1102 else if( cNodeName == wxT(
"SWAPRULE" ) )
1106 else if( cNodeName == wxT(
"USAGE" ) )
1108 wxXmlAttribute* xmlAttribute = cNode->GetAttributes();
1110 for( ; xmlAttribute; xmlAttribute = xmlAttribute->GetNext() )
1115 if( xmlAttribute->GetValue() == wxT(
"NO_TRACKS" ) )
1117 else if( xmlAttribute->GetValue() == wxT(
"NO_VIAS" ) )
1135 wxASSERT( aNode->GetName() == wxT(
"EXITS" ) );
1137 wxXmlAttribute* xmlAttribute = aNode->GetAttributes();
1139 for( ; xmlAttribute; xmlAttribute = xmlAttribute->GetNext() )
1144 if( xmlAttribute->GetValue() == wxT(
"FREE" ) )
1146 else if( xmlAttribute->GetValue() == wxT(
"N" ) )
1148 else if( xmlAttribute->GetValue() == wxT(
"S" ) )
1150 else if( xmlAttribute->GetValue() == wxT(
"E" ) )
1152 else if( xmlAttribute->GetValue() == wxT(
"W" ) )
1154 else if( xmlAttribute->GetValue() == wxT(
"NE" ) )
1156 else if( xmlAttribute->GetValue() == wxT(
"NW" ) )
1158 else if( xmlAttribute->GetValue() == wxT(
"SE" ) )
1160 else if( xmlAttribute->GetValue() == wxT(
"SW" ) )
1172 wxASSERT( aNode->GetName() == wxT(
"PAD" ) );
1179 wxString location = wxString::Format( wxT(
"PAD %ld" ),
ID );
1184 for( ; cNode; cNode = cNode->
GetNext() )
1186 wxString cNodeName = cNode->GetName();
1188 if( cNodeName == wxT(
"ORIENT" ) )
1190 else if( cNodeName == wxT(
"FIRSTPAD" ) )
1192 else if( cNodeName == wxT(
"EXITS" ) )
1193 Exits.Parse( cNode, aContext );
1194 else if( cNodeName == wxT(
"PADIDENTIFIER" ) )
1196 else if( cNodeName == wxT(
"PCBONLYPAD" ) )
1198 else if( cNodeName == wxT(
"PT" ) )
1199 Position.Parse( cNode, aContext );
1208 wxASSERT( aNode->GetName() == wxT(
"DIMARROW" ) );
1209 bool arrowStyleInitialised =
false;
1210 bool upperAngleInitialised =
false;
1211 bool lowerAngleInitialised =
false;
1218 for( ; cNode; cNode = cNode->
GetNext() )
1220 wxString cNodeName = cNode->GetName();
1222 if( cNodeName == wxT(
"ARROWSTYLE" ) )
1225 arrowStyleInitialised =
true;
1227 if( arrowStyleStr == wxT(
"DIMENSION_ARROWOPEN" ) )
1228 ArrowStyle = STYLE::OPEN;
1229 else if( arrowStyleStr == wxT(
"DIMENSION_ARROWCLOSED" ) )
1230 ArrowStyle = STYLE::CLOSED;
1231 else if( arrowStyleStr == wxT(
"DIMENSION_ARROWCLEAR" ) )
1232 ArrowStyle = STYLE::CLEAR;
1233 else if( arrowStyleStr == wxT(
"DIMENSION_ARROWCLOSEDFILLED" ) )
1234 ArrowStyle = STYLE::CLOSED_FILLED;
1238 else if( cNodeName == wxT(
"ARROWANGLEA" ) )
1241 upperAngleInitialised =
true;
1243 else if( cNodeName == wxT(
"ARROWANGLEB" ) )
1246 lowerAngleInitialised =
true;
1254 if( !arrowStyleInitialised )
1257 if( !upperAngleInitialised )
1260 if( !lowerAngleInitialised )
1268 wxASSERT( aNode->GetName() == wxT(
"DIMTEXT" ) );
1275 if( !cNode || cNode->GetName() != wxT(
"TXTSTYLE" ) )
1280 if( styleStr == wxT(
"DIMENSION_INTERNAL" ) )
1281 Style = STYLE::INSIDE;
1282 else if( styleStr == wxT(
"DIMENSION_EXTERNAL" ) )
1283 Style = STYLE::OUTSIDE;
1294 wxASSERT( aNode->GetName() == wxT(
"EXTLINE" ) );
1303 for( ; cNode; cNode = cNode->
GetNext() )
1305 wxString cNodeName = cNode->GetName();
1307 if( noOfPoints < 2 && cNodeName == wxT(
"PT" ) )
1311 if( noOfPoints == 1 )
1312 Start.Parse( cNode, aContext );
1314 End.Parse( cNode, aContext );
1316 else if( cNodeName == wxT(
"SUPPRESSFIRST" ) )
1318 SuppressFirst =
true;
1326 if( noOfPoints != 2 )
1333 if( aNode->GetName() == wxT(
"LEADERLINE" ) || aNode->GetName() == wxT(
"LINEARLINE" )
1334 || aNode->GetName() == wxT(
"ANGULARLINE" ) )
1347 wxASSERT( IsLine( aNode ) );
1349 if( aNode->GetName() == wxT(
"LINEARLINE" ) )
1350 Type = TYPE::LINEARLINE;
1351 else if( aNode->GetName() == wxT(
"LEADERLINE" ) )
1352 Type = TYPE::LEADERLINE;
1353 else if( aNode->GetName() == wxT(
"ANGULARLINE" ) )
1354 Type = TYPE::ANGULARLINE;
1356 wxASSERT_MSG(
true, wxT(
"Not a valid type. What happened to the node Name?" ) );
1360 if( Type == TYPE::LEADERLINE )
1368 int requiredNoOfPoints = 2;
1370 if( Type == TYPE::ANGULARLINE )
1371 requiredNoOfPoints = 3;
1373 for( ; cNode; cNode = cNode->
GetNext() )
1375 wxString cNodeName = cNode->GetName();
1377 if( cNodeName == wxT(
"DIMLINETYPE" ) )
1381 if( styleStr == wxT(
"DIMENSION_INTERNAL" ) )
1382 Style = STYLE::INTERNAL;
1383 else if( styleStr == wxT(
"DIMENSION_EXTERNAL" ) )
1384 Style = STYLE::EXTERNAL;
1388 else if( noOfPoints < requiredNoOfPoints && cNodeName == wxT(
"PT" ) )
1392 if( noOfPoints == 1 )
1393 Start.Parse( cNode, aContext );
1394 else if( noOfPoints == 2 )
1395 End.Parse( cNode, aContext );
1397 Centre.Parse( cNode, aContext );
1399 else if( Type == TYPE::LEADERLINE && cNodeName == wxT(
"LEADERANG" ) )
1409 if( noOfPoints != requiredNoOfPoints )
1416 if( aNode->GetName() == wxT(
"LINEARDIM" ) || aNode->GetName() == wxT(
"LEADERDIM" )
1417 || aNode->GetName() == wxT(
"ANGLEDIM" ) )
1430 wxASSERT( IsDimension( aNode ) );
1432 std::map<wxString, TYPE> typeMap = { { wxT(
"LINEARDIM" ), TYPE::LINEARDIM },
1433 { wxT(
"LEADERDIM" ), TYPE::LEADERDIM }, { wxT(
"ANGLEDIM" ), TYPE::ANGLEDIM } };
1436 wxASSERT_MSG( typeMap.find( aNode->GetName() ) != typeMap.end(),
1437 wxT(
"Not a valid type. What happened to the node Name?" ) );
1439 Type = typeMap[aNode->GetName()];
1443 std::map<wxString, SUBTYPE> subTypeMap = {
1444 { wxT(
"DIMENSION_ORTHOGONAL" ), SUBTYPE::ORTHOGONAL },
1445 { wxT(
"DIMENSION_DIRECT" ), SUBTYPE::DIRECT },
1446 { wxT(
"DIMENSION_ANGLED" ), SUBTYPE::ANGLED },
1447 { wxT(
"DIMENSION_DIAMETER" ), SUBTYPE::DIAMETER },
1448 { wxT(
"DIMENSION_RADIUS" ), SUBTYPE::RADIUS },
1449 { wxT(
"DIMENSION_ANGULAR" ), SUBTYPE::ANGULAR } };
1451 if( subTypeMap.find( subTypeStr ) == subTypeMap.end() )
1454 Subtype = subTypeMap[subTypeStr];
1459 bool idParsed =
false;
1460 bool unitsParsed =
false;
1461 bool arrowParsed =
false;
1462 bool textFormatParsed =
false;
1463 bool extLineParsed =
false;
1464 bool lineParsed =
false;
1465 bool textParsed =
false;
1467 for( ; cNode; cNode = cNode->
GetNext() )
1469 wxString cNodeName = cNode->GetName();
1471 if( !idParsed && cNodeName == wxT(
"DIMREF" ) )
1476 else if( !unitsParsed && cNodeName == wxT(
"UNITS" ) )
1481 else if( !unitsParsed && cNodeName == wxT(
"ANGUNITS" ) )
1486 else if( !arrowParsed && cNodeName == wxT(
"DIMARROW" ) )
1488 Arrow.Parse( cNode, aContext );
1491 else if( !textFormatParsed && cNodeName == wxT(
"DIMTEXT" ) )
1493 TextParams.Parse( cNode, aContext );
1494 textFormatParsed =
true;
1496 else if( !extLineParsed && cNodeName == wxT(
"EXTLINE" ) )
1498 ExtensionLineParams.Parse( cNode, aContext );
1499 extLineParsed =
true;
1501 else if( !lineParsed && LINE::IsLine( cNode ) )
1503 Line.Parse( cNode, aContext );
1506 else if( !textParsed && cNodeName == wxT(
"TEXT" ) )
1509 Text.Parse( cNode, aContext,
false );
1512 else if( cNodeName == wxT(
"FIX" ) )
1516 else if( cNodeName == wxT(
"GROUPREF" ) )
1520 else if( cNodeName == wxT(
"REUSEBLOCKREF" ) )
1522 ReuseBlockRef.Parse( cNode, aContext );
1534 wxASSERT( aNode->GetName() == wxT(
"SYMDEF" ) );
1536 ParseIdentifiers( aNode, aContext );
1540 if( ReferenceName.StartsWith( wxT(
"JUMPERNF" ), &rest ) )
1542 else if( ReferenceName.StartsWith( wxT(
"STARPOINTNF" ), &rest ) )
1544 else if( ReferenceName == wxT(
"TESTPOINT" ) )
1551 for( ; cNode; cNode = cNode->
GetNext() )
1553 wxString cNodeName = cNode->GetName();
1555 if( ParseSubNode( cNode, aContext ) )
1559 else if( cNodeName == wxT(
"SYMHEIGHT" ) )
1563 else if( cNodeName == wxT(
"COMPCOPPER" ) )
1566 compcopper.
Parse( cNode, aContext );
1567 ComponentCoppers.push_back( compcopper );
1569 else if( cNodeName == wxT(
"COMPAREA" ) )
1572 area.
Parse( cNode, aContext );
1573 ComponentAreas.insert( std::make_pair( area.
ID, area ) );
1575 else if( cNodeName == wxT(
"PAD" ) )
1578 pad.Parse( cNode, aContext );
1579 ComponentPads.insert( std::make_pair(
pad.ID,
pad ) );
1581 else if( cNodeName == wxT(
"DIMENSIONS" ) )
1585 for( ; dimensionNode; dimensionNode = dimensionNode->
GetNext() )
1590 dim.
Parse( dimensionNode, aContext );
1591 Dimensions.insert( std::make_pair( dim.
ID, dim ) );
1612 wxASSERT( aNode->GetName() == wxT(
"LIBRARY" ) );
1616 for( ; cNode; cNode = cNode->
GetNext() )
1618 wxString cNodeName = cNode->GetName();
1620 if( cNodeName == wxT(
"SYMDEF" ) )
1623 symdef.
Parse( cNode, aContext );
1624 ComponentDefinitions.insert( std::make_pair( symdef.
ID, symdef ) );
1626 else if( cNodeName == wxT(
"HIERARCHY" ) )
1646 wxASSERT( aNode->GetName() == wxT(
"BOARD" ) );
1652 bool shapeIsInitialised =
false;
1653 wxString location = wxString::Format( wxT(
"BOARD %s" ),
ID );
1658 for( ; cNode; cNode = cNode->
GetNext() )
1660 wxString cNodeName = cNode->GetName();
1662 if( !shapeIsInitialised && SHAPE::IsShape( cNode ) )
1664 Shape.Parse( cNode, aContext );
1665 shapeIsInitialised =
true;
1667 else if( cNodeName == wxT(
"ATTR" ) )
1670 attr.
Parse( cNode, aContext );
1671 AttributeValues.insert( std::make_pair( attr.
AttributeID, attr ) );
1673 else if( cNodeName == wxT(
"FIX" ) )
1677 else if( cNodeName == wxT(
"GROUPREF" ) )
1681 else if( cNodeName == wxT(
"REUSEBLOCKREF" ) )
1683 ReuseBlockRef.Parse( cNode, aContext );
1695 wxASSERT( aNode->GetName() == wxT(
"AREA" ) );
1703 bool shapeIsInitialised =
false;
1704 wxString location = wxString::Format( wxT(
"AREA %s" ),
ID );
1709 for( ; cNode; cNode = cNode->
GetNext() )
1711 wxString cNodeName = cNode->GetName();
1713 if( !shapeIsInitialised && SHAPE::IsShape( cNode ) )
1715 Shape.Parse( cNode, aContext );
1716 shapeIsInitialised =
true;
1718 else if( cNodeName == wxT(
"FIX" ) )
1722 else if( cNodeName == wxT(
"USAGE" ) )
1724 wxXmlAttribute* xmlAttribute = cNode->GetAttributes();
1726 for( ; xmlAttribute; xmlAttribute = xmlAttribute->GetNext() )
1731 if( xmlAttribute->GetValue() == wxT(
"PLACEMENT" ) )
1733 else if( xmlAttribute->GetValue() == wxT(
"ROUTING" ) )
1735 else if( xmlAttribute->GetValue() == wxT(
"KEEPOUT" ) )
1737 else if( xmlAttribute->GetValue() == wxT(
"NO_TRACKS" ) )
1739 else if( xmlAttribute->GetValue() == wxT(
"NO_VIAS" ) )
1747 else if( cNodeName == wxT(
"AREAHEIGHT" ) )
1751 else if( cNodeName == wxT(
"GROUPREF" ) )
1755 else if( cNodeName == wxT(
"REUSEBLOCKREF" ) )
1757 ReuseBlockRef.Parse( cNode, aContext );
1759 else if( cNodeName == wxT(
"ATTR" ) )
1762 attr.
Parse( cNode, aContext );
1763 AttributeValues.insert( std::make_pair( attr.
AttributeID, attr ) );
1775 wxASSERT( aNode->GetName() == wxT(
"PINATTR" ) );
1781 for( ; cNode; cNode = cNode->
GetNext() )
1783 wxString cNodeName = cNode->GetName();
1785 if( cNodeName == wxT(
"ATTR" ) )
1788 attrVal.
Parse( cNode, aContext );
1789 AttributeValues.insert( std::make_pair( attrVal.
AttributeID, attrVal ) );
1791 else if( cNodeName == wxT(
"TESTLAND" ) )
1805 wxASSERT( aNode->GetName() == wxT(
"PADEXCEPTION" ) );
1811 for( ; cNode; cNode = cNode->
GetNext() )
1813 wxString cNodeName = cNode->GetName();
1815 if( cNodeName == wxT(
"PADCODEREF" ) )
1819 else if( cNodeName == wxT(
"EXITS" ) )
1821 OverrideExits =
true;
1822 Exits.Parse( cNode, aContext );
1824 else if( cNodeName == wxT(
"SIDE" ) )
1826 OverrideSide =
true;
1829 else if( cNodeName == wxT(
"ORIENT" ) )
1831 OverrideOrientation =
true;
1844 wxASSERT( aNode->GetName() == wxT(
"COMP" ) );
1852 bool originParsed =
false;
1854 for( ; cNode; cNode = cNode->
GetNext() )
1856 wxString cNodeName = cNode->GetName();
1858 if( !originParsed && cNodeName == wxT(
"PT" ) )
1860 Origin.Parse( cNode, aContext );
1861 originParsed =
true;
1863 else if( cNodeName == wxT(
"GROUPREF" ) )
1867 else if( cNodeName == wxT(
"REUSEBLOCKREF" ) )
1869 ReuseBlockRef.Parse( cNode, aContext );
1871 else if( cNodeName == wxT(
"TESTPOINT" ) )
1875 else if( cNodeName == wxT(
"FIX" ) )
1879 else if( cNodeName == wxT(
"MIRROR" ) )
1883 else if( cNodeName == wxT(
"READABILITY" ) )
1887 else if( cNodeName == wxT(
"ORIENT" ) )
1891 else if( cNodeName == wxT(
"VCOMPMASTER" ) )
1896 else if( cNodeName == wxT(
"TEXTLOC" ) )
1899 textloc.
Parse( cNode, aContext );
1900 TextLocations.insert( std::make_pair( textloc.
AttributeID, textloc ) );
1902 else if( cNodeName == wxT(
"ATTR" ) )
1905 attrVal.
Parse( cNode, aContext );
1906 AttributeValues.insert( std::make_pair( attrVal.
AttributeID, attrVal ) );
1908 else if( cNodeName == wxT(
"PINATTR" ) )
1911 pinAttr.
Parse( cNode, aContext );
1912 PinAttributes.insert( std::make_pair( pinAttr.
Pin, pinAttr ) );
1914 else if( cNodeName == wxT(
"COMPPINLABEL" ) )
1918 PinLabels.insert( std::make_pair( pinID, pinLabel ) );
1920 else if( cNodeName == wxT(
"PADEXCEPTION" ) )
1923 padExcept.
Parse( cNode, aContext );
1924 PadExceptions.insert( std::make_pair( padExcept.
ID, padExcept ) );
1940 wxASSERT( aNode->GetName() == wxT(
"TESTLAND" ) );
1944 if( side == wxT(
"MIN_SIDE" ) )
1946 else if( side == wxT(
"MAX_SIDE" ) )
1948 else if( side == wxT(
"BOTH_SIDES" ) )
1959 wxASSERT( aNode->GetName() == wxT(
"TRUNK" ) );
1968 wxASSERT( aNode->GetName() == wxT(
"PIN" ) );
1980 ParseIdentifiers( aNode, aContext );
1983 for( ; cNode; cNode = cNode->
GetNext() )
1985 if( ParseSubNode( cNode, aContext ) )
1987 else if( cNode->GetName() == wxT(
"TRUNKREF" ) )
1997 wxASSERT( aNode->GetName() == wxT(
"VIA" ) );
2005 for( ; cNode; cNode = cNode->
GetNext() )
2007 wxString cNodeName = cNode->GetName();
2009 if( cNodeName == wxT(
"PT" ) )
2010 Location.Parse( cNode, aContext );
2011 else if( cNodeName == wxT(
"FIX" ) )
2013 else if( cNodeName == wxT(
"GROUPREF" ) )
2015 else if( cNodeName == wxT(
"REUSEBLOCKREF" ) )
2016 ReuseBlockRef.Parse( cNode, aContext );
2017 else if( cNodeName == wxT(
"TESTLAND" ) )
2019 else if( cNode->GetName() == wxT(
"TRUNKREF" ) )
2030 wxASSERT( aNode->GetName() == wxT(
"COPTERM" ) );
2041 wxASSERT( aNode->GetName() == wxT(
"ROUTEWIDTH" ) );
2044 XNODE* prevNode = aNode;
2047 for( ; nextNode; nextNode = nextNode->
GetNext() )
2049 if( nextNode->GetName() == wxT(
"FIX" ) )
2053 else if( nextNode->GetName() == wxT(
"TDROPATSTART" ) )
2055 TeardropAtStart =
true;
2058 else if( nextNode->GetName() == wxT(
"TDROPATEND" ) )
2060 TeardropAtEnd =
true;
2063 else if( VERTEX::IsVertex( nextNode ) )
2065 Vertex.Parse( nextNode, aContext );
2067 else if( nextNode->GetName() == wxT(
"ROUTEWIDTH" ) )
2076 prevNode = nextNode;
2085 wxASSERT( aNode->GetName() == wxT(
"ROUTE" ) );
2091 bool startPointParsed =
false;
2093 for( ; cNode; cNode = cNode->
GetNext() )
2095 wxString cNodeName = cNode->GetName();
2097 if( !startPointParsed && cNodeName == wxT(
"PT" ) )
2099 startPointParsed =
true;
2100 StartPoint.Parse( cNode, aContext );
2102 else if( cNodeName == wxT(
"ROUTEWIDTH" ) )
2105 cNode = rtVert.
Parse( cNode, aContext );
2106 RouteVertices.push_back( rtVert );
2108 assert( cNode !=
nullptr );
2121 ParseIdentifiers( aNode, aContext );
2125 bool routeParsed =
false;
2127 for( ; cNode; cNode = cNode->
GetNext() )
2129 wxString cNodeName = cNode->GetName();
2131 if( ParseSubNode( cNode, aContext ) )
2135 else if( !Unrouted && !routeParsed && cNodeName == wxT(
"ROUTE" ) )
2137 Route.Parse( cNode, aContext );
2140 else if( !routeParsed && cNodeName == wxT(
"UNROUTE" ) )
2145 else if( cNode->GetName() == wxT(
"TRUNKREF" ) )
2159 ParseIdentifiers( aNode, aContext );
2164 for( ; cNode; cNode = cNode->
GetNext() )
2166 wxString cNodeName = cNode->GetName();
2168 if( cNodeName == wxT(
"JPT" ) )
2171 jpt.
Parse( cNode, aContext );
2172 Junctions.insert( std::make_pair( jpt.
ID, jpt ) );
2174 else if( ParseSubNode( cNode, aContext ) )
2178 else if( cNodeName == wxT(
"PIN" ) )
2181 pin.Parse( cNode, aContext );
2182 Pins.insert( std::make_pair(
pin.ID,
pin ) );
2184 else if( cNodeName == wxT(
"VIA" ) )
2187 via.Parse( cNode, aContext );
2188 Vias.insert( std::make_pair(
via.ID,
via ) );
2190 else if( cNodeName == wxT(
"COPTERM" ) )
2193 cterm.
Parse( cNode, aContext );
2194 CopperTerminals.insert( std::make_pair( cterm.
ID, cterm ) );
2196 else if( cNodeName == wxT(
"CONN" ) )
2199 conn.
Parse( cNode, aContext );
2200 Connections.push_back( conn );
2212 wxASSERT( aNode->GetName() == wxT(
"POURING" ) );
2224 if( MinIsolCopStr == wxT(
"NONE" ) )
2231 if( MinDisjCopStr == wxT(
"NONE" ) )
2238 for( ; cNode; cNode = cNode->
GetNext() )
2240 wxString cNodeName = cNode->GetName();
2242 if( cNodeName == wxT(
"NOPINRELIEF" ) )
2244 ThermalReliefOnPads =
false;
2246 else if( cNodeName == wxT(
"NOVIARELIEF" ) )
2248 ThermalReliefOnVias =
false;
2250 else if( cNodeName == wxT(
"IGNORETRN" ) )
2252 AllowInNoRouting =
true;
2254 else if( cNodeName == wxT(
"BOXPINS" ) )
2256 BoxIsolatedPins =
true;
2258 else if( cNodeName == wxT(
"REGENERATE" ) )
2260 AutomaticRepour =
true;
2262 else if( cNodeName == wxT(
"AUTOROUTETARGET" ) )
2264 TargetForAutorouting =
true;
2266 else if( cNodeName == wxT(
"THERMALCUTOUT" ) )
2268 ReliefType = RELIEF_TYPE::CUTOUTS;
2270 else if( cNodeName == wxT(
"FILLED" ) )
2272 FillType = COPPER_FILL_TYPE::FILLED;
2274 else if( cNodeName == wxT(
"HATCHCODEREF" ) )
2276 FillType = COPPER_FILL_TYPE::HATCHED;
2289 wxASSERT( aNode->GetName() == wxT(
"TEMPLATE" ) );
2298 bool shapeParsed =
false;
2299 bool pouringParsed =
false;
2301 for( ; cNode; cNode = cNode->
GetNext() )
2303 wxString cNodeName = cNode->GetName();
2305 if( !shapeParsed && SHAPE::IsShape( cNode ) )
2307 Shape.Parse( cNode, aContext );
2310 else if( !pouringParsed && cNodeName == wxT(
"POURING" ) )
2312 Pouring.Parse( cNode, aContext );
2313 pouringParsed =
true;
2315 else if( cNodeName == wxT(
"FIX" ) )
2319 else if( cNodeName == wxT(
"GROUPREF" ) )
2323 else if( cNodeName == wxT(
"REUSEBLOCKREF" ) )
2325 ReuseBlockRef.Parse( cNode, aContext );
2327 else if( cNodeName == wxT(
"ATTR" ) )
2330 attr.
Parse( cNode, aContext );
2331 AttributeValues.insert( std::make_pair( attr.
AttributeID, attr ) );
2344 wxASSERT( aNode->GetName() == wxT(
"TERM" ) );
2349 bool locationParsed =
false;
2351 for( ; cNode; cNode = cNode->
GetNext() )
2353 wxString cNodeName = cNode->GetName();
2355 if( !locationParsed && cNodeName == wxT(
"PT" ) )
2357 Location.Parse( cNode, aContext );
2358 locationParsed =
true;
2360 else if( cNodeName == wxT(
"FIX" ) )
2374 wxASSERT( aNode->GetName() == wxT(
"NETREF" ) );
2380 for( ; cNode; cNode = cNode->
GetNext() )
2382 wxString cNodeName = cNode->GetName();
2384 if( cNodeName == wxT(
"TERM" ) )
2387 term.
Parse( cNode, aContext );
2388 CopperTerminals.insert( std::make_pair( term.
ID, term ) );
2390 else if( cNodeName == wxT(
"FIX" ) )
2404 wxASSERT( aNode->GetName() == wxT(
"COPPER" ) );
2411 bool shapeParsed =
false;
2412 bool netRefParsed =
false;
2414 for( ; cNode; cNode = cNode->
GetNext() )
2416 wxString cNodeName = cNode->GetName();
2418 if( !shapeParsed && SHAPE::IsShape( cNode ) )
2420 Shape.Parse( cNode, aContext );
2423 else if( !netRefParsed && cNodeName == wxT(
"NETREF" ) )
2425 NetRef.Parse( cNode, aContext );
2426 netRefParsed =
true;
2428 else if( cNodeName == wxT(
"FIX" ) )
2432 else if( cNodeName == wxT(
"GROUPREF" ) )
2436 else if( cNodeName == wxT(
"REUSEBLOCKREF" ) )
2438 ReuseBlockRef.Parse( cNode, aContext );
2440 else if( cNodeName == wxT(
"POURED" ) )
2444 else if( cNodeName == wxT(
"ATTR" ) )
2447 attr.
Parse( cNode, aContext );
2448 AttributeValues.insert( std::make_pair( attr.
AttributeID, attr ) );
2460 wxASSERT( aNode->GetName() == wxT(
"DRILLTABLE" ) );
2466 bool positionParsed =
false;
2468 for( ; cNode; cNode = cNode->
GetNext() )
2470 wxString cNodeName = cNode->GetName();
2472 if( !positionParsed && cNodeName == wxT(
"PT" ) )
2474 Position.Parse( cNode, aContext );
2475 positionParsed =
true;
2477 else if( cNodeName == wxT(
"ORIENT" ) )
2481 else if( cNodeName == wxT(
"MIRROR" ) )
2485 else if( cNodeName == wxT(
"FIX" ) )
2489 else if( cNodeName == wxT(
"READABILITY" ) )
2493 else if( cNodeName == wxT(
"GROUPREF" ) )
2497 else if( cNodeName == wxT(
"REUSEBLOCKREF" ) )
2499 ReuseBlockRef.Parse( cNode, aContext );
2511 wxASSERT( aNode->GetName() == wxT(
"LAYOUT" ) );
2514 bool netSynchParsed =
false;
2515 bool dimensionsParsed =
false;
2517 for( ; cNode; cNode = cNode->
GetNext() )
2519 wxString cNodeName = cNode->GetName();
2521 if( !netSynchParsed && cNodeName == wxT(
"NETSYNCH" ) )
2523 std::map<wxString, NETSYNCH> netSynchMap = { { wxT(
"WARNING" ),
NETSYNCH::WARNING },
2528 if( netSynchMap.find( nsString ) == netSynchMap.end() )
2531 NetSynch = netSynchMap[nsString];
2532 netSynchParsed =
true;
2534 else if( cNodeName == wxT(
"GROUP" ) )
2537 group.Parse( cNode, aContext );
2538 Groups.insert( std::make_pair(
group.ID,
group ) );
2540 else if( cNodeName == wxT(
"REUSEBLOCK" ) )
2543 reuseblock.
Parse( cNode, aContext );
2544 ReuseBlocks.insert( std::make_pair( reuseblock.
ID, reuseblock ) );
2546 else if( cNodeName == wxT(
"BOARD" ) )
2549 board.
Parse( cNode, aContext );
2550 Boards.insert( std::make_pair( board.
ID, board ) );
2552 else if( cNodeName == wxT(
"FIGURE" ) )
2555 figure.
Parse( cNode, aContext );
2556 Figures.insert( std::make_pair( figure.
ID, figure ) );
2558 else if( cNodeName == wxT(
"AREA" ) )
2561 area.
Parse( cNode, aContext );
2562 Areas.insert( std::make_pair( area.
ID, area ) );
2564 else if( cNodeName == wxT(
"COMP" ) )
2567 comp.
Parse( cNode, aContext );
2568 Components.insert( std::make_pair( comp.
ID, comp ) );
2570 else if( cNodeName == wxT(
"TRUNK" ) )
2573 trunk.
Parse( cNode, aContext );
2574 Trunks.insert( std::make_pair( trunk.
ID, trunk ) );
2576 else if( cNodeName == wxT(
"NET" ) )
2579 net.
Parse( cNode, aContext );
2580 Nets.insert( std::make_pair( net.
ID, net ) );
2582 else if( cNodeName == wxT(
"TEMPLATE" ) )
2585 temp.
Parse( cNode, aContext );
2586 Templates.insert( std::make_pair( temp.
ID, temp ) );
2588 else if( cNodeName == wxT(
"COPPER" ) )
2591 copper.
Parse( cNode, aContext );
2592 Coppers.insert( std::make_pair( copper.
ID, copper ) );
2594 else if( cNodeName == wxT(
"TEXT" ) )
2597 txt.
Parse( cNode, aContext );
2598 Texts.insert( std::make_pair( txt.
ID, txt ) );
2600 else if( cNodeName == wxT(
"DOCSYMBOL" ) )
2603 docsym.
Parse( cNode, aContext );
2604 DocumentationSymbols.insert( std::make_pair( docsym.
ID, docsym ) );
2606 else if( !dimensionsParsed && cNodeName == wxT(
"DIMENSIONS" ) )
2610 for( ; dimensionNode; dimensionNode = dimensionNode->
GetNext() )
2615 dim.
Parse( dimensionNode, aContext );
2616 Dimensions.insert( std::make_pair( dim.
ID, dim ) );
2624 dimensionsParsed =
true;
2626 else if( cNodeName == wxT(
"DRILLTABLE" ) )
2629 drilltable.
Parse( cNode, aContext );
2630 DrillTables.insert( std::make_pair( drilltable.
ID, drilltable ) );
2632 else if( cNodeName == wxT(
"VHIERARCHY" ) )
2634 VariantHierarchy.Parse( cNode, aContext );
2636 else if( cNodeName == wxT(
"ERRORMARK" ) )
constexpr double PCB_IU_PER_MM
#define THROW_MISSING_NODE_IO_ERROR(nodename, location)
#define THROW_UNKNOWN_NODE_IO_ERROR(nodename, location)
#define THROW_UNKNOWN_PARAMETER_IO_ERROR(param, location)
#define THROW_MISSING_PARAMETER_IO_ERROR(param, location)
#define THROW_PARSING_IO_ERROR(param, location)
static UNITS ParseUnits(XNODE *aNode)
static SWAP_RULE ParseSwapRule(XNODE *aNode)
static const long UNDEFINED_VALUE
static void CheckNoNextNodes(XNODE *aNode)
static XNODE * LoadArchiveFile(const wxString &aFileName, const wxString &aFileTypeIdentifier, PROGRESS_REPORTER *aProgressReporter=nullptr)
Reads a CADSTAR Archive file (S-parameter format)
wxString LAYER_ID
ID of a Sheet (if schematic) or board Layer (if PCB)
static ANGUNITS ParseAngunits(XNODE *aNode)
long PART_DEFINITION_PIN_ID
Pin identifier in the part definition.
static wxString GetXmlAttributeIDString(XNODE *aNode, unsigned int aID, bool aIsRequired=true)
void checkPoint()
Updates m_progressReporter or throws if user cancelled.
static bool IsValidAttribute(wxXmlAttribute *aAttribute)
static READABILITY ParseReadability(XNODE *aNode)
static void CheckNoChildNodes(XNODE *aNode)
static long GetXmlAttributeIDLong(XNODE *aNode, unsigned int aID, bool aIsRequired=true)
static void ParseChildEValue(XNODE *aNode, PARSER_CONTEXT *aContext, EVALUE &aValueToParse)
static long GetNumberOfStepsForReporting(XNODE *aRootNode, std::vector< wxString > aSubNodeChildrenToCount)
PROGRESS_REPORTER * m_progressReporter
static TESTLAND_SIDE ParseTestlandSide(XNODE *aNode)
@ STARPOINT
From CADSTAR Help: "Starpoints are special symbols/components that can be used to electrically connec...
@ JUMPER
From CADSTAR Help: "Jumpers are components used primarily for the purpose of routing.
@ COMPONENT
Standard PCB Component definition.
@ TESTPOINT
From CADSTAR Help: "A testpoint is an area of copper connected to a net.
@ ANTI_ROUTE
Keyword "ANTITRACK".
@ OBSTACLE
Keyword "OBSTACLE".
@ UNBIASED
Keyword "UNBIASED" (default)
long PAD_ID
Pad identifier (pin) in the PCB.
@ LAYERSUBTYPE_SOLDERRESIST
@ LAYERSUBTYPE_SILKSCREEN
void Parse(bool aLibrary=false)
Parses the file.
int KiCadUnitMultiplier
Use this value to convert units in this CPA file to KiCad units.
@ ALLELEC
Inbuilt layer type (cannot be assigned to user layers)
@ ALLDOC
Inbuilt layer type (cannot be assigned to user layers)
@ NONELEC
This type has subtypes.
@ NOLAYER
Inbuilt layer type (cannot be assigned to user layers)
@ JUMPERLAYER
Inbuilt layer type (cannot be assigned to user layers)
@ ALLLAYER
Inbuilt layer type (cannot be assigned to user layers)
@ ASSCOMPCOPP
Inbuilt layer type (cannot be assigned to user layers)
@ ROUNDED_RECT
Keyword "ROUNDED".
@ MAX
The highest PHYSICAL_LAYER_ID currently defined (i.e. back / bottom side).
@ MIN
The lowest PHYSICAL_LAYER_ID currently defined (i.e. front / top side).
static PAD_SIDE GetPadSide(const wxString &aPadSideString)
PAD_SIDE
From CADSTAR Help: "This parameter indicates the physical layers on which the selected pad is placed.
@ MAXIMUM
The highest PHYSICAL_LAYER_ID currently defined (i.e.
@ MINIMUM
PHYSICAL_LAYER_ID 1 (i.e.
@ THROUGH_HOLE
All physical layers currently defined.
virtual void BeginPhase(int aPhase)=0
Initialize the aPhase virtual zone of the dialog progress bar.
virtual void SetMaxProgress(int aMaxProgress)=0
Fix the value that gives the 100 percent progress bar length (inside the current virtual zone).
Hold an XML or S-expression element.
XNODE * GetChildren() const
#define THROW_IO_ERROR(msg)
This file contains miscellaneous commonly used macros and functions.
#define KI_FALLTHROUGH
The KI_FALLTHROUGH macro is to be used when switch statement cases should purposely fallthrough from ...
void Parse(XNODE *aNode, PARSER_CONTEXT *aContext) override
DOCUMENTATION_SYMBOL_ID ID
void Parse(XNODE *aNode, PARSER_CONTEXT *aContext) override
void Parse(XNODE *aNode, PARSER_CONTEXT *aContext) override
NETELEMENT_ID ID
First character is "J".
std::function< void()> CheckPointCallback
Callback function to report progress.
void Parse(XNODE *aNode, PARSER_CONTEXT *aContext) override
void Parse(XNODE *aNode, PARSER_CONTEXT *aContext) override
Corresponds to CADSTAR "origin".
void Parse(XNODE *aNode, PARSER_CONTEXT *aContext) override
void Parse(XNODE *aNode, PARSER_CONTEXT *aContext) override
From CADSTAR Help: "Area is for creating areas within which, and nowhere else, certain operations are...
void Parse(XNODE *aNode, PARSER_CONTEXT *aContext) override
TECHNOLOGY_SECTION Technology
bool SpacingclassEditAttributeSettings
void Parse(XNODE *aNode, PARSER_CONTEXT *aContext) override
bool NetclassEditAttributeSettings
void Parse(XNODE *aNode, PARSER_CONTEXT *aContext) override
static bool IsPadShape(XNODE *aNode)
void Parse(XNODE *aNode, PARSER_CONTEXT *aContext) override
void Parse(XNODE *aNode, PARSER_CONTEXT *aContext) override
From CADSTAR Help: "Area is for creating areas within which, and nowhere else, certain operations are...
void Parse(XNODE *aNode, PARSER_CONTEXT *aContext) override
A shape of copper in the component footprint.
void Parse(XNODE *aNode, PARSER_CONTEXT *aContext) override
void Parse(XNODE *aNode, PARSER_CONTEXT *aContext) override
void Parse(XNODE *aNode, PARSER_CONTEXT *aContext) override
void Parse(XNODE *aNode, PARSER_CONTEXT *aContext) override
void Parse(XNODE *aNode, PARSER_CONTEXT *aContext) override
void Parse(XNODE *aNode, PARSER_CONTEXT *aContext) override
void Parse(XNODE *aNode, PARSER_CONTEXT *aContext) override
void Parse(XNODE *aNode, PARSER_CONTEXT *aContext) override
void Parse(XNODE *aNode, PARSER_CONTEXT *aContext) override
void Parse(XNODE *aNode, PARSER_CONTEXT *aContext) override
static bool IsLine(XNODE *aNode)
void Parse(XNODE *aNode, PARSER_CONTEXT *aContext) override
void Parse(XNODE *aNode, PARSER_CONTEXT *aContext) override
Linear, leader (radius/diameter) or angular dimension.
static bool IsDimension(XNODE *aNode)
void Parse(XNODE *aNode, PARSER_CONTEXT *aContext) override
DIMENSION_ID ID
Some ID (doesn't seem to be used) subnode="DIMREF".
void Parse(XNODE *aNode, PARSER_CONTEXT *aContext) override
void Parse(XNODE *aNode, PARSER_CONTEXT *aContext) override
void Parse(XNODE *aNode, PARSER_CONTEXT *aContext) override
void Parse(XNODE *aNode, PARSER_CONTEXT *aContext) override
void Parse(XNODE *aNode, PARSER_CONTEXT *aContext) override
void Parse(XNODE *aNode, PARSER_CONTEXT *aContext) override
void Parse(XNODE *aNode, PARSER_CONTEXT *aContext) override
void Parse(XNODE *aNode, PARSER_CONTEXT *aContext) override
void Parse(XNODE *aNode, PARSER_CONTEXT *aContext) override
NETELEMENT_ID ID
First two character are "CT".
void Parse(XNODE *aNode, PARSER_CONTEXT *aContext) override
< "PIN" nodename (represents a PAD in a PCB component)
void Parse(XNODE *aNode, PARSER_CONTEXT *aContext) override
< Two sibbling nodes: first node being "ROUTEWIDTH" and next node being a VERTEX (e....
XNODE * Parse(XNODE *aNode, PARSER_CONTEXT *aContext)
void Parse(XNODE *aNode, PARSER_CONTEXT *aContext) override
void Parse(XNODE *aNode, PARSER_CONTEXT *aContext) override
void Parse(XNODE *aNode, PARSER_CONTEXT *aContext) override
void Parse(XNODE *aNode, PARSER_CONTEXT *aContext) override
void Parse(XNODE *aNode, PARSER_CONTEXT *aContext) override
void Parse(XNODE *aNode, PARSER_CONTEXT *aContext) override
void Parse(XNODE *aNode, PARSER_CONTEXT *aContext) override
void Parse(XNODE *aNode, PARSER_CONTEXT *aContext) override
PART_DEFINITION_PIN_ID Pin
void Parse(XNODE *aNode, PARSER_CONTEXT *aContext) override
void Parse(XNODE *aNode, PARSER_CONTEXT *aContext) override
SPACINGCODE_ID ID
Possible spacing rules:
void Parse(XNODE *aNode, PARSER_CONTEXT *aContext) override
void Parse(XNODE *aNode, PARSER_CONTEXT *aContext) override
void Parse(XNODE *aNode, PARSER_CONTEXT *aContext) override
void Parse(XNODE *aNode, PARSER_CONTEXT *aContext) override
void Parse(XNODE *aNode, PARSER_CONTEXT *aContext) override
Templates are CADSTAR's equivalent to a "filled zone".
void Parse(XNODE *aNode, PARSER_CONTEXT *aContext) override
void Parse(XNODE *aNode, PARSER_CONTEXT *aContext) override
void Parse(XNODE *aNode, PARSER_CONTEXT *aContext) override
void Parse(XNODE *aNode, PARSER_CONTEXT *aContext) override