simplified a bit how the TelemetryField updaters work

- now we only use one function to update the TelemetryField instead
of having to fetch data and then update it.

Still need to update the iRacing provider to use this pattern. Way
better and creates better units.

Got rid of that stupid long ass switch statement too
This commit is contained in:
2026-07-07 17:52:47 +01:00
parent 94ba0e2539
commit 0887fbfd75
6 changed files with 181 additions and 281 deletions
+7 -2
View File
@@ -18,7 +18,12 @@ func UInt8Transform(v any, out *TelemetryField) {
out.Raw = uint64(v.(int))
}
func FloatToStringTransform(v any, out *TelemetryField) {
func FloatToStringTransform(v float32, out *TelemetryField) {
out.Type = DataTypeSTRING
out.Str = strconv.FormatFloat(float64(v), 'f', 1, 32)
}
func FloatToStringTransformDEPRECATE(v any, out *TelemetryField) {
out.Type = DataTypeSTRING
if v == nil {
@@ -29,7 +34,7 @@ func FloatToStringTransform(v any, out *TelemetryField) {
out.Str = strconv.FormatFloat(float64(v.(float32)), 'f', 1, 32)
}
func FloatToUInt8Transform(v any, out *TelemetryField) {
func FloatToUInt8TransformDEPRECATE(v any, out *TelemetryField) {
out.Type = DataTypeUINT8
if v == nil {