#include <pv/data/logicsnapshot.h>
#include <pv/data/decode/decoder.h>
#include <pv/data/decode/annotation.h>
+#include <pv/sigsession.h>
#include <pv/view/logicsignal.h>
using boost::lock_guard;
_session(session),
_samples_decoded(0)
{
+ connect(&_session, SIGNAL(frame_began()), this, SLOT(on_new_frame()));
+
_stack.push_back(shared_ptr<decode::Decoder>(
new decode::Decoder(dec)));
}
d->new_decode_data();
}
+void DecoderStack::on_new_frame()
+{
+ begin_decode();
+}
+
} // namespace data
} // namespace pv
static void annotation_callback(srd_proto_data *pdata,
void *decoder);
+private slots:
+ void on_new_frame();
+
signals:
void new_decode_data();
signals_changed();
}
+void SigSession::feed_in_frame_begin()
+{
+ if (_cur_logic_snapshot || !_cur_analog_snapshots.empty())
+ frame_began();
+}
+
void SigSession::feed_in_logic(const sr_datafeed_logic &logic)
{
lock_guard<mutex> lock(_data_mutex);
_cur_logic_snapshot = shared_ptr<data::LogicSnapshot>(
new data::LogicSnapshot(logic, _dev_inst->get_sample_limit()));
_logic_data->push_snapshot(_cur_logic_snapshot);
+
+ // @todo Putting this here means that only listeners querying
+ // for logic will be notified. Currently the only user of
+ // frame_began is DecoderStack, but in future we need to signal
+ // this after both analog and logic sweeps have begun.
+ frame_began();
}
else
{
*(const sr_datafeed_meta*)packet->payload);
break;
+ case SR_DF_FRAME_BEGIN:
+ feed_in_frame_begin();
+ break;
+
case SR_DF_LOGIC:
assert(packet->payload);
feed_in_logic(*(const sr_datafeed_logic*)packet->payload);
void feed_in_meta(const sr_dev_inst *sdi,
const sr_datafeed_meta &meta);
+ void feed_in_frame_begin();
+
void feed_in_logic(const sr_datafeed_logic &logic);
void feed_in_analog(const sr_datafeed_analog &analog);
void signals_changed();
+ void frame_began();
+
void data_updated();
private: