KiCad PCB EDA Suite
Loading...
Searching...
No Matches
ref_suffix_split.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
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version 2
9 * of the License, or (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU 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#ifndef REF_SUFFIX_SPLIT_H
21#define REF_SUFFIX_SPLIT_H
22
23#include <map>
24#include <optional>
25#include <string>
26
27#include <kiid.h>
28#include <pcb_item_containers.h>
29#include <wx/string.h>
30
31
34{
35 size_t Rank = 0;
36 wxString Suffix;
37};
38
41using SHEET_REF_SUFFIXES = std::map<wxString, SHEET_REF_SUFFIX>;
42
46std::optional<SHEET_REF_SUFFIXES> ParseRefSuffixes( const std::string& aPayload );
47
48
50{
51 wxString Base;
52 wxString Suffix;
54 bool Unknown = false;
55 bool Shared = false;
56};
57
68std::map<KIID, FOOTPRINT_REF_SPLIT> SplitRefSuffixes( const FOOTPRINTS& aFootprints,
69 const SHEET_REF_SUFFIXES* aSuffixes, bool aSuffixMode );
70
71#endif // REF_SUFFIX_SPLIT_H
Definition kiid.h:46
std::deque< FOOTPRINT * > FOOTPRINTS
std::map< wxString, SHEET_REF_SUFFIX > SHEET_REF_SUFFIXES
Sheet suffixes keyed by the sheet path string that starts the paths of its footprints,...
std::optional< SHEET_REF_SUFFIXES > ParseRefSuffixes(const std::string &aPayload)
std::map< KIID, FOOTPRINT_REF_SPLIT > SplitRefSuffixes(const FOOTPRINTS &aFootprints, const SHEET_REF_SUFFIXES *aSuffixes, bool aSuffixMode)
Split each footprint reference into its base and sheet suffix.
wxString Base
Reference without its sheet suffix.
wxString Suffix
Composed suffix of the footprint's sheet path.
bool Shared
One of the copies on reused sheets that share a base.
KIID Representative
Copy whose placement numbers the base this footprint shares.
bool Unknown
Text follows the number and no known suffix accounts for it.
A schematic sheet path's composed reference suffix and its position in page order.