KiCad PCB EDA Suite
Loading...
Searching...
No Matches
dialog_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 DIALOG_SYNC_SHEET_PINS_H
26#define DIALOG_SYNC_SHEET_PINS_H
27
29
30#include <sch_sheet_path.h>
31#include <list>
32#include <memory>
33#include <unordered_map>
34
35class SCH_SHEET;
36class EDA_ITEM;
39class SCH_HIERLABEL;
40
42{
43public:
44 enum class PlaceItemKind
45 {
49 };
50
51 DIALOG_SYNC_SHEET_PINS( wxWindow* aParent, std::list<SCH_SHEET_PATH> aSheetPath,
52 std::shared_ptr<SHEET_SYNCHRONIZATION_AGENT> aAgent );
53
55
56 void OnCloseBtnClick( wxCommandEvent& event ) override;
57
58 void OnClose( wxCloseEvent& aEvent );
59
60 void EndPlaceItem( EDA_ITEM* aNewItem );
61
69 void BeginPlaceItem( SCH_SHEET* aSheet, PlaceItemKind aKind, EDA_ITEM* aTemplate );
70
77
78
79private:
80 //It's the agent that performs modification and placement
81 std::shared_ptr<SHEET_SYNCHRONIZATION_AGENT> m_agent;
83
84 //The same sheet may have mutiple instances
85 std::unordered_map<SCH_SHEET*, PANEL_SYNC_SHEET_PINS*> m_panels;
88};
89
90#endif
Class DIALOG_SYNC_SHEET_PINS_BASE.
SCH_HIERLABEL * GetPlacementTemplate() const
Get the Placement Template SHEET_PIN / HIERLABEL used for place a new HIERLABEL/SHEET_PIN.
void BeginPlaceItem(SCH_SHEET *aSheet, PlaceItemKind aKind, EDA_ITEM *aTemplate)
Start place a new SHEET_PIN/HIERLABEL.
std::unordered_map< SCH_SHEET *, PANEL_SYNC_SHEET_PINS * > m_panels
void EndPlaceItem(EDA_ITEM *aNewItem)
std::shared_ptr< SHEET_SYNCHRONIZATION_AGENT > m_agent
void OnClose(wxCloseEvent &aEvent)
~DIALOG_SYNC_SHEET_PINS() override
void OnCloseBtnClick(wxCommandEvent &event) override
A base class for most all the KiCad significant classes used in schematics and boards.
Definition: eda_item.h:88
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.
Definition of the SCH_SHEET_PATH and SCH_SHEET_LIST classes for Eeschema.