Remove scaled
Scale was removed from phosphor-dbus-interfaces when moving to a
double.
https://github.com/openbmc/phosphor-dbus-interfaces/commit/4ec6587fa908fe9df41cc0962ab6ff6446fbd54f
A future improvement could be some sort of rounding.
Tested: Loaded GUI on a Witherspoon
Change-Id: I771e575c85cc97196678a1da8e01d1fdb96ddf8c
Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
diff --git a/app/common/services/api-utils.js b/app/common/services/api-utils.js
index 8e25b9c..f10476d 100644
--- a/app/common/services/api-utils.js
+++ b/app/common/services/api-utils.js
@@ -11,18 +11,6 @@
angular.module('app.common.services').factory('APIUtils', [
'$http', '$cookies', 'Constants', '$q', 'dataService', '$interval',
function($http, $cookies, Constants, $q, DataService, $interval) {
- var getScaledValue = function(value, scale) {
- scale = scale + '';
- scale = parseInt(scale, 10);
- var power = Math.abs(parseInt(scale, 10));
-
- if (scale > 0) {
- value = value * Math.pow(10, power);
- } else if (scale < 0) {
- value = value / Math.pow(10, power);
- }
- return value;
- };
var SERVICE = {
API_CREDENTIALS: Constants.API_CREDENTIALS,
API_RESPONSE: Constants.API_RESPONSE,
@@ -1013,20 +1001,6 @@
return prev + ' ' + el;
});
- content.data[key].Value = getScaledValue(
- content.data[key].Value, content.data[key].Scale);
- content.data[key].CriticalLow = getScaledValue(
- content.data[key].CriticalLow,
- content.data[key].Scale);
- content.data[key].CriticalHigh = getScaledValue(
- content.data[key].CriticalHigh,
- content.data[key].Scale);
- content.data[key].WarningLow = getScaledValue(
- content.data[key].WarningLow,
- content.data[key].Scale);
- content.data[key].WarningHigh = getScaledValue(
- content.data[key].WarningHigh,
- content.data[key].Scale);
if (Constants.SENSOR_SORT_ORDER.indexOf(
content.data[key].Unit) > -1) {
customOrder = Constants.SENSOR_SORT_ORDER.indexOf(
@@ -1748,9 +1722,7 @@
var json = JSON.stringify(response.data);
var content = JSON.parse(json);
- return getScaledValue(
- content.data.Value, content.data.Scale) +
- ' ' +
+ return content.data.Value + ' ' +
Constants.POWER_CONSUMPTION_TEXT[content.data.Unit];
},
function(error) {