using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Domain;
using System.Collections.Concurrent;

namespace CommonEntity
{

    /// <summary>
    /// 这个类是 组合 式的
    /// 
    /// 意思是 根据类型，来选取相应的字段
    /// 比如说 空调只就需要使用空调的
    /// 调光灯 只需要 一个亮度。
    /// 
    /// 这样修改最原来的代码是 最简单，最快的，但是不是最合理的
    /// 
    /// 如果分开写的话，设备类型太多，写不过来
    /// </summary>
    public class HostModal_Cache
    {
        public int HostID { get; set; }
        /// <summary>
        /// 设备的一些基础信息，如地址，名称
        /// </summary>
        public RoomTypeModalCache Modal { get; set; }

        /// <summary>
        /// 当前设备是 空调 灯光
        /// </summary>
        public DeviceType ModalType { get; set; }

        /// <summary>
        /// 调光亮度
        /// </summary>
        public int Brightness { get; set; }

        /// <summary>
        /// 开关状态
        /// </summary>
        public int Status { get; set; }


        /// <summary>
        /// 空调
        /// </summary>
        public AirConditionData AirConditionData { get; set; }

        public DateTime? UpdateTime { get; set; }
        public int Time { get; set; }

    }
    public class AirConditionData
    {
        /// <summary>
        /// 开关
        /// </summary>
        public int AirStatus { get; set; }
        /// <summary>
        /// 当前温度
        /// </summary>
        public int CurrentTemp { get; set; }
        /// <summary>
        /// 设定温度
        /// </summary>
        public int SettingTemp { get; set; }
        /// <summary>
        /// 风速
        /// </summary>
        public int FanSpeed { get; set; }
        /// <summary>
        /// 模式
        /// </summary>
        public int Mode { get; set; }
        /// <summary>
        /// 阀门
        /// </summary>
        public int Valve { get; set; }
        /// <summary>
        /// 当天开启时长
        /// </summary>
        public int Time { get; set; }

        public DateTime? UpdateTime { get; set; }
        public AirConditionData()
        {
            this.AirStatus=2;
            this.FanSpeed=0;
            this.Mode=0;
            this.Valve=0;
            this.CurrentTemp = 25;
            this.SettingTemp = 25;
            this.Valve = 0;
            this.Time = 0;
            this.UpdateTime=DateTime.Now;
        }
    }

    public class RoomTypeModalCache
    {
        public int ID { get; set; }

        /// <summary>
        /// 设备的名字
        /// </summary>
        public string Name { get; set; }
        /// <summary>
        /// 设备的地址
        /// </summary>
        public string ModalAddress { get; set; }

        /// <summary>
        /// 设备所属的房型
        /// </summary>
        public int RoomTypeID { get; set; }
        public int Sort { get; set; }
        public bool ActiveIndicator { get; set; }
    }
}
