From 8245dd3bba861d60556cd4804b39bca74c19c329 Mon Sep 17 00:00:00 2001
From: WJC <wjc@hdlchina.com.cn>
Date: 星期二, 29 十月 2019 14:35:29 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/dev-tzy' into dev-wjc
---
ZigbeeApp/Shared/Phone/Device/Logic/DeviceStateCondition.cs | 166 ++++++++++++++++++++++++++++++++++++++++++++++++++-----
1 files changed, 150 insertions(+), 16 deletions(-)
diff --git a/ZigbeeApp/Shared/Phone/Device/Logic/DeviceStateCondition.cs b/ZigbeeApp/Shared/Phone/Device/Logic/DeviceStateCondition.cs
index b61b296..a511835 100644
--- a/ZigbeeApp/Shared/Phone/Device/Logic/DeviceStateCondition.cs
+++ b/ZigbeeApp/Shared/Phone/Device/Logic/DeviceStateCondition.cs
@@ -88,7 +88,8 @@
Width = Application.GetRealWidth(400),
Height = Application.GetRealHeight(69),
Y = Application.GetRealHeight(92),
- TextID = MyInternationalizationString.customroom,
+ //TextID = MyInternationalizationString.customroom,
+ Text = Config.Instance.Home.GetCurrentFloorName,
};
topRowLayout.AddChidren(foolrname);
var dropdown = new Button
@@ -102,6 +103,7 @@
UnSelectedImagePath = "ZigeeLogic/drop-down.png",
};
topRowLayout.AddChidren(dropdown);
+
#endregion
///娌℃湁鎴块棿鐩存帴杩斿洖鍘伙紱
@@ -154,11 +156,12 @@
DeviceType.IASZone,
DeviceType.OnOffSwitch,
DeviceType.OnOffOutput,//妤兼鐏�
- DeviceType.DoorLock
+ DeviceType.DoorLock,
+ DeviceType.TemperatureSensor,
};
///妤煎眰鐐瑰嚮浜嬩欢
- foolrname.MouseUpEventHandler += (sender, e) =>
+ EventHandler<MouseEventArgs> foorlclick = (sender, e) =>
{
var flMain = new FrameLayout { BackgroundColor = ZigbeeColor.Current.LogicViewBackgroundColor };
@@ -178,10 +181,9 @@
Radius = (uint)Application.GetRealHeight(30),
};
flMain.AddChidren(foolrbj);
- ///榛樿璋冭瘯
- List<string> foolrlist = new List<string> { "涓�妤�", "浜屾ゼ", "涓夋ゼ" };
- foreach (var foolr in foolrlist)
+ foreach (var foolr in Config.Instance.Home.FloorDics)
{
+
var foolrRowLayout = new FrameLayout
{
Height = Application.GetRealHeight(150),
@@ -192,32 +194,57 @@
{
Width = Application.GetRealWidth(250),
Height = Application.GetRealHeight(160),
- Text = foolr,
+ Text = foolr.Value,
TextAlignment = TextAlignment.Center,
TextColor = ZigbeeColor.Current.LogicTextBlackColor,
//SelectedTextColor=0xfffc744b,
+ Tag = foolr.Key,
};
foolrRowLayout.AddChidren(btnfoolrname);
- EventHandler<MouseEventArgs> foolrclick = (sender13, e13) =>
+ EventHandler<MouseEventArgs> foolrnameclick = (sender13, e13) =>
{
roomhorizontalScrol.RemoveAll();
+ devicetypehorizontalScrol.RemoveAll();
+ middle.RemoveAll();
foolrname.Text = btnfoolrname.Text;
flMain.RemoveFromParent();
- ///澶囨敞锛氭樉绀洪�変腑妤煎眰鐨勬墍鏈夋埧闂�
- AllRoomView(Common.Room.Lists, deviceTypeList, roomhorizontalScrol, devicetypehorizontalScrol);
-
+ var list = Send.GetRoomList(btnfoolrname.Tag.ToString());
+ AllRoomView(list, deviceTypeList, roomhorizontalScrol, devicetypehorizontalScrol);
};
- foolrRowLayout.MouseUpEventHandler += foolrclick;
- btnfoolrname.MouseUpEventHandler += foolrclick;
+ foolrRowLayout.MouseUpEventHandler += foolrnameclick;
+ btnfoolrname.MouseUpEventHandler += foolrnameclick;
}
};
+ foolrname.MouseUpEventHandler += foorlclick;
+ dropdown.MouseUpEventHandler += foorlclick;
///绗竴娆¤繘鏉�
- AllRoomView(Common.Room.Lists, deviceTypeList, roomhorizontalScrol, devicetypehorizontalScrol);
+ var roomlists = new List<Common.Room>();
+ roomlists.Clear();
+ if (Config.Instance.Home.FloorDics.Count < 2)
+ {
+ foolrname.Visible = false;
+ dropdown.Visible = false;
+ if (Config.Instance.Home.FloorDics.Count == 0)
+ {
+ roomlists.AddRange(Common.Room.Lists);
+ }
+ else
+ {
+ roomlists = Send.GetRoomList(Config.Instance.Home.CurrentFloorId);
+ }
+ }
+ else
+ {
+ roomlists = Send.GetRoomList(Config.Instance.Home.CurrentFloorId);
+
+ }
+
+ AllRoomView(roomlists, deviceTypeList, roomhorizontalScrol, devicetypehorizontalScrol);
}
/// <summary>
/// 鍔犺浇鎵�鏈夋埧闂寸殑瑙嗗浘鏂规硶
@@ -272,6 +299,9 @@
var list = new List<DeviceUI>();
foreach (var device in room.DeviceUIList)
{
+ if (device.CommonDevice==null) {
+ continue;
+ }
if (!deviceTypeList.Contains(device.CommonDevice.Type))
{
continue;
@@ -298,6 +328,9 @@
var list = new List<DeviceUI>();
foreach (var device in room.DeviceUIList)
{
+ if (device.CommonDevice==null) {
+ continue;
+ }
if (!deviceTypeList.Contains(device.CommonDevice.Type))
{
continue;
@@ -334,7 +367,7 @@
devicetypelist.Add(Language.StringByID(MyInternationalizationString.Curtains));
}
- var iASZonejosn = devicelist.Find((device) => device.CommonDevice.Type == DeviceType.IASZone);
+ var iASZonejosn = devicelist.Find((device) => device.CommonDevice.Type == DeviceType.IASZone|| device.CommonDevice.Type == DeviceType.TemperatureSensor);
if (iASZonejosn != null)
{
devicetypelist.Add(Language.StringByID(MyInternationalizationString.sensor));
@@ -454,6 +487,7 @@
else if (devicetype == Language.StringByID(MyInternationalizationString.sensor))
{
list.Add(DeviceType.IASZone);
+ list.Add(DeviceType.TemperatureSensor);
}
else if (devicetype == Language.StringByID(MyInternationalizationString.doorLock))
{
@@ -555,6 +589,21 @@
deviceIconBtn.SelectedImagePath = $"ZigeeLogic/selectedsensor{iASZonedevice.IasDeviceType}.png";
+ }
+ break;
+ case DeviceType.TemperatureSensor:
+ {
+ var temperatureSensor = common.CommonDevice as TemperatureSensor;
+ if (temperatureSensor.SensorDiv == 1)
+ {
+ deviceIconBtn.UnSelectedImagePath = $"ZigeeLogic/temperature.png";
+ deviceIconBtn.SelectedImagePath = $"ZigeeLogic/selectedtemperature.png";
+ }
+ else
+ {
+ deviceIconBtn.UnSelectedImagePath = "ZigeeLogic/humidity.png";
+ deviceIconBtn.SelectedImagePath = "ZigeeLogic/selectedhumidity.png";
+ }
}
break;
case DeviceType.OnOffSwitch:
@@ -1322,7 +1371,7 @@
case DeviceType.DoorLock:
{
#region ------
- var doorlockifonlist = Send.ReadDoorLockIfon("ccccccfffe300347");
+ var doorlockifonlist = Send.ReadDoorLockIfon(common.DeviceAddr);
//var list = Send.ReadDoorLockIfon(common.DeviceAddr);
var pra = new UserCenter.MemberListInfoPra();
string result = await UserCenter.UserCenterLogic.GetResponseDataByRequestHttps("ZigbeeUsers/GetSubAccountByDistributedMark", false, pra);
@@ -1365,6 +1414,91 @@
}
break;
+ case DeviceType.TemperatureSensor:
+ {
+ devicefra.Y = Application.GetRealHeight(1920 - 140 - 160 * 2 - 20 - 50);
+ devicefra.Height = Application.GetRealHeight(140 + 160 * 2 + 20 + 50);
+ var temperatureSensor = common as TemperatureSensor;
+ var Btntemperaturevalue = new Button
+ {
+ TextColor = ZigbeeColor.Current.LogicBtnCancelColor,
+ Height = Application.GetRealHeight(60),
+ Width = Application.GetRealWidth(400),
+ TextAlignment = TextAlignment.CenterLeft,
+ X = Application.GetRealWidth(80),
+ Y = timetype.Bottom + Application.GetRealHeight(70),
+ };
+ devicefra.AddChidren(Btntemperaturevalue);
+
+ var horizontalSeekBarVol = new HorizontalSeekBar
+ {
+ Width = Application.GetRealWidth(920),
+ Height = Application.GetRealHeight(80),
+ Radius = (uint)Application.GetRealHeight(25),
+ Y = timetype.Bottom + Application.GetRealHeight(70 + 60 + 70),
+ X = Application.GetRealWidth(80),
+ ProgressColor = ZigbeeColor.Current.LogicProgressColorSelected,
+ Max = 100,
+ SleepTime = 1000,
+ ThumbRadius = 9,
+ };
+ devicefra.AddChidren(horizontalSeekBarVol);
+ horizontalSeekBarVol.MouseUpEventHandler += (sender, e) =>
+ {
+ SelectedDeviceStatuscondition = "TemperatureSensor";
+ if (temperatureSensor.SensorDiv == 1)
+ {
+ dictionary(deviceConditionsInfo, "AttriButeData1", horizontalSeekBarVol.Progress.ToString());
+
+ Btntemperaturevalue.Text = "褰撳墠>" + horizontalSeekBarVol.Progress.ToString() + "鈩�";
+
+ }
+ else
+ {
+ Btntemperaturevalue.Text = "褰撳墠<" + horizontalSeekBarVol.Progress.ToString() + "%";
+ dictionary(deviceConditionsInfo, "AttriButeData1", horizontalSeekBarVol.Progress.ToString());//娓╁害鍊�
+ }
+ };
+
+
+
+ if (temperatureSensor.SensorDiv == 1)
+ {
+ dictionary(deviceConditionsInfo, "Cluster_ID", "1026");
+ dictionary(deviceConditionsInfo, "AttriButeId", "0");
+ dictionary(deviceConditionsInfo, "Range", "0");//0澶т簬AttriButeData1鏃惰Е鍙戝姩浣�
+ dictionary(deviceConditionsInfo, "AttriButeData1", "0");
+ dictionary(deviceConditionsInfo, "AttriButeData2", "0");
+ Btntemperaturevalue.Text = "褰撳墠>0鈩�";
+
+ }
+ else
+ {
+ Btntemperaturevalue.Text = "褰撳墠<0%";
+ dictionary(deviceConditionsInfo, "Cluster_ID", "1029");
+ dictionary(deviceConditionsInfo, "AttriButeId", "0");
+ dictionary(deviceConditionsInfo, "Range", "2");//2灏忎簬AttriButeData1鏃惰Е鍙戝姩浣�
+ dictionary(deviceConditionsInfo, "AttriButeData1", "0");//娓╁害鍊�
+ dictionary(deviceConditionsInfo, "AttriButeData2", "0");
+ }
+
+ if (edit && devices != null)
+ {
+ horizontalSeekBarVol.Progress = int.Parse(devices["AttriButeData1"]);
+ if (temperatureSensor.SensorDiv == 1)
+ {
+
+ Btntemperaturevalue.Text = "褰撳墠>" + devices["AttriButeData1"] + "鈩�";
+
+ }
+ else
+ {
+ Btntemperaturevalue.Text = "褰撳墠<" + devices["AttriButeData1"] + "%";
+ }
+ }
+
+ }
+ break;
}
Btncomplete.MouseUpEventHandler += (sender2, e2) =>
--
Gitblit v1.8.0