Bug 1841

Summary: Request: Add auto-save while capturing
Product: PulseView Reporter: cedric <cedric.dewijs>
Component: File handlingAssignee: Nobody <nobody>
Status: CONFIRMED ---    
Severity: normal    
Priority: Normal    
Version: unreleased development snapshot   
Target Milestone: ---   
Hardware: All   
OS: All   

Description cedric 2023-04-16 10:46:39 CEST
Overview: I would like pulseview to autosave during a capture, so the data of the samples is still there. 

Steps to Reproduce:
1) Start Pulseview.
2) Change the samplerate to 100Hz (to have more time for the following steps)
3) Click Run. Now data is coming in, and traces are drawn.
4) On a separate console, type "killall -s 9 pulseview" to simulate a crash. Pulseview now dissapears (as expected)
5) Start Pulseview. Pulseview starts in the default state, without any data.

Actual Results:
Pulseview has lost all data and settings after a crash.

Expected Results:
At step 3, I would like pulseview to start streaming the sample data to disk, as well into the display memory. For this to work without asking the user, Pulseview needs a default location to save that data, and settings to change the default location, and limit the max amount of data that is stored there.
At step 5, I would like pulseview to restore the data up to the point of the crash, so I don't loose the sample data. if this data is large, pulseview can ask the user if he wants the data to be restored, as that can take some time.

Build Date & Hardware: I build it myself on 04/15/2023 on a 64 bit AMD machine.
Versions, libraries and features:
0.6.0-git/4:0:0 (rt: 0.6.0-git-5bce22ac/4:0:0)
- glib
2.76.1 (rt: 2.76.1/7601:1)
- zlib
- libzip
- minilzo
- libserialport
0.1.1/1:0:1 (rt: 0.1.1/1:0:1)
- libusb-1.0 API 0x01000109
- hidapi
- bluez
- libftdi
- Host
x86_64-pc-linux-gnu, little-endian
- SCPI backends
TCP, RPC, serial, USBTMC
0.6.0-git-d7da8b9/4:0:0 (rt: 0.6.0-git-d7da8b9/4:0:0)
- glib
2.76.1 (rt: 2.76.1/7601:1)
- Python
3.10.10 / 0x30a0af0 (API 1013, ABI 3)
- Host
x86_64-pc-linux-gnu, little-endian
Kernel version: $ uname -a 
Linux cedric 6.2.11-arch1-1 #1 SMP PREEMPT_DYNAMIC Thu, 13 Apr 2023 16:59:24 +0000 x86_64 GNU/Linux

Additional Builds and Platforms:
Not explicitly tested with this exact version, but the windows version running on windows 10 also does this.

Additional Information:
Notepad++ on Windows is a great example of a program that does auto save in the background, so crashes/updates/unplanned alt-F4 presses, dead batteries and so on are not a problem anymore.