| | |
| | | btnPosition.ButtonClickEvent += (sender, e) =>
|
| | | {
|
| | | //定位
|
| | | Common.LocalDevice.Current.SetFixedPositionCommand(listdevice[0]);
|
| | | Common.LocalDevice.Current.SetFixedPositionCommand(listdevice[0], true);
|
| | | };
|
| | | }
|
| | |
|
| | |
| | | return;
|
| | | }
|
| | | var listMacDevice = LocalDevice.Current.GetDevicesByMac(deviceMac, false);
|
| | | if (LocalDevice.Current.IsMiniLight(listMacDevice[0]) == true)
|
| | | if (listMacDevice.Count > 0 && LocalDevice.Current.IsMiniLight(listMacDevice[0]) == true)
|
| | | {
|
| | | //mini夜灯的功能设置界面
|
| | | var room = HdlRoomLogic.Current.GetRoomByDevice(listMacDevice[0]);
|
| | |
| | | }
|
| | | }
|
| | | else if (deviceEnumInfo.ConcreteType == DeviceConcreteType.ButtonPanel_FangyueFreshAir
|
| | | || deviceEnumInfo.ConcreteType == DeviceConcreteType.ButtonPanel_SimpleEnvironment)
|
| | | || deviceEnumInfo.ConcreteType == DeviceConcreteType.ButtonPanel_SimpleEnvironment
|
| | | || deviceEnumInfo.ConcreteType == DeviceConcreteType.ButtonPanel_FangyueEnvironment)
|
| | | {
|
| | | var listTemp = Common.LocalDevice.Current.GetPanelMatchEpointByMac(listDevice);
|
| | | //展开模式时,扩大依据为:它有几个子控件
|
| | |
| | | var form = new DeviceMacInfoEditorForm();
|
| | | form.AddForm(device.DeviceAddr);
|
| | | }
|
| | | else if (deviceEnumInfo.BeloneType == DeviceBeloneType.A晾衣架)
|
| | | {
|
| | | var form = new DeviceMacInfoEditorForm();
|
| | | form.AddForm(device.DeviceAddr);
|
| | | }
|
| | | else if (deviceEnumInfo.BeloneType == DeviceBeloneType.A空气质量)
|
| | | {
|
| | | var form = new DeviceMacInfoEditorForm();
|
| | | form.AddForm(device.DeviceAddr);
|
| | | }
|
| | | else if (deviceEnumInfo.BeloneType == DeviceBeloneType.A窗帘)
|
| | | {
|
| | | var form = new DeviceMacInfoEditorForm();
|
| | |
| | | var form = new DeviceAirConditioner.IndoorUnitSettionForm();
|
| | | form.AddForm((AC)device);
|
| | | }
|
| | | //环境面板
|
| | | else if (deviceEnumInfo.ConcreteType == DeviceConcreteType.ButtonPanel_FangyueEnvironment)
|
| | | {
|
| | | var form = new DeviceFunctionSettionForm();
|
| | | form.AddForm(device, true);
|
| | | }
|
| | | //新风面板
|
| | | else if (deviceEnumInfo.ConcreteType == DeviceConcreteType.ButtonPanel_FangyueFreshAir)
|
| | | {
|
| | |
| | | //干接点
|
| | | if (device.Type == DeviceType.FreshAir)
|
| | | {
|
| | | var form = new DevicePanel.PanelFangyueFreshAirButtonSettionForm();
|
| | | var form = new DevicePanel.PanelSettionWithSourceForm();
|
| | | form.AddForm(device);
|
| | | }
|
| | | else
|
| | |
| | |
|
| | | if (device.Type == DeviceType.FreshAir || device.Type == DeviceType.Thermostat)
|
| | | {
|
| | | var form = new DevicePanel.PanelSimpleEnvironmentButtonSettionForm();
|
| | | var form = new DevicePanel.PanelSettionWithSourceForm();
|
| | | form.AddForm(device);
|
| | | }
|
| | | else
|
| | |
| | | form.AddForm(device, true);
|
| | | }
|
| | | }
|
| | | //简约环境面板的按键配置
|
| | | //简约多功能面板的按键配置
|
| | | else if (deviceEnumInfo.ConcreteType == DeviceConcreteType.ButtonPanel_SimpleMultifunction)
|
| | | {
|
| | | var form = new DeviceFunctionSettionForm();
|
| | |
| | | }
|
| | | //如果是在线的
|
| | | var nowGateway = HdlGatewayLogic.Current.GetLocalGateway(GatewayResourse.NowSelectGatewayId);
|
| | | if (HdlGatewayLogic.Current.CheckGatewayOnlineByFlag(nowGateway) == true)
|
| | | if (HdlGatewayLogic.Current.CheckGatewayOnlineByMemory(nowGateway) == true)
|
| | | {
|
| | | //检测广播到的这个网关是否拥有住宅ID
|
| | | ZbGateway realWay = null;
|
| | |
| | | ProgressBar.Close();
|
| | | if (result2 == -1)
|
| | | {
|
| | | HdlThreadLogic.Current.RunMain(() =>
|
| | | {
|
| | | //隐藏下拉刷新特效
|
| | | listView.EndHeaderRefreshing();
|
| | | });
|
| | | return;
|
| | | }
|
| | | }
|
| | |
| | | }
|
| | |
|
| | | //获取全部设备
|
| | | int result = LocalDevice.Current.SetDeviceToMemmoryByGateway(nowGateway, false);
|
| | | int result = LocalDevice.Current.SetDeviceToMemmoryByGateway(nowGateway.GwId, false);
|
| | | if (this.Parent == null)
|
| | | {
|
| | | return;
|
| | |
| | | {
|
| | | if (this.gatewayViewRow != null && this.gatewayViewRow.zbGatewayId == selectGwId)
|
| | | {
|
| | | bool online = HdlGatewayLogic.Current.CheckGatewayOnlineByFlag(zbGateway);
|
| | | bool online = HdlGatewayLogic.Current.CheckGatewayOnlineByMemory(zbGateway);
|
| | | //刷新控件在线状态
|
| | | this.gatewayViewRow?.RefreshOnlineStatu();
|
| | | //根据网关在线状态刷新设备在线状态
|
| | |
| | | return;
|
| | | }
|
| | | //添加升级固件信息(成不成功都无所谓)
|
| | | var result = HdlFirmwareUpdateLogic.AddFirmwareVersionInfo(FirmwareLevelType.ZigbeeDevice, ota.HwVersion.ToString(), ota.ImgTypeId.ToString());
|
| | | var result = HdlFirmwareUpdateLogic.AddFirmwareVersionInfo(FirmwareLevelType.A设备, ota.HwVersion.ToString(), ota.ImgTypeId.ToString());
|
| | |
|
| | | //获取设备最新版本
|
| | | var deviceFirmware = HdlFirmwareUpdateLogic.GetFirmwareMostVersionInfo(FirmwareLevelType.ZigbeeDevice,
|
| | | var deviceFirmware = HdlFirmwareUpdateLogic.GetFirmwareMostVersionInfo(FirmwareLevelType.A设备,
|
| | | ota.HwVersion.ToString(),
|
| | | ota.ImgTypeId.ToString(),
|
| | | ota.ImgVersion);
|
| | |
| | | }
|
| | | });
|
| | | }
|
| | | });
|
| | | }, ShowErrorMode.NO);
|
| | | }
|
| | |
|
| | | #endregion
|
| | |
| | | /// </summary>
|
| | | public override int FormActionAgainEvent()
|
| | | {
|
| | | if (GatewayResourse.AppOldSelectGatewayId != this.gatewayViewRow.zbGatewayId)
|
| | | {
|
| | | //这个网关被整掉了,需要重新初始化界面
|
| | | this.nowActionDeviceMac = null;
|
| | | this.oldShowRightMuneRow = null;
|
| | | //重新选择网关
|
| | | HdlGatewayLogic.Current.RefreshAppOldSelectGatewayId();
|
| | |
|
| | | //初始化界面
|
| | | this.InitMiddleFrame();
|
| | |
|
| | | return 1;
|
| | | }
|
| | |
|
| | | if (this.nowActionDeviceMac != null)
|
| | | {
|
| | | //刷新指定设备行的信息
|
| | |
| | | /// </summary>
|
| | | private NormalViewControl btnName = null;
|
| | | /// <summary>
|
| | | /// 在线状态
|
| | | /// 在线状态(初始状态为在线)
|
| | | /// </summary>
|
| | | public bool isOnline = false;
|
| | | public bool isOnline = true;
|
| | |
|
| | | /// <summary>
|
| | | /// 自定义网关控件
|
| | |
| | | {
|
| | | btnName.Text = HdlGatewayLogic.Current.GetGatewayName(zbway);
|
| | | //在线状态
|
| | | this.isOnline = HdlGatewayLogic.Current.CheckGatewayOnlineByFlag(zbway);
|
| | | if (this.isOnline == false)
|
| | | {
|
| | | btnName.TextColor = UserCenterColor.Current.TextGrayColor1;
|
| | | }
|
| | | //this.isOnline = HdlGatewayLogic.Current.CheckGatewayOnlineByMemory(zbway);
|
| | | //if (this.isOnline == false)
|
| | | //{
|
| | | // btnName.TextColor = UserCenterColor.Current.TextGrayColor1;
|
| | | //}
|
| | | }
|
| | | else
|
| | | {
|
| | |
| | | return;
|
| | | }
|
| | | //在线状态
|
| | | bool statu = HdlGatewayLogic.Current.CheckGatewayOnlineByFlag(zbway);
|
| | | bool statu = HdlGatewayLogic.Current.CheckGatewayOnlineByMemory(zbway);
|
| | | if (this.isOnline != statu)
|
| | | {
|
| | | this.isOnline = statu;
|
| | |
| | | btnName.Height = Application.GetRealHeight(60);
|
| | | btnName.TextSize = 15;
|
| | | btnName.Y = Application.GetRealHeight(57);
|
| | | btnName.Text = "小度小度";
|
| | | btnName.Text = "智能音箱";
|
| | |
|
| | | this.AddRightArrow();
|
| | | this.AddMostRightView("", 300, false).Name = "smartSoundLayout";
|