MythTV  master
Public Types | Public Member Functions | Static Public Member Functions | 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 ()
 
void Reset (void) override
 Resets to the last known settings for this device. More...
 
bool Execute (const DiSEqCDevSettings &, const DTVMultiplex &) 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
 Stores this device to the database. More...
 
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 &, const DTVMultiplex &) const override
 Determines if this device or any child will be sending a command for the given configuration chain. More...
 
bool IsMoving (const DiSEqCDevSettings &) const
 
uint GetVoltage (const DiSEqCDevSettings &, const DTVMultiplex &) const override
 Retrives the desired voltage for this config. More...
 
DiSEqCDevDeviceGetSelectedChild (const DiSEqCDevSettings &) 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)
 Returns a device by ID. More...
 

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 &, const DTVMultiplex &, double angle)
 
bool ExecuteUSALS (const DiSEqCDevSettings &, const DTVMultiplex &, double angle)
 
void StartRotorPositionTracking (double azimuth)
 
double CalculateAzimuth (double angle) const
 
double GetApproxAzimuth (void) const
 
- Protected Member Functions inherited from DiSEqCDevDevice
void SetDeviceID (uint devid) const
 

Private Attributes

dvbdev_rotor_t m_type {kTypeDiSEqC_1_3}
 
double m_speed_hi {2.5}
 
double m_speed_lo {1.9}
 
dbl_to_uint_t m_posmap
 
DiSEqCDevDevicem_child {nullptr}
 
double m_last_position {0.0}
 
double m_desired_azimuth {0.0}
 
bool m_reset {true}
 
double m_move_time {0.0}
 
bool m_last_pos_known {false}
 
double m_last_azimuth {0.0}
 

Static Private Attributes

static const TypeTable RotorTypeTable [3]
 

Additional Inherited Members

- Static Protected Member Functions inherited from DiSEqCDevDevice
static QString TableToString (uint type, const TypeTable *table)
 
static uint TableFromString (const QString &type, const TypeTable *table)
 
- Protected Attributes inherited from DiSEqCDevDevice
uint m_devid
 
dvbdev_t m_dev_type {kTypeLNB}
 
QString m_desc
 
DiSEqCDevTreem_tree
 
DiSEqCDevDevicem_parent {nullptr}
 
uint m_ordinal {0}
 
uint m_repeat {1}
 

Detailed Description

Rotor class.

Definition at line 293 of file diseqc.h.

Member Enumeration Documentation

◆ dvbdev_rotor_t

Enumerator
kTypeDiSEqC_1_2 
kTypeDiSEqC_1_3 

Definition at line 307 of file diseqc.h.

Constructor & Destructor Documentation

◆ DiSEqCDevRotor()

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

Definition at line 296 of file diseqc.h.

◆ ~DiSEqCDevRotor()

DiSEqCDevRotor::~DiSEqCDevRotor ( )

Definition at line 1715 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 1757 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 1720 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 1828 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 1891 of file diseqc.cpp.

◆ SetType()

void DiSEqCDevRotor::SetType ( dvbdev_rotor_t  type)
inline

Definition at line 308 of file diseqc.h.

Referenced by RotorTypeSetting::Save().

◆ SetLoSpeed()

void DiSEqCDevRotor::SetLoSpeed ( double  speed)
inline

Definition at line 309 of file diseqc.h.

Referenced by RotorLoSpeedSetting::Save().

◆ SetHiSpeed()

void DiSEqCDevRotor::SetHiSpeed ( double  speed)
inline

Definition at line 310 of file diseqc.h.

Referenced by RotorHiSpeedSetting::Save().

◆ SetPosMap()

void DiSEqCDevRotor::SetPosMap ( const uint_to_dbl_t posmap)

Definition at line 2017 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 1783 of file diseqc.cpp.

Referenced by Load().

◆ RotationComplete()

void DiSEqCDevRotor::RotationComplete ( void  ) const

Definition at line 2104 of file diseqc.cpp.

Referenced by GetProgress().

◆ GetType()

dvbdev_rotor_t DiSEqCDevRotor::GetType ( void  ) const
inline

◆ GetLoSpeed()

double DiSEqCDevRotor::GetLoSpeed ( void  ) const
inline

Definition at line 317 of file diseqc.h.

Referenced by RotorLoSpeedSetting::Load().

◆ GetHiSpeed()

double DiSEqCDevRotor::GetHiSpeed ( void  ) const
inline

Definition at line 318 of file diseqc.h.

Referenced by RotorHiSpeedSetting::Load().

◆ GetPosMap()

uint_to_dbl_t DiSEqCDevRotor::GetPosMap ( void  ) const

Definition at line 2007 of file diseqc.cpp.

Referenced by RotorPosMap::Load(), and RotorSetting::RotorSetting().

◆ 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 1972 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 2002 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 322 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 1764 of file diseqc.cpp.

◆ IsMoving()

bool DiSEqCDevRotor::IsMoving ( const DiSEqCDevSettings settings) const

Definition at line 1802 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 1811 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 1778 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 332 of file diseqc.h.

◆ RotorTypeToString()

static QString DiSEqCDevRotor::RotorTypeToString ( dvbdev_rotor_t  type)
inlinestatic

Definition at line 336 of file diseqc.h.

Referenced by Store().

◆ RotorTypeFromString()

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

Definition at line 338 of file diseqc.h.

Referenced by Load().

◆ ExecuteRotor()

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

Definition at line 2026 of file diseqc.cpp.

Referenced by Execute().

◆ ExecuteUSALS()

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

Definition at line 2046 of file diseqc.cpp.

Referenced by Execute().

◆ StartRotorPositionTracking()

void DiSEqCDevRotor::StartRotorPositionTracking ( double  azimuth)
protected

Definition at line 2090 of file diseqc.cpp.

Referenced by ExecuteRotor(), and ExecuteUSALS().

◆ CalculateAzimuth()

double DiSEqCDevRotor::CalculateAzimuth ( double  angle) const
protected

Definition at line 2065 of file diseqc.cpp.

Referenced by ExecuteRotor(), and ExecuteUSALS().

◆ GetApproxAzimuth()

double DiSEqCDevRotor::GetApproxAzimuth ( void  ) const
protected

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

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

◆ m_speed_hi

double DiSEqCDevRotor::m_speed_hi {2.5}
private

Definition at line 354 of file diseqc.h.

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

◆ m_speed_lo

double DiSEqCDevRotor::m_speed_lo {1.9}
private

Definition at line 355 of file diseqc.h.

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

◆ m_posmap

dbl_to_uint_t DiSEqCDevRotor::m_posmap
private

Definition at line 356 of file diseqc.h.

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

◆ m_child

DiSEqCDevDevice* DiSEqCDevRotor::m_child {nullptr}
private

◆ m_last_position

double DiSEqCDevRotor::m_last_position {0.0}
private

Definition at line 360 of file diseqc.h.

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

◆ m_desired_azimuth

double DiSEqCDevRotor::m_desired_azimuth {0.0}
private

◆ m_reset

bool DiSEqCDevRotor::m_reset {true}
private

Definition at line 362 of file diseqc.h.

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

◆ m_move_time

double DiSEqCDevRotor::m_move_time {0.0}
mutableprivate

◆ m_last_pos_known

bool DiSEqCDevRotor::m_last_pos_known {false}
mutableprivate

Definition at line 366 of file diseqc.h.

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

◆ m_last_azimuth

double DiSEqCDevRotor::m_last_azimuth {0.0}
mutableprivate

◆ RotorTypeTable

const DiSEqCDevDevice::TypeTable DiSEqCDevRotor::RotorTypeTable
staticprivate
Initial value:
=
{
{ "diseqc_1_2", kTypeDiSEqC_1_2 },
{ "diseqc_1_3", kTypeDiSEqC_1_3 },
{ nullptr, kTypeDiSEqC_1_3 }
}

Definition at line 370 of file diseqc.h.


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