| | |
| | | Scene scene; |
| | | |
| | | Action refreshAction; |
| | | Function function; |
| | | public SceneFunctionInfoEditPage(Scene s,Function fc,Action action) |
| | | SceneFunction sceneFunction; |
| | | //Function localFunction; |
| | | public SceneFunctionInfoEditPage(Scene s, SceneFunction fc,Action action) |
| | | { |
| | | bodyView = this; |
| | | scene = s; |
| | | function = fc; |
| | | //localFunction = fc; |
| | | sceneFunction = fc; |
| | | refreshAction = action; |
| | | } |
| | | |
| | |
| | | { |
| | | bodyView.BackgroundColor = CSS_Color.BackgroundColor; |
| | | |
| | | new TopViewDiv(bodyView, function.name).LoadTopView(); |
| | | new TopViewDiv(bodyView, sceneFunction.localFunction.name).LoadTopView(); |
| | | |
| | | contentView = new VerticalScrolViewLayout() |
| | | { |
| | |
| | | bodyView.AddChidren(contentView); |
| | | |
| | | //加载开关Row |
| | | LoadFunctionRow(function.trait_on_off); |
| | | LoadFunctionRow(sceneFunction.localFunction.trait_on_off); |
| | | |
| | | switch (function.functionType) |
| | | switch (sceneFunction.localFunction.functionType) |
| | | { |
| | | case FunctionType.AC: |
| | | LoadFunctionRow(function.function.Find((obj) => obj.key == "set_temperature")); |
| | | LoadFunctionRow(function.function.Find((obj) => obj.key == "mode")); |
| | | LoadFunctionRow(function.function.Find((obj) => obj.key == "fan")); |
| | | 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 FunctionType.FloorHeating: |
| | | LoadFunctionRow(function.function.Find((obj) => obj.key == "set_temperature")); |
| | | LoadFunctionRow(function.function.Find((obj) => obj.key == "mode")); |
| | | LoadFunctionRow(sceneFunction.localFunction.attributes.Find((obj) => obj.key == "set_temp")); |
| | | LoadFunctionRow(sceneFunction.localFunction.attributes.Find((obj) => obj.key == "mode")); |
| | | break; |
| | | case FunctionType.Curtain: |
| | | //无操作 |
| | | break; |
| | | case FunctionType.MotorCurtain: |
| | | case FunctionType.RollingShutter: |
| | | LoadFunctionRow(function.function.Find((obj) => obj.key == "percent")); |
| | | LoadFunctionRow(sceneFunction.localFunction.attributes.Find((obj) => obj.key == "percent")); |
| | | break; |
| | | case FunctionType.Relay: |
| | | //无操作 |
| | | break; |
| | | case FunctionType.Dimmer: |
| | | case FunctionType.RGB: |
| | | LoadFunctionRow(function.function.Find((obj) => obj.key == "brightness")); |
| | | LoadFunctionRow(sceneFunction.localFunction.attributes.Find((obj) => obj.key == "brightness")); |
| | | break; |
| | | } |
| | | |
| | |
| | | |
| | | btnConfrim.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | var temp = scene.sceneFunctionList.Find((obj) => obj.sid == function.sid); |
| | | if (temp!=null) |
| | | //var temp = localFunction.ConvertSceneFunction(); |
| | | var temp = scene.functions.Find((obj) => obj.sid == sceneFunction.sid); |
| | | if (temp != null) |
| | | { |
| | | temp = function; |
| | | temp = sceneFunction; |
| | | } |
| | | else |
| | | { |
| | | scene.sceneFunctionList.Add(function); |
| | | scene.functions.Add(sceneFunction); |
| | | } |
| | | scene.SaveSceneData(true); |
| | | refreshAction(); |
| | | this.RemoveFromParent(); |
| | | }; |
| | |
| | | case "fan": |
| | | LoadEditDialog_FunctionPar(trait, btnFunctionText); |
| | | break; |
| | | case "set_temperature": |
| | | case "set_temp": |
| | | LoadEditDialog_Temp(trait, btnFunctionText); |
| | | break; |
| | | case "delay": |
| | |
| | | |
| | | |
| | | btnSceneDelayTitle.MouseUpEventHandler = (sender, e) => { |
| | | new PublicAssmebly().SetSceneDelayDialog(function, btnDelayInfo); |
| | | new PublicAssmebly().SetSceneDelayDialog(scene, btnDelayInfo); |
| | | }; |
| | | |
| | | |
| | |
| | | SelectedTextColor = CSS_Color.MainColor, |
| | | TextSize = CSS_FontSize.SubheadingFontSize, |
| | | TextID = StringId.On, |
| | | IsSelected = function.trait_on_off.curValue.ToString() == "on" |
| | | IsSelected = trait.curValue.ToString() == "on" |
| | | }; |
| | | optionView.AddChidren(btnOn); |
| | | |
| | |
| | | SelectedTextColor = CSS_Color.MainColor, |
| | | TextSize = CSS_FontSize.SubheadingFontSize, |
| | | TextID = StringId.OFF, |
| | | IsSelected = function.trait_on_off.curValue.ToString() == "off" |
| | | IsSelected = trait.curValue.ToString() == "off" |
| | | }; |
| | | optionView.AddChidren(btnOff); |
| | | |
| | |
| | | btnOn.MouseUpEventHandler = (sender, e) => { |
| | | dialog.Close(); |
| | | trait.curValue = "on"; |
| | | sceneFunction.status.Find((obj) => obj.key == FunctionAttributeKey.OnOff).value = "on"; |
| | | btn.Text = trait.GetCurValueText() + trait.uintString; |
| | | }; |
| | | btnOff.MouseUpEventHandler = (sender,e) =>{ |
| | | dialog.Close(); |
| | | trait.curValue = "off"; |
| | | sceneFunction.status.Find((obj) => obj.key == FunctionAttributeKey.OnOff).value = "off"; |
| | | btn.Text= trait.GetCurValueText() + trait.uintString; |
| | | }; |
| | | |
| | |
| | | btnConfrim.MouseUpEventHandler = (sender, e) => { |
| | | dialog.Close(); |
| | | btn.Text = selectItem; |
| | | sceneFunction.status.Find((obj) => obj.key == FunctionAttributeKey.OnOff).value = trait.curValue.ToString() ; |
| | | trait.curValue = selectItem.Replace(trait.uintString,""); |
| | | }; |
| | | |
| | |
| | | btnConfrim.MouseUpEventHandler = (sender, e) => { |
| | | dialog.Close(); |
| | | trait.curValue = controlBar.Progress; |
| | | sceneFunction.status.Find((obj) => obj.key == FunctionAttributeKey.OnOff).value = trait.curValue.ToString() ; |
| | | btn.Text = trait.curValue + trait.uintString; |
| | | }; |
| | | } |
| | |
| | | btnConfrim.MouseUpEventHandler = (sender, e) => { |
| | | dialog.Close(); |
| | | trait.curValue = lastData; |
| | | sceneFunction.status.Find((obj) => obj.key == FunctionAttributeKey.OnOff).value = trait.curValue.ToString() ; |
| | | btn.Text = lastText; |
| | | }; |
| | | |