KiCad PCB EDA Suite
Loading...
Searching...
No Matches
panel_setup_buses.h
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 (C) 2018 CERN
5 * Copyright (C) 2021-2022 KiCad Developers, see AUTHORS.txt for contributors.
6 * @author Jon Evans <[email protected]>
7 *
8 * This program is free software: you can redistribute it and/or modify it
9 * under the terms of the GNU General Public License as published by the
10 * Free Software Foundation, either version 3 of the License, or (at your
11 * option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful, but
14 * WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License along
19 * with this program. If not, see <http://www.gnu.org/licenses/>.
20 */
21
22#ifndef PANEL_SETUP_BUSES_H
23#define PANEL_SETUP_BUSES_H
24
25#include <map>
27#include <bus_alias.h>
28
29class SCH_EDIT_FRAME;
30class SCH_SCREEN;
31class BUS_ALIAS;
32
34{
35public:
36 PANEL_SETUP_BUSES( wxWindow* aWindow, SCH_EDIT_FRAME* aFrame );
37
39
40 bool TransferDataFromWindow() override;
41 bool TransferDataToWindow() override;
42
43 void ImportSettingsFrom( const SCHEMATIC& aOtherSchematic );
44
45protected:
46 void OnAddAlias( wxCommandEvent& aEvent ) override;
47 void OnDeleteAlias( wxCommandEvent& aEvent ) override;
48 void OnAddMember( wxCommandEvent& aEvent ) override;
49 void OnRemoveMember( wxCommandEvent& aEvent ) override;
50 void OnAliasesGridCellChanging( wxGridEvent& event );
51 void OnMemberGridCellChanging( wxGridEvent& event );
52 void OnSizeGrid( wxSizeEvent& event ) override;
53 void OnUpdateUI( wxUpdateUIEvent& event ) override;
54
55 void loadAliases( const SCHEMATIC& aSchematic );
56
57 void reloadMembersGridOnIdle( wxIdleEvent& aEvent );
58
60
61 /*
62 * When rows are created programmatically by pasting values from the clipboard,
63 * the cell change event may not be triggered. This can prevent members from
64 * being automatically added to the corresponding alias.
65 *
66 * To ensure that members are correctly associated with the alias,
67 * we manually update the members for the needed alias.
68 */
69 void updateAliasMembers( int aAliasIndex );
70
71private:
74
75 std::vector< std::shared_ptr<BUS_ALIAS> > m_aliases;
79
80 wxString m_errorMsg;
83};
84
85
86#endif // PANEL_SETUP_BUSES_H
Class PANEL_SETUP_BUSES_BASE.
void OnAliasesGridCellChanging(wxGridEvent &event)
std::vector< std::shared_ptr< BUS_ALIAS > > m_aliases
void reloadMembersGridOnIdle(wxIdleEvent &aEvent)
void OnDeleteAlias(wxCommandEvent &aEvent) override
void OnUpdateUI(wxUpdateUIEvent &event) override
void loadAliases(const SCHEMATIC &aSchematic)
SCH_EDIT_FRAME * m_frame
void OnSizeGrid(wxSizeEvent &event) override
bool TransferDataToWindow() override
void ImportSettingsFrom(const SCHEMATIC &aOtherSchematic)
void updateAliasMembers(int aAliasIndex)
wxString m_membersLabelTemplate
void OnRemoveMember(wxCommandEvent &aEvent) override
void OnMemberGridCellChanging(wxGridEvent &event)
bool TransferDataFromWindow() override
void OnAddMember(wxCommandEvent &aEvent) override
void OnAddAlias(wxCommandEvent &aEvent) override
Holds all the data relating to one schematic.
Definition: schematic.h:77
Schematic editor (Eeschema) main window.