From 675df74cdd4103ffdcbfa0a6ccfc105fd61af15a Mon Sep 17 00:00:00 2001
From: JLChen <551775569@qq.com>
Date: 星期五, 29 十月 2021 15:44:18 +0800
Subject: [PATCH] 2021-10-29 1.更新乐橙 AndroidSDK
---
HDL_ON/UI/UI2/FuntionControlView/ArmCenter/AddInputPage.cs | 103 ++++++++++++++++++++++++++++++++++++++++++++++++---
1 files changed, 96 insertions(+), 7 deletions(-)
diff --git a/HDL_ON/UI/UI2/FuntionControlView/ArmCenter/AddInputPage.cs b/HDL_ON/UI/UI2/FuntionControlView/ArmCenter/AddInputPage.cs
index 9d0a8c2..167b453 100644
--- a/HDL_ON/UI/UI2/FuntionControlView/ArmCenter/AddInputPage.cs
+++ b/HDL_ON/UI/UI2/FuntionControlView/ArmCenter/AddInputPage.cs
@@ -86,7 +86,7 @@
functionListView = new VerticalScrolViewLayout()
{
Y = showdFunctionTypeRow.Bottom,
- Height = Application.GetRealHeight(530),
+ Height = Application.GetRealHeight(530-60),
BackgroundColor = CSS_Color.BackgroundColor,
};
bodyView.AddChidren(functionListView);
@@ -150,6 +150,11 @@
//鍒濆鍊�
functions = FunctionList.List.GetArmSensorList();
}
+
+#if DEBUG
+ functions.AddRange(FunctionList.List.GetLightList());
+#endif
+
foreach (var function in functions)
{
var input = securityAlarm.input.Find((obj) => obj.sid == function.sid);
@@ -157,6 +162,52 @@
{
input = new SecurityInput();
input.sid = function.sid;
+
+ var inKey = "status";
+ var inValue = "true";
+ switch(function.spk)
+ {
+ case SPK.SensorWater:
+ inKey = "alarm_status";
+ inValue = "alarm";
+ break;
+ case SPK.SensorPir:
+ inKey = "people_status";
+ break;
+ case SPK.SensorSmoke:
+ inKey = "alarm_status";
+ inValue = "alarm";
+ break;
+ case SPK.SensorGas:
+ inKey = "alarm_status";
+ inValue = "alarm";
+ break;
+ case SPK.SensorDoorWindow:
+ inKey = "contact_status";
+ inValue = "open";
+ break;
+ }
+ input.condition = new List<SecurityInputCondition>()
+ {
+ new SecurityInputCondition()
+ {
+ key = inKey,
+ value = inValue,
+ }
+ };
+
+ if (function.spk == SPK.LightSwitch || function.spk == SPK.LightRGB || function.spk == SPK.LightDimming)
+ {
+ input.condition = new List<SecurityInputCondition>()
+ {
+ new SecurityInputCondition()
+ {
+ key = FunctionAttributeKey.OnOff,
+ value = "off",
+ }
+ };
+ }
+
}
else
{
@@ -222,10 +273,10 @@
if(btnChooseIcon.IsSelected)
{
input.addCondition = true;
- if (input.condition.Count==0)
- {
- ShowStateDialog(input, btnState,btnChooseIcon);
- }
+ //if (input.condition.Count==0)
+ //{
+ // ShowStateDialog(input, btnState,btnChooseIcon,function.spk);
+ //}
}
else
{
@@ -234,7 +285,16 @@
};
btnState.MouseUpEventHandler = (sender, e) =>
{
- ShowStateDialog(input, btnState, btnChooseIcon);
+ //ShowStateDialog(input, btnState, btnChooseIcon, function.spk);
+ btnChooseIcon.IsSelected = !btnChooseIcon.IsSelected;
+ if (btnChooseIcon.IsSelected)
+ {
+ input.addCondition = true;
+ }
+ else
+ {
+ input.addCondition = false;
+ }
};
@@ -258,7 +318,7 @@
}
- private void ShowStateDialog(SecurityInput input,Button btnState,Button btnChoose = null)
+ private void ShowStateDialog(SecurityInput input,Button btnState,Button btnChoose ,string spk)
{
Dialog dialog = new Dialog();
@@ -340,6 +400,21 @@
value = "true",
}
};
+
+ if (spk == SPK.LightSwitch || spk == SPK.LightRGB || spk == SPK.LightDimming)
+ {
+ input.condition = new List<SecurityInputCondition>()
+ {
+ new SecurityInputCondition()
+ {
+ key = FunctionAttributeKey.OnOff,
+ value = "on",
+ }
+ };
+ }
+
+
+
input.addCondition = true;
if (btnChoose != null)
{
@@ -359,6 +434,20 @@
value = "false",
}
};
+
+ if (spk == SPK.LightSwitch || spk == SPK.LightRGB || spk == SPK.LightDimming)
+ {
+ input.condition = new List<SecurityInputCondition>()
+ {
+ new SecurityInputCondition()
+ {
+ key = FunctionAttributeKey.OnOff,
+ value = "off",
+ }
+ };
+ }
+
+
input.addCondition = true;
if (btnChoose != null)
{
--
Gitblit v1.8.0