From 0fc2962749e7e1f4078717a9914ac8175a2c4b26 Mon Sep 17 00:00:00 2001
From: wxr <wxr@hdlchina.com.cn>
Date: 星期四, 26 九月 2024 20:53:55 +0800
Subject: [PATCH] 可视对讲,注册
---
HDL_ON/UI/UI2/3-Intelligence/Automation/LogicMethod.cs | 226 +++++++++++++++++++++-----------------------------------
1 files changed, 86 insertions(+), 140 deletions(-)
diff --git a/HDL_ON/UI/UI2/3-Intelligence/Automation/LogicMethod.cs b/HDL_ON/UI/UI2/3-Intelligence/Automation/LogicMethod.cs
index 8d03e9a..d239964 100644
--- a/HDL_ON/UI/UI2/3-Intelligence/Automation/LogicMethod.cs
+++ b/HDL_ON/UI/UI2/3-Intelligence/Automation/LogicMethod.cs
@@ -361,7 +361,7 @@
}
else if (SPK.SensorPm10 == device.spk
|| SPK.SensorPirHold == device.spk
- || SPK.SensorLight == device.spk)
+ )
{
return "LogicIcon/sensor.png";
}
@@ -370,129 +370,14 @@
{
return "FunctionIcon/DoorLock/DoorLock.png";
}
-
- //LogicIcon/heatlogic.png"
+ else if (SPK.ElectricalTvHisense == device.spk)
+ {
+ return "LogicIcon/electricaltvhisense.png";
+ }
return $"FunctionIcon/Icon/{device.IconName}.png";
}
- /// <summary>
- /// 鑾峰彇璁惧绫诲瀷鍥炬爣(宸插純鐢� 2022骞�11鏈�25鏃�14:07:30)
- /// </summary>
- /// <param name="functionType">璁惧绫诲瀷</param>
- /// <returns></returns>
- public string GetIconPath(string spk)
- {
- string strPath = "";
- switch (spk)
- {
- case SPK.IpCam_Imou:
- {
- strPath = $"FunctionIcon/Icon/{SPK.IpCam_Imou.Replace(".", "")}.png";
- }
- break;
- case SPK.MechanicalArm:
- {
- strPath = "LogicIcon/lightloguc.png";
- }
- break;
- case SPK.doorgate:
- {
- strPath = "VideoIcon/keshiduijiang.png";
- }
- break;
- case SPK.AirSwitch:
- {
- strPath = "FunctionIcon/Icon/electricalbreaker.png";
- }
- break;
- case SPK.PanelSocket:
- case SPK.ElectricSocket:
- {
- strPath = "FunctionIcon/Icon/electricalsocket.png";
- }
- break;
- case SPK.LightSwitch:
- case SPK.LightRGB:
- case SPK.LightRGBW:
- case SPK.LightCCT:
- case SPK.LightDimming:
- {
- strPath = "LogicIcon/lightloguc.png";
- }
- break;
- case SPK.CurtainSwitch:
- case SPK.CurtainRoller:
- case SPK.CurtainTrietex:
- case SPK.CurtainDream:
- {
- strPath = "LogicIcon/curtainlogic.png";
- }
- break;
- case SPK.AcStandard:
- case SPK.AcIr:
- case SPK.HvacAC:
- {
- strPath = "LogicIcon/airconditionerlogic.png";
- }
- break;
- case SPK.HvacCac:
- strPath = "FunctionIcon/Icon/hvaccac.png";
- break;
- case SPK.FloorHeatStandard:
- case SPK.HvacFloorHeat:
- {
- strPath = "LogicIcon/heatlogic.png";
- }
- break;
- case SPK.AirFreshStandard:
- case SPK.HvacAirFresh:
- {
- strPath = "LogicIcon/heatlogic.png";
- }
- break;
- case SPK.SensorSmoke:
- case SPK.SensorWater:
- case SPK.SensorGas:
- case SPK.SensorDryContact:
- case SPK.SensorDryContact2:
- case SPK.SensorShanLan:
- case SPK.SensorDuiShe:
- case SPK.SensorPir:
- case SPK.SensorDoorWindow:
- case SPK.SensorUtrasonic:
- case SPK.SensorMmvPose:
- case SPK.SenesorMegahealth:
- case SPK.SenesorMegahealth2:
- case SPK.SensorEnvironment:case SPK.SensorEnvironmentHailin:
- case SPK.SensorEnvironment2:
- case SPK.SensorEnvironment3:
- case SPK.SensorTemperature:
- case SPK.SensorHumidity:
- case SPK.SensorCO2:
- case SPK.SensorPm25:
- case SPK.SensorTVOC:
- case SPK.SensorHcho:
- case SPK.SensorHelp:
- case SPK.SensorPirHold:
-
- {
- strPath = "LogicIcon/sensor.png";
- }
- break;
- case SPK.DoorLock:
- {
- strPath = "FunctionIcon/DoorLock/DoorLock.png";
- }
- break;
- case SPK.MusicStandard:
- case SPK.AvMusic:
- {
- strPath = "MusicIcon/localMusic.png";
- }
- break;
- }
- return strPath;
- }
+
#region 鍔ㄤ竴鏀逛笁
/// <summary>
/// 璁惧绫诲瀷鐨勫垪琛�(鐏厜绫伙紝绐楀笜绫汇�傘�傘��)
@@ -519,6 +404,7 @@
|| device.spk == SPK.LightCCT
|| device.spk == SPK.LightRGB
|| device.spk == SPK.LightRGBW
+ || device.spk == SPK.OtherCommon
);
if (lightjosn != null)
{
@@ -536,13 +422,13 @@
deviceStrTypeList.Add(Language.StringByID(StringId.Curtain));
}
///绌鸿皟绫�
- var ac = deviceList.Find((device) => device.spk == SPK.AcStandard || device.spk == SPK.HvacAC|| device.spk == SPK.AcIr);
+ var ac = deviceList.Find((device) => device.spk == SPK.AcStandard || device.spk == SPK.HvacAC|| device.spk == SPK.AcIr || device.spk == SPK.HvacAcPanel);
if (ac != null)
{
deviceStrTypeList.Add(Language.StringByID(StringId.AC));
}
///鍦版殩绫�
- var floorHeating = deviceList.Find((device) => device.spk == SPK.FloorHeatStandard || device.spk == SPK.HvacFloorHeat);
+ var floorHeating = deviceList.Find((device) => device.spk == SPK.FloorHeatStandard || device.spk == SPK.HvacFloorHeat || device.spk == SPK.HvacFloorHeatPanel);
if (floorHeating != null)
{
deviceStrTypeList.Add(Language.StringByID(StringId.FloorHeating));
@@ -652,6 +538,7 @@
functionTypeList.Add(SPK.AirSwitch);
functionTypeList.Add(SPK.PanelSocket);
functionTypeList.Add(SPK.ElectricSocket);
+ functionTypeList.Add(SPK.OtherCommon);
}
//缇ゆ帶
else if (deviceType == Language.StringByID(StringId.GroupControl))
@@ -670,14 +557,14 @@
else if (deviceType == Language.StringByID(StringId.AC))
{
functionTypeList.Add(SPK.AcStandard);
- functionTypeList.Add(SPK.HvacAC);
+ functionTypeList.Add(SPK.HvacAC); functionTypeList.Add(SPK.HvacAcPanel);
functionTypeList.Add(SPK.HvacCac);
functionTypeList.Add(SPK.AcIr);
}
///鍦版殩绫�
else if (deviceType == Language.StringByID(StringId.FloorHeating))
{
- functionTypeList.Add(SPK.FloorHeatStandard); functionTypeList.Add(SPK.HvacFloorHeat);
+ functionTypeList.Add(SPK.FloorHeatStandard); functionTypeList.Add(SPK.HvacFloorHeat); functionTypeList.Add(SPK.HvacFloorHeatPanel);
}
///鏂伴绫�
else if (deviceType == Language.StringByID(StringId.AirFresh))
@@ -770,10 +657,10 @@
functionTypeList.Add(SPK.CurtainRoller);
functionTypeList.Add(SPK.CurtainTrietex);
functionTypeList.Add(SPK.AcStandard);
- functionTypeList.Add(SPK.HvacAC);
+ functionTypeList.Add(SPK.HvacAC); functionTypeList.Add(SPK.HvacAcPanel);
functionTypeList.Add(SPK.AcIr);
functionTypeList.Add(SPK.FloorHeatStandard);
- functionTypeList.Add(SPK.HvacFloorHeat);
+ functionTypeList.Add(SPK.HvacFloorHeat); functionTypeList.Add(SPK.HvacFloorHeatPanel);
functionTypeList.Add(SPK.AirFreshStandard);
functionTypeList.Add(SPK.HvacAirFresh);
functionTypeList.Add(SPK.SensorSmoke);
@@ -816,6 +703,7 @@
functionTypeList.Add(SPK.SensorPirHold);
functionTypeList.Add(SPK.ElectricalTvHisense);
functionTypeList.Add(SPK.SensorLight);
+ functionTypeList.Add(SPK.OtherCommon);
}
@@ -844,9 +732,9 @@
deviceTypeList.Add(SPK.CurtainSwitch);
deviceTypeList.Add(SPK.CurtainRoller);
deviceTypeList.Add(SPK.CurtainTrietex);
- deviceTypeList.Add(SPK.AcStandard); deviceTypeList.Add(SPK.HvacAC);deviceTypeList.Add(SPK.AcIr);
+ deviceTypeList.Add(SPK.AcStandard); deviceTypeList.Add(SPK.HvacAC);deviceTypeList.Add(SPK.AcIr); deviceTypeList.Add(SPK.HvacAcPanel);
deviceTypeList.Add(SPK.AirFreshStandard); deviceTypeList.Add(SPK.HvacAirFresh);
- deviceTypeList.Add(SPK.FloorHeatStandard); deviceTypeList.Add(SPK.HvacFloorHeat);
+ deviceTypeList.Add(SPK.FloorHeatStandard); deviceTypeList.Add(SPK.HvacFloorHeat); deviceTypeList.Add(SPK.HvacFloorHeatPanel);
deviceTypeList.Add(SPK.SensorSmoke);
deviceTypeList.Add(SPK.SensorWater);
deviceTypeList.Add(SPK.SensorGas);
@@ -895,8 +783,8 @@
deviceTypeList.Add(SPK.CurtainSwitch);
deviceTypeList.Add(SPK.CurtainRoller);
deviceTypeList.Add(SPK.CurtainTrietex);
- deviceTypeList.Add(SPK.AcStandard); deviceTypeList.Add(SPK.HvacAC); deviceTypeList.Add(SPK.AcIr);
- deviceTypeList.Add(SPK.FloorHeatStandard); deviceTypeList.Add(SPK.HvacFloorHeat);
+ deviceTypeList.Add(SPK.AcStandard); deviceTypeList.Add(SPK.HvacAC); deviceTypeList.Add(SPK.AcIr); deviceTypeList.Add(SPK.HvacAcPanel);
+ deviceTypeList.Add(SPK.FloorHeatStandard); deviceTypeList.Add(SPK.HvacFloorHeat); deviceTypeList.Add(SPK.HvacFloorHeatPanel);
deviceTypeList.Add(SPK.AirFreshStandard); deviceTypeList.Add(SPK.HvacAirFresh);
deviceTypeList.Add(SPK.AirSwitch);
deviceTypeList.Add(SPK.PanelSocket);
@@ -907,6 +795,7 @@
deviceTypeList.Add(SPK.MechanicalArm);
deviceTypeList.Add(SPK.AcIr);
deviceTypeList.Add(SPK.ElectricalTvHisense);
+ deviceTypeList.Add(SPK.OtherCommon);
}
break;
}
@@ -982,6 +871,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 "";
}
}
@@ -1134,18 +1080,17 @@
//涓嶆槸涓昏处鍙风洿鎺ヨ繑鍥�
return;
}
- List<LogicData> logicDataList = new List<LogicData>();
+ List<LogicIdData> logicDataList = new List<LogicIdData>();
logicDataList.Clear();
System.Threading.Tasks.Task.Run(() =>
{
try
{
//鑾峰彇閫昏緫ID鍒楄〃锛岀洰鍓嶉拡瀵规墍鏈�<澶囨敞:濡傛灉鍙拡瀵瑰綋鍓嶆墜鏈虹殑璇濓紝鍙互鐩存帴鎷跨紦瀛樻暟鎹嚜鍔ㄥ寲鍒楄〃閬嶅巻>
- var idStr = Send.Current.GetLogicIdList();
- if (idStr != null)
+ var idStrList = Send.Current.GetLogicIdList();
+ if (idStrList != null)
{
- var date = Newtonsoft.Json.JsonConvert.SerializeObject(idStr.Data);
- logicDataList = Newtonsoft.Json.JsonConvert.DeserializeObject<List<LogicData>>(date);
+ logicDataList.AddRange(idStrList);
}
///鏈夎嚜鍔ㄥ垪琛ㄦ墠澶勭悊
if (logicDataList.Count > 0)
@@ -1222,12 +1167,13 @@
{
//妯℃嫙璁惧
var functions = new List<Function> {
- new Entity.Function { sid = "1234567890", name = "鐓ф槑浼犳劅鍣�", spk = Entity.SPK.SensorLight },
- // 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 },
--
Gitblit v1.8.0