From bfb3d0d4879dca8c59ff287c92f5113162f3a33a Mon Sep 17 00:00:00 2001
From: wxr <wxr@hdlchina.com.cn>
Date: 星期二, 27 八月 2024 15:22:48 +0800
Subject: [PATCH] 代码备份
---
OnPro/HDL_ON/UI/UI2/3-Intelligence/Automation/LogicMethod.cs | 142 ++++++++++++++++++++++++++++++-----------------
1 files changed, 91 insertions(+), 51 deletions(-)
diff --git a/OnPro/HDL_ON/UI/UI2/3-Intelligence/Automation/LogicMethod.cs b/OnPro/HDL_ON/UI/UI2/3-Intelligence/Automation/LogicMethod.cs
index 9496297..66e6906 100644
--- a/OnPro/HDL_ON/UI/UI2/3-Intelligence/Automation/LogicMethod.cs
+++ b/OnPro/HDL_ON/UI/UI2/3-Intelligence/Automation/LogicMethod.cs
@@ -131,7 +131,7 @@
/// <param name="dic">Dictionary绫�</param>
/// <param name="key">鍋�</param>
/// <param name="value">鍊�</param>
- public void dictionary(Dictionary<string, string> dic, string key, string value)
+ public void dictionary(Dictionary<string, string> dic, string key, string value)
{
if (dic.ContainsKey(key)) //鍒ゆ柇鏄惁瀛樺湪閿��
{
@@ -187,7 +187,6 @@
var list2 = this.GetVideoDeviceList();
list.AddRange(list1);
list.AddRange(list2);
- list.AddRange(FunctionList.List.groupControls);
#if DEBUG
GetTestDevice(ref list, true);
#endif
@@ -200,21 +199,6 @@
public List<HDL_ON.Entity.Function> GetVideoDeviceList()
{
var functionList = new List<Function>();
- foreach (var videoDevice in FunctionList.List.videoIntercom)
- {
- Function function = new Function();
- function.spk = videoDevice.spk;
- function.name = videoDevice.deviceName;
- function.deviceId = videoDevice.deviceId;
- function.setOnine( videoDevice.status == "online");
- function.sid = videoDevice.sid;
- var video = functionList.Find((o) => o.deviceId == function.deviceId);
- if (video == null)
- {
- functionList.Add(function);
- }
-
- }
return functionList;
}
/// <summary>
@@ -226,14 +210,6 @@
return HDL_ON.Entity.FunctionList.List.scenes;
}
- /// <summary>
- /// 鑾峰彇瀹夐槻鍒楄〃
- /// </summary>
- /// <returns></returns>
- public List<HDL_ON.Entity.SecurityAlarm> GetSecurityList()
- {
- return FunctionList.List.securities;
- }
/// <summary>
/// 鑾峰彇鎴块棿鐨勮澶囧垪琛�
/// </summary>
@@ -306,26 +282,6 @@
return scene;
}
/// <summary>
- /// 鑾峰彇瀹夐槻瀵硅薄
- /// </summary>
- /// <param name="sid">瀹夐槻鍞竴鏍囪瘑</param>
- /// <returns></returns>
- public HDL_ON.Entity.SecurityAlarm GetSecurity(string sid)
- {
- HDL_ON.Entity.SecurityAlarm security = new Entity.SecurityAlarm() { name = "Unknown" };
- List<HDL_ON.Entity.SecurityAlarm> SecurityLists = GetSecurityList();
- for (int i = 0; i < SecurityLists.Count; i++)
- {
- var sce = SecurityLists[i];
- if (sce.sid == sid)
- {
- security = sce;
- break;
- }
- }
- return security;
- }
- /// <summary>
/// 鑾峰彇鎴块棿鍚�(鍗虫槸=鍖哄煙鍚嶇О)
/// </summary>
/// <param name="device">璁惧</param>
@@ -359,7 +315,9 @@
{
return "MusicIcon/localMusic.png";
}
- else if (SPK.SensorPm10 == device.spk || SPK.SensorPirHold == device.spk)
+ else if (SPK.SensorPm10 == device.spk
+ || SPK.SensorPirHold == device.spk
+ )
{
return "LogicIcon/sensor.png";
}
@@ -368,10 +326,21 @@
{
return "FunctionIcon/DoorLock/DoorLock.png";
}
+ //else if (SPK.SensorDryContact == device.spk
+ // || SPK.SensorDryContact2 == device.spk
+ // || SPK.OtherCommon == device.spk
+ // )
+ //{
+ // return "LogicIcon/ganjiedian.png";
+ //}
+ //else if (SPK.SensorLight == device.spk)
+ //{
+ // return "LogicIcon/lightloguc.png";
+ //}
//LogicIcon/heatlogic.png"
return $"FunctionIcon/Icon/{device.IconName}.png";
- }
+ }
/// <summary>
/// 鑾峰彇璁惧绫诲瀷鍥炬爣(宸插純鐢� 2022骞�11鏈�25鏃�14:07:30)
/// </summary>
@@ -516,6 +485,7 @@
|| device.spk == SPK.LightCCT
|| device.spk == SPK.LightRGB
|| device.spk == SPK.LightRGBW
+ || device.spk == SPK.OtherCommon
);
if (lightjosn != null)
{
@@ -576,6 +546,7 @@
|| device.spk == SPK.SensorHelp
|| device.spk == SPK.SensorPm10
|| device.spk == SPK.SensorPirHold
+ || device.spk == SPK.SensorLight
);
if (sensor != null)
{
@@ -586,6 +557,7 @@
device.spk == SPK.AirSwitch
|| device.spk == SPK.PanelSocket
|| device.spk == SPK.ElectricSocket
+ || device.spk == SPK.ElectricalTvHisense
);
if (electric != null)
{
@@ -647,6 +619,7 @@
functionTypeList.Add(SPK.AirSwitch);
functionTypeList.Add(SPK.PanelSocket);
functionTypeList.Add(SPK.ElectricSocket);
+ functionTypeList.Add(SPK.OtherCommon);
}
//缇ゆ帶
else if (deviceType == Language.StringByID(StringId.GroupControl))
@@ -706,6 +679,7 @@
functionTypeList.Add(SPK.SensorHelp);
functionTypeList.Add(SPK.SensorPm10);
functionTypeList.Add(SPK.SensorPirHold);
+ functionTypeList.Add(SPK.SensorLight);
}
@@ -715,6 +689,7 @@
functionTypeList.Add(SPK.AirSwitch);
functionTypeList.Add(SPK.PanelSocket);
functionTypeList.Add(SPK.ElectricSocket);
+ functionTypeList.Add(SPK.ElectricalTvHisense);
}
///闂ㄩ攣绫�
else if (deviceType == Language.StringByID(StringId.DoorLock))
@@ -807,6 +782,9 @@
functionTypeList.Add(SPK.VideoDoorLock);
functionTypeList.Add(SPK.AcIr);
functionTypeList.Add(SPK.SensorPirHold);
+ functionTypeList.Add(SPK.ElectricalTvHisense);
+ functionTypeList.Add(SPK.SensorLight);
+ functionTypeList.Add(SPK.OtherCommon);
}
@@ -871,6 +849,7 @@
deviceTypeList.Add(SPK.VideoDoorLock);
deviceTypeList.Add(SPK.AcIr);
deviceTypeList.Add(SPK.SensorPirHold);
+ deviceTypeList.Add(SPK.SensorLight);
}
break;
@@ -896,6 +875,8 @@
deviceTypeList.Add(SPK.AvMusic);
deviceTypeList.Add(SPK.MechanicalArm);
deviceTypeList.Add(SPK.AcIr);
+ deviceTypeList.Add(SPK.ElectricalTvHisense);
+ deviceTypeList.Add(SPK.OtherCommon);
}
break;
}
@@ -971,6 +952,63 @@
get
{
return Entity.DB_ResidenceData.Instance.CurrentRegion.isOtherShare;
+ }
+ }
+ /// <summary>
+ /// 鎷兼帴鏃堕棿鏍煎紡//"{h}h{m}min{s}s";
+ /// </summary>
+ /// <param name="totalSeconds">绉�(娌℃湁榛樿浼犲叆0)</param>
+ /// <returns></returns>
+ public string getTimeStr(string totalSeconds)
+ {
+ try
+ {
+ if (string.IsNullOrEmpty(totalSeconds))
+ {
+ return "";
+ }
+ int time = int.Parse(totalSeconds);
+ int h = time / (60 * 60);
+ int m = time % (60 * 60) / 60;
+ int s = (time % (60 * 60) % 60);
+
+ if (h == 0 && m != 0 && s != 0)
+ {
+ return $"{m}min{s}s";
+ }
+ else if (h == 0 && m == 0 && s != 0)
+ {
+ return $"{s}s";
+ }
+ else if (h == 0 && m != 0 && s == 0)
+ {
+ return $"{m}min";
+ }
+ else if (h != 0 && m == 0 && s != 0)
+ {
+ return $"{h}h{s}s";
+ }
+ else if (h != 0 && m == 0 && s == 0)
+ {
+ return $"{h}h";
+ }
+ else if (h != 0 && m != 0 && s == 0)
+ {
+ return $"{h}h{m}min";
+ }
+ else if (h != 0 && m != 0 && s != 0)
+ {
+ return $"{h}h{m}min{s}s";
+ }
+ else if (h == 0 && m == 0 && s == 0)
+ {
+ return $"0s";
+ }
+ return "";
+ }
+ catch
+ {
+ return "";
}
}
@@ -1211,12 +1249,13 @@
{
//妯℃嫙璁惧
var functions = new List<Function> {
- //new Entity.Function { sid = "1234567890", name = "瓒呭0娉紶鎰熷櫒", spk = Entity.SPK.SensorUtrasonic },
- // new Entity.Function { sid = "1234567891", name = "娓╁害浼犳劅鍣�", spk = Entity.SPK.SensorTemperature },
- // new Entity.Function { sid = "1234567892", name = "婀垮害浼犳劅鍣�", spk = Entity.SPK.SensorHumidity },
+ new Entity.Function { sid = "1234567890", name = "鍏夌収浼犳劅鍣�", spk = Entity.SPK.SensorLight },
+ new Entity.Function { sid = "1234567891", name = "骞茶妭鐐�", spk = Entity.SPK.SensorDryContact },
+ new Entity.Function { sid = "1234567892", name = "绱ф�ユ眰鍔╀紶鎰熷櫒", spk = Entity.SPK.SensorHelp },
+ new Entity.Function { sid = "12345678921", name = "閫氱敤寮�鍏�", spk = Entity.SPK.OtherCommon },
//new Entity.Function { sid = "12345678933456", name = "闂ㄩ攣", spk = Entity.SPK.DoorLock },
// new Entity.Function { sid = "1234567895444", name = "瑙嗛闂ㄩ攣", spk = Entity.SPK.VideoDoorLock },
- //new Entity.Function { sid = "12345678968888", name = "浜轰綋瀛樺湪浼犳劅鍣�", spk = Entity.SPK.SensorPirHold },
+ new Entity.Function { sid = "123456789688889", name = "浜轰綋瀛樺湪浼犳劅鍣�", spk = Entity.SPK.SensorPirHold },
new Entity.Function { sid = "12345678968888", name = "娴嬭瘯鐚溂", spk = Entity.SPK.Peephole },
new Entity.Function { sid = "12345678968889", name = "娴嬭瘯钀ょ煶鎽勫儚澶�", spk = Entity.SPK.Ev_Ipcam },
// new Entity.Function { sid = "1234567897", name = "姣背娉紶鎰熷櫒1", spk = Entity.SPK.SenesorMegahealth2 },
@@ -1226,6 +1265,7 @@
new Entity.Function { sid = "12345678991234566844", name = "澶у崕鎽勫儚澶�", spk = Entity.SPK.IpCam_Imou },
new Entity.Function { sid = "12345678991234567", name = "RGB", spk = Entity.SPK.LightRGB },
new Entity.Function { sid = "123456789912345678", name = "RGBW", spk = Entity.SPK.LightRGBW },
+ new Function { spk = SPK.ElectricalTvHisense, name = "娴蜂俊鐢佃1",sid="123456789"},
};
foreach (var function in functions)
{
--
Gitblit v1.8.0