Skip to content

Commit

Permalink
Fixed fuel warning field.
Browse files Browse the repository at this point in the history
  • Loading branch information
nlhans committed Feb 23, 2015
1 parent 0c0f63f commit 11dc2b7
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion ets2-client/C#/Ets2SdkClient/Ets2SdkData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ public struct Ets2SdkData
[FieldOffset(608)]
public float brakeTemperature;
[FieldOffset(612)]
public float fuelWarning;
public int fuelWarning;
[FieldOffset(616)]
public float adblue;
[FieldOffset(620)]
Expand Down
5 changes: 4 additions & 1 deletion ets2-client/C#/Ets2SdkClient/Ets2Telemetry.cs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,10 @@ public class _Drivetrain

public float Fuel { get; internal set; }
public float FuelMax { get; internal set; }

// Deprecated: was never actually functional
public float FuelWarning { get; internal set; }
public bool FuelWarningLight { get; internal set; }
public float FuelRate { get; internal set; }
public float FuelAvgConsumption { get; internal set; }

Expand Down Expand Up @@ -244,7 +247,7 @@ public Ets2Telemetry(Ets2SdkData raw, Ets2SdkUnmanaged rawUnmanaged)
Drivetrain.FuelAvgConsumption = raw.fuelAvgConsumption;
Drivetrain.FuelMax = raw.fuelCapacity;
Drivetrain.FuelRate = raw.fuelRate;
Drivetrain.FuelWarning = raw.fuelWarning;
Drivetrain.FuelWarningLight = raw.fuelWarning == 0 ? false : true;

Drivetrain.Gear = raw.gear;
Drivetrain.GearRange = raw.gearRangeActive;
Expand Down
2 changes: 1 addition & 1 deletion ets2-telemetry/inc/ets2-telemetry-common.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ typedef struct ets2TelemetryMap_s

float airPressure;
float brakeTemperature;
float fuelWarning;
int fuelWarning;
float adblue;
float adblueConsumption;
float oilPressure;
Expand Down
2 changes: 1 addition & 1 deletion ets2-telemetry/src/ets2-telemetry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,7 @@ SCSAPI_RESULT scs_telemetry_init(const scs_u32_t version, const scs_telemetry_in
// Floats
registerChannel(TRUCK_CHANNEL_brake_air_pressure, float, telemPtr->tel_rev3.airPressure);
registerChannel(TRUCK_CHANNEL_brake_temperature, float, telemPtr->tel_rev3.brakeTemperature);
registerChannel(TRUCK_CHANNEL_fuel_warning, float, telemPtr->tel_rev3.fuelWarning);
registerChannel(TRUCK_CHANNEL_fuel_warning, bool, telemPtr->tel_rev3.fuelWarning);
registerChannel(TRUCK_CHANNEL_adblue, float, telemPtr->tel_rev3.adblue);
registerChannel(TRUCK_CHANNEL_adblue_average_consumption, float, telemPtr->tel_rev3.adblueConsumption);
registerChannel(TRUCK_CHANNEL_oil_pressure, float, telemPtr->tel_rev3.oilPressure);
Expand Down

0 comments on commit 11dc2b7

Please sign in to comment.