示例#1
0
        /// <summary>
        /// 修改芯片状态
        /// </summary>
        /// <param name="rowIndex">行序号,从0开始</param>
        /// <param name="columnIndex">列序号,从0开始</param>
        /// <param name="state">芯片状态</param>
        public void SetDieState(int rowIndex, int columnIndex, InspectionResult inspectionResult)
        {
            if (!IsInitialized)
            {
                return;
            }
            MappingData data = DataCollection[rowIndex * ColumnCount + columnIndex];

            ExampleData example = ExampleCollection.Where(e => e.DieState == InspectionResultsConverter.ToString(data.DieState)).FirstOrDefault();

            example.Count--;

            data.DieState = inspectionResult;

            example = ExampleCollection.Where(e => e.DieState == InspectionResultsConverter.ToString(data.DieState)).FirstOrDefault();
            example.Count++;
            mappingViewModel.ChangeSelectedText(rowIndex, columnIndex, inspectionResult);

            ScrollToView(data);
        }
示例#2
0
        /// <summary>
        /// 图谱初始化 重载
        /// </summary>
        /// <param name="rowCount">行数</param>
        /// <param name="columnCount">列数</param>
        /// <param name="dic_DieState_Color">芯片状态-颜色 字典</param>
        /// <param name="initialDieState">初始状态</param>
        /// <param name="Dict_DefectType">错误码</param>
        /// <param name="dbFilePath">数据库路径</param>
        /// <param name="lotIndex">批次号</param>
        /// <param name="frameName">盘名</param>
        public void Initial(int rowCount, int columnCount, List <InspectionDataView> list_InspectionDataView, Dictionary <int, string> Dict_DefectType, string dbFilePath, int lotIndex, string frameName, List <ReviewEditData> list_editData)
        {
            this.DbFilePath    = dbFilePath;
            this.LotIndex      = lotIndex;
            this.FrameName     = frameName;
            this.List_editData = list_editData;
            DataCollection.Clear();
            ExampleCollection.Clear();
            double cellWidth, cellHeight;

            RowCount    = rowCount;
            ColumnCount = columnCount;
            SetCellSize(RowCount, ColumnCount, out cellWidth, out cellHeight);
            for (int i = 0; i < rowCount; i++)
            {
                for (int j = 0; j < columnCount; j++)
                {
                    MappingData data = new MappingData();
                    data.BorderThickness   = DefaultBorderThickness;
                    data.Width             = cellWidth;
                    data.Height            = cellHeight;
                    data.VariableX         = j * data.Width;
                    data.VariableY         = i * data.Height;
                    data.RowIndex          = i;
                    data.ColumnIndex       = j;
                    data.DieState          = InspectionResult.SKIP;
                    data.NormalBorderColor = DefaultBorderColor;
                    DataCollection.Add(data);
                }
            }
            foreach (InspectionDataView dataView in list_InspectionDataView)
            {
                DataCollection[dataView.RowIndex * ColumnCount + dataView.ColumnIndex].DieState = dataView.InspectionResult;
                if (dataView.List_DefectData.Count != 0)
                {
                    string[] defectTypeStrings = new string[dataView.List_DefectData.Count];
                    for (int i = 0; i < dataView.List_DefectData.Count; i++)
                    {
                        defectTypeStrings[i] = dataView.List_DefectData[i].ToString();
                    }
                    DataCollection[dataView.RowIndex * ColumnCount + dataView.ColumnIndex].DefectTypeIndexString = string.Join(";", defectTypeStrings);
                }
            }
            double fontSize = SetFontSize(cellWidth, cellHeight);

            foreach (MappingData data in DataCollection)
            {
                data.FontSize = fontSize;
            }

            foreach (KeyValuePair <InspectionResult, Color> kv in MappingData.Dict_DieState_Color)
            {
                ExampleData data = new ExampleData();
                data.DieState    = InspectionResultsConverter.ToString(kv.Key);
                data.FillColor   = kv.Value.ToString();
                data.BorderColor = DefaultBorderColor.ToString();
                data.Count       = DataCollection.Where(d => d.DieState == kv.Key).Count();
                ExampleCollection.Add(data);
            }
            this.Dict_DefectType = Dict_DefectType;

            //foreach (ReviewEditData item in List_editData)
            //{
            //    SetDieState(item.Row, item.Col, InspectionResults.K2N);
            //}
        }