Spaces:
Paused
Paused
Download lib/summaryHelper/tlogParser.js from Adhyasta/gcs-backend-server: direct link, hf CLI and curl.
- Browser
- Download file 725 Bytes
-
https://huggingface.co/spaces/Adhyasta/gcs-backend-server/resolve/main/lib/summaryHelper/tlogParser.js
- Command line
-
hf download hf://spaces/Adhyasta/gcs-backend-server/lib/summaryHelper/tlogParser.js
-
curl -L -o tlogParser.js https://huggingface.co/spaces/Adhyasta/gcs-backend-server/resolve/main/lib/summaryHelper/tlogParser.js
725 Bytes
| const fs = require('fs') | |
| const { Readable } = require('stream') | |
| const { parsePBTlog } = require('../tlogParsers/pbTlogParser.js') | |
| const { parseMavTlog } = require('./tools/mavTlogReader.js') | |
| /* TODO: | |
| - use another way to identify Mavlink or PB file instead of using filename | |
| */ | |
| const parseTlog = (fileName, responseCallback) => { | |
| fs.readFile(`../Adhyasta-MavPyRedis/logs/${fileName}.tlog`, (err, file) => { | |
| if (err) { | |
| console.error('Error reading directory:', file) | |
| return | |
| } | |
| if (String(fileName).startsWith('pb-')) { | |
| parsePBTlog(fileName, responseCallback) | |
| return | |
| } | |
| const _file = Readable.from(file) | |
| parseMavTlog(_file, responseCallback) | |
| }) | |
| } | |
| module.exports = parseTlog | |