示例#1
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();
        }
示例#2
0
        public ChartStateManager(
            ChartXY sensitivityChart,
            ChartXY velocityChart,
            ChartXY gainChat,
            AccelCalculator accelCalculator,
            EstimatedPoints combined,
            EstimatedPoints xPoints,
            EstimatedPoints yPoints)
        {
            CombinedState = new CombinedState(
                sensitivityChart,
                velocityChart,
                gainChat,
                combined,
                accelCalculator);

            XYOneGraphState = new XYOneGraphState(
                sensitivityChart,
                velocityChart,
                gainChat,
                xPoints,
                yPoints,
                accelCalculator);

            XYTwoGraphState = new XYTwoGraphState(
                sensitivityChart,
                velocityChart,
                gainChat,
                xPoints,
                yPoints,
                accelCalculator);
        }
示例#3
0
 public AccelDataXYDirectional(
     EstimatedPoints xPoints,
     EstimatedPoints yPoints,
     AccelCalculator calculator)
 {
     XPoints     = xPoints;
     YPoints     = yPoints;
     Calculator  = calculator;
     AngleToData = new AccelChartData[Constants.AngleDivisions];
     FillAngleData();
 }
 public AccelDataXYComponential(
     EstimatedPoints xPoints,
     EstimatedPoints yPoints,
     AccelCalculator calculator)
 {
     X          = new AccelChartData();
     Y          = new AccelChartData();
     XPoints    = xPoints;
     YPoints    = yPoints;
     Calculator = calculator;
 }
 public CombinedState(
     ChartXY sensitivityChart,
     ChartXY velocityChart,
     ChartXY gainChart,
     EstimatedPoints points,
     AccelCalculator accelCalculator)
     : base(
         sensitivityChart,
         velocityChart,
         gainChart,
         accelCalculator)
 {
     Data = new AccelDataCombined(points, accelCalculator);
 }
示例#6
0
        public AccelData(
            EstimatedPoints combined,
            EstimatedPoints x,
            EstimatedPoints y)
        {
            Combined = new AccelChartData();
            X        = new AccelChartData();
            Y        = new AccelChartData();

            Estimated  = combined;
            EstimatedX = x;
            EstimatedY = y;

            OutVelocityToPoints = new Dictionary <double, (double, double, double, double, double, double, double)>();
        }
示例#7
0
 public XYTwoGraphState(
     ChartXY sensitivityChart,
     ChartXY velocityChart,
     ChartXY gainChart,
     EstimatedPoints xPoints,
     EstimatedPoints yPoints,
     AccelCalculator accelCalculator)
     : base(
         sensitivityChart,
         velocityChart,
         gainChart,
         accelCalculator)
 {
     Data = new AccelDataXYComponential(xPoints, yPoints, accelCalculator);
 }
示例#8
0
 public XYOneGraphState(
     ChartXY sensitivityChart,
     ChartXY velocityChart,
     ChartXY gainChart,
     EstimatedPoints xPoints,
     EstimatedPoints yPoints,
     AccelCalculator accelCalculator)
     : base(
         sensitivityChart,
         velocityChart,
         gainChart,
         accelCalculator)
 {
     DataDirectional = new AccelDataXYDirectional(xPoints, yPoints, accelCalculator);
     Data            = DataDirectional;
     TwoDotsPerGraph = true;
 }
示例#9
0
        private static void SetupCharts(
            ChartXY sensitivityChart,
            ChartXY velocityChart,
            ChartXY gainChart,
            EstimatedPoints estimated,
            EstimatedPoints estimatedX,
            EstimatedPoints estimatedY)
        {
            sensitivityChart.SetPointBinds(estimated.Sensitivity, estimatedX.Sensitivity, estimatedY.Sensitivity);
            velocityChart.SetPointBinds(estimated.Velocity, estimatedX.Velocity, estimatedY.Velocity);
            gainChart.SetPointBinds(estimated.Gain, estimatedX.Gain, estimatedY.Gain);

            sensitivityChart.SetTop(0);
            velocityChart.SetHeight(sensitivityChart.Height);
            velocityChart.SetTop(sensitivityChart.Height + Constants.ChartSeparationVertical);
            gainChart.SetHeight(sensitivityChart.Height);
            gainChart.SetTop(velocityChart.Top + velocityChart.Height + Constants.ChartSeparationVertical);
        }
 public AccelDataCombined(EstimatedPoints points, AccelCalculator calculator)
 {
     X          = new AccelChartData();
     Points     = points;
     Calculator = calculator;
 }