SignalMonitorValue Class Reference

#include <signalmonitorvalue.h>

List of all members.

Public Member Functions

 SignalMonitorValue (const QString &_name, const 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.
QString GetShortName (void) const
 Returns a space free name of the value. Used by GetStatus().
QString GetStatus () const
 Returns a signal monitor value as one long string.
int GetValue () const
 Returns the value.
int GetMin () const
 Returns smallest value possible, used for signal monitor bars.
int GetMax () const
 Returns greatest value possible, used for signal monitor bars.
int GetThreshold () const
 Returns the threshold at which the value is considered "good".
bool IsHighThreshold () const
 Returns true if values greater than the threshold are considered good, false otherwise.
int GetTimeout () const
 Returns how long to wait for a good value in milliseconds.
bool IsGood () const
 Returns true if the value is equal to the threshold, or on the right side of the threshold (depends on IsHighThreashold()).
int GetNormalizedValue (int newmin, int newmax) const
 Returns the value normalized to the [newmin, newmax] range.
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.
void SetTimeout (int _timeout)
QString toString () const

Static Public Member Functions

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

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

typedef vector
< SignalMonitorValue
SignalMonitorList

Private Member Functions

 SignalMonitorValue ()
 SignalMonitorValue (const QString &_name, const 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 name
QString noSpaceName
int value
int threshold
int minval
int maxval
int timeout
bool high_threshold
bool set

Detailed Description

Definition at line 12 of file signalmonitorvalue.h.


Member Typedef Documentation

Definition at line 14 of file signalmonitorvalue.h.


Constructor & Destructor Documentation

SignalMonitorValue::SignalMonitorValue ( const QString &  _name,
const QString &  _noSpaceName,
int  _threshold,
bool  _high_threshold,
int  _min,
int  _max,
int  _timeout 
)

Definition at line 34 of file signalmonitorvalue.cpp.

virtual SignalMonitorValue::~SignalMonitorValue (  )  [inline, virtual]

Definition at line 19 of file signalmonitorvalue.h.

SignalMonitorValue::SignalMonitorValue (  )  [inline, private]

Definition at line 128 of file signalmonitorvalue.h.

Referenced by Create().

SignalMonitorValue::SignalMonitorValue ( const QString &  _name,
const 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

QString SignalMonitorValue::GetName ( void   )  const

Returns the long name of this value.

Definition at line 86 of file signalmonitorvalue.cpp.

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

QString SignalMonitorValue::GetShortName ( void   )  const

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

Definition at line 96 of file signalmonitorvalue.cpp.

QString SignalMonitorValue::GetStatus ( void   )  const [inline]

Returns a signal monitor value as one long string.

Definition at line 29 of file signalmonitorvalue.h.

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

int SignalMonitorValue::GetValue (  )  const [inline]
int SignalMonitorValue::GetMin (  )  const [inline]

Returns smallest value possible, used for signal monitor bars.

Definition at line 39 of file signalmonitorvalue.h.

Referenced by GetNormalizedValue().

int SignalMonitorValue::GetMax (  )  const [inline]

Returns greatest value possible, used for signal monitor bars.

Definition at line 41 of file signalmonitorvalue.h.

Referenced by GetNormalizedValue().

int SignalMonitorValue::GetThreshold (  )  const [inline]

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

See also:
IsHighThreshold(), IsGood()

Definition at line 44 of file signalmonitorvalue.h.

bool SignalMonitorValue::IsHighThreshold (  )  const [inline]

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

Definition at line 47 of file signalmonitorvalue.h.

int SignalMonitorValue::GetTimeout (  )  const [inline]

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

Definition at line 49 of file signalmonitorvalue.h.

bool SignalMonitorValue::IsGood (  )  const [inline]
int SignalMonitorValue::GetNormalizedValue ( int  newmin,
int  newmax 
) const [inline]

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

Parameters:
newmin New minimum value.
newmax New maximum value.

Definition at line 60 of file signalmonitorvalue.h.

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

void SignalMonitorValue::SetValue ( int  _value  )  [inline]
void SignalMonitorValue::SetMin ( int  _min  )  [inline]

Definition at line 77 of file signalmonitorvalue.h.

void SignalMonitorValue::SetMax ( int  _max  )  [inline]

Definition at line 79 of file signalmonitorvalue.h.

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

Definition at line 83 of file signalmonitorvalue.h.

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

Sets the minimum and maximum values.

See also:
SetMin(int), SetMax(int)

Definition at line 90 of file signalmonitorvalue.h.

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

void SignalMonitorValue::SetTimeout ( int  _timeout  )  [inline]

Definition at line 95 of file signalmonitorvalue.h.

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

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

Referenced by SignalMonitorValue().

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

Definition at line 145 of file signalmonitorvalue.cpp.

SignalMonitorList SignalMonitorValue::Parse ( const QStringList &  list  )  [static]

Converts a list of strings to SignalMonitorValue classes.

Parameters:
slist List of strings to convert.

Definition at line 161 of file signalmonitorvalue.cpp.

Referenced by TV::UpdateOSDSignal().

bool SignalMonitorValue::AllGood ( const SignalMonitorList slist  )  [static]

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

Parameters:
slist List of SignalMonitorValue classes to check.

Definition at line 188 of file signalmonitorvalue.cpp.

Referenced by TV::UpdateOSDSignal().

int SignalMonitorValue::MaxWait ( const SignalMonitorList slist  )  [static]

Returns the maximum timeout value in the signal monitor list.

Parameters:
slist List of SignalMonitorValue classes to check.

Definition at line 218 of file signalmonitorvalue.cpp.

QString SignalMonitorValue::toString ( void   )  const [inline]

Definition at line 117 of file signalmonitorvalue.h.

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

Definition at line 106 of file signalmonitorvalue.cpp.

Referenced by Create(), and Parse().


Member Data Documentation

Definition at line 111 of file signalmonitorvalue.h.

Referenced by Init().

QStringList SignalMonitorValue::ERROR_NO_LINK [static]

Definition at line 112 of file signalmonitorvalue.h.

Referenced by Init().

QStringList SignalMonitorValue::SIGNAL_LOCK [static]

Definition at line 113 of file signalmonitorvalue.h.

Referenced by Init().

Definition at line 115 of file signalmonitorvalue.h.

Referenced by Init().

QString SignalMonitorValue::name [private]

Definition at line 136 of file signalmonitorvalue.h.

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

Definition at line 137 of file signalmonitorvalue.h.

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

Definition at line 142 of file signalmonitorvalue.h.

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

Definition at line 144 of file signalmonitorvalue.h.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends
Generated on Mon May 28 06:42:27 2012 for MythTV by  doxygen 1.6.3