Skip to content

Commit

Permalink
Misc details
Browse files Browse the repository at this point in the history
  • Loading branch information
Werni2A committed Jun 19, 2024
1 parent d8fecd3 commit 23b7450
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 5 deletions.
6 changes: 6 additions & 0 deletions src/Streams/StreamCache.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,12 @@ void StreamCache::read(FileFormatVersion /* aVersion */)
uint16_t someVal;
do
{
// Indicates what follows
// 0 = Package Name
// 1 = Probably Source Library
// 2 = Probably Source Library
// 3 = Probably Source Library
// Other values have not been observed
someVal = ds.readUint16();

mCtx.mLogger.trace("someVal = {}", someVal);
Expand Down
23 changes: 22 additions & 1 deletion src/Streams/StreamLibrary.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -98,18 +98,30 @@ void StreamLibrary::read(FileFormatVersion aVersion)
textFonts.push_back(font);
}

// @todo Always has length = 24, but why?
const uint16_t someLen = ds.readUint16();

if(someLen != 24U)
{
const std::string msg = fmt::format("Expected length of 24 but got {}", someLen);
mCtx.mLogger.error(msg);
throw std::runtime_error(msg);
}

mCtx.mLogger.trace("someLen = {}", someLen);

for(int i = 0; i < someLen; ++i)
{
const uint16_t someData = ds.readUint16();

// Has value in range [0, 1, 2, 3, 4, 5, 6] and extremely rarely [13]
mCtx.mLogger.trace("someData [{}] = {}", i, someData);
}

// Always has value [00 00 00 00] or [01 00 00 00]
ds.printUnknownData(4, getMethodName(this, __func__) + ": 2.0");

// Always has value [00 00 00 00] or [01 00 00 00]
ds.printUnknownData(4, getMethodName(this, __func__) + ": 2.1");

// Property to Part Field Mapping
Expand Down Expand Up @@ -161,7 +173,16 @@ void StreamLibrary::read(FileFormatVersion aVersion)

if(mDbType == DatabaseType::Design)
{
ds.printUnknownData(8, getMethodName(this, __func__) + ": 5");
ds.assumeData({0x00, 0x00, 0x00, 0x00}, getMethodName(this, __func__) + ": 5.0");
ds.printUnknownData(2, getMethodName(this, __func__) + ": 5.1");

// Always one of:
// [00 00]
// [01 00]
// [02 00]
// [65 54]
ds.printUnknownData(2, getMethodName(this, __func__) + ": 5.2");

std::string schematicName = ds.readStringLenZeroTerm();
mCtx.mLogger.trace("schematicName = {}", schematicName);
}
Expand Down
5 changes: 3 additions & 2 deletions src/Structures/StructLibraryPart.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,10 @@ void StructLibraryPart::read(FileFormatVersion /* aVersion */)

mCtx.mLogger.trace("name = {}", name);

const std::string someStr791411 = ds.readStringLenZeroTerm();
// Absolute path
const std::string sourceLibrary = ds.readStringLenZeroTerm();

mCtx.mLogger.trace("someStr791411 = {}", someStr791411);
mCtx.mLogger.trace("sourceLibrary = {}", sourceLibrary);

localFutureLst.checkpoint();

Expand Down
5 changes: 3 additions & 2 deletions src/Structures/StructPackage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,9 @@ void StructPackage::read(FileFormatVersion /* aVersion */)

mCtx.mLogger.trace("name = {}", name);

std::string unknownStr0 = ds.readStringLenZeroTerm(); // @todo figure out
mCtx.mLogger.trace("{}: unknownStr0 = {}", __func__, unknownStr0);
// Absolute path
const std::string sourceLibrary = ds.readStringLenZeroTerm();
mCtx.mLogger.trace("sourceLibrary = {}", sourceLibrary);

localFutureLst.checkpoint();

Expand Down

0 comments on commit 23b7450

Please sign in to comment.