KiCad PCB EDA Suite
PCAD2KICAD::PCB_NET Class Reference

#include <pcb_net.h>

Inheritance diagram for PCAD2KICAD::PCB_NET:

Public Member Functions

 PCB_NET (int aNetCode)
 
 ~PCB_NET ()
 
void Parse (XNODE *aNode)
 

Public Attributes

wxString m_name
 
int m_netCode
 
PCB_NET_NODES_ARRAY m_netNodes
 

Detailed Description

Definition at line 51 of file pcb_net.h.

Constructor & Destructor Documentation

PCAD2KICAD::PCB_NET::PCB_NET ( int  aNetCode)

Definition at line 49 of file pcb_net.cpp.

References m_name.

49  : m_netCode( aNetCode )
50 {
51  m_name = wxEmptyString;
52 }
wxString m_name
Definition: pcb_net.h:54
PCAD2KICAD::PCB_NET::~PCB_NET ( )

Definition at line 55 of file pcb_net.cpp.

References m_netNodes.

56 {
57  int i;
58 
59  for( i = 0; i < (int) m_netNodes.GetCount(); i++ )
60  {
61  delete m_netNodes[i];
62  }
63 }
PCB_NET_NODES_ARRAY m_netNodes
Definition: pcb_net.h:56

Member Function Documentation

void PCAD2KICAD::PCB_NET::Parse ( XNODE aNode)

Definition at line 66 of file pcb_net.cpp.

References PCAD2KICAD::FindNode(), XNODE::GetNext(), PCAD2KICAD::PCB_NET_NODE::m_compRef, m_name, m_netNodes, and PCAD2KICAD::PCB_NET_NODE::m_pinRef.

Referenced by PCAD2KICAD::PCB::Parse().

67 {
68  wxString propValue, s1, s2;
69  PCB_NET_NODE* netNode;
70  XNODE* lNode;
71 
72  aNode->GetAttribute( wxT( "Name" ), &propValue );
73  propValue.Trim( false );
74  propValue.Trim( true );
75  m_name = propValue;
76 
77  lNode = FindNode( aNode, wxT( "node" ) );
78 
79  while( lNode )
80  {
81  lNode->GetAttribute( wxT( "Name" ), &s2 );
82  s2.Trim( false );
83  s1 = wxEmptyString;
84 
85  while( s2.Len() > 0 && s2[0] != wxT( ' ' ) )
86  {
87  s1 = s1 + s2[0];
88  s2 = s2.Mid( 1 );
89  }
90 
91  netNode = new PCB_NET_NODE;
92  s1.Trim( false );
93  s1.Trim( true );
94  netNode->m_compRef = s1;
95 
96  s2.Trim( false );
97  s2.Trim( true );
98  netNode->m_pinRef = s2;
99  m_netNodes.Add( netNode );
100  lNode = lNode->GetNext();
101  }
102 }
wxString m_name
Definition: pcb_net.h:54
PCB_NET_NODES_ARRAY m_netNodes
Definition: pcb_net.h:56
Class XNODE holds an XML or S-expression element.
Definition: xnode.h:43
XNODE * FindNode(XNODE *aChild, wxString aTag)
XNODE * GetNext() const
Definition: xnode.h:68

Member Data Documentation

wxString PCAD2KICAD::PCB_NET::m_name
int PCAD2KICAD::PCB_NET::m_netCode

Definition at line 55 of file pcb_net.h.

Referenced by PCAD2KICAD::PCB::AddToBoard(), and PCAD2KICAD::PCB::GetNetCode().

PCB_NET_NODES_ARRAY PCAD2KICAD::PCB_NET::m_netNodes

Definition at line 56 of file pcb_net.h.

Referenced by Parse(), PCAD2KICAD::PCB::Parse(), and ~PCB_NET().


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