Compare commits
79 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 | |||
| 71afc6554e | |||
| bc40da74ab | |||
| 785792d63b | |||
| 330e501277 | |||
| c6f353ec35 | |||
| 0b7bdd6ade |
@@ -90,6 +90,16 @@ Public Class BTLFeatureM
|
||||
End Set
|
||||
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
|
||||
Protected m_sName As String
|
||||
Public ReadOnly Property sName As String
|
||||
@@ -244,10 +254,11 @@ Public Class BTLFeatureM
|
||||
Dim NewBTLFeature As New BTLFeatureM
|
||||
NewBTLFeature.m_ParentPart = ParentPart
|
||||
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_PRC, NewBTLFeature.m_nPRC)
|
||||
EgtGetInfo(nFeatureId, BTL_FTR_SIDE, NewBTLFeature.m_nSelSIDE)
|
||||
EgtGetInfo(nFeatureId, BTL_FTR_PRIORITY, NewBTLFeature.m_nPRIORITY)
|
||||
Dim nDO As Integer = 1
|
||||
If EgtGetInfo(nFeatureId, BTL_FTR_DO, nDO) Then
|
||||
NewBTLFeature.m_bDO = (nDO <> 0)
|
||||
@@ -309,6 +320,7 @@ Public Class BTLFeatureM
|
||||
NewBTLFeature.m_nPRC = nPRC
|
||||
NewBTLFeature.m_nSelGRP = nGRP
|
||||
NewBTLFeature.m_nSelSIDE = nSIDE
|
||||
NewBTLFeature.m_nPriority = 0
|
||||
NewBTLFeature.m_bDO = True
|
||||
' crea parametri per questa feature da file ini
|
||||
NewBTLFeature.CreateFeatureParams(NewBTLFeature)
|
||||
@@ -533,6 +545,7 @@ Public Class BTLFeatureM
|
||||
For Each QPar In QBTLParamMList
|
||||
If QPar.bCustom Then EgtSetInfo(nFeatureId, QPar.sName & "A", 1)
|
||||
Next
|
||||
EgtSetInfo( nFeatureId, BTL_FTR_PRIORITY, nPriority)
|
||||
SetFeatureId(nFeatureId)
|
||||
' imposto modificato per copie
|
||||
EgtDuploSetModified(ParentPart.nPartId)
|
||||
|
||||
@@ -797,15 +797,15 @@ Public Class BTLPartM
|
||||
Dim vtVersY As New Vector3d
|
||||
sValArray = sValue.Split({","}, StringSplitOptions.RemoveEmptyEntries)
|
||||
If sValArray.Count() >= 9 Then
|
||||
StringToLen(sValArray(0), ptOri.x)
|
||||
StringToLen(sValArray(1), ptOri.y)
|
||||
StringToLen(sValArray(2), ptOri.z)
|
||||
StringToDouble(sValArray(3), vtVersX.x)
|
||||
StringToDouble(sValArray(4), vtVersX.y)
|
||||
StringToDouble(sValArray(5), vtVersX.z)
|
||||
StringToDouble(sValArray(6), vtVersY.x)
|
||||
StringToDouble(sValArray(7), vtVersY.y)
|
||||
StringToDouble(sValArray(8), vtVersY.z)
|
||||
StringToLenAdv(sValArray(0), ptOri.x)
|
||||
StringToLenAdv(sValArray(1), ptOri.y)
|
||||
StringToLenAdv(sValArray(2), ptOri.z)
|
||||
StringToDoubleAdv(sValArray(3), vtVersX.x)
|
||||
StringToDoubleAdv(sValArray(4), vtVersX.y)
|
||||
StringToDoubleAdv(sValArray(5), vtVersX.z)
|
||||
StringToDoubleAdv(sValArray(6), vtVersY.x)
|
||||
StringToDoubleAdv(sValArray(7), vtVersY.y)
|
||||
StringToDoubleAdv(sValArray(8), vtVersY.z)
|
||||
NewBTLPart.m_refTransf.ChangeOrigin(ptOri)
|
||||
NewBTLPart.m_refTransf.Setup(ptOri, ptOri + vtVersX, ptOri + vtVersY)
|
||||
End If
|
||||
@@ -815,10 +815,10 @@ Public Class BTLPartM
|
||||
EgtGetInfo(nPartId, BTL_PRT_CAMBER, sValue)
|
||||
sValArray = sValue.Split(New String() {":", "P"}, StringSplitOptions.RemoveEmptyEntries)
|
||||
If sValArray.Count() >= 10 Then
|
||||
StringToLen(sValArray(3), NewBTLPart.m_dCamberLen1)
|
||||
StringToLen(sValArray(5), NewBTLPart.m_dCamberLen2)
|
||||
StringToLen(sValArray(7), NewBTLPart.m_dCamberLen3)
|
||||
StringToLen(sValArray(9), NewBTLPart.m_dCamberCross3)
|
||||
StringToLenAdv(sValArray(3), NewBTLPart.m_dCamberLen1)
|
||||
StringToLenAdv(sValArray(5), NewBTLPart.m_dCamberLen2)
|
||||
StringToLenAdv(sValArray(7), NewBTLPart.m_dCamberLen3)
|
||||
StringToLenAdv(sValArray(9), NewBTLPart.m_dCamberCross3)
|
||||
End If
|
||||
Dim pFrom As Integer = sValue.IndexOf("SIDE: ") + "SIDE: ".Length
|
||||
Dim pTo As Integer = sValue.LastIndexOf(" P01")
|
||||
@@ -830,10 +830,10 @@ Public Class BTLPartM
|
||||
EgtGetInfo(nPartId, BTL_PRT_PARTOFFSET, sValue)
|
||||
sValArray = sValue.Split(New String() {":", "P"}, StringSplitOptions.RemoveEmptyEntries)
|
||||
If sValArray.Count() >= 10 Then
|
||||
StringToLen(sValArray(3), NewBTLPart.m_dPartOffsetSide1)
|
||||
StringToLen(sValArray(5), NewBTLPart.m_dPartOffsetSide2)
|
||||
StringToLen(sValArray(7), NewBTLPart.m_dPartOffsetSide3)
|
||||
StringToLen(sValArray(9), NewBTLPart.m_dPartOffsetSide4)
|
||||
StringToLenAdv(sValArray(3), NewBTLPart.m_dPartOffsetSide1)
|
||||
StringToLenAdv(sValArray(5), NewBTLPart.m_dPartOffsetSide2)
|
||||
StringToLenAdv(sValArray(7), NewBTLPart.m_dPartOffsetSide3)
|
||||
StringToLenAdv(sValArray(9), NewBTLPart.m_dPartOffsetSide4)
|
||||
End If
|
||||
pFrom = sValue.IndexOf("P04: ") + "P04: ".Length
|
||||
pTo = sValue.LastIndexOf(" P11")
|
||||
@@ -883,9 +883,9 @@ Public Class BTLPartM
|
||||
NewBTLPart.m_refGrainDir = New Vector3d
|
||||
sValArray = sValue.Split(New String() {",", ";"}, StringSplitOptions.RemoveEmptyEntries)
|
||||
If sValArray.Count() >= 4 Then
|
||||
StringToDouble(sValArray(0), NewBTLPart.m_refGrainDir.x)
|
||||
StringToDouble(sValArray(1), NewBTLPart.m_refGrainDir.y)
|
||||
StringToDouble(sValArray(2), NewBTLPart.m_refGrainDir.z)
|
||||
StringToDoubleAdv(sValArray(0), NewBTLPart.m_refGrainDir.x)
|
||||
StringToDoubleAdv(sValArray(1), NewBTLPart.m_refGrainDir.y)
|
||||
StringToDoubleAdv(sValArray(2), NewBTLPart.m_refGrainDir.z)
|
||||
NewBTLPart.m_bGRAINDIRALIGN = (CInt(sValArray(3)) = 1)
|
||||
End If
|
||||
|
||||
@@ -1044,15 +1044,15 @@ Public Class BTLPartM
|
||||
' Dim vtVersY As New Vector3d
|
||||
' sValArray = sValue.Split({","}, StringSplitOptions.RemoveEmptyEntries)
|
||||
' If sValArray.Count() >= 9 Then
|
||||
' StringToLen(sValArray(0), ptOri.x)
|
||||
' StringToLen(sValArray(1), ptOri.y)
|
||||
' StringToLen(sValArray(2), ptOri.z)
|
||||
' StringToDouble(sValArray(3), vtVersX.x)
|
||||
' StringToDouble(sValArray(4), vtVersX.y)
|
||||
' StringToDouble(sValArray(5), vtVersX.z)
|
||||
' StringToDouble(sValArray(6), vtVersY.x)
|
||||
' StringToDouble(sValArray(7), vtVersY.y)
|
||||
' StringToDouble(sValArray(8), vtVersY.z)
|
||||
' StringToLenAdv(sValArray(0), ptOri.x)
|
||||
' StringToLenAdv(sValArray(1), ptOri.y)
|
||||
' StringToLenAdv(sValArray(2), ptOri.z)
|
||||
' StringToDoubleAdv(sValArray(3), vtVersX.x)
|
||||
' StringToDoubleAdv(sValArray(4), vtVersX.y)
|
||||
' StringToDoubleAdv(sValArray(5), vtVersX.z)
|
||||
' StringToDoubleAdv(sValArray(6), vtVersY.x)
|
||||
' StringToDoubleAdv(sValArray(7), vtVersY.y)
|
||||
' StringToDoubleAdv(sValArray(8), vtVersY.z)
|
||||
' m_refTransf.ChangeOrigin(ptOri)
|
||||
' m_refTransf.Setup(ptOri, ptOri + vtVersX, ptOri + vtVersY)
|
||||
' End If
|
||||
@@ -1063,10 +1063,10 @@ Public Class BTLPartM
|
||||
' EgtGetInfo(nPartId, BTL_PRT_CAMBER, sValue)
|
||||
' sValArray = sValue.Split(New String() {": ", " P"}, StringSplitOptions.RemoveEmptyEntries)
|
||||
' If sValArray.Count() >= 5 Then
|
||||
' StringToLen(sValArray(3), m_dCamberLen1)
|
||||
' StringToLen(sValArray(5), m_dCamberLen2)
|
||||
' StringToLen(sValArray(7), m_dCamberLen3)
|
||||
' StringToLen(sValArray(9), m_dCamberCross3)
|
||||
' StringToLenAdv(sValArray(3), m_dCamberLen1)
|
||||
' StringToLenAdv(sValArray(5), m_dCamberLen2)
|
||||
' StringToLenAdv(sValArray(7), m_dCamberLen3)
|
||||
' StringToLenAdv(sValArray(9), m_dCamberCross3)
|
||||
' End If
|
||||
' Dim pFrom As Integer = sValue.IndexOf("SIDE: ") + "SIDE: ".Length
|
||||
' Dim pTo As Integer = sValue.LastIndexOf(" P01")
|
||||
@@ -1078,10 +1078,10 @@ Public Class BTLPartM
|
||||
' EgtGetInfo(nPartId, BTL_PRT_PARTOFFSET, sValue)
|
||||
' sValArray = sValue.Split(New String() {": ", " P"}, StringSplitOptions.RemoveEmptyEntries)
|
||||
' If sValArray.Count() >= 5 Then
|
||||
' StringToLen(sValArray(3), m_dPartOffsetSide1)
|
||||
' StringToLen(sValArray(5), m_dPartOffsetSide2)
|
||||
' StringToLen(sValArray(7), m_dPartOffsetSide3)
|
||||
' StringToLen(sValArray(9), m_dPartOffsetSide4)
|
||||
' StringToLenAdv(sValArray(3), m_dPartOffsetSide1)
|
||||
' StringToLenAdv(sValArray(5), m_dPartOffsetSide2)
|
||||
' StringToLenAdv(sValArray(7), m_dPartOffsetSide3)
|
||||
' StringToLenAdv(sValArray(9), m_dPartOffsetSide4)
|
||||
' End If
|
||||
' pFrom = sValue.IndexOf("P04: ") + "P04: ".Length
|
||||
' pTo = sValue.LastIndexOf(" P11")
|
||||
@@ -1105,9 +1105,9 @@ Public Class BTLPartM
|
||||
' m_refGrainDir = New Vector3d
|
||||
' sValArray = sValue.Split(New String() {",", ";"}, StringSplitOptions.RemoveEmptyEntries)
|
||||
' If sValArray.Count() >= 4 Then
|
||||
' StringToDouble(sValArray(0), m_refGrainDir.x)
|
||||
' StringToDouble(sValArray(1), m_refGrainDir.y)
|
||||
' StringToDouble(sValArray(2), m_refGrainDir.z)
|
||||
' StringToDoubleAdv(sValArray(0), m_refGrainDir.x)
|
||||
' StringToDoubleAdv(sValArray(1), m_refGrainDir.y)
|
||||
' StringToDoubleAdv(sValArray(2), m_refGrainDir.z)
|
||||
' m_bGRAINDIRALIGN = (CInt(sValArray(3)) = 1)
|
||||
' End If
|
||||
|
||||
|
||||
@@ -206,6 +206,7 @@
|
||||
Public Const BTL_FTR_PRC As String = "PRC"
|
||||
Public Const BTL_FTR_DO As String = "DO"
|
||||
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_DES As String = "DES"
|
||||
Public Const BTL_FTR_PRID As String = "PRID"
|
||||
|
||||
@@ -16,5 +16,6 @@
|
||||
Public Const COL_TYPE As String = "colTYPE"
|
||||
Public Const COL_DESCRIPTION As String = "colDESCRIPTION"
|
||||
Public Const COL_SUPERVISORID As String = "colSUPERVISORID"
|
||||
Public Const COL_PRIORITY As String = "colPRIORITY"
|
||||
|
||||
End Module
|
||||
|
||||
@@ -21,6 +21,7 @@ Public Module ConstGen
|
||||
' File con dati di licenza
|
||||
Public Const LIC_FILE_NAME As String = "EgtBEAMWALL.lic"
|
||||
Public Const S_LICENCE As String = "Licence"
|
||||
Public Const K_LOCKID As String = "LockId"
|
||||
Public Const K_KEY As String = "Key"
|
||||
Public Const K_NESTKEY As String = "NestKey"
|
||||
|
||||
|
||||
@@ -20,6 +20,7 @@ Public Module ConstIni
|
||||
'Public Const K_LICENCE As String = "Licence"
|
||||
'Public Const K_USERLEVEL As String = "UserLevel"
|
||||
'Public Const K_MAXINST As String = "MaxInstances"
|
||||
Public Const K_NETKEY As String = "NetKey"
|
||||
Public Const K_MAXCAMINST As String = "MaxCamInstances"
|
||||
Public Const K_VIEWOPTIM_INSTANCES As String = "ViewOptimInstances"
|
||||
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_ENABLEEDIT As String = "EnableEdit"
|
||||
Public Const K_FASTPRODUCE As String = "FastProduce"
|
||||
Public Const K_ADDPROJ As String = "AddProj"
|
||||
|
||||
'Public Const S_LANGUAGES As String = "Languages"
|
||||
'Public Const K_LANGUAGE As String = "Language"
|
||||
@@ -94,6 +96,7 @@ Public Module ConstIni
|
||||
Public Const S_IMPORT As String = "Import"
|
||||
Public Const K_BTLFLAG As String = "BtlFlag"
|
||||
Public Const K_WALLBTLFLAG As String = "WallBtlFlag"
|
||||
Public Const K_WALLOPPOSITESIDENESTING As String = "WallOppositeSideNesting"
|
||||
|
||||
'Public Const S_MACH As String = "Mach"
|
||||
'Public Const K_MACHINESDIR As String = "MachinesDir"
|
||||
@@ -117,6 +120,15 @@ Public Module ConstIni
|
||||
Public Const K_WALLBASEDIR As String = "BaseDir"
|
||||
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 K_NESTEXEC As String = "NestExec"
|
||||
Public Const K_FLIPROT As String = "FlipRot"
|
||||
|
||||
@@ -28,7 +28,7 @@ Public Module DataGridColumnsIniFile
|
||||
Dim bIsReadOnly As Boolean = sColumnParams(4).Equals("1")
|
||||
Dim Width As Double
|
||||
Dim WidthType As DataGridLengthUnitType
|
||||
StringToDouble(sColumnParams(5), Width)
|
||||
StringToDoubleAdv(sColumnParams(5), Width)
|
||||
Integer.TryParse(sColumnParams(6), WidthType)
|
||||
Dim bVisible As Boolean = sColumnParams(7).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 Width As Double
|
||||
Dim WidthType As DataGridLengthUnitType
|
||||
StringToDouble(sColumnParams(5), Width)
|
||||
StringToDoubleAdv(sColumnParams(5), Width)
|
||||
Integer.TryParse(sColumnParams(6), WidthType)
|
||||
Dim bVisible As Boolean = sColumnParams(7).Equals("1")
|
||||
Dim bCanUserEditVisible As Boolean = sColumnParams(8).Equals("1")
|
||||
|
||||
@@ -424,6 +424,7 @@ Public Class EgtDataGridColumn
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private Property m_OrigIsReadOnly As Boolean = True
|
||||
Private Property m_IsReadOnly As Boolean = True
|
||||
Public Property IsReadOnly As Boolean
|
||||
Get
|
||||
@@ -437,6 +438,9 @@ Public Class EgtDataGridColumn
|
||||
End If
|
||||
End Set
|
||||
End Property
|
||||
Public Sub ResetToOrigIsReadOnly()
|
||||
IsReadOnly = m_OrigIsReadOnly
|
||||
End Sub
|
||||
|
||||
Friend OldCanUserReorder As Boolean?
|
||||
Private m_CanUserReorder As Boolean
|
||||
@@ -561,6 +565,7 @@ Public Class EgtDataGridColumn
|
||||
m_CanUserReorder = bCanUserReorder
|
||||
m_CanUserResize = bCanUserResize
|
||||
m_CanUserSort = bCanUserSort
|
||||
m_OrigIsReadOnly = bIsReadOnly
|
||||
m_IsReadOnly = bIsReadOnly
|
||||
m_Width = Width
|
||||
m_Visible = bVisible
|
||||
@@ -588,7 +593,7 @@ Public Class EgtDataGridColumn
|
||||
Public Function SaveDataGridColumn() As Boolean
|
||||
Dim bOk As Boolean
|
||||
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)
|
||||
Return bOk
|
||||
End Function
|
||||
|
||||
@@ -420,7 +420,7 @@ Public Class MyMachGroupM
|
||||
EgtGetInfo(Id, MGR_RPT_PART & 1, sInfo)
|
||||
If Not String.IsNullOrWhiteSpace(sInfo) Then
|
||||
sSplitInfo = sInfo.Split(","c)
|
||||
StringToDouble(sSplitInfo(1), m_dStartCut)
|
||||
StringToDoubleAdv(sSplitInfo(1), m_dStartCut)
|
||||
Else
|
||||
m_dStartCut = 0
|
||||
End If
|
||||
|
||||
@@ -508,7 +508,7 @@ Public Class PartM
|
||||
Index += 1
|
||||
End While
|
||||
If bFound Then
|
||||
StringToDouble(sSplitInfo(1), NewPartM.m_dPOSX)
|
||||
StringToDoubleAdv(sSplitInfo(1), NewPartM.m_dPOSX)
|
||||
End If
|
||||
Else
|
||||
' leggo PosX, PosY, Rot e Flip
|
||||
|
||||
@@ -169,7 +169,7 @@ Public MustInherit Class MyMachGroupVM
|
||||
Return LenToString(MyMachGroupM.dStartCut, 3)
|
||||
End Get
|
||||
Set(value As String)
|
||||
StringToLen(value, MyMachGroupM.dStartCut)
|
||||
StringToLenAdv(value, MyMachGroupM.dStartCut, True)
|
||||
End Set
|
||||
End Property
|
||||
Public Property dStartCut As Double
|
||||
|
||||
@@ -107,7 +107,7 @@ Public MustInherit Class PartVM
|
||||
Return LenToString(m_PartM.dPOSX, 3)
|
||||
End Get
|
||||
Set(value As String)
|
||||
StringToLen(value, m_PartM.dPOSX)
|
||||
StringToLenAdv(value, m_PartM.dPOSX, True)
|
||||
End Set
|
||||
End Property
|
||||
Public Property dPOSX As Double
|
||||
@@ -217,7 +217,7 @@ Public MustInherit Class PartVM
|
||||
Return LenToString(m_PartM.dOffset, 3)
|
||||
End Get
|
||||
Set(value As String)
|
||||
StringToLen(value, m_PartM.dOffset)
|
||||
StringToLenAdv(value, m_PartM.dOffset, True)
|
||||
End Set
|
||||
End Property
|
||||
Public ReadOnly Property dOffset As Double
|
||||
@@ -235,7 +235,7 @@ Public MustInherit Class PartVM
|
||||
Return LenToString(m_PartM.dPOSY, 3)
|
||||
End Get
|
||||
Set(value As String)
|
||||
StringToLen(value, m_PartM.dPOSY)
|
||||
StringToLenAdv(value, m_PartM.dPOSY, True)
|
||||
End Set
|
||||
End Property
|
||||
|
||||
@@ -250,7 +250,7 @@ Public MustInherit Class PartVM
|
||||
Return LenToString(m_PartM.dROT, 3) & "°"
|
||||
End Get
|
||||
Set(value As String)
|
||||
StringToLen(value, m_PartM.dROT)
|
||||
StringToLenAdv(value, m_PartM.dROT, True)
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
@@ -35,5 +35,5 @@ Imports System.Runtime.InteropServices
|
||||
' by using the '*' as shown below:
|
||||
' <Assembly: AssemblyVersion("1.0.*")>
|
||||
|
||||
<Assembly: AssemblyVersion("2.5.3.2")>
|
||||
<Assembly: AssemblyFileVersion("2.5.3.2")>
|
||||
<Assembly: AssemblyVersion("2.5.6.2")>
|
||||
<Assembly: AssemblyFileVersion("2.5.6.2")>
|
||||
|
||||
@@ -5,9 +5,9 @@
|
||||
xmlns:EgtBEAMWALL="clr-namespace:EgtBEAMWALL.Core"
|
||||
Title="{Binding Title}"
|
||||
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"
|
||||
Height="500" Width="500" Topmost="True"
|
||||
MinHeight="500" MinWidth="500" Topmost="True"
|
||||
DataContext="{Binding RelativeSource={RelativeSource Self}}">
|
||||
|
||||
<EgtWPFLib5:EgtCustomWindow.Resources>
|
||||
@@ -21,42 +21,105 @@
|
||||
<RowDefinition Height="1*"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<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>
|
||||
<GroupBox Header="Filters"
|
||||
Margin="5">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
</Grid.RowDefinitions>
|
||||
<Grid>
|
||||
<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"
|
||||
Style="{StaticResource OptionTextBlock}"/>
|
||||
<ComboBox ItemsSource="{Binding SearchColumnList}"
|
||||
<ComboBox ItemsSource="{Binding SearchColumnList}"
|
||||
SelectedItem="{Binding SelSearchColumn}"
|
||||
Width="Auto"
|
||||
Margin="5"
|
||||
Grid.Row="0" Grid.Column="1"
|
||||
Style="{StaticResource FeatureComboBox}"/>
|
||||
<TextBlock Text="{Binding Search_Msg}"
|
||||
<TextBlock Text="{Binding Search_Msg}"
|
||||
Margin="0,5,0,0"
|
||||
Grid.Row="1" Grid.Column="0"
|
||||
Style="{StaticResource OptionTextBlock}"/>
|
||||
<EgtWPFLib5:EgtTextBox Text="{Binding SearchText}"
|
||||
<EgtWPFLib5:EgtTextBox Text="{Binding SearchText}"
|
||||
Margin="5"
|
||||
Grid.Row="1" Grid.Column="1"
|
||||
Visibility="{Binding SearchText_Visibility}"/>
|
||||
<Calendar SelectedDatesChanged="Calendar_SelectedDatesChanged"
|
||||
<Calendar SelectedDatesChanged="Calendar_SelectedDatesChanged"
|
||||
SelectionMode="MultipleRange"
|
||||
Grid.Row="1" Grid.Column="1"
|
||||
Visibility="{Binding SearchDate_Visibility}"/>
|
||||
</Grid>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</StackPanel>-->
|
||||
|
||||
<EgtBEAMWALL:EgtDataGrid Grid.Row="1"
|
||||
<EgtBEAMWALL:EgtDataGrid Grid.Row="1"
|
||||
ItemsSource="{Binding ProjectList}"
|
||||
SelectedItem="{Binding SelProject}"
|
||||
CanUserAddRows="False"
|
||||
@@ -85,6 +148,14 @@
|
||||
</DataTemplate>
|
||||
</DataGridTextColumn.HeaderTemplate>
|
||||
</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 -->
|
||||
<DataGridTextColumn x:Key="colBTLNAME" Binding="{Binding sBTLFileName}">
|
||||
<DataGridTextColumn.HeaderTemplate>
|
||||
|
||||
@@ -5,6 +5,8 @@ Imports System.Windows.Controls
|
||||
Imports System.Windows.Input
|
||||
Imports EgtBEAMWALL.Core.ConstBeam
|
||||
Imports EgtUILib
|
||||
Imports EgtWPFLib5
|
||||
Imports EgtBEAMWALL
|
||||
|
||||
Public Class OpenProjectFileDialogV
|
||||
|
||||
@@ -19,6 +21,8 @@ Public Class OpenProjectFileDialogV
|
||||
Me.DataContext = OpenProjFileDialogVM
|
||||
' Assegno al riferimento locale al VM il VM preso dal DataContext
|
||||
m_OpenProjFileDialogVM = OpenProjFileDialogVM
|
||||
AddHandler Me.Loaded, AddressOf OpenProjectFileDialog_Loaded
|
||||
AddHandler Me.Closing, AddressOf OpenProjectFileDialog_Closing
|
||||
End Sub
|
||||
|
||||
#End Region ' CONSTRUCTOR
|
||||
@@ -42,6 +46,20 @@ Public Class OpenProjectFileDialogV
|
||||
Return Me.ShowDialog()
|
||||
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
|
||||
|
||||
#Region "EVENTS"
|
||||
@@ -60,10 +78,4 @@ Public Class OpenProjectFileDialogV
|
||||
Me.DialogResult = bDialogResult
|
||||
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
|
||||
@@ -14,6 +14,32 @@ Public MustInherit Class OpenProjectFileDialogVM
|
||||
|
||||
#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)
|
||||
|
||||
Protected m_ProjectColumns As New ObservableCollection(Of EgtDataGridColumn)
|
||||
@@ -83,18 +109,131 @@ Public MustInherit Class OpenProjectFileDialogVM
|
||||
End Set
|
||||
End Property
|
||||
|
||||
' lista campi per ricerca testuale e con datepicker
|
||||
Protected m_SearchColumnList As New ObservableCollection(Of IdNameStruct)
|
||||
Public ReadOnly Property SearchColumnList As ObservableCollection(Of IdNameStruct)
|
||||
Protected m_BTLDateTypeList As New List(Of String)
|
||||
Public ReadOnly Property BTLDateTypeList As List(Of String)
|
||||
Get
|
||||
Return m_SearchColumnList
|
||||
Return m_BTLDateTypeList
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Protected m_SelSearchColumn As IdNameStruct = Nothing
|
||||
Public Property SelSearchColumn As IdNameStruct
|
||||
Protected m_SelBTLDateType As BTLDateTypes = Nothing
|
||||
Public Property SelBTLDateType As Integer
|
||||
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
|
||||
Set(value As IdNameStruct)
|
||||
' resetto il contenuto della barra di ricerca testuale
|
||||
@@ -103,15 +242,15 @@ Public MustInherit Class OpenProjectFileDialogVM
|
||||
' resetto le selezioni sul calendario
|
||||
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)
|
||||
m_SelSearchColumn = m_SearchColumnList(0)
|
||||
m_SelFilterType = m_FilterTypeList(0)
|
||||
m_ProjectList_View.Refresh()
|
||||
' ora setto il valore scelto come Tipo Filtro
|
||||
m_SelSearchColumn = value
|
||||
Select Case m_SelSearchColumn.Id
|
||||
Case OpenProjFileColumn.ID, OpenProjFileColumn.BTLFILENAME, OpenProjFileColumn.LISTNAME, OpenProjFileColumn.MACHINE
|
||||
m_SelFilterType = value
|
||||
Select Case m_SelFilterType.Id
|
||||
Case FilterTypes.ID, FilterTypes.BTLFILENAME, FilterTypes.LISTNAME, FilterTypes.MACHINE
|
||||
SearchText_Visibility = Visibility.Visible
|
||||
SearchDate_Visibility = Visibility.Collapsed
|
||||
Case OpenProjFileColumn.EXPORTDATE, OpenProjFileColumn.CREATEDATE
|
||||
Case BTLDateTypes.EXPORTDATE, BTLDateTypes.CREATEDATE
|
||||
SearchText_Visibility = Visibility.Collapsed
|
||||
SearchDate_Visibility = Visibility.Visible
|
||||
Case Else
|
||||
@@ -161,18 +300,13 @@ Public MustInherit Class OpenProjectFileDialogVM
|
||||
End Set
|
||||
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"
|
||||
|
||||
Public ReadOnly Property Title As String
|
||||
Get
|
||||
Return "Open Project"
|
||||
End Get
|
||||
End Property
|
||||
Public ReadOnly Property FilterType_Msg As String
|
||||
Get
|
||||
Return EgtMsg(61836)
|
||||
@@ -236,6 +370,18 @@ Public MustInherit Class OpenProjectFileDialogVM
|
||||
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
|
||||
|
||||
' Definizione comandi
|
||||
@@ -244,31 +390,45 @@ Public MustInherit Class OpenProjectFileDialogVM
|
||||
|
||||
#End Region ' FIELDS & PROPERTIES
|
||||
|
||||
Sub New()
|
||||
End Sub
|
||||
|
||||
#Region "METHODS"
|
||||
|
||||
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)
|
||||
If ProjectType = ProjectType.PROJ Then
|
||||
' carico le colonne della datagrid
|
||||
GetPrivateProfileColumns(S_OPENPROJFILEDLG_PROJ, ProjectColumns)
|
||||
' carico campi su cui eseguire il filtro di ricerca
|
||||
m_SearchColumnList = New ObservableCollection(Of IdNameStruct)({New IdNameStruct(OpenProjFileColumn.NULL, ""),
|
||||
New IdNameStruct(OpenProjFileColumn.ID, Id_Msg),
|
||||
New IdNameStruct(OpenProjFileColumn.BTLFILENAME, BTLFileName_Msg),
|
||||
New IdNameStruct(OpenProjFileColumn.LISTNAME, ListName_Msg),
|
||||
New IdNameStruct(OpenProjFileColumn.EXPORTDATE, ExportDate_Msg),
|
||||
New IdNameStruct(OpenProjFileColumn.CREATEDATE, CreateDate_Msg),
|
||||
New IdNameStruct(OpenProjFileColumn.MACHINE, Machine_Msg)})
|
||||
m_BTLDateTypeList = New List(Of String)({CreateDate_Msg, ExportDate_Msg})
|
||||
m_SelBTLDateType = BTLDateTypes.CREATEDATE
|
||||
NotifyPropertyChanged(NameOf(BTLDateTypeList))
|
||||
NotifyPropertyChanged(NameOf(SelBTLDateType))
|
||||
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.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
|
||||
' carico le colonne della datagrid
|
||||
GetPrivateProfileColumns(S_OPENPROJFILEDLG_PROD, ProjectColumns)
|
||||
' carico campi su cui eseguire il filtro di ricerca
|
||||
m_SearchColumnList = New ObservableCollection(Of IdNameStruct)({New IdNameStruct(OpenProjFileColumn.NULL, ""),
|
||||
New IdNameStruct(OpenProjFileColumn.ID, Id_Msg),
|
||||
New IdNameStruct(OpenProjFileColumn.BTLFILENAME, BTLFileName_Msg),
|
||||
New IdNameStruct(OpenProjFileColumn.CREATEDATE, CreateDate_Msg),
|
||||
New IdNameStruct(OpenProjFileColumn.MACHINE, Machine_Msg)})
|
||||
m_BTLDateTypeList = New List(Of String)({CreateDate_Msg})
|
||||
m_SelBTLDateType = BTLDateTypes.CREATEDATE
|
||||
NotifyPropertyChanged(NameOf(BTLDateTypeList))
|
||||
NotifyPropertyChanged(NameOf(SelBTLDateType))
|
||||
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
|
||||
' setto la visibilità delle colonne delle EgtDataGrid
|
||||
For Each col In ProjectColumns
|
||||
@@ -301,22 +461,22 @@ Public MustInherit Class OpenProjectFileDialogVM
|
||||
Dim bProjectOk As Boolean = True
|
||||
If m_ProjectType = ProjectType.PROJ Then
|
||||
Dim CurrProj As ProjFileVM = DirectCast(Proj, ProjFileVM)
|
||||
If m_SelSearchColumn.Id <> OpenProjFileColumn.NULL AndAlso (
|
||||
(m_SelSearchColumn.Id = OpenProjFileColumn.EXPORTDATE AndAlso Not SearchDate.Contains(CurrProj.dtExportDate.Date)) OrElse
|
||||
(m_SelSearchColumn.Id = OpenProjFileColumn.CREATEDATE AndAlso Not SearchDate.Contains(CurrProj.dtCreateDate.Date))) Then bProjectOk = False
|
||||
If m_SelSearchColumn.Id <> OpenProjFileColumn.NULL AndAlso m_SearchText <> String.Empty AndAlso (
|
||||
(m_SelSearchColumn.Id = OpenProjFileColumn.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_SelSearchColumn.Id = OpenProjFileColumn.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
|
||||
If m_SelFilterType.Id <> FilterTypes.NULL AndAlso (
|
||||
(m_SelFilterType.Id = BTLDateTypes.EXPORTDATE AndAlso Not SearchDate.Contains(CurrProj.dtExportDate.Date)) OrElse
|
||||
(m_SelFilterType.Id = BTLDateTypes.CREATEDATE AndAlso Not SearchDate.Contains(CurrProj.dtCreateDate.Date))) Then bProjectOk = False
|
||||
If m_SelFilterType.Id <> FilterTypes.NULL AndAlso m_SearchText <> String.Empty AndAlso (
|
||||
(m_SelFilterType.Id = FilterTypes.ID AndAlso CurrProj.sProjId.ToString.IndexOf(SearchText, StringComparison.InvariantCultureIgnoreCase) < 0) OrElse
|
||||
(m_SelFilterType.Id = FilterTypes.BTLFILENAME AndAlso CurrProj.sBTLFileName.IndexOf(SearchText, StringComparison.InvariantCultureIgnoreCase) < 0) OrElse
|
||||
(m_SelFilterType.Id = FilterTypes.LISTNAME AndAlso CurrProj.sListName.IndexOf(SearchText, StringComparison.InvariantCultureIgnoreCase) < 0) OrElse
|
||||
(m_SelFilterType.Id = FilterTypes.MACHINE AndAlso CurrProj.sMachine.IndexOf(SearchText, StringComparison.InvariantCultureIgnoreCase) < 0)) Then bProjectOk = False
|
||||
ElseIf m_ProjectType = ProjectType.PROD Then
|
||||
Dim CurrProj As ProdFileVM = DirectCast(Proj, ProdFileVM)
|
||||
If m_SelSearchColumn.Id <> OpenProjFileColumn.NULL AndAlso (
|
||||
(m_SelSearchColumn.Id = OpenProjFileColumn.CREATEDATE AndAlso Not SearchDate.Contains(CurrProj.dtCreateDate.Date))) Then bProjectOk = False
|
||||
If m_SelSearchColumn.Id <> OpenProjFileColumn.NULL AndAlso m_SearchText <> String.Empty AndAlso (
|
||||
(m_SelSearchColumn.Id = OpenProjFileColumn.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_SelSearchColumn.Id = OpenProjFileColumn.MACHINE AndAlso CurrProj.sMachine.IndexOf(SearchText, StringComparison.InvariantCultureIgnoreCase) < 0)) Then bProjectOk = False
|
||||
If m_SelFilterType.Id <> FilterTypes.NULL AndAlso (
|
||||
(m_SelFilterType.Id = BTLDateTypes.CREATEDATE AndAlso Not SearchDate.Contains(CurrProj.dtCreateDate.Date))) Then bProjectOk = False
|
||||
If m_SelFilterType.Id <> FilterTypes.NULL AndAlso m_SearchText <> String.Empty AndAlso (
|
||||
(m_SelFilterType.Id = FilterTypes.ID AndAlso CurrProj.sProdId.ToString.IndexOf(SearchText, StringComparison.InvariantCultureIgnoreCase) < 0) OrElse
|
||||
(m_SelFilterType.Id = FilterTypes.BTLFILENAME AndAlso CurrProj.sBTLFileName.IndexOf(SearchText, StringComparison.InvariantCultureIgnoreCase) < 0) OrElse
|
||||
(m_SelFilterType.Id = FilterTypes.MACHINE AndAlso CurrProj.sMachine.IndexOf(SearchText, StringComparison.InvariantCultureIgnoreCase) < 0)) Then bProjectOk = False
|
||||
End If
|
||||
Return bProjectOk
|
||||
End Function
|
||||
|
||||
@@ -10,6 +10,9 @@ Public Class ProdFileM
|
||||
Return m_nProjIdList
|
||||
End Get
|
||||
End Property
|
||||
Public Sub SetProjIdList(value As List(Of Integer))
|
||||
m_nProjIdList = value
|
||||
End Sub
|
||||
|
||||
Protected m_sName As String
|
||||
Public ReadOnly Property sName As String
|
||||
|
||||
@@ -19,39 +19,49 @@ Public Class ProjFileM
|
||||
End Property
|
||||
|
||||
Protected m_sBTLFileName As String = String.Empty
|
||||
Public Property sBTLFileName As String
|
||||
Get
|
||||
Return m_sBTLFileName
|
||||
End Get
|
||||
Set(value As String)
|
||||
m_sBTLFileName = value
|
||||
End Set
|
||||
End Property
|
||||
Public Property sBTLFileName As String
|
||||
Get
|
||||
Return m_sBTLFileName
|
||||
End Get
|
||||
Set(value As String)
|
||||
m_sBTLFileName = value
|
||||
End Set
|
||||
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"
|
||||
|
||||
Protected Sub New()
|
||||
Protected Sub New()
|
||||
End Sub
|
||||
|
||||
Public Shared Function CreateNewProjFileM() As ProjFileM
|
||||
Return New ProjFileM
|
||||
End Function
|
||||
|
||||
Public Shared Function CreateProjFileM(nProjId As Integer, nProdId As Integer, dtCreateProjDate As DateTime, dtExportDate As DateTime, sListName As String,
|
||||
sBTLFileName As String, IsNew As Boolean, IsLocked As Boolean, nType As BWType, sMachine As String) As ProjFileM
|
||||
Dim NewProjectFileM As New ProjFileM
|
||||
NewProjectFileM.m_nProjId = nProjId
|
||||
NewProjectFileM.m_nProdId = nProdId
|
||||
NewProjectFileM.m_dtCreateDate = dtCreateProjDate
|
||||
NewProjectFileM.m_dtExportDate = dtExportDate
|
||||
NewProjectFileM.m_sListName = sListName
|
||||
NewProjectFileM.m_sBTLFileName = sBTLFileName
|
||||
NewProjectFileM.m_bIsNew = IsNew
|
||||
NewProjectFileM.m_bIsLocked = IsLocked
|
||||
NewProjectFileM.m_nType = nType
|
||||
NewProjectFileM.m_sMachine = sMachine
|
||||
Return NewProjectFileM
|
||||
End Function
|
||||
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
|
||||
Dim NewProjectFileM As New ProjFileM
|
||||
NewProjectFileM.m_nProjId = nProjId
|
||||
NewProjectFileM.m_nProdId = nProdId
|
||||
NewProjectFileM.m_dtCreateDate = dtCreateProjDate
|
||||
NewProjectFileM.m_dtExportDate = dtExportDate
|
||||
NewProjectFileM.m_sListName = sListName
|
||||
NewProjectFileM.m_sBTLFileName = sBTLFileName
|
||||
NewProjectFileM.m_sDescription = sDescription
|
||||
NewProjectFileM.m_bIsNew = IsNew
|
||||
NewProjectFileM.m_bIsLocked = IsLocked
|
||||
NewProjectFileM.m_nType = nType
|
||||
NewProjectFileM.m_sMachine = sMachine
|
||||
Return NewProjectFileM
|
||||
End Function
|
||||
|
||||
#End Region ' CONSTRUCTORS
|
||||
|
||||
|
||||
@@ -68,6 +68,12 @@ Public Class ProjFileVM
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property sDescription As String
|
||||
Get
|
||||
Return ProjFileM.sDescription
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property sListName As String
|
||||
Get
|
||||
Return ProjFileM.sListName
|
||||
|
||||
@@ -147,9 +147,9 @@ Public Module BTLIniFile
|
||||
Dim dMin As Double
|
||||
Dim dMax As Double
|
||||
Dim dDefault As Double
|
||||
StringToDouble(sBTLParamParams(2), dMin)
|
||||
StringToDouble(sBTLParamParams(3), dMax)
|
||||
StringToDouble(sBTLParamParams(4), dDefault)
|
||||
StringToDoubleAdv(sBTLParamParams(2), dMin)
|
||||
StringToDoubleAdv(sBTLParamParams(3), dMax)
|
||||
StringToDoubleAdv(sBTLParamParams(4), dDefault)
|
||||
Dim ParamType As BTLParamType
|
||||
If sBTLParamParams(0) = "d" Then
|
||||
ParamType = BTLParamType.DOUBLE_
|
||||
@@ -200,9 +200,9 @@ Public Module BTLIniFile
|
||||
Dim dMin As Double
|
||||
Dim dMax As Double
|
||||
Dim dDefault As Double
|
||||
StringToDouble(sBTLParamParams(2), dMin)
|
||||
StringToDouble(sBTLParamParams(3), dMax)
|
||||
StringToDouble(sBTLParamParams(4), dDefault)
|
||||
StringToDoubleAdv(sBTLParamParams(2), dMin)
|
||||
StringToDoubleAdv(sBTLParamParams(3), dMax)
|
||||
StringToDoubleAdv(sBTLParamParams(4), dDefault)
|
||||
Dim ParamType As BTLParamType
|
||||
If sBTLParamParams(0) = "d" Then
|
||||
ParamType = BTLParamType.DOUBLE_
|
||||
|
||||
@@ -27,7 +27,7 @@ Public Module DimensionsIniFile
|
||||
Dim GridLenType As GridUnitType
|
||||
Integer.TryParse(sValueParams(0), nDimIndex)
|
||||
Integer.TryParse(sValueParams(1), nDimType)
|
||||
StringToDouble(sValueParams(2), GridLenValue)
|
||||
StringToDoubleAdv(sValueParams(2), GridLenValue)
|
||||
Integer.TryParse(sValueParams(3), GridLenType)
|
||||
GridDimsList.Add(New GridDimension(GridName, nDimIndex, nDimType, New GridLength(GridLenValue, GridLenType)))
|
||||
End If
|
||||
|
||||
@@ -1,45 +1,49 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<configuration>
|
||||
<configSections>
|
||||
<!-- 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" />
|
||||
</configSections>
|
||||
<entityFramework>
|
||||
<defaultConnectionFactory type="MySql.Data.Entity.MySqlConnectionFactory, MySql.Data.Entity.EF6" />
|
||||
<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></providers>
|
||||
</entityFramework>
|
||||
<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" />
|
||||
</connectionStrings>
|
||||
<runtime>
|
||||
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="MySql.Data" publicKeyToken="c5687fc88969c44d" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-8.0.21.0" newVersion="8.0.21.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<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" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="Google.Protobuf" publicKeyToken="a7d26565bac4d604" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-3.19.4.0" newVersion="3.19.4.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<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" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="BouncyCastle.Crypto" publicKeyToken="0e99375e54769942" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-1.8.5.0" newVersion="1.8.5.0" />
|
||||
</dependentAssembly>
|
||||
</assemblyBinding>
|
||||
</runtime>
|
||||
<startup>
|
||||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" />
|
||||
</startup>
|
||||
<configSections>
|
||||
<!-- 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" />
|
||||
</configSections>
|
||||
<entityFramework>
|
||||
<!--<defaultConnectionFactory type="MySql.Data.Entity.MySqlConnectionFactory, MySql.Data.EntityFramework" />-->
|
||||
<defaultConnectionFactory type="System.Data.Entity.Infrastructure.SqlConnectionFactory, EntityFramework"/>
|
||||
<providers>
|
||||
<provider invariantName="MySql.Data.MySqlClient" type="MySql.Data.MySqlClient.MySqlProviderServices, MySql.Data.EntityFramework, Version=8.0.21.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d">
|
||||
</provider>
|
||||
</providers>
|
||||
</entityFramework>
|
||||
<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" />
|
||||
</connectionStrings>
|
||||
<runtime>
|
||||
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="MySql.Data" publicKeyToken="c5687fc88969c44d" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-8.0.21.0" newVersion="8.0.21.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="Google.Protobuf" publicKeyToken="a7d26565bac4d604" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-3.21.9.0" newVersion="3.21.9.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="K4os.Compression.LZ4.Streams" publicKeyToken="2186fa9121ef231d" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-1.3.5.0" newVersion="1.3.5.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="BouncyCastle.Crypto" publicKeyToken="0e99375e54769942" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-1.9.0.0" newVersion="1.9.0.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Memory" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.0.1.2" newVersion="4.0.1.2" />
|
||||
</dependentAssembly>
|
||||
</assemblyBinding>
|
||||
</runtime>
|
||||
<startup>
|
||||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" />
|
||||
</startup>
|
||||
</configuration>
|
||||
@@ -24,7 +24,7 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
||||
/// <param name="corePart"></param>
|
||||
/// <param name="currProjDbId"></param>
|
||||
/// <returns></returns>
|
||||
public static BTLPartModel ConvertFromCore(Core.BTLPartM corePart, int currProjDbId)
|
||||
public BTLPartModel ConvertFromCore(Core.BTLPartM corePart, int currProjDbId)
|
||||
{
|
||||
BTLPartModel answ = new BTLPartModel();
|
||||
if (corePart != null)
|
||||
|
||||
@@ -23,7 +23,7 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
||||
/// </summary>
|
||||
/// <param name="coreMacLog"></param>
|
||||
/// <returns></returns>
|
||||
public static LogMachineModel ConvertFromCore(Core.MachLog coreMacLog)
|
||||
public LogMachineModel ConvertFromCore(Core.MachLog coreMacLog)
|
||||
{
|
||||
LogMachineModel answ = new LogMachineModel();
|
||||
if (coreMacLog != null)
|
||||
@@ -53,7 +53,7 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
||||
/// </summary>
|
||||
/// <param name="dbLog"></param>
|
||||
/// <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);
|
||||
return newRecord;
|
||||
|
||||
@@ -8,12 +8,6 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
||||
{
|
||||
public class MachGroupController : IDisposable
|
||||
{
|
||||
#region Public Fields
|
||||
|
||||
public static MachGroupController man = new MachGroupController();
|
||||
|
||||
#endregion Public Fields
|
||||
|
||||
#region Public Constructors
|
||||
|
||||
public MachGroupController()
|
||||
@@ -30,7 +24,7 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
||||
/// <param name="coreMachGroup"></param>
|
||||
/// <param name="currProdDbId"></param>
|
||||
/// <returns></returns>
|
||||
public static MachGroupModel ConvertFromCore(Core.MyMachGroupM coreMachGroup, int currProdDbId)
|
||||
public MachGroupModel ConvertFromCore(Core.MyMachGroupM coreMachGroup, int currProdDbId)
|
||||
{
|
||||
MachGroupModel answ = new MachGroupModel();
|
||||
if (coreMachGroup != null)
|
||||
@@ -63,6 +57,8 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
||||
{
|
||||
ProdModel currData = new ProdModel();
|
||||
List<PartModel> PartList2Add = new List<PartModel>();
|
||||
var myPartCtrl = new PartController();
|
||||
var myStatusMapCtrl = new StatusMapController();
|
||||
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
||||
{
|
||||
// Recupero il PROD nel contesto
|
||||
@@ -72,7 +68,8 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
||||
.SingleOrDefault();
|
||||
try
|
||||
{
|
||||
var convCurrMG = MachGroupController.ConvertFromCore(newMachGroup, currData.ProdDbId);
|
||||
var locMGCtrl = new MachGroupController();
|
||||
var convCurrMG = locMGCtrl.ConvertFromCore(newMachGroup, currData.ProdDbId);
|
||||
|
||||
convCurrMG.ProdIndex = 1;
|
||||
|
||||
@@ -81,15 +78,25 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
||||
// Commit changes
|
||||
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...
|
||||
foreach (var currPartM in newMachGroup.PartMList)
|
||||
{
|
||||
var currPart = localDbCtx
|
||||
.PartList
|
||||
.Where(x => x.MachGroup.Prod.ProdId == ProdId && x.MachGroup.MachGroupId == newMachGroup.Id && x.PartId == currPartM.nPartId)
|
||||
//var currPart = localDbCtx
|
||||
// .PartList
|
||||
// .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();
|
||||
var convCurrPartM = PartController.ConvertFromCore(currPartM, MachGroupDbId);
|
||||
|
||||
var convCurrPartM = myPartCtrl.ConvertFromCore(currPartM, MachGroupDbId);
|
||||
if (currPart != null)
|
||||
{
|
||||
// se non identico x equality limitata a ViewOptim...
|
||||
@@ -125,7 +132,7 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
||||
// Commit changes
|
||||
localDbCtx.SaveChanges();
|
||||
// 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)
|
||||
{
|
||||
@@ -177,6 +184,7 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
||||
bool done = false;
|
||||
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
||||
{
|
||||
var myStatusMapCtrl = new StatusMapController();
|
||||
// inizio eliminando le part
|
||||
var parts2del = localDbCtx
|
||||
.PartList
|
||||
@@ -197,7 +205,7 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
||||
localDbCtx.SaveChanges();
|
||||
|
||||
// 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;
|
||||
}
|
||||
@@ -209,7 +217,7 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
||||
}
|
||||
|
||||
// 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;
|
||||
}
|
||||
@@ -393,6 +401,7 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
||||
bool done = false;
|
||||
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
||||
{
|
||||
var myStatusMapCtrl = new StatusMapController();
|
||||
try
|
||||
{
|
||||
// aggiorno
|
||||
@@ -405,13 +414,19 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
||||
currRecord.State = Core.ItemState.ND;
|
||||
currRecord.SupervisorId = "";
|
||||
currRecord.ProdIndex = 0;
|
||||
}
|
||||
// Commit changes
|
||||
localDbCtx.SaveChanges();
|
||||
// aggiorno info sullo status
|
||||
StatusMapController.man.UpdateAction("", ProdId, MachGroupId, Core.StatusMapItemType.MachGroup, Core.StatusMapOpType.MachGroupRemovedFromSupervisor, "");
|
||||
// Commit changes
|
||||
localDbCtx.SaveChanges();
|
||||
// aggiorno info sullo status
|
||||
myStatusMapCtrl.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)
|
||||
{
|
||||
@@ -435,23 +450,33 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
||||
bool done = false;
|
||||
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
||||
{
|
||||
var myStatusMapCtrl = new StatusMapController();
|
||||
try
|
||||
{
|
||||
// aggiorno
|
||||
localDbCtx
|
||||
var item2upd = localDbCtx
|
||||
.MachGroupList
|
||||
.Where(x => x.Prod.ProdId == ProdId && x.MachGroupId == MachGroupId)
|
||||
.FirstOrDefault()
|
||||
.State = newState;
|
||||
// Commit changes
|
||||
localDbCtx.SaveChanges();
|
||||
done = true;
|
||||
// aggiorno info sullo status
|
||||
StatusMapController.man.UpdateAction("", ProdId, MachGroupId, Core.StatusMapItemType.MachGroup, Core.StatusMapOpType.MachGroupNeedRedo, Value);
|
||||
.FirstOrDefault();
|
||||
if (item2upd != null)
|
||||
{
|
||||
item2upd.State = newState;
|
||||
// Commit changes
|
||||
localDbCtx.SaveChanges();
|
||||
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)
|
||||
{
|
||||
string errMessage = $"EXCEPTION on MachGroup.UpdateStatus: {Environment.NewLine}{exc}";
|
||||
string errMessage = $"EXCEPTION on MachGroup.SetNeedRedo: {Environment.NewLine}{exc}";
|
||||
Console.WriteLine(errMessage);
|
||||
Log.Error(errMessage);
|
||||
}
|
||||
@@ -469,20 +494,30 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
||||
bool done = false;
|
||||
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
||||
{
|
||||
var item2update = localDbCtx
|
||||
.MachGroupList
|
||||
.Where(x => x.MachGroupDbId == updItem.MachGroupDbId)
|
||||
.SingleOrDefault();
|
||||
var myStatusMapCtrl = new StatusMapController();
|
||||
try
|
||||
{
|
||||
// update, vers 1...
|
||||
localDbCtx.Entry(item2update).CurrentValues.SetValues(updItem);
|
||||
var item2update = localDbCtx
|
||||
.MachGroupList
|
||||
.Where(x => x.MachGroupDbId == updItem.MachGroupDbId)
|
||||
.SingleOrDefault();
|
||||
if (item2update != null)
|
||||
{
|
||||
// update, vers 1...
|
||||
localDbCtx.Entry(item2update).CurrentValues.SetValues(updItem);
|
||||
|
||||
// Commit changes
|
||||
localDbCtx.SaveChanges();
|
||||
done = true;
|
||||
// aggiorno info sullo status
|
||||
StatusMapController.man.UpdateAction("", updItem.Prod.ProdId, updItem.MachGroupId, Core.StatusMapItemType.MachGroup, Core.StatusMapOpType.MachGroupMod, "");
|
||||
// Commit changes
|
||||
localDbCtx.SaveChanges();
|
||||
done = true;
|
||||
// aggiorno info sullo status
|
||||
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)
|
||||
{
|
||||
@@ -506,6 +541,7 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
||||
bool done = false;
|
||||
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
||||
{
|
||||
var myStatusMapCtrl = new StatusMapController();
|
||||
try
|
||||
{
|
||||
// aggiorno
|
||||
@@ -513,15 +549,21 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
||||
.MachGroupList
|
||||
.Where(x => x.Prod.ProdId == ProdId && x.MachGroupId == MachGroupId)
|
||||
.FirstOrDefault();
|
||||
|
||||
currRecord.DtEnd = DtEnd;
|
||||
|
||||
// Commit changes
|
||||
localDbCtx.SaveChanges();
|
||||
|
||||
done = true;
|
||||
// aggiorno info sullo status
|
||||
StatusMapController.man.UpdateAction("", ProdId, MachGroupId, Core.StatusMapItemType.MachGroup, DtEnd == DateTime.MinValue ? Core.StatusMapOpType.ResetPartEnd : Core.StatusMapOpType.PartEnd, "");
|
||||
if (currRecord != null)
|
||||
{
|
||||
currRecord.DtEnd = DtEnd;
|
||||
// Commit changes
|
||||
localDbCtx.SaveChanges();
|
||||
done = true;
|
||||
// aggiorno info sullo status
|
||||
myStatusMapCtrl.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)
|
||||
{
|
||||
@@ -548,15 +590,23 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
||||
try
|
||||
{
|
||||
// aggiorno
|
||||
localDbCtx
|
||||
var item2upd = localDbCtx
|
||||
.MachGroupList
|
||||
.Where(x => x.Prod.ProdId == ProdId && x.MachGroupId == MachGroupId)
|
||||
.FirstOrDefault()
|
||||
.ProdIndex = newProdIndex;
|
||||
// Commit changes
|
||||
localDbCtx.SaveChanges();
|
||||
|
||||
done = true;
|
||||
.FirstOrDefault();
|
||||
if (item2upd != null)
|
||||
{
|
||||
item2upd.ProdIndex = newProdIndex;
|
||||
// Commit changes
|
||||
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)
|
||||
{
|
||||
@@ -581,6 +631,7 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
||||
bool done = false;
|
||||
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
||||
{
|
||||
var myStatusMapCtrl = new StatusMapController();
|
||||
try
|
||||
{
|
||||
// aggiorno
|
||||
@@ -588,15 +639,21 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
||||
.MachGroupList
|
||||
.Where(x => x.Prod.ProdId == ProdId && x.MachGroupId == MachGroupId)
|
||||
.FirstOrDefault();
|
||||
|
||||
currRecord.DtStart = DtStart;
|
||||
|
||||
// Commit changes
|
||||
localDbCtx.SaveChanges();
|
||||
|
||||
done = true;
|
||||
// aggiorno info sullo status
|
||||
StatusMapController.man.UpdateAction("", ProdId, MachGroupId, Core.StatusMapItemType.MachGroup, DtStart == DateTime.MinValue ? Core.StatusMapOpType.ResetPartStart : Core.StatusMapOpType.PartStart, "");
|
||||
if (currRecord != null)
|
||||
{
|
||||
currRecord.DtStart = DtStart;
|
||||
// Commit changes
|
||||
localDbCtx.SaveChanges();
|
||||
done = true;
|
||||
// aggiorno info sullo status
|
||||
myStatusMapCtrl.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)
|
||||
{
|
||||
@@ -621,6 +678,7 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
||||
bool done = false;
|
||||
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
||||
{
|
||||
var myStatusMapCtrl = new StatusMapController();
|
||||
try
|
||||
{
|
||||
// aggiorno
|
||||
@@ -628,15 +686,22 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
||||
.MachGroupList
|
||||
.Where(x => x.Prod.ProdId == ProdId && x.MachGroupId == MachGroupId)
|
||||
.FirstOrDefault();
|
||||
|
||||
currRecord.DtStart = DtStart;
|
||||
currRecord.DtEnd = DtEnd;
|
||||
|
||||
// Commit changes
|
||||
localDbCtx.SaveChanges();
|
||||
done = true;
|
||||
// aggiorno info sullo status
|
||||
StatusMapController.man.UpdateAction("", ProdId, MachGroupId, Core.StatusMapItemType.MachGroup, Core.StatusMapOpType.MachGroupMod, "");
|
||||
if (currRecord != null)
|
||||
{
|
||||
currRecord.DtStart = DtStart;
|
||||
currRecord.DtEnd = DtEnd;
|
||||
// Commit changes
|
||||
localDbCtx.SaveChanges();
|
||||
done = true;
|
||||
// aggiorno info sullo status
|
||||
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)
|
||||
{
|
||||
@@ -659,20 +724,29 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
||||
bool done = false;
|
||||
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
||||
{
|
||||
var myStatusMapCtrl = new StatusMapController();
|
||||
try
|
||||
{
|
||||
// aggiorno
|
||||
localDbCtx
|
||||
var item2upd = localDbCtx
|
||||
.MachGroupList
|
||||
.Where(x => x.Prod.ProdId == ProdId && x.MachGroupId == MachGroupId)
|
||||
.FirstOrDefault()
|
||||
.State = newState;
|
||||
// Commit changes
|
||||
localDbCtx.SaveChanges();
|
||||
|
||||
done = true;
|
||||
// aggiorno info sullo status
|
||||
StatusMapController.man.UpdateAction("", ProdId, MachGroupId, Core.StatusMapItemType.MachGroup, Core.StatusMapOpType.MachGroupMod, "");
|
||||
.FirstOrDefault();
|
||||
if (item2upd != null)
|
||||
{
|
||||
item2upd.State = newState;
|
||||
// Commit changes
|
||||
localDbCtx.SaveChanges();
|
||||
done = true;
|
||||
// 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)
|
||||
{
|
||||
@@ -691,23 +765,32 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
||||
bool done = false;
|
||||
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
||||
{
|
||||
var myStatusMapCtrl = new StatusMapController();
|
||||
try
|
||||
{
|
||||
// aggiorno
|
||||
var currRecord = localDbCtx
|
||||
var item2upd = localDbCtx
|
||||
.MachGroupList
|
||||
.Where(x => x.Prod.ProdId == ProdId && x.MachGroupId == MachGroupId)
|
||||
.FirstOrDefault();
|
||||
if (item2upd != null)
|
||||
{
|
||||
item2upd.SupervisorId = SupervisorId;
|
||||
item2upd.State = Core.ItemState.Assigned;
|
||||
|
||||
currRecord.SupervisorId = SupervisorId;
|
||||
currRecord.State = Core.ItemState.Assigned;
|
||||
// Commit changes
|
||||
localDbCtx.SaveChanges();
|
||||
done = true;
|
||||
|
||||
// Commit changes
|
||||
localDbCtx.SaveChanges();
|
||||
|
||||
done = true;
|
||||
// aggiorno info sullo status
|
||||
StatusMapController.man.UpdateAction("", ProdId, MachGroupId, Core.StatusMapItemType.MachGroup, Core.StatusMapOpType.MachGroupAssignedToSupervisor, "");
|
||||
// aggiorno info sullo status
|
||||
myStatusMapCtrl.UpdateAction("", ProdId, MachGroupId, Core.StatusMapItemType.MachGroup, Core.StatusMapOpType.MachGroupAssignedToSupervisor, "");
|
||||
}
|
||||
else
|
||||
{
|
||||
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)
|
||||
{
|
||||
|
||||
@@ -7,17 +7,10 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
||||
{
|
||||
public class PartController : IDisposable
|
||||
{
|
||||
#region Public Fields
|
||||
|
||||
public static PartController man = new PartController();
|
||||
|
||||
#endregion Public Fields
|
||||
|
||||
#region Public Constructors
|
||||
|
||||
public PartController()
|
||||
{
|
||||
}
|
||||
{ }
|
||||
|
||||
#endregion Public Constructors
|
||||
|
||||
@@ -29,12 +22,12 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
||||
/// <param name="corePart"></param>
|
||||
/// <param name="currMachGroupDbId"></param>
|
||||
/// <returns></returns>
|
||||
public static PartModel ConvertFromCore(Core.PartM corePart, int currMachGroupDbId)
|
||||
public PartModel ConvertFromCore(Core.PartM corePart, int currMachGroupDbId)
|
||||
{
|
||||
PartModel answ = new PartModel();
|
||||
if (corePart != null)
|
||||
{
|
||||
int BTLPartId = man.FindBtlPartByBPI(corePart.nProjId, corePart.nBTLPartId);
|
||||
int BTLPartId = FindBtlPartByBPI(corePart.nProjId, corePart.nBTLPartId);
|
||||
answ = new PartModel()
|
||||
{
|
||||
PartId = corePart.nPartId,
|
||||
@@ -74,23 +67,34 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
||||
bool done = false;
|
||||
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
||||
{
|
||||
var myStatusMapCtrl = new StatusMapController();
|
||||
var item2del = localDbCtx
|
||||
.PartList
|
||||
.Where(x => x.MachGroup.Prod.ProdId == ProdId && x.MachGroup.MachGroupId == MachGroupId && x.PartId == PartId)
|
||||
.SingleOrDefault();
|
||||
try
|
||||
|
||||
if (item2del != null)
|
||||
{
|
||||
// Remove from database
|
||||
localDbCtx.PartList.Remove(item2del);
|
||||
// Commit changes
|
||||
localDbCtx.SaveChanges();
|
||||
done = true;
|
||||
// aggiorno info sullo status
|
||||
StatusMapController.man.UpdateAction("", ProdId, MachGroupId, Core.StatusMapItemType.MachGroup, Core.StatusMapOpType.MachGroupMod, "");
|
||||
try
|
||||
{
|
||||
// Remove from database
|
||||
localDbCtx.PartList.Remove(item2del);
|
||||
// Commit changes
|
||||
localDbCtx.SaveChanges();
|
||||
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);
|
||||
Log.Error(errMessage);
|
||||
}
|
||||
@@ -112,17 +116,27 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
||||
.PartList
|
||||
.Where(x => x.PartDbId == PartDbId)
|
||||
.SingleOrDefault();
|
||||
try
|
||||
|
||||
if (item2del != null)
|
||||
{
|
||||
// Add to database
|
||||
localDbCtx.PartList.Remove(item2del);
|
||||
// Commit changes
|
||||
localDbCtx.SaveChanges();
|
||||
done = true;
|
||||
try
|
||||
{
|
||||
// Add to database
|
||||
localDbCtx.PartList.Remove(item2del);
|
||||
// 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);
|
||||
Log.Error(errMessage);
|
||||
}
|
||||
@@ -209,28 +223,38 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
||||
bool done = false;
|
||||
using (DatabaseContext locallocalDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
||||
{
|
||||
var item2update = locallocalDbCtx
|
||||
var myStatusMapCtrl = new StatusMapController();
|
||||
var item2upd = locallocalDbCtx
|
||||
.PartList
|
||||
.Where(x => x.PartDbId == updItem.PartDbId)
|
||||
.SingleOrDefault();
|
||||
try
|
||||
if (item2upd != null)
|
||||
{
|
||||
// update, vers 1...
|
||||
locallocalDbCtx.Entry(item2update).CurrentValues.SetValues(updItem);
|
||||
try
|
||||
{
|
||||
// update, vers 1...
|
||||
locallocalDbCtx.Entry(item2upd).CurrentValues.SetValues(updItem);
|
||||
|
||||
//// update, vers 2
|
||||
//localDbCtx.PartList.Remove(item2del);
|
||||
//localDbCtx.PartList.Add(updItem);
|
||||
//// update, vers 2
|
||||
//localDbCtx.PartList.Remove(item2del);
|
||||
//localDbCtx.PartList.Add(updItem);
|
||||
|
||||
// Commit changes
|
||||
locallocalDbCtx.SaveChanges();
|
||||
done = true;
|
||||
// aggiorno info sullo status
|
||||
StatusMapController.man.UpdateAction("", updItem.MachGroup.Prod.ProdId, updItem.PartId, Core.StatusMapItemType.Part, Core.StatusMapOpType.MachGroupMod, "");
|
||||
// Commit changes
|
||||
locallocalDbCtx.SaveChanges();
|
||||
done = true;
|
||||
// aggiorno info sullo status
|
||||
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);
|
||||
Log.Error(errMessage);
|
||||
}
|
||||
@@ -249,19 +273,30 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
||||
bool done = false;
|
||||
using (DatabaseContext locallocalDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
||||
{
|
||||
var myStatusMapCtrl = new StatusMapController();
|
||||
try
|
||||
{
|
||||
// aggiorno
|
||||
locallocalDbCtx
|
||||
var item2upd = locallocalDbCtx
|
||||
.PartList
|
||||
.Where(x => x.MachGroup.Prod.ProdId == ProdId && x.MachGroup.MachGroupId == MachGroupId && x.PartId == PartId)
|
||||
.FirstOrDefault()
|
||||
.DtEnd = DtEnd;
|
||||
// Commit changes
|
||||
locallocalDbCtx.SaveChanges();
|
||||
done = true;
|
||||
// aggiorno info sullo status
|
||||
StatusMapController.man.UpdateAction("", ProdId, PartId, Core.StatusMapItemType.Part, DtEnd == DateTime.MinValue ? Core.StatusMapOpType.ResetPartEnd : Core.StatusMapOpType.PartEnd, "");
|
||||
.FirstOrDefault();
|
||||
|
||||
if (item2upd != null)
|
||||
{
|
||||
item2upd.DtEnd = DtEnd;
|
||||
// Commit changes
|
||||
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)
|
||||
{
|
||||
@@ -284,19 +319,29 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
||||
bool done = false;
|
||||
using (DatabaseContext locallocalDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
||||
{
|
||||
var myStatusMapCtrl = new StatusMapController();
|
||||
try
|
||||
{
|
||||
// aggiorno
|
||||
locallocalDbCtx
|
||||
var item2upd = locallocalDbCtx
|
||||
.PartList
|
||||
.Where(x => x.MachGroup.Prod.ProdId == ProdId && x.MachGroup.MachGroupId == MachGroupId && x.PartId == PartId)
|
||||
.FirstOrDefault()
|
||||
.DtStart = DtStart;
|
||||
// Commit changes
|
||||
locallocalDbCtx.SaveChanges();
|
||||
done = true;
|
||||
// aggiorno info sullo status
|
||||
StatusMapController.man.UpdateAction("", ProdId, PartId, Core.StatusMapItemType.Part, DtStart == DateTime.MinValue ? Core.StatusMapOpType.ResetPartStart : Core.StatusMapOpType.PartStart, "");
|
||||
.FirstOrDefault();
|
||||
if (item2upd != null)
|
||||
{
|
||||
item2upd.DtStart = DtStart;
|
||||
// Commit changes
|
||||
locallocalDbCtx.SaveChanges();
|
||||
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)
|
||||
{
|
||||
@@ -320,19 +365,29 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
||||
bool done = false;
|
||||
using (DatabaseContext locallocalDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
||||
{
|
||||
var myStatusMapCtrl = new StatusMapController();
|
||||
try
|
||||
{
|
||||
// aggiorno
|
||||
locallocalDbCtx
|
||||
var item2upd = locallocalDbCtx
|
||||
.PartList
|
||||
.Where(x => x.MachGroup.Prod.ProdId == ProdId && x.MachGroup.MachGroupId == MachGroupId && x.PartId == PartId)
|
||||
.FirstOrDefault()
|
||||
.State = newState;
|
||||
// Commit changes
|
||||
locallocalDbCtx.SaveChanges();
|
||||
done = true;
|
||||
// aggiorno info sullo status
|
||||
StatusMapController.man.UpdateAction("", ProdId, PartId, Core.StatusMapItemType.Part, newState == Core.ItemState.Scrapped ? Core.StatusMapOpType.SetPartScrapped : Core.StatusMapOpType.MachGroupMod, "");
|
||||
.FirstOrDefault();
|
||||
if (item2upd != null)
|
||||
{
|
||||
item2upd.State = newState;
|
||||
// Commit changes
|
||||
locallocalDbCtx.SaveChanges();
|
||||
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)
|
||||
{
|
||||
|
||||
@@ -9,17 +9,11 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
||||
{
|
||||
public class ProdController : IDisposable
|
||||
{
|
||||
#region Public Fields
|
||||
|
||||
public static ProdController man = new ProdController();
|
||||
|
||||
#endregion Public Fields
|
||||
|
||||
#region Public Constructors
|
||||
|
||||
public ProdController()
|
||||
{
|
||||
Log.Info("ProdController istance Started");
|
||||
Log.Info("ProdController instance Started");
|
||||
}
|
||||
|
||||
#endregion Public Constructors
|
||||
@@ -179,14 +173,75 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Elenco progetti
|
||||
/// Elenco prod
|
||||
/// </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>
|
||||
public List<Core.ProdFileM> GetLastDesc(int numRecord)
|
||||
public List<Core.ProdFileM> GetLastDesc(int numRecord, bool OnlyActive)
|
||||
{
|
||||
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
|
||||
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;
|
||||
@@ -353,25 +408,39 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
||||
bool done = false;
|
||||
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
||||
{
|
||||
var item2update = localDbCtx
|
||||
.ProdList
|
||||
.Where(x => x.ProdDbId == updItem.ProdDbId)
|
||||
.SingleOrDefault();
|
||||
try
|
||||
{
|
||||
// update, vers 1...
|
||||
localDbCtx.Entry(item2update).CurrentValues.SetValues(updItem);
|
||||
var item2update = localDbCtx
|
||||
.ProdList
|
||||
.Where(x => x.ProdDbId == updItem.ProdDbId)
|
||||
.SingleOrDefault();
|
||||
|
||||
//// update, vers 2
|
||||
//localDbCtx.PartList.Remove(item2del);
|
||||
//localDbCtx.PartList.Add(updItem);
|
||||
if (item2update != null)
|
||||
{
|
||||
// update, vers 1...
|
||||
localDbCtx.Entry(item2update).CurrentValues.SetValues(updItem);
|
||||
|
||||
// Commit changes
|
||||
localDbCtx.SaveChanges();
|
||||
done = true;
|
||||
//// update, vers 2
|
||||
//localDbCtx.PartList.Remove(item2del);
|
||||
//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;
|
||||
}
|
||||
@@ -384,137 +453,182 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
||||
/// </summary>
|
||||
/// <param name="ProdId">Id del Prod</param>
|
||||
/// <param name="MachGroupList">Elenco MachGroup da associare</param>
|
||||
/// <returns></returns>
|
||||
public ProdModel UpdateMachGroup(int ProdId, List<Core.MyMachGroupM> MachGroupList)
|
||||
/// <returns>Bool esecuzione con successo o meno</returns>
|
||||
public bool UpdateMachGroup(int ProdId, List<Core.MyMachGroupM> MachGroupList)
|
||||
{
|
||||
ProdModel currData = new ProdModel();
|
||||
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
||||
bool testOk = false;
|
||||
// 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
|
||||
currData = localDbCtx
|
||||
.ProdList
|
||||
.Where(x => x.ProdId == ProdId)
|
||||
.SingleOrDefault();
|
||||
|
||||
try
|
||||
ProdModel currData = new ProdModel();
|
||||
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
||||
{
|
||||
// preparo elenco
|
||||
List<MachGroupModel> itemsMG2Add = new List<MachGroupModel>();
|
||||
|
||||
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 myStatusMapCtrl = new StatusMapController();
|
||||
try
|
||||
{
|
||||
var currMG = MachGroupController.man.FindByMachGroupId(ProdId, item.Id);
|
||||
var convCurrMG = MachGroupController.ConvertFromCore(item, currData.ProdDbId);
|
||||
if (currMG != null)
|
||||
// Recupero il PROD nel contesto DB attuale
|
||||
currData = localDbCtx
|
||||
.ProdList
|
||||
.Where(x => x.ProdId == ProdId)
|
||||
.SingleOrDefault();
|
||||
|
||||
if (currData != null)
|
||||
{
|
||||
// se non identico x equality limitata a ViewOptim...
|
||||
if (!currMG.ViewOptimEquals(convCurrMG))
|
||||
// preparo elenco
|
||||
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
|
||||
currMG.H = convCurrMG.H;
|
||||
currMG.L = convCurrMG.L;
|
||||
currMG.W = convCurrMG.W;
|
||||
currMG.Material = convCurrMG.Material;
|
||||
currMG.Name = convCurrMG.Name;
|
||||
// salvo
|
||||
localDbCtx.SaveChanges();
|
||||
// registro modifica StatusMap
|
||||
StatusMapController.man.UpdateAction(currMG.SupervisorId, ProdId, currMG.MachGroupId, Core.StatusMapItemType.MachGroup, Core.StatusMapOpType.MachGroupMod, "");
|
||||
var currMG = logMGCtrl.FindByMachGroupId(ProdId, item.Id);
|
||||
var convCurrMG = logMGCtrl.ConvertFromCore(item, currData.ProdDbId);
|
||||
if (currMG != null)
|
||||
{
|
||||
// se non identico x equality limitata a ViewOptim...
|
||||
if (!currMG.ViewOptimEquals(convCurrMG))
|
||||
{
|
||||
// aggiorno con nuovi valori ricevuti
|
||||
currMG.H = convCurrMG.H;
|
||||
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
|
||||
{
|
||||
itemsMG2Add.Add(convCurrMG);
|
||||
// registro modifica StatusMap
|
||||
StatusMapController.man.UpdateAction("", ProdId, item.Id, Core.StatusMapItemType.MachGroup, Core.StatusMapOpType.MachGroupAdd, "");
|
||||
string errMessage = $"ERROR on Prod.UpdateMachGroup: req item was not found | ProdId {ProdId} | MachGroupList {MachGroupList.Count} rec";
|
||||
Console.WriteLine(errMessage);
|
||||
Log.Error(errMessage);
|
||||
}
|
||||
}
|
||||
// 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)
|
||||
catch (Exception exc)
|
||||
{
|
||||
var currMG = MachGroupController.man.FindByMachGroupId(ProdId, item.Id);
|
||||
int MachGroupDbId = currMG.MachGroupDbId;
|
||||
bool modMg = false;
|
||||
// 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, "");
|
||||
}
|
||||
string errMessage = $"EXCEPTION on Prod.UpdateMachGroup: {Environment.NewLine}{exc}";
|
||||
Console.WriteLine(errMessage);
|
||||
Log.Error(errMessage);
|
||||
}
|
||||
|
||||
// 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>
|
||||
@@ -525,18 +639,36 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
||||
/// <returns></returns>
|
||||
public Core.ProdFileM UpdateMachine(int ProdId, String Machine)
|
||||
{
|
||||
ProdModel currData;
|
||||
ProdModel currData = new ProdModel();
|
||||
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
||||
{
|
||||
currData = localDbCtx
|
||||
try
|
||||
{
|
||||
currData = localDbCtx
|
||||
.ProdList
|
||||
.Where(x => x.ProdId == ProdId)
|
||||
.SingleOrDefault();
|
||||
// aggiorno valore BTL
|
||||
currData.Machine = Machine;
|
||||
if (currData != null)
|
||||
{
|
||||
// aggiorno valore BTL
|
||||
currData.Machine = Machine;
|
||||
|
||||
// Commit changes
|
||||
localDbCtx.SaveChanges();
|
||||
// Commit changes
|
||||
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);
|
||||
}
|
||||
@@ -549,18 +681,36 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
||||
/// <returns></returns>
|
||||
public Core.ProdFileM UpdatePType(int ProdId, BWType PType)
|
||||
{
|
||||
ProdModel currData;
|
||||
ProdModel currData = new ProdModel();
|
||||
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
||||
{
|
||||
currData = localDbCtx
|
||||
try
|
||||
{
|
||||
currData = localDbCtx
|
||||
.ProdList
|
||||
.Where(x => x.ProdId == ProdId)
|
||||
.SingleOrDefault();
|
||||
// aggiorno valore BTL
|
||||
currData.PType = PType;
|
||||
if (currData != null)
|
||||
{
|
||||
// aggiorno valore BTL
|
||||
currData.PType = PType;
|
||||
|
||||
// Commit changes
|
||||
localDbCtx.SaveChanges();
|
||||
// Commit changes
|
||||
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);
|
||||
}
|
||||
@@ -572,25 +722,40 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
||||
string LockBy = "";
|
||||
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
||||
{
|
||||
// seleziono il prod...
|
||||
var currProd = localDbCtx
|
||||
try
|
||||
{
|
||||
// seleziono il prod...
|
||||
var currProd = localDbCtx
|
||||
.ProdList
|
||||
.Where(x => x.ProdId == ProdId)
|
||||
.FirstOrDefault();
|
||||
|
||||
if (currProd != null)
|
||||
{
|
||||
LockBy = currProd.LockedBy;
|
||||
|
||||
var currProj = localDbCtx
|
||||
.ProjList
|
||||
.Where(x => x.ProdDbId == currProd.ProdDbId)
|
||||
.ToList();
|
||||
|
||||
if (currProj != null && string.IsNullOrEmpty(LockBy))
|
||||
if (currProd != null)
|
||||
{
|
||||
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;
|
||||
@@ -611,6 +776,7 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
||||
return answ;
|
||||
}
|
||||
|
||||
#if false
|
||||
/// <summary>
|
||||
/// Get LAST paginated data from DB (DESC ordered)
|
||||
/// </summary>
|
||||
@@ -632,11 +798,14 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
||||
.Take(numRecord)
|
||||
.ToList();
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
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
|
||||
|
||||
@@ -45,11 +45,12 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Delete Proj on DB by ProjId
|
||||
/// Delete Proj logically / on DB by ProjId
|
||||
/// </summary>
|
||||
/// <param name="ProjId"></param>
|
||||
/// <param name="IsLogical"></param>
|
||||
/// <returns></returns>
|
||||
public bool DeleteProj(int ProjId)
|
||||
public bool DeleteProj(int ProjId, bool IsLogical)
|
||||
{
|
||||
bool done = false;
|
||||
|
||||
@@ -59,25 +60,45 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
||||
.ProjList
|
||||
.Where(x => x.ProjId == ProjId)
|
||||
.SingleOrDefault();
|
||||
// sel delle BTLParts da proj
|
||||
var parts2del = localDbCtx
|
||||
.BTLPartList
|
||||
.Where(x => x.ProjDbId == currProj.ProjDbId);
|
||||
|
||||
try
|
||||
if (IsLogical)
|
||||
{
|
||||
// remove from database
|
||||
localDbCtx.BTLPartList.RemoveRange(parts2del);
|
||||
localDbCtx.ProjList.Remove(currProj);
|
||||
// Commit changes
|
||||
localDbCtx.SaveChanges();
|
||||
done = true;
|
||||
try
|
||||
{
|
||||
currProj.IsActive = false;
|
||||
// Commit changes
|
||||
localDbCtx.SaveChanges();
|
||||
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}";
|
||||
Console.WriteLine(errMessage);
|
||||
Log.Error(errMessage);
|
||||
// sel delle BTLParts da proj
|
||||
var parts2del = localDbCtx
|
||||
.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;
|
||||
@@ -91,8 +112,9 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
||||
/// Get records filtered by BtlPartName matching regexp BtlFileName[_number]
|
||||
/// </summary>
|
||||
/// <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>
|
||||
public List<ProjModel> FindByBtlFileName(string BtlFileName)
|
||||
public List<ProjModel> FindByBtlFileName(string BtlFileName, bool OnlyActive)
|
||||
{
|
||||
List<ProjModel> searchResult = new List<ProjModel>();
|
||||
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...
|
||||
ProjModel parentRec = localDbCtx
|
||||
.ProjList
|
||||
.Where(x => x.BTLFileName == BtlFileName)
|
||||
.Where(x => x.BTLFileName == BtlFileName && (!OnlyActive || x.IsActive))
|
||||
.FirstOrDefault();
|
||||
if (parentRec != null && parentRec.ProjId > 0)
|
||||
{
|
||||
@@ -109,7 +131,7 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
||||
// cerco eventuali dati "child" puliti
|
||||
var childRec = localDbCtx
|
||||
.ProjList
|
||||
.Where(x => x.BTLFileName.StartsWith(BtlFileName + "_"))
|
||||
.Where(x => x.BTLFileName.StartsWith(BtlFileName + "_") && (!OnlyActive || x.IsActive))
|
||||
.ToList();
|
||||
// faccio filtro con ricerca regexp x scartare "falsi positivi" come BtlFileName_nonNumero...
|
||||
if (childRec.Count > 0)
|
||||
@@ -180,7 +202,7 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
||||
/// <summary>
|
||||
/// Get filtered data by ProdId (ASC ordered)
|
||||
/// </summary>
|
||||
/// <param name="ProdDbId"></param>
|
||||
/// <param name="ProdId"></param>
|
||||
/// <returns></returns>
|
||||
public List<Core.ProjFileM> GetByProdAsc(int ProdId)
|
||||
{
|
||||
@@ -280,9 +302,12 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
||||
/// <summary>
|
||||
/// Elenco progetti
|
||||
/// </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>
|
||||
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>();
|
||||
|
||||
@@ -296,6 +321,69 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
||||
// retrieve
|
||||
var dbRes = localDbCtx
|
||||
.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)
|
||||
.Take(numRecord)
|
||||
.ToList();
|
||||
@@ -341,6 +429,7 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
||||
{
|
||||
ProjId = nextId,
|
||||
BTLFileName = "",
|
||||
ProjDescription = "",
|
||||
IsNew = true,
|
||||
Locked = true,
|
||||
LockedBy = UserKey,
|
||||
@@ -452,22 +541,35 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
||||
.ProjList
|
||||
.Where(x => x.ProjId == updItem.ProjId)
|
||||
.SingleOrDefault();
|
||||
try
|
||||
if (item2update != null)
|
||||
{
|
||||
updItem.ProjDbId = item2update.ProjDbId;
|
||||
// update, vers 1...
|
||||
localDbCtx.Entry(item2update).CurrentValues.SetValues(updItem);
|
||||
try
|
||||
{
|
||||
updItem.ProjDbId = item2update.ProjDbId;
|
||||
// update, vers 1...
|
||||
localDbCtx.Entry(item2update).CurrentValues.SetValues(updItem);
|
||||
|
||||
//// update, vers 2
|
||||
//dbCtx.PartList.Remove(item2del);
|
||||
//dbCtx.PartList.Add(updItem);
|
||||
//// update, vers 2
|
||||
//dbCtx.PartList.Remove(item2del);
|
||||
//dbCtx.PartList.Add(updItem);
|
||||
|
||||
// Commit changes
|
||||
localDbCtx.SaveChanges();
|
||||
done = true;
|
||||
// Commit changes
|
||||
localDbCtx.SaveChanges();
|
||||
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;
|
||||
}
|
||||
@@ -493,77 +595,84 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
||||
.BTLPartList
|
||||
.Where(x => x.ProjDbId == currData.ProjDbId)
|
||||
.ToList();
|
||||
|
||||
// converto le BtlParts da core --> DB
|
||||
List<BTLPartModel> newBtlParts = BtlPartList.Select(x => BTLPartController.ConvertFromCore(x, currData.ProjDbId)).ToList();
|
||||
|
||||
try
|
||||
if (oldBtlParts != null)
|
||||
{
|
||||
// elementi BtlPartId NON + presenti da eliminare
|
||||
List<int> bpi2rem = oldBtlParts.Select(x => x.PartId).Except(newBtlParts.Select(y => y.PartId)).ToList();
|
||||
List<int> bpi2add = newBtlParts.Select(x => x.PartId).Except(oldBtlParts.Select(y => y.PartId)).ToList();
|
||||
List<int> bpiExis = newBtlParts.Select(x => x.PartId).Intersect(oldBtlParts.Select(y => y.PartId)).ToList();
|
||||
var locBtlCtrl = new BTLPartController();
|
||||
// converto le BtlParts da core --> DB
|
||||
List<BTLPartModel> newBtlParts = BtlPartList.Select(x => locBtlCtrl.ConvertFromCore(x, currData.ProjDbId)).ToList();
|
||||
|
||||
// aggiorno existing...
|
||||
foreach (var currPartId in bpiExis)
|
||||
try
|
||||
{
|
||||
// recupero item da aggiornare...
|
||||
var oldItem = oldBtlParts.Where(x => x.PartId == currPartId).FirstOrDefault();
|
||||
// dati nuovo item
|
||||
var newItem = newBtlParts.Where(x => x.PartId == currPartId).FirstOrDefault();
|
||||
if (newItem != null && oldItem != null)
|
||||
// elementi BtlPartId NON + presenti da eliminare
|
||||
List<int> bpi2rem = oldBtlParts.Select(x => x.PartId).Except(newBtlParts.Select(y => y.PartId)).ToList();
|
||||
List<int> bpi2add = newBtlParts.Select(x => x.PartId).Except(oldBtlParts.Select(y => y.PartId)).ToList();
|
||||
List<int> bpiExis = newBtlParts.Select(x => x.PartId).Intersect(oldBtlParts.Select(y => y.PartId)).ToList();
|
||||
|
||||
// aggiorno existing...
|
||||
foreach (var currPartId in bpiExis)
|
||||
{
|
||||
oldItem.CALC_State = newItem.CALC_State;
|
||||
oldItem.CNT = newItem.CNT;
|
||||
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;
|
||||
// recupero item da aggiornare...
|
||||
var oldItem = oldBtlParts.Where(x => x.PartId == currPartId).FirstOrDefault();
|
||||
// dati nuovo item
|
||||
var newItem = newBtlParts.Where(x => x.PartId == currPartId).FirstOrDefault();
|
||||
if (newItem != null && oldItem != null)
|
||||
{
|
||||
oldItem.CALC_State = newItem.CALC_State;
|
||||
oldItem.CNT = newItem.CNT;
|
||||
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
|
||||
foreach (var newPartId in bpi2add)
|
||||
{
|
||||
var newItem = newBtlParts.Where(x => x.PartId == newPartId).FirstOrDefault();
|
||||
localDbCtx.BTLPartList.Add(newItem);
|
||||
}
|
||||
// aggiorno valore isNew a false
|
||||
currData.IsNew = false;
|
||||
|
||||
// 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);
|
||||
}
|
||||
// Commit changes
|
||||
localDbCtx.SaveChanges();
|
||||
}
|
||||
else
|
||||
{
|
||||
string errMessage = $"ERROR on Proj.UpdateBtlParts: req item was not found | ProjId {ProjId} | BtlPartList {BtlPartList.Count} items";
|
||||
Console.WriteLine(errMessage);
|
||||
Log.Error(errMessage);
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
|
||||
// aggiorno valore isNew a false
|
||||
currData.IsNew = false;
|
||||
|
||||
// Commit changes
|
||||
localDbCtx.SaveChanges();
|
||||
}
|
||||
return currData;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Update record su DB x nomeBTL, ListName, ExportDate
|
||||
/// Update record su DB x Description
|
||||
/// </summary>
|
||||
/// <param name="ProjId"></param>
|
||||
/// <param name="BTLFileName"></param>
|
||||
/// <param name="ListName"></param>
|
||||
/// <param name="DtExported"></param>
|
||||
/// <param name="Description"></param>
|
||||
/// <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
|
||||
ProjModel currData;
|
||||
@@ -573,50 +682,120 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
||||
.ProjList
|
||||
.Where(x => x.ProjId == ProjId)
|
||||
.SingleOrDefault();
|
||||
|
||||
// 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)
|
||||
if (currData != null)
|
||||
{
|
||||
// se ne ho esattamente 1 nel DB allora DEVE essere il record Parent
|
||||
if (duplicateList.Count == 1)
|
||||
try
|
||||
{
|
||||
// verifico se ProjId variato
|
||||
if (!duplicateList[0].ProjId.Equals(currData.ProjId))
|
||||
{
|
||||
// in questo caso ho il PRIMO duplicato
|
||||
BTLFileName = $"{BTLFileName}_1";
|
||||
}
|
||||
// aggiorno valore BTL
|
||||
currData.ProjDescription = Description;
|
||||
|
||||
// Commit changes
|
||||
localDbCtx.SaveChanges();
|
||||
}
|
||||
// se ne ho + di 1 --> so che il maxId interno avrò il valore ULTIMO x prendere
|
||||
// il successivo
|
||||
else
|
||||
catch (Exception exc)
|
||||
{
|
||||
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}";
|
||||
}
|
||||
string errMessage = $"EXCEPTION on Part.UpdateDescription:{Environment.NewLine}{exc}";
|
||||
Console.WriteLine(errMessage);
|
||||
Log.Error(errMessage);
|
||||
}
|
||||
}
|
||||
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
|
||||
currData.BTLFileName = BTLFileName;
|
||||
currData.DtExported = DtExported;
|
||||
currData.ListName = ListName;
|
||||
currData.PType = PType;
|
||||
currData.Machine = Machine;
|
||||
return coreConv(currData);
|
||||
}
|
||||
|
||||
// Commit changes
|
||||
localDbCtx.SaveChanges();
|
||||
/// <summary>
|
||||
/// 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);
|
||||
@@ -630,18 +809,36 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
||||
/// <returns></returns>
|
||||
public Core.ProjFileM UpdateListName(int ProjId, string ListName)
|
||||
{
|
||||
ProjModel currData;
|
||||
ProjModel currData = new ProjModel();
|
||||
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
||||
{
|
||||
currData = localDbCtx
|
||||
.ProjList
|
||||
.Where(x => x.ProjId == ProjId)
|
||||
.SingleOrDefault();
|
||||
// aggiorno valore BTL
|
||||
currData.ListName = ListName;
|
||||
try
|
||||
{
|
||||
currData = localDbCtx
|
||||
.ProjList
|
||||
.Where(x => x.ProjId == ProjId)
|
||||
.SingleOrDefault();
|
||||
if (currData != null)
|
||||
{
|
||||
// aggiorno valore BTL
|
||||
currData.ListName = ListName;
|
||||
|
||||
// Commit changes
|
||||
localDbCtx.SaveChanges();
|
||||
// Commit changes
|
||||
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);
|
||||
}
|
||||
@@ -654,18 +851,37 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
||||
/// <returns></returns>
|
||||
public Core.ProjFileM UpdateMachine(int ProjId, String Machine)
|
||||
{
|
||||
ProjModel currData;
|
||||
ProjModel currData = new ProjModel();
|
||||
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
||||
{
|
||||
currData = localDbCtx
|
||||
try
|
||||
{
|
||||
currData = localDbCtx
|
||||
.ProjList
|
||||
.Where(x => x.ProjId == ProjId)
|
||||
.SingleOrDefault();
|
||||
// aggiorno valore BTL
|
||||
currData.Machine = Machine;
|
||||
|
||||
// Commit changes
|
||||
localDbCtx.SaveChanges();
|
||||
if (currData != null)
|
||||
{
|
||||
// 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);
|
||||
}
|
||||
@@ -684,7 +900,7 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
||||
Core.ProjFileM answ = 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;
|
||||
}
|
||||
|
||||
@@ -8,15 +8,6 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
||||
{
|
||||
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
|
||||
|
||||
public StatusMapController()
|
||||
|
||||
@@ -97,6 +97,8 @@ namespace EgtBEAMWALL.DataLayer.DatabaseModels
|
||||
if (!(obj is PartModel item))
|
||||
return false;
|
||||
|
||||
if (BTLPartDbId != item.BTLPartDbId)
|
||||
return false;
|
||||
if (H != item.H)
|
||||
return false;
|
||||
if (L != item.L)
|
||||
|
||||
@@ -1,7 +1,4 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using static EgtBEAMWALL.Core.ConstBeam;
|
||||
@@ -31,6 +28,12 @@ namespace EgtBEAMWALL.DataLayer.DatabaseModels
|
||||
[Column("DtExported")]
|
||||
public DateTime DtExported { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Record attivo (se false == cancellazione logica)
|
||||
/// </summary>
|
||||
[Column("IsActive")]
|
||||
public bool IsActive { get; set; } = true;
|
||||
|
||||
/// <summary>
|
||||
/// Stato NEW = creato ma NON salvato
|
||||
/// </summary>
|
||||
@@ -43,6 +46,13 @@ namespace EgtBEAMWALL.DataLayer.DatabaseModels
|
||||
[Column("ListName")]
|
||||
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>
|
||||
/// Stato locked (quando aperto da un dispositivo in rete)
|
||||
/// </summary>
|
||||
@@ -55,12 +65,6 @@ namespace EgtBEAMWALL.DataLayer.DatabaseModels
|
||||
[Column("LockedBy")]
|
||||
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>
|
||||
/// Macchina
|
||||
/// </summary>
|
||||
@@ -76,6 +80,12 @@ namespace EgtBEAMWALL.DataLayer.DatabaseModels
|
||||
[Key, Column("ProjDbId"), DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
||||
public int ProjDbId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Descrizione progetto (copiata da BTLFileName inizialmente)
|
||||
/// </summary>
|
||||
[Column("ProjDescription")]
|
||||
public string ProjDescription { get; set; } = "";
|
||||
|
||||
[Column("Id")]
|
||||
public int ProjId { get; set; }
|
||||
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
using System.IO;
|
||||
using System.Diagnostics;
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Reflection;
|
||||
|
||||
namespace EgtBEAMWALL.DataLayer
|
||||
@@ -27,7 +29,7 @@ namespace EgtBEAMWALL.DataLayer
|
||||
public static string ADMIN_CONNECTION_STRING { get; set; } = "";
|
||||
|
||||
/// <summary>
|
||||
/// DB Connection string
|
||||
/// DB Connection string, per effettuare migration riportare valore connessione admin cablato
|
||||
/// </summary>
|
||||
public static string CONNECTION_STRING { get; set; } = "";
|
||||
|
||||
@@ -70,6 +72,68 @@ namespace EgtBEAMWALL.DataLayer
|
||||
// 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>
|
||||
/// Metodo di init standard per DB in rete con Master_Key
|
||||
|
||||
@@ -9,7 +9,6 @@ namespace EgtBEAMWALL.DataLayer
|
||||
{
|
||||
#region Public Fields
|
||||
|
||||
public static DbManager obj = new DbManager();
|
||||
public Controllers.BTLPartController BtlPartCtr = new Controllers.BTLPartController();
|
||||
public Controllers.LogMachineController LogMacCtr = new Controllers.LogMachineController();
|
||||
public Controllers.LogSupportController LogSupCtr = new Controllers.LogSupportController();
|
||||
|
||||
@@ -37,8 +37,8 @@
|
||||
<Prefer32Bit>false</Prefer32Bit>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="BouncyCastle.Crypto, Version=1.8.5.0, Culture=neutral, PublicKeyToken=0e99375e54769942">
|
||||
<HintPath>..\packages\BouncyCastle.1.8.5\lib\BouncyCastle.Crypto.dll</HintPath>
|
||||
<Reference Include="BouncyCastle.Crypto, Version=1.9.0.0, Culture=neutral, PublicKeyToken=0e99375e54769942, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Portable.BouncyCastle.1.9.0\lib\net40\BouncyCastle.Crypto.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="EgtWPFLib5">
|
||||
<HintPath>..\ExtLibs\EgtWPFLib5.dll</HintPath>
|
||||
@@ -49,17 +49,17 @@
|
||||
<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>
|
||||
</Reference>
|
||||
<Reference Include="Google.Protobuf, Version=3.19.4.0, Culture=neutral, PublicKeyToken=a7d26565bac4d604, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Google.Protobuf.3.19.4\lib\net45\Google.Protobuf.dll</HintPath>
|
||||
<Reference Include="Google.Protobuf, Version=3.21.9.0, Culture=neutral, PublicKeyToken=a7d26565bac4d604, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Google.Protobuf.3.21.9\lib\net45\Google.Protobuf.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="K4os.Compression.LZ4, Version=1.2.6.0, Culture=neutral, PublicKeyToken=2186fa9121ef231d, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\K4os.Compression.LZ4.1.2.6\lib\net46\K4os.Compression.LZ4.dll</HintPath>
|
||||
<Reference Include="K4os.Compression.LZ4, Version=1.3.5.0, Culture=neutral, PublicKeyToken=2186fa9121ef231d, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\K4os.Compression.LZ4.1.3.5\lib\net462\K4os.Compression.LZ4.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="K4os.Compression.LZ4.Streams, Version=1.2.6.0, Culture=neutral, PublicKeyToken=2186fa9121ef231d, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\K4os.Compression.LZ4.Streams.1.2.6\lib\net46\K4os.Compression.LZ4.Streams.dll</HintPath>
|
||||
<Reference Include="K4os.Compression.LZ4.Streams, Version=1.3.5.0, Culture=neutral, PublicKeyToken=2186fa9121ef231d, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\K4os.Compression.LZ4.Streams.1.3.5\lib\net462\K4os.Compression.LZ4.Streams.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="K4os.Hash.xxHash, Version=1.0.6.0, Culture=neutral, PublicKeyToken=32cd54395057cec3, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\K4os.Hash.xxHash.1.0.6\lib\net46\K4os.Hash.xxHash.dll</HintPath>
|
||||
<Reference Include="K4os.Hash.xxHash, Version=1.0.8.0, Culture=neutral, PublicKeyToken=32cd54395057cec3, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\K4os.Hash.xxHash.1.0.8\lib\net462\K4os.Hash.xxHash.dll</HintPath>
|
||||
</Reference>
|
||||
<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>
|
||||
@@ -88,20 +88,26 @@
|
||||
<Reference Include="System.Drawing" />
|
||||
<Reference Include="System.Drawing.Design" />
|
||||
<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.Memory, Version=4.0.1.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Memory.4.5.4\lib\net461\System.Memory.dll</HintPath>
|
||||
<Reference Include="System.Memory, Version=4.0.1.2, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Memory.4.5.5\lib\net461\System.Memory.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Numerics" />
|
||||
<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>
|
||||
</Reference>
|
||||
<Reference Include="System.Runtime.CompilerServices.Unsafe, Version=5.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>
|
||||
<Reference Include="System.Runtime.CompilerServices.Unsafe, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Runtime.CompilerServices.Unsafe.6.0.0\lib\net461\System.Runtime.CompilerServices.Unsafe.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Security" />
|
||||
<Reference Include="System.ServiceModel" />
|
||||
<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.Xml.Linq" />
|
||||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
@@ -166,6 +172,10 @@
|
||||
<Compile Include="Migrations\202207051703296_UpgradeLockModel.designer.cs">
|
||||
<DependentUpon>202207051703296_UpgradeLockModel.cs</DependentUpon>
|
||||
</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="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="Utils.cs" />
|
||||
@@ -205,6 +215,9 @@
|
||||
<EmbeddedResource Include="Migrations\202207051703296_UpgradeLockModel.resx">
|
||||
<DependentUpon>202207051703296_UpgradeLockModel.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Migrations\202306081452095_UpdateProjModel.resx">
|
||||
<DependentUpon>202306081452095_UpdateProjModel.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<PropertyGroup>
|
||||
|
||||
+29
@@ -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");
|
||||
}
|
||||
}
|
||||
}
|
||||
File diff suppressed because one or more lines are too long
@@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("2.5.3.2")]
|
||||
[assembly: AssemblyFileVersion("2.5.3.2")]
|
||||
[assembly: AssemblyVersion("2.5.6.2")]
|
||||
[assembly: AssemblyFileVersion("2.5.6.2")]
|
||||
|
||||
@@ -2,17 +2,20 @@
|
||||
<packages>
|
||||
<package id="BouncyCastle" version="1.8.5" targetFramework="net472" />
|
||||
<package id="EntityFramework" version="6.4.4" targetFramework="net452" />
|
||||
<package id="Google.Protobuf" version="3.19.4" targetFramework="net472" />
|
||||
<package id="K4os.Compression.LZ4" version="1.2.6" targetFramework="net472" />
|
||||
<package id="K4os.Compression.LZ4.Streams" version="1.2.6" targetFramework="net472" />
|
||||
<package id="K4os.Hash.xxHash" version="1.0.6" targetFramework="net472" />
|
||||
<package id="Google.Protobuf" version="3.21.9" targetFramework="net472" />
|
||||
<package id="K4os.Compression.LZ4" version="1.3.5" targetFramework="net472" />
|
||||
<package id="K4os.Compression.LZ4.Streams" version="1.3.5" 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.EntityFramework" version="8.0.21" targetFramework="net472" />
|
||||
<package id="Newtonsoft.Json" version="13.0.1" targetFramework="net452" />
|
||||
<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="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.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>
|
||||
@@ -118,6 +118,7 @@ Public Class CALCPanelVM
|
||||
End Sub
|
||||
|
||||
Private Shared Sub ProcessResults(Bar As Bar)
|
||||
If IsNothing(Bar) Then Return
|
||||
|
||||
' disabilito impostazione modificato
|
||||
Dim DisableMgr As New DisableModifiedMgr
|
||||
@@ -148,7 +149,7 @@ Public Class CALCPanelVM
|
||||
|
||||
If line.StartsWith("ERR=") Then
|
||||
Dim nVal As Integer? = GetVal(line, "ERR")
|
||||
nErr = (If(nVal IsNot Nothing, nVal.Value, 0))
|
||||
nErr = (If(Not IsNothing(nVal), nVal.Value, 0))
|
||||
sMsg = ""
|
||||
dRot = 0
|
||||
nFall = 0
|
||||
@@ -156,24 +157,24 @@ Public Class CALCPanelVM
|
||||
taskId = 0
|
||||
ElseIf line.StartsWith("ROT=") Then
|
||||
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)
|
||||
dPartRot = Math.Max(dPartRot, dRot)
|
||||
dTotRot = Math.Max(dTotRot, dRot)
|
||||
ElseIf line.StartsWith("CUTID=") Then
|
||||
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
|
||||
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)
|
||||
ElseIf line.StartsWith("FALL=") Then
|
||||
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))
|
||||
ElseIf line.StartsWith("TIME=") Then
|
||||
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))
|
||||
'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)
|
||||
@@ -216,23 +217,25 @@ Public Class CALCPanelVM
|
||||
End If
|
||||
Select Case Line.Type
|
||||
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
|
||||
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
|
||||
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
|
||||
CurrPartVM.CalcFallUpdate(Line.nFALL)
|
||||
If Not IsNothing(CurrPartVM) Then CurrPartVM.CalcFallUpdate(Line.nFALL)
|
||||
Case ProcessResult.ProcessResultTypes.TIME
|
||||
If IsNothing(CurrMachgroupVM) Then CurrMachgroupVM = GetMachgroupVMFromMachgroupId(Bar.nBarId)
|
||||
CurrMachgroupVM.CalcTimeUpdate(Line.nTIME)
|
||||
If Not IsNothing(CurrMachgroupVM) Then CurrMachgroupVM.CalcTimeUpdate(Line.nTIME)
|
||||
End Select
|
||||
Next
|
||||
Machgroup = GetMachgroupVMFromMachgroupId(Bar.nBarId)
|
||||
For Each Part In Machgroup.PartVMList
|
||||
Part.CalcGlobalUpdate()
|
||||
Next
|
||||
Machgroup.CalcGlobalUpdate()
|
||||
If Not IsNothing(Machgroup) Then
|
||||
For Each Part In Machgroup.PartVMList
|
||||
Part.CalcGlobalUpdate()
|
||||
Next
|
||||
Machgroup.CalcGlobalUpdate()
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
|
||||
@@ -474,7 +474,7 @@ Public Class NUMAxiumComm
|
||||
Friend Sub WriteNCVariables(Address As String, value As String)
|
||||
Try
|
||||
Dim dValue As Double = 0
|
||||
StringToDouble(value, dValue)
|
||||
StringToDoubleAdv(value, dValue)
|
||||
Dim rc As Short = objDVariables.WriteVariables(objDGroupManager.Handle, Address, value)
|
||||
|
||||
'If rc <> 0 Then EgtOutLog(" objDVariables.WriteVariables2() Error : " & rc)
|
||||
|
||||
@@ -467,7 +467,7 @@ Public Class NUMAxiumPcToolkitComm
|
||||
Friend Sub WritePlcVariables(Address As String, value As String)
|
||||
Try
|
||||
Dim dValue As Double = 0
|
||||
StringToDouble(value, dValue)
|
||||
StringToDoubleAdv(value, dValue)
|
||||
Select Case Address
|
||||
Case "E30099" ' in realta' per scrivere si usa la %RD0C.L
|
||||
Dim nRes = WriteLadderVar(m_nPortWVariables, RL, &HD0C, 1, dValue)
|
||||
@@ -641,7 +641,6 @@ Public Class NUMAxiumPcToolkitComm
|
||||
Dim FileTransferThread As New Thread(Sub()
|
||||
' 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
|
||||
@@ -649,8 +648,7 @@ Public Class NUMAxiumPcToolkitComm
|
||||
EgtOutLog("Inizio ciclo verifica diverso da 2")
|
||||
' leggo valore
|
||||
If Not IsNothing(SendPermissionVariable.sValue) Then
|
||||
StringToDouble(SendPermissionVariable.sValue, dTemp)
|
||||
Integer.TryParse(dTemp, nSendPermission)
|
||||
Integer.TryParse(SendPermissionVariable.sValue, nSendPermission)
|
||||
EgtOutLog("Lettura variabile E30099: " & nSendPermission)
|
||||
Else
|
||||
EgtOutLog("nSendPermission = -1")
|
||||
@@ -798,7 +796,7 @@ Public Class NUMAxiumPcToolkitComm
|
||||
Friend Sub WriteNCVariables(Address As String, value As String)
|
||||
Try
|
||||
Dim dValue As Double = 0
|
||||
StringToDouble(value, dValue)
|
||||
StringToDoubleAdv(value, dValue)
|
||||
Dim nType As eVarious4
|
||||
Dim nValue As Integer = 0
|
||||
Dim MyData As New My_data_struct
|
||||
|
||||
@@ -378,7 +378,7 @@ Public Class NUMFlexiumComm
|
||||
' EgtOutLog("Inizio ciclo verifica diverso da 2")
|
||||
' ' leggo valore
|
||||
' If Not IsNothing(SendPermissionVariable.sValue) Then
|
||||
' StringToDouble(SendPermissionVariable.sValue, dTemp)
|
||||
' StringToDoubleAdv(SendPermissionVariable.sValue, dTemp)
|
||||
' Integer.TryParse(dTemp, nSendPermission)
|
||||
' EgtOutLog("Lettura variabile E30099: " & nSendPermission)
|
||||
' Else
|
||||
@@ -449,7 +449,7 @@ Public Class NUMFlexiumComm
|
||||
Friend Sub WriteNCVariables(Address As String, value As String)
|
||||
Try
|
||||
Dim dValue As Double = 0
|
||||
StringToDouble(value, dValue)
|
||||
StringToDoubleAdv(value, dValue)
|
||||
Dim rc As Short = objDVariables.WriteVariables2(2, objDGroupManager.Handle, Address, dValue)
|
||||
|
||||
If rc <> 0 Then EgtOutLog(" objDVariables.WriteVariables2() Error : " & rc)
|
||||
|
||||
@@ -102,6 +102,38 @@
|
||||
<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>
|
||||
<Reference Include="APLog">
|
||||
<HintPath>..\ExtLibs\APLog.dll</HintPath>
|
||||
@@ -111,8 +143,8 @@
|
||||
<HintPath>..\ExtLibs\APServer.dll</HintPath>
|
||||
<EmbedInteropTypes>True</EmbedInteropTypes>
|
||||
</Reference>
|
||||
<Reference Include="BouncyCastle.Crypto, Version=1.8.5.0, Culture=neutral, PublicKeyToken=0e99375e54769942">
|
||||
<HintPath>..\packages\BouncyCastle.1.8.5\lib\BouncyCastle.Crypto.dll</HintPath>
|
||||
<Reference Include="BouncyCastle.Crypto, Version=1.9.0.0, Culture=neutral, PublicKeyToken=0e99375e54769942, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Portable.BouncyCastle.1.9.0\lib\net40\BouncyCastle.Crypto.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Csv, Version=1.0.31.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Csv.1.0.31\lib\net40\Csv.dll</HintPath>
|
||||
@@ -134,8 +166,8 @@
|
||||
<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>
|
||||
</Reference>
|
||||
<Reference Include="Google.Protobuf, Version=3.19.4.0, Culture=neutral, PublicKeyToken=a7d26565bac4d604, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Google.Protobuf.3.19.4\lib\net45\Google.Protobuf.dll</HintPath>
|
||||
<Reference Include="Google.Protobuf, Version=3.21.9.0, Culture=neutral, PublicKeyToken=a7d26565bac4d604, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Google.Protobuf.3.21.9\lib\net45\Google.Protobuf.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Interop.FXLog">
|
||||
<HintPath>..\ExtLibs\Interop.FXLog.dll</HintPath>
|
||||
@@ -151,14 +183,14 @@
|
||||
<Reference Include="ISOCNC.Remoting">
|
||||
<HintPath>..\ExtLibs\ISOCNC.Remoting.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="K4os.Compression.LZ4, Version=1.2.6.0, Culture=neutral, PublicKeyToken=2186fa9121ef231d, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\K4os.Compression.LZ4.1.2.6\lib\net46\K4os.Compression.LZ4.dll</HintPath>
|
||||
<Reference Include="K4os.Compression.LZ4, Version=1.3.5.0, Culture=neutral, PublicKeyToken=2186fa9121ef231d, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\K4os.Compression.LZ4.1.3.5\lib\net462\K4os.Compression.LZ4.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="K4os.Compression.LZ4.Streams, Version=1.2.6.0, Culture=neutral, PublicKeyToken=2186fa9121ef231d, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\K4os.Compression.LZ4.Streams.1.2.6\lib\net46\K4os.Compression.LZ4.Streams.dll</HintPath>
|
||||
<Reference Include="K4os.Compression.LZ4.Streams, Version=1.3.5.0, Culture=neutral, PublicKeyToken=2186fa9121ef231d, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\K4os.Compression.LZ4.Streams.1.3.5\lib\net462\K4os.Compression.LZ4.Streams.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="K4os.Hash.xxHash, Version=1.0.6.0, Culture=neutral, PublicKeyToken=32cd54395057cec3, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\K4os.Hash.xxHash.1.0.6\lib\net46\K4os.Hash.xxHash.dll</HintPath>
|
||||
<Reference Include="K4os.Hash.xxHash, Version=1.0.8.0, Culture=neutral, PublicKeyToken=32cd54395057cec3, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\K4os.Hash.xxHash.1.0.8\lib\net462\K4os.Hash.xxHash.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
<Reference Include="Microsoft.DotNet.PlatformAbstractions, Version=2.1.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
|
||||
@@ -210,9 +242,12 @@
|
||||
<Reference Include="System.Drawing" />
|
||||
<Reference Include="System.Drawing.Design" />
|
||||
<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.Memory, Version=4.0.1.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Memory.4.5.4\lib\net461\System.Memory.dll</HintPath>
|
||||
<Reference Include="System.Memory, Version=4.0.1.2, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Memory.4.5.5\lib\net461\System.Memory.dll</HintPath>
|
||||
</Reference>
|
||||
<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>
|
||||
@@ -228,8 +263,8 @@
|
||||
<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>
|
||||
</Reference>
|
||||
<Reference Include="System.Runtime.CompilerServices.Unsafe, Version=5.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>
|
||||
<Reference Include="System.Runtime.CompilerServices.Unsafe, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Runtime.CompilerServices.Unsafe.6.0.0\lib\net461\System.Runtime.CompilerServices.Unsafe.dll</HintPath>
|
||||
</Reference>
|
||||
<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>
|
||||
@@ -238,6 +273,9 @@
|
||||
</Reference>
|
||||
<Reference Include="System.Runtime.Remoting" />
|
||||
<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.Web" />
|
||||
<Reference Include="System.Windows.Forms" />
|
||||
|
||||
@@ -40,7 +40,7 @@ Public Class LeftPanelVM
|
||||
Return m_SelChannel
|
||||
End Get
|
||||
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
|
||||
End Set
|
||||
End Property
|
||||
@@ -86,7 +86,7 @@ Public Class LeftPanelVM
|
||||
Return m_SelOPMode
|
||||
End Get
|
||||
Set(ByVal value As OPState)
|
||||
MachManaging.CommandList.Add(ThreadCommand.CreateCommand(CommandTypes.SETOPMODE, value.Id))
|
||||
MachManaging.AddToCommandList(ThreadCommand.CreateCommand(CommandTypes.SETOPMODE, value.Id))
|
||||
' se MDI
|
||||
If value.Id = OPModes.Mdi Then
|
||||
' mostro pagina comandi MDI
|
||||
|
||||
@@ -163,7 +163,7 @@ Public Class MDIPageVM
|
||||
''' </summary>
|
||||
Friend Sub SendMDI()
|
||||
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 Sub
|
||||
|
||||
|
||||
@@ -427,11 +427,11 @@ Public Class MachCommandMessagePanelVM
|
||||
End Property
|
||||
|
||||
Public Sub Disconnect()
|
||||
MachManaging.CommandList.Add(ThreadCommand.CreateCommand(CommandTypes.DISCONNECT))
|
||||
MachManaging.AddToCommandList(ThreadCommand.CreateCommand(CommandTypes.DISCONNECT))
|
||||
End Sub
|
||||
|
||||
Public Sub SetOPState(OpState As Integer)
|
||||
MachManaging.CommandList.Add(ThreadCommand.CreateCommand(CommandTypes.SETOPMODE))
|
||||
MachManaging.AddToCommandList(ThreadCommand.CreateCommand(CommandTypes.SETOPMODE))
|
||||
End Sub
|
||||
|
||||
Public ReadOnly Property Start_Command As ICommand
|
||||
@@ -442,7 +442,7 @@ Public Class MachCommandMessagePanelVM
|
||||
End Property
|
||||
|
||||
Public Sub Start(ByVal param As Object)
|
||||
MachManaging.CommandList.Add(ThreadCommand.CreateCommand(CommandTypes.START))
|
||||
MachManaging.AddToCommandList(ThreadCommand.CreateCommand(CommandTypes.START))
|
||||
End Sub
|
||||
|
||||
Public ReadOnly Property Stop_Command As ICommand
|
||||
@@ -453,7 +453,7 @@ Public Class MachCommandMessagePanelVM
|
||||
End Property
|
||||
|
||||
Public Sub [Stop](ByVal param As Object)
|
||||
MachManaging.CommandList.Add(ThreadCommand.CreateCommand(CommandTypes.STOP_))
|
||||
MachManaging.AddToCommandList(ThreadCommand.CreateCommand(CommandTypes.STOP_))
|
||||
End Sub
|
||||
|
||||
Public ReadOnly Property Reset_Command As ICommand
|
||||
@@ -464,7 +464,7 @@ Public Class MachCommandMessagePanelVM
|
||||
End Property
|
||||
|
||||
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
|
||||
If Not IsNothing(Map.refProjectVM.SupervisorMachGroupPanelVM) Then Map.refProjectVM.SupervisorMachGroupPanelVM.ResetAllMachGroups()
|
||||
End Sub
|
||||
@@ -477,7 +477,7 @@ Public Class MachCommandMessagePanelVM
|
||||
End Property
|
||||
|
||||
Public Sub [Step](ByVal param As Object)
|
||||
MachManaging.CommandList.Add(ThreadCommand.CreateCommand(CommandTypes.STEP_))
|
||||
MachManaging.AddToCommandList(ThreadCommand.CreateCommand(CommandTypes.STEP_))
|
||||
End Sub
|
||||
|
||||
Public ReadOnly Property SetPoint_Command As ICommand
|
||||
@@ -488,7 +488,7 @@ Public Class MachCommandMessagePanelVM
|
||||
End Property
|
||||
|
||||
Public Sub SetPoint(ByVal param As Object)
|
||||
MachManaging.CommandList.Add(ThreadCommand.CreateCommand(CommandTypes.SETPOINT))
|
||||
MachManaging.AddToCommandList(ThreadCommand.CreateCommand(CommandTypes.SETPOINT))
|
||||
End Sub
|
||||
|
||||
|
||||
@@ -500,7 +500,7 @@ Public Class MachCommandMessagePanelVM
|
||||
End Property
|
||||
|
||||
Public Sub DeleteAlarms(ByVal param As Object)
|
||||
MachManaging.CommandList.Add(ThreadCommand.CreateCommand(CommandTypes.DELETEALARMS))
|
||||
MachManaging.AddToCommandList(ThreadCommand.CreateCommand(CommandTypes.DELETEALARMS))
|
||||
End Sub
|
||||
|
||||
Public Function GetVarPathByName(Name As String) As String
|
||||
|
||||
@@ -132,7 +132,7 @@ Public Class MyMachGroupVM
|
||||
EgtGetInfo(Id, MGR_RPT_PART & 1, sInfo)
|
||||
If Not String.IsNullOrWhiteSpace(sInfo) Then
|
||||
sSplitInfo = sInfo.Split(","c)
|
||||
StringToDouble(sSplitInfo(1), MyMachGroupM.dStartCut)
|
||||
StringToDoubleAdv(sSplitInfo(1), MyMachGroupM.dStartCut)
|
||||
Else
|
||||
MyMachGroupM.dStartCut = 0
|
||||
End If
|
||||
|
||||
@@ -10,6 +10,9 @@ Imports EgtBEAMWALL.Supervisor.CommVar
|
||||
|
||||
Public Class MachManaging
|
||||
|
||||
' lock per aggiunta elemento a lista MachGroup
|
||||
Private Shared Lock_CommandList As New Object
|
||||
|
||||
Private m_bConnected As Boolean = False
|
||||
Public ReadOnly Property bConnected As Boolean
|
||||
Get
|
||||
@@ -53,6 +56,22 @@ Public Class MachManaging
|
||||
Return m_CommandList
|
||||
End Get
|
||||
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
|
||||
Public ReadOnly Property StartPending As Boolean
|
||||
@@ -286,70 +305,59 @@ Public Class MachManaging
|
||||
Dim dTemp As Double = 0
|
||||
Dim nTemp As Integer = 0
|
||||
If Not IsNothing(ResetVariable.sValue) Then
|
||||
StringToDouble(ResetVariable.sValue, dTemp)
|
||||
Integer.TryParse(dTemp, nReset_State)
|
||||
Integer.TryParse(ResetVariable.sValue, nReset_State)
|
||||
Else
|
||||
nReset_State = 1
|
||||
End If
|
||||
If Not IsNothing(StartVariable.sValue) Then
|
||||
StringToDouble(StartVariable.sValue, dTemp)
|
||||
Integer.TryParse(dTemp, nTemp)
|
||||
Integer.TryParse(StartVariable.sValue, nTemp)
|
||||
nStart_State = (nTemp = 1)
|
||||
Else
|
||||
nStart_State = -1
|
||||
End If
|
||||
If Not IsNothing(StopVariable.sValue) Then
|
||||
StringToDouble(StopVariable.sValue, dTemp)
|
||||
Integer.TryParse(dTemp, nTemp)
|
||||
Integer.TryParse(StopVariable.sValue, nTemp)
|
||||
nStop_State = (nTemp = 1)
|
||||
Else
|
||||
nStop_State = -1
|
||||
End If
|
||||
If Not IsNothing(ProdVariable.sValue) Then
|
||||
StringToDouble(ProdVariable.sValue, dTemp)
|
||||
Integer.TryParse(dTemp, nP_Prod)
|
||||
Integer.TryParse(ProdVariable.sValue, nP_Prod)
|
||||
Else
|
||||
nP_Prod = -1
|
||||
End If
|
||||
If Not IsNothing(MachGroupVariable.sValue) Then
|
||||
StringToDouble(MachGroupVariable.sValue, dTemp)
|
||||
Integer.TryParse(dTemp, nP_Machgroup)
|
||||
Integer.TryParse(MachGroupVariable.sValue, nP_Machgroup)
|
||||
Else
|
||||
nP_Machgroup = -1
|
||||
End If
|
||||
If Not IsNothing(PartVariable.sValue) Then
|
||||
StringToDouble(PartVariable.sValue, dTemp)
|
||||
Integer.TryParse(dTemp, nP_Part)
|
||||
Integer.TryParse(PartVariable.sValue, nP_Part)
|
||||
Else
|
||||
nP_Part = -1
|
||||
End If
|
||||
If Not IsNothing(StateVariable.sValue) Then
|
||||
StringToDouble(StateVariable.sValue, dTemp)
|
||||
Integer.TryParse(dTemp, nP_State)
|
||||
Integer.TryParse(StateVariable.sValue, nP_State)
|
||||
Else
|
||||
nP_State = -1
|
||||
End If
|
||||
If Not IsNothing(ISONumVariable.sValue) Then
|
||||
StringToDouble(ISONumVariable.sValue, dTemp)
|
||||
Integer.TryParse(dTemp, nISO_Num)
|
||||
Integer.TryParse(ISONumVariable.sValue, nISO_Num)
|
||||
Else
|
||||
nISO_Num = -1
|
||||
End If
|
||||
If Not IsNothing(ISOSentVariable.sValue) Then
|
||||
StringToDouble(ISOSentVariable.sValue, dTemp)
|
||||
Integer.TryParse(dTemp, nISO_Sent)
|
||||
Integer.TryParse(ISOSentVariable.sValue, nISO_Sent)
|
||||
Else
|
||||
nISO_Sent = -1
|
||||
End If
|
||||
If Not IsNothing(RunningVariable.sValue) Then
|
||||
StringToDouble(RunningVariable.sValue, dTemp)
|
||||
Integer.TryParse(dTemp, nRunning)
|
||||
Integer.TryParse(RunningVariable.sValue, nRunning)
|
||||
Else
|
||||
nRunning = -1
|
||||
End If
|
||||
If Not IsNothing(MachIndexVariable.sValue) Then
|
||||
StringToDouble(MachIndexVariable.sValue, dTemp)
|
||||
Integer.TryParse(dTemp, nCurrMachIndex)
|
||||
Integer.TryParse(MachIndexVariable.sValue, nCurrMachIndex)
|
||||
Else
|
||||
nCurrMachIndex = -1
|
||||
End If
|
||||
@@ -366,70 +374,59 @@ Public Class MachManaging
|
||||
Dim dTemp As Double = 0
|
||||
Dim nTemp As Integer = 0
|
||||
If Not IsNothing(ResetVariable.sValue) Then
|
||||
StringToDouble(ResetVariable.sValue, dTemp)
|
||||
Integer.TryParse(dTemp, nReset_State)
|
||||
Integer.TryParse(ResetVariable.sValue, nReset_State)
|
||||
Else
|
||||
nReset_State = 1
|
||||
End If
|
||||
If Not IsNothing(StartVariable.sValue) Then
|
||||
StringToDouble(StartVariable.sValue, dTemp)
|
||||
Integer.TryParse(dTemp, nTemp)
|
||||
Integer.TryParse(StartVariable.sValue, nTemp)
|
||||
nStart_State = (nTemp = 1)
|
||||
Else
|
||||
nStart_State = -1
|
||||
End If
|
||||
If Not IsNothing(StopVariable.sValue) Then
|
||||
StringToDouble(StopVariable.sValue, dTemp)
|
||||
Integer.TryParse(dTemp, nTemp)
|
||||
Integer.TryParse(StopVariable.sValue, nTemp)
|
||||
nStop_State = (nTemp = 1)
|
||||
Else
|
||||
nStop_State = -1
|
||||
End If
|
||||
If Not IsNothing(ProdVariable.sValue) Then
|
||||
StringToDouble(ProdVariable.sValue, dTemp)
|
||||
Integer.TryParse(dTemp, nP_Prod)
|
||||
Integer.TryParse(ProdVariable.sValue, nP_Prod)
|
||||
Else
|
||||
nP_Prod = -1
|
||||
End If
|
||||
If Not IsNothing(MachGroupVariable.sValue) Then
|
||||
StringToDouble(MachGroupVariable.sValue, dTemp)
|
||||
Integer.TryParse(dTemp, nP_Machgroup)
|
||||
Integer.TryParse(MachGroupVariable.sValue, nP_Machgroup)
|
||||
Else
|
||||
nP_Machgroup = -1
|
||||
End If
|
||||
If Not IsNothing(PartVariable.sValue) Then
|
||||
StringToDouble(PartVariable.sValue, dTemp)
|
||||
Integer.TryParse(dTemp, nP_Part)
|
||||
Integer.TryParse(PartVariable.sValue, nP_Part)
|
||||
Else
|
||||
nP_Part = -1
|
||||
End If
|
||||
If Not IsNothing(StateVariable.sValue) Then
|
||||
StringToDouble(StateVariable.sValue, dTemp)
|
||||
Integer.TryParse(dTemp, nP_State)
|
||||
Integer.TryParse(StateVariable.sValue, nP_State)
|
||||
Else
|
||||
nP_State = -1
|
||||
End If
|
||||
If Not IsNothing(ISONumVariable.sValue) Then
|
||||
StringToDouble(ISONumVariable.sValue, dTemp)
|
||||
Integer.TryParse(dTemp, nISO_Num)
|
||||
Integer.TryParse(ISONumVariable.sValue, nISO_Num)
|
||||
Else
|
||||
nISO_Num = -1
|
||||
End If
|
||||
If Not IsNothing(ISOSentVariable.sValue) Then
|
||||
StringToDouble(ISOSentVariable.sValue, dTemp)
|
||||
Integer.TryParse(dTemp, nISO_Sent)
|
||||
Integer.TryParse(ISOSentVariable.sValue, nISO_Sent)
|
||||
Else
|
||||
nISO_Sent = -1
|
||||
End If
|
||||
If Not IsNothing(RunningVariable.sValue) Then
|
||||
StringToDouble(RunningVariable.sValue, dTemp)
|
||||
Integer.TryParse(dTemp, nRunning)
|
||||
Integer.TryParse(RunningVariable.sValue, nRunning)
|
||||
Else
|
||||
nRunning = -1
|
||||
End If
|
||||
If Not IsNothing(MachIndexVariable.sValue) Then
|
||||
StringToDouble(MachIndexVariable.sValue, dTemp)
|
||||
Integer.TryParse(dTemp, nCurrMachIndex)
|
||||
Integer.TryParse(MachIndexVariable.sValue, nCurrMachIndex)
|
||||
Else
|
||||
nCurrMachIndex = -1
|
||||
End If
|
||||
@@ -469,7 +466,7 @@ Public Class MachManaging
|
||||
Else
|
||||
OpState = OPStates.End
|
||||
End If
|
||||
If OpState <> Map.refLeftPanelVM.SelOPState.Id Then
|
||||
If IsNothing(Map.refLeftPanelVM.SelOPState) OrElse OpState <> Map.refLeftPanelVM.SelOPState.Id Then
|
||||
m_OpStateCallbackDlg(OpState)
|
||||
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)
|
||||
' se pezzo = -1 devo dare start a tutti i pezzi del MachGroup
|
||||
If nP_Part = -1 Then
|
||||
For Each Part In MachGroup.PartVMList
|
||||
' scrivo data start su Db pezzo
|
||||
DbControllers.m_PartController.UpdateStart(nP_Prod, nP_Machgroup, Part.nPartId, dtStart)
|
||||
DbControllers.m_PartController.UpdateStatus(nP_Prod, nP_Machgroup, Part.nPartId, ItemState.WIP)
|
||||
' scrivo stato start
|
||||
Part.nProduction_State = ItemState.WIP
|
||||
Part.dtStartTime = dtStart
|
||||
Part.NotifyPropertyChanged(NameOf(Part.nProduction_State))
|
||||
' scrivo evento inizio pezzo su DB
|
||||
DbControllers.m_LogMachineController.Create(LogEvent.CreatePartStateLog(dtStart, nP_Prod, nP_Machgroup, Part.nPartId, nP_State, DbControllers.SupervisorId))
|
||||
Next
|
||||
If Not IsNothing(MachGroup) Then
|
||||
For Each Part In MachGroup.PartVMList
|
||||
' scrivo data start su Db pezzo
|
||||
DbControllers.m_PartController.UpdateStart(nP_Prod, nP_Machgroup, Part.nPartId, dtStart)
|
||||
DbControllers.m_PartController.UpdateStatus(nP_Prod, nP_Machgroup, Part.nPartId, ItemState.WIP)
|
||||
' scrivo stato start
|
||||
Part.nProduction_State = ItemState.WIP
|
||||
Part.dtStartTime = dtStart
|
||||
Part.NotifyPropertyChanged(NameOf(Part.nProduction_State))
|
||||
' scrivo evento inizio pezzo su DB
|
||||
DbControllers.m_LogMachineController.Create(LogEvent.CreatePartStateLog(dtStart, nP_Prod, nP_Machgroup, Part.nPartId, nP_State, DbControllers.SupervisorId))
|
||||
Next
|
||||
End If
|
||||
Else
|
||||
' scrivo data start su Db pezzo
|
||||
DbControllers.m_PartController.UpdateStart(nP_Prod, nP_Machgroup, nP_Part, dtStart)
|
||||
DbControllers.m_PartController.UpdateStatus(nP_Prod, nP_Machgroup, nP_Part, ItemState.WIP)
|
||||
' recupero pezzo
|
||||
Dim Part As PartVM = MachGroup.PartVMList.FirstOrDefault(Function(x) x.nPartId = nP_Part)
|
||||
' scrivo stato start
|
||||
Part.nProduction_State = ItemState.WIP
|
||||
Part.dtStartTime = dtStart
|
||||
Part.NotifyPropertyChanged(NameOf(Part.nProduction_State))
|
||||
If Not IsNothing(MachGroup) Then
|
||||
' recupero pezzo
|
||||
Dim Part As PartVM = MachGroup.PartVMList.FirstOrDefault(Function(x) x.nPartId = nP_Part)
|
||||
If Not IsNothing(Part) Then
|
||||
' scrivo stato start
|
||||
Part.nProduction_State = ItemState.WIP
|
||||
Part.dtStartTime = dtStart
|
||||
Part.NotifyPropertyChanged(NameOf(Part.nProduction_State))
|
||||
End If
|
||||
End If
|
||||
' scrivo evento inizio pezzo su DB
|
||||
DbControllers.m_LogMachineController.Create(LogEvent.CreatePartStateLog(dtStart, nP_Prod, nP_Machgroup, nP_Part, nP_State, DbControllers.SupervisorId))
|
||||
End If
|
||||
@@ -577,9 +580,11 @@ Public Class MachManaging
|
||||
DbControllers.m_MachGroupController.UpdateStart(nP_Prod, nP_Machgroup, dtStart)
|
||||
DbControllers.m_MachGroupController.UpdateStatus(nP_Prod, nP_Machgroup, ItemState.WIP)
|
||||
' scrivo stato start
|
||||
MachGroup.MyMachGroupM.SetProductionState(ItemState.WIP)
|
||||
MachGroup.dtStartTime = dtStart
|
||||
MachGroup.NotifyPropertyChanged(NameOf(MachGroup.nProduction_State))
|
||||
If Not IsNothing(MachGroup) Then
|
||||
MachGroup.MyMachGroupM.SetProductionState(ItemState.WIP)
|
||||
MachGroup.dtStartTime = dtStart
|
||||
MachGroup.NotifyPropertyChanged(NameOf(MachGroup.nProduction_State))
|
||||
End If
|
||||
' scrivo evento inizio MachGroup su DB
|
||||
DbControllers.m_LogMachineController.Create(LogEvent.CreateMachGroupStateLog(dtStart, nP_Prod, nP_Machgroup, nP_State, DbControllers.SupervisorId))
|
||||
End If
|
||||
@@ -591,44 +596,50 @@ Public Class MachManaging
|
||||
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
|
||||
If nP_Part = -1 Then
|
||||
For Each Part In MachGroup.PartVMList
|
||||
' scrivo data end su Db pezzo
|
||||
DbControllers.m_PartController.UpdateEnd(nP_Prod, nP_Machgroup, Part.nPartId, dtEnd)
|
||||
DbControllers.m_PartController.UpdateStatus(nP_Prod, nP_Machgroup, Part.nPartId, ItemState.Produced)
|
||||
' scrivo stato end
|
||||
Part.nProduction_State = ItemState.Produced
|
||||
Part.dtEndTime = dtEnd
|
||||
Part.NotifyPropertyChanged(NameOf(Part.nProduction_State))
|
||||
' resetto stato redo
|
||||
Part.bRedo = False
|
||||
' se non impostata data start
|
||||
If Part.dtStartTime = DateTime.MinValue Then
|
||||
' scrivo data start su Db pezzo
|
||||
Dim dtStart As DateTime = Part.dtEndTime - TimeSpan.FromSeconds(60)
|
||||
DbControllers.m_PartController.UpdateStart(nP_Prod, nP_Machgroup, Part.nPartId, dtStart)
|
||||
Part.dtStartTime = dtStart
|
||||
End If
|
||||
' scrivo evento fine pezzo su DB
|
||||
DbControllers.m_LogMachineController.Create(LogEvent.CreatePartStateLog(dtEnd, nP_Prod, nP_Machgroup, Part.nPartId, nP_State, DbControllers.SupervisorId))
|
||||
Next
|
||||
If Not IsNothing(MachGroup) Then
|
||||
For Each Part In MachGroup.PartVMList
|
||||
' scrivo data end su Db pezzo
|
||||
DbControllers.m_PartController.UpdateEnd(nP_Prod, nP_Machgroup, Part.nPartId, dtEnd)
|
||||
DbControllers.m_PartController.UpdateStatus(nP_Prod, nP_Machgroup, Part.nPartId, ItemState.Produced)
|
||||
' scrivo stato end
|
||||
Part.nProduction_State = ItemState.Produced
|
||||
Part.dtEndTime = dtEnd
|
||||
Part.NotifyPropertyChanged(NameOf(Part.nProduction_State))
|
||||
' resetto stato redo
|
||||
Part.bRedo = False
|
||||
' se non impostata data start
|
||||
If Part.dtStartTime = DateTime.MinValue Then
|
||||
' scrivo data start su Db pezzo
|
||||
Dim dtStart As DateTime = Part.dtEndTime - TimeSpan.FromSeconds(60)
|
||||
DbControllers.m_PartController.UpdateStart(nP_Prod, nP_Machgroup, Part.nPartId, dtStart)
|
||||
Part.dtStartTime = dtStart
|
||||
End If
|
||||
' scrivo evento fine pezzo su DB
|
||||
DbControllers.m_LogMachineController.Create(LogEvent.CreatePartStateLog(dtEnd, nP_Prod, nP_Machgroup, Part.nPartId, nP_State, DbControllers.SupervisorId))
|
||||
Next
|
||||
End If
|
||||
Else
|
||||
' scrivo data end su Db pezzo
|
||||
DbControllers.m_PartController.UpdateEnd(nP_Prod, nP_Machgroup, nP_Part, dtEnd)
|
||||
DbControllers.m_PartController.UpdateStatus(nP_Prod, nP_Machgroup, nP_Part, ItemState.Produced)
|
||||
' recupero pezzo
|
||||
Dim Part As PartVM = MachGroup.PartVMList.FirstOrDefault(Function(x) x.nPartId = nP_Part)
|
||||
' scrivo stato end
|
||||
Part.nProduction_State = ItemState.Produced
|
||||
Part.dtEndTime = dtEnd
|
||||
Part.NotifyPropertyChanged(NameOf(Part.nProduction_State))
|
||||
' resetto stato redo
|
||||
Part.bRedo = False
|
||||
If Not IsNothing(MachGroup) Then
|
||||
' recupero pezzo
|
||||
Dim Part As PartVM = MachGroup.PartVMList.FirstOrDefault(Function(x) x.nPartId = nP_Part)
|
||||
If Not IsNothing(Part) Then
|
||||
' scrivo stato end
|
||||
Part.nProduction_State = ItemState.Produced
|
||||
Part.dtEndTime = dtEnd
|
||||
Part.NotifyPropertyChanged(NameOf(Part.nProduction_State))
|
||||
' resetto stato redo
|
||||
Part.bRedo = False
|
||||
End If
|
||||
End If
|
||||
' scrivo evento fine pezzo su DB
|
||||
DbControllers.m_LogMachineController.Create(LogEvent.CreatePartStateLog(dtEnd, nP_Prod, nP_Machgroup, nP_Part, nP_State, DbControllers.SupervisorId))
|
||||
End If
|
||||
|
||||
' 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
|
||||
DbControllers.m_MachGroupController.UpdateEnd(nP_Prod, nP_Machgroup, dtEnd)
|
||||
DbControllers.m_MachGroupController.UpdateStatus(nP_Prod, nP_Machgroup, ItemState.Produced)
|
||||
@@ -646,7 +657,7 @@ Public Class MachManaging
|
||||
|
||||
' se non impostata data start
|
||||
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)
|
||||
' provo a recuperare tempo stimato
|
||||
If MachGroup.nCALC_TIME > 0 Then
|
||||
@@ -674,13 +685,17 @@ Public Class MachManaging
|
||||
End If
|
||||
' se pezzo = -1 stampo etichette di tutti i pezzi del MachGroup
|
||||
If nP_Part = -1 Then
|
||||
For Each Part In MachGroup.PartVMList
|
||||
Map.refLeftPanelVM.PrintLabel(MachGroup, Part)
|
||||
Next
|
||||
If Not IsNothing(MachGroup) Then
|
||||
For Each Part In MachGroup.PartVMList
|
||||
Map.refLeftPanelVM.PrintLabel(MachGroup, Part)
|
||||
Next
|
||||
End If
|
||||
Else
|
||||
' recupero pezzo
|
||||
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
|
||||
' attesa per essere sicuro che abbia scritto e riletto variabili
|
||||
Threading.Thread.Sleep(300)
|
||||
@@ -706,7 +721,7 @@ Public Class MachManaging
|
||||
For VParIndex = 1 To sVs.Length - 1
|
||||
Dim VPar() As String = sVs(VParIndex).Split("="c)
|
||||
VPar(1) = VPar(1).Trim
|
||||
StringToDouble(VPar(1), dVPars(VParIndex - 1))
|
||||
StringToDoubleAdv(VPar(1), dVPars(VParIndex - 1))
|
||||
Next
|
||||
' li scrivo nel CN
|
||||
For Index As Integer = 1 To 10
|
||||
@@ -726,7 +741,7 @@ Public Class MachManaging
|
||||
End Function
|
||||
|
||||
Private Function SendNextProgram() As Boolean
|
||||
EgtOutLog("Inizio SendNextProgram")
|
||||
' EgtOutLog("Inizio SendNextProgram")
|
||||
Dim bSent As Boolean = False
|
||||
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
|
||||
@@ -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
|
||||
' verifico se c'e' un programma da lanciare
|
||||
If Not IsNothing(Map.refProjectVM.SupervisorMachGroupPanelVM) Then
|
||||
EgtOutLog("Start " & DateTime.Now())
|
||||
' EgtOutLog("Start " & DateTime.Now())
|
||||
Dim bMachGroupNotReady As Boolean = False
|
||||
SyncLock m_Lock_SendProgram
|
||||
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
|
||||
(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
|
||||
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
|
||||
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
|
||||
Case NCTypes.TPA
|
||||
MyMachGroup.SetSentToMachine(bSent)
|
||||
@@ -759,7 +774,7 @@ Public Class MachManaging
|
||||
Else
|
||||
' programma non ancora pronto, esco per attendere
|
||||
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
|
||||
'Return False
|
||||
End If
|
||||
@@ -767,7 +782,7 @@ Public Class MachManaging
|
||||
Next
|
||||
End SyncLock
|
||||
If bMachGroupNotReady Then Return False
|
||||
EgtOutLog("End " & DateTime.Now())
|
||||
' EgtOutLog("End " & DateTime.Now())
|
||||
End If
|
||||
End If
|
||||
Return bSent
|
||||
@@ -775,10 +790,17 @@ Public Class MachManaging
|
||||
|
||||
Private Sub CommandList_CollectionChanged(sender As Object, e As NotifyCollectionChangedEventArgs)
|
||||
If Not IsNothing(e.NewItems) Then
|
||||
For Each Command In e.NewItems
|
||||
ExecuteCommand(DirectCast(Command, ThreadCommand))
|
||||
m_CommandList.Remove(Command)
|
||||
' EgtOutLog("Inizio ciclo esecuzione comandi")
|
||||
Dim nCommandCount As Integer = e.NewItems.Count
|
||||
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
|
||||
' EgtOutLog("Fine ciclo esecuzione di " & nCommandCount & " comandi")
|
||||
End If
|
||||
End Sub
|
||||
|
||||
@@ -1048,7 +1070,7 @@ Public Class MachManaging
|
||||
Num_Axium_APServer.StartTransfer()
|
||||
Return True
|
||||
Case NCTypes.NUM_AXIUM_PCTOOLKIT
|
||||
EgtOutLog("Pre Download")
|
||||
' EgtOutLog("Pre Download")
|
||||
Dim nFileType As Integer = 0
|
||||
If Integer.TryParse(ProgramId, nFileType) AndAlso nFileType > 0 Then
|
||||
Num_Axium_PCToolkit.FileDownload(nFileType * 10, ProgramPath)
|
||||
@@ -1228,10 +1250,8 @@ Public Class MachManaging
|
||||
Dim nIndex As Integer = Index
|
||||
Dim PLCMessagesVariable As Variable = Map.refMachCommandMessagePanelVM.MainVariablesList.FirstOrDefault(Function(x) x.sName = PLC_MESSAGES & nIndex)
|
||||
If IsNothing(PLCMessagesVariable) OrElse IsNothing(PLCMessagesVariable.sValue) Then Return
|
||||
Dim dTemp As Double = 0
|
||||
Dim nTemp As Integer = 0
|
||||
StringToDouble(PLCMessagesVariable.sValue, dTemp)
|
||||
Integer.TryParse(dTemp, nTemp)
|
||||
Integer.TryParse(PLCMessagesVariable.sValue, nTemp)
|
||||
Dim Bytes As Byte() = BitConverter.GetBytes(nTemp)
|
||||
Dim NewBytes As Byte() = BitConverter.GetBytes(nTemp)
|
||||
For nBIndex = Bytes.Count - 1 To 0 Step -1
|
||||
|
||||
@@ -54,6 +54,12 @@ End Class
|
||||
|
||||
Public Class ThreadCommand
|
||||
|
||||
Public Enum ProcessingStatuses
|
||||
WAITING = 1
|
||||
PROCESSING = 2
|
||||
DONE = 3
|
||||
End Enum
|
||||
|
||||
Private m_CommandType As CommandTypes
|
||||
Public ReadOnly Property CommandType As CommandTypes
|
||||
Get
|
||||
@@ -95,6 +101,16 @@ Public Class ThreadCommand
|
||||
End Get
|
||||
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()
|
||||
End Sub
|
||||
|
||||
|
||||
@@ -148,7 +148,7 @@ Public Class RWVariableManager
|
||||
Public Sub ReadVar(Name As String, ByRef Value As Double)
|
||||
Dim nIndex As Integer = GetIndexFromName(Name)
|
||||
If nIndex >= 0 Then
|
||||
Value = StringToDouble(m_ReadedVars(nIndex), 5)
|
||||
Value = StringToDoubleAdv(m_ReadedVars(nIndex), 5)
|
||||
Else
|
||||
Value = -999999999
|
||||
End If
|
||||
|
||||
@@ -25,16 +25,37 @@
|
||||
</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}"
|
||||
|
||||
@@ -9,6 +9,12 @@ Imports EgtBEAMWALL.Core.MachLog
|
||||
Public Class MachineLogPageVM
|
||||
Inherits VMBase
|
||||
|
||||
Private Enum DayTypes As Integer
|
||||
TODAY = 0
|
||||
YESTERDAY = 1
|
||||
PERIOD = 2
|
||||
End Enum
|
||||
|
||||
Private m_colMachineLog_Type As EgtDataGridColumn
|
||||
Public ReadOnly Property colMachineLog_Type As EgtDataGridColumn
|
||||
Get
|
||||
@@ -62,7 +68,7 @@ Public Class MachineLogPageVM
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_PartEventTypeList As New List(Of String)({"", "Inizio", "Fine"})
|
||||
Private m_PartEventTypeList As New List(Of String)({"", EgtMsg(62527), EgtMsg(62528)})
|
||||
Public ReadOnly Property PartEventTypeList As List(Of String)
|
||||
Get
|
||||
Return m_PartEventTypeList
|
||||
@@ -76,11 +82,12 @@ Public Class MachineLogPageVM
|
||||
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)({"", "Pezzo", "Barra"})
|
||||
Private m_EntityTypeList As New List(Of String)({"", EgtMsg(62525), EgtMsg(62526)})
|
||||
Public ReadOnly Property EntityTypeList As List(Of String)
|
||||
Get
|
||||
Return m_EntityTypeList
|
||||
@@ -94,10 +101,75 @@ Public Class MachineLogPageVM
|
||||
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
|
||||
Private m_cmdRefresh As ICommand
|
||||
|
||||
@@ -151,6 +223,35 @@ Public Class MachineLogPageVM
|
||||
End Get
|
||||
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
|
||||
|
||||
@@ -167,6 +268,30 @@ Public Class MachineLogPageVM
|
||||
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_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 Region ' CONSTRUCTORS
|
||||
@@ -215,7 +340,15 @@ Public Class MachineLogPageVM
|
||||
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())
|
||||
'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))
|
||||
m_MachineLogList_View = CollectionViewSource.GetDefaultView(m_MachineLogList)
|
||||
m_MachineLogList_View.Filter = AddressOf MachineLogFilter
|
||||
|
||||
@@ -277,31 +277,31 @@ Public Class MainMenuVM
|
||||
|
||||
Private Function InitINPUTS() As Boolean
|
||||
' fermo e riavvio lettura variabili per includere quelle della pagina input
|
||||
MachManaging.CommandList.Add(ThreadCommand.CreateCommand(CommandTypes.STOPREAD_NUMFLEXIUM))
|
||||
MachManaging.CommandList.Add(ThreadCommand.CreateCommand(CommandTypes.READ_NUMFLEXIUM))
|
||||
MachManaging.AddToCommandList(ThreadCommand.CreateCommand(CommandTypes.STOPREAD_NUMFLEXIUM))
|
||||
MachManaging.AddToCommandList(ThreadCommand.CreateCommand(CommandTypes.READ_NUMFLEXIUM))
|
||||
Map.refMainWindowVM.NotifyPropertyChanged(NameOf(Map.refMainWindowVM.nSelTabPage))
|
||||
Return True
|
||||
End Function
|
||||
|
||||
Private Function ExitINPUTS() As Boolean
|
||||
' fermo e riavvio lettura variabili per includere quelle della pagina input
|
||||
MachManaging.CommandList.Add(ThreadCommand.CreateCommand(CommandTypes.STOPREAD_NUMFLEXIUM))
|
||||
MachManaging.CommandList.Add(ThreadCommand.CreateCommand(CommandTypes.READ_NUMFLEXIUM))
|
||||
MachManaging.AddToCommandList(ThreadCommand.CreateCommand(CommandTypes.STOPREAD_NUMFLEXIUM))
|
||||
MachManaging.AddToCommandList(ThreadCommand.CreateCommand(CommandTypes.READ_NUMFLEXIUM))
|
||||
Return True
|
||||
End Function
|
||||
|
||||
Private Function InitOUTPUTS() As Boolean
|
||||
' fermo e riavvio lettura variabili per includere quelle della pagina input
|
||||
MachManaging.CommandList.Add(ThreadCommand.CreateCommand(CommandTypes.STOPREAD_NUMFLEXIUM))
|
||||
MachManaging.CommandList.Add(ThreadCommand.CreateCommand(CommandTypes.READ_NUMFLEXIUM))
|
||||
MachManaging.AddToCommandList(ThreadCommand.CreateCommand(CommandTypes.STOPREAD_NUMFLEXIUM))
|
||||
MachManaging.AddToCommandList(ThreadCommand.CreateCommand(CommandTypes.READ_NUMFLEXIUM))
|
||||
Map.refMainWindowVM.NotifyPropertyChanged(NameOf(Map.refMainWindowVM.nSelTabPage))
|
||||
Return True
|
||||
End Function
|
||||
|
||||
Private Function ExitOUTPUTS() As Boolean
|
||||
' fermo e riavvio lettura variabili per includere quelle della pagina input
|
||||
MachManaging.CommandList.Add(ThreadCommand.CreateCommand(CommandTypes.STOPREAD_NUMFLEXIUM))
|
||||
MachManaging.CommandList.Add(ThreadCommand.CreateCommand(CommandTypes.READ_NUMFLEXIUM))
|
||||
MachManaging.AddToCommandList(ThreadCommand.CreateCommand(CommandTypes.STOPREAD_NUMFLEXIUM))
|
||||
MachManaging.AddToCommandList(ThreadCommand.CreateCommand(CommandTypes.READ_NUMFLEXIUM))
|
||||
Return True
|
||||
End Function
|
||||
|
||||
|
||||
@@ -239,9 +239,17 @@ Public Class MainWindowM
|
||||
EgtSetNestKey(sNestKey)
|
||||
' Verifico abilitazione nesting automatico
|
||||
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
|
||||
Dim bKey As Boolean = EgtGetKeyLevel(5327, 2503, 1, m_nKeyLevel) And
|
||||
EgtGetKeyOptions(5327, 2503, 1, m_nKeyOptions)
|
||||
Dim bKey As Boolean = EgtGetKeyLevel(5327, 2506, 1, m_nKeyLevel) And
|
||||
EgtGetKeyOptions(5327, 2506, 1, m_nKeyOptions)
|
||||
' Inizializzazione generale di EgtInterface
|
||||
m_nDebug = GetMainPrivateProfileInt(S_GENERAL, K_DEBUG, 0)
|
||||
m_sLogFile = m_sTempDir & "\" & SUPGENLOG_FILE_NAME.Replace("#", m_nInstance.ToString())
|
||||
|
||||
@@ -234,7 +234,7 @@ Public Class MainWindowVM
|
||||
Return
|
||||
End If
|
||||
' 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
|
||||
ViewerOptimizerCommThread.StopThread()
|
||||
' Verifico modifica parametri in Configurazione e chiedo il salvataggio
|
||||
|
||||
@@ -70,5 +70,5 @@ Imports System.Windows
|
||||
' by using the '*' as shown below:
|
||||
' <Assembly: AssemblyVersion("1.0.*")>
|
||||
|
||||
<Assembly: AssemblyVersion("2.5.3.2")>
|
||||
<Assembly: AssemblyFileVersion("2.5.3.2")>
|
||||
<Assembly: AssemblyVersion("2.5.6.2")>
|
||||
<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?
|
||||
m_ProjectType = ProjectType
|
||||
' carico colonne
|
||||
LoadColumns(ProjectType)
|
||||
NotifyPropertyChanged(NameOf(SearchColumnList))
|
||||
m_SelSearchColumn = m_SearchColumnList(0)
|
||||
LoadColumns(m_ProjectType)
|
||||
NotifyPropertyChanged(NameOf(FilterTypeList))
|
||||
m_SelFilterType = m_FilterTypeList(0)
|
||||
' carico lista progetti
|
||||
If IsNothing(CurrProjectList) OrElse CurrProjectList.Count = 0 Then
|
||||
' leggo da db
|
||||
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
|
||||
RefreshProjectList(GoToProd)
|
||||
Else
|
||||
m_ProjectList = New ObservableCollection(Of ProjectFileVM)(CurrProjectList)
|
||||
NotifyPropertyChanged(NameOf(ProjectList))
|
||||
@@ -33,6 +26,45 @@ Public Class OpenProjectFileDialogVM
|
||||
m_ProjectList_View.Filter = AddressOf ProjectFilter
|
||||
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 Class
|
||||
|
||||
@@ -178,13 +178,14 @@ Public Class MySceneHostVM
|
||||
|
||||
#Region "ProjectManager"
|
||||
|
||||
Public Overrides Sub NewProject()
|
||||
Public Overrides Function NewProject() As Boolean
|
||||
EgtSetCurrentContext(MainScene.GetCtx())
|
||||
Dim bOk As Boolean = MainController.NewProject()
|
||||
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())
|
||||
Dim bOk As Boolean = False
|
||||
If String.IsNullOrEmpty(sFilePath) Then
|
||||
@@ -201,29 +202,32 @@ Public Class MySceneHostVM
|
||||
bOk = MainController.OpenProject(sFilePath, False)
|
||||
End If
|
||||
MainScene.SetStatusNull()
|
||||
End Sub
|
||||
Return bOk
|
||||
End Function
|
||||
|
||||
Public Overrides Sub SaveProject()
|
||||
MyBase.SaveProject()
|
||||
Public Overrides Function SaveProject() As Boolean
|
||||
Dim bOk As Boolean = MyBase.SaveProject()
|
||||
' Imposto stato gestione mouse diretto della scena a nessuno
|
||||
MainScene.SetStatusNull()
|
||||
End Sub
|
||||
Return bOk
|
||||
End Function
|
||||
|
||||
Public Overrides Sub SaveAsProject()
|
||||
MyBase.SaveAsProject()
|
||||
Public Overrides Function SaveAsProject() As Boolean
|
||||
Dim bOk As Boolean = MyBase.SaveAsProject()
|
||||
' Imposto stato gestione mouse diretto della scena a nessuno
|
||||
MainScene.SetStatusNull()
|
||||
End Sub
|
||||
Return bOk
|
||||
End Function
|
||||
|
||||
Public Overrides Sub ImportProject()
|
||||
Public Overrides Function ImportProject() As Boolean
|
||||
Dim sDir As String = String.Empty
|
||||
GetMainPrivateProfileString(S_MRUIMPORT, K_FILE & "1", "", sDir)
|
||||
If Not String.IsNullOrWhiteSpace(sDir) Then
|
||||
sDir = Path.GetDirectoryName(sDir)
|
||||
End If
|
||||
sDir.TrimEnd("\"c)
|
||||
MainController.ImportProject(sDir)
|
||||
End Sub
|
||||
Return MainController.ImportProject(sDir)
|
||||
End Function
|
||||
|
||||
#End Region ' ProjectManager
|
||||
|
||||
|
||||
@@ -342,6 +342,16 @@
|
||||
<Setter Property="VerticalAlignment" Value="Center"/>
|
||||
<Setter Property="Margin" Value="10,0,10,0"/>
|
||||
</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>
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
Imports EgtWPFLib5
|
||||
Imports EgtUILib
|
||||
Imports EgtWPFLib5
|
||||
Imports EgtBEAMWALL.Core
|
||||
|
||||
Public Class LogEvent
|
||||
@@ -77,9 +78,9 @@ Public Class LogEvent
|
||||
Get
|
||||
Select Case m_Status
|
||||
Case 1
|
||||
Return "Inizio"
|
||||
Return EgtMsg(62527)
|
||||
Case 2
|
||||
Return "Fine"
|
||||
Return EgtMsg(62528)
|
||||
Case Else
|
||||
Return ""
|
||||
End Select
|
||||
|
||||
@@ -64,7 +64,7 @@ Public Class Variable
|
||||
Return CommVar.sValue
|
||||
End Get
|
||||
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))
|
||||
End Set
|
||||
End Property
|
||||
|
||||
@@ -1,52 +1,59 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<configuration>
|
||||
<configSections>
|
||||
<!-- 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" />
|
||||
</configSections>
|
||||
<entityFramework>
|
||||
<defaultConnectionFactory type="MySql.Data.Entity.MySqlConnectionFactory, MySql.Data.Entity.EF6" />
|
||||
<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></providers>
|
||||
</entityFramework>
|
||||
<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" />
|
||||
</connectionStrings>
|
||||
<runtime>
|
||||
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="MySql.Data" publicKeyToken="c5687fc88969c44d" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-8.0.21.0" newVersion="8.0.21.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-13.0.0.0" newVersion="13.0.0.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<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" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="BouncyCastle.Crypto" publicKeyToken="0e99375e54769942" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-1.8.5.0" newVersion="1.8.5.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="Google.Protobuf" publicKeyToken="a7d26565bac4d604" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-3.19.4.0" newVersion="3.19.4.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<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" />
|
||||
</dependentAssembly>
|
||||
</assemblyBinding>
|
||||
</runtime>
|
||||
<system.data>
|
||||
<DbProviderFactories>
|
||||
<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>
|
||||
<configSections>
|
||||
<!-- 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" />
|
||||
</configSections>
|
||||
<entityFramework>
|
||||
<!--<defaultConnectionFactory type="MySql.Data.Entity.MySqlConnectionFactory, MySql.Data.EntityFramework" />-->
|
||||
<defaultConnectionFactory type="System.Data.Entity.Infrastructure.SqlConnectionFactory, EntityFramework"/>
|
||||
<providers>
|
||||
<provider invariantName="MySql.Data.MySqlClient" type="MySql.Data.MySqlClient.MySqlProviderServices, MySql.Data.EntityFramework, Version=8.0.21.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d">
|
||||
</provider>
|
||||
</providers>
|
||||
</entityFramework>
|
||||
<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" />
|
||||
</connectionStrings>
|
||||
<runtime>
|
||||
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="MySql.Data" publicKeyToken="c5687fc88969c44d" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-8.0.21.0" newVersion="8.0.21.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-13.0.0.0" newVersion="13.0.0.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="BouncyCastle.Crypto" publicKeyToken="0e99375e54769942" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-1.9.0.0" newVersion="1.9.0.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="Google.Protobuf" publicKeyToken="a7d26565bac4d604" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-3.21.9.0" newVersion="3.21.9.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="K4os.Compression.LZ4.Streams" publicKeyToken="2186fa9121ef231d" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-1.3.5.0" newVersion="1.3.5.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Memory" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.0.1.2" newVersion="4.0.1.2" />
|
||||
</dependentAssembly>
|
||||
</assemblyBinding>
|
||||
</runtime>
|
||||
<system.data>
|
||||
<DbProviderFactories>
|
||||
<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>
|
||||
|
||||
@@ -4,11 +4,11 @@
|
||||
<package id="Csv" version="1.0.31" targetFramework="net472" />
|
||||
<package id="EntityFramework" version="6.4.4" targetFramework="net452" />
|
||||
<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="K4os.Compression.LZ4" version="1.2.6" targetFramework="net472" />
|
||||
<package id="K4os.Compression.LZ4.Streams" version="1.2.6" targetFramework="net472" />
|
||||
<package id="K4os.Hash.xxHash" version="1.0.6" targetFramework="net472" />
|
||||
<package id="K4os.Compression.LZ4" version="1.3.5" targetFramework="net472" />
|
||||
<package id="K4os.Compression.LZ4.Streams" version="1.3.5" 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="Microsoft.DotNet.PlatformAbstractions" 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="Newtonsoft.Json" version="13.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="System.Buffers" version="4.5.1" 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.Sockets" version="4.3.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.Threading.Tasks.Extensions" version="4.5.4" targetFramework="net472" />
|
||||
<package id="System.Xml.XmlDocument" version="4.3.0" targetFramework="net472" />
|
||||
<package id="Zebra.Printer.SDK" version="2.15.2634" targetFramework="net472" />
|
||||
</packages>
|
||||
@@ -40,7 +40,7 @@ Public Class AddPartWndVM
|
||||
End Get
|
||||
Set(value As String)
|
||||
Dim dTempL As Double
|
||||
If StringToLen(value, dTempL) AndAlso dTempL > 0 Then
|
||||
If StringToLenAdv(value, dTempL, True) AndAlso dTempL > 0 Then
|
||||
m_dL = dTempL
|
||||
Else
|
||||
NotifyPropertyChanged("sL")
|
||||
@@ -60,7 +60,7 @@ Public Class AddPartWndVM
|
||||
End Get
|
||||
Set(value As String)
|
||||
Dim dTempW As Double
|
||||
If StringToLen(value, dTempW) AndAlso dTempW > 0 Then
|
||||
If StringToLenAdv(value, dTempW, True) AndAlso dTempW > 0 Then
|
||||
EgtDraw()
|
||||
m_dW = dTempW
|
||||
Else
|
||||
@@ -81,7 +81,7 @@ Public Class AddPartWndVM
|
||||
End Get
|
||||
Set(value As String)
|
||||
Dim dTempH As Double
|
||||
If StringToLen(value, dTempH) AndAlso dTempH > 0 Then
|
||||
If StringToLenAdv(value, dTempH, True) AndAlso dTempH > 0 Then
|
||||
EgtDraw()
|
||||
m_dH = dTempH
|
||||
Else
|
||||
|
||||
@@ -232,14 +232,14 @@ Public Class Variable
|
||||
m_sValue = value
|
||||
Case VariableType.LENGTH
|
||||
Dim dTempValue As Double
|
||||
If StringToLen(value, dTempValue) Then
|
||||
If StringToLenAdv(value, dTempValue, True) Then
|
||||
m_dValue = dTempValue
|
||||
Else
|
||||
NotifyPropertyChanged("sValue")
|
||||
End If
|
||||
Case Else ' VariableType.DOUBLE_
|
||||
Dim dTempValue As Double
|
||||
If StringToDouble(value, dTempValue) Then
|
||||
If StringToDoubleAdv(value, dTempValue, True) Then
|
||||
m_dValue = dTempValue
|
||||
Else
|
||||
NotifyPropertyChanged("sValue")
|
||||
|
||||
@@ -1,47 +1,55 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<configuration>
|
||||
<configSections>
|
||||
<!-- 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" />
|
||||
</configSections>
|
||||
<entityFramework>
|
||||
<defaultConnectionFactory type="MySql.Data.Entity.MySqlConnectionFactory, MySql.Data.Entity.EF6" />
|
||||
<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" />
|
||||
</providers>
|
||||
</entityFramework>
|
||||
<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" />
|
||||
</connectionStrings>
|
||||
<runtime>
|
||||
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="MySql.Data" publicKeyToken="c5687fc88969c44d" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-8.0.21.0" newVersion="8.0.21.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<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" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="Google.Protobuf" publicKeyToken="a7d26565bac4d604" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-3.19.4.0" newVersion="3.19.4.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<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" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="BouncyCastle.Crypto" publicKeyToken="0e99375e54769942" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-1.8.5.0" newVersion="1.8.5.0" />
|
||||
</dependentAssembly>
|
||||
</assemblyBinding>
|
||||
</runtime>
|
||||
<system.data>
|
||||
<DbProviderFactories>
|
||||
<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>
|
||||
<configSections>
|
||||
<!-- 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" />
|
||||
</configSections>
|
||||
<entityFramework>
|
||||
<!--<defaultConnectionFactory type="MySql.Data.Entity.MySqlConnectionFactory, MySql.Data.EntityFramework" />-->
|
||||
<defaultConnectionFactory type="System.Data.Entity.Infrastructure.SqlConnectionFactory, EntityFramework"/>
|
||||
<providers>
|
||||
<provider invariantName="MySql.Data.MySqlClient" type="MySql.Data.MySqlClient.MySqlProviderServices, MySql.Data.EntityFramework, Version=8.0.21.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d">
|
||||
</provider>
|
||||
</providers>
|
||||
</entityFramework>
|
||||
<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" />
|
||||
</connectionStrings>
|
||||
<runtime>
|
||||
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="MySql.Data" publicKeyToken="c5687fc88969c44d" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-8.0.21.0" newVersion="8.0.21.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="Google.Protobuf" publicKeyToken="a7d26565bac4d604" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-3.21.9.0" newVersion="3.21.9.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="K4os.Compression.LZ4.Streams" publicKeyToken="2186fa9121ef231d" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-1.3.5.0" newVersion="1.3.5.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="BouncyCastle.Crypto" publicKeyToken="0e99375e54769942" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-1.9.0.0" newVersion="1.9.0.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Memory" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.0.1.2" newVersion="4.0.1.2" />
|
||||
</dependentAssembly>
|
||||
</assemblyBinding>
|
||||
</runtime>
|
||||
<system.data>
|
||||
<DbProviderFactories>
|
||||
<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>
|
||||
|
||||
@@ -114,6 +114,27 @@ Public Class BTLFeatureVM
|
||||
End Set
|
||||
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)
|
||||
' necessario per evitare ricalcolo della grafica sulla modifica del parametro per ogni feature
|
||||
Private Shared m_bDO_MultipleUpdate As Boolean = False
|
||||
@@ -372,6 +393,8 @@ Public Class BTLFeatureVM
|
||||
For Each QPar In QBTLParamVMList
|
||||
If QPar.bCustom Then EgtSetInfo(nNewFeatureId, QPar.sName & "A", 1)
|
||||
Next
|
||||
' Riporto priority
|
||||
EgtSetInfo(nNewFeatureId, BTL_FTR_PRIORITY, m_BTLFeatureM.nPriority)
|
||||
Dim NewFeat As BTLFeatureM = BTLFeatureM.CreateBTLFeature(m_BTLPartM, nNewFeatureId)
|
||||
' la aggiungo a struttura BTL pezzo di destinazione
|
||||
DestBTLPart.AddBTLFeature(NewFeat)
|
||||
|
||||
@@ -121,9 +121,9 @@ Public Class BTLParamVM
|
||||
' trasformo valori
|
||||
Select Case m_BTLParamM.nType
|
||||
Case BTLParamType.DOUBLE_
|
||||
StringToDouble(value, dNewValue)
|
||||
StringToDoubleAdv(value, dNewValue, True)
|
||||
Case BTLParamType.LENGTH
|
||||
StringToLen(value, dNewValue)
|
||||
StringToLenAdv(value, dNewValue, True)
|
||||
Case Else
|
||||
' per string non faccio nulla
|
||||
End Select
|
||||
@@ -168,9 +168,9 @@ Public Class BTLParamVM
|
||||
' trasformo valori
|
||||
Select Case m_BTLParamM.nType
|
||||
Case BTLParamType.DOUBLE_
|
||||
StringToDouble(value, dNewValue)
|
||||
StringToDoubleAdv(value, dNewValue, True)
|
||||
Case BTLParamType.LENGTH
|
||||
StringToLen(value, dNewValue)
|
||||
StringToLenAdv(value, dNewValue, True)
|
||||
Case Else
|
||||
' per string non faccio nulla
|
||||
End Select
|
||||
|
||||
@@ -171,7 +171,7 @@ Public Class BTLPartVM
|
||||
End Get
|
||||
Set(value As String)
|
||||
Dim dVal As Double
|
||||
If StringToLen(value, dVal) Then
|
||||
If StringToLenAdv(value, dVal, True) Then
|
||||
Dim dBtlL = m_BTLPartM.dBtlL
|
||||
Dim dBtlW = m_BTLPartM.dBtlW
|
||||
Dim dBtlH = m_BTLPartM.dBtlH
|
||||
@@ -229,7 +229,7 @@ Public Class BTLPartVM
|
||||
End Get
|
||||
Set(value As String)
|
||||
Dim dVal As Double
|
||||
If StringToLen(value, dVal) Then
|
||||
If StringToLenAdv(value, dVal, True) Then
|
||||
Dim dBtlL = m_BTLPartM.dBtlL
|
||||
Dim dBtlW = m_BTLPartM.dBtlW
|
||||
Dim dBtlH = m_BTLPartM.dBtlH
|
||||
@@ -287,7 +287,7 @@ Public Class BTLPartVM
|
||||
End Get
|
||||
Set(value As String)
|
||||
Dim dVal As Double
|
||||
If StringToLen(value, dVal) Then
|
||||
If StringToLenAdv(value, dVal, True) Then
|
||||
Dim dBtlL = m_BTLPartM.dBtlL
|
||||
Dim dBtlW = m_BTLPartM.dBtlW
|
||||
Dim dBtlH = m_BTLPartM.dBtlH
|
||||
@@ -550,7 +550,7 @@ Public Class BTLPartVM
|
||||
End Get
|
||||
Set(value As String)
|
||||
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
|
||||
Else
|
||||
NotifyPropertyChanged("dPLANINGLEN")
|
||||
@@ -564,7 +564,7 @@ Public Class BTLPartVM
|
||||
End Get
|
||||
Set(value As String)
|
||||
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
|
||||
Else
|
||||
NotifyPropertyChanged("dSTARTOFFSET")
|
||||
@@ -578,7 +578,7 @@ Public Class BTLPartVM
|
||||
End Get
|
||||
Set(value As String)
|
||||
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
|
||||
Else
|
||||
NotifyPropertyChanged("dENDOFFSET")
|
||||
@@ -625,9 +625,9 @@ Public Class BTLPartVM
|
||||
Dim sValArray() As String = value.Split(",")
|
||||
Dim ptOri As New Point3d
|
||||
If sValArray.Count() >= 3 AndAlso
|
||||
StringToLen(sValArray(0), ptOri.x) AndAlso
|
||||
StringToLen(sValArray(1), ptOri.y) AndAlso
|
||||
StringToLen(sValArray(2), ptOri.z) AndAlso
|
||||
StringToLenAdv(sValArray(0), ptOri.x, True) AndAlso
|
||||
StringToLenAdv(sValArray(1), ptOri.y, True) AndAlso
|
||||
StringToLenAdv(sValArray(2), ptOri.z, True) AndAlso
|
||||
m_BTLPartM.refTransf.ChangeOrigin(ptOri) Then
|
||||
EgtSetInfo(m_BTLPartM.nPartId, BTL_PRT_TRANSFORMATION & (SelUID + 1), LenToString(m_BTLPartM.refTransf.Orig.x, 3) & "," &
|
||||
LenToString(m_BTLPartM.refTransf.Orig.y, 3) & "," &
|
||||
@@ -661,9 +661,9 @@ Public Class BTLPartVM
|
||||
Dim sValArray() As String = value.Split(",")
|
||||
Dim vtVersX As New Vector3d
|
||||
If sValArray.Count() >= 3 AndAlso
|
||||
StringToDouble(sValArray(0), vtVersX.x) AndAlso
|
||||
StringToDouble(sValArray(1), vtVersX.y) AndAlso
|
||||
StringToDouble(sValArray(2), vtVersX.z) AndAlso
|
||||
StringToDoubleAdv(sValArray(0), vtVersX.x, True) AndAlso
|
||||
StringToDoubleAdv(sValArray(1), vtVersX.y, True) AndAlso
|
||||
StringToDoubleAdv(sValArray(2), vtVersX.z, True) AndAlso
|
||||
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) & "," &
|
||||
LenToString(m_BTLPartM.refTransf.Orig.y, 3) & "," &
|
||||
@@ -699,9 +699,9 @@ Public Class BTLPartVM
|
||||
Dim sValArray() As String = value.Split(",")
|
||||
Dim vtVersY As New Vector3d
|
||||
If sValArray.Count() >= 3 AndAlso
|
||||
StringToDouble(sValArray(0), vtVersY.x) AndAlso
|
||||
StringToDouble(sValArray(1), vtVersY.y) AndAlso
|
||||
StringToDouble(sValArray(2), vtVersY.z) AndAlso
|
||||
StringToDoubleAdv(sValArray(0), vtVersY.x, True) AndAlso
|
||||
StringToDoubleAdv(sValArray(1), vtVersY.y, True) AndAlso
|
||||
StringToDoubleAdv(sValArray(2), vtVersY.z, True) AndAlso
|
||||
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) & "," &
|
||||
LenToString(m_BTLPartM.refTransf.Orig.y, 3) & "," &
|
||||
@@ -733,10 +733,10 @@ Public Class BTLPartVM
|
||||
Set(value As Integer)
|
||||
Dim sValArray() As String = CamberParams.Split(",")
|
||||
If sValArray.Count() >= 4 AndAlso
|
||||
StringToLen(sValArray(0), m_BTLPartM.m_dCamberLen1) AndAlso
|
||||
StringToLen(sValArray(1), m_BTLPartM.m_dCamberLen2) AndAlso
|
||||
StringToLen(sValArray(2), m_BTLPartM.m_dCamberLen3) AndAlso
|
||||
StringToLen(sValArray(3), m_BTLPartM.m_dCamberCross3) AndAlso
|
||||
StringToLenAdv(sValArray(0), m_BTLPartM.m_dCamberLen1, True) AndAlso
|
||||
StringToLenAdv(sValArray(1), m_BTLPartM.m_dCamberLen2, True) AndAlso
|
||||
StringToLenAdv(sValArray(2), m_BTLPartM.m_dCamberLen3, True) AndAlso
|
||||
StringToLenAdv(sValArray(3), m_BTLPartM.m_dCamberCross3, True) AndAlso
|
||||
EgtSetInfo(m_BTLPartM.nPartId, BTL_PRT_CAMBER, "SIDE: " & (value + 1) &
|
||||
" P01: " & sValArray(0) &
|
||||
" P02: " & sValArray(1) &
|
||||
@@ -759,10 +759,10 @@ Public Class BTLPartVM
|
||||
Set(value As String)
|
||||
Dim sValArray() As String = value.Split(",")
|
||||
If sValArray.Count() >= 4 AndAlso
|
||||
StringToLen(sValArray(0), m_BTLPartM.m_dCamberLen1) AndAlso
|
||||
StringToLen(sValArray(1), m_BTLPartM.m_dCamberLen2) AndAlso
|
||||
StringToLen(sValArray(2), m_BTLPartM.m_dCamberLen3) AndAlso
|
||||
StringToLen(sValArray(3), m_BTLPartM.m_dCamberCross3) Then
|
||||
StringToLenAdv(sValArray(0), m_BTLPartM.m_dCamberLen1, True) AndAlso
|
||||
StringToLenAdv(sValArray(1), m_BTLPartM.m_dCamberLen2, True) AndAlso
|
||||
StringToLenAdv(sValArray(2), m_BTLPartM.m_dCamberLen3, True) AndAlso
|
||||
StringToLenAdv(sValArray(3), m_BTLPartM.m_dCamberCross3, True) Then
|
||||
EgtSetInfo(m_BTLPartM.nPartId, BTL_PRT_CAMBER, " SIDE: " & (SelCAMBERSIDE + 1) &
|
||||
" P01: " & sValArray(0) &
|
||||
" P02: " & sValArray(1) &
|
||||
@@ -790,10 +790,10 @@ Public Class BTLPartVM
|
||||
|
||||
Dim sValArray() As String = PartOffsetParams.Split(",")
|
||||
If sValArray.Count() >= 4 AndAlso
|
||||
StringToLen(sValArray(0), m_BTLPartM.m_dPartOffsetSide1) AndAlso
|
||||
StringToLen(sValArray(1), m_BTLPartM.m_dPartOffsetSide2) AndAlso
|
||||
StringToLen(sValArray(2), m_BTLPartM.m_dPartOffsetSide3) AndAlso
|
||||
StringToLen(sValArray(3), m_BTLPartM.m_dPartOffsetSide4) AndAlso
|
||||
StringToLenAdv(sValArray(0), m_BTLPartM.m_dPartOffsetSide1, True) AndAlso
|
||||
StringToLenAdv(sValArray(1), m_BTLPartM.m_dPartOffsetSide2, True) AndAlso
|
||||
StringToLenAdv(sValArray(2), m_BTLPartM.m_dPartOffsetSide3, True) AndAlso
|
||||
StringToLenAdv(sValArray(3), m_BTLPartM.m_dPartOffsetSide4, True) AndAlso
|
||||
EgtSetInfo(m_BTLPartM.nPartId, BTL_PRT_PARTOFFSET, " P04: " & sValue &
|
||||
" P11: " & sValArray(0) &
|
||||
" P12: " & sValArray(1) &
|
||||
@@ -819,10 +819,10 @@ Public Class BTLPartVM
|
||||
|
||||
Dim sValArray() As String = value.Split(",")
|
||||
If sValArray.Count() >= 4 AndAlso
|
||||
StringToLen(sValArray(0), m_BTLPartM.m_dPartOffsetSide1) AndAlso
|
||||
StringToLen(sValArray(1), m_BTLPartM.m_dPartOffsetSide2) AndAlso
|
||||
StringToLen(sValArray(2), m_BTLPartM.m_dPartOffsetSide3) AndAlso
|
||||
StringToLen(sValArray(3), m_BTLPartM.m_dPartOffsetSide4) Then
|
||||
StringToLenAdv(sValArray(0), m_BTLPartM.m_dPartOffsetSide1, True) AndAlso
|
||||
StringToLenAdv(sValArray(1), m_BTLPartM.m_dPartOffsetSide2, True) AndAlso
|
||||
StringToLenAdv(sValArray(2), m_BTLPartM.m_dPartOffsetSide3, True) AndAlso
|
||||
StringToLenAdv(sValArray(3), m_BTLPartM.m_dPartOffsetSide4, True) Then
|
||||
EgtSetInfo(m_BTLPartM.nPartId, BTL_PRT_PARTOFFSET, " P04: " & sValue &
|
||||
" P11: " & sValArray(0) &
|
||||
" P12: " & sValArray(1) &
|
||||
@@ -973,9 +973,9 @@ Public Class BTLPartVM
|
||||
Dim sValArray() As String = value.Split(",")
|
||||
Dim dX, dY, dZ As Double
|
||||
If sValArray.Count() >= 3 AndAlso
|
||||
StringToDouble(sValArray(0), dX) AndAlso
|
||||
StringToDouble(sValArray(1), dY) AndAlso
|
||||
StringToDouble(sValArray(2), dZ) Then
|
||||
StringToDoubleAdv(sValArray(0), dX, True) AndAlso
|
||||
StringToDoubleAdv(sValArray(1), dY, True) AndAlso
|
||||
StringToDoubleAdv(sValArray(2), dZ, True) Then
|
||||
m_BTLPartM.refGrainDir = New Vector3d(dX, dY, dZ)
|
||||
EgtSetInfo(m_BTLPartM.nPartId, BTL_PRT_GRAINDIR, sValArray(0) & "," &
|
||||
sValArray(1) & "," &
|
||||
@@ -994,9 +994,9 @@ Public Class BTLPartVM
|
||||
Set(value As Boolean)
|
||||
Dim sValArray() As String = GrainDirection.Split(",")
|
||||
If sValArray.Count() >= 3 AndAlso
|
||||
StringToDouble(sValArray(0), m_BTLPartM.refGrainDir.x) AndAlso
|
||||
StringToDouble(sValArray(1), m_BTLPartM.refGrainDir.y) AndAlso
|
||||
StringToDouble(sValArray(2), m_BTLPartM.refGrainDir.z) AndAlso
|
||||
StringToDoubleAdv(sValArray(0), m_BTLPartM.refGrainDir.x, True) AndAlso
|
||||
StringToDoubleAdv(sValArray(1), m_BTLPartM.refGrainDir.y, True) AndAlso
|
||||
StringToDoubleAdv(sValArray(2), m_BTLPartM.refGrainDir.z, True) AndAlso
|
||||
EgtSetInfo(m_BTLPartM.nPartId, BTL_PRT_GRAINDIR, sValArray(0) & "," &
|
||||
sValArray(1) & "," &
|
||||
sValArray(2) & ";" &
|
||||
@@ -1530,6 +1530,7 @@ Public Class BTLPartVM
|
||||
m_SelBTLFeatureVM.RefreshFCMBtnVisibility()
|
||||
' aggiorno stato abilitazione del bottone modifica free contour
|
||||
Map.refFeatureManagerVM.SetEditIsEnabled()
|
||||
Map.refFeatureManagerVM.NotifyPropertyChanged(NameOf(Map.refFeatureManagerVM.Priority_Visibility))
|
||||
Else
|
||||
EgtDeselectAll()
|
||||
End If
|
||||
@@ -2163,7 +2164,7 @@ Public Class BTLPartVM
|
||||
' 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)
|
||||
Case NameOf(sender.bDO), NameOf(sender.sPriority)
|
||||
NotifyPropertyChanged(NameOf(bDOALL))
|
||||
' setto pezzo da ricalcolare
|
||||
'ResetCalcTotalPart()
|
||||
|
||||
@@ -280,8 +280,8 @@ Public Class CALCPanelVM
|
||||
End Sub
|
||||
|
||||
Private Shared Sub ProcessResults(Bar As Bar)
|
||||
If IsNothing(Bar) Then Return
|
||||
ProcessResults(Bar.sBarPath, Bar.nProgramPage, Bar.nBarId)
|
||||
|
||||
End Sub
|
||||
|
||||
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
|
||||
Dim nVal As Integer? = GetVal(line, "ERR")
|
||||
nErr = (If(nVal IsNot Nothing, nVal.Value, 0))
|
||||
nErr = (If(Not IsNothing(nVal), nVal.Value, 0))
|
||||
sMsg = ""
|
||||
dRot = 0
|
||||
nFall = 0
|
||||
@@ -320,24 +320,24 @@ Public Class CALCPanelVM
|
||||
taskId = 0
|
||||
ElseIf line.StartsWith("ROT=") Then
|
||||
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)
|
||||
dPartRot = Math.Max(dPartRot, dRot)
|
||||
dTotRot = Math.Max(dTotRot, dRot)
|
||||
ElseIf line.StartsWith("CUTID=") Then
|
||||
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
|
||||
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)
|
||||
ElseIf line.StartsWith("FALL=") Then
|
||||
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))
|
||||
ElseIf line.StartsWith("TIME=") Then
|
||||
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))
|
||||
'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)
|
||||
|
||||
@@ -142,9 +142,9 @@ Public Class Parameters
|
||||
Set(value As String)
|
||||
Select Case m_BTLParamM.nType
|
||||
Case BTLParamType.DOUBLE_
|
||||
StringToDouble(value, m_dActualValue)
|
||||
StringToDoubleAdv(value, m_dActualValue, True)
|
||||
Case BTLParamType.LENGTH
|
||||
StringToLen(value, m_dActualValue)
|
||||
StringToLenAdv(value, m_dActualValue, True)
|
||||
Case Else ' BTLParamType.STRING_
|
||||
m_sActualValue = value
|
||||
End Select
|
||||
@@ -172,9 +172,9 @@ Public Class Parameters
|
||||
Set(value As String)
|
||||
Select Case m_BTLParamM.nType
|
||||
Case BTLParamType.DOUBLE_
|
||||
StringToDouble(value, m_dNewValue)
|
||||
StringToDoubleAdv(value, m_dNewValue, True)
|
||||
Case BTLParamType.LENGTH
|
||||
StringToLen(value, m_dNewValue)
|
||||
StringToLenAdv(value, m_dNewValue, True)
|
||||
Case Else ' BTLParamType.STRING_
|
||||
m_sNewValue = value
|
||||
End Select
|
||||
|
||||
@@ -5,226 +5,232 @@
|
||||
xmlns:EgtWPFLib5="clr-namespace:EgtWPFLib5;assembly=EgtWPFLib5"
|
||||
xmlns:EgtBEAMWALL="clr-namespace:EgtBEAMWALL.ViewerOptimizer">
|
||||
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="10*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="6*"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
</Grid.RowDefinitions>
|
||||
<TabControl Grid.Row="0" Grid.Column="0" Grid.RowSpan="2" Grid.ColumnSpan="2"
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="10*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="6*"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
</Grid.RowDefinitions>
|
||||
<TabControl Grid.Row="0" Grid.Column="0" Grid.RowSpan="2" Grid.ColumnSpan="2"
|
||||
SelectedIndex="{Binding SelConfigSubPage}">
|
||||
<TabItem Header="General">
|
||||
<TabItem.Content>
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
</Grid.RowDefinitions>
|
||||
<StackPanel Grid.Row="0" Grid.Column="0" Margin="5,5,5,0">
|
||||
<GroupBox Header="{Binding CurrentLanguage_Msg}"
|
||||
<TabItem Header="General">
|
||||
<TabItem.Content>
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
</Grid.RowDefinitions>
|
||||
<StackPanel Grid.Row="0" Grid.Column="0" Margin="5,5,5,0">
|
||||
<GroupBox Header="{Binding CurrentLanguage_Msg}"
|
||||
Margin="0,0,0,5">
|
||||
<UniformGrid Rows="2" Margin="3,3,3,3">
|
||||
<ComboBox ItemsSource="{Binding LanguageList, Mode=OneWay}" Height="25"
|
||||
<UniformGrid Rows="2" Margin="3,3,3,3">
|
||||
<ComboBox ItemsSource="{Binding LanguageList, Mode=OneWay}" Height="25"
|
||||
DisplayMemberPath="Name" SelectedItem="{Binding SelectedLanguage}"
|
||||
Margin="0,0,0,5"/>
|
||||
<TextBlock Text="{Binding LanguageAdvert_Msg}" TextWrapping="Wrap"
|
||||
<TextBlock Text="{Binding LanguageAdvert_Msg}" TextWrapping="Wrap"
|
||||
TextAlignment="Center"/>
|
||||
</UniformGrid>
|
||||
</GroupBox>
|
||||
<UniformGrid Columns="2"
|
||||
</UniformGrid>
|
||||
</GroupBox>
|
||||
<UniformGrid Columns="2"
|
||||
Margin="0,0,0,5">
|
||||
<TextBlock Text="{Binding MMUnits_Msg}" VerticalAlignment="Center"/>
|
||||
<ComboBox ItemsSource="{Binding UnitMeasureList, Mode=OneWay}"
|
||||
<TextBlock Text="{Binding MMUnits_Msg}" VerticalAlignment="Center"/>
|
||||
<ComboBox ItemsSource="{Binding UnitMeasureList, Mode=OneWay}"
|
||||
SelectedIndex="{Binding SelMeasureUnit}" Height="25"
|
||||
Margin="0,5,0,0"/>
|
||||
</UniformGrid>
|
||||
<GroupBox Header="{Binding Nesting_Msg}"
|
||||
</UniformGrid>
|
||||
<GroupBox Header="{Binding Nesting_Msg}"
|
||||
Margin="0,0,0,5">
|
||||
<StackPanel>
|
||||
<UniformGrid Columns="2"
|
||||
<StackPanel>
|
||||
<UniformGrid Columns="2"
|
||||
Margin="0,0,0,5">
|
||||
<TextBlock Text="{Binding SectionTime_Msg}"
|
||||
<TextBlock Text="{Binding SectionTime_Msg}"
|
||||
Grid.Row="0" Grid.Column="0"/>
|
||||
<EgtWPFLib5:EgtTextBox Text="{Binding SectionTime, UpdateSourceTrigger=Explicit}"
|
||||
<EgtWPFLib5:EgtTextBox Text="{Binding SectionTime, UpdateSourceTrigger=Explicit}"
|
||||
Grid.Row="0" Grid.Column="1"/>
|
||||
</UniformGrid>
|
||||
<UniformGrid Columns="2"
|
||||
</UniformGrid>
|
||||
<UniformGrid Columns="2"
|
||||
Margin="0,0,0,5">
|
||||
<TextBlock Text="{Binding PartTime_Msg}"
|
||||
<TextBlock Text="{Binding PartTime_Msg}"
|
||||
Grid.Row="1" Grid.Column="0"/>
|
||||
<EgtWPFLib5:EgtTextBox Text="{Binding PartTime, UpdateSourceTrigger=Explicit}"
|
||||
<EgtWPFLib5:EgtTextBox Text="{Binding PartTime, UpdateSourceTrigger=Explicit}"
|
||||
Grid.Row="1" Grid.Column="1"/>
|
||||
</UniformGrid>
|
||||
</StackPanel>
|
||||
</GroupBox>
|
||||
</UniformGrid>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</TabItem.Content>
|
||||
</TabItem>
|
||||
<TabItem Header="Parametri Q">
|
||||
<TabItem.Content>
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="2*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="1*"/>
|
||||
</Grid.RowDefinitions>
|
||||
<EgtBEAMWALL:QParamListV DataContext="{Binding}"
|
||||
</GroupBox>
|
||||
<UniformGrid Columns="2"
|
||||
Margin="0,0,0,5">
|
||||
<TextBlock Text="{Binding PrintLabel_Msg}" VerticalAlignment="Center"/>
|
||||
<CheckBox IsChecked="{Binding bPrintLabel_IsChecked}"
|
||||
Margin="0,5,0,0"/>
|
||||
</UniformGrid>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</TabItem.Content>
|
||||
</TabItem>
|
||||
<TabItem Header="Parametri Q">
|
||||
<TabItem.Content>
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="2*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="1*"/>
|
||||
</Grid.RowDefinitions>
|
||||
<EgtBEAMWALL:QParamListV DataContext="{Binding}"
|
||||
ItemsSource="{Binding QBTLParamVMList}"
|
||||
SelectedItem="{Binding SelQParam}"
|
||||
Grid.Column="0"
|
||||
Margin="5">
|
||||
<DataGrid.GroupStyle>
|
||||
<GroupStyle>
|
||||
<GroupStyle.Panel>
|
||||
<ItemsPanelTemplate>
|
||||
<DataGridRowsPresenter/>
|
||||
</ItemsPanelTemplate>
|
||||
</GroupStyle.Panel>
|
||||
<GroupStyle.HeaderTemplate>
|
||||
<DataTemplate>
|
||||
<StackPanel>
|
||||
<TextBlock Text="{Binding Path=Name}"/>
|
||||
</StackPanel>
|
||||
</DataTemplate>
|
||||
</GroupStyle.HeaderTemplate>
|
||||
<GroupStyle.ContainerStyle>
|
||||
<Style TargetType="{x:Type GroupItem}">
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="{x:Type GroupItem}">
|
||||
<Expander IsExpanded="True">
|
||||
<Expander.Background>
|
||||
<SolidColorBrush Color="#FFBABABA"></SolidColorBrush>
|
||||
</Expander.Background>
|
||||
<Expander.Header>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<TextBlock Text="{Binding Path=Name}" />
|
||||
</StackPanel>
|
||||
</Expander.Header>
|
||||
<ItemsPresenter />
|
||||
</Expander>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
</GroupStyle.ContainerStyle>
|
||||
</GroupStyle>
|
||||
<GroupStyle>
|
||||
<GroupStyle.ContainerStyle>
|
||||
<Style TargetType="{x:Type GroupItem}">
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="{x:Type GroupItem}">
|
||||
<Expander IsExpanded="True">
|
||||
<Expander.Background>
|
||||
<SolidColorBrush Color="LightGray"></SolidColorBrush>
|
||||
</Expander.Background>
|
||||
<Expander.Header>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<TextBlock Text="{Binding Path=Name}" />
|
||||
</StackPanel>
|
||||
</Expander.Header>
|
||||
<ItemsPresenter />
|
||||
</Expander>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
</GroupStyle.ContainerStyle>
|
||||
</GroupStyle>
|
||||
</DataGrid.GroupStyle>
|
||||
</EgtBEAMWALL:QParamListV>
|
||||
</Grid>
|
||||
</TabItem.Content>
|
||||
</TabItem>
|
||||
<TabItem Header="Macchina">
|
||||
<TabItem.Content>
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="10*"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<StackPanel Grid.Row="0" Grid.Column="0" Orientation="Horizontal">
|
||||
<GroupBox Style="{StaticResource GroupBoxStyle_NoHeader}" Padding="5,10,5,5">
|
||||
<EgtBEAMWALL:MachinePanelV DataContext="{Binding MachinePanelVM}" VerticalAlignment="Center"/>
|
||||
</GroupBox>
|
||||
</StackPanel>
|
||||
|
||||
<StackPanel Grid.Row="1" Grid.Column="0" Orientation="Horizontal">
|
||||
<ItemsControl ItemsSource="{Binding ConfigMachTableList}">
|
||||
<ItemsControl.ItemsPanel>
|
||||
<ItemsPanelTemplate>
|
||||
<StackPanel x:Name="GroupStackPanel" Orientation="Horizontal"/>
|
||||
</ItemsPanelTemplate>
|
||||
</ItemsControl.ItemsPanel>
|
||||
<ItemsControl.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<GroupBox Header="{Binding sName}" Width="Auto" VerticalAlignment="Top" Height="Auto">
|
||||
<ItemsControl Name="MachParamsItemsControl" ItemsSource="{Binding MachParamList}" Margin="0,5,0,0">
|
||||
<ItemsControl.ItemsPanel>
|
||||
<ItemsPanelTemplate>
|
||||
<WrapPanel Orientation="Vertical"/>
|
||||
</ItemsPanelTemplate>
|
||||
</ItemsControl.ItemsPanel>
|
||||
<ItemsControl.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<Grid Margin="0,0,5,5">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*" />
|
||||
<ColumnDefinition Width="*" />
|
||||
<ColumnDefinition Width="*" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBlock Text="{Binding sName}"
|
||||
<DataGrid.GroupStyle>
|
||||
<GroupStyle>
|
||||
<GroupStyle.Panel>
|
||||
<ItemsPanelTemplate>
|
||||
<DataGridRowsPresenter/>
|
||||
</ItemsPanelTemplate>
|
||||
</GroupStyle.Panel>
|
||||
<GroupStyle.HeaderTemplate>
|
||||
<DataTemplate>
|
||||
<StackPanel>
|
||||
<TextBlock Text="{Binding Path=Name}"/>
|
||||
</StackPanel>
|
||||
</DataTemplate>
|
||||
</GroupStyle.HeaderTemplate>
|
||||
<GroupStyle.ContainerStyle>
|
||||
<Style TargetType="{x:Type GroupItem}">
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="{x:Type GroupItem}">
|
||||
<Expander IsExpanded="True">
|
||||
<Expander.Background>
|
||||
<SolidColorBrush Color="#FFBABABA"></SolidColorBrush>
|
||||
</Expander.Background>
|
||||
<Expander.Header>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<TextBlock Text="{Binding Path=Name}" />
|
||||
</StackPanel>
|
||||
</Expander.Header>
|
||||
<ItemsPresenter />
|
||||
</Expander>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
</GroupStyle.ContainerStyle>
|
||||
</GroupStyle>
|
||||
<GroupStyle>
|
||||
<GroupStyle.ContainerStyle>
|
||||
<Style TargetType="{x:Type GroupItem}">
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="{x:Type GroupItem}">
|
||||
<Expander IsExpanded="True">
|
||||
<Expander.Background>
|
||||
<SolidColorBrush Color="LightGray"></SolidColorBrush>
|
||||
</Expander.Background>
|
||||
<Expander.Header>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<TextBlock Text="{Binding Path=Name}" />
|
||||
</StackPanel>
|
||||
</Expander.Header>
|
||||
<ItemsPresenter />
|
||||
</Expander>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
</GroupStyle.ContainerStyle>
|
||||
</GroupStyle>
|
||||
</DataGrid.GroupStyle>
|
||||
</EgtBEAMWALL:QParamListV>
|
||||
</Grid>
|
||||
</TabItem.Content>
|
||||
</TabItem>
|
||||
<TabItem Header="Macchina">
|
||||
<TabItem.Content>
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="10*"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<StackPanel Grid.Row="0" Grid.Column="0" Orientation="Horizontal">
|
||||
<GroupBox Style="{StaticResource GroupBoxStyle_NoHeader}" Padding="5,10,5,5">
|
||||
<EgtBEAMWALL:MachinePanelV DataContext="{Binding MachinePanelVM}" VerticalAlignment="Center"/>
|
||||
</GroupBox>
|
||||
</StackPanel>
|
||||
|
||||
<StackPanel Grid.Row="1" Grid.Column="0" Orientation="Horizontal">
|
||||
<ItemsControl ItemsSource="{Binding ConfigMachTableList}">
|
||||
<ItemsControl.ItemsPanel>
|
||||
<ItemsPanelTemplate>
|
||||
<StackPanel x:Name="GroupStackPanel" Orientation="Horizontal"/>
|
||||
</ItemsPanelTemplate>
|
||||
</ItemsControl.ItemsPanel>
|
||||
<ItemsControl.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<GroupBox Header="{Binding sName}" Width="Auto" VerticalAlignment="Top" Height="Auto">
|
||||
<ItemsControl Name="MachParamsItemsControl" ItemsSource="{Binding MachParamList}" Margin="0,5,0,0">
|
||||
<ItemsControl.ItemsPanel>
|
||||
<ItemsPanelTemplate>
|
||||
<WrapPanel Orientation="Vertical"/>
|
||||
</ItemsPanelTemplate>
|
||||
</ItemsControl.ItemsPanel>
|
||||
<ItemsControl.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<Grid Margin="0,0,5,5">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*" />
|
||||
<ColumnDefinition Width="*" />
|
||||
<ColumnDefinition Width="*" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBlock Text="{Binding sName}"
|
||||
TextWrapping="WrapWithOverflow"
|
||||
Width="100"
|
||||
Style="{StaticResource MachParamTextBlock}"/>
|
||||
<EgtWPFLib5:EgtTextBox Text="{Binding sValue, UpdateSourceTrigger=Explicit}"
|
||||
<EgtWPFLib5:EgtTextBox Text="{Binding sValue, UpdateSourceTrigger=Explicit}"
|
||||
Grid.Column="1"
|
||||
Width="70"/>
|
||||
<TextBlock Text="{Binding sDescription}"
|
||||
<TextBlock Text="{Binding sDescription}"
|
||||
TextWrapping="WrapWithOverflow"
|
||||
Width="200"
|
||||
Style="{StaticResource MachParamTextBlock}"
|
||||
Grid.Column="2"/>
|
||||
</Grid>
|
||||
</DataTemplate>
|
||||
</ItemsControl.ItemTemplate>
|
||||
</ItemsControl>
|
||||
</GroupBox>
|
||||
</DataTemplate>
|
||||
</ItemsControl.ItemTemplate>
|
||||
</ItemsControl>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</TabItem.Content>
|
||||
</TabItem>
|
||||
</TabControl>
|
||||
|
||||
<Button Command="{Binding SaveCommand}"
|
||||
</Grid>
|
||||
</DataTemplate>
|
||||
</ItemsControl.ItemTemplate>
|
||||
</ItemsControl>
|
||||
</GroupBox>
|
||||
</DataTemplate>
|
||||
</ItemsControl.ItemTemplate>
|
||||
</ItemsControl>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</TabItem.Content>
|
||||
</TabItem>
|
||||
</TabControl>
|
||||
|
||||
<Button Command="{Binding SaveCommand}"
|
||||
ToolTip="{Binding SaveToolTip}"
|
||||
Grid.Row="1"
|
||||
Grid.Column="1"
|
||||
Style="{StaticResource OptionPanel_Button}">
|
||||
<Image Source="/Resources/ProjectManager/Save.png" Stretch="Uniform"/>
|
||||
</Button>
|
||||
|
||||
</Grid>
|
||||
<Image Source="/Resources/ProjectManager/Save.png" Stretch="Uniform"/>
|
||||
</Button>
|
||||
|
||||
</Grid>
|
||||
</DockPanel>
|
||||
|
||||
@@ -131,7 +131,7 @@ Public Class ConfigurationPageVM
|
||||
End Get
|
||||
Set(value As String)
|
||||
Dim dVal As Double = 0
|
||||
If StringToDouble(value, dVal) AndAlso dVal > 0 Then
|
||||
If StringToDoubleAdv(value, dVal, True) AndAlso dVal > 0 Then
|
||||
m_SectionTime = dVal
|
||||
End If
|
||||
End Set
|
||||
@@ -144,12 +144,22 @@ Public Class ConfigurationPageVM
|
||||
End Get
|
||||
Set(value As String)
|
||||
Dim dVal As Double = 0
|
||||
If StringToDouble(value, dVal) AndAlso dVal > 0 Then
|
||||
If StringToDoubleAdv(value, dVal, True) AndAlso dVal > 0 Then
|
||||
m_PartTime = dVal
|
||||
End If
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_bPrintLabel_IsChecked As Boolean
|
||||
Public Property bPrintLabel_IsChecked As String
|
||||
Get
|
||||
Return m_bPrintLabel_IsChecked
|
||||
End Get
|
||||
Set(value As String)
|
||||
m_bPrintLabel_IsChecked = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
#Region "Messages"
|
||||
|
||||
Public ReadOnly Property L_Msg As String
|
||||
@@ -277,6 +287,12 @@ Public Class ConfigurationPageVM
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property PrintLabel_Msg As String
|
||||
Get
|
||||
Return EgtMsg(61894)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
#End Region ' Messages
|
||||
|
||||
#Region "Constructor"
|
||||
@@ -311,6 +327,7 @@ Public Class ConfigurationPageVM
|
||||
' leggo SectionTime e PartTime
|
||||
GetMainPrivateProfileString(S_NEST, K_SECTIONTIME, "", SectionTime)
|
||||
GetMainPrivateProfileString(S_NEST, K_PARTTIME, "", PartTime)
|
||||
m_bPrintLabel_IsChecked = ( GetMainPrivateProfileInt(S_PRINTER, K_ENABLE, 0) <> 0)
|
||||
' assegno le liste dei parametri della macchina corrente alla ConfigMachTableList alla pagina di Configurazione
|
||||
ConfigMachTableList = CurrentMachine.MachTableList
|
||||
' carico i parametri Q dei Process letti dall'ini
|
||||
@@ -352,18 +369,6 @@ Public Class ConfigurationPageVM
|
||||
''' </summary>
|
||||
Public Sub Save()
|
||||
VerifyConfigPageModification()
|
||||
'Select Case SelConfigSubPage
|
||||
' Case ConfigSubPages.GENERAL
|
||||
' WriteMachParams()
|
||||
' WriteMachParamsLua()
|
||||
' Case ConfigSubPages.QPARAMETERS
|
||||
' WriteProcessParams(PRCList.ToList())
|
||||
' Case ConfigSubPages.MACHINE
|
||||
' WriteMainPrivateProfileString(S_GENERAL, K_MESSAGES, m_SelectedLanguage.Name)
|
||||
' WriteMainPrivateProfileString(S_SCENE, K_MMUNITS, SelMeasureUnit.ToString())
|
||||
' WriteMainPrivateProfileString(S_NEST, K_SECTIONTIME, DoubleToString(m_SectionTime, 5))
|
||||
' WriteMainPrivateProfileString(S_NEST, K_PARTTIME, DoubleToString(m_PartTime, 5))
|
||||
'End Select
|
||||
End Sub
|
||||
|
||||
#End Region ' SaveCommand
|
||||
@@ -455,6 +460,7 @@ Public Class ConfigurationPageVM
|
||||
WriteMainPrivateProfileString(S_SCENE, K_MMUNITS, SelMeasureUnit.ToString())
|
||||
WriteMainPrivateProfileString(S_NEST, K_SECTIONTIME, DoubleToString(m_SectionTime, 5))
|
||||
WriteMainPrivateProfileString(S_NEST, K_PARTTIME, DoubleToString(m_PartTime, 5))
|
||||
WriteMainPrivateProfileString(S_PRINTER, K_ENABLE, If(m_bPrintLabel_IsChecked, 1, 0))
|
||||
Case ConfigSubPages.QPARAMETERS
|
||||
' ciclo sui parametri Q
|
||||
Dim bAskToSaveDefaultValues As Boolean = False
|
||||
@@ -680,11 +686,11 @@ Public Class MachParam
|
||||
' trasformo valori
|
||||
Select Case nType
|
||||
Case MachParamType.DOUBLE_
|
||||
StringToDouble(value, dNewValue)
|
||||
StringToDouble(sOrigValue, dOrigValue)
|
||||
StringToDoubleAdv(value, dNewValue, True)
|
||||
StringToDoubleAdv(sOrigValue, dOrigValue, True)
|
||||
Case MachParamType.LENGTH
|
||||
StringToLen(value, dNewValue)
|
||||
StringToLen(sOrigValue, dOrigValue)
|
||||
StringToLenAdv(value, dNewValue, True)
|
||||
StringToLenAdv(sOrigValue, dOrigValue, True)
|
||||
Case Else
|
||||
' per string non faccio nulla
|
||||
End Select
|
||||
|
||||
@@ -105,9 +105,41 @@
|
||||
<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.ViewerOptimizer.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.ViewerOptimizer.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.ViewerOptimizer.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>
|
||||
<Reference Include="BouncyCastle.Crypto, Version=1.8.5.0, Culture=neutral, PublicKeyToken=0e99375e54769942">
|
||||
<HintPath>..\packages\BouncyCastle.1.8.5\lib\BouncyCastle.Crypto.dll</HintPath>
|
||||
<Reference Include="BouncyCastle.Crypto, Version=1.9.0.0, Culture=neutral, PublicKeyToken=0e99375e54769942, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Portable.BouncyCastle.1.9.0\lib\net40\BouncyCastle.Crypto.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="EgtUILib, Version=2.4.3.1, Culture=neutral, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
@@ -123,20 +155,20 @@
|
||||
<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>
|
||||
</Reference>
|
||||
<Reference Include="Google.Protobuf, Version=3.19.4.0, Culture=neutral, PublicKeyToken=a7d26565bac4d604, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Google.Protobuf.3.19.4\lib\net45\Google.Protobuf.dll</HintPath>
|
||||
<Reference Include="Google.Protobuf, Version=3.21.9.0, Culture=neutral, PublicKeyToken=a7d26565bac4d604, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Google.Protobuf.3.21.9\lib\net45\Google.Protobuf.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Ionic.Zip, Version=1.9.1.8, Culture=neutral, PublicKeyToken=edbe51ad942a3f5c, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Ionic.Zip.1.9.1.8\lib\Ionic.Zip.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="K4os.Compression.LZ4, Version=1.2.6.0, Culture=neutral, PublicKeyToken=2186fa9121ef231d, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\K4os.Compression.LZ4.1.2.6\lib\net46\K4os.Compression.LZ4.dll</HintPath>
|
||||
<Reference Include="K4os.Compression.LZ4, Version=1.3.5.0, Culture=neutral, PublicKeyToken=2186fa9121ef231d, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\K4os.Compression.LZ4.1.3.5\lib\net462\K4os.Compression.LZ4.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="K4os.Compression.LZ4.Streams, Version=1.2.6.0, Culture=neutral, PublicKeyToken=2186fa9121ef231d, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\K4os.Compression.LZ4.Streams.1.2.6\lib\net46\K4os.Compression.LZ4.Streams.dll</HintPath>
|
||||
<Reference Include="K4os.Compression.LZ4.Streams, Version=1.3.5.0, Culture=neutral, PublicKeyToken=2186fa9121ef231d, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\K4os.Compression.LZ4.Streams.1.3.5\lib\net462\K4os.Compression.LZ4.Streams.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="K4os.Hash.xxHash, Version=1.0.6.0, Culture=neutral, PublicKeyToken=32cd54395057cec3, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\K4os.Hash.xxHash.1.0.6\lib\net46\K4os.Hash.xxHash.dll</HintPath>
|
||||
<Reference Include="K4os.Hash.xxHash, Version=1.0.8.0, Culture=neutral, PublicKeyToken=32cd54395057cec3, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\K4os.Hash.xxHash.1.0.8\lib\net462\K4os.Hash.xxHash.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
<Reference Include="MigraDoc.DocumentObjectModel-wpf, Version=1.50.5147.0, Culture=neutral, PublicKeyToken=f94615aa0424f9eb, processorArchitecture=MSIL">
|
||||
@@ -177,18 +209,24 @@
|
||||
<Reference Include="System.Drawing" />
|
||||
<Reference Include="System.Drawing.Design" />
|
||||
<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.Memory, Version=4.0.1.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Memory.4.5.4\lib\net461\System.Memory.dll</HintPath>
|
||||
<Reference Include="System.Memory, Version=4.0.1.2, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Memory.4.5.5\lib\net461\System.Memory.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Numerics" />
|
||||
<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>
|
||||
</Reference>
|
||||
<Reference Include="System.Runtime.CompilerServices.Unsafe, Version=5.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>
|
||||
<Reference Include="System.Runtime.CompilerServices.Unsafe, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Runtime.CompilerServices.Unsafe.6.0.0\lib\net461\System.Runtime.CompilerServices.Unsafe.dll</HintPath>
|
||||
</Reference>
|
||||
<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.Windows.Forms" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
@@ -955,6 +993,9 @@
|
||||
<ItemGroup>
|
||||
<Resource Include="Resources\TopPanel\RemoveAllRawPart.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Resource Include="Resources\ProjectManager\AddProj.png" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.VisualBasic.targets" />
|
||||
<PropertyGroup>
|
||||
<PostBuildEvent>IF "$(PlatformName)"=="x86" IF "$(ConfigurationName)" == "Release" copy $(TargetPath) c:\EgtProg\EgtBEAMWALL\EgtBEAMWALL.ViewerOptimizerR32.exe
|
||||
|
||||
@@ -20,6 +20,16 @@
|
||||
SelectedItem="{Binding Tag.nSelGRP, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:FeatureManagerV}}}"
|
||||
IsEnabled="{Binding FeatureManager_IsEnabled}"
|
||||
Style="{StaticResource FeatureComboBox}"/>
|
||||
<TextBlock Text="{Binding Priority_Msg}"
|
||||
IsEnabled="{Binding FeatureManager_IsEnabled}"
|
||||
Visibility="{Binding Priority_Visibility}"
|
||||
Style="{StaticResource OptionTextBlock}"/>
|
||||
<EgtWPFLib5:EgtTextBox Text="{Binding Tag.sPriority,
|
||||
RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:FeatureManagerV}},
|
||||
UpdateSourceTrigger=Explicit}"
|
||||
IsEnabled="{Binding FeatureManager_IsEnabled}"
|
||||
Visibility="{Binding Priority_Visibility}"
|
||||
Width="45"/>
|
||||
<TextBlock Text="{Binding Tag.sName, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:FeatureManagerV}}}"
|
||||
Style="{StaticResource OptionTextBlock}"/>
|
||||
<Button Content="{Binding Edit_Msg}"
|
||||
|
||||
@@ -27,6 +27,12 @@ Public Class FeatureManagerVM
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property Priority_Visibility As Visibility
|
||||
Get
|
||||
Return If(CurrentMachine.nType = Core.ConstBeam.MachineType.WALL AndAlso CurrentMachine.bIsEnabledPriority, Visibility.Visible, Visibility.Collapsed)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
#Region "Messages"
|
||||
|
||||
Public ReadOnly Property Face_Msg As String
|
||||
@@ -41,6 +47,12 @@ Public Class FeatureManagerVM
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property Priority_Msg As String
|
||||
Get
|
||||
Return EgtMsg(61895)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property Edit_Msg As String
|
||||
Get
|
||||
Return EgtMsg(61826)
|
||||
|
||||
@@ -650,7 +650,7 @@ Public Class FreeContourManagerVM
|
||||
EgtAtParamPoint(m_nNewPathId, Index + 0.5, ptText)
|
||||
Dim dSideAng As Double = 0
|
||||
If sSideAngSplit.Count - 1 >= Index Then
|
||||
StringToDouble(sSideAngSplit(Index), dSideAng)
|
||||
StringToDoubleAdv(sSideAngSplit(Index), dSideAng, True)
|
||||
End If
|
||||
Dim sSideAng As String = DoubleToString( dSideAng, 2) & "°"
|
||||
Dim TextId As Integer = EgtCreateText(nSideAngTextLayer, ptText, sSideAng, 20)
|
||||
@@ -898,7 +898,7 @@ Public Class FreeContourManagerVM
|
||||
If bResult Then
|
||||
' scrivo info con nuova inclinazione
|
||||
Dim dAng As Double
|
||||
StringToDouble(Map.refFreeContourInputVM.Text, dAng)
|
||||
StringToDoubleAdv(Map.refFreeContourInputVM.Text, dAng, True)
|
||||
EgtSetInfo(m_nSelTextId, "SideAng", dAng)
|
||||
Dim sAng As String = DoubleToString( dAng, 2) & "°"
|
||||
EgtModifyText(m_nSelTextId, sAng)
|
||||
|
||||
@@ -83,10 +83,16 @@
|
||||
<!--Descrizione-->
|
||||
<DataGridTextColumn x:Key="colDESC" Binding="{Binding sDesc}">
|
||||
<DataGridTextColumn.Header>
|
||||
<TextBlock Text="{Binding Path=DataContext.Description_Msg,RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:FeatureInPartInRawPartListV}}}"/>
|
||||
<TextBlock Text="{Binding Path=DataContext.Description_Msg, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:FeatureInPartInRawPartListV}}}"/>
|
||||
</DataGridTextColumn.Header>
|
||||
</DataGridTextColumn>
|
||||
</DataGrid.Resources>
|
||||
<!--Descrizione-->
|
||||
<DataGridTextColumn x:Key="colPRIORITY" Binding="{Binding sPriority}">
|
||||
<DataGridTextColumn.Header>
|
||||
<TextBlock Text="{Binding Path=DataContext.Priority_Msg, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:FeatureInPartInRawPartListV}}}"/>
|
||||
</DataGridTextColumn.Header>
|
||||
</DataGridTextColumn>
|
||||
</DataGrid.Resources>
|
||||
|
||||
</EgtBEAMWALLCORE:EgtDataGrid>
|
||||
<!--<TextBlock Grid.Row="1"
|
||||
|
||||
@@ -11,6 +11,13 @@ Public Class FeatureInPartInRawPartListVM
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_colFeatureInPartInRawPart_Priority As EgtDataGridColumn
|
||||
Public ReadOnly Property colFeatureInPartInRawPart_Priority As EgtDataGridColumn
|
||||
Get
|
||||
Return m_colFeatureInPartInRawPart_Priority
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_FeatureInPartInRawPartColumns As New ObservableCollection(Of EgtDataGridColumn)
|
||||
Public Property FeatureInPartInRawPartColumns As ObservableCollection(Of EgtDataGridColumn)
|
||||
Get
|
||||
@@ -35,6 +42,12 @@ Public Class FeatureInPartInRawPartListVM
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property Priority_Msg As String
|
||||
Get
|
||||
Return EgtMsg(61895)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
#End Region ' Messages
|
||||
|
||||
Sub New()
|
||||
@@ -44,6 +57,13 @@ Public Class FeatureInPartInRawPartListVM
|
||||
GetPrivateProfileColumns(S_FEATUREINPARTINRAWPARTLIST, FeatureInPartInRawPartColumns)
|
||||
' recupero riferimento a colonna Do
|
||||
m_colFeatureInPartInRawPart_Do = FeatureInPartInRawPartColumns.FirstOrDefault(Function(x) x.Name = COL_DO)
|
||||
m_colFeatureInPartInRawPart_Priority = FeatureInPartInRawPartColumns.FirstOrDefault(Function(x) x.Name = COL_PRIORITY)
|
||||
End Sub
|
||||
|
||||
Friend Sub UpdateColumns(nMachType As MachineType)
|
||||
If Not IsNothing(m_colFeatureInPartInRawPart_Priority) Then
|
||||
m_colFeatureInPartInRawPart_Priority.Visible = (nMachType = MachineType.WALL AndAlso CurrentMachine.bIsEnabledPriority)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
|
||||
@@ -27,6 +27,13 @@ Public Class RawPartListVM
|
||||
End Get
|
||||
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)
|
||||
Public Property RawPartColumns As ObservableCollection(Of EgtDataGridColumn)
|
||||
Get
|
||||
@@ -120,6 +127,7 @@ Public Class RawPartListVM
|
||||
m_colRawPart_StartCut = RawPartColumns.FirstOrDefault(Function(x) x.Name = COL_STARTCUT)
|
||||
m_colRawPart_W = RawPartColumns.FirstOrDefault(Function(x) x.Name = COL_W)
|
||||
m_colRawPart_L = RawPartColumns.FirstOrDefault(Function(x) x.Name = COL_L)
|
||||
m_colRawPart_PosZ = RawPartColumns.FirstOrDefault(Function(x) x.Name = COL_POSZ)
|
||||
' aggiorno la visibilità delle colonne
|
||||
For Each col In RawPartColumns
|
||||
col.ColumnVisibility = If(col.Visible, Visibility.Visible, Visibility.Collapsed)
|
||||
|
||||
@@ -280,7 +280,7 @@ Public Class LeftPanelVM
|
||||
|
||||
Public Sub NewRawPart(bLast As Boolean)
|
||||
If IsNothing(Map.refProdManagerVM.CurrProd) Then Return
|
||||
Dim SelPart As BTLPartVM = Map.refProjectVM.BTLStructureVM.SelBTLPart
|
||||
'Dim SelPart As BTLPartVM = Map.refProjectVM.BTLStructureVM.SelBTLPart
|
||||
Dim SelParts As List(Of BTLPartVM) = Map.refProjectVM.BTLStructureVM.SelBTLParts.ToList()
|
||||
If IsNothing(SelParts) OrElse SelParts.Count <= 0 Then Return
|
||||
' verifico che abbiano tutti la stessa sezione
|
||||
@@ -436,7 +436,7 @@ Public Class LeftPanelVM
|
||||
Next
|
||||
' scrivo dati costruzione grezzo in gruppo di lavorazione
|
||||
EgtSetInfo(nCurrMachGroup, MGR_RPT_BARLEN, dRawL)
|
||||
EgtSetInfo(nCurrMachGroup, MGR_RPT_MATERIAL, SelPart.sMATERIAL)
|
||||
EgtSetInfo(nCurrMachGroup, MGR_RPT_MATERIAL, SelParts(0).sMATERIAL)
|
||||
' scrivo dati di tutti i pezzi
|
||||
Dim dPosX As Double = WarehouseHelper.GetStartOffset()
|
||||
' ciclo sui pezzi
|
||||
@@ -487,13 +487,13 @@ Public Class LeftPanelVM
|
||||
BeamMachGroup.UpdateUsage()
|
||||
Core.ViewPanelVM.BWSetView(VT.ISO_SW, False)
|
||||
ElseIf Map.refProjectVM.BTLStructureVM.nPROJTYPE = MachineType.WALL Then
|
||||
Dim nPartDuploId As Integer = EgtDuploNew(SelPart.nPartId)
|
||||
Dim nPartDuploId As Integer = EgtDuploNew(SelParts(0).nPartId)
|
||||
' scrivo dati in gruppo di lavorazione
|
||||
Dim dPosX As Double = dKerf
|
||||
Dim dPosY As Double = dKerf
|
||||
EgtSetInfo(nCurrMachGroup, MGR_RPT_PANELLEN, dRawL)
|
||||
EgtSetInfo(nCurrMachGroup, MGR_RPT_PANELWIDTH, dRawW)
|
||||
EgtSetInfo(nCurrMachGroup, MGR_RPT_MATERIAL, SelPart.sMATERIAL)
|
||||
EgtSetInfo(nCurrMachGroup, MGR_RPT_MATERIAL, SelParts(0).sMATERIAL)
|
||||
EgtSetInfo(nCurrMachGroup, MGR_RPT_PART & 1,
|
||||
nPartDuploId & "," & DoubleToString(dPosX, 3) & "," & DoubleToString(dPosY, 3) & ",0,0")
|
||||
Dim WallMachGroup As MyMachGroupVM = Map.refMachGroupPanelVM.MachGroupVMList(Map.refMachGroupPanelVM.MachGroupVMList.Count - 1)
|
||||
@@ -519,10 +519,10 @@ Public Class LeftPanelVM
|
||||
' scrivo dati pezzo
|
||||
EgtSetInfo(nPartDuploId, MGR_PRT_POSX, dPosX)
|
||||
EgtSetInfo(nPartDuploId, MGR_PRT_POSY, dPosY)
|
||||
EgtSetInfo(nPartDuploId, MGR_PRT_ROT, SelPart.nROTATED)
|
||||
EgtSetInfo(nPartDuploId, MGR_PRT_FLIP, SelPart.nINVERTED)
|
||||
EgtSetInfo(nPartDuploId, MGR_PRT_ROT, SelParts(0).nROTATED)
|
||||
EgtSetInfo(nPartDuploId, MGR_PRT_FLIP, SelParts(0).nINVERTED)
|
||||
' aggiorno contatore pezzi usati in Prod
|
||||
SelPart.RefreshPartInProd()
|
||||
SelParts(0).RefreshPartInProd()
|
||||
' aggiorno lista pezzi
|
||||
WallMachGroup.MyMachGroupM.RefreshPartList()
|
||||
WallMachGroup.MyMachGroupM.RefreshGroupData()
|
||||
|
||||
@@ -46,7 +46,7 @@ Public Class MyMachGroupVM
|
||||
End Get
|
||||
Set(value As String)
|
||||
Dim dValue As Double
|
||||
If StringToLen(value, dValue) Then
|
||||
If StringToLenAdv(value, dValue, True) Then
|
||||
Dim nRawPartId As Integer = EgtGetFirstRawPart()
|
||||
If dValue <> MyMachGroupM.dL Then
|
||||
Select Case nType
|
||||
@@ -140,7 +140,7 @@ Public Class MyMachGroupVM
|
||||
End Get
|
||||
Set(value As String)
|
||||
Dim dValue As Double
|
||||
If StringToLen(value, dValue) Then
|
||||
If StringToLenAdv(value, dValue, True) Then
|
||||
If nType = BWType.WALL Then
|
||||
Dim nRawPartId As Integer = EgtGetFirstRawPart()
|
||||
If dValue <> MyMachGroupM.dW Then
|
||||
@@ -211,7 +211,7 @@ Public Class MyMachGroupVM
|
||||
End Get
|
||||
Set(value As String)
|
||||
Dim dValue As Double
|
||||
If StringToLen(value, dValue) Then
|
||||
If StringToLenAdv(value, dValue, True) Then
|
||||
MyMachGroupM.dH = value
|
||||
End If
|
||||
End Set
|
||||
@@ -248,7 +248,7 @@ Public Class MyMachGroupVM
|
||||
End Get
|
||||
Set(value As String)
|
||||
Dim dValue As Double
|
||||
If StringToLen(value, dValue) Then
|
||||
If StringToLenAdv(value, dValue, True) Then
|
||||
Dim dOldValue As Double = MyMachGroupM.dStartCut
|
||||
' verifico se con il nuovo StartCut tutti i pezzi stanno nella barra
|
||||
Dim dTotLength As Double = 0
|
||||
@@ -300,15 +300,15 @@ Public Class MyMachGroupVM
|
||||
End Get
|
||||
Set(value As String)
|
||||
Dim dValue As Double
|
||||
If StringToLen(value, dValue) Then
|
||||
If StringToLenAdv(value, dValue, True) Then
|
||||
Dim nRawPartId As Integer = EgtGetFirstRawPart()
|
||||
If Math.Abs( dValue - MyMachGroupM.dPosZ) > EPS_SMALL Then
|
||||
If Math.Abs(dValue - MyMachGroupM.dPosZ) > EPS_SMALL Then
|
||||
Select Case nType
|
||||
Case BWType.BEAM
|
||||
' non utilizzato
|
||||
Case BWType.WALL
|
||||
' se operazione di spostamento in z ha successo
|
||||
If dValue >= 0 AndAlso EgtMoveRawPart( nRawPartId, New Vector3d(0, 0, dValue - MyMachGroupM.dPosZ)) Then
|
||||
If dValue >= 0 AndAlso EgtMoveRawPart(nRawPartId, New Vector3d(0, 0, dValue - MyMachGroupM.dPosZ)) Then
|
||||
EgtSetInfo(Id, MGR_RPT_PANELPOSZ, dValue)
|
||||
EgtDraw()
|
||||
MyMachGroupM.dPosZ = dValue
|
||||
@@ -806,7 +806,7 @@ Public Class MyMachGroupVM
|
||||
EgtGetInfo(Id, MGR_RPT_PART & 1, sInfo)
|
||||
If Not String.IsNullOrWhiteSpace(sInfo) Then
|
||||
sSplitInfo = sInfo.Split(","c)
|
||||
StringToDouble(sSplitInfo(1), MyMachGroupM.dStartCut)
|
||||
StringToDoubleAdv(sSplitInfo(1), MyMachGroupM.dStartCut)
|
||||
Else
|
||||
MyMachGroupM.dStartCut = 0
|
||||
End If
|
||||
|
||||
@@ -54,14 +54,14 @@ Public Class PartVM
|
||||
End Get
|
||||
Set(value As String)
|
||||
Dim dValue As Double
|
||||
If StringToLen(value, dValue) Then
|
||||
If StringToLenAdv(value, dValue, True) Then
|
||||
Dim dOldValue As Double = m_PartM.dOffset
|
||||
Dim BeamMachGroup As MyMachGroupVM = DirectCast(ParentMachGroupVM, MyMachGroupVM)
|
||||
' se prima trave della barra sostituisco valore anche a startoffset
|
||||
If ParentMachGroupVM.PartVMList(0) Is Me Then
|
||||
m_PartM.dOffset = dValue
|
||||
BeamMachGroup.dStartCut = dValue
|
||||
ElseIf value > CurrentMachine.dMinOffset Then
|
||||
ElseIf dValue > CurrentMachine.dMinOffset Then
|
||||
m_PartM.dOffset = dValue
|
||||
Else
|
||||
m_PartM.dOffset = CurrentMachine.dMinOffset
|
||||
@@ -103,7 +103,7 @@ Public Class PartVM
|
||||
End Get
|
||||
Set(value As String)
|
||||
Dim dValue As Double
|
||||
If StringToLen(value, dValue) Then
|
||||
If StringToLenAdv(value, dValue, True) Then
|
||||
Dim dOldValue As Double = m_PartM.dPOSX
|
||||
Dim dNewValue As Double = dValue
|
||||
Select Case Map.refProjectVM.BTLStructureVM.nPROJTYPE
|
||||
@@ -151,7 +151,7 @@ Public Class PartVM
|
||||
End Get
|
||||
Set(value As String)
|
||||
Dim dValue As Double
|
||||
If StringToLen(value, dValue) Then
|
||||
If StringToLenAdv(value, dValue, True) Then
|
||||
Dim dOldValue As Double = m_PartM.dPOSY
|
||||
Dim dNewValue As Double = dValue
|
||||
' valuto angolo di posizionamento
|
||||
|
||||
@@ -250,10 +250,12 @@ Public Class MainMenuVM
|
||||
' aggiorno le colonne in base al tipo progetto
|
||||
If Not IsNothing(Map.refProjectVM.BTLStructureVM) Then
|
||||
Map.refRawPartListVM.UpdateColumns(Map.refProjectVM.BTLStructureVM.nPROJTYPE)
|
||||
Map.refFeatureInPartInRawPartListVM.UpdateColumns(CurrentMachine.nType)
|
||||
Map.refTopPanelVM.ManageQParamsRowVisibility(Map.refProjectVM.BTLStructureVM.nPROJTYPE <> BWType.BEAM)
|
||||
Map.refPartInRawPartListVM.UpdateColumns(Map.refProjectVM.BTLStructureVM.nPROJTYPE)
|
||||
Else
|
||||
Map.refRawPartListVM.UpdateColumns(BWType.BEAM)
|
||||
Map.refFeatureInPartInRawPartListVM.UpdateColumns(CurrentMachine.nType)
|
||||
Map.refTopPanelVM.ManageQParamsRowVisibility(BWType.BEAM)
|
||||
Map.refPartInRawPartListVM.UpdateColumns(BWType.BEAM)
|
||||
End If
|
||||
@@ -337,6 +339,7 @@ Public Class MainMenuVM
|
||||
If Map.refSceneHostVM.MainController.OpenProject(Map.refProdManagerVM.CurrProd.sProdPath, False) Then
|
||||
' aggiorno le colonne in base al tipo progetto
|
||||
Map.refRawPartListVM.UpdateColumns(Map.refProjectVM.BTLStructureVM.nPROJTYPE)
|
||||
Map.refFeatureInPartInRawPartListVM.UpdateColumns(CurrentMachine.nType)
|
||||
Map.refTopPanelVM.ManageQParamsRowVisibility(Map.refProjectVM.BTLStructureVM.nPROJTYPE <> BWType.BEAM)
|
||||
Map.refPartInRawPartListVM.UpdateColumns(Map.refProjectVM.BTLStructureVM.nPROJTYPE)
|
||||
' resetto modifica parametri Q default
|
||||
@@ -373,6 +376,12 @@ Public Class MainMenuVM
|
||||
Map.refProdManagerVM.CurrProd.SetReloadProject(True)
|
||||
End If
|
||||
'DbControllers.m_ProdController.ResetController()
|
||||
' se Warehouse di tipo Medium e piu' di un progetto collegato
|
||||
Dim nDefault As Integer = 2
|
||||
If GetMainPrivateProfileInt(S_WAREHOUSE, EgtBEAMWALL.Core.ConstIni.K_TYPE, nDefault) = WarehouseType.MEDIUM AndAlso Map.refProdManagerVM.CurrProd.nProjIdList.Count > 1 Then
|
||||
' confronto le Sezioni del BTL importato con quelle in Warehouse
|
||||
WarehouseWndVM.UpdateSectionXMaterial()
|
||||
End If
|
||||
' aggiorno titolo
|
||||
Map.refMainWindowVM.UpdateTitle()
|
||||
DbControllers.m_ProdController.LockByProdId(Map.refProdManagerVM.CurrProd.nProdId, True, Map.refMainWindowVM.MainWindowM.GetKeyNumber())
|
||||
@@ -478,10 +487,12 @@ Public Class MainMenuVM
|
||||
Map.refConfigurationPageVM.bModifyMachParam = False
|
||||
If Not IsNothing(Map.refProjectVM.BTLStructureVM) Then
|
||||
Map.refRawPartListVM.UpdateColumns(Map.refProjectVM.BTLStructureVM.nPROJTYPE)
|
||||
Map.refFeatureInPartInRawPartListVM.UpdateColumns(CurrentMachine.nType)
|
||||
Map.refTopPanelVM.ManageQParamsRowVisibility(Map.refProjectVM.BTLStructureVM.nPROJTYPE <> BWType.BEAM)
|
||||
Map.refPartInRawPartListVM.UpdateColumns(Map.refProjectVM.BTLStructureVM.nPROJTYPE)
|
||||
Else
|
||||
Map.refRawPartListVM.UpdateColumns(BWType.BEAM)
|
||||
Map.refFeatureInPartInRawPartListVM.UpdateColumns(CurrentMachine.nType)
|
||||
Map.refTopPanelVM.ManageQParamsRowVisibility(BWType.BEAM)
|
||||
Map.refPartInRawPartListVM.UpdateColumns(BWType.BEAM)
|
||||
End If
|
||||
|
||||
@@ -150,7 +150,7 @@ Public Class MainWindowM
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_sWarehouseDir As String
|
||||
Private m_sWarehouseDir As String = ""
|
||||
Friend ReadOnly Property sWarehouseDir As String
|
||||
Get
|
||||
Return m_sWarehouseDir
|
||||
@@ -226,9 +226,17 @@ Public Class MainWindowM
|
||||
EgtSetNestKey(sNestKey)
|
||||
' Verifico abilitazione nesting automatico
|
||||
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
|
||||
Dim bKey As Boolean = EgtGetKeyLevel(5327, 2503, 1, m_nKeyLevel) And
|
||||
EgtGetKeyOptions(5327, 2503, 1, m_nKeyOptions)
|
||||
Dim bKey As Boolean = EgtGetKeyLevel(5327, 2506, 1, m_nKeyLevel) And
|
||||
EgtGetKeyOptions(5327, 2506, 1, m_nKeyOptions)
|
||||
' Inizializzazione generale di EgtInterface
|
||||
m_nDebug = GetMainPrivateProfileInt(S_GENERAL, K_DEBUG, 0)
|
||||
m_sLogFile = m_sTempDir & "\" & VWOPTGENLOG_FILE_NAME.Replace("#", m_nInstance.ToString())
|
||||
|
||||
@@ -20,7 +20,7 @@ Public Class MovePartInRawPartWndVM
|
||||
End Get
|
||||
Set(value As String)
|
||||
Dim dTempMoveLen As Double
|
||||
If StringToLen(value, dTempMoveLen) AndAlso dTempMoveLen > 0 Then
|
||||
If StringToLenAdv(value, dTempMoveLen, True) AndAlso dTempMoveLen > 0 Then
|
||||
m_dMoveLen = dTempMoveLen
|
||||
Else
|
||||
m_dMoveLen = 0
|
||||
|
||||
@@ -70,5 +70,5 @@ Imports System.Windows
|
||||
' by using the '*' as shown below:
|
||||
' <Assembly: AssemblyVersion("1.0.*")>
|
||||
|
||||
<Assembly: AssemblyVersion("2.5.3.2")>
|
||||
<Assembly: AssemblyFileVersion("2.5.3.2")>
|
||||
<Assembly: AssemblyVersion("2.5.6.2")>
|
||||
<Assembly: AssemblyFileVersion("2.5.6.2")>
|
||||
|
||||
@@ -366,6 +366,12 @@ Public Class NestingRunningWndVM
|
||||
End If
|
||||
nOutlineId = EgtGetNext(nOutlineId)
|
||||
End While
|
||||
' verifico se nesting XZ tipo BTL o XY standar
|
||||
Dim dRawPartBtlH As Double
|
||||
EgtGetInfo( nRawPartId, "H", dRawPartBtlH)
|
||||
Dim dRawPartBtlW As Double
|
||||
EgtGetInfo( nRawPartId, "W", dRawPartBtlW)
|
||||
Dim bRefBtl As Boolean = ( Map.refProjectVM.BTLStructureVM.nPROJTYPE = BWType.WALL AndAlso dRawPartBtlW > dRawPartBtlH)
|
||||
' recupero i pezzi con frame
|
||||
Dim PartList As New List(Of NestPartWithFrame)
|
||||
Dim nPartPlaceHolderId As Integer = EgtGetFirstInGroup(nRawPartId)
|
||||
@@ -392,7 +398,12 @@ Public Class NestingRunningWndVM
|
||||
' calcolo riferimento
|
||||
Dim frPlaceHolder As New Frame3d
|
||||
EgtFrame(nPartPlaceHolderId, nRawPartId, frPlaceHolder)
|
||||
Dim p3Origin As Point3d = New Point3d(frPlaceHolder.Orig.x, frPlaceHolder.Orig.z, 0)
|
||||
Dim p3Origin As Point3d
|
||||
If bRefBtl Then
|
||||
p3Origin = New Point3d(frPlaceHolder.Orig.x, frPlaceHolder.Orig.z, 0)
|
||||
Else
|
||||
p3Origin = New Point3d(frPlaceHolder.Orig.x, frPlaceHolder.Orig.y, 0)
|
||||
End If
|
||||
' lo rendo std
|
||||
EgtSetMode(nPartDuploId, GDB_MD.STD)
|
||||
PartList.Add(New NestPartWithFrame(nPartPlaceHolderId, p3Origin, frPlaceHolder, nPartDuploId, nSourceId))
|
||||
@@ -424,7 +435,8 @@ Public Class NestingRunningWndVM
|
||||
Dim dPosX As Double = NestPart.p3Orig.x
|
||||
Dim dPosY As Double = NestPart.p3Orig.y
|
||||
Dim b3Duplo As New BBox3d
|
||||
EgtGetBBoxGlob(NestPart.nPartDuploId, GDB_BB.STANDARD, b3Duplo)
|
||||
Dim nBoxLayId As Integer = EgtGetFirstNameInGroup( NestPart.nPartDuploId, "Box")
|
||||
EgtGetBBoxGlob(nBoxLayId, GDB_BB.STANDARD, b3Duplo)
|
||||
' calcolo rot ed invert da frame
|
||||
If Map.refProjectVM.BTLStructureVM.nPROJTYPE = BWType.BEAM Then
|
||||
If AreSameVectorApprox(NestPart.frFrame.VersX, Vector3d.X_AX) Then
|
||||
@@ -442,30 +454,138 @@ Public Class NestingRunningWndVM
|
||||
EgtRotate(NestPart.nPartDuploId, b3Duplo.Center, Vector3d.X_AX, dRot)
|
||||
EgtRotate(NestPart.nPartDuploId, b3Duplo.Center, Vector3d.Z_AX, dFlip)
|
||||
ElseIf Map.refProjectVM.BTLStructureVM.nPROJTYPE = BWType.WALL Then
|
||||
'Dim frPlaceHolder As New Frame3d
|
||||
'EgtFrame(NestPart.nPartId, GDB_ID.ROOT, frPlaceHolder)
|
||||
'Dim frDuplo As New Frame3d
|
||||
'EgtFrame(NestPart.nPartDuploId, GDB_ID.ROOT, frDuplo)
|
||||
'Dim dDuploRot As Double = GetAngle(frDuplo.VersX, frPlaceHolder.VersX)
|
||||
'Dim dDuploFlip As Double = GetAngle(frDuplo.VersY, frPlaceHolder.VersY)
|
||||
'If dDuploFlip > 180 - 10 * EPS_SMALL AndAlso dDuploFlip < 180 + 10 * EPS_SMALL Then
|
||||
' dDuploRot -= 180
|
||||
'End If
|
||||
If NestPart.frFrame.GetEgtType() = Frame3d.TYPE.TOP Then
|
||||
dFlip = 180
|
||||
dRot = 180
|
||||
dPosX = b3Box.DimX() - b3Duplo.DimX() - dPosX
|
||||
ElseIf AreSameVectorApprox(NestPart.frFrame.VersX, -Vector3d.X_AX) AndAlso AreSameVectorApprox(NestPart.frFrame.VersY, Vector3d.Y_AX) Then
|
||||
dFlip = 180
|
||||
dRot = 0
|
||||
dPosX = b3Box.DimX() - dPosX
|
||||
dPosY -= b3Duplo.DimY()
|
||||
If bRefBtl Then
|
||||
Dim vtFrVersX As Vector3d = NestPart.frFrame.VersX
|
||||
Dim vtFrVersY As Vector3d = NestPart.frFrame.VersY
|
||||
If Math.Abs( vtFrVersX.z) > EPS_SMALL Or
|
||||
Math.Abs( vtFrVersX.z) > EPS_SMALL Then
|
||||
vtFrVersX = New Vector3d( vtFrVersX.y, vtFrVersX.z, 0)
|
||||
vtFrVersY = New Vector3d( vtFrVersY.y, vtFrVersY.z, 0)
|
||||
End If
|
||||
If AreSameVectorApprox(vtFrVersX, Vector3d.X_AX) AndAlso
|
||||
AreSameVectorApprox(vtFrVersY, Vector3d.Y_AX) Then
|
||||
dFlip = 0
|
||||
dRot = 0
|
||||
dPosX = dPosX
|
||||
dPosY = dPosY
|
||||
ElseIf AreSameVectorApprox(vtFrVersX, -Vector3d.X_AX) AndAlso
|
||||
AreSameVectorApprox(vtFrVersY, Vector3d.Y_AX) Then
|
||||
dFlip = 0
|
||||
dRot = 180
|
||||
dPosX = dPosX - b3Duplo.DimX()
|
||||
dPosY = dPosY - b3Duplo.DimY()
|
||||
ElseIf AreSameVectorApprox(vtFrVersX, Vector3d.X_AX) AndAlso
|
||||
AreSameVectorApprox(vtFrVersY, -Vector3d.Y_AX) Then
|
||||
dFlip = 180
|
||||
dRot = 0
|
||||
dPosX = dPosX
|
||||
dPosY = dPosY - b3Duplo.DimY()
|
||||
ElseIf AreSameVectorApprox(vtFrVersX, -Vector3d.X_AX) AndAlso
|
||||
AreSameVectorApprox(vtFrVersY, -Vector3d.Y_AX) Then
|
||||
dFlip = 180
|
||||
dRot = 180
|
||||
dPosX = dPosX - b3Duplo.DimX()
|
||||
dPosY = dPosY
|
||||
ElseIf AreSameVectorApprox(vtFrVersX, Vector3d.Y_AX) AndAlso
|
||||
AreSameVectorApprox(vtFrVersY, Vector3d.X_AX) Then
|
||||
dFlip = 0
|
||||
dRot = -90
|
||||
dPosX = dPosX - b3Duplo.DimY()
|
||||
dPosY = dPosY
|
||||
ElseIf AreSameVectorApprox(vtFrVersX, -Vector3d.Y_AX) AndAlso
|
||||
AreSameVectorApprox(vtFrVersY, Vector3d.X_AX) Then
|
||||
dFlip = 0
|
||||
dRot = 90
|
||||
dPosX = dPosX
|
||||
dPosY = dPosY - b3Duplo.DimX()
|
||||
ElseIf AreSameVectorApprox(vtFrVersX, Vector3d.Y_AX) AndAlso
|
||||
AreSameVectorApprox(vtFrVersY, -Vector3d.X_AX) Then
|
||||
dFlip = 180
|
||||
dRot = -90
|
||||
dPosX = dPosX
|
||||
dPosY = dPosY
|
||||
ElseIf AreSameVectorApprox(vtFrVersX, -Vector3d.Y_AX) AndAlso
|
||||
AreSameVectorApprox(vtFrVersY, -Vector3d.X_AX) Then
|
||||
dFlip = 180
|
||||
dRot = 90
|
||||
dPosX = dPosX - b3Duplo.DimY()
|
||||
dPosY = dPosY - b3Duplo.DimX()
|
||||
Else
|
||||
' errore, la parete deve stare nel piano del grezzo
|
||||
EgtOutLog(String.Format("Errore in BTL nesting, pezzo {0} non giace nel piano XY ({1})", NestPart.nPartDuploId, NestPart.frFrame.VersZ))
|
||||
Continue For
|
||||
End If
|
||||
Else
|
||||
' errore, la parete deve stare nel piano del grezzo
|
||||
EgtOutLog(String.Format("Errore in BTL nesting, pezzo {0} non giace nel piano XY ({1})", NestPart.nPartDuploId, NestPart.frFrame.VersZ))
|
||||
Continue For
|
||||
If AreSameVectorApprox(NestPart.frFrame.VersX, Vector3d.X_AX) AndAlso
|
||||
AreSameVectorApprox(NestPart.frFrame.VersY, Vector3d.Y_AX) Then
|
||||
dFlip = 0
|
||||
dRot = 0
|
||||
dPosX = dPosX
|
||||
dPosY = dPosY
|
||||
ElseIf AreSameVectorApprox(NestPart.frFrame.VersX, -Vector3d.X_AX) AndAlso
|
||||
AreSameVectorApprox(NestPart.frFrame.VersY, Vector3d.Y_AX) Then
|
||||
dFlip = 180
|
||||
dRot = 180
|
||||
dPosX = dPosX - b3Duplo.DimX()
|
||||
dPosY = dPosY
|
||||
ElseIf AreSameVectorApprox(NestPart.frFrame.VersX, Vector3d.X_AX) AndAlso
|
||||
AreSameVectorApprox(NestPart.frFrame.VersY, -Vector3d.Y_AX) Then
|
||||
dFlip = 180
|
||||
dRot = 0
|
||||
dPosX = dPosX
|
||||
dPosY = dPosY - b3Duplo.DimY()
|
||||
ElseIf AreSameVectorApprox(NestPart.frFrame.VersX, -Vector3d.X_AX) AndAlso
|
||||
AreSameVectorApprox(NestPart.frFrame.VersY, -Vector3d.Y_AX) Then
|
||||
dFlip = 0
|
||||
dRot = 180
|
||||
dPosX = dPosX - b3Duplo.DimX()
|
||||
dPosY = dPosY - b3Duplo.DimY()
|
||||
ElseIf AreSameVectorApprox(NestPart.frFrame.VersX, Vector3d.Y_AX) AndAlso
|
||||
AreSameVectorApprox(NestPart.frFrame.VersY, Vector3d.X_AX) Then
|
||||
dFlip = 180
|
||||
dRot = -90
|
||||
dPosX = dPosX
|
||||
dPosY = dPosY
|
||||
ElseIf AreSameVectorApprox(NestPart.frFrame.VersX, -Vector3d.Y_AX) AndAlso
|
||||
AreSameVectorApprox(NestPart.frFrame.VersY, Vector3d.X_AX) Then
|
||||
dFlip = 0
|
||||
dRot = 90
|
||||
dPosX = dPosX
|
||||
dPosY = dPosY - b3Duplo.DimX()
|
||||
ElseIf AreSameVectorApprox(NestPart.frFrame.VersX, Vector3d.Y_AX) AndAlso
|
||||
AreSameVectorApprox(NestPart.frFrame.VersY, -Vector3d.X_AX) Then
|
||||
dFlip = 0
|
||||
dRot = -90
|
||||
dPosX = dPosX - b3Duplo.DimY()
|
||||
dPosY = dPosY
|
||||
ElseIf AreSameVectorApprox(NestPart.frFrame.VersX, -Vector3d.Y_AX) AndAlso
|
||||
AreSameVectorApprox(NestPart.frFrame.VersY, -Vector3d.X_AX) Then
|
||||
dFlip = 180
|
||||
dRot = 90
|
||||
dPosX = dPosX - b3Duplo.DimY()
|
||||
dPosY = dPosY - b3Duplo.DimX()
|
||||
Else
|
||||
' errore, la parete deve stare nel piano del grezzo
|
||||
EgtOutLog(String.Format("Errore in BTL nesting, pezzo {0} non giace nel piano XY ({1})", NestPart.nPartDuploId, NestPart.frFrame.VersZ))
|
||||
Continue For
|
||||
End If
|
||||
End If
|
||||
' faccio rotazioni
|
||||
' Se pannello ribaltato
|
||||
Dim bSideOppo As Boolean = (GetMainPrivateProfileInt(S_IMPORT, K_WALLOPPOSITESIDENESTING, 0) <> 0)
|
||||
If bSideOppo Then
|
||||
dFlip = ( dFlip + 180) Mod 360
|
||||
Dim bUseX As Boolean
|
||||
If Math.Abs( dRot Mod 180) < EPS_ANG_SMALL Then
|
||||
dRot = ( dRot + 180) Mod 360
|
||||
bUseX = True
|
||||
Else
|
||||
dRot = dRot
|
||||
bUseX = False
|
||||
End If
|
||||
dPosX = -dPosX - If( bUseX, b3Duplo.DimX(), b3Duplo.DimY()) + b3Box.DimX()
|
||||
dPosY = dPosY
|
||||
End If
|
||||
' Applico le rotazioni
|
||||
EgtRotate(NestPart.nPartDuploId, b3Duplo.Center, Vector3d.X_AX, dFlip)
|
||||
EgtRotate(NestPart.nPartDuploId, b3Duplo.Center, -Vector3d.Z_AX, dRot)
|
||||
End If
|
||||
|
||||
@@ -14,57 +14,11 @@ Public Class OpenProjectFileDialogVM
|
||||
m_ProjectType = ProjectType
|
||||
' carico colonne
|
||||
LoadColumns(ProjectType)
|
||||
NotifyPropertyChanged(NameOf(SearchColumnList))
|
||||
m_SelSearchColumn = m_SearchColumnList(0)
|
||||
NotifyPropertyChanged(NameOf(FilterTypeList))
|
||||
m_SelFilterType = m_FilterTypeList(0)
|
||||
' carico lista progetti
|
||||
If IsNothing(CurrProjectList) OrElse CurrProjectList.Count = 0 Then
|
||||
' leggo da db
|
||||
If ProjectType = ProjectType.PROJ Then
|
||||
Dim DbProjectList As New List(Of ProjFileM)
|
||||
DbProjectList = DbControllers.m_ProjController.GetLastDesc(5000)
|
||||
For Each Project In DbProjectList
|
||||
' recupero path per verificare esista
|
||||
If IsNothing(Project.nProjId) OrElse Project.nProjId = 0 Then Continue For
|
||||
Dim sPath As String = Map.refMainWindowVM.MainWindowM.sProjsDir & "\" & Project.nProjId.ToString("0000") & "\" & Project.nProjId.ToString("0000") & ".nge"
|
||||
If File.Exists(sPath) Then
|
||||
m_ProjectList.Add(New ProjFileVM(Project))
|
||||
Else
|
||||
DbControllers.m_ProjController.DeleteProj(Project.nProjId)
|
||||
EgtOutLog("Found project on Db without the folder and erased it! Proj number " & Project.nProjId.ToString("0000"))
|
||||
End If
|
||||
Next
|
||||
ElseIf ProjectType = ProjectType.PROD Then
|
||||
Dim DbProjectList As New List(Of ProdFileM)
|
||||
DbProjectList = DbControllers.m_ProdController.GetLastDesc(5000)
|
||||
If GoToProd Then
|
||||
For Each Project In DbProjectList
|
||||
' recupero path per verificare esista
|
||||
If IsNothing(Project.nProdId) OrElse Project.nProdId = 0 Then Continue For
|
||||
Dim sPath As String = Map.refMainWindowVM.MainWindowM.sProdsDir & "\" & Project.nProdId.ToString("0000") & "\" & Project.nProdId.ToString("0000") & ".nge"
|
||||
If Project.sMachine = Map.refProjManagerVM.CurrProj.sMachine AndAlso
|
||||
Project.nType = Map.refProjManagerVM.CurrProj.nType Then
|
||||
If File.Exists(sPath) Then
|
||||
m_ProjectList.Add(New ProdFileVM(Project))
|
||||
Else
|
||||
DbControllers.m_ProdController.DeleteProd(Project.nProdId)
|
||||
EgtOutLog("Found project on Db without the folder and erased it! Prod number " & Project.nProdId.ToString("0000"))
|
||||
End If
|
||||
End If
|
||||
Next
|
||||
Else
|
||||
For Each Project In DbProjectList
|
||||
' recupero path per verificare esista
|
||||
If IsNothing(Project.nProdId) OrElse Project.nProdId = 0 Then Continue For
|
||||
Dim sPath As String = Map.refMainWindowVM.MainWindowM.sProdsDir & "\" & Project.nProdId.ToString("0000") & "\" & Project.nProdId.ToString("0000") & ".nge"
|
||||
If File.Exists(sPath) Then
|
||||
m_ProjectList.Add(New ProdFileVM(Project))
|
||||
Else
|
||||
DbControllers.m_ProdController.DeleteProd(Project.nProdId)
|
||||
EgtOutLog("Found project on Db without the folder and erased it! Prod number " & Project.nProdId.ToString("0000"))
|
||||
End If
|
||||
Next
|
||||
End If
|
||||
End If
|
||||
RefreshProjectList(GoToProd)
|
||||
Else
|
||||
m_ProjectList = New ObservableCollection(Of ProjectFileVM)(CurrProjectList)
|
||||
NotifyPropertyChanged(NameOf(ProjectList))
|
||||
@@ -73,6 +27,89 @@ Public Class OpenProjectFileDialogVM
|
||||
m_ProjectList_View.Filter = AddressOf ProjectFilter
|
||||
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.PROJ Then
|
||||
Dim DbProjectList As New List(Of ProjFileM)
|
||||
' CheckMe: lasciato come prima, anche NON attivi (cancellazione logica)
|
||||
If m_SelBTLDateType = BTLDateTypes.CREATEDATE Then
|
||||
DbProjectList = DbControllers.m_ProjController.GetLastDesc(dtStart, dtEnd, nRowQuantity, True)
|
||||
Else
|
||||
DbProjectList = DbControllers.m_ProjController.GetLastByExpDesc(dtStart, dtEnd, nRowQuantity, False)
|
||||
End If
|
||||
For Each Project In DbProjectList
|
||||
' recupero path per verificare esista
|
||||
If IsNothing(Project.nProjId) OrElse Project.nProjId = 0 Then Continue For
|
||||
Dim sPath As String = Map.refMainWindowVM.MainWindowM.sProjsDir & "\" & Project.nProjId.ToString("0000") & "\" & Project.nProjId.ToString("0000") & ".nge"
|
||||
If File.Exists(sPath) Then
|
||||
m_ProjectList.Add(New ProjFileVM(Project))
|
||||
Else
|
||||
' CheckMe impostata come cancellazione FISICA dal DB...
|
||||
DbControllers.m_ProjController.DeleteProj(Project.nProjId, False)
|
||||
EgtOutLog("Found project on Db without the folder and erased it! Proj number " & Project.nProjId.ToString("0000"))
|
||||
End If
|
||||
Next
|
||||
ElseIf m_ProjectType = ProjectType.PROD Then
|
||||
Dim DbProjectList As New List(Of ProdFileM)
|
||||
DbProjectList = DbControllers.m_ProdController.GetLastDesc(dtStart, dtEnd, nRowQuantity, True)
|
||||
If GoToProd Then
|
||||
For Each Project In DbProjectList
|
||||
' recupero path per verificare esista
|
||||
If IsNothing(Project.nProdId) OrElse Project.nProdId = 0 Then Continue For
|
||||
Dim sPath As String = Map.refMainWindowVM.MainWindowM.sProdsDir & "\" & Project.nProdId.ToString("0000") & "\" & Project.nProdId.ToString("0000") & ".nge"
|
||||
If Project.sMachine = Map.refProjManagerVM.CurrProj.sMachine AndAlso
|
||||
Project.nType = Map.refProjManagerVM.CurrProj.nType Then
|
||||
If File.Exists(sPath) Then
|
||||
m_ProjectList.Add(New ProdFileVM(Project))
|
||||
Else
|
||||
DbControllers.m_ProdController.DeleteProd(Project.nProdId)
|
||||
EgtOutLog("Found project on Db without the folder and erased it! Prod number " & Project.nProdId.ToString("0000"))
|
||||
End If
|
||||
End If
|
||||
Next
|
||||
Else
|
||||
For Each Project In DbProjectList
|
||||
' recupero path per verificare esista
|
||||
If IsNothing(Project.nProdId) OrElse Project.nProdId = 0 Then Continue For
|
||||
Dim sPath As String = Map.refMainWindowVM.MainWindowM.sProdsDir & "\" & Project.nProdId.ToString("0000") & "\" & Project.nProdId.ToString("0000") & ".nge"
|
||||
If File.Exists(sPath) Then
|
||||
m_ProjectList.Add(New ProdFileVM(Project))
|
||||
Else
|
||||
DbControllers.m_ProdController.DeleteProd(Project.nProdId)
|
||||
EgtOutLog("Found project on Db without the folder and erased it! Prod number " & Project.nProdId.ToString("0000"))
|
||||
End If
|
||||
Next
|
||||
End If
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Public Overrides Sub Delete()
|
||||
If IsNothing(SelProject) Then Return
|
||||
' recupero indice per riselezionare
|
||||
@@ -91,7 +128,8 @@ Public Class OpenProjectFileDialogVM
|
||||
Map.refProjManagerVM.m_MruFiles.Remove(SelProject.sProjPath)
|
||||
Map.refProjManagerVM.NotifyPropertyChanged(NameOf(Map.refProjManagerVM.MruFileNames))
|
||||
' cancello progetto
|
||||
DbControllers.m_ProjController.DeleteProj(SelProject.nProjId)
|
||||
' CheckMe impostata come cancellazione FISICA dal DB...
|
||||
DbControllers.m_ProjController.DeleteProj(SelProject.nProjId, False)
|
||||
' cancello cartella del Proj
|
||||
Try
|
||||
Directory.Delete(SelProject.sProjDirPath, True)
|
||||
@@ -101,7 +139,7 @@ Public Class OpenProjectFileDialogVM
|
||||
' aggiorno lista progetti
|
||||
m_ProjectList.Clear()
|
||||
Dim DbProjectList As New List(Of ProjFileM)
|
||||
DbProjectList = DbControllers.m_ProjController.GetLastDesc(50)
|
||||
DbProjectList = DbControllers.m_ProjController.GetLastDesc(50, False)
|
||||
For Each Project In DbProjectList
|
||||
m_ProjectList.Add(New ProjFileVM(Project))
|
||||
Next
|
||||
@@ -126,28 +164,40 @@ Public Class OpenProjectFileDialogVM
|
||||
If nTempCtx <> 0 Then
|
||||
' inizializzo gestore lavorazioni
|
||||
EgtInitMachMgr(Map.refMainWindowVM.MainWindowM.sMachinesRoot, Map.refMainWindowVM.MainWindowM.sToolMakersDir)
|
||||
EgtOpenFile(SelProject.sProdPath)
|
||||
' cancello tutti i gruppi di lavorazione
|
||||
Dim nMachGroupId As Integer = EgtGetFirstMachGroup()
|
||||
While nMachGroupId <> GDB_ID.NULL
|
||||
EgtSetCurrMachGroup(nMachGroupId)
|
||||
Dim nRawPartId As Integer = EgtGetFirstRawPart()
|
||||
While nRawPartId <> GDB_ID.NULL
|
||||
Dim nPartId As Integer = EgtGetFirstPartInRawPart(nRawPartId)
|
||||
While nPartId <> GDB_ID.NULL
|
||||
EgtRemovePartFromRawPart(nPartId)
|
||||
' elimino pezzo copia
|
||||
EgtErase(nPartId)
|
||||
nPartId = EgtGetFirstPartInRawPart(nRawPartId)
|
||||
End While
|
||||
nRawPartId = EgtGetNextRawPart(nRawPartId)
|
||||
End While
|
||||
EgtRemoveMachGroup(nMachGroupId)
|
||||
nMachGroupId = EgtGetFirstMachGroup()
|
||||
End While
|
||||
' lo salvo in tutti i proj correlati
|
||||
' apro, ripulisco e salvo il progetto in tutti i proj correlati
|
||||
Dim ProdFile As ProdFileVM = DirectCast(SelProject, ProdFileVM)
|
||||
For Each nProjId In ProdFile.nProjIdList
|
||||
EgtOpenFile(SelProject.sProdPath)
|
||||
' cancello tutti i gruppi di lavorazione
|
||||
Dim nMachGroupId As Integer = EgtGetFirstMachGroup()
|
||||
While nMachGroupId <> GDB_ID.NULL
|
||||
EgtSetCurrMachGroup(nMachGroupId)
|
||||
Dim nRawPartId As Integer = EgtGetFirstRawPart()
|
||||
While nRawPartId <> GDB_ID.NULL
|
||||
Dim nPartId As Integer = EgtGetFirstPartInRawPart(nRawPartId)
|
||||
While nPartId <> GDB_ID.NULL
|
||||
EgtRemovePartFromRawPart(nPartId)
|
||||
' elimino pezzo copia
|
||||
EgtErase(nPartId)
|
||||
nPartId = EgtGetFirstPartInRawPart(nRawPartId)
|
||||
End While
|
||||
nRawPartId = EgtGetNextRawPart(nRawPartId)
|
||||
End While
|
||||
EgtRemoveMachGroup(nMachGroupId)
|
||||
nMachGroupId = EgtGetFirstMachGroup()
|
||||
End While
|
||||
' cancello tutti i gruppi che sono di un progetto diverso da questo
|
||||
Dim nGroupId As Integer = EgtGetFirstInGroup(GDB_ID.ROOT)
|
||||
While nGroupId <> GDB_ID.NULL
|
||||
Dim nGroupProjId As Integer = GDB_ID.NULL
|
||||
Dim nNextGroupId As Integer = EgtGetNext(nGroupId)
|
||||
If EgtGetInfo(nGroupId, BTL_PRT_PROJ, nGroupProjId) Then
|
||||
If nGroupProjId <> nProjId Then
|
||||
EgtErase(nGroupId)
|
||||
End If
|
||||
End If
|
||||
nGroupId = nNextGroupId
|
||||
End While
|
||||
EgtSaveFile(ProdFile.GetProjPath(nProjId), NGE.CMPTEXT)
|
||||
Next
|
||||
' torno sul contesto corrente
|
||||
@@ -167,7 +217,7 @@ Public Class OpenProjectFileDialogVM
|
||||
' aggiorno lista progetti
|
||||
m_ProjectList.Clear()
|
||||
Dim DbProjectList As New List(Of ProdFileM)
|
||||
DbProjectList = DbControllers.m_ProdController.GetLastDesc(50)
|
||||
DbProjectList = DbControllers.m_ProdController.GetLastDesc(50, False)
|
||||
For Each Project In DbProjectList
|
||||
m_ProjectList.Add(New ProdFileVM(Project))
|
||||
Next
|
||||
|
||||
@@ -39,9 +39,9 @@
|
||||
</Button>-->
|
||||
<Button Command="{Binding AddProj_Command}"
|
||||
ToolTip="{Binding AddProj_ToolTip}"
|
||||
Visibility="Collapsed"
|
||||
Visibility="{Binding AddProj_Visibility}"
|
||||
Style="{StaticResource ToolBar_Button}">
|
||||
<Image Source="/Resources/ProjectManager/Import.png" Stretch="Uniform"/>
|
||||
<Image Source="/Resources/ProjectManager/AddProj.png" Stretch="Uniform"/>
|
||||
</Button>
|
||||
<Button Command="{Binding GoToProj_Command}"
|
||||
ToolTip="{Binding GoToProj_ToolTip}"
|
||||
|
||||
@@ -84,10 +84,18 @@ Public Class ProdManagerVM
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_AddProj_Visibility As Visibility
|
||||
Public ReadOnly Property AddProj_Visibility As Visibility
|
||||
Get
|
||||
Return m_AddProj_Visibility
|
||||
End Get
|
||||
End Property
|
||||
|
||||
' Definizione comandi
|
||||
Private m_cmdOpen As ICommand
|
||||
Private m_cmdOpenMruFile As ICommand
|
||||
Private m_cmdSave As ICommand
|
||||
Private m_cmdAddProj As ICommand
|
||||
Private m_cmdGoToProj As ICommand
|
||||
Private m_cmdGoToSupervisor As ICommand
|
||||
|
||||
@@ -135,6 +143,12 @@ Public Class ProdManagerVM
|
||||
Else
|
||||
m_GoToSupervisor_Visibility = Visibility.Collapsed
|
||||
End If
|
||||
' attivo bottone AddProj
|
||||
If GetMainPrivateProfileInt(S_GENERAL, K_ADDPROJ, 0) = 1 Then
|
||||
m_AddProj_Visibility = Visibility.Visible
|
||||
Else
|
||||
m_AddProj_Visibility = Visibility.Collapsed
|
||||
End If
|
||||
' Leggo ultimo indice di progetto
|
||||
m_nLastProdId = GetMainPrivateProfileInt(S_GENERAL, K_PRODSINDEX, 1)
|
||||
' Impostazioni MruLists
|
||||
@@ -372,10 +386,10 @@ Public Class ProdManagerVM
|
||||
Save(True)
|
||||
End Sub
|
||||
|
||||
Public Sub Save(Optional bShowLoading As Boolean = False)
|
||||
If IsNothing(m_CurrProd) Then Return
|
||||
Public Function Save(Optional bShowLoading As Boolean = False) As Boolean
|
||||
If IsNothing(m_CurrProd) Then Return False
|
||||
If bShowLoading Then LoadingWndHelper.OpenLoadingWnd(ActiveIds.SAVEPROD, 2, EgtMsg(63007), EgtMsg(63012), 70) ' Project saving ' Saving geometry
|
||||
Map.refSceneHostVM.SaveProject()
|
||||
Dim bOk As Boolean = Map.refSceneHostVM.SaveProject()
|
||||
If bShowLoading Then LoadingWndHelper.UpdateLoadingWnd(ActiveIds.SAVEPROD, 2, EgtMsg(63013), 70, 100) ' Saving data on Db
|
||||
Dim MyMachGroupList As New List(Of MyMachGroupM)
|
||||
If Not IsNothing(Map.refProjectVM.MachGroupPanelVM) Then
|
||||
@@ -384,7 +398,10 @@ Public Class ProdManagerVM
|
||||
Next
|
||||
End If
|
||||
' aggiorno pezzi su Db
|
||||
DbControllers.m_ProdController.UpdateMachGroup(CurrProd.nProdId, MyMachGroupList)
|
||||
If Not DbControllers.m_ProdController.UpdateMachGroup(CurrProd.nProdId, MyMachGroupList) And bShowLoading Then
|
||||
LoadingWndHelper.CloseLoadingWnd(ActiveIds.SAVEPROD)
|
||||
Return False
|
||||
End If
|
||||
' verifico se Reset Macchina modificato e nel caso aggiorno DB e CurrProj
|
||||
If Map.refCALCPanelVM.IsMachineModified() Then
|
||||
DbControllers.m_ProdController.UpdateMachine(Map.refProdManagerVM.CurrProd.nProdId, Map.refCALCPanelVM.SelectedMachine.Name)
|
||||
@@ -408,10 +425,103 @@ Public Class ProdManagerVM
|
||||
Map.refMainWindowVM.UpdateTitle()
|
||||
NotifyPropertyChanged(NameOf(MruFileNames))
|
||||
If bShowLoading Then LoadingWndHelper.CloseLoadingWnd(ActiveIds.SAVEPROD)
|
||||
End Sub
|
||||
Return bOk
|
||||
End Function
|
||||
|
||||
#End Region ' SaveCommand
|
||||
|
||||
#Region "AddProj"
|
||||
|
||||
''' <summary>
|
||||
''' Returns a command that do Save.
|
||||
''' </summary>
|
||||
Public ReadOnly Property AddProj_Command As ICommand
|
||||
Get
|
||||
If m_cmdAddProj Is Nothing Then
|
||||
m_cmdAddProj = New Command(AddressOf AddProj)
|
||||
End If
|
||||
Return m_cmdAddProj
|
||||
End Get
|
||||
End Property
|
||||
|
||||
''' <summary>
|
||||
''' Execute the Save. This method is invoked by the SaveCommand.
|
||||
''' </summary>
|
||||
Public Sub AddProj()
|
||||
' verifico se progetto modificato, e chiedo se salvare
|
||||
If IsNothing(CurrProd) Then Return
|
||||
Dim bNewProject As Boolean = False
|
||||
Dim sProjectDirPath As String = ""
|
||||
sProjectDirPath = CurrProd.sProdDirPath
|
||||
Dim VerifyResult As MessageBoxResult = MessageBoxResult.None
|
||||
' verifico se progetto modificato, e chiedo se salvare
|
||||
If EgtGetModified() OrElse CurrProd.bIsNew OrElse Map.refCALCPanelVM.IsMachineModified() Then
|
||||
VerifyResult = MessageBox.Show(EgtMsg(61875), "", If(CurrProd.bIsNew, MessageBoxButton.OKCancel, MessageBoxButton.YesNoCancel), MessageBoxImage.Question)
|
||||
Select Case VerifyResult
|
||||
Case MessageBoxResult.Yes, MessageBoxResult.OK
|
||||
' salvo proj
|
||||
Map.refProdManagerVM.Save()
|
||||
Case MessageBoxResult.Cancel
|
||||
Return
|
||||
Case Else ' No
|
||||
EgtResetModified()
|
||||
OpenProject(CurrProd)
|
||||
End Select
|
||||
Else
|
||||
EgtResetModified()
|
||||
End If
|
||||
' faccio scegliere proj da aggiungere
|
||||
Dim OpenProjectFileDialogVM As New OpenProjectFileDialogVM
|
||||
Dim ChooseProdFileDialog As New OpenProjectFileDialogV(Application.Current.MainWindow, OpenProjectFileDialogVM)
|
||||
Dim DialogResult As Boolean? = ChooseProdFileDialog.EgtShowDialog(ProjectType.PROJ, True)
|
||||
If IsNothing(DialogResult) OrElse Not DialogResult Then Return
|
||||
If IsNothing(OpenProjectFileDialogVM.SelProject.nProjId) OrElse OpenProjectFileDialogVM.SelProject.nProjId <= 0 Then Return
|
||||
' verifico che il proj selezionato non abbia prod
|
||||
If Not IsNothing(OpenProjectFileDialogVM.SelProject.nProdId) AndAlso OpenProjectFileDialogVM.SelProject.nProdId > 0 Then
|
||||
' verifico che non sia uno di quelli gia' collegati a questo Prod
|
||||
Dim bFound As Boolean = False
|
||||
For Each nProjId As Integer In CurrProd.nProjIdList
|
||||
If nProjId = OpenProjectFileDialogVM.SelProject.nProjId Then
|
||||
bFound = True
|
||||
Exit For
|
||||
End If
|
||||
Next
|
||||
If bFound Then
|
||||
MessageBox.Show("Selezionato progetto che fa gia' parte di questa produzione!", "Errore", MessageBoxButton.OK, MessageBoxImage.Error)
|
||||
Else
|
||||
MessageBox.Show("Progetto gia' collegato ad una produzione!", "Errore", MessageBoxButton.OK, MessageBoxImage.Error)
|
||||
End If
|
||||
Return
|
||||
End If
|
||||
' verifico che sia associato alla stessa macchina
|
||||
If OpenProjectFileDialogVM.SelProject.sMachine <> CurrProd.sMachine Then
|
||||
MessageBox.Show("Progetto per una macchina diversa da quella del progetto corrente!", "Errore", MessageBoxButton.OK, MessageBoxImage.Error)
|
||||
Return
|
||||
End If
|
||||
' inserisco proj nel prod corrente
|
||||
Dim bOk As Boolean = EgtInsertFile(OpenProjectFileDialogVM.SelProject.sProjPath)
|
||||
' lo salvo
|
||||
bOk = bOk AndAlso Save(False)
|
||||
If bOk Then
|
||||
' riporto aggiunta proj a prod su Db
|
||||
DbControllers.m_ProdController.AddProj(CurrProd.nProdId, OpenProjectFileDialogVM.SelProject.nProjId)
|
||||
End If
|
||||
' Ricavo il tipo di Warehouse settato nell'INI
|
||||
Dim nDefault As Integer = 2
|
||||
If GetMainPrivateProfileInt(S_WAREHOUSE, EgtBEAMWALL.Core.ConstIni.K_TYPE, nDefault) = WarehouseType.MEDIUM Then
|
||||
' Se di tipo Medium confronto le Sezioni del BTL importato con quelle in Warehouse
|
||||
WarehouseWndVM.UpdateSectionXMaterial()
|
||||
End If
|
||||
' aggiorno CurrProd
|
||||
Dim PdFileM = DbControllers.m_ProdController.FindCoreByProdId(CurrProd.nProdId)
|
||||
CurrProd.ProdFileM.SetProjIdList(PdFileM.nProjIdList)
|
||||
' ricarico BTLPartList
|
||||
OpenProject(CurrProd)
|
||||
End Sub
|
||||
|
||||
|
||||
#End Region ' AddProj
|
||||
|
||||
#Region "GoToProj"
|
||||
|
||||
''' <summary>
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -267,6 +267,9 @@ Public Class ProjectVM
|
||||
If Not IsNothing(Map.refRawPartListVM.colRawPart_L) Then
|
||||
Map.refRawPartListVM.colRawPart_L.IsReadOnly = True
|
||||
End If
|
||||
If Not IsNothing(Map.refRawPartListVM.colRawPart_PosZ) Then
|
||||
Map.refRawPartListVM.colRawPart_PosZ.IsReadOnly = True
|
||||
End If
|
||||
If Not IsNothing(Map.refPartInRawPartListVM.colPartInRawPart_Offset) Then
|
||||
Map.refPartInRawPartListVM.colPartInRawPart_Offset.IsReadOnly = True
|
||||
End If
|
||||
@@ -291,46 +294,49 @@ Public Class ProjectVM
|
||||
ManageIsEnabled(True)
|
||||
' aggiungere gestione colonne editabili delle tabelle
|
||||
If Not IsNothing(Map.refPartListVM.colPart_Do) Then
|
||||
Map.refPartListVM.colPart_Do.IsReadOnly = False
|
||||
Map.refPartListVM.colPart_Do.ResetToOrigIsReadOnly()
|
||||
End If
|
||||
If Not IsNothing(Map.refFeatureListVM.colFeature_Do) Then
|
||||
Map.refFeatureListVM.colFeature_Do.IsReadOnly = False
|
||||
Map.refFeatureListVM.colFeature_Do.ResetToOrigIsReadOnly()
|
||||
End If
|
||||
If Not IsNothing(Map.refPParameterListVM.colPParam_Value) Then
|
||||
Map.refPParameterListVM.colPParam_Value.IsReadOnly = False
|
||||
Map.refPParameterListVM.colPParam_Value.ResetToOrigIsReadOnly()
|
||||
End If
|
||||
If Not IsNothing(Map.refQParameterListVM.colQParam_Value) Then
|
||||
Map.refQParameterListVM.colQParam_Value.IsReadOnly = False
|
||||
Map.refQParameterListVM.colQParam_Value.ResetToOrigIsReadOnly()
|
||||
End If
|
||||
If Not IsNothing(Map.refQParameterListVM.colQParam_Custom) Then
|
||||
Map.refQParameterListVM.colQParam_Custom.IsReadOnly = False
|
||||
Map.refQParameterListVM.colQParam_Custom.ResetToOrigIsReadOnly()
|
||||
End If
|
||||
If Not IsNothing(Map.refRawPartListVM.colRawPart_StartCut) Then
|
||||
Map.refRawPartListVM.colRawPart_StartCut.IsReadOnly = False
|
||||
Map.refRawPartListVM.colRawPart_StartCut.ResetToOrigIsReadOnly()
|
||||
End If
|
||||
If m_BTLStructureVM.nPROJTYPE <> BWType.BEAM AndAlso Not IsNothing(Map.refRawPartListVM.colRawPart_W) Then
|
||||
Map.refRawPartListVM.colRawPart_W.IsReadOnly = False
|
||||
Map.refRawPartListVM.colRawPart_W.ResetToOrigIsReadOnly()
|
||||
End If
|
||||
If Not IsNothing(Map.refRawPartListVM.colRawPart_L) Then
|
||||
Map.refRawPartListVM.colRawPart_L.IsReadOnly = False
|
||||
Map.refRawPartListVM.colRawPart_L.ResetToOrigIsReadOnly()
|
||||
End If
|
||||
If Not IsNothing(Map.refRawPartListVM.colRawPart_PosZ) Then
|
||||
Map.refRawPartListVM.colRawPart_PosZ.ResetToOrigIsReadOnly()
|
||||
End If
|
||||
If Not IsNothing(Map.refPartInRawPartListVM.colPartInRawPart_Offset) Then
|
||||
Map.refPartInRawPartListVM.colPartInRawPart_Offset.IsReadOnly = False
|
||||
Map.refPartInRawPartListVM.colPartInRawPart_Offset.ResetToOrigIsReadOnly()
|
||||
End If
|
||||
If Not IsNothing(Map.refPartInRawPartListVM.colPartInRawPart_Rot) Then
|
||||
Map.refPartInRawPartListVM.colPartInRawPart_Rot.IsReadOnly = False
|
||||
Map.refPartInRawPartListVM.colPartInRawPart_Rot.ResetToOrigIsReadOnly()
|
||||
End If
|
||||
If Not IsNothing(Map.refPartInRawPartListVM.colPartInRawPart_Flip) Then
|
||||
Map.refPartInRawPartListVM.colPartInRawPart_Flip.IsReadOnly = False
|
||||
Map.refPartInRawPartListVM.colPartInRawPart_Flip.ResetToOrigIsReadOnly()
|
||||
End If
|
||||
If Not IsNothing(Map.refPartInRawPartListVM.colPartInRawPart_PosX) Then
|
||||
Map.refPartInRawPartListVM.colPartInRawPart_PosX.IsReadOnly = False
|
||||
Map.refPartInRawPartListVM.colPartInRawPart_PosX.ResetToOrigIsReadOnly()
|
||||
End If
|
||||
If Not IsNothing(Map.refPartInRawPartListVM.colPartInRawPart_PosY) Then
|
||||
Map.refPartInRawPartListVM.colPartInRawPart_PosY.IsReadOnly = False
|
||||
Map.refPartInRawPartListVM.colPartInRawPart_PosY.ResetToOrigIsReadOnly()
|
||||
End If
|
||||
If Not IsNothing(Map.refFeatureInPartInRawPartListVM.colFeatureInPartInRawPart_Do) Then
|
||||
Map.refFeatureInPartInRawPartListVM.colFeatureInPartInRawPart_Do.IsReadOnly = False
|
||||
Map.refFeatureInPartInRawPartListVM.colFeatureInPartInRawPart_Do.ResetToOrigIsReadOnly()
|
||||
End If
|
||||
' fermo il timer
|
||||
If Not m_bCalcRunning Then
|
||||
|
||||
@@ -139,7 +139,10 @@ Public Class ProdFileVM
|
||||
Map.refCALCPanelVM.RevertToOriginalMachine()
|
||||
If CurrProject.bIsNew Then
|
||||
' lo elimino
|
||||
Directory.Delete(sProjectDirPath, True)
|
||||
Try
|
||||
Directory.Delete(sProjectDirPath, True)
|
||||
Catch ex As Exception
|
||||
End Try
|
||||
Map.refProdManagerVM.m_MruFiles.Remove(CurrProject.sProdPath)
|
||||
Map.refProdManagerVM.NotifyPropertyChanged(NameOf(Map.refProdManagerVM.MruFileNames))
|
||||
DbControllers.m_ProdController.DeleteProd(CurrProject.nProdId)
|
||||
|
||||
@@ -15,6 +15,11 @@ Public Class ProjFileVM
|
||||
|
||||
Sub New(ProjectFileM As ProjFileM)
|
||||
MyBase.New(ProjectFileM)
|
||||
' verifico valore description
|
||||
If Not IsNothing(ProjectFileM) AndAlso String.IsNullOrWhiteSpace(ProjectFileM.sDescription) Then
|
||||
DbControllers.m_ProjController.UpdateDescription(ProjectFileM.nProjId, ProjectFileM.sBTLFileName)
|
||||
ProjectFileM.sDescription = ProjectFileM.sBTLFileName
|
||||
End If
|
||||
End Sub
|
||||
|
||||
#End Region ' CONSTRUCTORS
|
||||
@@ -137,9 +142,11 @@ Public Class ProjFileVM
|
||||
Directory.Delete(sProjectDirPath, True)
|
||||
End If
|
||||
Map.refProjManagerVM.m_MruFiles.Remove(CurrProject.sProjPath)
|
||||
Map.refProjManagerVM.NotifyPropertyChanged(NameOf(Map.refProjManagerVM.MruFileNames))
|
||||
DbControllers.m_ProjController.DeleteProj(CurrProject.nProjId)
|
||||
Map.refProjManagerVM.CurrProj = Nothing
|
||||
Map.refProjManagerVM.NotifyPropertyChanged(NameOf(Map.refProjManagerVM.MruFileNames))
|
||||
|
||||
' CheckMe impostata come cancellazione FISICA dal DB...
|
||||
DbControllers.m_ProjController.DeleteProj(CurrProject.nProjId, False)
|
||||
Map.refProjManagerVM.CurrProj = Nothing
|
||||
EgtResetModified()
|
||||
Return True
|
||||
End If
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 976 B |
@@ -202,13 +202,14 @@ Public Class MySceneHostVM
|
||||
|
||||
#Region "ProjectManager"
|
||||
|
||||
Public Overrides Sub NewProject()
|
||||
Public Overrides Function NewProject() As Boolean
|
||||
EgtSetCurrentContext(MainScene.GetCtx())
|
||||
Dim bOk As Boolean = MainController.NewProject()
|
||||
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())
|
||||
Dim bOk As Boolean = False
|
||||
If String.IsNullOrEmpty(sFilePath) Then
|
||||
@@ -225,29 +226,32 @@ Public Class MySceneHostVM
|
||||
bOk = MainController.OpenProject(sFilePath, False)
|
||||
End If
|
||||
MainScene.SetStatusNull()
|
||||
End Sub
|
||||
Return bOk
|
||||
End Function
|
||||
|
||||
Public Overrides Sub SaveProject()
|
||||
MyBase.SaveProject()
|
||||
Public Overrides Function SaveProject() As Boolean
|
||||
Dim bOk As Boolean = MyBase.SaveProject()
|
||||
' Imposto stato gestione mouse diretto della scena a nessuno
|
||||
MainScene.SetStatusNull()
|
||||
End Sub
|
||||
Return bOk
|
||||
End Function
|
||||
|
||||
Public Overrides Sub SaveAsProject()
|
||||
MyBase.SaveAsProject()
|
||||
Public Overrides Function SaveAsProject() As Boolean
|
||||
Dim bOk As Boolean = MyBase.SaveAsProject()
|
||||
' Imposto stato gestione mouse diretto della scena a nessuno
|
||||
MainScene.SetStatusNull()
|
||||
End Sub
|
||||
Return bOk
|
||||
End Function
|
||||
|
||||
Public Overrides Sub ImportProject()
|
||||
Public Overrides Function ImportProject() As Boolean
|
||||
Dim sDir As String = String.Empty
|
||||
GetMainPrivateProfileString(S_MRUIMPORT, K_FILE & "1", "", sDir)
|
||||
If Not String.IsNullOrWhiteSpace(sDir) Then
|
||||
sDir = Path.GetDirectoryName(sDir)
|
||||
End If
|
||||
sDir.TrimEnd("\"c)
|
||||
MainController.ImportProject(sDir)
|
||||
End Sub
|
||||
Return MainController.ImportProject(sDir)
|
||||
End Function
|
||||
|
||||
#End Region ' ProjectManager
|
||||
|
||||
@@ -543,6 +547,7 @@ Public Class MySceneHostVM
|
||||
Map.refMachinePanelVM.SelectedMachine = Map.refMachinePanelVM.MachineList.FirstOrDefault(Function(x) x.Name = Map.refProjManagerVM.TempCurrProj.sMachine)
|
||||
' aggiorno le colonne in base al tipo progetto
|
||||
Map.refRawPartListVM.UpdateColumns(Map.refProjectVM.BTLStructureVM.BTLStructureM.nPROJTYPE)
|
||||
Map.refFeatureInPartInRawPartListVM.UpdateColumns(CurrentMachine.nType)
|
||||
Map.refTopPanelVM.ManageQParamsRowVisibility(Map.refProjectVM.BTLStructureVM.BTLStructureM.nPROJTYPE <> BWType.BEAM)
|
||||
Map.refPartInRawPartListVM.UpdateColumns(Map.refProjectVM.BTLStructureVM.BTLStructureM.nPROJTYPE)
|
||||
Map.refProjManagerVM.CurrProj = Map.refProjManagerVM.TempCurrProj
|
||||
@@ -556,12 +561,13 @@ Public Class MySceneHostVM
|
||||
End If
|
||||
' imposto macchina del progetto
|
||||
Map.refMachinePanelVM.SelectedMachine = If(Not IsNothing(Map.refProdManagerVM.TempCurrProd),
|
||||
Map.refMachinePanelVM.MachineList.FirstOrDefault(Function(x) x.Name = Map.refProdManagerVM.TempCurrProd.sMachine),
|
||||
Map.refMachinePanelVM.MachineList.FirstOrDefault(Function(x) x.Name = Map.refProjManagerVM.CurrProj.sMachine))
|
||||
Map.refMachinePanelVM.MachineList.FirstOrDefault(Function(x) x.Name = Map.refProdManagerVM.TempCurrProd.sMachine),
|
||||
Map.refMachinePanelVM.MachineList.FirstOrDefault(Function(x) x.Name = Map.refProjManagerVM.CurrProj.sMachine))
|
||||
SectionXMaterial.SetType(Map.refProjectVM.BTLStructureVM.BTLStructureM.nPROJTYPE)
|
||||
Core.ViewPanelVM.UpdateBWType(Map.refProjectVM.BTLStructureVM.BTLStructureM.nPROJTYPE)
|
||||
' aggiorno le colonne in base al tipo progetto
|
||||
Map.refRawPartListVM.UpdateColumns(Map.refProjectVM.BTLStructureVM.BTLStructureM.nPROJTYPE)
|
||||
Map.refFeatureInPartInRawPartListVM.UpdateColumns(CurrentMachine.nType)
|
||||
Map.refTopPanelVM.ManageQParamsRowVisibility(Map.refProjectVM.BTLStructureVM.BTLStructureM.nPROJTYPE <> BWType.BEAM)
|
||||
Map.refPartInRawPartListVM.UpdateColumns(Map.refProjectVM.BTLStructureVM.BTLStructureM.nPROJTYPE)
|
||||
If Not IsNothing(Map.refProdManagerVM.TempCurrProd) Then Map.refProdManagerVM.CurrProd = Map.refProdManagerVM.TempCurrProd
|
||||
|
||||
@@ -87,6 +87,13 @@ Public Module CurrentMachine
|
||||
Return m_dMinOffset
|
||||
End Get
|
||||
End Property
|
||||
' Attivazione Priority pareti
|
||||
Private m_bIsEnabledPriority As Boolean = 0
|
||||
Public ReadOnly Property bIsEnabledPriority As Boolean
|
||||
Get
|
||||
Return m_bIsEnabledPriority
|
||||
End Get
|
||||
End Property
|
||||
|
||||
#Region "Proprietà che leggono e scrivono i valori anche da o su file ini"
|
||||
|
||||
@@ -300,6 +307,11 @@ Public Module CurrentMachine
|
||||
End Select
|
||||
EgtLuaGetGlobNumVar("GWD.MIN_HEIGHT", m_dMinRawH)
|
||||
EgtLuaGetGlobNumVar("GWD.MAX_HEIGHT", m_dMaxRawH)
|
||||
If EgtLuaGetGlobNumVar("GWD.BTL_PRIORITY", nTemp) Then
|
||||
m_bIsEnabledPriority = nTemp > 0
|
||||
Else
|
||||
m_bIsEnabledPriority = False
|
||||
End If
|
||||
Else
|
||||
m_nViewDir = VT.ISO_SW
|
||||
m_OrigCorner = MCH_CR.BR
|
||||
@@ -308,6 +320,7 @@ Public Module CurrentMachine
|
||||
m_NestingCorner = MCH_CR.BR
|
||||
m_dMinRawH = 5
|
||||
m_dMaxRawH = 500
|
||||
m_bIsEnabledPriority = False
|
||||
End If
|
||||
' Cancello tavola globale
|
||||
EgtLuaResetGlobVar("GWD")
|
||||
|
||||
@@ -68,6 +68,8 @@ Public Module DbControllers
|
||||
DataLayer.DbConfig.CheckMigrateDb()
|
||||
DataLayer.DbConfig.CheckUser(sUser, sPwd, m_bNetwork AndAlso Map.refMainWindowVM.MainWindowM.GetKeyOption(KEY_OPT.NETWORK))
|
||||
DataLayer.DbConfig.CheckViews(sUser, sPwd)
|
||||
' riattivare il dump per il backup
|
||||
'DataLayer.DbConfig.DumpDB("C:\Program Files\MariaDB 10.5\bin\mysqldump", "c:\Temp\Pippo.sql")
|
||||
If m_bNetwork AndAlso Map.refMainWindowVM.MainWindowM.GetKeyOption(KEY_OPT.NETWORK) Then
|
||||
' imposto cartella condivisa
|
||||
GetMainPrivateProfileString(S_GENERAL, K_SHAREDFOLDER, Map.refMainWindowVM.MainWindowM.sDataDir, sSharedFolder)
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user