Browse Source

UI: Updated unit definition

pull/13282/head
Vladyslav_Prykhodko 1 year ago
parent
commit
43488081fc
  1. 157
      ui-ngx/src/app/shared/models/unit.models.ts
  2. 37
      ui-ngx/src/app/shared/models/units/Magnetic-permeability.ts
  3. 8
      ui-ngx/src/app/shared/models/units/acceleration.ts
  4. 18
      ui-ngx/src/app/shared/models/units/air-quality-index.ts
  5. 32
      ui-ngx/src/app/shared/models/units/amount-of-substance.ts
  6. 20
      ui-ngx/src/app/shared/models/units/angle.ts
  7. 4
      ui-ngx/src/app/shared/models/units/angular-acceleration.ts
  8. 26
      ui-ngx/src/app/shared/models/units/area.ts
  9. 20
      ui-ngx/src/app/shared/models/units/blood-glucose.ts
  10. 34
      ui-ngx/src/app/shared/models/units/capacitance.ts
  11. 24
      ui-ngx/src/app/shared/models/units/catalytic-activity.ts
  12. 35
      ui-ngx/src/app/shared/models/units/catalytic-concentration.ts
  13. 16
      ui-ngx/src/app/shared/models/units/charge.ts
  14. 40
      ui-ngx/src/app/shared/models/units/concentration-gradient.ts
  15. 63
      ui-ngx/src/app/shared/models/units/concentration-volume.ts
  16. 26
      ui-ngx/src/app/shared/models/units/current-density.ts
  17. 25
      ui-ngx/src/app/shared/models/units/data-transfer-rate.ts
  18. 62
      ui-ngx/src/app/shared/models/units/density.ts
  19. 26
      ui-ngx/src/app/shared/models/units/digital.ts
  20. 35
      ui-ngx/src/app/shared/models/units/dimension-ratio.ts
  21. 21
      ui-ngx/src/app/shared/models/units/dimensionless-ratio.ts
  22. 30
      ui-ngx/src/app/shared/models/units/dynamic-viscosity.ts
  23. 18
      ui-ngx/src/app/shared/models/units/earthquake-magnitude.ts
  24. 22
      ui-ngx/src/app/shared/models/units/electric-current.ts
  25. 39
      ui-ngx/src/app/shared/models/units/electric-dipole-moment.ts
  26. 19
      ui-ngx/src/app/shared/models/units/electric-field-strength.ts
  27. 28
      ui-ngx/src/app/shared/models/units/electric-flux.ts
  28. 26
      ui-ngx/src/app/shared/models/units/electric-moment.ts
  29. 23
      ui-ngx/src/app/shared/models/units/electric-permittivity.ts
  30. 22
      ui-ngx/src/app/shared/models/units/electrical-conductance.ts
  31. 27
      ui-ngx/src/app/shared/models/units/electrical-conductivity.ts
  32. 26
      ui-ngx/src/app/shared/models/units/energy.ts
  33. 9
      ui-ngx/src/app/shared/models/units/force.ts
  34. 25
      ui-ngx/src/app/shared/models/units/frequency.ts
  35. 20
      ui-ngx/src/app/shared/models/units/fuel-efficiency.ts
  36. 26
      ui-ngx/src/app/shared/models/units/heat-capacity.ts
  37. 20
      ui-ngx/src/app/shared/models/units/humidity.ts
  38. 8
      ui-ngx/src/app/shared/models/units/illuminance.ts
  39. 16
      ui-ngx/src/app/shared/models/units/inductance.ts
  40. 26
      ui-ngx/src/app/shared/models/units/kinematic-viscosity.ts
  41. 50
      ui-ngx/src/app/shared/models/units/length.ts
  42. 24
      ui-ngx/src/app/shared/models/units/light-exposure.ts
  43. 24
      ui-ngx/src/app/shared/models/units/liner-charge-density.ts
  44. 45
      ui-ngx/src/app/shared/models/units/logarithmic-ratio.ts
  45. 29
      ui-ngx/src/app/shared/models/units/logarithmic-units.ts
  46. 24
      ui-ngx/src/app/shared/models/units/luminous-efficacy.ts
  47. 24
      ui-ngx/src/app/shared/models/units/luminous-flux.ts
  48. 24
      ui-ngx/src/app/shared/models/units/luminous-intensity.ts
  49. 23
      ui-ngx/src/app/shared/models/units/magnetic-field-gradient.ts
  50. 71
      ui-ngx/src/app/shared/models/units/magnetic-field.ts
  51. 84
      ui-ngx/src/app/shared/models/units/magnetic-flux-density.ts
  52. 31
      ui-ngx/src/app/shared/models/units/magnetic-flux.ts
  53. 28
      ui-ngx/src/app/shared/models/units/magnetic-moment.ts
  54. 40
      ui-ngx/src/app/shared/models/units/magnetic-permeability.ts
  55. 35
      ui-ngx/src/app/shared/models/units/mass-fraction.ts
  56. 32
      ui-ngx/src/app/shared/models/units/mass.ts
  57. 35
      ui-ngx/src/app/shared/models/units/molar-concentration.ts
  58. 23
      ui-ngx/src/app/shared/models/units/molar-energy.ts
  59. 23
      ui-ngx/src/app/shared/models/units/molar-heat-capacity.ts
  60. 19
      ui-ngx/src/app/shared/models/units/molar-mass.ts
  61. 35
      ui-ngx/src/app/shared/models/units/specific-humidity.ts
  62. 36
      ui-ngx/src/assets/locale/locale.constant-en_US.json

157
ui-ngx/src/app/shared/models/unit.models.ts

@ -15,21 +15,59 @@
///
import acceleration, { AccelerationUnits } from '@shared/models/units/acceleration';
import airQualityIndex, { AirQualityIndexUnits } from '@shared/models/units/air-quality-index';
import amountOfSubstance, { AmountOfSubstanceUnits } from '@shared/models/units/amount-of-substance';
import angle, { AngleUnits } from '@shared/models/units/angle';
import angularAcceleration, { AngularAccelerationUnits } from '@shared/models/units/angular-acceleration';
import area, { AreaUnits } from '@shared/models/units/area';
import capacitance, { CapacitanceUnits } from '@shared/models/units/capacitance';
import catalyticActivity, { CatalyticActivityUnits } from '@shared/models/units/catalytic-activity';
import catalyticConcentration, { CatalyticConcentrationUnits } from '@shared/models/units/catalytic-concentration';
import charge, { ChargeUnits } from '@shared/models/units/charge';
import currentDensity, { CurrentDensityUnits } from '@shared/models/units/current-density';
import dataTransferRate, { DataTransferRateUnits } from '@shared/models/units/data-transfer-rate';
import density, { DensityUnits } from '@shared/models/units/density';
import digital, { DigitalUnits } from '@shared/models/units/digital';
import dimensionRatio, { DimensionRatioUnits } from '@shared/models/units/dimension-ratio';
import dynamicViscosity, { DynamicViscosityUnits } from '@shared/models/units/dynamic-viscosity';
import earthquakeMagnitude, { EarthquakeMagnitudeUnits } from '@shared/models/units/earthquake-magnitude';
import electricCurrent, { ElectricCurrentUnits } from '@shared/models/units/electric-current';
import electricDipoleMoment, { ElectricDipoleMomentUnits } from '@shared/models/units/electric-dipole-moment';
import electricFieldStrength, { ElectricFieldStrengthUnits } from '@shared/models/units/electric-field-strength';
import electricFlux, { ElectricFluxUnits } from '@shared/models/units/electric-flux';
import electricPermittivity, { ElectricPermittivityUnits } from '@shared/models/units/electric-permittivity';
import electricalConductance, { ElectricalConductanceUnits } from '@shared/models/units/electrical-conductance';
import electricalConductivity, { ElectricalConductivityUnits } from '@shared/models/units/electrical-conductivity';
import energy, { EnergyUnits } from '@shared/models/units/energy';
import force, { ForceUnits } from '@shared/models/units/force';
import fuelEfficiency, { FuelEfficiencyUnits } from '@shared/models/units/fuel-efficiency';
import frequency, { FrequencyUnits } from '@shared/models/units/frequency';
import heatCapacity, { HeatCapacityUnits } from '@shared/models/units/heat-capacity';
import illuminance, { IlluminanceUnits } from '@shared/models/units/illuminance';
import inductance, { InductanceUnits } from '@shared/models/units/inductance';
import kinematicViscosity, { KinematicViscosityUnits } from '@shared/models/units/kinematic-viscosity';
import length, { LengthUnits } from '@shared/models/units/length';
import lightExposure, { LightExposureUnits } from '@shared/models/units/light-exposure';
import linerChargeDensity, { LinerChargeDensityUnits } from '@shared/models/units/liner-charge-density';
import logarithmicRatio, { LogarithmicRatioUnits } from '@shared/models/units/logarithmic-ratio';
import luminousEfficacy, { LuminousEfficacyUnits } from '@shared/models/units/luminous-efficacy';
import luminousFlux, { LuminousFluxUnits } from '@shared/models/units/luminous-flux';
import luminousIntensity, { LuminousIntensityUnits } from '@shared/models/units/luminous-intensity';
import magneticFieldGradient, { MagneticFieldGradientUnits } from '@shared/models/units/magnetic-field-gradient';
import magneticFlux, { MagneticFluxUnits } from '@shared/models/units/magnetic-flux';
import magneticFluxDensity, { MagneticFluxDensityUnits } from '@shared/models/units/magnetic-flux-density';
import magneticMoment, { MagneticMomentUnits } from '@shared/models/units/magnetic-moment';
import magneticPermeability, { MagneticPermeabilityUnits } from '@shared/models/units/magnetic-permeability';
import mass, { MassUnits } from '@shared/models/units/mass';
import massFraction, { MassFractionUnits } from '@shared/models/units/mass-fraction';
import molarConcentration, { MolarConcentrationUnits } from '@shared/models/units/molar-concentration';
import molarEnergy, { MolarEnergyUnits } from '@shared/models/units/molar-energy';
import molarHeatCapacity, { MolarHeatCapacityUnits } from '@shared/models/units/molar-heat-capacity';
import molarMass, { MolarMassUnits } from '@shared/models/units/molar-mass';
import partsPer, { PartsPerUnits } from '@shared/models/units/parts-per';
import power, { PowerUnits } from '@shared/models/units/power';
import pressure, { PressureUnits } from '@shared/models/units/pressure';
import specificHumidity, { SpecificHumidityUnits } from '@shared/models/units/specific-humidity';
import speed, { SpeedUnits } from '@shared/models/units/speed';
import temperature, { TemperatureUnits } from '@shared/models/units/temperature';
import time, { TimeUnits } from '@shared/models/units/time';
@ -41,21 +79,59 @@ import { TranslateService } from '@ngx-translate/core';
export type AllMeasuresUnits =
| AccelerationUnits
| AirQualityIndexUnits
| AmountOfSubstanceUnits
| AngleUnits
| AngularAccelerationUnits
| AreaUnits
| CapacitanceUnits
| CatalyticActivityUnits
| CatalyticConcentrationUnits
| ChargeUnits
| CurrentDensityUnits
| DataTransferRateUnits
| DensityUnits
| DigitalUnits
| DimensionRatioUnits
| DynamicViscosityUnits
| EarthquakeMagnitudeUnits
| ElectricCurrentUnits
| ElectricDipoleMomentUnits
| ElectricFieldStrengthUnits
| ElectricFluxUnits
| ElectricPermittivityUnits
| ElectricalConductanceUnits
| ElectricalConductivityUnits
| EnergyUnits
| ForceUnits
| FrequencyUnits
| FuelEfficiencyUnits
| HeatCapacityUnits
| IlluminanceUnits
| InductanceUnits
| KinematicViscosityUnits
| LengthUnits
| LightExposureUnits
| LinerChargeDensityUnits
| LogarithmicRatioUnits
| LuminousEfficacyUnits
| LuminousFluxUnits
| LuminousIntensityUnits
| MagneticFieldGradientUnits
| MagneticFluxUnits
| MagneticFluxDensityUnits
| MagneticMomentUnits
| MagneticPermeabilityUnits
| MassUnits
| MassFractionUnits
| MolarConcentrationUnits
| MolarEnergyUnits
| MolarHeatCapacityUnits
| MolarMassUnits
| PartsPerUnits
| PowerUnits
| PressureUnits
| SpecificHumidityUnits
| SpeedUnits
| TemperatureUnits
| TimeUnits
@ -66,21 +142,59 @@ export type AllMeasuresUnits =
export type AllMeasures =
| 'acceleration'
| 'air-quality-index'
| 'amount-of-substance'
| 'angle'
| 'angular-acceleration'
| 'area'
| 'capacitance'
| 'catalytic-activity'
| 'catalytic-concentration'
| 'charge'
| 'current-density'
| 'data-transfer-rate'
| 'density'
| 'digital'
| 'dimension-ratio'
| 'dynamic-viscosity'
| 'earthquake-magnitude'
| 'electric-current'
| 'electric-dipole-moment'
| 'electric-field-strength'
| 'electric-flux'
| 'electric-permittivity'
| 'electrical-conductance'
| 'electrical-conductivity'
| 'energy'
| 'force'
| 'frequency'
| 'fuel-efficiency'
| 'heat-capacity'
| 'illuminance'
| 'inductance'
| 'kinematic-viscosity'
| 'length'
| 'light-exposure'
| 'linear-charge-density'
| 'logarithmic-ratio'
| 'luminous-efficacy'
| 'luminous-flux'
| 'luminous-intensity'
| 'magnetic-field-gradient'
| 'magnetic-flux'
| 'magnetic-flux-density'
| 'magnetic-moment'
| 'magnetic-permeability'
| 'mass'
| 'mass-fraction'
| 'molar-concentration'
| 'molar-energy'
| 'molar-heat-capacity'
| 'molar-mass'
| 'parts-per'
| 'power'
| 'pressure'
| 'specific-humidity'
| 'speed'
| 'temperature'
| 'time'
@ -94,21 +208,59 @@ const allMeasures: Record<
TbMeasure<AllMeasuresUnits>
> = Object.freeze({
acceleration,
'air-quality-index': airQualityIndex,
'amount-of-substance': amountOfSubstance,
angle,
'angular-acceleration': angularAcceleration,
area,
capacitance,
'catalytic-activity': catalyticActivity,
'catalytic-concentration': catalyticConcentration,
charge,
'current-density': currentDensity,
'data-transfer-rate': dataTransferRate,
density,
digital,
'dimension-ratio': dimensionRatio,
'dynamic-viscosity': dynamicViscosity,
'earthquake-magnitude': earthquakeMagnitude,
'electric-current': electricCurrent,
'electric-dipole-moment': electricDipoleMoment,
'electric-field-strength': electricFieldStrength,
'electric-flux': electricFlux,
'electric-permittivity': electricPermittivity,
'electrical-conductance': electricalConductance,
'electrical-conductivity': electricalConductivity,
energy,
force,
frequency,
'fuel-efficiency': fuelEfficiency,
'heat-capacity': heatCapacity,
illuminance,
inductance,
'kinematic-viscosity': kinematicViscosity,
length,
'light-exposure': lightExposure,
'linear-charge-density': linerChargeDensity,
'logarithmic-ratio': logarithmicRatio,
'luminous-efficacy': luminousEfficacy,
'luminous-flux': luminousFlux,
'luminous-intensity': luminousIntensity,
'magnetic-field-gradient': magneticFieldGradient,
'magnetic-flux': magneticFlux,
'magnetic-flux-density': magneticFluxDensity,
'magnetic-moment': magneticMoment,
'magnetic-permeability': magneticPermeability,
mass,
'mass-fraction': massFraction,
'molar-concentration': molarConcentration,
'molar-energy': molarEnergy,
'molar-heat-capacity': molarHeatCapacity,
'molar-mass': molarMass,
'parts-per': partsPer,
power,
pressure,
'specific-humidity': specificHumidity,
speed,
temperature,
time,
@ -143,7 +295,7 @@ export const UnitSystems = Object.values(UnitSystem);
export interface Unit {
name: string;
tags: string[];
tags?: string[];
to_anchor: number;
anchor_shift?: number;
transform?: (value: number) => number;
@ -407,6 +559,9 @@ function buildUnitCache(measures: Record<AllMeasures, TbMeasure<AllMeasuresUnits
AllMeasuresUnits
>[]) {
unit.name = translate.instant(unit.name);
const measureNameTranslation = translate.instant('unit.measures.' + measureName);
unit.tags = unit.tags ?? [];
unit.tags.push(testAbbr, unit.name, measureNameTranslation);
unitCache.set(testAbbr, {
measure: measureName,
system: systemName,

37
ui-ngx/src/app/shared/models/units/Magnetic-permeability.ts

@ -1,37 +0,0 @@
import { TbMeasure, TbMeasureUnits } from '@shared/models/unit.models';
export type MagneticPermeabilityMetricUnits = 'H/m';
export type MagneticPermeabilityImperialUnits = 'G/Oe';
export type MagneticPermeabilityUnits =
| MagneticPermeabilityMetricUnits
| MagneticPermeabilityImperialUnits;
const METRIC: TbMeasureUnits<MagneticPermeabilityMetricUnits> = {
transform: (Hm) => Hm * 795774.715,
units: {
'H/m': {
name: 'unit.henry-per-meter',
tags: ['magnetic permeability', 'henry per meter', 'H/m'],
to_anchor: 1,
},
},
};
const IMPERIAL: TbMeasureUnits<MagneticPermeabilityImperialUnits> = {
transform: (GOe) => GOe / 795774.715,
units: {
'G/Oe': {
name: 'unit.gauss-per-oersted',
tags: ['magnetic field', 'Gauss per Oersted', 'G/Oe'],
to_anchor: 1,
},
},
};
const measure: TbMeasure<MagneticPermeabilityUnits> = {
METRIC,
IMPERIAL,
};
export default measure;

8
ui-ngx/src/app/shared/models/units/acceleration.ts

@ -26,22 +26,22 @@ const METRIC: TbMeasureUnits<AccelerationMetricUnits> = {
units: {
'G': {
name: 'unit.g-force',
tags: ['acceleration', 'gravity', 'g-force', 'load', 'G'],
tags: ['gravity', 'g-force', 'load'],
to_anchor: 9.80665,
},
'm/s²': {
name: 'unit.meters-per-second-squared',
tags: ['peak', 'peak to peak', 'root mean square (RMS)', 'vibration', 'meters per second squared', 'm/s²'],
tags: ['peak', 'peak to peak', 'root mean square (RMS)', 'vibration', 'meters per second squared'],
to_anchor: 1,
},
'Gal': {
name: 'unit.gal',
tags: ['acceleration', 'gravity', 'g-force', 'Gal'],
tags: ['gravity', 'g-force'],
to_anchor: 1,
},
'km/h²': {
name: 'unit.kilometer-per-hour-squared',
tags: ['acceleration', 'rate of change of velocity', 'kilometer per hour squared', 'km/h²'],
tags: ['rate of change of velocity', 'kilometer per hour squared'],
to_anchor: 1 / 12960,
}
}

18
ui-ngx/src/app/shared/models/units/air-quality-index.ts

@ -1,3 +1,19 @@
///
/// Copyright © 2016-2025 The Thingsboard Authors
///
/// Licensed under the Apache License, Version 2.0 (the "License");
/// you may not use this file except in compliance with the License.
/// You may obtain a copy of the License at
///
/// http://www.apache.org/licenses/LICENSE-2.0
///
/// Unless required by applicable law or agreed to in writing, software
/// distributed under the License is distributed on an "AS IS" BASIS,
/// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
/// See the License for the specific language governing permissions and
/// limitations under the License.
///
import { TbMeasure, TbMeasureUnits } from '@shared/models/unit.models';
export type AirQualityIndexUnits = 'aqi';
@ -6,7 +22,7 @@ const METRIC: TbMeasureUnits<AirQualityIndexUnits> = {
units: {
aqi: {
name: 'unit.aqi',
tags: ['AQI', 'air quality index'],
tags: ['pollutant concentration'],
to_anchor: 1,
},
},

32
ui-ngx/src/app/shared/models/units/amount-of-substance.ts

@ -1,34 +1,48 @@
import { TbMeasure, TbMeasureUnits } from '@shared/models/unit.models';
///
/// Copyright © 2016-2025 The Thingsboard Authors
///
/// Licensed under the Apache License, Version 2.0 (the "License");
/// you may not use this file except in compliance with the License.
/// You may obtain a copy of the License at
///
/// http://www.apache.org/licenses/LICENSE-2.0
///
/// Unless required by applicable law or agreed to in writing, software
/// distributed under the License is distributed on an "AS IS" BASIS,
/// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
/// See the License for the specific language governing permissions and
/// limitations under the License.
///
export type AmountOfSubstanceMetricUnits = 'mol' | 'nmol' | 'μmol' | 'mmol' | 'kmol';
import { TbMeasure, TbMeasureUnits } from '@shared/models/unit.models';
export type AmountOfSubstanceUnits = AmountOfSubstanceMetricUnits;
export type AmountOfSubstanceUnits = 'mol' | 'nmol' | 'μmol' | 'mmol' | 'kmol';
const METRIC: TbMeasureUnits<AmountOfSubstanceMetricUnits> = {
const METRIC: TbMeasureUnits<AmountOfSubstanceUnits> = {
units: {
'mol': {
name: 'unit.mole',
tags: ['amount of substance', 'chemical amount', 'mole', 'mol'],
tags: ['chemical amount'],
to_anchor: 1,
},
'nmol': {
name: 'unit.nanomole',
tags: ['amount of substance', 'nanomole', 'nmol'],
tags: ['chemical amount'],
to_anchor: 0.000000001,
},
'μmol': {
name: 'unit.micromole',
tags: ['amount of substance', 'micromole', 'μmol'],
tags: ['chemical amount'],
to_anchor: 0.000001,
},
'mmol': {
name: 'unit.millimole',
tags: ['amount of substance', 'millimole', 'mmol'],
tags: ['chemical amount'],
to_anchor: 0.001,
},
'kmol': {
name: 'unit.kilomole',
tags: ['amount of substance', 'kilomole', 'kmol'],
tags: ['chemical amount'],
to_anchor: 1000,
},
},

20
ui-ngx/src/app/shared/models/units/angle.ts

@ -16,45 +16,43 @@
import { TbMeasure, TbMeasureUnits } from '@shared/models/unit.models';
export type AngleUnits = AngleMetricUnits;
export type AngleUnits = 'rad' | 'deg' | 'grad' | 'arcmin' | 'arcsec' | 'mrad' | 'rev';
export type AngleMetricUnits = 'rad' | 'deg' | 'grad' | 'arcmin' | 'arcsec' | 'mrad' | 'rev';
const METRIC: TbMeasureUnits<AngleMetricUnits> = {
const METRIC: TbMeasureUnits<AngleUnits> = {
units: {
rad: {
name: 'unit.rad',
tags: ['angle', 'radian', 'radians', 'rad'],
tags: ['radians'],
to_anchor: 180 / Math.PI,
},
deg: {
name: 'unit.degree',
tags: ['angle', 'degree', 'degrees', 'deg'],
tags: ['degrees'],
to_anchor: 1,
},
grad: {
name: 'unit.gradian',
tags: ['angle', 'gradian', 'grades', 'grad'],
tags: ['grades'],
to_anchor: 9 / 10,
},
arcmin: {
name: 'unit.arcminute',
tags: ['angle', 'arcminute', 'arcminutes', 'arcmin'],
tags: ['arcminutes'],
to_anchor: 1 / 60
},
arcsec: {
name: 'unit.arcsecond',
tags: ['angle', 'arcsecond', 'arcseconds', 'arcsec'],
tags: ['arcseconds'],
to_anchor: 1 / 3600
},
mrad: {
name: 'unit.milliradian',
tags: ['angle', 'military angle', 'angular mil', 'mil'],
tags: ['military angle', 'angular mil', 'mil'],
to_anchor: 9 / (50 * Math.PI),
},
rev: {
name: 'unit.revolution',
tags: ['angle', 'revolution', 'full circle', 'complete turn', 'rev'],
tags: ['full circle', 'complete turn'],
to_anchor: 360,
},
}

4
ui-ngx/src/app/shared/models/units/angular-acceleration.ts

@ -26,7 +26,7 @@ const METRIC: TbMeasureUnits<AngularAccelerationMetricUnits> = {
units: {
'rad/s²': {
name: 'unit.radian-per-second-squared',
tags: ['angular acceleration', 'rotation rate of change', 'rad/s²'],
tags: ['rotation rate of change'],
to_anchor: 1,
}
}
@ -37,7 +37,7 @@ const IMPERIAL: TbMeasureUnits<AngularAccelerationImperialUnits> = {
units: {
'rpm/s': {
name: 'unit.revolutions-per-minute-per-second',
tags: ['angular acceleration', 'rotation rate of change', 'rpm/s'],
tags: ['rotation rate of change'],
to_anchor: 1
}
}

26
ui-ngx/src/app/shared/models/units/area.ts

@ -26,37 +26,37 @@ const METRIC: TbMeasureUnits<AreaMetricUnits> = {
units: {
'mm²': {
name: 'unit.square-millimeter',
tags: ['area','lot','zone','space','region','square millimeter','square millimeters','mm²','sq-mm'],
tags: ['lot', 'zone', 'space', 'region', 'square millimeters', 'sq-mm'],
to_anchor: 1 / 1000000,
},
'cm²': {
name: 'unit.square-centimeter',
tags: ['area','lot','zone','space','region','square centimeter','square centimeters','cm²','sq-cm'],
tags: ['lot', 'zone', 'space', 'region', 'square centimeters', 'sq-cm'],
to_anchor: 1 / 10000,
},
'm²': {
name: 'unit.square-meter',
tags: ['area','lot','zone','space','region','square meter','square meters','m²','sq-m'],
tags: ['lot', 'zone', 'space', 'region', 'square meters', 'sq-m'],
to_anchor: 1,
},
a: {
name: 'unit.are',
tags: ['area','land measurement','are'],
tags: ['land measurement'],
to_anchor: 100,
},
ha: {
name: 'unit.hectare',
tags: ['area','lot','zone','space','region','hectare','hectares','ha'],
tags: ['lot', 'zone', 'space', 'region', 'hectares'],
to_anchor: 10000,
},
'km²': {
name: 'unit.square-kilometer',
tags: ['area','lot','zone','space','region','square kilometer','square kilometers','km²','sq-km'],
tags: ['lot', 'zone', 'space', 'region', 'square kilometers', 'sq-km'],
to_anchor: 1000000,
},
barn: {
name: 'unit.barn',
tags: ['cross-sectional area', 'particle physics', 'nuclear physics', 'barn'],
tags: ['cross-sectional area', 'particle physics', 'nuclear physics'],
to_anchor: 1e-28,
},
}
@ -67,32 +67,32 @@ const IMPERIAL: TbMeasureUnits<AreaImperialUnits> = {
units: {
'in²': {
name: 'unit.square-inch',
tags: ['area','lot','zone','space','region','square inch','square inches','in²','sq-in'],
tags: ['lot', 'zone', 'space', 'region', 'square inches', 'sq-in'],
to_anchor: 1 / 144,
},
'yd²': {
name: 'unit.square-yard',
tags: ['area','lot','zone','space','region','square yard','square yards','yd²','sq-yd'],
tags: ['lot', 'zone', 'space', 'region', 'square yards', 'sq-yd'],
to_anchor: 9,
},
'ft²': {
name: 'unit.square-foot',
tags: ['area','lot','zone','space','region','square foot','square feet','ft²','sq-ft'],
tags: ['lot', 'zone', 'space', 'region', 'square feet', 'sq-ft'],
to_anchor: 1,
},
ac: {
name: 'unit.acre',
tags: ['area','lot','zone','space','region','acre','acres','a'],
tags: ['lot', 'zone', 'space', 'region', 'acres', 'a'],
to_anchor: 43560,
},
'ml²': {
name: 'unit.square-mile',
tags: ['area','lot','zone','space','region','square mile','square miles','ml²','sq-mi'],
tags: ['lot', 'zone', 'space', 'region', 'square mile', 'sq-mi'],
to_anchor: 27878400,
},
cin: {
name: 'unit.circular-inch',
tags: ['area','circular measurement','circular inch','circin'],
tags: ['circular measurement', 'circin'],
to_anchor: Math.PI / 576
}
}

20
ui-ngx/src/app/shared/models/units/blood-glucose.ts

@ -1,20 +0,0 @@
import { TbMeasure, TbMeasureUnits } from '@shared/models/unit.models';
export type BloodGlucoseUnits = BloodGlucoseMetricUnits;
export type BloodGlucoseMetricUnits = 'mg/dL';
const METRIC: TbMeasureUnits<BloodGlucoseMetricUnits> = {
units: {
'mg/dL': {
name: 'unit.milligrams-per-deciliter',
tags: ['glucose', 'blood sugar', 'glucose level', 'mg/dL'],
to_anchor: 1,
},
},
};
const measure: TbMeasure<BloodGlucoseUnits> = {
METRIC,
};
export default measure;

34
ui-ngx/src/app/shared/models/units/capacitance.ts

@ -1,3 +1,19 @@
///
/// Copyright © 2016-2025 The Thingsboard Authors
///
/// Licensed under the Apache License, Version 2.0 (the "License");
/// you may not use this file except in compliance with the License.
/// You may obtain a copy of the License at
///
/// http://www.apache.org/licenses/LICENSE-2.0
///
/// Unless required by applicable law or agreed to in writing, software
/// distributed under the License is distributed on an "AS IS" BASIS,
/// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
/// See the License for the specific language governing permissions and
/// limitations under the License.
///
import { TbMeasure, TbMeasureUnits } from '@shared/models/unit.models';
export type CapacitanceUnits = 'F' | 'mF' | 'μF' | 'nF' | 'pF' | 'kF' | 'MF' | 'GF' | 'TF';
@ -6,47 +22,47 @@ const METRIC: TbMeasureUnits<CapacitanceUnits> = {
units: {
'F': {
name: 'unit.farad',
tags: ['electric capacitance', 'capacitance', 'farad', 'F'],
tags: ['electric capacitance'],
to_anchor: 1,
},
'mF': {
name: 'unit.millifarad',
tags: ['electric capacitance', 'capacitance', 'millifarad', 'mF'],
tags: ['electric capacitance'],
to_anchor: 1e-3,
},
'μF': {
name: 'unit.microfarad',
tags: ['electric capacitance', 'capacitance', 'microfarad', 'μF'],
tags: ['electric capacitance'],
to_anchor: 1e-6,
},
'nF': {
name: 'unit.nanofarad',
tags: ['electric capacitance', 'capacitance', 'nanofarad', 'nF'],
tags: ['electric capacitance'],
to_anchor: 1e-9,
},
'pF': {
name: 'unit.picofarad',
tags: ['electric capacitance', 'capacitance', 'picofarad', 'pF'],
tags: ['electric capacitance'],
to_anchor: 1e-12,
},
'kF': {
name: 'unit.kilofarad',
tags: ['electric capacitance', 'capacitance', 'kilofarad', 'kF'],
tags: ['electric capacitance'],
to_anchor: 1e3,
},
'MF': {
name: 'unit.megafarad',
tags: ['electric capacitance', 'capacitance', 'megafarad', 'MF'],
tags: ['electric capacitance'],
to_anchor: 1e6,
},
'GF': {
name: 'unit.gigafarad',
tags: ['electric capacitance', 'capacitance', 'gigafarad', 'GF'],
tags: ['electric capacitance'],
to_anchor: 1e9,
},
'TF': {
name: 'unit.terafarad',
tags: ['electric capacitance', 'capacitance', 'terafarad', 'TF'],
tags: ['electric capacitance'],
to_anchor: 1e12,
},
},

24
ui-ngx/src/app/shared/models/units/catalytic-activity.ts

@ -1,18 +1,34 @@
///
/// Copyright © 2016-2025 The Thingsboard Authors
///
/// Licensed under the Apache License, Version 2.0 (the "License");
/// you may not use this file except in compliance with the License.
/// You may obtain a copy of the License at
///
/// http://www.apache.org/licenses/LICENSE-2.0
///
/// Unless required by applicable law or agreed to in writing, software
/// distributed under the License is distributed on an "AS IS" BASIS,
/// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
/// See the License for the specific language governing permissions and
/// limitations under the License.
///
import { TbMeasure, TbMeasureUnits } from '@shared/models/unit.models';
export type AirQualityIndexUnits = 'kat';
export type CatalyticActivityUnits = 'kat';
const METRIC: TbMeasureUnits<AirQualityIndexUnits> = {
const METRIC: TbMeasureUnits<CatalyticActivityUnits> = {
units: {
kat: {
name: 'unit.katal',
tags: ['catalytic activity', 'enzyme activity', 'kat'],
tags: ['catalytic activity', 'enzyme activity'],
to_anchor: 1,
},
},
};
const measure: TbMeasure<AirQualityIndexUnits> = {
const measure: TbMeasure<CatalyticActivityUnits> = {
METRIC,
};

35
ui-ngx/src/app/shared/models/units/catalytic-concentration.ts

@ -0,0 +1,35 @@
///
/// Copyright © 2016-2025 The Thingsboard Authors
///
/// Licensed under the Apache License, Version 2.0 (the "License");
/// you may not use this file except in compliance with the License.
/// You may obtain a copy of the License at
///
/// http://www.apache.org/licenses/LICENSE-2.0
///
/// Unless required by applicable law or agreed to in writing, software
/// distributed under the License is distributed on an "AS IS" BASIS,
/// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
/// See the License for the specific language governing permissions and
/// limitations under the License.
///
import { TbMeasure, TbMeasureUnits } from '@shared/models/unit.models';
export type CatalyticConcentrationUnits = 'kat/m³';
const METRIC: TbMeasureUnits<CatalyticConcentrationUnits> = {
units: {
'kat/m³': {
name: 'unit.katal-per-cubic-metre',
tags: ['enzyme concentration'],
to_anchor: 1,
}
},
};
const measure: TbMeasure<CatalyticConcentrationUnits> = {
METRIC,
};
export default measure;

16
ui-ngx/src/app/shared/models/units/charge.ts

@ -24,42 +24,42 @@ const METRIC: TbMeasureUnits<ChargeMetricUnits> = {
units: {
c: {
name: 'unit.coulomb',
tags: ['charge', 'electricity', 'electrostatics', 'Coulomb', 'C'],
tags: ['electricity', 'electrostatics'],
to_anchor: 1,
},
mC: {
name: 'unit.millicoulomb',
tags: ['charge', 'electricity', 'electrostatics', 'millicoulombs', 'mC'],
tags: ['electricity', 'electrostatics'],
to_anchor: 1 / 1000,
},
μC: {
name: 'unit.microcoulomb',
tags: ['charge', 'electricity', 'electrostatics', 'microcoulomb', 'µC'],
tags: [ 'electricity', 'electrostatics'],
to_anchor: 1 / 1000000,
},
nC: {
name: 'unit.nanocoulomb',
tags: ['charge', 'electricity', 'electrostatics', 'nanocoulomb', 'nC'],
tags: ['electricity', 'electrostatics',],
to_anchor: 1e-9,
},
pC: {
name: 'unit.picocoulomb',
tags: ['charge', 'electricity', 'electrostatics', 'picocoulomb', 'pC'],
tags: ['electricity', 'electrostatics'],
to_anchor: 1e-12,
},
mAh: {
name: 'unit.milliampere-hour',
tags: ['electric current', 'current flow', 'electric charge', 'current capacity', 'flow of electricity', 'electrical flow', 'milliampere-hour', 'milliampere-hours', 'mAh'],
tags: ['electric current', 'current flow', 'electric charge', 'current capacity', 'flow of electricity', 'electrical flow', 'milliampere-hours'],
to_anchor: 3.6,
},
Ah: {
name: 'unit.ampere-hours',
tags: ['electric current', 'current flow', 'electric charge', 'current capacity', 'flow of electricity', 'electrical flow', 'ampere', 'ampere-hours', 'Ah'],
tags: ['electric current', 'current flow', 'electric charge', 'current capacity', 'flow of electricity', 'electrical flow', 'ampere'],
to_anchor: 3600,
},
kAh: {
name: 'unit.kiloampere-hours',
tags: ['electric current', 'current flow', 'electric charge', 'current capacity', 'flow of electricity', 'electrical flow', 'kiloampere-hours', 'kiloampere-hour', 'kAh'],
tags: ['electric current', 'current flow', 'electric charge', 'current capacity', 'flow of electricity', 'electrical flow', 'kiloampere-hours'],
to_anchor: 3600000,
},
}

40
ui-ngx/src/app/shared/models/units/concentration-gradient.ts

@ -1,40 +0,0 @@
import { TbMeasure, TbMeasureUnits } from '@shared/models/unit.models';
export type ConcentrationMetricUnits = 'mol/m³' | 'mg/mL' | 'mg/m³' | 'µg/m³' | 'particles/mL';
export type ConcentrationUnits = ConcentrationMetricUnits;
const METRIC: TbMeasureUnits<ConcentrationMetricUnits> = {
units: {
'mol/m³': {
name: 'unit.mole-per-cubic-meter',
tags: ['concentration', 'amount of substance per unit volume', 'mole per cubic meter', 'mol/m³'],
to_anchor: 1,
},
'mg/mL': {
name: 'unit.milligram-per-milliliter',
tags: ['concentration', 'mass per unit volume', 'milligram per milliliter', 'mg/mL'],
to_anchor: 1,
},
'mg/m³': {
name: 'unit.milligram-per-cubic-meter',
tags: ['concentration', 'mass per unit volume', 'milligram per cubic meter', 'mg/m³'],
to_anchor: 1,
},
'µg/m³': {
name: 'unit.micrograms-per-cubic-meter',
tags: ['concentration', 'air quality', 'particulate matter', 'PM2.5', 'PM10', 'micrograms per cubic meter', 'µg/m³'],
to_anchor: 1,
},
'particles/mL': {
name: 'unit.particle-density',
tags: ['concentration', 'particle density', 'particles per milliliter', 'particles/mL'],
to_anchor: 1,
},
},
};
const measure: TbMeasure<ConcentrationUnits> = {
METRIC,
};
export default measure;

63
ui-ngx/src/app/shared/models/units/concentration-volume.ts

@ -1,63 +0,0 @@
import { TbMeasure, TbMeasureUnits } from '@shared/models/unit.models';
export type ConcentrationVolumeMetricUnits =
'mol/m³'
| 'µg/m³'
| 'mg/m³'
| 'g/m³'
| 'mg/L'
| 'mg/mL'
| 'kat/m³'
| '°Bx';
export type ConcentrationVolumeUnits = ConcentrationVolumeMetricUnits;
const METRIC: TbMeasureUnits<ConcentrationVolumeMetricUnits> = {
units: {
'mol/m³': {
name: 'unit.mole-per-cubic-meter',
tags: ['concentration', 'amount of substance', 'mole per cubic meter', 'mol/m³'],
to_anchor: 1,
},
'µg/m³': {
name: 'unit.micrograms-per-cubic-meter',
tags: ['coarse particulate matter', 'pm10', 'fine particulate matter', 'pm2.5', 'aqi', 'air quality', 'total volatile organic compounds', 'tvoc', 'micrograms per cubic meter', 'µg/m³'],
to_anchor: 1e-9,
},
'mg/m³': {
name: 'unit.milligram-per-cubic-meter',
tags: ['concentration', 'mass per volume', 'mg/m³'],
to_anchor: 1e-6,
},
'g/m³': {
name: 'unit.gram-per-cubic-meter',
tags: ['humidity', 'moisture', 'absolute humidity', 'g/m³'],
to_anchor: 1 / 1000,
},
'mg/L': {
name: 'unit.mg-per-liter',
tags: ['dissolved oxygen', 'water quality', 'mg/L'],
to_anchor: 1e-6,
},
'mg/mL': {
name: 'unit.milligram-per-milliliter',
tags: ['concentration', 'mass per volume', 'mg/mL'],
to_anchor: 1 / 1000,
},
'kat/m³': {
name: 'unit.katal-per-cubic-metre',
tags: ['catalytic activity concentration', 'enzyme concentration', 'kat/m³'],
to_anchor: 1,
},
'°Bx': {
name: 'unit.degrees-brix',
tags: ['sugar content', 'fruit ripeness', 'Bx'],
to_anchor: 10.04 * 1e-3,
},
},
};
const measure: TbMeasure<ConcentrationVolumeUnits> = {
METRIC,
};
export default measure;

26
ui-ngx/src/app/shared/models/units/current-density.ts

@ -1,19 +1,33 @@
import { TbMeasure, TbMeasureUnits } from '@shared/models/unit.models';
///
/// Copyright © 2016-2025 The Thingsboard Authors
///
/// Licensed under the Apache License, Version 2.0 (the "License");
/// you may not use this file except in compliance with the License.
/// You may obtain a copy of the License at
///
/// http://www.apache.org/licenses/LICENSE-2.0
///
/// Unless required by applicable law or agreed to in writing, software
/// distributed under the License is distributed on an "AS IS" BASIS,
/// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
/// See the License for the specific language governing permissions and
/// limitations under the License.
///
export type CurrentDensityMetricUnits = 'µA/cm²' | 'A/m²';
import { TbMeasure, TbMeasureUnits } from '@shared/models/unit.models';
export type CurrentDensityUnits = CurrentDensityMetricUnits;
export type CurrentDensityUnits = 'µA/cm²' | 'A/m²';
const METRIC: TbMeasureUnits<CurrentDensityMetricUnits> = {
const METRIC: TbMeasureUnits<CurrentDensityUnits> = {
units: {
'µA/cm²': {
name: 'unit.microampere-per-square-centimeter',
tags: ['current density', 'microampere per square centimeter', 'µA/cm²'],
tags: ['current per unit area'],
to_anchor: 10000,
},
'A/m²': {
name: 'unit.ampere-per-square-meter',
tags: ['current density', 'current per unit area', 'ampere per square meter', 'A/m²'],
tags: ['current per unit area'],
to_anchor: 1,
},
},

25
ui-ngx/src/app/shared/models/units/data-transfer-rate.ts

@ -1,3 +1,19 @@
///
/// Copyright © 2016-2025 The Thingsboard Authors
///
/// Licensed under the Apache License, Version 2.0 (the "License");
/// you may not use this file except in compliance with the License.
/// You may obtain a copy of the License at
///
/// http://www.apache.org/licenses/LICENSE-2.0
///
/// Unless required by applicable law or agreed to in writing, software
/// distributed under the License is distributed on an "AS IS" BASIS,
/// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
/// See the License for the specific language governing permissions and
/// limitations under the License.
///
import { TbMeasure, TbMeasureUnits } from '@shared/models/unit.models';
export type DataTransferRateUnits = 'bps' | 'kbps' | 'Mbps' | 'Gbps' | 'Tbps' | 'B/s' | 'KB/s' | 'MB/s' | 'GB/s';
@ -6,47 +22,38 @@ const METRIC: TbMeasureUnits<DataTransferRateUnits> = {
units: {
'bps': {
name: 'unit.bit-per-second',
tags: ['data transfer rate', 'bps'],
to_anchor: 1,
},
'kbps': {
name: 'unit.kilobit-per-second',
tags: ['data transfer rate', 'kbps'],
to_anchor: 1e3,
},
'Mbps': {
name: 'unit.megabit-per-second',
tags: ['data transfer rate', 'Mbps'],
to_anchor: 1e6,
},
'Gbps': {
name: 'unit.gigabit-per-second',
tags: ['data transfer rate', 'Gbps'],
to_anchor: 1e9,
},
'Tbps': {
name: 'unit.terabit-per-second',
tags: ['data transfer rate', 'Tbps'],
to_anchor: 1e12,
},
'B/s': {
name: 'unit.byte-per-second',
tags: ['data transfer rate', 'B/s'],
to_anchor: 8,
},
'KB/s': {
name: 'unit.kilobyte-per-second',
tags: ['data transfer rate', 'KB/s'],
to_anchor: 8e3,
},
'MB/s': {
name: 'unit.megabyte-per-second',
tags: ['data transfer rate', 'MB/s'],
to_anchor: 8e6,
},
'GB/s': {
name: 'unit.gigabyte-per-second',
tags: ['data transfer rate', 'GB/s'],
to_anchor: 8e9,
},
},

62
ui-ngx/src/app/shared/models/units/density.ts

@ -1,6 +1,22 @@
///
/// Copyright © 2016-2025 The Thingsboard Authors
///
/// Licensed under the Apache License, Version 2.0 (the "License");
/// you may not use this file except in compliance with the License.
/// You may obtain a copy of the License at
///
/// http://www.apache.org/licenses/LICENSE-2.0
///
/// Unless required by applicable law or agreed to in writing, software
/// distributed under the License is distributed on an "AS IS" BASIS,
/// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
/// See the License for the specific language governing permissions and
/// limitations under the License.
///
import { TbMeasure, TbMeasureUnits } from '@shared/models/unit.models';
export type DensityMetricUnits = 'kg/m³' | 'g/cm³';
export type DensityMetricUnits = 'kg/m³' | 'g/cm³' | 'mg/dL' | 'g/m³' | 'mg/mL' | 'mg/L' | 'mg/m³' | 'µg/m³';
export type DensityImperialUnits = 'lb/ft³' | 'oz/in³' | 'ton/yd³';
export type DensityUnits = DensityMetricUnits | DensityImperialUnits;
@ -10,13 +26,43 @@ const METRIC: TbMeasureUnits<DensityMetricUnits> = {
units: {
'kg/m³': {
name: 'unit.kilogram-per-cubic-meter',
tags: ['density', 'mass per unit volume', 'kg/m³'],
to_anchor: 1, // Base unit: kg/m³
tags: ['mass per unit volume'],
to_anchor: 1,
},
'g/cm³': {
name: 'unit.gram-per-cubic-centimeter',
tags: ['density', 'mass per unit volume', 'g/cm³'],
to_anchor: 1000, // 1 g/cm³ = 10³ kg/m³
tags: ['mass per unit volume'],
to_anchor: 1000,
},
'mg/dL': {
name: 'unit.milligrams-per-deciliter',
tags: ['glucose', 'blood sugar', 'glucose level', 'concentration'],
to_anchor: 0.01,
},
'g/m³': {
name: 'unit.gram-per-cubic-meter',
tags: ['humidity', 'moisture', 'absolute humidity', 'concentration'],
to_anchor: 0.001,
},
'mg/L': {
name: 'unit.mg-per-liter',
tags: ['dissolved oxygen', 'water quality', 'mg/L', 'concentration'],
to_anchor: 0.001,
},
'mg/mL': {
name: 'unit.milligram-per-milliliter',
tags: ['mass per unit volume', 'concentration'],
to_anchor: 1,
},
'mg/m³': {
name: 'unit.milligram-per-cubic-meter',
tags: ['mass per unit volume', 'concentration'],
to_anchor: 1e-6,
},
'µg/m³': {
name: 'unit.micrograms-per-cubic-meter',
tags: ['coarse particulate matter', 'pm10', 'fine particulate matter', 'pm2.5', 'aqi', 'air quality', 'total volatile organic compounds', 'tvoc', 'concentration'],
to_anchor: 1e-9,
},
},
};
@ -26,17 +72,17 @@ const IMPERIAL: TbMeasureUnits<DensityImperialUnits> = {
units: {
'lb/ft³': {
name: 'unit.pound-per-cubic-foot',
tags: ['density', 'mass per unit volume', 'lb/ft³'],
tags: ['mass per unit volume'],
to_anchor: 1,
},
'oz/in³': {
name: 'unit.ounces-per-cubic-inch',
tags: ['density', 'mass per unit volume', 'oz/in³'],
tags: ['mass per unit volume'],
to_anchor: 1728,
},
'ton/yd³': {
name: 'unit.tons-per-cubic-yard',
tags: ['density', 'mass per unit volume', 'ton/yd³'],
tags: ['mass per unit volume'],
to_anchor: 74.074,
},
},

26
ui-ngx/src/app/shared/models/units/digital.ts

@ -16,60 +16,58 @@
import { TbMeasure, TbMeasureUnits } from '@shared/models/unit.models';
export type DigitalUnits = DigitalMetricUnits;
export type DigitalUnits = 'bit' | 'B' | 'KB' | 'MB' | 'GB' | 'TB' | 'PB' | 'EB' | 'ZB' | 'YB';
export type DigitalMetricUnits = 'bit' | 'B' | 'KB' | 'MB' | 'GB' | 'TB' | 'PB' | 'EB' | 'ZB' | 'YB';
const METRIC: TbMeasureUnits<DigitalMetricUnits> = {
const METRIC: TbMeasureUnits<DigitalUnits> = {
units: {
bit: {
name: 'unit.bit',
tags: ['data', 'binary digit', 'information', 'bit'],
tags: ['data', 'binary digit', 'information'],
to_anchor: 1.25e-1,
},
B: {
name: 'unit.byte',
tags: ['data', 'byte', 'information', 'storage', 'memory', 'B'],
tags: ['data', 'information', 'storage', 'memory'],
to_anchor: 1
},
KB: {
name: 'unit.kilobyte',
tags: ['data', 'kilobyte', 'KB'],
tags: ['data'],
to_anchor: 1024,
},
MB: {
name: 'unit.megabyte',
tags: ['data', 'megabyte', 'MB'],
tags: ['data'],
to_anchor: 1024 ** 2,
},
GB: {
name: 'unit.gigabyte',
tags: ['data', 'gigabyte', 'GB'],
tags: ['data'],
to_anchor: 1024 ** 3,
},
TB: {
name: 'unit.terabyte',
tags: ['data', 'terabyte', 'TB'],
tags: ['data'],
to_anchor: 1024 ** 4,
},
PB: {
name: 'unit.petabyte',
tags: ['data', 'petabyte', 'PB'],
tags: ['data'],
to_anchor: 1024 ** 5,
},
EB: {
name: 'unit.exabyte',
tags: ['data', 'exabyte', 'EB'],
tags: ['data'],
to_anchor: 1024 ** 6,
},
ZB: {
name: 'unit.zettabyte',
tags: ['data', 'zettabyte', 'EB'],
tags: ['data'],
to_anchor: 1024 ** 7,
},
YB: {
name: 'unit.yottabyte',
tags: ['data', 'yottabyte', 'EB'],
tags: ['data'],
to_anchor: 1024 ** 8,
},
}

35
ui-ngx/src/app/shared/models/units/dimension-ratio.ts

@ -0,0 +1,35 @@
///
/// Copyright © 2016-2025 The Thingsboard Authors
///
/// Licensed under the Apache License, Version 2.0 (the "License");
/// you may not use this file except in compliance with the License.
/// You may obtain a copy of the License at
///
/// http://www.apache.org/licenses/LICENSE-2.0
///
/// Unless required by applicable law or agreed to in writing, software
/// distributed under the License is distributed on an "AS IS" BASIS,
/// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
/// See the License for the specific language governing permissions and
/// limitations under the License.
///
import { TbMeasure, TbMeasureUnits } from '@shared/models/unit.models';
export type DimensionRatioUnits = 'm/m';
const METRIC: TbMeasureUnits<DimensionRatioUnits> = {
units: {
'm/m': {
name: 'unit.meter-per-meter',
tags: ['ratio of length to length'],
to_anchor: 1,
},
},
};
const measure: TbMeasure<DimensionRatioUnits> = {
METRIC,
};
export default measure;

21
ui-ngx/src/app/shared/models/units/dimensionless-ratio.ts

@ -1,21 +0,0 @@
import { TbMeasure, TbMeasureUnits } from '@shared/models/unit.models';
export type DimensionlessRatioMetricUnits = 'm/m';
export type DimensionRatioUnits = DimensionlessRatioMetricUnits;
const METRIC: TbMeasureUnits<DimensionlessRatioMetricUnits> = {
units: {
'm/m': {
name: 'unit.meter-per-meter',
tags: ['ratio of length to length', 'meter per meter', 'm/m'],
to_anchor: 1,
},
},
};
const measure: TbMeasure<DimensionRatioUnits> = {
METRIC,
};
export default measure;

30
ui-ngx/src/app/shared/models/units/dynamic-viscosity.ts

@ -1,3 +1,19 @@
///
/// Copyright © 2016-2025 The Thingsboard Authors
///
/// Licensed under the Apache License, Version 2.0 (the "License");
/// you may not use this file except in compliance with the License.
/// You may obtain a copy of the License at
///
/// http://www.apache.org/licenses/LICENSE-2.0
///
/// Unless required by applicable law or agreed to in writing, software
/// distributed under the License is distributed on an "AS IS" BASIS,
/// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
/// See the License for the specific language governing permissions and
/// limitations under the License.
///
import { TbMeasure, TbMeasureUnits } from '@shared/models/unit.models';
export type DynamicViscosityMetricUnits = 'Pa·s' | 'cP' | 'P' | 'N·s/m²' | 'dyn·s/cm²' | 'kg/(m·s)';
@ -10,32 +26,32 @@ const METRIC: TbMeasureUnits<DynamicViscosityMetricUnits> = {
units: {
'Pa·s': {
name: 'unit.pascal-second',
tags: ['dynamic viscosity', 'viscosity', 'fluid mechanics', 'Pa·s'],
tags: ['fluid mechanics'],
to_anchor: 1,
},
'cP': {
name: 'unit.centipoise',
tags: ['viscosity', 'dynamic viscosity', 'fluid viscosity', 'centipoise', 'cP'],
tags: ['fluid mechanics'],
to_anchor: 0.001,
},
'P': {
name: 'unit.poise',
tags: ['viscosity', 'dynamic viscosity', 'fluid viscosity', 'poise', 'P'],
tags: ['fluid mechanics'],
to_anchor: 0.1,
},
'N·s/m²': {
name: 'unit.newton-second-per-square-meter',
tags: ['newton second per square meter', 'N·s/m²'],
tags: ['fluid mechanics'],
to_anchor: 1,
},
'dyn·s/cm²': {
name: 'unit.dyne-second-per-square-centimeter',
tags: ['dyne second per square centimeter', 'dyn·s/cm²'],
tags: ['fluid mechanics'],
to_anchor: 0.1,
},
'kg/(m·s)': {
name: 'unit.kilogram-per-meter-second',
tags: ['kilogram per meter-second', 'kg/(m·s)'],
tags: ['fluid mechanics'],
to_anchor: 1,
},
},
@ -46,7 +62,7 @@ const IMPERIAL: TbMeasureUnits<DynamicViscosityImperialUnits> = {
units: {
'lb/(ft·h)': {
name: 'unit.pound-per-foot-hour',
tags: ['pound per foot-hour', 'lb/(ft·h)'],
tags: ['fluid mechanics'],
to_anchor: 1,
},
},

18
ui-ngx/src/app/shared/models/units/earthquake-magnitude.ts

@ -1,3 +1,19 @@
///
/// Copyright © 2016-2025 The Thingsboard Authors
///
/// Licensed under the Apache License, Version 2.0 (the "License");
/// you may not use this file except in compliance with the License.
/// You may obtain a copy of the License at
///
/// http://www.apache.org/licenses/LICENSE-2.0
///
/// Unless required by applicable law or agreed to in writing, software
/// distributed under the License is distributed on an "AS IS" BASIS,
/// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
/// See the License for the specific language governing permissions and
/// limitations under the License.
///
import { TbMeasure, TbMeasureUnits } from '@shared/models/unit.models';
export type EarthquakeMagnitudeUnits = 'richter';
@ -6,7 +22,7 @@ const METRIC: TbMeasureUnits<EarthquakeMagnitudeUnits> = {
units: {
richter: {
name: 'unit.richter-scale',
tags: ['earthquake', 'seismic activity', 'richter'],
tags: ['seismic activity'],
to_anchor: 1,
},
},

22
ui-ngx/src/app/shared/models/units/electric-current.ts

@ -16,50 +16,48 @@
import { TbMeasure, TbMeasureUnits } from '@shared/models/unit.models';
export type ElectricCurrentUnits = ElectricCurrentMetricalUnits;
export type ElectricCurrentUnits = 'A' | 'pA' | 'nA' | 'μA' | 'mA' | 'kA' | 'MA' | 'GA';
export type ElectricCurrentMetricalUnits = 'A' | 'pA' | 'nA' | 'μA' | 'mA' | 'kA' | 'MA' | 'GA';
const METRIC: TbMeasureUnits<ElectricCurrentMetricalUnits> = {
const METRIC: TbMeasureUnits<ElectricCurrentUnits> = {
units: {
A: {
name: 'unit.ampere',
tags: ['electric current', 'current flow', 'flow of electricity', 'electrical flow', 'ampere', 'amperes', 'amperage', 'A'],
tags: ['current flow', 'flow of electricity', 'electrical flow', 'amperes', 'amperage'],
to_anchor: 1,
},
pA: {
name: 'unit.picoampere',
tags: ['current', 'amperes', 'picoampere', 'pA'],
tags: ['picoamperes'],
to_anchor: 1e-12,
},
nA: {
name: 'unit.nanoampere',
tags: ['electric current', 'amperes', 'nanoampere', 'nA'],
tags: ['nanoamperes'],
to_anchor: 1e-9,
},
μA: {
name: 'unit.microampere',
tags: ['electric current', 'microampere', 'microamperes', 'μA'],
tags: ['microamperes'],
to_anchor: 1e-6,
},
mA: {
name: 'unit.milliampere',
tags: ['electric current', 'milliampere', 'milliamperes', 'mA'],
tags: ['milliamperes'],
to_anchor: 0.001,
},
kA: {
name: 'unit.kiloampere',
tags: ['electric current', 'kiloampere', 'kiloamperes', 'kA'],
tags: ['kiloamperes'],
to_anchor: 1000,
},
MA: {
name: 'unit.megaampere',
tags: ['electric current', 'megaampere', 'megaamperes', 'MA'],
tags: ['megaamperes'],
to_anchor: 1e6,
},
GA: {
name: 'unit.gigaampere',
tags: ['electric current', 'gigaampere', 'gigaamperes', 'GA'],
tags: ['gigaamperes'],
to_anchor: 1e9,
},
}

39
ui-ngx/src/app/shared/models/units/electric-dipole-moment.ts

@ -0,0 +1,39 @@
///
/// Copyright © 2016-2025 The Thingsboard Authors
///
/// Licensed under the Apache License, Version 2.0 (the "License");
/// you may not use this file except in compliance with the License.
/// You may obtain a copy of the License at
///
/// http://www.apache.org/licenses/LICENSE-2.0
///
/// Unless required by applicable law or agreed to in writing, software
/// distributed under the License is distributed on an "AS IS" BASIS,
/// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
/// See the License for the specific language governing permissions and
/// limitations under the License.
///
import { TbMeasure, TbMeasureUnits } from '@shared/models/unit.models';
export type ElectricDipoleMomentUnits = 'C·m' | 'D';
const METRIC: TbMeasureUnits<ElectricDipoleMomentUnits> = {
units: {
'C·m': {
name: 'unit.electric-dipole-moment',
to_anchor: 1,
},
'D': {
name: 'unit.debye',
tags: ['polarization'],
to_anchor: 3.33564e-30
},
},
};
const measure: TbMeasure<ElectricDipoleMomentUnits> = {
METRIC,
};
export default measure;

19
ui-ngx/src/app/shared/models/units/electric-field-strength.ts

@ -1,3 +1,19 @@
///
/// Copyright © 2016-2025 The Thingsboard Authors
///
/// Licensed under the Apache License, Version 2.0 (the "License");
/// you may not use this file except in compliance with the License.
/// You may obtain a copy of the License at
///
/// http://www.apache.org/licenses/LICENSE-2.0
///
/// Unless required by applicable law or agreed to in writing, software
/// distributed under the License is distributed on an "AS IS" BASIS,
/// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
/// See the License for the specific language governing permissions and
/// limitations under the License.
///
import { TbMeasure, TbMeasureUnits } from '@shared/models/unit.models';
export type ElectricFieldStrengthUnits = 'V/m' | 'mV/m' | 'kV/m';
@ -6,17 +22,14 @@ const METRIC: TbMeasureUnits<ElectricFieldStrengthUnits> = {
units: {
'V/m': {
name: 'unit.volts-per-meter',
tags: ['electric field strength', 'volts per meter', 'V/m'],
to_anchor: 1,
},
'mV/m': {
name: 'unit.millivolts-per-meter',
tags: ['electric field strength', 'millivolts per meter', 'mV/m'],
to_anchor: 1e-3,
},
'kV/m': {
name: 'unit.kilovolts-per-meter',
tags: ['electric field strength', 'kilovolts per meter', 'kV/m'],
to_anchor: 1e3,
},
},

28
ui-ngx/src/app/shared/models/units/electric-flux.ts

@ -1,39 +1,47 @@
import { TbMeasure, TbMeasureUnits } from '@shared/models/unit.models';
///
/// Copyright © 2016-2025 The Thingsboard Authors
///
/// Licensed under the Apache License, Version 2.0 (the "License");
/// you may not use this file except in compliance with the License.
/// You may obtain a copy of the License at
///
/// http://www.apache.org/licenses/LICENSE-2.0
///
/// Unless required by applicable law or agreed to in writing, software
/// distributed under the License is distributed on an "AS IS" BASIS,
/// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
/// See the License for the specific language governing permissions and
/// limitations under the License.
///
export type ElectricFluxMetricUnits = 'V·m' | 'kV·m' | 'MV·m' | 'µV·m' | 'mV·m' | 'nV·m';
import { TbMeasure, TbMeasureUnits } from '@shared/models/unit.models';
export type ElectricFluxUnits = ElectricFluxMetricUnits;
export type ElectricFluxUnits = 'V·m' | 'kV·m' | 'MV·m' | 'µV·m' | 'mV·m' | 'nV·m';
const METRIC: TbMeasureUnits<ElectricFluxMetricUnits> = {
const METRIC: TbMeasureUnits<ElectricFluxUnits> = {
units: {
'V·m': {
name: 'unit.volt-meter',
tags: ['electric flux', 'volt-meter', 'V·m'],
to_anchor: 1,
},
'kV·m': {
name: 'unit.kilovolt-meter',
tags: ['electric flux', 'kilovolt-meter', 'kV·m'],
to_anchor: 1000,
},
'MV·m': {
name: 'unit.megavolt-meter',
tags: ['electric flux', 'megavolt-meter', 'MV·m'],
to_anchor: 1000000,
},
'µV·m': {
name: 'unit.microvolt-meter',
tags: ['electric flux', 'microvolt-meter', 'µV·m'],
to_anchor: 0.000001,
},
'mV·m': {
name: 'unit.millivolt-meter',
tags: ['electric flux', 'millivolt-meter', 'mV·m'],
to_anchor: 0.001,
},
'nV·m': {
name: 'unit.nanovolt-meter',
tags: ['electric flux', 'nanovolt-meter', 'nV·m'],
to_anchor: 0.000000001,
},
},

26
ui-ngx/src/app/shared/models/units/electric-moment.ts

@ -1,26 +0,0 @@
import { TbMeasure, TbMeasureUnits } from '@shared/models/unit.models';
export type ElectricMomentMetricUnits = 'C·m' | 'D';
export type ElectricMomentUnits = ElectricMomentMetricUnits;
const METRIC: TbMeasureUnits<ElectricMomentMetricUnits> = {
units: {
'C·m': {
name: 'unit.electric-dipole-moment',
tags: ['electric dipole', 'dipole moment', 'coulomb meter', 'C·m'],
to_anchor: 1,
},
'D': {
name: 'unit.debye',
tags: ['polarization', 'electric dipole moment', 'debye', 'D'],
to_anchor: 3.33564e-30
},
},
};
const measure: TbMeasure<ElectricMomentUnits> = {
METRIC,
};
export default measure;

23
ui-ngx/src/app/shared/models/units/electric-permittivity.ts

@ -1,14 +1,27 @@
import { TbMeasure, TbMeasureUnits } from '@shared/models/unit.models';
///
/// Copyright © 2016-2025 The Thingsboard Authors
///
/// Licensed under the Apache License, Version 2.0 (the "License");
/// you may not use this file except in compliance with the License.
/// You may obtain a copy of the License at
///
/// http://www.apache.org/licenses/LICENSE-2.0
///
/// Unless required by applicable law or agreed to in writing, software
/// distributed under the License is distributed on an "AS IS" BASIS,
/// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
/// See the License for the specific language governing permissions and
/// limitations under the License.
///
export type ElectricPermittivityMetricUnits = 'F/m';
import { TbMeasure, TbMeasureUnits } from '@shared/models/unit.models';
export type ElectricPermittivityUnits = ElectricPermittivityMetricUnits;
export type ElectricPermittivityUnits = 'F/m';
const METRIC: TbMeasureUnits<ElectricPermittivityMetricUnits> = {
const METRIC: TbMeasureUnits<ElectricPermittivityUnits> = {
units: {
'F/m': {
name: 'unit.farad-per-meter',
tags: ['electric permittivity', 'farad per meter', 'F/m'],
to_anchor: 1,
},
},

22
ui-ngx/src/app/shared/models/units/electrical-conductance.ts

@ -1,3 +1,19 @@
///
/// Copyright © 2016-2025 The Thingsboard Authors
///
/// Licensed under the Apache License, Version 2.0 (the "License");
/// you may not use this file except in compliance with the License.
/// You may obtain a copy of the License at
///
/// http://www.apache.org/licenses/LICENSE-2.0
///
/// Unless required by applicable law or agreed to in writing, software
/// distributed under the License is distributed on an "AS IS" BASIS,
/// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
/// See the License for the specific language governing permissions and
/// limitations under the License.
///
import { TbMeasure, TbMeasureUnits } from '@shared/models/unit.models';
export type ElectricalConductanceUnits = 'S' | 'mS' | 'μS' | 'kS' | 'MS' | 'GS';
@ -6,32 +22,26 @@ const METRIC: TbMeasureUnits<ElectricalConductanceUnits> = {
units: {
'S': {
name: 'unit.siemens',
tags: ['electrical conductance', 'conductance', 'siemens', 'S'],
to_anchor: 1,
},
'mS': {
name: 'unit.millisiemens',
tags: ['electrical conductance', 'conductance', 'millisiemens', 'mS'],
to_anchor: 1e-3,
},
'μS': {
name: 'unit.microsiemens',
tags: ['electrical conductance', 'conductance', 'microsiemens', 'μS'],
to_anchor: 1e-6,
},
'kS': {
name: 'unit.kilosiemens',
tags: ['electrical conductance', 'conductance', 'kilosiemens', 'kS'],
to_anchor: 1e3,
},
'MS': {
name: 'unit.megasiemens',
tags: ['electrical conductance', 'conductance', 'megasiemens', 'MS'],
to_anchor: 1e6,
},
'GS': {
name: 'unit.gigasiemens',
tags: ['electrical conductance', 'conductance', 'gigasiemens', 'GS'],
to_anchor: 1e9,
},
},

27
ui-ngx/src/app/shared/models/units/electrical-conductivity.ts

@ -1,23 +1,38 @@
///
/// Copyright © 2016-2025 The Thingsboard Authors
///
/// Licensed under the Apache License, Version 2.0 (the "License");
/// you may not use this file except in compliance with the License.
/// You may obtain a copy of the License at
///
/// http://www.apache.org/licenses/LICENSE-2.0
///
/// Unless required by applicable law or agreed to in writing, software
/// distributed under the License is distributed on an "AS IS" BASIS,
/// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
/// See the License for the specific language governing permissions and
/// limitations under the License.
///
import { TbMeasure, TbMeasureUnits } from '@shared/models/unit.models';
export type ElectricalConductivityMetricUnits = 'µS/cm' | 'mS/m' | 'S/m';
export type ElectricalConductivityUnits = ElectricalConductivityMetricUnits;
export type ElectricalConductivityUnits = 'µS/cm' | 'mS/m' | 'S/m';
const METRIC: TbMeasureUnits<ElectricalConductivityMetricUnits> = {
const METRIC: TbMeasureUnits<ElectricalConductivityUnits> = {
units: {
'S/m': {
name: 'unit.siemens-per-meter',
tags: ['Electrical conductivity', 'water quality', 'soil quality', 'siemens per meter', 'S/m'],
tags: [ 'water quality', 'soil quality'],
to_anchor: 1,
},
'µS/cm': {
name: 'unit.microsiemens-per-centimeter',
tags: ['Electrical conductivity', 'water quality', 'soil quality', 'microsiemens per centimeter', 'µS/cm'],
tags: ['water quality', 'soil quality'],
to_anchor: 0.0001,
},
'mS/m': {
name: 'unit.millisiemens-per-meter',
tags: ['Electrical conductivity', 'water quality', 'soil quality', 'millisiemens per meter', 'mS/m'],
tags: ['water quality', 'soil quality'],
to_anchor: 0.001,
},
},

26
ui-ngx/src/app/shared/models/units/energy.ts

@ -40,42 +40,36 @@ const METRIC: TbMeasureUnits<EnergyMetricUnits> = {
units: {
Wm: {
name: 'unit.watt-minute',
tags: ['energy', 'watt-minute', 'watt-minutes', 'Wm'],
to_anchor: 60,
},
Wh: {
name: 'unit.watt-hour',
tags: ['energy', 'watt-hour', 'watt-hours', 'energy usage', 'power consumption', 'energy consumption', 'electricity usage'],
tags: ['energy usage', 'power consumption', 'energy consumption', 'electricity usage'],
to_anchor: 3600,
},
mWh: {
name: 'unit.milliwatt-hour',
tags: ['energy', 'milliwatt-hour', 'milliwatt-hours', 'mWh'],
to_anchor: 3.6,
},
kWh: {
name: 'unit.kilowatt-hour',
tags: ['energy', 'kilowatt-hour', 'kilowatt-hours', 'energy usage', 'power consumption', 'energy consumption', 'electricity usage'],
tags: ['energy usage', 'power consumption', 'energy consumption', 'electricity usage'],
to_anchor: 3600000,
},
MWh: {
name: 'unit.megawatt-hour',
tags: ['energy', 'megawatt-hour', 'megawatt-hours', 'MWh'],
to_anchor: 3600000000,
},
GWh: {
name: 'unit.gigawatt-hour',
tags: ['energy', 'gigawatt-hour', 'gigawatt-hours', 'GWh'],
to_anchor: 3600000000000,
},
μJ: {
name: 'unit.microjoule',
tags: ['energy', 'microjoule', 'microjoules', 'μJ'],
to_anchor: 0.000001,
},
mJ: {
name: 'unit.millijoule',
tags: ['energy', 'millijoule', 'millijoules', 'mJ'],
to_anchor: 0.001,
},
J: {
@ -85,22 +79,19 @@ const METRIC: TbMeasureUnits<EnergyMetricUnits> = {
},
kJ: {
name: 'unit.kilojoule',
tags: ['energy', 'kilojoule', 'kilojoules', 'kJ'],
to_anchor: 1000,
},
MJ: {
name: 'unit.megajoule',
tags: ['energy', 'megajoule', 'megajoules', 'MJ'],
to_anchor: 1000000,
},
GJ: {
name: 'unit.gigajoule',
tags: ['energy', 'gigajoule', 'gigajoules', 'GJ'],
to_anchor: 1000000000,
},
eV: {
name: 'unit.electron-volts',
tags: ['energy', 'subatomic particles', 'radiation'],
tags: ['subatomic particles', 'radiation'],
to_anchor: 1.602176634e-19,
},
},
@ -111,32 +102,31 @@ const IMPERIAL: TbMeasureUnits<EnergyImperialUnits> = {
units: {
cal: {
name: 'unit.small-calorie',
tags: ['energy', 'small calorie', 'calories', 'cal'],
to_anchor: 1,
},
Cal: {
name: 'unit.calorie',
tags: ['energy', 'food energy', 'Calorie', 'Calories', 'Cal'],
tags: ['food energy'],
to_anchor: 1000,
},
kcal: {
name: 'unit.kilocalorie',
tags: ['energy', 'small calorie', 'kilocalories', 'kcal'],
tags: ['small calorie'],
to_anchor: 1000,
},
BTU: {
name: 'unit.british-thermal-unit',
tags: ['energy', 'heat', 'work done', 'british thermal unit', 'british thermal units', 'BTU'],
tags: ['heat', 'work done'],
to_anchor: 252.164401,
},
'ft·lb': {
name: 'unit.foot-pound',
tags: ['energy', 'foot-pound', 'foot-pounds', 'ft·lb', 'ft⋅lbf'],
tags: ['ft⋅lbf'],
to_anchor: 0.32404875717017,
},
thm: {
name: 'unit.therm',
tags: ['energy', 'natural gas consumption', 'BTU', 'therm', 'thm'],
tags: ['natural gas consumption', 'BTU'],
to_anchor: 25219021.687207,
},
},

9
ui-ngx/src/app/shared/models/units/force.ts

@ -26,17 +26,15 @@ const METRIC: TbMeasureUnits<ForceMetricUnits> = {
units: {
N: {
name: 'unit.newton',
tags: ['force', 'pressure', 'newton', 'newtons', 'N', 'push', 'pull', 'weight', 'gravity', 'N'],
tags: ['pressure', 'push', 'pull', 'weight'],
to_anchor: 1,
},
kN: {
name: 'unit.kilonewton',
tags: ['force', 'kN'],
to_anchor: 1000,
},
dyn: {
name: 'unit.dyne',
tags: ['force', 'dyn'],
to_anchor: 0.00001,
},
},
@ -47,27 +45,22 @@ const IMPERIAL: TbMeasureUnits<ForceImperialUnits> = {
units: {
lbf: {
name: 'unit.pound-force',
tags: ['force', 'lbf'],
to_anchor: 1,
},
kgf: {
name: 'unit.kilogram-force',
tags: ['force', 'kgf'],
to_anchor: 2.20462,
},
klbf: {
name: 'unit.kilopound-force',
tags: ['force', 'klbf'],
to_anchor: 1000,
},
pdl: {
name: 'unit.poundal',
tags: ['force', 'pdl'],
to_anchor: 0.031081,
},
kip: {
name: 'unit.kip',
tags: ['force', 'kip'],
to_anchor: 1000,
},
},

25
ui-ngx/src/app/shared/models/units/frequency.ts

@ -23,62 +23,61 @@ const METRIC: TbMeasureUnits<FrequencyMetricUnits> = {
units: {
mHz: {
name: 'unit.millihertz',
tags: ['frequency', 'cycles per second', 'millihertz', 'mHz'],
tags: ['cycles per second'],
to_anchor: 1 / 1000,
},
Hz: {
name: 'unit.hertz',
tags: ['frequency', 'cycles per second', 'hertz', 'Hz'],
tags: ['cycles per second'],
to_anchor: 1,
},
kHz: {
name: 'unit.kilohertz',
tags: ['frequency', 'cycles per second', 'kilohertz', 'kHz'],
tags: ['cycles per second'],
to_anchor: 1000,
},
MHz: {
name: 'unit.megahertz',
tags: ['frequency', 'cycles per second', 'megahertz', 'MHz'],
tags: ['cycles per second'],
to_anchor: 1000 * 1000,
},
GHz: {
name: 'unit.gigahertz',
tags: ['frequency', 'cycles per second', 'gigahertz', 'GHz'],
tags: ['cycles per second'],
to_anchor: 1000 * 1000 * 1000,
},
THz: {
name: 'unit.terahertz',
tags: ['frequency', 'terahertz', 'THz'],
to_anchor: 1000 * 1000 * 1000 * 1000,
},
rpm: {
name: 'unit.rotation-per-minute',
tags: ['frequency', 'rotation per minute', 'rotations per minute', 'rpm', 'angular velocity'],
tags: ['rotations per minute', 'angular velocity'],
to_anchor: 1 / 60,
},
RPM: {
name: 'unit.rpm',
tags: ['rotational speed', 'angular velocity', 'revolutions per minute', 'RPM'],
tags: ['rotational speed', 'angular velocity'],
to_anchor: 1 / 60,
},
'λ': {
name: 'unit.lambda',
tags: ['wavelength', 'lambda', 'λ'],
tags: ['wavelength'],
to_anchor: 299792458,
},
bpm: {
name: 'unit.beats-per-minute',
tags: ['heart rate', 'pulse', 'bpm'],
tags: ['heart rate', 'pulse'],
to_anchor: 0.0167
},
'deg/s': {
name: 'unit.deg-per-second',
tags: ['angular velocity', 'degrees per second', 'deg/s'],
to_anchor: 1 / 360, // 1 deg/s = 1/360 Hz
tags: ['angular velocity'],
to_anchor: 1 / 360,
},
'rad/s': {
name: 'unit.radian-per-second',
tags: ['angular velocity', 'rotation speed', 'rad/s'],
tags: ['angular velocity'],
to_anchor: 1 / (Math.PI * 2),
},
},

20
ui-ngx/src/app/shared/models/units/fuel-efficiency.ts

@ -1,3 +1,19 @@
///
/// Copyright © 2016-2025 The Thingsboard Authors
///
/// Licensed under the Apache License, Version 2.0 (the "License");
/// you may not use this file except in compliance with the License.
/// You may obtain a copy of the License at
///
/// http://www.apache.org/licenses/LICENSE-2.0
///
/// Unless required by applicable law or agreed to in writing, software
/// distributed under the License is distributed on an "AS IS" BASIS,
/// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
/// See the License for the specific language governing permissions and
/// limitations under the License.
///
import { TbMeasure, TbMeasureUnits } from '@shared/models/unit.models';
export type FuelEfficiencyMetricUnits = 'km/L' | 'L/100km';
@ -10,12 +26,10 @@ const METRIC: TbMeasureUnits<FuelEfficiencyMetricUnits> = {
units: {
'km/L': {
name: 'unit.kilometers-per-liter',
tags: ['fuel efficiency', 'km/L'],
to_anchor: 1,
},
'L/100km': {
name: 'unit.liters-per-100-km',
tags: ['fuel efficiency', 'L/100km'],
to_anchor: 1,
transform: (value) => 100 / value,
},
@ -27,12 +41,10 @@ const IMPERIAL: TbMeasureUnits<FuelEfficiencyImperialUnits> = {
units: {
'mpg': {
name: 'unit.miles-per-gallon',
tags: ['fuel efficiency', 'mpg'],
to_anchor: 0.425144,
},
'gal/mi': {
name: 'unit.gallons-per-mile',
tags: ['fuel efficiency', 'gal/mi'],
to_anchor: 2.35214583,
},
},

26
ui-ngx/src/app/shared/models/units/heat-capacity.ts

@ -1,15 +1,29 @@
import { TbMeasure, TbMeasureUnits } from '@shared/models/unit.models';
///
/// Copyright © 2016-2025 The Thingsboard Authors
///
/// Licensed under the Apache License, Version 2.0 (the "License");
/// you may not use this file except in compliance with the License.
/// You may obtain a copy of the License at
///
/// http://www.apache.org/licenses/LICENSE-2.0
///
/// Unless required by applicable law or agreed to in writing, software
/// distributed under the License is distributed on an "AS IS" BASIS,
/// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
/// See the License for the specific language governing permissions and
/// limitations under the License.
///
export type HeatCapacityMetricUnits = 'J/K';
import { TbMeasure, TbMeasureUnits } from '@shared/models/unit.models';
export type HeatCapacityUnits = HeatCapacityMetricUnits;
export type HeatCapacityUnits = 'J/K';
const METRIC: TbMeasureUnits<HeatCapacityMetricUnits> = {
const METRIC: TbMeasureUnits<HeatCapacityUnits> = {
units: {
'J/K': {
name: 'unit.joule-per-kelvin',
tags: ['specific heat capacity', 'heat capacity per unit temperature', 'joule per kelvin', 'J/K'],
to_anchor: 1, // Base unit: J/K
tags: ['heat capacity per unit temperature'],
to_anchor: 1,
},
},
};

20
ui-ngx/src/app/shared/models/units/humidity.ts

@ -1,20 +0,0 @@
import { TbMeasure, TbMeasureUnits } from '@shared/models/unit.models';
export type HumidityUnits = HumidityMetricUnits;
export type HumidityMetricUnits = 'g/kg';
const METRIC: TbMeasureUnits<HumidityMetricUnits> = {
units: {
'g/kg': {
name: 'unit.gram-per-kilogram',
tags: ['humidity', 'moisture', 'specific humidity', 'g/kg'],
to_anchor: 1,
},
},
};
const measure: TbMeasure<HumidityUnits> = {
METRIC,
};
export default measure;

8
ui-ngx/src/app/shared/models/units/illuminance.ts

@ -26,17 +26,17 @@ const METRIC: TbMeasureUnits<IlluminanceMetricUnits> = {
units: {
lx: {
name: 'unit.lux',
tags: ['illumination', 'light level on a surface', 'illuminance', 'Lux', 'lx'],
tags: ['light level on a surface', 'illuminance', 'Lux', 'lx'],
to_anchor: 1,
},
'cd/m²': {
name: 'unit.candela-per-square-meter',
tags: ['brightness', 'light level', 'Luminance', 'Candela per square meter', 'cd/m²'],
tags: ['brightness', 'light level', 'Luminance'],
to_anchor: 1,
},
'lm/m²': {
name: 'unit.lumen-per-square-meter',
tags: ['illumination', 'light level', 'lumen per square meter', 'lm/m²'],
tags: ['light level'],
to_anchor: 1,
},
},
@ -47,7 +47,7 @@ const IMPERIAL: TbMeasureUnits<IlluminanceImperialUnits> = {
units: {
'fc': {
name: 'unit.foot-candle',
tags: ['illuminance', 'light level', 'foot-candle', 'fc'],
tags: ['illuminance', 'light level'],
to_anchor: 1,
},
},

16
ui-ngx/src/app/shared/models/units/inductance.ts

@ -1,3 +1,19 @@
///
/// Copyright © 2016-2025 The Thingsboard Authors
///
/// Licensed under the Apache License, Version 2.0 (the "License");
/// you may not use this file except in compliance with the License.
/// You may obtain a copy of the License at
///
/// http://www.apache.org/licenses/LICENSE-2.0
///
/// Unless required by applicable law or agreed to in writing, software
/// distributed under the License is distributed on an "AS IS" BASIS,
/// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
/// See the License for the specific language governing permissions and
/// limitations under the License.
///
import { TbMeasure, TbMeasureUnits } from '@shared/models/unit.models';
export type InductanceMetricUnits = 'H' | 'mH' | 'µH' | 'nH' | 'T·m/A';

26
ui-ngx/src/app/shared/models/units/kinematic-viscosity.ts

@ -1,3 +1,19 @@
///
/// Copyright © 2016-2025 The Thingsboard Authors
///
/// Licensed under the Apache License, Version 2.0 (the "License");
/// you may not use this file except in compliance with the License.
/// You may obtain a copy of the License at
///
/// http://www.apache.org/licenses/LICENSE-2.0
///
/// Unless required by applicable law or agreed to in writing, software
/// distributed under the License is distributed on an "AS IS" BASIS,
/// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
/// See the License for the specific language governing permissions and
/// limitations under the License.
///
import { TbMeasure, TbMeasureUnits } from '@shared/models/unit.models';
export type KinematicViscosityMetricUnits = 'm²/s' | 'cm²/s' | 'St' | 'cSt';
@ -10,23 +26,19 @@ const METRIC: TbMeasureUnits<KinematicViscosityMetricUnits> = {
units: {
'm²/s': {
name: 'unit.square-meter-per-second',
tags: ['kinematic viscosity', 'm²/s'],
to_anchor: 1,
},
'cm²/s': {
name: 'unit.square-centimeter-per-second',
tags: ['kinematic viscosity', 'cm²/s'],
to_anchor: 1e-4,
},
'St': {
name: 'unit.stoke',
tags: ['kinematic viscosity', 'stokes', 'St'],
to_anchor: 1e-4, // St to m²/s
to_anchor: 1e-4,
},
'cSt': {
name: 'unit.centistokes',
tags: ['kinematic viscosity', 'centistokes', 'cSt'],
to_anchor: 1e-6, // cSt to m²/s
to_anchor: 1e-6,
},
},
};
@ -36,12 +48,10 @@ const IMPERIAL: TbMeasureUnits<KinematicViscosityImperialUnits> = {
units: {
'ft²/s': {
name: 'unit.square-foot-per-second',
tags: ['kinematic viscosity', 'ft²/s'],
to_anchor: 0.09290304,
},
'in²/s': {
name: 'unit.square-inch-per-second',
tags: ['kinematic viscosity', 'in²/s'],
to_anchor: 0.00064516,
},
},

50
ui-ngx/src/app/shared/models/units/length.ts

@ -43,42 +43,42 @@ const METRIC: TbMeasureUnits<LengthMetricUnits> = {
units: {
nm: {
name: 'unit.nanometer',
tags: ['level', 'height', 'distance', 'length', 'width', 'gap', 'depth', 'nanoscale', 'atomic scale', 'molecular scale', 'nanometer', 'nanometers', 'nm'],
tags: ['level', 'height', 'distance', 'width', 'gap', 'depth', 'nanoscale', 'atomic scale', 'molecular scale'],
to_anchor: 1e-9,
},
μm: {
name: 'unit.micrometer',
tags: ['level', 'height', 'distance', 'length', 'width', 'gap', 'depth', 'microns', 'micrometer', 'micrometers', 'µm'],
tags: ['level', 'height', 'distance', 'width', 'gap', 'depth', 'microns'],
to_anchor: 1e-6,
},
mm: {
name: 'unit.millimeter',
tags: ['level', 'height', 'distance', 'length', 'width', 'gap', 'depth', 'millimeter', 'millimeters', 'rainfall', 'precipitation', 'displacement', 'position', 'movement', 'transition', 'mm'],
tags: ['level', 'height', 'distance', 'width', 'gap', 'depth', 'rainfall', 'precipitation', 'displacement', 'position', 'movement', 'transition'],
to_anchor: 1e-3,
},
cm: {
name: 'unit.centimeter',
tags: ['level', 'height', 'distance', 'length', 'width', 'gap', 'depth', 'centimeter', 'centimeters', 'rainfall', 'precipitation', 'displacement', 'position', 'movement', 'transition', 'cm'],
tags: ['level', 'height', 'distance', 'width', 'gap', 'depth', 'rainfall', 'precipitation', 'displacement', 'position', 'movement', 'transition'],
to_anchor: 1e-2,
},
dm: {
name: 'unit.decimeter',
tags: ['level', 'height', 'distance', 'length', 'width', 'gap', 'depth', 'decimeter', 'decimeters', 'dm'],
tags: ['level', 'height', 'distance', 'width', 'gap', 'depth'],
to_anchor: 1e-1,
},
m: {
name: 'unit.meter',
tags: ['level', 'height', 'distance', 'length', 'width', 'gap', 'depth', 'meter', 'meters', 'm'],
tags: ['level', 'height', 'distance', 'width', 'gap', 'depth'],
to_anchor: 1,
},
km: {
name: 'unit.kilometer',
tags: ['distance', 'height', 'length', 'width', 'gap', 'depth', 'kilometer', 'kilometers', 'km'],
tags: ['distance', 'height', 'width', 'gap', 'depth'],
to_anchor: 1e3,
},
angstrom: {
name: 'unit.angstrom',
tags: ['level', 'height', 'distance', 'length', 'width', 'gap', 'depth', 'atomic scale', 'atomic distance', 'nanoscale', 'angstrom', 'angstroms', '],
tags: ['level', 'height', 'distance', 'width', 'gap', 'depth', 'atomic scale', 'atomic distance', 'nanoscale'],
to_anchor: 1e-10,
},
},
@ -89,87 +89,87 @@ const IMPERIAL: TbMeasureUnits<LengthImperialUnits> = {
units: {
in: {
name: 'unit.inch',
tags: ['level', 'height', 'distance', 'length', 'width', 'gap', 'depth', 'inch', 'inches', 'in'],
tags: ['level', 'height', 'distance', 'width', 'gap', 'depth'],
to_anchor: 1 / 12,
},
yd: {
name: 'unit.yard',
tags: ['level', 'height', 'distance', 'length', 'width', 'gap', 'depth', 'yard', 'yards', 'yd'],
tags: ['level', 'height', 'distance', 'width', 'gap', 'depth'],
to_anchor: 3,
},
'ft-us': {
name: 'unit.foot-us',
tags: ['length', 'us survey foot', 'us survey feet', 'ft-us', 'surveying'],
tags: ['us survey foot', 'us survey feet', 'ft-us', 'surveying'],
to_anchor: 1.000002,
},
ft: {
name: 'unit.foot',
tags: ['level', 'height', 'distance', 'length', 'width', 'gap', 'depth', 'foot', 'feet', 'ft'],
tags: ['level', 'height', 'distance', 'width', 'gap', 'depth', 'feet'],
to_anchor: 1,
},
fathom: {
name: 'unit.fathom',
tags: ['depth', 'nautical measurement', 'fathom'],
tags: ['depth', 'nautical measurement'],
to_anchor: 6,
},
mi: {
name: 'unit.mile',
tags: ['level', 'height', 'distance', 'length', 'width', 'gap', 'depth', 'mile', 'miles', 'mi'],
tags: ['level', 'height', 'distance', 'width', 'gap', 'depth'],
to_anchor: 5280,
},
nmi: {
name: 'unit.nautical-mile',
tags: ['level', 'height', 'distance', 'length', 'width', 'gap', 'depth', 'nautical mile', 'nmi'],
tags: ['level', 'height', 'distance', 'width', 'gap', 'depth', 'nautical mile'],
to_anchor: 6076.12,
},
thou: {
name: 'unit.thou',
tags: ['length', 'measurement', 'thou'],
tags: ['measurement'],
to_anchor: 0.001 / 12,
},
barleycorn: {
name: 'unit.barleycorn',
tags: ['length', 'shoe size', 'barleycorn'],
tags: ['shoe size'],
to_anchor: 1 / 36,
},
hand: {
name: 'unit.hand',
tags: ['length', 'horse measurement', 'hand'],
tags: ['horse measurement'],
to_anchor: 4 / 12,
},
ch: {
name: 'unit.chain',
tags: ['length', 'land surveying', 'ch'],
tags: ['land surveying'],
to_anchor: 66,
},
fur: {
name: 'unit.furlong',
tags: ['length', 'land surveying', 'fur'],
tags: ['land surveying'],
to_anchor: 660,
},
league: {
name: 'unit.league',
tags: ['length', 'historical measurement', 'league'],
tags: ['historical measurement'],
to_anchor: 3 * 5280,
},
link: {
name: 'unit.link',
tags: ['length', 'land surveying', 'link'],
tags: ['land surveying'],
to_anchor: 0.66,
},
rod: {
name: 'unit.rod',
tags: ['length', 'land surveying', 'rod'],
tags: ['land surveying'],
to_anchor: 16.5,
},
cable: {
name: 'unit.cable',
tags: ['distance', 'nautical measurement', 'cable'],
tags: ['distance', 'nautical measurement'],
to_anchor: 600,
},
AU: {
name: 'unit.astronomical-unit',
tags: ['distance', 'celestial bodies', 'solar system', 'AU'],
tags: ['distance', 'celestial bodies', 'solar system'],
to_anchor: 149597870700 * 3.28084,
},
},

24
ui-ngx/src/app/shared/models/units/light-exposure.ts

@ -1,14 +1,28 @@
import { TbMeasure, TbMeasureUnits } from '@shared/models/unit.models';
///
/// Copyright © 2016-2025 The Thingsboard Authors
///
/// Licensed under the Apache License, Version 2.0 (the "License");
/// you may not use this file except in compliance with the License.
/// You may obtain a copy of the License at
///
/// http://www.apache.org/licenses/LICENSE-2.0
///
/// Unless required by applicable law or agreed to in writing, software
/// distributed under the License is distributed on an "AS IS" BASIS,
/// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
/// See the License for the specific language governing permissions and
/// limitations under the License.
///
export type LightExposureMetricUnits = 'lx·s';
import { TbMeasure, TbMeasureUnits } from '@shared/models/unit.models';
export type LightExposureUnits = LightExposureMetricUnits;
export type LightExposureUnits = 'lx·s';
const METRIC: TbMeasureUnits<LightExposureMetricUnits> = {
const METRIC: TbMeasureUnits<LightExposureUnits> = {
units: {
'lx·s': {
name: 'unit.lux-second',
tags: ['light exposure', 'illuminance over time', 'lux-second', 'lx·s'],
tags: ['illuminance over time'],
to_anchor: 1,
},
},

24
ui-ngx/src/app/shared/models/units/liner-charge-density.ts

@ -1,14 +1,28 @@
import { TbMeasure, TbMeasureUnits } from '@shared/models/unit.models';
///
/// Copyright © 2016-2025 The Thingsboard Authors
///
/// Licensed under the Apache License, Version 2.0 (the "License");
/// you may not use this file except in compliance with the License.
/// You may obtain a copy of the License at
///
/// http://www.apache.org/licenses/LICENSE-2.0
///
/// Unless required by applicable law or agreed to in writing, software
/// distributed under the License is distributed on an "AS IS" BASIS,
/// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
/// See the License for the specific language governing permissions and
/// limitations under the License.
///
export type LinerChargeDensityMetricUnits = 'C/m';
import { TbMeasure, TbMeasureUnits } from '@shared/models/unit.models';
export type LinerChargeDensityUnits = LinerChargeDensityMetricUnits;
export type LinerChargeDensityUnits = 'C/m';
const METRIC: TbMeasureUnits<LinerChargeDensityMetricUnits> = {
const METRIC: TbMeasureUnits<LinerChargeDensityUnits> = {
units: {
'C/m': {
name: 'unit.coulomb-per-meter',
tags: ['electric displacement field per length', 'coulomb per meter', 'C/m'],
tags: ['electric displacement field per length'],
to_anchor: 1,
},
},

45
ui-ngx/src/app/shared/models/units/logarithmic-ratio.ts

@ -0,0 +1,45 @@
///
/// Copyright © 2016-2025 The Thingsboard Authors
///
/// Licensed under the Apache License, Version 2.0 (the "License");
/// you may not use this file except in compliance with the License.
/// You may obtain a copy of the License at
///
/// http://www.apache.org/licenses/LICENSE-2.0
///
/// Unless required by applicable law or agreed to in writing, software
/// distributed under the License is distributed on an "AS IS" BASIS,
/// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
/// See the License for the specific language governing permissions and
/// limitations under the License.
///
import { TbMeasure, TbMeasureUnits } from '@shared/models/unit.models';
export type LogarithmicRatioUnits = 'dB' | 'B' | 'Np';
const METRIC: TbMeasureUnits<LogarithmicRatioUnits> = {
units: {
'dB': {
name: 'unit.decibel',
tags: ['noise level', 'sound level', 'volume', 'acoustics'],
to_anchor: 1,
},
'B': {
name: 'unit.bel',
tags: ['power ratio', 'intensity ratio'],
to_anchor: 10,
},
'Np': {
name: 'unit.neper',
tags: ['gain', 'loss', 'attenuation'],
to_anchor: 8.685889638,
},
},
};
const measure: TbMeasure<LogarithmicRatioUnits> = {
METRIC,
};
export default measure;

29
ui-ngx/src/app/shared/models/units/logarithmic-units.ts

@ -1,29 +0,0 @@
import { TbMeasure, TbMeasureUnits } from '@shared/models/unit.models';
export type LogarithmicUnits = 'dB' | 'B' | 'Np';
const METRIC: TbMeasureUnits<LogarithmicUnits> = {
units: {
'dB': {
name: 'unit.decibel',
tags: ['noise level', 'sound level', 'volume', 'acoustics', 'decibel', 'dB'],
to_anchor: 1,
},
'B': {
name: 'unit.bel',
tags: ['logarithmic unit', 'power ratio', 'intensity ratio', 'bel', 'B'],
to_anchor: 10,
},
'Np': {
name: 'unit.neper',
tags: ['logarithmic unit', 'ratio', 'gain', 'loss', 'attenuation', 'neper', 'Np'],
to_anchor: 8.685889638,
},
},
};
const measure: TbMeasure<LogarithmicUnits> = {
METRIC,
};
export default measure;

24
ui-ngx/src/app/shared/models/units/luminous-efficacy.ts

@ -1,14 +1,28 @@
import { TbMeasure, TbMeasureUnits } from '@shared/models/unit.models';
///
/// Copyright © 2016-2025 The Thingsboard Authors
///
/// Licensed under the Apache License, Version 2.0 (the "License");
/// you may not use this file except in compliance with the License.
/// You may obtain a copy of the License at
///
/// http://www.apache.org/licenses/LICENSE-2.0
///
/// Unless required by applicable law or agreed to in writing, software
/// distributed under the License is distributed on an "AS IS" BASIS,
/// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
/// See the License for the specific language governing permissions and
/// limitations under the License.
///
export type LuminousEfficacyMetricUnits = 'lm/W';
import { TbMeasure, TbMeasureUnits } from '@shared/models/unit.models';
export type LuminousEfficacyUnits = LuminousEfficacyMetricUnits;
export type LuminousEfficacyUnits = 'lm/W';
const METRIC: TbMeasureUnits<LuminousEfficacyMetricUnits> = {
const METRIC: TbMeasureUnits<LuminousEfficacyUnits> = {
units: {
'lm/W': {
name: 'unit.lumens-per-watt',
tags: ['luminous efficacy', 'lighting efficiency', 'lumens per watt', 'lm/W'],
tags: ['lighting efficiency'],
to_anchor: 1,
},
},

24
ui-ngx/src/app/shared/models/units/luminous-flux.ts

@ -1,14 +1,28 @@
import { TbMeasure, TbMeasureUnits } from '@shared/models/unit.models';
///
/// Copyright © 2016-2025 The Thingsboard Authors
///
/// Licensed under the Apache License, Version 2.0 (the "License");
/// you may not use this file except in compliance with the License.
/// You may obtain a copy of the License at
///
/// http://www.apache.org/licenses/LICENSE-2.0
///
/// Unless required by applicable law or agreed to in writing, software
/// distributed under the License is distributed on an "AS IS" BASIS,
/// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
/// See the License for the specific language governing permissions and
/// limitations under the License.
///
export type LuminousFluxMetricUnits = 'lm';
import { TbMeasure, TbMeasureUnits } from '@shared/models/unit.models';
export type LuminousFluxUnits = LuminousFluxMetricUnits;
export type LuminousFluxUnits = 'lm';
const METRIC: TbMeasureUnits<LuminousFluxMetricUnits> = {
const METRIC: TbMeasureUnits<LuminousFluxUnits> = {
units: {
'lm': {
name: 'unit.lumen',
tags: ['luminous flux', 'total light output', 'lumen', 'lm'],
tags: ['total light output'],
to_anchor: 1,
},
},

24
ui-ngx/src/app/shared/models/units/luminous-intensity.ts

@ -1,14 +1,28 @@
import { TbMeasure, TbMeasureUnits } from '@shared/models/unit.models';
///
/// Copyright © 2016-2025 The Thingsboard Authors
///
/// Licensed under the Apache License, Version 2.0 (the "License");
/// you may not use this file except in compliance with the License.
/// You may obtain a copy of the License at
///
/// http://www.apache.org/licenses/LICENSE-2.0
///
/// Unless required by applicable law or agreed to in writing, software
/// distributed under the License is distributed on an "AS IS" BASIS,
/// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
/// See the License for the specific language governing permissions and
/// limitations under the License.
///
export type LuminousIntensityMetricUnits = 'cd';
import { TbMeasure, TbMeasureUnits } from '@shared/models/unit.models';
export type LuminousIntensityUnits = LuminousIntensityMetricUnits;
export type LuminousIntensityUnits = 'cd';
const METRIC: TbMeasureUnits<LuminousIntensityMetricUnits> = {
const METRIC: TbMeasureUnits<LuminousIntensityUnits> = {
units: {
'cd': {
name: 'unit.candela',
tags: ['luminous intensity', 'light intensity', 'candela', 'cd'],
tags: ['light intensity'],
to_anchor: 1,
},
},

23
ui-ngx/src/app/shared/models/units/magnetic-field-gradient.ts

@ -1,18 +1,31 @@
///
/// Copyright © 2016-2025 The Thingsboard Authors
///
/// Licensed under the Apache License, Version 2.0 (the "License");
/// you may not use this file except in compliance with the License.
/// You may obtain a copy of the License at
///
/// http://www.apache.org/licenses/LICENSE-2.0
///
/// Unless required by applicable law or agreed to in writing, software
/// distributed under the License is distributed on an "AS IS" BASIS,
/// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
/// See the License for the specific language governing permissions and
/// limitations under the License.
///
import { TbMeasure, TbMeasureUnits } from '@shared/models/unit.models';
export type MagneticFieldGradientUnits = MagneticFieldGradientMetricUnits;
export type MagneticFieldGradientMetricUnits = 'T/m' | 'G/cm';
export type MagneticFieldGradientUnits = 'T/m' | 'G/cm';
const METRIC: TbMeasureUnits<MagneticFieldGradientMetricUnits> = {
const METRIC: TbMeasureUnits<MagneticFieldGradientUnits> = {
units: {
'T/m': {
name: 'unit.tesla-per-meter',
tags: ['magnetic field', 'tesla per meter', 'T/m'],
to_anchor: 1,
},
'G/cm': {
name: 'unit.gauss-per-centimeter',
tags: ['magnetic field', 'gauss per centimeter', 'G/cm'],
to_anchor: 0.01,
},
},

71
ui-ngx/src/app/shared/models/units/magnetic-field.ts

@ -1,71 +0,0 @@
import { TbMeasure, TbMeasureUnits } from '@shared/models/unit.models';
export type MagneticFieldMetricUnits = 'T' | 'mT' | 'μT' | 'nT' | 'kT' | 'MT' | 'G' | 'kG' | 'γ' | 'A/m' | 'Oe';
export type MagneticFieldUnits = MagneticFieldMetricUnits;
const METRIC: TbMeasureUnits<MagneticFieldMetricUnits> = {
units: {
'T': {
name: 'unit.tesla',
tags: ['magnetic field', 'magnetic field strength', 'tesla', 'T', 'magnetic flux density'],
to_anchor: 1,
},
'mT': {
name: 'unit.millitesla',
tags: ['magnetic field', 'magnetic field strength', 'millitesla', 'mT'],
to_anchor: 0.001,
},
'μT': {
name: 'unit.microtesla',
tags: ['magnetic field', 'magnetic field strength', 'microtesla', 'μT'],
to_anchor: 0.000001,
},
'nT': {
name: 'unit.nanotesla',
tags: ['magnetic field', 'magnetic field strength', 'nanotesla', 'nT'],
to_anchor: 0.000000001,
},
'kT': {
name: 'unit.kilotesla',
tags: ['magnetic field', 'magnetic field strength', 'kilotesla', 'kT'],
to_anchor: 1000,
},
'MT': {
name: 'unit.megatesla',
tags: ['magnetic field', 'magnetic field strength', 'megatesla', 'MT'],
to_anchor: 1000000,
},
'G': {
name: 'unit.gauss',
tags: ['magnetic field', 'magnetic field strength', 'gauss', 'G', 'magnetic flux density'],
to_anchor: 0.0001,
},
'kG': {
name: 'unit.kilogauss',
tags: ['magnetic field', 'magnetic field strength', 'kilogauss', 'kG', 'magnetic flux density'],
to_anchor: 0.1,
},
'γ': {
name: 'unit.gamma',
tags: ['magnetic flux density', 'gamma', 'γ'],
to_anchor: 0.000000001,
},
'A/m': {
name: 'unit.ampere-per-meter',
tags: ['magnetic field strength', 'magnetic field intensity', 'ampere per meter', 'A/m'],
to_anchor: 0.00000125663706143591,
},
'Oe': {
name: 'unit.oersted',
tags: ['magnetic field', 'oersted', 'Oe'],
to_anchor: 0.0001,
},
},
};
const measure: TbMeasure<MagneticFieldUnits> = {
METRIC,
};
export default measure;

84
ui-ngx/src/app/shared/models/units/magnetic-flux-density.ts

@ -0,0 +1,84 @@
///
/// Copyright © 2016-2025 The Thingsboard Authors
///
/// Licensed under the Apache License, Version 2.0 (the "License");
/// you may not use this file except in compliance with the License.
/// You may obtain a copy of the License at
///
/// http://www.apache.org/licenses/LICENSE-2.0
///
/// Unless required by applicable law or agreed to in writing, software
/// distributed under the License is distributed on an "AS IS" BASIS,
/// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
/// See the License for the specific language governing permissions and
/// limitations under the License.
///
import { TbMeasure, TbMeasureUnits } from '@shared/models/unit.models';
export type MagneticFluxDensityUnits = 'T' | 'mT' | 'μT' | 'nT' | 'kT' | 'MT' | 'G' | 'kG' | 'γ' | 'A/m' | 'Oe';
const METRIC: TbMeasureUnits<MagneticFluxDensityUnits> = {
units: {
T: {
name: 'unit.tesla',
tags: ['magnetic field strength'],
to_anchor: 1,
},
mT: {
name: 'unit.millitesla',
tags: ['magnetic field strength'],
to_anchor: 0.001,
},
μT: {
name: 'unit.microtesla',
tags: ['magnetic field strength'],
to_anchor: 0.000001,
},
nT: {
name: 'unit.nanotesla',
tags: ['magnetic field strength'],
to_anchor: 0.000000001,
},
kT: {
name: 'unit.kilotesla',
tags: ['magnetic field strength'],
to_anchor: 1000,
},
MT: {
name: 'unit.megatesla',
tags: ['magnetic field strength'],
to_anchor: 1000000,
},
G: {
name: 'unit.gauss',
tags: ['magnetic field strength'],
to_anchor: 0.0001,
},
kG: {
name: 'unit.kilogauss',
tags: ['magnetic field strength'],
to_anchor: 0.1,
},
γ: {
name: 'unit.gamma',
to_anchor: 0.000000001,
},
'A/m': {
name: 'unit.ampere-per-meter',
tags: ['magnetic field strength', 'magnetic field intensity'],
to_anchor: 0.00000125663706143591,
},
Oe: {
name: 'unit.oersted',
tags: ['magnetic field strength'],
to_anchor: 0.0001,
},
},
};
const measure: TbMeasure<MagneticFluxDensityUnits> = {
METRIC,
};
export default measure;

31
ui-ngx/src/app/shared/models/units/magnetic-flux.ts

@ -1,37 +1,48 @@
///
/// Copyright © 2016-2025 The Thingsboard Authors
///
/// Licensed under the Apache License, Version 2.0 (the "License");
/// you may not use this file except in compliance with the License.
/// You may obtain a copy of the License at
///
/// http://www.apache.org/licenses/LICENSE-2.0
///
/// Unless required by applicable law or agreed to in writing, software
/// distributed under the License is distributed on an "AS IS" BASIS,
/// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
/// See the License for the specific language governing permissions and
/// limitations under the License.
///
import { TbMeasure, TbMeasureUnits } from '@shared/models/unit.models';
export type MagneticFluxUnits = 'Wb' | 'µWb' | 'mWb' | 'Mx' | 'G·cm²' | 'kG·cm²';
const METRIC: TbMeasureUnits<MagneticFluxUnits> = {
units: {
'Wb': {
Wb: {
name: 'unit.weber',
tags: ['magnetic flux', 'weber', 'Wb'],
to_anchor: 1,
},
'µWb': {
µWb: {
name: 'unit.microweber',
tags: ['magnetic flux', 'microweber', 'µWb'],
to_anchor: 1e-6,
},
'mWb': {
mWb: {
name: 'unit.milliweber',
tags: ['magnetic flux', 'milliweber', 'mWb'],
to_anchor: 1e-3,
},
'Mx': {
Mx: {
name: 'unit.maxwell',
tags: ['magnetic flux', 'magnetic field', 'maxwell', 'Mx'],
tags: ['magnetic field'],
to_anchor: 1e-8,
},
'G·cm²': {
name: 'unit.gauss-square-centimeter',
tags: ['magnetic flux', 'gauss-square centimeter', 'G·cm²'],
to_anchor: 1e-8,
},
'kG·cm²': {
name: 'unit.kilogauss-square-centimeter',
tags: ['magnetic flux', 'kilogauss-square centimeter', 'kG·cm²'],
to_anchor: 1e-5,
},
},

28
ui-ngx/src/app/shared/models/units/magnetic-moment.ts

@ -1,19 +1,33 @@
import { TbMeasure, TbMeasureUnits } from '@shared/models/unit.models';
///
/// Copyright © 2016-2025 The Thingsboard Authors
///
/// Licensed under the Apache License, Version 2.0 (the "License");
/// you may not use this file except in compliance with the License.
/// You may obtain a copy of the License at
///
/// http://www.apache.org/licenses/LICENSE-2.0
///
/// Unless required by applicable law or agreed to in writing, software
/// distributed under the License is distributed on an "AS IS" BASIS,
/// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
/// See the License for the specific language governing permissions and
/// limitations under the License.
///
export type MagneticMomentMetricUnits = 'A·m²' | 'μB';
import { TbMeasure, TbMeasureUnits } from '@shared/models/unit.models';
export type MagneticMomentUnits = MagneticMomentMetricUnits;
export type MagneticMomentUnits = 'A·m²' | 'μB';
const METRIC: TbMeasureUnits<MagneticMomentMetricUnits> = {
const METRIC: TbMeasureUnits<MagneticMomentUnits> = {
units: {
'A·m²': {
name: 'unit.magnetic-dipole-moment',
tags: ['magnetic dipole', 'dipole moment', 'ampere square meter', 'A·m²'],
tags: ['magnetic dipole moment'],
to_anchor: 1,
},
'μB': {
μB: {
name: 'unit.bohr-magneton',
tags: ['atomic physics', 'magnetic moment', 'bohr magneton', 'μB'],
tags: ['atomic physics'],
to_anchor: 9.274e-24,
},
},

40
ui-ngx/src/app/shared/models/units/magnetic-permeability.ts

@ -0,0 +1,40 @@
///
/// Copyright © 2016-2025 The Thingsboard Authors
///
/// Licensed under the Apache License, Version 2.0 (the "License");
/// you may not use this file except in compliance with the License.
/// You may obtain a copy of the License at
///
/// http://www.apache.org/licenses/LICENSE-2.0
///
/// Unless required by applicable law or agreed to in writing, software
/// distributed under the License is distributed on an "AS IS" BASIS,
/// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
/// See the License for the specific language governing permissions and
/// limitations under the License.
///
import { TbMeasure, TbMeasureUnits } from '@shared/models/unit.models';
export type MagneticPermeabilityUnits = 'H/m' | 'G/Oe';
const METRIC: TbMeasureUnits<MagneticPermeabilityUnits> = {
units: {
'H/m': {
name: 'unit.henry-per-meter',
to_anchor: 1,
},
'G/Oe': {
name: 'unit.gauss-per-oersted',
tags: ['magnetic field'],
to_anchor: 1/ 795774.715,
},
},
};
const measure: TbMeasure<MagneticPermeabilityUnits> = {
METRIC,
};
export default measure;

35
ui-ngx/src/app/shared/models/units/mass-fraction.ts

@ -0,0 +1,35 @@
///
/// Copyright © 2016-2025 The Thingsboard Authors
///
/// Licensed under the Apache License, Version 2.0 (the "License");
/// you may not use this file except in compliance with the License.
/// You may obtain a copy of the License at
///
/// http://www.apache.org/licenses/LICENSE-2.0
///
/// Unless required by applicable law or agreed to in writing, software
/// distributed under the License is distributed on an "AS IS" BASIS,
/// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
/// See the License for the specific language governing permissions and
/// limitations under the License.
///
import { TbMeasure, TbMeasureUnits } from '@shared/models/unit.models';
export type MassFractionUnits = '°Bx';
const METRIC: TbMeasureUnits<MassFractionUnits> = {
units: {
'°Bx': {
name: 'unit.degrees-brix',
tags: ['sugar content', 'fruit ripeness'],
to_anchor: 1,
},
},
};
const measure: TbMeasure<MassFractionUnits> = {
METRIC,
};
export default measure;

32
ui-ngx/src/app/shared/models/units/mass.ts

@ -26,37 +26,37 @@ const METRIC: TbMeasureUnits<MassMetricUnits> = {
units: {
ng: {
name: 'unit.nanogram',
tags: ['mass', 'weight', 'heaviness', 'load', 'nanogram', 'nanograms', 'ng'],
tags: ['weight', 'heaviness', 'load'],
to_anchor: 1e-9,
},
mcg: {
name: 'unit.microgram',
tags: ['mass', 'weight', 'heaviness', 'load', 'μg', 'microgram'],
tags: ['weight', 'heaviness', 'load'],
to_anchor: 1e-6,
},
mg: {
name: 'unit.milligram',
tags: ['mass', 'weight', 'heaviness', 'load', 'milligram', 'miligrams', 'mg'],
tags: ['weight', 'heaviness', 'load'],
to_anchor: 1e-3,
},
g: {
name: 'unit.gram',
tags: ['mass', 'weight', 'heaviness', 'load', 'gram', 'grams', 'g'],
tags: ['weight', 'heaviness', 'load'],
to_anchor: 1,
},
kg: {
name: 'unit.kilogram',
tags: ['mass', 'weight', 'heaviness', 'load', 'kilogram', 'kilograms', 'kg'],
tags: ['weight', 'heaviness', 'load'],
to_anchor: 1000,
},
t: {
name: 'unit.tonne',
tags: ['mass', 'weight', 'heaviness', 'load', 'tonne', 'tons', 't'],
tags: ['weight', 'heaviness', 'load'],
to_anchor: 1000000,
},
Da: {
name: 'unit.dalton',
tags: ['atomic mass unit', 'AMU', 'unified atomic mass unit', 'dalton', 'Da'],
tags: ['atomic mass unit', 'AMU', 'unified atomic mass unit'],
to_anchor: 1.66053906660e-24,
},
ct: {
@ -72,47 +72,47 @@ const IMPERIAL: TbMeasureUnits<MassImperialUnits> = {
units: {
oz: {
name: 'unit.ounce',
tags: ['mass', 'weight', 'heaviness', 'load', 'ounce', 'ounces', 'oz'],
tags: ['weight', 'heaviness', 'load'],
to_anchor: 1 / 16,
},
lb: {
name: 'unit.pound',
tags: ['mass', 'weight', 'heaviness', 'load', 'pound', 'pounds', 'lb'],
tags: ['weight', 'heaviness', 'load'],
to_anchor: 1,
},
st: {
name: 'unit.stone',
tags: ['mass', 'weight', 'heaviness', 'load', 'stone', 'stones', 'st'],
tags: ['weight', 'heaviness', 'load'],
to_anchor: 14,
},
'short tons': {
name: 'unit.short-tons',
tags: ['mass', 'weight', 'heaviness', 'load', 'short ton', 'short tons'],
tags: ['weight', 'heaviness', 'load'],
to_anchor: 2000,
},
gr: {
name: 'unit.grain',
tags: ['mass', 'measurement', 'grain', 'gr'],
tags: ['measurement'],
to_anchor: 1 / 7000,
},
dr: {
name: 'unit.drachm',
tags: ['mass', 'measurement', 'drachm', 'dr'],
tags: ['measurement'],
to_anchor: 1 / 256,
},
qr: {
name: 'unit.quarter',
tags: ['mass', 'measurement', 'quarter', 'qr'],
tags: ['measurement'],
to_anchor: 28,
},
cwt: {
name: 'unit.hundredweight-count',
tags: ['mass', 'weight', 'heaviness', 'load', 'hundredweight count', 'cwt'],
tags: ['weight', 'heaviness', 'load'],
to_anchor: 100,
},
slug: {
name: 'unit.slug',
tags: ['mass', 'measurement', 'slug'],
tags: ['measurement'],
to_anchor: 32.174,
},
},

35
ui-ngx/src/app/shared/models/units/molar-concentration.ts

@ -0,0 +1,35 @@
///
/// Copyright © 2016-2025 The Thingsboard Authors
///
/// Licensed under the Apache License, Version 2.0 (the "License");
/// you may not use this file except in compliance with the License.
/// You may obtain a copy of the License at
///
/// http://www.apache.org/licenses/LICENSE-2.0
///
/// Unless required by applicable law or agreed to in writing, software
/// distributed under the License is distributed on an "AS IS" BASIS,
/// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
/// See the License for the specific language governing permissions and
/// limitations under the License.
///
import { TbMeasure, TbMeasureUnits } from '@shared/models/unit.models';
export type MolarConcentrationUnits = 'mol/m³';
const METRIC: TbMeasureUnits<MolarConcentrationUnits> = {
units: {
'mol/m³': {
name: 'unit.mole-per-cubic-meter',
tags: ['amount of substance per unit volume'],
to_anchor: 1,
}
},
};
const measure: TbMeasure<MolarConcentrationUnits> = {
METRIC,
};
export default measure;

23
ui-ngx/src/app/shared/models/units/molar-energy.ts

@ -1,14 +1,27 @@
import { TbMeasure, TbMeasureUnits } from '@shared/models/unit.models';
///
/// Copyright © 2016-2025 The Thingsboard Authors
///
/// Licensed under the Apache License, Version 2.0 (the "License");
/// you may not use this file except in compliance with the License.
/// You may obtain a copy of the License at
///
/// http://www.apache.org/licenses/LICENSE-2.0
///
/// Unless required by applicable law or agreed to in writing, software
/// distributed under the License is distributed on an "AS IS" BASIS,
/// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
/// See the License for the specific language governing permissions and
/// limitations under the License.
///
export type MolarEnergyMetricUnits = 'J/mol';
import { TbMeasure, TbMeasureUnits } from '@shared/models/unit.models';
export type MolarEnergyUnits = MolarEnergyMetricUnits;
export type MolarEnergyUnits = 'J/mol';
const METRIC: TbMeasureUnits<MolarEnergyMetricUnits> = {
const METRIC: TbMeasureUnits<MolarEnergyUnits> = {
units: {
'J/mol': {
name: 'unit.joule-per-mole',
tags: ['molar energy', 'joule per mole', 'J/mol'],
to_anchor: 1,
},
},

23
ui-ngx/src/app/shared/models/units/molar-heat-capacity.ts

@ -1,14 +1,27 @@
import { TbMeasure, TbMeasureUnits } from '@shared/models/unit.models';
///
/// Copyright © 2016-2025 The Thingsboard Authors
///
/// Licensed under the Apache License, Version 2.0 (the "License");
/// you may not use this file except in compliance with the License.
/// You may obtain a copy of the License at
///
/// http://www.apache.org/licenses/LICENSE-2.0
///
/// Unless required by applicable law or agreed to in writing, software
/// distributed under the License is distributed on an "AS IS" BASIS,
/// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
/// See the License for the specific language governing permissions and
/// limitations under the License.
///
export type MolarHeatCapacityMetricUnits = 'J/(mol·K)';
import { TbMeasure, TbMeasureUnits } from '@shared/models/unit.models';
export type MolarHeatCapacityUnits = MolarHeatCapacityMetricUnits;
export type MolarHeatCapacityUnits = 'J/(mol·K)';
const METRIC: TbMeasureUnits<MolarHeatCapacityMetricUnits> = {
const METRIC: TbMeasureUnits<MolarHeatCapacityUnits> = {
units: {
'J/(mol·K)': {
name: 'unit.joule-per-mole-kelvin',
tags: ['molar heat capacity', 'joule per mole-kelvin', 'J/(mol·K)'],
to_anchor: 1,
},
},

19
ui-ngx/src/app/shared/models/units/molar-mass.ts

@ -1,3 +1,19 @@
///
/// Copyright © 2016-2025 The Thingsboard Authors
///
/// Licensed under the Apache License, Version 2.0 (the "License");
/// you may not use this file except in compliance with the License.
/// You may obtain a copy of the License at
///
/// http://www.apache.org/licenses/LICENSE-2.0
///
/// Unless required by applicable law or agreed to in writing, software
/// distributed under the License is distributed on an "AS IS" BASIS,
/// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
/// See the License for the specific language governing permissions and
/// limitations under the License.
///
import { TbMeasure, TbMeasureUnits } from '@shared/models/unit.models';
export type MolarMassUnits = 'kg/mol' | 'g/mol' | 'mg/mol';
@ -6,17 +22,14 @@ const METRIC: TbMeasureUnits<MolarMassUnits> = {
units: {
'g/mol': {
name: 'unit.gram-per-mole',
tags: ['molar mass', 'gram per mole', 'g/mol'],
to_anchor: 1,
},
'kg/mol': {
name: 'unit.kilogram-per-mole',
tags: ['molar mass', 'kilogram per mole', 'kg/mol'],
to_anchor: 1e3,
},
'mg/mol': {
name: 'unit.milligram-per-mole',
tags: ['molar mass', 'milligram per mole', 'mg/mol'],
to_anchor: 1e-3,
},
},

35
ui-ngx/src/app/shared/models/units/specific-humidity.ts

@ -0,0 +1,35 @@
///
/// Copyright © 2016-2025 The Thingsboard Authors
///
/// Licensed under the Apache License, Version 2.0 (the "License");
/// you may not use this file except in compliance with the License.
/// You may obtain a copy of the License at
///
/// http://www.apache.org/licenses/LICENSE-2.0
///
/// Unless required by applicable law or agreed to in writing, software
/// distributed under the License is distributed on an "AS IS" BASIS,
/// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
/// See the License for the specific language governing permissions and
/// limitations under the License.
///
import { TbMeasure, TbMeasureUnits } from '@shared/models/unit.models';
export type SpecificHumidityUnits = 'g/kg';
const METRIC: TbMeasureUnits<SpecificHumidityUnits> = {
units: {
'g/kg': {
name: 'unit.gram-per-kilogram',
tags: ['humidity', 'moisture', 'specific humidity', 'g/kg'],
to_anchor: 1,
},
},
};
const measure: TbMeasure<SpecificHumidityUnits> = {
METRIC,
};
export default measure;

36
ui-ngx/src/assets/locale/locale.constant-en_US.json

@ -5866,18 +5866,54 @@
},
"measures": {
"acceleration": "Acceleration",
"air-quality-index": "Air quality index",
"amount-of-substance": "Amount of substance",
"angle": "Angle",
"angular-acceleration": "Angular acceleration",
"area": "Area",
"capacitance": "Capacitance",
"catalytic-activity": "Catalytic activity",
"catalytic-concetration": "Catalytic concetration",
"charge": "Charge",
"current-density": "Current density",
"data-transfer-rate": "Data transfer rate",
"digital": "Digital",
"dimension-ratio": "Dimension ratio",
"dynamic-viscosity": "Dynamic viscosity",
"earthquake-magnitude": "Earthquake magnitude",
"electric-current": "Electric current",
"electric-dipole-moment": "Electric dipole moment",
"electric-field-strength": "Electric field strength",
"electric-flux": "Electric flux",
"electric-permittivity": "Electric permittivity",
"electrical-conductance": "Electrical conductance",
"electrical-conductivity": "Electrical conductivity",
"energy": "Energy",
"force": "Force",
"frequency": "Frequency",
"fuel-efficiency": "fuel efficiency",
"heat-capacity": "Heat capacity",
"illuminance": "Illuminance",
"inductance": "Inductance",
"kinematic-viscosity": "Kinematic viscosity",
"length": "Length",
"light-exposure": "Light exposure",
"logarithmic-ratio": "Logarithmic ratio",
"luminous-efficacy": "Luminous efficacy",
"luminous-flux": "Luminous flux",
"luminous-intensity": "Luminous intensity",
"magnetic-field-gradient": "Magnetic field gradient",
"magnetic-flux": "Magnetic flux",
"magnetic-flux-density": "Magnetic flux density",
"magnetic-moment": "Magnetic moment",
"magnetic-permeability": "Magnetic permeability",
"mass": "Mass",
"mass-fraction": "Mass fraction",
"molar-concetration": "Molar concetration",
"molar-energy": "Molar energy",
"molar-heat-capacity": "Molar heat capacity",
"molar-mass": "Molar mass",
"specific-humidity": "Specific humidity",
"temperature": "Temperature",
"time": "Time"
},

Loading…
Cancel
Save