| | |
| | | /// <summary>
|
| | | /// 设备信息界面的设备图标控件(兼容网关)
|
| | | /// </summary>
|
| | | public class DeviceInfoIconControl : FrameLayout
|
| | | public class DeviceInfoIconControl : FrameLayoutControl
|
| | | {
|
| | | #region ■ 变量声明___________________________
|
| | |
|
| | |
| | | /// 设备Mac地址
|
| | | /// </summary>
|
| | | private string deviceMac = null;
|
| | | /// <summary>
|
| | | /// 设备端点
|
| | | /// </summary>
|
| | | private int deviceEpoint = -1;
|
| | | /// <summary>
|
| | | /// 网关对象
|
| | | /// </summary>
|
| | |
| | | this.Width = Application.GetMinRealAverage(207);
|
| | | this.BackgroundColor = UserCenterColor.Current.White;
|
| | | this.Radius = (uint)Application.GetMinRealAverage(207) / 2;
|
| | | this.UseClickStatu = false;
|
| | | }
|
| | |
|
| | | /// <summary>
|
| | |
| | | btnIcon2.BackgroundColor = 0xfffef1ed;
|
| | | btnIcon2.Radius = (uint)Application.GetMinRealAverage(184) / 2;
|
| | | btnIcon2.Gravity = Gravity.Center;
|
| | | this.AddChidren(btnIcon2);
|
| | | this.AddChidren(btnIcon2, ChidrenBindMode.BindEventOnly);
|
| | |
|
| | | //设备图标
|
| | | var listDevice = Common.LocalDevice.Current.GetDevicesByMac(deviceMac);
|
| | |
| | | btnIcon = new NormalViewControl(Application.GetMinRealAverage(121), Application.GetMinRealAverage(121), false);
|
| | | btnIcon.Gravity = Gravity.Center;
|
| | | Common.LocalDevice.Current.SetDeviceObjectIconToControl(btnIcon, listDevice);
|
| | | this.AddChidren(btnIcon);
|
| | | this.AddChidren(btnIcon, ChidrenBindMode.BindEventOnly);
|
| | | }
|
| | |
|
| | | /// <summary>
|
| | | /// 初始化(设备端点)
|
| | | /// </summary>
|
| | | /// <param name="i_device">设备对象</param>
|
| | | public void InitControl(string deviceMacAddr, int epoint)
|
| | | {
|
| | | this.deviceMac = deviceMacAddr;
|
| | | this.deviceEpoint = epoint;
|
| | |
|
| | | //第二层底色
|
| | | var btnIcon2 = new NormalViewControl(Application.GetMinRealAverage(184), Application.GetMinRealAverage(184), false);
|
| | | btnIcon2.BackgroundColor = 0xfffef1ed;
|
| | | btnIcon2.Radius = (uint)Application.GetMinRealAverage(184) / 2;
|
| | | btnIcon2.Gravity = Gravity.Center;
|
| | | this.AddChidren(btnIcon2, ChidrenBindMode.BindEventOnly);
|
| | |
|
| | | //设备图标
|
| | | btnIcon = new NormalViewControl(Application.GetMinRealAverage(121), Application.GetMinRealAverage(121), false);
|
| | | btnIcon.Gravity = Gravity.Center;
|
| | | Common.LocalDevice.Current.SetDeviceIconToControl(btnIcon, Common.LocalDevice.Current.GetDevice(deviceMacAddr, epoint));
|
| | | this.AddChidren(btnIcon, ChidrenBindMode.BindEventOnly);
|
| | | }
|
| | |
|
| | | /// <summary>
|
| | |
| | | btnIcon2.BackgroundColor = 0xfffef1ed;
|
| | | btnIcon2.Radius = (uint)Application.GetMinRealAverage(184) / 2;
|
| | | btnIcon2.Gravity = Gravity.Center;
|
| | | this.AddChidren(btnIcon2);
|
| | | this.AddChidren(btnIcon2, ChidrenBindMode.BindEventOnly);
|
| | |
|
| | | //设备图标
|
| | | btnIcon = new NormalViewControl(Application.GetMinRealAverage(121), Application.GetMinRealAverage(121), false);
|
| | | btnIcon.Gravity = Gravity.Center;
|
| | | HdlGatewayLogic.Current.SetGatewayIcon(btnIcon, i_gateway);
|
| | | this.AddChidren(btnIcon);
|
| | | this.AddChidren(btnIcon, ChidrenBindMode.BindEventOnly);
|
| | | }
|
| | |
|
| | | #endregion
|
| | |
| | | /// </summary>
|
| | | public void RefreshControl()
|
| | | {
|
| | | if (this.deviceMac != null)
|
| | | if (this.deviceEpoint != -1)
|
| | | {
|
| | | //刷新图标
|
| | | Common.LocalDevice.Current.SetDeviceIconToControl(btnIcon, Common.LocalDevice.Current.GetDevice(this.deviceMac, this.deviceEpoint));
|
| | | }
|
| | | else if (this.deviceMac != null)
|
| | | {
|
| | | //刷新图标
|
| | | var listDevice = Common.LocalDevice.Current.GetDevicesByMac(deviceMac);
|