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