| | |
| | | //划线
|
| | | btnBeloneArea.AddBottomLine();
|
| | |
|
| | | //mini网关有个功能设置
|
| | | var linuxImageType = this.zbGateway.LinuxImageType;
|
| | | if (linuxImageType == 11)
|
| | | {
|
| | | var listDevice = Common.LocalDevice.Current.GetDeviceByGatewayID(this.zbGateway.GwId);
|
| | | CommonDevice miniDevice = null;
|
| | | foreach (var device in listDevice)
|
| | | {
|
| | | //获取这个网关下的小夜灯设备
|
| | | if (Common.LocalDevice.Current.IsMiniLight(device) == true)
|
| | | {
|
| | | miniDevice = device;
|
| | | break;
|
| | | }
|
| | | }
|
| | | //如果找得到的话
|
| | | if (miniDevice != null)
|
| | | {
|
| | | //功能设置
|
| | | var rowFunction = new RowLayoutControl(listview.rowSpace / 2);
|
| | | listview.AddChidren(rowFunction);
|
| | | rowFunction.frameTable.AddLeftCaption(Language.StringByID(R.MyInternationalizationString.uFunctionSettingUp), 700);
|
| | | //右图标
|
| | | rowFunction.frameTable.AddRightArrow();
|
| | | //底线
|
| | | rowFunction.frameTable.AddBottomLine();
|
| | | rowFunction.frameTable.ButtonClickEvent += (sender, e) =>
|
| | | {
|
| | | var form = new DeviceLight.MiniNightLightFunctionSettionForm();
|
| | | form.AddForm(miniDevice);
|
| | | };
|
| | | }
|
| | | }
|
| | |
|
| | | //数据上传与下载
|
| | | var rowData = new RowLayoutControl(listview.rowSpace / 2);
|
| | | listview.AddChidren(rowData);
|
| | |
| | | rowData.frameTable.ButtonClickEvent += (sender, e) =>
|
| | | {
|
| | | var form = new GatewayUploadAndDownLoadForm();
|
| | | form.AddForm(HdlGatewayLogic.Current.GetGatewayId(this.zbGateway));
|
| | | form.AddForm(this.zbGateway.GwId);
|
| | | };
|
| | |
|
| | | //通用信息
|
| | |
| | | btnNewVersion.Visible = false;
|
| | | btnNewVersion.X = Application.GetRealWidth(242);
|
| | | btnNewVersion.Y = Application.GetRealHeight(23);
|
| | | rowUpDate.AddChidren(btnNewVersion, ChidrenBindMode.BindEventOnly);
|
| | | rowUpDate.AddChidren(btnNewVersion, ChidrenBindMode.BindEvent);
|
| | | rowUpDate.ButtonClickEvent += (sender, e) =>
|
| | | {
|
| | | btnNewVersion.Visible = false;
|
| | |
| | | if (oldName != btnNote.Text)
|
| | | {
|
| | | //修改名字
|
| | | this.SetGatewayName(btnNote.Text, false);
|
| | | this.SetGatewayName(btnNote.Text, true);
|
| | | }
|
| | | else
|
| | | {
|
| | |
| | |
|
| | | //切换
|
| | | MenuName = Language.StringByID(R.MyInternationalizationString.uSwitch1);
|
| | | string strWayId = HdlGatewayLogic.Current.GetGatewayId(zbGateway);
|
| | | string strWayId = this.zbGateway.GwId;
|
| | | if (strWayId == GatewayResourse.AppOldSelectGatewayId)
|
| | | {
|
| | | MenuName = Language.StringByID(R.MyInternationalizationString.uRefresh);
|
| | |
| | |
|
| | | #endregion
|
| | |
|
| | | #region ■ 完成按钮按下_______________________
|
| | |
|
| | | /// <summary>
|
| | | /// 完成按钮按下
|
| | | /// </summary>
|
| | | /// <param name="gatewayName">网关名</param>
|
| | | private void FinishButtonClick(string gatewayName)
|
| | | {
|
| | | if (string.IsNullOrEmpty(gatewayName) == true)
|
| | | {
|
| | | //请输入网关名称
|
| | | string msg = Language.StringByID(R.MyInternationalizationString.uGatewayNameMastInput);
|
| | | this.ShowMassage(ShowMsgType.Error, msg);
|
| | | return;
|
| | | }
|
| | | string nameValue = HdlGatewayLogic.Current.GetGatewayName(zbGateway);
|
| | | if (nameValue == gatewayName)
|
| | | {
|
| | | //同名不需要处理
|
| | | this.CloseForm();
|
| | | return;
|
| | | }
|
| | | //修改名字
|
| | | this.SetGatewayName(gatewayName, true);
|
| | | }
|
| | |
|
| | | #endregion
|
| | |
|
| | | #region ■ 修改名字___________________________
|
| | |
|
| | | /// <summary>
|
| | |
| | | /// <param name="online"></param>
|
| | | private async void DoSwitchGateway()
|
| | | {
|
| | | string gatewayId = HdlGatewayLogic.Current.GetGatewayId(zbGateway);
|
| | | var result = await HdlGatewayLogic.Current.DoSwitchGateway(gatewayId);
|
| | | var result = await HdlGatewayLogic.Current.DoSwitchGateway(zbGateway.GwId);
|
| | | if (result == false)
|
| | | {
|
| | | return;
|