| | |
| | | |
| | | Action refreshAction; |
| | | SceneFunction sceneFunction; |
| | | //Function localFunction; |
| | | public SceneFunctionInfoEditPage(Scene s, SceneFunction fc,Action action) |
| | | { |
| | | bodyView = this; |
| | | scene = s; |
| | | //localFunction = fc; |
| | | sceneFunction = fc; |
| | | refreshAction = action; |
| | | } |
| | |
| | | switch (sceneFunction.localFunction.functionType) |
| | | { |
| | | case FunctionType.AC: |
| | | LoadFunctionRow(sceneFunction.localFunction.attributes.Find((obj) => obj.key == "set_temperature")); |
| | | 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(sceneFunction.localFunction.attributes.Find((obj) => obj.key == "set_temperature")); |
| | | LoadFunctionRow(sceneFunction.localFunction.attributes.Find((obj) => obj.key == "set_temp")); |
| | | LoadFunctionRow(sceneFunction.localFunction.attributes.Find((obj) => obj.key == "mode")); |
| | | break; |
| | | case FunctionType.Curtain: |
| | |
| | | |
| | | btnConfrim.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | //var temp = localFunction.ConvertSceneFunction(); |
| | | var temp = scene.functions.Find((obj) => obj.sid == sceneFunction.sid); |
| | | if (temp != null) |
| | | { |
| | |
| | | { |
| | | 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": |
| | |
| | | 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; |
| | | }; |
| | | |