2019-03-11 21:32:05 +00:00
|
|
|
/*
|
|
|
|
* This program source code file is part of KiCad, a free EDA CAD application.
|
|
|
|
*
|
|
|
|
* Copyright (C) 2018 CERN
|
2022-08-21 19:35:02 +00:00
|
|
|
* Copyright (C) 2021-2022 KiCad Developers, see AUTHORS.txt for contributors.
|
2019-03-11 21:32:05 +00:00
|
|
|
* @author Jon Evans <jon@craftyjon.com>
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
|
|
|
* of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License along
|
|
|
|
* with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef _BUS_ALIAS_H
|
|
|
|
#define _BUS_ALIAS_H
|
|
|
|
|
|
|
|
#include <memory>
|
2022-08-21 19:35:02 +00:00
|
|
|
#include <vector>
|
2019-03-11 21:32:05 +00:00
|
|
|
#include <wx/string.h>
|
|
|
|
|
|
|
|
|
|
|
|
class SCH_SCREEN;
|
|
|
|
|
|
|
|
|
|
|
|
class BUS_ALIAS
|
|
|
|
{
|
|
|
|
public:
|
2022-08-22 16:52:42 +00:00
|
|
|
BUS_ALIAS( SCH_SCREEN* aParent = nullptr ) :
|
|
|
|
m_parent( aParent )
|
2022-08-21 19:35:02 +00:00
|
|
|
{ }
|
2019-03-11 21:32:05 +00:00
|
|
|
|
2022-08-21 19:35:02 +00:00
|
|
|
~BUS_ALIAS()
|
|
|
|
{ }
|
2019-03-11 21:32:05 +00:00
|
|
|
|
2022-08-21 19:35:02 +00:00
|
|
|
std::shared_ptr<BUS_ALIAS> Clone() const
|
2019-03-11 21:32:05 +00:00
|
|
|
{
|
2022-08-21 19:35:02 +00:00
|
|
|
return std::make_shared<BUS_ALIAS>( *this );
|
2019-03-11 21:32:05 +00:00
|
|
|
}
|
|
|
|
|
2022-08-21 19:35:02 +00:00
|
|
|
wxString GetName() { return m_name; }
|
|
|
|
void SetName( const wxString& aName ) { m_name = aName; }
|
2019-03-11 21:32:05 +00:00
|
|
|
|
2022-08-21 19:35:02 +00:00
|
|
|
const std::vector<wxString>& Members() const { return m_members; }
|
|
|
|
std::vector<wxString>& Members() { return m_members; }
|
2019-03-11 21:32:05 +00:00
|
|
|
|
2022-08-21 19:35:02 +00:00
|
|
|
SCH_SCREEN* GetParent() { return m_parent; }
|
|
|
|
void SetParent( SCH_SCREEN* aParent ) { m_parent = aParent; }
|
2019-03-11 21:32:05 +00:00
|
|
|
|
|
|
|
protected:
|
2022-08-21 19:35:02 +00:00
|
|
|
wxString m_name;
|
|
|
|
std::vector<wxString> m_members;
|
2019-03-11 21:32:05 +00:00
|
|
|
|
|
|
|
/**
|
2022-08-21 19:35:02 +00:00
|
|
|
* Schematic Setup can edit aliases from all sheets, so we have to store a reference back
|
|
|
|
* to our parent so that the dialog can update the parent if aliases are changed or removed.
|
2019-03-11 21:32:05 +00:00
|
|
|
*/
|
|
|
|
SCH_SCREEN* m_parent;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|