Ticket #2473: lnb-reversed.patch
File lnb-reversed.patch, 10.8 KB (added by , 18 years ago) |
---|
-
libs/libmythtv/diseqc.h
359 359 void SetLOFSwitch(uint lof_switch) { m_lof_switch = lof_switch; } 360 360 void SetLOFHigh( uint lof_hi) { m_lof_hi = lof_hi; } 361 361 void SetLOFLow( uint lof_lo) { m_lof_lo = lof_lo; } 362 void SetReversed(bool reversed) { m_reversed = reversed; } 362 363 363 364 // Gets 364 365 dvbdev_lnb_t GetType(void) const { return m_type; } 365 366 uint GetLOFSwitch(void) const { return m_lof_switch; } 366 367 uint GetLOFHigh(void) const { return m_lof_hi; } 367 368 uint GetLOFLow(void) const { return m_lof_lo; } 369 bool IsReversed(void) const { return m_reversed; } 368 370 bool IsHighBand(const DVBTuning&) const; 369 371 bool IsHorizontal(const DVBTuning&) const; 370 372 uint32_t GetIntermediateFrequency(const DiSEqCDevSettings&, … … 383 385 uint m_lof_switch; 384 386 uint m_lof_hi; 385 387 uint m_lof_lo; 388 bool m_reversed; 386 389 387 390 static const TypeTable LNBTypeTable[5]; 388 391 }; -
libs/libmythtv/dbcheck.cpp
10 10 #include "mythdbcon.h" 11 11 12 12 /// This is the DB schema version expected by the running MythTV instance. 13 const QString currentDatabaseVersion = "116 0";13 const QString currentDatabaseVersion = "1161"; 14 14 15 15 static bool UpdateDBVersionNumber(const QString &newnumber); 16 16 static bool performActualUpdate(const QString updates[], QString version, … … 2546 2546 return false; 2547 2547 } 2548 2548 2549 if (dbver == "1160") 2550 { 2551 const QString updates[] = { 2552 "ALTER TABLE diseqc_tree ADD COLUMN reversed TINYINT NOT NULL DEFAULT '0';", 2553 "" 2554 }; 2555 2556 if (!performActualUpdate(updates, "1161", dbver)) 2557 return false; 2558 } 2559 2549 2560 //"ALTER TABLE capturecard DROP COLUMN dvb_recordts;" in 0.21 2550 2561 //"ALTER TABLE capturecard DROP COLUMN dvb_hw_decoder;" in 0.21 2551 2562 //"ALTER TABLE cardinput DROP COLUMN preference;" in 0.22 -
libs/libmythtv/diseqcsettings.cpp
457 457 uint lof_sw; 458 458 uint lof_lo; 459 459 uint lof_hi; 460 bool reversed; 460 461 }; 461 462 462 463 static lnb_preset lnb_presets[] = 463 464 { 464 /* description, type, LOF switch, LOF low, LOF high */465 /* description, type, LOF switch, LOF low, LOF high, Reversed Polarity */ 465 466 { DeviceTree::tr("Single (Europe)"), 466 DiSEqCDevLNB::kTypeVoltageControl, 0, 9750000, 0 }, 467 DiSEqCDevLNB::kTypeVoltageControl, 468 0, 9750000, 0, false }, 467 469 { DeviceTree::tr("Universal (Europe)"), 468 DiSEqCDevLNB::kTypeVoltageAndToneControl, 11700000, 9750000, 10600000 }, 470 DiSEqCDevLNB::kTypeVoltageAndToneControl, 471 11700000, 9750000, 10600000, false }, 469 472 { DeviceTree::tr("Circular (N. America)"), 470 DiSEqCDevLNB::kTypeVoltageControl, 0, 11250000, 0 }, 473 DiSEqCDevLNB::kTypeVoltageControl, 474 0, 11250000, 0, false }, 475 { DeviceTree::tr("Reverse Circular (N. America)"), 476 DiSEqCDevLNB::kTypeVoltageControl, 477 0, 11250000, 0, true }, 471 478 { DeviceTree::tr("Linear (N. America)"), 472 DiSEqCDevLNB::kTypeVoltageControl, 0, 10750000, 0 }, 479 DiSEqCDevLNB::kTypeVoltageControl, 480 0, 10750000, 0, false }, 473 481 { DeviceTree::tr("C Band"), 474 DiSEqCDevLNB::kTypeVoltageControl, 0, 5150000, 0 }, 482 DiSEqCDevLNB::kTypeVoltageControl, 483 0, 5150000, 0, false }, 475 484 { DeviceTree::tr("DishPro Bandstacked"), 476 DiSEqCDevLNB::kTypeBandstacked, 0, 11250000, 14350000 }, 485 DiSEqCDevLNB::kTypeBandstacked, 486 0, 11250000, 14350000, false }, 487 { DeviceTree::tr("Reverse DishPro Bandstacked"), 488 DiSEqCDevLNB::kTypeBandstacked, 489 0, 11250000, 14350000, true }, 477 490 { QString::null, 478 DiSEqCDevLNB::kTypeVoltageControl, 0, 0, 0 }, 491 DiSEqCDevLNB::kTypeVoltageControl, 492 0, 0, 0, false }, 479 493 }; 480 494 481 495 uint FindPreset(const DiSEqCDevLNB &lnb) … … 483 497 uint i; 484 498 for (i = 0; !lnb_presets[i].name.isEmpty(); i++) 485 499 { 486 if (lnb_presets[i].type == lnb.GetType() && 487 lnb_presets[i].lof_sw == lnb.GetLOFSwitch() && 488 lnb_presets[i].lof_lo == lnb.GetLOFLow() && 489 lnb_presets[i].lof_hi == lnb.GetLOFHigh()) 500 if (lnb_presets[i].type == lnb.GetType() && 501 lnb_presets[i].lof_sw == lnb.GetLOFSwitch() && 502 lnb_presets[i].lof_lo == lnb.GetLOFLow() && 503 lnb_presets[i].lof_hi == lnb.GetLOFHigh() && 504 lnb_presets[i].reversed == lnb.IsReversed()) 490 505 { 491 506 break; 492 507 } … … 645 660 DiSEqCDevLNB &m_lnb; 646 661 }; 647 662 663 class LNBReversedSetting : public CheckBoxSetting 664 { 665 public: 666 LNBReversedSetting(DiSEqCDevLNB &lnb) : m_lnb(lnb) 667 { 668 setLabel(DeviceTree::tr("LNB Reversed")); 669 QString help = DeviceTree::tr( 670 "This defines whether the signal reaching the LNB " 671 "is reversed from normal polarization. This happens " 672 "to circular signals bouncing twice on a toroidal " 673 "dish."); 674 setHelpText(help); 675 } 676 677 virtual void load(void) 678 { 679 setValue(m_lnb.IsReversed()); 680 } 681 682 virtual void save(void) 683 { 684 m_lnb.SetReversed(getValue()); 685 } 686 private: 687 DiSEqCDevLNB &m_lnb; 688 }; 689 648 690 //////////////////////////////////////// LNBConfig 649 691 650 692 LNBConfig::LNBConfig(DiSEqCDevLNB &lnb) … … 664 706 group->addChild(m_lof_lo); 665 707 m_lof_hi = new LNBLOFHighSetting(lnb); 666 708 group->addChild(m_lof_hi); 709 m_reversed = new LNBReversedSetting(lnb); 710 group->addChild(m_reversed); 667 711 connect(m_type, SIGNAL(valueChanged(const QString&)), 668 712 this, SLOT( UpdateType( void))); 669 713 connect(preset, SIGNAL(valueChanged(const QString&)), … … 690 734 m_lof_switch->setValue(QString::number(preset.lof_sw / 1000)); 691 735 m_lof_lo->setValue(QString::number(preset.lof_lo / 1000)); 692 736 m_lof_hi->setValue(QString::number(preset.lof_hi / 1000)); 737 m_reversed->setValue(preset.reversed); 693 738 m_type->setEnabled(false); 694 739 m_lof_switch->setEnabled(false); 695 740 m_lof_hi->setEnabled(false); 696 741 m_lof_lo->setEnabled(false); 742 m_reversed->setEnabled(false); 697 743 } 698 744 } 699 745 … … 709 755 m_lof_switch->setEnabled(false); 710 756 m_lof_hi->setEnabled(false); 711 757 m_lof_lo->setEnabled(true); 758 m_reversed->setEnabled(true); 712 759 break; 713 760 case DiSEqCDevLNB::kTypeVoltageAndToneControl: 714 761 m_lof_switch->setEnabled(true); 715 762 m_lof_hi->setEnabled(true); 716 763 m_lof_lo->setEnabled(true); 764 m_reversed->setEnabled(true); 717 765 break; 718 766 case DiSEqCDevLNB::kTypeBandstacked: 719 767 m_lof_switch->setEnabled(false); 720 768 m_lof_hi->setEnabled(true); 721 769 m_lof_lo->setEnabled(true); 770 m_reversed->setEnabled(true); 722 771 break; 723 772 } 724 773 } -
libs/libmythtv/diseqcsettings.h
75 75 class LNBLOFSwitchSetting; 76 76 class LNBLOFLowSetting; 77 77 class LNBLOFHighSetting; 78 class LNBReversedSetting; 78 79 79 80 class LNBConfig : public ConfigurationWizard 80 81 { … … 92 93 LNBLOFSwitchSetting *m_lof_switch; 93 94 LNBLOFLowSetting *m_lof_lo; 94 95 LNBLOFHighSetting *m_lof_hi; 96 LNBReversedSetting *m_reversed; 95 97 }; 96 98 97 99 class DeviceTree : public ListBoxSetting -
libs/libmythtv/diseqc.cpp
1849 1849 DiSEqCDevLNB::DiSEqCDevLNB(DiSEqCDevTree &tree, uint devid) 1850 1850 : DiSEqCDevDevice(tree, devid), 1851 1851 m_type(kTypeVoltageAndToneControl), m_lof_switch(11700000), 1852 m_lof_hi(10600000), m_lof_lo(9750000) 1852 m_lof_hi(10600000), m_lof_lo(9750000), 1853 m_reversed(false) 1853 1854 { 1854 1855 Reset(); 1855 1856 } … … 1883 1884 MSqlQuery query(MSqlQuery::InitCon()); 1884 1885 query.prepare( 1885 1886 "SELECT subtype, lnb_lof_switch, " 1886 " lnb_lof_hi, lnb_lof_lo " 1887 " lnb_lof_hi, lnb_lof_lo, " 1888 " reversed " 1887 1889 "FROM diseqc_tree " 1888 1890 "WHERE diseqcid = :DEVID"); 1889 1891 query.bindValue(":DEVID", GetDeviceID()); … … 1899 1901 m_lof_switch = query.value(1).toInt(); 1900 1902 m_lof_hi = query.value(2).toInt(); 1901 1903 m_lof_lo = query.value(3).toInt(); 1904 m_reversed = query.value(4).toInt(); 1902 1905 } 1903 1906 1904 1907 return true; … … 1921 1924 " subtype = :TYPE, " 1922 1925 " lnb_lof_switch = :LOFSW, " 1923 1926 " lnb_lof_lo = :LOFLO, " 1924 " lnb_lof_hi = :LOFHI " 1927 " lnb_lof_hi = :LOFHI, " 1928 " reversed = :REVERSED " 1925 1929 "WHERE diseqcid = :DEVID"); 1926 1930 } 1927 1931 else … … 1930 1934 "INSERT INTO diseqc_tree" 1931 1935 " ( parentid, ordinal, type, " 1932 1936 " description, subtype, lnb_lof_switch, " 1933 " lnb_lof_lo, lnb_lof_hi ) "1937 " lnb_lof_lo, lnb_lof_hi, reversed ) " 1934 1938 "VALUES " 1935 1939 " (:PARENT, :ORDINAL, 'lnb', " 1936 1940 " :DESC, :TYPE, :LOFSW, " 1937 " :LOFLO, :LOFHI ) ");1941 " :LOFLO, :LOFHI, :REVERSED ) "); 1938 1942 } 1939 1943 1940 1944 if (m_parent) … … 1946 1950 query.bindValue(":LOFSW", m_lof_switch); 1947 1951 query.bindValue(":LOFLO", m_lof_lo); 1948 1952 query.bindValue(":LOFHI", m_lof_hi); 1953 query.bindValue(":REVERSED",m_reversed); 1949 1954 query.bindValue(":DEVID", GetDeviceID()); 1950 1955 1951 1956 // update dev_id … … 1996 2001 (void) tuning; 1997 2002 #ifdef USING_DVB 1998 2003 char pol = tuning.PolarityChar(); 1999 return (pol == 'h' || pol == 'l'); 2004 bool horizontal = (pol == 'h' || pol == 'l'); 2005 if (IsReversed()) 2006 horizontal = !horizontal; 2007 return horizontal; 2000 2008 #else 2001 2009 return false; 2002 2010 #endif // !USING_DVB