| | |
| | | };
|
| | | }
|
| | |
|
| | | #endregion
|
| | | #endregion
|
| | |
|
| | | #region ■ 修改名字___________________________
|
| | | #region ■ 修改名字___________________________
|
| | |
|
| | | /// <summary>
|
| | | /// 设备重命名然后打开新的画面
|
| | |
| | | /// </summary>
|
| | | private async void SetAllEpointName()
|
| | | {
|
| | | var tempValue = Common.LocalDevice.Current.GetDeviceObjectText(this.listNewDevice);
|
| | | var arry = tempValue.Split(new string[] { "(" }, StringSplitOptions.RemoveEmptyEntries);
|
| | | var objName = arry[0].Trim();
|
| | |
|
| | | //获取设备类型
|
| | | var deviceInfoType = Common.LocalDevice.Current.GetMyDeviceEnumInfo(this.listNewDevice);
|
| | | foreach (var device in this.listNewDevice)
|
| | | {
|
| | | if (Common.LocalDevice.Current.GetSimpleEpointName(device) != string.Empty)
|
| | | {
|
| | | //有名字不处理
|
| | | continue;
|
| | | }
|
| | | var epointName = objName;
|
| | | if (this.listNewDevice.Count > 1)
|
| | | {
|
| | | if (deviceInfoType.BeloneType == Common.DeviceBeloneType.A按键面板 && device.Type == DeviceType.TemperatureSensor)
|
| | | {
|
| | | //面板的最后一个回路是温度传感器
|
| | | epointName += Language.StringByID(R.MyInternationalizationString.uDeviceBelongId11);
|
| | | }
|
| | | else if (deviceInfoType.ConcreteType == Common.DeviceConcreteType.Sensor_Pir)
|
| | | {
|
| | | //pir传感器,它又搞特殊东西,传感器自身用自己的名字,继电器回路的话……
|
| | | if (device.Type == DeviceType.OnOffOutput)
|
| | | {
|
| | | epointName += Language.StringByID(R.MyInternationalizationString.uDeviceBelongId2300);
|
| | | }
|
| | | }
|
| | | else
|
| | | {
|
| | | //XXXXX(N回路)
|
| | | epointName += "(" + device.DeviceEpoint + Language.StringByID(R.MyInternationalizationString.uDeviceCircuit) + ")";
|
| | | }
|
| | | }
|
| | | //获取端点名字
|
| | | var epointName = Common.LocalDevice.Current.GetDeviceEpointName(device);
|
| | | await Common.LocalDevice.Current.ReName(device, epointName, ShowErrorMode.NO);
|
| | | }
|
| | | }
|
| | |
|
| | | #endregion
|
| | | #endregion
|
| | |
|
| | | #region ■ 画面关闭___________________________
|
| | | #region ■ 画面关闭___________________________
|
| | |
|
| | | /// <summary>
|
| | | /// 画面关闭
|
| | |
| | |
|
| | | base.CloseFormBefore();
|
| | | }
|
| | | #endregion
|
| | | #endregion
|
| | | }
|
| | | }
|