You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
67 lines
1.2 KiB
67 lines
1.2 KiB
3 days ago
|
#ifndef MAINWINDOW_H
|
||
|
#define MAINWINDOW_H
|
||
|
|
||
|
#include <QMainWindow>
|
||
|
#include <QDebug>
|
||
|
#include <Dense>
|
||
|
#include <QTimer>
|
||
|
#include <QJsonObject>
|
||
|
|
||
|
#include "uchart.h"
|
||
|
#include "agent.h"
|
||
|
#include "enviroment.h"
|
||
|
|
||
|
class QLineSeries;
|
||
|
class Agent;
|
||
|
class Enviroment;
|
||
|
|
||
|
QT_BEGIN_NAMESPACE
|
||
|
namespace Ui {
|
||
|
class MainWindow;
|
||
|
}
|
||
|
QT_END_NAMESPACE
|
||
|
|
||
|
class MainWindow : public QMainWindow
|
||
|
{
|
||
|
Q_OBJECT
|
||
|
|
||
|
public:
|
||
|
MainWindow(QWidget *parent = nullptr);
|
||
|
~MainWindow();
|
||
|
void InitEnv();
|
||
|
void InitUI();
|
||
|
void PaintAgent(QLineSeries*, AgentState, double, double);
|
||
|
void PlayByStep(int step);
|
||
|
void DispEnvNow();
|
||
|
|
||
|
public slots:
|
||
|
void UpdateUI();
|
||
|
void UpdateUIDebug();
|
||
|
|
||
|
private slots:
|
||
|
void on_start_botton_clicked();
|
||
|
|
||
|
void on_calculate_pushButton_clicked();
|
||
|
|
||
|
void on_next_botton_clicked();
|
||
|
|
||
|
void on_back_botton_clicked();
|
||
|
|
||
|
void on_save_pushButton_clicked();
|
||
|
|
||
|
void on_debug_checkBox_checkStateChanged(const Qt::CheckState &arg1);
|
||
|
|
||
|
void on_reset_pushButton_clicked();
|
||
|
|
||
|
private:
|
||
|
Ui::MainWindow *ui;
|
||
|
std::vector<Agent*> multi_agent;
|
||
|
UChart *chart;
|
||
|
QJsonObject *data;
|
||
|
Enviroment *env;
|
||
|
QTimer *timer = new QTimer(this);
|
||
|
int step_now;
|
||
|
bool play_flag;
|
||
|
};
|
||
|
#endif // MAINWINDOW_H
|