| | |
| | | using System; |
| | | using Shared.SimpleControl; |
| | | using System.Collections.Generic; |
| | | |
| | | namespace Shared |
| | | { |
| | |
| | | |
| | | public string RequestSource = MainPage.RequestSource; |
| | | |
| | | public static List<Function> deviceList = new List<Function> (); |
| | | |
| | | /// <summary> |
| | | /// 定时器的唯一ID |
| | | /// </summary> |
| | | public string Id { get; set; } |
| | | |
| | | public string id { get; set; } |
| | | /// <summary> |
| | | /// 用户Id |
| | | /// </summary> |
| | | public string userId { get; set; } |
| | | /// <summary> |
| | | /// 定时器备注名 |
| | | /// </summary> |
| | | public string TimerName { get; set; } |
| | | public string timerName { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 住宅ID |
| | | /// </summary> |
| | | public string gatewayId { get; set; } |
| | | /// <summary> |
| | | /// 网关ID |
| | | /// </summary> |
| | | public string RegionID { get; set; } |
| | | public string homeId { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 执行时间点 |
| | | /// </summary> |
| | | public string ExecutionTime { get; set; } |
| | | public string executeUtcTime { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 重复周期 |
| | | /// </summary> |
| | | public string Periodicity { get; set; } |
| | | public List<int> whichDay = new List<int> (); |
| | | |
| | | /// <summary> |
| | | /// 是否启用 |
| | | /// 是否启用(默认开启) |
| | | /// </summary> |
| | | public bool IsStart { get; set; } |
| | | public bool isEnable = true; |
| | | |
| | | /// <summary> |
| | | /// 定时器重复类型 |
| | | /// </summary> |
| | | public TimerType TimerType { get; set; } |
| | | public TimerType timerType { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 控制的设备数据 |
| | | /// </summary> |
| | | public string ControlDeviceData =""; |
| | | public DeviceDate controlData = new DeviceDate (); |
| | | |
| | | /// <summary> |
| | | /// 房间名称 |
| | | /// </summary> |
| | | public string RoomName { get; set; } |
| | | public string RoomName = "ALL"; |
| | | |
| | | /// <summary> |
| | | /// 时区 |
| | |
| | | public enum TimerType |
| | | { |
| | | EveryDay = 0, //每天 |
| | | WorkingDay, //工作日 |
| | | Weekend, //周末 |
| | | Week, //指定星期几 |
| | | WorkingDay = 1, //工作日 |
| | | Weekend = 2, //周末 |
| | | Week = 3, //指定星期几 |
| | | Period, //指定时间段 |
| | | AppointDay, //指定日 |
| | | |
| | | |
| | | } |
| | | |
| | | #region 通讯 |
| | | public class DeviceInfo |
| | | |
| | | [Serializable] |
| | | public class DeviceDate |
| | | { |
| | | public string DevicePath { get; set; } |
| | | |
| | | public int DeviceType { get; set; } |
| | | /// <summary> |
| | | /// 住宅ID |
| | | /// </summary> |
| | | public string gatewayId { get; set; } |
| | | /// <summary> |
| | | /// 网关ID |
| | | /// </summary> |
| | | public string homeId { get; set; } |
| | | |
| | | public byte SubnetID { get; set; } |
| | | |
| | | public byte DeviceID { get; set; } |
| | | |
| | | public byte LoopID { get; set; } |
| | | |
| | | public int Command { get; set; } |
| | | |
| | | public byte [] SendBytes { get; set; } |
| | | public DeviceType Type; |
| | | public string SavePath; |
| | | public string CommonLoopID { |
| | | get { |
| | | return SubnetID.ToString () + "_" + DeviceID.ToString () + "_" + LoopID.ToString (); |
| | | } |
| | | } |
| | | public string Name; |
| | | public List<Fun> actions = new List<Fun> (); |
| | | } |
| | | // AddTimer 添加定时器 |
| | | //当定时器重复类型为每日、工作日、周末,只填充TimerType |
| | | //如果未指定星期几Week,填充Periodicity |
| | | [Serializable] |
| | | public class Fun |
| | | { |
| | | /// <summary> |
| | | /// 设备ID |
| | | /// </summary> |
| | | public long deviceId = 0; |
| | | /// <summary> |
| | | /// 云雀定义spk |
| | | /// </summary> |
| | | public string spk = string.Empty; |
| | | /// <summary> |
| | | /// spk(设备)的属性列表 |
| | | /// </summary> |
| | | public List<Attributes> attributes = new List<Attributes> (); |
| | | public Bus bus = new Bus (); |
| | | } |
| | | [Serializable] |
| | | public class Attributes |
| | | { |
| | | |
| | | /// <summary> |
| | | /// "key":"on_off", |
| | | /// </summary> |
| | | public string key = "on_off"; |
| | | /// <summary> |
| | | /// "value":on/off |
| | | /// </summary> |
| | | public string value = string.Empty; |
| | | } |
| | | [Serializable] |
| | | public class Bus |
| | | { |
| | | public string addresses = string.Empty; |
| | | public string loopId = string.Empty; |
| | | } |
| | | |
| | | // EditTimer 编辑定时器 |
| | | //当定时器重复类型为每日、工作日、周末,只填充TimerType |
| | | //如果未指定星期几Week,填充Periodicity |
| | | |
| | | //GetOneTimerInfo 读取一个定时器信息 |
| | | //填充Id 字段就行了 |
| | | |
| | | //GetTimerList 读取定时器列表 填充 GatewayId字段 |
| | | |
| | | //IsEnableTimer 启用或禁用定时器 填充Id 字段就行了 |
| | | |
| | | //DeleteTimer 删除定时器 填充Id 字段就行了 |
| | | #endregion |
| | | |
| | | } |