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."));
260 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)
458 double pos = __builtin_nan(
"");
459 QChar postfix = angle.at(angle.length() - 1);
460 if (postfix.isLetter())
462 pos = angle.left(angle.length() - 1).toDouble();
464 (postfix.toUpper() ==
465 DeviceTree::tr(
"W",
"Western Hemisphere").at(0))) ||
466 (!translated && (postfix.toUpper() ==
'W')))
473 pos = angle.toDouble();
504 item->SetText(DeviceTree::tr(
"None"),
"value");
513 if (posEdit ==
nullptr)
515 QString value = posEdit->
getValue();
525 for (
uint pos = 1; pos < num_pos; pos++)
527 uint_to_dbl_t::const_iterator it =
m_posmap.constFind(pos);
548 setLabel(DeviceTree::tr(
"Rotor Configuration"));
590 setLabel(DeviceTree::tr(
"Userband"));
592 "Unicable userband ID (0-7). The Unicable userband channels "
593 "are often numbered starting at 1 but MythTV starts at 0."));
618 setLabel(DeviceTree::tr(
"Frequency (MHz)"));
619 setHelpText(DeviceTree::tr(
"Unicable userband frequency (usually 1210, 1420, 1680 and 2040 MHz)"));
644 setLabel(DeviceTree::tr(
"PIN code"));
645 setHelpText(DeviceTree::tr(
"Unicable PIN code (-1 disabled, 0 - 255)"));
667 setLabel(DeviceTree::tr(
"Unicable Configuration"));
683 uint _lof_hi = 0,
bool _pol_inv =
false) :
697 static const std::array<const lnb_preset,7>
lnb_presets
701 lnb_preset(QT_TRANSLATE_NOOP(
"DeviceTree",
"Universal (Europe)"),
703 11700000, 9750000, 10600000),
704 lnb_preset(QT_TRANSLATE_NOOP(
"DeviceTree",
"Single (Europe)"),
706 lnb_preset(QT_TRANSLATE_NOOP(
"DeviceTree",
"Circular (N. America)"),
708 lnb_preset(QT_TRANSLATE_NOOP(
"DeviceTree",
"Linear (N. America)"),
710 lnb_preset(QT_TRANSLATE_NOOP(
"DeviceTree",
"C Band"),
712 lnb_preset(QT_TRANSLATE_NOOP(
"DeviceTree",
"DishPro Bandstacked"),
739 setLabel(DeviceTree::tr(
"LNB Preset"));
740 QString
help = DeviceTree::tr(
741 "Select the LNB preset from the list, or choose "
742 "'Custom' and set the advanced settings below.");
749 addSelection(DeviceTree::tr(
"Custom"), QString::number(i));
773 setLabel(DeviceTree::tr(
"LNB Type"));
774 setHelpText(DeviceTree::tr(
"Select the type of LNB from the list."));
779 kTypeVoltageControl));
780 addSelection(DeviceTree::tr(
"Universal (Voltage & Tone)"),
782 kTypeVoltageAndToneControl));
809 setLabel(DeviceTree::tr(
"LNB LOF Switch (MHz)"));
810 QString
help = DeviceTree::tr(
811 "This defines at what frequency the LNB will do a "
812 "switch from high to low setting, and vice versa.");
838 setLabel(DeviceTree::tr(
"LNB LOF Low (MHz)"));
839 QString
help = DeviceTree::tr(
840 "This defines the offset the frequency coming "
841 "from the LNB will be in low setting. For bandstacked "
842 "LNBs this is the vertical/right polarization band.");
868 setLabel(DeviceTree::tr(
"LNB LOF High (MHz)"));
869 QString
help = DeviceTree::tr(
870 "This defines the offset the frequency coming from "
871 "the LNB will be in high setting. For bandstacked "
872 "LNBs this is the horizontal/left polarization band.");
897 setLabel(DeviceTree::tr(
"LNB Reversed"));
898 QString
help = DeviceTree::tr(
899 "This defines whether the signal reaching the LNB "
900 "is reversed from normal polarization. This happens "
901 "to circular signals bouncing twice on a toroidal "
931 setLabel(DeviceTree::tr(
"LNB Configuration"));
959 uint index = value.toUInt();
964 if (preset.
m_name.isEmpty())
1100 devtype->SetDevice(node);
1108 devtype->addChild(setting);
1142 auto slot = [devtype, parent, childnum,
this](
const QString &value)
1158 for (
uint ch = 0; ch < num_ch; ch++)
1182 else if (parent->
SetChild(childnum, dev))
1211 setHelpText(DeviceTree::tr(
"Choose a port to use for this switch."));
1214 for (
uint ch = 0; ch < num_children; ch++)
1216 QString val = QString(
"%1").arg(ch);
1217 QString descr = DeviceTree::tr(
"Port %1").arg(ch+1);
1251 setHelpText(DeviceTree::tr(
"Choose a satellite position."));
1262 for (
double d : std::as_const(
m_posmap))
1293 "Locates the satellite you wish to point to "
1294 "with the longitude along the Clarke Belt of "
1295 "the satellite [-180..180] and its hemisphere.");
1343 setHelpText(DeviceTree::tr(
"Unicable satellite position (A/B)"));
1371 m_settings(settings), m_switchesEnabled(switches_enabled)
1373 setLabel(DeviceTree::tr(
"DTV Device Configuration"));
1421 for (
uint i = 0; i < num_ch; i++)
1435 for (
uint i = 0; i < num_ch; i++)
1442 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.
@ kTypeVoltageAndToneControl
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)
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
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)