MythTV  master
diseqcsettings.h
Go to the documentation of this file.
1 /*
2  * \file diseqcsettings.h
3  * \brief DVB-S Device Tree Configuration Classes.
4  * \author Copyright (C) 2006, Yeasah Pell
5  */
6 
7 #ifndef _DISEQCSETTINGS_H_
8 #define _DISEQCSETTINGS_H_
9 
10 #include "diseqc.h"
11 #include "standardsettings.h"
12 
13 typedef QMap<uint, StandardSetting*> devid_to_setting_t;
14 
15 class SwitchTypeSetting;
16 class SwitchPortsSetting;
18 class DeviceDescrSetting;
19 
21 {
22  Q_OBJECT
23 
24  public:
25  bool keyPressEvent(QKeyEvent *) override; // StandardSetting
27  StandardSetting *parent);
28 
29  signals:
30  void DeleteClicked(void);
31 };
32 
34 {
35  Q_OBJECT
36 
37  public:
38  SwitchConfig(DiSEqCDevSwitch &switch_dev, StandardSetting *parent);
39  void Load(void) override; // StandardSetting
40 
41  public slots:
42  void update(void);
43 
44  private:
49 };
50 
51 class RotorPosMap : public GroupSetting
52 {
53  Q_OBJECT
54 
55  public:
56  explicit RotorPosMap(DiSEqCDevRotor &rotor) :
57  m_rotor(rotor) { }
58 
59  void Load(void) override; // StandardSetting
60  void Save(void) override; // StandardSetting
61 
62  private slots:
64 
65  protected:
66  void PopulateList(void);
67 
68  private:
71 };
72 
74 {
75  Q_OBJECT
76 
77  public:
78  void Load() override; // StandardSetting
80 
81  public slots:
82  void SetType(const QString &type);
83 
84  private:
86  RotorPosMap *m_pos {nullptr};
87 };
88 
90 {
91  Q_OBJECT
92 
93  public:
94  SCRConfig(DiSEqCDevSCR &scr, StandardSetting* parent);
95 
96  private:
98 };
99 
100 class LNBTypeSetting;
101 class LNBLOFSwitchSetting;
102 class LNBLOFLowSetting;
103 class LNBLOFHighSetting;
105 class LNBPresetSetting;
106 
108 {
109  Q_OBJECT
110 
111  public:
112  LNBConfig(DiSEqCDevLNB &lnb, StandardSetting *parent);
113  void Load(void) override; // StandardSetting
114 
115  public slots:
116  void SetPreset(const QString &value);
117  void UpdateType(void);
118 
119  private:
121  LNBTypeSetting *m_type {nullptr};
126 };
127 
128 class DeviceTypeSetting;
129 
130 class DeviceTree : public GroupSetting
131 {
132  Q_OBJECT
133 
134  public:
135  explicit DeviceTree(DiSEqCDevTree &tree) :
136  m_tree(tree) { }
137  void DeleteDevice(DeviceTypeSetting *devtype);
138 
139  void Load(void) override; // StandardSetting
140 
141  protected:
142  void PopulateTree(void);
143  void PopulateTree(DiSEqCDevDevice *node,
144  DiSEqCDevDevice *parent = nullptr,
145  uint childnum = 0,
146  GroupSetting *parentSetting = nullptr);
147  void PopulateChildren(DiSEqCDevDevice *node, GroupSetting *parentSetting);
149  DiSEqCDevDevice *parent,
150  uint childnum,
151  GroupSetting *parentSetting);
153  DiSEqCDevDevice *parent,
154  uint childnum);
155  void ValueChanged(const QString &value,
156  DeviceTypeSetting *devtype,
157  DiSEqCDevDevice *parent,
158  uint childnum);
159 
160  private:
162 };
163 
165 {
166  public:
167  DTVDeviceConfigGroup(DiSEqCDevSettings &settings, uint cardid,
168  bool switches_enabled);
169  ~DTVDeviceConfigGroup(void) = default;
170 
171  protected:
172  void AddNodes(StandardSetting *group, const QString &trigger,
173  DiSEqCDevDevice *node);
174 
175  void AddChild(StandardSetting *group, const QString &trigger,
176  StandardSetting *setting);
177 
178  private:
183 };
184 
185 #endif // _DISEQCSETTINGS_H_
186 
DTVDeviceConfigGroup(DiSEqCDevSettings &settings, uint cardid, bool switches_enabled)
LNBConfig(DiSEqCDevLNB &lnb, StandardSetting *parent)
LNBLOFLowSetting * m_lof_lo
unsigned int slots[4]
Definition: element.c:38
DVB-S device settings class.
Definition: diseqc.h:35
LNBPresetSetting * m_preset
RotorPosMap * m_pos
LNBLOFSwitchSetting * m_lof_switch
DiSEqCDevSCR & m_scr
void update(void)
QMap< uint, StandardSetting * > devid_to_setting_t
void ConnectToValueChanged(DeviceTypeSetting *devtype, DiSEqCDevDevice *parent, uint childnum)
unsigned int uint
Definition: compat.h:140
void valueChanged(StandardSetting *)
RotorConfig(DiSEqCDevRotor &rotor, StandardSetting *parent)
void Save(void) override
void UpdateType(void)
LNBLOFHighSetting * m_lof_hi
SwitchConfig(DiSEqCDevSwitch &switch_dev, StandardSetting *parent)
bool keyPressEvent(QKeyEvent *) override
devid_to_setting_t m_devs
Represents a node in a DVB-S device network.
Definition: diseqc.h:133
QMap< uint, double > uint_to_dbl_t
Definition: diseqc.h:28
SwitchTypeSetting * m_type
void DeleteClicked(void)
RotorPosMap(DiSEqCDevRotor &rotor)
void Load(void) override
void AddNodes(StandardSetting *group, const QString &trigger, DiSEqCDevDevice *node)
Rotor class.
Definition: diseqc.h:293
SwitchPortsSetting * m_ports
void AddChild(StandardSetting *group, const QString &trigger, StandardSetting *setting)
void SetPreset(const QString &value)
~DTVDeviceConfigGroup(void)=default
LNBPolarityInvertedSetting * m_pol_inv
void Load(void) override
void AddDeviceTypeSetting(DeviceTypeSetting *devtype, DiSEqCDevDevice *parent, uint childnum, GroupSetting *parentSetting)
void PopulateList(void)
DiSEqCDevRotor & m_rotor
static DiseqcConfigBase * CreateByType(DiSEqCDevDevice *dev, StandardSetting *parent)
Unicable / SCR Class.
Definition: diseqc.h:373
void DeleteDevice(DeviceTypeSetting *devtype)
void PopulateChildren(DiSEqCDevDevice *node, GroupSetting *parentSetting)
SwitchAddressSetting * m_address
LNB Class.
Definition: diseqc.h:438
void PopulateTree(void)
uint_to_dbl_t m_posmap
DiSEqCDevRotor & m_rotor
void Load(void) override
void Load() override
void SetType(const QString &type)
LNBTypeSetting * m_type
DiSEqCDevTree m_tree
DeviceDescrSetting * m_deviceDescr
DVB-S device tree class.
Definition: diseqc.h:73
Switch class, including tone, legacy and DiSEqC switches.
Definition: diseqc.h:215
DiSEqCDevSettings & m_settings
SCRConfig(DiSEqCDevSCR &scr, StandardSetting *parent)
void ValueChanged(const QString &value, DeviceTypeSetting *devtype, DiSEqCDevDevice *parent, uint childnum)
DiSEqCDevTree & m_tree
DeviceTree(DiSEqCDevTree &tree)
void Load(void) override