| | |
| | | using HDL_ON.UI.CSS; |
| | | using Shared; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | |
| | | namespace HDL_ON.UI |
| | | { |
| | |
| | | SceneFunction rgbColorful; |
| | | bool isOnStatus = false; |
| | | |
| | | public SceneFunctionInfoEditPage(Scene s, SceneFunction fc,Action action) |
| | | |
| | | public SceneFunctionInfoEditPage(Scene s, SceneFunction fc, Action action) |
| | | { |
| | | |
| | | bodyView = this; |
| | | scene = s; |
| | | sceneFunction = fc.localFunction.ConvertSceneFunction(); |
| | | foreach(var ll in sceneFunction.status) |
| | | sceneFunction = fc.localFunction.ConvertSceneFunction(); |
| | | foreach (var ll in sceneFunction.status) |
| | | { |
| | | try |
| | | { |
| | |
| | | { |
| | | bodyView.BackgroundColor = CSS_Color.BackgroundColor; |
| | | |
| | | new TopViewDiv(bodyView, sceneFunction.localFunction.name).LoadTopView(); |
| | | var topView = new TopViewDiv(bodyView, sceneFunction.localFunction.name); |
| | | topView.maginY = 10; |
| | | topView.LoadTopView(); |
| | | |
| | | contentView = new VerticalScrolViewLayout() |
| | | { |
| | | Y = Application.GetRealHeight(64), |
| | | Height = Application.GetRealHeight(520), |
| | | Y = Application.GetRealHeight(64 + 10), |
| | | Height = Application.GetRealHeight(510), |
| | | ScrollEnabled = false, |
| | | }; |
| | | bodyView.AddChidren(contentView); |
| | |
| | | case "security"://大华摄像布防撤防 |
| | | LoadFunctionRow(sceneFunction.status.Find((obj) => obj.key == "security")); |
| | | break; |
| | | case FunctionAttributeKey.SetVolume: |
| | | LoadFunctionRow(sceneFunction.status.Find((obj) => obj.key == FunctionAttributeKey.SetVolume)); |
| | | break; |
| | | case FunctionAttributeKey.Signal: |
| | | LoadFunctionRow(sceneFunction.status.Find((obj) => obj.key == FunctionAttributeKey.Signal)); |
| | | break; |
| | | case FunctionAttributeKey.SongName: |
| | | LoadFunctionRow(sceneFunction.status.Find((obj) => obj.key == FunctionAttributeKey.SongName)); |
| | | break; |
| | | case FunctionAttributeKey.Volume: |
| | | LoadFunctionRow(sceneFunction.status.Find((obj) => obj.key == FunctionAttributeKey.Volume)); |
| | | break; |
| | | } |
| | | } |
| | | |
| | |
| | | BackgroundColor = CSS_Color.MainColor, |
| | | TextSize = CSS_FontSize.SubheadingFontSize, |
| | | IsBold = true, |
| | | Radius = (uint) Application.GetRealWidth(22), |
| | | Radius = (uint)Application.GetRealWidth(22), |
| | | TextID = StringId.Complete |
| | | }; |
| | | bottomView.AddChidren(btnConfrim); |
| | | |
| | | btnConfrim.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | if (sceneFunction.localFunction.spk == SPK.GroupControl) { |
| | | if (sceneFunction.localFunction.spk == SPK.GroupControl) |
| | | { |
| | | var colorBegin = sceneFunction.status.Find((obj) => obj.key == FunctionAttributeKey.ColorfulBegin); |
| | | if (colorBegin != null) |
| | | { |
| | |
| | | } |
| | | else |
| | | { |
| | | var isHasColorful = sceneFunction.status.Find((obj) => obj.key == FunctionAttributeKey.Colorful); |
| | | if (isHasColorful != null) |
| | | if (sceneFunction.localFunction.spk == SPK.ElectricalTvHisense) |
| | | { |
| | | sceneFunction.status.Remove(isHasColorful); |
| | | for(int i = 0;i< sceneFunction.status.Count;i++) |
| | | { |
| | | var tvState = sceneFunction.status[i]; |
| | | if (tvState.key == FunctionAttributeKey.OnOff) |
| | | { |
| | | tvState.key = "wol"; |
| | | tvState.value = "on"; |
| | | } |
| | | else |
| | | { |
| | | if(string.IsNullOrEmpty( tvState.value)) |
| | | { |
| | | sceneFunction.status.RemoveAt(i); |
| | | i--; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | else |
| | | { |
| | | var isHasColorful = sceneFunction.status.Find((obj) => obj.key == FunctionAttributeKey.Colorful); |
| | | if (isHasColorful != null) |
| | | { |
| | | sceneFunction.status.Remove(isHasColorful); |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | { |
| | | sceneFunction.status.Clear(); |
| | | sceneFunction.status.Add(new SceneFunctionStatus() { key = FunctionAttributeKey.OnOff, value = "off" }); |
| | | sceneFunction.status.Add(new SceneFunctionStatus() { key = FunctionAttributeKey.Delay, value = sceneFunction.delay }); |
| | | } |
| | | } |
| | | } |
| | |
| | | { |
| | | if (temp != null) |
| | | { |
| | | //temp.delay = sceneFunction.delay; |
| | | //foreach (var attr in sceneFunction.status) |
| | | //{ |
| | | // var keva = temp.status.Find((obj) => obj.key == attr.key); |
| | | // if (keva != null) |
| | | // { |
| | | // keva.value = attr.value; |
| | | // } |
| | | //} |
| | | //temp = sceneFunction; |
| | | scene.functions.Remove(temp); |
| | | } |
| | | //else |
| | | { |
| | | scene.functions.Insert(0, sceneFunction); |
| | | |
| | | |
| | | if (sceneFunction.localFunction.spk == SPK.MusicStandard) |
| | | { |
| | | for (var i = 0; i < sceneFunction.status.Count;) |
| | | { |
| | | var ddd = sceneFunction.status[i]; |
| | | if (string.IsNullOrEmpty(ddd.value)) |
| | | { |
| | | sceneFunction.status.Remove(ddd); |
| | | continue; |
| | | } |
| | | i++; |
| | | } |
| | | |
| | | if (sceneFunction.status.Find((obj) => obj.key == FunctionAttributeKey.PlaylistName) == null) |
| | | { |
| | | if (isOnStatus) |
| | | { |
| | | var songNameStatus = sceneFunction.status.Find((obj) => obj.key == FunctionAttributeKey.SongName); |
| | | { |
| | | if (songNameStatus != null) |
| | | { |
| | | if (string.IsNullOrEmpty(songNameStatus.value)) |
| | | { |
| | | sceneFunction.status.Add(new SceneFunctionStatus() { key = FunctionAttributeKey.PlaylistName, value = "hdl_special" }); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | if (!string.IsNullOrEmpty(scene.userSceneId)) |
| | | { |
| | |
| | | |
| | | void UpdataFunctionRow() |
| | | { |
| | | contentView.RemoveAll(); |
| | | for (var i =0;i< functionRowList.Count; i++) |
| | | try |
| | | { |
| | | contentView.RemoveAll(); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | MainPage.Log(ex.Message); |
| | | } |
| | | for (var i = 0; i < functionRowList.Count; i++) |
| | | { |
| | | try |
| | | { |
| | | var view = functionRowList[i]; |
| | | if(view!= null) |
| | | if (view != null) |
| | | { |
| | | if(view.GetType() == typeof(FrameLayout)) |
| | | if (view.GetType() == typeof(FrameLayout)) |
| | | { |
| | | if (view.Tag != null) |
| | | { |
| | | if (view.Tag.ToString() == FunctionAttributeKey.OnOff) |
| | | if (view.Tag.ToString() == FunctionAttributeKey.OnOff || view.Tag.ToString() == "delay") |
| | | { |
| | | contentView.AddChidren(view); |
| | | |
| | | } |
| | | if (isOnStatus) |
| | | else |
| | | { |
| | | if (view.Tag.ToString() != FunctionAttributeKey.OnOff) |
| | | if (isOnStatus) |
| | | { |
| | | if (isColorful && sceneFunction.localFunction.spk == SPK.LightRGB) |
| | | if (view.Tag.ToString() != FunctionAttributeKey.OnOff) |
| | | { |
| | | if(view.Tag.ToString() != FunctionAttributeKey.Colorful) |
| | | if (isColorful && sceneFunction.localFunction.spk == SPK.LightRGB) |
| | | { |
| | | view.RemoveFromParent(); |
| | | if (view.Tag.ToString() != FunctionAttributeKey.Colorful) |
| | | { |
| | | view.RemoveFromParent(); |
| | | } |
| | | else |
| | | { |
| | | contentView.AddChidren(view); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | contentView.AddChidren(view); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | contentView.AddChidren(view); |
| | | } |
| | | } |
| | | } |
| | | else |
| | | { |
| | | if (view.Tag.ToString() != FunctionAttributeKey.OnOff) |
| | | else |
| | | { |
| | | view.RemoveFromParent(); |
| | | if (view.Tag.ToString() != FunctionAttributeKey.OnOff && view.Tag.ToString() != "delay") |
| | | { |
| | | view.RemoveFromParent(); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | }catch(Exception ex) |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | MainPage.Log($"UpdataFuntionRow error:{ex.Message}"); |
| | | } |
| | |
| | | |
| | | break; |
| | | case "angle": |
| | | //呈现的弹窗 |
| | | LoadEditDialog_Angle(sceneStatus, btnFunctionText); |
| | | //呈现的弹窗 |
| | | LoadEditDialog_Angle(sceneStatus, btnFunctionText); |
| | | |
| | | break; |
| | | case "cct": |
| | |
| | | case FunctionAttributeKey.Percent: |
| | | LoadEditDialog_Percent(sceneStatus, btnFunctionText); |
| | | break; |
| | | case FunctionAttributeKey.SetVolume: |
| | | BrightnessView(btnFunctionText.Text, btnFunctionName.Text, (volume, uintStr) => |
| | | { |
| | | btnFunctionText.Text = volume; |
| | | sceneStatus.value = volume; |
| | | }); |
| | | break; |
| | | case FunctionAttributeKey.Signal: |
| | | var p = new UI2.Intelligence.Automation.PublicInterface(); |
| | | var dic = p.GetHisenseSignalSourceDic(); |
| | | ListView(dic.Keys.ToList(), btnFunctionText.Text, btnFunctionName.Text, (valueStr) => |
| | | { |
| | | btnFunctionText.Text = valueStr; |
| | | sceneStatus.value = p.GetValue(dic, valueStr); |
| | | }); |
| | | break; |
| | | case FunctionAttributeKey.Volume: |
| | | BrightnessView(btnFunctionText.Text, btnFunctionName.Text, (volume, uintStr) => |
| | | { |
| | | btnFunctionText.Text = volume; |
| | | sceneStatus.value = volume; |
| | | }); |
| | | break; |
| | | case FunctionAttributeKey.SongName: |
| | | MusicListView(btnFunctionText.Text, (playListName, song) => |
| | | { |
| | | btnFunctionText.Text = song.name; |
| | | sceneStatus.value = song.name; |
| | | //追加属性 |
| | | var oldList = new List<SceneFunctionStatus>(); |
| | | for (int i = 0; i < sceneFunction.status.Count; i++) |
| | | { |
| | | var status = sceneFunction.status[i]; |
| | | if (status.key == FunctionAttributeKey.PlaylistName) |
| | | { |
| | | //控制需要(界面不需要显示) |
| | | sceneFunction.status.RemoveAt(i); |
| | | sceneFunction.status.Insert(i, new SceneFunctionStatus { key = FunctionAttributeKey.PlaylistName, value = playListName }); |
| | | } |
| | | else if (status.key == FunctionAttributeKey.Url) |
| | | { |
| | | //存在url就一起发过去 |
| | | if (!string.IsNullOrEmpty(song.url)) |
| | | { |
| | | //控制需要(界面不需要显示) |
| | | sceneFunction.status.RemoveAt(i); |
| | | sceneFunction.status.Insert(i, new SceneFunctionStatus { key = FunctionAttributeKey.Url, value = song.url }); |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | }); |
| | | break; |
| | | |
| | | } |
| | | }; |
| | | |
| | | #endregion |
| | | }catch(Exception ex) |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | MainPage.Log($"场景加载设备属性异常:{ex.Message}"); |
| | | } |
| | |
| | | btnFunctionName.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | LoadEditDialog_OnOff(sceneStatus, btnFunctionText); |
| | | //var colorfulModePage = new SetSceneRgbColorfulModePage(); |
| | | //colorfulModePage.backAction = (selectedSerise,status) => { |
| | | // if (selectedSerise == null) |
| | | // { |
| | | // if (status == "on") |
| | | // { |
| | | // isColorful = true; |
| | | // } |
| | | // else |
| | | // { |
| | | // isColorful = false; |
| | | // } |
| | | // } |
| | | // else |
| | | // { |
| | | // isColorful = true; |
| | | // rgbColorful = selectedSerise.ConvertSceneFunction(); |
| | | // } |
| | | // if (isColorful) |
| | | // { |
| | | // btnFunctionText.TextID = StringId.On; |
| | | // if (selectedSerise != null) |
| | | // { |
| | | // btnFunctionText.Text = selectedSerise.name; |
| | | // } |
| | | // } |
| | | // else |
| | | // { |
| | | // btnFunctionText.TextID = StringId.OFF; |
| | | // } |
| | | // UpdataFunctionRow(); |
| | | //}; |
| | | //MainPage.BasePageView.AddChidren(colorfulModePage); |
| | | //colorfulModePage.LoadPage(sceneFunction.localFunction.sid.Substring(0,16)); |
| | | //MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; |
| | | |
| | | |
| | | }; |
| | | |
| | | #endregion |
| | |
| | | delayRow.AddChidren(btnSceneDelayTitle); |
| | | |
| | | |
| | | btnSceneDelayTitle.MouseUpEventHandler = (sender, e) => { |
| | | Action<string> action = (obj) => { |
| | | btnSceneDelayTitle.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | Action<string> action = (obj) => |
| | | { |
| | | sceneFunction.delay = obj; |
| | | btnDelayInfo.Text = new Scene() { delay = sceneFunction.delay }.GetDelayText(); |
| | | }; |
| | |
| | | |
| | | dialog.Show(); |
| | | |
| | | pView.MouseUpEventHandler = (sender, e) => { |
| | | pView.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | dialog.Close(); |
| | | }; |
| | | |
| | | btnCancel.MouseUpEventHandler = (sender, e) => { |
| | | btnCancel.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | dialog.Close(); |
| | | }; |
| | | btnOn.MouseUpEventHandler = (sender, e) => { |
| | | btnOn.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | dialog.Close(); |
| | | trait.value = "true"; |
| | | sceneFunction.status.Find((obj) => obj.key == FunctionAttributeKey.Security).value = "true"; |
| | | btn.Text = trait.GetValueText() + trait.GetUintString(); |
| | | |
| | | }; |
| | | btnOff.MouseUpEventHandler = (sender, e) => { |
| | | btnOff.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | dialog.Close(); |
| | | trait.value = "false"; |
| | | sceneFunction.status.Find((obj) => obj.key == FunctionAttributeKey.Security).value = "false"; |
| | |
| | | trait.value = temp.ToString(); |
| | | |
| | | List<string> pickerItems = new List<string>(); |
| | | if(trait == null) |
| | | if (trait == null) |
| | | { |
| | | return; |
| | | } |
| | |
| | | |
| | | var optionBaseView = new FrameLayout() |
| | | { |
| | | Y = Application.GetRealHeight(456-60), |
| | | Y = Application.GetRealHeight(456 - 60), |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Width = Application.GetRealWidth(343), |
| | | Height = Application.GetRealHeight(260), |
| | |
| | | Radius = (uint)Application.GetRealWidth(12), |
| | | }; |
| | | optionBaseView.AddChidren(topView); |
| | | topView.AddChidren(new Button() {Y = Application.GetRealHeight(39), Height = Application.GetRealHeight(1), BackgroundColor = CSS_Color.DividingLineColor }); |
| | | topView.AddChidren(new Button() { Y = Application.GetRealHeight(39), Height = Application.GetRealHeight(1), BackgroundColor = CSS_Color.DividingLineColor }); |
| | | |
| | | var btnCancel = new Button() |
| | | { |
| | |
| | | if (pickerItems.Contains(trait.value + trait.GetUintString())) |
| | | { |
| | | selectItem = trait.value.ToString() + trait.GetUintString(); |
| | | uIPickerView.setCurrentItems(pickerItems.IndexOf(selectItem),0,0); |
| | | uIPickerView.setCurrentItems(pickerItems.IndexOf(selectItem), 0, 0); |
| | | } |
| | | |
| | | dialog.Show(); |
| | | |
| | | pView.MouseUpEventHandler = (sender, e) => { |
| | | pView.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | dialog.Close(); |
| | | }; |
| | | |
| | | btnCancel.MouseUpEventHandler = (sender, e) => { |
| | | btnCancel.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | dialog.Close(); |
| | | }; |
| | | uIPickerView.OnSelectChangeEvent = (int1, int2, int3) => { |
| | | uIPickerView.OnSelectChangeEvent = (int1, int2, int3) => |
| | | { |
| | | selectItem = pickerItems[int1]; |
| | | }; |
| | | btnConfrim.MouseUpEventHandler = (sender, e) => { |
| | | btnConfrim.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | dialog.Close(); |
| | | btn.Text = selectItem; |
| | | //sceneFunction.status.Find((obj) => obj.key == FunctionAttributeKey.OnOff).value = trait.value.ToString() ; |
| | | trait.value = selectItem.Replace(trait.GetUintString(),""); |
| | | trait.value = selectItem.Replace(trait.GetUintString(), ""); |
| | | }; |
| | | |
| | | } |
| | |
| | | /// </summary> |
| | | /// <param name="function"></param> |
| | | /// <param name="btn"></param> |
| | | void LoadEditDialog_Angle (SceneFunctionStatus trait, Button btn) |
| | | void LoadEditDialog_Angle(SceneFunctionStatus trait, Button btn) |
| | | { |
| | | double temp = trait.min; |
| | | double.TryParse(trait.value, out temp); |
| | |
| | | } |
| | | uIPickerView.setNPicker(pickerItems, null, null); |
| | | optionBaseView.AddChidren(uIPickerView); |
| | | uIPickerView.setCurrentItems(pickerItems.IndexOf(trait.value.ToString()+ "°"), 0, 0); |
| | | uIPickerView.setCurrentItems(pickerItems.IndexOf(trait.value.ToString() + "°"), 0, 0); |
| | | |
| | | string selectItem = pickerItems[pickerItems.IndexOf(trait.value.ToString() + "°")]; |
| | | if (pickerItems.Contains(trait.value + trait.GetUintString())) |
| | |
| | | //uIPickerView.setCurrentItems |
| | | dialog.Show(); |
| | | |
| | | pView.MouseUpEventHandler = (sender, e) => { |
| | | pView.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | dialog.Close(); |
| | | }; |
| | | |
| | | btnCancel.MouseUpEventHandler = (sender, e) => { |
| | | btnCancel.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | dialog.Close(); |
| | | }; |
| | | uIPickerView.OnSelectChangeEvent = (int1, int2, int3) => { |
| | | uIPickerView.OnSelectChangeEvent = (int1, int2, int3) => |
| | | { |
| | | selectItem = pickerItems[int1]; |
| | | }; |
| | | btnConfrim.MouseUpEventHandler = (sender, e) => { |
| | | btnConfrim.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | dialog.Close(); |
| | | btn.Text = selectItem; |
| | | //sceneFunction.status.Find((obj) => obj.key == FunctionAttributeKey.OnOff).value = trait.value.ToString() ; |
| | |
| | | } |
| | | |
| | | double temp = trait.min; |
| | | |
| | | |
| | | double.TryParse(trait.value, out temp); |
| | | trait.value = temp.ToString(); |
| | | |
| | |
| | | uIPickerView.setCurrentItems(pickerItems.IndexOf(trait.value.ToString()), 4, 5); |
| | | |
| | | string selectItem = pickerItems[0]; |
| | | if (pickerItems.Contains(trait.value + trait.GetUintString())) |
| | | if (pickerItems.Contains(trait.value + trait.GetUintString())) |
| | | { |
| | | selectItem = trait.value.ToString() + trait.GetUintString(); |
| | | } |
| | | |
| | | dialog.Show(); |
| | | |
| | | pView.MouseUpEventHandler = (sender, e) => { |
| | | pView.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | dialog.Close(); |
| | | }; |
| | | |
| | | btnCancel.MouseUpEventHandler = (sender, e) => { |
| | | btnCancel.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | dialog.Close(); |
| | | }; |
| | | uIPickerView.OnSelectChangeEvent = (int1, int2, int3) => { |
| | | uIPickerView.OnSelectChangeEvent = (int1, int2, int3) => |
| | | { |
| | | selectItem = pickerItems[int1]; |
| | | }; |
| | | btnConfrim.MouseUpEventHandler = (sender, e) => { |
| | | btnConfrim.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | dialog.Close(); |
| | | btn.Text = selectItem; |
| | | //sceneFunction.status.Find((obj) => obj.key == FunctionAttributeKey.OnOff).value = trait.value.ToString() ; |
| | |
| | | |
| | | #endregion |
| | | |
| | | int attrViewHight = Application.GetRealHeight(18 + 22+ 248); |
| | | int attrViewHight = Application.GetRealHeight(18 + 22 + 248); |
| | | //属性设置区域 |
| | | var attrView = new FrameLayout() |
| | | { |
| | |
| | | contentView.AddChidren(attrView); |
| | | attrView.AddChidren(new Button() { Height = Application.GetRealHeight(18) }); |
| | | |
| | | |
| | | |
| | | |
| | | #region RGB |
| | | var rgbView = new FrameLayout() |
| | |
| | | int circleR = colorPicker.Width / 2 - Application.GetRealWidth(12); |
| | | |
| | | |
| | | colorPicker.ColorChaged += (sender2, e2) => { |
| | | colorPicker.ColorChaged += (sender2, e2) => |
| | | { |
| | | rgbString = (e2[0] + "," + e2[1] + "," + e2[2]).ToString(); |
| | | //trait.value = rgbString; |
| | | btnCurColor.BackgroundColor = (uint)(0xFF000000 + tempLight.GetRGBcolor(rgbString)); |
| | |
| | | TextID = StringId.Cancel, |
| | | }; |
| | | bottomView.AddChidren(btnCancel); |
| | | btnCancel.MouseUpEventHandler = (sender, e) => { |
| | | btnCancel.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | dialog.Close(); |
| | | }; |
| | | |
| | |
| | | //例:右下圆角 大小为50 |
| | | int mRectCornerID = HDLUtils.RectCornerBottomRight; |
| | | btnComplete.SetCornerWithSameRadius((uint)Application.GetRealWidth(14), mRectCornerID); |
| | | btnComplete.MouseUpEventHandler = (sender, e) => { |
| | | btnComplete.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | dialog.Close(); |
| | | trait.value = rgbString; |
| | | btn.BackgroundColor = (uint)(0xFF000000 + tempLight.GetRGBcolor(rgbString)); |
| | |
| | | return; |
| | | } |
| | | |
| | | Dialog dialog = new Dialog() { |
| | | Dialog dialog = new Dialog() |
| | | { |
| | | Height = Application.GetRealHeight(647), |
| | | }; |
| | | |
| | |
| | | int circleR = colorPicker.Width / 2 - Application.GetRealWidth(12); |
| | | |
| | | |
| | | colorPicker.ColorChaged += (sender2, e2) => { |
| | | colorPicker.ColorChaged += (sender2, e2) => |
| | | { |
| | | rgbString = (e2[0] + "," + e2[1] + "," + e2[2]).ToString(); |
| | | //trait.value = rgbString; |
| | | btnCurColor.BackgroundColor = (uint)(0xFF000000 + tempLight.GetRGBcolor(rgbString)); |
| | |
| | | #region |
| | | var btnCancel = new Button() |
| | | { |
| | | X = Application.GetRealWidth(20), |
| | | X = Application.GetRealWidth(20), |
| | | Width = Application.GetRealWidth(100), |
| | | Height = Application.GetRealHeight(44), |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | |
| | | TextID = StringId.Cancel, |
| | | }; |
| | | titleView.AddChidren(btnCancel); |
| | | btnCancel.MouseUpEventHandler = (sender, e) => { |
| | | btnCancel.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | dialog.Close(); |
| | | }; |
| | | |
| | |
| | | //例:右下圆角 大小为50 |
| | | int mRectCornerID = HDLUtils.RectCornerBottomRight; |
| | | btnComplete.SetCornerWithSameRadius((uint)Application.GetRealWidth(14), mRectCornerID); |
| | | btnComplete.MouseUpEventHandler = (sender, e) => { |
| | | btnComplete.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | dialog.Close(); |
| | | trait.value = rgbString; |
| | | btn.BackgroundColor = (uint)(0xFF000000 + tempLight.GetRGBcolor(rgbString)); |
| | |
| | | /// <summary> |
| | | /// 加载功能属性数据选择弹窗 |
| | | /// </summary> |
| | | void LoadEditDialog_FunctionPar(SceneFunctionStatus trait, Button btn,List<string> statusList) |
| | | void LoadEditDialog_FunctionPar(SceneFunctionStatus trait, Button btn, List<string> statusList) |
| | | { |
| | | Button lastButton = new Button(); |
| | | var lastData = trait.value; |
| | | var lastText = btn.Text; |
| | | Dialog dialog = new Dialog(); |
| | | |
| | | if(DB_ResidenceData.Instance.GatewayType == 0) |
| | | if (DB_ResidenceData.Instance.GatewayType == 0) |
| | | { |
| | | if (SPK.AcSpkList().Contains(sceneFunction.localFunction.spk)) |
| | | { |
| | |
| | | }; |
| | | row.AddChidren(btnPropertyTitle); |
| | | |
| | | btnPropertyTitle.MouseUpEventHandler = (sender, e) => { |
| | | btnPropertyTitle.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | btnChoose.IsSelected = true; |
| | | if (lastButton != null) |
| | | { |
| | |
| | | |
| | | dialog.Show(); |
| | | |
| | | pView.MouseUpEventHandler = (sender, e) => { |
| | | pView.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | dialog.Close(); |
| | | }; |
| | | |
| | | btnCancel.MouseUpEventHandler = (sender, e) => { |
| | | btnCancel.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | dialog.Close(); |
| | | }; |
| | | btnConfrim.MouseUpEventHandler = (sender, e) => { |
| | | btnConfrim.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | dialog.Close(); |
| | | trait.value = lastData; |
| | | //sceneFunction.status.Find((obj) => obj.key == FunctionAttributeKey.OnOff).value = trait.curValue.ToString() ; |
| | |
| | | |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | /// <summary> |
| | | /// 百分比 |
| | | /// </summary> |
| | | /// <param name="oldStateValue">旧状态值</param> |
| | | /// <param name="titleName">标题</param> |
| | | /// <param name="action">回调</param> |
| | | void BrightnessView(string oldStateValue, string titleName, Action<string, string> action) |
| | | { |
| | | #region 界面 |
| | | var brightness = new UI2.Intelligence.Automation.LogicView.BrightnessView(); |
| | | brightness.FLayoutView(this, titleName, oldStateValue, action); |
| | | #endregion |
| | | |
| | | } |
| | | /// <summary> |
| | | /// 列表界面 |
| | | /// </summary> |
| | | /// <param name="list">界面显示数据源</param> |
| | | /// <param name="oldStateValue">旧状态值</param> |
| | | /// <param name="titleName">标题</param> |
| | | /// <param name="action">回调</param> |
| | | void ListView(List<string> list, string oldStateValue, string titleName, Action<string> action) |
| | | { |
| | | var pif = new UI2.Intelligence.Automation.PublicInterface(); |
| | | pif.SingleSelectionShow(this, list, titleName, oldStateValue, action); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 音乐列表界面 |
| | | /// </summary> |
| | | /// <param name="oldStateValue">旧状态值</param> |
| | | /// <param name="action">回调</param> |
| | | void MusicListView(string oldStateValue, Action<string, Music.SongInfo> action) |
| | | { |
| | | Loading loading = new Loading(); |
| | | this.AddChidren(loading); |
| | | loading.Start(); |
| | | System.Threading.Tasks.Task.Run(() => |
| | | { |
| | | try |
| | | { |
| | | var palyList = Music.SendMethod.Current.GetSingleSongList(new Function { sid = sceneFunction.sid }, "hdl_special", ""); |
| | | List<string> songNameList = new List<string>(); |
| | | for (int i = 0; i < palyList.songs.Count; i++) |
| | | { |
| | | var song = palyList.songs[i]; |
| | | songNameList.Add(song.name); |
| | | } |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | loading.Hide(); |
| | | var publicInterface = new UI2.Intelligence.Automation.PublicInterface(); |
| | | publicInterface.FrameOrVv(this, songNameList, new List<string> { oldStateValue }, palyList.group, (index) => |
| | | { |
| | | if (index > palyList.songs.Count) |
| | | { |
| | | index = 0; |
| | | } |
| | | var song = palyList.songs[index]; |
| | | action?.Invoke(palyList.group, song); |
| | | |
| | | //界面显示选中值 |
| | | //funTypeView.btnState.Text = songSelecetd.name; |
| | | ////数据封装 |
| | | //AddDictionary("playlist_name", palyList.group);//列表名 |
| | | //AddDictionary("song_name", songSelecetd.name);//歌曲名 |
| | | //if (!string.IsNullOrEmpty(songSelecetd.url)) |
| | | //{ |
| | | // //存在url就一起发送过去 |
| | | // AddDictionary("url", songSelecetd.url); |
| | | //} |
| | | |
| | | }, false); |
| | | |
| | | }); |
| | | } |
| | | catch { } |
| | | |
| | | }); |
| | | } |
| | | #endregion |
| | | } |
| | | } |
| | | |