wei
2020-12-23 35c4bc03ee8da50317cd3f33e9f52f0a4259affd
Merge remote-tracking branch 'origin/WJC' into NewFilePath
3个文件已修改
41 ■■■■■ 已修改文件
HDL_ON/UI/UI2/3-Intelligence/Automation/LogicMethod.cs 20 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/3-Intelligence/Automation/LogicView/brightnessView.cs 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/3-Intelligence/Automation/TargetDeviceFunList.cs 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/3-Intelligence/Automation/LogicMethod.cs
@@ -5,7 +5,7 @@
namespace HDL_ON.UI.UI2.Intelligence.Automation
{
    public  class  LogicMethod
    public class LogicMethod
    {
        /// <summary>
        /// 表示是条件
@@ -141,8 +141,9 @@
            room1.uid = "全部区域";//默认sid用识别该房间
            roomList.Add(room1);//默认添加到房间列表里
            var roomLists = GetGatewayRoomList();
            foreach (var room in roomLists)
            for (int i = 0; i < roomLists.Count; i++)
            {
                var room = roomLists[i];
                var devlist = GetRoomDevice(room);
                if (devlist.Count == 0)
                {
@@ -202,8 +203,9 @@
        {
            HDL_ON.Entity.Function device = new Entity.Function() { name = "Unknown" };
            List<HDL_ON.Entity.Function> deviceLists = GetGatewayDeviceList();
            foreach (var dev in deviceLists)
            for (int i = 0; i < deviceLists.Count; i++)
            {
                var dev = deviceLists[i];
                if (dev.sid == sid)
                {
                    device = dev;
@@ -222,8 +224,9 @@
        {
            HDL_ON.Entity.Scene scene = new Entity.Scene() { name = "Unknown" };
            List<HDL_ON.Entity.Scene> sceneLists = GetSceneList();
            foreach (var sce in sceneLists)
            for (int i = 0; i < sceneLists.Count; i++)
            {
                var sce = sceneLists[i];
                if (sce.sid == sid)
                {
                    scene = sce;
@@ -242,8 +245,10 @@
            string roomName = "";
            List<HDL_ON.Entity.Room> roomLists = GetGatewayRoomList();
            foreach (var dev in device.roomIds)
            for (int i = 0; i < device.roomIds.Count; i++)
            {
                var dev = device.roomIds[i];
                var room = roomLists.Find((c) => c.uid == dev);
                if (room != null)
                {
@@ -409,14 +414,17 @@
        public static List<Entity.Function> GetShowDeviceList(List<FunctionType> functionType, List<HDL_ON.Entity.Function> deviceList)
        {
            List<HDL_ON.Entity.Function> devList = new List<Entity.Function>();
            foreach (var dev in deviceList)
            for (int i = 0; i < deviceList.Count; i++)
            {
                var dev = deviceList[i];
                if (functionType.Contains(dev.functionType))
                {
                    ///过滤掉不需要显示的设备
                    devList.Add(dev);
                }
            }
            return devList;
        }
        /// <summary>
HDL_ON/UI/UI2/3-Intelligence/Automation/LogicView/brightnessView.cs
@@ -122,12 +122,17 @@
        /// <summary>
        /// View的方法
        /// </summary>
        /// <param name="fLayout">父控件</param>
        /// <param name="frame">父控件</param>
        /// <param name="titleName">标题名称</param>
        /// <param name="stateValue">之前状态值</param>
        /// <param name="action">返回回调</param>
        public void FLayoutView(FrameLayout fLayout, string titleName,string stateValue, Action<string> action)
        public void FLayoutView(FrameLayout frame, string titleName,string stateValue, Action<string> action)
        {
            FrameLayout fLayout = new FrameLayout
            {
                BackgroundColor = CSS.CSS_Color.viewTrans60lucence,
            };
            frame.AddChidren(fLayout);
            fLayout.AddChidren(frameLayout);
            frameLayout.AddChidren(btnTitle);
            frameLayout.AddChidren(btnCancel);
@@ -145,8 +150,8 @@
                try
                {
                    //进来的状态
                    brightnesValue = int.Parse(stateValue);
                    seekBarVol.Progress = int.Parse(stateValue);
                    brightnesValue = int.Parse(stateValue.Replace("%", ""));
                    seekBarVol.Progress = brightnesValue;
                }
                catch { }
            }
HDL_ON/UI/UI2/3-Intelligence/Automation/TargetDeviceFunList.cs
@@ -502,14 +502,10 @@
        private void BrightnessMethod(Entity.Function device, Button button, string titleName)
        {
            #region 界面
            FrameLayout frame = new FrameLayout
            {
                BackgroundColor = CSS.CSS_Color.viewTrans60lucence,
            };
            this.AddChidren(frame);
            //之前的状态值
            string stateVlaue = button.Text;
            LogicView.BrightnessView brightness = new LogicView.BrightnessView();
            brightness.FLayoutView(frame, titleName, stateVlaue, (brightnesValue) =>
            brightness.FLayoutView(this, titleName, stateVlaue, (brightnesValue) =>
            {
                //界面显示选中值
                button.Text = brightnesValue+"%";