本文整理汇总了C++中DVBChannel::GetSNR方法的典型用法代码示例。如果您正苦于以下问题:C++ DVBChannel::GetSNR方法的具体用法?C++ DVBChannel::GetSNR怎么用?C++ DVBChannel::GetSNR使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DVBChannel
的用法示例。
在下文中一共展示了DVBChannel::GetSNR方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: UpdateValues
/** \fn DVBSignalMonitor::UpdateValues()
* \brief Fills in frontend stats and emits status Qt signals.
*
* This is automatically called by MonitorLoop(), after Start()
* has been used to start the signal monitoring thread.
*/
void DVBSignalMonitor::UpdateValues(void)
{
if (!running || exit)
return;
if (streamHandlerStarted)
{
if (!streamHandler->IsRunning())
{
error = QObject::tr("Error: stream handler died");
update_done = true;
return;
}
EmitStatus();
if (IsAllGood())
SendMessageAllGood();
// TODO dtv signals...
update_done = true;
return;
}
AddFlags(kSigMon_WaitForSig);
DVBChannel *dvbchannel = GetDVBChannel();
if (!dvbchannel)
return;
// Handle retuning after rotor has turned
if (HasFlags(SignalMonitor::kDVBSigMon_WaitForPos))
{
if (dvbchannel->GetRotor())
{
if (!streamHandler->IsRetuneAllowed())
streamHandler->SetRetuneAllowed(true, this, dvbchannel);
streamHandler->RetuneMonitor();
}
else
RemoveFlags(SignalMonitor::kDVBSigMon_WaitForPos);
}
bool wasLocked = false, isLocked = false;
uint sig = 0, snr = 0, ber = 0, ublocks = 0;
// Get info from card
bool has_lock = dvbchannel->HasLock();
if (HasFlags(kSigMon_WaitForSig))
sig = (uint) (dvbchannel->GetSignalStrength() * 65535);
if (HasFlags(kDVBSigMon_WaitForSNR))
snr = (uint) (dvbchannel->GetSNR() * 65535);
if (HasFlags(kDVBSigMon_WaitForBER))
ber = (uint) dvbchannel->GetBitErrorRate();
if (HasFlags(kDVBSigMon_WaitForUB))
ublocks = (uint) dvbchannel->GetUncorrectedBlockCount();
has_lock |= streamHandler->IsRunning();
// Set SignalMonitorValues from info from card.
{
QMutexLocker locker(&statusLock);
// BER and UB are actually uint32 values, but we
// clamp them at 64K. This is because these values
// are acutally cumulative, but we don't try to
// normalize these to a time period.
wasLocked = signalLock.IsGood();
signalLock.SetValue((has_lock) ? 1 : 0);
isLocked = signalLock.IsGood();
if (HasFlags(kSigMon_WaitForSig))
signalStrength.SetValue(sig);
if (HasFlags(kDVBSigMon_WaitForSNR))
signalToNoise.SetValue(snr);
if (HasFlags(kDVBSigMon_WaitForBER))
bitErrorRate.SetValue(ber);
if (HasFlags(kDVBSigMon_WaitForUB))
uncorrectedBlocks.SetValue(ublocks);
}
// Debug output
if (wasLocked != isLocked)
{
VERBOSE(VB_CHANNEL, LOC + "UpdateValues -- Signal "
<<(isLocked ? "Locked" : "Lost"));
}
EmitStatus();
if (IsAllGood())
SendMessageAllGood();
// Start table monitoring if we are waiting on any table
//.........这里部分代码省略.........