프로젝트

일반

사용자정보

개정판 9b5d4527

ID9b5d4527a92488a62f3009ec3576dd0aa55a0302
상위 1bfcc921
하위 e318b88e, 8db6e7dd, dd46ca83

Gyusu 이(가) 6년 이상 전에 추가함

issue #654

차이점 보기:

DTI_PID/SPPIDConverter/Main.vb
2381 2381
                            '모델링 된 PipeLine 데이터 테이블 저장
2382 2382
                            AddModelingDT(sUid, oCurrentConnector.ModelItemID, oCurrentConnector, dStart_Dwg_x, dStart_Dwg_y, dEnd_Dwg_x, dEnd_Dwg_y)
2383 2383
                        End If
2384
                        '//2018.09.07 LMControl에 따라서 inconsitency가 달라지는듯 확인
2385
                        If sStartConnectionUid <> "" Then
2386
                            Dim oChangeRow() As DataRow = _ModelingLine_Dt.Select(_XML_LINE_UID & " = '" & sStartConnectionUid & "'")
2387
                            If oChangeRow.Length = 1 Then
2388
                                oChangeRow(0)(_XML_LINE_SPID) = sID_1
2389
                                oChangeRow(0)(_XML_LINE_LMCONNECTOR) = oAddConnector
2384
                        If bCheckBranchItem Then
2385
                            '//2018.09.07 LMControl에 따라서 inconsitency가 달라지는듯 확인
2386
                            If sStartConnectionUid <> "" Then
2387
                                Dim oChangeRow() As DataRow = _ModelingLine_Dt.Select(_XML_LINE_UID & " = '" & sStartConnectionUid & "'")
2388
                                If oChangeRow.Length = 1 Then
2389
                                    oChangeRow(0)(_XML_LINE_SPID) = sID_1
2390
                                    oChangeRow(0)(_XML_LINE_LMCONNECTOR) = oAddConnector
2391
                                End If
2390 2392
                            End If
2391
                        End If
2392
                        If sEndConnectionUid <> "" Then
2393
                            Dim oChangeRow() As DataRow = _ModelingLine_Dt.Select(_XML_LINE_UID & " = '" & sEndConnectionUid & "'")
2394
                            If oChangeRow.Length = 1 Then
2395
                                oChangeRow(0)(_XML_LINE_SPID) = sID_1
2396
                                oChangeRow(0)(_XML_LINE_LMCONNECTOR) = oAddConnector
2393
                            If sEndConnectionUid <> "" Then
2394
                                Dim oChangeRow() As DataRow = _ModelingLine_Dt.Select(_XML_LINE_UID & " = '" & sEndConnectionUid & "'")
2395
                                If oChangeRow.Length = 1 Then
2396
                                    oChangeRow(0)(_XML_LINE_SPID) = sID_1
2397
                                    oChangeRow(0)(_XML_LINE_LMCONNECTOR) = oAddConnector
2398
                                End If
2397 2399
                            End If
2398 2400
                        End If
2401

  
2399 2402
                    Else
2400 2403
                        sReturnUid = ""
2401 2404
                    End If
......
3706 3709
                                            bCheckBranchItem = True
3707 3710
                                        End If
3708 3711

  
3709

  
3710

  
3711 3712
                                        'If dConn_EX <> 0 And dConn_EY <> 0 Then
3712 3713
                                        '    If dConn_SX >= dX And dConn_EX <= dX And dConn_SY >= dY And dConn_EY <= dY Then
3713 3714
                                        '        oLMConnector = objConnector
......
3728 3729
                                    '    Exit For
3729 3730
                                    'End If
3730 3731
                                End If
3731

  
3732 3732
                                'If objRep.Attributes("RepresentationType").Value = "Connector" And objRep.Attributes("ItemStatus").Value = "Active" Then
3733 3733
                                '    Dim objConnector As LMConnector = _Placement.PIDDataSource.GetConnector(objRep.ID)
3734 3734
                                '    For Each objConnectorVertex In objConnector.ConnectorVertices
......
3746 3746
                        End If
3747 3747
                    Catch ex As Exception
3748 3748
                    End Try
3749

  
3750

  
3751

  
3752 3749
                    '    oUid = oModelrow(_XML_LINE_UID).ToString()
3753 3750
                    ' Dim oID As String = oModelrow(_XML_LINE_SPID)
3754 3751
                    '    oLMConnector = oModelrow(_XML_LINE_LMCONNECTOR)
......
3851 3848
        '오차범위를 줘서 현재선을 통과하는지 체크
3852 3849
        '통과하는 상대라인 갯수를 먼저 구한다음 라인 갯수만큼 라인을 그린다.
3853 3850
        Dim bCheckBranchLine As Boolean = False
3854
        Dim sCurrentDirection As String = ""
3855

  
3856
        Dim oModel_Dt As New DataTable()
3857
        oModel_Dt.Columns.Add("X")
3858
        oModel_Dt.Columns.Add("Y")
3859
        oModel_Dt.Columns.Add("Type")
3860
        oModel_Dt.Columns.Add("SPID")
3861
        Dim dGap = 0.001
3862
        If Math.Abs(dStartX - dEndX) > Math.Abs(dStartY - dEndY) Then
3863
            sCurrentDirection = "X"
3864
            If dStartX > dEndX Then
3865
                Dim dTempX As Double = dEndX
3866
                dEndX = dStartX
3867
                dStartX = dTempX
3868
                Dim dTempY As Double = dEndY
3869
                dEndY = dStartY
3870
                dStartY = dTempY
3871
            End If
3872
            '현재선이 X축방향
3873
            Try
3874
                For Each oModelrow In _ModelingLine_Dt.Rows
3875
                    Dim dModelStart_X As Double = oModelrow(_XML_LINE_DWG_STARTPOINT_X)
3876
                    Dim dModelStart_Y As Double = oModelrow(_XML_LINE_DWG_STARTPOINT_Y)
3877
                    Dim dModelEnd_X As Double = oModelrow(_XML_LINE_DWG_ENDPOINT_X)
3878
                    Dim dModelEnd_Y As Double = oModelrow(_XML_LINE_DWG_ENDPOINT_Y)
3879
                    Dim sSPID As String = oModelrow(_XML_LINE_SPID)
3880
                    If dStartX < dModelStart_X And dStartX < dModelEnd_X And
3881
                       dEndX > dModelStart_X And dEndX > dModelEnd_X Then
3882
                        Dim dAddX As Double = 0
3883
                        Dim dAddY As Double = dModelStart_Y
3884
                        Dim sType As String = ""
3885
                        If dStartY = dModelStart_Y Then
3886
                            dAddX = dModelStart_X
3887
                        ElseIf dStartY = dModelEnd_Y Then
3888
                            dAddX = dModelEnd_X
3889
                        ElseIf dStartY <= dModelStart_Y + dGap And dStartY >= dModelStart_Y - dGap Then
3890
                            dAddX = dModelStart_X
3891
                            If dStartY > dModelStart_Y Then
3892
                                sType = "AddLine"
3893
                            End If
3894
                        ElseIf dStartY <= dModelEnd_Y + dGap And dStartY >= dModelEnd_Y - dGap Then
3895
                            dAddX = dModelEnd_X
3896
                            If dStartY > dModelEnd_Y Then
3897
                                sType = "AddLine"
3898
                            End If
3899
                        End If
3900
                        If dAddX <> 0 Then
3901
                            Dim oDatarow As DataRow = oModel_Dt.NewRow()
3902
                            oDatarow("X") = dAddX
3903
                            oDatarow("Y") = dAddY
3904
                            oDatarow("Type") = sType
3905
                            oDatarow("SPID") = sSPID
3906
                            oModel_Dt.Rows.Add(oDatarow)
3907
                        End If
3908
                    End If
3909
                Next
3910
            Catch ex As Exception
3911
            End Try
3912
        Else
3913
            '현재선이 y축방향
3914
            sCurrentDirection = "Y"
3915
            Try
3916
                For Each oModelrow In _ModelingLine_Dt.Rows
3917
                    Dim dModelStart_X As Double = oModelrow(_XML_LINE_DWG_STARTPOINT_X)
3918
                    Dim dModelStart_Y As Double = oModelrow(_XML_LINE_DWG_STARTPOINT_Y)
3919
                    Dim dModelEnd_X As Double = oModelrow(_XML_LINE_DWG_ENDPOINT_X)
3920
                    Dim dModelEnd_Y As Double = oModelrow(_XML_LINE_DWG_ENDPOINT_Y)
3921
                    Dim sSPID As String = oModelrow(_XML_LINE_SPID)
3922
                    If dStartY < dModelStart_Y And dStartY < dModelEnd_Y And
3923
                       dEndY > dModelStart_Y And dEndY > dModelEnd_Y Then
3924
                        Dim dAddX As Double = dModelStart_X
3925
                        Dim dAddY As Double = 0
3926
                        Dim sType As String = ""
3927
                        If dStartX = dModelStart_X Then
3928
                            dAddY = dModelStart_Y
3929
                        ElseIf dStartX = dModelEnd_X Then
3930
                            dAddY = dModelEnd_Y
3931
                        ElseIf dStartX <= dModelStart_X + dGap And dStartX >= dModelStart_X - dGap Then
3932
                            dAddY = dModelStart_Y
3933
                            If dStartX > dModelStart_X Then
3934
                                sType = "AddLine"
3935
                            End If
3936
                        ElseIf dStartX <= dModelEnd_X + dGap And dStartX >= dModelEnd_X - dGap Then
3937
                            dAddY = dModelEnd_Y
3938
                            If dStartX > dModelEnd_X Then
3939
                                sType = "AddLine"
3940
                            End If
3941
                        End If
3942
                        If dAddX <> 0 Then
3943
                            Dim oDatarow As DataRow = oModel_Dt.NewRow()
3944
                            oDatarow("X") = dAddX
3945
                            oDatarow("Y") = dAddY
3946
                            oDatarow("Type") = sType
3947
                            oDatarow("SPID") = sSPID
3948
                            oModel_Dt.Rows.Add(oDatarow)
3949
                        End If
3950
                    End If
3951
                Next
3952
            Catch ex As Exception
3953
            End Try
3954
        End If
3955
        If oModel_Dt.Rows.Count > 0 Then
3956
            If sCurrentDirection = "X" Then
3957
                'X좌표 정렬
3958
                oModel_Dt.DefaultView.Sort = "X desc"
3959
                oModel_Dt = oModel_Dt.DefaultView.ToTable(True)
3960
            Else
3961
                'Y좌표 정렬
3962
                oModel_Dt.DefaultView.Sort = "Y desc"
3963
                oModel_Dt = oModel_Dt.DefaultView.ToTable(True)
3964
            End If
3965
            Dim oLMConnector As LMConnector = Nothing
3966
            Dim oPreLMConnector As LMConnector = Nothing
3967
            Dim dStartFlag As Boolean = True
3968
            For Each oModelRow In oModel_Dt.Rows
3969
                Dim objInputs As PlaceRunInputs
3970
                objInputs = New PlaceRunInputs
3971
                Dim dX As Double = oModelRow("X")
3972
                Dim dY As Double = oModelRow("Y")
3973
                Dim sType As String = oModelRow("Type")
3974
                Dim sUid As String = ""
3975
                CheckConnectionLine(dX, dY, oLMConnector, sUid)
3976
                If oLMConnector IsNot Nothing Then
3977
                    If dStartFlag Then
3978
                        objInputs.AddPoint(dStartX, dStartY)
3979
                        objInputs.AddConnectorTarget(oLMConnector, dX, dY)
3980
                    Else
3981
                        objInputs.AddConnectorTarget(oPreLMConnector, dStartX, dStartY)
3982
                        objInputs.AddConnectorTarget(oLMConnector, dX, dY)
3983
                    End If
3984
                    oPreLMConnector = LineModeling(objInputs, sSystemPath)
3985
                    '모델링후 StartX를 현재 X로 변경
3986
                    dStartX = dX
3987
                    dStartY = dY
3988
                End If
3989
            Next
3990
            If oPreLMConnector IsNot Nothing Then
3991
                Dim objInputs As PlaceRunInputs
3992
                objInputs = New PlaceRunInputs
3993
                objInputs.AddConnectorTarget(oPreLMConnector, dStartX, dStartY)
3994
                objInputs.AddPoint(dEndX, dEndY)
3995
                LineModeling(objInputs, sSystemPath)
3996
            End If
3997
        End If
3851
        'Dim sCurrentDirection As String = ""
3852

  
3853
        'Dim oModel_Dt As New DataTable()
3854
        'oModel_Dt.Columns.Add("X")
3855
        'oModel_Dt.Columns.Add("Y")
3856
        'oModel_Dt.Columns.Add("Type")
3857
        'oModel_Dt.Columns.Add("SPID")
3858
        'Dim dGap = 0.001
3859
        'If Math.Abs(dStartX - dEndX) > Math.Abs(dStartY - dEndY) Then
3860
        '    sCurrentDirection = "X"
3861
        '    If dStartX > dEndX Then
3862
        '        Dim dTempX As Double = dEndX
3863
        '        dEndX = dStartX
3864
        '        dStartX = dTempX
3865
        '        Dim dTempY As Double = dEndY
3866
        '        dEndY = dStartY
3867
        '        dStartY = dTempY
3868
        '    End If
3869
        '    '현재선이 X축방향
3870
        '    Try
3871
        '        For Each oModelrow In _ModelingLine_Dt.Rows
3872
        '            Dim dModelStart_X As Double = oModelrow(_XML_LINE_DWG_STARTPOINT_X)
3873
        '            Dim dModelStart_Y As Double = oModelrow(_XML_LINE_DWG_STARTPOINT_Y)
3874
        '            Dim dModelEnd_X As Double = oModelrow(_XML_LINE_DWG_ENDPOINT_X)
3875
        '            Dim dModelEnd_Y As Double = oModelrow(_XML_LINE_DWG_ENDPOINT_Y)
3876
        '            Dim sSPID As String = oModelrow(_XML_LINE_SPID)
3877
        '            If dStartX < dModelStart_X And dStartX < dModelEnd_X And
3878
        '               dEndX > dModelStart_X And dEndX > dModelEnd_X Then
3879
        '                Dim dAddX As Double = 0
3880
        '                Dim dAddY As Double = dStartY
3881
        '                Dim sType As String = ""
3882
        '                If dStartY = dModelStart_Y Then
3883
        '                    dAddX = dModelStart_X
3884
        '                ElseIf dStartY = dModelEnd_Y Then
3885
        '                    dAddX = dModelEnd_X
3886
        '                ElseIf dStartY <= dModelStart_Y + dGap And dStartY >= dModelStart_Y - dGap Then
3887
        '                    dAddX = dModelStart_X
3888
        '                    If dStartY > dModelStart_Y Then
3889
        '                        sType = "AddLine"
3890
        '                    End If
3891
        '                ElseIf dStartY <= dModelEnd_Y + dGap And dStartY >= dModelEnd_Y - dGap Then
3892
        '                    dAddX = dModelEnd_X
3893
        '                    If dStartY > dModelEnd_Y Then
3894
        '                        sType = "AddLine"
3895
        '                    End If
3896
        '                End If
3897
        '                If dAddX <> 0 Then
3898
        '                    Dim oDatarow As DataRow = oModel_Dt.NewRow()
3899
        '                    oDatarow("X") = dAddX
3900
        '                    oDatarow("Y") = dAddY
3901
        '                    oDatarow("Type") = sType
3902
        '                    oDatarow("SPID") = sSPID
3903
        '                    oModel_Dt.Rows.Add(oDatarow)
3904
        '                End If
3905
        '            End If
3906
        '        Next
3907
        '    Catch ex As Exception
3908
        '    End Try
3909
        'Else
3910
        '    '현재선이 y축방향
3911
        '    sCurrentDirection = "Y"
3912
        '    Try
3913
        '        For Each oModelrow In _ModelingLine_Dt.Rows
3914
        '            Dim dModelStart_X As Double = oModelrow(_XML_LINE_DWG_STARTPOINT_X)
3915
        '            Dim dModelStart_Y As Double = oModelrow(_XML_LINE_DWG_STARTPOINT_Y)
3916
        '            Dim dModelEnd_X As Double = oModelrow(_XML_LINE_DWG_ENDPOINT_X)
3917
        '            Dim dModelEnd_Y As Double = oModelrow(_XML_LINE_DWG_ENDPOINT_Y)
3918
        '            Dim sSPID As String = oModelrow(_XML_LINE_SPID)
3919
        '            If dStartY < dModelStart_Y And dStartY < dModelEnd_Y And
3920
        '               dEndY > dModelStart_Y And dEndY > dModelEnd_Y Then
3921
        '                Dim dAddX As Double = dStartX
3922
        '                Dim dAddY As Double = 0
3923
        '                Dim sType As String = ""
3924
        '                If dStartX = dModelStart_X Then
3925
        '                    dAddY = dModelStart_Y
3926
        '                ElseIf dStartX = dModelEnd_X Then
3927
        '                    dAddY = dModelEnd_Y
3928
        '                ElseIf dStartX <= dModelStart_X + dGap And dStartX >= dModelStart_X - dGap Then
3929
        '                    dAddY = dModelStart_Y
3930
        '                    If dStartX > dModelStart_X Then
3931
        '                        sType = "AddLine"
3932
        '                    End If
3933
        '                ElseIf dStartX <= dModelEnd_X + dGap And dStartX >= dModelEnd_X - dGap Then
3934
        '                    dAddY = dModelEnd_Y
3935
        '                    If dStartX > dModelEnd_X Then
3936
        '                        sType = "AddLine"
3937
        '                    End If
3938
        '                End If
3939
        '                If dAddX <> 0 Then
3940
        '                    Dim oDatarow As DataRow = oModel_Dt.NewRow()
3941
        '                    oDatarow("X") = dAddX
3942
        '                    oDatarow("Y") = dAddY
3943
        '                    oDatarow("Type") = sType
3944
        '                    oDatarow("SPID") = sSPID
3945
        '                    oModel_Dt.Rows.Add(oDatarow)
3946
        '                End If
3947
        '            End If
3948
        '        Next
3949
        '    Catch ex As Exception
3950
        '    End Try
3951
        'End If
3952
        'If oModel_Dt.Rows.Count > 0 Then
3953
        '    If sCurrentDirection = "X" Then
3954
        '        'X좌표 정렬
3955
        '        oModel_Dt.DefaultView.Sort = "X desc"
3956
        '        oModel_Dt = oModel_Dt.DefaultView.ToTable(True)
3957
        '    Else
3958
        '        'Y좌표 정렬
3959
        '        oModel_Dt.DefaultView.Sort = "Y desc"
3960
        '        oModel_Dt = oModel_Dt.DefaultView.ToTable(True)
3961
        '    End If
3962
        '    Dim oLMConnector As LMConnector = Nothing
3963
        '    Dim oPreLMConnector As LMConnector = Nothing
3964
        '    Dim dStartFlag As Boolean = True
3965
        '    For Each oModelRow In oModel_Dt.Rows
3966
        '        Dim objInputs As PlaceRunInputs
3967
        '        objInputs = New PlaceRunInputs
3968
        '        Dim dX As Double = oModelRow("X")
3969
        '        Dim dY As Double = oModelRow("Y")
3970
        '        Dim sType As String = oModelRow("Type")
3971
        '        Dim sUid As String = ""
3972
        '        CheckConnectionLine(dX, dY, oLMConnector, sUid)
3973
        '        If oLMConnector IsNot Nothing Then
3974
        '            If dStartFlag Then
3975
        '                objInputs.AddPoint(dStartX, dStartY)
3976
        '                objInputs.AddConnectorTarget(oLMConnector, dX, dY)
3977
        '            Else
3978
        '                objInputs.AddConnectorTarget(oPreLMConnector, dStartX, dStartY)
3979
        '                objInputs.AddConnectorTarget(oLMConnector, dX, dY)
3980
        '            End If
3981
        '            oPreLMConnector = LineModeling(objInputs, sSystemPath)
3982
        '            '모델링후 StartX를 현재 X로 변경
3983
        '            dStartX = dX
3984
        '            dStartY = dY
3985
        '        End If
3986
        '    Next
3987
        '    If oPreLMConnector IsNot Nothing Then
3988
        '        Dim objInputs As PlaceRunInputs
3989
        '        objInputs = New PlaceRunInputs
3990
        '        objInputs.AddConnectorTarget(oPreLMConnector, dStartX, dStartY)
3991
        '        objInputs.AddPoint(dEndX, dEndY)
3992
        '        LineModeling(objInputs, sSystemPath)
3993
        '    End If
3994
        'End If
3998 3995
        Return bCheckBranchLine
3999 3996
    End Function
4000 3997

  
DTI_PID/SPPIDConverter/SPPIDConverter.vbproj
54 54
  <ItemGroup>
55 55
    <Reference Include="ComUtil.MessageLog, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
56 56
      <SpecificVersion>False</SpecificVersion>
57
      <HintPath>bin\Debug\ComUtil.MessageLog.dll</HintPath>
57
      <HintPath>..\..\..\DTIPID\DTI_PID\SPPIDConverter\bin\Debug\ComUtil.MessageLog.dll</HintPath>
58 58
    </Reference>
59 59
    <Reference Include="DevExpress.Data.v18.1, Version=18.1.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" />
60 60
    <Reference Include="DevExpress.Printing.v18.1.Core, Version=18.1.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" />

내보내기 Unified diff

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