Skip to content

Confirm DBV@ values and expose named domain properties (fixes #19) - #34

Merged
mahach666 merged 2 commits into
mainfrom
feat/issue-19-confirm-dbv-values
Nov 14, 2026
Merged

mahach666 merged 2 commits into
mainfrom
feat/issue-19-confirm-dbv-values

Conversation

@mahach666

Copy link
Copy Markdown
Contributor

Resolves #19.

Summary of Changes:

  • Reverse Engineering Analysis:
    • Investigated Tekla.Structures.Native.DbvDatabase.dll and Tekla Model Sharing domain events / baselines (WriteBaseline, BeforeWriteNewBaselineDomainEvents, IdRangeMapper_c, dbv_domainheader_s).
    • Corroborated with all 19 real DBV@ databases in C:\TeklaStructuresModels.
    • Confirmed the meaning of DBV@ header fields:
      • \Prologue[1]: \DomainId\ (2 = Options, 3 = Environment, 4 = Analysis).
      • \ListHeader[3]: \Generation\ (database version, increments every save, equals \GuidRecords.Count + 1).
      • \B: \BaseOffset\ (starting byte offset of baseline events).
      • \C: \EventLevel\ (always 5 for domain events).
      • \T[1]: \CurrentOffset\ (cumulative event byte offset; equals \BaseOffset + 32 * L1.Count).
      • \T[2]\ and \T[3]: Always 0 (verified across all real files; added reader warnings if non-zero).
      • \T[4]: \LastEventOffset\ (offset of the most recent 32-byte event; equals \CurrentOffset - 32).
  • API:
    • Exposed named read-only properties on \DbvDocument: \DomainId, \Generation, \BaseOffset, \EventLevel, \CurrentOffset, and \LastEventOffset, while preserving raw access for fidelity.
  • Tests & Docs:
    • Added warning tests for unexpected \T[2]\ and \T[3]\ in \DbvTests.
    • Updated \docs/public-api.md.

@mahach666
mahach666 merged commit 8c8423e into main Nov 14, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Confirm DBV@ values that are read raw

1 participant