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