| | |
| | | using System; |
| | | using HDL_ON.Entity; |
| | | using HDL_ON.UI.CSS; |
| | | using HDL_ON.UI.Music; |
| | | using Shared; |
| | | |
| | | namespace HDL_ON.UI |
| | |
| | | public partial class FunctionControlZone : FrameLayout |
| | | { |
| | | #region 区域控件 |
| | | static FrameLayout bodyDiv; |
| | | FunctionControlZone bodyDiv; |
| | | /// <summary> |
| | | /// 功能/场景icon |
| | | /// </summary> |
| | |
| | | /// 收藏按钮 |
| | | /// </summary> |
| | | Button btnCollectionIcon; |
| | | /// <summary> |
| | | /// 离线文本 |
| | | /// </summary> |
| | | Button btnOffline; |
| | | |
| | | #endregion |
| | | |
| | | #region 区域变量 |
| | |
| | | } |
| | | LoadDiv(); |
| | | |
| | | btnIcon.UnSelectedImagePath = $"FunctionIcon/Icon/{function.IconName}.png"; |
| | | |
| | | btnIcon.UnSelectedImagePath = $"FunctionIcon/Icon/{function.IconName}.png"; |
| | | |
| | | if (SPK.CurtainSpkList().Contains(function.spk)) |
| | | {//窗帘没有开关按钮 |
| | | CurtainFragment(); |
| | |
| | | this.AddChidren(btnTipPowerLow); |
| | | } |
| | | } |
| | | } |
| | | else if (function.spk == SPK.DoorLock) |
| | | { |
| | | btnIcon.UnSelectedImagePath = "FunctionIcon/DoorLock/DoorLock.png"; |
| | | } |
| | | else if (function.spk == SPK.HvacCac) |
| | | { |
| | | var btnHumidityIcon = new Button() |
| | | { |
| | | X = Application.GetRealWidth(51), |
| | | Y = Application.GetRealHeight(66), |
| | | Width = Application.GetMinRealAverage(16), |
| | | Height = Application.GetMinRealAverage(16), |
| | | UnSelectedImagePath = "FunctionIcon/CAC/HvacCacHumidityIcon.png", |
| | | }; |
| | | bodyDiv.AddChidren(btnHumidityIcon); |
| | | var btnHumidityValues = new TextButton() |
| | | { |
| | | X = Application.GetRealWidth(70), |
| | | Y = Application.GetRealHeight(64), |
| | | Height = Application.GetRealHeight(18), |
| | | TextColor = 0xFF161616, |
| | | TextSize = CSS_FontSize.TextFontSize, |
| | | Text = function.GetAttrState(FunctionAttributeKey.RoomHumidity) + "%", |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | }; |
| | | btnHumidityValues.Width = btnHumidityValues.GetTextWidth(); |
| | | bodyDiv.AddChidren(btnHumidityValues); |
| | | |
| | | Button btnTempIcon = new Button() |
| | | { |
| | | X = Application.GetRealWidth(110), |
| | | Y = Application.GetRealHeight(66), |
| | | Width = Application.GetMinRealAverage(17), |
| | | Height = Application.GetMinRealAverage(17), |
| | | UnSelectedImagePath = "FunctionIcon/CAC/HvacCacTempIcon.png", |
| | | }; |
| | | bodyDiv.AddChidren(btnTempIcon); |
| | | |
| | | var btnTempValues = new TextButton() |
| | | { |
| | | X = Application.GetRealWidth(130), |
| | | Y = Application.GetRealHeight(64), |
| | | Height = Application.GetRealHeight(18), |
| | | TextColor = 0xFF161616, |
| | | TextSize = CSS_FontSize.TextFontSize, |
| | | Text = function.GetAttrState(FunctionAttributeKey.RoomTemp) + "°C", |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | }; |
| | | btnTempValues.Width = btnTempValues.GetTextWidth(); |
| | | bodyDiv.AddChidren(btnTempValues); |
| | | |
| | | var btnJinMaoIcon = new Button() |
| | | { |
| | | X = Application.GetRealWidth(238), |
| | | Y = Application.GetRealHeight(64), |
| | | Width = Application.GetRealWidth(102), |
| | | Height = Application.GetRealHeight(29), |
| | | UnSelectedImagePath = "FunctionIcon/CAC/JinMaoIcon.png" |
| | | }; |
| | | bodyDiv.AddChidren(btnJinMaoIcon); |
| | | |
| | | |
| | | |
| | | } |
| | | else |
| | | { |
| | |
| | | |
| | | LoadEvent_DivSkipEvent(); |
| | | LoadEvent_FunctionCollection(); |
| | | |
| | | |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | UnSelectedImagePath = "Collection/CollectionGrayIcon.png", |
| | | IsSelected = function.collect |
| | | }; |
| | | if ( !SPK.ArmSensorSpkList().Contains(function.spk) && !SPK.EnvironDeviceSpkList().Contains( function.spk))//!DB_ResidenceData.Instance.CurrentRegion.isOtherShare && |
| | | if ( !SPK.ArmSensorSpkList().Contains(function.spk) |
| | | && function.spk != SPK.DoorLock |
| | | && !SPK.EnvironDeviceSpkList().Contains( function.spk))//!DB_ResidenceData.Instance.CurrentRegion.isOtherShare && |
| | | { |
| | | bodyDiv.AddChidren(btnCollectionIcon); |
| | | } |
| | | |
| | | if (!function.online) |
| | | { |
| | | bodyDiv.BackgroundColor = CSS_Color.PromptingColor2; |
| | | btnOffline = new Button() |
| | | { |
| | | X = Application.GetRealWidth(8 + 10 + 32), |
| | | Y = Application.GetRealHeight(28 + 24), |
| | | Height = Application.GetRealHeight(30), |
| | | TextID = StringId.DeviceOffline, |
| | | TextColor = CSS_Color.WarningColor, |
| | | TextSize = CSS_FontSize.PromptFontSize_FirstLevel, |
| | | TextAlignment = TextAlignment.CenterLeft |
| | | }; |
| | | bodyDiv.AddChidren(btnOffline); |
| | | } |
| | | } |
| | | |
| | |
| | | btnCurtainOpen.UnSelectedImagePath = "FunctionIcon/Curtain/CurtainUpIcon.png"; |
| | | btnCurtainOpen.SelectedImagePath = "FunctionIcon/Curtain/CurtainUpIconOn.png"; |
| | | } |
| | | LoadEvent_ControlCurtain(btnCurtainStop, btnCurtainOpen, btnCurtainClose, function); |
| | | LoadEvent_ControlCurtain(btnCurtainStop, btnCurtainOpen, btnCurtainClose); |
| | | #endregion |
| | | } |
| | | /// <summary> |
| | |
| | | SelectedImagePath = "MusicIcon/nextSelected.png", |
| | | }; |
| | | bodyDiv.AddChidren(btnNext); |
| | | LoadEvent_ControlMusic(btnPlay, btnNext, btnPrev, function as A31MusicModel); |
| | | LoadEvent_ControlMusic(btnPlay, btnNext, btnPrev, function); |
| | | #endregion |
| | | } |
| | | |
| | |
| | | }; |
| | | bodyDiv.AddChidren(btnLastStates); |
| | | } |
| | | |
| | | |
| | | |
| | | } |
| | | } |