File was renamed from HDL_ON/UI/UI2/2-Classification/Room/FunctionDiv.cs |
| | |
| | | |
| | | namespace HDL_ON.UI |
| | | { |
| | | public partial class RoomControlZone : FrameLayout |
| | | public partial class FunctionControlZone : FrameLayout |
| | | { |
| | | #region 区域控件 |
| | | FrameLayout bodyDiv; |
| | |
| | | #region 区域变量 |
| | | Function function; |
| | | #endregion |
| | | public RoomControlZone(Function func) |
| | | public FunctionControlZone(Function func) |
| | | { |
| | | bodyDiv = this; |
| | | function = func; |
| | | } |
| | | |
| | | public override void RemoveFromParent() |
| | | { |
| | | base.RemoveFromParent(); |
| | | bodyDiv = null; |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | LoadDiv(); |
| | | |
| | | |
| | | #region 加载开关按钮 |
| | | if (function.functionCategory != FunctionType.Curtain)//窗帘没有开关按钮 |
| | | { |
| | | #region 加载开关按钮 |
| | | /// <summary> |
| | | /// 开关按钮 |
| | | /// </summary> |
| | |
| | | Height = Application.GetMinRealAverage(32), |
| | | UnSelectedImagePath = "Public/PowerClose.png", |
| | | SelectedImagePath = "Public/PowerOpen.png", |
| | | Tag = function.functionType + "_Switch_" + function.sid |
| | | }; |
| | | bodyDiv.AddChidren(btnSwitch); |
| | | } |
| | |
| | | Height = Application.GetMinRealAverage(32), |
| | | UnSelectedImagePath = "Public/PowerClose.png", |
| | | SelectedImagePath = "Public/PowerOpen.png", |
| | | Tag = function.functionType + "_Switch_" + function.sid |
| | | }; |
| | | bodyDiv.AddChidren(btnSwitch); |
| | | } |
| | | //加载开关按钮事件 |
| | | LoadEvent_LightSwitch(btnSwitch); |
| | | } |
| | | #endregion |
| | | |
| | | switch (function.functionCategory) |
| | | { |
| | | case FunctionType.AC: |
| | | btnIcon.UnSelectedImagePath = "FunctionIcon/AC/AcThinIcon.png"; |
| | | AcDiv(bodyDiv); |
| | | break; |
| | | case FunctionType.Curtain: |
| | | btnIcon.UnSelectedImagePath = "FunctionIcon/Curtain/CurtainThinIcon.png"; |
| | | CurtainFragment(bodyDiv); |
| | | break; |
| | | case FunctionType.Light: |
| | | btnIcon.UnSelectedImagePath = "FunctionIcon/Light/LightThinIcon.png"; |
| | | LoadLightcontrol(bodyDiv); |
| | | break; |
| | | case FunctionType.FloorHeating: |
| | | btnIcon.UnSelectedImagePath = "FunctionIcon/FloorHeating/FloorHeatingThinIcon.png"; |
| | | FloorHeatingDiv(bodyDiv); |
| | | break; |
| | | case FunctionType.Scene: |
| | | btnIcon.UnSelectedImagePath = "FunctionIcon/Scene/SceneIcon.png"; |
| | | if ((function as Scene).sceneType == SceneType.MovieScene) |
| | | { |
| | | var movieIcon = new Button() |
| | | switch (function.functionCategory) |
| | | { |
| | | case FunctionType.AC: |
| | | btnIcon.UnSelectedImagePath = "FunctionIcon/AC/AcThinIcon.png"; |
| | | AcDiv(); |
| | | break; |
| | | case FunctionType.Light: |
| | | btnIcon.UnSelectedImagePath = "FunctionIcon/Light/LightThinIcon.png"; |
| | | btnSwitch.IsSelected = (function as Light).on_off == 1; |
| | | LoadLightControl(); |
| | | break; |
| | | case FunctionType.FloorHeating: |
| | | btnIcon.UnSelectedImagePath = "FunctionIcon/FloorHeating/FloorHeatingThinIcon.png"; |
| | | FloorHeatingDiv(); |
| | | break; |
| | | case FunctionType.Scene: |
| | | btnIcon.UnSelectedImagePath = "FunctionIcon/Scene/SceneIcon.png"; |
| | | if ((function as Scene).sceneType == SceneType.MovieScene) |
| | | { |
| | | X = Application.GetRealWidth(52), |
| | | Y = Application.GetRealHeight(14), |
| | | Width = Application.GetRealWidth(16), |
| | | Height = Application.GetRealWidth(16), |
| | | UnSelectedImagePath = "FunctionIcon/Scene/MovieMark.png", |
| | | }; |
| | | bodyDiv.AddChidren(movieIcon); |
| | | var movieIcon = new Button() |
| | | { |
| | | X = Application.GetRealWidth(52), |
| | | Y = Application.GetRealHeight(14), |
| | | Width = Application.GetRealWidth(16), |
| | | Height = Application.GetRealWidth(16), |
| | | UnSelectedImagePath = "FunctionIcon/Scene/MovieMark.png", |
| | | }; |
| | | bodyDiv.AddChidren(movieIcon); |
| | | |
| | | btnName.X = movieIcon.Right; |
| | | } |
| | | break; |
| | | btnName.X = movieIcon.Right; |
| | | } |
| | | break; |
| | | } |
| | | |
| | | #endregion |
| | | } |
| | | else |
| | | { |
| | | btnIcon.UnSelectedImagePath = "FunctionIcon/Curtain/CurtainThinIcon.png"; |
| | | CurtainFragment(); |
| | | |
| | | } |
| | | |
| | | LoadEvent_DivSkipEvent(); |
| | |
| | | /// <summary> |
| | | /// 加载灯光功能控制卡片 |
| | | /// </summary> |
| | | void LoadLightcontrol(FrameLayout view) |
| | | void LoadLightControl() |
| | | { |
| | | switch (function.functionType) |
| | | { |
| | |
| | | TextColor = CSS_Color.PromptingColor1, |
| | | TextSize = CSS_FontSize.PromptFontSize_FirstLevel, |
| | | }; |
| | | view.AddChidren(btnDimmerMinValues); |
| | | bodyDiv.AddChidren(btnDimmerMinValues); |
| | | |
| | | var dimmerControlBar = new DiyImageSeekBar() |
| | | { |
| | |
| | | ProgressTextColor = CSS_Color.FirstLevelTitleColor, |
| | | ProgressTextSize = CSS_FontSize.PromptFontSize_FirstLevel, |
| | | MaxValue = 100, |
| | | Progress = 30, |
| | | Progress = (function as Light).brightness, |
| | | Tag = function.functionType + "_DimmerBar_" + function.sid |
| | | }; |
| | | view.AddChidren(dimmerControlBar); |
| | | bodyDiv.AddChidren(dimmerControlBar); |
| | | |
| | | var btnDimmerMaxValues = new Button() |
| | | { |
| | |
| | | TextColor = CSS_Color.PromptingColor1, |
| | | TextSize = CSS_FontSize.PromptFontSize_FirstLevel, |
| | | }; |
| | | view.AddChidren(btnDimmerMaxValues); |
| | | bodyDiv.AddChidren(btnDimmerMaxValues); |
| | | //加载调光事件 |
| | | LoadEvent_LightDimming(dimmerControlBar); |
| | | #endregion |
| | |
| | | /// <summary> |
| | | /// 加载窗帘功能控制卡片 |
| | | /// </summary> |
| | | void CurtainFragment(FrameLayout view) |
| | | void CurtainFragment() |
| | | { |
| | | #region Curtain |
| | | var btnCurtainClose = new Button() |
| | |
| | | UnSelectedImagePath = "FunctionIcon/Curtain/CurtainCloseIcon.png", |
| | | SelectedImagePath = "FunctionIcon/Curtain/CurtainCloseOnIcon.png", |
| | | }; |
| | | view.AddChidren(btnCurtainClose); |
| | | bodyDiv.AddChidren(btnCurtainClose); |
| | | |
| | | var btnCurtainStop = new Button() |
| | | { |
| | |
| | | UnSelectedImagePath = "FunctionIcon/Curtain/CurtainStopIcon.png", |
| | | SelectedImagePath = "FunctionIcon/Curtain/CurtainStopOnIcon.png", |
| | | }; |
| | | view.AddChidren(btnCurtainStop); |
| | | bodyDiv.AddChidren(btnCurtainStop); |
| | | |
| | | var btnCurtainOpen = new Button() |
| | | { |
| | |
| | | UnSelectedImagePath = "FunctionIcon/Curtain/CurtainOpenIcon.png", |
| | | SelectedImagePath = "FunctionIcon/Curtain/CurtainOpenOnIcon.png", |
| | | }; |
| | | view.AddChidren(btnCurtainOpen); |
| | | bodyDiv.AddChidren(btnCurtainOpen); |
| | | |
| | | |
| | | |
| | | |
| | | #endregion |
| | | } |
| | |
| | | /// <summary> |
| | | /// 加载空调功能控制卡片 |
| | | /// </summary> |
| | | void AcDiv(FrameLayout view) |
| | | void AcDiv() |
| | | { |
| | | #region AC |
| | | #endregion |
| | |
| | | /// <summary> |
| | | /// 加载地热功能控制卡片 |
| | | /// </summary> |
| | | void FloorHeatingDiv(FrameLayout view) |
| | | void FloorHeatingDiv() |
| | | { |
| | | #region 地热 |
| | | #endregion |