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, SIGNAL(valueChanged(const QString&)),
270  this, SLOT( update(void)));
271  connect(m_deviceDescr, SIGNAL(valueChanged(const QString&)),
272  SLOT(setValue(const QString&)));
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 
312 {
313  QStringList actions;
314  if (GetMythMainWindow()->TranslateKeyPress("Global", e, actions))
315  return true;
316 
317  bool handled = false;
318  for (const QString & action : qAsConst(actions))
319  {
320  if (action == "DELETE")
321  {
322  handled = true;
323  emit DeleteClicked();
324  break;
325  }
326  }
327 
328  return handled;
329 }
330 
332 
334 {
335  public:
336  explicit RotorTypeSetting(DiSEqCDevRotor &rotor) :
337  m_rotor(rotor)
338  {
339  setLabel(DeviceTree::tr("Rotor Type"));
340  setHelpText(DeviceTree::tr("Select the type of rotor from the list."));
341  addSelection(DeviceTree::tr("DiSEqC 1.2"),
342  QString::number((uint) DiSEqCDevRotor::kTypeDiSEqC_1_2));
343  addSelection(DeviceTree::tr("DiSEqC 1.3 (GotoX/USALS)"),
344  QString::number((uint) DiSEqCDevRotor::kTypeDiSEqC_1_3));
345  }
346 
347  void Load(void) override // StandardSetting
348  {
349  setValue(getValueIndex(QString::number((uint)m_rotor.GetType())));
350  setChanged(false);
351  }
352 
353  void Save(void) override // StandardSetting
354  {
356  }
357 
358  private:
360 };
361 
363 
365 {
366  public:
368  m_rotor(rotor)
369  {
370  setLabel(DeviceTree::tr("Rotor Low Speed (deg/sec)"));
371  QString help = DeviceTree::tr(
372  "To allow the approximate monitoring of rotor movement, enter "
373  "the rated angular speed of the rotor when powered at 13V.");
374  setHelpText(help);
375  }
376 
377  void Load(void) override // StandardSetting
378  {
379  setValue(QString::number(m_rotor.GetLoSpeed()));
380  setChanged(false);
381  }
382 
383  void Save(void) override // StandardSetting
384  {
385  m_rotor.SetLoSpeed(getValue().toDouble());
386  }
387 
388  private:
390 };
391 
393 
395 {
396  public:
398  m_rotor(rotor)
399  {
400  setLabel(DeviceTree::tr("Rotor High Speed (deg/sec)"));
401  QString help = DeviceTree::tr(
402  "To allow the approximate monitoring of rotor movement, enter "
403  "the rated angular speed of the rotor when powered at 18V.");
404  setHelpText(help);
405  }
406 
407  void Load(void) override // StandardSetting
408  {
409  setValue(QString::number(m_rotor.GetHiSpeed()));
410  setChanged(false);
411  }
412 
413  void Save(void) override // StandardSetting
414  {
415  m_rotor.SetHiSpeed(getValue().toDouble());
416  }
417 
418  private:
420 };
421 
423 
424 static QString AngleToString(double angle)
425 {
426  QString str;
427  if (angle >= 0.0)
428  {
429  str = QString::number(angle) +
430  DeviceTree::tr("E", "Eastern Hemisphere");
431  }
432  else /* if (angle < 0.0) */
433  {
434  str = QString::number(-angle) +
435  DeviceTree::tr("W", "Western Hemisphere");
436  }
437  return str;
438 }
439 
440 static double AngleToEdit(double angle, QString &hemi)
441 {
442  if (angle > 0.0)
443  {
444  hemi = "E";
445  return angle;
446  }
447 
448  hemi = "W";
449  return -angle;
450 }
451 
452 static double AngleToFloat(const QString &angle, bool translated = true)
453 {
454  if (angle.length() < 2)
455  return 0.0;
456 
457  double pos = NAN;
458  QChar postfix = angle.at(angle.length() - 1);
459  if (postfix.isLetter())
460  {
461  pos = angle.left(angle.length() - 1).toDouble();
462  if ((translated &&
463  (postfix.toUpper() ==
464  DeviceTree::tr("W", "Western Hemisphere")[0])) ||
465  (!translated && (postfix.toUpper() == 'W')))
466  {
467  pos = -pos;
468  }
469  }
470  else
471  pos = angle.toDouble();
472 
473  return pos;
474 }
475 
477 {
479  PopulateList();
480 }
481 
483 {
485 }
486 
488 {
489 public:
490  RotorPosTextEdit(const QString &label, uint id, const QString &value) :
491  m_id(id)
492  {
493  setLabel(label);
494  setValue(value);
495  }
496 
497  void updateButton(MythUIButtonListItem *item) override // MythUITextEditSetting
498  {
500  if (getValue().isEmpty())
501  item->SetText(DeviceTree::tr("None"), "value");
502  }
503 
505 };
506 
508 {
509  auto *posEdit = dynamic_cast<RotorPosTextEdit*>(setting);
510  if (posEdit == nullptr)
511  return;
512  QString value = posEdit->getValue();
513  if (value.isEmpty())
514  m_posmap.erase(m_posmap.find(posEdit->m_id));
515  else
516  m_posmap[posEdit->m_id] = AngleToFloat(posEdit->getValue());
517 }
518 
520 {
521  uint num_pos = 64;
522  for (uint pos = 1; pos < num_pos; pos++)
523  {
524  uint_to_dbl_t::const_iterator it = m_posmap.find(pos);
525  QString posval;
526  if (it != m_posmap.end())
527  posval = AngleToString(*it);
528 
529  auto *posEdit =
530  new RotorPosTextEdit(DeviceTree::tr("Position #%1").arg(pos),
531  pos,
532  posval);
533  connect(posEdit, SIGNAL(valueChanged(StandardSetting*)),
534  SLOT(valueChanged(StandardSetting*)));
535  addChild(posEdit);
536  }
537 }
538 
540 
542  : m_rotor(rotor)
543 {
544  setLabel(DeviceTree::tr("Rotor Configuration"));
545  setValue(rotor.GetDescription());
546 
547  parent = this;
548  parent->addChild(new DeviceDescrSetting(rotor));
549  parent->addChild(new DeviceRepeatSetting(rotor));
550 
551  auto *rtype = new RotorTypeSetting(rotor);
552  connect(rtype, SIGNAL(valueChanged(const QString&)),
553  this, SLOT( SetType( const QString&)));
554  parent->addChild(rtype);
555 
556  m_pos = new RotorPosMap(rotor);
557  m_pos->setLabel(DeviceTree::tr("Positions"));
558  m_pos->setHelpText(DeviceTree::tr("Rotor position setup."));
559  parent->addChild(m_pos);
560 
561  parent->addChild(new RotorLoSpeedSetting(rotor));
562  parent->addChild(new RotorHiSpeedSetting(rotor));
563  parent->addChild(DiSEqCLatitude());
564  parent->addChild(DiSEqCLongitude());
565 }
566 
568 {
571 }
572 
573 void RotorConfig::SetType(const QString &type)
574 {
575  auto rtype = (DiSEqCDevRotor::dvbdev_rotor_t) type.toUInt();
577 }
578 
580 
582 {
583  public:
585  TransMythUISpinBoxSetting(0, 8, 1), m_scr(scr)
586  {
587  setLabel(DeviceTree::tr("Userband"));
588  setHelpText(DeviceTree::tr("Unicable userband ID (0-7) or sometimes (1-8)"));
589  }
590 
591  void Load(void) override // StandardSetting
592  {
594  setChanged(false);
595  }
596 
597  void Save(void) override // StandardSetting
598  {
600  }
601 
602  private:
604 };
605 
607 
609 {
610  public:
611  explicit SCRFrequencySetting(DiSEqCDevSCR &scr) : m_scr(scr)
612  {
613  setLabel(DeviceTree::tr("Frequency (MHz)"));
614  setHelpText(DeviceTree::tr("Unicable userband frequency (usually 1210, 1420, 1680 and 2040 MHz)"));
615  }
616 
617  void Load(void) override // StandardSetting
618  {
619  setValue(QString::number(m_scr.GetFrequency()));
620  setChanged(false);
621  }
622 
623  void Save(void) override // StandardSetting
624  {
625  m_scr.SetFrequency(getValue().toUInt());
626  }
627 
628  private:
630 };
631 
633 
635 {
636  public:
637  explicit SCRPINSetting(DiSEqCDevSCR &scr) : m_scr(scr)
638  {
639  setLabel(DeviceTree::tr("PIN code"));
640  setHelpText(DeviceTree::tr("Unicable PIN code (-1 disabled, 0 - 255)"));
641  }
642 
643  void Load(void) override // StandardSetting
644  {
645  setValue(QString::number(m_scr.GetPIN()));
646  setChanged(false);
647  }
648 
649  void Save(void) override // StandardSetting
650  {
651  m_scr.SetPIN(getValue().toInt());
652  }
653 
654  private:
656 };
657 
659 
661 {
662  setLabel(DeviceTree::tr("Unicable Configuration"));
663 
664  parent = this;
665  parent->addChild(new SCRUserBandSetting(scr));
666  parent->addChild(new SCRFrequencySetting(scr));
667  parent->addChild(new SCRPINSetting(scr));
668  parent->addChild(new DeviceRepeatSetting(scr));
669 }
670 
672 
674 {
675  public:
677  uint _lof_sw = 0, uint _lof_lo = 0,
678  uint _lof_hi = 0, bool _pol_inv = false) :
679  m_name(std::move(_name)), m_type(_type),
680  m_lofSw(_lof_sw), m_lofLo(_lof_lo),
681  m_lofHi(_lof_hi), m_polInv(_pol_inv) {}
682 
683  public:
684  QString m_name;
689  bool m_polInv;
690 };
691 
692 static const std::array<const lnb_preset,7> lnb_presets
693 {
694 
695  /* description, type, LOF switch, LOF low, LOF high, inverted polarity */
696  lnb_preset(QT_TRANSLATE_NOOP("DeviceTree", "Universal (Europe)"),
698  11700000, 9750000, 10600000),
699  lnb_preset(QT_TRANSLATE_NOOP("DeviceTree", "Single (Europe)"),
701  lnb_preset(QT_TRANSLATE_NOOP("DeviceTree", "Circular (N. America)"),
702  DiSEqCDevLNB::kTypeVoltageControl, 0, 11250000),
703  lnb_preset(QT_TRANSLATE_NOOP("DeviceTree", "Linear (N. America)"),
704  DiSEqCDevLNB::kTypeVoltageControl, 0, 10750000),
705  lnb_preset(QT_TRANSLATE_NOOP("DeviceTree", "C Band"),
707  lnb_preset(QT_TRANSLATE_NOOP("DeviceTree", "DishPro Bandstacked"),
708  DiSEqCDevLNB::kTypeBandstacked, 0, 11250000, 14350000),
710 };
711 
712 static uint FindPreset(const DiSEqCDevLNB &lnb)
713 {
714  uint i = 0;
715  for ( ; !lnb_presets[i].m_name.isEmpty(); i++)
716  {
717  if (lnb_presets[i].m_type == lnb.GetType() &&
718  lnb_presets[i].m_lofSw == lnb.GetLOFSwitch() &&
719  lnb_presets[i].m_lofLo == lnb.GetLOFLow() &&
720  lnb_presets[i].m_lofHi == lnb.GetLOFHigh() &&
721  lnb_presets[i].m_polInv== lnb.IsPolarityInverted())
722  {
723  break;
724  }
725  }
726  return i;
727 }
728 
730 {
731  public:
732  explicit LNBPresetSetting(DiSEqCDevLNB &lnb) : m_lnb(lnb)
733  {
734  setLabel(DeviceTree::tr("LNB Preset"));
735  QString help = DeviceTree::tr(
736  "Select the LNB preset from the list, or choose "
737  "'Custom' and set the advanced settings below.");
738  setHelpText(help);
739 
740  uint i = 0;
741  for (; !lnb_presets[i].m_name.isEmpty(); i++)
742  addSelection(DeviceTree::tr( lnb_presets[i].m_name.toUtf8() ),
743  QString::number(i));
744  addSelection(DeviceTree::tr("Custom"), QString::number(i));
745  }
746 
747  void Load(void) override // StandardSetting
748  {
750  setChanged(false);
751  }
752 
753  void Save(void) override // StandardSetting
754  {
755  }
756 
757  private:
759 };
760 
762 
764 {
765  public:
766  explicit LNBTypeSetting(DiSEqCDevLNB &lnb) : m_lnb(lnb)
767  {
768  setLabel(DeviceTree::tr("LNB Type"));
769  setHelpText(DeviceTree::tr("Select the type of LNB from the list."));
770  addSelection(DeviceTree::tr("Legacy (Fixed)"),
771  QString::number((uint) DiSEqCDevLNB::kTypeFixed));
772  addSelection(DeviceTree::tr("Standard (Voltage)"),
773  QString::number((uint) DiSEqCDevLNB::
774  kTypeVoltageControl));
775  addSelection(DeviceTree::tr("Universal (Voltage & Tone)"),
776  QString::number((uint) DiSEqCDevLNB::
777  kTypeVoltageAndToneControl));
778  addSelection(DeviceTree::tr("Bandstacked"),
779  QString::number((uint) DiSEqCDevLNB::kTypeBandstacked));
780  }
781 
782  void Load(void) override // StandardSetting
783  {
784  setValue(getValueIndex(QString::number((uint) m_lnb.GetType())));
785  setChanged(false);
786  }
787 
788  void Save(void) override // StandardSetting
789  {
791  }
792 
793  private:
795 };
796 
798 
800 {
801  public:
802  explicit LNBLOFSwitchSetting(DiSEqCDevLNB &lnb) : m_lnb(lnb)
803  {
804  setLabel(DeviceTree::tr("LNB LOF Switch (MHz)"));
805  QString help = DeviceTree::tr(
806  "This defines at what frequency the LNB will do a "
807  "switch from high to low setting, and vice versa.");
808  setHelpText(help);
809  }
810 
811  void Load(void) override // StandardSetting
812  {
813  setValue(QString::number(m_lnb.GetLOFSwitch() / 1000));
814  setChanged(false);
815  }
816 
817  void Save(void) override // StandardSetting
818  {
819  m_lnb.SetLOFSwitch(getValue().toUInt() * 1000);
820  }
821 
822  private:
824 };
825 
827 
829 {
830  public:
831  explicit LNBLOFLowSetting(DiSEqCDevLNB &lnb) : m_lnb(lnb)
832  {
833  setLabel(DeviceTree::tr("LNB LOF Low (MHz)"));
834  QString help = DeviceTree::tr(
835  "This defines the offset the frequency coming "
836  "from the LNB will be in low setting. For bandstacked "
837  "LNBs this is the vertical/right polarization band.");
838  setHelpText(help);
839  }
840 
841  void Load(void) override // StandardSetting
842  {
843  setValue(QString::number(m_lnb.GetLOFLow() / 1000));
844  setChanged(false);
845  }
846 
847  void Save(void) override // StandardSetting
848  {
849  m_lnb.SetLOFLow(getValue().toUInt() * 1000);
850  }
851 
852  private:
854 };
855 
857 
859 {
860  public:
861  explicit LNBLOFHighSetting(DiSEqCDevLNB &lnb) : m_lnb(lnb)
862  {
863  setLabel(DeviceTree::tr("LNB LOF High (MHz)"));
864  QString help = DeviceTree::tr(
865  "This defines the offset the frequency coming from "
866  "the LNB will be in high setting. For bandstacked "
867  "LNBs this is the horizontal/left polarization band.");
868  setHelpText(help);
869  }
870 
871  void Load(void) override // StandardSetting
872  {
873  setValue(QString::number(m_lnb.GetLOFHigh() / 1000));
874  setChanged(false);
875  }
876 
877  void Save(void) override // StandardSetting
878  {
879  m_lnb.SetLOFHigh(getValue().toUInt() * 1000);
880  }
881 
882  private:
884 };
885 
887 {
888  public:
890  m_lnb(lnb)
891  {
892  setLabel(DeviceTree::tr("LNB Reversed"));
893  QString help = DeviceTree::tr(
894  "This defines whether the signal reaching the LNB "
895  "is reversed from normal polarization. This happens "
896  "to circular signals bouncing twice on a toroidal "
897  "dish.");
898  setHelpText(help);
899  }
900 
901  void Load(void) override // StandardSetting
902  {
904  setChanged(false);
905  }
906 
907  void Save(void) override // StandardSetting
908  {
910  }
911 
912  private:
914 };
915 
917 
919 {
920  setLabel(DeviceTree::tr("LNB Configuration"));
921  setValue(lnb.GetDescription());
922 
923  parent = this;
924  auto *deviceDescr = new DeviceDescrSetting(lnb);
925  parent->addChild(deviceDescr);
926  m_preset = new LNBPresetSetting(lnb);
927  parent->addChild(m_preset);
928  m_type = new LNBTypeSetting(lnb);
929  parent->addChild(m_type);
930  m_lofSwitch = new LNBLOFSwitchSetting(lnb);
931  parent->addChild(m_lofSwitch);
932  m_lofLo = new LNBLOFLowSetting(lnb);
933  parent->addChild(m_lofLo);
934  m_lofHi = new LNBLOFHighSetting(lnb);
935  parent->addChild(m_lofHi);
937  parent->addChild(m_polInv);
938  connect(m_type, SIGNAL(valueChanged(const QString&)),
939  this, SLOT( UpdateType( void)));
940  connect(m_preset, SIGNAL(valueChanged(const QString&)),
941  this, SLOT( SetPreset( const QString&)));
942  connect(deviceDescr, SIGNAL(valueChanged(const QString&)),
943  SLOT(setValue(const QString&)));
944 }
945 
946 void LNBConfig::Load(void)
947 {
950 }
951 
952 void LNBConfig::SetPreset(const QString &value)
953 {
954  uint index = value.toUInt();
955  if (index >= (sizeof(lnb_presets) / sizeof(lnb_preset)))
956  return;
957 
958  const lnb_preset &preset = lnb_presets[index];
959  if (preset.m_name.isEmpty())
960  {
961  m_type->setEnabled(true);
962  UpdateType();
963  }
964  else
965  {
967  QString::number((uint)preset.m_type)));
968  m_lofSwitch->setValue(QString::number(preset.m_lofSw / 1000));
969  m_lofLo->setValue(QString::number(preset.m_lofLo / 1000));
970  m_lofHi->setValue(QString::number(preset.m_lofHi / 1000));
971  m_polInv->setValue(preset.m_polInv);
972  m_type->setEnabled(false);
973  m_lofSwitch->setEnabled(false);
974  m_lofHi->setEnabled(false);
975  m_lofLo->setEnabled(false);
976  m_polInv->setEnabled(false);
977  }
978 }
979 
981 {
982  if (!m_type->isEnabled())
983  return;
984 
985  switch ((DiSEqCDevLNB::dvbdev_lnb_t) m_type->getValue().toUInt())
986  {
989  m_lofSwitch->setEnabled(false);
990  m_lofHi->setEnabled(false);
991  m_lofLo->setEnabled(true);
992  m_polInv->setEnabled(true);
993  break;
995  m_lofSwitch->setEnabled(true);
996  m_lofHi->setEnabled(true);
997  m_lofLo->setEnabled(true);
998  m_polInv->setEnabled(true);
999  break;
1001  m_lofSwitch->setEnabled(false);
1002  m_lofHi->setEnabled(true);
1003  m_lofLo->setEnabled(true);
1004  m_polInv->setEnabled(true);
1005  break;
1006  }
1007 }
1008 
1010 
1012 {
1013  PopulateTree();
1015 }
1016 
1018 {
1019  DiSEqCDevDevice *dev = devtype->GetDevice();
1020  if (dev)
1021  {
1022  DiSEqCDevDevice *parent = dev->GetParent();
1023  if (parent)
1024  parent->SetChild(dev->GetOrdinal(), nullptr);
1025  else
1026  m_tree.SetRoot(nullptr);
1027  }
1028 
1029  devtype->DeleteDevice();
1030 }
1031 
1033 {
1034  clearSettings();
1036 }
1037 
1039  StandardSetting *parent)
1040 {
1041  DiseqcConfigBase *setting = nullptr;
1042  switch (dev->GetDeviceType())
1043  {
1045  {
1046  auto *sw = dynamic_cast<DiSEqCDevSwitch*>(dev);
1047  if (sw)
1048  setting = new SwitchConfig(*sw, parent);
1049  }
1050  break;
1051 
1053  {
1054  auto *rotor = dynamic_cast<DiSEqCDevRotor*>(dev);
1055  if (rotor)
1056  setting = new RotorConfig(*rotor, parent);
1057  }
1058  break;
1059 
1061  {
1062  auto *scr = dynamic_cast<DiSEqCDevSCR*>(dev);
1063  if (scr)
1064  setting = new SCRConfig(*scr, parent);
1065  }
1066  break;
1067 
1069  {
1070  auto *lnb = dynamic_cast<DiSEqCDevLNB*>(dev);
1071  if (lnb)
1072  setting = new LNBConfig(*lnb, parent);
1073  }
1074  break;
1075 
1076  default:
1077  break;
1078  }
1079 
1080  return setting;
1081 }
1082 
1084  DiSEqCDevDevice *parent,
1085  uint childnum,
1086  GroupSetting *parentSetting)
1087 {
1088  if (node)
1089  {
1090  auto *devtype = new DeviceTypeSetting();
1091  devtype->SetDevice(node);
1092  devtype->Load();
1094  devtype);
1095 
1096  if (setting)
1097  {
1098  setting->Load();
1099  devtype->addChild(setting);
1100  PopulateChildren(node, setting);
1101 
1102  AddDeviceTypeSetting(devtype, parent, childnum, parentSetting);
1103  }
1104  else
1105  delete devtype;
1106  }
1107  else
1108  {
1109  auto *devtype = new DeviceTypeSetting();
1110  AddDeviceTypeSetting(devtype, parent, childnum, parentSetting);
1111  }
1112 }
1113 
1115  DiSEqCDevDevice *parent,
1116  uint childnum,
1117  GroupSetting *parentSetting)
1118 {
1119  if (parentSetting)
1120  parentSetting->addChild(devtype);
1121  else // Root node
1122  addChild(devtype);
1123 
1124  ConnectToValueChanged(devtype, parent, childnum);
1125 }
1126 
1128  DiSEqCDevDevice *parent,
1129  uint childnum)
1130 {
1131  auto slot = [devtype, parent, childnum, this](const QString &value)
1132  {
1133  ValueChanged(value, devtype, parent, childnum);
1134  };
1135 
1136  connect(devtype,
1137  static_cast<void (StandardSetting::*)(const QString&)>(
1139  this,
1140  slot);
1141 }
1142 
1144  GroupSetting *parentSetting)
1145 {
1146  uint num_ch = node->GetChildCount();
1147  for (uint ch = 0; ch < num_ch; ch++)
1148  {
1149  PopulateTree(node->GetChild(ch), node, ch, parentSetting);
1150  }
1151 }
1152 
1153 void DeviceTree::ValueChanged(const QString &value,
1154  DeviceTypeSetting *devtype,
1155  DiSEqCDevDevice *parent,
1156  uint childnum)
1157 {
1158  // Remove old setting from m_tree
1159  DeleteDevice(devtype);
1160 
1161  const auto type = static_cast<DiSEqCDevDevice::dvbdev_t>(value.toUInt());
1162 
1164  if (dev)
1165  {
1166  if (!parent)
1167  {
1168  m_tree.SetRoot(dev);
1169  PopulateTree();
1170  }
1171  else if (parent->SetChild(childnum, dev))
1172  {
1173  DiseqcConfigBase *newConfig =
1174  DiseqcConfigBase::CreateByType(dev, devtype);
1175  newConfig->Load();
1176 
1177  PopulateChildren(dev, newConfig);
1178 
1179  devtype->addChild(newConfig);
1180  devtype->SetDevice(dev);
1181  }
1182  else
1183  delete dev;
1184  }
1185 
1186  emit settingsChanged(this);
1187 }
1188 
1190 
1192 {
1193  public:
1195  : m_node(node), m_settings(settings)
1196  {
1197  setLabel(node.GetDescription());
1198  setHelpText(DeviceTree::tr("Choose a port to use for this switch."));
1199 
1200  uint num_children = node.GetChildCount();
1201  for (uint ch = 0; ch < num_children; ch++)
1202  {
1203  QString val = QString("%1").arg(ch);
1204  QString descr = DeviceTree::tr("Port %1").arg(ch+1);
1205  DiSEqCDevDevice *child = node.GetChild(ch);
1206  if (child)
1207  descr += QString(" (%2)").arg(child->GetDescription());
1208  addSelection(descr, val);
1209  }
1210  }
1211 
1212  void Load(void) override // StandardSetting
1213  {
1214  double value = m_settings.GetValue(m_node.GetDeviceID());
1215  setValue((uint)value);
1216  setChanged(false);
1217  }
1218 
1219  void Save(void) override // StandardSetting
1220  {
1221  m_settings.SetValue(m_node.GetDeviceID(), getValue().toDouble());
1222  }
1223 
1224  private:
1227 };
1228 
1230 
1232 {
1233  public:
1235  : m_node(node), m_settings(settings)
1236  {
1237  setLabel(node.GetDescription());
1238  setHelpText(DeviceTree::tr("Choose a satellite position."));
1239 
1240  auto *rotor = dynamic_cast<DiSEqCDevRotor*>(&m_node);
1241  if (rotor)
1242  m_posmap = rotor->GetPosMap();
1243  }
1244 
1245  void Load(void) override // StandardSetting
1246  {
1247  clearSelections();
1248 
1249  uint_to_dbl_t::const_iterator it;
1250  for (it = m_posmap.begin(); it != m_posmap.end(); ++it)
1251  addSelection(AngleToString(*it), QString::number(*it));
1252 
1253  double angle = m_settings.GetValue(m_node.GetDeviceID());
1254  setValue(getValueIndex(QString::number(angle)));
1255  setChanged(false);
1256  }
1257 
1258  void Save(void) override // StandardSetting
1259  {
1260  m_settings.SetValue(m_node.GetDeviceID(), getValue().toDouble());
1261  }
1262 
1263  private:
1267 };
1268 
1270 
1272 {
1273  public:
1276  m_hemisphere(new TransMythUIComboBoxSetting(/*false*/)),
1277  m_node(node), m_settings(settings)
1278  {
1279  QString help =
1280  DeviceTree::tr(
1281  "Locates the satellite you wish to point to "
1282  "with the longitude along the Clarke Belt of "
1283  "the satellite [-180..180] and its hemisphere.");
1284 
1285  m_numeric->setLabel(DeviceTree::tr("Longitude (degrees)"));
1287  m_hemisphere->setLabel(DeviceTree::tr("Hemisphere"));
1288  m_hemisphere->addSelection(DeviceTree::tr("Eastern"), "E", false);
1289  m_hemisphere->addSelection(DeviceTree::tr("Western"), "W", true);
1291 
1294 
1295  addChild(new RotorConfig(dynamic_cast<DiSEqCDevRotor&>(m_node), this));
1296  }
1297 
1298  void Load(void) override // StandardSetting
1299  {
1300  double val = m_settings.GetValue(m_node.GetDeviceID());
1301  QString hemi;
1302  double eval = AngleToEdit(val, hemi);
1303  m_numeric->setValue(QString::number(eval));
1306  }
1307 
1308  void Save(void) override // StandardSetting
1309  {
1310  QString val = QString::number(m_numeric->getValue().toDouble());
1311  val += m_hemisphere->getValue();
1313  }
1314 
1315  private:
1320 };
1321 
1323 
1325 {
1326  public:
1328  : m_node(node), m_settings(settings)
1329  {
1330  setLabel("Position");
1331  setHelpText(DeviceTree::tr("Unicable satellite position (A/B)"));
1333  QString::number((uint)DiSEqCDevSCR::kTypeScrPosA), true);
1335  QString::number((uint)DiSEqCDevSCR::kTypeScrPosB), false);
1336  }
1337 
1338  void Load(void) override // StandardSetting
1339  {
1340  double value = m_settings.GetValue(m_node.GetDeviceID());
1341  setValue(getValueIndex(QString::number((uint)value)));
1342  setChanged(false);
1343  }
1344 
1345  void Save(void) override // StandardSetting
1346  {
1347  m_settings.SetValue(m_node.GetDeviceID(), getValue().toDouble());
1348  }
1349 
1350  private:
1353 };
1354 
1356 
1358  DiSEqCDevSettings &settings, uint cardid, bool switches_enabled) :
1359  m_settings(settings), m_switchesEnabled(switches_enabled)
1360 {
1361  setLabel(DeviceTree::tr("DTV Device Configuration"));
1362 
1363  // load
1364  m_tree.Load(cardid);
1365 
1366  // initial UI setup
1367  AddNodes(this, QString(), m_tree.Root());
1368 }
1369 
1371  StandardSetting *group, const QString &trigger, DiSEqCDevDevice *node)
1372 {
1373  if (!node)
1374  return;
1375 
1376  StandardSetting *setting = nullptr;
1377  switch (node->GetDeviceType())
1378  {
1380  setting = new SwitchSetting(*node, m_settings);
1381  setting->setEnabled(m_switchesEnabled);
1382  break;
1384  {
1385  auto *rotor = dynamic_cast<DiSEqCDevRotor*>(node);
1386  if (rotor && (rotor->GetType() == DiSEqCDevRotor::kTypeDiSEqC_1_2))
1387  setting = new RotorSetting(*node, m_settings);
1388  else
1389  setting = new USALSRotorSetting(*node, m_settings);
1390  break;
1391  }
1393  {
1394  setting = new SCRPositionSetting(*node, m_settings);
1395  break;
1396  }
1397  default:
1398  break;
1399  }
1400 
1401  if (!setting)
1402  return;
1403 
1404  m_devs[node->GetDeviceID()] = setting;
1405 
1406  uint num_ch = node->GetChildCount();
1408  {
1409  for (uint i = 0; i < num_ch; i++)
1410  AddNodes(setting, QString::number(i), node->GetChild(i));
1411 
1412  AddChild(group, trigger, setting);
1413  return;
1414  }
1415 
1416  if (!num_ch)
1417  {
1418  AddChild(group, trigger, setting);
1419  return;
1420  }
1421 
1422  AddChild(group, trigger, setting);
1423  for (uint i = 0; i < num_ch; i++)
1424  AddNodes(group, trigger, node->GetChild(i));
1425 }
1426 
1428  StandardSetting *group, const QString &trigger, StandardSetting *setting)
1429 {
1430  if (!trigger.isEmpty())
1431  group->addTargetedChild(trigger, setting);
1432  else
1433  group->addChild(setting);
1434 }
LNBConfig::m_lofLo
LNBLOFLowSetting * m_lofLo
Definition: diseqcsettings.h:123
DeviceTree::AddDeviceTypeSetting
void AddDeviceTypeSetting(DeviceTypeSetting *devtype, DiSEqCDevDevice *parent, uint childnum, GroupSetting *parentSetting)
Definition: diseqcsettings.cpp:1114
SCRUserBandSetting::m_scr
DiSEqCDevSCR & m_scr
Definition: diseqcsettings.cpp:603
RotorTypeSetting::Save
void Save(void) override
Definition: diseqcsettings.cpp:353
LNBConfig::m_preset
LNBPresetSetting * m_preset
Definition: diseqcsettings.h:120
MythUIComboBoxSetting::clearSelections
void clearSelections()
Definition: standardsettings.cpp:494
e
QDomElement e
Definition: mythplugins/mytharchive/mytharchivehelper/main.cpp:1417
DiSEqCDevRotor::kTypeDiSEqC_1_2
@ kTypeDiSEqC_1_2
Definition: diseqc.h:310
RotorConfig::Load
void Load() override
Definition: diseqcsettings.cpp:567
LNBPolarityInvertedSetting::Save
void Save(void) override
Definition: diseqcsettings.cpp:907
DiSEqCDevDevice::GetChildCount
virtual uint GetChildCount(void) const
Retrieves the proper number of children for this node.
Definition: diseqc.h:172
RotorSetting
Definition: diseqcsettings.cpp:1232
SwitchTypeSetting
Definition: diseqcsettings.cpp:154
SCRPINSetting::SCRPINSetting
SCRPINSetting(DiSEqCDevSCR &scr)
Definition: diseqcsettings.cpp:637
DTVDeviceConfigGroup::DTVDeviceConfigGroup
DTVDeviceConfigGroup(DiSEqCDevSettings &settings, uint cardid, bool switches_enabled)
Definition: diseqcsettings.cpp:1357
SwitchSetting::m_settings
DiSEqCDevSettings & m_settings
Definition: diseqcsettings.cpp:1226
DiSEqCDevDevice::kTypeRotor
@ kTypeRotor
Definition: diseqc.h:151
DiSEqCDevLNB::GetLOFLow
uint GetLOFLow(void) const
Definition: diseqc.h:470
DiSEqCDevSettings::GetValue
double GetValue(uint devid) const
Retrieves a value from this configuration chain by device id.
Definition: diseqc.cpp:206
StandardSetting::setValue
virtual void setValue(const QString &newValue)
Definition: standardsettings.cpp:163
LNBLOFHighSetting::Load
void Load(void) override
Definition: diseqcsettings.cpp:871
SCRPINSetting::Save
void Save(void) override
Definition: diseqcsettings.cpp:649
DiSEqCDevRotor
Rotor class.
Definition: diseqc.h:297
DeviceRepeatSetting::Save
void Save(void) override
Definition: diseqcsettings.cpp:142
DiSEqCDevLNB::SetLOFHigh
void SetLOFHigh(uint lof_hi)
Definition: diseqc.h:462
DiSEqCDevRotor::GetType
dvbdev_rotor_t GetType(void) const
Definition: diseqc.h:319
USALSRotorSetting::m_node
DiSEqCDevDevice & m_node
Definition: diseqcsettings.cpp:1318
LNBConfig::SetPreset
void SetPreset(const QString &value)
Definition: diseqcsettings.cpp:952
DiSEqCDevRotor::kTypeDiSEqC_1_3
@ kTypeDiSEqC_1_3
Definition: diseqc.h:310
DeviceTree::PopulateChildren
void PopulateChildren(DiSEqCDevDevice *node, GroupSetting *parentSetting)
Definition: diseqcsettings.cpp:1143
SwitchConfig
Definition: diseqcsettings.h:34
SCRFrequencySetting::Save
void Save(void) override
Definition: diseqcsettings.cpp:623
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:686
RotorLoSpeedSetting
Definition: diseqcsettings.cpp:365
TransMythUIComboBoxSetting
Definition: standardsettings.h:270
AngleToEdit
static double AngleToEdit(double angle, QString &hemi)
Definition: diseqcsettings.cpp:440
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:396
lnb_presets
static const std::array< const lnb_preset, 7 > lnb_presets
Definition: diseqcsettings.cpp:693
RotorSetting::m_posmap
uint_to_dbl_t m_posmap
Definition: diseqcsettings.cpp:1266
DiSEqCDevLNB::GetType
dvbdev_lnb_t GetType(void) const
Definition: diseqc.h:467
LNBTypeSetting
Definition: diseqcsettings.cpp:764
SCRPINSetting::Load
void Load(void) override
Definition: diseqcsettings.cpp:643
DTVDeviceConfigGroup::m_devs
devid_to_setting_t m_devs
Definition: diseqcsettings.h:181
DiSEqCDevSettings::SetValue
void SetValue(uint devid, double value)
Sets a value for this configuration chain by device id.
Definition: diseqc.cpp:221
LNBConfig::m_lofHi
LNBLOFHighSetting * m_lofHi
Definition: diseqcsettings.h:124
DeviceTypeSetting::DeleteDevice
void DeleteDevice()
Definition: diseqcsettings.cpp:73
TransMythUISpinBoxSetting
Definition: standardsettings.h:351
DiSEqCDevDevice::GetDescription
QString GetDescription(void) const
Definition: diseqc.h:170
SCRPositionSetting
Definition: diseqcsettings.cpp:1325
RotorLoSpeedSetting::RotorLoSpeedSetting
RotorLoSpeedSetting(DiSEqCDevRotor &rotor)
Definition: diseqcsettings.cpp:367
SCRPositionSetting::m_settings
DiSEqCDevSettings & m_settings
Definition: diseqcsettings.cpp:1352
DiSEqCDevDevice::kTypeSCR
@ kTypeSCR
Definition: diseqc.h:152
DiSEqCDevLNB::SetLOFSwitch
void SetLOFSwitch(uint lof_switch)
Definition: diseqc.h:461
DeviceTree::Load
void Load(void) override
Definition: diseqcsettings.cpp:1011
RotorConfig
Definition: diseqcsettings.h:74
arg
arg(title).arg(filename).arg(doDelete))
mythdbcon.h
lnb_preset::m_lofLo
uint m_lofLo
Definition: diseqcsettings.cpp:687
DiSEqCDevSCR::kTypeScrPosB
@ kTypeScrPosB
Definition: diseqc.h:394
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:311
DiSEqCDevRotor::SetPosMap
void SetPosMap(const uint_to_dbl_t &posmap)
Definition: diseqc.cpp:2017
LNBPresetSetting
Definition: diseqcsettings.cpp:730
SCRUserBandSetting::Load
void Load(void) override
Definition: diseqcsettings.cpp:591
lnb_preset
Definition: diseqcsettings.cpp:674
RotorConfig::m_pos
RotorPosMap * m_pos
Definition: diseqcsettings.h:86
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:660
StandardSetting::addTargetedChild
void addTargetedChild(const QString &value, StandardSetting *setting)
Definition: standardsettings.cpp:110
DiSEqCDevLNB::kTypeBandstacked
@ kTypeBandstacked
Definition: diseqc.h:458
RotorSetting::m_node
DiSEqCDevDevice & m_node
Definition: diseqcsettings.cpp:1264
DiSEqCDevDevice
Represents a node in a DVB-S device network.
Definition: diseqc.h:135
DeviceDescrSetting::Load
void Load(void) override
Definition: diseqcsettings.cpp:103
LNBLOFSwitchSetting::LNBLOFSwitchSetting
LNBLOFSwitchSetting(DiSEqCDevLNB &lnb)
Definition: diseqcsettings.cpp:802
DiSEqCDevDevice::SetChild
virtual bool SetChild(uint, DiSEqCDevDevice *)
Changes the nth child of this node.
Definition: diseqc.h:160
LNBLOFLowSetting::Save
void Save(void) override
Definition: diseqcsettings.cpp:847
RotorHiSpeedSetting::Save
void Save(void) override
Definition: diseqcsettings.cpp:413
SwitchConfig::m_address
SwitchAddressSetting * m_address
Definition: diseqcsettings.h:48
StandardSetting::m_name
QString m_name
Definition: standardsettings.h:113
LNBLOFHighSetting::m_lnb
DiSEqCDevLNB & m_lnb
Definition: diseqcsettings.cpp:883
DeviceTypeSetting::m_device
DiSEqCDevDevice * m_device
Definition: diseqcsettings.cpp:85
DiseqcConfigBase::DeleteClicked
void DeleteClicked(void)
DeviceTree::DeleteDevice
void DeleteDevice(DeviceTypeSetting *devtype)
Definition: diseqcsettings.cpp:1017
LNBPolarityInvertedSetting::Load
void Load(void) override
Definition: diseqcsettings.cpp:901
LNBConfig::Load
void Load(void) override
Definition: diseqcsettings.cpp:946
DiSEqCDevSCR::SetFrequency
void SetFrequency(uint freq)
Definition: diseqc.h:397
lnb_preset::m_lofHi
uint m_lofHi
Definition: diseqcsettings.cpp:688
SwitchAddressSetting::Load
void Load(void) override
Definition: diseqcsettings.cpp:210
DiSEqCDevSwitch::kTypeDiSEqCUncommitted
@ kTypeDiSEqCUncommitted
Definition: diseqc.h:235
DiSEqCDevDevice::kTypeSwitch
@ kTypeSwitch
Definition: diseqc.h:150
DiSEqCDevDevice::GetParent
DiSEqCDevDevice * GetParent(void) const
Definition: diseqc.h:168
tmp
static guint32 * tmp
Definition: goom_core.cpp:30
SwitchConfig::m_ports
SwitchPortsSetting * m_ports
Definition: diseqcsettings.h:47
DiSEqCDevSCR::GetPIN
int GetPIN(void) const
Definition: diseqc.h:404
DiSEqCLongitude
static GlobalTextEditSetting * DiSEqCLongitude(void)
Definition: diseqcsettings.cpp:28
SwitchSetting::m_node
DiSEqCDevDevice & m_node
Definition: diseqcsettings.cpp:1225
RotorPosMap::Save
void Save(void) override
Definition: diseqcsettings.cpp:482
DeviceTree::PopulateTree
void PopulateTree(void)
Definition: diseqcsettings.cpp:1032
DiSEqCDevSettings
DVB-S device settings class.
Definition: diseqc.h:37
MythUIButtonListItem
Definition: mythuibuttonlist.h:28
LNBPresetSetting::m_lnb
DiSEqCDevLNB & m_lnb
Definition: diseqcsettings.cpp:758
StandardSetting::setChanged
void setChanged(bool changed)
Definition: standardsettings.cpp:203
RotorPosTextEdit::RotorPosTextEdit
RotorPosTextEdit(const QString &label, uint id, const QString &value)
Definition: diseqcsettings.cpp:490
RotorSetting::Load
void Load(void) override
Definition: diseqcsettings.cpp:1245
DiSEqCDevDevice::GetDeviceType
dvbdev_t GetDeviceType(void) const
Definition: diseqc.h:164
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:313
DiSEqCDevDevice::GetRepeatCount
uint GetRepeatCount(void) const
Definition: diseqc.h:171
RotorConfig::RotorConfig
RotorConfig(DiSEqCDevRotor &rotor, StandardSetting *parent)
Definition: diseqcsettings.cpp:541
DiSEqCDevSCR::GetFrequency
uint GetFrequency(void) const
Definition: diseqc.h:403
DiSEqCDevLNB::SetType
void SetType(dvbdev_lnb_t type)
Definition: diseqc.h:460
LNBPolarityInvertedSetting::LNBPolarityInvertedSetting
LNBPolarityInvertedSetting(DiSEqCDevLNB &lnb)
Definition: diseqcsettings.cpp:889
DiSEqCDevLNB::IsPolarityInverted
bool IsPolarityInverted(void) const
Definition: diseqc.h:471
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:685
DeviceTree::m_tree
DiSEqCDevTree & m_tree
Definition: diseqcsettings.h:161
MythUIComboBoxSetting
Definition: standardsettings.h:216
LNBTypeSetting::LNBTypeSetting
LNBTypeSetting(DiSEqCDevLNB &lnb)
Definition: diseqcsettings.cpp:766
LNBTypeSetting::Save
void Save(void) override
Definition: diseqcsettings.cpp:788
LNBLOFSwitchSetting::Save
void Save(void) override
Definition: diseqcsettings.cpp:817
DiSEqCDevSwitch::GetAddress
uint GetAddress(void) const
Definition: diseqc.h:249
DiSEqCDevLNB::kTypeFixed
@ kTypeFixed
Definition: diseqc.h:455
SCRPINSetting
Definition: diseqcsettings.cpp:635
SwitchTypeSetting::Load
void Load(void) override
Definition: diseqcsettings.cpp:182
RotorPosTextEdit
Definition: diseqcsettings.cpp:488
DiSEqCDevLNB::dvbdev_lnb_t
dvbdev_lnb_t
Definition: diseqc.h:454
FindPreset
static uint FindPreset(const DiSEqCDevLNB &lnb)
Definition: diseqcsettings.cpp:712
RotorPosMap
Definition: diseqcsettings.h:52
MythUISpinBoxSetting::intValue
int intValue()
Definition: standardsettings.cpp:652
USALSRotorSetting::Load
void Load(void) override
Definition: diseqcsettings.cpp:1298
LNBLOFHighSetting::LNBLOFHighSetting
LNBLOFHighSetting(DiSEqCDevLNB &lnb)
Definition: diseqcsettings.cpp:861
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:31
DTVDeviceConfigGroup::AddChild
static void AddChild(StandardSetting *group, const QString &trigger, StandardSetting *setting)
Definition: diseqcsettings.cpp:1427
SwitchTypeSetting::m_switch
DiSEqCDevSwitch & m_switch
Definition: diseqcsettings.cpp:195
lnb_preset::m_name
QString m_name
Definition: diseqcsettings.cpp:684
DeviceTree::ValueChanged
void ValueChanged(const QString &value, DeviceTypeSetting *devtype, DiSEqCDevDevice *parent, uint childnum)
Definition: diseqcsettings.cpp:1153
DiSEqCDevSCR
Unicable / SCR Class.
Definition: diseqc.h:377
DiSEqCDevDevice::dvbdev_t
dvbdev_t
Definition: diseqc.h:149
StandardSetting::setHelpText
virtual void setHelpText(const QString &str)
Definition: standardsettings.h:37
RotorSetting::RotorSetting
RotorSetting(DiSEqCDevDevice &node, DiSEqCDevSettings &settings)
Definition: diseqcsettings.cpp:1234
SCRUserBandSetting::SCRUserBandSetting
SCRUserBandSetting(DiSEqCDevSCR &scr)
Definition: diseqcsettings.cpp:584
USALSRotorSetting::USALSRotorSetting
USALSRotorSetting(DiSEqCDevDevice &node, DiSEqCDevSettings &settings)
Definition: diseqcsettings.cpp:1274
DiSEqCDevTree::Load
bool Load(const QString &device)
Loads the device tree from the database.
Definition: diseqc.cpp:313
DeviceRepeatSetting::DeviceRepeatSetting
DeviceRepeatSetting(DiSEqCDevDevice &device)
Definition: diseqcsettings.cpp:124
RotorLoSpeedSetting::Load
void Load(void) override
Definition: diseqcsettings.cpp:377
MythUIComboBoxSetting::getValueIndex
int getValueIndex(const QString &value) const
Definition: standardsettings.cpp:468
USALSRotorSetting::m_numeric
TransTextEditSetting * m_numeric
Definition: diseqcsettings.cpp:1316
LNBConfig::m_lofSwitch
LNBLOFSwitchSetting * m_lofSwitch
Definition: diseqcsettings.h:122
DiSEqCDevTree::SetRoot
void SetRoot(DiSEqCDevDevice *root)
Changes the root node of the tree.
Definition: diseqc.cpp:636
DiSEqCDevLNB
LNB Class.
Definition: diseqc.h:442
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:183
RotorPosMap::Load
void Load(void) override
Definition: diseqcsettings.cpp:476
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:464
DiSEqCDevSwitch::dvbdev_switch_t
dvbdev_switch_t
Definition: diseqc.h:232
LNBConfig::UpdateType
void UpdateType(void)
Definition: diseqcsettings.cpp:980
USALSRotorSetting::m_hemisphere
TransMythUIComboBoxSetting * m_hemisphere
Definition: diseqcsettings.cpp:1317
DiseqcConfigBase::CreateByType
static DiseqcConfigBase * CreateByType(DiSEqCDevDevice *dev, StandardSetting *parent)
Definition: diseqcsettings.cpp:1038
uint
unsigned int uint
Definition: compat.h:140
DiSEqCDevRotor::GetPosMap
uint_to_dbl_t GetPosMap(void) const
Definition: diseqc.cpp:2007
RotorTypeSetting::m_rotor
DiSEqCDevRotor & m_rotor
Definition: diseqcsettings.cpp:359
SCRFrequencySetting::SCRFrequencySetting
SCRFrequencySetting(DiSEqCDevSCR &scr)
Definition: diseqcsettings.cpp:611
DiSEqCDevSCR::GetUserBand
uint GetUserBand(void) const
Definition: diseqc.h:402
SCRFrequencySetting::Load
void Load(void) override
Definition: diseqcsettings.cpp:617
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:169
SCRPositionSetting::Load
void Load(void) override
Definition: diseqcsettings.cpp:1338
DiSEqCDevDevice::CreateByType
static DiSEqCDevDevice * CreateByType(DiSEqCDevTree &tree, dvbdev_t type, uint dev_id=0)
Definition: diseqc.cpp:941
RotorPosMap::PopulateList
void PopulateList(void)
Definition: diseqcsettings.cpp:519
LNBLOFSwitchSetting::m_lnb
DiSEqCDevLNB & m_lnb
Definition: diseqcsettings.cpp:823
SCRPositionSetting::SCRPositionSetting
SCRPositionSetting(DiSEqCDevDevice &node, DiSEqCDevSettings &settings)
Definition: diseqcsettings.cpp:1327
DiSEqCDevLNB::GetLOFSwitch
uint GetLOFSwitch(void) const
Definition: diseqc.h:468
SwitchSetting::Save
void Save(void) override
Definition: diseqcsettings.cpp:1219
RotorHiSpeedSetting::RotorHiSpeedSetting
RotorHiSpeedSetting(DiSEqCDevRotor &rotor)
Definition: diseqcsettings.cpp:397
DiSEqCDevLNB::GetLOFHigh
uint GetLOFHigh(void) const
Definition: diseqc.h:469
StandardSetting::setLabel
virtual void setLabel(QString str)
Definition: standardsettings.h:34
DiSEqCDevDevice::SetRepeatCount
void SetRepeatCount(uint repeat)
Definition: diseqc.h:159
DiseqcConfigBase
Definition: diseqcsettings.h:21
DiSEqCDevDevice::kTypeLNB
@ kTypeLNB
Definition: diseqc.h:153
DiSEqCDevSwitch::kTypeDiSEqCCommitted
@ kTypeDiSEqCCommitted
Definition: diseqc.h:234
GlobalTextEditSetting
Definition: standardsettings.h:173
SwitchConfig::Load
void Load(void) override
Definition: diseqcsettings.cpp:275
DTVDeviceConfigGroup::m_tree
DiSEqCDevTree m_tree
Definition: diseqcsettings.h:179
StandardSetting::valueChanged
void valueChanged(const QString &newValue)
DiSEqCDevSwitch::GetType
dvbdev_switch_t GetType(void) const
Definition: diseqc.h:248
SCRConfig
Definition: diseqcsettings.h:90
LNBLOFHighSetting::Save
void Save(void) override
Definition: diseqcsettings.cpp:877
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:479
DiSEqCDevSwitch::kTypeMiniDiSEqC
@ kTypeMiniDiSEqC
Definition: diseqc.h:240
DeviceDescrSetting::m_device
DiSEqCDevDevice & m_device
Definition: diseqcsettings.cpp:115
LNBPresetSetting::Load
void Load(void) override
Definition: diseqcsettings.cpp:747
LNBPolarityInvertedSetting
Definition: diseqcsettings.cpp:887
DeviceTypeSetting::DeviceTypeSetting
DeviceTypeSetting()
Definition: diseqcsettings.cpp:43
DiSEqCDevSwitch::SetNumPorts
void SetNumPorts(uint num_ports)
Definition: diseqc.cpp:1345
DiSEqCDevSCR::SetPIN
void SetPIN(int pin)
Definition: diseqc.h:398
SwitchTypeSetting::SwitchTypeSetting
SwitchTypeSetting(DiSEqCDevSwitch &switch_dev)
Definition: diseqcsettings.cpp:156
RotorTypeSetting::Load
void Load(void) override
Definition: diseqcsettings.cpp:347
DTVDeviceConfigGroup::AddNodes
void AddNodes(StandardSetting *group, const QString &trigger, DiSEqCDevDevice *node)
Definition: diseqcsettings.cpp:1370
RotorPosTextEdit::m_id
uint m_id
Definition: diseqcsettings.cpp:504
DiSEqCDevSwitch::kTypeTone
@ kTypeTone
Definition: diseqc.h:233
DiSEqCDevSwitch::SetAddress
void SetAddress(uint address)
Definition: diseqc.h:243
SwitchConfig::m_deviceDescr
DeviceDescrSetting * m_deviceDescr
Definition: diseqcsettings.h:45
RotorTypeSetting::RotorTypeSetting
RotorTypeSetting(DiSEqCDevRotor &rotor)
Definition: diseqcsettings.cpp:336
lnb_preset::m_polInv
bool m_polInv
Definition: diseqcsettings.cpp:689
DiSEqCDevSCR::kTypeScrPosA
@ kTypeScrPosA
Definition: diseqc.h:393
DiSEqCDevSwitch::kTypeLegacySW64
@ kTypeLegacySW64
Definition: diseqc.h:238
SCRFrequencySetting
Definition: diseqcsettings.cpp:609
LNBConfig::LNBConfig
LNBConfig(DiSEqCDevLNB &lnb, StandardSetting *parent)
Definition: diseqcsettings.cpp:918
SwitchAddressSetting
Definition: diseqcsettings.cpp:201
RotorHiSpeedSetting::m_rotor
DiSEqCDevRotor & m_rotor
Definition: diseqcsettings.cpp:419
SCRUserBandSetting::Save
void Save(void) override
Definition: diseqcsettings.cpp:597
DiSEqCDevSwitch::kTypeLegacySW42
@ kTypeLegacySW42
Definition: diseqc.h:237
DiSEqCDevSwitch::kTypeLegacySW21
@ kTypeLegacySW21
Definition: diseqc.h:236
DiSEqCDevSCR::SCRPositionToString
static QString SCRPositionToString(dvbdev_pos_t pos)
Definition: diseqc.h:421
StandardSetting::isEnabled
bool isEnabled() const
Definition: standardsettings.h:45
DiSEqCDevSwitch::kTypeVoltage
@ kTypeVoltage
Definition: diseqc.h:239
LNBPresetSetting::Save
void Save(void) override
Definition: diseqcsettings.cpp:753
SwitchTypeSetting::Save
void Save(void) override
Definition: diseqcsettings.cpp:188
LNBLOFLowSetting::Load
void Load(void) override
Definition: diseqcsettings.cpp:841
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:676
SwitchPortsSetting::SwitchPortsSetting
SwitchPortsSetting(DiSEqCDevSwitch &switch_dev)
Definition: diseqcsettings.cpp:230
LNBTypeSetting::m_lnb
DiSEqCDevLNB & m_lnb
Definition: diseqcsettings.cpp:794
DiSEqCDevSwitch::SetType
void SetType(dvbdev_switch_t type)
Definition: diseqc.h:242
LNBLOFHighSetting
Definition: diseqcsettings.cpp:859
SCRPositionSetting::m_node
DiSEqCDevDevice & m_node
Definition: diseqcsettings.cpp:1351
DeviceTree::ConnectToValueChanged
void ConnectToValueChanged(DeviceTypeSetting *devtype, DiSEqCDevDevice *parent, uint childnum)
Definition: diseqcsettings.cpp:1127
RotorLoSpeedSetting::m_rotor
DiSEqCDevRotor & m_rotor
Definition: diseqcsettings.cpp:389
USALSRotorSetting::m_settings
DiSEqCDevSettings & m_settings
Definition: diseqcsettings.cpp:1319
RotorConfig::SetType
void SetType(const QString &type)
Definition: diseqcsettings.cpp:573
GetMythMainWindow
MythMainWindow * GetMythMainWindow(void)
Definition: mythmainwindow.cpp:107
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:497
build_compdb.action
action
Definition: build_compdb.py:9
RotorLoSpeedSetting::Save
void Save(void) override
Definition: diseqcsettings.cpp:383
USALSRotorSetting
Definition: diseqcsettings.cpp:1272
AngleToFloat
static double AngleToFloat(const QString &angle, bool translated=true)
Definition: diseqcsettings.cpp:452
LNBConfig::m_polInv
LNBPolarityInvertedSetting * m_polInv
Definition: diseqcsettings.h:125
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:312
RotorConfig::m_rotor
DiSEqCDevRotor & m_rotor
Definition: diseqcsettings.h:85
LNBConfig::m_type
LNBTypeSetting * m_type
Definition: diseqcsettings.h:121
RotorSetting::Save
void Save(void) override
Definition: diseqcsettings.cpp:1258
LNBLOFLowSetting::m_lnb
DiSEqCDevLNB & m_lnb
Definition: diseqcsettings.cpp:853
DTVDeviceConfigGroup::m_switchesEnabled
bool m_switchesEnabled
Definition: diseqcsettings.h:182
StandardSetting
Definition: standardsettings.h:30
DiSEqCDevDevice::SetDescription
void SetDescription(const QString &desc)
Definition: diseqc.h:158
SwitchConfig::SwitchConfig
SwitchConfig(DiSEqCDevSwitch &switch_dev, StandardSetting *parent)
Definition: diseqcsettings.cpp:254
AngleToString
static QString AngleToString(double angle)
Definition: diseqcsettings.cpp:424
DiSEqCDevRotor::GetHiSpeed
double GetHiSpeed(void) const
Definition: diseqc.h:321
SwitchPortsSetting::Load
void Load(void) override
Definition: diseqcsettings.cpp:237
RotorHiSpeedSetting::Load
void Load(void) override
Definition: diseqcsettings.cpp:407
SwitchPortsSetting
Definition: diseqcsettings.cpp:228
SCRPINSetting::m_scr
DiSEqCDevSCR & m_scr
Definition: diseqcsettings.cpp:655
DiSEqCDevDevice::GetDeviceID
uint GetDeviceID(void) const
Definition: diseqc.h:165
MythUICheckBoxSetting
Definition: standardsettings.h:388
DiSEqCDevLNB::kTypeVoltageAndToneControl
@ kTypeVoltageAndToneControl
Definition: diseqc.h:457
DeviceTypeSetting::SetDevice
void SetDevice(DiSEqCDevDevice *dev)
Definition: diseqcsettings.cpp:68
RotorTypeSetting
Definition: diseqcsettings.cpp:334
RotorHiSpeedSetting
Definition: diseqcsettings.cpp:395
LNBTypeSetting::Load
void Load(void) override
Definition: diseqcsettings.cpp:782
RotorSetting::m_settings
DiSEqCDevSettings & m_settings
Definition: diseqcsettings.cpp:1265
SwitchConfig::m_type
SwitchTypeSetting * m_type
Definition: diseqcsettings.h:46
SCRFrequencySetting::m_scr
DiSEqCDevSCR & m_scr
Definition: diseqcsettings.cpp:629
RotorPosMap::m_posmap
uint_to_dbl_t m_posmap
Definition: diseqcsettings.h:70
SwitchSetting::Load
void Load(void) override
Definition: diseqcsettings.cpp:1212
DiSEqCDevRotor::GetLoSpeed
double GetLoSpeed(void) const
Definition: diseqc.h:320
MythUICheckBoxSetting::setValue
void setValue(const QString &newValue) override
Definition: standardsettings.cpp:694
RotorPosMap::valueChanged
void valueChanged(StandardSetting *setting)
Definition: diseqcsettings.cpp:507
SCRPositionSetting::Save
void Save(void) override
Definition: diseqcsettings.cpp:1345
DiSEqCDevRotor::dvbdev_rotor_t
dvbdev_rotor_t
Definition: diseqc.h:310
SCRUserBandSetting
Definition: diseqcsettings.cpp:582
LNBLOFSwitchSetting::Load
void Load(void) override
Definition: diseqcsettings.cpp:811
DeviceTypeSetting
Definition: diseqcsettings.cpp:41
DiSEqCDevRotor::SetType
void SetType(dvbdev_rotor_t type)
Definition: diseqc.h:311
SwitchAddressSetting::Save
void Save(void) override
Definition: diseqcsettings.cpp:216
LNBLOFSwitchSetting
Definition: diseqcsettings.cpp:800
LNBLOFLowSetting
Definition: diseqcsettings.cpp:829
LNBPolarityInvertedSetting::m_lnb
DiSEqCDevLNB & m_lnb
Definition: diseqcsettings.cpp:913
MythUIComboBoxSetting::setValue
void setValue(int value) override
Definition: standardsettings.cpp:459
RotorPosMap::m_rotor
DiSEqCDevRotor & m_rotor
Definition: diseqcsettings.h:69
DiSEqCDevLNB::kTypeVoltageControl
@ kTypeVoltageControl
Definition: diseqc.h:456
SwitchSetting::SwitchSetting
SwitchSetting(DiSEqCDevDevice &node, DiSEqCDevSettings &settings)
Definition: diseqcsettings.cpp:1194
GroupSetting
Definition: standardsettings.h:433
diseqcsettings.h
DTVDeviceConfigGroup::m_settings
DiSEqCDevSettings & m_settings
Definition: diseqcsettings.h:180
DiSEqCDevLNB::SetLOFLow
void SetLOFLow(uint lof_lo)
Definition: diseqc.h:463
DeviceRepeatSetting
Definition: diseqcsettings.cpp:122
LNBPresetSetting::LNBPresetSetting
LNBPresetSetting(DiSEqCDevLNB &lnb)
Definition: diseqcsettings.cpp:732
USALSRotorSetting::Save
void Save(void) override
Definition: diseqcsettings.cpp:1308
DiSEqCDevSwitch::GetNumPorts
uint GetNumPorts(void) const
Definition: diseqc.h:250
DiSEqCDevSwitch
Switch class, including tone, legacy and DiSEqC switches.
Definition: diseqc.h:218
MythUICheckBoxSetting::boolValue
bool boolValue()
Definition: standardsettings.h:400
LNBLOFLowSetting::LNBLOFLowSetting
LNBLOFLowSetting(DiSEqCDevLNB &lnb)
Definition: diseqcsettings.cpp:831
SwitchSetting
Definition: diseqcsettings.cpp:1192