| | |
| | | /// <summary>
|
| | | /// 场景功能中部背景bodyView(高度为设备菜单的那个白色背景的上部到屏幕底部)
|
| | | /// </summary>
|
| | | public FrameLayout functionSceneBodyView;
|
| | | public NormalFrameLayout functionSceneBodyView;
|
| | | /// <summary>
|
| | | /// 中部背景bodyView(高度为场景功能切换控件的底部到屏幕底部)
|
| | | /// </summary>
|
| | | public FrameLayout functionSceneAutoBodyView;
|
| | | public NormalFrameLayout functionSceneAutoBodyView;
|
| | | /// <summary>
|
| | | /// 右上角添加按钮
|
| | | /// </summary>
|
| | |
| | | /// </summary>
|
| | | public CategoryMainForm()
|
| | | {
|
| | | this.FormID = "CategoryMainForm";
|
| | | BackgroundColor = ZigbeeColor.Current.GXCGrayBackgroundColor;
|
| | | instance = this;
|
| | | }
|
| | |
| | | private void InitTopControl()
|
| | | {
|
| | | //头部FrameLayout
|
| | | this.topFrameLayout = new FrameLayout();
|
| | | this.topFrameLayout = new NormalFrameLayout();
|
| | | topFrameLayout.Y = Application.GetRealHeight(104);
|
| | | topFrameLayout.Height = Application.GetRealHeight(127);
|
| | | topFrameLayout.BackgroundColor = ZigbeeColor.Current.GXCGrayBackgroundColor;
|
| | |
| | | private void InitMidControls()
|
| | | {
|
| | | //应该是body吧
|
| | | this.bodyFrameLayout = new FrameLayout();
|
| | | this.bodyFrameLayout = new NormalFrameLayout();
|
| | | bodyFrameLayout.Y = topFrameLayout.Bottom;
|
| | | bodyFrameLayout.Height = this.Height - topFrameLayout.Bottom;
|
| | | bodyFrameLayout.BackgroundColor = ZigbeeColor.Current.GXCGrayBackgroundColor;
|
| | |
| | | floors.changeFloor = true;
|
| | | floors.FloorAction += (floorId) =>
|
| | | {
|
| | | btnFloorName.Text = Config.Instance.Home.GetFloorNameById(floorId);
|
| | | btnFloorName.Text = HdlResidenceLogic.Current.GetFloorNameById(floorId);
|
| | | HdlRoomLogic.Current.NowCategoryRoom = HdlRoomLogic.Current.GetLoveRoom();
|
| | | //刷新bodyView
|
| | | this.RefreshBodyView();
|
| | |
| | | }
|
| | |
|
| | | //目前不知道郭雪城的这个具体放在哪个的位置
|
| | | this.functionSceneAutoBodyView = new FrameLayout();
|
| | | this.functionSceneAutoBodyView = new NormalFrameLayout();
|
| | | functionSceneAutoBodyView.Y = frameSwitchBack.Bottom;
|
| | | functionSceneAutoBodyView.Height = bodyFrameLayout.Height - frameSwitchBack.Bottom;
|
| | | bodyFrameLayout.AddChidren(functionSceneAutoBodyView);
|
| | |
| | | };
|
| | |
|
| | | //功能和场景bodyView
|
| | | this.functionSceneBodyView = new FrameLayout();
|
| | | this.functionSceneBodyView = new NormalFrameLayout();
|
| | | functionSceneBodyView.Y = roomSwitchContr.Bottom;
|
| | | functionSceneBodyView.Height = functionSceneAutoBodyView.Height - roomSwitchContr.Bottom;
|
| | | functionSceneAutoBodyView.AddChidren(functionSceneBodyView);
|
| | |
| | | {
|
| | | cardContr = new Controls.DeviceDoorLockRowControl();
|
| | | }
|
| | | //色温灯
|
| | | else if (device.Type == DeviceType.ColorTemperatureLight)
|
| | | {
|
| | | cardContr = new Controls.DeviceColorTemperatureRowControl();
|
| | | }
|
| | | //无法识别
|
| | | else
|
| | | {
|
| | |
| | | //下拉刷新
|
| | | listview1.BeginHeaderRefreshingAction += () =>
|
| | | {
|
| | | //如果当前是虚拟住宅,则只给个特效
|
| | | if (Common.Config.Instance.Home.IsVirtually == true)
|
| | | {
|
| | | HdlThreadLogic.Current.RunThread(() =>
|
| | | {
|
| | | System.Threading.Thread.Sleep(1500);
|
| | | HdlThreadLogic.Current.RunMain(() =>
|
| | | {
|
| | | listview1.EndHeaderRefreshing();
|
| | | });
|
| | | });
|
| | | return;
|
| | | }
|
| | |
|
| | | HdlThreadLogic.Current.RunThread(() =>
|
| | | {
|
| | | //从网关刷新场景列表
|
| | |
| | | private void AddNormalDeviceReportEvent()
|
| | | {
|
| | | //设备属性上报(缓存的修改交由 HdlGatewayReceiveLogic 处理)
|
| | | HdlGatewayReceiveLogic.Current.AddAttributeEvent("UserHomeViewDeviceStatus", ReceiveComandDiv.A设备属性上报, (report) =>
|
| | | HdlGatewayReceiveLogic.Current.AddAttributeEvent("CategoryMainFormDeviceStatus", ReceiveComandDiv.A设备属性上报, (report) =>
|
| | | {
|
| | | HdlThreadLogic.Current.RunMain(() =>
|
| | | {
|
| | |
| | | });
|
| | |
|
| | | //设备在线上报(缓存的修改交由 HdlGatewayReceiveLogic 处理)
|
| | | HdlGatewayReceiveLogic.Current.AddAttributeEvent("UserHomeViewDeviceOnline", ReceiveComandDiv.A设备在线上报, (report) =>
|
| | | HdlGatewayReceiveLogic.Current.AddAttributeEvent("CategoryMainFormDeviceOnline", ReceiveComandDiv.A设备在线上报, (report) =>
|
| | | {
|
| | | HdlThreadLogic.Current.RunMain(() =>
|
| | | {
|
| | |
| | | private void AddSensorDeviceReportEvent()
|
| | | {
|
| | | //传感器上报(缓存的修改交由 HdlGatewayReceiveLogic 处理)
|
| | | HdlGatewayReceiveLogic.Current.AddAttributeEvent("UserHomeViewSensor", ReceiveComandDiv.A传感器上报, (report) =>
|
| | | HdlGatewayReceiveLogic.Current.AddAttributeEvent("CategoryMainFormSensor", ReceiveComandDiv.A传感器上报, (report) =>
|
| | | {
|
| | | HdlThreadLogic.Current.RunMain(() =>
|
| | | {
|
| | |
| | | string mainKeys = LocalDevice.Current.GetDeviceMainKeys(report);
|
| | | if (this.dicDeviceRowControl.ContainsKey(mainKeys) == true)
|
| | | {
|
| | | //本地设备对象
|
| | | var locadevice = LocalDevice.Current.GetDevice(mainKeys);
|
| | | //刷新卡片信息
|
| | | this.dicDeviceRowControl[mainKeys].RefreshControlInfo(locadevice);
|
| | | //开启行闪烁特效
|
| | | this.dicDeviceRowControl[mainKeys].StartRowLightAppeal();
|
| | | }
|
| | |
|
| | | }, ShowErrorMode.NO);
|
| | |
| | | {
|
| | | //把静态变量的这个东西置空
|
| | | instance = null;
|
| | | HdlGatewayReceiveLogic.Current.RemoveEvent("CategoryMainFormDeviceStatus");
|
| | | HdlGatewayReceiveLogic.Current.RemoveEvent("CategoryMainFormDeviceOnline");
|
| | | HdlGatewayReceiveLogic.Current.RemoveEvent("CategoryMainFormSensor");
|
| | |
|
| | | base.CloseFormBefore();
|
| | | }
|