Skip to content

Commit

Permalink
fix(seeder-example): make sure the speed updates are not preemptively…
Browse files Browse the repository at this point in the history
… filtered out

This fixes a bug where the speed doesn't get updated when re-entering the main screen and speed isn't changing
  • Loading branch information
GwnDaan committed Mar 15, 2024
1 parent 6edc33d commit 89bdf32
Showing 1 changed file with 6 additions and 15 deletions.
21 changes: 6 additions & 15 deletions examples/seeder_example/vt_application.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -278,28 +278,19 @@ void SeederVtApplication::handle_numeric_value_events(const isobus::VirtualTermi
}
}

void SeederVtApplication::handle_machine_selected_speed(const std::shared_ptr<isobus::SpeedMessagesInterface::MachineSelectedSpeedData> mssData, bool changed)
void SeederVtApplication::handle_machine_selected_speed(const std::shared_ptr<isobus::SpeedMessagesInterface::MachineSelectedSpeedData> mssData, bool)
{
if (changed)
{
process_new_speed(SpeedSources::MachineSelected, mssData->get_machine_speed());
}
process_new_speed(SpeedSources::MachineSelected, mssData->get_machine_speed());
}

void SeederVtApplication::handle_ground_based_speed(const std::shared_ptr<isobus::SpeedMessagesInterface::GroundBasedSpeedData> gbsData, bool changed)
void SeederVtApplication::handle_ground_based_speed(const std::shared_ptr<isobus::SpeedMessagesInterface::GroundBasedSpeedData> gbsData, bool)
{
if (changed)
{
process_new_speed(SpeedSources::GroundBased, gbsData->get_machine_speed());
}
process_new_speed(SpeedSources::GroundBased, gbsData->get_machine_speed());
}

void SeederVtApplication::handle_wheel_based_speed(const std::shared_ptr<isobus::SpeedMessagesInterface::WheelBasedMachineSpeedData> wbsData, bool changed)
void SeederVtApplication::handle_wheel_based_speed(const std::shared_ptr<isobus::SpeedMessagesInterface::WheelBasedMachineSpeedData> wbsData, bool)
{
if (changed)
{
process_new_speed(SpeedSources::WheelBased, wbsData->get_machine_speed());
}
process_new_speed(SpeedSources::WheelBased, wbsData->get_machine_speed());
}

void SeederVtApplication::process_new_speed(SpeedSources source, std::uint32_t speed)
Expand Down

0 comments on commit 89bdf32

Please sign in to comment.