Animating each particular led is not difficult:
- Code: Select all
<animation>
<type>select</type>
<object-name>led.fuel0.2</object-name>
<condition>
<greater-than-equals>
<property>/consumables/fuel/tank[0]/level-gal_us</property>
<value>1.0</value>
</greater-than-equals>
</condition>
</animation>
and this animation is repeated for other 31 remaining LEDs, with condition values adjusted respectively.
All is nice and good until one wants to include special modes of operation in this indicator. For example:
- when fuel quantity sensor is contaminated, only first and last LED should illuminate, and
- when fuel quantity sensor is defective, all LEDs should remain unlit.
So, I can add two additional animations for the above special cases _and_ complicate the condition logic in_every_ animation.
This seems wasteful and computational resource unfriendly.
Is there a way to define an animation group? Basically, I would like to enclose the 32 separate animations into one group/block, executed where everything is operational, and have two other animations executed for special cases. Something like:
- Code: Select all
if (operational)
execute animation block
elseif (contaminated)
execute dedicated animation
else
execute other dedicated animation
What would be the best way to approach this?