From 23f3310b22b57f74a12d530396c08748fa1aea07 Mon Sep 17 00:00:00 2001 From: dreamsourcelabTAI Date: Thu, 16 Jun 2022 17:52:45 +0800 Subject: [PATCH] fix: load file popups an error dialog about trigger support --- DSView/pv/device/devinst.cpp | 1 + DSView/pv/device/devinst.h | 9 ++++++--- DSView/pv/device/inputfile.cpp | 1 + DSView/pv/device/sessionfile.cpp | 1 + DSView/pv/dock/triggerdock.cpp | 3 ++- 5 files changed, 11 insertions(+), 4 deletions(-) diff --git a/DSView/pv/device/devinst.cpp b/DSView/pv/device/devinst.cpp index 92c4894f..28414b8c 100755 --- a/DSView/pv/device/devinst.cpp +++ b/DSView/pv/device/devinst.cpp @@ -35,6 +35,7 @@ DevInst::DevInst() : _usable(true) { _id = malloc(1); + _is_file = false; } DevInst::~DevInst() diff --git a/DSView/pv/device/devinst.h b/DSView/pv/device/devinst.h index 641b088f..c0f235a0 100755 --- a/DSView/pv/device/devinst.h +++ b/DSView/pv/device/devinst.h @@ -105,13 +105,15 @@ public: * * @return device name */ - QString name(); - + QString name(); bool is_usable(); - void destroy(); + inline bool is_file(){ + return _is_file; + } + public: virtual void start(); @@ -139,6 +141,7 @@ protected: SigSession *_owner; void *_id; bool _usable; + bool _is_file; }; } // device diff --git a/DSView/pv/device/inputfile.cpp b/DSView/pv/device/inputfile.cpp index 83ed6995..3cb91f87 100755 --- a/DSView/pv/device/inputfile.cpp +++ b/DSView/pv/device/inputfile.cpp @@ -35,6 +35,7 @@ InputFile::InputFile(QString path) : File(path), _input(NULL) { + _is_file = true; } sr_dev_inst* InputFile::dev_inst() diff --git a/DSView/pv/device/sessionfile.cpp b/DSView/pv/device/sessionfile.cpp index 1d5ae1db..ff661e92 100755 --- a/DSView/pv/device/sessionfile.cpp +++ b/DSView/pv/device/sessionfile.cpp @@ -29,6 +29,7 @@ SessionFile::SessionFile(QString path) : File(path) { _sdi = NULL; + _is_file = true; } sr_dev_inst* SessionFile::dev_inst() diff --git a/DSView/pv/dock/triggerdock.cpp b/DSView/pv/dock/triggerdock.cpp index cf09043c..d2cc4c24 100755 --- a/DSView/pv/dock/triggerdock.cpp +++ b/DSView/pv/dock/triggerdock.cpp @@ -200,7 +200,8 @@ void TriggerDock::adv_trigger() } else { widget_enable(0); } - } else { + } + else if (_session->get_device()->is_file() == false){ dialogs::DSMessageBox msg(this); msg.mBox()->setText(tr("Trigger")); msg.mBox()->setInformativeText(tr("Advanced Trigger need DSLogic Hardware Support!"));