#ifndef ETNETWORKTEST_H
#define ETNETWORKTEST_H

#include <QWidget>
#include <thread>
#include <mutex>
#include "CHttpBll.h"

namespace Ui {
class etNetworkTest;
}

class etNetworkTest : public QWidget
{
    Q_OBJECT
signals:
	void checkInfo(QString speed, QString sTime);	
public:
    explicit etNetworkTest(QWidget *parent = nullptr);
    ~etNetworkTest();

    int setUI(const int nLeft, const int nTop, const int nWidth);
    int widgetHeight();
    int getCheckStatus();//0:false 1:true 2:未检测
private:
    void threadProc();
    Ui::etNetworkTest *ui;

    std::thread m_thread;
    bool m_bIsRun;

	bool bSpeedPass;
	bool bDelayPass;

    const QString sAudioUrl = "https://ecs-static.qmth.com.cn/check-audio.mp3";
};

#endif // ETNETWORKTEST_H
