Ejemplo n.º 1
0
    private void Update()
    {
        if (bIsCalibrate)
        {
            m_RecordController.Update();
        }
        if (bIsStartRecord)
        {
            ModelCtrlData modelCtrlData = m_RecordController.GetCurrentData();
            m_FileWriter.CacheData(modelCtrlData);
            m_RecordModeChartController.UpdateLineChart(ChartType.CHART_SPEED, m_RecordRateController.nTotalFrameCount, TrailCurveDrawCtrl.Instance().lastSpeed(TrailType.EG_S1));
            m_RecordModeChartController.UpdateLineChart(ChartType.CHART_ACCELERATE, m_RecordRateController.nTotalFrameCount, TrailCurveDrawCtrl.Instance().lastAcceleration(TrailType.EG_S1));
            m_RecordModeChartController.UpdateLineChart(ChartType.CHART_CURVATURE, m_RecordRateController.nTotalFrameCount, TrailCurveDrawCtrl.Instance().lastCurvature(TrailType.EG_S1));
            m_RecordModeChartController.UpdateLineChart(ChartType.CHART_TORSION, m_RecordRateController.nTotalFrameCount, TrailCurveDrawCtrl.Instance().lastTorsion(TrailType.EG_S1));

            m_RecordRateController.nTotalFrameCount += 1;  //录制帧编号从0开始
        }
    }
    private void Update()
    {
        if (bIsPlay)
        {
            var modelCtrlData = m_FileReader.PraseDataByFrameCount((int)m_VIdeoRateController.nCurrentFrame);
            m_PlayController.Update(modelCtrlData);
            m_PlayModeChartController.UpdateLineChart(ChartType.CHART_SPEED, m_VIdeoRateController.nCurrentFrame, TrailCurveDrawCtrl.Instance().lastSpeed(TrailType.EG_S1));
            m_PlayModeChartController.UpdateLineChart(ChartType.CHART_ACCELERATE, m_VIdeoRateController.nCurrentFrame, TrailCurveDrawCtrl.Instance().lastAcceleration(TrailType.EG_S1));
            //m_PlayModeChartController.UpdateLineChart(ChartType.CHART_CURVATURE, m_VIdeoRateController.nCurrentFrame, TrailCurveDrawCtrl.Instance().lastCurvature(TrailType.EG_S1));
            //m_PlayModeChartController.UpdateLineChart(ChartType.CHART_TORSION, m_VIdeoRateController.nCurrentFrame, TrailCurveDrawCtrl.Instance().lastTorsion(TrailType.EG_S1));

            m_VIdeoRateController.nCurrentFrame += m_VIdeoRateController.nAccelerate;
            if (m_VIdeoRateController.nCurrentFrame >= m_VIdeoRateController.nTotalFrameCount)
            {
                GetComponent <PlayRateControl>().OnStartOrStopClick();
            }
        }
    }
Ejemplo n.º 3
0
    // Update is called once per frame
    void Update()
    {
        if (bIsStart)
        {
            m_RefRateController.nCurrentFrame += 1;
            m_RateController.nCurrentFrame    += 1;

            m_StudyController.Update((int)m_RefRateController.nCurrentFrame, (int)m_RateController.nCurrentFrame);
            m_StudyModeChartController.UpdateRefLineChart(ChartType.CHART_SPEED, m_RefRateController.nCurrentFrame, TrailCurveDrawCtrl.Instance().lastSpeed(TrailType.EG_S1));
            m_StudyModeChartController.UpdateRefLineChart(ChartType.CHART_ACCELERATE, m_RefRateController.nCurrentFrame, TrailCurveDrawCtrl.Instance().lastAcceleration(TrailType.EG_S1));
            m_StudyModeChartController.UpdateRefLineChart(ChartType.CHART_CURVATURE, m_RefRateController.nCurrentFrame, TrailCurveDrawCtrl.Instance().lastCurvature(TrailType.EG_S1));
            m_StudyModeChartController.UpdateRefLineChart(ChartType.CHART_TORSION, m_RefRateController.nCurrentFrame, TrailCurveDrawCtrl.Instance().lastTorsion(TrailType.EG_S1));
            m_StudyModeChartController.UpdateLineChart(ChartType.CHART_SPEED, m_RateController.nCurrentFrame, TrailCurveDrawCtrl.Instance().lastSpeed(TrailType.EG_S1, true));
            m_StudyModeChartController.UpdateLineChart(ChartType.CHART_ACCELERATE, m_RateController.nCurrentFrame, TrailCurveDrawCtrl.Instance().lastAcceleration(TrailType.EG_S1, true));
            m_StudyModeChartController.UpdateLineChart(ChartType.CHART_CURVATURE, m_RateController.nCurrentFrame, TrailCurveDrawCtrl.Instance().lastCurvature(TrailType.EG_S1, true));
            m_StudyModeChartController.UpdateLineChart(ChartType.CHART_TORSION, m_RateController.nCurrentFrame, TrailCurveDrawCtrl.Instance().lastTorsion(TrailType.EG_S1, true));

            if (!bIsRecord)
            {
                if (m_RefRateController.nCurrentFrame >= m_RefRateController.nTotalFrameCount ||
                    m_RateController.nCurrentFrame >= m_RateController.nTotalFrameCount)
                {
                    GetComponent <StudyModelUIPanel>().StudyOver(m_StudyController.GetAppraiseResult());
                    StartOrStopStudy();
                }
            }
            else
            {
                if (m_RefRateController.nCurrentFrame >= m_RefRateController.nTotalFrameCount)
                {
                    GetComponent <StudyModelUIPanel>().StudyOver(m_StudyController.GetAppraiseResult());
                    StartOrStopStudy();
                }
            }
        }
    }