[SM] Call "Update UI State" only for intended state changes
Problem
The call to "SM Update UI State" is called with every iteration of the State Machine Loop. But if a state change, that is not implemented for the current state, is requested, the default case and one loop iteration gets executed. This can lead to unintended behavior because a state change is signaled where no state change should happen.
Proposed Solution
Put the "SM Update UI State" and all other VIs (e.g. broadcasts) which may signal a state change into a case structure. The signaling VIs gets executed only, if the "Is Value Changed.vim" on the Current State
enum returns True
.
Caveats
This change would prevent signaling an intended state change to the same state. Alternatively, we could move the "SM Update UI State" VI into every "HSE_SM_TRANSITION" case except the default
case. But this approach would cause more code duplications.
Any comments? @joerg.hampel