| | |
| | | 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) |
| | | { |
| | | |
| | | bodyView = this; |
| | | scene = s; |
| | | sceneFunction = fc.localFunction.ConvertSceneFunction(); |
| | |
| | | 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; |
| | | } |
| | | } |
| | | |
| | |
| | | |
| | | 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) |
| | | { |
| | |
| | | } |
| | | } |
| | | } |
| | | }catch(Exception ex) |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | MainPage.Log($"UpdataFuntionRow error:{ex.Message}"); |
| | | } |
| | |
| | | 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; |
| | | } |
| | | }; |
| | | |
| | | #endregion |
| | | }catch(Exception ex) |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | MainPage.Log($"场景加载设备属性异常:{ex.Message}"); |
| | | } |
| | |
| | | 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"; |
| | |
| | | |
| | | 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() ; |
| | |
| | | //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() ; |
| | |
| | | |
| | | 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() ; |
| | |
| | | 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)); |
| | |
| | | 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)); |
| | |
| | | }; |
| | | 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() ; |
| | |
| | | |
| | | } |
| | | |
| | | |
| | | /// <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); |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | } |