KiCad PCB EDA Suite
Loading...
Searching...
No Matches
conn_dump.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 The KiCad Developers, see AUTHORS.txt for contributors.
5 *
6 * This program is free software: you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License as published by the
8 * Free Software Foundation, either version 3 of the License, or (at your
9 * option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful, but
12 * WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program. If not, see <https://www.gnu.org/licenses/>.
18 */
19
20#pragma once
21
22#include <kiid.h>
23#include <wx/string.h>
24
25#include <map>
26#include <optional>
27#include <set>
28#include <string>
29#include <utility>
30#include <vector>
31
32class SCHEMATIC;
33enum class CONNECTION_TYPE;
34
35namespace SCH_CONNECTIVITY
36{
37class FACADE;
38
41{
42 wxString name;
43 wxString localName;
45 std::optional<KIID> driver;
47 std::vector<DUMP_VALUE> members;
48 std::set<wxString> netclasses;
49
50 bool operator==( const DUMP_VALUE& ) const = default;
51};
52
54{
56 bool dangling = false;
57 std::vector<bool> danglingEnds;
58 std::set<KIID> connected;
59
60 bool operator==( const DUMP_ROW& ) const = default;
61};
62
64using DUMP_ROWS = std::map<std::pair<KIID_PATH, KIID>, DUMP_ROW>;
65
71DUMP_ROWS CaptureRows( SCHEMATIC& aSchematic );
72
74DUMP_ROWS CaptureRows( SCHEMATIC& aSchematic, const FACADE& aFacade );
75
76std::string Dump( const DUMP_ROWS& aRows );
77
79std::string Dump( SCHEMATIC& aSchematic );
80
82std::string Dump( SCHEMATIC& aSchematic, const FACADE& aFacade );
83}
Holds all the data relating to one schematic.
Definition schematic.h:155
Model-owned source resolver.
Value keys and the key session of the schematic connectivity engine.
std::map< std::pair< KIID_PATH, KIID >, DUMP_ROW > DUMP_ROWS
Rows by sheet path and item.
Definition conn_dump.h:64
DUMP_ROWS CaptureRows(SCHEMATIC &aSchematic)
Canonical, pointer-free connectivity rows for migration and rebuild comparisons.
std::string Dump(const DUMP_ROWS &aRows)
CONNECTION_TYPE
std::set< KIID > connected
Definition conn_dump.h:58
std::vector< bool > danglingEnds
Definition conn_dump.h:57
bool operator==(const DUMP_ROW &) const =default
One connection or bus member.
Definition conn_dump.h:41
std::optional< KIID > driver
Definition conn_dump.h:45
std::set< wxString > netclasses
Definition conn_dump.h:48
std::vector< DUMP_VALUE > members
Definition conn_dump.h:47
bool operator==(const DUMP_VALUE &) const =default