private void Open_Port_Click(object sender, EventArgs e)
        {
            therm.Open_Port(Com_Ports.SelectedItem.ToString());
            bool A = false, B = false;

            if (!tools.open_device(1))
            {
                MessageBox.Show("Ontrak failed to connect");
                therm.Close_Port();
                Close_Port.Enabled = false;
                Start_Cal.Enabled  = false;
                Stop_Cal.Enabled   = false;
            }
            else
            {
                A = true;
                Close_Port.Enabled = true;
            }



            Start_Cal.Enabled = A;
        }
Ejemplo n.º 2
0
        private void Connect2_Click(object sender, EventArgs e)
        {
            var lines = File.ReadAllLines(@"CalibrationExpiryDates.ini");

            for (int i = 0; i < 6; i++)
            {
                EXP_Stat[i] = Cal.CalibrationTime.check_stat(i);
            }

            datetimeReport = DateTime.Now.ToString("dd-MMM-yyyy,hh:mm tt");

            if (!EXP_Stat[0] || !EXP_Stat[1] || !EXP_Stat[2] || !EXP_Stat[3] || !EXP_Stat[4] || !EXP_Stat[5])
            {
                string temp = "";
                temp = (!EXP_Stat[0]) ? temp + "Thermistor 1 Calibration is Expired \n" : temp;
                temp = (!EXP_Stat[1]) ? temp + "Thermistor 2 Calibration is Expired \n" : temp;
                temp = (!EXP_Stat[2]) ? temp + "Thermistor 3 Calibration is Expired \n" : temp;
                temp = (!EXP_Stat[3]) ? temp + "Thermistor 4 Calibration is Expired \n" : temp;
                temp = (!EXP_Stat[4]) ? temp + "PCBA Calibration is Expired \n" : temp;
                temp = (!EXP_Stat[5]) ? temp + "Heater Bath Calibration is Expired \n" : temp;
                MessageBox.Show(temp);
            }
            else if (LotNum.Text == "")
            {
                MessageBox.Show("Lot Number Field is empty, Please Enter the Lot number");
            }
            else if (!tools.open_device(0))
            {
                MessageBox.Show("Failed to Connect to Ontrak");
            }
            else
            {
                fireworks.Hide();
                Kenny.Show();
                LotNum.Enabled         = false;
                Calibration_PB.Enabled = false;
                datetime             = DateTime.Now.ToString("ddMMMyyyyHHmm");
                Connect2.Enabled     = false;
                complete_flag        = false;
                complete_calibration = false;

                init_boards();

                for (int m = 0; m < 36; m++)
                {
                    Array.Clear(Data[m], 0, Data[m].Length);
                    fill_array(Offset[m], Offset[m].Length, 999);
                    Offset[m][0]     = 0;
                    Status[m]        = false;
                    Status_buffer[m] = false;
                    Offset_Status[m] = false;

                    worker_counter = 0;

                    HTR1_Radio.Enabled  = false;
                    HTR2_Radio.Enabled  = false;
                    HTR3_Radio.Enabled  = false;
                    HTR4_Radio.Enabled  = false;
                    HTR5_Radio.Enabled  = false;
                    HTR6_Radio.Enabled  = false;
                    HTR7_Radio.Enabled  = false;
                    HTR8_Radio.Enabled  = false;
                    HTR9_Radio.Enabled  = false;
                    HTR10_Radio.Enabled = false;
                    HTR11_Radio.Enabled = false;
                    HTR12_Radio.Enabled = false;
                    HTR13_Radio.Enabled = false;
                    HTR14_Radio.Enabled = false;
                    HTR15_Radio.Enabled = false;
                    HTR16_Radio.Enabled = false;


                    HTR1_Radio.Checked  = false;
                    HTR2_Radio.Checked  = false;
                    HTR3_Radio.Checked  = false;
                    HTR4_Radio.Checked  = false;
                    HTR5_Radio.Checked  = false;
                    HTR6_Radio.Checked  = false;
                    HTR7_Radio.Checked  = false;
                    HTR8_Radio.Checked  = false;
                    HTR9_Radio.Checked  = false;
                    HTR10_Radio.Checked = false;
                    HTR11_Radio.Checked = false;
                    HTR12_Radio.Checked = false;
                    HTR13_Radio.Checked = false;
                    HTR14_Radio.Checked = false;
                    HTR15_Radio.Checked = false;
                    HTR16_Radio.Checked = false;

                    if (!Second_Worker.IsBusy)
                    {
                        Second_Worker.RunWorkerAsync();
                    }
                    Print_PB.Enabled = false;
                }
            }
        }