From a838d09fbd8655004e69dd9a353671d390921be8 Mon Sep 17 00:00:00 2001 From: Srivats P Date: Sat, 10 Dec 2016 13:40:28 +0530 Subject: [PATCH] sign: Inform user when stream stats is not enabled If Sign protocol is configured without enabling stream statistics on port, inform user that stream statistics will not be available till it is enabled on port --- client/streamconfigdialog.cpp | 7 +++++++ common/streambase.cpp | 9 +++++++++ common/streambase.h | 1 + 3 files changed, 17 insertions(+) diff --git a/client/streamconfigdialog.cpp b/client/streamconfigdialog.cpp index af35fea..1dee6f9 100644 --- a/client/streamconfigdialog.cpp +++ b/client/streamconfigdialog.cpp @@ -1240,6 +1240,13 @@ void StreamConfigDialog::on_pbOk_clicked() "varying fields at transmit time may not be same as configured\n"; } + if (!mPort.trackStreamStats() + && mpStream->hasProtocol(OstProto::Protocol::kSignFieldNumber)) + { + log += "Stream contains special signature, but per stream statistics " + "will not be available till it is enabled on the port.\n"; + } + mpStream->preflightCheck(log); if (log.length()) diff --git a/common/streambase.cpp b/common/streambase.cpp index 56d6d4a..28a9442 100644 --- a/common/streambase.cpp +++ b/common/streambase.cpp @@ -140,6 +140,15 @@ void StreamBase::setFrameProtocol(ProtocolList protocolList) } #endif +bool StreamBase::hasProtocol(quint32 protocolNumber) +{ + foreach(const AbstractProtocol *proto, *currentFrameProtocols) + if (proto->protocolNumber() == protocolNumber) + return true; + + return false; +} + ProtocolListIterator* StreamBase::createProtocolListIterator() const { return new ProtocolListIterator(*currentFrameProtocols); diff --git a/common/streambase.h b/common/streambase.h index ca6e6be..907fc8d 100644 --- a/common/streambase.h +++ b/common/streambase.h @@ -40,6 +40,7 @@ public: void protoDataCopyFrom(const OstProto::Stream &stream); void protoDataCopyInto(OstProto::Stream &stream) const; + bool hasProtocol(quint32 protocolNumber); ProtocolListIterator* createProtocolListIterator() const; //! \todo (LOW) should we have a copy constructor??