00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030 #ifndef _SCAN_MONITOR_H_
00031 #define _SCAN_MONITOR_H_
00032
00033
00034 #include <QObject>
00035 #include <QEvent>
00036
00037
00038 #include "signalmonitorlistener.h"
00039
00040 class ChannelScanner;
00041 class SignalMonitorValue;
00042 class QString;
00043
00044 class ScanMonitor :
00045 public QObject,
00046 public DVBSignalMonitorListener
00047 {
00048 Q_OBJECT
00049
00050 friend class QObject;
00051
00052 public:
00053 ScanMonitor(ChannelScanner *cs) : channelScanner(cs) { }
00054 virtual void deleteLater(void);
00055
00056 virtual void customEvent(QEvent*);
00057
00058
00059 void ScanPercentComplete(int pct);
00060 void ScanUpdateStatusText(const QString &status);
00061 void ScanUpdateStatusTitleText(const QString &status);
00062 void ScanAppendTextToLog(const QString &status);
00063 void ScanComplete(void);
00064
00065
00066 virtual void AllGood(void) { }
00067 virtual void StatusSignalLock(const SignalMonitorValue&);
00068 virtual void StatusChannelTuned(const SignalMonitorValue&);
00069 virtual void StatusSignalStrength(const SignalMonitorValue&);
00070
00071
00072 virtual void StatusSignalToNoise(const SignalMonitorValue&);
00073 virtual void StatusBitErrorRate(const SignalMonitorValue&) { }
00074 virtual void StatusUncorrectedBlocks(const SignalMonitorValue&) { }
00075 virtual void StatusRotorPosition(const SignalMonitorValue&);
00076
00077 private:
00078 ~ScanMonitor() { }
00079
00080 ChannelScanner *channelScanner;
00081 };
00082
00083 class Configurable;
00084
00085 class ScannerEvent : public QEvent
00086 {
00087 friend class QObject;
00088
00089 public:
00090
00091 ScannerEvent(QEvent::Type t) :
00092 QEvent(t), str(""), intvalue(0), cfg_ptr(NULL) { ; }
00093
00094 QString strValue() const { return str; }
00095 void strValue(const QString& _str) { str = _str; }
00096
00097 int intValue() const { return intvalue; }
00098 void intValue(int _intvalue) { intvalue = _intvalue; }
00099
00100 Configurable *ConfigurableValue() const { return cfg_ptr; }
00101 void ConfigurableValue(Configurable *_cfg_ptr)
00102 { cfg_ptr = _cfg_ptr; }
00103
00104 static Type ScanComplete;
00105 static Type ScanShutdown;
00106 static Type AppendTextToLog;
00107 static Type SetStatusText;
00108 static Type SetStatusTitleText;
00109 static Type SetPercentComplete;
00110 static Type SetStatusRotorPosition;
00111 static Type SetStatusSignalToNoise;
00112 static Type SetStatusSignalStrength;
00113 static Type SetStatusSignalLock;
00114 static Type SetStatusChannelTuned;
00115
00116 private:
00117 ~ScannerEvent() { }
00118
00119 private:
00120 QString str;
00121 int intvalue;
00122 Configurable *cfg_ptr;
00123 };
00124
00125 void post_event(QObject *dest, QEvent::Type type, int val);
00126 void post_event(QObject *dest, QEvent::Type type, const QString &val);
00127 void post_event(QObject *dest, QEvent::Type type, int val,
00128 Configurable *cfg);
00129
00130 #endif // _SCAN_MONITOR_H_