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");
453static 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) :
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())
devid_to_setting_t m_devs
DTVDeviceConfigGroup(DiSEqCDevSettings &settings, uint cardid, bool switches_enabled)
static void AddChild(StandardSetting *group, const QString &trigger, StandardSetting *setting)
void AddNodes(StandardSetting *group, const QString &trigger, DiSEqCDevDevice *node)
DiSEqCDevSettings & m_settings
DiSEqCDevDevice & m_device
DeviceDescrSetting(DiSEqCDevDevice &device)
DiSEqCDevDevice & m_device
DeviceRepeatSetting(DiSEqCDevDevice &device)
void ValueChanged(const QString &value, DeviceTypeSetting *devtype, DiSEqCDevDevice *parent, uint childnum)
void DeleteDevice(DeviceTypeSetting *devtype)
void AddDeviceTypeSetting(DeviceTypeSetting *devtype, DiSEqCDevDevice *parent, uint childnum, GroupSetting *parentSetting)
void PopulateChildren(DiSEqCDevDevice *node, GroupSetting *parentSetting)
void ConnectToValueChanged(DeviceTypeSetting *devtype, DiSEqCDevDevice *parent, uint childnum)
void SetDevice(DiSEqCDevDevice *dev)
DiSEqCDevDevice * m_device
DiSEqCDevDevice * GetDevice()
Represents a node in a DVB-S device network.
uint GetDeviceID(void) const
void SetRepeatCount(uint repeat)
virtual uint GetChildCount(void) const
Retrieves the proper number of children for this node.
virtual DiSEqCDevDevice * GetChild(uint)
Retrieves the nth child of this node.
uint GetOrdinal(void) const
QString GetDescription(void) const
void SetDescription(const QString &desc)
uint GetRepeatCount(void) const
static DiSEqCDevDevice * CreateByType(DiSEqCDevTree &tree, dvbdev_t type, uint dev_id=0)
virtual bool SetChild(uint, DiSEqCDevDevice *)
Changes the nth child of this node.
dvbdev_t GetDeviceType(void) const
DiSEqCDevDevice * GetParent(void) const
dvbdev_lnb_t GetType(void) const
bool IsPolarityInverted(void) const
uint GetLOFHigh(void) const
uint GetLOFSwitch(void) const
void SetLOFLow(uint lof_lo)
void SetType(dvbdev_lnb_t type)
void SetPolarityInverted(bool inv)
@ kTypeVoltageAndToneControl
uint GetLOFLow(void) const
void SetLOFSwitch(uint lof_switch)
void SetLOFHigh(uint lof_hi)
double GetLoSpeed(void) const
double GetHiSpeed(void) const
void SetHiSpeed(double speed)
uint_to_dbl_t GetPosMap(void) const
void SetType(dvbdev_rotor_t type)
void SetPosMap(const uint_to_dbl_t &posmap)
dvbdev_rotor_t GetType(void) const
void SetLoSpeed(double speed)
uint GetFrequency(void) const
static QString SCRPositionToString(dvbdev_pos_t pos)
void SetFrequency(uint freq)
uint GetUserBand(void) const
void SetUserBand(uint userband)
DVB-S device settings class.
double GetValue(uint devid) const
Retrieves a value from this configuration chain by device id.
void SetValue(uint devid, double value)
Sets a value for this configuration chain by device id.
Switch class, including tone, legacy and DiSEqC switches.
void SetAddress(uint address)
void SetType(dvbdev_switch_t type)
dvbdev_switch_t GetType(void) const
uint GetAddress(void) const
void SetNumPorts(uint num_ports)
uint GetNumPorts(void) const
bool Load(const QString &device)
Loads the device tree from the database.
void SetRoot(DiSEqCDevDevice *root)
Changes the root node of the tree.
DiSEqCDevDevice * Root(void)
Retrieves the root node in the tree.
static DiseqcConfigBase * CreateByType(DiSEqCDevDevice *dev, StandardSetting *parent)
bool keyPressEvent(QKeyEvent *event) override
void SetPreset(const QString &value)
LNBPolarityInvertedSetting * m_polInv
LNBPresetSetting * m_preset
LNBLOFSwitchSetting * m_lofSwitch
LNBConfig(DiSEqCDevLNB &lnb, StandardSetting *parent)
LNBLOFLowSetting * m_lofLo
LNBLOFHighSetting * m_lofHi
LNBLOFHighSetting(DiSEqCDevLNB &lnb)
LNBLOFLowSetting(DiSEqCDevLNB &lnb)
LNBLOFSwitchSetting(DiSEqCDevLNB &lnb)
LNBPolarityInvertedSetting(DiSEqCDevLNB &lnb)
LNBPresetSetting(DiSEqCDevLNB &lnb)
LNBTypeSetting(DiSEqCDevLNB &lnb)
void setValue(const QString &newValue) override
void addSelection(const QString &label, QString value=QString(), bool select=false)
void setValue(int value) override
int getValueIndex(const QString &value) const
void updateButton(MythUIButtonListItem *item) override
This method is called whenever the UI need to reflect a change Reimplement this If you widget need a ...
RotorConfig(DiSEqCDevRotor &rotor, StandardSetting *parent)
void SetType(const QString &type)
RotorHiSpeedSetting(DiSEqCDevRotor &rotor)
RotorLoSpeedSetting(DiSEqCDevRotor &rotor)
void newValue(StandardSetting *setting)
RotorPosTextEdit(const QString &label, uint id, const QString &value)
void updateButton(MythUIButtonListItem *item) override
This method is called whenever the UI need to reflect a change Reimplement this If you widget need a ...
DiSEqCDevSettings & m_settings
RotorSetting(DiSEqCDevDevice &node, DiSEqCDevSettings &settings)
RotorTypeSetting(DiSEqCDevRotor &rotor)
SCRConfig(DiSEqCDevSCR &scr, StandardSetting *parent)
SCRFrequencySetting(DiSEqCDevSCR &scr)
SCRPINSetting(DiSEqCDevSCR &scr)
DiSEqCDevSettings & m_settings
SCRPositionSetting(DiSEqCDevDevice &node, DiSEqCDevSettings &settings)
SCRUserBandSetting(DiSEqCDevSCR &scr)
virtual void addChild(StandardSetting *child)
void addTargetedChild(const QString &value, StandardSetting *setting)
virtual void clearSettings()
void settingsChanged(StandardSetting *selectedSetting=nullptr)
virtual void setHelpText(const QString &str)
virtual void setValue(const QString &newValue)
void valueChanged(const QString &newValue)
virtual QString getValue(void) const
virtual void setEnabled(bool enabled)
virtual void setLabel(QString str)
void setChanged(bool changed)
SwitchAddressSetting(DiSEqCDevSwitch &switch_dev)
DiSEqCDevSwitch & m_switch
DeviceDescrSetting * m_deviceDescr
SwitchConfig(DiSEqCDevSwitch &switch_dev, StandardSetting *parent)
SwitchAddressSetting * m_address
SwitchPortsSetting * m_ports
SwitchTypeSetting * m_type
SwitchPortsSetting(DiSEqCDevSwitch &switch_dev)
DiSEqCDevSwitch & m_switch
SwitchSetting(DiSEqCDevDevice &node, DiSEqCDevSettings &settings)
DiSEqCDevSettings & m_settings
SwitchTypeSetting(DiSEqCDevSwitch &switch_dev)
DiSEqCDevSwitch & m_switch
TransTextEditSetting * m_numeric
USALSRotorSetting(DiSEqCDevDevice &node, DiSEqCDevSettings &settings)
DiSEqCDevSettings & m_settings
TransMythUIComboBoxSetting * m_hemisphere
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)
DiSEqCDevLNB::dvbdev_lnb_t m_type
QMap< uint, double > uint_to_dbl_t
static const std::array< const lnb_preset, 7 > lnb_presets
static QString AngleToString(double angle)
static uint FindPreset(const DiSEqCDevLNB &lnb)
static double AngleToEdit(double angle, QString &hemi)
static double AngleToFloat(const QString &angle, bool translated=true)
static GlobalTextEditSetting * DiSEqCLongitude(void)
static GlobalTextEditSetting * DiSEqCLatitude(void)
static const iso6937table * d
MythMainWindow * GetMythMainWindow(void)