KiCad PCB EDA Suite
Loading...
Searching...
No Matches
orcad_page.h File Reference
#include <cstdint>
#include <map>
#include <string>
#include <vector>
#include <sch_io/orcad/orcad_records.h>

Go to the source code of this file.

Functions

ORCAD_RAW_PAGE OrcadParsePage (const std::vector< char > &aData, const std::vector< std::string > &aStrings, const ORCAD_WARN_FN &aWarn)
 A body failure skips that structure.
 
std::vector< std::string > OrcadParsePageOrder (const std::vector< char > &aData)
 Returns display order.
 
std::vector< std::string > OrcadParsePageOrderV2 (const std::vector< char > &aData, const std::vector< std::string > &aStrings)
 Returns display order; throws IO_ERROR for invalid legacy framing.
 
std::vector< std::string > OrcadParseSchematicFolderOrder (const std::vector< char > &aData)
 Unlisted Views storages can be stale.
 
ORCAD_OCC_SCOPE OrcadReadOccurrenceTree (const std::vector< char > &aData, const std::vector< std::string > &aStrings, const ORCAD_WARN_FN &aWarn)
 Returns occurrence references and child scopes.
 
ORCAD_OCC_SCOPE OrcadReadOccurrenceTreeV2 (const std::vector< char > &aData, const std::vector< std::string > &aStrings)
 Parse a short-prefix-only v2.0 Hierarchy stream without scan recovery.
 
ORCAD_RAW_PAGE OrcadParsePageV2 (const std::vector< char > &aData, const std::vector< std::string > &aStrings, const ORCAD_WARN_FN &aWarn, bool aShortDisplayProp=false)
 Legacy records have no stop offsets.
 
void OrcadParseCacheV2 (const std::vector< char > &aData, const std::vector< std::string > &aStrings, const ORCAD_WARN_FN &aWarn, std::map< std::string, ORCAD_SYMBOL_DEF > &aSymbols, std::map< std::string, ORCAD_PACKAGE > &aPackages)
 Keep decoded entries if a framing error ends the legacy cache.
 
void OrcadParseOlbSymbolStreamV2 (const std::vector< char > &aData, const std::vector< std::string > &aStrings, std::map< std::string, ORCAD_SYMBOL_DEF > &aSymbols, bool aShortDisplayProp=false)
 aShortDisplayProp selects the version 1 display-property layout.
 
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, bool aShortDisplayProp=false)
 aShortDisplayProp selects the version 1 display-property layout.
 
bool OrcadPageHasHierarchyBlocks (const ORCAD_RAW_PAGE &aPage)
 True when the page contains hierarchical block instances (DrawnInstance, type 12).
 

Function Documentation

◆ OrcadPageHasHierarchyBlocks()

bool OrcadPageHasHierarchyBlocks ( const ORCAD_RAW_PAGE & aPage)
inline

True when the page contains hierarchical block instances (DrawnInstance, type 12).

Definition at line 74 of file orcad_page.h.

References ORCAD_RAW_PAGE::blocks.

Referenced by SCH_IO_ORCAD::LoadSchematicFile().

◆ OrcadParseCacheV2()

◆ OrcadParseOlbPackageStreamV2()

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,
bool aShortDisplayProp = false )

◆ OrcadParseOlbSymbolStreamV2()

void OrcadParseOlbSymbolStreamV2 ( const std::vector< char > & aData,
const std::vector< std::string > & aStrings,
std::map< std::string, ORCAD_SYMBOL_DEF > & aSymbols,
bool aShortDisplayProp = false )

aShortDisplayProp selects the version 1 display-property layout.

Definition at line 1239 of file orcad_page.cpp.

References ORCAD_SYMBOL_DEF::name, ORCAD_ST_LIBRARY_PART, ORCAD_SYMBOL_DEF::props, ORCAD_STREAM::Remaining(), THROW_IO_ERROR, v2LibraryPartTail(), v2LibSymbolDef(), and v2Prefix().

Referenced by BOOST_AUTO_TEST_CASE(), and SCH_IO_ORCAD::loadOlbSymbols().

◆ OrcadParsePage()

ORCAD_RAW_PAGE OrcadParsePage ( const std::vector< char > & aData,
const std::vector< std::string > & aStrings,
const ORCAD_WARN_FN & aWarn )

A body failure skips that structure.

Invalid page framing throws IO_ERROR.

Definition at line 69 of file orcad_page.cpp.

References ORCAD_RAW_PAGE::blocks, ORCAD_PAGE_SETTINGS::borderPrinted, ORCAD_RAW_PAGE::borderPrinted, ORCAD_RAW_PAGE::busEntries, ORCAD_PAGE_SETTINGS::createTimestamp, ORCAD_RAW_PAGE::createTimestamp, ORCAD_PREFIXES::end, ORCAD_RAW_PAGE::ercObjects, ORCAD_STREAM::GetOffset(), ORCAD_RAW_PAGE::globals, ORCAD_RAW_PAGE::graphics, ORCAD_PAGE_SETTINGS::gridRefPrinted, ORCAD_RAW_PAGE::gridRefPrinted, ORCAD_PAGE_SETTINGS::height, ORCAD_RAW_PAGE::height, ORCAD_PAGE_SETTINGS::horizontalAscending, ORCAD_RAW_PAGE::horizontalAscending, ORCAD_PAGE_SETTINGS::horizontalChar, ORCAD_RAW_PAGE::horizontalChar, ORCAD_PAGE_SETTINGS::horizontalCount, ORCAD_RAW_PAGE::horizontalCount, ORCAD_PAGE_SETTINGS::horizontalWidth, ORCAD_RAW_PAGE::horizontalWidth, ORCAD_RAW_PAGE::instances, ORCAD_PAGE_SETTINGS::isMetric, ORCAD_RAW_PAGE::isMetric, ORCAD_PAGE_SETTINGS::modifyTimestamp, ORCAD_RAW_PAGE::modifyTimestamp, ORCAD_RAW_PAGE::name, ORCAD_RAW_PAGE::netAliases, ORCAD_RAW_PAGE::netGroups, ORCAD_RAW_PAGE::netmap, ORCAD_RAW_PAGE::offpage, ORCAD_ST_PAGE, OrcadParsePageSettings(), OrcadReadT0x34Raw(), OrcadReadT0x35Raw(), ORCAD_RAW_PAGE::pageSize, ORCAD_RAW_PAGE::ports, ORCAD_RAW_PAGE::props, ORCAD_STRUCT_READER::PropsDict(), ORCAD_STREAM::ReadLzt(), ORCAD_STRUCT_READER::ReadPrefixes(), ORCAD_STRUCT_READER::ReadStructure(), ORCAD_STREAM::ReadU16(), ORCAD_STREAM::ReadU32(), result, ORCAD_STREAM::Skip(), THROW_IO_ERROR, ORCAD_RAW_PAGE::titleBlocks, ORCAD_PAGE_SETTINGS::verticalAscending, ORCAD_RAW_PAGE::verticalAscending, ORCAD_PAGE_SETTINGS::verticalChar, ORCAD_RAW_PAGE::verticalChar, ORCAD_PAGE_SETTINGS::verticalCount, ORCAD_RAW_PAGE::verticalCount, ORCAD_PAGE_SETTINGS::verticalWidth, ORCAD_RAW_PAGE::verticalWidth, ORCAD_PAGE_SETTINGS::width, ORCAD_RAW_PAGE::width, and ORCAD_RAW_PAGE::wires.

Referenced by SCH_IO_ORCAD::LoadSchematicFile().

◆ OrcadParsePageOrder()

std::vector< std::string > OrcadParsePageOrder ( const std::vector< char > & aData)

Returns display order.

The caller must reconcile these names with available page streams.

Definition at line 187 of file orcad_page.cpp.

References ORCAD_ST_SCH_LIB, pageOrderBody(), and ORCAD_STRUCT_READER::ReadPrefixes().

Referenced by BOOST_AUTO_TEST_CASE(), and SCH_IO_ORCAD::LoadSchematicFile().

◆ OrcadParsePageOrderV2()

std::vector< std::string > OrcadParsePageOrderV2 ( const std::vector< char > & aData,
const std::vector< std::string > & aStrings )

Returns display order; throws IO_ERROR for invalid legacy framing.

Definition at line 1268 of file orcad_page.cpp.

References pageOrderBody(), and v2Prefix().

Referenced by BOOST_AUTO_TEST_CASE(), and SCH_IO_ORCAD::LoadSchematicFile().

◆ OrcadParsePageV2()

ORCAD_RAW_PAGE OrcadParsePageV2 ( const std::vector< char > & aData,
const std::vector< std::string > & aStrings,
const ORCAD_WARN_FN & aWarn,
bool aShortDisplayProp = false )

Legacy records have no stop offsets.

A framing error throws IO_ERROR and discards the page.

Definition at line 1098 of file orcad_page.cpp.

References ORCAD_RAW_PAGE::blocks, ORCAD_PAGE_SETTINGS::borderPrinted, ORCAD_RAW_PAGE::borderPrinted, ORCAD_RAW_PAGE::busEntries, ORCAD_PAGE_SETTINGS::createTimestamp, ORCAD_RAW_PAGE::createTimestamp, ORCAD_RAW_PAGE::ercObjects, ORCAD_RAW_PAGE::globals, ORCAD_RAW_PAGE::graphics, ORCAD_PAGE_SETTINGS::gridRefPrinted, ORCAD_RAW_PAGE::gridRefPrinted, group, ORCAD_PAGE_SETTINGS::height, ORCAD_RAW_PAGE::height, ORCAD_PAGE_SETTINGS::horizontalAscending, ORCAD_RAW_PAGE::horizontalAscending, ORCAD_PAGE_SETTINGS::horizontalChar, ORCAD_RAW_PAGE::horizontalChar, ORCAD_PAGE_SETTINGS::horizontalCount, ORCAD_RAW_PAGE::horizontalCount, ORCAD_PAGE_SETTINGS::horizontalWidth, ORCAD_RAW_PAGE::horizontalWidth, ORCAD_RAW_PAGE::instances, ORCAD_PAGE_SETTINGS::isMetric, ORCAD_RAW_PAGE::isMetric, ORCAD_PAGE_SETTINGS::modifyTimestamp, ORCAD_RAW_PAGE::modifyTimestamp, ORCAD_RAW_PAGE::name, ORCAD_RAW_PAGE::netAliases, ORCAD_RAW_PAGE::netGroups, ORCAD_RAW_PAGE::netmap, ORCAD_RAW_PAGE::offpage, ORCAD_ST_DRAWN_INSTANCE, ORCAD_ST_PAGE, OrcadParsePageSettings(), OrcadReadBusEntryBody(), ORCAD_RAW_PAGE::pageSize, ORCAD_STREAM::PeekU8(), ORCAD_RAW_PAGE::ports, ORCAD_RAW_PAGE::props, ORCAD_STREAM::ReadLzt(), ORCAD_STREAM::ReadU16(), ORCAD_STREAM::ReadU32(), ORCAD_STREAM::Skip(), THROW_IO_ERRORF, ORCAD_RAW_PAGE::titleBlocks, v2CheckCount(), v2DrawnInstance(), v2GraphicInst(), v2PlacedInstance(), v2Prefix(), v2Wire(), ORCAD_PAGE_SETTINGS::verticalAscending, ORCAD_RAW_PAGE::verticalAscending, ORCAD_PAGE_SETTINGS::verticalChar, ORCAD_RAW_PAGE::verticalChar, ORCAD_PAGE_SETTINGS::verticalCount, ORCAD_RAW_PAGE::verticalCount, ORCAD_PAGE_SETTINGS::verticalWidth, ORCAD_RAW_PAGE::verticalWidth, ORCAD_PAGE_SETTINGS::width, ORCAD_RAW_PAGE::width, and ORCAD_RAW_PAGE::wires.

Referenced by BOOST_AUTO_TEST_CASE(), and SCH_IO_ORCAD::LoadSchematicFile().

◆ OrcadParseSchematicFolderOrder()

std::vector< std::string > OrcadParseSchematicFolderOrder ( const std::vector< char > & aData)

Unlisted Views storages can be stale.

Import them only if a hierarchy occurrence refers to them.

Definition at line 198 of file orcad_page.cpp.

References ORCAD_STREAM::AtEnd(), ORCAD_STREAM::ReadLzt(), ORCAD_STREAM::ReadU16(), ORCAD_STREAM::Skip(), and THROW_IO_ERROR.

Referenced by BOOST_AUTO_TEST_CASE(), and SCH_IO_ORCAD::LoadSchematicFile().

◆ OrcadReadOccurrenceTree()

ORCAD_OCC_SCOPE OrcadReadOccurrenceTree ( const std::vector< char > & aData,
const std::vector< std::string > & aStrings,
const ORCAD_WARN_FN & aWarn )

Returns occurrence references and child scopes.

Parse errors return an empty scope.

Definition at line 1571 of file orcad_page.cpp.

References ORCAD_STREAM::ReadLzt(), readOccHeader(), readOccScope(), ORCAD_STREAM::ReadU16(), ORCAD_STREAM::ReadU32(), ORCAD_STREAM::ReadU8(), ORCAD_STREAM::Skip(), and IO_ERROR::What().

Referenced by BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), and SCH_IO_ORCAD::LoadSchematicFile().

◆ OrcadReadOccurrenceTreeV2()

ORCAD_OCC_SCOPE OrcadReadOccurrenceTreeV2 ( const std::vector< char > & aData,
const std::vector< std::string > & aStrings )