From b129359c5a0df75f63d9131e5e41d3060ac38cc3 Mon Sep 17 00:00:00 2001
From: gxc <guoxuecheng@guoxuechengdeMacBook-Pro.local>
Date: 星期一, 30 十二月 2019 14:14:06 +0800
Subject: [PATCH] 2019.12.30
---
ZigbeeApp/Shared/Phone/Device/Light/OnOffControl.cs | 41 +++++++++++++++++++++--------------------
1 files changed, 21 insertions(+), 20 deletions(-)
diff --git a/ZigbeeApp/Shared/Phone/Device/Light/OnOffControl.cs b/ZigbeeApp/Shared/Phone/Device/Light/OnOffControl.cs
index dae9d4c..9d7c7a3 100644
--- a/ZigbeeApp/Shared/Phone/Device/Light/OnOffControl.cs
+++ b/ZigbeeApp/Shared/Phone/Device/Light/OnOffControl.cs
@@ -2,6 +2,7 @@
using System.Collections.Generic;
using Shared.Common;
using Shared.Phone.Device.CommonForm;
+using Shared.Phone.Device.DeviceLogic;
using Shared.Phone.UserView;
using ZigBee.Device;
namespace Shared.Phone.Device.Light
@@ -70,6 +71,10 @@
/// </summary>
private Button OffBtn;
+ /// <summary>
+ /// IsDrawerLockMode
+ /// </summary>
+ public bool IsDrawerLockMode;
#endregion
#region 鈼� 鎺ュ彛__________________________
@@ -140,7 +145,7 @@
}
light.OnOffStatus = light.DeviceStatusReport.AttriBute[0].AttriButeData;
SetONOFFStatu(light.OnOffStatus == 1);
- StatuBtn.Text = CommonFormResouce.GetSwitchStatu(light.OnOffStatus == 1);
+ StatuBtn.Text = $"{Language.StringByID(R.MyInternationalizationString.Current)} {device.GetDeviceStatu()}";
light.LastDateTime = DateTime.Now;
}
}
@@ -169,7 +174,7 @@
return;
}
deviceUI.CommonDevice.IsOnline = common.IsOnline;
- OnBtn.IsSelected = OffBtn.IsSelected= deviceUI.CommonDevice.IsOnline == 1;
+ //OnBtn.IsSelected = OffBtn.IsSelected= deviceUI.CommonDevice.IsOnline == 1;
deviceUI.CommonDevice.LastDateTime = DateTime.Now;
}
catch (Exception ex)
@@ -191,6 +196,10 @@
//action();
//action = null;
RemoveUpdateControlDeviceStatuAction();
+ if (IsDrawerLockMode)
+ {
+ CommonPage.Instance.IsDrawerLockMode = false;
+ }
base.RemoveFromParent();
}
@@ -228,8 +237,7 @@
{
UserHomeView.ReadStatus(light, () =>
{
- light.ReadOnOffStatus();
- light.ReadAttri(Cluster_ID.Identify, AttriButeId.Switch);
+ ReadDeviceAttributeLogic.Instance.SendLightStatuComand(device.CommonDevice);
});
}
else
@@ -237,8 +245,7 @@
//闃叉鐭椂闂村唴澶氭璇诲彇鐘舵��
if (CommonPage.ReadDeviceStatuSpan < (DateTime.Now - light.LastDateTime).TotalSeconds)
{
- light.ReadAttri(Cluster_ID.Identify, AttriButeId.Switch);
- light.ReadOnOffStatus();
+ ReadDeviceAttributeLogic.Instance.SendLightStatuComand(device.CommonDevice);
}
}
@@ -273,16 +280,6 @@
{
RemoveFromParent();
};
-
- var sharedBtn = new Button
- {
- X = Application.GetRealWidth(850),
- Width = Application.GetMinReal(69),
- Height = Application.GetMinReal(69),
- Gravity = Gravity.CenterVertical,
- UnSelectedImagePath = "Item/Shared.png"
- };
- top.topView.AddChidren(sharedBtn);
var moreBtn = new Button
{
@@ -340,7 +337,8 @@
Gravity = Gravity.CenterHorizontal,
Text = device.CommonDevice.DeviceEpointName,
TextColor = ZigbeeColor.Current.GXCTextBlackColor,
- TextSize = 15
+ TextSize = 15,
+ IsBold=true
};
itemView.AddChidren(deviceNameBtn);
@@ -351,7 +349,8 @@
Height = Application.GetRealHeight(60),
Gravity = Gravity.CenterHorizontal,
TextColor = ZigbeeColor.Current.GXCTextGrayColor,
- Text = CommonFormResouce.GetSwitchStatu(device.CommonDevice.IsOnline == 1)
+ Text = $"{Language.StringByID(R.MyInternationalizationString.Current)} {device.GetDeviceStatu()}",
+ TextSize = 10
};
itemView.AddChidren(StatuBtn);
@@ -424,7 +423,8 @@
Height = Application.GetRealHeight(50),
Text = room.Name,
TextAlignment = TextAlignment.CenterLeft,
- TextColor = ZigbeeColor.Current.GXCTextWhiteColor
+ TextColor = ZigbeeColor.Current.GXCTextWhiteColor,
+ TextSize = 12
};
itemView.AddChidren(roomName);
}
@@ -546,8 +546,9 @@
OnBtn.IsSelected = false;
OffBtn.IsSelected = true;
}
+ StatuBtn.Text = statu ? $"{Language.StringByID(R.MyInternationalizationString.Current)} {Language.StringByID(R.MyInternationalizationString.Open)}" : $"{Language.StringByID(R.MyInternationalizationString.Current)} {Language.StringByID(R.MyInternationalizationString.Shut)}";
}
-
+
#endregion
--
Gitblit v1.8.0