From 23532fa8ad34c89b6d24b01eaef6475fd0aad898 Mon Sep 17 00:00:00 2001
From: 黄学彪 <hxb@hdlchina.com.cn>
Date: 星期三, 15 四月 2020 18:08:24 +0800
Subject: [PATCH] ???????
---
ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelFangyueButtonSettionForm.cs | 72 ++++++++++++++++-------------------
1 files changed, 33 insertions(+), 39 deletions(-)
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelFangyueButtonSettionForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelFangyueButtonSettionForm.cs
index e653cca..514859d 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelFangyueButtonSettionForm.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelFangyueButtonSettionForm.cs
@@ -1,4 +1,5 @@
-锘縰sing System;
+锘縰sing Shared.Common;
+using System;
using System.Collections.Generic;
using System.Text;
using ZigBee.Device;
@@ -15,7 +16,7 @@
/// <summary>
/// 鍒楄〃鎺т欢
/// </summary>
- private VerticalListControl listview = null;
+ private FrameListControl listview = null;
/// <summary>
/// 褰撳墠閫夋嫨鐨勮澶�
/// </summary>
@@ -71,12 +72,16 @@
//娓呯┖bodyFrame
this.ClearBodyFrame();
+ var listBackControl = new VerticalFrameControl();
+ listBackControl.Height = bodyFrameLayout.Height;
+ bodyFrameLayout.AddChidren(listBackControl);
+
//鍒濆鍖栨甯�
this.tableContr = new InformationEditorControl();
- this.listview = tableContr.InitControl(bodyFrameLayout, Language.StringByID(R.MyInternationalizationString.uDeviceEditor), 708, 1028);
+ this.listview = tableContr.InitControl(listBackControl.frameTable, Language.StringByID(R.MyInternationalizationString.uDeviceEditor), 1028);
//鍒濆鍖栬澶囧洖璺浘鏍�
- this.InitDeviceEpointIcon();
+ this.InitDeviceEpointIcon(listBackControl);
//淇濆瓨
var btnFinish = new BottomClickButton();
@@ -166,18 +171,16 @@
rowBeloneArea.SelectRoomEvent += (roomKeys) =>
{
//鍙樻洿鎴块棿
- Common.Room.CurrentRoom.ChangedRoom(nowSelectDevice, roomKeys);
+ HdlRoomLogic.Current.ChangedRoom(nowSelectDevice, roomKeys);
};
//娣诲姞缁戝畾鐩爣琛�
this.AddBindRow();
//娣诲姞鑳屽厜鐏
this.AddBackLightRow();
- //娣诲姞鎺ヨ繎鎰熷簲琛�
- this.AddProximityInductionRow();
//鍒濆鍖栨甯冨畬鎴�
- tableContr.FinishInitControl(bodyFrameLayout, this.listview);
+ tableContr.FinishInitControl();
}
#endregion
@@ -273,34 +276,25 @@
btnLight.AddRightArrow();
btnLight.ButtonClickEvent += (sender, e) =>
{
- var form = new PanelBackLightSettionForm();
- form.AddForm((Panel)nowSelectDevice);
+ List<CommonDevice> listNewDevice = new List<CommonDevice> { };
+ listNewDevice.Add((Panel)nowSelectDevice);
+ var deviceEnumInfo = Common.LocalDevice.Current.GetMyDeviceEnumInfo(listNewDevice);
+ //濡傛灉璁惧鏄柟鎮﹀紑鎺ц澶囷紝鑳屽厜鐏〉闇�瑕佹粦鍔ㄤ笖鏈夋帴杩戞劅搴斿姛鑳�
+ if (deviceEnumInfo.ConcreteType == DeviceConcreteType.ButtonPanel_FangyueTwo
+ || deviceEnumInfo.ConcreteType == DeviceConcreteType.ButtonPanel_FangyueFour
+ || deviceEnumInfo.ConcreteType == DeviceConcreteType.ButtonPanel_FangyueEight)
+ {
+ var form = new PanelBackLighWithSensorForm();
+ form.AddForm((Panel)nowSelectDevice);
+ }
+ else
+ {
+ //涓嶅甫鎺ヨ繎鎰熷簲鐨�
+ var form = new PanelBackLightSettionForm();
+ form.AddForm((Panel)nowSelectDevice);
+ }
};
}
- }
-
- #endregion
-
- #region 鈻� 鎺ヨ繎鎰熷簲___________________________
-
- /// <summary>
- /// 娣诲姞鎺ヨ繎鎰熷簲琛�
- /// </summary>
- private void AddProximityInductionRow()
- {
- //鎺ヨ繎鎰熷簲
- var rowContr = new FrameRowControl(listview.rowSpace / 2);
- rowContr.UseClickStatu = false;
- listview.AddChidren(rowContr);
- rowContr.AddLeftCaption(Language.StringByID(R.MyInternationalizationString.uProximityInduction), 600);
- //搴曠嚎
- rowContr.AddBottomLine();
- //寮�鍏�
- var btnSwitch = rowContr.AddMostRightSwitchIcon();
- btnSwitch.ButtonClickEvent += (sender, e) =>
- {
- btnSwitch.IsSelected = !btnSwitch.IsSelected;
- };
}
#endregion
@@ -310,7 +304,7 @@
/// <summary>
/// 鍒濆鍖栬澶囧洖璺浘鏍�
/// </summary>
- private void InitDeviceEpointIcon()
+ private void InitDeviceEpointIcon(VerticalFrameControl listBackControl)
{
bool hadDevice = false;
var listDevice = Common.LocalDevice.Current.GetDevicesByMac(deviceObj.DeviceAddr);
@@ -348,7 +342,7 @@
frameBorder.Gravity = Gravity.CenterHorizontal;
frameBorder.Width = Application.GetMinRealAverage(426);
frameBorder.Height = Application.GetMinRealAverage(426);
- bodyFrameLayout.AddChidren(frameBorder);
+ listBackControl.frameTable.AddChidren(frameBorder);
var btnPic = new PicViewControl(frameBorder.Width, frameBorder.Height, false);
@@ -357,19 +351,19 @@
if (listOffSwitch.Count == 8)
{
//鍏寜閿潰鏉�
- btnPic.UnSelectedImagePath = "Device/PanelFangyueEightButtonTable.png";
+ btnPic.UnSelectedImagePath = "DeviceItem/PanelFangyueEightButtonTable.png";
this.InitEightButtonPanelIcon(frameBorder, listOffSwitch);
}
else if (listOffSwitch.Count == 4)
{
//鍥涙寜閿潰鏉�
- btnPic.UnSelectedImagePath = "Device/PanelFangyueFourButtonTable.png";
+ btnPic.UnSelectedImagePath = "DeviceItem/PanelFangyueFourButtonTable.png";
this.InitFourButtonPanelIcon(frameBorder, listOffSwitch);
}
else
{
//浜屾寜閿潰鏉�
- btnPic.UnSelectedImagePath = "Device/PanelFangyueTwoButtonTable.png";
+ btnPic.UnSelectedImagePath = "DeviceItem/PanelFangyueTwoButtonTable.png";
this.InitTwoButtonPanelIcon(frameBorder, listOffSwitch);
}
}
--
Gitblit v1.8.0