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 if (actions.contains(
"DELETE"))
339 setLabel(DeviceTree::tr(
"Rotor Type"));
340 setHelpText(DeviceTree::tr(
"Select the type of rotor from the list."));
343 addSelection(DeviceTree::tr(
"DiSEqC 1.3 (GotoX/USALS)"),
370 setLabel(DeviceTree::tr(
"Rotor Low Speed (deg/sec)"));
371 QString
help = DeviceTree::tr(
372 "To allow the approximate monitoring of rotor movement, enter "
373 "the rated angular speed of the rotor when powered at 13V.");
400 setLabel(DeviceTree::tr(
"Rotor High Speed (deg/sec)"));
401 QString
help = DeviceTree::tr(
402 "To allow the approximate monitoring of rotor movement, enter "
403 "the rated angular speed of the rotor when powered at 18V.");
429 str = QString::number(angle) +
430 DeviceTree::tr(
"E",
"Eastern Hemisphere");
434 str = QString::number(-angle) +
435 DeviceTree::tr(
"W",
"Western Hemisphere");
452static double AngleToFloat(
const QString &angle,
bool translated =
true)
454 if (angle.length() < 2)
457 double pos = __builtin_nan(
"");
458 QChar postfix = angle.at(angle.length() - 1);
459 if (postfix.isLetter())
461 pos = angle.left(angle.length() - 1).toDouble();
463 (postfix.toUpper() ==
464 DeviceTree::tr(
"W",
"Western Hemisphere").at(0))) ||
465 (!translated && (postfix.toUpper() ==
'W')))
472 pos = angle.toDouble();
503 item->SetText(DeviceTree::tr(
"None"),
"value");
512 if (posEdit ==
nullptr)
514 QString value = posEdit->
getValue();
524 for (
uint pos = 1; pos < num_pos; pos++)
526 uint_to_dbl_t::const_iterator it =
m_posmap.constFind(pos);
547 setLabel(DeviceTree::tr(
"Rotor Configuration"));
589 setLabel(DeviceTree::tr(
"Userband"));
591 "Unicable userband ID (0-7). The Unicable userband channels "
592 "are often numbered starting at 1 but MythTV starts at 0."));
617 setLabel(DeviceTree::tr(
"Frequency (MHz)"));
618 setHelpText(DeviceTree::tr(
"Unicable userband frequency (usually 1210, 1420, 1680 and 2040 MHz)"));
643 setLabel(DeviceTree::tr(
"PIN code"));
644 setHelpText(DeviceTree::tr(
"Unicable PIN code (-1 disabled, 0 - 255)"));
666 setLabel(DeviceTree::tr(
"Unicable Configuration"));
682 uint _lof_hi = 0,
bool _pol_inv =
false) :
700 lnb_preset(QT_TRANSLATE_NOOP(
"DeviceTree",
"Universal (Europe)"),
702 11700000, 9750000, 10600000),
703 lnb_preset(QT_TRANSLATE_NOOP(
"DeviceTree",
"Single (Europe)"),
705 lnb_preset(QT_TRANSLATE_NOOP(
"DeviceTree",
"Circular (N. America)"),
707 lnb_preset(QT_TRANSLATE_NOOP(
"DeviceTree",
"Linear (N. America)"),
709 lnb_preset(QT_TRANSLATE_NOOP(
"DeviceTree",
"C Band"),
711 lnb_preset(QT_TRANSLATE_NOOP(
"DeviceTree",
"DishPro Bandstacked"),
738 setLabel(DeviceTree::tr(
"LNB Preset"));
739 QString
help = DeviceTree::tr(
740 "Select the LNB preset from the list, or choose "
741 "'Custom' and set the advanced settings below.");
748 addSelection(DeviceTree::tr(
"Custom"), QString::number(i));
772 setLabel(DeviceTree::tr(
"LNB Type"));
773 setHelpText(DeviceTree::tr(
"Select the type of LNB from the list."));
778 kTypeVoltageControl));
779 addSelection(DeviceTree::tr(
"Universal (Voltage & Tone)"),
781 kTypeVoltageAndToneControl));
808 setLabel(DeviceTree::tr(
"LNB LOF Switch (MHz)"));
809 QString
help = DeviceTree::tr(
810 "This defines at what frequency the LNB will do a "
811 "switch from high to low setting, and vice versa.");
837 setLabel(DeviceTree::tr(
"LNB LOF Low (MHz)"));
838 QString
help = DeviceTree::tr(
839 "This defines the offset the frequency coming "
840 "from the LNB will be in low setting. For bandstacked "
841 "LNBs this is the vertical/right polarization band.");
867 setLabel(DeviceTree::tr(
"LNB LOF High (MHz)"));
868 QString
help = DeviceTree::tr(
869 "This defines the offset the frequency coming from "
870 "the LNB will be in high setting. For bandstacked "
871 "LNBs this is the horizontal/left polarization band.");
896 setLabel(DeviceTree::tr(
"LNB Reversed"));
897 QString
help = DeviceTree::tr(
898 "This defines whether the signal reaching the LNB "
899 "is reversed from normal polarization. This happens "
900 "to circular signals bouncing twice on a toroidal "
930 setLabel(DeviceTree::tr(
"LNB Configuration"));
958 uint index = value.toUInt();
963 if (preset.
m_name.isEmpty())
1099 devtype->SetDevice(node);
1107 devtype->addChild(setting);
1141 auto slot = [devtype, parent, childnum,
this](
const QString &value)
1156 for (
uint ch = 0; ch < num_ch; ch++)
1180 else if (parent->
SetChild(childnum, dev))
1209 setHelpText(DeviceTree::tr(
"Choose a port to use for this switch."));
1212 for (
uint ch = 0; ch < num_children; ch++)
1214 QString val = QString(
"%1").arg(ch);
1215 QString descr = DeviceTree::tr(
"Port %1").arg(ch+1);
1249 setHelpText(DeviceTree::tr(
"Choose a satellite position."));
1260 for (
double d : std::as_const(
m_posmap))
1291 "Locates the satellite you wish to point to "
1292 "with the longitude along the Clarke Belt of "
1293 "the satellite [-180..180] and its hemisphere.");
1341 setHelpText(DeviceTree::tr(
"Unicable satellite position (A/B)"));
1369 m_settings(settings), m_switchesEnabled(switches_enabled)
1371 setLabel(DeviceTree::tr(
"DTV Device Configuration"));
1419 for (
uint i = 0; i < num_ch; i++)
1433 for (
uint i = 0; i < num_ch; i++)
1440 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
virtual 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)