2823 lines
101 KiB
VB.net
2823 lines
101 KiB
VB.net
Imports System.Collections.ObjectModel
|
|
Imports EgtUILib
|
|
Imports EgtWPFLib5
|
|
Imports EgtBEAMWALL.Core
|
|
|
|
Public Class BTLStructure
|
|
Inherits Core.BTLStructure
|
|
|
|
Dim m_bOldEnMod As Boolean = False
|
|
Dim m_nBTLInfoId As Integer = 0
|
|
|
|
' pezzi da BTL
|
|
Private m_PartList_View As CollectionView = Nothing
|
|
|
|
Private m_SelPart As BTLPart = Nothing
|
|
Public Property SelPart As BTLPart
|
|
Get
|
|
Return m_SelPart
|
|
End Get
|
|
Set(value As BTLPart)
|
|
m_SelPart = value
|
|
' se seleziono un pezzo
|
|
If Map.refMainMenuVM.SelPage = Pages.VIEW AndAlso Not IsNothing(m_SelPart) Then
|
|
' se modalità building, la tolgo
|
|
If Map.refShowBeamPanelVM.ShowBuilding_IsChecked Then
|
|
ShowBuilding(False)
|
|
Map.refShowBeamPanelVM.SetShowBuilding(False)
|
|
End If
|
|
' deseleziono tutto
|
|
EgtDeselectAll()
|
|
' disabilito impostazione modificato
|
|
DisableModified()
|
|
' ciclo sui pezzi
|
|
For Each Part As BTLPart In m_PartList
|
|
' se non è quello selezionato, lo nasondo
|
|
If Not Part Is SelPart Then
|
|
EgtSetMode(Part.nPartId, GDB_MD.HIDDEN)
|
|
Else
|
|
EgtSetMode(Part.nPartId, GDB_MD.STD)
|
|
End If
|
|
Next
|
|
' ripristino precedente impostazione modificato
|
|
EnableModified()
|
|
' seleziono pezzo in Db geometrico
|
|
EgtBeamSetPart(m_SelPart.nPartId)
|
|
' seleziono pagina BottomPanel
|
|
Map.refBottomPanelVM.SetSelPartFeatureTab(BottomPanelVM.PartFeatureTab.PART)
|
|
' deseleziono le feature
|
|
If Not IsNothing(m_SelPart.SelFeature) Then SelPart.SelFeature = Nothing
|
|
' aggiorno stato selezionato tutto
|
|
Map.refShowBeamPanelVM.bShowAll = False
|
|
' aggiorno vista
|
|
EgtSetView(VT.ISO_SW, False)
|
|
EgtZoom(ZM.ALL)
|
|
End If
|
|
NotifyPropertyChanged("SelPart")
|
|
End Set
|
|
End Property
|
|
|
|
' lista parametri per ricerca testuale
|
|
Private m_SearchParamList As New ObservableCollection(Of IdNameStruct)({New IdNameStruct(BTLPartParam.NULL, ""),
|
|
New IdNameStruct(BTLPartParam.PDN, "PDN"),
|
|
New IdNameStruct(BTLPartParam.NAM, "Descrizione"),
|
|
New IdNameStruct(BTLPartParam.GRP, "Gruppo")})
|
|
Public ReadOnly Property SearchParamList As ObservableCollection(Of IdNameStruct)
|
|
Get
|
|
Return m_SearchParamList
|
|
End Get
|
|
End Property
|
|
|
|
Private m_SelSearchParam As IdNameStruct = m_SearchParamList(0)
|
|
Public Property SelSearchParam As IdNameStruct
|
|
Get
|
|
Return m_SelSearchParam
|
|
End Get
|
|
Set(value As IdNameStruct)
|
|
m_SelSearchParam = value
|
|
End Set
|
|
End Property
|
|
|
|
' lista dei materiali utilizzati
|
|
Private m_MaterialList_View As CollectionView = Nothing
|
|
Private m_MaterialList As New ObservableCollection(Of String)({""})
|
|
Public Property MaterialList As ObservableCollection(Of String)
|
|
Get
|
|
Return m_MaterialList
|
|
End Get
|
|
Set(value As ObservableCollection(Of String))
|
|
m_MaterialList = value
|
|
End Set
|
|
End Property
|
|
|
|
Private m_SelMaterial As String = ""
|
|
Public Property SelMaterial As String
|
|
Get
|
|
Return m_SelMaterial
|
|
End Get
|
|
Set(value As String)
|
|
m_SelMaterial = value
|
|
m_PartList_View.Refresh()
|
|
m_SectionList_View.Refresh()
|
|
End Set
|
|
End Property
|
|
|
|
' lista delle sezioni utilizzate
|
|
Private m_SectionList_View As CollectionView = Nothing
|
|
Private m_SectionList As New ObservableCollection(Of SectionXMaterial)({SectionXMaterial.Empty})
|
|
Public Property SectionList As ObservableCollection(Of SectionXMaterial)
|
|
Get
|
|
Return m_SectionList
|
|
End Get
|
|
Set(value As ObservableCollection(Of SectionXMaterial))
|
|
m_SectionList = value
|
|
End Set
|
|
End Property
|
|
|
|
Private m_SelSection As SectionXMaterial = SectionXMaterial.Empty
|
|
Public Property SelSection As SectionXMaterial
|
|
Get
|
|
Return m_SelSection
|
|
End Get
|
|
Set(value As SectionXMaterial)
|
|
m_SelSection = value
|
|
m_PartList_View.Refresh()
|
|
m_MaterialList_View.Refresh()
|
|
End Set
|
|
End Property
|
|
|
|
Private m_SearchText As String = ""
|
|
Public Property SearchText As String
|
|
Get
|
|
Return m_SearchText
|
|
End Get
|
|
Set(value As String)
|
|
m_SearchText = value
|
|
m_PartList_View.Refresh()
|
|
m_MaterialList_View.Refresh()
|
|
m_SectionList_View.Refresh()
|
|
End Set
|
|
End Property
|
|
|
|
#Region "Parametri generici"
|
|
|
|
Public Overrides Property sPROJNUM As String
|
|
Get
|
|
Return m_sPROJNUM
|
|
End Get
|
|
Set(value As String)
|
|
If EgtSetInfo(m_nBTLInfoId, BTL_GEN_PROJNUM, value) Then
|
|
m_sPROJNUM = value
|
|
Else
|
|
NotifyPropertyChanged("sPROJNUM")
|
|
End If
|
|
End Set
|
|
End Property
|
|
|
|
Public Overrides Property sPROJNAME As String
|
|
Get
|
|
Return m_sPROJNAME
|
|
End Get
|
|
Set(value As String)
|
|
If EgtSetInfo(m_nBTLInfoId, BTL_GEN_PROJNAME, value) Then
|
|
m_sPROJNAME = value
|
|
Else
|
|
NotifyPropertyChanged("sPROJNAME")
|
|
End If
|
|
End Set
|
|
End Property
|
|
|
|
Public Overrides Property sPROJPART As String
|
|
Get
|
|
Return m_sPROJPART
|
|
End Get
|
|
Set(value As String)
|
|
If EgtSetInfo(m_nBTLInfoId, BTL_GEN_PROJPART, value) Then
|
|
m_sPROJPART = value
|
|
Else
|
|
NotifyPropertyChanged("sPROJPART")
|
|
End If
|
|
End Set
|
|
End Property
|
|
|
|
Public Overrides Property sPROJGUID As String
|
|
Get
|
|
Return m_sPROJGUID
|
|
End Get
|
|
Set(value As String)
|
|
If EgtSetInfo(m_nBTLInfoId, BTL_GEN_PROJGUID, value) Then
|
|
m_sPROJGUID = value
|
|
Else
|
|
NotifyPropertyChanged("sPROJGUID")
|
|
End If
|
|
End Set
|
|
End Property
|
|
|
|
Public Overrides Property sLISTNAME As String
|
|
Get
|
|
Return m_sLISTNAME
|
|
End Get
|
|
Set(value As String)
|
|
If EgtSetInfo(m_nBTLInfoId, BTL_GEN_LISTNAME, value) Then
|
|
m_sLISTNAME = value
|
|
Else
|
|
NotifyPropertyChanged("sLISTNAME")
|
|
End If
|
|
End Set
|
|
End Property
|
|
|
|
Public Overrides Property sCUSTOMER As String
|
|
Get
|
|
Return m_sCUSTOMER
|
|
End Get
|
|
Set(value As String)
|
|
If EgtSetInfo(m_nBTLInfoId, BTL_GEN_CUSTOMER, value) Then
|
|
m_sCUSTOMER = value
|
|
Else
|
|
NotifyPropertyChanged("sCUSTOMER")
|
|
End If
|
|
End Set
|
|
End Property
|
|
|
|
Public Overrides Property sARCHITECT As String
|
|
Get
|
|
Return m_sARCHITECT
|
|
End Get
|
|
Set(value As String)
|
|
If EgtSetInfo(m_nBTLInfoId, BTL_GEN_ARCHITECT, value) Then
|
|
m_sARCHITECT = value
|
|
Else
|
|
NotifyPropertyChanged("sARCHITECT")
|
|
End If
|
|
End Set
|
|
End Property
|
|
|
|
Public Overrides Property sEDITOR As String
|
|
Get
|
|
Return m_sEDITOR
|
|
End Get
|
|
Set(value As String)
|
|
If EgtSetInfo(m_nBTLInfoId, BTL_GEN_EDITOR, value) Then
|
|
m_sEDITOR = value
|
|
Else
|
|
NotifyPropertyChanged("sEDITOR")
|
|
End If
|
|
End Set
|
|
End Property
|
|
|
|
Public Overrides Property sDELIVDATE As String
|
|
Get
|
|
Return m_sDELIVDATE
|
|
End Get
|
|
Set(value As String)
|
|
If EgtSetInfo(m_nBTLInfoId, BTL_GEN_DELIVDATE, value) Then
|
|
m_sDELIVDATE = value
|
|
Else
|
|
NotifyPropertyChanged("sDELIVDATE")
|
|
End If
|
|
End Set
|
|
End Property
|
|
|
|
Public Overrides Property sEXPDATE As String
|
|
Get
|
|
Return m_sEXPDATE
|
|
End Get
|
|
Set(value As String)
|
|
If EgtSetInfo(m_nBTLInfoId, BTL_GEN_EXPDATE, value) Then
|
|
m_sEXPDATE = value
|
|
Else
|
|
NotifyPropertyChanged("sEXPDATE")
|
|
End If
|
|
End Set
|
|
End Property
|
|
|
|
Public Overrides Property sEXPTIME As String
|
|
Get
|
|
Return m_sEXPTIME
|
|
End Get
|
|
Set(value As String)
|
|
If EgtSetInfo(m_nBTLInfoId, BTL_GEN_EXPTIME, value) Then
|
|
m_sEXPTIME = value
|
|
Else
|
|
NotifyPropertyChanged("sEXPTIME")
|
|
End If
|
|
End Set
|
|
End Property
|
|
|
|
Public Overrides Property sEXPRELEASE As String
|
|
Get
|
|
Return m_sEXPRELEASE
|
|
End Get
|
|
Set(value As String)
|
|
If EgtSetInfo(m_nBTLInfoId, BTL_GEN_EXPRELEASE, value) Then
|
|
m_sEXPRELEASE = value
|
|
Else
|
|
NotifyPropertyChanged("sEXPRELEASE")
|
|
End If
|
|
End Set
|
|
End Property
|
|
|
|
Public Overrides Property sLANGUAGE As String
|
|
Get
|
|
Return m_sLANGUAGE
|
|
End Get
|
|
Set(value As String)
|
|
If EgtSetInfo(m_nBTLInfoId, BTL_GEN_LANGUAGE, value) Then
|
|
m_sLANGUAGE = value
|
|
Else
|
|
NotifyPropertyChanged("sLANGUAGE")
|
|
End If
|
|
End Set
|
|
End Property
|
|
|
|
Public Overrides Property SelRANGE As Integer
|
|
Get
|
|
Return m_SelRANGE
|
|
End Get
|
|
Set(value As Integer)
|
|
Dim nValue As Integer = IdNameStruct.IdFromInd(value, ocRANGE)
|
|
Dim sValue As String = [Enum].GetName(GetType(Range), nValue)
|
|
If EgtSetInfo(m_nBTLInfoId, BTL_GEN_RANGE, sValue) Then
|
|
m_SelRANGE = value
|
|
Else
|
|
NotifyPropertyChanged("SelRANGE")
|
|
End If
|
|
End Set
|
|
End Property
|
|
|
|
Public Overrides Property SelPROCESSINGQUALITY As Integer
|
|
Get
|
|
Return m_SelPROCESSINGQUALITY
|
|
End Get
|
|
Set(value As Integer)
|
|
Dim nValue As Integer = IdNameStruct.IdFromInd(value, ocPROCESSINGQUALITY)
|
|
Dim sValue As String = [Enum].GetName(GetType(ProcessingQuality), nValue)
|
|
If EgtSetInfo(m_nBTLInfoId, BTL_PRT_PROCESSINGQUALITY, sValue) Then
|
|
m_SelPROCESSINGQUALITY = value
|
|
Else
|
|
NotifyPropertyChanged("SelPROCESSINGQUALITY")
|
|
End If
|
|
End Set
|
|
End Property
|
|
|
|
Public Overrides Property sCOMPUTERNAME As String
|
|
Get
|
|
Return m_sCOMPUTERNAME
|
|
End Get
|
|
Set(value As String)
|
|
If EgtSetInfo(m_nBTLInfoId, BTL_GEN_COMPUTERNAME, value) Then
|
|
m_sCOMPUTERNAME = value
|
|
Else
|
|
NotifyPropertyChanged("sCOMPUTERNAME")
|
|
End If
|
|
End Set
|
|
End Property
|
|
|
|
Public Overrides Property sUSER As String
|
|
Get
|
|
Return m_sUSER
|
|
End Get
|
|
Set(value As String)
|
|
If EgtSetInfo(m_nBTLInfoId, BTL_GEN_USER, value) Then
|
|
m_sUSER = value
|
|
Else
|
|
NotifyPropertyChanged("sUSER")
|
|
End If
|
|
End Set
|
|
End Property
|
|
|
|
Public Overrides Property sSRCFILE As String
|
|
Get
|
|
Return m_sSRCFILE
|
|
End Get
|
|
Set(value As String)
|
|
If EgtSetInfo(m_nBTLInfoId, BTL_GEN_SRCFILE, value) Then
|
|
m_sSRCFILE = value
|
|
Else
|
|
NotifyPropertyChanged("sSRCFILE")
|
|
End If
|
|
End Set
|
|
End Property
|
|
|
|
Public Overrides Property sEXPFILE As String
|
|
Get
|
|
Return m_sEXPFILE
|
|
End Get
|
|
Set(value As String)
|
|
If EgtSetInfo(m_nBTLInfoId, BTL_GEN_EXPFILE, value) Then
|
|
m_sEXPFILE = value
|
|
Else
|
|
NotifyPropertyChanged("sEXPFILE")
|
|
End If
|
|
End Set
|
|
End Property
|
|
|
|
Public Overrides Property SelRECESS As Integer
|
|
Get
|
|
Return m_SelRECESS
|
|
End Get
|
|
Set(value As Integer)
|
|
Dim nValue As Integer = IdNameStruct.IdFromInd(value, ocRECESS)
|
|
Dim sValue As String = [Enum].GetName(GetType(Recess), nValue)
|
|
If EgtSetInfo(m_nBTLInfoId, BTL_PRT_RECESS, sValue) Then
|
|
m_SelRECESS = value
|
|
Else
|
|
NotifyPropertyChanged("SelRECESS")
|
|
End If
|
|
End Set
|
|
End Property
|
|
|
|
Public Overrides Property sUSERATTRIBUTE As String
|
|
Get
|
|
Return m_sUSERATTRIBUTE
|
|
End Get
|
|
Set(value As String)
|
|
If EgtSetInfo(m_nBTLInfoId, BTL_GEN_USERATTRIBUTE, value) Then
|
|
m_sUSERATTRIBUTE = value
|
|
Else
|
|
NotifyPropertyChanged("sUSERATTRIBUTE")
|
|
End If
|
|
End Set
|
|
End Property
|
|
|
|
#End Region ' Parametri generici
|
|
|
|
#Region "CONSTRUCTOR"
|
|
|
|
Sub New()
|
|
m_PartList_View = CollectionViewSource.GetDefaultView(m_PartList)
|
|
m_MaterialList_View = CollectionViewSource.GetDefaultView(m_MaterialList)
|
|
m_SectionList_View = CollectionViewSource.GetDefaultView(m_SectionList)
|
|
m_PartList_View.Filter = AddressOf PartFilter
|
|
m_MaterialList_View.Filter = AddressOf MaterialFilter
|
|
m_SectionList_View.Filter = AddressOf SectionFilter
|
|
End Sub
|
|
|
|
#End Region ' CONSTRUCTOR
|
|
|
|
#Region "METHODS"
|
|
|
|
Public Shared Function Init() As BTLStructure
|
|
Dim NewBTLStructure As New BTLStructure
|
|
Dim sValue As String = String.Empty
|
|
NewBTLStructure.m_nBTLInfoId = EgtGetFirstNameInGroup(GDB_ID.ROOT, BTLINFO)
|
|
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_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)
|
|
' recupero i part
|
|
Dim nPartId As Integer = EgtGetFirstPart()
|
|
While nPartId <> GDB_ID.NULL
|
|
NewBTLStructure.m_PartList.Add(New BTLPart(NewBTLStructure, nPartId))
|
|
nPartId = EgtGetNextPart(nPartId)
|
|
End While
|
|
Return NewBTLStructure
|
|
End Function
|
|
|
|
Private Sub DisableModified()
|
|
m_bOldEnMod = EgtGetEnableModified()
|
|
If m_bOldEnMod Then EgtDisableModified()
|
|
End Sub
|
|
|
|
Private Sub EnableModified()
|
|
If m_bOldEnMod Then EgtEnableModified()
|
|
End Sub
|
|
|
|
Friend Sub ShowAll(Optional bRedraw As Boolean = True)
|
|
' disabilito impostazione modificato
|
|
DisableModified()
|
|
If Not IsNothing(SelPart) Then
|
|
' se pezzo solido, lo riporto normale
|
|
If Map.refShowBeamPanelVM.ShowSolid_IsChecked Then
|
|
ShowSolid(False)
|
|
Map.refShowBeamPanelVM.SetShowSolid(False)
|
|
End If
|
|
' tolgo pezzo selezionato
|
|
SelPart.SelFeature = Nothing
|
|
End If
|
|
SelPart = Nothing
|
|
' mostro tutti i pezzi
|
|
For Each Part As BTLPart In m_PartList
|
|
Dim nMode As Integer
|
|
EgtGetMode(Part.nPartId, nMode)
|
|
If nMode <> GDB_MD.STD Then
|
|
EgtSetMode(Part.nPartId, GDB_MD.STD)
|
|
End If
|
|
Next
|
|
' ripristino precedente impostazione modificato
|
|
EnableModified()
|
|
EgtSetView(VT.ISO_SW, False)
|
|
EgtZoom(ZM.ALL, bRedraw)
|
|
' imposto stato per ShowBeamPanel
|
|
Map.refShowBeamPanelVM.bShowAll = True
|
|
End Sub
|
|
|
|
Friend Sub ShowBuilding(Optional bRedraw As Boolean = True)
|
|
' disabilito impostazione modificato
|
|
DisableModified()
|
|
' tolgo pezzo selezionato
|
|
If Not IsNothing(SelPart) Then SelPart.SelFeature = Nothing
|
|
SelPart = Nothing
|
|
' recupero il gruppo di assemblaggio
|
|
Dim AsseBaseId As Integer = EgtGetFirstNameInGroup(GDB_ID.ROOT, "AsseBase")
|
|
If IsNothing(AsseBaseId) Then Return
|
|
|
|
' recupero il primo oggetto nel gruppo e verifico se devo assemblare o disassemblare
|
|
Dim AsseId As Integer = EgtGetFirstInGroup(AsseBaseId)
|
|
If IsNothing(AsseId) Then Return
|
|
Dim bMake As Boolean = (EgtGetGroupObjs(AsseId) = 0)
|
|
|
|
' ciclo sul gruppo di assemblaggio
|
|
While AsseId <> GDB_ID.NULL
|
|
' salvo il successivo nel gruppo dell'assemblato
|
|
Dim NextId As Integer = EgtGetNext(AsseId)
|
|
' costruisco l'assemblato
|
|
If bMake Then
|
|
' recupero il pezzo sorgente
|
|
Dim SouId As Integer
|
|
If EgtGetInfo(AsseId, GDB_SI_SOURCE, SouId) Then
|
|
EgtSetMode(SouId, GDB_MD.STD)
|
|
EgtSetStatus(SouId, GDB_ST.ON_)
|
|
' se già utilizzato, ne faccio una copia
|
|
If Not EgtIsPart(SouId) Then
|
|
Dim CopyId As Integer = EgtCopy(SouId, GDB_ID.ROOT)
|
|
If CopyId <> GDB_ID.NULL Then
|
|
EgtRemoveInfo(CopyId, GDB_SI_BASE)
|
|
EgtRemoveInfo(CopyId, GDB_SI_LIST)
|
|
EgtSetInfo(CopyId, GDB_SI_COPY, SouId)
|
|
SouId = CopyId
|
|
EgtSetInfo(AsseId, GDB_SI_SOURCE, SouId)
|
|
End If
|
|
End If
|
|
EgtSetStatus(EgtGetFirstNameInGroup(SouId, "Box"), GDB_ST.OFF)
|
|
EgtGroupSwap(SouId, AsseId, True, True)
|
|
End If
|
|
' ritorno ai pezzi
|
|
Else
|
|
Dim BasId As Integer
|
|
If EgtGetInfo(AsseId, GDB_SI_BASE, BasId) Then
|
|
EgtGroupSwap(AsseId, BasId, True, True)
|
|
Dim CopId As Integer
|
|
If EgtGetInfo(AsseId, GDB_SI_COPY, CopId) Then
|
|
EgtErase(AsseId)
|
|
EgtSetInfo(BasId, GDB_SI_SOURCE, CopId)
|
|
Else
|
|
EgtSetStatus(EgtGetFirstNameInGroup(AsseId, "Box"), GDB_ST.ON_)
|
|
End If
|
|
End If
|
|
End If
|
|
' passo al successivo
|
|
AsseId = NextId
|
|
End While
|
|
' ripristino precedente impostazione modificato
|
|
EnableModified()
|
|
EgtSetView(VT.ISO_SW, False)
|
|
EgtZoom(ZM.ALL, bRedraw)
|
|
End Sub
|
|
|
|
Friend Sub ShowSolid(Optional bRedraw As Boolean = True)
|
|
' disabilito impostazione modificato
|
|
DisableModified()
|
|
' Recupero il pezzo del primo oggetto selezionato
|
|
Dim nPartId As Integer = If(Not IsNothing(SelPart), SelPart.nPartId, GDB_ID.NULL)
|
|
If nPartId = GDB_ID.NULL Or Not EgtIsPart(nPartId) Then
|
|
Map.refMyStatusBarVM.SetOutputMessage("ERROR: Nessuna trave selezionata ", 5, MSG_TYPE.ERROR_)
|
|
Return
|
|
End If
|
|
EgtDeselectAll()
|
|
|
|
Dim nSolId As Integer = EgtBeamGetSolid(nPartId)
|
|
If nSolId = GDB_ID.NULL OrElse Not EgtExistsInfo(nSolId, "VALID") Then
|
|
EgtBeamCalcSolid(nPartId)
|
|
EgtBeamShowSolid(nPartId, True)
|
|
Else
|
|
Dim nStat As Integer
|
|
EgtGetStatus(EgtGetParent(nSolId), nStat)
|
|
EgtBeamShowSolid(nPartId, (nStat = GDB_ST.OFF))
|
|
End If
|
|
|
|
If bRedraw Then EgtDraw()
|
|
' ripristino precedente impostazione modificato
|
|
EnableModified()
|
|
End Sub
|
|
|
|
' Funzione per regolarizzare, se necessario, la superficie della feature
|
|
Private Function RegularizeTriMesh(SurfId As Integer, DestGrpId As Integer, dStep As Double) As Integer
|
|
' solo per superfici trimesh con poche facce (max4)
|
|
Dim nFacetCnt As Integer = EgtSurfTmFacetCount(SurfId)
|
|
If nFacetCnt > 4 Then
|
|
Return SurfId
|
|
End If
|
|
' box della superficie
|
|
Dim b3Surf As New BBox3d
|
|
EgtGetBBox(SurfId, GDB_BB.STANDARD, b3Surf)
|
|
If b3Surf.IsEmpty() Or b3Surf.DimX() < 2 * dStep Then
|
|
Return SurfId
|
|
End If
|
|
' recupero le facce e le divido in X
|
|
Dim dXmin As Double = b3Surf.Min().x - 1
|
|
Dim dXmax As Double = b3Surf.Max().x + 1
|
|
Dim nStep As Integer = CInt(Math.Floor((dXmax - dXmin) / dStep + 0.9))
|
|
dStep = (dXmax - dXmin) / nStep
|
|
Dim NewSurfId As Integer = GDB_ID.NULL
|
|
For nF = 0 To nFacetCnt - 1
|
|
Dim FacId As Integer = EgtCopySurfTmFacet(SurfId, nF, DestGrpId)
|
|
Dim b3Fac As New BBox3d
|
|
EgtGetBBox(FacId, GDB_BB.STANDARD, b3Fac)
|
|
Dim dX2 As Double = dXmin
|
|
For nI = 1 To nStep
|
|
Dim dX1 As Double = dX2
|
|
dX2 = dX2 + dStep
|
|
If b3Fac.Min().x < dX2 And b3Fac.Max().x > dX1 Then
|
|
EgtCutSurfTmPlane(FacId, New Point3d(dX1, 0, 0), -Vector3d.X_AX, True)
|
|
EgtCutSurfTmPlane(FacId, New Point3d(dX2, 0, 0), Vector3d.X_AX, False)
|
|
Dim nCount As Integer = 0
|
|
Dim LoopId As Integer = EgtExtractSurfTmFacetLoops(FacId, 0, DestGrpId, nCount)
|
|
EgtMergeCurvesInCurveCompo(LoopId, 0.001)
|
|
Dim TmpSurfId As Integer = EgtCreateSurfTmByFlatContour(DestGrpId, LoopId, 0.01)
|
|
EgtErase(LoopId)
|
|
If NewSurfId <> GDB_ID.NULL Then
|
|
NewSurfId = EgtCreateSurfTmBySewing(DestGrpId, 2, {NewSurfId, TmpSurfId}, True)
|
|
Else
|
|
NewSurfId = TmpSurfId
|
|
End If
|
|
EgtErase(FacId)
|
|
FacId = EgtCopySurfTmFacet(SurfId, nF, DestGrpId)
|
|
End If
|
|
Next
|
|
EgtErase(FacId)
|
|
Next
|
|
Return NewSurfId
|
|
End Function
|
|
|
|
Private Function PartFilter(Part As Object) As Boolean
|
|
Dim CurrBTLPart As BTLPart = DirectCast(Part, BTLPart)
|
|
Dim bMaterialOk As Boolean = True
|
|
Dim bSectionOk As Boolean = True
|
|
Dim bSearchTextOk As Boolean = True
|
|
If SelMaterial <> "" AndAlso CurrBTLPart.sMATERIAL <> SelMaterial Then bMaterialOk = False
|
|
If SelSection <> SectionXMaterial.Empty AndAlso CurrBTLPart.Section <> SelSection Then bSectionOk = False
|
|
'If SearchText <> "" AndAlso CurrBTLPart.sNAM.IndexOf(SearchText, StringComparison.InvariantCultureIgnoreCase) < 0 Then bSectionOk = False
|
|
If m_SelSearchParam.Id <> BTLPartParam.NULL AndAlso m_SearchText <> String.Empty AndAlso (
|
|
(m_SelSearchParam.Id = BTLPartParam.PDN AndAlso CurrBTLPart.nPDN.ToString.IndexOf(SearchText, StringComparison.InvariantCultureIgnoreCase) < 0) OrElse
|
|
(m_SelSearchParam.Id = BTLPartParam.NAM AndAlso CurrBTLPart.sNAM.IndexOf(SearchText, StringComparison.InvariantCultureIgnoreCase) < 0) OrElse
|
|
(m_SelSearchParam.Id = BTLPartParam.GRP AndAlso (IsNothing(CurrBTLPart.sGRP) OrElse CurrBTLPart.sGRP.ToString.IndexOf(SearchText, StringComparison.InvariantCultureIgnoreCase)) < 0)) Then bSectionOk = False
|
|
Return (bMaterialOk AndAlso bSectionOk)
|
|
End Function
|
|
|
|
Private Function MaterialFilter(Material As Object) As Boolean
|
|
Dim CurrMaterial As String = DirectCast(Material, String)
|
|
Dim bOk As Boolean = True
|
|
If SelSection <> SectionXMaterial.Empty AndAlso SearchText <> "" AndAlso CurrMaterial <> "" Then
|
|
bOk = m_PartList.Any(Function(x) x.sMATERIAL = CurrMaterial AndAlso x.Section = SelSection AndAlso Not x.sNAM.IndexOf(SearchText, StringComparison.InvariantCultureIgnoreCase) >= 0)
|
|
End If
|
|
Return bOk
|
|
End Function
|
|
|
|
Private Function SectionFilter(Section As Object) As Boolean
|
|
Dim CurrSection As SectionXMaterial = DirectCast(Section, SectionXMaterial)
|
|
Dim bOk As Boolean = True
|
|
If SelMaterial <> "" AndAlso SearchText <> "" AndAlso CurrSection <> Section.Empty Then
|
|
bOk = m_PartList.Any(Function(x) x.sMATERIAL = SelMaterial AndAlso x.Section = CurrSection AndAlso Not x.sNAM.IndexOf(SearchText, StringComparison.InvariantCultureIgnoreCase) >= 0)
|
|
End If
|
|
Return bOk
|
|
End Function
|
|
|
|
Friend Sub UpdateSectionFromRotation(Part As BTLPart)
|
|
If IsNothing(PartList) Then Return
|
|
If Map.refMachinePanelVM.SelectedMachine.nType = MachineType.BEAM Then
|
|
' verifico se era unico con vecchia sezione
|
|
If Not PartList.Any(Function(x) x.dH = Part.dW AndAlso x.dW = Part.dH AndAlso x.sMATERIAL = Part.sMATERIAL) Then
|
|
' nel caso lo cerco ed elimino
|
|
For nIndex = 0 To m_SectionList.Count - 1
|
|
Dim CurrSection As SectionXMaterial = m_SectionList(nIndex)
|
|
If CurrSection.dH = Part.dW AndAlso CurrSection.dW = Part.dH AndAlso If(CurrSection.sMaterial.Count > 0, CurrSection.sMaterial(0), String.Empty) = Part.sMATERIAL Then
|
|
m_SectionList.RemoveAt(nIndex)
|
|
Exit For
|
|
End If
|
|
Next
|
|
End If
|
|
' verifico se esiste già nuova sezione
|
|
If Not m_SectionList.Any(Function(x) x.dH = Part.dH AndAlso x.dW = Part.dW AndAlso If(x.sMaterial.Count > 0, x.sMaterial(0), String.Empty) = Part.sMATERIAL) Then
|
|
m_SectionList.Add(Part.Section)
|
|
End If
|
|
ElseIf Map.refMachinePanelVM.SelectedMachine.nType = MachineType.WALL Then
|
|
' se ruoto o inverto parete, la sezione non cambia
|
|
End If
|
|
End Sub
|
|
|
|
Public Shared Shadows Function Empty()
|
|
Return New BTLStructure
|
|
End Function
|
|
|
|
#End Region ' METHODS
|
|
|
|
End Class
|
|
|
|
Public Class BTLPart
|
|
' Inherits VMBase
|
|
Inherits Core.BTLPart
|
|
|
|
#Region "FIELDS & PROPERTIES"
|
|
|
|
Public Property sL As String
|
|
Get
|
|
Return LenToString(m_dL, 3)
|
|
End Get
|
|
Set(value As String)
|
|
Dim dTempL As Double
|
|
If StringToLen(value, dTempL) Then
|
|
' verifico se ci sono già copie in grezzi
|
|
Dim nDuploCount As Integer = 0
|
|
If EgtDuploCount(m_nPartId, nDuploCount) AndAlso nDuploCount > 0 Then
|
|
' se modalità travi e trave
|
|
If Map.refMachinePanelVM.SelectedMachine.nType = MachineType.BEAM OrElse
|
|
Map.refMachinePanelVM.SelectedMachine.nType = MachineType.WALL Then
|
|
If dTempL > m_dL Then
|
|
' avviso che tutti i pezzi verranno tolti dai grezzi e chiedo di confermare
|
|
If MessageBox.Show("La modifica di questo parametro comporta la rimozione del pezzo da " & nDuploCount & " grezzi. Procedere comunque?", "Info", MessageBoxButton.YesNo, MessageBoxImage.Information) = MessageBoxResult.Yes Then
|
|
MyMachGroupPanelVM.DuploSetToDelete(m_nPartId)
|
|
Else
|
|
' reimposto vecchio valore
|
|
NotifyPropertyChanged("sL")
|
|
Return
|
|
End If
|
|
End If
|
|
End If
|
|
End If
|
|
If EgtBeamSetPartBox(dTempL, dH, dW) Then
|
|
' imposto modificato per copie
|
|
EgtDuploSetModified(nPartId)
|
|
EgtDraw()
|
|
m_dL = dTempL
|
|
End If
|
|
Else
|
|
NotifyPropertyChanged("sL")
|
|
End If
|
|
End Set
|
|
End Property
|
|
|
|
Public Property sW As String
|
|
Get
|
|
Return LenToString(m_dW, 3)
|
|
End Get
|
|
Set(value As String)
|
|
Dim dTempW As Double
|
|
If StringToLen(value, dTempW) AndAlso EgtBeamSetPartBox(dL, dH, dTempW) Then
|
|
EgtDraw()
|
|
m_dW = dTempW
|
|
Else
|
|
NotifyPropertyChanged("sW")
|
|
End If
|
|
End Set
|
|
End Property
|
|
|
|
Public Property sH As String
|
|
Get
|
|
Return LenToString(m_dH, 3)
|
|
End Get
|
|
Set(value As String)
|
|
Dim dTempH As Double
|
|
If StringToLen(value, dTempH) AndAlso EgtBeamSetPartBox(dL, dTempH, dW) Then
|
|
EgtDraw()
|
|
m_dH = dTempH
|
|
Else
|
|
NotifyPropertyChanged("sH")
|
|
End If
|
|
End Set
|
|
End Property
|
|
|
|
Public Overrides Property bDO As Boolean
|
|
Get
|
|
Return m_bDO
|
|
End Get
|
|
Set(value As Boolean)
|
|
m_bDO = value
|
|
EgtSetInfo(nPartId, BTL_PRT_DO, If(value, 1, 0))
|
|
NotifyPropertyChanged("Calc_BorderBrush")
|
|
End Set
|
|
End Property
|
|
|
|
Public Overrides Property sNAM As String
|
|
Get
|
|
Return m_sNAM
|
|
End Get
|
|
Set(value As String)
|
|
If EgtSetInfo(m_nPartId, BTL_PRT_NAM, value) Then
|
|
m_sNAM = value
|
|
Else
|
|
NotifyPropertyChanged("sNAM")
|
|
End If
|
|
End Set
|
|
End Property
|
|
|
|
#Region "Parametri pezzo"
|
|
|
|
Protected m_nSINGLEMEMBERNUM As Integer
|
|
Public Property nSINGLEMEMBERNUM As Integer
|
|
Get
|
|
Return m_nSINGLEMEMBERNUM
|
|
End Get
|
|
Set(value As Integer)
|
|
If EgtSetInfo(m_nPartId, BTL_PRT_SINGLEMEMBERNUM, value) Then
|
|
m_nSINGLEMEMBERNUM = value
|
|
Else
|
|
NotifyPropertyChanged("nSINGLEMEMBERNUM")
|
|
End If
|
|
End Set
|
|
End Property
|
|
|
|
Protected m_sASSEMBLYNUM As String
|
|
Public Property sASSEMBLYNUM As String
|
|
Get
|
|
Return m_sASSEMBLYNUM
|
|
End Get
|
|
Set(value As String)
|
|
If EgtSetInfo(m_nPartId, BTL_PRT_ASSEMBLYNUM, value) Then
|
|
m_sASSEMBLYNUM = value
|
|
Else
|
|
NotifyPropertyChanged("sASSEMBLYNUM")
|
|
End If
|
|
End Set
|
|
End Property
|
|
|
|
Protected m_nORDERNUM As Integer
|
|
Public Property nORDERNUM As Integer
|
|
Get
|
|
Return m_nORDERNUM
|
|
End Get
|
|
Set(value As Integer)
|
|
If EgtSetInfo(m_nPartId, BTL_PRT_ORDERNUM, value) Then
|
|
m_nORDERNUM = value
|
|
Else
|
|
NotifyPropertyChanged("nORDERNUM")
|
|
End If
|
|
End Set
|
|
End Property
|
|
|
|
Protected m_sDESIGN As String
|
|
Public Property sDESIGN As String
|
|
Get
|
|
Return m_sDESIGN
|
|
End Get
|
|
Set(value As String)
|
|
If EgtSetInfo(m_nPartId, BTL_PRT_DESIGNATION, value) Then
|
|
m_sDESIGN = value
|
|
Else
|
|
NotifyPropertyChanged("sDESIGN")
|
|
End If
|
|
End Set
|
|
End Property
|
|
|
|
Protected m_sANNOT As String
|
|
Public Property sANNOT As String
|
|
Get
|
|
Return m_sANNOT
|
|
End Get
|
|
Set(value As String)
|
|
If EgtSetInfo(m_nPartId, BTL_PRT_ANNOTATION, value) Then
|
|
m_sANNOT = value
|
|
Else
|
|
NotifyPropertyChanged("sANNOT")
|
|
End If
|
|
End Set
|
|
End Property
|
|
|
|
Protected m_sSTOREY As String
|
|
Public Property sSTOREY As String
|
|
Get
|
|
Return m_sSTOREY
|
|
End Get
|
|
Set(value As String)
|
|
If EgtSetInfo(m_nPartId, BTL_PRT_STOREY, value) Then
|
|
m_sSTOREY = value
|
|
Else
|
|
NotifyPropertyChanged("sSTOREY")
|
|
End If
|
|
End Set
|
|
End Property
|
|
|
|
Protected m_sGROUP As String
|
|
Public Property sGROUP As String
|
|
Get
|
|
Return m_sGROUP
|
|
End Get
|
|
Set(value As String)
|
|
If EgtSetInfo(m_nPartId, BTL_PRT_GROUP, value) Then
|
|
m_sGROUP = value
|
|
Else
|
|
NotifyPropertyChanged("sGROUP")
|
|
End If
|
|
End Set
|
|
End Property
|
|
|
|
Protected m_sPACKAGE As String
|
|
Public Property sPACKAGE As String
|
|
Get
|
|
Return m_sPACKAGE
|
|
End Get
|
|
Set(value As String)
|
|
If EgtSetInfo(m_nPartId, BTL_PRT_PACKAGE, value) Then
|
|
m_sPACKAGE = value
|
|
Else
|
|
NotifyPropertyChanged("sPACKAGE")
|
|
End If
|
|
End Set
|
|
End Property
|
|
|
|
Public Overrides Property sMATERIAL As String
|
|
Get
|
|
Return m_sMATERIAL
|
|
End Get
|
|
Set(value As String)
|
|
If EgtSetInfo(m_nPartId, BTL_PRT_MATERIAL, value) Then
|
|
m_sMATERIAL = value
|
|
Else
|
|
NotifyPropertyChanged("sMATERIAL")
|
|
End If
|
|
End Set
|
|
End Property
|
|
|
|
Protected m_sTIMBERGRADE As String
|
|
Public Property sTIMBERGRADE As String
|
|
Get
|
|
Return m_sTIMBERGRADE
|
|
End Get
|
|
Set(value As String)
|
|
If EgtSetInfo(m_nPartId, BTL_PRT_TIMBERGRADE, value) Then
|
|
m_sTIMBERGRADE = value
|
|
Else
|
|
NotifyPropertyChanged("sTIMBERGRADE")
|
|
End If
|
|
End Set
|
|
End Property
|
|
|
|
Protected m_sQUALITYGRADE As String
|
|
Public Property sQUALITYGRADE As String
|
|
Get
|
|
Return m_sQUALITYGRADE
|
|
End Get
|
|
Set(value As String)
|
|
If EgtSetInfo(m_nPartId, BTL_PRT_QUALITYGRADE, value) Then
|
|
m_sQUALITYGRADE = value
|
|
Else
|
|
NotifyPropertyChanged("sQUALITYGRADE")
|
|
End If
|
|
End Set
|
|
End Property
|
|
|
|
Public ReadOnly Property PartColour As Brush
|
|
Get
|
|
Return New SolidColorBrush(Color.FromArgb(m_colCOLOR.ToColor().A,
|
|
CByte(m_colCOLOR.R),
|
|
CByte(m_colCOLOR.G),
|
|
CByte(m_colCOLOR.B)))
|
|
End Get
|
|
End Property
|
|
|
|
Protected m_colCOLOR As Color3d
|
|
Public Property sCOLRGB As String
|
|
Get
|
|
Return m_colCOLOR.R & "," &
|
|
m_colCOLOR.G & "," &
|
|
m_colCOLOR.B & "," &
|
|
nCOLA
|
|
End Get
|
|
Set(value As String)
|
|
Dim sValArray() As String = value.Split(",")
|
|
If sValArray.Count() >= 4 Then
|
|
m_colCOLOR.R = Color3d.Clamp(sValArray(0), 0, 255)
|
|
m_colCOLOR.G = Color3d.Clamp(sValArray(1), 0, 255)
|
|
m_colCOLOR.B = Color3d.Clamp(sValArray(2), 0, 255)
|
|
m_colCOLOR.A = Color3d.Clamp(nCOLA, 0, 100)
|
|
EgtSetInfo(m_nPartId, BTL_PRT_COLOUR, m_colCOLOR.ToString())
|
|
Else
|
|
NotifyPropertyChanged("sCOLRGB")
|
|
End If
|
|
End Set
|
|
End Property
|
|
|
|
Public Property nCOLA As Integer
|
|
Get
|
|
Return m_colCOLOR.A
|
|
End Get
|
|
Set(value As Integer)
|
|
If m_colCOLOR.A <> value Then
|
|
m_colCOLOR.A = Color3d.Clamp(value, 0, 100)
|
|
EgtSetInfo(m_nPartId, BTL_PRT_COLOUR, m_colCOLOR.ToString())
|
|
NotifyPropertyChanged("nCOLA")
|
|
NotifyPropertyChanged("PartColour")
|
|
End If
|
|
End Set
|
|
End Property
|
|
|
|
Protected m_dPLANINGLEN As Double
|
|
Public Property dPLANINGLEN As String
|
|
Get
|
|
Return LenToString(m_dPLANINGLEN, 3)
|
|
End Get
|
|
Set(value As String)
|
|
Dim dTempPlaningLen As Double
|
|
If StringToLen(value, dTempPlaningLen) AndAlso EgtSetInfo(m_nPartId, BTL_PRT_PLANINGLENGTH, dTempPlaningLen) Then
|
|
m_dPLANINGLEN = dTempPlaningLen
|
|
Else
|
|
NotifyPropertyChanged("dPLANINGLEN")
|
|
End If
|
|
End Set
|
|
End Property
|
|
|
|
Protected m_dSTARTOFFSET As Double
|
|
Public Property dSTARTOFFSET As String
|
|
Get
|
|
Return LenToString(m_dSTARTOFFSET, 3)
|
|
End Get
|
|
Set(value As String)
|
|
Dim dTempStartOffset As Double
|
|
If StringToLen(value, dTempStartOffset) AndAlso EgtSetInfo(m_nPartId, BTL_PRT_STARTOFFSET, dTempStartOffset) Then
|
|
m_dSTARTOFFSET = dTempStartOffset
|
|
Else
|
|
NotifyPropertyChanged("dSTARTOFFSET")
|
|
End If
|
|
End Set
|
|
End Property
|
|
|
|
Protected m_dENDOFFSET As Double
|
|
Public Property dENDOFFSET As String
|
|
Get
|
|
Return LenToString(m_dENDOFFSET, 3)
|
|
End Get
|
|
Set(value As String)
|
|
Dim dTempEndOffset As Double
|
|
If StringToLen(value, dTempEndOffset) AndAlso EgtSetInfo(m_nPartId, BTL_PRT_ENDOFFSET, dTempEndOffset) Then
|
|
m_dENDOFFSET = dTempEndOffset
|
|
Else
|
|
NotifyPropertyChanged("dENDOFFSET")
|
|
End If
|
|
End Set
|
|
End Property
|
|
|
|
Protected m_ocUID As New ObservableCollection(Of Integer)
|
|
Public ReadOnly Property ocUID As ObservableCollection(Of Integer)
|
|
Get
|
|
Return m_ocUID
|
|
End Get
|
|
End Property
|
|
|
|
Protected m_SelUID As Integer
|
|
Public Property SelUID As Integer
|
|
Get
|
|
Return m_SelUID
|
|
End Get
|
|
Set(value As Integer)
|
|
If m_SelUID <> value Then
|
|
m_refTransf = refTransfList(value)
|
|
m_SelUID = value
|
|
NotifyPropertyChanged("TransfOrig")
|
|
NotifyPropertyChanged("TransfVersX")
|
|
NotifyPropertyChanged("TransfVersY")
|
|
Else
|
|
NotifyPropertyChanged("SelUID")
|
|
End If
|
|
End Set
|
|
End Property
|
|
|
|
Protected refTransfList As New List(Of Frame3d)
|
|
Protected m_refTransf As Frame3d
|
|
Public Property TransfOrig As String
|
|
Get
|
|
If SelUID >= 0 AndAlso
|
|
SelUID < refTransfList.Count AndAlso
|
|
Not IsNothing(refTransfList(SelUID)) Then
|
|
Return LenToString(refTransfList(SelUID).Orig().x, 3) & "," &
|
|
LenToString(refTransfList(SelUID).Orig().y, 3) & "," &
|
|
LenToString(refTransfList(SelUID).Orig().z, 3)
|
|
Else
|
|
Return Nothing
|
|
End If
|
|
End Get
|
|
Set(value As String)
|
|
Dim sValArray() As String = value.Split(",")
|
|
Dim ptOri As New Point3d
|
|
If sValArray.Count() >= 3 AndAlso
|
|
StringToLen(sValArray(0), ptOri.x) AndAlso
|
|
StringToLen(sValArray(1), ptOri.y) AndAlso
|
|
StringToLen(sValArray(2), ptOri.z) AndAlso
|
|
m_refTransf.ChangeOrigin(ptOri) Then
|
|
EgtSetInfo(m_nPartId, BTL_PRT_TRANSFORMATION & (SelUID + 1), LenToString(m_refTransf.Orig.x, 3) & "," &
|
|
LenToString(m_refTransf.Orig.y, 3) & "," &
|
|
LenToString(m_refTransf.Orig.z, 3) & "," &
|
|
DoubleToString(m_refTransf.VersX.x, 6) & "," &
|
|
DoubleToString(m_refTransf.VersX.y, 6) & "," &
|
|
DoubleToString(m_refTransf.VersX.z, 6) & "," &
|
|
DoubleToString(m_refTransf.VersY.x, 6) & "," &
|
|
DoubleToString(m_refTransf.VersY.y, 6) & "," &
|
|
DoubleToString(m_refTransf.VersY.z, 6))
|
|
Else
|
|
NotifyPropertyChanged("TransfOrig")
|
|
End If
|
|
End Set
|
|
End Property
|
|
Public Property TransfVersX As String
|
|
Get
|
|
If SelUID >= 0 AndAlso
|
|
SelUID < refTransfList.Count AndAlso
|
|
Not IsNothing(refTransfList(SelUID)) Then
|
|
Return DoubleToString(refTransfList(SelUID).VersX().x, 6) & "," &
|
|
DoubleToString(refTransfList(SelUID).VersX().y, 6) & "," &
|
|
DoubleToString(refTransfList(SelUID).VersX().z, 6)
|
|
Else
|
|
Return Nothing
|
|
End If
|
|
End Get
|
|
Set(value As String)
|
|
Dim ptOri As New Point3d(m_refTransf.Orig())
|
|
Dim vtVersY As New Vector3d(m_refTransf.VersY())
|
|
Dim sValArray() As String = value.Split(",")
|
|
Dim vtVersX As New Vector3d
|
|
If sValArray.Count() >= 3 AndAlso
|
|
StringToDouble(sValArray(0), vtVersX.x) AndAlso
|
|
StringToDouble(sValArray(1), vtVersX.y) AndAlso
|
|
StringToDouble(sValArray(2), vtVersX.z) AndAlso
|
|
m_refTransf.Setup(ptOri, ptOri + vtVersX, ptOri + vtVersY) Then
|
|
EgtSetInfo(m_nPartId, BTL_PRT_TRANSFORMATION & (SelUID + 1), LenToString(m_refTransf.Orig.x, 3) & "," &
|
|
LenToString(m_refTransf.Orig.y, 3) & "," &
|
|
LenToString(m_refTransf.Orig.z, 3) & "," &
|
|
DoubleToString(m_refTransf.VersX.x, 6) & "," &
|
|
DoubleToString(m_refTransf.VersX.y, 6) & "," &
|
|
DoubleToString(m_refTransf.VersX.z, 6) & "," &
|
|
DoubleToString(m_refTransf.VersY.x, 6) & "," &
|
|
DoubleToString(m_refTransf.VersY.y, 6) & "," &
|
|
DoubleToString(m_refTransf.VersY.z, 6))
|
|
NotifyPropertyChanged("TransfVersX")
|
|
NotifyPropertyChanged("TransfVersY")
|
|
Else
|
|
NotifyPropertyChanged("TransfVersX")
|
|
End If
|
|
End Set
|
|
End Property
|
|
Public Property TransfVersY As String
|
|
Get
|
|
If SelUID >= 0 AndAlso
|
|
SelUID < refTransfList.Count AndAlso
|
|
Not IsNothing(refTransfList(SelUID)) Then
|
|
Return DoubleToString(refTransfList(SelUID).VersY().x, 6) & "," &
|
|
DoubleToString(refTransfList(SelUID).VersY().y, 6) & "," &
|
|
DoubleToString(refTransfList(SelUID).VersY().z, 6)
|
|
Else
|
|
Return Nothing
|
|
End If
|
|
End Get
|
|
Set(value As String)
|
|
Dim ptOri As New Point3d(m_refTransf.Orig())
|
|
Dim vtVersX As New Vector3d(m_refTransf.VersX())
|
|
Dim sValArray() As String = value.Split(",")
|
|
Dim vtVersY As New Vector3d
|
|
If sValArray.Count() >= 3 AndAlso
|
|
StringToDouble(sValArray(0), vtVersY.x) AndAlso
|
|
StringToDouble(sValArray(1), vtVersY.y) AndAlso
|
|
StringToDouble(sValArray(2), vtVersY.z) AndAlso
|
|
m_refTransf.Setup(ptOri, ptOri + vtVersX, ptOri + vtVersY) Then
|
|
EgtSetInfo(m_nPartId, BTL_PRT_TRANSFORMATION & (SelUID + 1), LenToString(m_refTransf.Orig.x, 3) & "," &
|
|
LenToString(m_refTransf.Orig.y, 3) & "," &
|
|
LenToString(m_refTransf.Orig.z, 3) & "," &
|
|
DoubleToString(m_refTransf.VersX.x, 6) & "," &
|
|
DoubleToString(m_refTransf.VersX.y, 6) & "," &
|
|
DoubleToString(m_refTransf.VersX.z, 6) & "," &
|
|
DoubleToString(m_refTransf.VersY.x, 6) & "," &
|
|
DoubleToString(m_refTransf.VersY.y, 6) & "," &
|
|
DoubleToString(m_refTransf.VersY.z, 6))
|
|
NotifyPropertyChanged("TransfVersX")
|
|
NotifyPropertyChanged("TransfVersY")
|
|
Else
|
|
NotifyPropertyChanged("TransfVersY")
|
|
End If
|
|
End Set
|
|
End Property
|
|
|
|
Protected m_ocCAMBERSIDE As New ObservableCollection(Of Integer)({1, 2, 3, 4})
|
|
Public ReadOnly Property ocCAMBERSIDE As ObservableCollection(Of Integer)
|
|
Get
|
|
Return m_ocCAMBERSIDE
|
|
End Get
|
|
End Property
|
|
|
|
Protected m_SelCAMBERSIDE As Integer
|
|
Public Property SelCAMBERSIDE As Integer
|
|
Get
|
|
Return m_SelCAMBERSIDE
|
|
End Get
|
|
Set(value As Integer)
|
|
Dim sValArray() As String = CamberParams.Split(",")
|
|
If sValArray.Count() >= 4 AndAlso
|
|
StringToLen(sValArray(0), m_dCamberLen1) AndAlso
|
|
StringToLen(sValArray(1), m_dCamberLen2) AndAlso
|
|
StringToLen(sValArray(2), m_dCamberLen3) AndAlso
|
|
StringToLen(sValArray(3), m_dCamberCross3) AndAlso
|
|
EgtSetInfo(m_nPartId, BTL_PRT_CAMBER, "SIDE: " & (value + 1) &
|
|
" P01: " & sValArray(0) &
|
|
" P02: " & sValArray(1) &
|
|
" P03: " & sValArray(2) &
|
|
" P04: " & sValArray(3)) Then
|
|
m_SelCAMBERSIDE = value
|
|
Else
|
|
NotifyPropertyChanged("SelCAMBERSIDE")
|
|
End If
|
|
End Set
|
|
End Property
|
|
|
|
Protected m_dCamberLen1 As Double
|
|
Protected m_dCamberLen2 As Double
|
|
Protected m_dCamberLen3 As Double
|
|
Protected m_dCamberCross3 As Double
|
|
Public Property CamberParams As String
|
|
Get
|
|
Return LenToString(m_dCamberLen1, 3) & "," &
|
|
LenToString(m_dCamberLen2, 3) & "," &
|
|
LenToString(m_dCamberLen3, 3) & "," &
|
|
LenToString(m_dCamberCross3, 3)
|
|
End Get
|
|
Set(value As String)
|
|
Dim sValArray() As String = value.Split(",")
|
|
If sValArray.Count() >= 4 AndAlso
|
|
StringToLen(sValArray(0), m_dCamberLen1) AndAlso
|
|
StringToLen(sValArray(1), m_dCamberLen2) AndAlso
|
|
StringToLen(sValArray(2), m_dCamberLen3) AndAlso
|
|
StringToLen(sValArray(3), m_dCamberCross3) Then
|
|
EgtSetInfo(m_nPartId, BTL_PRT_CAMBER, " SIDE: " & (SelCAMBERSIDE + 1) &
|
|
" P01: " & sValArray(0) &
|
|
" P02: " & sValArray(1) &
|
|
" P03: " & sValArray(2) &
|
|
" P04: " & sValArray(3))
|
|
Else
|
|
NotifyPropertyChanged("CamberParams")
|
|
End If
|
|
End Set
|
|
End Property
|
|
|
|
Protected m_ocREFSIDEFIXCLAMP As New ObservableCollection(Of Object)({New IdNameStruct(PartOffset_RefSideFixClamp.INACTIVE, EgtMsg(61665)),
|
|
New IdNameStruct(PartOffset_RefSideFixClamp.REFSIDE1, EgtMsg(61687)),
|
|
New IdNameStruct(PartOffset_RefSideFixClamp.REFSIDE2, EgtMsg(61688)),
|
|
New IdNameStruct(PartOffset_RefSideFixClamp.REFSIDE3, EgtMsg(61689)),
|
|
New IdNameStruct(PartOffset_RefSideFixClamp.REFSIDE4, EgtMsg(61690))})
|
|
Public ReadOnly Property ocREFSIDEFIXCLAMP As ObservableCollection(Of Object)
|
|
Get
|
|
Return m_ocREFSIDEFIXCLAMP
|
|
End Get
|
|
End Property
|
|
|
|
Protected m_SelREFSIDEFIXCLAMP As Integer
|
|
Public Property SelREFSIDEFIXCLAMP As Integer
|
|
Get
|
|
Return m_SelREFSIDEFIXCLAMP
|
|
End Get
|
|
Set(value As Integer)
|
|
Dim nValue As Integer = IdNameStruct.IdFromInd(value, ocREFSIDEFIXCLAMP)
|
|
Dim sValue As String = ocREFSIDEFIXCLAMP(nValue).Name '[Enum].GetName(GetType(PartOffset_RefSideFixClamp), nValue)
|
|
|
|
Dim sValArray() As String = PartOffsetParams.Split(",")
|
|
If sValArray.Count() >= 4 AndAlso
|
|
StringToLen(sValArray(0), m_dPartOffsetSide1) AndAlso
|
|
StringToLen(sValArray(1), m_dPartOffsetSide2) AndAlso
|
|
StringToLen(sValArray(2), m_dPartOffsetSide3) AndAlso
|
|
StringToLen(sValArray(3), m_dPartOffsetSide4) AndAlso
|
|
EgtSetInfo(m_nPartId, BTL_PRT_PARTOFFSET, " P04: " & sValue &
|
|
" P11: " & sValArray(0) &
|
|
" P12: " & sValArray(1) &
|
|
" P13: " & sValArray(2) &
|
|
" P14: " & sValArray(3)) Then
|
|
m_SelREFSIDEFIXCLAMP = value
|
|
Else
|
|
NotifyPropertyChanged("SelREFSIDEFIXCLAMP")
|
|
End If
|
|
End Set
|
|
End Property
|
|
|
|
Protected m_dPartOffsetSide1 As Double
|
|
Protected m_dPartOffsetSide2 As Double
|
|
Protected m_dPartOffsetSide3 As Double
|
|
Protected m_dPartOffsetSide4 As Double
|
|
Public Property PartOffsetParams As String
|
|
Get
|
|
Return LenToString(m_dPartOffsetSide1, 3) & "," &
|
|
LenToString(m_dPartOffsetSide2, 3) & "," &
|
|
LenToString(m_dPartOffsetSide3, 3) & "," &
|
|
LenToString(m_dPartOffsetSide4, 3)
|
|
End Get
|
|
Set(value As String)
|
|
Dim nValue As Integer = IdNameStruct.IdFromInd(SelREFSIDEFIXCLAMP, ocREFSIDEFIXCLAMP)
|
|
Dim sValue As String = ocREFSIDEFIXCLAMP(nValue).Name '[Enum].GetName(GetType(PartOffset_RefSideFixClamp), nValue)
|
|
|
|
Dim sValArray() As String = value.Split(",")
|
|
If sValArray.Count() >= 4 AndAlso
|
|
StringToLen(sValArray(0), m_dPartOffsetSide1) AndAlso
|
|
StringToLen(sValArray(1), m_dPartOffsetSide2) AndAlso
|
|
StringToLen(sValArray(2), m_dPartOffsetSide3) AndAlso
|
|
StringToLen(sValArray(3), m_dPartOffsetSide4) Then
|
|
EgtSetInfo(m_nPartId, BTL_PRT_PARTOFFSET, " P04: " & sValue &
|
|
" P11: " & sValArray(0) &
|
|
" P12: " & sValArray(1) &
|
|
" P13: " & sValArray(2) &
|
|
" P14: " & sValArray(3))
|
|
Else
|
|
NotifyPropertyChanged("PartOffsetParams")
|
|
End If
|
|
End Set
|
|
End Property
|
|
|
|
Protected m_ocPROCESSINGQUALITY As New ObservableCollection(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 ObservableCollection(Of Object)
|
|
Get
|
|
Return m_ocPROCESSINGQUALITY
|
|
End Get
|
|
End Property
|
|
|
|
Protected m_SelPROCESSINGQUALITY As Integer
|
|
Public Property SelPROCESSINGQUALITY As Integer
|
|
Get
|
|
Return m_SelPROCESSINGQUALITY
|
|
End Get
|
|
Set(value As Integer)
|
|
Dim nValue As Integer = IdNameStruct.IdFromInd(value, ocPROCESSINGQUALITY)
|
|
Dim sValue As String = [Enum].GetName(GetType(ProcessingQuality), nValue)
|
|
If EgtSetInfo(m_nPartId, BTL_PRT_PROCESSINGQUALITY, sValue) Then
|
|
m_SelPROCESSINGQUALITY = value
|
|
Else
|
|
NotifyPropertyChanged("SelPROCESSINGQUALITY")
|
|
End If
|
|
End Set
|
|
End Property
|
|
|
|
Protected m_ocRECESS As New ObservableCollection(Of Object)({New IdNameStruct(Recess.AUTOMATIC, EgtMsg(61658)),
|
|
New IdNameStruct(Recess.MANUAL, EgtMsg(61661))})
|
|
Public ReadOnly Property ocRECESS As ObservableCollection(Of Object)
|
|
Get
|
|
Return m_ocRECESS
|
|
End Get
|
|
End Property
|
|
|
|
Protected m_SelRECESS As Integer
|
|
Public Property SelRECESS As Integer
|
|
Get
|
|
Return m_SelRECESS
|
|
End Get
|
|
Set(value As Integer)
|
|
Dim nValue As Integer = IdNameStruct.IdFromInd(value, ocRECESS)
|
|
Dim sValue As String = [Enum].GetName(GetType(Recess), nValue)
|
|
If EgtSetInfo(m_nPartId, BTL_PRT_RECESS, sValue) Then
|
|
m_SelRECESS = value
|
|
Else
|
|
NotifyPropertyChanged("SelRECESS")
|
|
End If
|
|
End Set
|
|
End Property
|
|
|
|
Protected m_ocSTOREYTYPE As New ObservableCollection(Of Object)({New IdNameStruct(StoreyType.CEILING, EgtMsg(61662)),
|
|
New IdNameStruct(StoreyType.ROOF, EgtMsg(61663)),
|
|
New IdNameStruct(StoreyType.WALL, EgtMsg(61664))})
|
|
Public ReadOnly Property ocSTOREYTYPE As ObservableCollection(Of Object)
|
|
Get
|
|
Return m_ocSTOREYTYPE
|
|
End Get
|
|
End Property
|
|
|
|
Protected m_SelSTOREYTYPE As Integer
|
|
Public Property SelSTOREYTYPE As Integer
|
|
Get
|
|
Return m_SelSTOREYTYPE
|
|
End Get
|
|
Set(value As Integer)
|
|
Dim nValue As Integer = IdNameStruct.IdFromInd(value, ocSTOREYTYPE)
|
|
Dim sValue As String = [Enum].GetName(GetType(StoreyType), nValue)
|
|
If EgtSetInfo(m_nPartId, BTL_PRT_STOREYTYPE, sValue) Then
|
|
m_SelSTOREYTYPE = value
|
|
Else
|
|
NotifyPropertyChanged("SelSTOREYTYPE")
|
|
End If
|
|
End Set
|
|
End Property
|
|
|
|
Protected m_sELEMENTNUM As String
|
|
Public Property sELEMENTNUM As String
|
|
Get
|
|
Return m_sELEMENTNUM
|
|
End Get
|
|
Set(value As String)
|
|
If EgtSetInfo(m_nPartId, BTL_PRT_ELEMENTNUM, value) Then
|
|
m_sELEMENTNUM = value
|
|
Else
|
|
NotifyPropertyChanged("sELEMENTNUM")
|
|
End If
|
|
End Set
|
|
End Property
|
|
|
|
Protected m_nLAYER As Integer
|
|
Public Property nLAYER As Integer
|
|
Get
|
|
Return m_nLAYER
|
|
End Get
|
|
Set(value As Integer)
|
|
If EgtSetInfo(m_nPartId, BTL_PRT_LAYER, value) Then
|
|
m_nLAYER = value
|
|
Else
|
|
NotifyPropertyChanged("nLAYER")
|
|
End If
|
|
End Set
|
|
End Property
|
|
|
|
Protected m_sMODULENUM As String
|
|
Public Property sMODULENUM As String
|
|
Get
|
|
Return m_sMODULENUM
|
|
End Get
|
|
Set(value As String)
|
|
If EgtSetInfo(m_nPartId, BTL_PRT_MODULENUM, value) Then
|
|
m_sMODULENUM = value
|
|
Else
|
|
NotifyPropertyChanged("sMODULENUM")
|
|
End If
|
|
End Set
|
|
End Property
|
|
|
|
'Protected m_sUSERATTRIBUTE As String
|
|
'Public Property sUSERATTRIBUTE As String
|
|
' Get
|
|
' Return m_sUSERATTRIBUTE
|
|
' End Get
|
|
' Set(value As String)
|
|
' If EgtSetInfo(m_nPartId, BTL_PRT_USERATTRIBUTE, value) Then
|
|
' m_sUSERATTRIBUTE = value
|
|
' Else
|
|
' NotifyPropertyChanged("sUSERATTRIBUTE")
|
|
' End If
|
|
' End Set
|
|
'End Property
|
|
|
|
Protected m_sCOMMENT As String
|
|
Public Property sCOMMENT As String
|
|
Get
|
|
Return m_sCOMMENT
|
|
End Get
|
|
Set(value As String)
|
|
If EgtSetInfo(m_nPartId, BTL_PRT_COMMENT, value) Then
|
|
m_sCOMMENT = value
|
|
Else
|
|
NotifyPropertyChanged("sCOMMENT")
|
|
End If
|
|
End Set
|
|
End Property
|
|
|
|
Protected m_refGrainDir As Vector3d
|
|
Public Property GrainDirection As String
|
|
Get
|
|
Return DoubleToString(m_refGrainDir.x, 6) & "," &
|
|
DoubleToString(m_refGrainDir.y, 6) & "," &
|
|
DoubleToString(m_refGrainDir.z, 6)
|
|
End Get
|
|
Set(value As String)
|
|
Dim sValArray() As String = value.Split(",")
|
|
If sValArray.Count() >= 3 AndAlso
|
|
StringToDouble(sValArray(0), m_refGrainDir.x) AndAlso
|
|
StringToDouble(sValArray(1), m_refGrainDir.y) AndAlso
|
|
StringToDouble(sValArray(2), m_refGrainDir.z) Then
|
|
EgtSetInfo(m_nPartId, BTL_PRT_GRAINDIR, sValArray(0) & "," &
|
|
sValArray(1) & "," &
|
|
sValArray(2) & ";" &
|
|
If(bGRAINDIRALIGN, 1, 0))
|
|
Else
|
|
NotifyPropertyChanged("GrainDirection")
|
|
End If
|
|
End Set
|
|
End Property
|
|
|
|
Protected m_bGRAINDIRALIGN As Boolean
|
|
Public Property bGRAINDIRALIGN As Boolean
|
|
Get
|
|
Return m_bGRAINDIRALIGN
|
|
End Get
|
|
Set(value As Boolean)
|
|
Dim sValArray() As String = GrainDirection.Split(",")
|
|
If sValArray.Count() >= 3 AndAlso
|
|
StringToDouble(sValArray(0), m_refGrainDir.x) AndAlso
|
|
StringToDouble(sValArray(1), m_refGrainDir.y) AndAlso
|
|
StringToDouble(sValArray(2), m_refGrainDir.z) AndAlso
|
|
EgtSetInfo(m_nPartId, BTL_PRT_GRAINDIR, sValArray(0) & "," &
|
|
sValArray(1) & "," &
|
|
sValArray(2) & ";" &
|
|
If(value, 1, 0)) Then
|
|
m_bGRAINDIRALIGN = value
|
|
NotifyPropertyChanged("bGRAINDIRALIGN")
|
|
End If
|
|
End Set
|
|
End Property
|
|
|
|
Protected m_ocREFSIDE As New ObservableCollection(Of Integer)({1, 2, 3, 4})
|
|
Public ReadOnly Property ocREFSIDE As ObservableCollection(Of Integer)
|
|
Get
|
|
Return m_ocREFSIDE
|
|
End Get
|
|
End Property
|
|
|
|
Protected m_ReferenceSide As String
|
|
Protected m_SelREFSIDE As Integer
|
|
Public Property SelREFSIDE As Integer
|
|
Get
|
|
Return m_SelREFSIDE
|
|
End Get
|
|
Set(value As Integer)
|
|
If EgtSetInfo(m_nPartId, BTL_PRT_REFSIDE, (value + 1) & ";" & If(bREFSIDEALIGN, 1, 0)) Then
|
|
m_SelREFSIDE = value
|
|
Else
|
|
NotifyPropertyChanged("SelREFSIDE")
|
|
End If
|
|
End Set
|
|
End Property
|
|
|
|
Protected m_bREFSIDEALIGN As Boolean
|
|
Public Property bREFSIDEALIGN As Boolean
|
|
Get
|
|
Return m_bREFSIDEALIGN
|
|
End Get
|
|
Set(value As Boolean)
|
|
If EgtSetInfo(m_nPartId, BTL_PRT_REFSIDE, (SelREFSIDE + 1) & ";" & If(value, 1, 0)) Then
|
|
m_bREFSIDEALIGN = value
|
|
NotifyPropertyChanged("bREFSIDEALIGN")
|
|
End If
|
|
End Set
|
|
End Property
|
|
|
|
Protected m_ocALIGNLOCATION As New ObservableCollection(Of Object)({New IdNameStruct(AlignmentLocation.INACTIV, EgtMsg(61665)),
|
|
New IdNameStruct(AlignmentLocation.BR, EgtMsg(61666)),
|
|
New IdNameStruct(AlignmentLocation.TR, EgtMsg(61667)),
|
|
New IdNameStruct(AlignmentLocation.BA, EgtMsg(61668)),
|
|
New IdNameStruct(AlignmentLocation.TA, EgtMsg(61669)),
|
|
New IdNameStruct(AlignmentLocation.HC, EgtMsg(61670)),
|
|
New IdNameStruct(AlignmentLocation.VC, EgtMsg(61671)),
|
|
New IdNameStruct(AlignmentLocation.AC, EgtMsg(61672))})
|
|
Public ReadOnly Property ocALIGNLOCATION As ObservableCollection(Of Object)
|
|
Get
|
|
Return m_ocALIGNLOCATION
|
|
End Get
|
|
End Property
|
|
|
|
Protected m_SelALIGNLOCATION As Integer
|
|
Public Property SelALIGNLOCATION As Integer
|
|
Get
|
|
Return m_SelALIGNLOCATION
|
|
End Get
|
|
Set(value As Integer)
|
|
Dim nValue As Integer = IdNameStruct.IdFromInd(value, ocALIGNLOCATION)
|
|
Dim sValueLoc As String = [Enum].GetName(GetType(AlignmentLocation), nValue)
|
|
nValue = IdNameStruct.IdFromInd(SelALIGNENDTYPE, ocALIGNENDTYPE)
|
|
Dim sValueEnd As String = [Enum].GetName(GetType(AlignmentEndtype), nValue)
|
|
If EgtSetInfo(m_nPartId, BTL_PRT_ALIGNMENT, sValueLoc & ": " & sValueEnd) Then
|
|
m_SelALIGNLOCATION = value
|
|
Else
|
|
NotifyPropertyChanged("SelALIGNLOCATION")
|
|
End If
|
|
End Set
|
|
End Property
|
|
|
|
Protected m_ocALIGNENDTYPE As New ObservableCollection(Of Object)({New IdNameStruct(AlignmentEndtype.R, EgtMsg(61673)),
|
|
New IdNameStruct(AlignmentEndtype.A, EgtMsg(61674)),
|
|
New IdNameStruct(AlignmentEndtype.D, EgtMsg(61675))})
|
|
Public ReadOnly Property ocALIGNENDTYPE As ObservableCollection(Of Object)
|
|
Get
|
|
Return m_ocALIGNENDTYPE
|
|
End Get
|
|
End Property
|
|
|
|
Protected m_SelALIGNENDTYPE As Integer
|
|
Public Property SelALIGNENDTYPE As Integer
|
|
Get
|
|
Return m_SelALIGNENDTYPE
|
|
End Get
|
|
Set(value As Integer)
|
|
Dim nValue As Integer = IdNameStruct.IdFromInd(SelALIGNLOCATION, ocALIGNLOCATION)
|
|
Dim sValueLoc As String = [Enum].GetName(GetType(AlignmentLocation), nValue)
|
|
nValue = IdNameStruct.IdFromInd(value, ocALIGNENDTYPE)
|
|
Dim sValueEnd As String = [Enum].GetName(GetType(AlignmentEndtype), nValue)
|
|
If EgtSetInfo(m_nPartId, BTL_PRT_ALIGNMENT, sValueLoc & ": " & sValueEnd) Then
|
|
m_SelALIGNENDTYPE = value
|
|
Else
|
|
NotifyPropertyChanged("SelALIGNENDTYPE")
|
|
End If
|
|
End Set
|
|
End Property
|
|
|
|
Protected m_ocMATERIALTYPEGRP As New ObservableCollection(Of Object)({New IdNameStruct(MaterialType.INACTIV, EgtMsg(61665)),
|
|
New IdNameStruct(MaterialType.BA, EgtMsg(61676)),
|
|
New IdNameStruct(MaterialType.CL, EgtMsg(61677)),
|
|
New IdNameStruct(MaterialType.MT, EgtMsg(61678)),
|
|
New IdNameStruct(MaterialType.ME_, EgtMsg(61679)),
|
|
New IdNameStruct(MaterialType.GB, EgtMsg(61680)),
|
|
New IdNameStruct(MaterialType.GF, EgtMsg(61681)),
|
|
New IdNameStruct(MaterialType.IN_, EgtMsg(61682)),
|
|
New IdNameStruct(MaterialType.SH, EgtMsg(61683)),
|
|
New IdNameStruct(MaterialType.FB, EgtMsg(61684)),
|
|
New IdNameStruct(MaterialType.PB, EgtMsg(61685)),
|
|
New IdNameStruct(MaterialType.PL, EgtMsg(61686))})
|
|
Public ReadOnly Property ocMATERIALTYPEGRP As ObservableCollection(Of Object)
|
|
Get
|
|
Return m_ocMATERIALTYPEGRP
|
|
End Get
|
|
End Property
|
|
|
|
Protected m_SelMATERIALTYPEGRP As Integer
|
|
Public Property SelMATERIALTYPEGRP As Integer
|
|
Get
|
|
Return m_SelMATERIALTYPEGRP
|
|
End Get
|
|
Set(value As Integer)
|
|
Dim nValue As Integer = IdNameStruct.IdFromInd(value, ocMATERIALTYPEGRP)
|
|
Dim sValue As String = ocMATERIALTYPEGRP(nValue).Name '[Enum].GetName(GetType(MaterialType), nValue)
|
|
If EgtSetInfo(m_nPartId, BTL_PRT_MATERIALTYPE, sValue & ": " & sMATERIALTYPESPEC) Then
|
|
m_SelMATERIALTYPEGRP = value
|
|
Else
|
|
NotifyPropertyChanged("SelMATERIALTYPEGRP")
|
|
End If
|
|
End Set
|
|
End Property
|
|
|
|
Protected m_sMATERIALTYPESPEC As String
|
|
Public Property sMATERIALTYPESPEC As String
|
|
Get
|
|
Return m_sMATERIALTYPESPEC
|
|
End Get
|
|
Set(value As String)
|
|
Dim nValue As Integer = IdNameStruct.IdFromInd(SelMATERIALTYPEGRP, ocMATERIALTYPEGRP)
|
|
Dim sValue As String = ocMATERIALTYPEGRP(nValue).Name '[Enum].GetName(GetType(MaterialType), nValue)
|
|
If EgtSetInfo(m_nPartId, BTL_PRT_MATERIALTYPE, sValue & ": " & value) Then
|
|
m_sMATERIALTYPESPEC = value
|
|
Else
|
|
NotifyPropertyChanged("sMATERIALTYPESPEC")
|
|
End If
|
|
End Set
|
|
End Property
|
|
|
|
#End Region ' Parametri pezzo
|
|
|
|
Public Property sCNT As String
|
|
Get
|
|
Return m_nCNT
|
|
End Get
|
|
Set(value As String)
|
|
Dim nTempCNT As Integer
|
|
If Integer.TryParse(value, nTempCNT) AndAlso nTempCNT > 0 AndAlso EgtSetInfo(m_nPartId, BTL_PRT_CNT, value) Then
|
|
m_nCNT = nTempCNT
|
|
Else
|
|
NotifyPropertyChanged("sCNT")
|
|
End If
|
|
End Set
|
|
End Property
|
|
|
|
Private m_nINVERTED As Integer
|
|
Public ReadOnly Property sINVERTED As String
|
|
Get
|
|
Return m_nINVERTED & "°"
|
|
End Get
|
|
End Property
|
|
|
|
Private m_nROTATED As Integer
|
|
Public ReadOnly Property sROTATED As String
|
|
Get
|
|
Return m_nROTATED & "°"
|
|
End Get
|
|
End Property
|
|
|
|
Private m_nCALC_ERR As Integer
|
|
Public ReadOnly Property nCALC_ERR As Integer
|
|
Get
|
|
Return m_nCALC_ERR
|
|
End Get
|
|
End Property
|
|
|
|
Private m_nCALC_FALL As Integer
|
|
Public ReadOnly Property nCALC_FALL As Integer
|
|
Get
|
|
Return m_nCALC_FALL
|
|
End Get
|
|
End Property
|
|
|
|
Private m_sCALC_MSG As String
|
|
Public ReadOnly Property nCALC_MSG As String
|
|
Get
|
|
Return m_sCALC_MSG
|
|
End Get
|
|
End Property
|
|
|
|
Public ReadOnly Property Calc_BorderBrush As SolidColorBrush
|
|
Get
|
|
If Not bDO Then
|
|
Return Brushes.Aqua
|
|
ElseIf m_nGlobalState = 0 Then
|
|
Return Brushes.Green
|
|
ElseIf m_nGlobalState < 0 Then
|
|
Return Brushes.LightGray
|
|
ElseIf m_nGlobalState > 0 Then
|
|
Return Brushes.Red
|
|
End If
|
|
End Get
|
|
End Property
|
|
|
|
Public Property bDOALL As Boolean?
|
|
Get
|
|
If FeatureList.Count = 0 Then Return False
|
|
Dim bTemp As Boolean = FeatureList(0).bDO
|
|
For FeatureIndex = 1 To FeatureList.Count - 1
|
|
If FeatureList(FeatureIndex).bDO <> bTemp Then Return Nothing
|
|
Next
|
|
Return bTemp
|
|
End Get
|
|
Set(value As Boolean?)
|
|
If FeatureList.Count = 0 Then
|
|
NotifyPropertyChanged("bDOALL")
|
|
Return
|
|
End If
|
|
For Each Feature In FeatureList
|
|
Feature.bDO = value
|
|
Next
|
|
End Set
|
|
End Property
|
|
|
|
' lista delle feature del pezzo
|
|
|
|
Public Overrides Property SelFeature As Core.BTLFeature
|
|
Get
|
|
Return m_SelFeature
|
|
End Get
|
|
Set(value As Core.BTLFeature)
|
|
m_SelFeature = value
|
|
If Map.refMainMenuVM.SelPage = Pages.VIEW Then
|
|
If Not IsNothing(m_SelFeature) Then
|
|
DirectCast(m_SelFeature, BTLFeature).SelGeomFeature()
|
|
EgtDraw()
|
|
' imposto path disegno da mostrare in BottomPanel
|
|
Map.refBottomPanelVM.SetCurrDraw(DirectCast(m_SelFeature, BTLFeature).sDrawPath)
|
|
' seleziono pagina BottomPanel
|
|
Map.refBottomPanelVM.SetSelPartFeatureTab(BottomPanelVM.PartFeatureTab.FEATURE)
|
|
' deseleziono i parametri
|
|
If Not IsNothing(SelFeature.SelPParam) Then SelFeature.SelPParam = Nothing
|
|
' se contorno libero
|
|
If m_SelFeature.IsFreeContour() Then
|
|
' attivo stato contorno libero
|
|
|
|
End If
|
|
Else
|
|
EgtDeselectAll()
|
|
End If
|
|
End If
|
|
NotifyPropertyChanged("SelFeature")
|
|
End Set
|
|
End Property
|
|
|
|
' Definizione comandi
|
|
Private m_cmdInvert As ICommand
|
|
Private m_cmdBackRotation As ICommand
|
|
Private m_cmdForwardRotation As ICommand
|
|
Private m_cmdPartColour As ICommand
|
|
Private m_cmdDeletePart As ICommand
|
|
|
|
#Region "MESSAGES"
|
|
|
|
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
|
|
|
|
#End Region
|
|
|
|
#End Region ' FIELDS & PROPERTIES
|
|
|
|
#Region "CONSTRUCTOR"
|
|
|
|
Sub New(ParentStructure As BTLStructure, nPartId As Integer)
|
|
MyBase.New(ParentStructure, nPartId)
|
|
' leggo info pezzo
|
|
Dim sValArray() As String
|
|
Dim sValue As String = String.Empty
|
|
Dim nValue As Integer = 0
|
|
EgtGetInfo(nPartId, BTL_PRT_PDN, nPDN)
|
|
Dim nDO As Integer = 1
|
|
If EgtGetInfo(nPartId, BTL_PRT_DO, nDO) Then
|
|
m_bDO = (nDO <> 0)
|
|
Else
|
|
m_bDO = True
|
|
End If
|
|
EgtGetInfo(nPartId, BTL_PRT_NAM, m_sNAM)
|
|
EgtGetInfo(nPartId, BTL_PRT_L, m_dL)
|
|
EgtGetInfo(nPartId, BTL_PRT_W, m_dW)
|
|
EgtGetInfo(nPartId, BTL_PRT_H, m_dH)
|
|
EgtGetInfo(nPartId, BTL_PRT_CNT, m_nCNT)
|
|
EgtGetInfo(nPartId, BTL_PRT_ASSEMBLYNUM, m_sASSEMBLYNUM)
|
|
EgtGetInfo(nPartId, BTL_PRT_ORDERNUM, m_nORDERNUM)
|
|
EgtGetInfo(nPartId, BTL_PRT_DESIGNATION, m_sDESIGN)
|
|
EgtGetInfo(nPartId, BTL_PRT_ANNOTATION, m_sANNOT)
|
|
EgtGetInfo(nPartId, BTL_PRT_STOREY, m_sSTOREY)
|
|
EgtGetInfo(nPartId, BTL_PRT_GROUP, m_sGROUP)
|
|
EgtGetInfo(nPartId, BTL_PRT_PACKAGE, m_sPACKAGE)
|
|
EgtGetInfo(nPartId, BTL_PRT_TIMBERGRADE, m_sTIMBERGRADE)
|
|
EgtGetInfo(nPartId, BTL_PRT_QUALITYGRADE, m_sQUALITYGRADE)
|
|
EgtGetInfo(nPartId, BTL_PRT_COLOUR, sValue)
|
|
m_colCOLOR.FromString(sValue)
|
|
EgtGetInfo(nPartId, BTL_PRT_PLANINGLENGTH, m_dPLANINGLEN)
|
|
EgtGetInfo(nPartId, BTL_PRT_STARTOFFSET, m_dSTARTOFFSET)
|
|
EgtGetInfo(nPartId, BTL_PRT_ENDOFFSET, m_dENDOFFSET)
|
|
|
|
Dim ind As Integer = 1
|
|
While EgtGetInfo(nPartId, BTL_PRT_UID & ind, nValue)
|
|
ocUID.Add(nValue)
|
|
EgtGetInfo(nPartId, BTL_PRT_TRANSFORMATION & ind, sValue)
|
|
m_refTransf = New Frame3d
|
|
Dim ptOri As New Point3d
|
|
Dim vtVersX As New Vector3d
|
|
Dim vtVersY As New Vector3d
|
|
sValArray = sValue.Split({","}, StringSplitOptions.RemoveEmptyEntries)
|
|
If sValArray.Count() >= 9 Then
|
|
StringToLen(sValArray(0), ptOri.x)
|
|
StringToLen(sValArray(1), ptOri.y)
|
|
StringToLen(sValArray(2), ptOri.z)
|
|
StringToDouble(sValArray(3), vtVersX.x)
|
|
StringToDouble(sValArray(4), vtVersX.y)
|
|
StringToDouble(sValArray(5), vtVersX.z)
|
|
StringToDouble(sValArray(6), vtVersY.x)
|
|
StringToDouble(sValArray(7), vtVersY.y)
|
|
StringToDouble(sValArray(8), vtVersY.z)
|
|
m_refTransf.ChangeOrigin(ptOri)
|
|
m_refTransf.Setup(ptOri, ptOri + vtVersX, ptOri + vtVersY)
|
|
End If
|
|
refTransfList.Add(m_refTransf)
|
|
ind = ind + 1
|
|
End While
|
|
|
|
EgtGetInfo(nPartId, BTL_PRT_CAMBER, sValue)
|
|
sValArray = sValue.Split(New String() {": ", " P"}, StringSplitOptions.RemoveEmptyEntries)
|
|
If sValArray.Count() >= 5 Then
|
|
StringToLen(sValArray(3), m_dCamberLen1)
|
|
StringToLen(sValArray(5), m_dCamberLen2)
|
|
StringToLen(sValArray(7), m_dCamberLen3)
|
|
StringToLen(sValArray(9), m_dCamberCross3)
|
|
End If
|
|
Dim pFrom As Integer = sValue.IndexOf("SIDE: ") + "SIDE: ".Length
|
|
Dim pTo As Integer = sValue.LastIndexOf(" P01")
|
|
If pTo >= 0 Then
|
|
nValue = CInt(sValue.Substring(pFrom, pTo - pFrom))
|
|
m_SelCAMBERSIDE = ocCAMBERSIDE.IndexOf(CInt(sValue.Substring(pFrom, pTo - pFrom)))
|
|
End If
|
|
|
|
EgtGetInfo(nPartId, BTL_PRT_PARTOFFSET, sValue)
|
|
sValArray = sValue.Split(New String() {": ", " P"}, StringSplitOptions.RemoveEmptyEntries)
|
|
If sValArray.Count() >= 5 Then
|
|
StringToLen(sValArray(3), m_dPartOffsetSide1)
|
|
StringToLen(sValArray(5), m_dPartOffsetSide2)
|
|
StringToLen(sValArray(7), m_dPartOffsetSide3)
|
|
StringToLen(sValArray(9), m_dPartOffsetSide4)
|
|
End If
|
|
pFrom = sValue.IndexOf("P04: ") + "P04: ".Length
|
|
pTo = sValue.LastIndexOf(" P11")
|
|
If pTo >= 0 Then
|
|
m_SelREFSIDEFIXCLAMP = IdNameStruct.IndFromId(IdNameStruct.IdFromName(sValue.Substring(pFrom, pTo - pFrom), ocREFSIDEFIXCLAMP), ocREFSIDEFIXCLAMP)
|
|
End If
|
|
|
|
EgtGetInfo(nPartId, BTL_PRT_PROCESSINGQUALITY, sValue)
|
|
m_SelPROCESSINGQUALITY = IdNameStruct.IndFromId(IdNameStruct.IdFromName(sValue, ocPROCESSINGQUALITY), ocPROCESSINGQUALITY)
|
|
EgtGetInfo(nPartId, BTL_PRT_RECESS, sValue)
|
|
m_SelRECESS = IdNameStruct.IndFromId(IdNameStruct.IdFromName(sValue, ocRECESS), ocRECESS)
|
|
EgtGetInfo(nPartId, BTL_PRT_STOREYTYPE, sValue)
|
|
m_SelSTOREYTYPE = IdNameStruct.IndFromId(IdNameStruct.IdFromName(sValue, ocSTOREYTYPE), ocSTOREYTYPE)
|
|
EgtGetInfo(nPartId, BTL_PRT_ELEMENTNUM, m_sELEMENTNUM)
|
|
EgtGetInfo(nPartId, BTL_PRT_LAYER, m_nLAYER)
|
|
EgtGetInfo(nPartId, BTL_PRT_MODULENUM, m_sMODULENUM)
|
|
'EgtGetInfo(nPartId, BTL_PRT_USERATTRIBUTE, m_sUSERATTRIBUTE)
|
|
EgtGetInfo(nPartId, BTL_PRT_COMMENT, m_sCOMMENT)
|
|
|
|
EgtGetInfo(nPartId, BTL_PRT_GRAINDIR, sValue)
|
|
m_refGrainDir = New Vector3d
|
|
sValArray = sValue.Split(New String() {",", ";"}, StringSplitOptions.RemoveEmptyEntries)
|
|
If sValArray.Count() >= 4 Then
|
|
StringToDouble(sValArray(0), m_refGrainDir.x)
|
|
StringToDouble(sValArray(1), m_refGrainDir.y)
|
|
StringToDouble(sValArray(2), m_refGrainDir.z)
|
|
m_bGRAINDIRALIGN = (CInt(sValArray(3)) = 1)
|
|
End If
|
|
|
|
EgtGetInfo(nPartId, BTL_PRT_REFSIDE, sValue)
|
|
sValArray = sValue.Split({";"}, StringSplitOptions.RemoveEmptyEntries)
|
|
If sValArray.Count() >= 2 Then
|
|
m_SelREFSIDE = ocREFSIDE.IndexOf(CInt(sValArray(0)))
|
|
m_bREFSIDEALIGN = (CInt(sValArray(1)) = 1)
|
|
End If
|
|
|
|
EgtGetInfo(nPartId, BTL_PRT_ALIGNMENT, sValue)
|
|
sValArray = sValue.Split({":"}, StringSplitOptions.RemoveEmptyEntries)
|
|
If sValArray.Count() >= 2 Then
|
|
m_SelALIGNLOCATION = IdNameStruct.IndFromId(IdNameStruct.IdFromName(sValArray(0), ocALIGNLOCATION), ocALIGNLOCATION)
|
|
m_SelALIGNENDTYPE = IdNameStruct.IndFromId(IdNameStruct.IdFromName(sValArray(1).Trim(), ocALIGNENDTYPE), ocALIGNENDTYPE)
|
|
End If
|
|
|
|
EgtGetInfo(nPartId, BTL_PRT_MATERIALTYPE, sValue)
|
|
sValArray = sValue.Split({":"}, StringSplitOptions.RemoveEmptyEntries)
|
|
If sValArray.Count() >= 1 Then
|
|
m_SelMATERIALTYPEGRP = IdNameStruct.IndFromId(IdNameStruct.IdFromName(sValArray(0), ocMATERIALTYPEGRP), ocMATERIALTYPEGRP)
|
|
If sValArray.Count() >= 2 Then m_sMATERIALTYPESPEC = sValArray(1).Trim()
|
|
End If
|
|
|
|
If Not EgtGetInfo(nPartId, BTL_PRT_ROTATED, m_nROTATED) Then
|
|
m_nROTATED = 0
|
|
End If
|
|
If Not EgtGetInfo(nPartId, BTL_PRT_INVERTED, m_nINVERTED) Then
|
|
m_nINVERTED = 0
|
|
End If
|
|
If EgtGetInfo(nPartId, BTL_PRT_MATERIAL, m_sMATERIAL) Then
|
|
If Not ParentStructure.MaterialList.Contains(m_sMATERIAL) Then
|
|
ParentStructure.MaterialList.Add(m_sMATERIAL)
|
|
End If
|
|
End If
|
|
If Not ParentStructure.SectionList.Contains(Section) Then
|
|
ParentStructure.SectionList.Add(Section)
|
|
End If
|
|
' Leggo outline
|
|
Dim nOutlineLayerId As Integer = EgtGetFirstNameInGroup(nPartId, OUTLINE)
|
|
Dim nOutlineId As Integer = EgtGetFirstInGroup(nOutlineLayerId)
|
|
While nOutlineId <> GDB_ID.NULL
|
|
' verifico che sia una feature
|
|
Dim nGRP As Integer
|
|
If EgtGetInfo(nOutlineId, BTL_FTR_GRP, nGRP) Then
|
|
' creo la feature
|
|
m_FeatureList.Add(New BTLFeature(Me, nOutlineId))
|
|
End If
|
|
nOutlineId = EgtGetNext(nOutlineId)
|
|
End While
|
|
' Leggo feature
|
|
Dim nProcessingId As Integer = EgtGetFirstNameInGroup(nPartId, PROCESSINGS)
|
|
Dim nFeatureId As Integer = EgtGetFirstInGroup(nProcessingId)
|
|
While nFeatureId <> GDB_ID.NULL
|
|
' verifico che sia una feature
|
|
Dim nGRP As Integer
|
|
If EgtGetInfo(nFeatureId, BTL_FTR_GRP, nGRP) Then
|
|
' creo la feature
|
|
m_FeatureList.Add(New BTLFeature(Me, nFeatureId))
|
|
End If
|
|
nFeatureId = EgtGetNext(nFeatureId)
|
|
End While
|
|
' Aggiorno check DOALL
|
|
NotifyPropertyChanged("bDOALL")
|
|
' leggo calc error
|
|
Dim nErr As Integer = 0
|
|
Dim nRot As Integer = 0
|
|
Dim nFall As Integer = 0
|
|
Dim sMsg As String = ""
|
|
Dim bCalc As Boolean = False
|
|
bCalc = EgtGetInfo(nPartId, ITG_PROJ_ERR, nErr)
|
|
EgtGetInfo(nPartId, ITG_PROJ_ROT, nRot)
|
|
EgtGetInfo(nPartId, ITG_PROJ_FALL, sMsg)
|
|
EgtGetInfo(nPartId, ITG_PROJ_MSG, sMsg)
|
|
CalcPartUpdate(bCalc, nErr, nRot, nFall, sMsg)
|
|
CalcFeatureUpdate()
|
|
End Sub
|
|
|
|
#End Region ' CONSTRUCTOR
|
|
|
|
#Region "METHODS"
|
|
|
|
Public Sub Rotation(IsPositive As Boolean)
|
|
' recupero il box del pezzo
|
|
Dim nLs As Integer = EgtGetFirstNameInGroup(nPartId, "Box")
|
|
Dim b3Solid As New BBox3d
|
|
EgtGetBBoxGlob(nLs, GDB_BB.STANDARD, b3Solid)
|
|
If b3Solid.IsEmpty() Then
|
|
Map.refMyStatusBarVM.SetOutputMessage("ERROR: Box non definito per la trave " & sNAM, 5, MSG_TYPE.ERROR_)
|
|
Return
|
|
End If
|
|
' eseguo rotazione di 90 gradi attorno asse X
|
|
Dim dRot = If(IsPositive, 90, -90)
|
|
Dim vtAxes As Vector3d
|
|
' se travi ruoto attorno all'asse X
|
|
If Map.refMachinePanelVM.SelectedMachine.nType = MachineType.BEAM Then
|
|
vtAxes = Vector3d.X_AX
|
|
' se pareti ruoto attorno all'asse Z
|
|
ElseIf Map.refMachinePanelVM.SelectedMachine.nType = MachineType.WALL Then
|
|
vtAxes = Vector3d.Z_AX
|
|
End If
|
|
If EgtRotate(nPartId, b3Solid.Center, vtAxes, dRot, GDB_RT.GLOB) Then
|
|
Select Case m_nROTATED
|
|
Case 0
|
|
m_nROTATED = If(IsPositive, 90, 270)
|
|
Case 90
|
|
m_nROTATED = If(IsPositive, 180, 0)
|
|
Case 180
|
|
m_nROTATED = If(IsPositive, 270, 90)
|
|
Case 270
|
|
m_nROTATED = If(IsPositive, 0, 180)
|
|
End Select
|
|
EgtSetInfo(nPartId, BTL_PRT_ROTATED, m_nROTATED)
|
|
' scambio dimensioni
|
|
SwapDimForRotation()
|
|
' aggiorno sezioni
|
|
DirectCast(ParentStructure, BTLStructure).UpdateSectionFromRotation(Me)
|
|
' imposto modificato per copie
|
|
EgtDuploSetModified(nPartId)
|
|
End If
|
|
EgtDraw()
|
|
NotifyPropertyChanged("sROTATED")
|
|
End Sub
|
|
|
|
Private Function SwapDimForRotation()
|
|
If Map.refMachinePanelVM.SelectedMachine.nType = MachineType.BEAM Then
|
|
' scambio W ed H
|
|
Dim Temp As Double = m_dW
|
|
m_dW = m_dH
|
|
m_dH = Temp
|
|
EgtSetInfo(nPartId, BTL_PRT_W, m_dW)
|
|
EgtSetInfo(nPartId, BTL_PRT_H, m_dH)
|
|
ElseIf Map.refMachinePanelVM.SelectedMachine.nType = MachineType.WALL Then
|
|
' scambio W ed L
|
|
Dim Temp As Double = m_dW
|
|
m_dW = m_dL
|
|
m_dL = Temp
|
|
EgtSetInfo(nPartId, BTL_PRT_W, m_dW)
|
|
EgtSetInfo(nPartId, BTL_PRT_L, m_dL)
|
|
End If
|
|
' notifica per valori in PartGrid
|
|
NotifyPropertyChanged("dW")
|
|
NotifyPropertyChanged("dH")
|
|
NotifyPropertyChanged("dL")
|
|
' notifica per valori in PartManager(textbox)
|
|
NotifyPropertyChanged("sW")
|
|
NotifyPropertyChanged("sH")
|
|
NotifyPropertyChanged("sL")
|
|
End Function
|
|
|
|
' funzione che aggiorna lo stato e gli errori dopo calcolo
|
|
Friend Sub CalcPartUpdate(bCalc As Boolean, ERR As Integer, ROT As Integer, FALL As Integer, MSG As String)
|
|
If Not bCalc Then
|
|
nState = CalcStates.NOTCALCULATED
|
|
m_nCALC_ERR = 0
|
|
m_nCALC_ROT = 0
|
|
m_nCALC_FALL = 0
|
|
m_sCALC_MSG = ""
|
|
Else
|
|
m_nCALC_ERR = ERR
|
|
m_nCALC_ROT = ROT
|
|
m_nCALC_FALL = FALL
|
|
m_sCALC_MSG = MSG
|
|
If ERR = 0 Then
|
|
nState = CalcStates.OK
|
|
ElseIf ERR > 1 Then
|
|
nState = CalcStates.ERROR_
|
|
ElseIf ERR < 1 Then
|
|
nState = CalcStates.NOTCALCULATED
|
|
End If
|
|
End If
|
|
NotifyPropertyChanged("Calc_BorderBrush")
|
|
End Sub
|
|
|
|
' funzione che aggiorna lo stato e gli errori dopo calcolo
|
|
Friend Sub CalcFeatureUpdate()
|
|
m_nGlobalState = nState
|
|
For Each Feature In FeatureList
|
|
If Not Feature.bDO Then
|
|
|
|
ElseIf Feature.nState < 0 Then
|
|
m_nGlobalState = CalcStates.NOTCALCULATED
|
|
Exit For
|
|
ElseIf Feature.nState > 0 AndAlso m_nGlobalState = CalcStates.OK Then
|
|
m_nGlobalState = CalcStates.ERROR_
|
|
End If
|
|
Next
|
|
NotifyPropertyChanged("Calc_BorderBrush")
|
|
End Sub
|
|
|
|
Public Function Copy() As BTLPart
|
|
' creo nuovo part
|
|
Dim nNewPartId As Integer = EgtBeamCreatePart()
|
|
If nNewPartId = GDB_ID.NULL Then Return Nothing
|
|
EgtBeamSetPartProdNbr(Me.ParentStructure.NewPDN())
|
|
EgtBeamSetPartName(Me.sNAM)
|
|
EgtBeamSetPartCount(Me.nCNT)
|
|
EgtBeamSetPartBox(Me.dL, Me.dH, Me.dW)
|
|
' aggiungo dati pezzo
|
|
Dim NewPart As New BTLPart(Me.ParentStructure, nNewPartId)
|
|
'aggiungo tutte le sue feature
|
|
For Each Feature In Me.FeatureList
|
|
Feature.Copy(NewPart)
|
|
Next
|
|
' aggiungo pezzo alla lista
|
|
Me.ParentStructure.PartList.Add(NewPart)
|
|
Return NewPart
|
|
End Function
|
|
|
|
#End Region ' METHODS
|
|
|
|
#Region "COMMANDS"
|
|
|
|
#Region "Invert"
|
|
|
|
Public ReadOnly Property Invert_Command As ICommand
|
|
Get
|
|
If m_cmdInvert Is Nothing Then
|
|
m_cmdInvert = New Command(AddressOf Invert)
|
|
End If
|
|
Return m_cmdInvert
|
|
End Get
|
|
End Property
|
|
|
|
Public Sub Invert()
|
|
' recupero il box del pezzo
|
|
Dim nLs As Integer = EgtGetFirstNameInGroup(nPartId, "Box")
|
|
Dim b3Solid As New BBox3d
|
|
EgtGetBBoxGlob(nLs, GDB_BB.STANDARD, b3Solid)
|
|
If b3Solid.IsEmpty() Then
|
|
Map.refMyStatusBarVM.SetOutputMessage("ERROR: Box non definito per la trave " & sNAM, 5, MSG_TYPE.ERROR_)
|
|
Return
|
|
End If
|
|
Dim vtAxes As Vector3d
|
|
' se travi ruoto attorno all'asse Z
|
|
If Map.refMachinePanelVM.SelectedMachine.nType = MachineType.BEAM Then
|
|
vtAxes = Vector3d.Z_AX
|
|
' se pareti ruoto attorno all'asse X
|
|
ElseIf Map.refMachinePanelVM.SelectedMachine.nType = MachineType.WALL Then
|
|
vtAxes = Vector3d.X_AX
|
|
End If
|
|
' eseguo rotazione di 180 gradi
|
|
If EgtRotate(nPartId, b3Solid.Center, vtAxes, 180, GDB_RT.GLOB) Then
|
|
m_nINVERTED = If(m_nINVERTED = 0, 180, 0)
|
|
EgtSetInfo(nPartId, BTL_PRT_INVERTED, m_nINVERTED)
|
|
' imposto modificato per copie
|
|
EgtDuploSetModified(nPartId)
|
|
End If
|
|
EgtDraw()
|
|
NotifyPropertyChanged("sINVERTED")
|
|
End Sub
|
|
|
|
#End Region ' Invert
|
|
|
|
#Region "BackRotation"
|
|
|
|
Public ReadOnly Property BackRotation_Command As ICommand
|
|
Get
|
|
If m_cmdBackRotation Is Nothing Then
|
|
m_cmdBackRotation = New Command(AddressOf BackRotation)
|
|
End If
|
|
Return m_cmdBackRotation
|
|
End Get
|
|
End Property
|
|
|
|
Public Sub BackRotation()
|
|
Rotation(False)
|
|
End Sub
|
|
|
|
#End Region ' BackRotation
|
|
|
|
#Region "ForwardRotation"
|
|
|
|
Public ReadOnly Property ForwardRotation_Command As ICommand
|
|
Get
|
|
If m_cmdForwardRotation Is Nothing Then
|
|
m_cmdForwardRotation = New Command(AddressOf ForwardRotation)
|
|
End If
|
|
Return m_cmdForwardRotation
|
|
End Get
|
|
End Property
|
|
|
|
Public Sub ForwardRotation()
|
|
Rotation(True)
|
|
End Sub
|
|
|
|
#End Region ' ForwardRotation
|
|
|
|
#Region "PartColour"
|
|
|
|
Public ReadOnly Property PartColour_Command As ICommand
|
|
Get
|
|
If m_cmdPartColour Is Nothing Then
|
|
m_cmdPartColour = New Command(AddressOf PartColourCmd)
|
|
End If
|
|
Return m_cmdPartColour
|
|
End Get
|
|
End Property
|
|
|
|
Public Sub PartColourCmd()
|
|
Dim PartColor As New Color3d(192, 192, 192)
|
|
' Eseguo modifica con dialogo
|
|
If SelectColor(m_colCOLOR, PartColor) Then
|
|
'm_colCOLOR = PartColor
|
|
sCOLRGB = PartColor.ToString
|
|
NotifyPropertyChanged("PartColour")
|
|
End If
|
|
End Sub
|
|
|
|
#End Region ' PartColour
|
|
|
|
#Region "DeletePart"
|
|
|
|
Public ReadOnly Property DeletePart_Command As ICommand
|
|
Get
|
|
If m_cmdDeletePart Is Nothing Then
|
|
m_cmdDeletePart = New Command(AddressOf DeletePart)
|
|
End If
|
|
Return m_cmdDeletePart
|
|
End Get
|
|
End Property
|
|
|
|
Public Sub DeletePart()
|
|
If Map.refMainMenuVM.SelPage = Pages.VIEW Then Map.refLeftPanelVM.RemovePart()
|
|
End Sub
|
|
|
|
#End Region ' DeletePart
|
|
|
|
Private Function SelectColor(Col As Color3d, ByRef NewCol As Color3d) As Boolean
|
|
' Creo dialogo colori
|
|
Dim ColorDlg As New System.Windows.Forms.ColorDialog
|
|
ColorDlg.FullOpen = True
|
|
ColorDlg.Color = Col.ToColor()
|
|
' Visualizzo dialogo
|
|
If ColorDlg.ShowDialog() <> Windows.Forms.DialogResult.OK Then Return False
|
|
' Recupero colore scelto
|
|
NewCol.FromString(ColorDlg.Color.R & "," & ColorDlg.Color.G & "," & ColorDlg.Color.B & "," & ColorDlg.Color.A) 'NewCol.FromColor(ColorDlg.Color)
|
|
Return True
|
|
End Function
|
|
|
|
#End Region ' COMMANDS
|
|
|
|
End Class
|
|
|
|
Public Class BTLFeature
|
|
Inherits Core.BTLFeature
|
|
|
|
Public Overrides Property nSelGRP As Integer
|
|
Get
|
|
Return m_nSelGRP
|
|
End Get
|
|
Set(value As Integer)
|
|
If value <> -1 Then
|
|
' aggiorno la feature con nuovo valore
|
|
Dim vPar() As Double = Nothing
|
|
Dim sPar As String = String.Empty
|
|
CalcParamArray(vPar, sPar)
|
|
Dim bOK As Boolean = UpdateParams(value, nPRC, nSelSIDE, sDES, nPRID, frFRAME, vPar, sPar)
|
|
If bOK Then
|
|
m_nSelGRP = value
|
|
' seleziono feature in disegno
|
|
SelGeomFeature()
|
|
' rendo non calcolata questa feature
|
|
CalcFeatureUpdate(False, 0, 0, 0, "")
|
|
' ed aggiorno stato pezzo
|
|
DirectCast(ParentPart, BTLPart).CalcFeatureUpdate()
|
|
Else
|
|
NotifyPropertyChanged("nSelGRP")
|
|
End If
|
|
EgtDraw()
|
|
End If
|
|
End Set
|
|
End Property
|
|
Friend ReadOnly Property sDescGRP As String
|
|
Get
|
|
Dim sDescConstruction As String = String.Empty
|
|
If CalcBeamPrivateProfileGRP(m_nSelGRP) = 0 Then
|
|
sDescConstruction = "L"
|
|
Else
|
|
sDescConstruction = "T"
|
|
End If
|
|
sDescConstruction &= m_nPRC.ToString("000")
|
|
Return sDescConstruction
|
|
End Get
|
|
End Property
|
|
|
|
' Lato
|
|
Public Overrides Property nSelSIDE As Integer
|
|
Get
|
|
Return m_nSelSIDE
|
|
End Get
|
|
Set(value As Integer)
|
|
If value <> -1 Then
|
|
' aggiorno la feature con nuovo valore
|
|
Dim vPar() As Double = Nothing
|
|
Dim sPar As String = String.Empty
|
|
CalcParamArray(vPar, sPar)
|
|
Dim bOK As Boolean = UpdateParams(nSelGRP, nPRC, value, sDES, nPRID, frFRAME, vPar, sPar)
|
|
If bOK Then
|
|
m_nSelSIDE = value
|
|
SelGeomFeature()
|
|
' rendo non calcolata questa feature
|
|
CalcFeatureUpdate(False, 0, 0, 0, "")
|
|
' ed aggiorno stato pezzo
|
|
DirectCast(ParentPart, BTLPart).CalcFeatureUpdate()
|
|
Else
|
|
NotifyPropertyChanged("nSelGRP")
|
|
End If
|
|
EgtDraw()
|
|
End If
|
|
End Set
|
|
End Property
|
|
|
|
Public Overrides Property bDO As Boolean
|
|
Get
|
|
Return m_bDO
|
|
End Get
|
|
Set(value As Boolean)
|
|
If EgtBeamEnableProcess(nFeatureId, value) Then
|
|
m_bDO = value
|
|
' aggiorno check DOALL
|
|
ParentPart.NotifyPropertyChanged("bDOALL")
|
|
EgtDraw()
|
|
NotifyPropertyChanged("Calc_Background")
|
|
NotifyPropertyChanged("bDO")
|
|
End If
|
|
End Set
|
|
End Property
|
|
|
|
' proprieta' che mostra la descrizione in interfaccia
|
|
Public ReadOnly Property sDesc As String
|
|
Get
|
|
Return sDescGRP & " " & sName
|
|
End Get
|
|
End Property
|
|
|
|
Public ReadOnly Property sDrawPath As String
|
|
Get
|
|
Return Map.refMainWindowVM.MainWindowM.sResourcesRoot & "\Features\" & sDescGRP & ".png"
|
|
End Get
|
|
End Property
|
|
|
|
Public ReadOnly Property Calc_Background As SolidColorBrush
|
|
Get
|
|
If Not m_bDO Then
|
|
Return Brushes.Aqua
|
|
ElseIf nState = 0 Then
|
|
Return Brushes.Green
|
|
ElseIf nState < 0 Then
|
|
Return Brushes.LightGray
|
|
ElseIf nState > 0 Then
|
|
Return Brushes.Red
|
|
End If
|
|
End Get
|
|
End Property
|
|
|
|
Public ReadOnly Property CALC_ROT_Visibility As Visibility
|
|
Get
|
|
Return If(m_nCALC_ROT <> 0, Visibility.Visible, Visibility.Collapsed)
|
|
End Get
|
|
End Property
|
|
|
|
Public ReadOnly Property CALC_FALL_Visibility As Visibility
|
|
Get
|
|
Return If(m_nCALC_FALL <> 0, Visibility.Visible, Visibility.Collapsed)
|
|
End Get
|
|
End Property
|
|
|
|
Public ReadOnly Property CALC_ERR_Letter As String
|
|
Get
|
|
Select Case m_nCALC_ERR
|
|
Case 22
|
|
Return "c"
|
|
Case 19, 23, 24, 25
|
|
Return "e"
|
|
Case 17
|
|
Return "w"
|
|
Case < 0
|
|
Return "i"
|
|
End Select
|
|
End Get
|
|
End Property
|
|
|
|
Public ReadOnly Property CALC_ERR_Foreground As SolidColorBrush
|
|
Get
|
|
Select Case m_nCALC_ERR
|
|
Case 19, 22, 23, 24, 25
|
|
Return Brushes.Red
|
|
Case 17
|
|
Return Brushes.Orange
|
|
Case < 0
|
|
Return Brushes.Green
|
|
End Select
|
|
End Get
|
|
End Property
|
|
|
|
Public Overrides Property SelPParam As Core.BTLParam
|
|
Get
|
|
Return m_SelPParam
|
|
End Get
|
|
Set(value As Core.BTLParam)
|
|
m_SelPParam = value
|
|
If Not IsNothing(m_SelPParam) Then
|
|
' imposto path disegno da mostrare in BottomPanel
|
|
Map.refBottomPanelVM.SetCurrDraw(DirectCast(m_SelPParam, BTLParam).sDrawPath)
|
|
End If
|
|
NotifyPropertyChanged("SelPParam")
|
|
End Set
|
|
End Property
|
|
|
|
Public Overrides Property SelQParam As Core.BTLParam
|
|
Get
|
|
Return m_SelQParam
|
|
End Get
|
|
Set(value As Core.BTLParam)
|
|
m_SelQParam = value
|
|
If Not IsNothing(m_SelQParam) Then
|
|
' imposto path disegno da mostrare in BottomPanel
|
|
Map.refBottomPanelVM.SetCurrDraw(DirectCast(m_SelQParam, BTLParam).sDrawPath)
|
|
End If
|
|
NotifyPropertyChanged("SelQParam")
|
|
End Set
|
|
End Property
|
|
|
|
' Definizione comandi
|
|
Private m_cmdDeleteFeature As ICommand
|
|
|
|
Sub New(ParentPart As BTLPart, nFeatureId As Integer)
|
|
MyBase.New(ParentPart, nFeatureId)
|
|
' leggo gruppo, numero feature e lato
|
|
EgtGetInfo(nFeatureId, BTL_FTR_GRP, m_nSelGRP)
|
|
EgtGetInfo(nFeatureId, BTL_FTR_PRC, m_nPRC)
|
|
EgtGetInfo(nFeatureId, BTL_FTR_SIDE, m_nSelSIDE)
|
|
Dim nDO As Integer = 1
|
|
If EgtGetInfo(nFeatureId, BTL_FTR_DO, nDO) Then
|
|
m_bDO = (nDO <> 0)
|
|
Else
|
|
m_bDO = True
|
|
End If
|
|
' leggo des,prid e frame
|
|
EgtGetInfo(nFeatureId, BTL_FTR_DES, m_sDES)
|
|
EgtGetInfo(nFeatureId, BTL_FTR_PRID, m_nPRID)
|
|
EgtGetInfo(nFeatureId, BTL_FTR_FRAME, m_frFRAME)
|
|
' leggo calc error
|
|
Dim nErr As Integer = 0
|
|
Dim nRot As Integer = 0
|
|
Dim nFall As Integer = 0
|
|
Dim sMsg As String = ""
|
|
Dim bCalc As Boolean = False
|
|
bCalc = EgtGetInfo(m_nFeatureId, ITG_PROJ_ERR, nErr)
|
|
EgtGetInfo(m_nFeatureId, ITG_PROJ_ROT, nRot)
|
|
EgtGetInfo(m_nFeatureId, ITG_PROJ_FALL, nFall)
|
|
EgtGetInfo(m_nFeatureId, ITG_PROJ_MSG, sMsg)
|
|
CalcFeatureUpdate(bCalc, nErr, nRot, nFall, sMsg)
|
|
' leggo parametri della feature
|
|
GetBeamPrivateProfileGRPList(CalcBeamPrivateProfileGRP(nSelGRP), m_nPRC, m_GRPList)
|
|
GetBeamPrivateProfileName(m_nSelGRP, m_nPRC, Me)
|
|
' crea parametri per questa feature da file ini
|
|
CreateFeatureParams()
|
|
ReadFeatureParams()
|
|
End Sub
|
|
|
|
Sub New(nPRC As Integer, nGRP As Integer, nSIDE As Integer)
|
|
MyBase.New(nPRC, nGRP, nSIDE)
|
|
End Sub
|
|
|
|
' funzione che crea l'elenco dei parametri
|
|
Public Overrides Sub CreateFeatureParams()
|
|
Dim ParamIndex As Integer = 1
|
|
Dim NewBTLParam As BTLParam = Nothing
|
|
' leggo tutti i P della feature
|
|
While BTLIniFile.GetBeamPrivateProfileParam(m_nSelGRP, m_nPRC, True, ParamIndex, Me, NewBTLParam)
|
|
m_PParamList.Add(NewBTLParam)
|
|
ParamIndex += 1
|
|
End While
|
|
' leggo tutti i Q della feature
|
|
ParamIndex = 1
|
|
While BTLIniFile.GetBeamPrivateProfileParam(m_nSelGRP, m_nPRC, False, ParamIndex, Me, NewBTLParam)
|
|
m_QParamList.Add(NewBTLParam)
|
|
ParamIndex += 1
|
|
End While
|
|
End Sub
|
|
|
|
' funzione che aggiorna lo stato e gli errori dopo calcolo
|
|
Friend Sub CalcFeatureUpdate(bCalc As Boolean, ERR As Integer, ROT As Integer, FALL As Integer, MSG As String)
|
|
If Not bCalc Then
|
|
m_nState = CalcStates.NOTCALCULATED
|
|
m_nCALC_ERR = 0
|
|
m_nCALC_ROT = 0
|
|
m_nCALC_FALL = 0
|
|
m_sCALC_MSG = ""
|
|
Else
|
|
m_nCALC_ERR = ERR
|
|
m_nCALC_ROT = ROT
|
|
m_nCALC_FALL = FALL
|
|
m_sCALC_MSG = MSG
|
|
If ERR = 0 Then
|
|
m_nState = 0
|
|
ElseIf ERR > 1 Then
|
|
m_nState = 1
|
|
ElseIf ERR < 1 Then
|
|
m_nState = -1
|
|
End If
|
|
End If
|
|
NotifyPropertyChanged("Calc_Background")
|
|
End Sub
|
|
|
|
' funzione che seleziona la feature nella geometria
|
|
Friend Shared Sub SelGeomFeature(Feature As BTLFeature)
|
|
EgtDeselectAll()
|
|
If Not IsNothing(Feature) Then EgtSelectObj(Feature.nFeatureId)
|
|
End Sub
|
|
Friend Sub SelGeomFeature()
|
|
EgtDeselectAll()
|
|
EgtSelectObj(nFeatureId)
|
|
End Sub
|
|
|
|
Public Overrides Function Copy() As Core.BTLFeature
|
|
' creo nuova feature
|
|
Dim vPar() As Double = Nothing
|
|
Dim sPar As String = String.Empty
|
|
Me.CalcParamArray(vPar, sPar)
|
|
' aggiorno la feature con nuovo valore
|
|
EgtBeamSetPart(Me.ParentPart.nPartId)
|
|
Dim nNewFeatureId As Integer = EgtBeamAddProcess(Me.nSelGRP, Me.nPRC, Me.nSelSIDE, Me.sDES, Me.ParentPart.NewProcId(), Me.frFRAME, vPar, sPar)
|
|
' se è stata creata
|
|
If nNewFeatureId <> GDB_ID.NULL Then
|
|
Dim NewFeat As New BTLFeature(Me.ParentPart, nNewFeatureId)
|
|
' la aggiungo a struttura BTL corrente
|
|
Me.ParentPart.FeatureList.Add(NewFeat)
|
|
Return NewFeat
|
|
End If
|
|
Return Nothing
|
|
End Function
|
|
|
|
Public Overrides Function Copy(DestBTLPart As Core.BTLPart) As Boolean
|
|
' creo nuova feature
|
|
Dim vPar() As Double
|
|
Dim sPar As String = String.Empty
|
|
Me.CalcParamArray(vPar, sPar)
|
|
' aggiorno la feature con nuovo valore
|
|
EgtBeamSetPart(DestBTLPart.nPartId)
|
|
Dim nNewFeatureId As Integer = EgtBeamAddProcess(Me.nSelGRP, Me.nPRC, Me.nSelSIDE, Me.sDES, DestBTLPart.NewProcId(), Me.frFRAME, vPar, sPar)
|
|
' se è stata creata
|
|
If nNewFeatureId <> GDB_ID.NULL Then
|
|
Dim NewFeat As New BTLFeature(Me.ParentPart, nNewFeatureId)
|
|
' la aggiungo a struttura BTL pezzo di destinazione
|
|
DestBTLPart.FeatureList.Add(NewFeat)
|
|
Return True
|
|
End If
|
|
Return False
|
|
End Function
|
|
|
|
#Region "COMMANDS"
|
|
|
|
#Region "DeleteFeature"
|
|
|
|
Public ReadOnly Property DeleteFeature_Command As ICommand
|
|
Get
|
|
If m_cmdDeleteFeature Is Nothing Then
|
|
m_cmdDeleteFeature = New Command(AddressOf DeleteFeature)
|
|
End If
|
|
Return m_cmdDeleteFeature
|
|
End Get
|
|
End Property
|
|
|
|
Public Sub DeleteFeature()
|
|
If Map.refMainMenuVM.SelPage = Pages.VIEW Then Map.refLeftPanelVM.RemoveFeature()
|
|
End Sub
|
|
|
|
#End Region ' DeleteFeature
|
|
|
|
#End Region ' COMMANDS
|
|
|
|
End Class
|
|
|
|
Public Class BTLParam
|
|
Inherits Core.BTLParam
|
|
|
|
' parametri da struttura
|
|
Public ReadOnly Property sMin As String
|
|
Get
|
|
Select Case nType
|
|
Case BTLParamType.DOUBLE_
|
|
Return DoubleToString(m_dMin, 3)
|
|
Case BTLParamType.LENGTH
|
|
Return LenToString(m_dMin, 3)
|
|
Case Else
|
|
Return ""
|
|
End Select
|
|
End Get
|
|
End Property
|
|
|
|
Public ReadOnly Property sMax As String
|
|
Get
|
|
Select Case nType
|
|
Case BTLParamType.DOUBLE_
|
|
Return DoubleToString(m_dMax, 3)
|
|
Case BTLParamType.LENGTH
|
|
Return LenToString(m_dMax, 3)
|
|
Case Else
|
|
Return ""
|
|
End Select
|
|
End Get
|
|
End Property
|
|
|
|
' parametri da geometria
|
|
Public Overrides Property sValue As String
|
|
Get
|
|
Select Case nType
|
|
Case BTLParamType.DOUBLE_
|
|
Return DoubleToString(m_dValue, 3)
|
|
Case BTLParamType.LENGTH
|
|
Return LenToString(m_dValue, 3)
|
|
Case Else ' stringhe
|
|
Return m_sValue
|
|
End Select
|
|
Return If(nType = BTLParamType.LENGTH, LenToString(m_dValue, 3), DoubleToString(m_dValue, 3))
|
|
End Get
|
|
Set(value As String)
|
|
Dim dNewValue As Double
|
|
' trasformo valori
|
|
Select Case nType
|
|
Case BTLParamType.DOUBLE_
|
|
StringToDouble(value, dNewValue)
|
|
Case BTLParamType.LENGTH
|
|
StringToLen(value, dNewValue)
|
|
Case Else
|
|
' per string non faccio nulla
|
|
End Select
|
|
' verifico che sia compreso tra minimo e massimo
|
|
If dNewValue < m_dMin OrElse dNewValue > m_dMax Then
|
|
MessageBox.Show("Valore non compreso tra minimo e massimo", "Error")
|
|
NotifyPropertyChanged("sValue")
|
|
Return
|
|
End If
|
|
Select Case nType
|
|
Case BTLParamType.DOUBLE_, BTLParamType.LENGTH
|
|
UpdateParamValue(dNewValue, "")
|
|
Case Else
|
|
UpdateParamValue(0, value)
|
|
End Select
|
|
End Set
|
|
End Property
|
|
Public Overrides Property dValue As Double
|
|
Get
|
|
Return m_dValue
|
|
End Get
|
|
Set(value As Double)
|
|
m_dValue = value
|
|
NotifyPropertyChanged("sValue")
|
|
End Set
|
|
End Property
|
|
|
|
Public ReadOnly Property sDefault As String
|
|
Get
|
|
Select Case nType
|
|
Case BTLParamType.DOUBLE_
|
|
Return DoubleToString(m_dDefault, 3)
|
|
Case BTLParamType.LENGTH
|
|
Return LenToString(m_dDefault, 3)
|
|
Case Else
|
|
Return ""
|
|
End Select
|
|
End Get
|
|
End Property
|
|
|
|
Public ReadOnly Property sDrawPath As String
|
|
Get
|
|
Return Map.refMainWindowVM.MainWindowM.sResourcesRoot & "\Parameters\" & DirectCast(m_ParentFeature, BTLFeature).sDescGRP & "_" & m_sName & "_" & m_ParentFeature.nSelGRP & ".gif"
|
|
End Get
|
|
End Property
|
|
|
|
' new per double e length
|
|
Sub New(ParentFeature As BTLFeature, IsP As Boolean, nType As BTLParamType, sParamName As String, dMin As Double, dMax As Double, dDefault As Double, sDescription As String)
|
|
MyBase.New(ParentFeature, IsP, nType, sParamName, dMin, dMax, dDefault, sDescription)
|
|
End Sub
|
|
|
|
' new per stringhe
|
|
Sub New(ParentFeature As BTLFeature, IsP As Boolean, nType As BTLParamType, sParamName As String, sDescription As String)
|
|
MyBase.New(ParentFeature, IsP, nType, sParamName, sDescription)
|
|
End Sub
|
|
|
|
' new per combobox
|
|
Sub New(ParentFeature As BTLFeature, IsP As Boolean, nType As BTLParamType, sParamName As String, nMin As Integer, nMax As Integer, nDefault As Integer, sDescription As String, ValueList As List(Of String))
|
|
MyBase.New(ParentFeature, IsP, nType, sParamName, nMin, nMax, nDefault, sDescription, ValueList)
|
|
End Sub
|
|
|
|
' new per parametro vuoto
|
|
Sub New(IsP As Boolean, nType As BTLParamType, sParamName As String)
|
|
MyBase.New(IsP, nType, sParamName)
|
|
End Sub
|
|
|
|
Friend Sub UpdateParamValue(dNewValue As Double, sNewValue As String, Optional bDraw As Boolean = True)
|
|
' se P
|
|
If bIsP Then
|
|
' aggiorno la feature con nuovo valore
|
|
Dim vPar() As Double = Nothing
|
|
Dim sPar As String = String.Empty
|
|
ParentFeature.CalcParamArray(vPar, sPar)
|
|
' modifico parametro cambiato con value
|
|
Select Case nType
|
|
Case BTLParamType.DOUBLE_, BTLParamType.LENGTH
|
|
vPar(Me.nId - 1) = dNewValue
|
|
Case BTLParamType.STRING_
|
|
sPar = sNewValue
|
|
End Select
|
|
Dim bOK As Boolean = ParentFeature.UpdateParams(ParentFeature.nSelGRP, ParentFeature.nPRC, ParentFeature.nSelSIDE, ParentFeature.sDES,
|
|
ParentFeature.nPRID, ParentFeature.frFRAME, vPar, sPar)
|
|
If bOK Then
|
|
Select Case nType
|
|
Case BTLParamType.DOUBLE_, BTLParamType.LENGTH
|
|
m_dValue = dNewValue
|
|
Case BTLParamType.STRING_
|
|
m_sValue = sNewValue
|
|
End Select
|
|
' riseleziono questa feature
|
|
DirectCast(ParentFeature, BTLFeature).SelGeomFeature()
|
|
' rendo non calcolata questa feature
|
|
DirectCast(ParentFeature, BTLFeature).CalcFeatureUpdate(False, 0, 0, 0, "")
|
|
' ed aggiorno stato pezzo
|
|
DirectCast(ParentFeature.ParentPart, BTLPart).CalcFeatureUpdate()
|
|
Else
|
|
NotifyPropertyChanged("sValue")
|
|
End If
|
|
If bDraw Then EgtDraw()
|
|
Else
|
|
' se Q
|
|
If EgtSetInfo(ParentFeature.nFeatureId, "Q" & Me.nId.ToString("D2"), dNewValue) Then
|
|
m_dValue = dNewValue
|
|
' imposto modificato per copie
|
|
EgtDuploSetModified(ParentFeature.ParentPart.nPartId)
|
|
End If
|
|
End If
|
|
End Sub
|
|
|
|
End Class
|
|
|
|
'Friend Class BTLParamDouble
|
|
' Inherits BTLParam
|
|
|
|
|
|
|
|
' Private m_dDefault As Double
|
|
' Friend ReadOnly Property dDefault As Double
|
|
' Get
|
|
' Return m_dDefault
|
|
' End Get
|
|
' End Property
|
|
|
|
|
|
'End Class
|
|
|
|
'Friend Class BTLParamString
|
|
' Inherits BTLParam
|
|
|
|
' ' parametri da geometria
|
|
' Private m_sValue As String
|
|
' Public Property sValue As String
|
|
' Get
|
|
' Return m_sValue
|
|
' End Get
|
|
' Set(value As String)
|
|
' m_sValue = value
|
|
' 'EgtSetPParam(m_nFeatureId, m_sName, value)
|
|
' EgtDraw()
|
|
' End Set
|
|
' End Property
|
|
|
|
' Sub New(ParentFeature As BTLFeature, IsP As Boolean, nType As BTLParamType, sParamName As String, sDescription As String)
|
|
' MyBase.New(ParentFeature, IsP, nType, sParamName, sDescription)
|
|
' End Sub
|
|
|
|
'End Class
|
|
|
|
'Friend Class BTLParamCombo
|
|
' Inherits BTLParam
|
|
|
|
' ' parametri da struttura
|
|
' Dim m_nMin As Integer
|
|
' Dim m_nMax As Integer
|
|
|
|
' Dim m_ValueList As List(Of String)
|
|
|
|
' ' parametri da geometria
|
|
' Private m_nSelValue As Integer
|
|
' Public Property nSelValue As Integer
|
|
' Get
|
|
' Return m_nSelValue
|
|
' End Get
|
|
' Set(value As Integer)
|
|
' m_nSelValue = value
|
|
' End Set
|
|
' End Property
|
|
|
|
' Private m_nDefault As Integer
|
|
' Friend ReadOnly Property nDefault As Integer
|
|
' Get
|
|
' Return m_nDefault
|
|
' End Get
|
|
' End Property
|
|
' Sub New(ParentFeature As BTLFeature, IsP As Boolean, nType As BTLParamType, sParamName As String, nMin As Integer, nMax As Integer, nDefault As Integer, sDescription As String, ValueList As List(Of String))
|
|
' MyBase.New(ParentFeature, IsP, nType, sParamName, sDescription)
|
|
' m_nMin = nMin
|
|
' m_nMax = nMax
|
|
' m_nDefault = nDefault
|
|
' m_ValueList = ValueList
|
|
' End Sub
|
|
|
|
'End Class
|
|
|
|
Friend Class BTLRawPart
|
|
|
|
End Class
|