| | |
| | | this.ShowProgressBar();
|
| | | foreach (var epoint in dicDeviceSaveName.Keys)
|
| | | {
|
| | | var device = HdlDeviceCommonLogic.Current.GetDevice(deviceObj.DeviceAddr, epoint);
|
| | | var device = Common.LocalDevice.Current.GetDevice(deviceObj.DeviceAddr, epoint);
|
| | | if (device == null || dicDeviceSaveName[epoint] == string.Empty)
|
| | | {
|
| | | //不能允许空白名字
|
| | | continue;
|
| | | }
|
| | | string newName = dicDeviceSaveName[epoint];
|
| | | string oldName = HdlDeviceCommonLogic.Current.GetDeviceEpointName(device);
|
| | | string oldName = Common.LocalDevice.Current.GetDeviceEpointName(device);
|
| | | if (oldName != newName)
|
| | | {
|
| | | //设备名称修改
|
| | | var result = HdlDeviceCommonLogic.Current.ReName(device, newName);
|
| | | var result = Common.LocalDevice.Current.ReName(device, newName);
|
| | | if (result == false)
|
| | | {
|
| | | //关闭
|
| | |
| | | {
|
| | | this.listview.RemoveAll();
|
| | |
|
| | | string nameValue = HdlDeviceCommonLogic.Current.GetDeviceEpointName(nowSelectDevice);
|
| | | string nameValue = Common.LocalDevice.Current.GetDeviceEpointName(nowSelectDevice);
|
| | | if (dicDeviceSaveName.ContainsKey(nowSelectDevice.DeviceEpoint) == true)
|
| | | {
|
| | | nameValue = dicDeviceSaveName[nowSelectDevice.DeviceEpoint];
|
| | |
| | | btnDeviceName.AddBottomLine();
|
| | | btnDeviceName.txtInput.FinishInputEvent += () =>
|
| | | {
|
| | | string oldName = HdlDeviceCommonLogic.Current.GetDeviceEpointName(nowSelectDevice);
|
| | | string oldName = Common.LocalDevice.Current.GetDeviceEpointName(nowSelectDevice);
|
| | | if (btnDeviceName.Text.Trim() == string.Empty)
|
| | | {
|
| | | //将名字还原
|
| | |
| | | if (oldName != btnDeviceName.Text.Trim())
|
| | | {
|
| | | //设备名称修改
|
| | | var result = HdlDeviceCommonLogic.Current.ReName(nowSelectDevice, btnDeviceName.Text.Trim());
|
| | | var result = Common.LocalDevice.Current.ReName(nowSelectDevice, btnDeviceName.Text.Trim());
|
| | | if (result == false)
|
| | | {
|
| | | return;
|
| | |
| | | private void InitTopRightMenu()
|
| | | {
|
| | | //检测此回路是否拥有定位功能
|
| | | if (HdlDeviceCommonLogic.Current.DeviceIsCanFixedPosition(nowSelectDevice) == false)
|
| | | if (Common.LocalDevice.Current.DeviceIsCanFixedPosition(nowSelectDevice) == false)
|
| | | {
|
| | | return;
|
| | | }
|
| | |
| | | frame.AddRowMenu(deviceMenu, "Item/FixedPosition.png", "Item/FixedPositionSelected.png", () =>
|
| | | {
|
| | | //发送定位功能
|
| | | HdlDeviceCommonLogic.Current.SetFixedPositionCommand(nowSelectDevice);
|
| | | Common.LocalDevice.Current.SetFixedPositionCommand(nowSelectDevice);
|
| | | });
|
| | | }
|
| | |
|
| | |
| | | private void AddBackLightRow()
|
| | | {
|
| | | //河东设备才会开启此选项
|
| | | if (HdlDeviceCommonLogic.Current.IsHdlDevice(nowSelectDevice) == true)
|
| | | if (Common.LocalDevice.Current.IsHdlDevice(nowSelectDevice) == true)
|
| | | {
|
| | | //背光灯
|
| | | string caption = Language.StringByID(R.MyInternationalizationString.uBackLight);
|
| | |
| | | {
|
| | | List<CommonDevice> listNewDevice = new List<CommonDevice> { };
|
| | | listNewDevice.Add((Panel)nowSelectDevice);
|
| | | var deviceEnumInfo = HdlDeviceCommonLogic.Current.GetMyDeviceEnumInfo(listNewDevice);
|
| | | var deviceEnumInfo = Common.LocalDevice.Current.GetMyDeviceEnumInfo(listNewDevice);
|
| | | //如果设备是方悦开控设备,背光灯页需要滑动且有接近感应功能
|
| | | if (deviceEnumInfo.ConcreteType == DeviceConcreteType.ButtonPanel_FangyueTwo
|
| | | || deviceEnumInfo.ConcreteType == DeviceConcreteType.ButtonPanel_FangyueFour
|
| | |
| | | private void InitDeviceEpointIcon(VerticalFrameControl listBackControl)
|
| | | {
|
| | | bool hadDevice = false;
|
| | | var listDevice = HdlDeviceCommonLogic.Current.GetDevicesByMac(deviceObj.DeviceAddr);
|
| | | var listDevice = Common.LocalDevice.Current.GetDevicesByMac(deviceObj.DeviceAddr);
|
| | | var listOffSwitch = new List<CommonDevice>();
|
| | | foreach (var device in listDevice)
|
| | | {
|
| | |
| | | nowContr.TextColor = 0xfffb744a;
|
| | |
|
| | | nowSelectControl = nowContr;
|
| | | nowSelectDevice = HdlDeviceCommonLogic.Current.GetDevice(deviceObj.DeviceAddr, Convert.ToInt32(nowContr.Text.Replace("BUTTON", string.Empty)));
|
| | | nowSelectDevice = Common.LocalDevice.Current.GetDevice(deviceObj.DeviceAddr, Convert.ToInt32(nowContr.Text.Replace("BUTTON", string.Empty)));
|
| | |
|
| | | //重新初始化菜单行
|
| | | this.InitMenuRow();
|