wei
2021-07-09 068c68295cad1967f7aafb4e5e951260ef03d4ce
HDL_ON/UI/UI2/2-Classification/ClassificationPageBLL.cs
@@ -108,22 +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.curValue.ToString() == "on").Count.ToString();
                                                            btnText = FunctionList.List.GetAirFreshList().FindAll((obj) => obj.trait_on_off.state.ToString() == "on").Count.ToString();
                                                            break;
                                                    }
                                                    if (btn.Tag.ToString() == functionCategory + "_onCount")
@@ -168,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;
                                }
@@ -185,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)
                                        {
@@ -215,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);
                            }
@@ -237,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;
@@ -344,9 +344,9 @@
                                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(sleepTime);
                                    }
@@ -354,9 +354,9 @@
                                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(sleepTime);
                                    }
@@ -364,9 +364,9 @@
                                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(sleepTime);
                                    }
@@ -374,9 +374,9 @@
                                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(sleepTime);
                                    }
@@ -384,9 +384,9 @@
                                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(sleepTime);
                                    }
@@ -472,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);
                        }
@@ -503,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);
                }
            };