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, see <https://www.gnu.org/licenses/>.
19 */
20
21#ifndef PANEL_SYNC_SHEET_PINS_H
22#define PANEL_SYNC_SHEET_PINS_H
23
25#include "sch_sheet_path.h"
26
27#include <map>
28#include <wx/dataview.h>
29
30class SCH_SHEET;
31class wxNotebook;
32class SCH_HIERLABEL;
33class SCH_SHEET_PIN;
35class EDA_ITEM;
37using SHEET_SYNCHRONIZATION_MODEL_PTR = wxObjectDataPtr<SHEET_SYNCHRONIZATION_MODEL>;
38
39using SYNC_SHEET_PINT_MODELS = std::map<int, SHEET_SYNCHRONIZATION_MODEL_PTR>;
40using SYNC_SHEET_PINT_VIEWS = std::map<int, wxDataViewCtrl*>;
41
43{
44public:
50
51
52 PANEL_SYNC_SHEET_PINS( wxWindow* aParent, SCH_SHEET* aSheet, wxNotebook* aNoteBook, int aIndex,
53 SHEET_SYNCHRONIZATION_AGENT& aAgent, const SCH_SHEET_PATH& aPath );
54
55 ~PANEL_SYNC_SHEET_PINS() override;
56
57 bool HasUndefinedSheetPing() const;
58
59 void UpdateForms();
60
62
63 const wxString& GetSheetFileName() const;
64
65 SCH_SHEET_PATH const& GetSheetPath() const { return m_path; }
66
67protected:
68 void OnViewSheetPinCellClicked( wxDataViewEvent& event ) override;
69
70 void OnBtnAddSheetPinsClicked( wxCommandEvent& event ) override;
71
72 void OnBtnRmPinsClicked( wxCommandEvent& event ) override;
73
74 void OnBtnUsePinAsTemplateClicked( wxCommandEvent& event ) override;
75
76 void OnBtnUseLabelAsTemplateClicked( wxCommandEvent& event ) override;
77
78 void OnBtnUndoClicked( wxCommandEvent& event ) override;
79
80 void OnViewSheetLabelCellClicked( wxDataViewEvent& event ) override;
81
82 void OnBtnAddLabelsClicked( wxCommandEvent& event ) override;
83
84 void OnBtnRmLabelsClicked( wxCommandEvent& event ) override;
85
86 void OnViewMatchedCellClicked( wxDataViewEvent& event ) override;
87
88 void PostProcessModelSelection( int aIdex, wxDataViewItem const& aItem );
89
90 void GenericSync( SYNC_DIRECTION direction );
91
92 void UpdatePageImage() const;
93
94
95private:
97 wxNotebook* m_noteBook;
104};
105
106#endif
A base class for most all the KiCad significant classes used in schematics and boards.
Definition eda_item.h:96
PANEL_SYNC_SHEET_PINS_BASE(wxWindow *parent, wxWindowID id=wxID_ANY, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxSize(666, 414), long style=wxTAB_TRAVERSAL, const wxString &name=wxEmptyString)
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
PANEL_SYNC_SHEET_PINS(wxWindow *aParent, SCH_SHEET *aSheet, wxNotebook *aNoteBook, int aIndex, SHEET_SYNCHRONIZATION_AGENT &aAgent, const SCH_SHEET_PATH &aPath)
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.
Sheet symbol placed in a schematic, and is the entry point for a sub schematic.
Definition sch_sheet.h:44
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.