From e76381c3393d284f3f8ab61930cb6b71f18b2d6b Mon Sep 17 00:00:00 2001
From: wxr <wxr@hdlchina.com.cn>
Date: 星期二, 13 八月 2024 14:43:43 +0800
Subject: [PATCH] 金茂定制热水器,光伏储能,UI完成
---
HDL_ON/Entity/FunctionList.cs | 141 ++++++++++++++++++++++++++++++++++------------
1 files changed, 103 insertions(+), 38 deletions(-)
diff --git a/HDL_ON/Entity/FunctionList.cs b/HDL_ON/Entity/FunctionList.cs
index b294d7d..d190820 100644
--- a/HDL_ON/Entity/FunctionList.cs
+++ b/HDL_ON/Entity/FunctionList.cs
@@ -14,20 +14,20 @@
{
static FunctionList _FunctionList;
- public static void ClearData()
- {
- try
- {
- _FunctionList._IpCamImou = null;
- _FunctionList.ClearDatas();
- _FunctionList = null;
- }
- catch (Exception ex)
- {
- MainPage.Log($"娓呯悊FunctionList寮傚父:{ex.Message}");
- _FunctionList = null;
- }
- }
+ //public static void ClearData()
+ //{
+ // try
+ // {
+ // _FunctionList._IpCamImou = null;
+ // _FunctionList.ClearDatas();
+ // _FunctionList = null;
+ // }
+ // catch (Exception ex)
+ // {
+ // MainPage.Log($"娓呯悊FunctionList寮傚父:{ex.Message}");
+ // _FunctionList = null;
+ // }
+ //}
public static FunctionList List
{
@@ -56,6 +56,12 @@
/// </summary>
public List<Function> Functions = new List<Function>();
/// <summary>
+ /// 缇ゆ帶鍒楄〃
+ /// </summary>
+ public List<GroupControl> groupControls = new List<GroupControl>();
+
+
+ /// <summary>
/// 鏈烘鑷傚垪琛�
/// </summary>
/// <returns></returns>
@@ -77,6 +83,17 @@
if (_IpCamImou.Count > 0)
{
#if __IOS__
+ //鍒濆鍖栧ぇ鍗庢憚鍍忓ごsdk
+ Shared.IOS.HDLCNVRSDK.HDLLCNVRSDK.SharedInstance().InitSDKWithAppKey("HDL-HOME-APP-TEST", "WeJ8TY88vbakCcnvH8G1tDUqzLWY8yss", OnAppConfig.Instance.RequestHttpsHost);
+ Shared.IOS.HDLCNVRSDK.HDLLCNVRSDK.SharedInstance().AccessToken = UserInfo.Current.LoginTokenString;
+ Shared.IOS.HDLCNVRSDK.HDLLCNVRSDK.SharedInstance().RefreshToken = UserInfo.Current.RefreshToken;
+ Shared.IOS.HDLCNVRSDK.HDLLCNVRSDK.SharedInstance().HomeId = DB_ResidenceData.Instance.CurrentRegion.id;
+ Console.WriteLine("token锛�" + UserInfo.Current.LoginTokenString);
+ Console.WriteLine("token锛�" + UserInfo.Current.RefreshToken);
+ Shared.IOS.HDLCNVRSDK.HDLLCNVRSDK.SharedInstance().RefreshDeviceList();
+
+
+
#else
Com.Utils.HdlToLcUtils.Instance.InitData(Shared.Application.Activity, "HDL-HOME-APP-TEST", "WeJ8TY88vbakCcnvH8G1tDUqzLWY8yss", OnAppConfig.Instance.RequestHttpsHost);
Com.Utils.HdlToLcUtils.Instance.HomeId = DB_ResidenceData.Instance.CurrentRegion.id;
@@ -94,7 +111,7 @@
/// <returns></returns>
public List<Function> GetAcstParentList()
{
- return Functions.FindAll((obj) => obj.spk == SPK.AcstParent);//.OrderByDescending(o=>o.controlCounter).ToList()
+ return Functions.FindAll((obj) => obj.spk == SPK.AcstParent);
}
/// <summary>
@@ -105,6 +122,23 @@
public List<Function> GetAcstSubList()
{
return Functions.FindAll((obj) => obj.spk == SPK.AcstSub);
+ }
+ /// <summary>
+ /// 缁垮缓绉戞妧绯荤粺
+ /// 鐑按鍣ㄥ垪琛�
+ /// </summary>
+ /// <returns></returns>
+ public List<Function> GetWaterHeaterJinmaoList()
+ {
+ return Functions.FindAll((obj) => obj.spk == SPK.WaterHeaterJinmao);
+ }
+ /// <summary>
+ /// 閲戣寕鍏変紡鍌ㄨ兘
+ /// </summary>
+ /// <returns></returns>
+ public List<Function> GetInverterJinmaoList()
+ {
+ return Functions.FindAll((obj) => obj.spk == SPK.InverterJinmao);
}
/// <summary>
@@ -126,6 +160,15 @@
return Functions.FindAll((obj) => spkList.Contains(obj.spk));
}
/// <summary>
+ /// 搴忓垪鍒楄〃
+ /// </summary>
+ /// <returns></returns>
+ public List<Function> GetSeries()
+ {
+ return Functions.FindAll((obj) => obj.spk == SPK.CommonSeries);
+ }
+
+ /// <summary>
/// 绐楀笜鍒楄〃
/// </summary>
public List<Function> GetCurtainList()
@@ -146,6 +189,25 @@
public List<Function> GetDoorLockList()
{
var spkList = SPK.GetDoorLockSPKList();
+ return Functions.FindAll((obj) => spkList.Contains(obj.spk));
+ }
+ /// <summary>
+ /// 鑾峰彇钀ょ煶瑙嗛闂ㄩ攣
+ /// </summary>
+ /// <returns></returns>
+ public List<Function> GetVideoDoorLockList()
+ {
+ var spkList = SPK.GetVideoDoorLockSPKList();
+ return Functions.FindAll((obj) => spkList.Contains(obj.spk));
+ }
+
+ /// <summary>
+ /// 鑾峰彇褰遍煶涓帶鍒楄〃
+ /// </summary>
+ /// <returns></returns>
+ public List<Function> GetVideoControlsList()
+ {
+ var spkList = SPK.GetVideoControlsSPKList();
return Functions.FindAll((obj) => spkList.Contains(obj.spk));
}
@@ -186,8 +248,8 @@
var spkList = SPK.ElectricalSpkList();
return Functions.FindAll((obj) => spkList.Contains(obj.spk));
}
-
-
+
+
/// <summary>
/// 绾㈠瀹濆垪琛�
/// </summary>
@@ -195,7 +257,7 @@
{
return Functions.FindAll((obj) => obj.spk == SPK.IrModule);
}
-#endregion
+ #endregion
/// <summary>
/// 闊充箰鍒楄〃
@@ -232,10 +294,13 @@
var spkList = new List<string>()
{
SPK.SensorPir,
+ SPK.SensorPirHold,
SPK.SensorDoorWindow,
SPK.SensorSmoke,
SPK.SensorWater,
SPK.SensorGas,
+ SPK.SensorDryContact,
+ SPK.SensorDryContact2,
};
return Functions.FindAll((obj) => spkList.Contains(obj.spk));
@@ -256,7 +321,7 @@
{
get
{
- if(_OtherBrandFunction == null)
+ if (_OtherBrandFunction == null)
{
_OtherBrandFunction = new List<Function>();
var spkList = SPK.GetAll3tySPK();
@@ -324,9 +389,9 @@
{
//妫�娴嬮噸澶�
var same = Functions.FindAll((obj) => obj.deviceId == tempFunction.deviceId);
- if(same!= null)
+ if (same != null)
{
- foreach(var sameTemp in same)
+ foreach (var sameTemp in same)
{
Functions.Remove(sameTemp);
}
@@ -358,7 +423,7 @@
var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<SecurityAlarm>(dataString);
if (temp == null)
{
- MainPage.Log("null");
+ MainPage.Log("SecurityData_null");
FileUtlis.Files.DeleteFile(filePath);
return;
}
@@ -398,7 +463,7 @@
{
}
else
- {
+ {
switch (brandType)
{
case SPK.BrandType.Hdl:
@@ -465,11 +530,11 @@
/// <summary>
/// 鍔熻兘缁戝畾鎴块棿
/// </summary>
- public string FunctionsBindRooms(List<string> roomIds,List<string> deviceIds)
+ public string FunctionsBindRooms(List<string> roomIds, List<string> deviceIds)
{
var pm = new HttpServerRequest();
var pack = pm.BindDeviceToRoom(deviceIds, roomIds);
- if(pack.Code == StateCode.SUCCESS)
+ if (pack.Code == StateCode.SUCCESS)
{
}
@@ -483,7 +548,7 @@
/// <summary>
/// 鍒犻櫎鍦烘櫙
/// </summary>
- public void DeleteScene(Scene scene,bool upSevser)
+ public void DeleteScene(Scene scene, bool upSevser)
{
if (upSevser)
{
@@ -550,14 +615,14 @@
{
if (lockReadFunctionStatus)
{
- MainPage.Log($"澶氭杩涘叆--杩斿洖");
+ MainPage.Log($"澶氭杩涘叆--杩斿洖1");
return;
}
new Thread(() =>
{
if (lockReadFunctionStatus)
{
- MainPage.Log($"澶氭杩涘叆--杩斿洖");
+ MainPage.Log($"澶氭杩涘叆--杩斿洖2");
return;
}
MainPage.Log($"杩涘叆--璇诲彇");
@@ -566,7 +631,7 @@
{
Read3tyFunctionStatus();
- if(DriverLayer.Control.Ins.GatewayOnline_Local)
+ if (DriverLayer.Control.Ins.GatewayOnline_Local)
{
//List<Function> functions = GetDeviceFunctionList(SPK.BrandType.Hdl);
@@ -630,12 +695,12 @@
MainPage.Log($"缁撴潫--璇诲彇");
}
-
+
})
{ IsBackground = true }.Start();
}
-#region 鍦烘櫙鐩稿叧
+ #region 鍦烘櫙鐩稿叧
/// <summary>
/// 娣诲姞鍦烘櫙
/// </summary>
@@ -667,10 +732,10 @@
}
return revPack.Code;
}
-#endregion
+ #endregion
-#region 鏀惰棌鍔熻兘
-
+ #region 鏀惰棌鍔熻兘
+
/// <summary>
/// 鏀惰棌鍦烘櫙
/// </summary>
@@ -695,14 +760,14 @@
return result;
}
-#endregion
+ #endregion
-#region
-
+ #region
-#endregion
+
+ #endregion
}
}
--
Gitblit v1.8.0