#ifndef COMMANDWIDGET_H
#define COMMANDWIDGET_H

#include <QUdpSocket>
#include <QWidget>

#include "communicationsettingdlg.h"

namespace Ui {
class CommandWidget;
}

class CommandWidget : public QWidget {
    Q_OBJECT

public:
    explicit CommandWidget(QWidget *parent = nullptr);
    ~CommandWidget();

    QUdpSocket *udpSocket = nullptr;
signals:
    void startConnectionSignal(QString ip, int port);
    void stopConnectionSignal();
    void sendErrorMessage(QString message, int type);
private slots:
    void on_settingToolBtn_clicked();

    void on_startConnectionToolBtn_clicked();

    void on_stopConnectionToolBtn_clicked();

    void receiveMessageSlots(QString message, int type);

private:
    Ui::CommandWidget *ui;

    CommunicationSettingDlg settingDlg;
    QString m_remoteIP;
    int m_remotePort;
};

#endif  // COMMANDWIDGET_H
