FuelCellData.java
3.98 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
package com.bsth.entity;
import com.bsth.socket.protocol.Message0203;
public class FuelCellData extends Data{
/**
* 信息类型
* 默认应该为0x03
*/
private byte infoType;
/**
* 电池电压 0-20000
* 分辨率0.1v
* 0xff 0xfe 异常
* 0xff 0xff 无效
*/
private short voltage;
/**
* 电池电流 0-20000
* 分辨率0.1v
* 0xff 0xfe 异常
* 0xff 0xff 无效
*/
private short current;
/**
* 燃料消耗率 0-60000
* 分辨率0.01kg/100km
* 0xff 0xfe 异常
* 0xff 0xff 无效
*/
private short fuelConsumeRate;
/**
* 电池温度探针数量 0-65531
* n
* 0xff 0xfe 异常
* 0xff 0xff 无效
*/
private short tempProbeQuantity;
/**
* 累计里程 0-240
* 分辨率1℃ 偏移量-40 n*1
* 0xff 0xff 0xff 0xfe 异常
* 0xff 0xff 0xff 0xff 无效
*/
private byte[] temps;
/**
* 氢系统中最高温度值 0-2400
* 分辨率0.1℃ 偏移量-400
* 0xff 0xfe 异常
* 0xff 0xff 无效
*/
private short hydrogenMaxTemp;
/**
* 氢系统最高温度探针代号 1-252
* 0xfe 异常
* 0xff 无效
*/
private byte maxTempSensorCode;
/**
* 氢气最大浓度 0-60000
* 分辨率1mg/kg
* 0xFF 0xFE 异常
* 0xFF 0xFF 无效
*/
private short hydrogenMaxConcentration;
/**
* 氢气最大浓度传感器代号 1-252
* 0xfe 异常
* 0xff 无效
*/
private byte maxConcentrationSensorCode;
/**
* 氢气最高压力 0-1000
* 分辨率0.1MPa
* 0xFF 0xFE 异常
* 0xFF 0xFF 无效
*/
private short hydrogenMaxPressure;
/**
* 氢气最大浓度传感器代号 1-252
* 0xfe 异常
* 0xff 无效
*/
private byte maxPressureSensorCode;
/**
* dc-dc状态
* 0x01 工作
* 0x02 断开
* 0xFE 异常
* 0xFF 无效
*/
private byte dcState;
public FuelCellData(Message0203 message0203){
this.infoType = message0203.getInfoType();
this.voltage = message0203.getVoltage();
this.current = message0203.getCurrent();
this.fuelConsumeRate = message0203.getFuelConsumeRate();
this.tempProbeQuantity = message0203.getTempProbeQuantity();
this.temps = message0203.getTemps();
this.hydrogenMaxTemp = message0203.getHydrogenMaxTemp();
this.maxTempSensorCode = message0203.getMaxTempSensorCode();
this.hydrogenMaxConcentration = message0203.getHydrogenMaxConcentration();
this.maxConcentrationSensorCode = message0203.getMaxConcentrationSensorCode();
this.hydrogenMaxPressure = message0203.getHydrogenMaxPressure();
this.maxPressureSensorCode = message0203.getMaxPressureSensorCode();
this.dcState = message0203.getDcState();
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append(" 信息类型: ").append(String.format("%02x", infoType))
.append(" 电池电压: ").append(voltage)
.append(" 电池电流: ").append(current)
.append(" 燃料消耗率: ").append(fuelConsumeRate)
.append(" 电池温度探针数量: ").append(tempProbeQuantity)
.append(" 氢系统最高温度值: ").append(hydrogenMaxTemp)
.append(" 氢系统最高温度探针代号: ").append(maxTempSensorCode)
.append(" 氢气最大浓度: ").append(hydrogenMaxConcentration)
.append(" 氢气最大浓度传感器代号: ").append(maxConcentrationSensorCode)
.append(" 氢气最高压力: ").append(hydrogenMaxPressure)
.append(" 氢气最高压力传感器代号: ").append(maxPressureSensorCode)
.append(" dc-dc状态: ").append(dcState);
return sb.toString();
}
@Override
public String getType() {
return "FuelCell_data";
}
}