Bug 1215 - Properly handle session structure when using reset() on file devices
Summary: Properly handle session structure when using reset() on file devices
Status: CONFIRMED
Alias: None
Product: PulseView
Classification: Unclassified
Component: File handling (show other bugs)
Version: unreleased development snapshot
Hardware: All All
: Normal normal
Target Milestone: PulseView 0.6.0
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-06-03 10:32 CEST by Soeren Apel
Modified: 2018-06-03 10:32 CEST (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Soeren Apel 2018-06-03 10:32:16 CEST
We want PV to support a common use case: user gathers data using an external tool, exports its data to a file, imports that file in PV, updates the file and wants to click "Run" to update the file's data in PV.

In order to support this, reset() was introduced in libsigrok's input modules. It resets the input module's internal state so that file data can be fed to it again. However, one limitation is that the libsigrok channels must only be created once (in init()) because PV doesn't remove the sigrok channels from the session when using this mechanism.
The reason for this is that removing the channels would remove everything that the user set up: channel naming, channel display settings, channel conversions, channel assignments to PDs.

With input modules where the number of channels is determined by the file's contents however, this is a big problem. What if the number of channels changes? Or the order in which they appear? Currently, this would lead to wrong data or crashes (#1167).

Ideally, PV would be able to clear the libsigrok channels while keeping the corresponding signal instances around. When the channels are re-created, they need to be reconnected (e.g. using the internal names), deleted (when a channel no longer exists) or created (when a channel didn't exist before).

This bug report can be closed when this is implemented and a new libsigrok bug should be opened then that removes reset(). Also, a new bug for PV should then be opened to replace reset() by calls to cleanup() and init(). That way, this entire mechanism is invisible to the input modules.