Adding a radial gauge to the library - #6
Open
davidgs wants to merge 5 commits into
Open
Conversation
audreylim
reviewed
Aug 8, 2024
audreylim
left a comment
Contributor
There was a problem hiding this comment.
Thanks for the APIs. Can you provide some images on how it looks like, as well as code snippets on how it might be used?
Contributor
Author
|
I'm currently using it with the InfluxDB app I wrote: while (result.next()) {
// Get the value of the "_value" column
FluxValue value = result.getValueByName("_value");
double a = value.getDouble();
int color = TFT_WHITE;
if (a <= STAT_LOWER) {
color = TFT_BLUE;
} else if (a > STAT_LOWER && a <= STAT_MID) {
color = TFT_GREEN;
} else if (a > STAT_MID && a <= STAT_UPPER) {
color = TFT_YELLOW;
} else {
color = TFT_RED;
}
ui.drawGauge(STAT_LABEL.c_str(), SUFFIX.c_str(), a, 50, 0, TFT_WHITE, color, true);
} |
audreylim
reviewed
Aug 9, 2024
audreylim
left a comment
Contributor
There was a problem hiding this comment.
I think your editor's formatting may make the code more readable, so let's leave it.
The gauge looks great and the code LGTM. Just a minor fix and we can merge this.
We'll probably add an examples folder to this repo in future.
Contributor
Author
|
Are we ok to merge this? |
Contributor
|
One more thing, it works well but only for static data. Is this meant to be constantly refreshing? We would need to draw it on a large sprite if so. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

A radial gauge (with or without hash-marks) for the display