From e00f9611f4f0d75b616c568ee971260a2d5c4e4b Mon Sep 17 00:00:00 2001 From: Axel Voitier Date: Sat, 13 Feb 2016 19:23:30 +0100 Subject: [PATCH] Adding units volt-ampere (VA), kilovolt-ampere (kVA) and volt-ampere reactive (var). --- public/app/core/utils/kbn.js | 38 +++++++++++++++++++++--------------- 1 file changed, 22 insertions(+), 16 deletions(-) diff --git a/public/app/core/utils/kbn.js b/public/app/core/utils/kbn.js index 959de5fa42a..fbb854148f9 100644 --- a/public/app/core/utils/kbn.js +++ b/public/app/core/utils/kbn.js @@ -358,14 +358,17 @@ function($, _) { kbn.valueFormats.iops = kbn.formatBuilders.simpleCountUnit('iops'); // Energy - kbn.valueFormats.watt = kbn.formatBuilders.decimalSIPrefix('W'); - kbn.valueFormats.kwatt = kbn.formatBuilders.decimalSIPrefix('W', 1); - kbn.valueFormats.watth = kbn.formatBuilders.decimalSIPrefix('Wh'); - kbn.valueFormats.kwatth = kbn.formatBuilders.decimalSIPrefix('Wh', 1); - kbn.valueFormats.joule = kbn.formatBuilders.decimalSIPrefix('J'); - kbn.valueFormats.ev = kbn.formatBuilders.decimalSIPrefix('eV'); - kbn.valueFormats.amp = kbn.formatBuilders.decimalSIPrefix('A'); - kbn.valueFormats.volt = kbn.formatBuilders.decimalSIPrefix('V'); + kbn.valueFormats.watt = kbn.formatBuilders.decimalSIPrefix('W'); + kbn.valueFormats.kwatt = kbn.formatBuilders.decimalSIPrefix('W', 1); + kbn.valueFormats.voltamp = kbn.formatBuilders.decimalSIPrefix('VA'); + kbn.valueFormats.kvoltamp = kbn.formatBuilders.decimalSIPrefix('VA', 1); + kbn.valueFormats.voltampreact = kbn.formatBuilders.decimalSIPrefix('var'); + kbn.valueFormats.watth = kbn.formatBuilders.decimalSIPrefix('Wh'); + kbn.valueFormats.kwatth = kbn.formatBuilders.decimalSIPrefix('Wh', 1); + kbn.valueFormats.joule = kbn.formatBuilders.decimalSIPrefix('J'); + kbn.valueFormats.ev = kbn.formatBuilders.decimalSIPrefix('eV'); + kbn.valueFormats.amp = kbn.formatBuilders.decimalSIPrefix('A'); + kbn.valueFormats.volt = kbn.formatBuilders.decimalSIPrefix('V'); // Temperature kbn.valueFormats.celsius = kbn.formatBuilders.fixedUnit('°C'); @@ -636,14 +639,17 @@ function($, _) { { text: 'energy', submenu: [ - {text: 'watt (W)', value: 'watt' }, - {text: 'kilowatt (kW)', value: 'kwatt' }, - {text: 'watt-hour (Wh)', value: 'watth' }, - {text: 'kilowatt-hour (kWh)', value: 'kwatth'}, - {text: 'joule (J)', value: 'joule' }, - {text: 'electron volt (eV)', value: 'ev' }, - {text: 'Ampere (A)', value: 'amp' }, - {text: 'Volt (V)', value: 'volt' }, + {text: 'watt (W)', value: 'watt' }, + {text: 'kilowatt (kW)', value: 'kwatt' }, + {text: 'volt-ampere (VA)', value: 'voltamp' }, + {text: 'kilovolt-ampere (kVA)', value: 'kvoltamp' }, + {text: 'volt-ampere reactive (var)', value: 'voltampreact'}, + {text: 'watt-hour (Wh)', value: 'watth' }, + {text: 'kilowatt-hour (kWh)', value: 'kwatth' }, + {text: 'joule (J)', value: 'joule' }, + {text: 'electron volt (eV)', value: 'ev' }, + {text: 'Ampere (A)', value: 'amp' }, + {text: 'Volt (V)', value: 'volt' }, ] }, {