mac
2024-11-06 5d46ab965bb9bb827e9585400ef006bbc3a7814b
app/src/main/java/com/hdl/photovoltaic/other/HdlFileLogic.java
@@ -8,7 +8,9 @@
import android.text.TextUtils;
import com.hdl.photovoltaic.HDLApp;
import com.hdl.photovoltaic.config.ConstantManage;
import com.hdl.photovoltaic.config.UserConfigManage;
import com.hdl.photovoltaic.utils.LocalManageUtil;
import org.apache.commons.io.FileUtils;
@@ -99,6 +101,19 @@
        return getAPPInternalStoreFilesPath() + "/upgrade/firmware";
    }
    /**
     * 获取中文【json资源文件夹】全路径
     */
    public String getHdlESLocalJsonZhRootPath(String deviceModel) {
        return getAPPInternalStoreFilesPath() + "/hdlESLocalJson/" + LocalManageUtil.zh + "/" + deviceModel;
    }
    /**
     * 获取英文【json资源文件夹】全路径
     */
    public String getHdlESLocalJsonEnRootPath(String deviceModel) {
        return getAPPInternalStoreFilesPath() + "/hdlESLocalJson/" + LocalManageUtil.en + "/" + deviceModel;
    }
    /**
@@ -108,12 +123,34 @@
        return getCurrentHomeRootPath() + "/log.txt";
    }
    /**
     * 获取【用户文件】全路径
     */
    public String getUserFilePath() {
        return getAPPInternalStoreFilesPath() + "/userConfigManage.txt";
    }
    /**
     * 获取中文【json资源文件】全路径
     */
    public String getHdlESLocalJsonZhFilePath(String deviceModel, String fileName) {
        if (!fileName.endsWith(".json")) {
            fileName += ".json";
        }
        return getAPPInternalStoreFilesPath() + "/hdlESLocalJson/" + LocalManageUtil.zh + "/" + deviceModel + "/" + fileName;
    }
    /**
     * 获取英文【json资源文件】全路径
     */
    public String getHdlESLocalJsonEnFilePath(String deviceModel, String fileName) {
        if (!fileName.endsWith(".json")) {
            fileName += ".json";
        }
        return getAPPInternalStoreFilesPath() + "/hdlESLocalJson/" + LocalManageUtil.en + "/" + deviceModel + "/" + fileName;
    }
    /**
     * 获取驱动升级文件全路径
@@ -157,6 +194,23 @@
    }
    /**
     * 预创建json资源文件夹
     */
    public void createHdlESLocalJsonDirectory() {
        //中文文件夹
        this.createFileDir(this.getHdlESLocalJsonZhRootPath(HdlESLocalJsonLogic.deviceModel_ME_GSE_S5K));//逆变器
        this.createFileDir(this.getHdlESLocalJsonZhRootPath(HdlESLocalJsonLogic.deviceModel_ME_GSE_SPG63A));//负载中心
        this.createFileDir(this.getHdlESLocalJsonZhRootPath(HdlESLocalJsonLogic.deviceModel_ME_GSE_BMS15K));//BMS
        this.createFileDir(this.getHdlESLocalJsonZhRootPath(HdlESLocalJsonLogic.deviceModel_ME_GSE_B5K));//电池包
        //英文文件夹
        this.createFileDir(this.getHdlESLocalJsonEnRootPath(HdlESLocalJsonLogic.deviceModel_ME_GSE_S5K));
        this.createFileDir(this.getHdlESLocalJsonEnRootPath(HdlESLocalJsonLogic.deviceModel_ME_GSE_SPG63A));
        this.createFileDir(this.getHdlESLocalJsonEnRootPath(HdlESLocalJsonLogic.deviceModel_ME_GSE_BMS15K));
        this.createFileDir(this.getHdlESLocalJsonEnRootPath(HdlESLocalJsonLogic.deviceModel_ME_GSE_B5K));
    }
    /**
     * 创建文件夹
     *
     * @param fullPath fullPath 全路径