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:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user