| | |
| | | Scene scene; |
| | | |
| | | Action refreshAction; |
| | | Function function; |
| | | public SceneFunctionInfoEditPage(Scene s,Function fc,Action action) |
| | | SceneFunction sceneFunction; |
| | | public SceneFunctionInfoEditPage(Scene s, SceneFunction fc,Action action) |
| | | { |
| | | bodyView = this; |
| | | scene = s; |
| | | function = 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_temperature")); |
| | | 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_temperature")); |
| | | 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 = scene.functions.Find((obj) => obj.sid == sceneFunction.sid); |
| | | if (temp != null) |
| | | { |
| | | temp = function; |
| | | temp = sceneFunction; |
| | | } |
| | | else |
| | | { |
| | | scene.sceneFunctionList.Add(function); |
| | | scene.functions.Add(sceneFunction); |
| | | } |
| | | refreshAction(); |
| | | this.RemoveFromParent(); |
| | |
| | | |
| | | |
| | | 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); |
| | | |