| | |
| | | //设备图标控件
|
| | | this.btnDeviceIcon = new IconViewControl(78);
|
| | | btnDeviceIcon.Gravity = Gravity.Center;
|
| | | Common.LocalDevice.Current.SetDeviceIconToControl(btnDeviceIcon, i_device);
|
| | | HdlDeviceCommonLogic.Current.SetDeviceIconToControl(btnDeviceIcon, i_device);
|
| | | frameIconBackGroud.AddChidren(btnDeviceIcon);
|
| | | //重新绑定事件
|
| | | this.frameTable.ChangedChidrenBindMode(frameIconBackGroud, ChidrenBindMode.BindEvent);
|
| | |
|
| | | //设备名字
|
| | | this.btnDeviceName = new NormalViewControl(600, 60, true);
|
| | | if (this.device.Type == DeviceType.WindowCoveringDevice)
|
| | | if (this.device.Type == DeviceType.WindowCoveringDevice || this.device.Type == DeviceType.Airer)
|
| | | {
|
| | | //窗帘因为右边有三个按钮,所以需要所有名字的宽度
|
| | | //窗帘因为右边有三个按钮,所以需要缩小名字的宽度
|
| | | this.btnDeviceName.Width = Application.GetRealWidth(360);
|
| | | }
|
| | | btnDeviceName.X = Application.GetRealWidth(181);
|
| | | //当指定实际坐标时,这里需要的偏移量为2倍
|
| | | btnDeviceName.Y = Application.GetRealHeight(16) + this.chidrenYaxis * 2;
|
| | | btnDeviceName.Text = Common.LocalDevice.Current.GetDeviceEpointName(i_device);
|
| | | btnDeviceName.Text = HdlDeviceCommonLogic.Current.GetDeviceEpointName(i_device);
|
| | | btnDeviceName.SelectedTextColor = Common.ZigbeeColor.Current.GXCTextSelectedColor;
|
| | | this.frameTable.AddChidren(btnDeviceName, ChidrenBindMode.BindEvent);
|
| | |
|
| | |
| | | }
|
| | |
|
| | | //底线
|
| | | var btnBottomLine = new NormalViewControl(Application.GetRealWidth(841), ControlCommonResourse.BottomLineHeight, false);
|
| | | var btnBottomLine = new NormalViewControl(Application.GetRealWidth(841), HdlControlResourse.BottomLineHeight, false);
|
| | | btnBottomLine.X = Application.GetRealWidth(181);
|
| | | btnBottomLine.Y = this.Height - ControlCommonResourse.BottomLineHeight;
|
| | | btnBottomLine.Y = this.Height - HdlControlResourse.BottomLineHeight;
|
| | | btnBottomLine.BackgroundColor = UserCenterColor.Current.ButtomLine;
|
| | | this.frameTable.AddChidren(btnBottomLine, ChidrenBindMode.NotBind);
|
| | |
|
| | |
| | | {
|
| | | this.frameTable.AddChidren(this.btnSwitch, ChidrenBindMode.NotBind);
|
| | | btnSwitch.InitControl();
|
| | | btnSwitch.X -= ControlCommonResourse.XXLeft;
|
| | | btnSwitch.X -= HdlControlResourse.XXLeft;
|
| | | btnSwitch.Y += this.chidrenYaxis;
|
| | |
|
| | | return btnSwitch;
|
| | |
| | | public virtual void RefreshControlInfo(CommonDevice i_device)
|
| | | {
|
| | | //设备图标也刷新
|
| | | Common.LocalDevice.Current.SetDeviceIconToControl(btnDeviceIcon, i_device);
|
| | | HdlDeviceCommonLogic.Current.SetDeviceIconToControl(btnDeviceIcon, i_device);
|
| | | //设备名字
|
| | | this.btnDeviceName.Text = Common.LocalDevice.Current.GetDeviceEpointName(i_device);
|
| | | this.btnDeviceName.Text = HdlDeviceCommonLogic.Current.GetDeviceEpointName(i_device);
|
| | | //检测设备是否是打开状态
|
| | | bool isOpen = this.CheckIsOpenStatu(i_device);
|
| | | if (this.isHadOpenSwitch == true && i_device.HadReadDeviceStatu == false)
|
| | |
| | | //设备状态必须刷新
|
| | | if (this.btnStatu != null)
|
| | | {
|
| | | this.btnStatu.Text = HdlDeviceOtherLogic.Current.GetDeviceStatu(this.device);
|
| | | this.btnStatu.Text = HdlDeviceCommonLogic.Current.GetMainPageDeviceStatuText(this.device);
|
| | | }
|
| | | //开关控件
|
| | | if (this.btnSwitch != null && this.btnSwitch.IsSelected != isOpen)
|
| | |
| | | //如果这个函数被重写的话,则代表这个设备有开关功能
|
| | | this.isHadOpenSwitch = false;
|
| | | //默认用在线状态来判断
|
| | | return Common.LocalDevice.Current.CheckDeviceIsOnline(i_device);
|
| | | return HdlDeviceCommonLogic.Current.CheckDeviceIsOnline(i_device);
|
| | | }
|
| | |
|
| | |
|
| | |
| | | public void StartRowLightAppeal()
|
| | | {
|
| | | //设备状态必须刷新
|
| | | this.btnStatu.Text = HdlDeviceOtherLogic.Current.GetDeviceStatu(this.device);
|
| | | this.btnStatu.Text = HdlDeviceCommonLogic.Current.GetMainPageDeviceStatuText(this.device);
|
| | |
|
| | | if (this.isAppeal == true) { return; }
|
| | | this.isAppeal = true;
|