예제 #1
0
        private void ReportLog(string msg, bool bSend = true)
        {
            var jsonLog = JCVT_VEC.Set(new LOG()
            {
                bSend = bSend, msg = msg
            });

            Evt_UpdateData?.Invoke(this, jsonLog);
        }
예제 #2
0
        private void On_RecvdData(object sender, string data)
        {
            var temp = new LD_STATUS(data);

            switch (temp.cmd)
            {
            case eSTATE_CMD_TYPE.EXTENDEDSTATUSFORHUMANS:
            case eSTATE_CMD_TYPE.STATUS:
            case eSTATE_CMD_TYPE.ERROR:
            case eSTATE_CMD_TYPE.PAUSETASK:
                _curr.state.st     = temp.state.st;
                _curr.state.dst    = temp.state.dst;
                _curr.state.subMsg = temp.state.subMsg;
                break;

            case eSTATE_CMD_TYPE.STATEOFCHARGE: _curr.batt = temp.batt; break;

            case eSTATE_CMD_TYPE.LOCALIZATIONSCORE: _curr.local = temp.local; break;

            case eSTATE_CMD_TYPE.TEMPERATURE: _curr.temp = temp.temp; break;

            case eSTATE_CMD_TYPE.LOCATION: _curr.pos = new POS()
            {
                    x = temp.pos.x, y = temp.pos.y, ang = temp.pos.ang
            }; break;

            case eSTATE_CMD_TYPE.PARKING: _curr.state.st = temp.state.st; break;

            default: break;
            }

            switch (temp.cmd)
            {
            case eSTATE_CMD_TYPE.NONE: ReportLog($"Parsing Failed : {data}", false); break;

            case eSTATE_CMD_TYPE.PASSWORD:
                SendQuery("adept", false);
                bInit = true;
                break;

            case eSTATE_CMD_TYPE.END_OF_COMMAND:
                break;

            default:
                var rcv = JCVT_VEC.Set(_curr);
                Evt_UpdateData?.Invoke(this, rcv);
                if (_beforeSt.state.st != _curr.state.st || _beforeSt.state.dst != _curr.state.dst)
                {
                    _beforeSt.state.st  = _curr.state.st;
                    _beforeSt.state.dst = _curr.state.dst;
                    ReportLog(data, false);
                }
                break;
            }
        }
예제 #3
0
        public void Vec_SendCmd(eVEC_CMD cmd, SENDARG s)
        {
            var arg = JCVT_VEC.Set(s);

            _Vec.Send(cmd, arg);
        }