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/settings_pane.cc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/settings_pane.cc') diff --git a/src/settings_pane.cc b/src/settings_pane.cc index 7d3b10f..e580d37 100644 --- a/src/settings_pane.cc +++ b/src/settings_pane.cc @@ -12,6 +12,8 @@ SettingsPane::SettingsPane(QWidget *parent) :QWidget(parent) { QDoubleSpinBox *sphere_radius = new QDoubleSpinBox(); sphere_radius->setSingleStep(.1); + QDoubleSpinBox *speed_limit = new QDoubleSpinBox(); + speed_limit->setSingleStep(.1); QCheckBox *show_trajectories = new QCheckBox(); QCheckBox *show_guides = new QCheckBox(); collisions = new QListWidget(); @@ -19,6 +21,8 @@ SettingsPane::SettingsPane(QWidget *parent) connect(sphere_radius, QOverload::of(&QDoubleSpinBox::valueChanged), this, &SettingsPane::sphereRadiusChanged); + connect(speed_limit, QOverload::of(&QDoubleSpinBox::valueChanged), + this, &SettingsPane::speedLimitChanged); connect(show_trajectories, &QCheckBox::stateChanged, this, &SettingsPane::toggledTrajectories); connect(show_guides, &QCheckBox::stateChanged, @@ -32,6 +36,7 @@ SettingsPane::SettingsPane(QWidget *parent) QFormLayout *layout = new QFormLayout; layout->addRow("Taille de la sphère de collision", sphere_radius); + layout->addRow("Limite de vitesse", speed_limit); layout->addRow("Afficher les trajectoires", show_trajectories); layout->addRow("Afficher les guides", show_guides); @@ -52,7 +57,7 @@ void SettingsPane::addCollision(int idA, int idB, int frame) { } -void SettingsPane::addSpeedingViolation(int id, int frame, double speed) { +void SettingsPane::addSpeedingViolation(int id, double speed, int frame) { BookmarkItem *item = new BookmarkItem("Frame " + QString::number(frame) + ": #" + QString::number(id) + " (" + QString::number(speed) + ")", frame); -- cgit v1.2.3-70-g09d2