28#if QT_VERSION >= QT_VERSION_CHECK(6,0,0)
29#include <QtSystemDetection>
31#include <QCoreApplication>
37#include "libmythbase/mythconfig.h"
48#define LOC QString("ChScanWeb: ")
70 const QString &ScanType,
73 const QString &FirstChan,
74 const QString &LastChan,
79 const QString &frequency,
80 const QString &bandwidth,
81 const QString &polarity,
82 const QString &symbolrate,
83 const QString &inversion,
84 const QString &constellation,
85 const QString &modsys,
86 const QString &coderate_lp,
87 const QString &coderate_hp,
89 const QString &trans_mode,
90 const QString &guard_interval,
91 const QString &hierarchy,
92 const QString &rolloff)
110 if (ScanType ==
"FULL")
141 else if (ScanType ==
"FULLTUNED")
169 else if (ScanType ==
"VBOXIMPORT")
173 else if (ScanType ==
"HDHRIMPORT")
177 else if (ScanType ==
"MPTSIMPORT")
181 else if (ScanType ==
"M3UIMPORT")
185 else if (ScanType ==
"ASI" || ScanType ==
"MPTS")
189 else if (ScanType ==
"EXTIMPORT")
193 else if (ScanType ==
"IMPORT")
197 else if (ScanType ==
"ALLTRANSPORT")
201 else if (ScanType ==
"ONETRANSPORT")
206 if (nScanType == -99)
208 m_dlgMsg = QObject::tr(
"This scan type is not supported");
251 modulation =
"analog";
258 QMap<QString,QString> startChan;
261 startChan[
"std"] =
"dvb";
262 startChan[
"type"] =
"OFDM";
263 startChan[
"frequency"] = frequency;
264 startChan[
"inversion"] = inversion;
265 startChan[
"bandwidth"] = bandwidth;
266 startChan[
"coderate_hp"] = coderate_hp;
267 startChan[
"coderate_lp"] = coderate_lp;
268 startChan[
"constellation"] = constellation;
269 startChan[
"trans_mode"] = trans_mode;
270 startChan[
"guard_interval"] = guard_interval;
271 startChan[
"hierarchy"] = hierarchy;
275 startChan[
"std"] =
"dvb";
276 startChan[
"type"] =
"DVB_T2";
277 startChan[
"frequency"] = frequency;
278 startChan[
"inversion"] = inversion;
279 startChan[
"bandwidth"] = bandwidth;
280 startChan[
"coderate_hp"] = coderate_hp;
281 startChan[
"coderate_lp"] = coderate_lp;
282 startChan[
"constellation"] = constellation;
283 startChan[
"trans_mode"] = trans_mode;
284 startChan[
"guard_interval"] = guard_interval;
285 startChan[
"hierarchy"] = hierarchy;
286 startChan[
"mod_sys"] = modsys;
290 startChan[
"std"] =
"dvb";
291 startChan[
"type"] =
"QPSK";
292 startChan[
"modulation"] =
"qpsk";
293 startChan[
"frequency"] = frequency;
294 startChan[
"inversion"] = inversion;
295 startChan[
"symbolrate"] = symbolrate;
296 startChan[
"fec"] = fec;
297 startChan[
"polarity"] = polarity;
301 startChan[
"std"] =
"dvb";
302 startChan[
"type"] =
"QAM";
303 startChan[
"frequency"] = frequency;
304 startChan[
"symbolrate"] = symbolrate;
305 startChan[
"modulation"] = modulation;
306 startChan[
"mod_sys"] = modsys;
307 startChan[
"inversion"] = inversion;
308 startChan[
"fec"] = fec;
312 startChan[
"std"] =
"dvb";
313 startChan[
"type"] =
"DVB_S2";
314 startChan[
"frequency"] = frequency;
315 startChan[
"inversion"] = inversion;
316 startChan[
"symbolrate"] = symbolrate;
317 startChan[
"fec"] = fec;
318 startChan[
"modulation"] = modulation;
319 startChan[
"polarity"] = polarity;
320 startChan[
"mod_sys"] = modsys;
321 startChan[
"rolloff"] = rolloff;
327 int sourceid =
get_on_input(
"sourceid", cardid).toUInt();
344 ImportM3U(cardid, inputname, sourceid,
false);
350 service_requirements);
355 service_requirements);
363 ImportM3U(cardid, inputname, sourceid,
true);
381 service_requirements,
464 auto type = scanEvent->type();
485 QString msg = tr(
"Found %1 Transports").arg(
m_transports.size());
491 success |= (m_vboxScanner !=
nullptr);
494 success |= (m_externRecScanner !=
nullptr);
497 success |= (m_hdhrScanner !=
nullptr);
557 msg = QString(
"%1% S/N %2 %3 : %4 (%5) %6")
568 static QString s_oldMsg;
571 LOG(VB_CHANSCAN, LOG_INFO,
LOC + msg);
577 if (msg.length() > 80)
578 msg = msg.left(77) +
"...";
579 std::cout <<
"\r" << msg.toLatin1().constData() <<
"\r";
580 std::cout << std::flush;
608 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.