diff --git a/ui-ngx/src/app/shared/models/unit.models.ts b/ui-ngx/src/app/shared/models/unit.models.ts index c2763ff632..3fcf742cb0 100644 --- a/ui-ngx/src/app/shared/models/unit.models.ts +++ b/ui-ngx/src/app/shared/models/unit.models.ts @@ -14,12 +14,15 @@ /// limitations under the License. /// +import absorbedDoseRate, { AbsorbedDoseRateUnits } from '@shared/models/units/absorbed-dose-rate'; import acceleration, { AccelerationUnits } from '@shared/models/units/acceleration'; +import acidity, { AcidityUnits } from '@shared/models/units/acidity'; 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 areaDensity, { AreaDensityUnits } from '@shared/models/units/area-density'; 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'; @@ -31,14 +34,17 @@ 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 electricChargeDensity, { ElectricChargeDensityUnits } from '@shared/models/units/electric-charge-density'; 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 electricPolarizability, { ElectricPolarizabilityUnits } from '@shared/models/units/electric-polarizability'; 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 energyDensity, { EnergyDensityUnits } from '@shared/models/units/energy-density'; 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'; @@ -64,26 +70,51 @@ import molarConcentration, { MolarConcentrationUnits } from '@shared/models/unit 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 numberConcentration, { NumberConcentrationUnits } from '@shared/models/units/number-concentration'; +import partsPerMillion, { PartsPerMillionUnits } from '@shared/models/units/parts-per-million'; import power, { PowerUnits } from '@shared/models/units/power'; +import powerDensity, { PowerDensityUnits } from '@shared/models/units/power-density'; import pressure, { PressureUnits } from '@shared/models/units/pressure'; +import radiance, { RadianceUnits } from '@shared/models/units/radiance'; +import radiantIntensity, { RadiantIntensityUnits } from '@shared/models/units/radiant-intensity'; +import radiationDose, { RadiationDoseUnits } from '@shared/models/units/radiation-dose'; +import radioactiveDecay, { RadioactiveDecayUnits } from '@shared/models/units/radioactive-decay'; +import radioactivity, { RadioactivityUnits } from '@shared/models/units/radioactivity'; +import radioactivityConcentration, { + RadioactivityConcentrationUnits +} from '@shared/models/units/radioactivity-concentration'; +import resistance, { ResistanceUnits } from '@shared/models/units/resistance'; +import reynoldsNumber, { ReynoldsNumberUnits } from '@shared/models/units/reynolds-number'; +import signalLevel, { SignalLevelUnits } from '@shared/models/units/signal-level'; +import solidAngle, { SolidAngleUnits } from '@shared/models/units/solid-angle'; +import specificEnergy, { SpecificEnergyUnits } from '@shared/models/units/specific-energy'; +import specificHeatCapacity, { SpecificHeatCapacityUnits } from '@shared/models/units/specific-heat-capacity'; import specificHumidity, { SpecificHumidityUnits } from '@shared/models/units/specific-humidity'; +import specificVolume, { SpecificVolumeUnits } from '@shared/models/units/specific-volume'; import speed, { SpeedUnits } from '@shared/models/units/speed'; +import surfaceChargeDensity, { SurfaceChargeDensityUnits } from '@shared/models/units/surface-charge-density'; +import surfaceTension, { SurfaceTensionUnits } from '@shared/models/units/surface-tension'; import temperature, { TemperatureUnits } from '@shared/models/units/temperature'; +import thermalConductivity, { ThermalConductivityUnits } from '@shared/models/units/thermal-conductivity'; import time, { TimeUnits } from '@shared/models/units/time'; import torque, { TorqueUnits } from '@shared/models/units/torque'; +import turbidity, { TurbidityUnits } from '@shared/models/units/turbidity'; import voltage, { VoltageUnits } from '@shared/models/units/voltage'; import volume, { VolumeUnits } from '@shared/models/units/volume'; -import volumeFlowRate, { VolumeFlowRateUnits } from '@shared/models/units/volume-flow-rate'; +import volumeFlow, { VolumeFlowUnits } from '@shared/models/units/volume-flow'; import { TranslateService } from '@ngx-translate/core'; +import reciprocalLength, { ReciprocalLengthUnits } from '@shared/models/units/reciprocal-length'; export type AllMeasuresUnits = + | AbsorbedDoseRateUnits | AccelerationUnits + | AcidityUnits | AirQualityIndexUnits | AmountOfSubstanceUnits | AngleUnits | AngularAccelerationUnits | AreaUnits + | AreaDensityUnits | CapacitanceUnits | CatalyticActivityUnits | CatalyticConcentrationUnits @@ -95,14 +126,17 @@ export type AllMeasuresUnits = | DimensionRatioUnits | DynamicViscosityUnits | EarthquakeMagnitudeUnits + | ElectricChargeDensityUnits | ElectricCurrentUnits | ElectricDipoleMomentUnits | ElectricFieldStrengthUnits | ElectricFluxUnits | ElectricPermittivityUnits + | ElectricPolarizabilityUnits | ElectricalConductanceUnits | ElectricalConductivityUnits | EnergyUnits + | EnergyDensityUnits | ForceUnits | FrequencyUnits | FuelEfficiencyUnits @@ -128,20 +162,42 @@ export type AllMeasuresUnits = | MolarEnergyUnits | MolarHeatCapacityUnits | MolarMassUnits - | PartsPerUnits + | NumberConcentrationUnits + | PartsPerMillionUnits | PowerUnits + | PowerDensityUnits | PressureUnits + | RadianceUnits + | RadiantIntensityUnits + | RadiationDoseUnits + | RadioactiveDecayUnits + | RadioactivityUnits + | RadioactivityConcentrationUnits + | ReciprocalLengthUnits + | ResistanceUnits + | ReynoldsNumberUnits + | SignalLevelUnits + | SolidAngleUnits + | SpecificEnergyUnits + | SpecificHeatCapacityUnits | SpecificHumidityUnits + | SpecificVolumeUnits | SpeedUnits + | SurfaceChargeDensityUnits + | SurfaceTensionUnits | TemperatureUnits + | ThermalConductivityUnits | TimeUnits | TorqueUnits + | TurbidityUnits | VoltageUnits | VolumeUnits - | VolumeFlowRateUnits; + | VolumeFlowUnits; export type AllMeasures = + | 'absorbed-dose-rate' | 'acceleration' + | 'acidity' | 'air-quality-index' | 'amount-of-substance' | 'angle' @@ -158,14 +214,17 @@ export type AllMeasures = | 'dimension-ratio' | 'dynamic-viscosity' | 'earthquake-magnitude' + | 'electric-charge-density' | 'electric-current' | 'electric-dipole-moment' | 'electric-field-strength' | 'electric-flux' | 'electric-permittivity' + | 'electric-polarizability' | 'electrical-conductance' | 'electrical-conductivity' | 'energy' + | 'energy-density' | 'force' | 'frequency' | 'fuel-efficiency' @@ -191,28 +250,51 @@ export type AllMeasures = | 'molar-energy' | 'molar-heat-capacity' | 'molar-mass' - | 'parts-per' + | 'number-concentration' + | 'parts-per-million' | 'power' + | 'power-density' | 'pressure' + | 'radiance' + | 'radiant-intensity' + | 'radiation-dose' + | 'radioactive-decay' + | 'radioactivity' + | 'radioactivity-concentration' + | 'reciprocal-length' + | 'resistance' + | 'reynolds-number' + | 'signal-level' + | 'solid-angle' + | 'specific-energy' + | 'specific-heat-capacity' | 'specific-humidity' + | 'specific-volume' + | 'surface-charge-density' + | 'surface-tension' | 'speed' | 'temperature' + | 'thermal-conductivity' | 'time' | 'torque' + | 'turbidity' | 'voltage' | 'volume' - | 'volume-flow-rate'; + | 'volume-flow'; const allMeasures: Record< AllMeasures, TbMeasure > = Object.freeze({ + 'absorbed-dose-rate': absorbedDoseRate, acceleration, + acidity, 'air-quality-index': airQualityIndex, 'amount-of-substance': amountOfSubstance, angle, 'angular-acceleration': angularAcceleration, area, + 'area-density': areaDensity, capacitance, 'catalytic-activity': catalyticActivity, 'catalytic-concentration': catalyticConcentration, @@ -224,14 +306,17 @@ const allMeasures: Record< 'dimension-ratio': dimensionRatio, 'dynamic-viscosity': dynamicViscosity, 'earthquake-magnitude': earthquakeMagnitude, + 'electric-charge-density': electricChargeDensity, 'electric-current': electricCurrent, 'electric-dipole-moment': electricDipoleMoment, 'electric-field-strength': electricFieldStrength, 'electric-flux': electricFlux, 'electric-permittivity': electricPermittivity, + 'electric-polarizability': electricPolarizability, 'electrical-conductance': electricalConductance, 'electrical-conductivity': electricalConductivity, energy, + 'energy-density': energyDensity, force, frequency, 'fuel-efficiency': fuelEfficiency, @@ -246,6 +331,7 @@ const allMeasures: Record< 'luminous-efficacy': luminousEfficacy, 'luminous-flux': luminousFlux, 'luminous-intensity': luminousIntensity, + 'number-concentration': numberConcentration, 'magnetic-field-gradient': magneticFieldGradient, 'magnetic-flux': magneticFlux, 'magnetic-flux-density': magneticFluxDensity, @@ -257,17 +343,36 @@ const allMeasures: Record< 'molar-energy': molarEnergy, 'molar-heat-capacity': molarHeatCapacity, 'molar-mass': molarMass, - 'parts-per': partsPer, + 'parts-per-million': partsPerMillion, power, + 'power-density': powerDensity, pressure, + radiance, + 'radiant-intensity': radiantIntensity, + 'radiation-dose': radiationDose, + 'radioactive-decay': radioactiveDecay, + radioactivity, + 'radioactivity-concentration': radioactivityConcentration, + 'reciprocal-length': reciprocalLength, + resistance, + 'reynolds-number': reynoldsNumber, + 'signal-level': signalLevel, + 'solid-angle': solidAngle, + 'specific-energy': specificEnergy, + 'specific-heat-capacity': specificHeatCapacity, 'specific-humidity': specificHumidity, + 'specific-volume': specificVolume, speed, + 'surface-charge-density': surfaceChargeDensity, + 'surface-tension': surfaceTension, temperature, + 'thermal-conductivity': thermalConductivity, time, torque, + turbidity, voltage, volume, - 'volume-flow-rate': volumeFlowRate, + 'volume-flow': volumeFlow, }); export enum UnitsType { diff --git a/ui-ngx/src/app/shared/models/units/absorbed-dose-rate.ts b/ui-ngx/src/app/shared/models/units/absorbed-dose-rate.ts new file mode 100644 index 0000000000..46f52272a1 --- /dev/null +++ b/ui-ngx/src/app/shared/models/units/absorbed-dose-rate.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 AbsorbedDoseRateUnits = 'Gy/s'; + +const METRIC: TbMeasureUnits = { + units: { + 'Gy/s': { + name: 'unit.gy-per-second', + tags: ['radiation dose rate'], + to_anchor: 1, + }, + }, +}; + +const measure: TbMeasure = { + METRIC, +}; + +export default measure; diff --git a/ui-ngx/src/app/shared/models/units/acceleration.ts b/ui-ngx/src/app/shared/models/units/acceleration.ts index a1643020a9..cef91df465 100644 --- a/ui-ngx/src/app/shared/models/units/acceleration.ts +++ b/ui-ngx/src/app/shared/models/units/acceleration.ts @@ -24,24 +24,24 @@ export type AccelerationUnits = AccelerationMetricUnits | AccelerationImperialUn const METRIC: TbMeasureUnits = { ratio: 3.28084, units: { - 'G': { + G: { name: 'unit.g-force', - tags: ['gravity', 'g-force', 'load'], + tags: ['gravity', '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'], + tags: ['peak to peak', 'root mean square (RMS)', 'vibration'], to_anchor: 1, }, - 'Gal': { + Gal: { name: 'unit.gal', tags: ['gravity', 'g-force'], to_anchor: 1, }, 'km/h²': { name: 'unit.kilometer-per-hour-squared', - tags: ['rate of change of velocity', 'kilometer per hour squared'], + tags: ['rate of change of velocity'], to_anchor: 1 / 12960, } } @@ -52,7 +52,7 @@ const IMPERIAL: TbMeasureUnits = { units: { 'ft/s²': { name: 'unit.foot-per-second-squared', - tags: ['acceleration', 'rate of change of velocity', 'foot per second squared', 'ft/s²'], + tags: ['rate of change of velocity'], to_anchor: 1 } } diff --git a/ui-ngx/src/app/shared/models/units/acidity.ts b/ui-ngx/src/app/shared/models/units/acidity.ts new file mode 100644 index 0000000000..9681084a99 --- /dev/null +++ b/ui-ngx/src/app/shared/models/units/acidity.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 AcidityUnits = 'pH'; + +const METRIC: TbMeasureUnits = { + units: { + pH: { + name: 'unit.ph-level', + tags: [ 'alkalinity', 'neutral', 'acid', 'base', 'soil pH', 'water quality', 'water pH'], + to_anchor: 1, + }, + }, +}; + +const measure: TbMeasure = { + METRIC, +}; + +export default measure; diff --git a/ui-ngx/src/app/shared/models/units/amount-of-substance.ts b/ui-ngx/src/app/shared/models/units/amount-of-substance.ts index 1601f5d80a..6dc38ccad6 100644 --- a/ui-ngx/src/app/shared/models/units/amount-of-substance.ts +++ b/ui-ngx/src/app/shared/models/units/amount-of-substance.ts @@ -20,27 +20,27 @@ export type AmountOfSubstanceUnits = 'mol' | 'nmol' | 'μmol' | 'mmol' | 'kmol'; const METRIC: TbMeasureUnits = { units: { - 'mol': { + mol: { name: 'unit.mole', tags: ['chemical amount'], to_anchor: 1, }, - 'nmol': { + nmol: { name: 'unit.nanomole', tags: ['chemical amount'], to_anchor: 0.000000001, }, - 'μmol': { + μmol: { name: 'unit.micromole', tags: ['chemical amount'], to_anchor: 0.000001, }, - 'mmol': { + mmol: { name: 'unit.millimole', tags: ['chemical amount'], to_anchor: 0.001, }, - 'kmol': { + kmol: { name: 'unit.kilomole', tags: ['chemical amount'], to_anchor: 1000, diff --git a/ui-ngx/src/app/shared/models/units/area-density.ts b/ui-ngx/src/app/shared/models/units/area-density.ts new file mode 100644 index 0000000000..3fd0757a45 --- /dev/null +++ b/ui-ngx/src/app/shared/models/units/area-density.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 AreaDensityUnits = 'kg/m²'; + +const METRIC: TbMeasureUnits = { + units: { + 'kg/m²': { + name: 'unit.kilogram-per-square-meter', + tags: ['surface density', 'mass per unit area'], + to_anchor: 1 + }, + }, +}; + +const measure: TbMeasure = { + METRIC, +}; + +export default measure; diff --git a/ui-ngx/src/app/shared/models/units/capacitance.ts b/ui-ngx/src/app/shared/models/units/capacitance.ts index f4dc13dc97..8f65fd97b2 100644 --- a/ui-ngx/src/app/shared/models/units/capacitance.ts +++ b/ui-ngx/src/app/shared/models/units/capacitance.ts @@ -20,48 +20,48 @@ export type CapacitanceUnits = 'F' | 'mF' | 'μF' | 'nF' | 'pF' | 'kF' | 'MF' | const METRIC: TbMeasureUnits = { units: { - 'F': { + F: { name: 'unit.farad', tags: ['electric capacitance'], to_anchor: 1, }, - 'mF': { + mF: { name: 'unit.millifarad', tags: ['electric capacitance'], to_anchor: 1e-3, }, - 'μF': { + μF: { name: 'unit.microfarad', tags: ['electric capacitance'], to_anchor: 1e-6, }, - 'nF': { + nF: { name: 'unit.nanofarad', tags: ['electric capacitance'], to_anchor: 1e-9, }, - 'pF': { + pF: { name: 'unit.picofarad', tags: ['electric capacitance'], to_anchor: 1e-12, }, - 'kF': { + kF: { name: 'unit.kilofarad', tags: ['electric capacitance'], to_anchor: 1e3, }, - 'MF': { + MF: { name: 'unit.megafarad', tags: ['electric capacitance'], to_anchor: 1e6, }, - 'GF': { + GF: { name: 'unit.gigafarad', tags: ['electric capacitance'], to_anchor: 1e9, }, - 'TF': { - name: 'unit.terafarad', + TF: { + name: 'unit.terfarad', tags: ['electric capacitance'], to_anchor: 1e12, }, diff --git a/ui-ngx/src/app/shared/models/units/data-transfer-rate.ts b/ui-ngx/src/app/shared/models/units/data-transfer-rate.ts index d952eaf727..e77576dce2 100644 --- a/ui-ngx/src/app/shared/models/units/data-transfer-rate.ts +++ b/ui-ngx/src/app/shared/models/units/data-transfer-rate.ts @@ -20,23 +20,23 @@ export type DataTransferRateUnits = 'bps' | 'kbps' | 'Mbps' | 'Gbps' | 'Tbps' | const METRIC: TbMeasureUnits = { units: { - 'bps': { + bps: { name: 'unit.bit-per-second', to_anchor: 1, }, - 'kbps': { + kbps: { name: 'unit.kilobit-per-second', to_anchor: 1e3, }, - 'Mbps': { + Mbps: { name: 'unit.megabit-per-second', to_anchor: 1e6, }, - 'Gbps': { + Gbps: { name: 'unit.gigabit-per-second', to_anchor: 1e9, }, - 'Tbps': { + Tbps: { name: 'unit.terabit-per-second', to_anchor: 1e12, }, diff --git a/ui-ngx/src/app/shared/models/units/dimension-ratio.ts b/ui-ngx/src/app/shared/models/units/dimension-ratio.ts index 3deb60a38f..1df77e13ad 100644 --- a/ui-ngx/src/app/shared/models/units/dimension-ratio.ts +++ b/ui-ngx/src/app/shared/models/units/dimension-ratio.ts @@ -16,10 +16,15 @@ import { TbMeasure, TbMeasureUnits } from '@shared/models/unit.models'; -export type DimensionRatioUnits = 'm/m'; +export type DimensionRatioUnits = 'm/m' | '%'; const METRIC: TbMeasureUnits = { units: { + '%': { + name: 'unit.percent', + tags: ['power source', 'state of charge (SoC)', 'battery', 'battery level', 'level', 'humidity', 'moisture', 'relative humidity', 'water content', 'soil moisture', 'irrigation', 'water in soil', 'soil water content', 'VWC', 'Volumetric Water Content', 'Total Harmonic Distortion', 'THD', 'power quality', 'UV Transmittance', 'capacity'], + to_anchor: 1, + }, 'm/m': { name: 'unit.meter-per-meter', tags: ['ratio of length to length'], diff --git a/ui-ngx/src/app/shared/models/units/dynamic-viscosity.ts b/ui-ngx/src/app/shared/models/units/dynamic-viscosity.ts index e3fe8602b3..bb8a479931 100644 --- a/ui-ngx/src/app/shared/models/units/dynamic-viscosity.ts +++ b/ui-ngx/src/app/shared/models/units/dynamic-viscosity.ts @@ -29,12 +29,12 @@ const METRIC: TbMeasureUnits = { tags: ['fluid mechanics'], to_anchor: 1, }, - 'cP': { + cP: { name: 'unit.centipoise', tags: ['fluid mechanics'], to_anchor: 0.001, }, - 'P': { + P: { name: 'unit.poise', tags: ['fluid mechanics'], to_anchor: 0.1, diff --git a/ui-ngx/src/app/shared/models/units/electric-charge-density.ts b/ui-ngx/src/app/shared/models/units/electric-charge-density.ts new file mode 100644 index 0000000000..0e2e8dfe08 --- /dev/null +++ b/ui-ngx/src/app/shared/models/units/electric-charge-density.ts @@ -0,0 +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 ElectricChargeDensityUnits = 'C/m³'; + +const METRIC: TbMeasureUnits = { + units: { + 'C/m³': { + name: 'unit.coulomb-per-cubic-meter', + to_anchor: 1, + }, + }, +}; + +const measure: TbMeasure = { + METRIC, +}; + +export default measure; diff --git a/ui-ngx/src/app/shared/models/units/electric-dipole-moment.ts b/ui-ngx/src/app/shared/models/units/electric-dipole-moment.ts index b43e08b857..8a7ecc7379 100644 --- a/ui-ngx/src/app/shared/models/units/electric-dipole-moment.ts +++ b/ui-ngx/src/app/shared/models/units/electric-dipole-moment.ts @@ -24,7 +24,7 @@ const METRIC: TbMeasureUnits = { name: 'unit.electric-dipole-moment', to_anchor: 1, }, - 'D': { + D: { name: 'unit.debye', tags: ['polarization'], to_anchor: 3.33564e-30 diff --git a/ui-ngx/src/app/shared/models/units/electric-polarizability.ts b/ui-ngx/src/app/shared/models/units/electric-polarizability.ts new file mode 100644 index 0000000000..2d92ad4cb1 --- /dev/null +++ b/ui-ngx/src/app/shared/models/units/electric-polarizability.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 ElectricPolarizabilityUnits = 'C·m²/V'; + +const METRIC: TbMeasureUnits = { + units: { + 'C·m²/V': { + name: 'unit.coulomb-per-square-meter-per-volt', + tags: ['electric field'], + to_anchor: 1, + }, + }, +}; + +const measure: TbMeasure = { + METRIC, +}; + +export default measure; diff --git a/ui-ngx/src/app/shared/models/units/electrical-conductance.ts b/ui-ngx/src/app/shared/models/units/electrical-conductance.ts index 62241d059f..bbad5d3f5c 100644 --- a/ui-ngx/src/app/shared/models/units/electrical-conductance.ts +++ b/ui-ngx/src/app/shared/models/units/electrical-conductance.ts @@ -20,27 +20,27 @@ export type ElectricalConductanceUnits = 'S' | 'mS' | 'μS' | 'kS' | 'MS' | 'GS' const METRIC: TbMeasureUnits = { units: { - 'S': { + S: { name: 'unit.siemens', to_anchor: 1, }, - 'mS': { + mS: { name: 'unit.millisiemens', to_anchor: 1e-3, }, - 'μS': { + μS: { name: 'unit.microsiemens', to_anchor: 1e-6, }, - 'kS': { + kS: { name: 'unit.kilosiemens', to_anchor: 1e3, }, - 'MS': { + MS: { name: 'unit.megasiemens', to_anchor: 1e6, }, - 'GS': { + GS: { name: 'unit.gigasiemens', to_anchor: 1e9, }, diff --git a/ui-ngx/src/app/shared/models/units/energy-density.ts b/ui-ngx/src/app/shared/models/units/energy-density.ts new file mode 100644 index 0000000000..9b0e2e4a1e --- /dev/null +++ b/ui-ngx/src/app/shared/models/units/energy-density.ts @@ -0,0 +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 EnergyDensityUnits = 'J/m³'; + +const METRIC: TbMeasureUnits = { + units: { + 'J/m³': { + name: 'unit.joule-per-cubic-meter', + to_anchor: 1, + }, + }, +}; + +const measure: TbMeasure = { + METRIC, +}; + +export default measure; diff --git a/ui-ngx/src/app/shared/models/units/fuel-efficiency.ts b/ui-ngx/src/app/shared/models/units/fuel-efficiency.ts index 64eb49cfb2..360b35ed6e 100644 --- a/ui-ngx/src/app/shared/models/units/fuel-efficiency.ts +++ b/ui-ngx/src/app/shared/models/units/fuel-efficiency.ts @@ -39,7 +39,7 @@ const METRIC: TbMeasureUnits = { const IMPERIAL: TbMeasureUnits = { ratio: 0.425144, units: { - 'mpg': { + mpg: { name: 'unit.miles-per-gallon', to_anchor: 0.425144, }, diff --git a/ui-ngx/src/app/shared/models/units/illuminance.ts b/ui-ngx/src/app/shared/models/units/illuminance.ts index 286cd4923d..4063b61fc5 100644 --- a/ui-ngx/src/app/shared/models/units/illuminance.ts +++ b/ui-ngx/src/app/shared/models/units/illuminance.ts @@ -45,7 +45,7 @@ const METRIC: TbMeasureUnits = { const IMPERIAL: TbMeasureUnits = { ratio: 10.76391, units: { - 'fc': { + fc: { name: 'unit.foot-candle', tags: ['illuminance', 'light level'], to_anchor: 1, diff --git a/ui-ngx/src/app/shared/models/units/kinematic-viscosity.ts b/ui-ngx/src/app/shared/models/units/kinematic-viscosity.ts index 8d2201d456..c1203ff75b 100644 --- a/ui-ngx/src/app/shared/models/units/kinematic-viscosity.ts +++ b/ui-ngx/src/app/shared/models/units/kinematic-viscosity.ts @@ -32,11 +32,11 @@ const METRIC: TbMeasureUnits = { name: 'unit.square-centimeter-per-second', to_anchor: 1e-4, }, - 'St': { + St: { name: 'unit.stoke', to_anchor: 1e-4, }, - 'cSt': { + cSt: { name: 'unit.centistokes', to_anchor: 1e-6, }, diff --git a/ui-ngx/src/app/shared/models/units/logarithmic-ratio.ts b/ui-ngx/src/app/shared/models/units/logarithmic-ratio.ts index cb34632711..83a26c3030 100644 --- a/ui-ngx/src/app/shared/models/units/logarithmic-ratio.ts +++ b/ui-ngx/src/app/shared/models/units/logarithmic-ratio.ts @@ -20,17 +20,17 @@ export type LogarithmicRatioUnits = 'dB' | 'B' | 'Np'; const METRIC: TbMeasureUnits = { units: { - 'dB': { + dB: { name: 'unit.decibel', tags: ['noise level', 'sound level', 'volume', 'acoustics'], to_anchor: 1, }, - 'B': { + B: { name: 'unit.bel', tags: ['power ratio', 'intensity ratio'], to_anchor: 10, }, - 'Np': { + Np: { name: 'unit.neper', tags: ['gain', 'loss', 'attenuation'], to_anchor: 8.685889638, diff --git a/ui-ngx/src/app/shared/models/units/luminous-flux.ts b/ui-ngx/src/app/shared/models/units/luminous-flux.ts index 0d91e372e8..db9c3bc2b6 100644 --- a/ui-ngx/src/app/shared/models/units/luminous-flux.ts +++ b/ui-ngx/src/app/shared/models/units/luminous-flux.ts @@ -20,7 +20,7 @@ export type LuminousFluxUnits = 'lm'; const METRIC: TbMeasureUnits = { units: { - 'lm': { + lm: { name: 'unit.lumen', tags: ['total light output'], to_anchor: 1, diff --git a/ui-ngx/src/app/shared/models/units/luminous-intensity.ts b/ui-ngx/src/app/shared/models/units/luminous-intensity.ts index da85631822..259e64de6f 100644 --- a/ui-ngx/src/app/shared/models/units/luminous-intensity.ts +++ b/ui-ngx/src/app/shared/models/units/luminous-intensity.ts @@ -20,7 +20,7 @@ export type LuminousIntensityUnits = 'cd'; const METRIC: TbMeasureUnits = { units: { - 'cd': { + cd: { name: 'unit.candela', tags: ['light intensity'], to_anchor: 1, diff --git a/ui-ngx/src/app/shared/models/units/number-concentration.ts b/ui-ngx/src/app/shared/models/units/number-concentration.ts new file mode 100644 index 0000000000..b5ad4692bc --- /dev/null +++ b/ui-ngx/src/app/shared/models/units/number-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 NumberConcentrationUnits = 'particles/mL'; + +const METRIC: TbMeasureUnits = { + units: { + 'particles/mL': { + name: 'unit.particle-density', + tags: ['particle concentration', 'count'], + to_anchor: 1, + }, + }, +}; + +const measure: TbMeasure = { + METRIC, +}; + +export default measure; diff --git a/ui-ngx/src/app/shared/models/units/particle-concentration.ts b/ui-ngx/src/app/shared/models/units/particle-concentration.ts deleted file mode 100644 index 991d5a9f78..0000000000 --- a/ui-ngx/src/app/shared/models/units/particle-concentration.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { TbMeasure, TbMeasureUnits } from '@shared/models/unit.models'; - -export type ParticleConcentrationUnits = 'particles/mL'; - -const METRIC: TbMeasureUnits = { - units: { - 'particles/mL': { - name: 'unit.particle-density', - tags: ['particle concentration', 'count', 'particles/mL'], - to_anchor: 1, - }, - }, -}; - -const measure: TbMeasure = { - METRIC, -}; - -export default measure; diff --git a/ui-ngx/src/app/shared/models/units/parts-per.ts b/ui-ngx/src/app/shared/models/units/parts-per-million.ts similarity index 80% rename from ui-ngx/src/app/shared/models/units/parts-per.ts rename to ui-ngx/src/app/shared/models/units/parts-per-million.ts index 83f72447df..ca3de46a52 100644 --- a/ui-ngx/src/app/shared/models/units/parts-per.ts +++ b/ui-ngx/src/app/shared/models/units/parts-per-million.ts @@ -16,25 +16,24 @@ import { TbMeasure, TbMeasureUnits } from '@shared/models/unit.models'; -export type PartsPerUnits = PartsPerMetricUnits; -export type PartsPerMetricUnits = 'ppm' | 'ppb'; +export type PartsPerMillionUnits = 'ppm' | 'ppb'; -const METRIC: TbMeasureUnits = { +const METRIC: TbMeasureUnits = { units: { ppm: { name: 'unit.ppm', - tags: ['carbon dioxide', 'co²', 'carbon monoxide', 'co', 'aqi', 'air quality', 'total volatile organic compounds', 'tvoc', 'ppm'], + tags: ['carbon dioxide', 'co²', 'carbon monoxide', 'co', 'aqi', 'air quality', 'total volatile organic compounds', 'tvoc'], to_anchor: 1, }, ppb: { name: 'unit.ppb', - tags: ['ozone', 'o³', 'nitrogen dioxide', 'no²', 'sulfur dioxide', 'so²', 'aqi', 'air quality', 'tvoc', 'ppb'], + tags: ['ozone', 'o³', 'nitrogen dioxide', 'no²', 'sulfur dioxide', 'so²', 'aqi', 'air quality', 'tvoc'], to_anchor: 0.001, } }, }; -const measure: TbMeasure = { +const measure: TbMeasure = { METRIC, }; diff --git a/ui-ngx/src/app/shared/models/units/percentage.ts b/ui-ngx/src/app/shared/models/units/percentage.ts deleted file mode 100644 index 1bd796b0f5..0000000000 --- a/ui-ngx/src/app/shared/models/units/percentage.ts +++ /dev/null @@ -1,20 +0,0 @@ -import { TbMeasure, TbMeasureUnits } from '@shared/models/unit.models'; - -export type PercentageMetricUnits = '%'; -export type PercentageUnits = PercentageMetricUnits; - -const METRIC: TbMeasureUnits = { - units: { - '%': { - name: 'unit.percent', - tags: ['power source', 'state of charge (SoC)', 'battery', 'battery level', 'level', 'humidity', 'moisture', 'percentage', 'relative humidity', 'water content', 'soil moisture', 'irrigation', 'water in soil', 'soil water content', 'VWC', 'Volumetric Water Content', 'Total Harmonic Distortion', 'THD', 'power quality', 'UV Transmittance', '%', 'capacity'], - to_anchor: 1, - }, - }, -}; - -const measure: TbMeasure = { - METRIC, -}; - -export default measure; diff --git a/ui-ngx/src/app/shared/models/units/ph.ts b/ui-ngx/src/app/shared/models/units/ph.ts deleted file mode 100644 index d394d0f8ec..0000000000 --- a/ui-ngx/src/app/shared/models/units/ph.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { TbMeasure, TbMeasureUnits } from '@shared/models/unit.models'; - -export type PHUnits = 'pH'; - -const METRIC: TbMeasureUnits = { - units: { - pH: { - name: 'unit.ph-level', - tags: ['acidity', 'alkalinity', 'neutral', 'acid', 'base', 'pH', 'soil pH', 'water quality', 'water pH'], - to_anchor: 1, - }, - }, -}; - -const measure: TbMeasure = { - METRIC, -}; - -export default measure; diff --git a/ui-ngx/src/app/shared/models/units/polarization.ts b/ui-ngx/src/app/shared/models/units/polarization.ts deleted file mode 100644 index 09528228a0..0000000000 --- a/ui-ngx/src/app/shared/models/units/polarization.ts +++ /dev/null @@ -1,21 +0,0 @@ -import { TbMeasure, TbMeasureUnits } from '@shared/models/unit.models'; - -export type PolarizationMetricUnits = 'C·m²/V'; - -export type PolarizationUnits = PolarizationMetricUnits; - -const METRIC: TbMeasureUnits = { - units: { - 'C·m²/V': { - name: 'unit.coulomb-per-square-meter-per-volt', - tags: ['polarization', 'electric field', 'coulomb per square meter per volt', 'C·m²/V'], - to_anchor: 1, - }, - }, -}; - -const measure: TbMeasure = { - METRIC, -}; - -export default measure; diff --git a/ui-ngx/src/app/shared/models/units/power-density.ts b/ui-ngx/src/app/shared/models/units/power-density.ts index 38ec33fd6e..ed3ac37a6c 100644 --- a/ui-ngx/src/app/shared/models/units/power-density.ts +++ b/ui-ngx/src/app/shared/models/units/power-density.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 PowerDensityMetricUnits = 'mW/cm²' | 'W/cm²' | 'kW/cm²' | 'mW/m²' | 'W/m²' | 'kW/m²'; @@ -10,32 +26,32 @@ const METRIC: TbMeasureUnits = { units: { 'mW/cm²': { name: 'unit.milliwatt-per-square-centimeter', - tags: ['power density', 'radiation intensity', 'sunlight intensity', 'signal power', 'intensity', 'milliwatts per square centimeter', 'UV Intensity', 'mW/cm²'], + tags: ['radiation intensity', 'sunlight intensity', 'signal power', 'intensity', 'UV Intensity'], to_anchor: 10000, }, 'W/cm²': { name: 'unit.watt-per-square-centimeter', - tags: ['power density', 'intensity of power', 'watts per square centimeter', 'W/cm²'], + tags: ['intensity of power'], to_anchor: 10000, }, 'kW/cm²': { name: 'unit.kilowatt-per-square-centimeter', - tags: ['power density', 'intensity of power', 'kilowatts per square centimeter', 'kW/cm²'], + tags: ['intensity of power'], to_anchor: 10000000, }, 'mW/m²': { name: 'unit.milliwatt-per-square-meter', - tags: ['power density', 'intensity of power', 'milliwatts per square meter', 'mW/m²'], + tags: ['intensity of power'], to_anchor: 0.001, }, 'W/m²': { name: 'unit.watt-per-square-meter', - tags: ['power density', 'intensity of power', 'watts per square meter', 'W/m²'], + tags: ['intensity of power'], to_anchor: 1, }, 'kW/m²': { name: 'unit.kilowatt-per-square-meter', - tags: ['power density', 'intensity of power', 'kilowatts per square meter', 'kW/m²'], + tags: ['intensity of power'], to_anchor: 1000, }, }, @@ -46,12 +62,12 @@ const IMPERIAL: TbMeasureUnits = { units: { 'W/in²': { name: 'unit.watt-per-square-inch', - tags: ['power density', 'intensity of power', 'watts per square inch', 'W/in²'], + tags: ['intensity of power'], to_anchor: 1, }, 'kW/in²': { name: 'unit.kilowatt-per-square-inch', - tags: ['power density', 'intensity of power', 'kilowatts per square inch', 'kW/in²'], + tags: ['intensity of power'], to_anchor: 1000, }, }, diff --git a/ui-ngx/src/app/shared/models/units/power.ts b/ui-ngx/src/app/shared/models/units/power.ts index 8b9c5eda81..937ddde675 100644 --- a/ui-ngx/src/app/shared/models/units/power.ts +++ b/ui-ngx/src/app/shared/models/units/power.ts @@ -26,37 +26,37 @@ const METRIC: TbMeasureUnits = { units: { W: { name: 'unit.watt', - tags: ['power', 'horsepower', 'performance', 'watt', 'watts', 'electricity', 'W'], + tags: ['horsepower', 'performance', 'electricity'], to_anchor: 1, }, μW: { name: 'unit.microwatt', - tags: ['power', 'horsepower', 'performance', 'microwatt', 'microwatts', 'electricity', 'μW'], + tags: ['horsepower', 'performance', 'electricity'], to_anchor: 0.000001, }, mW: { name: 'unit.milliwatt', - tags: ['power', 'horsepower', 'performance', 'milliwatt', 'milliwatts', 'electricity', 'mW'], + tags: ['horsepower', 'performance', 'electricity'], to_anchor: 0.001, }, kW: { name: 'unit.kilowatt', - tags: ['power', 'horsepower', 'performance', 'kilowatt', 'kilowatts', 'electricity', 'kW'], + tags: ['horsepower', 'performance', 'electricity'], to_anchor: 1000, }, MW: { name: 'unit.megawatt', - tags: ['power', 'horsepower', 'performance', 'megawatt', 'megawatts', 'electricity', 'MW'], + tags: [ 'horsepower', 'performance', 'electricity'], to_anchor: 1000000, }, GW: { name: 'unit.gigawatt', - tags: ['power', 'horsepower', 'performance', 'gigawatt', 'gigawatts', 'electricity', 'GW'], + tags: ['horsepower', 'performance', 'electricity'], to_anchor: 1000000000, }, PS: { name: 'unit.metric-horsepower', - tags: ['power', 'performance', 'metric horsepower', 'PS'], + tags: ['performance'], to_anchor: 735.49875, }, }, @@ -67,22 +67,22 @@ const IMPERIAL: TbMeasureUnits = { units: { 'BTU/s': { name: 'unit.btu-per-second', - tags: ['power', 'heat transfer', 'thermal energy', 'british thermal unit per second', 'Btu/s'], + tags: ['heat transfer', 'thermal energy'], to_anchor: 778.16937, }, 'ft-lb/s': { name: 'unit.foot-pound-per-second', - tags: ['power', 'foot-pound per second', 'foot-pounds per second', 'ft-lb/s', 'mechanical power'], + tags: ['mechanical power'], to_anchor: 1, }, hp: { name: 'unit.horsepower', - tags: ['power', 'horsepower', 'performance', 'electricity', 'horsepowers', 'hp'], + tags: ['performance', 'electricity'], to_anchor: 550, }, 'BTU/h': { name: 'unit.btu-per-hour', - tags: ['power', 'heat transfer', 'thermal energy', 'HVAC', 'BTU/h'], + tags: ['heat transfer', 'thermal energy', 'HVAC'], to_anchor: 0.216158, }, }, diff --git a/ui-ngx/src/app/shared/models/units/pressure.ts b/ui-ngx/src/app/shared/models/units/pressure.ts index 7443763754..e57bcd6e78 100644 --- a/ui-ngx/src/app/shared/models/units/pressure.ts +++ b/ui-ngx/src/app/shared/models/units/pressure.ts @@ -36,9 +36,7 @@ export type PressureMetricUnits = | 'N/m²' | 'kN/m²' | 'kgf/m²' - | 'Pa/cm²' - | 'J/m³' - | 'kg/m²'; + | 'Pa/cm²'; export type PressureImperialUnits = 'psi' | 'ksi' | 'inHg' | 'psi/in²' | 'tonf/in²'; @@ -47,104 +45,94 @@ const METRIC: TbMeasureUnits = { units: { Pa: { name: 'unit.pascal', - tags: ['pressure', 'force', 'compression', 'tension', 'pascal', 'pascals', 'Pa', 'atmospheric pressure', 'air pressure', 'weather', 'altitude', 'flight'], + tags: ['force', 'compression', 'tension', 'atmospheric pressure', 'air pressure', 'weather', 'altitude', 'flight'], to_anchor: 0.001, }, kPa: { name: 'unit.kilopascal', - tags: ['pressure', 'force', 'compression', 'tension', 'kilopascal', 'kilopascals', 'kPa'], + tags: ['force', 'compression', 'tension'], to_anchor: 1, }, MPa: { name: 'unit.megapascal', - tags: ['pressure', 'force', 'compression', 'tension', 'megapascal', 'megapascals', 'MPa'], + tags: ['force', 'compression', 'tension'], to_anchor: 1000, }, GPa: { name: 'unit.gigapascal', - tags: ['pressure', 'force', 'compression', 'tension', 'gigapascal', 'gigapascals', 'GPa'], + tags: ['force', 'compression', 'tension'], to_anchor: 1000000, }, hPa: { name: 'unit.hectopascal', - tags: ['pressure', 'force', 'compression', 'tension', 'hectopascal', 'hectopascals', 'hPa', 'atmospheric pressure'], + tags: ['force', 'compression', 'tension', 'atmospheric pressure'], to_anchor: 0.1, }, mbar: { name: 'unit.millibar', - tags: ['pressure', 'force', 'compression', 'tension', 'millibar', 'millibars', 'mbar'], + tags: ['force', 'compression', 'tension'], to_anchor: 0.1, }, mb: { name: 'unit.millibar', - tags: ['atmospheric pressure', 'air pressure', 'weather', 'altitude', 'flight', 'mb'], + tags: ['atmospheric pressure', 'air pressure', 'weather', 'altitude', 'flight'], to_anchor: 0.1, }, bar: { name: 'unit.bar', - tags: ['pressure', 'force', 'compression', 'tension', 'bar', 'bars'], + tags: ['force', 'compression', 'tension'], to_anchor: 100, }, kbar: { name: 'unit.kilobar', - tags: ['pressure', 'force', 'compression', 'tension', 'kilobar', 'kilobars', 'kbar'], + tags: ['force', 'compression', 'tension'], to_anchor: 100000, }, Torr: { name: 'unit.torr', - tags: ['pressure', 'force', 'compression', 'tension', 'vacuum pressure', 'torr'], + tags: ['force', 'compression', 'tension', 'vacuum pressure'], to_anchor: 101325 / 760000, }, mmHg: { name: 'unit.millimeters-of-mercury', - tags: ['pressure', 'force', 'compression', 'tension', 'millimeter of mercury', 'millimeters of mercury', 'mmHg', 'vacuum pressure'], + tags: ['force', 'compression', 'tension', 'vacuum pressure'], to_anchor: 0.133322, }, atm: { name: 'unit.atmospheres', - tags: ['pressure', 'force', 'compression', 'tension', 'atmosphere', 'atmospheres', 'atmospheric pressure', 'atm'], + tags: ['force', 'compression', 'tension', 'atmospheric pressure'], to_anchor: 101.325, }, 'Pa/m²': { name: 'unit.pascal-per-square-meter', - tags: ['pressure', 'stress', 'mechanical strength', 'pascal per square meter', 'Pa/m²'], + tags: ['stress', 'mechanical strength'], to_anchor: 0.001, }, 'N/mm²': { name: 'unit.newton-per-square-millimeter', - tags: ['pressure', 'stress', 'mechanical strength', 'newton per square millimeter', 'N/mm²'], + tags: ['stress', 'mechanical strength'], to_anchor: 1000, }, 'N/m²': { name: 'unit.newton-per-square-meter', - tags: ['pressure', 'stress', 'mechanical strength', 'newton per square meter', 'N/m²'], + tags: ['stress', 'mechanical strength'], to_anchor: 0.001, }, 'kN/m²': { name: 'unit.kilonewton-per-square-meter', - tags: ['pressure', 'stress', 'mechanical strength', 'kilonewton per square meter', 'kN/m²'], + tags: ['stress', 'mechanical strength'], to_anchor: 1, }, 'kgf/m²': { name: 'unit.kilogram-force-per-square-meter', - tags: ['pressure', 'stress', 'mechanical strength', 'kilogram-force per square meter', 'kgf/m²'], + tags: ['stress', 'mechanical strength'], to_anchor: 0.00980665, }, 'Pa/cm²': { name: 'unit.pascal-per-square-centimeter', - tags: ['pressure', 'stress', 'mechanical strength', 'pascal per square centimeter', 'Pa/cm²'], + tags: ['stress', 'mechanical strength'], to_anchor: 0.1, }, - 'J/m³': { - name: 'unit.joule-per-cubic-meter', - tags: ['energy density', 'joule per cubic meter', 'J/m³'], - to_anchor: 0.001, - }, - 'kg/m²': { - name: 'unit.kilogram-per-square-meter', - tags: ['density','surface density','areal density','mass per unit area','kg/m²'], - to_anchor: 0.00980665 - } }, }; @@ -153,27 +141,27 @@ const IMPERIAL: TbMeasureUnits = { units: { psi: { name: 'unit.pounds-per-square-inch', - tags: ['pressure', 'force', 'compression', 'tension', 'pounds per square inch', 'psi'], + tags: ['force', 'compression', 'tension'], to_anchor: 0.001, }, ksi: { name: 'unit.kilopound-per-square-inch', - tags: ['pressure', 'force', 'compression', 'tension', 'kilopound per square inch', 'kilopounds per square inch', 'ksi'], + tags: ['force', 'compression', 'tension'], to_anchor: 1, }, inHg: { name: 'unit.inch-of-mercury', - tags: ['pressure', 'force', 'compression', 'tension', 'vacuum pressure', 'inHg', 'atmospheric pressure', 'barometric pressure'], + tags: ['force', 'compression', 'tension', 'vacuum pressure','atmospheric pressure', 'barometric pressure'], to_anchor: 0.000491154, }, 'psi/in²': { name: 'unit.pound-per-square-inch', - tags: ['pressure', 'stress', 'mechanical strength', 'pound per square inch', 'psi/in²'], + tags: ['stress', 'mechanical strength'], to_anchor: 0.001, }, 'tonf/in²': { name: 'unit.ton-force-per-square-inch', - tags: ['pressure', 'stress', 'mechanical strength', 'ton-force per square inch', 'tonf/in²'], + tags: ['stress', 'mechanical strength'], to_anchor: 2, }, }, diff --git a/ui-ngx/src/app/shared/models/units/radiance.ts b/ui-ngx/src/app/shared/models/units/radiance.ts index 38fb646fab..878cc86064 100644 --- a/ui-ngx/src/app/shared/models/units/radiance.ts +++ b/ui-ngx/src/app/shared/models/units/radiance.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 RadianceUnits = 'W/(m²·sr)'; @@ -6,7 +22,7 @@ const METRIC: TbMeasureUnits = { units: { 'W/(m²·sr)': { name: 'unit.watt-per-square-metre-steradian', - tags: ['radiance', 'radiant flux density', 'wTape per square metre-steradian', 'W/(m²·sr)'], + tags: ['radiant flux density'], to_anchor: 1, }, }, diff --git a/ui-ngx/src/app/shared/models/units/radiant-intensity.ts b/ui-ngx/src/app/shared/models/units/radiant-intensity.ts index 78ee45ee5d..3b4958b892 100644 --- a/ui-ngx/src/app/shared/models/units/radiant-intensity.ts +++ b/ui-ngx/src/app/shared/models/units/radiant-intensity.ts @@ -1,13 +1,28 @@ +/// +/// 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 RadiantIntensityUnits = RadiantIntensityMetricUnits; -export type RadiantIntensityMetricUnits = 'W/sr'; +export type RadiantIntensityUnits = 'W/sr'; -const METRIC: TbMeasureUnits = { +const METRIC: TbMeasureUnits = { units: { 'W/sr': { name: 'unit.watt-per-steradian', - tags: ['radiant intensity', 'power per unit solid angle', 'watt per steradian', 'W/sr'], + tags: ['power per unit solid angle'], to_anchor: 1, }, }, diff --git a/ui-ngx/src/app/shared/models/units/radiation-dose.ts b/ui-ngx/src/app/shared/models/units/radiation-dose.ts index 1619a48780..c7adc05f57 100644 --- a/ui-ngx/src/app/shared/models/units/radiation-dose.ts +++ b/ui-ngx/src/app/shared/models/units/radiation-dose.ts @@ -1,43 +1,58 @@ +/// +/// 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 RadiationDoseMetricUnits = 'Gy' | 'Sv' | 'Rad' | 'Rem' | 'R' | 'C/kg' | 'Gy/s'; -export type RadiationDoseUnits = RadiationDoseMetricUnits; +export type RadiationDoseUnits = 'Gy' | 'Sv' | 'Rad' | 'Rem' | 'R' | 'C/kg' | 'cps'; -const METRIC: TbMeasureUnits = { +const METRIC: TbMeasureUnits = { units: { - 'Sv': { + Sv: { name: 'unit.sievert', - tags: ['radiation dose', 'sievert', 'radiation dose equivalent', 'Sv'], + tags: ['sievert', 'radiation dose equivalent', 'Sv'], to_anchor: 1, }, - 'Gy': { + Gy: { name: 'unit.gray', - tags: ['radiation dose', 'absorbed dose', 'gray', 'Gy'], + tags: ['absorbed dose', 'gray', 'Gy'], to_anchor: 1, }, - 'Rad': { + Rad: { name: 'unit.rad', - tags: ['radiation dose', 'rad'], + tags: ['rad'], to_anchor: 0.01, }, - 'Rem': { + Rem: { name: 'unit.rem', - tags: ['radiation dose equivalent', 'rem'], + tags: ['radiation dose equivalent'], to_anchor: 0.01, }, - 'R': { + R: { name: 'unit.roentgen', - tags: ['radiation exposure', 'roentgen', 'R'], + tags: ['radiation exposure'], to_anchor: 0.0093, }, 'C/kg': { name: 'unit.coulombs-per-kilogram', - tags: ['radiation exposure', 'dose', 'coulombs per kilogram', 'electric charge-to-mass ratio', 'C/kg'], + tags: ['radiation exposure', 'electric charge-to-mass ratio'], to_anchor: 34, }, - 'Gy/s': { - name: 'unit.gy-per-second', - tags: ['absorbed dose rate', 'radiation dose rate', 'gray per second', 'Gy/s'], + cps: { + name: 'unit.cps', + tags: ['radiation detection'], to_anchor: 1, }, }, diff --git a/ui-ngx/src/app/shared/models/units/radioactive-decay-rate.ts b/ui-ngx/src/app/shared/models/units/radioactive-decay-rate.ts deleted file mode 100644 index d357c11b72..0000000000 --- a/ui-ngx/src/app/shared/models/units/radioactive-decay-rate.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { TbMeasure, TbMeasureUnits } from '@shared/models/unit.models'; - -export type RadioactiveDecayRateUnits = 'Bq/s' | 'Ci/s'; - -const METRIC: TbMeasureUnits = { - transform: (Bq_s) => Bq_s / 3.7e10, // Convert Bq/s to Ci/s - units: { - 'Bq/s': { - name: 'unit.becquerels-per-second', - tags: ['radioactive decay rate', 'becquerels per second', 'Bq/s'], - to_anchor: 1, - }, - 'Ci/s': { - name: 'unit.curies-per-second', - tags: ['radioactive decay rate', 'curies per second', 'Ci/s'], - to_anchor: 3.7e10, - }, - } -}; - -const measure: TbMeasure = { - METRIC, -}; - -export default measure; diff --git a/ui-ngx/src/app/shared/models/units/radioactive-decay.ts b/ui-ngx/src/app/shared/models/units/radioactive-decay.ts new file mode 100644 index 0000000000..520b81dab6 --- /dev/null +++ b/ui-ngx/src/app/shared/models/units/radioactive-decay.ts @@ -0,0 +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 RadioactiveDecayUnits = 'Bq/s' | 'Ci/s'; + +const METRIC: TbMeasureUnits = { + units: { + 'Bq/s': { + name: 'unit.becquerels-per-second', + to_anchor: 1, + }, + 'Ci/s': { + name: 'unit.curies-per-second', + to_anchor: 3.7e10, + }, + } +}; + +const measure: TbMeasure = { + METRIC, +}; + +export default measure; diff --git a/ui-ngx/src/app/shared/models/units/radioactivity-concentration.ts b/ui-ngx/src/app/shared/models/units/radioactivity-concentration.ts index 8036332f13..4d6c99bf1e 100644 --- a/ui-ngx/src/app/shared/models/units/radioactivity-concentration.ts +++ b/ui-ngx/src/app/shared/models/units/radioactivity-concentration.ts @@ -1,18 +1,33 @@ +/// +/// 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 RadioactivityConcentrationMetricUnits = 'Bq/m³' | 'Ci/L'; -export type RadioactivityConcentrationUnits = RadioactivityConcentrationMetricUnits; +export type RadioactivityConcentrationUnits = 'Bq/m³' | 'Ci/L'; -const METRIC: TbMeasureUnits = { +const METRIC: TbMeasureUnits = { units: { 'Bq/m³': { name: 'unit.becquerels-per-cubic-meter', - tags: ['radioactivity', 'radiation', 'becquerels per cubic meter', 'Bq/m³'], + tags: ['radiation'], to_anchor: 1, }, 'Ci/L': { name: 'unit.curies-per-liter', - tags: ['radioactivity', 'radiation', 'curies per liter', 'Ci/L'], + tags: ['radiation'], to_anchor: 3.7e10 * 1000, }, }, diff --git a/ui-ngx/src/app/shared/models/units/radioactivity.ts b/ui-ngx/src/app/shared/models/units/radioactivity.ts index 8db76da7af..ed456ca96a 100644 --- a/ui-ngx/src/app/shared/models/units/radioactivity.ts +++ b/ui-ngx/src/app/shared/models/units/radioactivity.ts @@ -1,33 +1,44 @@ +/// +/// 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 RadioactivityMetricUnits = 'Bq' | 'Ci' | 'Rd' | 'dps' | 'cps'; +export type RadioactivityMetricUnits = 'Bq' | 'Ci' | 'Rd' | 'dps'; export type RadioactivityUnits = RadioactivityMetricUnits; const METRIC: TbMeasureUnits = { units: { - 'Bq': { + Bq: { name: 'unit.becquerel', - tags: ['radioactivity', 'decay rate', 'becquerel', 'Bq'], + tags: ['radioactivity', 'decay rate'], to_anchor: 1, }, - 'Ci': { + Ci: { name: 'unit.curie', - tags: ['radioactivity', 'radiation', 'curie', 'Ci'], + tags: ['radiation'], to_anchor: 3.7e10, }, - 'Rd': { + Rd: { name: 'unit.rutherford', - tags: ['radioactive decay', 'radioactivity', 'rutherford', 'Rd'], - to_anchor: 1e6, + tags: ['radioactive decay'], + to_anchor: 3.7e4, }, - 'dps': { + dps: { name: 'unit.dps', - tags: ['radioactive decay', 'radioactivity', 'disintegrations per second', 'dps'], - to_anchor: 1, - }, - cps: { - name: 'unit.cps', - tags: ['radiation detection', 'counts per second', 'cps'], + tags: ['radioactive decay'], to_anchor: 1, }, }, diff --git a/ui-ngx/src/app/shared/models/units/reciprocal-length.ts b/ui-ngx/src/app/shared/models/units/reciprocal-length.ts new file mode 100644 index 0000000000..bfa26f57ec --- /dev/null +++ b/ui-ngx/src/app/shared/models/units/reciprocal-length.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 ReciprocalLengthUnits = 'm⁻¹'; + +const METRIC: TbMeasureUnits = { + units: { + 'm⁻¹': { + name: 'unit.reciprocal-metre', + tags: ['wavenumber', 'wave density', 'wave frequency'], + to_anchor: 1, + }, + }, +}; + +const measure: TbMeasure = { + METRIC, +}; + +export default measure; diff --git a/ui-ngx/src/app/shared/models/units/resistance.ts b/ui-ngx/src/app/shared/models/units/resistance.ts index 6f14faf4c4..0efef06a0a 100644 --- a/ui-ngx/src/app/shared/models/units/resistance.ts +++ b/ui-ngx/src/app/shared/models/units/resistance.ts @@ -1,39 +1,53 @@ -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 ResistanceMetricUnits = 'Ω' | 'μΩ' | 'mΩ' | 'kΩ' | 'MΩ' | 'GΩ'; +import { TbMeasure, TbMeasureUnits } from '@shared/models/unit.models'; -export type ResistanceUnits = ResistanceMetricUnits; +export type ResistanceUnits = 'Ω' | 'μΩ' | 'mΩ' | 'kΩ' | 'MΩ' | 'GΩ'; -const METRIC: TbMeasureUnits = { +const METRIC: TbMeasureUnits = { units: { - 'Ω': { + Ω: { name: 'unit.ohm', - tags: ['electrical resistance', 'resistance', 'impedance', 'ohm'], + tags: ['electrical resistance', 'impedance'], to_anchor: 1, }, - 'μΩ': { + μΩ: { name: 'unit.microohm', - tags: ['electrical resistance', 'resistance', 'microohm', 'μΩ'], + tags: ['electrical resistance'], to_anchor: 0.000001, }, - 'mΩ': { + mΩ: { name: 'unit.milliohm', - tags: ['electrical resistance', 'resistance', 'milliohm', 'mΩ'], + tags: ['electrical resistance'], to_anchor: 0.001, }, - 'kΩ': { + kΩ: { name: 'unit.kilohm', - tags: ['electrical resistance', 'resistance', 'kilohm', 'kΩ'], + tags: ['electrical resistance'], to_anchor: 1000, }, - 'MΩ': { + MΩ: { name: 'unit.megohm', - tags: ['electrical resistance', 'resistance', 'megohm', 'MΩ'], + tags: ['electrical resistance'], to_anchor: 1000000, }, - 'GΩ': { + GΩ: { name: 'unit.gigohm', - tags: ['electrical resistance', 'resistance', 'gigohm', 'GΩ'], + tags: ['electrical resistance'], to_anchor: 1000000000, }, }, diff --git a/ui-ngx/src/app/shared/models/units/reynolds-number.ts b/ui-ngx/src/app/shared/models/units/reynolds-number.ts index a9e8b8c01e..6f3b9a9df3 100644 --- a/ui-ngx/src/app/shared/models/units/reynolds-number.ts +++ b/ui-ngx/src/app/shared/models/units/reynolds-number.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 ReynoldsNumberMetricUnits = 'Re'; +import { TbMeasure, TbMeasureUnits } from '@shared/models/unit.models'; -export type ReynoldsNumberUnits = ReynoldsNumberMetricUnits; +export type ReynoldsNumberUnits = 'Re'; -const METRIC: TbMeasureUnits = { +const METRIC: TbMeasureUnits = { units: { Re: { name: 'unit.reynolds', - tags: ['fluid flow regime', 'fluid mechanics', 'reynolds', 'Re'], + tags: ['fluid flow regime', 'fluid mechanics'], to_anchor: 1, }, }, diff --git a/ui-ngx/src/app/shared/models/units/signal-level.ts b/ui-ngx/src/app/shared/models/units/signal-level.ts new file mode 100644 index 0000000000..0ef0c5ce54 --- /dev/null +++ b/ui-ngx/src/app/shared/models/units/signal-level.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 SignalLevelUnits = 'dBmV' | 'dBm' | 'rssi'; + +const METRIC: TbMeasureUnits = { + units: { + dBmV: { + name: 'unit.dbmV', + tags: ['decibels millivolt', 'voltage level'], + to_anchor: 1, + }, + dBm: { + name: 'unit.dbm', + tags: ['decibel milliwatts', 'output power'], + to_anchor: 1, + }, + rssi: { + name: 'unit.rssi', + tags: ['signal strength', 'received signal strength indicator'], + to_anchor: 1, + }, + }, +}; + +const measure: TbMeasure = { + METRIC, +}; + +export default measure; diff --git a/ui-ngx/src/app/shared/models/units/signal-strength.ts b/ui-ngx/src/app/shared/models/units/signal-strength.ts deleted file mode 100644 index ef6a595ea3..0000000000 --- a/ui-ngx/src/app/shared/models/units/signal-strength.ts +++ /dev/null @@ -1,31 +0,0 @@ -import { TbMeasure, TbMeasureUnits } from '@shared/models/unit.models'; - -export type SignalStrengthMetricUnits = 'dBmV' | 'dBm' | 'rssi'; - -export type SignalStrengthUnits = SignalStrengthMetricUnits; - -const METRIC: TbMeasureUnits = { - units: { - 'dBmV': { - name: 'unit.dbmV', - tags: ['decibels millivolt', 'voltage level', 'signal', 'dBmV'], - to_anchor: 1, - }, - 'dBm': { - name: 'unit.dbm', - tags: ['decibel milliwatts', 'output power', 'signal', 'dBm'], - to_anchor: 1, - }, - 'rssi': { - name: 'unit.rssi', - tags: ['signal strength', 'signal level', 'received signal strength indicator', 'rssi', 'dBm'], - to_anchor: 1, - }, - }, -}; - -const measure: TbMeasure = { - METRIC, -}; - -export default measure; diff --git a/ui-ngx/src/app/shared/models/units/solid-angle.ts b/ui-ngx/src/app/shared/models/units/solid-angle.ts index c339884b65..c220c41098 100644 --- a/ui-ngx/src/app/shared/models/units/solid-angle.ts +++ b/ui-ngx/src/app/shared/models/units/solid-angle.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 SolidAngleMetricUnits = 'sr'; +import { TbMeasure, TbMeasureUnits } from '@shared/models/unit.models'; -export type SolidAngleUnits = SolidAngleMetricUnits; +export type SolidAngleUnits = 'sr'; -const METRIC: TbMeasureUnits = { +const METRIC: TbMeasureUnits = { units: { - 'sr': { + sr: { name: 'unit.steradian', - tags: ['solid angle', 'spatial extent', 'steradian', 'sr'], + tags: ['spatial extent'], to_anchor: 1, }, }, diff --git a/ui-ngx/src/app/shared/models/units/specific-energy.ts b/ui-ngx/src/app/shared/models/units/specific-energy.ts index 3ca9d44221..3787f1fb7a 100644 --- a/ui-ngx/src/app/shared/models/units/specific-energy.ts +++ b/ui-ngx/src/app/shared/models/units/specific-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 SpecificEnergyMetricUnits = 'J/kg'; +import { TbMeasure, TbMeasureUnits } from '@shared/models/unit.models'; -export type SpecificEnergyUnits = SpecificEnergyMetricUnits; +export type SpecificEnergyUnits = 'J/kg'; -const METRIC: TbMeasureUnits = { +const METRIC: TbMeasureUnits = { units: { 'J/kg': { name: 'unit.joule-per-kilogram', - tags: ['specific energy', 'specific energy capacity', 'joule per kilogram', 'J/kg'], to_anchor: 1, }, }, diff --git a/ui-ngx/src/app/shared/models/units/specific-heat-capacity.ts b/ui-ngx/src/app/shared/models/units/specific-heat-capacity.ts index 9bdf38e80c..595d1ca7ff 100644 --- a/ui-ngx/src/app/shared/models/units/specific-heat-capacity.ts +++ b/ui-ngx/src/app/shared/models/units/specific-heat-capacity.ts @@ -1,14 +1,12 @@ import { TbMeasure, TbMeasureUnits } from '@shared/models/unit.models'; -export type SpecificHeatCapacityMetricUnits = 'J/(kg·K)'; +export type SpecificHeatCapacityUnits = 'J/(kg·K)'; -export type SpecificHeatCapacityUnits = SpecificHeatCapacityMetricUnits; - -const METRIC: TbMeasureUnits = { +const METRIC: TbMeasureUnits = { units: { 'J/(kg·K)': { name: 'unit.joule-per-kilogram-kelvin', - tags: ['specific heat capacity', 'heat capacity per unit mass and temperature', 'joule per kilogram-kelvin', 'J/(kg·K)'], + tags: ['heat capacity per unit mass and temperature'], to_anchor: 1, }, }, diff --git a/ui-ngx/src/app/shared/models/units/specific-humidity.ts b/ui-ngx/src/app/shared/models/units/specific-humidity.ts index 82f12b26e2..9a93f513da 100644 --- a/ui-ngx/src/app/shared/models/units/specific-humidity.ts +++ b/ui-ngx/src/app/shared/models/units/specific-humidity.ts @@ -22,7 +22,7 @@ const METRIC: TbMeasureUnits = { units: { 'g/kg': { name: 'unit.gram-per-kilogram', - tags: ['humidity', 'moisture', 'specific humidity', 'g/kg'], + tags: ['humidity', 'moisture'], to_anchor: 1, }, }, diff --git a/ui-ngx/src/app/shared/models/units/specific-volume.ts b/ui-ngx/src/app/shared/models/units/specific-volume.ts index 9968454e41..adef7b4b00 100644 --- a/ui-ngx/src/app/shared/models/units/specific-volume.ts +++ b/ui-ngx/src/app/shared/models/units/specific-volume.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 SpecificVolumeMetricUnits = 'm³/kg'; +import { TbMeasure, TbMeasureUnits } from '@shared/models/unit.models'; -export type SpecificVolumeUnits = SpecificVolumeMetricUnits; +export type SpecificVolumeUnits = 'm³/kg'; -const METRIC: TbMeasureUnits = { +const METRIC: TbMeasureUnits = { units: { 'm³/kg': { name: 'unit.cubic-meter-per-kilogram', - tags: ['specific volume', 'volume per unit mass', 'cubic meter per kilogram', 'm³/kg'], + tags: ['volume per unit mass'], to_anchor: 1, }, }, diff --git a/ui-ngx/src/app/shared/models/units/speed.ts b/ui-ngx/src/app/shared/models/units/speed.ts index f44553a7a7..b930b0739c 100644 --- a/ui-ngx/src/app/shared/models/units/speed.ts +++ b/ui-ngx/src/app/shared/models/units/speed.ts @@ -26,22 +26,22 @@ const METRIC: TbMeasureUnits = { units: { 'm/s': { name: 'unit.meter-per-second', - tags: ['speed', 'velocity', 'pace', 'meter per second', 'm/s', 'peak', 'peak to peak', 'root mean square (RMS)', 'vibration', 'wind speed', 'weather'], + tags: ['velocity', 'pace', 'peak', 'peak to peak', 'root mean square (RMS)', 'vibration', 'wind speed', 'weather'], to_anchor: 3.6, }, 'km/h': { name: 'unit.kilometer-per-hour', - tags: ['speed', 'velocity', 'pace', 'kilometer per hour', 'km/h'], + tags: ['velocity', 'pace'], to_anchor: 1, }, 'mm/min': { name: 'unit.millimeters-per-minute', - tags: ['feed rate', 'cutting feed rate', 'millimeters per minute', 'mm/min'], + tags: ['feed rate', 'cutting feed rate'], to_anchor: 0.06, }, 'mm/s': { name: 'unit.millimeters-per-second', - tags: ['velocity', 'speed', 'vibration rate', 'millimeters per second', 'mm/s'], + tags: ['velocity', 'vibration rate'], to_anchor: 0.0036, }, }, @@ -52,27 +52,27 @@ const IMPERIAL: TbMeasureUnits = { units: { mph: { name: 'unit.mile-per-hour', - tags: ['speed', 'velocity', 'pace', 'mile per hour', 'mph'], + tags: ['velocity', 'pace'], to_anchor: 1, }, kt: { name: 'unit.knot', - tags: ['speed', 'velocity', 'pace', 'knot', 'knots', 'kt'], + tags: ['velocity', 'pace'], to_anchor: 1.150779, }, 'ft/s': { name: 'unit.foot-per-second', - tags: ['speed', 'velocity', 'pace', 'foot per second', 'ft/s'], - to_anchor: 0.681818, // 1 ft/s ≈ 0.681818 mph + tags: ['velocity', 'pace'], + to_anchor: 0.681818, }, 'ft/min': { name: 'unit.foot-per-minute', - tags: ['speed', 'velocity', 'pace', 'foot per minute', 'ft/min'], + tags: ['velocity', 'pace'], to_anchor: 0.0113636, }, 'in/h': { name: 'unit.inch-per-hour', - tags: ['speed', 'velocity', 'pace', 'inch per hour', 'in/h'], + tags: ['velocity', 'pace'], to_anchor: 0.00001578, }, }, diff --git a/ui-ngx/src/app/shared/models/units/sugar-content.ts b/ui-ngx/src/app/shared/models/units/sugar-content.ts deleted file mode 100644 index 1badaf3ce0..0000000000 --- a/ui-ngx/src/app/shared/models/units/sugar-content.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { TbMeasure, TbMeasureUnits } from '@shared/models/unit.models'; - -export type SugarContentUnits = '°Bx'; - -const METRIC: TbMeasureUnits = { - units: { - '°Bx': { - name: 'unit.degrees-brix', - tags: ['sugar content', 'fruit ripeness', 'Bx'], - to_anchor: 1, - }, - }, -}; - -const measure: TbMeasure = { - METRIC, -}; - -export default measure; diff --git a/ui-ngx/src/app/shared/models/units/surface-charge-density.ts b/ui-ngx/src/app/shared/models/units/surface-charge-density.ts index 306649db3c..d0640bcf4e 100644 --- a/ui-ngx/src/app/shared/models/units/surface-charge-density.ts +++ b/ui-ngx/src/app/shared/models/units/surface-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 SurfaceChargeDensityMetricUnits = 'C/m²'; +import { TbMeasure, TbMeasureUnits } from '@shared/models/unit.models'; -export type SurfaceChargeDensityUnits = SurfaceChargeDensityMetricUnits; +export type SurfaceChargeDensityUnits = 'C/m²'; -const METRIC: TbMeasureUnits = { +const METRIC: TbMeasureUnits = { units: { 'C/m²': { name: 'unit.coulomb-per-square-meter', - tags: ['electric surface charge density', 'coulomb per square meter', 'C/m²'], + tags: ['electric surface charge density'], to_anchor: 1, }, }, diff --git a/ui-ngx/src/app/shared/models/units/surface-tension.ts b/ui-ngx/src/app/shared/models/units/surface-tension.ts index b1c5593354..718b8113c1 100644 --- a/ui-ngx/src/app/shared/models/units/surface-tension.ts +++ b/ui-ngx/src/app/shared/models/units/surface-tension.ts @@ -1,20 +1,34 @@ -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 SurfaceTensionMetricUnits = 'N/m'; +import { TbMeasure, TbMeasureUnits } from '@shared/models/unit.models'; -export type SurfaceTensionhUnits = SurfaceTensionMetricUnits; +export type SurfaceTensionUnits = 'N/m'; -const METRIC: TbMeasureUnits = { +const METRIC: TbMeasureUnits = { units: { 'N/m': { name: 'unit.newton-per-meter', - tags: ['linear density', 'force per unit length', 'newton per meter', 'N/m'], + tags: ['linear density', 'force per unit length'], to_anchor: 1, }, }, }; -const measure: TbMeasure = { +const measure: TbMeasure = { METRIC, }; diff --git a/ui-ngx/src/app/shared/models/units/temperature.ts b/ui-ngx/src/app/shared/models/units/temperature.ts index 67f17f0a4b..59d11f1eed 100644 --- a/ui-ngx/src/app/shared/models/units/temperature.ts +++ b/ui-ngx/src/app/shared/models/units/temperature.ts @@ -28,12 +28,12 @@ const METRIC: TbMeasureUnits = { units: { '°C': { name: 'unit.celsius', - tags: ['temperature', 'heat', 'cold', 'warmth', 'degrees', 'celsius', 'shipment condition', '°C'], + tags: ['heat', 'cold', 'warmth', 'degrees', 'shipment condition'], to_anchor: 1, }, K: { name: 'unit.kelvin', - tags: ['temperature', 'heat', 'cold', 'warmth', 'degrees', 'kelvin', 'K', 'color quality', 'white balance', 'color temperature'], + tags: ['heat', 'cold', 'warmth', 'degrees', 'color quality', 'white balance', 'color temperature'], to_anchor: 1, anchor_shift: 273.15, }, @@ -45,12 +45,12 @@ const IMPERIAL: TbMeasureUnits = { units: { '°F': { name: 'unit.fahrenheit', - tags: ['temperature', 'heat', 'cold', 'warmth', 'degrees', 'fahrenheit', '°F'], + tags: ['heat', 'cold', 'warmth', 'degrees'], to_anchor: 1, }, '°R': { name: 'unit.rankine', - tags: ['temperature', 'heat', 'cold', 'warmth', 'Rankine', '°R'], + tags: ['heat', 'cold', 'warmth'], to_anchor: 1, anchor_shift: 459.67, }, diff --git a/ui-ngx/src/app/shared/models/units/thermal-conductivity.ts b/ui-ngx/src/app/shared/models/units/thermal-conductivity.ts index 3c27727919..5407614164 100644 --- a/ui-ngx/src/app/shared/models/units/thermal-conductivity.ts +++ b/ui-ngx/src/app/shared/models/units/thermal-conductivity.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 ThermalConductivityMetricUnits = 'W/(m·K)'; +import { TbMeasure, TbMeasureUnits } from '@shared/models/unit.models'; -export type ThermalConductivityUnits = ThermalConductivityMetricUnits; +export type ThermalConductivityUnits = 'W/(m·K)'; -const METRIC: TbMeasureUnits = { +const METRIC: TbMeasureUnits = { units: { 'W/(m·K)': { name: 'unit.watt-per-meter-kelvin', - tags: ['thermal conductivity', 'watt per meter-kelvin', 'W/(m·K)'], to_anchor: 1, }, }, diff --git a/ui-ngx/src/app/shared/models/units/time.ts b/ui-ngx/src/app/shared/models/units/time.ts index 944bfafbe7..2833080230 100644 --- a/ui-ngx/src/app/shared/models/units/time.ts +++ b/ui-ngx/src/app/shared/models/units/time.ts @@ -36,52 +36,52 @@ const METRIC: TbMeasureUnits = { units: { ns: { name: 'unit.nanosecond', - tags: ['time', 'duration', 'interval', 'ns'], + tags: ['duration', 'interval'], to_anchor: 1 / 1000000000 }, - 'μs': { + μs: { name: 'unit.microsecond', - tags: ['time', 'duration', 'interval', 'h'], + tags: ['duration', 'interval'], to_anchor: 1 / 1000000 }, ms: { name: 'unit.millisecond', - tags: ['time', 'duration', 'interval', 'ms'], + tags: ['duration', 'interval'], to_anchor: 1 / 1000 }, s: { name: 'unit.second', - tags: ['time', 'duration', 'interval', 'second', 'sec'], + tags: ['duration', 'interval'], to_anchor: 1, }, min: { name: 'unit.minute', - tags: ['time', 'duration', 'interval', 'minute', 'min'], + tags: ['duration', 'interval'], to_anchor: 60, }, h: { name: 'unit.hour', - tags: ['time', 'duration', 'interval', 'h'], + tags: ['duration', 'interval'], to_anchor: 60 * 60, }, d: { name: 'unit.day', - tags: ['time', 'duration', 'interval', 'd'], + tags: ['duration', 'interval'], to_anchor: 60 * 60 * 24, }, wk: { name: 'unit.week', - tags: ['time', 'duration', 'interval', 'wk'], + tags: ['duration', 'interval'], to_anchor: 60 * 60 * 24 * 7, }, mo: { name: 'unit.month', - tags: ['time', 'duration', 'interval', 'mo'], + tags: ['duration', 'interval'], to_anchor: (60 * 60 * 24 * daysInYear) / 12, }, yr: { name: 'unit.year', - tags: ['time', 'duration', 'interval', 'yr'], + tags: ['duration', 'interval'], to_anchor: 60 * 60 * 24 * daysInYear, }, } diff --git a/ui-ngx/src/app/shared/models/units/torque.ts b/ui-ngx/src/app/shared/models/units/torque.ts index fa830a0a4a..03ef7e7208 100644 --- a/ui-ngx/src/app/shared/models/units/torque.ts +++ b/ui-ngx/src/app/shared/models/units/torque.ts @@ -26,7 +26,7 @@ const METRIC: TbMeasureUnits = { units: { Nm: { name: 'unit.newton-meter', - tags: ['torque', 'rotational force', 'newton meter', 'Nm'], + tags: ['rotational force', 'newton meter', 'Nm'], to_anchor: 1, }, }, @@ -37,12 +37,12 @@ const IMPERIAL: TbMeasureUnits = { units: { 'lbf-ft': { name: 'unit.foot-pounds', - tags: ['torque', 'rotational force', 'foot-pound', 'foot-pounds', 'ft·lbf'], + tags: ['rotational force'], to_anchor: 1, }, 'in·lbf': { name: 'unit.inch-pounds', - tags: ['torque', 'rotational force', 'inch-pounds', 'inch-pound', 'in·lbf'], + tags: ['rotational force'], to_anchor: 1 / 12, }, }, diff --git a/ui-ngx/src/app/shared/models/units/turbidity.ts b/ui-ngx/src/app/shared/models/units/turbidity.ts index 92b1122437..3d5e752ef7 100644 --- a/ui-ngx/src/app/shared/models/units/turbidity.ts +++ b/ui-ngx/src/app/shared/models/units/turbidity.ts @@ -1,13 +1,28 @@ +/// +/// 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 TurbidityUnits = TurbidityMetricUnits; -export type TurbidityMetricUnits = 'NTU'; +export type TurbidityUnits = 'NTU'; -const METRIC: TbMeasureUnits = { +const METRIC: TbMeasureUnits = { units: { NTU: { name: 'unit.turbidity', - tags: ['water turbidity', 'water clarity', 'Nephelometric Turbidity Units', 'NTU'], + tags: ['water turbidity', 'water clarity', 'Nephelometric Turbidity Units'], to_anchor: 1, }, }, diff --git a/ui-ngx/src/app/shared/models/units/voltage.ts b/ui-ngx/src/app/shared/models/units/voltage.ts index 54f0ec2c20..10c079551c 100644 --- a/ui-ngx/src/app/shared/models/units/voltage.ts +++ b/ui-ngx/src/app/shared/models/units/voltage.ts @@ -23,37 +23,37 @@ const METRIC: TbMeasureUnits = { units: { pV: { name: 'unit.picovolt', - tags: ['voltage', 'volts', 'picovolt', 'pV'], + tags: ['volts'], to_anchor: 1e-12, }, nV: { name: 'unit.nanovolt', - tags: ['voltage', 'volts', 'nanovolt', 'nV'], + tags: ['volts'], to_anchor: 1e-9, }, μV: { name: 'unit.microvolt', - tags: ['electric potential', 'electric tension', 'voltage', 'microvolt', 'microvolts', 'μV'], + tags: ['electric potential', 'electric tension'], to_anchor: 1e-6, }, mV: { name: 'unit.millivolt', - tags: ['electric potential', 'electric tension', 'voltage', 'millivolt', 'millivolts', 'mV'], - to_anchor: 0.001, // 1 mV = 1e-3 V + tags: ['electric potential', 'electric tension'], + to_anchor: 0.001, }, V: { name: 'unit.volt', - tags: ['electric potential', 'electric tension', 'voltage', 'volt', 'volts', 'V', 'power source', 'battery', 'battery level'], + tags: ['electric potential', 'electric tension', 'power source', 'battery', 'battery level'], to_anchor: 1, }, kV: { name: 'unit.kilovolt', - tags: ['electric potential', 'electric tension', 'voltage', 'kilovolt', 'kilovolts', 'kV'], + tags: ['electric potential', 'electric tension'], to_anchor: 1000, }, MV: { name: 'unit.megavolt', - tags: ['electric potential', 'electric tension', 'voltage', 'megavolt', 'megavolts', 'MV'], + tags: ['electric potential', 'electric tension'], to_anchor: 1e6, }, }, diff --git a/ui-ngx/src/app/shared/models/units/volume-charge-density.ts b/ui-ngx/src/app/shared/models/units/volume-charge-density.ts deleted file mode 100644 index 0b172962fd..0000000000 --- a/ui-ngx/src/app/shared/models/units/volume-charge-density.ts +++ /dev/null @@ -1,21 +0,0 @@ -import { TbMeasure, TbMeasureUnits } from '@shared/models/unit.models'; - -export type VolumeChargeDensityMetricUnits = 'C/m³'; - -export type VolumeChargeDensityUnits = VolumeChargeDensityMetricUnits; - -const METRIC: TbMeasureUnits = { - units: { - 'C/m³': { - name: 'unit.coulomb-per-cubic-meter', - tags: ['electric charge density', 'coulomb per cubic meter', 'C/m³'], - to_anchor: 1, - }, - }, -}; - -const measure: TbMeasure = { - METRIC, -}; - -export default measure; diff --git a/ui-ngx/src/app/shared/models/units/volume-flow-rate.ts b/ui-ngx/src/app/shared/models/units/volume-flow.ts similarity index 56% rename from ui-ngx/src/app/shared/models/units/volume-flow-rate.ts rename to ui-ngx/src/app/shared/models/units/volume-flow.ts index fd1f25c1f4..0f9fa44520 100644 --- a/ui-ngx/src/app/shared/models/units/volume-flow-rate.ts +++ b/ui-ngx/src/app/shared/models/units/volume-flow.ts @@ -16,9 +16,9 @@ import { TbMeasure, TbMeasureUnits } from '@shared/models/unit.models'; -export type VolumeFlowRateUnits = VolumeFlowRateMetricUnits | VolumeFlowRateImperialUnits; +export type VolumeFlowUnits = VolumeFlowMetricUnits | VolumeFlowImperialUnits; -export type VolumeFlowRateMetricUnits = +export type VolumeFlowMetricUnits = | 'dm³/s' | 'mL/min' | 'L/s' @@ -27,86 +27,86 @@ export type VolumeFlowRateMetricUnits = | 'm³/s' | 'm³/hr'; -export type VolumeFlowRateImperialUnits = +export type VolumeFlowImperialUnits = | 'fl-oz/s' | 'ft³/s' | 'ft³/min' | 'gal/hr' | 'GPM'; -const METRIC: TbMeasureUnits = { +const METRIC: TbMeasureUnits = { ratio: 33.8140227, units: { + 'L/s': { + name: 'unit.liter-per-second', + tags: ['airflow', 'ventilation', 'HVAC', 'gas flow rate'], + to_anchor: 1, + }, 'dm³/s': { name: 'unit.cubic-decimeter-per-second', - tags: ['volume flow', 'cubic decimeter per second', 'dm3/s'], + tags: ['cubic decimeter per second'], to_anchor: 1, }, 'mL/min': { name: 'unit.milliliters-per-minute', - tags: ['volume flow', 'flow rate', 'fluid dynamics', 'milliliters per minute', 'mL/min'], + tags: ['flow rate', 'fluid dynamics'], to_anchor: 1 / 60000, }, - 'L/s': { - name: 'unit.liter-per-second', - tags: ['volume flow', 'airflow', 'ventilation', 'HVAC', 'gas flow rate', 'liter per second', 'L/s'], - to_anchor: 1, - }, 'L/min': { name: 'unit.liter-per-minute', - tags: ['volume flow', 'airflow', 'ventilation', 'HVAC', 'gas flow rate', 'liter per minute', 'L/min'], + tags: ['airflow', 'ventilation', 'HVAC', 'gas flow rate'], to_anchor: 1 / 60, }, 'L/hr': { name: 'unit.liters-per-hour', - tags: ['volume flow', 'fuel consumption', 'liter per hour', 'L/hr'], + tags: ['fuel consumption'], to_anchor: 1 / 3600, }, 'm³/s': { name: 'unit.cubic-meters-per-second', - tags: ['volume flow', 'airflow', 'ventilation', 'HVAC', 'gas flow rate', 'cubic meters per second', 'm³/s'], + tags: ['airflow', 'ventilation', 'HVAC', 'gas flow rate'], to_anchor: 1000, }, 'm³/hr': { name: 'unit.cubic-meters-per-hour', - tags: ['volume flow', 'airflow', 'ventilation', 'HVAC', 'gas flow rate', 'cubic meters per hour', 'm³/hr'], + tags: ['airflow', 'ventilation', 'HVAC', 'gas flow rate'], to_anchor: 5 / 18, }, }, }; -const IMPERIAL: TbMeasureUnits = { +const IMPERIAL: TbMeasureUnits = { ratio: 1 / 33.8140227, units: { 'fl-oz/s': { name: 'unit.fluid-ounce-per-second', - tags: ['volume flow', 'fluid ounce per second', 'fl-oz/s'], + tags: ['fluid ounce per second', 'fl-oz/s'], to_anchor: 1, }, 'ft³/s': { name: 'unit.cubic-foot-per-second', - tags: ['volume flow', 'flow rate', 'fluid flow', 'cubic foot per second', 'cubic feet per second', 'ft³/s'], + tags: ['flow rate', 'fluid flow'], to_anchor: 957.506, }, 'ft³/min': { name: 'unit.cubic-foot-per-minute', - tags: ['volume flow', 'airflow', 'ventilation', 'HVAC', 'gas flow rate', 'CFM', 'flow rate', 'fluid flow', 'cubic foot per minute', 'ft³/min'], + tags: ['airflow', 'ventilation', 'HVAC', 'gas flow rate', 'CFM', 'flow rate', 'fluid flow'], to_anchor: 957.506 / 60, }, 'gal/hr': { name: 'unit.gallons-per-hour', - tags: ['volume flow', 'fuel consumption', 'gallons per hour', 'gal/hr'], + tags: ['fuel consumption'], to_anchor: 128 / 3600, }, 'GPM': { name: 'unit.gallons-per-minute', - tags: ['volume flow', 'airflow', 'ventilation', 'HVAC', 'gas flow rate', 'gallons per minute', 'GPM'], + tags: ['airflow', 'ventilation', 'HVAC', 'gas flow rate'], to_anchor: 128 / 60, }, }, }; -const measure: TbMeasure = { +const measure: TbMeasure = { METRIC, IMPERIAL, }; diff --git a/ui-ngx/src/app/shared/models/units/volume.ts b/ui-ngx/src/app/shared/models/units/volume.ts index 92e1a2dfa7..42b78ad8f2 100644 --- a/ui-ngx/src/app/shared/models/units/volume.ts +++ b/ui-ngx/src/app/shared/models/units/volume.ts @@ -48,42 +48,42 @@ const METRIC: TbMeasureUnits = { units: { 'mm³': { name: 'unit.cubic-millimeter', - tags: ['volume', 'capacity', 'extent', 'cubic millimeter', 'mm³'], + tags: ['capacity', 'extent'], to_anchor: 1 / 1000000, }, 'cm³': { name: 'unit.cubic-centimeter', - tags: ['volume', 'capacity', 'extent', 'cubic centimeter', 'cubic centimeters', 'cm³'], + tags: ['capacity', 'extent'], to_anchor: 1 / 1000, }, µL: { name: 'unit.microliter', - tags: ['volume', 'liquid measurement', 'microliter', 'µL'], + tags: ['liquid measurement'], to_anchor: 0.000001, }, mL: { name: 'unit.milliliter', - tags: ['volume', 'capacity', 'extent', 'milliliter', 'milliliters', 'mL'], + tags: ['capacity', 'extent'], to_anchor: 1 / 1000, }, L: { name: 'unit.liter', - tags: ['volume', 'capacity', 'extent', 'liter', 'liters', 'l'], + tags: ['capacity', 'extent'], to_anchor: 1, }, hL: { name: 'unit.hectoliter', - tags: ['volume', 'capacity', 'extent', 'hectoliter', 'hectoliters', 'hl'], + tags: ['capacity', 'extent'], to_anchor: 100, }, 'm³': { name: 'unit.cubic-meter', - tags: ['volume', 'capacity', 'extent', 'cubic meter', 'cubic meters', 'm³'], + tags: ['capacity', 'extent'], to_anchor: 1000, }, 'km³': { name: 'unit.cubic-kilometer', - tags: ['volume', 'capacity', 'extent', 'cubic kilometer', 'cubic kilometers', 'km³'], + tags: ['capacity', 'extent'], to_anchor: 1000000000000, }, }, @@ -94,67 +94,67 @@ const IMPERIAL: TbMeasureUnits = { units: { tsp: { name: 'unit.teaspoon', - tags: ['volume', 'cooking measurement', 'tsp'], + tags: ['cooking measurement'], to_anchor: 1 / 6, }, tbsp: { name: 'unit.tablespoon', - tags: ['volume', 'cooking measurement', 'tbsp'], + tags: ['cooking measurement'], to_anchor: 1 / 2, }, 'in³': { name: 'unit.cubic-inch', - tags: ['volume', 'capacity', 'extent', 'cubic inch', 'cubic inches', 'in³'], + tags: ['capacity', 'extent'], to_anchor: 0.55411, }, 'fl-oz': { name: 'unit.fluid-ounce', - tags: ['volume', 'capacity', 'extent', 'fluid ounce', 'fluid ounces', 'fl-oz'], + tags: ['capacity', 'extent'], to_anchor: 1, }, cup: { name: 'unit.cup', - tags: ['volume', 'cooking measurement', 'cup'], + tags: ['cooking measurement'], to_anchor: 8, }, pt: { name: 'unit.pint', - tags: ['volume', 'capacity', 'extent', 'pint', 'pints', 'pt'], + tags: ['capacity', 'extent'], to_anchor: 16, }, qt: { name: 'unit.quart', - tags: ['volume', 'capacity', 'extent', 'quart', 'quarts', 'qt'], + tags: ['capacity', 'extent'], to_anchor: 32, }, gal: { name: 'unit.gallon', - tags: ['volume', 'capacity', 'extent', 'gallon', 'gallons', 'gal'], + tags: ['capacity', 'extent'], to_anchor: 128, }, 'ft³': { name: 'unit.cubic-foot', - tags: ['volume', 'capacity', 'extent', 'cubic foot', 'cubic feet', 'ft³'], + tags: ['capacity', 'extent'], to_anchor: 957.506, }, 'yd³': { name: 'unit.cubic-yard', - tags: ['volume', 'capacity', 'extent', 'cubic yard', 'cubic yards', 'yd³'], + tags: ['capacity', 'extent'], to_anchor: 25852.7, }, bbl: { name: 'unit.oil-barrels', - tags: ['volume', 'capacity', 'extent', 'oil barrel', 'oil barrels', 'bbl'], + tags: ['capacity', 'extent'], to_anchor: 5376, }, gi: { name: 'unit.gill', - tags: ['volume', 'liquid measurement', 'gi'], + tags: ['liquid measurement'], to_anchor: 4, }, hhd: { name: 'unit.hogshead', - tags: ['volume', 'liquid measurement', 'hhd'], + tags: ['liquid measurement'], to_anchor: 8064, }, }, diff --git a/ui-ngx/src/app/shared/models/units/wavenumber.ts b/ui-ngx/src/app/shared/models/units/wavenumber.ts deleted file mode 100644 index 6745601328..0000000000 --- a/ui-ngx/src/app/shared/models/units/wavenumber.ts +++ /dev/null @@ -1,21 +0,0 @@ -import { TbMeasure, TbMeasureUnits } from '@shared/models/unit.models'; - -export type WavenumberMetricUnits = 'm⁻¹'; - -export type WavenumberUnits = WavenumberMetricUnits; - -const METRIC: TbMeasureUnits = { - units: { - 'm⁻¹': { - name: 'unit.reciprocal-metre', - tags: ['wavenumber', 'wave density', 'wave frequency', 'm⁻¹'], - to_anchor: 1, - }, - }, -}; - -const measure: TbMeasure = { - METRIC, -}; - -export default measure; diff --git a/ui-ngx/src/assets/locale/locale.constant-en_US.json b/ui-ngx/src/assets/locale/locale.constant-en_US.json index c6e2d31cbc..3798e96a9b 100644 --- a/ui-ngx/src/assets/locale/locale.constant-en_US.json +++ b/ui-ngx/src/assets/locale/locale.constant-en_US.json @@ -5865,30 +5865,37 @@ "HYBRID": "Hybrid" }, "measures": { + "absorbed-dose-rate": "Absorbed dose rate", "acceleration": "Acceleration", + "acidity": "Acidity", "air-quality-index": "Air quality index", "amount-of-substance": "Amount of substance", "angle": "Angle", "angular-acceleration": "Angular acceleration", "area": "Area", + "area-density": "Area density", "capacitance": "Capacitance", "catalytic-activity": "Catalytic activity", - "catalytic-concetration": "Catalytic concetration", + "catalytic-concentration": "Catalytic concentration", "charge": "Charge", "current-density": "Current density", "data-transfer-rate": "Data transfer rate", + "density": "Density", "digital": "Digital", "dimension-ratio": "Dimension ratio", "dynamic-viscosity": "Dynamic viscosity", "earthquake-magnitude": "Earthquake magnitude", + "electric-charge-density": "Electric charge density", "electric-current": "Electric current", "electric-dipole-moment": "Electric dipole moment", "electric-field-strength": "Electric field strength", "electric-flux": "Electric flux", "electric-permittivity": "Electric permittivity", + "electric-polarizability": "Electric polarizability", "electrical-conductance": "Electrical conductance", "electrical-conductivity": "Electrical conductivity", "energy": "Energy", + "energy-density": "Energy density", "force": "Force", "frequency": "Frequency", "fuel-efficiency": "fuel efficiency", @@ -5898,6 +5905,7 @@ "kinematic-viscosity": "Kinematic viscosity", "length": "Length", "light-exposure": "Light exposure", + "linear-charge-density": "Linear charge density", "logarithmic-ratio": "Logarithmic ratio", "luminous-efficacy": "Luminous efficacy", "luminous-flux": "Luminous flux", @@ -5909,13 +5917,41 @@ "magnetic-permeability": "Magnetic permeability", "mass": "Mass", "mass-fraction": "Mass fraction", - "molar-concetration": "Molar concetration", + "molar-concentration": "Molar concentration", "molar-energy": "Molar energy", "molar-heat-capacity": "Molar heat capacity", "molar-mass": "Molar mass", + "number-concentration": "Number concentration", + "parts-per-million": "Parts per million", + "power": "Power", + "power-density": "Power density", + "pressure": "Pressure", + "radiance": "Radiance", + "radiant-intensity": "Radiant intensity", + "radiation-dose": "Radiation dose", + "radioactive-decay": "Radioactive decay", + "radioactivity": "Radioactivity", + "radioactivity-concentration": "Radioactivity concentration", + "reciprocal-length": "Reciprocal length", + "resistance": "Resistance", + "reynolds-number": "Reynolds number", + "signal-level": "Signal level", + "solid-angle": "Solid angle", + "specific-energy": "Specific energy", + "specific-heat-capacity": "Specific heat capacity", "specific-humidity": "Specific humidity", + "specific-volume": "Specific volume", + "speed": "Speed", + "surface-charge-density": "Surface charge density", + "surface-tension": "Surface tension", "temperature": "Temperature", - "time": "Time" + "thermal-conductivity": "Thermal conductivity", + "time": "Time", + "torque": "Torque", + "turbidity": "Turbidity", + "voltage": "Voltage", + "volume": "Volume", + "volume-flow": "Volume flow" }, "millimeter": "Millimeter", "centimeter": "Centimeter", @@ -6098,6 +6134,7 @@ "ampere-hours": "Ampere-hours", "kiloampere-hours": "Kiloampere-hours", "nanoampere": "Nanoampere", + "picoampere": "Picoampere", "microampere": "Microampere", "milliampere": "Milliampere", "ampere": "Ampere",