예제 #1
0
 private void comboPartName_SelectedIndexChanged(object sender, EventArgs e)
 {
     try
     {
         if (comboPartName.Items.Count > 0)
         {
             if (comboPartName.SelectedItem == null)
             {
                 return;
             }
             SelectedPartName = comboPartName.SelectedItem.ToString();
             PopulateBoardList();
             listLifetimeInfo1.Clear();
             LifetimePartLimits    = GCIDB.GetLifetimeLimits(SelectedPartName);
             LoadedLifetimeLimitID = LifetimePartLimits.LifetimeLimitID;
             if (LifetimePartLimits.LifetimeLimitID > 0)
             {
                 LoadedPartID          = GCIDB.GetPartID(SelectedPartName);
                 ExistingSerialNumbers = GCIDB.GetSerialNumberList(SelectedPartName);
             }
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("comboPartName_SelectedIndexChanged(): " + ex.ToString());
     }
 }
예제 #2
0
        void SaveDataToDatabase()
        {
            try
            {
                string batchName = null;
                foreach (int Socket in LifetimeTest.TestResults.Keys)
                {
                    string CurrentSerialNumber = listLifetimeInfo1.GetSerialNumber(Socket);
                    Dispatcher.BeginInvoke(new Action(delegate()
                    {
                        batchName = textBatchName.Text;
                    }));
                    if (numericTestHour.pinValue() == 0)
                    {
                        //this causing prob
                        int BaselineID = GCIDB.GetMostRecentLifetimeTestID_BaseLine(LoadedPartID, CurrentSerialNumber, batchName);
                        // Look at this later
                        //if (BaselineID != 0)
                        //{
                        //    if (MessageBox.Show("Baseline data already exists for:\nPart: " + SelectedPartName + "\nSerial Number: " + CurrentSerialNumber + "\n\nDo you want to change the baseline data to these measurements?", "Warning!", MessageBoxButtons.YesNo, MessageBoxIcon.Exclamation) == System.Windows.Forms.DialogResult.Yes)
                        //    {
                        //        continue;
                        //    }
                        //    else
                        //        return;

                        //}
                    }

                    int LifetimeTestID = GCIDB.GetNextLifetimeTestID();

                    String Batch = null;
                    Dispatcher.BeginInvoke(new Action(delegate()
                    {
                        Batch = textBatchName.Text;
                    }));

                    DateTime Time        = DateTime.Now;
                    int      Hour        = (int)numericTestHour.pinValue();
                    double   Temperature = (double)numericTemperature.pinValue();

                    foreach (int TestedDUTPin in LifetimeTest.TestResults[Socket].Keys)
                    {
                        double AverageVoltage = LifetimeTest.TestResults[Socket][TestedDUTPin].GetVoltageAverage();
                        double StdDev         = LifetimeTest.TestResults[Socket][TestedDUTPin].GetStandardDeviation();

                        for (int j = 0; j < LifetimeTest.TestResults[Socket][TestedDUTPin].VoltageReadings.Count; j++)
                        {
                            Console.WriteLine(j - 1);
                            double MeasuredVoltage = LifetimeTest.TestResults[Socket][TestedDUTPin].VoltageReadings[j];
                            GCIDB.AddLifetimeTestData(LifetimeTestID, CurrentSerialNumber, Batch, LoadedPartID, Hour, LoadedLifetimeLimitID, Temperature, TestedDUTPin, j, MeasuredVoltage, AverageVoltage, StdDev, Time);
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("SaveDataToDatabase(): " + ex.ToString());
            }
        }
        public lifetimeReport()
        {
            InitializeComponent();

            DirectoryInfo dinfo = new DirectoryInfo(@"..\..\..\..\..\Reports\Lifetime Reports");

            FileInfo[] Files = dinfo.GetFiles();

            //file list to string for filter purposes
            var fileList = Files.ToList();

            //show all files before filtering
            files_listbox.ItemsSource = fileList;

            //get part names
            GCIDB.Initialize();
            GCIDB.OpenConnection();
            partNames = GCIDB.GetPartList();
            partName_listbox.ItemsSource = partNames;

            System.ComponentModel.ICollectionView file_view = CollectionViewSource.GetDefaultView(files_listbox.ItemsSource);
            file_view.Filter = files_CustomFilter;

            //filter for partnames
            System.ComponentModel.ICollectionView partName_view = CollectionViewSource.GetDefaultView(partName_listbox.ItemsSource);
            partName_view.Filter = partName_CustomFilter;
        }
예제 #4
0
        private void saveButton_Click(object sender, RoutedEventArgs e)
        {
            int ProductionLimitID = GCIDB.AssociatePartToNewProductionLimit(SelectedPartName);

            if (ProductionLimitID != 0)
            {
                //List<LimitEntity> UserLimits = BuildLimitEntityList();
                //foreach (LimitEntity entry in UserLimits)
                //{
                //    GCIDB.AddProductionLimit(LimitID, entry.PinID, entry.UCL, entry.LCL);
                //}
                foreach (int PinID in LearnResults.Keys)
                {
                    int DutPinID = GCIToDUTMap[PinID];

                    Double Average = LearnResults[PinID].GetVoltageAverage();
                    Double StdDev  = LearnResults[PinID].GetStandardDeviation();

                    int NumberOfSigmas = (int)numericSigma.pinValue();

                    Double UCL = Average + NumberOfSigmas * StdDev;
                    Double LCL = Average - NumberOfSigmas * StdDev;

                    GCIDB.AddProductionLimit(ProductionLimitID, DutPinID, UCL, LCL, Average, StdDev);
                }

                MessageBox.Show("Limits saved to the database", "Success", MessageBoxButton.OK);
            }

            //  this.DialogResult = this.ShowDialog();
            //     this.Close();
        }
예제 #5
0
        void Communication_OnResultComplete()
        {
            Double VoltageRef = Properties.Settings.Default.VoltageReference;
            int    TestedPin  = Communication.PinID1 + Communication.PinID2;
            Double Voltage    = Math.Round((Communication.PinValue * VoltageRef) / 1023.0, 3);

            int BelongsToSocketId = GCItoDeviceIndex[TestedPin];
            int DUTPin            = GCItoDUTMap[TestedPin];
            //LimitEntity LimitsForPin = DUTPintoLimit[DUTPin];

            bool PinResult = false;

            ProductionTest.AddResult(BelongsToSocketId, DUTPin, Voltage);
            int NextPin = ProductionTest.GetNextPin();

            if (NextPin != 0)
            {
                UpdateCurrentIteration(true);
                Communication.TestPin(NextPin);
            }
            else
            {
                foreach (int Socket in ProductionTest.TestResults.Keys)
                {
                    int ProductionTestID = GCIDB.GetNextProductionTestID();
                    foreach (int TestedDUTPin in ProductionTest.TestResults[Socket].Keys)
                    {
                        LimitEntity LimitsForPin = DUTPintoLimit[TestedDUTPin];

                        double AverageVoltage = ProductionTest.TestResults[Socket][TestedDUTPin].GetVoltageAverage();
                        double StdDev         = ProductionTest.TestResults[Socket][TestedDUTPin].GetStandardDeviation();

                        if (AverageVoltage < LimitsForPin.LCL || AverageVoltage > LimitsForPin.UCL)
                        {
                            PinResult = false;
                            listProductionInfo1.SetResult(Socket, false);
                            AddLog("Socket " + Socket + " DUT Pin [" + TestedDUTPin + "] Average Voltage: " + AverageVoltage + " FAILED");
                        }
                        else
                        {
                            PinResult = true;
                            AddLog("Socket " + Socket + " DUT Pin [" + TestedDUTPin + "] Average Voltage: " + AverageVoltage + " PASSED");
                        }

                        for (int j = 0; j < ProductionTest.TestResults[Socket][TestedDUTPin].VoltageReadings.Count; j++)
                        {
                            double MeasuredVoltage = ProductionTest.TestResults[Socket][TestedDUTPin].VoltageReadings[j];
                            Dispatcher.BeginInvoke(new Action(delegate()
                            {
                                GCIDB.AddProductionTestData(textBatchName.Text, ProductionTestID, LoadedPartID, LoadedProductionLimitID, TestedDUTPin, (j - 1), MeasuredVoltage, AverageVoltage, StdDev, PinResult, DateTime.Now);
                            }));
                        }
                    }
                }
                SetDisplayStates(true);
                UpdateCurrentIteration(false);
                listProductionInfo1.DisplaAll(true);
                //  MessageBox.Show("Test Complete", "Part Finished", MessageBoxButton.OK, MessageBox.Information);
            }
        }
예제 #6
0
 private void productionTest_Load(object sender, RoutedEventArgs e)
 {
     GCIDB.Initialize();
     PopulatePartList();
     numericIterations.setValue(Properties.Settings.Default.Production_DefaultIterations);
     Communication.OnResultComplete += new Communication.ResultComplete(Communication_OnResultComplete);
 }
예제 #7
0
        public productionReport()
        {
            InitializeComponent();

            //list Production reports in a given directory
            DirectoryInfo dinfo = new DirectoryInfo(@"..\..\..\..\..\Reports\Production Reports");

            FileInfo[] Files = dinfo.GetFiles();

            //file list to string for filter purposes
            var fileList = Files.ToList();

            //show all files before filtering
            listBox.ItemsSource = fileList;

            //pull parts list from the database
            GCIDB.Initialize();
            GCIDB.OpenConnection();
            partNames = GCIDB.GetPartList();
            partName_listBox1.ItemsSource = partNames;

            //create view then filter, doesnt includes batch view, which is changed in the
            System.ComponentModel.ICollectionView view = CollectionViewSource.GetDefaultView(listBox.ItemsSource);
            view.Filter = CustomFilter;

            System.ComponentModel.ICollectionView partName_view = CollectionViewSource.GetDefaultView(partName_listBox1.ItemsSource);
            partName_view.Filter = partName_CustomFilter;
        }
예제 #8
0
        private void comboPartName_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (comboPartName.Items.Count > 0)
            {
                if (comboPartName.SelectedItem == null)
                {
                    return;
                }
                SelectedPartName = comboPartName.SelectedItem.ToString();
                PopulateBoardList();
                listProductionInfo1.Clear();
                ProductionPartLimits = GCIDB.GetProductionLimits(SelectedPartName);
                if (ProductionPartLimits.Count > 0)
                {
                    LoadedPartID            = ProductionPartLimits[0].PartID;
                    LoadedProductionLimitID = ProductionPartLimits[0].ProductionLimitID;
                    DUTPintoLimit           = new Dictionary <int, LimitEntity>();

                    foreach (LimitEntity Limit in ProductionPartLimits)
                    {
                        if (DUTPintoLimit.ContainsKey(Limit.PinID) == false)
                        {
                            DUTPintoLimit.Add(Limit.PinID, Limit);
                        }
                    }
                }
                UpdateStartButtonState();
            }
        }
예제 #9
0
        private void SaveChanges()
        {
            if (PinsEdited == true || limitList1.HasEdits() == true)
            {
                SelectedProductionLimitID = GCIDB.AssociatePartToNewProductionLimit(SelectedPartName);
                List <LimitEntity> UserLimits = limitList1.BuildLimitEntityList();
                foreach (LimitEntity entry in UserLimits)
                {
                    GCIDB.AddProductionLimit(SelectedProductionLimitID, entry.PinID, entry.UCL, entry.LCL, entry.AverageVoltage, entry.StdDevVoltage);
                }
                PinsEdited = false;
                limitList1.ClearAllEdits();
                buttonSaveChanges.IsEnabled = false;
            }

            if (lifetimeLimits1.Edited == true)
            {
                int LifetimeLimitID = GCIDB.AddNewLifetimeLimit(SelectedPartName, lifetimeLimits1.LCL, lifetimeLimits1.UCL);
                SelectedLifetimeLimitID = LifetimeLimitID;
                GCIDB.SetLifetimeLimit(SelectedPartName, SelectedLifetimeLimitID);
                lifetimeLimits1.Edited      = false;
                buttonSaveChanges.IsEnabled = false;
            }
            MessageBox.Show("All changes saved!");
        }
예제 #10
0
 private void LifetimeTest_Load(object sender, EventArgs e)
 {
     GCIDB.Initialize();
     PopulatePartList();
     Communication.OnResultComplete += new Communication.ResultComplete(Communication_OnResultComplete);
     numericIterations.setValue(Properties.Settings.Default.Lifetime_DefaultIterations);
     numericTemperature.setValue((int)Properties.Settings.Default.Lifetime_DefaultTemperature);
 }
예제 #11
0
        private void listParts_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (PinsEdited == true || limitList1.HasEdits() == true || lifetimeLimits1.Edited == true)
            {
                // if (MessageBox.Show("There were changes made to the part.\nWould you like to save these changes to the database?", "Edits detected", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == System.Windows.Forms.DialogResult.Yes)
                // {
                SaveChanges();
                //}
            }
            PinsEdited = false;
            limitList1.ClearAllEdits();
            lifetimeLimits1.Edited      = false;
            buttonSaveChanges.IsEnabled = false;

            if (listParts.Items.Count > 0)
            {
                if (listParts.SelectedItem == null)
                {
                    return;
                }
                SelectedPartName        = listParts.SelectedItem.ToString();
                SelectedLifetimeLimitID = GCIDB.GetLifetimeLimitID(SelectedPartName);
                LoadedLimitData         = GCIDB.GetProductionLimits(SelectedPartName);
                lifetimeLimits1.SetEnabled(true);

                if (SelectedLifetimeLimitID > 0)
                {
                    LoadedLifetimeLimitData = GCIDB.GetLifetimeLimits(SelectedPartName);
                    lifetimeLimits1.LCL     = LoadedLifetimeLimitData.LowerRange;
                    lifetimeLimits1.UCL     = LoadedLifetimeLimitData.UpperRange;
                }
                else
                {
                    lifetimeLimits1.LCL = Properties.Settings.Default.LifetimeLimit_DefaultLowerRange;
                    lifetimeLimits1.UCL = Properties.Settings.Default.LifetimeLimit_DefaultUpperRange;
                }

                if (LoadedLimitData.Count > 0)
                {
                    SelectedPartID            = LoadedLimitData[0].PartID;
                    SelectedProductionLimitID = LoadedLimitData[0].ProductionLimitID;
                }
                else
                {
                    SelectedPartID            = GCIDB.GetPartID(SelectedPartName);
                    SelectedProductionLimitID = 0;
                }
                limitList1.ClearLimits();
                foreach (LimitEntity Limit in LoadedLimitData)
                {
                    limitList1.AddLimit(Limit);
                }
                buttonEditTestPins.IsEnabled = true;
                //buttonSaveChanges.IsEnabled = true;
            }
        }
예제 #12
0
 public shortTest()
 {
     InitializeComponent();
     iterCount2.setValue(1);
     GCIDB.Initialize();
     PopulatePartList();
     // List<int> listPins = new List<int>();
     //   PossiblePins.ItemsSource = listPins;
     //  ICollectionView view = CollectionViewSource.GetDefaultView(PossiblePins.ItemsSource);
 }
예제 #13
0
        private void PopulatePartList()
        {
            comboPartName.Items.Clear();
            List <string> PartNames = GCIDB.GetPartList();

            foreach (string part in PartNames)
            {
                comboPartName.Items.Add(part);
            }
        }
예제 #14
0
        private void PopulatePartList()
        {
            partNumberBox.Items.Clear();
            //Add if statement, if  continous or short
            List <string> PartNames = GCIDB.GetPartList();

            foreach (string part in PartNames)
            {
                partNumberBox.Items.Add(part);
            }
        }
예제 #15
0
 private void buttonDeletePart_Click(object sender, EventArgs e)
 {
     //  if (MessageBox.Show("Are you sure you want to delete the part " + SelectedPartName + "?", "Are you really sure?", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == System.Windows.Forms.DialogResult.Yes)
     //  {
     GCIDB.DeletePart(SelectedPartName);
     limitList1.ClearLimits();
     lifetimeLimits1.UCL = 0;
     lifetimeLimits1.LCL = 0;
     PopulatePartList();
     //  }
 }
예제 #16
0
        private void PopulateBoardList()
        {
            List <String> BoardNames = GCIDB.GetTestBoardList(SelectedPartName);

            SelectedBoardName   = string.Empty;
            comboTestBoard.Text = string.Empty;
            comboTestBoard.Items.Clear();
            foreach (String Board in BoardNames)
            {
                comboTestBoard.Items.Add(Board);
            }
        }
예제 #17
0
 private void productionLimits_Load(object sender, RoutedEventArgs e)
 {
     /****** All three of the next few lines will need to be uncommented, and the pin will be set as a getter/setter******/
     //numPartsTestCount.pinValue = Properties.Settings.Default.Learn_DefaultIterations;
     //numIterPartCount.pinValue = Properties.Settings.Default.Learn_DefaultNumberOfParts;
     //numericSigma.pinValue = Properties.Settings.Default.ProductionLimit_DefaultSigma;
     GCIDB.Initialize();
     testType_ComboBox.SelectedIndex = 0;
     SelectedTestType = "Continuous";
     //PopulatePartList(); // This may need to be changed to a different method, when the test is selected
     Communication.OnResultComplete += new Communication.ResultComplete(Communication_OnResultComplete);
 }
예제 #18
0
 private void socketOnBoardCombobox_SelectionChanged(object sender, SelectionChangedEventArgs e)
 {
     if (socketOnBoardCombobox.Items.Count > 0)
     {
         if (socketOnBoardCombobox.SelectedItem == null)
         {
             return;
         }
         SelectedSocketName = socketOnBoardCombobox.SelectedItem.ToString();
         GCIToDUTMap        = GCIDB.GetPinMap(SelectedPartName, SelectedBoardName, SelectedSocketName);
     }
 }
예제 #19
0
        private void PopulateSocketList()
        {
            List <String> SocketNames = GCIDB.GetSocketList(SelectedPartName, SelectedBoardName);

            SelectedSocketName         = string.Empty;
            socketOnBoardCombobox.Text = string.Empty;
            socketOnBoardCombobox.Items.Clear();
            foreach (String Socket in SocketNames)
            {
                socketOnBoardCombobox.Items.Add(Socket);
            }
        }
예제 #20
0
        private void saveChanges_button_Click(object sender, RoutedEventArgs e)
        {
            List <TestPinMap> TestPins = testBoardList1.CurrentPinMap;

            foreach (TestPinMap Pin in TestPins)
            {
                if (Pin.Edited == true)
                {
                    GCIDB.ChangePinMap(Pin.TestBoardID, Pin.PartID, Pin.DUTPin, Pin.GCIPin);
                }
            }
            testBoardList1.ClearAllEdits();
            MessageBox.Show("All changes saved!");
        }
예제 #21
0
        public TestEditor()
        {
            InitializeComponent();


            GCIDB.Initialize();
            GCIDB.OpenConnection();
            List <string> partNames = GCIDB.GetPartList();

            part_listBox.ItemsSource = partNames;

            System.ComponentModel.ICollectionView partName_view = CollectionViewSource.GetDefaultView(part_listBox.ItemsSource);
            partName_view.Filter = partName_CustomFilter;
        }
예제 #22
0
        void LoadTestInformation()
        {
            try
            {
                LoadedTestInfo   = GCIDB.GetTestPins(SelectedPartName, SelectedBoardName);
                GCItoDUTMap      = new Dictionary <int, int>();
                GCItoDeviceIndex = new Dictionary <int, int>();

                if (LoadedTestInfo.Count > 0)
                {
                    LoadedTestBoardID = LoadedTestInfo[0].TestBoardID;
                }

                List <string> SlotNames   = new List <string>();
                List <int>    SocketIndex = new List <int>();
                foreach (TestPinEntity Pin in LoadedTestInfo)
                {
                    if (SlotNames.Contains(Pin.SocketName) == false)
                    {
                        SlotNames.Add(Pin.SocketName);
                        SocketIndex.Add(Pin.SocketIndex);
                    }

                    if (GCItoDUTMap.ContainsKey(Pin.GCIPin) == false)
                    {
                        GCItoDUTMap.Add(Pin.GCIPin, Pin.DUTPin);
                    }

                    if (GCItoDeviceIndex.ContainsKey(Pin.GCIPin) == false)
                    {
                        GCItoDeviceIndex.Add(Pin.GCIPin, Pin.SocketIndex);
                    }
                }
                listLifetimeInfo1.Clear();

                for (int i = 0; i < SlotNames.Count; i++)
                {
                    String     Slot          = SlotNames[i];
                    int        Index         = SocketIndex[i];
                    List <int> GCIPinsToTest = GetGCITestPinsFromIndex(Index);
                    listLifetimeInfo1.AddLifetimeTestSlot(Slot, Index, LoadedTestBoardID, GCIPinsToTest, ExistingSerialNumbers);
                }
                buttonStart.IsEnabled = true;
            }
            catch (Exception ex)
            {
                MessageBox.Show("LoadTestInformation(): " + ex.ToString());
            }
        }
예제 #23
0
        private void delete_button_Click(object sender, RoutedEventArgs e)
        {
            MessageBox.Show($"name: , board: {SelectedPartName.Length}, {SelectedBoardName.Length}");
            if (SelectedPartName.Length > 0 && SelectedBoardName.Length > 0)
            {
                GCIDB.DeleteBoard(SelectedPartName, SelectedBoardName);
                GCIDB.Initialize();
                GCIDB.OpenConnection();
                List <string> partNames = GCIDB.GetPartList();
                part_listBox.ItemsSource = partNames;

                System.ComponentModel.ICollectionView partName_view = CollectionViewSource.GetDefaultView(part_listBox.ItemsSource);
                partName_view.Filter = partName_CustomFilter;
            }
        }
        private void toExcel_button_Click(object sender, RoutedEventArgs e)
        {
            List <String> SerialNumbers = GetSelectedSerialNumbers();

            if (SerialNumbers.Count == 0)
            {
                MessageBox.Show("Please select serial numbers.");
                return;
            }
            DataTable dtResult = GCIDB.GetLifetimeData(SelectedPartName, SelectedBatchName, SerialNumbers);

            //LifetimeLimitEntity Limits = GCIDB.GetLifetimeLimits(SelectedPartName);
            //LifeTimeReportData LifetimeReport = new LifeTimeReportData(dtResult, Limits);
            //LifetimeReport.GenerateExcelOutput(customerName_textBox.Text, PO_textBox.Text, prodDesc_textBox.Text, SelectedPartName, SelectedBatchName);
            ExportToExcel.FastExportToExcel(dtResult);
        }
예제 #25
0
        private void batchName_listBox1_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            if (batchName_listBox1.SelectedIndex == -1)
            {
                MessageBox.Show("Select a Batch Name!");
            }
            else
            {
                SelectedBatchName = batchName_listBox1.SelectedItem.ToString();
                // MessageBox.Show(string.Format("Pulling Legacy Report for Part ID: {0}  Batch ID: {1}", SelectedPartName, SelectedBatchName));

                //connect to DB, get production data then return into datatable
                GCIDB.Initialize();
                GCIDB.OpenConnection();
                dt = GCIDB.GetProductionData(SelectedPartName, SelectedBatchName);
                dataGrid.DataContext = dt;
            }
        }
예제 #26
0
 private void part_listBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
 {
     if (part_listBox.SelectedIndex == -1)
     {
         MessageBox.Show("Select a Part Name!");
     }
     else
     {
         //pull batch names from the DB, then render the view for filtering
         SelectedPartName = part_listBox.SelectedItem.ToString();
         GCIDB.Initialize();
         GCIDB.OpenConnection();
         List <string> boardNames = GCIDB.GetTestBoardList(SelectedPartName);
         SelectedBoardName = string.Empty;
         testBoardList1.ClearPins();
         selectBoard_listBox.ItemsSource = boardNames;
     }
 }
예제 #27
0
        private void newBoard_button_Click(object sender, RoutedEventArgs e)
        {
            AddBoard window = new AddBoard();

            window.ShowDialog();
            //AddBoard addBoard = new AddBoard();
            //List<String> DeviceNames = window.GetNameList();



            if (window.boolVal == true)
            {
                List <int>    DUTPins       = GCIDB.GetDUTPins(SelectedPartName);
                List <String> DeviceNames   = window.GetNameList();
                Byte          CurrentGCIPin = 1;
                int           SocketIndex   = 0;


                int TestBoardID = GCIDB.GetNextTestBoardID();
                int PartID      = GCIDB.GetPartID(SelectedPartName);

                testBoardList1.ClearPins();
                foreach (String Device in DeviceNames)
                {
                    foreach (byte Pin in DUTPins)
                    {
                        //if (CurrentGCIPin == 48)
                        //    CurrentGCIPin += 4;
                        GCIDB.AddTestPinMap(TestBoardID, window.BoardName, PartID, SocketIndex, Device, Pin, CurrentGCIPin, DateTime.Now);
                        CurrentGCIPin++;
                        //testBoardList1.AddPinMap(PartID, TestBoardID, Device, Pin, CurrentGCIPin++);
                    }
                    testBoardList1.ExtraSpace += 20;
                    SocketIndex++;
                }
                //AddBoardControl window = new AddBoardControl();
                //window.ShowDialog();
            }
            List <string> boardNames = GCIDB.GetTestBoardList(SelectedPartName);

            //SelectedBoardName = string.Empty;
            selectBoard_listBox.ItemsSource = boardNames;
        }
        private void partName_listbox_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            if (partName_listbox.SelectedIndex == -1)
            {
                MessageBox.Show("Select a Part Name!");
            }
            else
            {
                //pull batch names from the DB, then render the view for filtering
                SelectedPartName = partName_listbox.SelectedItem.ToString();
                GCIDB.Initialize();
                GCIDB.OpenConnection();
                batchNames = GCIDB.GetBatchNameList(SelectedPartName);
                batchName_listbox.ItemsSource = batchNames;

                System.ComponentModel.ICollectionView batchName_view = CollectionViewSource.GetDefaultView(batchName_listbox.ItemsSource);
                batchName_view.Filter = batchName_CustomFilter;
            }
        }
예제 #29
0
        void LoadTestInformation()
        {
            LoadedTestInfo   = GCIDB.GetTestPins(SelectedPartName, SelectedBoardName);
            GCItoDUTMap      = new Dictionary <int, int>();
            GCItoDeviceIndex = new Dictionary <int, int>();

            if (LoadedTestInfo.Count > 0)
            {
                LoadedTestBoardID = LoadedTestInfo[0].TestBoardID;
            }

            List <string> SlotNames   = new List <string>();
            List <int>    SocketIndex = new List <int>();

            foreach (TestPinEntity Pin in LoadedTestInfo)
            {
                if (SlotNames.Contains(Pin.SocketName) == false)
                {
                    SlotNames.Add(Pin.SocketName);
                    SocketIndex.Add(Pin.SocketIndex);
                }

                if (GCItoDUTMap.ContainsKey(Pin.GCIPin) == false)
                {
                    GCItoDUTMap.Add(Pin.GCIPin, Pin.DUTPin);
                }

                if (GCItoDeviceIndex.ContainsKey(Pin.GCIPin) == false)
                {
                    GCItoDeviceIndex.Add(Pin.GCIPin, Pin.SocketIndex);
                }
            }
            listProductionInfo1.Clear();

            for (int i = 0; i < SlotNames.Count; i++)
            {
                String     Slot          = SlotNames[i];
                int        Index         = SocketIndex[i];
                List <int> GCIPinsToTest = GetGCITestPinsFromIndex(Index);
                listProductionInfo1.AddProductionTestSlot(Slot, Index, LoadedTestBoardID, GCIPinsToTest);
            }
        }
예제 #30
0
        private void selectBoard_listBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            if (selectBoard_listBox.Items.Count > 0)
            {
                if (selectBoard_listBox.SelectedItem == null)
                {
                    return;
                }

                if (SelectedBoardName == selectBoard_listBox.SelectedItem.ToString())
                {
                    return;
                }
                SelectedBoardName = selectBoard_listBox.SelectedItem.ToString();

                LoadedTestInfo = GCIDB.GetTestPins(SelectedPartName, SelectedBoardName);
                testBoardList1.ClearPins();
                //  test
                String LastDeviceName = string.Empty;
                foreach (TestPinEntity Pin in LoadedTestInfo)
                {
                    if (LastDeviceName.Length > 0 && (LastDeviceName != Pin.SocketName))
                    {
                        testBoardList1.ExtraSpace += 20;
                    }

                    testBoardList1.AddPinMap(Pin);
                    LastDeviceName = Pin.SocketName;
                }

                SelectedPartName = part_listBox.SelectedItem.ToString();
                GCIDB.Initialize();
                GCIDB.OpenConnection();
                List <string> boardNames = GCIDB.GetTestBoardList(SelectedPartName);
                SelectedBoardName = string.Empty;
                selectBoard_listBox.ItemsSource = boardNames;

                SelectedBoardName = selectBoard_listBox.SelectedItem.ToString();
            }
        }