xm
2019-07-16 b910cb79c9b5bcc204022a3cf9e6950f0a64dfbd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
using System;
using System.Collections.Generic;
using System.Text;
using ZigBee.Device;
 
namespace Shared.Phone.UserCenter
{
    /// <summary>
    /// 安防的业务逻辑类
    /// </summary>
    public class SafeguardLogic
    {
        /// <summary>
        /// 获取灯光类型的报警目标的状态文本
        /// </summary>
        /// <param name="listTaskInfo">动作对象,可以为空</param>
        /// <returns></returns>
        public static string GetLightAlarmStatuText(List<Safeguard.TaskListInfo> listTaskInfo)
        {
            if (listTaskInfo == null)
            {
                //无动作
                return Language.StringByID(R.MyInternationalizationString.uNotAction);
            }
            //要考虑它的排列顺序(可以按需求变更编号)
            Dictionary<int, string> dicSort = new Dictionary<int, string>();
            //开关的位置编号
            int ControlNo = 0;
 
            foreach (var info in listTaskInfo)
            {
                //开关控制
                if (info.Data1 == 1)
                {
                    //开
                    dicSort[ControlNo] = Language.StringByID(R.MyInternationalizationString.uSimpleOpen);
                }
                else
                {
                    //关
                    dicSort[ControlNo] = Language.StringByID(R.MyInternationalizationString.uSimpleClose);
                }
            }
 
            //拼接文本
            string txtvalue = string.Empty;
            for (int i = 0; i < dicSort.Count; i++)
            {
                txtvalue += dicSort[i] + " ";
            }
 
            return txtvalue.Trim();
        }
    }
}