19a8ca1267
- Inserite 2 FeatureListV separate (e parte di 2 diverse Tab) per Layer e Part selezionati
721 lines
23 KiB
VB.net
721 lines
23 KiB
VB.net
Imports System.IO
|
|
Imports EgtUILib
|
|
Imports EgtWPFLib5
|
|
|
|
Public Class BTLStructureM
|
|
|
|
Private m_nBTLInfoId As Integer = 0
|
|
Public ReadOnly Property nBTLInfoId As Integer
|
|
Get
|
|
Return m_nBTLInfoId
|
|
End Get
|
|
End Property
|
|
|
|
Private m_nAsseBaseId As Integer = GDB_ID.NULL
|
|
Public ReadOnly Property nAsseBaseId As Integer
|
|
Get
|
|
Return m_nAsseBaseId
|
|
End Get
|
|
End Property
|
|
|
|
Private m_nCompositesId As Integer = GDB_ID.NULL
|
|
Public ReadOnly Property nCompositesId As Integer
|
|
Get
|
|
Return m_nCompositesId
|
|
End Get
|
|
End Property
|
|
|
|
' composite di tipo Element da BTL
|
|
Public m_BTLElementMList As List(Of BTLElementM)
|
|
Public Property BTLElementMList As List(Of BTLElementM)
|
|
Get
|
|
Return m_BTLElementMList
|
|
End Get
|
|
Set(value As List(Of BTLElementM))
|
|
m_BTLElementMList = value
|
|
End Set
|
|
End Property
|
|
|
|
' composite di tipo Layer da BTL
|
|
Public m_BTLLayerMList As List(Of BTLLayerM)
|
|
Public Property BTLLayerMList As List(Of BTLLayerM)
|
|
Get
|
|
Return m_BTLLayerMList
|
|
End Get
|
|
Set(value As List(Of BTLLayerM))
|
|
m_BTLLayerMList = value
|
|
End Set
|
|
End Property
|
|
|
|
' pezzi da BTL
|
|
Public m_BTLPartMList As List(Of BTLPartM)
|
|
Public Property BTLPartMList As List(Of BTLPartM)
|
|
Get
|
|
Return m_BTLPartMList
|
|
End Get
|
|
Set(value As List(Of BTLPartM))
|
|
m_BTLPartMList = value
|
|
End Set
|
|
End Property
|
|
|
|
' grezzi da BTL
|
|
Public m_BTLRawPartList As List(Of BTLRawPart)
|
|
|
|
#Region "Parametri generici"
|
|
|
|
Public m_sPROJNUM As String
|
|
Public Property sPROJNUM As String
|
|
Get
|
|
Return m_sPROJNUM
|
|
End Get
|
|
Set(value As String)
|
|
m_sPROJNUM = value
|
|
End Set
|
|
End Property
|
|
|
|
Public m_sPROJNAME As String
|
|
Public Property sPROJNAME As String
|
|
Get
|
|
Return m_sPROJNAME
|
|
End Get
|
|
Set(value As String)
|
|
m_sPROJNAME = value
|
|
End Set
|
|
End Property
|
|
|
|
Public m_sPROJPART As String
|
|
Public Property sPROJPART As String
|
|
Get
|
|
Return m_sPROJPART
|
|
End Get
|
|
Set(value As String)
|
|
m_sPROJPART = value
|
|
End Set
|
|
End Property
|
|
|
|
Public m_sPROJGUID As String
|
|
Public Property sPROJGUID As String
|
|
Get
|
|
Return m_sPROJGUID
|
|
End Get
|
|
Set(value As String)
|
|
m_sPROJGUID = value
|
|
End Set
|
|
End Property
|
|
|
|
Public m_nPROJTYPE As Integer
|
|
Public Property nPROJTYPE As Integer
|
|
Get
|
|
Return m_nPROJTYPE
|
|
End Get
|
|
Set(value As Integer)
|
|
m_nPROJTYPE = value
|
|
End Set
|
|
End Property
|
|
|
|
Public m_sLISTNAME As String
|
|
Public Property sLISTNAME As String
|
|
Get
|
|
Return m_sLISTNAME
|
|
End Get
|
|
Set(value As String)
|
|
m_sLISTNAME = value
|
|
End Set
|
|
End Property
|
|
|
|
Public m_sCUSTOMER As String
|
|
Public Property sCUSTOMER As String
|
|
Get
|
|
Return m_sCUSTOMER
|
|
End Get
|
|
Set(value As String)
|
|
m_sCUSTOMER = value
|
|
End Set
|
|
End Property
|
|
|
|
Public m_sARCHITECT As String
|
|
Public Property sARCHITECT As String
|
|
Get
|
|
Return m_sARCHITECT
|
|
End Get
|
|
Set(value As String)
|
|
m_sARCHITECT = value
|
|
End Set
|
|
End Property
|
|
|
|
Public m_sEDITOR As String
|
|
Public Property sEDITOR As String
|
|
Get
|
|
Return m_sEDITOR
|
|
End Get
|
|
Set(value As String)
|
|
m_sEDITOR = value
|
|
End Set
|
|
End Property
|
|
|
|
Public m_sDELIVDATE As String
|
|
Public Property sDELIVDATE As String
|
|
Get
|
|
Return m_sDELIVDATE
|
|
End Get
|
|
Set(value As String)
|
|
m_sDELIVDATE = value
|
|
End Set
|
|
End Property
|
|
|
|
Public m_sEXPDATE As String
|
|
Public Property sEXPDATE As String
|
|
Get
|
|
Return m_sEXPDATE
|
|
End Get
|
|
Set(value As String)
|
|
m_sEXPDATE = value
|
|
End Set
|
|
End Property
|
|
|
|
Public m_sEXPTIME As String
|
|
Public Property sEXPTIME As String
|
|
Get
|
|
Return m_sEXPTIME
|
|
End Get
|
|
Set(value As String)
|
|
m_sEXPTIME = value
|
|
End Set
|
|
End Property
|
|
|
|
Public m_sEXPRELEASE As String
|
|
Public Property sEXPRELEASE As String
|
|
Get
|
|
Return m_sEXPRELEASE
|
|
End Get
|
|
Set(value As String)
|
|
m_sEXPRELEASE = value
|
|
End Set
|
|
End Property
|
|
|
|
Public m_sLANGUAGE As String
|
|
Public Property sLANGUAGE As String
|
|
Get
|
|
Return m_sLANGUAGE
|
|
End Get
|
|
Set(value As String)
|
|
m_sLANGUAGE = value
|
|
End Set
|
|
End Property
|
|
|
|
Public m_ocRANGE As New List(Of Object)({New IdNameStruct(Range.STANDARD, EgtMsg(61710)),
|
|
New IdNameStruct(Range.EXTENDED, EgtMsg(61711))})
|
|
Public ReadOnly Property ocRANGE As List(Of Object)
|
|
Get
|
|
Return m_ocRANGE
|
|
End Get
|
|
End Property
|
|
|
|
Public m_SelRANGE As Integer
|
|
Public Property SelRANGE As Integer
|
|
Get
|
|
Return m_SelRANGE
|
|
End Get
|
|
Set(value As Integer)
|
|
m_SelRANGE = value
|
|
End Set
|
|
End Property
|
|
|
|
Public m_ocPROCESSINGQUALITY As New List(Of Object)({New IdNameStruct(ProcessingQuality.AUTOMATIC, EgtMsg(61658)),
|
|
New IdNameStruct(ProcessingQuality.VISIBLE, EgtMsg(61659)),
|
|
New IdNameStruct(ProcessingQuality.FAST, EgtMsg(61660))})
|
|
Public ReadOnly Property ocPROCESSINGQUALITY As List(Of Object)
|
|
Get
|
|
Return m_ocPROCESSINGQUALITY
|
|
End Get
|
|
End Property
|
|
|
|
Public m_SelPROCESSINGQUALITY As Integer
|
|
Public Property SelPROCESSINGQUALITY As Integer
|
|
Get
|
|
Return m_SelPROCESSINGQUALITY
|
|
End Get
|
|
Set(value As Integer)
|
|
m_SelPROCESSINGQUALITY = value
|
|
End Set
|
|
End Property
|
|
|
|
Public m_sCOMPUTERNAME As String
|
|
Public Property sCOMPUTERNAME As String
|
|
Get
|
|
Return m_sCOMPUTERNAME
|
|
End Get
|
|
Set(value As String)
|
|
m_sCOMPUTERNAME = value
|
|
End Set
|
|
End Property
|
|
|
|
Public m_sUSER As String
|
|
Public Property sUSER As String
|
|
Get
|
|
Return m_sUSER
|
|
End Get
|
|
Set(value As String)
|
|
m_sUSER = value
|
|
End Set
|
|
End Property
|
|
|
|
Public m_sSRCFILE As String
|
|
Public Property sSRCFILE As String
|
|
Get
|
|
Return m_sSRCFILE
|
|
End Get
|
|
Set(value As String)
|
|
m_sSRCFILE = value
|
|
End Set
|
|
End Property
|
|
|
|
Public m_sEXPFILE As String
|
|
Public Property sEXPFILE As String
|
|
Get
|
|
Return m_sEXPFILE
|
|
End Get
|
|
Set(value As String)
|
|
m_sEXPFILE = value
|
|
End Set
|
|
End Property
|
|
|
|
Public m_ocRECESS As New List(Of Object)({New IdNameStruct(Recess.AUTOMATIC, EgtMsg(61658)),
|
|
New IdNameStruct(Recess.MANUAL, EgtMsg(61661))})
|
|
Public ReadOnly Property ocRECESS As List(Of Object)
|
|
Get
|
|
Return m_ocRECESS
|
|
End Get
|
|
End Property
|
|
|
|
Public m_SelRECESS As Integer
|
|
Public Property SelRECESS As Integer
|
|
Get
|
|
Return m_SelRECESS
|
|
End Get
|
|
Set(value As Integer)
|
|
m_SelRECESS = value
|
|
End Set
|
|
End Property
|
|
|
|
Public m_sUSERATTRIBUTE As String
|
|
Public Property sUSERATTRIBUTE As String
|
|
Get
|
|
Return m_sUSERATTRIBUTE
|
|
End Get
|
|
Set(value As String)
|
|
m_sUSERATTRIBUTE = value
|
|
End Set
|
|
End Property
|
|
|
|
#End Region ' Parametri generici
|
|
|
|
#Region "MESSAGES"
|
|
|
|
' Info del pezzo
|
|
Public ReadOnly Property PDN_Msg As String
|
|
Get
|
|
Return EgtMsg(61601)
|
|
End Get
|
|
End Property
|
|
|
|
Public ReadOnly Property DO_Msg As String
|
|
Get
|
|
Return EgtMsg(61602)
|
|
End Get
|
|
End Property
|
|
|
|
Public ReadOnly Property NAM_Msg As String
|
|
Get
|
|
Return EgtMsg(61603)
|
|
End Get
|
|
End Property
|
|
|
|
Public ReadOnly Property L_Msg As String
|
|
Get
|
|
Return EgtMsg(61604)
|
|
End Get
|
|
End Property
|
|
|
|
Public ReadOnly Property W_Msg As String
|
|
Get
|
|
Return EgtMsg(61605)
|
|
End Get
|
|
End Property
|
|
|
|
Public ReadOnly Property H_Msg As String
|
|
Get
|
|
Return EgtMsg(61606)
|
|
End Get
|
|
End Property
|
|
|
|
Public ReadOnly Property MAT_Msg As String
|
|
Get
|
|
Return EgtMsg(61607)
|
|
End Get
|
|
End Property
|
|
|
|
Public ReadOnly Property CNT_Msg As String
|
|
Get
|
|
Return EgtMsg(61608)
|
|
End Get
|
|
End Property
|
|
|
|
Public ReadOnly Property TBP_Msg As String
|
|
Get
|
|
Return EgtMsg(61609)
|
|
End Get
|
|
End Property
|
|
|
|
Public ReadOnly Property DON_Msg As String
|
|
Get
|
|
Return EgtMsg(61610)
|
|
End Get
|
|
End Property
|
|
|
|
Public ReadOnly Property ROT_Msg As String
|
|
Get
|
|
Return EgtMsg(61611)
|
|
End Get
|
|
End Property
|
|
|
|
Public ReadOnly Property GRP_Msg As String
|
|
Get
|
|
Return EgtMsg(61612)
|
|
End Get
|
|
End Property
|
|
|
|
Public ReadOnly Property UNT_Msg As String
|
|
Get
|
|
Return EgtMsg(61613)
|
|
End Get
|
|
End Property
|
|
|
|
#End Region ' MESSAGES
|
|
|
|
#Region "CONSTRUCTOR"
|
|
|
|
Protected Sub New()
|
|
m_BTLPartMList = New List(Of BTLPartM)
|
|
End Sub
|
|
|
|
Public Shared Function CreateNewBTLStructure() As BTLStructureM
|
|
Return New BTLStructureM
|
|
End Function
|
|
|
|
Public Shared Function CreateBTLStructure(ProjId As Integer) As BTLStructureM
|
|
Dim NewBTLStructure As New BTLStructureM
|
|
Dim sValue As String = String.Empty
|
|
' se devo filtrare un progetto
|
|
If ProjId > 0 Then
|
|
' cerco tra i layer BTLInfo
|
|
Dim nBTLInfoLayerId As Integer = EgtGetFirstNameInGroup(GDB_ID.ROOT, BTLINFO)
|
|
While nBTLInfoLayerId <> GDB_ID.NULL
|
|
' verifico se il layer appartiene al ProjId
|
|
Dim nBTLInfoLayerProjId As Integer
|
|
EgtGetInfo(nBTLInfoLayerId, BTL_PRT_PROJ, nBTLInfoLayerProjId)
|
|
If nBTLInfoLayerProjId = ProjId Then
|
|
NewBTLStructure.m_nBTLInfoId = nBTLInfoLayerId
|
|
Exit While
|
|
End If
|
|
nBTLInfoLayerId = EgtGetNextName(nBTLInfoLayerId, BTLINFO)
|
|
End While
|
|
' cerco tra gli AsseBase
|
|
Dim nAsseBaseLayerId As Integer = EgtGetFirstNameInGroup(GDB_ID.ROOT, ASSEBASE)
|
|
While nAsseBaseLayerId <> GDB_ID.NULL
|
|
' verifico se il layer appartiene al ProjId
|
|
Dim nAsseBaseLayerProjId As Integer
|
|
EgtGetInfo(nAsseBaseLayerId, BTL_PRT_PROJ, nAsseBaseLayerProjId)
|
|
If nAsseBaseLayerProjId = ProjId Then
|
|
NewBTLStructure.m_nAsseBaseId = nAsseBaseLayerId
|
|
Exit While
|
|
End If
|
|
nAsseBaseLayerId = EgtGetNextName(nAsseBaseLayerId, ASSEBASE)
|
|
End While
|
|
|
|
|
|
'' cerco tra i Composites se ci sono Element o Layer per vedere se è un progetto Pareti Layer
|
|
'' cerco tra gli AsseBase
|
|
'Dim nCompositesId As Integer = EgtGetFirstNameInGroup(GDB_ID.ROOT, COMPOSITES)
|
|
'While nCompositesId <> GDB_ID.NULL
|
|
' ' verifico se il layer appartiene al ProjId
|
|
' Dim nCompositesProjId As Integer
|
|
' EgtGetInfo(nCompositesId, BTL_PRT_PROJ, nCompositesProjId)
|
|
' If nCompositesProjId = ProjId Then
|
|
' NewBTLStructure.m_nCompositesId = nCompositesProjId
|
|
' Exit While
|
|
' End If
|
|
' nCompositesId = EgtGetNextName(nCompositesId, COMPOSITES)
|
|
'End While
|
|
|
|
|
|
Else
|
|
NewBTLStructure.m_nAsseBaseId = EgtGetFirstNameInGroup(GDB_ID.ROOT, ASSEBASE)
|
|
NewBTLStructure.m_nBTLInfoId = EgtGetFirstNameInGroup(GDB_ID.ROOT, BTLINFO)
|
|
NewBTLStructure.m_nCompositesId = EgtGetFirstNameInGroup(GDB_ID.ROOT, COMPOSITES)
|
|
End If
|
|
|
|
|
|
|
|
' cerco tra i Composites se ci sono Element o Layer per vedere se è un progetto Pareti Layer
|
|
Dim bIsLayersWall As Boolean = False
|
|
Dim nCompositesId As Integer = EgtGetFirstNameInGroup(GDB_ID.ROOT, COMPOSITES)
|
|
While nCompositesId <> GDB_ID.NULL
|
|
' verifico se il layer appartiene al ProjId
|
|
Dim nCompositesProjId As Integer
|
|
EgtGetInfo(nCompositesId, BTL_PRT_PROJ, nCompositesProjId)
|
|
If nCompositesProjId = ProjId Then
|
|
NewBTLStructure.m_nCompositesId = nCompositesProjId
|
|
|
|
' Qua ciclare sui nodi figli (Element e Layer) di Composites?
|
|
|
|
'' costruisco un dizionario con gli id dei sottonodi di AsseBase del BTL importato e il valore dell'Info N degli stessi
|
|
'Dim CompositesSubNodeDict As New Dictionary(Of Integer, Integer)
|
|
Dim nCompositesSubNodeId As Integer = EgtGetFirstInGroup(nCompositesId)
|
|
'Dim sCompositeUID As String = String.Empty
|
|
'Dim nCompositeUID As Integer = 0
|
|
'While nCompositesSubNodeId <> GDB_ID.NULL
|
|
' 'If EgtGetInfo(nCompositesSubNodeId, BTL_Composite_N, sCompositeUID) Then
|
|
' ' sCompositeUID = sCompositeUID.Remove(0, 4)
|
|
' ' Integer.TryParse(sCompositeUID, nCompositeUID)
|
|
' ' CompositesSubNodeDict.Add(nCompositesSubNodeId, sCompositeUID)
|
|
' 'End If
|
|
|
|
|
|
' se Composites presente recupero i Composites di tipo Element e Layer
|
|
NewBTLStructure.m_BTLElementMList = LoadElements(nCompositesSubNodeId)
|
|
NewBTLStructure.m_BTLLayerMList = LoadLayers(nCompositesSubNodeId)
|
|
|
|
|
|
' aggiungo i Layer già caricati al BTLElement a seconda del GROUP (o di UID/SOU?)
|
|
For Each BTLElementItem In NewBTLStructure.BTLElementMList
|
|
BTLElementItem.BTLLayerMList = New List(Of BTLLayerM)
|
|
For Each BTLLayerItem In NewBTLStructure.BTLLayerMList
|
|
If BTLLayerItem.sGROUP = BTLElementItem.sGROUP Then
|
|
|
|
' recupero i pezzi associati al Layer
|
|
BTLLayerItem.BTLPartMList = LoadLayerParts(BTLLayerItem.nPartId)
|
|
|
|
BTLElementItem.BTLLayerMList.Add(BTLLayerItem)
|
|
End If
|
|
Next
|
|
Next
|
|
|
|
|
|
' nCompositesSubNodeId = EgtGetNext(nCompositesSubNodeId)
|
|
'End While
|
|
|
|
|
|
' setto il flag per specificare che è un progetto Pareti layer
|
|
' per evitare poi il LoadParts di tutti i pezzi del progetto
|
|
bIsLayersWall = True
|
|
|
|
Exit While
|
|
End If
|
|
nCompositesId = EgtGetNextName(nCompositesId, COMPOSITES)
|
|
End While
|
|
|
|
|
|
|
|
EgtGetInfo(NewBTLStructure.m_nBTLInfoId, BTL_GEN_PROJNUM, NewBTLStructure.m_sPROJNUM)
|
|
EgtGetInfo(NewBTLStructure.m_nBTLInfoId, BTL_GEN_PROJNAME, NewBTLStructure.m_sPROJNAME)
|
|
EgtGetInfo(NewBTLStructure.m_nBTLInfoId, BTL_GEN_PROJPART, NewBTLStructure.m_sPROJPART)
|
|
EgtGetInfo(NewBTLStructure.m_nBTLInfoId, BTL_GEN_PROJGUID, NewBTLStructure.m_sPROJGUID)
|
|
EgtGetInfo(NewBTLStructure.m_nBTLInfoId, BTL_GEN_PROJTYPE, NewBTLStructure.m_nPROJTYPE)
|
|
EgtGetInfo(NewBTLStructure.m_nBTLInfoId, BTL_GEN_LISTNAME, NewBTLStructure.m_sLISTNAME)
|
|
EgtGetInfo(NewBTLStructure.m_nBTLInfoId, BTL_GEN_CUSTOMER, NewBTLStructure.m_sCUSTOMER)
|
|
EgtGetInfo(NewBTLStructure.m_nBTLInfoId, BTL_GEN_ARCHITECT, NewBTLStructure.m_sARCHITECT)
|
|
EgtGetInfo(NewBTLStructure.m_nBTLInfoId, BTL_GEN_EDITOR, NewBTLStructure.m_sEDITOR)
|
|
EgtGetInfo(NewBTLStructure.m_nBTLInfoId, BTL_GEN_DELIVDATE, NewBTLStructure.m_sDELIVDATE)
|
|
EgtGetInfo(NewBTLStructure.m_nBTLInfoId, BTL_GEN_EXPDATE, NewBTLStructure.m_sEXPDATE)
|
|
EgtGetInfo(NewBTLStructure.m_nBTLInfoId, BTL_GEN_EXPTIME, NewBTLStructure.m_sEXPTIME)
|
|
EgtGetInfo(NewBTLStructure.m_nBTLInfoId, BTL_GEN_EXPRELEASE, NewBTLStructure.m_sEXPRELEASE)
|
|
EgtGetInfo(NewBTLStructure.m_nBTLInfoId, BTL_GEN_LANGUAGE, NewBTLStructure.m_sLANGUAGE)
|
|
EgtGetInfo(NewBTLStructure.m_nBTLInfoId, BTL_GEN_RANGE, sValue)
|
|
NewBTLStructure.m_SelRANGE = IdNameStruct.IndFromId(IdNameStruct.IdFromName(sValue, NewBTLStructure.ocRANGE), NewBTLStructure.ocRANGE)
|
|
EgtGetInfo(NewBTLStructure.m_nBTLInfoId, BTL_PRT_PROCESSINGQUALITY, sValue)
|
|
NewBTLStructure.m_SelPROCESSINGQUALITY = IdNameStruct.IndFromId(IdNameStruct.IdFromName(sValue, NewBTLStructure.ocPROCESSINGQUALITY), NewBTLStructure.ocPROCESSINGQUALITY)
|
|
EgtGetInfo(NewBTLStructure.m_nBTLInfoId, BTL_GEN_COMPUTERNAME, NewBTLStructure.m_sCOMPUTERNAME)
|
|
EgtGetInfo(NewBTLStructure.m_nBTLInfoId, BTL_GEN_USER, NewBTLStructure.m_sUSER)
|
|
EgtGetInfo(NewBTLStructure.m_nBTLInfoId, BTL_GEN_SRCFILE, NewBTLStructure.m_sSRCFILE)
|
|
EgtGetInfo(NewBTLStructure.m_nBTLInfoId, BTL_GEN_EXPFILE, NewBTLStructure.m_sEXPFILE)
|
|
EgtGetInfo(NewBTLStructure.m_nBTLInfoId, BTL_PRT_RECESS, sValue)
|
|
NewBTLStructure.m_SelRECESS = IdNameStruct.IndFromId(IdNameStruct.IdFromName(sValue, NewBTLStructure.ocRECESS), NewBTLStructure.ocRECESS)
|
|
EgtGetInfo(NewBTLStructure.m_nBTLInfoId, BTL_GEN_USERATTRIBUTE, NewBTLStructure.m_sUSERATTRIBUTE)
|
|
' setto il tipo di progetto (Beam o Wall) nel file ini del BTL
|
|
If NewBTLStructure.m_nPROJTYPE <> BWType.NULL Then BTLIniFile.m_nBTLBWType = NewBTLStructure.m_nPROJTYPE
|
|
' recupero i part
|
|
|
|
|
|
'If Not bIsLayersWall Then NewBTLStructure.m_BTLPartMList = LoadParts(ProjId)
|
|
NewBTLStructure.m_BTLPartMList = LoadParts(ProjId)
|
|
|
|
'Dim nPartId As Integer = EgtGetFirstPart()
|
|
'While nPartId <> GDB_ID.NULL
|
|
' NewBTLStructure.m_BTLPartMList.Add(BTLPartM.CreateBTLPart(nPartId))
|
|
' nPartId = EgtGetNextPart(nPartId)
|
|
'End While
|
|
Return NewBTLStructure
|
|
End Function
|
|
|
|
Private Shared Function LoadParts(ProjId As Integer) As List(Of BTLPartM)
|
|
Dim TempList As New List(Of BTLPartM)
|
|
Dim nPartId As Integer = EgtGetFirstPart()
|
|
While nPartId <> GDB_ID.NULL
|
|
' se devo filtrare un progetto
|
|
If ProjId > 0 Then
|
|
' verifico se il pezzo appartiene al ProjId
|
|
Dim nPartProjId As Integer
|
|
EgtGetInfo(nPartId, BTL_PRT_PROJ, nPartProjId)
|
|
If nPartProjId = ProjId Then
|
|
TempList.Add(BTLPartM.CreateBTLPart(nPartId))
|
|
End If
|
|
Else
|
|
' altrimenti carico tutti
|
|
TempList.Add(BTLPartM.CreateBTLPart(nPartId))
|
|
End If
|
|
nPartId = EgtGetNextPart(nPartId)
|
|
End While
|
|
Return TempList
|
|
End Function
|
|
|
|
Private Shared Function LoadLayerParts(nLayerId As Integer) As List(Of BTLPartM)
|
|
Dim TempList As New List(Of BTLPartM)
|
|
Dim nSubLayerId As Integer = EgtGetFirstInGroup(nLayerId)
|
|
' devo far passare i vari SubLayerId finchè non trovo quelli di UID.
|
|
' dentro questi devo trovare !SOU, il valore di questo è il PartId che ci interessa caricare
|
|
While nSubLayerId <> GDB_ID.NULL
|
|
Dim sSubLayerName As String = ""
|
|
Dim nPartId As Integer
|
|
EgtGetName(nSubLayerId, sSubLayerName)
|
|
|
|
If sSubLayerName.Length > 3 AndAlso sSubLayerName.Substring(0, 4) = "UID-" Then
|
|
EgtGetInfo(nSubLayerId, "!SOU", nPartId)
|
|
|
|
If nPartId <> GDB_ID.NULL Then
|
|
TempList.Add(BTLPartM.CreateBTLPart(nPartId))
|
|
End If
|
|
End If
|
|
|
|
nSubLayerId = EgtGetNext(nSubLayerId)
|
|
End While
|
|
|
|
Return TempList
|
|
End Function
|
|
|
|
Private Shared Function LoadElements(CompositesSubNodeId As Integer) As List(Of BTLElementM)
|
|
Dim TempList As New List(Of BTLElementM)
|
|
Dim nCompositesSubNodeId As Integer = CompositesSubNodeId ' EgtGetFirstGroupInGroup(CompositesSubNodeId) ' EgtGetFirstPart()
|
|
While nCompositesSubNodeId <> GDB_ID.NULL
|
|
' se devo filtrare un progetto
|
|
'If ProjId > 0 Then
|
|
' verifico se il pezzo appartiene al ProjId
|
|
Dim sCompositeType As String = ""
|
|
Dim nTest As Integer = 0
|
|
|
|
EgtGetInfo(nCompositesSubNodeId, "N", sCompositeType)
|
|
EgtGetInfo(nCompositesSubNodeId, BTL_PRT_GROUP, sCompositeType)
|
|
EgtGetInfo(nCompositesSubNodeId, BTL_PRT_NAM, sCompositeType)
|
|
|
|
EgtGetInfo(nCompositesSubNodeId, BTL_PRT_TYPE, sCompositeType)
|
|
If sCompositeType = "ELEMENT" Then
|
|
TempList.Add(BTLElementM.CreateBTLElement(nCompositesSubNodeId))
|
|
End If
|
|
'Else
|
|
' ' altrimenti carico tutti
|
|
' TempList.Add(BTLPartM.CreateBTLPart(nPartId))
|
|
'End If
|
|
nCompositesSubNodeId = EgtGetNextGroup(nCompositesSubNodeId)
|
|
End While
|
|
Return TempList
|
|
End Function
|
|
|
|
Private Shared Function LoadLayers(CompositesSubNodeId As Integer) As List(Of BTLLayerM)
|
|
Dim TempList As New List(Of BTLLayerM)
|
|
Dim nCompositesSubNodeId As Integer = CompositesSubNodeId ' EgtGetFirstGroupInGroup(CompositesSubNodeId) ' EgtGetFirstPart()
|
|
While nCompositesSubNodeId <> GDB_ID.NULL
|
|
' se devo filtrare un progetto
|
|
'If ProjId > 0 Then
|
|
' verifico se il pezzo appartiene al ProjId
|
|
Dim sCompositeType As String = ""
|
|
Dim nTest As Integer = 0
|
|
|
|
EgtGetInfo(nCompositesSubNodeId, "N", sCompositeType)
|
|
EgtGetInfo(nCompositesSubNodeId, BTL_PRT_GROUP, sCompositeType)
|
|
EgtGetInfo(nCompositesSubNodeId, BTL_PRT_NAM, sCompositeType)
|
|
|
|
EgtGetInfo(nCompositesSubNodeId, BTL_PRT_TYPE, sCompositeType)
|
|
If sCompositeType = "LAYER" Then
|
|
TempList.Add(BTLLayerM.CreateBTLLayer(nCompositesSubNodeId))
|
|
End If
|
|
'Else
|
|
' ' altrimenti carico tutti
|
|
' TempList.Add(BTLPartM.CreateBTLPart(nPartId))
|
|
'End If
|
|
nCompositesSubNodeId = EgtGetNextGroup(nCompositesSubNodeId)
|
|
End While
|
|
Return TempList
|
|
End Function
|
|
|
|
#End Region ' CONSTRUCTOR
|
|
|
|
#Region "METHODS"
|
|
|
|
Public Event BTLPartAdded As EventHandler(Of BTLPartAddedEventArgs)
|
|
|
|
Public Sub AddBTLPart(BTLPartM As BTLPartM)
|
|
If IsNothing(BTLPartM) Then Return
|
|
If Not m_BTLPartMList.Contains(BTLPartM) Then
|
|
m_BTLPartMList.Add(BTLPartM)
|
|
RaiseEvent BTLPartAdded(Me, New BTLPartAddedEventArgs(BTLPartM))
|
|
End If
|
|
End Sub
|
|
|
|
Public Sub RemoveBTLPart(BTLPartM As BTLPartM)
|
|
If IsNothing(BTLPartM) Then Return
|
|
If Not m_BTLPartMList.Contains(BTLPartM) Then Return
|
|
m_BTLPartMList.Remove(BTLPartM)
|
|
'RaiseEvent BTLPartAdded(Me, New BTLPartAddedEventArgs(BTLPartM))
|
|
End Sub
|
|
|
|
Public Function GetBTLElements() As List(Of BTLElementM)
|
|
If Not IsNothing(m_BTLElementMList) Then
|
|
Return New List(Of BTLElementM)(m_BTLElementMList)
|
|
Else
|
|
Return Nothing
|
|
End If
|
|
End Function
|
|
|
|
Public Function GetBTLLayers() As List(Of BTLLayerM)
|
|
If Not IsNothing(m_BTLLayerMList) Then
|
|
Return New List(Of BTLLayerM)(m_BTLLayerMList)
|
|
Else
|
|
Return Nothing
|
|
End If
|
|
End Function
|
|
|
|
Public Function GetBTLParts() As List(Of BTLPartM)
|
|
Return New List(Of BTLPartM)(m_BTLPartMList)
|
|
End Function
|
|
|
|
Public Function NewPDN() As Integer
|
|
Dim nMaxPDN As Integer = 0
|
|
If Not IsNothing(BTLPartMList) And BTLPartMList.Count > 0 Then
|
|
nMaxPDN = BTLPartMList.Max(Function(x) x.nPDN)
|
|
End If
|
|
Return nMaxPDN + 1
|
|
End Function
|
|
|
|
Public Sub UpdateBTLInfoLayer()
|
|
m_nBTLInfoId = EgtGetFirstNameInGroup(GDB_ID.ROOT, BTLINFO)
|
|
End Sub
|
|
|
|
#End Region ' METHODS
|
|
|
|
End Class
|
|
|
|
Public Class BTLRawPart
|
|
|
|
End Class
|
|
|