|
|
@ -109,15 +109,16 @@ const WeatherWindSpeedUnits = { |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
const WeatherPressureUnits = { |
|
|
|
const WeatherPressureUnits = { |
|
|
|
hPa: 0, |
|
|
|
HPA: 0, |
|
|
|
inHg: 1, |
|
|
|
INHG: 1, |
|
|
|
bar: 2, |
|
|
|
BAR: 2, |
|
|
|
Pa: 3, |
|
|
|
PA: 3, |
|
|
|
kPa: 4, |
|
|
|
KPA: 4, |
|
|
|
atm: 5, |
|
|
|
ATM: 5, |
|
|
|
at: 6, |
|
|
|
AT: 6, |
|
|
|
Torr: 7, |
|
|
|
TORR: 7, |
|
|
|
psi: 8 |
|
|
|
PSI: 8, |
|
|
|
|
|
|
|
MMHG: 9 |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
const WeatherPosition = { |
|
|
|
const WeatherPosition = { |
|
|
@ -980,50 +981,55 @@ const OpenweatherMenuButton = new Lang.Class({ |
|
|
|
formatPressure: function(pressure) { |
|
|
|
formatPressure: function(pressure) { |
|
|
|
let pressure_unit = 'hPa'; |
|
|
|
let pressure_unit = 'hPa'; |
|
|
|
switch (this._pressure_units) { |
|
|
|
switch (this._pressure_units) { |
|
|
|
case WeatherPressureUnits.inHg: |
|
|
|
case WeatherPressureUnits.INHG: |
|
|
|
pressure = this.toInHg(pressure); |
|
|
|
pressure = this.toInHg(pressure); |
|
|
|
pressure_unit = "inHg"; |
|
|
|
pressure_unit = "inHg"; |
|
|
|
break; |
|
|
|
break; |
|
|
|
|
|
|
|
|
|
|
|
case WeatherPressureUnits.hPa: |
|
|
|
case WeatherPressureUnits.HPA: |
|
|
|
pressure = pressure.toFixed(this._decimal_places); |
|
|
|
pressure = pressure.toFixed(this._decimal_places); |
|
|
|
pressure_unit = "hPa"; |
|
|
|
pressure_unit = "hPa"; |
|
|
|
break; |
|
|
|
break; |
|
|
|
|
|
|
|
|
|
|
|
case WeatherPressureUnits.bar: |
|
|
|
case WeatherPressureUnits.BAR: |
|
|
|
pressure = (pressure / 1000).toFixed(this._decimal_places); |
|
|
|
pressure = (pressure / 1000).toFixed(this._decimal_places); |
|
|
|
pressure_unit = "bar"; |
|
|
|
pressure_unit = "bar"; |
|
|
|
break; |
|
|
|
break; |
|
|
|
|
|
|
|
|
|
|
|
case WeatherPressureUnits.Pa: |
|
|
|
case WeatherPressureUnits.PA: |
|
|
|
pressure = (pressure * 100).toFixed(this._decimal_places); |
|
|
|
pressure = (pressure * 100).toFixed(this._decimal_places); |
|
|
|
pressure_unit = "Pa"; |
|
|
|
pressure_unit = "Pa"; |
|
|
|
break; |
|
|
|
break; |
|
|
|
|
|
|
|
|
|
|
|
case WeatherPressureUnits.kPa: |
|
|
|
case WeatherPressureUnits.KPA: |
|
|
|
pressure = (pressure / 10).toFixed(this._decimal_places); |
|
|
|
pressure = (pressure / 10).toFixed(this._decimal_places); |
|
|
|
pressure_unit = "kPa"; |
|
|
|
pressure_unit = "kPa"; |
|
|
|
break; |
|
|
|
break; |
|
|
|
|
|
|
|
|
|
|
|
case WeatherPressureUnits.atm: |
|
|
|
case WeatherPressureUnits.ATM: |
|
|
|
pressure = (pressure * 0.000986923267).toFixed(this._decimal_places); |
|
|
|
pressure = (pressure * 0.000986923267).toFixed(this._decimal_places); |
|
|
|
pressure_unit = "atm"; |
|
|
|
pressure_unit = "atm"; |
|
|
|
break; |
|
|
|
break; |
|
|
|
|
|
|
|
|
|
|
|
case WeatherPressureUnits.at: |
|
|
|
case WeatherPressureUnits.AT: |
|
|
|
pressure = (pressure * 0.00101971621298).toFixed(this._decimal_places); |
|
|
|
pressure = (pressure * 0.00101971621298).toFixed(this._decimal_places); |
|
|
|
pressure_unit = "at"; |
|
|
|
pressure_unit = "at"; |
|
|
|
break; |
|
|
|
break; |
|
|
|
|
|
|
|
|
|
|
|
case WeatherPressureUnits.Torr: |
|
|
|
case WeatherPressureUnits.TORR: |
|
|
|
pressure = (pressure * 0.750061683).toFixed(this._decimal_places); |
|
|
|
pressure = (pressure * 0.750061683).toFixed(this._decimal_places); |
|
|
|
pressure_unit = "Torr"; |
|
|
|
pressure_unit = "Torr"; |
|
|
|
break; |
|
|
|
break; |
|
|
|
|
|
|
|
|
|
|
|
case WeatherPressureUnits.psi: |
|
|
|
case WeatherPressureUnits.PSI: |
|
|
|
pressure = (pressure * 0.0145037738).toFixed(this._decimal_places); |
|
|
|
pressure = (pressure * 0.0145037738).toFixed(this._decimal_places); |
|
|
|
pressure_unit = "psi"; |
|
|
|
pressure_unit = "psi"; |
|
|
|
break; |
|
|
|
break; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
case WeatherPressureUnits.MMHG: |
|
|
|
|
|
|
|
pressure = (pressure * 0.750061683).toFixed(this._decimal_places); |
|
|
|
|
|
|
|
pressure_unit = "mmHg"; |
|
|
|
|
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
return parseFloat(pressure).toLocaleString() + ' ' + pressure_unit; |
|
|
|
return parseFloat(pressure).toLocaleString() + ' ' + pressure_unit; |
|
|
|
}, |
|
|
|
}, |
|
|
|