public frmPowerStepTest(MvcTestMode TestMode)
        {
            InitializeComponent();
            this.Dock = DockStyle.Fill;
            this.Width = Screen.PrimaryScreen.Bounds.Width;
            this.Height = Screen.PrimaryScreen.Bounds.Height;

            DataSample = new Classes.PowerStepTestDS(GlobalVariables.leftSerialPort);
            AssignCallbackMethods();

            DataSample.ResetGraphs(chartPower);
            DataSample.SetReferncePowerCurve(chartPower, numUpDownPower.Value);
            // Set the control style to double buffer.
            //this.SetStyle(ControlStyles.AllPaintingInWmPaint | ControlStyles.UserPaint, true);
            //this.SetStyle(ControlStyles.SupportsTransparentBackColor, false);
            //this.SetStyle(ControlStyles.OptimizedDoubleBuffer, true);
        }
 private void btnTestEccentric_MouseUp(object sender, MouseEventArgs e)
 {
     if (CalibrationSettings.Default.SoundEnabled == true) GlobalFunctions.PlayClickSound();
     DataSample = new Classes.PowerStepTestDS(GlobalVariables.leftSerialPort);
     AssignCallbackMethods();
     DataSample.ResetGraphs(chartPower);
     DataSample.SetReferncePowerCurve(chartPower, numUpDownPower.Value);
     DataSample.ContractionSelector = Enumerators.ConstactionType.Eccentric;                                                                         //Set the Contraction Selector to Concentric
     DataSample.ResetConcentricParamters(ref lblCycleCounter, ref lblCurrentSpeed, chartPower);
     DataSample.SelectedDirection = Enumerators.Direction.Backward;
     DataSample.IsTestDataAvailible = true;
     DataSample.CycleCounter = 0;
     DataSample.CyclesPerStep = Convert.ToInt32(numUpDownCyclesPerStep.Value);
     DataSample.IncSpeedPerStep = Convert.ToInt32(numUpDownSpeed.Value);
     DataSample.SelectedSpeed = Convert.ToInt32(numUpDownSpeed.Value);
     lblCurrentSpeed.Text = DataSample.SelectedSpeed.ToString();
     lblCycleCounter.Text = "0";
     InitiateSequence();
 }