프로젝트

일반

사용자정보

개정판 288a94c5

ID288a94c5f6bcd0f5be3d85a9db0589442f1feaf9
상위 65cb96ef
하위 fe2de78e

백흠경이(가) 일년 이상 전에 추가함

Fix: 유사도 분류 기능 오류 수정

Change-Id: I950191479a63d1fed8d834140a77b5d3b190f12d

차이점 보기:

ID2.Manager/ID2.Manager/Controls/Classify.cs
32 32
            Application.ProductName, $"{Application.ProductName}.ini");
33 33

  
34 34
        #region 기본값
35
        private static string AutoCADLayer { get; } = "AutoCAD";
36
        private static Color AutoCADColor = Color.FromArgb(44, 44, 44);
37
        private static string AVEVALayer { get; } = "AVEVA";
38
        private static Color AVEVAColor = Color.FromArgb(44, 44, 44);
39
        private static Color DiffColor = Color.Yellow;
40
        private static Color RevCloudColor = Color.Magenta;
41 35
        private static double Tolerance = 0;
42 36
        private static double Simularity { get; set; } = 80;
43 37
        private static double LengthToleranceRatio { get; set; } = 0.1;
44 38

  
39
        private static Font UnmatchedFont = new System.Drawing.Font("Segoe UI", 9F, FontStyle.Italic);
40
        private static Font MatchedFont = new System.Drawing.Font("Segoe UI", 9F, FontStyle.Bold);
41

  
45 42
        private string dwgExtension { get; } = ".dwg";
46 43
        #endregion
47 44

  
......
175 172
                });
176 173
            }
177 174

  
175
            this.designDrawing.Entities.Clear();
176
            this.designDrawing.Blocks.Clear();
178 177
            RadMessageBox.Show("Classifying drawing is complete.");
179 178
        }
180 179

  
......
254 253
            #endregion
255 254

  
256 255
            this.radGridViewDocument.CellDoubleClick += RadGridViewDocument_CellDoubleClick;
256
            this.radGridViewDocument.ViewRowFormatting += RadGridViewDocument_ViewRowFormatting;
257
        }
258

  
259
        private void RadGridViewDocument_ViewRowFormatting(object sender, RowFormattingEventArgs e)
260
        {
261
            if (e.RowElement is GridRowElement)
262
            {
263
                if (e.RowElement.RowInfo.DataBoundItem is Documents doc)
264
                {
265
                    string DwgFolder = System.IO.Path.Combine(informations.FindID2LocalPath(doc.RefProjectCode), "drawings", "Native");
266
                    string DocNo = doc.DocumentNo;
267
                    string FilePath = System.IO.Path.Combine(DwgFolder, $"{DocNo}{dwgExtension}");
268
                    if (!File.Exists(FilePath))
269
                    {
270
                        e.RowElement.ForeColor = Color.Gray;
271
                        e.RowElement.Font = UnmatchedFont;
272
                    }
273
                    else
274
                    {
275
                        e.RowElement.ResetValue(LightVisualElement.ForeColorProperty, ValueResetFlags.Local);
276
                        e.RowElement.Font = MatchedFont;
277
                    }
278
                }
279
            }
280
            else
281
            {
282
                e.RowElement.ResetValue(LightVisualElement.ForeColorProperty, ValueResetFlags.Local);
283
                e.RowElement.ResetValue(LightVisualElement.FontProperty, ValueResetFlags.Local);
284
            }
257 285
        }
258 286

  
259 287
        /// <summary>
......
295 323
        /// </summary>
296 324
        private double CompareDrawing(Design design, IList<Entity> FirstEntities, IList<Entity> SecondEntities)
297 325
        {
298
            bool[] equalEntitiesInV2 = new bool[FirstEntities.Count];
326
            bool[] equalEntitiesInV2 = new bool[SecondEntities.Count];
299 327
            var EqualIndices = new List<int>();
300 328

  
301 329
            /// 서로 검사 가능한 타입인지 확인한다.
......
321 349
                    {
322 350
                        Entity entVp2 = SecondEntities[j];
323 351

  
324
                        if (!equalEntitiesInV2[j] && CheckType(entVp1, entVp2) &&
325
                            CompareIfEqual(design, entVp1, design, entVp2))
352
                        if (!equalEntitiesInV2[j] && CheckType(entVp1, entVp2) && CompareIfEqual(design, entVp1, design, entVp2))
326 353
                        {
327 354
                            EqualIndices.Add(j);
328 355
                        }
......
348 375
                {
349 376
                    if (!equalEntitiesInV2[j]) differents[1]++;
350 377
                }
378

  
379
                double a = Math.Abs(FirstEntities.Count - SecondEntities.Count) / ((FirstEntities.Count + SecondEntities.Count) * 0.5) * 100;
380
                double b = FirstEntities.Count > 0 ? ((double)differents[0] / (double)FirstEntities.Count) * 100 : 100;
381
                double c = SecondEntities.Count > 0 ? ((double)differents[1] / (double)SecondEntities.Count) * 100 : 100;
382

  
383
                return (a + b + c) / 3;
351 384
            }
352 385
            catch (Exception ex)
353 386
            {
354 387
                Console.Write($"Error : {ex.Message}");
355 388
            }
356 389

  
357
            double a = Math.Abs(FirstEntities.Count - SecondEntities.Count) / ((FirstEntities.Count + SecondEntities.Count) * 0.5) * 100;
358
            double b = FirstEntities.Count > 0 ? ((double)differents[0] / (double)FirstEntities.Count) * 100 : 100;
359
            double c = SecondEntities.Count > 0 ? ((double)differents[1] / (double)SecondEntities.Count) * 100 : 100;
360

  
361
            return (a + b + c) / 3;
390
            return 100;
362 391
        }
363 392

  
364 393
        public void DocumentListBinding(List<ID2.Manager.Data.Models.Documents> docs)

내보내기 Unified diff

클립보드 이미지 추가 (최대 크기: 500 MB)