• Maciej Suminski's avatar
    BOARD_CONNECTED_ITEMs do not store net code anymore (m_NetCode field), instead... · d62b47a0
    Maciej Suminski authored
    BOARD_CONNECTED_ITEMs do not store net code anymore (m_NetCode field), instead net info is stored using a pointer to NETINFO_ITEM.
    GetNet() refers to the net code stored in the NETINFO_ITEM. SetNet() finds an appropriate NETINFO_ITEM and uses it.
    Removing GetNet() & SetNet() (and the whole net code idea) requires too many changes in the code (~250 references to the mentioned functions).
    BOARD_CONNECTED_ITEMs by default get a pointer to NETINFO_ITEM that stores unconnected items. This requires for all BOARD_CONNECTED_ITEMs to have a parent (so BOARD* is accessible). The only orphaned item is BOARD_DESIGN_SETTINGS::m_Pad_Master, but it does not cause any issues so far.
    Items that do not have access to a BOARD (do not have set parents) and therefore cannot get net assigned, by default get const static NETINFO_LIST::ORPHANED.
    
    Performed tests:
    - loaded .kicad_pcb, KiCad legacy board, Eagle 6.0 board, P-CAD board - all ok
    - load a simple project, reload netlist after changing connections in eeschema - ok
    - save & reload a board - ok, but still contain empty nets
    - remove everything, restore with undo - ok
    - remove everything, reload netlist - ok
    - changing net names (all possibilites: empty->existing, empty->not existing, existing->empty, existing->not existing) - all ok
    - zones: when net is changed to a net that does not have any nodes besides the zone itself, it does not get filled
    d62b47a0
pcb_parser.h 8.84 KB