knicholson32 / stratux_ahrs

AHRS Display for the Raspberry pi powered Stratux software
MIT License
18 stars 8 forks source link

Speed tape configuration values should respect the speed tape unit selection #23

Closed knicholson32 closed 4 years ago

knicholson32 commented 4 years ago

Describe the refactor proposal When entering aircraft speeds (arcs) into the speed tape configuration, the entered values should be represented by the specified unit entered. At the moment, the bands are configured in MPH regardless of what unit the speed tape actually uses. This is confusing and not applicable, as most aircraft use knots anyways.

Expected behavior The values entered into the speed tape configuration should match the speed tape unit. For example, if the unit is 'kts', all values in the configuration would be interpreted by the system as 'kts'.

Screenshots

/** ******************************** SPEED ********************************* **/
var speedTape = {
  lowerSpeed: 0, // <--- Here
  upperSpeed: 200, // <--- Here
  speeds: [
    // Speed color band configurations given in MPH
    {
      color: COLORS.WHITE,
      start: 55, // <--- Here
      end: 115   // <--- Here
    },
    {
      color: COLORS.GREEN,
      start: 64, // <--- Here
      end: 140   // <--- Here
    },
    {
      color: COLORS.YELLOW,
      start: 140, // <--- Here
      end: 171    // <--- Here
    },
    {
      color: COLORS.RED,
      start: 171, // <--- Here
      end: 200    // <--- Here
    }
  ],
  units: UNITS.MPH // <--- Based on this unit
};
/** ******************************** ***** ********************************* **/

Additional context Most airplanes these days use knots, not mph. It really doesn't make sense to lock it to those units, even though we can display any unit we want.