xm
2021-12-01 6d73bf6e816570291865674bef8bce8972e4de3f
HDL_ON/UI/UI2/2-Classification/ClassificationPageBLL.cs
@@ -23,34 +23,29 @@
                try
                {
                    ShowFunction vv = ShowFunction.Light;
                    switch (function.spk)
                    if (SPK.ElectricalSpkList().Contains(function.spk))
                    {
                        case SPK.FloorHeatStandard:
                            vv = ShowFunction.FloorHeating;
                            break;
                        case SPK.AcStandard:
                            vv = ShowFunction.AC;
                            break;
                        case SPK.CurtainRoller:
                        case SPK.CurtainShades:
                        case SPK.CurtainSwitch:
                        case SPK.CurtainTrietex:
                            vv = ShowFunction.Curtain;
                            break;
                        case SPK.LightCCT:
                        case SPK.LightDimming:
                        case SPK.LightRGB:
                        case SPK.LightSwitch:
                            vv = ShowFunction.Light;
                            break;
                        case SPK.ElectricSocket:
                        case SPK.ElectricTuyaAirCleaner:
                        case SPK.ElectricTuyaFan:
                        case SPK.ElectricTuyaWaterValve:
                        case SPK.ElectricTuyaWeepRobot:
                        case SPK.ClothesHanger:
                            vv = ShowFunction.Electric;
                            break;
                        vv = ShowFunction.Electric;
                    }
                    else if (SPK.FhSpkList().Contains(function.spk))
                    {
                        vv = ShowFunction.FloorHeating;
                    }
                    else if (SPK.AcSpkList().Contains(function.spk))
                    {
                        vv = ShowFunction.AC;
                    }
                    else if (SPK.CurtainSpkList().Contains(function.spk))
                    {
                        vv = ShowFunction.Curtain;
                    }
                    else if (SPK.LightSpkList().Contains(function.spk))
                    {
                        vv = ShowFunction.Light;
                    }
                    else if (SPK.AirFreshSpkList().Contains(function.spk))
                    {
                        vv = ShowFunction.FreshAir;
                    }
                    UpdataFunctionOnCount(vv, function.spk);
                    UpdataCloseAllButton(function);
@@ -117,6 +112,9 @@
                                                            break;
                                                        case ShowFunction.Electric:
                                                            btnText = FunctionList.List.GetElectricals().FindAll((obj) => obj.trait_on_off.curValue.ToString() == "on").Count.ToString();
                                                            break;
                                                        case ShowFunction.FreshAir:
                                                            btnText = FunctionList.List.GetAirFreshList().FindAll((obj) => obj.trait_on_off.curValue.ToString() == "on").Count.ToString();
                                                            break;
                                                    }
                                                    if (btn.Tag.ToString() == functionCategory + "_onCount")
@@ -324,8 +322,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)
@@ -337,7 +339,7 @@
                                        Dictionary<string, string> d = new Dictionary<string, string>();
                                        d.Add(FunctionAttributeKey.OnOff, f.trait_on_off.curValue.ToString());
                                        Control.Ins.SendWriteCommand(f, d);
                                        System.Threading.Thread.Sleep(100);
                                        System.Threading.Thread.Sleep(sleepTime);
                                    }
                                    break;
                                case ShowFunction.FloorHeating:
@@ -347,7 +349,7 @@
                                        Dictionary<string, string> d = new Dictionary<string, string>();
                                        d.Add(FunctionAttributeKey.OnOff, f.trait_on_off.curValue.ToString());
                                        Control.Ins.SendWriteCommand(f, d);
                                        System.Threading.Thread.Sleep(100);
                                        System.Threading.Thread.Sleep(sleepTime);
                                    }
                                    break;
                                case ShowFunction.Light:
@@ -357,7 +359,7 @@
                                        Dictionary<string, string> d = new Dictionary<string, string>();
                                        d.Add(FunctionAttributeKey.OnOff, f.trait_on_off.curValue.ToString());
                                        Control.Ins.SendWriteCommand(f, d);
                                        System.Threading.Thread.Sleep(100);
                                        System.Threading.Thread.Sleep(sleepTime);
                                    }
                                    break;
                                case ShowFunction.Electric:
@@ -367,7 +369,7 @@
                                        Dictionary<string, string> d = new Dictionary<string, string>();
                                        d.Add(FunctionAttributeKey.OnOff, f.trait_on_off.curValue.ToString());
                                        Control.Ins.SendWriteCommand(f, d);
                                        System.Threading.Thread.Sleep(100);
                                        System.Threading.Thread.Sleep(sleepTime);
                                    }
                                    break;
                                case ShowFunction.FreshAir:
@@ -377,7 +379,7 @@
                                        Dictionary<string, string> d = new Dictionary<string, string>();
                                        d.Add(FunctionAttributeKey.OnOff, f.trait_on_off.curValue.ToString());
                                        Control.Ins.SendWriteCommand(f, d);
                                        System.Threading.Thread.Sleep(100);
                                        System.Threading.Thread.Sleep(sleepTime);
                                    }
                                    break;
                            }
@@ -431,8 +433,11 @@
                    {
                        Application.RunOnMainThread(() =>
                        {
                            waitPage.Hide();
                            waitPage.RemoveFromParent();
                            if (waitPage != null)
                            {
                                waitPage.RemoveFromParent();
                                waitPage = null;
                            }
                        });
                    }
                })
@@ -477,8 +482,11 @@
                    {
                        Application.RunOnMainThread(() =>
                        {
                            waitPage.Hide();
                            waitPage.RemoveFromParent();
                            if (waitPage != null)
                            {
                                waitPage.RemoveFromParent();
                                waitPage = null;
                            }
                        });
                    }
                })