From 0c28d9dc80e634ebfbabed5ad446b6a4f82056e3 Mon Sep 17 00:00:00 2001 From: ccolin Date: Mon, 4 Jan 2021 14:49:26 +0100 Subject: add speeding violation reporting --- src/main_window.cc | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/main_window.cc') diff --git a/src/main_window.cc b/src/main_window.cc index 285294f..39261dd 100644 --- a/src/main_window.cc +++ b/src/main_window.cc @@ -82,17 +82,27 @@ void MainWindow::open(const QString &path) { // Settings pane connect(settings_pane, &SettingsPane::bookmarkClicked, slider, &QSlider::setValue); + connect(dc, &DroneController::collision, settings_pane, &SettingsPane::addCollision); + connect(dc, &DroneController::speedViolation, settings_pane, &SettingsPane::addSpeedingViolation); + connect(settings_pane, &SettingsPane::sphereRadiusChanged, [&](double _) { Q_UNUSED(_); settings_pane->clearCollisions(); }); connect(settings_pane, &SettingsPane::sphereRadiusChanged, dc, &DroneController::computeCollisions); connect(settings_pane, &SettingsPane::sphereRadiusChanged, dc, &DroneController::displaySpheres); + + connect(settings_pane, &SettingsPane::speedLimitChanged, + [&](double _) { Q_UNUSED(_); settings_pane->clearSpeedingViolations(); }); + connect(settings_pane, &SettingsPane::speedLimitChanged, + dc, &DroneController::computeSpeedingViolations); + connect(settings_pane, &SettingsPane::toggledTrajectories, dc, &DroneController::setDrawTrajectories); connect(settings_pane, &SettingsPane::toggledGuides, dc, &DroneController::setDrawGuides); + settings_pane->setEnabled(true); glw.setPainter(dc); -- cgit v1.2.3-70-g09d2