Added a text to display wifi status.
This commit is contained in:
parent
ca73f70b63
commit
b8201398e1
1 changed files with 267 additions and 18 deletions
|
|
@ -11,6 +11,9 @@
|
|||
#include <QTimer>
|
||||
#include <QThread>
|
||||
#include <chrono>
|
||||
#ifdef Q_OS_ANDROID
|
||||
#include "wifihelper.h"
|
||||
#endif
|
||||
|
||||
class RequestWorker : public QObject
|
||||
{
|
||||
|
|
@ -31,6 +34,10 @@ class RequestWorker : public QObject
|
|||
bool player_started = false;
|
||||
QMediaPlayer *player = nullptr;
|
||||
QAudioOutput *audioOutput = nullptr;
|
||||
#ifdef Q_OS_ANDROID
|
||||
WiFiHelper *wifi = nullptr;
|
||||
QTimer *poll_wifi = nullptr;
|
||||
#endif
|
||||
std::chrono::time_point<std::chrono::high_resolution_clock> prev_time;
|
||||
public:
|
||||
explicit RequestWorker(QObject *parent = nullptr);
|
||||
|
|
@ -42,6 +49,7 @@ signals:
|
|||
void networkReply(int distance, float rate_of_fill, int expected_to_fill);
|
||||
void statusChanged();
|
||||
void playMedia();
|
||||
void connectionText(QString text, bool errored = false);
|
||||
public slots:
|
||||
void startAlarm();
|
||||
void stopAlarm();
|
||||
|
|
@ -49,6 +57,8 @@ public slots:
|
|||
void start();
|
||||
void stop();
|
||||
private slots:
|
||||
void pollWiFi();
|
||||
void gotWiFiSSID(QString ssid);
|
||||
void playAlarm();
|
||||
void makeRequest();
|
||||
void requestFinished(QNetworkReply *rep);
|
||||
|
|
|
|||
Loading…
Reference in a new issue