프로젝트

일반

사용자정보

개정판 8634af60

ID8634af600d3b49af2ee8c38842f9f94a5e7273d3
상위 5a83fda2
하위 e6bea39e, c2fef4ca

gaqhf 이(가) 5년 이상 전에 추가함

dev issue #000 : Line Number Attribute 버그 수정

Change-Id: I4557a3d22f011002df93744a554009668701bbc6

차이점 보기:

DTI_PID/SPPIDConverter/AutoModeling.cs
41 41

  
42 42
        public void Run()
43 43
        {
44
            CloseOPCForm.Run();
44 45
            _placement = new Placement();
45 46
            dataSource = _placement.PIDDataSource;
46 47

  
......
89 90
                foreach (var item in document.LINENUMBERS)
90 91
                    LineNumberModeling(item);
91 92

  
92
                // LineRun Line Join
93
                foreach (LineNumber lineNumber in document.LINENUMBERS)
94
                    foreach (LineRun run in lineNumber.RUNS)
95
                        JoinRunLine(run);
96

  
97
                // TrimLineRun Line Join
98
                foreach (TrimLine trimLine in document.TRIMLINES)
99
                    foreach (LineRun run in trimLine.RUNS)
100
                        JoinRunLine(run);
101

  
102 93
                // Note Modeling
103 94
                foreach (var item in document.NOTES)
104 95
                    NoteModeling(item);
......
182 173
                    }
183 174
                }
184 175
                #endregion
176

  
177
                // LineRun Line Join
178
                foreach (LineNumber lineNumber in document.LINENUMBERS)
179
                    foreach (LineRun run in lineNumber.RUNS)
180
                        JoinRunLine(run);
181

  
182
                // TrimLineRun Line Join
183
                foreach (TrimLine trimLine in document.TRIMLINES)
184
                    foreach (LineRun run in trimLine.RUNS)
185
                        JoinRunLine(run);
185 186
            }
186 187
            catch (Exception ex)
187 188
            {
......
193 194
                ReleaseCOMObjects(_placement);
194 195
            }
195 196

  
197
            CloseOPCForm.Stop();
196 198
            //System.Windows.Forms.MessageBox.Show("end");
197 199
        }
198 200

  
......
1449 1451

  
1450 1452
        private void InputLineNumberAttribute(LineNumber lineNumber)
1451 1453
        {
1452
            Line line = SPPIDUtil.FindObjectByUID(document, lineNumber.CONNLINE) as Line;
1453
            if (line != null)
1454
            foreach (LineRun run in lineNumber.RUNS)
1454 1455
            {
1455
                LMModelItem _LMModelItem = dataSource.GetModelItem(line.SPPID.ModelItemId);
1456
                if (_LMModelItem != null && _LMModelItem.get_ItemStatus() == "Active")
1456
                foreach (var item in run.RUNITEMS)
1457 1457
                {
1458
                    foreach (var attribute in lineNumber.ATTRIBUTES)
1458
                    if (item.GetType() == typeof(Symbol))
1459 1459
                    {
1460
                        LineNumberMapping mapping = document.LineNumberMappings.Find(x => x.UID == attribute.UID);
1461
                        if (mapping != null)
1460
                        Symbol symbol = item as Symbol;
1461
                        LMSymbol _LMSymbol = dataSource.GetSymbol(symbol.SPPID.RepresentationId);
1462
                        LMModelItem _LMModelItem = _LMSymbol.ModelItemObject;
1463

  
1464
                        if (_LMModelItem != null && _LMModelItem.get_ItemStatus() == "Active")
1462 1465
                        {
1463
                            LMAAttribute _LMAAttribute = _LMModelItem.Attributes[mapping.SPPIDATTRIBUTENAME];
1464
                            if (_LMAAttribute != null)
1466
                            foreach (var attribute in lineNumber.ATTRIBUTES)
1465 1467
                            {
1466
                                if (DBNull.Value.Equals(_LMAAttribute.get_Value()))
1467
                                    _LMAAttribute.set_Value(attribute.VALUE);
1468
                                else if (_LMAAttribute.get_Value() != attribute.VALUE)
1469
                                    _LMAAttribute.set_Value(attribute.VALUE);
1468
                                LineNumberMapping mapping = document.LineNumberMappings.Find(x => x.UID == attribute.UID);
1469
                                if (mapping != null)
1470
                                {
1471
                                    LMAAttribute _LMAAttribute = _LMModelItem.Attributes[mapping.SPPIDATTRIBUTENAME];
1472
                                    if (_LMAAttribute != null)
1473
                                    {
1474
                                        if (DBNull.Value.Equals(_LMAAttribute.get_Value()))
1475
                                            _LMAAttribute.set_Value(attribute.VALUE);
1476
                                        else if (_LMAAttribute.get_Value() != attribute.VALUE)
1477
                                            _LMAAttribute.set_Value(attribute.VALUE);
1478
                                    }
1479
                                }
1480
                            }
1481
                            _LMModelItem.Commit();
1482
                        }
1483
                        if (_LMModelItem != null)
1484
                            ReleaseCOMObjects(_LMModelItem);
1485
                        if (_LMSymbol != null)
1486
                            ReleaseCOMObjects(_LMSymbol);
1487
                    }
1488
                    else if (item.GetType() == typeof(Line))
1489
                    {
1490
                        Line line = item as Line;
1491
                        if (line != null)
1492
                        {
1493
                            LMModelItem _LMModelItem = dataSource.GetModelItem(line.SPPID.ModelItemId);
1494
                            if (_LMModelItem != null && _LMModelItem.get_ItemStatus() == "Active")
1495
                            {
1496
                                foreach (var attribute in lineNumber.ATTRIBUTES)
1497
                                {
1498
                                    LineNumberMapping mapping = document.LineNumberMappings.Find(x => x.UID == attribute.UID);
1499
                                    if (mapping != null)
1500
                                    {
1501
                                        LMAAttribute _LMAAttribute = _LMModelItem.Attributes[mapping.SPPIDATTRIBUTENAME];
1502
                                        if (_LMAAttribute != null)
1503
                                        {
1504
                                            if (DBNull.Value.Equals(_LMAAttribute.get_Value()))
1505
                                                _LMAAttribute.set_Value(attribute.VALUE);
1506
                                            else if (_LMAAttribute.get_Value() != attribute.VALUE)
1507
                                                _LMAAttribute.set_Value(attribute.VALUE);
1508
                                            
1509
                                        }
1510
                                    }
1511
                                }
1470 1512
                                _LMModelItem.Commit();
1471 1513
                            }
1514
                            if (_LMModelItem != null)
1515
                                ReleaseCOMObjects(_LMModelItem);
1472 1516
                        }
1473 1517
                    }
1474 1518
                }
1475
                ReleaseCOMObjects(_LMModelItem);
1476 1519
            }
1477 1520
        }
1478 1521

  

내보내기 Unified diff

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