private void frmCustomProgram_Activated(object sender, EventArgs e)
        {
            if (isNewSession == true)
            {
                DialogResult result = System.Windows.Forms.DialogResult.OK;
                isNewSession = false;
                //if (GlobalVariables.UserMode == GlobalVariables.UserIdentityMode.AnonymousMode)
                //{
                frmPulseCalibrationDialog ObjFrmPulseCalibration = new frmPulseCalibrationDialog();
                result = ObjFrmPulseCalibration.ShowDialog();
                //}

                System.Threading.Thread.Sleep(50);
                DataSample.StartTime = DateTime.Now;

                if (result == System.Windows.Forms.DialogResult.OK)
                    Start();
                else
                {
                    StopSequence();
                    Application.OpenForms["frmUserMenu"].Focus();
                }
            }
        }
        private void frmDropTest_Load(object sender, EventArgs e)
        {
            logger.Info("Initiating Drop Test.");

            frmPulseCalibrationDialog ObjFrmPulseCalibration = new frmPulseCalibrationDialog();
            ObjFrmPulseCalibration.ShowDialog();

            ChartTorque.ResetData();
            SetupGraphs();

            DataSample = new Classes.StaticStrengthTestDS(GlobalVariables.leftSerialPort);
            DataSample.CapturePowerFlag = true;
            ThreadCallbackProcessFeedbackError = DataSample.ProcessErrorSession;
            isNewSession = true;
        }
        private void frmCustomProgram_Activated(object sender, EventArgs e)
        {
            if (isNewSession == true)
            {
                DialogResult result = System.Windows.Forms.DialogResult.OK;
                isNewSession = false;

                frmPulseCalibrationDialog ObjFrmPulseCalibration = new frmPulseCalibrationDialog();
                result = ObjFrmPulseCalibration.ShowDialog();

                System.Threading.Thread.Sleep(50);
                //dataSampleLeft.StartTime = DateTime.Now;

                if (result == System.Windows.Forms.DialogResult.OK)
                {
                    //Start();
                }
                else
                {
                    StopSequence();
                    Application.OpenForms["frmUserMenu"].Focus();
                }
            }
        }
        private void frmCustomProgram_Activated(object sender, EventArgs e)
        {
            if (isNewSession == true)
            {
                DialogResult result = System.Windows.Forms.DialogResult.OK;
                isNewSession = false;

                frmPulseCalibrationDialog ObjFrmPulseCalibration = new frmPulseCalibrationDialog();
                result = ObjFrmPulseCalibration.ShowDialog();

                System.Threading.Thread.Sleep(50);
                //dataSampleLeft.StartTime = DateTime.Now;

                if (result == System.Windows.Forms.DialogResult.OK)
                {
                    //Prevent screen from switching off
                    displayPowerRequest = new PowerManager.PowerRequest("SessionActive");
                    displayPowerRequest.DisplayRequired = true;

                    dataSampleLeft.StartingPulse = CalibrationSettings.Default.LeftStartingPulse;
                    dataSampleRight.StartingPulse = CalibrationSettings.Default.RightStartingPulse;
                }
                else
                {
                    StopSequence();
                    Application.OpenForms["frmUserMenu"].Focus();
                }
            }
        }
 private void btnCalibrate_MouseUp(object sender, MouseEventArgs e)
 {
     frmPulseCalibrationDialog frmPulseCalibration = new frmPulseCalibrationDialog();
     DialogResult result = frmPulseCalibration.ShowDialog();
 }