Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions src/components/MainMenu.vue
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,7 @@ import ConfigurationMissionView from '@/views/ConfigurationMissionView.vue'
import ConfigurationUIView from '@/views/ConfigurationUIView.vue'
import ConfigurationVideoView from '@/views/ConfigurationVideoView.vue'
import ToolsDataLakeView from '@/views/ToolsDataLakeView.vue'
import ToolsLogsView from '@/views/ToolsLogsView.vue'
import ToolsMAVLinkView from '@/views/ToolsMAVLinkView.vue'

const route = useRoute()
Expand Down Expand Up @@ -435,6 +436,12 @@ const toolsMenu = computed(() => {
componentName: SubMenuComponentName.ToolsDataLake,
component: markRaw(ToolsDataLakeView) as SubMenuComponent,
},
{
icon: 'mdi-file-chart-outline',
title: 'Data Logs',
componentName: SubMenuComponentName.ToolsLogs,
component: markRaw(ToolsLogsView) as SubMenuComponent,
},
]

if (interfaceStore.pirateMode) {
Expand Down
26 changes: 23 additions & 3 deletions src/components/VideoLibraryModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -834,7 +834,12 @@ import { useSnapshotStore } from '@/stores/snapshot'
import { useVideoStore } from '@/stores/video'
import { SnapshotLibraryFile } from '@/types/snapshot'
import { VideoLibraryFile, VideoLibraryLogFile } from '@/types/video'
import { videoSubtitlesFilename, videoThumbnailFilename } from '@/utils/video'
import {
videoSubtitlesFilename,
videoTelemetryCsvFilename,
videoTelemetryJsonFilename,
videoThumbnailFilename,
} from '@/utils/video'

const videoStore = useVideoStore()
const interfaceStore = useAppInterfaceStore()
Expand Down Expand Up @@ -1146,9 +1151,24 @@ const deselectAllVideos = (): void => {
// Add the log files to the list of files to be downloaded/discarded
const addLogDataToFileList = (fileNames: string[]): string[] => {
const filesWithLogData = fileNames.flatMap((fileName) => {
const result = [fileName]

const subtitleFileName = videoSubtitlesFilename(fileName)
const subtitleExists = availableLogFiles.value.some((video) => video.fileName === subtitleFileName)
return subtitleExists ? [fileName, subtitleFileName] : [fileName]
if (availableLogFiles.value.some((video) => video.fileName === subtitleFileName)) {
result.push(subtitleFileName)
}

const jsonFileName = videoTelemetryJsonFilename(fileName)
if (availableLogFiles.value.some((video) => video.fileName === jsonFileName)) {
result.push(jsonFileName)
}

const csvFileName = videoTelemetryCsvFilename(fileName)
if (availableLogFiles.value.some((video) => video.fileName === csvFileName)) {
result.push(csvFileName)
}

return result
})
return filesWithLogData
}
Expand Down
22 changes: 19 additions & 3 deletions src/composables/videoChunkManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,12 @@ import { LiveVideoProcessor } from '@/libs/live-video-processor'
import { formatBytes, isElectron } from '@/libs/utils'
import { useVideoStore } from '@/stores/video'
import { type FileDescriptor } from '@/types/video'
import { videoFilename, videoSubtitlesFilename } from '@/utils/video'
import {
videoFilename,
videoSubtitlesFilename,
videoTelemetryCsvFilename,
videoTelemetryJsonFilename,
} from '@/utils/video'

import { useInteractionDialog } from './interactionDialog'
import { useSnackbar } from './snackbar'
Expand Down Expand Up @@ -501,15 +506,26 @@ export const useVideoChunkManager = (): {
// Finalize the streaming process
await window.electronAPI.finalizeVideoRecording(processId)

// Find and copy telemetry file if it exists
// Find and copy telemetry files if they exist (.ass, .json, .csv)
try {
const videoKeys = await videoStore.videoStorage.keys()

const assFile = videoKeys.find((key) => key.includes(group.hash) && key.endsWith('.ass'))
if (assFile) {
await window.electronAPI.copyTelemetryFile(assFile, videoSubtitlesFilename(outputPath))
}

const jsonFile = videoKeys.find((key) => key.includes(group.hash) && key.endsWith('.json'))
if (jsonFile) {
await window.electronAPI.copyTelemetryFile(jsonFile, videoTelemetryJsonFilename(outputPath))
}

const csvFile = videoKeys.find((key) => key.includes(group.hash) && key.endsWith('.csv'))
if (csvFile) {
await window.electronAPI.copyTelemetryFile(csvFile, videoTelemetryCsvFilename(outputPath))
}
} catch (error) {
console.warn('Failed to copy telemetry file:', error)
console.warn('Failed to copy telemetry files:', error)
}

openSnackbar({
Expand Down
20 changes: 14 additions & 6 deletions src/libs/live-video-processor.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { isElectron } from '@/libs/utils'
import type { VideoChunkQueueItem, ZipExtractionResult } from '@/types/video'
import { videoSubtitlesFilename } from '@/utils/video'
import { videoSubtitlesFilename, videoTelemetryCsvFilename, videoTelemetryJsonFilename } from '@/utils/video'

/**
* Error class for LiveVideoProcessor initialization errors
Expand Down Expand Up @@ -237,7 +237,7 @@ export class LiveVideoProcessor {

// Extract ZIP and get chunk information
const extractionResult: ZipExtractionResult = await window.electronAPI.extractVideoChunksZip(zipFilePath)
const { chunkPaths, assFilePath, hash, fileName, tempDir } = extractionResult
const { chunkPaths, assFilePath, jsonFilePath, csvFilePath, hash, fileName, tempDir } = extractionResult

console.log(`Extracted ${chunkPaths.length} chunks from ZIP file`)
onProgress?.(30, 'Starting video processing...')
Expand Down Expand Up @@ -276,10 +276,18 @@ export class LiveVideoProcessor {
// Finalize the streaming process
await window.electronAPI.finalizeVideoRecording(processId)

// Copy telemetry file if it exists (using the full output path)
if (assFilePath) {
onProgress?.(95, 'Copying telemetry file...')
await window.electronAPI.copyTelemetryFile(assFilePath, videoSubtitlesFilename(outputPath))
// Copy telemetry files if they exist (using the full output path)
if (assFilePath || jsonFilePath || csvFilePath) {
onProgress?.(95, 'Copying telemetry files...')
if (assFilePath) {
await window.electronAPI.copyTelemetryFile(assFilePath, videoSubtitlesFilename(outputPath))
}
if (jsonFilePath) {
await window.electronAPI.copyTelemetryFile(jsonFilePath, videoTelemetryJsonFilename(outputPath))
}
if (csvFilePath) {
await window.electronAPI.copyTelemetryFile(csvFilePath, videoTelemetryCsvFilename(outputPath))
}
}

// Clean up temporary extraction directory
Expand Down
Loading
Loading