| | |
| | | complateDevice = true; |
| | | MainPage.Log($"============设备============完成" + FunctionList.List.Functions.Count); |
| | | } |
| | | |
| | | |
| | | #if DEBUG |
| | | DB_ResidenceData.Instance.CurrentRegion.isSupportGroupControl = true; |
| | | #endif |
| | | if (DB_ResidenceData.Instance.CurrentRegion.isSupportGroupControl) |
| | | { |
| | | var pack = Ins.HttpRequest.GetGroupControlList(); |
| | | if (pack != null) |
| | | { |
| | | if (pack.Code == StateCode.SUCCESS) |
| | | { |
| | | try |
| | | { |
| | | FunctionList.List.groupControls = JsonConvert.DeserializeObject<List<GroupControl>>(pack.Data.ToString()); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | MainPage.Log($"读取组控列表失败:{ex.Message}"); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | IMessageCommon.Current.ShowErrorInfoAlter(pack.Code); |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | //}) |
| | | //{ IsBackground = true }.Start(); |
| | | |
| | |
| | | |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// 更新设备状态 |
| | | /// A协议数据 |
| | | /// </summary> |
| | | /// <param name="updateBytes"></param> |
| | | public void UpdataGroupControlStatus(string revString, byte[] usefulBytes, bool isCloudData = false) |
| | | { |
| | | var temp = JsonConvert.DeserializeObject<AlinkFunctionStatusObj>(revString); |
| | | if (temp != null) |
| | | { |
| | | Control_Udp.ReceiveRepeatManager(temp.id, usefulBytes); |
| | | var allLocalFuntion = FunctionList.List.groupControls; |
| | | foreach (var updateTemp in temp.objects) |
| | | { |
| | | try |
| | | { |
| | | var localFunction = allLocalFuntion.Find((obj) => obj.sid == updateTemp.sid); |
| | | if (localFunction == null) |
| | | { |
| | | continue; |
| | | } |
| | | MainPage.Log($"收到数据:{revString}"); |
| | | foreach (var attr in updateTemp.status) |
| | | { |
| | | localFunction.time_stamp = temp.time_stamp; |
| | | localFunction.SetAttrState(attr.key, attr.value); |
| | | |
| | | } |
| | | |
| | | //更新界面状态 |
| | | switch (localFunction.spk) |
| | | { |
| | | case SPK.ElectricEnergy: |
| | | EnergyMainPage.UpdataStatus(localFunction); |
| | | break; |
| | | } |
| | | |
| | | HomePage.UpdataFunctionStates(localFunction); |
| | | RoomPage.UpdataStates(localFunction); |
| | | FunctionPage.UpdataStates(localFunction); |
| | | ClassificationPage.UpdataInfo(localFunction); |
| | | |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | MainPage.Log($"A协议更新状态异常:{ex.Message}"); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// 更新设备状态 |
| | | /// A协议数据 |
| | | /// </summary> |
| | | public void UpdataFunctionStatus(string revString, byte[] usefulBytes, bool isCloudData = false) |
| | | { |
| | | ////test 云端连接成功时,不适用本地数据更新 |
| | |
| | | } |
| | | finally |
| | | { |
| | | heartBeatThread = null; |
| | | if (heartBeatThread != null) |
| | | { |
| | | heartBeatThread = null; |
| | | } |
| | | HeartBeat(); |
| | | } |
| | | } |
| | |
| | | Topic = $"/user/{DB_ResidenceData.Instance.CurrentRegion.id}/app/thing/event/irCodeStudyDone/up", |
| | | QualityOfServiceLevel = MQTTnet.Protocol.MqttQualityOfServiceLevel.AtMostOnce |
| | | }; |
| | | //App订阅群控状态主题 |
| | | var groupControlStatus = new MqttTopicFilter() |
| | | { |
| | | Topic = $"/user/{DB_ResidenceData.Instance.CurrentRegion.id}/app/device/group/control/property/send", |
| | | QualityOfServiceLevel = MQTTnet.Protocol.MqttQualityOfServiceLevel.AtMostOnce |
| | | }; |
| | | |
| | | |
| | | #region 数据更新推送主题 |
| | |
| | | topicFilterPush2, topicAlinkStatus ,mqttkeyChange, |
| | | deviceOnlinePush, |
| | | securityStatusChange}); |
| | | //订阅群控状态 |
| | | if (DB_ResidenceData.Instance.CurrentRegion.isSupportGroupControl) |
| | | { |
| | | await RemoteMqttClient.SubscribeAsync(groupControlStatus); |
| | | } |
| | | if (result.Items[0].ResultCode == MQTTnet.Client.Subscribing.MqttClientSubscribeResultCode.GrantedQoS0) |
| | | { |
| | | isSubscribeSuccess = true; |
| | |
| | | } |
| | | } |
| | | #endregion |
| | | //群控状态 |
| | | else if (topic == $"/user/{DB_ResidenceData.Instance.CurrentRegion.id}/app/device/group/control/property/send") |
| | | { |
| | | var bytes = Securitys.EncryptionService.AesDecryptPayload(e.ApplicationMessage.Payload, tuyaEncryptKey); |
| | | var revString = Encoding.UTF8.GetString(bytes); |
| | | MainPage.Log($"mqtt 群控状态更新:{revString}"); |
| | | Control.Ins.UpdataGroupControlStatus(revString, null, true); |
| | | } |
| | | //A网关设备状态-包含涂鸦设备 |
| | | //Tag 网络状态解析 |
| | | else if (topic == $"/user/{DB_ResidenceData.Instance.CurrentRegion.id}/app/thing/property/send") |
| | | { |
| | | |
| | | var bytes = Securitys.EncryptionService.AesDecryptPayload(e.ApplicationMessage.Payload, tuyaEncryptKey); |
| | | var revString = Encoding.UTF8.GetString(bytes); |
| | | MainPage.Log($"mqtt 状态更新:{revString}"); |
| | |
| | | var pack = HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_GetGroupControlListByHome, requestJson); |
| | | return pack; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 获取群控详情 |
| | | /// </summary> |
| | | public ResponsePackNew GetGroupControInfo(String userDeviceGroupControlIds) |
| | | { |
| | | Dictionary<string, object> d = new Dictionary<string, object>(); |
| | | d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id); |
| | | var ids = new List<string>() |
| | | { |
| | | userDeviceGroupControlIds, |
| | | }; |
| | | d.Add("userDeviceGroupControlIds", ids); |
| | | var requestJson = HttpUtil.GetSignRequestJson(d); |
| | | var pack = HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_GetGroupControlInfos, requestJson); |
| | | return pack; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 添加群控列表 |
| | |
| | | d.Add("gatewayId", DB_ResidenceData.Instance.HomeGateway.gatewayId); |
| | | d.Add("infos", groupControls); |
| | | var requestJson = HttpUtil.GetSignRequestJson(d); |
| | | var pack = HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_GetGroupControlListByHome, requestJson); |
| | | var pack = HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_AddGroupControl, requestJson); |
| | | return pack; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 编辑群控列表 |
| | | /// </summary> |
| | | /// <param name="spk"></param> |
| | | /// <returns></returns> |
| | | public ResponsePackNew EditGroupControl(List<GroupControl> groupControls) |
| | | { |
| | | Dictionary<string, object> d = new Dictionary<string, object>(); |
| | | d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id); |
| | | d.Add("infos", groupControls); |
| | | var requestJson = HttpUtil.GetSignRequestJson(d); |
| | | var pack = HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_AddGroupControl, requestJson); |
| | | return pack; |
| | | } |
| | | |
| | |
| | | /// 固定域名,正式环境 |
| | | /// 公共域名就近解析 |
| | | /// </summary> |
| | | public const string GlobalRequestHttpsHost = "https://nearest.hdlcontrol.com"; |
| | | //public const string GlobalRequestHttpsHost = "https://test-gz.hdlcontrol.com"; |
| | | //public const string GlobalRequestHttpsHost = "https://nearest.hdlcontrol.com"; |
| | | public const string GlobalRequestHttpsHost = "https://test-gz.hdlcontrol.com"; |
| | | const string APP_KEY = "HDL-HOME-APP-TEST"; |
| | | const string SECRET_KEY = "WeJ8TY88vbakCcnvH8G1tDUqzLWY8yss"; |
| | | //public const string GlobalRequestHttpsHost = "http://59.41.255.150:7777";//mmmm |
| | |
| | | } |
| | | else |
| | | { |
| | | HDL_ON.Utlis.WriteLine($"接口异常:{requestFullUrl} \r\n"+response.ErrorMessage); |
| | | HDL_ON.Utlis.WriteLine($"接口异常:{requestFullUrl} \r\n"+response.Content); |
| | | return new ResponsePackNew() { Code = StateCode.NETWORK_ERROR }; |
| | | } |
| | | |
| | |
| | | |
| | | new System.Threading.Thread(() => |
| | | { |
| | | if (collect) |
| | | { |
| | | result = ApiUtlis.Ins.HttpRequest.CollectDevice(deviceId).Code; |
| | | if (spk == SPK.GroupControl) { |
| | | if (collect) |
| | | { |
| | | } |
| | | else |
| | | { |
| | | } |
| | | } |
| | | else |
| | | { |
| | | result = ApiUtlis.Ins.HttpRequest.CancelCollectDevice(deviceId).Code; |
| | | if (collect) |
| | | { |
| | | result = ApiUtlis.Ins.HttpRequest.CollectDevice(deviceId).Code; |
| | | } |
| | | else |
| | | { |
| | | result = ApiUtlis.Ins.HttpRequest.CancelCollectDevice(deviceId).Code; |
| | | } |
| | | } |
| | | //提示错误 |
| | | if (result != StateCode.SUCCESS) |
| | |
| | | public static class SPK |
| | | { |
| | | /// <summary> |
| | | /// 群控(自定义) |
| | | /// </summary> |
| | | public const string GroupControl = "GroupControl"; |
| | | /// <summary> |
| | | /// 通用开关 |
| | | /// </summary> |
| | | public const string OtherCommon = "other.common"; |
| | |
| | | /// </summary> |
| | | public List<Function> Functions = new List<Function>(); |
| | | /// <summary> |
| | | /// 群控列表 |
| | | /// </summary> |
| | | public List<GroupControl> groupControls = new List<GroupControl>(); |
| | | |
| | | |
| | | /// <summary> |
| | | /// 机械臂列表 |
| | | /// </summary> |
| | | /// <returns></returns> |
| | |
| | | if (titleId == StringId.Lights) |
| | | { |
| | | functionList.AddRange(FunctionList.List.GetLightList()); |
| | | functionList.AddRange(FunctionList.List.groupControls); |
| | | |
| | | |
| | | var lightScene = FunctionList.List.scenes.FindAll((obj) => obj.sceneType == SceneType.LightScene); |
| | | |
| | | foreach (var scene in lightScene) |
| | |
| | | /// 回调刷新 |
| | | /// </summary> |
| | | Action backActon; |
| | | |
| | | /// <summary> |
| | | /// 是否新增群控 |
| | | /// </summary> |
| | | bool isAdd = true; |
| | | |
| | | GroupControl groupControl; |
| | | |
| | | GroupControlType groupControlType = new GroupControlType(); |
| | | |
| | | |
| | | public AddGroupControlPage(List<Function> functions, GroupControl groupControl, Action action) |
| | | public AddGroupControlPage(GroupControl groupControl, Action action) |
| | | { |
| | | bodyView = this; |
| | | groupControlLightList = functions; |
| | | if(groupControl == null) |
| | | { |
| | | this.groupControl = new GroupControl(); |
| | | } |
| | | else |
| | | { |
| | | isAdd = false; |
| | | this.groupControl = groupControl; |
| | | } |
| | | groupControlLightList = new List<Function>(); |
| | | backActon = action; |
| | | lightList = FunctionList.List.GetLightList(); |
| | | this.groupControl = groupControl; |
| | | } |
| | | |
| | | public void LoadPage() |
| | |
| | | TextSize = CSS_FontSize.TextFontSize, |
| | | TextAlignment = TextAlignment.CenterRight, |
| | | TextColor = CSS_Color.TextualColor, |
| | | PlaceholderTextColor = CSS_Color.PromptingColor1, |
| | | }; |
| | | groupNameView.AddChidren(etGroupName); |
| | | |
| | |
| | | view.LoadPage(); |
| | | MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; |
| | | }; |
| | | btnLocationInfoRight.MouseUpEventHandler = eventHandler; |
| | | btnLocationValues.MouseUpEventHandler = eventHandler; |
| | | btnLocationInfoRight.MouseUpEventHandler = eventHandler; |
| | | btnLocationValues.MouseUpEventHandler = eventHandler; |
| | | |
| | | |
| | | //locationMagtView.AddChidren( |
| | |
| | | try |
| | | { |
| | | var http = new HttpServerRequest(); |
| | | groupControl.type = groupControlType.type; |
| | | groupControl.sid = groupControl.NewGroupControlSid(); |
| | | var pack = http.AddGroupControl(new List<GroupControl>() { groupControl }); |
| | | if (pack != null) |
| | | { |
| | |
| | | |
| | | //加载功能筛选组件 |
| | | LoadDialog_ChangeFloor(); |
| | | |
| | | |
| | | new Thread(() => { |
| | | var http = new HttpServerRequest(); |
| | | if (isAdd) |
| | | { |
| | | var pack = http.GetGroupControlTypes("light.switch"); |
| | | if (pack != null) |
| | | { |
| | | if (pack.Code == StateCode.SUCCESS) |
| | | { |
| | | try |
| | | { |
| | | |
| | | var groupControlTypes = Newtonsoft.Json.JsonConvert.DeserializeObject<List<GroupControlType>>(pack.Data.ToString()); |
| | | if (groupControlTypes != null && groupControlTypes.Count > 0) |
| | | { |
| | | groupControlType = groupControlTypes[0]; |
| | | } |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | MainPage.Log($"读取组控类型失败:{ex.Message}"); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | IMessageCommon.Current.ShowErrorInfoAlter(pack.Code); |
| | | } |
| | | } |
| | | } |
| | | else |
| | | { |
| | | var pack = http.GetGroupControInfo(groupControl.userDeviceGroupControlId); |
| | | if (pack != null) |
| | | { |
| | | if (pack.Code == StateCode.SUCCESS) |
| | | { |
| | | try |
| | | { |
| | | |
| | | var groupControlTemps = Newtonsoft.Json.JsonConvert.DeserializeObject<List<GroupControl>>(pack.Data.ToString()); |
| | | if (groupControlTemps != null && groupControlTemps.Count > 0) |
| | | { |
| | | groupControl = groupControlTemps[0]; |
| | | } |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | MainPage.Log($"读取组控信息失败:{ex.Message}"); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | IMessageCommon.Current.ShowErrorInfoAlter(pack.Code); |
| | | } |
| | | } |
| | | } |
| | | }) { IsBackground = true }.Start(); |
| | | |
| | | if (!isAdd) |
| | | { |
| | | etGroupName.Text = groupControl.name; |
| | | btnLocationValues.Text = groupControl.GetRoomListName(); |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | var functionDiv = new LightRow(function) |
| | | { |
| | | Gravity = Gravity.CenterHorizontal, |
| | | //Width = Application.GetRealWidth(343), |
| | | Height = Application.GetRealHeight(62), |
| | | BorderColor = 0x00FFFFFF, |
| | | BorderWidth = 1, |
| | |
| | | btnConfrim.IsSelected = false; |
| | | } |
| | | }; |
| | | if (groupControl.sids.Find((obj) => obj.sid == function.sid) != null) |
| | | { |
| | | groupControlLightList.Add(function); |
| | | } |
| | | |
| | | functionDiv.LoadDiv(groupControlLightList, setAction); |
| | | functionListView.AddChidren(functionDiv); |
| | |
| | | (s,c)=>{ |
| | | try |
| | | { |
| | | var page = new AddGroupControlPage(new System.Collections.Generic.List<Function>(),new GroupControl(), |
| | | var page = new AddGroupControlPage(null, |
| | | ()=> { |
| | | |
| | | }); |
| | |
| | | try |
| | | { |
| | | var groupControlList = Newtonsoft.Json.JsonConvert.DeserializeObject<List<GroupControl>>(pack.Data.ToString()); |
| | | LoadGroupControlView(groupControlList); |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | LoadGroupControlView(groupControlList); |
| | | }); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | |
| | | IMessageCommon.Current.ShowErrorInfoAlter(pack.Code); |
| | | } |
| | | } |
| | | |
| | | }) { IsBackground = true }.Start(); |
| | | |
| | | #region |
| | |
| | | |
| | | private void LoadGroupControlView(List<GroupControl> list) |
| | | { |
| | | if(list.Count == 0) |
| | | #if DEBUG |
| | | if (list.Count == 0) |
| | | { |
| | | list.Add(new GroupControl() |
| | | { |
| | | name = "组合调光1", |
| | | roomIds = new List<string> { Room.CurrentSpatial.RoomList[0].roomId }, |
| | | sid = "00000000000000001", |
| | | type = "light", |
| | | uids = new List<string>() { Room.CurrentSpatial.RoomList[0].uid }, |
| | | }); |
| | | |
| | | list.Add(new GroupControl() |
| | | { |
| | | name = "组合调光2", |
| | | roomIds = new List<string> { Room.CurrentSpatial.RoomList[0].roomId }, |
| | | sid = "00000000000000002", |
| | | type = "light", |
| | | uids = new List<string>() { Room.CurrentSpatial.RoomList[0].uid }, |
| | | }); |
| | | } |
| | | |
| | | #endif |
| | | |
| | | if (list.Count == 0) |
| | | { |
| | | |
| | | } |
| | |
| | | { |
| | | contentView.RemoveAll(); |
| | | |
| | | foreach (var function in list) |
| | | foreach (var groupControl in list) |
| | | { |
| | | var functionRow = new FrameLayout() |
| | | { |
| | |
| | | BackgroundColor = CSS_Color.MainBackgroundColor, |
| | | }; |
| | | contentView.AddChidren(functionRow); |
| | | |
| | | var btnRight = new Button() |
| | | { |
| | | X = Application.GetRealWidth(339), |
| | | Gravity = Gravity.CenterVertical, |
| | | Width = Application.GetMinRealAverage(16), |
| | | Height = Application.GetMinRealAverage(16), |
| | | UnSelectedImagePath = "Public/Right.png", |
| | | }; |
| | | functionRow.AddChidren(btnRight); |
| | | |
| | | var btnFunctionName = new Button() |
| | | { |
| | |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextSize = CSS_FontSize.SubheadingFontSize, |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | Text = function.name, |
| | | Text = groupControl.name, |
| | | }; |
| | | functionRow.AddChidren(btnFunctionName); |
| | | |
| | |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextSize = CSS_FontSize.PromptFontSize_FirstLevel, |
| | | TextColor = CSS_Color.PromptingColor1, |
| | | Text = function.GetRoomListName(), |
| | | Text = groupControl.GetRoomListName(), |
| | | }; |
| | | functionRow.AddChidren(btnFunctionLocationInfo); |
| | | |
| | |
| | | BackgroundColor = CSS_Color.DividingLineColor, |
| | | }); |
| | | |
| | | EventHandler<MouseEventArgs> eventHandler = (sender, e) => { |
| | | var page = new AddGroupControlPage(groupControl, |
| | | () => { |
| | | |
| | | }); |
| | | MainPage.BasePageView.AddChidren(page); |
| | | page.LoadPage(); |
| | | MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; |
| | | }; |
| | | functionRow.MouseUpEventHandler = eventHandler; |
| | | btnRight.MouseUpEventHandler = eventHandler; |
| | | btnFunctionName.MouseUpEventHandler = eventHandler; |
| | | btnFunctionLocationInfo.MouseUpEventHandler = eventHandler; |
| | | |
| | | } |
| | | |
| | | } |
| | |
| | | |
| | | namespace HDL_ON.Entity |
| | | { |
| | | public class GroupControl |
| | | public class GroupControl : Function |
| | | { |
| | | public GroupControl() |
| | | { |
| | | spk = "GroupControl"; |
| | | } |
| | | /// <summary> |
| | | /// 群控ID |
| | | /// </summary> |
| | | public string userDeviceGroupControlId = string.Empty; |
| | | /// <summary> |
| | | /// 群控sid |
| | | /// </summary> |
| | | public string sid = string.Empty; |
| | | //public string sid = string.Empty; |
| | | /// <summary> |
| | | /// 生成群控sid |
| | | /// </summary> |
| | | public string NewGroupControlSid() |
| | | { |
| | | string sceneId = ""; |
| | | try |
| | | { |
| | | string sOidBeginsWith = "000101";//厂商 + 通讯方式 |
| | | DateTime dt = DateTime.Now; |
| | | DateTime startTime = TimeZoneInfo.ConvertTimeToUtc(new DateTime(2020, 1, 1)); |
| | | long m = (long)((dt - startTime).TotalMilliseconds / 10); |
| | | string sTimeSpan = "00000000"; |
| | | |
| | | byte[] arry = new byte[4]; |
| | | arry[0] = (byte)(m & 0xFF); |
| | | arry[1] = (byte)((m & 0xFF00) >> 8); |
| | | arry[2] = (byte)((m & 0xFF0000) >> 16); |
| | | arry[3] = (byte)((m >> 24) & 0xFF); |
| | | sTimeSpan = arry[0].ToString("X2") + arry[1].ToString("X2") + arry[2].ToString("X2") + arry[3].ToString("X2"); |
| | | |
| | | |
| | | if (sTimeSpan.Length >= 8) |
| | | { |
| | | sTimeSpan = sTimeSpan.Substring(0, 8); |
| | | } |
| | | else |
| | | { |
| | | sTimeSpan = Guid.NewGuid().ToString().Substring(0, 8); |
| | | //sTimeSpan = "00000000"; |
| | | } |
| | | |
| | | sceneId = sOidBeginsWith + sTimeSpan; |
| | | |
| | | sceneId += "AA"; |
| | | sceneId += "AA01"; |
| | | int maxId = 1; |
| | | |
| | | Random random = new Random(Guid.NewGuid().GetHashCode()); |
| | | maxId = random.Next(10); |
| | | |
| | | sceneId += (maxId + 1).ToString("X4"); |
| | | sceneId += "0000"; |
| | | } |
| | | catch |
| | | { |
| | | return sceneId; |
| | | } |
| | | return sceneId; |
| | | } |
| | | /// <summary> |
| | | /// 群控名称 |
| | | /// </summary> |
| | | public string name = string.Empty; |
| | | //public string name = string.Empty; |
| | | /// <summary> |
| | | /// 群控类型 |
| | | /// </summary> |
| | |
| | | /// 房间uid |
| | | /// </summary> |
| | | public List<String> uids = new List<string>(); |
| | | public List<String> roomIds = new List<string>(); |
| | | //public List<String> roomIds = new List<string>(); |
| | | /// <summary> |
| | | /// 群控功能sid配置 |
| | | /// </summary> |
| | |
| | | |
| | | |
| | | |
| | | /// <summary> |
| | | /// 获取设备添加到房间的房间名称 |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | public string GetRoomListName() |
| | | { |
| | | string roomNameList = ""; |
| | | foreach (var roomId in roomIds) |
| | | { |
| | | var findRoom = SpatialInfo.CurrentSpatial.RoomList.Find(obj => obj.roomId == roomId); |
| | | if (findRoom == null) |
| | | { |
| | | continue; |
| | | } |
| | | if (roomNameList != "") |
| | | { |
| | | roomNameList += ","; |
| | | } |
| | | roomNameList += findRoom.floorName + "-" + findRoom.roomName; |
| | | } |
| | | if (roomNameList == "") |
| | | { |
| | | roomNameList = Language.StringByID(StringId.WholeZone); |
| | | } |
| | | return roomNameList; |
| | | } |
| | | ///// <summary> |
| | | ///// 获取设备添加到房间的房间名称 |
| | | ///// </summary> |
| | | ///// <returns></returns> |
| | | //public string GetRoomListName() |
| | | //{ |
| | | // string roomNameList = ""; |
| | | // foreach (var roomId in roomIds) |
| | | // { |
| | | // var findRoom = SpatialInfo.CurrentSpatial.RoomList.Find(obj => obj.roomId == roomId); |
| | | // if (findRoom == null) |
| | | // { |
| | | // continue; |
| | | // } |
| | | // if (roomNameList != "") |
| | | // { |
| | | // roomNameList += ","; |
| | | // } |
| | | // roomNameList += findRoom.floorName + "-" + findRoom.roomName; |
| | | // } |
| | | // if (roomNameList == "") |
| | | // { |
| | | // roomNameList = Language.StringByID(StringId.WholeZone); |
| | | // } |
| | | // return roomNameList; |
| | | //} |
| | | } |
| | | |
| | | public class GroupControlFunction |
| | |
| | | /// </summary> |
| | | public string spk = string.Empty; |
| | | } |
| | | |
| | | |
| | | public class GroupControlType |
| | | { |
| | | /// <summary> |
| | | /// 类型 |
| | | /// </summary> |
| | | public string type = string.Empty; |
| | | /// <summary> |
| | | /// 类型名称 |
| | | /// </summary> |
| | | public string typeName = string.Empty; |
| | | /// <summary> |
| | | /// 群控支持的spk |
| | | /// </summary> |
| | | public List<string> spks = new List<string>(); |
| | | /// <summary> |
| | | /// 群控支持的spk属性 |
| | | /// </summary> |
| | | public List<string> spkAttrs = new List<string>(); |
| | | } |
| | | } |
| | | |
| | |
| | | bodyView = this; |
| | | bodyView.BackgroundColor = CSS_Color.BackgroundColor; |
| | | } |
| | | |
| | | public void LoadView() |
| | | { |
| | | #region 个人信息 |
| | |
| | | /// 固定域名,正式环境 |
| | | /// 公共域名就近解析 |
| | | /// </summary> |
| | | public const string GlobalRequestHttpsHost = "https://nearest.hdlcontrol.com"; |
| | | //public const string GlobalRequestHttpsHost = "https://test-gz.hdlcontrol.com"; |
| | | //public const string GlobalRequestHttpsHost = "https://nearest.hdlcontrol.com"; |
| | | public const string GlobalRequestHttpsHost = "https://test-gz.hdlcontrol.com"; |
| | | const string APP_KEY = "HDL-HOME-APP-TEST"; |
| | | const string SECRET_KEY = "WeJ8TY88vbakCcnvH8G1tDUqzLWY8yss"; |
| | | //public const string GlobalRequestHttpsHost = "http://59.41.255.150:7777";//mmmm |