| | |
| | | /// 该功能添加到到房间列表 |
| | | /// </summary> |
| | | public List<string> roomIds = new List<string>(); |
| | | /// <summary> |
| | | /// 绑定房间 |
| | | /// </summary> |
| | | public void BindRoom(string roomId) |
| | | { |
| | | roomIds.Add(roomId); |
| | | var pm = new DAL.Server.HttpServerRequest(); |
| | | pm.BindDeviceToRoom(deviceId, roomId); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// bus协议数据格式 |
| | |
| | | string roomNameList = ""; |
| | | foreach (var roomId in roomIds) |
| | | { |
| | | var findRoom = DB_ResidenceData.residenceData.Rooms.Find(obj => obj.uid == roomId); |
| | | var findRoom = SpatialInfo.CurrentSpatial.RoomList.Find(obj => obj.roomId == roomId); |
| | | if (findRoom == null) |
| | | { |
| | | continue; |
| | |
| | | if (pack.Code == DAL.Server.StateCode.SUCCESS) |
| | | { |
| | | var ssd = System.Text.Encoding.UTF8.GetBytes(Newtonsoft.Json.JsonConvert.SerializeObject(this)); |
| | | FileUtils.WriteFileByBytes(savePath, ssd); |
| | | MainPage.Log($"Save FunctionData {this.functionType} : {this.sid}"); |
| | | Common.FileUtlis.Files.WriteFileByBytes(savePath, ssd); |
| | | } |
| | | else |
| | | { |
| | | Utlis.ShowTip(Language.StringByID(StringId.EditFunctionInfoFail) + "Code:" + pack.Code); |
| | | Utlis.ShowTip(Language.StringByID(StringId.EditFunctionInfoFail) + "\r\nCode:" + pack.Code); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | var ssd = System.Text.Encoding.UTF8.GetBytes(Newtonsoft.Json.JsonConvert.SerializeObject(this)); |
| | | FileUtils.WriteFileByBytes(savePath, ssd); |
| | | MainPage.Log($"Save FunctionData {this.functionType} : {this.sid}"); |
| | | Common.FileUtlis.Files.WriteFileByBytes(savePath, ssd); |
| | | } |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// 转换成场景功能对象 |
| | |
| | | foreach (var attr in attributes) |
| | | { |
| | | sFunc.status.Add(new SceneFunctionStatus() { key = attr.key, value = attr.curValue.ToString() }); |
| | | sFunc.sid = this.sid; |
| | | } |
| | | return sFunc; |
| | | } |