public frmTunkEcceLats(int SelectedSpeed, int SelectedTorque, double SelectedAngle, Enumerators.ProgramSelect TestMode)
        {
            InitializeComponent();
            this.Dock = DockStyle.Fill;
            this.Width = Screen.PrimaryScreen.Bounds.Width;
            this.Height = Screen.PrimaryScreen.Bounds.Height;

            DataSample = new Classes.TunkEcceLatsDS(GlobalVariables.leftSerialPort);
            DataSample.SelectedTorque = SelectedTorque;
            DataSample.ProgramSelector = TestMode;
            DataSample.DeltaTorqueAdjustment = 4;
            DataSample.DeltaTimeInterval = 500;
            testMode = TestMode;
            SetupStartParameters(SelectedSpeed, SelectedAngle, TestMode);

            lblTorqueLimit.Text = DataSample.SelectedTorque.ToString();

            AssignCallbackMethods();
        }
        //Set the labels to the results data
        public void SetLabels()
        {
            lblMaxEcceTorqueAbs.Text = Math.Round(DataSample.SessionMaxEcceTorqueAbs, 1).ToString();
            lblMaxConcTorqueAbs.Text = Math.Round(DataSample.SessionMaxConcTorqueAbs, 1).ToString();
            lblMaxEcceTorqueRight.Text = Math.Round(DataSample.SessionMaxEcceTorqueBack, 1).ToString();
            lblMaxConcTorqueRight.Text = Math.Round(DataSample.SessionMaxConcTorqueBack, 1).ToString();
            lblAvgEcceTorqueAbs.Text = Math.Round(DataSample.SessionAvgEcceTorqueAbs, 1).ToString();
            lblAvgConcTorqueAbs.Text = Math.Round(DataSample.SessionAvgConcTorqueAbs, 1).ToString();
            lblAvgEcceTorqueRight.Text = Math.Round(DataSample.SessionAvgEcceTorqueBack, 1).ToString();
            lblAvgConcTorqueRight.Text = Math.Round(DataSample.SessionAvgConcTorqueBack, 1).ToString();
            lblStrengthIndexAbs.Text = Math.Round(DataSample.SessionStrengthIndexAbs, 1).ToString();
            lblEnduranceIndexAbs.Text = Math.Round(DataSample.SessionEnduranceIndexAbs, 1).ToString();
            lblStrengthIndexRight.Text = Math.Round(DataSample.SessionStrengthIndexBack, 1).ToString();
            lblEnduranceIndexRight.Text = Math.Round(DataSample.SessionEnduranceIndexBack, 1).ToString();
            lblEnergyBurned.Text = Math.Round(DataSample.TotalEnergyBurned, 2).ToString();
            lblSessionDuration.Text = DataSample.SessionDuration.ToString(@"mm\:ss");

            ProgramSelector = DataSample.ProgramSelector;
        }
        private void btnCustomProgram2_MouseUp(object sender, MouseEventArgs e)
        {
            if (backgroundWorkerOpenSerialPort.IsBusy != true)
            {
                backgroundWorkerOpenSerialPort.RunWorkerAsync();
            }
            else
                return;

            frmCustomMessage = new frmMessageDialog("Establishing Communications Link...", MessageBoxButtons.RetryCancel);
            DialogResult result = frmCustomMessage.ShowDialog();

            if (result == DialogResult.OK)
            {
                GlobalVariables.FormCollection.FormCustomProgramCPM.AutoRetractMode = true;
                if (CalibrationSettings.Default.SoundEnabled == true) GlobalFunctions.PlayClickSound();
                this.ProgramSelector = Enumerators.ProgramSelect.CustomProgramCPM;
                this.tabControlSelectProgramGroup.SelectedTab = GlobalVariables.FormCollection.FormProgramSetup.tabPageSetup;
                this.tabControl1.SelectedTab = GlobalVariables.FormCollection.FormProgramSetup.tabPageSpeed;
                this.textBoxSpeed.Focus();
            }
            else
            {
                backgroundWorkerOpenSerialPort.CancelAsync();
            }
        }
 private void btnRehabRightLeg_MouseUp(object sender, MouseEventArgs e)
 {
     if (CalibrationSettings.Default.SoundEnabled == true) GlobalFunctions.PlayClickSound();
     ProgramSelector = Enumerators.ProgramSelect.RehabRightLeg;
     ShowTabpPAgeSpeed();
 }