From ea0b1e8e5f43c5fd0a7d479e25ede3b8cbea464a Mon Sep 17 00:00:00 2001
From: wxr <wxr@hdlchina.com.cn>
Date: 星期一, 02 十二月 2024 17:17:19 +0800
Subject: [PATCH] tcp;可视对讲;
---
HDL_ON/UI/UI2/3-Intelligence/Automation/ConditionDeviceFunList.cs | 210 +++++++++++++++++++++++++++++++++++++++++++++++++++-
1 files changed, 204 insertions(+), 6 deletions(-)
diff --git a/HDL_ON/UI/UI2/3-Intelligence/Automation/ConditionDeviceFunList.cs b/HDL_ON/UI/UI2/3-Intelligence/Automation/ConditionDeviceFunList.cs
index 2c31124..7d2996e 100644
--- a/HDL_ON/UI/UI2/3-Intelligence/Automation/ConditionDeviceFunList.cs
+++ b/HDL_ON/UI/UI2/3-Intelligence/Automation/ConditionDeviceFunList.cs
@@ -2,6 +2,7 @@
using Shared;
using System.Collections.Generic;
using HDL_ON.Entity;
+using HDL_ON.UI.UI2.FuntionControlView.VideoDoorLock;
namespace HDL_ON.UI.UI2.Intelligence.Automation
@@ -737,6 +738,78 @@
}
}
break;
+ //澶у崕鎽勫儚澶�
+ case SPK.IpCam_Imou:
+ {
+ LogicView.FunTypeView view = new LogicView.FunTypeView();
+ view.btnText.TextID = StringId.quyuruqingaojing;
+ view.btnText.Name = Language.StringByID(StringId.shipintonghuahujiao);
+ fLayout.AddChidren(view.FLayoutView());
+ view.btnClick.MouseUpEventHandler += (sender, e) =>
+ {
+ this.identifier = "ipcam_region_alram_event";
+ this.DeviceView(device, view.btnState, StringId.shi, StringId.offLogic, 1);
+ };
+
+ if (edit)
+ {
+ this.GetEditState(device, index, view.btnState, null, null, null);
+ }
+ }
+ break;
+ //钀ょ煶瑙嗛闂ㄩ攣
+ case SPK.VideoDoorLock:
+ {
+ LogicView.FunTypeView view1 = new LogicView.FunTypeView();
+ view1.btnText.TextID=StringId.kaimenrenyuan;
+ view1.btnText.Name = Language.StringByID(StringId.shipinmensuo);
+ fLayout.AddChidren(view1.FLayoutView());
+ view1.btnClick.MouseUpEventHandler += (sender, e) =>
+ {
+ this.identifier = "open_door";//寮�閿佷簨浠�
+ this.VideoDoorLockAction(this, device, view1.btnState);
+ };
+ if (edit)
+ {
+ this.GetEditState(device, index, view1.btnState,null, null, null);
+ }
+ }
+ break;
+ //鐚溂
+ case SPK.Peephole:
+ LogicView.FunTypeView viewPeephole = new LogicView.FunTypeView();
+ viewPeephole.btnText.TextID = StringId.ActivityDetection;
+ //viewPeephole.btnText.Name = Language.StringByID(StringId.shipinmensuo);
+ fLayout.AddChidren(viewPeephole.FLayoutView());
+ viewPeephole.btnClick.MouseUpEventHandler += (sender, e) =>
+ {
+ this.identifier = "pir_event";//浜轰綋鎰熷簲鍛婅
+ this.DeviceView(device, viewPeephole.btnState, StringId.shi, StringId.offLogic, 1);
+
+ };
+ if (edit)
+ {
+ this.GetEditState(device, index, viewPeephole.btnState, null, null, null);
+ }
+ break;
+ //钀ょ煶鎽勫儚澶�
+ case SPK.Ev_Ipcam:
+ LogicView.FunTypeView viewEzIpcam = new LogicView.FunTypeView();
+ viewEzIpcam.btnText.TextID = StringId.ActivityDetection;
+ //viewEzIpcam.btnText.Name = Language.StringByID(StringId.shipinmensuo);
+ fLayout.AddChidren(viewEzIpcam.FLayoutView());
+ viewEzIpcam.btnClick.MouseUpEventHandler += (sender, e) =>
+ {
+ this.identifier = Constant.intelligentDetection_event;//浜轰綋鎰熷簲鍛婅
+ this.DeviceView(device, viewEzIpcam.btnState, StringId.shi, StringId.offLogic, 1);
+
+ };
+ if (edit)
+ {
+ this.GetEditState(device, index, viewEzIpcam.btnState, null, null, null);
+ }
+ break;
+
}
#region 淇濆瓨
///淇濆瓨View
@@ -775,6 +848,38 @@
{
inputDevice.condition = new List<Dictionary<string, string>>();
}
+ }
+ else if (device.spk == SPK.IpCam_Imou)
+ {
+ //澶у崕鎽勫儚澶�
+ inputDevice.condition_type = "9";
+ inputDevice.identifier = this.identifier;
+ if (this.identifier == "ipcam_region_alram_event")
+ {
+ //condition榛樿[]
+ inputDevice.condition = new List<Dictionary<string, string>>();
+ }
+ }
+ else if(device.spk == SPK.Peephole)
+ {
+ //鐚溂-浜轰綋鎰熷簲鍛婅
+ inputDevice.condition_type = "9";
+ inputDevice.identifier = this.identifier;
+ inputDevice.condition = new List<Dictionary<string, string>>();
+ }
+ else if(device.spk == SPK.Ev_Ipcam)
+ {
+ //钀ょ煶鎽勫儚澶�-绉诲姩鐩戞祴鍛婅
+ inputDevice.condition_type = "9";
+ inputDevice.identifier = this.identifier;
+ inputDevice.condition = new List<Dictionary<string, string>>();
+ }
+ else if (device.spk == SPK.VideoDoorLock)
+ {
+ ////钀ょ煶瑙嗛闂ㄩ攣
+ inputDevice.condition_type = "9";
+ inputDevice.identifier = this.identifier;
+ //inputDevice.condition = new List<Dictionary<string, string>>();
}
else if (device.spk == SPK.SensorPirHold)
{
@@ -1190,13 +1295,13 @@
frame.AddChidren(loading);
loading.Start();
- new System.Threading.Thread(() =>
+ CommonMethod.Current.SunThread(() =>
{
try
{
var faceIdList = Send.Current.GetListHomeFace(device.deviceId, true);
- Application.RunOnMainThread(() =>
+ CommonMethod.Current.MainThread(() =>
{
loading.Hide();
string stateValue = btnState.Tag == null ? "" : btnState.Tag.ToString();
@@ -1207,7 +1312,7 @@
{
dicSateteList.Clear();
string userNameStr = string.Empty;
- string seleUsrIdStr = string.Empty;
+ string seleUsrIdStr = string.Empty;
string tag = string.Empty;
string[] arrayUserIds = new string[indexeList.Count];
//寮�闂ㄧ被鍨�
@@ -1245,8 +1350,76 @@
});
}
- })
- { IsBackground = true }.Start() ;
+ });
+
+ }
+
+ /// <summary>
+ /// 钀ょ煶瑙嗛闂ㄩ攣涓撶敤
+ /// </summary>
+ /// <param name="frame">褰撳墠鐣岄潰</param>
+ /// <param name="device">褰撳墠璁惧</param>
+ /// <param name="btnState">鏃х姸鎬�</param>
+ public void VideoDoorLockAction(FrameLayout frame, Entity.Function device, Button btnState)
+ {
+ selectedState = device.spk + "_";
+ Loading loading = new Loading();
+ frame.AddChidren(loading);
+ loading.Start();
+ CommonMethod.Current.SunThread(() =>
+ {
+ try
+ {
+ var faceIdList = Send.Current.GetVideoDoorLockUserListInfo(device);
+ CommonMethod.Current.MainThread(() =>
+ {
+
+ loading.Hide();
+ string stateValue = btnState.Text == null ? "" : btnState.Text.ToString();
+ PublicInterface publicInterface = new PublicInterface();
+ publicInterface.MultiSelectShow(this, faceIdList, device.name, stateValue, (indexeList) =>
+ {
+ if (indexeList.Count > 0)
+ {
+ dicSateteList.Clear();
+ string seleTxet = string.Empty;
+ string tag = string.Empty;
+ string[] array = new string[indexeList.Count];
+
+ for (int i = 0; i < indexeList.Count; i++)
+ {
+ if (i > faceIdList.Count)
+ {
+ continue;
+ }
+ var indexe = indexeList[i];
+ var face = faceIdList[indexe];
+ tag += face.userId;
+ tag += "_";
+ array[i] = face.userName;
+ }
+ seleTxet = Newtonsoft.Json.JsonConvert.SerializeObject(array);
+ //鏁版嵁灏佽<楂樿儨璇磋悿鐭抽偅杈规槸鎺ㄩ�佺敤鎴峰悕>
+ AddDictionary("open_user",seleTxet, "string", "[]");
+ //鐣岄潰鏄剧ず閫変腑鍊�
+ btnState.Text = InpOrOutLogicMethod.Current.RemoveLastStr(seleTxet);
+ btnState.Tag = tag;
+ }
+
+ });
+
+ });
+ }
+ catch { }
+ finally
+ {
+ Application.RunOnMainThread(() =>
+ {
+ loading.Hide();
+ });
+ }
+
+ });
}
@@ -1306,6 +1479,31 @@
{
//鏈夋暟鎹噸鏂拌祴鍊�
dicSateteList.AddRange(dicList);
+ }
+ //浜嬩欢涓撶敤
+ switch (device.spk)
+ {
+ case SPK.IpCam_Imou:
+ {
+ if (inputs.identifier == "ipcam_region_alram_event")
+ {
+ button1.Text = Language.StringByID(StringId.shi);
+ }
+
+ }
+ break;
+ case SPK.Peephole:
+ if (inputs.identifier == "pir_event")
+ {
+ button1.Text = Language.StringByID(StringId.shi );
+ }
+ break;
+ case SPK.Ev_Ipcam:
+ if (inputs.identifier == Constant.intelligentDetection_event)
+ {
+ button1.Text = Language.StringByID(StringId.shi);
+ }
+ break;
}
InpOrOutLogicMethod.Current.EditDeviceState(device, dicList, button1, button2, button3, button4, "");
}
@@ -1429,7 +1627,7 @@
{
return false;
}
- if (
+ if (this.function.spk == SPK.VideoDoorLock ||
this.function.spk == SPK.doorgate
)
{
--
Gitblit v1.8.0