2
schangxiang@126.com
2024-12-08 09d0a68dcc8a48a79e472b87c4aa3c90e9770154
SDA/iWareSda/Devices/4-Station/StationModel/StationEntity.cs
@@ -750,6 +750,44 @@
                return false;
            }
        }
        /// <summary>
        /// 写入 人工放行
        /// </summary>
        /// <param name="stationCode"></param>
        /// <param name="value"></param>
        /// <param name="msg"></param>
        /// <returns></returns>
        public bool WriteStation_PersonAllow(string stationCode, bool value, out string msg)
        {
            try
            {
                msg = "";
                //var stationObj = this.DBBlockForWrite.W_StationForWriteCommList.Where(x => x.StationCode == stationCode).FirstOrDefault();
                //var view_stationObj = this.View.W_StationForWriteCommList.Where(x => x.StationCode == stationCode).FirstOrDefault();
                //MessageModel b2 = this.plcService.WriteValuePoint(stationObj.W_PersonAllow, value, view_stationObj.W_PersonAllow);
                var stationObj = this.DBBlockForRead.R_StationForReadCommList.Where(x => x.StationCode == stationCode).FirstOrDefault();
                var view_stationObj = this.View.R_StationForReadCommList.Where(x => x.StationCode == stationCode).FirstOrDefault();
                MessageModel b2 = this.plcService.WriteValuePoint(stationObj.R_ReqParseData, value, view_stationObj.R_ReqParseData);
                if (!b2.result)
                {
                    msg = string.Format("向Station" + stationCode + " 写入 人工放行 地址{0} 写  " + value + "失败,返回结果:" + b2.resMsg,
                        stationObj.R_ReqParseData);
                    return false;
                }
                return true;
            }
            catch (Exception ex)
            {
                msg = ex.Message;
                var logcontext = string.Format("向Statio 人工放行 出现异常:" + JsonConvert.SerializeObject(ex),
                        "");
                Log4NetHelper.WriteErrorLog(Station_CacheEntity.curLogType, logcontext, ex);
                return false;
            }
        }
        public bool WriteSurround_FinishACK(string stationCode, bool value, out string msg)
        {
            try