#ifndef MODEL_SELECT_H
#define MODEL_SELECT_H

#include <QMainWindow>
#include <QTcpServer>
#include <QTcpSocket>
#include <QLabel>
#include <QFile>



namespace Ui {
class model_select;
}
static int send_time=2; // 全局变量，记录发送时间
class model_select : public QMainWindow
{
    Q_OBJECT

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


signals:
    void receive_msg(const QString &data);  // 声明信号
private slots:
    void connectClient(QTcpSocket *clientSocket);
    void receive_Client(QTcpSocket *clientSocket);
    void on_btn_start_clicked();
    void initsetting();


    void openSimulinkModel(const QString &modelName);
    void on_btn_pause_clicked();

    void on_btn_stop_clicked();

    void on_btn_link_clicked();

    void on_btn_gsb_clicked();

    void on_btn_gsf_clicked();

private:
    Ui::model_select *ui;

    QTcpServer* ms;
    QTcpSocket* mtcp;
    QLabel* mstatus;
    QMap<QTcpSocket*, QString> connectedClients;
    int connectNum;
    int pause_flag=1;
    QString sim_time_wt;
    void cbo_select_Init();
    void cbo_select_changed(int index);
    void cbo_wt_changed(int index);
    void file_write(QString *prs_name, QString *msg);
    void file_read();
    void cbo_condition_changed(int index);
    

};

#endif // MODEL_SELECT_H
