Compare commits

..

4 Commits

Author SHA1 Message Date
Just Call Me Koko
9fd032a698 Merge pull request #724 from justcallmekoko/develop
Channel analyzer graph scaling is more fluid
2025-04-19 14:04:42 -04:00
Just Call Me Koko
97dce525a4 Graph scaling more fluid 2025-04-19 13:46:31 -04:00
Just Call Me Koko
424aa61127 Merge pull request #722 from justcallmekoko/develop
Channel analyzer graphs shows frames without multiplier
2025-04-19 13:45:42 -04:00
Just Call Me Koko
4c6a2b23c4 Fix graph scaling 2025-04-19 12:58:54 -04:00
2 changed files with 8 additions and 5 deletions

View File

@@ -2734,12 +2734,15 @@ void MenuFunctions::setGraphScale(float scale) {
}
float MenuFunctions::calculateGraphScale(int16_t value) {
if (value < GRAPH_VERT_LIM) {
return 1.0; // No scaling needed if the value is within the limit
if ((value * this->_graph_scale < GRAPH_VERT_LIM) && (value * this->_graph_scale > GRAPH_VERT_LIM * 0.75)) {
return this->_graph_scale; // No scaling needed if the value is within the limit
}
if (value < GRAPH_VERT_LIM)
return 1.0;
// Calculate the multiplier proportionally
return (0.5 * GRAPH_VERT_LIM) / value;
return (0.75 * GRAPH_VERT_LIM) / value;
}
float MenuFunctions::graphScaleCheck(const int16_t array[TFT_WIDTH]) {
@@ -2766,7 +2769,7 @@ void MenuFunctions::drawMaxLine(int16_t value, uint16_t color) {
display_obj.tft.setCursor(0, TFT_HEIGHT - (value * this->_graph_scale));
display_obj.tft.setTextColor(color, TFT_BLACK);
display_obj.tft.setTextSize(1);
display_obj.tft.println((String)value);
display_obj.tft.println((String)(value / BASE_MULTIPLIER));
}
void MenuFunctions::drawGraph(int16_t *values) {

View File

@@ -23,7 +23,7 @@
//#define MARAUDER_REV_FEATHER
//// END BOARD TARGETS
#define MARAUDER_VERSION "v1.4.3"
#define MARAUDER_VERSION "v1.4.4"
#define GRAPH_REFRESH 100