개정판 9c86a823
Flange Modeling 완료
DTI_PID/SPPIDConverter/Main.vb | ||
---|---|---|
527 | 527 |
Dim sConnectionPoint As String = "" |
528 | 528 |
Dim sConnectionUids As String = "" |
529 | 529 |
Dim sConnArray As String() |
530 |
|
|
530 |
Dim sChild As String = "" |
|
531 | 531 |
Dim dCenterPos_x As Double = 0.0 |
532 | 532 |
Dim dCenterPos_y As Double = 0.0 |
533 | 533 |
Dim dDwgCenterPos_x As Double = 0.0 |
... | ... | |
564 | 564 |
sAngle = oEleObj.Value |
565 | 565 |
oEleObj = oSymbol.Element(_XML_SYMBOL_CONNECTIONPOINT) |
566 | 566 |
sConnectionPoint = oEleObj.Value |
567 |
oEleObj = oSymbol.Element(_XML_SYMBOL_CHILD) |
|
568 |
sChild = oEleObj.Value |
|
567 | 569 |
Try |
568 | 570 |
oEleObj = oSymbol.Element(_XML_SYMBOL_ORIGINALPOINT) |
569 | 571 |
sOriginalPoint = oEleObj.Value |
... | ... | |
664 | 666 |
|
665 | 667 |
oAddrow(_XML_SYMBOL_CONNECTIONPOINT) = sConnectionPoint |
666 | 668 |
oAddrow(_XML_SYMBOL_DRAWING_TF) = "FALSE" |
669 |
oAddrow(_XML_SYMBOL_CHILD) = sChild |
|
667 | 670 |
' _AllSymbol_DT.Rows.Add(oAddrow) |
668 | 671 |
oSymbol_Dt.Rows.Add(oAddrow) |
669 | 672 |
Catch ex As Exception |
... | ... | |
1714 | 1717 |
ConvertPointBystring(sOriginalPoint, dOriginal_x, dOriginal_y) |
1715 | 1718 |
ConvertPointByImage(dOriginal_x, dOriginal_y, _IMG_X, _IMG_Y) |
1716 | 1719 |
|
1720 |
Dim sChildItem As String = oCurrentSymbolRow(_XML_SYMBOL_CHILD) |
|
1721 |
|
|
1717 | 1722 |
'Connection 정보 체크, 모델링 되어 있는지 유무 |
1718 | 1723 |
'양 커넥션의 모델링 유무를 체크한다. |
1719 | 1724 |
Dim sConn1Uid As String = oCurrentSymbolRow(_XML_SYMBOL_Conn1_Uid).ToString() |
... | ... | |
1784 | 1789 |
ConvertPoint(oCurrentSymbolRow(_XML_SYMBOL_Conn4_Point).ToString(), dConn4_x, dConn4_y) |
1785 | 1790 |
End If |
1786 | 1791 |
|
1792 |
|
|
1793 |
|
|
1794 |
|
|
1795 |
|
|
1787 | 1796 |
'If sConn1Type = "Line" Then |
1788 | 1797 |
' Dim sStartpoint As String = oCurrentSymbolRow(0)(_XML_SYMBOL_Conn1_Point).ToString() |
1789 | 1798 |
' ConvertPointBystring(sStartpoint, dConn1_x, dConn1_y) |
... | ... | |
1908 | 1917 |
|
1909 | 1918 |
sFirstUid = CheckExistModeling(oConn1Rows(0)) |
1910 | 1919 |
sSecondUid = CheckExistModeling(oConn2Rows(0)) |
1911 |
If oStartLMConnector IsNot Nothing Then |
|
1912 |
dOriginal_x = dConn1_x |
|
1913 |
dOriginal_y = dConn1_y |
|
1920 |
|
|
1921 |
If oStartLMConnector IsNot Nothing And oEndLMConnector IsNot Nothing Then |
|
1922 |
|
|
1923 |
''라인을 센터점에 먼저그리기 |
|
1924 |
'If dConn1_x <> dConn2_x And dConn1_y <> dConn2_y Then |
|
1925 |
' 'Angle Valve |
|
1926 |
' '라인두개 긋기 |
|
1927 |
' objInputs.Clear() |
|
1928 |
' objInputs.AddConnectorTarget(oStartLMConnector, dConn1_x, dConn1_y) |
|
1929 |
' objInputs.AddPoint(dOriginal_x, dOriginal_y) |
|
1930 |
' objInputs.AddConnectorTarget(oEndLMConnector, dConn2_x, dConn2_y) |
|
1931 |
' Dim objItem As LMAItem |
|
1932 |
' Dim sLineType As String = oConn1Rows(0)(_XML_LINE_TYPE).ToString() |
|
1933 |
' Dim sLine1Path As String = GetPipeType(sLineType) |
|
1934 |
' sLineType = oConn2Rows(0)(_XML_LINE_TYPE).ToString() |
|
1935 |
' Dim sLine2Path As String = GetPipeType(sLineType) |
|
1936 |
' If sLine1Path = sLine2Path Then |
|
1937 |
' objItem = _Placement.PIDCreateItem(sLine1Path) |
|
1938 |
' _Placement.PIDPlaceRun(objItem, objInputs) |
|
1939 |
' Else |
|
1940 |
' '//서로다른선일경우 먼저 Symbol을 그리고 커넥션으로 부터 각 선까지 선을 잇는다. |
|
1941 |
' End If |
|
1942 |
|
|
1943 |
|
|
1944 |
'End If |
|
1914 | 1945 |
Else |
1915 |
dOriginal_x = dConn2_x |
|
1916 |
dOriginal_y = dConn2_y |
|
1946 |
If oStartLMConnector IsNot Nothing Then |
|
1947 |
dOriginal_x = dConn1_x |
|
1948 |
dOriginal_y = dConn1_y |
|
1949 |
Else |
|
1950 |
dOriginal_x = dConn2_x |
|
1951 |
dOriginal_y = dConn2_y |
|
1952 |
End If |
|
1917 | 1953 |
End If |
1918 |
|
|
1919 | 1954 |
ElseIf sConn1Type <> "" And sConn2Type = "" Then |
1920 | 1955 |
If sConn1Type = "Line" Then |
1921 | 1956 |
CheckConnectionLine(oConn1Rows, dConn1_x, dConn1_y, oStartLMConnector, dPreConn_x, dPreConn_y) |
... | ... | |
1997 | 2032 |
sReturnUid = "" |
1998 | 2033 |
End If |
1999 | 2034 |
|
2035 |
|
|
2036 |
|
|
2037 |
|
|
2038 |
|
|
2039 |
|
|
2040 |
|
|
2041 |
|
|
2000 | 2042 |
If sSymbolCompType.ToUpper() = _SYMBOL_INSTUMENT.ToUpper() Then |
2001 | 2043 |
oLMSymbol = _Placement.PIDPlaceSymbol(sSystemPath, dOriginal_x, dOriginal_y,, dAngle) |
2002 | 2044 |
oCurrentSymbolRow(_XML_SYMBOL_LMSYMBOL) = oLMSymbol |
... | ... | |
2019 | 2061 |
oLMSymbol = _Placement.PIDPlaceSymbol(sSystemPath, dOriginal_x, dOriginal_y,, dAngle) |
2020 | 2062 |
oCurrentSymbolRow(_XML_SYMBOL_LMSYMBOL) = oLMSymbol |
2021 | 2063 |
End If |
2064 |
|
|
2065 |
|
|
2066 |
|
|
2067 |
End If |
|
2068 |
|
|
2069 |
|
|
2070 |
If sChildItem <> "" Then |
|
2071 |
Dim sConn1_Systempath As String = "" |
|
2072 |
Dim sConn2_Systempath As String = "" |
|
2073 |
Dim sConn1_Angle As Double = 0 |
|
2074 |
Dim sConn2_Angle As Double = 0 |
|
2075 |
|
|
2076 |
For Each sDirection In sChildItem.Split("/") |
|
2077 |
Dim iType As Integer = 0 |
|
2078 |
For Each sType In sDirection.Split(",") |
|
2079 |
If sConn1_Systempath = "" Then |
|
2080 |
If iType = 0 Then |
|
2081 |
sConn1_Angle = GetChildSymbolDirection(sType) |
|
2082 |
iType = iType + 1 |
|
2083 |
Else |
|
2084 |
Dim sStartpoint As String = oCurrentSymbolRow(_XML_SYMBOL_Conn1_Point).ToString() |
|
2085 |
ConvertPointBystring(sStartpoint, dConn1_x, dConn1_y) |
|
2086 |
ConvertPointByImage(dConn1_x, dConn1_y, _IMG_X, _IMG_Y) |
|
2087 |
sConn1_Systempath = GetDataFromMappingDB(sType, _DB_COLUMN_MAPPING_SPPID_SYSTEMPATH) |
|
2088 |
If oStartLMConnector Is Nothing Then |
|
2089 |
Dim dChildConn1_x As Double = 0 |
|
2090 |
Dim dChildConn1_y As Double = 0 |
|
2091 |
_Placement.PIDConnectPointLocation(oLMSymbol, 1, dChildConn1_x, dChildConn1_y) |
|
2092 |
If oLMSymbol.Connect1Connectors.Count = 0 And oLMSymbol IsNot Nothing Then |
|
2093 |
_Placement.PIDPlaceSymbol(sConn1_Systempath, dChildConn1_x, dChildConn1_y,, sConn1_Angle,, |
|
2094 |
TargetItem:=oLMSymbol.AsLMAItem) |
|
2095 |
Else |
|
2096 |
For Each oConnector In oLMSymbol.Connect1Connectors |
|
2097 |
_Placement.PIDPlaceSymbol(sConn1_Systempath, dChildConn1_x, dChildConn1_y,, sConn1_Angle,, |
|
2098 |
TargetItem:=oConnector.AsLMAItem) |
|
2099 |
Next |
|
2100 |
End If |
|
2101 |
|
|
2102 |
Else |
|
2103 |
_Placement.PIDPlaceSymbol(sConn1_Systempath, dConn1_x, dConn1_y,, sConn1_Angle,, |
|
2104 |
TargetItem:=oLMSymbol.AsLMAItem) |
|
2105 |
'oLMSymbol = _Placement.PIDPlaceSymbol(sConn1_Systempath, dConn1_x, dConn1_y,, sConn1_Angle,, |
|
2106 |
'TargetItem:=oStartLMConnector.AsLMAItem) |
|
2107 |
End If |
|
2108 |
|
|
2109 |
End If |
|
2110 |
Else |
|
2111 |
If iType = 0 Then |
|
2112 |
sConn2_Angle = GetChildSymbolDirection(sType) |
|
2113 |
iType = iType + 1 |
|
2114 |
Else |
|
2115 |
Dim sEndPoint As String = oCurrentSymbolRow(_XML_SYMBOL_Conn2_Point).ToString() |
|
2116 |
ConvertPointBystring(sEndPoint, dConn2_x, dConn2_y) |
|
2117 |
ConvertPointByImage(dConn2_x, dConn2_y, _IMG_X, _IMG_Y) |
|
2118 |
sConn2_Systempath = GetDataFromMappingDB(sType, _DB_COLUMN_MAPPING_SPPID_SYSTEMPATH) |
|
2119 |
If oEndLMConnector Is Nothing Then |
|
2120 |
Dim dChildConn2_x As Double = 0 |
|
2121 |
Dim dChildConn2_y As Double = 0 |
|
2122 |
_Placement.PIDConnectPointLocation(oLMSymbol, 2, dChildConn2_x, dChildConn2_y) |
|
2123 |
If oLMSymbol.Connect2Connectors.Count = 0 And oLMSymbol IsNot Nothing Then |
|
2124 |
_Placement.PIDPlaceSymbol(sConn1_Systempath, dChildConn2_x, dChildConn2_y,, sConn2_Angle,, |
|
2125 |
TargetItem:=oLMSymbol.AsLMAItem) |
|
2126 |
Else |
|
2127 |
For Each oConnector In oLMSymbol.Connect2Connectors |
|
2128 |
oLMSymbol = _Placement.PIDPlaceSymbol(sConn2_Systempath, dChildConn2_x, dChildConn2_y,, sConn2_Angle,, |
|
2129 |
TargetItem:=oConnector.AsLMAItem) |
|
2130 |
Next |
|
2131 |
End If |
|
2132 |
|
|
2133 |
Else |
|
2134 |
_Placement.PIDPlaceSymbol(sConn1_Systempath, dConn2_x, dConn2_y,, sConn2_Angle,, |
|
2135 |
TargetItem:=oLMSymbol.AsLMAItem) |
|
2136 |
' oLMSymbol = _Placement.PIDPlaceSymbol(sConn2_Systempath, dConn2_x, dConn2_y,, sConn2_Angle,, |
|
2137 |
'TargetItem:=oEndLMConnector.AsLMAItem) |
|
2138 |
End If |
|
2139 |
|
|
2140 |
End If |
|
2141 |
End If |
|
2142 |
Next |
|
2143 |
Next |
|
2144 |
|
|
2145 |
|
|
2146 |
'If sConn1_Systempath <> "" Then |
|
2147 |
' Dim oConn1s As LMConnectors = oLMSymbol.Connect1Connectors |
|
2148 |
' Dim dChildConn1_x As Double = 0 |
|
2149 |
' Dim dChildConn1_y As Double = 0 |
|
2150 |
' _Placement.PIDConnectPointLocation(oLMSymbol, 1, dChildConn1_x, dChildConn1_y) |
|
2151 |
' oLMSymbol = _Placement.PIDPlaceSymbol(sConn1_Systempath, dChildConn1_x, dChildConn1_y,, sConn1_Angle) |
|
2152 |
' 'For Each oConnector In oLMSymbol.Connect1Connectors |
|
2153 |
' ' oLMSymbol = _Placement.PIDPlaceSymbol(sConn1_Systempath, dChildConn1_x, dChildConn1_y,, sConn1_Angle,, |
|
2154 |
' ' TargetItem:=oConnector.AsLMAItem) |
|
2155 |
' 'Next |
|
2156 |
'End If |
|
2157 |
|
|
2158 |
'If sConn2_Systempath <> "" Then |
|
2159 |
' Dim oConn2s As LMConnectors = oLMSymbol.Connect2Connectors |
|
2160 |
' Dim dChildConn2_x As Double = 0 |
|
2161 |
' Dim dChildConn2_y As Double = 0 |
|
2162 |
' _Placement.PIDConnectPointLocation(oLMSymbol, 2, dChildConn2_x, dChildConn2_y) |
|
2163 |
' oLMSymbol = _Placement.PIDPlaceSymbol(sConn2_Systempath, dChildConn2_x, dChildConn2_y,, sConn2_Angle) |
|
2164 |
' 'For Each oConnector In oLMSymbol.Connect2Connectors |
|
2165 |
' ' oLMSymbol = _Placement.PIDPlaceSymbol(sConn2_Systempath, dChildConn2_x, dChildConn2_y,, sConn2_Angle,, |
|
2166 |
' ' TargetItem:=oConnector.AsLMAItem) |
|
2167 |
' 'Next |
|
2168 |
'End If |
|
2169 |
''Child 모델링 |
|
2170 |
|
|
2171 |
|
|
2172 |
|
|
2173 |
|
|
2174 |
|
|
2175 |
|
|
2176 |
|
|
2022 | 2177 |
End If |
2178 |
|
|
2179 |
|
|
2180 |
|
|
2181 |
|
|
2182 |
|
|
2023 | 2183 |
AddProgress() |
2024 | 2184 |
|
2025 | 2185 |
SetListBoxItems(ListBox_Result, "Place Fitting.." & sUid & " (" & dOriginal_x & "," & dOriginal_y & ")..." & _iFittingcnt & " count ") |
... | ... | |
2102 | 2262 |
'현재 Uid 모델링 |
2103 | 2263 |
End Function |
2104 | 2264 |
|
2265 |
Private Function GetChildSymbolDirection(ByVal sDirection As String) As Double |
|
2266 |
Dim sReturnDirection As String = "" |
|
2267 |
If sDirection.ToUpper() = "RIGHT" Then |
|
2268 |
Return 3.14 |
|
2269 |
ElseIf sDirection.ToUpper() = "LEFT" Then |
|
2270 |
Return 0 |
|
2271 |
ElseIf sDirection.ToUpper = "DOWN" Then |
|
2272 |
Return 1.57 |
|
2273 |
ElseIf sDirection.ToUpper() = "UP" Then |
|
2274 |
Return 4.71 |
|
2275 |
Else |
|
2276 |
Return 0 |
|
2277 |
End If |
|
2278 |
End Function |
|
2279 |
|
|
2280 |
|
|
2281 |
|
|
2105 | 2282 |
Private Function CheckExistModeling(ByVal oRow As DataRow) As String |
2106 | 2283 |
If oRow(_XML_LINE_DRAWING_TF).ToString() = "FALSE" And oRow(_XML_LINE_Check).ToString() = "TRUE" Then |
2107 | 2284 |
Return oRow(_XML_LINE_UID).ToString() |
... | ... | |
2116 | 2293 |
End Sub |
2117 | 2294 |
|
2118 | 2295 |
|
2119 |
|
|
2120 |
|
|
2121 |
'Dim _StartPos_X As Double = 0 |
|
2122 |
'Dim _StartPos_Y As Double = 0 |
|
2123 |
'Dim _EndPos_X As Double = 0 |
|
2124 |
'Dim _EndPos_Y As Double = 0 |
|
2125 |
'Dim _StartUid As String = "" |
|
2126 |
'Dim _EndUid As String = "" |
|
2127 |
'Dim _objInputs As PlaceRunInputs |
|
2128 |
'Dim _ListPos As New List(Of String) |
|
2129 |
'Dim _Direction As String = "" |
|
2130 |
'Private Function FinalLineModeling(ByVal oCurrentLineRow As DataRow, |
|
2131 |
' ByVal oLine_Dt As DataTable, ByVal oSymbol_Dt As DataTable, |
|
2132 |
' ByVal oAttribute_Dt As DataTable) As String |
|
2133 |
' Dim sReturnUid As String = "" |
|
2134 |
' '현재 Uid 모델링 여부 체크 |
|
2135 |
' Dim sStartpoint As String = "" |
|
2136 |
' Dim sEndpoint As String = "" |
|
2137 |
|
|
2138 |
' Dim dOriginalStart_x As Double = 0.0 |
|
2139 |
' Dim dOriginalStart_y As Double = 0.0 |
|
2140 |
' Dim dOriginalEnd_x As Double = 0.0 |
|
2141 |
' Dim dOriginalEnd_y As Double = 0.0 |
|
2142 |
|
|
2143 |
' Dim dConvertStart_x As Double = 0 |
|
2144 |
' Dim dConvertStart_y As Double = 0 |
|
2145 |
' Dim dConvertEnd_x As Double = 0 |
|
2146 |
' Dim dConvertEnd_y As Double = 0 |
|
2147 |
|
|
2148 |
|
|
2149 |
' Dim dCenterPos_x As Double = 0.0 |
|
2150 |
' Dim dCenterPos_y As Double = 0.0 |
|
2151 |
' Dim objItem As LMAItem |
|
2152 |
|
|
2153 |
' Dim sUid As String = oCurrentLineRow(_XML_LINE_UID).ToString() |
|
2154 |
' Dim sLineType As String = oCurrentLineRow(_XML_LINE_TYPE).ToString() |
|
2155 |
' Dim sSystemPath As String = GetPipeType(sLineType) |
|
2156 |
' Dim sLineNoText As String = oCurrentLineRow(_XML_LINENO_TEXT).ToString() |
|
2157 |
' Dim sLineNoUid As String = oCurrentLineRow(_XML_LINE_LINENOUID).ToString() |
|
2158 |
' sStartpoint = oCurrentLineRow(_XML_LINE_STARTPOINT).ToString() |
|
2159 |
' ConvertPointBystring(sStartpoint, dOriginalStart_x, dOriginalStart_y) |
|
2160 |
' ConvertPointByImage(dConvertStart_x, dConvertStart_y, _IMG_X, _IMG_Y) |
|
2161 |
' sEndpoint = oCurrentLineRow(_XML_LINE_ENDPOINT).ToString() |
|
2162 |
' ConvertPointBystring(sEndpoint, dOriginalEnd_x, dOriginalEnd_y) |
|
2163 |
' ConvertPointByImage(dConvertEnd_x, dConvertEnd_y, _IMG_X, _IMG_Y) |
|
2164 |
|
|
2165 |
' dCenterPos_x = Math.Abs(dOriginalStart_x + dOriginalEnd_x) / 2 |
|
2166 |
' dCenterPos_y = Math.Abs(dOriginalStart_y + dOriginalEnd_y) / 2 |
|
2167 |
|
|
2168 |
' If _Direction = "" Then |
|
2169 |
' If Math.Abs(dOriginalStart_x - dOriginalEnd_x) > Math.Abs(dOriginalStart_y - dOriginalEnd_y) Then |
|
2170 |
' _Direction = "X" |
|
2171 |
' Else |
|
2172 |
' _Direction = "Y" |
|
2173 |
' End If |
|
2174 |
' Else |
|
2175 |
' If _Direction = "X" Then |
|
2176 |
' If Math.Abs(dOriginalStart_x - dOriginalEnd_x) < Math.Abs(dOriginalStart_y - dOriginalEnd_y) Then |
|
2177 |
|
|
2178 |
' End If |
|
2179 |
' Else |
|
2180 |
' If Math.Abs(dOriginalStart_x - dOriginalEnd_x) > Math.Abs(dOriginalStart_y - dOriginalEnd_y) Then |
|
2181 |
|
|
2182 |
' End If |
|
2183 |
' End If |
|
2184 |
' End If |
|
2185 |
|
|
2186 |
|
|
2187 |
' 'Connection 정보 체크, 모델링 되어 있는지 유무 |
|
2188 |
' '양 커넥션의 모델링 유무를 체크한다. |
|
2189 |
' Dim sConn1Uid As String = oCurrentLineRow(_XML_LINE_Conn1_Uid).ToString() |
|
2190 |
' Dim sConn2Uid As String = oCurrentLineRow(_XML_LINE_Conn2_Uid).ToString() |
|
2191 |
' Dim sConn1Type As String = "" |
|
2192 |
' Dim sConn2Type As String = "" |
|
2193 |
|
|
2194 |
' Dim oConn1Rows() As DataRow = oSymbol_Dt.Select("[" & _XML_SYMBOL_UID & "] = '" & sConn1Uid & "'" & |
|
2195 |
' " And [" & _XML_SYMBOL_DRAWING_TF & "] = 'False'" & |
|
2196 |
' " And [" & _XML_SYMBOL_Check & "] = 'True'") |
|
2197 |
' If oConn1Rows.Length = 0 Then |
|
2198 |
' oConn1Rows = oLine_Dt.Select("[" & _XML_LINE_UID & "] = '" & sConn1Uid & "'" & |
|
2199 |
' " And [" & _XML_LINE_DRAWING_TF & "] = 'False'" & |
|
2200 |
' " And [" & _XML_LINE_Check & "] = 'True'") |
|
2201 |
' If oConn1Rows.Length = 1 Then |
|
2202 |
' sConn1Type = "Line" |
|
2203 |
' End If |
|
2204 |
' Else |
|
2205 |
' sConn1Type = "Symbol" |
|
2206 |
' End If |
|
2207 |
|
|
2208 |
' Dim oConn2Rows() As DataRow = oSymbol_Dt.Select("[" & _XML_SYMBOL_UID & "] = '" & sConn2Uid & "'" & |
|
2209 |
' " And [" & _XML_SYMBOL_DRAWING_TF & "] = 'False'" & |
|
2210 |
' " And [" & _XML_SYMBOL_Check & "] = 'True'") |
|
2211 |
' If oConn2Rows.Length = 0 Then |
|
2212 |
' oConn2Rows = oLine_Dt.Select("[" & _XML_LINE_UID & "] = '" & sConn2Uid & "'" & |
|
2213 |
' " And [" & _XML_LINE_DRAWING_TF & "] = 'False'" & |
|
2214 |
' " And [" & _XML_LINE_Check & "] = 'True'") |
|
2215 |
' If oConn2Rows.Length = 1 Then |
|
2216 |
' sConn2Type = "Line" |
|
2217 |
' End If |
|
2218 |
' Else |
|
2219 |
' sConn2Type = "Symbol" |
|
2220 |
' End If |
|
2221 |
|
|
2222 |
|
|
2223 |
' If _StartPos_X = 0 And _StartPos_Y = 0 Then |
|
2224 |
' _StartPos_X = dOriginalStart_x |
|
2225 |
' _StartPos_Y = dOriginalStart_y |
|
2226 |
' _ListPos.Add(_StartPos_X & "," & _StartPos_Y) |
|
2227 |
' End If |
|
2228 |
' Dim iModelingType As Integer = 0 |
|
2229 |
' If sConn1Type = "Line" And sConn2Type = "Line" Then |
|
2230 |
' sReturnUid = sConn2Uid |
|
2231 |
' ElseIf sConn1Type = "Line" And sConn2Type = "Symbol" Then |
|
2232 |
' sReturnUid = sConn2Uid |
|
2233 |
' ElseIf sConn1Type = "Symbol" And sConn2Type = "Line" Then |
|
2234 |
' sReturnUid = sConn2Uid |
|
2235 |
' ElseIf sConn1Type = "Symbol" And sConn2Type = "Symbol" Then |
|
2236 |
' sReturnUid = sConn2Uid |
|
2237 |
' ElseIf sConn1Type = "Line" And sConn2Type = "" Then |
|
2238 |
' sReturnUid = sConn1Uid |
|
2239 |
' ElseIf sConn1Type = "Symbol" And sConn2Type = "" Then |
|
2240 |
' sReturnUid = sConn1Uid |
|
2241 |
' ElseIf sConn1Type = "" And sConn2Type = "Line" Then |
|
2242 |
' sReturnUid = sConn2Uid |
|
2243 |
' ElseIf sConn1Type = "" And sConn2Type = "Symbol" Then |
|
2244 |
' sReturnUid = sConn2Uid |
|
2245 |
' Else |
|
2246 |
' sReturnUid = "" |
|
2247 |
' _EndPos_X = dOriginalEnd_x |
|
2248 |
' _EndPos_Y = dOriginalEnd_y |
|
2249 |
' End If |
|
2250 |
|
|
2251 |
|
|
2252 |
' Dim sConn1LineNo As String = "" |
|
2253 |
' If oConn1Rows.Length = 1 Then |
|
2254 |
|
|
2255 |
' End If |
|
2256 |
' Dim sConn2LineNo As String = "" |
|
2257 |
' If oConn2Rows.Length = 1 Then |
|
2258 |
|
|
2259 |
' End If |
|
2260 |
' Dim oStartLMConnector As LMConnector = Nothing |
|
2261 |
' Dim oEndLMConnector As LMConnector = Nothing |
|
2262 |
' Dim oLMSymbol1 As LMSymbol = Nothing |
|
2263 |
' Dim oLMSymbol2 As LMSymbol = Nothing |
|
2264 |
' Dim objInputs As PlaceRunInputs |
|
2265 |
' objInputs = New PlaceRunInputs |
|
2266 |
|
|
2267 |
' If sConn1Type = "Line" And sConn2Type = "Line" Then |
|
2268 |
' iModelingType = 1 |
|
2269 |
' ElseIf sConn1Type = "Line" And sConn2Type = "Symbol" Then |
|
2270 |
' iModelingType = 1 |
|
2271 |
' ElseIf sConn1Type = "Symbol" And sConn2Type = "Line" Then |
|
2272 |
' iModelingType = 1 |
|
2273 |
' ElseIf sConn1Type = "Symbol" And sConn2Type = "Symbol" Then |
|
2274 |
' iModelingType = 1 |
|
2275 |
' ElseIf sConn1Type = "Line" And sConn2Type = "" Then |
|
2276 |
' iModelingType = 2 |
|
2277 |
' ElseIf sConn1Type = "Symbol" And sConn2Type = "" Then |
|
2278 |
' iModelingType = 2 |
|
2279 |
' ElseIf sConn1Type = "" And sConn2Type = "Line" Then |
|
2280 |
' iModelingType = 3 |
|
2281 |
' ElseIf sConn1Type = "" And sConn2Type = "Symbol" Then |
|
2282 |
' iModelingType = 3 |
|
2283 |
' Else |
|
2284 |
' iModelingType = 4 |
|
2285 |
' End If |
|
2286 |
|
|
2287 |
' If iModelingType = 1 Then |
|
2288 |
' If sConn1Type = "Line" Then |
|
2289 |
' CheckConnectionLine(oConn1Rows, dOriginalStart_x, dOriginalStart_y, oStartLMConnector) |
|
2290 |
' Else |
|
2291 |
' oLMSymbol1 = CheckConnectionSymbolToLine(oConn1Rows, dOriginalStart_x, dOriginalStart_y, dCenterPos_x, dCenterPos_y, oStartLMConnector) |
|
2292 |
' End If |
|
2293 |
' If sConn1Type = "Line" Then |
|
2294 |
' CheckConnectionLine(oConn2Rows, dOriginalEnd_x, dOriginalEnd_y, oEndLMConnector) |
|
2295 |
' Else |
|
2296 |
' oLMSymbol2 = CheckConnectionSymbolToLine(oConn2Rows, dOriginalEnd_x, dOriginalEnd_y, dCenterPos_x, dCenterPos_y, oEndLMConnector) |
|
2297 |
' End If |
|
2298 |
' 'CheckConnectionLine(oConn1Rows, dOriginalStart_x, dOriginalStart_y, oStartLMConnector) |
|
2299 |
' 'CheckConnectionLine(oConn2Rows, dOriginalEnd_x, dOriginalEnd_y, oEndLMConnector) |
|
2300 |
' ElseIf iModelingType = "2" Then |
|
2301 |
' If sConn1Type = "Line" Then |
|
2302 |
' CheckConnectionLine(oConn1Rows, dOriginalStart_x, dOriginalStart_y, oStartLMConnector) |
|
2303 |
' Else |
|
2304 |
' oLMSymbol1 = CheckConnectionSymbolToLine(oConn1Rows, dOriginalStart_x, dOriginalStart_y, dCenterPos_x, dCenterPos_y, oStartLMConnector) |
|
2305 |
' End If |
|
2306 |
' ' CheckConnectionLine(oConn2Rows, dOriginalStart_x, dOriginalStart_y, oStartLMConnector) |
|
2307 |
' ElseIf iModelingType = "3" Then |
|
2308 |
' If sConn1Type = "Line" Then |
|
2309 |
' CheckConnectionLine(oConn2Rows, dOriginalEnd_x, dOriginalEnd_y, oEndLMConnector) |
|
2310 |
' Else |
|
2311 |
' oLMSymbol2 = CheckConnectionSymbolToLine(oConn2Rows, dOriginalEnd_x, dOriginalEnd_y, dCenterPos_x, dCenterPos_y, oEndLMConnector) |
|
2312 |
' End If |
|
2313 |
' ' CheckConnectionLine(oConn2Rows, dOriginalEnd_x, dOriginalEnd_y, oStartLMConnector) |
|
2314 |
|
|
2315 |
' Else |
|
2316 |
' 'objInputs.AddPoint(dOriginalStart_x, dOriginalStart_y) |
|
2317 |
' 'objInputs.AddPoint(dOriginalEnd_x, dOriginalEnd_y) |
|
2318 |
' End If |
|
2319 |
|
|
2320 |
' Dim sFirstUid As String = "" |
|
2321 |
' Dim sSecondUid As String = "" |
|
2322 |
|
|
2323 |
' If oStartLMConnector Is Nothing And oEndLMConnector Is Nothing Then |
|
2324 |
' objInputs.AddPoint(dOriginalStart_x, dOriginalStart_y) |
|
2325 |
' objInputs.AddPoint(dOriginalEnd_x, dOriginalEnd_y) |
|
2326 |
' 'sFirstUid = CheckExistModeling(oConn1Rows(0)) |
|
2327 |
' 'sSecondUid = CheckExistModeling(oConn2Rows(0)) |
|
2328 |
' ElseIf oStartLMConnector IsNot Nothing And oEndLMConnector Is Nothing Then |
|
2329 |
' If sConn1Type = "Line" Then |
|
2330 |
' objInputs.AddConnectorTarget(oStartLMConnector, dOriginalStart_x, dOriginalStart_y) |
|
2331 |
' Else |
|
2332 |
' objInputs.AddSymbolTarget(oLMSymbol1, dOriginalStart_x, dOriginalStart_y) |
|
2333 |
' End If |
|
2334 |
|
|
2335 |
' objInputs.AddPoint(dOriginalEnd_x, dOriginalEnd_y) |
|
2336 |
' ' sSecondUid = CheckExistModeling(oConn2Rows(0)) |
|
2337 |
' ElseIf oStartLMConnector Is Nothing And oEndLMConnector IsNot Nothing Then |
|
2338 |
' If sConn2Type = "Line" Then |
|
2339 |
' objInputs.AddConnectorTarget(oStartLMConnector, dOriginalEnd_x, dOriginalEnd_y) |
|
2340 |
' Else |
|
2341 |
' objInputs.AddSymbolTarget(oLMSymbol2, dOriginalEnd_x, dOriginalEnd_y) |
|
2342 |
' End If |
|
2343 |
|
|
2344 |
' objInputs.AddPoint(dOriginalStart_x, dOriginalStart_y) |
|
2345 |
|
|
2346 |
' 'objInputs.AddPoint(dOriginalEnd_x, dOriginalEnd_y) |
|
2347 |
|
|
2348 |
' ' sFirstUid = CheckExistModeling(oConn1Rows(0)) |
|
2349 |
' Else |
|
2350 |
' If sConn1Type = "Line" Then |
|
2351 |
' objInputs.AddConnectorTarget(oStartLMConnector, dOriginalStart_x, dOriginalStart_y) |
|
2352 |
' Else |
|
2353 |
' objInputs.AddSymbolTarget(oLMSymbol1, dOriginalStart_x, dOriginalStart_y) |
|
2354 |
' End If |
|
2355 |
' If sConn2Type = "Line" Then |
|
2356 |
' objInputs.AddConnectorTarget(oStartLMConnector, dOriginalEnd_x, dOriginalEnd_y) |
|
2357 |
' Else |
|
2358 |
' objInputs.AddSymbolTarget(oLMSymbol2, dOriginalEnd_x, dOriginalEnd_y) |
|
2359 |
' End If |
|
2360 |
' 'objInputs.AddConnectorTarget(oStartLMConnector, dOriginalStart_x, dOriginalStart_y) |
|
2361 |
' 'objInputs.AddConnectorTarget(oEndLMConnector, dOriginalEnd_x, dOriginalEnd_y) |
|
2362 |
' End If |
|
2363 |
' If sConn1Type <> "" And sConn2Type <> "" Then |
|
2364 |
' sFirstUid = CheckExistModeling(oConn1Rows(0)) |
|
2365 |
' sSecondUid = CheckExistModeling(oConn2Rows(0)) |
|
2366 |
' ElseIf sConn1Type <> "" And sConn2Type = "" Then |
|
2367 |
' sFirstUid = CheckExistModeling(oConn1Rows(0)) |
|
2368 |
' ElseIf sConn1Type = "" And sConn2Type <> "" Then |
|
2369 |
' sSecondUid = CheckExistModeling(oConn2Rows(0)) |
|
2370 |
' End If |
|
2371 |
|
|
2372 |
' If sFirstUid <> "" And sSecondUid <> "" Then |
|
2373 |
' sReturnUid = sSecondUid |
|
2374 |
' ElseIf sFirstUid = "" And sSecondUid <> "" Then |
|
2375 |
' sReturnUid = sSecondUid |
|
2376 |
' ElseIf sFirstUid <> "" And sSecondUid = "" Then |
|
2377 |
' sReturnUid = sFirstUid |
|
2378 |
' Else |
|
2379 |
' sReturnUid = "" |
|
2380 |
' End If |
|
2381 |
' _iPipecnt = _iPipecnt + 1 |
|
2382 |
' Dim oCurrentConnector As LMConnector |
|
2383 |
|
|
2384 |
' objItem = _Placement.PIDCreateItem(sSystemPath) |
|
2385 |
' Try |
|
2386 |
' objInputs.Clear() |
|
2387 |
' objInputs.AddPoint(dOriginalStart_x, dOriginalStart_y) |
|
2388 |
' objInputs.AddPoint(dOriginalEnd_x, dOriginalEnd_y) |
|
2389 |
' oCurrentConnector = _Placement.PIDPlaceRun(objItem, objInputs) |
|
2390 |
' Catch ex As Exception |
|
2391 |
|
|
2392 |
' End Try |
|
2393 |
|
|
2394 |
' oCurrentLineRow(_XML_LINE_LMCONNECTOR) = oCurrentConnector |
|
2395 |
' oCurrentLineRow(_XML_LINE_DRAWING_TF) = "TRUE" |
|
2396 |
|
|
2397 |
' SetListBoxItems(ListBox_Result, "Place Pipe.." & sUid & " (" & dOriginalStart_x & "," & dOriginalStart_y & ") - (" & dOriginalEnd_x & "," & dOriginalEnd_y & ")..." & _iPipecnt & " count ") |
|
2398 |
|
|
2399 |
' ComUtil.MessageLog.CEventLog.Log_Write_Update(_Log_Path, _Log_File, "Place Pipe : " & sUid) |
|
2400 |
' ComUtil.MessageLog.CEventLog.Log_Write_Update(_Log_Path, _Log_File, "LineNo : " & sLineNoText) |
|
2401 |
' ComUtil.MessageLog.CEventLog.Log_Write_Update(_Log_Path, _Log_File, "Connection1 : " & oCurrentLineRow(_XML_SYMBOL_Conn1_Uid).ToString()) |
|
2402 |
' ComUtil.MessageLog.CEventLog.Log_Write_Update(_Log_Path, _Log_File, "Connection2 : " & oCurrentLineRow(_XML_SYMBOL_Conn2_Uid).ToString()) |
|
2403 |
' 'ComUtil.MessageLog.CEventLog.Log_Write_Update(_Log_Path, _Log_File, "Angle : " & dAngle) |
|
2404 |
' ComUtil.MessageLog.CEventLog.Log_Write_Update(_Log_Path, _Log_File, "StartPoint : " & dOriginalStart_x & "," & dOriginalStart_y) |
|
2405 |
' ComUtil.MessageLog.CEventLog.Log_Write_Update(_Log_Path, _Log_File, "EndPoint : " & dOriginalEnd_x & "," & dOriginalEnd_y) |
|
2406 |
' ComUtil.MessageLog.CEventLog.Log_Write_Update(_Log_Path, _Log_File, "Pipe Count : " & _iPipecnt) |
|
2407 |
|
|
2408 |
' Dim oPipeRun As LMPipeRun = _Placement.PIDDataSource.GetPipeRun(oCurrentConnector.ModelItemID) |
|
2409 |
' Dim oAttributeRow() As DataRow = oAttribute_Dt.Select(_XML_ATTRIBUTE_UID & " = '" + sLineNoUid + "'") |
|
2410 |
' If oAttributeRow.Length > 0 Then |
|
2411 |
' For Each oAttribute In oAttributeRow |
|
2412 |
' Try |
|
2413 |
' Dim sPIDAttribute As String = oAttribute(_XML_ATTRIBUTE_NAME).ToString() |
|
2414 |
' Dim sPIDValue As String = oAttribute(_XML_ATTRIBUTE_VALUE).ToString() |
|
2415 |
' If sPIDValue.Contains("'") Then |
|
2416 |
' sPIDValue = sPIDValue.Replace("'", """") |
|
2417 |
' End If |
|
2418 |
' Dim sSPPIDAttribute As String = GetAttributeMapping(sPIDAttribute, _DB_COLUMN_ATTRIBUTE_SPPID_ATTRIBUTE) |
|
2419 |
' oPipeRun.Attributes(sSPPIDAttribute).Value = sPIDValue |
|
2420 |
' Catch ex As Exception |
|
2421 |
' End Try |
|
2422 |
' Next |
|
2423 |
' oPipeRun.Commit() |
|
2424 |
' End If |
|
2425 |
|
|
2426 |
' Dim sID_1 As String = "" |
|
2427 |
' Dim sID_2 As String = "" |
|
2428 |
' If oStartLMConnector IsNot Nothing Then |
|
2429 |
' sID_1 = oStartLMConnector.ModelItemID |
|
2430 |
' sID_2 = oCurrentConnector.ModelItemID |
|
2431 |
' ElseIf oEndLMConnector IsNot Nothing Then |
|
2432 |
' sID_1 = oEndLMConnector.ModelItemID |
|
2433 |
' sID_2 = oCurrentConnector.ModelItemID |
|
2434 |
' End If |
|
2435 |
' If sID_1 <> "" And sID_2 <> "" Then |
|
2436 |
' ' Dim objSurvivorItem As LMAItem = Nothing |
|
2437 |
' ' Dim oPipeRun1 As LMPipeRun = _Placement.PIDDataSource.GetPipeRun(sID_1) |
|
2438 |
' ' Dim oPipeRun2 As LMPipeRun = _Placement.PIDDataSource.GetPipeRun(sID_2) |
|
2439 |
' ' _Placement.PIDJoinRuns(oPipeRun1, oPipeRun2) |
|
2440 |
' End If |
|
2441 |
' Return sReturnUid |
|
2442 |
' '현재 Uid 모델링 |
|
2443 |
'End Function |
|
2444 | 2296 |
Private Function FinalLineModeling(ByVal oCurrentLineRow As DataRow, |
2445 | 2297 |
ByVal oLine_Dt As DataTable, ByVal oSymbol_Dt As DataTable, |
2446 | 2298 |
ByVal oAttribute_Dt As DataTable) As String |
... | ... | |
3056 | 2908 |
|
3057 | 2909 |
End Sub |
3058 | 2910 |
|
2911 |
Private Function GetPipeColor(ByVal sType As String) As Color |
|
2912 |
If sType.ToUpper() = "ELECTRIC" Then |
|
2913 |
Return Color.DarkOrange |
|
2914 |
ElseIf sType.ToUpper() = "CONNECT TO PROCESS" Then |
|
2915 |
Return Color.LightGreen |
|
2916 |
ElseIf sType.ToUpper() = "SOFTWARE" Then |
|
2917 |
Return Color.Blue |
|
2918 |
ElseIf sType.ToUpper() = "PNEUMATIC" Then |
|
2919 |
Return Color.Gray |
|
2920 |
Else |
|
2921 |
Return Color.Black |
|
2922 |
End If |
|
2923 |
End Function |
|
2924 |
|
|
3059 | 2925 |
Private Function GetPipeType(ByVal sType As String) As String |
3060 | 2926 |
Dim sSystempath As String = "\Piping\Routing\Process Lines\Primary Piping.sym" ' oPipeRow(0)(_XML_LINE_SYSTEMPATH).ToString() |
3061 | 2927 |
If sType.ToUpper() = "ELECTRIC" Then |
3062 | 2928 |
sSystempath = "\Instrumentation\Signal Line\Electric.sym" |
3063 | 2929 |
ElseIf sType.ToUpper() = "CONNECT TO PROCESS" Then |
3064 | 2930 |
sSystempath = "\Instrumentation\Signal Line\Connect to Process.sym" |
2931 |
ElseIf sType.ToUpper() = "SOFTWARE" Then |
|
2932 |
sSystempath = "\Instrumentation\Signal Line\Software Link.sym" |
|
2933 |
ElseIf sType.ToUpper() = "PNEUMATIC" Then |
|
2934 |
sSystempath = "\Instrumentation\Signal Line\Pneumatic.sym" |
|
3065 | 2935 |
Else |
3066 | 2936 |
End If |
3067 | 2937 |
Return sSystempath |
... | ... | |
5570 | 5440 |
Dim sLineUid As String = oLineRow(_XML_LINE_UID) |
5571 | 5441 |
Dim oPipeNode As TreeNode = oLineNoNode.Nodes.Add(sLineUid, "Pipe") |
5572 | 5442 |
Dim bValidLine As Boolean = oLineRow(_XML_LINE_ValieLine) |
5443 |
|
|
5444 |
|
|
5573 | 5445 |
If bValidLine = False Then |
5574 | 5446 |
oLineNoNode.ForeColor = Color.Red |
5575 | 5447 |
oPipeNode.ForeColor = Color.Red |
5448 |
Else |
|
5449 |
|
|
5450 |
Dim bLineType As String = oLineRow(_XML_LINE_TYPE) |
|
5451 |
Dim bLineColor As Color = GetPipeColor(bLineType) |
|
5452 |
If bLineType <> "Primary" Then |
|
5453 |
MessageBox.Show("") |
|
5454 |
End If |
|
5455 |
oPipeNode.ForeColor = bLineColor |
|
5576 | 5456 |
End If |
5577 | 5457 |
oPipeNode.Tag = sLineNoUid |
5578 | 5458 |
Next |
... | ... | |
5580 | 5460 |
Dim sSymbolUid As String = oSymbolRow(_XML_SYMBOL_UID) |
5581 | 5461 |
Dim sSymbolName As String = oSymbolRow(_XML_SYMBOL_NAME) |
5582 | 5462 |
Dim oSymbolNode As TreeNode = oLineNoNode.Nodes.Add(sSymbolUid, sSymbolName) |
5463 |
|
|
5583 | 5464 |
oSymbolNode.Tag = sLineNoUid |
5584 | 5465 |
Next |
5585 | 5466 |
Next |
... | ... | |
5610 | 5491 |
If bValidLine = False Then |
5611 | 5492 |
oLineNoNode.ForeColor = Color.Red |
5612 | 5493 |
oPipeNode.ForeColor = Color.Red |
5494 |
Else |
|
5495 |
Dim bLineType As String = oLineRow(_XML_LINE_TYPE) |
|
5496 |
If bLineType <> "Primary" Then |
|
5497 |
MessageBox.Show("") |
|
5498 |
End If |
|
5499 |
Dim bLineColor As Color = GetPipeColor(bLineType) |
|
5500 |
oPipeNode.ForeColor = bLineColor |
|
5613 | 5501 |
End If |
5614 | 5502 |
oPipeNode.Tag = sLineNoUid |
5615 | 5503 |
Next |
내보내기 Unified diff