프로젝트

일반

사용자정보

개정판 72424099

ID724240998dea9da5d5d472c8292b957d2b3a4f9b
상위 ac4f1e13
하위 366f00c2

김태성이(가) 약 5년 전에 추가함

Markus.ImageComparer/ImageComparerBase.cs Parallel.ForEach 제거

Change-Id: I2875826245d2ce1530ffb6ffe712615d17b4a36e

차이점 보기:

INI/MARKUS_HyoSung_Debug.ini
3 3
[External]
4 4
IP=10.11.252.3:8975
5 5
[BaseClientAddress]
6
URL=http://localhost:8080
6
URL=http://10.11.252.3:8975
7 7
[HubAddress]
8 8
URL=http://10.11.252.3:8975/
9 9
[UpdateVer64]
ImageComparer/Markus.ImageComparer/ImageComparerBase.cs
161 161
            System.Diagnostics.Stopwatch stopwatch = new System.Diagnostics.Stopwatch();
162 162
            stopwatch.Start();
163 163

  
164
            Parallel.ForEach(heightRange, (y) =>
164
            foreach (var y in heightRange)
165 165
            {
166
                Parallel.ForEach(widthRange, (x) =>
166
                foreach (var x in widthRange)
167 167
                {
168 168
                    var rect = DataMatchScore(data, x, y, width, height, block);
169 169

  
......
171 171
                    {
172 172
                        results.Add(rect.Value);
173 173
                    }
174
                });
175
            });
174
                }
175
            }
176

  
177
            //Parallel.ForEach(heightRange, (y) =>
178
            //{
179
            //    Parallel.ForEach(widthRange, (x) =>
180
            //    {
181
            //        var rect = DataMatchScore(data, x, y, width, height, block);
182

  
183
            //        if (rect != null)
184
            //        {
185
            //            results.Add(rect.Value);
186
            //        }
187
            //    });
188
            //});
189
            //Parallel.ForEach(heightRange, (y) =>
190
            //{
191
            //    Parallel.ForEach(widthRange, (x) =>
192
            //    {
193
            //        var rect = DataMatchScore(data, x, y, width, height, block);
194

  
195
            //        if (rect != null)
196
            //        {
197
            //            results.Add(rect.Value);
198
            //        }
199
            //    });
200
            //});
176 201

  
177 202
            System.Diagnostics.Debug.WriteLine("1 - " + new TimeSpan(stopwatch.ElapsedTicks));
178 203
            return results;
KCOM/PageManager/PageStorage.cs
130 130
                        {
131 131
                            System.Diagnostics.Debug.WriteLine("DownloadPagesAsync err", ex);
132 132
                        }
133
                        finally
134
                        {
135
                        }
136

  
137

  
133 138
                    }
134 139
                }
135 140
            }
......
139 144
            }
140 145
            finally
141 146
            {
142
                GC.Collect();
143
                GC.WaitForPendingFinalizers();
144
                GC.Collect();
147
            
145 148
            }
146 149
        }
147 150

  
......
205 208

  
206 209
                    await client.DownloadFileTaskAsync(result.OriginalUri, downloadFilePath);
207 210

  
211
                    GC.Collect();
212
                    GC.WaitForPendingFinalizers();
213
                    GC.Collect();
214

  
208 215
                    System.Diagnostics.Debug.WriteLine("Download : " + result.LocalFilePath);
209 216
                }
210 217
            }
KCOM/Services/BaseServices.cs
241 241
        /// <param name="e"></param>
242 242
        private async void BaseClient_GetDocInfoCompleted(object sender, GetDocInfoCompletedEventArgs e)
243 243
        {
244
            Logger.sendResLog("GetDocInfoCompleted", "UserState : " + e.UserState + "\r Result :" + e.Result + "\r Cancelled :" + e.Cancelled + "\r Error :" + e.Error, 1);
244
            //Logger.sendResLog("GetDocInfoCompleted", "UserState : " + e.UserState + "\r Result :" + e.Result + "\r Cancelled :" + e.Cancelled + "\r Error :" + e.Error, 1);
245 245

  
246 246
            if (e.Error != null)
247 247
            {
KCOM/Views/MainMenu.xaml.cs
630 630
        /// <param name="e"></param>
631 631
        private async void pageNavigator_PageChanging(object sender, Controls.Sample.PageChangeEventArgs e)
632 632
        {
633
            // 마크업 로드
634
            await this.Dispatcher.InvokeAsync(()=>MarkupLoad(e.PageNumber));
633
            await Task.Delay(10);
635 634

  
635
            // 마크업 로드
636
            //await this.Dispatcher.InvokeAsync(()=>MarkupLoad(e.PageNumber));
637
            await MarkupLoadAsync(e.PageNumber);
636 638

  
637 639
            // 페이지 이미지 변경
638 640
            await PageChangingAsync(e.CurrentPage, e.PageNumber);
......
809 811
            ViewerDataModel.Instance.LoadPageMarkup();
810 812
        }
811 813

  
812
        private async void MarkupLoad(int pageNumber)
814
        private async Task MarkupLoadAsync(int pageNumber)
813 815
        {
814 816
            System.Diagnostics.Stopwatch stopwatch = new Stopwatch();
815 817
            stopwatch.Start();
KCOM_API/ServiceDeepView.svc.cs
229 229
        [OperationContract]
230 230
        public List<Rect> GetCompareRect(string projectNo, string originDocItem_ID, string targetDocItem_ID, string originPageNo, string targetPageNo, string isInternalAddress)
231 231
        {
232
      
233 232
            List<Rect> result = new List<Rect>();
234 233

  
235
            string originFile = "";
236
            string targetFile = "";
234
            try
235
            {
236
                string originFile = "";
237
                string targetFile = "";
237 238

  
238
            string sOriginFolder = originDocItem_ID.All(char.IsDigit) ? (Convert.ToUInt32(originDocItem_ID) / 100).ToString() : (originDocItem_ID.Length >= 5 ? originDocItem_ID.Substring(0, 5) : originDocItem_ID);
239
            string sTagetFolder = targetDocItem_ID.All(char.IsDigit) ? (Convert.ToUInt32(targetDocItem_ID) / 100).ToString() : (targetDocItem_ID.Length >= 5 ? targetDocItem_ID.Substring(0, 5) : targetDocItem_ID);
239
                string sOriginFolder = originDocItem_ID.All(char.IsDigit) ? (Convert.ToUInt32(originDocItem_ID) / 100).ToString() : (originDocItem_ID.Length >= 5 ? originDocItem_ID.Substring(0, 5) : originDocItem_ID);
240
                string sTagetFolder = targetDocItem_ID.All(char.IsDigit) ? (Convert.ToUInt32(targetDocItem_ID) / 100).ToString() : (targetDocItem_ID.Length >= 5 ? targetDocItem_ID.Substring(0, 5) : targetDocItem_ID);
240 241

  
241
            if (Boolean.Parse(isInternalAddress))
242
            {
243
                originFile = String.Format(KCOM_API.Properties.Settings.Default.TileSoucePath, projectNo, sOriginFolder, originDocItem_ID, originPageNo);
244
                targetFile = String.Format(KCOM_API.Properties.Settings.Default.TileSoucePath, projectNo, sTagetFolder, targetDocItem_ID, targetPageNo);
245
            }
246
            else
247
            {
248
                originFile = String.Format(KCOM_API.Properties.Settings.Default.TileSoucePath_SUB, projectNo,  originDocItem_ID, originPageNo);
249
                targetFile = String.Format(KCOM_API.Properties.Settings.Default.TileSoucePath_SUB, projectNo,  targetDocItem_ID, targetPageNo);
250
            }
242
                if (Boolean.Parse(isInternalAddress))
243
                {
244
                    originFile = String.Format(KCOM_API.Properties.Settings.Default.TileSoucePath, projectNo, sOriginFolder, originDocItem_ID, originPageNo);
245
                    targetFile = String.Format(KCOM_API.Properties.Settings.Default.TileSoucePath, projectNo, sTagetFolder, targetDocItem_ID, targetPageNo);
246
                }
247
                else
248
                {
249
                    originFile = String.Format(KCOM_API.Properties.Settings.Default.TileSoucePath_SUB, projectNo, originDocItem_ID, originPageNo);
250
                    targetFile = String.Format(KCOM_API.Properties.Settings.Default.TileSoucePath_SUB, projectNo, targetDocItem_ID, targetPageNo);
251
                }
251 252

  
252
            using (Markus.Image.ImageComparer compareLib = new Markus.Image.ImageComparer())
253
                using (Markus.Image.ImageComparer compareLib = new Markus.Image.ImageComparer())
254
                {
255
                    result = compareLib.CompareReturnRects(originFile, targetFile, new System.Drawing.Size(20, 20));
256
                }
257
            }
258
            catch (Exception ex)
253 259
            {
254
                result = compareLib.CompareReturnRects(originFile, targetFile, new System.Drawing.Size(20, 20));
260
                //throw new FaultException(ex.ToString() + " Inner Exception : " + ex.InnerException?.ToString());
255 261
            }
262
      
256 263

  
257 264
            return result;
258 265
        }
KCOM_API/Web.config
10 10
    </sectionGroup>
11 11
  </configSections>
12 12
  <connectionStrings>
13
    <!--효성 Connection String-->
13 14
    <add name="ConnectionString"
14
      connectionString="metadata=res://*/DataModel.KCOM_Model.csdl|res://*/DataModel.KCOM_Model.ssdl|res://*/DataModel.KCOM_Model.msl;provider=System.Data.SqlClient;provider=System.Data.SqlClient;provider connection string=&quot;data source=cloud.devdoftech.co.kr,7777;initial catalog=markus;persist security info=True;user id=doftech;password=dof1073#;multipleactiveresultsets=True;App=EntityFramework&quot;"
15
      connectionString="metadata=res://*/DataModel.KCOM_Model.csdl|res://*/DataModel.KCOM_Model.ssdl|res://*/DataModel.KCOM_Model.msl;provider=System.Data.SqlClient;provider=System.Data.SqlClient;provider connection string=&quot;data source=10.11.252.2,9875;initial catalog=markus;persist security info=True;user id=ProjectPortalDBConn;password=ProjectPortalDBConn;multipleactiveresultsets=True;App=EntityFramework&quot;"
15 16
      providerName="System.Data.EntityClient"/>
16 17
    <add name="CIConnectionString"
17
      connectionString="metadata=res://*/DataModel.CIModel.csdl|res://*/DataModel.CIModel.ssdl|res://*/DataModel.CIModel.msl;provider=System.Data.SqlClient;provider=System.Data.SqlClient;provider connection string=&quot;data source=cloud.devdoftech.co.kr,7777;initial catalog=markus;persist security info=True;user id=doftech;password=dof1073#;multipleactiveresultsets=True;App=EntityFramework&quot;"
18
      connectionString="metadata=res://*/DataModel.CIModel.csdl|res://*/DataModel.CIModel.ssdl|res://*/DataModel.CIModel.msl;provider=System.Data.SqlClient;provider=System.Data.SqlClient;provider connection string=&quot;data source=10.11.252.2,9875;initial catalog=markus;persist security info=True;user id=ProjectPortalDBConn;password=ProjectPortalDBConn;multipleactiveresultsets=True;App=EntityFramework&quot;"
18 19
      providerName="System.Data.EntityClient"/>
19 20
  </connectionStrings>
20 21
  <!--
......
81 82
  <applicationSettings>
82 83
    <KCOM_API.Properties.Settings>
83 84
      <setting name="TileSoucePath" serializeAs="String">
84
        <value>http://192.168.0.67:5977/TileSource/{0}_Tile/{1}/{2}/{3}.png</value>
85
        <value>http://10.11.252.3/TileSource/{0}_Tile/{1}/{2}/{3}.png</value>
85 86
      </setting>
86 87
      <setting name="TileSoucePath_SUB" serializeAs="String">
87
        <value>http://192.168.0.67:5977/TileSource/{0}_Tile/{1}/{2}/{3}.png</value>
88
        <value>http://10.11.252.3/TileSource/{0}_Tile/{1}/{2}/{3}.png</value>
88 89
      </setting>
89 90
      <setting name="IsProjectNoPass" serializeAs="String">
90 91
        <value>True</value>

내보내기 Unified diff

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