Beispiel #1
0
        void ConstructELSpecSheetsPlots(LJVScanSummaryVM ssvm, string sheetName = "Data")
        {
            activeSheet = originApp.FindWorksheet(sheetName);
            if (activeSheet == null)
            {
                sheetName = (String)originApp.CreatePage((int)Origin.PAGETYPES.OPT_WORKSHEET, sheetName, "Origin", 2);
            }
            activeSheet = (Worksheet)originApp.WorksheetPages[sheetName].Layers[0];
            activeSheet.Execute("window -i");//minimize worksheet
            int scanCounter = 0;

            colorCounter = 0;
            foreach (ELSpectrum spec in ssvm.TheLJVScanSummary.ELSpectrums)
            {
                activePixelName = spec.Pixel.Site;
                if (activePixelName == "SiteA")
                {
                    activeSheet.Name = "SiteA";
                    activeSheet      = (Worksheet)originApp.WorksheetPages[sheetName].Layers[0];
                    PopulateELSpecSheet(new ELSpecVM(spec));
                    scanCounter++;
                }
                else
                {
                    originApp.WorksheetPages[sheetName].Layers.Add(spec.Pixel.Site);
                    activeSheet = (Worksheet)originApp.WorksheetPages[sheetName].Layers[scanCounter];
                    PopulateELSpecSheet(new ELSpecVM(spec));
                    scanCounter++;
                    colorCounter++;
                }
                string label = spec.DeviceLJVScanSummary.Device.Label + "_EL";
                PlotELSpec(label);
            }
        }
        private static void WriteQDBColorToWS(ExcelWorksheet ws, QDBatch qdb)
        {
            int rowCounter           = 1;
            List <Device> deviceList = new List <Device>(qdb.Devices);

            deviceList = deviceList.OrderBy(x => x.DeviceBatch.FabDate).ThenBy(y => y.BatchIndex).ToList();

            foreach (Device d in deviceList)
            {
                int columnCounter = 2;
                ws.Cells[rowCounter, 1].Value = d.Label;
                foreach (DeviceLJVScanSummary ss in d.DeviceLJVScanSummaries)
                {
                    List <LJVScan> scansWherePixelLitUp = ss.LJVScans.ToList();
                    for (int j = 0; j < scansWherePixelLitUp.Count; j++)
                    {
                        if (scansWherePixelLitUp[j].PixelLitUp.HasValue)              //if PixelLitUp is not null
                        {
                            if (!scansWherePixelLitUp[j].PixelLitUp.Value)            //if it didn't light up
                            {
                                scansWherePixelLitUp.Remove(scansWherePixelLitUp[j]); //remove it from the list
                            }
                        }
                    }
                    //Debug.WriteLine("Adding data to cell for device " + d.BatchIndex + " with testCondition " + ss.TestCondition);
                    if (scansWherePixelLitUp.Count > 0)
                    {
                        try
                        {
                            LJVScanSummaryVM vm = new LJVScanSummaryVM(ss);

                            string cellString = string.Concat(
                                ss.TestCondition,
                                "\n",
                                "Peak λ: ",
                                vm.PeakLambda.Mean,
                                " FWHM: ",
                                vm.FWHM.Mean,
                                " CIE x: ",
                                vm.CIEx.Mean,
                                " CIE y: ",
                                vm.CIEy.Mean
                                );
                            ws.Cells[rowCounter, columnCounter].Value = cellString;
                            columnCounter++;
                        }
                        catch (Exception e)
                        {
                            Debug.WriteLine(e.ToString());
                        }
                    }
                }
                rowCounter++;
            }
        }
Beispiel #3
0
 private async Task <SingleDeviceScanVM> InitializeAsync(Device dev, DeviceBatchContext context)
 {
     return(await Task.Run(() =>
     {
         TheDeviceVM = new DeviceVM(dev, ctx);
         RunVoltageSweepCommand = AsyncCommand.Create(token => ScanPixelAndProcessData(token));
         TheLJVScanSummaryVM = new LJVScanSummaryVM(ctx);
         TheLJVScanSummaryVM.TheLJVScanSummary.Device = ctx.Devices.Where(x => x.DeviceId == TheDeviceVM.TheDevice.DeviceId).First();
         TheLJVScanSummaryVM.TheLJVScanSummary.TestCondition = TheScanSpec.TestCondition;
         string bts = ConfigurationManager.AppSettings.Get("BatchTestSystem");
         if (bts == "BTS2")
         {
             TheImagingControl = InstrumentService.LJVScanCoordinator.TheImagingControl;
         }
         return this;
     }));
 }
        private static void WriteColorDataToWorksheet(ExcelWorksheet ws, DeviceBatch devBatch, int startColumn)
        {
            HashSet <string> testConditions = new HashSet <string>();

            foreach (Device d in devBatch.Devices)
            {
                foreach (DeviceLJVScanSummary ss in d.DeviceLJVScanSummaries)
                {
                    testConditions.Add(ss.TestCondition);
                }
            }
            List <string> testConditionsList = testConditions.ToList();

            testConditionsList.Sort();
            //label test conditions
            for (int i = 1; i <= testConditionsList.Count(); i++)
            {
                ws.Cells[1, startColumn + i - 1].Value = testConditionsList[i - 1];
            }
            foreach (Device d in devBatch.Devices)
            {
                for (int i = 0; i < testConditions.Count(); i++)
                {
                    foreach (DeviceLJVScanSummary ss in d.DeviceLJVScanSummaries)
                    {
                        if (ss.TestCondition == testConditionsList[i])
                        {
                            LJVScanSummaryVM vm = new LJVScanSummaryVM(ss);

                            string cellString = string.Concat(
                                "Peak λ: ",
                                vm.PeakLambda.Mean,
                                " FWHM: ",
                                vm.FWHM.Mean,
                                " CIE x: ",
                                vm.CIEx.Mean,
                                " CIE y: ",
                                vm.CIEy.Mean
                                );
                            ws.Cells[d.BatchIndex + 1, startColumn + i].Value = cellString;
                        }
                    }
                }
            }
        }
Beispiel #5
0
 private async Task <SingleDeviceScanVM> ManualSweepInitializeAsync()
 {
     return(await Task.Run(() =>
     {
         InstrumentService.LJVScanCoordinator.PurgeSubscribers();
         TheDeviceVM = new DeviceVM();
         TheLJVScanSummaryVM = new LJVScanSummaryVM();
         TheLJVScanSummaryVM.TheLJVScanSummary.Device = TheDeviceVM.TheDevice;
         RunVoltageSweepCommand = AsyncCommand.Create(token => ScanPixelAndProcessData(token));
         ScanAllPixelsCommand = AsyncCommand.Create(token => ScanAllPixels(token));
         //InstrumentService.LJVScanCoordinator.VoltageSweepFinished += InstrumentService_VoltageSweepFinished;
         SelectedPixel = theDeviceVM.PixelsDict["SiteA"];
         string bts = ConfigurationManager.AppSettings.Get("BatchTestSystem");
         if (bts == "BTS2")
         {
             TheImagingControl = InstrumentService.LJVScanCoordinator.TheImagingControl;
         }
         return this;
     }));
 }
Beispiel #6
0
        void ConstructFullDATSheetsPlots(LJVScanSummaryVM ssvm, string sheetName = "Data")
        {
            activeSheet = originApp.FindWorksheet(sheetName);
            if (activeSheet == null)
            {
                sheetName = (String)originApp.CreatePage((int)Origin.PAGETYPES.OPT_WORKSHEET, sheetName, "Origin", 2);
            }
            activeSheet = (Worksheet)originApp.WorksheetPages[sheetName].Layers[0];
            activeSheet.Execute("window -i");//minimize worksheet
            int scanCounter = 0;

            colorCounter = 0;
            foreach (LJVScan scan in ssvm.TheLJVScanSummary.LJVScans)
            {
                activePixelName = scan.Pixel.Site;
                if (scan.Pixel.Site == "SiteA")
                {
                    activeSheet.Name = "SiteA";
                    activeSheet      = (Worksheet)originApp.WorksheetPages[sheetName].Layers[0];
                    PopulateFullDATSheet(new LJVScanVM(scan));
                    scanCounter++;
                }
                else
                {
                    originApp.WorksheetPages[sheetName].Layers.Add(scan.Pixel.Site);
                    activeSheet = (Worksheet)originApp.WorksheetPages[sheetName].Layers[scanCounter];
                    PopulateFullDATSheet(new LJVScanVM(scan));
                    scanCounter++;
                    colorCounter++;
                }
                string label = scan.DeviceLJVScanSummary.Device.Label;
                PlotFullDATXY(FullDATField.Voltage, FullDATField.PCurrChangePercent, (label + "_PDCV"));
                PlotFullDATXY(FullDATField.CurrentDensity, FullDATField.CurrentEff, (label + "_CEJ"));
                PlotFullDATXY(FullDATField.Luminance, FullDATField.EQE, (label + "_EQEL"));
                PlotFullDATXY(FullDATField.Voltage, FullDATField.CurrentDensity, (label + "_JV"), AxisType.Logarithmic, AxisType.Logarithmic);
                PlotFullDATXY(FullDATField.Voltage, FullDATField.CurrentDensity, (label + "_LJV"), AxisType.Linear, AxisType.Logarithmic, "DoubleY");
            }
        }
Beispiel #7
0
        private void ConstructSingleTCSheetsPlots(LJVScanSummaryVM ssvm, string sheetName = "Data")
        {
            activeSheet = originApp.FindWorksheet(sheetName);
            if (activeSheet == null)
            {
                sheetName = (String)originApp.CreatePage((int)Origin.PAGETYPES.OPT_WORKSHEET, sheetName, "Origin", 2);
            }
            activeSheet = (Worksheet)originApp.WorksheetPages[sheetName].Layers[0];
            int scanCounter = 0;

            colorCounter = 0;
            foreach (LJVScan scan in ssvm.TheLJVScanSummary.LJVScans)
            {
                activePixelName = scan.Pixel.Site;
                if (scan.Pixel.Site == "SiteA")
                {
                    activeSheet.Name = "SiteA";
                    activeSheet      = (Worksheet)originApp.WorksheetPages[sheetName].Layers[0];
                    PopulateProcDATSheet(new LJVScanVM(scan));
                    scanCounter++;
                }
                else
                {
                    originApp.WorksheetPages[sheetName].Layers.Add(scan.Pixel.Site);
                    activeSheet = (Worksheet)originApp.WorksheetPages[sheetName].Layers[scanCounter];
                    PopulateProcDATSheet(new LJVScanVM(scan));
                    scanCounter++;
                    colorCounter++;
                }

                PlotCEJ(scan.DeviceLJVScanSummary.Device.Label);
                PlotEQEL(scan.DeviceLJVScanSummary.Device.Label);
                PlotJV(scan.DeviceLJVScanSummary.Device.Label);
                PlotLJV(scan.DeviceLJVScanSummary.Device.Label);
                TileGraphs();
            }
        }
Beispiel #8
0
 public Task GenerateFullDATOPJ(DeviceBatchVM DBVM, string testCondition)
 {
     return(Task.Run(() =>
     {
         KillAllOriginApps();
         dbvm = DBVM;
         originApp = new Application
         {
             Visible = MAINWND_VISIBLE.MAINWND_SHOW,
         };
         originApp.Reset();
         activeTestCondition = testCondition;
         ConstructSingleTCDirectory(testCondition);
         foreach (Device d in dbvm.TheDeviceBatch.Devices)
         {
             originApp.ActiveFolder = originApp.RootFolder.Folders.FolderFromPath(d.Label);
             var ss = d.DeviceLJVScanSummaries.Where(x => x.TestCondition == testCondition).FirstOrDefault();
             if (ss != null)
             {
                 activeSheetName = string.Concat("sheet", ss.TestCondition, d.BatchIndex);
                 var charsToRemove = new string[] { "-", ".", "_" };
                 foreach (var c in charsToRemove)
                 {
                     activeSheetName = activeSheetName.Replace(c, string.Empty);
                 }
                 Debug.WriteLine("activeSheetName: " + activeSheetName);
                 var ssvm = new LJVScanSummaryVM(ss);
                 ConstructFullDATSheetsPlots(ssvm, activeSheetName);
                 activeSheetName = "EL" + activeSheetName;
                 ConstructELSpecSheetsPlots(ssvm, activeSheetName);
                 TileGraphs();
             }
         }
         SaveOPJAndRelease(String.Concat("FullDAT_", testCondition));
     }));
 }
Beispiel #9
0
        private void PopulateCompareStatsSheetThenPlotXY(StatsDATField xval, StatsDATField yval, string sheetName, AxisType xAxis = AxisType.Linear, AxisType yAxis = AxisType.Linear)
        {
            //create worksheet
            activeSheet = originApp.FindWorksheet(sheetName);
            if (activeSheet == null)
            {
                sheetName = (String)originApp.CreatePage((int)Origin.PAGETYPES.OPT_WORKSHEET, sheetName, "Origin", 2);
            }
            activeSheet = (Worksheet)originApp.WorksheetPages[sheetName].Layers[0];
            //count columns to create from # of scans
            int colsCounter = 0;

            foreach (Device d in dbvm.TheDeviceBatch.Devices)
            {
                foreach (DeviceLJVScanSummary ss in d.DeviceLJVScanSummaries)
                {
                    if (ss.TestCondition == activeTestCondition)
                    {
                        foreach (LJVScan scan in ss.LJVScans)
                        {
                            colsCounter++;
                        }
                    }
                }
            }
            activeSheet.Cols = colsCounter * 3;//xval (mean),yval(mean),yerror (no xerror because messy)
            colsCounter      = 0;
            //create graph layer
            String strGrName = string.Concat("graph_", sheetName);

            activeGraphLayer1 = originApp.FindGraphLayer(strGrName);
            if (activeGraphLayer1 == null)
            {
                strGrName = (String)originApp.CreatePage((int)Origin.PAGETYPES.OPT_GRAPH, strGrName, "Scatter", 2);
            }
            activeGraphLayer1 = (GraphLayer)originApp.GraphPages[strGrName].Layers[0];
            String strPlotName = string.Concat(strGrName, "_line");

            activeDataPlot   = activeGraphLayer1.DataPlots[strPlotName];
            colorCounter     = 0;
            lineStyleCounter = 0;
            if (activeSheet.Cols > 0)
            {
                //populate columns with data then add DataPlots to GraphLayer
                foreach (Device d in dbvm.TheDeviceBatch.Devices)
                {
                    Debug.WriteLine("Plotting " + sheetName + " for " + d.Label);
                    foreach (DeviceLJVScanSummary ss in d.DeviceLJVScanSummaries)
                    {
                        if (ss.TestCondition == activeTestCondition)
                        {
                            lineStyleCounter = 0;
                            LJVScanSummaryVM vm = new LJVScanSummaryVM(ss);
                            var array           = vm.StatsDatArray();
                            activeSheet.Columns[colsCounter].LongName = StatsDATLongNames[xval];
                            activeSheet.Columns[colsCounter].Type     = COLTYPES.COLTYPE_X;
                            activeSheet.Columns[colsCounter].Units    = StatsDATUnits[xval];
                            activeSheet.SetData(array.GetCol((int)xval), 0, colsCounter);
                            activeSheet.Columns[colsCounter + 1].LongName = StatsDATLongNames[yval];
                            activeSheet.Columns[colsCounter + 1].Type     = COLTYPES.COLTYPE_Y;
                            activeSheet.Columns[colsCounter + 1].Units    = StatsDATUnits[yval];
                            activeSheet.Columns[colsCounter + 1].Comments = d.Label;
                            activeSheet.SetData(array.GetCol((int)yval), 0, colsCounter + 1);
                            activeSheet.Columns[colsCounter + 2].Type = COLTYPES.COLTYPE_ERROR;//set y error stuff
                            activeSheet.SetData(array.GetCol((int)yval + 1), 0, colsCounter + 2);
                            DataRange dr = activeSheet.NewDataRange();
                            dr.Add("X", activeSheet, 0, colsCounter, -1, colsCounter);          //add data for X column
                            dr.Add("Y", activeSheet, 0, colsCounter + 1, -1, colsCounter + 1);
                            dr.Add("ED", activeSheet, 0, colsCounter + 2, -1, colsCounter + 2); //ED==origin name for Yerror type XDDDD
                            activeDataPlot = activeGraphLayer1.DataPlots.Add(dr, PLOTTYPES.IDM_PLOT_LINE);
                            activeGraphLayer1.Execute(string.Concat("set ", activeDataPlot.Name, " -c color(", plotColors[colorCounter], ")"));
                            activeGraphLayer1.Execute(string.Concat("set ", activeDataPlot.Name, " -d ", lineStyleCounter));
                            colsCounter += 3;
                            lineStyleCounter++;
                        }
                    }
                    colorCounter++;//do this to use same line color for each device
                }
                if (xAxis == AxisType.Logarithmic)
                {
                    activeGraphLayer1.Execute("layer.x.type = 2");
                }
                if (yAxis == AxisType.Logarithmic)
                {
                    activeGraphLayer1.Execute("layer.y.type = 2");
                }
                FormatXYGraph();
            }
        }