forked from andreasdahl1987/DahlDesignProperties
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDataPluginSettings.cs
123 lines (86 loc) · 4.45 KB
/
DataPluginSettings.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
using System.Collections.Generic;
using System.ComponentModel;
using System.Runtime.CompilerServices;
namespace DahlDesign.Plugin
{
/// <summary>
/// Settings class, make sure it can be correctly serialized using JSON.net
/// </summary>
public class DataPluginSettings : INotifyPropertyChanged
{
public int ReactionTime { get; set; } = 300;
public bool DDUEnabled { get; set; } = false;
public int DDUstartLED { get; set; } = 1;
public bool SW1Enabled { get; set; } = false;
public int SW1startLED { get; set; } = 30;
public bool SpotterEnable { get; set; } = false;
public bool DashLEDEnabled { get; set; } = false;
public bool LapInfoScreen { get; set; } = true;
public bool ShiftWarning { get; set; } = false;
public bool WheelSlipLEDs { get; set; } = false;
public bool FullTank { get; set; } = false;
public int SmallFuelIncrement { get; set; } = 2; //In Liters
public int LargeFuelIncrement { get; set; } = 10; //In Liters
public double FuelCalculationMargin { get; set; } = 0; //In liters
public double FuelCommandMargin { get; set; } = 0.5; //In liters
public bool CoupleInCarToPit { get; set; } = true; //Only allow pit commands when the in-car rotary is on Pit Mode.
public bool ShiftTimingAssist { get; set; } = false;
public string AheadPlayerText { get; set; } = "Blue flag";
public string BehindPlayerText { get; set; } = "Sorry!";
public string WheelBaseSteeringAxis { get; set; } = "";
public string myClutch { get; set; } = "";
public string myBitePoint { get; set; } = "";
public double WheelRevolutions { get; set; } = 1080;
public string DDC { get; set; } = "Arduino_Leonardo";
public bool DDCEnabled { get; set; } = false;
public bool DDCclutchEnabled { get; set; } = false;
public bool DDSEnabled { get; set; } = false;
public double fuelPerLapTarget { get; set; } = 2.50;
public bool fuelPerLapTargetLocked { get; set; } = false;
public bool fuelTargetLockOnTargetSet { get; set; } = false;
public double fuelOffsetIncrement { get; set; } = 0.01;
public bool SupercarSwapPosition { get; set; } = false;
public bool SupercarARBDirection { get; set; } = false;
public bool AngledCenterScreen { get; set; } = false;
public bool CorrectByPitstop { get; set; } = false;
public bool ShowMapEnabled { get; set; } = false;
public bool ShowBrakeThrottleGaugesEnabled { get; set; } = false;
public bool ShowGenericSplashEnabled {get;set;} = false;
public string DashType { get; set; } = "Automatic Selection";
public int LeftScreen { get; set; } = 1;
public int RightScreen { get; set; } = 1;
public string LeftPracticeScreen { get; set; } = "1";
public string RightPracticeScreen { get; set; } = "1";
public string LeftQualyScreen { get; set; } = "1";
public string RightQualyScreen { get; set; } = "1";
public string LeftRaceScreen { get; set; } = "1";
public string RightRaceScreen { get; set; } = "1";
public int DeltaScreen { get; set; } = 1;
public string DeltaScreenStartup { get; set; } = "1";
public double DeltaRoadSensitivity { get; set; } = 2.5;
public double DeltaOvalSensitivity { get; set; } = 0.2;
public double DeltaRallySensitivity { get; set; } = 1.5;
#region Property supporting UI refresh from code
/*
private string _FilePath;
public string FilePath
{
get => _FilePath;
set => SetField(ref _FilePath, value);
}
*/
#endregion
#region Utilities methods to refresh the UI see https://docs.microsoft.com/en-us/dotnet/api/system.componentmodel.inotifypropertychanged?view=netframework-4.7.2
protected void OnPropertyChanged(string propertyName)
=> PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
protected bool SetField<T>(ref T field, T value, [CallerMemberName] string propertyName = null)
{
if (EqualityComparer<T>.Default.Equals(field, value)) return false;
field = value;
OnPropertyChanged(propertyName);
return true;
}
public event PropertyChangedEventHandler PropertyChanged;
#endregion
}
}