KiCad PCB EDA Suite
|
#include <netinfo.h>
Classes | |
class | iterator |
Wrapper class, so you can iterate through NETINFO_ITEM*s, not std::pair<int/wxString, NETINFO_ITEM*> More... | |
Public Member Functions | |
NETINFO_MAPPING () | |
void | SetBoard (const BOARD *aBoard) |
Set a BOARD object that is used to prepare the net code map. | |
void | Update () |
Prepare a mapping for net codes so they can be saved as consecutive numbers. | |
int | Translate (int aNetCode) const |
Translate net number according to the map prepared by Update() function. | |
iterator | begin () const |
Return iterator to the first entry in the mapping. | |
iterator | end () const |
Return iterator to the last entry in the mapping. | |
int | GetSize () const |
Private Attributes | |
const BOARD * | m_board |
Board for which mapping is prepared. | |
std::map< int, int > | m_netMapping |
Map that allows saving net codes with consecutive numbers (for compatibility reasons) | |
|
inline |
|
inline |
Return iterator to the first entry in the mapping.
Definition at line 298 of file netinfo.h.
References m_netMapping.
|
inline |
Return iterator to the last entry in the mapping.
Definition at line 309 of file netinfo.h.
References m_netMapping.
|
inline |
Definition at line 317 of file netinfo.h.
References m_netMapping.
|
inline |
Set a BOARD object that is used to prepare the net code map.
Definition at line 223 of file netinfo.h.
References m_board, and Update().
Referenced by CLIPBOARD_IO::SaveBoard(), PCB_IO_KICAD_SEXPR::SaveBoard(), and CLIPBOARD_IO::SaveSelection().
int NETINFO_MAPPING::Translate | ( | int | aNetCode | ) | const |
Translate net number according to the map prepared by Update() function.
It allows one to have items stored with consecutive net codes.
aNetCode | is an old net code. |
Definition at line 275 of file netinfo_list.cpp.
References m_netMapping.
Referenced by PCB_IO_KICAD_SEXPR::format(), and PCB_IO_KICAD_SEXPR::formatNetInformation().
void NETINFO_MAPPING::Update | ( | ) |
Prepare a mapping for net codes so they can be saved as consecutive numbers.
To retrieve a mapped net code, use translateNet() function after calling this.
Definition at line 287 of file netinfo_list.cpp.
References BOARD::Drawings(), BOARD::Footprints(), BOARD_CONNECTED_ITEM::GetNetCode(), m_board, m_netMapping, pad, PCB_SHAPE_T, BOARD::Tracks(), and BOARD::Zones().
Referenced by SetBoard().
|
private |
Board for which mapping is prepared.
Definition at line 323 of file netinfo.h.
Referenced by NETINFO_MAPPING(), NETINFO_MAPPING::iterator::operator*(), SetBoard(), and Update().
|
private |