using System;
|
using System.Collections.Generic;
|
|
namespace Shared.Common
|
{
|
|
public class Logic
|
{
|
public static List<Logic> LogicList = new List<Logic>();
|
public static List<Logic> LockLogicList = new List<Logic>();
|
public static List<ZigBee.Device.CommonDevice> LogicDviceList = new List<ZigBee.Device.CommonDevice>();
|
public static Logic CurrentLogic;
|
/// <summary>
|
///0:获取成功
|
///<para>1:该逻辑不存在。</para>
|
///<para>以下所有字段只有在Result 为1时存在</para>
|
/// </summary>
|
public int Result;
|
/// <summary>
|
/// 0.正常自动化;1.门锁自动化
|
/// </summary>
|
public int LogicType = 0;
|
/// <summary>
|
/// 逻辑ID
|
/// </summary>
|
public int LogicId;
|
/// <summary>
|
///该逻辑是否被使能。
|
///<para>0:禁用该逻辑</para>
|
///<para>1:使能该逻辑</para>
|
///<para>2: 只触发一次。触发后该字段将自动置为0,即禁用状态。</para>
|
/// </summary>
|
public int IsEnable;
|
|
/// <summary>
|
///逻辑名称
|
/// </summary>
|
public string LogicName;
|
|
/// <summary>
|
///逻辑关系。
|
///<para>0:满足所有条件触发动作</para>
|
///<para>1:满足其中一个条件触发动作</para>
|
/// </summary>
|
public int Relationship;
|
/// <summary>
|
/// 推送内容
|
/// </summary>
|
public string LogicCustomPushText=string.Empty;
|
/// <summary>
|
/// 记录推送开关状态
|
/// </summary>
|
public int LogicIsCustomPushText = 0;
|
|
//public Dictionary<string, string> TimeAttribute = new Dictionary<string, string>();
|
public TimeAttributeObj TimeAttribute = new TimeAttributeObj();
|
/// <summary>
|
/// 逻辑条件列表
|
/// </summary>
|
public List<Dictionary<string, string>> Conditions = new List<Dictionary<string, string>>();
|
|
/// <summary>
|
/// 条件满足后执行的动作列表
|
/// </summary>
|
public List<Dictionary<string, object>> Actions = new List<Dictionary<string, object>>();
|
|
/// <summary>
|
/// 关联app账号列表
|
/// </summary>
|
public List<Dictionary<string, string>> Accounts = new List<Dictionary<string, string>>();
|
|
}
|
|
/// <summary>
|
/// 描述逻辑时间属性
|
/// </summary>
|
[System.Serializable]
|
public class TimeAttributeObj
|
{
|
public int Calendar;
|
public int Repeat = 2;
|
public int WeekDay;
|
public int SetYear;
|
public int MonthDate;
|
public int SelectMonth;
|
public List<int> SelectMonDate = new List<int>();
|
}
|
|
|
}
|