| | |
| | |
|
| | | //初始化中部控件
|
| | | this.InitMiddleFrame();
|
| | | |
| | |
|
| | | this.zbGateway = HdlGatewayLogic.Current.GetLocalGateway(GatewayResourse.AppOldSelectGatewayId); |
| | | } |
| | | |
| | |
| | | rowThrid.ButtonClickEvent += (sender, e) => |
| | | {
|
| | | rowThrid.CanClick = false;
|
| | | HdlThreadLogic.Current.RunThread(() => |
| | | HdlThreadLogic.Current.RunThread(() =>
|
| | | {
|
| | | //检测网关
|
| | | var errorMsg = this.CheckGateway();
|
| | | HdlThreadLogic.Current.RunMain(() => |
| | | HdlThreadLogic.Current.RunMain(() =>
|
| | | {
|
| | | rowThrid.CanClick = true; |
| | | if (errorMsg != null) |
| | | { |
| | | this.ShowMassage(ShowMsgType.Tip, errorMsg); |
| | | } |
| | | else |
| | | { |
| | | var form = new Device.DeviceSearchForm(); |
| | | form.AddForm(string.Empty); |
| | | } |
| | | }); |
| | | rowThrid.CanClick = true;
|
| | | if (errorMsg != null)
|
| | | {
|
| | | this.ShowMassage(ShowMsgType.Tip, errorMsg);
|
| | | }
|
| | | else
|
| | | {
|
| | | var form = new Device.DeviceSearchForm();
|
| | | form.AddForm(string.Empty);
|
| | | }
|
| | | });
|
| | | }); |
| | | }; |
| | | |
| | |
| | | /// </summary> |
| | | private string CheckGateway()
|
| | | {
|
| | | if (zbGateway != null && zbGateway.LinuxImageType == 11) |
| | | { |
| | | if (zbGateway != null && zbGateway.LinuxImageType == 11)
|
| | | {
|
| | | //mini夜灯只能限制加入16和设备
|
| | | this.ShowProgressBar();
|
| | |
|
| | |
| | | var listDevice = Common.LocalDevice.Current.GetDeviceListFromGateway(zbGateway.GwId, ref statu, true, ShowErrorMode.NO);
|
| | | if (statu != 1)
|
| | | {
|
| | | //如果 |
| | | //如果
|
| | | listDevice = Common.LocalDevice.Current.GetDeviceByGatewayID(zbGateway.GwId);
|
| | | }
|
| | | //检测mini网关的设备数
|
| | |
| | | listMac.Add(device.DeviceAddr);
|
| | | }
|
| | | }
|
| | | this.CloseProgressBar(); |
| | | |
| | | this.CloseProgressBar();
|
| | |
|
| | | bool canAdd = listMac.Count < 16;
|
| | | if (canAdd == false) |
| | | { |
| | | //Mini网关最大只能添加16个设备 |
| | | return Language.StringByID(R.MyInternationalizationString.uMiniGatewayMaxDeviceCountMsg); |
| | | } |
| | | } |
| | | |
| | | return null; |
| | | if (canAdd == false)
|
| | | {
|
| | | //Mini网关最大只能添加16个设备
|
| | | return Language.StringByID(R.MyInternationalizationString.uMiniGatewayMaxDeviceCountMsg);
|
| | | }
|
| | | }
|
| | |
|
| | | return null;
|
| | | } |
| | | |
| | | #endregion |
| | |
| | | if (formName != string.Empty) |
| | | { |
| | | rowLayout.ButtonClickEvent += (sender, e) => |
| | | { |
| | | {
|
| | | rowLayout.CanClick = false;
|
| | | HdlThreadLogic.Current.RunThread(() => |
| | | HdlThreadLogic.Current.RunThread(() =>
|
| | | {
|
| | | //检测网关
|
| | | var errorMsg = this.CheckGateway();
|
| | | HdlThreadLogic.Current.RunMain(() => |
| | | HdlThreadLogic.Current.RunMain(() =>
|
| | | {
|
| | | rowLayout.CanClick = true; |
| | | if (errorMsg != null) |
| | | { |
| | | this.ShowMassage(ShowMsgType.Tip, errorMsg); |
| | | } |
| | | else |
| | | { |
| | | //反射目标界面 |
| | | this.LoadFormByFullName("Shared.Phone.UserCenter.DeviceDirection." + formName); |
| | | } |
| | | }); |
| | | rowLayout.CanClick = true;
|
| | | if (errorMsg != null)
|
| | | {
|
| | | this.ShowMassage(ShowMsgType.Tip, errorMsg);
|
| | | }
|
| | | else
|
| | | {
|
| | | //反射目标界面
|
| | | this.LoadFormByFullName("Shared.Phone.UserCenter.DeviceDirection." + formName);
|
| | | }
|
| | | });
|
| | | }); |
| | | }; |
| | | } |