Ticket #1990: myth_bandstacked_r10285.diff
File myth_bandstacked_r10285.diff, 20.2 KB (added by , 19 years ago) |
---|
-
libs/libmythtv/videosource.h
531 531 class LNBLofSwitch; 532 532 class LNBLofLo; 533 533 class LNBLofHi; 534 class LNBLofStackLo; 535 class LNBLofStackHi; 536 class LNBBandstacked; 537 class LNBBandstackPol; 534 538 535 539 class CardInput: public ConfigurationWizard 536 540 { … … 584 588 LNBLofSwitch *lnblofswitch; 585 589 LNBLofLo *lnbloflo; 586 590 LNBLofHi *lnblofhi; 591 LNBLofStackLo *lnblofstacklo; 592 LNBLofStackHi *lnblofstackhi; 593 LNBBandstacked *lnbbandstacked; 594 LNBBandstackPol *lnbbandstackpol; 587 595 StartingChannel *startchan; 588 596 }; 589 597 -
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 = "114 6";13 const QString currentDatabaseVersion = "1147"; 14 14 15 15 static bool UpdateDBVersionNumber(const QString &newnumber); 16 16 static bool performActualUpdate(const QString updates[], QString version, … … 2315 2315 return false; 2316 2316 } 2317 2317 2318 if (dbver == "1145") 2319 { 2320 const QString updates[] = { 2321 "ALTER TABLE cardinput ADD COLUMN lnb_lof_stack_hi int(11) DEFAULT 0 AFTER lnb_lof_lo;", 2322 "ALTER TABLE cardinput ADD COLUMN lnb_lof_stack_lo int(11) DEFAULT 0 AFTER lnb_lof_stack_hi;", 2323 "ALTER TABLE cardinput ADD COLUMN bandstacked int(1) DEFAULT 0 AFTER lnb_lof_stack_lo;", 2324 "ALTER TABLE cardinput ADD COLUMN bandstack_pol char(1) DEFAULT "" AFTER bandstacked;", 2325 "" 2326 }; 2327 2328 if (!performActualUpdate(updates, "1146", dbver)) 2329 return false; 2330 } 2331 2318 2332 //"ALTER TABLE capturecard DROP COLUMN dvb_recordts;" in 0.21 2319 2333 //"ALTER TABLE capturecard DROP COLUMN dvb_hw_decoder;" in 0.21 2320 2334 //"ALTER TABLE cardinput DROP COLUMN preference;" in 0.22 -
libs/libmythtv/dvbtypes.cpp
581 581 582 582 if (FE_QPSK == type) 583 583 { 584 msg = QString("Frequency: %1 Symbol Rate: %2 Pol: %3 Inv: %4 ")584 msg = QString("Frequency: %1 Symbol Rate: %2 Pol: %3 Inv: %4 BS: %5") 585 585 .arg(Frequency()) 586 586 .arg(QPSKSymbolRate()) 587 587 .arg((voltage == SEC_VOLTAGE_13) ? "V/R" : "H/L") 588 .arg(InversionString()); 588 .arg(InversionString()) 589 .arg(bandstacked ? "Y" : "N"); 589 590 } 590 591 else if (FE_QAM == type) 591 592 { … … 682 683 const QString& _lnb_lof_switch, 683 684 const QString& _lnb_lof_hi, 684 685 const QString& _lnb_lof_lo, 686 const QString& _lnb_lof_stack_hi, 687 const QString& _lnb_lof_stack_lo, 688 const QString& _bandstacked, 689 const QString& bandstack_pol, 685 690 const QString &modulation) 686 691 { 687 692 bool ok = true; … … 702 707 return false; 703 708 } 704 709 705 voltage = parsePolarity(pol, ok);710 voltage = parsePolarity(pol, _bandstacked, bandstack_pol, ok); 706 711 if (SEC_VOLTAGE_OFF == voltage) 707 712 { 708 713 VERBOSE(VB_IMPORTANT, LOC_ERR + "Invalid polarization, aborting."); … … 718 723 lnb_lof_switch = _lnb_lof_switch.toInt(); 719 724 lnb_lof_hi = _lnb_lof_hi.toInt(); 720 725 lnb_lof_lo = _lnb_lof_lo.toInt(); 726 lnb_lof_stack_hi = _lnb_lof_stack_hi.toInt(); 727 lnb_lof_stack_lo = _lnb_lof_stack_lo.toInt(); 721 728 return true; 722 729 } 723 730 #endif … … 730 737 const QString& _diseqc_pos, 731 738 const QString& _lnb_lof_switch, 732 739 const QString& _lnb_lof_hi, 733 const QString& _lnb_lof_lo) 740 const QString& _lnb_lof_lo, 741 const QString& _lnb_lof_stack_hi, 742 const QString& _lnb_lof_stack_lo, 743 const QString& _bandstacked, 744 const QString& bandstack_pol) 734 745 { 735 746 bool ok = true; 736 747 … … 753 764 return false; 754 765 } 755 766 756 voltage = parsePolarity(pol, ok);767 voltage = parsePolarity(pol, _bandstacked, bandstack_pol, ok); 757 768 if (SEC_VOLTAGE_OFF == voltage) 758 769 { 759 770 VERBOSE(VB_IMPORTANT, LOC_ERR + "Invalid polarization, aborting."); … … 769 780 lnb_lof_switch = _lnb_lof_switch.toInt(); 770 781 lnb_lof_hi = _lnb_lof_hi.toInt(); 771 782 lnb_lof_lo = _lnb_lof_lo.toInt(); 783 lnb_lof_stack_hi = _lnb_lof_stack_hi.toInt(); 784 lnb_lof_stack_lo = _lnb_lof_stack_lo.toInt(); 772 785 return true; 773 786 } 774 787 … … 823 836 return BANDWIDTH_AUTO; 824 837 } 825 838 826 fe_sec_voltage DVBTuning::parsePolarity(const QString &pol, bool &ok) 839 fe_sec_voltage DVBTuning::parsePolarity(const QString &pol, const QString &_bandstacked, 840 const QString &bandstack_pol, bool &ok) 827 841 { 842 fe_sec_voltage voltage; 843 fe_sec_voltage voltage_stack; 844 828 845 char polarity = QChar(pol[0]).lower(); 846 char polarity_stack = QChar(bandstack_pol[0]).lower(); 829 847 ok = true; 830 848 switch (polarity) 831 849 { 832 850 case 'v': 833 case 'r': return SEC_VOLTAGE_13; 851 case 'r': 852 voltage = SEC_VOLTAGE_13; 853 break; 834 854 case 'h': 835 case 'l': return SEC_VOLTAGE_18; 836 default: return SEC_VOLTAGE_OFF; 855 case 'l': 856 voltage = SEC_VOLTAGE_18; 857 break; 858 default: 859 voltage = SEC_VOLTAGE_OFF; 837 860 } 861 862 switch (polarity_stack) 863 { 864 case 'v': 865 case 'r': 866 voltage_stack = SEC_VOLTAGE_13; 867 break; 868 case 'h': 869 case 'l': 870 voltage_stack = SEC_VOLTAGE_18; 871 break; 872 default: 873 voltage_stack = SEC_VOLTAGE_OFF; 874 } 875 876 if (_bandstacked.toInt() && (voltage == voltage_stack)) 877 { 878 bandstacked = true; 879 880 switch (voltage) 881 { 882 case SEC_VOLTAGE_13: 883 voltage = SEC_VOLTAGE_18; 884 break; 885 case SEC_VOLTAGE_18: 886 voltage = SEC_VOLTAGE_13; 887 break; 888 default: 889 voltage = SEC_VOLTAGE_OFF; 890 } 891 } 892 else 893 bandstacked = false; 894 895 return voltage; 838 896 } 839 897 840 898 fe_guard_interval DVBTuning::parseGuardInterval(const QString &gi, bool &ok) -
libs/libmythtv/scanwizardscanner.cpp
276 276 MSqlQuery query(MSqlQuery::InitCon()); 277 277 query.prepare( 278 278 "SELECT dvb_diseqc_type, diseqc_port, diseqc_pos, " 279 " lnb_lof_switch, lnb_lof_hi, lnb_lof_lo " 279 " lnb_lof_switch, lnb_lof_hi, lnb_lof_lo, " 280 " lnb_lof_stack_hi, lnb_lof_stack_lo, " 281 " bandstacked, bandstack_pol " 280 282 "FROM cardinput, capturecard " 281 283 "WHERE cardinput.cardid = capturecard.cardid AND " 282 284 " cardinput.cardid = :CARDID AND " … … 298 300 startChan["lnb_lof_switch"] = query.value(3).toString(); 299 301 startChan["lnb_lof_hi"] = query.value(4).toString(); 300 302 startChan["lnb_lof_lo"] = query.value(5).toString(); 303 startChan["lnb_lof_stack_hi"] = query.value(6).toString(); 304 startChan["lnb_lof_stack_lo"] = query.value(7).toString(); 305 startChan["bandstacked"] = query.value(8).toString(); 306 startChan["bandstack_pol"] = query.value(9).toString(); 301 307 return true; 302 308 } 303 309 … … 387 393 startChan["polarity"], 388 394 startChan["diseqc_type"], startChan["diseqc_port"], 389 395 startChan["diseqc_pos"], startChan["lnb_lof_switch"], 390 startChan["lnb_lof_hi"], startChan["lnb_lof_lo"]); 396 startChan["lnb_lof_hi"], startChan["lnb_lof_lo"], 397 startChan["lnb_lof_stack_hi"], startChan["lnb_lof_stack_lo"], 398 startChan["bandstacked"], startChan["bandstack_pol"]); 391 399 } 392 400 #endif // USING_DVB 393 401 } -
libs/libmythtv/siscan.cpp
830 830 startChan["polarity"], 831 831 startChan["diseqc_type"], startChan["diseqc_port"], 832 832 startChan["diseqc_pos"], startChan["lnb_lof_switch"], 833 startChan["lnb_lof_hi"], startChan["lnb_lof_lo"]); 833 startChan["lnb_lof_hi"], startChan["lnb_lof_lo"], 834 startChan["lnb_lof_stack_hi"], startChan["lnb_lof_stack_lo"], 835 startChan["bandstacked"], startChan["bandstacked_pol"]); 834 836 } 835 837 else if (std == "dvb" && mod.left(3) == "qam") 836 838 { -
libs/libmythtv/dvbchannel.h
87 87 QString frequency, QString inversion, QString symbolrate, 88 88 QString fec, QString polarity, QString dvb_diseqc_type, 89 89 QString diseqc_port, QString diseqc_pos, QString lnb_lof_switch, 90 QString lnb_lof_hi, QString lnb_lof_lo, QString _sistandard, 90 QString lnb_lof_hi, QString lnb_lof_lo, QString lnb_lof_stack_hi, 91 QString lnb_lof_stack_lo, QString bandstacked, QString bandstack_pol, 92 QString _sistandard, 91 93 QString hp_code_rate, QString lp_code_rate, QString constellation, 92 94 QString trans_mode, QString guard_interval, QString hierarchy, 93 95 QString modulation, QString bandwidth, QString _input_id); -
libs/libmythtv/dvbtypes.h
320 320 DVBTuning() 321 321 : voltage(SEC_VOLTAGE_OFF), tone(SEC_TONE_OFF), 322 322 diseqc_type(0), diseqc_port(0), diseqc_pos(0.0f), 323 lnb_lof_switch(0), lnb_lof_hi(0), lnb_lof_lo(0) 323 lnb_lof_switch(0), lnb_lof_hi(0), lnb_lof_lo(0), 324 lnb_lof_stack_hi(0), lnb_lof_stack_lo(0), 325 bandstacked(false) 324 326 { 325 327 bzero(¶ms, sizeof(dvb_fe_params)); 326 328 } … … 334 336 unsigned int lnb_lof_switch; 335 337 unsigned int lnb_lof_hi; 336 338 unsigned int lnb_lof_lo; 339 unsigned int lnb_lof_stack_hi; 340 unsigned int lnb_lof_stack_lo; 341 bool bandstacked; 337 342 338 343 bool equalQPSK(const DVBTuning& other, uint range = 0) const 339 344 { return equal_qpsk(params, other.params, range); } … … 356 361 357 362 // Helper functions to parse params from DB friendly strings 358 363 static fe_bandwidth parseBandwidth( const QString&, bool &ok); 359 static fe_sec_voltage parsePolarity( const QString&, bool &ok);360 364 static fe_guard_interval parseGuardInterval(const QString&, bool &ok); 361 365 static fe_transmit_mode parseTransmission( const QString&, bool &ok); 362 366 static fe_hierarchy parseHierarchy( const QString&, bool &ok); 363 367 static fe_spectral_inversion parseInversion(const QString&, bool &ok); 364 368 static fe_code_rate parseCodeRate( const QString&, bool &ok); 365 369 static fe_modulation parseModulation( const QString&, bool &ok); 370 fe_sec_voltage parsePolarity( const QString&, const QString&, 371 const QString&, bool &ok); 366 372 367 373 // Helper functions for UI and DB 368 374 uint Frequency() const { return params.frequency; } … … 393 399 const QString& pol, const QString& diseqc_type, 394 400 const QString& diseqc_port, const QString& diseqc_pos, 395 401 const QString& lnb_lof_switch, const QString& lnb_lof_hi, 396 const QString& lnb_lof_lo); 402 const QString& lnb_lof_lo, const QString& lnb_lof_stack_hi, 403 const QString& lnb_lof_stack_lo, const QString& bandstacked, 404 const QString& bandstack_pol); 397 405 398 406 bool parseQAM(const QString& frequency, const QString& inversion, 399 407 const QString& symbol_rate, const QString& fec_inner, … … 408 416 const QString& pol, const QString& diseqc_type, 409 417 const QString& diseqc_port, const QString& diseqc_pos, 410 418 const QString& lnb_lof_switch, const QString& lnb_lof_hi, 411 const QString& lnb_lof_lo, const QString& modulation); 419 const QString& lnb_lof_lo, const QString& lnb_lof_stack_hi, 420 const QString& lnb_lof_stack_lo, const QString& bandstacked, 421 const QString& bandstack_pol, const QString& modulation); 412 422 #endif 413 423 }; 414 424 -
libs/libmythtv/dvbchannel.cpp
408 408 "SELECT frequency, inversion, symbolrate, " 409 409 " fec, polarity, dvb_diseqc_type, " 410 410 " diseqc_port, diseqc_pos, lnb_lof_switch, " 411 " lnb_lof_hi, lnb_lof_lo, sistandard, " 411 " lnb_lof_hi, lnb_lof_lo, lnb_lof_stack_hi, " 412 " lnb_lof_stack_lo, " 413 " bandstacked, bandstack_pol, sistandard, " 412 414 " hp_code_rate, lp_code_rate, constellation, " 413 415 " transmission_mode, guard_interval, hierarchy, " 414 416 " modulation, bandwidth, cardinputid " … … 447 449 query.value(14).toString(), query.value(15).toString(), 448 450 query.value(16).toString(), query.value(17).toString(), 449 451 query.value(18).toString(), query.value(19).toString(), 450 query.value(20).toString()); 452 query.value(20).toString(), query.value(21).toString(), 453 query.value(22).toString(), query.value(23).toString(), 454 query.value(23).toString()); 451 455 } 452 456 453 457 bool DVBChannel::ParseTuningParams( … … 455 459 QString frequency, QString inversion, QString symbolrate, 456 460 QString fec, QString polarity, QString dvb_diseqc_type, 457 461 QString diseqc_port, QString diseqc_pos, QString lnb_lof_switch, 458 QString lnb_lof_hi, QString lnb_lof_lo, QString _sistandard, 462 QString lnb_lof_hi, QString lnb_lof_lo, QString lnb_lof_stack_hi, 463 QString lnb_lof_stack_lo, 464 QString bandstacked, QString bandstack_pol, QString _sistandard, 459 465 QString hp_code_rate, QString lp_code_rate, QString constellation, 460 466 QString trans_mode, QString guard_interval, QString hierarchy, 461 467 QString modulation, QString bandwidth, QString _input_id) … … 467 473 return cur_tuning.parseQPSK( 468 474 frequency, inversion, symbolrate, fec, polarity, 469 475 dvb_diseqc_type, diseqc_port, diseqc_pos, 470 lnb_lof_switch, lnb_lof_hi, lnb_lof_lo); 476 lnb_lof_switch, lnb_lof_hi, lnb_lof_lo, lnb_lof_stack_hi, 477 lnb_lof_stack_lo, bandstacked, bandstack_pol); 471 478 else if (FE_QAM == type) 472 479 return cur_tuning.parseQAM( 473 480 frequency, inversion, symbolrate, fec, modulation); … … 483 490 return cur_tuning.parseDVBS2( 484 491 frequency, inversion, symbolrate, fec, polarity, 485 492 dvb_diseqc_type, diseqc_port, diseqc_pos, 486 lnb_lof_switch, lnb_lof_hi, lnb_lof_lo, modulation); 493 lnb_lof_switch, lnb_lof_hi, lnb_lof_lo, lnb_lof_stack_hi, 494 lnb_lof_stack_lo, bandstacked, bandstack_pol, modulation); 487 495 #endif // FE_GET_EXTENDED_INFO 488 496 489 497 return false; … … 864 872 return tuning.Frequency(); 865 873 #endif 866 874 875 unsigned int lnb_lof_hi; 876 unsigned int lnb_lof_lo; 877 878 if (tuning.bandstacked) 879 { 880 lnb_lof_hi = tuning.lnb_lof_stack_hi; 881 lnb_lof_lo = tuning.lnb_lof_stack_lo; 882 } 883 else 884 { 885 lnb_lof_hi = tuning.lnb_lof_hi; 886 lnb_lof_lo = tuning.lnb_lof_lo; 887 } 888 867 889 uint freq = tuning.Frequency(); 868 890 bool tone = freq >= tuning.lnb_lof_switch; 869 uint lnb_hi = (uint) abs((int)freq - (int) tuning.lnb_lof_hi);870 uint lnb_lo = (uint) abs((int)freq - (int) tuning.lnb_lof_lo);891 uint lnb_hi = (uint) abs((int)freq - (int)lnb_lof_hi); 892 uint lnb_lo = (uint) abs((int)freq - (int)lnb_lof_lo); 871 893 872 894 if (p_tone) 873 895 *p_tone = (tone) ? SEC_TONE_ON : SEC_TONE_OFF; -
libs/libmythtv/videosource.cpp
1511 1511 }; 1512 1512 }; 1513 1513 1514 class LNBLofStackHi: public LineEditSetting, public CISetting { 1515 public: 1516 LNBLofStackHi(const CardInput& parent): 1517 CISetting(parent, "lnb_lof_stack_hi") { 1518 setLabel(QObject::tr("Bandstacked LNB LOF High")); 1519 setValue("13700000"); 1520 setHelpText(QObject::tr("This defines the offset (in Hz) the " 1521 "frequency coming from the bandstacked LNB polarity " 1522 "will be in high setting.")); 1523 }; 1524 }; 1525 1526 class LNBLofStackLo: public LineEditSetting, public CISetting { 1527 public: 1528 LNBLofStackLo(const CardInput& parent): 1529 CISetting(parent, "lnb_lof_stack_lo") { 1530 setLabel(QObject::tr("Bandstacked LNB LOF Low")); 1531 setValue("12850000"); 1532 setHelpText(QObject::tr("This defines the offset (in Hz) the " 1533 "frequency coming from the bandstacked LNB polarity " 1534 "will be in low setting.")); 1535 }; 1536 }; 1537 1538 class LNBBandstacked: public CheckBoxSetting, public CISetting { 1539 public: 1540 LNBBandstacked(const CardInput& parent): 1541 CISetting(parent, "bandstacked") 1542 { 1543 setValue(false); 1544 setLabel(QObject::tr("This is a bandstacked LNB.")); 1545 setHelpText(QObject::tr("Set this if your LNB is bandstacked " 1546 "(Dish Network DishPro LNBFs for example)")); 1547 }; 1548 }; 1549 1550 class LNBBandstackPol: public ComboBoxSetting, public CISetting 1551 { 1552 public: 1553 LNBBandstackPol(const CardInput& parent): 1554 CISetting(parent, "bandstack_pol") { 1555 setLabel("LNB Bandstack Polarity:"); 1556 addSelection(QObject::tr("No Bandstacking"), ""); 1557 addSelection(QObject::tr("Horizontal/Left"), "h"); 1558 addSelection(QObject::tr("Verticle/Right"), "v"); 1559 setHelpText(QObject::tr("For bandstacked LNBs, select the polarity " 1560 "which is bandstacked.")); 1561 }; 1562 }; 1563 1514 1564 class DiSEqCPos: public LineEditSetting, public CISetting 1515 1565 { 1516 1566 public: … … 1751 1801 dvbgroup->addChild(lnblofswitch = new LNBLofSwitch(*this)); 1752 1802 dvbgroup->addChild(lnblofhi = new LNBLofHi(*this)); 1753 1803 dvbgroup->addChild(lnbloflo = new LNBLofLo(*this)); 1804 dvbgroup->addChild(lnbbandstacked = new LNBBandstacked(*this)); 1805 dvbgroup->addChild(lnblofstacklo = new LNBLofStackLo(*this)); 1806 dvbgroup->addChild(lnblofstackhi = new LNBLofStackHi(*this)); 1807 dvbgroup->addChild(lnbbandstackpol = new LNBBandstackPol(*this)); 1754 1808 1755 1809 dvbgroup->addChild(new FreeToAir(*this)); 1756 1810 dvbgroup->addChild(new RadioServices(*this)); … … 1885 1939 lnblofswitch->setVisible(true); 1886 1940 lnbloflo->setVisible(true); 1887 1941 lnblofhi->setVisible(true); 1942 lnblofstackhi->setVisible(true); 1943 lnblofstacklo->setVisible(true); 1944 lnbbandstacked->setVisible(true); 1945 lnbbandstackpol->setVisible(true); 1888 1946 1889 1947 DISEQC_TYPES dt = CardUtil::GetDISEqCType(_cardid); 1890 1948 bool pos = (dt == DISEQC_POSITIONER_X); … … 1896 1954 lnblofswitch->setVisible(false); 1897 1955 lnbloflo->setVisible(false); 1898 1956 lnblofhi->setVisible(false); 1957 lnblofstackhi->setVisible(false); 1958 lnblofstacklo->setVisible(false); 1959 lnbbandstacked->setVisible(false); 1960 lnbbandstackpol->setVisible(false); 1899 1961 } 1900 1962 } 1901 1963 }