프로젝트

일반

사용자정보

개정판 f291ddcb

IDf291ddcb6f9eea9e3abfb83766b99eecea1debba
상위 fa8a3260
하위 bcee5244, a3dd299d

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

issue #591 : Nozzle모델링 완료

차이점 보기:

DTI_PID/SPPIDConverter/CGembox.vb
155 155
            For Each oDt As DataTable In oDs.Tables
156 156
                oSymbolSheet.Cells(0, iColcnt).Value = oDt.TableName
157 157
                oSymbolSheet.Columns(iColcnt).AutoFit()
158
                Dim oDataRows() As DataRow = oPIDSymbol_Dt.Select("category = '" & oDt.TableName & "'")
159
                Dim iRowcnt As Integer = 1
160
                For Each oRow In oDataRows
161
                    Dim sCategory As String = oRow("name").ToString()
162
                    oSymbolSheet.Cells(iRowcnt, iColcnt).Value = sCategory
163
                    iRowcnt = iRowcnt + 1
164
                Next
165
                Dim sStartCell As String = ConvertAlphabet(iColcnt) & 2
166
                Dim sEndCell As String = ConvertAlphabet(iColcnt) & iRowcnt
167

  
168
                Dim oAddRow As DataRow = oImageSymbol_Dt.NewRow()
169
                oAddRow(_Sheet_ImageSymbol_Type) = oDt.TableName
170
                oAddRow(_Sheet_ImageSymbol_StartCell) = sStartCell
171
                oAddRow(_Sheet_ImageSymbol_EndCell) = sEndCell
172
                oImageSymbol_Dt.Rows.Add(oAddRow)
173
                iColcnt = iColcnt + 1
158
                If oPIDSymbol_Dt IsNot Nothing Then
159
                    Dim oDataRows() As DataRow = oPIDSymbol_Dt.Select("category = '" & oDt.TableName & "'")
160
                    Dim iRowcnt As Integer = 1
161
                    For Each oRow In oDataRows
162
                        Dim sCategory As String = oRow("name").ToString()
163
                        oSymbolSheet.Cells(iRowcnt, iColcnt).Value = sCategory
164
                        iRowcnt = iRowcnt + 1
165
                    Next
166
                    Dim sStartCell As String = ConvertAlphabet(iColcnt) & 2
167
                    Dim sEndCell As String = ConvertAlphabet(iColcnt) & iRowcnt
168
                    Dim oAddRow As DataRow = oImageSymbol_Dt.NewRow()
169
                    oAddRow(_Sheet_ImageSymbol_Type) = oDt.TableName
170
                    oAddRow(_Sheet_ImageSymbol_StartCell) = sStartCell
171
                    oAddRow(_Sheet_ImageSymbol_EndCell) = sEndCell
172
                    oImageSymbol_Dt.Rows.Add(oAddRow)
173
                    iColcnt = iColcnt + 1
174
                End If
175

  
176

  
177

  
178

  
174 179
            Next
175 180
        End If
176 181
        Return oImageSymbol_Dt
DTI_PID/SPPIDConverter/GenerateRelation.vb
202 202

  
203 203
            For Each oLineRow In oLinelist_Dt_Line.Rows
204 204
                Dim sLineUid As String = oLineRow(_XML_LINE_UID).ToString()
205
                If sLineUid = "c5e85037-c9a6-4b8b-aff8-240d4dd89876" Then
206
                    ' MessageBox.Show("")
207
                End If
205

  
208 206
                Dim dLineStart_x As Double = 0.0
209 207
                Dim dLineStart_y As Double = 0.0
210 208
                Dim dLineEnd_x As Double = 0.0
......
406 404
        Try
407 405
            For Each oSymbolRow In oLinelist_Dt_Symbol.Rows
408 406
                Dim sUid As String = oSymbolRow(_XML_SYMBOL_UID)
409
                If sUid = "9ebcb62e-156e-4d3c-aeb2-3d9e5089915e" Then
410
                    '    MessageBox.Show("")
411
                End If
407

  
412 408
                Dim dConn1_x As Double = 0.0
413 409
                Dim dConn1_y As Double = 0.0
414 410
                Dim dConn2_x As Double = 0.0
DTI_PID/SPPIDConverter/MDatatable.vb
130 130
    Public Function Symbol_Dt() As DataTable
131 131
        Dim oDt As New DataTable
132 132
        oDt.Columns.Add(_XML_SYMBOL_UID)
133
        oDt.Columns.Add(_XML_SYMBOL_OWNER)
133 134
        oDt.Columns.Add(_XML_SYMBOL_LINENOUID)
134 135
        oDt.Columns.Add(_XML_LINENO_TEXT)
135 136
        oDt.Columns.Add(_XML_SYMBOL_RUNNAME)
DTI_PID/SPPIDConverter/MKey.vb
148 148
    Public _XML_SYMBOL_LMCONNECTOR_3 As String = "LMCONNECTOR_3"
149 149
    Public _XML_SYMBOL_LMCONNECTOR_4 As String = "LMCONNECTOR_4"
150 150

  
151
    Public _XML_SYMBOL_OWNER As String = "OWNER"
152

  
153

  
151 154
    Public _XML_SYMBOL_Conn1_Point As String = "Conn1_Point"
152 155
    Public _XML_SYMBOL_Conn2_Point As String = "Conn2_Point"
153 156
    Public _XML_SYMBOL_Conn3_Point As String = "Conn3_Point"
DTI_PID/SPPIDConverter/Main.vb
104 104
        Try
105 105
            ''  _TempSymbolDt = Symbol_Dt()
106 106
            Dim CDrawing As Drawing = New Drawing()
107
            Dim oDt As DataTable = LoadSymbol_DT()
107
            '     Dim oDt As DataTable = LoadSymbol_DT()
108 108
            Dim oElement As XElement = XElement.Load(sXmlPath)
109 109
            If oElement IsNot Nothing Then
110 110
                CDrawing.DwgName = oElement.Element(_XML_DWGNAME).Value
......
124 124
                        Try
125 125
                            Dim oAddrow As DataRow = oSymbol_Dt.NewRow()
126 126
                            Dim oEleObj As XElement
127
                            Dim sParentName As String
127 128
                            Dim sName As String
128 129
                            Dim sLocation As String
129 130
                            Dim sSize As String
......
155 156
                            Dim dDwg_Conn3Pos_y As Double = 0.0
156 157
                            Dim dDwg_Conn4Pos_x As Double = 0.0
157 158
                            Dim dDwg_Conn4Pos_y As Double = 0.0
159
                            Dim sOwnerUid As String = ""
158 160
                            oEleObj = oSymbol.Element(_XML_SYMBOL_UID)
159 161
                            sUid = oEleObj.Value
160 162
                            oEleObj = oSymbol.Element(_XML_SYMBOL_PARENT)
163
                            sParentName = oEleObj.Value
164
                            oEleObj = oSymbol.Element(_XML_SYMBOL_NAME)
161 165
                            sName = oEleObj.Value
162 166
                            oEleObj = oSymbol.Element(_XML_SYMBOL_LOCATION)
163 167
                            sLocation = oEleObj.Value
......
169 173
                            sConnectionPoint = oEleObj.Value
170 174
                            oEleObj = oSymbol.Element(_XML_SYMBOL_CHILD)
171 175
                            sChild = oEleObj.Value
176

  
177
                            If sName = "NOZZLE" Then
178
                                oEleObj = oSymbol.Element(_XML_SYMBOL_OWNER)
179
                                sOwnerUid = oEleObj.Value
180
                            End If
172 181
                            Try
173 182
                                oEleObj = oSymbol.Element(_XML_SYMBOL_ORIGINALPOINT)
174 183
                                sOriginalPoint = oEleObj.Value
175 184
                            Catch ex As Exception
176 185

  
177 186
                            End Try
178
                            'oEleObj = oSymbol.Element(_XML_LINE_CONNS)
179
                            'sConnectionUids = oEleObj.Value
180
                            'sConnArray = sConnectionUids.Split(",")
181
                            'If sConnArray.Length > 4 Then
182
                            '    MessageBox.Show(sConnArray.Length)
183
                            'End If
184
                            'For i = 0 To sConnArray.Length - 1
185
                            '    If i = 0 Then
186
                            '        oAddrow(_XML_SYMBOL_Conn1_Uid) = sConnArray(i)
187
                            '    ElseIf i = 1 Then
188
                            '        oAddrow(_XML_SYMBOL_Conn2_Uid) = sConnArray(i)
189
                            '    ElseIf i = 2 Then
190
                            '        oAddrow(_XML_SYMBOL_Conn3_Uid) = sConnArray(i)
191
                            '    ElseIf i = 3 Then
192
                            '        oAddrow(_XML_SYMBOL_Conn4_Uid) = sConnArray(i)
193
                            '    End If
194
                            'Next
187
                            oAddrow(_XML_SYMBOL_OWNER) = sOwnerUid
195 188
                            oAddrow(_XML_SYMBOL_Conn1_Uid) = ""
196 189
                            oAddrow(_XML_SYMBOL_Conn2_Uid) = ""
197 190
                            oAddrow(_XML_SYMBOL_Conn3_Uid) = ""
......
281 274
                            Next
282 275
                            ConvertPointByImage(dMin_x, dMin_y, _IMG_X, _IMG_Y)
283 276
                            ConvertPointByImage(dMax_x, dMax_y, _IMG_X, _IMG_Y)
284

  
285 277
                            oAddrow(_XML_SYMBOL_MIN_X) = dMin_x
286 278
                            oAddrow(_XML_SYMBOL_MAX_X) = dMax_x
287 279
                            oAddrow(_XML_SYMBOL_MIN_Y) = dMin_y
288 280
                            oAddrow(_XML_SYMBOL_MAX_Y) = dMax_y
289 281
                            oAddrow(_XML_SYMBOL_UID) = sUid
290
                            oAddrow(_XML_SYMBOL_NAME) = IO.Path.GetFileNameWithoutExtension(GetDataFromMappingDB(sName, _DB_COLUMN_MAPPING_SPPID_SYMBOLNAME))
282
                            oAddrow(_XML_SYMBOL_NAME) = IO.Path.GetFileNameWithoutExtension(GetDataFromMappingDB(sParentName, _DB_COLUMN_MAPPING_SPPID_SYMBOLNAME))
291 283
                            oAddrow(_XML_SYMBOL_LOCATION) = sLocation
292 284
                            oAddrow(_XML_SYMBOL_SIZE) = sSize
293 285
                            oAddrow(_XML_SYMBOL_ANGLE) = sAngle
294
                            oAddrow(_XML_SYMBOL_SYSTEMPATH) = GetDataFromMappingDB(sName, _DB_COLUMN_MAPPING_SPPID_SYSTEMPATH)
295
                            oAddrow(_XML_SYMBOL_TYPE) = GetDataFromMappingDB(sName, _DB_COLUMN_MAPPING_SPPID_COMPTPYE)
296
                            oAddrow(_XML_SYMBOL_CLASS) = GetDataFromMappingDB(sName, _DB_COLUMN_MAPPING_SPPID_CLASS)
286
                            oAddrow(_XML_SYMBOL_SYSTEMPATH) = GetDataFromMappingDB(sParentName, _DB_COLUMN_MAPPING_SPPID_SYSTEMPATH)
287
                            oAddrow(_XML_SYMBOL_TYPE) = GetDataFromMappingDB(sParentName, _DB_COLUMN_MAPPING_SPPID_COMPTPYE)
288
                            oAddrow(_XML_SYMBOL_CLASS) = GetDataFromMappingDB(sParentName, _DB_COLUMN_MAPPING_SPPID_CLASS)
297 289
                            oAddrow(_XML_SYMBOL_ORIGINALPOINT) = sOriginalPoint
298

  
299 290
                            oAddrow(_XML_SYMBOL_CONNECTIONPOINT) = sConnectionPoint
300 291
                            oAddrow(_XML_SYMBOL_DRAWING_TF) = "FALSE"
301 292
                            oAddrow(_XML_SYMBOL_CHILD) = sChild
......
313 304
                CDrawing.Line_nos = oLineno_list
314 305
                CDrawing.Eqp_nos = oEqp_list
315 306
                CDrawing.TrimLine_nos = oTrim_Lineno_list
316

  
317 307
            End If
318 308
            Return CDrawing
319 309
        Catch ex As Exception
......
514 504
                                sEndpoint = oEleObj.Value
515 505
                                oEleObj = oLine.Element(_XML_LINE_TYPE)
516 506
                                sType = oEleObj.Value
517
                                'oEleObj = oLine.Element(_XML_LINE_CONNS)
518
                                'sConnectionUids = oEleObj.Value
519
                                'sConnArray = sConnectionUids.Split(",")
520
                                'For i = 0 To sConnArray.Length - 1
521
                                '    If i = 0 Then
522
                                '        oAddrow(_XML_LINE_Conn1_Uid) = sConnArray(i)
523
                                '    ElseIf i = 1 Then
524
                                '        oAddrow(_XML_LINE_Conn2_Uid) = sConnArray(i)
525
                                '    End If
526
                                'Next
527
                                'If sConnArray.Length > 2 Then
528
                                '    MessageBox.Show(sConnArray.Length)
529
                                'End If
507

  
530 508
                                oAddrow(_XML_LINE_Conn1_Uid) = ""
531 509
                                oAddrow(_XML_LINE_Conn2_Uid) = ""
532 510
                                oAddrow(_XML_LINE_UID) = sUid
......
535 513
                                oAddrow(_XML_LINENO_TEXT) = CLineNo.Text
536 514
                                oAddrow(_XML_LINE_STARTPOINT) = sStartpoint
537 515
                                oAddrow(_XML_LINE_ENDPOINT) = sEndpoint
538

  
516
                                If sUid = "0bda520b-9c01-4dc1-9ddd-73adb5f7a871" Then
517
                                    MsgBox("")
518
                                End If
539 519
                                ConvertPointBystring(sStartpoint, dStartPos_x, dStartPos_y)
540 520
                                ConvertPointBystring(sEndpoint, dEndPos_x, dEndPos_y)
541 521
                                Dim sDirection As String = ""
......
1076 1056
                oAttributeRow = oAttribute_Dt.Select(_XML_ATTRIBUTE_UID & " = '" + sUid + "'")
1077 1057
            End If
1078 1058
            If oSymbolRow.Length > 0 Then
1059

  
1079 1060
                Dim oDatasource As Object = _Placement.PIDDataSource
1061
                Dim sSymbolName As String = oSymbolRow(0)(_XML_SYMBOL_NAME).ToString()
1080 1062
                Dim sSymbolCompType As String = oSymbolRow(0)(_XML_SYMBOL_TYPE).ToString()
1081 1063
                Dim sSystemPath As String = oSymbolRow(0)(_XML_SYMBOL_SYSTEMPATH).ToString()
1082 1064
                Dim sClass As String = oSymbolRow(0)(_XML_SYMBOL_CLASS).ToString()
......
1088 1070
                End If
1089 1071
                Dim dLocationX As Double = 0.0
1090 1072
                Dim dLocationY As Double = 0.0
1091
                Dim dX As Double = 0.0
1092
                Dim dY As Double = 0.0
1093 1073

  
1094
                If ConvertPointBystring(sOriginalPoint, dLocationX, dLocationY) Then
1095
                    dX = dLocationX
1096
                    dY = dLocationY
1097
                    ConvertPointByImage(dX, dY, _IMG_X, _IMG_Y)
1098
                    _Placement.PIDPlaceSymbol(sSystemPath, dX, dY, , dAngle)
1074
                ConvertPointBystring(sOriginalPoint, dLocationX, dLocationY)
1075
                Dim dX As Double = dLocationX
1076
                Dim dY As Double = dLocationY
1077
                ConvertPointByImage(dX, dY, _IMG_X, _IMG_Y)
1078

  
1079
                Dim oReturnSymbol As LMSymbol = Nothing
1080
                If sSymbolCompType.ToUpper() = "NOZZLE" Then
1081
                    Dim sOwnerUid As String = oSymbolRow(0)(_XML_SYMBOL_OWNER).ToString()
1082
                    Dim oFineRow() As DataRow = _ModelingSymbol_Dt.Select("Uid = '" & sOwnerUid & "'")
1083
                    If oFineRow.Length = 1 Then
1084
                        Dim sEqpModelID As String = oFineRow(0)(_XML_SYMBOL_SPID).ToString()
1085

  
1086
                        Dim objVessel As LMVessel
1087
                        objVessel = _Placement.PIDDataSource.GetVessel(sEqpModelID)
1088
                        Dim oVesselLocation As LMLocations = objVessel.Locations
1089
                        Dim oEqpSymbol As LMSymbol = _Placement.PIDDataSource.GetSymbol(objVessel.Representations.Nth(1).Id)
1090

  
1091
                        Dim objNozzle As LMSymbol = _Placement.PIDPlaceSymbol(sSystemPath, dX, dY,
1092
                                                    TargetItem:=oEqpSymbol.AsLMRepresentation)
1093
                        SetListBoxItems(ListBox_Result, "Place Nozzle.." & sUid & " (" & dLocationX & "," & dLocationY & ")..." & _iEquipmentcnt & " count ")
1094
                        _iNozzlecnt = _iNozzlecnt + 1
1095
                        ComUtil.MessageLog.CEventLog.Log_Write_Update(_Log_Path, _Log_File, "Place Nozzle : " & sUid)
1096
                        ComUtil.MessageLog.CEventLog.Log_Write_Update(_Log_Path, _Log_File, "Nozzle Name : " & sSymbolName)
1097
                        ComUtil.MessageLog.CEventLog.Log_Write_Update(_Log_Path, _Log_File, "Angle : " & dAngle)
1098
                        ComUtil.MessageLog.CEventLog.Log_Write_Update(_Log_Path, _Log_File, "OriginalPoint : " & dLocationX & "," & dLocationY)
1099
                        ComUtil.MessageLog.CEventLog.Log_Write_Update(_Log_Path, _Log_File, "Nozzle Count : " & _iNozzlecnt)
1100
                    End If
1101
                Else
1102
                    oReturnSymbol = _Placement.PIDPlaceSymbol(sSystemPath, dX, dY, , dAngle)
1099 1103
                    SetListBoxItems(ListBox_Result, "Place Equipment.." & sUid & " (" & dLocationX & "," & dLocationY & ")..." & _iEquipmentcnt & " count ")
1100 1104
                    _iEquipmentcnt = _iEquipmentcnt + 1
1101 1105
                    ComUtil.MessageLog.CEventLog.Log_Write_Update(_Log_Path, _Log_File, "Place Equipment : " & sUid)
1102
                    ComUtil.MessageLog.CEventLog.Log_Write_Update(_Log_Path, _Log_File, "Equipment Name : " & sEqpName)
1106
                    ComUtil.MessageLog.CEventLog.Log_Write_Update(_Log_Path, _Log_File, "Equipment Name : " & sSymbolName)
1103 1107
                    ComUtil.MessageLog.CEventLog.Log_Write_Update(_Log_Path, _Log_File, "Angle : " & dAngle)
1104 1108
                    ComUtil.MessageLog.CEventLog.Log_Write_Update(_Log_Path, _Log_File, "OriginalPoint : " & dLocationX & "," & dLocationY)
1105 1109
                    ComUtil.MessageLog.CEventLog.Log_Write_Update(_Log_Path, _Log_File, "Equipment Count : " & _iEquipmentcnt)
1106 1110
                End If
1111
                '모델링 된 Symbol 데이터 테이블 저장
1112
                Dim oAddRow As DataRow = _ModelingSymbol_Dt.NewRow
1113
                oAddRow(_XML_SYMBOL_UID) = sUid
1114
                oAddRow(_XML_SYMBOL_SPID) = oReturnSymbol.ModelItemID
1115
                oAddRow(_XML_SYMBOL_LMSYMBOL) = oReturnSymbol
1116
                oAddRow(_XML_SYMBOL_DRAWING_TF) = "TRUE"
1117
                oAddRow(_XML_SYMBOL_CENTERPOINT_X) = dLocationX
1118
                oAddRow(_XML_SYMBOL_CENTERPOINT_Y) = dLocationY
1119
                _ModelingSymbol_Dt.Rows.Add(oAddRow)
1120

  
1107 1121
            End If
1108 1122
        Catch ex As Exception
1109 1123
        End Try
......
1960 1974
            End If
1961 1975
        End If
1962 1976

  
1963
        '모델링 된 PipeLine 데이터 테이블 저장
1977
        '모델링 된 Symbol 데이터 테이블 저장
1964 1978
        Dim oAddRow As DataRow = _ModelingSymbol_Dt.NewRow
1965 1979
        oAddRow(_XML_SYMBOL_SPID) = oLMSymbol.ModelItemID
1966 1980
        oAddRow(_XML_SYMBOL_LMSYMBOL) = oLMSymbol
DTI_PID/SPPIDConverter/Mapping.vb
76 76
    Private Function GetComboEdit(ByVal sType As String) As RepositoryItemComboBox
77 77
        Dim oSymbolCombo As New RepositoryItemComboBox()
78 78
        oSymbolCombo.DropDownRows = 30
79
        Dim oDataRows() As DataRow = _PIDSymbol_Dt.Select("category = '" & sType & "'")
79
        If _PIDSymbol_Dt IsNot Nothing Then
80
            Dim oDataRows() As DataRow = _PIDSymbol_Dt.Select("category = '" & sType & "'")
80 81

  
81
        For Each oRow In oDataRows
82
            For Each oRow In oDataRows
82 83

  
83
            Dim sCategory As String = oRow("name").ToString()
84
            oSymbolCombo.Items.Add(sCategory)
85
        Next
84
                Dim sCategory As String = oRow("name").ToString()
85
                oSymbolCombo.Items.Add(sCategory)
86
            Next
87

  
88
        End If
86 89

  
87 90
        Return oSymbolCombo
88 91

  

내보내기 Unified diff

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