From 12442c57fd00b59ce0512a0a2dced15d714ae3e6 Mon Sep 17 00:00:00 2001 From: Emiel Steerneman Date: Sun, 6 Aug 2023 16:53:00 +0200 Subject: [PATCH] Disable QT5 GUI --- roboteam_ai/src/STPManager.cpp | 4 ++-- roboteam_ai/src/roboteam_ai.cpp | 24 +++++++++++++----------- 2 files changed, 15 insertions(+), 13 deletions(-) diff --git a/roboteam_ai/src/STPManager.cpp b/roboteam_ai/src/STPManager.cpp index 8b165eca9..199f99675 100644 --- a/roboteam_ai/src/STPManager.cpp +++ b/roboteam_ai/src/STPManager.cpp @@ -157,7 +157,7 @@ void STPManager::runOneLoopCycle() { roboteam_utils::rotate(&packet); } } - mainWindow->updateProcessedVisionPackets(vision_packets); + // mainWindow->updateProcessedVisionPackets(vision_packets); auto const &[_, world] = world::World::instance(); world->updateWorld(worldMessage); @@ -220,7 +220,7 @@ void STPManager::decidePlay(world::World *_world, bool ignoreWorldAge) { currentPlay->updateField(_world->getField().value()); } currentPlay->update(); - mainWindow->updatePlay(currentPlay); + // mainWindow->updatePlay(currentPlay); } STPManager::STPManager(std::shared_ptr interfaceGateway, ai::interface::MainWindow *mainWindow): interfaceGateway(std::move(interfaceGateway)) { this->mainWindow = mainWindow; } diff --git a/roboteam_ai/src/roboteam_ai.cpp b/roboteam_ai/src/roboteam_ai.cpp index e80665fb3..7132693a1 100644 --- a/roboteam_ai/src/roboteam_ai.cpp +++ b/roboteam_ai/src/roboteam_ai.cpp @@ -91,23 +91,25 @@ int main(int argc, char** argv) { RTT_DEBUG("Initialize Interface Server"); auto interfaceGateway = std::make_shared(rtt::GameSettings::isPrimaryAI() ? 12676 : 12677); /// Shared-prt because the variable is shared accross threads - QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling); - // initialize the interface - QApplication application(argc, argv); - setDarkTheme(); - - // Todo make this a not-global-static thingy - window = new ui::MainWindow{}; - window->setWindowState(Qt::WindowMaximized); + // QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling); + // QApplication application(argc, argv); + // setDarkTheme(); + // window = new ui::MainWindow{}; + // window->setWindowState(Qt::WindowMaximized); //Create a flag which signals to the STP thread to stop if the interface is stopped std::atomic_bool exitApplication = false; std::thread stpThread(runStp, interfaceGateway, std::ref(exitApplication)); - window->show(); - bool runQT = application.exec(); + while(true){ + std::this_thread::sleep_for(std::chrono::milliseconds(200)); + } + + // window->show(); + // bool runQT = application.exec(); + exitApplication = true; stpThread.join(); - return runQT; + return false; }