KiCad PCB EDA Suite
Loading...
Searching...
No Matches
orcad_structures.h File Reference
#include <cstdint>
#include <map>
#include <optional>
#include <string>
#include <utility>
#include <variant>
#include <vector>
#include <wx/string.h>
#include <sch_io/orcad/orcad_records.h>
#include <sch_io/orcad/orcad_stream.h>

Go to the source code of this file.

Classes

struct  ORCAD_PREFIXES
 Prefix lengths supply structure bounds. More...
 
struct  ORCAD_READ_RESULT
 
class  ORCAD_STRUCT_READER
 ReadStructure can recover from a body error when the prefix supplies a valid end offset. More...
 

Typedefs

using ORCAD_RECORD_VARIANT
 A skipped or unreadable body produces monostate.
 

Functions

std::optional< size_t > OrcadLongPrefixCount (int aTypeId)
 Registered number of long prefixes for a modern framed structure type.
 
ORCAD_DISPLAY_PROP OrcadReadDisplayProp (ORCAD_STRUCT_READER &aReader, const ORCAD_PREFIXES &aPrefixes)
 Body readers start after the prefixes.
 
ORCAD_ALIAS OrcadReadAlias (ORCAD_STRUCT_READER &aReader, const ORCAD_PREFIXES &aPrefixes)
 
ORCAD_WIRE OrcadReadWire (ORCAD_STRUCT_READER &aReader, const ORCAD_PREFIXES &aPrefixes)
 Types 20 (wire) and 21 (bus); isBus is set from the prefix type.
 
ORCAD_PLACED_INSTANCE OrcadReadPlacedInstance (ORCAD_STRUCT_READER &aReader, const ORCAD_PREFIXES &aPrefixes)
 
ORCAD_GRAPHIC_INST OrcadReadGraphicInst (ORCAD_STRUCT_READER &aReader, const ORCAD_PREFIXES &aPrefixes)
 Common body of Port/Global/OffPageConnector/TitleBlock/ERCObject/Graphic*Inst.
 
ORCAD_GRAPHIC_INST OrcadReadPort (ORCAD_STRUCT_READER &aReader, const ORCAD_PREFIXES &aPrefixes)
 GraphicInst body followed by a 9-byte trailer.
 
ORCAD_GRAPHIC_INST OrcadReadTitleBlock (ORCAD_STRUCT_READER &aReader, const ORCAD_PREFIXES &aPrefixes)
 GraphicInst body followed by a 12-byte trailer.
 
ORCAD_GRAPHIC_INST OrcadReadErcObject (ORCAD_STRUCT_READER &aReader, const ORCAD_PREFIXES &aPrefixes)
 GraphicInst body followed by 3 lzt strings.
 
ORCAD_PIN_INST OrcadReadPinInst (ORCAD_STRUCT_READER &aReader, const ORCAD_PREFIXES &aPrefixes)
 
ORCAD_BUS_ENTRY OrcadReadBusEntryBody (ORCAD_STREAM &aStream)
 
ORCAD_BUS_ENTRY OrcadReadBusEntry (ORCAD_STRUCT_READER &aReader, const ORCAD_PREFIXES &aPrefixes)
 
std::vector< ORCAD_DISPLAY_PROPOrcadReadDisplayPropList (ORCAD_STRUCT_READER &aReader)
 Keep only display properties that ReadStructure decodes.
 
ORCAD_NET_GROUP OrcadReadT0x34Raw (ORCAD_STREAM &aStream)
 T0x34 records have no prefixes; consume their fixed layout to preserve alignment.
 
ORCAD_NET_GROUP OrcadReadT0x35Raw (ORCAD_STREAM &aStream)
 T0x35 = the T0x34 raw layout followed by u16 n and 4 * n bytes.
 

Typedef Documentation

◆ ORCAD_RECORD_VARIANT

Initial value:
The owning wire defines the connection.
Display positions use symbol coordinates; rotFont combines the font index and quarter turns.
The inline LibraryPart defines the block interface; placed pin records supply absolute positions.
Free graphics use nested primitive coordinates.
Pin positions are absolute page connection points.
The placed box includes displayed text.
The bounding box occupies the final eight bytes before the next prefix stop.
The wire ID refers to the page net table.

A skipped or unreadable body produces monostate.

Definition at line 58 of file orcad_structures.h.

Function Documentation

◆ OrcadLongPrefixCount()

std::optional< size_t > OrcadLongPrefixCount ( int aTypeId)

Registered number of long prefixes for a modern framed structure type.

Definition at line 51 of file orcad_structures.cpp.

Referenced by BOOST_AUTO_TEST_CASE(), and ORCAD_STRUCT_READER::ReadPrefixes().

◆ OrcadReadAlias()

◆ OrcadReadBusEntry()

ORCAD_BUS_ENTRY OrcadReadBusEntry ( ORCAD_STRUCT_READER & aReader,
const ORCAD_PREFIXES & aPrefixes )

◆ OrcadReadBusEntryBody()

◆ OrcadReadDisplayProp()

◆ OrcadReadDisplayPropList()

std::vector< ORCAD_DISPLAY_PROP > OrcadReadDisplayPropList ( ORCAD_STRUCT_READER & aReader)

◆ OrcadReadErcObject()

ORCAD_GRAPHIC_INST OrcadReadErcObject ( ORCAD_STRUCT_READER & aReader,
const ORCAD_PREFIXES & aPrefixes )

GraphicInst body followed by 3 lzt strings.

Definition at line 518 of file orcad_structures.cpp.

References OrcadReadGraphicInst(), ORCAD_STREAM::ReadLzt(), and ORCAD_STRUCT_READER::Stream().

Referenced by ORCAD_STRUCT_READER::ReadStructure().

◆ OrcadReadGraphicInst()

◆ OrcadReadPinInst()

◆ OrcadReadPlacedInstance()

◆ OrcadReadPort()

ORCAD_GRAPHIC_INST OrcadReadPort ( ORCAD_STRUCT_READER & aReader,
const ORCAD_PREFIXES & aPrefixes )

GraphicInst body followed by a 9-byte trailer.

Definition at line 500 of file orcad_structures.cpp.

References OrcadReadGraphicInst(), ORCAD_STREAM::Skip(), and ORCAD_STRUCT_READER::Stream().

Referenced by ORCAD_STRUCT_READER::ReadStructure().

◆ OrcadReadT0x34Raw()

ORCAD_NET_GROUP OrcadReadT0x34Raw ( ORCAD_STREAM & aStream)

T0x34 records have no prefixes; consume their fixed layout to preserve alignment.

Definition at line 589 of file orcad_structures.cpp.

References ORCAD_NET_GROUP::id, ORCAD_NET_GROUP::name, ORCAD_STREAM::ReadLzt(), ORCAD_STREAM::ReadU32(), and ORCAD_STREAM::Skip().

Referenced by OrcadParsePage(), and OrcadReadT0x35Raw().

◆ OrcadReadT0x35Raw()

ORCAD_NET_GROUP OrcadReadT0x35Raw ( ORCAD_STREAM & aStream)

T0x35 = the T0x34 raw layout followed by u16 n and 4 * n bytes.

Definition at line 605 of file orcad_structures.cpp.

References ORCAD_NET_GROUP::members, OrcadReadT0x34Raw(), ORCAD_STREAM::ReadU16(), and ORCAD_STREAM::ReadU32().

Referenced by OrcadParsePage().

◆ OrcadReadTitleBlock()

ORCAD_GRAPHIC_INST OrcadReadTitleBlock ( ORCAD_STRUCT_READER & aReader,
const ORCAD_PREFIXES & aPrefixes )

GraphicInst body followed by a 12-byte trailer.

Definition at line 509 of file orcad_structures.cpp.

References OrcadReadGraphicInst(), ORCAD_STREAM::Skip(), and ORCAD_STRUCT_READER::Stream().

Referenced by ORCAD_STRUCT_READER::ReadStructure().

◆ OrcadReadWire()