| | |
| | | /// </summary> |
| | | /// <param name="device"></param> |
| | | /// <param name="deviceBindType">0:场景 1:开关 2:插座 3:灯光 4:遮阳 5:空调 6:新风</param> |
| | | public PanelSimpleMutilfunctionAddTargetsForm(string deviceMac, int deviceBindType) |
| | | public PanelSimpleMutilfunctionAddTargetsForm(Panel controlDev, int deviceBindType) |
| | | { |
| | | curControlDev = new Panel(); |
| | | var dev = Common.LocalDevice.Current.GetDevice(deviceMac, 62);//简约面板随便一个回路来获取设备 |
| | | if (dev != null) |
| | | { |
| | | curControlDev.CurrentGateWayId = dev.CurrentGateWayId; |
| | | } |
| | | curControlDev.Type = DeviceType.OnOffSwitch; |
| | | curControlDev.DeviceAddr = deviceMac; |
| | | curBindType = deviceBindType; |
| | | this.curControlDev = controlDev; |
| | | this.curBindType = deviceBindType; |
| | | } |
| | | #endregion |
| | | |
| | |
| | | /// 刷新绑定表页面 |
| | | /// </summary> |
| | | public Action actionRefreshBindList; |
| | | /// <summary> |
| | | /// 是否能刷新 |
| | | /// </summary> |
| | | private bool canFresh = false; |
| | | #endregion |
| | | |
| | | #region UI设计 |
| | |
| | | { |
| | | TitleUI(); |
| | | MidFrameLayouUI(); |
| | | //首次初始化数据 |
| | | CommonPage.Loading.Start(""); |
| | | InitData(); |
| | | |
| | | //备注弹窗提示 |
| | | string msg = Language.StringByID(R.MyInternationalizationString.BindRemarkTip1).Replace("{0}", "\r\n"); |
| | | var alert = new Shared.Phone.ShowMsgControl(ShowMsgType.Confirm, msg, Language.StringByID(R.MyInternationalizationString.Iknown)); |
| | | alert.Show(); |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | midVerticalScrolViewLayout.BeginHeaderRefreshingAction += () => |
| | | { |
| | | midVerticalScrolViewLayout.BeginHeaderRefreshing(); |
| | | canFresh = true; |
| | | InitData(); |
| | | }; |
| | | |
| | |
| | | |
| | | btnFinifh = new Button() |
| | | { |
| | | Width = Application.GetRealWidth(907),
|
| | | Height = Application.GetRealHeight(127),
|
| | | Width = Application.GetRealWidth(907), |
| | | Height = Application.GetRealHeight(127), |
| | | Y = Application.GetRealHeight(49 + 35), |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Radius = (uint)Application.GetRealHeight(127) / 2, |
| | |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 楼层选择的侧边栏 |
| | | /// </summary> |
| | | void SideslipFramelayout() |
| | | { |
| | | var dialog = new Dialog |
| | | { |
| | | }; |
| | | dialog.Show(); |
| | | |
| | | var flMain = new FrameLayout { BackgroundColor = 0x00000000 }; |
| | | dialog.AddChidren(flMain); |
| | | flMain.MouseUpEventHandler += (sender11, e11) => |
| | | { |
| | | dialog.Close(); |
| | | }; |
| | | |
| | | var sidelipFrameLayout = new FrameLayout() |
| | | { |
| | | Width = Application.GetMinReal(449), |
| | | Y = Application.GetRealHeight(161), |
| | | X = Application.GetRealWidth(596), |
| | | BackgroundImagePath = "DoorLock/SideslipPic.png", |
| | | }; |
| | | flMain.AddChidren(sidelipFrameLayout); |
| | | |
| | | var btnSelectFloor = new Button() |
| | | { |
| | | Width = Application.GetRealWidth(200), |
| | | Height = Application.GetRealHeight(58), |
| | | X = Application.GetRealWidth(81), |
| | | Y = Application.GetRealHeight(81), |
| | | TextColor = Shared.Common.ZigbeeColor.Current.XMBlack, |
| | | TextSize = 14, |
| | | IsBold = true, |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextID = R.MyInternationalizationString.SelectFloor, |
| | | }; |
| | | sidelipFrameLayout.AddChidren(btnSelectFloor); |
| | | |
| | | var sidelipVerticalScrolViewLayout = new VerticalScrolViewLayout() |
| | | { |
| | | Y = btnSelectFloor.Bottom + Application.GetRealHeight(45), |
| | | Height = Application.GetRealHeight(600), |
| | | }; |
| | | sidelipFrameLayout.AddChidren(sidelipVerticalScrolViewLayout); |
| | | |
| | | Button oldbutton = null; |
| | | Button oldbuttonText = null; |
| | | int count = 0; |
| | | foreach (var floorId in dicFloorList.Keys) |
| | | { |
| | | var rowFrameLayout = new RowLayout() |
| | | { |
| | | Height = Application.GetRealHeight(152), |
| | | LineColor = Shared.Common.ZigbeeColor.Current.XMRowLine, |
| | | X = Application.GetRealWidth(81), |
| | | }; |
| | | sidelipVerticalScrolViewLayout.AddChidren(rowFrameLayout); |
| | | |
| | | var btnAllMethod = new Button() |
| | | { |
| | | Width = Application.GetMinReal(81), |
| | | Height = Application.GetMinReal(81), |
| | | UnSelectedImagePath = "Floor/Floor.png", |
| | | SelectedImagePath = "Floor/FloorSelected.png", |
| | | Gravity = Gravity.CenterVertical, |
| | | }; |
| | | rowFrameLayout.AddChidren(btnAllMethod); |
| | | |
| | | var btnMethodText = new Button() |
| | | { |
| | | Width = Application.GetRealWidth(311), |
| | | Height = Application.GetRealHeight(58), |
| | | X = Application.GetRealWidth(92), |
| | | Gravity = Gravity.CenterVertical, |
| | | TextColor = Shared.Common.ZigbeeColor.Current.XMGray3, |
| | | TextSize = 14, |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | Text = dicFloorList[floorId], |
| | | }; |
| | | rowFrameLayout.AddChidren(btnMethodText); |
| | | |
| | | if (curControlDev.currentSelectFloorId == floorId) |
| | | { |
| | | btnAllMethod.IsSelected = true; |
| | | btnAllMethod.IsBold = true; |
| | | btnMethodText.TextColor = Shared.Common.ZigbeeColor.Current.XMBlack; |
| | | } |
| | | |
| | | string curFloorId = floorId; |
| | | EventHandler<MouseEventArgs> hander = (sender, e) => |
| | | { |
| | | if (curControlDev.currentSelectFloorId == curFloorId) |
| | | { |
| | | return; |
| | | } |
| | | curControlDev.currentSelectFloorId = curFloorId; |
| | | |
| | | |
| | | |
| | | if (!btnMethodText.IsSelected) |
| | | { |
| | | if (oldbutton != null) |
| | | { |
| | | oldbutton.IsSelected = false; |
| | | } |
| | | if (oldbuttonText != null) |
| | | { |
| | | oldbuttonText.TextColor = Shared.Common.ZigbeeColor.Current.XMGray3; |
| | | } |
| | | oldbutton = btnMethodText; |
| | | oldbuttonText = btnMethodText; |
| | | btnMethodText.IsSelected = true; |
| | | oldbuttonText.TextColor = Shared.Common.ZigbeeColor.Current.XMBlack; |
| | | oldbuttonText.IsBold = true; |
| | | } |
| | | |
| | | int index = 0; |
| | | RefreshRoomList(); |
| | | dialog.Close(); |
| | | }; |
| | | btnAllMethod.MouseUpEventHandler += hander; |
| | | rowFrameLayout.MouseUpEventHandler += hander; |
| | | btnMethodText.MouseUpEventHandler += hander; |
| | | count++; |
| | | } |
| | | |
| | | if (count == 0) |
| | | { |
| | | sidelipFrameLayout.Height = 0; |
| | | } |
| | | else if (count <= 4 && count > 0) |
| | | { |
| | | sidelipFrameLayout.Height = Application.GetRealHeight(180) + count * Application.GetRealHeight(150); |
| | | } |
| | | else |
| | | { |
| | | sidelipFrameLayout.Height = Application.GetMinReal(780); |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 面板绑定目标表显示 |
| | | /// </summary> |
| | | /// <param name="gateway">Gateway.</param> |
| | | /// <param name="key">Key.</param> |
| | | void RefreshRoomList() |
| | | { |
| | | Room curRoom = null; |
| | | if (supportRoomList.Count == 0) |
| | | { |
| | | return; |
| | | } |
| | | btnHorizontalScrolViewLayout.RemoveAll(); |
| | | Room curRoom = null; |
| | | Button curentOldRoom = null; |
| | | FrameLayout curentOldRoomFrameLayout = null; |
| | | int index = 0; |
| | | curBindTypeList = MutilfunctionPanelMethod.GetMatchBindList(curBindType); |
| | | var roomTempList = MutilfunctionPanelMethod.GetSupportRoomList(curControlDev, supportRoomList, curBindTypeList, curBindType); |
| | | List<Room> roomTempList = new List<Room> { }; |
| | | Room slectedRoom = null; |
| | | var roomUn = new Room(); |
| | | roomUn.Name = Language.StringByID(R.MyInternationalizationString.Undistributed); |
| | | roomUn.Id = "UndistributedId"; |
| | | |
| | | if (supportRoomList.Count != 0) |
| | | { |
| | | roomTempList = MutilfunctionPanelMethod.GetSupportRoomList(curControlDev, supportRoomList, curBindTypeList, curBindType); |
| | | } |
| | | |
| | | if (curBindType == 0) |
| | | { |
| | | if (undistributeScList != null && undistributeScList.Count != 0) |
| | |
| | | } |
| | | } |
| | | |
| | | if (index == roomTempList.Count - 1 && index > 3) |
| | | if (index == roomTempList.Count - 1 && index > 2) |
| | | { |
| | | var btnRoomFrameLayoutEmpty = new FrameLayout |
| | | { |
| | |
| | | var btn = (Button)frame.GetChildren(0); |
| | | frame.BackgroundImagePath = "Item/RoomIconBackgroundSelected.png"; |
| | | btn.TextColor = Shared.Common.ZigbeeColor.Current.XMWhite; |
| | | curentOldRoom = btn; |
| | | curentOldRoomFrameLayout = frame; |
| | | } |
| | | else |
| | | { |
| | |
| | | X = devicePic.Right + Application.GetRealWidth(20), |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextSize = 15, |
| | | Text = Common.LocalDevice.Current.GetDeviceEpointName(device), |
| | | Text = HdlDeviceCommonLogic.Current.GetDeviceEpointName(device), |
| | | }; |
| | | rowLayout.AddChidren(btnBindName); |
| | | |
| | |
| | | { |
| | | line2.Visible = false; |
| | | } |
| | | if (Common.LocalDevice.Current.CheckDeviceIsOnline(device) == true)
|
| | | {
|
| | | btnBindName.TextColor = Shared.Common.ZigbeeColor.Current.TextBlack;
|
| | | }
|
| | | else
|
| | | {
|
| | | btnBindName.TextColor = Shared.Common.ZigbeeColor.Current.XMGray3;
|
| | | if (HdlDeviceCommonLogic.Current.CheckDeviceIsOnline(device) == true) |
| | | { |
| | | btnBindName.TextColor = Shared.Common.ZigbeeColor.Current.TextBlack; |
| | | } |
| | | else |
| | | { |
| | | btnBindName.TextColor = Shared.Common.ZigbeeColor.Current.XMGray3; |
| | | } |
| | | switch (curBindType) |
| | | { |
| | |
| | | |
| | | EventHandler<MouseEventArgs> hander = (sender, e) => |
| | | { |
| | | //目标备注处理 |
| | | var localName = System.Text.Encoding.UTF8.GetBytes(HdlDeviceCommonLogic.Current.GetDeviceEpointName(device)); |
| | | if (localName.Length > 20) |
| | | { |
| | | new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.BindRemarkTip2), Direction = AMPopTipDirection.None, CloseTime = 1 }.Show(Common.CommonPage.Instance); |
| | | return; |
| | | } |
| | | btnChoose.IsSelected = !btnChoose.IsSelected; |
| | | if (curBindType != 6) |
| | | { |
| | |
| | | |
| | | EventHandler<MouseEventArgs> hander = (sender, e) => |
| | | { |
| | | if (curSupportBindEpointList.Count == 0 || curSupportBindEpointList.Count == targetScList.Count) |
| | | |
| | | //目标备注处理 |
| | | if (!string.IsNullOrEmpty(scene.Name)) |
| | | { |
| | | var localName = System.Text.Encoding.UTF8.GetBytes(scene.Name); |
| | | if (localName.Length > 20) |
| | | { |
| | | new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.BindRemarkTip2), Direction = AMPopTipDirection.None, CloseTime = 1 }.Show(Common.CommonPage.Instance); |
| | | return; |
| | | } |
| | | } |
| | | |
| | | btnChoose.IsSelected = !btnChoose.IsSelected; |
| | | |
| | | if (curSupportBindEpointList.Count == 0) |
| | | { |
| | | new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.BindFull), Direction = AMPopTipDirection.None, CloseTime = 1 }.Show(Common.CommonPage.Instance); |
| | | return; |
| | | } |
| | | |
| | | btnChoose.IsSelected = !btnChoose.IsSelected; |
| | | if (!btnChoose.IsSelected) |
| | | { |
| | | targetScList.Remove(scene); |
| | |
| | | { |
| | | try |
| | | { |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | CommonPage.Loading.Start(""); |
| | | }); |
| | | |
| | | //获取楼层 |
| | | dicFloorList = HdlRoomLogic.Current.GetFloorSortList(); |
| | | curControlDev.currentSelectFloorId = BindInfo.GetCurrentSelectFloorId(); |
| | | |
| | | //获取楼层中房间列表 |
| | | supportRoomList = BindInfo.GetFloorRoomList(); |
| | | //获取房间列表 |
| | | supportRoomList = BindInfo.GetSupportRoomList(); |
| | | |
| | | //获取面板已经绑定的匹配类型的列表 |
| | | curBindTypeList = MutilfunctionPanelMethod.GetMatchBindList(curControlDev, curBindType); |
| | | |
| | | if (curBindType == 0) |
| | | { |
| | |
| | | undistributeDevList = MutilfunctionPanelMethod.GetUndistributeDeviceList(undistributeDevList, curBindTypeList, curBindType); |
| | | } |
| | | //获取当前支持的端点绑定表 |
| | | curSupportBindEpointList = MutilfunctionPanelMethod.GetMatchEpointList(curBindType); |
| | | curSupportBindEpointList = MutilfunctionPanelMethod.GetMatchEpointList(curControlDev, curBindType); |
| | | if (curBindType == 3) |
| | | { |
| | | foreach (var ep in curSupportBindEpointList) |
| | |
| | | { |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | BindDownFrameLayout(this.midFrameLayout, curControlDev, dicFloorList, ref btnFloorText); |
| | | if (!canFresh) |
| | | { |
| | | BindDownFrameLayout(this.midFrameLayout, curControlDev, dicFloorList, ref btnFloorText); |
| | | } |
| | | ChooseFloorAction += (floorId, btnMethodText) => |
| | | { |
| | | btnFloorText.Text = dicFloorList[floorId]; |
| | | |
| | | //获取楼层中房间列表 |
| | | //获取房间列表 |
| | | supportRoomList.Clear(); |
| | | supportRoomList = BindInfo.GetFloorRoomList(); |
| | | supportRoomList = BindInfo.GetSupportRoomList(); |
| | | if (curBindType == 0) |
| | | { |
| | | // 获取本地未分配的支持当前类型的绑定场景列表 |
| | |
| | | } |
| | | RefreshRoomList(); |
| | | }; |
| | | |
| | | btnFloorText.Text = BindInfo.GetCurrentSelectFloorIdName(); |
| | | //获取楼层中房间列表 |
| | | if (supportRoomList.Count != 0) |
| | | //默认楼层显示 |
| | | if (BindInfo.GetCurrentSelectFloorIdName() != null) |
| | | { |
| | | RefreshRoomList(); |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | btnFloorText.Text = BindInfo.GetCurrentSelectFloorIdName(); |
| | | }); |
| | | } |
| | | |
| | | //获取楼层中房间列表 |
| | | RefreshRoomList(); |
| | | CommonPage.Loading.Hide(); |
| | | canFresh = false; |
| | | midVerticalScrolViewLayout.EndHeaderRefreshing(); |
| | | }); |
| | | } |
| | |
| | | for (int i = 0; i < targetScList.Count; i++) |
| | | { |
| | | //绑定新的数据 |
| | | var addBindeDev = new AddBindData(); |
| | | addBindeDev.DeviceAddr = curControlDev.DeviceAddr; |
| | | var addSingleBindData = new AddSingleBindData(); |
| | | addSingleBindData.DeviceAddr = curControlDev.DeviceAddr; |
| | | for (int j = 0; j < curSupportBindEpointList.Count; j++) |
| | | { |
| | | curSendEpointList.Add(curSupportBindEpointList[0]); |
| | | addBindeDev.Epoint = curControlDev.DeviceEpoint = curSupportBindEpointList[0]; |
| | | addSingleBindData.Epoint = curControlDev.DeviceEpoint = curSupportBindEpointList[0]; |
| | | break; |
| | | } |
| | | var de = targetScList[i]; |
| | | var addBindInfo = new AddBindListObj(); |
| | | addBindInfo.BindType = 1; |
| | | addBindInfo.BindCluster = 6; |
| | | addBindInfo.BindScenesId = de.Id; |
| | | addBindeDev.BindList.Add(addBindInfo); |
| | | addSingleBindData.BindType = 1; |
| | | addSingleBindData.BindClusterList.Add(6); |
| | | addSingleBindData.BindScenesId = de.Id; |
| | | |
| | | var resT = AddDeviceBind(addBindeDev, targetSendCount, ref targetRecCount); |
| | | var resT = AddDeviceBind(addSingleBindData, targetSendCount, ref targetRecCount); |
| | | if (!resT) |
| | | { |
| | | break; |
| | |
| | | foreach (var de in targetList) |
| | | { |
| | | //绑定新的数据 |
| | | var addBindeDev = new AddBindData(); |
| | | addBindeDev.DeviceAddr = curControlDev.DeviceAddr; |
| | | var addSingleBindData = new AddSingleBindData(); |
| | | addSingleBindData.DeviceAddr = curControlDev.DeviceAddr; |
| | | |
| | | if (curBindType == 3) |
| | | { |
| | |
| | | for (int j = 0; j < curSupportDimmerEpointList.Count; j++) |
| | | { |
| | | curSendEpointList.Add(curSupportDimmerEpointList[0]); |
| | | addBindeDev.Epoint = curControlDev.DeviceEpoint = curSupportDimmerEpointList[0]; |
| | | addSingleBindData.Epoint = curControlDev.DeviceEpoint = curSupportDimmerEpointList[0]; |
| | | break; |
| | | } |
| | | } |
| | |
| | | for (int j = 0; j < curSupportLightEpointList.Count; j++) |
| | | { |
| | | curSendEpointList.Add(curSupportLightEpointList[0]); |
| | | addBindeDev.Epoint = curControlDev.DeviceEpoint = curSupportLightEpointList[0]; |
| | | addSingleBindData.Epoint = curControlDev.DeviceEpoint = curSupportLightEpointList[0]; |
| | | break; |
| | | } |
| | | } |
| | |
| | | for (int j = 0; j < curSupportBindEpointList.Count; j++) |
| | | { |
| | | curSendEpointList.Add(curSupportBindEpointList[0]); |
| | | addBindeDev.Epoint = curControlDev.DeviceEpoint = curSupportBindEpointList[0]; |
| | | addSingleBindData.Epoint = curControlDev.DeviceEpoint = curSupportBindEpointList[0]; |
| | | break; |
| | | } |
| | | } |
| | | |
| | | var addBindInfo = new AddBindListObj(); |
| | | addBindInfo.BindType = 0; |
| | | addBindInfo.BindMacAddr = de.DeviceAddr; |
| | | addBindInfo.BindEpoint = de.DeviceEpoint; |
| | | addSingleBindData.BindType = 0; |
| | | addSingleBindData.BindMacAddr = de.DeviceAddr; |
| | | addSingleBindData.BindEpoint = de.DeviceEpoint; |
| | | switch (curBindType) |
| | | { |
| | | case 0: |
| | | addBindInfo.BindCluster = 6; |
| | | break; |
| | | case 1: |
| | | addBindInfo.BindCluster = 6; |
| | | break; |
| | | case 2: |
| | | addBindInfo.BindCluster = 6; |
| | | addSingleBindData.BindClusterList.Add(6); |
| | | break; |
| | | case 3: |
| | | addBindInfo.BindCluster = 6; |
| | | break; |
| | | case 4: |
| | | addBindInfo.BindCluster = 258; |
| | | break; |
| | | case 5: |
| | | addBindInfo.BindCluster = 513; |
| | | break; |
| | | case 6: |
| | | addBindInfo.BindCluster = 514; |
| | | break; |
| | | } |
| | | addBindeDev.BindList.Add(addBindInfo); |
| | | |
| | | //部分目标需要二次绑定第二种功能 |
| | | var addBindInfo2 = new AddBindListObj(); |
| | | addBindInfo2.BindType = 0; |
| | | addBindInfo2.BindMacAddr = de.DeviceAddr; |
| | | addBindInfo2.BindEpoint = de.DeviceEpoint; |
| | | switch (curBindType) |
| | | { |
| | | case 3: |
| | | var device = LocalDevice.Current.GetDevice(de.DeviceAddr, de.DeviceEpoint); |
| | | addSingleBindData.BindClusterList.Add(6); |
| | | var device = HdlDeviceCommonLogic.Current.GetDevice(de.DeviceAddr, de.DeviceEpoint); |
| | | if (device != null) |
| | | { |
| | | if (device.Type == DeviceType.DimmableLight) |
| | | { |
| | | //灯光为调光时需要绑定6,8 |
| | | addBindInfo2.BindCluster = 8; |
| | | addBindeDev.BindList.Add(addBindInfo2); |
| | | addSingleBindData.BindClusterList.Add(8); |
| | | } |
| | | } |
| | | break; |
| | | case 4: |
| | | addSingleBindData.BindClusterList.Add(258); |
| | | break; |
| | | case 5: |
| | | //要绑定空调:需要绑定513,514 |
| | | addBindInfo2.BindCluster = 514; |
| | | addBindeDev.BindList.Add(addBindInfo2); |
| | | addSingleBindData.BindClusterList.Add(513); |
| | | addSingleBindData.BindClusterList.Add(514); |
| | | break; |
| | | case 6: |
| | | addSingleBindData.BindClusterList.Add(514); |
| | | break; |
| | | } |
| | | |
| | | var resT = AddDeviceBind(addBindeDev, targetSendCount, ref targetRecCount); |
| | | |
| | | var resT = AddDeviceBind(addSingleBindData, targetSendCount, ref targetRecCount); |
| | | if (!resT) |
| | | { |
| | | break; |
| | |
| | | /// <summary> |
| | | /// AddDeviceBind |
| | | /// </summary> |
| | | /// <param name="addBindeDev"></param> |
| | | /// <param name="addSingleBindData"></param> |
| | | /// <param name="targetSendCount"></param> |
| | | /// <param name="targetRecCount"></param> |
| | | /// <returns></returns> |
| | | private bool AddDeviceBind(AddBindData addBindeDev, int targetSendCount, ref int targetRecCount) |
| | | private bool AddDeviceBind(AddSingleBindData addSingleBindData, int targetSendCount, ref int targetRecCount) |
| | | { |
| | | var addSuccess = false; |
| | | var dev = HdlDeviceBindLogic.Current.AddDeviceBindAsync(addBindeDev); |
| | | if (dev != null && dev.addedDeviceBindResponseData != null) |
| | | var dev = HdlDeviceBindLogic.Current.AddDeviceSingleBindAsync(addSingleBindData); |
| | | if (dev != null && dev.addedDeviceSingleBindResponseData != null) |
| | | { |
| | | addSuccess = true; |
| | | targetRecCount++; |
| | | if (dev.addedDeviceBindResponseData.Result == 0) |
| | | if (dev.addedDeviceSingleBindResponseData.Result == 0) |
| | | { |
| | | var countTotal = targetRecCount; |
| | | |
| | | var bList = new List<BindListAllInfo>(); |
| | | foreach (var devB in dev.addedDeviceBindResponseData.BindList) |
| | | foreach (var cluster in dev.addedDeviceSingleBindResponseData.BindClusterList) |
| | | { |
| | | var curD = new BindListAllInfo(); |
| | | curD.KeyMacAddr = curControlDev.DeviceAddr; |
| | | curD.KeyEpoint = curControlDev.DeviceEpoint; |
| | | curD.BindCluster = devB.BindCluster; |
| | | curD.BindScenesId = devB.BindScenesId; |
| | | curD.BindMacAddr = devB.BindMacAddr; |
| | | curD.BindEpoint = devB.BindEpoint; |
| | | curD.ESName = devB.ESName; |
| | | curD.BindType = devB.BindType; |
| | | curD.BindCluster = cluster; |
| | | curD.BindScenesId = dev.addedDeviceSingleBindResponseData.BindScenesId; |
| | | curD.BindMacAddr = dev.addedDeviceSingleBindResponseData.BindMacAddr; |
| | | curD.BindEpoint = dev.addedDeviceSingleBindResponseData.BindEpoint; |
| | | curD.ESName = dev.addedDeviceSingleBindResponseData.ESName; |
| | | curD.BindType = dev.addedDeviceSingleBindResponseData.BindType; |
| | | bList.Add(curD); |
| | | } |
| | | if (MutilfunctionPanelMethod.bindTargetsFromMutilfunctionPanelList.ContainsKey(curControlDev.DeviceAddr + curControlDev.DeviceEpoint)) |
| | | |
| | | if (curControlDev.bindTargetsFromMutilfunctionPanelList.ContainsKey(curControlDev.DeviceAddr + curControlDev.DeviceEpoint)) |
| | | { |
| | | MutilfunctionPanelMethod.bindTargetsFromMutilfunctionPanelList[curControlDev.DeviceAddr + curControlDev.DeviceEpoint] = bList; |
| | | curControlDev.bindTargetsFromMutilfunctionPanelList[curControlDev.DeviceAddr + curControlDev.DeviceEpoint] = bList; |
| | | } |
| | | else |
| | | { |
| | | MutilfunctionPanelMethod.bindTargetsFromMutilfunctionPanelList.Add(curControlDev.DeviceAddr + curControlDev.DeviceEpoint, bList); |
| | | curControlDev.bindTargetsFromMutilfunctionPanelList.Add(curControlDev.DeviceAddr + curControlDev.DeviceEpoint, bList); |
| | | } |
| | | |
| | | if (curBindType == 3) |
| | | { |
| | | if (addBindeDev.Epoint >= 22 && addBindeDev.Epoint <= 28) |
| | | if (addSingleBindData.Epoint >= 22 && addSingleBindData.Epoint <= 28) |
| | | { |
| | | curSupportDimmerEpointList.RemoveAt(0); |
| | | |
| | | } |
| | | if (addBindeDev.Epoint >= 52 && addBindeDev.Epoint <= 61) |
| | | if (addSingleBindData.Epoint >= 52 && addSingleBindData.Epoint <= 61) |
| | | { |
| | | curSupportLightEpointList.RemoveAt(0); |
| | | } |
| | |
| | | } |
| | | }); |
| | | } |
| | | else if (dev.addedDeviceBindResponseData.Result == 1) |
| | | else if (dev.addedDeviceSingleBindResponseData.Result == 1) |
| | | { |
| | | Application.RunOnMainThread(() => |
| | | { |
| | |
| | | new Tip() |
| | | { |
| | | MaxWidth = 150, |
| | | Text = Language.StringByID(R.MyInternationalizationString.BindFailed), |
| | | Text = Language.StringByID(R.MyInternationalizationString.BindFailed) + "(" + "5020_1" + ")", |
| | | Direction = AMPopTipDirection.Up, |
| | | CloseTime = 1 |
| | | }.Show(btnFinifh); |
| | |
| | | new Tip() |
| | | { |
| | | MaxWidth = 150, |
| | | Text = Language.StringByID(R.MyInternationalizationString.BindUnknownError), |
| | | Text = Language.StringByID(R.MyInternationalizationString.BindUnknownError) + "(" + "5020_2" + ")", |
| | | Direction = AMPopTipDirection.Up, |
| | | CloseTime = 1 |
| | | }.Show(btnFinifh); |
| | |
| | | btnFinifh.Enable = true; |
| | | btnFinifh.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack; |
| | | RefreshRoomList(); |
| | | new Tip() |
| | | { |
| | | MaxWidth = 150, |
| | | Text = Language.StringByID(R.MyInternationalizationString.GwResponseOvertime) + "(" + "5020" + ")", |
| | | Direction = AMPopTipDirection.Up, |
| | | CloseTime = 1 |
| | | }.Show(btnFinifh); |
| | | CommonPage.Loading.Hide(); |
| | | GetEpointData(); |
| | | }); |
| | |
| | | curD.BindScenesId = dev.BindScenesId; |
| | | curD.BindMacAddr = dev.BindMacAddr; |
| | | curD.BindEpoint = dev.BindEpoint; |
| | | curD.ESName = dev.ESName; |
| | | curD.BindType = dev.BindType; |
| | | bList.Add(curD); |
| | | |
| | |
| | | } |
| | | |
| | | //更新bindTargetsFromMutilfunctionPanelList |
| | | if (MutilfunctionPanelMethod.bindTargetsFromMutilfunctionPanelList.ContainsKey(curControlDev.DeviceAddr + curControlDev.DeviceEpoint)) |
| | | if (curControlDev.bindTargetsFromMutilfunctionPanelList.ContainsKey(curControlDev.DeviceAddr + curControlDev.DeviceEpoint)) |
| | | { |
| | | MutilfunctionPanelMethod.bindTargetsFromMutilfunctionPanelList[curControlDev.DeviceAddr + curControlDev.DeviceEpoint] = bList; |
| | | curControlDev.bindTargetsFromMutilfunctionPanelList[curControlDev.DeviceAddr + curControlDev.DeviceEpoint] = bList; |
| | | } |
| | | else |
| | | { |
| | | MutilfunctionPanelMethod.bindTargetsFromMutilfunctionPanelList.Add(curControlDev.DeviceAddr + curControlDev.DeviceEpoint, bList); |
| | | curControlDev.bindTargetsFromMutilfunctionPanelList.Add(curControlDev.DeviceAddr + curControlDev.DeviceEpoint, bList); |
| | | } |
| | | |
| | | //更新当前支持的端点绑定表 |
| | | curSupportBindEpointList = MutilfunctionPanelMethod.GetMatchEpointList(curBindType); |
| | | curSupportBindEpointList = MutilfunctionPanelMethod.GetMatchEpointList(curControlDev, curBindType); |
| | | if (curBindType == 3) |
| | | { |
| | | foreach (var ep in curSupportBindEpointList) |