Ticket #2802: mythtv-scan-rotor.patch

File mythtv-scan-rotor.patch, 5.7 KB (added by yeasah@…, 15 years ago)

patch to improve scanner when dish rotor is present

  • libs/libmythtv/dvbsignalmonitor.h

     
    2626    bool UpdateFiltersFromStreamData(void);
    2727
    2828    virtual void SetRotorTarget(float target);
     29    bool isRotorMoving(void) const;
    2930
    3031  public slots:
    3132    void deleteLater(void);
  • libs/libmythtv/scanwizardhelpers.h

     
    6666  protected:
    6767    ScanSignalMeter   *ss;
    6868    ScanSignalMeter   *sn;
     69    ScanSignalMeter   *pos;
    6970    ScanSignalMeter   *progressBar;
    7071
    7172    TransLabelSetting *sl;
     
    7778    void exec(ScanWizardScanner *parent);
    7879    void signalToNoise(int value);
    7980    void signalStrength(int value);
     81    void rotorPosition(int value);
    8082    void dvbLock(int value);
    8183    void status(const QString& value);
    8284
     
    9698        DVBSNR,
    9799        DVBSignalStrength,
    98100        DVBLock,
     101        DVBRotorPosition,
    99102    };
    100103
    101104    ScannerEvent(TYPE t) : QCustomEvent(t + QEvent::User) { ; }
  • libs/libmythtv/scanwizardscanner.cpp

     
    172172        case ScannerEvent::DVBSignalStrength:
    173173            popupProgress->signalStrength(scanEvent->intValue());
    174174            break;
     175        case ScannerEvent::DVBRotorPosition:
     176            popupProgress->rotorPosition(scanEvent->intValue());
     177            break;
    175178    }
    176179}
    177180
     
    229232    dvbSignalStrength(val.GetNormalizedValue(0, 65535));
    230233}
    231234
     235void ScanWizardScanner::dvbRotorPosition(const SignalMonitorValue &val)
     236{
     237    dvbRotorPosition(val.GetNormalizedValue(0, 65535));
     238}
     239
    232240void ScanWizardScanner::dvbLock(int locked)
    233241{
    234242    ScannerEvent* e = new ScannerEvent(ScannerEvent::DVBLock);
     
    250258    QApplication::postEvent(this, e);
    251259}
    252260
     261void ScanWizardScanner::dvbRotorPosition(int i)
     262{
     263    ScannerEvent* e = new ScannerEvent(ScannerEvent::DVBRotorPosition);
     264    e->intValue(i);
     265    QApplication::postEvent(this, e);
     266}
     267
    253268// full scan of existing transports broken
    254269// existing transport scan broken
    255270void ScanWizardScanner::Scan(
     
    557572                SIGNAL(StatusSignalStrength(const SignalMonitorValue&)),
    558573                this,
    559574                SLOT(  dvbSignalStrength(   const SignalMonitorValue&)));
     575        connect(monitor,
     576                SIGNAL(StatusRotorPosition(const SignalMonitorValue&)),
     577                this,
     578                SLOT(  dvbRotorPosition(   const SignalMonitorValue&)));
    560579    }
    561580
    562581#ifdef USING_DVB
  • libs/libmythtv/siscan.cpp

     
    623623    // ok the tables haven't timed out, but have we hit the signal timeout?
    624624    if (timer.elapsed() > (int)(*current).timeoutTune)
    625625    {
     626#ifdef USING_DVB
     627        // If the rotor is still moving, reset the timer and keep waiting
     628        if (GetDVBSignalMonitor() && GetDVBSignalMonitor()->isRotorMoving())
     629        {
     630            timer.restart();
     631            return false;
     632        }
     633#endif // USING_DVB
     634
    626635        // If we don't have a signal in timeoutTune msec, continue..
    627636        SignalMonitor *sm = GetSignalMonitor();
    628637        if (NULL == sm || sm->HasSignalLock())
  • libs/libmythtv/scanwizardscanner.h

     
    9292    void dvbLock(const SignalMonitorValue&);
    9393    void dvbSNR(const SignalMonitorValue&);
    9494    void dvbSignalStrength(const SignalMonitorValue&);
     95    void dvbRotorPosition(const SignalMonitorValue&);
    9596
    9697    void serviceScanPctComplete(int pct);
    9798
     
    106107    void dvbLock(int);
    107108    void dvbSNR(int);
    108109    void dvbSignalStrength(int);
     110    void dvbRotorPosition(int);
    109111    void customEvent(QCustomEvent *e);
    110112
    111113  public:
  • libs/libmythtv/dvbsignalmonitor.cpp

     
    130130    rotorPosition.SetThreshold((int)roundf(100 * target));
    131131}
    132132
     133bool DVBSignalMonitor::isRotorMoving(void) const
     134{
     135    QMutexLocker locker(&statusLock);
     136    return HasFlags(kDVBSigMon_WaitForPos) && !rotorPosition.IsGood();
     137}
     138
    133139/** \fn DVBSignalMonitor::GetDVBCardNum(void) const
    134140 *  \brief Returns DVB Card Number from DVBChannel.
    135141 */
  • libs/libmythtv/scanwizardhelpers.cpp

     
    105105    {
    106106        addChild(ss = new ScanSignalMeter(65535));
    107107        addChild(sn = new ScanSignalMeter(65535));
     108        addChild(pos = new ScanSignalMeter(65535));
    108109        ss->setLabel(tr("Signal Strength"));
    109110        sn->setLabel(tr("Signal/Noise"));
     111        pos->setLabel(tr("Rotor Movement"));
    110112    }
    111113
    112114    TransButtonSetting *cancel = new TransButtonSetting();
     
    136138    ss->setValue(value);
    137139}
    138140
     141void ScanProgressPopup::rotorPosition(int value)
     142{
     143    pos->setValue(value);
     144}
     145
    139146void ScanProgressPopup::dvbLock(int value)
    140147{
    141148    sl->setValue((value) ? tr("Locked") : tr("No Lock"));