| | |
| | | SmartSound.getInstantiate().LayerList = CollateData(); |
| | | SmartSound.getInstantiate().TokenID = mSoundInfo.Id; |
| | | SmartSound.getInstantiate().UserID = mSoundInfo.UserID; |
| | | SmartSound.getInstantiate().HomeID = mSoundInfo.HomeID; |
| | | |
| | | //上传数据到服务器 |
| | | string str = await postBatchEdit(); |
| | |
| | | // The remote server returned an error: (400) Bad Request. |
| | | string url = "https://developer.hdlcontrol.com/zigbeespeakerservice/BatchEdit"; |
| | | string json = Newtonsoft.Json.JsonConvert.SerializeObject(SmartSound.getInstantiate()); |
| | | string response_str = await MyHttpWebResponse.PostWebRequest(url, json, Encoding.UTF8); |
| | | string response_str = MyHttpWebResponse.PostWebRequest(url, json, Encoding.UTF8); |
| | | return response_str; |
| | | } |
| | | |
| | |
| | | for (int n = 0; n < SmartSound.LocaData.Count; n++) |
| | | { |
| | | SmartSound.Layer layer = SmartSound.LocaData[n]; |
| | | |
| | | foreach (Room room in roomList) |
| | | { |
| | | try |
| | |
| | | continue; |
| | | |
| | | SmartSound.Device smartDevice = new SmartSound.Device(); |
| | | //smartDevice.Id = device.DeviceID.ToString();//设备 Id |
| | | smartDevice.DeviceAddress = device.DeviceAddr;//设备 MAC |
| | | smartDevice.Epoint = device.DeviceEpoint;//设备端口 |
| | | //smartDevice.ClusterID = 0; |
| | | smartDevice.DeviceName = device.DeviceName;//设备名称 |
| | | smartDevice.DeviceName = Common.LocalDevice.Current.GetDeviceEpointName(device);//设备名称 |
| | | smartDevice.NicksName = ""; |
| | | smartDevice.DeviceType = GetDeviceType(device);//设备类型 |
| | | smartDevice.GatewayID = device.CurrentGateWayId;//网关 Id |
| | | //smartDevice.RoomID = room.Id;//房间 Id |
| | | if (smartDevice.DeviceType == 0) |
| | | continue; |
| | | |
| | | if(ZbGateway.GateWayBaseInfomations.ContainsKey(device.CurrentGateWayId) ==true)
|
| | | {
|
| | | smartDevice.GatewayID = ZbGateway.GateWayBaseInfomations[device.CurrentGateWayId].MacMark;//网关 Id
|
| | | } |
| | | else
|
| | | {
|
| | | smartDevice.GatewayID = device.CurrentGateWayId;//网关 Id
|
| | | } |
| | | |
| | | if (smartDevice.DeviceName == "" || smartDevice.DeviceName == string.Empty) |
| | | continue; |
| | | |
| | | smartRoom.DeviceList.Add(smartDevice); |
| | | |
| | | } |
| | | #endregion |
| | | |
| | |
| | | #region //添加场景 |
| | | for (int k = 0; k < sceneList.Count; k++) |
| | | { |
| | | SceneUI scene = sceneList[k]; |
| | | |
| | | if (scene == null) continue; |
| | | SmartSound.Scene smartScene = new SmartSound.Scene(); |
| | | //smartScene.Id = scene.DeviceID.ToString(); |
| | | smartScene.SceneName = scene.Name; |
| | | smartScene.SceneID = scene.Id; |
| | | smartScene.DelayTime = scene.DelayTime; |
| | | //smartScene.ClusterID = 0; |
| | | smartScene.NicksName = ""; |
| | | //smartScene.RoomID = room.Id; |
| | | smartScene.GatewayID = ZbGateway.MainGateWay.GwId; |
| | | try |
| | | { |
| | | SceneUI scene = sceneList[k]; |
| | | |
| | | if (smartScene.SceneName == "" || smartScene.SceneName == string.Empty) |
| | | continue; |
| | | if (scene == null) continue; |
| | | SmartSound.Scene smartScene = new SmartSound.Scene(); |
| | | smartScene.SceneName = scene.Name; |
| | | smartScene.SceneID = scene.Id; |
| | | smartScene.DelayTime = scene.DelayTime; |
| | | smartScene.NicksName = ""; |
| | | if (ZbGateway.GateWayBaseInfomations.ContainsKey(ZbGateway.MainGateWay.GwId) == true) |
| | | { |
| | | smartScene.GatewayID = ZbGateway.GateWayBaseInfomations[ZbGateway.MainGateWay.GwId].MacMark;//网关 Id |
| | | } |
| | | else |
| | | { |
| | | smartScene.GatewayID = ZbGateway.MainGateWay.GwId;//网关 Id |
| | | } |
| | | |
| | | smartRoom.SceneList.Add(smartScene); |
| | | if (smartScene.SceneName == "" || smartScene.SceneName == string.Empty) |
| | | continue; |
| | | |
| | | smartRoom.SceneList.Add(smartScene); |
| | | } |
| | | catch (Exception e) { } |
| | | } |
| | | #endregion |
| | | |
| | | if (smartRoom.DeviceList.Count == 0 && sceneList.Count == 0) |
| | | layer.RoomList.Remove(smartRoom); |
| | | |
| | | } |
| | | catch (Exception e) |
| | |
| | | if (!_device.Checked) |
| | | { |
| | | _room.DeviceList.Remove(_device); |
| | | k--; |
| | | } |
| | | } |
| | | #endregion |
| | |
| | | if (!_scene.Checked) |
| | | { |
| | | _room.SceneList.Remove(_scene); |
| | | n--; |
| | | } |
| | | } |
| | | #endregion |
| | |
| | | else |
| | | { |
| | | _layer.RoomList.Remove(_room); |
| | | j--; |
| | | } |
| | | } |
| | | } |
| | |
| | | if (_layer.RoomList.Count < 1) |
| | | { |
| | | TempDatas.Remove(_layer); |
| | | j--; |
| | | } |
| | | } |
| | | } |
| | |
| | | btnName.TextSize = 17;
|
| | | btnName.Y = Application.GetRealHeight(57);
|
| | | btnName.Text = mRoom.RoomName; |
| | | |
| | | Right_icon = this.AddRightArrow();
|
| | | Right_icon.Width = Application.GetRealWidth(115); |
| | | Right_icon.Height = Application.GetRealHeight(115); |