KiCad PCB EDA Suite
Loading...
Searching...
No Matches
orcad_records.h File Reference

Plain data records produced by the OrCAD Capture DSN stream parsers and consumed by ORCAD_CONVERTER. More...

#include <cstdint>
#include <functional>
#include <map>
#include <memory>
#include <optional>
#include <string>
#include <utility>
#include <vector>
#include <wx/string.h>

Go to the source code of this file.

Classes

struct  ORCAD_POINT
 Integer point in OrCAD DBU. More...
 
struct  ORCAD_BBOX
 Axis-aligned box in OrCAD DBU; corner order as stored (not normalized). More...
 
struct  ORCAD_DISPLAY_PROP
 One displayed property of an instance (Part Reference, Value, user fields). More...
 
struct  ORCAD_ALIAS
 Net alias attached to a wire (becomes a local label). More...
 
struct  ORCAD_WIRE
 One wire or bus segment. More...
 
struct  ORCAD_PIN_INST
 T0x10: one pin of a placed instance, carrying the pin's absolute page position (the connection point wires attach to). More...
 
struct  ORCAD_PLACED_INSTANCE
 A placed part instance on a page (structure type 13). More...
 
struct  ORCAD_GRAPHIC_INST
 Shared body of Port / Global / OffPageConnector / TitleBlock / ERCObject and the Graphic*Inst shapes (structure types 23, 37, 38, 55..62, 65, 77, 88, 89). More...
 
struct  ORCAD_PRIMITIVE
 One graphic primitive of a symbol body or nested page graphic. More...
 
struct  ORCAD_SYMBOL_PIN
 One pin of a symbol definition (structure types 26/27). More...
 
struct  ORCAD_SYMBOL_DEF
 A symbol definition from the design Cache (LibraryPart / GlobalSymbol / PortSymbol / OffPageSymbol / TitleBlockSymbol / ERCSymbol / ...), or the nested SthInPages0 body of a page graphic. More...
 
struct  ORCAD_DEVICE
 One device of a package: the pin-number map of a unit (structure type 32). More...
 
struct  ORCAD_PACKAGE
 A package: refdes prefix, footprint and per-unit devices (structure type 31). More...
 
struct  ORCAD_BLOCK_PIN
 One interface pin of a hierarchical block, at its absolute page position. More...
 
struct  ORCAD_DRAWN_INSTANCE
 Structure type 12: a hierarchical block instance placed on a page. More...
 
struct  ORCAD_BUS_ENTRY
 Bus entry (structure type 29). More...
 
struct  ORCAD_FONT
 One text font from the Library stream (a Win32 LOGFONTA record, 60 bytes: lfHeight i32 at +0, lfWeight i32 at +16, lfItalic u8 at +20, lfFaceName char[32] at +28). More...
 
struct  ORCAD_PAGE_SETTINGS
 The 156-byte PageSettings block embedded in the Library stream and in every Page stream: 8 bytes create/modify dates, 16 unknown, u32 width, u32 height, u32 pinToPin, 2 bytes, 4 bytes horizontal/vertical count, 2 bytes, 8 bytes horizontal/vertical width, 48 unknown, 24 bytes grid-reference settings, 8 x u32 flags of which flags[0] is isMetric. More...
 
struct  ORCAD_NET_GROUP
 
struct  ORCAD_LIBRARY_INFO
 Decoded Library stream: format version, fonts, and the string table that all property name/value indices reference throughout the file. More...
 
struct  ORCAD_RAW_PAGE
 One parsed 'Views/<folder>/Pages/<page>' stream, raw structure lists in stream order. More...
 
struct  ORCAD_OCC_SCOPE
 One node of the design occurrence tree parsed from the root Hierarchy stream. More...
 
struct  ORCAD_OCC_BLOCK
 A hierarchical block occurrence: one placement of a child schematic folder on a parent page. More...
 
struct  ORCAD_DESIGN
 Everything parsed from one .DSN, as handed to ORCAD_CONVERTER. More...
 

Typedefs

using ORCAD_WARN_FN = std::function<void( const wxString& aMsg )>
 Warning sink shared by all parser entry points (recoverable-issue channel).
 

Enumerations

enum  ORCAD_ST : int {
  ORCAD_ST_STH_IN_PAGES0 = 2 , ORCAD_ST_DSN_STREAM = 4 , ORCAD_ST_PART_CELL = 6 , ORCAD_ST_SCH_LIB = 9 ,
  ORCAD_ST_PAGE = 10 , ORCAD_ST_PART_INSTANCE = 11 , ORCAD_ST_DRAWN_INSTANCE = 12 , ORCAD_ST_PLACED_INSTANCE = 13 ,
  ORCAD_ST_T0X10 = 16 , ORCAD_ST_T0X11 = 17 , ORCAD_ST_WIRE_SCALAR = 20 , ORCAD_ST_WIRE_BUS = 21 ,
  ORCAD_ST_PORT = 23 , ORCAD_ST_LIBRARY_PART = 24 , ORCAD_ST_SYMBOL_PIN_SCALAR = 26 , ORCAD_ST_SYMBOL_PIN_BUS = 27 ,
  ORCAD_ST_BUS_ENTRY = 29 , ORCAD_ST_PACKAGE = 31 , ORCAD_ST_DEVICE = 32 , ORCAD_ST_GLOBAL_SYMBOL = 33 ,
  ORCAD_ST_PORT_SYMBOL = 34 , ORCAD_ST_OFFPAGE_SYMBOL = 35 , ORCAD_ST_GLOBAL = 37 , ORCAD_ST_OFFPAGE_CONNECTOR = 38 ,
  ORCAD_ST_SYMBOL_DISPLAY_PROP = 39 , ORCAD_ST_SYMBOL_VECTOR = 48 , ORCAD_ST_ALIAS = 49 , ORCAD_ST_T0X34 = 52 ,
  ORCAD_ST_T0X35 = 53 , ORCAD_ST_GRAPHIC_BOX_INST = 55 , ORCAD_ST_GRAPHIC_LINE_INST = 56 , ORCAD_ST_GRAPHIC_ARC_INST = 57 ,
  ORCAD_ST_GRAPHIC_ELLIPSE_INST = 58 , ORCAD_ST_GRAPHIC_POLYGON_INST = 59 , ORCAD_ST_GRAPHIC_POLYLINE_INST = 60 , ORCAD_ST_GRAPHIC_COMMENT_TEXT_INST = 61 ,
  ORCAD_ST_GRAPHIC_BITMAP_INST = 62 , ORCAD_ST_TITLEBLOCK_SYMBOL = 64 , ORCAD_ST_TITLEBLOCK = 65 , ORCAD_ST_HIERARCHY_LINK = 66 ,
  ORCAD_ST_ERC_SYMBOL = 75 , ORCAD_ST_BOOKMARK_SYMBOL = 76 , ORCAD_ST_ERC_OBJECT = 77 , ORCAD_ST_BOOKMARK_INST = 78 ,
  ORCAD_ST_GRAPHIC_BEZIER_INST = 88 , ORCAD_ST_GRAPHIC_OLE_INST = 89 , ORCAD_ST_PIN_SHAPE_SYMBOL = 98 , ORCAD_ST_NET_GROUP = 103
}
 Structure type ids as they appear in the u8 type byte of the long/short prefixes. More...
 
enum  ORCAD_PRIM : int {
  ORCAD_PRIM_RECT = 40 , ORCAD_PRIM_LINE = 41 , ORCAD_PRIM_ARC = 42 , ORCAD_PRIM_ELLIPSE = 43 ,
  ORCAD_PRIM_POLYGON = 44 , ORCAD_PRIM_POLYLINE = 45 , ORCAD_PRIM_COMMENT_TEXT = 46 , ORCAD_PRIM_BITMAP = 47 ,
  ORCAD_PRIM_SYMBOL_VECTOR = 48 , ORCAD_PRIM_BEZIER = 87 , ORCAD_PRIM_OLE_IMAGE = 90
}
 Graphic primitive type ids, stored as a doubled u8 pair (t, t) before each primitive body inside symbol definitions. More...
 
enum class  ORCAD_PRIM_KIND {
  GROUP , RECT , LINE , ARC ,
  ELLIPSE , POLYGON , POLYLINE , BEZIER ,
  TEXT , IMAGE
}
 Decoded primitive kind after parsing. More...
 
enum class  ORCAD_PORT_TYPE : int {
  INPUT = 0 , BIDIRECTIONAL = 1 , OUTPUT = 2 , OPEN_COLLECTOR = 3 ,
  PASSIVE = 4 , TRI_STATE = 5 , OPEN_EMITTER = 6 , POWER_IN = 7
}
 Pin electrical type codes (u32 portType field of a symbol pin). More...
 

Detailed Description

Plain data records produced by the OrCAD Capture DSN stream parsers and consumed by ORCAD_CONVERTER.

Header-only; no behavior beyond trivial defaults.

Coordinates throughout are in OrCAD schematic database units (DBU): 1 DBU = 10 mil = 0.254 mm on modern designs. Y grows downward, the same as the KiCad schematic canvas AND KiCad's in-memory LIB_SYMBOL space — no axis flip is required anywhere (the .kicad_sch writer itself flips symbol bodies into the file's Y-up space).

Strings hold the raw Windows-1252 stream bytes (std::string); convert with FromOrcadString() (orcad_stream.h) only where the text reaches the UI or a KiCad object.

Definition in file orcad_records.h.

Typedef Documentation

◆ ORCAD_WARN_FN

using ORCAD_WARN_FN = std::function<void( const wxString& aMsg )>

Warning sink shared by all parser entry points (recoverable-issue channel).

Definition at line 54 of file orcad_records.h.

Enumeration Type Documentation

◆ ORCAD_PORT_TYPE

enum class ORCAD_PORT_TYPE : int
strong

Pin electrical type codes (u32 portType field of a symbol pin).

Values outside 0..7 must be mapped to PASSIVE by the parser.

Enumerator
INPUT 
BIDIRECTIONAL 
OUTPUT 
OPEN_COLLECTOR 
PASSIVE 
TRI_STATE 
OPEN_EMITTER 
POWER_IN 

Definition at line 153 of file orcad_records.h.

◆ ORCAD_PRIM

enum ORCAD_PRIM : int

Graphic primitive type ids, stored as a doubled u8 pair (t, t) before each primitive body inside symbol definitions.

Enumerator
ORCAD_PRIM_RECT 
ORCAD_PRIM_LINE 
ORCAD_PRIM_ARC 
ORCAD_PRIM_ELLIPSE 
ORCAD_PRIM_POLYGON 
ORCAD_PRIM_POLYLINE 
ORCAD_PRIM_COMMENT_TEXT 
ORCAD_PRIM_BITMAP 

plain DIB (BITMAPINFOHEADER + pixels)

ORCAD_PRIM_SYMBOL_VECTOR 

nested prefix-framed vector graphic

ORCAD_PRIM_BEZIER 
ORCAD_PRIM_OLE_IMAGE 

OLE compound document embed.

Definition at line 117 of file orcad_records.h.

◆ ORCAD_PRIM_KIND

enum class ORCAD_PRIM_KIND
strong

Decoded primitive kind after parsing.

Enumerator
GROUP 
RECT 
LINE 
ARC 
ELLIPSE 
POLYGON 
POLYLINE 
BEZIER 
TEXT 
IMAGE 

Definition at line 134 of file orcad_records.h.

◆ ORCAD_ST

enum ORCAD_ST : int

Structure type ids as they appear in the u8 type byte of the long/short prefixes.

Enumerator
ORCAD_ST_STH_IN_PAGES0 

nested symbol body inside Graphic*Inst

ORCAD_ST_DSN_STREAM 
ORCAD_ST_PART_CELL 
ORCAD_ST_SCH_LIB 
ORCAD_ST_PAGE 
ORCAD_ST_PART_INSTANCE 
ORCAD_ST_DRAWN_INSTANCE 

hierarchical block instance

ORCAD_ST_PLACED_INSTANCE 
ORCAD_ST_T0X10 

scalar pin instance (absolute pos)

ORCAD_ST_T0X11 

bus pin instance (absolute pos)

ORCAD_ST_WIRE_SCALAR 
ORCAD_ST_WIRE_BUS 
ORCAD_ST_PORT 
ORCAD_ST_LIBRARY_PART 
ORCAD_ST_SYMBOL_PIN_SCALAR 
ORCAD_ST_SYMBOL_PIN_BUS 
ORCAD_ST_BUS_ENTRY 
ORCAD_ST_PACKAGE 
ORCAD_ST_DEVICE 
ORCAD_ST_GLOBAL_SYMBOL 

power symbol definition

ORCAD_ST_PORT_SYMBOL 
ORCAD_ST_OFFPAGE_SYMBOL 
ORCAD_ST_GLOBAL 

placed power symbol

ORCAD_ST_OFFPAGE_CONNECTOR 
ORCAD_ST_SYMBOL_DISPLAY_PROP 
ORCAD_ST_SYMBOL_VECTOR 
ORCAD_ST_ALIAS 

net alias attached to a wire

ORCAD_ST_T0X34 

raw record, not prefix-framed

ORCAD_ST_T0X35 

raw record, not prefix-framed

ORCAD_ST_GRAPHIC_BOX_INST 
ORCAD_ST_GRAPHIC_LINE_INST 
ORCAD_ST_GRAPHIC_ARC_INST 
ORCAD_ST_GRAPHIC_ELLIPSE_INST 
ORCAD_ST_GRAPHIC_POLYGON_INST 
ORCAD_ST_GRAPHIC_POLYLINE_INST 
ORCAD_ST_GRAPHIC_COMMENT_TEXT_INST 
ORCAD_ST_GRAPHIC_BITMAP_INST 
ORCAD_ST_TITLEBLOCK_SYMBOL 
ORCAD_ST_TITLEBLOCK 
ORCAD_ST_HIERARCHY_LINK 

block dbId -> child folder link

ORCAD_ST_ERC_SYMBOL 
ORCAD_ST_BOOKMARK_SYMBOL 
ORCAD_ST_ERC_OBJECT 

placed ERC marker (no-connect)

ORCAD_ST_BOOKMARK_INST 
ORCAD_ST_GRAPHIC_BEZIER_INST 
ORCAD_ST_GRAPHIC_OLE_INST 
ORCAD_ST_PIN_SHAPE_SYMBOL 
ORCAD_ST_NET_GROUP 

Definition at line 60 of file orcad_records.h.