time4tea / gopro-dashboard-overlay

Programs to process GoPro MP4 & Generic GPX/FIT files and create video dashboards & maps
GNU General Public License v3.0
353 stars 51 forks source link

Feature request - Heading Indicator gauge - variation of the compass #43

Open KyleGW opened 2 years ago

KyleGW commented 2 years ago

I modified the widget code, to edit the font size, the tick sizes, and to include the heading degrees text. I started to play around with a way to actually rotate the text as the gauge spins, the way a real heading indicator would, but was more work than I felt like putting in after a while. :) Could either implement as it's own gauge or with option flags on the compass gauge.

recommendation is to add ability to modify the compass text size. In my rough implementation I hard coded a font load in with sizes needed for 4k and 1080

edits to widget_compass.py:

       self.font = ImageFont.truetype(font="Roboto-Medium.ttf", size=27) #4k size=27 , 1080 size=13 

        major_tick = size / 13
        minor_tick = size / 13
        tiny_tick = size / 20
        teeny_tick = size / 30

        #added text for heading indicator
        draw.text(locate(30, self.size / text_circleradius), "3", font=self.font, anchor="mm", fill=self.text)
        draw.text(locate(60, self.size / text_circleradius), "6", font=self.font, anchor="mm", fill=self.text)
        draw.text(locate(120, self.size / text_circleradius), "12", font=self.font, anchor="mm", fill=self.text)
        draw.text(locate(150, self.size / text_circleradius), "15", font=self.font, anchor="mm", fill=self.text)
        draw.text(locate(210, self.size / text_circleradius), "21", font=self.font, anchor="mm", fill=self.text)
        draw.text(locate(240, self.size / text_circleradius), "24", font=self.font, anchor="mm", fill=self.text)
        draw.text(locate(300, self.size / text_circleradius), "30", font=self.font, anchor="mm", fill=self.text)
        draw.text(locate(330, self.size / text_circleradius), "33", font=self.font, anchor="mm", fill=self.text)

4K layout xml:

    <translate x="50" y="30">
        <component type="compass" size="350" textsize="27" text="255,255,255" bg="0,0,0,25"/>
        <component type="icon" x="79" y="79" file="airplane.png" size="192"/>
        <composite x="140" y="190" name="altitude">
            <component type="text" x="75" y="0" size="18">ALT(ft)</component>
            <component type="metric" x="75" y="20" metric="alt" dp="0" units="feet" size="28" />
        </composite>
    </translate>

plane icon from: http://clipart-library.com/clip-art/377337_plane-icon-png.htm Another instrument reference: https://www.mcico.com/resources/flight-instruments/six-pack-aircraft-instruments-explained

time4tea commented 2 years ago

Hey this is great! Thank you!

prestonvanloon commented 4 months ago

This would be an excellent feature for aviation videos. Thanks