| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Text; |
| | | using HDL_ON.DAL; |
| | | using HDL_ON.DAL.Server; |
| | | using HDL_ON.DriverLayer; |
| | | using HDL_ON.Entity; |
| | | using HDL_ON.UI.CSS; |
| | | using Newtonsoft.Json; |
| | | using Newtonsoft.Json.Linq; |
| | | using Shared; |
| | | |
| | | namespace HDL_ON.UI |
| | | { |
| | | #if __IOS__ |
| | | public partial class HomePage : VerticalRefreshLayout |
| | | public partial class HomePage : VerticalRefreshLayout |
| | | #else |
| | | public partial class HomePage : VerticalScrolViewLayout |
| | | #endif |
| | |
| | | /// 功能区域集合 |
| | | /// </summary> |
| | | List<FrameLayout> functionViews; |
| | | #endregion |
| | | #endregion |
| | | |
| | | #region 区域变量 |
| | | #region 区域变量 |
| | | /// <summary> |
| | | /// 当前显示对控制类型是否是设备功能控制 |
| | | /// 0 功能 |
| | |
| | | /// 2 群控 |
| | | /// </summary> |
| | | int CurShowTypeContent = 0; |
| | | #endregion |
| | | #endregion |
| | | |
| | | #region 报警信息 |
| | | #region 报警信息 |
| | | //Button btnMsgBg; |
| | | //Button btnMsgTime; |
| | | //Button btnMsg; |
| | |
| | | topView.AddChidren(environmentalView); |
| | | CheckLinkStatus();//2020-12-22 |
| | | |
| | | #region 环境数据 |
| | | #region 环境数据 |
| | | var tempSensorList = FunctionList.List.GetEnvirSensorsList().FindAll((obj) => obj.spk == SPK.SensorTemperature); |
| | | var humiSensorList = FunctionList.List.GetEnvirSensorsList().FindAll((obj) => obj.spk == SPK.SensorHumidity); |
| | | var enviList = FunctionList.List.GetEnvirSensorsList().FindAll((obj) => SPK.EvironmentSensorList().Contains(obj.spk)); |
| | |
| | | } |
| | | } |
| | | |
| | | var btnEnvirValuesTitle = new Button() { |
| | | var btnEnvirValuesTitle = new Button() |
| | | { |
| | | X = Application.GetRealWidth(12), |
| | | Gravity = Gravity.CenterVertical, |
| | | TextColor = CSS_Color.MainBackgroundColor, |
| | |
| | | } |
| | | if (tempTotalValues > 0) |
| | | { |
| | | btnIndoorTempValues.Text = "/" + (tempTotalValues/ tempTotalCount).ToString("0.0") + "°"; |
| | | btnIndoorTempValues.Text = "/" + (tempTotalValues / tempTotalCount).ToString("0.0") + "°"; |
| | | } |
| | | } |
| | | btnIndoorTempValues.Width = btnIndoorTempValues.GetTextWidth(); |
| | |
| | | }; |
| | | if (DB_ResidenceData.Instance.GatewayType == 1 && !DB_ResidenceData.Instance.CurrentRegion.isOtherShare) |
| | | { |
| | | |
| | | |
| | | topView.AddChidren(btnSecurityStatus); |
| | | foreach (var temp in FunctionList.List.securities) |
| | | { |
| | |
| | | } |
| | | } |
| | | |
| | | btnSecurityStatus.MouseUpEventHandler = (sender, e) => { |
| | | btnSecurityStatus.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | var page = new ArmCenterPage(); |
| | | MainPage.BasePageView.AddChidren(page); |
| | | page.LoadPage(); |
| | |
| | | } |
| | | |
| | | |
| | | #region msg |
| | | #region msg |
| | | //FrameLayout msgView; |
| | | //msgView = new FrameLayout() |
| | | //{ |
| | |
| | | UnSelectedImagePath = "Collection/MsgIcon.png", |
| | | SelectedImagePath = "Collection/MsgIconTip.png", |
| | | }; |
| | | if(btnSecurityStatus.Parent == null) |
| | | if (btnSecurityStatus.Parent == null) |
| | | { |
| | | btnMsgIcon.X = Application.GetRealWidth(329); |
| | | } |
| | |
| | | |
| | | LoadEvent_GotoMessageCenterPage(); |
| | | |
| | | #endregion |
| | | #endregion |
| | | |
| | | #endregion |
| | | #endregion |
| | | |
| | | #region 功能场景切换 |
| | | #region 功能场景切换 |
| | | |
| | | bodyView.AddChidren(new Button() { Height = Application.GetRealHeight(20), BackgroundColor = 0x00000000 }); |
| | | |
| | |
| | | #endregion |
| | | |
| | | #if DEBUG |
| | | btnResidenceName.MouseUpEventHandler = (envent, ee) => { |
| | | btnResidenceName.MouseUpEventHandler = (envent, ee) => |
| | | { |
| | | MainPage.Log("sss"); |
| | | new System.Threading.Thread(async() => |
| | | { |
| | | await Common.AliyunLog.AliyunLogClient.PostLogs("告警测试", "测试信息测试信息测试信息测试信息测试信息测试信息测试信息测试信息测试信息测试信息测试信息测试信息测试信息"); |
| | | }) |
| | | { IsBackground = true }.Start(); |
| | | |
| | | #if __ANDROID__ |
| | | //HDLLinphoneKit.Instance.MediaPlayerLooping(true); |
| | | Com.Hdl.Hdllinphonesdk.HDLLinphoneKit.Instance.PlayRingtone(); |
| | | #elif __IOS__ |
| | | |
| | | //if (isPlay) |
| | | //{ |
| | | // isPlay = false; |
| | | // soundPlayer.StopSound(); |
| | | //} |
| | | //else |
| | | //{ |
| | | // isPlay = true; |
| | | // soundPlayer.PlaySound(); |
| | | //} |
| | | |
| | | #endif |
| | | //PlaySystemRingtone playSystemRingtone = new PlaySystemRingtone(); |
| | | //playSystemRingtone.Play(); |
| | | //new System.Threading.Thread(async() => |
| | | //{ |
| | | // await Common.AliyunLog.AliyunLogClient.PostLogs("告警测试", "测试信息测试信息测试信息测试信息测试信息测试信息测试信息测试信息测试信息测试信息测试信息测试信息测试信息"); |
| | | //}) |
| | | //{ IsBackground = true }.Start(); |
| | | }; |
| | | #endif |
| | | } |
| | |
| | | |
| | | void loadNavView() |
| | | { |
| | | if(changeBaseView == null) |
| | | if (changeBaseView == null) |
| | | { |
| | | changeBaseView = new FrameLayout() |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | btnChangeGroupControl.MouseUpEventHandler = (sender, e) => { |
| | | btnChangeGroupControl.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | btnChangeFunction.IsSelected = false; |
| | | btnChangeFunction.TextSize = CSS.CSS_FontSize.TextFontSize; |
| | | btnChangeFunction.IsBold = false; |
| | |
| | | contentView.PageIndex = 2; |
| | | }; |
| | | |
| | | btnChangeFunction.MouseUpEventHandler = (sender, e) => { |
| | | btnChangeFunction.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | btnChangeFunction.IsSelected = true; |
| | | btnChangeFunction.TextSize = CSS.CSS_FontSize.HeadlineFontSize; |
| | | btnChangeFunction.IsBold = true; |
| | |
| | | btnChangeGroupControl.TextSize = CSS.CSS_FontSize.TextFontSize; |
| | | btnChangeGroupControl.IsBold = false; |
| | | }; |
| | | btnChangeScene.MouseUpEventHandler = (sender, e) => { |
| | | btnChangeScene.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | btnChangeScene.IsSelected = true; |
| | | btnChangeScene.TextSize = CSS.CSS_FontSize.HeadlineFontSize; |
| | | btnChangeScene.IsBold = true; |
| | |
| | | /// </summary> |
| | | void LoadContentView() |
| | | { |
| | | |
| | | |
| | | if (!Common.ApiUtlis.Ins.DownloadDataComplete && !MainPage.NoLoginMode) |
| | | { |
| | | var waitPage = new Loading(); |
| | |
| | | } |
| | | }); |
| | | } |
| | | catch (Exception ex) { |
| | | catch (Exception ex) |
| | | { |
| | | MainPage.Log($"刷新主页异常:{ex.Message}"); |
| | | } |
| | | finally { } |
| | |
| | | //} |
| | | //else |
| | | { |
| | | if (!function.collect) |
| | | if (!function.collect&& function.spk != SPK.InverterJinmao) |
| | | continue; |
| | | } |
| | | if (index % 2 == 0) |
| | |
| | | }; |
| | | rowView.AddChidren(functionView); |
| | | functionViews.Add(functionView); |
| | | //绿建人居环境,科技系统 |
| | | if (function.spk == SPK.AcstParent) |
| | | //绿建人居环境,科技系统,金茂光伏储能 |
| | | if (function.spk == SPK.AcstParent || function.spk == SPK.InverterJinmao) |
| | | { |
| | | LoadAcstDiv(functionView, function); |
| | | } |
| | |
| | | }; |
| | | rowView.AddChidren(functionView); |
| | | functionViews.Add(functionView); |
| | | var btnbg = new Button() |
| | | { |
| | | UnSelectedImagePath = "Collection/Functionbg.png", |
| | | SelectedImagePath = "Collection/FunctionOnbg.png", |
| | | Tag = function.sid |
| | | }; |
| | | functionView.AddChidren(btnbg); |
| | | LoadDeviceFunctionDiv(functionView, function); |
| | | var btnbg = new Button() |
| | | { |
| | | UnSelectedImagePath = "Collection/Functionbg.png", |
| | | SelectedImagePath = "Collection/FunctionOnbg.png", |
| | | Tag = function.sid |
| | | }; |
| | | functionView.AddChidren(btnbg); |
| | | LoadDeviceFunctionDiv(functionView, function); |
| | | |
| | | index++; |
| | | } |
| | |
| | | //2020-12-03 修改图片加载方法 |
| | | ImageUtlis.Current.LoadLocalOrNetworkImages((scene as Scene).ImagePath, functionView); |
| | | |
| | | LoadSceneFunctionDiv( functionView, scene); |
| | | LoadSceneFunctionDiv(functionView, scene); |
| | | index++; |
| | | } |
| | | |
| | |
| | | |
| | | } |
| | | |
| | | else if(function.spk == SPK.SensorDryContact || function.spk == SPK.SensorDryContact2) |
| | | else if (function.spk == SPK.SensorDryContact || function.spk == SPK.SensorDryContact2) |
| | | { |
| | | btnIcon.UnSelectedImagePath = $"FunctionIcon/Icon/HomeIcon/{function.IconName}_white.png"; |
| | | btnIcon.SelectedImagePath = $"FunctionIcon/Icon/HomeIcon/{function.IconName}_white.png"; |
| | |
| | | SelectedImagePath = "FunctionIcon/Curtain/CurtainCloseWhiteIcon_Shadow.png", |
| | | }; |
| | | view.AddChidren(btnCurtainClose); |
| | | |
| | | |
| | | |
| | | Button btnCurtainOpen; |
| | | btnCurtainOpen = new Button() |
| | |
| | | view.AddChidren(btnClose); |
| | | |
| | | |
| | | btnClose.MouseDownEventHandler = (sender, e) => { |
| | | btnClose.MouseDownEventHandler = (sender, e) => |
| | | { |
| | | btnClose.IsSelected = true; |
| | | }; |
| | | |
| | | btnClose.MouseUpEventHandler = (sender, e) => { |
| | | btnClose.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | btnClose.IsSelected = false; |
| | | if (function.spk == SPK.GroupControl) |
| | | { |
| | |
| | | (function as GroupControl).Control(d); |
| | | } |
| | | }; |
| | | btnOpen.MouseDownEventHandler = (sender, e) => { |
| | | btnOpen.MouseDownEventHandler = (sender, e) => |
| | | { |
| | | btnOpen.IsSelected = true; |
| | | }; |
| | | btnOpen.MouseUpEventHandler = (sender, e) => { |
| | | btnOpen.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | btnOpen.IsSelected = false; |
| | | if (function.spk == SPK.GroupControl) |
| | | { |
| | |
| | | LoadEvent_SwitchFunction(function, btnSwitch); |
| | | } |
| | | //取消收藏事件 |
| | | Action cannelCollect = () => { |
| | | Action cannelCollect = () => |
| | | { |
| | | function.collect = false; |
| | | //if (SPK.MusicSpkList().Contains(function.spk))//处理音乐主从关系 |
| | | //{ |
| | |
| | | btnIcon.MouseUpEventHandler = skipControlPageEvent; |
| | | btnState.MouseUpEventHandler = skipControlPageEvent; |
| | | //不需要更新状态的功能列表 |
| | | if(!SPK.NotStatusSpkList.Contains(function.spk) || function.spk != SPK.IpCam_Imou) |
| | | if (!SPK.NotStatusSpkList.Contains(function.spk) || function.spk != SPK.IpCam_Imou) |
| | | { |
| | | UpdataFunctionStates(function); |
| | | } |
| | |
| | | { |
| | | X = Application.GetRealWidth(11), |
| | | Y = Application.GetRealWidth(10), |
| | | TextID = StringId.Acst, |
| | | Text = function.name, |
| | | //TextID = StringId.Acst, |
| | | IsBold = true, |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | TextSize = CSS_FontSize.TextFontSize, |
| | |
| | | }; |
| | | view.AddChidren(btnLogo); |
| | | |
| | | try |
| | | { |
| | | if (function.extend.Contains("jinmao") && function.extend.Contains("true")) |
| | | { |
| | | btnLogo.Visible = true; |
| | | } |
| | | else |
| | | { |
| | | btnLogo.Visible = false; |
| | | } |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | MainPage.Log("Error", $"金茂logo显示处理异常:{ex.Message}"); |
| | | } |
| | | |
| | | Button btnFunctionViewBg; |
| | | btnFunctionViewBg = new Button() |
| | | { |
| | | Height = Application.GetRealWidth(100), |
| | | Width = Application.GetRealWidth(102), |
| | | UnSelectedImagePath = "FunctionIcon/FunctionBg/AcstFunctionBg.png", |
| | | UnSelectedImagePath = function.spk == SPK.AcstParent ? "FunctionIcon/FunctionBg/AcstFunctionBg.png" : "FunctionIcon/FunctionBg/InverterJinmaoFunctionBg.png", |
| | | }; |
| | | view.AddChidren(btnFunctionViewBg); |
| | | btnFunctionViewBg.MouseUpEventHandler = (sender, e) => { |
| | | var page = new AcstParentPage(); |
| | | MainPage.BasePageView.AddChidren(page); |
| | | page.LoadPage(); |
| | | MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; |
| | | }; |
| | | if (function.spk == SPK.AcstParent) |
| | | { |
| | | btnFunctionViewBg.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | var page = new AcstParentPage(); |
| | | MainPage.BasePageView.AddChidren(page); |
| | | page.LoadPage(); |
| | | MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; |
| | | }; |
| | | } |
| | | else if (function.spk == SPK.InverterJinmao) |
| | | { |
| | | //btnName.TextID = StringId.NewEnergy; |
| | | btnFunctionViewBg.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | var page = new InverterJinmaoPage(); |
| | | MainPage.BasePageView.AddChidren(page); |
| | | page.LoadPage(); |
| | | MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; |
| | | }; |
| | | } |
| | | |
| | | |
| | | //Button btnAcstPower = new Button() |
| | |
| | | // }) |
| | | // { IsBackground = true }.Start(); |
| | | //}; |
| | | |
| | | |
| | | |
| | | |
| | | |