| | |
| | | this.listview = tableContr.InitControl(bodyFrameLayout, Language.StringByID(R.MyInternationalizationString.uInfoEditor), 369, 1368);
|
| | |
|
| | | //图片
|
| | | var btnPic = new DeviceInfoIconControl(listNewDevice[0]);
|
| | | var btnPic = new DeviceInfoIconControl();
|
| | | btnPic.Y = Application.GetRealHeight(92);
|
| | | btnPic.Gravity = Gravity.CenterHorizontal;
|
| | | bodyFrameLayout.AddChidren(btnPic);
|
| | | btnPic.InitControl();
|
| | | btnPic.InitControl(listNewDevice[0]);
|
| | |
|
| | | //设备备注
|
| | | string caption = Language.StringByID(R.MyInternationalizationString.uDeviceNote);
|
| | |
| | | }
|
| | | else
|
| | | {
|
| | | //添加【绑定目标】行(pir传感器专用)
|
| | | this.AddPirSensorBindRow();
|
| | | //添加【方向与限位】行(开合帘,卷帘专用)
|
| | | this.AddDirectionAndLimitRow();
|
| | | //添加【手拉控制】行(开合帘专用)
|
| | | this.AddHandPullControlRow();
|
| | | //添加【按键设置】行(面板专用)
|
| | | this.AddPanelSettionRow();
|
| | | //添加【功能设置】行
|
| | |
| | | btnFunction.ButtonClickEvent += (sender, e) =>
|
| | | {
|
| | | var form = new DevicePanel.PanelButtonSettionForm();
|
| | | form.AddForm(listNewDevice[0].DeviceAddr);
|
| | | form.AddForm(listNewDevice[0]);
|
| | | };
|
| | | }
|
| | |
|
| | | #endregion
|
| | |
|
| | | #region ■ 功能设置(通用)_____________________
|
| | |
|
| | | /// <summary>
|
| | | /// 添加【功能设置】行
|
| | | /// </summary>
|
| | | private void AddFunctionSettionRow()
|
| | | {
|
| | | //功能设置
|
| | | string caption = Language.StringByID(R.MyInternationalizationString.uFunctionSettingUp);
|
| | | var btnFunction = new FrameRowControl(listview.rowSpace / 2);
|
| | | listview.AddChidren(btnFunction);
|
| | | btnFunction.AddLeftCaption(caption, 600);
|
| | | //向右图标
|
| | | btnFunction.AddRightArrow();
|
| | | //底线
|
| | | btnFunction.AddBottomLine();
|
| | | btnFunction.ButtonClickEvent += (sender, e) =>
|
| | | {
|
| | | //河东的面板设备
|
| | | if (deviceEnumInfo.BeloneType == DeviceBeloneType.A按键面板 && deviceEnumInfo.IsHdlDevice == true)
|
| | | {
|
| | | var form = new DevicePanel.PanelFunctionSettionForm();
|
| | | form.AddForm(listNewDevice[0].DeviceAddr);
|
| | | }
|
| | | else
|
| | | {
|
| | | var form = new DeviceRelay.DeviceFunctionSettionForm();
|
| | | form.AddForm(listNewDevice[0].DeviceAddr);
|
| | | }
|
| | | };
|
| | | }
|
| | |
|
| | | #endregion;
|
| | |
|
| | | #region ■ 干接点设置(干接点)_________________
|
| | |
|
| | |
| | | btnBackLight.AddBottomLine();
|
| | | btnBackLight.ButtonClickEvent += (sender, e) =>
|
| | | {
|
| | | var form = new DeviceRelay.DeviceDryContactSettionForm();
|
| | | form.AddForm(listNewDevice[0].DeviceAddr);
|
| | | var form = new DeviceDryContactSettionForm();
|
| | | form.AddForm(listNewDevice[0]);
|
| | | };
|
| | | }
|
| | |
|
| | | #endregion
|
| | |
|
| | | #region ■ 绑定目标(pir传感器专用)____________
|
| | |
|
| | | /// <summary>
|
| | | /// 添加【绑定目标】行(pir传感器专用)
|
| | | /// </summary>
|
| | | private void AddPirSensorBindRow()
|
| | | {
|
| | | if (this.deviceEnumInfo.ConcreteType != DeviceConcreteType.Sensor_Pir)
|
| | | {
|
| | | return;
|
| | | }
|
| | | //绑定目标
|
| | | string caption = Language.StringByID(R.MyInternationalizationString.uBindTargets);
|
| | | var btnFunction = new FrameRowControl(listview.rowSpace / 2);
|
| | | listview.AddChidren(btnFunction);
|
| | | btnFunction.AddLeftCaption(caption, 600);
|
| | | //向右图标
|
| | | btnFunction.AddRightArrow();
|
| | | //底线
|
| | | btnFunction.AddBottomLine();
|
| | | btnFunction.ButtonClickEvent += (sender, e) =>
|
| | | {
|
| | | var form = new DevicePirSensor.PirSensorBindTargetSettionForm();
|
| | | form.AddForm((IASZone)this.listNewDevice[0]);
|
| | | };
|
| | | }
|
| | |
|
| | | #endregion;
|
| | |
|
| | | #region ■ 功能设置(通用)_____________________
|
| | |
|
| | | /// <summary>
|
| | | /// 添加【功能设置】行
|
| | | /// </summary>
|
| | | private void AddFunctionSettionRow()
|
| | | {
|
| | | //功能设置
|
| | | string caption = Language.StringByID(R.MyInternationalizationString.uFunctionSettingUp);
|
| | | var btnFunction = new FrameRowControl(listview.rowSpace / 2);
|
| | | listview.AddChidren(btnFunction);
|
| | | btnFunction.AddLeftCaption(caption, 600);
|
| | | //向右图标
|
| | | btnFunction.AddRightArrow();
|
| | | //底线
|
| | | btnFunction.AddBottomLine();
|
| | | btnFunction.ButtonClickEvent += (sender, e) =>
|
| | | {
|
| | | //河东的面板设备
|
| | | if (deviceEnumInfo.BeloneType == DeviceBeloneType.A按键面板 && deviceEnumInfo.IsHdlDevice == true)
|
| | | {
|
| | | var form = new DevicePanel.PanelFunctionSettionForm();
|
| | | form.AddForm(listNewDevice[0]);
|
| | | }
|
| | | else
|
| | | {
|
| | | var form = new DeviceFunctionSettionForm();
|
| | | form.AddForm(listNewDevice[0], false);
|
| | | }
|
| | | };
|
| | | }
|
| | |
|
| | | #endregion;
|
| | |
|
| | | #region ■ 方向与限位(窗帘)___________________
|
| | |
|
| | | /// <summary>
|
| | | /// 添加【方向与限位】行(窗帘专用)
|
| | | /// </summary>
|
| | | private void AddDirectionAndLimitRow()
|
| | | {
|
| | | if (deviceEnumInfo.BeloneType != DeviceBeloneType.A窗帘)
|
| | | {
|
| | | return;
|
| | | }
|
| | | var deviceCurtain = (Rollershade)this.listNewDevice[0];
|
| | | if (deviceCurtain.WcdType != 4 && deviceCurtain.WcdType != 0)
|
| | | {
|
| | | //开合帘,卷帘专用
|
| | | return;
|
| | | }
|
| | |
|
| | | //方向与限位
|
| | | string caption = Language.StringByID(R.MyInternationalizationString.uDirectionAndLimit);
|
| | | var btnFunction = new FrameRowControl(listview.rowSpace / 2);
|
| | | listview.AddChidren(btnFunction);
|
| | | btnFunction.AddLeftCaption(caption, 600);
|
| | | //向右图标
|
| | | btnFunction.AddRightArrow();
|
| | | //底线
|
| | | btnFunction.AddBottomLine();
|
| | | btnFunction.ButtonClickEvent += (sender, e) =>
|
| | | {
|
| | | if (deviceCurtain.WcdType == 4)
|
| | | {
|
| | | var form = new DeviceCurtain.AutoOpenDirectionAndLimitSettionForm();
|
| | | form.AddForm(deviceCurtain);
|
| | | }
|
| | | else if (deviceCurtain.WcdType == 0)
|
| | | {
|
| | | var form = new DeviceCurtain.SiphonateDirectionAndLimitSettionForm();
|
| | | form.AddForm(deviceCurtain);
|
| | | }
|
| | | };
|
| | | }
|
| | |
|
| | | #endregion;
|
| | |
|
| | | #region ■ 手拉控制(开合帘)___________________
|
| | |
|
| | | /// <summary>
|
| | | /// 添加【手拉控制】行(开合帘专用)
|
| | | /// </summary>
|
| | | private void AddHandPullControlRow()
|
| | | {
|
| | | if (deviceEnumInfo.BeloneType != DeviceBeloneType.A窗帘)
|
| | | {
|
| | | return;
|
| | | }
|
| | | var deviceCurtain = (Rollershade)this.listNewDevice[0];
|
| | | if (deviceCurtain.WcdType != 4)
|
| | | {
|
| | | //开合帘专用
|
| | | return;
|
| | | }
|
| | |
|
| | | //手拉控制
|
| | | string caption = Language.StringByID(R.MyInternationalizationString.uHandPullControl);
|
| | | var btnFunction = new FrameRowControl(listview.rowSpace / 2);
|
| | | listview.AddChidren(btnFunction);
|
| | | btnFunction.AddLeftCaption(caption, 600);
|
| | | //开关图标
|
| | | var btnSwitch = btnFunction.AddMostRightSwitchIcon();
|
| | | //底线
|
| | | btnFunction.AddBottomLine();
|
| | | btnSwitch.ButtonClickEvent += async (sender, e) =>
|
| | | {
|
| | | //切换模式
|
| | | var result = await HdlDeviceCurtainLogic.Current.SetHandPullControl(deviceCurtain, !btnSwitch.IsSelected);
|
| | | if (result == true)
|
| | | {
|
| | | btnSwitch.IsSelected = !btnSwitch.IsSelected;
|
| | | }
|
| | | };
|
| | |
|
| | | //添加属性上报监听
|
| | | string mainkeys = LocalDevice.Current.GetDeviceMainKeys(this.listNewDevice[0]);
|
| | | HdlDeviceAttributeLogic.Current.AddAttributeEvent("HandPullControl", "DeviceStatusReport", (device) =>
|
| | | {
|
| | | string checkKey = LocalDevice.Current.GetDeviceMainKeys(device);
|
| | | if (mainkeys != checkKey || device.DeviceStatusReport.CluterID != 258)
|
| | | {
|
| | | return;
|
| | | }
|
| | | foreach (var attriBute in device.DeviceStatusReport.AttriBute)
|
| | | {
|
| | | if (attriBute.AttributeId == 23)
|
| | | {
|
| | | //手拉控制
|
| | | if (0 < (attriBute.AttriButeData & 0x04))
|
| | | {
|
| | | btnSwitch.IsSelected = true;
|
| | | }
|
| | | }
|
| | | }
|
| | | });
|
| | | //发送命令
|
| | | deviceCurtain.ReadCurtainDirectionAndMode();
|
| | | }
|
| | |
|
| | | #endregion;
|
| | |
|
| | | #region ■ 通用信息___________________________
|
| | |
|
| | |
| | | /// </summary>
|
| | | public override void CloseForm()
|
| | | {
|
| | | HdlDeviceAttributeLogic.Current.RemoveEvent("HandPullControl");
|
| | | //移除获取设备硬件信息的监听线程
|
| | | HdlDeviceHardInfoLogic.Current.RemoveDeviceHardInfoThread(listNewDevice[0]);
|
| | |
|