projects
/
pulseview.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
DecodeSignal: Make sure bit IDs are always up-to-date
[pulseview.git]
/
pv
/
data
/
decodesignal.cpp
diff --git
a/pv/data/decodesignal.cpp
b/pv/data/decodesignal.cpp
index 8bdad1097af99c654779f5a8c48f0d05d77d4e4d..a7afe44e7408ecf6fac5bdb92f03300493155b46 100644
(file)
--- a/
pv/data/decodesignal.cpp
+++ b/
pv/data/decodesignal.cpp
@@
-507,7
+507,6
@@
void DecodeSignal::restore_settings(QSettings &settings)
// Include the newly created decode channels in the channel lists
update_channel_list();
// Include the newly created decode channels in the channel lists
update_channel_list();
- commit_decoder_channels();
break;
}
}
break;
}
}
@@
-544,6
+543,10
@@
void DecodeSignal::restore_settings(QSettings &settings)
settings.endGroup();
}
settings.endGroup();
}
+ // Update the internal structures
+ update_channel_list();
+ commit_decoder_channels();
+
begin_decode();
}
begin_decode();
}
@@
-640,6
+643,12
@@
void DecodeSignal::commit_decoder_channels()
dec->set_channels(channel_list);
}
dec->set_channels(channel_list);
}
+
+ // Channel bit IDs must be in sync with the channel's apperance in channels_
+ int id = 0;
+ for (data::DecodeChannel &ch : channels_)
+ if (ch.assigned_signal)
+ ch.bit_id = id++;
}
void DecodeSignal::mux_logic_samples(const int64_t start, const int64_t end)
}
void DecodeSignal::mux_logic_samples(const int64_t start, const int64_t end)
@@
-655,11
+664,8
@@
void DecodeSignal::mux_logic_samples(const int64_t start, const int64_t end)
vector<uint8_t> signal_in_bytepos;
vector<uint8_t> signal_in_bitpos;
vector<uint8_t> signal_in_bytepos;
vector<uint8_t> signal_in_bitpos;
- int id = 0;
for (data::DecodeChannel &ch : channels_)
if (ch.assigned_signal) {
for (data::DecodeChannel &ch : channels_)
if (ch.assigned_signal) {
- ch.bit_id = id++;
-
const shared_ptr<Logic> logic_data = ch.assigned_signal->logic_data();
const shared_ptr<LogicSegment> segment = logic_data->logic_segments().front();
segments.push_back(segment);
const shared_ptr<Logic> logic_data = ch.assigned_signal->logic_data();
const shared_ptr<LogicSegment> segment = logic_data->logic_segments().front();
segments.push_back(segment);
@@
-744,11
+750,6
@@
void DecodeSignal::logic_mux_proc()
logic_mux_cond_.wait(logic_mux_lock);
}
} while (!logic_mux_interrupt_);
logic_mux_cond_.wait(logic_mux_lock);
}
} while (!logic_mux_interrupt_);
-
- // No more input data and session is stopped, let the decode thread
- // process any pending data, terminate and release the global SRD mutex
- // in order to let other decoders run
- decode_input_cond_.notify_one();
}
void DecodeSignal::query_input_metadata()
}
void DecodeSignal::query_input_metadata()