KiCad PCB EDA Suite
Loading...
Searching...
No Matches
conn_presentation.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 3 of the License, or (at your
9 * option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful, but
12 * WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * 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
21#include <sch_item.h>
22#include <wx/thread.h>
23#include <sch_connection.h>
24#include <string_utils.h>
25#include <widgets/msgpanel.h>
26
28 const SCH_ITEM& aItem, std::vector<MSG_PANEL_ITEM>& aList, const SCH_SHEET_PATH* aPath )
29{
30 wxASSERT( wxThread::IsMain() );
31 wxString name;
32 bool isBus;
33
34 const SCH_CONNECTION* connection = aItem.Connection( aPath );
35
36 if( !connection )
37 return std::nullopt;
38
39 connection->AppendInfoToMsgPanel( aList );
40 name = connection->Name();
41 isBus = connection->IsBus();
42
43 if( isBus )
44 return std::nullopt;
45
46 aList.emplace_back( _( "Resolved Netclass" ),
48 return name;
49}
const char * name
const wxString GetHumanReadableName() const
Gets the consolidated name of this netclass (which may be an aggregate).
Definition netclass.cpp:334
Each graphical item can have a SCH_CONNECTION describing its logical connection (to a bus or net).
wxString Name(bool aIgnoreSheet=false) const
bool IsBus() const
void AppendInfoToMsgPanel(std::vector< MSG_PANEL_ITEM > &aList) const
Adds information about the connection object to aList.
Base class for any item which can be embedded within the SCHEMATIC container class,...
Definition sch_item.h:165
std::shared_ptr< NETCLASS > GetEffectiveNetClass(const SCH_SHEET_PATH *aSheet=nullptr) const
Definition sch_item.cpp:556
SCH_CONNECTION * Connection(const SCH_SHEET_PATH *aSheet=nullptr) const
Retrieve the connection associated with this object in the given sheet.
Definition sch_item.cpp:503
Handle access to a stack of flattened SCH_SHEET objects by way of a path for creating a flattened sch...
#define _(s)
Message panel definition file.
std::optional< wxString > AppendConnectionInfo(const SCH_ITEM &aItem, std::vector< MSG_PANEL_ITEM > &aList, const SCH_SHEET_PATH *aPath=nullptr)
Append connection details; return its name for a signal, or no value for a bus/missing row.
wxString UnescapeString(const wxString &aSource)