+ }
+
+ signals_changed();
+}
+
+void SigSession::feed_in_logic(const sr_datafeed_logic &logic)
+{
+ lock_guard<mutex> lock(_data_mutex);
+
+ if (!_logic_data)
+ {
+ qDebug() << "Unexpected logic packet";
+ return;
+ }
+
+ if (!_cur_logic_snapshot)
+ {
+ // This could be the first packet after a trigger
+ set_capture_state(Running);
+
+ // Create a new data snapshot
+ _cur_logic_snapshot = shared_ptr<data::LogicSnapshot>(
+ new data::LogicSnapshot(logic, _dev_inst->get_sample_limit()));
+ _logic_data->push_snapshot(_cur_logic_snapshot);
+ }
+ else
+ {
+ // Append to the existing data snapshot
+ _cur_logic_snapshot->append_payload(logic);
+ }
+
+ data_updated();
+}
+
+void SigSession::feed_in_analog(const sr_datafeed_analog &analog)
+{
+ lock_guard<mutex> lock(_data_mutex);
+
+ const unsigned int probe_count = g_slist_length(analog.probes);
+ const size_t sample_count = analog.num_samples / probe_count;
+ const float *data = analog.data;
+ bool sweep_beginning = false;
+
+ for (GSList *p = analog.probes; p; p = p->next)
+ {
+ shared_ptr<data::AnalogSnapshot> snapshot;
+
+ sr_probe *const probe = (sr_probe*)p->data;
+ assert(probe);
+
+ // Try to get the snapshot of the probe
+ const map< const sr_probe*, shared_ptr<data::AnalogSnapshot> >::
+ iterator iter = _cur_analog_snapshots.find(probe);
+ if (iter != _cur_analog_snapshots.end())
+ snapshot = (*iter).second;