Пример #1
0
        public DataTable GetPointData_BurnIn(string wafer, TEST_TYPE type)
        {
            DataTable tbl = new DataTable();

            try {
                using (MySqlConnection connect = new MySqlConnection(connectionString)) {
                    connect.Open();
                    string       query = "getWaferData";
                    MySqlCommand cmd   = new MySqlCommand(query, connect);
                    cmd.CommandType = System.Data.CommandType.StoredProcedure;
                    cmd.Prepare();
                    cmd.Parameters.AddWithValue("@wafer", wafer);
                    cmd.Parameters.AddWithValue("@test", (int)type);
                    cmd.ExecuteNonQuery();

                    using (MySqlDataAdapter adp = new MySqlDataAdapter(cmd)) {
                        adp.Fill(tbl);
                    }
                    connect.Close();
                    return(tbl);
                }
            } catch (MySqlException ex) {
                return(null);
            }
        }
        public Table GetWaferData(string wafer, TEST_TYPE type)
        {
            DataTable tbl = new DataTable();
            Table     dat = new Table();

            using (MySqlConnection connect = new MySqlConnection(connectionString)) {
                connect.Open();
                string       query = "getWaferData_LB";
                MySqlCommand cmd   = new MySqlCommand(query, connect);
                cmd.CommandType = System.Data.CommandType.StoredProcedure;
                cmd.Prepare();
                cmd.Parameters.AddWithValue("@wafer", wafer);
                cmd.Parameters.AddWithValue("@test", (int)type);
                var reader = cmd.ExecuteReader();
                if (reader.Read())
                {
                    dat.Add(new TestData(TEST_AREA.CENTERA, (double)reader[0], (double)reader[1], (double)reader[2], (double)reader[3]));
                    dat.Add(new TestData(TEST_AREA.CENTERB, (double)reader[4], (double)reader[5], (double)reader[6], (double)reader[7]));
                    dat.Add(new TestData(TEST_AREA.CENTERC, (double)reader[8], (double)reader[9], (double)reader[10], (double)reader[11]));
                    dat.Add(new TestData(TEST_AREA.RIGHT, (double)reader[12], (double)reader[13], (double)reader[14], (double)reader[15]));
                    dat.Add(new TestData(TEST_AREA.TOP, (double)reader[16], (double)reader[17], (double)reader[18], (double)reader[19]));
                    dat.Add(new TestData(TEST_AREA.LEFT, (double)reader[20], (double)reader[21], (double)reader[22], (double)reader[23]));
                }
            }
            return(dat);
        }
        public string MarkTested(string wafer, TEST_TYPE type, bool isTested)
        {
            int val = 0;

            if (isTested)
            {
                val = 1;
            }
            try {
                using (MySqlConnection connect = new MySqlConnection(connectionString)) {
                    connect.Open();
                    string       query = "mark_tested";
                    MySqlCommand cmd   = new MySqlCommand(query, connect);
                    cmd.CommandType = System.Data.CommandType.StoredProcedure;
                    cmd.Prepare();
                    cmd.Parameters.AddWithValue("@wafer", wafer);
                    cmd.Parameters.AddWithValue("@test", (int)type);
                    cmd.Parameters.AddWithValue("@isTested", val);
                    cmd.ExecuteNonQuery();
                }
                return("Success");
            } catch (MySqlException ex) {
                return(ex.ToString());
            }
        }
        }//End

        public string[] GetWaferBySystem(string system, TEST_TYPE type)
        {
            List <string> wafers = new List <string>();

            try {
                using (MySqlConnection connect = new MySqlConnection(connectionString)) {
                    connect.Open();
                    string       query = "get_waferlist";
                    MySqlCommand cmd   = new MySqlCommand(query, connect);
                    cmd.CommandType = System.Data.CommandType.StoredProcedure;
                    cmd.Prepare();
                    cmd.Parameters.AddWithValue("@sys", system);
                    cmd.Parameters.AddWithValue("@test", (int)type);
                    cmd.ExecuteNonQuery();
                    var reader = cmd.ExecuteReader();
                    while (reader.Read())
                    {
                        wafers.Add((string)reader[0]);
                    }
                }
                return(wafers.ToArray());
            } catch (MySqlException ex) {
                return(null);
            }
        }
        public int UpdateSpectrum(string wafer, TEST_TYPE type, TEST_AREA area, double[] wl, double[] spect, double[] wl50mA, double[] spect50mA)
        {
            int retVal = 0;

            try {
                using (MySqlConnection connect = new MySqlConnection(connectionString)) {
                    connect.Open();
                    string       query = "epi_update_spectrum";
                    MySqlCommand cmd   = new MySqlCommand(query, connect);
                    cmd.CommandType = System.Data.CommandType.StoredProcedure;
                    cmd.Prepare();
                    cmd.Parameters.AddWithValue("@wafer", wafer);
                    cmd.Parameters.AddWithValue("@test", (int)type);
                    cmd.Parameters.AddWithValue("@area", (int)area);
                    var wlout = JsonConvert.SerializeObject(wl);
                    cmd.Parameters.AddWithValue("@wl", wlout);
                    var spectout = JsonConvert.SerializeObject(spect);
                    cmd.Parameters.AddWithValue("@spect", spectout);

                    var wlout50 = JsonConvert.SerializeObject(wl50mA);
                    cmd.Parameters.AddWithValue("@wl50mA", wlout50);
                    var spectout50 = JsonConvert.SerializeObject(spect50mA);
                    cmd.Parameters.AddWithValue("@spect50mA", spectout50);

                    cmd.ExecuteNonQuery();
                }
                return(retVal);
            }catch (MySqlException ex) {
                return(-1);
            }
        }
Пример #6
0
        }     //End importBurn

        private int Exist(string wafer, TEST_TYPE type)
        {
            int retVal = 0;

            try {
                using (MySqlConnection connect = new MySqlConnection(connectionString)) {
                    connect.Open();
                    string       query = "check";
                    MySqlCommand cmd   = new MySqlCommand(query, connect);
                    cmd.CommandType = System.Data.CommandType.StoredProcedure;
                    cmd.Prepare();
                    cmd.Parameters.AddWithValue("@wafer", wafer);
                    cmd.Parameters.AddWithValue("@test", (int)type);
                    cmd.Parameters.AddWithValue("?isentry", MySqlDbType.Int32);
                    cmd.Parameters["?isentry"].Direction = System.Data.ParameterDirection.Output;
                    cmd.ExecuteNonQuery();
                    retVal = (int)cmd.Parameters["?isentry"].Value;
                }
                return(retVal);
            } catch (MySqlException ex) {
                return(-1);
            }
        }
 public string LogData50mA(string wafer, TEST_TYPE type, TEST_AREA area, double wl, double power, double voltage, double knee, double reverse)
 {
     try {
         using (MySqlConnection connect = new MySqlConnection(connectionString)) {
             connect.Open();
             string       query = "epi_update_50ma";
             MySqlCommand cmd   = new MySqlCommand(query, connect);
             cmd.CommandType = System.Data.CommandType.StoredProcedure;
             cmd.Prepare();
             cmd.Parameters.AddWithValue("@wafer", wafer);
             cmd.Parameters.AddWithValue("@test", (int)type);
             cmd.Parameters.AddWithValue("@area", (int)area);
             cmd.Parameters.AddWithValue("@wl", wl);
             cmd.Parameters.AddWithValue("@power", power);
             cmd.Parameters.AddWithValue("@voltage", voltage);
             cmd.Parameters.AddWithValue("@knee", knee);
             cmd.Parameters.AddWithValue("@reverse", reverse);
             cmd.ExecuteNonQuery();
         }
         return("success");
     } catch (MySqlException ex) {
         return(ex.ToString());
     }
 }
        public async Task <DataTable> GetSpectrum(string waferID, TEST_TYPE typ)
        {
            DataTable tbl = new DataTable();

            try {
                using (MySqlConnection connect = new MySqlConnection(connectionString)) {
                    await connect.OpenAsync();

                    string       query = "get_spectrum";
                    MySqlCommand cmd   = new MySqlCommand(query, connect);
                    cmd.CommandType = System.Data.CommandType.StoredProcedure;
                    cmd.Prepare();
                    cmd.Parameters.AddWithValue("@wafer", waferID);
                    cmd.Parameters.AddWithValue("@test", (int)typ);
                    //cmd.ExecuteNonQuery();cmd.ExecuteNonQueryAsync();
                    using (MySqlDataAdapter adp = new MySqlDataAdapter(cmd)) {
                        var t = await adp.FillAsync(tbl);
                    }
                }
                return(tbl);
            } catch (MySqlException ex) {
                return(null);
            }
        }
Пример #9
0
        private void importBurn_Click(object sender, RibbonControlEventArgs e)
        {
            Excel.Range sel = Globals.ThisAddIn.Application.Selection as Excel.Range;
            if (sel != null)
            {
                List <string> notFound = new List <string>();
                TEST_TYPE     type     = TEST_TYPE.AFTER;

                string start = "", stop = "", date = "";
                if (this.testType.Text == "Initial")
                {
                    type  = TEST_TYPE.INITIAL;
                    start = "M";
                    stop  = "AJ";
                    date  = "L";
                }
                else if (this.testType.Text == "After")
                {
                    type  = TEST_TYPE.AFTER;
                    start = "BC";
                    stop  = "BZ";
                    date  = "BB";
                }
                else
                {
                    MessageBox.Show("Please select a Test Type" + Environment.NewLine + "and try again.");
                    return;
                }//End check for selection
                this.getSpectrum.Enabled = false;
                this.openEWAT.Enabled    = false;
                this.importBurn.Enabled  = false;
                Excel.Worksheet ws = Globals.ThisAddIn.Application.ActiveSheet as Excel.Worksheet;
                Globals.ThisAddIn.Application.Calculation = Excel.XlCalculation.xlCalculationManual;
                foreach (Excel.Range cell in sel.Cells)
                {
                    if (cell.Value2 != null && (string)cell.Value2 != "")
                    {
                        if (epiWrapper.Exist((string)cell.Value2, type) == 1)
                        {
                            Excel.Range output = ws.get_Range(start + cell.Row, stop + cell.Row);
                            DataTable   data   = this.epiWrapper.GetPointData_BurnIn(cell.Value2, type);
                            object[,] Cells = new object[data.Rows.Count, data.Columns.Count];
                            for (int j = 0; j < data.Rows.Count; j++)
                            {
                                for (int i = 0; i < data.Columns.Count; i++)
                                {
                                    if ((double)data.Rows[j][i] == 0.00)
                                    {
                                        Cells[j, i] = "";
                                    }
                                    else
                                    {
                                        Cells[j, i] = data.Rows[j][i];
                                    } //End check for 0, empty if 0
                                }
                            }         //End loop through
                            output.Value = Cells;
                            ws.get_Range(date + cell.Row).Value = DateTime.Now.ToShortDateString();
                        }
                        else
                        {
                            notFound.Add((string)cell.Value2);
                        } //End check if exist
                    }     //double check not null
                }         //End loop through range
                if (notFound.Count > 0)
                {
                    string message = "";
                    foreach (string not in notFound)
                    {
                        message += not + Environment.NewLine;
                    }
                    MessageBox.Show("Wafers not Found: " + message);
                }//End check for not found wafers and message
                MessageBox.Show("Import Done");
                Globals.ThisAddIn.Application.Calculation = Excel.XlCalculation.xlCalculationAutomatic;
                this.getSpectrum.Enabled = true;
                this.openEWAT.Enabled    = true;
                this.importBurn.Enabled  = true;
            } //End check for selection
        }     //End importBurn
Пример #10
0
 // Reads a file and attempts to convert it to a TestReplay object
 public async Task loadTestReplay(string testFilename)
 {
     testActions.Clear();
     StorageFile testStorageFile;
     string testReplayString = "";
     try
     {
         Task<StorageFile> fileTask = ApplicationData
                 .Current.LocalFolder
                 .GetFileAsync(testFilename).AsTask<StorageFile>();
         fileTask.Wait();
         testStorageFile = fileTask.Result;
         testReplayString = await FileIO.ReadTextAsync(testStorageFile);
     }
     catch { return; }
     if (testFilename.Contains("_H"))
     {
         if (this.testType == TEST_TYPE.TRAILS_A)
         {
             this.testType = TEST_TYPE.TRAILS_A_H;
         }
         else
         {
             this.testType = TEST_TYPE.TRAILS_B_H;
         }
     }
     parseTestReplayFile(testReplayString);
 }
Пример #11
0
 public TestReplay(Patient _patient, TEST_TYPE TestType)
 {
     patient = _patient;
     testActions = new List<TestAction>();
     testNotes = new List<PatientNote>();
     testErrors = new List<TestError>();
     testCompletions = new List<NodeCompletion>();
     testType = TestType;
 }
 public async Task <DataTable> GetWaferSpectrum(string wafer, TEST_TYPE type)
 {
     return(null);
 }