KiCad PCB EDA Suite
Loading...
Searching...
No Matches
panel_sync_sheet_pins.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) 2023 Ethan Chien <[email protected]>
5 * Copyright (C) 2023 KiCad Developers, see AUTHORS.txt for contributors.
6 *
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * as published by the Free Software Foundation; either version 2
10 * of the License, or (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, you may find one here:
19 * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
20 * or you may search the http://www.gnu.org website for the version 2 license,
21 * or you may write to the Free Software Foundation, Inc.,
22 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
23 */
24
25#ifndef PANEL_SYNC_SHEET_PINS_H
26#define PANEL_SYNC_SHEET_PINS_H
27
29#include "sch_sheet_path.h"
30
31#include <map>
32#include <wx/dataview.h>
33
34class SCH_SHEET;
35class wxNotebook;
36class SCH_HIERLABEL;
37class SCH_SHEET_PIN;
39class EDA_ITEM;
41using SHEET_SYNCHRONIZATION_MODEL_PTR = wxObjectDataPtr<SHEET_SYNCHRONIZATION_MODEL>;
42
43using SYNC_SHEET_PINT_MODELS = std::map<int, SHEET_SYNCHRONIZATION_MODEL_PTR>;
44
46{
47public:
48 enum class SYNC_DIRECTION
49 {
52 };
53
54
55 PANEL_SYNC_SHEET_PINS( wxWindow* aParent, SCH_SHEET* aSheet, wxNotebook* aNoteBook, int aIndex,
56 SHEET_SYNCHRONIZATION_AGENT& aAgent, const SCH_SHEET_PATH& aPath );
57
58 ~PANEL_SYNC_SHEET_PINS() override;
59
60 bool HasUndefinedSheetPing() const;
61
62 void UpdateForms();
63
65
66 const wxString& GetSheetFileName() const;
67
68 SCH_SHEET_PATH const& GetSheetPath() const { return m_path; }
69
70protected:
71 void OnViewSheetPinCellClicked( wxDataViewEvent& event ) override;
72
73 void OnBtnAddSheetPinsClicked( wxCommandEvent& event ) override;
74
75 void OnBtnRmPinsClicked( wxCommandEvent& event ) override;
76
77 void OnBtnUsePinAsTemplateClicked( wxCommandEvent& event ) override;
78
79 void OnBtnUseLabelAsTemplateClicked( wxCommandEvent& event ) override;
80
81 void OnBtnUndoClicked( wxCommandEvent& event ) override;
82
83 void OnViewSheetLabelCellClicked( wxDataViewEvent& event ) override;
84
85 void OnBtnAddLabelsClicked( wxCommandEvent& event ) override;
86
87 void OnBtnRmLabelsClicked( wxCommandEvent& event ) override;
88
89 void OnViewMatchedCellClicked( wxDataViewEvent& event ) override;
90
91 void PostProcessModelSelection( int aIdex, wxDataViewItem const& aItem );
92
93 void GenericSync( SYNC_DIRECTION direction );
94
95 void UpdatePageImage() const;
96
97
98private:
100 wxNotebook* m_noteBook;
106};
107
108#endif
A base class for most all the KiCad significant classes used in schematics and boards.
Definition: eda_item.h:88
Class PANEL_SYNC_SHEET_PINS_BASE.
SHEET_SYNCHRONIZATION_MODEL_PTR GetModel(int aKind) const
void PostProcessModelSelection(int aIdex, wxDataViewItem const &aItem)
void OnBtnUsePinAsTemplateClicked(wxCommandEvent &event) override
void OnBtnRmPinsClicked(wxCommandEvent &event) override
void GenericSync(SYNC_DIRECTION direction)
void OnBtnAddLabelsClicked(wxCommandEvent &event) override
void OnViewSheetLabelCellClicked(wxDataViewEvent &event) override
void OnViewMatchedCellClicked(wxDataViewEvent &event) override
const wxString & GetSheetFileName() const
void OnBtnUseLabelAsTemplateClicked(wxCommandEvent &event) override
void OnBtnRmLabelsClicked(wxCommandEvent &event) override
SCH_SHEET_PATH const & GetSheetPath() const
void OnBtnAddSheetPinsClicked(wxCommandEvent &event) override
void OnBtnUndoClicked(wxCommandEvent &event) override
SHEET_SYNCHRONIZATION_AGENT & m_agent
void OnViewSheetPinCellClicked(wxDataViewEvent &event) override
SYNC_SHEET_PINT_MODELS m_models
Handle access to a stack of flattened SCH_SHEET objects by way of a path for creating a flattened sch...
Define a sheet pin (label) used in sheets to create hierarchical schematics.
Definition: sch_sheet_pin.h:66
Sheet symbol placed in a schematic, and is the entry point for a sub schematic.
Definition: sch_sheet.h:57
Agent for all the modifications while syncing the sheet pin and hierarchical label.
wxObjectDataPtr< SHEET_SYNCHRONIZATION_MODEL > SHEET_SYNCHRONIZATION_MODEL_PTR
std::map< int, SHEET_SYNCHRONIZATION_MODEL_PTR > SYNC_SHEET_PINT_MODELS
Definition of the SCH_SHEET_PATH and SCH_SHEET_LIST classes for Eeschema.