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

Centered post flight stats with HD-mode #12084

Closed
Box-in-the-Jack opened this issue Dec 24, 2022 · 3 comments · Fixed by #12086
Closed

Centered post flight stats with HD-mode #12084

Box-in-the-Jack opened this issue Dec 24, 2022 · 3 comments · Fixed by #12086
Labels
Feature Request Feature requests are excluded from automatically being marked as stale

Comments

@Box-in-the-Jack
Copy link

Is your feature request related to a problem? Please describe

After flying and disarm post flight stats are shown. With analog and digital links before HD mode the stats were more or less centered. Now with HD mode the stats are all the way to the left.

Describe the solution you'd like

1.) I'd like to have an option to place the stats wherever the user wants.
2.) Just put it in the middle, all the time.
3.) Use the whole screen.

I guess whatever has the chance to get done for bf 4.4.1 (or even 4.4.0? Please, pretty pretty please!) should be done first as the current behavior is just... weird.

Describe alternatives you've considered

There is no alternative... is's either HD or not. Not using HD is an option, but I guess that's not the idea of an alternative.

Other information

No response

@Box-in-the-Jack Box-in-the-Jack added the Template: Feature Request Set by auto_close_issue. label Dec 24, 2022
@McGiverGim McGiverGim added Feature Request Feature requests are excluded from automatically being marked as stale and removed Template: Feature Request Set by auto_close_issue. labels Dec 24, 2022
@McGiverGim
Copy link
Member

I'm not too sure if this is a feature request or can be considered a bug... @SteveCEvans you did almost all the HD part. What do you think?

@Box-in-the-Jack
Copy link
Author

Bug or feature request, I guess that depends on the way one looks at it. Someone told me the stats placement is hardcoded in betaflight, which is fine when basically analog SD was the only kid in town. And I guess it still works as intended, no "bug" there. The canvas to "paint" the stats just changed. Then it's a feature request.
But when you just see the situation as is, ignoring the past, it might be seen as a bug.

@McGiverGim
Copy link
Member

The statistics are written here:

static void osdDisplayStatisticLabel(uint8_t y, const char * text, const char * value)
{
displayWrite(osdDisplayPort, 2, y, DISPLAYPORT_ATTR_NORMAL, text);
displayWrite(osdDisplayPort, 20, y, DISPLAYPORT_ATTR_NORMAL, ":");
displayWrite(osdDisplayPort, 22, y, DISPLAYPORT_ATTR_NORMAL, value);
}

Is only add an offset to the second parameter of the displayWrite commands to be able to center it.
Something like this:

    uint8_t offset = 0;
    if (vcdProfile->video_system == VIDEO_SYSTEM_HD && vcdProfile->canvas_cols > OSD_ELEMENT_BUFFER_LENGTH) {
        offset = (vcdProfile->canvas_rows - OSD_ELEMENT_BUFFER_LENGTH) / 2;
    }
    displayWrite(osdDisplayPort, offset + 2, y, DISPLAYPORT_ATTR_NORMAL, text);
    displayWrite(osdDisplayPort, offset + 20, y, DISPLAYPORT_ATTR_NORMAL, ":");
    displayWrite(osdDisplayPort, offset + 22, y, DISPLAYPORT_ATTR_NORMAL, value);

But I'm not too sure where to calculate this offset. Doing this here (in this method) will calculate it for each statistic, I suppose it must be done earlier to calculate it only one.
I'm not good at C, maybe someone can pass here and take a look at it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature Request Feature requests are excluded from automatically being marked as stale
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants