Merge branch 'wjc' into dev--wxr
| | |
| | | 7162=Face to open the door |
| | | 7163=Video call |
| | | 7164=Manipulator |
| | | 7165=Area intrusion alarm |
| | | 7166=camera |
| | | 7167=main switch |
| | | |
| | | |
| | | |
| | | |
| | | |
| | |
| | | 7162=人脸开门 |
| | | 7163=视频通话呼叫 |
| | | 7164=机械手 |
| | | 7165=区域入侵告警 |
| | | 7166=摄像头 |
| | | 7167=总控开关 |
| | | |
| | | |
| | | |
| | | |
| | |
| | | 7162=Face to open the door |
| | | 7163=Video call |
| | | 7164=Manipulator |
| | | 7165=Area intrusion alarm |
| | | 7166=camera |
| | | 7167=main switch |
| | | |
| | | |
| | | |
| | | |
| | |
| | | 7162=人脸开门 |
| | | 7163=视频通话呼叫 |
| | | 7164=机械手 |
| | | 7165=区域入侵告警 |
| | | 7166=摄像头 |
| | | 7167=总控开关 |
| | | |
| | | |
| | | |
| | |
| | | /// 机械手 |
| | | /// </summary> |
| | | public const int jixieshou = 7164; |
| | | |
| | | /// <summary> |
| | | /// 区域入侵告警 |
| | | /// </summary> |
| | | public const int quyuruqingaojing = 7165; |
| | | /// <summary> |
| | | /// 摄像头 |
| | | /// </summary> |
| | | public const int shexiangtou = 7166; |
| | | /// <summary> |
| | | /// 总控开关 |
| | | /// </summary> |
| | | public const int zongkogkaiguan = 7167; |
| | | |
| | | |
| | | |
| | | #region LE新增 |
| | |
| | | fLayout.AddChidren(view1.FLayoutView()); |
| | | view1.btnClick.MouseUpEventHandler += (sender, e) => |
| | | { |
| | | identifier = "door_call_cloud_event"; |
| | | DeviceView(device, view1.btnState, StringId.shi, StringId.offLogic, 1); |
| | | this.identifier = "door_call_cloud_event"; |
| | | this.DeviceView(device, view1.btnState, StringId.shi, StringId.offLogic, 1); |
| | | }; |
| | | |
| | | LogicView.FunTypeView view2 = new LogicView.FunTypeView(); |
| | |
| | | fLayout.AddChidren(view2.FLayoutView()); |
| | | view2.btnClick.MouseUpEventHandler += (sender, e) => |
| | | { |
| | | identifier = "door_pedestrian_records"; |
| | | this.identifier = "door_pedestrian_records"; |
| | | this.FaceAction(this, device, view2.btnState); |
| | | }; |
| | | |
| | |
| | | } |
| | | if (edit) |
| | | { |
| | | GetEditState(device, index, view1.btnState, view2.btnState, null, null); |
| | | this.GetEditState(device, index, view1.btnState, view2.btnState, null, null); |
| | | } |
| | | } |
| | | 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; |
| | | |
| | | } |
| | | #region 保存 |
| | | ///保存View |
| | |
| | | this.AddChidren(saveView.FLayoutView()); |
| | | saveView.btnClick.MouseUpEventHandler += (sen, e) => |
| | | { |
| | | Save(device,index, edit); |
| | | this.SaveInput(device,index, edit); |
| | | }; |
| | | |
| | | #endregion |
| | |
| | | /// </summary> |
| | | /// <param name="index">索引值</param> |
| | | /// <param name="edit"></param> |
| | | private void Save(Entity.Function device,int index, bool edit) |
| | | private void SaveInput(Entity.Function device,int index, bool edit) |
| | | { |
| | | |
| | | if (selectedState != "unknown") |
| | |
| | | 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>>(); |
| | | } |
| | | } |
| | | |
| | | |
| | | if (edit) |
| | | { |
| | | //移除旧数据 |
| | |
| | | || (button.Name == Language.StringByID(StringId.diedaobaojing))) |
| | | { |
| | | //只有毫米波传感器(自研) |
| | | Save(device, mIndex, mEdit); |
| | | SaveInput(device, mIndex, mEdit); |
| | | } |
| | | else if (button.Name == Language.StringByID(StringId.shipintonghuahujiao)) { |
| | | //只有毫米波传感器(自研) |
| | | Save(device, mIndex, mEdit); |
| | | SaveInput(device, mIndex, mEdit); |
| | | } |
| | | } |
| | | |
| | |
| | | } |
| | | selectedState = device.spk + "_" + value; |
| | | AddDictionary(keyValue, value, data_type, comparator); |
| | | Save(device,index, edit); |
| | | SaveInput(device,index, edit); |
| | | }); |
| | | } |
| | | /// PM2.5,Co2,Tvoc设置值 |
| | |
| | | break; |
| | | } |
| | | AddDictionary(key, values, "integer", "in"); |
| | | Save(device, index, edit); |
| | | SaveInput(device, index, edit); |
| | | }); |
| | | } |
| | | /// <summary> |
| | |
| | | funView.btnLine.X = Application.GetRealWidth(16); |
| | | funView.btnLine.Width = Application.GetRealWidth(343); |
| | | verticalScrolView.AddChidren(funView.FLayoutView()); |
| | | funView.btnIcon.UnSelectedImagePath = LogicMethod.Current.GetIconPath(dev.spk); |
| | | funView.btnIcon.UnSelectedImagePath = LogicMethod.Current.GetDeviceIconPath(dev); |
| | | funView.btnDeviceName.Text = dev.name; |
| | | funView.btnRoomName.Text = dev.GetRoomListName(); |
| | | |
| | | funView.btnClick.MouseUpEventHandler += (sen, e) => |
| | | { |
| | | if (if_Type == LogicMethod.condition_if) |
| | |
| | | //用sid找到设备; |
| | | var device = LogicMethod.Current.GetDevice(inputCondition.sid); |
| | | //用设备的functionType类型找到对应图标; |
| | | inputView.btnIcon.UnSelectedImagePath = LogicMethod.Current.GetIconPath(device.spk); |
| | | inputView.btnIcon.UnSelectedImagePath = LogicMethod.Current.GetDeviceIconPath(device); |
| | | //显示设备名称 |
| | | inputView.btnText.Text = device.name; |
| | | //改变设备名称显示控件宽度 |
| | |
| | | var FaceItem = this.GetFaceItem(userId, device.deviceId); |
| | | inputView.btnState.Text = FaceItem.userName; |
| | | } |
| | | } |
| | | break; |
| | | case SPK.IpCam_Imou: |
| | | { |
| | | if (inputCondition.identifier == "door_caipcam_region_alram_eventll_cloud_event") |
| | | { |
| | | inputView.btnState.Text = Language.StringByID(StringId.quyuruqingaojing); |
| | | } |
| | | |
| | | } |
| | | break; |
| | | } |
| | |
| | | //用sid找到设备; |
| | | var device = LogicMethod.Current.GetDevice(outputTarget.sid); |
| | | //用设备的functionType类型找到对应图标; |
| | | targetView.btnIcon.UnSelectedImagePath = LogicMethod.Current.GetIconPath(device.spk); |
| | | targetView.btnIcon.UnSelectedImagePath = LogicMethod.Current.GetDeviceIconPath(device); |
| | | //显示设备名称 |
| | | targetView.btnText.Text = device.name; |
| | | //改变设备名称显示控件宽度 |
| | |
| | | //区别不同设备,显示不同设备状态 |
| | | switch (device.spk) |
| | | { |
| | | |
| | | |
| | | //插座(有USB) |
| | | case SPK.PanelSocket: |
| | | { |
| | | string on_off = GetKeyValue("on_off_master", dicList); |
| | | if (on_off == "on") |
| | | { |
| | | stateStr = Language.StringByID(StringId.onLogic); |
| | | } |
| | | else |
| | | { |
| | | stateStr = stateStr = Language.StringByID(StringId.offLogic); |
| | | } |
| | | } |
| | | break; |
| | | case SPK.AirSwitch: |
| | | case SPK.LightSwitch: |
| | | //插座 |
| | | case SPK.PanelSocket: |
| | | case SPK.ElectricSocket: |
| | | //机械手 |
| | | case SPK.MechanicalArm: |
| | |
| | | { |
| | | switch (device.spk) |
| | | { |
| | | //插座 |
| | | //插座(有USB) |
| | | case SPK.PanelSocket: |
| | | { |
| | | foreach (var dic in dicList) |
| | | { |
| | | string value = dic["value"]; |
| | | if (value == "on") |
| | | { |
| | | button1.Text = Language.StringByID(StringId.onLogic); |
| | | } |
| | | else |
| | | { |
| | | button1.Text = Language.StringByID(StringId.offLogic); |
| | | } |
| | | } |
| | | } |
| | | break; |
| | | case SPK.ElectricSocket: |
| | | //开关灯光 |
| | | case SPK.AirSwitch: |
| | |
| | | button2.Text = this.GetFaceItem(value, device.deviceId).userName; |
| | | } |
| | | break; |
| | | |
| | | } |
| | | } |
| | | /// <summary> |
| | |
| | | /// <returns></returns> |
| | | private string GetTimeText(string strTimeValue) |
| | | { |
| | | var timeValue = int.Parse(strTimeValue); |
| | | //因为调试软件上传为空过; |
| | | string intTimeValue = string.IsNullOrEmpty(strTimeValue) ? "0" : strTimeValue; |
| | | var timeValue = int.Parse(intTimeValue); |
| | | string state = ""; |
| | | var minutes = timeValue / 60; |
| | | var seconds = timeValue % 60; |
| | |
| | | var list2 = this.GetVideoDeviceList(); |
| | | list.AddRange(list1); |
| | | list.AddRange(list2); |
| | | GetTestDevice(ref list, false); |
| | | GetTestDevice(ref list, true); |
| | | return list; |
| | | } |
| | | /// <summary> |
| | |
| | | |
| | | return roomName.TrimEnd(','); |
| | | } |
| | | #region 动一改四 |
| | | |
| | | /// <summary> |
| | | /// 获取设备类型图标 |
| | | /// </summary> |
| | | /// <param name="device">设备</param> |
| | | /// <returns></returns> |
| | | public string GetDeviceIconPath(Function device) |
| | | { |
| | | |
| | | if (SPK.MusicStandard == device.spk |
| | | || SPK.AvMusic == device.spk) |
| | | { |
| | | return "MusicIcon/localMusic.png"; |
| | | } |
| | | //LogicIcon/heatlogic.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 functionType) |
| | | public string GetIconPath(string spk) |
| | | { |
| | | string strPath = ""; |
| | | switch (functionType) |
| | | switch (spk) |
| | | { |
| | | case SPK.IpCam_Imou: |
| | | { |
| | | strPath = $"FunctionIcon/Icon/{SPK.IpCam_Imou.Replace(".", "")}.png"; |
| | | } |
| | | break; |
| | | case SPK.MechanicalArm: |
| | | { |
| | | strPath = "LogicIcon/lightloguc.png"; |
| | |
| | | strPath = "MusicIcon/localMusic.png"; |
| | | } |
| | | break; |
| | | |
| | | } |
| | | return strPath; |
| | | } |
| | | #region 动一改三 |
| | | /// <summary> |
| | | /// 设备类型的列表(灯光类,窗帘类。。。) |
| | | /// </summary> |
| | |
| | | { |
| | | deviceStrTypeList.Add(Language.StringByID(StringId.jixieshou)); |
| | | } |
| | | ///摄像头类 |
| | | var camera = deviceList.Find((device) => |
| | | device.spk == SPK.IpCam_Imou); |
| | | if (camera != null) |
| | | { |
| | | deviceStrTypeList.Add(Language.StringByID(StringId.shexiangtou)); |
| | | } |
| | | return deviceStrTypeList; |
| | | |
| | | } |
| | |
| | | else if (deviceType == Language.StringByID(StringId.VideoIntercom)) |
| | | { |
| | | functionTypeList.Add(SPK.doorgate); |
| | | } ///机械手类 |
| | | } |
| | | ///机械手类 |
| | | else if (deviceType == Language.StringByID(StringId.jixieshou)) |
| | | { |
| | | functionTypeList.Add(SPK.MechanicalArm); |
| | | } |
| | | ///摄像头类 |
| | | else if (deviceType == Language.StringByID(StringId.shexiangtou)) |
| | | { |
| | | functionTypeList.Add(SPK.IpCam_Imou); |
| | | } |
| | | else |
| | | { |
| | |
| | | functionTypeList.Add(SPK.AvMusic); |
| | | functionTypeList.Add(SPK.doorgate); |
| | | functionTypeList.Add(SPK.MechanicalArm); |
| | | functionTypeList.Add(SPK.IpCam_Imou); |
| | | |
| | | } |
| | | |
| | |
| | | deviceTypeList.Add(SPK.SensorHelp); |
| | | deviceTypeList.Add(SPK.DoorLock); |
| | | deviceTypeList.Add(SPK.doorgate); |
| | | deviceTypeList.Add(SPK.IpCam_Imou); |
| | | |
| | | } |
| | | break; |
| | |
| | | return list; |
| | | } |
| | | /// <summary> |
| | | /// 网关ID(获取嘉乐网关ID) |
| | | /// 网关ID(获取网关ID) |
| | | /// </summary> |
| | | public string GatewayId |
| | | { |
| | |
| | | // new Entity.Function { sid = "1234567891", name = "温度传感器", spk = Entity.SPK.SensorTemperature }, |
| | | // new Entity.Function { sid = "1234567892", name = "湿度传感器", spk = Entity.SPK.SensorHumidity }, |
| | | new Entity.Function { sid = "12345678933456", name = "调光灯", spk = Entity.SPK.LightDimming }, |
| | | new Entity.Function { sid = "1234567895444", name = "cct", spk = Entity.SPK.LightCCT }, |
| | | new Entity.Function { sid = "1234567895444", name = "面板", spk = Entity.SPK.PanelSocket }, |
| | | //new Entity.Function { sid = "1234567896", name = "毫米波传感器", spk = Entity.SPK.SenesorMegahealth }, |
| | | // new Entity.Function { sid = "1234567897", name = "毫米波传感器1", spk = Entity.SPK.SenesorMegahealth2 }, |
| | | // new Entity.Function { sid = "1234567899", name = "门磁传感器", spk = Entity.SPK.SensorDoorWindow }, |
| | |
| | | #region 编辑设备状态 |
| | | switch (device.spk) |
| | | { |
| | | |
| | | //插座(有USB) |
| | | case SPK.PanelSocket: |
| | | { |
| | | #region 界面 |
| | | ///总控开关 |
| | | LogicView.FunTypeView view1 = new LogicView.FunTypeView(); |
| | | view1.btnText.TextID = StringId.zongkogkaiguan; |
| | | view1.btnState.Name = "总控开关"; |
| | | fLayout.AddChidren(view1.FLayoutView()); |
| | | ///设备延时iewv |
| | | DelayView(fLayout, view1.frameLayout.Bottom); |
| | | #endregion |
| | | #region 点击事件 |
| | | ///总控开关点击事件 |
| | | view1.btnClick.MouseUpEventHandler += (sender, e) => |
| | | { |
| | | SwitchViewMethod(device, view1.btnState, 2); |
| | | }; |
| | | if (edit) |
| | | { |
| | | //显示编辑之前的设备状态 |
| | | GetEditDeviceState(device, index, view1.btnState, null, null, null); |
| | | } |
| | | #endregion |
| | | } |
| | | break; |
| | | //开关灯光 |
| | | case SPK.AirSwitch: |
| | | case SPK.LightSwitch: |
| | | //插座 |
| | | case SPK.PanelSocket: |
| | | case SPK.ElectricSocket: |
| | | //机械手 |
| | | case SPK.MechanicalArm: |
| | |
| | | selectedState = device.spk + "_" + strValue; |
| | | //设备属性值,云雀上定义好的; |
| | | string keyVlaue = "on_off"; |
| | | switch (device.spk) |
| | | { |
| | | case SPK.PanelSocket: |
| | | { |
| | | if (button.Name == "总控开关") |
| | | { |
| | | keyVlaue = "on_off_master"; |
| | | } |
| | | } |
| | | break; |
| | | } |
| | | //数据封装 |
| | | AddDictionary(keyVlaue, strValue); |
| | | }); |