Go to the documentation of this file.
21 gc->setLabel(
"Latitude");
23 DeviceTree::tr(
"The Cartesian latitude for your location. "
24 "Use negative numbers for southern coordinates."));
31 gc->setLabel(
"Longitude");
33 DeviceTree::tr(
"The Cartesian longitude for your location. "
34 "Use negative numbers for western coordinates."));
45 setLabel(DeviceTree::tr(
"Device Type"));
47 QString::number((
uint) 0xFFFF));
96 setLabel(DeviceTree::tr(
"Description"));
97 QString
help = DeviceTree::tr(
98 "Optional descriptive name for this device, to "
99 "make it easier to configure settings later.");
127 setLabel(DeviceTree::tr(
"Repeat Count"));
128 QString
help = DeviceTree::tr(
129 "Number of repeat (command with repeat flag ON) or resend (the same command) DiSEqC commands. "
130 "If value is higher than 10, command will be resend N-10 times. "
131 "If value is lower than 10, command will be repeated N times. "
132 "Repeat useful for unreliable DiSEqC equipment; resend useful when unreliable DiSEqC equipment has broken/unsupported repeat flag support.");
159 setLabel(DeviceTree::tr(
"Switch Type"));
160 setHelpText(DeviceTree::tr(
"Select the type of switch from the list."));
169 QString::number((
uint)
172 QString::number((
uint)
206 setLabel(DeviceTree::tr(
"Address of switch"));
207 setHelpText(DeviceTree::tr(
"The DiSEqC address of the switch."));
233 setLabel(DeviceTree::tr(
"Number of ports"));
234 setHelpText(DeviceTree::tr(
"The number of ports this switch has."));
256 setLabel(DeviceTree::tr(
"Switch Configuration"));
322 auto isdelete = [](
const QString &
action) {
return action ==
"DELETE"; };
323 if (std::any_of(actions.cbegin(), actions.cend(), isdelete))
340 setLabel(DeviceTree::tr(
"Rotor Type"));
341 setHelpText(DeviceTree::tr(
"Select the type of rotor from the list."));
344 addSelection(DeviceTree::tr(
"DiSEqC 1.3 (GotoX/USALS)"),
371 setLabel(DeviceTree::tr(
"Rotor Low Speed (deg/sec)"));
372 QString
help = DeviceTree::tr(
373 "To allow the approximate monitoring of rotor movement, enter "
374 "the rated angular speed of the rotor when powered at 13V.");
401 setLabel(DeviceTree::tr(
"Rotor High Speed (deg/sec)"));
402 QString
help = DeviceTree::tr(
403 "To allow the approximate monitoring of rotor movement, enter "
404 "the rated angular speed of the rotor when powered at 18V.");
430 str = QString::number(angle) +
431 DeviceTree::tr(
"E",
"Eastern Hemisphere");
435 str = QString::number(-angle) +
436 DeviceTree::tr(
"W",
"Western Hemisphere");
453 static double AngleToFloat(
const QString &angle,
bool translated =
true)
455 if (angle.length() < 2)
459 QChar postfix = angle.at(angle.length() - 1);
460 if (postfix.isLetter())
462 pos = angle.leftRef(angle.length() - 1).toDouble();
464 (postfix.toUpper() ==
465 DeviceTree::tr(
"W",
"Western Hemisphere").at(0))) ||
466 (!translated && (postfix.toUpper() ==
'W')))
472 pos = angle.toDouble();
502 item->SetText(DeviceTree::tr(
"None"),
"value");
511 if (posEdit ==
nullptr)
513 QString value = posEdit->
getValue();
523 for (
uint pos = 1; pos < num_pos; pos++)
525 uint_to_dbl_t::const_iterator it =
m_posmap.constFind(pos);
545 setLabel(DeviceTree::tr(
"Rotor Configuration"));
588 setLabel(DeviceTree::tr(
"Userband"));
589 setHelpText(DeviceTree::tr(
"Unicable userband ID (0-7) or sometimes (1-8)"));
614 setLabel(DeviceTree::tr(
"Frequency (MHz)"));
615 setHelpText(DeviceTree::tr(
"Unicable userband frequency (usually 1210, 1420, 1680 and 2040 MHz)"));
640 setLabel(DeviceTree::tr(
"PIN code"));
641 setHelpText(DeviceTree::tr(
"Unicable PIN code (-1 disabled, 0 - 255)"));
663 setLabel(DeviceTree::tr(
"Unicable Configuration"));
679 uint _lof_hi = 0,
bool _pol_inv =
false) :
693 static const std::array<const lnb_preset,7>
lnb_presets
697 lnb_preset(QT_TRANSLATE_NOOP(
"DeviceTree",
"Universal (Europe)"),
699 11700000, 9750000, 10600000),
700 lnb_preset(QT_TRANSLATE_NOOP(
"DeviceTree",
"Single (Europe)"),
702 lnb_preset(QT_TRANSLATE_NOOP(
"DeviceTree",
"Circular (N. America)"),
704 lnb_preset(QT_TRANSLATE_NOOP(
"DeviceTree",
"Linear (N. America)"),
706 lnb_preset(QT_TRANSLATE_NOOP(
"DeviceTree",
"C Band"),
708 lnb_preset(QT_TRANSLATE_NOOP(
"DeviceTree",
"DishPro Bandstacked"),
735 setLabel(DeviceTree::tr(
"LNB Preset"));
736 QString
help = DeviceTree::tr(
737 "Select the LNB preset from the list, or choose "
738 "'Custom' and set the advanced settings below.");
745 addSelection(DeviceTree::tr(
"Custom"), QString::number(i));
769 setLabel(DeviceTree::tr(
"LNB Type"));
770 setHelpText(DeviceTree::tr(
"Select the type of LNB from the list."));
775 kTypeVoltageControl));
776 addSelection(DeviceTree::tr(
"Universal (Voltage & Tone)"),
778 kTypeVoltageAndToneControl));
805 setLabel(DeviceTree::tr(
"LNB LOF Switch (MHz)"));
806 QString
help = DeviceTree::tr(
807 "This defines at what frequency the LNB will do a "
808 "switch from high to low setting, and vice versa.");
834 setLabel(DeviceTree::tr(
"LNB LOF Low (MHz)"));
835 QString
help = DeviceTree::tr(
836 "This defines the offset the frequency coming "
837 "from the LNB will be in low setting. For bandstacked "
838 "LNBs this is the vertical/right polarization band.");
864 setLabel(DeviceTree::tr(
"LNB LOF High (MHz)"));
865 QString
help = DeviceTree::tr(
866 "This defines the offset the frequency coming from "
867 "the LNB will be in high setting. For bandstacked "
868 "LNBs this is the horizontal/left polarization band.");
893 setLabel(DeviceTree::tr(
"LNB Reversed"));
894 QString
help = DeviceTree::tr(
895 "This defines whether the signal reaching the LNB "
896 "is reversed from normal polarization. This happens "
897 "to circular signals bouncing twice on a toroidal "
921 setLabel(DeviceTree::tr(
"LNB Configuration"));
955 uint index = value.toUInt();
960 if (preset.
m_name.isEmpty())
1096 devtype->SetDevice(node);
1104 devtype->addChild(setting);
1136 auto slot = [devtype, parent, childnum,
this](
const QString &value)
1152 for (
uint ch = 0; ch < num_ch; ch++)
1176 else if (parent->
SetChild(childnum, dev))
1203 setHelpText(DeviceTree::tr(
"Choose a port to use for this switch."));
1206 for (
uint ch = 0; ch < num_children; ch++)
1208 QString val = QString(
"%1").arg(ch);
1209 QString descr = DeviceTree::tr(
"Port %1").arg(ch+1);
1243 setHelpText(DeviceTree::tr(
"Choose a satellite position."));
1285 "Locates the satellite you wish to point to "
1286 "with the longitude along the Clarke Belt of "
1287 "the satellite [-180..180] and its hemisphere.");
1335 setHelpText(DeviceTree::tr(
"Unicable satellite position (A/B)"));
1363 m_settings(settings), m_switchesEnabled(switches_enabled)
1365 setLabel(DeviceTree::tr(
"DTV Device Configuration"));
1413 for (
uint i = 0; i < num_ch; i++)
1427 for (
uint i = 0; i < num_ch; i++)
1434 if (!trigger.isEmpty())
LNBLOFLowSetting * m_lofLo
void AddDeviceTypeSetting(DeviceTypeSetting *devtype, DiSEqCDevDevice *parent, uint childnum, GroupSetting *parentSetting)
LNBPresetSetting * m_preset
virtual uint GetChildCount(void) const
Retrieves the proper number of children for this node.
SCRPINSetting(DiSEqCDevSCR &scr)
DTVDeviceConfigGroup(DiSEqCDevSettings &settings, uint cardid, bool switches_enabled)
DiSEqCDevSettings & m_settings
uint GetLOFLow(void) const
double GetValue(uint devid) const
Retrieves a value from this configuration chain by device id.
virtual void setValue(const QString &newValue)
void SetLOFHigh(uint lof_hi)
dvbdev_rotor_t GetType(void) const
void SetPreset(const QString &value)
void PopulateChildren(DiSEqCDevDevice *node, GroupSetting *parentSetting)
static GlobalTextEditSetting * DiSEqCLatitude(void)
static double AngleToEdit(double angle, QString &hemi)
DiSEqCDevDevice * GetDevice()
void SetUserBand(uint userband)
static const std::array< const lnb_preset, 7 > lnb_presets
dvbdev_lnb_t GetType(void) const
devid_to_setting_t m_devs
void SetValue(uint devid, double value)
Sets a value for this configuration chain by device id.
LNBLOFHighSetting * m_lofHi
QString GetDescription(void) const
RotorLoSpeedSetting(DiSEqCDevRotor &rotor)
DiSEqCDevSettings & m_settings
void SetLOFSwitch(uint lof_switch)
arg(title).arg(filename).arg(doDelete))
void updateButton(MythUIButtonListItem *item) override
This method is called whenever the UI need to reflect a change Reimplement this If you widget need a ...
bool keyPressEvent(QKeyEvent *event) override
void SetPosMap(const uint_to_dbl_t &posmap)
DiSEqCDevSwitch & m_switch
virtual void clearSettings()
SCRConfig(DiSEqCDevSCR &scr, StandardSetting *parent)
void addTargetedChild(const QString &value, StandardSetting *setting)
Represents a node in a DVB-S device network.
LNBLOFSwitchSetting(DiSEqCDevLNB &lnb)
virtual bool SetChild(uint, DiSEqCDevDevice *)
Changes the nth child of this node.
SwitchAddressSetting * m_address
DiSEqCDevDevice * m_device
void DeleteDevice(DeviceTypeSetting *devtype)
void SetFrequency(uint freq)
DiSEqCDevDevice * GetParent(void) const
SwitchPortsSetting * m_ports
static GlobalTextEditSetting * DiSEqCLongitude(void)
DVB-S device settings class.
void setChanged(bool changed)
RotorPosTextEdit(const QString &label, uint id, const QString &value)
dvbdev_t GetDeviceType(void) const
void settingsChanged(StandardSetting *selectedSetting=nullptr)
virtual void addChild(StandardSetting *child)
void SetHiSpeed(double speed)
uint GetRepeatCount(void) const
RotorConfig(DiSEqCDevRotor &rotor, StandardSetting *parent)
uint GetFrequency(void) const
void SetType(dvbdev_lnb_t type)
LNBPolarityInvertedSetting(DiSEqCDevLNB &lnb)
bool IsPolarityInverted(void) const
DiSEqCDevDevice & m_device
DiSEqCDevLNB::dvbdev_lnb_t m_type
LNBTypeSetting(DiSEqCDevLNB &lnb)
uint GetAddress(void) const
static uint FindPreset(const DiSEqCDevLNB &lnb)
LNBLOFHighSetting(DiSEqCDevLNB &lnb)
DeviceDescrSetting(DiSEqCDevDevice &device)
QMap< uint, double > uint_to_dbl_t
static void AddChild(StandardSetting *group, const QString &trigger, StandardSetting *setting)
DiSEqCDevSwitch & m_switch
void ValueChanged(const QString &value, DeviceTypeSetting *devtype, DiSEqCDevDevice *parent, uint childnum)
virtual void setHelpText(const QString &str)
RotorSetting(DiSEqCDevDevice &node, DiSEqCDevSettings &settings)
SCRUserBandSetting(DiSEqCDevSCR &scr)
USALSRotorSetting(DiSEqCDevDevice &node, DiSEqCDevSettings &settings)
bool Load(const QString &device)
Loads the device tree from the database.
DeviceRepeatSetting(DiSEqCDevDevice &device)
int getValueIndex(const QString &value) const
TransTextEditSetting * m_numeric
LNBLOFSwitchSetting * m_lofSwitch
void SetRoot(DiSEqCDevDevice *root)
Changes the root node of the tree.
DiSEqCDevSwitch & m_switch
virtual DiSEqCDevDevice * GetChild(uint)
Retrieves the nth child of this node.
virtual QString getValue(void) const
void SetPolarityInverted(bool inv)
TransMythUIComboBoxSetting * m_hemisphere
static DiseqcConfigBase * CreateByType(DiSEqCDevDevice *dev, StandardSetting *parent)
uint_to_dbl_t GetPosMap(void) const
SCRFrequencySetting(DiSEqCDevSCR &scr)
uint GetUserBand(void) const
DiSEqCDevDevice * Root(void)
Retrieves the root node in the tree.
uint GetOrdinal(void) const
static DiSEqCDevDevice * CreateByType(DiSEqCDevTree &tree, dvbdev_t type, uint dev_id=0)
SCRPositionSetting(DiSEqCDevDevice &node, DiSEqCDevSettings &settings)
uint GetLOFSwitch(void) const
RotorHiSpeedSetting(DiSEqCDevRotor &rotor)
uint GetLOFHigh(void) const
virtual void setLabel(QString str)
void SetRepeatCount(uint repeat)
void valueChanged(const QString &newValue)
dvbdev_switch_t GetType(void) const
virtual void setEnabled(bool enabled)
void addSelection(const QString &label, QString value=QString(), bool select=false)
DiSEqCDevDevice & m_device
void SetNumPorts(uint num_ports)
SwitchTypeSetting(DiSEqCDevSwitch &switch_dev)
void AddNodes(StandardSetting *group, const QString &trigger, DiSEqCDevDevice *node)
void SetAddress(uint address)
DeviceDescrSetting * m_deviceDescr
RotorTypeSetting(DiSEqCDevRotor &rotor)
LNBConfig(DiSEqCDevLNB &lnb, StandardSetting *parent)
static QString SCRPositionToString(dvbdev_pos_t pos)
lnb_preset(QString _name, DiSEqCDevLNB::dvbdev_lnb_t _type, uint _lof_sw=0, uint _lof_lo=0, uint _lof_hi=0, bool _pol_inv=false)
SwitchPortsSetting(DiSEqCDevSwitch &switch_dev)
void SetType(dvbdev_switch_t type)
void ConnectToValueChanged(DeviceTypeSetting *devtype, DiSEqCDevDevice *parent, uint childnum)
DiSEqCDevSettings & m_settings
void SetType(const QString &type)
MythMainWindow * GetMythMainWindow(void)
void updateButton(MythUIButtonListItem *item) override
This method is called whenever the UI need to reflect a change Reimplement this If you widget need a ...
static double AngleToFloat(const QString &angle, bool translated=true)
LNBPolarityInvertedSetting * m_polInv
SwitchAddressSetting(DiSEqCDevSwitch &switch_dev)
void SetLoSpeed(double speed)
void SetDescription(const QString &desc)
SwitchConfig(DiSEqCDevSwitch &switch_dev, StandardSetting *parent)
static QString AngleToString(double angle)
double GetHiSpeed(void) const
void newValue(StandardSetting *setting)
uint GetDeviceID(void) const
static const iso6937table * d
@ kTypeVoltageAndToneControl
void SetDevice(DiSEqCDevDevice *dev)
DiSEqCDevSettings & m_settings
SwitchTypeSetting * m_type
double GetLoSpeed(void) const
void setValue(const QString &newValue) override
void SetType(dvbdev_rotor_t type)
void setValue(int value) override
SwitchSetting(DiSEqCDevDevice &node, DiSEqCDevSettings &settings)
DiSEqCDevSettings & m_settings
void SetLOFLow(uint lof_lo)
LNBPresetSetting(DiSEqCDevLNB &lnb)
uint GetNumPorts(void) const
Switch class, including tone, legacy and DiSEqC switches.
LNBLOFLowSetting(DiSEqCDevLNB &lnb)