added cyclic update

This commit is contained in:
2018-11-17 22:29:57 +01:00
parent a347c3d965
commit 4c473f5d07
3 changed files with 23 additions and 17 deletions

View File

@@ -16,11 +16,13 @@ class MainWindow : public QMainWindow
Q_OBJECT
public:
explicit MainWindow(QWidget *parent = 0);
explicit MainWindow(QWidget *parent = nullptr);
~MainWindow();
void setPowerState();
void updateAVState();
private slots:
void on_btn_onoff_clicked();
void replyFinished(QNetworkReply *reply);
@@ -38,11 +40,14 @@ private:
Ui::MainWindow *ui;
QString mAddress;
QTimer mTimer;
QTimer mTimerValCollect;
QTimer mTimerUpdate;
bool mPowered = false;
int mVolume = 0;
QString mInput;
const int WAITTIME = 400;
const int COLLECTTIME = 400;
const int UPDATETIME = 20000;
void sendCommand(QString cmd);
void updateUi();