Beispiel #1
0
        /// <summary>
        /// 图谱初始化
        /// </summary>
        /// <param name="rowCount">行数</param>
        /// <param name="columnCount">列数</param>
        /// <param name="dic_DieState_Color">芯片状态-颜色 字典</param>
        /// <param name="initialDieState">初始状态</param>
        public void Initial(int rowCount, int columnCount, List <InspectionDataView> list_InspectionDataView)
        {
            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);
            }
        }
Beispiel #2
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);
        }
 public void ChangeSelectedText(int rowIndex, int columnIndex, InspectionResult inspectionResult)
 {
     SelectionText = string.Format("行{0} 列{1} {2}", rowIndex, columnIndex, InspectionResultsConverter.ToString(inspectionResult));
 }