From 1793cca452c8d905ec64d26d2bfad6821f5e0c4c Mon Sep 17 00:00:00 2001
From: wjc <1243177876@qq.com>
Date: 星期三, 09 四月 2025 11:10:36 +0800
Subject: [PATCH] 2025年04月09日11:10:33

---
 app/src/main/java/com/hdl/photovoltaic/other/HdlFileLogic.java |   69 ++++++++++++++++++++++++++++++++++
 1 files changed, 69 insertions(+), 0 deletions(-)

diff --git a/app/src/main/java/com/hdl/photovoltaic/other/HdlFileLogic.java b/app/src/main/java/com/hdl/photovoltaic/other/HdlFileLogic.java
index 76133f3..c476bb2 100644
--- a/app/src/main/java/com/hdl/photovoltaic/other/HdlFileLogic.java
+++ b/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,23 @@
         return getAPPInternalStoreFilesPath() + "/upgrade/firmware";
     }
 
+    /**
+     * 鑾峰彇涓枃銆恓son璧勬簮鏂囦欢澶广�戝叏璺緞
+     *
+     * @param deviceModel 璁惧鍨嬪彿
+     */
+    public String getHdlESLocalJsonZhRootPath(String deviceModel) {
+        return getAPPInternalStoreFilesPath() + "/hdlESLocalJson/" + LocalManageUtil.zh + "/" + deviceModel;
+    }
+
+    /**
+     * 鑾峰彇鑻辨枃銆恓son璧勬簮鏂囦欢澶广�戝叏璺緞
+     *
+     * @param deviceModel 璁惧鍨嬪彿
+     */
+    public String getHdlESLocalJsonEnRootPath(String deviceModel) {
+        return getAPPInternalStoreFilesPath() + "/hdlESLocalJson/" + LocalManageUtil.en + "/" + deviceModel;
+    }
 
 
     /**
@@ -108,12 +127,34 @@
         return getCurrentHomeRootPath() + "/log.txt";
     }
 
+
     /**
      * 鑾峰彇銆愮敤鎴锋枃浠躲�戝叏璺緞
      */
     public String getUserFilePath() {
         return getAPPInternalStoreFilesPath() + "/userConfigManage.txt";
     }
+
+    /**
+     * 鑾峰彇涓枃銆恓son璧勬簮鏂囦欢銆戝叏璺緞
+     */
+    public String getHdlESLocalJsonZhFilePath(String deviceModel, String fileName) {
+        if (!fileName.endsWith(".json")) {
+            fileName += ".json";
+        }
+        return getAPPInternalStoreFilesPath() + "/hdlESLocalJson/" + LocalManageUtil.zh + "/" + deviceModel + "/" + fileName;
+    }
+
+    /**
+     * 鑾峰彇鑻辨枃銆恓son璧勬簮鏂囦欢銆戝叏璺緞
+     */
+    public String getHdlESLocalJsonEnFilePath(String deviceModel, String fileName) {
+        if (!fileName.endsWith(".json")) {
+            fileName += ".json";
+        }
+        return getAPPInternalStoreFilesPath() + "/hdlESLocalJson/" + LocalManageUtil.en + "/" + deviceModel + "/" + fileName;
+    }
+
 
     /**
      * 鑾峰彇椹卞姩鍗囩骇鏂囦欢鍏ㄨ矾寰�
@@ -157,6 +198,34 @@
     }
 
     /**
+     * 棰勫垱寤簀son璧勬簮鏂囦欢澶�
+     */
+    public void createHdlESLocalJsonDirectory() {
+        //涓枃鏂囦欢澶�
+
+        this.createFileDir(this.getHdlESLocalJsonZhRootPath(HdlESLocalJsonLogic.DeviceModel.INV));//閫嗗彉鍣�
+        this.createFileDir(this.getHdlESLocalJsonZhRootPath(HdlESLocalJsonLogic.DeviceModel.LC));//璐熻浇涓績
+        this.createFileDir(this.getHdlESLocalJsonZhRootPath(HdlESLocalJsonLogic.DeviceModel.INV_BMS));//BMS
+        this.createFileDir(this.getHdlESLocalJsonZhRootPath(HdlESLocalJsonLogic.DeviceModel.INV_BATTERY));//鐢垫睜鍖�
+        //绂荤嚎閫嗗彉鍣�
+        this.createFileDir(this.getHdlESLocalJsonZhRootPath(HdlESLocalJsonLogic.DeviceModel.OFF_INV));//绂荤嚎閫嗗彉鍣�
+        this.createFileDir(this.getHdlESLocalJsonZhRootPath(HdlESLocalJsonLogic.DeviceModel.OFF_INV_BMS));//绂荤綉閫嗗彉鍣ㄨ櫄鎷烞MS
+        this.createFileDir(this.getHdlESLocalJsonZhRootPath(HdlESLocalJsonLogic.DeviceModel.OFF_INV_BATTERY));//绂荤綉閫嗗彉鍣ㄧ數姹犲寘
+
+
+        //鑻辨枃鏂囦欢澶�
+        this.createFileDir(this.getHdlESLocalJsonEnRootPath(HdlESLocalJsonLogic.DeviceModel.INV));
+        this.createFileDir(this.getHdlESLocalJsonEnRootPath(HdlESLocalJsonLogic.DeviceModel.LC));
+        this.createFileDir(this.getHdlESLocalJsonEnRootPath(HdlESLocalJsonLogic.DeviceModel.INV_BMS));
+        this.createFileDir(this.getHdlESLocalJsonEnRootPath(HdlESLocalJsonLogic.DeviceModel.INV_BATTERY));
+        //绂荤嚎閫嗗彉鍣�
+        this.createFileDir(this.getHdlESLocalJsonEnRootPath(HdlESLocalJsonLogic.DeviceModel.OFF_INV));//绂荤嚎閫嗗彉鍣�
+        this.createFileDir(this.getHdlESLocalJsonEnRootPath(HdlESLocalJsonLogic.DeviceModel.OFF_INV_BMS));//绂荤綉閫嗗彉鍣ㄨ櫄鎷烞MS
+        this.createFileDir(this.getHdlESLocalJsonEnRootPath(HdlESLocalJsonLogic.DeviceModel.OFF_INV_BATTERY));//绂荤綉閫嗗彉鍣ㄧ數姹犲寘
+
+    }
+
+    /**
      * 鍒涘缓鏂囦欢澶�
      *
      * @param fullPath fullPath 鍏ㄨ矾寰�

--
Gitblit v1.8.0