From 4dce704aaf8587cf3f91cf88f2208315a03c4cbb Mon Sep 17 00:00:00 2001
From: 黄学彪 <hxb@hdlchina.com.cn>
Date: 星期三, 08 四月 2020 13:54:58 +0800
Subject: [PATCH] 先上传一个版本
---
ZigbeeApp/Shared/Phone/Device/Category/SelectDevice.cs | 87 ++++++++++++++++++++++---------------------
1 files changed, 45 insertions(+), 42 deletions(-)
diff --git a/ZigbeeApp/Shared/Phone/Device/Category/SelectDevice.cs b/ZigbeeApp/Shared/Phone/Device/Category/SelectDevice.cs
index 061f441..266fff7 100755
--- a/ZigbeeApp/Shared/Phone/Device/Category/SelectDevice.cs
+++ b/ZigbeeApp/Shared/Phone/Device/Category/SelectDevice.cs
@@ -45,7 +45,7 @@
/// <summary>
/// deviceUI
/// </summary>
- public DeviceUI deviceUI;
+ public CommonDevice deviceUI;
/// <summary>
/// 鍔熻兘绫诲瀷
/// </summary>
@@ -82,11 +82,11 @@
/// <summary>
/// dList
/// </summary>
- private List<DeviceUI> devList;
+ private List<CommonDevice> devList;
/// <summary>
/// 鐩稿悓绫诲瀷鐨勮澶囧垪琛�
/// </summary>
- private Dictionary<int, List<DeviceUI>> typeDeviceDic;
+ private Dictionary<int, List<CommonDevice>> typeDeviceDic;
/// <summary>
/// 璁惧绫诲瀷鐨勫浘id
/// </summary>
@@ -138,7 +138,7 @@
/// </summary>
private void InitData()
{
- typeDeviceDic = new Dictionary<int, List<DeviceUI>> { };
+ typeDeviceDic = new Dictionary<int, List<CommonDevice>> { };
typeIdDic = new Dictionary<int, DeviceConcreteType> { };
}
@@ -147,22 +147,22 @@
/// </summary>
private void RefreshData(Common.Room room)
{
- devList = room.DeviceUIList;
+ devList = UserCenter.HdlRoomLogic.Current.GetRoomListDevice(room);
typeDeviceDic.Clear();
typeIdDic.Clear();
foreach (var device in devList)
{
- var info = Common.LocalDevice.Current.GetDeviceBelongEnumInfo(device.CommonDevice);
+ var info = Common.LocalDevice.Current.GetDeviceBelongEnumInfo(device);
if (info.BeloneType == DeviceBeloneType.A寮�鍏� || info.BeloneType == DeviceBeloneType.A褰╃伅
|| info.BeloneType == DeviceBeloneType.A鎻掑骇 || info.BeloneType == DeviceBeloneType.A鏅鸿兘绌哄紑
|| info.BeloneType == DeviceBeloneType.A鐏厜 || info.BeloneType == DeviceBeloneType.A绌鸿皟
|| info.BeloneType == DeviceBeloneType.A绐楀笜 || info.BeloneType == DeviceBeloneType.A缁х數鍣�
- || info.BeloneType == DeviceBeloneType.A璋冨厜鍣�
+ || info.BeloneType == DeviceBeloneType.A璋冨厜鍣�
)
{
if (typeDeviceDic.ContainsKey(info.BeloneTextId) == false)
{
- var sameDevList = new List<DeviceUI> { };
+ var sameDevList = new List<CommonDevice> { };
sameDevList.Add(device);
typeDeviceDic[info.BeloneTextId] = sameDevList;
}
@@ -288,7 +288,8 @@
bodyFrameLayout.AddChidren(functionSceneBodyView);
RoomButton curBtn = new RoomButton(0, 0);
- foreach (var room in Common.Room.CurrentRoom.GetRoomsByFloorIdAppendLoveRoom(floorId))
+ var lisrRoom = UserCenter.HdlRoomLogic.Current.GetRoomsByFloorIdAppendLoveRoom(floorId);
+ foreach (var room in lisrRoom)
{
var row = new FrameLayout()
{
@@ -431,7 +432,7 @@
deviceListScrolView.RemoveAll();
- var sameTypeList = new List<DeviceUI> { };
+ var sameTypeList = new List<CommonDevice> { };
sameTypeList = typeDeviceDic[int.Parse((typeSender as Button).Tag.ToString())];
foreach (var device in sameTypeList)
@@ -448,11 +449,13 @@
deviceListScrolView.AddChidren(deviceTypeRowLayout);
var deviceRow = new FunctionRow(0, 35);
- deviceTypeRowLayout.AddChidren(deviceRow);
deviceRow.Init(device.IconPath, device.OnlineIconPath, true);
- deviceRow.SetTitle(device.CommonDevice.DeviceEpointName);
+ deviceRow.SetTitle(Common.LocalDevice.Current.GetDeviceEpointName(device));
deviceRow.IsSelected = true;
deviceRow.HideSwitchBtn(false);
+ deviceRow.NameBtn.BackgroundColor = ZigbeeColor.Current.GXCRedColor;
+ deviceTypeRowLayout.AddChidren(deviceRow);
+
deviceRow.ClickBtn.MouseUpEventHandler += (sender, e) =>
{
@@ -495,7 +498,7 @@
/// ShowSelectAction
/// </summary>
/// <param name="device"></param>
- private void ShowSelectAction(DeviceUI device, SceneTargetDeviceUI sceneTarget)
+ private void ShowSelectAction(CommonDevice device, SceneTargetDeviceUI sceneTarget)
{
var dialog = new FrameLayout()
{
@@ -508,23 +511,23 @@
dialog.RemoveFromParent();
};
- if (device.CommonDevice.Type == ZigBee.Device.DeviceType.OnOffOutput)
+ if (device.Type == ZigBee.Device.DeviceType.OnOffOutput)
{
SelectOnoffOutput(dialog, device, sceneTarget);
}
- else if (device.CommonDevice.Type == ZigBee.Device.DeviceType.AirSwitch)
+ else if (device.Type == ZigBee.Device.DeviceType.AirSwitch)
{
SelectOnoffOutput(dialog, device, sceneTarget);
}
- else if (device.CommonDevice.Type == ZigBee.Device.DeviceType.DimmableLight)
+ else if (device.Type == ZigBee.Device.DeviceType.DimmableLight)
{
SelectDimmableLight(dialog, device, sceneTarget);
}
- else if (device.CommonDevice.Type == ZigBee.Device.DeviceType.WindowCoveringDevice)
+ else if (device.Type == ZigBee.Device.DeviceType.WindowCoveringDevice)
{
SelectWindowCoveringDevice(dialog, device, sceneTarget);
}
- else if (device.CommonDevice.Type == ZigBee.Device.DeviceType.Thermostat)
+ else if (device.Type == ZigBee.Device.DeviceType.Thermostat)
{
SelectThermostat(dialog, device, sceneTarget);
}
@@ -536,7 +539,7 @@
/// <param name="dialog"></param>
/// <param name="device"></param>
/// <param name="sceneTarget"></param>
- private void SelectOnoffOutput(FrameLayout dialog, DeviceUI device, SceneTargetDeviceUI sceneTarget)
+ private void SelectOnoffOutput(FrameLayout dialog, CommonDevice device, SceneTargetDeviceUI sceneTarget)
{
var selectFL = new FrameLayout
{
@@ -585,7 +588,7 @@
Gravity = Gravity.CenterHorizontal,
TextColor = ZigbeeColor.Current.GXCTextBlackColor,
TextSize = 16,
- Text = device.CommonDevice.DeviceEpointName
+ Text = Common.LocalDevice.Current.GetDeviceEpointName(device)
};
titleFL.AddChidren(deviceName);
@@ -655,7 +658,7 @@
comfrimBtn.MouseUpEventHandler = (sender, e) =>
{
- var taskList = new List<ZigBee.Device.Scene.TaskListInfo> { };
+ var taskList = new List<Safeguard.TaskListInfo> { };
int taskType = 1;
int data1 = 0;
int data2 = 0;
@@ -672,7 +675,7 @@
data1 = 0;
data2 = 0;
}
- var taskInfo = new ZigBee.Device.Scene.TaskListInfo
+ var taskInfo = new Safeguard.TaskListInfo
{
TaskType = taskType,
Data1 = data1,
@@ -692,7 +695,7 @@
/// <param name="dialog"></param>
/// <param name="device"></param>
/// <param name="sceneTarget"></param>
- private void SelectWindowCoveringDevice(FrameLayout dialog, DeviceUI device, SceneTargetDeviceUI sceneTarget)
+ private void SelectWindowCoveringDevice(FrameLayout dialog, CommonDevice device, SceneTargetDeviceUI sceneTarget)
{
var selectFL = new FrameLayout
{
@@ -741,7 +744,7 @@
Gravity = Gravity.CenterHorizontal,
TextColor = ZigbeeColor.Current.GXCTextBlackColor,
TextSize = 16,
- Text = device.CommonDevice.DeviceEpointName
+ Text = Common.LocalDevice.Current.GetDeviceEpointName(device)
};
titleFL.AddChidren(deviceName);
@@ -794,7 +797,7 @@
dialog.RemoveFromParent();
};
- open.SeekBar.ProgressChanged += (sender, e) =>
+ open.SeekBar.OnProgressChangedEvent += (sender, e) =>
{
open.IsSelected = true;
shut.IsSelected = false;
@@ -812,13 +815,13 @@
{
open.IsSelected = true;
shut.IsSelected = false;
- open.SetProgress(sceneTarget.TaskList[0].Data2);
+ open.SetSeekBarProgress(sceneTarget.TaskList[0].Data2);
}
}
comfrimBtn.MouseUpEventHandler = (sender, e) =>
{
- var taskList = new List<ZigBee.Device.Scene.TaskListInfo> { };
+ var taskList = new List<Safeguard.TaskListInfo> { };
int taskType = 6;
int data1 = 0;
@@ -837,7 +840,7 @@
data2 = open.SeekBar.Progress;
}
- var taskInfo = new ZigBee.Device.Scene.TaskListInfo
+ var taskInfo = new Safeguard.TaskListInfo
{
TaskType = taskType,
Data1 = data1,
@@ -857,7 +860,7 @@
/// <param name="dialog"></param>
/// <param name="device"></param>
/// <param name="sceneTarget"></param>
- private void SelectDimmableLight(FrameLayout dialog, DeviceUI device, SceneTargetDeviceUI sceneTarget)
+ private void SelectDimmableLight(FrameLayout dialog, CommonDevice device, SceneTargetDeviceUI sceneTarget)
{
var selectFL = new FrameLayout
{
@@ -907,7 +910,7 @@
TextColor = ZigbeeColor.Current.GXCTextBlackColor,
TextSize = 16,
TextAlignment = TextAlignment.CenterLeft,
- Text = device.CommonDevice.DeviceEpointName
+ Text = Common.LocalDevice.Current.GetDeviceEpointName(device)
};
titleFL.AddChidren(deviceName);
@@ -960,7 +963,7 @@
dialog.RemoveFromParent();
};
- open.SeekBar.ProgressChanged += (sender, e) =>
+ open.SeekBar.OnProgressChangedEvent += (sender, e) =>
{
open.IsSelected = true;
shut.IsSelected = false;
@@ -978,13 +981,13 @@
{
open.IsSelected = true;
shut.IsSelected = false;
- open.SetProgress(sceneTarget.TaskList[0].Data1);
+ open.SetSeekBarProgress(sceneTarget.TaskList[0].Data1);
}
}
comfrimBtn.MouseUpEventHandler = (sender, e) =>
{
- var taskList = new List<ZigBee.Device.Scene.TaskListInfo> { };
+ var taskList = new List<Safeguard.TaskListInfo> { };
int taskType = 3;
int data1 = 0;
@@ -1003,7 +1006,7 @@
data2 = 0;
}
- var taskInfo = new ZigBee.Device.Scene.TaskListInfo
+ var taskInfo = new Safeguard.TaskListInfo
{
TaskType = taskType,
Data1 = data1,
@@ -1023,7 +1026,7 @@
/// <param name="dialog"></param>
/// <param name="device"></param>
/// <param name="sceneTarget"></param>
- private void SelectThermostat(FrameLayout dialog, DeviceUI device, SceneTargetDeviceUI sceneTarget)
+ private void SelectThermostat(FrameLayout dialog, CommonDevice device, SceneTargetDeviceUI sceneTarget)
{
var selectFL = new FrameLayout
{
@@ -1073,7 +1076,7 @@
TextColor = ZigbeeColor.Current.GXCTextBlackColor,
TextSize = 16,
TextAlignment = TextAlignment.CenterLeft,
- Text = device.CommonDevice.DeviceEpointName
+ Text = Common.LocalDevice.Current.GetDeviceEpointName(device)
};
titleFL.AddChidren(deviceName);
@@ -1167,7 +1170,7 @@
comfrimBtn.MouseUpEventHandler = (sender, e) =>
{
- var taskList = new List<ZigBee.Device.Scene.TaskListInfo> { };
+ var taskList = new List<Safeguard.TaskListInfo> { };
int taskType = 5;
int data1 = 0;
@@ -1178,7 +1181,7 @@
//鍏�
data1 = 3;
data2 = 0;
- var taskInfo = new ZigBee.Device.Scene.TaskListInfo
+ var taskInfo = new Safeguard.TaskListInfo
{
TaskType = taskType,
Data1 = data1,
@@ -1189,7 +1192,7 @@
else
{
//fan
- var taskInfo = new ZigBee.Device.Scene.TaskListInfo
+ var taskInfo = new Safeguard.TaskListInfo
{
TaskType = taskType,
Data1 = 6,
@@ -1198,7 +1201,7 @@
taskList.Add(taskInfo);
//mode
- var taskInfo2 = new ZigBee.Device.Scene.TaskListInfo
+ var taskInfo2 = new Safeguard.TaskListInfo
{
TaskType = taskType,
Data1 = 3,
@@ -1210,7 +1213,7 @@
if (open.modeList[modelId] == 4)
{
//heat
- var taskInfo3 = new ZigBee.Device.Scene.TaskListInfo
+ var taskInfo3 = new Safeguard.TaskListInfo
{
TaskType = taskType,
Data1 = 4,
@@ -1222,7 +1225,7 @@
else
{
//heat
- var taskInfo3 = new ZigBee.Device.Scene.TaskListInfo
+ var taskInfo3 = new Safeguard.TaskListInfo
{
TaskType = taskType,
Data1 = 5,
--
Gitblit v1.8.0