public void OnIncomingMesg(object sender, IncomingMesgEventArgs e)
        {
            switch (e.mesg.Num)
            {
            case MesgNum.ThreeDSensorCalibration:
                ThreeDSensorCalibrationMesg calMesg = new ThreeDSensorCalibrationMesg(e.mesg);
                switch (calMesg.GetSensorType())
                {
                case SensorType.Accelerometer:
                    accelCalParams.LoadParams(calMesg);
                    haveAccelCal = true;
                    break;

                case SensorType.Gyroscope:
                    gyroCalParams.LoadParams(calMesg);
                    haveGyroCal = true;
                    break;

                case SensorType.Compass:
                    magCalParams.LoadParams(calMesg);
                    haveMagCal = true;
                    break;

                default:
                    break;
                }     // switch
                break;

            default:
                break;
            } //switch
        }
Пример #2
0
        public void OnIncomingMesg(object sender, IncomingMesgEventArgs e)
        {
            switch (e.mesg.Num)
            {
            case MesgNum.FileId:
                FileIdMesg fileIdMesg = new FileIdMesg(e.mesg);
                if (fileIdMesg.GetType() == File.Activity)
                {
                    isActivityFile = true;
                }
                break;

            case MesgNum.Session:
                SessionMesg sessionMesg = new SessionMesg(e.mesg);
                record_range_start_time = new DateTime(sessionMesg.GetStartTime());
                break;

            case MesgNum.Hr:
                if (hr_start_index == HrToRecordMesgBroadcastPlugin.INVALID_INDEX)
                {
                    // Mark the first appearance of an HR message
                    hr_start_index     = mesg_count;
                    hr_start_sub_index = 0;
                }
                break;

            default:
                break;
            } // switch

            mesg_count++;
        }