From 304dca51c28183a9dfc192c6b93ea1c00bdd5d97 Mon Sep 17 00:00:00 2001
From: 黄学彪 <hxb@hdlchina.com.cn>
Date: 星期三, 01 七月 2020 15:00:40 +0800
Subject: [PATCH] 添加了写入功能类型
---
ZigbeeApp/Shared/Phone/Device/Logic/CurrentDeviceState.cs | 153 +++++++++++++++------------------------------------
1 files changed, 45 insertions(+), 108 deletions(-)
diff --git a/ZigbeeApp/Shared/Phone/Device/Logic/CurrentDeviceState.cs b/ZigbeeApp/Shared/Phone/Device/Logic/CurrentDeviceState.cs
index 203f4c8..6f80b9b 100755
--- a/ZigbeeApp/Shared/Phone/Device/Logic/CurrentDeviceState.cs
+++ b/ZigbeeApp/Shared/Phone/Device/Logic/CurrentDeviceState.cs
@@ -19,7 +19,7 @@
UserView.HomePage.Instance.ScrollEnabled = false;
CompleteView completeView = new CompleteView();
flMain.AddChidren(completeView.Show(1));
- completeView.Btntitle.Text = common.DeviceEpointName;
+ completeView.Btntitle.Text = LocalDevice.Current.GetDeviceEpointName(common);
EventHandler<MouseEventArgs> clickcancel = (sender, e) =>
{
if (!edit)
@@ -62,7 +62,7 @@
//Y = openView.frameLayout.Bottom,
X = Application.GetRealWidth(80),
Width = Application.GetRealWidth(915),
- Height = Application.GetRealHeight(160),
+ Height = Application.GetRealHeight(160),//婊戝姩鏉$埗鎺т欢楂樺害
IsProgressTextShow = true,//鏄剧ず鐧惧垎姣�
IsClickable = false,//杩涘害鏉℃槸鍚︽粦鍔�
ProgressBarColor = ZigbeeColor.Current.LogicProgressColorSelected,//閫変腑杩涘害鏉¢鑹�
@@ -334,7 +334,7 @@
var ignoreTime = new IgnoreTime();
UserView.HomePage.Instance.AddChidren(ignoreTime);
UserView.HomePage.Instance.PageIndex += 1;
- ignoreTime.Show(common, closeView.titleBtn.Text, edit, timevalue);
+ ignoreTime.Show(common, closeView.titleBtn.Text, edit, timevalue, _if[1]);
}
@@ -378,7 +378,7 @@
var ignoreTime = new IgnoreTime();
UserView.HomePage.Instance.AddChidren(ignoreTime);
UserView.HomePage.Instance.PageIndex += 1;
- ignoreTime.Show(common, timeoutView.titleBtn.Text, edit, timevalue);
+ ignoreTime.Show(common, timeoutView.titleBtn.Text, edit, timevalue, _if[1]);
};
@@ -387,6 +387,7 @@
break;
case 40:
{
+
openView.titleBtn.TextID = MyInternationalizationString.smokescreen;
openView.lineBtn.BackgroundColor = ZigbeeColor.Current.LogicBackgroundColor;
completeView.Show(1).AddChidren(openView.Show());
@@ -403,7 +404,7 @@
}
break;
case 43:
- {
+ {//鍙厓璇寸殑
openView.titleBtn.TextID = MyInternationalizationString.gas;
openView.lineBtn.BackgroundColor = ZigbeeColor.Current.LogicBackgroundColor;
completeView.Show(1).AddChidren(openView.Show());
@@ -436,27 +437,30 @@
{
if (devices["AttriButeId"] == "1281")
{
- if (devices["AttriButeData1"] == "1")
+ if (devices.ContainsKey("IgnoreTime"))
{
- openView.titleBtn.TextColor = ZigbeeColor.Current.LogicBtnSelectedColor;
- closeView.titleBtn.TextColor = ZigbeeColor.Current.LogicBtnNotSelectedColor;
- openView.selectedIconBtn.Visible = true;
- closeView.selectedIconBtn.Visible = false;
+ timevalue = int.Parse(devices["IgnoreTime"]);
}
else
{
- if (devices.ContainsKey("IgnoreTime"))
+ if (devices["AttriButeData1"] == "1")
{
- timevalue = int.Parse(devices["IgnoreTime"]);
+ openView.titleBtn.TextColor = ZigbeeColor.Current.LogicBtnSelectedColor;
+ closeView.titleBtn.TextColor = ZigbeeColor.Current.LogicBtnNotSelectedColor;
+ openView.selectedIconBtn.Visible = true;
+ closeView.selectedIconBtn.Visible = false;
}
else
{
openView.titleBtn.TextColor = ZigbeeColor.Current.LogicBtnNotSelectedColor;
closeView.titleBtn.TextColor = ZigbeeColor.Current.LogicBtnSelectedColor;
openView.selectedIconBtn.Visible = false;
- closeView.titleBtn.Visible = true;
+ closeView.selectedIconBtn.Visible = true;
}
+
}
+
+
}
@@ -492,97 +496,14 @@
}
break;
case DeviceType.DoorLock:
- {
- if (_if[0] == "condition")
- {
- flMain.RemoveFromParent();
- var memberList = new MemberList();
- UserView.HomePage.Instance.AddChidren(memberList);
- UserView.HomePage.Instance.PageIndex += 1;
- MemberList.edit = false;
- memberList.Show(common);
- }
- else
- {
- completeView.Btntitle.TextID = MyInternationalizationString.openmode;
- completeView.Show(2).AddChidren(openView.Show());
- completeView.Show(2).AddChidren(closeView.Show());
- openView.titleBtn.TextID = MyInternationalizationString.logicopen;
- closeView.titleBtn.TextID = MyInternationalizationString.logicclose;
- //闂ㄩ攣鏁版嵁鐗规畩锛岃繘琛岀壒娈婂鐞�;
- if (actionsInfo.ContainsKey("LinkType"))
- {
- actionsInfo.Remove("LinkType");
- }
- //鐩爣闂ㄩ攣绫诲瀷鏄�8锛�
- actionsInfo.Add("LinkType", 8);
- if (actionsInfo.ContainsKey("TaskList"))
- {
- actionsInfo.Remove("TaskList");
- }
- if (actionsInfo.ContainsKey("Time"))
- {
- actionsInfo.Remove("Time");
- }
- closeView.lineBtn.BackgroundColor = ZigbeeColor.Current.LogicBackgroundColor;
- ///
- openView.clickviewBtn.MouseUpEventHandler += (sender, e) =>
- {
- openView.selectedIconBtn.Visible = true;
- closeView.selectedIconBtn.Visible = false;
- openView.titleBtn.TextColor = ZigbeeColor.Current.LogicBtnSelectedColor;
- closeView.titleBtn.TextColor = ZigbeeColor.Current.LogicBtnNotSelectedColor;
- SelectedDeviceStatus = "DoorLock";
- if (actionsInfo.ContainsKey("PassData"))
- {
- actionsInfo.Remove("PassData");
- }
- actionsInfo.Add("PassData", "055704010112");//闂ㄩ攣甯稿紑
- };
- ///鐐瑰嚮鍙栨秷浜嬩欢
- closeView.clickviewBtn.MouseUpEventHandler += (sender, e) =>
- {
- openView.selectedIconBtn.Visible = false;
- closeView.selectedIconBtn.Visible = true;
- openView.titleBtn.TextColor = ZigbeeColor.Current.LogicBtnNotSelectedColor;
- closeView.titleBtn.TextColor = ZigbeeColor.Current.LogicBtnSelectedColor;
- SelectedDeviceStatus = "DoorLock";
- if (actionsInfo.ContainsKey("PassData"))
- {
- actionsInfo.Remove("PassData");
- }
- actionsInfo.Add("PassData", "055704010113");//闂ㄩ攣甯稿叧
+ {
- };
- if (edit)
- {
- foreach (var deviceinfo in Common.Logic.CurrentLogic.Actions)
- {
- if (deviceinfo["LinkType"].ToString() == "8")
- {
- if (deviceinfo["DeviceAddr"].ToString() == common.DeviceAddr && deviceinfo["Epoint"].ToString() == common.DeviceEpoint.ToString())
- {
- if (deviceinfo["PassData"].ToString() == "055704010112")
- {//寮�鍚�
- openView.selectedIconBtn.Visible = true;
- closeView.selectedIconBtn.Visible = false;
- openView.titleBtn.TextColor = ZigbeeColor.Current.LogicBtnSelectedColor;
- closeView.titleBtn.TextColor = ZigbeeColor.Current.LogicBtnNotSelectedColor;
- }
- else
- {//鍏抽棴
- openView.selectedIconBtn.Visible = false;
- closeView.selectedIconBtn.Visible = true;
- openView.titleBtn.TextColor = ZigbeeColor.Current.LogicBtnNotSelectedColor;
- closeView.titleBtn.TextColor = ZigbeeColor.Current.LogicBtnSelectedColor;
-
- }
- break;
- }
- }
- }
- }
- }
+ flMain.RemoveFromParent();
+ var memberList = new MemberList();
+ UserView.HomePage.Instance.AddChidren(memberList);
+ UserView.HomePage.Instance.PageIndex += 1;
+ MemberList.edit = false;
+ memberList.Show(common);
}
break;
case DeviceType.TemperatureSensor:
@@ -618,7 +539,7 @@
Send.dictionary(deviceConditionsInfo, "Cluster_ID", "1026");
Send.dictionary(deviceConditionsInfo, "AttriButeId", "0");
Send.dictionary(deviceConditionsInfo, "Range", "1");//1:绛変簬AttriButeData1鏃惰Е鍙戝姩浣�
- Send.dictionary(deviceConditionsInfo, "AttriButeData1", "50");//榛樿娓╁害鍊�50鈩�
+ Send.dictionary(deviceConditionsInfo, "AttriButeData1", "5000");//榛樿娓╁害鍊�50鈩�
Send.dictionary(deviceConditionsInfo, "AttriButeData2", "0");
}
else
@@ -627,7 +548,7 @@
Send.dictionary(deviceConditionsInfo, "Cluster_ID", "1029");
Send.dictionary(deviceConditionsInfo, "AttriButeId", "0");
Send.dictionary(deviceConditionsInfo, "Range", "1");//1:绛変簬AttriButeData1鏃惰Е鍙戝姩浣�
- Send.dictionary(deviceConditionsInfo, "AttriButeData1", "50");//榛樿婀垮害鍊�50%
+ Send.dictionary(deviceConditionsInfo, "AttriButeData1", "5000");//榛樿婀垮害鍊�50%
Send.dictionary(deviceConditionsInfo, "AttriButeData2", "0");
}
mUIPickerView.setNPicker(mList1, mList2, mList3);
@@ -636,8 +557,10 @@
mUIPickerView.OnSelectChangeEvent += (s1, s2, s3) =>
{
+ ///娓╁害杩涚巼杞崲*100
+ var strValue = (int.Parse(mList2[s2]) * 100).ToString();
SelectedDeviceStatus = "TemperatureSensor";
- Send.dictionary(deviceConditionsInfo, "AttriButeData1", mList2[s2]);
+ Send.dictionary(deviceConditionsInfo, "AttriButeData1", strValue);
switch (mList1[s1])
{
case ">":
@@ -703,8 +626,10 @@
break;
}
//鏌ユ壘绱㈠紩
- index1 = mList1.IndexOf(s);
- index2 = mList2.IndexOf(devices["AttriButeData1"]);
+ index1 = mList1.IndexOf(s);
+ //杞崲娓╁害鍊�/100
+ var dd = (int.Parse(devices["AttriButeData1"])/100).ToString();
+ index2 = mList2.IndexOf(dd);
}
///鏇存柊鏈�鏂扮姸鎬侊紱
@@ -1280,6 +1205,18 @@
};
}
break;
+ case DeviceType.ColorTemperatureLight: {
+
+
+
+
+ flMain.RemoveFromParent();
+ var nightlight = new Nightlight();
+ UserView.HomePage.Instance.AddChidren(nightlight);
+ UserView.HomePage.Instance.PageIndex += 1;
+ nightlight.Show(common, false, _if[1]);
+ }
+ break;
}
completeView.Btncomplete.MouseUpEventHandler += (sender, e) =>
{
--
Gitblit v1.8.0