Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
*.ibt filter=lfs diff=lfs merge=lfs -text
* text=auto eol=lf

*.ibt filter=lfs diff=lfs merge=lfs -text
1 change: 1 addition & 0 deletions Samples/DumpVariables_DumpSessionInfo/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
using SVappsLAB.iRacingTelemetrySDK;

namespace DumpVariables_DumpSessionInfo;

[RequiredTelemetryVars([TelemetryVar.RPM])]
internal class Program
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"profiles": {
"DumpVariables_DumpSessionInfo": {
"commandName": "Project",
"commandLineArgs": "\"..\\..\\..\\..\\data\\formulair04_tsukuba 2kfull 2024-01-09 17-26-10.ibt\""
}
}
{
"profiles": {
"DumpVariables_DumpSessionInfo": {
"commandName": "Project",
"commandLineArgs": "\"..\\..\\..\\..\\data\\formulair04_tsukuba 2kfull 2024-01-09 17-26-10.ibt\""
}
}
}
14 changes: 7 additions & 7 deletions Samples/LocationAndWarnings/Properties/launchSettings.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"profiles": {
"LocationAndWarnings": {
"commandName": "Project",
"commandLineArgs": "\"..\\..\\..\\..\\data\\formulair04_tsukuba 2kfull 2024-01-09 17-26-10.ibt\"\r\n"
}
}
{
"profiles": {
"LocationAndWarnings": {
"commandName": "Project",
"commandLineArgs": "\"..\\..\\..\\..\\data\\formulair04_tsukuba 2kfull 2024-01-09 17-26-10.ibt\"\r\n"
}
}
}
14 changes: 7 additions & 7 deletions Samples/SpeedRPMGear/Properties/launchSettings.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"profiles": {
"SpeedRPMGear": {
"commandName": "Project",
"commandLineArgs": "\"..\\..\\..\\..\\data\\formulair04_tsukuba 2kfull 2024-01-09 17-26-10.ibt\"\r\n"
}
}
{
"profiles": {
"SpeedRPMGear": {
"commandName": "Project",
"commandLineArgs": "\"..\\..\\..\\..\\data\\formulair04_tsukuba 2kfull 2024-01-09 17-26-10.ibt\"\r\n"
}
}
}
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"profiles": {
"Profile 1": {
"commandName": "DebugRoslynComponent",
"targetProject": "..\\tests\\IBT_Tests\\IBT_Tests.csproj"
}
}
{
"profiles": {
"Profile 1": {
"commandName": "DebugRoslynComponent",
"targetProject": "..\\tests\\IBT_Tests\\IBT_Tests.csproj"
}
}
}
42 changes: 21 additions & 21 deletions Sdk/SVappsLAB.iRacingTelemetrySDK.CodeGen/tools/README.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
# Tools
## vars
Some python scripts to help with the generation of the `iRacingData.cs` file used during code generation.
* findDistinctVars.py
Reads a glob of *.csv files (from various variable dumps of live and ibt files), and outputs a single CSV file with the unique/distinct set of variables
* csv-to-cs.py
Reads a CSV file of variables and outputs a snippet of C# code, that can be merged with the `iRacingData.cs` file
### usage
```bash
python findDistinctVars.py "variableDumps/*.csv" "distinctVars.csv"
python csv-to-cs.py "distinctVars.csv" "varDictData.cs"
```
use merge tool to manually merge `varDictData.cs` with `iRacingData.cs`
# Tools

## vars

Some python scripts to help with the generation of the `iRacingData.cs` file used during code generation.

* findDistinctVars.py

Reads a glob of *.csv files (from various variable dumps of live and ibt files), and outputs a single CSV file with the unique/distinct set of variables

* csv-to-cs.py

Reads a CSV file of variables and outputs a snippet of C# code, that can be merged with the `iRacingData.cs` file

### usage

```bash
python findDistinctVars.py "variableDumps/*.csv" "distinctVars.csv"
python csv-to-cs.py "distinctVars.csv" "varDictData.cs"
```
use merge tool to manually merge `varDictData.cs` with `iRacingData.cs`
2 changes: 1 addition & 1 deletion Sdk/SVappsLAB.iRacingTelemetrySDK/Constants.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ namespace SVappsLAB.iRacingTelemetrySDK;
internal static class Constants
{
public const string SDK_NAME = "SVappsLAB.iRacingTelemetrySDK";
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ public irsdk_header GetHeader()
}

if (_logger.IsEnabled(LogLevel.Debug))
LogLayoutIfChanged();
LogLayoutIfChanged();

return _header;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public override Task<bool> WaitForDataReady(TimeSpan timeSpan, CancellationToken
internal bool ProcessNewData()
{
// copy new data to the access buffer,
// validating data is good and no write was in progress
// validating data is good and no write was in progress
if (!TryCopyLiveTelemetryDataToBuffer(out var latestTickCount))
{
_logger.LogWarning("data changed while we were reading it. skipping this sample");
Expand Down
2 changes: 1 addition & 1 deletion Sdk/SVappsLAB.iRacingTelemetrySDK/TelemetryDataAccessor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public T CreateTelemetryDataSample(IDataProvider dataProvider)
}
catch (Exception ex)
{
_logger.LogWarning("Failed to set property {PropertyName} with value '{RawValue}': {Error}",
_logger.LogWarning("Failed to set property {PropertyName} with value '{RawValue}': {Error}",
accessor.PropertyName, rawValue, ex.Message);
}
}
Expand Down
3 changes: 2 additions & 1 deletion Sdk/tests/SmokeTests/Base/Base.cs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,8 @@ await client.Monitor(
Assert.True(telemetryData.CarIdxTrackSurface == null || telemetryData.CarIdxTrackSurface.Length >= 64);

// only need one sample
if (_variableSummary is null) {
if (_variableSummary is null)
{
var telemetryVars = client.GetTelemetryVariables();
var variableSummary = VariableSummary.Create(telemetryVars);
_variableSummary = variableSummary;
Expand Down
14 changes: 7 additions & 7 deletions Sdk/tests/SmokeTests/Properties/launchSettings.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"profiles": {
"SmokeTests": {
"commandName": "Project",
"commandLineArgs": "--filter-class \"SmokeTests.Live\""
}
}
{
"profiles": {
"SmokeTests": {
"commandName": "Project",
"commandLineArgs": "--filter-class \"SmokeTests.Live\""
}
}
}
4 changes: 2 additions & 2 deletions Sdk/tests/UnitTests/CodeGen/CodeGeneratorTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public class Program { }
Assert.Empty(telemetryData.GetMembers().OfType<IPropertySymbol>());

// the consumer program itself must compile cleanly
Assert.Empty(output.GetDiagnostics().Where(d => d.Severity == DiagnosticSeverity.Error));
Assert.Empty(output.GetDiagnostics(TestContext.Current.CancellationToken).Where(d => d.Severity == DiagnosticSeverity.Error));

// an informational diagnostic flags the (possibly accidental) empty list
var info = Assert.Single(diagnostics, d => d.Id == "EmptyVarList");
Expand All @@ -86,7 +86,7 @@ public class Program { }
Assert.Contains("Speed", properties);
Assert.Contains("RPM", properties);

Assert.Empty(output.GetDiagnostics().Where(d => d.Severity == DiagnosticSeverity.Error));
Assert.Empty(output.GetDiagnostics(TestContext.Current.CancellationToken).Where(d => d.Severity == DiagnosticSeverity.Error));
Assert.DoesNotContain(diagnostics, d => d.Id == "EmptyVarList");
}
}
Loading