wei
2021-07-09 068c68295cad1967f7aafb4e5e951260ef03d4ce
HDL_ON/UI/UI2/2-Classification/ClassificationPageBLL.cs
@@ -51,6 +51,10 @@
                        case SPK.ClothesHanger:
                            vv = ShowFunction.Electric;
                            break;
                        case SPK.AirFreshJinmao:
                        case SPK.AirFreshStandard:
                            vv = ShowFunction.FreshAir;
                            break;
                    }
                    UpdataFunctionOnCount(vv, function.spk);
                    UpdataCloseAllButton(function);
@@ -104,19 +108,22 @@
                                                    switch (functionCategory)
                                                    {
                                                        case ShowFunction.FloorHeating:
                                                            btnText = FunctionList.List.GetFloorHeatingList().FindAll((obj) => obj.trait_on_off.curValue.ToString() == "on").Count.ToString();
                                                            btnText = FunctionList.List.GetFloorHeatingList().FindAll((obj) => obj.trait_on_off.state.ToString() == "on").Count.ToString();
                                                            break;
                                                        case ShowFunction.AC:
                                                            btnText = FunctionList.List.GetAcList().FindAll((obj) => obj.trait_on_off.curValue.ToString() == "on").Count.ToString();
                                                            btnText = FunctionList.List.GetAcList().FindAll((obj) => obj.trait_on_off.state.ToString() == "on").Count.ToString();
                                                            break;
                                                        case ShowFunction.Curtain:
                                                            btnText = FunctionList.List.GetCurtainList().FindAll((obj) => obj.trait_on_off.curValue.ToString() == "on").Count.ToString();
                                                            btnText = FunctionList.List.GetCurtainList().FindAll((obj) => obj.trait_on_off.state.ToString() == "on").Count.ToString();
                                                            break;
                                                        case ShowFunction.Light:
                                                            btnText = FunctionList.List.GetLightList().FindAll((obj) => obj.trait_on_off.curValue.ToString() == "on").Count.ToString();
                                                            btnText = FunctionList.List.GetLightList().FindAll((obj) => obj.trait_on_off.state.ToString() == "on").Count.ToString();
                                                            break;
                                                        case ShowFunction.Electric:
                                                            btnText = FunctionList.List.GetElectricals().FindAll((obj) => obj.trait_on_off.curValue.ToString() == "on").Count.ToString();
                                                            btnText = FunctionList.List.GetElectricals().FindAll((obj) => obj.trait_on_off.state.ToString() == "on").Count.ToString();
                                                            break;
                                                        case ShowFunction.FreshAir:
                                                            btnText = FunctionList.List.GetAirFreshList().FindAll((obj) => obj.trait_on_off.state.ToString() == "on").Count.ToString();
                                                            break;
                                                    }
                                                    if (btn.Tag.ToString() == functionCategory + "_onCount")
@@ -161,7 +168,7 @@
                            var btn = view1.GetChildren(j) as Button;
                            if (btn.Tag != null && btn.Tag.ToString() == "AllClose")
                            {
                                if (function.trait_on_off.curValue.ToString() == "on")
                                if (function.trait_on_off.state.ToString() == "on")
                                {
                                    btn.Visible = true;
                                }
@@ -178,7 +185,7 @@
                                        {
                                            continue;
                                        }
                                        var ssd = r.GetRoomFunctions(false).FindAll((obj) => obj.trait_on_off.curValue.ToString() == "on");
                                        var ssd = r.GetRoomFunctions(false).FindAll((obj) => obj.trait_on_off.state.ToString() == "on");
                                        var sss = ssd.Count;
                                        if (sss == 0)
                                        {
@@ -208,9 +215,9 @@
                        {
                            foreach (var f in room.GetRoomFunctions(false))
                            {
                                f.trait_on_off.curValue = "off";
                                f.trait_on_off.state = "off";
                                Dictionary<string, string> d = new Dictionary<string, string>();
                                d.Add("on_off", f.trait_on_off.curValue.ToString());
                                d.Add("on_off", f.trait_on_off.state.ToString());
                                Control.Ins.SendWriteCommand(f, d);
                            }
@@ -230,7 +237,7 @@
                };
                foreach (var f in room.GetRoomFunctions(false))
                {
                    if (f.trait_on_off.curValue.ToString() == "on")
                    if (f.trait_on_off.state.ToString() == "on")
                    {
                        btn.Visible = true;
                        break;
@@ -324,8 +331,12 @@
                {
                    try
                    {
                        //全开全关
                        //if (DB_ResidenceData.Instance.GatewayType == 0 && !Control.Ins.IsRemote)
                        //休眠时间(ms)
                        int sleepTime = 100;
                        if(DB_ResidenceData.Instance.GatewayType == 0)
                        {
                            sleepTime = 200;
                        }
                        if (Control.Ins.GatewayOnline_Local)
                        {
                            switch (functionCategory)
@@ -333,51 +344,51 @@
                                case ShowFunction.AC:
                                    foreach (var f in FunctionList.List.GetAcList())
                                    {
                                        f.trait_on_off.curValue = onoff;
                                        f.trait_on_off.state = onoff;
                                        Dictionary<string, string> d = new Dictionary<string, string>();
                                        d.Add(FunctionAttributeKey.OnOff, f.trait_on_off.curValue.ToString());
                                        d.Add(FunctionAttributeKey.OnOff, f.trait_on_off.state.ToString());
                                        Control.Ins.SendWriteCommand(f, d);
                                        System.Threading.Thread.Sleep(100);
                                        System.Threading.Thread.Sleep(sleepTime);
                                    }
                                    break;
                                case ShowFunction.FloorHeating:
                                    foreach (var f in FunctionList.List.GetFloorHeatingList())
                                    {
                                        f.trait_on_off.curValue = onoff;
                                        f.trait_on_off.state = onoff;
                                        Dictionary<string, string> d = new Dictionary<string, string>();
                                        d.Add(FunctionAttributeKey.OnOff, f.trait_on_off.curValue.ToString());
                                        d.Add(FunctionAttributeKey.OnOff, f.trait_on_off.state.ToString());
                                        Control.Ins.SendWriteCommand(f, d);
                                        System.Threading.Thread.Sleep(100);
                                        System.Threading.Thread.Sleep(sleepTime);
                                    }
                                    break;
                                case ShowFunction.Light:
                                    foreach (var f in FunctionList.List.GetLightList())
                                    {
                                        f.trait_on_off.curValue = onoff;
                                        f.trait_on_off.state = onoff;
                                        Dictionary<string, string> d = new Dictionary<string, string>();
                                        d.Add(FunctionAttributeKey.OnOff, f.trait_on_off.curValue.ToString());
                                        d.Add(FunctionAttributeKey.OnOff, f.trait_on_off.state.ToString());
                                        Control.Ins.SendWriteCommand(f, d);
                                        System.Threading.Thread.Sleep(100);
                                        System.Threading.Thread.Sleep(sleepTime);
                                    }
                                    break;
                                case ShowFunction.Electric:
                                    foreach (var f in FunctionList.List.GetElectricals())
                                    {
                                        f.trait_on_off.curValue = onoff;
                                        f.trait_on_off.state = onoff;
                                        Dictionary<string, string> d = new Dictionary<string, string>();
                                        d.Add(FunctionAttributeKey.OnOff, f.trait_on_off.curValue.ToString());
                                        d.Add(FunctionAttributeKey.OnOff, f.trait_on_off.state.ToString());
                                        Control.Ins.SendWriteCommand(f, d);
                                        System.Threading.Thread.Sleep(100);
                                        System.Threading.Thread.Sleep(sleepTime);
                                    }
                                    break;
                                case ShowFunction.FreshAir:
                                    foreach (var f in FunctionList.List.GetAirFreshList())
                                    {
                                        f.trait_on_off.curValue = onoff;
                                        f.trait_on_off.state = onoff;
                                        Dictionary<string, string> d = new Dictionary<string, string>();
                                        d.Add(FunctionAttributeKey.OnOff, f.trait_on_off.curValue.ToString());
                                        d.Add(FunctionAttributeKey.OnOff, f.trait_on_off.state.ToString());
                                        Control.Ins.SendWriteCommand(f, d);
                                        System.Threading.Thread.Sleep(100);
                                        System.Threading.Thread.Sleep(sleepTime);
                                    }
                                    break;
                            }
@@ -461,10 +472,10 @@
                    {
                        foreach (var f in FunctionList.List.GetCurtainList())
                        {
                            f.trait_on_off.curValue = "on";
                            f.trait_on_off.state = "on";
                            f.SetAttrState(FunctionAttributeKey.Percent, "100");
                            Dictionary<string, string> d = new Dictionary<string, string>();
                            d.Add("on_off", f.trait_on_off.curValue.ToString());
                            d.Add("on_off", f.trait_on_off.state.ToString());
                            Control.Ins.SendWriteCommand(f, d);
                            System.Threading.Thread.Sleep(100);
                        }
@@ -492,10 +503,10 @@
                btnOpen.IsSelected = false;
                foreach (var f in FunctionList.List.GetCurtainList())
                {
                    f.trait_on_off.curValue = "off";
                    f.trait_on_off.state = "off";
                    f.SetAttrState(FunctionAttributeKey.Percent, "0");
                    Dictionary<string, string> d = new Dictionary<string, string>();
                    d.Add("on_off", f.trait_on_off.curValue.ToString());
                    d.Add("on_off", f.trait_on_off.state.ToString());
                    Control.Ins.SendWriteCommand(f, d);
                }
            };