From f982455916297ab07379d902a7f15b7a7a867c94 Mon Sep 17 00:00:00 2001
From: wei <kaede@kaededeMacBook-Air.local>
Date: 星期三, 20 十月 2021 09:19:20 +0800
Subject: [PATCH] 1
---
HDL_ON/UI/UI2/2-Classification/ClassificationPageBLL.cs | 84 +++++++++++++++++++++++-------------------
1 files changed, 46 insertions(+), 38 deletions(-)
diff --git a/HDL_ON/UI/UI2/2-Classification/ClassificationPageBLL.cs b/HDL_ON/UI/UI2/2-Classification/ClassificationPageBLL.cs
index d6371a6..0e8f778 100644
--- a/HDL_ON/UI/UI2/2-Classification/ClassificationPageBLL.cs
+++ b/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;
+ }
});
}
})
--
Gitblit v1.8.0