From fe39d81aa79a58e5f4349eda881c51d375cc827b Mon Sep 17 00:00:00 2001 From: minsoo Date: Tue, 22 Sep 2026 17:38:31 -0500 Subject: [PATCH 1/6] compound event manager content from ramtares_main --- .../compound_events/docs/compound_events.odt | 4 +- .../compound_events/docs/compound_events.pdf | Bin 131 -> 131 bytes .../include/compound_event_manager.hh | 14 ++- .../compound_events/include/event_trigger.hh | 96 +++++++++--------- .../include/event_trigger_set.hh | 1 + .../compound_events/src/compound_event.cc | 16 ++- .../src/compound_event_manager.cc | 8 +- .../compound_events/src/event_trigger.cc | 27 +++++ .../compound_events/src/event_trigger_set.cc | 18 ++++ .../include/verif_events_manager.hh | 6 +- .../include/verif_events_manager.hh | 6 +- .../include/verif_events_manager.hh | 7 +- 12 files changed, 144 insertions(+), 59 deletions(-) diff --git a/models/vehicle_management/compound_events/docs/compound_events.odt b/models/vehicle_management/compound_events/docs/compound_events.odt index 329da3f1..6c9e9a76 100644 --- a/models/vehicle_management/compound_events/docs/compound_events.odt +++ b/models/vehicle_management/compound_events/docs/compound_events.odt @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:e883bc7344bfc7b087dfe2f8e2d2a0191ee98ad190ff7c02e4ce1339d41b8580 -size 50087 +oid sha256:031d3941280b88cbfc01a3486b838a93c441023cdc84fcb7fe1088c729d36df7 +size 56832 diff --git a/models/vehicle_management/compound_events/docs/compound_events.pdf b/models/vehicle_management/compound_events/docs/compound_events.pdf index 117e85a11bed979b55c27d1365b81cb71e9a8350..1e24aedfd9281ead7d8d2ba04aa9854ba94a58bf 100644 GIT binary patch delta 84 zcmV~$xePq2@&qkmXKF erprV_tGi(aHL$Qypk%W$xX<+5Z=6k-NYf7r%NKG0 delta 84 zcmV~$u@QhE3%H6?>viEGNd2LtQHFZ diff --git a/models/vehicle_management/compound_events/include/compound_event_manager.hh b/models/vehicle_management/compound_events/include/compound_event_manager.hh index 0536814a..adca1dd2 100644 --- a/models/vehicle_management/compound_events/include/compound_event_manager.hh +++ b/models/vehicle_management/compound_events/include/compound_event_manager.hh @@ -34,7 +34,15 @@ class CompoundEventsManager : public VehicleEventsManager CompoundEventsManager is responsible for the memory-management cleanup / destruction of these event / watch-value instances.*/ std::list managed_triggers; /* (--) - List of all triggers being used, used to unlock triggers.*/ + List of all triggers being managed by the manager. This list is used for: + - at the start of each cycle all of these triggers are unlocked; when a + trigger on this list trigger is updated, it gets locked so that it only + gets evaluated once per cycle; this is useful if a trigger is used in + multiple events, and especially so for multi-shot triggers monitoring + for something like a variable reaching a maximum value. + - when looking for a trigger by name, it is this list that gets searched. + Events are updated from their event(s). They do not need to be included in + this list, especially if a trigger is used in only one event.*/ std::list allocated_triggers; /* (--) Set of triggers allocated for use by any trigger-set.*/ EventTriggerSet allocated_triggers_; /* (--) @@ -228,5 +236,9 @@ class CompoundEventsManager : public VehicleEventsManager return reinterpret_cast(var_name_ref->address); } + + // Copy-constructor and operator= not implemented / deleted + CompoundEventsManager( const CompoundEventsManager&) = delete; + CompoundEventsManager& operator=( const CompoundEventsManager&) = delete; }; #endif diff --git a/models/vehicle_management/compound_events/include/event_trigger.hh b/models/vehicle_management/compound_events/include/event_trigger.hh index 37ed5d13..4e7a1681 100644 --- a/models/vehicle_management/compound_events/include/event_trigger.hh +++ b/models/vehicle_management/compound_events/include/event_trigger.hh @@ -68,7 +68,7 @@ struct EventTriggerBase MIN_CONDITIONAL_FIRST, ABS_MAX_CONDITIONAL_FIRST, ABS_MIN_CONDITIONAL_FIRST, - + // options with managed values of reference: MAX_LAST, // triggers when variable reaches a pt >= reference (LAST occurance) // and resets reference to this value. @@ -133,14 +133,12 @@ struct EventTriggerBase The value obtained when the template reference value (or template reference pointer) is cast to type double. This defines the threshold for logical comparisons made in this class.*/ - bool locked{false}; /* (--) - Boolean used to lock at each cycle, so each WatchValuesBase cannot be - tested more than once per cycle, leading to unintended behavior.*/ public: EventTriggerBase() = default; void apply_function_modifier(); bool has_conditional_reference() const; + bool has_managed_value(); void set_new_reference(); }; @@ -153,17 +151,13 @@ class EventTrigger : public WatchValuesDelay, public EventTriggerBase { bool relative_to_activation_ET{false}; /* (--) - This is a bit kludgy. relative_to_activation is inherited from - WatchValuesDelay (from WatchValuesBase) and is a public flag; - for an EventTrigger, this needs to be locked down at activation. - relative_to_activation_protected is also inherited from WatchValuesDelay - and is set at activation. - But this protected variable is used in WatchValuesBase::test_crossing() - to reset "reference" based on the current value of variable. - We need to reset "reference" based on the current value of "variable" - after the modifier function has been applied. - So we cannot use relative_to_activation_protected and need a - new variable, similar in intent, specifically for EventTrigger.*/ + This is a protected form of relative_to_activation. used to support + applying the function-modified value of the monitored variable as + recorded at trigger-activation. It works similarly to the inherited + relative_to_activation_protected, but for applying the function-modified + value instead of the raw-value.bit kludgy. + See documentation section "Pre-comparison Function Application" for more + comprehensive discussion.*/ public: explicit EventTrigger( const double & delay_ref, @@ -197,43 +191,52 @@ Purpose: WatchValues implementations. Notes: - Going all the way back to WatchValuesBaseCore, the method test_crossing() - is the method-template entry-point for determining whether the event - should be triggered. For data types double, float, and any others with - the "use_threshold_crossing_trigger" flag set, the call to test_crossing - eventually transfers to test_crossing_dbl(double), which evaluates - whether the value is on the "triggered" side of the threshold, and sets - the event_triggered flag in response. + is the method-template entry-point for determining whether the event + should be triggered. +- For data types double, float, and any others with the + "use_threshold_crossing_trigger" flag set, the call to test_crossing + eventually transfers to test_crossing_dbl(double), which evaluates + whether the value is on the "triggered" side of the threshold, and sets + the event_triggered flag in response. - In WatchValuesDelay, the test_crossing() method is expanded to wrap - the delay mechanism around the core WatchValuesBaseCore::test_crossing_dbl - functionality. -- In this model, we utilize the wrapped-up capabilities provided by - WatchValuesDelay::test_crossing and overwrite the basic - threshold-crossing evaluations in WatchValuesBaseCore::test_crossing_dbl - to include the new requirements encapsulated in the enumerations - TriggerCondition, FunctionModifier, and DirectionLimit. -- The reference (threshold) value can be: - - Fixed: pre-defined to a specific value - - Fixed: computed at trigger-activations to be a pre-defined offset from - the value of the monitored variable at trigger-activation. - - Variable: using a pointer to access the reference-variable. - - Variable: using that pointer to access the extent to which the - reference (threshold) value should be offset from the recorded baseline - value of the monitored variable at trigger-activation. - Case 1, and 2 use the class member value reference_dbl. - Case 3 uses the passed argument ref_val. - Case 4 uses ref_val + the value stored at activation, which is a - post-modified value unknown to WatchValuesBase so cannot be incorporated - in WatchValuesBase prior to entry into this method. + the delay mechanism around the core WatchValuesBaseCore::test_crossing + functionality. +- In this model (which inherits the WatchValuesDelay functionality), we utilize + the wrapped-up capabilities provided by WatchValuesDelay and overwrite the + basic threshold-crossing evaluations (as previously implemented in + WatchValuesBaseCore::test_crossing_dbl) to include the new requirements + encapsulated in the enumerations + - TriggerCondition, + - FunctionModifier, and + - DirectionLimit. +- The 2nd argument (ref_val) is passed into here from WatchValuesBase. + This represents the trigger threshold and can be: + 1. Fixed: pre-defined to a specific value + 2. Fixed: computed at trigger-activations from the value of the + monitored variable at trigger-activation; allows the application + of the same function_modifier to the monitored variable at model + activation and now. + 3. Variable: equal to the value of another sim variable at the current time. + 4. Variable: equal to the sum of the value of another sim variable and the + value of the monitored variable at trigger-activation, after + applying the function-modifier. + Case 1, and 2 use the class member value reference_dbl. + Case 3 uses the passed argument ref_val. + Case 4 uses ref_val + the value stored at trigger-activation ******************************************************************************/ void test_crossing_dbl( double var_val, double ref_val) override { if (this->reference_is_variable) { if (relative_to_activation_ET) { + // Case 4 above in notes: reference_dbl = ref_val + variable_dbl_activation; } else { + // Case 3 above in notes reference_dbl = ref_val; } + // else: + // Cases 1 and 2 above in notes, reference_dbl is already known. } variable_dbl = var_val; @@ -255,7 +258,7 @@ Notes: case EQ: // FIXME the use of is_near_equal() in this and other cases in this method, // with the default ulp of 0.5, tests for actual equality to the precision of - // the representation. + // the representation. this->event_triggered = MathUtils::is_near_equal(variable_dbl, reference_dbl); break; case NE: @@ -485,17 +488,17 @@ Notes: (comparison_logic == ABS_MIN_LAST)) { reference_dbl = std::abs(variable_dbl); } - else if ((comparison_logic == MAX_CONDITIONAL_FIRST) || + else if ((comparison_logic == MAX_CONDITIONAL_FIRST) || (comparison_logic == MAX_CONDITIONAL_LAST)) { reference_dbl = std::numeric_limits::lowest(); } - else if ((comparison_logic == MIN_CONDITIONAL_FIRST) || + else if ((comparison_logic == MIN_CONDITIONAL_FIRST) || (comparison_logic == MIN_CONDITIONAL_LAST) || - (comparison_logic == ABS_MIN_CONDITIONAL_FIRST) || + (comparison_logic == ABS_MIN_CONDITIONAL_FIRST) || (comparison_logic == ABS_MIN_CONDITIONAL_LAST)) { reference_dbl = std::numeric_limits::max(); } - else if ((comparison_logic == ABS_MAX_CONDITIONAL_FIRST) || + else if ((comparison_logic == ABS_MAX_CONDITIONAL_FIRST) || (comparison_logic == ABS_MAX_CONDITIONAL_LAST)) { reference_dbl = 0.0; } @@ -522,6 +525,7 @@ Notes: } // All actions complete, set the active flag and exit. + WatchValuesDelay::activate(); this->active = true; } }; diff --git a/models/vehicle_management/compound_events/include/event_trigger_set.hh b/models/vehicle_management/compound_events/include/event_trigger_set.hh index a250eea6..bc4b273c 100644 --- a/models/vehicle_management/compound_events/include/event_trigger_set.hh +++ b/models/vehicle_management/compound_events/include/event_trigger_set.hh @@ -49,6 +49,7 @@ class EventTriggerSet : public WatchValuesSet void populate_conditional_reference_trigger_list(); void update_conditional_trigger_references(); + void force_multi_shot_for_managed_values(); WatchValuesBaseCore * find_trigger( const std::string& trigger_name_in); }; #endif \ No newline at end of file diff --git a/models/vehicle_management/compound_events/src/compound_event.cc b/models/vehicle_management/compound_events/src/compound_event.cc index 989b76ac..bdf2da8b 100644 --- a/models/vehicle_management/compound_events/src/compound_event.cc +++ b/models/vehicle_management/compound_events/src/compound_event.cc @@ -128,11 +128,15 @@ CompoundEvent::test_crossing() } /***************************************************************************** -test_crossing +test_crossing_iterative Purpose: - FIXME Comment Me + Sets the status of a CompoundEvent according to the status of its triggers. + This method is iterative in that when moving from an Unarmed state to an + armed state, it can call itself if the event allows for simultaneous + processing of its arming triggers and other triggers (including action and + disarming triggers)An iterative call to process the Event's triggers *****************************************************************************/ -void +void CompoundEvent::test_crossing_iterative() { switch (status) { @@ -374,11 +378,17 @@ CompoundEvent::activate() if (arming_triggers.get_num_triggers() > 0) { status = Unarmed; arming_triggers.subscribe(); + // arming_triggers.force_multi_shot_for_managed_values(); } else { status = Armed; action_triggers.subscribe(); } + + //Apply multi_shot to triggers where necessary: + // * Action triggers with managed references + action_triggers.force_multi_shot_for_managed_values(); + WatchValuesDelay::activate(); // Identify which of the triggers has a conditional reference value. diff --git a/models/vehicle_management/compound_events/src/compound_event_manager.cc b/models/vehicle_management/compound_events/src/compound_event_manager.cc index 41483074..bad47add 100644 --- a/models/vehicle_management/compound_events/src/compound_event_manager.cc +++ b/models/vehicle_management/compound_events/src/compound_event_manager.cc @@ -70,7 +70,8 @@ CompoundEventsManager::update() { if (!enabled) {return;} // Iterate through managed triggers and unlock them for the current sim cycle - // (meant to be executed before a trigger is updated, where it will then be locked) + // (meant to be executed before a trigger is updated, where it will then be + // locked) for ( WatchValuesBaseCore * trigger : managed_triggers) { trigger->locked = false; } @@ -110,10 +111,15 @@ add_trigger Purpose: Adds a trigger to the list of managed_triggers, which will enable locking and unlocking of the trigger. + + FIXME Turner 2026/07 + It is not clear why this method takes a pointer rather than a reference. *****************************************************************************/ void CompoundEventsManager::add_trigger(WatchValuesBaseCore* new_trigger) { + if (new_trigger == nullptr) {return;} + managed_triggers.push_back( new_trigger); new_trigger->externally_managed = true; } diff --git a/models/vehicle_management/compound_events/src/event_trigger.cc b/models/vehicle_management/compound_events/src/event_trigger.cc index ecbef556..314cd5f6 100644 --- a/models/vehicle_management/compound_events/src/event_trigger.cc +++ b/models/vehicle_management/compound_events/src/event_trigger.cc @@ -70,6 +70,33 @@ EventTriggerBase::has_conditional_reference() const (comparison_logic == ABS_MIN_CONDITIONAL_LAST)); } +/***************************************************************************** +has_managed_value_reference +Purpose: + Returns a simple flag indicating whether the trigger has + managed values of reference. These should be multi-shot. +*****************************************************************************/ +bool +EventTriggerBase::has_managed_value() +{ + return ((comparison_logic == MAX_FIRST) || + (comparison_logic == MIN_FIRST) || + (comparison_logic == ABS_MAX_FIRST) || + (comparison_logic == ABS_MIN_FIRST) || + (comparison_logic == MAX_LAST) || + (comparison_logic == MIN_LAST) || + (comparison_logic == ABS_MAX_LAST) || + (comparison_logic == ABS_MIN_LAST) || + (comparison_logic == MAX_CONDITIONAL_FIRST) || + (comparison_logic == MIN_CONDITIONAL_FIRST) || + (comparison_logic == ABS_MAX_CONDITIONAL_FIRST) || + (comparison_logic == ABS_MIN_CONDITIONAL_FIRST) || + (comparison_logic == MAX_CONDITIONAL_LAST) || + (comparison_logic == MIN_CONDITIONAL_LAST) || + (comparison_logic == ABS_MAX_CONDITIONAL_LAST) || + (comparison_logic == ABS_MIN_CONDITIONAL_LAST)); +} + /***************************************************************************** set_new_reference Purpose: diff --git a/models/vehicle_management/compound_events/src/event_trigger_set.cc b/models/vehicle_management/compound_events/src/event_trigger_set.cc index d86687a9..166dd318 100644 --- a/models/vehicle_management/compound_events/src/event_trigger_set.cc +++ b/models/vehicle_management/compound_events/src/event_trigger_set.cc @@ -73,6 +73,24 @@ EventTriggerSet::populate_conditional_reference_trigger_list() } } +/***************************************************************************** +Name: force_multi_shot_for_managed_values +Purpose: + Triggers that have managed value references should always have multi_shot + forced. Otherwise, they'll inappropriately stop updating. +*****************************************************************************/ +void +EventTriggerSet::force_multi_shot_for_managed_values() +{ + for (WatchValuesBaseCore * trigger : triggers) { + EventTriggerBase * event_trigger = dynamic_cast(trigger); + if (event_trigger != nullptr && + event_trigger->has_managed_value()) { + trigger->multi_shot = true; + } + } +} + /***************************************************************************** Name: update_conditional_trigger_references Purpose: diff --git a/models/vehicle_management/compound_events/verif/SIM_verif_prebuilt_multitriggers/include/verif_events_manager.hh b/models/vehicle_management/compound_events/verif/SIM_verif_prebuilt_multitriggers/include/verif_events_manager.hh index 80945cf9..4d6700e5 100644 --- a/models/vehicle_management/compound_events/verif/SIM_verif_prebuilt_multitriggers/include/verif_events_manager.hh +++ b/models/vehicle_management/compound_events/verif/SIM_verif_prebuilt_multitriggers/include/verif_events_manager.hh @@ -101,7 +101,9 @@ class VerifCompoundEventsManager : public CompoundEventsManager add_event( event); } - VerifCompoundEventsManager(const VerifCompoundEventsManager&) = delete; - VerifCompoundEventsManager& operator=(const VerifCompoundEventsManager&) = delete; + private: + VerifCompoundEventsManager( const VerifCompoundEventsManager&) = delete; + VerifCompoundEventsManager& operator=( + const VerifCompoundEventsManager&) = delete; }; #endif diff --git a/models/vehicle_management/compound_events/verif/SIM_verif_trigger_test1/include/verif_events_manager.hh b/models/vehicle_management/compound_events/verif/SIM_verif_trigger_test1/include/verif_events_manager.hh index 783881e2..7f7261ce 100644 --- a/models/vehicle_management/compound_events/verif/SIM_verif_trigger_test1/include/verif_events_manager.hh +++ b/models/vehicle_management/compound_events/verif/SIM_verif_trigger_test1/include/verif_events_manager.hh @@ -44,7 +44,9 @@ class VerifCompoundEventsManager : public CompoundEventsManager event.action_triggers.multi_shot = true; add_event( event); } - VerifCompoundEventsManager(const VerifCompoundEventsManager&) = delete; - VerifCompoundEventsManager& operator=(const VerifCompoundEventsManager&) = delete; + private: + VerifCompoundEventsManager( const VerifCompoundEventsManager&) = delete; + VerifCompoundEventsManager& operator=( + const VerifCompoundEventsManager&) = delete; }; #endif diff --git a/models/vehicle_management/compound_events/verif/SIM_verif_trigger_test2/include/verif_events_manager.hh b/models/vehicle_management/compound_events/verif/SIM_verif_trigger_test2/include/verif_events_manager.hh index 773f6d11..b97a1c64 100644 --- a/models/vehicle_management/compound_events/verif/SIM_verif_trigger_test2/include/verif_events_manager.hh +++ b/models/vehicle_management/compound_events/verif/SIM_verif_trigger_test2/include/verif_events_manager.hh @@ -35,7 +35,10 @@ class VerifCompoundEventsManager : public CompoundEventsManager event.action_triggers.add_trigger(trigger); add_event( event); } - VerifCompoundEventsManager(const VerifCompoundEventsManager&) = delete; - VerifCompoundEventsManager& operator=(const VerifCompoundEventsManager&) = delete; + private: + VerifCompoundEventsManager( const VerifCompoundEventsManager&) = delete; + VerifCompoundEventsManager& operator=( + const VerifCompoundEventsManager&) = delete; + }; #endif From b9962c700547358370bb8b6b9f3875128cdd8641 Mon Sep 17 00:00:00 2001 From: Minsoo Kang Date: Thu, 1 Oct 2026 16:13:52 -0500 Subject: [PATCH 2/6] Remove commented-out code and changed has_managed_value() to use switch statement --- .../compound_events/src/compound_event.cc | 1 - .../compound_events/src/event_trigger.cc | 37 +++++++++++-------- 2 files changed, 21 insertions(+), 17 deletions(-) diff --git a/models/vehicle_management/compound_events/src/compound_event.cc b/models/vehicle_management/compound_events/src/compound_event.cc index bdf2da8b..a3c0014d 100644 --- a/models/vehicle_management/compound_events/src/compound_event.cc +++ b/models/vehicle_management/compound_events/src/compound_event.cc @@ -378,7 +378,6 @@ CompoundEvent::activate() if (arming_triggers.get_num_triggers() > 0) { status = Unarmed; arming_triggers.subscribe(); - // arming_triggers.force_multi_shot_for_managed_values(); } else { status = Armed; diff --git a/models/vehicle_management/compound_events/src/event_trigger.cc b/models/vehicle_management/compound_events/src/event_trigger.cc index 314cd5f6..8a90351c 100644 --- a/models/vehicle_management/compound_events/src/event_trigger.cc +++ b/models/vehicle_management/compound_events/src/event_trigger.cc @@ -79,22 +79,27 @@ has_managed_value_reference bool EventTriggerBase::has_managed_value() { - return ((comparison_logic == MAX_FIRST) || - (comparison_logic == MIN_FIRST) || - (comparison_logic == ABS_MAX_FIRST) || - (comparison_logic == ABS_MIN_FIRST) || - (comparison_logic == MAX_LAST) || - (comparison_logic == MIN_LAST) || - (comparison_logic == ABS_MAX_LAST) || - (comparison_logic == ABS_MIN_LAST) || - (comparison_logic == MAX_CONDITIONAL_FIRST) || - (comparison_logic == MIN_CONDITIONAL_FIRST) || - (comparison_logic == ABS_MAX_CONDITIONAL_FIRST) || - (comparison_logic == ABS_MIN_CONDITIONAL_FIRST) || - (comparison_logic == MAX_CONDITIONAL_LAST) || - (comparison_logic == MIN_CONDITIONAL_LAST) || - (comparison_logic == ABS_MAX_CONDITIONAL_LAST) || - (comparison_logic == ABS_MIN_CONDITIONAL_LAST)); + switch (comparison_logic) { + case MAX_FIRST: + case MIN_FIRST: + case ABS_MAX_FIRST: + case ABS_MIN_FIRST: + case MAX_LAST: + case MIN_LAST: + case ABS_MAX_LAST: + case ABS_MIN_LAST: + case MAX_CONDITIONAL_FIRST: + case MIN_CONDITIONAL_FIRST: + case ABS_MAX_CONDITIONAL_FIRST: + case ABS_MIN_CONDITIONAL_FIRST: + case MAX_CONDITIONAL_LAST: + case MIN_CONDITIONAL_LAST: + case ABS_MAX_CONDITIONAL_LAST: + case ABS_MIN_CONDITIONAL_LAST: + return true; + } + + return false; } /***************************************************************************** From e166c6d52667f57a043b82f6d5f7994cb2ace0a4 Mon Sep 17 00:00:00 2001 From: Minsoo Kang Date: Thu, 1 Oct 2026 17:07:00 -0500 Subject: [PATCH 3/6] Fix clang-tidy errors: remove duplicate deleted copy operations, use auto for dynamic_cast, mark has_managed_value as const --- .../compound_events/include/compound_event_manager.hh | 4 ---- .../compound_events/include/event_trigger.hh | 2 +- .../vehicle_management/compound_events/src/event_trigger.cc | 2 +- .../compound_events/src/event_trigger_set.cc | 2 +- 4 files changed, 3 insertions(+), 7 deletions(-) diff --git a/models/vehicle_management/compound_events/include/compound_event_manager.hh b/models/vehicle_management/compound_events/include/compound_event_manager.hh index adca1dd2..ce9a38c3 100644 --- a/models/vehicle_management/compound_events/include/compound_event_manager.hh +++ b/models/vehicle_management/compound_events/include/compound_event_manager.hh @@ -236,9 +236,5 @@ class CompoundEventsManager : public VehicleEventsManager return reinterpret_cast(var_name_ref->address); } - - // Copy-constructor and operator= not implemented / deleted - CompoundEventsManager( const CompoundEventsManager&) = delete; - CompoundEventsManager& operator=( const CompoundEventsManager&) = delete; }; #endif diff --git a/models/vehicle_management/compound_events/include/event_trigger.hh b/models/vehicle_management/compound_events/include/event_trigger.hh index 4e7a1681..3518b282 100644 --- a/models/vehicle_management/compound_events/include/event_trigger.hh +++ b/models/vehicle_management/compound_events/include/event_trigger.hh @@ -138,7 +138,7 @@ struct EventTriggerBase EventTriggerBase() = default; void apply_function_modifier(); bool has_conditional_reference() const; - bool has_managed_value(); + bool has_managed_value() const; void set_new_reference(); }; diff --git a/models/vehicle_management/compound_events/src/event_trigger.cc b/models/vehicle_management/compound_events/src/event_trigger.cc index 8a90351c..2c91418b 100644 --- a/models/vehicle_management/compound_events/src/event_trigger.cc +++ b/models/vehicle_management/compound_events/src/event_trigger.cc @@ -77,7 +77,7 @@ has_managed_value_reference managed values of reference. These should be multi-shot. *****************************************************************************/ bool -EventTriggerBase::has_managed_value() +EventTriggerBase::has_managed_value() const { switch (comparison_logic) { case MAX_FIRST: diff --git a/models/vehicle_management/compound_events/src/event_trigger_set.cc b/models/vehicle_management/compound_events/src/event_trigger_set.cc index 166dd318..c9242c53 100644 --- a/models/vehicle_management/compound_events/src/event_trigger_set.cc +++ b/models/vehicle_management/compound_events/src/event_trigger_set.cc @@ -83,7 +83,7 @@ void EventTriggerSet::force_multi_shot_for_managed_values() { for (WatchValuesBaseCore * trigger : triggers) { - EventTriggerBase * event_trigger = dynamic_cast(trigger); + auto * event_trigger = dynamic_cast(trigger); if (event_trigger != nullptr && event_trigger->has_managed_value()) { trigger->multi_shot = true; From 7f557af918ba4c9c65bab8d87b408400f13b7b15 Mon Sep 17 00:00:00 2001 From: Minsoo Kang Date: Thu, 1 Oct 2026 19:05:39 -0500 Subject: [PATCH 4/6] Add 'Undefined' enum value handling in switch for 'has_managed_value' --- models/vehicle_management/compound_events/src/event_trigger.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/models/vehicle_management/compound_events/src/event_trigger.cc b/models/vehicle_management/compound_events/src/event_trigger.cc index 2c91418b..5863733d 100644 --- a/models/vehicle_management/compound_events/src/event_trigger.cc +++ b/models/vehicle_management/compound_events/src/event_trigger.cc @@ -97,6 +97,8 @@ EventTriggerBase::has_managed_value() const case ABS_MAX_CONDITIONAL_LAST: case ABS_MIN_CONDITIONAL_LAST: return true; + case Undefined: + return false; } return false; From 8501a00bda7a8e856e786a9c87ededff296241a7 Mon Sep 17 00:00:00 2001 From: Minsoo Kang <327114246+Minsoo-Kang-space@users.noreply.github.com> Date: Tue, 6 Oct 2026 11:35:44 -0500 Subject: [PATCH 5/6] Add all 'TriggerCondition' enums to 'has_managed_value()' for switch statement --- .../compound_events/src/event_trigger.cc | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/models/vehicle_management/compound_events/src/event_trigger.cc b/models/vehicle_management/compound_events/src/event_trigger.cc index 5863733d..fd841dff 100644 --- a/models/vehicle_management/compound_events/src/event_trigger.cc +++ b/models/vehicle_management/compound_events/src/event_trigger.cc @@ -98,6 +98,20 @@ EventTriggerBase::has_managed_value() const case ABS_MIN_CONDITIONAL_LAST: return true; case Undefined: + case EQ: + case NE: + case GT: + case LT: + case GE: + case LE: + case ABS_EQ: + case ABS_GT: + case ABS_GE: + case ABS_LT: + case ABS_LE: + case OC: + case Change: + case Crossing: return false; } From 8e72ed4f7cca86e96e0a749991ab857c2c91eee2 Mon Sep 17 00:00:00 2001 From: Minsoo Kang <327114246+Minsoo-Kang-space@users.noreply.github.com> Date: Tue, 13 Oct 2026 10:06:17 -0500 Subject: [PATCH 6/6] Revert extraneous changes --- .../include/verif_events_manager.hh | 7 +++---- .../include/verif_events_manager.hh | 7 +++---- .../include/verif_events_manager.hh | 6 ++---- 3 files changed, 8 insertions(+), 12 deletions(-) diff --git a/models/vehicle_management/compound_events/verif/SIM_verif_prebuilt_multitriggers/include/verif_events_manager.hh b/models/vehicle_management/compound_events/verif/SIM_verif_prebuilt_multitriggers/include/verif_events_manager.hh index 4d6700e5..97668259 100644 --- a/models/vehicle_management/compound_events/verif/SIM_verif_prebuilt_multitriggers/include/verif_events_manager.hh +++ b/models/vehicle_management/compound_events/verif/SIM_verif_prebuilt_multitriggers/include/verif_events_manager.hh @@ -101,9 +101,8 @@ class VerifCompoundEventsManager : public CompoundEventsManager add_event( event); } - private: - VerifCompoundEventsManager( const VerifCompoundEventsManager&) = delete; - VerifCompoundEventsManager& operator=( - const VerifCompoundEventsManager&) = delete; + + VerifCompoundEventsManager(const VerifCompoundEventsManager&) = delete; + VerifCompoundEventsManager& operator=(const VerifCompoundEventsManager&) = delete; }; #endif diff --git a/models/vehicle_management/compound_events/verif/SIM_verif_trigger_test1/include/verif_events_manager.hh b/models/vehicle_management/compound_events/verif/SIM_verif_trigger_test1/include/verif_events_manager.hh index 7f7261ce..a30c3b32 100644 --- a/models/vehicle_management/compound_events/verif/SIM_verif_trigger_test1/include/verif_events_manager.hh +++ b/models/vehicle_management/compound_events/verif/SIM_verif_trigger_test1/include/verif_events_manager.hh @@ -44,9 +44,8 @@ class VerifCompoundEventsManager : public CompoundEventsManager event.action_triggers.multi_shot = true; add_event( event); } - private: - VerifCompoundEventsManager( const VerifCompoundEventsManager&) = delete; - VerifCompoundEventsManager& operator=( - const VerifCompoundEventsManager&) = delete; + + VerifCompoundEventsManager(const VerifCompoundEventsManager&) = delete; + VerifCompoundEventsManager& operator=(const VerifCompoundEventsManager&) = delete; }; #endif diff --git a/models/vehicle_management/compound_events/verif/SIM_verif_trigger_test2/include/verif_events_manager.hh b/models/vehicle_management/compound_events/verif/SIM_verif_trigger_test2/include/verif_events_manager.hh index b97a1c64..f0c11747 100644 --- a/models/vehicle_management/compound_events/verif/SIM_verif_trigger_test2/include/verif_events_manager.hh +++ b/models/vehicle_management/compound_events/verif/SIM_verif_trigger_test2/include/verif_events_manager.hh @@ -35,10 +35,8 @@ class VerifCompoundEventsManager : public CompoundEventsManager event.action_triggers.add_trigger(trigger); add_event( event); } - private: - VerifCompoundEventsManager( const VerifCompoundEventsManager&) = delete; - VerifCompoundEventsManager& operator=( - const VerifCompoundEventsManager&) = delete; + VerifCompoundEventsManager(const VerifCompoundEventsManager&) = delete; + VerifCompoundEventsManager& operator=(const VerifCompoundEventsManager&) = delete; }; #endif