diff options
Diffstat (limited to 'src/main_window.cc')
-rw-r--r-- | src/main_window.cc | 10 |
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); |