Modifiche che non funzionano

This commit is contained in:
Emmanuele Sassi
2021-03-31 18:37:07 +02:00
parent 07908aad27
commit e279ad25df
44 changed files with 1430 additions and 758 deletions
+4 -2
View File
@@ -73,8 +73,10 @@
<ItemGroup>
<Compile Include="Beam.vb" />
<Compile Include="BeamMachGroup.vb" />
<Compile Include="Model\BTLFeature.vb" />
<Compile Include="Model\BTLParam.vb" />
<Compile Include="Model\BTLParamAddedEventArgs.vb" />
<Compile Include="Model\BTLFeatureM.vb" />
<Compile Include="Model\BTLParamM.vb" />
<Compile Include="Model\BTLFeatureAddedEventArgs.vb" />
<Compile Include="Model\BTLPartAddedEventArgs.vb" />
<Compile Include="Model\BTLPartM.vb" />
<Compile Include="Model\BTLStructureM.vb" />
@@ -0,0 +1,18 @@
Public Class BTLFeatureAddedEventArgs
Inherits EventArgs
Public m_NewBTLFeature As BTLFeatureM
Public Property NewBTLFeature As BTLFeatureM
Get
Return m_NewBTLFeature
End Get
Private Set(value As BTLFeatureM)
m_NewBTLFeature = value
End Set
End Property
Sub New(NewBTLFeature As BTLFeatureM)
Me.NewBTLFeature = NewBTLFeature
End Sub
End Class
@@ -5,8 +5,7 @@ Imports System.Windows.Media
Imports EgtUILib
Imports EgtWPFLib5
Public Class BTLFeature
Inherits VMBase
Public Class BTLFeatureM
' Feature a cui appartiene il parametro
Protected m_ParentPart As BTLPartM
@@ -47,6 +46,18 @@ Public Class BTLFeature
m_nSelGRP = value
End Set
End Property
Public ReadOnly Property sDescGRP As String
Get
Dim sDescConstruction As String = String.Empty
If CalcBeamPrivateProfileGRP(nSelGRP) = 0 Then
sDescConstruction = "L"
Else
sDescConstruction = "T"
End If
sDescConstruction &= nPRC.ToString("000")
Return sDescConstruction
End Get
End Property
' Processo
Protected m_nPRC As Integer
@@ -131,79 +142,74 @@ Public Class BTLFeature
End Property
Protected m_nState As CalcStates = -1
Public ReadOnly Property nState As CalcStates
Public Property nState As CalcStates
Get
Return m_nState
End Get
Set(value As CalcStates)
m_nState = value
End Set
End Property
Protected m_nCALC_ERR As Integer = -1
Public ReadOnly Property nCALC_ERR As Integer
Public Property nCALC_ERR As Integer
Get
Return m_nCALC_ERR
End Get
Set(value As Integer)
m_nCALC_ERR = value
End Set
End Property
Protected m_nCALC_ROT As Integer
Public ReadOnly Property nCALC_ROT As Integer
Public Property nCALC_ROT As Integer
Get
Return m_nCALC_ROT
End Get
Set(value As Integer)
m_nCALC_ROT = value
End Set
End Property
Protected m_nCALC_FALL As Integer
Public ReadOnly Property nCALC_FALL As Integer
Public Property nCALC_FALL As Integer
Get
Return m_nCALC_FALL
End Get
Set(value As Integer)
m_nCALC_FALL = value
End Set
End Property
Protected m_sCALC_MSG As String
Public ReadOnly Property nCALC_MSG As String
Public Property sCALC_MSG As String
Get
Return m_sCALC_MSG
End Get
End Property
' lista dei parametri della feature
Protected m_PParamList As ObservableCollection(Of BTLParam)
Public Property PParamList As ObservableCollection(Of BTLParam)
Get
Return m_PParamList
End Get
Set(value As ObservableCollection(Of BTLParam))
m_PParamList = value
End Set
End Property
Protected m_SelPParam As BTLParam
Public Overridable Property SelPParam As BTLParam
Get
Return m_SelPParam
End Get
Set(value As BTLParam)
m_SelPParam = value
Set(value As String)
m_sCALC_MSG = value
End Set
End Property
' lista dei parametri della feature
Protected m_QParamList As ObservableCollection(Of BTLParam)
Public Property QParamList As ObservableCollection(Of BTLParam)
Protected m_PBTLParamMList As List(Of BTLParamM)
Public Property PBTLParamMList As List(Of BTLParamM)
Get
Return m_QParamList
Return m_PBTLParamMList
End Get
Set(value As ObservableCollection(Of BTLParam))
m_QParamList = value
Set(value As List(Of BTLParamM))
m_PBTLParamMList = value
End Set
End Property
Protected m_SelQParam As BTLParam
Public Overridable Property SelQParam As BTLParam
' lista dei parametri della feature
Protected m_QBTLParamMList As List(Of BTLParamM)
Public Property QBTLParamMList As List(Of BTLParamM)
Get
Return m_SelQParam
Return m_QBTLParamMList
End Get
Set(value As BTLParam)
m_SelQParam = value
Set(value As List(Of BTLParamM))
m_QBTLParamMList = value
End Set
End Property
@@ -235,46 +241,156 @@ Public Class BTLFeature
#End Region
Sub New(ParentPart As BTLPartM, nFeatureId As Integer)
m_ParentPart = ParentPart
m_nFeatureId = nFeatureId
m_PParamList = New ObservableCollection(Of BTLParam)
m_QParamList = New ObservableCollection(Of BTLParam)
#Region "CONSTRUCTOR"
Protected Sub New()
End Sub
Sub New(nPRC As Integer, nGRP As Integer, nSIDE As Integer)
m_PParamList = New ObservableCollection(Of BTLParam)
m_QParamList = New ObservableCollection(Of BTLParam)
m_nPRC = nPRC
m_nSelGRP = nGRP
m_nSelSIDE = nSIDE
m_bDO = True
Public Shared Function CreateNewBTLFeature() As BTLFeatureM
Return New BTLFeatureM
End Function
Public Shared Function CreateBTLFeature(ParentPart As BTLPartM, nFeatureId As Integer) As BTLFeatureM
Dim NewBTLFeature As New BTLFeatureM
NewBTLFeature.m_ParentPart = ParentPart
NewBTLFeature.m_nFeatureId = nFeatureId
' leggo gruppo, numero feature e lato
EgtGetInfo(nFeatureId, BTL_FTR_GRP, NewBTLFeature.nSelGRP)
EgtGetInfo(nFeatureId, BTL_FTR_PRC, NewBTLFeature.nPRC)
EgtGetInfo(nFeatureId, BTL_FTR_SIDE, NewBTLFeature.nSelSIDE)
Dim nDO As Integer = 1
If EgtGetInfo(nFeatureId, BTL_FTR_DO, nDO) Then
NewBTLFeature.bDO = (nDO <> 0)
Else
NewBTLFeature.bDO = True
End If
' leggo des,prid e frame
EgtGetInfo(nFeatureId, BTL_FTR_DES, NewBTLFeature.sDES)
EgtGetInfo(nFeatureId, BTL_FTR_PRID, NewBTLFeature.nPRID)
EgtGetInfo(nFeatureId, BTL_FTR_FRAME, NewBTLFeature.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(NewBTLFeature.nFeatureId, ITG_PROJ_ERR, nErr)
EgtGetInfo(nFeatureId, ITG_PROJ_ROT, nRot)
EgtGetInfo(nFeatureId, ITG_PROJ_FALL, nFall)
EgtGetInfo(nFeatureId, ITG_PROJ_MSG, sMsg)
If Not bCalc Then
NewBTLFeature.nState = CalcStates.NOTCALCULATED
NewBTLFeature.nCALC_ERR = 0
NewBTLFeature.nCALC_ROT = 0
NewBTLFeature.nCALC_FALL = 0
NewBTLFeature.sCALC_MSG = ""
Else
NewBTLFeature.nCALC_ERR = nErr
NewBTLFeature.nCALC_ROT = nRot
NewBTLFeature.nCALC_FALL = nFall
NewBTLFeature.sCALC_MSG = sMsg
If nErr = 0 Then
NewBTLFeature.nState = 0
ElseIf nErr > 1 Then
NewBTLFeature.nState = 1
ElseIf nErr < 1 Then
NewBTLFeature.nState = -1
End If
End If
' leggo parametri della feature
GetBeamPrivateProfileGRPList(CalcBeamPrivateProfileGRP(NewBTLFeature.nSelGRP), NewBTLFeature.nPRC, NewBTLFeature.GRPList)
GetBeamPrivateProfileName(NewBTLFeature.nSelGRP, NewBTLFeature.nPRC, NewBTLFeature)
' crea parametri per questa feature da file ini
NewBTLFeature.CreateFeatureParams(NewBTLFeature)
' leggo parametri delle feature
NewBTLFeature.ReadFeatureParams()
Return NewBTLFeature
End Function
Public Shared Function CreateBTLFeature(nPRC As Integer, nGRP As Integer, nSIDE As Integer) As BTLFeatureM
Dim NewBTLFeature As New BTLFeatureM
NewBTLFeature.nPRC = nPRC
NewBTLFeature.nSelGRP = nGRP
NewBTLFeature.nSelSIDE = nSIDE
NewBTLFeature.bDO = True
' crea parametri per questa feature da file ini
NewBTLFeature.CreateFeatureParams(NewBTLFeature)
Return NewBTLFeature
End Function
'Sub New(ParentPart As BTLPartM, nFeatureId As Integer)
' m_ParentPart = ParentPart
' m_nFeatureId = nFeatureId
' m_PParamList = New ObservableCollection(Of BTLParam)
' m_QParamList = New ObservableCollection(Of BTLParam)
'End Sub
'Sub New(nPRC As Integer, nGRP As Integer, nSIDE As Integer)
' m_PParamList = New ObservableCollection(Of BTLParam)
' m_QParamList = New ObservableCollection(Of BTLParam)
' m_nPRC = nPRC
' m_nSelGRP = nGRP
' m_nSelSIDE = nSIDE
' m_bDO = True
'End Sub
#End Region ' CONSTRUCTOR
#Region "METHODS"
Public Event PBTLParamAdded As EventHandler(Of BTLParamAddedEventArgs)
Public Event QBTLParamAdded As EventHandler(Of BTLParamAddedEventArgs)
Public Sub AddPBTLParam(BTLparamM As BTLParamM)
If IsNothing(BTLparamM) Then Return
If Not m_PBTLParamMList.Contains(BTLparamM) Then
m_PBTLParamMList.Add(BTLparamM)
RaiseEvent PBTLParamAdded(Me, New BTLParamAddedEventArgs(BTLparamM))
End If
End Sub
Public Sub AddQBTLParam(BTLparamM As BTLParamM)
If IsNothing(BTLparamM) Then Return
If Not m_QBTLParamMList.Contains(BTLparamM) Then
m_QBTLParamMList.Add(BTLparamM)
RaiseEvent QBTLParamAdded(Me, New BTLParamAddedEventArgs(BTLparamM))
End If
End Sub
Public Function GetPBTLParams() As List(Of BTLParamM)
Return New List(Of BTLParamM)(m_PBTLParamMList)
End Function
Public Function GetQBTLParams() As List(Of BTLParamM)
Return New List(Of BTLParamM)(m_QBTLParamMList)
End Function
' funzione che crea l'elenco dei parametri
Public Overridable Sub CreateFeatureParams()
Public Sub CreateFeatureParams(NewBTLFeature As BTLFeatureM)
Dim ParamIndex As Integer = 1
Dim NewBTLParam As BTLParam = Nothing
Dim TempList As New List(Of BTLParamM)
Dim NewBTLParam As BTLParamM = Nothing
' leggo tutti i P della feature
While BTLIniFile.GetBeamPrivateProfileParam(m_nSelGRP, m_nPRC, True, ParamIndex, Me, NewBTLParam)
m_PParamList.Add(NewBTLParam)
TempList.Add(NewBTLParam)
ParamIndex += 1
End While
NewBTLFeature.PBTLParamMList = TempList
' leggo tutti i Q della feature
ParamIndex = 1
TempList = New List(Of BTLParamM)
While BTLIniFile.GetBeamPrivateProfileParam(m_nSelGRP, m_nPRC, False, ParamIndex, Me, NewBTLParam)
m_QParamList.Add(NewBTLParam)
TempList.Add(NewBTLParam)
ParamIndex += 1
End While
NewBTLFeature.QBTLParamMList = TempList
End Sub
' funzione che legge il valore corrente del parametro
Public Function ReadFeatureParams() As Boolean
Return ReadFeatureParams(PParamList) And ReadFeatureParams(QParamList)
Return ReadFeatureParams(m_PBTLParamMList) And ReadFeatureParams(m_QBTLParamMList)
End Function
Private Function ReadFeatureParams(ParamList As ObservableCollection(Of Core.BTLParam)) As Boolean
Private Function ReadFeatureParams(ParamList As List(Of BTLParamM)) As Boolean
' leggo valore parametro da struttura geometrica
For Each Param As BTLParam In ParamList
For Each Param As BTLParamM In ParamList
If Param.nType = BTLParamType.DOUBLE_ Or Param.nType = BTLParamType.LENGTH Then
Dim dParamValue As Double = 0
If Not EgtGetInfo(m_nFeatureId, Param.sName, dParamValue) Then
@@ -296,11 +412,11 @@ Public Class BTLFeature
' funzione che setta i valori di default a tutti i parametri
Public Function SetDefaultValues() As Boolean
Return SetDefaultValues(PParamList) And SetDefaultValues(QParamList)
Return SetDefaultValues(m_PBTLParamMList) And SetDefaultValues(m_QBTLParamMList)
End Function
Private Function SetDefaultValues(ParamList As ObservableCollection(Of Core.BTLParam)) As Boolean
Private Function SetDefaultValues(ParamList As List(Of Core.BTLParamM)) As Boolean
' leggo valore parametro da struttura geometrica
For Each Param As BTLParam In ParamList
For Each Param As BTLParamM In ParamList
If Param.nType = BTLParamType.DOUBLE_ Or Param.nType = BTLParamType.LENGTH Then
Param.dValue = Param.dDefault
ElseIf Param.nType = BTLParamType.STRING_ Then
@@ -315,14 +431,14 @@ Public Class BTLFeature
' funzione che calcola array dei valori dei parametri
Public Function CalcParamArray(ByRef vPar() As Double, ByRef sPar As String) As Boolean
' verifico che lista parametri non sia vuota
If IsNothing(m_PParamList) OrElse m_PParamList.Count = 0 Then Return False
If IsNothing(m_PBTLParamMList) OrElse m_PBTLParamMList.Count = 0 Then Return False
' caclcolo lunghezza array
Dim nLastParId As Integer = m_PParamList(m_PParamList.Count - 1).nId - 1
Dim nLastParId As Integer = m_PBTLParamMList(m_PBTLParamMList.Count - 1).nId - 1
Dim vTempPar(nLastParId) As Double
Dim sTempPar As String = String.Empty
' carico tutti i parametri su array
For ParIndex = 0 To m_PParamList.Count - 1
Dim BTLPar As BTLParam = DirectCast(m_PParamList(ParIndex), BTLParam)
For ParIndex = 0 To m_PBTLParamMList.Count - 1
Dim BTLPar As BTLParamM = DirectCast(m_PBTLParamMList(ParIndex), BTLParamM)
Select Case BTLPar.nType
Case BTLParamType.DOUBLE_, BTLParamType.LENGTH
vTempPar(BTLPar.nId - 1) = BTLPar.dValue
@@ -342,42 +458,6 @@ Public Class BTLFeature
Return True
End Function
Public Overridable Function Copy() As 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 Overridable Function Copy(DestBTLPart As BTLPartM) 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
' funzione che aggiorna parametri della feature
Public Function UpdateParams(nNewGRP As Integer, nNewPRC As Integer, nNewSIDE As Integer, sNewDesc As String, nNewProcId As Integer,
frNewRef As Frame3d, vNewPar() As Double, sNewPar As String) As Boolean
@@ -405,5 +485,7 @@ Public Class BTLFeature
Return m_nPRC = 250 OrElse m_nPRC = 251 OrElse m_nPRC = 252
End Function
#End Region ' METHODS
End Class
-187
View File
@@ -1,187 +0,0 @@
Imports System.Collections.ObjectModel
Imports System.Windows
Imports System.Windows.Input
Imports System.Windows.Media
Imports EgtUILib
Imports EgtWPFLib5
Public Class BTLParam
Inherits VMBase
' parametro che dice se il parametro e' P o Q
Protected m_bIsP As Boolean = True
Public ReadOnly Property bIsP As Boolean
Get
Return m_bIsP
End Get
End Property
' parametri da struttura
Protected m_sName As String
Public Property sName As String
Get
Return m_sName
End Get
Set(value As String)
m_sName = value
End Set
End Property
Protected m_nId As Integer
Public ReadOnly Property nId As Integer
Get
Return m_nId
End Get
End Property
Protected m_sDescription As String
Public Property sDescription As String
Get
Return m_sDescription
End Get
Set(value As String)
m_sDescription = value
End Set
End Property
' parametri da struttura
Protected m_dMin As Double
Protected m_dMax As Double
Protected m_ValueList As List(Of String)
Public ReadOnly Property ValueList As List(Of String)
Get
Return m_ValueList
End Get
End Property
' parametri da geometria
Protected m_dValue As Double
Protected m_sValue As String
Public Overridable Property sValue As String
Get
Return m_sValue
End Get
Set(value As String)
m_sValue = value
End Set
End Property
Public Overridable Property dValue As Double
Get
Return m_dValue
End Get
Set(value As Double)
m_dValue = value
End Set
End Property
Protected 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
Protected m_dDefault As Double
Public ReadOnly Property dDefault As Double
Get
Return m_dDefault
End Get
End Property
Protected m_sDrawPath As String
' tipo della variabile
Protected m_nType As BTLParamType
Public ReadOnly Property nType As BTLParamType
Get
Return m_nType
End Get
End Property
' Feature a cui appartiene il parametro
Protected m_ParentFeature As BTLFeature
Public ReadOnly Property ParentFeature As BTLFeature
Get
Return m_ParentFeature
End Get
End Property
#Region "MESSAGES"
Public ReadOnly Property Name_Msg As String
Get
Return EgtMsg(61614)
End Get
End Property
Public ReadOnly Property Value_Msg As String
Get
Return EgtMsg(61615)
End Get
End Property
Public ReadOnly Property Min_Msg As String
Get
Return EgtMsg(61616)
End Get
End Property
Public ReadOnly Property Max_Msg As String
Get
Return EgtMsg(61617)
End Get
End Property
#End Region
Public Sub StdInit(ParentFeature As BTLFeature, IsP As Boolean, Type As BTLParamType, sName As String, sDescription As String)
m_ParentFeature = ParentFeature
m_bIsP = IsP
m_nType = Type
m_sName = sName
Dim nDescription As Integer
If IsNumeric(sDescription) AndAlso Integer.TryParse(sDescription, nDescription) Then
m_sDescription = EgtMsg(sDescription)
Else
m_sDescription = sDescription
End If
If Not String.IsNullOrWhiteSpace(sName) Then
Dim sId As String = sName.Trim({"P"c, "Q"c, "p"c, "q"c})
Integer.TryParse(sId, m_nId)
End If
End Sub
' 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)
StdInit(ParentFeature, IsP, nType, sParamName, sDescription)
m_dMin = dMin
m_dMax = dMax
m_dDefault = dDefault
End Sub
' new per stringhe
Sub New(ParentFeature As BTLFeature, IsP As Boolean, nType As BTLParamType, sParamName As String, sDescription As String)
StdInit(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))
StdInit(ParentFeature, IsP, nType, sParamName, sDescription)
m_dMin = nMin
m_dMax = nMax
m_dDefault = nDefault
m_ValueList = ValueList
End Sub
' new per parametro vuoto
Sub New(IsP As Boolean, nType As BTLParamType, sParamName As String)
StdInit(Nothing, IsP, nType, sParamName, "")
End Sub
End Class
@@ -0,0 +1,18 @@
Public Class BTLParamAddedEventArgs
Inherits EventArgs
Public m_NewBTLParam As BTLParamM
Public Property NewBTLParam As BTLParamM
Get
Return m_NewBTLParam
End Get
Private Set(value As BTLParamM)
m_NewBTLParam = value
End Set
End Property
Sub New(NewBTLParam As BTLParamM)
Me.NewBTLParam = NewBTLParam
End Sub
End Class
+253
View File
@@ -0,0 +1,253 @@
Imports System.Collections.ObjectModel
Imports System.Windows
Imports System.Windows.Input
Imports System.Windows.Media
Imports EgtUILib
Imports EgtWPFLib5
Public Class BTLParamM
' parametro che dice se il parametro e' P o Q
Protected m_bIsP As Boolean = True
Public ReadOnly Property bIsP As Boolean
Get
Return m_bIsP
End Get
End Property
' parametri da struttura
Protected m_sName As String
Public Property sName As String
Get
Return m_sName
End Get
Set(value As String)
m_sName = value
End Set
End Property
Protected m_nId As Integer
Public ReadOnly Property nId As Integer
Get
Return m_nId
End Get
End Property
Protected m_sDescription As String
Public Property sDescription As String
Get
Return m_sDescription
End Get
Set(value As String)
m_sDescription = value
End Set
End Property
' parametri da struttura
Protected m_dMin As Double
Public Property dMin As Double
Get
Return m_dMin
End Get
Set(value As Double)
m_dMin = value
End Set
End Property
Protected m_dMax As Double
Public Property dMax As Double
Get
Return m_dMax
End Get
Set(value As Double)
m_dMax = value
End Set
End Property
Protected m_ValueList As List(Of String)
Public ReadOnly Property ValueList As List(Of String)
Get
Return m_ValueList
End Get
End Property
' parametri da geometria
Protected m_dValue As Double
Public Overridable Property dValue As Double
Get
Return m_dValue
End Get
Set(value As Double)
m_dValue = value
End Set
End Property
Protected m_sValue As String
Public Overridable Property sValue As String
Get
Return m_sValue
End Get
Set(value As String)
m_sValue = value
End Set
End Property
Protected 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
Protected m_dDefault As Double
Public ReadOnly Property dDefault As Double
Get
Return m_dDefault
End Get
End Property
' tipo della variabile
Protected m_nType As BTLParamType
Public ReadOnly Property nType As BTLParamType
Get
Return m_nType
End Get
End Property
' Feature a cui appartiene il parametro
Protected m_ParentFeature As BTLFeatureM
Public ReadOnly Property ParentFeature As BTLFeatureM
Get
Return m_ParentFeature
End Get
End Property
#Region "MESSAGES"
Public ReadOnly Property Name_Msg As String
Get
Return EgtMsg(61614)
End Get
End Property
Public ReadOnly Property Value_Msg As String
Get
Return EgtMsg(61615)
End Get
End Property
Public ReadOnly Property Min_Msg As String
Get
Return EgtMsg(61616)
End Get
End Property
Public ReadOnly Property Max_Msg As String
Get
Return EgtMsg(61617)
End Get
End Property
#End Region
Public Sub StdInit(ParentFeature As BTLFeatureM, IsP As Boolean, Type As BTLParamType, sName As String, sDescription As String)
m_ParentFeature = ParentFeature
m_bIsP = IsP
m_nType = Type
m_sName = sName
Dim nDescription As Integer
If IsNumeric(sDescription) AndAlso Integer.TryParse(sDescription, nDescription) Then
m_sDescription = EgtMsg(sDescription)
Else
m_sDescription = sDescription
End If
If Not String.IsNullOrWhiteSpace(sName) Then
Dim sId As String = sName.Trim({"P"c, "Q"c, "p"c, "q"c})
Integer.TryParse(sId, m_nId)
End If
End Sub
#Region "CONSTRUCTOR"
Protected Sub New()
End Sub
Public Shared Function CreateNewBTLParam() As BTLParamM
Return New BTLParamM
End Function
' new per double e length
Public Shared Function CreateBTLParam(ParentFeature As BTLFeatureM, IsP As Boolean, nType As BTLParamType, sParamName As String,
dMin As Double, dMax As Double, dDefault As Double, sDescription As String) As BTLParamM
Dim NewBTLParam As New BTLParamM
NewBTLParam.StdInit(ParentFeature, IsP, nType, sParamName, sDescription)
NewBTLParam.dMin = dMin
NewBTLParam.dMax = dMax
NewBTLParam.m_dDefault = dDefault
Return NewBTLParam
End Function
' new per stringhe
Public Shared Function CreateBTLParam(ParentFeature As BTLFeatureM, IsP As Boolean, nType As BTLParamType, sParamName As String, sDescription As String)
Dim NewBTLParam As New BTLParamM
NewBTLParam.StdInit(ParentFeature, IsP, nType, sParamName, sDescription)
Return NewBTLParam
End Function
' new per combobox
Public Shared Function CreateBTLParam(ParentFeature As BTLFeatureM, 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))
Dim NewBTLParam As New BTLParamM
NewBTLParam.StdInit(ParentFeature, IsP, nType, sParamName, sDescription)
NewBTLParam.dMin = nMin
NewBTLParam.dMax = nMax
NewBTLParam.m_dDefault = nDefault
NewBTLParam.m_ValueList = ValueList
Return NewBTLParam
End Function
' new per parametro vuoto
Public Shared Function CreateBTLParam(IsP As Boolean, nType As BTLParamType, sParamName As String)
Dim NewBTLParam As New BTLParamM
NewBTLParam.StdInit(Nothing, IsP, nType, sParamName, "")
Return NewBTLParam
End Function
'' new per double e length
'Sub New(ParentFeature As BTLFeatureM, IsP As Boolean, nType As BTLParamType, sParamName As String, dMin As Double, dMax As Double, dDefault As Double, sDescription As String)
' StdInit(ParentFeature, IsP, nType, sParamName, sDescription)
' m_dMin = dMin
' m_dMax = dMax
' m_dDefault = dDefault
'End Sub
'' new per stringhe
'Sub New(ParentFeature As BTLFeatureM, IsP As Boolean, nType As BTLParamType, sParamName As String, sDescription As String)
' StdInit(ParentFeature, IsP, nType, sParamName, sDescription)
'End Sub
'' new per combobox
'Sub New(ParentFeature As BTLFeatureM, 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))
' StdInit(ParentFeature, IsP, nType, sParamName, sDescription)
' m_dMin = nMin
' m_dMax = nMax
' m_dDefault = nDefault
' m_ValueList = ValueList
'End Sub
'' new per parametro vuoto
'Sub New(IsP As Boolean, nType As BTLParamType, sParamName As String)
' StdInit(Nothing, IsP, nType, sParamName, "")
'End Sub
#End Region ' CONSTRUCTOR
#Region "METHODS"
#End Region ' METHODS
End Class
+65 -29
View File
@@ -169,7 +169,7 @@ Public Class BTLPartM
End Property
Public m_sMATERIAL As String
Public Overridable Property sMATERIAL As String
Public Property sMATERIAL As String
Get
Return m_sMATERIAL
End Get
@@ -649,13 +649,13 @@ Public Class BTLPartM
End Property
' lista delle feature del pezzo
Public m_FeatureList As ObservableCollection(Of BTLFeature)
Public Property FeatureList As ObservableCollection(Of BTLFeature)
Public m_BTLFeatureMList As List(Of BTLFeatureM)
Public Property BTLFeatureMList As List(Of BTLFeatureM)
Get
Return m_FeatureList
Return m_BTLFeatureMList
End Get
Set(value As ObservableCollection(Of BTLFeature))
m_FeatureList = value
Set(value As List(Of BTLFeatureM))
m_BTLFeatureMList = value
End Set
End Property
@@ -670,6 +670,7 @@ Public Class BTLPartM
Public Shared Function CreateBTLPart(nPartId As Integer) As BTLPartM
Dim NewBTLPart As New BTLPartM
NewBTLPart.m_nPartId = nPartId
' leggo info pezzo
Dim sValArray() As String
Dim sValue As String = String.Empty
@@ -813,13 +814,43 @@ Public Class BTLPartM
NewBTLPart.m_nINVERTED = 0
End If
If EgtGetInfo(nPartId, BTL_PRT_MATERIAL, NewBTLPart.m_sMATERIAL) Then
If Not ParentStructure.MaterialList.Contains(NewBTLPart.m_sMATERIAL) Then
ParentStructure.MaterialList.Add(NewBTLPart.m_sMATERIAL)
End If
' Leggo outline e features
NewBTLPart.m_BTLFeatureMList = LoadFeatures(nPartId, NewBTLPart)
' 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, nFall)
EgtGetInfo(nPartId, ITG_PROJ_MSG, sMsg)
If Not bCalc Then
NewBTLPart.nState = CalcStates.NOTCALCULATED
NewBTLPart.nCALC_ERR = -1
NewBTLPart.nCALC_ROT = 0
NewBTLPart.nCALC_FALL = 0
NewBTLPart.sCALC_MSG = ""
Else
NewBTLPart.nCALC_ERR = nErr
NewBTLPart.nCALC_ROT = nRot
NewBTLPart.nCALC_FALL = nFall
NewBTLPart.sCALC_MSG = sMsg
If nErr = 0 Then
NewBTLPart.nState = CalcStates.OK
ElseIf nErr > 1 Then
NewBTLPart.nState = CalcStates.ERROR_
ElseIf nErr < 1 Then
NewBTLPart.nState = CalcStates.NOTCALCULATED
End If
End If
If Not ParentStructure.SectionList.Contains(NewBTLPart.Section) Then
ParentStructure.SectionList.Add(NewBTLPart.Section)
End If
Return NewBTLPart
End Function
Private Shared Function LoadFeatures(nPartId As Integer, NewBTLPart As BTLPartM) As List(Of BTLFeatureM)
Dim TempList As New List(Of BTLFeatureM)
' Leggo outline
Dim nOutlineLayerId As Integer = EgtGetFirstNameInGroup(nPartId, OUTLINE)
Dim nOutlineId As Integer = EgtGetFirstInGroup(nOutlineLayerId)
@@ -828,7 +859,7 @@ Public Class BTLPartM
Dim nGRP As Integer
If EgtGetInfo(nOutlineId, BTL_FTR_GRP, nGRP) Then
' creo la feature
NewBTLPart.m_FeatureList.Add(New BTLFeatureVM(Me, nOutlineId))
TempList.Add(BTLFeatureM.CreateBTLFeature(NewBTLPart, nOutlineId))
End If
nOutlineId = EgtGetNext(nOutlineId)
End While
@@ -840,24 +871,11 @@ Public Class BTLPartM
Dim nGRP As Integer
If EgtGetInfo(nFeatureId, BTL_FTR_GRP, nGRP) Then
' creo la feature
NewBTLPart.m_FeatureList.Add(New BTLFeatureVM(Me, nFeatureId))
TempList.Add(BTLFeatureM.CreateBTLFeature(NewBTLPart, 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()
Return TempList
End Function
'Sub New(ParentStructure As BTLStructureVM, nPartId As Integer)
@@ -1053,13 +1071,31 @@ Public Class BTLPartM
#End Region ' CONSTRUCTOR
#Region "METHODS"
Public Event BTLFeatureAdded As EventHandler(Of BTLFeatureAddedEventArgs)
Public Sub AddBTLFeature(BTLFeatureM As BTLFeatureM)
If IsNothing(BTLFeatureM) Then Return
If Not m_BTLFeatureMList.Contains(BTLFeatureM) Then
m_BTLFeatureMList.Add(BTLFeatureM)
RaiseEvent BTLFeatureAdded(Me, New BTLFeatureAddedEventArgs(BTLFeatureM))
End If
End Sub
Public Function GetBTLFeatures() As List(Of BTLFeatureM)
Return New List(Of BTLFeatureM)(m_BTLFeatureMList)
End Function
Public Function NewProcId() As Integer
Dim nMaxProcId As Integer = 0
If Not IsNothing(Me.FeatureList) AndAlso Me.FeatureList.Count > 0 Then
nMaxProcId = Me.FeatureList.Max(Function(x) x.nPRID)
If Not IsNothing(BTLFeatureMList) AndAlso BTLFeatureMList.Count > 0 Then
nMaxProcId = BTLFeatureMList.Max(Function(x) x.nPRID)
End If
Return nMaxProcId + 1
End Function
#End Region ' METHODS
End Class
+14 -7
View File
@@ -11,7 +11,7 @@ Public Class BTLStructureM
End Property
' pezzi da BTL
Public m_BTLPartMList As New List(Of BTLPartM)
Public m_BTLPartMList As List(Of BTLPartM)
Public Property BTLPartMList As List(Of BTLPartM)
Get
Return m_BTLPartMList
@@ -384,12 +384,23 @@ Public Class BTLStructureM
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
NewBTLStructure.m_BTLPartMList = LoadParts()
'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() As List(Of BTLPartM)
Dim TempList As New List(Of BTLPartM)
Dim nPartId As Integer = EgtGetFirstPart()
While nPartId <> GDB_ID.NULL
NewBTLStructure.m_BTLPartMList.Add(New BTLPartM(NewBTLStructure, nPartId))
TempList.Add(BTLPartM.CreateBTLPart(nPartId))
nPartId = EgtGetNextPart(nPartId)
End While
Return NewBTLStructure
Return TempList
End Function
#End Region ' CONSTRUCTOR
@@ -418,10 +429,6 @@ Public Class BTLStructureM
Return nMaxPDN + 1
End Function
Public Shared Function Empty()
Return New BTLStructureM
End Function
#End Region ' METHODS
End Class
+2
View File
@@ -125,6 +125,8 @@ Public MustInherit Class MyMachGroup
Return Brushes.LightGray
ElseIf m_nState > 0 Then
Return Brushes.Red
Else
Return Brushes.Red
End If
End Get
End Property
+9 -7
View File
@@ -168,6 +168,8 @@ Public MustInherit Class Part
Return Brushes.LightGray
ElseIf m_nGlobalState > 0 Then
Return Brushes.Red
Else
Return Brushes.Red
End If
End Get
End Property
@@ -217,22 +219,22 @@ Public MustInherit Class Part
End Property
' lista delle feature del pezzo
Protected m_FeatureList As ObservableCollection(Of BTLFeature)
Public Property FeatureList As ObservableCollection(Of BTLFeature)
Protected m_FeatureList As ObservableCollection(Of BTLFeatureM)
Public Property FeatureList As ObservableCollection(Of BTLFeatureM)
Get
Return m_FeatureList
End Get
Set(value As ObservableCollection(Of BTLFeature))
Set(value As ObservableCollection(Of BTLFeatureM))
m_FeatureList = value
End Set
End Property
Protected m_SelFeature As BTLFeature
Public Property SelFeature As Core.BTLFeature
Protected m_SelFeature As BTLFeatureM
Public Property SelFeature As BTLFeatureM
Get
Return m_SelFeature
End Get
Set(value As Core.BTLFeature)
Set(value As BTLFeatureM)
m_SelFeature = value
EgtDeselectAll()
If Not IsNothing(value) Then EgtSelectObj(m_SelFeature.nFeatureId)
@@ -251,7 +253,7 @@ Public MustInherit Class Part
Sub New(nParentMachGroup As MyMachGroup, nPartId As Integer)
m_ParentMachGroup = nParentMachGroup
SetPartId(nPartId)
m_FeatureList = New ObservableCollection(Of BTLFeature)
m_FeatureList = New ObservableCollection(Of BTLFeatureM)
End Sub
#End Region ' CONSTRUCTOR
+5 -5
View File
@@ -94,7 +94,7 @@ Public Module BTLIniFile
End If
End Function
Public Function GetBeamPrivateProfileName(IpGRP As Integer, IpPRC As Integer, ByRef IpBTLFeature As BTLFeature) As Boolean
Public Function GetBeamPrivateProfileName(IpGRP As Integer, IpPRC As Integer, ByRef IpBTLFeature As BTLFeatureM) As Boolean
Dim sBTLName As String = String.Empty
' creo lista GRP e leggo nome
If EgtUILib.GetPrivateProfileString(CalcBeamPrivateProfileGRP(IpGRP) & "." & IpPRC, BTL_FTR_NAME, String.Empty, sBTLName, m_sBTLIniFile) > 0 Then
@@ -124,7 +124,7 @@ Public Module BTLIniFile
Return ""
End Function
Public Function GetBeamPrivateProfileParam(IpGRP As Integer, IpPRC As Integer, IsP As Boolean, IpFeatureParamIndex As String, IpParentFeature As BTLFeature, ByRef IpBTLParam As BTLParam) As Boolean
Public Function GetBeamPrivateProfileParam(IpGRP As Integer, IpPRC As Integer, IsP As Boolean, IpFeatureParamIndex As String, IpParentFeature As BTLFeatureM, ByRef IpBTLParam As BTLParamM) As Boolean
Dim sBTLParam As String = String.Empty
If EgtUILib.GetPrivateProfileString(CalcBeamPrivateProfileGRP(IpGRP) & "." & IpPRC, If(IsP, "P", "Q") & IpFeatureParamIndex, String.Empty, sBTLParam, m_sBTLIniFile) > 0 Then
Dim sBTLParamParams() As String = sBTLParam.Split(","c)
@@ -148,10 +148,10 @@ Public Module BTLIniFile
Else
ParamType = BTLParamType.LENGTH
End If
IpBTLParam = New BTLParam(IpParentFeature, IsP, ParamType, sBTLParamParams(1), dMin, dMax, dDefault, sBTLParamParams(5))
IpBTLParam = BTLParamM.CreateBTLParam(IpParentFeature, IsP, ParamType, sBTLParamParams(1), dMin, dMax, dDefault, sBTLParamParams(5))
Return Not IsNothing(IpBTLParam)
ElseIf sBTLParamParams(0) = "s" Then
IpBTLParam = New BTLParam(IpParentFeature, IsP, BTLParamType.STRING_, sBTLParamParams(1), sBTLParamParams(5))
IpBTLParam = BTLParamM.CreateBTLParam(IpParentFeature, IsP, BTLParamType.STRING_, sBTLParamParams(1), sBTLParamParams(5))
Return Not IsNothing(IpBTLParam)
ElseIf sBTLParamParams(0) = "c" Then
Dim nMin As Integer
@@ -162,7 +162,7 @@ Public Module BTLIniFile
Integer.TryParse(sBTLParamParams(4), nDefault)
' recupero lista valori
Dim ValueList As New List(Of String)
IpBTLParam = New BTLParam(IpParentFeature, IsP, BTLParamType.COMBO, sBTLParamParams(1), nMin, nMax, nDefault, sBTLParamParams(5), ValueList)
IpBTLParam = BTLParamM.CreateBTLParam(IpParentFeature, IsP, BTLParamType.COMBO, sBTLParamParams(1), nMin, nMax, nDefault, sBTLParamParams(5), ValueList)
Return Not IsNothing(IpBTLParam)
End If
End If
@@ -48,11 +48,11 @@ namespace EgtBEAMWALL.DataLayer.Controllers
H = corePart.dH,
Material = corePart.sMATERIAL,
CNT = corePart.nCNT,
TBP = corePart.nTBP,
DON = corePart.nDON,
ROT = corePart.nROT,
GRP = corePart.sGRP,
UNT = corePart.nUNT,
//TBP = corePart.nTBP,
//DON = corePart.nDON,
//ROT = corePart.nROT,
//GRP = corePart.sGRP,
//UNT = corePart.nUNT,
CALC_State = (int)corePart.nState,
ProjDbId = currProjDbId
};
@@ -81,11 +81,11 @@ namespace EgtBEAMWALL.DataLayer.Controllers
H = corePart.dH,
Material = corePart.sMATERIAL,
CNT = corePart.nCNT,
TBP = corePart.nTBP,
DON = corePart.nDON,
ROT = corePart.nROT,
GRP = corePart.sGRP,
UNT = corePart.nUNT,
//TBP = corePart.nTBP,
//DON = corePart.nDON,
//ROT = corePart.nROT,
//GRP = corePart.sGRP,
//UNT = corePart.nUNT,
CALC_State = (int)corePart.nState
};
}
@@ -128,17 +128,17 @@ Public Class AddPartWndVM
#Region "CONSTRUCTOR"
Sub New()
If Not IsNothing(Map.refProjectVM.BTLStructure.BTLPartVMList) Then
If Not IsNothing(Map.refProjectVM.BTLStructure.SelBTLPart) Then
m_dW = Map.refProjectVM.BTLStructure.SelBTLPart.dW
m_dH = Map.refProjectVM.BTLStructure.SelBTLPart.dH
m_dL = Map.refProjectVM.BTLStructure.SelBTLPart.dL
ElseIf Map.refProjectVM.BTLStructure.BTLPartVMList.Count > 0 Then
m_dW = Map.refProjectVM.BTLStructure.BTLPartVMList(0).dW
m_dH = Map.refProjectVM.BTLStructure.BTLPartVMList(0).dH
m_dL = Map.refProjectVM.BTLStructure.BTLPartVMList(0).dL
If Not IsNothing(Map.refProjectVM.BTLStructureVM.BTLPartVMList) Then
If Not IsNothing(Map.refProjectVM.BTLStructureVM.SelBTLPart) Then
m_dW = Map.refProjectVM.BTLStructureVM.SelBTLPart.dW
m_dH = Map.refProjectVM.BTLStructureVM.SelBTLPart.dH
m_dL = Map.refProjectVM.BTLStructureVM.SelBTLPart.dL
ElseIf Map.refProjectVM.BTLStructureVM.BTLPartVMList.Count > 0 Then
m_dW = Map.refProjectVM.BTLStructureVM.BTLPartVMList(0).dW
m_dH = Map.refProjectVM.BTLStructureVM.BTLPartVMList(0).dH
m_dL = Map.refProjectVM.BTLStructureVM.BTLPartVMList(0).dL
End If
m_nPDN = Map.refProjectVM.BTLStructure.NewPDN()
m_nPDN = Map.refProjectVM.BTLStructureVM.BTLStructureM.NewPDN()
End If
m_nCNT = 1
End Sub
@@ -84,7 +84,7 @@ Public Class AddSectionXMaterialWndVM
For Each NewSectXMatItem In NewSectionXMaterialList
NewSectXMatItem.Alias_IsChecked = False
For Each SectionListItem In Map.refProjectVM.BTLStructure.SectionList
For Each SectionListItem In Map.refProjectVM.BTLStructureVM.SectionList
If Map.refMachinePanelVM.SelectedMachine.nType = MachineType.BEAM Then
If NewSectXMatItem.dW = SectionListItem.dW AndAlso NewSectXMatItem.dH = SectionListItem.dH Then
' Se le sezioni sono uguali allora indago sui materiali
@@ -7,7 +7,7 @@
' This call is required by the designer.
InitializeComponent()
Me.DataContext = BTLDataWndVM
Me.Tag = Map.refProjectVM.BTLStructure
Me.Tag = Map.refProjectVM.BTLStructureVM
' Assegno al riferimento locale al VM il VM preso dal DataContext
m_BTLDataWndVM = BTLDataWndVM
End Sub
@@ -1,29 +1,55 @@
Imports System.Collections.ObjectModel
Imports System.Collections.Specialized
Imports System.ComponentModel
Imports EgtBEAMWALL.Core
Imports EgtUILib
Imports EgtWPFLib5
Public Class BTLFeatureVM
Inherits Core.BTLFeature
Inherits VMBase
Public Overrides Property nSelGRP As Integer
Private WithEvents m_BTLFeatureM As BTLFeatureM
Public ReadOnly Property BTLFeatureM As BTLFeatureM
Get
Return m_nSelGRP
Return m_BTLFeatureM
End Get
End Property
Private m_BTLPartM As BTLPartM
Public ReadOnly Property nFeatureId As Integer
Get
Return m_BTLFeatureM.nFeatureId
End Get
End Property
Public Property GRPList As ObservableCollection(Of Integer)
Get
Return m_BTLFeatureM.GRPList
End Get
Set(value As ObservableCollection(Of Integer))
m_BTLFeatureM.GRPList = value
End Set
End Property
Public Property nSelGRP As Integer
Get
Return m_BTLFeatureM.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)
m_BTLFeatureM.CalcParamArray(vPar, sPar)
Dim bOK As Boolean = m_BTLFeatureM.UpdateParams(value, m_BTLFeatureM.nPRC, nSelSIDE, m_BTLFeatureM.sDES, m_BTLFeatureM.nPRID, m_BTLFeatureM.frFRAME, vPar, sPar)
If bOK Then
m_nSelGRP = value
m_BTLFeatureM.nSelGRP = value
' seleziono feature in disegno
SelGeomFeature()
' rendo non calcolata questa feature
CalcFeatureUpdate(False, 0, 0, 0, "")
' ed aggiorno stato pezzo
DirectCast(ParentPart, BTLPartVM).CalcFeatureUpdate()
'''' ed aggiorno stato pezzo
'''m_BTLPartM.CalcFeatureUpdate()
Else
NotifyPropertyChanged("nSelGRP")
End If
@@ -34,35 +60,53 @@ Public Class BTLFeatureVM
Friend ReadOnly Property sDescGRP As String
Get
Dim sDescConstruction As String = String.Empty
If CalcBeamPrivateProfileGRP(m_nSelGRP) = 0 Then
If CalcBeamPrivateProfileGRP(m_BTLFeatureM.nSelGRP) = 0 Then
sDescConstruction = "L"
Else
sDescConstruction = "T"
End If
sDescConstruction &= m_nPRC.ToString("000")
sDescConstruction &= m_BTLFeatureM.nPRC.ToString("000")
Return sDescConstruction
End Get
End Property
' Lato
Public Overrides Property nSelSIDE As Integer
Public Property nPRC As Integer
Get
Return m_nSelSIDE
Return m_BTLFeatureM.nPRC
End Get
Set(value As Integer)
m_BTLFeatureM.nPRC = value
End Set
End Property
Public Property SIDEList As ObservableCollection(Of Integer)
Get
Return m_BTLFeatureM.SIDEList
End Get
Set(value As ObservableCollection(Of Integer))
m_BTLFeatureM.SIDEList = value
End Set
End Property
' Lato
Public Property nSelSIDE As Integer
Get
Return m_BTLFeatureM.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)
m_BTLFeatureM.CalcParamArray(vPar, sPar)
Dim bOK As Boolean = m_BTLFeatureM.UpdateParams(nSelGRP, m_BTLFeatureM.nPRC, value, m_BTLFeatureM.sDES, m_BTLFeatureM.nPRID, m_BTLFeatureM.frFRAME, vPar, sPar)
If bOK Then
m_nSelSIDE = value
m_BTLFeatureM.nSelSIDE = value
SelGeomFeature()
' rendo non calcolata questa feature
CalcFeatureUpdate(False, 0, 0, 0, "")
' ed aggiorno stato pezzo
DirectCast(ParentPart, BTLPartVM).CalcFeatureUpdate()
'''' ed aggiorno stato pezzo
'''DirectCast(ParentPart, BTLPartVM).CalcFeatureUpdate()
Else
NotifyPropertyChanged("nSelGRP")
End If
@@ -71,15 +115,21 @@ Public Class BTLFeatureVM
End Set
End Property
Public Overrides Property bDO As Boolean
Public ReadOnly Property sName As String
Get
Return m_bDO
Return m_BTLFeatureM.sName
End Get
End Property
Public Property bDO As Boolean
Get
Return m_BTLFeatureM.bDO
End Get
Set(value As Boolean)
If EgtBeamEnableProcess(nFeatureId, value) Then
m_bDO = value
' aggiorno check DOALL
ParentPart.NotifyPropertyChanged("bDOALL")
m_BTLFeatureM.bDO = value
'''' aggiorno check DOALL
'''ParentPart.NotifyPropertyChanged("bDOALL")
EgtDraw()
NotifyPropertyChanged("Calc_Background")
NotifyPropertyChanged("bDO")
@@ -87,6 +137,33 @@ Public Class BTLFeatureVM
End Set
End Property
Public Property nPRID As Integer
Get
Return m_BTLFeatureM.nPRID
End Get
Set(value As Integer)
m_BTLFeatureM.nPRID = value
End Set
End Property
Public Property sDES As String
Get
Return m_BTLFeatureM.sDES
End Get
Set(value As String)
m_BTLFeatureM.sDES = value
End Set
End Property
Public Property frFRAME As Frame3d
Get
Return m_BTLFeatureM.frFRAME
End Get
Set(value As Frame3d)
m_BTLFeatureM.frFRAME = value
End Set
End Property
' proprieta' che mostra la descrizione in interfaccia
Public ReadOnly Property sDesc As String
Get
@@ -100,15 +177,47 @@ Public Class BTLFeatureVM
End Get
End Property
Public ReadOnly Property nState As CalcStates
Get
Return m_BTLFeatureM.nState
End Get
End Property
Public ReadOnly Property nCALC_ERR As Integer
Get
Return m_BTLFeatureM.nCALC_ERR
End Get
End Property
Public ReadOnly Property nCALC_ROT As Integer
Get
Return m_BTLFeatureM.nCALC_ROT
End Get
End Property
Public ReadOnly Property nCALC_FALL As Integer
Get
Return m_BTLFeatureM.nCALC_FALL
End Get
End Property
Public ReadOnly Property nCALC_MSG As String
Get
Return m_BTLFeatureM.sCALC_MSG
End Get
End Property
Public ReadOnly Property Calc_Background As SolidColorBrush
Get
If Not m_bDO Then
If Not m_BTLFeatureM.bDO Then
Return Brushes.Aqua
ElseIf nState = 0 Then
ElseIf m_BTLFeatureM.nState = 0 Then
Return Brushes.Green
ElseIf nState < 0 Then
ElseIf m_BTLFeatureM.nState < 0 Then
Return Brushes.LightGray
ElseIf nState > 0 Then
ElseIf m_BTLFeatureM.nState > 0 Then
Return Brushes.Red
Else
Return Brushes.Red
End If
End Get
@@ -116,19 +225,19 @@ Public Class BTLFeatureVM
Public ReadOnly Property CALC_ROT_Visibility As Visibility
Get
Return If(m_nCALC_ROT <> 0, Visibility.Visible, Visibility.Collapsed)
Return If(m_BTLFeatureM.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)
Return If(m_BTLFeatureM.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
Select Case m_BTLFeatureM.nCALC_ERR
Case 22
Return "c"
Case 19, 23, 24, 25
@@ -137,46 +246,72 @@ Public Class BTLFeatureVM
Return "w"
Case < 0
Return "i"
Case Else
Return ""
End Select
End Get
End Property
Public ReadOnly Property CALC_ERR_Foreground As SolidColorBrush
Get
Select Case m_nCALC_ERR
Select Case m_BTLFeatureM.nCALC_ERR
Case 19, 22, 23, 24, 25
Return Brushes.Red
Case 17
Return Brushes.Orange
Case < 0
Return Brushes.Green
Case Else
Return Brushes.Red
End Select
End Get
End Property
Public Overrides Property SelPParam As Core.BTLParam
Private m_PBTLParamVMList As ObservableCollection(Of BTLParamVM)
Public Property PBTLParamVMList As ObservableCollection(Of BTLParamVM)
Get
Return m_SelPParam
Return m_PBTLParamVMList
End Get
Set(value As Core.BTLParam)
m_SelPParam = value
If Not IsNothing(m_SelPParam) Then
Set(value As ObservableCollection(Of BTLParamVM))
m_PBTLParamVMList = value
End Set
End Property
Protected m_SelPBTLParam As BTLParamVM
Public Property SelPBTLParam As BTLParamVM
Get
Return m_SelPBTLParam
End Get
Set(value As BTLParamVM)
m_SelPBTLParam = value
If Not IsNothing(m_SelPBTLParam) Then
' imposto path disegno da mostrare in BottomPanel
Map.refBottomPanelVM.SetCurrDraw(DirectCast(m_SelPParam, BTLParamVM).sDrawPath)
Map.refBottomPanelVM.SetCurrDraw(sDrawPath)
End If
NotifyPropertyChanged("SelPParam")
End Set
End Property
Public Overrides Property SelQParam As Core.BTLParam
Private m_QBTLParamVMList As ObservableCollection(Of BTLParamVM)
Public Property QBTLParamVMList As ObservableCollection(Of BTLParamVM)
Get
Return m_QBTLParamVMList
End Get
Set(value As ObservableCollection(Of BTLParamVM))
m_QBTLParamVMList = value
End Set
End Property
Protected m_SelQParam As BTLParamVM
Public Property SelQParam As BTLParamVM
Get
Return m_SelQParam
End Get
Set(value As Core.BTLParam)
Set(value As BTLParamVM)
m_SelQParam = value
If Not IsNothing(m_SelQParam) Then
' imposto path disegno da mostrare in BottomPanel
Map.refBottomPanelVM.SetCurrDraw(DirectCast(m_SelQParam, BTLParamVM).sDrawPath)
Map.refBottomPanelVM.SetCurrDraw(sDrawPath)
End If
NotifyPropertyChanged("SelQParam")
End Set
@@ -185,84 +320,104 @@ Public Class BTLFeatureVM
' Definizione comandi
Private m_cmdDeleteFeature As ICommand
Sub New(ParentPart As BTLPartVM, 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()
#Region "CONSTRUCTOR"
'Sub New(ParentPart As BTLPartVM, 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(BTLFeatureM As BTLFeatureM, BTLPartM As BTLPartM)
m_BTLFeatureM = BTLFeatureM
AddHandler m_BTLFeatureM.PBTLParamAdded, AddressOf OnPBTLParamAdded
AddHandler m_BTLFeatureM.QBTLParamAdded, AddressOf OnQBTLParamAdded
m_BTLPartM = BTLPartM
CreatePBTLParamVMList()
CreateQBTLParamVMList()
NotifyPropertyChanged(NameOf(Calc_Background))
End Sub
Sub New(nPRC As Integer, nGRP As Integer, nSIDE As Integer)
MyBase.New(nPRC, nGRP, nSIDE)
#End Region ' CONSTRUCTOR
#Region "METHODS"
Private Sub CreatePBTLParamVMList()
Dim all As List(Of BTLParamVM) = (From BTLParamM In m_BTLFeatureM.GetPBTLParams()
Select New BTLParamVM(BTLParamM, m_BTLFeatureM)).ToList()
For Each BTLParamVM As BTLParamVM In all
AddHandler BTLParamVM.PropertyChanged, AddressOf OnPBTLParamVMPropertyChanged
Next
m_PBTLParamVMList = New ObservableCollection(Of BTLParamVM)(all)
AddHandler m_PBTLParamVMList.CollectionChanged, AddressOf OnPBTLParamVMListChanged
End Sub
' funzione che crea l'elenco dei parametri
Public Overrides Sub CreateFeatureParams()
Dim ParamIndex As Integer = 1
Dim NewBTLParam As BTLParamVM = 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
Private Sub CreateQBTLParamVMList()
Dim all As List(Of BTLParamVM) = (From BTLParamM In m_BTLFeatureM.GetQBTLParams()
Select New BTLParamVM(BTLParamM, m_BTLFeatureM)).ToList()
For Each BTLParamVM As BTLParamVM In all
AddHandler BTLParamVM.PropertyChanged, AddressOf OnQBTLParamVMPropertyChanged
Next
m_QBTLParamVMList = New ObservableCollection(Of BTLParamVM)(all)
AddHandler m_QBTLParamVMList.CollectionChanged, AddressOf OnQBTLParamVMListChanged
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 = ""
m_BTLFeatureM.nState = CalcStates.NOTCALCULATED
m_BTLFeatureM.nCALC_ERR = 0
m_BTLFeatureM.nCALC_ROT = 0
m_BTLFeatureM.nCALC_FALL = 0
m_BTLFeatureM.sCALC_MSG = ""
Else
m_nCALC_ERR = ERR
m_nCALC_ROT = ROT
m_nCALC_FALL = FALL
m_sCALC_MSG = MSG
m_BTLFeatureM.nCALC_ERR = ERR
m_BTLFeatureM.nCALC_ROT = ROT
m_BTLFeatureM.nCALC_FALL = FALL
m_BTLFeatureM.sCALC_MSG = MSG
If ERR = 0 Then
m_nState = 0
m_BTLFeatureM.nState = 0
ElseIf ERR > 1 Then
m_nState = 1
m_BTLFeatureM.nState = 1
ElseIf ERR < 1 Then
m_nState = -1
m_BTLFeatureM.nState = -1
End If
End If
NotifyPropertyChanged("Calc_Background")
NotifyPropertyChanged(NameOf(Calc_Background))
End Sub
' funzione che seleziona la feature nella geometria
@@ -275,42 +430,46 @@ Public Class BTLFeatureVM
EgtSelectObj(nFeatureId)
End Sub
Public Overrides Function Copy() As Core.BTLFeature
Public Function Copy() As BTLFeatureM
' creo nuova feature
Dim vPar() As Double = Nothing
Dim sPar As String = String.Empty
Me.CalcParamArray(vPar, sPar)
m_BTLFeatureM.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)
EgtBeamSetPart(m_BTLPartM.nPartId)
Dim nNewFeatureId As Integer = EgtBeamAddProcess(m_BTLFeatureM.nSelGRP, m_BTLFeatureM.nPRC, m_BTLFeatureM.nSelSIDE, m_BTLFeatureM.sDES,
m_BTLFeatureM.ParentPart.NewProcId(), m_BTLFeatureM.frFRAME, vPar, sPar)
' se è stata creata
If nNewFeatureId <> GDB_ID.NULL Then
Dim NewFeat As New BTLFeatureVM(Me.ParentPart, nNewFeatureId)
Dim NewFeat As BTLFeatureM = BTLFeatureM.CreateBTLFeature(m_BTLPartM, nNewFeatureId)
' la aggiungo a struttura BTL corrente
Me.ParentPart.FeatureList.Add(NewFeat)
m_BTLPartM.AddBTLFeature(NewFeat)
Return NewFeat
End If
Return Nothing
End Function
Public Overrides Function Copy(DestBTLPart As Core.BTLPartM) As Boolean
Public Function Copy(DestBTLPart As BTLPartM) As Boolean
' creo nuova feature
Dim vPar() As Double
Dim vPar() As Double = Nothing
Dim sPar As String = String.Empty
Me.CalcParamArray(vPar, sPar)
m_BTLFeatureM.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)
Dim nNewFeatureId As Integer = EgtBeamAddProcess(m_BTLFeatureM.nSelGRP, m_BTLFeatureM.nPRC, m_BTLFeatureM.nSelSIDE, m_BTLFeatureM.sDES,
DestBTLPart.NewProcId(), m_BTLFeatureM.frFRAME, vPar, sPar)
' se è stata creata
If nNewFeatureId <> GDB_ID.NULL Then
Dim NewFeat As New BTLFeatureVM(Me.ParentPart, nNewFeatureId)
Dim NewFeat As BTLFeatureM = BTLFeatureM.CreateBTLFeature(m_BTLPartM, nNewFeatureId)
' la aggiungo a struttura BTL pezzo di destinazione
DestBTLPart.FeatureList.Add(NewFeat)
DestBTLPart.AddBTLFeature(NewFeat)
Return True
End If
Return False
End Function
#End Region ' METHODS
#Region "COMMANDS"
#Region "DeleteFeature"
@@ -332,4 +491,57 @@ Public Class BTLFeatureVM
#End Region ' COMMANDS
#Region "EVENTS"
Private Sub OnPBTLParamAdded(sender As Object, e As BTLParamAddedEventArgs) Handles m_BTLFeatureM.PBTLParamAdded
Dim BTLParamVM As BTLParamVM = New BTLParamVM(e.NewBTLParam, m_BTLFeatureM)
PBTLParamVMList.Add(BTLParamVM)
End Sub
Private Sub OnQBTLParamAdded(sender As Object, e As BTLParamAddedEventArgs) Handles m_BTLFeatureM.QBTLParamAdded
Dim BTLParamVM As BTLParamVM = New BTLParamVM(e.NewBTLParam, m_BTLFeatureM)
QBTLParamVMList.Add(BTLParamVM)
End Sub
Private Sub OnPBTLParamVMListChanged(sender As Object, e As NotifyCollectionChangedEventArgs)
If Not IsNothing(e.NewItems) AndAlso e.NewItems.Count > 0 Then
For Each BTLParamVM As BTLParamVM In e.NewItems
AddHandler BTLParamVM.PropertyChanged, AddressOf OnPBTLParamVMPropertyChanged
Next
End If
If Not IsNothing(e.OldItems) AndAlso e.OldItems.Count > 0 Then
For Each BTLParamVM As BTLParamVM In e.OldItems
RemoveHandler BTLParamVM.PropertyChanged, AddressOf OnPBTLParamVMPropertyChanged
Next
End If
End Sub
Private Sub OnQBTLParamVMListChanged(sender As Object, e As NotifyCollectionChangedEventArgs)
If Not IsNothing(e.NewItems) AndAlso e.NewItems.Count > 0 Then
For Each BTLParamVM As BTLParamVM In e.NewItems
AddHandler BTLParamVM.PropertyChanged, AddressOf OnQBTLParamVMPropertyChanged
Next
End If
If Not IsNothing(e.OldItems) AndAlso e.OldItems.Count > 0 Then
For Each BTLParamVM As BTLParamVM In e.OldItems
RemoveHandler BTLParamVM.PropertyChanged, AddressOf OnQBTLParamVMPropertyChanged
Next
End If
End Sub
Private Sub OnPBTLParamVMPropertyChanged(sender As Object, e As PropertyChangedEventArgs)
Select Case e.PropertyName
Case "dValue", "sValue"
' riseleziono questa feature
SelGeomFeature()
' rendo non calcolata questa feature
CalcFeatureUpdate(False, 0, 0, 0, "")
End Select
End Sub
Private Sub OnQBTLParamVMPropertyChanged(sender As Object, e As PropertyChangedEventArgs)
Select Case e.PropertyName
'Case "sMATERIAL"
End Select
End Sub
#End Region ' EVENTS
End Class
@@ -1,18 +1,58 @@
Imports System.Collections.ObjectModel
Imports EgtBEAMWALL.Core
Imports EgtUILib
Imports EgtWPFLib5
Public Class BTLParamVM
Inherits Core.BTLParam
Inherits VMBase
Protected m_BTLParamM As BTLParamM
Public ReadOnly Property BTLParamM As BTLParamM
Get
Return m_BTLParamM
End Get
End Property
Private m_BTLFeatureM As BTLFeatureM
Public ReadOnly Property bIsP As Boolean
Get
Return m_BTLParamM.bIsP
End Get
End Property
' parametri da struttura
Public Property sName As String
Get
Return m_BTLParamM.sName
End Get
Set(value As String)
m_BTLParamM.sName = value
End Set
End Property
Public ReadOnly Property nId As Integer
Get
Return m_BTLParamM.nId
End Get
End Property
Public Property sDescription As String
Get
Return m_BTLParamM.sDescription
End Get
Set(value As String)
m_BTLParamM.sDescription = value
End Set
End Property
Public ReadOnly Property sMin As String
Get
Select Case nType
Select Case m_BTLParamM.nType
Case BTLParamType.DOUBLE_
Return DoubleToString(m_dMin, 3)
Return DoubleToString(m_BTLParamM.dMin, 3)
Case BTLParamType.LENGTH
Return LenToString(m_dMin, 3)
Return LenToString(m_BTLParamM.dMin, 3)
Case Else
Return ""
End Select
@@ -21,11 +61,11 @@ Public Class BTLParamVM
Public ReadOnly Property sMax As String
Get
Select Case nType
Select Case m_BTLParamM.nType
Case BTLParamType.DOUBLE_
Return DoubleToString(m_dMax, 3)
Return DoubleToString(m_BTLParamM.dMax, 3)
Case BTLParamType.LENGTH
Return LenToString(m_dMax, 3)
Return LenToString(m_BTLParamM.dMax, 3)
Case Else
Return ""
End Select
@@ -33,22 +73,22 @@ Public Class BTLParamVM
End Property
' parametri da geometria
Public Overrides Property sValue As String
Public Property sValue As String
Get
Select Case nType
Select Case m_BTLParamM.nType
Case BTLParamType.DOUBLE_
Return DoubleToString(m_dValue, 3)
Return DoubleToString(m_BTLParamM.dValue, 3)
Case BTLParamType.LENGTH
Return LenToString(m_dValue, 3)
Return LenToString(m_BTLParamM.dValue, 3)
Case Else ' stringhe
Return m_sValue
Return m_BTLParamM.sValue
End Select
Return If(nType = BTLParamType.LENGTH, LenToString(m_dValue, 3), DoubleToString(m_dValue, 3))
Return If(m_BTLParamM.nType = BTLParamType.LENGTH, LenToString(m_BTLParamM.dValue, 3), DoubleToString(m_BTLParamM.dValue, 3))
End Get
Set(value As String)
Dim dNewValue As Double
' trasformo valori
Select Case nType
Select Case m_BTLParamM.nType
Case BTLParamType.DOUBLE_
StringToDouble(value, dNewValue)
Case BTLParamType.LENGTH
@@ -57,12 +97,12 @@ Public Class BTLParamVM
' per string non faccio nulla
End Select
' verifico che sia compreso tra minimo e massimo
If dNewValue < m_dMin OrElse dNewValue > m_dMax Then
If dNewValue < m_BTLParamM.dMin OrElse dNewValue > m_BTLParamM.dMax Then
MessageBox.Show("Valore non compreso tra minimo e massimo", "Error")
NotifyPropertyChanged("sValue")
Return
End If
Select Case nType
Select Case m_BTLParamM.nType
Case BTLParamType.DOUBLE_, BTLParamType.LENGTH
UpdateParamValue(dNewValue, "")
Case Else
@@ -70,94 +110,118 @@ Public Class BTLParamVM
End Select
End Set
End Property
Public Overrides Property dValue As Double
Public Property dValue As Double
Get
Return m_dValue
Return m_BTLParamM.dValue
End Get
Set(value As Double)
m_dValue = value
m_BTLParamM.dValue = value
NotifyPropertyChanged("sValue")
End Set
End Property
Public ReadOnly Property sDefault As String
Get
Select Case nType
Select Case m_BTLParamM.nType
Case BTLParamType.DOUBLE_
Return DoubleToString(m_dDefault, 3)
Return DoubleToString(m_BTLParamM.dDefault, 3)
Case BTLParamType.LENGTH
Return LenToString(m_dDefault, 3)
Return LenToString(m_BTLParamM.dDefault, 3)
Case Else
Return ""
End Select
End Get
End Property
Public ReadOnly Property sDrawPath As String
Public ReadOnly Property nType As BTLParamType
Get
Return Map.refMainWindowVM.MainWindowM.sResourcesRoot & "\Parameters\" & DirectCast(m_ParentFeature, BTLFeatureVM).sDescGRP & "_" & m_sName & "_" & m_ParentFeature.nSelGRP & ".gif"
Return m_BTLParamM.nType
End Get
End Property
' new per double e length
Sub New(ParentFeature As BTLFeatureVM, 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)
Protected m_sDrawPath As String
Public ReadOnly Property sDrawPath As String
Get
Return Map.refMainWindowVM.MainWindowM.sResourcesRoot & "\Parameters\" & m_BTLFeatureM.sDescGRP & "_" & m_BTLParamM.sName & "_" & m_BTLFeatureM.nSelGRP & ".gif"
End Get
End Property
#Region "CONSTRUCTOR"
Sub New(BTLParamM As BTLParamM, BTLFeatureM As BTLFeatureM)
m_BTLParamM = BTLParamM
m_BTLFeatureM = BTLFeatureM
End Sub
' new per stringhe
Sub New(ParentFeature As BTLFeatureVM, IsP As Boolean, nType As BTLParamType, sParamName As String, sDescription As String)
MyBase.New(ParentFeature, IsP, nType, sParamName, sDescription)
Sub New(BTLParamM As BTLParamM)
m_BTLParamM = BTLParamM
m_BTLFeatureM = Nothing
End Sub
' new per combobox
Sub New(ParentFeature As BTLFeatureVM, 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 double e length
'Sub New(ParentFeature As BTLFeatureVM, 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 parametro vuoto
Sub New(IsP As Boolean, nType As BTLParamType, sParamName As String)
MyBase.New(IsP, nType, sParamName)
End Sub
'' new per stringhe
'Sub New(ParentFeature As BTLFeatureVM, 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 BTLFeatureVM, 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
#End Region ' CONSTRUCTOR
Friend Sub UpdateParamValue(dNewValue As Double, sNewValue As String, Optional bDraw As Boolean = True)
' se P
If bIsP Then
If m_BTLParamM.bIsP Then
' aggiorno la feature con nuovo valore
Dim vPar() As Double = Nothing
Dim sPar As String = String.Empty
ParentFeature.CalcParamArray(vPar, sPar)
m_BTLFeatureM.CalcParamArray(vPar, sPar)
' modifico parametro cambiato con value
Select Case nType
Select Case m_BTLParamM.nType
Case BTLParamType.DOUBLE_, BTLParamType.LENGTH
vPar(Me.nId - 1) = dNewValue
vPar(m_BTLParamM.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)
Dim bOK As Boolean = m_BTLFeatureM.UpdateParams(m_BTLFeatureM.nSelGRP, m_BTLFeatureM.nPRC, m_BTLFeatureM.nSelSIDE, m_BTLFeatureM.sDES,
m_BTLFeatureM.nPRID, m_BTLFeatureM.frFRAME, vPar, sPar)
If bOK Then
Select Case nType
Select Case m_BTLParamM.nType
Case BTLParamType.DOUBLE_, BTLParamType.LENGTH
m_dValue = dNewValue
m_BTLParamM.dValue = dNewValue
NotifyPropertyChanged(NameOf(dValue))
Case BTLParamType.STRING_
m_sValue = sNewValue
m_BTLParamM.sValue = sNewValue
NotifyPropertyChanged(NameOf(sValue))
End Select
' riseleziono questa feature
DirectCast(ParentFeature, BTLFeatureVM).SelGeomFeature()
' rendo non calcolata questa feature
DirectCast(ParentFeature, BTLFeatureVM).CalcFeatureUpdate(False, 0, 0, 0, "")
' ed aggiorno stato pezzo
DirectCast(ParentFeature.ParentPart, BTLPartVM).CalcFeatureUpdate()
'''' riseleziono questa feature
'''m_BTLFeatureM.SelGeomFeature()
'''' rendo non calcolata questa feature
'''DirectCast(m_BTLFeatureM, BTLFeatureVM).CalcFeatureUpdate(False, 0, 0, 0, "")
'''' ed aggiorno stato pezzo
'''DirectCast(m_BTLFeatureM.ParentPart, BTLPartVM).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
If EgtSetInfo(m_BTLFeatureM.nFeatureId, "Q" & m_BTLParamM.nId.ToString("D2"), dNewValue) Then
m_BTLParamM.dValue = dNewValue
NotifyPropertyChanged(NameOf(dValue))
' imposto modificato per copie
EgtDuploSetModified(ParentFeature.ParentPart.nPartId)
EgtDuploSetModified(m_BTLFeatureM.ParentPart.nPartId)
End If
End If
End Sub
+178 -65
View File
@@ -2,13 +2,20 @@
Imports EgtWPFLib5
Imports EgtUILib
Imports EgtBEAMWALL.Core
Imports System.Collections.Specialized
Imports System.ComponentModel
Public Class BTLPartVM
Inherits VMBase
#Region "FIELDS & PROPERTIES"
Private m_BTLPartM As BTLPartM
Private WithEvents m_BTLPartM As BTLPartM
Public ReadOnly Property BTLPartM As BTLPartM
Get
Return m_BTLPartM
End Get
End Property
Private m_BTLStructureM As BTLStructureM
Public ReadOnly Property nPartId As Integer
@@ -86,6 +93,11 @@ Public Class BTLPartVM
End If
End Set
End Property
Public ReadOnly Property dL As Double
Get
Return m_BTLPartM.dL
End Get
End Property
Public Property sW As String
Get
@@ -101,6 +113,11 @@ Public Class BTLPartVM
End If
End Set
End Property
Public ReadOnly Property dW As Double
Get
Return m_BTLPartM.dW
End Get
End Property
Public Property sH As String
Get
@@ -116,6 +133,11 @@ Public Class BTLPartVM
End If
End Set
End Property
Public ReadOnly Property dH As Double
Get
Return m_BTLPartM.dH
End Get
End Property
#Region "Parametri pezzo"
@@ -888,7 +910,7 @@ Public Class BTLPartVM
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
If Integer.TryParse(value, nTempCNT) AndAlso nTempCNT > 0 AndAlso EgtSetInfo(m_BTLPartM.nPartId, BTL_PRT_CNT, value) Then
m_BTLPartM.nCNT = nTempCNT
Else
NotifyPropertyChanged("sCNT")
@@ -972,6 +994,8 @@ Public Class BTLPartVM
Return Brushes.LightGray
ElseIf m_BTLPartM.nGlobalState > 0 Then
Return Brushes.Red
Else
Return Brushes.Red
End If
End Get
End Property
@@ -984,53 +1008,54 @@ Public Class BTLPartVM
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
If BTLFeatureVMList.Count = 0 Then Return False
Dim bTemp As Boolean = BTLFeatureVMList(0).bDO
For FeatureIndex = 1 To BTLFeatureVMList.Count - 1
If BTLFeatureVMList(FeatureIndex).bDO <> bTemp Then Return Nothing
Next
Return bTemp
End Get
Set(value As Boolean?)
If FeatureList.Count = 0 Then
If BTLFeatureVMList.Count = 0 Then
NotifyPropertyChanged("bDOALL")
Return
End If
For Each Feature In FeatureList
For Each Feature In BTLFeatureVMList
Feature.bDO = value
Next
End Set
End Property
' lista delle feature del pezzo
Public Property FeatureList As ObservableCollection(Of BTLFeature)
Public m_BTLFeatureVMList As ObservableCollection(Of BTLFeatureVM)
Public Property BTLFeatureVMList As ObservableCollection(Of BTLFeatureVM)
Get
Return m_BTLPartM.FeatureList
Return m_BTLFeatureVMList
End Get
Set(value As ObservableCollection(Of BTLFeature))
m_BTLPartM.FeatureList = value
Set(value As ObservableCollection(Of BTLFeatureVM))
m_BTLFeatureVMList = value
End Set
End Property
Public m_SelFeature As BTLFeature
Public Property SelFeature As BTLFeature
Public m_SelBTLFeatureVM As BTLFeatureVM
Public Property SelBTLFeatureVM As BTLFeatureVM
Get
Return m_SelFeature
Return m_SelBTLFeatureVM
End Get
Set(value As Core.BTLFeature)
m_SelFeature = value
Set(value As BTLFeatureVM)
m_SelBTLFeatureVM = value
If Map.refMainMenuVM.SelPage = Pages.VIEW Then
If Not IsNothing(m_SelFeature) Then
DirectCast(m_SelFeature, BTLFeatureVM).SelGeomFeature()
If Not IsNothing(m_SelBTLFeatureVM) Then
DirectCast(m_SelBTLFeatureVM, BTLFeatureVM).SelGeomFeature()
EgtDraw()
' imposto path disegno da mostrare in BottomPanel
Map.refBottomPanelVM.SetCurrDraw(DirectCast(m_SelFeature, BTLFeatureVM).sDrawPath)
Map.refBottomPanelVM.SetCurrDraw(DirectCast(m_SelBTLFeatureVM, BTLFeatureVM).sDrawPath)
' seleziono pagina BottomPanel
Map.refBottomPanelVM.SetSelPartFeatureTab(BottomPanelVM.PartFeatureTab.FEATURE)
' deseleziono i parametri
If Not IsNothing(SelFeature.SelPParam) Then SelFeature.SelPParam = Nothing
If Not IsNothing(SelBTLFeatureVM.SelPBTLParam) Then SelBTLFeatureVM.SelPBTLParam = Nothing
' se contorno libero
If m_SelFeature.IsFreeContour() Then
If m_SelBTLFeatureVM.BTLFeatureM.IsFreeContour() Then
' attivo stato contorno libero
End If
@@ -1071,7 +1096,13 @@ Public Class BTLPartVM
Sub New(BTLPartM As BTLPartM, BTLStructureM As BTLStructureM)
m_BTLPartM = BTLPartM
AddHandler m_BTLPartM.BTLFeatureAdded, AddressOf OnBTLFeatureAdded
m_BTLStructureM = BTLStructureM
CreateBTLFeatureVMList()
' Aggiorno check DOALL
NotifyPropertyChanged(NameOf(bDOALL))
' Aggiorno stato da stati feature
CalcFeatureUpdate()
End Sub
'Sub New(ParentStructure As BTLStructureVM, nPartId As Integer)
@@ -1263,6 +1294,26 @@ Public Class BTLPartVM
#Region "METHODS"
Private Sub CreateBTLFeatureVMList()
Dim all As List(Of BTLFeatureVM) = (From BTLFeatureM In m_BTLPartM.GetBTLFeatures()
Select New BTLFeatureVM(BTLFeatureM, m_BTLPartM)).ToList()
For Each BTLFeatureVM As BTLFeatureVM In all
AddHandler BTLFeatureVM.PropertyChanged, AddressOf OnBTLFeatureVMPropertyChanged
For Each BTLParamVM As BTLParamVM In BTLFeatureVM.PBTLParamVMList
AddHandler BTLParamVM.PropertyChanged, AddressOf OnBTLPParamVMPropertyChanged
Next
AddHandler BTLFeatureVM.PBTLParamVMList.CollectionChanged, AddressOf OnBTLPParamVMListChanged
For Each BTLParamVM As BTLParamVM In BTLFeatureVM.QBTLParamVMList
AddHandler BTLParamVM.PropertyChanged, AddressOf OnBTLQParamVMPropertyChanged
Next
AddHandler BTLFeatureVM.PBTLParamVMList.CollectionChanged, AddressOf OnBTLQParamVMListChanged
Next
m_BTLFeatureVMList = New ObservableCollection(Of BTLFeatureVM)(all)
AddHandler m_BTLFeatureVMList.CollectionChanged, AddressOf OnBTLFeatureVMListChanged
End Sub
Public Sub Rotation(IsPositive As Boolean)
' recupero il box del pezzo
Dim nLs As Integer = EgtGetFirstNameInGroup(nPartId, "Box")
@@ -1296,30 +1347,28 @@ Public Class BTLPartVM
EgtSetInfo(nPartId, BTL_PRT_ROTATED, m_BTLPartM.nROTATED)
' scambio dimensioni
SwapDimForRotation()
' aggiorno sezioni
DirectCast(BTLStructureM, BTLStructureVM).UpdateSectionFromRotation(Me)
' imposto modificato per copie
EgtDuploSetModified(nPartId)
End If
EgtDraw()
NotifyPropertyChanged("sROTATED")
NotifyPropertyChanged(NameOf(sROTATED))
End Sub
Private Function SwapDimForRotation()
Private Sub 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)
Dim Temp As Double = m_BTLPartM.dW
m_BTLPartM.dW = m_BTLPartM.dH
m_BTLPartM.dH = Temp
EgtSetInfo(nPartId, BTL_PRT_W, m_BTLPartM.dW)
EgtSetInfo(nPartId, BTL_PRT_H, m_BTLPartM.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)
Dim Temp As Double = m_BTLPartM.dW
m_BTLPartM.dW = m_BTLPartM.dL
m_BTLPartM.dL = Temp
EgtSetInfo(nPartId, BTL_PRT_W, m_BTLPartM.dW)
EgtSetInfo(nPartId, BTL_PRT_L, m_BTLPartM.dL)
End If
' notifica per valori in PartGrid
NotifyPropertyChanged("dW")
@@ -1329,21 +1378,21 @@ Public Class BTLPartVM
NotifyPropertyChanged("sW")
NotifyPropertyChanged("sH")
NotifyPropertyChanged("sL")
End Function
End Sub
' 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 = ""
m_BTLPartM.nCALC_ERR = -1
m_BTLPartM.nCALC_ROT = 0
m_BTLPartM.nCALC_FALL = 0
m_BTLPartM.sCALC_MSG = ""
Else
m_nCALC_ERR = ERR
m_nCALC_ROT = ROT
m_nCALC_FALL = FALL
m_sCALC_MSG = MSG
m_BTLPartM.nCALC_ERR = ERR
m_BTLPartM.nCALC_ROT = ROT
m_BTLPartM.nCALC_FALL = FALL
m_BTLPartM.sCALC_MSG = MSG
If ERR = 0 Then
nState = CalcStates.OK
ElseIf ERR > 1 Then
@@ -1352,41 +1401,40 @@ Public Class BTLPartVM
nState = CalcStates.NOTCALCULATED
End If
End If
NotifyPropertyChanged("Calc_BorderBrush")
NotifyPropertyChanged(NameOf(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
m_BTLPartM.nGlobalState = nState
For Each Feature In BTLFeatureVMList
If Not Feature.bDO Then
ElseIf Feature.nState < 0 Then
m_nGlobalState = CalcStates.NOTCALCULATED
m_BTLPartM.nGlobalState = CalcStates.NOTCALCULATED
Exit For
ElseIf Feature.nState > 0 AndAlso m_nGlobalState = CalcStates.OK Then
m_nGlobalState = CalcStates.ERROR_
ElseIf Feature.nState > 0 AndAlso m_BTLPartM.nGlobalState = CalcStates.OK Then
m_BTLPartM.nGlobalState = CalcStates.ERROR_
End If
Next
NotifyPropertyChanged("Calc_BorderBrush")
NotifyPropertyChanged(NameOf(Calc_BorderBrush))
End Sub
Public Function Copy() As BTLPartVM
Public Function Copy() As BTLPartM
' creo nuovo part
Dim nNewPartId As Integer = EgtBeamCreatePart()
If nNewPartId = GDB_ID.NULL Then Return Nothing
EgtBeamSetPartProdNbr(Me.BTLStructureM.NewPDN())
EgtBeamSetPartName(Me.sNAM)
EgtBeamSetPartCount(Me.nCNT)
EgtBeamSetPartBox(Me.dL, Me.dH, Me.dW)
EgtBeamSetPartProdNbr(m_BTLStructureM.NewPDN())
EgtBeamSetPartName(m_BTLPartM.sNAM)
EgtBeamSetPartCount(m_BTLPartM.nCNT)
EgtBeamSetPartBox(m_BTLPartM.dL, m_BTLPartM.dH, m_BTLPartM.dW)
' aggiungo dati pezzo
Dim NewPart As New BTLPartVM(Me.BTLStructureM, nNewPartId)
Dim NewPart As BTLPartM = BTLPartM.CreateBTLPart(nNewPartId)
'aggiungo tutte le sue feature
For Each Feature In Me.FeatureList
For Each Feature In m_BTLFeatureVMList
Feature.Copy(NewPart)
Next
' aggiungo pezzo alla lista
Me.BTLStructureM.BTLPartMList.Add(NewPart)
m_BTLStructureM.AddBTLPart(NewPart)
Return NewPart
End Function
@@ -1424,13 +1472,13 @@ Public Class BTLPartVM
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)
m_BTLPartM.nINVERTED = If(m_BTLPartM.nINVERTED = 0, 180, 0)
EgtSetInfo(nPartId, BTL_PRT_INVERTED, m_BTLPartM.nINVERTED)
' imposto modificato per copie
EgtDuploSetModified(nPartId)
End If
EgtDraw()
NotifyPropertyChanged("sINVERTED")
NotifyPropertyChanged(NameOf(sINVERTED))
End Sub
#End Region ' Invert
@@ -1483,7 +1531,7 @@ Public Class BTLPartVM
Public Sub PartColourCmd()
Dim PartColor As New Color3d(192, 192, 192)
' Eseguo modifica con dialogo
If SelectColor(m_colCOLOR, PartColor) Then
If SelectColor(m_BTLPartM.colCOLOR, PartColor) Then
'm_colCOLOR = PartColor
sCOLRGB = PartColor.ToString
NotifyPropertyChanged("PartColour")
@@ -1523,4 +1571,69 @@ Public Class BTLPartVM
#End Region ' COMMANDS
#Region "EVENTS"
Private Sub OnBTLFeatureAdded(sender As Object, e As BTLFeatureAddedEventArgs)
Dim BTLFeatureVM As BTLFeatureVM = New BTLFeatureVM(e.NewBTLFeature, m_BTLPartM)
BTLFeatureVMList.Add(BTLFeatureVM)
End Sub
Private Sub OnBTLFeatureVMListChanged(sender As Object, e As NotifyCollectionChangedEventArgs)
If Not IsNothing(e.NewItems) AndAlso e.NewItems.Count > 0 Then
For Each BTLFeatureVM As BTLFeatureVM In e.NewItems
AddHandler BTLFeatureVM.PropertyChanged, AddressOf OnBTLFeatureVMPropertyChanged
Next
End If
If Not IsNothing(e.OldItems) AndAlso e.OldItems.Count > 0 Then
For Each BTLFeatureVM As BTLFeatureVM In e.OldItems
RemoveHandler BTLFeatureVM.PropertyChanged, AddressOf OnBTLFeatureVMPropertyChanged
Next
End If
End Sub
Private Sub OnBTLPParamVMListChanged(sender As Object, e As NotifyCollectionChangedEventArgs)
If Not IsNothing(e.NewItems) AndAlso e.NewItems.Count > 0 Then
For Each BTLParamVM As BTLParamVM In e.NewItems
AddHandler BTLParamVM.PropertyChanged, AddressOf OnBTLPParamVMPropertyChanged
Next
End If
If Not IsNothing(e.OldItems) AndAlso e.OldItems.Count > 0 Then
For Each BTLParamVM As BTLParamVM In e.OldItems
RemoveHandler BTLParamVM.PropertyChanged, AddressOf OnBTLPParamVMPropertyChanged
Next
End If
End Sub
Private Sub OnBTLQParamVMListChanged(sender As Object, e As NotifyCollectionChangedEventArgs)
If Not IsNothing(e.NewItems) AndAlso e.NewItems.Count > 0 Then
For Each BTLParamVM As BTLParamVM In e.NewItems
AddHandler BTLParamVM.PropertyChanged, AddressOf OnBTLQParamVMPropertyChanged
Next
End If
If Not IsNothing(e.OldItems) AndAlso e.OldItems.Count > 0 Then
For Each BTLParamVM As BTLParamVM In e.OldItems
RemoveHandler BTLParamVM.PropertyChanged, AddressOf OnBTLQParamVMPropertyChanged
Next
End If
End Sub
Private Sub OnBTLFeatureVMPropertyChanged(sender As Object, e As PropertyChangedEventArgs)
Select Case e.PropertyName
Case "nSelGRP", "nSelSIDE"
CalcFeatureUpdate()
Case "bDO"
NotifyPropertyChanged(NameOf(bDOALL))
End Select
End Sub
Private Sub OnBTLPParamVMPropertyChanged(sender As Object, e As PropertyChangedEventArgs)
Select Case e.PropertyName
Case "dValue", "sValue"
CalcFeatureUpdate()
End Select
End Sub
Private Sub OnBTLQParamVMPropertyChanged(sender As Object, e As PropertyChangedEventArgs)
Select Case e.PropertyName
'Case "nSelGRP", "nSelSIDE"
End Select
End Sub
#End Region
End Class
@@ -1,4 +1,6 @@
Imports System.Collections.ObjectModel
Imports System.Collections.Specialized
Imports System.ComponentModel
Imports EgtBEAMWALL.Core
Imports EgtUILib
Imports EgtWPFLib5
@@ -9,6 +11,11 @@ Public Class BTLStructureVM
#Region "FIELDS & PROPERTIES"
Private WithEvents m_BTLStructureM As BTLStructureM
Public ReadOnly Property BTLStructureM As BTLStructureM
Get
Return m_BTLStructureM
End Get
End Property
' variabile che indica se attiva la registrazione delle modifiche
Private m_bOldEnMod As Boolean = False
@@ -46,7 +53,7 @@ Public Class BTLStructureVM
' ciclo sui pezzi
For Each Part As BTLPartVM In m_BTLPartVMList
' se non è quello selezionato, lo nasondo
If Not Part Is SelBTLPart Then
If Part IsNot m_SelBTLPart Then
EgtSetMode(Part.nPartId, GDB_MD.HIDDEN)
Else
EgtSetMode(Part.nPartId, GDB_MD.STD)
@@ -59,7 +66,7 @@ Public Class BTLStructureVM
' seleziono pagina BottomPanel
Map.refBottomPanelVM.SetSelPartFeatureTab(BottomPanelVM.PartFeatureTab.PART)
' deseleziono le feature
If Not IsNothing(m_SelBTLPart.SelFeature) Then SelBTLPart.SelFeature = Nothing
If Not IsNothing(m_SelBTLPart.SelBTLFeatureVM) Then SelBTLPart.SelBTLFeatureVM = Nothing
' aggiorno stato selezionato tutto
Map.refShowBeamPanelVM.bShowAll = False
' aggiorno vista
@@ -459,30 +466,38 @@ Public Class BTLStructureVM
Sub New(BTLStructureM As BTLStructureM)
m_BTLStructureM = BTLStructureM
m_BTLPartVMList_View = CollectionViewSource.GetDefaultView(m_BTLStructureM.m_BTLPartMList)
AddHandler m_BTLStructureM.BTLPartAdded, AddressOf OnBTLPartAdded
' creo lista di BTLPartVM
CreateBTLPartVMList()
m_BTLPartVMList_View = CollectionViewSource.GetDefaultView(m_BTLPartVMList)
m_MaterialList_View = CollectionViewSource.GetDefaultView(m_MaterialList)
m_SectionList_View = CollectionViewSource.GetDefaultView(m_SectionList)
m_BTLPartVMList_View.Filter = AddressOf PartFilter
m_MaterialList_View.Filter = AddressOf MaterialFilter
m_SectionList_View.Filter = AddressOf SectionFilter
' creo lista di BTLPartVM
End Sub
#End Region ' CONSTRUCTOR
#Region "METHODS"
Private Sub BTLPartAdded(sender As Object, e As BTLPartAddedEventArgs) Handles m_BTLStructureM.BTLPartAdded
End Sub
Private Sub CreateBTLPartVMList()
Dim all As List(Of BTLPartVM) = (From BTLPartM In m_BTLStructureM.GetBTLParts()
Select New BTLPartVM(BTLPartM, m_BTLStructureM)).ToList()
m_BTLPartVMList = New ObservableCollection(Of BTLPartVM)(all)
For Each BTLPartVM As BTLPartVM In all
AddHandler BTLPartVM.PropertyChanged, AddressOf OnBTLPartVMPropertyChanged
' verifico sezione e materiale per inserirli nei filtri
If Not MaterialList.Contains(BTLPartVM.sMATERIAL) Then
MaterialList.Add(BTLPartVM.sMATERIAL)
End If
If Not SectionList.Contains(BTLPartVM.Section) Then
SectionList.Add(BTLPartVM.Section)
End If
Next
m_BTLPartVMList = New ObservableCollection(Of BTLPartVM)(all)
AddHandler m_BTLPartVMList.CollectionChanged, AddressOf OnBTLPartVMListChanged
End Sub
Private Sub DisableModified()
@@ -504,7 +519,7 @@ Public Class BTLStructureVM
Map.refShowBeamPanelVM.SetShowSolid(False)
End If
' tolgo pezzo selezionato
SelBTLPart.SelFeature = Nothing
SelBTLPart.SelBTLFeatureVM = Nothing
End If
SelBTLPart = Nothing
' mostro tutti i pezzi
@@ -527,7 +542,7 @@ Public Class BTLStructureVM
' disabilito impostazione modificato
DisableModified()
' tolgo pezzo selezionato
If Not IsNothing(SelBTLPart) Then SelBTLPart.SelFeature = Nothing
If Not IsNothing(SelBTLPart) Then SelBTLPart.SelBTLFeatureVM = Nothing
SelBTLPart = Nothing
' recupero il gruppo di assemblaggio
Dim AsseBaseId As Integer = EgtGetFirstNameInGroup(GDB_ID.ROOT, "AsseBase")
@@ -622,7 +637,7 @@ Public Class BTLStructureVM
' box della superficie
Dim b3Surf As New BBox3d
EgtGetBBox(SurfId, GDB_BB.STANDARD, b3Surf)
If b3Surf.IsEmpty() Or b3Surf.DimX() <2 * dStep Then
If b3Surf.IsEmpty() Or b3Surf.DimX() < 2 * dStep Then
Return SurfId
End If
' recupero le facce e le divido in X
@@ -717,10 +732,44 @@ Public Class BTLStructureVM
End If
End Sub
Public Shared Function Empty()
Return New BTLStructureVM
End Function
#End Region ' METHODS
#Region "EVENTS"
Private Sub OnBTLPartAdded(sender As Object, e As BTLPartAddedEventArgs)
Dim BTLPartVM As BTLPartVM = New BTLPartVM(e.NewBTLPart, m_BTLStructureM)
m_BTLPartVMList.Add(BTLPartVM)
NotifyPropertyChanged(NameOf(BTLPartVMList))
End Sub
Private Sub OnBTLPartVMListChanged(sender As Object, e As NotifyCollectionChangedEventArgs)
If Not IsNothing(e.NewItems) AndAlso e.NewItems.Count > 0 Then
For Each BTLPartVM As BTLPartVM In e.NewItems
AddHandler BTLPartVM.PropertyChanged, AddressOf OnBTLPartVMPropertyChanged
Next
End If
If Not IsNothing(e.OldItems) AndAlso e.OldItems.Count > 0 Then
For Each BTLPartVM As BTLPartVM In e.OldItems
RemoveHandler BTLPartVM.PropertyChanged, AddressOf OnBTLPartVMPropertyChanged
Next
End If
End Sub
Private Sub OnBTLPartVMPropertyChanged(sender As Object, e As PropertyChangedEventArgs)
Select Case e.PropertyName
Case "sMATERIAL"
If Not MaterialList.Contains(sender.m_sMATERIAL) Then
MaterialList.Add(sender.m_sMATERIAL)
End If
Case "sW", "sH", "sL"
If Not SectionList.Contains(sender.Section) Then
SectionList.Add(sender.Section)
End If
Case "sROTATION"
UpdateSectionFromRotation(CType(sender, BTLPartVM).BTLPartM)
End Select
End Sub
#End Region ' EVENTS
End Class
@@ -3,8 +3,8 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:EgtBEAMWALL="clr-namespace:EgtBEAMWALL.ViewerOptimizer">
<DataGrid ItemsSource="{Binding FeatureList}"
SelectedItem="{Binding SelFeature}"
<DataGrid ItemsSource="{Binding BTLFeatureVMList}"
SelectedItem="{Binding SelBTLFeatureVM}"
CanUserAddRows="False"
AutoGenerateColumns="False"
CanUserSortColumns="False"
@@ -17,7 +17,7 @@
ScrollViewer.HorizontalScrollBarVisibility="Hidden"
Margin="0,0,0,5">
<DataGrid.InputBindings>
<KeyBinding Key="Delete" Command="{Binding SelFeature.DeleteFeature_Command}" />
<KeyBinding Key="Delete" Command="{Binding SelBTLFeatureVM.DeleteFeature_Command}" />
</DataGrid.InputBindings>
<DataGrid.RowStyle>
<Style TargetType="DataGridRow">
@@ -3,8 +3,8 @@
Private Sub FeatureList_PreviewMouseDown(sender As Object, e As MouseButtonEventArgs)
If TypeOf sender Is DataGridRow Then
Dim Row As DataGridRow = DirectCast(sender, DataGridRow)
If Not IsNothing(Row) AndAlso Row.IsSelected AndAlso Not IsNothing(Map.refProjectVM.BTLStructure.SelBTLPart) Then
Map.refProjectVM.BTLStructure.SelBTLPart.SelFeature = Map.refProjectVM.BTLStructure.SelBTLPart.SelFeature
If Not IsNothing(Row) AndAlso Row.IsSelected AndAlso Not IsNothing(Map.refProjectVM.BTLStructureVM.SelBTLPart) Then
Map.refProjectVM.BTLStructureVM.SelBTLPart.SelBTLFeatureVM = Map.refProjectVM.BTLStructureVM.SelBTLPart.SelBTLFeatureVM
End If
End If
End Sub
@@ -3,8 +3,8 @@
Private Sub ParameterList_PreviewMouseDown(sender As Object, e As MouseButtonEventArgs)
If TypeOf sender Is DataGridRow Then
Dim Row As DataGridRow = DirectCast(sender, DataGridRow)
If Not IsNothing(Row) AndAlso Row.IsSelected AndAlso Not IsNothing(Map.refProjectVM.BTLStructure.SelBTLPart) AndAlso Not IsNothing(Map.refProjectVM.BTLStructure.SelBTLPart.SelFeature) Then
Map.refProjectVM.BTLStructure.SelBTLPart.SelFeature.SelPParam = Map.refProjectVM.BTLStructure.SelBTLPart.SelFeature.SelPParam
If Not IsNothing(Row) AndAlso Row.IsSelected AndAlso Not IsNothing(Map.refProjectVM.BTLStructureVM.SelBTLPart) AndAlso Not IsNothing(Map.refProjectVM.BTLStructureVM.SelBTLPart.SelBTLFeatureVM) Then
Map.refProjectVM.BTLStructureVM.SelBTLPart.SelBTLFeatureVM.SelPBTLParam = Map.refProjectVM.BTLStructureVM.SelBTLPart.SelBTLFeatureVM.SelPBTLParam
End If
End If
End Sub
@@ -2,8 +2,8 @@
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:EgtBEAMWALL="clr-namespace:EgtBEAMWALL.ViewerOptimizer">
<DataGrid ItemsSource="{Binding PartList}"
SelectedItem="{Binding SelPart}"
<DataGrid ItemsSource="{Binding BTLPartVMList}"
SelectedItem="{Binding SelBTLPart}"
CanUserAddRows="False"
AutoGenerateColumns="False"
CanUserSortColumns="False"
@@ -16,7 +16,7 @@
ScrollViewer.HorizontalScrollBarVisibility="Auto"
Margin="0,0,0,5">
<DataGrid.InputBindings>
<KeyBinding Key="Delete" Command="{Binding SelPart.DeletePart_Command}" />
<KeyBinding Key="Delete" Command="{Binding SelBTLPart.DeletePart_Command}" />
</DataGrid.InputBindings>
<DataGrid.RowStyle>
<Style TargetType="DataGridRow">
@@ -4,7 +4,7 @@
If TypeOf sender Is DataGridRow Then
Dim Row As DataGridRow = DirectCast(sender, DataGridRow)
If Not IsNothing(Row) AndAlso Row.IsSelected Then
Map.refProjectVM.BTLStructure.SelBTLPart = Map.refProjectVM.BTLStructure.SelBTLPart
Map.refProjectVM.BTLStructureVM.SelBTLPart = Map.refProjectVM.BTLStructureVM.SelBTLPart
End If
End If
End Sub
@@ -33,13 +33,13 @@
<RowDefinition Height="1*"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<EgtBEAMWALL:FeatureManagerV DataContext="{Binding Tag.SelFeature, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:BottomPanelV}}}"/>
<EgtBEAMWALL:FeatureManagerV DataContext="{Binding Tag.SelBTLFeatureVM, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:BottomPanelV}}}"/>
<TabControl Grid.Row="1"
TabStripPlacement="Left"
Margin="5,5,2.5,5">
<TabItem Header="P">
<TabItem.Content>
<EgtBEAMWALL:ParameterListV DataContext="{Binding Tag.SelFeature, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:BottomPanelV}}}"
<EgtBEAMWALL:ParameterListV DataContext="{Binding Tag.SelBTLFeatureVM, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:BottomPanelV}}}"
ItemsSource="{Binding PParamList}"
SelectedItem="{Binding SelPParam}"
Margin="5"/>
@@ -47,7 +47,7 @@
</TabItem>
<TabItem Header="Q">
<TabItem.Content>
<EgtBEAMWALL:ParameterListV DataContext="{Binding Tag.SelFeature, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:BottomPanelV}}}"
<EgtBEAMWALL:ParameterListV DataContext="{Binding Tag.SelBTLFeatureVM, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:BottomPanelV}}}"
ItemsSource="{Binding QParamList}"
SelectedItem="{Binding SelQParam}"
Margin="5"/>
@@ -72,7 +72,7 @@
</TabItem.Content>
</TabItem>
<TabItem Header="Feature"
DataContext="{Binding Tag.SelFeature, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:BottomPanelV}}}">
DataContext="{Binding Tag.SelBTLFeatureVM, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:BottomPanelV}}}">
<TabItem.Content>
<Image Source="{Binding SelParam.sDrawPath}"
Margin="5"/>
@@ -80,7 +80,7 @@
</TabItem>
</TabControl>
<TextBlock Grid.Row="2" Grid.ColumnSpan="2"
Text="{Binding Tag.SelFeature.nCALC_MSG, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:BottomPanelV}}}"
Text="{Binding Tag.SelBTLFeatureVM.nCALC_MSG, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:BottomPanelV}}}"
Margin="5,0,5,0"/>
</Grid>
</TabItem.Content>
@@ -27,20 +27,20 @@ Public Class ChangeParameterWndVM
' aggiorno lista parametri
m_ParamList.Clear()
Dim ParamIndex As Integer = 1
Dim NewBTLParam As BTLParamVM = Nothing
Dim NewBTLParam As BTLParamM = Nothing
' leggo tutti i P della feature
While BTLIniFile.GetBeamPrivateProfileParam(m_SelPRC.nGRP, m_SelPRC.nPRC, True, ParamIndex, Nothing, NewBTLParam)
m_ParamList.Add(New Parameters(True, NewBTLParam.nType, NewBTLParam.sName))
m_ParamList.Add(New Parameters(NewBTLParam))
ParamIndex += 1
End While
' leggo tutti i Q della feature
ParamIndex = 1
While BTLIniFile.GetBeamPrivateProfileParam(m_SelPRC.nGRP, m_SelPRC.nPRC, False, ParamIndex, Nothing, NewBTLParam)
m_ParamList.Add(New Parameters(False, NewBTLParam.nType, NewBTLParam.sName))
m_ParamList.Add(New Parameters(NewBTLParam))
ParamIndex += 1
End While
' aggiungo bDO come parametro
m_ParamList.Add(New Parameters(False, BTLParamType.CHECKBOX, "Abilitazione", True))
m_ParamList.Add(New Parameters(NewBTLParam, True))
End If
End Set
End Property
@@ -54,7 +54,7 @@ Public Class ChangeParameterWndVM
m_ParamList = value
End Set
End Property
Private m_SelParam As Parameters = New Parameters(False, BTLParamType.STRING_, "") ' per dargli un valore iniziale ed evitare che visualizzi sia text che check
Private m_SelParam As Parameters = New Parameters(BTLParamM.CreateNewBTLParam()) ' False, BTLParamType.STRING_, "") ' per dargli un valore iniziale ed evitare che visualizzi sia text che check
Public Property SelParam As Parameters
Get
Return m_SelParam
@@ -128,7 +128,7 @@ Public Class Parameters
End Property
Public Property sActualValue As String
Get
Select Case nType
Select Case m_BTLParamM.nType
Case BTLParamType.DOUBLE_
Return DoubleToString(m_dActualValue, 3)
Case BTLParamType.LENGTH
@@ -138,7 +138,7 @@ Public Class Parameters
End Select
End Get
Set(value As String)
Select Case nType
Select Case m_BTLParamM.nType
Case BTLParamType.DOUBLE_
StringToDouble(value, m_dActualValue)
Case BTLParamType.LENGTH
@@ -158,7 +158,7 @@ Public Class Parameters
End Property
Public Property sNewValue As String
Get
Select Case nType
Select Case m_BTLParamM.nType
Case BTLParamType.DOUBLE_
Return DoubleToString(m_dNewValue, 3)
Case BTLParamType.LENGTH
@@ -168,7 +168,7 @@ Public Class Parameters
End Select
End Get
Set(value As String)
Select Case nType
Select Case m_BTLParamM.nType
Case BTLParamType.DOUBLE_
StringToDouble(value, m_dNewValue)
Case BTLParamType.LENGTH
@@ -217,8 +217,8 @@ Public Class Parameters
End Set
End Property
Sub New(IsP As Boolean, nType As BTLParamType, sParamName As String, Optional IsCheckBox As Boolean = False)
MyBase.New(IsP, nType, sParamName)
Sub New(BTLParamM As BTLParamM, Optional IsCheckBox As Boolean = False)
MyBase.New(BTLParamM)
m_bIsCheckBox = IsCheckBox
End Sub
@@ -144,7 +144,6 @@
<Compile Include="BTLParam\BTLPartVM.vb" />
<Compile Include="BTLParam\BTLRawPartVM.vb" />
<Compile Include="Constants\ConstWarehouseIni.vb" />
<Compile Include="Utility\BTLIniFile.vb" />
<Compile Include="Utility\DbControllers.vb" />
<Compile Include="WarehouseWnd\WarehouseWndV.xaml.vb">
<DependentUpon>WarehouseWndV.xaml</DependentUpon>
@@ -65,26 +65,26 @@ Public Class MyInstrumentPanelVM
If ChangeParameterWnd.ShowDialog() Then
' faccio passare pezzi
If Not IsNothing(ChangeParameterWndVM.SelParam) Then
For Each Part In Map.refProjectVM.BTLStructure.BTLPartVMList
For Each Feature In Part.FeatureList.Where(Function(x) x.nPRC = ChangeParameterWndVM.SelPRC.nPRC AndAlso CalcBeamPrivateProfileGRP(x.nSelGRP) = ChangeParameterWndVM.SelPRC.nGRP)
If ChangeParameterWndVM.SelParam.nType = BTLParamType.CHECKBOX AndAlso Feature.bDO = ChangeParameterWndVM.SelParam.bActualValue Then
For Each Part In Map.refProjectVM.BTLStructureVM.BTLPartVMList
For Each Feature In Part.BTLFeatureVMList.Where(Function(x) x.nPRC = ChangeParameterWndVM.SelPRC.nPRC AndAlso CalcBeamPrivateProfileGRP(x.nSelGRP) = ChangeParameterWndVM.SelPRC.nGRP)
If ChangeParameterWndVM.SelParam.BTLParamM.nType = BTLParamType.CHECKBOX AndAlso Feature.bDO = ChangeParameterWndVM.SelParam.bActualValue Then
Feature.bDO = ChangeParameterWndVM.SelParam.bNewValue
Else
Dim ParamList As ObservableCollection(Of Core.BTLParam)
If ChangeParameterWndVM.SelParam.bIsP Then
ParamList = Feature.PParamList
Dim ParamList As ObservableCollection(Of BTLParamVM)
If ChangeParameterWndVM.SelParam.BTLParamM.bIsP Then
ParamList = Feature.PBTLParamVMList
Else
ParamList = Feature.QParamList
ParamList = Feature.QBTLParamVMList
End If
For Each Param In ParamList.Where(Function(x) x.sName = ChangeParameterWndVM.SelParam.sName)
Select Case Param.nType
Case BTLParamType.DOUBLE_, BTLParamType.LENGTH
If Param.dValue = ChangeParameterWndVM.SelParam.dActualValue Then
DirectCast(Param, BTLParamVM).UpdateParamValue(ChangeParameterWndVM.SelParam.dNewValue, "")
Param.UpdateParamValue(ChangeParameterWndVM.SelParam.dNewValue, "")
' rinfresco valori parametri feature correntemente selezionata
If Not IsNothing(Map.refProjectVM.BTLStructure.SelBTLPart) AndAlso
Not IsNothing(Map.refProjectVM.BTLStructure.SelBTLPart.SelFeature) AndAlso
Map.refProjectVM.BTLStructure.SelBTLPart.SelFeature Is Feature Then
If Not IsNothing(Map.refProjectVM.BTLStructureVM.SelBTLPart) AndAlso
Not IsNothing(Map.refProjectVM.BTLStructureVM.SelBTLPart.SelBTLFeatureVM) AndAlso
Map.refProjectVM.BTLStructureVM.SelBTLPart.SelBTLFeatureVM Is Feature Then
Param.NotifyPropertyChanged("sValue")
End If
End If
@@ -92,10 +92,10 @@ Public Class MyInstrumentPanelVM
If Param.sValue = ChangeParameterWndVM.SelParam.sActualValue Then
DirectCast(Param, BTLParamVM).UpdateParamValue(0, ChangeParameterWndVM.SelParam.sNewValue)
' rinfresco valori parametri feature correntemente selezionata
If Not IsNothing(Map.refProjectVM.BTLStructure.SelBTLPart) AndAlso
Not IsNothing(Map.refProjectVM.BTLStructure.SelBTLPart.SelFeature) AndAlso
Map.refProjectVM.BTLStructure.SelBTLPart.SelFeature.nPRC = ChangeParameterWndVM.SelPRC.nPRC AndAlso
Map.refProjectVM.BTLStructure.SelBTLPart.SelFeature.nSelGRP = ChangeParameterWndVM.SelPRC.nGRP Then
If Not IsNothing(Map.refProjectVM.BTLStructureVM.SelBTLPart) AndAlso
Not IsNothing(Map.refProjectVM.BTLStructureVM.SelBTLPart.SelBTLFeatureVM) AndAlso
Map.refProjectVM.BTLStructureVM.SelBTLPart.SelBTLFeatureVM.nPRC = ChangeParameterWndVM.SelPRC.nPRC AndAlso
Map.refProjectVM.BTLStructureVM.SelBTLPart.SelBTLFeatureVM.nSelGRP = ChangeParameterWndVM.SelPRC.nGRP Then
Param.NotifyPropertyChanged("sValue")
End If
End If
@@ -151,9 +151,9 @@ Public Class MyInstrumentPanelVM
Dim BarList() As CalcIntegration.Bar
If Map.refMainMenuVM.SelPage = Pages.VIEW Then
If ((Keyboard.Modifiers And ModifierKeys.Shift) = ModifierKeys.Shift) Then
Dim TempBarList(Map.refProjectVM.BTLStructure.BTLPartVMList.Count - 1) As CalcIntegration.Bar
For PartIndex = 0 To Map.refProjectVM.BTLStructure.BTLPartVMList.Count - 1
Dim CurrPart As BTLPartVM = Map.refProjectVM.BTLStructure.BTLPartVMList(PartIndex)
Dim TempBarList(Map.refProjectVM.BTLStructureVM.BTLPartVMList.Count - 1) As CalcIntegration.Bar
For PartIndex = 0 To Map.refProjectVM.BTLStructureVM.BTLPartVMList.Count - 1
Dim CurrPart As BTLPartVM = Map.refProjectVM.BTLStructureVM.BTLPartVMList(PartIndex)
Dim Bar As New CalcIntegration.Bar With {.nBarId = CurrPart.nPartId,
.nBarType = ProjectType.PROJ,
.bBarOk = True}
@@ -166,12 +166,12 @@ Public Class MyInstrumentPanelVM
TempBarList(PartIndex) = Bar
Next
BarList = TempBarList
ElseIf Not IsNothing(Map.refProjectVM.BTLStructure.SelBTLPart) Then
ElseIf Not IsNothing(Map.refProjectVM.BTLStructureVM.SelBTLPart) Then
Dim TempBarList(0) As CalcIntegration.Bar
Dim Bar As New CalcIntegration.Bar With {.nBarId = Map.refProjectVM.BTLStructure.SelBTLPart.nPartId,
Dim Bar As New CalcIntegration.Bar With {.nBarId = Map.refProjectVM.BTLStructureVM.SelBTLPart.nPartId,
.nBarType = ProjectType.PROJ,
.bBarOk = True}
Select Case Map.refProjectVM.BTLStructure.SelBTLPart.nState
Select Case Map.refProjectVM.BTLStructureVM.SelBTLPart.nState
Case Core.CalcStates.OK
Bar.nCmdType = CalcIntegration.CmdType.GENERATE
Case Else
@@ -264,9 +264,9 @@ Public Class MyInstrumentPanelVM
Dim Calc As New CalcIntegration
Dim BarList() As CalcIntegration.Bar
If Map.refMainMenuVM.SelPage = Pages.VIEW Then
If Not IsNothing(Map.refProjectVM.BTLStructure.SelBTLPart) Then
If Not IsNothing(Map.refProjectVM.BTLStructureVM.SelBTLPart) Then
Dim TempBarList(0) As CalcIntegration.Bar
Dim Bar As New CalcIntegration.Bar With {.nBarId = Map.refProjectVM.BTLStructure.SelBTLPart.nPartId,
Dim Bar As New CalcIntegration.Bar With {.nBarId = Map.refProjectVM.BTLStructureVM.SelBTLPart.nPartId,
.nBarType = ProjectType.PROJ,
.bBarOk = True,
.nCmdType = CalcIntegration.CmdType.SIMULATE}
@@ -334,7 +334,7 @@ Public Class CalcIntegration
' aggiornamento risultati in struttura BTL
If Bar.nBarType = ProjectType.PROJ Then
' cerco pezzo in btl structure da id
For Each Part In Map.refProjectVM.BTLStructure.BTLPartVMList
For Each Part In Map.refProjectVM.BTLStructureVM.BTLPartVMList
If Part.nPartId = cutId Then
currBTLPart = Part
End If
@@ -363,7 +363,7 @@ Public Class CalcIntegration
If Bar.nBarType = ProjectType.PROJ Then
' cerco task in btl structure da id
If Not IsNothing(currBTLPart) Then
For Each Feature In currBTLPart.FeatureList
For Each Feature In currBTLPart.BTLFeatureVMList
If Feature.nFeatureId = taskId Then
DirectCast(Feature, BTLFeatureVM).CalcFeatureUpdate(True, nErr, dRot, nFall, sMsg)
End If
@@ -374,7 +374,7 @@ Public Class CalcIntegration
If Not IsNothing(currPart) Then
For Each Feature In currPart.FeatureList
If Feature.nFeatureId = taskId Then
DirectCast(Feature, BTLFeatureVM).CalcFeatureUpdate(True, nErr, dRot, nFall, sMsg)
'''DirectCast(Feature, BTLFeatureVM).CalcFeatureUpdate(True, nErr, dRot, nFall, sMsg)
End If
Next
End If
@@ -418,7 +418,7 @@ Public Class CalcIntegration
' aggiornamento risultati in struttura BTL
If Bar.nBarType = ProjectType.PROJ Then
' cerco pezzo in btl structure da id
For Each Part In Map.refProjectVM.BTLStructure.BTLPartVMList
For Each Part In Map.refProjectVM.BTLStructureVM.BTLPartVMList
If Part.nPartId = Bar.nBarId Then
' leggo errori da geometria e li aggiorno in struttura btl
DirectCast(Part, BTLPartVM).CalcFeatureUpdate()
@@ -95,7 +95,7 @@
Visibility="{Binding ViewPage_Visibility}"
Style="{StaticResource LeftPanel_SmallButton}"/>
</StackPanel>
<EgtBEAMWALL:FeatureListV DataContext="{Binding Tag.SelPart, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:LeftPanelV}}}"
<EgtBEAMWALL:FeatureListV DataContext="{Binding Tag.SelBTLPart, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:LeftPanelV}}}"
Grid.Row="1"/>
</Grid>
@@ -1,5 +1,6 @@
Imports System.Collections.ObjectModel
Imports System.IO
Imports EgtBEAMWALL.Core
Imports EgtUILib
Imports EgtWPFLib5
@@ -66,7 +67,7 @@ Public Class LeftPanelVM
''' Execute the Exec. This method is invoked by the ExecCommand.
''' </summary>
Public Sub NewRawPart()
Dim SelPart As BTLPartVM = Map.refProjectVM.BTLStructure.SelBTLPart
Dim SelPart As BTLPartVM = Map.refProjectVM.BTLStructureVM.SelBTLPart
If IsNothing(SelPart) Then Return
' Determino il tipo di macchina (travi o pareti)
Dim nMachType As MachineType = Map.refMachinePanelVM.SelectedMachine.nType
@@ -144,7 +145,7 @@ Public Class LeftPanelVM
''' Execute the Exec. This method is invoked by the ExecCommand.
''' </summary>
Public Sub AddToRawPart()
Dim SelPart As BTLPartVM = Map.refProjectVM.BTLStructure.SelBTLPart
Dim SelPart As BTLPartVM = Map.refProjectVM.BTLStructureVM.SelBTLPart
If IsNothing(SelPart) Then Return
Dim SelMachGroup As MachGroup = Map.refMachGroupPanelVM.SelectedMachGroup
If IsNothing(SelMachGroup) Then Return
@@ -176,7 +177,7 @@ Public Class LeftPanelVM
Dim dPosY As Double = 10
' Se ci sono pezzi già inseriti
If WallMachGroup.PartList.Count > 0 Then
Dim LastWall As Wall = DirectCast( WallMachGroup.PartList(WallMachGroup.PartList.Count - 1), Wall)
Dim LastWall As Wall = DirectCast(WallMachGroup.PartList(WallMachGroup.PartList.Count - 1), Wall)
' verifico se posso metterlo sopra in Y
Dim NextPosY = LastWall.dPOSY + LastWall.dW + RawPartConfiguration.dWallDist
If WallMachGroup.dW - NextPosY > SelPart.dW + 10 Then
@@ -185,17 +186,17 @@ Public Class LeftPanelVM
Else
dPosX = 10
For i As Integer = 0 To WallMachGroup.PartList.Count - 1
Dim CurrWall As Wall = DirectCast( WallMachGroup.PartList(i), Wall)
Dim CurrWall As Wall = DirectCast(WallMachGroup.PartList(i), Wall)
Dim NextPosX = CurrWall.dPOSX + CurrWall.dL + RawPartConfiguration.dWallDist
If NextPosX > dPosX Then
dPOSX = NextPosX
If NextPosX > dPosX Then
dPosX = NextPosX
End If
Next
dPosY = 10
End If
End If
End If
' scrivo dati in gruppo di lavorazione
EgtSetInfo(nCurrMachGroup, MGR_RPT_PART & WallMachGroup.PartList.Count + 1, SelPart.nPartId & "," & dPOSX & "," & dPosY & "," & 0 & "," & 0)
EgtSetInfo(nCurrMachGroup, MGR_RPT_PART & WallMachGroup.PartList.Count + 1, SelPart.nPartId & "," & dPosX & "," & dPosY & "," & 0 & "," & 0)
' eseguo script creazione grezzo
Dim nRawId As Integer = EgtGetFirstRawPart()
While nRawId <> GDB_ID.NULL
@@ -304,12 +305,13 @@ Public Class LeftPanelVM
''' Execute the Exec. This method is invoked by the ExecCommand.
''' </summary>
Public Sub CopyPart()
Dim SelPart As BTLPartVM = Map.refProjectVM.BTLStructure.SelBTLPart
Dim SelPart As BTLPartVM = Map.refProjectVM.BTLStructureVM.SelBTLPart
If IsNothing(SelPart) Then Return
' creo copia
Dim NewPart = SelPart.Copy()
Dim NewPart As BTLPartM = SelPart.Copy()
If Not IsNothing(NewPart) Then
Map.refProjectVM.BTLStructure.SelBTLPart = NewPart
' selezione ultimo che e' quello appena crerato
Map.refProjectVM.BTLStructureVM.SelBTLPart = Map.refProjectVM.BTLStructureVM.BTLPartVMList(Map.refProjectVM.BTLStructureVM.BTLPartVMList.Count - 1)
End If
End Sub
@@ -346,10 +348,10 @@ Public Class LeftPanelVM
EgtBeamSetPartCount(AddPartWndVM.nCNT)
EgtBeamSetPartBox(AddPartWndVM.dL, AddPartWndVM.dH, AddPartWndVM.dW)
' aggiungo dati pezzo
Dim NewPart As New BTLPartVM(Map.refProjectVM.BTLStructure, nNewPartId)
Dim NewPart As BTLPartM = BTLPartM.CreateBTLPart(nNewPartId)
' aggiungo pezzo alla lista
Map.refProjectVM.BTLStructure.BTLPartVMList.Add(NewPart)
Map.refProjectVM.BTLStructure.SelBTLPart = NewPart
Map.refProjectVM.BTLStructureVM.BTLStructureM.AddBTLPart(NewPart)
Map.refProjectVM.BTLStructureVM.SelBTLPart = Map.refProjectVM.BTLStructureVM.BTLPartVMList.Where(Function(x) x.BTLPartM Is NewPart)
End If
End Sub
@@ -374,27 +376,27 @@ Public Class LeftPanelVM
''' Execute the Exec. This method is invoked by the ExecCommand.
''' </summary>
Public Sub RemovePart()
If IsNothing(Map.refProjectVM.BTLStructure.SelBTLPart) Then Return
EgtBeamSetPart(Map.refProjectVM.BTLStructure.SelBTLPart.nPartId)
If IsNothing(Map.refProjectVM.BTLStructureVM.SelBTLPart) Then Return
EgtBeamSetPart(Map.refProjectVM.BTLStructureVM.SelBTLPart.nPartId)
If EgtBeamErasePart() Then
' rimuovo dalla lista pezzi
Dim Index As Integer = Map.refProjectVM.BTLStructure.BTLPartVMList.IndexOf(Map.refProjectVM.BTLStructure.SelBTLPart)
Dim Index As Integer = Map.refProjectVM.BTLStructureVM.BTLPartVMList.IndexOf(Map.refProjectVM.BTLStructureVM.SelBTLPart)
If Index = 0 Then
If Map.refProjectVM.BTLStructure.BTLPartVMList.Count > 0 Then
Map.refProjectVM.BTLStructure.SelBTLPart = Map.refProjectVM.BTLStructure.BTLPartVMList(0)
If Map.refProjectVM.BTLStructureVM.BTLPartVMList.Count > 0 Then
Map.refProjectVM.BTLStructureVM.SelBTLPart = Map.refProjectVM.BTLStructureVM.BTLPartVMList(0)
Else
Map.refProjectVM.BTLStructure.SelBTLPart = Nothing
Map.refProjectVM.BTLStructureVM.SelBTLPart = Nothing
End If
ElseIf Index = Map.refProjectVM.BTLStructure.BTLPartVMList.Count - 1 Then
If Map.refProjectVM.BTLStructure.BTLPartVMList.Count > 1 Then
Map.refProjectVM.BTLStructure.SelBTLPart = Map.refProjectVM.BTLStructure.BTLPartVMList(Map.refProjectVM.BTLStructure.BTLPartVMList.Count - 2)
ElseIf Index = Map.refProjectVM.BTLStructureVM.BTLPartVMList.Count - 1 Then
If Map.refProjectVM.BTLStructureVM.BTLPartVMList.Count > 1 Then
Map.refProjectVM.BTLStructureVM.SelBTLPart = Map.refProjectVM.BTLStructureVM.BTLPartVMList(Map.refProjectVM.BTLStructureVM.BTLPartVMList.Count - 2)
Else
Map.refProjectVM.BTLStructure.SelBTLPart = Nothing
Map.refProjectVM.BTLStructureVM.SelBTLPart = Nothing
End If
Else
Map.refProjectVM.BTLStructure.SelBTLPart = Map.refProjectVM.BTLStructure.BTLPartVMList(Index - 1)
Map.refProjectVM.BTLStructureVM.SelBTLPart = Map.refProjectVM.BTLStructureVM.BTLPartVMList(Index - 1)
End If
Map.refProjectVM.BTLStructure.BTLPartVMList.RemoveAt(Index)
Map.refProjectVM.BTLStructureVM.BTLPartVMList.RemoveAt(Index)
End If
End Sub
@@ -418,14 +420,14 @@ Public Class LeftPanelVM
''' Execute the Exec. This method is invoked by the ExecCommand.
''' </summary>
Public Sub CopyFeature()
Dim SelPart As BTLPartVM = Map.refProjectVM.BTLStructure.SelBTLPart
Dim SelPart As BTLPartVM = Map.refProjectVM.BTLStructureVM.SelBTLPart
If IsNothing(SelPart) Then Return
Dim SelFeature As BTLFeatureVM = SelPart.SelFeature
Dim SelFeature As BTLFeatureVM = SelPart.SelBTLFeatureVM
If IsNothing(SelFeature) Then Return
' creo copia
Dim NewFeature = SelFeature.Copy()
If Not IsNothing(NewFeature) Then
Map.refProjectVM.BTLStructure.SelBTLPart.SelFeature = NewFeature
Map.refProjectVM.BTLStructureVM.SelBTLPart.SelBTLFeatureVM = Map.refProjectVM.BTLStructureVM.SelBTLPart.BTLFeatureVMList.Where(Function(x) x.BTLFeatureM Is NewFeature)
End If
End Sub
@@ -449,7 +451,7 @@ Public Class LeftPanelVM
''' Execute the Exec. This method is invoked by the ExecCommand.
''' </summary>
Public Sub MacroFeature()
If IsNothing(Map.refProjectVM.BTLStructure.SelBTLPart) Then Return
If IsNothing(Map.refProjectVM.BTLStructureVM.SelBTLPart) Then Return
' apro finestra di creazione macro
Dim MacroFeatureWndVM As New MacroFeatureWndVM()
Dim MacroFeatureWnd As New MacroFeatureWndV(Application.Current.MainWindow, MacroFeatureWndVM)
@@ -478,12 +480,12 @@ Public Class LeftPanelVM
''' Execute the Exec. This method is invoked by the ExecCommand.
''' </summary>
Public Sub AddFeature(ByVal param As Object)
If IsNothing(Map.refProjectVM.BTLStructure.SelBTLPart) Then Return
If IsNothing(Map.refProjectVM.BTLStructureVM.SelBTLPart) Then Return
' apro finestra di definizione nuova feature
Dim AddFeatureWndVM As New AddFeatureWndVM()
Dim AddFeatureWnd As New AddFeatureWndV(Application.Current.MainWindow, AddFeatureWndVM)
If AddFeatureWnd.ShowDialog() Then
Dim NewFeat As BTLFeatureVM
Dim NewFeat As BTLFeatureM
Dim nNewFeatureId As Integer = 0
Dim bMacroFlag As Boolean = False
' verifico se una Macro è selezionata
@@ -491,10 +493,10 @@ Public Class LeftPanelVM
' Creo nuova feature sulla base della Macro selezionata
' Creo table e setto variabili
EgtLuaCreateGlobTable("MACRO")
EgtLuaSetGlobNumVar("MACRO.L", Map.refProjectVM.BTLStructure.SelBTLPart.dL)
EgtLuaSetGlobNumVar("MACRO.W", Map.refProjectVM.BTLStructure.SelBTLPart.dW)
EgtLuaSetGlobNumVar("MACRO.H", Map.refProjectVM.BTLStructure.SelBTLPart.dH)
EgtLuaSetGlobIntVar("MACRO.PROCID", Map.refProjectVM.BTLStructure.SelBTLPart.NewProcId())
EgtLuaSetGlobNumVar("MACRO.L", Map.refProjectVM.BTLStructureVM.SelBTLPart.dL)
EgtLuaSetGlobNumVar("MACRO.W", Map.refProjectVM.BTLStructureVM.SelBTLPart.dW)
EgtLuaSetGlobNumVar("MACRO.H", Map.refProjectVM.BTLStructureVM.SelBTLPart.dH)
EgtLuaSetGlobIntVar("MACRO.PROCID", Map.refProjectVM.BTLStructureVM.SelBTLPart.BTLPartM.NewProcId())
Dim bOk = EgtLuaExecFile(AddFeatureWndVM.m_MacroFilePathList(AddFeatureWndVM.nSelMacro))
' Leggo variabili
EgtLuaGetGlobIntVar("MACRO.FEATUREID", nNewFeatureId)
@@ -507,24 +509,23 @@ Public Class LeftPanelVM
bMacroFlag = True
Else
' Creo nuova feature (Macro non selezionata)
NewFeat = New BTLFeatureVM(AddFeatureWndVM.nSelPRC.nPRC, AddFeatureWndVM.nSelPRC.nGRP, AddFeatureWndVM.nSelPRC.nSIDE)
NewFeat.CreateFeatureParams()
NewFeat = BTLFeatureM.CreateBTLFeature(AddFeatureWndVM.nSelPRC.nPRC, AddFeatureWndVM.nSelPRC.nGRP, AddFeatureWndVM.nSelPRC.nSIDE)
NewFeat.SetDefaultValues()
Dim vPar() As Double
Dim vPar() As Double = Nothing
Dim sPar As String = String.Empty
NewFeat.CalcParamArray(vPar, sPar)
' aggiorno la feature con nuovo valore
EgtBeamSetPart(Map.refProjectVM.BTLStructure.SelBTLPart.nPartId)
nNewFeatureId = EgtBeamAddProcess(NewFeat.nSelGRP, NewFeat.nPRC, NewFeat.nSelSIDE, "", Map.refProjectVM.BTLStructure.SelBTLPart.NewProcId(), New Frame3d(), vPar, sPar)
EgtBeamSetPart(Map.refProjectVM.BTLStructureVM.SelBTLPart.nPartId)
nNewFeatureId = EgtBeamAddProcess(NewFeat.nSelGRP, NewFeat.nPRC, NewFeat.nSelSIDE, "", Map.refProjectVM.BTLStructureVM.SelBTLPart.BTLPartM.NewProcId(), New Frame3d(), vPar, sPar)
bMacroFlag = False
End If
' se è stata creata
If nNewFeatureId <> GDB_ID.NULL Then
' la aggiungo a struttura BTL corrente
NewFeat = New BTLFeatureVM(Map.refProjectVM.BTLStructure.SelBTLPart, nNewFeatureId)
NewFeat = BTLFeatureM.CreateBTLFeature(Map.refProjectVM.BTLStructureVM.SelBTLPart.BTLPartM, nNewFeatureId)
If Not bMacroFlag Then NewFeat.SetDefaultValues()
Map.refProjectVM.BTLStructure.SelBTLPart.FeatureList.Add(NewFeat)
Map.refProjectVM.BTLStructure.SelBTLPart.SelFeature = NewFeat
Map.refProjectVM.BTLStructureVM.SelBTLPart.BTLPartM.AddBTLFeature(NewFeat)
Map.refProjectVM.BTLStructureVM.SelBTLPart.SelBTLFeatureVM = Map.refProjectVM.BTLStructureVM.SelBTLPart.BTLFeatureVMList.Where(Function(x) x.BTLFeatureM Is NewFeat)
End If
End If
End Sub
@@ -549,25 +550,25 @@ Public Class LeftPanelVM
''' Execute the Exec. This method is invoked by the ExecCommand.
''' </summary>
Public Sub RemoveFeature()
If EgtBeamEraseProcess(Map.refProjectVM.BTLStructure.SelBTLPart.SelFeature.nFeatureId) Then
If EgtBeamEraseProcess(Map.refProjectVM.BTLStructureVM.SelBTLPart.SelBTLFeatureVM.nFeatureId) Then
' rimuovo dalla lista pezzi
Dim Index As Integer = Map.refProjectVM.BTLStructure.SelBTLPart.FeatureList.IndexOf(Map.refProjectVM.BTLStructure.SelBTLPart.SelFeature)
Dim Index As Integer = Map.refProjectVM.BTLStructureVM.SelBTLPart.BTLFeatureVMList.IndexOf(Map.refProjectVM.BTLStructureVM.SelBTLPart.SelBTLFeatureVM)
If Index = 0 Then
If Map.refProjectVM.BTLStructure.SelBTLPart.FeatureList.Count > 0 Then
Map.refProjectVM.BTLStructure.SelBTLPart.SelFeature = Map.refProjectVM.BTLStructure.SelBTLPart.FeatureList(0)
If Map.refProjectVM.BTLStructureVM.SelBTLPart.BTLFeatureVMList.Count > 0 Then
Map.refProjectVM.BTLStructureVM.SelBTLPart.SelBTLFeatureVM = Map.refProjectVM.BTLStructureVM.SelBTLPart.BTLFeatureVMList(0)
Else
Map.refProjectVM.BTLStructure.SelBTLPart.SelFeature = Nothing
Map.refProjectVM.BTLStructureVM.SelBTLPart.SelBTLFeatureVM = Nothing
End If
ElseIf Index = Map.refProjectVM.BTLStructure.SelBTLPart.FeatureList.Count - 1 Then
If Map.refProjectVM.BTLStructure.SelBTLPart.FeatureList.Count > 1 Then
Map.refProjectVM.BTLStructure.SelBTLPart.SelFeature = Map.refProjectVM.BTLStructure.SelBTLPart.FeatureList(Map.refProjectVM.BTLStructure.SelBTLPart.FeatureList.Count - 2)
ElseIf Index = Map.refProjectVM.BTLStructureVM.SelBTLPart.BTLFeatureVMList.Count - 1 Then
If Map.refProjectVM.BTLStructureVM.SelBTLPart.BTLFeatureVMList.Count > 1 Then
Map.refProjectVM.BTLStructureVM.SelBTLPart.SelBTLFeatureVM = Map.refProjectVM.BTLStructureVM.SelBTLPart.BTLFeatureVMList(Map.refProjectVM.BTLStructureVM.SelBTLPart.BTLFeatureVMList.Count - 2)
Else
Map.refProjectVM.BTLStructure.SelBTLPart.SelFeature = Nothing
Map.refProjectVM.BTLStructureVM.SelBTLPart.SelBTLFeatureVM = Nothing
End If
Else
Map.refProjectVM.BTLStructure.SelBTLPart.SelFeature = Map.refProjectVM.BTLStructure.SelBTLPart.FeatureList(Index - 1)
Map.refProjectVM.BTLStructureVM.SelBTLPart.SelBTLFeatureVM = Map.refProjectVM.BTLStructureVM.SelBTLPart.BTLFeatureVMList(Index - 1)
End If
Map.refProjectVM.BTLStructure.SelBTLPart.FeatureList.RemoveAt(Index)
Map.refProjectVM.BTLStructureVM.SelBTLPart.BTLFeatureVMList.RemoveAt(Index)
EgtDraw()
End If
End Sub
@@ -588,7 +588,7 @@ Public Class Beam
Dim nGRP As Integer
If EgtGetInfo(nFeatureId, BTL_FTR_GRP, nGRP) Then
' creo la feature
FeatureList.Add(New BTLFeatureVM(Nothing, nFeatureId))
'''FeatureList.Add(New BTLFeatureVM(Nothing, nFeatureId))
End If
nFeatureId = EgtGetNext(nFeatureId)
End While
@@ -717,7 +717,7 @@ Public Class Wall
Dim nGRP As Integer
If EgtGetInfo(nFeatureId, BTL_FTR_GRP, nGRP) Then
' creo la feature
FeatureList.Add(New BTLFeatureVM(Nothing, nFeatureId))
'''FeatureList.Add(New BTLFeatureVM(Nothing, nFeatureId))
End If
nFeatureId = EgtGetNext(nFeatureId)
End While
@@ -66,7 +66,7 @@ Public Class MacroFeatureWndVM
#Region "CONSTRUCTOR"
Sub New()
For Each FeatureItem In Map.refProjectVM.BTLStructure.SelBTLPart.FeatureList
For Each FeatureItem In Map.refProjectVM.BTLStructureVM.SelBTLPart.BTLFeatureVMList
FeatureList.Add(FeatureItem)
Next
End Sub
@@ -129,7 +129,7 @@ Public Class MacroFeatureWndVM
Dim vPar() As Double = Nothing
Dim sPar As String = String.Empty
Dim s_vPar As String = String.Empty
nSelFeature.CalcParamArray(vPar, sPar)
nSelFeature.BTLFeatureM.CalcParamArray(vPar, sPar)
For Each vParItem In vPar
s_vPar = s_vPar & " " & DoubleToString(vParItem, 3) & ","
Next
@@ -167,7 +167,7 @@ Public Class MainMenuVM
End If
Else
Map.refSceneHostVM.MainController.NewProject()
Map.refProjectVM.BTLStructure = Nothing
Map.refProjectVM.BTLStructureVM = Nothing
End If
Map.refMainWindowVM.NotifyPropertyChanged("nSelTabPage")
Return True
@@ -80,14 +80,14 @@ Public Class OptimizePanelVM
''' </summary>
Friend Sub Optimize()
If IsNothing(m_SelPartType) OrElse IsNothing(m_SelOriginType) Then Return
If IsNothing(Map.refProjectVM.BTLStructure.BTLPartVMList) OrElse Map.refProjectVM.BTLStructure.BTLPartVMList.Count = 0 Then Return
If IsNothing(Map.refProjectVM.BTLStructureVM.BTLPartVMList) OrElse Map.refProjectVM.BTLStructureVM.BTLPartVMList.Count = 0 Then Return
Dim sLogPath As String = Map.refMainWindowVM.MainWindowM.sTempDir & "\RawPartLog.txt"
Dim SectionList As New List(Of SParam)
' se ho selezionato nest per materiale e c'è una sezione selezionata diversa da sezione nulla
If m_SelPartType.Id = PartType.MATERIAL AndAlso Not IsNothing(Map.refProjectVM.BTLStructure.SelSection) AndAlso Map.refProjectVM.BTLStructure.SelSection.dH <> -1 Then
SectionList.Add(New SParam(Map.refProjectVM.BTLStructure.SelSection, 0, 0))
If m_SelPartType.Id = PartType.MATERIAL AndAlso Not IsNothing(Map.refProjectVM.BTLStructureVM.SelSection) AndAlso Map.refProjectVM.BTLStructureVM.SelSection.dH <> -1 Then
SectionList.Add(New SParam(Map.refProjectVM.BTLStructureVM.SelSection, 0, 0))
Else
For Each Section In Map.refProjectVM.BTLStructure.SectionList
For Each Section In Map.refProjectVM.BTLStructureVM.SectionList
If Section.dH = -1 Then Continue For
SectionList.Add(New SParam(Section, 0, 0))
Next
@@ -161,7 +161,7 @@ Public Class OptimizePanelVM
' attivo loading progress
Map.refMyStatusBarVM.StartLoading("Nesting started", True)
For Each Section In SectionList
Dim SectionPartList As New List(Of Core.BTLPartM)(Map.refProjectVM.BTLStructure.BTLPartVMList.Where(Function(x) x.Section = Section.SectXMat).ToList())
Dim SectionPartList As New List(Of Core.BTLPartM)(Map.refProjectVM.BTLStructureVM.BTLPartVMList.Where(Function(x) x.Section = Section.SectXMat).ToList())
' passo a lua lista id pezzi da nestare
ExecNesting(sLogPath, CurrentMachine.sMachineName, SectionPartList, Section.dL, Section.dW, dStartOffset, dOffset, dKerf)
Next
@@ -248,7 +248,7 @@ Public Class ProjManagerVM
Map.refSceneHostVM.SaveProject()
Map.refMainWindowVM.SetTitle(CurrProj.nProjId.ToString("0000") & " - " & CurrProj.BTLFileName & " - EgtBEAMWALL")
' aggiorno su DB
DbControllers.m_ProjController.UpdateBtlParts(CurrProj.nProjId, Map.refProjectVM.BTLStructure.BTLPartVMList.ToList())
DbControllers.m_ProjController.UpdateBtlParts(CurrProj.nProjId, Map.refProjectVM.BTLStructureVM.BTLStructureM.BTLPartMList)
' se nuovo progetto, incremento l'indice di progetto
'If m_CurrProj.NewProj Then
@@ -16,7 +16,7 @@
<EgtBEAMWALL:LeftPanelV DockPanel.Dock="Left"
DataContext="{StaticResource LeftPanelVM}"
Tag="{Binding DataContext.BTLStructure, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:ProjectV}}}"
Tag="{Binding DataContext.BTLStructureVM, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:ProjectV}}}"
Visibility="{Binding DataContext.LeftPanel_Visibility, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:ProjectV}}}"/>
<EgtBEAMWALL:TopPanelV DockPanel.Dock="Top"
DataContext="{StaticResource TopPanelVM}"
@@ -24,7 +24,7 @@
Visibility="{Binding DataContext.TopPanel_Visibility, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:ProjectV}}}"/>
<EgtBEAMWALL:BottomPanelV DockPanel.Dock="Bottom"
DataContext="{StaticResource BottomPanelVM}"
Tag="{Binding DataContext.BTLStructure.SelPart, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:ProjectV}}}"
Tag="{Binding DataContext.BTLStructureVM.SelBTLPart, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:ProjectV}}}"
Visibility="{Binding DataContext.BottomPanel_Visibility, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:ProjectV}}}"/>
<EgtFloating:EgtFloatingTray x:Name="SCENETOPTRAY"
@@ -41,7 +41,7 @@
DataContext="{Binding BTLStructure.SelPart}"
Visibility="{Binding DataContext.FeatureManager_Visibility, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:ProjectV}}}"/>-->
<EgtBEAMWALL:PartManagerV DockPanel.Dock="Bottom"
DataContext="{Binding BTLStructure.SelPart}"
DataContext="{Binding BTLStructureVM.SelBTLPart}"
Visibility="{Binding DataContext.PartManager_Visibility, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:ProjectV}}}"/>
<EgtBEAMWALL:SceneHostV/>
@@ -3,14 +3,14 @@
#Region "FIELDS & PROPERTIES"
Private m_BTLStructure As BTLStructureVM
Public Property BTLStructure As BTLStructureVM
Private m_BTLStructureVM As BTLStructureVM
Public Property BTLStructureVM As BTLStructureVM
Get
Return m_BTLStructure
Return m_BTLStructureVM
End Get
Set(value As BTLStructureVM)
m_BTLStructure = value
NotifyPropertyChanged("BTLStructure")
m_BTLStructureVM = value
NotifyPropertyChanged("BTLStructureVM")
End Set
End Property
@@ -2,6 +2,7 @@
Imports System.IO
Imports EgtUILib
Imports EgtWPFLib5
Imports EgtBEAMWALL.Core
Public Class MySceneHostVM
Inherits EgtWPFLib5.SceneHostVM
@@ -27,7 +28,6 @@ Public Class MySceneHostVM
Private bReducedCut As Boolean = False
Private m_bMagnetic As Boolean
#Region "CONSTRUCTOR"
Sub New()
@@ -230,21 +230,22 @@ Public Class MySceneHostVM
Private Sub OnNewProject(sender As Object, bOk As Boolean)
Map.refMainWindowVM.SetTitle(" New - EgtBEAMWALL")
Map.refProjectVM.BTLStructure = BTLStructureVM.Empty
Map.refProjectVM.BTLStructureVM = New BTLStructureVM(BTLStructureM.CreateNewBTLStructure())
End Sub
Private Sub OnOpenProject(sender As Object, sFile As String, bOk As Boolean)
' Procedo a seconda del risultato
If bOk Then
' leggo struttura BTL
Map.refProjectVM.BTLStructure = BTLStructureVM.Init()
Map.refProjectVM.BTLStructureVM = New BTLStructureVM(BTLStructureM.CreateBTLStructure())
If Map.refMainMenuVM.SelPage = Pages.MACHINING Then
Map.refProjectVM.MachGroupPanelVM = New MyMachGroupPanelVM
End If
Map.refProjectVM.BTLStructure.ShowAll()
Map.refProjectVM.BTLStructureVM.ShowAll()
WriteMainPrivateProfileString(S_GENERAL, K_LASTPROJ, sFile)
Else
EgtNewFile()
Map.refProjectVM.BTLStructureVM = New BTLStructureVM(BTLStructureM.CreateNewBTLStructure())
Map.refMainWindowVM.SetTitle(" New - EgtBEAMWALL")
Dim sMsg As String = EgtMsg(10003) & " '" & sFile & "'" 'Error opening file
MessageBox.Show(sMsg, EgtMsg(10001), MessageBoxButton.OK, MessageBoxImage.Error) 'Error
@@ -278,7 +279,7 @@ Public Class MySceneHostVM
WriteMainPrivateProfileString(S_GENERAL, K_LASTIMPDIR, Path.GetDirectoryName(sFile))
If bOk Then
' leggo struttura BTL
Map.refProjectVM.BTLStructure = BTLStructureVM.Init()
Map.refProjectVM.BTLStructureVM = New BTLStructureVM(BTLStructureM.CreateBTLStructure())
' Ricavo il tipo di Warehouse settato nell'INI
Dim nDefault As Integer = 1
If GetMainPrivateProfileInt(S_GENERAL, K_WAREHOUSE, nDefault) = WarehouseType.MEDIUM Then
@@ -295,7 +296,7 @@ Public Class MySceneHostVM
nPartId = EgtGetNextPart(nPartId)
End While
' mostro tutti i pezzi
Map.refProjectVM.BTLStructure.ShowAll()
Map.refProjectVM.BTLStructureVM.ShowAll()
Else
Dim sMsg As String = EgtMsg(10006) & " '" & sFile & "'" 'Error importing file
MessageBox.Show(Application.Current.MainWindow, sMsg, EgtMsg(10001), MessageBoxButton.OK, MessageBoxImage.Error) ' Error
@@ -306,7 +307,7 @@ Public Class MySceneHostVM
If e.Button = Forms.MouseButtons.Middle Then Return
Select Case Map.refMainMenuVM.SelPage
Case Pages.VIEW
If Not IsNothing(Map.refProjectVM.BTLStructure) Then
If Not IsNothing(Map.refProjectVM.BTLStructureVM) Then
View_OnMouseDownScene(sender, e)
End If
Case Pages.MACHINING
@@ -323,7 +324,7 @@ Public Class MySceneHostVM
If e.Button = Forms.MouseButtons.Middle Then Return
Select Case Map.refMainMenuVM.SelPage
Case Pages.VIEW
If Not IsNothing(Map.refProjectVM.BTLStructure) Then
If Not IsNothing(Map.refProjectVM.BTLStructureVM) Then
View_OnMouseMoveScene(sender, e)
End If
Case Pages.MACHINING
@@ -340,7 +341,7 @@ Public Class MySceneHostVM
If e.Button = Forms.MouseButtons.Middle Then Return
Select Case Map.refMainMenuVM.SelPage
Case Pages.VIEW
If Not IsNothing(Map.refProjectVM.BTLStructure) Then
If Not IsNothing(Map.refProjectVM.BTLStructureVM) Then
View_OnMouseUpScene(sender, e)
End If
Case Pages.MACHINING
@@ -596,9 +597,9 @@ Public Class MySceneHostVM
' Se selezione da eseguire
ElseIf m_nIdToSel <> GDB_ID.NULL Then
' Se pezzo da selezionare non è già selezionato
If IsNothing(Map.refProjectVM.BTLStructure.SelBTLPart) OrElse Map.refProjectVM.BTLStructure.SelBTLPart.nPartId <> m_nIdToSel Then
If IsNothing(Map.refProjectVM.BTLStructureVM.SelBTLPart) OrElse Map.refProjectVM.BTLStructureVM.SelBTLPart.nPartId <> m_nIdToSel Then
' Eseguo la selezione
Map.refProjectVM.BTLStructure.SelBTLPart = Map.refProjectVM.BTLStructure.BTLPartVMList.First(Function(x) x.nPartId = m_nIdToSel)
Map.refProjectVM.BTLStructureVM.SelBTLPart = Map.refProjectVM.BTLStructureVM.BTLPartVMList.First(Function(x) x.nPartId = m_nIdToSel)
End If
End If
' Reset
@@ -59,7 +59,7 @@ Public Class ShowBeamPanelVM
End Get
Set(value As Boolean)
m_bShowSolid = value
If Not IsNothing(Map.refProjectVM.BTLStructure) Then Map.refProjectVM.BTLStructure.ShowSolid()
If Not IsNothing(Map.refProjectVM.BTLStructureVM) Then Map.refProjectVM.BTLStructureVM.ShowSolid()
End Set
End Property
Friend Sub SetShowSolid(bValue As Boolean)
@@ -74,7 +74,7 @@ Public Class ShowBeamPanelVM
End Get
Set(value As Boolean)
m_bShowBuilding = value
If Not IsNothing(Map.refProjectVM.BTLStructure) Then Map.refProjectVM.BTLStructure.ShowBuilding()
If Not IsNothing(Map.refProjectVM.BTLStructureVM) Then Map.refProjectVM.BTLStructureVM.ShowBuilding()
End Set
End Property
Friend Sub SetShowBuilding(bValue As Boolean)
@@ -130,8 +130,8 @@ Public Class ShowBeamPanelVM
End Property
Public Sub ShowAll()
If Not IsNothing(Map.refProjectVM.BTLStructure) Then
Map.refProjectVM.BTLStructure.ShowAll()
If Not IsNothing(Map.refProjectVM.BTLStructureVM) Then
Map.refProjectVM.BTLStructureVM.ShowAll()
End If
End Sub
@@ -7,7 +7,7 @@
' This call is required by the designer.
InitializeComponent()
Me.DataContext = WarehouseWndVM
Me.Tag = Map.refProjectVM.BTLStructure
Me.Tag = Map.refProjectVM.BTLStructureVM
' Assegno al riferimento locale al VM il VM preso dal DataContext
m_WarehouseWndVM = WarehouseWndVM
End Sub
@@ -750,7 +750,7 @@ Public Class WarehouseWndVM
Dim NewSectXMatList As New List(Of SectionXMaterial)
' Ricavo la lista dei SectionXMaterial presenti in Warehouse
Dim WhSectXMatList As List(Of SectionXMaterial) = GetSectionXMaterialsFromWarehouse()
For Each SectionListItem In Map.refProjectVM.BTLStructure.SectionList
For Each SectionListItem In Map.refProjectVM.BTLStructureVM.SectionList
Dim Index As Integer = 0
Dim bEqual As Boolean = False
' Confronto l'Item di SectionList con ciascuno di quelli presenti nella Warehouse
BIN
View File
Binary file not shown.
Binary file not shown.