From 33c75f1b7dbc5ed934a91bea8eacd83dbb94b9a6 Mon Sep 17 00:00:00 2001 From: schangxiang@126.com <schangxiang@126.com> Date: 周一, 09 12月 2024 10:41:24 +0800 Subject: [PATCH] 2 --- SDA/iWareSda/Devices/4-Station/StationService/StationService.cs | 65 ++++++++++++++++++++++++++++++++ 1 files changed, 65 insertions(+), 0 deletions(-) diff --git a/SDA/iWareSda/Devices/4-Station/StationService/StationService.cs b/SDA/iWareSda/Devices/4-Station/StationService/StationService.cs index 260d089..34f3225 100644 --- a/SDA/iWareSda/Devices/4-Station/StationService/StationService.cs +++ b/SDA/iWareSda/Devices/4-Station/StationService/StationService.cs @@ -405,6 +405,38 @@ } } + /// <summary> + /// 鍐橮LC bool + /// </summary> + /// <param name="deviceId"></param> + /// <param name="dbAddress"></param> + /// <param name="value"></param> + /// <returns></returns> + public SdaResEntity WriteBoolPlcData(int deviceId, string dbAddress, bool value) + { + SdaResEntity _SdaResEntity = new SdaResEntity(); + try + { + var StationResult = Station_CacheEntity.GetDeviceObj(deviceId); + if (!StationResult.result) + { + return StationResult; + } + var Station = StationResult.resData as StationEntity; + + string msg = ""; + var result = Station.WriteBoolPlcData(dbAddress, value, out msg); + _SdaResEntity.result = result; + _SdaResEntity.resMsg = msg; + return _SdaResEntity; + } + catch (Exception ex) + { + _SdaResEntity.result = false; + _SdaResEntity.resMsg = ex.Message; + return _SdaResEntity; + } + } /// <summary> /// 鍐欏叆榻愬缁撴灉銆佽В鏋愮粨鏋� @@ -751,6 +783,39 @@ } /// <summary> + /// 鍐欏叆 浜哄伐鏀捐 + /// </summary> + /// <param name="deviceId"></param> + /// <param name="value"></param> + /// <param name="stationCode"></param> + /// <returns></returns> + public SdaResEntity WriteStation_PersonAllow(int deviceId, bool value, string stationCode) + { + SdaResEntity _SdaResEntity = new SdaResEntity(); + try + { + var StationResult = Station_CacheEntity.GetDeviceObj(deviceId); + if (!StationResult.result) + { + return StationResult; + } + var Station = StationResult.resData as StationEntity; + + string msg = ""; + var result = Station.WriteStation_PersonAllow(stationCode, value, out msg); + _SdaResEntity.result = result; + _SdaResEntity.resMsg = msg; + return _SdaResEntity; + } + catch (Exception ex) + { + _SdaResEntity.result = false; + _SdaResEntity.resMsg = ex.Message; + return _SdaResEntity; + } + } + + /// <summary> /// 鍐欏叆鍑哄簱浠诲姟淇℃伅 /// </summary> /// <param name="deviceId"></param> -- Gitblit v1.9.3