public override bool send_Str31(ID_31_TRANS_REQUEST send_gpp, out ID_131_TRANS_RESPONSE receive_gpp, out string reason)
        {
            bool isSuccess = false;

            try
            {
                WrapperMessage wrapper = new WrapperMessage
                {
                    ID       = WrapperMessage.TransReqFieldNumber,
                    TransReq = send_gpp
                };
                //SCUtility.RecodeReportInfo(eqpt.VEHICLE_ID, 0, send_gpp);
                com.mirle.iibg3k0.ttc.Common.TrxTcpIp.ReturnCode result = snedRecv(wrapper, out receive_gpp, out reason);
                //SCUtility.RecodeReportInfo(eqpt.VEHICLE_ID, 0, receive_gpp, result.ToString());
                if (result == TrxTcpIp.ReturnCode.Normal)
                {
                    isSuccess = true;
                    reason    = receive_gpp.NgReason;
                }
                else
                {
                    isSuccess = false;
                    reason    = result.ToString();
                }
                //isSuccess = result == TrxTcpIp.ReturnCode.Normal;
                //reason = receive_gpp.NgReason;
                if (isSuccess)
                {
                    isSuccess = receive_gpp.ReplyCode == 0;
                }
            }
            catch (Exception ex)
            {
                logger.Error(ex, "Exception");
                receive_gpp = null;
                reason      = "命令下達時發生錯誤!";
            }
            return(isSuccess);
        }
Пример #2
0
        public override bool send_Str91(ID_91_ALARM_RESET_REQUEST send_gpp, out ID_191_ALARM_RESET_RESPONSE receive_gpp)
        {
            bool isScuess = false;

            try
            {
                string         rtnMsg  = string.Empty;
                WrapperMessage wrapper = new WrapperMessage
                {
                    ID            = WrapperMessage.AlarmResetReqFieldNumber,
                    AlarmResetReq = send_gpp
                };
                com.mirle.iibg3k0.ttc.Common.TrxTcpIp.ReturnCode result = snedRecv(wrapper, out receive_gpp, out rtnMsg);
                isScuess = result == TrxTcpIp.ReturnCode.Normal;
            }
            catch (Exception ex)
            {
                receive_gpp = null;
                logger.Error(ex, "Exception");
            }
            return(isScuess);
        }
Пример #3
0
        public override bool send_Str71(ID_71_RANGE_TEACHING_REQUEST send_gpp, out ID_171_RANGE_TEACHING_RESPONSE receive_gpp)
        {
            bool isScuess = false;

            try
            {
                string         rtnMsg  = string.Empty;
                WrapperMessage wrapper = new WrapperMessage
                {
                    ID = VHMSGIF.ID_SECTION_TEACH_REQUEST,
                    RangeTeachingReq = send_gpp
                };
                com.mirle.iibg3k0.ttc.Common.TrxTcpIp.ReturnCode result = snedRecv(wrapper, out receive_gpp, out rtnMsg);
                isScuess = result == TrxTcpIp.ReturnCode.Normal;
            }
            catch (Exception ex)
            {
                receive_gpp = null;
                logger.Error(ex, "Exception");
            }
            return(isScuess);
        }
Пример #4
0
        public override bool sned_Str41(ID_41_MODE_CHANGE_REQ send_gpp, out ID_141_MODE_CHANGE_RESPONSE receive_gpp)
        {
            bool isScuess = false;

            try
            {
                string         rtnMsg  = string.Empty;
                WrapperMessage wrapper = new WrapperMessage
                {
                    ID            = VHMSGIF.ID_MODE_CHANGE_REQUEST,
                    ModeChangeReq = send_gpp
                };
                com.mirle.iibg3k0.ttc.Common.TrxTcpIp.ReturnCode result = snedRecv(wrapper, out receive_gpp, out rtnMsg);
                isScuess = result == TrxTcpIp.ReturnCode.Normal;
            }
            catch (Exception ex)
            {
                receive_gpp = null;
                logger.Error(ex, "Exception");
            }
            return(isScuess);
        }
Пример #5
0
        public override bool send_Str39(ID_39_PAUSE_REQUEST send_gpp, out ID_139_PAUSE_RESPONSE receive_gpp)
        {
            bool isScuess = false;

            try
            {
                string         rtnMsg  = string.Empty;
                WrapperMessage wrapper = new WrapperMessage
                {
                    ID       = WrapperMessage.PauseReqFieldNumber,
                    PauseReq = send_gpp
                };
                // SCUtility.RecodeReportInfo(eqpt.VEHICLE_ID, 0, send_gpp);
                com.mirle.iibg3k0.ttc.Common.TrxTcpIp.ReturnCode result = snedRecv(wrapper, out receive_gpp, out rtnMsg);
                //SCUtility.RecodeReportInfo(eqpt.VEHICLE_ID, 0, receive_gpp, result.ToString());
                isScuess = result == TrxTcpIp.ReturnCode.Normal;

                //ID_39_PAUSE_REQUEST stSend;
                //ID_139_PAUSE_RESPONSE stRecv;
                //stSend = new ID_39_PAUSE_REQUEST()
                //{
                //    EventType = eventType,
                //    PauseType = pauseType
                //};


                //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());
                //isScuess = result == TrxTcpIp.ReturnCode.Normal;
            }
            catch (Exception ex)
            {
                receive_gpp = null;
                logger.Error(ex, "Exception");
            }
            return(isScuess);
        }
Пример #6
0
        public override bool send_Str39(ID_39_PAUSE_REQUEST send_gpp, out ID_139_PAUSE_RESPONSE receive_gpp)
        {
            bool isScuess = false;

            try
            {
                string         rtnMsg  = string.Empty;
                WrapperMessage wrapper = new WrapperMessage
                {
                    ID       = VHMSGIF.ID_PAUSE_REQUEST,
                    PauseReq = send_gpp
                };
                com.mirle.iibg3k0.ttc.Common.TrxTcpIp.ReturnCode result = snedRecv(wrapper, out receive_gpp, out rtnMsg);
                isScuess = result == TrxTcpIp.ReturnCode.Normal &&
                           receive_gpp.ReplyCode == 0;
            }
            catch (Exception ex)
            {
                receive_gpp = null;
                logger.Error(ex, "Exception");
            }
            return(isScuess);
        }
        public override (bool isSendOK, int replyCode) send_Str37(string cmd_id, CMDCancelType actType)
        {
            bool is_scuess  = false;
            int  reply_code = 0;

            try
            {
                //由於A00的要求,希望可以在收到命令後 走完一個Section後再進行Cancel,因此先加入此Function
                //WaitPassOneSection();

                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             = WrapperMessage.TransCancelReqFieldNumber,
                    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());
                is_scuess  = result == TrxTcpIp.ReturnCode.Normal;
                reply_code = stRecv.ReplyCode;
            }
            catch (Exception ex)
            {
                logger.Error(ex, "Exception");
            }
            return(is_scuess, reply_code);
        }
Пример #8
0
        /// <summary>
        /// Handles selecting option from dropdown in chat window.
        /// </summary>
        /// <param name="option">id of selected option</param>
        public void OnDropdownOption(int option)
        {
            // reset dropdown value to make it work like a button
            FriendActionsDropdown.value = ChatDropdownOption.CANCEL;
            switch (option)
            {
            case ChatDropdownOption.SHOW_PROFILE:
                ConnectionHandler.Instance.OpenUrlAuthorized("profile/" + Uri.EscapeDataString(FriendName.text));
                break;

            case ChatDropdownOption.CHALLENGE:
                ChallengeController.Instance.Show();
                break;

            case ChatDropdownOption.OFFER_FRUITON:
                Scenes.Load(Scenes.LOCAL_TRADE_SCENE, Scenes.OFFERED_PLAYER_LOGIN, SelectedPlayerLogin);
                break;

            case ChatDropdownOption.DELETE_FRIEND:
                FriendRemoval removalMessage = new FriendRemoval
                {
                    Login = FriendName.text
                };

                WrapperMessage ws = new WrapperMessage
                {
                    FriendRemoval = removalMessage
                };
                ConnectionHandler.Instance.SendWebsocketMessage(ws);
                OnFriendRemoval(removalMessage);
                break;

            case ChatDropdownOption.CANCEL:
                return;
            }
        }
Пример #9
0
 public void OnMessage(WrapperMessage message)
 {
     // Online opponent should only receive Action messages.
     Assert.AreEqual(message.MessageCase, WrapperMessage.MessageOneofCase.Action);
     ProcessMessage(message.Action);
 }
Пример #10
0
        public override bool send_Str37(string cmd_id, CMDCancelType actType)
        {
            //加入StackTrace,來找出他會下達Cancel的入口 by Kevin //A0.01
            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
            {
                //由於A00的要求,希望可以在收到命令後 走完一個Section後再進行Cancel,因此先加入此Function
                //WaitPassOneSection();

                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);
        }
 public virtual com.mirle.iibg3k0.ttc.Common.TrxTcpIp.ReturnCode snedRecv <TSource2>(WrapperMessage wrapper, out TSource2 stRecv, out string rtnMsg)
 {
     stRecv = default(TSource2);
     rtnMsg = string.Empty;
     return(iibg3k0.ttc.Common.TrxTcpIp.ReturnCode.SendDataFail);
 }
Пример #12
0
        private void btnSend_Click(object sender, EventArgs e)
        {
            WrapperMessage wrapper = new WrapperMessage();
            EnumCmdNums    cmdNum  = (EnumCmdNums)boxAgvCmdNums.SelectedItem;

            switch (cmdNum)
            {
            case EnumCmdNums.Cmd11_CouplerInfoReport:
                break;

            case EnumCmdNums.Cmd31_TransferRequest:
                break;

            case EnumCmdNums.Cmd32_TransferCompleteResponse:
                break;

            case EnumCmdNums.Cmd35_CarrierIdRenameRequest:
                break;

            case EnumCmdNums.Cmd36_TransferEventResponse:
                break;

            case EnumCmdNums.Cmd37_TransferCancelRequest:
                break;

            case EnumCmdNums.Cmd38_GuideInfoResponse:
                break;

            case EnumCmdNums.Cmd39_PauseRequest:
                break;

            case EnumCmdNums.Cmd41_ModeChange:
                break;

            case EnumCmdNums.Cmd43_StatusRequest:
                break;

            case EnumCmdNums.Cmd45_PowerOnoffRequest:
                break;

            case EnumCmdNums.Cmd51_AvoidRequest:
                break;

            case EnumCmdNums.Cmd52_AvoidCompleteResponse:
                break;

            case EnumCmdNums.Cmd91_AlarmResetRequest:
                break;

            case EnumCmdNums.Cmd94_AlarmResponse:
                break;

            case EnumCmdNums.Cmd131_TransferResponse:
                break;

            case EnumCmdNums.Cmd132_TransferCompleteReport:
            {
                var cmdInfo = JsonConvert.DeserializeObject <ID_132_TRANS_COMPLETE_REPORT>(txtAgvCommandInfo.Text);

                wrapper.ID         = WrapperMessage.TranCmpRepFieldNumber;
                wrapper.TranCmpRep = cmdInfo;
            }
            break;

            case EnumCmdNums.Cmd134_TransferEventReport:
            {
                var cmdInfo = JsonConvert.DeserializeObject <ID_134_TRANS_EVENT_REP>(txtAgvCommandInfo.Text);

                wrapper.ID            = WrapperMessage.TransEventRepFieldNumber;
                wrapper.TransEventRep = cmdInfo;
            }
            break;

            case EnumCmdNums.Cmd135_CarrierIdRenameResponse:
                break;

            case EnumCmdNums.Cmd136_TransferEventReport:
            {
                var cmdInfo = JsonConvert.DeserializeObject <ID_136_TRANS_EVENT_REP>(txtAgvCommandInfo.Text);

                wrapper.ID = WrapperMessage.ImpTransEventRepFieldNumber;
                wrapper.ImpTransEventRep = cmdInfo;
            }
            break;

            case EnumCmdNums.Cmd137_TransferCancelResponse:
                break;

            case EnumCmdNums.Cmd138_GuideInfoRequest:
            {
                var cmdInfo = JsonConvert.DeserializeObject <ID_138_GUIDE_INFO_REQUEST>(txtAgvCommandInfo.Text);

                wrapper.ID           = WrapperMessage.GuideInfoReqFieldNumber;
                wrapper.GuideInfoReq = cmdInfo;
            }
            break;

            case EnumCmdNums.Cmd139_PauseResponse:
                break;

            case EnumCmdNums.Cmd141_ModeChangeResponse:
                break;

            case EnumCmdNums.Cmd143_StatusResponse:
                break;

            case EnumCmdNums.Cmd144_StatusReport:
            {
                var cmdInfo = JsonConvert.DeserializeObject <ID_144_STATUS_CHANGE_REP>(txtAgvCommandInfo.Text);

                wrapper.ID = WrapperMessage.StatueChangeRepFieldNumber;
                wrapper.StatueChangeRep = cmdInfo;
            }
            break;

            case EnumCmdNums.Cmd145_PowerOnoffResponse:
                break;

            case EnumCmdNums.Cmd151_AvoidResponse:
                break;

            case EnumCmdNums.Cmd152_AvoidCompleteReport:
            {
                var cmdInfo = JsonConvert.DeserializeObject <ID_144_STATUS_CHANGE_REP>(txtAgvCommandInfo.Text);

                wrapper.ID = WrapperMessage.StatueChangeRepFieldNumber;
                wrapper.StatueChangeRep = cmdInfo;
            }
            break;

            case EnumCmdNums.Cmd191_AlarmResetResponse:
            {
                var cmdInfo = JsonConvert.DeserializeObject <ID_191_ALARM_RESET_RESPONSE>(txtAgvCommandInfo.Text);

                wrapper.ID             = WrapperMessage.AlarmResetRespFieldNumber;
                wrapper.AlarmResetResp = cmdInfo;
            }
            break;

            case EnumCmdNums.Cmd194_AlarmReport:
            {
                var cmdInfo = JsonConvert.DeserializeObject <ID_194_ALARM_REPORT>(txtAgvCommandInfo.Text);

                wrapper.ID       = WrapperMessage.AlarmRepFieldNumber;
                wrapper.AlarmRep = cmdInfo;
            }
            break;

            default:
                break;
            }

            agvcConnector.SendWrapperToSchedule(wrapper, false, false);
        }
Пример #13
0
    public void OnMessage(WrapperMessage message)
    {
        StatusChange onlineStatusChange = message.StatusChange;

        Friends.Single(f => f.Login == onlineStatusChange.Login).Status = onlineStatusChange.Status;
    }
 public virtual bool snedMessage(WrapperMessage wrapper, bool isReply = false)
 {
     return(true);
 }
 public void OnMessage(WrapperMessage message)
 {
     GameManager.Instance.OnLoggedIn(message.LoggedPlayerInfo);
 }
        public void OnMessage(WrapperMessage message)
        {
            FriendRequest friendRequest = message.FriendRequest;

            ShowFriendRequest(friendRequest.FriendToAdd);
        }
Пример #17
0
 public void OnMessage(WrapperMessage message)
 {
     Debug.LogError(message.ErrorMessage.Message);
 }
Пример #18
0
        public override bool snedMessage(WrapperMessage wrapper, bool isReply = false)
        {
            Boolean resp_cmp = ITcpIpControl.sendGoogleMsg(bcfApp, tcpipAgentName, wrapper, true);

            return(resp_cmp);
        }
Пример #19
0
        public static Google.Protobuf.IMessage unPackWrapperMsg(byte[] raw_data)
        {
            WrapperMessage WarpperMsg = ToObject <WrapperMessage>(raw_data);

            return(WarpperMsg);
        }
Пример #20
0
        public override com.mirle.iibg3k0.ttc.Common.TrxTcpIp.ReturnCode snedRecv <TSource2>(WrapperMessage wrapper, out TSource2 stRecv, out string rtnMsg)
        {
            //lock (sendRecv_LockObj)
            //{
            //    return ITcpIpControl.sendRecv_Google(bcfApp, tcpipAgentName, wrapper, out stRecv, out rtnMsg);
            //}
            bool lockTaken = false;

            try
            {
                Monitor.TryEnter(sendRecv_LockObj, SCAppConstants.LOCK_TIMEOUT_MS, ref lockTaken);
                if (!lockTaken)
                {
                    throw new TimeoutException("snedRecv time out lock happen");
                }
                return(ITcpIpControl.sendRecv_Google(bcfApp, tcpipAgentName, wrapper, out stRecv, out rtnMsg));
            }
            finally
            {
                if (lockTaken)
                {
                    Monitor.Exit(sendRecv_LockObj);
                }
            }
        }
Пример #21
0
 /// <summary>
 /// Updates displayed friend count
 /// </summary>
 public void OnMessage(WrapperMessage message)
 {
     RecountOnlineFriends();
 }