| | |
| | | import com.facebook.imagepipeline.cache.BitmapMemoryCacheTrimStrategy; |
| | | import com.hdl.linkpm.sdk.core.exception.HDLException; |
| | | import com.hdl.photovoltaic.config.UserConfigManage; |
| | | import com.hdl.photovoltaic.enums.Languages; |
| | | import com.hdl.photovoltaic.internet.HttpClient; |
| | | import com.hdl.photovoltaic.listener.CloudCallBeak; |
| | | |
| | |
| | | * @param isDelPath 是否删除(true表示删除,否则不删除) |
| | | */ |
| | | public void getHdlESLocalJson(String fileName, String deviceType, String deviceModel, boolean isDelPath, CloudCallBeak<String> callBeak) { |
| | | // 2025年12月08日09:29:31 产品经理说:因脚本还没有适配阿拉伯语言,先默认英文 |
| | | String language = UserConfigManage.getInstance().getCurrentAppLanguage(); |
| | | if (!UserConfigManage.getInstance().getCurrentAppLanguage().equals(Languages.zh)) { |
| | | language = Languages.en; |
| | | } |
| | | //拼接地址 |
| | | String url = getStrJointNewUrl(fileName, deviceType, deviceModel); |
| | | String url = getStrJointNewUrl(fileName, deviceType, deviceModel, language); |
| | | HttpClient.getInstance().requestJsonHttpGet(url, new CloudCallBeak<String>() { |
| | | @Override |
| | | public void onSuccess(String json) { |
| | |
| | | * @param fileName json文件名称 |
| | | * @param deviceType 设备类型(inv,lc,bms,battery) |
| | | * @param deviceModel 设备型号 |
| | | * @param language 语言 (例如:Languages.zh) |
| | | * @return 新地址 |
| | | */ |
| | | private String getStrJointNewUrl(String fileName, String deviceType, String deviceModel) { |
| | | private String getStrJointNewUrl(String fileName, String deviceType, String deviceModel, String language) { |
| | | String joinFileName = fileName + concatenation_symbol + deviceType + concatenation_symbol + deviceModel; |
| | | if (joinFileName.equals(FileName.hdl_inv_ecu_info_pv + concatenation_symbol + DeviceType.INV + concatenation_symbol + DeviceModel.INV) |
| | | || joinFileName.equals(FileName.hdl_inv_ecu_info_output + concatenation_symbol + DeviceType.INV + concatenation_symbol + DeviceModel.INV) |
| | |
| | | || joinFileName.equals(FileName.hdl_inv_ecu_info_signal + concatenation_symbol + DeviceType.INV + concatenation_symbol + DeviceModel.OFF_INV_8) |
| | | || joinFileName.equals(FileName.hdl_inv_ecu_info_input_off + concatenation_symbol + DeviceType.INV + concatenation_symbol + DeviceModel.OFF_INV_8) |
| | | ) { |
| | | return address + "/" + UserConfigManage.getInstance().getCurrentAppLanguage() + "/" + deviceType + "/" + deviceModel + "/info/" + fileName + this.getVersion(joinFileName) + ".json"; |
| | | return address + "/" + language + "/" + deviceType + "/" + deviceModel + "/info/" + fileName + this.getVersion(joinFileName) + ".json"; |
| | | } |
| | | return address + "/" + UserConfigManage.getInstance().getCurrentAppLanguage() + "/" + deviceType + "/" + deviceModel + "/" + fileName + this.getVersion(joinFileName) + ".json"; |
| | | return address + "/" + language + "/" + deviceType + "/" + deviceModel + "/" + fileName + this.getVersion(joinFileName) + ".json"; |
| | | } |
| | | //region ---------改一动五(注意:如果是增加设备型号【要到HdlFileLogic.createHdlESLocalJsonDirectory()方法里面创建文件夹】)----------- |
| | | |