| | |
| | | public void ShowForm(string deviceMac)
|
| | | {
|
| | | this.listNewDevice = Common.LocalDevice.Current.GetDevicesByMac(deviceMac);
|
| | | if (listNewDevice.Count == 0)
|
| | | {
|
| | | //对应单纯只有200回路的设备
|
| | | listNewDevice.Add(Common.LocalDevice.Current.GetOTADevice(deviceMac));
|
| | | }
|
| | |
|
| | | //设置标题信息
|
| | | base.SetTitleText(Language.StringByID(R.MyInternationalizationString.uAddDevice));
|
| | |
| | | {
|
| | | foreach (var device in this.listNewDevice)
|
| | | {
|
| | | if (device is OTADevice)
|
| | | {
|
| | | continue;
|
| | | }
|
| | | var room = Common.Room.CurrentRoom.GetRoomByDevice(device);
|
| | | string mainKeys = Common.LocalDevice.Current.GetDeviceMainKeys(device);
|
| | | if (room == null)
|
| | |
| | | this.saveDefultName = string.Empty;
|
| | |
|
| | | //如果它的回路只有一个的话,则在设备上报的时候,修改MAC名字之后,连同端点名字也一起修改
|
| | | if (this.listNewDevice.Count == 1)
|
| | | if (this.listNewDevice.Count == 1 && (this.listNewDevice[0] is OTADevice) == false)
|
| | | {
|
| | | //修改端点名字
|
| | | result = await Common.LocalDevice.Current.ReName(this.listNewDevice[0], deviceName, mode);
|
| | |
| | | {
|
| | | foreach (var device in this.listNewDevice)
|
| | | {
|
| | | if (Common.LocalDevice.Current.GetSimpleEpointName(device) != string.Empty)
|
| | | if ((device is OTADevice) || Common.LocalDevice.Current.GetSimpleEpointName(device) != string.Empty)
|
| | | {
|
| | | //有名字不处理
|
| | | continue;
|