2
0
forked from Ivasoft/DSView

fix: Can't restore the disabled channel from dso data file

This commit is contained in:
dreamsourcelabTAI
2023-02-20 16:17:40 +08:00
parent 44add386d1
commit bc0684b57a
4 changed files with 8 additions and 10 deletions

View File

@@ -111,10 +111,9 @@ void DsoSnapshot::free_data()
}
void DsoSnapshot::first_payload(const sr_datafeed_dso &dso, uint64_t total_sample_count,
GSList *channels, bool instant)
GSList *channels, bool instant, bool isFile)
{
assert(channels);
//dsv_info("first total_sample_count:%llu", total_sample_count);
assert(channels);
bool channel_changed = false;
uint16_t channel_num = 0;
@@ -123,7 +122,7 @@ void DsoSnapshot::first_payload(const sr_datafeed_dso &dso, uint64_t total_sampl
sr_channel *const probe = (sr_channel*)l->data;
if (probe->type == SR_CHANNEL_DSO) {
if (probe->enabled){
if (probe->enabled || isFile){
channel_num++;
if (!channel_changed){
channel_changed = !has_data(probe->index);
@@ -150,7 +149,7 @@ void DsoSnapshot::first_payload(const sr_datafeed_dso &dso, uint64_t total_sampl
for (const GSList *l = channels; l; l = l->next) {
sr_channel *const probe = (sr_channel*)l->data;
if (probe->type == SR_CHANNEL_DSO && probe->enabled) {
if (probe->type == SR_CHANNEL_DSO && (probe->enabled || isFile)) {
uint8_t *chan_buffer = (uint8_t*)malloc(total_sample_count + 1);
if (chan_buffer == NULL){

View File

@@ -86,7 +86,7 @@ public:
void init();
void first_payload(const sr_datafeed_dso &dso, uint64_t total_sample_count,
GSList *channels, bool instant);
GSList *channels, bool instant, bool isFile);
void append_payload(const sr_datafeed_dso &dso);
const uint8_t* get_samples(int64_t start_sample, int64_t end_sample, uint16_t index);

View File

@@ -985,7 +985,8 @@ namespace pv
_capture_data->get_dso()->first_payload(o,
_device_agent.get_sample_limit(),
_device_agent.get_channels(),
_is_instant);
_is_instant,
_device_agent.is_file());
}
else
{