KiCad PCB EDA Suite
Loading...
Searching...
No Matches
import_net_names.cpp
Go to the documentation of this file.
1/*
2 * This program source code file is part of KiCad, a free EDA CAD application.
3 *
4 * Copyright The KiCad Developers, see AUTHORS.txt for contributors.
5 *
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License as published by the
8 * Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program. If not, see <https://www.gnu.org/licenses/>.
18 */
19
20#include <import_net_names.h>
21#include <board.h>
24#include <reporter.h>
25
26
27bool ApplyImportedNetNameMap( BOARD& aBoard, const std::map<wxString, wxString>& aNames,
28 REPORTER& aReporter )
29{
30 if( !aBoard.RenameNets( aNames, aReporter ) )
31 return false;
32
33 if( std::shared_ptr<NET_SETTINGS> settings = aBoard.GetDesignSettings().m_NetSettings )
34 settings->RenameNets( aNames );
35
36 return true;
37}
std::shared_ptr< NET_SETTINGS > m_NetSettings
Information pertinent to a Pcbnew printed circuit board.
Definition board.h:409
bool RenameNets(const std::map< wxString, wxString > &aNewNames, REPORTER &aReporter)
Rename nets without changing net codes or connectivity.
Definition board.h:1218
BOARD_DESIGN_SETTINGS & GetDesignSettings() const
Definition board.cpp:1299
A pure virtual class used to derive REPORTER objects from.
Definition reporter.h:73
bool ApplyImportedNetNameMap(BOARD &aBoard, const std::map< wxString, wxString > &aNames, REPORTER &aReporter)
Apply caller-selected imported net names without changing net identity or connectivity.