Skip to content

Commit

Permalink
Disable QT5 GUI
Browse files Browse the repository at this point in the history
  • Loading branch information
emielsteerneman committed Aug 6, 2023
1 parent e1581db commit 12442c5
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 13 deletions.
4 changes: 2 additions & 2 deletions roboteam_ai/src/STPManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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<rtt::ai::io::InterfaceGateway> interfaceGateway, ai::interface::MainWindow *mainWindow): interfaceGateway(std::move(interfaceGateway)) { this->mainWindow = mainWindow; }
Expand Down
24 changes: 13 additions & 11 deletions roboteam_ai/src/roboteam_ai.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -91,23 +91,25 @@ int main(int argc, char** argv) {
RTT_DEBUG("Initialize Interface Server");
auto interfaceGateway = std::make_shared<rtt::ai::io::InterfaceGateway>(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;
}

0 comments on commit 12442c5

Please sign in to comment.