AirControl  1.3.0
Open Source, Modular, and Extensible Flight Simulator For Deep Learning Research
AirControl.AC_Airplane_Airspeed Class Reference

Monitor and updates the Airspeed to UI More...

Inheritance diagram for AirControl.AC_Airplane_Airspeed:
Collaboration diagram for AirControl.AC_Airplane_Airspeed:

Public Member Functions

void HandleAirplaneUI ()
 Updates to UI More...
 

Public Attributes

RectTransform pointer
 
float maxIndicatedKnots = 200f
 

Static Public Attributes

const float mphToKnts = 0.868976f
 

Detailed Description

Monitor and updates the Airspeed to UI

Definition at line 12 of file AC_Airplane_Airspeed.cs.

Member Function Documentation

◆ HandleAirplaneUI()

void AirControl.AC_Airplane_Airspeed.HandleAirplaneUI ( )
inline

Updates to UI

Implements AirControl.IAirplaneUI.

Definition at line 36 of file AC_Airplane_Airspeed.cs.

37  {
38  if(characteristics && pointer)
39  {
40  currentKnots = characteristics.MPH * mphToKnts;
41  //Debug.Log(currentKnots);
42 
43  float normalizedKnots = Mathf.InverseLerp(0f, maxIndicatedKnots, currentKnots);
44  float wantedRotation = 360f * normalizedKnots;
45  pointer.rotation = Quaternion.Euler(0f, 0f, -wantedRotation);
46  }
47 
48  #region DBArea
49  StaticOutputSchema.CurrentSpeed = currentKnots;
50  //Set value of AGL and MSL to DB
51  // DB_Functions.SetSpeed(connection, currentKnots);
52  #endregion
53  }

The documentation for this class was generated from the following file: