| | |
| | | Action refreshAction; |
| | | SceneFunction sceneFunction; |
| | | |
| | | bool isColorful = false; |
| | | |
| | | public SceneFunctionInfoEditPage(Scene s, SceneFunction fc,Action action) |
| | | { |
| | | bodyView = this; |
| | |
| | | } |
| | | catch { } |
| | | } |
| | | //sceneFunction = fc; |
| | | refreshAction = action; |
| | | } |
| | | |
| | |
| | | }; |
| | | bodyView.AddChidren(contentView); |
| | | |
| | | LoadFunctionRow(sceneFunction.status.Find((obj) => obj.key == FunctionAttributeKey.OnOff)); |
| | | var onOffStatus = sceneFunction.status.Find((obj) => obj.key == FunctionAttributeKey.OnOff); |
| | | |
| | | foreach (var attr in sceneFunction.status) |
| | | LoadFunctionRow(onOffStatus); |
| | | |
| | | if (sceneFunction.localFunction.spk == SPK.LightRGB) |
| | | { |
| | | switch (attr.key) |
| | | var colorfulStatus = sceneFunction.status.Find((obj) => obj.key == FunctionAttributeKey.Colorful); |
| | | if (colorfulStatus != null) |
| | | { |
| | | case FunctionAttributeKey.SetTemp: |
| | | LoadFunctionRow(sceneFunction.status.Find((obj) => obj.key == FunctionAttributeKey.SetTemp)); |
| | | break; |
| | | case FunctionAttributeKey.Mode: |
| | | |
| | | LoadFunctionRow(sceneFunction.status.Find((obj) => obj.key == FunctionAttributeKey.Mode)); |
| | | break; |
| | | case FunctionAttributeKey.FanSpeed: |
| | | LoadFunctionRow(sceneFunction.status.Find((obj) => obj.key == FunctionAttributeKey.FanSpeed)); |
| | | break; |
| | | case FunctionAttributeKey.Percent: |
| | | LoadFunctionRow(sceneFunction.status.Find((obj) => obj.key == FunctionAttributeKey.Percent)); |
| | | break; |
| | | case FunctionAttributeKey.Brightness: |
| | | LoadFunctionRow(sceneFunction.status.Find((obj) => obj.key == FunctionAttributeKey.Brightness)); |
| | | break; |
| | | case FunctionAttributeKey.FadeTime: |
| | | LoadFunctionRow(sceneFunction.status.Find((obj) => obj.key == FunctionAttributeKey.FadeTime)); |
| | | break; |
| | | case FunctionAttributeKey.CCT: |
| | | LoadFunctionRow(sceneFunction.status.Find((obj) => obj.key == FunctionAttributeKey.CCT)); |
| | | break; |
| | | case FunctionAttributeKey.RGB: |
| | | LoadFunctionRow(sceneFunction.status.Find((obj) => obj.key == FunctionAttributeKey.RGB)); |
| | | break; |
| | | case "angle"://角度 |
| | | LoadFunctionRow(sceneFunction.status.Find((obj) => obj.key == "angle")); |
| | | break; |
| | | case "security"://大华摄像布防撤防 |
| | | LoadFunctionRow(sceneFunction.status.Find((obj) => obj.key == "security")); |
| | | break; |
| | | isColorful = true; |
| | | LoadColorfulRow(colorfulStatus); |
| | | } |
| | | } |
| | | |
| | | //加载开关Row |
| | | //LoadFunctionRow(sceneFunction.localFunction.trait_on_off); |
| | | //switch (sceneFunction.localFunction.functionType) |
| | | //{ |
| | | // case SPK.AcStandard: |
| | | // LoadFunctionRow(sceneFunction.localFunction.attributes.Find((obj) => obj.key == "set_temp")); |
| | | // LoadFunctionRow(sceneFunction.localFunction.attributes.Find((obj) => obj.key == "mode")); |
| | | // LoadFunctionRow(sceneFunction.localFunction.attributes.Find((obj) => obj.key == "fan")); |
| | | // break; |
| | | // case SPK.FloorHeatStandard: |
| | | // LoadFunctionRow(sceneFunction.localFunction.attributes.Find((obj) => obj.key == "set_temp")); |
| | | // LoadFunctionRow(sceneFunction.localFunction.attributes.Find((obj) => obj.key == "mode")); |
| | | // break; |
| | | // case SPK.CurtainSwitch: |
| | | // //无操作 |
| | | // break; |
| | | // case SPK.CurtainTrietex: |
| | | // case SPK.CurtainRoller: |
| | | // LoadFunctionRow(sceneFunction.localFunction.attributes.Find((obj) => obj.key == "percent")); |
| | | // break; |
| | | // case SPK.LightSwitch: |
| | | // //无操作 |
| | | // break; |
| | | // case SPK.LightDimming: |
| | | // case SPK.LightRGB: |
| | | // LoadFunctionRow(sceneFunction.localFunction.attributes.Find((obj) => obj.key == "brightness")); |
| | | // break; |
| | | //} |
| | | |
| | | if (DB_ResidenceData.Instance.GatewayType != 0) |
| | | if(!isColorful) |
| | | { |
| | | //加载延时Row |
| | | LoadDelayRow(); |
| | | } |
| | | foreach (var attr in sceneFunction.status) |
| | | { |
| | | switch (attr.key) |
| | | { |
| | | case FunctionAttributeKey.SetTemp: |
| | | LoadFunctionRow(sceneFunction.status.Find((obj) => obj.key == FunctionAttributeKey.SetTemp)); |
| | | break; |
| | | case FunctionAttributeKey.Mode: |
| | | LoadFunctionRow(sceneFunction.status.Find((obj) => obj.key == FunctionAttributeKey.Mode)); |
| | | break; |
| | | case FunctionAttributeKey.FanSpeed: |
| | | LoadFunctionRow(sceneFunction.status.Find((obj) => obj.key == FunctionAttributeKey.FanSpeed)); |
| | | break; |
| | | case FunctionAttributeKey.Percent: |
| | | LoadFunctionRow(sceneFunction.status.Find((obj) => obj.key == FunctionAttributeKey.Percent)); |
| | | break; |
| | | case FunctionAttributeKey.Brightness: |
| | | LoadFunctionRow(sceneFunction.status.Find((obj) => obj.key == FunctionAttributeKey.Brightness)); |
| | | break; |
| | | case FunctionAttributeKey.FadeTime: |
| | | LoadFunctionRow(sceneFunction.status.Find((obj) => obj.key == FunctionAttributeKey.FadeTime)); |
| | | break; |
| | | case FunctionAttributeKey.CCT: |
| | | LoadFunctionRow(sceneFunction.status.Find((obj) => obj.key == FunctionAttributeKey.CCT)); |
| | | break; |
| | | case FunctionAttributeKey.RGB: |
| | | LoadFunctionRow(sceneFunction.status.Find((obj) => obj.key == FunctionAttributeKey.RGB)); |
| | | break; |
| | | case "angle"://角度 |
| | | LoadFunctionRow(sceneFunction.status.Find((obj) => obj.key == "angle")); |
| | | break; |
| | | case "security"://大华摄像布防撤防 |
| | | LoadFunctionRow(sceneFunction.status.Find((obj) => obj.key == "security")); |
| | | break; |
| | | } |
| | | } |
| | | |
| | | if (DB_ResidenceData.Instance.GatewayType != 0) |
| | | { |
| | | //加载延时Row |
| | | LoadDelayRow(); |
| | | } |
| | | } |
| | | var bottomView = new FrameLayout() |
| | | { |
| | | Y = Application.GetRealHeight(591), |
| | |
| | | #endregion |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 加载功能Row |
| | | /// </summary> |
| | | void LoadColorfulRow(SceneFunctionStatus sceneStatus) |
| | | { |
| | | if (sceneStatus == null) |
| | | return; |
| | | #region Row code |
| | | var row = new FrameLayout() |
| | | { |
| | | Height = Application.GetRealHeight(50), |
| | | BackgroundColor = CSS_Color.MainBackgroundColor, |
| | | }; |
| | | contentView.AddChidren(row); |
| | | |
| | | row.AddChidren(new Button() { X = Application.GetRealWidth(16), Height = Application.GetRealHeight(1), Width = Application.GetRealWidth(343), BackgroundColor = CSS_Color.DividingLineColor }); |
| | | |
| | | Button btnRight = new Button() |
| | | { |
| | | X = Application.GetRealWidth(339), |
| | | Gravity = Gravity.CenterVertical, |
| | | Width = Application.GetMinRealAverage(16), |
| | | Height = Application.GetMinRealAverage(16), |
| | | UnSelectedImagePath = "Public/Right.png", |
| | | }; |
| | | row.AddChidren(btnRight); |
| | | |
| | | |
| | | var showCode = ""; |
| | | |
| | | var btnFunctionText = new Button() |
| | | { |
| | | Width = Application.GetRealWidth(330), |
| | | TextAlignment = TextAlignment.CenterRight, |
| | | TextColor = CSS_Color.PromptingColor1, |
| | | TextSize = CSS_FontSize.PromptFontSize_FirstLevel, |
| | | Text = sceneStatus.GetValueText(showCode) |
| | | }; |
| | | row.AddChidren(btnFunctionText); |
| | | |
| | | var btnFunctionName = new Button() |
| | | { |
| | | X = Application.GetRealWidth(16), |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | TextSize = CSS_FontSize.SubheadingFontSize, |
| | | TextID = StringId.ColorfulFunction |
| | | }; |
| | | row.AddChidren(btnFunctionName); |
| | | btnFunctionName.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | LoadEditDialog_OnOff(sceneStatus, btnFunctionText); |
| | | }; |
| | | |
| | | #endregion |
| | | } |
| | | |
| | | |
| | | |
| | | #region 加载功能场景数据调节界面 |
| | | /// <summary> |