emahon / war-thunder-display

Repo for a test War Thunder display page
2 stars 0 forks source link

Fix altitude unit problems #26

Open emahon opened 3 years ago

emahon commented 3 years ago

Apparently indicator endpoint -> altitude_hour (and presumably altitude_minute and altitude_10k as well) shows different units depending on the plane:

P-36A: Feet F-5C: Feet Z.1007 bis serie 3: Meters G.91 R/4: Feet (???????)

Need to resolve so we get altitude for energy calculations in consistent units.

Potential solutions:

emahon commented 3 years ago

Went with solution 1 - got everything from the state endpoint, which is always in meters for altitude and km/h for TAS. This comes at the cost of only getting these values as integers, so some precision is lost, but I think it's acceptable.

emahon commented 3 years ago

Is it possible to extract the units from the HUD info somehow? maybe at start of match could compare to the state endpoint and determine unit by the factor? This would give us the precision and accuracy