KiCad PCB EDA Suite
CADSTAR_ARCHIVE_PARSER::ATTRNAME Struct Reference

NOTE from CADSTAR help: To convert a Part Definition Attribute into a hyperlink, prefix the attribute name with "Link ". More...

#include <cadstar_archive_parser.h>

Inheritance diagram for CADSTAR_ARCHIVE_PARSER::ATTRNAME:
CADSTAR_ARCHIVE_PARSER::PARSER

Classes

struct  COLUMNORDER
 
struct  COLUMNWIDTH
 

Public Member Functions

void Parse (XNODE *aNode, PARSER_CONTEXT *aContext) override
 

Public Attributes

ATTRIBUTE_ID ID
 
wxString Name
 Parenthesis aren't permitted in user attributes in CADSTAR. More...
 
ATTROWNER AttributeOwner = ATTROWNER::ALL_ITEMS
 
ATTRUSAGE AttributeUsage = ATTRUSAGE::UNDEFINED
 
bool NoTransfer = false
 True="All Design Types", False="Current Design Type" "All Design Types" Description from CADSTAR Help: "The selected attribute name will be available when any design is displayed" "Current Design Type" From CADSTAR Help: This restricts the availability of the selected attribute name to the current design. More...
 
std::vector< COLUMNORDERColumnOrders
 
std::vector< COLUMNWIDTHColumnWidths
 
bool ColumnInvisible = false
 

Detailed Description

NOTE from CADSTAR help: To convert a Part Definition Attribute into a hyperlink, prefix the attribute name with "Link ".

Definition at line 695 of file cadstar_archive_parser.h.

Member Function Documentation

◆ Parse()

void CADSTAR_ARCHIVE_PARSER::ATTRNAME::Parse ( XNODE aNode,
PARSER_CONTEXT aContext 
)
overridevirtual

Implements CADSTAR_ARCHIVE_PARSER::PARSER.

Definition at line 1081 of file cadstar_archive_parser.cpp.

1082 {
1083  wxASSERT( aNode->GetName() == wxT( "ATTRNAME" ) );
1084 
1085  ID = GetXmlAttributeIDString( aNode, 0 );
1086  Name = GetXmlAttributeIDString( aNode, 1 );
1087 
1088  XNODE* cNode = aNode->GetChildren();
1089  wxString location = wxString::Format( "ATTRNAME -> %s", Name );
1090 
1091  for( ; cNode; cNode = cNode->GetNext() )
1092  {
1093  wxString cNodeName = cNode->GetName();
1094 
1095  if( cNodeName == wxT( "ATTROWNER" ) )
1096  {
1097  wxString attOwnerVal = GetXmlAttributeIDString( cNode, 0 );
1098 
1099  if( attOwnerVal == wxT( "ALL_ITEMS" ) )
1101  else if( attOwnerVal == wxT( "AREA" ) )
1103  else if( attOwnerVal == wxT( "BOARD" ) )
1105  else if( attOwnerVal == wxT( "COMPONENT" ) )
1107  else if( attOwnerVal == wxT( "CONNECTION" ) )
1109  else if( attOwnerVal == wxT( "COPPER" ) )
1111  else if( attOwnerVal == wxT( "DOCSYMBOL" ) )
1113  else if( attOwnerVal == wxT( "FIGURE" ) )
1115  else if( attOwnerVal == wxT( "NET" ) )
1117  else if( attOwnerVal == wxT( "NETCLASS" ) )
1119  else if( attOwnerVal == wxT( "PART" ) )
1121  else if( attOwnerVal == wxT( "PART_DEFINITION" ) )
1123  else if( attOwnerVal == wxT( "PIN" ) )
1125  else if( attOwnerVal == wxT( "SIGNALREF" ) )
1127  else if( attOwnerVal == wxT( "SYMBOL" ) )
1129  else if( attOwnerVal == wxT( "SYMDEF" ) )
1131  else if( attOwnerVal == wxT( "TEMPLATE" ) )
1133  else if( attOwnerVal == wxT( "TESTPOINT" ) )
1135  else
1136  THROW_UNKNOWN_PARAMETER_IO_ERROR( attOwnerVal, location );
1137  }
1138  else if( cNodeName == wxT( "ATTRUSAGE" ) )
1139  {
1140  wxString attUsageVal = GetXmlAttributeIDString( cNode, 0 );
1141 
1142  if( attUsageVal == wxT( "BOTH" ) )
1144  else if( attUsageVal == wxT( "COMPONENT" ) )
1146  else if( attUsageVal == wxT( "PART_DEFINITION" ) )
1148  else if( attUsageVal == wxT( "PART_LIBRARY" ) )
1150  else if( attUsageVal == wxT( "SYMBOL" ) )
1152  else
1153  THROW_UNKNOWN_PARAMETER_IO_ERROR( attUsageVal, location );
1154  }
1155  else if( cNodeName == wxT( "NOTRANSFER" ) )
1156  {
1157  NoTransfer = true;
1158  }
1159  else if( cNodeName == wxT( "COLUMNORDER" ) )
1160  {
1161  COLUMNORDER cOrder;
1162  cOrder.Parse( cNode, aContext );
1163  ColumnOrders.push_back( cOrder );
1164  }
1165  else if( cNodeName == wxT( "COLUMNWIDTH" ) )
1166  {
1167  COLUMNWIDTH cWidth;
1168  cWidth.Parse( cNode, aContext );
1169  ColumnWidths.push_back( cWidth );
1170  }
1171  else if( cNodeName == wxT( "COLUMNINVISIBLE" ) )
1172  {
1173  ColumnInvisible = true;
1174  }
1175  else
1176  {
1177  THROW_UNKNOWN_NODE_IO_ERROR( cNodeName, location );
1178  }
1179  }
1180 }
From CADSTAR Help: Assigned to Parts library Definitions and displayed by the Library searcher.
From CADSTAR Help: Assigned to Schematic Symbols and displayed on Schematic Designs.
std::vector< COLUMNWIDTH > ColumnWidths
From CADSTAR Help: Only used by non-Cadstar applications.
bool NoTransfer
True="All Design Types", False="Current Design Type" "All Design Types" Description from CADSTAR Help...
XNODE * GetChildren() const
Definition: xnode.h:62
std::vector< COLUMNORDER > ColumnOrders
wxString Name
Parenthesis aren't permitted in user attributes in CADSTAR.
Hold an XML or S-expression element.
Definition: xnode.h:43
void Format(OUTPUTFORMATTER *out, int aNestLevel, int aCtl, const CPTREE &aTree)
Output a PTREE into s-expression format via an OUTPUTFORMATTER derivative.
Definition: ptree.cpp:200
XNODE * GetNext() const
Definition: xnode.h:67
From CADSTAR Help: Assigned to PCB components and displayed on PCB designs.
#define THROW_UNKNOWN_NODE_IO_ERROR(nodename, location)
static wxString GetXmlAttributeIDString(XNODE *aNode, unsigned int aID, bool aIsRequired=true)
#define THROW_UNKNOWN_PARAMETER_IO_ERROR(param, location)
From CADSTAR Help: Assigned to both Schematic symbols and PCB components, and displayed on Schematic ...

References CADSTAR_ARCHIVE_PARSER::ALL_ITEMS, CADSTAR_ARCHIVE_PARSER::AREA, CADSTAR_ARCHIVE_PARSER::BOARD, CADSTAR_ARCHIVE_PARSER::BOTH, CADSTAR_ARCHIVE_PARSER::COMPONENT, CADSTAR_ARCHIVE_PARSER::CONNECTION, CADSTAR_ARCHIVE_PARSER::COPPER, CADSTAR_ARCHIVE_PARSER::DOCSYMBOL, CADSTAR_ARCHIVE_PARSER::FIGURE, Format(), XNODE::GetChildren(), XNODE::GetNext(), CADSTAR_ARCHIVE_PARSER::GetXmlAttributeIDString(), CADSTAR_ARCHIVE_PARSER::NET, CADSTAR_ARCHIVE_PARSER::NETCLASS, CADSTAR_ARCHIVE_PARSER::ATTRNAME::COLUMNORDER::Parse(), CADSTAR_ARCHIVE_PARSER::ATTRNAME::COLUMNWIDTH::Parse(), CADSTAR_ARCHIVE_PARSER::PART, CADSTAR_ARCHIVE_PARSER::PART_DEFINITION, CADSTAR_ARCHIVE_PARSER::PART_LIBRARY, CADSTAR_ARCHIVE_PARSER::PIN, CADSTAR_ARCHIVE_PARSER::SIGNALREF, CADSTAR_ARCHIVE_PARSER::SYMBOL, CADSTAR_ARCHIVE_PARSER::SYMDEF, CADSTAR_ARCHIVE_PARSER::TEMPLATE, CADSTAR_ARCHIVE_PARSER::TESTPOINT, THROW_UNKNOWN_NODE_IO_ERROR, and THROW_UNKNOWN_PARAMETER_IO_ERROR.

Referenced by CADSTAR_ARCHIVE_PARSER::CODEDEFS::ParseSubNode().

Member Data Documentation

◆ AttributeOwner

ATTROWNER CADSTAR_ARCHIVE_PARSER::ATTRNAME::AttributeOwner = ATTROWNER::ALL_ITEMS

Definition at line 719 of file cadstar_archive_parser.h.

◆ AttributeUsage

ATTRUSAGE CADSTAR_ARCHIVE_PARSER::ATTRNAME::AttributeUsage = ATTRUSAGE::UNDEFINED

Definition at line 720 of file cadstar_archive_parser.h.

◆ ColumnInvisible

bool CADSTAR_ARCHIVE_PARSER::ATTRNAME::ColumnInvisible = false

Definition at line 730 of file cadstar_archive_parser.h.

◆ ColumnOrders

std::vector<COLUMNORDER> CADSTAR_ARCHIVE_PARSER::ATTRNAME::ColumnOrders

Definition at line 728 of file cadstar_archive_parser.h.

◆ ColumnWidths

std::vector<COLUMNWIDTH> CADSTAR_ARCHIVE_PARSER::ATTRNAME::ColumnWidths

Definition at line 729 of file cadstar_archive_parser.h.

◆ ID

ATTRIBUTE_ID CADSTAR_ARCHIVE_PARSER::ATTRNAME::ID

◆ Name

wxString CADSTAR_ARCHIVE_PARSER::ATTRNAME::Name

Parenthesis aren't permitted in user attributes in CADSTAR.

Any Attributes in Parenthesis indicate an internal CADSTAR attribute Examples: "(PartDescription)" "(PartDefinitionNameStem)",etc. TODO: create a list of all CADSTAR internal attribute names.

Definition at line 715 of file cadstar_archive_parser.h.

◆ NoTransfer

bool CADSTAR_ARCHIVE_PARSER::ATTRNAME::NoTransfer = false

True="All Design Types", False="Current Design Type" "All Design Types" Description from CADSTAR Help: "The selected attribute name will be available when any design is displayed" "Current Design Type" From CADSTAR Help: This restricts the availability of the selected attribute name to the current design.

Definition at line 721 of file cadstar_archive_parser.h.


The documentation for this struct was generated from the following files: