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: 1:
uiwindow: uiwindow:
Dims: Dims:
X0: 142 X0: 710
Y0: 19 Y0: 8
Width: 500 Width: 84
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
Height: 57 Height: 57
Decor: Decor:
BGColour: 4161 BGColour: 4161
@@ -42,12 +18,12 @@ Windows:
Opts: Opts:
ShowID: 0 ShowID: 0
WinType: 2 WinType: 2
PreviewValue: "61.4" PreviewValue: PIT
Title: BBias Title: Pit Sp
uidata: uidata:
WID: 2 WID: 1
TelemetryField: BrakeBias TelemetryField: Pit Speed Limiter
3: 2:
uiwindow: uiwindow:
Dims: Dims:
X0: 331 X0: 331
@@ -69,33 +45,9 @@ Windows:
PreviewValue: "234" PreviewValue: "234"
Title: SPEEDO Title: SPEEDO
uidata: uidata:
WID: 3 WID: 2
TelemetryField: Speed TelemetryField: Speed
4: 3:
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:
uiwindow: uiwindow:
Dims: Dims:
X0: 354 X0: 354
@@ -117,9 +69,9 @@ Windows:
PreviewValue: R PreviewValue: R
Title: Box Title: Box
uidata: uidata:
WID: 5 WID: 3
TelemetryField: Gear TelemetryField: Gear
6: 4:
uiwindow: uiwindow:
Dims: Dims:
X0: 9 X0: 9
@@ -141,9 +93,9 @@ Windows:
PreviewValue: "12" PreviewValue: "12"
Title: ABS Title: ABS
uidata: uidata:
WID: 6 WID: 4
TelemetryField: Emtpy TelemetryField: ABS Control
7: 5:
uiwindow: uiwindow:
Dims: Dims:
X0: 74 X0: 74
@@ -165,9 +117,9 @@ Windows:
PreviewValue: "12" PreviewValue: "12"
Title: TC Title: TC
uidata: uidata:
WID: 7 WID: 5
TelemetryField: Emtpy TelemetryField: TC Control
8: 6:
uiwindow: uiwindow:
Dims: Dims:
X0: 140 X0: 140
@@ -188,6 +140,54 @@ Windows:
WinType: 2 WinType: 2
PreviewValue: "6" PreviewValue: "6"
Title: Thr 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: uidata:
WID: 8 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 package iracing
// This file maps the data from the desktop provider data structure to iRacing
import ( import (
"esdi/telemetry" "esdi/telemetry"
) )
var internalToSDKFieldNames = map[telemetry.FieldID]string{ var internalToSDKFieldNames = map[telemetry.FieldID]string{
telemetry.Speed: "Speed", telemetry.Speed: "Speed",
telemetry.Gear: "Gear", telemetry.Gear: "Gear",
telemetry.RPM: "RPM", telemetry.RPM: "RPM",
telemetry.BrakeBias: "dcBrakeBias", // 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.SessionTime: "SessionTime",
telemetry.ReplaySessionTime: "ReplaySessionTime", telemetry.ReplaySessionTime: "ReplaySessionTime",
telemetry.Empty: "empty", 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 package iracing
import ( import (
@@ -187,7 +190,17 @@ func (i *IRacing) Subscribe(requestFields map[int16]telem.FieldID) {
out.Type = telem.DataTypeUINT16 out.Type = telem.DataTypeUINT16
out.Raw = uint64(uint16(v.(float32))) out.Raw = uint64(uint16(v.(float32)))
} }
case telem.PitSpeedLimiter:
binding.Transform = PitSpeedLimiterTransform
case telem.BrakeBias: 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) { binding.Transform = func(v any, out *telem.TelemetryField) {
out.Type = telem.DataTypeSTRING out.Type = telem.DataTypeSTRING
out.Str = strconv.FormatFloat(float64(v.(float32)), 'f', 1, 32) out.Str = strconv.FormatFloat(float64(v.(float32)), 'f', 1, 32)
+48 -4
View File
@@ -7,6 +7,10 @@ import (
"time" "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 { type FieldMapper struct {
SDKKey string SDKKey string
DataType DataType DataType DataType
@@ -124,7 +128,27 @@ const (
Speed FieldID = iota Speed FieldID = iota
RPM RPM
Gear Gear
// Engine Warnings
PitSpeedLimiter
// Adjustements
BrakeBias BrakeBias
ABSSetting
TCSetting
ThrottleSetting
// Tire Data
LFtempL
LFtempM
LFtempR
RFtempL
RFtempM
RFtempR
LRtempL
LRtempM
LRtempR
RRtempL
RRtempM
RRtempR
// Session Data
SessionTime SessionTime
ReplaySessionTime ReplaySessionTime
Empty Empty
@@ -133,10 +157,30 @@ const (
const FirstField = Speed const FirstField = Speed
var FieldNames = [MaxFields]string{ var FieldNames = [MaxFields]string{
Speed: "Speed", Speed: "Speed",
RPM: "RPM", RPM: "RPM",
Gear: "Gear", Gear: "Gear",
BrakeBias: "BrakeBias", // 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", SessionTime: "SessionTime",
ReplaySessionTime: "ReplaySessionTime", ReplaySessionTime: "ReplaySessionTime",
Empty: "Emtpy", Empty: "Emtpy",