From e267db1832578f34ed81b70c9524356c5dd75462 Mon Sep 17 00:00:00 2001
From: wxr <464027401@qq.com>
Date: 星期五, 02 九月 2022 15:42:56 +0800
Subject: [PATCH] 增加光伏储能入口

---
 SiriIntents/Server/NewAPI.cs                         |    2 
 HDL-ON_Android/Assets/Language.ini                   |   10 +
 HDL_ON/Common/ApiUtlis.cs                            |   31 +++++
 HDL_ON/UI/UI2/2-Classification/ClassificationPage.cs |  144 ++++++++++++++++++++++-
 HDL_ON/HDL_ON.projitems                              |    1 
 HDL_ON/Entity/FunctionList.cs                        |   15 ++
 HDL-ON_iOS/Info.plist                                |    4 
 HDL-ON_iOS/Resources/Language.ini                    |    5 
 HDL_ON/DAL/Server/NewAPI.cs                          |   12 ++
 HDL_ON/DAL/Server/HttpUtil.cs                        |    4 
 SiriIntents/Server/HttpServerRequest.cs              |    4 
 HDL_ON/Entity/Function/InverterInfo.cs               |   40 ++++++
 HDL_ON/Common/R.cs                                   |   26 ++++
 HDL_ON/DAL/Server/HttpServerRequest.cs               |   22 +++
 SiriIntents/Server/HttpUtil.cs                       |    4 
 15 files changed, 306 insertions(+), 18 deletions(-)

diff --git a/HDL-ON_Android/Assets/Language.ini b/HDL-ON_Android/Assets/Language.ini
index ed2b28e..6291a8c 100644
--- a/HDL-ON_Android/Assets/Language.ini
+++ b/HDL-ON_Android/Assets/Language.ini
@@ -547,6 +547,7 @@
 559=Bind a third-party account
 560=Bound
 561=Original password
+562=PhotovoltaicEnergyStorage
 
 
 
@@ -1753,6 +1754,13 @@
 559=缁戝畾绗笁鏂硅处鍙�
 560=宸茬粦瀹�
 561=鍘熷瘑鐮�
+562=鍏変紡鍌ㄨ兘
+563=宸ヤ綔姝e父
+564=宸ヤ綔妯″紡: ----
+565=浠婃棩鍙戠數: ----KW路h
+566=褰撳墠鍙戠數鍔熺巼: ----w
+567=鐢垫睜SOC: --%
+568=杩愯鏁版嵁/鎬绘暟鎹�: --/--
 
  
 
@@ -2938,6 +2946,7 @@
 559=Bind a third-party account
 560=Bound
 561=Original password
+562=PhotovoltaicEnergyStorage
 
 
 2532=Visitor Invitation Record
@@ -4134,6 +4143,7 @@
 559=Bind a third-party account
 560=Bound
 561=Original password
+562=PhotovoltaicEnergyStorage
 
 
 2532=Visitor Invitation Record
diff --git a/HDL-ON_iOS/Info.plist b/HDL-ON_iOS/Info.plist
index 5c1818d..7c3cac3 100644
--- a/HDL-ON_iOS/Info.plist
+++ b/HDL-ON_iOS/Info.plist
@@ -100,9 +100,9 @@
 	<key>UIStatusBarStyle</key>
 	<string>UIStatusBarStyleLightContent</string>
 	<key>CFBundleShortVersionString</key>
-	<string>1.6.002208191</string>
+	<string>1.6.002209021</string>
 	<key>CFBundleVersion</key>
-	<string>1.6.008191</string>
+	<string>1.6.009021</string>
 	<key>NSLocationWhenInUseUsageDescription</key>
 	<string>Use geographic location to provide services such as weather</string>
 	<key>NSAppleMusicUsageDescription</key>
diff --git a/HDL-ON_iOS/Resources/Language.ini b/HDL-ON_iOS/Resources/Language.ini
index ed2b28e..ff333ba 100644
--- a/HDL-ON_iOS/Resources/Language.ini
+++ b/HDL-ON_iOS/Resources/Language.ini
@@ -547,6 +547,7 @@
 559=Bind a third-party account
 560=Bound
 561=Original password
+562=PhotovoltaicEnergyStorage
 
 
 
@@ -1753,7 +1754,7 @@
 559=缁戝畾绗笁鏂硅处鍙�
 560=宸茬粦瀹�
 561=鍘熷瘑鐮�
-
+562=鍏変紡鍌ㄨ兘
  
 
 2532=璁垮閭�璇疯褰�
@@ -2938,6 +2939,7 @@
 559=Bind a third-party account
 560=Bound
 561=Original password
+562=PhotovoltaicEnergyStorage
 
 
 2532=Visitor Invitation Record
@@ -4134,6 +4136,7 @@
 559=Bind a third-party account
 560=Bound
 561=Original password
+562=PhotovoltaicEnergyStorage
 
 
 2532=Visitor Invitation Record
diff --git a/HDL_ON/Common/ApiUtlis.cs b/HDL_ON/Common/ApiUtlis.cs
index c618e15..10b28ef 100644
--- a/HDL_ON/Common/ApiUtlis.cs
+++ b/HDL_ON/Common/ApiUtlis.cs
@@ -433,6 +433,37 @@
                 }
             })
             { IsBackground = true }.Start();
+
+
+
+
+            //涓嬭浇鍏変紡鏁版嵁
+            new System.Threading.Thread(() => {
+                try
+                {
+                    HttpServerRequest http = new HttpServerRequest();
+                    var packData = http.GetInverterList();
+                    if (packData != null)
+                    {
+                        if (packData.Code == StateCode.SUCCESS)
+                        {
+                            var inverterList = JsonConvert.DeserializeObject<List<InverterInfo>>(packData.Data.ToString());
+                            if (inverterList!= null)
+                            {
+                                FunctionList.List.InverterList = inverterList;
+                            }
+                        }
+                    }
+                }
+                catch (Exception ex)
+                {
+                    MainPage.Log($"璇诲彇鍏変紡鏁版嵁寮傚父:{ex.Message}");
+                }
+
+            }) { IsBackground = true }.Start();
+
+
+
         }
 
         /// <summary>
diff --git a/HDL_ON/Common/R.cs b/HDL_ON/Common/R.cs
index c1c0dbf..c83a079 100644
--- a/HDL_ON/Common/R.cs
+++ b/HDL_ON/Common/R.cs
@@ -4,6 +4,32 @@
 {
     public static class StringId
     {
+
+        public const int OperationDataTotalData = 568;
+        /// <summary>
+        /// 鐢垫睜SOC
+        /// </summary>
+        public const int BatterySOC = 567;
+        /// <summary>
+        /// 褰撳墠鍙戠數鍔熺巼
+        /// </summary>
+        public const int CurrentPowerGeneration = 566;
+        /// <summary>
+        /// 浠婃棩鐢甸噺
+        /// </summary>
+        public const int PowerTenerationToday = 565;
+        /// <summary>
+        /// 宸ヤ綔妯″紡
+        /// </summary>
+        public const int WorkingMode = 564;
+        /// <summary>
+        /// 宸ヤ綔姝e父
+        /// </summary>
+        public const int NormalOperation = 563;
+        /// <summary>
+        /// 鍏変紡鍌ㄨ兘
+        /// </summary>
+        public const int PhotovoltaicEnergyStorage = 562;
         /// <summary>
         /// 鍘熷瘑鐮�
         /// </summary>
diff --git a/HDL_ON/DAL/Server/HttpServerRequest.cs b/HDL_ON/DAL/Server/HttpServerRequest.cs
index a01cdae..23b024a 100644
--- a/HDL_ON/DAL/Server/HttpServerRequest.cs
+++ b/HDL_ON/DAL/Server/HttpServerRequest.cs
@@ -2984,5 +2984,27 @@
             var requestJson = HttpUtil.GetSignRequestJson(d);
             return HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_GetCustomerInfo, requestJson);
         }
+
+
+
+
+
+
+
+        #region 鍏変紡鍌ㄨ兘
+        /// <summary>
+        /// 鑾峰彇浣忓畢涓嬮�嗗彉鍣ㄥ垪琛�
+        /// </summary>
+        /// <returns></returns>
+        public ResponsePackNew GetInverterList()
+        {
+            Dictionary<string, object> d = new Dictionary<string, object>();
+            d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
+            var requestJson = HttpUtil.GetSignRequestJson(d);
+            var pack = HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_GetInverter_List, requestJson);
+            return pack;
+        }
+        #endregion
+
     }
 }
\ No newline at end of file
diff --git a/HDL_ON/DAL/Server/HttpUtil.cs b/HDL_ON/DAL/Server/HttpUtil.cs
index 015e50c..fef52b7 100644
--- a/HDL_ON/DAL/Server/HttpUtil.cs
+++ b/HDL_ON/DAL/Server/HttpUtil.cs
@@ -18,8 +18,8 @@
         /// 鍏叡鍩熷悕灏辫繎瑙f瀽
         /// </summary>
 
-        //public const string GlobalRequestHttpsHost = "https://nearest.hdlcontrol.com";
-        public const string GlobalRequestHttpsHost = "https://test-gz.hdlcontrol.com";//mmmm
+        public const string GlobalRequestHttpsHost = "https://nearest.hdlcontrol.com";
+        //public const string GlobalRequestHttpsHost = "https://test-gz.hdlcontrol.com";//mmmm
         /// <summary>
         /// RegionMark
         /// </summary>
diff --git a/HDL_ON/DAL/Server/NewAPI.cs b/HDL_ON/DAL/Server/NewAPI.cs
index bf216a1..d6b2914 100644
--- a/HDL_ON/DAL/Server/NewAPI.cs
+++ b/HDL_ON/DAL/Server/NewAPI.cs
@@ -812,6 +812,18 @@
         public const string Api_Post_PlayerList = "/home-wisdom/app/wise/music/playerList";
         #endregion
 
+
+        #region  鈻�  -- 鍏変紡鍌ㄨ兘鎺ュ彛_______________________________
+        /// <summary>
+        /// 鑾峰彇浣忓畢涓嬮�嗗彉鍣ㄥ垪琛�
+        /// "appKey": "HDL-IOT-PLATFORM-TEST",
+        /// "sign": "6d43303499eda78ba729eba9e8afe1e5",
+        /// "timestamp": 1661764403,
+        /// "homeId":0
+        /// </summary>
+        public const string Api_Post_GetInverter_List = "/home-wisdom/app/device/inverter/list";
+        #endregion
+
     }
 
     ///// <summary>
diff --git a/HDL_ON/Entity/Function/InverterInfo.cs b/HDL_ON/Entity/Function/InverterInfo.cs
new file mode 100644
index 0000000..5e73d1f
--- /dev/null
+++ b/HDL_ON/Entity/Function/InverterInfo.cs
@@ -0,0 +1,40 @@
+锘縰sing System;
+using System.Collections.Generic;
+
+namespace HDL_ON.Entity
+{
+    /// <summary>
+	/// 鍏変紡鏁版嵁
+	/// </summary>
+    public class InverterInfo
+    {
+        public InverterInfo()
+        {
+        }
+
+        public string gatewayId;// 缃戝叧Id    long
+        public string gatewayName;//缃戝叧鍚嶇О    String
+        public string deviceId;// 璁惧id    Long
+        public string name;//璁惧鍚嶇О    string
+        public string spk;//璁惧spk   string
+        public string sid;//璁惧sid   string
+        public string oid;//璁惧oid   string
+        public string omodel;// 璁惧鍨嬪彿    string
+        public string osn;// 璁惧sn	
+        public string powerPvNow;// 褰撳墠鍙戠數鍔熺巼  String
+        public string totalElectricityPvToday;// 浠婃棩鍙戠數閲�   String
+        public string systemStatus;// 鐘舵��  String
+        public string inv;// 閫嗗彉鍣ㄧ姸鎬�   String
+        public List<InverterStatusInfo> status = new List<InverterStatusInfo>();// 灞炴�у綋鍓嶇姸鎬�  array
+
+    }
+    /// <summary>
+    /// 閫嗗彉鍣ㄧ姸鎬�
+    /// </summary>
+    public class InverterStatusInfo
+    {
+        public string key;// 灞炴�у悕绉�    string
+        public string value;// 灞炴�у�� string
+    }
+}
+
diff --git a/HDL_ON/Entity/FunctionList.cs b/HDL_ON/Entity/FunctionList.cs
index 9dce20e..cf3f154 100644
--- a/HDL_ON/Entity/FunctionList.cs
+++ b/HDL_ON/Entity/FunctionList.cs
@@ -102,6 +102,21 @@
             return Functions.FindAll((obj) => spkList.Contains(obj.spk));
         }
 
+        List<InverterInfo> _inverterList = new List<InverterInfo>();
+        /// <summary>
+        /// 鍏変紡鍒楄〃
+        /// </summary>
+        public List<InverterInfo> InverterList
+        {
+            get
+            {
+                return _inverterList;
+            }
+            set
+            {
+                _inverterList = value;
+            }
+        }
         #region 瀹剁數鍒楄〃 electricals
         /// <summary>
         /// 瀹剁數鍒楄〃
diff --git a/HDL_ON/HDL_ON.projitems b/HDL_ON/HDL_ON.projitems
index b5c2981..774796c 100644
--- a/HDL_ON/HDL_ON.projitems
+++ b/HDL_ON/HDL_ON.projitems
@@ -513,6 +513,7 @@
     <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\4-PersonalCenter\AddFunction\Iot_AuthorizedPage.cs" />
     <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\4-PersonalCenter\AddFunction\Iot_SupportSpkListPage.cs" />
     <Compile Include="$(MSBuildThisFileDirectory)DAL\DriverLayer\Control_Tcp.cs" />
+    <Compile Include="$(MSBuildThisFileDirectory)Entity\Function\InverterInfo.cs" />
   </ItemGroup>
   <ItemGroup>
     <Folder Include="$(MSBuildThisFileDirectory)Entity\Device\" />
diff --git a/HDL_ON/UI/UI2/2-Classification/ClassificationPage.cs b/HDL_ON/UI/UI2/2-Classification/ClassificationPage.cs
index 77796b7..3873cb5 100644
--- a/HDL_ON/UI/UI2/2-Classification/ClassificationPage.cs
+++ b/HDL_ON/UI/UI2/2-Classification/ClassificationPage.cs
@@ -645,8 +645,6 @@
             var lastY2 = Application.GetRealWidth(16);
             var functionContentViewHeight = Application.GetRealWidth(16);
 
-            var functionCategoryCount = 0;
-
             foreach (var item in DB_ResidenceData.Instance.functionTypeList)
             {
                 int functionCount = 0;
@@ -739,8 +737,6 @@
                 {
                     continue;
                 }
-
-                functionCategoryCount++;
 
                 FrameLayout functionView = new FrameLayout()
                 {
@@ -1069,17 +1065,147 @@
                 }
                 index++;
             }
+            
 
-            //if (functionCategoryCount > 4)
+            bool debugFlag = false;
+            #if DEBUG
+            debugFlag = true;
+            #endif
+
+            //鍏変紡鏁版嵁
+            if (FunctionList.List.InverterList.Count > 0|| debugFlag)
             {
-                //functionContentView.Height = functionContentViewHeight;// Application.GetRealWidth((240 * (functionCategoryCount / 2)));
-                s1View.Height = s2View.Height = functionContentView.Height = functionContentViewHeight+ Application.GetRealWidth(40);
+                FrameLayout inverterListView = new FrameLayout()
+                {
+                    Height = Application.GetRealHeight(223),
+                    Radius = (uint)Application.GetRealWidth(6),
+                    BackgroundColor = CSS_Color.MainBackgroundColor,
+                    Tag =  "inverterList_View",
+                    Y = index % 2 == 1 ? lastY2 : lastY1
+                };
+                if (index % 2 == 1)
+                {
+                    lastY2 += inverterListView.Height + Application.GetRealWidth(16);
+                }
+                else
+                {
+                    lastY1 += inverterListView.Height + Application.GetRealWidth(16);
+                }
+
+                if (index % 2 == 0)
+                {
+                    s1View.AddChidren(inverterListView);
+                }
+                else
+                {
+                    s2View.AddChidren(inverterListView);
+                }
+                functionContentViewHeight = inverterListView.Bottom;
+
+
+                Button btnName = new Button()
+                {
+                    X = Application.GetRealWidth(16),
+                    Y = Application.GetRealHeight(22),//14),//
+                    Width = Application.GetRealWidth(140),
+                    Height = Application.GetRealHeight(20),
+                    TextColor = CSS_Color.FirstLevelTitleColor,
+                    TextSize = CSS_FontSize.TextFontSize,
+                    TextAlignment = TextAlignment.CenterLeft,
+                    IsMoreLines = true,
+                    TextID = StringId.PhotovoltaicEnergyStorage,
+                    IsBold = true,
+                };
+                inverterListView.AddChidren(btnName);
+
+                Button btnWorkStatus = new Button()
+                {
+                    Y = Application.GetRealHeight(24),
+                    Width = Application.GetRealWidth(148),
+                    Height = Application.GetRealHeight(18),
+                    TextAlignment = TextAlignment.CenterRight,
+                    TextColor = 0xFF0BAF31,
+                    TextID = StringId.NormalOperation,
+                    TextSize = CSS_FontSize.TextFontSize
+                };
+                inverterListView.AddChidren(btnWorkStatus);
+
+                Button btnWorkingMode = new Button()
+                {
+                    X = Application.GetRealWidth(16),
+                    Y = btnWorkStatus.Bottom + Application.GetRealHeight(16),
+                    Width = Application.GetRealWidth(148),
+                    Height = Application.GetRealHeight(18),
+                    TextColor = CSS_Color.FirstLevelTitleColor,
+                    TextSize = CSS_FontSize.PromptFontSize_FirstLevel,
+                    TextID = StringId.WorkingMode,
+                    TextAlignment = TextAlignment.CenterLeft,
+                };
+                inverterListView.AddChidren(btnWorkingMode);
+
+                Button btnPowerTenerationToday = new Button()
+                {
+                    X = Application.GetRealWidth(16),
+                    Y = btnWorkingMode.Bottom + Application.GetRealHeight(16),
+                    Width = Application.GetRealWidth(148),
+                    Height = Application.GetRealHeight(18),
+                    TextColor = CSS_Color.FirstLevelTitleColor,
+                    TextSize = CSS_FontSize.PromptFontSize_FirstLevel,
+                    TextID = StringId.PowerTenerationToday,
+                    TextAlignment = TextAlignment.CenterLeft,
+                };
+                inverterListView.AddChidren(btnPowerTenerationToday);
+
+
+                Button btnCurrentPowerGeneration = new Button()
+                {
+                    X = Application.GetRealWidth(16),
+                    Y = btnPowerTenerationToday.Bottom + Application.GetRealHeight(16),
+                    Width = Application.GetRealWidth(148),
+                    Height = Application.GetRealHeight(18),
+                    TextColor = CSS_Color.FirstLevelTitleColor,
+                    TextSize = CSS_FontSize.PromptFontSize_FirstLevel,
+                    TextID = StringId.CurrentPowerGeneration,
+                    TextAlignment = TextAlignment.CenterLeft,
+                };
+                inverterListView.AddChidren(btnCurrentPowerGeneration);
+
+                Button btnBatterySOC = new Button()
+                {
+                    X = Application.GetRealWidth(16),
+                    Y = btnCurrentPowerGeneration.Bottom + Application.GetRealHeight(16),
+                    Width = Application.GetRealWidth(148),
+                    Height = Application.GetRealHeight(18),
+                    TextColor = CSS_Color.FirstLevelTitleColor,
+                    TextSize = CSS_FontSize.PromptFontSize_FirstLevel,
+                    TextID = StringId.BatterySOC,
+                    TextAlignment = TextAlignment.CenterLeft,
+                };
+                inverterListView.AddChidren(btnBatterySOC);
+
+                Button btnOperationDataTotalData = new Button()
+                {
+                    X = Application.GetRealWidth(16),
+                    Y = btnBatterySOC.Bottom + Application.GetRealHeight(16),
+                    Width = Application.GetRealWidth(148),
+                    Height = Application.GetRealHeight(18),
+                    TextColor = CSS_Color.FirstLevelTitleColor,
+                    TextSize = CSS_FontSize.PromptFontSize_FirstLevel,
+                    TextID = StringId.OperationDataTotalData,
+                    TextAlignment = TextAlignment.CenterLeft,
+                };
+                inverterListView.AddChidren(btnOperationDataTotalData);
+
+
+                index++;
             }
+
+            s1View.Height = s2View.Height = functionContentView.Height = functionContentViewHeight+ Application.GetRealWidth(40);
 
 #endregion
         }
 
-        #region 鍒囨崲妤煎眰
+#region 鍒囨崲妤煎眰
         /// <summary>
         /// 妤煎眰鏄剧ず鍒囨崲
         /// </summary>
@@ -1236,6 +1362,6 @@
         {
 
         }
-        #endregion
+#endregion
     }
 }
\ No newline at end of file
diff --git a/SiriIntents/Server/HttpServerRequest.cs b/SiriIntents/Server/HttpServerRequest.cs
index 6fe2f52..6cfd65e 100644
--- a/SiriIntents/Server/HttpServerRequest.cs
+++ b/SiriIntents/Server/HttpServerRequest.cs
@@ -91,11 +91,11 @@
             d.Add("homeId", DataManager.HomeId);
             d.Add("securitys", securityStates);
             var requestJson = HttpUtil.GetSignRequestJson(d);
-            var pack = HttpUtil.RequestHttpsPostFroHome(
-                NewAPI.Api_Post_Security_StatusSet, requestJson);
+            var pack = HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_Security_StatusSet, requestJson);
             return pack.Code;
         }
 
 
+
     }
 }
\ No newline at end of file
diff --git a/SiriIntents/Server/HttpUtil.cs b/SiriIntents/Server/HttpUtil.cs
index 56a78a0..f61de04 100644
--- a/SiriIntents/Server/HttpUtil.cs
+++ b/SiriIntents/Server/HttpUtil.cs
@@ -16,8 +16,8 @@
         /// 鍥哄畾鍩熷悕,姝e紡鐜
         /// 鍏叡鍩熷悕灏辫繎瑙f瀽
         /// </summary>
-        //public const string GlobalRequestHttpsHost = "https://nearest.hdlcontrol.com";
-        public const string GlobalRequestHttpsHost = "https://test-gz.hdlcontrol.com";//mmmm
+        public const string GlobalRequestHttpsHost = "https://nearest.hdlcontrol.com";
+        //public const string GlobalRequestHttpsHost = "https://test-gz.hdlcontrol.com";//mmmm
         /// <summary>
         /// RegionMark
         /// </summary>
diff --git a/SiriIntents/Server/NewAPI.cs b/SiriIntents/Server/NewAPI.cs
index 209b433..13c1525 100644
--- a/SiriIntents/Server/NewAPI.cs
+++ b/SiriIntents/Server/NewAPI.cs
@@ -736,6 +736,8 @@
         public const string Api_Post_BindSourcePanel = "/home-wisdom/source/screen/home/bind";
 
 
+
+
     }
 
     ///// <summary>

--
Gitblit v1.8.0