Пример #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
        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);
        }