xm
2020-04-16 6fa9d69da922c8049f5acfcbb9ce9fd26811024c
ZigbeeApp/Shared/Common/SceneTargetDeviceUI.cs
@@ -1,6 +1,7 @@
using System;
using System.Collections.Generic;
using System.Globalization;
using ZigBee.Device;
using static ZigBee.Device.Scene;
namespace Shared.Common
@@ -19,12 +20,12 @@
        /// 任务列表中的数据列表
        /// Type=0 存在
        /// </summary>
        public List<TaskListInfo> TaskList = new List<TaskListInfo>();
        public List<Safeguard.TaskListInfo> TaskList = new List<Safeguard.TaskListInfo>();
        /// <summary>
        /// 选择的设备
        /// Type=0 存在
        /// </summary>
        public DeviceUI DeviceUI = new DeviceUI();
        public CommonDevice DeviceUI = new CommonDevice();
        /// <summary>
        /// Type=0、1、2 存在
@@ -56,13 +57,7 @@
        /// 唯一标识--HashCode
        /// DateTime.Now.ToString("yyyyMMddHHmmss", DateTimeFormatInfo.InvariantInfo)
        /// </summary>
        public string SceneTargetDeviceUIID
        {
            get
            {
                return GetHashCode().ToString();
            }
        }
        public string SceneTargetDeviceUIID = Guid.NewGuid().ToString();
        /// <summary>
        /// GetDeviceStatu
@@ -70,7 +65,7 @@
        /// <returns></returns>
        public string GetDeviceStatu()
        {
            if (DeviceUI.CommonDevice.Type == ZigBee.Device.DeviceType.OnOffOutput)
            if (DeviceUI.Type == ZigBee.Device.DeviceType.OnOffOutput)
            {
                if (TaskList.Count == 0)
                {
@@ -82,7 +77,7 @@
                }
                return Language.StringByID(R.MyInternationalizationString.Shut);
            }
            else if (DeviceUI.CommonDevice.Type == ZigBee.Device.DeviceType.AirSwitch)
            else if (DeviceUI.Type == ZigBee.Device.DeviceType.AirSwitch)
            {
                if (TaskList.Count == 0)
                {
@@ -94,7 +89,7 @@
                }
                return Language.StringByID(R.MyInternationalizationString.Shut);
            }
            else if (DeviceUI.CommonDevice.Type == ZigBee.Device.DeviceType.DimmableLight)
            else if (DeviceUI.Type == ZigBee.Device.DeviceType.DimmableLight)
            {
                if (TaskList.Count == 0)
                {
@@ -106,7 +101,7 @@
                }
                return $"{(int)(TaskList[0].Data1 * 1.0 / 254 * 100)}%";
            }
            else if (DeviceUI.CommonDevice.Type == ZigBee.Device.DeviceType.WindowCoveringDevice)
            else if (DeviceUI.Type == ZigBee.Device.DeviceType.WindowCoveringDevice)
            {
                if (TaskList.Count == 0)
                {
@@ -118,7 +113,7 @@
                }
                return $"{TaskList[0].Data2}%";
            }
            else if (DeviceUI.CommonDevice.Type == ZigBee.Device.DeviceType.Thermostat)
            else if (DeviceUI.Type == ZigBee.Device.DeviceType.Thermostat)
            {
                //温度,模式,风速
                string tempareture = string.Empty;