mirror of
https://github.com/modelec/ihm.git
synced 2026-01-19 00:57:27 +01:00
82 lines
1.6 KiB
C++
82 lines
1.6 KiB
C++
#pragma once
|
|
|
|
#include <QMainWindow>
|
|
#include <QWidget>
|
|
#include <QStackedWidget>
|
|
#include <QPixmap>
|
|
|
|
#include "HomePage.h"
|
|
#include "Homologation.h"
|
|
#include "InGame.h"
|
|
#include "PreparationMatch.h"
|
|
#include "TeamChooser.h"
|
|
#include "TestMode.h"
|
|
#include "WaintingForTirette.h"
|
|
#include "tcp/MyTCPClient.h"
|
|
|
|
enum class DisplayMode
|
|
{
|
|
FULLSCREEN,
|
|
WINDOWED
|
|
};
|
|
|
|
class MainWindow : public QMainWindow {
|
|
Q_OBJECT
|
|
public:
|
|
explicit MainWindow(const char* address = "127.0.0.1", int port = 8080, QWidget* parent = nullptr);
|
|
|
|
void setWidgetNb(int index);
|
|
|
|
void setDisplayMode(DisplayMode mode);
|
|
|
|
void turnOnTheWindow();
|
|
|
|
protected slots:
|
|
void onHomePressed();
|
|
|
|
void onHomologationPressed();
|
|
|
|
void onTeamChooserPressed();
|
|
|
|
void onTestModePressed();
|
|
|
|
void onSpawnPointChoose(int nb);
|
|
|
|
void onWaitingForTirette();
|
|
|
|
void onStartGame();
|
|
|
|
void onDeplierRobot();
|
|
|
|
void onReplierRobot();
|
|
|
|
void handleMessage(const std::string& message);
|
|
|
|
|
|
signals:
|
|
void deplierRobot();
|
|
void replierRobot();
|
|
void moveRobot(int x, int y, int theta);
|
|
|
|
private:
|
|
QVBoxLayout* mainLayout;
|
|
QHBoxLayout* topLayout;
|
|
QPushButton* homeBtn;
|
|
QWidget* centralWidget;
|
|
QStackedWidget* stackedWidget;
|
|
QPushButton* quit;
|
|
|
|
HomePage* home;
|
|
Homologation* homologation;
|
|
TeamChooser* teamChooser;
|
|
PreparationMatch* preparationMatch;
|
|
TestMode* testMode;
|
|
WaintingForTirette* waintingForTirette;
|
|
InGame* inGame;
|
|
|
|
bool waitingForTiretteValue = false;
|
|
DisplayMode displayMode = DisplayMode::WINDOWED;
|
|
|
|
MyTCPClient* tcpClient;
|
|
};
|