added some fields

This commit is contained in:
2026-03-15 00:19:04 +00:00
parent f50fc7a87b
commit 7f0ab21a61
7 changed files with 178 additions and 139 deletions
+148 -124
View File
@@ -1,125 +1,5 @@
Windows:
7:
uiwindow:
Dims:
X0: 331
Y0: 190
Width: 116
Height: 70
Decor:
BGColour: 4161
FGColour: 65535
TitleColour: 65535
BorderColour: 63488
TitleSize: 2
TextSize: 6
HasBorder: 1
Padding: 0
Opts:
ShowID: 0
WinType: 2
PreviewValue: "234"
Title: SPEEDO
uidata:
WID: 7
TelemetryField: Speed
8:
uiwindow:
Dims:
X0: 354
Y0: 71
Width: 74
Height: 111
Decor:
BGColour: 4161
FGColour: 65535
TitleColour: 65535
BorderColour: 63488
TitleSize: 2
TextSize: 12
HasBorder: 1
Padding: 0
Opts:
ShowID: 0
WinType: 2
PreviewValue: R
Title: Box
uidata:
WID: 8
TelemetryField: Gear
9:
uiwindow:
Dims:
X0: 9
Y0: 413
Width: 57
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: "12"
Title: ABS
uidata:
WID: 9
TelemetryField: Emtpy
10:
uiwindow:
Dims:
X0: 74
Y0: 413
Width: 57
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: "12"
Title: TC
uidata:
WID: 10
TelemetryField: Emtpy
11:
uiwindow:
Dims:
X0: 140
Y0: 412
Width: 57
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: "6"
Title: Thr
uidata:
WID: 11
TelemetryField: Emtpy
12:
1:
uiwindow:
Dims:
X0: 142
@@ -141,9 +21,9 @@ Windows:
PreviewValue: "5678"
Title: TACHO
uidata:
WID: 12
WID: 1
TelemetryField: RPM
13:
2:
uiwindow:
Dims:
X0: 207
@@ -165,5 +45,149 @@ Windows:
PreviewValue: "61.4"
Title: BBias
uidata:
WID: 13
WID: 2
TelemetryField: BrakeBias
3:
uiwindow:
Dims:
X0: 331
Y0: 190
Width: 116
Height: 70
Decor:
BGColour: 4161
FGColour: 65535
TitleColour: 65535
BorderColour: 63488
TitleSize: 2
TextSize: 6
HasBorder: 1
Padding: 0
Opts:
ShowID: 0
WinType: 2
PreviewValue: "234"
Title: SPEEDO
uidata:
WID: 3
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:
uiwindow:
Dims:
X0: 354
Y0: 71
Width: 74
Height: 111
Decor:
BGColour: 4161
FGColour: 65535
TitleColour: 65535
BorderColour: 63488
TitleSize: 2
TextSize: 12
HasBorder: 1
Padding: 0
Opts:
ShowID: 0
WinType: 2
PreviewValue: R
Title: Box
uidata:
WID: 5
TelemetryField: Gear
6:
uiwindow:
Dims:
X0: 9
Y0: 413
Width: 57
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: "12"
Title: ABS
uidata:
WID: 6
TelemetryField: Emtpy
7:
uiwindow:
Dims:
X0: 74
Y0: 413
Width: 57
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: "12"
Title: TC
uidata:
WID: 7
TelemetryField: Emtpy
8:
uiwindow:
Dims:
X0: 140
Y0: 412
Width: 57
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: "6"
Title: Thr
uidata:
WID: 8
TelemetryField: Emtpy
+7 -5
View File
@@ -5,9 +5,11 @@ import (
)
var internalToSDKFieldNames = map[telemetry.FieldID]string{
telemetry.Speed: "Speed",
telemetry.Gear: "Gear",
telemetry.RPM: "RPM",
telemetry.BrakeBias: "dcBrakeBias",
telemetry.Empty: "empty",
telemetry.Speed: "Speed",
telemetry.Gear: "Gear",
telemetry.RPM: "RPM",
telemetry.BrakeBias: "dcBrakeBias",
telemetry.SessionTime: "SessionTime",
telemetry.ReplaySessionTime: "ReplaySessionTime",
telemetry.Empty: "empty",
}
+13 -2
View File
@@ -60,7 +60,8 @@ func NewIRacingProvider(
SDK: sdk,
data: telem.NewTelemetryData(),
streamCh: make(chan telem.TelemetryData),
ticker: time.NewTicker(time.Second / 60),
// NOTE: This is because I stupidly recorded a test IBT file in 240
ticker: time.NewTicker(time.Second / 240),
}, nil
}
@@ -92,7 +93,7 @@ func (i *IRacing) readData() {
var err error
_, err = i.SDK.Update(time.Millisecond * 100)
_, err = i.SDK.Update(time.Millisecond * 16)
if err != nil {
return
}
@@ -191,6 +192,16 @@ func (i *IRacing) Subscribe(requestFields map[int16]telem.FieldID) {
out.Type = telem.DataTypeSTRING
out.Str = strconv.FormatFloat(float64(v.(float32)), 'f', 1, 32)
}
case telem.SessionTime:
binding.Transform = func(v any, out *telem.TelemetryField) {
out.Type = telem.DataTypeSTRING
out.Str = strconv.FormatFloat(v.(float64), 'f', 1, 32)
}
case telem.ReplaySessionTime:
binding.Transform = func(v any, out *telem.TelemetryField) {
out.Type = telem.DataTypeSTRING
out.Str = strconv.FormatFloat(v.(float64), 'f', 1, 32)
}
case telem.Empty:
binding.Transform = func(v any, out *telem.TelemetryField) {
out.Type = telem.DataTypeCHAR
+9 -5
View File
@@ -125,17 +125,21 @@ const (
RPM
Gear
BrakeBias
SessionTime
ReplaySessionTime
Empty
MaxFields
)
const FirstField = Speed
var FieldNames = [MaxFields]string{
Speed: "Speed",
RPM: "RPM",
Gear: "Gear",
BrakeBias: "BrakeBias",
Empty: "Emtpy",
Speed: "Speed",
RPM: "RPM",
Gear: "Gear",
BrakeBias: "BrakeBias",
SessionTime: "SessionTime",
ReplaySessionTime: "ReplaySessionTime",
Empty: "Emtpy",
}
func GetFieldName(id FieldID) string {
-1
View File
@@ -77,7 +77,6 @@ func (sc *StreamingCtrl) Start() {
isDrawing.Store(true)
sc.App.QueueUpdateDraw(func() {
sc.Messages <- fmt.Sprintf("got data: %+v\n", &msg)
sc.StreamView.Update(&msg)
isDrawing.Store(false)
})
-1
View File
@@ -96,7 +96,6 @@ func (cds *CDashService) StreamData(stream <-chan telemetry.TelemetryData) {
var isSending atomic.Bool
go func() {
for msg := range stream {
if isSending.Load() {
continue
+1 -1
View File
@@ -23,7 +23,7 @@ func NewTelemetryService(logger *slog.Logger, cdash *CDashService) *TelemetrySer
}
func (t *TelemetryService) setIRacingProvider() {
path := "/home/esilva/Desktop/projetos/simracing_peripherals/testTelemetry/supercars_indianapolis.ibt"
path := "/home/esilva/Desktop/projetos/simracing_peripherals/testTelemetry/gt3_mustang_bathurst.ibt"
provider, _ := providerir.NewIRacingProvider(t.logger, path, "", "")
t.ActiveProvider = provider