aboutsummaryrefslogtreecommitdiff
path: root/src/main_window.cc
diff options
context:
space:
mode:
authorccolin2021-01-04 14:49:26 +0100
committerccolin2021-01-04 14:49:26 +0100
commit0c28d9dc80e634ebfbabed5ad446b6a4f82056e3 (patch)
tree498a6b8ce12305a2d7531396767852a07f564b7d /src/main_window.cc
parent472e291ca823910418919eac101f26e2b3d852a8 (diff)
add speeding violation reporting
Diffstat (limited to 'src/main_window.cc')
-rw-r--r--src/main_window.cc10
1 files changed, 10 insertions, 0 deletions
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);