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
This commit is contained in:
Srivats P 2016-12-10 13:40:28 +05:30
parent ac1356ed53
commit a838d09fbd
3 changed files with 17 additions and 0 deletions

View File

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

View File

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

View File

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