MythTV  master
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Static Protected Member Functions | Private Attributes | Static Private Attributes | List of all members
DiSEqCDevRotor Class Reference

Rotor class. More...

#include <diseqc.h>

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

Public Types

enum  dvbdev_rotor_t { kTypeDiSEqC_1_2 = 0, kTypeDiSEqC_1_3 = 1 }
 
- Public Types inherited from DiSEqCDevDevice
enum  dvbdev_t { kTypeSwitch = 0, kTypeRotor = 1, kTypeSCR = 2, kTypeLNB = 3 }
 

Public Member Functions

 DiSEqCDevRotor (DiSEqCDevTree &tree, uint devid)
 
 ~DiSEqCDevRotor () override
 
void Reset (void) override
 Resets to the last known settings for this device. More...
 
bool Execute (const DiSEqCDevSettings &settings, const DTVMultiplex &tuning) override
 Applies DiSEqC settings to this node and any children. More...
 
bool Load (void) override
 Loads this device from the database. More...
 
bool Store (void) const override
 
void SetType (dvbdev_rotor_t type)
 
void SetLoSpeed (double speed)
 
void SetHiSpeed (double speed)
 
void SetPosMap (const uint_to_dbl_t &posmap)
 
bool SetChild (uint ordinal, DiSEqCDevDevice *device) override
 Changes the nth child of this node. More...
 
void RotationComplete (void) const
 
dvbdev_rotor_t GetType (void) const
 
double GetLoSpeed (void) const
 
double GetHiSpeed (void) const
 
uint_to_dbl_t GetPosMap (void) const
 
double GetProgress (void) const
 Returns an indication of rotor progress. More...
 
bool IsPositionKnown (void) const
 Returns true if there is reasonable confidence in the value returned by GetProgress(). More...
 
uint GetChildCount (void) const override
 Retrieves the proper number of children for this node. More...
 
bool IsCommandNeeded (const DiSEqCDevSettings &settings, const DTVMultiplex &tuning) const override
 Determines if this device or any child will be sending a command for the given configuration chain. More...
 
bool IsMoving (const DiSEqCDevSettings &settings) const
 
uint GetVoltage (const DiSEqCDevSettings &settings, const DTVMultiplex &tuning) const override
 Retrives the desired voltage for this config. More...
 
DiSEqCDevDeviceGetSelectedChild (const DiSEqCDevSettings &setting) const override
 Retrieves the selected child for this configuration, if any. More...
 
DiSEqCDevDeviceGetChild (uint) override
 Retrieves the nth child of this node. More...
 
- Public Member Functions inherited from DiSEqCDevDevice
 DiSEqCDevDevice (DiSEqCDevTree &tree, uint devid)
 
virtual ~DiSEqCDevDevice ()
 
void SetDeviceType (dvbdev_t type)
 
void SetParent (DiSEqCDevDevice *parent)
 
void SetOrdinal (uint ordinal)
 
void SetDescription (const QString &desc)
 
void SetRepeatCount (uint repeat)
 
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
 
DiSEqCDevDeviceFindDevice (uint dev_id)
 

Static Public Member Functions

static QString RotorTypeToString (dvbdev_rotor_t type)
 
static dvbdev_rotor_t RotorTypeFromString (const QString &type)
 
- Static Public Member Functions inherited from DiSEqCDevDevice
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 Member Functions

bool ExecuteRotor (const DiSEqCDevSettings &settings, const DTVMultiplex &tuning, double angle)
 
bool ExecuteUSALS (const DiSEqCDevSettings &settings, const DTVMultiplex &tuning, double angle)
 
void StartRotorPositionTracking (double azimuth)
 
double GetApproxAzimuth (void) const
 
- Protected Member Functions inherited from DiSEqCDevDevice
void SetDeviceID (uint devid) const
 

Static Protected Member Functions

static double CalculateAzimuth (double angle)
 
- Static Protected Member Functions inherited from DiSEqCDevDevice
static QString TableToString (uint type, const TypeTableVec &table)
 
static uint TableFromString (const QString &type, const TypeTableVec &table)
 

Private Attributes

dvbdev_rotor_t m_type {kTypeDiSEqC_1_3}
 
double m_speedHi {2.5}
 
double m_speedLo {1.9}
 
dbl_to_uint_t m_posmap
 
DiSEqCDevDevicem_child {nullptr}
 
double m_lastPosition {0.0}
 
double m_desiredAzimuth {0.0}
 
bool m_reset {true}
 
double m_moveTime {0.0}
 
bool m_lastPosKnown {false}
 
double m_lastAzimuth {0.0}
 

Static Private Attributes

static const TypeTableVec kRotorTypeTable
 

Additional Inherited Members

- Protected Types inherited from DiSEqCDevDevice
using TypeTableVec = std::vector< TypeTable >
 
- Protected Attributes inherited from DiSEqCDevDevice
uint m_devid
 
dvbdev_t m_devType {kTypeLNB}
 
QString m_desc
 
DiSEqCDevTreem_tree
 
DiSEqCDevDevicem_parent {nullptr}
 
uint m_ordinal {0}
 
uint m_repeat {1}
 

Detailed Description

Rotor class.

Definition at line 302 of file diseqc.h.

Member Enumeration Documentation

◆ dvbdev_rotor_t

Enumerator
kTypeDiSEqC_1_2 
kTypeDiSEqC_1_3 

Definition at line 316 of file diseqc.h.

Constructor & Destructor Documentation

◆ DiSEqCDevRotor()

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

Definition at line 305 of file diseqc.h.

◆ ~DiSEqCDevRotor()

DiSEqCDevRotor::~DiSEqCDevRotor ( )
override

Definition at line 1678 of file diseqc.cpp.

Member Function Documentation

◆ Reset()

void DiSEqCDevRotor::Reset ( void  )
overridevirtual

Resets to the last known settings for this device.

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

Reimplemented from DiSEqCDevDevice.

Definition at line 1720 of file diseqc.cpp.

Referenced by DiSEqCDevRotor().

◆ Execute()

bool DiSEqCDevRotor::Execute ( const DiSEqCDevSettings settings,
const DTVMultiplex tuning 
)
overridevirtual

Applies DiSEqC settings to this node and any children.

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

Implements DiSEqCDevDevice.

Definition at line 1683 of file diseqc.cpp.

◆ Load()

bool DiSEqCDevRotor::Load ( void  )
overridevirtual

Loads this device from the database.

Returns
True if successful.

Implements DiSEqCDevDevice.

Definition at line 1791 of file diseqc.cpp.

◆ Store()

bool DiSEqCDevRotor::Store ( void  ) const
overridevirtual

Stores this device to the database.

Returns
True if successful.

Implements DiSEqCDevDevice.

Definition at line 1853 of file diseqc.cpp.

◆ SetType()

void DiSEqCDevRotor::SetType ( dvbdev_rotor_t  type)
inline

Definition at line 317 of file diseqc.h.

Referenced by RotorTypeSetting::Save().

◆ SetLoSpeed()

void DiSEqCDevRotor::SetLoSpeed ( double  speed)
inline

Definition at line 318 of file diseqc.h.

Referenced by RotorLoSpeedSetting::Save().

◆ SetHiSpeed()

void DiSEqCDevRotor::SetHiSpeed ( double  speed)
inline

Definition at line 319 of file diseqc.h.

Referenced by RotorHiSpeedSetting::Save().

◆ SetPosMap()

void DiSEqCDevRotor::SetPosMap ( const uint_to_dbl_t posmap)

Definition at line 1979 of file diseqc.cpp.

Referenced by RotorPosMap::Save().

◆ SetChild()

bool DiSEqCDevRotor::SetChild ( uint  ordinal,
DiSEqCDevDevice device 
)
overridevirtual

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 from DiSEqCDevDevice.

Definition at line 1746 of file diseqc.cpp.

Referenced by Load().

◆ RotationComplete()

void DiSEqCDevRotor::RotationComplete ( void  ) const

Definition at line 2067 of file diseqc.cpp.

Referenced by GetProgress().

◆ GetType()

dvbdev_rotor_t DiSEqCDevRotor::GetType ( void  ) const
inline

Definition at line 325 of file diseqc.h.

Referenced by RotorConfig::Load(), and RotorTypeSetting::Load().

◆ GetLoSpeed()

double DiSEqCDevRotor::GetLoSpeed ( void  ) const
inline

Definition at line 326 of file diseqc.h.

Referenced by RotorLoSpeedSetting::Load().

◆ GetHiSpeed()

double DiSEqCDevRotor::GetHiSpeed ( void  ) const
inline

Definition at line 327 of file diseqc.h.

Referenced by RotorHiSpeedSetting::Load().

◆ GetPosMap()

uint_to_dbl_t DiSEqCDevRotor::GetPosMap ( void  ) const

Definition at line 1969 of file diseqc.cpp.

Referenced by RotorPosMap::Load().

◆ GetProgress()

double DiSEqCDevRotor::GetProgress ( void  ) const

Returns an indication of rotor progress.

Returns
Scale from 0.0..1.0 indicating percentage complete of current move. A value of 1.0 indicates motion is complete.

Definition at line 1934 of file diseqc.cpp.

Referenced by GetApproxAzimuth(), DVBSignalMonitor::GetRotorStatus(), and IsMoving().

◆ IsPositionKnown()

bool DiSEqCDevRotor::IsPositionKnown ( void  ) const

Returns true if there is reasonable confidence in the value returned by GetProgress().

If this returns false, GetProgress() returns progress toward the time when the position will be approximately known.

Definition at line 1964 of file diseqc.cpp.

◆ GetChildCount()

uint DiSEqCDevRotor::GetChildCount ( void  ) const
inlineoverridevirtual

Retrieves the proper number of children for this node.

Returns
Number of children

Reimplemented from DiSEqCDevDevice.

Definition at line 331 of file diseqc.h.

◆ IsCommandNeeded()

bool DiSEqCDevRotor::IsCommandNeeded ( const DiSEqCDevSettings settings,
const DTVMultiplex tuning 
) const
overridevirtual

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 from DiSEqCDevDevice.

Definition at line 1727 of file diseqc.cpp.

◆ IsMoving()

bool DiSEqCDevRotor::IsMoving ( const DiSEqCDevSettings settings) const

Definition at line 1765 of file diseqc.cpp.

Referenced by GetVoltage().

◆ GetVoltage()

uint DiSEqCDevRotor::GetVoltage ( const DiSEqCDevSettings settings,
const DTVMultiplex tuning 
) const
overridevirtual

Retrives the desired voltage for this config.

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

Implements DiSEqCDevDevice.

Definition at line 1774 of file diseqc.cpp.

◆ GetSelectedChild()

DiSEqCDevDevice * DiSEqCDevRotor::GetSelectedChild ( const DiSEqCDevSettings settings) const
overridevirtual

Retrieves the selected child for this configuration, if any.

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

Reimplemented from DiSEqCDevDevice.

Definition at line 1741 of file diseqc.cpp.

◆ GetChild()

DiSEqCDevDevice* DiSEqCDevRotor::GetChild ( uint  ordinal)
inlineoverridevirtual

Retrieves the nth child of this node.

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

Reimplemented from DiSEqCDevDevice.

Definition at line 341 of file diseqc.h.

◆ RotorTypeToString()

static QString DiSEqCDevRotor::RotorTypeToString ( dvbdev_rotor_t  type)
inlinestatic

Definition at line 345 of file diseqc.h.

Referenced by Store().

◆ RotorTypeFromString()

static dvbdev_rotor_t DiSEqCDevRotor::RotorTypeFromString ( const QString &  type)
inlinestatic

Definition at line 347 of file diseqc.h.

Referenced by Load().

◆ ExecuteRotor()

bool DiSEqCDevRotor::ExecuteRotor ( const DiSEqCDevSettings settings,
const DTVMultiplex tuning,
double  angle 
)
protected

Definition at line 1988 of file diseqc.cpp.

Referenced by Execute().

◆ ExecuteUSALS()

bool DiSEqCDevRotor::ExecuteUSALS ( const DiSEqCDevSettings settings,
const DTVMultiplex tuning,
double  angle 
)
protected

Definition at line 2009 of file diseqc.cpp.

Referenced by Execute().

◆ StartRotorPositionTracking()

void DiSEqCDevRotor::StartRotorPositionTracking ( double  azimuth)
protected

Definition at line 2053 of file diseqc.cpp.

Referenced by ExecuteRotor(), and ExecuteUSALS().

◆ CalculateAzimuth()

double DiSEqCDevRotor::CalculateAzimuth ( double  angle)
staticprotected

Definition at line 2028 of file diseqc.cpp.

Referenced by ExecuteRotor(), and ExecuteUSALS().

◆ GetApproxAzimuth()

double DiSEqCDevRotor::GetApproxAzimuth ( void  ) const
protected

Definition at line 2044 of file diseqc.cpp.

Referenced by StartRotorPositionTracking().

Member Data Documentation

◆ m_type

dvbdev_rotor_t DiSEqCDevRotor::m_type {kTypeDiSEqC_1_3}
private

Definition at line 362 of file diseqc.h.

Referenced by Execute(), GetType(), Load(), SetType(), and Store().

◆ m_speedHi

double DiSEqCDevRotor::m_speedHi {2.5}
private

Definition at line 363 of file diseqc.h.

Referenced by GetHiSpeed(), GetProgress(), Load(), SetHiSpeed(), and Store().

◆ m_speedLo

double DiSEqCDevRotor::m_speedLo {1.9}
private

Definition at line 364 of file diseqc.h.

Referenced by GetLoSpeed(), GetProgress(), Load(), SetLoSpeed(), and Store().

◆ m_posmap

dbl_to_uint_t DiSEqCDevRotor::m_posmap
private

Definition at line 365 of file diseqc.h.

Referenced by ExecuteRotor(), GetPosMap(), Load(), SetPosMap(), and Store().

◆ m_child

DiSEqCDevDevice* DiSEqCDevRotor::m_child {nullptr}
private

◆ m_lastPosition

double DiSEqCDevRotor::m_lastPosition {0.0}
private

Definition at line 369 of file diseqc.h.

Referenced by Execute(), IsCommandNeeded(), and IsMoving().

◆ m_desiredAzimuth

double DiSEqCDevRotor::m_desiredAzimuth {0.0}
private

◆ m_reset

bool DiSEqCDevRotor::m_reset {true}
private

Definition at line 371 of file diseqc.h.

Referenced by Execute(), IsCommandNeeded(), and Reset().

◆ m_moveTime

double DiSEqCDevRotor::m_moveTime {0.0}
mutableprivate

◆ m_lastPosKnown

bool DiSEqCDevRotor::m_lastPosKnown {false}
mutableprivate

Definition at line 375 of file diseqc.h.

Referenced by IsMoving(), IsPositionKnown(), RotationComplete(), and StartRotorPositionTracking().

◆ m_lastAzimuth

double DiSEqCDevRotor::m_lastAzimuth {0.0}
mutableprivate

◆ kRotorTypeTable

const std::vector< DiSEqCDevDevice::TypeTable > DiSEqCDevRotor::kRotorTypeTable
staticprivate
Initial value:
{
{ "diseqc_1_2", kTypeDiSEqC_1_2 },
{ "diseqc_1_3", kTypeDiSEqC_1_3 },
{ nullptr, kTypeDiSEqC_1_3 }
}

Definition at line 379 of file diseqc.h.

Referenced by RotorTypeFromString(), and RotorTypeToString().


The documentation for this class was generated from the following files:
DiSEqCDevRotor::kTypeDiSEqC_1_2
@ kTypeDiSEqC_1_2
Definition: diseqc.h:316
DiSEqCDevRotor::kTypeDiSEqC_1_3
@ kTypeDiSEqC_1_3
Definition: diseqc.h:316