even more fields were added, won't list them all

This commit is contained in:
2026-03-15 19:28:11 +00:00
parent 7f0ab21a61
commit e5bd5b8983
5 changed files with 179 additions and 75 deletions
+67 -67
View File
@@ -2,33 +2,9 @@ Windows:
1:
uiwindow:
Dims:
X0: 142
Y0: 19
Width: 500
Height: 20
Decor:
BGColour: 4161
FGColour: 65535
TitleColour: 65535
BorderColour: 63488
TitleSize: 1
TextSize: 2
HasBorder: 1
Padding: 0
Opts:
ShowID: 0
WinType: 1
PreviewValue: "5678"
Title: TACHO
uidata:
WID: 1
TelemetryField: RPM
2:
uiwindow:
Dims:
X0: 207
Y0: 412
Width: 111
X0: 710
Y0: 8
Width: 84
Height: 57
Decor:
BGColour: 4161
@@ -42,12 +18,12 @@ Windows:
Opts:
ShowID: 0
WinType: 2
PreviewValue: "61.4"
Title: BBias
PreviewValue: PIT
Title: Pit Sp
uidata:
WID: 2
TelemetryField: BrakeBias
3:
WID: 1
TelemetryField: Pit Speed Limiter
2:
uiwindow:
Dims:
X0: 331
@@ -69,33 +45,9 @@ Windows:
PreviewValue: "234"
Title: SPEEDO
uidata:
WID: 3
WID: 2
TelemetryField: Speed
4:
uiwindow:
Dims:
X0: 50
Y0: 102
Width: 143
Height: 40
Decor:
BGColour: 4161
FGColour: 65535
TitleColour: 65535
BorderColour: 63488
TitleSize: 2
TextSize: 2
HasBorder: 1
Padding: 0
Opts:
ShowID: 0
WinType: 2
PreviewValue: "12312.34"
Title: SessionTime
uidata:
WID: 4
TelemetryField: SessionTime
5:
3:
uiwindow:
Dims:
X0: 354
@@ -117,9 +69,9 @@ Windows:
PreviewValue: R
Title: Box
uidata:
WID: 5
WID: 3
TelemetryField: Gear
6:
4:
uiwindow:
Dims:
X0: 9
@@ -141,9 +93,9 @@ Windows:
PreviewValue: "12"
Title: ABS
uidata:
WID: 6
TelemetryField: Emtpy
7:
WID: 4
TelemetryField: ABS Control
5:
uiwindow:
Dims:
X0: 74
@@ -165,9 +117,9 @@ Windows:
PreviewValue: "12"
Title: TC
uidata:
WID: 7
TelemetryField: Emtpy
8:
WID: 5
TelemetryField: TC Control
6:
uiwindow:
Dims:
X0: 140
@@ -188,6 +140,54 @@ Windows:
WinType: 2
PreviewValue: "6"
Title: Thr
uidata:
WID: 6
TelemetryField: Throttle Control
7:
uiwindow:
Dims:
X0: 142
Y0: 19
Width: 500
Height: 20
Decor:
BGColour: 4161
FGColour: 65535
TitleColour: 65535
BorderColour: 63488
TitleSize: 1
TextSize: 2
HasBorder: 1
Padding: 0
Opts:
ShowID: 0
WinType: 1
PreviewValue: "5678"
Title: TACHO
uidata:
WID: 7
TelemetryField: RPM
8:
uiwindow:
Dims:
X0: 207
Y0: 412
Width: 111
Height: 57
Decor:
BGColour: 4161
FGColour: 65535
TitleColour: 65535
BorderColour: 63488
TitleSize: 2
TextSize: 4
HasBorder: 1
Padding: 0
Opts:
ShowID: 0
WinType: 2
PreviewValue: "61.4"
Title: BBias
uidata:
WID: 8
TelemetryField: Emtpy
TelemetryField: BrakeBias
+25
View File
@@ -0,0 +1,25 @@
package iracing
import (
telem "esdi/telemetry"
"strconv"
)
func PitSpeedLimiterTransform(v any, out *telem.TelemetryField) {
out.Type = telem.DataTypeSTRING
if v.(bool) {
out.Str = "PIT"
} else {
out.Str = " "
}
}
func FloatToStringTransform(v any, out *telem.TelemetryField) {
out.Type = telem.DataTypeSTRING
out.Str = strconv.FormatFloat(float64(v.(float32)), 'f', 1, 32)
}
func FloatToUInt8Transform(v any, out *telem.TelemetryField) {
out.Type = telem.DataTypeUINT8
out.Raw = uint64(v.(float32))
}
+26 -4
View File
@@ -1,14 +1,36 @@
package iracing
// This file maps the data from the desktop provider data structure to iRacing
import (
"esdi/telemetry"
)
var internalToSDKFieldNames = map[telemetry.FieldID]string{
telemetry.Speed: "Speed",
telemetry.Gear: "Gear",
telemetry.RPM: "RPM",
telemetry.BrakeBias: "dcBrakeBias",
telemetry.Speed: "Speed",
telemetry.Gear: "Gear",
telemetry.RPM: "RPM",
// Engine Warnings
telemetry.PitSpeedLimiter: "irsdk_pitSpeedLimiter",
// Ajudstements
telemetry.BrakeBias: "dcBrakeBias",
telemetry.ABSSetting: "dcABS",
telemetry.TCSetting: "dcTractionControl",
telemetry.ThrottleSetting: "dcThrottleShape",
// Tire data
telemetry.LFtempL: "LFtempCL",
telemetry.LFtempM: "LFtempCM",
telemetry.LFtempR: "LFtempCR",
telemetry.RFtempL: "RFtempCL",
telemetry.RFtempM: "RFtempCM",
telemetry.RFtempR: "RFtempCR",
telemetry.LRtempL: "LRtempCL",
telemetry.LRtempM: "LRtempCM",
telemetry.LRtempR: "LRtempCR",
telemetry.RRtempL: "RRtempCL",
telemetry.RRtempM: "RRtempCM",
telemetry.RRtempR: "RRtempCR",
// Session Data
telemetry.SessionTime: "SessionTime",
telemetry.ReplaySessionTime: "ReplaySessionTime",
telemetry.Empty: "empty",
+13
View File
@@ -1,3 +1,6 @@
// Package iracing is in the providers and provides telemety to our desktop
// application. It needs to establish a relationship between the desktop data
// structure of our app and the data iRacing provides
package iracing
import (
@@ -187,7 +190,17 @@ func (i *IRacing) Subscribe(requestFields map[int16]telem.FieldID) {
out.Type = telem.DataTypeUINT16
out.Raw = uint64(uint16(v.(float32)))
}
case telem.PitSpeedLimiter:
binding.Transform = PitSpeedLimiterTransform
case telem.BrakeBias:
binding.Transform = FloatToStringTransform
case telem.ABSSetting:
binding.Transform = FloatToUInt8Transform
case telem.TCSetting:
binding.Transform = FloatToUInt8Transform
case telem.ThrottleSetting:
binding.Transform = FloatToUInt8Transform
case telem.LFtempM:
binding.Transform = func(v any, out *telem.TelemetryField) {
out.Type = telem.DataTypeSTRING
out.Str = strconv.FormatFloat(float64(v.(float32)), 'f', 1, 32)
+48 -4
View File
@@ -7,6 +7,10 @@ import (
"time"
)
// NOTE: allow the user to create custom data things. For example, iRacing provides
// multiple surface temps, but I guess the user doesn't want all of them at once.
// allow him to make something that allows some data transformation to occur.
type FieldMapper struct {
SDKKey string
DataType DataType
@@ -124,7 +128,27 @@ const (
Speed FieldID = iota
RPM
Gear
// Engine Warnings
PitSpeedLimiter
// Adjustements
BrakeBias
ABSSetting
TCSetting
ThrottleSetting
// Tire Data
LFtempL
LFtempM
LFtempR
RFtempL
RFtempM
RFtempR
LRtempL
LRtempM
LRtempR
RRtempL
RRtempM
RRtempR
// Session Data
SessionTime
ReplaySessionTime
Empty
@@ -133,10 +157,30 @@ const (
const FirstField = Speed
var FieldNames = [MaxFields]string{
Speed: "Speed",
RPM: "RPM",
Gear: "Gear",
BrakeBias: "BrakeBias",
Speed: "Speed",
RPM: "RPM",
Gear: "Gear",
// Engine Warnings
PitSpeedLimiter: "Pit Speed Limiter",
// Ajustments
BrakeBias: "BrakeBias",
ABSSetting: "ABS Control",
TCSetting: "TC Control",
ThrottleSetting: "Throttle Control",
// Tire Data
LFtempL: "LF Surface Temp Left",
LFtempM: "LF Surface Temp Mid",
LFtempR: "LF Surface Temp Right",
RFtempL: "RF Surface Temp Left",
RFtempM: "RF Surface Temp Mid",
RFtempR: "RF Surface Temp Right",
LRtempL: "LR Surface Temp Left",
LRtempM: "LR Surface Temp Mid",
LRtempR: "LR Surface Temp Right",
RRtempL: "RR Surface Temp Left",
RRtempM: "RR Surface Temp Mid",
RRtempR: "RR Surface Temp Right",
// Session Data
SessionTime: "SessionTime",
ReplaySessionTime: "ReplaySessionTime",
Empty: "Emtpy",