SHWotever / SimHub

Multi sim dashboard, bass shaker driver, ....
http://www.simhubdash.com/
802 stars 98 forks source link

Improvement of temperature properties for ACC #1339

Closed kaiusl closed 1 year ago

kaiusl commented 1 year ago

Hello,

I have a small improvement in mind for ACC.

Is your feature request related to a problem? Please describe.

The temperature properties DataCorePlugin.GameData.RoadTemperature and DataCorePlugin.GameData.AirTemperature show 0 while the player is not on track (is in the pits with the menu up).

Describe the solution you'd like

This is inherently an issue with the temperatures reported by ACCs shared memory (so DataCorePlugin.GameRawData.Physics.RoadTemp and DataCorePlugin.GameRawData.Physics.AirTemp). However the data from broadcasting client shows the temperatures at all times (DataCorePlugin.GameRawData.Realtime.AmbientTemp and DataCorePlugin.GameRawData.Realtime.TrackTemp ). So the main temperature properties could use the data from the broadcasting client if the shared memory data reports 0s.

Right now the issue can be solved by little javascript

// Air temp
var t = $prop("DataCorePlugin.GameData.AirTemperature") // or $prop("DataCorePlugin.GameRawData.Physics.AirTemp")
if (t == 0) {
    return $prop("DataCorePlugin.GameRawData.Realtime.AmbientTemp")
} else {
    return t
}
// and similarly for track temp

This works fine but it would be much more convenient if DataCorePlugin.GameData.RoadTemperature and DataCorePlugin.GameData.AirTemperature would behave like it themselves. Also if someone doesn't know the specifics of ACCs data they would get the better temperature readings.

SHWotever commented 1 year ago

Hi !

Good point ! I changed it for the next version to fallback to the UDP data when shared memory does not give anything.