| | |
| | |
|
| | | //设备类型 (固定智能网关)
|
| | | caption = Language.StringByID(R.MyInternationalizationString.uDeviceType);
|
| | | var infoContent = Common.LocalDevice.Current.GetDeviceModelIdNameInfo("1");
|
| | | var infoContent = HdlDeviceCommonLogic.Current.GetDeviceModelIdNameInfo("1");
|
| | | var btnType = new FrameCaptionViewControl(caption, infoContent != null ? infoContent.A类型名字 : string.Empty, listview.rowSpace / 2);
|
| | | btnType.UseClickStatu = false;
|
| | | listview.AddChidren(btnType);
|
| | |
| | | btnBeloneArea.AddBottomLine();
|
| | |
|
| | | //mini网关有个功能设置
|
| | | if (HdlGatewayLogic.Current.IsMiniGateway(this.zbGateway) == true)
|
| | | var linuxImageType = this.zbGateway.LinuxImageType;
|
| | | if (linuxImageType == 11)
|
| | | {
|
| | | var listDevice = Common.LocalDevice.Current.GetDeviceByGatewayID(this.zbGateway.GwId);
|
| | | var listDevice = HdlDeviceCommonLogic.Current.GetDeviceByGatewayID(this.zbGateway.GwId);
|
| | | CommonDevice miniDevice = null;
|
| | | foreach (var device in listDevice)
|
| | | {
|
| | | //获取这个网关下的小夜灯设备
|
| | | if (Common.LocalDevice.Current.IsMiniLight(device) == true)
|
| | | if (HdlDeviceCommonLogic.Current.IsMiniLight(device) == true)
|
| | | {
|
| | | miniDevice = device;
|
| | | break;
|
| | |
| | | private void ShowTopRightMenu()
|
| | | {
|
| | | //搜索网关的时候,不能删除,不给他切换,只有定位功能
|
| | | bool isSearchGw = UserCenterResourse.DicActionForm.ContainsKey("NewGateWayMenuSelectForm");
|
| | | bool isSearchGw = HdlFormLogic.Current.IsFormOpen("NewGateWayMenuSelectForm");
|
| | | int menuCount = isSearchGw == true ? 1 : 3;
|
| | |
|
| | | bool canAddReplaceMenu = false;
|
| | |
| | | && Common.Config.Instance.Home.IsShowTemplate == false
|
| | | && Common.Config.Instance.Home.IsVirtually == false)
|
| | | {
|
| | | menuCount++;
|
| | | //menuCount++;
|
| | | }
|
| | | var frame = new TopRightMenuControl(menuCount, 1);
|
| | | //定位
|
| | |
| | | //切换
|
| | | MenuName = Language.StringByID(R.MyInternationalizationString.uSwitch1);
|
| | | string strWayId = this.zbGateway.GwId;
|
| | | if (strWayId == GatewayResourse.AppOldSelectGatewayId)
|
| | | if (strWayId == HdlGatewayResourse.AppOldSelectGatewayId)
|
| | | {
|
| | | MenuName = Language.StringByID(R.MyInternationalizationString.uRefresh);
|
| | | }
|
| | |
| | | string nameValue = HdlGatewayLogic.Current.GetGatewayName(zbGateway);
|
| | | //是否切换到{0}网关?
|
| | | string msg = string.Format(Language.StringByID(R.MyInternationalizationString.uConfirmWantToSwitchTheGateway), "[" + nameValue + "]");
|
| | | if (strWayId == GatewayResourse.AppOldSelectGatewayId)
|
| | | if (strWayId == HdlGatewayResourse.AppOldSelectGatewayId)
|
| | | {
|
| | | //是否重新刷新{0}网关?
|
| | | msg = string.Format(Language.StringByID(R.MyInternationalizationString.uConfirmWantToRefreshTheGateway), "[" + nameValue + "]");
|
| | |
| | | });
|
| | | });
|
| | | }
|
| | | if (canAddReplaceMenu == true)
|
| | | {
|
| | | //替换
|
| | | MenuName = Language.StringByID(R.MyInternationalizationString.uReplace);
|
| | | frame.AddRowMenu(MenuName, null, "Item/ReplaceIconSelected.png", () =>
|
| | | {
|
| | | var form = new GatewayReplaceForm();
|
| | | form.AddForm(this.zbGateway);
|
| | | });
|
| | | }
|
| | | //if (canAddReplaceMenu == true)
|
| | | //{
|
| | | // //替换
|
| | | // MenuName = Language.StringByID(R.MyInternationalizationString.uReplace);
|
| | | // frame.AddRowMenu(MenuName, null, "Item/ReplaceIconSelected.png", () =>
|
| | | // {
|
| | | // });
|
| | | //}
|
| | | }
|
| | | #endregion
|
| | |
|
| | |
| | | this.CloseForm();
|
| | |
|
| | | //关闭指定界面(网关搜索)
|
| | | this.CloseFormByFormName("GatewaySearchListForm");
|
| | | this.CloseFormByFormName("NewGateWayMenuSelectForm");
|
| | | HdlFormLogic.Current.CloseFormByFormName("GatewaySearchListForm");
|
| | | HdlFormLogic.Current.CloseFormByFormName("NewGateWayMenuSelectForm");
|
| | |
|
| | | //关闭指定界面(网关编辑)
|
| | | this.CloseFormByFormName("GatewayListForm");
|
| | | HdlFormLogic.Current.CloseFormByFormName("GatewayListForm");
|
| | |
|
| | | if (UserCenterResourse.DicActionForm.ContainsKey("DeviceListMainForm") == false)
|
| | | if (HdlFormLogic.Current.IsFormOpen("DeviceListMainForm") == false)
|
| | | {
|
| | | //刷新主画面
|
| | | var form = new Device.DeviceListMainForm();
|
| | |
| | | return;
|
| | | }
|
| | |
|
| | | if (strWayId == GatewayResourse.AppOldSelectGatewayId)
|
| | | if (strWayId == HdlGatewayResourse.AppOldSelectGatewayId)
|
| | | {
|
| | | HdlGatewayLogic.Current.SaveGatewayIdToLocation(string.Empty);
|
| | | }
|