| | |
| | | #endregion |
| | | |
| | | #region 区域变量 |
| | | AC aC; |
| | | AC acTemp = new AC(); |
| | | Function function; |
| | | Button btnCollection_Out; |
| | | Button btnFunctionName_Out; |
| | | Button btnFromFloor_Out; |
| | |
| | | /// </summary> |
| | | Action actionRefresh; |
| | | #endregion |
| | | public ACPage(AC func) |
| | | public ACPage(Function func) |
| | | { |
| | | bodyView = this; |
| | | aC = func; |
| | | function = func; |
| | | } |
| | | |
| | | public void LoadPage(Button btnCollectionIcon, Button btnFunctionNameOut, Button btnFromFloorOut) |
| | |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextSize = CSS_FontSize.EmphasisFontSize_FirstLevel, |
| | | Text = aC.name, |
| | | Text = function.name, |
| | | }; |
| | | controlView.AddChidren(btnFunctionName); |
| | | |
| | |
| | | TextColor = CSS_Color.PromptingColor1, |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextSize = CSS_FontSize.PromptFontSize_FirstLevel, |
| | | Text = aC.GetRoomListName() |
| | | Text = function.GetRoomListName() |
| | | }; |
| | | controlView.AddChidren(btnFromFoorAndRoom); |
| | | |
| | |
| | | Height = Application.GetMinRealAverage(40), |
| | | SelectedImagePath = "Collection/CollectionIcon.png", |
| | | UnSelectedImagePath = "Collection/CollectionGrayIcon.png", |
| | | IsSelected = aC.collect |
| | | IsSelected = function.collect |
| | | }; |
| | | //controlView.AddChidren(btnCollection); |
| | | //2020-12-16 如果是成员隐藏收藏功能 |
| | |
| | | { |
| | | Gravity = Gravity.CenterHorizontal, |
| | | OpenAngle = 160, |
| | | ThumbImagePath = aC.trait_on_off.curValue.ToString() == "on" ? "FunctionIcon/AC/DiyThumbIconOn.png" : "FunctionIcon/AC/DiyThumbIcon.png", |
| | | ThumbImagePath = function.trait_on_off.curValue.ToString() == "on" ? "FunctionIcon/AC/DiyThumbIconOn.png" : "FunctionIcon/AC/DiyThumbIcon.png", |
| | | ThumbImageHeight = Application.GetRealWidth(50), |
| | | ProgressBarColor = CSS_Color.MainColor, |
| | | OfflineProgressBarColor = CSS_Color.PromptingColor2, |
| | | IsOffline = aC.trait_on_off.curValue.ToString() == "off", |
| | | MinValue = aC.GetAttribute(FunctionAttributeKey.SetTemp).min, |
| | | MaxValue = aC.GetAttribute(FunctionAttributeKey.SetTemp).max, |
| | | //IsClickable = aC.trait_on_off.curValue.ToString() == "on", |
| | | IsOffline = function.trait_on_off.curValue.ToString() == "off", |
| | | MinValue = function.GetAttribute(FunctionAttributeKey.SetTemp).min, |
| | | MaxValue = function.GetAttribute(FunctionAttributeKey.SetTemp).max, |
| | | //IsClickable = function.trait_on_off.curValue.ToString() == "on", |
| | | ArcColor = CSS_Color.BackgroundColor, |
| | | Progress = Convert.ToInt32(aC.GetAttrState(FunctionAttributeKey.SetTemp)), |
| | | Progress = Convert.ToInt32(function.GetAttrState(FunctionAttributeKey.SetTemp)), |
| | | #if __IOS__ |
| | | Y = Application.GetRealHeight(120 + 25), |
| | | Width = Application.GetRealWidth(260 - 40), |
| | |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | TextSize = 50, |
| | | IsBold = true, |
| | | Text = aC.GetAttrState(FunctionAttributeKey.SetTemp), |
| | | Text = function.GetAttrState(FunctionAttributeKey.SetTemp), |
| | | TextAlignment = TextAlignment.Center, |
| | | }; |
| | | controlView.AddChidren(btnTemp); |
| | |
| | | Y = Application.GetRealHeight(334), |
| | | Width = Application.GetRealWidth(30), |
| | | Height = Application.GetRealWidth(30), |
| | | UnSelectedImagePath = aC.GetModeIconPath(), |
| | | UnSelectedImagePath = acTemp.GetModeIconPath(function.GetAttrState(FunctionAttributeKey.Mode)), |
| | | }; |
| | | controlView.AddChidren(btnMode); |
| | | |
| | |
| | | Y = Application.GetRealHeight(337), |
| | | Width = Application.GetRealWidth(30), |
| | | Height = Application.GetRealWidth(30), |
| | | UnSelectedImagePath = aC.GetFanIconPath(), |
| | | UnSelectedImagePath = acTemp.GetFanIconPath(function.GetAttrState(FunctionAttributeKey.FanSpeed)), |
| | | }; |
| | | controlView.AddChidren(btnWindSpeed); |
| | | |
| | |
| | | Height = Application.GetRealWidth(32), |
| | | UnSelectedImagePath = "Public/PowerClose.png", |
| | | SelectedImagePath = "Public/PowerOpen.png", |
| | | IsSelected = aC.trait_on_off.curValue.ToString() == "on" |
| | | IsSelected = function.trait_on_off.curValue.ToString() == "on" |
| | | }; |
| | | controlView.AddChidren(btnSwitch); |
| | | |
| | | LoadEventList(); |
| | | new TopViewDiv(bodyView,Language.StringByID(StringId.AC)).LoadTopView_FunctionTop(aC, actionRefresh); |
| | | new TopViewDiv(bodyView,Language.StringByID(StringId.AC)).LoadTopView_FunctionTop(function, actionRefresh); |
| | | new System.Threading.Thread(() => |
| | | { |
| | | DriverLayer.Control.Ins.SendReadCommand(aC); |
| | | DriverLayer.Control.Ins.SendReadCommand(function); |
| | | }) |
| | | { IsBackground = true }.Start(); |
| | | } |
| | |
| | | }; |
| | | modeChangeView.AddChidren(btnLine); |
| | | |
| | | var modeList = aC.GetAttribute(FunctionAttributeKey.Mode).value; |
| | | var modeList = function.GetAttribute(FunctionAttributeKey.Mode).value; |
| | | foreach (var m in modeList) |
| | | { |
| | | Button btnModeIcon = new Button() |
| | |
| | | Y = Application.GetRealHeight(44 * (modeList.IndexOf(m) + 1) + 10 + 8), |
| | | Width = Application.GetRealWidth(24), |
| | | Height = Application.GetRealWidth(24), |
| | | IsSelected = aC.GetAttrState(FunctionAttributeKey.Mode) == m, |
| | | IsSelected = function.GetAttrState(FunctionAttributeKey.Mode) == m, |
| | | }; |
| | | modeChangeView.AddChidren(btnModeIcon); |
| | | |
| | |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | SelectedTextColor = CSS_Color.MainColor, |
| | | IsSelected = aC.GetAttrState(FunctionAttributeKey.Mode) == m, |
| | | IsSelected = function.GetAttrState(FunctionAttributeKey.Mode) == m, |
| | | TextSize = CSS_FontSize.TextFontSize, |
| | | }; |
| | | modeChangeView.AddChidren(btnModeText); |
| | |
| | | }; |
| | | modeChangeView.AddChidren(btnLine); |
| | | |
| | | var modeList = aC.GetAttribute(FunctionAttributeKey.FanSpeed).value; |
| | | var modeList = function.GetAttribute(FunctionAttributeKey.FanSpeed).value; |
| | | foreach (var m in modeList) |
| | | { |
| | | Button btnFanIcon = new Button() |
| | |
| | | Y = Application.GetRealHeight(44 * (modeList.IndexOf(m) + 1) + 10 + 8), |
| | | Width = Application.GetRealWidth(24), |
| | | Height = Application.GetRealWidth(24), |
| | | IsSelected = aC.GetAttrState(FunctionAttributeKey.FanSpeed) == m, |
| | | IsSelected = function.GetAttrState(FunctionAttributeKey.FanSpeed) == m, |
| | | }; |
| | | modeChangeView.AddChidren(btnFanIcon); |
| | | |
| | |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | SelectedTextColor = CSS_Color.MainColor, |
| | | IsSelected = aC.GetAttrState(FunctionAttributeKey.FanSpeed) == m, |
| | | IsSelected = function.GetAttrState(FunctionAttributeKey.FanSpeed) == m, |
| | | TextSize = CSS_FontSize.TextFontSize, |
| | | }; |
| | | modeChangeView.AddChidren(btnFanText); |