1 Star 0 Fork 1

TONY/企业EMS - 能源管理系统 - 能源管理系统源码-双碳平台源码

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
wmp_bms_info_stub.java 2.17 KB
一键复制 编辑 原始数据 按行查看 历史
智电云 提交于 2024-07-31 18:42 . Add files via upload
package com.zhengbangnet.commu.wm.message;
/*
* 根据消息定义类、利用Java反射机制,由工具类MakeStubFile自动生成
* 浙江爱充网络, 2020-07-03
* */
import com.zhengbangnet.commu.wm.pack.PackException;
import com.zhengbangnet.commu.wm.pack.PackStubIF;
import com.zhengbangnet.commu.wm.pack.PackUtil;
public class wmp_bms_info_stub implements PackStubIF {
@Override
public void pack(PackUtil.Buf buf, Object o) throws PackException {
wmp_bms_info wmp_bms_info = (wmp_bms_info)o;
PackUtil.putByte(buf, wmp_bms_info.bms_type);
PackUtil.putByte(buf, wmp_bms_info.batt_soc);
PackUtil.putShort(buf, wmp_bms_info.cell_charge_volt_max.getShort());
PackUtil.putShort(buf, wmp_bms_info.charge_curr_max.getShort());
PackUtil.putShort(buf, wmp_bms_info.batt_volt_max.getShort());
PackUtil.putShort(buf, wmp_bms_info.batt_volt_now.getShort());
PackUtil.putShort(buf, wmp_bms_info.batt_capacity.getShort());
PackUtil.putShort(buf, wmp_bms_info.batt_quantity.getShort());
PackUtil.putShort(buf, wmp_bms_info.batt_temp_max.getShort());
PackUtil.putByte(buf, wmp_bms_info.battery_type.getByte());
PackUtil.putProtocolStr(buf, wmp_bms_info.vin);
}
@Override
public Object unpack(PackUtil.Buf buf) throws PackException {
wmp_bms_info wmp_bms_info = new wmp_bms_info();
wmp_bms_info.bms_type = PackUtil.getByte(buf);
wmp_bms_info.batt_soc = PackUtil.getByte(buf);
wmp_bms_info.cell_charge_volt_max.setShort(PackUtil.getShort(buf));
wmp_bms_info.charge_curr_max.setShort(PackUtil.getShort(buf));
wmp_bms_info.batt_volt_max.setShort(PackUtil.getShort(buf));
wmp_bms_info.batt_volt_now.setShort(PackUtil.getShort(buf));
wmp_bms_info.batt_capacity.setShort(PackUtil.getShort(buf));
wmp_bms_info.batt_quantity.setShort(PackUtil.getShort(buf));
wmp_bms_info.batt_temp_max.setShort(PackUtil.getShort(buf));
wmp_bms_info.battery_type.setByte(PackUtil.getByte(buf));
PackUtil.parseProtocolStr(buf, wmp_bms_info.vin);
return wmp_bms_info;
}
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Java
1
https://gitee.com/zhou_yu_feng/Source-code-of-energy-management-system05.git
git@gitee.com:zhou_yu_feng/Source-code-of-energy-management-system05.git
zhou_yu_feng
Source-code-of-energy-management-system05
企业EMS - 能源管理系统 - 能源管理系统源码-双碳平台源码
main

搜索帮助