예제 #1
0
        public override bool send_Str37(string cmd_id, CMDCancelType actType)
        {
            //加入StackTrace,來找出他會下達Cancel的入口 by Kevin
            try
            {
                StackTrace st        = new StackTrace(true);
                string     trace_msg = SCUtility.ShowCallerInfo(st, $"Call EQTcpIpMapAction.send_Str37(),cmd id:{cmd_id},act type:{actType}");
                LogHelper.Log(logger: logger, LogLevel: LogLevel.Info, Class: nameof(EQTcpIpMapAction), Device: "OHxC",
                              Data: trace_msg,
                              VehicleID: eqpt.VEHICLE_ID,
                              Details: st.ToString(),
                              CarrierID: eqpt.CST_ID);
            }
            catch { }
            bool isScuess = false;

            try
            {
                string rtnMsg = string.Empty;
                ID_37_TRANS_CANCEL_REQUEST   stSend;
                ID_137_TRANS_CANCEL_RESPONSE stRecv;
                stSend = new ID_37_TRANS_CANCEL_REQUEST()
                {
                    CmdID   = cmd_id,
                    ActType = actType
                };

                WrapperMessage wrapper = new WrapperMessage
                {
                    ID             = VHMSGIF.ID_TRANS_CANCEL_REQUEST,
                    TransCancelReq = stSend
                };

                SCUtility.RecodeReportInfo(eqpt.VEHICLE_ID, 0, stSend);
                com.mirle.iibg3k0.ttc.Common.TrxTcpIp.ReturnCode result = snedRecv(wrapper, out stRecv, out rtnMsg);
                SCUtility.RecodeReportInfo(eqpt.VEHICLE_ID, 0, stRecv, result.ToString());
                if (result == TrxTcpIp.ReturnCode.Normal)
                {
                    if (stRecv.ReplyCode == 0)
                    {
                        isScuess = true;
                    }
                    else
                    {
                        isScuess = false;
                    }
                }
                else
                {
                    isScuess = false;
                }
            }
            catch (Exception ex)
            {
                logger.Error(ex, "Exception");
            }
            return(isScuess);
        }