JohnySeven / TWatchSK

TTGO T-Watch 2020 v1 supporting Signal K features for displaying boat data and controlling devices on board.
MIT License
9 stars 1 forks source link

Dynamic UI - unit conversions #50

Closed JohnySeven closed 3 years ago

JohnySeven commented 3 years ago

What I'm facing right now is that SK data are shown on watch ⌚ display, but they are in SK default units, and I must say I don't play good with Kelvin or meters per second.

So I would like to add some mechanism that will show correct units per user configuration in TWatch UI designer.

The inspiration on how to do can be found in Instrument Panel app or KIP app where user can configure default values.

Any comments on this @ba58smith ?

Jan

ba58smith commented 3 years ago

How about a formula that can be added to the binding, that will do whatever conversion is necessary? I think that would be simple for temperature conversions, and for most speed, volume, length, depth, etc. conversions. It could be another element in the definition of a DynamicView. I would initially make it like a Linear transform in SensESP, I think - a multiplier and an offset. If that doesn't cover everything you have in mind, then it could be expanded.

JohnySeven commented 3 years ago

Yes, this is my intention - we've already multiply there and offset will be added. But in TWatchSK Designer I could at least offer some help with configuring it - some drop down with settings per unit maybe?

ba58smith commented 3 years ago

I don't know how the drop-down would work. If you can have a label in the drop-down that would put a formula into the "Conversion formula" field in the editor when selected, that would work. Drop-down List: Fahrenheit (would put value * 1.8 - 459.67 into the "Conversion formula" field) Celsius (would put value - 273.15) into "Conversion formula") Miles per hour (put value * 2.23694 into "Conversion formula") Knots (put value * 1.94384 into "Conversion formula") Other (put value * xxx + yyy into Conversion formula, and let user modify it to be math formula to modify value)

JohnySeven commented 3 years ago

Well this is solved in Designer where you can pick SK path from server and you can configure unit conversion based on value. Closing.