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, int _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...
 
int 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 (int _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 int 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 = vector< SignalMonitorValue >
 

Private Member Functions

 SignalMonitorValue ()=default
 
 SignalMonitorValue (QString _name, QString _noSpaceName, int _value, int _threshold, bool _high_threshold, int _min, int _max, int _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}
 
int m_timeout {-1}
 
bool m_highThreshold {true}
 
bool m_set {false}
 

Detailed Description

Definition at line 14 of file signalmonitorvalue.h.

Member Typedef Documentation

◆ SignalMonitorList

Definition at line 18 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,
int  _timeout 
)

Definition at line 37 of file signalmonitorvalue.cpp.

◆ ~SignalMonitorValue()

virtual SignalMonitorValue::~SignalMonitorValue ( )
inlinevirtual

Definition at line 23 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,
int  _timeout,
bool  _set 
)
private

Definition at line 60 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 ( void  ) const
inline

Returns a signal monitor value as one long string.

Definition at line 33 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 43 of file signalmonitorvalue.h.

◆ GetMax()

int SignalMonitorValue::GetMax ( ) const
inline

Returns greatest value possible, used for signal monitor bars.

Definition at line 45 of file signalmonitorvalue.h.

◆ GetThreshold()

int SignalMonitorValue::GetThreshold ( ) const
inline

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

See also
IsHighThreshold(), IsGood()

Definition at line 48 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 51 of file signalmonitorvalue.h.

◆ GetTimeout()

int SignalMonitorValue::GetTimeout ( ) const
inline

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

Definition at line 53 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 64 of file signalmonitorvalue.h.

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

◆ SetValue()

void SignalMonitorValue::SetValue ( int  _value)
inline

◆ SetMin()

void SignalMonitorValue::SetMin ( int  _min)
inline

Definition at line 81 of file signalmonitorvalue.h.

◆ SetMax()

void SignalMonitorValue::SetMax ( int  _max)
inline

Definition at line 83 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 87 of file signalmonitorvalue.h.

◆ SetRange()

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

Sets the minimum and maximum values.

See also
SetMin(int), SetMax(int)

Definition at line 94 of file signalmonitorvalue.h.

Referenced by DVBSignalMonitor::DVBSignalMonitor(), Set(), and V4L2encSignalMonitor::V4L2encSignalMonitor().

◆ SetTimeout()

void SignalMonitorValue::SetTimeout ( int  _timeout)
inline

Definition at line 99 of file signalmonitorvalue.h.

Referenced by DVBSignalMonitor::DVBSignalMonitor(), and Set().

◆ Init()

void SignalMonitorValue::Init ( void  )
static

Initializes the some static constants needed by SignalMonitorValue.

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

Definition at line 21 of file signalmonitorvalue.cpp.

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

◆ Create()

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

Definition at line 134 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 150 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 177 of file signalmonitorvalue.cpp.

Referenced by TV::UpdateOSDSignal().

◆ MaxWait()

int 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 207 of file signalmonitorvalue.cpp.

◆ toString()

QString SignalMonitorValue::toString ( void  ) const
inline

Definition at line 121 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 115 of file signalmonitorvalue.h.

◆ ERROR_NO_LINK

QStringList SignalMonitorValue::ERROR_NO_LINK
static

Definition at line 116 of file signalmonitorvalue.h.

◆ SIGNAL_LOCK

QStringList SignalMonitorValue::SIGNAL_LOCK
static

Definition at line 117 of file signalmonitorvalue.h.

◆ run_static_init

bool SignalMonitorValue::run_static_init = true
static

Definition at line 119 of file signalmonitorvalue.h.

◆ 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(), Set(), and SignalMonitorValue().

◆ m_value

int SignalMonitorValue::m_value {-1}
private

Definition at line 140 of file signalmonitorvalue.h.

Referenced by SignalMonitorValue().

◆ m_threshold

int SignalMonitorValue::m_threshold {-1}
private

Definition at line 141 of file signalmonitorvalue.h.

Referenced by SignalMonitorValue().

◆ m_minVal

int SignalMonitorValue::m_minVal {-1}
private

Definition at line 142 of file signalmonitorvalue.h.

Referenced by SignalMonitorValue().

◆ m_maxVal

int SignalMonitorValue::m_maxVal {-1}
private

Definition at line 143 of file signalmonitorvalue.h.

Referenced by SignalMonitorValue().

◆ m_timeout

int SignalMonitorValue::m_timeout {-1}
private

Definition at line 144 of file signalmonitorvalue.h.

Referenced by SignalMonitorValue().

◆ m_highThreshold

bool SignalMonitorValue::m_highThreshold {true}
private

Definition at line 145 of file signalmonitorvalue.h.

Referenced by SignalMonitorValue().

◆ m_set

bool SignalMonitorValue::m_set {false}
private

Definition at line 146 of file signalmonitorvalue.h.

Referenced by Set(), and SignalMonitorValue().


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