27#include <QCoreApplication>
33#include "libmythbase/mythconfig.h"
44#define LOC QString("ChScanWeb: ")
66 const QString &ScanType,
69 const QString &FirstChan,
70 const QString &LastChan,
75 const QString &frequency,
76 const QString &bandwidth,
77 const QString &polarity,
78 const QString &symbolrate,
79 const QString &inversion,
80 const QString &constellation,
81 const QString &modsys,
82 const QString &coderate_lp,
83 const QString &coderate_hp,
85 const QString &trans_mode,
86 const QString &guard_interval,
87 const QString &hierarchy,
88 const QString &rolloff)
106 if (ScanType ==
"FULL")
137 else if (ScanType ==
"FULLTUNED")
165 else if (ScanType ==
"VBOXIMPORT")
169 else if (ScanType ==
"HDHRIMPORT")
173 else if (ScanType ==
"MPTSIMPORT")
177 else if (ScanType ==
"M3UIMPORT")
181 else if (ScanType ==
"ASI" || ScanType ==
"MPTS")
185 else if (ScanType ==
"EXTIMPORT")
189 else if (ScanType ==
"IMPORT")
193 else if (ScanType ==
"ALLTRANSPORT")
197 else if (ScanType ==
"ONETRANSPORT")
202 if (nScanType == -99)
204 m_dlgMsg = QObject::tr(
"This scan type is not supported");
247 modulation =
"analog";
254 QMap<QString,QString> startChan;
257 startChan[
"std"] =
"dvb";
258 startChan[
"type"] =
"OFDM";
259 startChan[
"frequency"] = frequency;
260 startChan[
"inversion"] = inversion;
261 startChan[
"bandwidth"] = bandwidth;
262 startChan[
"coderate_hp"] = coderate_hp;
263 startChan[
"coderate_lp"] = coderate_lp;
264 startChan[
"constellation"] = constellation;
265 startChan[
"trans_mode"] = trans_mode;
266 startChan[
"guard_interval"] = guard_interval;
267 startChan[
"hierarchy"] = hierarchy;
271 startChan[
"std"] =
"dvb";
272 startChan[
"type"] =
"DVB_T2";
273 startChan[
"frequency"] = frequency;
274 startChan[
"inversion"] = inversion;
275 startChan[
"bandwidth"] = bandwidth;
276 startChan[
"coderate_hp"] = coderate_hp;
277 startChan[
"coderate_lp"] = coderate_lp;
278 startChan[
"constellation"] = constellation;
279 startChan[
"trans_mode"] = trans_mode;
280 startChan[
"guard_interval"] = guard_interval;
281 startChan[
"hierarchy"] = hierarchy;
282 startChan[
"mod_sys"] = modsys;
286 startChan[
"std"] =
"dvb";
287 startChan[
"type"] =
"QPSK";
288 startChan[
"modulation"] =
"qpsk";
289 startChan[
"frequency"] = frequency;
290 startChan[
"inversion"] = inversion;
291 startChan[
"symbolrate"] = symbolrate;
292 startChan[
"fec"] = fec;
293 startChan[
"polarity"] = polarity;
297 startChan[
"std"] =
"dvb";
298 startChan[
"type"] =
"QAM";
299 startChan[
"frequency"] = frequency;
300 startChan[
"symbolrate"] = symbolrate;
301 startChan[
"modulation"] = modulation;
302 startChan[
"mod_sys"] = modsys;
303 startChan[
"inversion"] = inversion;
304 startChan[
"fec"] = fec;
308 startChan[
"std"] =
"dvb";
309 startChan[
"type"] =
"DVB_S2";
310 startChan[
"frequency"] = frequency;
311 startChan[
"inversion"] = inversion;
312 startChan[
"symbolrate"] = symbolrate;
313 startChan[
"fec"] = fec;
314 startChan[
"modulation"] = modulation;
315 startChan[
"polarity"] = polarity;
316 startChan[
"mod_sys"] = modsys;
317 startChan[
"rolloff"] = rolloff;
323 int sourceid =
get_on_input(
"sourceid", cardid).toUInt();
340 ImportM3U(cardid, inputname, sourceid,
false);
346 service_requirements);
351 service_requirements);
359 ImportM3U(cardid, inputname, sourceid,
true);
377 service_requirements,
460 auto type = scanEvent->type();
481 QString msg = tr(
"Found %1 Transports").arg(
m_transports.size());
487 success |= (m_vboxScanner !=
nullptr);
490 success |= (m_externRecScanner !=
nullptr);
493 success |= (m_hdhrScanner !=
nullptr);
553 msg = QString(
"%1% S/N %2 %3 : %4 (%5) %6")
564 static QString s_oldMsg;
567 LOG(VB_CHANSCAN, LOG_INFO,
LOC + msg);
573 if (msg.length() > 80)
574 msg = msg.left(77) +
"...";
575 std::cout <<
"\r" << msg.toLatin1().constData() <<
"\r";
576 std::cout << std::flush;
604 bool lock,
bool strength,
bool snr,
bool rotorpos)
static GlobalComboBoxSetting * FreqTable()
QString get_on_input(const QString &to_get, uint inputid)
static INPUT_TYPES toInputType(const QString &name)
static bool HDHRdoesDVB(const QString &device)
If the device is valid, check if the model does DVB.
INPUT_TYPES
all the different inputs
static QString GetVideoDevice(uint inputid)
static bool HDHRdoesDVBC(const QString &device)
If the device is valid, check if the model does DVB-C.
static QString ProbeSubTypeName(uint inputid)
void Process(const ScanDTVTransportList &_transports, int sourceid=-1)
chan_info_map_t GetChannelList(transport_scan_items_it_t trans_info, ScannedChannelInfo *scan_info) const
void StopScanner(void)
Stops the ChannelScanSM event loop and the signal monitor, blocking until both exit.
void MonitorProgress(bool lock, bool strength, bool snr, bool rotor) override
void Process(const ScanDTVTransportList &_transports, bool success=false)
int m_statusSignalStrength
static ChannelScannerWeb * s_Instance
void setupScan(int CardId)
MThread * m_monitorThread
QString m_statusTitleText
void HandleEvent(const ScannerEvent *scanEvent) override
ScanDTVTransportList m_transports
int m_statusRotorPosition
bool StartScan(uint CardId, const QString &DesiredServices, bool FreeToAirOnly, bool ChannelNumbersOnly, bool CompleteChannelsOnly, bool FullChannelSearch, bool RemoveDuplicates, bool AddFullTS, bool TestDecryptable, const QString &ScanType, const QString &FreqTable, QString Modulation, const QString &FirstChan, const QString &LastChan, uint ScanId, bool IgnoreSignalTimeout, bool FollowNITSetting, uint MplexId, const QString &Frequency, const QString &Bandwidth, const QString &Polarity, const QString &SymbolRate, const QString &Inversion, const QString &Constellation, const QString &ModSys, const QString &CodeRate_LP, const QString &CodeRate_HP, const QString &FEC, const QString &Trans_Mode, const QString &Guard_Interval, const QString &Hierarchy, const QString &RollOff)
void InformUser(const QString &error) override
void log(const QString &msg)
static ChannelScannerWeb * getInstance()
ChannelScannerWeb(void)=default
bool m_showSignalStrength
bool m_completeOnly
Only complete channels desired post scan?
IPTVChannelFetcher * m_iptvScanner
ChannelScanSM * m_sigmonScanner
virtual bool ImportHDHR(uint cardid, const QString &inputname, uint sourceid, ServiceRequirements serviceType)
virtual void Teardown(void)
virtual bool ImportM3U(uint cardid, const QString &inputname, uint sourceid, bool is_mpts)
bool m_fullSearch
Extended search for old channels post scan?
bool m_channelNumbersOnly
Only channels with logical channel numbers desired post scan?
bool m_freeToAirOnly
Only fta channels desired post scan?
bool m_removeDuplicates
Remove duplicate transports and channels?
virtual bool ImportVBox(uint cardid, const QString &inputname, uint sourceid, bool ftaOnly, ServiceRequirements serviceType)
ScanMonitor * m_scanMonitor
bool m_addFullTS
Add MPTS "full transport stream" channels.
ServiceRequirements m_serviceRequirements
Services desired post scan.
virtual bool ImportExternRecorder(uint cardid, const QString &inputname, uint sourceid)
void Scan(int scantype, uint cardid, const QString &inputname, uint sourceid, bool do_ignore_signal_timeout, bool do_follow_nit, bool do_test_decryption, bool do_fta_only, bool do_lcn_only, bool do_complete_only, bool do_full_channel_search, bool do_remove_duplicates, bool do_add_full_ts, ServiceRequirements service_requirements, uint mplexid, const QMap< QString, QString > &startChan, const QString &freq_std, const QString &mod, const QString &tbl, const QString &tbl_start=QString(), const QString &tbl_end=QString())
This is a wrapper around QThread that does several additional things.
void start(QThread::Priority p=QThread::InheritPriority)
Tell MThread to start running the thread in the near future.
bool wait(std::chrono::milliseconds time=std::chrono::milliseconds::max())
Wait for the MThread to exit, with a maximum timeout.
void exit(int retcode=0)
Use this to exit from the thread if you are using a Qt event loop.
QThread * qthread(void)
Returns the thread, this will always return the same pointer no matter how often you restart the thre...
static CardUtil::INPUT_TYPES toDVBInputType(const QString &deviceid)
virtual void deleteLater(void)
@ CurrentTransportScan
Scans the transport when there is no tuner (for ASI)
static const Type kSetStatusSignalLock
static const Type kScanShutdown
static const Type kSetStatusTitleText
static const Type kSetStatusSignalToNoise
static const Type kSetStatusText
static const Type kAppendTextToLog
static const Type kSetStatusRotorPosition
static const Type kScanComplete
static const Type kSetPercentComplete
static const Type kSetStatusSignalStrength
static const Type kScanErrored
std::vector< ScanDTVTransport > ScanDTVTransportList
static bool VERBOSE_LEVEL_CHECK(uint64_t mask, LogLevel_t level)
static bool VERBOSE_LEVEL_NONE()
#define LOG(_MASK_, _LEVEL_, _QSTRING_)
ScanDTVTransportList LoadScan(uint scanid)
void post_event(QObject *dest, QEvent::Type type, int val)
Percentage to set to after the first tune.