| | |
| | | public void ShowForm(CommonDevice i_device)
|
| | | {
|
| | | this.deviceObj = i_device;
|
| | | var listDevice = Common.LocalDevice.Current.GetDevicesByMac(deviceObj.DeviceAddr);
|
| | | var listDevice = HdlDeviceCommonLogic.Current.GetDevicesByMac(deviceObj.DeviceAddr);
|
| | | //获取这一堆设备时属于什么类型的
|
| | | this.deviceEnumInfo = Common.LocalDevice.Current.GetMyDeviceEnumInfo(listDevice);
|
| | | this.deviceEnumInfo = HdlDeviceCommonLogic.Current.GetMyDeviceEnumInfo(listDevice);
|
| | |
|
| | | //设置头部信息
|
| | | base.SetTitleText(Language.StringByID(R.MyInternationalizationString.uDryContactSettion));
|
| | |
| | | this.ShowProgressBar();
|
| | | foreach (var epoint in dicDeviceSaveName.Keys)
|
| | | {
|
| | | var device = Common.LocalDevice.Current.GetDevice(deviceObj.DeviceAddr, epoint);
|
| | | var device = HdlDeviceCommonLogic.Current.GetDevice(deviceObj.DeviceAddr, epoint);
|
| | | if (device == null || dicDeviceSaveName[epoint] == string.Empty)
|
| | | {
|
| | | //不能允许空白名字
|
| | | continue;
|
| | | }
|
| | | string newName = dicDeviceSaveName[epoint];
|
| | | string oldName = Common.LocalDevice.Current.GetDeviceEpointName(device);
|
| | | string oldName = HdlDeviceCommonLogic.Current.GetDeviceEpointName(device);
|
| | | if (oldName != newName)
|
| | | {
|
| | | //设备名称修改
|
| | | var result = Common.LocalDevice.Current.ReName(device, newName);
|
| | | var result = HdlDeviceCommonLogic.Current.ReName(device, newName);
|
| | | if (result == false)
|
| | | {
|
| | | //关闭
|
| | |
| | |
|
| | | //干接点备注
|
| | | string caption = Language.StringByID(R.MyInternationalizationString.uDryContactNote);
|
| | | string nameValue = Common.LocalDevice.Current.GetDeviceEpointName(nowSelectDevice);
|
| | | string nameValue = HdlDeviceCommonLogic.Current.GetDeviceEpointName(nowSelectDevice);
|
| | | if (dicDeviceSaveName.ContainsKey(nowSelectDevice.DeviceEpoint) == true)
|
| | | {
|
| | | nameValue = dicDeviceSaveName[nowSelectDevice.DeviceEpoint];
|
| | |
| | | {
|
| | | frameDeviceName.txtInput.FinishInputEvent += () =>
|
| | | {
|
| | | string oldName = Common.LocalDevice.Current.GetDeviceEpointName(nowSelectDevice);
|
| | | string oldName = HdlDeviceCommonLogic.Current.GetDeviceEpointName(nowSelectDevice);
|
| | | if (frameDeviceName.Text.Trim() == string.Empty)
|
| | | {
|
| | | //将名字还原
|
| | |
| | | if (oldName != frameDeviceName.Text.Trim())
|
| | | {
|
| | | //设备名称修改
|
| | | var result = Common.LocalDevice.Current.ReName(nowSelectDevice, frameDeviceName.Text.Trim());
|
| | | var result = HdlDeviceCommonLogic.Current.ReName(nowSelectDevice, frameDeviceName.Text.Trim());
|
| | | if (result == false)
|
| | | {
|
| | | return;
|
| | |
| | | //3路继电器或者1路调光器第七回路的配置信息
|
| | | List<CommonDevice.AttributeDataObj> listRelayInfo7 = null;
|
| | |
|
| | | bool isHdlDevice = Common.LocalDevice.Current.IsHdlDevice(nowSelectDevice);
|
| | | bool isHdlDevice = HdlDeviceCommonLogic.Current.IsHdlDevice(nowSelectDevice);
|
| | | //河东设备才会开启此选项
|
| | | if (isHdlDevice == true)
|
| | | {
|
| | |
| | | private void InitTopRightMenu()
|
| | | {
|
| | | //检测此回路是否拥有定位功能
|
| | | if (Common.LocalDevice.Current.DeviceIsCanFixedPosition(nowSelectDevice) == false
|
| | | if (HdlDeviceCommonLogic.Current.DeviceIsCanFixedPosition(nowSelectDevice) == false
|
| | | || Common.Config.Instance.Home.IsShowTemplate == true)
|
| | | {
|
| | | return;
|
| | |
| | | int menuCount = 1;
|
| | | string deviceMenu = string.Empty;
|
| | | //检测此回路是否拥有定位功能
|
| | | bool canTest = Common.LocalDevice.Current.DeviceIsCanFixedPosition(nowSelectDevice);
|
| | | bool canTest = HdlDeviceCommonLogic.Current.DeviceIsCanFixedPosition(nowSelectDevice);
|
| | | //if (canTest == true)
|
| | | //{
|
| | | // menuCount = 2;
|
| | |
| | | frame.AddRowMenu(deviceMenu, "Item/FixedPosition.png", "Item/FixedPositionSelected.png", () =>
|
| | | {
|
| | | //发送定位功能
|
| | | Common.LocalDevice.Current.SetFixedPositionCommand(nowSelectDevice);
|
| | | HdlDeviceCommonLogic.Current.SetFixedPositionCommand(nowSelectDevice);
|
| | | });
|
| | | }
|
| | |
|
| | |
| | | private void AddBackLightRow()
|
| | | {
|
| | | //三路继电器,或者一路调光器 的时候才能开启此选项
|
| | | var listDevice = Common.LocalDevice.Current.GetDevicesByMac(deviceObj.DeviceAddr);
|
| | | var myType = Common.LocalDevice.Current.GetMyDeviceEnumInfo(listDevice);
|
| | | var listDevice = HdlDeviceCommonLogic.Current.GetDevicesByMac(deviceObj.DeviceAddr);
|
| | | var myType = HdlDeviceCommonLogic.Current.GetMyDeviceEnumInfo(listDevice);
|
| | |
|
| | | //欧标2路5A没有背光灯
|
| | | if (myType.ConcreteType == DeviceConcreteType.Relay_ThreeLoad
|
| | |
| | | if (myType.ConcreteType == DeviceConcreteType.Relay_NationalThreeLoadTenA
|
| | | || myType.ConcreteType == DeviceConcreteType.Relay_SevenLoadInOutPutDryContact)
|
| | | {
|
| | | //国标3路10A继电器小模块 或者 7路干接点输入输出模块
|
| | | //国标3路10A继电器小模块 或者 欧标2路5A继电器小模块 或者 7路干接点输入输出模块
|
| | | var form = new DeviceRelay.RelayNationalBackLightSettionForm();
|
| | | form.AddForm(deviceObj.DeviceAddr);
|
| | | }
|
| | |
| | | private List<List<CommonDevice>> GetAllDeviceGroup()
|
| | | {
|
| | | bool hadDevice = false;
|
| | | var listDevice = Common.LocalDevice.Current.GetDevicesByMac(deviceObj.DeviceAddr);
|
| | | var listDevice = HdlDeviceCommonLogic.Current.GetDevicesByMac(deviceObj.DeviceAddr);
|
| | | var listRelay = new List<CommonDevice>();
|
| | | foreach (var device in listDevice)
|
| | | {
|
| | |
| | | nowContr.TextColor = UserCenterColor.Current.TextColor1;
|
| | |
|
| | | nowSelectControl = nowContr;
|
| | | nowSelectDevice = Common.LocalDevice.Current.GetDevice(deviceObj.DeviceAddr, Convert.ToInt32(nowContr.Name.Replace("btn", string.Empty)));
|
| | | nowSelectDevice = HdlDeviceCommonLogic.Current.GetDevice(deviceObj.DeviceAddr, Convert.ToInt32(nowContr.Name.Replace("btn", string.Empty)));
|
| | |
|
| | | //重新初始化菜单行
|
| | | this.InitMenuRow();
|