Beispiel #1
0
        public ChartStateManager(
            ChartXY sensitivityChart,
            ChartXY velocityChart,
            ChartXY gainChat,
            AccelData accelData,
            AccelCalculator accelCalculator)
        {
            CombinedState = new CombinedState(
                sensitivityChart,
                velocityChart,
                gainChat,
                accelData,
                accelCalculator);

            XYOneGraphState = new XYOneGraphState(
                sensitivityChart,
                velocityChart,
                gainChat,
                accelData,
                accelCalculator);

            XYTwoGraphState = new XYTwoGraphState(
                sensitivityChart,
                velocityChart,
                gainChat,
                accelData,
                accelCalculator);
        }
Beispiel #2
0
        public AccelCharts(
            RawAcceleration form,
            ChartXY sensitivityChart,
            ChartXY velocityChart,
            ChartXY gainChart,
            ToolStripMenuItem enableVelocityAndGain,
            ToolStripMenuItem enableLastMouseMove,
            Button writeButton,
            AccelCalculator accelCalculator)
        {
            var estimated  = new EstimatedPoints();
            var estimatedX = new EstimatedPoints();
            var estimatedY = new EstimatedPoints();

            SetupCharts(sensitivityChart, velocityChart, gainChart, estimated, estimatedX, estimatedY);
            var accelData = new AccelData(estimated, estimatedX, estimatedY);

            ChartStateManager = new ChartStateManager(sensitivityChart, velocityChart, gainChart, accelData, accelCalculator);

            ContainingForm        = form;
            EnableVelocityAndGain = enableVelocityAndGain;
            EnableLastValue       = enableLastMouseMove;
            WriteButton           = writeButton;

            EnableVelocityAndGain.Click          += new System.EventHandler(OnEnableClick);
            EnableVelocityAndGain.CheckedChanged += new System.EventHandler(OnEnableVelocityGainCheckStateChange);

            EnableLastValue.CheckedChanged += new System.EventHandler(OnEnableLastMouseMoveCheckStateChange);

            ChartState = ChartStateManager.InitialState();
            ChartState.Activate();
            HideVelocityAndGain();
        }
    private void _onAccelDataChanged(AccelData data)
    {
        float intensity = data.Delta.magnitude - ShakeThreshold;

        if (intensity > 0)
        {
            _dispatchShakeEvent(intensity);
        }
    }
Beispiel #4
0
 public CombinedState(
     ChartXY sensitivityChart,
     ChartXY velocityChart,
     ChartXY gainChart,
     AccelData accelData,
     AccelCalculator accelCalculator)
     : base(
         sensitivityChart,
         velocityChart,
         gainChart,
         accelData,
         accelCalculator)
 {
 }
Beispiel #5
0
 public ChartState(
     ChartXY sensitivityChart,
     ChartXY velocityChart,
     ChartXY gainChart,
     AccelData accelData,
     AccelCalculator calculator)
 {
     SensitivityChart = sensitivityChart;
     VelocityChart    = velocityChart;
     GainChart        = gainChart;
     Data             = accelData;
     Calculator       = calculator;
     TwoDotsPerGraph  = false;
 }
Beispiel #6
0
 public XYOneGraphState(
     ChartXY sensitivityChart,
     ChartXY velocityChart,
     ChartXY gainChart,
     AccelData accelData,
     AccelCalculator accelCalculator)
     : base(
         sensitivityChart,
         velocityChart,
         gainChart,
         accelData,
         accelCalculator)
 {
     TwoDotsPerGraph = true;
 }
        private void Model_DataReceived(object sender, EventArgs e)
        {
            AccelData accel = model.ReadAccel;

            AccelX      = accel.X;
            AccelY      = accel.Y;
            AccelZ      = accel.Z;
            TempC       = model.ReadTempC;
            TempF       = model.ReadTempF;
            Light       = model.ReadLight;
            Sound       = model.ReadSound;
            LeftButton  = model.ReadLeftButton;
            RightButton = model.ReadRightButton;
            SlideSwitch = model.ReadSlideSwitch;
            IsHeld      = model.IsBeingHeld();
        }
Beispiel #8
0
 public void Clear()
 {
     myOrigin   = new clsPoint3d();
     myEndXAxis = new clsPoint3d();
     myEndYAxis = new clsPoint3d();
     myPoint    = new clsPoint3d();
     VX         = new clsPoint3d();
     VY         = new clsPoint3d();
     VZ         = new clsPoint3d();
     mySeenFromCameraPoints.Clear();
     myPts1.Clear();
     myPts2.Clear();
     myPts3.Clear();
     myCameraPoints.Clear();
     GyroData.Clear();
     LastGyroData.Clear();
     AccelData.Clear();
     LastAccelData.Clear();
     myHistory.Clear();
     myLastTime        = null;
     myLastVector      = null;
     FirstPointRemoved = false;
     mySeenFromMarkerIDs.Clear();
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="Acceleration"/> struct.
 /// </summary>
 /// <param name="accelData">The acceleration data.</param>
 internal Acceleration(AccelData accelData)
 {
     X = accelData.X;
     Y = accelData.Y;
     Z = accelData.Z;
 }
Beispiel #10
0
 private void _onAccelDataChanged(AccelData data)
 {
     // wiggle
     RendererObject.transform.localPosition = data.Delta * WiggleDampening;
 }
Beispiel #11
0
        public void Load(System.IO.StreamReader sr)
        {
            clsPoint3d p1;

            //var version = myPGLoadedVersion.Split('.');
            //var nLoadedVersionMajor = version.Count() >= 1 ? Convert.ToInt32(version[0]) : 0;
            //var nLoadedVersionMinor = version.Count() >= 2 ? Convert.ToInt32(version[1]) : 0;

            while (sr.EndOfStream == false)
            {
                var myLine = sr.ReadLine();
                if (myLine == "END_MARKER_POINT_SETTINGS")
                {
                    break;
                }
                if (myLine.IndexOf(",") > -1)
                {
                    var mySplit = myLine.Split(',');
                    if (mySplit.GetUpperBound(0) == 1)
                    {
                        if (mySplit[0] == "MarkerID")
                        {
                            myMarkerID = Convert.ToInt32(mySplit[1]);
                        }
                        if (mySplit[0] == "SeenFromMarkerID")
                        {
                            mySeenFromMarkerID = Convert.ToInt32(mySplit[1]);
                        }
                        if (mySplit[0] == "SeenFromMarkerIDs")
                        {
                            mySeenFromMarkerIDs.Add(Convert.ToInt32(mySplit[1]));
                        }
                        if (mySplit[0] == "ActualMarkerID")
                        {
                            myActualMarkerID = Convert.ToInt32(mySplit[1]);
                        }
                        if (mySplit[0] == "VerticalVectorX")
                        {
                            if (myVerticalVect == null)
                            {
                                myVerticalVect = new clsPoint3d();
                            }
                            myVerticalVect.X = Convert.ToDouble(mySplit[1]);
                        }
                        if (mySplit[0] == "VerticalVectorY")
                        {
                            if (myVerticalVect == null)
                            {
                                myVerticalVect = new clsPoint3d();
                            }
                            myVerticalVect.Y = Convert.ToDouble(mySplit[1]);
                        }
                        if (mySplit[0] == "VerticalVectorZ")
                        {
                            if (myVerticalVect == null)
                            {
                                myVerticalVect = new clsPoint3d();
                            }
                            myVerticalVect.Z = Convert.ToDouble(mySplit[1]);
                        }
                        if (mySplit[0] == "BulkheadHeight")
                        {
                            BulkheadHeight = Convert.ToDouble(mySplit[1]);
                        }
                        if (mySplit[0] == "Confirmed")
                        {
                            _confirmed = (mySplit[1] == "1");
                        }
                    }
                }
            }

            if (mySeenFromMarkerIDs.Contains(mySeenFromMarkerID) == false)
            {
                mySeenFromMarkerIDs.Add(mySeenFromMarkerID);
            }

            myOrigin.Load(sr);
            myEndXAxis.Load(sr);
            myEndYAxis.Load(sr);
            myPoint.Load(sr);
            VX.Load(sr);
            VY.Load(sr);
            VZ.Load(sr);

            var n = Convert.ToInt32(sr.ReadLine());

            for (var i = 1; i <= n; i++)
            {
                p1 = new clsPoint3d();
                p1.Load(sr);
                myCameraPoints.Add(p1);
            }

            n = Convert.ToInt32(sr.ReadLine());
            for (var i = 1; i <= n; i++)
            {
                p1 = new clsPoint3d();
                p1.Load(sr);
                mySeenFromCameraPoints.Add(p1);
            }

            n = Convert.ToInt32(sr.ReadLine());
            for (var i = 1; i <= n; i++)
            {
                p1 = new clsPoint3d();
                p1.Load(sr);
                myPts1.Add(p1);
            }

            n = Convert.ToInt32(sr.ReadLine());
            for (var i = 1; i <= n; i++)
            {
                p1 = new clsPoint3d();
                p1.Load(sr);
                myPts2.Add(p1);
            }

            n = Convert.ToInt32(sr.ReadLine());
            for (var i = 1; i <= n; i++)
            {
                p1 = new clsPoint3d();
                p1.Load(sr);
                myPts3.Add(p1);
            }

            n = Convert.ToInt32(sr.ReadLine());
            for (var i = 1; i <= n; i++)
            {
                p1 = new clsPoint3d();
                p1.Load(sr);
                GyroData.Add(p1);
            }

            n = Convert.ToInt32(sr.ReadLine());
            for (var i = 1; i <= n; i++)
            {
                p1 = new clsPoint3d();
                p1.Load(sr);
                LastGyroData.Add(p1);
            }

            n = Convert.ToInt32(sr.ReadLine());
            for (var i = 1; i <= n; i++)
            {
                p1 = new clsPoint3d();
                p1.Load(sr);
                AccelData.Add(p1);
            }

            n = Convert.ToInt32(sr.ReadLine());
            for (var i = 1; i <= n; i++)
            {
                p1 = new clsPoint3d();
                p1.Load(sr);
                LastAccelData.Add(p1);
            }

            n = Convert.ToInt32(sr.ReadLine());
            for (var i = 1; i <= n; i++)
            {
                var myHistoricPoint = new clsMarkerPoint();
                myHistoricPoint.Load(sr);
                myHistory.Add(myHistoricPoint);
            }
        }