From 737c036a39176fd2085ce82b7c60391da8cb508c Mon Sep 17 00:00:00 2001
From: 黄学彪 <hxb@hdlchina.com.cn>
Date: 星期二, 31 十二月 2019 19:17:47 +0800
Subject: [PATCH] 合并了代码
---
ZigbeeApp/Shared/Phone/Device/AC/ACControl.cs | 1325 +++++++++++++++++++++++++++++++++++++--------------------
1 files changed, 858 insertions(+), 467 deletions(-)
diff --git a/ZigbeeApp/Shared/Phone/Device/AC/ACControl.cs b/ZigbeeApp/Shared/Phone/Device/AC/ACControl.cs
index 6b7666b..0ba99c3 100755
--- a/ZigbeeApp/Shared/Phone/Device/AC/ACControl.cs
+++ b/ZigbeeApp/Shared/Phone/Device/AC/ACControl.cs
@@ -1,6 +1,9 @@
锘縰sing System;
using Shared.Common;
using ZigBee.Device;
+using Shared.Phone.Device.CommonForm;
+using Shared.Phone.UserView;
+using Shared.Phone.Device.DeviceLogic;
namespace Shared.Phone.Device.AC
{
@@ -11,46 +14,64 @@
/// The action.
/// </summary>
public Action action;
- ///// <summary>
- ///// The top view.
- ///// </summary>
- private CommonForm.TopFrameLayout topFL;
- /// <summary>
- /// 鏇村璁剧疆
- /// </summary>
- private Button moreBtn;
- /// <summary>
- /// 浼犺繃鏉ョ殑璁惧
- /// </summary>
- private DeviceUI device;
- /// <summary>
- /// 浼犺繃鏉ョ殑ac
- /// </summary>
- private ZigBee.Device.AC ac;
- /// <summary>
- /// 浼犺繃鏉ョ殑鎴块棿
- /// </summary>
- private Shared.Common.Room room;
- /// <summary>
- /// The middle fl.
- /// </summary>
- private FrameLayout midFL;
+
/// <summary>
/// 鏀惰棌鎸夐挳
/// </summary>
private Button collectionBtn;
/// <summary>
- /// 褰撳墠瀹ゅ唴娓╁害
+ /// 浼犺繃鏉ョ殑璁惧
+ /// </summary>
+ private DeviceUI device;
+ /// <summary>
+ /// 浼犺繃鏉ョ殑鎴块棿
+ /// </summary>
+ private Shared.Common.Room room;
+
+ /// <summary>
+ /// 鎴块棿
+ /// </summary>
+ private Button roomBtn;
+ /// <summary>
+ /// 鎴块棿鍚�
+ /// </summary>
+ private Button roomName;
+ /// <summary>
+ /// 缃戝叧
+ /// </summary>
+ private ZbGateway zbGateway = null;
+ /// <summary>
+ /// 鏄惁鍙戦�佹帶鍒跺懡浠ゆ垚鍔熶簡
+ /// </summary>
+ private bool sendedControlCommand = false;
+
+ /// <summary>
+ /// bodyFrameLayout
+ /// </summary>
+ private FrameLayout bodyFrameLayout;
+ /// <summary>
+ /// 瀹ゆ俯
/// </summary>
private Button indoorTemperatureBtn;
+
+ /// <summary>
+ /// OpenOrUpBtn
+ /// </summary>
+ public Button OpenOrUpBtn;
+ /// <summary>
+ /// OpenOrUpBtn
+ /// </summary>
+ public Button CloseOrDownBtn;
+ /// <summary>
+ /// StopBtn
+ /// </summary>
+ public Button StopBtn;
+
+
/// <summary>
/// 褰撳墠妯″紡
/// </summary>
private Button currentModeBtn;
- /// <summary>
- /// 褰撳墠娓╁害
- /// </summary>
- private Button currentTemperatureBtn;
/// <summary>
/// 娣诲姞娓╁害
/// </summary>
@@ -72,6 +93,10 @@
/// </summary>
private Button fanModeBtn;
/// <summary>
+ /// 鎵妯″紡
+ /// </summary>
+ private Button FanSwingModeBtn;
+ /// <summary>
/// 椋庨�熼�夋嫨瑙嗗浘
/// </summary>
private Dialog fanModeDialog;
@@ -80,10 +105,26 @@
/// </summary>
private Dialog acModeDialog;
+ /// <summary>
+ /// 浼犺繃鏉ョ殑ac
+ /// </summary>
+ private ZigBee.Device.AC ac;
+ /// <summary>
+ /// mArcScaleSeekBar
+ /// </summary>
+ private ArcScaleSeekBar mArcScaleSeekBar = new ArcScaleSeekBar { };
+ /// <summary>
+ /// 娓呮磥鐘舵��
+ /// </summary>
+ private LeftIconButtonRow cleanStatu;
+ /// <summary>
+ /// IsDrawerLockMode
+ /// </summary>
+ public bool IsDrawerLockMode;
#endregion
- #region 鈼� 鎺ュ彛__________________________
+ #region 鈼� 鎺ュ彛___________________________
/// <summary>
/// 澶勭悊鍙樺寲浜嬩欢 --灏嗗純鐢� 鏀圭敤DeviceInfoChange()
/// </summary>
@@ -92,22 +133,6 @@
public void Changed(CommonDevice common)
{
- }
- /// <summary>
- /// Changeds the IL ogic status.
- /// </summary>
- /// <param name="logic">Logic.</param>
- public void ChangedILogicStatus(ZigBee.Device.Logic logic)
- {
- //throw new NotImplementedException();
- }
- /// <summary>
- /// Changeds the IS cene status.
- /// </summary>
- /// <param name="scene">Scene.</param>
- public void ChangedISceneStatus(Scene scene)
- {
- //throw new NotImplementedException();
}
/// <summary>
/// 璁惧鐘舵�佹洿鏂版帴鍙�
@@ -128,106 +153,138 @@
try
{
var deviceUI = device;
- //璁惧涓虹┖
if (deviceUI.CommonDevice == null)
{
return;
}
- //鏄惁涓哄綋鍓嶈澶�
if (deviceUI.CommonDevice.DeviceEpoint != common.DeviceEpoint || deviceUI.CommonDevice.DeviceAddr != common.DeviceAddr)
{
return;
}
- if (deviceUI.CommonDevice.Type == DeviceType.Thermostat)
+
+ if (common.DeviceStatusReport.CluterID == 513)
{
- //Thermostat鍔熻兘
- if ((common as ZigBee.Device.AC).DeviceStatusReport.CluterID == 513)
+ var attriButeList = common.DeviceStatusReport.AttriBute;
+ if (attriButeList == null || attriButeList.Count == 0)
{
- var attriButeList = (common as ZigBee.Device.AC).DeviceStatusReport.AttriBute;
- if (attriButeList == null || attriButeList.Count == 0)
- {
- return;
- }
- ac.DeviceStatusReport = (common as ZigBee.Device.AC).DeviceStatusReport;
- switch (attriButeList[0].AttributeId)
+ return;
+ }
+ deviceUI.CommonDevice.DeviceStatusReport = common.DeviceStatusReport;
+ foreach(var attList in attriButeList)
+ {
+ var curTemp = (attList.AttriButeData / 100 < ACControlBase.Temperature_High && attList.AttriButeData / 100 > ACControlBase.Temperature_Low) ? attList.AttriButeData / 100 : ACControlBase.Temperature_Default;
+ switch (attList.AttributeId)
{
case 0:
- //姝ゅ睘鎬ц〃鏄庡鍐呭綋鍓嶇殑娓╁害 * 100锛屽疄闄呮俯搴︿负鈥淟ocalTemperature / 100鈥濓紝鍗曚綅锛氣剝
- ac.currentLocalTemperature = attriButeList[0].AttriButeData/100;
+ ac.currentLocalTemperature = curTemp;
ac.LastDateTime = DateTime.Now;
- indoorTemperatureBtn.Text = $"{Language.StringByID(R.MyInternationalizationString.IndoorTemperature)} {ac.currentLocalTemperature} 鈩�";
- currentTemperatureBtn.Text = $"{ac.currentLocalTemperature} 鈩�";
+ indoorTemperatureBtn.Text = $"{Language.StringByID(R.MyInternationalizationString.Current)} {ac.currentLocalTemperature} 鈩�";
+ //currentTemperatureBtn.Text = $"{ac.currentLocalTemperature} 鈩�";
break;
-
case 17:
- //姝ゅ睘鎬ц〃鏄庢璁惧褰撳墠鐨勫埗鍐锋俯搴︼紝瀹為檯娓╁害涓衡�淐oolingSetpoint / 100鈥濓紝鍗曚綅锛氣剝銆�
- ac.currentCoolingSetpoint = attriButeList[0].AttriButeData/100;
+ ac.currentCoolingSetpoint = curTemp;
+ if (ac.currentSystemMode == 3 || ac.currentSystemMode == 8)
+ {
+ mArcScaleSeekBar.Progress = ac.currentCoolingSetpoint;
+ }
ac.LastDateTime = DateTime.Now;
break;
-
case 18:
- //姝ゅ睘鎬ц〃鏄庢璁惧褰撳墠鐨勫埗鐑俯搴︼紝瀹為檯娓╁害涓衡�淗eatingSetpoint / 100鈥濓紝鍗曚綅锛氣剝銆�
- ac.currentHeatingSetpoint = attriButeList[0].AttriButeData/100;
+ ac.currentHeatingSetpoint = curTemp;
+ if (ac.currentSystemMode == 4)
+ {
+ mArcScaleSeekBar.Progress = ac.currentHeatingSetpoint;
+ }
ac.LastDateTime = DateTime.Now;
break;
-
+ case 4096:
+ ac.currentAutoSetpoint = curTemp;
+ if (ac.currentSystemMode == 1)
+ {
+ mArcScaleSeekBar.Progress = ac.currentAutoSetpoint;
+ }
+ ac.LastDateTime = DateTime.Now;
+ break;
case 28:
//姝ゅ睘鎬ф弿杩版亽娓╄澶囨澶勪簬鍝妯″紡
//Off = 0 Auto = 1 Cool = 3 Heat = 4 FanOnly = 7 Dry = 8
- ac.currentSystemMode = attriButeList[0].AttriButeData;
+ ac.currentSystemMode = attList.AttriButeData;
ac.LastDateTime = DateTime.Now;
if (ac.currentSystemMode == 0)
{
switchBtn.IsSelected = false;
modeBtn.IsSelected = false;
- modeBtn.SelectedImagePath = ACControlBase.GetModeSelectedImagePathByModeId(ac.currentSystemMode);
- modeBtn.UnSelectedImagePath = ACControlBase.GetModeUnSelectedImagePathByModeId(ac.currentSystemMode);
- currentModeBtn.Text = ACControlBase.GetModeNameByModeId(ac.currentSystemMode);
+ fanModeBtn.IsSelected = false;
+ FanSwingModeBtn.IsSelected = false;
+ mArcScaleSeekBar.SetProgressBarColors(ZigbeeColor.Current.GXCWaveSeekBarUnSelectedColor, ZigbeeColor.Current.GXCWaveSeekBarUnSelectedColor);
}
else if (ac.currentSystemMode == 1 || ac.currentSystemMode == 3 || ac.currentSystemMode == 4 || ac.currentSystemMode == 7 || ac.currentSystemMode == 8)
{
switchBtn.IsSelected = true;
modeBtn.IsSelected = true;
- modeBtn.SelectedImagePath = ACControlBase.GetModeSelectedImagePathByModeId(ac.currentSystemMode);
- modeBtn.UnSelectedImagePath = ACControlBase.GetModeUnSelectedImagePathByModeId(ac.currentSystemMode);
- currentModeBtn.Text = ACControlBase.GetModeNameByModeId(ac.currentSystemMode);
+ fanModeBtn.IsSelected = true;
+ FanSwingModeBtn.IsSelected = true;
+ mArcScaleSeekBar.SetProgressBarColors(ZigbeeColor.Current.GXCArcScaleSeekBarStartColor, ZigbeeColor.Current.GXCArcScaleSeekBarEndColor);
+ }
+ modeBtn.SelectedImagePath = ACControlBase.GetModeSelectedImagePathByModeId(ac.currentSystemMode);
+ modeBtn.UnSelectedImagePath = ACControlBase.GetModeUnSelectedImagePathByModeId(ac.currentSystemMode);
+ currentModeBtn.Text = ACControlBase.GetModeNameByModeId(ac.currentSystemMode);
+ mArcScaleSeekBar.Progress = ACControlBase.GetCurrentModeTemperature(ac);
+ mArcScaleSeekBar.IsClickable = ACControlBase.IsOpen(ac);
+ break;
+ case 4097:
+ //杩囪檻缃戞竻娲楁爣蹇�:42
+ ac.CleanStatu = attList.AttriButeData == 42;
+ cleanStatu.Visible = ac.CleanStatu;
+ break;
+ case 4099:
+ var value = Convert.ToString(attList.AttriButeData, 2).PadLeft(16, '0');
+ var modeStr = value.Substring(value.Length - 5, 5);
+ for (int j = 0; j < modeStr.Length; j++)
+ {
+ ac.listSupportMode[j] = Convert.ToInt32(modeStr[j]) == 49 ? 1 : 0;
}
break;
}
-
}
}
- //Fan Control鍔熻兘
- if ((common as ZigBee.Device.AC).DeviceStatusReport.CluterID == 514)
+
+ if (common.DeviceStatusReport.CluterID == 514)
{
- var attriButeList = (common as ZigBee.Device.AC).DeviceStatusReport.AttriBute;
- if (attriButeList == null || attriButeList.Count == 0)
+ var attriButeList = common.DeviceStatusReport.AttriBute;
+ ac.DeviceStatusReport = common.DeviceStatusReport;
+ foreach(var attList in attriButeList)
{
- return;
+ switch (attList.AttributeId)
+ {
+ case 0:
+ //椋庢墖褰撳墠鐨勫伐浣滄ā寮� 1=Low 2=Medium 3=High
+ ac.currentFanMode = attList.AttriButeData;
+ ac.LastDateTime = DateTime.Now;
+ fanModeBtn.IsSelected = true;
+ fanModeBtn.SelectedImagePath = ACControlBase.GetFanModeSelectedImagePathByFanModeId(ac.currentFanMode);
+ fanModeBtn.UnSelectedImagePath = ACControlBase.GetFanModeUnSelectedImagePathByFanModeId(ac.currentFanMode);
+ break;
+ case 4096:
+ //椋庢墖褰撳墠鐨勬壂椋庢ā寮�
+ ac.currentFanSwingMode = attList.AttriButeData;
+ ac.LastDateTime = DateTime.Now;
+ FanSwingModeBtn.IsSelected = true;
+ FanSwingModeBtn.SelectedImagePath = ACControlBase.GetFanSwingModeSelectedImagePathByFanSwingModeId(ac.currentFanSwingMode);
+ FanSwingModeBtn.UnSelectedImagePath = ACControlBase.GetFanSwingModeUnSelectedImagePathByFanSwingModeId(ac.currentFanSwingMode);
+ break;
+ }
}
- ac.DeviceStatusReport = (common as ZigBee.Device.AC).DeviceStatusReport;
- switch (attriButeList[0].AttributeId)
- {
- case 0:
- //椋庢墖褰撳墠鐨勫伐浣滄ā寮� 1=Low 2=Medium 3=High
- ac.currentFanMode = attriButeList[0].AttriButeData;
- ac.LastDateTime = DateTime.Now;
- fanModeBtn.IsSelected = true;
- fanModeBtn.SelectedImagePath = ACControlBase.GetFanModeSelectedImagePathByFanModeId(ac.currentFanMode);
- fanModeBtn.UnSelectedImagePath = ACControlBase.GetFanModeUnSelectedImagePathByFanModeId(ac.currentFanMode);
- break;
- }
- //***鏂版敼***璁惧鐘舵�佷笂鎶ヤ腑锛屽綋CluterID=3,璇佹槑璁惧鍦ㄧ嚎锛岀洿鎺ユ爣璁�
- //else if ((common as ToggleLight).DeviceStatusReport.CluterID == 3)
- //{
- //var light = deviceUI.CommonDevice as ToggleLight;
- //light.IsOnline = 1;
- //deviceIMG.IsSelected = light.IsOnline == 1;
- //light.LastDateTime = DateTime.Now;
- //}
+ }
+ //***鏂版敼 * **璁惧鐘舵�佷笂鎶ヤ腑锛屽綋CluterID = 3,璇佹槑璁惧鍦ㄧ嚎锛岀洿鎺ユ爣璁�
+ else if (common.DeviceStatusReport.CluterID == 3)
+ {
+ ac.IsOnline = 1;
+ switchBtn.IsSelected = true;
+ ac.LastDateTime = DateTime.Now;
+ }
}
- }
catch (Exception ex)
{
System.Console.WriteLine($"Error:{ex.Message}");
@@ -253,9 +310,7 @@
}
if (deviceUI.CommonDevice.Type == DeviceType.Thermostat)
{
- ac = deviceUI.CommonDevice as ZigBee.Device.AC;
- ac.IsOnline = (common as DimmableLight).IsOnline;
- //deviceIMG.IsSelected = light.IsOnline == 1;
+ ac.IsOnline = common.IsOnline;
ac.LastDateTime = DateTime.Now;
}
}
@@ -266,68 +321,87 @@
});
}
}
-
-
- #endregion
-
- #region 鈼� 閲嶅啓绉婚櫎_______________________
-
/// <summary>
- /// Removes from parent.
+ /// Changeds the IL ogic status.
/// </summary>
- public override void RemoveFromParent()
+ /// <param name="logic">Logic.</param>
+ public void ChangedILogicStatus(ZigBee.Device.Logic logic)
{
- ZbGateway.StatusList.Remove(this);
- base.RemoveFromParent();
+ //throw new NotImplementedException();
}
-
+ /// <summary>
+ /// Changeds the IS cene status.
+ /// </summary>
+ /// <param name="scene">Scene.</param>
+ public void ChangedISceneStatus(Scene scene)
+ {
+ //throw new NotImplementedException();
+ }
#endregion
- #region 鈼� 鏋勯�犳柟娉昣______________________
+ #region 鈼� 鏋勯�犳柟娉昣_______________________
+
/// <summary>
/// 鏋勯�犳柟娉�
/// </summary>
public ACControl()
{
BackgroundColor = ZigbeeColor.Current.GXCBackgroundColor;
+ ZigBee.Device.ZbGateway.StatusList.Add(this);
+ HomePage.Instance.ScrollEnabled = false;
+
}
#endregion
- #region 鈼� 鍒濆鍖朹_______________________
+ #region 鈼� 閲嶅啓绉婚櫎鏂规硶____________________
/// <summary>
- /// 鍒濆鍖�
+ /// Removes from parent.
/// </summary>
- /// <param name="device">Device.</param>
- /// <param name="room">Room.</param>
- private void InitAC(DeviceUI device, Common.Room room)
+ public override void RemoveFromParent()
{
- ZbGateway.StatusList.Add(this);
- this.device = device;
+ ZigBee.Device.ZbGateway.StatusList.Remove(this);
+ //action();
+ //action = null;
+ RemoveUpdateControlDeviceStatuAction();
+ HomePage.Instance.ScrollEnabled = true;
+ if (IsDrawerLockMode)
+ {
+ CommonPage.Instance.IsDrawerLockMode = false;
+ }
+ base.RemoveFromParent();
+ }
+
+ #endregion
+
+ #region 鈼� 鏄剧ず鐣岄潰________________________
+
+ /// <summary>
+ /// 鏄剧ず鐣岄潰
+ /// </summary>
+ /// <param name="dev">Device.</param>
+ /// <param name="room">Room.</param>
+ public void Show(DeviceUI dev, Shared.Common.Room room)
+ {
+ device = dev;
+ zbGateway = this.device.CommonDevice.Gateway;
this.room = room;
this.ac = device.CommonDevice as ZigBee.Device.AC;
+ AddTop();
- //娣诲姞topview
- AddTopView();
- //娣诲姞midview
- AddMidview();
- //缁戝畾浜嬩欢
- BindEvent();
- //鏀惰棌
- InitCollection();
+ AddBodyView(device);
+ if (ac.Gateway == null)
+ {
+ return;
+ }
if (ac.Gateway.IsVirtual)
{
//鍙戦�佽鍙栫姸鎬佸懡浠�
UserView.UserHomeView.ReadStatus(ac, () =>
{
- ac.ReadAttri(Cluster_ID.Identify, AttriButeId.Switch);
- ac.ReadFanMode();
- ac.ReadSystemMode();
- ac.ReadLocalTemperature();
- ac.ReadCoolingSetpoint();
- ac.ReadHeatingSetpoint();
+ ReadDeviceAttributeLogic.Instance.SendACStatuComand(device.CommonDevice);
});
}
else
@@ -335,24 +409,12 @@
//闃叉鐭椂闂村唴澶氭璇诲彇璁惧鐘舵��
if ((DateTime.Now - ac.LastDateTime).TotalSeconds > CommonPage.ReadDeviceStatuSpan)
{
- ac.ReadAttri(Cluster_ID.Identify, AttriButeId.Switch);
- ac.ReadFanMode();
- ac.ReadSystemMode();
- ac.ReadLocalTemperature();
- ac.ReadCoolingSetpoint();
- ac.ReadHeatingSetpoint();
+ ReadDeviceAttributeLogic.Instance.SendACStatuComand(device.CommonDevice);
}
}
- }
-
- /// <summary>
- /// Inits the collection.
- /// </summary>
- private void InitCollection()
- {
- var dev = Shared.Common.Room.LoveRoomDeviceUIFilePathList.Find((obj) => obj == device.FileName);
- if (dev == null)
+ var de = Shared.Common.Room.LoveRoomDeviceUIFilePathList.Find((obj) => obj == device.FileName);
+ if (de == null)
{
collectionBtn.IsSelected = false;
}
@@ -360,284 +422,307 @@
{
collectionBtn.IsSelected = true;
}
- }
-
- #endregion
-
- #region 鈼� 鏄剧ず鐣岄潰_______________________
- /// <summary>
- /// 鏄剧ず鐣岄潰
- /// </summary>
- /// <param name="device">Device.</param>
- /// <param name="room">Room.</param>
- public void Show(DeviceUI device, Shared.Common.Room room)
- {
- InitAC(device, room);
+ BindEvent();
}
#endregion
- #region 鈼� topview_______________________
+ #region 鈼� Add____________________________
/// <summary>
- /// Adds the top view.
+ /// AddTop
/// </summary>
- private void AddTopView()
+ public void AddTop()
{
- topFL = new CommonForm.TopFrameLayout(this) { };
- AddChidren(topFL);
-
- AddMoreview();
- }
-
- /// <summary>
- /// Adds the moreview.
- /// </summary>
- private void AddMoreview()
- {
- moreBtn = new CommonForm.SelectedStatuButton()
+ var top = new TopFrameLayout();
+ AddChidren(top);
+ top.InitTopview();
+ top.backButton.MouseUpEventHandler += (sender, e) =>
{
- X = Application.GetRealWidth(CommonPage.AppRealWidth - 150),
- Width = Application.GetMinReal(110),
- Height = Application.GetMinReal(110),
+ RemoveFromParent();
+ };
+
+ var moreBtn = new Button
+ {
+ X = Application.GetRealWidth(953),
+ Width = Application.GetMinReal(69),
+ Height = Application.GetMinReal(69),
Gravity = Gravity.CenterVertical,
- UnSelectedImagePath = "Item/More.png",
- SelectedImagePath = "Item/MoreSelected.png",
+ UnSelectedImagePath = "Item/More.png"
};
- topFL.topView.AddChidren(moreBtn);
- moreBtn.MouseUpEventHandler += MoreEvent;
- }
+ top.topView.AddChidren(moreBtn);
+ moreBtn.MouseUpEventHandler += More;
+ }
/// <summary>
- /// 鏇村璁剧疆
+ /// AddBodyView
/// </summary>
- /// <param name="sender">Sender.</param>
- /// <param name="e">E.</param>
- private void MoreEvent(object sender, MouseEventArgs e)
+ public void AddBodyView(DeviceUI device)
{
- var detailInfo = new Device.CommonForm.DeviceDetailInfo { };
- UserView.HomePage.Instance.AddChidren(detailInfo);
- UserView.HomePage.Instance.PageIndex += 1;
- detailInfo.Show(device, room);
- detailInfo.action = () =>
+ bodyFrameLayout = new FrameLayout()
{
- Show(device, room);
+ Y = Application.GetRealHeight(184),
+ Height = Application.GetRealHeight(1737),
+ BackgroundColor = ZigbeeColor.Current.GXCGrayBackgroundColor,
};
- }
+ AddChidren(bodyFrameLayout);
- #endregion
-
- #region 鈼� midview_______________________
-
- /// <summary>
- /// Adds the midview.
- /// </summary>
- private void AddMidview()
- {
- midFL = new FrameLayout()
- {
- Height = Application.GetRealHeight(CommonPage.AppRealHeight - CommonPage.Navigation_Height),
- Y = topFL.Bottom,
- BackgroundColor = ZigbeeColor.Current.GXCBackgroundColor
- };
- AddChidren(midFL);
-
- AddItemview();
- }
-
- #endregion
-
- #region 鈼� itemview_______________________
- /// <summary>
- /// Adds the itemview.
- /// </summary>
- private void AddItemview()
- {
var itemView = new FrameLayout()
{
- Y=Application.GetRealHeight(115),
+ Y = Application.GetRealHeight(115),
Width = Application.GetRealWidth(965),
- Height = Application.GetRealHeight(1316),
- Radius = CommonPage.BigFormRadius,
+ Height = Application.GetRealHeight(1457),
+ Radius = (uint)Application.GetRealHeight(CommonFormResouce.BigFormRadius),
Gravity = Gravity.CenterHorizontal,
- BackgroundColor = ZigbeeColor.Current.GXCTopViewBackgroundColor
+ BackgroundColor = ZigbeeColor.Current.GXCBackgroundColor
};
- midFL.AddChidren(itemView);
- var deviceView = new FrameLayout()
- {
- X = 2,
- Y = 2,
- Width = itemView.Width - 4,
- Height = itemView.Height - Application.GetRealHeight(138),
- BackgroundColor = ZigbeeColor.Current.GXCBackgroundColor,
- Tag = device
- };
- itemView.AddChidren(deviceView);
+ bodyFrameLayout.AddChidren(itemView);
+
+ cleanStatu = new LeftIconButtonRow(400, 80, 0, 20);
+ itemView.AddChidren(cleanStatu);
+ cleanStatu.Init("AC/AC_TIP.png", "AC/AC_TIP.png", Language.StringByID(R.MyInternationalizationString.NeedCleanAC), false);
+ cleanStatu.Visible = false;
collectionBtn = new Button()
{
- X = deviceView.Width - Application.GetRealWidth(130),
- Y = Application.GetRealHeight(20),
- Width = Application.GetMinReal(110),
- Height = Application.GetMinReal(110),
+ X = Application.GetRealWidth(850),
+ Y = Application.GetRealHeight(46),
+ Width = Application.GetMinReal(69),
+ Height = Application.GetMinReal(69),
UnSelectedImagePath = "Item/Collection.png",
SelectedImagePath = "Item/CollectionSelected.png"
};
- deviceView.AddChidren(collectionBtn);
+ itemView.AddChidren(collectionBtn);
- var deviceName = new Button()
+ var deviceNameBtn = new Button()
{
- Y = Application.GetRealHeight(50),
- Height = Application.GetRealHeight(80),
- Width = Application.GetRealWidth(300),
+ Y = Application.GetRealHeight(184),
+ Width = Application.GetRealWidth(600),
+ Height = Application.GetRealHeight(60),
Gravity = Gravity.CenterHorizontal,
- Text=device.CommonDevice.DeviceEpointName,
- TextSize=15,
- TextColor=ZigbeeColor.Current.GXCTextBlackColor
+ Text = device.CommonDevice.DeviceEpointName,
+ TextColor = ZigbeeColor.Current.GXCTextBlackColor,
+ TextSize = 15
};
- deviceView.AddChidren(deviceName);
+ itemView.AddChidren(deviceNameBtn);
- indoorTemperatureBtn = new Button()
+ indoorTemperatureBtn = new Button
{
- Y = deviceName.Bottom,
- Height = Application.GetRealHeight(80),
- Width = Application.GetRealWidth(300),
+ Y = Application.GetRealHeight(256),
+ Width = Application.GetRealWidth(600),
+ Height = Application.GetRealHeight(60),
Gravity = Gravity.CenterHorizontal,
- Text = $"{Language.StringByID(R.MyInternationalizationString.IndoorTemperature)} {ac.currentLocalTemperature}掳C" ,
- TextSize = 12,
- TextColor = ZigbeeColor.Current.GXCPlaceHolderTextColor
+ TextColor = ZigbeeColor.Current.GXCTextGrayColor,
+ Text = $"{Language.StringByID(R.MyInternationalizationString.Current)} {ac.currentLocalTemperature} 鈩�"
};
- deviceView.AddChidren(indoorTemperatureBtn);
+ itemView.AddChidren(indoorTemperatureBtn);
- var controlBG = new FrameLayout()
+ mArcScaleSeekBar = new ArcScaleSeekBar
{
- Y = Application.GetRealHeight(323),
- Height = Application.GetMinRealAverage(547),
- Width = Application.GetMinRealAverage(671),
+ Y = Application.GetRealHeight(412),
+ Width = Application.GetRealWidth(671),
+ Height = Application.GetRealHeight(671),
Gravity = Gravity.CenterHorizontal,
- BackgroundImagePath = "AC/Group.png"
+ MinValue = ACControlBase.Temperature_Low,
+ MaxValue = ACControlBase.Temperature_High,
+ Progress = ACControlBase.GetCurrentModeTemperature(ac),
+ IsClickable = ACControlBase.IsOpen(ac)
};
- deviceView.AddChidren(controlBG);
-
- var controlBG2 = new Button()
+ itemView.AddChidren(mArcScaleSeekBar);
+ if(ACControlBase.IsOpen(ac))
{
- Y=Application.GetRealHeight(783),
- Height=Application.GetMinRealAverage(121),
- Width=Application.GetMinRealAverage(351),
- UnSelectedImagePath="AC/Path.png",
- Gravity=Gravity.CenterHorizontal
+ mArcScaleSeekBar.SetProgressBarColors(ZigbeeColor.Current.GXCArcScaleSeekBarStartColor, ZigbeeColor.Current.GXCArcScaleSeekBarEndColor);
+ }
+ else
+ {
+ mArcScaleSeekBar.SetProgressBarColors(ZigbeeColor.Current.GXCWaveSeekBarUnSelectedColor, ZigbeeColor.Current.GXCWaveSeekBarUnSelectedColor);
+ }
+ mArcScaleSeekBar.OnStopTrackingTouchEvent += (sender, e) =>
+ {
+ if (ac.currentSystemMode == 3 || ac.currentSystemMode == 8)
+ {
+ ac.currentCoolingSetpoint = e;
+ ac.SetCoolingTemperatureAsync(ac.currentCoolingSetpoint * 100);
+ }
+ else if (ac.currentSystemMode == 4)
+ {
+ ac.currentHeatingSetpoint = e;
+ ac.SetHeatingTemperatureAsync(ac.currentHeatingSetpoint * 100);
+ }
+ else if (ac.currentSystemMode == 1)
+ {
+ ac.currentAutoSetpoint = e;
+ ac.SetAutoTemperatureAsync(ac.currentAutoSetpoint * 100);
+ }
};
- deviceView.AddChidren(controlBG2);
- //褰撳墠妯″紡
+
currentModeBtn = new Button()
{
- Y = Application.GetRealHeight(187),
+ Y = Application.GetRealHeight(565),
Height = Application.GetRealHeight(80),
Width = Application.GetRealWidth(200),
TextColor = ZigbeeColor.Current.GXCTextBlackColor,
- Gravity=Gravity.CenterHorizontal,
- Text=ACControlBase.GetModeNameByModeId(ac.currentSystemMode)
+ Gravity = Gravity.CenterHorizontal,
+ Text = ACControlBase.GetModeNameByModeId(ac.currentSystemMode)
};
- controlBG.AddChidren(currentModeBtn);
- //闄嶄綆娓╁害
+ itemView.AddChidren(currentModeBtn);
+
reduceTemperatureBtn = new Button()
{
- X = Application.GetRealWidth(112),
- Y = Application.GetRealHeight(268),
+ X = Application.GetRealWidth(268),
+ Y = Application.GetRealHeight(650),
Width = Application.GetMinRealAverage(80),
Height = Application.GetMinRealAverage(80),
UnSelectedImagePath = "AC/Reduce.png"
};
- controlBG.AddChidren(reduceTemperatureBtn);
+ itemView.AddChidren(reduceTemperatureBtn);
- //娓╁害
- currentTemperatureBtn = new Button()
- {
- //X = Application.GetRealWidth(239),
- Y = Application.GetRealHeight(248),
- Width = Application.GetRealWidth(180),
- Height = Application.GetRealHeight(100),
- TextColor=ZigbeeColor.Current.GXCTextBlackColor,
- TextSize=15,
- Text=$"{ACControlBase.GetCurrentModeTemperature(ac)} 掳C",
- Gravity=Gravity.CenterHorizontal
- };
- controlBG.AddChidren(currentTemperatureBtn);
-
- //娣诲姞娓╁害
addTemperatureBtn = new Button()
{
- X = Application.GetRealWidth(472),
- Y = Application.GetRealHeight(268),
+ X = Application.GetRealWidth(610),
+ Y = Application.GetRealHeight(650),
Width = Application.GetMinRealAverage(80),
Height = Application.GetMinRealAverage(80),
UnSelectedImagePath = "AC/Add.png"
};
- controlBG.AddChidren(addTemperatureBtn);
+ itemView.AddChidren(addTemperatureBtn);
- //妯″紡
+ FanSwingModeBtn = new Button()
+ {
+ X = Application.GetRealWidth(156),
+ Y = Application.GetRealHeight(1086),
+ Width = Application.GetMinRealAverage(80),
+ Height = Application.GetMinRealAverage(80),
+ UnSelectedImagePath = ACControlBase.GetFanSwingModeUnSelectedImagePathByFanSwingModeId(ac.currentFanSwingMode),
+ SelectedImagePath = ACControlBase.GetFanSwingModeSelectedImagePathByFanSwingModeId(ac.currentFanSwingMode),
+ IsSelected = ACControlBase.IsOpen(ac)
+ };
+ itemView.AddChidren(FanSwingModeBtn);
+
modeBtn = new Button()
{
- X = Application.GetRealWidth(207),
- Y = Application.GetRealHeight(996),
+ X = Application.GetRealWidth(346),
+ Y = Application.GetRealHeight(1086),
Width = Application.GetMinRealAverage(80),
Height = Application.GetMinRealAverage(80),
UnSelectedImagePath = ACControlBase.GetModeUnSelectedImagePathByModeId(ac.currentSystemMode),
SelectedImagePath = ACControlBase.GetModeSelectedImagePathByModeId(ac.currentSystemMode),
IsSelected = ACControlBase.IsOpen(ac)
};
- deviceView.AddChidren(modeBtn);
+ itemView.AddChidren(modeBtn);
- //寮�鍏�
switchBtn = new Button()
{
- X = Application.GetRealWidth(446),
- Y = Application.GetRealHeight(996),
+ X = Application.GetRealWidth(536),
+ Y = Application.GetRealHeight(1086),
Width = Application.GetMinRealAverage(80),
Height = Application.GetMinRealAverage(80),
UnSelectedImagePath = "AC/OpenOrClose.png",
SelectedImagePath = "AC/OpenOrCloseSelected.png",
IsSelected = ACControlBase.IsOpen(ac)
};
- deviceView.AddChidren(switchBtn);
+ itemView.AddChidren(switchBtn);
- //椋庨��
fanModeBtn = new Button()
{
- X = Application.GetRealWidth(667),
- Y = Application.GetRealHeight(996),
+ X = Application.GetRealWidth(729),
+ Y = Application.GetRealHeight(1086),
Width = Application.GetMinRealAverage(80),
Height = Application.GetMinRealAverage(80),
UnSelectedImagePath = ACControlBase.GetFanModeUnSelectedImagePathByFanModeId(ac.currentFanMode),
SelectedImagePath = ACControlBase.GetFanModeSelectedImagePathByFanModeId(ac.currentFanMode),
IsSelected = ACControlBase.IsOpen(ac)
};
- deviceView.AddChidren(fanModeBtn);
+ itemView.AddChidren(fanModeBtn);
- var roomBtn = new Button()
+ var roomBG = new Button
{
- X = Application.GetRealWidth(50),
- Y = Application.GetRealHeight(25) + deviceView.Bottom,
+ Y = Application.GetRealHeight(1322 - 50),
+ Height = Application.GetRealHeight(138 + 50),
+ BackgroundColor = ZigbeeColor.Current.GXCBlackBackgroundColor,
+ Radius = (uint)Application.GetRealHeight(CommonFormResouce.BigFormRadius)
+ };
+ itemView.AddChidren(roomBG);
+
+ var roomBG2 = new Button
+ {
+ Y = Application.GetRealHeight(1322 - 50),
+ Height = Application.GetRealHeight(50),
+ BackgroundColor = ZigbeeColor.Current.GXCBackgroundColor,
+ };
+ itemView.AddChidren(roomBG2);
+
+ roomBtn = new Button()
+ {
+ X = Application.GetRealWidth(CommonFormResouce.X_Left),
+ Y = Application.GetRealHeight(1351),
Width = Application.GetMinReal(80),
Height = Application.GetMinReal(80),
- UnSelectedImagePath = "Item/Room.png",
- SelectedImagePath = "Item/RoomSelected.png"
+ UnSelectedImagePath = "Item/Room.png"
};
itemView.AddChidren(roomBtn);
- var roomName = new Button()
+ roomName = new Button()
{
- X = roomBtn.Right + Application.GetRealWidth(20),
- Y = roomBtn.Y,
+ X = Application.GetRealWidth(150),
+ Y = Application.GetRealHeight(1368),
Width = Application.GetRealWidth(400),
- Height = Application.GetRealHeight(80),
+ Height = Application.GetRealHeight(50),
Text = room.Name,
TextAlignment = TextAlignment.CenterLeft,
- TextColor = ZigbeeColor.Current.GXCTextBlackColor,
- SelectedTextColor = ZigbeeColor.Current.GXCTextBlueColor
+ TextColor = ZigbeeColor.Current.GXCTextWhiteColor
};
itemView.AddChidren(roomName);
+ }
+
+ #endregion
+
+ #region 鈼� 缁戝畾浜嬩欢________________________
+
+ /// <summary>
+ /// 缁戝畾鎸夐挳鐨勪簨浠�
+ /// </summary>
+ private void BindEvent()
+ {
+ switchBtn.MouseUpEventHandler += Switch_MouseUpEvent;
+ collectionBtn.MouseUpEventHandler += Collection;
+ fanModeBtn.MouseUpEventHandler += ShowChangeFan_MouseUpEvent;
+ modeBtn.MouseUpEventHandler += ShowChangeMode_MouseUpEvent;
+ FanSwingModeBtn.MouseUpEventHandler += ShowChangeFanSwing_MouseUpEvent;
+ reduceTemperatureBtn.MouseUpEventHandler += Reduce_MouseUpEvent;
+ addTemperatureBtn.MouseUpEventHandler += Add_MouseUpEvent;
+ }
+
+ #endregion
+
+ #region 鈼� 寮�鍏砡_________________________
+
+ /// <summary>
+ /// 寮�鍏�
+ /// </summary>
+ /// <param name="sender">Sender.</param>
+ /// <param name="mouseEventArgs">The ${ParameterType} instance containing the event data.</param>
+ private void Switch_MouseUpEvent(object sender, MouseEventArgs mouseEventArgs)
+ {
+ switchBtn.IsSelected = !switchBtn.IsSelected;
+ mArcScaleSeekBar.IsClickable = switchBtn.IsSelected;
+ if (switchBtn.IsSelected == true)
+ {
+ ac.Open();
+ modeBtn.IsSelected = true;
+ fanModeBtn.IsSelected = true;
+ FanSwingModeBtn.IsSelected = true;
+ mArcScaleSeekBar.SetProgressBarColors(ZigbeeColor.Current.GXCArcScaleSeekBarStartColor, ZigbeeColor.Current.GXCArcScaleSeekBarEndColor);
+ }
+ else
+ {
+ ac.Close();
+ modeBtn.IsSelected = false;
+ fanModeBtn.IsSelected = false;
+ FanSwingModeBtn.IsSelected = false;
+ mArcScaleSeekBar.SetProgressBarColors(ZigbeeColor.Current.GXCWaveSeekBarUnSelectedColor, ZigbeeColor.Current.GXCWaveSeekBarUnSelectedColor);
+ }
}
#endregion
@@ -664,42 +749,31 @@
fanModeDialog.Close();
};
- //var downTriangleBtn = new Button()
- //{
- // X = Application.GetRealWidth(20) + fanModeBtn.X,
- // Y = fanModeBtn.Y-Application.GetRealHeight(217),
- // Width = Application.GetMinRealAverage(30),
- // Height = Application.GetMinRealAverage(15),
- // UnSelectedImagePath = "Item/UpperTriangle.png"
- //};
- //closeBGview.AddChidren(downTriangleBtn);
-
- //var changeFanModeBG = new Button()
- //{
- // X = Application.GetRealWidth(553),
- // Y = Application.GetRealHeight(605),
- // Height = Application.GetRealHeight(625),
- // Width = Application.GetRealWidth(fanItem_Width),
- // SelectedImagePath="AC/SelectedFanModeBG.png"
- //};
- //closeBGview.AddChidren(changeFanModeBG);
+ var changeFanModeBG = new Button()
+ {
+ X = Application.GetRealWidth(600),
+ Y = Application.GetRealHeight(750),
+ Height = Application.GetRealHeight(625),
+ Width = Application.GetRealWidth(fanItem_Width),
+ UnSelectedImagePath = "AC/SelectedFanModeBG.png"
+ };
+ closeBGview.AddChidren(changeFanModeBG);
var changeFanModeFL = new FrameLayout()
{
- X = Application.GetRealWidth(553),
- Y = Application.GetRealHeight(605),
- Height = Application.GetRealHeight(625),
+ X = Application.GetRealWidth(600),
+ Y = Application.GetRealHeight(750),
+ Height = Application.GetRealHeight(600),
Width = Application.GetRealWidth(fanItem_Width),
Radius = CommonPage.BigFormRadius,
BackgroundColor = ZigbeeColor.Current.GXCBackgroundColor,
- //BackgroundImagePath="AC/SelectedFanModeBG.png"
};
closeBGview.AddChidren(changeFanModeFL);
var changeFanBtn = new Button()
{
X = Application.GetRealWidth(fanItem_X),
- Width = Application.GetRealWidth(fanItem_Width- fanItem_X),
+ Width = Application.GetRealWidth(fanItem_Width - fanItem_X),
Height = Application.GetRealHeight(fanItem_Height),
TextColor = ZigbeeColor.Current.GXCTextBlackColor,
TextID = R.MyInternationalizationString.SelectFanMode,
@@ -707,17 +781,17 @@
};
changeFanModeFL.AddChidren(changeFanBtn);
- var fan_Low = new CommonForm.LeftIconButtonRowLayout()
+ var fan_Low = new CommonForm.ACLeftIconButtonRowLayout()
{
- Y=changeFanBtn.Bottom,
+ Y = changeFanBtn.Bottom,
Width = Application.GetRealWidth(fanItem_Width),
Height = Application.GetRealHeight(fanItem_Height),
- Tag=ZigBee.Device.AC.FanMode.Low
+ Tag = ZigBee.Device.AC.FanMode.Low
};
changeFanModeFL.AddChidren(fan_Low);
fan_Low.Init("AC/Fan_Low.png", "AC/Fan_LowSelected.png", Language.StringByID(R.MyInternationalizationString.Fan_Low));
- var fan_Middle = new CommonForm.LeftIconButtonRowLayout()
+ var fan_Middle = new CommonForm.ACLeftIconButtonRowLayout()
{
Y = fan_Low.Bottom,
Width = Application.GetRealWidth(fanItem_Width),
@@ -727,7 +801,7 @@
changeFanModeFL.AddChidren(fan_Middle);
fan_Middle.Init("AC/Fan_Middle.png", "AC/Fan_MiddleSelected.png", Language.StringByID(R.MyInternationalizationString.Fan_Middle));
- var fan_Height = new CommonForm.LeftIconButtonRowLayout()
+ var fan_Height = new CommonForm.ACLeftIconButtonRowLayout()
{
Y = fan_Middle.Bottom,
Width = Application.GetRealWidth(fanItem_Width),
@@ -735,17 +809,32 @@
Tag = ZigBee.Device.AC.FanMode.High
};
changeFanModeFL.AddChidren(fan_Height);
- fan_Height.Init("AC/Fan_Height.png", "AC/Fan_HeightSelected.png", Language.StringByID(R.MyInternationalizationString.Fan_Height));
+ fan_Height.Init("AC/Fan_Height.png", "AC/Fan_HeightSelected.png", Language.StringByID(R.MyInternationalizationString.Fan_Height), false);
- //fan_Low.MouseUpEventHandler += ChangeFan_MouseUpEvent;
- fan_Low.titleButton.MouseUpEventHandler += ChangeFan_MouseUpEvent;
- fan_Low.iconButton.MouseUpEventHandler += ChangeFan_MouseUpEvent;
+ fan_Low.TitleButton.MouseUpEventHandler += ChangeFan_MouseUpEvent;
+ fan_Low.IconButton.MouseUpEventHandler += ChangeFan_MouseUpEvent;
- fan_Middle.titleButton.MouseUpEventHandler += ChangeFan_MouseUpEvent;
- fan_Middle.iconButton.MouseUpEventHandler += ChangeFan_MouseUpEvent;
+ fan_Middle.TitleButton.MouseUpEventHandler += ChangeFan_MouseUpEvent;
+ fan_Middle.IconButton.MouseUpEventHandler += ChangeFan_MouseUpEvent;
- fan_Height.titleButton.MouseUpEventHandler += ChangeFan_MouseUpEvent;
- fan_Height.iconButton.MouseUpEventHandler += ChangeFan_MouseUpEvent;
+ fan_Height.TitleButton.MouseUpEventHandler += ChangeFan_MouseUpEvent;
+ fan_Height.IconButton.MouseUpEventHandler += ChangeFan_MouseUpEvent;
+
+ if (ACControlBase.IsOpen(ac))
+ {
+ if (ac.currentFanMode == 1)
+ {
+ fan_Low.SetSelectedStatu();
+ }
+ else if (ac.currentFanMode == 2)
+ {
+ fan_Middle.SetSelectedStatu();
+ }
+ else
+ {
+ fan_Height.SetSelectedStatu();
+ }
+ }
}
/// <summary>
@@ -753,10 +842,10 @@
/// </summary>
/// <param name="sender">Sender.</param>
/// <param name="mouseEventArgs">The ${ParameterType} instance containing the event data.</param>
- private void ChangeFan_MouseUpEvent(object sender,MouseEventArgs mouseEventArgs)
+ private void ChangeFan_MouseUpEvent(object sender, MouseEventArgs mouseEventArgs)
{
var tag = (sender as Button).Tag.ToString();
- ZigBee.Device.AC.FanMode mode= ZigBee.Device.AC.FanMode.Low;
+ ZigBee.Device.AC.FanMode mode = ZigBee.Device.AC.FanMode.Low;
if (tag == "Low")
{
mode = ZigBee.Device.AC.FanMode.Low;
@@ -790,7 +879,7 @@
fanModeBtn.UnSelectedImagePath = ACControlBase.GetFanModeUnSelectedImagePathByFanMode(fanMode);
ac.currentFanMode = (int)(fanMode);
- (device.CommonDevice as ZigBee.Device.AC).SetFanModeAsync(fanMode);
+ ac.SetFanModeAsync(fanMode);
}
#endregion
@@ -816,38 +905,27 @@
acModeDialog.Close();
};
- //var changeModeBG = new Button()
- //{
- // X = Application.GetRealWidth(80),
- // Y = Application.GetRealHeight(360),
- // Height = Application.GetRealHeight(933),
- // Width = Application.GetRealWidth(modeItem_Width),
- // //Radius = CommonPage.BigFormRadius,
- // SelectedImagePath = "AC/SelectedModeBG.png"
- //};
- //closeBGview.AddChidren(changeModeBG);
-
- var changeModeFL = new FrameLayout()
- {
- X = Application.GetRealWidth(80),
- Y = Application.GetRealHeight(360),
- Height = Application.GetRealHeight(933),
- Width = Application.GetRealWidth(modeItem_Width),
- Radius = CommonPage.BigFormRadius,
- BackgroundColor = ZigbeeColor.Current.GXCBackgroundColor,
- //BackgroundImagePath="AC/SelectedModeBG.png"
- };
- closeBGview.AddChidren(changeModeFL);
-
var changeModeBG = new Button()
{
+ X = Application.GetRealWidth(230),
+ Y = Application.GetRealHeight(450),
Height = Application.GetRealHeight(933),
Width = Application.GetRealWidth(modeItem_Width),
- //Radius = CommonPage.BigFormRadius,
- SelectedImagePath = "AC/SelectedModeBG.png"
+ UnSelectedImagePath = "AC/SelectedModeBG.png"
};
- changeModeFL.AddChidren(changeModeBG);
+ closeBGview.AddChidren(changeModeBG);
+ var changeModeFL = new VerticalScrolViewLayout()
+ {
+ X = Application.GetRealWidth(230),
+ Y = Application.GetRealHeight(450),
+ Height = Application.GetRealHeight(900),
+ Width = Application.GetRealWidth(modeItem_Width),
+ Radius = CommonFormResouce.BigFormRadius,
+ BackgroundColor = ZigbeeColor.Current.GXCBackgroundColor,
+ //BackgroundIagePath="AC/SelectedModeBG.png"
+ };
+ closeBGview.AddChidren(changeModeFL);
var changeModeBtn = new Button()
{
@@ -855,76 +933,115 @@
Width = Application.GetRealWidth(modeItem_Width - modeItem_X),
Height = Application.GetRealHeight(modeItem_Height),
TextColor = ZigbeeColor.Current.GXCTextBlackColor,
- TextID = R.MyInternationalizationString.SelectFanMode,
+ TextID = R.MyInternationalizationString.SelectMode,
TextAlignment = TextAlignment.CenterLeft
};
changeModeFL.AddChidren(changeModeBtn);
- var mode_Auto = new CommonForm.LeftIconButtonRowLayout()
+ var mode_Auto = new CommonForm.ACLeftIconButtonRowLayout()
{
Y = changeModeBtn.Bottom,
Width = Application.GetRealWidth(modeItem_Width),
Height = Application.GetRealHeight(modeItem_Height),
Tag = ZigBee.Device.AC.AcMode.Auto
};
- changeModeFL.AddChidren(mode_Auto);
+ if (ac.listSupportMode[4] == 1)
+ {
+ changeModeFL.AddChidren(mode_Auto);
+ }
mode_Auto.Init("AC/Mode_Auto.png", "AC/Mode_AutoSelected.png", Language.StringByID(R.MyInternationalizationString.Mode_Auto));
- var mode_Cool = new CommonForm.LeftIconButtonRowLayout()
+ var mode_Cool = new CommonForm.ACLeftIconButtonRowLayout()
{
Y = mode_Auto.Bottom,
Width = Application.GetRealWidth(modeItem_Width),
Height = Application.GetRealHeight(modeItem_Height),
Tag = ZigBee.Device.AC.AcMode.Cool
};
- changeModeFL.AddChidren(mode_Cool);
+ if (ac.listSupportMode[0] == 1)
+ {
+ changeModeFL.AddChidren(mode_Cool);
+ }
mode_Cool.Init("AC/Mode_Cool.png", "AC/Mode_CoolSelected.png", Language.StringByID(R.MyInternationalizationString.Mode_Cool));
- var mode_Heat = new CommonForm.LeftIconButtonRowLayout()
+ var mode_Heat = new CommonForm.ACLeftIconButtonRowLayout()
{
Y = mode_Cool.Bottom,
Width = Application.GetRealWidth(modeItem_Width),
Height = Application.GetRealHeight(modeItem_Height),
Tag = ZigBee.Device.AC.AcMode.Heat
};
- changeModeFL.AddChidren(mode_Heat);
+ if (ac.listSupportMode[1] == 1)
+ {
+ changeModeFL.AddChidren(mode_Heat);
+ }
mode_Heat.Init("AC/Mode_Heat.png", "AC/Mode_HeatSelected.png", Language.StringByID(R.MyInternationalizationString.Mode_Heat));
- var mode_Dry = new CommonForm.LeftIconButtonRowLayout()
+ var mode_Dry = new CommonForm.ACLeftIconButtonRowLayout()
{
Y = mode_Heat.Bottom,
Width = Application.GetRealWidth(modeItem_Width),
Height = Application.GetRealHeight(modeItem_Height),
Tag = ZigBee.Device.AC.AcMode.Dry
};
- changeModeFL.AddChidren(mode_Dry);
+ if (ac.listSupportMode[3] == 1)
+ {
+ changeModeFL.AddChidren(mode_Dry);
+ }
mode_Dry.Init("AC/Mode_Dry.png", "AC/Mode_DrySelected.png", Language.StringByID(R.MyInternationalizationString.Mode_Dry));
- var mode_Fan = new CommonForm.LeftIconButtonRowLayout()
+ var mode_Fan = new CommonForm.ACLeftIconButtonRowLayout()
{
Y = mode_Dry.Bottom,
Width = Application.GetRealWidth(modeItem_Width),
Height = Application.GetRealHeight(modeItem_Height),
Tag = ZigBee.Device.AC.AcMode.FanOnly
};
- changeModeFL.AddChidren(mode_Fan);
- mode_Fan.Init("AC/Mode_Fan.png", "AC/Mode_FanSelected.png", Language.StringByID(R.MyInternationalizationString.Mode_FanOnly));
+ if (ac.listSupportMode[2] == 1)
+ {
+ changeModeFL.AddChidren(mode_Fan);
+ }
+ mode_Fan.Init("AC/Mode_Fan.png", "AC/Mode_FanSelected.png", Language.StringByID(R.MyInternationalizationString.Mode_FanOnly), false);
- mode_Auto.titleButton.MouseUpEventHandler += ChangeMode_MouseUpEvent;
- mode_Auto.iconButton.MouseUpEventHandler += ChangeMode_MouseUpEvent;
- mode_Cool.titleButton.MouseUpEventHandler += ChangeMode_MouseUpEvent;
- mode_Cool.iconButton.MouseUpEventHandler += ChangeMode_MouseUpEvent;
+ mode_Auto.TitleButton.MouseUpEventHandler += ChangeMode_MouseUpEvent;
+ mode_Auto.IconButton.MouseUpEventHandler += ChangeMode_MouseUpEvent;
- mode_Heat.titleButton.MouseUpEventHandler += ChangeMode_MouseUpEvent;
- mode_Heat.iconButton.MouseUpEventHandler += ChangeMode_MouseUpEvent;
+ mode_Cool.TitleButton.MouseUpEventHandler += ChangeMode_MouseUpEvent;
+ mode_Cool.IconButton.MouseUpEventHandler += ChangeMode_MouseUpEvent;
- mode_Dry.titleButton.MouseUpEventHandler += ChangeMode_MouseUpEvent;
- mode_Dry.iconButton.MouseUpEventHandler += ChangeMode_MouseUpEvent;
+ mode_Heat.TitleButton.MouseUpEventHandler += ChangeMode_MouseUpEvent;
+ mode_Heat.IconButton.MouseUpEventHandler += ChangeMode_MouseUpEvent;
- mode_Fan.titleButton.MouseUpEventHandler += ChangeMode_MouseUpEvent;
- mode_Fan.iconButton.MouseUpEventHandler += ChangeMode_MouseUpEvent;
+ mode_Dry.TitleButton.MouseUpEventHandler += ChangeMode_MouseUpEvent;
+ mode_Dry.IconButton.MouseUpEventHandler += ChangeMode_MouseUpEvent;
+ mode_Fan.TitleButton.MouseUpEventHandler += ChangeMode_MouseUpEvent;
+ mode_Fan.IconButton.MouseUpEventHandler += ChangeMode_MouseUpEvent;
+
+ if (ACControlBase.IsOpen(ac))
+ {
+ if (ac.currentSystemMode == 1)
+ {
+ mode_Auto.SetSelectedStatu();
+ }
+ else if (ac.currentSystemMode == 3)
+ {
+ mode_Cool.SetSelectedStatu();
+ }
+ else if (ac.currentSystemMode == 4)
+ {
+ mode_Heat.SetSelectedStatu();
+ }
+ else if (ac.currentSystemMode == 8)
+ {
+ mode_Dry.SetSelectedStatu();
+ }
+ else if (ac.currentSystemMode == 7)
+ {
+ mode_Fan.SetSelectedStatu();
+ }
+ }
}
/// <summary>
@@ -949,11 +1066,11 @@
{
mode = ZigBee.Device.AC.AcMode.Heat;
}
- else if(tag =="Dry")
+ else if (tag == "Dry")
{
mode = ZigBee.Device.AC.AcMode.Dry;
}
- else if(tag == "FanOnly")
+ else if (tag == "FanOnly")
{
mode = ZigBee.Device.AC.AcMode.FanOnly;
}
@@ -978,35 +1095,228 @@
modeBtn.UnSelectedImagePath = ACControlBase.GetModeUnSelectedImagePathByMode(acMode);
currentModeBtn.Text = ACControlBase.GetModeNameByMode(acMode);
ac.currentSystemMode = (int)acMode;
- currentTemperatureBtn.Text = $"{ACControlBase.GetCurrentModeTemperature(ac)} 掳C";
- (device.CommonDevice as ZigBee.Device.AC).SetSystemModeAsync(acMode);
+ mArcScaleSeekBar.Progress = ACControlBase.GetCurrentModeTemperature(ac);
+ ac.SetSystemModeAsync(acMode);
}
#endregion
- #region 鈼� 寮�鍏砡_________________________
+ #region 鈼� 鍒囨崲鎵______________________
+
/// <summary>
- /// 寮�鍏�
+ /// 鍒囨崲鎵
/// </summary>
/// <param name="sender">Sender.</param>
/// <param name="mouseEventArgs">The ${ParameterType} instance containing the event data.</param>
- private void Switch_MouseUpEvent(object sender, MouseEventArgs mouseEventArgs)
+ private void ShowChangeFanSwing_MouseUpEvent(object sender, MouseEventArgs mouseEventArgs)
{
- switchBtn.IsSelected = !switchBtn.IsSelected;
- if (switchBtn.IsSelected == true)
+ int fanItem_X = 80;
+ int fanItem_Height = 150;
+ int fanItem_Width = 449;
+
+ fanModeDialog = new Dialog();
+ fanModeDialog.Show();
+ var closeBGview = new FrameLayout();
+ fanModeDialog.AddChidren(closeBGview);
+ closeBGview.MouseUpEventHandler += (send1, e1) =>
{
- ac.Open();
- modeBtn.IsSelected = true;
- fanModeBtn.IsSelected = true;
- }
- else
+ fanModeDialog.Close();
+ };
+
+ var changeFanModeBG = new Button()
{
- ac.Close();
- modeBtn.IsSelected = false;
- fanModeBtn.IsSelected = false;
+ X = Application.GetRealWidth(35),
+ Y = Application.GetRealHeight(297),
+ Height = Application.GetRealHeight(1089),
+ Width = Application.GetRealWidth(fanItem_Width),
+ UnSelectedImagePath = "AC/SwingBackground.png"
+ };
+ closeBGview.AddChidren(changeFanModeBG);
+
+ var changeFanModeFL = new FrameLayout()
+ {
+ X = Application.GetRealWidth(35),
+ Y = Application.GetRealHeight(297),
+ Height = Application.GetRealHeight(1050),
+ Width = Application.GetRealWidth(fanItem_Width),
+ Radius = CommonPage.BigFormRadius,
+ BackgroundColor = ZigbeeColor.Current.GXCBackgroundColor,
+ };
+ closeBGview.AddChidren(changeFanModeFL);
+
+ var changeFanBtn = new Button()
+ {
+ X = Application.GetRealWidth(fanItem_X),
+ Width = Application.GetRealWidth(fanItem_Width - fanItem_X),
+ Height = Application.GetRealHeight(fanItem_Height),
+ TextColor = ZigbeeColor.Current.GXCTextBlackColor,
+ TextID = R.MyInternationalizationString.SelectSwing,
+ TextAlignment = TextAlignment.CenterLeft
+ };
+ changeFanModeFL.AddChidren(changeFanBtn);
+
+ var swing_First = new CommonForm.ACLeftIconButtonRowLayout()
+ {
+ Y = changeFanBtn.Bottom,
+ Width = Application.GetRealWidth(fanItem_Width),
+ Height = Application.GetRealHeight(fanItem_Height),
+ Tag = ZigBee.Device.AC.FanSwingMode.First
+ };
+ changeFanModeFL.AddChidren(swing_First);
+ swing_First.Init("AC/Swing_1.png", "AC/Swing_1Selected.png", Language.StringByID(R.MyInternationalizationString.Swing_First));
+
+ var swing_Second = new CommonForm.ACLeftIconButtonRowLayout()
+ {
+ Y = swing_First.Bottom,
+ Width = Application.GetRealWidth(fanItem_Width),
+ Height = Application.GetRealHeight(fanItem_Height),
+ Tag = ZigBee.Device.AC.FanSwingMode.Second
+ };
+ changeFanModeFL.AddChidren(swing_Second);
+ swing_Second.Init("AC/Swing_2.png", "AC/Swing_2Selected.png", Language.StringByID(R.MyInternationalizationString.Swing_Second));
+
+ var swing_Thrid = new CommonForm.ACLeftIconButtonRowLayout()
+ {
+ Y = swing_Second.Bottom,
+ Width = Application.GetRealWidth(fanItem_Width),
+ Height = Application.GetRealHeight(fanItem_Height),
+ Tag = ZigBee.Device.AC.FanSwingMode.Thrid
+ };
+ changeFanModeFL.AddChidren(swing_Thrid);
+ swing_Thrid.Init("AC/Swing_3.png", "AC/Swing_3Selected.png", Language.StringByID(R.MyInternationalizationString.Swing_Thrid));
+
+ var swing_Fourth = new CommonForm.ACLeftIconButtonRowLayout()
+ {
+ Y = swing_Thrid.Bottom,
+ Width = Application.GetRealWidth(fanItem_Width),
+ Height = Application.GetRealHeight(fanItem_Height),
+ Tag = ZigBee.Device.AC.FanSwingMode.Fourth
+ };
+ changeFanModeFL.AddChidren(swing_Fourth);
+ swing_Fourth.Init("AC/Swing_4.png", "AC/Swing_4Selected.png", Language.StringByID(R.MyInternationalizationString.Swing_Fourth));
+
+ var swing_Fifth = new CommonForm.ACLeftIconButtonRowLayout()
+ {
+ Y = swing_Fourth.Bottom,
+ Width = Application.GetRealWidth(fanItem_Width),
+ Height = Application.GetRealHeight(fanItem_Height),
+ Tag = ZigBee.Device.AC.FanSwingMode.Fifth
+ };
+ changeFanModeFL.AddChidren(swing_Fifth);
+ swing_Fifth.Init("AC/Swing_5.png", "AC/Swing_5Selected.png", Language.StringByID(R.MyInternationalizationString.Swing_Fifth));
+
+ var swing_Auto = new CommonForm.ACLeftIconButtonRowLayout()
+ {
+ Y = swing_Fifth.Bottom,
+ Width = Application.GetRealWidth(fanItem_Width),
+ Height = Application.GetRealHeight(fanItem_Height),
+ Tag = ZigBee.Device.AC.FanSwingMode.Auto
+ };
+ changeFanModeFL.AddChidren(swing_Auto);
+ swing_Auto.Init("AC/Swing_Auto.png", "AC/Swing_AutoSelected.png", Language.StringByID(R.MyInternationalizationString.Swing_Auto),false);
+
+
+ swing_First.TitleButton.MouseUpEventHandler += ChangeFanSwing_MouseUpEvent;
+ swing_First.IconButton.MouseUpEventHandler += ChangeFanSwing_MouseUpEvent;
+
+ swing_Second.TitleButton.MouseUpEventHandler += ChangeFanSwing_MouseUpEvent;
+ swing_Second.IconButton.MouseUpEventHandler += ChangeFanSwing_MouseUpEvent;
+
+ swing_Thrid.TitleButton.MouseUpEventHandler += ChangeFanSwing_MouseUpEvent;
+ swing_Thrid.IconButton.MouseUpEventHandler += ChangeFanSwing_MouseUpEvent;
+
+ swing_Fourth.TitleButton.MouseUpEventHandler += ChangeFanSwing_MouseUpEvent;
+ swing_Fourth.IconButton.MouseUpEventHandler += ChangeFanSwing_MouseUpEvent;
+
+ swing_Fifth.TitleButton.MouseUpEventHandler += ChangeFanSwing_MouseUpEvent;
+ swing_Fifth.IconButton.MouseUpEventHandler += ChangeFanSwing_MouseUpEvent;
+
+ swing_Auto.TitleButton.MouseUpEventHandler += ChangeFanSwing_MouseUpEvent;
+ swing_Auto.IconButton.MouseUpEventHandler += ChangeFanSwing_MouseUpEvent;
+
+ if (ACControlBase.IsOpen(ac))
+ {
+ if (ac.currentFanSwingMode == 0)
+ {
+ swing_First.SetSelectedStatu();
+ }
+ else if (ac.currentFanSwingMode == 1)
+ {
+ swing_Second.SetSelectedStatu();
+ }
+ else if (ac.currentFanSwingMode == 2)
+ {
+ swing_Thrid.SetSelectedStatu();
+ }
+ else if (ac.currentFanSwingMode == 3)
+ {
+ swing_Fourth.SetSelectedStatu();
+ }
+ else if (ac.currentFanSwingMode == 4)
+ {
+ swing_Fifth.SetSelectedStatu();
+ }
+ else if (ac.currentFanSwingMode == 7)
+ {
+ swing_Auto.SetSelectedStatu();
+ }
}
}
+
+ /// <summary>
+ /// 鍒囨崲鎵
+ /// </summary>
+ /// <param name="sender">Sender.</param>
+ /// <param name="mouseEventArgs">The ${ParameterType} instance containing the event data.</param>
+ private void ChangeFanSwing_MouseUpEvent(object sender, MouseEventArgs mouseEventArgs)
+ {
+ var tag = (sender as Button).Tag.ToString();
+ ZigBee.Device.AC.FanSwingMode mode = ZigBee.Device.AC.FanSwingMode.Auto;
+ if (tag == "First")
+ {
+ mode = ZigBee.Device.AC.FanSwingMode.First;
+ }
+ else if (tag == "Second")
+ {
+ mode = ZigBee.Device.AC.FanSwingMode.Second;
+ }
+ else if (tag == "Thrid")
+ {
+ mode = ZigBee.Device.AC.FanSwingMode.Thrid;
+ }
+ else if(tag=="Fourth")
+ {
+ mode = ZigBee.Device.AC.FanSwingMode.Fourth;
+ }
+ else if (tag == "Fifth")
+ {
+ mode = ZigBee.Device.AC.FanSwingMode.Fifth;
+ }
+
+ ChangeFanSwing(mode);
+ }
+
+ /// <summary>
+ /// 鍒囨崲鎵
+ /// </summary>
+ /// <param name="fanSwingMode">Fan mode.</param>
+ private void ChangeFanSwing(ZigBee.Device.AC.FanSwingMode fanSwingMode)
+ {
+ fanModeDialog.Close();
+ if (ACControlBase.IsOpen(ac) == false)
+ {
+ ACControlBase.ShowACIsCloseTip();
+ return;
+ }
+ FanSwingModeBtn.IsSelected = true;
+ FanSwingModeBtn.SelectedImagePath = ACControlBase.GetFanSwingModeSelectedImagePathByFanSwingMode(fanSwingMode);
+ FanSwingModeBtn.UnSelectedImagePath = ACControlBase.GetFanSwingModeUnSelectedImagePathByFanSwingMode(fanSwingMode);
+ ac.currentFanSwingMode = (int)fanSwingMode;
+
+ ac.SetFanSwingAsyncMode(fanSwingMode);
+ }
+
#endregion
@@ -1023,22 +1333,36 @@
ACControlBase.ShowACIsCloseTip();
return;
}
- //cool
- if (ac.currentSystemMode == 3)
+ if (ac.currentSystemMode == 3 || ac.currentSystemMode == 8)
{
+ if (ac.currentCoolingSetpoint >= ACControlBase.Temperature_High)
+ {
+ return;
+ }
ac.currentCoolingSetpoint += 1;
- ac.SetCoolingTemperatureAsync(ac.currentCoolingSetpoint);
- currentTemperatureBtn.Text = $"{ac.currentCoolingSetpoint} 掳C";
+ ac.SetCoolingTemperatureAsync(ac.currentCoolingSetpoint * 100);
+ mArcScaleSeekBar.Progress = ac.currentCoolingSetpoint;
}
- //heat
else if (ac.currentSystemMode == 4)
{
+ if (ac.currentHeatingSetpoint >= ACControlBase.Temperature_High)
+ {
+ return;
+ }
ac.currentHeatingSetpoint += 1;
- ac.SetHeatingTemperatureAsync(ac.currentHeatingSetpoint);
- currentTemperatureBtn.Text = $"{ac.currentHeatingSetpoint} 掳C";
+ ac.SetHeatingTemperatureAsync(ac.currentHeatingSetpoint * 100);
+ mArcScaleSeekBar.Progress = ac.currentHeatingSetpoint;
}
- //auto
- //dry
+ else if (ac.currentSystemMode == 1)
+ {
+ if (ac.currentAutoSetpoint >= ACControlBase.Temperature_High)
+ {
+ return;
+ }
+ ac.currentAutoSetpoint += 1;
+ ac.SetAutoTemperatureAsync(ac.currentAutoSetpoint * 100);
+ mArcScaleSeekBar.Progress = ac.currentAutoSetpoint;
+ }
}
#endregion
@@ -1057,29 +1381,101 @@
ACControlBase.ShowACIsCloseTip();
return;
}
- //cool
- if (ac.currentSystemMode == 3)
+ if (ac.currentSystemMode == 3 || ac.currentSystemMode == 8)
{
+ if (ac.currentCoolingSetpoint <= ACControlBase.Temperature_Low)
+ {
+ return;
+ }
ac.currentCoolingSetpoint -= 1;
- ac.SetCoolingTemperatureAsync(ac.currentCoolingSetpoint);
-
- currentTemperatureBtn.Text = $"{ac.currentCoolingSetpoint} 掳C";
+ ac.SetCoolingTemperatureAsync(ac.currentCoolingSetpoint * 100);
+ mArcScaleSeekBar.Progress = ac.currentCoolingSetpoint;
}
- //heat
else if (ac.currentSystemMode == 4)
{
+ if (ac.currentHeatingSetpoint <= ACControlBase.Temperature_Low)
+ {
+ return;
+ }
ac.currentHeatingSetpoint -= 1;
- ac.SetHeatingTemperatureAsync(ac.currentHeatingSetpoint);
-
- currentTemperatureBtn.Text = $"{ac.currentHeatingSetpoint} 掳C";
+ ac.SetHeatingTemperatureAsync(ac.currentHeatingSetpoint * 100);
+ mArcScaleSeekBar.Progress = ac.currentHeatingSetpoint;
}
- //auto
- //dry
+ else if (ac.currentSystemMode == 1)
+ {
+ if (ac.currentAutoSetpoint <= ACControlBase.Temperature_Low)
+ {
+ return;
+ }
+ ac.currentAutoSetpoint -= 1;
+ ac.SetAutoTemperatureAsync(ac.currentAutoSetpoint * 100);
+ mArcScaleSeekBar.Progress = ac.currentAutoSetpoint;
+ }
}
#endregion
- #region 鈼� 鏀惰棌__________________________
+ #region 鈼� 鎺у埗鍙嶉_________________________
+
+ /// <summary>
+ /// 鏄剧ず璁惧鎺у埗鐘舵��
+ /// </summary>
+ /// <param name="command">Command.</param>
+ /// <param name="objValue">Object value.</param>
+ private void UpdateDeviceControllStatu(string command, object objValue)
+ {
+ if (command != "DeviceDefaultAck" || objValue == null)
+ {
+ return;
+ }
+ var tempDevice = (CommonDevice)objValue;
+ if (tempDevice.DeviceEpoint != this.device.CommonDevice.DeviceEpoint || tempDevice.DeviceAddr != this.device.CommonDevice.DeviceAddr)
+ {
+ //涓嶆槸褰撳墠璁惧鐨勬帹閫侊紝鍒欎笉澶勭悊
+ return;
+ }
+ //鏍囪宸茬粡鍙戦�佹帶鍒跺懡浠ゅ埌缃戝叧
+ sendedControlCommand = true;
+ //鎴愬姛涓嶆彁绀�
+ //DeviceUI.ShowStatuTip(R.MyInternationalizationString.Success);
+ }
+
+ /// <summary>
+ /// 绉婚櫎鏇存柊鎺у埗璁惧鐨刟ction
+ /// </summary>
+ private void RemoveUpdateControlDeviceStatuAction()
+ {
+ if (zbGateway != null)
+ {
+ zbGateway.ReportAction -= UpdateDeviceControllStatu;
+ }
+ }
+
+ #endregion
+
+ #region 鈼� 鏇村璁剧疆________________________
+
+ /// <summary>
+ /// 鏇村璁剧疆
+ /// </summary>
+ /// <param name="sender">Sender.</param>
+ /// <param name="e">E.</param>
+ private void More(object sender, MouseEventArgs e)
+ {
+ var detailInfo = new Device.CommonForm.DeviceDetailInfo { };
+ UserView.HomePage.Instance.AddChidren(detailInfo);
+ UserView.HomePage.Instance.PageIndex += 1;
+ detailInfo.Show(device, room);
+ detailInfo.action = () =>
+ {
+ Show(device, room);
+ };
+ }
+
+ #endregion
+
+ #region 鈼� 鏀惰棌鍒颁富椤礯______________________
+
/// <summary>
/// 鏀惰棌鍒颁富椤�
/// </summary>
@@ -1087,7 +1483,6 @@
/// <param name="e">E.</param>
private void Collection(object sender, MouseEventArgs e)
{
- //collection
if (collectionBtn.IsSelected)
{
Shared.Common.Room.Lists[0].DeleteDevice(device.FileName);
@@ -1098,24 +1493,20 @@
Shared.Common.Room.Lists[0].AddDevice(device.FileName);
collectionBtn.IsSelected = true;
}
- action?.Invoke();
}
#endregion
- #region 鈼� 缁戝畾鎸夐挳_______________________
+ #region 鈼� 鍥炲埌涓婚〉________________________
+
/// <summary>
- /// 缁戝畾鎸夐挳鐨勪簨浠�
+ /// 鍥炲埌涓婚〉
/// </summary>
- private void BindEvent()
+ /// <param name="sender">Sender.</param>
+ /// <param name="mouseEventArgs">The ${ParameterType} instance containing the event data.</param>
+ private void BackToRoomHandler(object sender, MouseEventArgs mouseEventArgs)
{
- switchBtn.MouseUpEventHandler += Switch_MouseUpEvent;
- reduceTemperatureBtn.MouseUpEventHandler += Reduce_MouseUpEvent;
- addTemperatureBtn.MouseUpEventHandler += Add_MouseUpEvent;
- collectionBtn.MouseUpEventHandler += Collection;
- moreBtn.MouseUpEventHandler += MoreEvent;
- fanModeBtn.MouseUpEventHandler += ShowChangeFan_MouseUpEvent;
- modeBtn.MouseUpEventHandler += ShowChangeMode_MouseUpEvent;
+ //backToRoom
}
#endregion
--
Gitblit v1.8.0