Пример #1
0
        public VirtualSensorData(VirtualSensorData v)
        {
            this.isinferredornottracked = v.isinferredornottracked;
            this.NowInTicks             = v.NowInTicks;

            this.acceleration = new double[v.acceleration.Length];
            for (int i = 0; i < v.acceleration.Length; i++)
            {
                this.acceleration[i] = v.acceleration[i];
            }

            this.velocity = new double[v.velocity.Length];
            for (int i = 0; i < v.velocity.Length; i++)
            {
                this.velocity[i] = v.velocity[i];
            }

            this.position = new double[v.position.Length];
            for (int i = 0; i < v.position.Length; i++)
            {
                this.position[i] = v.position[i];
            }

            this.rot = v.rot;

            this.section = v.section;
        }
Пример #2
0
        private void OnIdealSensorNewTData(object sender, VirtualSensorData e)
        {
            //derivation and store into buffer
            AccelerationTime t = new AccelerationTime();

            t.setVal(e.acceleration, e.NowInTicks);
        }
Пример #3
0
        /// <summary>
        /// Stores virtual accleration data into buffer
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void OnIdealSensorNewTData(object sender, VirtualSensorData e)
        {
            //TO DO: IF data gets pulled into buffer, gets tagged with section ID? Wait.. thought we were tagging all data touched??
            //regardless, no longer doing this here.
            //e.section = this.CalibrationCount;
            //DataTracker.CurrentSection = DataTracker.SectionCounter;
            //derivation and store into buffer
            AccelerationTime t = new AccelerationTime();



            if (ICherryPicker.isDataGood(e.acceleration, !e.isinferredornottracked))
            {
                //IF THIS CONDITIONAL IS CHANGED, IT MUST ALSO BE CHANGED IN THE DATA PRODUCERS.
                t.setVal(e.acceleration, e.NowInTicks, !e.isinferredornottracked);  //if it's good, assign the proper current value - maybe we need to move this if statement to sensor producer
                virtualAcc.Enqueue(t);
                LastVirtualFiltered = false;
            }
            else
            {
                LastVirtualFiltered = true;
                //DataTracker.CurrentSection = 0;
            }
        }