MythTV  master
Public Member Functions | Static Public Member Functions | Static Public Attributes | Private Types | Private Member Functions | Private Attributes | List of all members
SignalMonitorValue Class Reference

#include <signalmonitorvalue.h>

Collaboration diagram for SignalMonitorValue:
Collaboration graph
[legend]

Public Member Functions

 SignalMonitorValue (QString _name, QString _noSpaceName, int _threshold, bool _high_threshold, int _min, int _max, std::chrono::milliseconds _timeout)
 
virtual ~SignalMonitorValue ()
 
QString GetName (void) const
 Returns the long name of this value. More...
 
QString GetShortName (void) const
 Returns a space free name of the value. Used by GetStatus(). More...
 
QString GetStatus () const
 Returns a signal monitor value as one long string. More...
 
int GetValue () const
 Returns the value. More...
 
int GetMin () const
 Returns smallest value possible, used for signal monitor bars. More...
 
int GetMax () const
 Returns greatest value possible, used for signal monitor bars. More...
 
int GetThreshold () const
 Returns the threshold at which the value is considered "good". More...
 
bool IsHighThreshold () const
 Returns true if values greater than the threshold are considered good, false otherwise. More...
 
std::chrono::milliseconds GetTimeout () const
 Returns how long to wait for a good value in milliseconds. More...
 
bool IsGood () const
 Returns true if the value is equal to the threshold, or on the right side of the threshold (depends on IsHighThreashold()). More...
 
int GetNormalizedValue (int newmin, int newmax) const
 Returns the value normalized to the [newmin, newmax] range. More...
 
void SetValue (int _value)
 
void SetMin (int _min)
 
void SetMax (int _max)
 
void SetThreshold (int _threshold)
 
void SetThreshold (int _threshold, bool _high_threshold)
 
void SetRange (int _min, int _max)
 Sets the minimum and maximum values. More...
 
void SetTimeout (std::chrono::milliseconds _timeout)
 
QString toString () const
 

Static Public Member Functions

static void Init ()
 Initializes the some static constants needed by SignalMonitorValue. More...
 
static SignalMonitorValueCreate (const QString &_name, const QString &_longString)
 
static SignalMonitorList Parse (const QStringList &slist)
 Converts a list of strings to SignalMonitorValue classes. More...
 
static bool AllGood (const SignalMonitorList &slist)
 Returns true if all the values in the list return true on IsGood(). More...
 
static std::chrono::milliseconds MaxWait (const SignalMonitorList &slist)
 Returns the maximum timeout value in the signal monitor list. More...
 

Static Public Attributes

static QStringList ERROR_NO_CHANNEL
 
static QStringList ERROR_NO_LINK
 
static QStringList SIGNAL_LOCK
 
static bool run_static_init = true
 

Private Types

using SignalMonitorList = std::vector< SignalMonitorValue >
 

Private Member Functions

 SignalMonitorValue ()=default
 
 SignalMonitorValue (QString _name, QString _noSpaceName, int _value, int _threshold, bool _high_threshold, int _min, int _max, std::chrono::milliseconds _timeout, bool _set)
 
bool Set (const QString &_name, const QString &_longString)
 

Private Attributes

QString m_name
 
QString m_noSpaceName
 
int m_value {-1}
 
int m_threshold {-1}
 
int m_minVal {-1}
 
int m_maxVal {-1}
 
std::chrono::milliseconds m_timeout {-1ms}
 
bool m_highThreshold {true}
 
bool m_set {false}
 

Detailed Description

Definition at line 13 of file signalmonitorvalue.h.

Member Typedef Documentation

◆ SignalMonitorList

Definition at line 17 of file signalmonitorvalue.h.

Constructor & Destructor Documentation

◆ SignalMonitorValue() [1/3]

SignalMonitorValue::SignalMonitorValue ( QString  _name,
QString  _noSpaceName,
int  _threshold,
bool  _high_threshold,
int  _min,
int  _max,
std::chrono::milliseconds  _timeout 
)

Definition at line 36 of file signalmonitorvalue.cpp.

◆ ~SignalMonitorValue()

virtual SignalMonitorValue::~SignalMonitorValue ( )
inlinevirtual

Definition at line 22 of file signalmonitorvalue.h.

◆ SignalMonitorValue() [2/3]

SignalMonitorValue::SignalMonitorValue ( )
privatedefault

Referenced by Create().

◆ SignalMonitorValue() [3/3]

SignalMonitorValue::SignalMonitorValue ( QString  _name,
QString  _noSpaceName,
int  _value,
int  _threshold,
bool  _high_threshold,
int  _min,
int  _max,
std::chrono::milliseconds  _timeout,
bool  _set 
)
private

Definition at line 59 of file signalmonitorvalue.cpp.

Member Function Documentation

◆ GetName()

QString SignalMonitorValue::GetName ( void  ) const

Returns the long name of this value.

Definition at line 83 of file signalmonitorvalue.cpp.

Referenced by DTVSignalMonitor::GetStatusList(), DVBSignalMonitor::GetStatusList(), SignalMonitor::GetStatusList(), and Init().

◆ GetShortName()

QString SignalMonitorValue::GetShortName ( void  ) const

Returns a space free name of the value. Used by GetStatus().

Definition at line 91 of file signalmonitorvalue.cpp.

◆ GetStatus()

QString SignalMonitorValue::GetStatus ( ) const
inline

Returns a signal monitor value as one long string.

Definition at line 32 of file signalmonitorvalue.h.

Referenced by DTVSignalMonitor::GetStatusList(), DVBSignalMonitor::GetStatusList(), SignalMonitor::GetStatusList(), and Init().

◆ GetValue()

int SignalMonitorValue::GetValue ( ) const
inline

◆ GetMin()

int SignalMonitorValue::GetMin ( ) const
inline

Returns smallest value possible, used for signal monitor bars.

Definition at line 42 of file signalmonitorvalue.h.

Referenced by GetNormalizedValue().

◆ GetMax()

int SignalMonitorValue::GetMax ( ) const
inline

Returns greatest value possible, used for signal monitor bars.

Definition at line 44 of file signalmonitorvalue.h.

Referenced by GetNormalizedValue().

◆ GetThreshold()

int SignalMonitorValue::GetThreshold ( ) const
inline

Returns the threshold at which the value is considered "good".

See also
IsHighThreshold(), IsGood()

Definition at line 47 of file signalmonitorvalue.h.

◆ IsHighThreshold()

bool SignalMonitorValue::IsHighThreshold ( ) const
inline

Returns true if values greater than the threshold are considered good, false otherwise.

Definition at line 50 of file signalmonitorvalue.h.

◆ GetTimeout()

std::chrono::milliseconds SignalMonitorValue::GetTimeout ( ) const
inline

Returns how long to wait for a good value in milliseconds.

Definition at line 52 of file signalmonitorvalue.h.

◆ IsGood()

bool SignalMonitorValue::IsGood ( ) const
inline

◆ GetNormalizedValue()

int SignalMonitorValue::GetNormalizedValue ( int  newmin,
int  newmax 
) const
inline

Returns the value normalized to the [newmin, newmax] range.

Parameters
newminNew minimum value.
newmaxNew maximum value.

Definition at line 63 of file signalmonitorvalue.h.

Referenced by SignalMonitor::GetSignalStrength(), ScanMonitor::StatusRotorPosition(), ScanMonitor::StatusSignalStrength(), and ScanMonitor::StatusSignalToNoise().

◆ SetValue()

void SignalMonitorValue::SetValue ( int  _value)
inline

◆ SetMin()

void SignalMonitorValue::SetMin ( int  _min)
inline

Definition at line 80 of file signalmonitorvalue.h.

◆ SetMax()

void SignalMonitorValue::SetMax ( int  _max)
inline

Definition at line 82 of file signalmonitorvalue.h.

◆ SetThreshold() [1/2]

void SignalMonitorValue::SetThreshold ( int  _threshold)
inline

◆ SetThreshold() [2/2]

void SignalMonitorValue::SetThreshold ( int  _threshold,
bool  _high_threshold 
)
inline

Definition at line 86 of file signalmonitorvalue.h.

◆ SetRange()

void SignalMonitorValue::SetRange ( int  _min,
int  _max 
)
inline

◆ SetTimeout()

void SignalMonitorValue::SetTimeout ( std::chrono::milliseconds  _timeout)
inline

◆ Init()

void SignalMonitorValue::Init ( )
static

Initializes the some static constants needed by SignalMonitorValue.

This isn't done automatically because we need to translate the messages.

Definition at line 20 of file signalmonitorvalue.cpp.

Referenced by TVRec::SetupSignalMonitor(), and SignalMonitorValue().

◆ Create()

SignalMonitorValue * SignalMonitorValue::Create ( const QString &  _name,
const QString &  _longString 
)
static

Definition at line 138 of file signalmonitorvalue.cpp.

◆ Parse()

SignalMonitorList SignalMonitorValue::Parse ( const QStringList &  slist)
static

Converts a list of strings to SignalMonitorValue classes.

Parameters
slistList of strings to convert.

Definition at line 154 of file signalmonitorvalue.cpp.

Referenced by TV::UpdateOSDSignal().

◆ AllGood()

bool SignalMonitorValue::AllGood ( const SignalMonitorList slist)
static

Returns true if all the values in the list return true on IsGood().

Parameters
slistList of SignalMonitorValue classes to check.

Definition at line 181 of file signalmonitorvalue.cpp.

Referenced by TV::UpdateOSDSignal().

◆ MaxWait()

std::chrono::milliseconds SignalMonitorValue::MaxWait ( const SignalMonitorList slist)
static

Returns the maximum timeout value in the signal monitor list.

Parameters
slistList of SignalMonitorValue classes to check.

Definition at line 210 of file signalmonitorvalue.cpp.

◆ toString()

QString SignalMonitorValue::toString ( ) const
inline

Definition at line 120 of file signalmonitorvalue.h.

◆ Set()

bool SignalMonitorValue::Set ( const QString &  _name,
const QString &  _longString 
)
private

Definition at line 99 of file signalmonitorvalue.cpp.

Referenced by Parse().

Member Data Documentation

◆ ERROR_NO_CHANNEL

QStringList SignalMonitorValue::ERROR_NO_CHANNEL
static

Definition at line 114 of file signalmonitorvalue.h.

Referenced by Init().

◆ ERROR_NO_LINK

QStringList SignalMonitorValue::ERROR_NO_LINK
static

Definition at line 115 of file signalmonitorvalue.h.

Referenced by Init().

◆ SIGNAL_LOCK

QStringList SignalMonitorValue::SIGNAL_LOCK
static

Definition at line 116 of file signalmonitorvalue.h.

Referenced by Init().

◆ run_static_init

bool SignalMonitorValue::run_static_init = true
static

Definition at line 118 of file signalmonitorvalue.h.

Referenced by Init().

◆ m_name

QString SignalMonitorValue::m_name
private

Definition at line 138 of file signalmonitorvalue.h.

Referenced by GetName(), Set(), and SignalMonitorValue().

◆ m_noSpaceName

QString SignalMonitorValue::m_noSpaceName
private

Definition at line 139 of file signalmonitorvalue.h.

Referenced by GetShortName(), GetStatus(), Set(), SignalMonitorValue(), and toString().

◆ m_value

int SignalMonitorValue::m_value {-1}
private

◆ m_threshold

int SignalMonitorValue::m_threshold {-1}
private

◆ m_minVal

int SignalMonitorValue::m_minVal {-1}
private

◆ m_maxVal

int SignalMonitorValue::m_maxVal {-1}
private

◆ m_timeout

std::chrono::milliseconds SignalMonitorValue::m_timeout {-1ms}
private

Definition at line 144 of file signalmonitorvalue.h.

Referenced by GetStatus(), GetTimeout(), SetTimeout(), SignalMonitorValue(), and toString().

◆ m_highThreshold

bool SignalMonitorValue::m_highThreshold {true}
private

◆ m_set

bool SignalMonitorValue::m_set {false}
private

Definition at line 146 of file signalmonitorvalue.h.

Referenced by GetStatus(), Set(), SetValue(), SignalMonitorValue(), and toString().


The documentation for this class was generated from the following files: