DiSEqCDevRotor Class Reference

#include <diseqc.h>

Inheritance diagram for DiSEqCDevRotor:

DiSEqCDevDevice

List of all members.


Detailed Description

Rotor class.

Definition at line 281 of file diseqc.h.


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]

Member Enumeration Documentation

Enumerator:
kTypeDiSEqC_1_2 
kTypeDiSEqC_1_3 

Definition at line 294 of file diseqc.h.


Constructor & Destructor Documentation

DiSEqCDevRotor::DiSEqCDevRotor ( DiSEqCDevTree tree,
uint  devid 
)

Definition at line 1602 of file diseqc.cpp.

DiSEqCDevRotor::~DiSEqCDevRotor (  ) 

Definition at line 1614 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 1654 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:
settings Configuration chain to apply.
tuning Tuning parameters.
Returns:
True if execution completed successfully.

Implements DiSEqCDevDevice.

Definition at line 1620 of file diseqc.cpp.

bool DiSEqCDevRotor::Load ( void   )  [virtual]

Loads this device from the database.

Returns:
True if successful.

Implements DiSEqCDevDevice.

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

void DiSEqCDevRotor::SetType ( dvbdev_rotor_t  type  )  [inline]

Definition at line 295 of file diseqc.h.

Referenced by convert_diseqc_db().

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

Definition at line 296 of file diseqc.h.

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

Definition at line 297 of file diseqc.h.

void DiSEqCDevRotor::SetPosMap ( const uint_to_dbl_t posmap  ) 

Definition at line 1914 of file diseqc.cpp.

Referenced by RotorPosMap::save().

bool DiSEqCDevRotor::SetChild ( uint  ,
DiSEqCDevDevice  
) [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 from DiSEqCDevDevice.

Definition at line 1680 of file diseqc.cpp.

Referenced by Load().

void DiSEqCDevRotor::RotationComplete ( void   )  const

Definition at line 2005 of file diseqc.cpp.

Referenced by GetProgress().

dvbdev_rotor_t DiSEqCDevRotor::GetType ( void   )  const [inline]

Definition at line 303 of file diseqc.h.

Referenced by DTVDeviceConfigGroup::AddNodes(), and RotorConfig::RotorConfig().

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

Definition at line 304 of file diseqc.h.

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

Definition at line 305 of file diseqc.h.

uint_to_dbl_t DiSEqCDevRotor::GetPosMap ( void   )  const

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

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

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

Reimplemented from DiSEqCDevDevice.

Definition at line 1661 of file diseqc.cpp.

bool DiSEqCDevRotor::IsMoving ( const DiSEqCDevSettings settings  )  const

Definition at line 1700 of file diseqc.cpp.

Referenced by GetVoltage().

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

Retrives the desired voltage for this config.

Parameters:
settings Configuration chain in effect.
tuning Tuning parameters.
Returns:
Voltage required.

Implements DiSEqCDevDevice.

Definition at line 1709 of file diseqc.cpp.

DiSEqCDevDevice * DiSEqCDevRotor::GetSelectedChild ( const DiSEqCDevSettings  )  const [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 from DiSEqCDevDevice.

Definition at line 1675 of file diseqc.cpp.

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

Definition at line 318 of file diseqc.h.

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

Definition at line 321 of file diseqc.h.

Referenced by Store().

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

Definition at line 323 of file diseqc.h.

Referenced by Load().

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

Definition at line 1923 of file diseqc.cpp.

Referenced by Execute().

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

Definition at line 1942 of file diseqc.cpp.

Referenced by Execute().

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

Definition at line 1991 of file diseqc.cpp.

Referenced by ExecuteRotor(), and ExecuteUSALS().

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

Definition at line 1960 of file diseqc.cpp.

Referenced by ExecuteRotor(), and ExecuteUSALS().

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

Definition at line 1982 of file diseqc.cpp.

Referenced by StartRotorPositionTracking().


Member Data Documentation

Definition at line 338 of file diseqc.h.

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

double DiSEqCDevRotor::m_speed_hi [private]

Definition at line 339 of file diseqc.h.

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

double DiSEqCDevRotor::m_speed_lo [private]

Definition at line 340 of file diseqc.h.

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

Definition at line 341 of file diseqc.h.

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

Definition at line 345 of file diseqc.h.

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

Definition at line 347 of file diseqc.h.

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

double DiSEqCDevRotor::m_move_time [mutable, private]

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

Referenced by RotorTypeFromString(), and RotorTypeToString().


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