프로젝트

일반

사용자정보

개정판 328fbd35

ID328fbd35c7d12f07db2be9a0b2ccdfb5ba050c53
상위 e5a65871
하위 bc639f0b

백흠경이(가) 10달 전에 추가함

Fix: 유사도 평가 오류 메시지 출력

Change-Id: I397d0988d4a675906b81cad9b4e0238f3c6a94df

차이점 보기:

ID2.Manager/ID2.Manager.Compare/Controls/Verification.cs
730 730
                            }
731 731
                        }
732 732
                        ra.AddToScene(design);
733
                        (design as MyModel).FilePath = FilePath;
733
                        design.Tag = FilePath;
734 734
                    }
735 735
                }
736 736
                catch (Exception ex)
......
1137 1137
                var ID2DefaultSize = new Size(9600, 6787);
1138 1138
                double margin = 5;
1139 1139

  
1140
                if (!dwgFilePath.Equals(this.designCompare.FilePath)) ShowAutoCADFile(dwgFilePath, this.designCompare);
1140
                if (!dwgFilePath.Equals(this.designCompare.Tag)) ShowAutoCADFile(dwgFilePath, this.designCompare);
1141 1141
                
1142 1142
                double ScaleX = this.designCompare.Entities.BoxSize.X / ID2DefaultSize.Width;
1143 1143
                double ScaleY = this.designCompare.Entities.BoxSize.Y / ID2DefaultSize.Height;
ID2.Manager/ID2.Manager.Compare/Properties/AssemblyInfo.cs
16 16
[assembly: Guid("226ce2a3-dd88-4c99-a8e6-fac5a4d78c71")]
17 17

  
18 18
// [assembly: AssemblyVersion("1.0.*")]
19
[assembly: AssemblyVersion("20.24.5.2")]
20
[assembly: AssemblyFileVersion("20.24.5.2")]
19
[assembly: AssemblyVersion("20.24.5.3")]
20
[assembly: AssemblyFileVersion("20.24.5.3")]
21 21
[assembly: log4net.Config.XmlConfigurator(ConfigFile = "Log.config", Watch = true)]
ID2.Manager/ID2.Manager/Classes/CompareModelWorkUnit.cs
91 91
            int count = 0;
92 92
            for (int i = 0; i < _Docs.Count - 1; ++i)
93 93
            {
94
                string FirstDocNo = _Docs.ElementAt(i).DocumentNo;
95
                string FirstFilePath = _Docs.ElementAt(i).LocalDrawingFilePath;
96
                if (!System.IO.File.Exists(FirstFilePath))
94
                try
97 95
                {
98
                    UpdateProgress(count++, sum, "Comparing....", worker);
99
                    continue;
100
                }
101

  
102
                #region 첫 번째 도면을 연다.
103
                _FirstWorkspace.Invoke(new Action(() =>
104
                {
105
                    _FirstWorkspace.Entities.Clear();
106
                    _FirstWorkspace.Blocks.Clear();
107
                }));
108

  
109
                OpenDrawing(_FirstWorkspace, FirstFilePath);
110
                #endregion
111
                var FirstEntities = IgnoreText ? _FirstWorkspace.Entities.Where(x => !(x is Text)).ToList() : _FirstWorkspace.Entities.ToList();
112
                for (int j = i + 1; j < _Docs.Count; ++j)
113
                {
114
                    if (Cancelled(worker, doWorkEventArgs)) break;
115

  
116
                    string SecondDocNo = _Docs.ElementAt(j).DocumentNo;
117
                    string SecondFilePath = _Docs.ElementAt(j).LocalDrawingFilePath;
118
                    if (!System.IO.File.Exists(SecondFilePath))
96
                    string FirstDocNo = _Docs[i].DocumentNo;
97
                    string FirstFilePath = _Docs[i].LocalDrawingFilePath;
98
                    if (!System.IO.File.Exists(FirstFilePath))
119 99
                    {
120 100
                        UpdateProgress(count++, sum, "Comparing....", worker);
121 101
                        continue;
122 102
                    }
123 103

  
124
                    #region  번째 도면을 연다.
125
                    _SecondWorkspace.Invoke(new Action(() =>
104
                    #region  번째 도면을 연다.
105
                    _FirstWorkspace.Invoke(new Action(() =>
126 106
                    {
127
                        _SecondWorkspace.Entities.Clear();
128
                        _SecondWorkspace.Blocks.Clear();
107
                        _FirstWorkspace.Entities.Clear();
108
                        _FirstWorkspace.Blocks.Clear();
129 109
                    }));
130
                    OpenDrawing(_SecondWorkspace, SecondFilePath);
131
                    #endregion
132 110

  
133
                    var SecondEntities = IgnoreText ? _SecondWorkspace.Entities.Where(x => !(x is Text)).ToList() : _SecondWorkspace.Entities.ToList();
134
                    if (FirstEntities.Any() && SecondEntities.Any())
111
                    OpenDrawing(_FirstWorkspace, FirstFilePath);
112
                    #endregion
113
                    var FirstEntities = IgnoreText ? _FirstWorkspace.Entities.Where(x => !(x is Text)).ToList() : _FirstWorkspace.Entities.ToList();
114
                    for (int j = i + 1; j < _Docs.Count; ++j)
135 115
                    {
136
                        double simularity = 100 - CompareDrawing(_FirstWorkspace, _SecondWorkspace, FirstEntities, SecondEntities);
137
                        if (simularity >= Simularity)
116
                        if (Cancelled(worker, doWorkEventArgs)) break;
117

  
118
                        try
138 119
                        {
139
                            var group = DrawingGroupColl.FirstOrDefault(x => x.Drawings.Exists(y => y.Equals(FirstDocNo) || y.Equals(SecondDocNo)));
140
                            if (group != null)
120
                            string SecondDocNo = _Docs[j].DocumentNo;
121
                            string SecondFilePath = _Docs[j].LocalDrawingFilePath;
122
                            if (!System.IO.File.Exists(SecondFilePath))
141 123
                            {
142
                                if (!group.Drawings.Exists(x => x.Equals(FirstDocNo))) group.Drawings.Add(FirstDocNo);
143
                                if (!group.Drawings.Exists(x => x.Equals(SecondDocNo))) group.Drawings.Add(SecondDocNo);
124
                                UpdateProgress(count++, sum, "Comparing....", worker);
125
                                continue;
144 126
                            }
145
                            else
127

  
128
                            #region 두 번째 도면을 연다.
129
                            _SecondWorkspace.Invoke(new Action(() =>
130
                            {
131
                                _SecondWorkspace.Entities.Clear();
132
                                _SecondWorkspace.Blocks.Clear();
133
                            }));
134
                            OpenDrawing(_SecondWorkspace, SecondFilePath);
135
                            #endregion
136

  
137
                            var SecondEntities = IgnoreText ? _SecondWorkspace.Entities.Where(x => !(x is Text)).ToList() : _SecondWorkspace.Entities.ToList();
138
                            if (FirstEntities.Any() && SecondEntities.Any())
146 139
                            {
147
                                group = new ID2.Manager.Controls.Classify.DrawingGroup();
148
                                group.Drawings.Add(FirstDocNo);
149
                                group.Drawings.Add(SecondDocNo);
150
                                DrawingGroupColl.Add(group);
140
                                double simularity = 100 - CompareDrawing(_FirstWorkspace, _SecondWorkspace, FirstEntities, SecondEntities);
141
                                if (simularity >= Simularity)
142
                                {
143
                                    var group = DrawingGroupColl.Find(x => x.Drawings.Exists(y => y.Equals(FirstDocNo) || y.Equals(SecondDocNo)));
144
                                    if (group != null)
145
                                    {
146
                                        if (!group.Drawings.Exists(x => x.Equals(FirstDocNo))) group.Drawings.Add(FirstDocNo);
147
                                        if (!group.Drawings.Exists(x => x.Equals(SecondDocNo))) group.Drawings.Add(SecondDocNo);
148
                                    }
149
                                    else
150
                                    {
151
                                        group = new ID2.Manager.Controls.Classify.DrawingGroup();
152
                                        group.Drawings.Add(FirstDocNo);
153
                                        group.Drawings.Add(SecondDocNo);
154
                                        DrawingGroupColl.Add(group);
155
                                    }
156
                                }
151 157
                            }
158

  
159
                            UpdateProgress(count++, sum, "Comparing....", worker);
160
                        }
161
                        catch(Exception ex)
162
                        {
163
                            this.AppendToLog($"{_Docs[i].DocumentNo} - {_Docs[j].DocumentNo} : {ex.Message}");
152 164
                        }
153 165
                    }
154

  
155
                    UpdateProgress(count++, sum, "Comparing....", worker);
166
                    if (Cancelled(worker, doWorkEventArgs)) break;
167
                }
168
                catch(Exception ex)
169
                {
170
                    this.AppendToLog($"{_Docs[i].DocumentNo} : {ex.Message}");
156 171
                }
157
                if (Cancelled(worker, doWorkEventArgs)) break;
158 172
            }
159 173
        }
160 174

  
......
796 810
                {
797 811
                    group.Drawings.ForEach(x =>
798 812
                    {
799
                        var doc = _Docs.FirstOrDefault(y => y.DocumentNo.Equals(x));
813
                        var doc = _Docs.Find(y => y.DocumentNo.Equals(x));
800 814
                        if (doc != null)
801 815
                        {
802 816
                            if(_FieldName)
......
807 821
                    });
808 822
                }
809 823

  
810
                RadMessageBox.Show("Evaluation of simularity is complete.");
824
                if (!string.IsNullOrEmpty(this.Log))
825
                {
826
                    RadMessageBox.Show("Evaluation of simularity has error(s).", "Caption", MessageBoxButtons.OK, RadMessageIcon.Info, this.Log);
827
                }
828
                else
829
                {
830
                    RadMessageBox.Show("Evaluation of simularity is complete.");
831
                }
811 832
            }
812 833
            catch (Exception ex)
813 834
            {
ID2.Manager/ID2.Manager/Main.cs
1820 1820
                            {
1821 1821
                                string ID2DrawingFolder = System.IO.Path.Combine(informations.FindID2LocalPath(doc.RefProjectCode), "drawings", "Native");
1822 1822
                                string dwgFilePath = System.IO.Path.Combine(ID2DrawingFolder, $"{doc.DocumentNo}{dwgExtension}");
1823
                                System.Diagnostics.Process.Start(dwgFilePath);
1823
                                if (File.Exists(dwgFilePath))
1824
                                {
1825
                                    System.Diagnostics.Process.Start(dwgFilePath);
1826
                                }
1827
                                else
1828
                                {
1829
                                    RadMessageBox.Show($"Can't find file({dwgFilePath})");
1830
                                }
1824 1831
                            }
1825 1832
                        }
1826 1833
                        break;

내보내기 Unified diff

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