| | |
| | | using HDL_ON.UI.CSS; |
| | | using HDL_ON.Entity; |
| | | using System; |
| | | using HDL_ON.DAL.Server; |
| | | |
| | | namespace HDL_ON.UI |
| | | { |
| | |
| | | /// 文本控件 |
| | | /// </summary> |
| | | private NormalViewControl btnSuctionView = null; |
| | | /// <summary> |
| | | /// 退出实验室模式控制区域 |
| | | /// </summary> |
| | | FrameLayout exitLabView; |
| | | |
| | | |
| | | #endregion |
| | | |
| | |
| | | |
| | | |
| | | |
| | | //加载瞬时值 |
| | | |
| | | var btnInstantaneousValue = new Button() |
| | | { |
| | | Gravity = Gravity.CenterHorizontal, |
| | |
| | | }; |
| | | FrameWhiteCentet1.AddChidren(btnInstantaneousValueText); |
| | | EventHandler<MouseEventArgs> eventHandler = (sender, e) => { |
| | | //var page = new SocketPage_InstantaneousValue(function); |
| | | //MainPage.BasePageView.AddChidren(page); |
| | | //page.LoadPage(); |
| | | //MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; |
| | | var page = new SensorMegahealth_AlarmDataStatisticsPage(device); |
| | | MainPage.BasePageView.AddChidren(page); |
| | | page.LoadPage(); |
| | | MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; |
| | | }; |
| | | btnInstantaneousValue.MouseUpEventHandler = eventHandler; |
| | | btnInstantaneousValueText.MouseUpEventHandler = eventHandler; |
| | | |
| | | |
| | | exitLabView = new FrameLayout() |
| | | { |
| | | Y = Application.GetRealHeight(391), |
| | | Height = Application.GetRealHeight(135), |
| | | BackgroundColor = CSS_Color.MainBackgroundColor, |
| | | Visible = device.extSet.labModel, |
| | | }; |
| | | FrameWhiteCentet1.AddChidren(exitLabView); |
| | | |
| | | var labTipText = new Button() |
| | | { |
| | | Y = Application.GetRealHeight(10), |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Width = Application.GetRealWidth(250), |
| | | Height = Application.GetRealHeight(50), |
| | | TextColor = CSS_Color.TextualColor, |
| | | TextID = StringId.LabTipText, |
| | | IsMoreLines = true, |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextSize = CSS_FontSize.PromptFontSize_FirstLevel, |
| | | }; |
| | | exitLabView.AddChidren(labTipText); |
| | | |
| | | var btnExitLab = new Button() |
| | | { |
| | | Y = Application.GetRealHeight(75), |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Width = Application.GetRealWidth(148), |
| | | Height = Application.GetRealHeight(40), |
| | | TextAlignment = TextAlignment.Center, |
| | | TextColor = CSS_Color.MainBackgroundColor, |
| | | IsBold = true, |
| | | Radius = (uint)Application.GetRealHeight(20), |
| | | TextSize = 16, |
| | | TextID = StringId.ExitLabModel, |
| | | BackgroundColor = CSS_Color.MainColor, |
| | | }; |
| | | exitLabView.AddChidren(btnExitLab); |
| | | btnExitLab.MouseUpEventHandler = (sender, e) => { |
| | | |
| | | new System.Threading.Thread(() => |
| | | { |
| | | device.extSet.labModel = false; |
| | | var result = new HttpServerRequest().DeviceExtSet(device.deviceId, device.extSet); |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | if (result != null && result.Code == StateCode.SUCCESS) |
| | | { |
| | | exitLabView.Visible = false; |
| | | } |
| | | }); |
| | | }) |
| | | { IsBackground = true }.Start(); |
| | | }; |
| | | |
| | | base.SettionFinishEvent += () => { |
| | | exitLabView.Visible = device.extSet.labModel; |
| | | }; |
| | | |
| | | |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | /// <summary> |
| | | /// 初始化第二个索引页的内容 |
| | |
| | | else if (temp.state == "uninhabited")//无人 |
| | | { |
| | | btnIcon.UnSelectedImagePath = "FunctionIcon/ArmSensor/UnderProtectionBgIcon.png"; |
| | | btnSuctionView.TextID = StringId.UnderProtection; |
| | | btnSuctionView.TextID = StringId.SensorNormalState; |
| | | btnSuctionView.IsSelected = false; |
| | | } |
| | | else//有人 |
| | |
| | | { |
| | | if (temp.state == "true") |
| | | { |
| | | btnIcon.UnSelectedImagePath = "FunctionIcon/ArmSensor/SomeoneInBgIcon.png"; |
| | | btnIcon.IsSelected = true; |
| | | btnSuctionView.TextID = StringId.Someone; |
| | | btnIcon.IsSelected = false; |
| | | btnSuctionView.TextID = StringId.SomeoneIn; |
| | | btnSuctionView.IsSelected = true; |
| | | } |
| | | else |
| | |
| | | var tempStatus = device.attributes.Find((sta) => sta.key == FunctionAttributeKey.TargetStatus); |
| | | if(tempStatus != null) |
| | | { |
| | | if(tempStatus.state == "4") |
| | | { |
| | | btnIcon.UnSelectedImagePath = "FunctionIcon/ArmSensor/SomeoneFellBgIcon.png"; |
| | | btnSuctionView.TextID = StringId.SomeoneFell; |
| | | btnSuctionView.IsSelected = true; |
| | | |
| | | switch (tempStatus.state) |
| | | {//0空,1走,2跑,3坐,4跌倒,5站 |
| | | case "0": |
| | | btnIcon.UnSelectedImagePath = "FunctionIcon/ArmSensor/UnderProtectionBgIcon.png"; |
| | | btnIcon.IsSelected = true; |
| | | btnIcon.IsSelected = false; |
| | | btnSuctionView.TextID = StringId.SensorNormalState; |
| | | btnSuctionView.IsSelected = false; |
| | | break; |
| | | case "1": |
| | | btnIcon.UnSelectedImagePath = "FunctionIcon/ArmSensor/SomeoneInBgIcon.png"; |
| | | btnIcon.IsSelected = true; |
| | | btnIcon.IsSelected = false; |
| | | btnSuctionView.TextID = StringId.SomeoneIn; |
| | | btnSuctionView.IsSelected = true; |
| | | break; |
| | | case "2": |
| | | if (device.extSet.labModel) |
| | | { |
| | | btnIcon.UnSelectedImagePath = "FunctionIcon/ArmSensor/SomeoneRunBgIcon.png"; |
| | | btnIcon.IsSelected = true; |
| | | btnIcon.IsSelected = false; |
| | | btnSuctionView.TextID = StringId.SomeoneRunning; |
| | | btnSuctionView.IsSelected = true; |
| | | } |
| | | break; |
| | | case "3": |
| | | if (device.extSet.labModel) |
| | | { |
| | | btnIcon.UnSelectedImagePath = "FunctionIcon/ArmSensor/SomeoneSitBgIcon.png"; |
| | | btnIcon.IsSelected = true; |
| | | btnIcon.IsSelected = false; |
| | | btnSuctionView.TextID = StringId.SomeoneSitting; |
| | | btnSuctionView.IsSelected = true; |
| | | } |
| | | break; |
| | | case "4": |
| | | btnIcon.UnSelectedImagePath = "FunctionIcon/ArmSensor/SomeoneFellBgIcon.png"; |
| | | btnIcon.IsSelected = true; |
| | | btnIcon.IsSelected = false; |
| | | btnSuctionView.TextID = StringId.SomeoneFell; |
| | | btnSuctionView.IsSelected = true; |
| | | break; |
| | | case "5": |
| | | if (device.extSet.labModel) |
| | | { |
| | | btnIcon.UnSelectedImagePath = "FunctionIcon/ArmSensor/SomeoneStandBgIcon.png"; |
| | | btnIcon.IsSelected = true; |
| | | btnIcon.IsSelected = false; |
| | | btnSuctionView.TextID = StringId.SomeoneStanding; |
| | | btnSuctionView.IsSelected = true; |
| | | } |
| | | Console.WriteLine(btnSuctionView.Text); |
| | | break; |
| | | default: |
| | | |
| | | break; |
| | | } |
| | | |
| | | |
| | | } |
| | | } |
| | | } |