-
Notifications
You must be signed in to change notification settings - Fork 0
feat: implement SD card log import functionality #305
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
This commit implements the ability to import device logging sessions from SD card files into the application database, as requested in issue #126. Changes: - Created BinaryMessageConsumer for downloading binary files from device - Implemented SdCardLogParser to parse protobuf-encoded SD card log files - Added LoggingSessionImporter service to import logs into the database - Extended AbstractStreamingDevice with DownloadSdCardFileAsync method - Added SD card download message handler (HandleSdCardDownloadMessageReceived) - Updated DeviceLogsViewModel with import command and progress tracking - Enhanced DeviceLogsView with Import button and file selection The implementation: - Downloads binary log files from the SD card via USB connection - Parses protobuf messages to extract analog and digital channel data - Creates a new logging session with all imported samples - Provides progress feedback during the import process - Properly handles SD/LAN interface switching 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
PR Compliance Guide 🔍Below is a summary of compliance checks for this PR:
Compliance status legend🟢 - Fully Compliant🟡 - Partial Compliant 🔴 - Not Compliant ⚪ - Requires Further Human Verification 🏷️ - Compliance label |
|||||||||||||||||||||||||||||||||||||||
PR Code Suggestions ✨Explore these optional code suggestions:
|
|||||||||||||||||||
📊 Code Coverage ReportSummarySummary
CoverageDAQiFi - 9.9%
Daqifi.Desktop.Bootloader - 20.6%
Daqifi.Desktop.Common - 45.9%
Daqifi.Desktop.DataModel - 100%
Daqifi.Desktop.IO - 17.4%
Coverage report generated by ReportGenerator • View full report in build artifacts |
User description
Summary
Implements the ability to import device logging sessions from SD card files into the application database, addressing issue #126.
Changes
DownloadSdCardFileAsyncmethod and SD card download message handlerHow it Works
Key Features
Testing
Related Issues
Closes #126
🤖 Generated with Claude Code
PR Type
Enhancement
Description
Implements SD card log file import functionality with binary download support
Adds
BinaryMessageConsumerfor streaming binary data from deviceCreates
SdCardLogParserto extract protobuf-encoded samples from log filesImplements
LoggingSessionImporterservice for database persistenceExtends device with
DownloadSdCardFileAsyncmethod and UI controlsDiagram Walkthrough
File Walkthrough
BinaryMessage.cs
New binary message class for device dataDaqifi.Desktop.IO/Messages/BinaryMessage.cs
IInboundMessageinterfaceBinaryMessageConsumer.cs
Binary data consumer for file downloadsDaqifi.Desktop.IO/Messages/Consumers/BinaryMessageConsumer.cs
MemoryStreamBinaryMessageupon completionAbstractStreamingDevice.cs
Add SD card file download capability to deviceDaqifi.Desktop/Device/AbstractStreamingDevice.cs
SdCardDownloadmessage handler type to enum_downloadedFileDataand_downloadTaskCompletionSourcefields fordownload state
HandleSdCardDownloadMessageReceivedmethod to processbinary data
DownloadSdCardFileAsyncpublic method with USB validation,timeout handling, and interface switching
IStreamingDevice.cs
Add download method to device interfaceDaqifi.Desktop/Device/IStreamingDevice.cs
DownloadSdCardFileAsyncmethod signature to interfaceTaskfor asynchronous binary file downloadLoggingSessionImporter.cs
Service for importing logs to databaseDaqifi.Desktop/Services/LoggingSessionImporter.cs
SdCardLogParserLoggingSessionwith auto-incremented IDIProgresscallbackSdCardLogParser.cs
Parser for protobuf SD card log filesDaqifi.Desktop/Services/SdCardLogParser.cs
scanning
configuration
timestamps
DeviceLogsViewModel.cs
Add import command and file selection to view modelDaqifi.Desktop/ViewModels/DeviceLogsViewModel.cs
SelectedFileobservable property for file selectionImportFileCommandrelay command with can-execute validationImportFileAsyncmethod handling download, import, andprogress reporting
LoggingSessionImporterservice with progress callbacksDeviceLogsView.xaml
Add import button and file selection UIDaqifi.Desktop/View/DeviceLogsView.xaml
SelectedItembinding to ListView for file selectionImportFileCommandwith enabled state validation