• Maciej Suminski's avatar
    Changed the way of looking up NETINFO_ITEM using net names (using... · bf80cc77
    Maciej Suminski authored
    Changed the way of looking up NETINFO_ITEM using net names (using boost::unordered_map). Added a hash function (wxString) for that. Introduced NETINFO_ITEM::GetNetItem( wxString ). BOARD::FindNet() uses the map.
    Net codes are updated upon net list update. (BOARD::ReplaceNetlist())
    Added in some places (mostly class_board.cpp) pad->SetNet() calls to synchronize net codes.
    On creation of NETINFO_LIST, the first NETINFO_ITEM is added (the unconnected items net).
    Removed COMPONENT_NET::m_netNumber, as it was not used anywhere.
    Added an assert to D_PAD::GetNetname(), checking if net code and net name is consistent for unconnected pads. Added an assert for NETINFO_LIST::AppendNet() to assure that appended nets are unique.
    
    It seems that at this point:
    - Updating net lists works fine. The only difference between the file ouput is that after changes it contains empty nets as well.
    - Nets are not saved in the lexical order. Still, net names and net codes are properly assigned to all items in the .kicad_pcb file. It is going to be addressed in the next commit. I believe it should not create any problems, as pads are sorted by their net names anyway (NETINFO_LIST::buildPadsFullList())
    
    Performed tests:
    - Created a blank PCB, saved as pic_programmer.kicad_pcb (from demos folder). Updated net lists. .kicad_pcb file (comparing to the results from master branch) differ with net order (as mentioned before), net codes and timestamps.
    - Removed some of components from the above .kicad_pcb file and updated net lists. Modules reappeared. .kicad_pcb file differs in the same way as described above.
    - Trying to change a pad net name (via properties dialog) results in assert being fired. It is done on purpose (as there is a call to GetNetname() and net name and net code do not match). This will not happen after the next commit.
    - Prepared a simple project (starting with schematics). Imported net list, changed schematic, reimported net list - changes are applied.
    - Eagle & KiCad legacy boards seem to load without any problem.
    
    bf80cc77
Name
Last commit
Last update
3d-viewer Loading commit data...
CMakeModules Loading commit data...
Documentation Loading commit data...
bitmap2component Loading commit data...
bitmaps_png Loading commit data...
common Loading commit data...
cvpcb Loading commit data...
demos Loading commit data...
eeschema Loading commit data...
gerbview Loading commit data...
helpers/tools_to_build_newstroke-font Loading commit data...
include Loading commit data...
kicad Loading commit data...
lib_dxf Loading commit data...
new Loading commit data...
packaging Loading commit data...
pagelayout_editor Loading commit data...
patches Loading commit data...
pcb_calculator Loading commit data...
pcbnew Loading commit data...
polygon Loading commit data...
potrace Loading commit data...
resources Loading commit data...
scripting Loading commit data...
scripts Loading commit data...
template Loading commit data...
tools Loading commit data...
.bzrignore Loading commit data...
AUTHORS.txt Loading commit data...
CHANGELOG.txt Loading commit data...
CMakeLists.txt Loading commit data...
COPYRIGHT.txt Loading commit data...
CTestConfig.cmake Loading commit data...
Doxyfile Loading commit data...
HOW_TO_CONTRIBUTE.txt Loading commit data...
INSTALL.txt Loading commit data...
README.txt Loading commit data...
TODO.txt Loading commit data...
copyright.h Loading commit data...
license_for_documentation.txt Loading commit data...
notes_about_pcbnew_new_file_format.odt Loading commit data...
rules Loading commit data...
uncrustify.cfg Loading commit data...