프로젝트

일반

사용자정보

개정판 d8afa58b

IDd8afa58b1986d5741de8f83c303d71a5ad3e2973
상위 7e680366
하위 b52d3ef2

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

dev issue #507 : add InputEndBreakAttribute

Change-Id: I80807362a35f9b6a316e81ef37072729ef41141c

차이점 보기:

DTI_PID/SPPIDConverter/AutoModeling.cs
88 88
                    Log.Write("Start Modeling");
89 89
                    SplashScreenManager.ShowForm(typeof(SPPIDSplashScreen), true, true);
90 90
                    SplashScreenManager.Default.SendCommand(SPPIDSplashScreen.SplashScreenCommand.SetParent, (IntPtr)radApp.HWnd);
91
                    SplashScreenManager.Default.SendCommand(SPPIDSplashScreen.SplashScreenCommand.SetAllStepCount, 21);
91
                    SplashScreenManager.Default.SendCommand(SPPIDSplashScreen.SplashScreenCommand.SetAllStepCount, 22);
92 92
                    SplashScreenManager.Default.SendCommand(SPPIDSplashScreen.SplashScreenCommand.SetDocumentName, DocumentLabelText);
93 93

  
94 94
                    // Equipment Modeling
......
121 121
                    RunInputSymbolAttribute();
122 122
                    // Input SpecBreak Attribute
123 123
                    RunInputSpecBreakAttribute();
124
                    // Input EndBreak Attribute
125
                    RunInputEndBreakAttribute();
124 126
                    // Label Symbol Modeling
125 127
                    RunLabelSymbolModeling();
126 128
                    // Correct Text
......
861 863
        }
862 864
        private void RunInputSpecBreakAttribute()
863 865
        {
864
            SplashScreenManager.Default.SendCommand(SPPIDSplashScreen.SplashScreenCommand.SetAllProgress, document.SYMBOLS.Count);
865
            SplashScreenManager.Default.SendCommand(SPPIDSplashScreen.SplashScreenCommand.SetStep, "Set Symbols Attribute");
866
            SplashScreenManager.Default.SendCommand(SPPIDSplashScreen.SplashScreenCommand.SetAllProgress, document.SpecBreaks.Count);
867
            SplashScreenManager.Default.SendCommand(SPPIDSplashScreen.SplashScreenCommand.SetStep, "Set SpecBreak Attribute");
866 868
            foreach (var item in document.SpecBreaks)
867 869
                try
868 870
                {
......
877 879
                    Log.Write(ex.StackTrace);
878 880
                }
879 881
        }
882
        private void RunInputEndBreakAttribute()
883
        {
884
            SplashScreenManager.Default.SendCommand(SPPIDSplashScreen.SplashScreenCommand.SetAllProgress, document.EndBreaks.Count);
885
            SplashScreenManager.Default.SendCommand(SPPIDSplashScreen.SplashScreenCommand.SetStep, "Set EndBreak Attribute");
886
            foreach (var item in document.EndBreaks)
887
                try
888
                {
889
                    InputEndBreakAttribute(item);
890
                    SplashScreenManager.Default.SendCommand(SPPIDSplashScreen.SplashScreenCommand.UpProgress, null);
891
                }
892
                catch (Exception ex)
893
                {
894
                    Log.Write("Error in RunInputEndBreakAttribute");
895
                    Log.Write("UID : " + item.UID);
896
                    Log.Write(ex.Message);
897
                    Log.Write(ex.StackTrace);
898
                }
899
        }
880 900
        private void RunLabelSymbolModeling()
881 901
        {
882 902
            SplashScreenManager.Default.SendCommand(SPPIDSplashScreen.SplashScreenCommand.SetAllProgress, document.SYMBOLS.Count);
......
3793 3813
            return result;
3794 3814
        }
3795 3815

  
3796

  
3797 3816
        private int GetConnectorCount(string modelItemID)
3798 3817
        {
3799 3818
            LMModelItem modelItem = dataSource.GetModelItem(modelItemID);
......
4393 4412
            #endregion
4394 4413
        }
4395 4414

  
4415
        private void InputEndBreakAttribute(EndBreak endBreak)
4416
        {
4417
            object ownerObj = SPPIDUtil.FindObjectByUID(document, endBreak.OWNER);
4418
            object connectedItem = SPPIDUtil.FindObjectByUID(document, endBreak.PROPERTIES.Find(x => x.ATTRIBUTE == "Connected Item").VALUE);
4419

  
4420
            if ((ownerObj.GetType() == typeof(Symbol) && connectedItem.GetType() == typeof(Line)) ||
4421
                (ownerObj.GetType() == typeof(Line) && connectedItem.GetType() == typeof(Symbol)))
4422
            {
4423
                LMLabelPersist labelPersist = dataSource.GetLabelPersist(endBreak.SPPID.RepresentationId);
4424
                if (labelPersist != null)
4425
                {
4426
                    LMRepresentation representation = labelPersist.RepresentationObject;
4427
                    if (representation != null)
4428
                    {
4429
                        LMConnector connector = dataSource.GetConnector(representation.Id);
4430
                        LMModelItem ZeroLengthModelItem = connector.ModelItemObject;
4431
                        string modelItemID = connector.ModelItemID;
4432
                        if (Convert.ToBoolean(connector.get_IsZeroLength()))
4433
                        {
4434
                            List<string> modelItemIDs = new List<string>();
4435
                            if (connector.ConnectItem1SymbolObject != null && connector.ConnectItem1SymbolObject.get_RepresentationType() != "Branch")
4436
                            {
4437
                                LMSymbol symbol = connector.ConnectItem1SymbolObject;
4438
                                foreach (LMConnector item in symbol.Connect1Connectors)
4439
                                {
4440
                                    if (item.get_ItemStatus() == "Active" && item.ModelItemID != modelItemID)
4441
                                        modelItemIDs.Add(item.ModelItemID);
4442
                                    ReleaseCOMObjects(item);
4443
                                }
4444
                                foreach (LMConnector item in symbol.Connect2Connectors)
4445
                                {
4446
                                    if (item.get_ItemStatus() == "Active" && item.ModelItemID != modelItemID)
4447
                                        modelItemIDs.Add(item.ModelItemID);
4448
                                    ReleaseCOMObjects(item);
4449
                                }
4450
                                ReleaseCOMObjects(symbol);
4451
                                symbol = null;
4452
                            }
4453
                            else if (connector.ConnectItem2SymbolObject != null && connector.ConnectItem2SymbolObject.get_RepresentationType() != "Branch")
4454
                            {
4455
                                LMSymbol symbol = connector.ConnectItem2SymbolObject;
4456
                                foreach (LMConnector item in symbol.Connect1Connectors)
4457
                                {
4458
                                    if (item.get_ItemStatus() == "Active" && item.ModelItemID != modelItemID)
4459
                                        modelItemIDs.Add(item.ModelItemID);
4460
                                    ReleaseCOMObjects(item);
4461
                                }
4462
                                foreach (LMConnector item in symbol.Connect2Connectors)
4463
                                {
4464
                                    if (item.get_ItemStatus() == "Active" && item.ModelItemID != modelItemID)
4465
                                        modelItemIDs.Add(item.ModelItemID);
4466
                                    ReleaseCOMObjects(item);
4467
                                }
4468
                                ReleaseCOMObjects(symbol);
4469
                                symbol = null;
4470
                            }
4471

  
4472
                            modelItemIDs = modelItemIDs.Distinct().ToList();
4473
                            if (modelItemIDs.Count == 1)
4474
                            {
4475
                                LMModelItem modelItem = dataSource.GetModelItem(modelItemIDs[0]);
4476
                                object value = modelItem.Attributes["TagSequenceNo"].get_Value();
4477
                                ZeroLengthModelItem.Attributes["TagSequenceNo"].set_Value(value);
4478
                                ReleaseCOMObjects(modelItem);
4479
                                modelItem = null;
4480
                            }
4481
                        }
4482
                        ReleaseCOMObjects(connector);
4483
                        connector = null;
4484
                        ReleaseCOMObjects(ZeroLengthModelItem);
4485
                        ZeroLengthModelItem = null;
4486
                    }
4487
                    ReleaseCOMObjects(representation);
4488
                    representation = null;
4489
                }
4490
                ReleaseCOMObjects(labelPersist);
4491
                labelPersist = null;
4492
            }
4493
        }
4494

  
4396 4495
        /// <summary>
4397 4496
        /// Text Modeling - Association일 경우는 Text대신 해당 맵핑된 Symbol로 모델링
4398 4497
        /// </summary>

내보내기 Unified diff

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