refactor: replace deprecated getPressureUnit and getTemperatureUnit functions with user model methods
Updated the GateDeviceInteraction and MeasurementDescriber components to utilize user.pressureUnit() instead of the deprecated getPressureUnit() function. Added deprecation comments in units.ts for clarity on the transition to User.tempUnit() and User.pressureUnit().
This commit is contained in:
parent
ccabbbbd17
commit
a2944d7a60
3 changed files with 10 additions and 9 deletions
|
|
@ -19,7 +19,7 @@ import { pond } from "protobuf-ts/pond";
|
|||
import { quack } from "protobuf-ts/quack";
|
||||
import { getTextSecondary } from "theme/text";
|
||||
// import { getTextSecondary } from "theme";
|
||||
import { getDistanceUnit, getPressureUnit, roundTo } from "utils";
|
||||
import { getDistanceUnit, roundTo } from "utils";
|
||||
import { extract } from "utils/types";
|
||||
|
||||
interface Enumeration {
|
||||
|
|
@ -235,7 +235,8 @@ export class MeasurementDescriber {
|
|||
}
|
||||
break;
|
||||
case quack.MeasurementType.MEASUREMENT_TYPE_PRESSURE:
|
||||
let pressureUnit = getPressureUnit();
|
||||
let pressureUnit =
|
||||
user?.pressureUnit() ?? pond.PressureUnit.PRESSURE_UNIT_INCHES_OF_WATER;
|
||||
let isIWG = pressureUnit === pond.PressureUnit.PRESSURE_UNIT_INCHES_OF_WATER;
|
||||
this.details.label = "Pressure";
|
||||
this.details.unit = isIWG ? "iwg" : "kPa";
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue