diff --git a/DSView/pv/dock/triggerdock.cpp b/DSView/pv/dock/triggerdock.cpp index 832cec71..2c495d92 100644 --- a/DSView/pv/dock/triggerdock.cpp +++ b/DSView/pv/dock/triggerdock.cpp @@ -186,16 +186,11 @@ void TriggerDock::retranslateUi() } void TriggerDock::reStyle() -{ - +{ } void TriggerDock::paintEvent(QPaintEvent *) { -// QStyleOption opt; -// opt.init(this); -// QPainter p(this); -// style()->drawPrimitive(QStyle::PE_Widget, &opt, &p, this); } void TriggerDock::simple_trigger() @@ -310,6 +305,8 @@ void TriggerDock::device_updated() retranslateUi(); } } + + this->setEnabled(_session->is_loop_mode() == false); } bool TriggerDock::commit_trigger() @@ -581,7 +578,6 @@ void TriggerDock::setup_adv_tab() _stage_tabWidget = new QTabWidget(_widget); _stage_tabWidget->setTabPosition(QTabWidget::East); - //_stage_tabWidget->setDisabled(true); _stage_tabWidget->setUsesScrollButtons(false); const QString mask = "N N N N N N N N N N N N N N N N"; diff --git a/DSView/pv/mainwindow.cpp b/DSView/pv/mainwindow.cpp index effad38c..8f20469b 100644 --- a/DSView/pv/mainwindow.cpp +++ b/DSView/pv/mainwindow.cpp @@ -2039,6 +2039,10 @@ namespace pv if(_device_agent->is_demo()){ _pattern_mode = _device_agent->get_demo_operation_mode(); } + if (msg == DSV_MSG_COLLECT_MODE_CHANGED){ + _trigger_widget->device_updated(); + _view->update(); + } break; case DSV_MSG_END_DEVICE_OPTIONS: diff --git a/DSView/pv/sigsession.cpp b/DSView/pv/sigsession.cpp index 28b31863..c2935bb9 100644 --- a/DSView/pv/sigsession.cpp +++ b/DSView/pv/sigsession.cpp @@ -216,9 +216,7 @@ namespace pv assert(_callback); ds_device_handle old_dev = _device_agent.handle(); - - set_collect_mode(COLLECT_SINGLE); - + _callback->trigger_message(DSV_MSG_CURRENT_DEVICE_CHANGE_PREV); // Release the old device. @@ -234,6 +232,8 @@ namespace pv _device_agent.update(); + set_collect_mode(COLLECT_SINGLE); + if (_device_agent.is_file()){ std::string dev_name = pv::path::ToUnicodePath(_device_agent.name()); dsv_info("Switch to file \"%s\" done.", dev_name.c_str()); diff --git a/DSView/pv/view/logicsignal.cpp b/DSView/pv/view/logicsignal.cpp index 06438bf2..d027159b 100644 --- a/DSView/pv/view/logicsignal.cpp +++ b/DSView/pv/view/logicsignal.cpp @@ -223,21 +223,31 @@ void LogicSignal::paint_type_options(QPainter &p, int right, const QPoint pt, QC const QRectF edgeTrig_rect = get_rect(EDGTRIG, y, right); p.setPen(Qt::NoPen); - p.setBrush(posTrig_rect.contains(pt) ? View::Blue.lighter() : - (_trig == POSTRIG) ? View::Blue : Qt::transparent); - p.drawRect(posTrig_rect); - p.setBrush(higTrig_rect.contains(pt) ? View::Blue.lighter() : - (_trig == HIGTRIG) ? View::Blue : Qt::transparent); - p.drawRect(higTrig_rect); - p.setBrush(negTrig_rect.contains(pt) ? View::Blue.lighter() : - (_trig == NEGTRIG) ? View::Blue : Qt::transparent); - p.drawRect(negTrig_rect); - p.setBrush(lowTrig_rect.contains(pt) ? View::Blue.lighter() : - (_trig == LOWTRIG) ? View::Blue : Qt::transparent); - p.drawRect(lowTrig_rect); - p.setBrush(edgeTrig_rect.contains(pt) ? View::Blue.lighter() : - (_trig == EDGTRIG) ? View::Blue : Qt::transparent); - p.drawRect(edgeTrig_rect); + + if (true) + { + QColor color = View::Blue; + + if (session->is_loop_mode()){ + color = QColor(0x70, 0x70, 0x70, 255); + } + + p.setBrush(posTrig_rect.contains(pt) ? color.lighter() : + (_trig == POSTRIG) ? color : Qt::transparent); + p.drawRect(posTrig_rect); + p.setBrush(higTrig_rect.contains(pt) ? color.lighter() : + (_trig == HIGTRIG) ? color : Qt::transparent); + p.drawRect(higTrig_rect); + p.setBrush(negTrig_rect.contains(pt) ? color.lighter() : + (_trig == NEGTRIG) ? color : Qt::transparent); + p.drawRect(negTrig_rect); + p.setBrush(lowTrig_rect.contains(pt) ? color.lighter() : + (_trig == LOWTRIG) ? color : Qt::transparent); + p.drawRect(lowTrig_rect); + p.setBrush(edgeTrig_rect.contains(pt) ? color.lighter() : + (_trig == EDGTRIG) ? color : Qt::transparent); + p.drawRect(edgeTrig_rect); + } p.setPen(QPen(fore, 1, Qt::DashLine)); p.setBrush(Qt::transparent); diff --git a/DSView/pv/view/trace.cpp b/DSView/pv/view/trace.cpp index 4efeb966..b9bd648c 100644 --- a/DSView/pv/view/trace.cpp +++ b/DSView/pv/view/trace.cpp @@ -202,6 +202,7 @@ void Trace::paint_label(QPainter &p, int right, const QPoint pt, QColor fore) p.setPen(Qt::transparent); p.setBrush(enabled() ? (_colour.isValid() ? _colour : fore) : foreBack); p.drawRect(color_rect); + if (_type == SR_CHANNEL_DSO || _type == SR_CHANNEL_MATH) { p.setPen(enabled() ? Qt::white: foreBack);