| | |
| | | //用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; |