wpilog-parser 4.2.0 → 4.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -208,7 +208,7 @@ function readTimestamp(view, offset, length) {
208
208
  case 5: return view.getUint32(offset, true) + view.getUint8(offset + 4) * 2 ** 32;
209
209
  case 6: return view.getUint32(offset, true) + view.getUint16(offset + 4, true) * 2 ** 32;
210
210
  case 7: return view.getUint32(offset, true) + (view.getUint16(offset + 4, true) + view.getUint8(offset + 6) * 2 ** 16) * 2 ** 32;
211
- case 8: return view.getUint32(offset, true) + view.getUint32(offset + 4, true) * 2 ** 32;
211
+ case 8: return view.getUint32(offset, true) + view.getInt32(offset + 4, true) * 2 ** 32;
212
212
  default: throw new RangeError(`Invalid timestamp length ${length}`);
213
213
  }
214
214
  }
package/dist/cli.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { a as readRecords, l as diagnostics, t as catalogEntries } from "./catalog-4hqIYGKb.mjs";
2
+ import { a as readRecords, l as diagnostics, t as catalogEntries } from "./catalog-BP1qf30c.mjs";
3
3
  import { Diagnostic, formatDiagnostic } from "nostics";
4
4
  import { RootCommand, script } from "@bomb.sh/tab";
5
5
  import { boolean, command, commandsInfo, positional, run } from "@drizzle-team/brocli";
@@ -7,7 +7,7 @@ import oscStatus from "osc-status";
7
7
  import { readFile } from "node:fs/promises";
8
8
  import { encode } from "@toon-format/toon";
9
9
  // package.json
10
- var version = "4.2.0";
10
+ var version = "4.2.1";
11
11
  var description = "Read WPILib wpilog data log files in TypeScript & JavaScript";
12
12
  // src/cli/catalog.ts
13
13
  async function catalogFile(filePath) {
package/dist/index.d.mts CHANGED
@@ -45,7 +45,10 @@ type CatalogEntry = {
45
45
  /** A raw (undecoded) data log record from the binary format. */
46
46
  type RawRecord = {
47
47
  entryId: number;
48
- /** Timestamp in microseconds. */
48
+ /**
49
+ * Timestamp in microseconds. Can be negative for values set before logging started,
50
+ * such as NetworkTables values published before the log was opened.
51
+ */
49
52
  timestamp: number;
50
53
  payload: Uint8Array;
51
54
  };
@@ -79,7 +82,10 @@ type ControlRecord = Extract<DecodedRecord, {
79
82
  export declare function isDataRecord(record: DecodedRecord): record is DataRecord;
80
83
  /** A decoded data log record. */
81
84
  type DecodedRecord = {
82
- /** Timestamp in microseconds. */
85
+ /**
86
+ * Timestamp in microseconds. Can be negative for values set before logging started,
87
+ * such as NetworkTables values published before the log was opened.
88
+ */
83
89
  timestamp: number;
84
90
  } & ({
85
91
  entryId: number;
package/dist/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { a as readRecords, c as isDataRecord, i as withStructDiagnostics, n as decodeRecords, o as ControlRecordType, r as parseDataLog, s as RecordType, t as catalogEntries } from "./catalog-4hqIYGKb.mjs";
1
+ import { a as readRecords, c as isDataRecord, i as withStructDiagnostics, n as decodeRecords, o as ControlRecordType, r as parseDataLog, s as RecordType, t as catalogEntries } from "./catalog-BP1qf30c.mjs";
2
2
  import { KnownStructTypeName, parseStructSpecification as parseStructSpecification$1 } from "wpilib-struct";
3
3
  // src/struct/parse-struct.ts
4
4
  /** Parse a WPILib struct specification string into declarations. */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wpilog-parser",
3
- "version": "4.2.0",
3
+ "version": "4.2.1",
4
4
  "description": "Read WPILib wpilog data log files in TypeScript & JavaScript",
5
5
  "homepage": "https://github.com/jonahsnider/wpilog-parser#readme",
6
6
  "license": "MIT",
@@ -30,7 +30,7 @@
30
30
  "access": "public"
31
31
  },
32
32
  "dependencies": {
33
- "@bomb.sh/tab": "^0.0.22",
33
+ "@bomb.sh/tab": "^0.0.23",
34
34
  "@drizzle-team/brocli": "^0.12.1",
35
35
  "@toon-format/toon": "^4.1.1",
36
36
  "nostics": "^1.3.0",
@@ -39,7 +39,7 @@
39
39
  },
40
40
  "devDependencies": {
41
41
  "@microsoft/api-extractor": "7.60.1",
42
- "vite-plus": "1.6.0",
42
+ "vite-plus": "1.7.0",
43
43
  "vitest": "5.1.0"
44
44
  },
45
45
  "tsdocMetadata": "./dist/tsdoc-metadata.json",
@@ -74,7 +74,7 @@ When DriverStation logging is on, every WPILOG has these `boolean` entries:
74
74
  | `/DS:test` | `true` during test mode. |
75
75
  | `/DS:estop` | `true` if e-stopped. |
76
76
 
77
- The mode flags (`autonomous`, `test`) reflect what the DS _would_ run if enabled, so check `/DS:enabled` together with them. Timestamps are microseconds (`number`).
77
+ The mode flags (`autonomous`, `test`) reflect what the DS _would_ run if enabled, so check `/DS:enabled` together with them. Timestamps are microseconds (`number`). They can be negative for values set before logging started, such as NetworkTables values published before the log was opened.
78
78
 
79
79
  ### Tracking enable/mode durations
80
80