From b63ff58e2c415bae2fb4741aebe710fa3576ff66 Mon Sep 17 00:00:00 2001
From: wjc <1243177876@qq.com>
Date: 星期一, 23 三月 2026 13:11:47 +0800
Subject: [PATCH] 2026年03月23日13:11:38 备份代码

---
 app/src/main/java/com/hdl/photovoltaic/widget/DefaultFilteringDialog.java |   88 ++++++++++++++++++++++++++++++++++++-------
 1 files changed, 73 insertions(+), 15 deletions(-)

diff --git a/app/src/main/java/com/hdl/photovoltaic/widget/DefaultFilteringDialog.java b/app/src/main/java/com/hdl/photovoltaic/widget/DefaultFilteringDialog.java
index 8090819..994b3e8 100644
--- a/app/src/main/java/com/hdl/photovoltaic/widget/DefaultFilteringDialog.java
+++ b/app/src/main/java/com/hdl/photovoltaic/widget/DefaultFilteringDialog.java
@@ -21,6 +21,7 @@
 import com.hdl.photovoltaic.databinding.DialogDefaultFilteringBinding;
 import com.hdl.photovoltaic.enums.DebugStatus;
 import com.hdl.photovoltaic.enums.GridType;
+import com.hdl.photovoltaic.enums.PowerStationType;
 import com.hdl.photovoltaic.enums.UnitType;
 import com.hdl.photovoltaic.other.HdlThreadLogic;
 
@@ -41,7 +42,11 @@
     final String text8 = "500+";
 
 
-    private String mStateValue = GridType.All;
+    private String mGridType = GridType.All;
+    /**
+     * 鐢电珯绫诲瀷(INV = 閫嗗彉鍣ㄧ數绔�;BMS = BMS鐢电珯)
+     */
+    private String mPowerStationType = PowerStationType.All;
 
     public DefaultFilteringDialog(@NonNull Context context) {
         super(context, R.style.Custom_Dialog);
@@ -81,15 +86,15 @@
                         if (Integer.parseInt(minValue) > Integer.parseInt(maxValue)) {
                             //鏈�灏忓�煎湪鍓嶉潰
                             if (mOnClickListener != null) {
-                                mOnClickListener.confirm(maxValue, minValue, mStateValue);
+                                mOnClickListener.confirm(maxValue, minValue, mGridType, mPowerStationType);
                             }
                         } else {
                             if (mOnClickListener != null) {
-                                mOnClickListener.confirm(minValue, maxValue, mStateValue);
+                                mOnClickListener.confirm(minValue, maxValue, mGridType, mPowerStationType);
                             }
                         }
                     } catch (Exception e) {
-                        //寮哄埗杞崲鍥犺緭鍏ュ�艰秴鍑篿nt鍊煎煙鑼冨洿鎶ュ嚭寮傚父
+//                        //寮哄埗杞崲鍥犺緭鍏ュ�艰秴鍑篿nt鍊煎煙鑼冨洿鎶ュ嚭寮傚父
                         int maxValueInt = Integer.MAX_VALUE;
                         HdlThreadLogic.toast(mContext, mContext.getString(R.string.the_input_value_has_been_exceeded) + "(" + maxValueInt + ").");
                         return;
@@ -97,7 +102,7 @@
 
                 } else {
                     if (mOnClickListener != null) {
-                        mOnClickListener.confirm(minValue, maxValue, mStateValue);
+                        mOnClickListener.confirm(minValue, maxValue, mGridType, mPowerStationType);
                     }
                 }
                 dismiss();
@@ -118,7 +123,9 @@
                 setBackgroundColor(null, TitleType.string_capacity);
                 setSelectedText("");
                 setBackgroundColor(viewBinding.allTv, TitleType.debuggingState);
-                mStateValue = DebugStatus.All;
+                setBackgroundColor(viewBinding.powerStationTypeAllTv, TitleType.powerStationType);
+                mGridType = DebugStatus.All;
+                mPowerStationType = PowerStationType.All;
             }
         });
         viewBinding.text1Tv.setOnClickListener(new View.OnClickListener() {
@@ -184,7 +191,7 @@
             @Override
             public void onClick(View v) {
                 setBackgroundColor(viewBinding.allTv, TitleType.debuggingState);
-                mStateValue = DebugStatus.All;
+                mGridType = DebugStatus.All;
             }
         });
         //璋冭瘯涓�
@@ -193,7 +200,7 @@
             @Override
             public void onClick(View v) {
                 setBackgroundColor(viewBinding.beDebuggingTv, TitleType.debuggingState);
-                mStateValue = DebugStatus.Debugging;
+                mGridType = DebugStatus.Debugging;
             }
         });
         //璋冭瘯瀹屾垚
@@ -202,7 +209,7 @@
             @Override
             public void onClick(View v) {
                 setBackgroundColor(viewBinding.debuggingcOmpletedTv, TitleType.debuggingState);
-                mStateValue = DebugStatus.WAIT_DELIVERED;
+                mGridType = DebugStatus.WAIT_DELIVERED;
             }
         });
         //宸蹭氦浠�
@@ -211,7 +218,7 @@
             @Override
             public void onClick(View v) {
                 setBackgroundColor(viewBinding.deliveredTv, TitleType.debuggingState);
-                mStateValue = DebugStatus.Delivered;
+                mGridType = DebugStatus.Delivered;
             }
         });
         //鎺堟潈璋冭瘯
@@ -220,7 +227,36 @@
             @Override
             public void onClick(View v) {
                 setBackgroundColor(viewBinding.authorizationDebuggingTv, TitleType.debuggingState);
-                mStateValue = DebugStatus.SECONDARY_DEBUGGIN;
+                mGridType = DebugStatus.SECONDARY_DEBUGGIN;
+            }
+        });
+        //鐢电珯绫诲瀷--鍏ㄩ儴
+        viewBinding.powerStationTypeAllTv.setOnClickListener(new View.OnClickListener() {
+
+            @Override
+            public void onClick(View v) {
+                setBackgroundColor(viewBinding.powerStationTypeAllTv, TitleType.powerStationType);
+                mPowerStationType = PowerStationType.All;
+            }
+        });
+
+        //鐢电珯绫诲瀷--閫嗗彉鍣�
+        viewBinding.powerStationTypeInvTv.setOnClickListener(new View.OnClickListener() {
+
+            @Override
+            public void onClick(View v) {
+                setBackgroundColor(viewBinding.powerStationTypeInvTv, TitleType.powerStationType);
+                mPowerStationType = PowerStationType.INV;
+            }
+        });
+
+        //鐢电珯绫诲瀷--BMS
+        viewBinding.powerStationTypeBmsTv.setOnClickListener(new View.OnClickListener() {
+
+            @Override
+            public void onClick(View v) {
+                setBackgroundColor(viewBinding.powerStationTypeBmsTv, TitleType.powerStationType);
+                mPowerStationType = PowerStationType.BMS;
             }
         });
 
@@ -267,6 +303,10 @@
             viewBinding.text6Tv.setBackground(AppCompatResources.getDrawable(mContext, R.drawable.config_129));
             viewBinding.text7Tv.setBackground(AppCompatResources.getDrawable(mContext, R.drawable.config_129));
             viewBinding.text8Tv.setBackground(AppCompatResources.getDrawable(mContext, R.drawable.config_129));
+        } else if (titleType == TitleType.powerStationType) {
+            viewBinding.powerStationTypeAllTv.setBackground(AppCompatResources.getDrawable(mContext, R.drawable.config_129));
+            viewBinding.powerStationTypeInvTv.setBackground(AppCompatResources.getDrawable(mContext, R.drawable.config_129));
+            viewBinding.powerStationTypeBmsTv.setBackground(AppCompatResources.getDrawable(mContext, R.drawable.config_129));
         } else {
             viewBinding.allTv.setBackground(AppCompatResources.getDrawable(mContext, R.drawable.config_129));
             viewBinding.beDebuggingTv.setBackground(AppCompatResources.getDrawable(mContext, R.drawable.config_129));
@@ -280,9 +320,10 @@
 
     }
 
-    public void initState(String min, String max, String stateValue) {
+    public void initState(String min, String max, String stateValue, String powerStationTypeValue) {
         try {
-            mStateValue = stateValue;
+            mPowerStationType = powerStationTypeValue;
+            mGridType = stateValue;
             viewBinding.minEt.setText(min);
             viewBinding.maxEt.setText(max);
 
@@ -336,6 +377,21 @@
                     break;
                 }
             }
+            switch (powerStationTypeValue) {
+                case PowerStationType.All:
+                    setBackgroundColor(viewBinding.powerStationTypeAllTv, TitleType.powerStationType);
+                    break;
+                case PowerStationType.INV:
+                    setBackgroundColor(viewBinding.powerStationTypeInvTv, TitleType.powerStationType);
+                    break;
+                case PowerStationType.BMS:
+                    setBackgroundColor(viewBinding.powerStationTypeBmsTv, TitleType.powerStationType);
+                    break;
+                default: {
+                    setBackgroundColor(viewBinding.powerStationTypeAllTv, TitleType.powerStationType);
+                    break;
+                }
+            }
         } catch (Exception ignored) {
         }
 
@@ -361,6 +417,7 @@
         viewBinding.authorizationDebuggingTv.setTag(DebugStatus.SECONDARY_DEBUGGIN);
         setBackgroundColor(null, TitleType.string_capacity);
         setBackgroundColor(viewBinding.allTv, TitleType.debuggingState);
+        setBackgroundColor(viewBinding.powerStationTypeAllTv, TitleType.powerStationType);
     }
 
     public void setOnClickListener(OnClickListener onClickListener) {
@@ -371,12 +428,13 @@
 
 
     public interface OnClickListener {
-        void confirm(String min, String max, String state);
+        void confirm(String min, String max, String state, String powerStationType);
     }
 
     public enum TitleType {
         string_capacity,//缁勪覆瀹归噺
-        debuggingState//璋冭瘯鐘舵��
+        debuggingState,//璋冭瘯鐘舵��
+        powerStationType//鐢电珯绫诲瀷
 
     }
 

--
Gitblit v1.8.0