Skip to content
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

Add modifiers to MobiFlight Configuration #909

Merged
merged 8 commits into from
Sep 13, 2022
Merged

Conversation

DocMoebiuz
Copy link
Collaborator

@DocMoebiuz DocMoebiuz commented Sep 13, 2022

So far MobiFlight provided a very static way of modifying values. We had "transform", "compare" and "interpolation" - in this exact static order. With the concept of "modifiers" this will allow for more flexibility in the future:

  • The position of the modifier is not fixed
  • We can introduce different modifiers to format and manipulate values in many ways

The first additional modifier is "blink" which allows to let any value blink by applying a sequence of ON and OFF. ON and OFF duration can be defined. Other can be used for "padding", "text-alignment", etc.

This PR does not yet provide a UI for Blink. But the configuration can be added

<modifiers>
  <blink active="True" blinkValue=" " onOffSequence="200,200,400,200" />
</modifiers>

This configuration will let the value blink with a sequence of 200ms ON, 200ms OFF, 400ms ON and 200ms OFF.
The value for the OFF is defined by "blinkValue", in this case a space.

fixes #119

Confirmations:

  • Transformation, Comparison & Interpolation are now "modifiers" and loaded as a list
  • Backward compatibility with existing configs is preserved and the order of the modifiers is T, C, I
  • ExecutionManager will simply execute the chain of modifiers
  • Modifier logic resides in modifier class implementation, not in Execution Manager anymore
  • Unit tests are all update

Breaking Changes:

  • Values are internally handled as Float64 by default. A transform with Round or Floor can be explicitly applied if needed.

@DocMoebiuz DocMoebiuz added the feature A new feature label Sep 13, 2022
@DocMoebiuz DocMoebiuz self-assigned this Sep 13, 2022
@DocMoebiuz DocMoebiuz merged commit 4393cca into main Sep 13, 2022
@Kavakuo Kavakuo mentioned this pull request Sep 25, 2022
DocMoebiuz pushed a commit that referenced this pull request Sep 28, 2022
@DocMoebiuz DocMoebiuz deleted the clean-transform-refactor branch October 18, 2022 17:10
@DocMoebiuz DocMoebiuz added enhancement Improvement of an existing feature and removed feature A new feature labels Oct 28, 2022
@MobiFlight-Admin MobiFlight-Admin added feature A new feature and removed enhancement Improvement of an existing feature labels Nov 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature A new feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Provide Blink Mode
2 participants