| | |
| | | 676=Moderate |
| | | 677=High |
| | | 678=Current user data has been cleared, about to return to the previous page. |
| | | |
| | | 679=Group control |
| | | |
| | | |
| | | |
| | |
| | | 7169=Time of duration |
| | | 7170=Human presence detection |
| | | 7171=continue |
| | | 7172=Rgb color plate |
| | | |
| | | 8501=Video door lock |
| | | 8502=Electric quantity |
| | |
| | | 676=中 |
| | | 677=高 |
| | | 678=当前用户数据已清空,即将返回上一页。 |
| | | 679=群控 |
| | | |
| | | |
| | | |
| | | 2532=访客邀请记录 |
| | |
| | | 7169=持续时间 |
| | | 7170=人体存在检测 |
| | | 7171=持续 |
| | | 7172=RGB色盘 |
| | | |
| | | |
| | | |
| | |
| | | 676=Moderate |
| | | 677=High |
| | | 678=Current user data has been cleared, about to return to the previous page. |
| | | 679=Group control |
| | | |
| | | |
| | | |
| | |
| | | 7169=Time of duration |
| | | 7170=Human presence detection |
| | | 7171=continue |
| | | 7172=Rgb color plate |
| | | |
| | | 8501=Video door lock |
| | | 8502=Electric quantity |
| | |
| | | 676=Moderate |
| | | 677=High |
| | | 678=Current user data has been cleared, about to return to the previous page. |
| | | 679=Group control |
| | | |
| | | |
| | | |
| | |
| | | 7169=Time of duration |
| | | 7170=Human presence detection |
| | | 7171=continue |
| | | 7172=Rgb color plate |
| | | |
| | | 8501=Video door lock |
| | | 8502=Electric quantity |
| | |
| | | 676=Moderate |
| | | 677=High |
| | | 678=Current user data has been cleared, about to return to the previous page. |
| | | 679=Group control |
| | | |
| | | |
| | | |
| | |
| | | 7169=Time of duration |
| | | 7170=Human presence detection |
| | | 7171=continue |
| | | 7172=Rgb color plate |
| | | |
| | | 8501=Video door lock |
| | | 8502=Electric quantity |
| | |
| | | { |
| | | |
| | | |
| | | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Xamarin.Android.Build.Tasks", "1.0.0.0")] |
| | | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Xamarin.Android.Build.Tasks", "12.2.8.165")] |
| | | public partial class Resource |
| | | { |
| | | |
| | |
| | | 676=Moderate |
| | | 677=High |
| | | 678=Current user data has been cleared, about to return to the previous page. |
| | | |
| | | 679=Group control |
| | | |
| | | |
| | | |
| | |
| | | 7169=Time of duration |
| | | 7170=Human presence detection |
| | | 7171=continue |
| | | 7172=Rgb color plate |
| | | |
| | | 8501=Video door lock |
| | | 8502=Electric quantity |
| | |
| | | 676=中 |
| | | 677=高 |
| | | 678=当前用户数据已清空,即将返回上一页。 |
| | | 679=群控 |
| | | |
| | | |
| | | |
| | | 2532=访客邀请记录 |
| | |
| | | 7169=持续时间 |
| | | 7170=人体存在检测 |
| | | 7171=持续 |
| | | 7172=RGB色盘 |
| | | |
| | | |
| | | |
| | |
| | | 676=Moderate |
| | | 677=High |
| | | 678=Current user data has been cleared, about to return to the previous page. |
| | | 679=Group control |
| | | |
| | | |
| | | |
| | |
| | | 7169=Time of duration |
| | | 7170=Human presence detection |
| | | 7171=continue |
| | | 7172=Rgb color plate |
| | | |
| | | 8501=Video door lock |
| | | 8502=Electric quantity |
| | |
| | | 676=Moderate |
| | | 677=High |
| | | 678=Current user data has been cleared, about to return to the previous page. |
| | | 679=Group control |
| | | |
| | | |
| | | |
| | |
| | | 7169=Time of duration |
| | | 7170=Human presence detection |
| | | 7171=continue |
| | | 7172=Rgb color plate |
| | | |
| | | 8501=Video door lock |
| | | 8502=Electric quantity |
| | |
| | | 676=Moderate |
| | | 677=High |
| | | 678=Current user data has been cleared, about to return to the previous page. |
| | | 679=Group control |
| | | |
| | | |
| | | |
| | |
| | | 7169=Time of duration |
| | | 7170=Human presence detection |
| | | 7171=continue |
| | | 7172=Rgb color plate |
| | | |
| | | 8501=Video door lock |
| | | 8502=Electric quantity |
| | |
| | | } |
| | | readSidList.Clear(); |
| | | } |
| | | //FunctionList.List.Functions.AddRange(FunctionList.List.groupControls); |
| | | } |
| | | if (readSidList.Count > 0) |
| | | { |
| | |
| | | { |
| | | |
| | | /// <summary> |
| | | /// 群控 |
| | | /// </summary> |
| | | public const int GroupControl = 679; |
| | | /// <summary> |
| | | /// 当前用户数据是清空,即将返回上一页。 |
| | | /// </summary> |
| | | public const int VideoDoorlockDelDataTip = 678; |
| | |
| | | /// 持续 |
| | | /// </summary> |
| | | public const int chixu = 7171; |
| | | /// <summary> |
| | | /// RGB色盘 |
| | | /// </summary> |
| | | public const int rgbsepan = 7172; |
| | | |
| | | |
| | | |
| | | /// <summary> |
| | |
| | | using HDL_ON.Entity; |
| | | using HDL_ON.UI; |
| | | using HDL_ON.DAL.Server; |
| | | using HDL_ON; |
| | | |
| | | namespace HDL_ON.DAL.Mqtt |
| | | { |
| | |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | Console.WriteLine(ex.Message); |
| | | MainPage.Log(ex.Message); |
| | | } |
| | | return reData; |
| | | } |
| | |
| | | /// </summary> |
| | | /// <param name="key"></param> |
| | | /// <returns></returns> |
| | | public string GetAttrState(string key , string defaultValue = "0") |
| | | public string GetAttrState(string key, string defaultValue = "0") |
| | | { |
| | | //一级查询keyValue值 |
| | | var attrState = attributes.Find((s) => s.key == key.ToString()); |
| | |
| | | /// <summary> |
| | | /// 物理设备(模块)型号 |
| | | /// </summary> |
| | | public string omodel =string.Empty; |
| | | public string omodel = string.Empty; |
| | | /// <summary> |
| | | /// 设备spk |
| | | /// </summary> |
| | |
| | | /// attri |
| | | /// </summary> |
| | | public List<FunctionAttributes> attributes = new List<FunctionAttributes>(); |
| | | |
| | | public List<FunctionAttributes> GetFunctionAttributes() |
| | | { |
| | | if (spk == SPK.GroupControl) |
| | | { |
| | | var list = new List<FunctionAttributes>(); |
| | | var gc = FunctionList.List.groupControls.Find((obj) => obj.sid == sid); |
| | | if (gc != null) |
| | | { |
| | | foreach (var temp in gc.sids) |
| | | { |
| | | var light = FunctionList.List.GetLightList().Find((obj) => obj.sid == temp.sid); |
| | | if (light != null) |
| | | { |
| | | foreach (var attr in light.attributes) |
| | | { |
| | | if (list.Find((obj) => obj.key == attr.key) == null) |
| | | { |
| | | list.Add(attr); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | return list; |
| | | } |
| | | else |
| | | { |
| | | return attributes; |
| | | } |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// 房间ID列表 |
| | |
| | | public SceneFunction ConvertSceneFunction() |
| | | { |
| | | var sFunc = new SceneFunction(); |
| | | if(spk == SPK.GroupControl) |
| | | { |
| | | |
| | | } |
| | | foreach (var attr in attributes) |
| | | { |
| | | //窗帘同时发送开关跟百分比会有问题, |
| | |
| | | continue; |
| | | } |
| | | } |
| | | }else if (spk == SPK.GroupControl) |
| | | { |
| | | sFunc.type = "5"; |
| | | } |
| | | |
| | | string us = ""; |
| | |
| | | /// <summary> |
| | | /// 群控(自定义) |
| | | /// </summary> |
| | | public const string GroupControl = "GroupControl"; |
| | | public const string GroupControl = "groupControl"; |
| | | /// <summary> |
| | | /// 通用开关 |
| | | /// </summary> |
| | |
| | | return sceneFunctionInfo; |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// 设备 |
| | | /// 场景 =scene |
| | | /// 群控=5 |
| | | /// </summary> |
| | | public string type = "0"; |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | SPK.AirSwitch, |
| | | SPK.PanelSocket,SPK.ElectricSocket, |
| | | SPK.MechanicalArm,SPK.IpCam_Imou, |
| | | SPK.GroupControl |
| | | }; |
| | | |
| | | |
| | |
| | | public static void Log(string msg) |
| | | { |
| | | #if DEBUG |
| | | if (msg.Contains("收到数据")) |
| | | if (msg.Contains("收到数据") |
| | | || msg.Contains("发送") |
| | | |
| | | ) |
| | | Console.WriteLine(msg); |
| | | #endif |
| | | } |
| | |
| | | sids = new List<GroupControlFunction>() |
| | | { |
| | | new GroupControlFunction(){ |
| | | sid = "light1", |
| | | sid = lightRgb1.sid, |
| | | spk = SPK.LightRGB, |
| | | }, |
| | | new GroupControlFunction(){ |
| | | sid = "light2", |
| | | sid = "light2", |
| | | spk = SPK.LightRGB, |
| | | }, |
| | | } |
| | |
| | | switch (outputTarget.target_type) |
| | | { |
| | | case "1": |
| | | case "5": |
| | | { |
| | | //用sid找到设备; |
| | | var device = LogicMethod.Current.GetDevice(outputTarget.sid); |
| | |
| | | //区别不同设备,显示不同设备状态 |
| | | switch (device.spk) |
| | | { |
| | | |
| | | case SPK.CommonSeries: |
| | | targetView.btnIcon.UnSelectedImagePath = "FunctionIcon/Icon/groupControl.png"; |
| | | stateStr = GetKeyValue("on_off", dicList) == "on" ? Language.StringByID(StringId.onLogic) : Language.StringByID(StringId.offLogic); |
| | |
| | | } |
| | | } |
| | | break; |
| | | |
| | | |
| | | case SPK.LightRGB: |
| | | case SPK.LightRGBW: |
| | | case SPK.LightCCT: |
| | | case SPK.LightDimming: |
| | | { |
| | | if(device.spk == SPK.LightRGB) |
| | | { |
| | | string colorful = GetKeyValue(FunctionAttributeKey.Colorful, dicList); |
| | | if (!string.IsNullOrEmpty(colorful)) |
| | | { |
| | | targetView.btnIcon.UnSelectedImagePath = "FunctionIcon/Icon/groupControl.png"; |
| | | if (colorful == "on") |
| | | { |
| | | stateStr = Language.StringByID(StringId.onLogic); |
| | | } |
| | | else if (colorful == "off") |
| | | { |
| | | stateStr = Language.StringByID(StringId.offLogic); |
| | | } |
| | | |
| | | break; |
| | | } |
| | | } |
| | | |
| | | string on_off = GetKeyValue("on_off", dicList); |
| | | string brightness = GetKeyValue("brightness", dicList); |
| | | if (on_off == "on" && brightness != "") |
| | |
| | | |
| | | } |
| | | break; |
| | | |
| | | case SPK.GroupControl: //群控 |
| | | { |
| | | targetView.btnIcon.UnSelectedImagePath = "FunctionIcon/Icon/groupControl.png"; |
| | | string on_off = GetKeyValue("on_off", dicList); |
| | | string brightness = GetKeyValue("brightness", dicList); |
| | | string cct = GetKeyValue(FunctionAttributeKey.CCT, dicList); |
| | | string colorful = GetKeyValue(FunctionAttributeKey.Colorful, dicList); |
| | | if (on_off == "on" && brightness != "") |
| | | { |
| | | stateStr = Language.StringByID(StringId.onLogic) + brightness + "%"; |
| | | } |
| | | else if (on_off == "on") |
| | | { |
| | | stateStr = Language.StringByID(StringId.onLogic); |
| | | } |
| | | else if (on_off == "off") |
| | | { |
| | | stateStr = Language.StringByID(StringId.offLogic); |
| | | } |
| | | else if (brightness != "") |
| | | { |
| | | stateStr = brightness + "%"; |
| | | } |
| | | //色温这个属性才有效 |
| | | if (!string.IsNullOrEmpty(cct)) |
| | | { |
| | | stateStr += "," + Language.StringByID(StringId.ColorTemperature) + cct + "k"; |
| | | } |
| | | |
| | | if (!string.IsNullOrEmpty(colorful)) |
| | | { |
| | | stateStr += "," + Language.StringByID(StringId.ColorfulFunction); |
| | | if (colorful == "on") |
| | | { |
| | | stateStr += Language.StringByID(StringId.onLogic); |
| | | } |
| | | else if (colorful == "off") |
| | | { |
| | | stateStr += Language.StringByID(StringId.offLogic); |
| | | } |
| | | |
| | | break; |
| | | } |
| | | |
| | | string rgb = GetKeyValue("rgb", dicList); |
| | | if (!string.IsNullOrEmpty(rgb) && rgb.Length > 6) |
| | | { |
| | | targetView.btnStateColor.Visible = true; |
| | | targetView.btnStateColor.BackgroundColor = new LogicView.RGBColorView().GetBackgroundColor(rgb); |
| | | } |
| | | |
| | | |
| | | } |
| | | break; |
| | | |
| | | case SPK.CurtainSwitch: |
| | | { |
| | | foreach (var dic in dicList) |
| | |
| | | } |
| | | } |
| | | break; |
| | | case SPK.GroupControl://群控 |
| | | { |
| | | foreach (var dic in dicList) |
| | | { |
| | | string value = dic["value"]; |
| | | switch (dic["key"]) |
| | | { |
| | | case "on_off": |
| | | case "colorful": |
| | | { |
| | | if (value == "on") |
| | | { |
| | | button1.Text = Language.StringByID(StringId.onLogic); |
| | | } |
| | | else |
| | | { |
| | | button1.Text = Language.StringByID(StringId.offLogic); |
| | | } |
| | | } |
| | | break; |
| | | case "brightness": |
| | | { |
| | | if (button1 == null) |
| | | { |
| | | //怕调试软件乱上东西导致抛异常 |
| | | break; |
| | | } |
| | | button1.Text = value + "%"; |
| | | } |
| | | break; |
| | | case "cct": |
| | | { |
| | | if (button1 == null) |
| | | { |
| | | //怕调试软件乱上东西导致抛异常 |
| | | break; |
| | | } |
| | | button1.Text = value + "k"; |
| | | } |
| | | break; |
| | | case "rgb": |
| | | { |
| | | if (button1 == null) |
| | | { |
| | | //怕调试软件乱上东西导致抛异常 |
| | | break; |
| | | } |
| | | if (!string.IsNullOrEmpty(value) && value.Length > 6) |
| | | { |
| | | button1.BackgroundColor = new LogicView.RGBColorView().GetBackgroundColor(value); |
| | | button1.Tag = value; |
| | | } |
| | | } |
| | | break; |
| | | |
| | | } |
| | | |
| | | } |
| | | } |
| | | break; |
| | | case SPK.CurtainSwitch: |
| | | { |
| | | foreach (var dic in dicList) |
| | |
| | | var list2 = this.GetVideoDeviceList(); |
| | | list.AddRange(list1); |
| | | list.AddRange(list2); |
| | | list.AddRange(FunctionList.List.groupControls); |
| | | #if DEBUG |
| | | GetTestDevice(ref list, true); |
| | | #endif |
| | |
| | | { |
| | | List<string> deviceStrTypeList = new List<string>(); |
| | | deviceStrTypeList.Clear(); |
| | | |
| | | |
| | | //群控 |
| | | var gp = deviceList.Find((device) => |
| | | device.spk == SPK.GroupControl); |
| | | if (gp != null) |
| | | { |
| | | deviceStrTypeList.Add(Language.StringByID(StringId.GroupControl)); |
| | | } |
| | | |
| | | ///灯光类 |
| | | var lightjosn = deviceList.Find((device) => |
| | | device.spk == SPK.LightSwitch |
| | |
| | | functionTypeList.Add(SPK.PanelSocket); |
| | | functionTypeList.Add(SPK.ElectricSocket); |
| | | } |
| | | //群控 |
| | | else if (deviceType == Language.StringByID(StringId.GroupControl)) |
| | | { |
| | | functionTypeList.Add(SPK.GroupControl); |
| | | } |
| | | ///窗帘类 |
| | | else if (deviceType == Language.StringByID(StringId.Curtain)) |
| | | { |
| | |
| | | else |
| | | { |
| | | //全部区域 |
| | | functionTypeList.Add(SPK.GroupControl); |
| | | functionTypeList.Add(SPK.Peephole); |
| | | functionTypeList.Add(SPK.Ev_Ipcam); |
| | | functionTypeList.Add(SPK.LightSwitch); |
| | |
| | | break; |
| | | case target_if: |
| | | { |
| | | deviceTypeList.Add(SPK.GroupControl); |
| | | deviceTypeList.Add(SPK.LightSwitch); |
| | | deviceTypeList.Add(SPK.LightRGB); |
| | | deviceTypeList.Add(SPK.LightRGBW); |
| | |
| | | #region 编辑设备状态 |
| | | switch (device.spk) |
| | | { |
| | | //群控 |
| | | case SPK.GroupControl: |
| | | int bottom = 50; |
| | | int attributesNameId=0; |
| | | int count = 0; |
| | | foreach (var attr in (device as GroupControl).attributes) |
| | | { |
| | | if (attr.key == FunctionAttributeKey.OnOff || |
| | | attr.key == FunctionAttributeKey.Brightness || |
| | | attr.key == FunctionAttributeKey.CCT || |
| | | attr.key == FunctionAttributeKey.RGB || |
| | | attr.key == FunctionAttributeKey.Colorful) |
| | | { |
| | | LogicView.FunTypeView view = new LogicView.FunTypeView(); |
| | | view.btnState.Name = "群控"; |
| | | view.frameLayout.Y = count * Application.GetRealHeight(50); |
| | | fLayout.AddChidren(view.FLayoutView()); |
| | | count++; |
| | | switch (attr.key) |
| | | { |
| | | case FunctionAttributeKey.OnOff: |
| | | attributesNameId = StringId.switchLogic; |
| | | ///开关点击事件 |
| | | view.btnClick.MouseUpEventHandler += (sender, e) => |
| | | { |
| | | SwitchViewMethod(device, view.btnState, 2); |
| | | }; |
| | | break; |
| | | case FunctionAttributeKey.Brightness: |
| | | attributesNameId = StringId.brightnesLogic; |
| | | view.btnState.Text = "5%";//产品经理晓辉要求改的 2021-11-06 |
| | | ///亮度点击事件 |
| | | view.btnClick.MouseUpEventHandler += (sender, e) => |
| | | { |
| | | BrightnessMethod(device, view.btnState, view.btnText.Text); |
| | | |
| | | }; |
| | | break; |
| | | case FunctionAttributeKey.CCT: |
| | | attributesNameId = StringId.ColorTemperature; |
| | | ///色温点击事件 |
| | | view.btnClick.MouseUpEventHandler += (sender, e) => |
| | | { |
| | | ColorTemperatureMethod(device, view.btnState, view.btnText.Text); |
| | | |
| | | }; |
| | | break; |
| | | case FunctionAttributeKey.RGB: |
| | | attributesNameId = StringId.rgbsepan; |
| | | view.btnState.Tag = ""; |
| | | view.btnState.Width = Application.GetRealWidth(16); |
| | | view.btnState.Height = Application.GetRealWidth(16); |
| | | view.btnState.Radius = (uint)Application.GetRealWidth(8); |
| | | view.btnState.X = Application.GetRealWidth(375 - 48 - 16); |
| | | ///RGB色盘点击事件 |
| | | view.btnClick.MouseUpEventHandler += (sender, e) => |
| | | { |
| | | RgbColorDiskMethod(device, view.btnState, view.btnText.Text); |
| | | }; |
| | | break; |
| | | case FunctionAttributeKey.Colorful: |
| | | attributesNameId = StringId.ColorfulFunction; |
| | | ///开关点击事件 |
| | | view.btnClick.MouseUpEventHandler += (sender, e) => |
| | | { |
| | | SwitchViewMethod(device, view.btnState, 2); |
| | | }; |
| | | break; |
| | | } |
| | | view.btnText.TextID = attributesNameId; |
| | | if (edit) |
| | | { |
| | | //显示编辑之前的设备状态 |
| | | GetEditDeviceState(device, index, view.btnState, null, null, null); |
| | | } |
| | | } |
| | | } |
| | | |
| | | //设备延时iewv |
| | | DelayView(fLayout, Application.GetRealHeight(50)* count); |
| | | break; |
| | | //插座(有USB) |
| | | case SPK.PanelSocket: |
| | | { |
| | |
| | | ///RGB色盘 |
| | | LogicView.FunTypeView rgbView = new LogicView.FunTypeView(); |
| | | rgbView.frameLayout.Y = brightnessView.frameLayout.Bottom; |
| | | //rgbView.btnText.TextID = StringId.brightnesLogic; |
| | | rgbView.btnText.Text= "RGB色盘"; |
| | | rgbView.btnText.TextID = StringId.rgbsepan; |
| | | rgbView.btnState.Tag = ""; |
| | | rgbView.btnState.Width = Application.GetRealWidth(16); |
| | | rgbView.btnState.Height = Application.GetRealWidth(16); |
| | |
| | | } |
| | | } |
| | | break; |
| | | case SPK.GroupControl: |
| | | { |
| | | outputDevice.target_type = "5"; |
| | | } |
| | | break; |
| | | |
| | | } |
| | | outputDevice.status.AddRange(dicSateteList); |
| | |
| | | } |
| | | } |
| | | break; |
| | | case SPK.GroupControl: |
| | | { |
| | | keyVlaue = "colorful"; |
| | | } |
| | | break; |
| | | } |
| | | //数据封装 |
| | | AddDictionary(keyVlaue, strValue); |
| | |
| | | case SPK.LightRGB: |
| | | case SPK.LightRGBW: |
| | | case SPK.LightCCT: |
| | | case SPK.GroupControl: |
| | | { |
| | | keyVlaue = "brightness"; |
| | | } |
| | |
| | | switch (device.spk) |
| | | { |
| | | case SPK.LightCCT: |
| | | case SPK.GroupControl: |
| | | { |
| | | keyVlaue = "cct"; |
| | | } |
| | |
| | | switch (device.spk) |
| | | { |
| | | case SPK.LightRGB: |
| | | case SPK.GroupControl: |
| | | { |
| | | keyVlaue = "rgb"; |
| | | } |
| | |
| | | var pack = pm.GetSceneInfo(scene.userSceneId); |
| | | if (pack.Code == StateCode.SUCCESS) |
| | | { |
| | | var sceneList = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Scene>>(pack.Data.ToString()); |
| | | var tempScene = sceneList.Find((obj) => obj.userSceneId == scene.userSceneId); |
| | | if (tempScene != null) |
| | | if (pack.Data != null) |
| | | { |
| | | scene.name = tempScene.name; |
| | | scene.delay = tempScene.delay; |
| | | scene.roomIds = tempScene.roomIds; |
| | | scene.functions = tempScene.functions; |
| | | var sceneList = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Scene>>(pack.Data.ToString()); |
| | | var tempScene = sceneList.Find((obj) => obj.userSceneId == scene.userSceneId); |
| | | if (tempScene != null) |
| | | { |
| | | scene.name = tempScene.name; |
| | | scene.delay = tempScene.delay; |
| | | scene.roomIds = tempScene.roomIds; |
| | | scene.functions = tempScene.functions; |
| | | } |
| | | } |
| | | Application.RunOnMainThread(() => |
| | | { |
| | |
| | | }; |
| | | bodyView.AddChidren(functionListView); |
| | | |
| | | foreach (var function in FunctionList.List.Functions) |
| | | List<Function> showList = new List<Function>(); |
| | | showList.AddRange(FunctionList.List.Functions); |
| | | showList.AddRange(FunctionList.List.groupControls); |
| | | |
| | | foreach (var function in showList) |
| | | { |
| | | if (!MainPage.SceneSupportFunctionList.Contains(function.spk)) |
| | | { |
| | |
| | | { |
| | | public GroupControl() |
| | | { |
| | | spk = "GroupControl"; |
| | | spk = "groupControl"; |
| | | } |
| | | /// <summary> |
| | | /// 群控ID |
| | |
| | | MainPage.Log($"群控控制失败: {ex.Message}"); |
| | | } |
| | | } |
| | | |
| | | |
| | | public new List<FunctionAttributes> attributes { |
| | | get |
| | | { |
| | | var list = new List<FunctionAttributes>(); |
| | | |
| | | foreach (var temp in sids) |
| | | { |
| | | var light = FunctionList.List.GetLightList().Find((obj) => obj.sid == temp.sid); |
| | | if (light != null) |
| | | { |
| | | foreach(var attr in light.attributes) |
| | | { |
| | | if(list.Find((obj)=>obj.key == attr.key) == null) |
| | | { |
| | | list.Add(attr); |
| | | } |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | return list; |
| | | } |
| | | } |
| | | } |
| | | |
| | | public class GroupControlFunction |
| | |
| | | backAction?.Invoke(curColor) ; |
| | | System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>(); |
| | | if (isSatrtColor) |
| | | { |
| | | d.Add(FunctionAttributeKey.ColorfulBegin, redColor + "," + greenColor + "," + blueColor); |
| | | function.SetAttrState(FunctionAttributeKey.ColorfulBegin, redColor + "," + greenColor + "," + blueColor); |
| | | var color = function.GetAttrState(FunctionAttributeKey.ColorfulEnd).Split(","); |
| | | var sendColorString = color[0] + "," + color[1] + "," + color[2]; |
| | | d.Add(FunctionAttributeKey.ColorfulEnd, sendColorString); |
| | | d.Add(FunctionAttributeKey.ColorfulTime, function.GetAttrState(FunctionAttributeKey.ColorfulTime)); |
| | | |
| | | } |
| | | else |
| | | { |
| | | var color = function.GetAttrState(FunctionAttributeKey.ColorfulBegin).Split(","); |
| | | var sendColorString = color[0] + "," + color[1] + "," + color[2]; |
| | | d.Add(FunctionAttributeKey.ColorfulBegin, sendColorString); |
| | | d.Add(FunctionAttributeKey.ColorfulTime, function.GetAttrState(FunctionAttributeKey.ColorfulTime)); |
| | | d.Add(FunctionAttributeKey.ColorfulEnd, redColor + "," + greenColor + "," + blueColor); |
| | | function.SetAttrState(FunctionAttributeKey.ColorfulEnd, redColor + "," + greenColor + "," + blueColor); |
| | | } |
| | | Control.Ins.SendWriteCommand(function, d); |
| | | this.RemoveFromParent(); |
| | | }; |
| | | |
| | | |
| | |
| | | btnRecommenColor1.MouseUpEventHandler = (sender, e) => { |
| | | curColor = btnCurColor.BackgroundColor = btnRecommenColor1.BackgroundColor; |
| | | etCurColorHexInfo.Text = "FC4645"; |
| | | redColor = 252; |
| | | greenColor = 70; |
| | | blueColor = 69; |
| | | |
| | | }; |
| | | btnRecommenColor2.MouseUpEventHandler = (sender, e) => { |
| | | curColor = btnCurColor.BackgroundColor = btnRecommenColor2.BackgroundColor; |
| | | etCurColorHexInfo.Text = "FD834D"; |
| | | redColor = 253; |
| | | greenColor = 131; |
| | | blueColor = 77; |
| | | }; |
| | | btnRecommenColor3.MouseUpEventHandler = (sender, e) => { |
| | | curColor = btnCurColor.BackgroundColor = btnRecommenColor3.BackgroundColor; |
| | | etCurColorHexInfo.Text = "00AB11"; |
| | | redColor = 0; |
| | | greenColor = 171; |
| | | blueColor = 17; |
| | | }; |
| | | btnRecommenColor4.MouseUpEventHandler = (sender, e) => { |
| | | curColor = btnCurColor.BackgroundColor = btnRecommenColor4.BackgroundColor; |
| | | etCurColorHexInfo.Text = "28952E"; |
| | | redColor = 40; |
| | | greenColor = 149; |
| | | blueColor = 46; |
| | | }; |
| | | btnRecommenColor5.MouseUpEventHandler = (sender, e) => { |
| | | curColor = btnCurColor.BackgroundColor = btnRecommenColor5.BackgroundColor; |
| | | etCurColorHexInfo.Text = "45B7FD"; |
| | | redColor = 69; |
| | | greenColor = 183; |
| | | blueColor = 253; |
| | | }; |
| | | btnRecommenColor6.MouseUpEventHandler = (sender, e) => { |
| | | curColor = btnCurColor.BackgroundColor = btnRecommenColor6.BackgroundColor; |
| | | etCurColorHexInfo.Text = "794EFC"; |
| | | redColor = 121; |
| | | greenColor = 78; |
| | | blueColor = 252; |
| | | }; |
| | | btnRecommenColor7.MouseUpEventHandler = (sender, e) => { |
| | | curColor = btnCurColor.BackgroundColor = btnRecommenColor7.BackgroundColor; |
| | | etCurColorHexInfo.Text = "FFFFFF"; |
| | | redColor = 255; |
| | | greenColor = 255; |
| | | blueColor = 255; |
| | | }; |
| | | } |
| | | |
| | |
| | | function.SetAttrState(FunctionAttributeKey.Colorful, controlColorfulState); |
| | | System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>(); |
| | | d.Add(FunctionAttributeKey.Colorful, controlColorfulState); |
| | | if (controlColorfulState == "on") |
| | | { |
| | | var color = function.GetAttrState(FunctionAttributeKey.ColorfulBegin).Split(","); |
| | | var sendColorString = color[0] + "," + color[1] + "," + color[2]; |
| | | d.Add(FunctionAttributeKey.ColorfulBegin, sendColorString); |
| | | color = function.GetAttrState(FunctionAttributeKey.ColorfulEnd).Split(","); |
| | | sendColorString = color[0] + "," + color[1] + "," + color[2]; |
| | | d.Add(FunctionAttributeKey.ColorfulEnd, sendColorString); |
| | | d.Add(FunctionAttributeKey.ColorfulTime, function.GetAttrState(FunctionAttributeKey.ColorfulTime)); |
| | | } |
| | | Control.Ins.SendWriteCommand(function, d); |
| | | }catch(Exception ex) |
| | | { |