From c1d681f496f2e1c53f88472d803e3c95fab521af Mon Sep 17 00:00:00 2001
From: hxb <hxb@hdlchina.com.cn>
Date: 星期四, 29 七月 2021 09:46:16 +0800
Subject: [PATCH] 萤石测试通过
---
HDL_ON/UI/UI2/3-Intelligence/Scene/SetSceneFunctionInfoPage.cs | 206 +++++++++++++++++++++++++++++++++++++++++++-------
1 files changed, 175 insertions(+), 31 deletions(-)
diff --git a/HDL_ON/UI/UI2/3-Intelligence/Scene/SetSceneFunctionInfoPage.cs b/HDL_ON/UI/UI2/3-Intelligence/Scene/SetSceneFunctionInfoPage.cs
index 66bb9a4..93b3af5 100644
--- a/HDL_ON/UI/UI2/3-Intelligence/Scene/SetSceneFunctionInfoPage.cs
+++ b/HDL_ON/UI/UI2/3-Intelligence/Scene/SetSceneFunctionInfoPage.cs
@@ -49,6 +49,7 @@
LoadFunctionRow(sceneFunction.status.Find((obj) => obj.key == FunctionAttributeKey.SetTemp));
break;
case FunctionAttributeKey.Mode:
+
LoadFunctionRow(sceneFunction.status.Find((obj) => obj.key == FunctionAttributeKey.Mode));
break;
case FunctionAttributeKey.FanSpeed:
@@ -70,33 +71,36 @@
//LoadFunctionRow(sceneFunction.localFunction.trait_on_off);
//switch (sceneFunction.localFunction.functionType)
//{
- // case FunctionType.AC:
+ // case SPK.AcStandard:
// LoadFunctionRow(sceneFunction.localFunction.attributes.Find((obj) => obj.key == "set_temp"));
// LoadFunctionRow(sceneFunction.localFunction.attributes.Find((obj) => obj.key == "mode"));
// LoadFunctionRow(sceneFunction.localFunction.attributes.Find((obj) => obj.key == "fan"));
// break;
- // case FunctionType.FloorHeating:
+ // case SPK.FloorHeatStandard:
// LoadFunctionRow(sceneFunction.localFunction.attributes.Find((obj) => obj.key == "set_temp"));
// LoadFunctionRow(sceneFunction.localFunction.attributes.Find((obj) => obj.key == "mode"));
// break;
- // case FunctionType.Curtain:
+ // case SPK.CurtainSwitch:
// //鏃犳搷浣�
// break;
- // case FunctionType.MotorCurtain:
- // case FunctionType.RollingShutter:
+ // case SPK.CurtainTrietex:
+ // case SPK.CurtainRoller:
// LoadFunctionRow(sceneFunction.localFunction.attributes.Find((obj) => obj.key == "percent"));
// break;
- // case FunctionType.Relay:
+ // case SPK.LightSwitch:
// //鏃犳搷浣�
// break;
- // case FunctionType.Dimmer:
- // case FunctionType.RGB:
+ // case SPK.LightDimming:
+ // case SPK.LightRGB:
// LoadFunctionRow(sceneFunction.localFunction.attributes.Find((obj) => obj.key == "brightness"));
// break;
//}
- //鍔犺浇寤舵椂Row
- LoadDelayRow();
+ if (DB_ResidenceData.Instance.GatewayType != 0)
+ {
+ //鍔犺浇寤舵椂Row
+ LoadDelayRow();
+ }
var bottomView = new FrameLayout()
{
@@ -135,6 +139,7 @@
// }
// catch { }
//}
+
if (temp != null)
{
temp = sceneFunction;
@@ -179,9 +184,18 @@
BackgroundColor = CSS_Color.MainBackgroundColor,
};
contentView.AddChidren(row);
+
+
if (sceneStatus.key != FunctionAttributeKey.OnOff)
{
row.AddChidren(new Button() { X = Application.GetRealWidth(16), Height = Application.GetRealHeight(1), Width = Application.GetRealWidth(343), BackgroundColor = CSS_Color.DividingLineColor });
+ }
+ else
+ {
+ if(sceneStatus.value == "stop")
+ {
+ sceneStatus.value = "on";
+ }
}
Button btnRight = new Button()
{
@@ -193,20 +207,77 @@
};
row.AddChidren(btnRight);
+
+ var showCode = "";
+
+ if (sceneStatus.key == FunctionAttributeKey.Mode)
+ {
+ if (DB_ResidenceData.Instance.GatewayType == 0)
+ {
+ if (SPK.AcSpkList().Contains(sceneFunction.localFunction.spk))
+ {
+ //0 鍒跺喎1鍒剁儹锛�2閫氶锛�3鑷姩锛�4闄ゆ箍
+ switch (sceneStatus.value)
+ {
+ case "0":
+ showCode = "cool";
+ break;
+ case "1":
+ showCode = "heat";
+ break;
+ case "2":
+ showCode = "fan";
+ break;
+ case "3":
+ showCode = "auto";
+ break;
+ case "4":
+ showCode = "dry";
+ break;
+ }
+ }
+ else if (SPK.FhSpkList().Contains(sceneFunction.localFunction.spk))
+ {
+ //1:鏅��,2:鐧藉ぉ,3:澶滄櫄,4:绂诲紑,5:鏃堕棿
+ switch (sceneStatus.value)
+ {
+ case "5":
+ showCode = "timer";
+ break;
+ case "1":
+ showCode = "normal";
+ break;
+ case "2":
+ showCode = "day";
+ break;
+ case "3":
+ showCode = "night";
+ break;
+ case "4":
+ showCode = "away";
+ break;
+ }
+ }
+ }
+ }
+
var btnFunctionText = new Button()
{
Width = Application.GetRealWidth(330),
TextAlignment = TextAlignment.CenterRight,
TextColor = CSS_Color.PromptingColor1,
TextSize = CSS_FontSize.PromptFontSize_FirstLevel,
- Text = FunctionList.List.GetValueText(sceneStatus.key,sceneStatus.value) + FunctionList.List.GetUintString(sceneStatus.key)
+ Text = sceneStatus.GetValueText(showCode) + sceneStatus.GetUintString()
};
row.AddChidren(btnFunctionText);
+
+
+
if (sceneStatus.key == FunctionAttributeKey.OnOff)
{
btnOnText = btnFunctionText;
}
- else if (sceneStatus.key == FunctionAttributeKey.Brightness)
+ else if (sceneStatus.key == FunctionAttributeKey.Brightness || sceneStatus.key == FunctionAttributeKey.Percent)
{
btnBrightnessText = btnFunctionText;
}
@@ -217,7 +288,7 @@
TextAlignment = TextAlignment.CenterLeft,
TextColor = CSS_Color.FirstLevelTitleColor,
TextSize = CSS_FontSize.SubheadingFontSize,
- Text = FunctionList.List.GetNameText(sceneStatus.key)
+ Text = sceneStatus.GetNameText()
};
row.AddChidren(btnFunctionName);
btnFunctionName.MouseUpEventHandler = (sender, e) =>
@@ -297,7 +368,7 @@
TextAlignment = TextAlignment.CenterRight,
TextColor = CSS_Color.PromptingColor1,
TextSize = CSS_FontSize.PromptFontSize_FirstLevel,
- Text = FunctionList.List.GetDelayText( sceneFunction.delay)
+ Text = new Scene() { delay = sceneFunction.delay }.GetDelayText()
};
delayRow.AddChidren(btnDelayInfo);
@@ -315,14 +386,20 @@
btnSceneDelayTitle.MouseUpEventHandler = (sender, e) => {
Action<string> action = (obj) => {
sceneFunction.delay = obj;
- btnDelayInfo.Text = FunctionList.List.GetDelayText(obj);
+ btnDelayInfo.Text = new Scene() { delay = sceneFunction.delay }.GetDelayText();
};
- new PublicAssmebly().SetSceneDelayDialog(action,sceneFunction.delay);
+ Dictionary<string, string> items = new Dictionary<string, string>();
+ items.Add("30", "30s");
+ items.Add("60", "1min");
+ items.Add("120", "2min");
+ items.Add("300", "5min");
+ new PublicAssmebly().SetSceneDelayDialog(action, sceneFunction.delay);
};
#endregion
}
+
#endregion
#region 灞炴�ч�夋嫨寮圭獥
@@ -414,32 +491,40 @@
dialog.Close();
trait.value = "on";
sceneFunction.status.Find((obj) => obj.key == FunctionAttributeKey.OnOff).value = "on";
- btn.Text = FunctionList.List.GetValueText(trait.key, trait.value) + FunctionList.List.GetUintString(trait.key);
+ btn.Text = trait.GetValueText() + trait.GetUintString();
var temp = sceneFunction.status.Find((obj) => obj.key == FunctionAttributeKey.Brightness);
+ if (temp == null)
+ {
+ temp = sceneFunction.status.Find((obj) => obj.key == FunctionAttributeKey.Percent);
+ }
if (temp != null)
{
if (temp.value == "0")
{
temp.value = "100";
}
- btnBrightnessText.Text = FunctionList.List.GetValueText(temp.key, temp.value) + "%";
+ btnBrightnessText.Text = temp.GetValueText() + "%";
}
};
btnOff.MouseUpEventHandler = (sender,e) =>{
dialog.Close();
trait.value = "off";
sceneFunction.status.Find((obj) => obj.key == FunctionAttributeKey.OnOff).value = "off";
- btn.Text= FunctionList.List.GetValueText(trait.key,trait.value) + FunctionList.List.GetUintString(trait.key);
+ btn.Text= trait.GetValueText() + trait.GetUintString();
var temp = sceneFunction.status.Find((obj) => obj.key == FunctionAttributeKey.Brightness);
+ if(temp == null)
+ {
+ temp = sceneFunction.status.Find((obj) => obj.key == FunctionAttributeKey.Percent);
+ }
if (temp != null)
{
if (temp.value != "0")
{
temp.value = "0";
}
- btnBrightnessText.Text = FunctionList.List.GetValueText(temp.key, temp.value) + "%";
+ btnBrightnessText.Text = temp.GetValueText() + "%";
}
};
@@ -523,16 +608,16 @@
};
for (int i = 16; i <= 32; i += 1)
{
- pickerItems.Add(i.ToString() + FunctionList.List.GetUintString(trait.key));
+ pickerItems.Add(i.ToString() + trait.GetUintString());
}
uIPickerView.setNPicker(pickerItems, null, null);
optionBaseView.AddChidren(uIPickerView);
uIPickerView.setCurrentItems(pickerItems.IndexOf(trait.value.ToString()), 4, 5);
string selectItem = pickerItems[0];
- if (pickerItems.Contains(trait.value + FunctionList.List.GetUintString(trait.key)))
+ if (pickerItems.Contains(trait.value + trait.GetUintString()))
{
- selectItem = trait.value.ToString() + FunctionList.List.GetUintString(trait.key);
+ selectItem = trait.value.ToString() + trait.GetUintString();
}
dialog.Show();
@@ -551,7 +636,7 @@
dialog.Close();
btn.Text = selectItem;
//sceneFunction.status.Find((obj) => obj.key == FunctionAttributeKey.OnOff).value = trait.value.ToString() ;
- trait.value = selectItem.Replace(FunctionList.List.GetUintString(trait.key),"");
+ trait.value = selectItem.Replace(trait.GetUintString(),"");
};
}
@@ -605,7 +690,7 @@
Gravity = Gravity.CenterHorizontal,
TextAlignment = TextAlignment.Center,
Width = Application.GetRealWidth(100),
- Text = FunctionList.List.GetNameText(trait.key),
+ Text = trait.GetNameText(),
IsBold = true,
TextColor = CSS_Color.FirstLevelTitleColor,
TextSize = CSS_FontSize.SubheadingFontSize,
@@ -694,7 +779,7 @@
{
dialog.Close();
trait.value = controlBar.Progress.ToString();
- btn.Text = trait.value + FunctionList.List.GetUintString(trait.key);
+ btn.Text = trait.value + trait.GetUintString();
var temp = sceneFunction.status.Find((obj) => obj.key == FunctionAttributeKey.OnOff);
if (temp != null)
@@ -707,7 +792,7 @@
{
temp.value = "off";
}
- btnOnText.Text = FunctionList.List.GetValueText(temp.key, temp.value);
+ btnOnText.Text = temp.GetValueText();
}
};
}
@@ -762,7 +847,7 @@
Gravity = Gravity.CenterHorizontal,
TextAlignment = TextAlignment.Center,
Width = Application.GetRealWidth(100),
- Text = FunctionList.List.GetNameText(trait.key),
+ Text = trait.GetNameText(),
IsBold = true,
TextColor = CSS_Color.FirstLevelTitleColor,
TextSize = CSS_FontSize.SubheadingFontSize,
@@ -855,7 +940,7 @@
{
dialog.Close();
trait.value = controlBar.Progress.ToString();
- btn.Text = trait.value + FunctionList.List.GetUintString(trait.key);
+ btn.Text = trait.value + trait.GetUintString();
};
}
@@ -869,6 +954,65 @@
var lastData = "";
var lastText = "";
Dialog dialog = new Dialog();
+
+ if(DB_ResidenceData.Instance.GatewayType == 0)
+ {
+ if (SPK.AcSpkList().Contains(sceneFunction.localFunction.spk))
+ {
+ //0 鍒跺喎1鍒剁儹锛�2閫氶锛�3鑷姩锛�4闄ゆ箍
+ for (int i = 0; i < statusList.Count; i++)
+ {
+ if (statusList[i] == "0")
+ {
+ statusList[i] = "cool";
+ }
+ else if (statusList[i] == "1")
+ {
+ statusList[i] = "heat";
+ }
+ else if (statusList[i] == "2")
+ {
+ statusList[i] = "fan";
+ }
+ else if (statusList[i] == "3")
+ {
+ statusList[i] = "auto";
+ }
+ else if (statusList[i] == "4")
+ {
+ statusList[i] = "dry";
+ }
+ }
+ }
+ else if (SPK.FhSpkList().Contains(sceneFunction.localFunction.spk))
+ {
+ //1:鏅��,2:鐧藉ぉ,3:澶滄櫄,4:绂诲紑,5:鏃堕棿
+ for (int i = 0; i < statusList.Count; i++)
+ {
+ if (statusList[i] == "5")
+ {
+ statusList[i] = "timer";
+ }
+ else if (statusList[i] == "1")
+ {
+ statusList[i] = "normal";
+ }
+ else if (statusList[i] == "2")
+ {
+ statusList[i] = "day";
+ }
+ else if (statusList[i] == "3")
+ {
+ statusList[i] = "night";
+ }
+ else if (statusList[i] == "4")
+ {
+ statusList[i] = "away";
+ }
+ }
+
+ }
+ }
var pView = new FrameLayout()
{
@@ -904,7 +1048,7 @@
Gravity = Gravity.CenterHorizontal,
TextAlignment = TextAlignment.Center,
Width = Application.GetRealWidth(100),
- Text = FunctionList.List.GetNameText(trait.key),
+ Text = trait.GetNameText(),
IsBold = true,
TextColor = CSS_Color.FirstLevelTitleColor,
TextSize = CSS_FontSize.SubheadingFontSize,
@@ -976,7 +1120,7 @@
TextColor = CSS_Color.FirstLevelTitleColor,
TextSize = CSS_FontSize.TextFontSize,
Tag = m,
- Text = FunctionList.List.GetValueText(trait.key, m)
+ Text = trait.GetValueText(m)
};
row.AddChidren(btnPropertyTitle);
--
Gitblit v1.8.0