MythTV  master
Classes | Public Types | Public Member Functions | Static Public Member Functions | Protected Types | Protected Member Functions | Static Protected Member Functions | Protected Attributes | Static Private Attributes | List of all members
DiSEqCDevDevice Class Referenceabstract

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

#include <diseqc.h>

Inheritance diagram for DiSEqCDevDevice:
Inheritance graph
[legend]
Collaboration diagram for DiSEqCDevDevice:
Collaboration graph
[legend]

Classes

struct  TypeTable
 

Public Types

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

Public Member Functions

 DiSEqCDevDevice (DiSEqCDevTree &tree, uint devid)
 
virtual ~DiSEqCDevDevice ()
 
virtual void Reset (void)
 Resets to the last known settings for this device. More...
 
virtual bool Execute (const DiSEqCDevSettings &, const DTVMultiplex &)=0
 Applies DiSEqC settings to this node and any children. More...
 
virtual bool Load (void)=0
 Loads this device from the database. More...
 
virtual bool Store (void) const =0
 
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. More...
 
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. More...
 
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. More...
 
virtual uint GetVoltage (const DiSEqCDevSettings &, const DTVMultiplex &) const =0
 Retrives the desired voltage for this config. More...
 
DiSEqCDevDeviceFindDevice (uint dev_id)
 
virtual DiSEqCDevDeviceGetSelectedChild (const DiSEqCDevSettings &) const
 Retrieves the selected child for this configuration, if any. More...
 
virtual DiSEqCDevDeviceGetChild (uint)
 Retrieves the nth child of this node. More...
 

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 dev_id=0)
 

Protected Types

using TypeTableVec = std::vector< TypeTable >
 

Protected Member Functions

void SetDeviceID (uint devid) const
 

Static Protected Member Functions

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

Protected Attributes

uint m_devid
 
dvbdev_t m_devType {kTypeLNB}
 
QString m_desc
 
DiSEqCDevTreem_tree
 
DiSEqCDevDevicem_parent {nullptr}
 
uint m_ordinal {0}
 
uint m_repeat {1}
 

Static Private Attributes

static const TypeTableVec kDvbdevLookup
 

Detailed Description

Represents a node in a DVB-S device network.

Definition at line 139 of file diseqc.h.

Member Typedef Documentation

◆ TypeTableVec

using DiSEqCDevDevice::TypeTableVec = std::vector<TypeTable>
protected

Definition at line 214 of file diseqc.h.

Member Enumeration Documentation

◆ dvbdev_t

Enumerator
kTypeSwitch 
kTypeRotor 
kTypeSCR 
kTypeLNB 

Definition at line 153 of file diseqc.h.

Constructor & Destructor Documentation

◆ DiSEqCDevDevice()

DiSEqCDevDevice::DiSEqCDevDevice ( DiSEqCDevTree tree,
uint  devid 
)
inline

Definition at line 142 of file diseqc.h.

◆ ~DiSEqCDevDevice()

DiSEqCDevDevice::~DiSEqCDevDevice ( )
virtual

Definition at line 866 of file diseqc.cpp.

Member Function Documentation

◆ Reset()

DiSEqCDevDevice::Reset ( void  )
inlinevirtual

Resets to the last known settings for this device.

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

Reimplemented in DiSEqCDevSCR, DiSEqCDevRotor, and DiSEqCDevSwitch.

Definition at line 147 of file diseqc.h.

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

◆ Execute()

DiSEqCDevDevice::Execute ( const DiSEqCDevSettings settings,
const DTVMultiplex tuning 
)
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, DiSEqCDevSCR, DiSEqCDevRotor, and DiSEqCDevSwitch.

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

◆ Load()

DiSEqCDevDevice::Load ( void  )
pure virtual

Loads this device from the database.

Returns
True if successful.

Implemented in DiSEqCDevLNB, DiSEqCDevSCR, DiSEqCDevRotor, and DiSEqCDevSwitch.

Referenced by CreateById().

◆ Store()

DiSEqCDevDevice::Store ( void  ) const
pure virtual

Stores this device to the database.

Returns
True if successful.

Implemented in DiSEqCDevLNB, DiSEqCDevSCR, DiSEqCDevRotor, and DiSEqCDevSwitch.

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

◆ SetDeviceType()

void DiSEqCDevDevice::SetDeviceType ( dvbdev_t  type)
inline

Definition at line 160 of file diseqc.h.

Referenced by CreateByType().

◆ SetParent()

void DiSEqCDevDevice::SetParent ( DiSEqCDevDevice parent)
inline

◆ SetOrdinal()

void DiSEqCDevDevice::SetOrdinal ( uint  ordinal)
inline

◆ SetDescription()

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

Definition at line 163 of file diseqc.h.

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

◆ SetRepeatCount()

void DiSEqCDevDevice::SetRepeatCount ( uint  repeat)
inline

Definition at line 164 of file diseqc.h.

Referenced by DeviceRepeatSetting::Save().

◆ SetChild()

DiSEqCDevDevice::SetChild ( uint  ordinal,
DiSEqCDevDevice device 
)
inlinevirtual

Changes the nth child of this node.

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

Reimplemented in DiSEqCDevSCR, DiSEqCDevRotor, and DiSEqCDevSwitch.

Definition at line 165 of file diseqc.h.

Referenced by DeviceTree::DeleteDevice(), and DeviceTree::ValueChanged().

◆ GetDeviceType()

dvbdev_t DiSEqCDevDevice::GetDeviceType ( void  ) const
inline

◆ GetDeviceID()

uint DiSEqCDevDevice::GetDeviceID ( void  ) const
inline

◆ IsRealDeviceID()

bool DiSEqCDevDevice::IsRealDeviceID ( void  ) const
inline

◆ GetParent()

DiSEqCDevDevice* DiSEqCDevDevice::GetParent ( void  ) const
inline

Definition at line 173 of file diseqc.h.

Referenced by DeviceTree::DeleteDevice().

◆ GetOrdinal()

uint DiSEqCDevDevice::GetOrdinal ( void  ) const
inline

Definition at line 174 of file diseqc.h.

Referenced by DeviceTree::DeleteDevice().

◆ GetDescription()

QString DiSEqCDevDevice::GetDescription ( void  ) const
inline

◆ GetRepeatCount()

uint DiSEqCDevDevice::GetRepeatCount ( void  ) const
inline

Definition at line 176 of file diseqc.h.

Referenced by DeviceRepeatSetting::Load().

◆ GetChildCount()

DiSEqCDevDevice::GetChildCount ( void  ) const
inlinevirtual

Retrieves the proper number of children for this node.

Returns
Number of children

Reimplemented in DiSEqCDevSCR, DiSEqCDevRotor, and DiSEqCDevSwitch.

Definition at line 177 of file diseqc.h.

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

◆ IsCommandNeeded()

DiSEqCDevDevice::IsCommandNeeded ( const DiSEqCDevSettings settings,
const DTVMultiplex tuning 
) const
inlinevirtual

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

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

Reimplemented in DiSEqCDevRotor, DiSEqCDevSwitch, and DiSEqCDevSCR.

Definition at line 178 of file diseqc.h.

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

◆ GetVoltage()

DiSEqCDevDevice::GetVoltage ( const DiSEqCDevSettings settings,
const DTVMultiplex tuning 
) const
pure virtual

Retrives the desired voltage for this config.

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

Implemented in DiSEqCDevLNB, DiSEqCDevSCR, DiSEqCDevRotor, and DiSEqCDevSwitch.

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

◆ FindDevice()

DiSEqCDevDevice::FindDevice ( uint  dev_id)

Returns a device by ID.

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

Definition at line 872 of file diseqc.cpp.

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

◆ GetSelectedChild()

DiSEqCDevDevice::GetSelectedChild ( const DiSEqCDevSettings settings) const
inlinevirtual

Retrieves the selected child for this configuration, if any.

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

Reimplemented in DiSEqCDevSwitch, DiSEqCDevRotor, and DiSEqCDevSCR.

Definition at line 186 of file diseqc.h.

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

◆ GetChild()

DiSEqCDevDevice::GetChild ( uint  ordinal)
inlinevirtual

Retrieves the nth child of this node.

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

Reimplemented in DiSEqCDevSCR, DiSEqCDevRotor, and DiSEqCDevSwitch.

Definition at line 188 of file diseqc.h.

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

◆ DevTypeToString()

static QString DiSEqCDevDevice::DevTypeToString ( dvbdev_t  type)
inlinestatic

Definition at line 191 of file diseqc.h.

◆ DevTypeFromString()

static dvbdev_t DiSEqCDevDevice::DevTypeFromString ( const QString &  type)
inlinestatic

Definition at line 193 of file diseqc.h.

Referenced by CreateById().

◆ CreateById()

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

◆ CreateByType()

DiSEqCDevDevice * DiSEqCDevDevice::CreateByType ( DiSEqCDevTree tree,
dvbdev_t  type,
uint  dev_id = 0 
)
static

Definition at line 932 of file diseqc.cpp.

Referenced by CreateById(), and DeviceTree::ValueChanged().

◆ SetDeviceID()

void DiSEqCDevDevice::SetDeviceID ( uint  devid) const
inlineprotected

◆ TableToString()

QString DiSEqCDevDevice::TableToString ( uint  type,
const TypeTableVec table 
)
staticprotected

◆ TableFromString()

uint DiSEqCDevDevice::TableFromString ( const QString &  type,
const TypeTableVec table 
)
staticprotected

Member Data Documentation

◆ m_devid

uint DiSEqCDevDevice::m_devid
mutableprotected

Definition at line 205 of file diseqc.h.

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

◆ m_devType

dvbdev_t DiSEqCDevDevice::m_devType {kTypeLNB}
protected

Definition at line 206 of file diseqc.h.

Referenced by GetDeviceType(), and SetDeviceType().

◆ m_desc

QString DiSEqCDevDevice::m_desc
protected

Definition at line 207 of file diseqc.h.

Referenced by GetDescription(), and SetDescription().

◆ m_tree

DiSEqCDevTree& DiSEqCDevDevice::m_tree
protected

◆ m_parent

DiSEqCDevDevice* DiSEqCDevDevice::m_parent {nullptr}
protected

◆ m_ordinal

uint DiSEqCDevDevice::m_ordinal {0}
protected

◆ m_repeat

uint DiSEqCDevDevice::m_repeat {1}
protected

◆ kDvbdevLookup

const std::vector< DiSEqCDevDevice::TypeTable > DiSEqCDevDevice::kDvbdevLookup
staticprivate
Initial value:
{
{ "switch", kTypeSwitch },
{ "rotor", kTypeRotor },
{ "scr", kTypeSCR },
{ "lnb", kTypeLNB },
{ QString(), kTypeLNB },
}

Definition at line 220 of file diseqc.h.

Referenced by DevTypeFromString(), and DevTypeToString().


The documentation for this class was generated from the following files:
DiSEqCDevDevice::kTypeRotor
@ kTypeRotor
Definition: diseqc.h:156
DiSEqCDevDevice::kTypeSCR
@ kTypeSCR
Definition: diseqc.h:157
DiSEqCDevDevice::kTypeSwitch
@ kTypeSwitch
Definition: diseqc.h:155
DiSEqCDevDevice::kTypeLNB
@ kTypeLNB
Definition: diseqc.h:158