Commit 76f82b00 by Daniel Lee Committed by GitHub

Merge pull request #7554 from ryantxu/kbn_physics

Add more physics units
parents 73bec813 7867a24d
......@@ -459,11 +459,19 @@ function($, _) {
kbn.valueFormats.humidity = kbn.formatBuilders.fixedUnit('%H');
// Pressure
kbn.valueFormats.pressurembar = kbn.formatBuilders.fixedUnit('mbar');
kbn.valueFormats.pressurebar = kbn.formatBuilders.decimalSIPrefix('bar');
kbn.valueFormats.pressurembar = kbn.formatBuilders.decimalSIPrefix('bar', -1);
kbn.valueFormats.pressurekbar = kbn.formatBuilders.decimalSIPrefix('bar', 1);
kbn.valueFormats.pressurehpa = kbn.formatBuilders.fixedUnit('hPa');
kbn.valueFormats.pressurehg = kbn.formatBuilders.fixedUnit('"Hg');
kbn.valueFormats.pressurepsi = kbn.formatBuilders.scaledUnits(1000, [' psi', ' ksi', ' Mpsi']);
// Force
kbn.valueFormats.forceNm = kbn.formatBuilders.decimalSIPrefix('Nm');
kbn.valueFormats.forcekNm = kbn.formatBuilders.decimalSIPrefix('Nm', 1);
kbn.valueFormats.forceN = kbn.formatBuilders.decimalSIPrefix('N');
kbn.valueFormats.forcekN = kbn.formatBuilders.decimalSIPrefix('N', 1);
// Length
kbn.valueFormats.lengthm = kbn.formatBuilders.decimalSIPrefix('m');
kbn.valueFormats.lengthmm = kbn.formatBuilders.decimalSIPrefix('m', -1);
......@@ -480,6 +488,13 @@ function($, _) {
kbn.valueFormats.litre = kbn.formatBuilders.decimalSIPrefix('L');
kbn.valueFormats.mlitre = kbn.formatBuilders.decimalSIPrefix('L', -1);
kbn.valueFormats.m3 = kbn.formatBuilders.decimalSIPrefix('m3');
kbn.valueFormats.gallons = kbn.formatBuilders.fixedUnit('gal');
// Flow
kbn.valueFormats.flowgpm = kbn.formatBuilders.fixedUnit('gpm');
kbn.valueFormats.flowcms = kbn.formatBuilders.fixedUnit('cms');
kbn.valueFormats.flowcfs = kbn.formatBuilders.fixedUnit('cfs');
kbn.valueFormats.flowcfm = kbn.formatBuilders.fixedUnit('cfm');
// Time
kbn.valueFormats.hertz = kbn.formatBuilders.decimalSIPrefix('Hz');
......@@ -790,9 +805,10 @@ function($, _) {
{
text: 'volume',
submenu: [
{text: 'millilitre', value: 'mlitre'},
{text: 'litre', value: 'litre' },
{text: 'cubic metre', value: 'm3' },
{text: 'millilitre', value: 'mlitre' },
{text: 'litre', value: 'litre' },
{text: 'cubic metre', value: 'm3' },
{text: 'gallons', value: 'gallons'},
]
},
{
......@@ -827,10 +843,30 @@ function($, _) {
text: 'pressure',
submenu: [
{text: 'Millibars', value: 'pressurembar'},
{text: 'Bars', value: 'pressurebar' },
{text: 'Kilobars', value: 'pressurekbar'},
{text: 'Hectopascals', value: 'pressurehpa' },
{text: 'Inches of mercury', value: 'pressurehg' },
{text: 'PSI', value: 'pressurepsi' },
]
},
{
text: 'force',
submenu: [
{text: 'Newton-meters (Nm)', value: 'forceNm' },
{text: 'Kilonewton-meters (kNm)', value: 'forcekNm' },
{text: 'Newtons (N)', value: 'forceN' },
{text: 'Kilonewtons (kN)', value: 'forcekN' },
]
},
{
text: 'flow',
submenu: [
{text: 'Gallons/min (gpm)', value: 'flowgpm' },
{text: 'Cubic meters/sec (cms)', value: 'flowcms' },
{text: 'Cubic feet/sec (cfs)', value: 'flowcfs' },
{text: 'Cubic feet/min (cfm)', value: 'flowcfm' },
]
}
];
};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment