mirror of
https://github.com/Artemis-RGB/Artemis
synced 2026-01-02 10:43:31 +00:00
Created F1 2017 datamodel
This commit is contained in:
parent
9fc703196b
commit
0eda28424f
@ -9,8 +9,15 @@ namespace Artemis.Modules.Games.FormulaOne2017
|
|||||||
{
|
{
|
||||||
public FormulaOne2017DataModel()
|
public FormulaOne2017DataModel()
|
||||||
{
|
{
|
||||||
|
Car = new Car();
|
||||||
|
Session = new Session();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Car Car { get; set; }
|
||||||
|
public Session Session { get; set; }
|
||||||
|
|
||||||
|
#region Native structs
|
||||||
|
|
||||||
[StructLayout(LayoutKind.Sequential)]
|
[StructLayout(LayoutKind.Sequential)]
|
||||||
public struct UdpPacketData
|
public struct UdpPacketData
|
||||||
{
|
{
|
||||||
@ -65,10 +72,8 @@ namespace Artemis.Modules.Games.FormulaOne2017
|
|||||||
public float m_sector; // 0 = sector1, 1 = sector2; 2 = sector3
|
public float m_sector; // 0 = sector1, 1 = sector2; 2 = sector3
|
||||||
public float m_sector1_time; // time of sector1 (or 0)
|
public float m_sector1_time; // time of sector1 (or 0)
|
||||||
public float m_sector2_time; // time of sector2 (or 0)
|
public float m_sector2_time; // time of sector2 (or 0)
|
||||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 4)]
|
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 4)] public float[] m_brakes_temp; // brakes temperature (centigrade)
|
||||||
public float[] m_brakes_temp; // brakes temperature (centigrade)
|
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 4)] public float[] m_wheels_pressure; // wheels pressure PSI
|
||||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 4)]
|
|
||||||
public float[] m_wheels_pressure; // wheels pressure PSI
|
|
||||||
public float m_team_info; // team ID
|
public float m_team_info; // team ID
|
||||||
public float m_total_laps; // total number of laps in this race
|
public float m_total_laps; // total number of laps in this race
|
||||||
public float m_track_size; // track size meters
|
public float m_track_size; // track size meters
|
||||||
@ -82,8 +87,99 @@ namespace Artemis.Modules.Games.FormulaOne2017
|
|||||||
public float m_vehicleFIAFlags; // -1 = invalid/unknown, 0 = none, 1 = green, 2 = blue, 3 = yellow, 4 = red
|
public float m_vehicleFIAFlags; // -1 = invalid/unknown, 0 = none, 1 = green, 2 = blue, 3 = yellow, 4 = red
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
}
|
||||||
|
|
||||||
|
public class Car
|
||||||
|
{
|
||||||
|
public Car()
|
||||||
|
{
|
||||||
|
Overview = new CarOverview();
|
||||||
|
Details = new CarDetails();
|
||||||
|
}
|
||||||
|
|
||||||
|
public CarOverview Overview { get; set; }
|
||||||
|
public CarDetails Details { get; set; }
|
||||||
|
|
||||||
|
public float SpeedMps { get; set; }
|
||||||
|
|
||||||
|
public float Steering { get; set; }
|
||||||
|
public float Throttle { get; set; }
|
||||||
|
public float Brake { get; set; }
|
||||||
|
public float Clutch { get; set; }
|
||||||
|
|
||||||
|
public bool Drs { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class CarDetails
|
||||||
|
{
|
||||||
public float Rpm { get; set; }
|
public float Rpm { get; set; }
|
||||||
public float MaxRpm { get; set; }
|
public float MaxRpm { get; set; }
|
||||||
public float IdleRpm { get; set; }
|
public float IdleRpm { get; set; }
|
||||||
|
|
||||||
|
public int Gear { get; set; }
|
||||||
|
public int MaxGear { get; set; }
|
||||||
|
|
||||||
|
public float Kers { get; set; }
|
||||||
|
public float MaxKers { get; set; }
|
||||||
|
|
||||||
|
public float Fuel { get; set; }
|
||||||
|
public float MaxFuel { get; set; }
|
||||||
|
|
||||||
|
public float LateralG { get; set; }
|
||||||
|
public float LongitudeG { get; set; }
|
||||||
|
|
||||||
|
public float WheelSpeedFrontLeft { get; set; }
|
||||||
|
public float WheelSpeedFrontRight { get; set; }
|
||||||
|
public float WheelSpeedRearLeft { get; set; }
|
||||||
|
public float WheelSpeedRearRight { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class CarOverview
|
||||||
|
{
|
||||||
|
public TractionControl TractionControl { get; set; }
|
||||||
|
public bool AntiLockBrakes { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public enum TractionControl
|
||||||
|
{
|
||||||
|
Off = 0,
|
||||||
|
Medium = 1,
|
||||||
|
High = 2
|
||||||
|
}
|
||||||
|
|
||||||
|
public class Session
|
||||||
|
{
|
||||||
|
public SessionType SessionType { get; set; }
|
||||||
|
public bool DrsEnabled { get; set; }
|
||||||
|
public SessionFlag Flags { get; set; }
|
||||||
|
|
||||||
|
public float TotalSeconds { get; set; }
|
||||||
|
public float LapSeconds { get; set; }
|
||||||
|
|
||||||
|
public float TrackLength { get; set; }
|
||||||
|
public float TotalDistance { get; set; }
|
||||||
|
public float LapDistance { get; set; }
|
||||||
|
|
||||||
|
public int LabNumber { get; set; }
|
||||||
|
public int Position { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public enum SessionFlag
|
||||||
|
{
|
||||||
|
Unknown = -1,
|
||||||
|
None = 0,
|
||||||
|
Green = 1,
|
||||||
|
Blue = 2,
|
||||||
|
Yellow = 3,
|
||||||
|
Red = 4
|
||||||
|
}
|
||||||
|
|
||||||
|
public enum SessionType
|
||||||
|
{
|
||||||
|
Unknown,
|
||||||
|
Practise,
|
||||||
|
Qualifying,
|
||||||
|
Race
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -55,9 +55,9 @@ namespace Artemis.Modules.Games.FormulaOne2017
|
|||||||
var msg = (FormulaOne2017DataModel.UdpPacketData) Marshal.PtrToStructure(pinnedPacket.AddrOfPinnedObject(), typeof(FormulaOne2017DataModel.UdpPacketData));
|
var msg = (FormulaOne2017DataModel.UdpPacketData) Marshal.PtrToStructure(pinnedPacket.AddrOfPinnedObject(), typeof(FormulaOne2017DataModel.UdpPacketData));
|
||||||
pinnedPacket.Free();
|
pinnedPacket.Free();
|
||||||
|
|
||||||
dataModel.Rpm = msg.m_engineRate;
|
// dataModel.Rpm = msg.m_engineRate;
|
||||||
dataModel.MaxRpm = msg.m_max_rpm;
|
// dataModel.MaxRpm = msg.m_max_rpm;
|
||||||
dataModel.IdleRpm = msg.m_idle_rpm;
|
// dataModel.IdleRpm = msg.m_idle_rpm;
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void Dispose()
|
public override void Dispose()
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user