MythTV  master
diseqcsettings.cpp
Go to the documentation of this file.
1 /*
2  * \file diseqcsettings.cpp
3  * \brief DVB-S Device Tree Configuration Classes.
4  * \author Copyright (C) 2006, Yeasah Pell
5  */
6 
7 // Std C headers
8 #include <array>
9 #include <cmath>
10 #include <utility>
11 
12 // MythTV headers
13 #include "libmythbase/mythdbcon.h"
15 #include "diseqcsettings.h"
16 
17 /* Lat/Long items relocated from videosource.cpp */
18 
20 {
21  auto *gc = new GlobalTextEditSetting("latitude");
22  gc->setLabel("Latitude");
23  gc->setHelpText(
24  DeviceTree::tr("The Cartesian latitude for your location. "
25  "Use negative numbers for southern coordinates."));
26  return gc;
27 }
28 
30 {
31  auto *gc = new GlobalTextEditSetting("longitude");
32  gc->setLabel("Longitude");
33  gc->setHelpText(
34  DeviceTree::tr("The Cartesian longitude for your location. "
35  "Use negative numbers for western coordinates."));
36  return gc;
37 }
38 
40 
42 {
43  public:
45  {
46  setLabel(DeviceTree::tr("Device Type"));
47  addSelection(DeviceTree::tr("Unconnected"),
48  QString::number((uint) 0xFFFF));
49  addSelection(DeviceTree::tr("Switch"),
50  QString::number((uint) DiSEqCDevDevice::kTypeSwitch));
51  addSelection(DeviceTree::tr("Rotor"),
52  QString::number((uint) DiSEqCDevDevice::kTypeRotor));
53  addSelection(DeviceTree::tr("Unicable"),
54  QString::number((uint) DiSEqCDevDevice::kTypeSCR));
55  addSelection(DeviceTree::tr("LNB"),
56  QString::number((uint) DiSEqCDevDevice::kTypeLNB));
57  }
58 
59  void Load(void) override // StandardSetting
60  {
61  if (m_device)
62  {
63  QString tmp = QString::number((uint) m_device->GetDeviceType());
65  }
66  setChanged(false);
67  }
68 
70  {
71  m_device = dev;
72  }
73 
74  void DeleteDevice()
75  {
76  SetDevice(nullptr);
77  clearSettings();
78  }
79 
81  {
82  return m_device;
83  }
84 
85  private:
87 };
88 
90 
92 {
93  public:
94  explicit DeviceDescrSetting(DiSEqCDevDevice &device) :
95  m_device(device)
96  {
97  setLabel(DeviceTree::tr("Description"));
98  QString help = DeviceTree::tr(
99  "Optional descriptive name for this device, to "
100  "make it easier to configure settings later.");
101  setHelpText(help);
102  }
103 
104  void Load(void) override // StandardSetting
105  {
107  setChanged(false);
108  }
109 
110  void Save(void) override // StandardSetting
111  {
113  }
114 
115  private:
117 };
118 
119 
121 
123 {
124  public:
126  TransMythUISpinBoxSetting(0, 15, 1), m_device(device)
127  {
128  setLabel(DeviceTree::tr("Repeat Count"));
129  QString help = DeviceTree::tr(
130  "Number of repeat (command with repeat flag ON) or resend (the same command) DiSEqC commands. "
131  "If value is higher than 10, command will be resend N-10 times. "
132  "If value is lower than 10, command will be repeated N times. "
133  "Repeat useful for unreliable DiSEqC equipment; resend useful when unreliable DiSEqC equipment has broken/unsupported repeat flag support.");
134  setHelpText(help);
135  }
136 
137  void Load(void) override // StandardSetting
138  {
140  setChanged(false);
141  }
142 
143  void Save(void) override // StandardSetting
144  {
145  m_device.SetRepeatCount(getValue().toUInt());
146  }
147 
148  private:
150 };
151 
153 
155 {
156  public:
157  explicit SwitchTypeSetting(DiSEqCDevSwitch &switch_dev) :
158  m_switch(switch_dev)
159  {
160  setLabel(DeviceTree::tr("Switch Type"));
161  setHelpText(DeviceTree::tr("Select the type of switch from the list."));
162 
163  addSelection(DeviceTree::tr("Tone"),
164  QString::number((uint) DiSEqCDevSwitch::kTypeTone));
165  addSelection(DeviceTree::tr("Voltage"),
166  QString::number((uint) DiSEqCDevSwitch::kTypeVoltage));
167  addSelection(DeviceTree::tr("Mini DiSEqC"),
168  QString::number((uint) DiSEqCDevSwitch::kTypeMiniDiSEqC));
169  addSelection(DeviceTree::tr("DiSEqC"),
170  QString::number((uint)
172  addSelection(DeviceTree::tr("DiSEqC (Uncommitted)"),
173  QString::number((uint)
175  addSelection(DeviceTree::tr("Legacy SW21"),
176  QString::number((uint) DiSEqCDevSwitch::kTypeLegacySW21));
177  addSelection(DeviceTree::tr("Legacy SW42"),
178  QString::number((uint) DiSEqCDevSwitch::kTypeLegacySW42));
179  addSelection(DeviceTree::tr("Legacy SW64"),
180  QString::number((uint) DiSEqCDevSwitch::kTypeLegacySW64));
181  }
182 
183  void Load(void) override // StandardSetting
184  {
185  setValue(getValueIndex(QString::number((uint) m_switch.GetType())));
186  setChanged(false);
187  }
188 
189  void Save(void) override // StandardSetting
190  {
192  getValue().toUInt());
193  }
194 
195  private:
197 };
198 
200 
202 {
203  public:
204  explicit SwitchAddressSetting(DiSEqCDevSwitch &switch_dev) :
205  m_switch(switch_dev)
206  {
207  setLabel(DeviceTree::tr("Address of switch"));
208  setHelpText(DeviceTree::tr("The DiSEqC address of the switch."));
209  }
210 
211  void Load(void) override // StandardSetting
212  {
213  setValue(QString("0x%1").arg(m_switch.GetAddress(), 0, 16));
214  setChanged(false);
215  }
216 
217  void Save(void) override // StandardSetting
218  {
219  m_switch.SetAddress(getValue().toUInt(nullptr, 16));
220  }
221 
222  private:
224 };
225 
227 
229 {
230  public:
231  explicit SwitchPortsSetting(DiSEqCDevSwitch &switch_dev) :
232  m_switch(switch_dev)
233  {
234  setLabel(DeviceTree::tr("Number of ports"));
235  setHelpText(DeviceTree::tr("The number of ports this switch has."));
236  }
237 
238  void Load(void) override // StandardSetting
239  {
240  setValue(QString::number(m_switch.GetNumPorts()));
241  setChanged(false);
242  }
243 
244  void Save(void) override // StandardSetting
245  {
246  m_switch.SetNumPorts(getValue().toUInt());
247  }
248 
249  private:
251 };
252 
254 
256 {
257  setLabel(DeviceTree::tr("Switch Configuration"));
258 
259  parent = this;
260  m_deviceDescr = new DeviceDescrSetting(switch_dev);
261  parent->addChild(m_deviceDescr);
262  parent->addChild(new DeviceRepeatSetting(switch_dev));
263  m_type = new SwitchTypeSetting(switch_dev);
264  parent->addChild(m_type);
265  m_address = new SwitchAddressSetting(switch_dev);
266  parent->addChild(m_address);
267  m_ports = new SwitchPortsSetting(switch_dev);
268  parent->addChild(m_ports);
269 
270  connect(m_type, qOverload<const QString&>(&StandardSetting::valueChanged),
271  this, qOverload<const QString&>(&SwitchConfig::update));
272  connect(m_deviceDescr, qOverload<const QString&>(&StandardSetting::valueChanged),
273  this, qOverload<const QString&>(&StandardSetting::setValue));
274 }
275 
277 {
280  update();
281  setChanged(false);
282 }
283 
285 {
286  switch ((DiSEqCDevSwitch::dvbdev_switch_t) m_type->getValue().toUInt())
287  {
293  m_address->setValue(QString("0x10"));
294  m_address->setEnabled(false);
295  m_ports->setValue("2");
296  m_ports->setEnabled(false);
297  break;
299  m_address->setValue(QString("0x10"));
300  m_address->setEnabled(false);
301  m_ports->setValue("3");
302  m_ports->setEnabled(false);
303  break;
306  m_address->setEnabled(true);
307  m_ports->setEnabled(true);
308  break;
309  }
310 }
311 
312 void SwitchConfig::update(const QString &/*value*/)
313 {
314  update();
315 }
316 
318 {
319  QStringList actions;
320  if (GetMythMainWindow()->TranslateKeyPress("Global", e, actions))
321  return true;
322 
323  auto isdelete = [](const QString & action) { return action == "DELETE"; };
324  if (std::any_of(actions.cbegin(), actions.cend(), isdelete))
325  {
326  emit DeleteClicked();
327  return true;
328  }
329 
330  return false;
331 }
332 
334 
336 {
337  public:
338  explicit RotorTypeSetting(DiSEqCDevRotor &rotor) :
339  m_rotor(rotor)
340  {
341  setLabel(DeviceTree::tr("Rotor Type"));
342  setHelpText(DeviceTree::tr("Select the type of rotor from the list."));
343  addSelection(DeviceTree::tr("DiSEqC 1.2"),
344  QString::number((uint) DiSEqCDevRotor::kTypeDiSEqC_1_2));
345  addSelection(DeviceTree::tr("DiSEqC 1.3 (GotoX/USALS)"),
346  QString::number((uint) DiSEqCDevRotor::kTypeDiSEqC_1_3));
347  }
348 
349  void Load(void) override // StandardSetting
350  {
351  setValue(getValueIndex(QString::number((uint)m_rotor.GetType())));
352  setChanged(false);
353  }
354 
355  void Save(void) override // StandardSetting
356  {
358  }
359 
360  private:
362 };
363 
365 
367 {
368  public:
370  m_rotor(rotor)
371  {
372  setLabel(DeviceTree::tr("Rotor Low Speed (deg/sec)"));
373  QString help = DeviceTree::tr(
374  "To allow the approximate monitoring of rotor movement, enter "
375  "the rated angular speed of the rotor when powered at 13V.");
376  setHelpText(help);
377  }
378 
379  void Load(void) override // StandardSetting
380  {
381  setValue(QString::number(m_rotor.GetLoSpeed()));
382  setChanged(false);
383  }
384 
385  void Save(void) override // StandardSetting
386  {
387  m_rotor.SetLoSpeed(getValue().toDouble());
388  }
389 
390  private:
392 };
393 
395 
397 {
398  public:
400  m_rotor(rotor)
401  {
402  setLabel(DeviceTree::tr("Rotor High Speed (deg/sec)"));
403  QString help = DeviceTree::tr(
404  "To allow the approximate monitoring of rotor movement, enter "
405  "the rated angular speed of the rotor when powered at 18V.");
406  setHelpText(help);
407  }
408 
409  void Load(void) override // StandardSetting
410  {
411  setValue(QString::number(m_rotor.GetHiSpeed()));
412  setChanged(false);
413  }
414 
415  void Save(void) override // StandardSetting
416  {
417  m_rotor.SetHiSpeed(getValue().toDouble());
418  }
419 
420  private:
422 };
423 
425 
426 static QString AngleToString(double angle)
427 {
428  QString str;
429  if (angle >= 0.0)
430  {
431  str = QString::number(angle) +
432  DeviceTree::tr("E", "Eastern Hemisphere");
433  }
434  else /* if (angle < 0.0) */
435  {
436  str = QString::number(-angle) +
437  DeviceTree::tr("W", "Western Hemisphere");
438  }
439  return str;
440 }
441 
442 static double AngleToEdit(double angle, QString &hemi)
443 {
444  if (angle > 0.0)
445  {
446  hemi = "E";
447  return angle;
448  }
449 
450  hemi = "W";
451  return -angle;
452 }
453 
454 static double AngleToFloat(const QString &angle, bool translated = true)
455 {
456  if (angle.length() < 2)
457  return 0.0;
458 
459  double pos = NAN;
460  QChar postfix = angle.at(angle.length() - 1);
461  if (postfix.isLetter())
462  {
463  pos = angle.left(angle.length() - 1).toDouble();
464  if ((translated &&
465  (postfix.toUpper() ==
466  DeviceTree::tr("W", "Western Hemisphere").at(0))) ||
467  (!translated && (postfix.toUpper() == 'W')))
468  {
469  pos = -pos;
470  }
471  }
472  else
473  pos = angle.toDouble();
474 
475  return pos;
476 }
477 
479 {
481  PopulateList();
482 }
483 
485 {
487 }
488 
490 {
491 public:
492  RotorPosTextEdit(const QString &label, uint id, const QString &value) :
493  m_id(id)
494  {
495  setLabel(label);
496  setValue(value);
497  }
498 
499  void updateButton(MythUIButtonListItem *item) override // MythUITextEditSetting
500  {
502  if (getValue().isEmpty())
503  item->SetText(DeviceTree::tr("None"), "value");
504  }
505 
507 };
508 
510 {
511  auto *posEdit = dynamic_cast<RotorPosTextEdit*>(setting);
512  if (posEdit == nullptr)
513  return;
514  QString value = posEdit->getValue();
515  if (value.isEmpty())
516  m_posmap.erase(m_posmap.find(posEdit->m_id));
517  else
518  m_posmap[posEdit->m_id] = AngleToFloat(posEdit->getValue());
519 }
520 
522 {
523  uint num_pos = 64;
524  for (uint pos = 1; pos < num_pos; pos++)
525  {
526  uint_to_dbl_t::const_iterator it = m_posmap.constFind(pos);
527  QString posval;
528  if (it != m_posmap.constEnd())
529  posval = AngleToString(*it);
530 
531  auto *posEdit =
532  new RotorPosTextEdit(DeviceTree::tr("Position #%1").arg(pos),
533  pos,
534  posval);
535  connect(posEdit, qOverload<StandardSetting*>(&StandardSetting::valueChanged),
536  this, &RotorPosMap::newValue);
537  addChild(posEdit);
538  }
539 }
540 
542 
544  : m_rotor(rotor)
545 {
546  setLabel(DeviceTree::tr("Rotor Configuration"));
547  setValue(rotor.GetDescription());
548 
549  parent = this;
550  parent->addChild(new DeviceDescrSetting(rotor));
551  parent->addChild(new DeviceRepeatSetting(rotor));
552 
553  auto *rtype = new RotorTypeSetting(rotor);
554  connect(rtype, qOverload<const QString&>(&StandardSetting::valueChanged),
555  this, &RotorConfig::SetType);
556  parent->addChild(rtype);
557 
558  m_pos = new RotorPosMap(rotor);
559  m_pos->setLabel(DeviceTree::tr("Positions"));
560  m_pos->setHelpText(DeviceTree::tr("Rotor position setup."));
561  parent->addChild(m_pos);
562 
563  parent->addChild(new RotorLoSpeedSetting(rotor));
564  parent->addChild(new RotorHiSpeedSetting(rotor));
565  parent->addChild(DiSEqCLatitude());
566  parent->addChild(DiSEqCLongitude());
567 }
568 
570 {
573 }
574 
575 void RotorConfig::SetType(const QString &type)
576 {
577  auto rtype = (DiSEqCDevRotor::dvbdev_rotor_t) type.toUInt();
579 }
580 
582 
584 {
585  public:
587  TransMythUISpinBoxSetting(0, 7, 1), m_scr(scr)
588  {
589  setLabel(DeviceTree::tr("Userband"));
590  setHelpText(DeviceTree::tr(
591  "Unicable userband ID (0-7). The Unicable userband channels "
592  "are often numbered starting at 1 but MythTV starts at 0."));
593  }
594 
595  void Load(void) override // StandardSetting
596  {
598  setChanged(false);
599  }
600 
601  void Save(void) override // StandardSetting
602  {
604  }
605 
606  private:
608 };
609 
611 
613 {
614  public:
615  explicit SCRFrequencySetting(DiSEqCDevSCR &scr) : m_scr(scr)
616  {
617  setLabel(DeviceTree::tr("Frequency (MHz)"));
618  setHelpText(DeviceTree::tr("Unicable userband frequency (usually 1210, 1420, 1680 and 2040 MHz)"));
619  }
620 
621  void Load(void) override // StandardSetting
622  {
623  setValue(QString::number(m_scr.GetFrequency()));
624  setChanged(false);
625  }
626 
627  void Save(void) override // StandardSetting
628  {
629  m_scr.SetFrequency(getValue().toUInt());
630  }
631 
632  private:
634 };
635 
637 
639 {
640  public:
641  explicit SCRPINSetting(DiSEqCDevSCR &scr) : m_scr(scr)
642  {
643  setLabel(DeviceTree::tr("PIN code"));
644  setHelpText(DeviceTree::tr("Unicable PIN code (-1 disabled, 0 - 255)"));
645  }
646 
647  void Load(void) override // StandardSetting
648  {
649  setValue(QString::number(m_scr.GetPIN()));
650  setChanged(false);
651  }
652 
653  void Save(void) override // StandardSetting
654  {
655  m_scr.SetPIN(getValue().toInt());
656  }
657 
658  private:
660 };
661 
663 
665 {
666  setLabel(DeviceTree::tr("Unicable Configuration"));
667 
668  parent = this;
669  parent->addChild(new SCRUserBandSetting(scr));
670  parent->addChild(new SCRFrequencySetting(scr));
671  parent->addChild(new SCRPINSetting(scr));
672  parent->addChild(new DeviceRepeatSetting(scr));
673 }
674 
676 
678 {
679  public:
681  uint _lof_sw = 0, uint _lof_lo = 0,
682  uint _lof_hi = 0, bool _pol_inv = false) :
683  m_name(std::move(_name)), m_type(_type),
684  m_lofSw(_lof_sw), m_lofLo(_lof_lo),
685  m_lofHi(_lof_hi), m_polInv(_pol_inv) {}
686 
687  public:
688  QString m_name;
693  bool m_polInv;
694 };
695 
696 static const std::array<const lnb_preset,7> lnb_presets
697 {
698 
699  /* description, type, LOF switch, LOF low, LOF high, inverted polarity */
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)"),
706  DiSEqCDevLNB::kTypeVoltageControl, 0, 11250000),
707  lnb_preset(QT_TRANSLATE_NOOP("DeviceTree", "Linear (N. America)"),
708  DiSEqCDevLNB::kTypeVoltageControl, 0, 10750000),
709  lnb_preset(QT_TRANSLATE_NOOP("DeviceTree", "C Band"),
711  lnb_preset(QT_TRANSLATE_NOOP("DeviceTree", "DishPro Bandstacked"),
712  DiSEqCDevLNB::kTypeBandstacked, 0, 11250000, 14350000),
714 };
715 
716 static uint FindPreset(const DiSEqCDevLNB &lnb)
717 {
718  uint i = 0;
719  for ( ; !lnb_presets[i].m_name.isEmpty(); i++)
720  {
721  if (lnb_presets[i].m_type == lnb.GetType() &&
722  lnb_presets[i].m_lofSw == lnb.GetLOFSwitch() &&
723  lnb_presets[i].m_lofLo == lnb.GetLOFLow() &&
724  lnb_presets[i].m_lofHi == lnb.GetLOFHigh() &&
725  lnb_presets[i].m_polInv== lnb.IsPolarityInverted())
726  {
727  break;
728  }
729  }
730  return i;
731 }
732 
734 {
735  public:
736  explicit LNBPresetSetting(DiSEqCDevLNB &lnb) : m_lnb(lnb)
737  {
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.");
742  setHelpText(help);
743 
744  uint i = 0;
745  for (; !lnb_presets[i].m_name.isEmpty(); i++)
746  addSelection(DeviceTree::tr( lnb_presets[i].m_name.toUtf8() ),
747  QString::number(i));
748  addSelection(DeviceTree::tr("Custom"), QString::number(i));
749  }
750 
751  void Load(void) override // StandardSetting
752  {
754  setChanged(false);
755  }
756 
757  void Save(void) override // StandardSetting
758  {
759  }
760 
761  private:
763 };
764 
766 
768 {
769  public:
770  explicit LNBTypeSetting(DiSEqCDevLNB &lnb) : m_lnb(lnb)
771  {
772  setLabel(DeviceTree::tr("LNB Type"));
773  setHelpText(DeviceTree::tr("Select the type of LNB from the list."));
774  addSelection(DeviceTree::tr("Legacy (Fixed)"),
775  QString::number((uint) DiSEqCDevLNB::kTypeFixed));
776  addSelection(DeviceTree::tr("Standard (Voltage)"),
777  QString::number((uint) DiSEqCDevLNB::
778  kTypeVoltageControl));
779  addSelection(DeviceTree::tr("Universal (Voltage & Tone)"),
780  QString::number((uint) DiSEqCDevLNB::
781  kTypeVoltageAndToneControl));
782  addSelection(DeviceTree::tr("Bandstacked"),
783  QString::number((uint) DiSEqCDevLNB::kTypeBandstacked));
784  }
785 
786  void Load(void) override // StandardSetting
787  {
788  setValue(getValueIndex(QString::number((uint) m_lnb.GetType())));
789  setChanged(false);
790  }
791 
792  void Save(void) override // StandardSetting
793  {
795  }
796 
797  private:
799 };
800 
802 
804 {
805  public:
806  explicit LNBLOFSwitchSetting(DiSEqCDevLNB &lnb) : m_lnb(lnb)
807  {
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.");
812  setHelpText(help);
813  }
814 
815  void Load(void) override // StandardSetting
816  {
817  setValue(QString::number(m_lnb.GetLOFSwitch() / 1000));
818  setChanged(false);
819  }
820 
821  void Save(void) override // StandardSetting
822  {
823  m_lnb.SetLOFSwitch(getValue().toUInt() * 1000);
824  }
825 
826  private:
828 };
829 
831 
833 {
834  public:
835  explicit LNBLOFLowSetting(DiSEqCDevLNB &lnb) : m_lnb(lnb)
836  {
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.");
842  setHelpText(help);
843  }
844 
845  void Load(void) override // StandardSetting
846  {
847  setValue(QString::number(m_lnb.GetLOFLow() / 1000));
848  setChanged(false);
849  }
850 
851  void Save(void) override // StandardSetting
852  {
853  m_lnb.SetLOFLow(getValue().toUInt() * 1000);
854  }
855 
856  private:
858 };
859 
861 
863 {
864  public:
865  explicit LNBLOFHighSetting(DiSEqCDevLNB &lnb) : m_lnb(lnb)
866  {
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.");
872  setHelpText(help);
873  }
874 
875  void Load(void) override // StandardSetting
876  {
877  setValue(QString::number(m_lnb.GetLOFHigh() / 1000));
878  setChanged(false);
879  }
880 
881  void Save(void) override // StandardSetting
882  {
883  m_lnb.SetLOFHigh(getValue().toUInt() * 1000);
884  }
885 
886  private:
888 };
889 
891 {
892  public:
894  m_lnb(lnb)
895  {
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 "
901  "dish.");
902  setHelpText(help);
903  }
904 
905  void Load(void) override // StandardSetting
906  {
908  setChanged(false);
909  }
910 
911  void Save(void) override // StandardSetting
912  {
914  }
915 
916  private:
918 };
919 
921 
923 {
924  setLabel(DeviceTree::tr("LNB Configuration"));
925  setValue(lnb.GetDescription());
926 
927  parent = this;
928  auto *deviceDescr = new DeviceDescrSetting(lnb);
929  parent->addChild(deviceDescr);
930  m_preset = new LNBPresetSetting(lnb);
931  parent->addChild(m_preset);
932  m_type = new LNBTypeSetting(lnb);
933  parent->addChild(m_type);
934  m_lofSwitch = new LNBLOFSwitchSetting(lnb);
935  parent->addChild(m_lofSwitch);
936  m_lofLo = new LNBLOFLowSetting(lnb);
937  parent->addChild(m_lofLo);
938  m_lofHi = new LNBLOFHighSetting(lnb);
939  parent->addChild(m_lofHi);
941  parent->addChild(m_polInv);
942  connect(m_type, qOverload<const QString&>(&StandardSetting::valueChanged),
943  this, qOverload<const QString&>(&LNBConfig::UpdateType));
944  connect(m_preset, qOverload<const QString&>(&StandardSetting::valueChanged),
945  this, &LNBConfig::SetPreset);
946  connect(deviceDescr, qOverload<const QString&>(&StandardSetting::valueChanged),
947  this, qOverload<const QString&>(&StandardSetting::setValue));
948 }
949 
950 void LNBConfig::Load(void)
951 {
954 }
955 
956 void LNBConfig::SetPreset(const QString &value)
957 {
958  uint index = value.toUInt();
959  if (index >= (sizeof(lnb_presets) / sizeof(lnb_preset)))
960  return;
961 
962  const lnb_preset &preset = lnb_presets[index];
963  if (preset.m_name.isEmpty())
964  {
965  m_type->setEnabled(true);
966  UpdateType();
967  }
968  else
969  {
971  QString::number((uint)preset.m_type)));
972  m_lofSwitch->setValue(QString::number(preset.m_lofSw / 1000));
973  m_lofLo->setValue(QString::number(preset.m_lofLo / 1000));
974  m_lofHi->setValue(QString::number(preset.m_lofHi / 1000));
975  m_polInv->setValue(preset.m_polInv);
976  m_type->setEnabled(false);
977  m_lofSwitch->setEnabled(false);
978  m_lofHi->setEnabled(false);
979  m_lofLo->setEnabled(false);
980  m_polInv->setEnabled(false);
981  }
982 }
983 
985 {
986  if (!m_type->isEnabled())
987  return;
988 
989  switch ((DiSEqCDevLNB::dvbdev_lnb_t) m_type->getValue().toUInt())
990  {
993  m_lofSwitch->setEnabled(false);
994  m_lofHi->setEnabled(false);
995  m_lofLo->setEnabled(true);
996  m_polInv->setEnabled(true);
997  break;
999  m_lofSwitch->setEnabled(true);
1000  m_lofHi->setEnabled(true);
1001  m_lofLo->setEnabled(true);
1002  m_polInv->setEnabled(true);
1003  break;
1005  m_lofSwitch->setEnabled(false);
1006  m_lofHi->setEnabled(true);
1007  m_lofLo->setEnabled(true);
1008  m_polInv->setEnabled(true);
1009  break;
1010  }
1011 }
1012 
1013 void LNBConfig::UpdateType(const QString &/*value*/)
1014 {
1015  UpdateType();
1016 }
1018 
1020 {
1021  PopulateTree();
1023 }
1024 
1026 {
1027  DiSEqCDevDevice *dev = devtype->GetDevice();
1028  if (dev)
1029  {
1030  DiSEqCDevDevice *parent = dev->GetParent();
1031  if (parent)
1032  parent->SetChild(dev->GetOrdinal(), nullptr);
1033  else
1034  m_tree.SetRoot(nullptr);
1035  }
1036 
1037  devtype->DeleteDevice();
1038 }
1039 
1041 {
1042  clearSettings();
1044 }
1045 
1047  StandardSetting *parent)
1048 {
1049  DiseqcConfigBase *setting = nullptr;
1050  switch (dev->GetDeviceType())
1051  {
1053  {
1054  auto *sw = dynamic_cast<DiSEqCDevSwitch*>(dev);
1055  if (sw)
1056  setting = new SwitchConfig(*sw, parent);
1057  }
1058  break;
1059 
1061  {
1062  auto *rotor = dynamic_cast<DiSEqCDevRotor*>(dev);
1063  if (rotor)
1064  setting = new RotorConfig(*rotor, parent);
1065  }
1066  break;
1067 
1069  {
1070  auto *scr = dynamic_cast<DiSEqCDevSCR*>(dev);
1071  if (scr)
1072  setting = new SCRConfig(*scr, parent);
1073  }
1074  break;
1075 
1077  {
1078  auto *lnb = dynamic_cast<DiSEqCDevLNB*>(dev);
1079  if (lnb)
1080  setting = new LNBConfig(*lnb, parent);
1081  }
1082  break;
1083 
1084  default:
1085  break;
1086  }
1087 
1088  return setting;
1089 }
1090 
1092  DiSEqCDevDevice *parent,
1093  uint childnum,
1094  GroupSetting *parentSetting)
1095 {
1096  if (node)
1097  {
1098  auto *devtype = new DeviceTypeSetting();
1099  devtype->SetDevice(node);
1100  devtype->Load();
1102  devtype);
1103 
1104  if (setting)
1105  {
1106  setting->Load();
1107  devtype->addChild(setting);
1108  PopulateChildren(node, setting);
1109 
1110  AddDeviceTypeSetting(devtype, parent, childnum, parentSetting);
1111  }
1112  else
1113  delete devtype;
1114  }
1115  else
1116  {
1117  auto *devtype = new DeviceTypeSetting();
1118  AddDeviceTypeSetting(devtype, parent, childnum, parentSetting);
1119  }
1120 }
1121 
1123  DiSEqCDevDevice *parent,
1124  uint childnum,
1125  GroupSetting *parentSetting)
1126 {
1127  if (parentSetting)
1128  parentSetting->addChild(devtype);
1129  else // Root node
1130  addChild(devtype);
1131 
1132  ConnectToValueChanged(devtype, parent, childnum);
1133 }
1134 
1136  DiSEqCDevDevice *parent,
1137  uint childnum)
1138 {
1139  auto slot = [devtype, parent, childnum, this](const QString &value)
1140  {
1141  ValueChanged(value, devtype, parent, childnum);
1142  };
1143 
1144  connect(devtype,
1145  static_cast<void (StandardSetting::*)(const QString&)>(
1147  this,
1148  slot);
1149 }
1150 
1152  GroupSetting *parentSetting)
1153 {
1154  uint num_ch = node->GetChildCount();
1155  for (uint ch = 0; ch < num_ch; ch++)
1156  {
1157  PopulateTree(node->GetChild(ch), node, ch, parentSetting);
1158  }
1159 }
1160 
1161 void DeviceTree::ValueChanged(const QString &value,
1162  DeviceTypeSetting *devtype,
1163  DiSEqCDevDevice *parent,
1164  uint childnum)
1165 {
1166  // Remove old setting from m_tree
1167  DeleteDevice(devtype);
1168 
1169  const auto type = static_cast<DiSEqCDevDevice::dvbdev_t>(value.toUInt());
1170 
1172  if (dev)
1173  {
1174  if (!parent)
1175  {
1176  m_tree.SetRoot(dev);
1177  PopulateTree();
1178  }
1179  else if (parent->SetChild(childnum, dev))
1180  {
1181  DiseqcConfigBase *newConfig =
1182  DiseqcConfigBase::CreateByType(dev, devtype);
1183  newConfig->Load();
1184 
1185  PopulateChildren(dev, newConfig);
1186 
1187  devtype->addChild(newConfig);
1188  devtype->SetDevice(dev);
1189  }
1190  else
1191  delete dev;
1192  }
1193 
1194  emit settingsChanged(this);
1195 }
1196 
1198 
1200 {
1201  public:
1203  : m_node(node), m_settings(settings)
1204  {
1205  setLabel(node.GetDescription());
1206  setHelpText(DeviceTree::tr("Choose a port to use for this switch."));
1207 
1208  uint num_children = node.GetChildCount();
1209  for (uint ch = 0; ch < num_children; ch++)
1210  {
1211  QString val = QString("%1").arg(ch);
1212  QString descr = DeviceTree::tr("Port %1").arg(ch+1);
1213  DiSEqCDevDevice *child = node.GetChild(ch);
1214  if (child)
1215  descr += QString(" (%2)").arg(child->GetDescription());
1216  addSelection(descr, val);
1217  }
1218  }
1219 
1220  void Load(void) override // StandardSetting
1221  {
1222  double value = m_settings.GetValue(m_node.GetDeviceID());
1223  setValue((uint)value);
1224  setChanged(false);
1225  }
1226 
1227  void Save(void) override // StandardSetting
1228  {
1229  m_settings.SetValue(m_node.GetDeviceID(), getValue().toDouble());
1230  }
1231 
1232  private:
1235 };
1236 
1238 
1240 {
1241  public:
1243  : m_node(node), m_settings(settings)
1244  {
1245  setLabel(node.GetDescription());
1246  setHelpText(DeviceTree::tr("Choose a satellite position."));
1247 
1248  auto *rotor = dynamic_cast<DiSEqCDevRotor*>(&m_node);
1249  if (rotor)
1250  m_posmap = rotor->GetPosMap();
1251  }
1252 
1253  void Load(void) override // StandardSetting
1254  {
1255  clearSelections();
1256 
1257  for (double d : qAsConst(m_posmap))
1258  addSelection(AngleToString(d), QString::number(d));
1259 
1260  double angle = m_settings.GetValue(m_node.GetDeviceID());
1261  setValue(getValueIndex(QString::number(angle)));
1262  setChanged(false);
1263  }
1264 
1265  void Save(void) override // StandardSetting
1266  {
1267  m_settings.SetValue(m_node.GetDeviceID(), getValue().toDouble());
1268  }
1269 
1270  private:
1274 };
1275 
1277 
1279 {
1280  public:
1283  m_hemisphere(new TransMythUIComboBoxSetting(/*false*/)),
1284  m_node(node), m_settings(settings)
1285  {
1286  QString help =
1287  DeviceTree::tr(
1288  "Locates the satellite you wish to point to "
1289  "with the longitude along the Clarke Belt of "
1290  "the satellite [-180..180] and its hemisphere.");
1291 
1292  m_numeric->setLabel(DeviceTree::tr("Longitude (degrees)"));
1294  m_hemisphere->setLabel(DeviceTree::tr("Hemisphere"));
1295  m_hemisphere->addSelection(DeviceTree::tr("Eastern"), "E", false);
1296  m_hemisphere->addSelection(DeviceTree::tr("Western"), "W", true);
1298 
1301 
1302  addChild(new RotorConfig(dynamic_cast<DiSEqCDevRotor&>(m_node), this));
1303  }
1304 
1305  void Load(void) override // StandardSetting
1306  {
1307  double val = m_settings.GetValue(m_node.GetDeviceID());
1308  QString hemi;
1309  double eval = AngleToEdit(val, hemi);
1310  m_numeric->setValue(QString::number(eval));
1313  }
1314 
1315  void Save(void) override // StandardSetting
1316  {
1317  QString val = QString::number(m_numeric->getValue().toDouble());
1318  val += m_hemisphere->getValue();
1320  }
1321 
1322  private:
1327 };
1328 
1330 
1332 {
1333  public:
1335  : m_node(node), m_settings(settings)
1336  {
1337  setLabel("Position");
1338  setHelpText(DeviceTree::tr("Unicable satellite position (A/B)"));
1340  QString::number((uint)DiSEqCDevSCR::kTypeScrPosA), true);
1342  QString::number((uint)DiSEqCDevSCR::kTypeScrPosB), false);
1343  }
1344 
1345  void Load(void) override // StandardSetting
1346  {
1347  double value = m_settings.GetValue(m_node.GetDeviceID());
1348  setValue(getValueIndex(QString::number((uint)value)));
1349  setChanged(false);
1350  }
1351 
1352  void Save(void) override // StandardSetting
1353  {
1354  m_settings.SetValue(m_node.GetDeviceID(), getValue().toDouble());
1355  }
1356 
1357  private:
1360 };
1361 
1363 
1365  DiSEqCDevSettings &settings, uint cardid, bool switches_enabled) :
1366  m_settings(settings), m_switchesEnabled(switches_enabled)
1367 {
1368  setLabel(DeviceTree::tr("DTV Device Configuration"));
1369 
1370  // load
1371  m_tree.Load(cardid);
1372 
1373  // initial UI setup
1374  AddNodes(this, QString(), m_tree.Root());
1375 }
1376 
1378  StandardSetting *group, const QString &trigger, DiSEqCDevDevice *node)
1379 {
1380  if (!node)
1381  return;
1382 
1383  StandardSetting *setting = nullptr;
1384  switch (node->GetDeviceType())
1385  {
1387  setting = new SwitchSetting(*node, m_settings);
1388  setting->setEnabled(m_switchesEnabled);
1389  break;
1391  {
1392  auto *rotor = dynamic_cast<DiSEqCDevRotor*>(node);
1393  if (rotor && (rotor->GetType() == DiSEqCDevRotor::kTypeDiSEqC_1_2))
1394  setting = new RotorSetting(*node, m_settings);
1395  else
1396  setting = new USALSRotorSetting(*node, m_settings);
1397  break;
1398  }
1400  {
1401  setting = new SCRPositionSetting(*node, m_settings);
1402  break;
1403  }
1404  default:
1405  break;
1406  }
1407 
1408  if (!setting)
1409  return;
1410 
1411  m_devs[node->GetDeviceID()] = setting;
1412 
1413  uint num_ch = node->GetChildCount();
1415  {
1416  for (uint i = 0; i < num_ch; i++)
1417  AddNodes(setting, QString::number(i), node->GetChild(i));
1418 
1419  AddChild(group, trigger, setting);
1420  return;
1421  }
1422 
1423  if (!num_ch)
1424  {
1425  AddChild(group, trigger, setting);
1426  return;
1427  }
1428 
1429  AddChild(group, trigger, setting);
1430  for (uint i = 0; i < num_ch; i++)
1431  AddNodes(group, trigger, node->GetChild(i));
1432 }
1433 
1435  StandardSetting *group, const QString &trigger, StandardSetting *setting)
1436 {
1437  if (!trigger.isEmpty())
1438  group->addTargetedChild(trigger, setting);
1439  else
1440  group->addChild(setting);
1441 }
LNBConfig::m_lofLo
LNBLOFLowSetting * m_lofLo
Definition: diseqcsettings.h:125
DeviceTree::AddDeviceTypeSetting
void AddDeviceTypeSetting(DeviceTypeSetting *devtype, DiSEqCDevDevice *parent, uint childnum, GroupSetting *parentSetting)
Definition: diseqcsettings.cpp:1122
SCRUserBandSetting::m_scr
DiSEqCDevSCR & m_scr
Definition: diseqcsettings.cpp:607
RotorTypeSetting::Save
void Save(void) override
Definition: diseqcsettings.cpp:355
LNBConfig::m_preset
LNBPresetSetting * m_preset
Definition: diseqcsettings.h:122
MythUIComboBoxSetting::clearSelections
void clearSelections()
Definition: standardsettings.cpp:514
DiSEqCDevRotor::kTypeDiSEqC_1_2
@ kTypeDiSEqC_1_2
Definition: diseqc.h:316
RotorConfig::Load
void Load() override
Definition: diseqcsettings.cpp:569
LNBPolarityInvertedSetting::Save
void Save(void) override
Definition: diseqcsettings.cpp:911
DiSEqCDevDevice::GetChildCount
virtual uint GetChildCount(void) const
Retrieves the proper number of children for this node.
Definition: diseqc.h:177
RotorSetting
Definition: diseqcsettings.cpp:1239
SwitchTypeSetting
Definition: diseqcsettings.cpp:154
SCRPINSetting::SCRPINSetting
SCRPINSetting(DiSEqCDevSCR &scr)
Definition: diseqcsettings.cpp:641
DTVDeviceConfigGroup::DTVDeviceConfigGroup
DTVDeviceConfigGroup(DiSEqCDevSettings &settings, uint cardid, bool switches_enabled)
Definition: diseqcsettings.cpp:1364
SwitchSetting::m_settings
DiSEqCDevSettings & m_settings
Definition: diseqcsettings.cpp:1234
DiSEqCDevDevice::kTypeRotor
@ kTypeRotor
Definition: diseqc.h:156
DiSEqCDevLNB::GetLOFLow
uint GetLOFLow(void) const
Definition: diseqc.h:475
DiSEqCDevSettings::GetValue
double GetValue(uint devid) const
Retrieves a value from this configuration chain by device id.
Definition: diseqc.cpp:200
StandardSetting::setValue
virtual void setValue(const QString &newValue)
Definition: standardsettings.cpp:170
LNBLOFHighSetting::Load
void Load(void) override
Definition: diseqcsettings.cpp:875
SCRPINSetting::Save
void Save(void) override
Definition: diseqcsettings.cpp:653
DiSEqCDevRotor
Rotor class.
Definition: diseqc.h:302
DeviceRepeatSetting::Save
void Save(void) override
Definition: diseqcsettings.cpp:143
DiSEqCDevLNB::SetLOFHigh
void SetLOFHigh(uint lof_hi)
Definition: diseqc.h:467
DiSEqCDevRotor::GetType
dvbdev_rotor_t GetType(void) const
Definition: diseqc.h:325
USALSRotorSetting::m_node
DiSEqCDevDevice & m_node
Definition: diseqcsettings.cpp:1325
LNBConfig::SetPreset
void SetPreset(const QString &value)
Definition: diseqcsettings.cpp:956
DiSEqCDevRotor::kTypeDiSEqC_1_3
@ kTypeDiSEqC_1_3
Definition: diseqc.h:316
DeviceTree::PopulateChildren
void PopulateChildren(DiSEqCDevDevice *node, GroupSetting *parentSetting)
Definition: diseqcsettings.cpp:1151
SwitchConfig
Definition: diseqcsettings.h:33
SCRFrequencySetting::Save
void Save(void) override
Definition: diseqcsettings.cpp:627
DiSEqCLatitude
static GlobalTextEditSetting * DiSEqCLatitude(void)
Definition: diseqcsettings.cpp:19
lnb_preset::m_lofSw
uint m_lofSw
Definition: diseqcsettings.cpp:690
RotorLoSpeedSetting
Definition: diseqcsettings.cpp:366
TransMythUIComboBoxSetting
Definition: standardsettings.h:272
AngleToEdit
static double AngleToEdit(double angle, QString &hemi)
Definition: diseqcsettings.cpp:442
TransTextEditSetting
Definition: standardsettings.h:161
DeviceTypeSetting::GetDevice
DiSEqCDevDevice * GetDevice()
Definition: diseqcsettings.cpp:80
SwitchPortsSetting::Save
void Save(void) override
Definition: diseqcsettings.cpp:244
DiSEqCDevSCR::SetUserBand
void SetUserBand(uint userband)
Definition: diseqc.h:402
lnb_presets
static const std::array< const lnb_preset, 7 > lnb_presets
Definition: diseqcsettings.cpp:697
RotorSetting::m_posmap
uint_to_dbl_t m_posmap
Definition: diseqcsettings.cpp:1273
DiSEqCDevLNB::GetType
dvbdev_lnb_t GetType(void) const
Definition: diseqc.h:472
LNBTypeSetting
Definition: diseqcsettings.cpp:767
SCRPINSetting::Load
void Load(void) override
Definition: diseqcsettings.cpp:647
DTVDeviceConfigGroup::m_devs
devid_to_setting_t m_devs
Definition: diseqcsettings.h:183
DiSEqCDevSettings::SetValue
void SetValue(uint devid, double value)
Sets a value for this configuration chain by device id.
Definition: diseqc.cpp:215
LNBConfig::m_lofHi
LNBLOFHighSetting * m_lofHi
Definition: diseqcsettings.h:126
DeviceTypeSetting::DeleteDevice
void DeleteDevice()
Definition: diseqcsettings.cpp:74
TransMythUISpinBoxSetting
Definition: standardsettings.h:353
DiSEqCDevDevice::GetDescription
QString GetDescription(void) const
Definition: diseqc.h:175
SCRPositionSetting
Definition: diseqcsettings.cpp:1331
RotorLoSpeedSetting::RotorLoSpeedSetting
RotorLoSpeedSetting(DiSEqCDevRotor &rotor)
Definition: diseqcsettings.cpp:369
SCRPositionSetting::m_settings
DiSEqCDevSettings & m_settings
Definition: diseqcsettings.cpp:1359
DiSEqCDevDevice::kTypeSCR
@ kTypeSCR
Definition: diseqc.h:157
DiSEqCDevLNB::SetLOFSwitch
void SetLOFSwitch(uint lof_switch)
Definition: diseqc.h:466
DeviceTree::Load
void Load(void) override
Definition: diseqcsettings.cpp:1019
RotorConfig
Definition: diseqcsettings.h:74
mythdbcon.h
lnb_preset::m_lofLo
uint m_lofLo
Definition: diseqcsettings.cpp:691
DiSEqCDevSCR::kTypeScrPosB
@ kTypeScrPosB
Definition: diseqc.h:400
MythUITextEditSetting::updateButton
void updateButton(MythUIButtonListItem *item) override
This method is called whenever the UI need to reflect a change Reimplement this If you widget need a ...
Definition: standardsettings.cpp:423
DeviceDescrSetting::Save
void Save(void) override
Definition: diseqcsettings.cpp:110
DiseqcConfigBase::keyPressEvent
bool keyPressEvent(QKeyEvent *event) override
Definition: diseqcsettings.cpp:317
DiSEqCDevRotor::SetPosMap
void SetPosMap(const uint_to_dbl_t &posmap)
Definition: diseqc.cpp:1994
LNBPresetSetting
Definition: diseqcsettings.cpp:733
SCRUserBandSetting::Load
void Load(void) override
Definition: diseqcsettings.cpp:595
lnb_preset
Definition: diseqcsettings.cpp:677
RotorConfig::m_pos
RotorPosMap * m_pos
Definition: diseqcsettings.h:87
SwitchPortsSetting::m_switch
DiSEqCDevSwitch & m_switch
Definition: diseqcsettings.cpp:250
StandardSetting::clearSettings
virtual void clearSettings()
Definition: standardsettings.cpp:160
SCRConfig::SCRConfig
SCRConfig(DiSEqCDevSCR &scr, StandardSetting *parent)
Definition: diseqcsettings.cpp:664
StandardSetting::addTargetedChild
void addTargetedChild(const QString &value, StandardSetting *setting)
Definition: standardsettings.cpp:117
DiSEqCDevLNB::kTypeBandstacked
@ kTypeBandstacked
Definition: diseqc.h:463
RotorSetting::m_node
DiSEqCDevDevice & m_node
Definition: diseqcsettings.cpp:1271
DiSEqCDevDevice
Represents a node in a DVB-S device network.
Definition: diseqc.h:139
DeviceDescrSetting::Load
void Load(void) override
Definition: diseqcsettings.cpp:104
LNBLOFSwitchSetting::LNBLOFSwitchSetting
LNBLOFSwitchSetting(DiSEqCDevLNB &lnb)
Definition: diseqcsettings.cpp:806
DiSEqCDevDevice::SetChild
virtual bool SetChild(uint, DiSEqCDevDevice *)
Changes the nth child of this node.
Definition: diseqc.h:165
LNBLOFLowSetting::Save
void Save(void) override
Definition: diseqcsettings.cpp:851
RotorHiSpeedSetting::Save
void Save(void) override
Definition: diseqcsettings.cpp:415
SwitchConfig::m_address
SwitchAddressSetting * m_address
Definition: diseqcsettings.h:49
StandardSetting::m_name
QString m_name
Definition: standardsettings.h:116
LNBLOFHighSetting::m_lnb
DiSEqCDevLNB & m_lnb
Definition: diseqcsettings.cpp:887
DeviceTypeSetting::m_device
DiSEqCDevDevice * m_device
Definition: diseqcsettings.cpp:86
DiseqcConfigBase::DeleteClicked
void DeleteClicked(void)
DeviceTree::DeleteDevice
void DeleteDevice(DeviceTypeSetting *devtype)
Definition: diseqcsettings.cpp:1025
LNBPolarityInvertedSetting::Load
void Load(void) override
Definition: diseqcsettings.cpp:905
LNBConfig::Load
void Load(void) override
Definition: diseqcsettings.cpp:950
DiSEqCDevSCR::SetFrequency
void SetFrequency(uint freq)
Definition: diseqc.h:403
lnb_preset::m_lofHi
uint m_lofHi
Definition: diseqcsettings.cpp:692
SwitchAddressSetting::Load
void Load(void) override
Definition: diseqcsettings.cpp:211
DiSEqCDevSwitch::kTypeDiSEqCUncommitted
@ kTypeDiSEqCUncommitted
Definition: diseqc.h:241
DiSEqCDevDevice::kTypeSwitch
@ kTypeSwitch
Definition: diseqc.h:155
DiSEqCDevDevice::GetParent
DiSEqCDevDevice * GetParent(void) const
Definition: diseqc.h:173
tmp
static guint32 * tmp
Definition: goom_core.cpp:32
SwitchConfig::m_ports
SwitchPortsSetting * m_ports
Definition: diseqcsettings.h:48
DiSEqCDevSCR::GetPIN
int GetPIN(void) const
Definition: diseqc.h:410
DiSEqCLongitude
static GlobalTextEditSetting * DiSEqCLongitude(void)
Definition: diseqcsettings.cpp:29
SwitchSetting::m_node
DiSEqCDevDevice & m_node
Definition: diseqcsettings.cpp:1233
RotorPosMap::Save
void Save(void) override
Definition: diseqcsettings.cpp:484
DeviceTree::PopulateTree
void PopulateTree(void)
Definition: diseqcsettings.cpp:1040
DiSEqCDevSettings
DVB-S device settings class.
Definition: diseqc.h:36
MythUIButtonListItem
Definition: mythuibuttonlist.h:41
LNBPresetSetting::m_lnb
DiSEqCDevLNB & m_lnb
Definition: diseqcsettings.cpp:762
StandardSetting::setChanged
void setChanged(bool changed)
Definition: standardsettings.cpp:209
RotorPosTextEdit::RotorPosTextEdit
RotorPosTextEdit(const QString &label, uint id, const QString &value)
Definition: diseqcsettings.cpp:492
RotorSetting::Load
void Load(void) override
Definition: diseqcsettings.cpp:1253
DiSEqCDevDevice::GetDeviceType
dvbdev_t GetDeviceType(void) const
Definition: diseqc.h:169
StandardSetting::settingsChanged
void settingsChanged(StandardSetting *selectedSetting=nullptr)
StandardSetting::addChild
virtual void addChild(StandardSetting *child)
Definition: standardsettings.cpp:71
DiSEqCDevRotor::SetHiSpeed
void SetHiSpeed(double speed)
Definition: diseqc.h:319
DiSEqCDevDevice::GetRepeatCount
uint GetRepeatCount(void) const
Definition: diseqc.h:176
RotorConfig::RotorConfig
RotorConfig(DiSEqCDevRotor &rotor, StandardSetting *parent)
Definition: diseqcsettings.cpp:543
DiSEqCDevSCR::GetFrequency
uint GetFrequency(void) const
Definition: diseqc.h:409
DiSEqCDevLNB::SetType
void SetType(dvbdev_lnb_t type)
Definition: diseqc.h:465
LNBPolarityInvertedSetting::LNBPolarityInvertedSetting
LNBPolarityInvertedSetting(DiSEqCDevLNB &lnb)
Definition: diseqcsettings.cpp:893
DiSEqCDevLNB::IsPolarityInverted
bool IsPolarityInverted(void) const
Definition: diseqc.h:476
DeviceRepeatSetting::m_device
DiSEqCDevDevice & m_device
Definition: diseqcsettings.cpp:149
mythlogging.h
lnb_preset::m_type
DiSEqCDevLNB::dvbdev_lnb_t m_type
Definition: diseqcsettings.cpp:689
DeviceTree::m_tree
DiSEqCDevTree & m_tree
Definition: diseqcsettings.h:163
MythUIComboBoxSetting
Definition: standardsettings.h:218
LNBTypeSetting::LNBTypeSetting
LNBTypeSetting(DiSEqCDevLNB &lnb)
Definition: diseqcsettings.cpp:770
LNBTypeSetting::Save
void Save(void) override
Definition: diseqcsettings.cpp:792
LNBLOFSwitchSetting::Save
void Save(void) override
Definition: diseqcsettings.cpp:821
DiSEqCDevSwitch::GetAddress
uint GetAddress(void) const
Definition: diseqc.h:255
DiSEqCDevLNB::kTypeFixed
@ kTypeFixed
Definition: diseqc.h:460
SCRPINSetting
Definition: diseqcsettings.cpp:638
SwitchTypeSetting::Load
void Load(void) override
Definition: diseqcsettings.cpp:183
RotorPosTextEdit
Definition: diseqcsettings.cpp:489
DiSEqCDevLNB::dvbdev_lnb_t
dvbdev_lnb_t
Definition: diseqc.h:458
FindPreset
static uint FindPreset(const DiSEqCDevLNB &lnb)
Definition: diseqcsettings.cpp:716
RotorPosMap
Definition: diseqcsettings.h:52
MythUISpinBoxSetting::intValue
int intValue()
Definition: standardsettings.cpp:676
USALSRotorSetting::Load
void Load(void) override
Definition: diseqcsettings.cpp:1305
LNBLOFHighSetting::LNBLOFHighSetting
LNBLOFHighSetting(DiSEqCDevLNB &lnb)
Definition: diseqcsettings.cpp:865
DeviceDescrSetting::DeviceDescrSetting
DeviceDescrSetting(DiSEqCDevDevice &device)
Definition: diseqcsettings.cpp:94
StandardSetting::Load
virtual void Load(void)
Definition: standardsettings.cpp:214
uint_to_dbl_t
QMap< uint, double > uint_to_dbl_t
Definition: diseqc.h:30
DTVDeviceConfigGroup::AddChild
static void AddChild(StandardSetting *group, const QString &trigger, StandardSetting *setting)
Definition: diseqcsettings.cpp:1434
SwitchTypeSetting::m_switch
DiSEqCDevSwitch & m_switch
Definition: diseqcsettings.cpp:196
lnb_preset::m_name
QString m_name
Definition: diseqcsettings.cpp:688
DeviceTree::ValueChanged
void ValueChanged(const QString &value, DeviceTypeSetting *devtype, DiSEqCDevDevice *parent, uint childnum)
Definition: diseqcsettings.cpp:1161
DiSEqCDevSCR
Unicable / SCR Class.
Definition: diseqc.h:382
DiSEqCDevDevice::dvbdev_t
dvbdev_t
Definition: diseqc.h:153
StandardSetting::setHelpText
virtual void setHelpText(const QString &str)
Definition: standardsettings.h:37
RotorSetting::RotorSetting
RotorSetting(DiSEqCDevDevice &node, DiSEqCDevSettings &settings)
Definition: diseqcsettings.cpp:1242
SCRUserBandSetting::SCRUserBandSetting
SCRUserBandSetting(DiSEqCDevSCR &scr)
Definition: diseqcsettings.cpp:586
USALSRotorSetting::USALSRotorSetting
USALSRotorSetting(DiSEqCDevDevice &node, DiSEqCDevSettings &settings)
Definition: diseqcsettings.cpp:1281
DiSEqCDevTree::Load
bool Load(const QString &device)
Loads the device tree from the database.
Definition: diseqc.cpp:307
DeviceRepeatSetting::DeviceRepeatSetting
DeviceRepeatSetting(DiSEqCDevDevice &device)
Definition: diseqcsettings.cpp:125
RotorLoSpeedSetting::Load
void Load(void) override
Definition: diseqcsettings.cpp:379
MythUIComboBoxSetting::getValueIndex
int getValueIndex(const QString &value) const
Definition: standardsettings.cpp:488
USALSRotorSetting::m_numeric
TransTextEditSetting * m_numeric
Definition: diseqcsettings.cpp:1323
LNBConfig::m_lofSwitch
LNBLOFSwitchSetting * m_lofSwitch
Definition: diseqcsettings.h:124
DiSEqCDevTree::SetRoot
void SetRoot(DiSEqCDevDevice *root)
Changes the root node of the tree.
Definition: diseqc.cpp:630
DiSEqCDevLNB
LNB Class.
Definition: diseqc.h:446
SwitchAddressSetting::m_switch
DiSEqCDevSwitch & m_switch
Definition: diseqcsettings.cpp:223
DiSEqCDevDevice::GetChild
virtual DiSEqCDevDevice * GetChild(uint)
Retrieves the nth child of this node.
Definition: diseqc.h:188
RotorPosMap::Load
void Load(void) override
Definition: diseqcsettings.cpp:478
DeviceTypeSetting::Load
void Load(void) override
Definition: diseqcsettings.cpp:59
StandardSetting::getValue
virtual QString getValue(void) const
Definition: standardsettings.h:52
DiSEqCDevLNB::SetPolarityInverted
void SetPolarityInverted(bool inv)
Definition: diseqc.h:469
DiSEqCDevSwitch::dvbdev_switch_t
dvbdev_switch_t
Definition: diseqc.h:237
LNBConfig::UpdateType
void UpdateType(void)
Definition: diseqcsettings.cpp:984
USALSRotorSetting::m_hemisphere
TransMythUIComboBoxSetting * m_hemisphere
Definition: diseqcsettings.cpp:1324
DiseqcConfigBase::CreateByType
static DiseqcConfigBase * CreateByType(DiSEqCDevDevice *dev, StandardSetting *parent)
Definition: diseqcsettings.cpp:1046
uint
unsigned int uint
Definition: compat.h:79
DiSEqCDevRotor::GetPosMap
uint_to_dbl_t GetPosMap(void) const
Definition: diseqc.cpp:1984
RotorTypeSetting::m_rotor
DiSEqCDevRotor & m_rotor
Definition: diseqcsettings.cpp:361
SCRFrequencySetting::SCRFrequencySetting
SCRFrequencySetting(DiSEqCDevSCR &scr)
Definition: diseqcsettings.cpp:615
DiSEqCDevSCR::GetUserBand
uint GetUserBand(void) const
Definition: diseqc.h:408
SCRFrequencySetting::Load
void Load(void) override
Definition: diseqcsettings.cpp:621
DiSEqCDevTree::Root
DiSEqCDevDevice * Root(void)
Retrieves the root node in the tree.
Definition: diseqc.h:93
SwitchConfig::update
void update(void)
Definition: diseqcsettings.cpp:284
DeviceDescrSetting
Definition: diseqcsettings.cpp:91
DiSEqCDevDevice::GetOrdinal
uint GetOrdinal(void) const
Definition: diseqc.h:174
SCRPositionSetting::Load
void Load(void) override
Definition: diseqcsettings.cpp:1345
DiSEqCDevDevice::CreateByType
static DiSEqCDevDevice * CreateByType(DiSEqCDevTree &tree, dvbdev_t type, uint dev_id=0)
Definition: diseqc.cpp:931
RotorPosMap::PopulateList
void PopulateList(void)
Definition: diseqcsettings.cpp:521
LNBLOFSwitchSetting::m_lnb
DiSEqCDevLNB & m_lnb
Definition: diseqcsettings.cpp:827
SCRPositionSetting::SCRPositionSetting
SCRPositionSetting(DiSEqCDevDevice &node, DiSEqCDevSettings &settings)
Definition: diseqcsettings.cpp:1334
DiSEqCDevLNB::GetLOFSwitch
uint GetLOFSwitch(void) const
Definition: diseqc.h:473
SwitchSetting::Save
void Save(void) override
Definition: diseqcsettings.cpp:1227
RotorHiSpeedSetting::RotorHiSpeedSetting
RotorHiSpeedSetting(DiSEqCDevRotor &rotor)
Definition: diseqcsettings.cpp:399
DiSEqCDevLNB::GetLOFHigh
uint GetLOFHigh(void) const
Definition: diseqc.h:474
StandardSetting::setLabel
virtual void setLabel(QString str)
Definition: standardsettings.h:34
DiSEqCDevDevice::SetRepeatCount
void SetRepeatCount(uint repeat)
Definition: diseqc.h:164
DiseqcConfigBase
Definition: diseqcsettings.h:20
DiSEqCDevDevice::kTypeLNB
@ kTypeLNB
Definition: diseqc.h:158
DiSEqCDevSwitch::kTypeDiSEqCCommitted
@ kTypeDiSEqCCommitted
Definition: diseqc.h:240
GlobalTextEditSetting
Definition: standardsettings.h:175
SwitchConfig::Load
void Load(void) override
Definition: diseqcsettings.cpp:276
DTVDeviceConfigGroup::m_tree
DiSEqCDevTree m_tree
Definition: diseqcsettings.h:181
StandardSetting::valueChanged
void valueChanged(const QString &newValue)
DiSEqCDevSwitch::GetType
dvbdev_switch_t GetType(void) const
Definition: diseqc.h:254
SCRConfig
Definition: diseqcsettings.h:90
LNBLOFHighSetting::Save
void Save(void) override
Definition: diseqcsettings.cpp:881
LNBConfig
Definition: diseqcsettings.h:108
StandardSetting::setEnabled
virtual void setEnabled(bool enabled)
Definition: standardsettings.cpp:48
MythUIComboBoxSetting::addSelection
void addSelection(const QString &label, QString value=QString(), bool select=false)
Definition: standardsettings.cpp:499
DiSEqCDevSwitch::kTypeMiniDiSEqC
@ kTypeMiniDiSEqC
Definition: diseqc.h:246
DeviceDescrSetting::m_device
DiSEqCDevDevice & m_device
Definition: diseqcsettings.cpp:116
LNBPresetSetting::Load
void Load(void) override
Definition: diseqcsettings.cpp:751
LNBPolarityInvertedSetting
Definition: diseqcsettings.cpp:890
DeviceTypeSetting::DeviceTypeSetting
DeviceTypeSetting()
Definition: diseqcsettings.cpp:44
DiSEqCDevSwitch::SetNumPorts
void SetNumPorts(uint num_ports)
Definition: diseqc.cpp:1335
DiSEqCDevSCR::SetPIN
void SetPIN(int pin)
Definition: diseqc.h:404
SwitchTypeSetting::SwitchTypeSetting
SwitchTypeSetting(DiSEqCDevSwitch &switch_dev)
Definition: diseqcsettings.cpp:157
RotorTypeSetting::Load
void Load(void) override
Definition: diseqcsettings.cpp:349
DTVDeviceConfigGroup::AddNodes
void AddNodes(StandardSetting *group, const QString &trigger, DiSEqCDevDevice *node)
Definition: diseqcsettings.cpp:1377
RotorPosTextEdit::m_id
uint m_id
Definition: diseqcsettings.cpp:506
DiSEqCDevSwitch::kTypeTone
@ kTypeTone
Definition: diseqc.h:239
DiSEqCDevSwitch::SetAddress
void SetAddress(uint address)
Definition: diseqc.h:249
SwitchConfig::m_deviceDescr
DeviceDescrSetting * m_deviceDescr
Definition: diseqcsettings.h:46
RotorTypeSetting::RotorTypeSetting
RotorTypeSetting(DiSEqCDevRotor &rotor)
Definition: diseqcsettings.cpp:338
lnb_preset::m_polInv
bool m_polInv
Definition: diseqcsettings.cpp:693
DiSEqCDevSCR::kTypeScrPosA
@ kTypeScrPosA
Definition: diseqc.h:399
DiSEqCDevSwitch::kTypeLegacySW64
@ kTypeLegacySW64
Definition: diseqc.h:244
SCRFrequencySetting
Definition: diseqcsettings.cpp:612
LNBConfig::LNBConfig
LNBConfig(DiSEqCDevLNB &lnb, StandardSetting *parent)
Definition: diseqcsettings.cpp:922
SwitchAddressSetting
Definition: diseqcsettings.cpp:201
RotorHiSpeedSetting::m_rotor
DiSEqCDevRotor & m_rotor
Definition: diseqcsettings.cpp:421
SCRUserBandSetting::Save
void Save(void) override
Definition: diseqcsettings.cpp:601
DiSEqCDevSwitch::kTypeLegacySW42
@ kTypeLegacySW42
Definition: diseqc.h:243
DiSEqCDevSwitch::kTypeLegacySW21
@ kTypeLegacySW21
Definition: diseqc.h:242
std
Definition: mythchrono.h:23
DiSEqCDevSCR::SCRPositionToString
static QString SCRPositionToString(dvbdev_pos_t pos)
Definition: diseqc.h:427
StandardSetting::isEnabled
bool isEnabled() const
Definition: standardsettings.h:45
DiSEqCDevSwitch::kTypeVoltage
@ kTypeVoltage
Definition: diseqc.h:245
LNBPresetSetting::Save
void Save(void) override
Definition: diseqcsettings.cpp:757
SwitchTypeSetting::Save
void Save(void) override
Definition: diseqcsettings.cpp:189
LNBLOFLowSetting::Load
void Load(void) override
Definition: diseqcsettings.cpp:845
lnb_preset::lnb_preset
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)
Definition: diseqcsettings.cpp:680
SwitchPortsSetting::SwitchPortsSetting
SwitchPortsSetting(DiSEqCDevSwitch &switch_dev)
Definition: diseqcsettings.cpp:231
LNBTypeSetting::m_lnb
DiSEqCDevLNB & m_lnb
Definition: diseqcsettings.cpp:798
DiSEqCDevSwitch::SetType
void SetType(dvbdev_switch_t type)
Definition: diseqc.h:248
LNBLOFHighSetting
Definition: diseqcsettings.cpp:862
SCRPositionSetting::m_node
DiSEqCDevDevice & m_node
Definition: diseqcsettings.cpp:1358
DeviceTree::ConnectToValueChanged
void ConnectToValueChanged(DeviceTypeSetting *devtype, DiSEqCDevDevice *parent, uint childnum)
Definition: diseqcsettings.cpp:1135
RotorLoSpeedSetting::m_rotor
DiSEqCDevRotor & m_rotor
Definition: diseqcsettings.cpp:391
USALSRotorSetting::m_settings
DiSEqCDevSettings & m_settings
Definition: diseqcsettings.cpp:1326
RotorConfig::SetType
void SetType(const QString &type)
Definition: diseqcsettings.cpp:575
GetMythMainWindow
MythMainWindow * GetMythMainWindow(void)
Definition: mythmainwindow.cpp:102
RotorPosTextEdit::updateButton
void updateButton(MythUIButtonListItem *item) override
This method is called whenever the UI need to reflect a change Reimplement this If you widget need a ...
Definition: diseqcsettings.cpp:499
build_compdb.action
action
Definition: build_compdb.py:9
RotorLoSpeedSetting::Save
void Save(void) override
Definition: diseqcsettings.cpp:385
USALSRotorSetting
Definition: diseqcsettings.cpp:1278
AngleToFloat
static double AngleToFloat(const QString &angle, bool translated=true)
Definition: diseqcsettings.cpp:454
LNBConfig::m_polInv
LNBPolarityInvertedSetting * m_polInv
Definition: diseqcsettings.h:127
SwitchAddressSetting::SwitchAddressSetting
SwitchAddressSetting(DiSEqCDevSwitch &switch_dev)
Definition: diseqcsettings.cpp:204
build_compdb.help
help
Definition: build_compdb.py:10
DeviceRepeatSetting::Load
void Load(void) override
Definition: diseqcsettings.cpp:137
DiSEqCDevRotor::SetLoSpeed
void SetLoSpeed(double speed)
Definition: diseqc.h:318
RotorConfig::m_rotor
DiSEqCDevRotor & m_rotor
Definition: diseqcsettings.h:86
LNBConfig::m_type
LNBTypeSetting * m_type
Definition: diseqcsettings.h:123
RotorSetting::Save
void Save(void) override
Definition: diseqcsettings.cpp:1265
LNBLOFLowSetting::m_lnb
DiSEqCDevLNB & m_lnb
Definition: diseqcsettings.cpp:857
DTVDeviceConfigGroup::m_switchesEnabled
bool m_switchesEnabled
Definition: diseqcsettings.h:184
StandardSetting
Definition: standardsettings.h:29
DiSEqCDevDevice::SetDescription
void SetDescription(const QString &desc)
Definition: diseqc.h:163
SwitchConfig::SwitchConfig
SwitchConfig(DiSEqCDevSwitch &switch_dev, StandardSetting *parent)
Definition: diseqcsettings.cpp:255
AngleToString
static QString AngleToString(double angle)
Definition: diseqcsettings.cpp:426
DiSEqCDevRotor::GetHiSpeed
double GetHiSpeed(void) const
Definition: diseqc.h:327
SwitchPortsSetting::Load
void Load(void) override
Definition: diseqcsettings.cpp:238
RotorHiSpeedSetting::Load
void Load(void) override
Definition: diseqcsettings.cpp:409
SwitchPortsSetting
Definition: diseqcsettings.cpp:228
SCRPINSetting::m_scr
DiSEqCDevSCR & m_scr
Definition: diseqcsettings.cpp:659
RotorPosMap::newValue
void newValue(StandardSetting *setting)
Definition: diseqcsettings.cpp:509
DiSEqCDevDevice::GetDeviceID
uint GetDeviceID(void) const
Definition: diseqc.h:170
MythUICheckBoxSetting
Definition: standardsettings.h:390
d
static const iso6937table * d
Definition: iso6937tables.cpp:1025
DiSEqCDevLNB::kTypeVoltageAndToneControl
@ kTypeVoltageAndToneControl
Definition: diseqc.h:462
DeviceTypeSetting::SetDevice
void SetDevice(DiSEqCDevDevice *dev)
Definition: diseqcsettings.cpp:69
RotorTypeSetting
Definition: diseqcsettings.cpp:335
RotorHiSpeedSetting
Definition: diseqcsettings.cpp:396
LNBTypeSetting::Load
void Load(void) override
Definition: diseqcsettings.cpp:786
RotorSetting::m_settings
DiSEqCDevSettings & m_settings
Definition: diseqcsettings.cpp:1272
SwitchConfig::m_type
SwitchTypeSetting * m_type
Definition: diseqcsettings.h:47
SCRFrequencySetting::m_scr
DiSEqCDevSCR & m_scr
Definition: diseqcsettings.cpp:633
RotorPosMap::m_posmap
uint_to_dbl_t m_posmap
Definition: diseqcsettings.h:71
SwitchSetting::Load
void Load(void) override
Definition: diseqcsettings.cpp:1220
DiSEqCDevRotor::GetLoSpeed
double GetLoSpeed(void) const
Definition: diseqc.h:326
MythUICheckBoxSetting::setValue
void setValue(const QString &newValue) override
Definition: standardsettings.cpp:721
SCRPositionSetting::Save
void Save(void) override
Definition: diseqcsettings.cpp:1352
DiSEqCDevRotor::dvbdev_rotor_t
dvbdev_rotor_t
Definition: diseqc.h:316
SCRUserBandSetting
Definition: diseqcsettings.cpp:583
LNBLOFSwitchSetting::Load
void Load(void) override
Definition: diseqcsettings.cpp:815
DeviceTypeSetting
Definition: diseqcsettings.cpp:41
DiSEqCDevRotor::SetType
void SetType(dvbdev_rotor_t type)
Definition: diseqc.h:317
SwitchAddressSetting::Save
void Save(void) override
Definition: diseqcsettings.cpp:217
LNBLOFSwitchSetting
Definition: diseqcsettings.cpp:803
LNBLOFLowSetting
Definition: diseqcsettings.cpp:832
LNBPolarityInvertedSetting::m_lnb
DiSEqCDevLNB & m_lnb
Definition: diseqcsettings.cpp:917
MythUIComboBoxSetting::setValue
void setValue(int value) override
Definition: standardsettings.cpp:479
RotorPosMap::m_rotor
DiSEqCDevRotor & m_rotor
Definition: diseqcsettings.h:70
DiSEqCDevLNB::kTypeVoltageControl
@ kTypeVoltageControl
Definition: diseqc.h:461
SwitchSetting::SwitchSetting
SwitchSetting(DiSEqCDevDevice &node, DiSEqCDevSettings &settings)
Definition: diseqcsettings.cpp:1202
GroupSetting
Definition: standardsettings.h:435
diseqcsettings.h
DTVDeviceConfigGroup::m_settings
DiSEqCDevSettings & m_settings
Definition: diseqcsettings.h:182
DiSEqCDevLNB::SetLOFLow
void SetLOFLow(uint lof_lo)
Definition: diseqc.h:468
DeviceRepeatSetting
Definition: diseqcsettings.cpp:122
LNBPresetSetting::LNBPresetSetting
LNBPresetSetting(DiSEqCDevLNB &lnb)
Definition: diseqcsettings.cpp:736
USALSRotorSetting::Save
void Save(void) override
Definition: diseqcsettings.cpp:1315
DiSEqCDevSwitch::GetNumPorts
uint GetNumPorts(void) const
Definition: diseqc.h:256
DiSEqCDevSwitch
Switch class, including tone, legacy and DiSEqC switches.
Definition: diseqc.h:223
MythUICheckBoxSetting::boolValue
bool boolValue()
Definition: standardsettings.h:403
LNBLOFLowSetting::LNBLOFLowSetting
LNBLOFLowSetting(DiSEqCDevLNB &lnb)
Definition: diseqcsettings.cpp:835
SwitchSetting
Definition: diseqcsettings.cpp:1199