From 7fa61a2e8415f8dd862aad5541d323c9c51c45c5 Mon Sep 17 00:00:00 2001
From: gxc <guoxuecheng@guoxuechengdeMacBook-Pro.local>
Date: 星期二, 29 十月 2019 13:10:29 +0800
Subject: [PATCH] 2019.10.29
---
ZigbeeApp/Shared/Phone/UserView/UserPage.cs | 135 +++++++++++++++++++++++++++------------------
1 files changed, 81 insertions(+), 54 deletions(-)
diff --git a/ZigbeeApp/Shared/Phone/UserView/UserPage.cs b/ZigbeeApp/Shared/Phone/UserView/UserPage.cs
old mode 100755
new mode 100644
index 2166285..13ca839
--- a/ZigbeeApp/Shared/Phone/UserView/UserPage.cs
+++ b/ZigbeeApp/Shared/Phone/UserView/UserPage.cs
@@ -2,6 +2,7 @@
using System.Collections.Generic;
using Shared.Common;
using ZigBee.Device;
+using Shared.Phone.Device.AC;
namespace Shared.Phone.UserView
{
@@ -20,25 +21,25 @@
/// </summary>
private static readonly int tabBarEnum_Width = CommonPage.AppRealWidth / 3;
/// <summary>
- /// 搴曢儴鎸夐挳鍥剧墖鐨勯珮搴�-110
+ /// 搴曢儴鎸夐挳鍥剧墖鐨勯珮搴�
/// </summary>
- private static readonly int tabBarEnumIMG_Height = 110;
+ private static readonly int tabBarEnumIMG_Height = 98;
/// <summary>
- /// 搴曢儴鎸夐挳鍥剧墖鐨勫搴�-110
+ /// 搴曢儴鎸夐挳鍥剧墖鐨勫搴�
/// </summary>
- private static readonly int tabBarEnumIMG_Width = 110;
+ private static readonly int tabBarEnumIMG_Width = 138;
/// <summary>
- /// 搴曢儴鎸夐挳鍥剧墖鐨刌鍊� -5
+ /// 搴曢儴鎸夐挳鍥剧墖鐨刌鍊�
/// </summary>
- private static readonly int tabBarEnumIMG_Y = 5;
+ private static readonly int tabBarEnumIMG_Y = 3;
/// <summary>
- /// 搴曢儴鎸夐挳鏂囧瓧鐨勯珮搴� -50
+ /// 搴曢儴鎸夐挳鏂囧瓧鐨勯珮搴�
/// </summary>
- private static readonly int tabBarEnumName_Height = 50;
+ private static readonly int tabBarEnumName_Height = 40;
/// <summary>
- /// 搴曢儴鎸夐挳鏂囧瓧鐨刌鍊� 100
+ /// 搴曢儴鎸夐挳鏂囧瓧鐨刌鍊�
/// </summary>
- private static readonly int tabBarEnumName_Y = tabBarEnumIMG_Height - 10;
+ private static readonly int tabBarEnumName_Y = 104;
#endregion
#region 鈼� 鎺ュ彛____________________________
@@ -66,6 +67,7 @@
/// <param name="typeTag">Type tag.</param>
public void DeviceInfoChange(CommonDevice common, string typeTag)
{
+ ///
//璁惧涓婃姤鐘舵�佷腑 褰揅luterID=3,灏辫瘉鏄庤璁惧鍦ㄧ嚎锛岀洿鎺ユ爣璁�
if (typeTag == "DeviceStatusReport")
{
@@ -88,10 +90,10 @@
{
case DeviceType.OnOffOutput:
//寮�鍏冲姛鑳�
- if ((common as ZigBee.Device.ToggleLight).DeviceStatusReport.CluterID == 6)
+ if (common.DeviceStatusReport.CluterID == 6)
{
var onOffOutputLight = deviceUI.CommonDevice as ZigBee.Device.ToggleLight;
- onOffOutputLight.DeviceStatusReport = (common as ZigBee.Device.ToggleLight).DeviceStatusReport;
+ onOffOutputLight.DeviceStatusReport = common.DeviceStatusReport;
//璁板綍銆佹洿鏂扮姸鎬�
if (onOffOutputLight.DeviceStatusReport.AttriBute == null || onOffOutputLight.DeviceStatusReport.AttriBute.Count == 0)
{
@@ -102,7 +104,7 @@
onOffOutputLight.LastDateTime = DateTime.Now;
}
//褰揅luterID=3,灏辫瘉鏄庤璁惧鍦ㄧ嚎锛岀洿鎺ユ爣璁�
- if ((common as ZigBee.Device.ToggleLight).DeviceStatusReport.CluterID == 3)
+ if (common.DeviceStatusReport.CluterID == 3)
{
var onOffOutputLight = deviceUI.CommonDevice as ToggleLight;
onOffOutputLight.IsOnline = 1;
@@ -113,10 +115,10 @@
case DeviceType.AirSwitch:
//寮�鍏冲姛鑳�
- if ((common as ZigBee.Device.AirSwitch).DeviceStatusReport.CluterID == 6)
+ if (common.DeviceStatusReport.CluterID == 6)
{
var airSwitch = deviceUI.CommonDevice as ZigBee.Device.AirSwitch;
- airSwitch.DeviceStatusReport = (common as ZigBee.Device.AirSwitch).DeviceStatusReport;
+ airSwitch.DeviceStatusReport = common.DeviceStatusReport;
//璁板綍銆佹洿鏂扮姸鎬�
if (airSwitch.DeviceStatusReport.AttriBute == null || airSwitch.DeviceStatusReport.AttriBute.Count == 0)
{
@@ -128,7 +130,7 @@
}
//褰揅luterID=3,灏辫瘉鏄庤璁惧鍦ㄧ嚎锛岀洿鎺ユ爣璁�
- if ((common as ZigBee.Device.AirSwitch).DeviceStatusReport.CluterID == 3)
+ if (common.DeviceStatusReport.CluterID == 3)
{
var airSwitch = deviceUI.CommonDevice as AirSwitch;
airSwitch.IsOnline = 1;
@@ -138,7 +140,24 @@
break;
case DeviceType.WindowCoveringDevice:
- if ((common as ZigBee.Device.Rollershade).DeviceStatusReport.CluterID == 3)
+ if (common.DeviceStatusReport.CluterID == 258)
+ {
+ var rollershade = deviceUI.CommonDevice as ZigBee.Device.Rollershade;
+ rollershade.DeviceStatusReport = common.DeviceStatusReport;
+ var attriButeList = rollershade.DeviceStatusReport.AttriBute;
+ if (attriButeList == null || attriButeList.Count == 0)
+ {
+ continue;
+ }
+ switch (attriButeList[0].AttributeId)
+ {
+ case 0:
+ rollershade.WcdType = attriButeList[0].AttriButeData;
+ rollershade.LastDateTime = DateTime.Now;
+ break;
+ }
+ }
+ if (common.DeviceStatusReport.CluterID == 3)
{
var rollershade = deviceUI.CommonDevice as ZigBee.Device.Rollershade;
rollershade.IsOnline = 1;
@@ -149,10 +168,10 @@
case DeviceType.Thermostat:
//AC鍔熻兘
- if ((common as ZigBee.Device.AC).DeviceStatusReport.CluterID == 513)
+ if (common.DeviceStatusReport.CluterID == 513)
{
var ac = deviceUI.CommonDevice as ZigBee.Device.AC;
- ac.DeviceStatusReport = (common as ZigBee.Device.AC).DeviceStatusReport;
+ ac.DeviceStatusReport = common.DeviceStatusReport;
var attriButeList = ac.DeviceStatusReport.AttriBute;
if (attriButeList == null || attriButeList.Count == 0)
{
@@ -178,6 +197,12 @@
ac.LastDateTime = DateTime.Now;
break;
+ case 4096:
+ //姝ゅ睘鎬ц〃鏄庢璁惧褰撳墠鐨勮嚜鍔ㄦ俯搴︼紝瀹為檯娓╁害涓衡�淎utoSetpoint / 100鈥濓紝鍗曚綅锛氣剝銆�
+ ac.currentAutoSetpoint = (attriButeList[0].AttriButeData / 100 > ACControlBase.Temperature_High || attriButeList[0].AttriButeData / 100 < ACControlBase.Temperature_Low) ? attriButeList[0].AttriButeData / 100 : ACControlBase.Temperature_Default;
+ ac.LastDateTime = DateTime.Now;
+ break;
+
case 28:
//姝ゅ睘鎬ф弿杩版亽娓╄澶囨澶勪簬鍝妯″紡
//Off = 0 Auto = 1 Cool = 3 Heat = 4 FanOnly = 7 Dry = 8
@@ -189,7 +214,7 @@
}
//褰揅luterID=3,灏辫瘉鏄庤璁惧鍦ㄧ嚎锛岀洿鎺ユ爣璁�
- if ((common as ZigBee.Device.AC).DeviceStatusReport.CluterID == 3)
+ if (common.DeviceStatusReport.CluterID == 3)
{
var ac = deviceUI.CommonDevice as AC;
ac.IsOnline = 1;
@@ -202,10 +227,10 @@
case DeviceType.DimmableLight:
//璋冨厜鐏姛鑳�
//寮�鍏冲姛鑳�
- if ((common as ZigBee.Device.DimmableLight).DeviceStatusReport.CluterID == 6)
+ if (common.DeviceStatusReport.CluterID == 6)
{
var dimmableLight = deviceUI.CommonDevice as ZigBee.Device.DimmableLight;
- dimmableLight.DeviceStatusReport = (common as ZigBee.Device.DimmableLight).DeviceStatusReport;
+ dimmableLight.DeviceStatusReport = common.DeviceStatusReport;
//璁板綍銆佹洿鏂扮姸鎬�
if (dimmableLight.DeviceStatusReport.AttriBute == null || dimmableLight.DeviceStatusReport.AttriBute.Count == 0)
{
@@ -216,10 +241,10 @@
dimmableLight.LastDateTime = DateTime.Now;
}
//浜害
- if ((common as ZigBee.Device.DimmableLight).DeviceStatusReport.CluterID == 8)
+ if (common.DeviceStatusReport.CluterID == 8)
{
var dimmableLight = deviceUI.CommonDevice as ZigBee.Device.DimmableLight;
- dimmableLight.DeviceStatusReport = (common as ZigBee.Device.DimmableLight).DeviceStatusReport;
+ dimmableLight.DeviceStatusReport = common.DeviceStatusReport;
var attriButeList = dimmableLight.DeviceStatusReport.AttriBute;
if (attriButeList == null || attriButeList.Count == 0)
{
@@ -235,7 +260,7 @@
}
}
//褰揅luterID=3,灏辫瘉鏄庤璁惧鍦ㄧ嚎锛岀洿鎺ユ爣璁�
- if ((common as ZigBee.Device.DimmableLight).DeviceStatusReport.CluterID == 3)
+ if (common.DeviceStatusReport.CluterID == 3)
{
var dimmableLight = deviceUI.CommonDevice as DimmableLight;
dimmableLight.IsOnline = 1;
@@ -273,31 +298,31 @@
{
case DeviceType.OnOffOutput:
var onOffOutputLight = deviceUI.CommonDevice as ToggleLight;
- onOffOutputLight.IsOnline = (common as ToggleLight).IsOnline;
+ onOffOutputLight.IsOnline = common.IsOnline;
//璁板綍鍥炲鏃堕棿
onOffOutputLight.LastDateTime = DateTime.Now;
break;
case DeviceType.AirSwitch:
var airSwitch = deviceUI.CommonDevice as AirSwitch;
- airSwitch.IsOnline = (common as AirSwitch).IsOnline;
+ airSwitch.IsOnline = common.IsOnline;
//璁板綍鍥炲鏃堕棿
airSwitch.LastDateTime = DateTime.Now;
break;
case DeviceType.WindowCoveringDevice:
var rollershade = deviceUI.CommonDevice as ZigBee.Device.Rollershade;
- rollershade.IsOnline = (common as Rollershade).IsOnline;
+ rollershade.IsOnline = common.IsOnline;
//璁板綍鍥炲鏃堕棿
rollershade.LastDateTime = DateTime.Now;
break;
case DeviceType.Thermostat:
var ac = deviceUI.CommonDevice as ZigBee.Device.AC;
- ac.IsOnline = (common as ZigBee.Device.AC).IsOnline;
+ ac.IsOnline = common.IsOnline;
//璁板綍鍥炲鏃堕棿
ac.LastDateTime = DateTime.Now;
break;
case DeviceType.DimmableLight:
var dimmableLight = deviceUI.CommonDevice as ZigBee.Device.DimmableLight;
- dimmableLight.IsOnline = (common as ZigBee.Device.DimmableLight).IsOnline;
+ dimmableLight.IsOnline = common.IsOnline;
//璁板綍鍥炲鏃堕棿
dimmableLight.LastDateTime = DateTime.Now;
break;
@@ -368,8 +393,18 @@
{
Y = Application.GetRealHeight(CommonPage.AppRealHeight - CommonPage.TabbarHeight),
Height = Application.GetRealHeight(CommonPage.TabbarHeight),
- BackgroundColor = Shared.Common.ZigbeeColor.Current.GXCTopViewBackgroundColor,
+ BackgroundColor = Shared.Common.ZigbeeColor.Current.GXCBottomColor,
};
+
+ #region 鍒嗗壊绾�
+
+ private Button bottomLine = new Button
+ {
+ Height = 1,
+ BackgroundColor = ZigbeeColor.Current.GXCBottomLineColor
+ };
+
+ #endregion
#region 搴曢儴-涓婚〉鎸夐挳
/// <summary>
@@ -402,10 +437,11 @@
Y = Application.GetRealHeight(tabBarEnumName_Y),
Height = Application.GetRealHeight(tabBarEnumName_Height),
TextID = R.MyInternationalizationString.HomePage,
- TextColor = Shared.Common.ZigbeeColor.Current.GXCTextBlackColor,
- SelectedTextColor = Shared.Common.ZigbeeColor.Current.GXCTextBlueColor,
+ TextColor = Shared.Common.ZigbeeColor.Current.GXCTextBottomUnSelectedColor,
+ SelectedTextColor = Shared.Common.ZigbeeColor.Current.GXCTextBlackColor2,
IsSelected = true,
- Gravity = Gravity.CenterHorizontal
+ Gravity = Gravity.CenterHorizontal,
+ TextSize = 10
};
#endregion
@@ -439,10 +475,11 @@
Y = Application.GetRealHeight(tabBarEnumName_Y),
Height = Application.GetRealHeight(tabBarEnumName_Height),
TextID = R.MyInternationalizationString.Category,
- TextColor = Shared.Common.ZigbeeColor.Current.GXCTextBlackColor,
- SelectedTextColor = Shared.Common.ZigbeeColor.Current.GXCTextBlueColor,
+ TextColor = Shared.Common.ZigbeeColor.Current.GXCTextBottomUnSelectedColor,
+ SelectedTextColor = Shared.Common.ZigbeeColor.Current.GXCTextBlackColor2,
IsSelected = false,
- Gravity = Gravity.CenterHorizontal
+ Gravity = Gravity.CenterHorizontal,
+ TextSize=10
};
#endregion
@@ -476,27 +513,17 @@
Y = Application.GetRealHeight(tabBarEnumName_Y),
Height = Application.GetRealHeight(tabBarEnumName_Height),
TextID = R.MyInternationalizationString.Me,
- TextColor = ZigbeeColor.Current.GXCTextBlackColor,
- SelectedTextColor = ZigbeeColor.Current.GXCTextBlueColor,
+ TextColor = Shared.Common.ZigbeeColor.Current.GXCTextBottomUnSelectedColor,
+ SelectedTextColor = Shared.Common.ZigbeeColor.Current.GXCTextBlackColor2,
IsSelected = false,
- Gravity = Gravity.CenterHorizontal
+ Gravity = Gravity.CenterHorizontal,
+ TextSize = 10
};
#endregion
- #region 鍒嗗壊绾�
-
- private FrameLayout bottomLine = new FrameLayout
- {
- Height = 3,
- BackgroundColor = ZigbeeColor.Current.GXCBackgroundColor
- };
-
- #endregion
EventHandler<MouseEventArgs> BottomEventHandler = (sender, e) =>
{
- Room.GetAllRoomDeviceUIList();
-
Instance.homePageName.IsSelected = false;
Instance.homePageIMG.IsSelected = false;
@@ -530,7 +557,7 @@
//涓汉涓績
Instance.settingName.IsSelected = true;
Instance.settingIMG.IsSelected = true;
- var form = new UserCenter.User.UserMainForm();
+ var form = new UserCenter.UserMain.UserMainForm();
Instance.BodyView.AddChidren(form);
form.ShowForm();
}
@@ -557,6 +584,8 @@
AddChidren(BodyView);
AddChidren(BottomMenuView);
+ BottomMenuView.AddChidren(Instance.bottomLine);
+
Instance.homePageFL.AddChidren(Instance.homePageIMG);
Instance.homePageFL.AddChidren(Instance.homePageName);
BottomMenuView.AddChidren(Instance.homePageFL);
@@ -568,8 +597,6 @@
Instance.settingFL.AddChidren(Instance.settingIMG);
Instance.settingFL.AddChidren(Instance.settingName);
BottomMenuView.AddChidren(Instance.settingFL);
-
- BottomMenuView.AddChidren(Instance.bottomLine);
homePageIMG.MouseUpEventHandler += BottomEventHandler;
homePageName.MouseUpEventHandler += BottomEventHandler;
--
Gitblit v1.8.0