KiCad PCB EDA Suite
Loading...
Searching...
No Matches
orcad_page.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 * Based on the dsn2kicad reference implementation and on OrCAD file format
7 * documentation from the OpenOrCadParser project (MIT licensed).
8 *
9 * This program is free software: you can redistribute it and/or modify it
10 * under the terms of the GNU General Public License as published by the
11 * Free Software Foundation, either version 3 of the License, or (at your
12 * option) any later version.
13 *
14 * This program is distributed in the hope that it will be useful, but
15 * WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 * General Public License for more details.
18 *
19 * You should have received a copy of the GNU General Public License
20 * along with this program. If not, see <https://www.gnu.org/licenses/>.
21 */
22
31
32#ifndef ORCAD_PAGE_H_
33#define ORCAD_PAGE_H_
34
35#include <cstdint>
36#include <map>
37#include <string>
38#include <vector>
39
41
68ORCAD_RAW_PAGE OrcadParsePage( const std::vector<char>& aData,
69 const std::vector<std::string>& aStrings,
70 const ORCAD_WARN_FN& aWarn );
71
85std::vector<std::string> OrcadParsePageOrder( const std::vector<char>& aData );
86
102std::map<uint32_t, std::string> OrcadReadHierarchyLinks( const std::vector<char>& aData,
103 const std::vector<std::string>& aStrings,
104 const ORCAD_WARN_FN& aWarn,
105 std::map<uint32_t, std::string>*
106 aOccurrenceRefs = nullptr );
107
118ORCAD_OCC_SCOPE OrcadReadOccurrenceTree( const std::vector<char>& aData,
119 const ORCAD_WARN_FN& aWarn );
120
128ORCAD_RAW_PAGE OrcadParsePageV2( const std::vector<char>& aData,
129 const std::vector<std::string>& aStrings,
130 const ORCAD_WARN_FN& aWarn );
131
137void OrcadParseOlbSymbolStreamV2( const std::vector<char>& aData,
138 const std::vector<std::string>& aStrings,
139 std::map<std::string, ORCAD_SYMBOL_DEF>& aSymbols );
140
146void OrcadParseOlbPackageStreamV2( const std::vector<char>& aData,
147 const std::vector<std::string>& aStrings,
148 std::map<std::string, ORCAD_SYMBOL_DEF>& aSymbols,
149 std::map<std::string, ORCAD_PACKAGE>& aPackages );
150
153{
154 return !aPage.blocks.empty();
155}
156
157#endif // ORCAD_PAGE_H_
void OrcadParseOlbSymbolStreamV2(const std::vector< char > &aData, const std::vector< std::string > &aStrings, std::map< std::string, ORCAD_SYMBOL_DEF > &aSymbols)
Parse one v2.0 .OLB 'Symbols/<name>' stream (a single special symbol: power, port,...
void OrcadParseOlbPackageStreamV2(const std::vector< char > &aData, const std::vector< std::string > &aStrings, std::map< std::string, ORCAD_SYMBOL_DEF > &aSymbols, std::map< std::string, ORCAD_PACKAGE > &aPackages)
Parse one v2.0 .OLB 'Packages/<name>' stream (a part's inline symbol definitions plus its package/dev...
ORCAD_RAW_PAGE OrcadParsePageV2(const std::vector< char > &aData, const std::vector< std::string > &aStrings, const ORCAD_WARN_FN &aWarn)
Parse one v2.0 (pre-2003) 'Views/<folder>/Pages/<page>' stream.
ORCAD_OCC_SCOPE OrcadReadOccurrenceTree(const std::vector< char > &aData, const ORCAD_WARN_FN &aWarn)
Parse the root folder 'Hierarchy/Hierarchy' stream into the full occurrence tree: per-scope part refe...
std::vector< std::string > OrcadParsePageOrder(const std::vector< char > &aData)
Parse the 'Views/<folder>/Schematic' stream and return the folder's page names in display order.
bool OrcadPageHasHierarchyBlocks(const ORCAD_RAW_PAGE &aPage)
True when the page contains hierarchical block instances (DrawnInstance, type 12).
Definition orcad_page.h:152
ORCAD_RAW_PAGE OrcadParsePage(const std::vector< char > &aData, const std::vector< std::string > &aStrings, const ORCAD_WARN_FN &aWarn)
Parse one 'Views/<folder>/Pages/<page>' stream into raw structure lists.
std::map< uint32_t, std::string > OrcadReadHierarchyLinks(const std::vector< char > &aData, const std::vector< std::string > &aStrings, const ORCAD_WARN_FN &aWarn, std::map< uint32_t, std::string > *aOccurrenceRefs=nullptr)
Parse a 'Views/<folder>/Hierarchy/Hierarchy' stream into block-instance links: block db id -> child f...
Plain data records produced by the OrCAD Capture DSN stream parsers and consumed by ORCAD_CONVERTER.
std::function< void(const wxString &aMsg)> ORCAD_WARN_FN
Warning sink shared by all parser entry points (recoverable-issue channel).
One node of the design occurrence tree parsed from the root Hierarchy stream.
One parsed 'Views/<folder>/Pages/<page>' stream, raw structure lists in stream order.
std::vector< ORCAD_DRAWN_INSTANCE > blocks
hierarchical blocks (detection only)