Compare commits
170 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 0fc7d826a8 | |||
| 8b6c9b38cc | |||
| 3133c1d78c | |||
| 2ae08165f4 | |||
| f77ea8309c | |||
| 3a9e8651e7 | |||
| eddd7b93ca | |||
| 1d9182f96d | |||
| c3916dcf41 | |||
| 15bfc1bc15 | |||
| cee4375ea3 | |||
| 5b04080f35 | |||
| 0d7cc99a2d | |||
| d48deed9e0 | |||
| 4d8f0d6411 | |||
| 1cff7af4a6 | |||
| c3cc4518d8 | |||
| 04debf6b51 | |||
| cc71f0a34f | |||
| 3787b4e1f5 | |||
| 9f4e025305 | |||
| ecbd6ecd66 | |||
| c968befafb | |||
| df3b6ae657 | |||
| 668a37c6da | |||
| f4b18d962d | |||
| eaa43c6209 | |||
| 99dd1b6807 | |||
| 5b6f719349 | |||
| 93b3ddec79 | |||
| e701f54c07 | |||
| 2a2728505f | |||
| a5dc629e21 | |||
| c7fbe8a26a | |||
| b43a8ff2bb | |||
| 6cf303deca | |||
| 855762095f | |||
| 733fd4dc09 | |||
| 71a4985392 | |||
| 0d4d9a4520 | |||
| 622439de62 | |||
| 618d02d7c6 | |||
| d37df9d0f4 | |||
| 011673510d | |||
| ff52b9a79b | |||
| 85a5200e6b | |||
| 0e665ef1b0 | |||
| 2b99df6238 | |||
| 39ea11a8c4 | |||
| 79c7e3e536 | |||
| e4eb264abb | |||
| 500aa2eacf | |||
| b55810f235 | |||
| b898346efb | |||
| 586e4689ae | |||
| 7668aa5766 | |||
| e64090bfaf | |||
| 7c71fd4842 | |||
| 888bf0fcf8 | |||
| 009f22e146 | |||
| ef14b08737 | |||
| 8f9bd3ecb7 | |||
| 3eb6518ea4 | |||
| b15eb92785 | |||
| 96511ca335 | |||
| 974dee54da | |||
| 7e52ce986f | |||
| 4fc4875b91 | |||
| b3138d1982 | |||
| e87622ef5d | |||
| aafe52d2da | |||
| ffe53bf725 | |||
| 832ea7aec5 | |||
| 6d9a157b35 | |||
| 71afc6554e | |||
| bc40da74ab | |||
| 405fde996c | |||
| 8321f09af8 | |||
| 391583b9ea | |||
| 5cf0472806 | |||
| 89598c154e | |||
| 785792d63b | |||
| 5874a39b25 | |||
| 43f3f2f6d8 | |||
| 79a883a303 | |||
| e3f88296e5 | |||
| e207ed7ece | |||
| e97175765b | |||
| 6a0ebb9fee | |||
| 0a698dae34 | |||
| b74c052dd1 | |||
| 330e501277 | |||
| b7d62ace2c | |||
| c6f353ec35 | |||
| 0b7bdd6ade | |||
| 3febbbbcbf | |||
| 31874a8b92 | |||
| c75d9d6bc2 | |||
| 96dd92c3d3 | |||
| ebc41183bc | |||
| feb7982bef | |||
| f241b72453 | |||
| 2b306763c6 | |||
| f1b0a28e71 | |||
| 121f02fb0c | |||
| 848b6d98a5 | |||
| 0589565b8e | |||
| 1109a91dd9 | |||
| 37cb1dbb6a | |||
| 152788fe1b | |||
| 534b363a04 | |||
| 3f13706b97 | |||
| 1f804ab6fc | |||
| 21dd6fbbb1 | |||
| da73acc8a0 | |||
| f9825db2ac | |||
| a3ea3bd1eb | |||
| 805a3acf54 | |||
| f21f2a6422 | |||
| b25d73c0cb | |||
| 50d9603598 | |||
| fae8018df9 | |||
| 3b2715ee58 | |||
| d7c8e8e21d | |||
| 9d11e6e9ca | |||
| 8d90714a82 | |||
| 429d7f58e4 | |||
| 7e15ef9dd1 | |||
| 6060746412 | |||
| 2b4f3d93dc | |||
| f365c7a593 | |||
| fc797ff4a7 | |||
| 63b1f1532a | |||
| b861c647fc | |||
| fa7d95cc53 | |||
| cdb0414097 | |||
| 48ac0a878f | |||
| 804992e485 | |||
| 4ef9497514 | |||
| 3c939a9e5b | |||
| aaddb6897f | |||
| b0db630d56 | |||
| e608fd3a52 | |||
| 573cc1478a | |||
| 25d7516c7a | |||
| 8ac3c4879b | |||
| b551120fcc | |||
| b1846bb804 | |||
| 399a1f466f | |||
| c1ca70adce | |||
| 364520f9a3 | |||
| c0bfe75fd7 | |||
| 1d9618d797 | |||
| 1ac9f823a4 | |||
| 73950690ff | |||
| 2bc79ad2de | |||
| 9ad45b9ea4 | |||
| 89cb9e06f1 | |||
| 3b77f647a6 | |||
| 71c5b20782 | |||
| 08ac48d16e | |||
| 90ac144f2a | |||
| f5b98f803c | |||
| 8f05ef25f6 | |||
| 0022aacbd3 | |||
| ba64c8e231 | |||
| 431c30935c | |||
| 6decc2f690 | |||
| 402e17b57d | |||
| 08ae91e412 |
@@ -90,6 +90,16 @@ Public Class BTLFeatureM
|
|||||||
End Set
|
End Set
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
|
Protected m_nPriority As Integer = 0
|
||||||
|
Public Overridable Property nPriority As Integer
|
||||||
|
Get
|
||||||
|
Return m_nPriority
|
||||||
|
End Get
|
||||||
|
Set(value As Integer)
|
||||||
|
m_nPriority = value
|
||||||
|
End Set
|
||||||
|
End Property
|
||||||
|
|
||||||
' Nome
|
' Nome
|
||||||
Protected m_sName As String
|
Protected m_sName As String
|
||||||
Public ReadOnly Property sName As String
|
Public ReadOnly Property sName As String
|
||||||
@@ -244,10 +254,11 @@ Public Class BTLFeatureM
|
|||||||
Dim NewBTLFeature As New BTLFeatureM
|
Dim NewBTLFeature As New BTLFeatureM
|
||||||
NewBTLFeature.m_ParentPart = ParentPart
|
NewBTLFeature.m_ParentPart = ParentPart
|
||||||
NewBTLFeature.m_nFeatureId = nFeatureId
|
NewBTLFeature.m_nFeatureId = nFeatureId
|
||||||
' leggo gruppo, numero feature e lato
|
' leggo gruppo, numero feature, lato e priorità
|
||||||
EgtGetInfo(nFeatureId, BTL_FTR_GRP, NewBTLFeature.m_nSelGRP)
|
EgtGetInfo(nFeatureId, BTL_FTR_GRP, NewBTLFeature.m_nSelGRP)
|
||||||
EgtGetInfo(nFeatureId, BTL_FTR_PRC, NewBTLFeature.m_nPRC)
|
EgtGetInfo(nFeatureId, BTL_FTR_PRC, NewBTLFeature.m_nPRC)
|
||||||
EgtGetInfo(nFeatureId, BTL_FTR_SIDE, NewBTLFeature.m_nSelSIDE)
|
EgtGetInfo(nFeatureId, BTL_FTR_SIDE, NewBTLFeature.m_nSelSIDE)
|
||||||
|
EgtGetInfo(nFeatureId, BTL_FTR_PRIORITY, NewBTLFeature.m_nPRIORITY)
|
||||||
Dim nDO As Integer = 1
|
Dim nDO As Integer = 1
|
||||||
If EgtGetInfo(nFeatureId, BTL_FTR_DO, nDO) Then
|
If EgtGetInfo(nFeatureId, BTL_FTR_DO, nDO) Then
|
||||||
NewBTLFeature.m_bDO = (nDO <> 0)
|
NewBTLFeature.m_bDO = (nDO <> 0)
|
||||||
@@ -309,6 +320,7 @@ Public Class BTLFeatureM
|
|||||||
NewBTLFeature.m_nPRC = nPRC
|
NewBTLFeature.m_nPRC = nPRC
|
||||||
NewBTLFeature.m_nSelGRP = nGRP
|
NewBTLFeature.m_nSelGRP = nGRP
|
||||||
NewBTLFeature.m_nSelSIDE = nSIDE
|
NewBTLFeature.m_nSelSIDE = nSIDE
|
||||||
|
NewBTLFeature.m_nPriority = 0
|
||||||
NewBTLFeature.m_bDO = True
|
NewBTLFeature.m_bDO = True
|
||||||
' crea parametri per questa feature da file ini
|
' crea parametri per questa feature da file ini
|
||||||
NewBTLFeature.CreateFeatureParams(NewBTLFeature)
|
NewBTLFeature.CreateFeatureParams(NewBTLFeature)
|
||||||
@@ -467,7 +479,7 @@ Public Class BTLFeatureM
|
|||||||
If Param.nType = BTLParamType.DOUBLE_ Or Param.nType = BTLParamType.LENGTH Then
|
If Param.nType = BTLParamType.DOUBLE_ Or Param.nType = BTLParamType.LENGTH Then
|
||||||
Param.SetValue(Param.dDefault)
|
Param.SetValue(Param.dDefault)
|
||||||
ElseIf Param.nType = BTLParamType.STRING_ Then
|
ElseIf Param.nType = BTLParamType.STRING_ Then
|
||||||
Param.SetValue("")
|
Param.SetValue(Param.sDefault)
|
||||||
ElseIf Param.nType = BTLParamType.COMBO Then
|
ElseIf Param.nType = BTLParamType.COMBO Then
|
||||||
Param.nSelValue = Param.dDefault
|
Param.nSelValue = Param.dDefault
|
||||||
End If
|
End If
|
||||||
@@ -533,6 +545,7 @@ Public Class BTLFeatureM
|
|||||||
For Each QPar In QBTLParamMList
|
For Each QPar In QBTLParamMList
|
||||||
If QPar.bCustom Then EgtSetInfo(nFeatureId, QPar.sName & "A", 1)
|
If QPar.bCustom Then EgtSetInfo(nFeatureId, QPar.sName & "A", 1)
|
||||||
Next
|
Next
|
||||||
|
EgtSetInfo( nFeatureId, BTL_FTR_PRIORITY, nPriority)
|
||||||
SetFeatureId(nFeatureId)
|
SetFeatureId(nFeatureId)
|
||||||
' imposto modificato per copie
|
' imposto modificato per copie
|
||||||
EgtDuploSetModified(ParentPart.nPartId)
|
EgtDuploSetModified(ParentPart.nPartId)
|
||||||
|
|||||||
@@ -129,6 +129,16 @@ Public Class BTLParamM
|
|||||||
End Set
|
End Set
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
|
Protected m_sDefault As String
|
||||||
|
Public Property sDefault As String
|
||||||
|
Get
|
||||||
|
Return m_sDefault
|
||||||
|
End Get
|
||||||
|
Set(value As String)
|
||||||
|
m_sDefault = value
|
||||||
|
End Set
|
||||||
|
End Property
|
||||||
|
|
||||||
' tipo della variabile
|
' tipo della variabile
|
||||||
Protected m_nType As BTLParamType
|
Protected m_nType As BTLParamType
|
||||||
Public ReadOnly Property nType As BTLParamType
|
Public ReadOnly Property nType As BTLParamType
|
||||||
@@ -136,6 +146,9 @@ Public Class BTLParamM
|
|||||||
Return m_nType
|
Return m_nType
|
||||||
End Get
|
End Get
|
||||||
End Property
|
End Property
|
||||||
|
Public Sub SetType(value As BTLParamType)
|
||||||
|
m_nType = value
|
||||||
|
End Sub
|
||||||
|
|
||||||
' Feature a cui appartiene il parametro
|
' Feature a cui appartiene il parametro
|
||||||
Protected m_ParentFeature As BTLFeatureM
|
Protected m_ParentFeature As BTLFeatureM
|
||||||
@@ -245,16 +258,18 @@ Public Class BTLParamM
|
|||||||
End Function
|
End Function
|
||||||
|
|
||||||
' new per stringhe
|
' new per stringhe
|
||||||
Public Shared Function CreateBTLParam(ParentFeature As BTLFeatureM, IsP As Boolean, nType As BTLParamType, sParamName As String, sDescription As String)
|
Public Shared Function CreateBTLParam(ParentFeature As BTLFeatureM, IsP As Boolean, nType As BTLParamType, sParamName As String, sDefault As String, sDescription As String)
|
||||||
Dim NewBTLParam As New BTLParamM
|
Dim NewBTLParam As New BTLParamM
|
||||||
NewBTLParam.StdInit(ParentFeature, IsP, nType, sParamName, sDescription)
|
NewBTLParam.StdInit(ParentFeature, IsP, nType, sParamName, sDescription)
|
||||||
|
NewBTLParam.m_sDefault = sDefault
|
||||||
Return NewBTLParam
|
Return NewBTLParam
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
' new per stringhe (con tipo Beam o Wall)
|
' new per stringhe (con tipo Beam o Wall)
|
||||||
Public Shared Function CreateBTLParam(ParentFeature As BTLFeatureM, IsP As Boolean, nType As BTLParamType, sParamName As String, sDescription As String, sBWType As String)
|
Public Shared Function CreateBTLParam(ParentFeature As BTLFeatureM, IsP As Boolean, nType As BTLParamType, sParamName As String, sDefault As String, sDescription As String, sBWType As String)
|
||||||
Dim NewBTLParam As New BTLParamM
|
Dim NewBTLParam As New BTLParamM
|
||||||
NewBTLParam.StdInit(ParentFeature, IsP, nType, sParamName, sDescription)
|
NewBTLParam.StdInit(ParentFeature, IsP, nType, sParamName, sDescription)
|
||||||
|
NewBTLParam.m_sDefault = sDefault
|
||||||
NewBTLParam.m_sBWType = sBWType
|
NewBTLParam.m_sBWType = sBWType
|
||||||
Return NewBTLParam
|
Return NewBTLParam
|
||||||
End Function
|
End Function
|
||||||
|
|||||||
@@ -797,15 +797,15 @@ Public Class BTLPartM
|
|||||||
Dim vtVersY As New Vector3d
|
Dim vtVersY As New Vector3d
|
||||||
sValArray = sValue.Split({","}, StringSplitOptions.RemoveEmptyEntries)
|
sValArray = sValue.Split({","}, StringSplitOptions.RemoveEmptyEntries)
|
||||||
If sValArray.Count() >= 9 Then
|
If sValArray.Count() >= 9 Then
|
||||||
StringToLen(sValArray(0), ptOri.x)
|
StringToLenAdv(sValArray(0), ptOri.x)
|
||||||
StringToLen(sValArray(1), ptOri.y)
|
StringToLenAdv(sValArray(1), ptOri.y)
|
||||||
StringToLen(sValArray(2), ptOri.z)
|
StringToLenAdv(sValArray(2), ptOri.z)
|
||||||
StringToDouble(sValArray(3), vtVersX.x)
|
StringToDoubleAdv(sValArray(3), vtVersX.x)
|
||||||
StringToDouble(sValArray(4), vtVersX.y)
|
StringToDoubleAdv(sValArray(4), vtVersX.y)
|
||||||
StringToDouble(sValArray(5), vtVersX.z)
|
StringToDoubleAdv(sValArray(5), vtVersX.z)
|
||||||
StringToDouble(sValArray(6), vtVersY.x)
|
StringToDoubleAdv(sValArray(6), vtVersY.x)
|
||||||
StringToDouble(sValArray(7), vtVersY.y)
|
StringToDoubleAdv(sValArray(7), vtVersY.y)
|
||||||
StringToDouble(sValArray(8), vtVersY.z)
|
StringToDoubleAdv(sValArray(8), vtVersY.z)
|
||||||
NewBTLPart.m_refTransf.ChangeOrigin(ptOri)
|
NewBTLPart.m_refTransf.ChangeOrigin(ptOri)
|
||||||
NewBTLPart.m_refTransf.Setup(ptOri, ptOri + vtVersX, ptOri + vtVersY)
|
NewBTLPart.m_refTransf.Setup(ptOri, ptOri + vtVersX, ptOri + vtVersY)
|
||||||
End If
|
End If
|
||||||
@@ -815,10 +815,10 @@ Public Class BTLPartM
|
|||||||
EgtGetInfo(nPartId, BTL_PRT_CAMBER, sValue)
|
EgtGetInfo(nPartId, BTL_PRT_CAMBER, sValue)
|
||||||
sValArray = sValue.Split(New String() {":", "P"}, StringSplitOptions.RemoveEmptyEntries)
|
sValArray = sValue.Split(New String() {":", "P"}, StringSplitOptions.RemoveEmptyEntries)
|
||||||
If sValArray.Count() >= 10 Then
|
If sValArray.Count() >= 10 Then
|
||||||
StringToLen(sValArray(3), NewBTLPart.m_dCamberLen1)
|
StringToLenAdv(sValArray(3), NewBTLPart.m_dCamberLen1)
|
||||||
StringToLen(sValArray(5), NewBTLPart.m_dCamberLen2)
|
StringToLenAdv(sValArray(5), NewBTLPart.m_dCamberLen2)
|
||||||
StringToLen(sValArray(7), NewBTLPart.m_dCamberLen3)
|
StringToLenAdv(sValArray(7), NewBTLPart.m_dCamberLen3)
|
||||||
StringToLen(sValArray(9), NewBTLPart.m_dCamberCross3)
|
StringToLenAdv(sValArray(9), NewBTLPart.m_dCamberCross3)
|
||||||
End If
|
End If
|
||||||
Dim pFrom As Integer = sValue.IndexOf("SIDE: ") + "SIDE: ".Length
|
Dim pFrom As Integer = sValue.IndexOf("SIDE: ") + "SIDE: ".Length
|
||||||
Dim pTo As Integer = sValue.LastIndexOf(" P01")
|
Dim pTo As Integer = sValue.LastIndexOf(" P01")
|
||||||
@@ -830,10 +830,10 @@ Public Class BTLPartM
|
|||||||
EgtGetInfo(nPartId, BTL_PRT_PARTOFFSET, sValue)
|
EgtGetInfo(nPartId, BTL_PRT_PARTOFFSET, sValue)
|
||||||
sValArray = sValue.Split(New String() {":", "P"}, StringSplitOptions.RemoveEmptyEntries)
|
sValArray = sValue.Split(New String() {":", "P"}, StringSplitOptions.RemoveEmptyEntries)
|
||||||
If sValArray.Count() >= 10 Then
|
If sValArray.Count() >= 10 Then
|
||||||
StringToLen(sValArray(3), NewBTLPart.m_dPartOffsetSide1)
|
StringToLenAdv(sValArray(3), NewBTLPart.m_dPartOffsetSide1)
|
||||||
StringToLen(sValArray(5), NewBTLPart.m_dPartOffsetSide2)
|
StringToLenAdv(sValArray(5), NewBTLPart.m_dPartOffsetSide2)
|
||||||
StringToLen(sValArray(7), NewBTLPart.m_dPartOffsetSide3)
|
StringToLenAdv(sValArray(7), NewBTLPart.m_dPartOffsetSide3)
|
||||||
StringToLen(sValArray(9), NewBTLPart.m_dPartOffsetSide4)
|
StringToLenAdv(sValArray(9), NewBTLPart.m_dPartOffsetSide4)
|
||||||
End If
|
End If
|
||||||
pFrom = sValue.IndexOf("P04: ") + "P04: ".Length
|
pFrom = sValue.IndexOf("P04: ") + "P04: ".Length
|
||||||
pTo = sValue.LastIndexOf(" P11")
|
pTo = sValue.LastIndexOf(" P11")
|
||||||
@@ -883,9 +883,9 @@ Public Class BTLPartM
|
|||||||
NewBTLPart.m_refGrainDir = New Vector3d
|
NewBTLPart.m_refGrainDir = New Vector3d
|
||||||
sValArray = sValue.Split(New String() {",", ";"}, StringSplitOptions.RemoveEmptyEntries)
|
sValArray = sValue.Split(New String() {",", ";"}, StringSplitOptions.RemoveEmptyEntries)
|
||||||
If sValArray.Count() >= 4 Then
|
If sValArray.Count() >= 4 Then
|
||||||
StringToDouble(sValArray(0), NewBTLPart.m_refGrainDir.x)
|
StringToDoubleAdv(sValArray(0), NewBTLPart.m_refGrainDir.x)
|
||||||
StringToDouble(sValArray(1), NewBTLPart.m_refGrainDir.y)
|
StringToDoubleAdv(sValArray(1), NewBTLPart.m_refGrainDir.y)
|
||||||
StringToDouble(sValArray(2), NewBTLPart.m_refGrainDir.z)
|
StringToDoubleAdv(sValArray(2), NewBTLPart.m_refGrainDir.z)
|
||||||
NewBTLPart.m_bGRAINDIRALIGN = (CInt(sValArray(3)) = 1)
|
NewBTLPart.m_bGRAINDIRALIGN = (CInt(sValArray(3)) = 1)
|
||||||
End If
|
End If
|
||||||
|
|
||||||
@@ -1044,15 +1044,15 @@ Public Class BTLPartM
|
|||||||
' Dim vtVersY As New Vector3d
|
' Dim vtVersY As New Vector3d
|
||||||
' sValArray = sValue.Split({","}, StringSplitOptions.RemoveEmptyEntries)
|
' sValArray = sValue.Split({","}, StringSplitOptions.RemoveEmptyEntries)
|
||||||
' If sValArray.Count() >= 9 Then
|
' If sValArray.Count() >= 9 Then
|
||||||
' StringToLen(sValArray(0), ptOri.x)
|
' StringToLenAdv(sValArray(0), ptOri.x)
|
||||||
' StringToLen(sValArray(1), ptOri.y)
|
' StringToLenAdv(sValArray(1), ptOri.y)
|
||||||
' StringToLen(sValArray(2), ptOri.z)
|
' StringToLenAdv(sValArray(2), ptOri.z)
|
||||||
' StringToDouble(sValArray(3), vtVersX.x)
|
' StringToDoubleAdv(sValArray(3), vtVersX.x)
|
||||||
' StringToDouble(sValArray(4), vtVersX.y)
|
' StringToDoubleAdv(sValArray(4), vtVersX.y)
|
||||||
' StringToDouble(sValArray(5), vtVersX.z)
|
' StringToDoubleAdv(sValArray(5), vtVersX.z)
|
||||||
' StringToDouble(sValArray(6), vtVersY.x)
|
' StringToDoubleAdv(sValArray(6), vtVersY.x)
|
||||||
' StringToDouble(sValArray(7), vtVersY.y)
|
' StringToDoubleAdv(sValArray(7), vtVersY.y)
|
||||||
' StringToDouble(sValArray(8), vtVersY.z)
|
' StringToDoubleAdv(sValArray(8), vtVersY.z)
|
||||||
' m_refTransf.ChangeOrigin(ptOri)
|
' m_refTransf.ChangeOrigin(ptOri)
|
||||||
' m_refTransf.Setup(ptOri, ptOri + vtVersX, ptOri + vtVersY)
|
' m_refTransf.Setup(ptOri, ptOri + vtVersX, ptOri + vtVersY)
|
||||||
' End If
|
' End If
|
||||||
@@ -1063,10 +1063,10 @@ Public Class BTLPartM
|
|||||||
' EgtGetInfo(nPartId, BTL_PRT_CAMBER, sValue)
|
' EgtGetInfo(nPartId, BTL_PRT_CAMBER, sValue)
|
||||||
' sValArray = sValue.Split(New String() {": ", " P"}, StringSplitOptions.RemoveEmptyEntries)
|
' sValArray = sValue.Split(New String() {": ", " P"}, StringSplitOptions.RemoveEmptyEntries)
|
||||||
' If sValArray.Count() >= 5 Then
|
' If sValArray.Count() >= 5 Then
|
||||||
' StringToLen(sValArray(3), m_dCamberLen1)
|
' StringToLenAdv(sValArray(3), m_dCamberLen1)
|
||||||
' StringToLen(sValArray(5), m_dCamberLen2)
|
' StringToLenAdv(sValArray(5), m_dCamberLen2)
|
||||||
' StringToLen(sValArray(7), m_dCamberLen3)
|
' StringToLenAdv(sValArray(7), m_dCamberLen3)
|
||||||
' StringToLen(sValArray(9), m_dCamberCross3)
|
' StringToLenAdv(sValArray(9), m_dCamberCross3)
|
||||||
' End If
|
' End If
|
||||||
' Dim pFrom As Integer = sValue.IndexOf("SIDE: ") + "SIDE: ".Length
|
' Dim pFrom As Integer = sValue.IndexOf("SIDE: ") + "SIDE: ".Length
|
||||||
' Dim pTo As Integer = sValue.LastIndexOf(" P01")
|
' Dim pTo As Integer = sValue.LastIndexOf(" P01")
|
||||||
@@ -1078,10 +1078,10 @@ Public Class BTLPartM
|
|||||||
' EgtGetInfo(nPartId, BTL_PRT_PARTOFFSET, sValue)
|
' EgtGetInfo(nPartId, BTL_PRT_PARTOFFSET, sValue)
|
||||||
' sValArray = sValue.Split(New String() {": ", " P"}, StringSplitOptions.RemoveEmptyEntries)
|
' sValArray = sValue.Split(New String() {": ", " P"}, StringSplitOptions.RemoveEmptyEntries)
|
||||||
' If sValArray.Count() >= 5 Then
|
' If sValArray.Count() >= 5 Then
|
||||||
' StringToLen(sValArray(3), m_dPartOffsetSide1)
|
' StringToLenAdv(sValArray(3), m_dPartOffsetSide1)
|
||||||
' StringToLen(sValArray(5), m_dPartOffsetSide2)
|
' StringToLenAdv(sValArray(5), m_dPartOffsetSide2)
|
||||||
' StringToLen(sValArray(7), m_dPartOffsetSide3)
|
' StringToLenAdv(sValArray(7), m_dPartOffsetSide3)
|
||||||
' StringToLen(sValArray(9), m_dPartOffsetSide4)
|
' StringToLenAdv(sValArray(9), m_dPartOffsetSide4)
|
||||||
' End If
|
' End If
|
||||||
' pFrom = sValue.IndexOf("P04: ") + "P04: ".Length
|
' pFrom = sValue.IndexOf("P04: ") + "P04: ".Length
|
||||||
' pTo = sValue.LastIndexOf(" P11")
|
' pTo = sValue.LastIndexOf(" P11")
|
||||||
@@ -1105,9 +1105,9 @@ Public Class BTLPartM
|
|||||||
' m_refGrainDir = New Vector3d
|
' m_refGrainDir = New Vector3d
|
||||||
' sValArray = sValue.Split(New String() {",", ";"}, StringSplitOptions.RemoveEmptyEntries)
|
' sValArray = sValue.Split(New String() {",", ";"}, StringSplitOptions.RemoveEmptyEntries)
|
||||||
' If sValArray.Count() >= 4 Then
|
' If sValArray.Count() >= 4 Then
|
||||||
' StringToDouble(sValArray(0), m_refGrainDir.x)
|
' StringToDoubleAdv(sValArray(0), m_refGrainDir.x)
|
||||||
' StringToDouble(sValArray(1), m_refGrainDir.y)
|
' StringToDoubleAdv(sValArray(1), m_refGrainDir.y)
|
||||||
' StringToDouble(sValArray(2), m_refGrainDir.z)
|
' StringToDoubleAdv(sValArray(2), m_refGrainDir.z)
|
||||||
' m_bGRAINDIRALIGN = (CInt(sValArray(3)) = 1)
|
' m_bGRAINDIRALIGN = (CInt(sValArray(3)) = 1)
|
||||||
' End If
|
' End If
|
||||||
|
|
||||||
@@ -1210,7 +1210,7 @@ Public Class BTLPartM
|
|||||||
Return New List(Of BTLFeatureM)(m_BTLFeatureMList)
|
Return New List(Of BTLFeatureM)(m_BTLFeatureMList)
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
Public Function Rotation(IsPositive As Boolean, SelectedMachineType As MachineType, Optional dAng As Double = 90) As Boolean
|
Public Function Rotation(IsPositive As Boolean, SelectedMachineType As MachineType, Optional bRedraw As Boolean = True, Optional dAng As Double = 90) As Boolean
|
||||||
' recupero il box del pezzo
|
' recupero il box del pezzo
|
||||||
Dim nLs As Integer = EgtGetFirstNameInGroup(nPartId, "Box")
|
Dim nLs As Integer = EgtGetFirstNameInGroup(nPartId, "Box")
|
||||||
Dim b3Solid As New BBox3d
|
Dim b3Solid As New BBox3d
|
||||||
@@ -1249,7 +1249,7 @@ Public Class BTLPartM
|
|||||||
' ripristino inversione
|
' ripristino inversione
|
||||||
Inversion(SelectedMachineType)
|
Inversion(SelectedMachineType)
|
||||||
End If
|
End If
|
||||||
EgtDraw()
|
If bRedraw Then EgtDraw()
|
||||||
Return bOk
|
Return bOk
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
|
|||||||
@@ -65,7 +65,7 @@ Public Module CalcIntegration
|
|||||||
End If
|
End If
|
||||||
ElseIf Bar.nProgramPage = ProjectType.PROD Then
|
ElseIf Bar.nProgramPage = ProjectType.PROD Then
|
||||||
If Bar.nGlobState = CalcStates.NOTCALCULATED Then
|
If Bar.nGlobState = CalcStates.NOTCALCULATED Then
|
||||||
Bar.sBarPath = CreateNewProjectFromMachGroup(Bar.nBarId, sProjDirPath)
|
Bar.sBarPath = CreateNewProjectFromMachGroup(Bar.nBarId, sProjDirPath, Bar.nGlobState)
|
||||||
Else
|
Else
|
||||||
Dim sMachGroupName As String = ""
|
Dim sMachGroupName As String = ""
|
||||||
EgtGetMachGroupName(Bar.nBarId, sMachGroupName)
|
EgtGetMachGroupName(Bar.nBarId, sMachGroupName)
|
||||||
@@ -78,7 +78,7 @@ Public Module CalcIntegration
|
|||||||
If Bar.nProgramPage = ProjectType.PROJ Then
|
If Bar.nProgramPage = ProjectType.PROJ Then
|
||||||
Bar.sBarPath = CreateNewProjectFromPart(Bar.nBarId, sProjDirPath)
|
Bar.sBarPath = CreateNewProjectFromPart(Bar.nBarId, sProjDirPath)
|
||||||
ElseIf Bar.nProgramPage = ProjectType.PROD Then
|
ElseIf Bar.nProgramPage = ProjectType.PROD Then
|
||||||
Bar.sBarPath = CreateNewProjectFromMachGroup(Bar.nBarId, sProjDirPath)
|
Bar.sBarPath = CreateNewProjectFromMachGroup(Bar.nBarId, sProjDirPath, Bar.nGlobState)
|
||||||
End If
|
End If
|
||||||
Next
|
Next
|
||||||
End If
|
End If
|
||||||
@@ -355,8 +355,14 @@ Public Module CalcIntegration
|
|||||||
Return If(bOk, sPartFilePath, String.Empty)
|
Return If(bOk, sPartFilePath, String.Empty)
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
Private Function CreateNewProjectFromMachGroup(nMachGroupId As Integer, sProjDirPath As String) As String
|
Private Function CreateNewProjectFromMachGroup(nMachGroupId As Integer, sProjDirPath As String, nGlobState As Integer) As String
|
||||||
If Not m_bIsSupervisor Then
|
' aggiorno cutid e taskid solo fuori dal supervisore o se pezzo ricalcolato
|
||||||
|
If Not m_bIsSupervisor OrElse nGlobState = CalcStates.NOTCALCULATED Then
|
||||||
|
Dim DisableMgr As DisableModifiedMgr = Nothing
|
||||||
|
If m_bIsSupervisor Then
|
||||||
|
' Disabilito segnalazione modificato
|
||||||
|
DisableMgr = New DisableModifiedMgr
|
||||||
|
End If
|
||||||
' Aggiorno identificativi per segnalazione errori
|
' Aggiorno identificativi per segnalazione errori
|
||||||
Dim nOldMachGroup As Integer = EgtGetCurrMachGroup()
|
Dim nOldMachGroup As Integer = EgtGetCurrMachGroup()
|
||||||
If nMachGroupId <> nOldMachGroup Then EgtSetCurrMachGroup(nMachGroupId)
|
If nMachGroupId <> nOldMachGroup Then EgtSetCurrMachGroup(nMachGroupId)
|
||||||
@@ -378,6 +384,10 @@ Public Module CalcIntegration
|
|||||||
EgtResetCurrMachGroup()
|
EgtResetCurrMachGroup()
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
|
If m_bIsSupervisor Then
|
||||||
|
' Ripristino stato segnalazione modifica
|
||||||
|
DisableMgr.ReEnable()
|
||||||
|
End If
|
||||||
End If
|
End If
|
||||||
|
|
||||||
' Salvo gruppo di lavorazione nel suo progetto
|
' Salvo gruppo di lavorazione nel suo progetto
|
||||||
|
|||||||
@@ -175,8 +175,10 @@
|
|||||||
Public Const BTL_PRT_REFSIDE = "REFERENCESIDE"
|
Public Const BTL_PRT_REFSIDE = "REFERENCESIDE"
|
||||||
Public Const BTL_PRT_ALIGNMENT = "ALIGNMENT"
|
Public Const BTL_PRT_ALIGNMENT = "ALIGNMENT"
|
||||||
Public Const BTL_PRT_MATERIALTYPE = "MATERIALTYPE"
|
Public Const BTL_PRT_MATERIALTYPE = "MATERIALTYPE"
|
||||||
|
Public Const BTL_PRT_DESCRIPTION = "NAM"
|
||||||
|
|
||||||
' parametri generici
|
' parametri generici
|
||||||
|
Public Const BTL_GEN_BTLPATH = "BTL"
|
||||||
Public Const BTL_GEN_PROJNUM = "PROJECTNUMBER"
|
Public Const BTL_GEN_PROJNUM = "PROJECTNUMBER"
|
||||||
Public Const BTL_GEN_PROJNAME = "PROJECTNAME"
|
Public Const BTL_GEN_PROJNAME = "PROJECTNAME"
|
||||||
Public Const BTL_GEN_PROJPART = "PROJECTPART"
|
Public Const BTL_GEN_PROJPART = "PROJECTPART"
|
||||||
@@ -204,6 +206,7 @@
|
|||||||
Public Const BTL_FTR_PRC As String = "PRC"
|
Public Const BTL_FTR_PRC As String = "PRC"
|
||||||
Public Const BTL_FTR_DO As String = "DO"
|
Public Const BTL_FTR_DO As String = "DO"
|
||||||
Public Const BTL_FTR_SIDE As String = "SIDE"
|
Public Const BTL_FTR_SIDE As String = "SIDE"
|
||||||
|
Public Const BTL_FTR_PRIORITY As String = "PRIORITY"
|
||||||
Public Const BTL_FTR_NAME As String = "NAME"
|
Public Const BTL_FTR_NAME As String = "NAME"
|
||||||
Public Const BTL_FTR_DES As String = "DES"
|
Public Const BTL_FTR_DES As String = "DES"
|
||||||
Public Const BTL_FTR_PRID As String = "PRID"
|
Public Const BTL_FTR_PRID As String = "PRID"
|
||||||
@@ -251,6 +254,7 @@
|
|||||||
Public Const MGR_RPT_PANELLEN As String = "PANELLEN"
|
Public Const MGR_RPT_PANELLEN As String = "PANELLEN"
|
||||||
Public Const MGR_RPT_PANELWIDTH As String = "PANELWIDTH"
|
Public Const MGR_RPT_PANELWIDTH As String = "PANELWIDTH"
|
||||||
Public Const MGR_RPT_PANELHEIGHT As String = "PANELHEIGHT"
|
Public Const MGR_RPT_PANELHEIGHT As String = "PANELHEIGHT"
|
||||||
|
Public Const MGR_RPT_PANELPOSZ As String = "PANELPOSZ"
|
||||||
Public Const MGR_RPT_PART As String = "PART"
|
Public Const MGR_RPT_PART As String = "PART"
|
||||||
|
|
||||||
' parametri P per comunicazione con la macchina
|
' parametri P per comunicazione con la macchina
|
||||||
@@ -298,6 +302,8 @@
|
|||||||
Public Const BTLFILENAME As String = "BTLFILENAME"
|
Public Const BTLFILENAME As String = "BTLFILENAME"
|
||||||
Public Const EXP_PART As String = "ImportExport"
|
Public Const EXP_PART As String = "ImportExport"
|
||||||
Public Const EXP_MACHINE As String = "Machine"
|
Public Const EXP_MACHINE As String = "Machine"
|
||||||
|
' parametro che indica se il progetto e' stato appena importato e quindi bisogna riverificare i MachGroup
|
||||||
|
Public Const IMP_VERIFYMACHGROUP As String = "VerifyMachGroup"
|
||||||
|
|
||||||
' parametri modifica percorsi free contour
|
' parametri modifica percorsi free contour
|
||||||
Public Const PATH_SIDEANGLAYER As String = "SideAngLayer"
|
Public Const PATH_SIDEANGLAYER As String = "SideAngLayer"
|
||||||
|
|||||||
@@ -6,6 +6,7 @@
|
|||||||
Public Const COL_STARTCUT As String = "colSTARTCUT"
|
Public Const COL_STARTCUT As String = "colSTARTCUT"
|
||||||
Public Const COL_W As String = "colW"
|
Public Const COL_W As String = "colW"
|
||||||
Public Const COL_L As String = "colL"
|
Public Const COL_L As String = "colL"
|
||||||
|
Public Const COL_POSZ As String = "colPOSZ"
|
||||||
Public Const COL_ROT As String = "colROT"
|
Public Const COL_ROT As String = "colROT"
|
||||||
Public Const COL_FLIP As String = "colFLIP"
|
Public Const COL_FLIP As String = "colFLIP"
|
||||||
Public Const COL_POSX As String = "colPOSX"
|
Public Const COL_POSX As String = "colPOSX"
|
||||||
@@ -15,5 +16,6 @@
|
|||||||
Public Const COL_TYPE As String = "colTYPE"
|
Public Const COL_TYPE As String = "colTYPE"
|
||||||
Public Const COL_DESCRIPTION As String = "colDESCRIPTION"
|
Public Const COL_DESCRIPTION As String = "colDESCRIPTION"
|
||||||
Public Const COL_SUPERVISORID As String = "colSUPERVISORID"
|
Public Const COL_SUPERVISORID As String = "colSUPERVISORID"
|
||||||
|
Public Const COL_PRIORITY As String = "colPRIORITY"
|
||||||
|
|
||||||
End Module
|
End Module
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ Public Module ConstGen
|
|||||||
' File con dati di licenza
|
' File con dati di licenza
|
||||||
Public Const LIC_FILE_NAME As String = "EgtBEAMWALL.lic"
|
Public Const LIC_FILE_NAME As String = "EgtBEAMWALL.lic"
|
||||||
Public Const S_LICENCE As String = "Licence"
|
Public Const S_LICENCE As String = "Licence"
|
||||||
|
Public Const K_LOCKID As String = "LockId"
|
||||||
Public Const K_KEY As String = "Key"
|
Public Const K_KEY As String = "Key"
|
||||||
Public Const K_NESTKEY As String = "NestKey"
|
Public Const K_NESTKEY As String = "NestKey"
|
||||||
|
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ Public Module ConstIni
|
|||||||
'Public Const K_LICENCE As String = "Licence"
|
'Public Const K_LICENCE As String = "Licence"
|
||||||
'Public Const K_USERLEVEL As String = "UserLevel"
|
'Public Const K_USERLEVEL As String = "UserLevel"
|
||||||
'Public Const K_MAXINST As String = "MaxInstances"
|
'Public Const K_MAXINST As String = "MaxInstances"
|
||||||
|
Public Const K_NETKEY As String = "NetKey"
|
||||||
Public Const K_MAXCAMINST As String = "MaxCamInstances"
|
Public Const K_MAXCAMINST As String = "MaxCamInstances"
|
||||||
Public Const K_VIEWOPTIM_INSTANCES As String = "ViewOptimInstances"
|
Public Const K_VIEWOPTIM_INSTANCES As String = "ViewOptimInstances"
|
||||||
Public Const K_SUPERVISOR_INSTANCES As String = "SupervisorInstances"
|
Public Const K_SUPERVISOR_INSTANCES As String = "SupervisorInstances"
|
||||||
@@ -44,6 +45,7 @@ Public Module ConstIni
|
|||||||
Public Const K_DATADIR As String = "DataDir"
|
Public Const K_DATADIR As String = "DataDir"
|
||||||
Public Const K_ENABLEEDIT As String = "EnableEdit"
|
Public Const K_ENABLEEDIT As String = "EnableEdit"
|
||||||
Public Const K_FASTPRODUCE As String = "FastProduce"
|
Public Const K_FASTPRODUCE As String = "FastProduce"
|
||||||
|
Public Const K_ADDPROJ As String = "AddProj"
|
||||||
|
|
||||||
'Public Const S_LANGUAGES As String = "Languages"
|
'Public Const S_LANGUAGES As String = "Languages"
|
||||||
'Public Const K_LANGUAGE As String = "Language"
|
'Public Const K_LANGUAGE As String = "Language"
|
||||||
@@ -94,6 +96,7 @@ Public Module ConstIni
|
|||||||
Public Const S_IMPORT As String = "Import"
|
Public Const S_IMPORT As String = "Import"
|
||||||
Public Const K_BTLFLAG As String = "BtlFlag"
|
Public Const K_BTLFLAG As String = "BtlFlag"
|
||||||
Public Const K_WALLBTLFLAG As String = "WallBtlFlag"
|
Public Const K_WALLBTLFLAG As String = "WallBtlFlag"
|
||||||
|
Public Const K_WALLOPPOSITESIDENESTING As String = "WallOppositeSideNesting"
|
||||||
|
|
||||||
'Public Const S_MACH As String = "Mach"
|
'Public Const S_MACH As String = "Mach"
|
||||||
'Public Const K_MACHINESDIR As String = "MachinesDir"
|
'Public Const K_MACHINESDIR As String = "MachinesDir"
|
||||||
@@ -102,6 +105,7 @@ Public Module ConstIni
|
|||||||
Public Const K_SUPERVISORMACH As String = "SupervisorMach"
|
Public Const K_SUPERVISORMACH As String = "SupervisorMach"
|
||||||
Public Const K_PASSWORD As String = "Password"
|
Public Const K_PASSWORD As String = "Password"
|
||||||
Public Const K_CHANGEMACH As String = "ChangeMach"
|
Public Const K_CHANGEMACH As String = "ChangeMach"
|
||||||
|
Public Const K_EXPORTBWE As String = "ExpBwe"
|
||||||
|
|
||||||
'Public Const S_SIMUL As String = "Simul"
|
'Public Const S_SIMUL As String = "Simul"
|
||||||
'Public Const K_SLIDERX As String = "SliderX"
|
'Public Const K_SLIDERX As String = "SliderX"
|
||||||
@@ -116,6 +120,15 @@ Public Module ConstIni
|
|||||||
Public Const K_WALLBASEDIR As String = "BaseDir"
|
Public Const K_WALLBASEDIR As String = "BaseDir"
|
||||||
Public Const K_WALLBWEEXEC As String = "BweExec"
|
Public Const K_WALLBWEEXEC As String = "BweExec"
|
||||||
|
|
||||||
|
Public Const S_MACHINELOGFILTER As String = "MachineLogFilters"
|
||||||
|
Public Const K_PARTEVENTTYPE As String = "PartEventType"
|
||||||
|
Public Const K_ENTITYTYPE As String = "EntityType"
|
||||||
|
Public Const K_DAYTYPE As String = "DayType"
|
||||||
|
Public Const K_STARTDATE As String = "StartDate"
|
||||||
|
Public Const K_ENDDATE As String = "EndDate"
|
||||||
|
|
||||||
|
Public Const S_OPENFILEDIALOG As String = "OpenFileDialog"
|
||||||
|
|
||||||
'Public Const S_NEST As String = "Nest"
|
'Public Const S_NEST As String = "Nest"
|
||||||
Public Const K_NESTEXEC As String = "NestExec"
|
Public Const K_NESTEXEC As String = "NestExec"
|
||||||
Public Const K_FLIPROT As String = "FlipRot"
|
Public Const K_FLIPROT As String = "FlipRot"
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ Public Module DataGridColumnsIniFile
|
|||||||
Dim bIsReadOnly As Boolean = sColumnParams(4).Equals("1")
|
Dim bIsReadOnly As Boolean = sColumnParams(4).Equals("1")
|
||||||
Dim Width As Double
|
Dim Width As Double
|
||||||
Dim WidthType As DataGridLengthUnitType
|
Dim WidthType As DataGridLengthUnitType
|
||||||
StringToDouble(sColumnParams(5), Width)
|
StringToDoubleAdv(sColumnParams(5), Width)
|
||||||
Integer.TryParse(sColumnParams(6), WidthType)
|
Integer.TryParse(sColumnParams(6), WidthType)
|
||||||
Dim bVisible As Boolean = sColumnParams(7).Equals("1")
|
Dim bVisible As Boolean = sColumnParams(7).Equals("1")
|
||||||
Dim bCanUserEditVisible As Boolean = sColumnParams(8).Equals("1")
|
Dim bCanUserEditVisible As Boolean = sColumnParams(8).Equals("1")
|
||||||
@@ -65,7 +65,7 @@ Public Module DataGridColumnsIniFile
|
|||||||
Dim bIsReadOnly As Boolean = sColumnParams(4).Equals("1")
|
Dim bIsReadOnly As Boolean = sColumnParams(4).Equals("1")
|
||||||
Dim Width As Double
|
Dim Width As Double
|
||||||
Dim WidthType As DataGridLengthUnitType
|
Dim WidthType As DataGridLengthUnitType
|
||||||
StringToDouble(sColumnParams(5), Width)
|
StringToDoubleAdv(sColumnParams(5), Width)
|
||||||
Integer.TryParse(sColumnParams(6), WidthType)
|
Integer.TryParse(sColumnParams(6), WidthType)
|
||||||
Dim bVisible As Boolean = sColumnParams(7).Equals("1")
|
Dim bVisible As Boolean = sColumnParams(7).Equals("1")
|
||||||
Dim bCanUserEditVisible As Boolean = sColumnParams(8).Equals("1")
|
Dim bCanUserEditVisible As Boolean = sColumnParams(8).Equals("1")
|
||||||
|
|||||||
@@ -424,6 +424,7 @@ Public Class EgtDataGridColumn
|
|||||||
End Set
|
End Set
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
|
Private Property m_OrigIsReadOnly As Boolean = True
|
||||||
Private Property m_IsReadOnly As Boolean = True
|
Private Property m_IsReadOnly As Boolean = True
|
||||||
Public Property IsReadOnly As Boolean
|
Public Property IsReadOnly As Boolean
|
||||||
Get
|
Get
|
||||||
@@ -437,6 +438,9 @@ Public Class EgtDataGridColumn
|
|||||||
End If
|
End If
|
||||||
End Set
|
End Set
|
||||||
End Property
|
End Property
|
||||||
|
Public Sub ResetToOrigIsReadOnly()
|
||||||
|
IsReadOnly = m_OrigIsReadOnly
|
||||||
|
End Sub
|
||||||
|
|
||||||
Friend OldCanUserReorder As Boolean?
|
Friend OldCanUserReorder As Boolean?
|
||||||
Private m_CanUserReorder As Boolean
|
Private m_CanUserReorder As Boolean
|
||||||
@@ -561,6 +565,7 @@ Public Class EgtDataGridColumn
|
|||||||
m_CanUserReorder = bCanUserReorder
|
m_CanUserReorder = bCanUserReorder
|
||||||
m_CanUserResize = bCanUserResize
|
m_CanUserResize = bCanUserResize
|
||||||
m_CanUserSort = bCanUserSort
|
m_CanUserSort = bCanUserSort
|
||||||
|
m_OrigIsReadOnly = bIsReadOnly
|
||||||
m_IsReadOnly = bIsReadOnly
|
m_IsReadOnly = bIsReadOnly
|
||||||
m_Width = Width
|
m_Width = Width
|
||||||
m_Visible = bVisible
|
m_Visible = bVisible
|
||||||
@@ -588,7 +593,7 @@ Public Class EgtDataGridColumn
|
|||||||
Public Function SaveDataGridColumn() As Boolean
|
Public Function SaveDataGridColumn() As Boolean
|
||||||
Dim bOk As Boolean
|
Dim bOk As Boolean
|
||||||
Dim sColumnParams = String.Empty
|
Dim sColumnParams = String.Empty
|
||||||
sColumnParams = Name & "," & If(CanUserReorder, 1, 0) & "," & If(CanUserResize, 1, 0) & "," & If(CanUserSort, 1, 0) & "," & If(IsReadOnly, 1, 0) & "," & DoubleToString(Width.Value, 6) & "," & Width.UnitType & "," & If(Visible, 1, 0) & "," & If(CanUserEditVisible, 1, 0) & "," & CInt(SortDirection)
|
sColumnParams = Name & "," & If(CanUserReorder, 1, 0) & "," & If(CanUserResize, 1, 0) & "," & If(CanUserSort, 1, 0) & "," & If(m_OrigIsReadOnly, 1, 0) & "," & DoubleToString(Width.Value, 6) & "," & Width.UnitType & "," & If(Visible, 1, 0) & "," & If(CanUserEditVisible, 1, 0) & "," & CInt(SortDirection)
|
||||||
bOk = WriteColumnPrivateProfileParam(ParentDataGridName, DisplayIndex, sColumnParams)
|
bOk = WriteColumnPrivateProfileParam(ParentDataGridName, DisplayIndex, sColumnParams)
|
||||||
Return bOk
|
Return bOk
|
||||||
End Function
|
End Function
|
||||||
|
|||||||
@@ -149,6 +149,16 @@ Public Class MyMachGroupM
|
|||||||
End Get
|
End Get
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
|
Protected m_dPosZ As Double = 0
|
||||||
|
Public Property dPosZ As Double
|
||||||
|
Get
|
||||||
|
Return m_dPosZ
|
||||||
|
End Get
|
||||||
|
Set(value As Double)
|
||||||
|
m_dPosZ = value
|
||||||
|
End Set
|
||||||
|
End Property
|
||||||
|
|
||||||
#End Region ' Wall
|
#End Region ' Wall
|
||||||
|
|
||||||
#Region "Calc"
|
#Region "Calc"
|
||||||
@@ -311,6 +321,7 @@ Public Class MyMachGroupM
|
|||||||
EgtGetInfo(NewMachGroupM.m_Id, MGR_RPT_PANELLEN, NewMachGroupM.m_dL)
|
EgtGetInfo(NewMachGroupM.m_Id, MGR_RPT_PANELLEN, NewMachGroupM.m_dL)
|
||||||
EgtGetInfo(NewMachGroupM.m_Id, MGR_RPT_PANELWIDTH, NewMachGroupM.m_dW)
|
EgtGetInfo(NewMachGroupM.m_Id, MGR_RPT_PANELWIDTH, NewMachGroupM.m_dW)
|
||||||
EgtGetInfo(NewMachGroupM.m_Id, MGR_RPT_PANELHEIGHT, NewMachGroupM.m_dH)
|
EgtGetInfo(NewMachGroupM.m_Id, MGR_RPT_PANELHEIGHT, NewMachGroupM.m_dH)
|
||||||
|
EgtGetInfo(NewMachGroupM.m_Id, MGR_RPT_PANELPOSZ, NewMachGroupM.m_dPosZ)
|
||||||
NewMachGroupM.m_dTotMat = NewMachGroupM.m_dL * NewMachGroupM.m_dW * NewMachGroupM.m_dH
|
NewMachGroupM.m_dTotMat = NewMachGroupM.m_dL * NewMachGroupM.m_dW * NewMachGroupM.m_dH
|
||||||
NewMachGroupM.m_PartMList = LoadParts(NewMachGroupM)
|
NewMachGroupM.m_PartMList = LoadParts(NewMachGroupM)
|
||||||
For Each Part In NewMachGroupM.m_PartMList
|
For Each Part In NewMachGroupM.m_PartMList
|
||||||
@@ -343,6 +354,7 @@ Public Class MyMachGroupM
|
|||||||
EgtGetInfo(NewMachGroupM.m_Id, MGR_RPT_PANELLEN, NewMachGroupM.m_dL)
|
EgtGetInfo(NewMachGroupM.m_Id, MGR_RPT_PANELLEN, NewMachGroupM.m_dL)
|
||||||
EgtGetInfo(NewMachGroupM.m_Id, MGR_RPT_PANELWIDTH, NewMachGroupM.m_dW)
|
EgtGetInfo(NewMachGroupM.m_Id, MGR_RPT_PANELWIDTH, NewMachGroupM.m_dW)
|
||||||
EgtGetInfo(NewMachGroupM.m_Id, MGR_RPT_PANELHEIGHT, NewMachGroupM.m_dH)
|
EgtGetInfo(NewMachGroupM.m_Id, MGR_RPT_PANELHEIGHT, NewMachGroupM.m_dH)
|
||||||
|
EgtGetInfo(NewMachGroupM.m_Id, MGR_RPT_PANELPOSZ, NewMachGroupM.m_dPosZ)
|
||||||
NewMachGroupM.m_dTotMat = NewMachGroupM.m_dL * NewMachGroupM.m_dW
|
NewMachGroupM.m_dTotMat = NewMachGroupM.m_dL * NewMachGroupM.m_dW
|
||||||
NewMachGroupM.m_PartMList = LoadParts(NewMachGroupM)
|
NewMachGroupM.m_PartMList = LoadParts(NewMachGroupM)
|
||||||
For Each Part In NewMachGroupM.m_PartMList
|
For Each Part In NewMachGroupM.m_PartMList
|
||||||
@@ -408,7 +420,7 @@ Public Class MyMachGroupM
|
|||||||
EgtGetInfo(Id, MGR_RPT_PART & 1, sInfo)
|
EgtGetInfo(Id, MGR_RPT_PART & 1, sInfo)
|
||||||
If Not String.IsNullOrWhiteSpace(sInfo) Then
|
If Not String.IsNullOrWhiteSpace(sInfo) Then
|
||||||
sSplitInfo = sInfo.Split(","c)
|
sSplitInfo = sInfo.Split(","c)
|
||||||
StringToDouble(sSplitInfo(1), m_dStartCut)
|
StringToDoubleAdv(sSplitInfo(1), m_dStartCut)
|
||||||
Else
|
Else
|
||||||
m_dStartCut = 0
|
m_dStartCut = 0
|
||||||
End If
|
End If
|
||||||
|
|||||||
@@ -395,6 +395,7 @@ Public Class MyMachGroupPanelM
|
|||||||
nPartId = EgtGetNextPart(nPartId)
|
nPartId = EgtGetNextPart(nPartId)
|
||||||
End While
|
End While
|
||||||
EgtResetCurrMachGroup()
|
EgtResetCurrMachGroup()
|
||||||
|
Return ToRedrawMachGroupList
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
Friend Shared Function DuploGetToDelete(nSouId As Integer, ByRef bToDelete As Boolean) As Boolean
|
Friend Shared Function DuploGetToDelete(nSouId As Integer, ByRef bToDelete As Boolean) As Boolean
|
||||||
|
|||||||
@@ -508,7 +508,7 @@ Public Class PartM
|
|||||||
Index += 1
|
Index += 1
|
||||||
End While
|
End While
|
||||||
If bFound Then
|
If bFound Then
|
||||||
StringToDouble(sSplitInfo(1), NewPartM.m_dPOSX)
|
StringToDoubleAdv(sSplitInfo(1), NewPartM.m_dPOSX)
|
||||||
End If
|
End If
|
||||||
Else
|
Else
|
||||||
' leggo PosX, PosY, Rot e Flip
|
' leggo PosX, PosY, Rot e Flip
|
||||||
|
|||||||
@@ -169,7 +169,7 @@ Public MustInherit Class MyMachGroupVM
|
|||||||
Return LenToString(MyMachGroupM.dStartCut, 3)
|
Return LenToString(MyMachGroupM.dStartCut, 3)
|
||||||
End Get
|
End Get
|
||||||
Set(value As String)
|
Set(value As String)
|
||||||
StringToLen(value, MyMachGroupM.dStartCut)
|
StringToLenAdv(value, MyMachGroupM.dStartCut, True)
|
||||||
End Set
|
End Set
|
||||||
End Property
|
End Property
|
||||||
Public Property dStartCut As Double
|
Public Property dStartCut As Double
|
||||||
@@ -632,13 +632,17 @@ Public MustInherit Class MyMachGroupVM
|
|||||||
Public ReadOnly Property DeleteMachGroup_Command As ICommand
|
Public ReadOnly Property DeleteMachGroup_Command As ICommand
|
||||||
Get
|
Get
|
||||||
If m_cmdDeleteMachGroup Is Nothing Then
|
If m_cmdDeleteMachGroup Is Nothing Then
|
||||||
m_cmdDeleteMachGroup = New Command(AddressOf DeleteMachGroup)
|
m_cmdDeleteMachGroup = New Command(AddressOf DeleteMachGroupCmd)
|
||||||
End If
|
End If
|
||||||
Return m_cmdDeleteMachGroup
|
Return m_cmdDeleteMachGroup
|
||||||
End Get
|
End Get
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
Public Overridable Sub DeleteMachGroup()
|
Public Sub DeleteMachGroupCmd()
|
||||||
|
DeleteMachGroup()
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Public Overridable Sub DeleteMachGroup(Optional bMultipleCommand As Boolean = False)
|
||||||
' elimino tutte le copie
|
' elimino tutte le copie
|
||||||
Dim nRawPartId As Integer = EgtGetFirstRawPart()
|
Dim nRawPartId As Integer = EgtGetFirstRawPart()
|
||||||
Dim nBeamId As Integer = EgtGetFirstPartInRawPart(nRawPartId)
|
Dim nBeamId As Integer = EgtGetFirstPartInRawPart(nRawPartId)
|
||||||
|
|||||||
@@ -107,7 +107,7 @@ Public MustInherit Class PartVM
|
|||||||
Return LenToString(m_PartM.dPOSX, 3)
|
Return LenToString(m_PartM.dPOSX, 3)
|
||||||
End Get
|
End Get
|
||||||
Set(value As String)
|
Set(value As String)
|
||||||
StringToLen(value, m_PartM.dPOSX)
|
StringToLenAdv(value, m_PartM.dPOSX, True)
|
||||||
End Set
|
End Set
|
||||||
End Property
|
End Property
|
||||||
Public Property dPOSX As Double
|
Public Property dPOSX As Double
|
||||||
@@ -217,7 +217,7 @@ Public MustInherit Class PartVM
|
|||||||
Return LenToString(m_PartM.dOffset, 3)
|
Return LenToString(m_PartM.dOffset, 3)
|
||||||
End Get
|
End Get
|
||||||
Set(value As String)
|
Set(value As String)
|
||||||
StringToLen(value, m_PartM.dOffset)
|
StringToLenAdv(value, m_PartM.dOffset, True)
|
||||||
End Set
|
End Set
|
||||||
End Property
|
End Property
|
||||||
Public ReadOnly Property dOffset As Double
|
Public ReadOnly Property dOffset As Double
|
||||||
@@ -235,7 +235,7 @@ Public MustInherit Class PartVM
|
|||||||
Return LenToString(m_PartM.dPOSY, 3)
|
Return LenToString(m_PartM.dPOSY, 3)
|
||||||
End Get
|
End Get
|
||||||
Set(value As String)
|
Set(value As String)
|
||||||
StringToLen(value, m_PartM.dPOSY)
|
StringToLenAdv(value, m_PartM.dPOSY, True)
|
||||||
End Set
|
End Set
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
@@ -250,7 +250,7 @@ Public MustInherit Class PartVM
|
|||||||
Return LenToString(m_PartM.dROT, 3) & "°"
|
Return LenToString(m_PartM.dROT, 3) & "°"
|
||||||
End Get
|
End Get
|
||||||
Set(value As String)
|
Set(value As String)
|
||||||
StringToLen(value, m_PartM.dROT)
|
StringToLenAdv(value, m_PartM.dROT, True)
|
||||||
End Set
|
End Set
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ Imports System.Runtime.InteropServices
|
|||||||
<Assembly: AssemblyDescription("")>
|
<Assembly: AssemblyDescription("")>
|
||||||
<Assembly: AssemblyCompany("Egalware s.r.l.")>
|
<Assembly: AssemblyCompany("Egalware s.r.l.")>
|
||||||
<Assembly: AssemblyProduct("EgtBEAMWALL.Core")>
|
<Assembly: AssemblyProduct("EgtBEAMWALL.Core")>
|
||||||
<Assembly: AssemblyCopyright("Copyright © 2020-2022 by Egalware s.r.l.")>
|
<Assembly: AssemblyCopyright("Copyright © 2020-2023 by Egalware s.r.l.")>
|
||||||
<Assembly: AssemblyTrademark("")>
|
<Assembly: AssemblyTrademark("")>
|
||||||
|
|
||||||
<Assembly: ComVisible(False)>
|
<Assembly: ComVisible(False)>
|
||||||
@@ -35,5 +35,5 @@ Imports System.Runtime.InteropServices
|
|||||||
' by using the '*' as shown below:
|
' by using the '*' as shown below:
|
||||||
' <Assembly: AssemblyVersion("1.0.*")>
|
' <Assembly: AssemblyVersion("1.0.*")>
|
||||||
|
|
||||||
<Assembly: AssemblyVersion("2.4.7.1")>
|
<Assembly: AssemblyVersion("2.5.6.2")>
|
||||||
<Assembly: AssemblyFileVersion("2.4.7.1")>
|
<Assembly: AssemblyFileVersion("2.5.6.2")>
|
||||||
|
|||||||
@@ -5,9 +5,9 @@
|
|||||||
xmlns:EgtBEAMWALL="clr-namespace:EgtBEAMWALL.Core"
|
xmlns:EgtBEAMWALL="clr-namespace:EgtBEAMWALL.Core"
|
||||||
Title="{Binding Title}"
|
Title="{Binding Title}"
|
||||||
Style="{DynamicResource {x:Type EgtWPFLib5:EgtCustomWindow}}"
|
Style="{DynamicResource {x:Type EgtWPFLib5:EgtCustomWindow}}"
|
||||||
WindowStyle="None" ResizeMode="NoResize" TitleBarHeight="30" IsResizable="False"
|
WindowStyle="None" ResizeMode="NoResize" TitleBarHeight="30" IsResizable="True"
|
||||||
IsMinimizable="False" WindowStartupLocation="CenterScreen" ShowInTaskbar="False"
|
IsMinimizable="False" WindowStartupLocation="CenterScreen" ShowInTaskbar="False"
|
||||||
Height="500" Width="500" Topmost="True"
|
MinHeight="500" MinWidth="500" Topmost="True"
|
||||||
DataContext="{Binding RelativeSource={RelativeSource Self}}">
|
DataContext="{Binding RelativeSource={RelativeSource Self}}">
|
||||||
|
|
||||||
<EgtWPFLib5:EgtCustomWindow.Resources>
|
<EgtWPFLib5:EgtCustomWindow.Resources>
|
||||||
@@ -21,42 +21,105 @@
|
|||||||
<RowDefinition Height="1*"/>
|
<RowDefinition Height="1*"/>
|
||||||
</Grid.RowDefinitions>
|
</Grid.RowDefinitions>
|
||||||
|
|
||||||
<StackPanel>
|
<GroupBox Header="Filters"
|
||||||
<Grid Grid.Row="0" Margin="5">
|
Margin="5">
|
||||||
<Grid.RowDefinitions>
|
<Grid>
|
||||||
<RowDefinition Height="1*" />
|
<Grid.RowDefinitions>
|
||||||
<RowDefinition Height="1*" />
|
<RowDefinition Height="Auto"/>
|
||||||
</Grid.RowDefinitions>
|
<RowDefinition Height="Auto"/>
|
||||||
<Grid.ColumnDefinitions>
|
</Grid.RowDefinitions>
|
||||||
<ColumnDefinition Width="1*" />
|
<Grid>
|
||||||
<ColumnDefinition Width="1*" />
|
<Grid.ColumnDefinitions>
|
||||||
</Grid.ColumnDefinitions>
|
<ColumnDefinition Width="Auto"/>
|
||||||
|
<ColumnDefinition Width="1*"/>
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
<ComboBox ItemsSource="{Binding BTLDateTypeList}"
|
||||||
|
SelectedIndex="{Binding SelBTLDateType}"
|
||||||
|
Width="105"
|
||||||
|
Margin="5"
|
||||||
|
Style="{StaticResource FeatureComboBox}"/>
|
||||||
|
<StackPanel Grid.Column="1" Orientation="Horizontal">
|
||||||
|
<ComboBox ItemsSource="{Binding DayTypeList}"
|
||||||
|
SelectedIndex="{Binding SelDayType}"
|
||||||
|
Width="105"
|
||||||
|
Margin="0,0,2.5,0"
|
||||||
|
Style="{StaticResource PartParam_ComboBox}"/>
|
||||||
|
<StackPanel Orientation="Horizontal" Visibility="{Binding Date_Visibility}">
|
||||||
|
<TextBlock Text="{Binding From_Msg}"
|
||||||
|
Style="{StaticResource Filter_TextBlock}"/>
|
||||||
|
<DatePicker SelectedDate="{Binding dtStartDate}"
|
||||||
|
Style="{StaticResource Filter_DatePicker}"/>
|
||||||
|
<TextBlock Text="{Binding To_Msg}"
|
||||||
|
Style="{StaticResource Filter_TextBlock}"/>
|
||||||
|
<DatePicker SelectedDate="{Binding dtEndDate}"
|
||||||
|
Style="{StaticResource Filter_DatePicker}"/>
|
||||||
|
</StackPanel>
|
||||||
|
</StackPanel>
|
||||||
|
</Grid>
|
||||||
|
<Grid Grid.Row="1">
|
||||||
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition Width="Auto"/>
|
||||||
|
<ColumnDefinition Width="1*"/>
|
||||||
|
<ColumnDefinition Width="Auto"/>
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
<ComboBox ItemsSource="{Binding FilterTypeList}"
|
||||||
|
SelectedItem="{Binding SelFilterType}"
|
||||||
|
Width="105"
|
||||||
|
Margin="5"
|
||||||
|
Style="{StaticResource FeatureComboBox}"/>
|
||||||
|
<EgtWPFLib5:EgtTextBox Grid.Column="1"
|
||||||
|
Text="{Binding SearchText}"
|
||||||
|
Margin="5"
|
||||||
|
Visibility="{Binding SearchText_Visibility}"/>
|
||||||
|
<StackPanel Grid.Column="2"
|
||||||
|
Orientation="Horizontal">
|
||||||
|
<TextBlock Text="Rows"
|
||||||
|
Style="{StaticResource OptionTextBlock}"/>
|
||||||
|
<ComboBox ItemsSource="{Binding RowQuantityList}"
|
||||||
|
SelectedIndex="{Binding SelRowQuantity}"
|
||||||
|
Style="{StaticResource FeatureComboBox}"/>
|
||||||
|
</StackPanel>
|
||||||
|
</Grid>
|
||||||
|
</Grid>
|
||||||
|
</GroupBox>
|
||||||
|
|
||||||
<TextBlock Text="{Binding FilterType_Msg}"
|
|
||||||
|
<!--<StackPanel>
|
||||||
|
<Grid Grid.Row="0" Margin="5">
|
||||||
|
<Grid.RowDefinitions>
|
||||||
|
<RowDefinition Height="1*" />
|
||||||
|
<RowDefinition Height="1*" />
|
||||||
|
</Grid.RowDefinitions>
|
||||||
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition Width="1*" />
|
||||||
|
<ColumnDefinition Width="1*" />
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
|
||||||
|
<TextBlock Text="{Binding FilterType_Msg}"
|
||||||
Grid.Row="0" Grid.Column="0"
|
Grid.Row="0" Grid.Column="0"
|
||||||
Style="{StaticResource OptionTextBlock}"/>
|
Style="{StaticResource OptionTextBlock}"/>
|
||||||
<ComboBox ItemsSource="{Binding SearchColumnList}"
|
<ComboBox ItemsSource="{Binding SearchColumnList}"
|
||||||
SelectedItem="{Binding SelSearchColumn}"
|
SelectedItem="{Binding SelSearchColumn}"
|
||||||
Width="Auto"
|
Width="Auto"
|
||||||
Margin="5"
|
Margin="5"
|
||||||
Grid.Row="0" Grid.Column="1"
|
Grid.Row="0" Grid.Column="1"
|
||||||
Style="{StaticResource FeatureComboBox}"/>
|
Style="{StaticResource FeatureComboBox}"/>
|
||||||
<TextBlock Text="{Binding Search_Msg}"
|
<TextBlock Text="{Binding Search_Msg}"
|
||||||
Margin="0,5,0,0"
|
Margin="0,5,0,0"
|
||||||
Grid.Row="1" Grid.Column="0"
|
Grid.Row="1" Grid.Column="0"
|
||||||
Style="{StaticResource OptionTextBlock}"/>
|
Style="{StaticResource OptionTextBlock}"/>
|
||||||
<EgtWPFLib5:EgtTextBox Text="{Binding SearchText}"
|
<EgtWPFLib5:EgtTextBox Text="{Binding SearchText}"
|
||||||
Margin="5"
|
Margin="5"
|
||||||
Grid.Row="1" Grid.Column="1"
|
Grid.Row="1" Grid.Column="1"
|
||||||
Visibility="{Binding SearchText_Visibility}"/>
|
Visibility="{Binding SearchText_Visibility}"/>
|
||||||
<Calendar SelectedDatesChanged="Calendar_SelectedDatesChanged"
|
<Calendar SelectedDatesChanged="Calendar_SelectedDatesChanged"
|
||||||
SelectionMode="MultipleRange"
|
SelectionMode="MultipleRange"
|
||||||
Grid.Row="1" Grid.Column="1"
|
Grid.Row="1" Grid.Column="1"
|
||||||
Visibility="{Binding SearchDate_Visibility}"/>
|
Visibility="{Binding SearchDate_Visibility}"/>
|
||||||
</Grid>
|
</Grid>
|
||||||
</StackPanel>
|
</StackPanel>-->
|
||||||
|
|
||||||
<EgtBEAMWALL:EgtDataGrid Grid.Row="1"
|
<EgtBEAMWALL:EgtDataGrid Grid.Row="1"
|
||||||
ItemsSource="{Binding ProjectList}"
|
ItemsSource="{Binding ProjectList}"
|
||||||
SelectedItem="{Binding SelProject}"
|
SelectedItem="{Binding SelProject}"
|
||||||
CanUserAddRows="False"
|
CanUserAddRows="False"
|
||||||
@@ -85,6 +148,14 @@
|
|||||||
</DataTemplate>
|
</DataTemplate>
|
||||||
</DataGridTextColumn.HeaderTemplate>
|
</DataGridTextColumn.HeaderTemplate>
|
||||||
</DataGridTextColumn>
|
</DataGridTextColumn>
|
||||||
|
<!-- Project Name -->
|
||||||
|
<DataGridTextColumn x:Key="colPROJNAME" Binding="{Binding sDescription}">
|
||||||
|
<DataGridTextColumn.HeaderTemplate>
|
||||||
|
<DataTemplate>
|
||||||
|
<TextBlock Text="{Binding Path=DataContext.BTLFileName_Msg,RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OpenProjectFileDialogV}}}"/>
|
||||||
|
</DataTemplate>
|
||||||
|
</DataGridTextColumn.HeaderTemplate>
|
||||||
|
</DataGridTextColumn>
|
||||||
<!-- BTL FileName -->
|
<!-- BTL FileName -->
|
||||||
<DataGridTextColumn x:Key="colBTLNAME" Binding="{Binding sBTLFileName}">
|
<DataGridTextColumn x:Key="colBTLNAME" Binding="{Binding sBTLFileName}">
|
||||||
<DataGridTextColumn.HeaderTemplate>
|
<DataGridTextColumn.HeaderTemplate>
|
||||||
|
|||||||
@@ -5,6 +5,8 @@ Imports System.Windows.Controls
|
|||||||
Imports System.Windows.Input
|
Imports System.Windows.Input
|
||||||
Imports EgtBEAMWALL.Core.ConstBeam
|
Imports EgtBEAMWALL.Core.ConstBeam
|
||||||
Imports EgtUILib
|
Imports EgtUILib
|
||||||
|
Imports EgtWPFLib5
|
||||||
|
Imports EgtBEAMWALL
|
||||||
|
|
||||||
Public Class OpenProjectFileDialogV
|
Public Class OpenProjectFileDialogV
|
||||||
|
|
||||||
@@ -19,6 +21,8 @@ Public Class OpenProjectFileDialogV
|
|||||||
Me.DataContext = OpenProjFileDialogVM
|
Me.DataContext = OpenProjFileDialogVM
|
||||||
' Assegno al riferimento locale al VM il VM preso dal DataContext
|
' Assegno al riferimento locale al VM il VM preso dal DataContext
|
||||||
m_OpenProjFileDialogVM = OpenProjFileDialogVM
|
m_OpenProjFileDialogVM = OpenProjFileDialogVM
|
||||||
|
AddHandler Me.Loaded, AddressOf OpenProjectFileDialog_Loaded
|
||||||
|
AddHandler Me.Closing, AddressOf OpenProjectFileDialog_Closing
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
#End Region ' CONSTRUCTOR
|
#End Region ' CONSTRUCTOR
|
||||||
@@ -42,6 +46,20 @@ Public Class OpenProjectFileDialogV
|
|||||||
Return Me.ShowDialog()
|
Return Me.ShowDialog()
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
|
Private Sub OpenProjectFileDialog_Loaded(sender As Object, e As RoutedEventArgs)
|
||||||
|
' Carico e imposto posizione finestra
|
||||||
|
WinPosFromIniToWindow(S_OPENFILEDIALOG, K_VIEWOPTIMWINPLACE, Me)
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Private Sub OpenProjectFileDialog_Closing(sender As Object, e As System.ComponentModel.CancelEventArgs)
|
||||||
|
If (Keyboard.Modifiers And ModifierKeys.Alt) = ModifierKeys.Alt OrElse Keyboard.IsKeyDown(Key.F4) Then
|
||||||
|
e.Cancel = True
|
||||||
|
Return
|
||||||
|
End If
|
||||||
|
' Salvo posizione finestra (se non minimizzata)
|
||||||
|
WinPosFromWindowToIni(Me, S_OPENFILEDIALOG, K_VIEWOPTIMWINPLACE)
|
||||||
|
End Sub
|
||||||
|
|
||||||
#End Region ' METHODS
|
#End Region ' METHODS
|
||||||
|
|
||||||
#Region "EVENTS"
|
#Region "EVENTS"
|
||||||
@@ -60,10 +78,4 @@ Public Class OpenProjectFileDialogV
|
|||||||
Me.DialogResult = bDialogResult
|
Me.DialogResult = bDialogResult
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Sub Calendar_SelectedDatesChanged(sender As Object, e As SelectionChangedEventArgs)
|
|
||||||
Dim cal As System.Windows.Controls.Calendar = sender
|
|
||||||
m_OpenProjFileDialogVM.m_SearchDate = cal.SelectedDates
|
|
||||||
m_OpenProjFileDialogVM.m_ProjectList_View.Refresh()
|
|
||||||
End Sub
|
|
||||||
|
|
||||||
End Class
|
End Class
|
||||||
@@ -14,6 +14,32 @@ Public MustInherit Class OpenProjectFileDialogVM
|
|||||||
|
|
||||||
#Region "FIELDS & PROPERTIES"
|
#Region "FIELDS & PROPERTIES"
|
||||||
|
|
||||||
|
Public Enum BTLDateTypes As Integer
|
||||||
|
CREATEDATE = 0
|
||||||
|
EXPORTDATE = 1
|
||||||
|
End Enum
|
||||||
|
|
||||||
|
Private Enum FilterTypes As Integer
|
||||||
|
NULL = 0
|
||||||
|
ID = 1
|
||||||
|
BTLFILENAME = 2
|
||||||
|
LISTNAME = 3
|
||||||
|
MACHINE = 4
|
||||||
|
End Enum
|
||||||
|
|
||||||
|
Public Enum DayTypes As Integer
|
||||||
|
LASTMONTH = 0
|
||||||
|
LAST3MONTHS = 1
|
||||||
|
LAST6MONTHS = 2
|
||||||
|
PERIOD = 3
|
||||||
|
End Enum
|
||||||
|
|
||||||
|
Public Enum RowQuantities As Integer
|
||||||
|
FIFTY = 0
|
||||||
|
HUNDRED = 1
|
||||||
|
HUNDREDANDFIFTY = 2
|
||||||
|
End Enum
|
||||||
|
|
||||||
Friend Event m_CloseWindow(bDialogResult As Boolean)
|
Friend Event m_CloseWindow(bDialogResult As Boolean)
|
||||||
|
|
||||||
Protected m_ProjectColumns As New ObservableCollection(Of EgtDataGridColumn)
|
Protected m_ProjectColumns As New ObservableCollection(Of EgtDataGridColumn)
|
||||||
@@ -83,18 +109,131 @@ Public MustInherit Class OpenProjectFileDialogVM
|
|||||||
End Set
|
End Set
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
' lista campi per ricerca testuale e con datepicker
|
Protected m_BTLDateTypeList As New List(Of String)
|
||||||
Protected m_SearchColumnList As New ObservableCollection(Of IdNameStruct)
|
Public ReadOnly Property BTLDateTypeList As List(Of String)
|
||||||
Public ReadOnly Property SearchColumnList As ObservableCollection(Of IdNameStruct)
|
|
||||||
Get
|
Get
|
||||||
Return m_SearchColumnList
|
Return m_BTLDateTypeList
|
||||||
End Get
|
End Get
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
Protected m_SelSearchColumn As IdNameStruct = Nothing
|
Protected m_SelBTLDateType As BTLDateTypes = Nothing
|
||||||
Public Property SelSearchColumn As IdNameStruct
|
Public Property SelBTLDateType As Integer
|
||||||
Get
|
Get
|
||||||
Return m_SelSearchColumn
|
Return m_SelBTLDateType
|
||||||
|
End Get
|
||||||
|
Set(value As Integer)
|
||||||
|
' aggiorno lista da Db
|
||||||
|
RefreshProjectList()
|
||||||
|
m_ProjectList_View.Refresh()
|
||||||
|
End Set
|
||||||
|
End Property
|
||||||
|
|
||||||
|
|
||||||
|
Private m_DayTypeList As New List(Of String)({"Last Month", "Last 3 Months", "Last 6 Months", EgtMsg(62531)})
|
||||||
|
Public ReadOnly Property DayTypeList As List(Of String)
|
||||||
|
Get
|
||||||
|
Return m_DayTypeList
|
||||||
|
End Get
|
||||||
|
End Property
|
||||||
|
|
||||||
|
Protected m_SelDayType As DayTypes = DayTypes.LASTMONTH
|
||||||
|
Public Property SelDayType As Integer
|
||||||
|
Get
|
||||||
|
Return m_SelDayType
|
||||||
|
End Get
|
||||||
|
Set(value As Integer)
|
||||||
|
Dim PrevSelDayType As DayTypes = m_SelDayType
|
||||||
|
m_SelDayType = value
|
||||||
|
WriteMainPrivateProfileString(S_OPENFILEDIALOG, K_DAYTYPE, Convert.ToInt32(m_SelDayType))
|
||||||
|
m_Date_Visibility = If(m_SelDayType = DayTypes.PERIOD, Visibility.Visible, Visibility.Collapsed)
|
||||||
|
If m_SelDayType = DayTypes.PERIOD Then
|
||||||
|
Select Case PrevSelDayType
|
||||||
|
Case DayTypes.LASTMONTH
|
||||||
|
m_dtStartDate = DateTime.Today + TimeSpan.FromDays(1)
|
||||||
|
m_dtEndDate = m_dtStartDate - TimeSpan.FromDays(31)
|
||||||
|
Case DayTypes.LAST3MONTHS
|
||||||
|
|
||||||
|
Case DayTypes.LAST6MONTHS
|
||||||
|
|
||||||
|
End Select
|
||||||
|
NotifyPropertyChanged(NameOf(dtStartDate))
|
||||||
|
NotifyPropertyChanged(NameOf(dtEndDate))
|
||||||
|
End If
|
||||||
|
NotifyPropertyChanged(NameOf(Date_Visibility))
|
||||||
|
' aggiorno lista da Db
|
||||||
|
RefreshProjectList()
|
||||||
|
m_ProjectList_View.Refresh()
|
||||||
|
End Set
|
||||||
|
End Property
|
||||||
|
|
||||||
|
Private m_dtStartDate As DateTime = DateTime.Today
|
||||||
|
Public Property dtStartDate As DateTime
|
||||||
|
Get
|
||||||
|
Return m_dtStartDate
|
||||||
|
End Get
|
||||||
|
Set(value As DateTime)
|
||||||
|
m_dtStartDate = value
|
||||||
|
Dim lStartDate As Long = m_dtStartDate.ToFileTimeUtc()
|
||||||
|
WriteMainPrivateProfileString(S_MACHINELOGFILTER, K_STARTDATE, lStartDate.ToString())
|
||||||
|
' aggiorno lista da Db
|
||||||
|
RefreshProjectList()
|
||||||
|
m_ProjectList_View.Refresh()
|
||||||
|
End Set
|
||||||
|
End Property
|
||||||
|
|
||||||
|
Private m_dtEndDate As DateTime = DateTime.Today
|
||||||
|
Public Property dtEndDate As DateTime
|
||||||
|
Get
|
||||||
|
Return m_dtEndDate
|
||||||
|
End Get
|
||||||
|
Set(value As DateTime)
|
||||||
|
m_dtEndDate = value
|
||||||
|
Dim lEndDate As Long = m_dtEndDate.ToFileTimeUtc()
|
||||||
|
WriteMainPrivateProfileString(S_MACHINELOGFILTER, K_ENDDATE, lEndDate.ToString())
|
||||||
|
' aggiorno lista da Db
|
||||||
|
RefreshProjectList()
|
||||||
|
m_ProjectList_View.Refresh()
|
||||||
|
End Set
|
||||||
|
End Property
|
||||||
|
|
||||||
|
Private m_Date_Visibility As Visibility = Visibility.Collapsed
|
||||||
|
Public ReadOnly Property Date_Visibility As Visibility
|
||||||
|
Get
|
||||||
|
Return m_Date_Visibility
|
||||||
|
End Get
|
||||||
|
End Property
|
||||||
|
|
||||||
|
Private m_RowQuantityList As New List(Of String)({50, 100, 150})
|
||||||
|
Public ReadOnly Property RowQuantityList As List(Of String)
|
||||||
|
Get
|
||||||
|
Return m_RowQuantityList
|
||||||
|
End Get
|
||||||
|
End Property
|
||||||
|
|
||||||
|
Private m_SelRowQuantity As RowQuantities
|
||||||
|
Public Property SelRowQuantity As Integer
|
||||||
|
Get
|
||||||
|
Return m_SelRowQuantity
|
||||||
|
End Get
|
||||||
|
Set(value As Integer)
|
||||||
|
m_SelRowQuantity = value
|
||||||
|
RefreshProjectList()
|
||||||
|
m_ProjectList_View.Refresh()
|
||||||
|
End Set
|
||||||
|
End Property
|
||||||
|
|
||||||
|
' lista campi per ricerca testuale e con datepicker
|
||||||
|
Protected m_FilterTypeList As New ObservableCollection(Of IdNameStruct)
|
||||||
|
Public ReadOnly Property FilterTypeList As ObservableCollection(Of IdNameStruct)
|
||||||
|
Get
|
||||||
|
Return m_FilterTypeList
|
||||||
|
End Get
|
||||||
|
End Property
|
||||||
|
|
||||||
|
Protected m_SelFilterType As IdNameStruct = Nothing
|
||||||
|
Public Property SelFilterType As IdNameStruct
|
||||||
|
Get
|
||||||
|
Return m_SelFilterType
|
||||||
End Get
|
End Get
|
||||||
Set(value As IdNameStruct)
|
Set(value As IdNameStruct)
|
||||||
' resetto il contenuto della barra di ricerca testuale
|
' resetto il contenuto della barra di ricerca testuale
|
||||||
@@ -103,15 +242,15 @@ Public MustInherit Class OpenProjectFileDialogVM
|
|||||||
' resetto le selezioni sul calendario
|
' resetto le selezioni sul calendario
|
||||||
If Not IsNothing(SearchDate) Then SearchDate.Clear()
|
If Not IsNothing(SearchDate) Then SearchDate.Clear()
|
||||||
' setto il Tipo Filtro a NULL e refresho la lista dei progetti (in modo da averli visibili tutti)
|
' setto il Tipo Filtro a NULL e refresho la lista dei progetti (in modo da averli visibili tutti)
|
||||||
m_SelSearchColumn = m_SearchColumnList(0)
|
m_SelFilterType = m_FilterTypeList(0)
|
||||||
m_ProjectList_View.Refresh()
|
m_ProjectList_View.Refresh()
|
||||||
' ora setto il valore scelto come Tipo Filtro
|
' ora setto il valore scelto come Tipo Filtro
|
||||||
m_SelSearchColumn = value
|
m_SelFilterType = value
|
||||||
Select Case m_SelSearchColumn.Id
|
Select Case m_SelFilterType.Id
|
||||||
Case OpenProjFileColumn.ID, OpenProjFileColumn.BTLFILENAME, OpenProjFileColumn.LISTNAME, OpenProjFileColumn.MACHINE
|
Case FilterTypes.ID, FilterTypes.BTLFILENAME, FilterTypes.LISTNAME, FilterTypes.MACHINE
|
||||||
SearchText_Visibility = Visibility.Visible
|
SearchText_Visibility = Visibility.Visible
|
||||||
SearchDate_Visibility = Visibility.Collapsed
|
SearchDate_Visibility = Visibility.Collapsed
|
||||||
Case OpenProjFileColumn.EXPORTDATE, OpenProjFileColumn.CREATEDATE
|
Case BTLDateTypes.EXPORTDATE, BTLDateTypes.CREATEDATE
|
||||||
SearchText_Visibility = Visibility.Collapsed
|
SearchText_Visibility = Visibility.Collapsed
|
||||||
SearchDate_Visibility = Visibility.Visible
|
SearchDate_Visibility = Visibility.Visible
|
||||||
Case Else
|
Case Else
|
||||||
@@ -161,18 +300,13 @@ Public MustInherit Class OpenProjectFileDialogVM
|
|||||||
End Set
|
End Set
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
Public Enum OpenProjFileColumn As Integer
|
|
||||||
NULL = 0
|
|
||||||
ID = 1
|
|
||||||
BTLFILENAME = 2
|
|
||||||
LISTNAME = 3
|
|
||||||
EXPORTDATE = 4
|
|
||||||
CREATEDATE = 5
|
|
||||||
MACHINE = 6
|
|
||||||
End Enum
|
|
||||||
|
|
||||||
#Region "Messages"
|
#Region "Messages"
|
||||||
|
|
||||||
|
Public ReadOnly Property Title As String
|
||||||
|
Get
|
||||||
|
Return "Open Project"
|
||||||
|
End Get
|
||||||
|
End Property
|
||||||
Public ReadOnly Property FilterType_Msg As String
|
Public ReadOnly Property FilterType_Msg As String
|
||||||
Get
|
Get
|
||||||
Return EgtMsg(61836)
|
Return EgtMsg(61836)
|
||||||
@@ -236,6 +370,18 @@ Public MustInherit Class OpenProjectFileDialogVM
|
|||||||
End Get
|
End Get
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
|
Public ReadOnly Property From_Msg As String
|
||||||
|
Get
|
||||||
|
Return EgtMsg(62523)
|
||||||
|
End Get
|
||||||
|
End Property
|
||||||
|
|
||||||
|
Public ReadOnly Property To_Msg As String
|
||||||
|
Get
|
||||||
|
Return EgtMsg(62524)
|
||||||
|
End Get
|
||||||
|
End Property
|
||||||
|
|
||||||
#End Region
|
#End Region
|
||||||
|
|
||||||
' Definizione comandi
|
' Definizione comandi
|
||||||
@@ -244,31 +390,45 @@ Public MustInherit Class OpenProjectFileDialogVM
|
|||||||
|
|
||||||
#End Region ' FIELDS & PROPERTIES
|
#End Region ' FIELDS & PROPERTIES
|
||||||
|
|
||||||
|
Sub New()
|
||||||
|
End Sub
|
||||||
|
|
||||||
#Region "METHODS"
|
#Region "METHODS"
|
||||||
|
|
||||||
Public MustOverride Function Init(ProjectType As ProjectType, Optional CurrProjectList As List(Of ProjectFileVM) = Nothing, Optional GoToProd As Boolean = False) As Boolean?
|
Public MustOverride Function Init(ProjectType As ProjectType, Optional CurrProjectList As List(Of ProjectFileVM) = Nothing, Optional GoToProd As Boolean = False) As Boolean?
|
||||||
|
Public Overridable Sub RefreshProjectList(Optional GoToProd As Boolean = False)
|
||||||
|
End Sub
|
||||||
|
|
||||||
Protected Sub LoadColumns(ProjectType As ProjectType)
|
Protected Sub LoadColumns(ProjectType As ProjectType)
|
||||||
If ProjectType = ProjectType.PROJ Then
|
If ProjectType = ProjectType.PROJ Then
|
||||||
' carico le colonne della datagrid
|
' carico le colonne della datagrid
|
||||||
GetPrivateProfileColumns(S_OPENPROJFILEDLG_PROJ, ProjectColumns)
|
GetPrivateProfileColumns(S_OPENPROJFILEDLG_PROJ, ProjectColumns)
|
||||||
' carico campi su cui eseguire il filtro di ricerca
|
' carico campi su cui eseguire il filtro di ricerca
|
||||||
m_SearchColumnList = New ObservableCollection(Of IdNameStruct)({New IdNameStruct(OpenProjFileColumn.NULL, ""),
|
m_BTLDateTypeList = New List(Of String)({CreateDate_Msg, ExportDate_Msg})
|
||||||
New IdNameStruct(OpenProjFileColumn.ID, Id_Msg),
|
m_SelBTLDateType = BTLDateTypes.CREATEDATE
|
||||||
New IdNameStruct(OpenProjFileColumn.BTLFILENAME, BTLFileName_Msg),
|
NotifyPropertyChanged(NameOf(BTLDateTypeList))
|
||||||
New IdNameStruct(OpenProjFileColumn.LISTNAME, ListName_Msg),
|
NotifyPropertyChanged(NameOf(SelBTLDateType))
|
||||||
New IdNameStruct(OpenProjFileColumn.EXPORTDATE, ExportDate_Msg),
|
m_FilterTypeList = New ObservableCollection(Of IdNameStruct)({New IdNameStruct(FilterTypes.NULL, ""),
|
||||||
New IdNameStruct(OpenProjFileColumn.CREATEDATE, CreateDate_Msg),
|
New IdNameStruct(FilterTypes.ID, Id_Msg),
|
||||||
New IdNameStruct(OpenProjFileColumn.MACHINE, Machine_Msg)})
|
New IdNameStruct(FilterTypes.BTLFILENAME, BTLFileName_Msg),
|
||||||
|
New IdNameStruct(FilterTypes.LISTNAME, ListName_Msg),
|
||||||
|
New IdNameStruct(FilterTypes.MACHINE, Machine_Msg)})
|
||||||
|
m_SelFilterType = m_FilterTypeList.FirstOrDefault(Function(x) x.Id = FilterTypes.NULL)
|
||||||
|
NotifyPropertyChanged(NameOf(SelFilterType))
|
||||||
ElseIf ProjectType = ProjectType.PROD Then
|
ElseIf ProjectType = ProjectType.PROD Then
|
||||||
' carico le colonne della datagrid
|
' carico le colonne della datagrid
|
||||||
GetPrivateProfileColumns(S_OPENPROJFILEDLG_PROD, ProjectColumns)
|
GetPrivateProfileColumns(S_OPENPROJFILEDLG_PROD, ProjectColumns)
|
||||||
' carico campi su cui eseguire il filtro di ricerca
|
' carico campi su cui eseguire il filtro di ricerca
|
||||||
m_SearchColumnList = New ObservableCollection(Of IdNameStruct)({New IdNameStruct(OpenProjFileColumn.NULL, ""),
|
m_BTLDateTypeList = New List(Of String)({CreateDate_Msg})
|
||||||
New IdNameStruct(OpenProjFileColumn.ID, Id_Msg),
|
m_SelBTLDateType = BTLDateTypes.CREATEDATE
|
||||||
New IdNameStruct(OpenProjFileColumn.BTLFILENAME, BTLFileName_Msg),
|
NotifyPropertyChanged(NameOf(BTLDateTypeList))
|
||||||
New IdNameStruct(OpenProjFileColumn.CREATEDATE, CreateDate_Msg),
|
NotifyPropertyChanged(NameOf(SelBTLDateType))
|
||||||
New IdNameStruct(OpenProjFileColumn.MACHINE, Machine_Msg)})
|
m_FilterTypeList = New ObservableCollection(Of IdNameStruct)({New IdNameStruct(FilterTypes.NULL, ""),
|
||||||
|
New IdNameStruct(FilterTypes.ID, Id_Msg),
|
||||||
|
New IdNameStruct(FilterTypes.BTLFILENAME, BTLFileName_Msg),
|
||||||
|
New IdNameStruct(FilterTypes.MACHINE, Machine_Msg)})
|
||||||
|
m_SelFilterType = m_FilterTypeList.FirstOrDefault(Function(x) x.Id = FilterTypes.NULL)
|
||||||
|
NotifyPropertyChanged(NameOf(SelFilterType))
|
||||||
End If
|
End If
|
||||||
' setto la visibilità delle colonne delle EgtDataGrid
|
' setto la visibilità delle colonne delle EgtDataGrid
|
||||||
For Each col In ProjectColumns
|
For Each col In ProjectColumns
|
||||||
@@ -301,22 +461,22 @@ Public MustInherit Class OpenProjectFileDialogVM
|
|||||||
Dim bProjectOk As Boolean = True
|
Dim bProjectOk As Boolean = True
|
||||||
If m_ProjectType = ProjectType.PROJ Then
|
If m_ProjectType = ProjectType.PROJ Then
|
||||||
Dim CurrProj As ProjFileVM = DirectCast(Proj, ProjFileVM)
|
Dim CurrProj As ProjFileVM = DirectCast(Proj, ProjFileVM)
|
||||||
If m_SelSearchColumn.Id <> OpenProjFileColumn.NULL AndAlso (
|
If m_SelFilterType.Id <> FilterTypes.NULL AndAlso (
|
||||||
(m_SelSearchColumn.Id = OpenProjFileColumn.EXPORTDATE AndAlso Not SearchDate.Contains(CurrProj.dtExportDate.Date)) OrElse
|
(m_SelFilterType.Id = BTLDateTypes.EXPORTDATE AndAlso Not SearchDate.Contains(CurrProj.dtExportDate.Date)) OrElse
|
||||||
(m_SelSearchColumn.Id = OpenProjFileColumn.CREATEDATE AndAlso Not SearchDate.Contains(CurrProj.dtCreateDate.Date))) Then bProjectOk = False
|
(m_SelFilterType.Id = BTLDateTypes.CREATEDATE AndAlso Not SearchDate.Contains(CurrProj.dtCreateDate.Date))) Then bProjectOk = False
|
||||||
If m_SelSearchColumn.Id <> OpenProjFileColumn.NULL AndAlso m_SearchText <> String.Empty AndAlso (
|
If m_SelFilterType.Id <> FilterTypes.NULL AndAlso m_SearchText <> String.Empty AndAlso (
|
||||||
(m_SelSearchColumn.Id = OpenProjFileColumn.ID AndAlso CurrProj.sProjId.ToString.IndexOf(SearchText, StringComparison.InvariantCultureIgnoreCase) < 0) OrElse
|
(m_SelFilterType.Id = FilterTypes.ID AndAlso CurrProj.sProjId.ToString.IndexOf(SearchText, StringComparison.InvariantCultureIgnoreCase) < 0) OrElse
|
||||||
(m_SelSearchColumn.Id = OpenProjFileColumn.BTLFILENAME AndAlso CurrProj.sBTLFileName.IndexOf(SearchText, StringComparison.InvariantCultureIgnoreCase) < 0) OrElse
|
(m_SelFilterType.Id = FilterTypes.BTLFILENAME AndAlso CurrProj.sBTLFileName.IndexOf(SearchText, StringComparison.InvariantCultureIgnoreCase) < 0) OrElse
|
||||||
(m_SelSearchColumn.Id = OpenProjFileColumn.LISTNAME AndAlso CurrProj.sListName.IndexOf(SearchText, StringComparison.InvariantCultureIgnoreCase) < 0) OrElse
|
(m_SelFilterType.Id = FilterTypes.LISTNAME AndAlso CurrProj.sListName.IndexOf(SearchText, StringComparison.InvariantCultureIgnoreCase) < 0) OrElse
|
||||||
(m_SelSearchColumn.Id = OpenProjFileColumn.MACHINE AndAlso CurrProj.sMachine.IndexOf(SearchText, StringComparison.InvariantCultureIgnoreCase) < 0)) Then bProjectOk = False
|
(m_SelFilterType.Id = FilterTypes.MACHINE AndAlso CurrProj.sMachine.IndexOf(SearchText, StringComparison.InvariantCultureIgnoreCase) < 0)) Then bProjectOk = False
|
||||||
ElseIf m_ProjectType = ProjectType.PROD Then
|
ElseIf m_ProjectType = ProjectType.PROD Then
|
||||||
Dim CurrProj As ProdFileVM = DirectCast(Proj, ProdFileVM)
|
Dim CurrProj As ProdFileVM = DirectCast(Proj, ProdFileVM)
|
||||||
If m_SelSearchColumn.Id <> OpenProjFileColumn.NULL AndAlso (
|
If m_SelFilterType.Id <> FilterTypes.NULL AndAlso (
|
||||||
(m_SelSearchColumn.Id = OpenProjFileColumn.CREATEDATE AndAlso Not SearchDate.Contains(CurrProj.dtCreateDate.Date))) Then bProjectOk = False
|
(m_SelFilterType.Id = BTLDateTypes.CREATEDATE AndAlso Not SearchDate.Contains(CurrProj.dtCreateDate.Date))) Then bProjectOk = False
|
||||||
If m_SelSearchColumn.Id <> OpenProjFileColumn.NULL AndAlso m_SearchText <> String.Empty AndAlso (
|
If m_SelFilterType.Id <> FilterTypes.NULL AndAlso m_SearchText <> String.Empty AndAlso (
|
||||||
(m_SelSearchColumn.Id = OpenProjFileColumn.ID AndAlso CurrProj.sProdId.ToString.IndexOf(SearchText, StringComparison.InvariantCultureIgnoreCase) < 0) OrElse
|
(m_SelFilterType.Id = FilterTypes.ID AndAlso CurrProj.sProdId.ToString.IndexOf(SearchText, StringComparison.InvariantCultureIgnoreCase) < 0) OrElse
|
||||||
(m_SelSearchColumn.Id = OpenProjFileColumn.BTLFILENAME AndAlso CurrProj.sBTLFileName.IndexOf(SearchText, StringComparison.InvariantCultureIgnoreCase) < 0) OrElse
|
(m_SelFilterType.Id = FilterTypes.BTLFILENAME AndAlso CurrProj.sBTLFileName.IndexOf(SearchText, StringComparison.InvariantCultureIgnoreCase) < 0) OrElse
|
||||||
(m_SelSearchColumn.Id = OpenProjFileColumn.MACHINE AndAlso CurrProj.sMachine.IndexOf(SearchText, StringComparison.InvariantCultureIgnoreCase) < 0)) Then bProjectOk = False
|
(m_SelFilterType.Id = FilterTypes.MACHINE AndAlso CurrProj.sMachine.IndexOf(SearchText, StringComparison.InvariantCultureIgnoreCase) < 0)) Then bProjectOk = False
|
||||||
End If
|
End If
|
||||||
Return bProjectOk
|
Return bProjectOk
|
||||||
End Function
|
End Function
|
||||||
|
|||||||
@@ -10,6 +10,9 @@ Public Class ProdFileM
|
|||||||
Return m_nProjIdList
|
Return m_nProjIdList
|
||||||
End Get
|
End Get
|
||||||
End Property
|
End Property
|
||||||
|
Public Sub SetProjIdList(value As List(Of Integer))
|
||||||
|
m_nProjIdList = value
|
||||||
|
End Sub
|
||||||
|
|
||||||
Protected m_sName As String
|
Protected m_sName As String
|
||||||
Public ReadOnly Property sName As String
|
Public ReadOnly Property sName As String
|
||||||
|
|||||||
@@ -19,39 +19,49 @@ Public Class ProjFileM
|
|||||||
End Property
|
End Property
|
||||||
|
|
||||||
Protected m_sBTLFileName As String = String.Empty
|
Protected m_sBTLFileName As String = String.Empty
|
||||||
Public Property sBTLFileName As String
|
Public Property sBTLFileName As String
|
||||||
Get
|
Get
|
||||||
Return m_sBTLFileName
|
Return m_sBTLFileName
|
||||||
End Get
|
End Get
|
||||||
Set(value As String)
|
Set(value As String)
|
||||||
m_sBTLFileName = value
|
m_sBTLFileName = value
|
||||||
End Set
|
End Set
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
|
Protected m_sDescription As String = String.Empty
|
||||||
|
Public Property sDescription As String
|
||||||
|
Get
|
||||||
|
Return m_sDescription
|
||||||
|
End Get
|
||||||
|
Set(value As String)
|
||||||
|
m_sDescription = value
|
||||||
|
End Set
|
||||||
|
End Property
|
||||||
|
|
||||||
#Region "CONSTRUCTORS"
|
#Region "CONSTRUCTORS"
|
||||||
|
|
||||||
Protected Sub New()
|
Protected Sub New()
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Public Shared Function CreateNewProjFileM() As ProjFileM
|
Public Shared Function CreateNewProjFileM() As ProjFileM
|
||||||
Return New ProjFileM
|
Return New ProjFileM
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
Public Shared Function CreateProjFileM(nProjId As Integer, nProdId As Integer, dtCreateProjDate As DateTime, dtExportDate As DateTime, sListName As String,
|
Public Shared Function CreateProjFileM(nProjId As Integer, nProdId As Integer, dtCreateProjDate As DateTime, dtExportDate As DateTime, sListName As String, sBTLFileName As String, sDescription As String, IsNew As Boolean, IsLocked As Boolean, nType As BWType, sMachine As String) As ProjFileM
|
||||||
sBTLFileName As String, IsNew As Boolean, IsLocked As Boolean, nType As BWType, sMachine As String) As ProjFileM
|
Dim NewProjectFileM As New ProjFileM
|
||||||
Dim NewProjectFileM As New ProjFileM
|
NewProjectFileM.m_nProjId = nProjId
|
||||||
NewProjectFileM.m_nProjId = nProjId
|
NewProjectFileM.m_nProdId = nProdId
|
||||||
NewProjectFileM.m_nProdId = nProdId
|
NewProjectFileM.m_dtCreateDate = dtCreateProjDate
|
||||||
NewProjectFileM.m_dtCreateDate = dtCreateProjDate
|
NewProjectFileM.m_dtExportDate = dtExportDate
|
||||||
NewProjectFileM.m_dtExportDate = dtExportDate
|
NewProjectFileM.m_sListName = sListName
|
||||||
NewProjectFileM.m_sListName = sListName
|
NewProjectFileM.m_sBTLFileName = sBTLFileName
|
||||||
NewProjectFileM.m_sBTLFileName = sBTLFileName
|
NewProjectFileM.m_sDescription = sDescription
|
||||||
NewProjectFileM.m_bIsNew = IsNew
|
NewProjectFileM.m_bIsNew = IsNew
|
||||||
NewProjectFileM.m_bIsLocked = IsLocked
|
NewProjectFileM.m_bIsLocked = IsLocked
|
||||||
NewProjectFileM.m_nType = nType
|
NewProjectFileM.m_nType = nType
|
||||||
NewProjectFileM.m_sMachine = sMachine
|
NewProjectFileM.m_sMachine = sMachine
|
||||||
Return NewProjectFileM
|
Return NewProjectFileM
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
#End Region ' CONSTRUCTORS
|
#End Region ' CONSTRUCTORS
|
||||||
|
|
||||||
|
|||||||
@@ -68,6 +68,12 @@ Public Class ProjFileVM
|
|||||||
End Get
|
End Get
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
|
Public ReadOnly Property sDescription As String
|
||||||
|
Get
|
||||||
|
Return ProjFileM.sDescription
|
||||||
|
End Get
|
||||||
|
End Property
|
||||||
|
|
||||||
Public ReadOnly Property sListName As String
|
Public ReadOnly Property sListName As String
|
||||||
Get
|
Get
|
||||||
Return ProjFileM.sListName
|
Return ProjFileM.sListName
|
||||||
|
|||||||
@@ -147,9 +147,9 @@ Public Module BTLIniFile
|
|||||||
Dim dMin As Double
|
Dim dMin As Double
|
||||||
Dim dMax As Double
|
Dim dMax As Double
|
||||||
Dim dDefault As Double
|
Dim dDefault As Double
|
||||||
StringToDouble(sBTLParamParams(2), dMin)
|
StringToDoubleAdv(sBTLParamParams(2), dMin)
|
||||||
StringToDouble(sBTLParamParams(3), dMax)
|
StringToDoubleAdv(sBTLParamParams(3), dMax)
|
||||||
StringToDouble(sBTLParamParams(4), dDefault)
|
StringToDoubleAdv(sBTLParamParams(4), dDefault)
|
||||||
Dim ParamType As BTLParamType
|
Dim ParamType As BTLParamType
|
||||||
If sBTLParamParams(0) = "d" Then
|
If sBTLParamParams(0) = "d" Then
|
||||||
ParamType = BTLParamType.DOUBLE_
|
ParamType = BTLParamType.DOUBLE_
|
||||||
@@ -159,7 +159,7 @@ Public Module BTLIniFile
|
|||||||
IpBTLParam = BTLParamM.CreateBTLParam(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)
|
Return Not IsNothing(IpBTLParam)
|
||||||
ElseIf sBTLParamParams(0) = "s" Then
|
ElseIf sBTLParamParams(0) = "s" Then
|
||||||
IpBTLParam = BTLParamM.CreateBTLParam(IpParentFeature, IsP, BTLParamType.STRING_, sBTLParamParams(1), sBTLParamParams(5))
|
IpBTLParam = BTLParamM.CreateBTLParam(IpParentFeature, IsP, BTLParamType.STRING_, sBTLParamParams(1), sBTLParamParams(4), sBTLParamParams(5))
|
||||||
Return Not IsNothing(IpBTLParam)
|
Return Not IsNothing(IpBTLParam)
|
||||||
ElseIf sBTLParamParams(0) = "c" Then
|
ElseIf sBTLParamParams(0) = "c" Then
|
||||||
Dim nMin As Integer
|
Dim nMin As Integer
|
||||||
@@ -200,9 +200,9 @@ Public Module BTLIniFile
|
|||||||
Dim dMin As Double
|
Dim dMin As Double
|
||||||
Dim dMax As Double
|
Dim dMax As Double
|
||||||
Dim dDefault As Double
|
Dim dDefault As Double
|
||||||
StringToDouble(sBTLParamParams(2), dMin)
|
StringToDoubleAdv(sBTLParamParams(2), dMin)
|
||||||
StringToDouble(sBTLParamParams(3), dMax)
|
StringToDoubleAdv(sBTLParamParams(3), dMax)
|
||||||
StringToDouble(sBTLParamParams(4), dDefault)
|
StringToDoubleAdv(sBTLParamParams(4), dDefault)
|
||||||
Dim ParamType As BTLParamType
|
Dim ParamType As BTLParamType
|
||||||
If sBTLParamParams(0) = "d" Then
|
If sBTLParamParams(0) = "d" Then
|
||||||
ParamType = BTLParamType.DOUBLE_
|
ParamType = BTLParamType.DOUBLE_
|
||||||
@@ -212,7 +212,7 @@ Public Module BTLIniFile
|
|||||||
IpBTLParam = BTLParamM.CreateBTLParam(IpParentFeature, IsP, ParamType, sBTLParamParams(1), dMin, dMax, dDefault, sBTLParamParams(5), sBWQParam)
|
IpBTLParam = BTLParamM.CreateBTLParam(IpParentFeature, IsP, ParamType, sBTLParamParams(1), dMin, dMax, dDefault, sBTLParamParams(5), sBWQParam)
|
||||||
Return Not IsNothing(IpBTLParam)
|
Return Not IsNothing(IpBTLParam)
|
||||||
ElseIf sBTLParamParams(0) = "s" Then
|
ElseIf sBTLParamParams(0) = "s" Then
|
||||||
IpBTLParam = BTLParamM.CreateBTLParam(IpParentFeature, IsP, BTLParamType.STRING_, sBTLParamParams(1), sBTLParamParams(5), sBWQParam)
|
IpBTLParam = BTLParamM.CreateBTLParam(IpParentFeature, IsP, BTLParamType.STRING_, sBTLParamParams(1), sBTLParamParams(4), sBTLParamParams(5), sBWQParam)
|
||||||
Return Not IsNothing(IpBTLParam)
|
Return Not IsNothing(IpBTLParam)
|
||||||
ElseIf sBTLParamParams(0) = "c" Then
|
ElseIf sBTLParamParams(0) = "c" Then
|
||||||
Dim nMin As Integer
|
Dim nMin As Integer
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ Public Module DimensionsIniFile
|
|||||||
Dim GridLenType As GridUnitType
|
Dim GridLenType As GridUnitType
|
||||||
Integer.TryParse(sValueParams(0), nDimIndex)
|
Integer.TryParse(sValueParams(0), nDimIndex)
|
||||||
Integer.TryParse(sValueParams(1), nDimType)
|
Integer.TryParse(sValueParams(1), nDimType)
|
||||||
StringToDouble(sValueParams(2), GridLenValue)
|
StringToDoubleAdv(sValueParams(2), GridLenValue)
|
||||||
Integer.TryParse(sValueParams(3), GridLenType)
|
Integer.TryParse(sValueParams(3), GridLenType)
|
||||||
GridDimsList.Add(New GridDimension(GridName, nDimIndex, nDimType, New GridLength(GridLenValue, GridLenType)))
|
GridDimsList.Add(New GridDimension(GridName, nDimIndex, nDimType, New GridLength(GridLenValue, GridLenType)))
|
||||||
End If
|
End If
|
||||||
|
|||||||
@@ -1,45 +1,49 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<configuration>
|
<configuration>
|
||||||
<configSections>
|
<configSections>
|
||||||
<!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
|
<!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
|
||||||
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
|
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
|
||||||
</configSections>
|
</configSections>
|
||||||
<entityFramework>
|
<entityFramework>
|
||||||
<defaultConnectionFactory type="MySql.Data.Entity.MySqlConnectionFactory, MySql.Data.Entity.EF6" />
|
<!--<defaultConnectionFactory type="MySql.Data.Entity.MySqlConnectionFactory, MySql.Data.EntityFramework" />-->
|
||||||
<providers>
|
<defaultConnectionFactory type="System.Data.Entity.Infrastructure.SqlConnectionFactory, EntityFramework"/>
|
||||||
<provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />
|
<providers>
|
||||||
|
<provider invariantName="MySql.Data.MySqlClient" type="MySql.Data.MySqlClient.MySqlProviderServices, MySql.Data.EntityFramework, Version=8.0.21.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d">
|
||||||
<provider invariantName="MySql.Data.MySqlClient" type="MySql.Data.MySqlClient.MySqlProviderServices, MySql.Data.EntityFramework, Version=8.0.21.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d">
|
</provider>
|
||||||
</provider></providers>
|
</providers>
|
||||||
</entityFramework>
|
</entityFramework>
|
||||||
<connectionStrings>
|
<connectionStrings>
|
||||||
<add name="DefaultConnection" connectionString="server=localhost;port=3306;User Id=steamware;password=Egalware_24068!;Persist Security Info=True;database=EgtBwDb_000470;SslMode=none" providerName="MySql.Data.MySqlClient" />
|
<add name="DefaultConnection" connectionString="server=localhost;port=3306;User Id=steamware;password=Egalware_24068!;Persist Security Info=True;database=EgtBwDb_000470;SslMode=none" providerName="MySql.Data.MySqlClient" />
|
||||||
</connectionStrings>
|
</connectionStrings>
|
||||||
<runtime>
|
<runtime>
|
||||||
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
|
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
|
||||||
<dependentAssembly>
|
<dependentAssembly>
|
||||||
<assemblyIdentity name="MySql.Data" publicKeyToken="c5687fc88969c44d" culture="neutral" />
|
<assemblyIdentity name="MySql.Data" publicKeyToken="c5687fc88969c44d" culture="neutral" />
|
||||||
<bindingRedirect oldVersion="0.0.0.0-8.0.29.0" newVersion="8.0.29.0" />
|
<bindingRedirect oldVersion="0.0.0.0-8.0.21.0" newVersion="8.0.21.0" />
|
||||||
</dependentAssembly>
|
</dependentAssembly>
|
||||||
<dependentAssembly>
|
<dependentAssembly>
|
||||||
<assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
|
<assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
|
||||||
<bindingRedirect oldVersion="0.0.0.0-5.0.0.0" newVersion="5.0.0.0" />
|
<bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
|
||||||
</dependentAssembly>
|
</dependentAssembly>
|
||||||
<dependentAssembly>
|
<dependentAssembly>
|
||||||
<assemblyIdentity name="Google.Protobuf" publicKeyToken="a7d26565bac4d604" culture="neutral" />
|
<assemblyIdentity name="Google.Protobuf" publicKeyToken="a7d26565bac4d604" culture="neutral" />
|
||||||
<bindingRedirect oldVersion="0.0.0.0-3.19.4.0" newVersion="3.19.4.0" />
|
<bindingRedirect oldVersion="0.0.0.0-3.21.9.0" newVersion="3.21.9.0" />
|
||||||
</dependentAssembly>
|
</dependentAssembly>
|
||||||
<dependentAssembly>
|
<dependentAssembly>
|
||||||
<assemblyIdentity name="K4os.Compression.LZ4.Streams" publicKeyToken="2186fa9121ef231d" culture="neutral" />
|
<assemblyIdentity name="K4os.Compression.LZ4.Streams" publicKeyToken="2186fa9121ef231d" culture="neutral" />
|
||||||
<bindingRedirect oldVersion="0.0.0.0-1.2.6.0" newVersion="1.2.6.0" />
|
<bindingRedirect oldVersion="0.0.0.0-1.3.5.0" newVersion="1.3.5.0" />
|
||||||
</dependentAssembly>
|
</dependentAssembly>
|
||||||
<dependentAssembly>
|
<dependentAssembly>
|
||||||
<assemblyIdentity name="BouncyCastle.Crypto" publicKeyToken="0e99375e54769942" culture="neutral" />
|
<assemblyIdentity name="BouncyCastle.Crypto" publicKeyToken="0e99375e54769942" culture="neutral" />
|
||||||
<bindingRedirect oldVersion="0.0.0.0-1.8.5.0" newVersion="1.8.5.0" />
|
<bindingRedirect oldVersion="0.0.0.0-1.9.0.0" newVersion="1.9.0.0" />
|
||||||
</dependentAssembly>
|
</dependentAssembly>
|
||||||
</assemblyBinding>
|
<dependentAssembly>
|
||||||
</runtime>
|
<assemblyIdentity name="System.Memory" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
|
||||||
<startup>
|
<bindingRedirect oldVersion="0.0.0.0-4.0.1.2" newVersion="4.0.1.2" />
|
||||||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" />
|
</dependentAssembly>
|
||||||
</startup>
|
</assemblyBinding>
|
||||||
|
</runtime>
|
||||||
|
<startup>
|
||||||
|
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" />
|
||||||
|
</startup>
|
||||||
</configuration>
|
</configuration>
|
||||||
@@ -24,7 +24,7 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
|||||||
/// <param name="corePart"></param>
|
/// <param name="corePart"></param>
|
||||||
/// <param name="currProjDbId"></param>
|
/// <param name="currProjDbId"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public static BTLPartModel ConvertFromCore(Core.BTLPartM corePart, int currProjDbId)
|
public BTLPartModel ConvertFromCore(Core.BTLPartM corePart, int currProjDbId)
|
||||||
{
|
{
|
||||||
BTLPartModel answ = new BTLPartModel();
|
BTLPartModel answ = new BTLPartModel();
|
||||||
if (corePart != null)
|
if (corePart != null)
|
||||||
|
|||||||
@@ -22,6 +22,8 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
|||||||
{
|
{
|
||||||
// Initialize database context for ADMIN
|
// Initialize database context for ADMIN
|
||||||
adbCtx = new AdminContext(DbConfig.ADMIN_CONNECTION_STRING);
|
adbCtx = new AdminContext(DbConfig.ADMIN_CONNECTION_STRING);
|
||||||
|
// DB standard utente
|
||||||
|
dbCtx = new AdminContext(DbConfig.CONNECTION_STRING);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion Public Constructors
|
#endregion Public Constructors
|
||||||
@@ -39,33 +41,10 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
|||||||
{
|
{
|
||||||
bool answ = false;
|
bool answ = false;
|
||||||
string domain = isNetwork ? "%" : "localhost";
|
string domain = isNetwork ? "%" : "localhost";
|
||||||
// ricerca utente...
|
answ = doCheckCreate(username, pwd, answ, domain, false);
|
||||||
var numUser = adbCtx
|
if (answ)
|
||||||
.UserList
|
|
||||||
.Where(x => x.User == username)
|
|
||||||
.ToList()
|
|
||||||
.Count;
|
|
||||||
if (numUser > 0)
|
|
||||||
{
|
{
|
||||||
answ = true;
|
doGrantPriv(username, domain, "ALL ON *.*");
|
||||||
}
|
|
||||||
if (!answ)
|
|
||||||
{
|
|
||||||
// creo utente
|
|
||||||
string sqlCommand = "FLUSH PRIVILEGES;";
|
|
||||||
//string sqlCommand = $"CREATE USER '{username}'@'{domain}' IDENTIFIED BY '{pwd}'; GRANT ALL ON *.* TO '{username}'@'localhost'; FLUSH PRIVILEGES;";
|
|
||||||
//string sqlCommand = $"CREATE USER '{username}'@'{domain}' IDENTIFIED BY '{pwd}'; GRANT ALL ON *.* TO '{username}'@'localhost'; FLUSH PRIVILEGES;";
|
|
||||||
adbCtx.Database.ExecuteSqlCommand(System.Data.Entity.TransactionalBehavior.DoNotEnsureTransaction, sqlCommand);
|
|
||||||
Thread.Sleep(100);
|
|
||||||
sqlCommand = $"CREATE USER '{username}'@'{domain}' IDENTIFIED BY '{pwd}';";
|
|
||||||
adbCtx.Database.ExecuteSqlCommand(System.Data.Entity.TransactionalBehavior.DoNotEnsureTransaction, sqlCommand);
|
|
||||||
Thread.Sleep(100);
|
|
||||||
sqlCommand = $"GRANT ALL ON *.* TO '{username}'@'{domain}';";
|
|
||||||
adbCtx.Database.ExecuteSqlCommand(System.Data.Entity.TransactionalBehavior.DoNotEnsureTransaction, sqlCommand);
|
|
||||||
Thread.Sleep(100);
|
|
||||||
sqlCommand = "FLUSH PRIVILEGES;";
|
|
||||||
adbCtx.Database.ExecuteSqlCommand(System.Data.Entity.TransactionalBehavior.DoNotEnsureTransaction, sqlCommand);
|
|
||||||
Thread.Sleep(100);
|
|
||||||
}
|
}
|
||||||
return answ;
|
return answ;
|
||||||
}
|
}
|
||||||
@@ -85,6 +64,51 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
|||||||
adbCtx.Dispose();
|
adbCtx.Dispose();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Verifica esistenza views + utente relativo eventualmente ricreandole + fornendo accesso
|
||||||
|
/// all'utente ReadOnly Essetre
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="dbName"></param>
|
||||||
|
/// <param name="username"></param>
|
||||||
|
/// <param name="pwd"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public bool refreshViews(string dbName, string username = "S3_User", string pwd = "S3_P4ssw0rd")
|
||||||
|
{
|
||||||
|
bool answ = false;
|
||||||
|
|
||||||
|
// in primis refresh delle view
|
||||||
|
string sqlCommand = @"CREATE OR REPLACE VIEW v_expProdRaw AS
|
||||||
|
SELECT DbId, AlarmDtEvent AS DtEvent, VarValue,
|
||||||
|
SUBSTRING_INDEX(VarValue, ';', 1) AS Prod,
|
||||||
|
SUBSTRING_INDEX(SUBSTRING_INDEX(VarValue, ';', 2), ';', -1) AS MachGroupId,
|
||||||
|
SUBSTRING_INDEX(SUBSTRING_INDEX(VarValue, ';', -2), ';', 1) AS PartId,
|
||||||
|
SUBSTRING_INDEX(VarValue, ';', -1) AS Status
|
||||||
|
FROM logmachine
|
||||||
|
WHERE ResultType = 1
|
||||||
|
AND VarAddress = 1;
|
||||||
|
|
||||||
|
CREATE OR REPLACE VIEW v_expProd AS
|
||||||
|
SELECT vp.DtEvent, vp.Prod, mgl.Name AS mgName, pl.PDN, vp.`Status`
|
||||||
|
FROM v_expProdRaw AS vp
|
||||||
|
INNER JOIN MachGroupList mgl ON vp.MachGroupId = mgl.Id
|
||||||
|
INNER JOIN partlist pl ON vp.PartId = pl.Id;";
|
||||||
|
dbCtx.Database.ExecuteSqlCommand(System.Data.Entity.TransactionalBehavior.DoNotEnsureTransaction, sqlCommand);
|
||||||
|
Thread.Sleep(100);
|
||||||
|
|
||||||
|
// ora setup parametri x utente
|
||||||
|
string domain = "%";
|
||||||
|
|
||||||
|
// ora controllo utente con diritti
|
||||||
|
answ = doCheckCreate(username, pwd, answ, domain, true);
|
||||||
|
if (answ)
|
||||||
|
{
|
||||||
|
doGrantPriv(username, domain, "USAGE ON *.*");
|
||||||
|
doGrantPriv(username, domain, $"SELECT ON {dbName}.v_expProd");
|
||||||
|
}
|
||||||
|
|
||||||
|
return answ;
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// ATTENZIONE!!!! Procedura di Reset del DB
|
/// ATTENZIONE!!!! Procedura di Reset del DB
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -117,6 +141,7 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
|||||||
#region Private Fields
|
#region Private Fields
|
||||||
|
|
||||||
private AdminContext adbCtx;
|
private AdminContext adbCtx;
|
||||||
|
private AdminContext dbCtx;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Istanza logger
|
/// Istanza logger
|
||||||
@@ -124,5 +149,79 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
|||||||
private NLog.Logger Log = LogManager.GetCurrentClassLogger();
|
private NLog.Logger Log = LogManager.GetCurrentClassLogger();
|
||||||
|
|
||||||
#endregion Private Fields
|
#endregion Private Fields
|
||||||
|
|
||||||
|
#region Private Methods
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Procedura interna effettiva di check utente ed eventuale creazione + grant level
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="username"></param>
|
||||||
|
/// <param name="pwd"></param>
|
||||||
|
/// <param name="answ"></param>
|
||||||
|
/// <param name="domain"></param>
|
||||||
|
/// <param name="force">Force = esegue un drop prima...</param>
|
||||||
|
/// <returns></returns>
|
||||||
|
private bool doCheckCreate(string username, string pwd, bool answ, string domain, bool force)
|
||||||
|
{
|
||||||
|
// ricerca utente...
|
||||||
|
var numUser = adbCtx
|
||||||
|
.UserList
|
||||||
|
.Where(x => x.User == username)
|
||||||
|
.ToList()
|
||||||
|
.Count;
|
||||||
|
if (numUser > 0)
|
||||||
|
{
|
||||||
|
answ = true;
|
||||||
|
}
|
||||||
|
if (!answ)
|
||||||
|
{
|
||||||
|
// creo utente
|
||||||
|
string sqlCommand = $"DROP USER IF EXISTS {username};";
|
||||||
|
if (force)
|
||||||
|
{
|
||||||
|
adbCtx.Database.ExecuteSqlCommand(System.Data.Entity.TransactionalBehavior.DoNotEnsureTransaction, sqlCommand);
|
||||||
|
Thread.Sleep(100);
|
||||||
|
}
|
||||||
|
sqlCommand = "FLUSH PRIVILEGES;";
|
||||||
|
adbCtx.Database.ExecuteSqlCommand(System.Data.Entity.TransactionalBehavior.DoNotEnsureTransaction, sqlCommand);
|
||||||
|
Thread.Sleep(100);
|
||||||
|
sqlCommand = $"CREATE USER '{username}'@'{domain}' IDENTIFIED BY '{pwd}';";
|
||||||
|
adbCtx.Database.ExecuteSqlCommand(System.Data.Entity.TransactionalBehavior.DoNotEnsureTransaction, sqlCommand);
|
||||||
|
Thread.Sleep(100);
|
||||||
|
sqlCommand = "FLUSH PRIVILEGES;";
|
||||||
|
adbCtx.Database.ExecuteSqlCommand(System.Data.Entity.TransactionalBehavior.DoNotEnsureTransaction, sqlCommand);
|
||||||
|
Thread.Sleep(100);
|
||||||
|
answ = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return answ;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Procedura interna effettiva di grant level x utente
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="username"></param>
|
||||||
|
/// <param name="domain"></param>
|
||||||
|
/// <param name="grantLevel"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
private bool doGrantPriv(string username, string domain, string grantLevel)
|
||||||
|
{
|
||||||
|
bool answ = false;
|
||||||
|
|
||||||
|
string sqlCommand = "FLUSH PRIVILEGES;";
|
||||||
|
adbCtx.Database.ExecuteSqlCommand(System.Data.Entity.TransactionalBehavior.DoNotEnsureTransaction, sqlCommand);
|
||||||
|
Thread.Sleep(100);
|
||||||
|
sqlCommand = $"GRANT {grantLevel} TO '{username}'@'{domain}';";
|
||||||
|
adbCtx.Database.ExecuteSqlCommand(System.Data.Entity.TransactionalBehavior.DoNotEnsureTransaction, sqlCommand);
|
||||||
|
Thread.Sleep(100);
|
||||||
|
sqlCommand = "FLUSH PRIVILEGES;";
|
||||||
|
adbCtx.Database.ExecuteSqlCommand(System.Data.Entity.TransactionalBehavior.DoNotEnsureTransaction, sqlCommand);
|
||||||
|
Thread.Sleep(100);
|
||||||
|
answ = true;
|
||||||
|
|
||||||
|
return answ;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion Private Methods
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -23,7 +23,7 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="coreMacLog"></param>
|
/// <param name="coreMacLog"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public static LogMachineModel ConvertFromCore(Core.MachLog coreMacLog)
|
public LogMachineModel ConvertFromCore(Core.MachLog coreMacLog)
|
||||||
{
|
{
|
||||||
LogMachineModel answ = new LogMachineModel();
|
LogMachineModel answ = new LogMachineModel();
|
||||||
if (coreMacLog != null)
|
if (coreMacLog != null)
|
||||||
@@ -53,7 +53,7 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="dbLog"></param>
|
/// <param name="dbLog"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public static Core.MachLog ConvertToCore(LogMachineModel dbLog)
|
public Core.MachLog ConvertToCore(LogMachineModel dbLog)
|
||||||
{
|
{
|
||||||
var newRecord = Core.MachLog.CreateMachLog(dbLog.AlarmCode, dbLog.AlarmDatetime, dbLog.AlarmMessage, dbLog.AlarmOperation, dbLog.AlarmType, dbLog.CommandExecutedCorrectly, dbLog.CommandState, dbLog.CommandType, dbLog.Description, dbLog.NewOpState, dbLog.ResultType, dbLog.VarAddress, dbLog.VarValue);
|
var newRecord = Core.MachLog.CreateMachLog(dbLog.AlarmCode, dbLog.AlarmDatetime, dbLog.AlarmMessage, dbLog.AlarmOperation, dbLog.AlarmType, dbLog.CommandExecutedCorrectly, dbLog.CommandState, dbLog.CommandType, dbLog.Description, dbLog.NewOpState, dbLog.ResultType, dbLog.VarAddress, dbLog.VarValue);
|
||||||
return newRecord;
|
return newRecord;
|
||||||
|
|||||||
@@ -8,12 +8,6 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
|||||||
{
|
{
|
||||||
public class MachGroupController : IDisposable
|
public class MachGroupController : IDisposable
|
||||||
{
|
{
|
||||||
#region Public Fields
|
|
||||||
|
|
||||||
public static MachGroupController man = new MachGroupController();
|
|
||||||
|
|
||||||
#endregion Public Fields
|
|
||||||
|
|
||||||
#region Public Constructors
|
#region Public Constructors
|
||||||
|
|
||||||
public MachGroupController()
|
public MachGroupController()
|
||||||
@@ -30,7 +24,7 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
|||||||
/// <param name="coreMachGroup"></param>
|
/// <param name="coreMachGroup"></param>
|
||||||
/// <param name="currProdDbId"></param>
|
/// <param name="currProdDbId"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public static MachGroupModel ConvertFromCore(Core.MyMachGroupM coreMachGroup, int currProdDbId)
|
public MachGroupModel ConvertFromCore(Core.MyMachGroupM coreMachGroup, int currProdDbId)
|
||||||
{
|
{
|
||||||
MachGroupModel answ = new MachGroupModel();
|
MachGroupModel answ = new MachGroupModel();
|
||||||
if (coreMachGroup != null)
|
if (coreMachGroup != null)
|
||||||
@@ -63,6 +57,8 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
|||||||
{
|
{
|
||||||
ProdModel currData = new ProdModel();
|
ProdModel currData = new ProdModel();
|
||||||
List<PartModel> PartList2Add = new List<PartModel>();
|
List<PartModel> PartList2Add = new List<PartModel>();
|
||||||
|
var myPartCtrl = new PartController();
|
||||||
|
var myStatusMapCtrl = new StatusMapController();
|
||||||
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
||||||
{
|
{
|
||||||
// Recupero il PROD nel contesto
|
// Recupero il PROD nel contesto
|
||||||
@@ -72,7 +68,8 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
|||||||
.SingleOrDefault();
|
.SingleOrDefault();
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
var convCurrMG = MachGroupController.ConvertFromCore(newMachGroup, currData.ProdDbId);
|
var locMGCtrl = new MachGroupController();
|
||||||
|
var convCurrMG = locMGCtrl.ConvertFromCore(newMachGroup, currData.ProdDbId);
|
||||||
|
|
||||||
convCurrMG.ProdIndex = 1;
|
convCurrMG.ProdIndex = 1;
|
||||||
|
|
||||||
@@ -81,15 +78,25 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
|||||||
// Commit changes
|
// Commit changes
|
||||||
localDbCtx.SaveChanges();
|
localDbCtx.SaveChanges();
|
||||||
|
|
||||||
int MachGroupDbId = MachGroupController.man.FindByMachGroupId(ProdId, newMachGroup.Id).MachGroupDbId;
|
int MachGroupDbId = FindByMachGroupId(ProdId, newMachGroup.Id).MachGroupDbId;
|
||||||
|
// 2023.05.10 leggo elenco part in una sola volta
|
||||||
|
|
||||||
|
var currMgPartList = localDbCtx
|
||||||
|
.PartList
|
||||||
|
.Where(x => x.MachGroup.Prod.ProdId == ProdId && x.MachGroup.MachGroupId == newMachGroup.Id)
|
||||||
|
.ToList();
|
||||||
// verifico se uguali o meno...
|
// verifico se uguali o meno...
|
||||||
foreach (var currPartM in newMachGroup.PartMList)
|
foreach (var currPartM in newMachGroup.PartMList)
|
||||||
{
|
{
|
||||||
var currPart = localDbCtx
|
//var currPart = localDbCtx
|
||||||
.PartList
|
// .PartList
|
||||||
.Where(x => x.MachGroup.Prod.ProdId == ProdId && x.MachGroup.MachGroupId == newMachGroup.Id && x.PartId == currPartM.nPartId)
|
// .Where(x => x.MachGroup.Prod.ProdId == ProdId && x.MachGroup.MachGroupId == newMachGroup.Id && x.PartId == currPartM.nPartId)
|
||||||
|
// .SingleOrDefault();
|
||||||
|
var currPart = currMgPartList
|
||||||
|
.Where(x => x.PartId == currPartM.nPartId)
|
||||||
.SingleOrDefault();
|
.SingleOrDefault();
|
||||||
var convCurrPartM = PartController.ConvertFromCore(currPartM, MachGroupDbId);
|
|
||||||
|
var convCurrPartM = myPartCtrl.ConvertFromCore(currPartM, MachGroupDbId);
|
||||||
if (currPart != null)
|
if (currPart != null)
|
||||||
{
|
{
|
||||||
// se non identico x equality limitata a ViewOptim...
|
// se non identico x equality limitata a ViewOptim...
|
||||||
@@ -125,7 +132,7 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
|||||||
// Commit changes
|
// Commit changes
|
||||||
localDbCtx.SaveChanges();
|
localDbCtx.SaveChanges();
|
||||||
// aggiorno info sullo status
|
// aggiorno info sullo status
|
||||||
StatusMapController.man.UpdateAction("", ProdId, newMachGroup.Id, Core.StatusMapItemType.MachGroup, Core.StatusMapOpType.MachGroupAdd, "");
|
myStatusMapCtrl.UpdateAction("", ProdId, newMachGroup.Id, Core.StatusMapItemType.MachGroup, Core.StatusMapOpType.MachGroupAdd, "");
|
||||||
}
|
}
|
||||||
catch (Exception exc)
|
catch (Exception exc)
|
||||||
{
|
{
|
||||||
@@ -177,6 +184,7 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
|||||||
bool done = false;
|
bool done = false;
|
||||||
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
||||||
{
|
{
|
||||||
|
var myStatusMapCtrl = new StatusMapController();
|
||||||
// inizio eliminando le part
|
// inizio eliminando le part
|
||||||
var parts2del = localDbCtx
|
var parts2del = localDbCtx
|
||||||
.PartList
|
.PartList
|
||||||
@@ -197,7 +205,7 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
|||||||
localDbCtx.SaveChanges();
|
localDbCtx.SaveChanges();
|
||||||
|
|
||||||
// registro modifica StatusMap
|
// registro modifica StatusMap
|
||||||
StatusMapController.man.UpdateAction(MG2Del.SupervisorId, ProdId, MG2Del.MachGroupId, Core.StatusMapItemType.MachGroup, Core.StatusMapOpType.MachGroupRem, "");
|
myStatusMapCtrl.UpdateAction(MG2Del.SupervisorId, ProdId, MG2Del.MachGroupId, Core.StatusMapItemType.MachGroup, Core.StatusMapOpType.MachGroupRem, "");
|
||||||
|
|
||||||
done = true;
|
done = true;
|
||||||
}
|
}
|
||||||
@@ -209,7 +217,7 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
|||||||
}
|
}
|
||||||
|
|
||||||
// se fatto aggiorno info sullo status
|
// se fatto aggiorno info sullo status
|
||||||
StatusMapController.man.UpdateAction("", ProdId, MachGroupId, Core.StatusMapItemType.MachGroup, Core.StatusMapOpType.MachGroupRem, "");
|
myStatusMapCtrl.UpdateAction("", ProdId, MachGroupId, Core.StatusMapItemType.MachGroup, Core.StatusMapOpType.MachGroupRem, "");
|
||||||
}
|
}
|
||||||
return done;
|
return done;
|
||||||
}
|
}
|
||||||
@@ -393,6 +401,7 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
|||||||
bool done = false;
|
bool done = false;
|
||||||
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
||||||
{
|
{
|
||||||
|
var myStatusMapCtrl = new StatusMapController();
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
// aggiorno
|
// aggiorno
|
||||||
@@ -405,13 +414,19 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
|||||||
currRecord.State = Core.ItemState.ND;
|
currRecord.State = Core.ItemState.ND;
|
||||||
currRecord.SupervisorId = "";
|
currRecord.SupervisorId = "";
|
||||||
currRecord.ProdIndex = 0;
|
currRecord.ProdIndex = 0;
|
||||||
}
|
// Commit changes
|
||||||
// Commit changes
|
localDbCtx.SaveChanges();
|
||||||
localDbCtx.SaveChanges();
|
// aggiorno info sullo status
|
||||||
// aggiorno info sullo status
|
myStatusMapCtrl.UpdateAction("", ProdId, MachGroupId, Core.StatusMapItemType.MachGroup, Core.StatusMapOpType.MachGroupRemovedFromSupervisor, "");
|
||||||
StatusMapController.man.UpdateAction("", ProdId, MachGroupId, Core.StatusMapItemType.MachGroup, Core.StatusMapOpType.MachGroupRemovedFromSupervisor, "");
|
|
||||||
|
|
||||||
done = true;
|
done = true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
string errMessage = $"ERROR on MachGroup.RemoveFromSupervisor: req item was not found | ProdId {ProdId} | MachGroupId {MachGroupId}";
|
||||||
|
Console.WriteLine(errMessage);
|
||||||
|
Log.Error(errMessage);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
catch (Exception exc)
|
catch (Exception exc)
|
||||||
{
|
{
|
||||||
@@ -435,23 +450,33 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
|||||||
bool done = false;
|
bool done = false;
|
||||||
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
||||||
{
|
{
|
||||||
|
var myStatusMapCtrl = new StatusMapController();
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
// aggiorno
|
// aggiorno
|
||||||
localDbCtx
|
var item2upd = localDbCtx
|
||||||
.MachGroupList
|
.MachGroupList
|
||||||
.Where(x => x.Prod.ProdId == ProdId && x.MachGroupId == MachGroupId)
|
.Where(x => x.Prod.ProdId == ProdId && x.MachGroupId == MachGroupId)
|
||||||
.FirstOrDefault()
|
.FirstOrDefault();
|
||||||
.State = newState;
|
if (item2upd != null)
|
||||||
// Commit changes
|
{
|
||||||
localDbCtx.SaveChanges();
|
item2upd.State = newState;
|
||||||
done = true;
|
// Commit changes
|
||||||
// aggiorno info sullo status
|
localDbCtx.SaveChanges();
|
||||||
StatusMapController.man.UpdateAction("", ProdId, MachGroupId, Core.StatusMapItemType.MachGroup, Core.StatusMapOpType.MachGroupNeedRedo, Value);
|
done = true;
|
||||||
|
// aggiorno info sullo status
|
||||||
|
myStatusMapCtrl.UpdateAction("", ProdId, MachGroupId, Core.StatusMapItemType.MachGroup, Core.StatusMapOpType.MachGroupNeedRedo, Value);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
string errMessage = $"ERROR on MachGroup.SetNeedRedo: req item was not found | ProdId {ProdId} | MachGroupId {MachGroupId} | newState {newState} | Value {Value}";
|
||||||
|
Console.WriteLine(errMessage);
|
||||||
|
Log.Error(errMessage);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
catch (Exception exc)
|
catch (Exception exc)
|
||||||
{
|
{
|
||||||
string errMessage = $"EXCEPTION on MachGroup.UpdateStatus: {Environment.NewLine}{exc}";
|
string errMessage = $"EXCEPTION on MachGroup.SetNeedRedo: {Environment.NewLine}{exc}";
|
||||||
Console.WriteLine(errMessage);
|
Console.WriteLine(errMessage);
|
||||||
Log.Error(errMessage);
|
Log.Error(errMessage);
|
||||||
}
|
}
|
||||||
@@ -469,20 +494,30 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
|||||||
bool done = false;
|
bool done = false;
|
||||||
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
||||||
{
|
{
|
||||||
var item2update = localDbCtx
|
var myStatusMapCtrl = new StatusMapController();
|
||||||
.MachGroupList
|
|
||||||
.Where(x => x.MachGroupDbId == updItem.MachGroupDbId)
|
|
||||||
.SingleOrDefault();
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
// update, vers 1...
|
var item2update = localDbCtx
|
||||||
localDbCtx.Entry(item2update).CurrentValues.SetValues(updItem);
|
.MachGroupList
|
||||||
|
.Where(x => x.MachGroupDbId == updItem.MachGroupDbId)
|
||||||
|
.SingleOrDefault();
|
||||||
|
if (item2update != null)
|
||||||
|
{
|
||||||
|
// update, vers 1...
|
||||||
|
localDbCtx.Entry(item2update).CurrentValues.SetValues(updItem);
|
||||||
|
|
||||||
// Commit changes
|
// Commit changes
|
||||||
localDbCtx.SaveChanges();
|
localDbCtx.SaveChanges();
|
||||||
done = true;
|
done = true;
|
||||||
// aggiorno info sullo status
|
// aggiorno info sullo status
|
||||||
StatusMapController.man.UpdateAction("", updItem.Prod.ProdId, updItem.MachGroupId, Core.StatusMapItemType.MachGroup, Core.StatusMapOpType.MachGroupMod, "");
|
myStatusMapCtrl.UpdateAction("", updItem.Prod.ProdId, updItem.MachGroupId, Core.StatusMapItemType.MachGroup, Core.StatusMapOpType.MachGroupMod, "");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
string errMessage = $"ERROR on MachGroup.Update: req item was not found | ProdDbId {updItem.ProdDbId} | MachGroupId {updItem.MachGroupId} | ProdIndex {updItem.ProdIndex}";
|
||||||
|
Console.WriteLine(errMessage);
|
||||||
|
Log.Error(errMessage);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
catch (Exception exc)
|
catch (Exception exc)
|
||||||
{
|
{
|
||||||
@@ -506,6 +541,7 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
|||||||
bool done = false;
|
bool done = false;
|
||||||
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
||||||
{
|
{
|
||||||
|
var myStatusMapCtrl = new StatusMapController();
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
// aggiorno
|
// aggiorno
|
||||||
@@ -513,15 +549,21 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
|||||||
.MachGroupList
|
.MachGroupList
|
||||||
.Where(x => x.Prod.ProdId == ProdId && x.MachGroupId == MachGroupId)
|
.Where(x => x.Prod.ProdId == ProdId && x.MachGroupId == MachGroupId)
|
||||||
.FirstOrDefault();
|
.FirstOrDefault();
|
||||||
|
if (currRecord != null)
|
||||||
currRecord.DtEnd = DtEnd;
|
{
|
||||||
|
currRecord.DtEnd = DtEnd;
|
||||||
// Commit changes
|
// Commit changes
|
||||||
localDbCtx.SaveChanges();
|
localDbCtx.SaveChanges();
|
||||||
|
done = true;
|
||||||
done = true;
|
// aggiorno info sullo status
|
||||||
// aggiorno info sullo status
|
myStatusMapCtrl.UpdateAction("", ProdId, MachGroupId, Core.StatusMapItemType.MachGroup, DtEnd == DateTime.MinValue ? Core.StatusMapOpType.ResetPartEnd : Core.StatusMapOpType.PartEnd, "");
|
||||||
StatusMapController.man.UpdateAction("", ProdId, MachGroupId, Core.StatusMapItemType.MachGroup, DtEnd == DateTime.MinValue ? Core.StatusMapOpType.ResetPartEnd : Core.StatusMapOpType.PartEnd, "");
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
string errMessage = $"ERROR on MachGroup.UpdateEnd: req item was not found | ProdId {ProdId} | MachGroupId {MachGroupId} | DtEnd {DtEnd}";
|
||||||
|
Console.WriteLine(errMessage);
|
||||||
|
Log.Error(errMessage);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
catch (Exception exc)
|
catch (Exception exc)
|
||||||
{
|
{
|
||||||
@@ -548,15 +590,23 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
// aggiorno
|
// aggiorno
|
||||||
localDbCtx
|
var item2upd = localDbCtx
|
||||||
.MachGroupList
|
.MachGroupList
|
||||||
.Where(x => x.Prod.ProdId == ProdId && x.MachGroupId == MachGroupId)
|
.Where(x => x.Prod.ProdId == ProdId && x.MachGroupId == MachGroupId)
|
||||||
.FirstOrDefault()
|
.FirstOrDefault();
|
||||||
.ProdIndex = newProdIndex;
|
if (item2upd != null)
|
||||||
// Commit changes
|
{
|
||||||
localDbCtx.SaveChanges();
|
item2upd.ProdIndex = newProdIndex;
|
||||||
|
// Commit changes
|
||||||
done = true;
|
localDbCtx.SaveChanges();
|
||||||
|
done = true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
string errMessage = $"ERROR on MachGroup.UpdateOrder: req item was not found | ProdId {ProdId} | MachGroupId {MachGroupId} | newProdIndex {newProdIndex}";
|
||||||
|
Console.WriteLine(errMessage);
|
||||||
|
Log.Error(errMessage);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
catch (Exception exc)
|
catch (Exception exc)
|
||||||
{
|
{
|
||||||
@@ -581,6 +631,7 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
|||||||
bool done = false;
|
bool done = false;
|
||||||
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
||||||
{
|
{
|
||||||
|
var myStatusMapCtrl = new StatusMapController();
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
// aggiorno
|
// aggiorno
|
||||||
@@ -588,15 +639,21 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
|||||||
.MachGroupList
|
.MachGroupList
|
||||||
.Where(x => x.Prod.ProdId == ProdId && x.MachGroupId == MachGroupId)
|
.Where(x => x.Prod.ProdId == ProdId && x.MachGroupId == MachGroupId)
|
||||||
.FirstOrDefault();
|
.FirstOrDefault();
|
||||||
|
if (currRecord != null)
|
||||||
currRecord.DtStart = DtStart;
|
{
|
||||||
|
currRecord.DtStart = DtStart;
|
||||||
// Commit changes
|
// Commit changes
|
||||||
localDbCtx.SaveChanges();
|
localDbCtx.SaveChanges();
|
||||||
|
done = true;
|
||||||
done = true;
|
// aggiorno info sullo status
|
||||||
// aggiorno info sullo status
|
myStatusMapCtrl.UpdateAction("", ProdId, MachGroupId, Core.StatusMapItemType.MachGroup, DtStart == DateTime.MinValue ? Core.StatusMapOpType.ResetPartStart : Core.StatusMapOpType.PartStart, "");
|
||||||
StatusMapController.man.UpdateAction("", ProdId, MachGroupId, Core.StatusMapItemType.MachGroup, DtStart == DateTime.MinValue ? Core.StatusMapOpType.ResetPartStart : Core.StatusMapOpType.PartStart, "");
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
string errMessage = $"ERROR on MachGroup.UpdateStart: req item was not found | ProdId {ProdId} | MachGroupId {MachGroupId} | DtStart {DtStart}";
|
||||||
|
Console.WriteLine(errMessage);
|
||||||
|
Log.Error(errMessage);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
catch (Exception exc)
|
catch (Exception exc)
|
||||||
{
|
{
|
||||||
@@ -621,6 +678,7 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
|||||||
bool done = false;
|
bool done = false;
|
||||||
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
||||||
{
|
{
|
||||||
|
var myStatusMapCtrl = new StatusMapController();
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
// aggiorno
|
// aggiorno
|
||||||
@@ -628,15 +686,22 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
|||||||
.MachGroupList
|
.MachGroupList
|
||||||
.Where(x => x.Prod.ProdId == ProdId && x.MachGroupId == MachGroupId)
|
.Where(x => x.Prod.ProdId == ProdId && x.MachGroupId == MachGroupId)
|
||||||
.FirstOrDefault();
|
.FirstOrDefault();
|
||||||
|
if (currRecord != null)
|
||||||
currRecord.DtStart = DtStart;
|
{
|
||||||
currRecord.DtEnd = DtEnd;
|
currRecord.DtStart = DtStart;
|
||||||
|
currRecord.DtEnd = DtEnd;
|
||||||
// Commit changes
|
// Commit changes
|
||||||
localDbCtx.SaveChanges();
|
localDbCtx.SaveChanges();
|
||||||
done = true;
|
done = true;
|
||||||
// aggiorno info sullo status
|
// aggiorno info sullo status
|
||||||
StatusMapController.man.UpdateAction("", ProdId, MachGroupId, Core.StatusMapItemType.MachGroup, Core.StatusMapOpType.MachGroupMod, "");
|
myStatusMapCtrl.UpdateAction("", ProdId, MachGroupId, Core.StatusMapItemType.MachGroup, Core.StatusMapOpType.MachGroupMod, "");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
string errMessage = $"ERROR on MachGroup.UpdateStartEnd: req item was not found | ProdId {ProdId} | MachGroupId {MachGroupId} | DtStart {DtStart} | DtEnd {DtEnd}";
|
||||||
|
Console.WriteLine(errMessage);
|
||||||
|
Log.Error(errMessage);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
catch (Exception exc)
|
catch (Exception exc)
|
||||||
{
|
{
|
||||||
@@ -659,20 +724,29 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
|||||||
bool done = false;
|
bool done = false;
|
||||||
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
||||||
{
|
{
|
||||||
|
var myStatusMapCtrl = new StatusMapController();
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
// aggiorno
|
// aggiorno
|
||||||
localDbCtx
|
var item2upd = localDbCtx
|
||||||
.MachGroupList
|
.MachGroupList
|
||||||
.Where(x => x.Prod.ProdId == ProdId && x.MachGroupId == MachGroupId)
|
.Where(x => x.Prod.ProdId == ProdId && x.MachGroupId == MachGroupId)
|
||||||
.FirstOrDefault()
|
.FirstOrDefault();
|
||||||
.State = newState;
|
if (item2upd != null)
|
||||||
// Commit changes
|
{
|
||||||
localDbCtx.SaveChanges();
|
item2upd.State = newState;
|
||||||
|
// Commit changes
|
||||||
done = true;
|
localDbCtx.SaveChanges();
|
||||||
// aggiorno info sullo status
|
done = true;
|
||||||
StatusMapController.man.UpdateAction("", ProdId, MachGroupId, Core.StatusMapItemType.MachGroup, Core.StatusMapOpType.MachGroupMod, "");
|
// aggiorno info sullo status
|
||||||
|
myStatusMapCtrl.UpdateAction("", ProdId, MachGroupId, Core.StatusMapItemType.MachGroup, Core.StatusMapOpType.MachGroupMod, "");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
string errMessage = $"ERROR on MachGroup.UpdateStatus: req item was not found | ProdId {ProdId} | MachGroupId {MachGroupId} | newState {newState}";
|
||||||
|
Console.WriteLine(errMessage);
|
||||||
|
Log.Error(errMessage);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
catch (Exception exc)
|
catch (Exception exc)
|
||||||
{
|
{
|
||||||
@@ -691,23 +765,32 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
|||||||
bool done = false;
|
bool done = false;
|
||||||
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
||||||
{
|
{
|
||||||
|
var myStatusMapCtrl = new StatusMapController();
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
// aggiorno
|
// aggiorno
|
||||||
var currRecord = localDbCtx
|
var item2upd = localDbCtx
|
||||||
.MachGroupList
|
.MachGroupList
|
||||||
.Where(x => x.Prod.ProdId == ProdId && x.MachGroupId == MachGroupId)
|
.Where(x => x.Prod.ProdId == ProdId && x.MachGroupId == MachGroupId)
|
||||||
.FirstOrDefault();
|
.FirstOrDefault();
|
||||||
|
if (item2upd != null)
|
||||||
|
{
|
||||||
|
item2upd.SupervisorId = SupervisorId;
|
||||||
|
item2upd.State = Core.ItemState.Assigned;
|
||||||
|
|
||||||
currRecord.SupervisorId = SupervisorId;
|
// Commit changes
|
||||||
currRecord.State = Core.ItemState.Assigned;
|
localDbCtx.SaveChanges();
|
||||||
|
done = true;
|
||||||
|
|
||||||
// Commit changes
|
// aggiorno info sullo status
|
||||||
localDbCtx.SaveChanges();
|
myStatusMapCtrl.UpdateAction("", ProdId, MachGroupId, Core.StatusMapItemType.MachGroup, Core.StatusMapOpType.MachGroupAssignedToSupervisor, "");
|
||||||
|
}
|
||||||
done = true;
|
else
|
||||||
// aggiorno info sullo status
|
{
|
||||||
StatusMapController.man.UpdateAction("", ProdId, MachGroupId, Core.StatusMapItemType.MachGroup, Core.StatusMapOpType.MachGroupAssignedToSupervisor, "");
|
string errMessage = $"ERROR on MachGroup.UpdateSupervisor: req item was not found | ProdId {ProdId} | MachGroupId {MachGroupId} | SupervisorId {SupervisorId}";
|
||||||
|
Console.WriteLine(errMessage);
|
||||||
|
Log.Error(errMessage);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
catch (Exception exc)
|
catch (Exception exc)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -7,17 +7,10 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
|||||||
{
|
{
|
||||||
public class PartController : IDisposable
|
public class PartController : IDisposable
|
||||||
{
|
{
|
||||||
#region Public Fields
|
|
||||||
|
|
||||||
public static PartController man = new PartController();
|
|
||||||
|
|
||||||
#endregion Public Fields
|
|
||||||
|
|
||||||
#region Public Constructors
|
#region Public Constructors
|
||||||
|
|
||||||
public PartController()
|
public PartController()
|
||||||
{
|
{ }
|
||||||
}
|
|
||||||
|
|
||||||
#endregion Public Constructors
|
#endregion Public Constructors
|
||||||
|
|
||||||
@@ -29,12 +22,12 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
|||||||
/// <param name="corePart"></param>
|
/// <param name="corePart"></param>
|
||||||
/// <param name="currMachGroupDbId"></param>
|
/// <param name="currMachGroupDbId"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public static PartModel ConvertFromCore(Core.PartM corePart, int currMachGroupDbId)
|
public PartModel ConvertFromCore(Core.PartM corePart, int currMachGroupDbId)
|
||||||
{
|
{
|
||||||
PartModel answ = new PartModel();
|
PartModel answ = new PartModel();
|
||||||
if (corePart != null)
|
if (corePart != null)
|
||||||
{
|
{
|
||||||
int BTLPartId = man.FindBtlPartByBPI(corePart.nProjId, corePart.nBTLPartId);
|
int BTLPartId = FindBtlPartByBPI(corePart.nProjId, corePart.nBTLPartId);
|
||||||
answ = new PartModel()
|
answ = new PartModel()
|
||||||
{
|
{
|
||||||
PartId = corePart.nPartId,
|
PartId = corePart.nPartId,
|
||||||
@@ -74,23 +67,34 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
|||||||
bool done = false;
|
bool done = false;
|
||||||
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
||||||
{
|
{
|
||||||
|
var myStatusMapCtrl = new StatusMapController();
|
||||||
var item2del = localDbCtx
|
var item2del = localDbCtx
|
||||||
.PartList
|
.PartList
|
||||||
.Where(x => x.MachGroup.Prod.ProdId == ProdId && x.MachGroup.MachGroupId == MachGroupId && x.PartId == PartId)
|
.Where(x => x.MachGroup.Prod.ProdId == ProdId && x.MachGroup.MachGroupId == MachGroupId && x.PartId == PartId)
|
||||||
.SingleOrDefault();
|
.SingleOrDefault();
|
||||||
try
|
|
||||||
|
if (item2del != null)
|
||||||
{
|
{
|
||||||
// Remove from database
|
try
|
||||||
localDbCtx.PartList.Remove(item2del);
|
{
|
||||||
// Commit changes
|
// Remove from database
|
||||||
localDbCtx.SaveChanges();
|
localDbCtx.PartList.Remove(item2del);
|
||||||
done = true;
|
// Commit changes
|
||||||
// aggiorno info sullo status
|
localDbCtx.SaveChanges();
|
||||||
StatusMapController.man.UpdateAction("", ProdId, MachGroupId, Core.StatusMapItemType.MachGroup, Core.StatusMapOpType.MachGroupMod, "");
|
done = true;
|
||||||
|
// aggiorno info sullo status
|
||||||
|
myStatusMapCtrl.UpdateAction("", ProdId, MachGroupId, Core.StatusMapItemType.MachGroup, Core.StatusMapOpType.MachGroupMod, "");
|
||||||
|
}
|
||||||
|
catch (Exception exc)
|
||||||
|
{
|
||||||
|
string errMessage = $"EXCEPTION on Part.Delete: ProdId: {ProdId} | MachGroupId: {MachGroupId} | PartId: {PartId}{Environment.NewLine}{exc}";
|
||||||
|
Console.WriteLine(errMessage);
|
||||||
|
Log.Error(errMessage);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
catch (Exception exc)
|
else
|
||||||
{
|
{
|
||||||
string errMessage = $"EXCEPTION on Part.Delete: ProdId: {ProdId} | MachGroupId: {MachGroupId} | PartId: {PartId}{Environment.NewLine}{exc}";
|
string errMessage = $"ERROR on Part.Delete (01): req item was not found | ProdId {ProdId} | MachGroupId {MachGroupId} | PartId {PartId}";
|
||||||
Console.WriteLine(errMessage);
|
Console.WriteLine(errMessage);
|
||||||
Log.Error(errMessage);
|
Log.Error(errMessage);
|
||||||
}
|
}
|
||||||
@@ -112,17 +116,27 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
|||||||
.PartList
|
.PartList
|
||||||
.Where(x => x.PartDbId == PartDbId)
|
.Where(x => x.PartDbId == PartDbId)
|
||||||
.SingleOrDefault();
|
.SingleOrDefault();
|
||||||
try
|
|
||||||
|
if (item2del != null)
|
||||||
{
|
{
|
||||||
// Add to database
|
try
|
||||||
localDbCtx.PartList.Remove(item2del);
|
{
|
||||||
// Commit changes
|
// Add to database
|
||||||
localDbCtx.SaveChanges();
|
localDbCtx.PartList.Remove(item2del);
|
||||||
done = true;
|
// Commit changes
|
||||||
|
localDbCtx.SaveChanges();
|
||||||
|
done = true;
|
||||||
|
}
|
||||||
|
catch (Exception exc)
|
||||||
|
{
|
||||||
|
string errMessage = $"EXCEPTION on Part.Delete: {Environment.NewLine}{exc}";
|
||||||
|
Console.WriteLine(errMessage);
|
||||||
|
Log.Error(errMessage);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
catch (Exception exc)
|
else
|
||||||
{
|
{
|
||||||
string errMessage = $"EXCEPTION on Part.Delete: {Environment.NewLine}{exc}";
|
string errMessage = $"ERROR on Part.Delete (02): req item was not found | PartDbId {PartDbId}";
|
||||||
Console.WriteLine(errMessage);
|
Console.WriteLine(errMessage);
|
||||||
Log.Error(errMessage);
|
Log.Error(errMessage);
|
||||||
}
|
}
|
||||||
@@ -209,28 +223,38 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
|||||||
bool done = false;
|
bool done = false;
|
||||||
using (DatabaseContext locallocalDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
using (DatabaseContext locallocalDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
||||||
{
|
{
|
||||||
var item2update = locallocalDbCtx
|
var myStatusMapCtrl = new StatusMapController();
|
||||||
|
var item2upd = locallocalDbCtx
|
||||||
.PartList
|
.PartList
|
||||||
.Where(x => x.PartDbId == updItem.PartDbId)
|
.Where(x => x.PartDbId == updItem.PartDbId)
|
||||||
.SingleOrDefault();
|
.SingleOrDefault();
|
||||||
try
|
if (item2upd != null)
|
||||||
{
|
{
|
||||||
// update, vers 1...
|
try
|
||||||
locallocalDbCtx.Entry(item2update).CurrentValues.SetValues(updItem);
|
{
|
||||||
|
// update, vers 1...
|
||||||
|
locallocalDbCtx.Entry(item2upd).CurrentValues.SetValues(updItem);
|
||||||
|
|
||||||
//// update, vers 2
|
//// update, vers 2
|
||||||
//localDbCtx.PartList.Remove(item2del);
|
//localDbCtx.PartList.Remove(item2del);
|
||||||
//localDbCtx.PartList.Add(updItem);
|
//localDbCtx.PartList.Add(updItem);
|
||||||
|
|
||||||
// Commit changes
|
// Commit changes
|
||||||
locallocalDbCtx.SaveChanges();
|
locallocalDbCtx.SaveChanges();
|
||||||
done = true;
|
done = true;
|
||||||
// aggiorno info sullo status
|
// aggiorno info sullo status
|
||||||
StatusMapController.man.UpdateAction("", updItem.MachGroup.Prod.ProdId, updItem.PartId, Core.StatusMapItemType.Part, Core.StatusMapOpType.MachGroupMod, "");
|
myStatusMapCtrl.UpdateAction("", updItem.MachGroup.Prod.ProdId, updItem.PartId, Core.StatusMapItemType.Part, Core.StatusMapOpType.MachGroupMod, "");
|
||||||
|
}
|
||||||
|
catch (Exception exc)
|
||||||
|
{
|
||||||
|
string errMessage = $"EXCEPTION on Part.Update: {Environment.NewLine}{exc}";
|
||||||
|
Console.WriteLine(errMessage);
|
||||||
|
Log.Error(errMessage);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
catch (Exception exc)
|
else
|
||||||
{
|
{
|
||||||
string errMessage = $"EXCEPTION on Part.Update: {Environment.NewLine}{exc}";
|
string errMessage = $"ERROR on Part.Update (01): req item was not found | PartId {updItem.PartId} | PartDbId {updItem.PartDbId} | BTLPartDbId {updItem.BTLPartDbId}";
|
||||||
Console.WriteLine(errMessage);
|
Console.WriteLine(errMessage);
|
||||||
Log.Error(errMessage);
|
Log.Error(errMessage);
|
||||||
}
|
}
|
||||||
@@ -249,19 +273,30 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
|||||||
bool done = false;
|
bool done = false;
|
||||||
using (DatabaseContext locallocalDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
using (DatabaseContext locallocalDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
||||||
{
|
{
|
||||||
|
var myStatusMapCtrl = new StatusMapController();
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
// aggiorno
|
// aggiorno
|
||||||
locallocalDbCtx
|
var item2upd = locallocalDbCtx
|
||||||
.PartList
|
.PartList
|
||||||
.Where(x => x.MachGroup.Prod.ProdId == ProdId && x.MachGroup.MachGroupId == MachGroupId && x.PartId == PartId)
|
.Where(x => x.MachGroup.Prod.ProdId == ProdId && x.MachGroup.MachGroupId == MachGroupId && x.PartId == PartId)
|
||||||
.FirstOrDefault()
|
.FirstOrDefault();
|
||||||
.DtEnd = DtEnd;
|
|
||||||
// Commit changes
|
if (item2upd != null)
|
||||||
locallocalDbCtx.SaveChanges();
|
{
|
||||||
done = true;
|
item2upd.DtEnd = DtEnd;
|
||||||
// aggiorno info sullo status
|
// Commit changes
|
||||||
StatusMapController.man.UpdateAction("", ProdId, PartId, Core.StatusMapItemType.Part, DtEnd == DateTime.MinValue ? Core.StatusMapOpType.ResetPartEnd : Core.StatusMapOpType.PartEnd, "");
|
locallocalDbCtx.SaveChanges();
|
||||||
|
done = true;
|
||||||
|
// aggiorno info sullo status
|
||||||
|
myStatusMapCtrl.UpdateAction("", ProdId, PartId, Core.StatusMapItemType.Part, DtEnd == DateTime.MinValue ? Core.StatusMapOpType.ResetPartEnd : Core.StatusMapOpType.PartEnd, "");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
string errMessage = $"ERROR on Part.UpdateEnd: req item was not found | ProdId {ProdId} | MachGroupId {MachGroupId} | PartId {PartId} | DtEnd {DtEnd}";
|
||||||
|
Console.WriteLine(errMessage);
|
||||||
|
Log.Error(errMessage);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
catch (Exception exc)
|
catch (Exception exc)
|
||||||
{
|
{
|
||||||
@@ -284,19 +319,29 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
|||||||
bool done = false;
|
bool done = false;
|
||||||
using (DatabaseContext locallocalDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
using (DatabaseContext locallocalDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
||||||
{
|
{
|
||||||
|
var myStatusMapCtrl = new StatusMapController();
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
// aggiorno
|
// aggiorno
|
||||||
locallocalDbCtx
|
var item2upd = locallocalDbCtx
|
||||||
.PartList
|
.PartList
|
||||||
.Where(x => x.MachGroup.Prod.ProdId == ProdId && x.MachGroup.MachGroupId == MachGroupId && x.PartId == PartId)
|
.Where(x => x.MachGroup.Prod.ProdId == ProdId && x.MachGroup.MachGroupId == MachGroupId && x.PartId == PartId)
|
||||||
.FirstOrDefault()
|
.FirstOrDefault();
|
||||||
.DtStart = DtStart;
|
if (item2upd != null)
|
||||||
// Commit changes
|
{
|
||||||
locallocalDbCtx.SaveChanges();
|
item2upd.DtStart = DtStart;
|
||||||
done = true;
|
// Commit changes
|
||||||
// aggiorno info sullo status
|
locallocalDbCtx.SaveChanges();
|
||||||
StatusMapController.man.UpdateAction("", ProdId, PartId, Core.StatusMapItemType.Part, DtStart == DateTime.MinValue ? Core.StatusMapOpType.ResetPartStart : Core.StatusMapOpType.PartStart, "");
|
done = true;
|
||||||
|
// aggiorno info sullo status
|
||||||
|
myStatusMapCtrl.UpdateAction("", ProdId, PartId, Core.StatusMapItemType.Part, DtStart == DateTime.MinValue ? Core.StatusMapOpType.ResetPartStart : Core.StatusMapOpType.PartStart, "");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
string errMessage = $"ERROR on Part.UpdateStart: req item was not found | ProdId {ProdId} | MachGroupId {MachGroupId} | PartId {PartId} | DtStart {DtStart}";
|
||||||
|
Console.WriteLine(errMessage);
|
||||||
|
Log.Error(errMessage);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
catch (Exception exc)
|
catch (Exception exc)
|
||||||
{
|
{
|
||||||
@@ -320,19 +365,29 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
|||||||
bool done = false;
|
bool done = false;
|
||||||
using (DatabaseContext locallocalDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
using (DatabaseContext locallocalDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
||||||
{
|
{
|
||||||
|
var myStatusMapCtrl = new StatusMapController();
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
// aggiorno
|
// aggiorno
|
||||||
locallocalDbCtx
|
var item2upd = locallocalDbCtx
|
||||||
.PartList
|
.PartList
|
||||||
.Where(x => x.MachGroup.Prod.ProdId == ProdId && x.MachGroup.MachGroupId == MachGroupId && x.PartId == PartId)
|
.Where(x => x.MachGroup.Prod.ProdId == ProdId && x.MachGroup.MachGroupId == MachGroupId && x.PartId == PartId)
|
||||||
.FirstOrDefault()
|
.FirstOrDefault();
|
||||||
.State = newState;
|
if (item2upd != null)
|
||||||
// Commit changes
|
{
|
||||||
locallocalDbCtx.SaveChanges();
|
item2upd.State = newState;
|
||||||
done = true;
|
// Commit changes
|
||||||
// aggiorno info sullo status
|
locallocalDbCtx.SaveChanges();
|
||||||
StatusMapController.man.UpdateAction("", ProdId, PartId, Core.StatusMapItemType.Part, newState == Core.ItemState.Scrapped ? Core.StatusMapOpType.SetPartScrapped : Core.StatusMapOpType.MachGroupMod, "");
|
done = true;
|
||||||
|
// aggiorno info sullo status
|
||||||
|
myStatusMapCtrl.UpdateAction("", ProdId, PartId, Core.StatusMapItemType.Part, newState == Core.ItemState.Scrapped ? Core.StatusMapOpType.SetPartScrapped : Core.StatusMapOpType.MachGroupMod, "");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
string errMessage = $"ERROR on Part.UpdateStart: req item was not found | ProdId {ProdId} | MachGroupId {MachGroupId} | PartId {PartId} | newState {newState}";
|
||||||
|
Console.WriteLine(errMessage);
|
||||||
|
Log.Error(errMessage);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
catch (Exception exc)
|
catch (Exception exc)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -9,17 +9,11 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
|||||||
{
|
{
|
||||||
public class ProdController : IDisposable
|
public class ProdController : IDisposable
|
||||||
{
|
{
|
||||||
#region Public Fields
|
|
||||||
|
|
||||||
public static ProdController man = new ProdController();
|
|
||||||
|
|
||||||
#endregion Public Fields
|
|
||||||
|
|
||||||
#region Public Constructors
|
#region Public Constructors
|
||||||
|
|
||||||
public ProdController()
|
public ProdController()
|
||||||
{
|
{
|
||||||
Log.Info("ProdController istance Started");
|
Log.Info("ProdController instance Started");
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion Public Constructors
|
#endregion Public Constructors
|
||||||
@@ -179,14 +173,75 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Elenco progetti
|
/// Elenco prod
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="numRecord"></param>
|
/// <param name="numRecord">Num max record da recuperare</param>
|
||||||
|
/// <param name="OnlyActive">Solo con ALMENO 1 PROJ attivo (senza cancellazione logica)</param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public List<Core.ProdFileM> GetLastDesc(int numRecord)
|
public List<Core.ProdFileM> GetLastDesc(int numRecord, bool OnlyActive)
|
||||||
{
|
{
|
||||||
List<Core.ProdFileM> result = new List<Core.ProdFileM>();
|
List<Core.ProdFileM> result = new List<Core.ProdFileM>();
|
||||||
var dbResult = GetLastDbModelDesc(numRecord);
|
//List<ProdModel> dbResult = GetLastDbModelDesc(numRecord);
|
||||||
|
List<ProdModel> dbResult = new List<ProdModel>();
|
||||||
|
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
||||||
|
{
|
||||||
|
// se numRecord = 0 --> passo tutti
|
||||||
|
if (numRecord == 0)
|
||||||
|
{
|
||||||
|
numRecord = localDbCtx.ProdList.Count();
|
||||||
|
}
|
||||||
|
// retrieve
|
||||||
|
dbResult = localDbCtx
|
||||||
|
.ProdList
|
||||||
|
// condizione join sui PROJ
|
||||||
|
.Join(localDbCtx.ProjList.Where(x=> x.IsActive || !OnlyActive),
|
||||||
|
p => p.ProdDbId,
|
||||||
|
e=> e.ProdDbId,
|
||||||
|
(p,e) => p)
|
||||||
|
.OrderByDescending(x => x.ProdId)
|
||||||
|
.Take(numRecord)
|
||||||
|
.ToList();
|
||||||
|
}
|
||||||
|
|
||||||
|
// conversione
|
||||||
|
result = dbResult.Select(x => Core.ProdFileM.CreateProdFileM(x.ProdId, ProjIdByProd(x.ProdId), x.DtCreated, x.Description, x.PType, x.Machine, x.LockedBy, x.LockDate)).ToList();
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Elenco prod
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="dtStart">Inizio periodo estrazione</param>
|
||||||
|
/// <param name="dtEnd">Fine periodo estrazione</param>
|
||||||
|
/// <param name="numRecord">Num max record da recuperare</param>
|
||||||
|
/// <param name="OnlyActive">Solo con ALMENO 1 PROJ attivo (senza cancellazione logica)</param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public List<Core.ProdFileM> GetLastDesc(DateTime dtStart, DateTime dtEnd, int numRecord, bool OnlyActive)
|
||||||
|
{
|
||||||
|
List<Core.ProdFileM> result = new List<Core.ProdFileM>();
|
||||||
|
//List<ProdModel> dbResult = GetLastDbModelDesc(numRecord);
|
||||||
|
List<ProdModel> dbResult = new List<ProdModel>();
|
||||||
|
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
||||||
|
{
|
||||||
|
// se numRecord = 0 --> passo tutti
|
||||||
|
if (numRecord == 0)
|
||||||
|
{
|
||||||
|
numRecord = localDbCtx.ProdList.Count();
|
||||||
|
}
|
||||||
|
// retrieve
|
||||||
|
dbResult = localDbCtx
|
||||||
|
.ProdList
|
||||||
|
.Where(x => x.DtCreated >= dtStart && x.DtCreated <= dtEnd)
|
||||||
|
// condizione join sui PROJ
|
||||||
|
.Join(localDbCtx.ProjList.Where(x => x.IsActive || !OnlyActive),
|
||||||
|
p => p.ProdDbId,
|
||||||
|
e => e.ProdDbId,
|
||||||
|
(p, e) => p)
|
||||||
|
.OrderByDescending(x => x.ProdId)
|
||||||
|
.Take(numRecord)
|
||||||
|
.ToList();
|
||||||
|
}
|
||||||
|
|
||||||
// conversione
|
// conversione
|
||||||
result = dbResult.Select(x => Core.ProdFileM.CreateProdFileM(x.ProdId, ProjIdByProd(x.ProdId), x.DtCreated, x.Description, x.PType, x.Machine, x.LockedBy, x.LockDate)).ToList();
|
result = dbResult.Select(x => Core.ProdFileM.CreateProdFileM(x.ProdId, ProjIdByProd(x.ProdId), x.DtCreated, x.Description, x.PType, x.Machine, x.LockedBy, x.LockDate)).ToList();
|
||||||
return result;
|
return result;
|
||||||
@@ -353,25 +408,39 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
|||||||
bool done = false;
|
bool done = false;
|
||||||
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
||||||
{
|
{
|
||||||
var item2update = localDbCtx
|
|
||||||
.ProdList
|
|
||||||
.Where(x => x.ProdDbId == updItem.ProdDbId)
|
|
||||||
.SingleOrDefault();
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
// update, vers 1...
|
var item2update = localDbCtx
|
||||||
localDbCtx.Entry(item2update).CurrentValues.SetValues(updItem);
|
.ProdList
|
||||||
|
.Where(x => x.ProdDbId == updItem.ProdDbId)
|
||||||
|
.SingleOrDefault();
|
||||||
|
|
||||||
//// update, vers 2
|
if (item2update != null)
|
||||||
//localDbCtx.PartList.Remove(item2del);
|
{
|
||||||
//localDbCtx.PartList.Add(updItem);
|
// update, vers 1...
|
||||||
|
localDbCtx.Entry(item2update).CurrentValues.SetValues(updItem);
|
||||||
|
|
||||||
// Commit changes
|
//// update, vers 2
|
||||||
localDbCtx.SaveChanges();
|
//localDbCtx.PartList.Remove(item2del);
|
||||||
done = true;
|
//localDbCtx.PartList.Add(updItem);
|
||||||
|
|
||||||
|
// Commit changes
|
||||||
|
localDbCtx.SaveChanges();
|
||||||
|
done = true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
string errMessage = $"ERROR on Prod.Update: req item was not found | ProdId {updItem.ProdId} | ProdDbId {updItem.ProdDbId} | Description {updItem.Description}";
|
||||||
|
Console.WriteLine(errMessage);
|
||||||
|
Log.Error(errMessage);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception exc)
|
||||||
|
{
|
||||||
|
string errMessage = $"EXCEPTION on Prod.Update: {Environment.NewLine}{exc}";
|
||||||
|
Console.WriteLine(errMessage);
|
||||||
|
Log.Error(errMessage);
|
||||||
}
|
}
|
||||||
catch
|
|
||||||
{ }
|
|
||||||
}
|
}
|
||||||
return done;
|
return done;
|
||||||
}
|
}
|
||||||
@@ -384,137 +453,182 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="ProdId">Id del Prod</param>
|
/// <param name="ProdId">Id del Prod</param>
|
||||||
/// <param name="MachGroupList">Elenco MachGroup da associare</param>
|
/// <param name="MachGroupList">Elenco MachGroup da associare</param>
|
||||||
/// <returns></returns>
|
/// <returns>Bool esecuzione con successo o meno</returns>
|
||||||
public ProdModel UpdateMachGroup(int ProdId, List<Core.MyMachGroupM> MachGroupList)
|
public bool UpdateMachGroup(int ProdId, List<Core.MyMachGroupM> MachGroupList)
|
||||||
{
|
{
|
||||||
ProdModel currData = new ProdModel();
|
bool testOk = false;
|
||||||
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
// calcolo occorrenze x ogni ID della barra...
|
||||||
|
var listaCheck = MachGroupList
|
||||||
|
.GroupBy(x => x.Id)
|
||||||
|
.Select(n => new
|
||||||
|
{
|
||||||
|
PartId = n.Key,
|
||||||
|
PartCount = n.Count()
|
||||||
|
})
|
||||||
|
.OrderBy(n => n.PartCount);
|
||||||
|
|
||||||
|
// controllo: nell'elenco delle barre MachGroupList NON devono esserci duplicati per
|
||||||
|
// l'ID (esterno) che deve essere univoco...
|
||||||
|
testOk = listaCheck.Where(x => x.PartCount > 1).Count() == 0;
|
||||||
|
if (testOk)
|
||||||
{
|
{
|
||||||
// Recupero il PROD nel contesto DB attuale
|
ProdModel currData = new ProdModel();
|
||||||
currData = localDbCtx
|
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
||||||
.ProdList
|
|
||||||
.Where(x => x.ProdId == ProdId)
|
|
||||||
.SingleOrDefault();
|
|
||||||
|
|
||||||
try
|
|
||||||
{
|
{
|
||||||
// preparo elenco
|
var myStatusMapCtrl = new StatusMapController();
|
||||||
List<MachGroupModel> itemsMG2Add = new List<MachGroupModel>();
|
try
|
||||||
|
|
||||||
List<Core.MyMachGroupM> MachGroupList2Add = new List<Core.MyMachGroupM>();
|
|
||||||
List<PartModel> PartList2Add = new List<PartModel>();
|
|
||||||
// cerco le MG esistenti --> aggiorno
|
|
||||||
foreach (var item in MachGroupList)
|
|
||||||
{
|
{
|
||||||
var currMG = MachGroupController.man.FindByMachGroupId(ProdId, item.Id);
|
// Recupero il PROD nel contesto DB attuale
|
||||||
var convCurrMG = MachGroupController.ConvertFromCore(item, currData.ProdDbId);
|
currData = localDbCtx
|
||||||
if (currMG != null)
|
.ProdList
|
||||||
|
.Where(x => x.ProdId == ProdId)
|
||||||
|
.SingleOrDefault();
|
||||||
|
|
||||||
|
if (currData != null)
|
||||||
{
|
{
|
||||||
// se non identico x equality limitata a ViewOptim...
|
// preparo elenco
|
||||||
if (!currMG.ViewOptimEquals(convCurrMG))
|
List<MachGroupModel> itemsMG2Add = new List<MachGroupModel>();
|
||||||
|
|
||||||
|
List<Core.MyMachGroupM> MachGroupList2Add = new List<Core.MyMachGroupM>();
|
||||||
|
List<PartModel> PartList2Add = new List<PartModel>();
|
||||||
|
List<PartModel> PartList2Rem = new List<PartModel>();
|
||||||
|
var logMGCtrl = new MachGroupController();
|
||||||
|
// cerco le MG esistenti --> aggiorno
|
||||||
|
foreach (var item in MachGroupList)
|
||||||
{
|
{
|
||||||
// aggiorno con nuovi valori ricevuti
|
var currMG = logMGCtrl.FindByMachGroupId(ProdId, item.Id);
|
||||||
currMG.H = convCurrMG.H;
|
var convCurrMG = logMGCtrl.ConvertFromCore(item, currData.ProdDbId);
|
||||||
currMG.L = convCurrMG.L;
|
if (currMG != null)
|
||||||
currMG.W = convCurrMG.W;
|
{
|
||||||
currMG.Material = convCurrMG.Material;
|
// se non identico x equality limitata a ViewOptim...
|
||||||
currMG.Name = convCurrMG.Name;
|
if (!currMG.ViewOptimEquals(convCurrMG))
|
||||||
// salvo
|
{
|
||||||
localDbCtx.SaveChanges();
|
// aggiorno con nuovi valori ricevuti
|
||||||
// registro modifica StatusMap
|
currMG.H = convCurrMG.H;
|
||||||
StatusMapController.man.UpdateAction(currMG.SupervisorId, ProdId, currMG.MachGroupId, Core.StatusMapItemType.MachGroup, Core.StatusMapOpType.MachGroupMod, "");
|
currMG.L = convCurrMG.L;
|
||||||
|
currMG.W = convCurrMG.W;
|
||||||
|
currMG.Material = convCurrMG.Material;
|
||||||
|
currMG.Name = convCurrMG.Name;
|
||||||
|
// salvo
|
||||||
|
localDbCtx.SaveChanges();
|
||||||
|
// registro modifica StatusMap
|
||||||
|
myStatusMapCtrl.UpdateAction(currMG.SupervisorId, ProdId, currMG.MachGroupId, Core.StatusMapItemType.MachGroup, Core.StatusMapOpType.MachGroupMod, "");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
itemsMG2Add.Add(convCurrMG);
|
||||||
|
// registro modifica StatusMap
|
||||||
|
myStatusMapCtrl.UpdateAction("", ProdId, item.Id, Core.StatusMapItemType.MachGroup, Core.StatusMapOpType.MachGroupAdd, "");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
// aggiungo MachGroup
|
||||||
|
localDbCtx.MachGroupList.AddRange(itemsMG2Add);
|
||||||
|
// Commit changes
|
||||||
|
localDbCtx.SaveChanges();
|
||||||
|
|
||||||
|
// verifico di nuovo l'elenco delle MG x le relative PART...
|
||||||
|
foreach (var item in MachGroupList)
|
||||||
|
{
|
||||||
|
var currMG = logMGCtrl.FindByMachGroupId(ProdId, item.Id);
|
||||||
|
int MachGroupDbId = currMG.MachGroupDbId;
|
||||||
|
bool modMg = false;
|
||||||
|
// 2023.05.10: recupero TUTTE le part del MachGroup e poi lavoro...
|
||||||
|
var currMgPartList = localDbCtx
|
||||||
|
.PartList
|
||||||
|
.Where(x => x.MachGroup.Prod.ProdId == ProdId && x.MachGroup.MachGroupId == item.Id)
|
||||||
|
.ToList();
|
||||||
|
// preparo elenco PartList x eventuale rimozione
|
||||||
|
var currPartList2Rem = new List<PartModel>();
|
||||||
|
currPartList2Rem.AddRange(currMgPartList);
|
||||||
|
// verifico se uguali o meno...
|
||||||
|
foreach (var currPartM in item.PartMList)
|
||||||
|
{
|
||||||
|
var myPartCtrl = new PartController();
|
||||||
|
var currPart = currMgPartList
|
||||||
|
.Where(x => x.PartId == currPartM.nPartId)
|
||||||
|
.SingleOrDefault();
|
||||||
|
var convCurrPartM = myPartCtrl.ConvertFromCore(currPartM, MachGroupDbId);
|
||||||
|
if (currPart != null)
|
||||||
|
{
|
||||||
|
// se non identico x equality limitata a ViewOptim...
|
||||||
|
if (!currPart.ViewOptimEquals(convCurrPartM))
|
||||||
|
{
|
||||||
|
// aggiorno con nuovi valori ricevuti
|
||||||
|
currPart.H = convCurrPartM.H;
|
||||||
|
currPart.L = convCurrPartM.L;
|
||||||
|
currPart.W = convCurrPartM.W;
|
||||||
|
currPart.Material = convCurrPartM.Material;
|
||||||
|
currPart.CALC_State = convCurrPartM.CALC_State;
|
||||||
|
currPart.ROT = convCurrPartM.ROT;
|
||||||
|
currPart.PDN = convCurrPartM.PDN;
|
||||||
|
currPart.NAM = convCurrPartM.NAM;
|
||||||
|
// aggiorno anche il BtlPartId
|
||||||
|
currPart.BTLPartDbId = convCurrPartM.BTLPartDbId;
|
||||||
|
// salvo
|
||||||
|
localDbCtx.SaveChanges();
|
||||||
|
modMg = true;
|
||||||
|
}
|
||||||
|
// tolgo da elenco di rimozione...
|
||||||
|
currPartList2Rem.Remove(currPart);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
PartList2Add.Add(convCurrPartM);
|
||||||
|
modMg = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// verifico se salvare...
|
||||||
|
if (modMg)
|
||||||
|
{
|
||||||
|
myStatusMapCtrl.UpdateAction(currMG.SupervisorId, ProdId, currMG.MachGroupId, Core.StatusMapItemType.MachGroup, Core.StatusMapOpType.MachGroupMod, "");
|
||||||
|
}
|
||||||
|
|
||||||
|
// aggiungo le part esistenti nel MG non ricevute...
|
||||||
|
PartList2Rem.AddRange(currPartList2Rem);
|
||||||
|
}
|
||||||
|
// elimino parti da rimuovere..
|
||||||
|
localDbCtx.PartList.RemoveRange(PartList2Rem);
|
||||||
|
// aggiungo PartList
|
||||||
|
localDbCtx.PartList.AddRange(PartList2Add);
|
||||||
|
// Commit changes
|
||||||
|
localDbCtx.SaveChanges();
|
||||||
|
|
||||||
|
// sel dei MachGroup da prod OLD
|
||||||
|
List<MachGroupModel> itemsMGOld = localDbCtx
|
||||||
|
.MachGroupList
|
||||||
|
.Where(x => x.Prod.ProdId == ProdId)
|
||||||
|
.ToList();
|
||||||
|
// elenco degli ID del MachGroup NON trovati
|
||||||
|
List<int> MgId2rem = itemsMGOld.Select(x => x.MachGroupId).Except(MachGroupList.Select(y => y.Id)).ToList();
|
||||||
|
// processo i MachGroup eliminati
|
||||||
|
foreach (var item in MgId2rem)
|
||||||
|
{
|
||||||
|
logMGCtrl.Delete(ProdId, item);
|
||||||
|
}
|
||||||
|
|
||||||
|
// aggiorno valore isNew a false x PROD
|
||||||
|
currData.IsNew = false;
|
||||||
|
|
||||||
|
// Commit changes
|
||||||
|
localDbCtx.SaveChanges();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
itemsMG2Add.Add(convCurrMG);
|
string errMessage = $"ERROR on Prod.UpdateMachGroup: req item was not found | ProdId {ProdId} | MachGroupList {MachGroupList.Count} rec";
|
||||||
// registro modifica StatusMap
|
Console.WriteLine(errMessage);
|
||||||
StatusMapController.man.UpdateAction("", ProdId, item.Id, Core.StatusMapItemType.MachGroup, Core.StatusMapOpType.MachGroupAdd, "");
|
Log.Error(errMessage);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// aggiungo MachGroup
|
catch (Exception exc)
|
||||||
localDbCtx.MachGroupList.AddRange(itemsMG2Add);
|
|
||||||
// Commit changes
|
|
||||||
localDbCtx.SaveChanges();
|
|
||||||
|
|
||||||
// verifico di nuovo l'elenco delle MG x le relative PART...
|
|
||||||
foreach (var item in MachGroupList)
|
|
||||||
{
|
{
|
||||||
var currMG = MachGroupController.man.FindByMachGroupId(ProdId, item.Id);
|
string errMessage = $"EXCEPTION on Prod.UpdateMachGroup: {Environment.NewLine}{exc}";
|
||||||
int MachGroupDbId = currMG.MachGroupDbId;
|
Console.WriteLine(errMessage);
|
||||||
bool modMg = false;
|
Log.Error(errMessage);
|
||||||
// verifico se uguali o meno...
|
|
||||||
foreach (var currPartM in item.PartMList)
|
|
||||||
{
|
|
||||||
var currPart = localDbCtx
|
|
||||||
.PartList
|
|
||||||
.Where(x => x.MachGroup.Prod.ProdId == ProdId && x.MachGroup.MachGroupId == item.Id && x.PartId == currPartM.nPartId)
|
|
||||||
.SingleOrDefault();
|
|
||||||
var convCurrPartM = PartController.ConvertFromCore(currPartM, MachGroupDbId);
|
|
||||||
if (currPart != null)
|
|
||||||
{
|
|
||||||
// se non identico x equality limitata a ViewOptim...
|
|
||||||
if (!currPart.ViewOptimEquals(convCurrPartM))
|
|
||||||
{
|
|
||||||
// aggiorno con nuovi valori ricevuti
|
|
||||||
currPart.H = convCurrPartM.H;
|
|
||||||
currPart.L = convCurrPartM.L;
|
|
||||||
currPart.W = convCurrPartM.W;
|
|
||||||
currPart.Material = convCurrPartM.Material;
|
|
||||||
currPart.CALC_State = convCurrPartM.CALC_State;
|
|
||||||
currPart.ROT = convCurrPartM.ROT;
|
|
||||||
currPart.PDN = convCurrPartM.PDN;
|
|
||||||
currPart.NAM = convCurrPartM.NAM;
|
|
||||||
// salvo
|
|
||||||
localDbCtx.SaveChanges();
|
|
||||||
modMg = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
PartList2Add.Add(convCurrPartM);
|
|
||||||
modMg = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// verifico se salvare...
|
|
||||||
if (modMg)
|
|
||||||
{
|
|
||||||
StatusMapController.man.UpdateAction(currMG.SupervisorId, ProdId, currMG.MachGroupId, Core.StatusMapItemType.MachGroup, Core.StatusMapOpType.MachGroupMod, "");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// aggiungo PartList
|
|
||||||
localDbCtx.PartList.AddRange(PartList2Add);
|
|
||||||
// Commit changes
|
|
||||||
localDbCtx.SaveChanges();
|
|
||||||
|
|
||||||
// sel dei MachGroup da prod OLD
|
|
||||||
List<MachGroupModel> itemsMGOld = localDbCtx
|
|
||||||
.MachGroupList
|
|
||||||
.Where(x => x.Prod.ProdId == ProdId)
|
|
||||||
.ToList();
|
|
||||||
// elenco degli ID del MachGroup NON trovati
|
|
||||||
List<int> MgId2rem = itemsMGOld.Select(x => x.MachGroupId).Except(MachGroupList.Select(y => y.Id)).ToList();
|
|
||||||
// processo i MachGroup eliminati
|
|
||||||
foreach (var item in MgId2rem)
|
|
||||||
{
|
|
||||||
MachGroupController.man.Delete(ProdId, item);
|
|
||||||
}
|
|
||||||
|
|
||||||
// aggiorno valore isNew a false x PROD
|
|
||||||
currData.IsNew = false;
|
|
||||||
|
|
||||||
// Commit changes
|
|
||||||
localDbCtx.SaveChanges();
|
|
||||||
}
|
|
||||||
catch (Exception exc)
|
|
||||||
{
|
|
||||||
string errMessage = $"EXCEPTION on Prod.UpdateMachGroup: {Environment.NewLine}{exc}";
|
|
||||||
Console.WriteLine(errMessage);
|
|
||||||
Log.Error(errMessage);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return currData;
|
return testOk;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -525,18 +639,36 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
|||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public Core.ProdFileM UpdateMachine(int ProdId, String Machine)
|
public Core.ProdFileM UpdateMachine(int ProdId, String Machine)
|
||||||
{
|
{
|
||||||
ProdModel currData;
|
ProdModel currData = new ProdModel();
|
||||||
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
||||||
{
|
{
|
||||||
currData = localDbCtx
|
try
|
||||||
|
{
|
||||||
|
currData = localDbCtx
|
||||||
.ProdList
|
.ProdList
|
||||||
.Where(x => x.ProdId == ProdId)
|
.Where(x => x.ProdId == ProdId)
|
||||||
.SingleOrDefault();
|
.SingleOrDefault();
|
||||||
// aggiorno valore BTL
|
if (currData != null)
|
||||||
currData.Machine = Machine;
|
{
|
||||||
|
// aggiorno valore BTL
|
||||||
|
currData.Machine = Machine;
|
||||||
|
|
||||||
// Commit changes
|
// Commit changes
|
||||||
localDbCtx.SaveChanges();
|
localDbCtx.SaveChanges();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
string errMessage = $"ERROR on Prod.UpdateMachine: req item was not found | ProdId {ProdId} | Machine {Machine}";
|
||||||
|
Console.WriteLine(errMessage);
|
||||||
|
Log.Error(errMessage);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception exc)
|
||||||
|
{
|
||||||
|
string errMessage = $"EXCEPTION on Prod.UpdateMachine: {Environment.NewLine}{exc}";
|
||||||
|
Console.WriteLine(errMessage);
|
||||||
|
Log.Error(errMessage);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return coreConv(currData);
|
return coreConv(currData);
|
||||||
}
|
}
|
||||||
@@ -549,18 +681,36 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
|||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public Core.ProdFileM UpdatePType(int ProdId, BWType PType)
|
public Core.ProdFileM UpdatePType(int ProdId, BWType PType)
|
||||||
{
|
{
|
||||||
ProdModel currData;
|
ProdModel currData = new ProdModel();
|
||||||
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
||||||
{
|
{
|
||||||
currData = localDbCtx
|
try
|
||||||
|
{
|
||||||
|
currData = localDbCtx
|
||||||
.ProdList
|
.ProdList
|
||||||
.Where(x => x.ProdId == ProdId)
|
.Where(x => x.ProdId == ProdId)
|
||||||
.SingleOrDefault();
|
.SingleOrDefault();
|
||||||
// aggiorno valore BTL
|
if (currData != null)
|
||||||
currData.PType = PType;
|
{
|
||||||
|
// aggiorno valore BTL
|
||||||
|
currData.PType = PType;
|
||||||
|
|
||||||
// Commit changes
|
// Commit changes
|
||||||
localDbCtx.SaveChanges();
|
localDbCtx.SaveChanges();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
string errMessage = $"ERROR on Prod.UpdatePType: req item was not found | ProdId {ProdId} | PType {PType}";
|
||||||
|
Console.WriteLine(errMessage);
|
||||||
|
Log.Error(errMessage);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception exc)
|
||||||
|
{
|
||||||
|
string errMessage = $"EXCEPTION on Prod.UpdatePType: {Environment.NewLine}{exc}";
|
||||||
|
Console.WriteLine(errMessage);
|
||||||
|
Log.Error(errMessage);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return coreConv(currData);
|
return coreConv(currData);
|
||||||
}
|
}
|
||||||
@@ -572,25 +722,40 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
|||||||
string LockBy = "";
|
string LockBy = "";
|
||||||
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
||||||
{
|
{
|
||||||
// seleziono il prod...
|
try
|
||||||
var currProd = localDbCtx
|
{
|
||||||
|
// seleziono il prod...
|
||||||
|
var currProd = localDbCtx
|
||||||
.ProdList
|
.ProdList
|
||||||
.Where(x => x.ProdId == ProdId)
|
.Where(x => x.ProdId == ProdId)
|
||||||
.FirstOrDefault();
|
.FirstOrDefault();
|
||||||
|
|
||||||
if (currProd != null)
|
if (currProd != null)
|
||||||
{
|
|
||||||
LockBy = currProd.LockedBy;
|
|
||||||
|
|
||||||
var currProj = localDbCtx
|
|
||||||
.ProjList
|
|
||||||
.Where(x => x.ProdDbId == currProd.ProdDbId)
|
|
||||||
.ToList();
|
|
||||||
|
|
||||||
if (currProj != null && string.IsNullOrEmpty(LockBy))
|
|
||||||
{
|
{
|
||||||
LockBy = currProj.FirstOrDefault(x => !string.IsNullOrEmpty(x.LockedBy)).LockedBy;
|
LockBy = currProd.LockedBy;
|
||||||
|
|
||||||
|
var currProj = localDbCtx
|
||||||
|
.ProjList
|
||||||
|
.Where(x => x.ProdDbId == currProd.ProdDbId)
|
||||||
|
.ToList();
|
||||||
|
|
||||||
|
if (currProj != null && string.IsNullOrEmpty(LockBy))
|
||||||
|
{
|
||||||
|
LockBy = currProj.FirstOrDefault(x => !string.IsNullOrEmpty(x.LockedBy)).LockedBy;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
string errMessage = $"ERROR on Prod.UserLockByProdId: req item was not found | ProdId {ProdId}";
|
||||||
|
Console.WriteLine(errMessage);
|
||||||
|
Log.Error(errMessage);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception exc)
|
||||||
|
{
|
||||||
|
string errMessage = $"EXCEPTION on Prod.UserLockByProdId: {Environment.NewLine}{exc}";
|
||||||
|
Console.WriteLine(errMessage);
|
||||||
|
Log.Error(errMessage);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return LockBy;
|
return LockBy;
|
||||||
@@ -611,6 +776,7 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
|||||||
return answ;
|
return answ;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if false
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Get LAST paginated data from DB (DESC ordered)
|
/// Get LAST paginated data from DB (DESC ordered)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -632,11 +798,14 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
|||||||
.Take(numRecord)
|
.Take(numRecord)
|
||||||
.ToList();
|
.ToList();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
protected List<int> ProjIdByProd(int ProdId)
|
protected List<int> ProjIdByProd(int ProdId)
|
||||||
{
|
{
|
||||||
return DbManager.obj.ProjCtr.GetByProdAsc(ProdId).Select(y => y.nProjId).ToList();
|
var ProjCtr = new ProjController();
|
||||||
|
return ProjCtr.GetByProdAsc(ProdId).Select(y => y.nProjId).ToList();
|
||||||
|
//return DbManager.obj.ProjCtr.GetByProdAsc(ProdId).Select(y => y.nProjId).ToList();
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion Protected Methods
|
#endregion Protected Methods
|
||||||
|
|||||||
@@ -45,11 +45,12 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Delete Proj on DB by ProjId
|
/// Delete Proj logically / on DB by ProjId
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="ProjId"></param>
|
/// <param name="ProjId"></param>
|
||||||
|
/// <param name="IsLogical"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public bool DeleteProj(int ProjId)
|
public bool DeleteProj(int ProjId, bool IsLogical)
|
||||||
{
|
{
|
||||||
bool done = false;
|
bool done = false;
|
||||||
|
|
||||||
@@ -59,25 +60,45 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
|||||||
.ProjList
|
.ProjList
|
||||||
.Where(x => x.ProjId == ProjId)
|
.Where(x => x.ProjId == ProjId)
|
||||||
.SingleOrDefault();
|
.SingleOrDefault();
|
||||||
// sel delle BTLParts da proj
|
|
||||||
var parts2del = localDbCtx
|
|
||||||
.BTLPartList
|
|
||||||
.Where(x => x.ProjDbId == currProj.ProjDbId);
|
|
||||||
|
|
||||||
try
|
if (IsLogical)
|
||||||
{
|
{
|
||||||
// remove from database
|
try
|
||||||
localDbCtx.BTLPartList.RemoveRange(parts2del);
|
{
|
||||||
localDbCtx.ProjList.Remove(currProj);
|
currProj.IsActive = false;
|
||||||
// Commit changes
|
// Commit changes
|
||||||
localDbCtx.SaveChanges();
|
localDbCtx.SaveChanges();
|
||||||
done = true;
|
done = true;
|
||||||
|
}
|
||||||
|
catch (Exception exc)
|
||||||
|
{
|
||||||
|
string errMessage = $"EXCEPTION on Proj.DeleteProj (logical only): {Environment.NewLine}{exc}";
|
||||||
|
Console.WriteLine(errMessage);
|
||||||
|
Log.Error(errMessage);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
catch (Exception exc)
|
else
|
||||||
{
|
{
|
||||||
string errMessage = $"EXCEPTION on Proj.DeleteProj: {Environment.NewLine}{exc}";
|
// sel delle BTLParts da proj
|
||||||
Console.WriteLine(errMessage);
|
var parts2del = localDbCtx
|
||||||
Log.Error(errMessage);
|
.BTLPartList
|
||||||
|
.Where(x => x.ProjDbId == currProj.ProjDbId);
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
// remove from database
|
||||||
|
localDbCtx.BTLPartList.RemoveRange(parts2del);
|
||||||
|
localDbCtx.ProjList.Remove(currProj);
|
||||||
|
// Commit changes
|
||||||
|
localDbCtx.SaveChanges();
|
||||||
|
done = true;
|
||||||
|
}
|
||||||
|
catch (Exception exc)
|
||||||
|
{
|
||||||
|
string errMessage = $"EXCEPTION on Proj.DeleteProj (on DB): {Environment.NewLine}{exc}";
|
||||||
|
Console.WriteLine(errMessage);
|
||||||
|
Log.Error(errMessage);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return done;
|
return done;
|
||||||
@@ -91,8 +112,9 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
|||||||
/// Get records filtered by BtlPartName matching regexp BtlFileName[_number]
|
/// Get records filtered by BtlPartName matching regexp BtlFileName[_number]
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="BtlFileName">Base name to search for (=starts by BtlFileName%)</param>
|
/// <param name="BtlFileName">Base name to search for (=starts by BtlFileName%)</param>
|
||||||
|
/// <param name="OnlyActive">Solo i record attivi (senza cancellazione logica)</param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public List<ProjModel> FindByBtlFileName(string BtlFileName)
|
public List<ProjModel> FindByBtlFileName(string BtlFileName, bool OnlyActive)
|
||||||
{
|
{
|
||||||
List<ProjModel> searchResult = new List<ProjModel>();
|
List<ProjModel> searchResult = new List<ProjModel>();
|
||||||
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
||||||
@@ -100,7 +122,7 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
|||||||
// in primi cerco il record "parent" generale, se non ci fosse inutile proseguire...
|
// in primi cerco il record "parent" generale, se non ci fosse inutile proseguire...
|
||||||
ProjModel parentRec = localDbCtx
|
ProjModel parentRec = localDbCtx
|
||||||
.ProjList
|
.ProjList
|
||||||
.Where(x => x.BTLFileName == BtlFileName)
|
.Where(x => x.BTLFileName == BtlFileName && (!OnlyActive || x.IsActive))
|
||||||
.FirstOrDefault();
|
.FirstOrDefault();
|
||||||
if (parentRec != null && parentRec.ProjId > 0)
|
if (parentRec != null && parentRec.ProjId > 0)
|
||||||
{
|
{
|
||||||
@@ -109,7 +131,7 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
|||||||
// cerco eventuali dati "child" puliti
|
// cerco eventuali dati "child" puliti
|
||||||
var childRec = localDbCtx
|
var childRec = localDbCtx
|
||||||
.ProjList
|
.ProjList
|
||||||
.Where(x => x.BTLFileName.StartsWith(BtlFileName + "_"))
|
.Where(x => x.BTLFileName.StartsWith(BtlFileName + "_") && (!OnlyActive || x.IsActive))
|
||||||
.ToList();
|
.ToList();
|
||||||
// faccio filtro con ricerca regexp x scartare "falsi positivi" come BtlFileName_nonNumero...
|
// faccio filtro con ricerca regexp x scartare "falsi positivi" come BtlFileName_nonNumero...
|
||||||
if (childRec.Count > 0)
|
if (childRec.Count > 0)
|
||||||
@@ -180,7 +202,7 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Get filtered data by ProdId (ASC ordered)
|
/// Get filtered data by ProdId (ASC ordered)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="ProdDbId"></param>
|
/// <param name="ProdId"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public List<Core.ProjFileM> GetByProdAsc(int ProdId)
|
public List<Core.ProjFileM> GetByProdAsc(int ProdId)
|
||||||
{
|
{
|
||||||
@@ -280,9 +302,12 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Elenco progetti
|
/// Elenco progetti
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="numRecord"></param>
|
/// <param name="dtStart">Inizio periodo estrazione (per export date)</param>
|
||||||
|
/// <param name="dtEnd">Fine periodo estrazione (per export date)</param>
|
||||||
|
/// <param name="numRecord">Num max record da recuperare</param>
|
||||||
|
/// <param name="OnlyActive">Solo i record attivi (senza cancellazione logica)</param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public List<Core.ProjFileM> GetLastDesc(int numRecord)
|
public List<Core.ProjFileM> GetLastByExpDesc(DateTime dtStart, DateTime dtEnd, int numRecord, bool OnlyActive)
|
||||||
{
|
{
|
||||||
List<Core.ProjFileM> answ = new List<Core.ProjFileM>();
|
List<Core.ProjFileM> answ = new List<Core.ProjFileM>();
|
||||||
|
|
||||||
@@ -296,6 +321,69 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
|||||||
// retrieve
|
// retrieve
|
||||||
var dbRes = localDbCtx
|
var dbRes = localDbCtx
|
||||||
.ProjList
|
.ProjList
|
||||||
|
.Where(x => (x.DtExported >= dtStart && x.DtExported <= dtEnd) && (!OnlyActive || x.IsActive))
|
||||||
|
.OrderByDescending(x => x.ProjId)
|
||||||
|
.Take(numRecord)
|
||||||
|
.ToList();
|
||||||
|
// conversione
|
||||||
|
answ = dbRes.Select(x => coreConv(x)).ToList();
|
||||||
|
}
|
||||||
|
return answ;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Elenco progetti
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="numRecord">Num max record da recuperare</param>
|
||||||
|
/// <param name="OnlyActive">Solo i record attivi (senza cancellazione logica)</param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public List<Core.ProjFileM> GetLastDesc(int numRecord, bool OnlyActive)
|
||||||
|
{
|
||||||
|
List<Core.ProjFileM> answ = new List<Core.ProjFileM>();
|
||||||
|
|
||||||
|
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
||||||
|
{
|
||||||
|
// se numRecord = 0 --> passo tutti
|
||||||
|
if (numRecord == 0)
|
||||||
|
{
|
||||||
|
numRecord = localDbCtx.ProjList.Count();
|
||||||
|
}
|
||||||
|
// retrieve
|
||||||
|
var dbRes = localDbCtx
|
||||||
|
.ProjList
|
||||||
|
.Where(x => (!OnlyActive || x.IsActive))
|
||||||
|
.OrderByDescending(x => x.ProjId)
|
||||||
|
.Take(numRecord)
|
||||||
|
.ToList();
|
||||||
|
// conversione
|
||||||
|
answ = dbRes.Select(x => coreConv(x)).ToList();
|
||||||
|
}
|
||||||
|
return answ;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Elenco progetti
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="dtStart">Inizio periodo estrazione</param>
|
||||||
|
/// <param name="dtEnd">Fine periodo estrazione</param>
|
||||||
|
/// <param name="numRecord">Num max record da recuperare</param>
|
||||||
|
/// <param name="OnlyActive">Solo i record attivi (senza cancellazione logica)</param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public List<Core.ProjFileM> GetLastDesc(DateTime dtStart, DateTime dtEnd, int numRecord, bool OnlyActive)
|
||||||
|
{
|
||||||
|
List<Core.ProjFileM> answ = new List<Core.ProjFileM>();
|
||||||
|
|
||||||
|
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
||||||
|
{
|
||||||
|
// se numRecord = 0 --> passo tutti
|
||||||
|
if (numRecord == 0)
|
||||||
|
{
|
||||||
|
numRecord = localDbCtx.ProjList.Count();
|
||||||
|
}
|
||||||
|
// retrieve
|
||||||
|
var dbRes = localDbCtx
|
||||||
|
.ProjList
|
||||||
|
.Where(x => (x.DtCreated >= dtStart && x.DtCreated <= dtEnd) && (!OnlyActive || x.IsActive))
|
||||||
.OrderByDescending(x => x.ProjId)
|
.OrderByDescending(x => x.ProjId)
|
||||||
.Take(numRecord)
|
.Take(numRecord)
|
||||||
.ToList();
|
.ToList();
|
||||||
@@ -341,6 +429,7 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
|||||||
{
|
{
|
||||||
ProjId = nextId,
|
ProjId = nextId,
|
||||||
BTLFileName = "",
|
BTLFileName = "",
|
||||||
|
ProjDescription = "",
|
||||||
IsNew = true,
|
IsNew = true,
|
||||||
Locked = true,
|
Locked = true,
|
||||||
LockedBy = UserKey,
|
LockedBy = UserKey,
|
||||||
@@ -452,22 +541,35 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
|||||||
.ProjList
|
.ProjList
|
||||||
.Where(x => x.ProjId == updItem.ProjId)
|
.Where(x => x.ProjId == updItem.ProjId)
|
||||||
.SingleOrDefault();
|
.SingleOrDefault();
|
||||||
try
|
if (item2update != null)
|
||||||
{
|
{
|
||||||
updItem.ProjDbId = item2update.ProjDbId;
|
try
|
||||||
// update, vers 1...
|
{
|
||||||
localDbCtx.Entry(item2update).CurrentValues.SetValues(updItem);
|
updItem.ProjDbId = item2update.ProjDbId;
|
||||||
|
// update, vers 1...
|
||||||
|
localDbCtx.Entry(item2update).CurrentValues.SetValues(updItem);
|
||||||
|
|
||||||
//// update, vers 2
|
//// update, vers 2
|
||||||
//dbCtx.PartList.Remove(item2del);
|
//dbCtx.PartList.Remove(item2del);
|
||||||
//dbCtx.PartList.Add(updItem);
|
//dbCtx.PartList.Add(updItem);
|
||||||
|
|
||||||
// Commit changes
|
// Commit changes
|
||||||
localDbCtx.SaveChanges();
|
localDbCtx.SaveChanges();
|
||||||
done = true;
|
done = true;
|
||||||
|
}
|
||||||
|
catch (Exception exc)
|
||||||
|
{
|
||||||
|
string errMessage = $"EXCEPTION on Part.Update{Environment.NewLine}{exc}";
|
||||||
|
Console.WriteLine(errMessage);
|
||||||
|
Log.Error(errMessage);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
string errMessage = $"ERROR on Proj.Update: req item was not found | ProjId {updItem.ProjId} | ProjDbId {updItem.ProjDbId} | ProdDbId {updItem.ProdDbId}";
|
||||||
|
Console.WriteLine(errMessage);
|
||||||
|
Log.Error(errMessage);
|
||||||
}
|
}
|
||||||
catch (Exception)
|
|
||||||
{ }
|
|
||||||
}
|
}
|
||||||
return done;
|
return done;
|
||||||
}
|
}
|
||||||
@@ -493,77 +595,84 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
|||||||
.BTLPartList
|
.BTLPartList
|
||||||
.Where(x => x.ProjDbId == currData.ProjDbId)
|
.Where(x => x.ProjDbId == currData.ProjDbId)
|
||||||
.ToList();
|
.ToList();
|
||||||
|
if (oldBtlParts != null)
|
||||||
// converto le BtlParts da core --> DB
|
|
||||||
List<BTLPartModel> newBtlParts = BtlPartList.Select(x => BTLPartController.ConvertFromCore(x, currData.ProjDbId)).ToList();
|
|
||||||
|
|
||||||
try
|
|
||||||
{
|
{
|
||||||
// elementi BtlPartId NON + presenti da eliminare
|
var locBtlCtrl = new BTLPartController();
|
||||||
List<int> bpi2rem = oldBtlParts.Select(x => x.PartId).Except(newBtlParts.Select(y => y.PartId)).ToList();
|
// converto le BtlParts da core --> DB
|
||||||
List<int> bpi2add = newBtlParts.Select(x => x.PartId).Except(oldBtlParts.Select(y => y.PartId)).ToList();
|
List<BTLPartModel> newBtlParts = BtlPartList.Select(x => locBtlCtrl.ConvertFromCore(x, currData.ProjDbId)).ToList();
|
||||||
List<int> bpiExis = newBtlParts.Select(x => x.PartId).Intersect(oldBtlParts.Select(y => y.PartId)).ToList();
|
|
||||||
|
|
||||||
// aggiorno existing...
|
try
|
||||||
foreach (var currPartId in bpiExis)
|
|
||||||
{
|
{
|
||||||
// recupero item da aggiornare...
|
// elementi BtlPartId NON + presenti da eliminare
|
||||||
var oldItem = oldBtlParts.Where(x => x.PartId == currPartId).FirstOrDefault();
|
List<int> bpi2rem = oldBtlParts.Select(x => x.PartId).Except(newBtlParts.Select(y => y.PartId)).ToList();
|
||||||
// dati nuovo item
|
List<int> bpi2add = newBtlParts.Select(x => x.PartId).Except(oldBtlParts.Select(y => y.PartId)).ToList();
|
||||||
var newItem = newBtlParts.Where(x => x.PartId == currPartId).FirstOrDefault();
|
List<int> bpiExis = newBtlParts.Select(x => x.PartId).Intersect(oldBtlParts.Select(y => y.PartId)).ToList();
|
||||||
if (newItem != null && oldItem != null)
|
|
||||||
|
// aggiorno existing...
|
||||||
|
foreach (var currPartId in bpiExis)
|
||||||
{
|
{
|
||||||
oldItem.CALC_State = newItem.CALC_State;
|
// recupero item da aggiornare...
|
||||||
oldItem.CNT = newItem.CNT;
|
var oldItem = oldBtlParts.Where(x => x.PartId == currPartId).FirstOrDefault();
|
||||||
oldItem.DO = newItem.DO;
|
// dati nuovo item
|
||||||
oldItem.H = newItem.H;
|
var newItem = newBtlParts.Where(x => x.PartId == currPartId).FirstOrDefault();
|
||||||
oldItem.L = newItem.L;
|
if (newItem != null && oldItem != null)
|
||||||
oldItem.W = newItem.W;
|
{
|
||||||
oldItem.Material = newItem.Material;
|
oldItem.CALC_State = newItem.CALC_State;
|
||||||
oldItem.NAM = newItem.NAM;
|
oldItem.CNT = newItem.CNT;
|
||||||
oldItem.PDN = newItem.PDN;
|
oldItem.DO = newItem.DO;
|
||||||
|
oldItem.H = newItem.H;
|
||||||
|
oldItem.L = newItem.L;
|
||||||
|
oldItem.W = newItem.W;
|
||||||
|
oldItem.Material = newItem.Material;
|
||||||
|
oldItem.NAM = newItem.NAM;
|
||||||
|
oldItem.PDN = newItem.PDN;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// aggiungo le nuove part
|
||||||
|
foreach (var newPartId in bpi2add)
|
||||||
|
{
|
||||||
|
var newItem = newBtlParts.Where(x => x.PartId == newPartId).FirstOrDefault();
|
||||||
|
localDbCtx.BTLPartList.Add(newItem);
|
||||||
|
}
|
||||||
|
|
||||||
|
// elimino dal DB i non + esistenti
|
||||||
|
foreach (var oldPartId in bpi2rem)
|
||||||
|
{
|
||||||
|
// elimino parts nei MachGroup
|
||||||
|
var oldIstPartList = localDbCtx.PartList.Where(x => x.BTLPart.PartId == oldPartId).ToList();
|
||||||
|
localDbCtx.PartList.RemoveRange(oldIstPartList);
|
||||||
|
// elimino BtlParts
|
||||||
|
var oldItem = oldBtlParts.Where(x => x.PartId == oldPartId).FirstOrDefault();
|
||||||
|
localDbCtx.BTLPartList.Remove(oldItem);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
catch
|
||||||
|
{ }
|
||||||
|
|
||||||
// aggiungo le nuove part
|
// aggiorno valore isNew a false
|
||||||
foreach (var newPartId in bpi2add)
|
currData.IsNew = false;
|
||||||
{
|
|
||||||
var newItem = newBtlParts.Where(x => x.PartId == newPartId).FirstOrDefault();
|
|
||||||
localDbCtx.BTLPartList.Add(newItem);
|
|
||||||
}
|
|
||||||
|
|
||||||
// elimino dal DB i non + esistenti
|
// Commit changes
|
||||||
foreach (var oldPartId in bpi2rem)
|
localDbCtx.SaveChanges();
|
||||||
{
|
}
|
||||||
// elimino parts nei MachGroup
|
else
|
||||||
var oldIstPartList = localDbCtx.PartList.Where(x => x.BTLPart.PartId == oldPartId).ToList();
|
{
|
||||||
localDbCtx.PartList.RemoveRange(oldIstPartList);
|
string errMessage = $"ERROR on Proj.UpdateBtlParts: req item was not found | ProjId {ProjId} | BtlPartList {BtlPartList.Count} items";
|
||||||
// elimino BtlParts
|
Console.WriteLine(errMessage);
|
||||||
var oldItem = oldBtlParts.Where(x => x.PartId == oldPartId).FirstOrDefault();
|
Log.Error(errMessage);
|
||||||
localDbCtx.BTLPartList.Remove(oldItem);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
catch
|
|
||||||
{ }
|
|
||||||
|
|
||||||
// aggiorno valore isNew a false
|
|
||||||
currData.IsNew = false;
|
|
||||||
|
|
||||||
// Commit changes
|
|
||||||
localDbCtx.SaveChanges();
|
|
||||||
}
|
}
|
||||||
return currData;
|
return currData;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Update record su DB x nomeBTL, ListName, ExportDate
|
/// Update record su DB x Description
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="ProjId"></param>
|
/// <param name="ProjId"></param>
|
||||||
/// <param name="BTLFileName"></param>
|
/// <param name="Description"></param>
|
||||||
/// <param name="ListName"></param>
|
|
||||||
/// <param name="DtExported"></param>
|
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public Core.ProjFileM UpdateInfo(int ProjId, string BTLFileName, string ListName, DateTime DtExported, BWType PType, string Machine)
|
public Core.ProjFileM UpdateDescription(int ProjId, string Description)
|
||||||
{
|
{
|
||||||
// cerco specifico Proj
|
// cerco specifico Proj
|
||||||
ProjModel currData;
|
ProjModel currData;
|
||||||
@@ -573,50 +682,120 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
|||||||
.ProjList
|
.ProjList
|
||||||
.Where(x => x.ProjId == ProjId)
|
.Where(x => x.ProjId == ProjId)
|
||||||
.SingleOrDefault();
|
.SingleOrDefault();
|
||||||
|
if (currData != null)
|
||||||
// 2022.01.24: verifico UNIVOCITA' nel nome del file: SE fosse duplicato --> nuovo
|
|
||||||
// nome, nel formato nomeOriginale_idx, dove idx è il contatore libero successivo
|
|
||||||
var duplicateList = FindByBtlFileName(BTLFileName);
|
|
||||||
// devo verificare SOLO SE la lista non è vuota
|
|
||||||
if (duplicateList != null && duplicateList.Count > 0)
|
|
||||||
{
|
{
|
||||||
// se ne ho esattamente 1 nel DB allora DEVE essere il record Parent
|
try
|
||||||
if (duplicateList.Count == 1)
|
|
||||||
{
|
{
|
||||||
// verifico se ProjId variato
|
// aggiorno valore BTL
|
||||||
if (!duplicateList[0].ProjId.Equals(currData.ProjId))
|
currData.ProjDescription = Description;
|
||||||
{
|
|
||||||
// in questo caso ho il PRIMO duplicato
|
// Commit changes
|
||||||
BTLFileName = $"{BTLFileName}_1";
|
localDbCtx.SaveChanges();
|
||||||
}
|
|
||||||
}
|
}
|
||||||
// se ne ho + di 1 --> so che il maxId interno avrò il valore ULTIMO x prendere
|
catch (Exception exc)
|
||||||
// il successivo
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
var lastRec = duplicateList.OrderByDescending(x => x.ProjDbId).FirstOrDefault();
|
string errMessage = $"EXCEPTION on Part.UpdateDescription:{Environment.NewLine}{exc}";
|
||||||
// cerco indice
|
Console.WriteLine(errMessage);
|
||||||
string maybeNumber = lastRec.BTLFileName.Replace($"{BTLFileName}_", "");
|
Log.Error(errMessage);
|
||||||
int index = 0;
|
|
||||||
bool isNumber = int.TryParse(maybeNumber, out index);
|
|
||||||
// fasccio comunque verifica sia numerico
|
|
||||||
if (isNumber)
|
|
||||||
{
|
|
||||||
// in questo caso ho il l'ULTIMO duplicato e faccio +1
|
|
||||||
BTLFileName = $"{BTLFileName}_{index + 1}";
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
string errMessage = $"ERROR on Proj.UpdateDescription: req item was not found | ProjId {ProjId} | Description {Description}";
|
||||||
|
Console.WriteLine(errMessage);
|
||||||
|
Log.Error(errMessage);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// aggiorno valore BTL
|
return coreConv(currData);
|
||||||
currData.BTLFileName = BTLFileName;
|
}
|
||||||
currData.DtExported = DtExported;
|
|
||||||
currData.ListName = ListName;
|
|
||||||
currData.PType = PType;
|
|
||||||
currData.Machine = Machine;
|
|
||||||
|
|
||||||
// Commit changes
|
/// <summary>
|
||||||
localDbCtx.SaveChanges();
|
/// Update record su DB x nomeBTL, ListName, ExportDate
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="ProjId"></param>
|
||||||
|
/// <param name="BTLFileName"></param>
|
||||||
|
/// <param name="Description"></param>
|
||||||
|
/// <param name="ListName"></param>
|
||||||
|
/// <param name="DtExported"></param>
|
||||||
|
/// <param name="PType"></param>
|
||||||
|
/// <param name="Machine"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public Core.ProjFileM UpdateInfo(int ProjId, string BTLFileName, string Description, string ListName, DateTime DtExported, BWType PType, string Machine)
|
||||||
|
{
|
||||||
|
// cerco specifico Proj
|
||||||
|
ProjModel currData;
|
||||||
|
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
||||||
|
{
|
||||||
|
currData = localDbCtx
|
||||||
|
.ProjList
|
||||||
|
.Where(x => x.ProjId == ProjId)
|
||||||
|
.SingleOrDefault();
|
||||||
|
if (currData != null)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
// 2022.01.24: verifico UNIVOCITA' nel nome del file: SE fosse duplicato -->
|
||||||
|
// nuovo nome, nel formato nomeOriginale_idx, dove idx è il contatore libero
|
||||||
|
// successivo 2023.06.08: lasciato come prima, anche NON attivi
|
||||||
|
// (cancellazione logica)
|
||||||
|
var duplicateList = FindByBtlFileName(BTLFileName, false);
|
||||||
|
// devo verificare SOLO SE la lista non è vuota
|
||||||
|
if (duplicateList != null && duplicateList.Count > 0)
|
||||||
|
{
|
||||||
|
// se ne ho esattamente 1 nel DB allora DEVE essere il record Parent
|
||||||
|
if (duplicateList.Count == 1)
|
||||||
|
{
|
||||||
|
// verifico se ProjId variato
|
||||||
|
if (!duplicateList[0].ProjId.Equals(currData.ProjId))
|
||||||
|
{
|
||||||
|
// in questo caso ho il PRIMO duplicato
|
||||||
|
BTLFileName = $"{BTLFileName}_1";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// se ne ho + di 1 --> so che il maxId interno avrò il valore ULTIMO x
|
||||||
|
// prendere il successivo
|
||||||
|
else
|
||||||
|
{
|
||||||
|
var lastRec = duplicateList.OrderByDescending(x => x.ProjDbId).FirstOrDefault();
|
||||||
|
// cerco indice
|
||||||
|
string maybeNumber = lastRec.BTLFileName.Replace($"{BTLFileName}_", "");
|
||||||
|
int index = 0;
|
||||||
|
bool isNumber = int.TryParse(maybeNumber, out index);
|
||||||
|
// fasccio comunque verifica sia numerico
|
||||||
|
if (isNumber)
|
||||||
|
{
|
||||||
|
// in questo caso ho il l'ULTIMO duplicato e faccio +1
|
||||||
|
BTLFileName = $"{BTLFileName}_{index + 1}";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// aggiorno valore BTL
|
||||||
|
currData.BTLFileName = BTLFileName;
|
||||||
|
// aggiorno il resto
|
||||||
|
currData.ProjDescription = Description;
|
||||||
|
currData.DtExported = DtExported;
|
||||||
|
currData.ListName = ListName;
|
||||||
|
currData.PType = PType;
|
||||||
|
currData.Machine = Machine;
|
||||||
|
|
||||||
|
// Commit changes
|
||||||
|
localDbCtx.SaveChanges();
|
||||||
|
}
|
||||||
|
catch (Exception exc)
|
||||||
|
{
|
||||||
|
string errMessage = $"EXCEPTION on Part.UpdateInfo:{Environment.NewLine}{exc}";
|
||||||
|
Console.WriteLine(errMessage);
|
||||||
|
Log.Error(errMessage);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
string errMessage = $"ERROR on Proj.UpdateInfo: req item was not found | ProjId {ProjId} | Description {BTLFileName} | ListName {ListName} | DtExported {DtExported} | PType {PType} | Machine {Machine}";
|
||||||
|
Console.WriteLine(errMessage);
|
||||||
|
Log.Error(errMessage);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return coreConv(currData);
|
return coreConv(currData);
|
||||||
@@ -630,18 +809,36 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
|||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public Core.ProjFileM UpdateListName(int ProjId, string ListName)
|
public Core.ProjFileM UpdateListName(int ProjId, string ListName)
|
||||||
{
|
{
|
||||||
ProjModel currData;
|
ProjModel currData = new ProjModel();
|
||||||
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
||||||
{
|
{
|
||||||
currData = localDbCtx
|
try
|
||||||
.ProjList
|
{
|
||||||
.Where(x => x.ProjId == ProjId)
|
currData = localDbCtx
|
||||||
.SingleOrDefault();
|
.ProjList
|
||||||
// aggiorno valore BTL
|
.Where(x => x.ProjId == ProjId)
|
||||||
currData.ListName = ListName;
|
.SingleOrDefault();
|
||||||
|
if (currData != null)
|
||||||
|
{
|
||||||
|
// aggiorno valore BTL
|
||||||
|
currData.ListName = ListName;
|
||||||
|
|
||||||
// Commit changes
|
// Commit changes
|
||||||
localDbCtx.SaveChanges();
|
localDbCtx.SaveChanges();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
string errMessage = $"ERROR on Proj.UpdateListName: req item was not found | ProjId {ProjId} | ListName {ListName}";
|
||||||
|
Console.WriteLine(errMessage);
|
||||||
|
Log.Error(errMessage);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception exc)
|
||||||
|
{
|
||||||
|
string errMessage = $"EXCEPTION on Part.UpdateListName:{Environment.NewLine}{exc}";
|
||||||
|
Console.WriteLine(errMessage);
|
||||||
|
Log.Error(errMessage);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return coreConv(currData);
|
return coreConv(currData);
|
||||||
}
|
}
|
||||||
@@ -654,18 +851,37 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
|||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public Core.ProjFileM UpdateMachine(int ProjId, String Machine)
|
public Core.ProjFileM UpdateMachine(int ProjId, String Machine)
|
||||||
{
|
{
|
||||||
ProjModel currData;
|
ProjModel currData = new ProjModel();
|
||||||
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
||||||
{
|
{
|
||||||
currData = localDbCtx
|
try
|
||||||
|
{
|
||||||
|
currData = localDbCtx
|
||||||
.ProjList
|
.ProjList
|
||||||
.Where(x => x.ProjId == ProjId)
|
.Where(x => x.ProjId == ProjId)
|
||||||
.SingleOrDefault();
|
.SingleOrDefault();
|
||||||
// aggiorno valore BTL
|
|
||||||
currData.Machine = Machine;
|
|
||||||
|
|
||||||
// Commit changes
|
if (currData != null)
|
||||||
localDbCtx.SaveChanges();
|
{
|
||||||
|
// aggiorno valore BTL
|
||||||
|
currData.Machine = Machine;
|
||||||
|
|
||||||
|
// Commit changes
|
||||||
|
localDbCtx.SaveChanges();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
string errMessage = $"ERROR on Proj.UpdateMachine: req item was not found | ProjId {ProjId} | Machine {Machine}";
|
||||||
|
Console.WriteLine(errMessage);
|
||||||
|
Log.Error(errMessage);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception exc)
|
||||||
|
{
|
||||||
|
string errMessage = $"EXCEPTION on Part.UpdateMachine:{Environment.NewLine}{exc}";
|
||||||
|
Console.WriteLine(errMessage);
|
||||||
|
Log.Error(errMessage);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return coreConv(currData);
|
return coreConv(currData);
|
||||||
}
|
}
|
||||||
@@ -684,7 +900,7 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
|||||||
Core.ProjFileM answ = null;
|
Core.ProjFileM answ = null;
|
||||||
if (currProj != null)
|
if (currProj != null)
|
||||||
{
|
{
|
||||||
answ = Core.ProjFileM.CreateProjFileM(currProj.ProjId, ProdIdByProdDbId(currProj.ProdDbId), currProj.DtCreated, currProj.DtExported, currProj.ListName, currProj.BTLFileName, currProj.IsNew, currProj.Locked, currProj.PType, currProj.Machine);
|
answ = Core.ProjFileM.CreateProjFileM(currProj.ProjId, ProdIdByProdDbId(currProj.ProdDbId), currProj.DtCreated, currProj.DtExported, currProj.ListName, currProj.BTLFileName, currProj.ProjDescription, currProj.IsNew, currProj.Locked, currProj.PType, currProj.Machine);
|
||||||
}
|
}
|
||||||
return answ;
|
return answ;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,15 +8,6 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
|||||||
{
|
{
|
||||||
public class StatusMapController : IDisposable
|
public class StatusMapController : IDisposable
|
||||||
{
|
{
|
||||||
#region Public Fields
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Oggetto statico per gestione chiamate da altre classi
|
|
||||||
/// </summary>
|
|
||||||
public static StatusMapController man = new StatusMapController();
|
|
||||||
|
|
||||||
#endregion Public Fields
|
|
||||||
|
|
||||||
#region Public Constructors
|
#region Public Constructors
|
||||||
|
|
||||||
public StatusMapController()
|
public StatusMapController()
|
||||||
|
|||||||
@@ -97,6 +97,8 @@ namespace EgtBEAMWALL.DataLayer.DatabaseModels
|
|||||||
if (!(obj is PartModel item))
|
if (!(obj is PartModel item))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
if (BTLPartDbId != item.BTLPartDbId)
|
||||||
|
return false;
|
||||||
if (H != item.H)
|
if (H != item.H)
|
||||||
return false;
|
return false;
|
||||||
if (L != item.L)
|
if (L != item.L)
|
||||||
|
|||||||
@@ -1,7 +1,4 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.ComponentModel.DataAnnotations;
|
using System.ComponentModel.DataAnnotations;
|
||||||
using System.ComponentModel.DataAnnotations.Schema;
|
using System.ComponentModel.DataAnnotations.Schema;
|
||||||
using static EgtBEAMWALL.Core.ConstBeam;
|
using static EgtBEAMWALL.Core.ConstBeam;
|
||||||
@@ -31,6 +28,12 @@ namespace EgtBEAMWALL.DataLayer.DatabaseModels
|
|||||||
[Column("DtExported")]
|
[Column("DtExported")]
|
||||||
public DateTime DtExported { get; set; }
|
public DateTime DtExported { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Record attivo (se false == cancellazione logica)
|
||||||
|
/// </summary>
|
||||||
|
[Column("IsActive")]
|
||||||
|
public bool IsActive { get; set; } = true;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Stato NEW = creato ma NON salvato
|
/// Stato NEW = creato ma NON salvato
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -43,6 +46,13 @@ namespace EgtBEAMWALL.DataLayer.DatabaseModels
|
|||||||
[Column("ListName")]
|
[Column("ListName")]
|
||||||
public string ListName { get; set; } = "";
|
public string ListName { get; set; } = "";
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// DataOra ultima operazione di Lock (o di rimozione di lock), quando aperto da un
|
||||||
|
/// dispositivo in rete
|
||||||
|
/// </summary>
|
||||||
|
[Column("LockDate")]
|
||||||
|
public DateTime LockDate { get; set; } = DateTime.MinValue;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Stato locked (quando aperto da un dispositivo in rete)
|
/// Stato locked (quando aperto da un dispositivo in rete)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -55,12 +65,6 @@ namespace EgtBEAMWALL.DataLayer.DatabaseModels
|
|||||||
[Column("LockedBy")]
|
[Column("LockedBy")]
|
||||||
public string LockedBy { get; set; } = "";
|
public string LockedBy { get; set; } = "";
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// DataOra ultima operazione di Lock (o di rimozione di lock), quando aperto da un dispositivo in rete
|
|
||||||
/// </summary>
|
|
||||||
[Column("LockDate")]
|
|
||||||
public DateTime LockDate { get; set; } = DateTime.MinValue;
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Macchina
|
/// Macchina
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -76,6 +80,12 @@ namespace EgtBEAMWALL.DataLayer.DatabaseModels
|
|||||||
[Key, Column("ProjDbId"), DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
[Key, Column("ProjDbId"), DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
||||||
public int ProjDbId { get; set; }
|
public int ProjDbId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Descrizione progetto (copiata da BTLFileName inizialmente)
|
||||||
|
/// </summary>
|
||||||
|
[Column("ProjDescription")]
|
||||||
|
public string ProjDescription { get; set; } = "";
|
||||||
|
|
||||||
[Column("Id")]
|
[Column("Id")]
|
||||||
public int ProjId { get; set; }
|
public int ProjId { get; set; }
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
using System.IO;
|
using System.Diagnostics;
|
||||||
|
using System;
|
||||||
|
using System.IO;
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
|
|
||||||
namespace EgtBEAMWALL.DataLayer
|
namespace EgtBEAMWALL.DataLayer
|
||||||
@@ -27,7 +29,7 @@ namespace EgtBEAMWALL.DataLayer
|
|||||||
public static string ADMIN_CONNECTION_STRING { get; set; } = "";
|
public static string ADMIN_CONNECTION_STRING { get; set; } = "";
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// DB Connection string
|
/// DB Connection string, per effettuare migration riportare valore connessione admin cablato
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static string CONNECTION_STRING { get; set; } = "";
|
public static string CONNECTION_STRING { get; set; } = "";
|
||||||
|
|
||||||
@@ -58,6 +60,81 @@ namespace EgtBEAMWALL.DataLayer
|
|||||||
return Controllers.DbController.man.checkCreateUser(DATABASE_USER, DATABASE_PWD, isNetwork);
|
return Controllers.DbController.man.checkCreateUser(DATABASE_USER, DATABASE_PWD, isNetwork);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Effettua verifica presenza view prod + relativo utente
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="nKey"></param>
|
||||||
|
/// <param name="sKey"></param>
|
||||||
|
/// <param name="isNetwork"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public static bool CheckViews(string nKey, string sKey)
|
||||||
|
{
|
||||||
|
// esecuzione script di install locale
|
||||||
|
return Controllers.DbController.man.refreshViews(DATABASE_NAME);
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// Effettua DUMP del DB dato utente admin + percorso salvataggio
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="outFilePath">Percorso di salvataggio del dump (*.sql)</param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public static bool DumpDB(string mysqlDumpPath, string outFilePath)
|
||||||
|
{
|
||||||
|
bool fatto = false;
|
||||||
|
// aggiungo sql finale
|
||||||
|
if (!outFilePath.EndsWith(".sql"))
|
||||||
|
{
|
||||||
|
outFilePath = $"{outFilePath}.sql";
|
||||||
|
}
|
||||||
|
// esecuzione script x dump del DB
|
||||||
|
string dirPath = Path.GetDirectoryName(outFilePath);
|
||||||
|
if (!Directory.Exists(dirPath))
|
||||||
|
{
|
||||||
|
Directory.CreateDirectory(dirPath);
|
||||||
|
}
|
||||||
|
// se ci fosse già file elimino...
|
||||||
|
if (File.Exists(outFilePath))
|
||||||
|
{
|
||||||
|
File.Delete(outFilePath);
|
||||||
|
}
|
||||||
|
// chiamo script esterno...
|
||||||
|
string callScript = $"\"{mysqlDumpPath}\" -u{DATABASE_USER} -p{DATABASE_PWD} {DATABASE_NAME} > {outFilePath}";
|
||||||
|
ExecuteCommand(callScript);
|
||||||
|
return fatto;
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// Esecuzione di un comando esterno
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="command"></param>
|
||||||
|
public static void ExecuteCommand(string command)
|
||||||
|
{
|
||||||
|
int exitCode;
|
||||||
|
ProcessStartInfo processInfo;
|
||||||
|
Process process;
|
||||||
|
|
||||||
|
processInfo = new ProcessStartInfo("cmd.exe", "/c " + command);
|
||||||
|
processInfo.CreateNoWindow = true;
|
||||||
|
processInfo.UseShellExecute = false;
|
||||||
|
// *** Redirect the output ***
|
||||||
|
processInfo.RedirectStandardError = true;
|
||||||
|
processInfo.RedirectStandardOutput = true;
|
||||||
|
|
||||||
|
process = Process.Start(processInfo);
|
||||||
|
process.WaitForExit();
|
||||||
|
|
||||||
|
// *** Read the streams ***
|
||||||
|
// Warning: This approach can lead to deadlocks, see Edit #2
|
||||||
|
string output = process.StandardOutput.ReadToEnd();
|
||||||
|
string error = process.StandardError.ReadToEnd();
|
||||||
|
|
||||||
|
exitCode = process.ExitCode;
|
||||||
|
|
||||||
|
Console.WriteLine("output>>" + (String.IsNullOrEmpty(output) ? "(none)" : output));
|
||||||
|
Console.WriteLine("error>>" + (String.IsNullOrEmpty(error) ? "(none)" : error));
|
||||||
|
Console.WriteLine("ExitCode: " + exitCode.ToString(), "ExecuteCommand");
|
||||||
|
process.Close();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Metodo di init standard per DB in rete con Master_Key
|
/// Metodo di init standard per DB in rete con Master_Key
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@@ -9,7 +9,6 @@ namespace EgtBEAMWALL.DataLayer
|
|||||||
{
|
{
|
||||||
#region Public Fields
|
#region Public Fields
|
||||||
|
|
||||||
public static DbManager obj = new DbManager();
|
|
||||||
public Controllers.BTLPartController BtlPartCtr = new Controllers.BTLPartController();
|
public Controllers.BTLPartController BtlPartCtr = new Controllers.BTLPartController();
|
||||||
public Controllers.LogMachineController LogMacCtr = new Controllers.LogMachineController();
|
public Controllers.LogMachineController LogMacCtr = new Controllers.LogMachineController();
|
||||||
public Controllers.LogSupportController LogSupCtr = new Controllers.LogSupportController();
|
public Controllers.LogSupportController LogSupCtr = new Controllers.LogSupportController();
|
||||||
|
|||||||
@@ -37,8 +37,8 @@
|
|||||||
<Prefer32Bit>false</Prefer32Bit>
|
<Prefer32Bit>false</Prefer32Bit>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Reference Include="BouncyCastle.Crypto, Version=1.8.5.0, Culture=neutral, PublicKeyToken=0e99375e54769942">
|
<Reference Include="BouncyCastle.Crypto, Version=1.9.0.0, Culture=neutral, PublicKeyToken=0e99375e54769942, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\BouncyCastle.1.8.5\lib\BouncyCastle.Crypto.dll</HintPath>
|
<HintPath>..\packages\Portable.BouncyCastle.1.9.0\lib\net40\BouncyCastle.Crypto.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="EgtWPFLib5">
|
<Reference Include="EgtWPFLib5">
|
||||||
<HintPath>..\ExtLibs\EgtWPFLib5.dll</HintPath>
|
<HintPath>..\ExtLibs\EgtWPFLib5.dll</HintPath>
|
||||||
@@ -49,17 +49,17 @@
|
|||||||
<Reference Include="EntityFramework.SqlServer, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL">
|
<Reference Include="EntityFramework.SqlServer, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\EntityFramework.6.4.4\lib\net45\EntityFramework.SqlServer.dll</HintPath>
|
<HintPath>..\packages\EntityFramework.6.4.4\lib\net45\EntityFramework.SqlServer.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="Google.Protobuf, Version=3.19.4.0, Culture=neutral, PublicKeyToken=a7d26565bac4d604, processorArchitecture=MSIL">
|
<Reference Include="Google.Protobuf, Version=3.21.9.0, Culture=neutral, PublicKeyToken=a7d26565bac4d604, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\Google.Protobuf.3.19.4\lib\net45\Google.Protobuf.dll</HintPath>
|
<HintPath>..\packages\Google.Protobuf.3.21.9\lib\net45\Google.Protobuf.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="K4os.Compression.LZ4, Version=1.2.6.0, Culture=neutral, PublicKeyToken=2186fa9121ef231d, processorArchitecture=MSIL">
|
<Reference Include="K4os.Compression.LZ4, Version=1.3.5.0, Culture=neutral, PublicKeyToken=2186fa9121ef231d, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\K4os.Compression.LZ4.1.2.6\lib\net46\K4os.Compression.LZ4.dll</HintPath>
|
<HintPath>..\packages\K4os.Compression.LZ4.1.3.5\lib\net462\K4os.Compression.LZ4.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="K4os.Compression.LZ4.Streams, Version=1.2.6.0, Culture=neutral, PublicKeyToken=2186fa9121ef231d, processorArchitecture=MSIL">
|
<Reference Include="K4os.Compression.LZ4.Streams, Version=1.3.5.0, Culture=neutral, PublicKeyToken=2186fa9121ef231d, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\K4os.Compression.LZ4.Streams.1.2.6\lib\net46\K4os.Compression.LZ4.Streams.dll</HintPath>
|
<HintPath>..\packages\K4os.Compression.LZ4.Streams.1.3.5\lib\net462\K4os.Compression.LZ4.Streams.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="K4os.Hash.xxHash, Version=1.0.6.0, Culture=neutral, PublicKeyToken=32cd54395057cec3, processorArchitecture=MSIL">
|
<Reference Include="K4os.Hash.xxHash, Version=1.0.8.0, Culture=neutral, PublicKeyToken=32cd54395057cec3, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\K4os.Hash.xxHash.1.0.6\lib\net46\K4os.Hash.xxHash.dll</HintPath>
|
<HintPath>..\packages\K4os.Hash.xxHash.1.0.8\lib\net462\K4os.Hash.xxHash.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="MySql.Data, Version=8.0.21.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d, processorArchitecture=MSIL">
|
<Reference Include="MySql.Data, Version=8.0.21.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\MySql.Data.8.0.21\lib\net452\MySql.Data.dll</HintPath>
|
<HintPath>..\packages\MySql.Data.8.0.21\lib\net452\MySql.Data.dll</HintPath>
|
||||||
@@ -88,20 +88,26 @@
|
|||||||
<Reference Include="System.Drawing" />
|
<Reference Include="System.Drawing" />
|
||||||
<Reference Include="System.Drawing.Design" />
|
<Reference Include="System.Drawing.Design" />
|
||||||
<Reference Include="System.IO.Compression" />
|
<Reference Include="System.IO.Compression" />
|
||||||
|
<Reference Include="System.IO.Pipelines, Version=5.0.0.2, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\packages\System.IO.Pipelines.5.0.2\lib\net461\System.IO.Pipelines.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
<Reference Include="System.Management" />
|
<Reference Include="System.Management" />
|
||||||
<Reference Include="System.Memory, Version=4.0.1.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
<Reference Include="System.Memory, Version=4.0.1.2, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\System.Memory.4.5.4\lib\net461\System.Memory.dll</HintPath>
|
<HintPath>..\packages\System.Memory.4.5.5\lib\net461\System.Memory.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="System.Numerics" />
|
<Reference Include="System.Numerics" />
|
||||||
<Reference Include="System.Numerics.Vectors, Version=4.1.4.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
<Reference Include="System.Numerics.Vectors, Version=4.1.4.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\System.Numerics.Vectors.4.5.0\lib\net46\System.Numerics.Vectors.dll</HintPath>
|
<HintPath>..\packages\System.Numerics.Vectors.4.5.0\lib\net46\System.Numerics.Vectors.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="System.Runtime.CompilerServices.Unsafe, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
<Reference Include="System.Runtime.CompilerServices.Unsafe, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\System.Runtime.CompilerServices.Unsafe.5.0.0\lib\net45\System.Runtime.CompilerServices.Unsafe.dll</HintPath>
|
<HintPath>..\packages\System.Runtime.CompilerServices.Unsafe.6.0.0\lib\net461\System.Runtime.CompilerServices.Unsafe.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="System.Security" />
|
<Reference Include="System.Security" />
|
||||||
<Reference Include="System.ServiceModel" />
|
<Reference Include="System.ServiceModel" />
|
||||||
<Reference Include="System.ServiceProcess" />
|
<Reference Include="System.ServiceProcess" />
|
||||||
|
<Reference Include="System.Threading.Tasks.Extensions, Version=4.2.0.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\packages\System.Threading.Tasks.Extensions.4.5.4\lib\net461\System.Threading.Tasks.Extensions.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
<Reference Include="System.Transactions" />
|
<Reference Include="System.Transactions" />
|
||||||
<Reference Include="System.Xml.Linq" />
|
<Reference Include="System.Xml.Linq" />
|
||||||
<Reference Include="System.Data.DataSetExtensions" />
|
<Reference Include="System.Data.DataSetExtensions" />
|
||||||
@@ -166,6 +172,10 @@
|
|||||||
<Compile Include="Migrations\202207051703296_UpgradeLockModel.designer.cs">
|
<Compile Include="Migrations\202207051703296_UpgradeLockModel.designer.cs">
|
||||||
<DependentUpon>202207051703296_UpgradeLockModel.cs</DependentUpon>
|
<DependentUpon>202207051703296_UpgradeLockModel.cs</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
|
<Compile Include="Migrations\202306081452095_UpdateProjModel.cs" />
|
||||||
|
<Compile Include="Migrations\202306081452095_UpdateProjModel.designer.cs">
|
||||||
|
<DependentUpon>202306081452095_UpdateProjModel.cs</DependentUpon>
|
||||||
|
</Compile>
|
||||||
<Compile Include="Migrations\Configuration.cs" />
|
<Compile Include="Migrations\Configuration.cs" />
|
||||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||||
<Compile Include="Utils.cs" />
|
<Compile Include="Utils.cs" />
|
||||||
@@ -205,6 +215,9 @@
|
|||||||
<EmbeddedResource Include="Migrations\202207051703296_UpgradeLockModel.resx">
|
<EmbeddedResource Include="Migrations\202207051703296_UpgradeLockModel.resx">
|
||||||
<DependentUpon>202207051703296_UpgradeLockModel.cs</DependentUpon>
|
<DependentUpon>202207051703296_UpgradeLockModel.cs</DependentUpon>
|
||||||
</EmbeddedResource>
|
</EmbeddedResource>
|
||||||
|
<EmbeddedResource Include="Migrations\202306081452095_UpdateProjModel.resx">
|
||||||
|
<DependentUpon>202306081452095_UpdateProjModel.cs</DependentUpon>
|
||||||
|
</EmbeddedResource>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
|
|||||||
@@ -0,0 +1,29 @@
|
|||||||
|
// <auto-generated />
|
||||||
|
namespace EgtBEAMWALL.DataLayer.Migrations
|
||||||
|
{
|
||||||
|
using System.CodeDom.Compiler;
|
||||||
|
using System.Data.Entity.Migrations;
|
||||||
|
using System.Data.Entity.Migrations.Infrastructure;
|
||||||
|
using System.Resources;
|
||||||
|
|
||||||
|
[GeneratedCode("EntityFramework.Migrations", "6.4.4")]
|
||||||
|
public sealed partial class UpdateProjModel : IMigrationMetadata
|
||||||
|
{
|
||||||
|
private readonly ResourceManager Resources = new ResourceManager(typeof(UpdateProjModel));
|
||||||
|
|
||||||
|
string IMigrationMetadata.Id
|
||||||
|
{
|
||||||
|
get { return "202306081452095_UpdateProjModel"; }
|
||||||
|
}
|
||||||
|
|
||||||
|
string IMigrationMetadata.Source
|
||||||
|
{
|
||||||
|
get { return null; }
|
||||||
|
}
|
||||||
|
|
||||||
|
string IMigrationMetadata.Target
|
||||||
|
{
|
||||||
|
get { return Resources.GetString("Target"); }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
namespace EgtBEAMWALL.DataLayer.Migrations
|
||||||
|
{
|
||||||
|
using System;
|
||||||
|
using System.Data.Entity.Migrations;
|
||||||
|
|
||||||
|
public partial class UpdateProjModel : DbMigration
|
||||||
|
{
|
||||||
|
public override void Up()
|
||||||
|
{
|
||||||
|
AddColumn("dbo.ProjList", "IsActive", c => c.Boolean(nullable: false, defaultValueSql: "1"));
|
||||||
|
AddColumn("dbo.ProjList", "ProjDescription", c => c.String(unicode: false));
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void Down()
|
||||||
|
{
|
||||||
|
DropColumn("dbo.ProjList", "ProjDescription");
|
||||||
|
DropColumn("dbo.ProjList", "IsActive");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -10,7 +10,7 @@ using System.Runtime.InteropServices;
|
|||||||
[assembly: AssemblyConfiguration("")]
|
[assembly: AssemblyConfiguration("")]
|
||||||
[assembly: AssemblyCompany("Egalware s.r.l.")]
|
[assembly: AssemblyCompany("Egalware s.r.l.")]
|
||||||
[assembly: AssemblyProduct("EgtBEAMWALL.DataLayer")]
|
[assembly: AssemblyProduct("EgtBEAMWALL.DataLayer")]
|
||||||
[assembly: AssemblyCopyright("Copyright © 2020-2022 by Egalware s.r.l.")]
|
[assembly: AssemblyCopyright("Copyright © 2020-2023 by Egalware s.r.l.")]
|
||||||
[assembly: AssemblyTrademark("")]
|
[assembly: AssemblyTrademark("")]
|
||||||
[assembly: AssemblyCulture("")]
|
[assembly: AssemblyCulture("")]
|
||||||
|
|
||||||
@@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
|
|||||||
// You can specify all the values or you can default the Build and Revision Numbers
|
// You can specify all the values or you can default the Build and Revision Numbers
|
||||||
// by using the '*' as shown below:
|
// by using the '*' as shown below:
|
||||||
// [assembly: AssemblyVersion("1.0.*")]
|
// [assembly: AssemblyVersion("1.0.*")]
|
||||||
[assembly: AssemblyVersion("2.4.7.1")]
|
[assembly: AssemblyVersion("2.5.6.2")]
|
||||||
[assembly: AssemblyFileVersion("2.4.7.1")]
|
[assembly: AssemblyFileVersion("2.5.6.2")]
|
||||||
|
|||||||
@@ -2,17 +2,20 @@
|
|||||||
<packages>
|
<packages>
|
||||||
<package id="BouncyCastle" version="1.8.5" targetFramework="net472" />
|
<package id="BouncyCastle" version="1.8.5" targetFramework="net472" />
|
||||||
<package id="EntityFramework" version="6.4.4" targetFramework="net452" />
|
<package id="EntityFramework" version="6.4.4" targetFramework="net452" />
|
||||||
<package id="Google.Protobuf" version="3.19.4" targetFramework="net472" />
|
<package id="Google.Protobuf" version="3.21.9" targetFramework="net472" />
|
||||||
<package id="K4os.Compression.LZ4" version="1.2.6" targetFramework="net472" />
|
<package id="K4os.Compression.LZ4" version="1.3.5" targetFramework="net472" />
|
||||||
<package id="K4os.Compression.LZ4.Streams" version="1.2.6" targetFramework="net472" />
|
<package id="K4os.Compression.LZ4.Streams" version="1.3.5" targetFramework="net472" />
|
||||||
<package id="K4os.Hash.xxHash" version="1.0.6" targetFramework="net472" />
|
<package id="K4os.Hash.xxHash" version="1.0.8" targetFramework="net472" />
|
||||||
<package id="MySql.Data" version="8.0.21" targetFramework="net472" />
|
<package id="MySql.Data" version="8.0.21" targetFramework="net472" />
|
||||||
<package id="MySql.Data.EntityFramework" version="8.0.21" targetFramework="net472" />
|
<package id="MySql.Data.EntityFramework" version="8.0.21" targetFramework="net472" />
|
||||||
<package id="Newtonsoft.Json" version="13.0.1" targetFramework="net452" />
|
<package id="Newtonsoft.Json" version="13.0.1" targetFramework="net452" />
|
||||||
<package id="NLog" version="5.0.1" targetFramework="net472" />
|
<package id="NLog" version="5.0.1" targetFramework="net472" />
|
||||||
|
<package id="Portable.BouncyCastle" version="1.9.0" targetFramework="net472" />
|
||||||
<package id="SSH.NET" version="2016.1.0" targetFramework="net472" />
|
<package id="SSH.NET" version="2016.1.0" targetFramework="net472" />
|
||||||
<package id="System.Buffers" version="4.5.1" targetFramework="net472" />
|
<package id="System.Buffers" version="4.5.1" targetFramework="net472" />
|
||||||
<package id="System.Memory" version="4.5.4" targetFramework="net472" />
|
<package id="System.IO.Pipelines" version="5.0.2" targetFramework="net472" />
|
||||||
|
<package id="System.Memory" version="4.5.5" targetFramework="net472" />
|
||||||
<package id="System.Numerics.Vectors" version="4.5.0" targetFramework="net472" />
|
<package id="System.Numerics.Vectors" version="4.5.0" targetFramework="net472" />
|
||||||
<package id="System.Runtime.CompilerServices.Unsafe" version="5.0.0" targetFramework="net472" />
|
<package id="System.Runtime.CompilerServices.Unsafe" version="6.0.0" targetFramework="net472" />
|
||||||
|
<package id="System.Threading.Tasks.Extensions" version="4.5.4" targetFramework="net472" />
|
||||||
</packages>
|
</packages>
|
||||||
@@ -8,7 +8,7 @@
|
|||||||
<defaultConnectionFactory type="MySql.Data.Entity.MySqlConnectionFactory, MySql.Data.Entity.EF6"/>
|
<defaultConnectionFactory type="MySql.Data.Entity.MySqlConnectionFactory, MySql.Data.Entity.EF6"/>
|
||||||
<providers>
|
<providers>
|
||||||
|
|
||||||
<provider invariantName="MySql.Data.MySqlClient" type="MySql.Data.MySqlClient.MySqlProviderServices, MySql.Data.Entity.EF6, Version=6.10.9.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d"></provider>
|
<provider invariantName="MySql.Data.MySqlClient" type="MySql.Data.MySqlClient.MySqlProviderServices, Version=6.10.9.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d"></provider>
|
||||||
</providers>
|
</providers>
|
||||||
</entityFramework>
|
</entityFramework>
|
||||||
<connectionStrings>
|
<connectionStrings>
|
||||||
|
|||||||
@@ -3,8 +3,7 @@ Imports EgtBEAMWALL.Core
|
|||||||
|
|
||||||
Public Class AboutBoxV
|
Public Class AboutBoxV
|
||||||
|
|
||||||
Private Sub AboutBoxWD_Initialized(sender As Object, e As EventArgs) Handles Me.Initialized
|
Private Sub AboutBoxWD_Loaded(sender As Object, e As RoutedEventArgs) Handles Me.Loaded
|
||||||
Me.Owner = Application.Current.MainWindow
|
|
||||||
DescriptionLbl.Text = My.Application.Info.Description.ToString()
|
DescriptionLbl.Text = My.Application.Info.Description.ToString()
|
||||||
VersionLbl.Text = "Version : " & My.Application.Info.Version.Major.ToString() &
|
VersionLbl.Text = "Version : " & My.Application.Info.Version.Major.ToString() &
|
||||||
"." & My.Application.Info.Version.Minor.ToString() &
|
"." & My.Application.Info.Version.Minor.ToString() &
|
||||||
@@ -25,6 +24,9 @@ Public Class AboutBoxV
|
|||||||
sInfo &= sKey & " - " & sKlev & " - " & sOpts & sLeftDays & Environment.NewLine
|
sInfo &= sKey & " - " & sKlev & " - " & sOpts & sLeftDays & Environment.NewLine
|
||||||
sInfo &= "DataRoot " & Map.refMainWindowVM.MainWindowM.sDataRoot & Environment.NewLine
|
sInfo &= "DataRoot " & Map.refMainWindowVM.MainWindowM.sDataRoot & Environment.NewLine
|
||||||
sInfo &= "MachinesRoot " & Map.refMainWindowVM.MainWindowM.sMachinesRoot & Environment.NewLine
|
sInfo &= "MachinesRoot " & Map.refMainWindowVM.MainWindowM.sMachinesRoot & Environment.NewLine
|
||||||
|
Dim sOpSys As String = String.Empty
|
||||||
|
EgtGetOsInfo( sOpSys)
|
||||||
|
sInfo &= sOpSys & Environment.NewLine
|
||||||
Dim sCPU As String = String.Empty
|
Dim sCPU As String = String.Empty
|
||||||
EgtGetCpuInfo( sCPU)
|
EgtGetCpuInfo( sCPU)
|
||||||
sInfo &= sCPU & Environment.NewLine
|
sInfo &= sCPU & Environment.NewLine
|
||||||
@@ -32,7 +34,7 @@ Public Class AboutBoxV
|
|||||||
EgtGetSceneInfo(sScene)
|
EgtGetSceneInfo(sScene)
|
||||||
sInfo &= sScene
|
sInfo &= sScene
|
||||||
InfoLbl.Text = sInfo
|
InfoLbl.Text = sInfo
|
||||||
ExitBtn.Content = EgtMsg(constmsg.MSG_MISSINGKEYWD + 4) 'Ok
|
ExitBtn.Content = EgtMsg(MSG_MISSINGKEYWD + 4) 'Ok
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
End Class
|
End Class
|
||||||
|
|||||||
@@ -118,6 +118,7 @@ Public Class CALCPanelVM
|
|||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Shared Sub ProcessResults(Bar As Bar)
|
Private Shared Sub ProcessResults(Bar As Bar)
|
||||||
|
If IsNothing(Bar) Then Return
|
||||||
|
|
||||||
' disabilito impostazione modificato
|
' disabilito impostazione modificato
|
||||||
Dim DisableMgr As New DisableModifiedMgr
|
Dim DisableMgr As New DisableModifiedMgr
|
||||||
@@ -148,7 +149,7 @@ Public Class CALCPanelVM
|
|||||||
|
|
||||||
If line.StartsWith("ERR=") Then
|
If line.StartsWith("ERR=") Then
|
||||||
Dim nVal As Integer? = GetVal(line, "ERR")
|
Dim nVal As Integer? = GetVal(line, "ERR")
|
||||||
nErr = (If(nVal IsNot Nothing, nVal.Value, 0))
|
nErr = (If(Not IsNothing(nVal), nVal.Value, 0))
|
||||||
sMsg = ""
|
sMsg = ""
|
||||||
dRot = 0
|
dRot = 0
|
||||||
nFall = 0
|
nFall = 0
|
||||||
@@ -156,24 +157,24 @@ Public Class CALCPanelVM
|
|||||||
taskId = 0
|
taskId = 0
|
||||||
ElseIf line.StartsWith("ROT=") Then
|
ElseIf line.StartsWith("ROT=") Then
|
||||||
Dim nVal As Integer? = GetVal(line, "ROT")
|
Dim nVal As Integer? = GetVal(line, "ROT")
|
||||||
Dim nRot As Integer = (If(nVal IsNot Nothing, nVal.Value, 0))
|
Dim nRot As Integer = (If(Not IsNothing(nVal), nVal.Value, 0))
|
||||||
dRot = Math.Abs(((4 - nRot) Mod 4) * 90)
|
dRot = Math.Abs(((4 - nRot) Mod 4) * 90)
|
||||||
dPartRot = Math.Max(dPartRot, dRot)
|
dPartRot = Math.Max(dPartRot, dRot)
|
||||||
dTotRot = Math.Max(dTotRot, dRot)
|
dTotRot = Math.Max(dTotRot, dRot)
|
||||||
ElseIf line.StartsWith("CUTID=") Then
|
ElseIf line.StartsWith("CUTID=") Then
|
||||||
Dim nVal As Integer? = GetVal(line, "CUTID")
|
Dim nVal As Integer? = GetVal(line, "CUTID")
|
||||||
cutId = If(nVal IsNot Nothing, nVal.Value, 0)
|
cutId = If(Not IsNothing(nVal), nVal.Value, 0)
|
||||||
ElseIf line.StartsWith("TASKID=") Then
|
ElseIf line.StartsWith("TASKID=") Then
|
||||||
Dim nVal As Integer? = GetVal(line, "TASKID")
|
Dim nVal As Integer? = GetVal(line, "TASKID")
|
||||||
taskId = (If(nVal IsNot Nothing, nVal.Value, 0))
|
taskId = (If(Not IsNothing(nVal), nVal.Value, 0))
|
||||||
ProcessResultAdd(ProcessResultList, ProcessResult.CreateTaskResult(cutId, taskId, nErr, sMsg, dRot), Bar)
|
ProcessResultAdd(ProcessResultList, ProcessResult.CreateTaskResult(cutId, taskId, nErr, sMsg, dRot), Bar)
|
||||||
ElseIf line.StartsWith("FALL=") Then
|
ElseIf line.StartsWith("FALL=") Then
|
||||||
Dim nVal As Integer? = GetVal(line, "FALL")
|
Dim nVal As Integer? = GetVal(line, "FALL")
|
||||||
nFall = (If(nVal IsNot Nothing, nVal.Value, 0))
|
nFall = (If(Not IsNothing(nVal), nVal.Value, 0))
|
||||||
ProcessResultList.Add(ProcessResult.CreateFallResult(cutId, nErr, sMsg, nFall))
|
ProcessResultList.Add(ProcessResult.CreateFallResult(cutId, nErr, sMsg, nFall))
|
||||||
ElseIf line.StartsWith("TIME=") Then
|
ElseIf line.StartsWith("TIME=") Then
|
||||||
Dim nVal As Integer? = GetVal(line, "TIME")
|
Dim nVal As Integer? = GetVal(line, "TIME")
|
||||||
nTotTime = (If(nVal IsNot Nothing, nVal.Value, 0))
|
nTotTime = (If(Not IsNothing(nVal), nVal.Value, 0))
|
||||||
ProcessResultList.Add(ProcessResult.CreateTimeResult(cutId, nTotTime))
|
ProcessResultList.Add(ProcessResult.CreateTimeResult(cutId, nTotTime))
|
||||||
'If Bar.nBarType = ProjectType.PROJ AndAlso Not IsNothing(currBTLPart) Then
|
'If Bar.nBarType = ProjectType.PROJ AndAlso Not IsNothing(currBTLPart) Then
|
||||||
' EgtSetInfo(currBTLPart.nPartId, If(Bar.nBarType = ProjectType.PROJ, ITG_PROJ_TIME, ITG_PROD_TIME), nTotTime, True)
|
' EgtSetInfo(currBTLPart.nPartId, If(Bar.nBarType = ProjectType.PROJ, ITG_PROJ_TIME, ITG_PROD_TIME), nTotTime, True)
|
||||||
@@ -216,23 +217,25 @@ Public Class CALCPanelVM
|
|||||||
End If
|
End If
|
||||||
Select Case Line.Type
|
Select Case Line.Type
|
||||||
Case ProcessResult.ProcessResultTypes.BAR
|
Case ProcessResult.ProcessResultTypes.BAR
|
||||||
CurrMachgroupVM.CalcMachGroupUpdate(Line.nERR, Line.dROT, Line.sMSG)
|
If Not IsNothing(CurrMachgroupVM) Then CurrMachgroupVM.CalcMachGroupUpdate(Line.nERR, Line.dROT, Line.sMSG)
|
||||||
Case ProcessResult.ProcessResultTypes.PART
|
Case ProcessResult.ProcessResultTypes.PART
|
||||||
CurrPartVM.CalcPartUpdate(Line.nERR, Line.dROT, Line.sMSG)
|
If Not IsNothing(CurrPartVM) Then CurrPartVM.CalcPartUpdate(Line.nERR, Line.dROT, Line.sMSG)
|
||||||
Case ProcessResult.ProcessResultTypes.TASKID
|
Case ProcessResult.ProcessResultTypes.TASKID
|
||||||
CurrBTLFeatureVM.CalcFeatureUpdate(Line.nERR, Line.dROT, Line.sMSG)
|
If Not IsNothing(CurrBTLFeatureVM) Then CurrBTLFeatureVM.CalcFeatureUpdate(Line.nERR, Line.dROT, Line.sMSG)
|
||||||
Case ProcessResult.ProcessResultTypes.FALL
|
Case ProcessResult.ProcessResultTypes.FALL
|
||||||
CurrPartVM.CalcFallUpdate(Line.nFALL)
|
If Not IsNothing(CurrPartVM) Then CurrPartVM.CalcFallUpdate(Line.nFALL)
|
||||||
Case ProcessResult.ProcessResultTypes.TIME
|
Case ProcessResult.ProcessResultTypes.TIME
|
||||||
If IsNothing(CurrMachgroupVM) Then CurrMachgroupVM = GetMachgroupVMFromMachgroupId(Bar.nBarId)
|
If IsNothing(CurrMachgroupVM) Then CurrMachgroupVM = GetMachgroupVMFromMachgroupId(Bar.nBarId)
|
||||||
CurrMachgroupVM.CalcTimeUpdate(Line.nTIME)
|
If Not IsNothing(CurrMachgroupVM) Then CurrMachgroupVM.CalcTimeUpdate(Line.nTIME)
|
||||||
End Select
|
End Select
|
||||||
Next
|
Next
|
||||||
Machgroup = GetMachgroupVMFromMachgroupId(Bar.nBarId)
|
Machgroup = GetMachgroupVMFromMachgroupId(Bar.nBarId)
|
||||||
For Each Part In Machgroup.PartVMList
|
If Not IsNothing(Machgroup) Then
|
||||||
Part.CalcGlobalUpdate()
|
For Each Part In Machgroup.PartVMList
|
||||||
Next
|
Part.CalcGlobalUpdate()
|
||||||
Machgroup.CalcGlobalUpdate()
|
Next
|
||||||
|
Machgroup.CalcGlobalUpdate()
|
||||||
|
End If
|
||||||
|
|
||||||
End If
|
End If
|
||||||
|
|
||||||
@@ -377,7 +380,8 @@ Public Class CALCPanelVM
|
|||||||
.nProgramPage = ProjectType.PROD,
|
.nProgramPage = ProjectType.PROD,
|
||||||
.nProjType = ProjType,
|
.nProjType = ProjType,
|
||||||
.bBarOk = True,
|
.bBarOk = True,
|
||||||
.nMachineName = MachineName}
|
.nMachineName = MachineName,
|
||||||
|
.nGlobState = MachGroup.nGlobalState}
|
||||||
Select Case MachGroup.nGlobalState
|
Select Case MachGroup.nGlobalState
|
||||||
Case Core.CalcStates.OK, Core.CalcStates.INFO
|
Case Core.CalcStates.OK, Core.CalcStates.INFO
|
||||||
Bar.nCmdType = CalcIntegration.CmdTypes.GENERATE
|
Bar.nCmdType = CalcIntegration.CmdTypes.GENERATE
|
||||||
@@ -500,7 +504,7 @@ Public Class CALCPanelVM
|
|||||||
.bBarOk = True,
|
.bBarOk = True,
|
||||||
.nMachineName = MachineName,
|
.nMachineName = MachineName,
|
||||||
.nCmdType = CalcIntegration.CmdTypes.SIMULATE}
|
.nCmdType = CalcIntegration.CmdTypes.SIMULATE}
|
||||||
If SelMachGroup.nGlobalState <> Core.CalcStates.OK Then
|
If SelMachGroup.nGlobalState = CalcStates.NOTCALCULATED Then
|
||||||
Dim sMachGroupFilePath As String = Map.refSupervisorManagerVM.CurrProd.sProdDirPath & "\" & SelMachGroup.Name.ToString() & ".ori.bwe"
|
Dim sMachGroupFilePath As String = Map.refSupervisorManagerVM.CurrProd.sProdDirPath & "\" & SelMachGroup.Name.ToString() & ".ori.bwe"
|
||||||
If File.Exists(sMachGroupFilePath) Then File.Delete(sMachGroupFilePath)
|
If File.Exists(sMachGroupFilePath) Then File.Delete(sMachGroupFilePath)
|
||||||
End If
|
End If
|
||||||
|
|||||||
@@ -474,7 +474,7 @@ Public Class NUMAxiumComm
|
|||||||
Friend Sub WriteNCVariables(Address As String, value As String)
|
Friend Sub WriteNCVariables(Address As String, value As String)
|
||||||
Try
|
Try
|
||||||
Dim dValue As Double = 0
|
Dim dValue As Double = 0
|
||||||
StringToDouble(value, dValue)
|
StringToDoubleAdv(value, dValue)
|
||||||
Dim rc As Short = objDVariables.WriteVariables(objDGroupManager.Handle, Address, value)
|
Dim rc As Short = objDVariables.WriteVariables(objDGroupManager.Handle, Address, value)
|
||||||
|
|
||||||
'If rc <> 0 Then EgtOutLog(" objDVariables.WriteVariables2() Error : " & rc)
|
'If rc <> 0 Then EgtOutLog(" objDVariables.WriteVariables2() Error : " & rc)
|
||||||
@@ -501,7 +501,9 @@ Public Class NUMAxiumComm
|
|||||||
|
|
||||||
Private Sub objDGeneralFunction_ProgramActivated(ByVal nerrorCode As Short)
|
Private Sub objDGeneralFunction_ProgramActivated(ByVal nerrorCode As Short)
|
||||||
EgtOutLog("Part program activated:" & " " & nerrorCode)
|
EgtOutLog("Part program activated:" & " " & nerrorCode)
|
||||||
DbControllers.m_LogMachineController.Create(MachLog.CreateResultLog(CommandTypes.SENDPROG, CommandStates.OK, ResultTypes.EXECUTED, "Part program activated:" & " " & nerrorCode))
|
'DbControllers.m_LogMachineController.Create(MachLog.CreateResultLog(CommandTypes.SENDPROG, CommandStates.OK, ResultTypes.EXECUTED, "Part program activated:" & " " & nerrorCode))
|
||||||
|
' scrivo evento programma attivato
|
||||||
|
DbControllers.m_LogMachineController.Create(LogEvent.CreateMachCommandLog(LogEvent.MachineCommands.PROGRAM_ACTIVATION, "", nerrorCode, DbControllers.SupervisorId))
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Sub objDGeneralFunction_OnCncStart(ByVal errorCode As Short)
|
Private Sub objDGeneralFunction_OnCncStart(ByVal errorCode As Short)
|
||||||
|
|||||||
@@ -255,11 +255,11 @@ Public Class NUMAxiumPcToolkitComm
|
|||||||
m_MachManaging.SetConnected(True)
|
m_MachManaging.SetConnected(True)
|
||||||
m_ResultCallbackDlg(CommandTypes.CONNECT, CommandStates.OK, ResultTypes.RESULT, "")
|
m_ResultCallbackDlg(CommandTypes.CONNECT, CommandStates.OK, ResultTypes.RESULT, "")
|
||||||
End If
|
End If
|
||||||
'''EgtOutLog("Activating program 9000")
|
'EgtOutLog("Activating program 9000")
|
||||||
|
|
||||||
' attivo programma main
|
' attivo programma main
|
||||||
Map.refMachManaging.Num_Axium_PCToolkit.ActivateProg(9000)
|
Map.refMachManaging.Num_Axium_PCToolkit.ActivateProg(9000)
|
||||||
'''EgtOutLog("Activated program 9000")
|
'EgtOutLog("Activated program 9000")
|
||||||
Return True
|
Return True
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
@@ -391,9 +391,11 @@ Public Class NUMAxiumPcToolkitComm
|
|||||||
nRes = WriteObjectVarious2(nPortFileTransfer, ACTIVE_PROG, PartProgramNumberActivate)
|
nRes = WriteObjectVarious2(nPortFileTransfer, ACTIVE_PROG, PartProgramNumberActivate)
|
||||||
If nRes <> 0 Then
|
If nRes <> 0 Then
|
||||||
EgtOutLog("Error Activate Program: " & nRes.ToString())
|
EgtOutLog("Error Activate Program: " & nRes.ToString())
|
||||||
Else
|
'Else
|
||||||
DbControllers.m_LogMachineController.Create(MachLog.CreateResultLog(CommandTypes.SENDPROG, CommandStates.OK, ResultTypes.EXECUTED, "Part program activated:" & " " & PartProgramNumberActivate))
|
' DbControllers.m_LogMachineController.Create(MachLog.CreateResultLog(CommandTypes.SENDPROG, CommandStates.OK, ResultTypes.EXECUTED, "Part program activated:" & " " & PartProgramNumberActivate))
|
||||||
End If
|
End If
|
||||||
|
' scrivo evento programma attivato
|
||||||
|
DbControllers.m_LogMachineController.Create(LogEvent.CreateMachCommandLog(LogEvent.MachineCommands.PROGRAM_ACTIVATION, PartProgramNumberActivate, nRes <> 0, DbControllers.SupervisorId))
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Sub ChangeChannel(Channel As Short)
|
Private Sub ChangeChannel(Channel As Short)
|
||||||
@@ -449,23 +451,23 @@ Public Class NUMAxiumPcToolkitComm
|
|||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Friend Sub CloseReadList()
|
Friend Sub CloseReadList()
|
||||||
'''objDPlcVariables.CloseReadList()
|
'objDPlcVariables.CloseReadList()
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Sub ReadVariablesOnce(Address As String)
|
Private Sub ReadVariablesOnce(Address As String)
|
||||||
'Dim _ReadSymbolicPlcVariableOnetime As String = "Application.IOCONFIG_GLOBALS.Flexium_NCK.RCNC.General.Mode"
|
'Dim _ReadSymbolicPlcVariableOnetime As String = "Application.IOCONFIG_GLOBALS.Flexium_NCK.RCNC.General.Mode"
|
||||||
'''Dim _FXReturn As Int16 = objDPlcVariables.ReadVariablesOnce(10, Address)
|
'Dim _FXReturn As Int16 = objDPlcVariables.ReadVariablesOnce(10, Address)
|
||||||
|
|
||||||
'''If _FXReturn <> 0 Then
|
'If _FXReturn <> 0 Then
|
||||||
''' EgtOutLog("Error ReadVariablesOnce:" & " " & _FXReturn.ToString())
|
' EgtOutLog("Error ReadVariablesOnce:" & " " & _FXReturn.ToString())
|
||||||
'''End If
|
'End If
|
||||||
|
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Friend Sub WritePlcVariables(Address As String, value As String)
|
Friend Sub WritePlcVariables(Address As String, value As String)
|
||||||
Try
|
Try
|
||||||
Dim dValue As Double = 0
|
Dim dValue As Double = 0
|
||||||
StringToDouble(value, dValue)
|
StringToDoubleAdv(value, dValue)
|
||||||
Select Case Address
|
Select Case Address
|
||||||
Case "E30099" ' in realta' per scrivere si usa la %RD0C.L
|
Case "E30099" ' in realta' per scrivere si usa la %RD0C.L
|
||||||
Dim nRes = WriteLadderVar(m_nPortWVariables, RL, &HD0C, 1, dValue)
|
Dim nRes = WriteLadderVar(m_nPortWVariables, RL, &HD0C, 1, dValue)
|
||||||
@@ -512,7 +514,7 @@ Public Class NUMAxiumPcToolkitComm
|
|||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Friend Sub CloseReadELS()
|
Friend Sub CloseReadELS()
|
||||||
'''objDPlcVariables.CloseReadList()
|
'objDPlcVariables.CloseReadList()
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Public Sub RefreshAllVars()
|
Public Sub RefreshAllVars()
|
||||||
@@ -574,11 +576,11 @@ Public Class NUMAxiumPcToolkitComm
|
|||||||
Case "%R3.2"
|
Case "%R3.2"
|
||||||
nRet = ReadLadderVar(nPortVariables, R2, &H3, 1, MyData, SYN)
|
nRet = ReadLadderVar(nPortVariables, R2, &H3, 1, MyData, SYN)
|
||||||
nRes = If(MyData.data(0) <> 0, 1, 0)
|
nRes = If(MyData.data(0) <> 0, 1, 0)
|
||||||
'''EgtOutLog("Variabile: " & Var.sAddress & "DVal: " & nRes & " Valore: " & MyData.data(0) & "," & MyData.data(1) & "," & MyData.data(2) & "," & MyData.data(3))
|
'EgtOutLog("Variabile: " & Var.sAddress & "DVal: " & nRes & " Valore: " & MyData.data(0) & "," & MyData.data(1) & "," & MyData.data(2) & "," & MyData.data(3))
|
||||||
Case "%R3.1"
|
Case "%R3.1"
|
||||||
nRet = ReadLadderVar(nPortVariables, R1, &H3, 1, MyData, SYN)
|
nRet = ReadLadderVar(nPortVariables, R1, &H3, 1, MyData, SYN)
|
||||||
nRes = If(MyData.data(0) <> 0, 1, 0)
|
nRes = If(MyData.data(0) <> 0, 1, 0)
|
||||||
'''EgtOutLog("Variabile: " & Var.sAddress & "DVal: " & nRes & " Valore: " & MyData.data(0) & "," & MyData.data(1) & "," & MyData.data(2) & "," & MyData.data(3))
|
'EgtOutLog("Variabile: " & Var.sAddress & "DVal: " & nRes & " Valore: " & MyData.data(0) & "," & MyData.data(1) & "," & MyData.data(2) & "," & MyData.data(3))
|
||||||
Case "%V800.L"
|
Case "%V800.L"
|
||||||
nRet = ReadLadderVar(nPortVariables, VL, &H800, 4, MyData, SYN)
|
nRet = ReadLadderVar(nPortVariables, VL, &H800, 4, MyData, SYN)
|
||||||
nRes = BitConverter.ToInt32(MyData.data, 0)
|
nRes = BitConverter.ToInt32(MyData.data, 0)
|
||||||
@@ -639,7 +641,6 @@ Public Class NUMAxiumPcToolkitComm
|
|||||||
Dim FileTransferThread As New Thread(Sub()
|
Dim FileTransferThread As New Thread(Sub()
|
||||||
' leggo variabile E30099
|
' leggo variabile E30099
|
||||||
Dim SendPermissionVariable As Variable = Map.refMachCommandMessagePanelVM.MainVariablesList.FirstOrDefault(Function(x) x.sName = SENDPERMISSION)
|
Dim SendPermissionVariable As Variable = Map.refMachCommandMessagePanelVM.MainVariablesList.FirstOrDefault(Function(x) x.sName = SENDPERMISSION)
|
||||||
Dim dTemp As Double = 0
|
|
||||||
Dim nSendPermission As Integer = 0
|
Dim nSendPermission As Integer = 0
|
||||||
EgtOutLog("Inizio invio programma")
|
EgtOutLog("Inizio invio programma")
|
||||||
While nSendPermission <> 2
|
While nSendPermission <> 2
|
||||||
@@ -647,8 +648,7 @@ Public Class NUMAxiumPcToolkitComm
|
|||||||
EgtOutLog("Inizio ciclo verifica diverso da 2")
|
EgtOutLog("Inizio ciclo verifica diverso da 2")
|
||||||
' leggo valore
|
' leggo valore
|
||||||
If Not IsNothing(SendPermissionVariable.sValue) Then
|
If Not IsNothing(SendPermissionVariable.sValue) Then
|
||||||
StringToDouble(SendPermissionVariable.sValue, dTemp)
|
Integer.TryParse(SendPermissionVariable.sValue, nSendPermission)
|
||||||
Integer.TryParse(dTemp, nSendPermission)
|
|
||||||
EgtOutLog("Lettura variabile E30099: " & nSendPermission)
|
EgtOutLog("Lettura variabile E30099: " & nSendPermission)
|
||||||
Else
|
Else
|
||||||
EgtOutLog("nSendPermission = -1")
|
EgtOutLog("nSendPermission = -1")
|
||||||
@@ -699,6 +699,12 @@ Public Class NUMAxiumPcToolkitComm
|
|||||||
Try
|
Try
|
||||||
ISONumVariable.sValue = SentMachGroup.Name
|
ISONumVariable.sValue = SentMachGroup.Name
|
||||||
ISOSentVariable.sValue = 0
|
ISOSentVariable.sValue = 0
|
||||||
|
'Dim TempISOSentVariable As Variable = Map.refMachCommandMessagePanelVM.MainVariablesList.FirstOrDefault(Function(x) x.sName = ISO_SENT)
|
||||||
|
'While ISOSentVariable.sValue <> "0"
|
||||||
|
' Threading.Thread.Sleep(100)
|
||||||
|
' EgtOutLog("Bloccato - Sent(80046): " & TempISOSentVariable.sValue & " Num(80045): " & ISONumVariable.sValue)
|
||||||
|
' TempISOSentVariable = Map.refMachCommandMessagePanelVM.MainVariablesList.FirstOrDefault(Function(x) x.sName = ISO_SENT)
|
||||||
|
'End While
|
||||||
SentMachGroup.SetSentToMachine(True)
|
SentMachGroup.SetSentToMachine(True)
|
||||||
Catch ex As Exception
|
Catch ex As Exception
|
||||||
EgtOutLog("Error write var after download: " & ex.Message)
|
EgtOutLog("Error write var after download: " & ex.Message)
|
||||||
@@ -708,6 +714,7 @@ Public Class NUMAxiumPcToolkitComm
|
|||||||
nRes = DownLoadFileAsyn(nPortFileTransfer, nFileType, sFilePath, DNC_MODE_ABORT, nIndex)
|
nRes = DownLoadFileAsyn(nPortFileTransfer, nFileType, sFilePath, DNC_MODE_ABORT, nIndex)
|
||||||
SendPermissionVariable.sValue = 0
|
SendPermissionVariable.sValue = 0
|
||||||
m_BytesTransferedCounter = 0
|
m_BytesTransferedCounter = 0
|
||||||
|
Threading.Thread.Sleep(1000)
|
||||||
m_bIsTransferActive = False
|
m_bIsTransferActive = False
|
||||||
Return
|
Return
|
||||||
End Sub)
|
End Sub)
|
||||||
@@ -789,7 +796,7 @@ Public Class NUMAxiumPcToolkitComm
|
|||||||
Friend Sub WriteNCVariables(Address As String, value As String)
|
Friend Sub WriteNCVariables(Address As String, value As String)
|
||||||
Try
|
Try
|
||||||
Dim dValue As Double = 0
|
Dim dValue As Double = 0
|
||||||
StringToDouble(value, dValue)
|
StringToDoubleAdv(value, dValue)
|
||||||
Dim nType As eVarious4
|
Dim nType As eVarious4
|
||||||
Dim nValue As Integer = 0
|
Dim nValue As Integer = 0
|
||||||
Dim MyData As New My_data_struct
|
Dim MyData As New My_data_struct
|
||||||
@@ -900,10 +907,11 @@ Public Class NUMAxiumPcToolkitComm
|
|||||||
Next
|
Next
|
||||||
|
|
||||||
For index As Integer = 0 To ErrorNumber.Count - 1
|
For index As Integer = 0 To ErrorNumber.Count - 1
|
||||||
|
Dim Ind As Integer = index
|
||||||
Dim NewMessageInList As ReadMessages = m_ReadFXMessages.FirstOrDefault(Function(x) x.CMsgCncNumber = 0.ToString() AndAlso
|
Dim NewMessageInList As ReadMessages = m_ReadFXMessages.FirstOrDefault(Function(x) x.CMsgCncNumber = 0.ToString() AndAlso
|
||||||
x.CMsgErrorType = 6.ToString() AndAlso
|
x.CMsgErrorType = 6.ToString() AndAlso
|
||||||
x.CMsgErrorIndex = "" AndAlso
|
x.CMsgErrorIndex = "" AndAlso
|
||||||
x.CMsgErrorNumber = ErrorNumber(index).ToString() AndAlso
|
x.CMsgErrorNumber = ErrorNumber(Ind).ToString() AndAlso
|
||||||
x.CMsgErrorLine = "" AndAlso
|
x.CMsgErrorLine = "" AndAlso
|
||||||
x.CMsgErrorMessage = "")
|
x.CMsgErrorMessage = "")
|
||||||
' se il messaggio e' gia' in lista
|
' se il messaggio e' gia' in lista
|
||||||
@@ -1113,9 +1121,9 @@ Public Class NUMAxiumPcToolkitComm
|
|||||||
Friend Sub ReadCncMode()
|
Friend Sub ReadCncMode()
|
||||||
Dim nRet As Short = -1
|
Dim nRet As Short = -1
|
||||||
Dim nMode As UInt16
|
Dim nMode As UInt16
|
||||||
'''EgtOutLog("Pre ReadObjectVarious2")
|
'EgtOutLog("Pre ReadObjectVarious2")
|
||||||
nRet = ReadObjectVarious2(nPortVariables, eVarious2.MODE, nMode, SYN)
|
nRet = ReadObjectVarious2(nPortVariables, eVarious2.MODE, nMode, SYN)
|
||||||
'''EgtOutLog("ReadObjectVarious2 Ret: " & nRet & " Mode: " & nMode)
|
'EgtOutLog("ReadObjectVarious2 Ret: " & nRet & " Mode: " & nMode)
|
||||||
If nRet <> 0 Then
|
If nRet <> 0 Then
|
||||||
EgtOutLog("Reading CncMode failed! Error: " & nRet)
|
EgtOutLog("Reading CncMode failed! Error: " & nRet)
|
||||||
Return
|
Return
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ Public Class NUMFlexiumComm
|
|||||||
Private m_ReadFXMessages As New List(Of ReadMessages)
|
Private m_ReadFXMessages As New List(Of ReadMessages)
|
||||||
Private m_ReadOperatorMessages As New List(Of ReadMessages)
|
Private m_ReadOperatorMessages As New List(Of ReadMessages)
|
||||||
' lista variabili in lettura
|
' lista variabili in lettura
|
||||||
Private Shared m_ReadingVars(100) As CommVar
|
Private Shared m_ReadingVars(230) As CommVar
|
||||||
Private m_BytesTransferedCounter As Integer
|
Private m_BytesTransferedCounter As Integer
|
||||||
Private m_LinearAxisPrecision As Integer
|
Private m_LinearAxisPrecision As Integer
|
||||||
|
|
||||||
@@ -368,6 +368,31 @@ Public Class NUMFlexiumComm
|
|||||||
|
|
||||||
Friend Sub FileDownload(sFileType As String, sFilePath As String)
|
Friend Sub FileDownload(sFileType As String, sFilePath As String)
|
||||||
Dim _Return_Download As Short
|
Dim _Return_Download As Short
|
||||||
|
'' leggo variabile E30099
|
||||||
|
'Dim SendPermissionVariable As Variable = Map.refMachCommandMessagePanelVM.MainVariablesList.FirstOrDefault(Function(x) x.sName = SENDPERMISSION)
|
||||||
|
'Dim dTemp As Double = 0
|
||||||
|
'Dim nSendPermission As Integer = 0
|
||||||
|
'EgtOutLog("Inizio invio programma")
|
||||||
|
'While nSendPermission <> 2
|
||||||
|
' Dim bFirstWriteOne = True
|
||||||
|
' EgtOutLog("Inizio ciclo verifica diverso da 2")
|
||||||
|
' ' leggo valore
|
||||||
|
' If Not IsNothing(SendPermissionVariable.sValue) Then
|
||||||
|
' StringToDoubleAdv(SendPermissionVariable.sValue, dTemp)
|
||||||
|
' Integer.TryParse(dTemp, nSendPermission)
|
||||||
|
' EgtOutLog("Lettura variabile E30099: " & nSendPermission)
|
||||||
|
' Else
|
||||||
|
' EgtOutLog("nSendPermission = -1")
|
||||||
|
' nSendPermission = -1
|
||||||
|
' End If
|
||||||
|
' ' se uguale a zero ci scrivo uno
|
||||||
|
' If nSendPermission = 0 And bFirstWriteOne Then
|
||||||
|
' bFirstWriteOne = False
|
||||||
|
' SendPermissionVariable.sValue = 1
|
||||||
|
' EgtOutLog("Scrittura variabile E30099 = 1")
|
||||||
|
' End If
|
||||||
|
' Threading.Thread.Sleep(1000)
|
||||||
|
'End While
|
||||||
|
|
||||||
_Return_Download = objDFileTransfer.FileDownload2(10, sFileType, sFilePath, "", 1, 0)
|
_Return_Download = objDFileTransfer.FileDownload2(10, sFileType, sFilePath, "", 1, 0)
|
||||||
|
|
||||||
@@ -424,7 +449,7 @@ Public Class NUMFlexiumComm
|
|||||||
Friend Sub WriteNCVariables(Address As String, value As String)
|
Friend Sub WriteNCVariables(Address As String, value As String)
|
||||||
Try
|
Try
|
||||||
Dim dValue As Double = 0
|
Dim dValue As Double = 0
|
||||||
StringToDouble(value, dValue)
|
StringToDoubleAdv(value, dValue)
|
||||||
Dim rc As Short = objDVariables.WriteVariables2(2, objDGroupManager.Handle, Address, dValue)
|
Dim rc As Short = objDVariables.WriteVariables2(2, objDGroupManager.Handle, Address, dValue)
|
||||||
|
|
||||||
If rc <> 0 Then EgtOutLog(" objDVariables.WriteVariables2() Error : " & rc)
|
If rc <> 0 Then EgtOutLog(" objDVariables.WriteVariables2() Error : " & rc)
|
||||||
@@ -451,7 +476,9 @@ Public Class NUMFlexiumComm
|
|||||||
|
|
||||||
Private Sub objDGeneralFunction_ProgramActivated(ByVal nerrorCode As Short)
|
Private Sub objDGeneralFunction_ProgramActivated(ByVal nerrorCode As Short)
|
||||||
EgtOutLog("Part program activated:" & " " & nerrorCode)
|
EgtOutLog("Part program activated:" & " " & nerrorCode)
|
||||||
DbControllers.m_LogMachineController.Create(MachLog.CreateResultLog(CommandTypes.SENDPROG, CommandStates.OK, ResultTypes.EXECUTED, "Part program activated:" & " " & nerrorCode))
|
'DbControllers.m_LogMachineController.Create(MachLog.CreateResultLog(CommandTypes.SENDPROG, CommandStates.OK, ResultTypes.EXECUTED, "Part program activated:" & " " & nerrorCode))
|
||||||
|
' scrivo evento programma attivato
|
||||||
|
DbControllers.m_LogMachineController.Create(LogEvent.CreateMachCommandLog(LogEvent.MachineCommands.PROGRAM_ACTIVATION, "", nerrorCode, DbControllers.SupervisorId))
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Sub objDGeneralFunction_OnCncStart(ByVal errorCode As Short)
|
Private Sub objDGeneralFunction_OnCncStart(ByVal errorCode As Short)
|
||||||
|
|||||||
@@ -3,5 +3,7 @@
|
|||||||
Public Const MDI_MSG As String = "MDI"
|
Public Const MDI_MSG As String = "MDI"
|
||||||
Public Const PLC_MSG As String = "PLC"
|
Public Const PLC_MSG As String = "PLC"
|
||||||
Public Const CNC_MSG As String = "CNC"
|
Public Const CNC_MSG As String = "CNC"
|
||||||
|
Public Const INPUT_MSG As String = "INPUT"
|
||||||
|
Public Const OUTPUT_MSG As String = "OUTPUT"
|
||||||
|
|
||||||
End Module
|
End Module
|
||||||
|
|||||||
@@ -99,6 +99,41 @@
|
|||||||
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
||||||
<Prefer32Bit>false</Prefer32Bit>
|
<Prefer32Bit>false</Prefer32Bit>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
<PropertyGroup>
|
||||||
|
<ApplicationManifest>app.manifest</ApplicationManifest>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'RemoteDebug|AnyCPU'">
|
||||||
|
<DebugSymbols>true</DebugSymbols>
|
||||||
|
<DefineDebug>true</DefineDebug>
|
||||||
|
<DefineTrace>true</DefineTrace>
|
||||||
|
<OutputPath>bin\RemoteDebug\</OutputPath>
|
||||||
|
<DocumentationFile>EgtBEAMWALL.Supervisor.xml</DocumentationFile>
|
||||||
|
<NoWarn>41999,42016,42017,42018,42019,42020,42021,42022,42032,42036,42314</NoWarn>
|
||||||
|
<DebugType>full</DebugType>
|
||||||
|
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'RemoteDebug|x64'">
|
||||||
|
<DebugSymbols>true</DebugSymbols>
|
||||||
|
<DefineDebug>true</DefineDebug>
|
||||||
|
<DefineTrace>true</DefineTrace>
|
||||||
|
<OutputPath>bin\x64\RemoteDebug\</OutputPath>
|
||||||
|
<DocumentationFile>EgtBEAMWALL.Supervisor.xml</DocumentationFile>
|
||||||
|
<NoWarn>41999,42016,42017,42018,42019,42020,42021,42022,42032,42036,42314</NoWarn>
|
||||||
|
<DebugType>full</DebugType>
|
||||||
|
<PlatformTarget>x64</PlatformTarget>
|
||||||
|
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'RemoteDebug|x86'">
|
||||||
|
<DebugSymbols>true</DebugSymbols>
|
||||||
|
<DefineDebug>true</DefineDebug>
|
||||||
|
<DefineTrace>true</DefineTrace>
|
||||||
|
<OutputPath>bin\x86\RemoteDebug\</OutputPath>
|
||||||
|
<DocumentationFile>EgtBEAMWALL.Supervisor.xml</DocumentationFile>
|
||||||
|
<NoWarn>41999,42016,42017,42018,42019,42020,42021,42022,42032,42036,42314</NoWarn>
|
||||||
|
<DebugType>full</DebugType>
|
||||||
|
<PlatformTarget>x86</PlatformTarget>
|
||||||
|
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
||||||
|
</PropertyGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Reference Include="APLog">
|
<Reference Include="APLog">
|
||||||
<HintPath>..\ExtLibs\APLog.dll</HintPath>
|
<HintPath>..\ExtLibs\APLog.dll</HintPath>
|
||||||
@@ -108,8 +143,8 @@
|
|||||||
<HintPath>..\ExtLibs\APServer.dll</HintPath>
|
<HintPath>..\ExtLibs\APServer.dll</HintPath>
|
||||||
<EmbedInteropTypes>True</EmbedInteropTypes>
|
<EmbedInteropTypes>True</EmbedInteropTypes>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="BouncyCastle.Crypto, Version=1.8.5.0, Culture=neutral, PublicKeyToken=0e99375e54769942">
|
<Reference Include="BouncyCastle.Crypto, Version=1.9.0.0, Culture=neutral, PublicKeyToken=0e99375e54769942, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\BouncyCastle.1.8.5\lib\BouncyCastle.Crypto.dll</HintPath>
|
<HintPath>..\packages\Portable.BouncyCastle.1.9.0\lib\net40\BouncyCastle.Crypto.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="Csv, Version=1.0.31.0, Culture=neutral, processorArchitecture=MSIL">
|
<Reference Include="Csv, Version=1.0.31.0, Culture=neutral, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\Csv.1.0.31\lib\net40\Csv.dll</HintPath>
|
<HintPath>..\packages\Csv.1.0.31\lib\net40\Csv.dll</HintPath>
|
||||||
@@ -131,8 +166,8 @@
|
|||||||
<Reference Include="FluentFTP, Version=19.2.2.0, Culture=neutral, PublicKeyToken=f4af092b1d8df44f, processorArchitecture=MSIL">
|
<Reference Include="FluentFTP, Version=19.2.2.0, Culture=neutral, PublicKeyToken=f4af092b1d8df44f, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\FluentFTP.19.2.2\lib\net45\FluentFTP.dll</HintPath>
|
<HintPath>..\packages\FluentFTP.19.2.2\lib\net45\FluentFTP.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="Google.Protobuf, Version=3.19.4.0, Culture=neutral, PublicKeyToken=a7d26565bac4d604, processorArchitecture=MSIL">
|
<Reference Include="Google.Protobuf, Version=3.21.9.0, Culture=neutral, PublicKeyToken=a7d26565bac4d604, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\Google.Protobuf.3.19.4\lib\net45\Google.Protobuf.dll</HintPath>
|
<HintPath>..\packages\Google.Protobuf.3.21.9\lib\net45\Google.Protobuf.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="Interop.FXLog">
|
<Reference Include="Interop.FXLog">
|
||||||
<HintPath>..\ExtLibs\Interop.FXLog.dll</HintPath>
|
<HintPath>..\ExtLibs\Interop.FXLog.dll</HintPath>
|
||||||
@@ -148,14 +183,14 @@
|
|||||||
<Reference Include="ISOCNC.Remoting">
|
<Reference Include="ISOCNC.Remoting">
|
||||||
<HintPath>..\ExtLibs\ISOCNC.Remoting.dll</HintPath>
|
<HintPath>..\ExtLibs\ISOCNC.Remoting.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="K4os.Compression.LZ4, Version=1.2.6.0, Culture=neutral, PublicKeyToken=2186fa9121ef231d, processorArchitecture=MSIL">
|
<Reference Include="K4os.Compression.LZ4, Version=1.3.5.0, Culture=neutral, PublicKeyToken=2186fa9121ef231d, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\K4os.Compression.LZ4.1.2.6\lib\net46\K4os.Compression.LZ4.dll</HintPath>
|
<HintPath>..\packages\K4os.Compression.LZ4.1.3.5\lib\net462\K4os.Compression.LZ4.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="K4os.Compression.LZ4.Streams, Version=1.2.6.0, Culture=neutral, PublicKeyToken=2186fa9121ef231d, processorArchitecture=MSIL">
|
<Reference Include="K4os.Compression.LZ4.Streams, Version=1.3.5.0, Culture=neutral, PublicKeyToken=2186fa9121ef231d, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\K4os.Compression.LZ4.Streams.1.2.6\lib\net46\K4os.Compression.LZ4.Streams.dll</HintPath>
|
<HintPath>..\packages\K4os.Compression.LZ4.Streams.1.3.5\lib\net462\K4os.Compression.LZ4.Streams.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="K4os.Hash.xxHash, Version=1.0.6.0, Culture=neutral, PublicKeyToken=32cd54395057cec3, processorArchitecture=MSIL">
|
<Reference Include="K4os.Hash.xxHash, Version=1.0.8.0, Culture=neutral, PublicKeyToken=32cd54395057cec3, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\K4os.Hash.xxHash.1.0.6\lib\net46\K4os.Hash.xxHash.dll</HintPath>
|
<HintPath>..\packages\K4os.Hash.xxHash.1.0.8\lib\net462\K4os.Hash.xxHash.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="Microsoft.CSharp" />
|
<Reference Include="Microsoft.CSharp" />
|
||||||
<Reference Include="Microsoft.DotNet.PlatformAbstractions, Version=2.1.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
|
<Reference Include="Microsoft.DotNet.PlatformAbstractions, Version=2.1.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
|
||||||
@@ -207,9 +242,12 @@
|
|||||||
<Reference Include="System.Drawing" />
|
<Reference Include="System.Drawing" />
|
||||||
<Reference Include="System.Drawing.Design" />
|
<Reference Include="System.Drawing.Design" />
|
||||||
<Reference Include="System.IO.Compression" />
|
<Reference Include="System.IO.Compression" />
|
||||||
|
<Reference Include="System.IO.Pipelines, Version=5.0.0.2, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\packages\System.IO.Pipelines.5.0.2\lib\net461\System.IO.Pipelines.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
<Reference Include="System.Management" />
|
<Reference Include="System.Management" />
|
||||||
<Reference Include="System.Memory, Version=4.0.1.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
<Reference Include="System.Memory, Version=4.0.1.2, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\System.Memory.4.5.4\lib\net461\System.Memory.dll</HintPath>
|
<HintPath>..\packages\System.Memory.4.5.5\lib\net461\System.Memory.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="System.Net.NameResolution, Version=4.0.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
<Reference Include="System.Net.NameResolution, Version=4.0.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\System.Net.NameResolution.4.3.0\lib\net46\System.Net.NameResolution.dll</HintPath>
|
<HintPath>..\packages\System.Net.NameResolution.4.3.0\lib\net46\System.Net.NameResolution.dll</HintPath>
|
||||||
@@ -225,8 +263,8 @@
|
|||||||
<Reference Include="System.Numerics.Vectors, Version=4.1.4.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
<Reference Include="System.Numerics.Vectors, Version=4.1.4.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\System.Numerics.Vectors.4.5.0\lib\net46\System.Numerics.Vectors.dll</HintPath>
|
<HintPath>..\packages\System.Numerics.Vectors.4.5.0\lib\net46\System.Numerics.Vectors.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="System.Runtime.CompilerServices.Unsafe, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
<Reference Include="System.Runtime.CompilerServices.Unsafe, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\System.Runtime.CompilerServices.Unsafe.5.0.0\lib\net45\System.Runtime.CompilerServices.Unsafe.dll</HintPath>
|
<HintPath>..\packages\System.Runtime.CompilerServices.Unsafe.6.0.0\lib\net461\System.Runtime.CompilerServices.Unsafe.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="System.Runtime.InteropServices.RuntimeInformation, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
<Reference Include="System.Runtime.InteropServices.RuntimeInformation, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\System.Runtime.InteropServices.RuntimeInformation.4.0.0\lib\net45\System.Runtime.InteropServices.RuntimeInformation.dll</HintPath>
|
<HintPath>..\packages\System.Runtime.InteropServices.RuntimeInformation.4.0.0\lib\net45\System.Runtime.InteropServices.RuntimeInformation.dll</HintPath>
|
||||||
@@ -235,6 +273,9 @@
|
|||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="System.Runtime.Remoting" />
|
<Reference Include="System.Runtime.Remoting" />
|
||||||
<Reference Include="System.Security" />
|
<Reference Include="System.Security" />
|
||||||
|
<Reference Include="System.Threading.Tasks.Extensions, Version=4.2.0.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\packages\System.Threading.Tasks.Extensions.4.5.4\lib\net461\System.Threading.Tasks.Extensions.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
<Reference Include="System.Transactions" />
|
<Reference Include="System.Transactions" />
|
||||||
<Reference Include="System.Web" />
|
<Reference Include="System.Web" />
|
||||||
<Reference Include="System.Windows.Forms" />
|
<Reference Include="System.Windows.Forms" />
|
||||||
@@ -543,6 +584,7 @@
|
|||||||
<CustomToolNamespace>My.Resources</CustomToolNamespace>
|
<CustomToolNamespace>My.Resources</CustomToolNamespace>
|
||||||
</EmbeddedResource>
|
</EmbeddedResource>
|
||||||
<None Include="app.config" />
|
<None Include="app.config" />
|
||||||
|
<None Include="app.manifest" />
|
||||||
<None Include="My Project\Settings.settings">
|
<None Include="My Project\Settings.settings">
|
||||||
<Generator>SettingsSingleFileGenerator</Generator>
|
<Generator>SettingsSingleFileGenerator</Generator>
|
||||||
<LastGenOutput>Settings.Designer.vb</LastGenOutput>
|
<LastGenOutput>Settings.Designer.vb</LastGenOutput>
|
||||||
|
|||||||
@@ -81,6 +81,13 @@
|
|||||||
RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:RawPartListV}}}"/>
|
RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:RawPartListV}}}"/>
|
||||||
</DataGridTextColumn.Header>
|
</DataGridTextColumn.Header>
|
||||||
</DataGridTextColumn>
|
</DataGridTextColumn>
|
||||||
|
<!--PosZ - Posizione in Z-->
|
||||||
|
<DataGridTextColumn x:Key="colPOSZ" Binding="{Binding sPosZ}">
|
||||||
|
<DataGridTextColumn.Header>
|
||||||
|
<TextBlock Text="{Binding Path=DataContext.PosZ_Msg,
|
||||||
|
RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:RawPartListV}}}"/>
|
||||||
|
</DataGridTextColumn.Header>
|
||||||
|
</DataGridTextColumn>
|
||||||
<!--MAT - Materiale-->
|
<!--MAT - Materiale-->
|
||||||
<DataGridTextColumn x:Key="colMATERIAL" Binding="{Binding sMATERIAL}">
|
<DataGridTextColumn x:Key="colMATERIAL" Binding="{Binding sMATERIAL}">
|
||||||
<DataGridTextColumn.Header>
|
<DataGridTextColumn.Header>
|
||||||
|
|||||||
@@ -13,6 +13,13 @@ Public Class RawPartListVM
|
|||||||
End Get
|
End Get
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
|
Private m_colRawPart_PosZ As EgtDataGridColumn
|
||||||
|
Public ReadOnly Property colRawPart_PosZ As EgtDataGridColumn
|
||||||
|
Get
|
||||||
|
Return m_colRawPart_PosZ
|
||||||
|
End Get
|
||||||
|
End Property
|
||||||
|
|
||||||
Private m_RawPartColumns As New ObservableCollection(Of EgtDataGridColumn)
|
Private m_RawPartColumns As New ObservableCollection(Of EgtDataGridColumn)
|
||||||
Public Property RawPartColumns As ObservableCollection(Of EgtDataGridColumn)
|
Public Property RawPartColumns As ObservableCollection(Of EgtDataGridColumn)
|
||||||
Get
|
Get
|
||||||
@@ -55,6 +62,12 @@ Public Class RawPartListVM
|
|||||||
End Get
|
End Get
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
|
Public ReadOnly Property PosZ_Msg As String
|
||||||
|
Get
|
||||||
|
Return EgtMsg(61728)
|
||||||
|
End Get
|
||||||
|
End Property
|
||||||
|
|
||||||
Public ReadOnly Property Material_Msg As String
|
Public ReadOnly Property Material_Msg As String
|
||||||
Get
|
Get
|
||||||
Return EgtMsg(61607)
|
Return EgtMsg(61607)
|
||||||
@@ -84,23 +97,27 @@ Public Class RawPartListVM
|
|||||||
Map.SetRefRawPartListVM(Me)
|
Map.SetRefRawPartListVM(Me)
|
||||||
' carico le colonne della datagrid
|
' carico le colonne della datagrid
|
||||||
GetPrivateProfileColumns(S_RAWPARTLIST_SUPERVISOR, RawPartColumns)
|
GetPrivateProfileColumns(S_RAWPARTLIST_SUPERVISOR, RawPartColumns)
|
||||||
' recupero riferimento a colonna StartCut
|
' recupero riferimento a colonna StartCut e PosZ
|
||||||
m_colRawPart_StartCut = m_RawPartColumns.FirstOrDefault(Function(x) x.Name = COL_STARTCUT)
|
m_colRawPart_StartCut = m_RawPartColumns.FirstOrDefault(Function(x) x.Name = COL_STARTCUT)
|
||||||
|
m_colRawPart_PosZ = m_RawPartColumns.FirstOrDefault(Function(x) x.Name = COL_POSZ)
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
#End Region ' CONSTRUCTOR
|
#End Region ' CONSTRUCTOR
|
||||||
|
|
||||||
Friend Sub UpdateColumns(nMachType As MachineType)
|
Friend Sub UpdateColumns(nMachType As MachineType)
|
||||||
If nMachType = MachineType.BEAM Then
|
If nMachType = MachineType.BEAM Then
|
||||||
If Not IsNothing(m_colRawPart_StartCut) Then
|
|
||||||
m_colRawPart_StartCut.ColumnVisibility = Visibility.Visible
|
|
||||||
End If
|
|
||||||
'RawPartColumns.Clear()
|
|
||||||
'GetPrivateProfileColumns(S_RAWPARTLIST_BEAM, RawPartColumns)
|
|
||||||
' aggiorno la visibilità delle colonne
|
' aggiorno la visibilità delle colonne
|
||||||
For Each col In RawPartColumns
|
For Each col In RawPartColumns
|
||||||
col.ColumnVisibility = If(col.Visible, Visibility.Visible, Visibility.Collapsed)
|
col.ColumnVisibility = If(col.Visible, Visibility.Visible, Visibility.Collapsed)
|
||||||
Next
|
Next
|
||||||
|
If Not IsNothing(m_colRawPart_StartCut) Then
|
||||||
|
m_colRawPart_StartCut.ColumnVisibility = Visibility.Visible
|
||||||
|
End If
|
||||||
|
If Not IsNothing(m_colRawPart_PosZ) Then
|
||||||
|
m_colRawPart_PosZ.ColumnVisibility = Visibility.Collapsed
|
||||||
|
End If
|
||||||
|
'RawPartColumns.Clear()
|
||||||
|
'GetPrivateProfileColumns(S_RAWPARTLIST_BEAM, RawPartColumns)
|
||||||
ElseIf nMachType = MachineType.WALL Then
|
ElseIf nMachType = MachineType.WALL Then
|
||||||
' aggiorno la visibilità delle colonne
|
' aggiorno la visibilità delle colonne
|
||||||
For Each col In RawPartColumns
|
For Each col In RawPartColumns
|
||||||
@@ -109,6 +126,9 @@ Public Class RawPartListVM
|
|||||||
If Not IsNothing(m_colRawPart_StartCut) Then
|
If Not IsNothing(m_colRawPart_StartCut) Then
|
||||||
m_colRawPart_StartCut.ColumnVisibility = Visibility.Collapsed
|
m_colRawPart_StartCut.ColumnVisibility = Visibility.Collapsed
|
||||||
End If
|
End If
|
||||||
|
If Not IsNothing(m_colRawPart_PosZ) Then
|
||||||
|
m_colRawPart_PosZ.ColumnVisibility = Visibility.Visible
|
||||||
|
End If
|
||||||
'RawPartColumns.Clear()
|
'RawPartColumns.Clear()
|
||||||
'GetPrivateProfileColumns(S_RAWPARTLIST_WALL, RawPartColumns)
|
'GetPrivateProfileColumns(S_RAWPARTLIST_WALL, RawPartColumns)
|
||||||
End If
|
End If
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
Imports System.Collections.ObjectModel
|
Imports System.Collections.ObjectModel
|
||||||
|
Imports System.Globalization
|
||||||
Imports System.IO
|
Imports System.IO
|
||||||
Imports System.Windows.Threading
|
Imports System.Windows.Threading
|
||||||
Imports EgtBEAMWALL.Core
|
Imports EgtBEAMWALL.Core
|
||||||
@@ -39,7 +40,7 @@ Public Class LeftPanelVM
|
|||||||
Return m_SelChannel
|
Return m_SelChannel
|
||||||
End Get
|
End Get
|
||||||
Set(ByVal value As IdNameStruct)
|
Set(ByVal value As IdNameStruct)
|
||||||
MachManaging.CommandList.Add(ThreadCommand.CreateCommand(CommandTypes.SETCHANNEL, value.Id))
|
MachManaging.AddToCommandList(ThreadCommand.CreateCommand(CommandTypes.SETCHANNEL, value.Id))
|
||||||
m_SelChannel = value
|
m_SelChannel = value
|
||||||
End Set
|
End Set
|
||||||
End Property
|
End Property
|
||||||
@@ -85,7 +86,7 @@ Public Class LeftPanelVM
|
|||||||
Return m_SelOPMode
|
Return m_SelOPMode
|
||||||
End Get
|
End Get
|
||||||
Set(ByVal value As OPState)
|
Set(ByVal value As OPState)
|
||||||
MachManaging.CommandList.Add(ThreadCommand.CreateCommand(CommandTypes.SETOPMODE, value.Id))
|
MachManaging.AddToCommandList(ThreadCommand.CreateCommand(CommandTypes.SETOPMODE, value.Id))
|
||||||
' se MDI
|
' se MDI
|
||||||
If value.Id = OPModes.Mdi Then
|
If value.Id = OPModes.Mdi Then
|
||||||
' mostro pagina comandi MDI
|
' mostro pagina comandi MDI
|
||||||
@@ -810,6 +811,8 @@ Public Class LeftPanelVM
|
|||||||
DbControllers.m_PartController.UpdateStatus(Map.refSupervisorManagerVM.CurrProd.nProdId, MachGroup.Id, Part.nPartId, ItemState.WIP)
|
DbControllers.m_PartController.UpdateStatus(Map.refSupervisorManagerVM.CurrProd.nProdId, MachGroup.Id, Part.nPartId, ItemState.WIP)
|
||||||
Part.dtStartTime = Time
|
Part.dtStartTime = Time
|
||||||
Part.nProduction_State = ItemState.WIP
|
Part.nProduction_State = ItemState.WIP
|
||||||
|
' scrivo evento inizio pezzo su DB
|
||||||
|
DbControllers.m_LogMachineController.Create(LogEvent.CreatePartStateLog(Time - TimeSpan.FromSeconds(1), Map.refSupervisorManagerVM.CurrProd.nProdId, MachGroup.Id, Part.nPartId, 1, DbControllers.SupervisorId))
|
||||||
' se e' il primo ad essere lavorato
|
' se e' il primo ad essere lavorato
|
||||||
If Not MachGroup.PartVMList.Any(Function(x) x IsNot Part AndAlso x.dtStartTime > DateTime.MinValue) Then
|
If Not MachGroup.PartVMList.Any(Function(x) x IsNot Part AndAlso x.dtStartTime > DateTime.MinValue) Then
|
||||||
' se non e' gia' in coda per essere prodotto
|
' se non e' gia' in coda per essere prodotto
|
||||||
@@ -837,6 +840,8 @@ Public Class LeftPanelVM
|
|||||||
MachGroup.dtStartTime = Time
|
MachGroup.dtStartTime = Time
|
||||||
MachGroup.nProduction_State = ItemState.WIP
|
MachGroup.nProduction_State = ItemState.WIP
|
||||||
MachGroup.NotifyPropertyChanged(NameOf(MachGroup.Production_Background))
|
MachGroup.NotifyPropertyChanged(NameOf(MachGroup.Production_Background))
|
||||||
|
' scrivo evento inizio MachGroup su DB
|
||||||
|
DbControllers.m_LogMachineController.Create(LogEvent.CreateMachGroupStateLog(Time - TimeSpan.FromSeconds(1), Map.refSupervisorManagerVM.CurrProd.nProdId, MachGroup.Id, 1, DbControllers.SupervisorId))
|
||||||
' blocco produzione di tutti gli altri perche' iniziato questo
|
' blocco produzione di tutti gli altri perche' iniziato questo
|
||||||
MyMachGroupVM.UpdateProduceIsEnabledForAll()
|
MyMachGroupVM.UpdateProduceIsEnabledForAll()
|
||||||
End If
|
End If
|
||||||
@@ -846,6 +851,8 @@ Public Class LeftPanelVM
|
|||||||
DbControllers.m_PartController.UpdateStatus(Map.refSupervisorManagerVM.CurrProd.nProdId, MachGroup.Id, Part.nPartId, ItemState.Produced)
|
DbControllers.m_PartController.UpdateStatus(Map.refSupervisorManagerVM.CurrProd.nProdId, MachGroup.Id, Part.nPartId, ItemState.Produced)
|
||||||
Part.dtEndTime = Time
|
Part.dtEndTime = Time
|
||||||
Part.nProduction_State = ItemState.Produced
|
Part.nProduction_State = ItemState.Produced
|
||||||
|
' scrivo evento fine pezzo su DB
|
||||||
|
DbControllers.m_LogMachineController.Create(LogEvent.CreatePartStateLog(Time, Map.refSupervisorManagerVM.CurrProd.nProdId, MachGroup.Id, Part.nPartId, 2, DbControllers.SupervisorId))
|
||||||
If MachGroup.PartVMList.All(Function(x) x.nProduction_State >= ItemState.Produced) Then
|
If MachGroup.PartVMList.All(Function(x) x.nProduction_State >= ItemState.Produced) Then
|
||||||
'aggiorno anche fine MachGroup
|
'aggiorno anche fine MachGroup
|
||||||
DbControllers.m_MachGroupController.UpdateEnd(Map.refSupervisorManagerVM.CurrProd.nProdId, MachGroup.Id, Time)
|
DbControllers.m_MachGroupController.UpdateEnd(Map.refSupervisorManagerVM.CurrProd.nProdId, MachGroup.Id, Time)
|
||||||
@@ -861,6 +868,8 @@ Public Class LeftPanelVM
|
|||||||
NotifyPropertyChanged(NameOf(DoneRawPart_IsEnabled))
|
NotifyPropertyChanged(NameOf(DoneRawPart_IsEnabled))
|
||||||
NotifyPropertyChanged(NameOf(MoveRawPart_IsEnabled))
|
NotifyPropertyChanged(NameOf(MoveRawPart_IsEnabled))
|
||||||
NotifyPropertyChanged(NameOf(ResetRawPart_IsEnabled))
|
NotifyPropertyChanged(NameOf(ResetRawPart_IsEnabled))
|
||||||
|
' scrivo evento fine MachGroup su DB
|
||||||
|
DbControllers.m_LogMachineController.Create(LogEvent.CreateMachGroupStateLog(Time, Map.refSupervisorManagerVM.CurrProd.nProdId, MachGroup.Id, 2, DbControllers.SupervisorId))
|
||||||
' se avanzamento singolo, sblocco produzione di tutti gli altri
|
' se avanzamento singolo, sblocco produzione di tutti gli altri
|
||||||
If CurrentMachine.Flow = FlowTypes.ONEBYONE Then
|
If CurrentMachine.Flow = FlowTypes.ONEBYONE Then
|
||||||
MyMachGroupVM.UpdateProduceIsEnabledForAll()
|
MyMachGroupVM.UpdateProduceIsEnabledForAll()
|
||||||
@@ -995,14 +1004,48 @@ Public Class LeftPanelVM
|
|||||||
|
|
||||||
Private Sub CreateDataFile(sFilePath As String, SelPart As PartVM, SelMachGroup As MyMachGroupVM)
|
Private Sub CreateDataFile(sFilePath As String, SelPart As PartVM, SelMachGroup As MyMachGroupVM)
|
||||||
Dim sFileText As New List(Of String)
|
Dim sFileText As New List(Of String)
|
||||||
|
Dim nBtlInfoId As Integer = EgtGetFirstNameInGroup(GDB_ID.ROOT, BTLINFO)
|
||||||
|
Dim sInfo As String = ""
|
||||||
|
Dim bOk As Boolean = False
|
||||||
' inserisco il capitolo del [Main]
|
' inserisco il capitolo del [Main]
|
||||||
sFileText.Add("[Main]")
|
sFileText.Add("[Main]")
|
||||||
sFileText.Add("Var1=$PRODID$," & Map.refSupervisorManagerVM.CurrProd.sProdId)
|
sFileText.Add("Var1=$PRODID$," & Map.refSupervisorManagerVM.CurrProd.sProdId)
|
||||||
sFileText.Add("Var2=$MACHGROUPID$," & SelMachGroup.Id)
|
sFileText.Add("Var2=$MACHGROUPID$," & SelMachGroup.nName)
|
||||||
sFileText.Add("Var3=$PARTID$," & SelPart.nPDN)
|
sFileText.Add("Var3=$PARTID$," & SelPart.nPDN)
|
||||||
sFileText.Add("Var4=$MATERIAL$," & SelPart.sMATERIAL)
|
sFileText.Add("Var4=$MATERIAL$," & SelPart.sMATERIAL)
|
||||||
'sFileText.Add("Var5=$Thickness$," & SelPart.Thickness)
|
bOk = EgtGetInfo(nBtlInfoId, BTL_GEN_PROJNUM, sInfo)
|
||||||
'sFileText.Add("Var6=$Storage$," & SelPart.WarehousePosition)
|
sFileText.Add("Var5=$PROJECTNUMBER$," & If(bOk, sInfo, ""))
|
||||||
|
bOk = EgtGetInfo(nBtlInfoId, BTL_GEN_PROJNAME, sInfo)
|
||||||
|
sFileText.Add("Var6=$PROJECTNAME$," & If(bOk, sInfo, ""))
|
||||||
|
bOk = EgtGetInfo(nBtlInfoId, BTL_GEN_CUSTOMER, sInfo)
|
||||||
|
sFileText.Add("Var7=$CUSTOMER$," & If(bOk, sInfo, ""))
|
||||||
|
bOk = EgtGetInfo(SelPart.nPartId, BTL_PRT_ASSEMBLYNUM, sInfo)
|
||||||
|
sFileText.Add("Var8=$ASSEMBLYNUMBER$," & If(bOk, sInfo, ""))
|
||||||
|
bOk = EgtGetInfo(SelPart.nPartId, BTL_PRT_ORDERNUM, sInfo)
|
||||||
|
sFileText.Add("Var9=$ORDERNUMBER$," & If(bOk, sInfo, ""))
|
||||||
|
bOk = EgtGetInfo(SelPart.nPartId, BTL_PRT_DESIGNATION, sInfo)
|
||||||
|
sFileText.Add("Var10=$DESIGNATION$," & If(bOk, sInfo, ""))
|
||||||
|
bOk = EgtGetInfo(SelPart.nPartId, BTL_PRT_ANNOTATION, sInfo)
|
||||||
|
sFileText.Add("Var11=$ANNOTATION$," & If(bOk, sInfo, ""))
|
||||||
|
sFileText.Add("Var12=$STOREY$," & SelPart.sSTOREY)
|
||||||
|
sFileText.Add("Var13=$GROUP$," & SelPart.sGROUP)
|
||||||
|
bOk = EgtGetInfo(SelPart.nPartId, BTL_PRT_PACKAGE, sInfo)
|
||||||
|
sFileText.Add("Var14=$PACKAGE$," & If(bOk, sInfo, ""))
|
||||||
|
sFileText.Add("Var15=$WHL$," & SelPart.sW & "x" & SelPart.sH & "x" & SelPart.sL)
|
||||||
|
sFileText.Add("Var16=$PRODUCTIONDATE$," & Date.Now().ToString("yyyy-MM-dd"))
|
||||||
|
' calcolo numero settimana corrente secondo ISO 8601
|
||||||
|
Dim time As Date = Date.Now()
|
||||||
|
Dim Day As DayOfWeek = CultureInfo.InvariantCulture.Calendar.GetDayOfWeek(time)
|
||||||
|
If Day >= DayOfWeek.Monday AndAlso Day <= DayOfWeek.Wednesday Then time = time.AddDays(3)
|
||||||
|
Dim nWeekOfYear As Integer = CultureInfo.InvariantCulture.Calendar.GetWeekOfYear(time, CalendarWeekRule.FirstFourDayWeek, DayOfWeek.Monday)
|
||||||
|
sFileText.Add("Var17=$PRODUCTIONWEEK$," & nWeekOfYear)
|
||||||
|
bOk = EgtGetInfo(SelPart.nPartId, BTL_PRT_DESCRIPTION, sInfo)
|
||||||
|
sFileText.Add("Var18=$DESCRIPTION$," & If(bOk, sInfo, ""))
|
||||||
|
bOk = EgtGetInfo(SelPart.nPartId, BTL_PRT_QUALITYGRADE, sInfo)
|
||||||
|
sFileText.Add("Var19=$QUALITYGRADE$," & If(bOk, sInfo, ""))
|
||||||
|
bOk = EgtGetInfo(nBtlInfoId, BTL_GEN_BTLPATH, sInfo)
|
||||||
|
sFileText.Add("Var20=$BTLPATH$," & If(bOk, Path.GetFileNameWithoutExtension(sInfo), ""))
|
||||||
|
|
||||||
Try
|
Try
|
||||||
File.WriteAllLines(sFilePath, sFileText)
|
File.WriteAllLines(sFilePath, sFileText)
|
||||||
Catch ex As Exception
|
Catch ex As Exception
|
||||||
|
|||||||
@@ -163,7 +163,7 @@ Public Class MDIPageVM
|
|||||||
''' </summary>
|
''' </summary>
|
||||||
Friend Sub SendMDI()
|
Friend Sub SendMDI()
|
||||||
If Not String.IsNullOrWhiteSpace(m_sMDICommand_Text) Then
|
If Not String.IsNullOrWhiteSpace(m_sMDICommand_Text) Then
|
||||||
MachManaging.CommandList.Add(ThreadCommand.CreateCommand(CommandTypes.MDI, m_sMDICommand_Text))
|
MachManaging.AddToCommandList(ThreadCommand.CreateCommand(CommandTypes.MDI, m_sMDICommand_Text))
|
||||||
End If
|
End If
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
|
|||||||
@@ -427,11 +427,11 @@ Public Class MachCommandMessagePanelVM
|
|||||||
End Property
|
End Property
|
||||||
|
|
||||||
Public Sub Disconnect()
|
Public Sub Disconnect()
|
||||||
MachManaging.CommandList.Add(ThreadCommand.CreateCommand(CommandTypes.DISCONNECT))
|
MachManaging.AddToCommandList(ThreadCommand.CreateCommand(CommandTypes.DISCONNECT))
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Public Sub SetOPState(OpState As Integer)
|
Public Sub SetOPState(OpState As Integer)
|
||||||
MachManaging.CommandList.Add(ThreadCommand.CreateCommand(CommandTypes.SETOPMODE))
|
MachManaging.AddToCommandList(ThreadCommand.CreateCommand(CommandTypes.SETOPMODE))
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Public ReadOnly Property Start_Command As ICommand
|
Public ReadOnly Property Start_Command As ICommand
|
||||||
@@ -442,7 +442,7 @@ Public Class MachCommandMessagePanelVM
|
|||||||
End Property
|
End Property
|
||||||
|
|
||||||
Public Sub Start(ByVal param As Object)
|
Public Sub Start(ByVal param As Object)
|
||||||
MachManaging.CommandList.Add(ThreadCommand.CreateCommand(CommandTypes.START))
|
MachManaging.AddToCommandList(ThreadCommand.CreateCommand(CommandTypes.START))
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Public ReadOnly Property Stop_Command As ICommand
|
Public ReadOnly Property Stop_Command As ICommand
|
||||||
@@ -453,7 +453,7 @@ Public Class MachCommandMessagePanelVM
|
|||||||
End Property
|
End Property
|
||||||
|
|
||||||
Public Sub [Stop](ByVal param As Object)
|
Public Sub [Stop](ByVal param As Object)
|
||||||
MachManaging.CommandList.Add(ThreadCommand.CreateCommand(CommandTypes.STOP_))
|
MachManaging.AddToCommandList(ThreadCommand.CreateCommand(CommandTypes.STOP_))
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Public ReadOnly Property Reset_Command As ICommand
|
Public ReadOnly Property Reset_Command As ICommand
|
||||||
@@ -464,7 +464,7 @@ Public Class MachCommandMessagePanelVM
|
|||||||
End Property
|
End Property
|
||||||
|
|
||||||
Public Sub Reset(ByVal param As Object)
|
Public Sub Reset(ByVal param As Object)
|
||||||
MachManaging.CommandList.Add(ThreadCommand.CreateCommand(CommandTypes.RESET))
|
MachManaging.AddToCommandList(ThreadCommand.CreateCommand(CommandTypes.RESET))
|
||||||
' annullo stato di pronto ad essere lavorato di tutti i programmi
|
' annullo stato di pronto ad essere lavorato di tutti i programmi
|
||||||
If Not IsNothing(Map.refProjectVM.SupervisorMachGroupPanelVM) Then Map.refProjectVM.SupervisorMachGroupPanelVM.ResetAllMachGroups()
|
If Not IsNothing(Map.refProjectVM.SupervisorMachGroupPanelVM) Then Map.refProjectVM.SupervisorMachGroupPanelVM.ResetAllMachGroups()
|
||||||
End Sub
|
End Sub
|
||||||
@@ -477,7 +477,7 @@ Public Class MachCommandMessagePanelVM
|
|||||||
End Property
|
End Property
|
||||||
|
|
||||||
Public Sub [Step](ByVal param As Object)
|
Public Sub [Step](ByVal param As Object)
|
||||||
MachManaging.CommandList.Add(ThreadCommand.CreateCommand(CommandTypes.STEP_))
|
MachManaging.AddToCommandList(ThreadCommand.CreateCommand(CommandTypes.STEP_))
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Public ReadOnly Property SetPoint_Command As ICommand
|
Public ReadOnly Property SetPoint_Command As ICommand
|
||||||
@@ -488,7 +488,7 @@ Public Class MachCommandMessagePanelVM
|
|||||||
End Property
|
End Property
|
||||||
|
|
||||||
Public Sub SetPoint(ByVal param As Object)
|
Public Sub SetPoint(ByVal param As Object)
|
||||||
MachManaging.CommandList.Add(ThreadCommand.CreateCommand(CommandTypes.SETPOINT))
|
MachManaging.AddToCommandList(ThreadCommand.CreateCommand(CommandTypes.SETPOINT))
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
|
|
||||||
@@ -500,7 +500,7 @@ Public Class MachCommandMessagePanelVM
|
|||||||
End Property
|
End Property
|
||||||
|
|
||||||
Public Sub DeleteAlarms(ByVal param As Object)
|
Public Sub DeleteAlarms(ByVal param As Object)
|
||||||
MachManaging.CommandList.Add(ThreadCommand.CreateCommand(CommandTypes.DELETEALARMS))
|
MachManaging.AddToCommandList(ThreadCommand.CreateCommand(CommandTypes.DELETEALARMS))
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Public Function GetVarPathByName(Name As String) As String
|
Public Function GetVarPathByName(Name As String) As String
|
||||||
@@ -541,14 +541,18 @@ Public Class MachCommandMessagePanelVM
|
|||||||
Map.refMachManaging.Num_Axium_APServer.GetGeneralFunctions()
|
Map.refMachManaging.Num_Axium_APServer.GetGeneralFunctions()
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
|
' scrivo evento programma attivato
|
||||||
|
DbControllers.m_LogMachineController.Create(LogEvent.CreateMachCommandLog(LogEvent.MachineCommands.CONNECTION, "", 0, DbControllers.SupervisorId))
|
||||||
End If
|
End If
|
||||||
Case CommandTypes.DISCONNECT
|
Case CommandTypes.DISCONNECT
|
||||||
If CommandState = CommandStates.OK Then
|
If CommandState = CommandStates.OK Then
|
||||||
_Connected = False
|
_Connected = False
|
||||||
NotifyPropertyChanged(NameOf(Connect_Background))
|
NotifyPropertyChanged(NameOf(Connect_Background))
|
||||||
|
' scrivo evento programma attivato
|
||||||
|
DbControllers.m_LogMachineController.Create(LogEvent.CreateMachCommandLog(LogEvent.MachineCommands.DISCONNECTION, "", 0, DbControllers.SupervisorId))
|
||||||
End If
|
End If
|
||||||
End Select
|
End Select
|
||||||
DbControllers.m_LogMachineController.Create(MachLog.CreateResultLog(CommandType, CommandState, ResultType, Params))
|
'DbControllers.m_LogMachineController.Create(MachLog.CreateResultLog(CommandType, CommandState, ResultType, Params))
|
||||||
End Sub
|
End Sub
|
||||||
Friend Sub CloseCallbackDlg(ByRef bCancel As Boolean)
|
Friend Sub CloseCallbackDlg(ByRef bCancel As Boolean)
|
||||||
' serve?
|
' serve?
|
||||||
@@ -615,7 +619,8 @@ Public Class MachCommandMessagePanelVM
|
|||||||
' fermo timer degli allarmi
|
' fermo timer degli allarmi
|
||||||
m_AlarmTimer.Stop()
|
m_AlarmTimer.Stop()
|
||||||
End If
|
End If
|
||||||
DbControllers.m_LogMachineController.Create(MachLog.CreateAlarmLog(AlarmOperation, AlarmType, AlarmMessage, AlarmCode, AlarmDateTime))
|
'DbControllers.m_LogMachineController.Create(MachLog.CreateAlarmLog(AlarmOperation, AlarmType, AlarmMessage, AlarmCode, AlarmDateTime))
|
||||||
|
DbControllers.m_LogMachineController.Create(LogEvent.CreateAlarmLog(DateTime.Now(), AlarmOperation & LogEvent.cSeparator & AlarmType & LogEvent.cSeparator & AlarmMessage & LogEvent.cSeparator & AlarmCode & LogEvent.cSeparator & AlarmDateTime, DbControllers.m_SupervisorId))
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Friend Sub NUMAlarmCallbackDlg(ByVal CncNumber As Integer, ByVal AlarmOperation As Integer, ByVal ErrorTyp As String, ByVal ErrorIndex As String, ByVal ErrorNumber As String, ByVal ErrorLine As String, ByVal ErrorMessage As String, ByVal ErrorAdditional As String)
|
Friend Sub NUMAlarmCallbackDlg(ByVal CncNumber As Integer, ByVal AlarmOperation As Integer, ByVal ErrorTyp As String, ByVal ErrorIndex As String, ByVal ErrorNumber As String, ByVal ErrorLine As String, ByVal ErrorMessage As String, ByVal ErrorAdditional As String)
|
||||||
@@ -661,10 +666,17 @@ Public Class MachCommandMessagePanelVM
|
|||||||
ErrorAdditionalMsg = "Line Number"
|
ErrorAdditionalMsg = "Line Number"
|
||||||
ErrorNumberMsg = "CN:"
|
ErrorNumberMsg = "CN:"
|
||||||
End If
|
End If
|
||||||
|
Dim sErrorMessage As String = ErrorMessage
|
||||||
|
If bMsgTranslationActive Then
|
||||||
|
Dim sTranslatedMsg = MachMsg(MsgParagraphs.CNC, nErrorNumber)
|
||||||
|
If Not String.IsNullOrWhiteSpace(sTranslatedMsg) Then
|
||||||
|
sErrorMessage = sTranslatedMsg
|
||||||
|
End If
|
||||||
|
End If
|
||||||
ErrorLineMsg = "Number from the Cnc Block"
|
ErrorLineMsg = "Number from the Cnc Block"
|
||||||
AlarmMessage = If(nErrorNumber <> 0, ErrorNumberMsg & ": " & nErrorNumber & " - ", "") &
|
AlarmMessage = If(nErrorNumber <> 0, ErrorNumberMsg & ": " & nErrorNumber & " - ", "") &
|
||||||
If(nErrorExtNumber <> 0, " - " & ErrorExtNumberMsg & ": " & nErrorExtNumber, "") &
|
If(nErrorExtNumber <> 0, " - " & ErrorExtNumberMsg & ": " & nErrorExtNumber, "") &
|
||||||
" " & ErrorMessage
|
" " & sErrorMessage
|
||||||
Case NUM_ErrorTypes.Drive_Error
|
Case NUM_ErrorTypes.Drive_Error
|
||||||
ErrorIndexMsg = "Azionamento: Asse"
|
ErrorIndexMsg = "Azionamento: Asse"
|
||||||
ErrorNumberMsg = "Ext"
|
ErrorNumberMsg = "Ext"
|
||||||
@@ -785,7 +797,8 @@ Public Class MachCommandMessagePanelVM
|
|||||||
' fermo timer degli allarmi
|
' fermo timer degli allarmi
|
||||||
m_AlarmTimer.Stop()
|
m_AlarmTimer.Stop()
|
||||||
End If
|
End If
|
||||||
DbControllers.m_LogMachineController.Create(MachLog.CreateAlarmLog(AlarmOperation, ErrorTyp, AlarmMessage, AlarmCode, DateTime.Now))
|
'DbControllers.m_LogMachineController.Create(MachLog.CreateAlarmLog(AlarmOperation, ErrorTyp, AlarmMessage, AlarmCode, DateTime.Now))
|
||||||
|
DbControllers.m_LogMachineController.Create(LogEvent.CreateAlarmLog(DateTime.Now(), AlarmOperation & LogEvent.cSeparator & ErrorTyp & LogEvent.cSeparator & AlarmMessage & LogEvent.cSeparator & AlarmCode & LogEvent.cSeparator, DbControllers.m_SupervisorId))
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Friend Sub AxisCoordinatesCallbackDlg(AxisValue As Double, AxisIndex As Integer)
|
Friend Sub AxisCoordinatesCallbackDlg(AxisValue As Double, AxisIndex As Integer)
|
||||||
@@ -808,7 +821,8 @@ Public Class MachCommandMessagePanelVM
|
|||||||
Case NCTypes.NUM_FLEXIUM, NCTypes.NUM_AXIUM_APSERVER, NCTypes.NUM_AXIUM_PCTOOLKIT
|
Case NCTypes.NUM_FLEXIUM, NCTypes.NUM_AXIUM_APSERVER, NCTypes.NUM_AXIUM_PCTOOLKIT
|
||||||
Map.refLeftPanelVM.SetOPState(NewState)
|
Map.refLeftPanelVM.SetOPState(NewState)
|
||||||
End Select
|
End Select
|
||||||
DbControllers.m_LogMachineController.Create(MachLog.CreateOPStateLog(newOpState))
|
'DbControllers.m_LogMachineController.Create(MachLog.CreateOPStateLog(newOpState))
|
||||||
|
DbControllers.m_LogMachineController.Create(LogEvent.CreateMachineStateLog(newOpState, DbControllers.m_SupervisorId))
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Friend Sub OpModeCallbackDlg(newOpState As Integer)
|
Friend Sub OpModeCallbackDlg(newOpState As Integer)
|
||||||
@@ -821,7 +835,8 @@ Public Class MachCommandMessagePanelVM
|
|||||||
Case NCTypes.NUM_FLEXIUM, NCTypes.NUM_AXIUM_APSERVER, NCTypes.NUM_AXIUM_PCTOOLKIT
|
Case NCTypes.NUM_FLEXIUM, NCTypes.NUM_AXIUM_APSERVER, NCTypes.NUM_AXIUM_PCTOOLKIT
|
||||||
Map.refLeftPanelVM.SetOPMode(NewState)
|
Map.refLeftPanelVM.SetOPMode(NewState)
|
||||||
End Select
|
End Select
|
||||||
DbControllers.m_LogMachineController.Create(MachLog.CreateOPStateLog(newOpState))
|
'DbControllers.m_LogMachineController.Create(MachLog.CreateOPStateLog(newOpState))
|
||||||
|
DbControllers.m_LogMachineController.Create(LogEvent.CreateMachineModeLog(newOpState, DbControllers.m_SupervisorId))
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Friend Sub ChannelCallbackDlg(NewChannelId As Short)
|
Friend Sub ChannelCallbackDlg(NewChannelId As Short)
|
||||||
@@ -840,8 +855,9 @@ Public Class MachCommandMessagePanelVM
|
|||||||
Case "AsseX", "AsseY", "AsseZ", "AsseC", "AsseB"
|
Case "AsseX", "AsseY", "AsseZ", "AsseC", "AsseB"
|
||||||
SetAxisValue(VarName, VarValue)
|
SetAxisValue(VarName, VarValue)
|
||||||
End Select
|
End Select
|
||||||
|
'DbControllers.m_LogMachineController.Create(MachLog.CreateReadLog(CommandExecutedCorrectly, VarAddress, VarValue))
|
||||||
|
DbControllers.m_LogMachineController.Create(LogEvent.CreateReadVarLog(VarAddress, VarValue, DbControllers.SupervisorId))
|
||||||
End If
|
End If
|
||||||
DbControllers.m_LogMachineController.Create(MachLog.CreateReadLog(CommandExecutedCorrectly, VarAddress, VarValue))
|
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Sub SetAxisValue(VarName As String, VarValue As String)
|
Private Sub SetAxisValue(VarName As String, VarValue As String)
|
||||||
|
|||||||
@@ -132,7 +132,7 @@ Public Class MyMachGroupVM
|
|||||||
EgtGetInfo(Id, MGR_RPT_PART & 1, sInfo)
|
EgtGetInfo(Id, MGR_RPT_PART & 1, sInfo)
|
||||||
If Not String.IsNullOrWhiteSpace(sInfo) Then
|
If Not String.IsNullOrWhiteSpace(sInfo) Then
|
||||||
sSplitInfo = sInfo.Split(","c)
|
sSplitInfo = sInfo.Split(","c)
|
||||||
StringToDouble(sSplitInfo(1), MyMachGroupM.dStartCut)
|
StringToDoubleAdv(sSplitInfo(1), MyMachGroupM.dStartCut)
|
||||||
Else
|
Else
|
||||||
MyMachGroupM.dStartCut = 0
|
MyMachGroupM.dStartCut = 0
|
||||||
End If
|
End If
|
||||||
|
|||||||
@@ -10,6 +10,9 @@ Imports EgtBEAMWALL.Supervisor.CommVar
|
|||||||
|
|
||||||
Public Class MachManaging
|
Public Class MachManaging
|
||||||
|
|
||||||
|
' lock per aggiunta elemento a lista MachGroup
|
||||||
|
Private Shared Lock_CommandList As New Object
|
||||||
|
|
||||||
Private m_bConnected As Boolean = False
|
Private m_bConnected As Boolean = False
|
||||||
Public ReadOnly Property bConnected As Boolean
|
Public ReadOnly Property bConnected As Boolean
|
||||||
Get
|
Get
|
||||||
@@ -53,6 +56,22 @@ Public Class MachManaging
|
|||||||
Return m_CommandList
|
Return m_CommandList
|
||||||
End Get
|
End Get
|
||||||
End Property
|
End Property
|
||||||
|
Friend Shared Sub AddToCommandList(value As ThreadCommand)
|
||||||
|
SyncLock Lock_CommandList
|
||||||
|
' EgtOutLog("Inizio ciclo rimozioni")
|
||||||
|
For CommandIndex = m_CommandList.Count - 1 To 0 Step -1
|
||||||
|
Dim Command As ThreadCommand = m_CommandList(CommandIndex)
|
||||||
|
If Command.ProcessingStatus = ThreadCommand.ProcessingStatuses.DONE Then
|
||||||
|
' EgtOutLog("Inizio rimozione comando")
|
||||||
|
m_CommandList.Remove(Command)
|
||||||
|
' EgtOutLog("Fine rimozione comando")
|
||||||
|
End If
|
||||||
|
Next
|
||||||
|
' EgtOutLog("Fine ciclo rimozioni")
|
||||||
|
CommandList.Add(value)
|
||||||
|
' EgtOutLog("Count dopo aggiunta: " & CommandList.Count)
|
||||||
|
End SyncLock
|
||||||
|
End Sub
|
||||||
|
|
||||||
Private m_bStartPending As Boolean = False
|
Private m_bStartPending As Boolean = False
|
||||||
Public ReadOnly Property StartPending As Boolean
|
Public ReadOnly Property StartPending As Boolean
|
||||||
@@ -286,70 +305,59 @@ Public Class MachManaging
|
|||||||
Dim dTemp As Double = 0
|
Dim dTemp As Double = 0
|
||||||
Dim nTemp As Integer = 0
|
Dim nTemp As Integer = 0
|
||||||
If Not IsNothing(ResetVariable.sValue) Then
|
If Not IsNothing(ResetVariable.sValue) Then
|
||||||
StringToDouble(ResetVariable.sValue, dTemp)
|
Integer.TryParse(ResetVariable.sValue, nReset_State)
|
||||||
Integer.TryParse(dTemp, nReset_State)
|
|
||||||
Else
|
Else
|
||||||
nReset_State = 1
|
nReset_State = 1
|
||||||
End If
|
End If
|
||||||
If Not IsNothing(StartVariable.sValue) Then
|
If Not IsNothing(StartVariable.sValue) Then
|
||||||
StringToDouble(StartVariable.sValue, dTemp)
|
Integer.TryParse(StartVariable.sValue, nTemp)
|
||||||
Integer.TryParse(dTemp, nTemp)
|
|
||||||
nStart_State = (nTemp = 1)
|
nStart_State = (nTemp = 1)
|
||||||
Else
|
Else
|
||||||
nStart_State = -1
|
nStart_State = -1
|
||||||
End If
|
End If
|
||||||
If Not IsNothing(StopVariable.sValue) Then
|
If Not IsNothing(StopVariable.sValue) Then
|
||||||
StringToDouble(StopVariable.sValue, dTemp)
|
Integer.TryParse(StopVariable.sValue, nTemp)
|
||||||
Integer.TryParse(dTemp, nTemp)
|
|
||||||
nStop_State = (nTemp = 1)
|
nStop_State = (nTemp = 1)
|
||||||
Else
|
Else
|
||||||
nStop_State = -1
|
nStop_State = -1
|
||||||
End If
|
End If
|
||||||
If Not IsNothing(ProdVariable.sValue) Then
|
If Not IsNothing(ProdVariable.sValue) Then
|
||||||
StringToDouble(ProdVariable.sValue, dTemp)
|
Integer.TryParse(ProdVariable.sValue, nP_Prod)
|
||||||
Integer.TryParse(dTemp, nP_Prod)
|
|
||||||
Else
|
Else
|
||||||
nP_Prod = -1
|
nP_Prod = -1
|
||||||
End If
|
End If
|
||||||
If Not IsNothing(MachGroupVariable.sValue) Then
|
If Not IsNothing(MachGroupVariable.sValue) Then
|
||||||
StringToDouble(MachGroupVariable.sValue, dTemp)
|
Integer.TryParse(MachGroupVariable.sValue, nP_Machgroup)
|
||||||
Integer.TryParse(dTemp, nP_Machgroup)
|
|
||||||
Else
|
Else
|
||||||
nP_Machgroup = -1
|
nP_Machgroup = -1
|
||||||
End If
|
End If
|
||||||
If Not IsNothing(PartVariable.sValue) Then
|
If Not IsNothing(PartVariable.sValue) Then
|
||||||
StringToDouble(PartVariable.sValue, dTemp)
|
Integer.TryParse(PartVariable.sValue, nP_Part)
|
||||||
Integer.TryParse(dTemp, nP_Part)
|
|
||||||
Else
|
Else
|
||||||
nP_Part = -1
|
nP_Part = -1
|
||||||
End If
|
End If
|
||||||
If Not IsNothing(StateVariable.sValue) Then
|
If Not IsNothing(StateVariable.sValue) Then
|
||||||
StringToDouble(StateVariable.sValue, dTemp)
|
Integer.TryParse(StateVariable.sValue, nP_State)
|
||||||
Integer.TryParse(dTemp, nP_State)
|
|
||||||
Else
|
Else
|
||||||
nP_State = -1
|
nP_State = -1
|
||||||
End If
|
End If
|
||||||
If Not IsNothing(ISONumVariable.sValue) Then
|
If Not IsNothing(ISONumVariable.sValue) Then
|
||||||
StringToDouble(ISONumVariable.sValue, dTemp)
|
Integer.TryParse(ISONumVariable.sValue, nISO_Num)
|
||||||
Integer.TryParse(dTemp, nISO_Num)
|
|
||||||
Else
|
Else
|
||||||
nISO_Num = -1
|
nISO_Num = -1
|
||||||
End If
|
End If
|
||||||
If Not IsNothing(ISOSentVariable.sValue) Then
|
If Not IsNothing(ISOSentVariable.sValue) Then
|
||||||
StringToDouble(ISOSentVariable.sValue, dTemp)
|
Integer.TryParse(ISOSentVariable.sValue, nISO_Sent)
|
||||||
Integer.TryParse(dTemp, nISO_Sent)
|
|
||||||
Else
|
Else
|
||||||
nISO_Sent = -1
|
nISO_Sent = -1
|
||||||
End If
|
End If
|
||||||
If Not IsNothing(RunningVariable.sValue) Then
|
If Not IsNothing(RunningVariable.sValue) Then
|
||||||
StringToDouble(RunningVariable.sValue, dTemp)
|
Integer.TryParse(RunningVariable.sValue, nRunning)
|
||||||
Integer.TryParse(dTemp, nRunning)
|
|
||||||
Else
|
Else
|
||||||
nRunning = -1
|
nRunning = -1
|
||||||
End If
|
End If
|
||||||
If Not IsNothing(MachIndexVariable.sValue) Then
|
If Not IsNothing(MachIndexVariable.sValue) Then
|
||||||
StringToDouble(MachIndexVariable.sValue, dTemp)
|
Integer.TryParse(MachIndexVariable.sValue, nCurrMachIndex)
|
||||||
Integer.TryParse(dTemp, nCurrMachIndex)
|
|
||||||
Else
|
Else
|
||||||
nCurrMachIndex = -1
|
nCurrMachIndex = -1
|
||||||
End If
|
End If
|
||||||
@@ -362,78 +370,67 @@ Public Class MachManaging
|
|||||||
Case NCTypes.NUM_AXIUM_PCTOOLKIT
|
Case NCTypes.NUM_AXIUM_PCTOOLKIT
|
||||||
' leggo tutte le variabili
|
' leggo tutte le variabili
|
||||||
Num_Axium_PCToolkit.RefreshAllVars()
|
Num_Axium_PCToolkit.RefreshAllVars()
|
||||||
'''EgtOutLog("Post lettura variabili")
|
'EgtOutLog("Post lettura variabili")
|
||||||
Dim dTemp As Double = 0
|
Dim dTemp As Double = 0
|
||||||
Dim nTemp As Integer = 0
|
Dim nTemp As Integer = 0
|
||||||
If Not IsNothing(ResetVariable.sValue) Then
|
If Not IsNothing(ResetVariable.sValue) Then
|
||||||
StringToDouble(ResetVariable.sValue, dTemp)
|
Integer.TryParse(ResetVariable.sValue, nReset_State)
|
||||||
Integer.TryParse(dTemp, nReset_State)
|
|
||||||
Else
|
Else
|
||||||
nReset_State = 1
|
nReset_State = 1
|
||||||
End If
|
End If
|
||||||
If Not IsNothing(StartVariable.sValue) Then
|
If Not IsNothing(StartVariable.sValue) Then
|
||||||
StringToDouble(StartVariable.sValue, dTemp)
|
Integer.TryParse(StartVariable.sValue, nTemp)
|
||||||
Integer.TryParse(dTemp, nTemp)
|
|
||||||
nStart_State = (nTemp = 1)
|
nStart_State = (nTemp = 1)
|
||||||
Else
|
Else
|
||||||
nStart_State = -1
|
nStart_State = -1
|
||||||
End If
|
End If
|
||||||
If Not IsNothing(StopVariable.sValue) Then
|
If Not IsNothing(StopVariable.sValue) Then
|
||||||
StringToDouble(StopVariable.sValue, dTemp)
|
Integer.TryParse(StopVariable.sValue, nTemp)
|
||||||
Integer.TryParse(dTemp, nTemp)
|
|
||||||
nStop_State = (nTemp = 1)
|
nStop_State = (nTemp = 1)
|
||||||
Else
|
Else
|
||||||
nStop_State = -1
|
nStop_State = -1
|
||||||
End If
|
End If
|
||||||
If Not IsNothing(ProdVariable.sValue) Then
|
If Not IsNothing(ProdVariable.sValue) Then
|
||||||
StringToDouble(ProdVariable.sValue, dTemp)
|
Integer.TryParse(ProdVariable.sValue, nP_Prod)
|
||||||
Integer.TryParse(dTemp, nP_Prod)
|
|
||||||
Else
|
Else
|
||||||
nP_Prod = -1
|
nP_Prod = -1
|
||||||
End If
|
End If
|
||||||
If Not IsNothing(MachGroupVariable.sValue) Then
|
If Not IsNothing(MachGroupVariable.sValue) Then
|
||||||
StringToDouble(MachGroupVariable.sValue, dTemp)
|
Integer.TryParse(MachGroupVariable.sValue, nP_Machgroup)
|
||||||
Integer.TryParse(dTemp, nP_Machgroup)
|
|
||||||
Else
|
Else
|
||||||
nP_Machgroup = -1
|
nP_Machgroup = -1
|
||||||
End If
|
End If
|
||||||
If Not IsNothing(PartVariable.sValue) Then
|
If Not IsNothing(PartVariable.sValue) Then
|
||||||
StringToDouble(PartVariable.sValue, dTemp)
|
Integer.TryParse(PartVariable.sValue, nP_Part)
|
||||||
Integer.TryParse(dTemp, nP_Part)
|
|
||||||
Else
|
Else
|
||||||
nP_Part = -1
|
nP_Part = -1
|
||||||
End If
|
End If
|
||||||
If Not IsNothing(StateVariable.sValue) Then
|
If Not IsNothing(StateVariable.sValue) Then
|
||||||
StringToDouble(StateVariable.sValue, dTemp)
|
Integer.TryParse(StateVariable.sValue, nP_State)
|
||||||
Integer.TryParse(dTemp, nP_State)
|
|
||||||
Else
|
Else
|
||||||
nP_State = -1
|
nP_State = -1
|
||||||
End If
|
End If
|
||||||
If Not IsNothing(ISONumVariable.sValue) Then
|
If Not IsNothing(ISONumVariable.sValue) Then
|
||||||
StringToDouble(ISONumVariable.sValue, dTemp)
|
Integer.TryParse(ISONumVariable.sValue, nISO_Num)
|
||||||
Integer.TryParse(dTemp, nISO_Num)
|
|
||||||
Else
|
Else
|
||||||
nISO_Num = -1
|
nISO_Num = -1
|
||||||
End If
|
End If
|
||||||
If Not IsNothing(ISOSentVariable.sValue) Then
|
If Not IsNothing(ISOSentVariable.sValue) Then
|
||||||
StringToDouble(ISOSentVariable.sValue, dTemp)
|
Integer.TryParse(ISOSentVariable.sValue, nISO_Sent)
|
||||||
Integer.TryParse(dTemp, nISO_Sent)
|
|
||||||
Else
|
Else
|
||||||
nISO_Sent = -1
|
nISO_Sent = -1
|
||||||
End If
|
End If
|
||||||
If Not IsNothing(RunningVariable.sValue) Then
|
If Not IsNothing(RunningVariable.sValue) Then
|
||||||
StringToDouble(RunningVariable.sValue, dTemp)
|
Integer.TryParse(RunningVariable.sValue, nRunning)
|
||||||
Integer.TryParse(dTemp, nRunning)
|
|
||||||
Else
|
Else
|
||||||
nRunning = -1
|
nRunning = -1
|
||||||
End If
|
End If
|
||||||
If Not IsNothing(MachIndexVariable.sValue) Then
|
If Not IsNothing(MachIndexVariable.sValue) Then
|
||||||
StringToDouble(MachIndexVariable.sValue, dTemp)
|
Integer.TryParse(MachIndexVariable.sValue, nCurrMachIndex)
|
||||||
Integer.TryParse(dTemp, nCurrMachIndex)
|
|
||||||
Else
|
Else
|
||||||
nCurrMachIndex = -1
|
nCurrMachIndex = -1
|
||||||
End If
|
End If
|
||||||
'''EgtOutLog("Post scrittura variabili lette")
|
'EgtOutLog("Post scrittura variabili lette")
|
||||||
' se indice lavorazione positivo, lo aggiorno
|
' se indice lavorazione positivo, lo aggiorno
|
||||||
If nCurrMachIndex > 0 AndAlso nReset_State = 0 Then
|
If nCurrMachIndex > 0 AndAlso nReset_State = 0 Then
|
||||||
m_nMachIndex = nCurrMachIndex
|
m_nMachIndex = nCurrMachIndex
|
||||||
@@ -469,7 +466,7 @@ Public Class MachManaging
|
|||||||
Else
|
Else
|
||||||
OpState = OPStates.End
|
OpState = OPStates.End
|
||||||
End If
|
End If
|
||||||
If OpState <> Map.refLeftPanelVM.SelOPState.Id Then
|
If IsNothing(Map.refLeftPanelVM.SelOPState) OrElse OpState <> Map.refLeftPanelVM.SelOPState.Id Then
|
||||||
m_OpStateCallbackDlg(OpState)
|
m_OpStateCallbackDlg(OpState)
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
@@ -540,27 +537,33 @@ Public Class MachManaging
|
|||||||
Dim MachGroup As MyMachGroupVM = Map.refProjectVM.SupervisorMachGroupPanelVM.MachGroupVMList.FirstOrDefault(Function(x) x.Id = nP_Machgroup)
|
Dim MachGroup As MyMachGroupVM = Map.refProjectVM.SupervisorMachGroupPanelVM.MachGroupVMList.FirstOrDefault(Function(x) x.Id = nP_Machgroup)
|
||||||
' se pezzo = -1 devo dare start a tutti i pezzi del MachGroup
|
' se pezzo = -1 devo dare start a tutti i pezzi del MachGroup
|
||||||
If nP_Part = -1 Then
|
If nP_Part = -1 Then
|
||||||
For Each Part In MachGroup.PartVMList
|
If Not IsNothing(MachGroup) Then
|
||||||
' scrivo data start su Db pezzo
|
For Each Part In MachGroup.PartVMList
|
||||||
DbControllers.m_PartController.UpdateStart(nP_Prod, nP_Machgroup, Part.nPartId, dtStart)
|
' scrivo data start su Db pezzo
|
||||||
DbControllers.m_PartController.UpdateStatus(nP_Prod, nP_Machgroup, Part.nPartId, ItemState.WIP)
|
DbControllers.m_PartController.UpdateStart(nP_Prod, nP_Machgroup, Part.nPartId, dtStart)
|
||||||
' scrivo stato start
|
DbControllers.m_PartController.UpdateStatus(nP_Prod, nP_Machgroup, Part.nPartId, ItemState.WIP)
|
||||||
Part.nProduction_State = ItemState.WIP
|
' scrivo stato start
|
||||||
Part.dtStartTime = dtStart
|
Part.nProduction_State = ItemState.WIP
|
||||||
Part.NotifyPropertyChanged(NameOf(Part.nProduction_State))
|
Part.dtStartTime = dtStart
|
||||||
' scrivo evento inizio pezzo su DB
|
Part.NotifyPropertyChanged(NameOf(Part.nProduction_State))
|
||||||
DbControllers.m_LogMachineController.Create(LogEvent.CreatePartStateLog(dtStart, nP_Prod, nP_Machgroup, Part.nPartId, nP_State, DbControllers.SupervisorId))
|
' scrivo evento inizio pezzo su DB
|
||||||
Next
|
DbControllers.m_LogMachineController.Create(LogEvent.CreatePartStateLog(dtStart, nP_Prod, nP_Machgroup, Part.nPartId, nP_State, DbControllers.SupervisorId))
|
||||||
|
Next
|
||||||
|
End If
|
||||||
Else
|
Else
|
||||||
' scrivo data start su Db pezzo
|
' scrivo data start su Db pezzo
|
||||||
DbControllers.m_PartController.UpdateStart(nP_Prod, nP_Machgroup, nP_Part, dtStart)
|
DbControllers.m_PartController.UpdateStart(nP_Prod, nP_Machgroup, nP_Part, dtStart)
|
||||||
DbControllers.m_PartController.UpdateStatus(nP_Prod, nP_Machgroup, nP_Part, ItemState.WIP)
|
DbControllers.m_PartController.UpdateStatus(nP_Prod, nP_Machgroup, nP_Part, ItemState.WIP)
|
||||||
' recupero pezzo
|
If Not IsNothing(MachGroup) Then
|
||||||
Dim Part As PartVM = MachGroup.PartVMList.FirstOrDefault(Function(x) x.nPartId = nP_Part)
|
' recupero pezzo
|
||||||
' scrivo stato start
|
Dim Part As PartVM = MachGroup.PartVMList.FirstOrDefault(Function(x) x.nPartId = nP_Part)
|
||||||
Part.nProduction_State = ItemState.WIP
|
If Not IsNothing(Part) Then
|
||||||
Part.dtStartTime = dtStart
|
' scrivo stato start
|
||||||
Part.NotifyPropertyChanged(NameOf(Part.nProduction_State))
|
Part.nProduction_State = ItemState.WIP
|
||||||
|
Part.dtStartTime = dtStart
|
||||||
|
Part.NotifyPropertyChanged(NameOf(Part.nProduction_State))
|
||||||
|
End If
|
||||||
|
End If
|
||||||
' scrivo evento inizio pezzo su DB
|
' scrivo evento inizio pezzo su DB
|
||||||
DbControllers.m_LogMachineController.Create(LogEvent.CreatePartStateLog(dtStart, nP_Prod, nP_Machgroup, nP_Part, nP_State, DbControllers.SupervisorId))
|
DbControllers.m_LogMachineController.Create(LogEvent.CreatePartStateLog(dtStart, nP_Prod, nP_Machgroup, nP_Part, nP_State, DbControllers.SupervisorId))
|
||||||
End If
|
End If
|
||||||
@@ -577,9 +580,11 @@ Public Class MachManaging
|
|||||||
DbControllers.m_MachGroupController.UpdateStart(nP_Prod, nP_Machgroup, dtStart)
|
DbControllers.m_MachGroupController.UpdateStart(nP_Prod, nP_Machgroup, dtStart)
|
||||||
DbControllers.m_MachGroupController.UpdateStatus(nP_Prod, nP_Machgroup, ItemState.WIP)
|
DbControllers.m_MachGroupController.UpdateStatus(nP_Prod, nP_Machgroup, ItemState.WIP)
|
||||||
' scrivo stato start
|
' scrivo stato start
|
||||||
MachGroup.MyMachGroupM.SetProductionState(ItemState.WIP)
|
If Not IsNothing(MachGroup) Then
|
||||||
MachGroup.dtStartTime = dtStart
|
MachGroup.MyMachGroupM.SetProductionState(ItemState.WIP)
|
||||||
MachGroup.NotifyPropertyChanged(NameOf(MachGroup.nProduction_State))
|
MachGroup.dtStartTime = dtStart
|
||||||
|
MachGroup.NotifyPropertyChanged(NameOf(MachGroup.nProduction_State))
|
||||||
|
End If
|
||||||
' scrivo evento inizio MachGroup su DB
|
' scrivo evento inizio MachGroup su DB
|
||||||
DbControllers.m_LogMachineController.Create(LogEvent.CreateMachGroupStateLog(dtStart, nP_Prod, nP_Machgroup, nP_State, DbControllers.SupervisorId))
|
DbControllers.m_LogMachineController.Create(LogEvent.CreateMachGroupStateLog(dtStart, nP_Prod, nP_Machgroup, nP_State, DbControllers.SupervisorId))
|
||||||
End If
|
End If
|
||||||
@@ -591,44 +596,50 @@ Public Class MachManaging
|
|||||||
Dim MachGroup As MyMachGroupVM = Map.refProjectVM.SupervisorMachGroupPanelVM.MachGroupVMList.FirstOrDefault(Function(x) x.Id = nP_Machgroup)
|
Dim MachGroup As MyMachGroupVM = Map.refProjectVM.SupervisorMachGroupPanelVM.MachGroupVMList.FirstOrDefault(Function(x) x.Id = nP_Machgroup)
|
||||||
' se pezzo = -1 devo dare end a tutti i pezzi del MachGroup
|
' se pezzo = -1 devo dare end a tutti i pezzi del MachGroup
|
||||||
If nP_Part = -1 Then
|
If nP_Part = -1 Then
|
||||||
For Each Part In MachGroup.PartVMList
|
If Not IsNothing(MachGroup) Then
|
||||||
' scrivo data end su Db pezzo
|
For Each Part In MachGroup.PartVMList
|
||||||
DbControllers.m_PartController.UpdateEnd(nP_Prod, nP_Machgroup, Part.nPartId, dtEnd)
|
' scrivo data end su Db pezzo
|
||||||
DbControllers.m_PartController.UpdateStatus(nP_Prod, nP_Machgroup, Part.nPartId, ItemState.Produced)
|
DbControllers.m_PartController.UpdateEnd(nP_Prod, nP_Machgroup, Part.nPartId, dtEnd)
|
||||||
' scrivo stato end
|
DbControllers.m_PartController.UpdateStatus(nP_Prod, nP_Machgroup, Part.nPartId, ItemState.Produced)
|
||||||
Part.nProduction_State = ItemState.Produced
|
' scrivo stato end
|
||||||
Part.dtEndTime = dtEnd
|
Part.nProduction_State = ItemState.Produced
|
||||||
Part.NotifyPropertyChanged(NameOf(Part.nProduction_State))
|
Part.dtEndTime = dtEnd
|
||||||
' resetto stato redo
|
Part.NotifyPropertyChanged(NameOf(Part.nProduction_State))
|
||||||
Part.bRedo = False
|
' resetto stato redo
|
||||||
' se non impostata data start
|
Part.bRedo = False
|
||||||
If Part.dtStartTime = DateTime.MinValue Then
|
' se non impostata data start
|
||||||
' scrivo data start su Db pezzo
|
If Part.dtStartTime = DateTime.MinValue Then
|
||||||
Dim dtStart As DateTime = Part.dtEndTime - TimeSpan.FromSeconds(60)
|
' scrivo data start su Db pezzo
|
||||||
DbControllers.m_PartController.UpdateStart(nP_Prod, nP_Machgroup, Part.nPartId, dtStart)
|
Dim dtStart As DateTime = Part.dtEndTime - TimeSpan.FromSeconds(60)
|
||||||
Part.dtStartTime = dtStart
|
DbControllers.m_PartController.UpdateStart(nP_Prod, nP_Machgroup, Part.nPartId, dtStart)
|
||||||
End If
|
Part.dtStartTime = dtStart
|
||||||
' scrivo evento fine pezzo su DB
|
End If
|
||||||
DbControllers.m_LogMachineController.Create(LogEvent.CreatePartStateLog(dtEnd, nP_Prod, nP_Machgroup, Part.nPartId, nP_State, DbControllers.SupervisorId))
|
' scrivo evento fine pezzo su DB
|
||||||
Next
|
DbControllers.m_LogMachineController.Create(LogEvent.CreatePartStateLog(dtEnd, nP_Prod, nP_Machgroup, Part.nPartId, nP_State, DbControllers.SupervisorId))
|
||||||
|
Next
|
||||||
|
End If
|
||||||
Else
|
Else
|
||||||
' scrivo data end su Db pezzo
|
' scrivo data end su Db pezzo
|
||||||
DbControllers.m_PartController.UpdateEnd(nP_Prod, nP_Machgroup, nP_Part, dtEnd)
|
DbControllers.m_PartController.UpdateEnd(nP_Prod, nP_Machgroup, nP_Part, dtEnd)
|
||||||
DbControllers.m_PartController.UpdateStatus(nP_Prod, nP_Machgroup, nP_Part, ItemState.Produced)
|
DbControllers.m_PartController.UpdateStatus(nP_Prod, nP_Machgroup, nP_Part, ItemState.Produced)
|
||||||
' recupero pezzo
|
If Not IsNothing(MachGroup) Then
|
||||||
Dim Part As PartVM = MachGroup.PartVMList.FirstOrDefault(Function(x) x.nPartId = nP_Part)
|
' recupero pezzo
|
||||||
' scrivo stato end
|
Dim Part As PartVM = MachGroup.PartVMList.FirstOrDefault(Function(x) x.nPartId = nP_Part)
|
||||||
Part.nProduction_State = ItemState.Produced
|
If Not IsNothing(Part) Then
|
||||||
Part.dtEndTime = dtEnd
|
' scrivo stato end
|
||||||
Part.NotifyPropertyChanged(NameOf(Part.nProduction_State))
|
Part.nProduction_State = ItemState.Produced
|
||||||
' resetto stato redo
|
Part.dtEndTime = dtEnd
|
||||||
Part.bRedo = False
|
Part.NotifyPropertyChanged(NameOf(Part.nProduction_State))
|
||||||
|
' resetto stato redo
|
||||||
|
Part.bRedo = False
|
||||||
|
End If
|
||||||
|
End If
|
||||||
' scrivo evento fine pezzo su DB
|
' scrivo evento fine pezzo su DB
|
||||||
DbControllers.m_LogMachineController.Create(LogEvent.CreatePartStateLog(dtEnd, nP_Prod, nP_Machgroup, nP_Part, nP_State, DbControllers.SupervisorId))
|
DbControllers.m_LogMachineController.Create(LogEvent.CreatePartStateLog(dtEnd, nP_Prod, nP_Machgroup, nP_Part, nP_State, DbControllers.SupervisorId))
|
||||||
End If
|
End If
|
||||||
|
|
||||||
' se tutti i pezzi della barra sono in end
|
' se tutti i pezzi della barra sono in end
|
||||||
If MachGroup.PartVMList.All(Function(x) x.nProduction_State >= 2) Then
|
If Not IsNothing(MachGroup) AndAlso MachGroup.PartVMList.All(Function(x) x.nProduction_State >= 2) Then
|
||||||
' scrivo data end su Db barra
|
' scrivo data end su Db barra
|
||||||
DbControllers.m_MachGroupController.UpdateEnd(nP_Prod, nP_Machgroup, dtEnd)
|
DbControllers.m_MachGroupController.UpdateEnd(nP_Prod, nP_Machgroup, dtEnd)
|
||||||
DbControllers.m_MachGroupController.UpdateStatus(nP_Prod, nP_Machgroup, ItemState.Produced)
|
DbControllers.m_MachGroupController.UpdateStatus(nP_Prod, nP_Machgroup, ItemState.Produced)
|
||||||
@@ -646,7 +657,7 @@ Public Class MachManaging
|
|||||||
|
|
||||||
' se non impostata data start
|
' se non impostata data start
|
||||||
If MachGroup.dtStartTime = DateTime.MinValue Then
|
If MachGroup.dtStartTime = DateTime.MinValue Then
|
||||||
EgtOutLog("Start date not set on Prod " & nP_Prod & " Machgroup " & nP_Machgroup)
|
' EgtOutLog("Start date not set on Prod " & nP_Prod & " Machgroup " & nP_Machgroup)
|
||||||
Dim dtStart As DateTime = MachGroup.dtEndTime - TimeSpan.FromSeconds(60)
|
Dim dtStart As DateTime = MachGroup.dtEndTime - TimeSpan.FromSeconds(60)
|
||||||
' provo a recuperare tempo stimato
|
' provo a recuperare tempo stimato
|
||||||
If MachGroup.nCALC_TIME > 0 Then
|
If MachGroup.nCALC_TIME > 0 Then
|
||||||
@@ -674,13 +685,17 @@ Public Class MachManaging
|
|||||||
End If
|
End If
|
||||||
' se pezzo = -1 stampo etichette di tutti i pezzi del MachGroup
|
' se pezzo = -1 stampo etichette di tutti i pezzi del MachGroup
|
||||||
If nP_Part = -1 Then
|
If nP_Part = -1 Then
|
||||||
For Each Part In MachGroup.PartVMList
|
If Not IsNothing(MachGroup) Then
|
||||||
Map.refLeftPanelVM.PrintLabel(MachGroup, Part)
|
For Each Part In MachGroup.PartVMList
|
||||||
Next
|
Map.refLeftPanelVM.PrintLabel(MachGroup, Part)
|
||||||
|
Next
|
||||||
|
End If
|
||||||
Else
|
Else
|
||||||
' recupero pezzo
|
' recupero pezzo
|
||||||
Dim Part As PartVM = MachGroup.PartVMList.FirstOrDefault(Function(x) x.nPartId = nP_Part)
|
Dim Part As PartVM = MachGroup.PartVMList.FirstOrDefault(Function(x) x.nPartId = nP_Part)
|
||||||
Map.refLeftPanelVM.PrintLabel(MachGroup, Part)
|
If Not IsNothing(Part) Then
|
||||||
|
Map.refLeftPanelVM.PrintLabel(MachGroup, Part)
|
||||||
|
End If
|
||||||
End If
|
End If
|
||||||
' attesa per essere sicuro che abbia scritto e riletto variabili
|
' attesa per essere sicuro che abbia scritto e riletto variabili
|
||||||
Threading.Thread.Sleep(300)
|
Threading.Thread.Sleep(300)
|
||||||
@@ -706,12 +721,12 @@ Public Class MachManaging
|
|||||||
For VParIndex = 1 To sVs.Length - 1
|
For VParIndex = 1 To sVs.Length - 1
|
||||||
Dim VPar() As String = sVs(VParIndex).Split("="c)
|
Dim VPar() As String = sVs(VParIndex).Split("="c)
|
||||||
VPar(1) = VPar(1).Trim
|
VPar(1) = VPar(1).Trim
|
||||||
StringToDouble(VPar(1), dVPars(VParIndex))
|
StringToDoubleAdv(VPar(1), dVPars(VParIndex - 1))
|
||||||
Next
|
Next
|
||||||
' li scrivo nel CN
|
' li scrivo nel CN
|
||||||
For Index As Integer = 1 To 10
|
For Index As Integer = 1 To 10
|
||||||
Dim sValue As String = ""
|
Dim sValue As String = ""
|
||||||
DoubleToString(dVPars(Index), sValue)
|
sValue = DoubleToString(dVPars(Index - 1), 2)
|
||||||
Tpa.RWVariableManager.WriteVarByName(VPAR & Index.ToString(), sValue)
|
Tpa.RWVariableManager.WriteVarByName(VPAR & Index.ToString(), sValue)
|
||||||
Next
|
Next
|
||||||
m_NextBarId = MyMachGroup.Id
|
m_NextBarId = MyMachGroup.Id
|
||||||
@@ -726,7 +741,7 @@ Public Class MachManaging
|
|||||||
End Function
|
End Function
|
||||||
|
|
||||||
Private Function SendNextProgram() As Boolean
|
Private Function SendNextProgram() As Boolean
|
||||||
EgtOutLog("Inizio SendNextProgram")
|
' EgtOutLog("Inizio SendNextProgram")
|
||||||
Dim bSent As Boolean = False
|
Dim bSent As Boolean = False
|
||||||
If (CurrentMachine.NCType = NCTypes.TPA AndAlso Not m_bStartPending AndAlso Tpa.opState = MachineOperatingState.Pending) OrElse
|
If (CurrentMachine.NCType = NCTypes.TPA AndAlso Not m_bStartPending AndAlso Tpa.opState = MachineOperatingState.Pending) OrElse
|
||||||
(CurrentMachine.NCType = NCTypes.NUM_FLEXIUM AndAlso Not Num_Flexium.bIsTransferActive) OrElse
|
(CurrentMachine.NCType = NCTypes.NUM_FLEXIUM AndAlso Not Num_Flexium.bIsTransferActive) OrElse
|
||||||
@@ -734,20 +749,20 @@ Public Class MachManaging
|
|||||||
(CurrentMachine.NCType = NCTypes.NUM_AXIUM_PCTOOLKIT AndAlso Not Num_Axium_PCToolkit.bIsTransferActive) Then ' Or Tpa.opState = MachineOperatingState.Start) Then
|
(CurrentMachine.NCType = NCTypes.NUM_AXIUM_PCTOOLKIT AndAlso Not Num_Axium_PCToolkit.bIsTransferActive) Then ' Or Tpa.opState = MachineOperatingState.Start) Then
|
||||||
' verifico se c'e' un programma da lanciare
|
' verifico se c'e' un programma da lanciare
|
||||||
If Not IsNothing(Map.refProjectVM.SupervisorMachGroupPanelVM) Then
|
If Not IsNothing(Map.refProjectVM.SupervisorMachGroupPanelVM) Then
|
||||||
EgtOutLog("Start " & DateTime.Now())
|
' EgtOutLog("Start " & DateTime.Now())
|
||||||
Dim bMachGroupNotReady As Boolean = False
|
Dim bMachGroupNotReady As Boolean = False
|
||||||
SyncLock m_Lock_SendProgram
|
SyncLock m_Lock_SendProgram
|
||||||
For Each MyMachGroup As MyMachGroupVM In Map.refProjectVM.SupervisorMachGroupPanelVM.MachGroupVMList
|
For Each MyMachGroup As MyMachGroupVM In Map.refProjectVM.SupervisorMachGroupPanelVM.MachGroupVMList
|
||||||
EgtOutLog("Ciclo su name: " & MyMachGroup.Name & " id: " & MyMachGroup.Id)
|
' EgtOutLog("Ciclo su name: " & MyMachGroup.Name & " id: " & MyMachGroup.Id)
|
||||||
If Not MyMachGroup.bSentToMachine AndAlso (MyMachGroup.dtStartTime = DateTime.MinValue OrElse
|
If Not MyMachGroup.bSentToMachine AndAlso (MyMachGroup.dtStartTime = DateTime.MinValue OrElse
|
||||||
(Map.refSupervisorManagerVM.CurrProd.nType = BWType.WALL AndAlso MyMachGroup.bResetWhileCutting)) Then
|
(Map.refSupervisorManagerVM.CurrProd.nType = BWType.WALL AndAlso MyMachGroup.bResetWhileCutting)) Then
|
||||||
EgtOutLog(MyMachGroup.Name & " id: " & MyMachGroup.Id & " è da fare")
|
' EgtOutLog(MyMachGroup.Name & " id: " & MyMachGroup.Id & " è da fare")
|
||||||
' verifico se ricalcolo finito
|
' verifico se ricalcolo finito
|
||||||
If MyMachGroup.bReadyForMachining AndAlso If(CurrentMachine.NCType = NCTypes.NUM_FLEXIUM Or CurrentMachine.NCType = NCTypes.NUM_AXIUM_APSERVER OrElse CurrentMachine.NCType = NCTypes.NUM_AXIUM_PCTOOLKIT, Not MyMachGroup.bSendingToMachine, True) Then
|
If MyMachGroup.bReadyForMachining AndAlso If(CurrentMachine.NCType = NCTypes.NUM_FLEXIUM Or CurrentMachine.NCType = NCTypes.NUM_AXIUM_APSERVER OrElse CurrentMachine.NCType = NCTypes.NUM_AXIUM_PCTOOLKIT, Not MyMachGroup.bSendingToMachine, True) Then
|
||||||
EgtOutLog(MyMachGroup.Name & " id: " & MyMachGroup.Id & " pronto per essere lavorato")
|
' EgtOutLog(MyMachGroup.Name & " id: " & MyMachGroup.Id & " pronto per essere lavorato")
|
||||||
' lo lancio
|
' lo lancio
|
||||||
bSent = SendProgram(MyMachGroup.CnFilePath(), MyMachGroup.Name)
|
bSent = SendProgram(MyMachGroup.CnFilePath(), MyMachGroup.Name)
|
||||||
EgtOutLog(MyMachGroup.Name & " id: " & MyMachGroup.Id & " mandato " & DateTime.Now() & " " & MyMachGroup.Name & " " & bSent.ToString())
|
' EgtOutLog(MyMachGroup.Name & " id: " & MyMachGroup.Id & " mandato " & DateTime.Now() & " " & MyMachGroup.Name & " " & bSent.ToString())
|
||||||
Select Case CurrentMachine.NCType
|
Select Case CurrentMachine.NCType
|
||||||
Case NCTypes.TPA
|
Case NCTypes.TPA
|
||||||
MyMachGroup.SetSentToMachine(bSent)
|
MyMachGroup.SetSentToMachine(bSent)
|
||||||
@@ -759,7 +774,7 @@ Public Class MachManaging
|
|||||||
Else
|
Else
|
||||||
' programma non ancora pronto, esco per attendere
|
' programma non ancora pronto, esco per attendere
|
||||||
bMachGroupNotReady = True
|
bMachGroupNotReady = True
|
||||||
EgtOutLog(MyMachGroup.Name & " id: " & MyMachGroup.Id & " non ancora pronto per essere mandato")
|
' EgtOutLog(MyMachGroup.Name & " id: " & MyMachGroup.Id & " non ancora pronto per essere mandato")
|
||||||
Exit For
|
Exit For
|
||||||
'Return False
|
'Return False
|
||||||
End If
|
End If
|
||||||
@@ -767,7 +782,7 @@ Public Class MachManaging
|
|||||||
Next
|
Next
|
||||||
End SyncLock
|
End SyncLock
|
||||||
If bMachGroupNotReady Then Return False
|
If bMachGroupNotReady Then Return False
|
||||||
EgtOutLog("End " & DateTime.Now())
|
' EgtOutLog("End " & DateTime.Now())
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
Return bSent
|
Return bSent
|
||||||
@@ -775,10 +790,17 @@ Public Class MachManaging
|
|||||||
|
|
||||||
Private Sub CommandList_CollectionChanged(sender As Object, e As NotifyCollectionChangedEventArgs)
|
Private Sub CommandList_CollectionChanged(sender As Object, e As NotifyCollectionChangedEventArgs)
|
||||||
If Not IsNothing(e.NewItems) Then
|
If Not IsNothing(e.NewItems) Then
|
||||||
For Each Command In e.NewItems
|
' EgtOutLog("Inizio ciclo esecuzione comandi")
|
||||||
ExecuteCommand(DirectCast(Command, ThreadCommand))
|
Dim nCommandCount As Integer = e.NewItems.Count
|
||||||
m_CommandList.Remove(Command)
|
For CommandIndex = 0 To nCommandCount - 1
|
||||||
|
Dim Command As ThreadCommand = e.NewItems(CommandIndex)
|
||||||
|
If Command.ProcessingStatus = ThreadCommand.ProcessingStatuses.WAITING Then
|
||||||
|
Command.SetProcessingStatus(ThreadCommand.ProcessingStatuses.PROCESSING)
|
||||||
|
ExecuteCommand(DirectCast(Command, ThreadCommand))
|
||||||
|
Command.SetProcessingStatus(ThreadCommand.ProcessingStatuses.DONE)
|
||||||
|
End If
|
||||||
Next
|
Next
|
||||||
|
' EgtOutLog("Fine ciclo esecuzione di " & nCommandCount & " comandi")
|
||||||
End If
|
End If
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
@@ -807,6 +829,7 @@ Public Class MachManaging
|
|||||||
Case CommandTypes.READ_TPA
|
Case CommandTypes.READ_TPA
|
||||||
Tpa.RWVariableManager.RefreshVar(Command.sVariable)
|
Tpa.RWVariableManager.RefreshVar(Command.sVariable)
|
||||||
Case CommandTypes.WRITE
|
Case CommandTypes.WRITE
|
||||||
|
'EgtOutLog("Write" & Command.sVariable & " " & Command.sVariables(1) & " " & Command.nVariable)
|
||||||
WriteVar(Command.sVariable, Command.sVariables(1), Command.nVariable)
|
WriteVar(Command.sVariable, Command.sVariables(1), Command.nVariable)
|
||||||
Case CommandTypes.DELETEALARMS
|
Case CommandTypes.DELETEALARMS
|
||||||
DeleteAlarms()
|
DeleteAlarms()
|
||||||
@@ -1047,7 +1070,7 @@ Public Class MachManaging
|
|||||||
Num_Axium_APServer.StartTransfer()
|
Num_Axium_APServer.StartTransfer()
|
||||||
Return True
|
Return True
|
||||||
Case NCTypes.NUM_AXIUM_PCTOOLKIT
|
Case NCTypes.NUM_AXIUM_PCTOOLKIT
|
||||||
EgtOutLog("Pre Download")
|
' EgtOutLog("Pre Download")
|
||||||
Dim nFileType As Integer = 0
|
Dim nFileType As Integer = 0
|
||||||
If Integer.TryParse(ProgramId, nFileType) AndAlso nFileType > 0 Then
|
If Integer.TryParse(ProgramId, nFileType) AndAlso nFileType > 0 Then
|
||||||
Num_Axium_PCToolkit.FileDownload(nFileType * 10, ProgramPath)
|
Num_Axium_PCToolkit.FileDownload(nFileType * 10, ProgramPath)
|
||||||
@@ -1169,7 +1192,7 @@ Public Class MachManaging
|
|||||||
EgtUILib.GetPrivateProfileString(IpAppName, IpKeyName, "", sVariable, IpFileName)
|
EgtUILib.GetPrivateProfileString(IpAppName, IpKeyName, "", sVariable, IpFileName)
|
||||||
If String.IsNullOrWhiteSpace(sVariable) Then Return Nothing
|
If String.IsNullOrWhiteSpace(sVariable) Then Return Nothing
|
||||||
Dim sVariableValues() As String = sVariable.Split(","c)
|
Dim sVariableValues() As String = sVariable.Split(","c)
|
||||||
If Not sVariableValues.Count >= 4 Then Return Nothing
|
'If Not sVariableValues.Count >= 4 Then Return Nothing
|
||||||
For Index As Integer = 0 To sVariableValues.Count - 1
|
For Index As Integer = 0 To sVariableValues.Count - 1
|
||||||
sVariableValues(Index) = sVariableValues(Index).Trim()
|
sVariableValues(Index) = sVariableValues(Index).Trim()
|
||||||
Next
|
Next
|
||||||
@@ -1200,7 +1223,25 @@ Public Class MachManaging
|
|||||||
Case S_OUTPUTVARIABLES
|
Case S_OUTPUTVARIABLES
|
||||||
Paragraph = Paragraphs.OUTPUT
|
Paragraph = Paragraphs.OUTPUT
|
||||||
End Select
|
End Select
|
||||||
Return New CommVar(sVariableValues(0), sVariableValues(1), ReadType, Type, Paragraph)
|
Dim sDescription As String = ""
|
||||||
|
If sVariableValues.Length >= 5 Then
|
||||||
|
Dim nDescription As Integer
|
||||||
|
If Integer.TryParse(sVariableValues(4), nDescription) Then
|
||||||
|
Dim MsgParagraph As MsgParagraphs
|
||||||
|
Select Case Paragraph
|
||||||
|
Case Paragraphs.INPUT
|
||||||
|
MsgParagraph = MsgParagraphs.INPUT
|
||||||
|
Case Paragraphs.OUTPUT
|
||||||
|
MsgParagraph = MsgParagraphs.OUTPUT
|
||||||
|
Case Else
|
||||||
|
MsgParagraph = MsgParagraphs.INPUT
|
||||||
|
End Select
|
||||||
|
sDescription = MachMsg(MsgParagraph, nDescription)
|
||||||
|
Else
|
||||||
|
sDescription = sVariableValues(4)
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
Return New CommVar(sVariableValues(0), sVariableValues(1), ReadType, Type, Paragraph, sDescription)
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
Private Sub ReadPLCMessages()
|
Private Sub ReadPLCMessages()
|
||||||
@@ -1209,10 +1250,8 @@ Public Class MachManaging
|
|||||||
Dim nIndex As Integer = Index
|
Dim nIndex As Integer = Index
|
||||||
Dim PLCMessagesVariable As Variable = Map.refMachCommandMessagePanelVM.MainVariablesList.FirstOrDefault(Function(x) x.sName = PLC_MESSAGES & nIndex)
|
Dim PLCMessagesVariable As Variable = Map.refMachCommandMessagePanelVM.MainVariablesList.FirstOrDefault(Function(x) x.sName = PLC_MESSAGES & nIndex)
|
||||||
If IsNothing(PLCMessagesVariable) OrElse IsNothing(PLCMessagesVariable.sValue) Then Return
|
If IsNothing(PLCMessagesVariable) OrElse IsNothing(PLCMessagesVariable.sValue) Then Return
|
||||||
Dim dTemp As Double = 0
|
|
||||||
Dim nTemp As Integer = 0
|
Dim nTemp As Integer = 0
|
||||||
StringToDouble(PLCMessagesVariable.sValue, dTemp)
|
Integer.TryParse(PLCMessagesVariable.sValue, nTemp)
|
||||||
Integer.TryParse(dTemp, nTemp)
|
|
||||||
Dim Bytes As Byte() = BitConverter.GetBytes(nTemp)
|
Dim Bytes As Byte() = BitConverter.GetBytes(nTemp)
|
||||||
Dim NewBytes As Byte() = BitConverter.GetBytes(nTemp)
|
Dim NewBytes As Byte() = BitConverter.GetBytes(nTemp)
|
||||||
For nBIndex = Bytes.Count - 1 To 0 Step -1
|
For nBIndex = Bytes.Count - 1 To 0 Step -1
|
||||||
|
|||||||
@@ -54,6 +54,12 @@ End Class
|
|||||||
|
|
||||||
Public Class ThreadCommand
|
Public Class ThreadCommand
|
||||||
|
|
||||||
|
Public Enum ProcessingStatuses
|
||||||
|
WAITING = 1
|
||||||
|
PROCESSING = 2
|
||||||
|
DONE = 3
|
||||||
|
End Enum
|
||||||
|
|
||||||
Private m_CommandType As CommandTypes
|
Private m_CommandType As CommandTypes
|
||||||
Public ReadOnly Property CommandType As CommandTypes
|
Public ReadOnly Property CommandType As CommandTypes
|
||||||
Get
|
Get
|
||||||
@@ -95,6 +101,16 @@ Public Class ThreadCommand
|
|||||||
End Get
|
End Get
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
|
Private m_ProcessingStatus As ProcessingStatuses = ProcessingStatuses.WAITING
|
||||||
|
Public ReadOnly Property ProcessingStatus As ProcessingStatuses
|
||||||
|
Get
|
||||||
|
Return m_ProcessingStatus
|
||||||
|
End Get
|
||||||
|
End Property
|
||||||
|
Friend Sub SetProcessingStatus(value As ProcessingStatuses)
|
||||||
|
m_ProcessingStatus = value
|
||||||
|
End Sub
|
||||||
|
|
||||||
Protected Sub New()
|
Protected Sub New()
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
|
|||||||
@@ -59,7 +59,7 @@ Public Class RWVariableManager
|
|||||||
|
|
||||||
Public Shared Function InitVar(Name As String, Address As String, Type As CommVar.ReadTypes) As Integer
|
Public Shared Function InitVar(Name As String, Address As String, Type As CommVar.ReadTypes) As Integer
|
||||||
Dim Index As Integer = Array.IndexOf(m_ReadingVars, Nothing)
|
Dim Index As Integer = Array.IndexOf(m_ReadingVars, Nothing)
|
||||||
m_ReadingVars(Index) = New CommVar(Name, Address, Type, CommVar.Types.NULL, CommVar.Paragraphs.NULL)
|
m_ReadingVars(Index) = New CommVar(Name, Address, Type, CommVar.Types.NULL, CommVar.Paragraphs.NULL, "")
|
||||||
Return Index
|
Return Index
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
@@ -101,7 +101,7 @@ Public Class RWVariableManager
|
|||||||
Case S_OUTPUTVARIABLES
|
Case S_OUTPUTVARIABLES
|
||||||
Paragraph = Paragraphs.OUTPUT
|
Paragraph = Paragraphs.OUTPUT
|
||||||
End Select
|
End Select
|
||||||
Return New CommVar(sVariableValues(0), sVariableValues(1), Type, CommVar.Types.NULL, Paragraph)
|
Return New CommVar(sVariableValues(0), sVariableValues(1), Type, CommVar.Types.NULL, Paragraph, "")
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
Public Sub RefreshVar(Name As String)
|
Public Sub RefreshVar(Name As String)
|
||||||
@@ -148,7 +148,7 @@ Public Class RWVariableManager
|
|||||||
Public Sub ReadVar(Name As String, ByRef Value As Double)
|
Public Sub ReadVar(Name As String, ByRef Value As Double)
|
||||||
Dim nIndex As Integer = GetIndexFromName(Name)
|
Dim nIndex As Integer = GetIndexFromName(Name)
|
||||||
If nIndex >= 0 Then
|
If nIndex >= 0 Then
|
||||||
Value = StringToDouble(m_ReadedVars(nIndex), 5)
|
Value = StringToDoubleAdv(m_ReadedVars(nIndex), 5)
|
||||||
Else
|
Else
|
||||||
Value = -999999999
|
Value = -999999999
|
||||||
End If
|
End If
|
||||||
@@ -266,6 +266,7 @@ Public Class CommVar
|
|||||||
m_sName = value
|
m_sName = value
|
||||||
End Set
|
End Set
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
Private m_sAddress As String
|
Private m_sAddress As String
|
||||||
Public Property sAddress As String
|
Public Property sAddress As String
|
||||||
Get
|
Get
|
||||||
@@ -275,12 +276,14 @@ Public Class CommVar
|
|||||||
m_sAddress = value
|
m_sAddress = value
|
||||||
End Set
|
End Set
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
Private m_nReadType As ReadTypes
|
Private m_nReadType As ReadTypes
|
||||||
Public ReadOnly Property nReadType As ReadTypes
|
Public ReadOnly Property nReadType As ReadTypes
|
||||||
Get
|
Get
|
||||||
Return m_nReadType
|
Return m_nReadType
|
||||||
End Get
|
End Get
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
Private m_nType As Types
|
Private m_nType As Types
|
||||||
Public ReadOnly Property nType As Types
|
Public ReadOnly Property nType As Types
|
||||||
Get
|
Get
|
||||||
@@ -306,6 +309,13 @@ Public Class CommVar
|
|||||||
If bNewValue Then RaiseEvent NewValue(Me, New NewValueEventArgs(Value))
|
If bNewValue Then RaiseEvent NewValue(Me, New NewValueEventArgs(Value))
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
|
Private m_sDescription As String
|
||||||
|
Public ReadOnly Property sDescription As String
|
||||||
|
Get
|
||||||
|
Return m_sDescription
|
||||||
|
End Get
|
||||||
|
End Property
|
||||||
|
|
||||||
Private m_bReaded As Boolean
|
Private m_bReaded As Boolean
|
||||||
Public ReadOnly Property bReaded As Boolean
|
Public ReadOnly Property bReaded As Boolean
|
||||||
Get
|
Get
|
||||||
@@ -324,12 +334,13 @@ Public Class CommVar
|
|||||||
' indice usato in liste lettura NUM
|
' indice usato in liste lettura NUM
|
||||||
Friend Index As Integer = -1
|
Friend Index As Integer = -1
|
||||||
|
|
||||||
Sub New(Name As String, Address As String, ReadType As ReadTypes, Type As Types, Paragraph As Paragraphs)
|
Sub New(Name As String, Address As String, ReadType As ReadTypes, Type As Types, Paragraph As Paragraphs, sDescription As String)
|
||||||
m_sName = Name
|
m_sName = Name
|
||||||
m_sAddress = Address
|
m_sAddress = Address
|
||||||
m_nReadType = ReadType
|
m_nReadType = ReadType
|
||||||
m_nType = Type
|
m_nType = Type
|
||||||
m_Paragraph = Paragraph
|
m_Paragraph = Paragraph
|
||||||
|
m_sDescription = sDescription
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Friend Sub ResetReading()
|
Friend Sub ResetReading()
|
||||||
|
|||||||
@@ -24,6 +24,47 @@
|
|||||||
</Button>
|
</Button>
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|
||||||
|
<StackPanel Orientation="Horizontal" Height="30">
|
||||||
|
<TextBlock Text="{Binding Entity_Msg}"
|
||||||
|
Style="{StaticResource Log_TextBlock}"/>
|
||||||
|
<ComboBox ItemsSource="{Binding EntityTypeList}"
|
||||||
|
SelectedIndex="{Binding SelEntityType}"
|
||||||
|
Width="70"
|
||||||
|
Margin="0,0,2.5,0"
|
||||||
|
Style="{StaticResource PartParam_ComboBox}"/>
|
||||||
|
<TextBlock Text="{Binding Event_Msg}"
|
||||||
|
Style="{StaticResource Log_TextBlock}"/>
|
||||||
|
<ComboBox ItemsSource="{Binding PartEventTypeList}"
|
||||||
|
SelectedIndex="{Binding SelPartEventType}"
|
||||||
|
Width="70"
|
||||||
|
Margin="0,0,2.5,0"
|
||||||
|
Style="{StaticResource PartParam_ComboBox}"/>
|
||||||
|
<TextBlock Text="{Binding Date_Msg}"
|
||||||
|
Style="{StaticResource Log_TextBlock}"/>
|
||||||
|
<ComboBox ItemsSource="{Binding DayTypeList}"
|
||||||
|
SelectedIndex="{Binding SelDayType}"
|
||||||
|
Width="70"
|
||||||
|
Margin="0,0,2.5,0"
|
||||||
|
Style="{StaticResource PartParam_ComboBox}"/>
|
||||||
|
<StackPanel Orientation="Horizontal" Visibility="{Binding Date_Visibility}">
|
||||||
|
<TextBlock Text="{Binding From_Msg}"
|
||||||
|
Style="{StaticResource Log_TextBlock}"/>
|
||||||
|
<DatePicker SelectedDate="{Binding dtStartDate}"
|
||||||
|
Style="{StaticResource Log_DatePicker}"/>
|
||||||
|
<TextBlock Text="{Binding To_Msg}"
|
||||||
|
Style="{StaticResource Log_TextBlock}"/>
|
||||||
|
<DatePicker SelectedDate="{Binding dtEndDate}"
|
||||||
|
Style="{StaticResource Log_DatePicker}"/>
|
||||||
|
</StackPanel>
|
||||||
|
<!--<TextBox Text="{Binding MaxRowNumber}"/>-->
|
||||||
|
<Button Grid.Column="1"
|
||||||
|
Command="{Binding Refresh_Command}"
|
||||||
|
Margin="2.5,0,5,0"
|
||||||
|
Style="{StaticResource ToolBar_Button}">
|
||||||
|
<Image Source="/Resources/MDIPage/Send.png" Stretch="Uniform"/>
|
||||||
|
</Button>
|
||||||
|
</StackPanel>
|
||||||
|
|
||||||
<EgtBEAMWALLCORE:EgtDataGrid ItemsSource="{Binding MachineLogList}"
|
<EgtBEAMWALLCORE:EgtDataGrid ItemsSource="{Binding MachineLogList}"
|
||||||
Grid.Row="1"
|
Grid.Row="1"
|
||||||
AutoGenerateColumns="False"
|
AutoGenerateColumns="False"
|
||||||
@@ -37,7 +78,8 @@
|
|||||||
BindingColumns="{Binding MachineLogColumns}">
|
BindingColumns="{Binding MachineLogColumns}">
|
||||||
<DataGrid.Resources>
|
<DataGrid.Resources>
|
||||||
<!-- Data/ora -->
|
<!-- Data/ora -->
|
||||||
<DataGridTextColumn x:Key="colDATETIME" Binding="{Binding sEventDateTime}">
|
<DataGridTextColumn x:Key="colDATETIME" Binding="{Binding sEventDateTime}"
|
||||||
|
SortMemberPath="sEventTick">
|
||||||
<DataGridTextColumn.HeaderTemplate>
|
<DataGridTextColumn.HeaderTemplate>
|
||||||
<DataTemplate>
|
<DataTemplate>
|
||||||
<TextBlock Text="{Binding Path=DataContext.EventDateTime_Msg,
|
<TextBlock Text="{Binding Path=DataContext.EventDateTime_Msg,
|
||||||
@@ -61,7 +103,7 @@
|
|||||||
<TextBlock Text="{Binding Path=DataContext.EventValue_Msg,
|
<TextBlock Text="{Binding Path=DataContext.EventValue_Msg,
|
||||||
RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:MachineLogPageV}}}"/>
|
RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:MachineLogPageV}}}"/>
|
||||||
</DataTemplate>
|
</DataTemplate>
|
||||||
</DataGridTextColumn.HeaderTemplate>
|
</DataGridTextColumn.HeaderTemplate>
|
||||||
</DataGridTextColumn>
|
</DataGridTextColumn>
|
||||||
<!-- SupervisorId -->
|
<!-- SupervisorId -->
|
||||||
<DataGridTextColumn x:Key="colSUPERVISORID" Binding="{Binding SupervisorId}">
|
<DataGridTextColumn x:Key="colSUPERVISORID" Binding="{Binding SupervisorId}">
|
||||||
@@ -91,7 +133,7 @@
|
|||||||
<DataGridTextColumn x:Key="colPART" Binding="{Binding PartId}">
|
<DataGridTextColumn x:Key="colPART" Binding="{Binding PartId}">
|
||||||
<DataGridTextColumn.HeaderTemplate>
|
<DataGridTextColumn.HeaderTemplate>
|
||||||
<DataTemplate>
|
<DataTemplate>
|
||||||
<TextBlock Text="{Binding Path=DataContext.PartId_Msg,
|
<TextBlock Text="{Binding Path=DataContext.PartId_Msg,
|
||||||
RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:MachineLogPageV}}}"/>
|
RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:MachineLogPageV}}}"/>
|
||||||
</DataTemplate>
|
</DataTemplate>
|
||||||
</DataGridTextColumn.HeaderTemplate>
|
</DataGridTextColumn.HeaderTemplate>
|
||||||
|
|||||||
@@ -9,6 +9,12 @@ Imports EgtBEAMWALL.Core.MachLog
|
|||||||
Public Class MachineLogPageVM
|
Public Class MachineLogPageVM
|
||||||
Inherits VMBase
|
Inherits VMBase
|
||||||
|
|
||||||
|
Private Enum DayTypes As Integer
|
||||||
|
TODAY = 0
|
||||||
|
YESTERDAY = 1
|
||||||
|
PERIOD = 2
|
||||||
|
End Enum
|
||||||
|
|
||||||
Private m_colMachineLog_Type As EgtDataGridColumn
|
Private m_colMachineLog_Type As EgtDataGridColumn
|
||||||
Public ReadOnly Property colMachineLog_Type As EgtDataGridColumn
|
Public ReadOnly Property colMachineLog_Type As EgtDataGridColumn
|
||||||
Get
|
Get
|
||||||
@@ -62,6 +68,108 @@ Public Class MachineLogPageVM
|
|||||||
End Set
|
End Set
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
|
Private m_PartEventTypeList As New List(Of String)({"", EgtMsg(62527), EgtMsg(62528)})
|
||||||
|
Public ReadOnly Property PartEventTypeList As List(Of String)
|
||||||
|
Get
|
||||||
|
Return m_PartEventTypeList
|
||||||
|
End Get
|
||||||
|
End Property
|
||||||
|
|
||||||
|
Private m_SelPartEventType As Integer
|
||||||
|
Public Property SelPartEventType As Integer
|
||||||
|
Get
|
||||||
|
Return m_SelPartEventType
|
||||||
|
End Get
|
||||||
|
Set(value As Integer)
|
||||||
|
m_SelPartEventType = value
|
||||||
|
WriteMainPrivateProfileString(S_MACHINELOGFILTER, K_PARTEVENTTYPE, m_SelPartEventType.ToString())
|
||||||
|
m_MachineLogList_View.Refresh()
|
||||||
|
End Set
|
||||||
|
End Property
|
||||||
|
|
||||||
|
Private m_EntityTypeList As New List(Of String)({"", EgtMsg(62525), EgtMsg(62526)})
|
||||||
|
Public ReadOnly Property EntityTypeList As List(Of String)
|
||||||
|
Get
|
||||||
|
Return m_EntityTypeList
|
||||||
|
End Get
|
||||||
|
End Property
|
||||||
|
|
||||||
|
Private m_SelEntityType As Integer
|
||||||
|
Public Property SelEntityType As Integer
|
||||||
|
Get
|
||||||
|
Return m_SelEntityType
|
||||||
|
End Get
|
||||||
|
Set(value As Integer)
|
||||||
|
m_SelEntityType = value
|
||||||
|
WriteMainPrivateProfileString(S_MACHINELOGFILTER, K_ENTITYTYPE, m_SelEntityType.ToString())
|
||||||
|
m_MachineLogList_View.Refresh()
|
||||||
|
End Set
|
||||||
|
End Property
|
||||||
|
|
||||||
|
Private m_DayTypeList As New List(Of String)({EgtMsg(62529), EgtMsg(62530), EgtMsg(62531)})
|
||||||
|
Public ReadOnly Property DayTypeList As List(Of String)
|
||||||
|
Get
|
||||||
|
Return m_DayTypeList
|
||||||
|
End Get
|
||||||
|
End Property
|
||||||
|
|
||||||
|
Private m_SelDayType As DayTypes = DayTypes.TODAY
|
||||||
|
Public Property SelDayType As Integer
|
||||||
|
Get
|
||||||
|
Return m_SelDayType
|
||||||
|
End Get
|
||||||
|
Set(value As Integer)
|
||||||
|
Dim PrevSelDayType As DayTypes = m_SelDayType
|
||||||
|
m_SelDayType = value
|
||||||
|
WriteMainPrivateProfileString(S_MACHINELOGFILTER, K_DAYTYPE, Convert.ToInt32(m_SelDayType))
|
||||||
|
m_Date_Visibility = If(m_SelDayType = DayTypes.PERIOD, Visibility.Visible, Visibility.Collapsed)
|
||||||
|
If m_SelDayType = DayTypes.PERIOD Then
|
||||||
|
m_dtStartDate = If(PrevSelDayType = DayTypes.TODAY, DateTime.Today, DateTime.Today - TimeSpan.FromDays(1))
|
||||||
|
m_dtEndDate = If(PrevSelDayType = DayTypes.TODAY, DateTime.Today, DateTime.Today - TimeSpan.FromDays(1))
|
||||||
|
NotifyPropertyChanged(NameOf(dtStartDate))
|
||||||
|
NotifyPropertyChanged(NameOf(dtEndDate))
|
||||||
|
End If
|
||||||
|
NotifyPropertyChanged(NameOf(Date_Visibility))
|
||||||
|
' aggiorno lista da Db
|
||||||
|
UpdateMachineLogList()
|
||||||
|
End Set
|
||||||
|
End Property
|
||||||
|
|
||||||
|
Private m_dtStartDate As DateTime = DateTime.Today
|
||||||
|
Public Property dtStartDate As DateTime
|
||||||
|
Get
|
||||||
|
Return m_dtStartDate
|
||||||
|
End Get
|
||||||
|
Set(value As DateTime)
|
||||||
|
m_dtStartDate = value
|
||||||
|
Dim lStartDate As Long = m_dtStartDate.ToFileTimeUtc()
|
||||||
|
WriteMainPrivateProfileString(S_MACHINELOGFILTER, K_STARTDATE, lStartDate.ToString())
|
||||||
|
' aggiorno lista da Db
|
||||||
|
UpdateMachineLogList()
|
||||||
|
End Set
|
||||||
|
End Property
|
||||||
|
|
||||||
|
Private m_dtEndDate As DateTime = DateTime.Today
|
||||||
|
Public Property dtEndDate As DateTime
|
||||||
|
Get
|
||||||
|
Return m_dtEndDate
|
||||||
|
End Get
|
||||||
|
Set(value As DateTime)
|
||||||
|
m_dtEndDate = value
|
||||||
|
Dim lEndDate As Long = m_dtEndDate.ToFileTimeUtc()
|
||||||
|
WriteMainPrivateProfileString(S_MACHINELOGFILTER, K_ENDDATE, lEndDate.ToString())
|
||||||
|
' aggiorno lista da Db
|
||||||
|
UpdateMachineLogList()
|
||||||
|
End Set
|
||||||
|
End Property
|
||||||
|
|
||||||
|
Private m_Date_Visibility As Visibility = Visibility.Collapsed
|
||||||
|
Public ReadOnly Property Date_Visibility As Visibility
|
||||||
|
Get
|
||||||
|
Return m_Date_Visibility
|
||||||
|
End Get
|
||||||
|
End Property
|
||||||
|
|
||||||
' Definizione comandi
|
' Definizione comandi
|
||||||
Private m_cmdRefresh As ICommand
|
Private m_cmdRefresh As ICommand
|
||||||
|
|
||||||
@@ -115,6 +223,35 @@ Public Class MachineLogPageVM
|
|||||||
End Get
|
End Get
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
|
Public ReadOnly Property Entity_Msg As String
|
||||||
|
Get
|
||||||
|
Return EgtMsg(62520)
|
||||||
|
End Get
|
||||||
|
End Property
|
||||||
|
|
||||||
|
Public ReadOnly Property Event_Msg As String
|
||||||
|
Get
|
||||||
|
Return EgtMsg(62521)
|
||||||
|
End Get
|
||||||
|
End Property
|
||||||
|
|
||||||
|
Public ReadOnly Property Date_Msg As String
|
||||||
|
Get
|
||||||
|
Return EgtMsg(62522)
|
||||||
|
End Get
|
||||||
|
End Property
|
||||||
|
|
||||||
|
Public ReadOnly Property From_Msg As String
|
||||||
|
Get
|
||||||
|
Return EgtMsg(62523)
|
||||||
|
End Get
|
||||||
|
End Property
|
||||||
|
|
||||||
|
Public ReadOnly Property To_Msg As String
|
||||||
|
Get
|
||||||
|
Return EgtMsg(62524)
|
||||||
|
End Get
|
||||||
|
End Property
|
||||||
|
|
||||||
#End Region ' Messages
|
#End Region ' Messages
|
||||||
|
|
||||||
@@ -131,24 +268,64 @@ Public Class MachineLogPageVM
|
|||||||
m_colMachineLog_Type = m_MachineLogColumns.FirstOrDefault(Function(x) x.Name = COL_TYPE)
|
m_colMachineLog_Type = m_MachineLogColumns.FirstOrDefault(Function(x) x.Name = COL_TYPE)
|
||||||
m_colMachineLog_Description = m_MachineLogColumns.FirstOrDefault(Function(x) x.Name = COL_DESCRIPTION)
|
m_colMachineLog_Description = m_MachineLogColumns.FirstOrDefault(Function(x) x.Name = COL_DESCRIPTION)
|
||||||
m_colMachineLog_SupervisorId = m_MachineLogColumns.FirstOrDefault(Function(x) x.Name = COL_SUPERVISORID)
|
m_colMachineLog_SupervisorId = m_MachineLogColumns.FirstOrDefault(Function(x) x.Name = COL_SUPERVISORID)
|
||||||
|
' imposto valori filtri da ini
|
||||||
|
m_SelPartEventType = GetMainPrivateProfileInt(S_MACHINELOGFILTER, K_PARTEVENTTYPE, 2)
|
||||||
|
m_SelEntityType = GetMainPrivateProfileInt(S_MACHINELOGFILTER, K_ENTITYTYPE, 1)
|
||||||
|
m_SelDayType = GetMainPrivateProfileInt(S_MACHINELOGFILTER, K_DAYTYPE, 0)
|
||||||
|
Select Case m_SelDayType
|
||||||
|
Case DayTypes.TODAY
|
||||||
|
m_dtStartDate = DateTime.Today
|
||||||
|
m_dtEndDate = DateTime.Today
|
||||||
|
Case DayTypes.YESTERDAY
|
||||||
|
m_dtStartDate = DateTime.Today - TimeSpan.FromDays(1)
|
||||||
|
m_dtEndDate = DateTime.Today - TimeSpan.FromDays(1)
|
||||||
|
Case DayTypes.PERIOD
|
||||||
|
Dim sStartDate As String = "0"
|
||||||
|
Dim lStartDate As Long = 0
|
||||||
|
GetMainPrivateProfileString(S_MACHINELOGFILTER, K_STARTDATE, 0, sStartDate)
|
||||||
|
Long.TryParse(sStartDate, lStartDate)
|
||||||
|
m_dtStartDate = If(lStartDate > 0, DateTime.FromFileTimeUtc(lStartDate), DateTime.Today)
|
||||||
|
Dim sEndDate As String = "0"
|
||||||
|
Dim lEndDate As Long = 0
|
||||||
|
GetMainPrivateProfileString(S_MACHINELOGFILTER, K_ENDDATE, 0, sEndDate)
|
||||||
|
Long.TryParse(sEndDate, lEndDate)
|
||||||
|
m_dtEndDate = If(lEndDate > 0, DateTime.FromFileTimeUtc(lEndDate), DateTime.Today)
|
||||||
|
m_Date_Visibility = Visibility.Visible
|
||||||
|
End Select
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
#End Region ' CONSTRUCTORS
|
#End Region ' CONSTRUCTORS
|
||||||
|
|
||||||
#Region "METHODS"
|
#Region "METHODS"
|
||||||
|
|
||||||
Private Function MachineLogFilter(LogEvent As Object) As Boolean
|
Private Function MachineLogFilter(CurrEvent As Object) As Boolean
|
||||||
Dim CurrLogEvent As LogEvent = DirectCast(LogEvent, LogEvent)
|
Dim CurrLogEvent As LogEvent = DirectCast(CurrEvent, LogEvent)
|
||||||
|
Dim bOk As Boolean = True
|
||||||
' se livello utente inferiore a 5, mostro solo eventi pezzo e machgroup
|
' se livello utente inferiore a 5, mostro solo eventi pezzo e machgroup
|
||||||
If Map.refMainWindowVM.MainWindowM.nUserLevel < 5 Then
|
If Map.refMainWindowVM.MainWindowM.nUserLevel < 5 Then
|
||||||
If CurrLogEvent.EventType = MachLogTypes.PART_STATUS Then
|
If CurrLogEvent.EventType <> LogEvent.MachLogTypes.PART_STATUS AndAlso CurrLogEvent.EventType <> LogEvent.MachLogTypes.MACHGROUP_STATUS Then
|
||||||
Return True
|
|
||||||
Else
|
|
||||||
Return False
|
Return False
|
||||||
End If
|
End If
|
||||||
Else
|
|
||||||
Return True
|
|
||||||
End If
|
End If
|
||||||
|
Select Case m_SelEntityType
|
||||||
|
Case 0 ' ""
|
||||||
|
bOk = bOk And True
|
||||||
|
Case 1 ' "Pezzo"
|
||||||
|
bOk = bOk And CurrLogEvent.EventType = LogEvent.MachLogTypes.PART_STATUS
|
||||||
|
Case 2 ' "Barra"
|
||||||
|
bOk = bOk And CurrLogEvent.EventType = LogEvent.MachLogTypes.MACHGROUP_STATUS
|
||||||
|
End Select
|
||||||
|
If CurrLogEvent.EventType = LogEvent.MachLogTypes.PART_STATUS OrElse CurrLogEvent.EventType = LogEvent.MachLogTypes.MACHGROUP_STATUS Then
|
||||||
|
Select Case m_SelPartEventType
|
||||||
|
Case 0 ' ""
|
||||||
|
bOk = bOk And True
|
||||||
|
Case 1 ' "Inizio"
|
||||||
|
bOk = bOk And CurrLogEvent.nStatus = 1
|
||||||
|
Case 2 ' "Fine"
|
||||||
|
bOk = bOk And CurrLogEvent.nStatus = 2
|
||||||
|
End Select
|
||||||
|
End If
|
||||||
|
Return bOk
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
Friend Sub LoadMachineLogList()
|
Friend Sub LoadMachineLogList()
|
||||||
@@ -157,7 +334,21 @@ Public Class MachineLogPageVM
|
|||||||
m_colMachineLog_Description.ColumnVisibility = Visibility.Collapsed
|
m_colMachineLog_Description.ColumnVisibility = Visibility.Collapsed
|
||||||
m_colMachineLog_SupervisorId.ColumnVisibility = Visibility.Collapsed
|
m_colMachineLog_SupervisorId.ColumnVisibility = Visibility.Collapsed
|
||||||
End If
|
End If
|
||||||
m_MachineLogList = New ObservableCollection(Of LogEvent)(DbControllers.m_LogMachineController.GetCoreDesc(DateTime.Now - TimeSpan.FromDays(300), DateTime.Now).Select(Of LogEvent)(Function(x) New LogEvent(x)).ToList())
|
UpdateMachineLogList()
|
||||||
|
m_MachineLogList_View = CollectionViewSource.GetDefaultView(m_MachineLogList)
|
||||||
|
m_MachineLogList_View.Filter = AddressOf MachineLogFilter
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Friend Sub UpdateMachineLogList()
|
||||||
|
'm_MachineLogList = New ObservableCollection(Of LogEvent)(DbControllers.m_LogMachineController.GetCoreDesc(DateTime.Now - TimeSpan.FromDays(300), DateTime.Now).Select(Of LogEvent)(Function(x) New LogEvent(x)).ToList())
|
||||||
|
Select Case m_SelDayType
|
||||||
|
Case DayTypes.TODAY
|
||||||
|
m_MachineLogList = New ObservableCollection(Of LogEvent)(DbControllers.m_LogMachineController.GetCoreDesc(DateTime.Today, DateTime.Today + TimeSpan.FromDays(1)).Select(Of LogEvent)(Function(x) New LogEvent(x)).ToList())
|
||||||
|
Case DayTypes.YESTERDAY
|
||||||
|
m_MachineLogList = New ObservableCollection(Of LogEvent)(DbControllers.m_LogMachineController.GetCoreDesc(DateTime.Today - TimeSpan.FromDays(1), DateTime.Today).Select(Of LogEvent)(Function(x) New LogEvent(x)).ToList())
|
||||||
|
Case DayTypes.PERIOD
|
||||||
|
m_MachineLogList = New ObservableCollection(Of LogEvent)(DbControllers.m_LogMachineController.GetCoreDesc(m_dtStartDate, m_dtEndDate + TimeSpan.FromDays(1)).Select(Of LogEvent)(Function(x) New LogEvent(x)).ToList())
|
||||||
|
End Select
|
||||||
NotifyPropertyChanged(NameOf(MachineLogList))
|
NotifyPropertyChanged(NameOf(MachineLogList))
|
||||||
m_MachineLogList_View = CollectionViewSource.GetDefaultView(m_MachineLogList)
|
m_MachineLogList_View = CollectionViewSource.GetDefaultView(m_MachineLogList)
|
||||||
m_MachineLogList_View.Filter = AddressOf MachineLogFilter
|
m_MachineLogList_View.Filter = AddressOf MachineLogFilter
|
||||||
@@ -185,7 +376,7 @@ Public Class MachineLogPageVM
|
|||||||
''' Execute the Open. This method is invoked by the OpenCommand.
|
''' Execute the Open. This method is invoked by the OpenCommand.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
Friend Sub Refresh()
|
Friend Sub Refresh()
|
||||||
m_MachineLogList_View.Refresh()
|
UpdateMachineLogList()
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
#End Region ' Refresh
|
#End Region ' Refresh
|
||||||
@@ -195,6 +386,7 @@ Public Class MachineLogPageVM
|
|||||||
End Class
|
End Class
|
||||||
|
|
||||||
Public Class MachLogType
|
Public Class MachLogType
|
||||||
|
Inherits VMBase
|
||||||
|
|
||||||
Private m_nId As Integer
|
Private m_nId As Integer
|
||||||
Public ReadOnly Property nId As Integer
|
Public ReadOnly Property nId As Integer
|
||||||
|
|||||||
@@ -277,31 +277,31 @@ Public Class MainMenuVM
|
|||||||
|
|
||||||
Private Function InitINPUTS() As Boolean
|
Private Function InitINPUTS() As Boolean
|
||||||
' fermo e riavvio lettura variabili per includere quelle della pagina input
|
' fermo e riavvio lettura variabili per includere quelle della pagina input
|
||||||
MachManaging.CommandList.Add(ThreadCommand.CreateCommand(CommandTypes.STOPREAD_NUMFLEXIUM))
|
MachManaging.AddToCommandList(ThreadCommand.CreateCommand(CommandTypes.STOPREAD_NUMFLEXIUM))
|
||||||
MachManaging.CommandList.Add(ThreadCommand.CreateCommand(CommandTypes.READ_NUMFLEXIUM))
|
MachManaging.AddToCommandList(ThreadCommand.CreateCommand(CommandTypes.READ_NUMFLEXIUM))
|
||||||
Map.refMainWindowVM.NotifyPropertyChanged(NameOf(Map.refMainWindowVM.nSelTabPage))
|
Map.refMainWindowVM.NotifyPropertyChanged(NameOf(Map.refMainWindowVM.nSelTabPage))
|
||||||
Return True
|
Return True
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
Private Function ExitINPUTS() As Boolean
|
Private Function ExitINPUTS() As Boolean
|
||||||
' fermo e riavvio lettura variabili per includere quelle della pagina input
|
' fermo e riavvio lettura variabili per includere quelle della pagina input
|
||||||
MachManaging.CommandList.Add(ThreadCommand.CreateCommand(CommandTypes.STOPREAD_NUMFLEXIUM))
|
MachManaging.AddToCommandList(ThreadCommand.CreateCommand(CommandTypes.STOPREAD_NUMFLEXIUM))
|
||||||
MachManaging.CommandList.Add(ThreadCommand.CreateCommand(CommandTypes.READ_NUMFLEXIUM))
|
MachManaging.AddToCommandList(ThreadCommand.CreateCommand(CommandTypes.READ_NUMFLEXIUM))
|
||||||
Return True
|
Return True
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
Private Function InitOUTPUTS() As Boolean
|
Private Function InitOUTPUTS() As Boolean
|
||||||
' fermo e riavvio lettura variabili per includere quelle della pagina input
|
' fermo e riavvio lettura variabili per includere quelle della pagina input
|
||||||
MachManaging.CommandList.Add(ThreadCommand.CreateCommand(CommandTypes.STOPREAD_NUMFLEXIUM))
|
MachManaging.AddToCommandList(ThreadCommand.CreateCommand(CommandTypes.STOPREAD_NUMFLEXIUM))
|
||||||
MachManaging.CommandList.Add(ThreadCommand.CreateCommand(CommandTypes.READ_NUMFLEXIUM))
|
MachManaging.AddToCommandList(ThreadCommand.CreateCommand(CommandTypes.READ_NUMFLEXIUM))
|
||||||
Map.refMainWindowVM.NotifyPropertyChanged(NameOf(Map.refMainWindowVM.nSelTabPage))
|
Map.refMainWindowVM.NotifyPropertyChanged(NameOf(Map.refMainWindowVM.nSelTabPage))
|
||||||
Return True
|
Return True
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
Private Function ExitOUTPUTS() As Boolean
|
Private Function ExitOUTPUTS() As Boolean
|
||||||
' fermo e riavvio lettura variabili per includere quelle della pagina input
|
' fermo e riavvio lettura variabili per includere quelle della pagina input
|
||||||
MachManaging.CommandList.Add(ThreadCommand.CreateCommand(CommandTypes.STOPREAD_NUMFLEXIUM))
|
MachManaging.AddToCommandList(ThreadCommand.CreateCommand(CommandTypes.STOPREAD_NUMFLEXIUM))
|
||||||
MachManaging.CommandList.Add(ThreadCommand.CreateCommand(CommandTypes.READ_NUMFLEXIUM))
|
MachManaging.AddToCommandList(ThreadCommand.CreateCommand(CommandTypes.READ_NUMFLEXIUM))
|
||||||
Return True
|
Return True
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ Imports System.Math
|
|||||||
Imports EgtUILib
|
Imports EgtUILib
|
||||||
Imports EgtWPFLib5
|
Imports EgtWPFLib5
|
||||||
Imports EgtBEAMWALL.Core
|
Imports EgtBEAMWALL.Core
|
||||||
|
Imports System.IO
|
||||||
|
|
||||||
Public Class MainWindowM
|
Public Class MainWindowM
|
||||||
|
|
||||||
@@ -18,6 +19,13 @@ Public Class MainWindowM
|
|||||||
End Get
|
End Get
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
|
Private m_sDataDir As String = String.Empty
|
||||||
|
Friend ReadOnly Property sDataDir As String
|
||||||
|
Get
|
||||||
|
Return m_sDataDir
|
||||||
|
End Get
|
||||||
|
End Property
|
||||||
|
|
||||||
Private m_sConfigDir As String = String.Empty
|
Private m_sConfigDir As String = String.Empty
|
||||||
Public ReadOnly Property sConfigDir As String
|
Public ReadOnly Property sConfigDir As String
|
||||||
Get
|
Get
|
||||||
@@ -190,6 +198,8 @@ Public Class MainWindowM
|
|||||||
IniFile.m_sIniFile = m_sConfigDir & "\" & Core.ConstIni.INI_FILE_NAME
|
IniFile.m_sIniFile = m_sConfigDir & "\" & Core.ConstIni.INI_FILE_NAME
|
||||||
' Impostazione path BTL Ini File
|
' Impostazione path BTL Ini File
|
||||||
BTLIniFile.m_sBTLIniFile = m_sConfigDir & "\" & BTLFEATURES_FILE_NAME
|
BTLIniFile.m_sBTLIniFile = m_sConfigDir & "\" & BTLFEATURES_FILE_NAME
|
||||||
|
' Impostazione path Ini file DataGrid
|
||||||
|
DataGridColumnsIniFile.m_sDataGridColumnsIniFile = m_sConfigDir & "\" & DATAGRIDCOLUMNS_FILE_NAME
|
||||||
' Impostazione path Ini file Dimensioni
|
' Impostazione path Ini file Dimensioni
|
||||||
DimensionsIniFile.m_sDimensionsIniFile = m_sConfigDir & "\" & ConstDims.DIMENSIONS_FILE_NAME
|
DimensionsIniFile.m_sDimensionsIniFile = m_sConfigDir & "\" & ConstDims.DIMENSIONS_FILE_NAME
|
||||||
' Impostazione path resources dir
|
' Impostazione path resources dir
|
||||||
@@ -209,13 +219,10 @@ Public Class MainWindowM
|
|||||||
If GetMainPrivateProfileString(S_WALL, K_WALLBASEDIR, "", m_sWallRoot) = 0 Then
|
If GetMainPrivateProfileString(S_WALL, K_WALLBASEDIR, "", m_sWallRoot) = 0 Then
|
||||||
m_sWallRoot = m_sDataRoot & "\" & WALL_DIR
|
m_sWallRoot = m_sDataRoot & "\" & WALL_DIR
|
||||||
End If
|
End If
|
||||||
m_sProjsDir = m_sDataRoot & "\" & PROJS_DIR
|
' Impostazione direttorio magazzino grezzi
|
||||||
m_sProdsDir = m_sDataRoot & "\" & PRODS_DIR
|
If GetMainPrivateProfileString(S_GENERAL, K_DATADIR, "", m_sDataDir) = 0 Then
|
||||||
m_sWarehouseRoot = m_sDataRoot & "\" & WAREHOUSE_DIR
|
m_sDataDir = m_sDataRoot
|
||||||
' imposto cartelle dei progetti
|
End If
|
||||||
ProjectFileVM.Init(sProjsDir, sProdsDir)
|
|
||||||
' Impostazione path Ini file DataGrid
|
|
||||||
Core.DataGridColumnsIniFile.m_sDataGridColumnsIniFile = m_sConfigDir & "\" & DATAGRIDCOLUMNS_FILE_NAME
|
|
||||||
' Verifico indice di istanza
|
' Verifico indice di istanza
|
||||||
ManageInstance()
|
ManageInstance()
|
||||||
' Imposto tipo di chiave
|
' Imposto tipo di chiave
|
||||||
@@ -232,9 +239,17 @@ Public Class MainWindowM
|
|||||||
EgtSetNestKey(sNestKey)
|
EgtSetNestKey(sNestKey)
|
||||||
' Verifico abilitazione nesting automatico
|
' Verifico abilitazione nesting automatico
|
||||||
m_bAutoNestOption = Not String.IsNullOrWhiteSpace(sNestKey)
|
m_bAutoNestOption = Not String.IsNullOrWhiteSpace(sNestKey)
|
||||||
|
' Impostazioni per chiave di rete
|
||||||
|
Dim bNetKey As Boolean = ( GetMainPrivateProfileInt( S_GENERAL, K_NETKEY, 0) = 1)
|
||||||
|
EgtSetNetHwKey( bNetKey)
|
||||||
|
Dim sLockId As String = ""
|
||||||
|
EgtUILib.GetPrivateProfileString( S_LICENCE, K_LOCKID, "", sLockId, sLicFile)
|
||||||
|
If Not String.IsNullOrEmpty( sLockId) Then
|
||||||
|
EgtSetLockId( sLockId)
|
||||||
|
End If
|
||||||
' Recupero livello e opzioni della chiave
|
' Recupero livello e opzioni della chiave
|
||||||
Dim bKey As Boolean = EgtGetKeyLevel(5327, 2407, 1, m_nKeyLevel) And
|
Dim bKey As Boolean = EgtGetKeyLevel(5327, 2506, 1, m_nKeyLevel) And
|
||||||
EgtGetKeyOptions(5327, 2407, 1, m_nKeyOptions)
|
EgtGetKeyOptions(5327, 2506, 1, m_nKeyOptions)
|
||||||
' Inizializzazione generale di EgtInterface
|
' Inizializzazione generale di EgtInterface
|
||||||
m_nDebug = GetMainPrivateProfileInt(S_GENERAL, K_DEBUG, 0)
|
m_nDebug = GetMainPrivateProfileInt(S_GENERAL, K_DEBUG, 0)
|
||||||
m_sLogFile = m_sTempDir & "\" & SUPGENLOG_FILE_NAME.Replace("#", m_nInstance.ToString())
|
m_sLogFile = m_sTempDir & "\" & SUPGENLOG_FILE_NAME.Replace("#", m_nInstance.ToString())
|
||||||
@@ -387,6 +402,30 @@ Public Class MainWindowM
|
|||||||
Core.ProjectFileVM.Init(sProjsDir, sProdsDir)
|
Core.ProjectFileVM.Init(sProjsDir, sProdsDir)
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
|
Friend Sub UpdatePathForKey(sKey As String)
|
||||||
|
m_sProjsDir = m_sDataDir & "\" & sKey & "\" & PROJS_DIR
|
||||||
|
m_sProdsDir = m_sDataDir & "\" & sKey & "\" & PRODS_DIR
|
||||||
|
If Not Directory.Exists(m_sDataDir & "\" & sKey) Then
|
||||||
|
Directory.CreateDirectory(m_sDataDir & "\" & sKey & "\" & PROJS_DIR)
|
||||||
|
Directory.CreateDirectory(m_sDataDir & "\" & sKey & "\" & PRODS_DIR)
|
||||||
|
End If
|
||||||
|
' imposto cartelle dei progetti
|
||||||
|
Core.ProjectFileVM.Init(sProjsDir, sProdsDir)
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Friend Function GetKeyNumber() As Integer
|
||||||
|
Dim sKey As String = ""
|
||||||
|
Dim nKey As Integer = 0
|
||||||
|
EgtGetKeyInfo(sKey)
|
||||||
|
sKey = sKey.Replace(" ", "")
|
||||||
|
If Not IsNothing(sKey) AndAlso sKey.Length > 11 Then
|
||||||
|
If Integer.TryParse(sKey.Substring(3, 6), nKey) AndAlso nKey > 0 Then
|
||||||
|
Return nKey
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
Return -1
|
||||||
|
End Function
|
||||||
|
|
||||||
Friend Sub Close()
|
Friend Sub Close()
|
||||||
' Terminazione generale di EgtInterface
|
' Terminazione generale di EgtInterface
|
||||||
EgtExit()
|
EgtExit()
|
||||||
|
|||||||
@@ -234,7 +234,7 @@ Public Class MainWindowVM
|
|||||||
Return
|
Return
|
||||||
End If
|
End If
|
||||||
' disconnetto comunicazione con macchina
|
' disconnetto comunicazione con macchina
|
||||||
MachManaging.CommandList.Add(ThreadCommand.CreateCommand(CommandTypes.DISCONNECT))
|
MachManaging.AddToCommandList(ThreadCommand.CreateCommand(CommandTypes.DISCONNECT))
|
||||||
' termino thread di comunicazione con Db ed altri programmi
|
' termino thread di comunicazione con Db ed altri programmi
|
||||||
ViewerOptimizerCommThread.StopThread()
|
ViewerOptimizerCommThread.StopThread()
|
||||||
' Verifico modifica parametri in Configurazione e chiedo il salvataggio
|
' Verifico modifica parametri in Configurazione e chiedo il salvataggio
|
||||||
|
|||||||
@@ -11,11 +11,26 @@ Imports System.Windows
|
|||||||
|
|
||||||
' Review the values of the assembly attributes
|
' Review the values of the assembly attributes
|
||||||
|
|
||||||
<Assembly: AssemblyTitle("EgtBEAMWALL.Supervisor")>
|
#If PLATFORM = "x64" Then
|
||||||
<Assembly: AssemblyDescription("")>
|
#If DEBUG Then
|
||||||
|
<Assembly: AssemblyTitle("EgtBEAMWALL.SupervisorD64.exe")>
|
||||||
|
<Assembly: AssemblyDescription("EgtBEAMWALL S Debug 32 bit")>
|
||||||
|
#Else
|
||||||
|
<Assembly: AssemblyTitle("EgtBEAMWALL.SupervisorR64.exe")>
|
||||||
|
<Assembly: AssemblyDescription("EgtBEAMWALL S 32 bit")>
|
||||||
|
#End if
|
||||||
|
#Else
|
||||||
|
#If DEBUG Then
|
||||||
|
<Assembly: AssemblyTitle("EgtBEAMWALL.SupervisorD32.exe")>
|
||||||
|
<Assembly: AssemblyDescription("EgtBEAMWALL S Debug 32 bit")>
|
||||||
|
#Else
|
||||||
|
<Assembly: AssemblyTitle("EgtBEAMWALL.SupervisorR32.exe")>
|
||||||
|
<Assembly: AssemblyDescription("EgtBEAMWALL S 32 bit")>
|
||||||
|
#End if
|
||||||
|
#End if
|
||||||
<Assembly: AssemblyCompany("Egalware s.r.l.")>
|
<Assembly: AssemblyCompany("Egalware s.r.l.")>
|
||||||
<Assembly: AssemblyProduct("EgtBEAMWALL.Supervisor")>
|
<Assembly: AssemblyProduct("EgtBEAMWALL.Supervisor")>
|
||||||
<Assembly: AssemblyCopyright("Copyright © 2020-2022 by Egalware s.r.l.")>
|
<Assembly: AssemblyCopyright("Copyright © 2020-2023 by Egalware s.r.l.")>
|
||||||
<Assembly: AssemblyTrademark("")>
|
<Assembly: AssemblyTrademark("")>
|
||||||
<Assembly: ComVisible(false)>
|
<Assembly: ComVisible(false)>
|
||||||
|
|
||||||
@@ -55,5 +70,5 @@ Imports System.Windows
|
|||||||
' by using the '*' as shown below:
|
' by using the '*' as shown below:
|
||||||
' <Assembly: AssemblyVersion("1.0.*")>
|
' <Assembly: AssemblyVersion("1.0.*")>
|
||||||
|
|
||||||
<Assembly: AssemblyVersion("2.4.7.1")>
|
<Assembly: AssemblyVersion("2.5.6.2")>
|
||||||
<Assembly: AssemblyFileVersion("2.4.7.1")>
|
<Assembly: AssemblyFileVersion("2.5.6.2")>
|
||||||
|
|||||||
@@ -12,19 +12,12 @@ Public Class OpenProjectFileDialogVM
|
|||||||
Public Overrides Function Init(ProjectType As ProjectType, Optional CurrProjectList As List(Of ProjectFileVM) = Nothing, Optional GoToProd As Boolean = False) As Boolean?
|
Public Overrides Function Init(ProjectType As ProjectType, Optional CurrProjectList As List(Of ProjectFileVM) = Nothing, Optional GoToProd As Boolean = False) As Boolean?
|
||||||
m_ProjectType = ProjectType
|
m_ProjectType = ProjectType
|
||||||
' carico colonne
|
' carico colonne
|
||||||
LoadColumns(ProjectType)
|
LoadColumns(m_ProjectType)
|
||||||
NotifyPropertyChanged(NameOf(SearchColumnList))
|
NotifyPropertyChanged(NameOf(FilterTypeList))
|
||||||
m_SelSearchColumn = m_SearchColumnList(0)
|
m_SelFilterType = m_FilterTypeList(0)
|
||||||
' carico lista progetti
|
' carico lista progetti
|
||||||
If IsNothing(CurrProjectList) OrElse CurrProjectList.Count = 0 Then
|
If IsNothing(CurrProjectList) OrElse CurrProjectList.Count = 0 Then
|
||||||
' leggo da db
|
RefreshProjectList(GoToProd)
|
||||||
If ProjectType = ProjectType.PROD Then
|
|
||||||
Dim DbProjectList As New List(Of ProdFileM)
|
|
||||||
DbProjectList = DbControllers.m_ProdController.GetLastDesc(50)
|
|
||||||
For Each Project In DbProjectList
|
|
||||||
m_ProjectList.Add(New ProdFileVM(Project))
|
|
||||||
Next
|
|
||||||
End If
|
|
||||||
Else
|
Else
|
||||||
m_ProjectList = New ObservableCollection(Of ProjectFileVM)(CurrProjectList)
|
m_ProjectList = New ObservableCollection(Of ProjectFileVM)(CurrProjectList)
|
||||||
NotifyPropertyChanged(NameOf(ProjectList))
|
NotifyPropertyChanged(NameOf(ProjectList))
|
||||||
@@ -33,6 +26,45 @@ Public Class OpenProjectFileDialogVM
|
|||||||
m_ProjectList_View.Filter = AddressOf ProjectFilter
|
m_ProjectList_View.Filter = AddressOf ProjectFilter
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
|
Public Overrides Sub RefreshProjectList(Optional GoToProd As Boolean = False)
|
||||||
|
m_ProjectList.Clear()
|
||||||
|
' calcolo periodo e righe
|
||||||
|
Dim dtStart As DateTime
|
||||||
|
Dim dtEnd As DateTime
|
||||||
|
Dim nRowQuantity As Integer = 20
|
||||||
|
Select Case SelRowQuantity
|
||||||
|
Case RowQuantities.FIFTY
|
||||||
|
nRowQuantity = 50
|
||||||
|
Case RowQuantities.HUNDRED
|
||||||
|
nRowQuantity = 100
|
||||||
|
Case RowQuantities.HUNDREDANDFIFTY
|
||||||
|
nRowQuantity = 150
|
||||||
|
End Select
|
||||||
|
Select Case m_SelDayType
|
||||||
|
Case DayTypes.LASTMONTH
|
||||||
|
dtEnd = DateTime.Today + TimeSpan.FromDays(1)
|
||||||
|
dtStart = dtEnd - TimeSpan.FromDays(31)
|
||||||
|
Case DayTypes.LAST3MONTHS
|
||||||
|
dtEnd = DateTime.Today + TimeSpan.FromDays(1)
|
||||||
|
dtStart = dtEnd - TimeSpan.FromDays(31 * 3)
|
||||||
|
Case DayTypes.LAST6MONTHS
|
||||||
|
dtEnd = DateTime.Today + TimeSpan.FromDays(1)
|
||||||
|
dtStart = dtEnd - TimeSpan.FromDays(31 * 6)
|
||||||
|
Case DayTypes.PERIOD
|
||||||
|
dtStart = dtStartDate + TimeSpan.FromDays(1)
|
||||||
|
dtEnd = dtEndDate
|
||||||
|
End Select
|
||||||
|
' leggo da db
|
||||||
|
If m_ProjectType = ProjectType.PROD Then
|
||||||
|
Dim DbProjectList As New List(Of ProdFileM)
|
||||||
|
DbProjectList = DbControllers.m_ProdController.GetLastDesc(dtStart, dtEnd, nRowQuantity, True)
|
||||||
|
For Each Project In DbProjectList
|
||||||
|
m_ProjectList.Add(New ProdFileVM(Project))
|
||||||
|
Next
|
||||||
|
End If
|
||||||
|
|
||||||
|
End Sub
|
||||||
|
|
||||||
#End Region ' METHODS
|
#End Region ' METHODS
|
||||||
|
|
||||||
End Class
|
End Class
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ Public Class ProjectVM
|
|||||||
If m_SelTabPage = TabPages.MACHINELOG Then
|
If m_SelTabPage = TabPages.MACHINELOG Then
|
||||||
Map.refCALCPanelVM.SetMachineLog(False)
|
Map.refCALCPanelVM.SetMachineLog(False)
|
||||||
End If
|
End If
|
||||||
If SelTabPage Then
|
If SelTabPage = TabPages.MACHINELOG Then
|
||||||
Map.refMachineLogPageVM.LoadMachineLogList()
|
Map.refMachineLogPageVM.LoadMachineLogList()
|
||||||
End If
|
End If
|
||||||
m_SelTabPage = SelTabPage
|
m_SelTabPage = SelTabPage
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 812 B After Width: | Height: | Size: 1016 B |
|
Before Width: | Height: | Size: 8.9 KiB After Width: | Height: | Size: 8.9 KiB |
|
Before Width: | Height: | Size: 832 B After Width: | Height: | Size: 834 B |
|
Before Width: | Height: | Size: 832 B After Width: | Height: | Size: 834 B |
|
Before Width: | Height: | Size: 411 B After Width: | Height: | Size: 432 B |
|
Before Width: | Height: | Size: 402 B After Width: | Height: | Size: 427 B |
|
Before Width: | Height: | Size: 455 B After Width: | Height: | Size: 448 B |
|
Before Width: | Height: | Size: 899 B After Width: | Height: | Size: 899 B |
|
Before Width: | Height: | Size: 402 B After Width: | Height: | Size: 427 B |
|
Before Width: | Height: | Size: 622 B After Width: | Height: | Size: 782 B |
@@ -178,13 +178,14 @@ Public Class MySceneHostVM
|
|||||||
|
|
||||||
#Region "ProjectManager"
|
#Region "ProjectManager"
|
||||||
|
|
||||||
Public Overrides Sub NewProject()
|
Public Overrides Function NewProject() As Boolean
|
||||||
EgtSetCurrentContext(MainScene.GetCtx())
|
EgtSetCurrentContext(MainScene.GetCtx())
|
||||||
Dim bOk As Boolean = MainController.NewProject()
|
Dim bOk As Boolean = MainController.NewProject()
|
||||||
MainScene.SetStatusNull()
|
MainScene.SetStatusNull()
|
||||||
End Sub
|
Return bOk
|
||||||
|
End Function
|
||||||
|
|
||||||
Public Overrides Sub OpenProject(sFilePath As String)
|
Public Overrides Function OpenProject(sFilePath As String) As Boolean
|
||||||
EgtSetCurrentContext(MainScene.GetCtx())
|
EgtSetCurrentContext(MainScene.GetCtx())
|
||||||
Dim bOk As Boolean = False
|
Dim bOk As Boolean = False
|
||||||
If String.IsNullOrEmpty(sFilePath) Then
|
If String.IsNullOrEmpty(sFilePath) Then
|
||||||
@@ -201,29 +202,32 @@ Public Class MySceneHostVM
|
|||||||
bOk = MainController.OpenProject(sFilePath, False)
|
bOk = MainController.OpenProject(sFilePath, False)
|
||||||
End If
|
End If
|
||||||
MainScene.SetStatusNull()
|
MainScene.SetStatusNull()
|
||||||
End Sub
|
Return bOk
|
||||||
|
End Function
|
||||||
|
|
||||||
Public Overrides Sub SaveProject()
|
Public Overrides Function SaveProject() As Boolean
|
||||||
MyBase.SaveProject()
|
Dim bOk As Boolean = MyBase.SaveProject()
|
||||||
' Imposto stato gestione mouse diretto della scena a nessuno
|
' Imposto stato gestione mouse diretto della scena a nessuno
|
||||||
MainScene.SetStatusNull()
|
MainScene.SetStatusNull()
|
||||||
End Sub
|
Return bOk
|
||||||
|
End Function
|
||||||
|
|
||||||
Public Overrides Sub SaveAsProject()
|
Public Overrides Function SaveAsProject() As Boolean
|
||||||
MyBase.SaveAsProject()
|
Dim bOk As Boolean = MyBase.SaveAsProject()
|
||||||
' Imposto stato gestione mouse diretto della scena a nessuno
|
' Imposto stato gestione mouse diretto della scena a nessuno
|
||||||
MainScene.SetStatusNull()
|
MainScene.SetStatusNull()
|
||||||
End Sub
|
Return bOk
|
||||||
|
End Function
|
||||||
|
|
||||||
Public Overrides Sub ImportProject()
|
Public Overrides Function ImportProject() As Boolean
|
||||||
Dim sDir As String = String.Empty
|
Dim sDir As String = String.Empty
|
||||||
GetMainPrivateProfileString(S_MRUIMPORT, K_FILE & "1", "", sDir)
|
GetMainPrivateProfileString(S_MRUIMPORT, K_FILE & "1", "", sDir)
|
||||||
If Not String.IsNullOrWhiteSpace(sDir) Then
|
If Not String.IsNullOrWhiteSpace(sDir) Then
|
||||||
sDir = Path.GetDirectoryName(sDir)
|
sDir = Path.GetDirectoryName(sDir)
|
||||||
End If
|
End If
|
||||||
sDir.TrimEnd("\"c)
|
sDir.TrimEnd("\"c)
|
||||||
MainController.ImportProject(sDir)
|
Return MainController.ImportProject(sDir)
|
||||||
End Sub
|
End Function
|
||||||
|
|
||||||
#End Region ' ProjectManager
|
#End Region ' ProjectManager
|
||||||
|
|
||||||
|
|||||||
@@ -77,21 +77,21 @@ Public Class SupervisorManagerVM
|
|||||||
'Private m_cmdSave As ICommand
|
'Private m_cmdSave As ICommand
|
||||||
Private m_cmdGoToProd As ICommand
|
Private m_cmdGoToProd As ICommand
|
||||||
|
|
||||||
'#Region "ToolTip"
|
#Region "ToolTip"
|
||||||
|
|
||||||
' 'Proprietà ToolTip
|
'Proprietà ToolTip
|
||||||
' Public ReadOnly Property OpenToolTip As String
|
Public ReadOnly Property OpenToolTip As String
|
||||||
' Get
|
Get
|
||||||
' Return EgtMsg(MSG_TOPCOMMANDBAR + 2)
|
Return EgtMsg(MSG_TOPCOMMANDBAR + 2)
|
||||||
' End Get
|
End Get
|
||||||
' End Property
|
End Property
|
||||||
' Public ReadOnly Property SaveToolTip As String
|
Public ReadOnly Property GoToProd_ToolTip As String
|
||||||
' Get
|
Get
|
||||||
' Return EgtMsg(MSG_TOPCOMMANDBAR + 3)
|
Return EgtMsg(61835)
|
||||||
' End Get
|
End Get
|
||||||
' End Property
|
End Property
|
||||||
|
|
||||||
'#End Region ' ToolTip
|
#End Region ' ToolTip
|
||||||
|
|
||||||
#End Region ' Fields & Properties
|
#End Region ' Fields & Properties
|
||||||
|
|
||||||
@@ -219,6 +219,8 @@ Public Class SupervisorManagerVM
|
|||||||
CurrProd = Nothing
|
CurrProd = Nothing
|
||||||
Map.refMainWindowVM.UpdateTitle()
|
Map.refMainWindowVM.UpdateTitle()
|
||||||
m_bLoadingProd = False
|
m_bLoadingProd = False
|
||||||
|
NotifyPropertyChanged(NameOf(MruFileNames))
|
||||||
|
LoadingWndHelper.CloseLoadingWnd(ActiveIds.OPENPROD)
|
||||||
Return
|
Return
|
||||||
End If
|
End If
|
||||||
LoadingWndHelper.OpenLoadingWnd(ActiveIds.OPENPROD, 3, EgtMsg(63000), EgtMsg(63001), 50) 'Project opening 'Loading project geometries
|
LoadingWndHelper.OpenLoadingWnd(ActiveIds.OPENPROD, 3, EgtMsg(63000), EgtMsg(63001), 50) 'Project opening 'Loading project geometries
|
||||||
@@ -239,11 +241,19 @@ Public Class SupervisorManagerVM
|
|||||||
MessageBox.Show("Impossibile aprire il file!!")
|
MessageBox.Show("Impossibile aprire il file!!")
|
||||||
Map.refSceneHostVM.MainController.NewProject()
|
Map.refSceneHostVM.MainController.NewProject()
|
||||||
Map.refMainWindowVM.SetTitle("New - EgtBEAMWALL")
|
Map.refMainWindowVM.SetTitle("New - EgtBEAMWALL")
|
||||||
|
m_bLoadingProd = False
|
||||||
|
NotifyPropertyChanged(NameOf(MruFileNames))
|
||||||
|
LoadingWndHelper.CloseLoadingWnd(ActiveIds.OPENPROD)
|
||||||
|
Return
|
||||||
End If
|
End If
|
||||||
Else
|
Else
|
||||||
MessageBox.Show("File non trovato!!")
|
MessageBox.Show("File non trovato!!")
|
||||||
Map.refSceneHostVM.MainController.NewProject()
|
Map.refSceneHostVM.MainController.NewProject()
|
||||||
Map.refMainWindowVM.SetTitle("New - EgtBEAMWALL")
|
Map.refMainWindowVM.SetTitle("New - EgtBEAMWALL")
|
||||||
|
m_bLoadingProd = False
|
||||||
|
NotifyPropertyChanged(NameOf(MruFileNames))
|
||||||
|
LoadingWndHelper.CloseLoadingWnd(ActiveIds.OPENPROD)
|
||||||
|
Return
|
||||||
End If
|
End If
|
||||||
LoadingWndHelper.UpdateLoadingWnd(ActiveIds.OPENPROD, 3, EgtMsg(63004), 70, 100) ' Loading production data
|
LoadingWndHelper.UpdateLoadingWnd(ActiveIds.OPENPROD, 3, EgtMsg(63004), 70, 100) ' Loading production data
|
||||||
Map.refProjectVM.SupervisorMachGroupPanelVM = New SupervisorMachGroupPanelVM(MachGroupPanelM.CreateNewMachGroupPanel())
|
Map.refProjectVM.SupervisorMachGroupPanelVM = New SupervisorMachGroupPanelVM(MachGroupPanelM.CreateNewMachGroupPanel())
|
||||||
|
|||||||
@@ -16,6 +16,8 @@ Public Module CurrentMachine
|
|||||||
MDI = 1
|
MDI = 1
|
||||||
PLC = 2
|
PLC = 2
|
||||||
CNC = 3
|
CNC = 3
|
||||||
|
INPUT = 4
|
||||||
|
OUTPUT = 5
|
||||||
End Enum
|
End Enum
|
||||||
|
|
||||||
' Nome macchina corrente
|
' Nome macchina corrente
|
||||||
@@ -305,6 +307,10 @@ Public Module CurrentMachine
|
|||||||
sPar = PLC_MSG
|
sPar = PLC_MSG
|
||||||
Case MsgParagraphs.CNC
|
Case MsgParagraphs.CNC
|
||||||
sPar = CNC_MSG
|
sPar = CNC_MSG
|
||||||
|
Case MsgParagraphs.INPUT
|
||||||
|
sPar = INPUT_MSG
|
||||||
|
Case MsgParagraphs.OUTPUT
|
||||||
|
sPar = OUTPUT_MSG
|
||||||
End Select
|
End Select
|
||||||
EgtGetStringUtf8FromIni(sPar, nId, nId, sMsg, m_sMachMessagesFile)
|
EgtGetStringUtf8FromIni(sPar, nId, nId, sMsg, m_sMachMessagesFile)
|
||||||
Return sMsg
|
Return sMsg
|
||||||
|
|||||||
@@ -4,81 +4,99 @@ Imports EgtBEAMWALL.Core
|
|||||||
|
|
||||||
Module DbControllers
|
Module DbControllers
|
||||||
|
|
||||||
Friend m_SupervisorId As String = "1"
|
Friend m_SupervisorId As String = "1"
|
||||||
Public ReadOnly Property SupervisorId As String
|
Public ReadOnly Property SupervisorId As String
|
||||||
Get
|
Get
|
||||||
Return m_SupervisorId
|
Return m_SupervisorId
|
||||||
End Get
|
End Get
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
Public m_ProjController As DataLayer.Controllers.ProjController
|
Private m_bNetwork As Boolean = False
|
||||||
Public m_ProdController As DataLayer.Controllers.ProdController
|
Friend ReadOnly Property bNetwork As Boolean
|
||||||
Public m_MachGroupController As DataLayer.Controllers.MachGroupController
|
Get
|
||||||
Public m_PartController As DataLayer.Controllers.PartController
|
Return m_bNetwork
|
||||||
Public m_LogMachineController As DataLayer.Controllers.LogMachineController
|
End Get
|
||||||
Public m_StatusMapController As DataLayer.Controllers.StatusMapController
|
End Property
|
||||||
|
|
||||||
Sub New()
|
Public m_ProjController As DataLayer.Controllers.ProjController
|
||||||
|
Public m_ProdController As DataLayer.Controllers.ProdController
|
||||||
|
Public m_MachGroupController As DataLayer.Controllers.MachGroupController
|
||||||
|
Public m_PartController As DataLayer.Controllers.PartController
|
||||||
|
Public m_LogMachineController As DataLayer.Controllers.LogMachineController
|
||||||
|
Public m_StatusMapController As DataLayer.Controllers.StatusMapController
|
||||||
|
|
||||||
' se demo--> server = db.steamware.net, nKey e sKey come le hai...
|
Sub New()
|
||||||
|
|
||||||
Dim sKey = "", sUser = "", sPwd = ""
|
' se demo--> server = db.steamware.net, nKey e sKey come le hai...
|
||||||
|
|
||||||
EgtGetKeyInfo(sKey)
|
Dim sKey = "", sUser = "", sPwd = ""
|
||||||
sKey = sKey.Replace(" ", "")
|
|
||||||
If Not IsNothing(sKey) AndAlso sKey.Length > 11 Then
|
EgtGetKeyInfo(sKey)
|
||||||
sUser = sKey.Substring(3, 6)
|
sKey = sKey.Replace(" ", "")
|
||||||
sPwd = sKey.Substring(10, sKey.Length - 10).Replace("(", "").Replace(")", "")
|
If Not IsNothing(sKey) AndAlso sKey.Length > 11 Then
|
||||||
End If
|
sUser = sKey.Substring(3, 6)
|
||||||
Try
|
sPwd = sKey.Substring(10, sKey.Length - 10).Replace("(", "").Replace(")", "")
|
||||||
Dim DbAddress As String = "127.0.0.1"
|
End If
|
||||||
Dim DbMasterKey As Integer = 0
|
Try
|
||||||
Dim sDbMasterKey As String = ""
|
Dim DbAddress As String = "127.0.0.1"
|
||||||
Dim sSharedFolder As String = ""
|
Dim DbMasterKey As Integer = 0
|
||||||
Dim bNetwork As Boolean = False
|
Dim sDbMasterKey As String = ""
|
||||||
If Map.refMainWindowVM.MainWindowM.GetKeyOption(KEY_OPT.NETWORK) Then
|
Dim sSharedFolder As String = ""
|
||||||
GetMainPrivateProfileString(S_GENERAL, K_DBADDRESS, "", DbAddress)
|
If Map.refMainWindowVM.MainWindowM.GetKeyOption(KEY_OPT.NETWORK) Then
|
||||||
DbMasterKey = GetMainPrivateProfileInt(S_GENERAL, K_DBMASTERKEY, 0)
|
GetMainPrivateProfileString(S_GENERAL, K_DBADDRESS, "", DbAddress)
|
||||||
If DbMasterKey > 0 Then
|
DbMasterKey = GetMainPrivateProfileInt(S_GENERAL, K_DBMASTERKEY, 0)
|
||||||
sDbMasterKey = DbMasterKey.ToString("000000")
|
If DbMasterKey > 0 Then
|
||||||
End If
|
sDbMasterKey = DbMasterKey.ToString("000000")
|
||||||
If String.IsNullOrWhiteSpace(DbAddress) OrElse DbMasterKey <= 0 Then
|
|
||||||
DbAddress = "127.0.0.1"
|
|
||||||
DbMasterKey = 0
|
|
||||||
Else
|
|
||||||
bNetwork = True
|
|
||||||
End If
|
|
||||||
End If
|
End If
|
||||||
DataLayer.DbConfig.InitDb(DbAddress, sUser, sPwd, sDbMasterKey)
|
If String.IsNullOrWhiteSpace(DbAddress) OrElse DbMasterKey <= 0 Then
|
||||||
DataLayer.DbConfig.SetupLogDir(Map.refMainWindowVM.MainWindowM.sTempDir)
|
DbAddress = "127.0.0.1"
|
||||||
DataLayer.DbConfig.CheckMigrateDb()
|
DbMasterKey = 0
|
||||||
DataLayer.DbConfig.CheckUser(sUser, sPwd, Map.refMainWindowVM.MainWindowM.GetKeyOption(KEY_OPT.NETWORK))
|
Else
|
||||||
If Map.refMainWindowVM.MainWindowM.GetKeyOption(KEY_OPT.NETWORK) And bNetwork Then
|
m_bNetwork = True
|
||||||
' imposto cartella condivisa
|
|
||||||
GetMainPrivateProfileString(S_GENERAL, K_SHAREDFOLDER, Map.refMainWindowVM.MainWindowM.sDataRoot, sSharedFolder)
|
|
||||||
Map.refMainWindowVM.MainWindowM.UpdatePathForNetwork(sSharedFolder)
|
|
||||||
Dim sSupervisorMachName As String = ""
|
|
||||||
GetMainPrivateProfileString(S_MACH, K_SUPERVISORMACH, "", sSupervisorMachName)
|
|
||||||
If Not String.IsNullOrWhiteSpace(sSupervisorMachName) Then m_SupervisorId = sSupervisorMachName
|
|
||||||
End If
|
End If
|
||||||
Catch ex As Exception
|
End If
|
||||||
EgtOutLog("InitDb error: " & ex.ToString())
|
If Not m_bNetwork AndAlso Map.refMainWindowVM.MainWindowM.GetKeyOption(KEY_OPT.ANY_DB) Then
|
||||||
MessageBox.Show(Application.Current.MainWindow, "Db connection error!!", "Error")
|
DbMasterKey = GetMainPrivateProfileInt(S_GENERAL, K_DBMASTERKEY, 0)
|
||||||
End
|
If DbMasterKey > 0 Then
|
||||||
End Try
|
sDbMasterKey = DbMasterKey.ToString("000000")
|
||||||
|
End If
|
||||||
If Map.refMainWindowVM.MainWindowM.GetKeyOption(KEY_OPT.NETWORK) Then
|
ElseIf GetMainPrivateProfileInt(S_GENERAL, K_DBMASTERKEY, 0) = 0 Then
|
||||||
|
Dim nKey As Integer = 0
|
||||||
|
If Integer.TryParse(sKey.Substring(3, 6), nKey) AndAlso nKey > 0 Then
|
||||||
|
WriteMainPrivateProfileString(S_GENERAL, K_DBMASTERKEY, nKey)
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
DataLayer.DbConfig.InitDb(DbAddress, sUser, sPwd, sDbMasterKey)
|
||||||
|
DataLayer.DbConfig.SetupLogDir(Map.refMainWindowVM.MainWindowM.sTempDir)
|
||||||
|
DataLayer.DbConfig.CheckMigrateDb()
|
||||||
|
DataLayer.DbConfig.CheckUser(sUser, sPwd, m_bNetwork AndAlso Map.refMainWindowVM.MainWindowM.GetKeyOption(KEY_OPT.NETWORK))
|
||||||
|
DataLayer.DbConfig.CheckViews(sUser, sPwd)
|
||||||
|
If m_bNetwork AndAlso Map.refMainWindowVM.MainWindowM.GetKeyOption(KEY_OPT.NETWORK) Then
|
||||||
|
' imposto cartella condivisa
|
||||||
|
GetMainPrivateProfileString(S_GENERAL, K_SHAREDFOLDER, Map.refMainWindowVM.MainWindowM.sDataRoot, sSharedFolder)
|
||||||
|
Map.refMainWindowVM.MainWindowM.UpdatePathForNetwork(sSharedFolder)
|
||||||
Dim sSupervisorMachName As String = ""
|
Dim sSupervisorMachName As String = ""
|
||||||
GetMainPrivateProfileString(S_MACH, K_SUPERVISORMACH, "", sSupervisorMachName)
|
GetMainPrivateProfileString(S_MACH, K_SUPERVISORMACH, "", sSupervisorMachName)
|
||||||
If Not String.IsNullOrWhiteSpace(sSupervisorMachName) Then m_SupervisorId = sSupervisorMachName
|
If Not String.IsNullOrWhiteSpace(sSupervisorMachName) Then m_SupervisorId = sSupervisorMachName
|
||||||
End If
|
ElseIf Map.refMainWindowVM.MainWindowM.GetKeyOption(KEY_OPT.ANY_DB) Then
|
||||||
|
' imposto cartella chiave master
|
||||||
|
Map.refMainWindowVM.MainWindowM.UpdatePathForKey(sDbMasterKey)
|
||||||
|
Else
|
||||||
|
' imposto cartella chiave locale
|
||||||
|
Map.refMainWindowVM.MainWindowM.UpdatePathForKey(sKey.Substring(3, 6))
|
||||||
|
End If
|
||||||
|
Catch ex As Exception
|
||||||
|
EgtOutLog("InitDb error: " & ex.ToString())
|
||||||
|
MessageBox.Show(Application.Current.MainWindow, "Db connection error!!", "Error")
|
||||||
|
End
|
||||||
|
End Try
|
||||||
|
|
||||||
m_ProjController = New DataLayer.Controllers.ProjController
|
m_ProjController = New DataLayer.Controllers.ProjController
|
||||||
m_ProdController = New DataLayer.Controllers.ProdController
|
m_ProdController = New DataLayer.Controllers.ProdController
|
||||||
m_MachGroupController = New DataLayer.Controllers.MachGroupController
|
m_MachGroupController = New DataLayer.Controllers.MachGroupController
|
||||||
m_PartController = New DataLayer.Controllers.PartController
|
m_PartController = New DataLayer.Controllers.PartController
|
||||||
m_LogMachineController = New DataLayer.Controllers.LogMachineController
|
m_LogMachineController = New DataLayer.Controllers.LogMachineController
|
||||||
m_StatusMapController = New DataLayer.Controllers.StatusMapController
|
m_StatusMapController = New DataLayer.Controllers.StatusMapController
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
End Module
|
End Module
|
||||||
|
|||||||
@@ -342,6 +342,16 @@
|
|||||||
<Setter Property="VerticalAlignment" Value="Center"/>
|
<Setter Property="VerticalAlignment" Value="Center"/>
|
||||||
<Setter Property="Margin" Value="10,0,10,0"/>
|
<Setter Property="Margin" Value="10,0,10,0"/>
|
||||||
</Style>
|
</Style>
|
||||||
|
|
||||||
|
<Style x:Key="Log_TextBlock" TargetType="{x:Type TextBlock}" BasedOn="{StaticResource {x:Type TextBlock}}">
|
||||||
|
<Setter Property="VerticalAlignment" Value="Center"/>
|
||||||
|
<Setter Property="Margin" Value="5,0,5,0"/>
|
||||||
|
</Style>
|
||||||
|
|
||||||
|
<Style x:Key="Filter_TextBlock" TargetType="{x:Type TextBlock}" BasedOn="{StaticResource {x:Type TextBlock}}">
|
||||||
|
<Setter Property="VerticalAlignment" Value="Center"/>
|
||||||
|
<Setter Property="Margin" Value="2.5,0,2.5,0"/>
|
||||||
|
</Style>
|
||||||
|
|
||||||
<!-- ______________________________________________________________________________________________________________________________________________ -->
|
<!-- ______________________________________________________________________________________________________________________________________________ -->
|
||||||
|
|
||||||
@@ -720,4 +730,22 @@
|
|||||||
|
|
||||||
<!-- ______________________________________________________________________________________________________________________________________________ -->
|
<!-- ______________________________________________________________________________________________________________________________________________ -->
|
||||||
|
|
||||||
|
|
||||||
|
<!-- DatePicker -->
|
||||||
|
|
||||||
|
<Style x:Key="Log_DatePicker" TargetType="{x:Type DatePicker}">
|
||||||
|
<Setter Property="Height" Value="22" />
|
||||||
|
</Style>
|
||||||
|
|
||||||
|
<!-- ______________________________________________________________________________________________________________________________________________ -->
|
||||||
|
|
||||||
|
<!-- DatePicker -->
|
||||||
|
|
||||||
|
<Style x:Key="Filter_DatePicker" TargetType="{x:Type DatePicker}">
|
||||||
|
<Setter Property="Height" Value="22" />
|
||||||
|
<Setter Property="Width" Value="100" />
|
||||||
|
</Style>
|
||||||
|
|
||||||
|
<!-- ______________________________________________________________________________________________________________________________________________ -->
|
||||||
|
|
||||||
</ResourceDictionary>
|
</ResourceDictionary>
|
||||||
|
|||||||
@@ -1,16 +1,11 @@
|
|||||||
Imports EgtWPFLib5
|
Imports EgtUILib
|
||||||
|
Imports EgtWPFLib5
|
||||||
Imports EgtBEAMWALL.Core
|
Imports EgtBEAMWALL.Core
|
||||||
|
|
||||||
Public Class LogEvent
|
Public Class LogEvent
|
||||||
Inherits VMBase
|
Inherits VMBase
|
||||||
|
|
||||||
Public ReadOnly Property MachGroupId_Msg As String
|
Public Const cSeparator As Char = ";"c
|
||||||
Get
|
|
||||||
Return "MachGroup"
|
|
||||||
End Get
|
|
||||||
End Property
|
|
||||||
|
|
||||||
Const cSeparator As Char = ";"c
|
|
||||||
|
|
||||||
Public Enum MachLogTypes
|
Public Enum MachLogTypes
|
||||||
PART_STATUS = 1
|
PART_STATUS = 1
|
||||||
@@ -25,6 +20,12 @@ Public Class LogEvent
|
|||||||
PROGRAM_SEND = 10
|
PROGRAM_SEND = 10
|
||||||
End Enum
|
End Enum
|
||||||
|
|
||||||
|
Public Enum MachineCommands As Integer
|
||||||
|
CONNECTION = 1
|
||||||
|
DISCONNECTION = 2
|
||||||
|
PROGRAM_ACTIVATION = 3
|
||||||
|
End Enum
|
||||||
|
|
||||||
Private m_EventDateTime As DateTime
|
Private m_EventDateTime As DateTime
|
||||||
Public ReadOnly Property EventDateTime As DateTime
|
Public ReadOnly Property EventDateTime As DateTime
|
||||||
Get
|
Get
|
||||||
@@ -68,13 +69,18 @@ Public Class LogEvent
|
|||||||
End Get
|
End Get
|
||||||
End Property
|
End Property
|
||||||
Private m_Status As Integer
|
Private m_Status As Integer
|
||||||
|
Public ReadOnly Property nStatus As Integer
|
||||||
|
Get
|
||||||
|
Return m_Status
|
||||||
|
End Get
|
||||||
|
End Property
|
||||||
Public ReadOnly Property Status As String
|
Public ReadOnly Property Status As String
|
||||||
Get
|
Get
|
||||||
Select Case m_Status
|
Select Case m_Status
|
||||||
Case 1
|
Case 1
|
||||||
Return "Inizio"
|
Return EgtMsg(62527)
|
||||||
Case 2
|
Case 2
|
||||||
Return "Fine"
|
Return EgtMsg(62528)
|
||||||
Case Else
|
Case Else
|
||||||
Return ""
|
Return ""
|
||||||
End Select
|
End Select
|
||||||
@@ -119,6 +125,11 @@ Public Class LogEvent
|
|||||||
Return m_Value
|
Return m_Value
|
||||||
End Get
|
End Get
|
||||||
End Property
|
End Property
|
||||||
|
Public ReadOnly Property sEventTick As Double
|
||||||
|
Get
|
||||||
|
Return m_EventDateTime.Ticks
|
||||||
|
End Get
|
||||||
|
End Property
|
||||||
|
|
||||||
Public ReadOnly Property sPROD As String
|
Public ReadOnly Property sPROD As String
|
||||||
Get
|
Get
|
||||||
@@ -137,13 +148,30 @@ Public Class LogEvent
|
|||||||
Select Case m_EventType
|
Select Case m_EventType
|
||||||
Case MachLogTypes.PART_STATUS
|
Case MachLogTypes.PART_STATUS
|
||||||
m_ProdId = sValues(0)
|
m_ProdId = sValues(0)
|
||||||
m_MachGroupId = DbControllers.m_MachGroupController.FindByMachGroupId(m_ProdId, sValues(1)).Name
|
Dim MachGroup As DataLayer.DatabaseModels.MachGroupModel = DbControllers.m_MachGroupController.FindByMachGroupId(m_ProdId, sValues(1))
|
||||||
m_PartId = DbControllers.m_PartController.FindByPartId(m_ProdId, sValues(2)).PDN
|
If Not IsNothing(MachGroup) Then
|
||||||
|
m_MachGroupId = MachGroup.Name
|
||||||
|
Else
|
||||||
|
m_MachGroupId = -1
|
||||||
|
End If
|
||||||
|
Dim Part As DataLayer.DatabaseModels.PartModel = DbControllers.m_PartController.FindByPartId(m_ProdId, sValues(2))
|
||||||
|
If Not IsNothing(Part) Then
|
||||||
|
m_PartId = Part.PDN
|
||||||
|
Else
|
||||||
|
m_PartId = -1
|
||||||
|
End If
|
||||||
m_Status = sValues(3)
|
m_Status = sValues(3)
|
||||||
Case MachLogTypes.MACHGROUP_STATUS
|
Case MachLogTypes.MACHGROUP_STATUS
|
||||||
m_ProdId = sValues(0)
|
m_ProdId = sValues(0)
|
||||||
m_MachGroupId = DbControllers.m_MachGroupController.FindByMachGroupId(m_ProdId, sValues(1)).Name
|
Dim MachGroup As DataLayer.DatabaseModels.MachGroupModel = DbControllers.m_MachGroupController.FindByMachGroupId(m_ProdId, sValues(1))
|
||||||
|
If Not IsNothing(MachGroup) Then
|
||||||
|
m_MachGroupId = MachGroup.Name
|
||||||
|
Else
|
||||||
|
m_MachGroupId = -1
|
||||||
|
End If
|
||||||
m_Status = sValues(2)
|
m_Status = sValues(2)
|
||||||
|
Case MachLogTypes.MACHINE_COMMAND
|
||||||
|
|
||||||
End Select
|
End Select
|
||||||
End If
|
End If
|
||||||
End Sub
|
End Sub
|
||||||
@@ -168,4 +196,24 @@ Public Class LogEvent
|
|||||||
Return CreateMachLog(MachLogTypes.MACHGROUP_STATUS, dtEvent, Prod & cSeparator & MachGroup & cSeparator & State, SupervisorID)
|
Return CreateMachLog(MachLogTypes.MACHGROUP_STATUS, dtEvent, Prod & cSeparator & MachGroup & cSeparator & State, SupervisorID)
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
|
Public Shared Function CreateMachCommandLog(Command As MachineCommands, sProgramId As String, nError As Integer, SupervisorID As String)
|
||||||
|
Return CreateMachLog(MachLogTypes.MACHINE_COMMAND, DateTime.Now(), Command & cSeparator & sProgramId & cSeparator & nError, SupervisorID)
|
||||||
|
End Function
|
||||||
|
|
||||||
|
Public Shared Function CreateAlarmLog(dtEvent As DateTime, Alarm As String, SupervisorID As String)
|
||||||
|
Return CreateMachLog(MachLogTypes.ALARM, dtEvent, Alarm, SupervisorID)
|
||||||
|
End Function
|
||||||
|
|
||||||
|
Public Shared Function CreateMachineModeLog(MachineMode As Integer, SupervisorID As String)
|
||||||
|
Return CreateMachLog(MachLogTypes.MACHINE_MODE, DateTime.Now(), MachineMode, SupervisorID)
|
||||||
|
End Function
|
||||||
|
|
||||||
|
Public Shared Function CreateMachineStateLog(MachineStatus As Integer, SupervisorID As String)
|
||||||
|
Return CreateMachLog(MachLogTypes.MACHINE_STATUS, DateTime.Now(), MachineStatus, SupervisorID)
|
||||||
|
End Function
|
||||||
|
|
||||||
|
Public Shared Function CreateReadVarLog(VarAddress As String, VarValue As String, SupervisorID As String)
|
||||||
|
Return CreateMachLog(MachLogTypes.READ_VAR, DateTime.Now(), VarAddress & cSeparator & VarValue, SupervisorID)
|
||||||
|
End Function
|
||||||
|
|
||||||
End Class
|
End Class
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
<DataGrid ItemsSource="{Binding VariablesList}"
|
<DataGrid ItemsSource="{Binding VariablesList}"
|
||||||
AutoGenerateColumns="False">
|
AutoGenerateColumns="False">
|
||||||
<DataGrid.Columns>
|
<DataGrid.Columns>
|
||||||
<DataGridTextColumn Header="Name" Binding="{Binding sName}" Width="1*"/>
|
<DataGridTextColumn Header="Name" Binding="{Binding sDescription}" Width="1*"/>
|
||||||
<DataGridTextColumn Header="Address" Binding="{Binding sAddress}" Width="1*"/>
|
<DataGridTextColumn Header="Address" Binding="{Binding sAddress}" Width="1*"/>
|
||||||
<DataGridTextColumn Header="Value" Binding="{Binding sValue}" Width="1*"/>
|
<DataGridTextColumn Header="Value" Binding="{Binding sValue}" Width="1*"/>
|
||||||
</DataGrid.Columns>
|
</DataGrid.Columns>
|
||||||
|
|||||||
@@ -44,6 +44,12 @@ Public Class Variable
|
|||||||
End Set
|
End Set
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
|
Public ReadOnly Property sDescription As String
|
||||||
|
Get
|
||||||
|
Return CommVar.sDescription
|
||||||
|
End Get
|
||||||
|
End Property
|
||||||
|
|
||||||
Public Property sAddress As String
|
Public Property sAddress As String
|
||||||
Get
|
Get
|
||||||
Return CommVar.sAddress
|
Return CommVar.sAddress
|
||||||
@@ -58,7 +64,7 @@ Public Class Variable
|
|||||||
Return CommVar.sValue
|
Return CommVar.sValue
|
||||||
End Get
|
End Get
|
||||||
Set(value As String)
|
Set(value As String)
|
||||||
MachManaging.CommandList.Add(ThreadCommand.CreateCommand(CommandTypes.WRITE, {CommVar.nType}, Nothing, {CommVar.sAddress, value}))
|
MachManaging.AddToCommandList(ThreadCommand.CreateCommand(CommandTypes.WRITE, {CommVar.nType}, Nothing, {CommVar.sAddress, value}))
|
||||||
NotifyPropertyChanged(NameOf(sValue))
|
NotifyPropertyChanged(NameOf(sValue))
|
||||||
End Set
|
End Set
|
||||||
End Property
|
End Property
|
||||||
|
|||||||
@@ -1,52 +1,59 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<configuration>
|
<configuration>
|
||||||
<configSections>
|
<configSections>
|
||||||
<!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
|
<!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
|
||||||
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
|
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
|
||||||
</configSections>
|
</configSections>
|
||||||
<entityFramework>
|
<entityFramework>
|
||||||
<defaultConnectionFactory type="MySql.Data.Entity.MySqlConnectionFactory, MySql.Data.Entity.EF6" />
|
<!--<defaultConnectionFactory type="MySql.Data.Entity.MySqlConnectionFactory, MySql.Data.EntityFramework" />-->
|
||||||
<providers>
|
<defaultConnectionFactory type="System.Data.Entity.Infrastructure.SqlConnectionFactory, EntityFramework"/>
|
||||||
|
<providers>
|
||||||
<provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />
|
<provider invariantName="MySql.Data.MySqlClient" type="MySql.Data.MySqlClient.MySqlProviderServices, MySql.Data.EntityFramework, Version=8.0.21.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d">
|
||||||
<provider invariantName="MySql.Data.MySqlClient" type="MySql.Data.MySqlClient.MySqlProviderServices, MySql.Data.EntityFramework, Version=8.0.21.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d">
|
</provider>
|
||||||
</provider></providers>
|
</providers>
|
||||||
</entityFramework>
|
</entityFramework>
|
||||||
<connectionStrings>
|
<connectionStrings>
|
||||||
<add name="DefaultConnection" connectionString="server=localhost;port=3306;User Id=root;password=viacremasca;Persist Security Info=True;database=EgtBwDb;SslMode=none" providerName="MySql.Data.MySqlClient" />
|
<add name="DefaultConnection" connectionString="server=localhost;port=3306;User Id=root;password=viacremasca;Persist Security Info=True;database=EgtBwDb;SslMode=none" providerName="MySql.Data.MySqlClient" />
|
||||||
</connectionStrings>
|
</connectionStrings>
|
||||||
<runtime>
|
<runtime>
|
||||||
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
|
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
|
||||||
<dependentAssembly>
|
<dependentAssembly>
|
||||||
<assemblyIdentity name="MySql.Data" publicKeyToken="c5687fc88969c44d" culture="neutral" />
|
<assemblyIdentity name="MySql.Data" publicKeyToken="c5687fc88969c44d" culture="neutral" />
|
||||||
<bindingRedirect oldVersion="0.0.0.0-8.0.29.0" newVersion="8.0.29.0" />
|
<bindingRedirect oldVersion="0.0.0.0-8.0.21.0" newVersion="8.0.21.0" />
|
||||||
</dependentAssembly>
|
</dependentAssembly>
|
||||||
<dependentAssembly>
|
<dependentAssembly>
|
||||||
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
|
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
|
||||||
<bindingRedirect oldVersion="0.0.0.0-13.0.0.0" newVersion="13.0.0.0" />
|
<bindingRedirect oldVersion="0.0.0.0-13.0.0.0" newVersion="13.0.0.0" />
|
||||||
</dependentAssembly>
|
</dependentAssembly>
|
||||||
<dependentAssembly>
|
<dependentAssembly>
|
||||||
<assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
|
<assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
|
||||||
<bindingRedirect oldVersion="0.0.0.0-5.0.0.0" newVersion="5.0.0.0" />
|
<bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
|
||||||
</dependentAssembly>
|
</dependentAssembly>
|
||||||
<dependentAssembly>
|
<dependentAssembly>
|
||||||
<assemblyIdentity name="BouncyCastle.Crypto" publicKeyToken="0e99375e54769942" culture="neutral" />
|
<assemblyIdentity name="BouncyCastle.Crypto" publicKeyToken="0e99375e54769942" culture="neutral" />
|
||||||
<bindingRedirect oldVersion="0.0.0.0-1.8.5.0" newVersion="1.8.5.0" />
|
<bindingRedirect oldVersion="0.0.0.0-1.9.0.0" newVersion="1.9.0.0" />
|
||||||
</dependentAssembly>
|
</dependentAssembly>
|
||||||
<dependentAssembly>
|
<dependentAssembly>
|
||||||
<assemblyIdentity name="Google.Protobuf" publicKeyToken="a7d26565bac4d604" culture="neutral" />
|
<assemblyIdentity name="Google.Protobuf" publicKeyToken="a7d26565bac4d604" culture="neutral" />
|
||||||
<bindingRedirect oldVersion="0.0.0.0-3.19.4.0" newVersion="3.19.4.0" />
|
<bindingRedirect oldVersion="0.0.0.0-3.21.9.0" newVersion="3.21.9.0" />
|
||||||
</dependentAssembly>
|
</dependentAssembly>
|
||||||
<dependentAssembly>
|
<dependentAssembly>
|
||||||
<assemblyIdentity name="K4os.Compression.LZ4.Streams" publicKeyToken="2186fa9121ef231d" culture="neutral" />
|
<assemblyIdentity name="K4os.Compression.LZ4.Streams" publicKeyToken="2186fa9121ef231d" culture="neutral" />
|
||||||
<bindingRedirect oldVersion="0.0.0.0-1.2.6.0" newVersion="1.2.6.0" />
|
<bindingRedirect oldVersion="0.0.0.0-1.3.5.0" newVersion="1.3.5.0" />
|
||||||
</dependentAssembly>
|
</dependentAssembly>
|
||||||
</assemblyBinding>
|
<dependentAssembly>
|
||||||
</runtime>
|
<assemblyIdentity name="System.Memory" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
|
||||||
<system.data>
|
<bindingRedirect oldVersion="0.0.0.0-4.0.1.2" newVersion="4.0.1.2" />
|
||||||
<DbProviderFactories>
|
</dependentAssembly>
|
||||||
<remove invariant="MySql.Data.MySqlClient" />
|
</assemblyBinding>
|
||||||
<add name="MySQL Data Provider" invariant="MySql.Data.MySqlClient" description=".Net Framework Data Provider for MySQL" type="MySql.Data.MySqlClient.MySqlClientFactory, MySql.Data, Version=8.0.29.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d" />
|
</runtime>
|
||||||
</DbProviderFactories>
|
<system.data>
|
||||||
</system.data>
|
<DbProviderFactories>
|
||||||
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" /></startup></configuration>
|
<remove invariant="MySql.Data.MySqlClient" />
|
||||||
|
<add name="MySQL Data Provider" invariant="MySql.Data.MySqlClient" description=".Net Framework Data Provider for MySQL" type="MySql.Data.MySqlClient.MySqlClientFactory, MySql.Data, Version=8.0.21.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d" />
|
||||||
|
</DbProviderFactories>
|
||||||
|
</system.data>
|
||||||
|
<startup>
|
||||||
|
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" />
|
||||||
|
</startup>
|
||||||
|
</configuration>
|
||||||
|
|||||||
@@ -0,0 +1,79 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1">
|
||||||
|
<assemblyIdentity version="1.0.0.0" name="MyApplication.app"/>
|
||||||
|
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
|
||||||
|
<security>
|
||||||
|
<requestedPrivileges xmlns="urn:schemas-microsoft-com:asm.v3">
|
||||||
|
<!-- UAC Manifest Options
|
||||||
|
If you want to change the Windows User Account Control level replace the
|
||||||
|
requestedExecutionLevel node with one of the following.
|
||||||
|
|
||||||
|
<requestedExecutionLevel level="asInvoker" uiAccess="false" />
|
||||||
|
<requestedExecutionLevel level="requireAdministrator" uiAccess="false" />
|
||||||
|
<requestedExecutionLevel level="highestAvailable" uiAccess="false" />
|
||||||
|
|
||||||
|
Specifying requestedExecutionLevel element will disable file and registry virtualization.
|
||||||
|
Remove this element if your application requires this virtualization for backwards
|
||||||
|
compatibility.
|
||||||
|
-->
|
||||||
|
<requestedExecutionLevel level="asInvoker" uiAccess="false" />
|
||||||
|
</requestedPrivileges>
|
||||||
|
</security>
|
||||||
|
</trustInfo>
|
||||||
|
|
||||||
|
<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
|
||||||
|
<application>
|
||||||
|
<!-- A list of the Windows versions that this application has been tested on
|
||||||
|
and is designed to work with. Uncomment the appropriate elements
|
||||||
|
and Windows will automatically select the most compatible environment. -->
|
||||||
|
|
||||||
|
<!-- Windows Vista -->
|
||||||
|
<!--<supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}" />-->
|
||||||
|
|
||||||
|
<!-- Windows 7 -->
|
||||||
|
<supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}" />
|
||||||
|
|
||||||
|
<!-- Windows 8 -->
|
||||||
|
<supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}" />
|
||||||
|
|
||||||
|
<!-- Windows 8.1 -->
|
||||||
|
<supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}" />
|
||||||
|
|
||||||
|
<!-- Windows 10 -->
|
||||||
|
<supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}" />
|
||||||
|
|
||||||
|
</application>
|
||||||
|
</compatibility>
|
||||||
|
|
||||||
|
<!-- Indicates that the application is DPI-aware and will not be automatically scaled by Windows at higher
|
||||||
|
DPIs. Windows Presentation Foundation (WPF) applications are automatically DPI-aware and do not need
|
||||||
|
to opt in. Windows Forms applications targeting .NET Framework 4.6 that opt into this setting, should
|
||||||
|
also set the 'EnableWindowsFormsHighDpiAutoResizing' setting to 'true' in their app.config.
|
||||||
|
|
||||||
|
Makes the application long-path aware. See https://docs.microsoft.com/windows/win32/fileio/maximum-file-path-limitation -->
|
||||||
|
<!--
|
||||||
|
<application xmlns="urn:schemas-microsoft-com:asm.v3">
|
||||||
|
<windowsSettings>
|
||||||
|
<dpiAware xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">true</dpiAware>
|
||||||
|
<longPathAware xmlns="http://schemas.microsoft.com/SMI/2016/WindowsSettings">true</longPathAware>
|
||||||
|
</windowsSettings>
|
||||||
|
</application>
|
||||||
|
-->
|
||||||
|
|
||||||
|
<!-- Enable themes for Windows common controls and dialogs (Windows XP and later) -->
|
||||||
|
<!--
|
||||||
|
<dependency>
|
||||||
|
<dependentAssembly>
|
||||||
|
<assemblyIdentity
|
||||||
|
type="win32"
|
||||||
|
name="Microsoft.Windows.Common-Controls"
|
||||||
|
version="6.0.0.0"
|
||||||
|
processorArchitecture="*"
|
||||||
|
publicKeyToken="6595b64144ccf1df"
|
||||||
|
language="*"
|
||||||
|
/>
|
||||||
|
</dependentAssembly>
|
||||||
|
</dependency>
|
||||||
|
-->
|
||||||
|
|
||||||
|
</assembly>
|
||||||
@@ -4,11 +4,11 @@
|
|||||||
<package id="Csv" version="1.0.31" targetFramework="net472" />
|
<package id="Csv" version="1.0.31" targetFramework="net472" />
|
||||||
<package id="EntityFramework" version="6.4.4" targetFramework="net452" />
|
<package id="EntityFramework" version="6.4.4" targetFramework="net452" />
|
||||||
<package id="FluentFTP" version="19.2.2" targetFramework="net472" />
|
<package id="FluentFTP" version="19.2.2" targetFramework="net472" />
|
||||||
<package id="Google.Protobuf" version="3.19.4" targetFramework="net472" />
|
<package id="Google.Protobuf" version="3.21.9" targetFramework="net472" />
|
||||||
<package id="Ionic.Zip" version="1.9.1.8" targetFramework="net472" />
|
<package id="Ionic.Zip" version="1.9.1.8" targetFramework="net472" />
|
||||||
<package id="K4os.Compression.LZ4" version="1.2.6" targetFramework="net472" />
|
<package id="K4os.Compression.LZ4" version="1.3.5" targetFramework="net472" />
|
||||||
<package id="K4os.Compression.LZ4.Streams" version="1.2.6" targetFramework="net472" />
|
<package id="K4os.Compression.LZ4.Streams" version="1.3.5" targetFramework="net472" />
|
||||||
<package id="K4os.Hash.xxHash" version="1.0.6" targetFramework="net472" />
|
<package id="K4os.Hash.xxHash" version="1.0.8" targetFramework="net472" />
|
||||||
<package id="Lextm.SharpSnmpLib" version="10.0.9" targetFramework="net472" />
|
<package id="Lextm.SharpSnmpLib" version="10.0.9" targetFramework="net472" />
|
||||||
<package id="Microsoft.DotNet.PlatformAbstractions" version="2.1.0" targetFramework="net472" />
|
<package id="Microsoft.DotNet.PlatformAbstractions" version="2.1.0" targetFramework="net472" />
|
||||||
<package id="Microsoft.Extensions.DependencyModel" version="2.1.0" targetFramework="net472" />
|
<package id="Microsoft.Extensions.DependencyModel" version="2.1.0" targetFramework="net472" />
|
||||||
@@ -16,16 +16,18 @@
|
|||||||
<package id="MySql.Data.EntityFramework" version="8.0.21" targetFramework="net472" />
|
<package id="MySql.Data.EntityFramework" version="8.0.21" targetFramework="net472" />
|
||||||
<package id="Newtonsoft.Json" version="13.0.1" targetFramework="net472" />
|
<package id="Newtonsoft.Json" version="13.0.1" targetFramework="net472" />
|
||||||
<package id="NLog" version="5.0.1" targetFramework="net472" />
|
<package id="NLog" version="5.0.1" targetFramework="net472" />
|
||||||
<package id="Portable.BouncyCastle" version="1.8.2" targetFramework="net472" />
|
<package id="Portable.BouncyCastle" version="1.9.0" targetFramework="net472" />
|
||||||
<package id="SSH.NET" version="2016.1.0" targetFramework="net472" />
|
<package id="SSH.NET" version="2016.1.0" targetFramework="net472" />
|
||||||
<package id="System.Buffers" version="4.5.1" targetFramework="net472" />
|
<package id="System.Buffers" version="4.5.1" targetFramework="net472" />
|
||||||
<package id="System.Collections.Specialized" version="4.3.0" targetFramework="net472" />
|
<package id="System.Collections.Specialized" version="4.3.0" targetFramework="net472" />
|
||||||
<package id="System.Memory" version="4.5.4" targetFramework="net472" />
|
<package id="System.IO.Pipelines" version="5.0.2" targetFramework="net472" />
|
||||||
|
<package id="System.Memory" version="4.5.5" targetFramework="net472" />
|
||||||
<package id="System.Net.NameResolution" version="4.3.0" targetFramework="net472" />
|
<package id="System.Net.NameResolution" version="4.3.0" targetFramework="net472" />
|
||||||
<package id="System.Net.Sockets" version="4.3.0" targetFramework="net472" />
|
<package id="System.Net.Sockets" version="4.3.0" targetFramework="net472" />
|
||||||
<package id="System.Numerics.Vectors" version="4.5.0" targetFramework="net472" />
|
<package id="System.Numerics.Vectors" version="4.5.0" targetFramework="net472" />
|
||||||
<package id="System.Runtime.CompilerServices.Unsafe" version="5.0.0" targetFramework="net472" />
|
<package id="System.Runtime.CompilerServices.Unsafe" version="6.0.0" targetFramework="net472" />
|
||||||
<package id="System.Runtime.InteropServices.RuntimeInformation" version="4.0.0" targetFramework="net472" />
|
<package id="System.Runtime.InteropServices.RuntimeInformation" version="4.0.0" targetFramework="net472" />
|
||||||
|
<package id="System.Threading.Tasks.Extensions" version="4.5.4" targetFramework="net472" />
|
||||||
<package id="System.Xml.XmlDocument" version="4.3.0" targetFramework="net472" />
|
<package id="System.Xml.XmlDocument" version="4.3.0" targetFramework="net472" />
|
||||||
<package id="Zebra.Printer.SDK" version="2.15.2634" targetFramework="net472" />
|
<package id="Zebra.Printer.SDK" version="2.15.2634" targetFramework="net472" />
|
||||||
</packages>
|
</packages>
|
||||||
@@ -43,7 +43,7 @@
|
|||||||
<TextBox Name="InfoLbl" Grid.Column="1" Grid.Row="6" HorizontalAlignment="Stretch"
|
<TextBox Name="InfoLbl" Grid.Column="1" Grid.Row="6" HorizontalAlignment="Stretch"
|
||||||
VerticalAlignment="Stretch" FontSize="12" IsReadOnly="True" TextWrapping="Wrap"/>
|
VerticalAlignment="Stretch" FontSize="12" IsReadOnly="True" TextWrapping="Wrap"/>
|
||||||
<Button Name="ExitBtn" Grid.Column="1" Grid.Row="8" IsCancel="True"
|
<Button Name="ExitBtn" Grid.Column="1" Grid.Row="8" IsCancel="True"
|
||||||
Margin="100,0"/>
|
Margin="100,0"/>
|
||||||
|
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
Imports EgtUILib
|
Imports EgtUILib
|
||||||
|
Imports EgtBEAMWALL.Core
|
||||||
|
|
||||||
Public Class AboutBoxV
|
Public Class AboutBoxV
|
||||||
|
|
||||||
Private Sub AboutBoxWD_Initialized(sender As Object, e As EventArgs) Handles Me.Initialized
|
Private Sub AboutBoxWD_Loaded(sender As Object, e As RoutedEventArgs) Handles Me.Loaded
|
||||||
Me.Owner = Application.Current.MainWindow
|
|
||||||
DescriptionLbl.Text = My.Application.Info.Description.ToString()
|
DescriptionLbl.Text = My.Application.Info.Description.ToString()
|
||||||
VersionLbl.Text = "Version : " & My.Application.Info.Version.Major.ToString() &
|
VersionLbl.Text = "Version : " & My.Application.Info.Version.Major.ToString() &
|
||||||
"." & My.Application.Info.Version.Minor.ToString() &
|
"." & My.Application.Info.Version.Minor.ToString() &
|
||||||
@@ -24,6 +24,9 @@ Public Class AboutBoxV
|
|||||||
sInfo &= sKey & " - " & sKlev & " - " & sOpts & sLeftDays & Environment.NewLine
|
sInfo &= sKey & " - " & sKlev & " - " & sOpts & sLeftDays & Environment.NewLine
|
||||||
sInfo &= "DataRoot " & Map.refMainWindowVM.MainWindowM.sDataRoot & Environment.NewLine
|
sInfo &= "DataRoot " & Map.refMainWindowVM.MainWindowM.sDataRoot & Environment.NewLine
|
||||||
sInfo &= "MachinesRoot " & Map.refMainWindowVM.MainWindowM.sMachinesRoot & Environment.NewLine
|
sInfo &= "MachinesRoot " & Map.refMainWindowVM.MainWindowM.sMachinesRoot & Environment.NewLine
|
||||||
|
Dim sOpSys As String = String.Empty
|
||||||
|
EgtGetOsInfo( sOpSys)
|
||||||
|
sInfo &= sOpSys & Environment.NewLine
|
||||||
Dim sCPU As String = String.Empty
|
Dim sCPU As String = String.Empty
|
||||||
EgtGetCpuInfo( sCPU)
|
EgtGetCpuInfo( sCPU)
|
||||||
sInfo &= sCPU & Environment.NewLine
|
sInfo &= sCPU & Environment.NewLine
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ Public Class AddPartWndVM
|
|||||||
End Get
|
End Get
|
||||||
Set(value As String)
|
Set(value As String)
|
||||||
Dim dTempL As Double
|
Dim dTempL As Double
|
||||||
If StringToLen(value, dTempL) AndAlso dTempL > 0 Then
|
If StringToLenAdv(value, dTempL, True) AndAlso dTempL > 0 Then
|
||||||
m_dL = dTempL
|
m_dL = dTempL
|
||||||
Else
|
Else
|
||||||
NotifyPropertyChanged("sL")
|
NotifyPropertyChanged("sL")
|
||||||
@@ -60,7 +60,7 @@ Public Class AddPartWndVM
|
|||||||
End Get
|
End Get
|
||||||
Set(value As String)
|
Set(value As String)
|
||||||
Dim dTempW As Double
|
Dim dTempW As Double
|
||||||
If StringToLen(value, dTempW) AndAlso dTempW > 0 Then
|
If StringToLenAdv(value, dTempW, True) AndAlso dTempW > 0 Then
|
||||||
EgtDraw()
|
EgtDraw()
|
||||||
m_dW = dTempW
|
m_dW = dTempW
|
||||||
Else
|
Else
|
||||||
@@ -81,7 +81,7 @@ Public Class AddPartWndVM
|
|||||||
End Get
|
End Get
|
||||||
Set(value As String)
|
Set(value As String)
|
||||||
Dim dTempH As Double
|
Dim dTempH As Double
|
||||||
If StringToLen(value, dTempH) AndAlso dTempH > 0 Then
|
If StringToLenAdv(value, dTempH, True) AndAlso dTempH > 0 Then
|
||||||
EgtDraw()
|
EgtDraw()
|
||||||
m_dH = dTempH
|
m_dH = dTempH
|
||||||
Else
|
Else
|
||||||
|
|||||||
@@ -102,7 +102,17 @@ Public Class AddRawPartWndVM
|
|||||||
End Select
|
End Select
|
||||||
m_DimensionsList = DimensionsList
|
m_DimensionsList = DimensionsList
|
||||||
If m_DimensionsList.Count > 0 Then
|
If m_DimensionsList.Count > 0 Then
|
||||||
SelDimension = m_DimensionsList(0)
|
Dim LastMaterial As SParam = WarehouseHelper.GetLastMaterial(DimensionsList(0).SectXMat)
|
||||||
|
If IsNothing(LastMaterial) Then
|
||||||
|
SelDimension = m_DimensionsList(0)
|
||||||
|
Else
|
||||||
|
Dim TempDimension As SParam = m_DimensionsList.FirstOrDefault(Function(x) x.SectXMat = LastMaterial.SectXMat AndAlso x.dL = LastMaterial.dL AndAlso x.dW = LastMaterial.dW AndAlso x.nQuantity = LastMaterial.nQuantity)
|
||||||
|
If Not IsNothing(TempDimension) Then
|
||||||
|
SelDimension = TempDimension
|
||||||
|
Else
|
||||||
|
SelDimension = m_DimensionsList(0)
|
||||||
|
End If
|
||||||
|
End If
|
||||||
End If
|
End If
|
||||||
' riduco lista parametri a solo quelli che utilizzati
|
' riduco lista parametri a solo quelli che utilizzati
|
||||||
m_VariableList_View = CollectionViewSource.GetDefaultView(m_VariableList)
|
m_VariableList_View = CollectionViewSource.GetDefaultView(m_VariableList)
|
||||||
@@ -222,14 +232,14 @@ Public Class Variable
|
|||||||
m_sValue = value
|
m_sValue = value
|
||||||
Case VariableType.LENGTH
|
Case VariableType.LENGTH
|
||||||
Dim dTempValue As Double
|
Dim dTempValue As Double
|
||||||
If StringToLen(value, dTempValue) Then
|
If StringToLenAdv(value, dTempValue, True) Then
|
||||||
m_dValue = dTempValue
|
m_dValue = dTempValue
|
||||||
Else
|
Else
|
||||||
NotifyPropertyChanged("sValue")
|
NotifyPropertyChanged("sValue")
|
||||||
End If
|
End If
|
||||||
Case Else ' VariableType.DOUBLE_
|
Case Else ' VariableType.DOUBLE_
|
||||||
Dim dTempValue As Double
|
Dim dTempValue As Double
|
||||||
If StringToDouble(value, dTempValue) Then
|
If StringToDoubleAdv(value, dTempValue, True) Then
|
||||||
m_dValue = dTempValue
|
m_dValue = dTempValue
|
||||||
Else
|
Else
|
||||||
NotifyPropertyChanged("sValue")
|
NotifyPropertyChanged("sValue")
|
||||||
|
|||||||
@@ -132,7 +132,7 @@ Public Class AddSectionXMaterialWndVM
|
|||||||
' carico le colonne della datagrid
|
' carico le colonne della datagrid
|
||||||
LoadColumns(Map.refProjectVM.BTLStructureVM.nPROJTYPE)
|
LoadColumns(Map.refProjectVM.BTLStructureVM.nPROJTYPE)
|
||||||
NewSectionXMaterialList = New ObservableCollection(Of SectionXMaterialToBeAdded)(SectXMatList)
|
NewSectionXMaterialList = New ObservableCollection(Of SectionXMaterialToBeAdded)(SectXMatList)
|
||||||
WhSectXMatList = Map.refWarehouseWndVM.GetSectionXMaterialsFromWarehouse()
|
WhSectXMatList = WarehouseWndVM.GetSectionXMaterialsFromWarehouse()
|
||||||
' Prendo i SectionXMaterial appena messi nella Lista di questa finestra e li confronto con ciascuno di quelli presenti in Warehouse.
|
' Prendo i SectionXMaterial appena messi nella Lista di questa finestra e li confronto con ciascuno di quelli presenti in Warehouse.
|
||||||
' Se le sezioni sono uguali carico i materiali relativi alla medesima sezione.
|
' Se le sezioni sono uguali carico i materiali relativi alla medesima sezione.
|
||||||
' Se i materiali di quella medesima sezione non ci sono disabilito la CheckBox Alias.
|
' Se i materiali di quella medesima sezione non ci sono disabilito la CheckBox Alias.
|
||||||
|
|||||||
@@ -1,48 +1,55 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<configuration>
|
<configuration>
|
||||||
<configSections>
|
<configSections>
|
||||||
<!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
|
<!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
|
||||||
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
|
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
|
||||||
</configSections>
|
</configSections>
|
||||||
<entityFramework>
|
<entityFramework>
|
||||||
<defaultConnectionFactory type="MySql.Data.Entity.MySqlConnectionFactory, MySql.Data.Entity.EF6" />
|
<!--<defaultConnectionFactory type="MySql.Data.Entity.MySqlConnectionFactory, MySql.Data.EntityFramework" />-->
|
||||||
<providers>
|
<defaultConnectionFactory type="System.Data.Entity.Infrastructure.SqlConnectionFactory, EntityFramework"/>
|
||||||
|
<providers>
|
||||||
<provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />
|
<provider invariantName="MySql.Data.MySqlClient" type="MySql.Data.MySqlClient.MySqlProviderServices, MySql.Data.EntityFramework, Version=8.0.21.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d">
|
||||||
<provider invariantName="MySql.Data.MySqlClient" type="MySql.Data.MySqlClient.MySqlProviderServices, MySql.Data.EntityFramework, Version=8.0.21.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d">
|
</provider>
|
||||||
</provider></providers>
|
</providers>
|
||||||
</entityFramework>
|
</entityFramework>
|
||||||
<connectionStrings>
|
<connectionStrings>
|
||||||
<add name="DefaultConnection" connectionString="server=localhost;port=3306;User Id=EgtUser;password=viacremasca;Persist Security Info=True;database=EgtBwDb;SslMode=none" providerName="MySql.Data.MySqlClient" />
|
<add name="DefaultConnection" connectionString="server=localhost;port=3306;User Id=EgtUser;password=viacremasca;Persist Security Info=True;database=EgtBwDb;SslMode=none" providerName="MySql.Data.MySqlClient" />
|
||||||
</connectionStrings>
|
</connectionStrings>
|
||||||
<runtime>
|
<runtime>
|
||||||
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
|
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
|
||||||
<dependentAssembly>
|
<dependentAssembly>
|
||||||
<assemblyIdentity name="MySql.Data" publicKeyToken="c5687fc88969c44d" culture="neutral" />
|
<assemblyIdentity name="MySql.Data" publicKeyToken="c5687fc88969c44d" culture="neutral" />
|
||||||
<bindingRedirect oldVersion="0.0.0.0-8.0.29.0" newVersion="8.0.29.0" />
|
<bindingRedirect oldVersion="0.0.0.0-8.0.21.0" newVersion="8.0.21.0" />
|
||||||
</dependentAssembly>
|
</dependentAssembly>
|
||||||
<dependentAssembly>
|
<dependentAssembly>
|
||||||
<assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
|
<assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
|
||||||
<bindingRedirect oldVersion="0.0.0.0-5.0.0.0" newVersion="5.0.0.0" />
|
<bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
|
||||||
</dependentAssembly>
|
</dependentAssembly>
|
||||||
<dependentAssembly>
|
<dependentAssembly>
|
||||||
<assemblyIdentity name="Google.Protobuf" publicKeyToken="a7d26565bac4d604" culture="neutral" />
|
<assemblyIdentity name="Google.Protobuf" publicKeyToken="a7d26565bac4d604" culture="neutral" />
|
||||||
<bindingRedirect oldVersion="0.0.0.0-3.19.4.0" newVersion="3.19.4.0" />
|
<bindingRedirect oldVersion="0.0.0.0-3.21.9.0" newVersion="3.21.9.0" />
|
||||||
</dependentAssembly>
|
</dependentAssembly>
|
||||||
<dependentAssembly>
|
<dependentAssembly>
|
||||||
<assemblyIdentity name="K4os.Compression.LZ4.Streams" publicKeyToken="2186fa9121ef231d" culture="neutral" />
|
<assemblyIdentity name="K4os.Compression.LZ4.Streams" publicKeyToken="2186fa9121ef231d" culture="neutral" />
|
||||||
<bindingRedirect oldVersion="0.0.0.0-1.2.6.0" newVersion="1.2.6.0" />
|
<bindingRedirect oldVersion="0.0.0.0-1.3.5.0" newVersion="1.3.5.0" />
|
||||||
</dependentAssembly>
|
</dependentAssembly>
|
||||||
<dependentAssembly>
|
<dependentAssembly>
|
||||||
<assemblyIdentity name="BouncyCastle.Crypto" publicKeyToken="0e99375e54769942" culture="neutral" />
|
<assemblyIdentity name="BouncyCastle.Crypto" publicKeyToken="0e99375e54769942" culture="neutral" />
|
||||||
<bindingRedirect oldVersion="0.0.0.0-1.8.5.0" newVersion="1.8.5.0" />
|
<bindingRedirect oldVersion="0.0.0.0-1.9.0.0" newVersion="1.9.0.0" />
|
||||||
</dependentAssembly>
|
</dependentAssembly>
|
||||||
</assemblyBinding>
|
<dependentAssembly>
|
||||||
</runtime>
|
<assemblyIdentity name="System.Memory" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
|
||||||
<system.data>
|
<bindingRedirect oldVersion="0.0.0.0-4.0.1.2" newVersion="4.0.1.2" />
|
||||||
<DbProviderFactories>
|
</dependentAssembly>
|
||||||
<remove invariant="MySql.Data.MySqlClient" />
|
</assemblyBinding>
|
||||||
<add name="MySQL Data Provider" invariant="MySql.Data.MySqlClient" description=".Net Framework Data Provider for MySQL" type="MySql.Data.MySqlClient.MySqlClientFactory, MySql.Data, Version=8.0.29.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d" />
|
</runtime>
|
||||||
</DbProviderFactories>
|
<system.data>
|
||||||
</system.data>
|
<DbProviderFactories>
|
||||||
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" /></startup></configuration>
|
<remove invariant="MySql.Data.MySqlClient" />
|
||||||
|
<add name="MySQL Data Provider" invariant="MySql.Data.MySqlClient" description=".Net Framework Data Provider for MySQL" type="MySql.Data.MySqlClient.MySqlClientFactory, MySql.Data, Version=8.0.21.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d" />
|
||||||
|
</DbProviderFactories>
|
||||||
|
</system.data>
|
||||||
|
<startup>
|
||||||
|
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" />
|
||||||
|
</startup>
|
||||||
|
</configuration>
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ Public Class BTLFeatureVM
|
|||||||
If value <> -1 Then
|
If value <> -1 Then
|
||||||
' verifico se solido attivo
|
' verifico se solido attivo
|
||||||
Dim bShowSolid As Boolean = Map.refShowBeamPanelVM.ShowSolid_IsChecked
|
Dim bShowSolid As Boolean = Map.refShowBeamPanelVM.ShowSolid_IsChecked
|
||||||
If bShowSolid Then Map.refProjectVM.BTLStructureVM.ShowSolid(False)
|
If bShowSolid Then Map.refProjectVM.BTLStructureVM.ShowSolid(GDB_ID.NULL, False, False)
|
||||||
' aggiorno la feature con nuovo valore
|
' aggiorno la feature con nuovo valore
|
||||||
Dim vPar() As Double = Nothing
|
Dim vPar() As Double = Nothing
|
||||||
Dim sPar As String = String.Empty
|
Dim sPar As String = String.Empty
|
||||||
@@ -40,10 +40,9 @@ Public Class BTLFeatureVM
|
|||||||
' rendo non calcolata questa feature
|
' rendo non calcolata questa feature
|
||||||
ResetCalcFeature()
|
ResetCalcFeature()
|
||||||
End If
|
End If
|
||||||
NotifyPropertyChanged("nSelGRP")
|
|
||||||
NotifyPropertyChanged(NameOf(nSelGRP))
|
NotifyPropertyChanged(NameOf(nSelGRP))
|
||||||
|
If bShowSolid Then Map.refProjectVM.BTLStructureVM.ShowSolid(GDB_ID.NULL, True, False)
|
||||||
EgtDraw()
|
EgtDraw()
|
||||||
If bShowSolid Then Map.refProjectVM.BTLStructureVM.ShowSolid(False)
|
|
||||||
End If
|
End If
|
||||||
End Set
|
End Set
|
||||||
End Property
|
End Property
|
||||||
@@ -66,7 +65,7 @@ Public Class BTLFeatureVM
|
|||||||
If value <> -1 Then
|
If value <> -1 Then
|
||||||
' verifico se solido attivo
|
' verifico se solido attivo
|
||||||
Dim bShowSolid As Boolean = Map.refShowBeamPanelVM.ShowSolid_IsChecked
|
Dim bShowSolid As Boolean = Map.refShowBeamPanelVM.ShowSolid_IsChecked
|
||||||
If bShowSolid Then Map.refProjectVM.BTLStructureVM.ShowSolid(False)
|
If bShowSolid Then Map.refProjectVM.BTLStructureVM.ShowSolid(GDB_ID.NULL, False, False)
|
||||||
' se freecontour
|
' se freecontour
|
||||||
If Me.m_BTLFeatureM.IsFreeContour() Then
|
If Me.m_BTLFeatureM.IsFreeContour() Then
|
||||||
' cambio faccia alla geometria
|
' cambio faccia alla geometria
|
||||||
@@ -109,12 +108,33 @@ Public Class BTLFeatureVM
|
|||||||
ResetCalcFeature()
|
ResetCalcFeature()
|
||||||
End If
|
End If
|
||||||
NotifyPropertyChanged("nSelSIDE")
|
NotifyPropertyChanged("nSelSIDE")
|
||||||
|
If bShowSolid Then Map.refProjectVM.BTLStructureVM.ShowSolid(GDB_ID.NULL, True, False)
|
||||||
EgtDraw()
|
EgtDraw()
|
||||||
If bShowSolid Then Map.refProjectVM.BTLStructureVM.ShowSolid(False)
|
|
||||||
End If
|
End If
|
||||||
End Set
|
End Set
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
|
Public Property sPriority As String
|
||||||
|
Get
|
||||||
|
Return m_BTLFeatureM.nPriority.ToString()
|
||||||
|
End Get
|
||||||
|
Set(value As String)
|
||||||
|
Dim nTemp As Integer = 0
|
||||||
|
If Integer.TryParse(value, nTemp) Then
|
||||||
|
If EgtSetInfo(nFeatureId, BTL_FTR_PRIORITY, nTemp) Then
|
||||||
|
m_BTLFeatureM.nPriority = nTemp
|
||||||
|
' setto feature da ricalcolare
|
||||||
|
ResetCalcFeature()
|
||||||
|
' se in View
|
||||||
|
If Map.refMainMenuVM.SelPage = Pages.VIEW Then
|
||||||
|
' imposto modificato per copie
|
||||||
|
EgtDuploSetModified(m_BTLPartM.nPartId)
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
NotifyPropertyChanged(NameOf(sPriority))
|
||||||
|
End Set
|
||||||
|
End Property
|
||||||
' proprieta' che indica se e' attivo l'update del parametro bDO su piu' feature (attiva/disattiva tutti su pezzo, o per tipo con tasto destro)
|
' proprieta' che indica se e' attivo l'update del parametro bDO su piu' feature (attiva/disattiva tutti su pezzo, o per tipo con tasto destro)
|
||||||
' necessario per evitare ricalcolo della grafica sulla modifica del parametro per ogni feature
|
' necessario per evitare ricalcolo della grafica sulla modifica del parametro per ogni feature
|
||||||
Private Shared m_bDO_MultipleUpdate As Boolean = False
|
Private Shared m_bDO_MultipleUpdate As Boolean = False
|
||||||
@@ -136,7 +156,7 @@ Public Class BTLFeatureVM
|
|||||||
If value <> m_BTLFeatureM.bDO Then
|
If value <> m_BTLFeatureM.bDO Then
|
||||||
If Map.refMainMenuVM.SelPage = Pages.VIEW Then
|
If Map.refMainMenuVM.SelPage = Pages.VIEW Then
|
||||||
' verifico se solido attivo
|
' verifico se solido attivo
|
||||||
If bShowSolid Then Map.refProjectVM.BTLStructureVM.ShowSolid(False)
|
If bShowSolid Then Map.refProjectVM.BTLStructureVM.ShowSolid(GDB_ID.NULL, False, False)
|
||||||
End If
|
End If
|
||||||
If EgtBeamEnableProcess(nFeatureId, value, Not m_bDO_MultipleUpdate) Then
|
If EgtBeamEnableProcess(nFeatureId, value, Not m_bDO_MultipleUpdate) Then
|
||||||
m_BTLFeatureM.bDO = value
|
m_BTLFeatureM.bDO = value
|
||||||
@@ -155,7 +175,7 @@ Public Class BTLFeatureVM
|
|||||||
End If
|
End If
|
||||||
If Map.refMainMenuVM.SelPage = Pages.VIEW Then
|
If Map.refMainMenuVM.SelPage = Pages.VIEW Then
|
||||||
' eventualmente ripristino solido
|
' eventualmente ripristino solido
|
||||||
If bShowSolid Then Map.refProjectVM.BTLStructureVM.ShowSolid(False)
|
If bShowSolid Then Map.refProjectVM.BTLStructureVM.ShowSolid(GDB_ID.NULL, True, False)
|
||||||
End If
|
End If
|
||||||
If Not m_bDO_MultipleUpdate Then EgtDraw()
|
If Not m_bDO_MultipleUpdate Then EgtDraw()
|
||||||
' aggiorno stato abilitazione del bottone modifica free contour
|
' aggiorno stato abilitazione del bottone modifica free contour
|
||||||
@@ -214,7 +234,7 @@ Public Class BTLFeatureVM
|
|||||||
m_SelQParam = value
|
m_SelQParam = value
|
||||||
If Not IsNothing(m_SelQParam) Then
|
If Not IsNothing(m_SelQParam) Then
|
||||||
' imposto path disegno da mostrare in BottomPanel
|
' imposto path disegno da mostrare in BottomPanel
|
||||||
Map.refBottomPanelVM.SetCurrDraw(sDrawPath)
|
Map.refBottomPanelVM.SetCurrDraw(m_SelQParam.sDrawPath)
|
||||||
End If
|
End If
|
||||||
NotifyPropertyChanged(NameOf(SelQBTLParam))
|
NotifyPropertyChanged(NameOf(SelQBTLParam))
|
||||||
End Set
|
End Set
|
||||||
@@ -222,7 +242,7 @@ Public Class BTLFeatureVM
|
|||||||
|
|
||||||
Public ReadOnly Property Edit_Visibility As Visibility
|
Public ReadOnly Property Edit_Visibility As Visibility
|
||||||
Get
|
Get
|
||||||
Return If(Map.refMainWindowVM.MainWindowM.nUserLevel > 5 AndAlso BTLFeatureM.IsFreeContour AndAlso Not Map.refFreeContourManagerVM.bIsActive, Visibility.Visible, Visibility.Collapsed)
|
Return If(BTLFeatureM.IsFreeContour AndAlso Not Map.refFreeContourManagerVM.bIsActive, Visibility.Visible, Visibility.Collapsed)
|
||||||
End Get
|
End Get
|
||||||
End Property
|
End Property
|
||||||
Public ReadOnly Property SaveCancel_Visibility As Visibility
|
Public ReadOnly Property SaveCancel_Visibility As Visibility
|
||||||
@@ -373,6 +393,8 @@ Public Class BTLFeatureVM
|
|||||||
For Each QPar In QBTLParamVMList
|
For Each QPar In QBTLParamVMList
|
||||||
If QPar.bCustom Then EgtSetInfo(nNewFeatureId, QPar.sName & "A", 1)
|
If QPar.bCustom Then EgtSetInfo(nNewFeatureId, QPar.sName & "A", 1)
|
||||||
Next
|
Next
|
||||||
|
' Riporto priority
|
||||||
|
EgtSetInfo(nNewFeatureId, BTL_FTR_PRIORITY, m_BTLFeatureM.nPriority)
|
||||||
Dim NewFeat As BTLFeatureM = BTLFeatureM.CreateBTLFeature(m_BTLPartM, nNewFeatureId)
|
Dim NewFeat As BTLFeatureM = BTLFeatureM.CreateBTLFeature(m_BTLPartM, nNewFeatureId)
|
||||||
' la aggiungo a struttura BTL pezzo di destinazione
|
' la aggiungo a struttura BTL pezzo di destinazione
|
||||||
DestBTLPart.AddBTLFeature(NewFeat)
|
DestBTLPart.AddBTLFeature(NewFeat)
|
||||||
|
|||||||
@@ -121,9 +121,9 @@ Public Class BTLParamVM
|
|||||||
' trasformo valori
|
' trasformo valori
|
||||||
Select Case m_BTLParamM.nType
|
Select Case m_BTLParamM.nType
|
||||||
Case BTLParamType.DOUBLE_
|
Case BTLParamType.DOUBLE_
|
||||||
StringToDouble(value, dNewValue)
|
StringToDoubleAdv(value, dNewValue, True)
|
||||||
Case BTLParamType.LENGTH
|
Case BTLParamType.LENGTH
|
||||||
StringToLen(value, dNewValue)
|
StringToLenAdv(value, dNewValue, True)
|
||||||
Case Else
|
Case Else
|
||||||
' per string non faccio nulla
|
' per string non faccio nulla
|
||||||
End Select
|
End Select
|
||||||
@@ -168,9 +168,9 @@ Public Class BTLParamVM
|
|||||||
' trasformo valori
|
' trasformo valori
|
||||||
Select Case m_BTLParamM.nType
|
Select Case m_BTLParamM.nType
|
||||||
Case BTLParamType.DOUBLE_
|
Case BTLParamType.DOUBLE_
|
||||||
StringToDouble(value, dNewValue)
|
StringToDoubleAdv(value, dNewValue, True)
|
||||||
Case BTLParamType.LENGTH
|
Case BTLParamType.LENGTH
|
||||||
StringToLen(value, dNewValue)
|
StringToLenAdv(value, dNewValue, True)
|
||||||
Case Else
|
Case Else
|
||||||
' per string non faccio nulla
|
' per string non faccio nulla
|
||||||
End Select
|
End Select
|
||||||
@@ -277,7 +277,7 @@ Public Class BTLParamVM
|
|||||||
Friend Sub UpdateParamValue(dNewValue As Double, sNewValue As String, Optional bDraw As Boolean = True)
|
Friend Sub UpdateParamValue(dNewValue As Double, sNewValue As String, Optional bDraw As Boolean = True)
|
||||||
' verifico se solido attivo
|
' verifico se solido attivo
|
||||||
Dim bShowSolid As Boolean = Map.refShowBeamPanelVM.ShowSolid_IsChecked
|
Dim bShowSolid As Boolean = Map.refShowBeamPanelVM.ShowSolid_IsChecked
|
||||||
If bShowSolid Then Map.refProjectVM.BTLStructureVM.ShowSolid(False)
|
If bShowSolid Then Map.refProjectVM.BTLStructureVM.ShowSolid(GDB_ID.NULL, False, False)
|
||||||
' Recupero i parametri attuali della feature
|
' Recupero i parametri attuali della feature
|
||||||
Dim vPar() As Double = Nothing
|
Dim vPar() As Double = Nothing
|
||||||
Dim sPar As String = String.Empty
|
Dim sPar As String = String.Empty
|
||||||
@@ -335,7 +335,7 @@ Public Class BTLParamVM
|
|||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
|
|
||||||
If bShowSolid Then Map.refProjectVM.BTLStructureVM.ShowSolid(False)
|
If bShowSolid Then Map.refProjectVM.BTLStructureVM.ShowSolid(GDB_ID.NULL, True, False)
|
||||||
If bDraw Then EgtDraw()
|
If bDraw Then EgtDraw()
|
||||||
|
|
||||||
End Sub
|
End Sub
|
||||||
|
|||||||
@@ -118,7 +118,7 @@ Public Class BTLPartVM
|
|||||||
|
|
||||||
' verifico se solido attivo
|
' verifico se solido attivo
|
||||||
Dim bShowSolid As Boolean = Map.refShowBeamPanelVM.ShowSolid_IsChecked
|
Dim bShowSolid As Boolean = Map.refShowBeamPanelVM.ShowSolid_IsChecked
|
||||||
If bShowSolid Then Map.refProjectVM.BTLStructureVM.ShowSolid(False)
|
If bShowSolid Then Map.refProjectVM.BTLStructureVM.ShowSolid(GDB_ID.NULL, False, False)
|
||||||
|
|
||||||
If Not EgtBeamSetPartBox(dBtlL, dBtlH, dBtlW, False) Then Return False
|
If Not EgtBeamSetPartBox(dBtlL, dBtlH, dBtlW, False) Then Return False
|
||||||
|
|
||||||
@@ -134,7 +134,7 @@ Public Class BTLPartVM
|
|||||||
' aggiorno sezioni
|
' aggiorno sezioni
|
||||||
Map.refProjectVM.BTLStructureVM.UpdateSection(Section, OldSection)
|
Map.refProjectVM.BTLStructureVM.UpdateSection(Section, OldSection)
|
||||||
' eventualmente ripristino solido
|
' eventualmente ripristino solido
|
||||||
If bShowSolid Then Map.refProjectVM.BTLStructureVM.ShowSolid(False)
|
If bShowSolid Then Map.refProjectVM.BTLStructureVM.ShowSolid(GDB_ID.NULL, True, False)
|
||||||
EgtDraw()
|
EgtDraw()
|
||||||
|
|
||||||
Return True
|
Return True
|
||||||
@@ -156,7 +156,7 @@ Public Class BTLPartVM
|
|||||||
Public Property sL As String
|
Public Property sL As String
|
||||||
Get
|
Get
|
||||||
Dim nOrigGroupId As Integer = nPartId
|
Dim nOrigGroupId As Integer = nPartId
|
||||||
If Map.refMainMenuVM.SelPage = Pages.VIEW AndAlso Map.refShowBeamPanelVM.ShowBuilding_IsChecked AndAlso Map.refShowBeamPanelVM.bShowAll Then
|
If Map.refMainMenuVM.SelPage = Pages.VIEW AndAlso EgtBeamGetBuildingIsOn() AndAlso Map.refShowBeamPanelVM.bShowAll Then
|
||||||
nOrigGroupId = GetOrigFrameGroup(nPartId)
|
nOrigGroupId = GetOrigFrameGroup(nPartId)
|
||||||
End If
|
End If
|
||||||
Dim frBeam As New Frame3d
|
Dim frBeam As New Frame3d
|
||||||
@@ -171,7 +171,7 @@ Public Class BTLPartVM
|
|||||||
End Get
|
End Get
|
||||||
Set(value As String)
|
Set(value As String)
|
||||||
Dim dVal As Double
|
Dim dVal As Double
|
||||||
If StringToLen(value, dVal) Then
|
If StringToLenAdv(value, dVal, True) Then
|
||||||
Dim dBtlL = m_BTLPartM.dBtlL
|
Dim dBtlL = m_BTLPartM.dBtlL
|
||||||
Dim dBtlW = m_BTLPartM.dBtlW
|
Dim dBtlW = m_BTLPartM.dBtlW
|
||||||
Dim dBtlH = m_BTLPartM.dBtlH
|
Dim dBtlH = m_BTLPartM.dBtlH
|
||||||
@@ -214,7 +214,7 @@ Public Class BTLPartVM
|
|||||||
Public Property sW As String
|
Public Property sW As String
|
||||||
Get
|
Get
|
||||||
Dim nOrigGroupId As Integer = nPartId
|
Dim nOrigGroupId As Integer = nPartId
|
||||||
If Map.refMainMenuVM.SelPage = Pages.VIEW AndAlso Map.refShowBeamPanelVM.ShowBuilding_IsChecked AndAlso Map.refShowBeamPanelVM.bShowAll Then
|
If Map.refMainMenuVM.SelPage = Pages.VIEW AndAlso EgtBeamGetBuildingIsOn() AndAlso Map.refShowBeamPanelVM.bShowAll Then
|
||||||
nOrigGroupId = GetOrigFrameGroup(nPartId)
|
nOrigGroupId = GetOrigFrameGroup(nPartId)
|
||||||
End If
|
End If
|
||||||
Dim frBeam As New Frame3d
|
Dim frBeam As New Frame3d
|
||||||
@@ -229,7 +229,7 @@ Public Class BTLPartVM
|
|||||||
End Get
|
End Get
|
||||||
Set(value As String)
|
Set(value As String)
|
||||||
Dim dVal As Double
|
Dim dVal As Double
|
||||||
If StringToLen(value, dVal) Then
|
If StringToLenAdv(value, dVal, True) Then
|
||||||
Dim dBtlL = m_BTLPartM.dBtlL
|
Dim dBtlL = m_BTLPartM.dBtlL
|
||||||
Dim dBtlW = m_BTLPartM.dBtlW
|
Dim dBtlW = m_BTLPartM.dBtlW
|
||||||
Dim dBtlH = m_BTLPartM.dBtlH
|
Dim dBtlH = m_BTLPartM.dBtlH
|
||||||
@@ -272,7 +272,7 @@ Public Class BTLPartVM
|
|||||||
Public Property sH As String
|
Public Property sH As String
|
||||||
Get
|
Get
|
||||||
Dim nOrigGroupId As Integer = nPartId
|
Dim nOrigGroupId As Integer = nPartId
|
||||||
If Map.refMainMenuVM.SelPage = Pages.VIEW AndAlso Map.refShowBeamPanelVM.ShowBuilding_IsChecked AndAlso Map.refShowBeamPanelVM.bShowAll Then
|
If Map.refMainMenuVM.SelPage = Pages.VIEW AndAlso EgtBeamGetBuildingIsOn() AndAlso Map.refShowBeamPanelVM.bShowAll Then
|
||||||
nOrigGroupId = GetOrigFrameGroup(nPartId)
|
nOrigGroupId = GetOrigFrameGroup(nPartId)
|
||||||
End If
|
End If
|
||||||
Dim frBeam As New Frame3d
|
Dim frBeam As New Frame3d
|
||||||
@@ -287,7 +287,7 @@ Public Class BTLPartVM
|
|||||||
End Get
|
End Get
|
||||||
Set(value As String)
|
Set(value As String)
|
||||||
Dim dVal As Double
|
Dim dVal As Double
|
||||||
If StringToLen(value, dVal) Then
|
If StringToLenAdv(value, dVal, True) Then
|
||||||
Dim dBtlL = m_BTLPartM.dBtlL
|
Dim dBtlL = m_BTLPartM.dBtlL
|
||||||
Dim dBtlW = m_BTLPartM.dBtlW
|
Dim dBtlW = m_BTLPartM.dBtlW
|
||||||
Dim dBtlH = m_BTLPartM.dBtlH
|
Dim dBtlH = m_BTLPartM.dBtlH
|
||||||
@@ -550,7 +550,7 @@ Public Class BTLPartVM
|
|||||||
End Get
|
End Get
|
||||||
Set(value As String)
|
Set(value As String)
|
||||||
Dim dTempPlaningLen As Double
|
Dim dTempPlaningLen As Double
|
||||||
If StringToLen(value, dTempPlaningLen) AndAlso EgtSetInfo(m_BTLPartM.nPartId, BTL_PRT_PLANINGLENGTH, dTempPlaningLen) Then
|
If StringToLenAdv(value, dTempPlaningLen, True) AndAlso EgtSetInfo(m_BTLPartM.nPartId, BTL_PRT_PLANINGLENGTH, dTempPlaningLen) Then
|
||||||
m_BTLPartM.dPLANINGLEN = dTempPlaningLen
|
m_BTLPartM.dPLANINGLEN = dTempPlaningLen
|
||||||
Else
|
Else
|
||||||
NotifyPropertyChanged("dPLANINGLEN")
|
NotifyPropertyChanged("dPLANINGLEN")
|
||||||
@@ -564,7 +564,7 @@ Public Class BTLPartVM
|
|||||||
End Get
|
End Get
|
||||||
Set(value As String)
|
Set(value As String)
|
||||||
Dim dTempStartOffset As Double
|
Dim dTempStartOffset As Double
|
||||||
If StringToLen(value, dTempStartOffset) AndAlso EgtSetInfo(m_BTLPartM.nPartId, BTL_PRT_STARTOFFSET, dTempStartOffset) Then
|
If StringToLenAdv(value, dTempStartOffset, True) AndAlso EgtSetInfo(m_BTLPartM.nPartId, BTL_PRT_STARTOFFSET, dTempStartOffset) Then
|
||||||
m_BTLPartM.dSTARTOFFSET = dTempStartOffset
|
m_BTLPartM.dSTARTOFFSET = dTempStartOffset
|
||||||
Else
|
Else
|
||||||
NotifyPropertyChanged("dSTARTOFFSET")
|
NotifyPropertyChanged("dSTARTOFFSET")
|
||||||
@@ -578,7 +578,7 @@ Public Class BTLPartVM
|
|||||||
End Get
|
End Get
|
||||||
Set(value As String)
|
Set(value As String)
|
||||||
Dim dTempEndOffset As Double
|
Dim dTempEndOffset As Double
|
||||||
If StringToLen(value, dTempEndOffset) AndAlso EgtSetInfo(m_BTLPartM.nPartId, BTL_PRT_ENDOFFSET, dTempEndOffset) Then
|
If StringToLenAdv(value, dTempEndOffset, True) AndAlso EgtSetInfo(m_BTLPartM.nPartId, BTL_PRT_ENDOFFSET, dTempEndOffset) Then
|
||||||
m_BTLPartM.dENDOFFSET = dTempEndOffset
|
m_BTLPartM.dENDOFFSET = dTempEndOffset
|
||||||
Else
|
Else
|
||||||
NotifyPropertyChanged("dENDOFFSET")
|
NotifyPropertyChanged("dENDOFFSET")
|
||||||
@@ -625,9 +625,9 @@ Public Class BTLPartVM
|
|||||||
Dim sValArray() As String = value.Split(",")
|
Dim sValArray() As String = value.Split(",")
|
||||||
Dim ptOri As New Point3d
|
Dim ptOri As New Point3d
|
||||||
If sValArray.Count() >= 3 AndAlso
|
If sValArray.Count() >= 3 AndAlso
|
||||||
StringToLen(sValArray(0), ptOri.x) AndAlso
|
StringToLenAdv(sValArray(0), ptOri.x, True) AndAlso
|
||||||
StringToLen(sValArray(1), ptOri.y) AndAlso
|
StringToLenAdv(sValArray(1), ptOri.y, True) AndAlso
|
||||||
StringToLen(sValArray(2), ptOri.z) AndAlso
|
StringToLenAdv(sValArray(2), ptOri.z, True) AndAlso
|
||||||
m_BTLPartM.refTransf.ChangeOrigin(ptOri) Then
|
m_BTLPartM.refTransf.ChangeOrigin(ptOri) Then
|
||||||
EgtSetInfo(m_BTLPartM.nPartId, BTL_PRT_TRANSFORMATION & (SelUID + 1), LenToString(m_BTLPartM.refTransf.Orig.x, 3) & "," &
|
EgtSetInfo(m_BTLPartM.nPartId, BTL_PRT_TRANSFORMATION & (SelUID + 1), LenToString(m_BTLPartM.refTransf.Orig.x, 3) & "," &
|
||||||
LenToString(m_BTLPartM.refTransf.Orig.y, 3) & "," &
|
LenToString(m_BTLPartM.refTransf.Orig.y, 3) & "," &
|
||||||
@@ -661,9 +661,9 @@ Public Class BTLPartVM
|
|||||||
Dim sValArray() As String = value.Split(",")
|
Dim sValArray() As String = value.Split(",")
|
||||||
Dim vtVersX As New Vector3d
|
Dim vtVersX As New Vector3d
|
||||||
If sValArray.Count() >= 3 AndAlso
|
If sValArray.Count() >= 3 AndAlso
|
||||||
StringToDouble(sValArray(0), vtVersX.x) AndAlso
|
StringToDoubleAdv(sValArray(0), vtVersX.x, True) AndAlso
|
||||||
StringToDouble(sValArray(1), vtVersX.y) AndAlso
|
StringToDoubleAdv(sValArray(1), vtVersX.y, True) AndAlso
|
||||||
StringToDouble(sValArray(2), vtVersX.z) AndAlso
|
StringToDoubleAdv(sValArray(2), vtVersX.z, True) AndAlso
|
||||||
m_BTLPartM.refTransf.Setup(ptOri, ptOri + vtVersX, ptOri + vtVersY) Then
|
m_BTLPartM.refTransf.Setup(ptOri, ptOri + vtVersX, ptOri + vtVersY) Then
|
||||||
EgtSetInfo(m_BTLPartM.nPartId, BTL_PRT_TRANSFORMATION & (SelUID + 1), LenToString(m_BTLPartM.refTransf.Orig.x, 3) & "," &
|
EgtSetInfo(m_BTLPartM.nPartId, BTL_PRT_TRANSFORMATION & (SelUID + 1), LenToString(m_BTLPartM.refTransf.Orig.x, 3) & "," &
|
||||||
LenToString(m_BTLPartM.refTransf.Orig.y, 3) & "," &
|
LenToString(m_BTLPartM.refTransf.Orig.y, 3) & "," &
|
||||||
@@ -699,9 +699,9 @@ Public Class BTLPartVM
|
|||||||
Dim sValArray() As String = value.Split(",")
|
Dim sValArray() As String = value.Split(",")
|
||||||
Dim vtVersY As New Vector3d
|
Dim vtVersY As New Vector3d
|
||||||
If sValArray.Count() >= 3 AndAlso
|
If sValArray.Count() >= 3 AndAlso
|
||||||
StringToDouble(sValArray(0), vtVersY.x) AndAlso
|
StringToDoubleAdv(sValArray(0), vtVersY.x, True) AndAlso
|
||||||
StringToDouble(sValArray(1), vtVersY.y) AndAlso
|
StringToDoubleAdv(sValArray(1), vtVersY.y, True) AndAlso
|
||||||
StringToDouble(sValArray(2), vtVersY.z) AndAlso
|
StringToDoubleAdv(sValArray(2), vtVersY.z, True) AndAlso
|
||||||
m_BTLPartM.refTransf.Setup(ptOri, ptOri + vtVersX, ptOri + vtVersY) Then
|
m_BTLPartM.refTransf.Setup(ptOri, ptOri + vtVersX, ptOri + vtVersY) Then
|
||||||
EgtSetInfo(m_BTLPartM.nPartId, BTL_PRT_TRANSFORMATION & (SelUID + 1), LenToString(m_BTLPartM.refTransf.Orig.x, 3) & "," &
|
EgtSetInfo(m_BTLPartM.nPartId, BTL_PRT_TRANSFORMATION & (SelUID + 1), LenToString(m_BTLPartM.refTransf.Orig.x, 3) & "," &
|
||||||
LenToString(m_BTLPartM.refTransf.Orig.y, 3) & "," &
|
LenToString(m_BTLPartM.refTransf.Orig.y, 3) & "," &
|
||||||
@@ -733,10 +733,10 @@ Public Class BTLPartVM
|
|||||||
Set(value As Integer)
|
Set(value As Integer)
|
||||||
Dim sValArray() As String = CamberParams.Split(",")
|
Dim sValArray() As String = CamberParams.Split(",")
|
||||||
If sValArray.Count() >= 4 AndAlso
|
If sValArray.Count() >= 4 AndAlso
|
||||||
StringToLen(sValArray(0), m_BTLPartM.m_dCamberLen1) AndAlso
|
StringToLenAdv(sValArray(0), m_BTLPartM.m_dCamberLen1, True) AndAlso
|
||||||
StringToLen(sValArray(1), m_BTLPartM.m_dCamberLen2) AndAlso
|
StringToLenAdv(sValArray(1), m_BTLPartM.m_dCamberLen2, True) AndAlso
|
||||||
StringToLen(sValArray(2), m_BTLPartM.m_dCamberLen3) AndAlso
|
StringToLenAdv(sValArray(2), m_BTLPartM.m_dCamberLen3, True) AndAlso
|
||||||
StringToLen(sValArray(3), m_BTLPartM.m_dCamberCross3) AndAlso
|
StringToLenAdv(sValArray(3), m_BTLPartM.m_dCamberCross3, True) AndAlso
|
||||||
EgtSetInfo(m_BTLPartM.nPartId, BTL_PRT_CAMBER, "SIDE: " & (value + 1) &
|
EgtSetInfo(m_BTLPartM.nPartId, BTL_PRT_CAMBER, "SIDE: " & (value + 1) &
|
||||||
" P01: " & sValArray(0) &
|
" P01: " & sValArray(0) &
|
||||||
" P02: " & sValArray(1) &
|
" P02: " & sValArray(1) &
|
||||||
@@ -759,10 +759,10 @@ Public Class BTLPartVM
|
|||||||
Set(value As String)
|
Set(value As String)
|
||||||
Dim sValArray() As String = value.Split(",")
|
Dim sValArray() As String = value.Split(",")
|
||||||
If sValArray.Count() >= 4 AndAlso
|
If sValArray.Count() >= 4 AndAlso
|
||||||
StringToLen(sValArray(0), m_BTLPartM.m_dCamberLen1) AndAlso
|
StringToLenAdv(sValArray(0), m_BTLPartM.m_dCamberLen1, True) AndAlso
|
||||||
StringToLen(sValArray(1), m_BTLPartM.m_dCamberLen2) AndAlso
|
StringToLenAdv(sValArray(1), m_BTLPartM.m_dCamberLen2, True) AndAlso
|
||||||
StringToLen(sValArray(2), m_BTLPartM.m_dCamberLen3) AndAlso
|
StringToLenAdv(sValArray(2), m_BTLPartM.m_dCamberLen3, True) AndAlso
|
||||||
StringToLen(sValArray(3), m_BTLPartM.m_dCamberCross3) Then
|
StringToLenAdv(sValArray(3), m_BTLPartM.m_dCamberCross3, True) Then
|
||||||
EgtSetInfo(m_BTLPartM.nPartId, BTL_PRT_CAMBER, " SIDE: " & (SelCAMBERSIDE + 1) &
|
EgtSetInfo(m_BTLPartM.nPartId, BTL_PRT_CAMBER, " SIDE: " & (SelCAMBERSIDE + 1) &
|
||||||
" P01: " & sValArray(0) &
|
" P01: " & sValArray(0) &
|
||||||
" P02: " & sValArray(1) &
|
" P02: " & sValArray(1) &
|
||||||
@@ -790,10 +790,10 @@ Public Class BTLPartVM
|
|||||||
|
|
||||||
Dim sValArray() As String = PartOffsetParams.Split(",")
|
Dim sValArray() As String = PartOffsetParams.Split(",")
|
||||||
If sValArray.Count() >= 4 AndAlso
|
If sValArray.Count() >= 4 AndAlso
|
||||||
StringToLen(sValArray(0), m_BTLPartM.m_dPartOffsetSide1) AndAlso
|
StringToLenAdv(sValArray(0), m_BTLPartM.m_dPartOffsetSide1, True) AndAlso
|
||||||
StringToLen(sValArray(1), m_BTLPartM.m_dPartOffsetSide2) AndAlso
|
StringToLenAdv(sValArray(1), m_BTLPartM.m_dPartOffsetSide2, True) AndAlso
|
||||||
StringToLen(sValArray(2), m_BTLPartM.m_dPartOffsetSide3) AndAlso
|
StringToLenAdv(sValArray(2), m_BTLPartM.m_dPartOffsetSide3, True) AndAlso
|
||||||
StringToLen(sValArray(3), m_BTLPartM.m_dPartOffsetSide4) AndAlso
|
StringToLenAdv(sValArray(3), m_BTLPartM.m_dPartOffsetSide4, True) AndAlso
|
||||||
EgtSetInfo(m_BTLPartM.nPartId, BTL_PRT_PARTOFFSET, " P04: " & sValue &
|
EgtSetInfo(m_BTLPartM.nPartId, BTL_PRT_PARTOFFSET, " P04: " & sValue &
|
||||||
" P11: " & sValArray(0) &
|
" P11: " & sValArray(0) &
|
||||||
" P12: " & sValArray(1) &
|
" P12: " & sValArray(1) &
|
||||||
@@ -819,10 +819,10 @@ Public Class BTLPartVM
|
|||||||
|
|
||||||
Dim sValArray() As String = value.Split(",")
|
Dim sValArray() As String = value.Split(",")
|
||||||
If sValArray.Count() >= 4 AndAlso
|
If sValArray.Count() >= 4 AndAlso
|
||||||
StringToLen(sValArray(0), m_BTLPartM.m_dPartOffsetSide1) AndAlso
|
StringToLenAdv(sValArray(0), m_BTLPartM.m_dPartOffsetSide1, True) AndAlso
|
||||||
StringToLen(sValArray(1), m_BTLPartM.m_dPartOffsetSide2) AndAlso
|
StringToLenAdv(sValArray(1), m_BTLPartM.m_dPartOffsetSide2, True) AndAlso
|
||||||
StringToLen(sValArray(2), m_BTLPartM.m_dPartOffsetSide3) AndAlso
|
StringToLenAdv(sValArray(2), m_BTLPartM.m_dPartOffsetSide3, True) AndAlso
|
||||||
StringToLen(sValArray(3), m_BTLPartM.m_dPartOffsetSide4) Then
|
StringToLenAdv(sValArray(3), m_BTLPartM.m_dPartOffsetSide4, True) Then
|
||||||
EgtSetInfo(m_BTLPartM.nPartId, BTL_PRT_PARTOFFSET, " P04: " & sValue &
|
EgtSetInfo(m_BTLPartM.nPartId, BTL_PRT_PARTOFFSET, " P04: " & sValue &
|
||||||
" P11: " & sValArray(0) &
|
" P11: " & sValArray(0) &
|
||||||
" P12: " & sValArray(1) &
|
" P12: " & sValArray(1) &
|
||||||
@@ -973,9 +973,9 @@ Public Class BTLPartVM
|
|||||||
Dim sValArray() As String = value.Split(",")
|
Dim sValArray() As String = value.Split(",")
|
||||||
Dim dX, dY, dZ As Double
|
Dim dX, dY, dZ As Double
|
||||||
If sValArray.Count() >= 3 AndAlso
|
If sValArray.Count() >= 3 AndAlso
|
||||||
StringToDouble(sValArray(0), dX) AndAlso
|
StringToDoubleAdv(sValArray(0), dX, True) AndAlso
|
||||||
StringToDouble(sValArray(1), dY) AndAlso
|
StringToDoubleAdv(sValArray(1), dY, True) AndAlso
|
||||||
StringToDouble(sValArray(2), dZ) Then
|
StringToDoubleAdv(sValArray(2), dZ, True) Then
|
||||||
m_BTLPartM.refGrainDir = New Vector3d(dX, dY, dZ)
|
m_BTLPartM.refGrainDir = New Vector3d(dX, dY, dZ)
|
||||||
EgtSetInfo(m_BTLPartM.nPartId, BTL_PRT_GRAINDIR, sValArray(0) & "," &
|
EgtSetInfo(m_BTLPartM.nPartId, BTL_PRT_GRAINDIR, sValArray(0) & "," &
|
||||||
sValArray(1) & "," &
|
sValArray(1) & "," &
|
||||||
@@ -994,9 +994,9 @@ Public Class BTLPartVM
|
|||||||
Set(value As Boolean)
|
Set(value As Boolean)
|
||||||
Dim sValArray() As String = GrainDirection.Split(",")
|
Dim sValArray() As String = GrainDirection.Split(",")
|
||||||
If sValArray.Count() >= 3 AndAlso
|
If sValArray.Count() >= 3 AndAlso
|
||||||
StringToDouble(sValArray(0), m_BTLPartM.refGrainDir.x) AndAlso
|
StringToDoubleAdv(sValArray(0), m_BTLPartM.refGrainDir.x, True) AndAlso
|
||||||
StringToDouble(sValArray(1), m_BTLPartM.refGrainDir.y) AndAlso
|
StringToDoubleAdv(sValArray(1), m_BTLPartM.refGrainDir.y, True) AndAlso
|
||||||
StringToDouble(sValArray(2), m_BTLPartM.refGrainDir.z) AndAlso
|
StringToDoubleAdv(sValArray(2), m_BTLPartM.refGrainDir.z, True) AndAlso
|
||||||
EgtSetInfo(m_BTLPartM.nPartId, BTL_PRT_GRAINDIR, sValArray(0) & "," &
|
EgtSetInfo(m_BTLPartM.nPartId, BTL_PRT_GRAINDIR, sValArray(0) & "," &
|
||||||
sValArray(1) & "," &
|
sValArray(1) & "," &
|
||||||
sValArray(2) & ";" &
|
sValArray(2) & ";" &
|
||||||
@@ -1395,7 +1395,7 @@ Public Class BTLPartVM
|
|||||||
Public ReadOnly Property Section As SectionXMaterial
|
Public ReadOnly Property Section As SectionXMaterial
|
||||||
Get
|
Get
|
||||||
Dim nOrigGroupId As Integer = nPartId
|
Dim nOrigGroupId As Integer = nPartId
|
||||||
If Map.refMainMenuVM.SelPage = Pages.VIEW AndAlso Map.refShowBeamPanelVM.ShowBuilding_IsChecked AndAlso Map.refShowBeamPanelVM.bShowAll Then
|
If Map.refMainMenuVM.SelPage = Pages.VIEW AndAlso EgtBeamGetBuildingIsOn() AndAlso Map.refShowBeamPanelVM.bShowAll Then
|
||||||
nOrigGroupId = GetOrigFrameGroup(nPartId)
|
nOrigGroupId = GetOrigFrameGroup(nPartId)
|
||||||
End If
|
End If
|
||||||
Dim frBeam As New Frame3d
|
Dim frBeam As New Frame3d
|
||||||
@@ -1530,6 +1530,7 @@ Public Class BTLPartVM
|
|||||||
m_SelBTLFeatureVM.RefreshFCMBtnVisibility()
|
m_SelBTLFeatureVM.RefreshFCMBtnVisibility()
|
||||||
' aggiorno stato abilitazione del bottone modifica free contour
|
' aggiorno stato abilitazione del bottone modifica free contour
|
||||||
Map.refFeatureManagerVM.SetEditIsEnabled()
|
Map.refFeatureManagerVM.SetEditIsEnabled()
|
||||||
|
Map.refFeatureManagerVM.NotifyPropertyChanged(NameOf(Map.refFeatureManagerVM.Priority_Visibility))
|
||||||
Else
|
Else
|
||||||
EgtDeselectAll()
|
EgtDeselectAll()
|
||||||
End If
|
End If
|
||||||
@@ -1629,9 +1630,9 @@ Public Class BTLPartVM
|
|||||||
AddHandler m_BTLFeatureVMList.CollectionChanged, AddressOf OnBTLFeatureVMListChanged
|
AddHandler m_BTLFeatureVMList.CollectionChanged, AddressOf OnBTLFeatureVMListChanged
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Public Sub Rotation(IsPositive As Boolean, SelectedMachineType As MachineType, Optional dAng As Double = 90, Optional bVerifyDuplo As Boolean = True)
|
Public Sub Rotation(IsPositive As Boolean, SelectedMachineType As MachineType, Optional bRedraw As Boolean = True, Optional dAng As Double = 90, Optional bVerifyDuplo As Boolean = True)
|
||||||
Dim OldSection As SectionXMaterial = Section
|
Dim OldSection As SectionXMaterial = Section
|
||||||
If m_BTLPartM.Rotation(IsPositive, SelectedMachineType, dAng) Then
|
If m_BTLPartM.Rotation(IsPositive, SelectedMachineType, bRedraw, dAng) Then
|
||||||
' aggiorno visualizzazione dimensioni
|
' aggiorno visualizzazione dimensioni
|
||||||
NotifyPropertyChanged(NameOf(sW))
|
NotifyPropertyChanged(NameOf(sW))
|
||||||
NotifyPropertyChanged(NameOf(sH))
|
NotifyPropertyChanged(NameOf(sH))
|
||||||
@@ -1985,11 +1986,11 @@ Public Class BTLPartVM
|
|||||||
BackRotation(True)
|
BackRotation(True)
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Public Sub BackRotation(Optional bUpdateSection As Boolean = False)
|
Public Sub BackRotation(Optional bUpdateSection As Boolean = False, Optional bRedraw As Boolean = True)
|
||||||
' salvo sezione impostata
|
' salvo sezione impostata
|
||||||
Dim CurrSection As SectionXMaterial = Map.refProjectVM.BTLStructureVM.SelSection
|
Dim CurrSection As SectionXMaterial = Map.refProjectVM.BTLStructureVM.SelSection
|
||||||
' ruoto
|
' ruoto
|
||||||
Rotation(False, Map.refProjectVM.BTLStructureVM.nPROJTYPE)
|
Rotation(False, Map.refProjectVM.BTLStructureVM.nPROJTYPE, bRedraw)
|
||||||
' imposto lock
|
' imposto lock
|
||||||
bLockRotation = True
|
bLockRotation = True
|
||||||
' se progetto travi e sezione precedente diversa da vuota (tutti i pezzi)
|
' se progetto travi e sezione precedente diversa da vuota (tutti i pezzi)
|
||||||
@@ -2017,10 +2018,10 @@ Public Class BTLPartVM
|
|||||||
ForwardRotation(True)
|
ForwardRotation(True)
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Public Sub ForwardRotation(Optional bUpdateSection As Boolean = False)
|
Public Sub ForwardRotation(Optional bUpdateSection As Boolean = False, Optional bRedraw As Boolean = True)
|
||||||
' salvo sezione impostata
|
' salvo sezione impostata
|
||||||
Dim CurrSection As SectionXMaterial = Map.refProjectVM.BTLStructureVM.SelSection
|
Dim CurrSection As SectionXMaterial = Map.refProjectVM.BTLStructureVM.SelSection
|
||||||
Rotation(True, Map.refProjectVM.BTLStructureVM.nPROJTYPE)
|
Rotation(True, Map.refProjectVM.BTLStructureVM.nPROJTYPE, bRedraw)
|
||||||
' imposto lock
|
' imposto lock
|
||||||
bLockRotation = True
|
bLockRotation = True
|
||||||
' se progetto travi e sezione precedente diversa da vuota (tutti i pezzi)
|
' se progetto travi e sezione precedente diversa da vuota (tutti i pezzi)
|
||||||
@@ -2160,7 +2161,10 @@ Public Class BTLPartVM
|
|||||||
Select Case e.PropertyName
|
Select Case e.PropertyName
|
||||||
Case NameOf(sender.nSelGRP), NameOf(sender.nSelSIDE)
|
Case NameOf(sender.nSelGRP), NameOf(sender.nSelSIDE)
|
||||||
CalcGlobalUpdate(True)
|
CalcGlobalUpdate(True)
|
||||||
Case NameOf(sender.bDO)
|
' imposto path disegno da mostrare in BottomPanel
|
||||||
|
Dim SelPBTLParam As BTLParamVM = Map.refProjectVM.BTLStructureVM.SelBTLPart.SelBTLFeatureVM.SelPBTLParam
|
||||||
|
If Not IsNothing(SelPBTLParam) Then Map.refBottomPanelVM.SetCurrDraw(SelPBTLParam.sDrawPath)
|
||||||
|
Case NameOf(sender.bDO), NameOf(sender.sPriority)
|
||||||
NotifyPropertyChanged(NameOf(bDOALL))
|
NotifyPropertyChanged(NameOf(bDOALL))
|
||||||
' setto pezzo da ricalcolare
|
' setto pezzo da ricalcolare
|
||||||
'ResetCalcTotalPart()
|
'ResetCalcTotalPart()
|
||||||
|
|||||||
@@ -79,7 +79,8 @@ Public Class BTLStructureVM
|
|||||||
Map.refProjectVM.NotifyPropertyChanged(NameOf(Map.refProjectVM.PartManager_Visibility))
|
Map.refProjectVM.NotifyPropertyChanged(NameOf(Map.refProjectVM.PartManager_Visibility))
|
||||||
Case SelectionTypes.HIGHLIGHT
|
Case SelectionTypes.HIGHLIGHT
|
||||||
If m_PrevSelectionType = SelectionTypes.SELECT_ Then
|
If m_PrevSelectionType = SelectionTypes.SELECT_ Then
|
||||||
|
EgtBeamShowFacesName( False)
|
||||||
|
EgtBeamShowLoadingSide( False, False)
|
||||||
End If
|
End If
|
||||||
If Not IsNothing(m_SelBTLPart) Then
|
If Not IsNothing(m_SelBTLPart) Then
|
||||||
m_SelBTLPart = Nothing
|
m_SelBTLPart = Nothing
|
||||||
@@ -181,6 +182,8 @@ Public Class BTLStructureVM
|
|||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Sub SelectBTLPart(BtlPart As BTLPartVM)
|
Private Sub SelectBTLPart(BtlPart As BTLPartVM)
|
||||||
|
EgtBeamShowFacesName( False)
|
||||||
|
EgtBeamShowLoadingSide( False, False)
|
||||||
m_SelBTLPart = BtlPart
|
m_SelBTLPart = BtlPart
|
||||||
If Map.refMainMenuVM.SelPage = Pages.VIEW Then
|
If Map.refMainMenuVM.SelPage = Pages.VIEW Then
|
||||||
' se modalità building, la tolgo
|
' se modalità building, la tolgo
|
||||||
@@ -191,6 +194,10 @@ Public Class BTLStructureVM
|
|||||||
SceneSelPartSelection()
|
SceneSelPartSelection()
|
||||||
' seleziono pezzo in Db geometrico
|
' seleziono pezzo in Db geometrico
|
||||||
EgtBeamSetPart(BtlPart.nPartId)
|
EgtBeamSetPart(BtlPart.nPartId)
|
||||||
|
EgtBeamShowFacesName( True)
|
||||||
|
Dim bLoadingSideShow As Boolean = (nPROJTYPE = BWType.BEAM)
|
||||||
|
Dim bLeftToRight As Boolean = Not ( CurrentMachine.ViewDir = VT.ISO_NW OrElse CurrentMachine.ViewDir = VT.ISO_NE)
|
||||||
|
EgtBeamShowLoadingSide( bLoadingSideShow, bLeftToRight)
|
||||||
' seleziono pagina BottomPanel
|
' seleziono pagina BottomPanel
|
||||||
Map.refBottomPanelVM.SetSelPartFeatureTab(BottomPanelVM.PartFeatureTab.PART)
|
Map.refBottomPanelVM.SetSelPartFeatureTab(BottomPanelVM.PartFeatureTab.PART)
|
||||||
'' mostro barra di gestione pezzo
|
'' mostro barra di gestione pezzo
|
||||||
@@ -236,9 +243,11 @@ Public Class BTLStructureVM
|
|||||||
If Map.refShowBeamPanelVM.ShowSolid_IsChecked Then
|
If Map.refShowBeamPanelVM.ShowSolid_IsChecked Then
|
||||||
' tolgo eventuale indicazione solido rimasta da pezzo precedente
|
' tolgo eventuale indicazione solido rimasta da pezzo precedente
|
||||||
Map.refShowBeamPanelVM.SetShowSolid(False)
|
Map.refShowBeamPanelVM.SetShowSolid(False)
|
||||||
Map.refProjectVM.BTLStructureVM.ShowSolid(False, BtlPart.nPartId)
|
Map.refProjectVM.BTLStructureVM.ShowSolid(BtlPart.nPartId, False, False)
|
||||||
End If
|
End If
|
||||||
If m_SelBTLPart Is BtlPart Then
|
If m_SelBTLPart Is BtlPart Then
|
||||||
|
EgtBeamShowFacesName( False)
|
||||||
|
EgtBeamShowLoadingSide( False, False)
|
||||||
m_SelBTLPart = Nothing
|
m_SelBTLPart = Nothing
|
||||||
NotifyPropertyChanged(NameOf(SelBTLPart))
|
NotifyPropertyChanged(NameOf(SelBTLPart))
|
||||||
End If
|
End If
|
||||||
@@ -1074,7 +1083,7 @@ Public Class BTLStructureVM
|
|||||||
If Not IsNothing(SelBTLPart) Then
|
If Not IsNothing(SelBTLPart) Then
|
||||||
' se pezzo solido, lo riporto normale
|
' se pezzo solido, lo riporto normale
|
||||||
If Map.refShowBeamPanelVM.ShowSolid_IsChecked Then
|
If Map.refShowBeamPanelVM.ShowSolid_IsChecked Then
|
||||||
ShowSolid(False)
|
ShowSolid(GDB_ID.NULL, False, False)
|
||||||
Map.refShowBeamPanelVM.SetShowSolid(False)
|
Map.refShowBeamPanelVM.SetShowSolid(False)
|
||||||
End If
|
End If
|
||||||
' tolgo pezzo selezionato
|
' tolgo pezzo selezionato
|
||||||
@@ -1123,12 +1132,12 @@ Public Class BTLStructureVM
|
|||||||
EgtZoom(ZM.ALL, bRedraw)
|
EgtZoom(ZM.ALL, bRedraw)
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Friend Sub ShowSolid(Optional bRedraw As Boolean = True, Optional nPartId As Integer = GDB_ID.NULL)
|
Friend Sub ShowSolid(nPartId As Integer, bShow As Boolean, Optional bRedraw As Boolean = True)
|
||||||
' se non viene passato, recupero il pezzo del primo oggetto selezionato
|
' se non viene passato, recupero il pezzo del primo oggetto selezionato
|
||||||
If nPartId = GDB_ID.NULL Then
|
If nPartId = GDB_ID.NULL And Not IsNothing(SelBTLPart) Then
|
||||||
nPartId = If(Not IsNothing(SelBTLPart), SelBTLPart.nPartId, GDB_ID.NULL)
|
nPartId = SelBTLPart.nPartId
|
||||||
End If
|
End If
|
||||||
If nPartId = GDB_ID.NULL Or Not EgtIsPart(nPartId) Then
|
If Not EgtIsPart(nPartId) Then
|
||||||
Dim nLayerId As Integer = EgtGetParent(nPartId)
|
Dim nLayerId As Integer = EgtGetParent(nPartId)
|
||||||
Dim sLayerName As String = ""
|
Dim sLayerName As String = ""
|
||||||
EgtGetName(nLayerId, sLayerName)
|
EgtGetName(nLayerId, sLayerName)
|
||||||
@@ -1142,17 +1151,11 @@ Public Class BTLStructureVM
|
|||||||
' disabilito impostazione modificato
|
' disabilito impostazione modificato
|
||||||
Dim DisableMgr As New DisableModifiedMgr
|
Dim DisableMgr As New DisableModifiedMgr
|
||||||
|
|
||||||
Dim nSolId As Integer = EgtBeamGetSolid(nPartId)
|
If bShow Then EgtBeamCalcSolid(nPartId)
|
||||||
If nSolId = GDB_ID.NULL OrElse Not EgtExistsInfo(nSolId, "VALID") Then
|
|
||||||
EgtBeamCalcSolid(nPartId)
|
|
||||||
EgtBeamShowSolid(nPartId, True)
|
|
||||||
Else
|
|
||||||
Dim nStat As Integer
|
|
||||||
EgtGetStatus(EgtGetParent(nSolId), nStat)
|
|
||||||
EgtBeamShowSolid(nPartId, (nStat = GDB_ST.OFF))
|
|
||||||
End If
|
|
||||||
|
|
||||||
|
EgtBeamShowSolid(nPartId, bShow)
|
||||||
If bRedraw Then EgtDraw()
|
If bRedraw Then EgtDraw()
|
||||||
|
|
||||||
' ripristino precedente impostazione modificato
|
' ripristino precedente impostazione modificato
|
||||||
DisableMgr.ReEnable()
|
DisableMgr.ReEnable()
|
||||||
End Sub
|
End Sub
|
||||||
|
|||||||
@@ -280,8 +280,8 @@ Public Class CALCPanelVM
|
|||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Shared Sub ProcessResults(Bar As Bar)
|
Private Shared Sub ProcessResults(Bar As Bar)
|
||||||
|
If IsNothing(Bar) Then Return
|
||||||
ProcessResults(Bar.sBarPath, Bar.nProgramPage, Bar.nBarId)
|
ProcessResults(Bar.sBarPath, Bar.nProgramPage, Bar.nBarId)
|
||||||
|
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Shared Sub ProcessResults(BtlPath As String, nProgramPage As ProjectType, nBarId As Integer)
|
Private Shared Sub ProcessResults(BtlPath As String, nProgramPage As ProjectType, nBarId As Integer)
|
||||||
@@ -312,7 +312,7 @@ Public Class CALCPanelVM
|
|||||||
|
|
||||||
If line.StartsWith("ERR=") Then
|
If line.StartsWith("ERR=") Then
|
||||||
Dim nVal As Integer? = GetVal(line, "ERR")
|
Dim nVal As Integer? = GetVal(line, "ERR")
|
||||||
nErr = (If(nVal IsNot Nothing, nVal.Value, 0))
|
nErr = (If(Not IsNothing(nVal), nVal.Value, 0))
|
||||||
sMsg = ""
|
sMsg = ""
|
||||||
dRot = 0
|
dRot = 0
|
||||||
nFall = 0
|
nFall = 0
|
||||||
@@ -320,24 +320,24 @@ Public Class CALCPanelVM
|
|||||||
taskId = 0
|
taskId = 0
|
||||||
ElseIf line.StartsWith("ROT=") Then
|
ElseIf line.StartsWith("ROT=") Then
|
||||||
Dim nVal As Integer? = GetVal(line, "ROT")
|
Dim nVal As Integer? = GetVal(line, "ROT")
|
||||||
Dim nRot As Integer = (If(nVal IsNot Nothing, nVal.Value, 0))
|
Dim nRot As Integer = (If(Not IsNothing(nVal), nVal.Value, 0))
|
||||||
dRot = Math.Abs(((4 - nRot) Mod 4) * 90)
|
dRot = Math.Abs(((4 - nRot) Mod 4) * 90)
|
||||||
dPartRot = Math.Max(dPartRot, dRot)
|
dPartRot = Math.Max(dPartRot, dRot)
|
||||||
dTotRot = Math.Max(dTotRot, dRot)
|
dTotRot = Math.Max(dTotRot, dRot)
|
||||||
ElseIf line.StartsWith("CUTID=") Then
|
ElseIf line.StartsWith("CUTID=") Then
|
||||||
Dim nVal As Integer? = GetVal(line, "CUTID")
|
Dim nVal As Integer? = GetVal(line, "CUTID")
|
||||||
cutId = If(nVal IsNot Nothing, nVal.Value, 0)
|
cutId = If(Not IsNothing(nVal), nVal.Value, 0)
|
||||||
ElseIf line.StartsWith("TASKID=") Then
|
ElseIf line.StartsWith("TASKID=") Then
|
||||||
Dim nVal As Integer? = GetVal(line, "TASKID")
|
Dim nVal As Integer? = GetVal(line, "TASKID")
|
||||||
taskId = (If(nVal IsNot Nothing, nVal.Value, 0))
|
taskId = (If(Not IsNothing(nVal), nVal.Value, 0))
|
||||||
ProcessResultAdd(ProcessResultList, ProcessResult.CreateTaskResult(cutId, taskId, nErr, sMsg, dRot), nProgramPage)
|
ProcessResultAdd(ProcessResultList, ProcessResult.CreateTaskResult(cutId, taskId, nErr, sMsg, dRot), nProgramPage)
|
||||||
ElseIf line.StartsWith("FALL=") Then
|
ElseIf line.StartsWith("FALL=") Then
|
||||||
Dim nVal As Integer? = GetVal(line, "FALL")
|
Dim nVal As Integer? = GetVal(line, "FALL")
|
||||||
nFall = (If(nVal IsNot Nothing, nVal.Value, 0))
|
nFall = (If(Not IsNothing(nVal), nVal.Value, 0))
|
||||||
ProcessResultList.Add(ProcessResult.CreateFallResult(cutId, nErr, sMsg, nFall))
|
ProcessResultList.Add(ProcessResult.CreateFallResult(cutId, nErr, sMsg, nFall))
|
||||||
ElseIf line.StartsWith("TIME=") Then
|
ElseIf line.StartsWith("TIME=") Then
|
||||||
Dim nVal As Integer? = GetVal(line, "TIME")
|
Dim nVal As Integer? = GetVal(line, "TIME")
|
||||||
nTotTime = (If(nVal IsNot Nothing, nVal.Value, 0))
|
nTotTime = (If(Not IsNothing(nVal), nVal.Value, 0))
|
||||||
ProcessResultList.Add(ProcessResult.CreateTimeResult(cutId, nTotTime))
|
ProcessResultList.Add(ProcessResult.CreateTimeResult(cutId, nTotTime))
|
||||||
'If Bar.nBarType = ProjectType.PROJ AndAlso Not IsNothing(currBTLPart) Then
|
'If Bar.nBarType = ProjectType.PROJ AndAlso Not IsNothing(currBTLPart) Then
|
||||||
' EgtSetInfo(currBTLPart.nPartId, If(Bar.nBarType = ProjectType.PROJ, ITG_PROJ_TIME, ITG_PROD_TIME), nTotTime, True)
|
' EgtSetInfo(currBTLPart.nPartId, If(Bar.nBarType = ProjectType.PROJ, ITG_PROJ_TIME, ITG_PROD_TIME), nTotTime, True)
|
||||||
|
|||||||