1- import {
2- BooleanMeasurement ,
3- Measurements ,
4- NumericMeasurement ,
5- useMeasurementsStore
6- } from ".." ;
71
8- export type BmslMeasurements = {
9- av_current : NumericMeasurement ;
10-
11- low_cell1 : NumericMeasurement ;
12- low_cell2 : NumericMeasurement ;
13- low_cell3 : NumericMeasurement ;
14- low_cell4 : NumericMeasurement ;
15- low_cell5 : NumericMeasurement ;
16- low_cell6 : NumericMeasurement ;
17-
18- low_SOC1 : NumericMeasurement ;
19- low_is_balancing1 : NumericMeasurement ;
20- low_maximum_cell : NumericMeasurement ;
21- low_minimum_cell : NumericMeasurement ;
22- low_battery_temperature_1 : NumericMeasurement ;
23- low_battery_temperature_2 : NumericMeasurement ;
24-
25- total_voltage_low : NumericMeasurement ;
26-
27- input_charging_current : NumericMeasurement ;
28- output_charging_current : NumericMeasurement ;
29- input_charging_voltage : NumericMeasurement ;
30- output_charging_voltage : NumericMeasurement ;
31- pwm_frequency : NumericMeasurement ;
32-
33- conditions_ready : BooleanMeasurement ;
34- conditions_want_to_charge : BooleanMeasurement ;
35- conditions_charging : BooleanMeasurement ;
36- conditions_fault : BooleanMeasurement ;
37- } ;
38-
39- export function selectBmslMeasurements (
40- measurements : Measurements
41- ) : BmslMeasurements {
42-
43- const getMeasurementFallback = useMeasurementsStore ( state => state . getMeasurementFallback ) ;
44-
45- return {
46- av_current : getMeasurementFallback ( "BMSL/av_current" ) ,
47-
48- low_cell1 : getMeasurementFallback ( "BMSL/low_cell1" ) ,
49- low_cell2 : getMeasurementFallback ( "BMSL/low_cell2" ) ,
50- low_cell3 : getMeasurementFallback ( "BMSL/low_cell3" ) ,
51- low_cell4 : getMeasurementFallback ( "BMSL/low_cell4" ) ,
52- low_cell5 : getMeasurementFallback ( "BMSL/low_cell5" ) ,
53- low_cell6 : getMeasurementFallback ( "BMSL/low_cell6" ) ,
54-
55- low_SOC1 : getMeasurementFallback ( "BMSL/low_SOC1" ) ,
56- low_is_balancing1 : getMeasurementFallback ( "BMSL/low_is_balancing1" ) ,
57- low_maximum_cell : getMeasurementFallback (
58- "BMSL/low_maximum_cell"
59- ) ,
60- low_minimum_cell : getMeasurementFallback (
61- "BMSL/low_minimum_cell"
62- ) ,
63- low_battery_temperature_1 : getMeasurementFallback (
64- "BMSL/low_battery_temperature_1"
65- ) ,
66- low_battery_temperature_2 : getMeasurementFallback (
67- "BMSL/low_battery_temperature_2"
68- ) ,
69- total_voltage_low : getMeasurementFallback (
70- "BMSL/total_voltage_low"
71- ) ,
72- input_charging_current : getMeasurementFallback (
73- "BMSL/input_charging_current"
74- ) ,
75- output_charging_current : getMeasurementFallback (
76- "BMSL/output_charging_current"
77- ) ,
78- input_charging_voltage : getMeasurementFallback (
79- "BMSL/output_charging_current"
80- ) ,
81-
82- output_charging_voltage : getMeasurementFallback (
83- "BMSL/output_charging_voltage"
84- ) ,
85-
86- pwm_frequency : getMeasurementFallback (
87- "BMSL/pwm_frequency"
88- ) ,
89-
90- conditions_ready : getMeasurementFallback (
91- "BMSL/conditions_ready"
92- ) ,
93- conditions_want_to_charge : getMeasurementFallback (
94- "BMSL/conditions_want_to_charge"
95- ) ,
96- conditions_charging : getMeasurementFallback (
97- "BMSL/conditions_charging"
98- ) ,
99- conditions_fault : getMeasurementFallback (
100- "BMSL/conditions_fault"
101- ) ,
102- } as BmslMeasurements ;
103- }
2+ export enum BmslMeasurements {
3+ avCurrent = "BMSL/AV_current" ,
4+ lowCell1 = "BMSL/low_cell1" ,
5+ lowCell2 = "BMSL/low_cell2" ,
6+ lowCell3 = "BMSL/low_cell3" ,
7+ lowCell4 = "BMSL/low_cell4" ,
8+ lowCell5 = "BMSL/low_cell5" ,
9+ lowCell6 = "BMSL/low_cell6" ,
10+ lowSOC1 = "BMSL/low_SOC1" ,
11+ lowIsBalancing1 = "BMSL/low_is_balancing1" ,
12+ lowMaximumCell = "BMSL/low_maximum_cell" ,
13+ lowMinimumCell = "BMSL/low_minimum_cell" ,
14+ lowBatteryTemperature1 = "BMSL/low_battery_temperature_1" ,
15+ lowBatteryTemperature2 = "BMSL/low_battery_temperature_2" ,
16+ totalVoltageLow = "BMSL/total_voltage_low" ,
17+ inputChargingCurrent = "BMSL/input_charging_current" ,
18+ outputChargingCurrent = "BMSL/output_charging_current" ,
19+ inputChargingVoltage = "BMSL/input_charging_voltage" ,
20+ outputChargingVoltage = "BMSL/output_charging_voltage" ,
21+ pwmFrequency = "BMSL/pwm_frequency" ,
22+ conditionsReady = "BMSL/conditions_ready" ,
23+ conditionsWantToCharge = "BMSL/conditions_want_to_charge" ,
24+ conditionsCharging = "BMSL/conditions_charging" ,
25+ conditionsFault = "BMSL/conditions_fault"
26+ }
0 commit comments