Go to the documentation of this file.
80 bool Load(
const QString &device);
82 bool Store(
uint cardid,
const QString &device =
"");
107 void Open(
int fd_frontend,
bool is_SCR);
124 static bool Exists(
int cardid);
149 virtual bool Load(
void) = 0;
150 virtual bool Store(
void)
const = 0;
180 const {
return false; }
230 void Reset(
void)
override;
233 bool Load(
void)
override;
234 bool Store(
void)
const override;
310 void Reset(
void)
override;
312 bool Load(
void)
override;
313 bool Store(
void)
const override;
390 void Reset(
void)
override;
393 bool Load(
void)
override;
394 bool Store(
void)
const override;
454 bool Load(
void)
override;
455 bool Store(
void)
const override;
static QString SwitchTypeToString(dvbdev_switch_t type)
std::vector< DiSEqCDevDevice * > dvbdev_vec_t
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.
virtual uint GetChildCount(void) const
Retrieves the proper number of children for this node.
static dvbdev_pos_t SCRPositionFromString(const QString &pos)
Main DVB-S device interface.
bool Store(void) const override
bool IsInNeedOfConf(void) const
static dvbdev_switch_t SwitchTypeFromString(const QString &type)
DiSEqCDevDevice * FindDevice(uint dev_id)
uint GetLOFLow(void) const
uint32_t GetIntermediateFrequency(uint32_t frequency) const
static const TypeTableVec kSwitchTypeTable
double GetValue(uint devid) const
Retrieves a value from this configuration chain by device id.
~DiSEqCDevRotor() override
@ kTypeVoltageAndToneControl
static dvbdev_lnb_t LNBTypeFromString(const QString &type)
void SetLOFHigh(uint lof_hi)
dvbdev_rotor_t GetType(void) const
void SetDeviceID(uint devid) const
uint GetVoltage(const DiSEqCDevSettings &settings, const DTVMultiplex &tuning) const override
Retrives the desired voltage for this config.
std::vector< uint > m_delete
bool SetChild(uint ordinal, DiSEqCDevDevice *device) override
Changes the nth child of this node.
static const TypeTableVec kLNBTypeTable
bool SendCommand(uint adr, uint cmd, uint repeats, cmd_vec_t &data) const
void SetUserBand(uint userband)
dvbdev_lnb_t GetType(void) const
void SetValue(uint devid, double value)
Sets a value for this configuration chain by device id.
static const std::array< const uint32_t, 4 > freq
QString GetDescription(void) const
bool SendCommand(uint cmd, uint repeats, cmd_vec_t &data) const
bool Execute(const DiSEqCDevSettings &settings, const DTVMultiplex &tuning)
Applies settings to the entire tree.
void SetLOFSwitch(uint lof_switch)
static QString RotorTypeToString(dvbdev_rotor_t type)
DiSEqCDevDevice * GetChild(uint ordinal) override
Retrieves the nth child of this node.
DiSEqCDevLNB(DiSEqCDevTree &tree, uint devid)
void SetPosMap(const uint_to_dbl_t &posmap)
bool SetTone(bool on) const
bool Execute(const DiSEqCDevSettings &, const DTVMultiplex &) override
Applies DiSEqC settings to this node and any children.
DiSEqCDevDevice * m_child
Static-scoped locked tree list class.
static const TypeTableVec kRotorTypeTable
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.
Represents a node in a DVB-S device network.
virtual uint GetVoltage(const DiSEqCDevSettings &, const DTVMultiplex &) const =0
Retrives the desired voltage for this config.
virtual bool SetChild(uint, DiSEqCDevDevice *)
Changes the nth child of this node.
bool Load(uint card_input_id)
Loads configuration chain from DB for specified card input id.
void Reset(void) override
Resets to the last known settings for this device.
bool Store(void) const override
int GetPosition(const DiSEqCDevSettings &settings) const
void SetFrequency(uint freq)
static QString DevTypeToString(dvbdev_t type)
DiSEqCDevSCR(DiSEqCDevTree &tree, uint devid)
static bool Exists(int cardid)
Check if a Diseqc device tree exists.
bool SetChild(uint ordinal, DiSEqCDevDevice *device) override
Changes the nth child of this node.
void Open(int fd_frontend, bool is_SCR)
Retrieve device tree.
uint m_inputId
current input id
DiSEqCDevDevice * GetParent(void) const
virtual void Reset(void)
Resets to the last known settings for this device.
bool ExecuteTone(const DiSEqCDevSettings &settings, const DTVMultiplex &tuning, uint pos)
bool ExecuteRotor(const DiSEqCDevSettings &settings, const DTVMultiplex &tuning, double angle)
DVB-S device settings class.
static const uint kFirstFakeDiSEqCID
dvbdev_t GetDeviceType(void) const
void SetHiSpeed(double speed)
double GetProgress(void) const
Returns an indication of rotor progress.
std::vector< uint8_t > cmd_vec_t
uint GetRepeatCount(void) const
uint GetFrequency(void) const
static double CalculateAzimuth(double angle)
uint GetChildCount(void) const override
Retrieves the proper number of children for this node.
void SetType(dvbdev_lnb_t type)
static QString TableToString(uint type, const TypeTableVec &table)
bool IsPolarityInverted(void) const
bool Store(void) const override
static const TypeTableVec kSCRPositionTable
uint m_previousFakeDiseqcid
bool ApplyVoltage(const DiSEqCDevSettings &settings, const DTVMultiplex &tuning)
uint GetAddress(void) const
bool m_polInv
If a signal is circularly polarized the polarity will flip on each reflection, so antenna systems wit...
bool ExecuteMiniDiSEqC(const DiSEqCDevSettings &settings, const DTVMultiplex &tuning, uint pos)
bool Store(void) const override
static uint TableFromString(const QString &type, const TypeTableVec &table)
bool SetVoltage(uint voltage)
void SetDeviceType(dvbdev_t type)
bool Load(void) override
Loads this device from the database.
static bool IsFakeDiSEqCID(uint id)
std::vector< TypeTable > TypeTableVec
virtual bool Load(void)=0
Loads this device from the database.
bool IsPositionKnown(void) const
Returns true if there is reasonable confidence in the value returned by GetProgress().
uint CreateFakeDiSEqCID(void)
DiSEqCDevRotor(DiSEqCDevTree &tree, uint devid)
QMap< uint, double > uint_to_dbl_t
void SetOrdinal(uint ordinal)
bool Execute(const DiSEqCDevSettings &settings, const DTVMultiplex &tuning) override
Applies DiSEqC settings to this node and any children.
static dvbdev_rotor_t RotorTypeFromString(const QString &type)
void RotationComplete(void) const
bool Load(const QString &device)
Loads the device tree from the database.
void SetParent(DiSEqCDevDevice *parent)
bool ExecuteLegacy(const DiSEqCDevSettings &settings, const DTVMultiplex &tuning, uint pos)
void SetRoot(DiSEqCDevDevice *root)
Changes the root node of the tree.
DiSEqCDevDevice * GetSelectedChild(const DiSEqCDevSettings &setting) const override
Retrieves the selected child for this configuration, if any.
virtual DiSEqCDevDevice * GetChild(uint)
Retrieves the nth child of this node.
bool Load(void) override
Loads this device from the database.
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.
void SetPolarityInverted(bool inv)
DiSEqCDevDevice * GetSelectedChild(const DiSEqCDevSettings &settings) const override
Retrieves the selected child for this configuration, if any.
bool IsHorizontal(const DTVMultiplex &tuning) const
Determine if horizontal polarity is active (for switchable LNBs).
bool Execute(const DiSEqCDevSettings &settings, const DTVMultiplex &tuning) override
Applies DiSEqC settings to this node and any children.
DiSEqCDevDevice * m_parent
uint_to_dbl_t GetPosMap(void) const
uint GetUserBand(void) const
bool ExecuteVoltage(const DiSEqCDevSettings &settings, const DTVMultiplex &tuning, uint pos)
bool Execute(const DiSEqCDevSettings &settings, const DTVMultiplex &tuning) override
Applies DiSEqC settings to this node and any children.
uint GetChildCount(void) const override
Retrieves the proper number of children for this node.
static DiSEqCDevTree * FindTree(uint cardid)
Retrieve device tree.
DiSEqCDevDevice * Root(void)
Retrieves the root node in the tree.
uint GetOrdinal(void) const
static DiSEqCDevTrees s_trees
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.
static DiSEqCDevDevice * CreateByType(DiSEqCDevTree &tree, dvbdev_t type, uint dev_id=0)
bool SetChild(uint ordinal, DiSEqCDevDevice *device) override
Changes the nth child of this node.
DiSEqCDevDevice * FindDevice(uint dev_id)
Returns a device by ID.
uint GetLOFSwitch(void) const
uint GetLOFHigh(void) const
QMap< uint, DiSEqCDevTree * > cardid_to_diseqc_tree_t
bool PowerOff(void) const
void SetRepeatCount(uint repeat)
bool Load(void) override
Loads this device from the database.
DiSEqCDevLNB * FindLNB(const DiSEqCDevSettings &settings)
Returns the LNB device object selected by the configuration chain.
static QString LNBTypeToString(dvbdev_lnb_t type)
void StartRotorPositionTracking(double azimuth)
bool ExecuteUSALS(const DiSEqCDevSettings &settings, const DTVMultiplex &tuning, double angle)
dvbdev_switch_t GetType(void) const
DiSEqCDevSettings()=default
bool SendCommand(uint adr, uint cmd, uint repeats=0) const
void SetNumPorts(uint num_ports)
bool Store(uint card_input_id) const
Stores configuration chain to DB for specified card input id.
static void InvalidateTrees(void)
Invalidate cached trees.
bool ResetDiseqc(bool hard_reset, bool is_SCR)
Resets the DiSEqC bus.
virtual ~DiSEqCDevDevice()
static const TypeTableVec kDvbdevLookup
void SetAddress(uint address)
DiSEqCDevRotor * FindRotor(const DiSEqCDevSettings &settings, uint index=0)
Returns the nth rotor device object in the tree.
uint GetVoltage(const DiSEqCDevSettings &settings, const DTVMultiplex &tuning) const override
Retrives the desired voltage for this config.
DiSEqCDevDevice * GetSelectedChild(const DiSEqCDevSettings &) const override
Retrieves the selected child for this configuration, if any.
static DiSEqCDevDevice * CreateById(DiSEqCDevTree &tree, uint devid)
uint GetChildCount(void) const override
Retrieves the proper number of children for this node.
DiSEqCDevDevice * m_child
static QString SCRPositionToString(dvbdev_pos_t pos)
static dvbdev_t DevTypeFromString(const QString &type)
~DiSEqCDevSwitch() override
void SetType(dvbdev_switch_t type)
DiSEqCDevSCR * FindSCR(const DiSEqCDevSettings &settings)
Returns the SCR device object selected by the configuration chain.
bool IsRealDeviceID(void) const
bool ExecuteDiseqc(const DiSEqCDevSettings &settings, const DTVMultiplex &tuning, uint pos)
void Reset(void) override
Resets to the last known settings for this device.
double GetApproxAzimuth(void) const
bool IsMoving(const DiSEqCDevSettings &settings) const
bool Load(void) override
Loads this device from the database.
DVB-S device tree class. Represents a tree of DVB-S devices.
void SetLoSpeed(double speed)
virtual bool Store(void) const =0
void SetDescription(const QString &desc)
DiSEqCDevDevice(DiSEqCDevTree &tree, uint devid)
bool IsHighBand(const DTVMultiplex &tuning) const
Determine if the high frequency band is active (for switchable LNBs).
double GetHiSpeed(void) const
bool Store(uint cardid, const QString &device="")
Stores the device tree to the database.
DiSEqCDevTree * FindTree(uint cardid)
Retrieve device tree.
uint GetDeviceID(void) const
DiSEqCDevSwitch(DiSEqCDevTree &tree, uint devid)
void Reset(void) override
Resets to the last known settings for this device.
uint GetVoltage(void) const
virtual DiSEqCDevDevice * GetSelectedChild(const DiSEqCDevSettings &) const
Retrieves the selected child for this configuration, if any.
virtual bool Execute(const DiSEqCDevSettings &, const DTVMultiplex &)=0
Applies DiSEqC settings to this node and any children.
DiSEqCDevDevice * GetChild(uint) override
Retrieves the nth child of this node.
double GetLoSpeed(void) const
cardid_to_diseqc_tree_t m_trees
void InvalidateTrees(void)
Invalidate cached trees.
QMap< double, uint > dbl_to_uint_t
uint GetVoltage(const DiSEqCDevSettings &settings, const DTVMultiplex &tuning) const override
Retrives the desired voltage for this config.
DiSEqCDevDevice * GetChild(uint) override
Retrieves the nth child of this node.
uint GetVoltage(const DiSEqCDevSettings &settings, const DTVMultiplex &tuning) const override
Retrives the desired voltage for this config.
void Reset(void)
Reset state of nodes in tree, forcing updates on the next Execute command.
void SetType(dvbdev_rotor_t type)
void SetLOFLow(uint lof_lo)
uint32_t GetIntermediateFrequency(const DiSEqCDevSettings &settings, const DTVMultiplex &tuning) const
Calculate proper intermediate frequency for the given settings and tuning parameters.
void AddDeferredDelete(uint dev_id)
uint GetNumPorts(void) const
Switch class, including tone, legacy and DiSEqC switches.
bool ShouldSwitch(const DiSEqCDevSettings &settings, const DTVMultiplex &tuning) const