From 10736a198f47530dbd36484dc122ca2879180efa Mon Sep 17 00:00:00 2001 From: dreamsourcelabTAI Date: Wed, 11 May 2022 11:34:32 +0800 Subject: [PATCH] update: deocder output data format ui --- DSView/pv/data/decode/decoderstatus.cpp | 3 ++- DSView/pv/data/decode/decoderstatus.h | 2 +- DSView/pv/data/decoderstack.cpp | 2 +- DSView/pv/dock/protocoldock.cpp | 5 +++++ DSView/pv/dock/protocolitemlayer.cpp | 11 ++++++++--- DSView/pv/dock/protocolitemlayer.h | 2 ++ DSView/pv/view/groupsignal.cpp | 3 +-- DSView/pv/view/ruler.cpp | 3 ++- DSView/pv/view/view.cpp | 2 +- 9 files changed, 23 insertions(+), 10 deletions(-) diff --git a/DSView/pv/data/decode/decoderstatus.cpp b/DSView/pv/data/decode/decoderstatus.cpp index 8dfc74c5..ea2c45bd 100644 --- a/DSView/pv/data/decode/decoderstatus.cpp +++ b/DSView/pv/data/decode/decoderstatus.cpp @@ -31,4 +31,5 @@ DecoderStatus::DecoderStatus() void DecoderStatus::clear() { m_resTable.reset(); -} + m_bNumeric = false; +} diff --git a/DSView/pv/data/decode/decoderstatus.h b/DSView/pv/data/decode/decoderstatus.h index cdc2252a..bf09d81d 100644 --- a/DSView/pv/data/decode/decoderstatus.h +++ b/DSView/pv/data/decode/decoderstatus.h @@ -28,7 +28,7 @@ class DecoderStatus public: DecoderStatus(); - void clear(); + void clear(); public: bool m_bNumeric; //when decoder get any numerical data,it will be set diff --git a/DSView/pv/data/decoderstack.cpp b/DSView/pv/data/decoderstack.cpp index 9964b117..8a255ddc 100755 --- a/DSView/pv/data/decoderstack.cpp +++ b/DSView/pv/data/decoderstack.cpp @@ -398,7 +398,7 @@ void DecoderStack::begin_decode_work() assert(_decode_state == Stopped); _error_message = ""; - _decode_state = Running; + _decode_state = Running; do_decode_work(); _decode_state = Stopped; } diff --git a/DSView/pv/dock/protocoldock.cpp b/DSView/pv/dock/protocoldock.cpp index 03ca54ab..8ce2ce0f 100755 --- a/DSView/pv/dock/protocoldock.cpp +++ b/DSView/pv/dock/protocoldock.cpp @@ -484,6 +484,11 @@ void ProtocolDock::decoded_progress(int progress) { ProtocolItemLayer &lay = *(_protocol_lay_items.at(index)); lay.SetProgress(pg, err); + + // have custom data format + if (progress == 100 && lay.m_decoderStatus != NULL){ + lay.enable_format(lay.m_decoderStatus->m_bNumeric); + } } index++; diff --git a/DSView/pv/dock/protocolitemlayer.cpp b/DSView/pv/dock/protocolitemlayer.cpp index b7600d98..033554c8 100644 --- a/DSView/pv/dock/protocolitemlayer.cpp +++ b/DSView/pv/dock/protocolitemlayer.cpp @@ -62,10 +62,10 @@ ProtocolItemLayer::ProtocolItemLayer(QWidget *parent, QString protocolName, IPro hori_layout->addStretch(1); - connect(_del_button, SIGNAL(clicked()),this, SLOT(on_del_protocol())); - - connect(_set_button, SIGNAL(clicked()),this, SLOT(on_set_protocol())); + enable_format(false); + connect(_del_button, SIGNAL(clicked()),this, SLOT(on_del_protocol())); + connect(_set_button, SIGNAL(clicked()),this, SLOT(on_set_protocol())); connect(_format_combox, SIGNAL(currentIndexChanged(int)),this, SLOT(on_format_select_changed(int))); } @@ -146,5 +146,10 @@ void ProtocolItemLayer::LoadFormatSelect(bool bSingle) m_bSetting = false; } + void ProtocolItemLayer::enable_format(bool flag) + { + _format_combox->setDisabled(!flag); + } + } //dock } //pv diff --git a/DSView/pv/dock/protocolitemlayer.h b/DSView/pv/dock/protocolitemlayer.h index cd0bff9c..1c6bd32d 100644 --- a/DSView/pv/dock/protocolitemlayer.h +++ b/DSView/pv/dock/protocolitemlayer.h @@ -57,6 +57,8 @@ public: inline void* get_protocol_key_handel(){ return m_decoderStatus; } + + void enable_format(bool flag); private slots: void on_set_protocol(); diff --git a/DSView/pv/view/groupsignal.cpp b/DSView/pv/view/groupsignal.cpp index b8f9555c..caa6bf38 100755 --- a/DSView/pv/view/groupsignal.cpp +++ b/DSView/pv/view/groupsignal.cpp @@ -24,8 +24,7 @@ #include "../data/group.h" #include "../data/groupsnapshot.h" #include "view.h" - -#include +#include using namespace std; diff --git a/DSView/pv/view/ruler.cpp b/DSView/pv/view/ruler.cpp index 612c56ed..3ba947d3 100755 --- a/DSView/pv/view/ruler.cpp +++ b/DSView/pv/view/ruler.cpp @@ -33,10 +33,11 @@ #include #include #include +#include #include #include -#include +#include using namespace std; diff --git a/DSView/pv/view/view.cpp b/DSView/pv/view/view.cpp index 9c9b0f94..82d063f1 100755 --- a/DSView/pv/view/view.cpp +++ b/DSView/pv/view/view.cpp @@ -22,7 +22,7 @@ #include #include -#include +#include #include #include