Disable triger on loop mode

This commit is contained in:
dreamsourcelabTAI 2023-06-17 16:36:39 +08:00
parent 45b9aa101e
commit b1ced0c0e4
5 changed files with 36 additions and 25 deletions

View File

@ -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";

View File

@ -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:

View File

@ -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());

View File

@ -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);

View File

@ -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);