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 <cmath>
9 #include <utility>
10 
11 // MythTV headers
12 #include "mythdbcon.h"
13 #include "mythlogging.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 {
256  setLabel(DeviceTree::tr("Switch Configuration"));
257 
258  parent = this;
259  m_deviceDescr = new DeviceDescrSetting(switch_dev);
260  parent->addChild(m_deviceDescr);
261  parent->addChild(new DeviceRepeatSetting(switch_dev));
262  m_type = new SwitchTypeSetting(switch_dev);
263  parent->addChild(m_type);
264  m_address = new SwitchAddressSetting(switch_dev);
265  parent->addChild(m_address);
266  m_ports = new SwitchPortsSetting(switch_dev);
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 = NAN;
459  QChar postfix = angle.at(angle.length() - 1);
460  if (postfix.isLetter())
461  {
462  pos = angle.leftRef(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  pos = angle.toDouble();
473 
474  return pos;
475 }
476 
478 {
480  PopulateList();
481 }
482 
484 {
486 }
487 
489 {
490 public:
491  RotorPosTextEdit(const QString &label, uint id, const QString &value) :
492  m_id(id)
493  {
494  setLabel(label);
495  setValue(value);
496  }
497 
498  void updateButton(MythUIButtonListItem *item) override // MythUITextEditSetting
499  {
501  if (getValue().isEmpty())
502  item->SetText(DeviceTree::tr("None"), "value");
503  }
504 
506 };
507 
509 {
510  auto *posEdit = dynamic_cast<RotorPosTextEdit*>(setting);
511  if (posEdit == nullptr)
512  return;
513  QString value = posEdit->getValue();
514  if (value.isEmpty())
515  m_posmap.erase(m_posmap.find(posEdit->m_id));
516  else
517  m_posmap[posEdit->m_id] = AngleToFloat(posEdit->getValue());
518 }
519 
521 {
522  uint num_pos = 64;
523  for (uint pos = 1; pos < num_pos; pos++)
524  {
525  uint_to_dbl_t::const_iterator it = m_posmap.constFind(pos);
526  QString posval;
527  if (it != m_posmap.constEnd())
528  posval = AngleToString(*it);
529 
530  auto *posEdit =
531  new RotorPosTextEdit(DeviceTree::tr("Position #%1").arg(pos),
532  pos,
533  posval);
534  connect(posEdit, qOverload<StandardSetting*>(&StandardSetting::valueChanged),
536  addChild(posEdit);
537  }
538 }
539 
541 
543  : m_rotor(rotor)
544 {
545  setLabel(DeviceTree::tr("Rotor Configuration"));
546  setValue(rotor.GetDescription());
547 
548  parent = this;
549  parent->addChild(new DeviceDescrSetting(rotor));
550  parent->addChild(new DeviceRepeatSetting(rotor));
551 
552  auto *rtype = new RotorTypeSetting(rotor);
553  connect(rtype, qOverload<const QString&>(&StandardSetting::valueChanged),
554  this, &RotorConfig::SetType);
555  parent->addChild(rtype);
556 
557  m_pos = new RotorPosMap(rotor);
558  m_pos->setLabel(DeviceTree::tr("Positions"));
559  m_pos->setHelpText(DeviceTree::tr("Rotor position setup."));
560  parent->addChild(m_pos);
561 
562  parent->addChild(new RotorLoSpeedSetting(rotor));
563  parent->addChild(new RotorHiSpeedSetting(rotor));
564  parent->addChild(DiSEqCLatitude());
565  parent->addChild(DiSEqCLongitude());
566 }
567 
569 {
572 }
573 
574 void RotorConfig::SetType(const QString &type)
575 {
576  auto rtype = (DiSEqCDevRotor::dvbdev_rotor_t) type.toUInt();
578 }
579 
581 
583 {
584  public:
586  TransMythUISpinBoxSetting(0, 8, 1), m_scr(scr)
587  {
588  setLabel(DeviceTree::tr("Userband"));
589  setHelpText(DeviceTree::tr("Unicable userband ID (0-7) or sometimes (1-8)"));
590  }
591 
592  void Load(void) override // StandardSetting
593  {
595  setChanged(false);
596  }
597 
598  void Save(void) override // StandardSetting
599  {
601  }
602 
603  private:
605 };
606 
608 
610 {
611  public:
612  explicit SCRFrequencySetting(DiSEqCDevSCR &scr) : m_scr(scr)
613  {
614  setLabel(DeviceTree::tr("Frequency (MHz)"));
615  setHelpText(DeviceTree::tr("Unicable userband frequency (usually 1210, 1420, 1680 and 2040 MHz)"));
616  }
617 
618  void Load(void) override // StandardSetting
619  {
620  setValue(QString::number(m_scr.GetFrequency()));
621  setChanged(false);
622  }
623 
624  void Save(void) override // StandardSetting
625  {
626  m_scr.SetFrequency(getValue().toUInt());
627  }
628 
629  private:
631 };
632 
634 
636 {
637  public:
638  explicit SCRPINSetting(DiSEqCDevSCR &scr) : m_scr(scr)
639  {
640  setLabel(DeviceTree::tr("PIN code"));
641  setHelpText(DeviceTree::tr("Unicable PIN code (-1 disabled, 0 - 255)"));
642  }
643 
644  void Load(void) override // StandardSetting
645  {
646  setValue(QString::number(m_scr.GetPIN()));
647  setChanged(false);
648  }
649 
650  void Save(void) override // StandardSetting
651  {
652  m_scr.SetPIN(getValue().toInt());
653  }
654 
655  private:
657 };
658 
660 
662 {
663  setLabel(DeviceTree::tr("Unicable Configuration"));
664 
665  parent = this;
666  parent->addChild(new SCRUserBandSetting(scr));
667  parent->addChild(new SCRFrequencySetting(scr));
668  parent->addChild(new SCRPINSetting(scr));
669  parent->addChild(new DeviceRepeatSetting(scr));
670 }
671 
673 
675 {
676  public:
678  uint _lof_sw = 0, uint _lof_lo = 0,
679  uint _lof_hi = 0, bool _pol_inv = false) :
680  m_name(std::move(_name)), m_type(_type),
681  m_lofSw(_lof_sw), m_lofLo(_lof_lo),
682  m_lofHi(_lof_hi), m_polInv(_pol_inv) {}
683 
684  public:
685  QString m_name;
690  bool m_polInv;
691 };
692 
693 static const std::array<const lnb_preset,7> lnb_presets
694 {
695 
696  /* description, type, LOF switch, LOF low, LOF high, inverted polarity */
697  lnb_preset(QT_TRANSLATE_NOOP("DeviceTree", "Universal (Europe)"),
699  11700000, 9750000, 10600000),
700  lnb_preset(QT_TRANSLATE_NOOP("DeviceTree", "Single (Europe)"),
702  lnb_preset(QT_TRANSLATE_NOOP("DeviceTree", "Circular (N. America)"),
703  DiSEqCDevLNB::kTypeVoltageControl, 0, 11250000),
704  lnb_preset(QT_TRANSLATE_NOOP("DeviceTree", "Linear (N. America)"),
705  DiSEqCDevLNB::kTypeVoltageControl, 0, 10750000),
706  lnb_preset(QT_TRANSLATE_NOOP("DeviceTree", "C Band"),
708  lnb_preset(QT_TRANSLATE_NOOP("DeviceTree", "DishPro Bandstacked"),
709  DiSEqCDevLNB::kTypeBandstacked, 0, 11250000, 14350000),
711 };
712 
713 static uint FindPreset(const DiSEqCDevLNB &lnb)
714 {
715  uint i = 0;
716  for ( ; !lnb_presets[i].m_name.isEmpty(); i++)
717  {
718  if (lnb_presets[i].m_type == lnb.GetType() &&
719  lnb_presets[i].m_lofSw == lnb.GetLOFSwitch() &&
720  lnb_presets[i].m_lofLo == lnb.GetLOFLow() &&
721  lnb_presets[i].m_lofHi == lnb.GetLOFHigh() &&
722  lnb_presets[i].m_polInv== lnb.IsPolarityInverted())
723  {
724  break;
725  }
726  }
727  return i;
728 }
729 
731 {
732  public:
733  explicit LNBPresetSetting(DiSEqCDevLNB &lnb) : m_lnb(lnb)
734  {
735  setLabel(DeviceTree::tr("LNB Preset"));
736  QString help = DeviceTree::tr(
737  "Select the LNB preset from the list, or choose "
738  "'Custom' and set the advanced settings below.");
739  setHelpText(help);
740 
741  uint i = 0;
742  for (; !lnb_presets[i].m_name.isEmpty(); i++)
743  addSelection(DeviceTree::tr( lnb_presets[i].m_name.toUtf8() ),
744  QString::number(i));
745  addSelection(DeviceTree::tr("Custom"), QString::number(i));
746  }
747 
748  void Load(void) override // StandardSetting
749  {
751  setChanged(false);
752  }
753 
754  void Save(void) override // StandardSetting
755  {
756  }
757 
758  private:
760 };
761 
763 
765 {
766  public:
767  explicit LNBTypeSetting(DiSEqCDevLNB &lnb) : m_lnb(lnb)
768  {
769  setLabel(DeviceTree::tr("LNB Type"));
770  setHelpText(DeviceTree::tr("Select the type of LNB from the list."));
771  addSelection(DeviceTree::tr("Legacy (Fixed)"),
772  QString::number((uint) DiSEqCDevLNB::kTypeFixed));
773  addSelection(DeviceTree::tr("Standard (Voltage)"),
774  QString::number((uint) DiSEqCDevLNB::
775  kTypeVoltageControl));
776  addSelection(DeviceTree::tr("Universal (Voltage & Tone)"),
777  QString::number((uint) DiSEqCDevLNB::
778  kTypeVoltageAndToneControl));
779  addSelection(DeviceTree::tr("Bandstacked"),
780  QString::number((uint) DiSEqCDevLNB::kTypeBandstacked));
781  }
782 
783  void Load(void) override // StandardSetting
784  {
785  setValue(getValueIndex(QString::number((uint) m_lnb.GetType())));
786  setChanged(false);
787  }
788 
789  void Save(void) override // StandardSetting
790  {
792  }
793 
794  private:
796 };
797 
799 
801 {
802  public:
803  explicit LNBLOFSwitchSetting(DiSEqCDevLNB &lnb) : m_lnb(lnb)
804  {
805  setLabel(DeviceTree::tr("LNB LOF Switch (MHz)"));
806  QString help = DeviceTree::tr(
807  "This defines at what frequency the LNB will do a "
808  "switch from high to low setting, and vice versa.");
809  setHelpText(help);
810  }
811 
812  void Load(void) override // StandardSetting
813  {
814  setValue(QString::number(m_lnb.GetLOFSwitch() / 1000));
815  setChanged(false);
816  }
817 
818  void Save(void) override // StandardSetting
819  {
820  m_lnb.SetLOFSwitch(getValue().toUInt() * 1000);
821  }
822 
823  private:
825 };
826 
828 
830 {
831  public:
832  explicit LNBLOFLowSetting(DiSEqCDevLNB &lnb) : m_lnb(lnb)
833  {
834  setLabel(DeviceTree::tr("LNB LOF Low (MHz)"));
835  QString help = DeviceTree::tr(
836  "This defines the offset the frequency coming "
837  "from the LNB will be in low setting. For bandstacked "
838  "LNBs this is the vertical/right polarization band.");
839  setHelpText(help);
840  }
841 
842  void Load(void) override // StandardSetting
843  {
844  setValue(QString::number(m_lnb.GetLOFLow() / 1000));
845  setChanged(false);
846  }
847 
848  void Save(void) override // StandardSetting
849  {
850  m_lnb.SetLOFLow(getValue().toUInt() * 1000);
851  }
852 
853  private:
855 };
856 
858 
860 {
861  public:
862  explicit LNBLOFHighSetting(DiSEqCDevLNB &lnb) : m_lnb(lnb)
863  {
864  setLabel(DeviceTree::tr("LNB LOF High (MHz)"));
865  QString help = DeviceTree::tr(
866  "This defines the offset the frequency coming from "
867  "the LNB will be in high setting. For bandstacked "
868  "LNBs this is the horizontal/left polarization band.");
869  setHelpText(help);
870  }
871 
872  void Load(void) override // StandardSetting
873  {
874  setValue(QString::number(m_lnb.GetLOFHigh() / 1000));
875  setChanged(false);
876  }
877 
878  void Save(void) override // StandardSetting
879  {
880  m_lnb.SetLOFHigh(getValue().toUInt() * 1000);
881  }
882 
883  private:
885 };
886 
888 {
889  public:
891  m_lnb(lnb)
892  {
893  setLabel(DeviceTree::tr("LNB Reversed"));
894  QString help = DeviceTree::tr(
895  "This defines whether the signal reaching the LNB "
896  "is reversed from normal polarization. This happens "
897  "to circular signals bouncing twice on a toroidal "
898  "dish.");
899  setHelpText(help);
900  }
901 
902  void Load(void) override // StandardSetting
903  {
905  setChanged(false);
906  }
907 
908  void Save(void) override // StandardSetting
909  {
911  }
912 
913  private:
915 };
916 
918 
920 {
921  setLabel(DeviceTree::tr("LNB Configuration"));
922  setValue(lnb.GetDescription());
923 
924  parent = this;
925  auto *deviceDescr = new DeviceDescrSetting(lnb);
926  parent->addChild(deviceDescr);
927  m_preset = new LNBPresetSetting(lnb);
928  parent->addChild(m_preset);
929  m_type = new LNBTypeSetting(lnb);
930  parent->addChild(m_type);
931  m_lofSwitch = new LNBLOFSwitchSetting(lnb);
932  parent->addChild(m_lofSwitch);
933  m_lofLo = new LNBLOFLowSetting(lnb);
934  parent->addChild(m_lofLo);
935  m_lofHi = new LNBLOFHighSetting(lnb);
936  parent->addChild(m_lofHi);
938  parent->addChild(m_polInv);
939  connect(m_type, qOverload<const QString&>(&StandardSetting::valueChanged),
940  this, qOverload<const QString&>(&LNBConfig::UpdateType));
941  connect(m_preset, qOverload<const QString&>(&StandardSetting::valueChanged),
942  this, &LNBConfig::SetPreset);
943  connect(deviceDescr, qOverload<const QString&>(&StandardSetting::valueChanged),
944  this, qOverload<const QString&>(&StandardSetting::setValue));
945 }
946 
947 void LNBConfig::Load(void)
948 {
951 }
952 
953 void LNBConfig::SetPreset(const QString &value)
954 {
955  uint index = value.toUInt();
956  if (index >= (sizeof(lnb_presets) / sizeof(lnb_preset)))
957  return;
958 
959  const lnb_preset &preset = lnb_presets[index];
960  if (preset.m_name.isEmpty())
961  {
962  m_type->setEnabled(true);
963  UpdateType();
964  }
965  else
966  {
968  QString::number((uint)preset.m_type)));
969  m_lofSwitch->setValue(QString::number(preset.m_lofSw / 1000));
970  m_lofLo->setValue(QString::number(preset.m_lofLo / 1000));
971  m_lofHi->setValue(QString::number(preset.m_lofHi / 1000));
972  m_polInv->setValue(preset.m_polInv);
973  m_type->setEnabled(false);
974  m_lofSwitch->setEnabled(false);
975  m_lofHi->setEnabled(false);
976  m_lofLo->setEnabled(false);
977  m_polInv->setEnabled(false);
978  }
979 }
980 
982 {
983  if (!m_type->isEnabled())
984  return;
985 
986  switch ((DiSEqCDevLNB::dvbdev_lnb_t) m_type->getValue().toUInt())
987  {
990  m_lofSwitch->setEnabled(false);
991  m_lofHi->setEnabled(false);
992  m_lofLo->setEnabled(true);
993  m_polInv->setEnabled(true);
994  break;
996  m_lofSwitch->setEnabled(true);
997  m_lofHi->setEnabled(true);
998  m_lofLo->setEnabled(true);
999  m_polInv->setEnabled(true);
1000  break;
1002  m_lofSwitch->setEnabled(false);
1003  m_lofHi->setEnabled(true);
1004  m_lofLo->setEnabled(true);
1005  m_polInv->setEnabled(true);
1006  break;
1007  }
1008 }
1009 
1010 void LNBConfig::UpdateType(const QString &/*value*/)
1011 {
1012  UpdateType();
1013 }
1015 
1017 {
1018  PopulateTree();
1020 }
1021 
1023 {
1024  DiSEqCDevDevice *dev = devtype->GetDevice();
1025  if (dev)
1026  {
1027  DiSEqCDevDevice *parent = dev->GetParent();
1028  if (parent)
1029  parent->SetChild(dev->GetOrdinal(), nullptr);
1030  else
1031  m_tree.SetRoot(nullptr);
1032  }
1033 
1034  devtype->DeleteDevice();
1035 }
1036 
1038 {
1039  clearSettings();
1041 }
1042 
1044  StandardSetting *parent)
1045 {
1046  DiseqcConfigBase *setting = nullptr;
1047  switch (dev->GetDeviceType())
1048  {
1050  {
1051  auto *sw = dynamic_cast<DiSEqCDevSwitch*>(dev);
1052  if (sw)
1053  setting = new SwitchConfig(*sw, parent);
1054  }
1055  break;
1056 
1058  {
1059  auto *rotor = dynamic_cast<DiSEqCDevRotor*>(dev);
1060  if (rotor)
1061  setting = new RotorConfig(*rotor, parent);
1062  }
1063  break;
1064 
1066  {
1067  auto *scr = dynamic_cast<DiSEqCDevSCR*>(dev);
1068  if (scr)
1069  setting = new SCRConfig(*scr, parent);
1070  }
1071  break;
1072 
1074  {
1075  auto *lnb = dynamic_cast<DiSEqCDevLNB*>(dev);
1076  if (lnb)
1077  setting = new LNBConfig(*lnb, parent);
1078  }
1079  break;
1080 
1081  default:
1082  break;
1083  }
1084 
1085  return setting;
1086 }
1087 
1089  DiSEqCDevDevice *parent,
1090  uint childnum,
1091  GroupSetting *parentSetting)
1092 {
1093  if (node)
1094  {
1095  auto *devtype = new DeviceTypeSetting();
1096  devtype->SetDevice(node);
1097  devtype->Load();
1099  devtype);
1100 
1101  if (setting)
1102  {
1103  setting->Load();
1104  devtype->addChild(setting);
1105  PopulateChildren(node, setting);
1106 
1107  AddDeviceTypeSetting(devtype, parent, childnum, parentSetting);
1108  }
1109  else
1110  delete devtype;
1111  }
1112  else
1113  {
1114  auto *devtype = new DeviceTypeSetting();
1115  AddDeviceTypeSetting(devtype, parent, childnum, parentSetting);
1116  }
1117 }
1118 
1120  DiSEqCDevDevice *parent,
1121  uint childnum,
1122  GroupSetting *parentSetting)
1123 {
1124  if (parentSetting)
1125  parentSetting->addChild(devtype);
1126  else // Root node
1127  addChild(devtype);
1128 
1129  ConnectToValueChanged(devtype, parent, childnum);
1130 }
1131 
1133  DiSEqCDevDevice *parent,
1134  uint childnum)
1135 {
1136  auto slot = [devtype, parent, childnum, this](const QString &value)
1137  {
1138  ValueChanged(value, devtype, parent, childnum);
1139  };
1140 
1141  connect(devtype,
1142  static_cast<void (StandardSetting::*)(const QString&)>(
1144  this,
1145  slot);
1146 }
1147 
1149  GroupSetting *parentSetting)
1150 {
1151  uint num_ch = node->GetChildCount();
1152  for (uint ch = 0; ch < num_ch; ch++)
1153  {
1154  PopulateTree(node->GetChild(ch), node, ch, parentSetting);
1155  }
1156 }
1157 
1158 void DeviceTree::ValueChanged(const QString &value,
1159  DeviceTypeSetting *devtype,
1160  DiSEqCDevDevice *parent,
1161  uint childnum)
1162 {
1163  // Remove old setting from m_tree
1164  DeleteDevice(devtype);
1165 
1166  const auto type = static_cast<DiSEqCDevDevice::dvbdev_t>(value.toUInt());
1167 
1169  if (dev)
1170  {
1171  if (!parent)
1172  {
1173  m_tree.SetRoot(dev);
1174  PopulateTree();
1175  }
1176  else if (parent->SetChild(childnum, dev))
1177  {
1178  DiseqcConfigBase *newConfig =
1179  DiseqcConfigBase::CreateByType(dev, devtype);
1180  newConfig->Load();
1181 
1182  PopulateChildren(dev, newConfig);
1183 
1184  devtype->addChild(newConfig);
1185  devtype->SetDevice(dev);
1186  }
1187  else
1188  delete dev;
1189  }
1190 
1191  emit settingsChanged(this);
1192 }
1193 
1195 
1197 {
1198  public:
1200  : m_node(node), m_settings(settings)
1201  {
1202  setLabel(node.GetDescription());
1203  setHelpText(DeviceTree::tr("Choose a port to use for this switch."));
1204 
1205  uint num_children = node.GetChildCount();
1206  for (uint ch = 0; ch < num_children; ch++)
1207  {
1208  QString val = QString("%1").arg(ch);
1209  QString descr = DeviceTree::tr("Port %1").arg(ch+1);
1210  DiSEqCDevDevice *child = node.GetChild(ch);
1211  if (child)
1212  descr += QString(" (%2)").arg(child->GetDescription());
1213  addSelection(descr, val);
1214  }
1215  }
1216 
1217  void Load(void) override // StandardSetting
1218  {
1219  double value = m_settings.GetValue(m_node.GetDeviceID());
1220  setValue((uint)value);
1221  setChanged(false);
1222  }
1223 
1224  void Save(void) override // StandardSetting
1225  {
1226  m_settings.SetValue(m_node.GetDeviceID(), getValue().toDouble());
1227  }
1228 
1229  private:
1232 };
1233 
1235 
1237 {
1238  public:
1240  : m_node(node), m_settings(settings)
1241  {
1242  setLabel(node.GetDescription());
1243  setHelpText(DeviceTree::tr("Choose a satellite position."));
1244 
1245  auto *rotor = dynamic_cast<DiSEqCDevRotor*>(&m_node);
1246  if (rotor)
1247  m_posmap = rotor->GetPosMap();
1248  }
1249 
1250  void Load(void) override // StandardSetting
1251  {
1252  clearSelections();
1253 
1254  for (double d : qAsConst(m_posmap))
1255  addSelection(AngleToString(d), QString::number(d));
1256 
1257  double angle = m_settings.GetValue(m_node.GetDeviceID());
1258  setValue(getValueIndex(QString::number(angle)));
1259  setChanged(false);
1260  }
1261 
1262  void Save(void) override // StandardSetting
1263  {
1264  m_settings.SetValue(m_node.GetDeviceID(), getValue().toDouble());
1265  }
1266 
1267  private:
1271 };
1272 
1274 
1276 {
1277  public:
1280  m_hemisphere(new TransMythUIComboBoxSetting(/*false*/)),
1281  m_node(node), m_settings(settings)
1282  {
1283  QString help =
1284  DeviceTree::tr(
1285  "Locates the satellite you wish to point to "
1286  "with the longitude along the Clarke Belt of "
1287  "the satellite [-180..180] and its hemisphere.");
1288 
1289  m_numeric->setLabel(DeviceTree::tr("Longitude (degrees)"));
1291  m_hemisphere->setLabel(DeviceTree::tr("Hemisphere"));
1292  m_hemisphere->addSelection(DeviceTree::tr("Eastern"), "E", false);
1293  m_hemisphere->addSelection(DeviceTree::tr("Western"), "W", true);
1295 
1298 
1299  addChild(new RotorConfig(dynamic_cast<DiSEqCDevRotor&>(m_node), this));
1300  }
1301 
1302  void Load(void) override // StandardSetting
1303  {
1304  double val = m_settings.GetValue(m_node.GetDeviceID());
1305  QString hemi;
1306  double eval = AngleToEdit(val, hemi);
1307  m_numeric->setValue(QString::number(eval));
1310  }
1311 
1312  void Save(void) override // StandardSetting
1313  {
1314  QString val = QString::number(m_numeric->getValue().toDouble());
1315  val += m_hemisphere->getValue();
1317  }
1318 
1319  private:
1324 };
1325 
1327 
1329 {
1330  public:
1332  : m_node(node), m_settings(settings)
1333  {
1334  setLabel("Position");
1335  setHelpText(DeviceTree::tr("Unicable satellite position (A/B)"));
1337  QString::number((uint)DiSEqCDevSCR::kTypeScrPosA), true);
1339  QString::number((uint)DiSEqCDevSCR::kTypeScrPosB), false);
1340  }
1341 
1342  void Load(void) override // StandardSetting
1343  {
1344  double value = m_settings.GetValue(m_node.GetDeviceID());
1345  setValue(getValueIndex(QString::number((uint)value)));
1346  setChanged(false);
1347  }
1348 
1349  void Save(void) override // StandardSetting
1350  {
1351  m_settings.SetValue(m_node.GetDeviceID(), getValue().toDouble());
1352  }
1353 
1354  private:
1357 };
1358 
1360 
1362  DiSEqCDevSettings &settings, uint cardid, bool switches_enabled) :
1363  m_settings(settings), m_switchesEnabled(switches_enabled)
1364 {
1365  setLabel(DeviceTree::tr("DTV Device Configuration"));
1366 
1367  // load
1368  m_tree.Load(cardid);
1369 
1370  // initial UI setup
1371  AddNodes(this, QString(), m_tree.Root());
1372 }
1373 
1375  StandardSetting *group, const QString &trigger, DiSEqCDevDevice *node)
1376 {
1377  if (!node)
1378  return;
1379 
1380  StandardSetting *setting = nullptr;
1381  switch (node->GetDeviceType())
1382  {
1384  setting = new SwitchSetting(*node, m_settings);
1385  setting->setEnabled(m_switchesEnabled);
1386  break;
1388  {
1389  auto *rotor = dynamic_cast<DiSEqCDevRotor*>(node);
1390  if (rotor && (rotor->GetType() == DiSEqCDevRotor::kTypeDiSEqC_1_2))
1391  setting = new RotorSetting(*node, m_settings);
1392  else
1393  setting = new USALSRotorSetting(*node, m_settings);
1394  break;
1395  }
1397  {
1398  setting = new SCRPositionSetting(*node, m_settings);
1399  break;
1400  }
1401  default:
1402  break;
1403  }
1404 
1405  if (!setting)
1406  return;
1407 
1408  m_devs[node->GetDeviceID()] = setting;
1409 
1410  uint num_ch = node->GetChildCount();
1412  {
1413  for (uint i = 0; i < num_ch; i++)
1414  AddNodes(setting, QString::number(i), node->GetChild(i));
1415 
1416  AddChild(group, trigger, setting);
1417  return;
1418  }
1419 
1420  if (!num_ch)
1421  {
1422  AddChild(group, trigger, setting);
1423  return;
1424  }
1425 
1426  AddChild(group, trigger, setting);
1427  for (uint i = 0; i < num_ch; i++)
1428  AddNodes(group, trigger, node->GetChild(i));
1429 }
1430 
1432  StandardSetting *group, const QString &trigger, StandardSetting *setting)
1433 {
1434  if (!trigger.isEmpty())
1435  group->addTargetedChild(trigger, setting);
1436  else
1437  group->addChild(setting);
1438 }
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:1119
SCRUserBandSetting::m_scr
DiSEqCDevSCR & m_scr
Definition: diseqcsettings.cpp:604
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:494
e
QDomElement e
Definition: mythplugins/mytharchive/mytharchivehelper/main.cpp:1420
DiSEqCDevRotor::kTypeDiSEqC_1_2
@ kTypeDiSEqC_1_2
Definition: diseqc.h:316
RotorConfig::Load
void Load() override
Definition: diseqcsettings.cpp:568
LNBPolarityInvertedSetting::Save
void Save(void) override
Definition: diseqcsettings.cpp:908
DiSEqCDevDevice::GetChildCount
virtual uint GetChildCount(void) const
Retrieves the proper number of children for this node.
Definition: diseqc.h:177
RotorSetting
Definition: diseqcsettings.cpp:1237
SwitchTypeSetting
Definition: diseqcsettings.cpp:154
SCRPINSetting::SCRPINSetting
SCRPINSetting(DiSEqCDevSCR &scr)
Definition: diseqcsettings.cpp:638
DTVDeviceConfigGroup::DTVDeviceConfigGroup
DTVDeviceConfigGroup(DiSEqCDevSettings &settings, uint cardid, bool switches_enabled)
Definition: diseqcsettings.cpp:1361
SwitchSetting::m_settings
DiSEqCDevSettings & m_settings
Definition: diseqcsettings.cpp:1231
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:199
StandardSetting::setValue
virtual void setValue(const QString &newValue)
Definition: standardsettings.cpp:163
LNBLOFHighSetting::Load
void Load(void) override
Definition: diseqcsettings.cpp:872
SCRPINSetting::Save
void Save(void) override
Definition: diseqcsettings.cpp:650
DiSEqCDevRotor
Rotor class.
Definition: diseqc.h:303
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:1322
LNBConfig::SetPreset
void SetPreset(const QString &value)
Definition: diseqcsettings.cpp:953
DiSEqCDevRotor::kTypeDiSEqC_1_3
@ kTypeDiSEqC_1_3
Definition: diseqc.h:316
DeviceTree::PopulateChildren
void PopulateChildren(DiSEqCDevDevice *node, GroupSetting *parentSetting)
Definition: diseqcsettings.cpp:1148
SwitchConfig
Definition: diseqcsettings.h:34
SCRFrequencySetting::Save
void Save(void) override
Definition: diseqcsettings.cpp:624
DiSEqCLatitude
static GlobalTextEditSetting * DiSEqCLatitude(void)
Definition: diseqcsettings.cpp:18
MythUICheckBoxSetting::setValue
virtual void setValue(const QString &newValue)
Definition: standardsettings.cpp:163
lnb_preset::m_lofSw
uint m_lofSw
Definition: diseqcsettings.cpp:687
RotorLoSpeedSetting
Definition: diseqcsettings.cpp:366
TransMythUIComboBoxSetting
Definition: standardsettings.h:270
AngleToEdit
static double AngleToEdit(double angle, QString &hemi)
Definition: diseqcsettings.cpp:441
TransTextEditSetting
Definition: standardsettings.h:159
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:694
RotorSetting::m_posmap
uint_to_dbl_t m_posmap
Definition: diseqcsettings.cpp:1270
DiSEqCDevLNB::GetType
dvbdev_lnb_t GetType(void) const
Definition: diseqc.h:472
LNBTypeSetting
Definition: diseqcsettings.cpp:765
SCRPINSetting::Load
void Load(void) override
Definition: diseqcsettings.cpp:644
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:214
LNBConfig::m_lofHi
LNBLOFHighSetting * m_lofHi
Definition: diseqcsettings.h:126
DeviceTypeSetting::DeleteDevice
void DeleteDevice()
Definition: diseqcsettings.cpp:73
TransMythUISpinBoxSetting
Definition: standardsettings.h:351
DiSEqCDevDevice::GetDescription
QString GetDescription(void) const
Definition: diseqc.h:175
SCRPositionSetting
Definition: diseqcsettings.cpp:1329
RotorLoSpeedSetting::RotorLoSpeedSetting
RotorLoSpeedSetting(DiSEqCDevRotor &rotor)
Definition: diseqcsettings.cpp:368
SCRPositionSetting::m_settings
DiSEqCDevSettings & m_settings
Definition: diseqcsettings.cpp:1356
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:1016
RotorConfig
Definition: diseqcsettings.h:75
arg
arg(title).arg(filename).arg(doDelete))
mythdbcon.h
lnb_preset::m_lofLo
uint m_lofLo
Definition: diseqcsettings.cpp:688
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:406
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:2006
LNBPresetSetting
Definition: diseqcsettings.cpp:731
SCRUserBandSetting::Load
void Load(void) override
Definition: diseqcsettings.cpp:592
lnb_preset
Definition: diseqcsettings.cpp:675
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:153
SCRConfig::SCRConfig
SCRConfig(DiSEqCDevSCR &scr, StandardSetting *parent)
Definition: diseqcsettings.cpp:661
StandardSetting::addTargetedChild
void addTargetedChild(const QString &value, StandardSetting *setting)
Definition: standardsettings.cpp:110
DiSEqCDevLNB::kTypeBandstacked
@ kTypeBandstacked
Definition: diseqc.h:463
RotorSetting::m_node
DiSEqCDevDevice & m_node
Definition: diseqcsettings.cpp:1268
DiSEqCDevDevice
Represents a node in a DVB-S device network.
Definition: diseqc.h:140
DeviceDescrSetting::Load
void Load(void) override
Definition: diseqcsettings.cpp:103
LNBLOFSwitchSetting::LNBLOFSwitchSetting
LNBLOFSwitchSetting(DiSEqCDevLNB &lnb)
Definition: diseqcsettings.cpp:803
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:848
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:113
LNBLOFHighSetting::m_lnb
DiSEqCDevLNB & m_lnb
Definition: diseqcsettings.cpp:884
DeviceTypeSetting::m_device
DiSEqCDevDevice * m_device
Definition: diseqcsettings.cpp:85
DiseqcConfigBase::DeleteClicked
void DeleteClicked(void)
DeviceTree::DeleteDevice
void DeleteDevice(DeviceTypeSetting *devtype)
Definition: diseqcsettings.cpp:1022
LNBPolarityInvertedSetting::Load
void Load(void) override
Definition: diseqcsettings.cpp:902
LNBConfig::Load
void Load(void) override
Definition: diseqcsettings.cpp:947
DiSEqCDevSCR::SetFrequency
void SetFrequency(uint freq)
Definition: diseqc.h:403
lnb_preset::m_lofHi
uint m_lofHi
Definition: diseqcsettings.cpp:689
SwitchAddressSetting::Load
void Load(void) override
Definition: diseqcsettings.cpp:210
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:31
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:28
SwitchSetting::m_node
DiSEqCDevDevice & m_node
Definition: diseqcsettings.cpp:1230
RotorPosMap::Save
void Save(void) override
Definition: diseqcsettings.cpp:483
DeviceTree::PopulateTree
void PopulateTree(void)
Definition: diseqcsettings.cpp:1037
DiSEqCDevSettings
DVB-S device settings class.
Definition: diseqc.h:37
MythUIButtonListItem
Definition: mythuibuttonlist.h:28
LNBPresetSetting::m_lnb
DiSEqCDevLNB & m_lnb
Definition: diseqcsettings.cpp:759
StandardSetting::setChanged
void setChanged(bool changed)
Definition: standardsettings.cpp:203
RotorPosTextEdit::RotorPosTextEdit
RotorPosTextEdit(const QString &label, uint id, const QString &value)
Definition: diseqcsettings.cpp:491
RotorSetting::Load
void Load(void) override
Definition: diseqcsettings.cpp:1250
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:64
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:542
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:890
DiSEqCDevLNB::IsPolarityInverted
bool IsPolarityInverted(void) const
Definition: diseqc.h:476
DeviceRepeatSetting::m_device
DiSEqCDevDevice & m_device
Definition: diseqcsettings.cpp:148
mythlogging.h
lnb_preset::m_type
DiSEqCDevLNB::dvbdev_lnb_t m_type
Definition: diseqcsettings.cpp:686
DeviceTree::m_tree
DiSEqCDevTree & m_tree
Definition: diseqcsettings.h:163
MythUIComboBoxSetting
Definition: standardsettings.h:216
LNBTypeSetting::LNBTypeSetting
LNBTypeSetting(DiSEqCDevLNB &lnb)
Definition: diseqcsettings.cpp:767
LNBTypeSetting::Save
void Save(void) override
Definition: diseqcsettings.cpp:789
LNBLOFSwitchSetting::Save
void Save(void) override
Definition: diseqcsettings.cpp:818
DiSEqCDevSwitch::GetAddress
uint GetAddress(void) const
Definition: diseqc.h:255
DiSEqCDevLNB::kTypeFixed
@ kTypeFixed
Definition: diseqc.h:460
SCRPINSetting
Definition: diseqcsettings.cpp:636
SwitchTypeSetting::Load
void Load(void) override
Definition: diseqcsettings.cpp:182
RotorPosTextEdit
Definition: diseqcsettings.cpp:489
DiSEqCDevLNB::dvbdev_lnb_t
dvbdev_lnb_t
Definition: diseqc.h:459
FindPreset
static uint FindPreset(const DiSEqCDevLNB &lnb)
Definition: diseqcsettings.cpp:713
RotorPosMap
Definition: diseqcsettings.h:53
MythUISpinBoxSetting::intValue
int intValue()
Definition: standardsettings.cpp:653
USALSRotorSetting::Load
void Load(void) override
Definition: diseqcsettings.cpp:1302
LNBLOFHighSetting::LNBLOFHighSetting
LNBLOFHighSetting(DiSEqCDevLNB &lnb)
Definition: diseqcsettings.cpp:862
DeviceDescrSetting::DeviceDescrSetting
DeviceDescrSetting(DiSEqCDevDevice &device)
Definition: diseqcsettings.cpp:93
StandardSetting::Load
virtual void Load(void)
Definition: standardsettings.cpp:208
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:1431
SwitchTypeSetting::m_switch
DiSEqCDevSwitch & m_switch
Definition: diseqcsettings.cpp:195
lnb_preset::m_name
QString m_name
Definition: diseqcsettings.cpp:685
DeviceTree::ValueChanged
void ValueChanged(const QString &value, DeviceTypeSetting *devtype, DiSEqCDevDevice *parent, uint childnum)
Definition: diseqcsettings.cpp:1158
DiSEqCDevSCR
Unicable / SCR Class.
Definition: diseqc.h:383
DiSEqCDevDevice::dvbdev_t
dvbdev_t
Definition: diseqc.h:154
StandardSetting::setHelpText
virtual void setHelpText(const QString &str)
Definition: standardsettings.h:37
RotorSetting::RotorSetting
RotorSetting(DiSEqCDevDevice &node, DiSEqCDevSettings &settings)
Definition: diseqcsettings.cpp:1239
SCRUserBandSetting::SCRUserBandSetting
SCRUserBandSetting(DiSEqCDevSCR &scr)
Definition: diseqcsettings.cpp:585
USALSRotorSetting::USALSRotorSetting
USALSRotorSetting(DiSEqCDevDevice &node, DiSEqCDevSettings &settings)
Definition: diseqcsettings.cpp:1278
DiSEqCDevTree::Load
bool Load(const QString &device)
Loads the device tree from the database.
Definition: diseqc.cpp:306
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:468
USALSRotorSetting::m_numeric
TransTextEditSetting * m_numeric
Definition: diseqcsettings.cpp:1320
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:629
DiSEqCDevLNB
LNB Class.
Definition: diseqc.h:447
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:477
DeviceTypeSetting::Load
void Load(void) override
Definition: diseqcsettings.cpp:58
StandardSetting::getValue
virtual QString getValue(void) const
Definition: standardsettings.h:51
DiSEqCDevLNB::SetPolarityInverted
void SetPolarityInverted(bool inv)
Definition: diseqc.h:469
DiSEqCDevSwitch::dvbdev_switch_t
dvbdev_switch_t
Definition: diseqc.h:238
LNBConfig::UpdateType
void UpdateType(void)
Definition: diseqcsettings.cpp:981
USALSRotorSetting::m_hemisphere
TransMythUIComboBoxSetting * m_hemisphere
Definition: diseqcsettings.cpp:1321
DiseqcConfigBase::CreateByType
static DiseqcConfigBase * CreateByType(DiSEqCDevDevice *dev, StandardSetting *parent)
Definition: diseqcsettings.cpp:1043
uint
unsigned int uint
Definition: compat.h:140
DiSEqCDevRotor::GetPosMap
uint_to_dbl_t GetPosMap(void) const
Definition: diseqc.cpp:1996
RotorTypeSetting::m_rotor
DiSEqCDevRotor & m_rotor
Definition: diseqcsettings.cpp:360
SCRFrequencySetting::SCRFrequencySetting
SCRFrequencySetting(DiSEqCDevSCR &scr)
Definition: diseqcsettings.cpp:612
DiSEqCDevSCR::GetUserBand
uint GetUserBand(void) const
Definition: diseqc.h:408
SCRFrequencySetting::Load
void Load(void) override
Definition: diseqcsettings.cpp:618
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:91
DiSEqCDevDevice::GetOrdinal
uint GetOrdinal(void) const
Definition: diseqc.h:174
SCRPositionSetting::Load
void Load(void) override
Definition: diseqcsettings.cpp:1342
DiSEqCDevDevice::CreateByType
static DiSEqCDevDevice * CreateByType(DiSEqCDevTree &tree, dvbdev_t type, uint dev_id=0)
Definition: diseqc.cpp:934
RotorPosMap::PopulateList
void PopulateList(void)
Definition: diseqcsettings.cpp:520
LNBLOFSwitchSetting::m_lnb
DiSEqCDevLNB & m_lnb
Definition: diseqcsettings.cpp:824
SCRPositionSetting::SCRPositionSetting
SCRPositionSetting(DiSEqCDevDevice &node, DiSEqCDevSettings &settings)
Definition: diseqcsettings.cpp:1331
DiSEqCDevLNB::GetLOFSwitch
uint GetLOFSwitch(void) const
Definition: diseqc.h:473
SwitchSetting::Save
void Save(void) override
Definition: diseqcsettings.cpp:1224
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:21
DiSEqCDevDevice::kTypeLNB
@ kTypeLNB
Definition: diseqc.h:158
DiSEqCDevSwitch::kTypeDiSEqCCommitted
@ kTypeDiSEqCCommitted
Definition: diseqc.h:240
GlobalTextEditSetting
Definition: standardsettings.h:173
SwitchConfig::Load
void Load(void) override
Definition: diseqcsettings.cpp:275
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:91
LNBLOFHighSetting::Save
void Save(void) override
Definition: diseqcsettings.cpp:878
LNBConfig
Definition: diseqcsettings.h:109
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:479
DiSEqCDevSwitch::kTypeMiniDiSEqC
@ kTypeMiniDiSEqC
Definition: diseqc.h:246
DeviceDescrSetting::m_device
DiSEqCDevDevice & m_device
Definition: diseqcsettings.cpp:115
LNBPresetSetting::Load
void Load(void) override
Definition: diseqcsettings.cpp:748
LNBPolarityInvertedSetting
Definition: diseqcsettings.cpp:888
DeviceTypeSetting::DeviceTypeSetting
DeviceTypeSetting()
Definition: diseqcsettings.cpp:43
DiSEqCDevSwitch::SetNumPorts
void SetNumPorts(uint num_ports)
Definition: diseqc.cpp:1338
DiSEqCDevSCR::SetPIN
void SetPIN(int pin)
Definition: diseqc.h:404
SwitchTypeSetting::SwitchTypeSetting
SwitchTypeSetting(DiSEqCDevSwitch &switch_dev)
Definition: diseqcsettings.cpp:156
RotorTypeSetting::Load
void Load(void) override
Definition: diseqcsettings.cpp:348
DTVDeviceConfigGroup::AddNodes
void AddNodes(StandardSetting *group, const QString &trigger, DiSEqCDevDevice *node)
Definition: diseqcsettings.cpp:1374
RotorPosTextEdit::m_id
uint m_id
Definition: diseqcsettings.cpp:505
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:337
lnb_preset::m_polInv
bool m_polInv
Definition: diseqcsettings.cpp:690
DiSEqCDevSCR::kTypeScrPosA
@ kTypeScrPosA
Definition: diseqc.h:399
DiSEqCDevSwitch::kTypeLegacySW64
@ kTypeLegacySW64
Definition: diseqc.h:244
SCRFrequencySetting
Definition: diseqcsettings.cpp:610
LNBConfig::LNBConfig
LNBConfig(DiSEqCDevLNB &lnb, StandardSetting *parent)
Definition: diseqcsettings.cpp:919
SwitchAddressSetting
Definition: diseqcsettings.cpp:201
RotorHiSpeedSetting::m_rotor
DiSEqCDevRotor & m_rotor
Definition: diseqcsettings.cpp:420
SCRUserBandSetting::Save
void Save(void) override
Definition: diseqcsettings.cpp:598
DiSEqCDevSwitch::kTypeLegacySW42
@ kTypeLegacySW42
Definition: diseqc.h:243
DiSEqCDevSwitch::kTypeLegacySW21
@ kTypeLegacySW21
Definition: diseqc.h:242
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:754
SwitchTypeSetting::Save
void Save(void) override
Definition: diseqcsettings.cpp:188
LNBLOFLowSetting::Load
void Load(void) override
Definition: diseqcsettings.cpp:842
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:677
SwitchPortsSetting::SwitchPortsSetting
SwitchPortsSetting(DiSEqCDevSwitch &switch_dev)
Definition: diseqcsettings.cpp:230
LNBTypeSetting::m_lnb
DiSEqCDevLNB & m_lnb
Definition: diseqcsettings.cpp:795
DiSEqCDevSwitch::SetType
void SetType(dvbdev_switch_t type)
Definition: diseqc.h:248
LNBLOFHighSetting
Definition: diseqcsettings.cpp:860
SCRPositionSetting::m_node
DiSEqCDevDevice & m_node
Definition: diseqcsettings.cpp:1355
DeviceTree::ConnectToValueChanged
void ConnectToValueChanged(DeviceTypeSetting *devtype, DiSEqCDevDevice *parent, uint childnum)
Definition: diseqcsettings.cpp:1132
RotorLoSpeedSetting::m_rotor
DiSEqCDevRotor & m_rotor
Definition: diseqcsettings.cpp:390
USALSRotorSetting::m_settings
DiSEqCDevSettings & m_settings
Definition: diseqcsettings.cpp:1323
RotorConfig::SetType
void SetType(const QString &type)
Definition: diseqcsettings.cpp:574
GetMythMainWindow
MythMainWindow * GetMythMainWindow(void)
Definition: mythmainwindow.cpp:105
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:498
build_compdb.action
action
Definition: build_compdb.py:9
RotorLoSpeedSetting::Save
void Save(void) override
Definition: diseqcsettings.cpp:384
USALSRotorSetting
Definition: diseqcsettings.cpp:1276
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:1262
LNBLOFLowSetting::m_lnb
DiSEqCDevLNB & m_lnb
Definition: diseqcsettings.cpp:854
DTVDeviceConfigGroup::m_switchesEnabled
bool m_switchesEnabled
Definition: diseqcsettings.h:184
StandardSetting
Definition: standardsettings.h:30
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:228
SCRPINSetting::m_scr
DiSEqCDevSCR & m_scr
Definition: diseqcsettings.cpp:656
DiSEqCDevDevice::GetDeviceID
uint GetDeviceID(void) const
Definition: diseqc.h:170
MythUICheckBoxSetting
Definition: standardsettings.h:388
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:68
RotorTypeSetting
Definition: diseqcsettings.cpp:335
RotorHiSpeedSetting
Definition: diseqcsettings.cpp:396
LNBTypeSetting::Load
void Load(void) override
Definition: diseqcsettings.cpp:783
RotorSetting::m_settings
DiSEqCDevSettings & m_settings
Definition: diseqcsettings.cpp:1269
SwitchConfig::m_type
SwitchTypeSetting * m_type
Definition: diseqcsettings.h:47
SCRFrequencySetting::m_scr
DiSEqCDevSCR & m_scr
Definition: diseqcsettings.cpp:630
RotorPosMap::m_posmap
uint_to_dbl_t m_posmap
Definition: diseqcsettings.h:71
SwitchSetting::Load
void Load(void) override
Definition: diseqcsettings.cpp:1217
DiSEqCDevRotor::GetLoSpeed
double GetLoSpeed(void) const
Definition: diseqc.h:326
MythUICheckBoxSetting::setValue
void setValue(const QString &newValue) override
Definition: standardsettings.cpp:695
RotorPosMap::valueChanged
void valueChanged(StandardSetting *setting)
Definition: diseqcsettings.cpp:508
SCRPositionSetting::Save
void Save(void) override
Definition: diseqcsettings.cpp:1349
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:812
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:216
LNBLOFSwitchSetting
Definition: diseqcsettings.cpp:801
LNBLOFLowSetting
Definition: diseqcsettings.cpp:830
LNBPolarityInvertedSetting::m_lnb
DiSEqCDevLNB & m_lnb
Definition: diseqcsettings.cpp:914
MythUIComboBoxSetting::setValue
void setValue(int value) override
Definition: standardsettings.cpp:459
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:1199
GroupSetting
Definition: standardsettings.h:433
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:733
USALSRotorSetting::Save
void Save(void) override
Definition: diseqcsettings.cpp:1312
DiSEqCDevSwitch::GetNumPorts
uint GetNumPorts(void) const
Definition: diseqc.h:256
DiSEqCDevSwitch
Switch class, including tone, legacy and DiSEqC switches.
Definition: diseqc.h:224
MythUICheckBoxSetting::boolValue
bool boolValue()
Definition: standardsettings.h:398
LNBLOFLowSetting::LNBLOFLowSetting
LNBLOFLowSetting(DiSEqCDevLNB &lnb)
Definition: diseqcsettings.cpp:832
SwitchSetting
Definition: diseqcsettings.cpp:1197