Exemplo n.º 1
0
        IEnumerator CheckResult(T3SensorData data)
        {
            while (true)
            {
                yield return(null);

                if (data.time + 2.0f < Time.time)
                {
                    Log.Instance.log(string.Format("T3_Result TimeOver : {0}, {1}", data.time, data.posX));
                    SendT3Catch(new T3SensorCatchMsg(false));
                    Message.Send <T3SensorReRequestMsg>(new T3SensorReRequestMsg());
                    break;
                }
            }
        }
Exemplo n.º 2
0
        void OnDegree(vCatchStationTypeDef.vCatchResult_Degree stDegree)
        {
            msgs = string.Format("# ms:{0}  pos:{1}  width:{2}\n", stDegree.msec,
                                 stDegree.pos, stDegree.width);

            T3SensorData sd = new T3SensorData();

            sd.posX = stDegree.pos + 0.5f;
            sd.time = Time.time;

            resultList.Add(sd);
            Log.Instance.log("Result List Count : " + resultList.Count.ToString());

            if (resultList.Count == 1)
            {
                if (_coroutine != null)
                {
                    StopCoroutine(_coroutine);
                    _coroutine = null;
                }
                _coroutine = StartCoroutine(CheckResult(sd));
                Log.Instance.log("Result Count 1 ");
            }

            if (resultList.Count == 2)
            {
                if (_coroutine != null)
                {
                    StopCoroutine(_coroutine);
                    _coroutine = null;
                }

                Log.Instance.log("Send T3ResultMsg");
                Debug.Log("Send T3ResultMsg");

                var msg = new T3ResultMsg();
                for (int i = 0; i < resultList.Count; i++)
                {
                    msg.Datas.Add(resultList[i]);
                }

                Message.Send <T3SensorCatchMsg>(new T3SensorCatchMsg(false));
                Message.Send <T3ResultMsg>(msg);
                resultList.Clear();
            }
        }