From 4e343aa2d3bba9e1dc5519afa2564a230c556496 Mon Sep 17 00:00:00 2001 From: 陈嘉乐 <cjl@hdlchina.com.cn> Date: 星期五, 05 二月 2021 15:13:14 +0800 Subject: [PATCH] 2021-2-5-1 --- Crabtree/SmartHome/HDL/Operation/ResponseEntity/Timer.cs | 125 ++++++++++++++++++++++++----------------- 1 files changed, 73 insertions(+), 52 deletions(-) diff --git a/Crabtree/SmartHome/HDL/Operation/ResponseEntity/Timer.cs b/Crabtree/SmartHome/HDL/Operation/ResponseEntity/Timer.cs index 27aef8f..d9d0404 100644 --- a/Crabtree/SmartHome/HDL/Operation/ResponseEntity/Timer.cs +++ b/Crabtree/SmartHome/HDL/Operation/ResponseEntity/Timer.cs @@ -1,5 +1,6 @@ 锘縰sing System; using Shared.SimpleControl; +using System.Collections.Generic; namespace Shared { @@ -10,50 +11,59 @@ 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> /// 鏃跺尯 @@ -65,55 +75,66 @@ 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 娣诲姞瀹氭椂鍣� - //褰撳畾鏃跺櫒閲嶅绫诲瀷涓烘瘡鏃ャ�佸伐浣滄棩銆佸懆鏈紝鍙~鍏匱imerType - //濡傛灉鏈寚瀹氭槦鏈熷嚑Week锛屽~鍏匬eriodicity + [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 缂栬緫瀹氭椂鍣� - //褰撳畾鏃跺櫒閲嶅绫诲瀷涓烘瘡鏃ャ�佸伐浣滄棩銆佸懆鏈紝鍙~鍏匱imerType - //濡傛灉鏈寚瀹氭槦鏈熷嚑Week锛屽~鍏匬eriodicity - - //GetOneTimerInfo 璇诲彇涓�涓畾鏃跺櫒淇℃伅 - //濉厖Id 瀛楁灏辫浜� - - //GetTimerList 璇诲彇瀹氭椂鍣ㄥ垪琛� 濉厖 GatewayId瀛楁 - - //IsEnableTimer 鍚敤鎴栫鐢ㄥ畾鏃跺櫒 濉厖Id 瀛楁灏辫浜� - - //DeleteTimer 鍒犻櫎瀹氭椂鍣� 濉厖Id 瀛楁灏辫浜� - #endregion } -- Gitblit v1.8.0