DiSEqCDevDevice Class Reference

#include <diseqc.h>

Inheritance diagram for DiSEqCDevDevice:

DiSEqCDevLNB DiSEqCDevRotor DiSEqCDevSwitch

List of all members.


Detailed Description

Represents a node in a DVB-S device network.

Definition at line 131 of file diseqc.h.


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]

Classes

struct  TypeTable

Member Enumeration Documentation

Enumerator:
kTypeSwitch 
kTypeRotor 
kTypeLNB 

Definition at line 144 of file diseqc.h.


Constructor & Destructor Documentation

DiSEqCDevDevice::DiSEqCDevDevice ( DiSEqCDevTree tree,
uint  devid 
)

Parameters:
tree Parent reference to tree object.
devid Device ID of this node.

Definition at line 761 of file diseqc.cpp.

DiSEqCDevDevice::~DiSEqCDevDevice (  )  [virtual]

Definition at line 769 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 DiSEqCDevSwitch, and DiSEqCDevRotor.

Definition at line 138 of file diseqc.h.

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

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

Applies DiSEqC settings to this node and any children.

Parameters:
settings Configuration chain to apply.
tuning Tuning parameters.
Returns:
True if execution completed successfully.

Implemented in DiSEqCDevSwitch, DiSEqCDevRotor, and DiSEqCDevLNB.

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

DiSEqCDevDevice::Load ( void   )  [pure virtual]

Loads this device from the database.

Returns:
True if successful.

Implemented in DiSEqCDevSwitch, DiSEqCDevRotor, and DiSEqCDevLNB.

Referenced by CreateById().

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

Stores this device to the database.

Returns:
True if successful.

Implemented in DiSEqCDevSwitch, DiSEqCDevRotor, and DiSEqCDevLNB.

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

void DiSEqCDevDevice::SetDeviceType ( dvbdev_t  type  )  [inline]

Definition at line 145 of file diseqc.h.

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

void DiSEqCDevDevice::SetParent ( DiSEqCDevDevice parent  )  [inline]

Definition at line 146 of file diseqc.h.

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

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

Definition at line 147 of file diseqc.h.

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

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

Definition at line 148 of file diseqc.h.

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

void DiSEqCDevDevice::SetRepeatCount ( uint  repeat  )  [inline]

Definition at line 149 of file diseqc.h.

Referenced by DeviceRepeatSetting::save().

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

Changes the nth child of this node.

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

Reimplemented in DiSEqCDevSwitch, and DiSEqCDevRotor.

Definition at line 150 of file diseqc.h.

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

dvbdev_t DiSEqCDevDevice::GetDeviceType ( void   )  const [inline]

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

bool DiSEqCDevDevice::IsRealDeviceID ( void   )  const [inline]

DiSEqCDevDevice* DiSEqCDevDevice::GetParent ( void   )  const [inline]

Definition at line 157 of file diseqc.h.

Referenced by DeviceTree::del().

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

Definition at line 158 of file diseqc.h.

Referenced by DeviceTree::del().

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

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

Definition at line 160 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 DiSEqCDevSwitch, and DiSEqCDevRotor.

Definition at line 161 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:
settings Configuration chain in effect.
Returns:
true if a command would be sent if Execute() were called.

Reimplemented in DiSEqCDevSwitch, and DiSEqCDevRotor.

Definition at line 162 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:
settings Configuration chain in effect.
tuning Tuning parameters.
Returns:
Voltage required.

Implemented in DiSEqCDevSwitch, DiSEqCDevRotor, and DiSEqCDevLNB.

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

DiSEqCDevDevice::FindDevice ( uint  dev_id  ) 

Returns a device by ID.

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

Definition at line 775 of file diseqc.cpp.

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

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

Retrieves the selected child for this configuration, if any.

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

Reimplemented in DiSEqCDevSwitch, and DiSEqCDevRotor.

Definition at line 170 of file diseqc.h.

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

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

Retrieves the nth child of this node.

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

Reimplemented in DiSEqCDevSwitch, and DiSEqCDevRotor.

Definition at line 172 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 175 of file diseqc.h.

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

Definition at line 177 of file diseqc.h.

Referenced by CreateById().

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

Definition at line 799 of file diseqc.cpp.

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

DiSEqCDevDevice * DiSEqCDevDevice::CreateByType ( DiSEqCDevTree tree,
dvbdev_t  type,
uint  devid = 0 
) [static]

void DiSEqCDevDevice::SetDeviceID ( uint  devid  )  const [inline, protected]

Definition at line 187 of file diseqc.h.

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

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

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


Member Data Documentation

uint DiSEqCDevDevice::m_devid [mutable, protected]

Definition at line 189 of file diseqc.h.

Referenced by GetDeviceID(), IsRealDeviceID(), and SetDeviceID().

Definition at line 190 of file diseqc.h.

Referenced by GetDeviceType(), and SetDeviceType().

QString DiSEqCDevDevice::m_desc [protected]

Definition at line 191 of file diseqc.h.

Referenced by GetDescription(), and SetDescription().

Initial value:

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

Definition at line 203 of file diseqc.h.

Referenced by DevTypeFromString(), and DevTypeToString().


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

Generated on Sat Dec 18 05:16:01 2010 for MythTV by  doxygen 1.5.5