Commit 856e1803 authored by DreamSourceLab's avatar DreamSourceLab

Improve the hardware abstraction layer

parent c7cba6a7
......@@ -66,5 +66,6 @@
<file>icons/manual.png</file>
<file>icons/bug.png</file>
<file>icons/support.png</file>
<file>icons/showDoc.png</file>
</qresource>
</RCC>
......@@ -33,6 +33,8 @@
#include <QFile>
#include <QDir>
#include <QTranslator>
#include <QSettings>
#include <QDesktopServices>
#include "dsapplication.h"
#include "pv/devicemanager.h"
......@@ -158,6 +160,7 @@ int main(int argc, char *argv[])
qss.close();
w.show();
w.readSettings();
w.show_doc();
// Run the application
ret = a.exec();
......
......@@ -273,9 +273,9 @@ void AnalogSnapshot::append_payload_to_envelope_levels()
// Break off if there are no new samples to compute
if (e0.ring_length == prev_length)
return;
continue;
if (e0.length == 0)
return;
continue;
reallocate_envelope(e0);
......
......@@ -174,7 +174,7 @@ void MathStack::calc_fft()
boost::shared_ptr<pv::data::Dso> data;
boost::shared_ptr<pv::view::DsoSignal> dsoSig;
BOOST_FOREACH(const boost::shared_ptr<view::Signal> s, _session.get_signals()) {
if (dsoSig = dynamic_pointer_cast<view::DsoSignal>(s)) {
if ((dsoSig = dynamic_pointer_cast<view::DsoSignal>(s))) {
if (dsoSig->get_index() == _index && dsoSig->enabled()) {
data = dsoSig->dso_data();
break;
......
......@@ -69,12 +69,12 @@ QString Device::format_device_title() const
assert(_sdi);
if (_sdi->vendor && _sdi->vendor[0]) {
s << _sdi->vendor;
if ((_sdi->model && _sdi->model[0]) ||
(_sdi->version && _sdi->version[0]))
s << ' ';
}
// if (_sdi->vendor && _sdi->vendor[0]) {
// s << _sdi->vendor;
// if ((_sdi->model && _sdi->model[0]) ||
// (_sdi->version && _sdi->version[0]))
// s << ' ';
// }
if (_sdi->model && _sdi->model[0]) {
s << _sdi->model;
......
......@@ -174,7 +174,7 @@ double DevInst::get_sample_time()
return sample_time;
}
GSList* DevInst::get_dev_mode_list()
const GSList* DevInst::get_dev_mode_list()
{
assert(_owner);
sr_dev_inst *const sdi = dev_inst();
......
......@@ -107,7 +107,7 @@ public:
* @return The returned device mode list from the driver, or NULL if the
* mode list could not be read.
*/
GSList* get_dev_mode_list();
const GSList *get_dev_mode_list();
/**
* @brief Get the device name from the driver
......
......@@ -58,8 +58,8 @@ About::About(QWidget *parent) :
QString thanks = tr("<font size=16>Special Thanks</font><br />"
"<a href=\"%1\" style=\"color:#C0C0C0\">All backers on kickstarter</a><br />"
"<a href=\"%1\" style=\"color:#C0C0C0\">All members of Sigrok project</a><br />"
"All contributors of open-source projects</a><br />"
"<a href=\"%2\" style=\"color:#C0C0C0\">All members of Sigrok project</a><br />"
"All contributors of all open-source projects</a><br />"
"<br /><br />")
.arg("https://www.kickstarter.com/projects/dreamsourcelab/dslogic-multifunction-instruments-for-everyone")
.arg("http://sigrok.org/");
......
......@@ -48,10 +48,11 @@ DeviceOptions::DeviceOptions(QWidget *parent, boost::shared_ptr<pv::device::DevI
_props_box->setLayout(get_property_form(_props_box));
_layout.addWidget(_props_box);
QGroupBox *dynamic_box = new QGroupBox(dynamic_widget(_dynamic_layout),
_dynamic_box = new QGroupBox(dynamic_widget(_dynamic_layout),
this);
dynamic_box->setLayout(&_dynamic_layout);
_layout.addWidget(dynamic_box);
_dynamic_box->setLayout(&_dynamic_layout);
_layout.addWidget(_dynamic_box);
_dynamic_box->setVisible(_dynamic_box->title() != NULL);
_layout.addStretch(1);
_layout.addWidget(&_button_box);
......@@ -333,6 +334,7 @@ void DeviceOptions::mode_check()
if (mode != _mode) {
dynamic_widget(_dynamic_layout);
_dynamic_box->setVisible(_dynamic_box->title() != NULL);
_mode = mode;
}
}
......@@ -356,9 +358,12 @@ void DeviceOptions::mode_check()
void DeviceOptions::channel_check()
{
QRadioButton* sc=dynamic_cast<QRadioButton*>(sender());
QString text = sc->text();
text.remove('&');
if(sc != NULL)
_dev_inst->set_config(NULL, NULL, SR_CONF_CHANNEL_MODE, g_variant_new_string(sc->text().toUtf8().data()));
_dev_inst->set_config(NULL, NULL, SR_CONF_CHANNEL_MODE, g_variant_new_string(text.toUtf8().data()));
dynamic_widget(_dynamic_layout);
_dynamic_box->setVisible(_dynamic_box->title() != NULL);
}
void DeviceOptions::channel_enable()
......@@ -424,20 +429,27 @@ QString DeviceOptions::dynamic_widget(QGridLayout& inner_layout) {
logic_probes(inner_layout);
return tr("Channels");
} else if (_dev_inst->dev_inst()->mode == DSO) {
_config_button = new QPushButton(tr("Auto Calibration"), this);
inner_layout.addWidget(_config_button, 0, 0, 1, 1);
connect(_config_button, SIGNAL(clicked()), this, SLOT(zero_adj()));
_cali_button = new QPushButton(tr("Manual Calibration"), this);
inner_layout.addWidget(_cali_button, 1, 0, 1, 1);
connect(_cali_button, SIGNAL(clicked()), this, SLOT(on_calibration()));
return tr("Calibration");
GVariant* gvar = _dev_inst->get_config(NULL, NULL, SR_CONF_HAVE_ZERO);
if (gvar != NULL) {
bool have_zero = g_variant_get_boolean(gvar);
g_variant_unref(gvar);
if (have_zero) {
_config_button = new QPushButton(tr("Auto Calibration"), this);
inner_layout.addWidget(_config_button, 0, 0, 1, 1);
connect(_config_button, SIGNAL(clicked()), this, SLOT(zero_adj()));
_cali_button = new QPushButton(tr("Manual Calibration"), this);
inner_layout.addWidget(_cali_button, 1, 0, 1, 1);
connect(_cali_button, SIGNAL(clicked()), this, SLOT(on_calibration()));
return tr("Calibration");
}
}
} else if (_dev_inst->dev_inst()->mode == ANALOG) {
analog_probes(inner_layout);
return tr("Channels");
} else {
return tr("Undefined");
}
return NULL;
}
void DeviceOptions::analog_probes(QGridLayout &layout)
......
......@@ -86,6 +86,7 @@ private:
QVBoxLayout _layout;
toolbars::TitleBar *_titlebar;
QGroupBox *_dynamic_box;
QGridLayout _dynamic_layout;
QVector <QLabel *> _probes_label_list;
QVector <QCheckBox *> _probes_checkBox_list;
......
......@@ -57,7 +57,7 @@ FftOptions::FftOptions(QWidget *parent, SigSession &session) :
// setup _ch_combobox
BOOST_FOREACH(const boost::shared_ptr<view::Signal> s, _session.get_signals()) {
boost::shared_ptr<view::DsoSignal> dsoSig;
if (dsoSig = dynamic_pointer_cast<view::DsoSignal>(s)) {
if ((dsoSig = dynamic_pointer_cast<view::DsoSignal>(s))) {
_ch_combobox->addItem(dsoSig->get_name(), qVariantFromValue(dsoSig->get_index()));
}
}
......@@ -77,7 +77,7 @@ FftOptions::FftOptions(QWidget *parent, SigSession &session) :
std::vector<int> dbv_ranges;
BOOST_FOREACH(const boost::shared_ptr<view::Trace> t, _session.get_math_signals()) {
boost::shared_ptr<view::MathTrace> mathTrace;
if (mathTrace = dynamic_pointer_cast<view::MathTrace>(t)) {
if ((mathTrace = dynamic_pointer_cast<view::MathTrace>(t))) {
windows = mathTrace->get_math_stack()->get_windows_support();
length = mathTrace->get_math_stack()->get_length_support();
view_modes = mathTrace->get_view_modes_support();
......@@ -127,7 +127,7 @@ FftOptions::FftOptions(QWidget *parent, SigSession &session) :
// load current settings
BOOST_FOREACH(const boost::shared_ptr<view::Trace> t, _session.get_math_signals()) {
boost::shared_ptr<view::MathTrace> mathTrace;
if (mathTrace = dynamic_pointer_cast<view::MathTrace>(t)) {
if ((mathTrace = dynamic_pointer_cast<view::MathTrace>(t))) {
if (mathTrace->enabled()) {
_en_checkbox->setChecked(true);
for (int i = 0; i < _ch_combobox->count(); i++) {
......@@ -216,7 +216,7 @@ void FftOptions::accept()
BOOST_FOREACH(const boost::shared_ptr<view::Trace> t, _session.get_math_signals()) {
boost::shared_ptr<view::MathTrace> mathTrace;
if (mathTrace = dynamic_pointer_cast<view::MathTrace>(t)) {
if ((mathTrace = dynamic_pointer_cast<view::MathTrace>(t))) {
mathTrace->set_enable(false);
if (mathTrace->get_index() == _ch_combobox->currentData().toInt()) {
mathTrace->get_math_stack()->set_dc_ignore(_dc_checkbox->isChecked());
......
......@@ -54,7 +54,7 @@ Search::Search(QWidget *parent, SigSession &session, std::map<uint16_t, QString>
_session.get_signals()) {
assert(sig);
boost::shared_ptr<view::LogicSignal> logic_sig;
if (logic_sig = boost::dynamic_pointer_cast<view::LogicSignal>(sig)) {
if ((logic_sig = boost::dynamic_pointer_cast<view::LogicSignal>(sig))) {
QLineEdit *search_lineEdit = new QLineEdit(this);
if (pattern.find(logic_sig->get_index()) != pattern.end())
search_lineEdit->setText(pattern[logic_sig->get_index()]);
......@@ -115,7 +115,7 @@ std::map<uint16_t, QString> Search::get_pattern()
_session.get_signals()) {
assert(sig);
boost::shared_ptr<view::LogicSignal> logic_sig;
if (logic_sig = boost::dynamic_pointer_cast<view::LogicSignal>(sig)) {
if ((logic_sig = boost::dynamic_pointer_cast<view::LogicSignal>(sig))) {
pattern[logic_sig->get_index()] = _search_lineEdit_vec[index]->text();
index++;
}
......
......@@ -356,7 +356,7 @@ void DsoTriggerDock::init()
channel_comboBox->clear();
BOOST_FOREACH(const boost::shared_ptr<view::Signal> s, _session.get_signals()) {
boost::shared_ptr<view::DsoSignal> dsoSig;
if (dsoSig = dynamic_pointer_cast<view::DsoSignal>(s)) {
if ((dsoSig = dynamic_pointer_cast<view::DsoSignal>(s))) {
channel_comboBox->addItem(dsoSig->get_name(), qVariantFromValue(dsoSig->get_index()));
}
}
......
......@@ -254,6 +254,7 @@ void MeasureDock::cursor_moving()
void MeasureDock::reCalc()
{
cursor_update();
update_dist();
update_edge();
}
......
......@@ -22,6 +22,8 @@
#include "mainframe.h"
#include "toolbars/titlebar.h"
#include "dialogs/dsmessagebox.h"
#include "dialogs/dsdialog.h"
#include "mainwindow.h"
#include <QVBoxLayout>
......@@ -30,9 +32,14 @@
#include <QHoverEvent>
#include <QPixmap>
#include <QPainter>
#include <QLabel>
#include <QDialogButtonBox>
#include <QBitmap>
#include <QResizeEvent>
#include <QDesktopWidget>
#include <QDesktopServices>
#include <QPushButton>
#include <QMessageBox>
#include <QApplication>
#include <algorithm>
......@@ -357,8 +364,8 @@ void MainFrame::readSettings()
QSettings settings;
QDesktopWidget* desktopWidget = QApplication::desktop();
QRect deskRect = desktopWidget->availableGeometry();
QPoint default_upleft = QPoint((deskRect.width() - minWidth)/2, (deskRect.height() - minHeight)/2);
QSize default_size = QSize(minWidth, minHeight);
QPoint default_upleft = QPoint((deskRect.width() - defWidth)/2, (deskRect.height() - defHeight)/2);
QSize default_size = QSize(defWidth, defHeight);
settings.beginGroup("MainFrame");
bool isMax = settings.value("isMax", false).toBool();
......@@ -386,4 +393,47 @@ void MainFrame::readSettings()
}
}
void MainFrame::setTaskbarProgress(int progress)
{
(void)progress;
}
void MainFrame::show_doc()
{
const QString DOC_KEY("ShowDocuments");
QSettings settings;
if (!settings.contains(DOC_KEY)) {
dialogs::DSDialog dlg(this);
dlg.setTitle(tr("Document"));
QLabel tipsLabel;
tipsLabel.setPixmap(QPixmap(":/icons/showDoc.png"));
QMessageBox msg;
msg.setWindowFlags(Qt::Dialog | Qt::FramelessWindowHint | Qt::WindowSystemMenuHint);
msg.setContentsMargins(0, 0, 0, 0);
connect(&msg, SIGNAL(buttonClicked(QAbstractButton*)), &dlg, SLOT(accept()));
QPushButton *noMoreButton = msg.addButton(tr("Not Show Again"), QMessageBox::ActionRole);
msg.addButton(tr("Ignore"), QMessageBox::ActionRole);
QPushButton *openButton = msg.addButton(tr("Open"), QMessageBox::ActionRole);
QVBoxLayout layout;
layout.addWidget(&tipsLabel);
layout.addWidget(&msg, 0, Qt::AlignRight);
layout.setContentsMargins(0, 0, 0, 0);
dlg.layout()->addLayout(&layout);
dlg.exec();
if (msg.clickedButton() == openButton) {
QDir dir(DS_RES_PATH);
dir.cdUp();
QDesktopServices::openUrl(
QUrl("file:///"+dir.absolutePath() + "/ug.pdf"));
}
if (msg.clickedButton() == noMoreButton)
settings.setValue(DOC_KEY, false);
}
}
} // namespace pv
......@@ -38,12 +38,19 @@ namespace toolbars {
class TitleBar;
}
namespace dialogs {
class DSMessageBox;
class DSDialog;
}
class MainFrame : public QFrame
{
Q_OBJECT
public:
static const int minWidth = 800;
static const int minHeight = 680;
static const int minWidth = 600;
static const int minHeight = 500;
static const int defWidth = 900;
static const int defHeight = 680;
public:
static const int Margin = 5;
......@@ -77,6 +84,8 @@ public slots:
void showNormal();
void showMaximized();
void showMinimized();
void show_doc();
void setTaskbarProgress(int progress);
private:
void hide_border();
......
This diff is collapsed.
......@@ -47,7 +47,7 @@ DeviceOptions::DeviceOptions(struct sr_dev_inst *sdi) :
GVariant *gvar_opts, *gvar_list;
gsize num_opts;
if ((sr_config_list(sdi->driver, sdi, NULL, SR_CONF_DEVICE_CONFIGS,
if ((sr_config_list(sdi->driver, sdi, NULL, SR_CONF_DEVICE_OPTIONS,
&gvar_opts) != SR_OK))
/* Driver supports no device instance options. */
return;
......@@ -109,7 +109,6 @@ DeviceOptions::DeviceOptions(struct sr_dev_inst *sdi) :
case SR_CONF_CLOCK_TYPE:
case SR_CONF_CLOCK_EDGE:
case SR_CONF_INSTANT:
case SR_CONF_DATALOCK:
bind_bool(name, key);
break;
......
......@@ -215,11 +215,11 @@ QString ProbeOptions::print_gvariant(GVariant *const gvar)
QString ProbeOptions::print_vdiv(GVariant *const gvar)
{
uint64_t p, q;
uint64_t p, q;
g_variant_get(gvar, "t", &p);
if (p < 1000ULL) {
q = 1000;
} else if (p < 1000000ULL) {
} else {
q = 1;
p /= 1000;
}
......
......@@ -172,11 +172,10 @@ void SigSession::set_device(boost::shared_ptr<device::DevInst> dev_inst) throw(Q
_cur_samplerate = _dev_inst->get_sample_rate();
_cur_samplelimits = _dev_inst->get_sample_limit();
// if (_dev_inst->dev_inst()->mode == DSO)
// set_run_mode(Repetitive);
// else
// set_run_mode(Single);
set_run_mode(Single);
if (_dev_inst->dev_inst()->mode == DSO)
set_run_mode(Repetitive);
else
set_run_mode(Single);
} catch(const QString e) {
throw(e);
return;
......@@ -289,6 +288,8 @@ void SigSession::set_cur_samplerate(uint64_t samplerate)
// MathStack
BOOST_FOREACH(const boost::shared_ptr<view::MathTrace> m, _math_traces)
m->get_math_stack()->set_samplerate(_cur_samplerate);
cur_samplerate_changed();
}
void SigSession::set_cur_samplelimits(uint64_t samplelimits)
......@@ -302,8 +303,12 @@ void SigSession::capture_init()
{
if (!_instant)
set_repeating(get_run_mode() == Repetitive);
_cur_samplerate = _dev_inst->get_sample_rate();
_cur_samplelimits = _dev_inst->get_sample_limit();
// update instant setting
_dev_inst->set_config(NULL, NULL, SR_CONF_INSTANT, g_variant_new_boolean(_instant));
update_capture();
set_cur_samplerate(_dev_inst->get_sample_rate());
set_cur_samplelimits(_dev_inst->get_sample_limit());
_data_updated = false;
_trigger_flag = false;
_hw_replied = false;
......@@ -314,62 +319,58 @@ void SigSession::capture_init()
_noData_cnt = 0;
data_unlock();
// Init and Set sample rate for all SignalData
// Analog/Dso
if (_analog_data) {
_analog_data->init();
_analog_data->set_samplerate(_cur_samplerate);
}
if (_dso_data) {
_dso_data->init();
_dso_data->set_samplerate(_cur_samplerate);
}
// MathStack
BOOST_FOREACH(const boost::shared_ptr<view::MathTrace> m, _math_traces)
{
assert(m);
m->get_math_stack()->init();
m->get_math_stack()->set_samplerate(_cur_samplerate);
}
// container init
container_init();
// update current hw offset
BOOST_FOREACH(const boost::shared_ptr<view::Signal> s, _signals)
{
assert(s);
boost::shared_ptr<view::DsoSignal> dsoSig;
if (dsoSig = dynamic_pointer_cast<view::DsoSignal>(s)) {
if ((dsoSig = dynamic_pointer_cast<view::DsoSignal>(s))) {
dsoSig->set_zero_vrate(dsoSig->get_zero_vrate(), true);
}
boost::shared_ptr<view::AnalogSignal> analogSig;
if (analogSig = dynamic_pointer_cast<view::AnalogSignal>(s)) {
if ((analogSig = dynamic_pointer_cast<view::AnalogSignal>(s))) {
analogSig->set_zero_vrate(analogSig->get_zero_vrate(), true);
}
}
}
void SigSession::logic_init()
void SigSession::container_init()
{
// Logic
if (_logic_data) {
if (_logic_data)
_logic_data->init();
_logic_data->set_samplerate(_cur_samplerate);
}
// Group
if (_group_data) {
if (_group_data)
_group_data->init();
_group_data->set_samplerate(_cur_samplerate);
// Dso
if (_analog_data)
_analog_data->init();
// Analog
if (_dso_data)
_dso_data->init();
// MathStack
BOOST_FOREACH(const boost::shared_ptr<view::MathTrace> m, _math_traces)
{
assert(m);
m->get_math_stack()->init();
}
#ifdef ENABLE_DECODE
// DecoderModel
pv::data::DecoderModel *decoder_model = get_decoder_model();
decoder_model->setDecoderStack(NULL);
//pv::data::DecoderModel *decoder_model = get_decoder_model();
//decoder_model->setDecoderStack(NULL);
// DecoderStack
BOOST_FOREACH(const boost::shared_ptr<view::DecodeTrace> d, _decode_traces)
{
assert(d);
d->decoder()->init();
d->decoder()->set_samplerate(_cur_samplerate);
}
#endif
}
......@@ -426,7 +427,7 @@ void SigSession::start_capture(bool instant,
void SigSession::stop_capture()
{
_instant = false;
data_unlock();
#ifdef ENABLE_DECODE
for (vector< boost::shared_ptr<view::DecodeTrace> >::iterator i =
_decode_traces.begin();
......@@ -533,6 +534,7 @@ void SigSession::sample_thread_proc(boost::shared_ptr<device::DevInst> dev_inst,
void SigSession::check_update()
{
data_unlock();
if (_capture_state != Running)
return;
......@@ -540,6 +542,7 @@ void SigSession::check_update()
data_updated();
_data_updated = false;
_noData_cnt = 0;
data_auto_unlock();
} else {
if (++_noData_cnt >= (WaitShowTime/ViewTime))
nodata_timeout();
......@@ -737,7 +740,7 @@ void SigSession::reload()
while (i != _signals.end()) {
if ((*i)->get_index() == probe->index) {
boost::shared_ptr<view::LogicSignal> logicSig;
if (logicSig = dynamic_pointer_cast<view::LogicSignal>(*i))
if ((logicSig = dynamic_pointer_cast<view::LogicSignal>(*i)))
signal = boost::shared_ptr<view::Signal>(
new view::LogicSignal(logicSig, _logic_data, probe));
break;
......@@ -761,7 +764,7 @@ void SigSession::reload()
while (i != _signals.end()) {
if ((*i)->get_index() == probe->index) {
boost::shared_ptr<view::AnalogSignal> analogSig;
if (analogSig = dynamic_pointer_cast<view::AnalogSignal>(*i))
if ((analogSig = dynamic_pointer_cast<view::AnalogSignal>(*i)))
signal = boost::shared_ptr<view::Signal>(
new view::AnalogSignal(analogSig, _analog_data, probe));
break;
......@@ -792,7 +795,7 @@ void SigSession::refresh(int holdtime)
{
boost::lock_guard<boost::mutex> lock(_data_mutex);
_data_lock = true;
data_lock();
QTimer::singleShot(holdtime, this, SLOT(data_unlock()));
if (_logic_data) {
......@@ -823,6 +826,11 @@ void SigSession::refresh(int holdtime)
_data_updated = true;
}
void SigSession::data_lock()
{
_data_lock = true;
}
void SigSession::data_unlock()
{
_data_lock = false;
......@@ -833,6 +841,21 @@ bool SigSession::get_data_lock()
return _data_lock;
}
void SigSession::data_auto_lock(int lock) {
_data_auto_lock = lock;
}
void SigSession::data_auto_unlock() {
if (_data_auto_lock > 0)
_data_auto_lock--;
else if (_data_auto_lock < 0)
_data_auto_lock = 0;
}
bool SigSession::get_data_auto_lock() {
return _data_auto_lock != 0;
}
void SigSession::feed_in_header(const sr_dev_inst *sdi)
{
(void)sdi;
......@@ -920,7 +943,6 @@ void SigSession::feed_in_logic(const sr_datafeed_logic &logic)
}
if (_cur_logic_snapshot->last_ended()) {
logic_init();
_cur_logic_snapshot->first_payload(logic, _dev_inst->get_sample_limit(), _dev_inst->dev_inst()->channels);
// @todo Putting this here means that only listeners querying
// for logic will be notified. Currently the only user of
......@@ -962,7 +984,7 @@ void SigSession::feed_in_dso(const sr_datafeed_dso &dso)
{
assert(s);
boost::shared_ptr<view::DsoSignal> dsoSig;
if (dsoSig = dynamic_pointer_cast<view::DsoSignal>(s)) {
if ((dsoSig = dynamic_pointer_cast<view::DsoSignal>(s))) {
dsoSig->set_scale(dsoSig->get_view_rect().height());
sig_enable[dsoSig->get_index()] = dsoSig->enabled();
}
......@@ -991,6 +1013,8 @@ void SigSession::feed_in_dso(const sr_datafeed_dso &dso)
_trigger_flag = dso.trig_flag;
receive_data(dso.num_samples);
//data_updated();
if (!_instant)
data_lock();
_data_updated = true;
}
......@@ -1032,7 +1056,7 @@ void SigSession::data_feed_in(const struct sr_dev_inst *sdi,
boost::lock_guard<boost::mutex> lock(_data_mutex);
if (_data_lock)
if (_data_lock && packet->type != SR_DF_END)
return;
if (packet->type != SR_DF_END &&
packet->status != SR_PKT_OK) {
......@@ -1095,10 +1119,7 @@ void SigSession::data_feed_in(const struct sr_dev_inst *sdi,
_cur_group_snapshot.reset();
}
}
if (!_cur_logic_snapshot->last_ended())
_cur_logic_snapshot->capture_ended();
else if (get_run_mode() != SigSession::Repetitive)
logic_init();
_cur_logic_snapshot->capture_ended();
_cur_dso_snapshot->capture_ended();
_cur_analog_snapshot->capture_ended();
#ifdef ENABLE_DECODE
......@@ -1405,7 +1426,7 @@ void SigSession::mathTraces_rebuild()
bool has_dso_signal = false;
BOOST_FOREACH(const boost::shared_ptr<view::Signal> s, _signals) {
boost::shared_ptr<view::DsoSignal> dsoSig;
if (dsoSig = dynamic_pointer_cast<view::DsoSignal>(s)) {
if ((dsoSig = dynamic_pointer_cast<view::DsoSignal>(s))) {
has_dso_signal = true;