프로젝트

일반

사용자정보

개정판 9133d5d8

ID9133d5d89128701d377b121d96c88419c9e79eb3
상위 55321a0d
하위 fa13baac, cdf18b83

gaqhf 이(가) 약 6년 전에 추가함

dev issue #683: 2개의 심볼 모델링

차이점 보기:

DTI_PID/SPPIDConverter/AutoModeling.vb
143 143
                End If
144 144
                SetListBoxItems(ListBox_Result, "Create Symbol (" + sCnt.ToString + "/" + CDrawing.SYMBOLS.Count.ToString + ") UID : " + symbol.UID)
145 145
                sCnt += 1
146
                symbol.SPPID_ITEM_OBJECT = DrawSymbol(symbol)
146
                symbol.Modeling()
147 147
                If symbol.SPPID_ITEM_OBJECT IsNot Nothing Then
148 148
                    prevSymbol = symbol
149 149
                    prevIndex = index
......
742 742

  
743 743
        If sysPath <> "" Then
744 744
            Dim connectSymbol As LMSymbol = Nothing
745

  
746 745
            For Each connector As Connector In symbol.CONNECTORS
747 746
                If String.IsNullOrEmpty(connector.CONNECTEDITEM) = False Or connector.CONNECTEDITEM <> "None" Then
748 747
                    Dim _sym As Symbol = FindSymbolByUID(CDrawing.SYMBOLS, connector.CONNECTEDITEM)
......
754 753
                    End If
755 754
                End If
756 755
            Next
757

  
758 756
            If connectSymbol IsNot Nothing Then
759 757
                _lmSymbol = _Placement.PIDPlaceSymbol(sysPath, symbol.LOCATION_X, symbol.LOCATION_Y, Rotation:=symbol.ANGLE, Mirror:=symbol.MIRROR, TargetItem:=connectSymbol)
760 758
            Else
761 759
                _lmSymbol = _Placement.PIDPlaceSymbol(sysPath, symbol.LOCATION_X, symbol.LOCATION_Y, Rotation:=symbol.ANGLE, Mirror:=symbol.MIRROR)
762 760
            End If
763

  
764 761
            _lmSymbol.Commit()
762

  
763
            '' Check Child
764
            For Each _child As String In symbol.CHILD
765
                Dim arrChild As String() = _child.Split(",")
766
                Dim arrow As String = arrChild(0)
767
                Dim mappingName As String = arrChild(1)
768

  
769
                Dim childAngle = 0
770
                If arrow = "UP" Then
771
                    childAngle = 0
772
                ElseIf arrow = "RIGHT" Then
773
                    childAngle = 90
774
                ElseIf arrow = "DOWN" Then
775
                    childAngle = 180
776
                Else
777
                    childAngle = 270
778
                End If
779

  
780
                Dim _childLmSymbol As LMSymbol = _Placement.PIDPlaceSymbol(mappingName, symbol.LOCATION_X, symbol.LOCATION_Y, Rotation:=childAngle, TargetItem:=_lmSymbol)
781
                symbol.CHILD_SPPID_ITEM_OBJECT.Add(_childLmSymbol)
782
            Next
783

  
765 784
            Debug.WriteLine(symbol.LOCATION_X.ToString + "," + symbol.LOCATION_Y.ToString + "/" + symbol.UID + "/" + symbol.SIZE)
766 785
        End If
767 786

  
DTI_PID/SPPIDConverter/Drawing.vb
456 456
    Private _SIZE As String
457 457
    Private _ANGLE As String
458 458
    Private _PARENT As String
459
    Private _CHILD As String
459
    Private _CHILD As List(Of String) = New List(Of String)
460
    Private _CHILD_SPPID_ITEM_OBJECT As List(Of Object) = New List(Of Object)
460 461
    Private _HASINSTRUMENTLABEL As String
461 462
    Private _CURRENTPOINTMODEINDEX As String
462 463

  
......
522 523
        End Set
523 524
    End Property
524 525

  
525
    Public Property CHILD As String
526
        Get
527
            Return _CHILD
528
        End Get
529
        Set(value As String)
530
            _CHILD = value
531
        End Set
532
    End Property
533

  
534 526
    Public Property HASINSTRUMENTLABEL As String
535 527
        Get
536 528
            Return _HASINSTRUMENTLABEL
......
594 586
        End Set
595 587
    End Property
596 588

  
589
    Public Property CHILD As List(Of String)
590
        Get
591
            Return _CHILD
592
        End Get
593
        Set(value As List(Of String))
594
            _CHILD = value
595
        End Set
596
    End Property
597

  
598
    Public Property CHILD_SPPID_ITEM_OBJECT As List(Of Object)
599
        Get
600
            Return _CHILD_SPPID_ITEM_OBJECT
601
        End Get
602
        Set(value As List(Of Object))
603
            _CHILD_SPPID_ITEM_OBJECT = value
604
        End Set
605
    End Property
606

  
597 607
    Public Overrides Sub Modeling()
598 608

  
599 609
        Dim _Placement As Placement = New Placement
......
622 632
                SPPID_ITEM_OBJECT = _Placement.PIDPlaceSymbol(sysPath, LOCATION_X, LOCATION_Y, Rotation:=ANGLE, Mirror:=MIRROR)
623 633
            End If
624 634

  
635
            '' Check Child
636
            For Each _child As String In CHILD
637
                Dim arrChild As String() = _child.Split(",")
638
                Dim arrow As String = arrChild(0)
639
                Dim mappingName As String = arrChild(1)
640

  
641
                Dim childAngle As Double = 0
642
                If arrow = "UP" Then
643
                    childAngle = 0
644
                ElseIf arrow = "RIGHT" Then
645
                    childAngle = 90 * Math.PI / 180
646
                ElseIf arrow = "DOWN" Then
647
                    childAngle = Math.PI
648
                Else
649
                    childAngle = 270 * Math.PI / 180
650
                End If
651

  
652
                Dim _childLmSymbol As LMSymbol = _Placement.PIDPlaceSymbol(mappingName, LOCATION_X, LOCATION_Y, Mirror:=0, Rotation:=childAngle, TargetItem:=SPPID_ITEM_OBJECT)
653
                CHILD_SPPID_ITEM_OBJECT.Add(_childLmSymbol)
654
            Next
655

  
625 656
            SPPID_ITEM_OBJECT.Commit()
626 657
            Debug.WriteLine(LOCATION_X.ToString + "," + LOCATION_Y.ToString + "/" + UID + "/" + SIZE)
627 658
        End If
DTI_PID/SPPIDConverter/Main.vb
319 319
                _symbol.LOCATION = oSymbol.Element(_XML_SYMBOLS_SYMBOL_LOCATION).Value
320 320
                _symbol.SIZE = oSymbol.Element(_XML_SYMBOLS_SYMBOL_SIZE).Value
321 321
                _symbol.PARENT = oSymbol.Element(_XML_SYMBOLS_SYMBOL_PARENT).Value
322
                _symbol.CHILD = oSymbol.Element(_XML_SYMBOLS_SYMBOL_CHILD).Value
322
                Dim strChild As String = oSymbol.Element(_XML_SYMBOLS_SYMBOL_CHILD).Value
323
                Dim arrChild As String() = strChild.Split("/")
324
                For Each _child As String In arrChild
325
                    Dim info As String() = _child.Split(",")
326
                    Dim childMappingName = GetDataFromMappingDB(info(1), _DB_COLUMN_MAPPING_SPPID_SYSTEMPATH)
327
                    If String.IsNullOrEmpty(childMappingName) = False Then
328
                        _symbol.CHILD.Add(info(0) + "," + childMappingName)
329
                    Else
330
                        Console.WriteLine("Mapping Fail : " + info(1))
331
                    End If
332
                Next
323 333
                _symbol.HASINSTRUMENTLABEL = oSymbol.Element(_XML_SYMBOLS_SYMBOL_HASINSTRUMENTLABEL).Value
324 334
                _symbol.AREA = oSymbol.Element(_XML_SYMBOLS_SYMBOL_AREA).Value
325 335
                _symbol.CURRENTPOINTMODEINDEX = oSymbol.Element(_XML_SYMBOLS_SYMBOL_CURRENTPOINTMODEINDEX).Value

내보내기 Unified diff

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