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

Rotor class. More...

#include <diseqc.h>

Inheritance diagram for DiSEqCDevRotor:
DiSEqCDevDevice

List of all members.

Public Types

enum  dvbdev_rotor_t { kTypeDiSEqC_1_2 = 0, kTypeDiSEqC_1_3 = 1 }

Public Member Functions

 DiSEqCDevRotor (DiSEqCDevTree &tree, uint devid)
 ~DiSEqCDevRotor ()
virtual void Reset (void)
 Resets to the last known settings for this device.
virtual bool Execute (const DiSEqCDevSettings &, const DTVMultiplex &)
 Applies DiSEqC settings to this node and any children.
virtual bool Load (void)
 Loads this device from the database.
virtual bool Store (void) const
 Stores this device to the database.
void SetType (dvbdev_rotor_t type)
void SetLoSpeed (double speed)
void SetHiSpeed (double speed)
void SetPosMap (const uint_to_dbl_t &posmap)
virtual bool SetChild (uint ordinal, DiSEqCDevDevice *device)
 Changes the nth child of this node.
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.
bool IsPositionKnown (void) const
 Returns true if there is reasonable confidence in the value returned by GetProgress().
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.
bool IsMoving (const DiSEqCDevSettings &) const
virtual uint GetVoltage (const DiSEqCDevSettings &, const DTVMultiplex &) const
 Retrives the desired voltage for this config.
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 RotorTypeToString (dvbdev_rotor_t type)
static dvbdev_rotor_t RotorTypeFromString (const QString &type)

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

Private Attributes

dvbdev_rotor_t m_type
double m_speed_hi
double m_speed_lo
dbl_to_uint_t m_posmap
DiSEqCDevDevicem_child
double m_last_position
double m_desired_azimuth
bool m_reset
double m_move_time
bool m_last_pos_known
double m_last_azimuth

Static Private Attributes

static const TypeTable RotorTypeTable [3]

Detailed Description

Rotor class.

Definition at line 285 of file diseqc.h.


Member Enumeration Documentation

Enumerator:
kTypeDiSEqC_1_2 
kTypeDiSEqC_1_3 

Definition at line 298 of file diseqc.h.


Constructor & Destructor Documentation

Definition at line 1646 of file diseqc.cpp.

Definition at line 1658 of file diseqc.cpp.


Member Function Documentation

void DiSEqCDevRotor::Reset ( void  ) [virtual]

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 1701 of file diseqc.cpp.

Referenced by DiSEqCDevRotor().

bool DiSEqCDevRotor::Execute ( const DiSEqCDevSettings ,
const DTVMultiplex  
) [virtual]

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 1664 of file diseqc.cpp.

bool DiSEqCDevRotor::Load ( void  ) [virtual]

Loads this device from the database.

Returns:
True if successful.

Implements DiSEqCDevDevice.

Definition at line 1773 of file diseqc.cpp.

bool DiSEqCDevRotor::Store ( void  ) const [virtual]

Stores this device to the database.

Returns:
True if successful.

Implements DiSEqCDevDevice.

Definition at line 1836 of file diseqc.cpp.

Definition at line 299 of file diseqc.h.

Referenced by convert_diseqc_db(), and RotorTypeSetting::Save().

void DiSEqCDevRotor::SetLoSpeed ( double  speed) [inline]

Definition at line 300 of file diseqc.h.

Referenced by RotorLoSpeedSetting::Save().

void DiSEqCDevRotor::SetHiSpeed ( double  speed) [inline]

Definition at line 301 of file diseqc.h.

Referenced by RotorHiSpeedSetting::Save().

Definition at line 1962 of file diseqc.cpp.

Referenced by RotorPosMap::Save().

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

Definition at line 1727 of file diseqc.cpp.

Referenced by Load().

Definition at line 2047 of file diseqc.cpp.

Referenced by GetProgress().

double DiSEqCDevRotor::GetLoSpeed ( void  ) const [inline]

Definition at line 308 of file diseqc.h.

Referenced by RotorLoSpeedSetting::Load().

double DiSEqCDevRotor::GetHiSpeed ( void  ) const [inline]

Definition at line 309 of file diseqc.h.

Referenced by RotorHiSpeedSetting::Load().

Definition at line 1952 of file diseqc.cpp.

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

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 1917 of file diseqc.cpp.

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

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 1947 of file diseqc.cpp.

virtual uint DiSEqCDevRotor::GetChildCount ( void  ) const [inline, virtual]

Retrieves the proper number of children for this node.

Returns:
Number of children

Reimplemented from DiSEqCDevDevice.

Definition at line 313 of file diseqc.h.

bool DiSEqCDevRotor::IsCommandNeeded ( const DiSEqCDevSettings settings,
const DTVMultiplex tuning 
) const [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 from DiSEqCDevDevice.

Definition at line 1708 of file diseqc.cpp.

bool DiSEqCDevRotor::IsMoving ( const DiSEqCDevSettings settings) const

Definition at line 1747 of file diseqc.cpp.

Referenced by GetVoltage().

uint DiSEqCDevRotor::GetVoltage ( const DiSEqCDevSettings ,
const DTVMultiplex  
) const [virtual]

Retrives the desired voltage for this config.

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

Implements DiSEqCDevDevice.

Definition at line 1756 of file diseqc.cpp.

Retrieves the selected child for this configuration, if any.

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

Reimplemented from DiSEqCDevDevice.

Definition at line 1722 of file diseqc.cpp.

virtual DiSEqCDevDevice* DiSEqCDevRotor::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 from DiSEqCDevDevice.

Definition at line 322 of file diseqc.h.

static QString DiSEqCDevRotor::RotorTypeToString ( dvbdev_rotor_t  type) [inline, static]

Definition at line 325 of file diseqc.h.

Referenced by Store().

static dvbdev_rotor_t DiSEqCDevRotor::RotorTypeFromString ( const QString &  type) [inline, static]

Definition at line 327 of file diseqc.h.

Referenced by Load().

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

Definition at line 1971 of file diseqc.cpp.

Referenced by Execute().

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

Definition at line 1990 of file diseqc.cpp.

Referenced by Execute().

void DiSEqCDevRotor::StartRotorPositionTracking ( double  azimuth) [protected]

Definition at line 2033 of file diseqc.cpp.

Referenced by ExecuteRotor(), and ExecuteUSALS().

double DiSEqCDevRotor::CalculateAzimuth ( double  angle) const [protected]

Definition at line 2008 of file diseqc.cpp.

Referenced by ExecuteRotor(), and ExecuteUSALS().

double DiSEqCDevRotor::GetApproxAzimuth ( void  ) const [protected]

Definition at line 2024 of file diseqc.cpp.

Referenced by StartRotorPositionTracking().


Member Data Documentation

Definition at line 342 of file diseqc.h.

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

double DiSEqCDevRotor::m_speed_hi [private]

Definition at line 343 of file diseqc.h.

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

double DiSEqCDevRotor::m_speed_lo [private]

Definition at line 344 of file diseqc.h.

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

Definition at line 345 of file diseqc.h.

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

Definition at line 349 of file diseqc.h.

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

Definition at line 351 of file diseqc.h.

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

double DiSEqCDevRotor::m_move_time [mutable, private]

Definition at line 355 of file diseqc.h.

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

double DiSEqCDevRotor::m_last_azimuth [mutable, private]
Initial value:
{
    { "diseqc_1_2", kTypeDiSEqC_1_2 },
    { "diseqc_1_3", kTypeDiSEqC_1_3 },
    { NULL, kTypeDiSEqC_1_3 }
}

Definition at line 359 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