From 8e8ea8be5c20c37a5619691701aa5f3bf814b941 Mon Sep 17 00:00:00 2001
From: wjc <1243177876@qq.com>
Date: 星期五, 23 五月 2025 14:17:26 +0800
Subject: [PATCH] 2025年05月23日14:17:24

---
 app/src/main/java/com/hdl/photovoltaic/other/HdlFileLogic.java |   76 ++++++++++++++++++++++++++++++++++++++
 1 files changed, 76 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..5093d22 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;
+    }
+
 
     /**
      * 鑾峰彇椹卞姩鍗囩骇鏂囦欢鍏ㄨ矾寰�
@@ -153,6 +194,41 @@
         this.createFileDir(this.getDriveRootPath());
         //鍥轰欢鏂囦欢
         this.createFileDir(this.getFirmwareRootPath());
+    }
+
+    /**
+     * 棰勫垱寤簀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));//绂荤綉-閫嗗彉鍣�-铏氭嫙BMS
+        this.createFileDir(this.getHdlESLocalJsonZhRootPath(HdlESLocalJsonLogic.DeviceModel.OFF_INV_BATTERY));//绂荤綉-閫嗗彉鍣�-鐢垫睜鍖�
+
+        //绂荤嚎-3.6kw閫嗗彉鍣�
+        this.createFileDir(this.getHdlESLocalJsonZhRootPath(HdlESLocalJsonLogic.DeviceModel.OFF_INV_3));//绂荤嚎-閫嗗彉鍣�
+        this.createFileDir(this.getHdlESLocalJsonZhRootPath(HdlESLocalJsonLogic.DeviceModel.OFF_INV_BMS_3));//绂荤綉-閫嗗彉鍣�-铏氭嫙BMS
+
+
+        //鑻辨枃鏂囦欢澶�
+        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));//绂荤綉-閫嗗彉鍣�-铏氭嫙BMS
+        this.createFileDir(this.getHdlESLocalJsonEnRootPath(HdlESLocalJsonLogic.DeviceModel.OFF_INV_BATTERY));//绂荤綉-閫嗗彉鍣�-鐢垫睜鍖�
+
+        //绂荤嚎-3.6kw閫嗗彉鍣�
+        this.createFileDir(this.getHdlESLocalJsonEnRootPath(HdlESLocalJsonLogic.DeviceModel.OFF_INV_3));//绂荤嚎-閫嗗彉鍣�
+        this.createFileDir(this.getHdlESLocalJsonEnRootPath(HdlESLocalJsonLogic.DeviceModel.OFF_INV_BMS_3));//绂荤綉-閫嗗彉鍣�-铏氭嫙BMS
 
     }
 

--
Gitblit v1.8.0