private void ExecuteMeasurment_Click(object sender, EventArgs e)
        {
            if (checkFileExists() == true)
            {
                generateErrorMessage("Filename Already Exists");
                return;
            }


            if (ExpLastName.Text != "" && TubeNumber.Text != "" && Substance.Text != "" && filename.Text != "")
            {
                StopMeas.Enabled          = true;
                ExecuteMeasurment.Enabled = false;

                Workbook = new excel_doc();
                Workbook.createDoc();
                Workbook.app.ScreenUpdating = false;
                addGeneralInfo();
                Workbook.addData(2, 1, "Time:", "raw_data");
                Workbook.addData(3, 1, "Cavity Temp:", "raw_data");
                Workbook.addData(4, 1, "Room Temp:", "raw_data");
                Workbook.addData(5, 1, "NA Calc Center:", "raw_data");
                Workbook.addData(6, 1, "NA Calc BW:", "raw_data");
                Workbook.addData(7, 1, "NA Calc IL:", "raw_data");
                Workbook.addData(8, 1, "NA Calc Q:", "raw_data");
                Workbook.addData(9, 1, "Data Set:", "raw_data");
                dataCol = 2;

                Q_L  = null;
                Q_UL = null;

                string path = string.Format("{0}{1}.xlsx", pathname.Text, filename.Text);
                Workbook.workbook.SaveAs(path);
                start = DateTime.Now;
                NA.Write("NPX?;");
                numberOfPoints = NA.ReadString();
                NA.Write("IFBWX?;");
                IFBW = NA.ReadString();
                Workbook.addData(5, 1, "Number of Data Points:", "gen_info");
                Workbook.addData(5, 2, numberOfPoints, "gen_info");
                Workbook.addData(7, 1, "IF Bandwidth:", "gen_info");
                Workbook.addData(7, 2, IFBW, "gen_info");

                Workbook.addData(15, 1, "Input Power (dB):", "gen_info");
                NA.Write("PWR?;");
                inputPower = NA.ReadString();
                Workbook.addData(15, 2, inputPower, "gen_info");
                inputPowerLabel.Text = inputPower;
                inputPowerLabel.Refresh();



                startMeasurment();
            }

            else
            {
                generateErrorMessage("Fill in all required fields.");
            }
        }
Example #2
0
        private void ExecuteMeasurment_Click(object sender, EventArgs e)
        {
            if (checkFileExists() == true)
            {
                generateErrorMessage("Filename Already Exists");
                return;
            }


            if (ExpLastName.Text != "" && Temp.Text != "" && Substance.Text != "" && TubeNumber.Text != "" && filename.Text != "")
            {
                Workbook = new excel_doc();
                Workbook.createDoc();
                // Workbook.app.ScreenUpdating = false;
                Workbook.addData(3, 1, "Cavity Temp:", "raw_data");
                Workbook.addData(4, 1, "Room Temp:", "raw_data");
                Workbook.addData(5, 1, "NA Calc Center:", "raw_data");
                Workbook.addData(6, 1, "NA Calc BW:", "raw_data");
                Workbook.addData(7, 1, "NA Calc IL:", "raw_data");
                Workbook.addData(8, 1, "NA Calc Q:", "raw_data");
                Workbook.addData(9, 1, "Data Set:", "raw_data");
                string path = string.Format("{0}{1}.xlsx", pathname.Text, filename.Text);
                Workbook.workbook.SaveAs(path);

                start = DateTime.Now;
                startMeasurment();
            }

            else
            {
                generateErrorMessage("Fill in all required fields.");
            }
        }