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