| | |
| | | || joinFileName.equals(FileName.hdl_inv_ecu_info_output + concatenation_symbol + DeviceType.INV + concatenation_symbol + DeviceModel.OFF_INV) |
| | | || joinFileName.equals(FileName.hdl_inv_ecu_info_item + concatenation_symbol + DeviceType.INV + concatenation_symbol + DeviceModel.OFF_INV) |
| | | || joinFileName.equals(FileName.hdl_inv_ecu_info_signal + concatenation_symbol + DeviceType.INV + concatenation_symbol + DeviceModel.OFF_INV) |
| | | || joinFileName.equals(FileName.hdl_inv_ecu_info_input_off + concatenation_symbol + DeviceType.INV + concatenation_symbol + DeviceModel.OFF_INV) |
| | | ) { |
| | | return address + "/" + UserConfigManage.getInstance().getCurrentAppLanguage() + "/" + deviceType + "/" + deviceModel + "/info/" + fileName + this.getVersion(joinFileName) + ".json"; |
| | | } |
| | |
| | | Map<String, String> map = new HashMap<>(); |
| | | //拼接规则:文件名_设备类型_设备信号 |
| | | 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_lc_ecu_quick + concatenation_symbol + DeviceType.LC + concatenation_symbol + DeviceModel.LC, 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_1);//逆变器参数配置//更新到v_1_5_2,目前硬件不支持 |
| | | map.put(FileName.hdl_inv_ecu + concatenation_symbol + DeviceType.INV + concatenation_symbol + DeviceModel.INV, Version.v_1_5_3);//逆变器参数配置//更新到v_1_5_3,目前硬件不支持 |
| | | 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);//逆变器详情-输出 |
| | | map.put(FileName.hdl_inv_ecu_info_item + concatenation_symbol + DeviceType.INV + concatenation_symbol + DeviceModel.INV, Version.v_1_5_1);//逆变器详情-item项//更新到v_1_5_2,目前硬件不支持¬ |
| | | map.put(FileName.hdl_inv_ecu_info_item + concatenation_symbol + DeviceType.INV + concatenation_symbol + DeviceModel.INV, Version.v_1_5_2);//逆变器详情-item项//更新到v_1_5_2,目前硬件不支持¬ |
| | | map.put(FileName.hdl_inv_ecu_info_signal + concatenation_symbol + DeviceType.INV + concatenation_symbol + DeviceModel.INV, Version.v_1_4_1);//逆变器详情-信号点 |
| | | map.put(FileName.hdl_bms_ecu + concatenation_symbol + DeviceType.BMS + concatenation_symbol + DeviceModel.INV_BMS, Version.v_1_4_2);//获取BMS信息 |
| | | map.put(FileName.hdl_battery_ecu + concatenation_symbol + DeviceType.BATTERY + concatenation_symbol + DeviceModel.INV_BATTERY, Version.v_1_4_2);//电池包信息 |
| | | map.put(FileName.hdl_battery_ecu_cell + concatenation_symbol + DeviceType.BATTERY + concatenation_symbol + DeviceModel.INV_BATTERY, Version.v_1_4_2);//电池包-电芯信息 |
| | | //离网逆变器 |
| | | map.put(FileName.hdl_inv_ecu_quick_off + concatenation_symbol + DeviceType.INV + concatenation_symbol + DeviceModel.OFF_INV, Version.v_1_5_2);//离网逆变器快速配置 |
| | | map.put(FileName.hdl_inv_master_ecu_off + concatenation_symbol + DeviceType.INV + concatenation_symbol + DeviceModel.OFF_INV, Version.v_1_5_2);//离网逆变器快速配置 |
| | | map.put(FileName.hdl_inv_master_ecu_off + concatenation_symbol + DeviceType.INV + concatenation_symbol + DeviceModel.OFF_INV, Version.v_1_5_3);//离网逆变器快速配置 |
| | | map.put(FileName.hdl_inv_slave_ecu_off + concatenation_symbol + DeviceType.INV + concatenation_symbol + DeviceModel.OFF_INV, Version.v_1_5_2);//离网逆变器快速配置 |
| | | map.put(FileName.hdl_inv_ecu_info_pv_off + concatenation_symbol + DeviceType.INV + concatenation_symbol + DeviceModel.OFF_INV, Version.v_1_5_2);//离网逆变器快速配置 |
| | | map.put(FileName.hdl_inv_ecu_info_input_off + concatenation_symbol + DeviceType.INV + concatenation_symbol + DeviceModel.OFF_INV, Version.v_1_5_2);//离网逆变器快速配置 |
| | |
| | | map.put(FileName.hdl_inv_ecu_info_item_off + concatenation_symbol + DeviceType.INV + concatenation_symbol + DeviceModel.OFF_INV, Version.v_1_5_2);//离网逆变器快速配置 |
| | | map.put(FileName.hdl_inv_ecu_info_signal_off + concatenation_symbol + DeviceType.INV + concatenation_symbol + DeviceModel.OFF_INV, Version.v_1_5_2);//离网逆变器快速配置 |
| | | map.put(FileName.hdl_bms_ecu_off + concatenation_symbol + DeviceType.BMS + concatenation_symbol + DeviceModel.OFF_INV_BMS, Version.v_1_5_2);//离网逆变器快速配置 |
| | | map.put(FileName.hdl_bms_ecu_off + concatenation_symbol + DeviceType.BATTERY + concatenation_symbol + DeviceModel.OFF_INV_BATTERY, Version.v_1_5_2);//离网逆变器快速配置 |
| | | map.put(FileName.hdl_battery_ecu_off + concatenation_symbol + DeviceType.BATTERY + concatenation_symbol + DeviceModel.OFF_INV_BATTERY, Version.v_1_5_2);//离网逆变器快速配置 |
| | | map.put(FileName.hdl_battery_ecu_cell_off + concatenation_symbol + DeviceType.BATTERY + concatenation_symbol + DeviceModel.OFF_INV_BATTERY, Version.v_1_5_2);//离网逆变器快速配置 |
| | | return map; |
| | | } |
| | |
| | | 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) { |
| | | } |
| | |
| | | * Json数据配置文件名 |
| | | */ |
| | | public @interface FileName { |
| | | |
| | | /** |
| | | * 创建电站-逆变器参数配置 |
| | | */ |
| | | String hdl_inv_ecu_quick = "modbus_hdl_inv_ecu_quick_v"; |
| | | /** |
| | | * 创建电站-负载控制中心参数配置 |
| | | */ |
| | | String hdl_lc_ecu_quick = "modbus_hdl_lc_ecu_quick_v"; |
| | | |
| | | /** |
| | | * 逆变器参数配置(config) |
| | | */ |
| | |
| | | * 逆变器详情-item项 |
| | | */ |
| | | String hdl_inv_ecu_info_item = "modbus_hdl_inv_ecu_info_item_v"; |
| | | /** |
| | | * 创建电站-负载控制中心参数配置 |
| | | */ |
| | | String hdl_lc_ecu_quick = "modbus_hdl_lc_ecu_quick_v"; |
| | | /** |
| | | * 获取负载控制中心 |
| | | */ |
| | |
| | | String v_1_5_0 = "1.5.0"; |
| | | String v_1_5_1 = "1.5.1"; |
| | | String v_1_5_2 = "1.5.2"; |
| | | String v_1_5_3 = "1.5.3"; |
| | | |
| | | } |
| | | |