MythTV  0.26-pre
Classes | Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Static Protected Member Functions | Protected Attributes | Static Private Attributes
DiSEqCDevDevice Class Reference

Represents a node in a DVB-S device network. More...

#include <diseqc.h>

Inheritance diagram for DiSEqCDevDevice:
DiSEqCDevLNB DiSEqCDevRotor DiSEqCDevSwitch

List of all members.

Classes

struct  TypeTable

Public Types

enum  dvbdev_t { kTypeSwitch = 0, kTypeRotor = 1, kTypeLNB = 2 }

Public Member Functions

 DiSEqCDevDevice (DiSEqCDevTree &tree, uint devid)
virtual ~DiSEqCDevDevice ()
virtual void Reset (void)
 Resets to the last known settings for this device.
virtual bool Execute (const DiSEqCDevSettings &, const DTVMultiplex &)=0
 Applies DiSEqC settings to this node and any children.
virtual bool Load (void)=0
 Loads this device from the database.
virtual bool Store (void) const =0
 Stores this device to the database.
void SetDeviceType (dvbdev_t type)
void SetParent (DiSEqCDevDevice *parent)
void SetOrdinal (uint ordinal)
void SetDescription (const QString &desc)
void SetRepeatCount (uint repeat)
virtual bool SetChild (uint, DiSEqCDevDevice *)
 Changes the nth child of this node.
dvbdev_t GetDeviceType (void) const
uint GetDeviceID (void) const
bool IsRealDeviceID (void) const
DiSEqCDevDeviceGetParent (void) const
uint GetOrdinal (void) const
QString GetDescription (void) const
uint GetRepeatCount (void) const
virtual uint GetChildCount (void) const
 Retrieves the proper number of children for this node.
virtual bool IsCommandNeeded (const DiSEqCDevSettings &, const DTVMultiplex &) const
 Determines if this device or any child will be sending a command for the given configuration chain.
virtual uint GetVoltage (const DiSEqCDevSettings &, const DTVMultiplex &) const =0
 Retrives the desired voltage for this config.
DiSEqCDevDeviceFindDevice (uint dev_id)
 Returns a device by ID.
virtual DiSEqCDevDeviceGetSelectedChild (const DiSEqCDevSettings &) const
 Retrieves the selected child for this configuration, if any.
virtual DiSEqCDevDeviceGetChild (uint)
 Retrieves the nth child of this node.

Static Public Member Functions

static QString DevTypeToString (dvbdev_t type)
static dvbdev_t DevTypeFromString (const QString &type)
static DiSEqCDevDeviceCreateById (DiSEqCDevTree &tree, uint devid)
static DiSEqCDevDeviceCreateByType (DiSEqCDevTree &tree, dvbdev_t type, uint devid=0)

Protected Member Functions

void SetDeviceID (uint devid) const

Static Protected Member Functions

static QString TableToString (uint type, const TypeTable *table)
static uint TableFromString (const QString &type, const TypeTable *table)

Protected Attributes

uint m_devid
dvbdev_t m_dev_type
QString m_desc
DiSEqCDevTreem_tree
DiSEqCDevDevicem_parent
uint m_ordinal
uint m_repeat

Static Private Attributes

static const TypeTable dvbdev_lookup [4]

Detailed Description

Represents a node in a DVB-S device network.

Definition at line 132 of file diseqc.h.


Member Enumeration Documentation

Enumerator:
kTypeSwitch 
kTypeRotor 
kTypeLNB 

Definition at line 145 of file diseqc.h.


Constructor & Destructor Documentation

Parameters:
treeParent reference to tree object.
devidDevice ID of this node.

Definition at line 800 of file diseqc.cpp.

Definition at line 808 of file diseqc.cpp.


Member Function Documentation

DiSEqCDevDevice::Reset ( void  ) [inline, virtual]

Resets to the last known settings for this device.

Device will not actually have commands issued until next Execute() method.

Reimplemented in DiSEqCDevRotor, and DiSEqCDevSwitch.

Definition at line 139 of file diseqc.h.

Referenced by DiSEqCDevLNB::DiSEqCDevLNB(), DiSEqCDevTree::Reset(), and DiSEqCDevRotor::Reset().

DiSEqCDevDevice::Execute ( const DiSEqCDevSettings ,
const DTVMultiplex  
) [pure virtual]

Applies DiSEqC settings to this node and any children.

Parameters:
settingsConfiguration chain to apply.
tuningTuning parameters.
Returns:
True if execution completed successfully.

Implemented in DiSEqCDevLNB, DiSEqCDevRotor, and DiSEqCDevSwitch.

Referenced by DiSEqCDevTree::Execute(), and DiSEqCDevRotor::Execute().

DiSEqCDevDevice::Load ( void  ) [pure virtual]

Loads this device from the database.

Returns:
True if successful.

Implemented in DiSEqCDevLNB, DiSEqCDevRotor, and DiSEqCDevSwitch.

Referenced by CreateById().

DiSEqCDevDevice::Store ( void  ) const [pure virtual]

Stores this device to the database.

Returns:
True if successful.

Implemented in DiSEqCDevLNB, DiSEqCDevRotor, and DiSEqCDevSwitch.

Referenced by DiSEqCDevTree::Store(), and DiSEqCDevRotor::Store().

Definition at line 146 of file diseqc.h.

Referenced by CreateByType(), and DeviceTypeSetting::Save().

Definition at line 147 of file diseqc.h.

Referenced by DiSEqCDevSwitch::SetChild(), and DiSEqCDevRotor::SetChild().

void DiSEqCDevDevice::SetOrdinal ( uint  ordinal) [inline]

Definition at line 148 of file diseqc.h.

Referenced by DiSEqCDevSwitch::SetChild(), and DiSEqCDevRotor::SetChild().

void DiSEqCDevDevice::SetDescription ( const QString &  desc) [inline]

Definition at line 149 of file diseqc.h.

Referenced by convert_diseqc_db(), CreateById(), CreateByType(), and DeviceDescrSetting::Save().

Definition at line 150 of file diseqc.h.

Referenced by DeviceRepeatSetting::Save().

DiSEqCDevDevice::SetChild ( uint  ,
DiSEqCDevDevice  
) [inline, virtual]

Changes the nth child of this node.

Parameters:
ordinalChild number (starting at 0).
deviceNew child device. (may be NULL)
Returns:
true if object was added to tree.

Reimplemented in DiSEqCDevRotor, and DiSEqCDevSwitch.

Definition at line 151 of file diseqc.h.

Referenced by convert_diseqc_db(), DeviceTree::CreateNewNodeDialog(), and DeviceTree::del().

uint DiSEqCDevDevice::GetDeviceID ( void  ) const [inline]

Definition at line 158 of file diseqc.h.

Referenced by DeviceTree::del().

uint DiSEqCDevDevice::GetOrdinal ( void  ) const [inline]

Definition at line 159 of file diseqc.h.

Referenced by DeviceTree::del().

QString DiSEqCDevDevice::GetDescription ( void  ) const [inline]

Definition at line 161 of file diseqc.h.

Referenced by DeviceRepeatSetting::Load().

DiSEqCDevDevice::GetChildCount ( void  ) const [inline, virtual]

Retrieves the proper number of children for this node.

Returns:
Number of children

Reimplemented in DiSEqCDevRotor, and DiSEqCDevSwitch.

Definition at line 162 of file diseqc.h.

Referenced by DTVDeviceConfigGroup::AddNodes(), FindDevice(), DeviceTree::PopulateTree(), and SwitchSetting::SwitchSetting().

DiSEqCDevDevice::IsCommandNeeded ( const DiSEqCDevSettings settings,
const DTVMultiplex tuning 
) const [inline, virtual]

Determines if this device or any child will be sending a command for the given configuration chain.

Parameters:
settingsConfiguration chain in effect.
Returns:
true if a command would be sent if Execute() were called.

Reimplemented in DiSEqCDevRotor, and DiSEqCDevSwitch.

Definition at line 163 of file diseqc.h.

Referenced by DiSEqCDevTree::Execute(), and DiSEqCDevRotor::IsCommandNeeded().

DiSEqCDevDevice::GetVoltage ( const DiSEqCDevSettings ,
const DTVMultiplex  
) const [pure virtual]

Retrives the desired voltage for this config.

Parameters:
settingsConfiguration chain in effect.
tuningTuning parameters.
Returns:
Voltage required.

Implemented in DiSEqCDevLNB, DiSEqCDevRotor, and DiSEqCDevSwitch.

Referenced by DiSEqCDevTree::ApplyVoltage(), DiSEqCDevSwitch::GetVoltage(), and DiSEqCDevRotor::GetVoltage().

Returns a device by ID.

Parameters:
dev_idDevice ID to find.
Returns:
Pointer to device, or NULL if not found in this tree.

Definition at line 814 of file diseqc.cpp.

Referenced by DiSEqCDevTree::FindDevice(), and FindDevice().

DiSEqCDevDevice::GetSelectedChild ( const DiSEqCDevSettings ) const [inline, virtual]

Retrieves the selected child for this configuration, if any.

Parameters:
settingsConfiguration chain in effect.
Returns:
Child node object, or NULL if none.

Reimplemented in DiSEqCDevRotor, and DiSEqCDevSwitch.

Definition at line 171 of file diseqc.h.

Referenced by DiSEqCDevTree::FindLNB(), and DiSEqCDevTree::FindRotor().

DiSEqCDevDevice::GetChild ( uint  ) [inline, virtual]

Retrieves the nth child of this node.

Parameters:
ordinalChild number (starting at 0).
Returns:
Pointer to device object, or NULL if no child.

Reimplemented in DiSEqCDevRotor, and DiSEqCDevSwitch.

Definition at line 173 of file diseqc.h.

Referenced by DTVDeviceConfigGroup::AddNodes(), convert_diseqc_db(), FindDevice(), DeviceTree::PopulateTree(), and SwitchSetting::SwitchSetting().

static QString DiSEqCDevDevice::DevTypeToString ( dvbdev_t  type) [inline, static]

Definition at line 176 of file diseqc.h.

static dvbdev_t DiSEqCDevDevice::DevTypeFromString ( const QString &  type) [inline, static]

Definition at line 178 of file diseqc.h.

Referenced by CreateById().

DiSEqCDevDevice * DiSEqCDevDevice::CreateById ( DiSEqCDevTree tree,
uint  devid 
) [static]

Definition at line 838 of file diseqc.cpp.

Referenced by DiSEqCDevTree::Load(), DiSEqCDevSwitch::Load(), and DiSEqCDevRotor::Load().

DiSEqCDevDevice * DiSEqCDevDevice::CreateByType ( DiSEqCDevTree tree,
dvbdev_t  type,
uint  devid = 0 
) [static]
void DiSEqCDevDevice::SetDeviceID ( uint  devid) const [inline, protected]

Definition at line 188 of file diseqc.h.

Referenced by DiSEqCDevSwitch::Store(), DiSEqCDevRotor::Store(), and DiSEqCDevLNB::Store().

QString DiSEqCDevDevice::TableToString ( uint  type,
const TypeTable table 
) [static, protected]

Definition at line 88 of file diseqc.cpp.

uint DiSEqCDevDevice::TableFromString ( const QString &  type,
const TypeTable table 
) [static, protected]

Definition at line 102 of file diseqc.cpp.


Member Data Documentation

uint DiSEqCDevDevice::m_devid [mutable, protected]

Definition at line 190 of file diseqc.h.

Definition at line 191 of file diseqc.h.

QString DiSEqCDevDevice::m_desc [protected]

Definition at line 192 of file diseqc.h.

Definition at line 194 of file diseqc.h.

Referenced by DiSEqCDevSwitch::Store(), DiSEqCDevRotor::Store(), and DiSEqCDevLNB::Store().

Definition at line 195 of file diseqc.h.

Referenced by DiSEqCDevSwitch::Store(), DiSEqCDevRotor::Store(), and DiSEqCDevLNB::Store().

Initial value:
{
    { "switch",      kTypeSwitch },
    { "rotor",       kTypeRotor  },
    { "lnb",         kTypeLNB    },
    { QString::null, kTypeLNB    },
}

Definition at line 204 of file diseqc.h.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends