프로젝트

일반

사용자정보

개정판 5e4c2ad1

ID5e4c2ad1f1d975b4cad868a6a012d4032c91d9c5
상위 5e500fed
하위 327a7a9c

이지연이(가) 3년 이상 전에 추가함

issue #000: 확도 계산 변경...

Change-Id: I15ef7e029ea57591865a65c2a0f6b1a5e7b024a5

차이점 보기:

DTI_PID/ID2PSN/Form/TransformKeywordsSettingForm.Designer.cs
94 94
            this.ribbonControl.ShowDisplayOptionsMenuButton = DevExpress.Utils.DefaultBoolean.False;
95 95
            this.ribbonControl.ShowPageHeadersMode = DevExpress.XtraBars.Ribbon.ShowPageHeadersMode.ShowOnMultiplePages;
96 96
            this.ribbonControl.ShowToolbarCustomizeItem = false;
97
            this.ribbonControl.Size = new System.Drawing.Size(912, 32);
97
            this.ribbonControl.Size = new System.Drawing.Size(920, 32);
98 98
            this.ribbonControl.Toolbar.ShowCustomizeItem = false;
99 99
            // 
100 100
            // layoutControl1
......
110 110
            this.layoutControl1.Location = new System.Drawing.Point(0, 32);
111 111
            this.layoutControl1.Name = "layoutControl1";
112 112
            this.layoutControl1.Root = this.Root;
113
            this.layoutControl1.Size = new System.Drawing.Size(912, 627);
113
            this.layoutControl1.Size = new System.Drawing.Size(920, 631);
114 114
            this.layoutControl1.TabIndex = 1;
115 115
            this.layoutControl1.Text = "layoutControl1";
116 116
            // 
......
120 120
            this.labelControlToolTip.ImageAlignToText = DevExpress.XtraEditors.ImageAlignToText.RightCenter;
121 121
            this.labelControlToolTip.ImageOptions.Alignment = System.Drawing.ContentAlignment.MiddleLeft;
122 122
            this.labelControlToolTip.ImageOptions.Image = ((System.Drawing.Image)(resources.GetObject("labelControlToolTip.ImageOptions.Image")));
123
            this.labelControlToolTip.Location = new System.Drawing.Point(830, 12);
123
            this.labelControlToolTip.Location = new System.Drawing.Point(838, 12);
124 124
            this.labelControlToolTip.Name = "labelControlToolTip";
125 125
            this.labelControlToolTip.Size = new System.Drawing.Size(70, 16);
126 126
            this.labelControlToolTip.StyleController = this.layoutControl1;
......
129 129
            // 
130 130
            // btnAddType
131 131
            // 
132
            this.btnAddType.Location = new System.Drawing.Point(357, 63);
132
            this.btnAddType.Location = new System.Drawing.Point(360, 63);
133 133
            this.btnAddType.Name = "btnAddType";
134
            this.btnAddType.Size = new System.Drawing.Size(78, 22);
134
            this.btnAddType.Size = new System.Drawing.Size(79, 22);
135 135
            this.btnAddType.StyleController = this.layoutControl1;
136 136
            this.btnAddType.TabIndex = 0;
137 137
            this.btnAddType.Text = "Add Type";
......
139 139
            // 
140 140
            // gridControlKeyword
141 141
            // 
142
            this.gridControlKeyword.Location = new System.Drawing.Point(475, 89);
142
            this.gridControlKeyword.Location = new System.Drawing.Point(479, 89);
143 143
            this.gridControlKeyword.MainView = this.gridViewKeyword;
144 144
            this.gridControlKeyword.MenuManager = this.ribbonControl;
145 145
            this.gridControlKeyword.Name = "gridControlKeyword";
146
            this.gridControlKeyword.Size = new System.Drawing.Size(413, 474);
146
            this.gridControlKeyword.Size = new System.Drawing.Size(417, 478);
147 147
            this.gridControlKeyword.TabIndex = 4;
148 148
            this.gridControlKeyword.ViewCollection.AddRange(new DevExpress.XtraGrid.Views.Base.BaseView[] {
149 149
            this.gridViewKeyword});
......
160 160
            this.gridControlType.MainView = this.gridViewType;
161 161
            this.gridControlType.MenuManager = this.ribbonControl;
162 162
            this.gridControlType.Name = "gridControlType";
163
            this.gridControlType.Size = new System.Drawing.Size(411, 474);
163
            this.gridControlType.Size = new System.Drawing.Size(415, 478);
164 164
            this.gridControlType.TabIndex = 3;
165 165
            this.gridControlType.ViewCollection.AddRange(new DevExpress.XtraGrid.Views.Base.BaseView[] {
166 166
            this.gridViewType});
......
176 176
            // btnClose
177 177
            // 
178 178
            this.btnClose.ImageOptions.Image = ((System.Drawing.Image)(resources.GetObject("btnClose.ImageOptions.Image")));
179
            this.btnClose.Location = new System.Drawing.Point(830, 579);
179
            this.btnClose.Location = new System.Drawing.Point(838, 583);
180 180
            this.btnClose.Name = "btnClose";
181 181
            this.btnClose.Size = new System.Drawing.Size(70, 36);
182 182
            this.btnClose.StyleController = this.layoutControl1;
......
187 187
            // btnSave
188 188
            // 
189 189
            this.btnSave.ImageOptions.Image = ((System.Drawing.Image)(resources.GetObject("btnSave.ImageOptions.Image")));
190
            this.btnSave.Location = new System.Drawing.Point(738, 579);
190
            this.btnSave.Location = new System.Drawing.Point(746, 583);
191 191
            this.btnSave.Name = "btnSave";
192 192
            this.btnSave.Size = new System.Drawing.Size(68, 36);
193 193
            this.btnSave.StyleController = this.layoutControl1;
......
197 197
            // 
198 198
            // btnAddSymbol
199 199
            // 
200
            this.btnAddSymbol.Location = new System.Drawing.Point(798, 63);
200
            this.btnAddSymbol.Location = new System.Drawing.Point(805, 63);
201 201
            this.btnAddSymbol.Name = "btnAddSymbol";
202
            this.btnAddSymbol.Size = new System.Drawing.Size(90, 22);
202
            this.btnAddSymbol.Size = new System.Drawing.Size(91, 22);
203 203
            this.btnAddSymbol.StyleController = this.layoutControl1;
204 204
            this.btnAddSymbol.TabIndex = 2;
205 205
            this.btnAddSymbol.Text = " Add Symbol";
......
220 220
            this.layoutControlItem7,
221 221
            this.emptySpaceItem5});
222 222
            this.Root.Name = "Root";
223
            this.Root.Size = new System.Drawing.Size(912, 627);
223
            this.Root.Size = new System.Drawing.Size(920, 631);
224 224
            this.Root.TextVisible = false;
225 225
            // 
226 226
            // splitterItem1
227 227
            // 
228 228
            this.splitterItem1.AllowHotTrack = true;
229
            this.splitterItem1.Location = new System.Drawing.Point(439, 20);
229
            this.splitterItem1.Location = new System.Drawing.Point(443, 20);
230 230
            this.splitterItem1.Name = "splitterItem1";
231
            this.splitterItem1.Size = new System.Drawing.Size(12, 547);
231
            this.splitterItem1.Size = new System.Drawing.Size(12, 551);
232 232
            // 
233 233
            // emptySpaceItem3
234 234
            // 
235 235
            this.emptySpaceItem3.AllowHotTrack = false;
236
            this.emptySpaceItem3.Location = new System.Drawing.Point(0, 567);
236
            this.emptySpaceItem3.Location = new System.Drawing.Point(0, 571);
237 237
            this.emptySpaceItem3.Name = "emptySpaceItem3";
238
            this.emptySpaceItem3.Size = new System.Drawing.Size(726, 40);
238
            this.emptySpaceItem3.Size = new System.Drawing.Size(734, 40);
239 239
            this.emptySpaceItem3.TextSize = new System.Drawing.Size(0, 0);
240 240
            // 
241 241
            // layoutControlItem4
242 242
            // 
243 243
            this.layoutControlItem4.Control = this.btnSave;
244
            this.layoutControlItem4.Location = new System.Drawing.Point(726, 567);
244
            this.layoutControlItem4.Location = new System.Drawing.Point(734, 571);
245 245
            this.layoutControlItem4.MaxSize = new System.Drawing.Size(72, 40);
246 246
            this.layoutControlItem4.MinSize = new System.Drawing.Size(72, 40);
247 247
            this.layoutControlItem4.Name = "layoutControlItem4";
......
253 253
            // layoutControlItem5
254 254
            // 
255 255
            this.layoutControlItem5.Control = this.btnClose;
256
            this.layoutControlItem5.Location = new System.Drawing.Point(818, 567);
256
            this.layoutControlItem5.Location = new System.Drawing.Point(826, 571);
257 257
            this.layoutControlItem5.MaxSize = new System.Drawing.Size(74, 40);
258 258
            this.layoutControlItem5.MinSize = new System.Drawing.Size(74, 40);
259 259
            this.layoutControlItem5.Name = "layoutControlItem5";
......
265 265
            // emptySpaceItem2
266 266
            // 
267 267
            this.emptySpaceItem2.AllowHotTrack = false;
268
            this.emptySpaceItem2.Location = new System.Drawing.Point(798, 567);
268
            this.emptySpaceItem2.Location = new System.Drawing.Point(806, 571);
269 269
            this.emptySpaceItem2.MaxSize = new System.Drawing.Size(20, 40);
270 270
            this.emptySpaceItem2.MinSize = new System.Drawing.Size(20, 40);
271 271
            this.emptySpaceItem2.Name = "emptySpaceItem2";
......
281 281
            this.emptySpaceItem4});
282 282
            this.layoutControlGroup1.Location = new System.Drawing.Point(0, 20);
283 283
            this.layoutControlGroup1.Name = "layoutControlGroup1";
284
            this.layoutControlGroup1.Size = new System.Drawing.Size(439, 547);
284
            this.layoutControlGroup1.Size = new System.Drawing.Size(443, 551);
285 285
            this.layoutControlGroup1.Text = "Keyword Type";
286 286
            // 
287 287
            // layoutControlItem2
......
289 289
            this.layoutControlItem2.Control = this.gridControlType;
290 290
            this.layoutControlItem2.Location = new System.Drawing.Point(0, 26);
291 291
            this.layoutControlItem2.Name = "layoutControlItem2";
292
            this.layoutControlItem2.Size = new System.Drawing.Size(415, 478);
292
            this.layoutControlItem2.Size = new System.Drawing.Size(419, 482);
293 293
            this.layoutControlItem2.TextSize = new System.Drawing.Size(0, 0);
294 294
            this.layoutControlItem2.TextVisible = false;
295 295
            // 
296 296
            // layoutControlItem1
297 297
            // 
298 298
            this.layoutControlItem1.Control = this.btnAddType;
299
            this.layoutControlItem1.Location = new System.Drawing.Point(333, 0);
299
            this.layoutControlItem1.Location = new System.Drawing.Point(336, 0);
300 300
            this.layoutControlItem1.Name = "layoutControlItem1";
301
            this.layoutControlItem1.Size = new System.Drawing.Size(82, 26);
301
            this.layoutControlItem1.Size = new System.Drawing.Size(83, 26);
302 302
            this.layoutControlItem1.TextSize = new System.Drawing.Size(0, 0);
303 303
            this.layoutControlItem1.TextVisible = false;
304 304
            // 
......
307 307
            this.emptySpaceItem4.AllowHotTrack = false;
308 308
            this.emptySpaceItem4.Location = new System.Drawing.Point(0, 0);
309 309
            this.emptySpaceItem4.Name = "emptySpaceItem4";
310
            this.emptySpaceItem4.Size = new System.Drawing.Size(333, 26);
310
            this.emptySpaceItem4.Size = new System.Drawing.Size(336, 26);
311 311
            this.emptySpaceItem4.TextSize = new System.Drawing.Size(0, 0);
312 312
            // 
313 313
            // layoutControlGroup2
......
316 316
            this.layoutControlItem6,
317 317
            this.layoutControlItem3,
318 318
            this.emptySpaceItem1});
319
            this.layoutControlGroup2.Location = new System.Drawing.Point(451, 20);
319
            this.layoutControlGroup2.Location = new System.Drawing.Point(455, 20);
320 320
            this.layoutControlGroup2.Name = "layoutControlGroup2";
321
            this.layoutControlGroup2.Size = new System.Drawing.Size(441, 547);
321
            this.layoutControlGroup2.Size = new System.Drawing.Size(445, 551);
322 322
            this.layoutControlGroup2.Text = "Type Items";
323 323
            // 
324 324
            // layoutControlItem6
......
326 326
            this.layoutControlItem6.Control = this.gridControlKeyword;
327 327
            this.layoutControlItem6.Location = new System.Drawing.Point(0, 26);
328 328
            this.layoutControlItem6.Name = "layoutControlItem6";
329
            this.layoutControlItem6.Size = new System.Drawing.Size(417, 478);
329
            this.layoutControlItem6.Size = new System.Drawing.Size(421, 482);
330 330
            this.layoutControlItem6.TextSize = new System.Drawing.Size(0, 0);
331 331
            this.layoutControlItem6.TextVisible = false;
332 332
            // 
333 333
            // layoutControlItem3
334 334
            // 
335 335
            this.layoutControlItem3.Control = this.btnAddSymbol;
336
            this.layoutControlItem3.Location = new System.Drawing.Point(323, 0);
336
            this.layoutControlItem3.Location = new System.Drawing.Point(326, 0);
337 337
            this.layoutControlItem3.Name = "layoutControlItem3";
338
            this.layoutControlItem3.Size = new System.Drawing.Size(94, 26);
338
            this.layoutControlItem3.Size = new System.Drawing.Size(95, 26);
339 339
            this.layoutControlItem3.TextSize = new System.Drawing.Size(0, 0);
340 340
            this.layoutControlItem3.TextVisible = false;
341 341
            // 
......
344 344
            this.emptySpaceItem1.AllowHotTrack = false;
345 345
            this.emptySpaceItem1.Location = new System.Drawing.Point(0, 0);
346 346
            this.emptySpaceItem1.Name = "emptySpaceItem1";
347
            this.emptySpaceItem1.Size = new System.Drawing.Size(323, 26);
347
            this.emptySpaceItem1.Size = new System.Drawing.Size(326, 26);
348 348
            this.emptySpaceItem1.TextSize = new System.Drawing.Size(0, 0);
349 349
            // 
350 350
            // layoutControlItem7
351 351
            // 
352 352
            this.layoutControlItem7.Control = this.labelControlToolTip;
353
            this.layoutControlItem7.Location = new System.Drawing.Point(818, 0);
353
            this.layoutControlItem7.Location = new System.Drawing.Point(826, 0);
354 354
            this.layoutControlItem7.MaxSize = new System.Drawing.Size(74, 20);
355 355
            this.layoutControlItem7.MinSize = new System.Drawing.Size(74, 20);
356 356
            this.layoutControlItem7.Name = "layoutControlItem7";
......
364 364
            this.emptySpaceItem5.AllowHotTrack = false;
365 365
            this.emptySpaceItem5.Location = new System.Drawing.Point(0, 0);
366 366
            this.emptySpaceItem5.Name = "emptySpaceItem5";
367
            this.emptySpaceItem5.Size = new System.Drawing.Size(818, 20);
367
            this.emptySpaceItem5.Size = new System.Drawing.Size(826, 20);
368 368
            this.emptySpaceItem5.TextSize = new System.Drawing.Size(0, 0);
369 369
            // 
370 370
            // TransformKeywordsSettingForm
371 371
            // 
372 372
            this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 14F);
373 373
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
374
            this.ClientSize = new System.Drawing.Size(912, 659);
374
            this.ClientSize = new System.Drawing.Size(920, 663);
375 375
            this.Controls.Add(this.layoutControl1);
376 376
            this.Controls.Add(this.ribbonControl);
377 377
            this.Name = "TransformKeywordsSettingForm";
DTI_PID/ID2PSN/PSN.cs
28 28
        InValid //이값은 들어가는데가 없음..
29 29
    }
30 30

  
31
    
32

  
33

  
34 31
    public class PSN
35 32
    {
36 33
        private double[] DrawingSize = null;
......
45 42
        public DataTable Equipment { get; set; }
46 43
        public DataTable Nozzle { get; set; }
47 44

  
48
        public string Rule1 = "";
49
        public string Rule2 = "";
50
        public string Rule3 = "";
51
        public string Rule4 = "";
45
        public string Rule1 = "Line Disconnected";
46
        public string Rule2 = "Missing LineNumber"; //토폴로지데이터가 = Empty LineNumber 인것 ??..
47
        public string Rule3 = "OPC Disconneted";
48
        public string Rule4 = "Missing ItemTag or Description";
52 49
        public string Rule5 = "";
53 50

  
54 51
        int tieInPointIndex = 1;
......
222 219
            // PSN이 Bypass인지 검사 
223 220
            SetPSNBypass();
224 221
            // Topology들에게 Index를 부여한다
225
            SetTopologyIndex();
226
            
222
            SetTopologyIndex();            
227 223
            // Nozzle, Equipment의 정보를 저장
228 224
            SaveNozzleAndEquipment();
229 225
            // PSN의 정보를 저장
......
232 228
            UpdateSubType();
233 229
            // Update Error
234 230
            UpdateErrorForPSN();
231
            // 확도 계산
232
            UpdateAccuracy();            
235 233
        }
236 234

  
237 235
        private void SetTopologyData()
......
298 296
                }
299 297
            }
300 298

  
301

  
302 299
            foreach (Document document in Documents)
303 300
            {
304 301
                foreach (Item item in document.Items)
......
352 349
            }
353 350

  
354 351
        }
352

  
355 353
        private void ConnectByOPC()
356 354
        {
357 355
            try
......
390 388
                //MessageBox.Show(ex.Message, "ID2 " + id2Info.ProgramName, MessageBoxButtons.OK, MessageBoxIcon.Information);
391 389
            }
392 390
        }
391

  
393 392
        private void SetPSNItem()
394 393
        {
395 394
            Dictionary<Group, string> groupDic = new Dictionary<Group, string>(); 
......
474 473
                    groupDic[_item] = to;
475 474
            }
476 475
        }
476

  
477 477
        private void SetPSNType()
478 478
        {
479 479
            foreach (PSNItem PSNItem in PSNItems)
......
525 525
                return type;
526 526
            }
527 527
        }
528

  
528 529
        private void SetBranchInfo()
529 530
        {
530 531
            foreach (Document document in Documents)
......
555 556
                }
556 557
            }
557 558
        }
559

  
558 560
        private void SetTopology()
559 561
        {
560 562
            #region 기본 topology 정리
......
621 623
            }
622 624
            #endregion
623 625
        }
626

  
624 627
        private void SetTopologyIndex()
625 628
        {
626 629
            List<string> ids = Topologies.Select(x => x.ID).Distinct().ToList();
......
639 642
                    topology.Index = (branchToplogies.IndexOf(topology) + 1).ToString();
640 643
            }
641 644
        }
645

  
642 646
        private void SetPSNBypass()
643 647
        {
644 648
            foreach (PSNItem PSNItem in PSNItems)
645 649
                PSNItem.IsBypass = IsBypass(PSNItem);
646 650
        }
651

  
647 652
        private List<Topology> FindMainTopology(List<Topology> data)
648 653
        {
649 654
            DataTable nominalDiameterDT = DB.SelectNominalDiameter();
......
797 802

  
798 803
            return dt;
799 804
        }
805

  
800 806
        private DataTable GetTopologyRule()
801 807
        {
802 808
            DataTable dt = DB.SelectTopologyRule();
803 809

  
804 810
            return dt;
805 811
        }
812

  
806 813
        private bool IsConnected(Item item1, Item item2)
807 814
        {
808 815
            if (item1.Relations.Find(x => x.UID.Equals(item2.UID)) != null &&
......
902 909
            Equipment = equipDT;
903 910
            Nozzle = nozzleDT;
904 911
        }
912

  
905 913
        private void SavePSNData()
906 914
        {
907 915
            try
......
1148 1156
                                else
1149 1157
                                    newRow["NPD"] = null;
1150 1158

  
1159

  
1151 1160
                                newRow["PipeSystemNetwork_OID"] = PSNItem.PSN_OID();
1152 1161
                                if (branchItem == null)
1153 1162
                                    newRow["ViewPipeSystemNetwork_OID"] = PSNItem.PSN_OID();
......
1174 1183
                                if (bVentDrain)
1175 1184
                                    return;
1176 1185

  
1177
                                List<double> lstAcc = new List<double>();
1178 1186
                                DataRow newRow = pipeSystemNetworkDT.NewRow();
1179 1187
                                newRow["OID"] = PSNItem.PSN_OID();
1180 1188
                                newRow["Type"] = PSNItem.GetPSNType();
......
1197 1205
                                newRow["PBS"] = PSNItem.GetPBSData();
1198 1206
                                newRow["Validity"] = PSNItem.Validity;
1199 1207
                                newRow["Status"] = !string.IsNullOrEmpty(PSNItem.Status) ? PSNItem.Status.Remove(0, 2) : string.Empty;
1200

  
1201

  
1202
                                if(!string.IsNullOrEmpty(From_d) || !string.IsNullOrEmpty(To_d))
1203
                                {
1204
                                    if (From_d.Contains(Rule1) || To_d.Contains(Rule1))
1205
                                        lstAcc.Add(0.75);
1206
                                    else if (From_d.Contains(Rule2) || To_d.Contains(Rule2))
1207
                                        lstAcc.Add(0.7);
1208
                                    else if (From_d.Contains(Rule3) || To_d.Contains(Rule3))
1209
                                        lstAcc.Add(0.5);
1210
                                    else if (From_d.Contains(Rule4) || To_d.Contains(Rule4))
1211
                                        lstAcc.Add(0.65);
1212
                                    else if (From_d.Contains(Rule5) || To_d.Contains(Rule5))
1213
                                        lstAcc.Add(0.6);
1214
                                }
1215

  
1216
                                
1217
                                PSNItem.PSNAccuracy = Convert.ToString(Math.Round(Convert.ToDouble(AccuracyCalculation(lstAcc)), 1));
1218

  
1219
                                if (PSNItem.PSNAccuracy == "100")
1220
                                    PSNItem.IncludingVirtualData = "No";
1221

  
1222
                                newRow["IncludingVirtualData"] = !string.IsNullOrEmpty(PSNItem.IncludingVirtualData) ? PSNItem.IncludingVirtualData : "Yes";
1223
                                newRow["PSNAccuracy"] = PSNItem.PSNAccuracy;
1208
                                newRow["IncludingVirtualData"] = "No";
1209
                                                        
1210
                                 newRow["PSNAccuracy"] = "100";
1224 1211

  
1225 1212
                                List<string> drawingNames = new List<string>();
1226 1213
                                foreach (Group _group in PSNItem.Groups)
......
1330 1317
            }
1331 1318
        }
1332 1319

  
1333

  
1334
        private double AccuracyCalculation(List<double> lstAcc)
1320
        private double AccuracyCalculation(List<double> lstAcc, double acc)
1335 1321
        {
1336
            double acc = 1;
1337 1322
            foreach(double lacc in lstAcc)
1338 1323
            {
1339 1324
                acc *= lacc;
......
1393 1378
                if (row["SubType"] == null || string.IsNullOrEmpty(row["SubType"].ToString()))
1394 1379
                    row["SubType"] = "Normal";
1395 1380
        }
1381

  
1396 1382
        private bool IsBypass(PSNItem PSNItem)
1397 1383
        {
1398 1384
            bool bResult = false;
......
1428 1414

  
1429 1415
            return bResult;
1430 1416
        }
1417

  
1418
        private void UpdateAccuracy()
1419
        {
1420
            DataRow[] statusRows = PipeSystemNetwork.Select(" Type = 'Error' OR Validity = 'Error'"); 
1421
            List<double> lstAcc = null;
1422
            string Status = string.Empty;
1423
            foreach (DataRow dataRow in statusRows)
1424
            {
1425
                lstAcc = new List<double>();
1426
                Status = dataRow.Field<string>("Status");
1427

  
1428
                if (!string.IsNullOrEmpty(Status))
1429
                {
1430
                    if (Status.Contains(Rule1)) //Line Disconnected
1431
                        lstAcc.Add(0.75);
1432
                    else if (Status.Contains(Rule2)) //Missing LineNumber
1433
                        lstAcc.Add(0.7);            
1434
                    else if (Status.Contains(Rule3)) //OPC Disconneted
1435
                        lstAcc.Add(0.7);            
1436
                    else if (Status.Contains(Rule4)) //Missing ItemTag or Description
1437
                        lstAcc.Add(0.65);           
1438
                    //else if (Status.Contains(Rule5))
1439
                    //    lstAcc.Add(0.6);
1440
                }
1441

  
1442
                string PSNAccuracy = dataRow["PSNAccuracy"].ToString();
1443
                if (PSNAccuracy == "100")
1444
                    PSNAccuracy = "1";
1445

  
1446
                PSNAccuracy = Convert.ToString(Math.Round(Convert.ToDouble(AccuracyCalculation(lstAcc, Convert.ToDouble(PSNAccuracy))), 2));
1447
                if (PSNAccuracy != "100")
1448
                {
1449
                    dataRow["IncludingVirtualData"] = "Yes";
1450
                    dataRow["PSNAccuracy"] = PSNAccuracy;
1451
                }
1452
            }
1453
        }
1454

  
1431 1455
        private void UpdateErrorForPSN()
1432 1456
        {
1433 1457
            DataRow[] errorRows = PipeSystemNetwork.Select(string.Format(" Type = '{0}'", ErrorType.Error));
1458
            bool bCheckRule5 = false;
1434 1459
            foreach (DataRow dataRow in errorRows)
1435 1460
            {
1436 1461
                PSNItem PSNItem = PSNItems.Find(x=>x.PSN_OID() == dataRow["OID"].ToString());
1437 1462
                bool change = false;
1463
                bCheckRule5 = false;
1464

  
1438 1465
                if (!PSNItem.EnableType(PSNItem.StartType))
1439 1466
                {
1440 1467
                    change = true;
......
1446 1473
                        loopRow["FROM_DATA"] = string.Format("TIEINPOINT_{0:D5}V", tieInPointIndex);
1447 1474
                    tieInPointIndex++;
1448 1475

  
1449

  
1476
                    
1450 1477
                    if (item.ItemType == ItemType.Line)
1451 1478
                    {
1479
                        //createTerminatorRow - Rule 5번
1452 1480
                        PathItems.Rows.InsertAt(createTerminatorRow(pathItemRows.First()), insertIndex);
1481

  
1482
                        bCheckRule5 = true;
1453 1483
                    }
1454 1484
                    else
1455 1485
                    {
1456 1486
                        PathItems.Rows.InsertAt(createLineRow(PathItems.Select(string.Format("PipeLine_OID = '{0}' AND ItemName = 'PipeRun' AND PipeSystemNetwork_OID = '{1}'", item.PSNPipeLineID, dataRow["OID"])).First()), insertIndex);
1487
                        //createTerminatorRow - Rule 5번
1457 1488
                        PathItems.Rows.InsertAt(createTerminatorRow(pathItemRows.First()), insertIndex);
1489

  
1490
                        bCheckRule5 = true;
1458 1491
                    }
1459 1492

  
1460 1493
                    PSNItem.StartType = PSNType.Equipment;
......
1475 1508

  
1476 1509
                    if (item.ItemType == ItemType.Line)
1477 1510
                    {
1511
                        //createTerminatorRow - Rule 5번
1478 1512
                        PathItems.Rows.InsertAt(createTerminatorRow(pathItemRows.Last()), insertIndex + 1);
1513

  
1479 1514
                    }
1480 1515
                    else
1481 1516
                    {
1517
                        //createTerminatorRow - Rule 5번
1482 1518
                        PathItems.Rows.InsertAt(createTerminatorRow(pathItemRows.Last()), insertIndex + 1);
1519

  
1483 1520
                        PathItems.Rows.InsertAt(createLineRow(PathItems.Select(string.Format("PipeLine_OID = '{0}' AND ItemName = 'PipeRun' AND PipeSystemNetwork_OID = '{1}'", item.PSNPipeLineID, dataRow["OID"])).Last()), insertIndex + 1);
1521

  
1522
                        bCheckRule5 = true;
1484 1523
                    }
1485 1524

  
1486 1525
                    PSNItem.EndType = PSNType.Equipment;
......
1504 1543
                        row["SequenceData_OID"] = sb.ToString(); 
1505 1544
                    }
1506 1545
                }
1546
                
1547
                if (bCheckRule5)
1548
                {
1549
                    string PSNAccuracy = "0.6";
1550
                    dataRow["IncludingVirtualData"] = "Yes";
1551
                    dataRow["PSNAccuracy"] = PSNAccuracy;
1552
                }
1507 1553

  
1508 1554
                DataRow createTerminatorRow(DataRow itemRow)
1509 1555
                {

내보내기 Unified diff