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 The 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>;
44using SYNC_SHEET_PINT_VIEWS = std::map<int, wxDataViewCtrl*>;
45
47{
48public:
49 enum class SYNC_DIRECTION
50 {
53 };
54
55
56 PANEL_SYNC_SHEET_PINS( wxWindow* aParent, SCH_SHEET* aSheet, wxNotebook* aNoteBook, int aIndex,
57 SHEET_SYNCHRONIZATION_AGENT& aAgent, const SCH_SHEET_PATH& aPath );
58
59 ~PANEL_SYNC_SHEET_PINS() override;
60
61 bool HasUndefinedSheetPing() const;
62
63 void UpdateForms();
64
66
67 const wxString& GetSheetFileName() const;
68
69 SCH_SHEET_PATH const& GetSheetPath() const { return m_path; }
70
71protected:
72 void OnViewSheetPinCellClicked( wxDataViewEvent& event ) override;
73
74 void OnBtnAddSheetPinsClicked( wxCommandEvent& event ) override;
75
76 void OnBtnRmPinsClicked( wxCommandEvent& event ) override;
77
78 void OnBtnUsePinAsTemplateClicked( wxCommandEvent& event ) override;
79
80 void OnBtnUseLabelAsTemplateClicked( wxCommandEvent& event ) override;
81
82 void OnBtnUndoClicked( wxCommandEvent& event ) override;
83
84 void OnViewSheetLabelCellClicked( wxDataViewEvent& event ) override;
85
86 void OnBtnAddLabelsClicked( wxCommandEvent& event ) override;
87
88 void OnBtnRmLabelsClicked( wxCommandEvent& event ) override;
89
90 void OnViewMatchedCellClicked( wxDataViewEvent& event ) override;
91
92 void PostProcessModelSelection( int aIdex, wxDataViewItem const& aItem );
93
94 void GenericSync( SYNC_DIRECTION direction );
95
96 void UpdatePageImage() const;
97
98
99private:
101 wxNotebook* m_noteBook;
108};
109
110#endif
A base class for most all the KiCad significant classes used in schematics and boards.
Definition: eda_item.h:89
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
SYNC_SHEET_PINT_VIEWS m_views
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
std::map< int, wxDataViewCtrl * > SYNC_SHEET_PINT_VIEWS
Definition of the SCH_SHEET_PATH and SCH_SHEET_LIST classes for Eeschema.