Ticket #2473: 2473-v1.patch
File 2473-v1.patch, 10.7 KB (added by , 18 years ago) |
---|
-
libs/libmythtv/diseqc.h
369 369 void SetLOFSwitch(uint lof_switch) { m_lof_switch = lof_switch; } 370 370 void SetLOFHigh( uint lof_hi) { m_lof_hi = lof_hi; } 371 371 void SetLOFLow( uint lof_lo) { m_lof_lo = lof_lo; } 372 void SetPolarityInverted(bool inv) { m_pol_inv = inv; } 372 373 373 374 // Gets 374 375 dvbdev_lnb_t GetType(void) const { return m_type; } 375 376 uint GetLOFSwitch(void) const { return m_lof_switch; } 376 377 uint GetLOFHigh(void) const { return m_lof_hi; } 377 378 uint GetLOFLow(void) const { return m_lof_lo; } 379 bool IsPolarityInverted(void) const { return m_pol_inv; } 378 380 bool IsHighBand(const DVBTuning&) const; 379 381 bool IsHorizontal(const DVBTuning&) const; 380 382 uint32_t GetIntermediateFrequency(const DiSEqCDevSettings&, … … 393 395 uint m_lof_switch; 394 396 uint m_lof_hi; 395 397 uint m_lof_lo; 398 /// If a signal is circularly polarized the polarity will flip 399 /// on each reflection, so antenna systems with an even number 400 /// of reflectors will need to set this value. 401 bool m_pol_inv; 396 402 397 403 static const TypeTable LNBTypeTable[5]; 398 404 }; -
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 lnb_pol_inv 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
489 489 uint lof_sw; 490 490 uint lof_lo; 491 491 uint lof_hi; 492 bool pol_inv; 492 493 }; 493 494 494 495 static lnb_preset lnb_presets[] = 495 496 { 496 /* description, type, LOF switch, LOF low, LOF high */497 /* description, type, LOF switch, LOF low, LOF high, inverted polarity */ 497 498 { DeviceTree::tr("Single (Europe)"), 498 DiSEqCDevLNB::kTypeVoltageControl, 0, 9750000, 0 }, 499 DiSEqCDevLNB::kTypeVoltageControl, 500 0, 9750000, 0, false }, 499 501 { DeviceTree::tr("Universal (Europe)"), 500 DiSEqCDevLNB::kTypeVoltageAndToneControl, 11700000, 9750000, 10600000 }, 502 DiSEqCDevLNB::kTypeVoltageAndToneControl, 503 11700000, 9750000, 10600000, false }, 501 504 { DeviceTree::tr("Circular (N. America)"), 502 DiSEqCDevLNB::kTypeVoltageControl, 0, 11250000, 0 }, 505 DiSEqCDevLNB::kTypeVoltageControl, 506 0, 11250000, 0, false }, 507 { DeviceTree::tr("Circular (Inv) (N. America)"), 508 DiSEqCDevLNB::kTypeVoltageControl, 509 0, 11250000, 0, true }, 503 510 { DeviceTree::tr("Linear (N. America)"), 504 DiSEqCDevLNB::kTypeVoltageControl, 0, 10750000, 0 }, 511 DiSEqCDevLNB::kTypeVoltageControl, 512 0, 10750000, 0, false }, 505 513 { DeviceTree::tr("C Band"), 506 DiSEqCDevLNB::kTypeVoltageControl, 0, 5150000, 0 }, 514 DiSEqCDevLNB::kTypeVoltageControl, 515 0, 5150000, 0, false }, 507 516 { DeviceTree::tr("DishPro Bandstacked"), 508 DiSEqCDevLNB::kTypeBandstacked, 0, 11250000, 14350000 }, 517 DiSEqCDevLNB::kTypeBandstacked, 518 0, 11250000, 14350000, false }, 519 { DeviceTree::tr("DishPro Bandstacked (Inv))"), 520 DiSEqCDevLNB::kTypeBandstacked, 521 0, 11250000, 14350000, true }, 509 522 { QString::null, 510 DiSEqCDevLNB::kTypeVoltageControl, 0, 0, 0 }, 523 DiSEqCDevLNB::kTypeVoltageControl, 524 0, 0, 0, false }, 511 525 }; 512 526 513 527 uint FindPreset(const DiSEqCDevLNB &lnb) … … 518 532 if (lnb_presets[i].type == lnb.GetType() && 519 533 lnb_presets[i].lof_sw == lnb.GetLOFSwitch() && 520 534 lnb_presets[i].lof_lo == lnb.GetLOFLow() && 521 lnb_presets[i].lof_hi == lnb.GetLOFHigh()) 535 lnb_presets[i].lof_hi == lnb.GetLOFHigh() && 536 lnb_presets[i].pol_inv== lnb.IsPolarityInverted()) 522 537 { 523 538 break; 524 539 } … … 677 692 DiSEqCDevLNB &m_lnb; 678 693 }; 679 694 695 class LNBPolarityInvertedSetting : public CheckBoxSetting 696 { 697 public: 698 LNBPolarityInvertedSetting(DiSEqCDevLNB &lnb) : m_lnb(lnb) 699 { 700 setLabel(DeviceTree::tr("LNB Reversed")); 701 QString help = DeviceTree::tr( 702 "This defines whether the signal reaching the LNB " 703 "is reversed from normal polarization. This happens " 704 "to circular signals bouncing twice on a toroidal " 705 "dish."); 706 setHelpText(help); 707 } 708 709 virtual void load(void) 710 { 711 setValue(m_lnb.IsPolarityInverted()); 712 } 713 714 virtual void save(void) 715 { 716 m_lnb.SetPolarityInverted(getValue()); 717 } 718 719 private: 720 DiSEqCDevLNB &m_lnb; 721 }; 722 680 723 //////////////////////////////////////// LNBConfig 681 724 682 725 LNBConfig::LNBConfig(DiSEqCDevLNB &lnb) … … 696 739 group->addChild(m_lof_lo); 697 740 m_lof_hi = new LNBLOFHighSetting(lnb); 698 741 group->addChild(m_lof_hi); 742 m_pol_inv = new LNBPolarityInvertedSetting(lnb); 743 group->addChild(m_pol_inv); 699 744 connect(m_type, SIGNAL(valueChanged(const QString&)), 700 745 this, SLOT( UpdateType( void))); 701 746 connect(preset, SIGNAL(valueChanged(const QString&)), … … 722 767 m_lof_switch->setValue(QString::number(preset.lof_sw / 1000)); 723 768 m_lof_lo->setValue(QString::number(preset.lof_lo / 1000)); 724 769 m_lof_hi->setValue(QString::number(preset.lof_hi / 1000)); 770 m_pol_inv->setValue(preset.pol_inv); 725 771 m_type->setEnabled(false); 726 772 m_lof_switch->setEnabled(false); 727 773 m_lof_hi->setEnabled(false); 728 774 m_lof_lo->setEnabled(false); 775 m_pol_inv->setEnabled(false); 729 776 } 730 777 } 731 778 … … 741 788 m_lof_switch->setEnabled(false); 742 789 m_lof_hi->setEnabled(false); 743 790 m_lof_lo->setEnabled(true); 791 m_pol_inv->setEnabled(true); 744 792 break; 745 793 case DiSEqCDevLNB::kTypeVoltageAndToneControl: 746 794 m_lof_switch->setEnabled(true); 747 795 m_lof_hi->setEnabled(true); 748 796 m_lof_lo->setEnabled(true); 797 m_pol_inv->setEnabled(true); 749 798 break; 750 799 case DiSEqCDevLNB::kTypeBandstacked: 751 800 m_lof_switch->setEnabled(false); 752 801 m_lof_hi->setEnabled(true); 753 802 m_lof_lo->setEnabled(true); 803 m_pol_inv->setEnabled(true); 754 804 break; 755 805 } 756 806 } -
libs/libmythtv/diseqcsettings.h
75 75 class LNBLOFSwitchSetting; 76 76 class LNBLOFLowSetting; 77 77 class LNBLOFHighSetting; 78 class LNBPolarityInvertedSetting; 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 LNBPolarityInvertedSetting *m_pol_inv; 95 97 }; 96 98 97 99 class DeviceTree : public ListBoxSetting -
libs/libmythtv/diseqc.cpp
1907 1907 DiSEqCDevLNB::DiSEqCDevLNB(DiSEqCDevTree &tree, uint devid) 1908 1908 : DiSEqCDevDevice(tree, devid), 1909 1909 m_type(kTypeVoltageAndToneControl), m_lof_switch(11700000), 1910 m_lof_hi(10600000), m_lof_lo(9750000) 1910 m_lof_hi(10600000), m_lof_lo(9750000), 1911 m_pol_inv(false) 1911 1912 { 1912 1913 Reset(); 1913 1914 } … … 1942 1943 query.prepare( 1943 1944 "SELECT subtype, lnb_lof_switch, " 1944 1945 " lnb_lof_hi, lnb_lof_lo, " 1945 " cmd_repeat "1946 " lnb_pol_inv, cmd_repeat " 1946 1947 "FROM diseqc_tree " 1947 1948 "WHERE diseqcid = :DEVID"); 1948 1949 query.bindValue(":DEVID", GetDeviceID()); … … 1959 1960 m_lof_hi = query.value(2).toInt(); 1960 1961 m_lof_lo = query.value(3).toInt(); 1961 1962 m_repeat = query.value(4).toUInt(); 1963 m_pol_inv = query.value(5).toUInt(); 1962 1964 } 1963 1965 1964 1966 return true; … … 1982 1984 " lnb_lof_switch = :LOFSW, " 1983 1985 " lnb_lof_lo = :LOFLO, " 1984 1986 " lnb_lof_hi = :LOFHI, " 1987 " lnb_pol_inv = :POLINV " 1985 1988 " cmd_repeat = :REPEAT " 1986 1989 "WHERE diseqcid = :DEVID"); 1987 1990 } … … 1991 1994 "INSERT INTO diseqc_tree" 1992 1995 " ( parentid, ordinal, type, " 1993 1996 " description, subtype, lnb_lof_switch, " 1994 " lnb_lof_lo, lnb_lof_hi, cmd_repeat ) " 1997 " lnb_lof_lo, lnb_lof_hi, lnb_pol_inv, " 1998 " cmd_repeat ) " 1995 1999 "VALUES " 1996 2000 " (:PARENT, :ORDINAL, 'lnb', " 1997 2001 " :DESC, :TYPE, :LOFSW, " 1998 " :LOFLO, :LOFHI, :REPEAT ) "); 2002 " :LOFLO, :LOFHI, :POLINV, " 2003 " :REPEAT ) "); 1999 2004 } 2000 2005 2001 2006 if (m_parent) … … 2007 2012 query.bindValue(":LOFSW", m_lof_switch); 2008 2013 query.bindValue(":LOFLO", m_lof_lo); 2009 2014 query.bindValue(":LOFHI", m_lof_hi); 2015 query.bindValue(":POLINV", m_pol_inv); 2010 2016 query.bindValue(":REPEAT", m_repeat); 2011 2017 query.bindValue(":DEVID", GetDeviceID()); 2012 2018 … … 2058 2064 (void) tuning; 2059 2065 #ifdef USING_DVB 2060 2066 char pol = tuning.PolarityChar(); 2061 return (pol == 'h' || pol == 'l') ;2067 return (pol == 'h' || pol == 'l') ^ IsPolarityInverted(); 2062 2068 #else 2063 2069 return false; 2064 2070 #endif // !USING_DVB