| | |
| | | //拼接规则:文件名_设备类型_设备信号 |
| | | map.put(FileName.hdl_lc_ecu_info_item + concatenation_symbol + DeviceType.LC + concatenation_symbol + DeviceModel.LC, Version.v_1_5_0);//获取负载控制中心 |
| | | map.put(FileName.hdl_lc_ecu_quick + concatenation_symbol + DeviceType.LC + concatenation_symbol + DeviceModel.LC, Version.v_1_5_0);//创建电站-负载控制中心参数配置 |
| | | map.put(FileName.hdl_inv_ecu_quick + concatenation_symbol + DeviceType.INV + concatenation_symbol + DeviceModel.INV, Version.v_1_5_2);//创建电站-逆变器参数配置 |
| | | map.put(FileName.hdl_inv_ecu_quick + concatenation_symbol + DeviceType.INV + concatenation_symbol + DeviceModel.INV, Version.v_1_5_1);//创建电站-逆变器参数配置 |
| | | map.put(FileName.hdl_inv_ecu + concatenation_symbol + DeviceType.INV + concatenation_symbol + DeviceModel.INV, Version.v_1_5_2);//逆变器参数配置//更新到v_1_5_2,目前硬件不支持 |
| | | map.put(FileName.hdl_inv_ecu_info_pv + concatenation_symbol + DeviceType.INV + concatenation_symbol + DeviceModel.INV, Version.v_1_4_2);// 逆变器详情-pv |
| | | map.put(FileName.hdl_inv_ecu_info_output + concatenation_symbol + DeviceType.INV + concatenation_symbol + DeviceModel.INV, Version.v_1_4_2);//逆变器详情-输出 |
| | |
| | | String fileName = ary[0]; |
| | | String deviceType = ary[1]; |
| | | String deviceMode = ary[2]; |
| | | this.getHdlESLocalJson(fileName, deviceType, deviceMode, null); |
| | | this.getHdlESLocalJson(fileName, deviceType, deviceMode, true, null); |
| | | } |
| | | |
| | | } |
| | |
| | | * @param fileName 文件名 |
| | | * @param deviceType 设备类型 |
| | | * @param deviceModel 设备型号 |
| | | * @param isDelPath 是否删除(true表示删除,否则不删除) |
| | | */ |
| | | public void getHdlESLocalJson(String fileName, String deviceType, String deviceModel, CloudCallBeak<String> callBeak) { |
| | | public void getHdlESLocalJson(String fileName, String deviceType, String deviceModel, boolean isDelPath, CloudCallBeak<String> callBeak) { |
| | | //拼接地址 |
| | | String url = getStrJointNewUrl(fileName, deviceType, deviceModel); |
| | | HttpClient.getInstance().requestJsonHttpGet(url, new CloudCallBeak<String>() { |
| | | @Override |
| | | public void onSuccess(String json) { |
| | | saveJson(fileName, deviceModel, json); |
| | | saveJson(fileName, deviceModel, json, isDelPath); |
| | | HdlLogLogic.print("获取云端脚本---" + url + "\r\n" + json, false); |
| | | if (callBeak != null) { |
| | | callBeak.onSuccess(json); |
| | |
| | | * |
| | | * @param fileName 文件名 |
| | | * @param deviceModel 设备型号(逆变器,负载中心,bms,电池包) |
| | | * @param json 内容 |
| | | * @param json json内容 |
| | | * @param isDelPath 是否删除(true表示删除,否则不删除) |
| | | */ |
| | | private void saveJson(String fileName, String deviceModel, String json) { |
| | | private void saveJson(String fileName, String deviceModel, String json, boolean isDelPath) { |
| | | try { |
| | | if (TextUtils.isEmpty(json)) { |
| | | return; |
| | |
| | | //中文文件路径 |
| | | fullPath = HdlFileLogic.getInstance().getHdlESLocalJsonZhFilePath(deviceModel, fileName); |
| | | } |
| | | |
| | | if (isDelPath) { |
| | | HdlFileLogic.getInstance().deleteFile(fullPath); |
| | | } |
| | | HdlFileLogic.getInstance().writeFile(fullPath, json); |
| | | } catch (Exception ignored) { |
| | | } |