-
Notifications
You must be signed in to change notification settings - Fork 10.4k
feat(replay): migrate onroadevents, cleanup #36609
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
feat(replay): migrate onroadevents, cleanup #36609
Conversation
|
this is kinda messy. i see we only want to run migration on i think it's probably best to have a separate method that always runs the |
|
It might be cleaner and easier to maintain if we use a single mapping table instead of a massive switch statement. Here’s a simplified approach using a small macro to reduce redundancy and improve readability: using OldEventName = cereal::OnroadEventDEPRECATED::EventName;
using NewEventName = cereal::OnroadEvent::EventName;
#define MAP_EVENT_NAME(name) {OldEventName::name, NewEventName::name}
static const std::unordered_map<OldEventName, NewEventName> event_name_map = {
MAP_EVENT_NAME(CAN_ERROR),
MAP_EVENT_NAME(STEER_UNAVAILABLE),
MAP_EVENT_NAME(WRONG_GEAR),
MAP_EVENT_NAME(DOOR_OPEN),
...
}; |
|
cool! let me try this out |
we will use these onroad events in mici UI, and the demo route still uses old deprecated onroadevents
modularized into separate methods since onroad events is a nasty migration