Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 0a45d1af95 | |||
| b41454183f | |||
| 7e7258dd7c | |||
| 19a8ca1267 | |||
| e88c603fca | |||
| a62f0ca724 |
-121
@@ -1,121 +0,0 @@
|
|||||||
variables:
|
|
||||||
NUGET_PATH: 'C:\Tools\nuget.exe'
|
|
||||||
MSBUILD_PATH: 'C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\MSBuild\Current\Bin\MSBuild.exe'
|
|
||||||
ASPNET_MERGE_PATH: 'C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.8 Tools'
|
|
||||||
EXE_RELEASE_FOLDER: 'c:\Projetcs\Compiled\GPW\Release'
|
|
||||||
DEPLOY_FOLDER: 'c:\Projects\Deploy\GPW\Builds'
|
|
||||||
APP_NAME: 'EgtBEAMWALL'
|
|
||||||
APP_NAMEG: 'EgtBEAMWALL'
|
|
||||||
NEW_REL: ''
|
|
||||||
VERS_RD: 'Release'
|
|
||||||
ARCH: 'x86'
|
|
||||||
ARCH64: 'x64'
|
|
||||||
OUTPUT_DIR: ''
|
|
||||||
NET_SHARE: '\\10.74.82.201\Artifacts\EgtProg\EgtBEAMWALL'
|
|
||||||
NET_USER: 'steamw\steamware'
|
|
||||||
|
|
||||||
# helper x mount cartella Artifacts su truenas
|
|
||||||
.ReplicaCompiled: &ReplicaCompiled
|
|
||||||
- |
|
|
||||||
rm -Recurse Z:\$CI_COMMIT_BRANCH\$env:ARCH\*.*
|
|
||||||
rm -Recurse Z:\$CI_COMMIT_BRANCH\$env:ARCH\*.*
|
|
||||||
ROBOCOPY /E $env:APP_NAME\bin\$env:ARCH\$env:VERS_RD Z:\$CI_COMMIT_BRANCH\$env:ARCH /XF *.xml /XF *.pdb
|
|
||||||
ROBOCOPY /E $env:APP_NAME2\bin\$env:ARCH\$env:VERS_RD Z:\$CI_COMMIT_BRANCH\$env:ARCH /XF *.xml /XF *.pdb
|
|
||||||
SLEEP 2
|
|
||||||
net use Z: /delete
|
|
||||||
|
|
||||||
.ReplicaCompileds2: &ReplicaCompileds2
|
|
||||||
- |
|
|
||||||
ROBOCOPY /E $env:APP_NAME\bin\$env:ARCH64\$env:VERS_RD Z:\$CI_COMMIT_BRANCH\$env:ARCH64 /XF *.xml /XF *.pdb
|
|
||||||
ROBOCOPY /E $env:APP_NAME2\bin\$env:ARCH64\$env:VERS_RD Z:\$CI_COMMIT_BRANCH\$env:ARCH64 /XF *.xml /XF *.pdb
|
|
||||||
SLEEP 2
|
|
||||||
net use Z: /delete
|
|
||||||
|
|
||||||
.MakeFolderM: &MakeFolderM
|
|
||||||
- |
|
|
||||||
net use Z: /delete
|
|
||||||
new-item c:\EgtProg\EgtBEAMWALL -itemtype directory
|
|
||||||
net use Z: $env:NET_SHARE
|
|
||||||
|
|
||||||
.nuget-fix: &nuget-fix
|
|
||||||
- |
|
|
||||||
$hasSource = C:\Tools\nuget.exe sources list | find "`"Steamware Nexus`"" /C
|
|
||||||
if ($hasSource -eq 0) {
|
|
||||||
C:\Tools\nuget.exe sources Add -Name "`"Steamware Nexus`"" -Source https://nexus.steamware.net/repository/nuget-group -username "`"nugetUser`"" -password "`"$NEXUS_PASSWD`""
|
|
||||||
} else {
|
|
||||||
C:\Tools\nuget.exe sources Update -Name "`"Steamware Nexus`"" -Source https://nexus.steamware.net/repository/nuget-group -username "`"nugetUser`"" -password "`"$NEXUS_PASSWD`""
|
|
||||||
}
|
|
||||||
echo $hasSource
|
|
||||||
|
|
||||||
|
|
||||||
# helper creazione hash files
|
|
||||||
.hashBuild: &hashBuild
|
|
||||||
- |
|
|
||||||
$Target = "Releases\" + $CI_COMMIT_BRANCH + "\" + $env:APP_NAME + ".zip"
|
|
||||||
$MD5 = Get-FileHash $Target -Algorithm MD5
|
|
||||||
$SHA1 = Get-FileHash $Target -Algorithm SHA1
|
|
||||||
New-Item $Target".md5"
|
|
||||||
New-Item $Target".sha1"
|
|
||||||
$MD5.Hash | Set-Content -Path $Target".md5"
|
|
||||||
$SHA1.Hash | Set-Content -Path $Target".sha1"
|
|
||||||
|
|
||||||
echo "Created HASH files for $Target"
|
|
||||||
|
|
||||||
.cleanup-dir: &cleanup-dir
|
|
||||||
- |
|
|
||||||
rm $env:APP_NAME\bin\$env:ARCH\$env:VERS_RD\*.xml
|
|
||||||
rm $env:APP_NAME\bin\$env:ARCH\$env:VERS_RD\*.pdb
|
|
||||||
rm $env:APP_NAME\bin\$env:ARCH64\$env:VERS_RD\*.xml
|
|
||||||
rm $env:APP_NAME\bin\$env:ARCH64\$env:VERS_RD\*.pdb
|
|
||||||
|
|
||||||
stages:
|
|
||||||
- build
|
|
||||||
- deploy
|
|
||||||
|
|
||||||
X86:build:
|
|
||||||
stage: build
|
|
||||||
tags:
|
|
||||||
- win
|
|
||||||
only:
|
|
||||||
- main
|
|
||||||
- master
|
|
||||||
- develop
|
|
||||||
variables:
|
|
||||||
APP_NAME: EgtBEAMWALL.Supervisor
|
|
||||||
APP_NAME2: EgtBEAMWALL.ViewerOptimizer
|
|
||||||
VERS_RD: 'Release'
|
|
||||||
ARCH: 'x86'
|
|
||||||
ARCH64: 'x64'
|
|
||||||
before_script:
|
|
||||||
- *nuget-fix
|
|
||||||
- '& "$env:NUGET_PATH" restore EgtBEAMWALL.sln -verbosity quiet'
|
|
||||||
- *MakeFolderM
|
|
||||||
script:
|
|
||||||
- '& "$env:MSBUILD_PATH" "$env:APP_NAME\$env:APP_NAME.vbproj" -target:Build /p:Configuration=$env:VERS_RD /p:Platform="$env:ARCH" /p:OutputPath=bin/$env:ARCH/$env:VERS_RD/ /verbosity:minimal /m'
|
|
||||||
- '& "$env:MSBUILD_PATH" "$env:APP_NAME2\$env:APP_NAME2.vbproj" -target:Build /p:Configuration=$env:VERS_RD /p:Platform="$env:ARCH" /p:OutputPath=bin/$env:ARCH/$env:VERS_RD/ /verbosity:minimal /m'
|
|
||||||
- *ReplicaCompiled
|
|
||||||
|
|
||||||
|
|
||||||
X64:build:
|
|
||||||
stage: build
|
|
||||||
tags:
|
|
||||||
- win
|
|
||||||
only:
|
|
||||||
- main
|
|
||||||
- master
|
|
||||||
- develop
|
|
||||||
variables:
|
|
||||||
APP_NAME: EgtBEAMWALL.Supervisor
|
|
||||||
APP_NAME2: EgtBEAMWALL.ViewerOptimizer
|
|
||||||
VERS_RD: 'Release'
|
|
||||||
ARCH: 'x86'
|
|
||||||
ARCH64: 'x64'
|
|
||||||
before_script:
|
|
||||||
- *nuget-fix
|
|
||||||
- '& "$env:NUGET_PATH" restore EgtBEAMWALL.sln -verbosity quiet'
|
|
||||||
- *MakeFolderM
|
|
||||||
script:
|
|
||||||
- '& "$env:MSBUILD_PATH" "$env:APP_NAME\$env:APP_NAME.vbproj" -target:Build /p:Configuration=$env:VERS_RD /p:Platform="$env:ARCH64" /p:OutputPath=bin/$env:ARCH64/$env:VERS_RD/ /verbosity:minimal /m'
|
|
||||||
- '& "$env:MSBUILD_PATH" "$env:APP_NAME2\$env:APP_NAME2.vbproj" -target:Build /p:Configuration=$env:VERS_RD /p:Platform="$env:ARCH64" /p:OutputPath=bin/$env:ARCH64/$env:VERS_RD/ /verbosity:minimal /m'
|
|
||||||
- *ReplicaCompileds2
|
|
||||||
|
|
||||||
@@ -0,0 +1,577 @@
|
|||||||
|
Imports System.Collections.ObjectModel
|
||||||
|
Imports EgtUILib
|
||||||
|
Imports EgtWPFLib5
|
||||||
|
|
||||||
|
Public Class BTLElementM
|
||||||
|
Inherits BTLPartM
|
||||||
|
|
||||||
|
' lista delle feature del pezzo
|
||||||
|
Public m_BTLLayerMList As List(Of BTLLayerM)
|
||||||
|
Public Property BTLLayerMList As List(Of BTLLayerM)
|
||||||
|
Get
|
||||||
|
Return m_BTLLayerMList
|
||||||
|
End Get
|
||||||
|
Set(value As List(Of BTLLayerM))
|
||||||
|
m_BTLLayerMList = value
|
||||||
|
End Set
|
||||||
|
End Property
|
||||||
|
|
||||||
|
Public ReadOnly Property sName As String
|
||||||
|
Get
|
||||||
|
Return "Prova"
|
||||||
|
End Get
|
||||||
|
End Property
|
||||||
|
|
||||||
|
#Region "CONSTRUCTOR"
|
||||||
|
|
||||||
|
Protected Sub New()
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Public Shared Function CreateNewBTLElement() As BTLElementM
|
||||||
|
Return New BTLPartM
|
||||||
|
End Function
|
||||||
|
|
||||||
|
Public Shared Function CreateBTLElement(nGroupId As Integer) As BTLElementM
|
||||||
|
Dim NewBTLElement As New BTLElementM
|
||||||
|
NewBTLElement = CreateBTLElementAsPart(nGroupId)
|
||||||
|
Return NewBTLElement
|
||||||
|
End Function
|
||||||
|
|
||||||
|
Public Overloads Shared Function CreateBTLElementAsPart(nPartId As Integer) As BTLElementM
|
||||||
|
Dim NewBTLPart As New BTLElementM
|
||||||
|
NewBTLPart.m_nPartId = nPartId
|
||||||
|
' leggo info pezzo
|
||||||
|
Dim sValArray() As String
|
||||||
|
Dim sValue As String = String.Empty
|
||||||
|
Dim nValue As Integer = 0
|
||||||
|
EgtGetInfo(nPartId, BTL_PRT_PDN, NewBTLPart.m_nPDN)
|
||||||
|
Dim nDO As Integer = 1
|
||||||
|
If EgtGetInfo(nPartId, BTL_PRT_DO, nDO) Then
|
||||||
|
NewBTLPart.m_bDO = (nDO <> 0)
|
||||||
|
Else
|
||||||
|
NewBTLPart.m_bDO = True
|
||||||
|
End If
|
||||||
|
EgtGetInfo(nPartId, BTL_PRT_NAM, NewBTLPart.m_sNAM)
|
||||||
|
EgtGetInfo(nPartId, BTL_PRT_L, NewBTLPart.m_dBtlL)
|
||||||
|
EgtGetInfo(nPartId, BTL_PRT_W, NewBTLPart.m_dBtlW)
|
||||||
|
EgtGetInfo(nPartId, BTL_PRT_H, NewBTLPart.m_dBtlH)
|
||||||
|
EgtGetInfo(nPartId, BTL_PRT_CNT, NewBTLPart.m_nCNT)
|
||||||
|
EgtGetInfo(nPartId, BTL_PRT_ADDED, NewBTLPart.m_nADDED)
|
||||||
|
EgtGetInfo(nPartId, BTL_PRT_ASSEMBLYNUM, NewBTLPart.m_sASSEMBLYNUM)
|
||||||
|
EgtGetInfo(nPartId, BTL_PRT_ORDERNUM, NewBTLPart.m_nORDERNUM)
|
||||||
|
EgtGetInfo(nPartId, BTL_PRT_DESIGNATION, NewBTLPart.m_sDESIGN)
|
||||||
|
EgtGetInfo(nPartId, BTL_PRT_ANNOTATION, NewBTLPart.m_sANNOT)
|
||||||
|
EgtGetInfo(nPartId, BTL_PRT_STOREY, NewBTLPart.m_sSTOREY)
|
||||||
|
EgtGetInfo(nPartId, BTL_PRT_GROUP, NewBTLPart.m_sGROUP)
|
||||||
|
EgtGetInfo(nPartId, BTL_PRT_PACKAGE, NewBTLPart.m_sPACKAGE)
|
||||||
|
EgtGetInfo(nPartId, BTL_PRT_TIMBERGRADE, NewBTLPart.m_sTIMBERGRADE)
|
||||||
|
EgtGetInfo(nPartId, BTL_PRT_QUALITYGRADE, NewBTLPart.m_sQUALITYGRADE)
|
||||||
|
EgtGetInfo(nPartId, BTL_PRT_COLOUR, sValue)
|
||||||
|
NewBTLPart.m_colCOLOR.FromString(sValue)
|
||||||
|
EgtGetInfo(nPartId, BTL_PRT_PLANINGLENGTH, NewBTLPart.m_dPLANINGLEN)
|
||||||
|
EgtGetInfo(nPartId, BTL_PRT_STARTOFFSET, NewBTLPart.m_dSTARTOFFSET)
|
||||||
|
EgtGetInfo(nPartId, BTL_PRT_ENDOFFSET, NewBTLPart.m_dENDOFFSET)
|
||||||
|
Dim ind As Integer = 1
|
||||||
|
While EgtGetInfo(nPartId, BTL_PRT_UID & ind, nValue)
|
||||||
|
NewBTLPart.ocUID.Add(nValue)
|
||||||
|
EgtGetInfo(nPartId, BTL_PRT_TRANSFORMATION & ind, sValue)
|
||||||
|
NewBTLPart.m_refTransf = New Frame3d
|
||||||
|
Dim ptOri As New Point3d
|
||||||
|
Dim vtVersX As New Vector3d
|
||||||
|
Dim vtVersY As New Vector3d
|
||||||
|
sValArray = sValue.Split({","}, StringSplitOptions.RemoveEmptyEntries)
|
||||||
|
If sValArray.Count() >= 9 Then
|
||||||
|
StringToLen(sValArray(0), ptOri.x)
|
||||||
|
StringToLen(sValArray(1), ptOri.y)
|
||||||
|
StringToLen(sValArray(2), ptOri.z)
|
||||||
|
StringToDouble(sValArray(3), vtVersX.x)
|
||||||
|
StringToDouble(sValArray(4), vtVersX.y)
|
||||||
|
StringToDouble(sValArray(5), vtVersX.z)
|
||||||
|
StringToDouble(sValArray(6), vtVersY.x)
|
||||||
|
StringToDouble(sValArray(7), vtVersY.y)
|
||||||
|
StringToDouble(sValArray(8), vtVersY.z)
|
||||||
|
NewBTLPart.m_refTransf.ChangeOrigin(ptOri)
|
||||||
|
NewBTLPart.m_refTransf.Setup(ptOri, ptOri + vtVersX, ptOri + vtVersY)
|
||||||
|
End If
|
||||||
|
NewBTLPart.refTransfList.Add(NewBTLPart.m_refTransf)
|
||||||
|
ind = ind + 1
|
||||||
|
End While
|
||||||
|
EgtGetInfo(nPartId, BTL_PRT_CAMBER, sValue)
|
||||||
|
sValArray = sValue.Split(New String() {": ", " P"}, StringSplitOptions.RemoveEmptyEntries)
|
||||||
|
If sValArray.Count() >= 5 Then
|
||||||
|
StringToLen(sValArray(3), NewBTLPart.m_dCamberLen1)
|
||||||
|
StringToLen(sValArray(5), NewBTLPart.m_dCamberLen2)
|
||||||
|
StringToLen(sValArray(7), NewBTLPart.m_dCamberLen3)
|
||||||
|
StringToLen(sValArray(9), NewBTLPart.m_dCamberCross3)
|
||||||
|
End If
|
||||||
|
Dim pFrom As Integer = sValue.IndexOf("SIDE: ") + "SIDE: ".Length
|
||||||
|
Dim pTo As Integer = sValue.LastIndexOf(" P01")
|
||||||
|
If pTo >= 0 Then
|
||||||
|
nValue = CInt(sValue.Substring(pFrom, pTo - pFrom))
|
||||||
|
NewBTLPart.m_SelCAMBERSIDE = NewBTLPart.ocCAMBERSIDE.IndexOf(CInt(sValue.Substring(pFrom, pTo - pFrom)))
|
||||||
|
End If
|
||||||
|
|
||||||
|
EgtGetInfo(nPartId, BTL_PRT_PARTOFFSET, sValue)
|
||||||
|
sValArray = sValue.Split(New String() {": ", " P"}, StringSplitOptions.RemoveEmptyEntries)
|
||||||
|
If sValArray.Count() >= 5 Then
|
||||||
|
StringToLen(sValArray(3), NewBTLPart.m_dPartOffsetSide1)
|
||||||
|
StringToLen(sValArray(5), NewBTLPart.m_dPartOffsetSide2)
|
||||||
|
StringToLen(sValArray(7), NewBTLPart.m_dPartOffsetSide3)
|
||||||
|
StringToLen(sValArray(9), NewBTLPart.m_dPartOffsetSide4)
|
||||||
|
End If
|
||||||
|
pFrom = sValue.IndexOf("P04: ") + "P04: ".Length
|
||||||
|
pTo = sValue.LastIndexOf(" P11")
|
||||||
|
If pTo >= 0 Then
|
||||||
|
NewBTLPart.m_SelREFSIDEFIXCLAMP = IdNameStruct.IndFromId(IdNameStruct.IdFromName(sValue.Substring(pFrom, pTo - pFrom),
|
||||||
|
NewBTLPart.ocREFSIDEFIXCLAMP),
|
||||||
|
NewBTLPart.ocREFSIDEFIXCLAMP)
|
||||||
|
End If
|
||||||
|
|
||||||
|
Dim EnumIndex As Integer = 0
|
||||||
|
EgtGetInfo(nPartId, BTL_PRT_PROCESSINGQUALITY, sValue)
|
||||||
|
For ind = 1 To NewBTLPart.ocPROCESSINGQUALITY.Count
|
||||||
|
Dim sEnumName = [Enum].GetName(GetType(ProcessingQuality), ind)
|
||||||
|
If sEnumName.Equals(sValue) Then
|
||||||
|
EnumIndex = ind
|
||||||
|
Exit For
|
||||||
|
End If
|
||||||
|
Next
|
||||||
|
NewBTLPart.m_SelPROCESSINGQUALITY = EnumIndex - 1
|
||||||
|
EgtGetInfo(nPartId, BTL_PRT_RECESS, sValue)
|
||||||
|
EnumIndex = 0
|
||||||
|
For ind = 1 To NewBTLPart.ocRECESS.Count
|
||||||
|
Dim sEnumName = [Enum].GetName(GetType(Recess), ind)
|
||||||
|
If sEnumName.Equals(sValue) Then
|
||||||
|
EnumIndex = ind
|
||||||
|
Exit For
|
||||||
|
End If
|
||||||
|
Next
|
||||||
|
NewBTLPart.m_SelRECESS = EnumIndex - 1
|
||||||
|
EgtGetInfo(nPartId, BTL_PRT_STOREYTYPE, sValue)
|
||||||
|
EnumIndex = 0
|
||||||
|
For ind = 1 To NewBTLPart.ocSTOREYTYPE.Count
|
||||||
|
Dim sEnumName = [Enum].GetName(GetType(StoreyType), ind)
|
||||||
|
If sEnumName.Equals(sValue) Then
|
||||||
|
EnumIndex = ind
|
||||||
|
Exit For
|
||||||
|
End If
|
||||||
|
Next
|
||||||
|
NewBTLPart.m_SelSTOREYTYPE = EnumIndex - 1
|
||||||
|
EgtGetInfo(nPartId, BTL_PRT_ELEMENTNUM, NewBTLPart.m_sELEMENTNUM)
|
||||||
|
EgtGetInfo(nPartId, BTL_PRT_LAYER, NewBTLPart.m_nLAYER)
|
||||||
|
EgtGetInfo(nPartId, BTL_PRT_MODULENUM, NewBTLPart.m_sMODULENUM)
|
||||||
|
'EgtGetInfo(nPartId, BTL_PRT_USERATTRIBUTE, m_sUSERATTRIBUTE)
|
||||||
|
EgtGetInfo(nPartId, BTL_PRT_COMMENT, NewBTLPart.m_sCOMMENT)
|
||||||
|
|
||||||
|
EgtGetInfo(nPartId, BTL_PRT_GRAINDIR, sValue)
|
||||||
|
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)
|
||||||
|
NewBTLPart.m_bGRAINDIRALIGN = (CInt(sValArray(3)) = 1)
|
||||||
|
End If
|
||||||
|
|
||||||
|
EgtGetInfo(nPartId, BTL_PRT_REFSIDE, sValue)
|
||||||
|
sValArray = sValue.Split({";"}, StringSplitOptions.RemoveEmptyEntries)
|
||||||
|
If sValArray.Count() >= 2 Then
|
||||||
|
NewBTLPart.m_SelREFSIDE = NewBTLPart.ocREFSIDE.IndexOf(CInt(sValArray(0)))
|
||||||
|
NewBTLPart.m_bREFSIDEALIGN = (CInt(sValArray(1)) = 1)
|
||||||
|
End If
|
||||||
|
|
||||||
|
EgtGetInfo(nPartId, BTL_PRT_ALIGNMENT, sValue)
|
||||||
|
sValArray = sValue.Split({":"}, StringSplitOptions.RemoveEmptyEntries)
|
||||||
|
If sValArray.Count() >= 2 Then
|
||||||
|
NewBTLPart.m_SelALIGNLOCATION = IdNameStruct.IndFromId(IdNameStruct.IdFromName(sValArray(0), NewBTLPart.ocALIGNLOCATION),
|
||||||
|
NewBTLPart.ocALIGNLOCATION)
|
||||||
|
NewBTLPart.m_SelALIGNENDTYPE = IdNameStruct.IndFromId(IdNameStruct.IdFromName(sValArray(1).Trim(),
|
||||||
|
NewBTLPart.ocALIGNENDTYPE),
|
||||||
|
NewBTLPart.ocALIGNENDTYPE)
|
||||||
|
End If
|
||||||
|
|
||||||
|
EgtGetInfo(nPartId, BTL_PRT_MATERIALTYPE, sValue)
|
||||||
|
sValArray = sValue.Split({":"}, StringSplitOptions.RemoveEmptyEntries)
|
||||||
|
If sValArray.Count() >= 1 Then
|
||||||
|
NewBTLPart.m_SelMATERIALTYPEGRP = IdNameStruct.IndFromId(IdNameStruct.IdFromName(sValArray(0),
|
||||||
|
NewBTLPart.ocMATERIALTYPEGRP),
|
||||||
|
NewBTLPart.ocMATERIALTYPEGRP)
|
||||||
|
If sValArray.Count() >= 2 Then NewBTLPart.m_sMATERIALTYPESPEC = sValArray(1).Trim()
|
||||||
|
End If
|
||||||
|
|
||||||
|
If Not EgtGetInfo(nPartId, BTL_PRT_ROTATED, NewBTLPart.nROTATED) Then
|
||||||
|
NewBTLPart.nROTATED = 0
|
||||||
|
End If
|
||||||
|
If Not EgtGetInfo(nPartId, BTL_PRT_INVERTED, NewBTLPart.nINVERTED) Then
|
||||||
|
NewBTLPart.nINVERTED = 0
|
||||||
|
End If
|
||||||
|
EgtGetInfo(nPartId, BTL_PRT_MATERIAL, NewBTLPart.m_sMATERIAL)
|
||||||
|
If Not EgtGetInfo(nPartId, LOCK_ROT, NewBTLPart.bLockRotation) Then
|
||||||
|
NewBTLPart.bLockRotation = False
|
||||||
|
End If
|
||||||
|
If Not EgtGetInfo(nPartId, LOCK_FLIP, NewBTLPart.bLockInversion) Then
|
||||||
|
NewBTLPart.bLockInversion = False
|
||||||
|
End If
|
||||||
|
EgtGetInfo(nPartId, BTL_PRT_VOLUME, NewBTLPart.dVolume)
|
||||||
|
'' Leggo outline e features
|
||||||
|
'NewBTLPart.m_BTLFeatureMList = LoadFeatures(nPartId, NewBTLPart)
|
||||||
|
' leggo calc error
|
||||||
|
Dim nErr As Integer = 0
|
||||||
|
Dim nRot As Integer = 0
|
||||||
|
Dim nFall As Integer = 0
|
||||||
|
Dim sMsg As String = ""
|
||||||
|
Dim bCalc As Boolean = False
|
||||||
|
bCalc = EgtGetInfo(nPartId, ITG_PROJ_ERR, nErr)
|
||||||
|
EgtGetInfo(nPartId, ITG_PROJ_ROT, nRot)
|
||||||
|
EgtGetInfo(nPartId, ITG_PROJ_FALL, nFall)
|
||||||
|
EgtGetInfo(nPartId, ITG_PROJ_MSG, sMsg)
|
||||||
|
If Not bCalc Then
|
||||||
|
NewBTLPart.m_nState = CalcStates.NOTCALCULATED
|
||||||
|
NewBTLPart.nCALC_ERR = 0
|
||||||
|
NewBTLPart.m_nCALC_ROT = 0
|
||||||
|
NewBTLPart.nCALC_FALL = 0
|
||||||
|
NewBTLPart.sCALC_MSG = ""
|
||||||
|
Else
|
||||||
|
NewBTLPart.nCALC_ERR = nErr
|
||||||
|
NewBTLPart.nCALC_ROT = nRot
|
||||||
|
NewBTLPart.nCALC_FALL = nFall
|
||||||
|
NewBTLPart.sCALC_MSG = sMsg
|
||||||
|
Select Case nErr
|
||||||
|
Case 0
|
||||||
|
NewBTLPart.nState = CalcStates.OK
|
||||||
|
Case 22
|
||||||
|
NewBTLPart.nState = CalcStates.COLLISION
|
||||||
|
Case 17, 19
|
||||||
|
NewBTLPart.nState = CalcStates.WARNING
|
||||||
|
Case < 0
|
||||||
|
NewBTLPart.nState = CalcStates.INFO
|
||||||
|
Case > 0
|
||||||
|
NewBTLPart.nState = CalcStates.ERROR_
|
||||||
|
End Select
|
||||||
|
End If
|
||||||
|
EgtGetInfo(nPartId, ITG_PROJ_TIME, NewBTLPart.m_nCALC_TIME)
|
||||||
|
Return NewBTLPart
|
||||||
|
End Function
|
||||||
|
|
||||||
|
' Private Shared Function LoadFeatures(nPartId As Integer, NewBTLPart As BTLPartM) As List(Of BTLFeatureM)
|
||||||
|
' Dim TempList As New List(Of BTLFeatureM)
|
||||||
|
' ' Leggo outline
|
||||||
|
' Dim nOutlineLayerId As Integer = EgtGetFirstNameInGroup(nPartId, OUTLINE)
|
||||||
|
' Dim nOutlineId As Integer = EgtGetFirstInGroup(nOutlineLayerId)
|
||||||
|
' While nOutlineId <> GDB_ID.NULL
|
||||||
|
' ' verifico che sia una feature
|
||||||
|
' Dim nGRP As Integer
|
||||||
|
' If EgtGetInfo(nOutlineId, BTL_FTR_GRP, nGRP) Then
|
||||||
|
' ' creo la feature
|
||||||
|
' TempList.Add(BTLFeatureM.CreateBTLFeature(NewBTLPart, nOutlineId))
|
||||||
|
' End If
|
||||||
|
' nOutlineId = EgtGetNext(nOutlineId)
|
||||||
|
' End While
|
||||||
|
' ' Leggo feature
|
||||||
|
' Dim nProcessingId As Integer = EgtGetFirstNameInGroup(nPartId, PROCESSINGS)
|
||||||
|
' Dim nFeatureId As Integer = EgtGetFirstInGroup(nProcessingId)
|
||||||
|
' While nFeatureId <> GDB_ID.NULL
|
||||||
|
' ' verifico che sia una feature
|
||||||
|
' Dim nGRP As Integer
|
||||||
|
' If EgtGetInfo(nFeatureId, BTL_FTR_GRP, nGRP) AndAlso Not EgtExistsInfo(nFeatureId, BTL_FTR_MAINID) Then
|
||||||
|
' ' creo la feature
|
||||||
|
' Dim NewFeature As BTLFeatureM = BTLFeatureM.CreateBTLFeature(NewBTLPart, nFeatureId)
|
||||||
|
' TempList.Add(NewFeature)
|
||||||
|
' ' aggiorno Id feature perchè potrebbe essere stata ricalcolata
|
||||||
|
' nFeatureId = NewFeature.nFeatureId
|
||||||
|
' End If
|
||||||
|
' nFeatureId = EgtGetNext(nFeatureId)
|
||||||
|
' End While
|
||||||
|
' Return TempList
|
||||||
|
' End Function
|
||||||
|
|
||||||
|
' 'Sub New(ParentStructure As BTLStructureVM, nPartId As Integer)
|
||||||
|
' ' MyBase.New(ParentStructure, nPartId)
|
||||||
|
' ' ' leggo info pezzo
|
||||||
|
' ' Dim sValArray() As String
|
||||||
|
' ' Dim sValue As String = String.Empty
|
||||||
|
' ' Dim nValue As Integer = 0
|
||||||
|
' ' EgtGetInfo(nPartId, BTL_PRT_PDN, nPDN)
|
||||||
|
' ' Dim nDO As Integer = 1
|
||||||
|
' ' If EgtGetInfo(nPartId, BTL_PRT_DO, nDO) Then
|
||||||
|
' ' m_bDO = (nDO <> 0)
|
||||||
|
' ' Else
|
||||||
|
' ' m_bDO = True
|
||||||
|
' ' End If
|
||||||
|
' ' EgtGetInfo(nPartId, BTL_PRT_NAM, m_sNAM)
|
||||||
|
' ' EgtGetInfo(nPartId, BTL_PRT_L, m_dL)
|
||||||
|
' ' EgtGetInfo(nPartId, BTL_PRT_W, m_dW)
|
||||||
|
' ' EgtGetInfo(nPartId, BTL_PRT_H, m_dH)
|
||||||
|
' ' EgtGetInfo(nPartId, BTL_PRT_CNT, m_nCNT)
|
||||||
|
' ' EgtGetInfo(nPartId, BTL_PRT_ASSEMBLYNUM, m_sASSEMBLYNUM)
|
||||||
|
' ' EgtGetInfo(nPartId, BTL_PRT_ORDERNUM, m_nORDERNUM)
|
||||||
|
' ' EgtGetInfo(nPartId, BTL_PRT_DESIGNATION, m_sDESIGN)
|
||||||
|
' ' EgtGetInfo(nPartId, BTL_PRT_ANNOTATION, m_sANNOT)
|
||||||
|
' ' EgtGetInfo(nPartId, BTL_PRT_STOREY, m_sSTOREY)
|
||||||
|
' ' EgtGetInfo(nPartId, BTL_PRT_GROUP, m_sGROUP)
|
||||||
|
' ' EgtGetInfo(nPartId, BTL_PRT_PACKAGE, m_sPACKAGE)
|
||||||
|
' ' EgtGetInfo(nPartId, BTL_PRT_TIMBERGRADE, m_sTIMBERGRADE)
|
||||||
|
' ' EgtGetInfo(nPartId, BTL_PRT_QUALITYGRADE, m_sQUALITYGRADE)
|
||||||
|
' ' EgtGetInfo(nPartId, BTL_PRT_COLOUR, sValue)
|
||||||
|
' ' m_colCOLOR.FromString(sValue)
|
||||||
|
' ' EgtGetInfo(nPartId, BTL_PRT_PLANINGLENGTH, m_dPLANINGLEN)
|
||||||
|
' ' EgtGetInfo(nPartId, BTL_PRT_STARTOFFSET, m_dSTARTOFFSET)
|
||||||
|
' ' EgtGetInfo(nPartId, BTL_PRT_ENDOFFSET, m_dENDOFFSET)
|
||||||
|
|
||||||
|
' ' Dim ind As Integer = 1
|
||||||
|
' ' While EgtGetInfo(nPartId, BTL_PRT_UID & ind, nValue)
|
||||||
|
' ' ocUID.Add(nValue)
|
||||||
|
' ' EgtGetInfo(nPartId, BTL_PRT_TRANSFORMATION & ind, sValue)
|
||||||
|
' ' m_refTransf = New Frame3d
|
||||||
|
' ' Dim ptOri As New Point3d
|
||||||
|
' ' Dim vtVersX As New Vector3d
|
||||||
|
' ' Dim vtVersY As New Vector3d
|
||||||
|
' ' sValArray = sValue.Split({","}, StringSplitOptions.RemoveEmptyEntries)
|
||||||
|
' ' If sValArray.Count() >= 9 Then
|
||||||
|
' ' StringToLen(sValArray(0), ptOri.x)
|
||||||
|
' ' StringToLen(sValArray(1), ptOri.y)
|
||||||
|
' ' StringToLen(sValArray(2), ptOri.z)
|
||||||
|
' ' StringToDouble(sValArray(3), vtVersX.x)
|
||||||
|
' ' StringToDouble(sValArray(4), vtVersX.y)
|
||||||
|
' ' StringToDouble(sValArray(5), vtVersX.z)
|
||||||
|
' ' StringToDouble(sValArray(6), vtVersY.x)
|
||||||
|
' ' StringToDouble(sValArray(7), vtVersY.y)
|
||||||
|
' ' StringToDouble(sValArray(8), vtVersY.z)
|
||||||
|
' ' m_refTransf.ChangeOrigin(ptOri)
|
||||||
|
' ' m_refTransf.Setup(ptOri, ptOri + vtVersX, ptOri + vtVersY)
|
||||||
|
' ' End If
|
||||||
|
' ' refTransfList.Add(m_refTransf)
|
||||||
|
' ' ind = ind + 1
|
||||||
|
' ' End While
|
||||||
|
|
||||||
|
' ' EgtGetInfo(nPartId, BTL_PRT_CAMBER, sValue)
|
||||||
|
' ' sValArray = sValue.Split(New String() {": ", " P"}, StringSplitOptions.RemoveEmptyEntries)
|
||||||
|
' ' If sValArray.Count() >= 5 Then
|
||||||
|
' ' StringToLen(sValArray(3), m_dCamberLen1)
|
||||||
|
' ' StringToLen(sValArray(5), m_dCamberLen2)
|
||||||
|
' ' StringToLen(sValArray(7), m_dCamberLen3)
|
||||||
|
' ' StringToLen(sValArray(9), m_dCamberCross3)
|
||||||
|
' ' End If
|
||||||
|
' ' Dim pFrom As Integer = sValue.IndexOf("SIDE: ") + "SIDE: ".Length
|
||||||
|
' ' Dim pTo As Integer = sValue.LastIndexOf(" P01")
|
||||||
|
' ' If pTo >= 0 Then
|
||||||
|
' ' nValue = CInt(sValue.Substring(pFrom, pTo - pFrom))
|
||||||
|
' ' m_SelCAMBERSIDE = ocCAMBERSIDE.IndexOf(CInt(sValue.Substring(pFrom, pTo - pFrom)))
|
||||||
|
' ' End If
|
||||||
|
|
||||||
|
' ' EgtGetInfo(nPartId, BTL_PRT_PARTOFFSET, sValue)
|
||||||
|
' ' sValArray = sValue.Split(New String() {": ", " P"}, StringSplitOptions.RemoveEmptyEntries)
|
||||||
|
' ' If sValArray.Count() >= 5 Then
|
||||||
|
' ' StringToLen(sValArray(3), m_dPartOffsetSide1)
|
||||||
|
' ' StringToLen(sValArray(5), m_dPartOffsetSide2)
|
||||||
|
' ' StringToLen(sValArray(7), m_dPartOffsetSide3)
|
||||||
|
' ' StringToLen(sValArray(9), m_dPartOffsetSide4)
|
||||||
|
' ' End If
|
||||||
|
' ' pFrom = sValue.IndexOf("P04: ") + "P04: ".Length
|
||||||
|
' ' pTo = sValue.LastIndexOf(" P11")
|
||||||
|
' ' If pTo >= 0 Then
|
||||||
|
' ' m_SelREFSIDEFIXCLAMP = IdNameStruct.IndFromId(IdNameStruct.IdFromName(sValue.Substring(pFrom, pTo - pFrom), ocREFSIDEFIXCLAMP), ocREFSIDEFIXCLAMP)
|
||||||
|
' ' End If
|
||||||
|
|
||||||
|
' ' EgtGetInfo(nPartId, BTL_PRT_PROCESSINGQUALITY, sValue)
|
||||||
|
' ' m_SelPROCESSINGQUALITY = IdNameStruct.IndFromId(IdNameStruct.IdFromName(sValue, ocPROCESSINGQUALITY), ocPROCESSINGQUALITY)
|
||||||
|
' ' EgtGetInfo(nPartId, BTL_PRT_RECESS, sValue)
|
||||||
|
' ' m_SelRECESS = IdNameStruct.IndFromId(IdNameStruct.IdFromName(sValue, ocRECESS), ocRECESS)
|
||||||
|
' ' EgtGetInfo(nPartId, BTL_PRT_STOREYTYPE, sValue)
|
||||||
|
' ' m_SelSTOREYTYPE = IdNameStruct.IndFromId(IdNameStruct.IdFromName(sValue, ocSTOREYTYPE), ocSTOREYTYPE)
|
||||||
|
' ' EgtGetInfo(nPartId, BTL_PRT_ELEMENTNUM, m_sELEMENTNUM)
|
||||||
|
' ' EgtGetInfo(nPartId, BTL_PRT_LAYER, m_nLAYER)
|
||||||
|
' ' EgtGetInfo(nPartId, BTL_PRT_MODULENUM, m_sMODULENUM)
|
||||||
|
' ' 'EgtGetInfo(nPartId, BTL_PRT_USERATTRIBUTE, m_sUSERATTRIBUTE)
|
||||||
|
' ' EgtGetInfo(nPartId, BTL_PRT_COMMENT, m_sCOMMENT)
|
||||||
|
|
||||||
|
' ' EgtGetInfo(nPartId, BTL_PRT_GRAINDIR, sValue)
|
||||||
|
' ' m_refGrainDir = New Vector3d
|
||||||
|
' ' sValArray = sValue.Split(New String() {",", ";"}, StringSplitOptions.RemoveEmptyEntries)
|
||||||
|
' ' If sValArray.Count() >= 4 Then
|
||||||
|
' ' StringToDouble(sValArray(0), m_refGrainDir.x)
|
||||||
|
' ' StringToDouble(sValArray(1), m_refGrainDir.y)
|
||||||
|
' ' StringToDouble(sValArray(2), m_refGrainDir.z)
|
||||||
|
' ' m_bGRAINDIRALIGN = (CInt(sValArray(3)) = 1)
|
||||||
|
' ' End If
|
||||||
|
|
||||||
|
' ' EgtGetInfo(nPartId, BTL_PRT_REFSIDE, sValue)
|
||||||
|
' ' sValArray = sValue.Split({";"}, StringSplitOptions.RemoveEmptyEntries)
|
||||||
|
' ' If sValArray.Count() >= 2 Then
|
||||||
|
' ' m_SelREFSIDE = ocREFSIDE.IndexOf(CInt(sValArray(0)))
|
||||||
|
' ' m_bREFSIDEALIGN = (CInt(sValArray(1)) = 1)
|
||||||
|
' ' End If
|
||||||
|
|
||||||
|
' ' EgtGetInfo(nPartId, BTL_PRT_ALIGNMENT, sValue)
|
||||||
|
' ' sValArray = sValue.Split({":"}, StringSplitOptions.RemoveEmptyEntries)
|
||||||
|
' ' If sValArray.Count() >= 2 Then
|
||||||
|
' ' m_SelALIGNLOCATION = IdNameStruct.IndFromId(IdNameStruct.IdFromName(sValArray(0), ocALIGNLOCATION), ocALIGNLOCATION)
|
||||||
|
' ' m_SelALIGNENDTYPE = IdNameStruct.IndFromId(IdNameStruct.IdFromName(sValArray(1).Trim(), ocALIGNENDTYPE), ocALIGNENDTYPE)
|
||||||
|
' ' End If
|
||||||
|
|
||||||
|
' ' EgtGetInfo(nPartId, BTL_PRT_MATERIALTYPE, sValue)
|
||||||
|
' ' sValArray = sValue.Split({":"}, StringSplitOptions.RemoveEmptyEntries)
|
||||||
|
' ' If sValArray.Count() >= 1 Then
|
||||||
|
' ' m_SelMATERIALTYPEGRP = IdNameStruct.IndFromId(IdNameStruct.IdFromName(sValArray(0), ocMATERIALTYPEGRP), ocMATERIALTYPEGRP)
|
||||||
|
' ' If sValArray.Count() >= 2 Then m_sMATERIALTYPESPEC = sValArray(1).Trim()
|
||||||
|
' ' End If
|
||||||
|
|
||||||
|
' ' If Not EgtGetInfo(nPartId, BTL_PRT_ROTATED, m_nROTATED) Then
|
||||||
|
' ' m_nROTATED = 0
|
||||||
|
' ' End If
|
||||||
|
' ' If Not EgtGetInfo(nPartId, BTL_PRT_INVERTED, m_nINVERTED) Then
|
||||||
|
' ' m_nINVERTED = 0
|
||||||
|
' ' End If
|
||||||
|
' ' If EgtGetInfo(nPartId, BTL_PRT_MATERIAL, m_sMATERIAL) Then
|
||||||
|
' ' If Not ParentStructure.MaterialList.Contains(m_sMATERIAL) Then
|
||||||
|
' ' ParentStructure.MaterialList.Add(m_sMATERIAL)
|
||||||
|
' ' End If
|
||||||
|
' ' End If
|
||||||
|
' ' If Not ParentStructure.SectionList.Contains(Section) Then
|
||||||
|
' ' ParentStructure.SectionList.Add(Section)
|
||||||
|
' ' End If
|
||||||
|
' ' ' Leggo outline
|
||||||
|
' ' Dim nOutlineLayerId As Integer = EgtGetFirstNameInGroup(nPartId, OUTLINE)
|
||||||
|
' ' Dim nOutlineId As Integer = EgtGetFirstInGroup(nOutlineLayerId)
|
||||||
|
' ' While nOutlineId <> GDB_ID.NULL
|
||||||
|
' ' ' verifico che sia una feature
|
||||||
|
' ' Dim nGRP As Integer
|
||||||
|
' ' If EgtGetInfo(nOutlineId, BTL_FTR_GRP, nGRP) Then
|
||||||
|
' ' ' creo la feature
|
||||||
|
' ' m_FeatureList.Add(New BTLFeatureVM(Me, nOutlineId))
|
||||||
|
' ' End If
|
||||||
|
' ' nOutlineId = EgtGetNext(nOutlineId)
|
||||||
|
' ' End While
|
||||||
|
' ' ' Leggo feature
|
||||||
|
' ' Dim nProcessingId As Integer = EgtGetFirstNameInGroup(nPartId, PROCESSINGS)
|
||||||
|
' ' Dim nFeatureId As Integer = EgtGetFirstInGroup(nProcessingId)
|
||||||
|
' ' While nFeatureId <> GDB_ID.NULL
|
||||||
|
' ' ' verifico che sia una feature
|
||||||
|
' ' Dim nGRP As Integer
|
||||||
|
' ' If EgtGetInfo(nFeatureId, BTL_FTR_GRP, nGRP) Then
|
||||||
|
' ' ' creo la feature
|
||||||
|
' ' m_FeatureList.Add(New BTLFeatureVM(Me, nFeatureId))
|
||||||
|
' ' End If
|
||||||
|
' ' nFeatureId = EgtGetNext(nFeatureId)
|
||||||
|
' ' End While
|
||||||
|
' ' ' Aggiorno check DOALL
|
||||||
|
' ' NotifyPropertyChanged("bDOALL")
|
||||||
|
' ' ' leggo calc error
|
||||||
|
' ' Dim nErr As Integer = 0
|
||||||
|
' ' Dim nRot As Integer = 0
|
||||||
|
' ' Dim nFall As Integer = 0
|
||||||
|
' ' Dim sMsg As String = ""
|
||||||
|
' ' Dim bCalc As Boolean = False
|
||||||
|
' ' bCalc = EgtGetInfo(nPartId, ITG_PROJ_ERR, nErr)
|
||||||
|
' ' EgtGetInfo(nPartId, ITG_PROJ_ROT, nRot)
|
||||||
|
' ' EgtGetInfo(nPartId, ITG_PROJ_FALL, sMsg)
|
||||||
|
' ' EgtGetInfo(nPartId, ITG_PROJ_MSG, sMsg)
|
||||||
|
' ' CalcPartUpdate(bCalc, nErr, nRot, nFall, sMsg)
|
||||||
|
' ' CalcFeatureUpdate()
|
||||||
|
' 'End Sub
|
||||||
|
|
||||||
|
' 'Sub New(ParentStructure As BTLStructure, nPartId As Integer)
|
||||||
|
' ' m_BTLStructureM = ParentStructure
|
||||||
|
' ' Me.SetPartId = nPartId
|
||||||
|
' ' m_FeatureList = New ObservableCollection(Of BTLFeature)
|
||||||
|
' 'End Sub
|
||||||
|
|
||||||
|
'#End Region ' CONSTRUCTOR
|
||||||
|
|
||||||
|
'#Region "METHODS"
|
||||||
|
|
||||||
|
' Public Event BTLFeatureAdded As EventHandler(Of BTLFeatureAddedEventArgs)
|
||||||
|
|
||||||
|
' Public Sub AddBTLFeature(BTLFeatureM As BTLFeatureM)
|
||||||
|
' If IsNothing(BTLFeatureM) Then Return
|
||||||
|
' If Not m_BTLFeatureMList.Contains(BTLFeatureM) Then
|
||||||
|
' m_BTLFeatureMList.Add(BTLFeatureM)
|
||||||
|
' RaiseEvent BTLFeatureAdded(Me, New BTLFeatureAddedEventArgs(BTLFeatureM))
|
||||||
|
' End If
|
||||||
|
' End Sub
|
||||||
|
|
||||||
|
' Public Function GetBTLFeatures() As List(Of BTLFeatureM)
|
||||||
|
' Return New List(Of BTLFeatureM)(m_BTLFeatureMList)
|
||||||
|
' End Function
|
||||||
|
|
||||||
|
' Public Function Rotation(IsPositive As Boolean, SelectedMachineType As MachineType, Optional dAng As Double = 90) As Boolean
|
||||||
|
' ' recupero il box del pezzo
|
||||||
|
' Dim nLs As Integer = EgtGetFirstNameInGroup(nPartId, "Box")
|
||||||
|
' Dim b3Solid As New BBox3d
|
||||||
|
' EgtGetBBoxGlob(nLs, GDB_BB.STANDARD, b3Solid)
|
||||||
|
' If b3Solid.IsEmpty() Then
|
||||||
|
' EgtOutLog("ERROR: Box non definito per la trave " & sNAM)
|
||||||
|
' Return False
|
||||||
|
' End If
|
||||||
|
' ' eseguo rotazione di 90 gradi attorno asse X
|
||||||
|
' Dim dRot = If(IsPositive, 1, -1) * Math.Abs(dAng)
|
||||||
|
' Dim vtAxes As Vector3d
|
||||||
|
' ' se travi ruoto attorno all'asse X
|
||||||
|
' If SelectedMachineType = MachineType.BEAM Then
|
||||||
|
' vtAxes = Vector3d.X_AX
|
||||||
|
' ' se pareti ruoto attorno all'asse Z
|
||||||
|
' ElseIf SelectedMachineType = MachineType.WALL Then
|
||||||
|
' vtAxes = -Vector3d.Z_AX
|
||||||
|
' End If
|
||||||
|
' ' se invertito
|
||||||
|
' Dim bInverted As Boolean = nINVERTED <> 0
|
||||||
|
' If bInverted Then
|
||||||
|
' ' annullo inversione
|
||||||
|
' Inversion(SelectedMachineType)
|
||||||
|
' End If
|
||||||
|
' ' eseguo rotazione
|
||||||
|
' Dim bOk As Boolean = EgtRotate(nPartId, b3Solid.Center, vtAxes, dRot, GDB_RT.GLOB)
|
||||||
|
' If bOk Then
|
||||||
|
' Dim dNewRotation As Double = (nROTATED + dRot) Mod 360
|
||||||
|
' nROTATED = If(dNewRotation >= 0, dNewRotation, 360 + dNewRotation)
|
||||||
|
' EgtSetInfo(nPartId, BTL_PRT_ROTATED, nROTATED)
|
||||||
|
' ' imposto modificato per copie
|
||||||
|
' EgtDuploSetModified(nPartId)
|
||||||
|
' End If
|
||||||
|
' ' se era invertito
|
||||||
|
' If bInverted Then
|
||||||
|
' ' ripristino inversione
|
||||||
|
' Inversion(SelectedMachineType)
|
||||||
|
' End If
|
||||||
|
' EgtDraw()
|
||||||
|
' Return bOk
|
||||||
|
' End Function
|
||||||
|
|
||||||
|
' Public Sub Inversion(SelectedMachineType As MachineType)
|
||||||
|
' ' recupero il box del pezzo
|
||||||
|
' Dim nLs As Integer = EgtGetFirstNameInGroup(nPartId, "Box")
|
||||||
|
' Dim b3Solid As New BBox3d
|
||||||
|
' EgtGetBBoxGlob(nLs, GDB_BB.STANDARD, b3Solid)
|
||||||
|
' If b3Solid.IsEmpty() Then
|
||||||
|
' EgtOutLog("ERROR: Box non definito per la trave " & sNAM)
|
||||||
|
' Return
|
||||||
|
' End If
|
||||||
|
' Dim vtAxes As Vector3d
|
||||||
|
' ' se travi ruoto attorno all'asse Z
|
||||||
|
' If SelectedMachineType = MachineType.BEAM Then
|
||||||
|
' vtAxes = Vector3d.Z_AX
|
||||||
|
' ' se pareti ruoto attorno all'asse X
|
||||||
|
' ElseIf SelectedMachineType = MachineType.WALL Then
|
||||||
|
' vtAxes = Vector3d.X_AX
|
||||||
|
' End If
|
||||||
|
' ' eseguo rotazione di 180 gradi
|
||||||
|
' If EgtRotate(nPartId, b3Solid.Center, vtAxes, 180, GDB_RT.GLOB) Then
|
||||||
|
' nINVERTED = If(nINVERTED = 0, 180, 0)
|
||||||
|
' EgtSetInfo(nPartId, BTL_PRT_INVERTED, nINVERTED)
|
||||||
|
' ' imposto modificato per copie
|
||||||
|
' EgtDuploSetModified(nPartId)
|
||||||
|
' End If
|
||||||
|
' End Sub
|
||||||
|
|
||||||
|
' Public Function NewProcId() As Integer
|
||||||
|
' Dim nMaxProcId As Integer = 0
|
||||||
|
' If Not IsNothing(BTLFeatureMList) AndAlso BTLFeatureMList.Count > 0 Then
|
||||||
|
' nMaxProcId = BTLFeatureMList.Max(Function(x) x.nPRID)
|
||||||
|
' End If
|
||||||
|
' Return nMaxProcId + 1
|
||||||
|
' End Function
|
||||||
|
|
||||||
|
#End Region ' METHODS
|
||||||
|
|
||||||
|
End Class
|
||||||
|
|
||||||
@@ -90,16 +90,6 @@ Public Class BTLFeatureM
|
|||||||
End Set
|
End Set
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
Protected m_nPriority As Integer = 0
|
|
||||||
Public Overridable Property nPriority As Integer
|
|
||||||
Get
|
|
||||||
Return m_nPriority
|
|
||||||
End Get
|
|
||||||
Set(value As Integer)
|
|
||||||
m_nPriority = value
|
|
||||||
End Set
|
|
||||||
End Property
|
|
||||||
|
|
||||||
' Nome
|
' Nome
|
||||||
Protected m_sName As String
|
Protected m_sName As String
|
||||||
Public ReadOnly Property sName As String
|
Public ReadOnly Property sName As String
|
||||||
@@ -254,11 +244,10 @@ Public Class BTLFeatureM
|
|||||||
Dim NewBTLFeature As New BTLFeatureM
|
Dim NewBTLFeature As New BTLFeatureM
|
||||||
NewBTLFeature.m_ParentPart = ParentPart
|
NewBTLFeature.m_ParentPart = ParentPart
|
||||||
NewBTLFeature.m_nFeatureId = nFeatureId
|
NewBTLFeature.m_nFeatureId = nFeatureId
|
||||||
' leggo gruppo, numero feature, lato e priorità
|
' leggo gruppo, numero feature e lato
|
||||||
EgtGetInfo(nFeatureId, BTL_FTR_GRP, NewBTLFeature.m_nSelGRP)
|
EgtGetInfo(nFeatureId, BTL_FTR_GRP, NewBTLFeature.m_nSelGRP)
|
||||||
EgtGetInfo(nFeatureId, BTL_FTR_PRC, NewBTLFeature.m_nPRC)
|
EgtGetInfo(nFeatureId, BTL_FTR_PRC, NewBTLFeature.m_nPRC)
|
||||||
EgtGetInfo(nFeatureId, BTL_FTR_SIDE, NewBTLFeature.m_nSelSIDE)
|
EgtGetInfo(nFeatureId, BTL_FTR_SIDE, NewBTLFeature.m_nSelSIDE)
|
||||||
EgtGetInfo(nFeatureId, BTL_FTR_PRIORITY, NewBTLFeature.m_nPRIORITY)
|
|
||||||
Dim nDO As Integer = 1
|
Dim nDO As Integer = 1
|
||||||
If EgtGetInfo(nFeatureId, BTL_FTR_DO, nDO) Then
|
If EgtGetInfo(nFeatureId, BTL_FTR_DO, nDO) Then
|
||||||
NewBTLFeature.m_bDO = (nDO <> 0)
|
NewBTLFeature.m_bDO = (nDO <> 0)
|
||||||
@@ -320,7 +309,6 @@ Public Class BTLFeatureM
|
|||||||
NewBTLFeature.m_nPRC = nPRC
|
NewBTLFeature.m_nPRC = nPRC
|
||||||
NewBTLFeature.m_nSelGRP = nGRP
|
NewBTLFeature.m_nSelGRP = nGRP
|
||||||
NewBTLFeature.m_nSelSIDE = nSIDE
|
NewBTLFeature.m_nSelSIDE = nSIDE
|
||||||
NewBTLFeature.m_nPriority = 0
|
|
||||||
NewBTLFeature.m_bDO = True
|
NewBTLFeature.m_bDO = True
|
||||||
' crea parametri per questa feature da file ini
|
' crea parametri per questa feature da file ini
|
||||||
NewBTLFeature.CreateFeatureParams(NewBTLFeature)
|
NewBTLFeature.CreateFeatureParams(NewBTLFeature)
|
||||||
@@ -479,7 +467,7 @@ Public Class BTLFeatureM
|
|||||||
If Param.nType = BTLParamType.DOUBLE_ Or Param.nType = BTLParamType.LENGTH Then
|
If Param.nType = BTLParamType.DOUBLE_ Or Param.nType = BTLParamType.LENGTH Then
|
||||||
Param.SetValue(Param.dDefault)
|
Param.SetValue(Param.dDefault)
|
||||||
ElseIf Param.nType = BTLParamType.STRING_ Then
|
ElseIf Param.nType = BTLParamType.STRING_ Then
|
||||||
Param.SetValue(Param.sDefault)
|
Param.SetValue("")
|
||||||
ElseIf Param.nType = BTLParamType.COMBO Then
|
ElseIf Param.nType = BTLParamType.COMBO Then
|
||||||
Param.nSelValue = Param.dDefault
|
Param.nSelValue = Param.dDefault
|
||||||
End If
|
End If
|
||||||
@@ -545,7 +533,6 @@ Public Class BTLFeatureM
|
|||||||
For Each QPar In QBTLParamMList
|
For Each QPar In QBTLParamMList
|
||||||
If QPar.bCustom Then EgtSetInfo(nFeatureId, QPar.sName & "A", 1)
|
If QPar.bCustom Then EgtSetInfo(nFeatureId, QPar.sName & "A", 1)
|
||||||
Next
|
Next
|
||||||
EgtSetInfo( nFeatureId, BTL_FTR_PRIORITY, nPriority)
|
|
||||||
SetFeatureId(nFeatureId)
|
SetFeatureId(nFeatureId)
|
||||||
' imposto modificato per copie
|
' imposto modificato per copie
|
||||||
EgtDuploSetModified(ParentPart.nPartId)
|
EgtDuploSetModified(ParentPart.nPartId)
|
||||||
@@ -554,7 +541,7 @@ Public Class BTLFeatureM
|
|||||||
' Impossibile creare una feature con questi valori - ERRORE
|
' Impossibile creare una feature con questi valori - ERRORE
|
||||||
MessageBox.Show(EgtMsg(61852), EgtMsg(30007))
|
MessageBox.Show(EgtMsg(61852), EgtMsg(30007))
|
||||||
nFeatureId = EgtBeamModifyProcess(Me.nFeatureId, Me.nSelGRP, Me.nPRC, Me.nSelSIDE, "", Me.nPRID,
|
nFeatureId = EgtBeamModifyProcess(Me.nFeatureId, Me.nSelGRP, Me.nPRC, Me.nSelSIDE, "", Me.nPRID,
|
||||||
Me.frFRAME, vPar, sPar, vParQ, nCrvId, nCrv2Id)
|
New Frame3d(), vPar, sPar, vParQ, nCrvId, nCrv2Id)
|
||||||
SetFeatureId(nFeatureId)
|
SetFeatureId(nFeatureId)
|
||||||
bOk = False
|
bOk = False
|
||||||
End If
|
End If
|
||||||
|
|||||||
@@ -0,0 +1,570 @@
|
|||||||
|
Imports System.Collections.ObjectModel
|
||||||
|
Imports EgtUILib
|
||||||
|
Imports EgtWPFLib5
|
||||||
|
|
||||||
|
Public Class BTLLayerM
|
||||||
|
Inherits BTLPartM
|
||||||
|
|
||||||
|
Public m_BTLPartMList As List(Of BTLPartM)
|
||||||
|
Public Property BTLPartMList As List(Of BTLPartM)
|
||||||
|
Get
|
||||||
|
Return m_BTLPartMList
|
||||||
|
End Get
|
||||||
|
Set(value As List(Of BTLPartM))
|
||||||
|
m_BTLPartMList = value
|
||||||
|
End Set
|
||||||
|
End Property
|
||||||
|
|
||||||
|
#Region "CONSTRUCTOR"
|
||||||
|
|
||||||
|
Protected Sub New()
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Public Shared Function CreateNewBTLLayer() As BTLLayerM
|
||||||
|
Return New BTLPartM
|
||||||
|
End Function
|
||||||
|
|
||||||
|
Public Shared Function CreateBTLLayer(nGroupId As Integer) As BTLLayerM
|
||||||
|
Dim NewBTLLayer As New BTLLayerM
|
||||||
|
NewBTLLayer = CreateBTLLayerAsPart(nGroupId)
|
||||||
|
Return NewBTLLayer
|
||||||
|
End Function
|
||||||
|
|
||||||
|
Public Overloads Shared Function CreateBTLLayerAsPart(nPartId As Integer) As BTLLayerM
|
||||||
|
Dim NewBTLPart As New BTLLayerM
|
||||||
|
NewBTLPart.m_nPartId = nPartId
|
||||||
|
' leggo info pezzo
|
||||||
|
Dim sValArray() As String
|
||||||
|
Dim sValue As String = String.Empty
|
||||||
|
Dim nValue As Integer = 0
|
||||||
|
EgtGetInfo(nPartId, BTL_PRT_PDN, NewBTLPart.m_nPDN)
|
||||||
|
Dim nDO As Integer = 1
|
||||||
|
If EgtGetInfo(nPartId, BTL_PRT_DO, nDO) Then
|
||||||
|
NewBTLPart.m_bDO = (nDO <> 0)
|
||||||
|
Else
|
||||||
|
NewBTLPart.m_bDO = True
|
||||||
|
End If
|
||||||
|
EgtGetInfo(nPartId, BTL_PRT_NAM, NewBTLPart.m_sNAM)
|
||||||
|
EgtGetInfo(nPartId, BTL_PRT_L, NewBTLPart.m_dBtlL)
|
||||||
|
EgtGetInfo(nPartId, BTL_PRT_W, NewBTLPart.m_dBtlW)
|
||||||
|
EgtGetInfo(nPartId, BTL_PRT_H, NewBTLPart.m_dBtlH)
|
||||||
|
EgtGetInfo(nPartId, BTL_PRT_CNT, NewBTLPart.m_nCNT)
|
||||||
|
EgtGetInfo(nPartId, BTL_PRT_ADDED, NewBTLPart.m_nADDED)
|
||||||
|
EgtGetInfo(nPartId, BTL_PRT_ASSEMBLYNUM, NewBTLPart.m_sASSEMBLYNUM)
|
||||||
|
EgtGetInfo(nPartId, BTL_PRT_ORDERNUM, NewBTLPart.m_nORDERNUM)
|
||||||
|
EgtGetInfo(nPartId, BTL_PRT_DESIGNATION, NewBTLPart.m_sDESIGN)
|
||||||
|
EgtGetInfo(nPartId, BTL_PRT_ANNOTATION, NewBTLPart.m_sANNOT)
|
||||||
|
EgtGetInfo(nPartId, BTL_PRT_STOREY, NewBTLPart.m_sSTOREY)
|
||||||
|
EgtGetInfo(nPartId, BTL_PRT_GROUP, NewBTLPart.m_sGROUP)
|
||||||
|
EgtGetInfo(nPartId, BTL_PRT_PACKAGE, NewBTLPart.m_sPACKAGE)
|
||||||
|
EgtGetInfo(nPartId, BTL_PRT_TIMBERGRADE, NewBTLPart.m_sTIMBERGRADE)
|
||||||
|
EgtGetInfo(nPartId, BTL_PRT_QUALITYGRADE, NewBTLPart.m_sQUALITYGRADE)
|
||||||
|
EgtGetInfo(nPartId, BTL_PRT_COLOUR, sValue)
|
||||||
|
NewBTLPart.m_colCOLOR.FromString(sValue)
|
||||||
|
EgtGetInfo(nPartId, BTL_PRT_PLANINGLENGTH, NewBTLPart.m_dPLANINGLEN)
|
||||||
|
EgtGetInfo(nPartId, BTL_PRT_STARTOFFSET, NewBTLPart.m_dSTARTOFFSET)
|
||||||
|
EgtGetInfo(nPartId, BTL_PRT_ENDOFFSET, NewBTLPart.m_dENDOFFSET)
|
||||||
|
Dim ind As Integer = 1
|
||||||
|
While EgtGetInfo(nPartId, BTL_PRT_UID & ind, nValue)
|
||||||
|
NewBTLPart.ocUID.Add(nValue)
|
||||||
|
EgtGetInfo(nPartId, BTL_PRT_TRANSFORMATION & ind, sValue)
|
||||||
|
NewBTLPart.m_refTransf = New Frame3d
|
||||||
|
Dim ptOri As New Point3d
|
||||||
|
Dim vtVersX As New Vector3d
|
||||||
|
Dim vtVersY As New Vector3d
|
||||||
|
sValArray = sValue.Split({","}, StringSplitOptions.RemoveEmptyEntries)
|
||||||
|
If sValArray.Count() >= 9 Then
|
||||||
|
StringToLen(sValArray(0), ptOri.x)
|
||||||
|
StringToLen(sValArray(1), ptOri.y)
|
||||||
|
StringToLen(sValArray(2), ptOri.z)
|
||||||
|
StringToDouble(sValArray(3), vtVersX.x)
|
||||||
|
StringToDouble(sValArray(4), vtVersX.y)
|
||||||
|
StringToDouble(sValArray(5), vtVersX.z)
|
||||||
|
StringToDouble(sValArray(6), vtVersY.x)
|
||||||
|
StringToDouble(sValArray(7), vtVersY.y)
|
||||||
|
StringToDouble(sValArray(8), vtVersY.z)
|
||||||
|
NewBTLPart.m_refTransf.ChangeOrigin(ptOri)
|
||||||
|
NewBTLPart.m_refTransf.Setup(ptOri, ptOri + vtVersX, ptOri + vtVersY)
|
||||||
|
End If
|
||||||
|
NewBTLPart.refTransfList.Add(NewBTLPart.m_refTransf)
|
||||||
|
ind = ind + 1
|
||||||
|
End While
|
||||||
|
EgtGetInfo(nPartId, BTL_PRT_CAMBER, sValue)
|
||||||
|
sValArray = sValue.Split(New String() {": ", " P"}, StringSplitOptions.RemoveEmptyEntries)
|
||||||
|
If sValArray.Count() >= 5 Then
|
||||||
|
StringToLen(sValArray(3), NewBTLPart.m_dCamberLen1)
|
||||||
|
StringToLen(sValArray(5), NewBTLPart.m_dCamberLen2)
|
||||||
|
StringToLen(sValArray(7), NewBTLPart.m_dCamberLen3)
|
||||||
|
StringToLen(sValArray(9), NewBTLPart.m_dCamberCross3)
|
||||||
|
End If
|
||||||
|
Dim pFrom As Integer = sValue.IndexOf("SIDE: ") + "SIDE: ".Length
|
||||||
|
Dim pTo As Integer = sValue.LastIndexOf(" P01")
|
||||||
|
If pTo >= 0 Then
|
||||||
|
nValue = CInt(sValue.Substring(pFrom, pTo - pFrom))
|
||||||
|
NewBTLPart.m_SelCAMBERSIDE = NewBTLPart.ocCAMBERSIDE.IndexOf(CInt(sValue.Substring(pFrom, pTo - pFrom)))
|
||||||
|
End If
|
||||||
|
|
||||||
|
EgtGetInfo(nPartId, BTL_PRT_PARTOFFSET, sValue)
|
||||||
|
sValArray = sValue.Split(New String() {": ", " P"}, StringSplitOptions.RemoveEmptyEntries)
|
||||||
|
If sValArray.Count() >= 5 Then
|
||||||
|
StringToLen(sValArray(3), NewBTLPart.m_dPartOffsetSide1)
|
||||||
|
StringToLen(sValArray(5), NewBTLPart.m_dPartOffsetSide2)
|
||||||
|
StringToLen(sValArray(7), NewBTLPart.m_dPartOffsetSide3)
|
||||||
|
StringToLen(sValArray(9), NewBTLPart.m_dPartOffsetSide4)
|
||||||
|
End If
|
||||||
|
pFrom = sValue.IndexOf("P04: ") + "P04: ".Length
|
||||||
|
pTo = sValue.LastIndexOf(" P11")
|
||||||
|
If pTo >= 0 Then
|
||||||
|
NewBTLPart.m_SelREFSIDEFIXCLAMP = IdNameStruct.IndFromId(IdNameStruct.IdFromName(sValue.Substring(pFrom, pTo - pFrom),
|
||||||
|
NewBTLPart.ocREFSIDEFIXCLAMP),
|
||||||
|
NewBTLPart.ocREFSIDEFIXCLAMP)
|
||||||
|
End If
|
||||||
|
|
||||||
|
Dim EnumIndex As Integer = 0
|
||||||
|
EgtGetInfo(nPartId, BTL_PRT_PROCESSINGQUALITY, sValue)
|
||||||
|
For ind = 1 To NewBTLPart.ocPROCESSINGQUALITY.Count
|
||||||
|
Dim sEnumName = [Enum].GetName(GetType(ProcessingQuality), ind)
|
||||||
|
If sEnumName.Equals(sValue) Then
|
||||||
|
EnumIndex = ind
|
||||||
|
Exit For
|
||||||
|
End If
|
||||||
|
Next
|
||||||
|
NewBTLPart.m_SelPROCESSINGQUALITY = EnumIndex - 1
|
||||||
|
EgtGetInfo(nPartId, BTL_PRT_RECESS, sValue)
|
||||||
|
EnumIndex = 0
|
||||||
|
For ind = 1 To NewBTLPart.ocRECESS.Count
|
||||||
|
Dim sEnumName = [Enum].GetName(GetType(Recess), ind)
|
||||||
|
If sEnumName.Equals(sValue) Then
|
||||||
|
EnumIndex = ind
|
||||||
|
Exit For
|
||||||
|
End If
|
||||||
|
Next
|
||||||
|
NewBTLPart.m_SelRECESS = EnumIndex - 1
|
||||||
|
EgtGetInfo(nPartId, BTL_PRT_STOREYTYPE, sValue)
|
||||||
|
EnumIndex = 0
|
||||||
|
For ind = 1 To NewBTLPart.ocSTOREYTYPE.Count
|
||||||
|
Dim sEnumName = [Enum].GetName(GetType(StoreyType), ind)
|
||||||
|
If sEnumName.Equals(sValue) Then
|
||||||
|
EnumIndex = ind
|
||||||
|
Exit For
|
||||||
|
End If
|
||||||
|
Next
|
||||||
|
NewBTLPart.m_SelSTOREYTYPE = EnumIndex - 1
|
||||||
|
EgtGetInfo(nPartId, BTL_PRT_ELEMENTNUM, NewBTLPart.m_sELEMENTNUM)
|
||||||
|
EgtGetInfo(nPartId, BTL_PRT_LAYER, NewBTLPart.m_nLAYER)
|
||||||
|
EgtGetInfo(nPartId, BTL_PRT_MODULENUM, NewBTLPart.m_sMODULENUM)
|
||||||
|
'EgtGetInfo(nPartId, BTL_PRT_USERATTRIBUTE, m_sUSERATTRIBUTE)
|
||||||
|
EgtGetInfo(nPartId, BTL_PRT_COMMENT, NewBTLPart.m_sCOMMENT)
|
||||||
|
|
||||||
|
EgtGetInfo(nPartId, BTL_PRT_GRAINDIR, sValue)
|
||||||
|
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)
|
||||||
|
NewBTLPart.m_bGRAINDIRALIGN = (CInt(sValArray(3)) = 1)
|
||||||
|
End If
|
||||||
|
|
||||||
|
EgtGetInfo(nPartId, BTL_PRT_REFSIDE, sValue)
|
||||||
|
sValArray = sValue.Split({";"}, StringSplitOptions.RemoveEmptyEntries)
|
||||||
|
If sValArray.Count() >= 2 Then
|
||||||
|
NewBTLPart.m_SelREFSIDE = NewBTLPart.ocREFSIDE.IndexOf(CInt(sValArray(0)))
|
||||||
|
NewBTLPart.m_bREFSIDEALIGN = (CInt(sValArray(1)) = 1)
|
||||||
|
End If
|
||||||
|
|
||||||
|
EgtGetInfo(nPartId, BTL_PRT_ALIGNMENT, sValue)
|
||||||
|
sValArray = sValue.Split({":"}, StringSplitOptions.RemoveEmptyEntries)
|
||||||
|
If sValArray.Count() >= 2 Then
|
||||||
|
NewBTLPart.m_SelALIGNLOCATION = IdNameStruct.IndFromId(IdNameStruct.IdFromName(sValArray(0), NewBTLPart.ocALIGNLOCATION),
|
||||||
|
NewBTLPart.ocALIGNLOCATION)
|
||||||
|
NewBTLPart.m_SelALIGNENDTYPE = IdNameStruct.IndFromId(IdNameStruct.IdFromName(sValArray(1).Trim(),
|
||||||
|
NewBTLPart.ocALIGNENDTYPE),
|
||||||
|
NewBTLPart.ocALIGNENDTYPE)
|
||||||
|
End If
|
||||||
|
|
||||||
|
EgtGetInfo(nPartId, BTL_PRT_MATERIALTYPE, sValue)
|
||||||
|
sValArray = sValue.Split({":"}, StringSplitOptions.RemoveEmptyEntries)
|
||||||
|
If sValArray.Count() >= 1 Then
|
||||||
|
NewBTLPart.m_SelMATERIALTYPEGRP = IdNameStruct.IndFromId(IdNameStruct.IdFromName(sValArray(0),
|
||||||
|
NewBTLPart.ocMATERIALTYPEGRP),
|
||||||
|
NewBTLPart.ocMATERIALTYPEGRP)
|
||||||
|
If sValArray.Count() >= 2 Then NewBTLPart.m_sMATERIALTYPESPEC = sValArray(1).Trim()
|
||||||
|
End If
|
||||||
|
|
||||||
|
If Not EgtGetInfo(nPartId, BTL_PRT_ROTATED, NewBTLPart.nROTATED) Then
|
||||||
|
NewBTLPart.nROTATED = 0
|
||||||
|
End If
|
||||||
|
If Not EgtGetInfo(nPartId, BTL_PRT_INVERTED, NewBTLPart.nINVERTED) Then
|
||||||
|
NewBTLPart.nINVERTED = 0
|
||||||
|
End If
|
||||||
|
EgtGetInfo(nPartId, BTL_PRT_MATERIAL, NewBTLPart.m_sMATERIAL)
|
||||||
|
If Not EgtGetInfo(nPartId, LOCK_ROT, NewBTLPart.bLockRotation) Then
|
||||||
|
NewBTLPart.bLockRotation = False
|
||||||
|
End If
|
||||||
|
If Not EgtGetInfo(nPartId, LOCK_FLIP, NewBTLPart.bLockInversion) Then
|
||||||
|
NewBTLPart.bLockInversion = False
|
||||||
|
End If
|
||||||
|
EgtGetInfo(nPartId, BTL_PRT_VOLUME, NewBTLPart.dVolume)
|
||||||
|
' Leggo outline e features
|
||||||
|
NewBTLPart.m_BTLFeatureMList = LoadFeatures(nPartId, NewBTLPart)
|
||||||
|
' leggo calc error
|
||||||
|
Dim nErr As Integer = 0
|
||||||
|
Dim nRot As Integer = 0
|
||||||
|
Dim nFall As Integer = 0
|
||||||
|
Dim sMsg As String = ""
|
||||||
|
Dim bCalc As Boolean = False
|
||||||
|
bCalc = EgtGetInfo(nPartId, ITG_PROJ_ERR, nErr)
|
||||||
|
EgtGetInfo(nPartId, ITG_PROJ_ROT, nRot)
|
||||||
|
EgtGetInfo(nPartId, ITG_PROJ_FALL, nFall)
|
||||||
|
EgtGetInfo(nPartId, ITG_PROJ_MSG, sMsg)
|
||||||
|
If Not bCalc Then
|
||||||
|
NewBTLPart.m_nState = CalcStates.NOTCALCULATED
|
||||||
|
NewBTLPart.nCALC_ERR = 0
|
||||||
|
NewBTLPart.m_nCALC_ROT = 0
|
||||||
|
NewBTLPart.nCALC_FALL = 0
|
||||||
|
NewBTLPart.sCALC_MSG = ""
|
||||||
|
Else
|
||||||
|
NewBTLPart.nCALC_ERR = nErr
|
||||||
|
NewBTLPart.nCALC_ROT = nRot
|
||||||
|
NewBTLPart.nCALC_FALL = nFall
|
||||||
|
NewBTLPart.sCALC_MSG = sMsg
|
||||||
|
Select Case nErr
|
||||||
|
Case 0
|
||||||
|
NewBTLPart.nState = CalcStates.OK
|
||||||
|
Case 22
|
||||||
|
NewBTLPart.nState = CalcStates.COLLISION
|
||||||
|
Case 17, 19
|
||||||
|
NewBTLPart.nState = CalcStates.WARNING
|
||||||
|
Case < 0
|
||||||
|
NewBTLPart.nState = CalcStates.INFO
|
||||||
|
Case > 0
|
||||||
|
NewBTLPart.nState = CalcStates.ERROR_
|
||||||
|
End Select
|
||||||
|
End If
|
||||||
|
EgtGetInfo(nPartId, ITG_PROJ_TIME, NewBTLPart.m_nCALC_TIME)
|
||||||
|
Return NewBTLPart
|
||||||
|
End Function
|
||||||
|
|
||||||
|
Private Shared Function LoadFeatures(nPartId As Integer, NewBTLPart As BTLLayerM) As List(Of BTLFeatureM)
|
||||||
|
Dim TempList As New List(Of BTLFeatureM)
|
||||||
|
' Leggo outline
|
||||||
|
Dim nOutlineLayerId As Integer = EgtGetFirstNameInGroup(nPartId, OUTLINE)
|
||||||
|
Dim nOutlineId As Integer = EgtGetFirstInGroup(nOutlineLayerId)
|
||||||
|
While nOutlineId <> GDB_ID.NULL
|
||||||
|
' verifico che sia una feature
|
||||||
|
Dim nGRP As Integer
|
||||||
|
If EgtGetInfo(nOutlineId, BTL_FTR_GRP, nGRP) Then
|
||||||
|
' creo la feature
|
||||||
|
TempList.Add(BTLFeatureM.CreateBTLFeature(NewBTLPart, nOutlineId))
|
||||||
|
End If
|
||||||
|
nOutlineId = EgtGetNext(nOutlineId)
|
||||||
|
End While
|
||||||
|
' Leggo feature
|
||||||
|
Dim nProcessingId As Integer = EgtGetFirstNameInGroup(nPartId, PROCESSINGS)
|
||||||
|
Dim nFeatureId As Integer = EgtGetFirstInGroup(nProcessingId)
|
||||||
|
While nFeatureId <> GDB_ID.NULL
|
||||||
|
' verifico che sia una feature
|
||||||
|
Dim nGRP As Integer
|
||||||
|
If EgtGetInfo(nFeatureId, BTL_FTR_GRP, nGRP) AndAlso Not EgtExistsInfo(nFeatureId, BTL_FTR_MAINID) Then
|
||||||
|
' creo la feature
|
||||||
|
Dim NewFeature As BTLFeatureM = BTLFeatureM.CreateBTLFeature(NewBTLPart, nFeatureId)
|
||||||
|
TempList.Add(NewFeature)
|
||||||
|
' aggiorno Id feature perchè potrebbe essere stata ricalcolata
|
||||||
|
nFeatureId = NewFeature.nFeatureId
|
||||||
|
End If
|
||||||
|
nFeatureId = EgtGetNext(nFeatureId)
|
||||||
|
End While
|
||||||
|
Return TempList
|
||||||
|
End Function
|
||||||
|
|
||||||
|
'Sub New(ParentStructure As BTLStructureVM, nPartId As Integer)
|
||||||
|
' MyBase.New(ParentStructure, nPartId)
|
||||||
|
' ' leggo info pezzo
|
||||||
|
' Dim sValArray() As String
|
||||||
|
' Dim sValue As String = String.Empty
|
||||||
|
' Dim nValue As Integer = 0
|
||||||
|
' EgtGetInfo(nPartId, BTL_PRT_PDN, nPDN)
|
||||||
|
' Dim nDO As Integer = 1
|
||||||
|
' If EgtGetInfo(nPartId, BTL_PRT_DO, nDO) Then
|
||||||
|
' m_bDO = (nDO <> 0)
|
||||||
|
' Else
|
||||||
|
' m_bDO = True
|
||||||
|
' End If
|
||||||
|
' EgtGetInfo(nPartId, BTL_PRT_NAM, m_sNAM)
|
||||||
|
' EgtGetInfo(nPartId, BTL_PRT_L, m_dL)
|
||||||
|
' EgtGetInfo(nPartId, BTL_PRT_W, m_dW)
|
||||||
|
' EgtGetInfo(nPartId, BTL_PRT_H, m_dH)
|
||||||
|
' EgtGetInfo(nPartId, BTL_PRT_CNT, m_nCNT)
|
||||||
|
' EgtGetInfo(nPartId, BTL_PRT_ASSEMBLYNUM, m_sASSEMBLYNUM)
|
||||||
|
' EgtGetInfo(nPartId, BTL_PRT_ORDERNUM, m_nORDERNUM)
|
||||||
|
' EgtGetInfo(nPartId, BTL_PRT_DESIGNATION, m_sDESIGN)
|
||||||
|
' EgtGetInfo(nPartId, BTL_PRT_ANNOTATION, m_sANNOT)
|
||||||
|
' EgtGetInfo(nPartId, BTL_PRT_STOREY, m_sSTOREY)
|
||||||
|
' EgtGetInfo(nPartId, BTL_PRT_GROUP, m_sGROUP)
|
||||||
|
' EgtGetInfo(nPartId, BTL_PRT_PACKAGE, m_sPACKAGE)
|
||||||
|
' EgtGetInfo(nPartId, BTL_PRT_TIMBERGRADE, m_sTIMBERGRADE)
|
||||||
|
' EgtGetInfo(nPartId, BTL_PRT_QUALITYGRADE, m_sQUALITYGRADE)
|
||||||
|
' EgtGetInfo(nPartId, BTL_PRT_COLOUR, sValue)
|
||||||
|
' m_colCOLOR.FromString(sValue)
|
||||||
|
' EgtGetInfo(nPartId, BTL_PRT_PLANINGLENGTH, m_dPLANINGLEN)
|
||||||
|
' EgtGetInfo(nPartId, BTL_PRT_STARTOFFSET, m_dSTARTOFFSET)
|
||||||
|
' EgtGetInfo(nPartId, BTL_PRT_ENDOFFSET, m_dENDOFFSET)
|
||||||
|
|
||||||
|
' Dim ind As Integer = 1
|
||||||
|
' While EgtGetInfo(nPartId, BTL_PRT_UID & ind, nValue)
|
||||||
|
' ocUID.Add(nValue)
|
||||||
|
' EgtGetInfo(nPartId, BTL_PRT_TRANSFORMATION & ind, sValue)
|
||||||
|
' m_refTransf = New Frame3d
|
||||||
|
' Dim ptOri As New Point3d
|
||||||
|
' Dim vtVersX As New Vector3d
|
||||||
|
' Dim vtVersY As New Vector3d
|
||||||
|
' sValArray = sValue.Split({","}, StringSplitOptions.RemoveEmptyEntries)
|
||||||
|
' If sValArray.Count() >= 9 Then
|
||||||
|
' StringToLen(sValArray(0), ptOri.x)
|
||||||
|
' StringToLen(sValArray(1), ptOri.y)
|
||||||
|
' StringToLen(sValArray(2), ptOri.z)
|
||||||
|
' StringToDouble(sValArray(3), vtVersX.x)
|
||||||
|
' StringToDouble(sValArray(4), vtVersX.y)
|
||||||
|
' StringToDouble(sValArray(5), vtVersX.z)
|
||||||
|
' StringToDouble(sValArray(6), vtVersY.x)
|
||||||
|
' StringToDouble(sValArray(7), vtVersY.y)
|
||||||
|
' StringToDouble(sValArray(8), vtVersY.z)
|
||||||
|
' m_refTransf.ChangeOrigin(ptOri)
|
||||||
|
' m_refTransf.Setup(ptOri, ptOri + vtVersX, ptOri + vtVersY)
|
||||||
|
' End If
|
||||||
|
' refTransfList.Add(m_refTransf)
|
||||||
|
' ind = ind + 1
|
||||||
|
' End While
|
||||||
|
|
||||||
|
' EgtGetInfo(nPartId, BTL_PRT_CAMBER, sValue)
|
||||||
|
' sValArray = sValue.Split(New String() {": ", " P"}, StringSplitOptions.RemoveEmptyEntries)
|
||||||
|
' If sValArray.Count() >= 5 Then
|
||||||
|
' StringToLen(sValArray(3), m_dCamberLen1)
|
||||||
|
' StringToLen(sValArray(5), m_dCamberLen2)
|
||||||
|
' StringToLen(sValArray(7), m_dCamberLen3)
|
||||||
|
' StringToLen(sValArray(9), m_dCamberCross3)
|
||||||
|
' End If
|
||||||
|
' Dim pFrom As Integer = sValue.IndexOf("SIDE: ") + "SIDE: ".Length
|
||||||
|
' Dim pTo As Integer = sValue.LastIndexOf(" P01")
|
||||||
|
' If pTo >= 0 Then
|
||||||
|
' nValue = CInt(sValue.Substring(pFrom, pTo - pFrom))
|
||||||
|
' m_SelCAMBERSIDE = ocCAMBERSIDE.IndexOf(CInt(sValue.Substring(pFrom, pTo - pFrom)))
|
||||||
|
' End If
|
||||||
|
|
||||||
|
' EgtGetInfo(nPartId, BTL_PRT_PARTOFFSET, sValue)
|
||||||
|
' sValArray = sValue.Split(New String() {": ", " P"}, StringSplitOptions.RemoveEmptyEntries)
|
||||||
|
' If sValArray.Count() >= 5 Then
|
||||||
|
' StringToLen(sValArray(3), m_dPartOffsetSide1)
|
||||||
|
' StringToLen(sValArray(5), m_dPartOffsetSide2)
|
||||||
|
' StringToLen(sValArray(7), m_dPartOffsetSide3)
|
||||||
|
' StringToLen(sValArray(9), m_dPartOffsetSide4)
|
||||||
|
' End If
|
||||||
|
' pFrom = sValue.IndexOf("P04: ") + "P04: ".Length
|
||||||
|
' pTo = sValue.LastIndexOf(" P11")
|
||||||
|
' If pTo >= 0 Then
|
||||||
|
' m_SelREFSIDEFIXCLAMP = IdNameStruct.IndFromId(IdNameStruct.IdFromName(sValue.Substring(pFrom, pTo - pFrom), ocREFSIDEFIXCLAMP), ocREFSIDEFIXCLAMP)
|
||||||
|
' End If
|
||||||
|
|
||||||
|
' EgtGetInfo(nPartId, BTL_PRT_PROCESSINGQUALITY, sValue)
|
||||||
|
' m_SelPROCESSINGQUALITY = IdNameStruct.IndFromId(IdNameStruct.IdFromName(sValue, ocPROCESSINGQUALITY), ocPROCESSINGQUALITY)
|
||||||
|
' EgtGetInfo(nPartId, BTL_PRT_RECESS, sValue)
|
||||||
|
' m_SelRECESS = IdNameStruct.IndFromId(IdNameStruct.IdFromName(sValue, ocRECESS), ocRECESS)
|
||||||
|
' EgtGetInfo(nPartId, BTL_PRT_STOREYTYPE, sValue)
|
||||||
|
' m_SelSTOREYTYPE = IdNameStruct.IndFromId(IdNameStruct.IdFromName(sValue, ocSTOREYTYPE), ocSTOREYTYPE)
|
||||||
|
' EgtGetInfo(nPartId, BTL_PRT_ELEMENTNUM, m_sELEMENTNUM)
|
||||||
|
' EgtGetInfo(nPartId, BTL_PRT_LAYER, m_nLAYER)
|
||||||
|
' EgtGetInfo(nPartId, BTL_PRT_MODULENUM, m_sMODULENUM)
|
||||||
|
' 'EgtGetInfo(nPartId, BTL_PRT_USERATTRIBUTE, m_sUSERATTRIBUTE)
|
||||||
|
' EgtGetInfo(nPartId, BTL_PRT_COMMENT, m_sCOMMENT)
|
||||||
|
|
||||||
|
' EgtGetInfo(nPartId, BTL_PRT_GRAINDIR, sValue)
|
||||||
|
' m_refGrainDir = New Vector3d
|
||||||
|
' sValArray = sValue.Split(New String() {",", ";"}, StringSplitOptions.RemoveEmptyEntries)
|
||||||
|
' If sValArray.Count() >= 4 Then
|
||||||
|
' StringToDouble(sValArray(0), m_refGrainDir.x)
|
||||||
|
' StringToDouble(sValArray(1), m_refGrainDir.y)
|
||||||
|
' StringToDouble(sValArray(2), m_refGrainDir.z)
|
||||||
|
' m_bGRAINDIRALIGN = (CInt(sValArray(3)) = 1)
|
||||||
|
' End If
|
||||||
|
|
||||||
|
' EgtGetInfo(nPartId, BTL_PRT_REFSIDE, sValue)
|
||||||
|
' sValArray = sValue.Split({";"}, StringSplitOptions.RemoveEmptyEntries)
|
||||||
|
' If sValArray.Count() >= 2 Then
|
||||||
|
' m_SelREFSIDE = ocREFSIDE.IndexOf(CInt(sValArray(0)))
|
||||||
|
' m_bREFSIDEALIGN = (CInt(sValArray(1)) = 1)
|
||||||
|
' End If
|
||||||
|
|
||||||
|
' EgtGetInfo(nPartId, BTL_PRT_ALIGNMENT, sValue)
|
||||||
|
' sValArray = sValue.Split({":"}, StringSplitOptions.RemoveEmptyEntries)
|
||||||
|
' If sValArray.Count() >= 2 Then
|
||||||
|
' m_SelALIGNLOCATION = IdNameStruct.IndFromId(IdNameStruct.IdFromName(sValArray(0), ocALIGNLOCATION), ocALIGNLOCATION)
|
||||||
|
' m_SelALIGNENDTYPE = IdNameStruct.IndFromId(IdNameStruct.IdFromName(sValArray(1).Trim(), ocALIGNENDTYPE), ocALIGNENDTYPE)
|
||||||
|
' End If
|
||||||
|
|
||||||
|
' EgtGetInfo(nPartId, BTL_PRT_MATERIALTYPE, sValue)
|
||||||
|
' sValArray = sValue.Split({":"}, StringSplitOptions.RemoveEmptyEntries)
|
||||||
|
' If sValArray.Count() >= 1 Then
|
||||||
|
' m_SelMATERIALTYPEGRP = IdNameStruct.IndFromId(IdNameStruct.IdFromName(sValArray(0), ocMATERIALTYPEGRP), ocMATERIALTYPEGRP)
|
||||||
|
' If sValArray.Count() >= 2 Then m_sMATERIALTYPESPEC = sValArray(1).Trim()
|
||||||
|
' End If
|
||||||
|
|
||||||
|
' If Not EgtGetInfo(nPartId, BTL_PRT_ROTATED, m_nROTATED) Then
|
||||||
|
' m_nROTATED = 0
|
||||||
|
' End If
|
||||||
|
' If Not EgtGetInfo(nPartId, BTL_PRT_INVERTED, m_nINVERTED) Then
|
||||||
|
' m_nINVERTED = 0
|
||||||
|
' End If
|
||||||
|
' If EgtGetInfo(nPartId, BTL_PRT_MATERIAL, m_sMATERIAL) Then
|
||||||
|
' If Not ParentStructure.MaterialList.Contains(m_sMATERIAL) Then
|
||||||
|
' ParentStructure.MaterialList.Add(m_sMATERIAL)
|
||||||
|
' End If
|
||||||
|
' End If
|
||||||
|
' If Not ParentStructure.SectionList.Contains(Section) Then
|
||||||
|
' ParentStructure.SectionList.Add(Section)
|
||||||
|
' End If
|
||||||
|
' ' Leggo outline
|
||||||
|
' Dim nOutlineLayerId As Integer = EgtGetFirstNameInGroup(nPartId, OUTLINE)
|
||||||
|
' Dim nOutlineId As Integer = EgtGetFirstInGroup(nOutlineLayerId)
|
||||||
|
' While nOutlineId <> GDB_ID.NULL
|
||||||
|
' ' verifico che sia una feature
|
||||||
|
' Dim nGRP As Integer
|
||||||
|
' If EgtGetInfo(nOutlineId, BTL_FTR_GRP, nGRP) Then
|
||||||
|
' ' creo la feature
|
||||||
|
' m_FeatureList.Add(New BTLFeatureVM(Me, nOutlineId))
|
||||||
|
' End If
|
||||||
|
' nOutlineId = EgtGetNext(nOutlineId)
|
||||||
|
' End While
|
||||||
|
' ' Leggo feature
|
||||||
|
' Dim nProcessingId As Integer = EgtGetFirstNameInGroup(nPartId, PROCESSINGS)
|
||||||
|
' Dim nFeatureId As Integer = EgtGetFirstInGroup(nProcessingId)
|
||||||
|
' While nFeatureId <> GDB_ID.NULL
|
||||||
|
' ' verifico che sia una feature
|
||||||
|
' Dim nGRP As Integer
|
||||||
|
' If EgtGetInfo(nFeatureId, BTL_FTR_GRP, nGRP) Then
|
||||||
|
' ' creo la feature
|
||||||
|
' m_FeatureList.Add(New BTLFeatureVM(Me, nFeatureId))
|
||||||
|
' End If
|
||||||
|
' nFeatureId = EgtGetNext(nFeatureId)
|
||||||
|
' End While
|
||||||
|
' ' Aggiorno check DOALL
|
||||||
|
' NotifyPropertyChanged("bDOALL")
|
||||||
|
' ' leggo calc error
|
||||||
|
' Dim nErr As Integer = 0
|
||||||
|
' Dim nRot As Integer = 0
|
||||||
|
' Dim nFall As Integer = 0
|
||||||
|
' Dim sMsg As String = ""
|
||||||
|
' Dim bCalc As Boolean = False
|
||||||
|
' bCalc = EgtGetInfo(nPartId, ITG_PROJ_ERR, nErr)
|
||||||
|
' EgtGetInfo(nPartId, ITG_PROJ_ROT, nRot)
|
||||||
|
' EgtGetInfo(nPartId, ITG_PROJ_FALL, sMsg)
|
||||||
|
' EgtGetInfo(nPartId, ITG_PROJ_MSG, sMsg)
|
||||||
|
' CalcPartUpdate(bCalc, nErr, nRot, nFall, sMsg)
|
||||||
|
' CalcFeatureUpdate()
|
||||||
|
'End Sub
|
||||||
|
|
||||||
|
'Sub New(ParentStructure As BTLStructure, nPartId As Integer)
|
||||||
|
' m_BTLStructureM = ParentStructure
|
||||||
|
' Me.SetPartId = nPartId
|
||||||
|
' m_FeatureList = New ObservableCollection(Of BTLFeature)
|
||||||
|
'End Sub
|
||||||
|
|
||||||
|
'#End Region ' CONSTRUCTOR
|
||||||
|
|
||||||
|
'#Region "METHODS"
|
||||||
|
|
||||||
|
' Public Event BTLFeatureAdded As EventHandler(Of BTLFeatureAddedEventArgs)
|
||||||
|
|
||||||
|
' Public Sub AddBTLFeature(BTLFeatureM As BTLFeatureM)
|
||||||
|
' If IsNothing(BTLFeatureM) Then Return
|
||||||
|
' If Not m_BTLFeatureMList.Contains(BTLFeatureM) Then
|
||||||
|
' m_BTLFeatureMList.Add(BTLFeatureM)
|
||||||
|
' RaiseEvent BTLFeatureAdded(Me, New BTLFeatureAddedEventArgs(BTLFeatureM))
|
||||||
|
' End If
|
||||||
|
' End Sub
|
||||||
|
|
||||||
|
' Public Function GetBTLFeatures() As List(Of BTLFeatureM)
|
||||||
|
' Return New List(Of BTLFeatureM)(m_BTLFeatureMList)
|
||||||
|
' End Function
|
||||||
|
|
||||||
|
' Public Function Rotation(IsPositive As Boolean, SelectedMachineType As MachineType, Optional dAng As Double = 90) As Boolean
|
||||||
|
' ' recupero il box del pezzo
|
||||||
|
' Dim nLs As Integer = EgtGetFirstNameInGroup(nPartId, "Box")
|
||||||
|
' Dim b3Solid As New BBox3d
|
||||||
|
' EgtGetBBoxGlob(nLs, GDB_BB.STANDARD, b3Solid)
|
||||||
|
' If b3Solid.IsEmpty() Then
|
||||||
|
' EgtOutLog("ERROR: Box non definito per la trave " & sNAM)
|
||||||
|
' Return False
|
||||||
|
' End If
|
||||||
|
' ' eseguo rotazione di 90 gradi attorno asse X
|
||||||
|
' Dim dRot = If(IsPositive, 1, -1) * Math.Abs(dAng)
|
||||||
|
' Dim vtAxes As Vector3d
|
||||||
|
' ' se travi ruoto attorno all'asse X
|
||||||
|
' If SelectedMachineType = MachineType.BEAM Then
|
||||||
|
' vtAxes = Vector3d.X_AX
|
||||||
|
' ' se pareti ruoto attorno all'asse Z
|
||||||
|
' ElseIf SelectedMachineType = MachineType.WALL Then
|
||||||
|
' vtAxes = -Vector3d.Z_AX
|
||||||
|
' End If
|
||||||
|
' ' se invertito
|
||||||
|
' Dim bInverted As Boolean = nINVERTED <> 0
|
||||||
|
' If bInverted Then
|
||||||
|
' ' annullo inversione
|
||||||
|
' Inversion(SelectedMachineType)
|
||||||
|
' End If
|
||||||
|
' ' eseguo rotazione
|
||||||
|
' Dim bOk As Boolean = EgtRotate(nPartId, b3Solid.Center, vtAxes, dRot, GDB_RT.GLOB)
|
||||||
|
' If bOk Then
|
||||||
|
' Dim dNewRotation As Double = (nROTATED + dRot) Mod 360
|
||||||
|
' nROTATED = If(dNewRotation >= 0, dNewRotation, 360 + dNewRotation)
|
||||||
|
' EgtSetInfo(nPartId, BTL_PRT_ROTATED, nROTATED)
|
||||||
|
' ' imposto modificato per copie
|
||||||
|
' EgtDuploSetModified(nPartId)
|
||||||
|
' End If
|
||||||
|
' ' se era invertito
|
||||||
|
' If bInverted Then
|
||||||
|
' ' ripristino inversione
|
||||||
|
' Inversion(SelectedMachineType)
|
||||||
|
' End If
|
||||||
|
' EgtDraw()
|
||||||
|
' Return bOk
|
||||||
|
' End Function
|
||||||
|
|
||||||
|
' Public Sub Inversion(SelectedMachineType As MachineType)
|
||||||
|
' ' recupero il box del pezzo
|
||||||
|
' Dim nLs As Integer = EgtGetFirstNameInGroup(nPartId, "Box")
|
||||||
|
' Dim b3Solid As New BBox3d
|
||||||
|
' EgtGetBBoxGlob(nLs, GDB_BB.STANDARD, b3Solid)
|
||||||
|
' If b3Solid.IsEmpty() Then
|
||||||
|
' EgtOutLog("ERROR: Box non definito per la trave " & sNAM)
|
||||||
|
' Return
|
||||||
|
' End If
|
||||||
|
' Dim vtAxes As Vector3d
|
||||||
|
' ' se travi ruoto attorno all'asse Z
|
||||||
|
' If SelectedMachineType = MachineType.BEAM Then
|
||||||
|
' vtAxes = Vector3d.Z_AX
|
||||||
|
' ' se pareti ruoto attorno all'asse X
|
||||||
|
' ElseIf SelectedMachineType = MachineType.WALL Then
|
||||||
|
' vtAxes = Vector3d.X_AX
|
||||||
|
' End If
|
||||||
|
' ' eseguo rotazione di 180 gradi
|
||||||
|
' If EgtRotate(nPartId, b3Solid.Center, vtAxes, 180, GDB_RT.GLOB) Then
|
||||||
|
' nINVERTED = If(nINVERTED = 0, 180, 0)
|
||||||
|
' EgtSetInfo(nPartId, BTL_PRT_INVERTED, nINVERTED)
|
||||||
|
' ' imposto modificato per copie
|
||||||
|
' EgtDuploSetModified(nPartId)
|
||||||
|
' End If
|
||||||
|
' End Sub
|
||||||
|
|
||||||
|
' Public Function NewProcId() As Integer
|
||||||
|
' Dim nMaxProcId As Integer = 0
|
||||||
|
' If Not IsNothing(BTLFeatureMList) AndAlso BTLFeatureMList.Count > 0 Then
|
||||||
|
' nMaxProcId = BTLFeatureMList.Max(Function(x) x.nPRID)
|
||||||
|
' End If
|
||||||
|
' Return nMaxProcId + 1
|
||||||
|
' End Function
|
||||||
|
|
||||||
|
#End Region ' METHODS
|
||||||
|
|
||||||
|
End Class
|
||||||
|
|
||||||
@@ -129,16 +129,6 @@ Public Class BTLParamM
|
|||||||
End Set
|
End Set
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
Protected m_sDefault As String
|
|
||||||
Public Property sDefault As String
|
|
||||||
Get
|
|
||||||
Return m_sDefault
|
|
||||||
End Get
|
|
||||||
Set(value As String)
|
|
||||||
m_sDefault = value
|
|
||||||
End Set
|
|
||||||
End Property
|
|
||||||
|
|
||||||
' tipo della variabile
|
' tipo della variabile
|
||||||
Protected m_nType As BTLParamType
|
Protected m_nType As BTLParamType
|
||||||
Public ReadOnly Property nType As BTLParamType
|
Public ReadOnly Property nType As BTLParamType
|
||||||
@@ -146,9 +136,6 @@ Public Class BTLParamM
|
|||||||
Return m_nType
|
Return m_nType
|
||||||
End Get
|
End Get
|
||||||
End Property
|
End Property
|
||||||
Public Sub SetType(value As BTLParamType)
|
|
||||||
m_nType = value
|
|
||||||
End Sub
|
|
||||||
|
|
||||||
' Feature a cui appartiene il parametro
|
' Feature a cui appartiene il parametro
|
||||||
Protected m_ParentFeature As BTLFeatureM
|
Protected m_ParentFeature As BTLFeatureM
|
||||||
@@ -258,18 +245,16 @@ Public Class BTLParamM
|
|||||||
End Function
|
End Function
|
||||||
|
|
||||||
' new per stringhe
|
' new per stringhe
|
||||||
Public Shared Function CreateBTLParam(ParentFeature As BTLFeatureM, IsP As Boolean, nType As BTLParamType, sParamName As String, sDefault As String, sDescription As String)
|
Public Shared Function CreateBTLParam(ParentFeature As BTLFeatureM, IsP As Boolean, nType As BTLParamType, sParamName As String, sDescription As String)
|
||||||
Dim NewBTLParam As New BTLParamM
|
Dim NewBTLParam As New BTLParamM
|
||||||
NewBTLParam.StdInit(ParentFeature, IsP, nType, sParamName, sDescription)
|
NewBTLParam.StdInit(ParentFeature, IsP, nType, sParamName, sDescription)
|
||||||
NewBTLParam.m_sDefault = sDefault
|
|
||||||
Return NewBTLParam
|
Return NewBTLParam
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
' new per stringhe (con tipo Beam o Wall)
|
' new per stringhe (con tipo Beam o Wall)
|
||||||
Public Shared Function CreateBTLParam(ParentFeature As BTLFeatureM, IsP As Boolean, nType As BTLParamType, sParamName As String, sDefault As String, sDescription As String, sBWType As String)
|
Public Shared Function CreateBTLParam(ParentFeature As BTLFeatureM, IsP As Boolean, nType As BTLParamType, sParamName As String, sDescription As String, sBWType As String)
|
||||||
Dim NewBTLParam As New BTLParamM
|
Dim NewBTLParam As New BTLParamM
|
||||||
NewBTLParam.StdInit(ParentFeature, IsP, nType, sParamName, sDescription)
|
NewBTLParam.StdInit(ParentFeature, IsP, nType, sParamName, sDescription)
|
||||||
NewBTLParam.m_sDefault = sDefault
|
|
||||||
NewBTLParam.m_sBWType = sBWType
|
NewBTLParam.m_sBWType = sBWType
|
||||||
Return NewBTLParam
|
Return NewBTLParam
|
||||||
End Function
|
End Function
|
||||||
|
|||||||
@@ -797,15 +797,15 @@ Public Class BTLPartM
|
|||||||
Dim vtVersY As New Vector3d
|
Dim vtVersY As New Vector3d
|
||||||
sValArray = sValue.Split({","}, StringSplitOptions.RemoveEmptyEntries)
|
sValArray = sValue.Split({","}, StringSplitOptions.RemoveEmptyEntries)
|
||||||
If sValArray.Count() >= 9 Then
|
If sValArray.Count() >= 9 Then
|
||||||
StringToLenAdv(sValArray(0), ptOri.x)
|
StringToLen(sValArray(0), ptOri.x)
|
||||||
StringToLenAdv(sValArray(1), ptOri.y)
|
StringToLen(sValArray(1), ptOri.y)
|
||||||
StringToLenAdv(sValArray(2), ptOri.z)
|
StringToLen(sValArray(2), ptOri.z)
|
||||||
StringToDoubleAdv(sValArray(3), vtVersX.x)
|
StringToDouble(sValArray(3), vtVersX.x)
|
||||||
StringToDoubleAdv(sValArray(4), vtVersX.y)
|
StringToDouble(sValArray(4), vtVersX.y)
|
||||||
StringToDoubleAdv(sValArray(5), vtVersX.z)
|
StringToDouble(sValArray(5), vtVersX.z)
|
||||||
StringToDoubleAdv(sValArray(6), vtVersY.x)
|
StringToDouble(sValArray(6), vtVersY.x)
|
||||||
StringToDoubleAdv(sValArray(7), vtVersY.y)
|
StringToDouble(sValArray(7), vtVersY.y)
|
||||||
StringToDoubleAdv(sValArray(8), vtVersY.z)
|
StringToDouble(sValArray(8), vtVersY.z)
|
||||||
NewBTLPart.m_refTransf.ChangeOrigin(ptOri)
|
NewBTLPart.m_refTransf.ChangeOrigin(ptOri)
|
||||||
NewBTLPart.m_refTransf.Setup(ptOri, ptOri + vtVersX, ptOri + vtVersY)
|
NewBTLPart.m_refTransf.Setup(ptOri, ptOri + vtVersX, ptOri + vtVersY)
|
||||||
End If
|
End If
|
||||||
@@ -813,12 +813,12 @@ Public Class BTLPartM
|
|||||||
ind = ind + 1
|
ind = ind + 1
|
||||||
End While
|
End While
|
||||||
EgtGetInfo(nPartId, BTL_PRT_CAMBER, sValue)
|
EgtGetInfo(nPartId, BTL_PRT_CAMBER, sValue)
|
||||||
sValArray = sValue.Split(New String() {":", "P"}, StringSplitOptions.RemoveEmptyEntries)
|
sValArray = sValue.Split(New String() {": ", " P"}, StringSplitOptions.RemoveEmptyEntries)
|
||||||
If sValArray.Count() >= 10 Then
|
If sValArray.Count() >= 5 Then
|
||||||
StringToLenAdv(sValArray(3), NewBTLPart.m_dCamberLen1)
|
StringToLen(sValArray(3), NewBTLPart.m_dCamberLen1)
|
||||||
StringToLenAdv(sValArray(5), NewBTLPart.m_dCamberLen2)
|
StringToLen(sValArray(5), NewBTLPart.m_dCamberLen2)
|
||||||
StringToLenAdv(sValArray(7), NewBTLPart.m_dCamberLen3)
|
StringToLen(sValArray(7), NewBTLPart.m_dCamberLen3)
|
||||||
StringToLenAdv(sValArray(9), NewBTLPart.m_dCamberCross3)
|
StringToLen(sValArray(9), NewBTLPart.m_dCamberCross3)
|
||||||
End If
|
End If
|
||||||
Dim pFrom As Integer = sValue.IndexOf("SIDE: ") + "SIDE: ".Length
|
Dim pFrom As Integer = sValue.IndexOf("SIDE: ") + "SIDE: ".Length
|
||||||
Dim pTo As Integer = sValue.LastIndexOf(" P01")
|
Dim pTo As Integer = sValue.LastIndexOf(" P01")
|
||||||
@@ -828,12 +828,12 @@ Public Class BTLPartM
|
|||||||
End If
|
End If
|
||||||
|
|
||||||
EgtGetInfo(nPartId, BTL_PRT_PARTOFFSET, sValue)
|
EgtGetInfo(nPartId, BTL_PRT_PARTOFFSET, sValue)
|
||||||
sValArray = sValue.Split(New String() {":", "P"}, StringSplitOptions.RemoveEmptyEntries)
|
sValArray = sValue.Split(New String() {": ", " P"}, StringSplitOptions.RemoveEmptyEntries)
|
||||||
If sValArray.Count() >= 10 Then
|
If sValArray.Count() >= 5 Then
|
||||||
StringToLenAdv(sValArray(3), NewBTLPart.m_dPartOffsetSide1)
|
StringToLen(sValArray(3), NewBTLPart.m_dPartOffsetSide1)
|
||||||
StringToLenAdv(sValArray(5), NewBTLPart.m_dPartOffsetSide2)
|
StringToLen(sValArray(5), NewBTLPart.m_dPartOffsetSide2)
|
||||||
StringToLenAdv(sValArray(7), NewBTLPart.m_dPartOffsetSide3)
|
StringToLen(sValArray(7), NewBTLPart.m_dPartOffsetSide3)
|
||||||
StringToLenAdv(sValArray(9), NewBTLPart.m_dPartOffsetSide4)
|
StringToLen(sValArray(9), NewBTLPart.m_dPartOffsetSide4)
|
||||||
End If
|
End If
|
||||||
pFrom = sValue.IndexOf("P04: ") + "P04: ".Length
|
pFrom = sValue.IndexOf("P04: ") + "P04: ".Length
|
||||||
pTo = sValue.LastIndexOf(" P11")
|
pTo = sValue.LastIndexOf(" P11")
|
||||||
@@ -883,9 +883,9 @@ Public Class BTLPartM
|
|||||||
NewBTLPart.m_refGrainDir = New Vector3d
|
NewBTLPart.m_refGrainDir = New Vector3d
|
||||||
sValArray = sValue.Split(New String() {",", ";"}, StringSplitOptions.RemoveEmptyEntries)
|
sValArray = sValue.Split(New String() {",", ";"}, StringSplitOptions.RemoveEmptyEntries)
|
||||||
If sValArray.Count() >= 4 Then
|
If sValArray.Count() >= 4 Then
|
||||||
StringToDoubleAdv(sValArray(0), NewBTLPart.m_refGrainDir.x)
|
StringToDouble(sValArray(0), NewBTLPart.m_refGrainDir.x)
|
||||||
StringToDoubleAdv(sValArray(1), NewBTLPart.m_refGrainDir.y)
|
StringToDouble(sValArray(1), NewBTLPart.m_refGrainDir.y)
|
||||||
StringToDoubleAdv(sValArray(2), NewBTLPart.m_refGrainDir.z)
|
StringToDouble(sValArray(2), NewBTLPart.m_refGrainDir.z)
|
||||||
NewBTLPart.m_bGRAINDIRALIGN = (CInt(sValArray(3)) = 1)
|
NewBTLPart.m_bGRAINDIRALIGN = (CInt(sValArray(3)) = 1)
|
||||||
End If
|
End If
|
||||||
|
|
||||||
@@ -1044,15 +1044,15 @@ Public Class BTLPartM
|
|||||||
' Dim vtVersY As New Vector3d
|
' Dim vtVersY As New Vector3d
|
||||||
' sValArray = sValue.Split({","}, StringSplitOptions.RemoveEmptyEntries)
|
' sValArray = sValue.Split({","}, StringSplitOptions.RemoveEmptyEntries)
|
||||||
' If sValArray.Count() >= 9 Then
|
' If sValArray.Count() >= 9 Then
|
||||||
' StringToLenAdv(sValArray(0), ptOri.x)
|
' StringToLen(sValArray(0), ptOri.x)
|
||||||
' StringToLenAdv(sValArray(1), ptOri.y)
|
' StringToLen(sValArray(1), ptOri.y)
|
||||||
' StringToLenAdv(sValArray(2), ptOri.z)
|
' StringToLen(sValArray(2), ptOri.z)
|
||||||
' StringToDoubleAdv(sValArray(3), vtVersX.x)
|
' StringToDouble(sValArray(3), vtVersX.x)
|
||||||
' StringToDoubleAdv(sValArray(4), vtVersX.y)
|
' StringToDouble(sValArray(4), vtVersX.y)
|
||||||
' StringToDoubleAdv(sValArray(5), vtVersX.z)
|
' StringToDouble(sValArray(5), vtVersX.z)
|
||||||
' StringToDoubleAdv(sValArray(6), vtVersY.x)
|
' StringToDouble(sValArray(6), vtVersY.x)
|
||||||
' StringToDoubleAdv(sValArray(7), vtVersY.y)
|
' StringToDouble(sValArray(7), vtVersY.y)
|
||||||
' StringToDoubleAdv(sValArray(8), vtVersY.z)
|
' StringToDouble(sValArray(8), vtVersY.z)
|
||||||
' m_refTransf.ChangeOrigin(ptOri)
|
' m_refTransf.ChangeOrigin(ptOri)
|
||||||
' m_refTransf.Setup(ptOri, ptOri + vtVersX, ptOri + vtVersY)
|
' m_refTransf.Setup(ptOri, ptOri + vtVersX, ptOri + vtVersY)
|
||||||
' End If
|
' End If
|
||||||
@@ -1063,10 +1063,10 @@ Public Class BTLPartM
|
|||||||
' EgtGetInfo(nPartId, BTL_PRT_CAMBER, sValue)
|
' EgtGetInfo(nPartId, BTL_PRT_CAMBER, sValue)
|
||||||
' sValArray = sValue.Split(New String() {": ", " P"}, StringSplitOptions.RemoveEmptyEntries)
|
' sValArray = sValue.Split(New String() {": ", " P"}, StringSplitOptions.RemoveEmptyEntries)
|
||||||
' If sValArray.Count() >= 5 Then
|
' If sValArray.Count() >= 5 Then
|
||||||
' StringToLenAdv(sValArray(3), m_dCamberLen1)
|
' StringToLen(sValArray(3), m_dCamberLen1)
|
||||||
' StringToLenAdv(sValArray(5), m_dCamberLen2)
|
' StringToLen(sValArray(5), m_dCamberLen2)
|
||||||
' StringToLenAdv(sValArray(7), m_dCamberLen3)
|
' StringToLen(sValArray(7), m_dCamberLen3)
|
||||||
' StringToLenAdv(sValArray(9), m_dCamberCross3)
|
' StringToLen(sValArray(9), m_dCamberCross3)
|
||||||
' End If
|
' End If
|
||||||
' Dim pFrom As Integer = sValue.IndexOf("SIDE: ") + "SIDE: ".Length
|
' Dim pFrom As Integer = sValue.IndexOf("SIDE: ") + "SIDE: ".Length
|
||||||
' Dim pTo As Integer = sValue.LastIndexOf(" P01")
|
' Dim pTo As Integer = sValue.LastIndexOf(" P01")
|
||||||
@@ -1078,10 +1078,10 @@ Public Class BTLPartM
|
|||||||
' EgtGetInfo(nPartId, BTL_PRT_PARTOFFSET, sValue)
|
' EgtGetInfo(nPartId, BTL_PRT_PARTOFFSET, sValue)
|
||||||
' sValArray = sValue.Split(New String() {": ", " P"}, StringSplitOptions.RemoveEmptyEntries)
|
' sValArray = sValue.Split(New String() {": ", " P"}, StringSplitOptions.RemoveEmptyEntries)
|
||||||
' If sValArray.Count() >= 5 Then
|
' If sValArray.Count() >= 5 Then
|
||||||
' StringToLenAdv(sValArray(3), m_dPartOffsetSide1)
|
' StringToLen(sValArray(3), m_dPartOffsetSide1)
|
||||||
' StringToLenAdv(sValArray(5), m_dPartOffsetSide2)
|
' StringToLen(sValArray(5), m_dPartOffsetSide2)
|
||||||
' StringToLenAdv(sValArray(7), m_dPartOffsetSide3)
|
' StringToLen(sValArray(7), m_dPartOffsetSide3)
|
||||||
' StringToLenAdv(sValArray(9), m_dPartOffsetSide4)
|
' StringToLen(sValArray(9), m_dPartOffsetSide4)
|
||||||
' End If
|
' End If
|
||||||
' pFrom = sValue.IndexOf("P04: ") + "P04: ".Length
|
' pFrom = sValue.IndexOf("P04: ") + "P04: ".Length
|
||||||
' pTo = sValue.LastIndexOf(" P11")
|
' pTo = sValue.LastIndexOf(" P11")
|
||||||
@@ -1105,9 +1105,9 @@ Public Class BTLPartM
|
|||||||
' m_refGrainDir = New Vector3d
|
' m_refGrainDir = New Vector3d
|
||||||
' sValArray = sValue.Split(New String() {",", ";"}, StringSplitOptions.RemoveEmptyEntries)
|
' sValArray = sValue.Split(New String() {",", ";"}, StringSplitOptions.RemoveEmptyEntries)
|
||||||
' If sValArray.Count() >= 4 Then
|
' If sValArray.Count() >= 4 Then
|
||||||
' StringToDoubleAdv(sValArray(0), m_refGrainDir.x)
|
' StringToDouble(sValArray(0), m_refGrainDir.x)
|
||||||
' StringToDoubleAdv(sValArray(1), m_refGrainDir.y)
|
' StringToDouble(sValArray(1), m_refGrainDir.y)
|
||||||
' StringToDoubleAdv(sValArray(2), m_refGrainDir.z)
|
' StringToDouble(sValArray(2), m_refGrainDir.z)
|
||||||
' m_bGRAINDIRALIGN = (CInt(sValArray(3)) = 1)
|
' m_bGRAINDIRALIGN = (CInt(sValArray(3)) = 1)
|
||||||
' End If
|
' End If
|
||||||
|
|
||||||
@@ -1210,7 +1210,7 @@ Public Class BTLPartM
|
|||||||
Return New List(Of BTLFeatureM)(m_BTLFeatureMList)
|
Return New List(Of BTLFeatureM)(m_BTLFeatureMList)
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
Public Function Rotation(IsPositive As Boolean, SelectedMachineType As MachineType, Optional bRedraw As Boolean = True, Optional dAng As Double = 90) As Boolean
|
Public Function Rotation(IsPositive As Boolean, SelectedMachineType As MachineType, Optional dAng As Double = 90) As Boolean
|
||||||
' recupero il box del pezzo
|
' recupero il box del pezzo
|
||||||
Dim nLs As Integer = EgtGetFirstNameInGroup(nPartId, "Box")
|
Dim nLs As Integer = EgtGetFirstNameInGroup(nPartId, "Box")
|
||||||
Dim b3Solid As New BBox3d
|
Dim b3Solid As New BBox3d
|
||||||
@@ -1249,7 +1249,7 @@ Public Class BTLPartM
|
|||||||
' ripristino inversione
|
' ripristino inversione
|
||||||
Inversion(SelectedMachineType)
|
Inversion(SelectedMachineType)
|
||||||
End If
|
End If
|
||||||
If bRedraw Then EgtDraw()
|
EgtDraw()
|
||||||
Return bOk
|
Return bOk
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
|
|||||||
@@ -18,6 +18,35 @@ Public Class BTLStructureM
|
|||||||
End Get
|
End Get
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
|
Private m_nCompositesId As Integer = GDB_ID.NULL
|
||||||
|
Public ReadOnly Property nCompositesId As Integer
|
||||||
|
Get
|
||||||
|
Return m_nCompositesId
|
||||||
|
End Get
|
||||||
|
End Property
|
||||||
|
|
||||||
|
' composite di tipo Element da BTL
|
||||||
|
Public m_BTLElementMList As List(Of BTLElementM)
|
||||||
|
Public Property BTLElementMList As List(Of BTLElementM)
|
||||||
|
Get
|
||||||
|
Return m_BTLElementMList
|
||||||
|
End Get
|
||||||
|
Set(value As List(Of BTLElementM))
|
||||||
|
m_BTLElementMList = value
|
||||||
|
End Set
|
||||||
|
End Property
|
||||||
|
|
||||||
|
' composite di tipo Layer da BTL
|
||||||
|
Public m_BTLLayerMList As List(Of BTLLayerM)
|
||||||
|
Public Property BTLLayerMList As List(Of BTLLayerM)
|
||||||
|
Get
|
||||||
|
Return m_BTLLayerMList
|
||||||
|
End Get
|
||||||
|
Set(value As List(Of BTLLayerM))
|
||||||
|
m_BTLLayerMList = value
|
||||||
|
End Set
|
||||||
|
End Property
|
||||||
|
|
||||||
' pezzi da BTL
|
' pezzi da BTL
|
||||||
Public m_BTLPartMList As List(Of BTLPartM)
|
Public m_BTLPartMList As List(Of BTLPartM)
|
||||||
Public Property BTLPartMList As List(Of BTLPartM)
|
Public Property BTLPartMList As List(Of BTLPartM)
|
||||||
@@ -406,7 +435,35 @@ Public Class BTLStructureM
|
|||||||
Else
|
Else
|
||||||
NewBTLStructure.m_nAsseBaseId = EgtGetFirstNameInGroup(GDB_ID.ROOT, ASSEBASE)
|
NewBTLStructure.m_nAsseBaseId = EgtGetFirstNameInGroup(GDB_ID.ROOT, ASSEBASE)
|
||||||
NewBTLStructure.m_nBTLInfoId = EgtGetFirstNameInGroup(GDB_ID.ROOT, BTLINFO)
|
NewBTLStructure.m_nBTLInfoId = EgtGetFirstNameInGroup(GDB_ID.ROOT, BTLINFO)
|
||||||
|
NewBTLStructure.m_nCompositesId = EgtGetFirstNameInGroup(GDB_ID.ROOT, COMPOSITES)
|
||||||
End If
|
End If
|
||||||
|
' cerco tra i Composites se ci sono Element o Layer per vedere se è un progetto Pareti Layer
|
||||||
|
Dim nCompositesId As Integer = EgtGetFirstNameInGroup(GDB_ID.ROOT, COMPOSITES)
|
||||||
|
While nCompositesId <> GDB_ID.NULL
|
||||||
|
' verifico se il layer appartiene al ProjId
|
||||||
|
Dim nCompositesProjId As Integer
|
||||||
|
EgtGetInfo(nCompositesId, BTL_PRT_PROJ, nCompositesProjId)
|
||||||
|
If nCompositesProjId = ProjId Then
|
||||||
|
NewBTLStructure.m_nCompositesId = nCompositesProjId
|
||||||
|
Dim nCompositesSubNodeId As Integer = EgtGetFirstInGroup(nCompositesId)
|
||||||
|
' se Composites presente recupero i Composites di tipo Element e Layer
|
||||||
|
NewBTLStructure.m_BTLElementMList = LoadElements(nCompositesSubNodeId)
|
||||||
|
NewBTLStructure.m_BTLLayerMList = LoadLayers(nCompositesSubNodeId)
|
||||||
|
' aggiungo i Layer già caricati al BTLElement a seconda del GROUP
|
||||||
|
For Each BTLElementItem In NewBTLStructure.BTLElementMList
|
||||||
|
BTLElementItem.BTLLayerMList = New List(Of BTLLayerM)
|
||||||
|
For Each BTLLayerItem In NewBTLStructure.BTLLayerMList
|
||||||
|
If BTLLayerItem.sGROUP = BTLElementItem.sGROUP Then
|
||||||
|
' recupero i pezzi associati al Layer
|
||||||
|
BTLLayerItem.BTLPartMList = LoadLayerParts(BTLLayerItem.nPartId)
|
||||||
|
BTLElementItem.BTLLayerMList.Add(BTLLayerItem)
|
||||||
|
End If
|
||||||
|
Next
|
||||||
|
Next
|
||||||
|
Exit While
|
||||||
|
End If
|
||||||
|
nCompositesId = EgtGetNextName(nCompositesId, COMPOSITES)
|
||||||
|
End While
|
||||||
EgtGetInfo(NewBTLStructure.m_nBTLInfoId, BTL_GEN_PROJNUM, NewBTLStructure.m_sPROJNUM)
|
EgtGetInfo(NewBTLStructure.m_nBTLInfoId, BTL_GEN_PROJNUM, NewBTLStructure.m_sPROJNUM)
|
||||||
EgtGetInfo(NewBTLStructure.m_nBTLInfoId, BTL_GEN_PROJNAME, NewBTLStructure.m_sPROJNAME)
|
EgtGetInfo(NewBTLStructure.m_nBTLInfoId, BTL_GEN_PROJNAME, NewBTLStructure.m_sPROJNAME)
|
||||||
EgtGetInfo(NewBTLStructure.m_nBTLInfoId, BTL_GEN_PROJPART, NewBTLStructure.m_sPROJPART)
|
EgtGetInfo(NewBTLStructure.m_nBTLInfoId, BTL_GEN_PROJPART, NewBTLStructure.m_sPROJPART)
|
||||||
@@ -465,6 +522,56 @@ Public Class BTLStructureM
|
|||||||
Return TempList
|
Return TempList
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
|
Private Shared Function LoadLayerParts(nLayerId As Integer) As List(Of BTLPartM)
|
||||||
|
Dim TempList As New List(Of BTLPartM)
|
||||||
|
Dim nSubLayerId As Integer = EgtGetFirstInGroup(nLayerId)
|
||||||
|
' devo far passare i vari SubLayerId finchè non trovo quelli di UID.
|
||||||
|
' dentro questi devo trovare !SOU, il valore di questo è il PartId che ci interessa caricare
|
||||||
|
While nSubLayerId <> GDB_ID.NULL
|
||||||
|
Dim sSubLayerName As String = ""
|
||||||
|
Dim nPartId As Integer
|
||||||
|
EgtGetName(nSubLayerId, sSubLayerName)
|
||||||
|
If sSubLayerName.Length > 3 AndAlso sSubLayerName.Substring(0, 4) = "UID-" Then
|
||||||
|
EgtGetInfo(nSubLayerId, "!SOU", nPartId)
|
||||||
|
If nPartId <> GDB_ID.NULL Then
|
||||||
|
TempList.Add(BTLPartM.CreateBTLPart(nPartId))
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
nSubLayerId = EgtGetNext(nSubLayerId)
|
||||||
|
End While
|
||||||
|
Return TempList
|
||||||
|
End Function
|
||||||
|
|
||||||
|
Private Shared Function LoadElements(CompositesSubNodeId As Integer) As List(Of BTLElementM)
|
||||||
|
Dim TempList As New List(Of BTLElementM)
|
||||||
|
Dim nCompositesSubNodeId As Integer = CompositesSubNodeId
|
||||||
|
While nCompositesSubNodeId <> GDB_ID.NULL
|
||||||
|
Dim sCompositeType As String = ""
|
||||||
|
Dim nTest As Integer = 0
|
||||||
|
EgtGetInfo(nCompositesSubNodeId, BTL_PRT_TYPE, sCompositeType)
|
||||||
|
If sCompositeType = "ELEMENT" Then
|
||||||
|
TempList.Add(BTLElementM.CreateBTLElement(nCompositesSubNodeId))
|
||||||
|
End If
|
||||||
|
nCompositesSubNodeId = EgtGetNextGroup(nCompositesSubNodeId)
|
||||||
|
End While
|
||||||
|
Return TempList
|
||||||
|
End Function
|
||||||
|
|
||||||
|
Private Shared Function LoadLayers(CompositesSubNodeId As Integer) As List(Of BTLLayerM)
|
||||||
|
Dim TempList As New List(Of BTLLayerM)
|
||||||
|
Dim nCompositesSubNodeId As Integer = CompositesSubNodeId
|
||||||
|
While nCompositesSubNodeId <> GDB_ID.NULL
|
||||||
|
Dim sCompositeType As String = ""
|
||||||
|
Dim nTest As Integer = 0
|
||||||
|
EgtGetInfo(nCompositesSubNodeId, BTL_PRT_TYPE, sCompositeType)
|
||||||
|
If sCompositeType = "LAYER" Then
|
||||||
|
TempList.Add(BTLLayerM.CreateBTLLayer(nCompositesSubNodeId))
|
||||||
|
End If
|
||||||
|
nCompositesSubNodeId = EgtGetNextGroup(nCompositesSubNodeId)
|
||||||
|
End While
|
||||||
|
Return TempList
|
||||||
|
End Function
|
||||||
|
|
||||||
#End Region ' CONSTRUCTOR
|
#End Region ' CONSTRUCTOR
|
||||||
|
|
||||||
#Region "METHODS"
|
#Region "METHODS"
|
||||||
@@ -486,6 +593,22 @@ Public Class BTLStructureM
|
|||||||
'RaiseEvent BTLPartAdded(Me, New BTLPartAddedEventArgs(BTLPartM))
|
'RaiseEvent BTLPartAdded(Me, New BTLPartAddedEventArgs(BTLPartM))
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
|
Public Function GetBTLElements() As List(Of BTLElementM)
|
||||||
|
If Not IsNothing(m_BTLElementMList) Then
|
||||||
|
Return New List(Of BTLElementM)(m_BTLElementMList)
|
||||||
|
Else
|
||||||
|
Return Nothing
|
||||||
|
End If
|
||||||
|
End Function
|
||||||
|
|
||||||
|
Public Function GetBTLLayers() As List(Of BTLLayerM)
|
||||||
|
If Not IsNothing(m_BTLLayerMList) Then
|
||||||
|
Return New List(Of BTLLayerM)(m_BTLLayerMList)
|
||||||
|
Else
|
||||||
|
Return Nothing
|
||||||
|
End If
|
||||||
|
End Function
|
||||||
|
|
||||||
Public Function GetBTLParts() As List(Of BTLPartM)
|
Public Function GetBTLParts() As List(Of BTLPartM)
|
||||||
Return New List(Of BTLPartM)(m_BTLPartMList)
|
Return New List(Of BTLPartM)(m_BTLPartMList)
|
||||||
End Function
|
End Function
|
||||||
|
|||||||
@@ -14,8 +14,6 @@ Public Module CalcIntegration
|
|||||||
Public Event Calc_ProcessResult As EventHandler(Of CalcResultEventArgs)
|
Public Event Calc_ProcessResult As EventHandler(Of CalcResultEventArgs)
|
||||||
Public Event Calc_ProcessEnd As EventHandler(Of CalcProcessEndEventArgs)
|
Public Event Calc_ProcessEnd As EventHandler(Of CalcProcessEndEventArgs)
|
||||||
|
|
||||||
Private m_bIsSupervisor As Boolean = False
|
|
||||||
|
|
||||||
Public Enum CmdTypes As Integer
|
Public Enum CmdTypes As Integer
|
||||||
GENERATE = 0
|
GENERATE = 0
|
||||||
MODIFY = 1
|
MODIFY = 1
|
||||||
@@ -40,9 +38,8 @@ Public Module CalcIntegration
|
|||||||
|
|
||||||
Delegate Sub CallbackDlg(dProgress As Double, sProgress As String, ByRef bCancel As Boolean)
|
Delegate Sub CallbackDlg(dProgress As Double, sProgress As String, ByRef bCancel As Boolean)
|
||||||
|
|
||||||
Public Sub Run(vBar As Bar(), sProjDirPath As String, callback As CallbackDlg, Optional bIsSupervisor As Boolean = False)
|
Public Sub Run(vBar As Bar(), sProjDirPath As String, callback As CallbackDlg)
|
||||||
_thread = New Thread(Sub()
|
_thread = New Thread(Sub()
|
||||||
m_bIsSupervisor = bIsSupervisor
|
|
||||||
DoJob(vBar, sProjDirPath, callback)
|
DoJob(vBar, sProjDirPath, callback)
|
||||||
End Sub)
|
End Sub)
|
||||||
_thread.Start()
|
_thread.Start()
|
||||||
@@ -65,7 +62,7 @@ Public Module CalcIntegration
|
|||||||
End If
|
End If
|
||||||
ElseIf Bar.nProgramPage = ProjectType.PROD Then
|
ElseIf Bar.nProgramPage = ProjectType.PROD Then
|
||||||
If Bar.nGlobState = CalcStates.NOTCALCULATED Then
|
If Bar.nGlobState = CalcStates.NOTCALCULATED Then
|
||||||
Bar.sBarPath = CreateNewProjectFromMachGroup(Bar.nBarId, sProjDirPath, Bar.nGlobState)
|
Bar.sBarPath = CreateNewProjectFromMachGroup(Bar.nBarId, sProjDirPath)
|
||||||
Else
|
Else
|
||||||
Dim sMachGroupName As String = ""
|
Dim sMachGroupName As String = ""
|
||||||
EgtGetMachGroupName(Bar.nBarId, sMachGroupName)
|
EgtGetMachGroupName(Bar.nBarId, sMachGroupName)
|
||||||
@@ -78,7 +75,7 @@ Public Module CalcIntegration
|
|||||||
If Bar.nProgramPage = ProjectType.PROJ Then
|
If Bar.nProgramPage = ProjectType.PROJ Then
|
||||||
Bar.sBarPath = CreateNewProjectFromPart(Bar.nBarId, sProjDirPath)
|
Bar.sBarPath = CreateNewProjectFromPart(Bar.nBarId, sProjDirPath)
|
||||||
ElseIf Bar.nProgramPage = ProjectType.PROD Then
|
ElseIf Bar.nProgramPage = ProjectType.PROD Then
|
||||||
Bar.sBarPath = CreateNewProjectFromMachGroup(Bar.nBarId, sProjDirPath, Bar.nGlobState)
|
Bar.sBarPath = CreateNewProjectFromMachGroup(Bar.nBarId, sProjDirPath)
|
||||||
End If
|
End If
|
||||||
Next
|
Next
|
||||||
End If
|
End If
|
||||||
@@ -355,38 +352,27 @@ Public Module CalcIntegration
|
|||||||
Return If(bOk, sPartFilePath, String.Empty)
|
Return If(bOk, sPartFilePath, String.Empty)
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
Private Function CreateNewProjectFromMachGroup(nMachGroupId As Integer, sProjDirPath As String, nGlobState As Integer) As String
|
Private Function CreateNewProjectFromMachGroup(nMachGroupId As Integer, sProjDirPath As String) As String
|
||||||
' aggiorno cutid e taskid solo fuori dal supervisore o se pezzo ricalcolato
|
|
||||||
If Not m_bIsSupervisor OrElse nGlobState = CalcStates.NOTCALCULATED Then
|
' Aggiorno identificativi per segnalazione errori
|
||||||
Dim DisableMgr As DisableModifiedMgr = Nothing
|
Dim nOldMachGroup As Integer = EgtGetCurrMachGroup()
|
||||||
If m_bIsSupervisor Then
|
If nMachGroupId <> nOldMachGroup Then EgtSetCurrMachGroup(nMachGroupId)
|
||||||
' Disabilito segnalazione modificato
|
Dim nRawId As Integer = EgtGetFirstRawPart()
|
||||||
DisableMgr = New DisableModifiedMgr
|
While nRawId <> GDB_ID.NULL
|
||||||
|
If EgtVerifyRawPartPhase(nRawId, 1) Then
|
||||||
|
Dim nPartId As Integer = EgtGetFirstPartInRawPart(nRawId)
|
||||||
|
While nPartId <> GDB_ID.NULL
|
||||||
|
UpdateCutIdAndTaskId(nPartId)
|
||||||
|
nPartId = EgtGetNextPartInRawPart(nPartId)
|
||||||
|
End While
|
||||||
End If
|
End If
|
||||||
' Aggiorno identificativi per segnalazione errori
|
nRawId = EgtGetNextRawPart(nRawId)
|
||||||
Dim nOldMachGroup As Integer = EgtGetCurrMachGroup()
|
End While
|
||||||
If nMachGroupId <> nOldMachGroup Then EgtSetCurrMachGroup(nMachGroupId)
|
If nMachGroupId <> nOldMachGroup Then
|
||||||
Dim nRawId As Integer = EgtGetFirstRawPart()
|
If nOldMachGroup <> GDB_ID.NULL Then
|
||||||
While nRawId <> GDB_ID.NULL
|
EgtSetCurrMachGroup(nOldMachGroup)
|
||||||
If EgtVerifyRawPartPhase(nRawId, 1) Then
|
Else
|
||||||
Dim nPartId As Integer = EgtGetFirstPartInRawPart(nRawId)
|
EgtResetCurrMachGroup()
|
||||||
While nPartId <> GDB_ID.NULL
|
|
||||||
UpdateCutIdAndTaskId(nPartId)
|
|
||||||
nPartId = EgtGetNextPartInRawPart(nPartId)
|
|
||||||
End While
|
|
||||||
End If
|
|
||||||
nRawId = EgtGetNextRawPart(nRawId)
|
|
||||||
End While
|
|
||||||
If nMachGroupId <> nOldMachGroup Then
|
|
||||||
If nOldMachGroup <> GDB_ID.NULL Then
|
|
||||||
EgtSetCurrMachGroup(nOldMachGroup)
|
|
||||||
Else
|
|
||||||
EgtResetCurrMachGroup()
|
|
||||||
End If
|
|
||||||
End If
|
|
||||||
If m_bIsSupervisor Then
|
|
||||||
' Ripristino stato segnalazione modifica
|
|
||||||
DisableMgr.ReEnable()
|
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
|||||||
@@ -113,11 +113,18 @@
|
|||||||
PROD = 2
|
PROD = 2
|
||||||
End Enum
|
End Enum
|
||||||
|
|
||||||
' Tipo di progetto (Beam o Wall)
|
' Tipo di progetto (Beam o Wall)
|
||||||
Public Enum BWType As Integer
|
Public Enum BWType As Integer
|
||||||
NULL = 0
|
NULL = 0
|
||||||
BEAM = 1
|
BEAM = 1
|
||||||
WALL = 2
|
WALL = 2
|
||||||
|
End Enum
|
||||||
|
|
||||||
|
' Tipo di Composite (Element o Layer)
|
||||||
|
Public Enum CompositeType As Integer
|
||||||
|
NULL = 0
|
||||||
|
ELEMENT = 1
|
||||||
|
LAYER = 2
|
||||||
End Enum
|
End Enum
|
||||||
|
|
||||||
Public Const PROJ As String = "PROJ"
|
Public Const PROJ As String = "PROJ"
|
||||||
@@ -129,8 +136,13 @@
|
|||||||
' info parametri assemblato
|
' info parametri assemblato
|
||||||
Public Const BTL_ASSEBASE_N As String = "N"
|
Public Const BTL_ASSEBASE_N As String = "N"
|
||||||
|
|
||||||
|
Public Const COMPOSITES As String = "Composites"
|
||||||
|
Public Const ELEMENT As String = "Element"
|
||||||
|
Public Const LAYER As String = "Layer"
|
||||||
|
|
||||||
' info parametri BTL
|
' info parametri BTL
|
||||||
Public Const BTL_PRT_PROJ As String = "PROJ"
|
Public Const BTL_PRT_PROJ As String = "PROJ"
|
||||||
|
Public Const BTL_PRT_TYPE As String = "TYPE"
|
||||||
Public Const BTL_PRT_PDN As String = "PDN"
|
Public Const BTL_PRT_PDN As String = "PDN"
|
||||||
Public Const BTL_PRT_DO As String = "DO"
|
Public Const BTL_PRT_DO As String = "DO"
|
||||||
Public Const BTL_PRT_NAM As String = "NAM"
|
Public Const BTL_PRT_NAM As String = "NAM"
|
||||||
@@ -175,10 +187,8 @@
|
|||||||
Public Const BTL_PRT_REFSIDE = "REFERENCESIDE"
|
Public Const BTL_PRT_REFSIDE = "REFERENCESIDE"
|
||||||
Public Const BTL_PRT_ALIGNMENT = "ALIGNMENT"
|
Public Const BTL_PRT_ALIGNMENT = "ALIGNMENT"
|
||||||
Public Const BTL_PRT_MATERIALTYPE = "MATERIALTYPE"
|
Public Const BTL_PRT_MATERIALTYPE = "MATERIALTYPE"
|
||||||
Public Const BTL_PRT_DESCRIPTION = "NAM"
|
|
||||||
|
|
||||||
' parametri generici
|
' parametri generici
|
||||||
Public Const BTL_GEN_BTLPATH = "BTL"
|
|
||||||
Public Const BTL_GEN_PROJNUM = "PROJECTNUMBER"
|
Public Const BTL_GEN_PROJNUM = "PROJECTNUMBER"
|
||||||
Public Const BTL_GEN_PROJNAME = "PROJECTNAME"
|
Public Const BTL_GEN_PROJNAME = "PROJECTNAME"
|
||||||
Public Const BTL_GEN_PROJPART = "PROJECTPART"
|
Public Const BTL_GEN_PROJPART = "PROJECTPART"
|
||||||
@@ -206,7 +216,6 @@
|
|||||||
Public Const BTL_FTR_PRC As String = "PRC"
|
Public Const BTL_FTR_PRC As String = "PRC"
|
||||||
Public Const BTL_FTR_DO As String = "DO"
|
Public Const BTL_FTR_DO As String = "DO"
|
||||||
Public Const BTL_FTR_SIDE As String = "SIDE"
|
Public Const BTL_FTR_SIDE As String = "SIDE"
|
||||||
Public Const BTL_FTR_PRIORITY As String = "PRIORITY"
|
|
||||||
Public Const BTL_FTR_NAME As String = "NAME"
|
Public Const BTL_FTR_NAME As String = "NAME"
|
||||||
Public Const BTL_FTR_DES As String = "DES"
|
Public Const BTL_FTR_DES As String = "DES"
|
||||||
Public Const BTL_FTR_PRID As String = "PRID"
|
Public Const BTL_FTR_PRID As String = "PRID"
|
||||||
@@ -254,7 +263,6 @@
|
|||||||
Public Const MGR_RPT_PANELLEN As String = "PANELLEN"
|
Public Const MGR_RPT_PANELLEN As String = "PANELLEN"
|
||||||
Public Const MGR_RPT_PANELWIDTH As String = "PANELWIDTH"
|
Public Const MGR_RPT_PANELWIDTH As String = "PANELWIDTH"
|
||||||
Public Const MGR_RPT_PANELHEIGHT As String = "PANELHEIGHT"
|
Public Const MGR_RPT_PANELHEIGHT As String = "PANELHEIGHT"
|
||||||
Public Const MGR_RPT_PANELPOSZ As String = "PANELPOSZ"
|
|
||||||
Public Const MGR_RPT_PART As String = "PART"
|
Public Const MGR_RPT_PART As String = "PART"
|
||||||
|
|
||||||
' parametri P per comunicazione con la macchina
|
' parametri P per comunicazione con la macchina
|
||||||
@@ -302,10 +310,5 @@
|
|||||||
Public Const BTLFILENAME As String = "BTLFILENAME"
|
Public Const BTLFILENAME As String = "BTLFILENAME"
|
||||||
Public Const EXP_PART As String = "ImportExport"
|
Public Const EXP_PART As String = "ImportExport"
|
||||||
Public Const EXP_MACHINE As String = "Machine"
|
Public Const EXP_MACHINE As String = "Machine"
|
||||||
' parametro che indica se il progetto e' stato appena importato e quindi bisogna riverificare i MachGroup
|
|
||||||
Public Const IMP_VERIFYMACHGROUP As String = "VerifyMachGroup"
|
|
||||||
|
|
||||||
' parametri modifica percorsi free contour
|
|
||||||
Public Const PATH_SIDEANGLAYER As String = "SideAngLayer"
|
|
||||||
|
|
||||||
End Module
|
End Module
|
||||||
|
|||||||
@@ -6,22 +6,11 @@
|
|||||||
Public Const COL_STARTCUT As String = "colSTARTCUT"
|
Public Const COL_STARTCUT As String = "colSTARTCUT"
|
||||||
Public Const COL_W As String = "colW"
|
Public Const COL_W As String = "colW"
|
||||||
Public Const COL_L As String = "colL"
|
Public Const COL_L As String = "colL"
|
||||||
Public Const COL_POSZ As String = "colPOSZ"
|
|
||||||
Public Const COL_ROT As String = "colROT"
|
Public Const COL_ROT As String = "colROT"
|
||||||
Public Const COL_FLIP As String = "colFLIP"
|
Public Const COL_FLIP As String = "colFLIP"
|
||||||
Public Const COL_POSX As String = "colPOSX"
|
Public Const COL_POSX As String = "colPOSX"
|
||||||
Public Const COL_POSY As String = "colPOSY"
|
Public Const COL_POSY As String = "colPOSY"
|
||||||
Public Const COL_OFFSET As String = "colOFFSET"
|
Public Const COL_OFFSET As String = "colOFFSET"
|
||||||
Public Const COL_REDO As String = "colREDO"
|
Public Const COL_REDO As String = "colREDO"
|
||||||
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"
|
|
||||||
Public Const COL_NAME As String = "colNAME"
|
|
||||||
Public Const COL_H As String = "colH"
|
|
||||||
Public Const COL_MATERIAL As String = "colMATERIAL"
|
|
||||||
Public Const COL_USAGE As String = "colUSAGE"
|
|
||||||
Public Const COL_WASTE As String = "colWASTE"
|
|
||||||
Public Const COL_ARCHIVED As String = "colARCHIVED"
|
|
||||||
|
|
||||||
End Module
|
End Module
|
||||||
|
|||||||
@@ -5,7 +5,6 @@
|
|||||||
Public Const S_FEATURELIST As String = "DG_FeatureList"
|
Public Const S_FEATURELIST As String = "DG_FeatureList"
|
||||||
Public Const S_OPENPROJFILEDLG_PROJ As String = "DG_OpenProjectFileDialog_PROJ"
|
Public Const S_OPENPROJFILEDLG_PROJ As String = "DG_OpenProjectFileDialog_PROJ"
|
||||||
Public Const S_OPENPROJFILEDLG_PROD As String = "DG_OpenProjectFileDialog_PROD"
|
Public Const S_OPENPROJFILEDLG_PROD As String = "DG_OpenProjectFileDialog_PROD"
|
||||||
Public Const S_NEWOPENPROJFILEDLG_PROD As String = "DG_NewOpenProjectFileDialog_PROD"
|
|
||||||
Public Const S_RAWPARTLIST_BEAM As String = "DG_RawPartList_BEAM"
|
Public Const S_RAWPARTLIST_BEAM As String = "DG_RawPartList_BEAM"
|
||||||
Public Const S_RAWPARTLIST_WALL As String = "DG_RawPartList_WALL"
|
Public Const S_RAWPARTLIST_WALL As String = "DG_RawPartList_WALL"
|
||||||
Public Const S_PARTINRAWPARTLIST_BEAM As String = "DG_PartInRawPartList_BEAM"
|
Public Const S_PARTINRAWPARTLIST_BEAM As String = "DG_PartInRawPartList_BEAM"
|
||||||
@@ -28,7 +27,6 @@
|
|||||||
Public Const S_SECTXMATLIST_WALL As String = "DG_SectXMatList_WALL"
|
Public Const S_SECTXMATLIST_WALL As String = "DG_SectXMatList_WALL"
|
||||||
Public Const S_VARIABLESLIST As String = "DG_VariablesList"
|
Public Const S_VARIABLESLIST As String = "DG_VariablesList"
|
||||||
Public Const S_MDICOMMANDS As String = "DG_MDICommands"
|
Public Const S_MDICOMMANDS As String = "DG_MDICommands"
|
||||||
Public Const S_MACHINELOG As String = "DG_MachineLog"
|
|
||||||
Public Const S_UPDATEBTLPARTLIST As String = "DG_UpdateBTLPartList"
|
Public Const S_UPDATEBTLPARTLIST As String = "DG_UpdateBTLPartList"
|
||||||
|
|
||||||
Public Const K_LOCKTABLE As String = "LockTable"
|
Public Const K_LOCKTABLE As String = "LockTable"
|
||||||
|
|||||||
@@ -6,6 +6,7 @@
|
|||||||
Public Const PROJECT_OPTIMIZER As String = "Project_Optimizer"
|
Public Const PROJECT_OPTIMIZER As String = "Project_Optimizer"
|
||||||
Public Const LEFTPANEL_VIEW As String = "LeftPanel_View"
|
Public Const LEFTPANEL_VIEW As String = "LeftPanel_View"
|
||||||
Public Const LEFTPANEL_OPTIMIZER As String = "LeftPanel_Optimizer"
|
Public Const LEFTPANEL_OPTIMIZER As String = "LeftPanel_Optimizer"
|
||||||
|
Public Const LEFTPANEL_LAYERSWALL As String = "LeftPanel_LayersWall"
|
||||||
Public Const TOPPANEL_OPTIMIZER As String = "TopPanel_Optimizer"
|
Public Const TOPPANEL_OPTIMIZER As String = "TopPanel_Optimizer"
|
||||||
Public Const LEFTPANEL_SUPERVISOR As String = "LeftPanel_Supervisor"
|
Public Const LEFTPANEL_SUPERVISOR As String = "LeftPanel_Supervisor"
|
||||||
Public Const PROJECT_SUPERVISOR As String = "Project_Supervisor"
|
Public Const PROJECT_SUPERVISOR As String = "Project_Supervisor"
|
||||||
|
|||||||
@@ -21,7 +21,6 @@ Public Module ConstGen
|
|||||||
' File con dati di licenza
|
' File con dati di licenza
|
||||||
Public Const LIC_FILE_NAME As String = "EgtBEAMWALL.lic"
|
Public Const LIC_FILE_NAME As String = "EgtBEAMWALL.lic"
|
||||||
Public Const S_LICENCE As String = "Licence"
|
Public Const S_LICENCE As String = "Licence"
|
||||||
Public Const K_LOCKID As String = "LockId"
|
|
||||||
Public Const K_KEY As String = "Key"
|
Public Const K_KEY As String = "Key"
|
||||||
Public Const K_NESTKEY As String = "NestKey"
|
Public Const K_NESTKEY As String = "NestKey"
|
||||||
|
|
||||||
@@ -33,6 +32,7 @@ Public Module ConstGen
|
|||||||
CONFIG = 3
|
CONFIG = 3
|
||||||
INPUTS = 4
|
INPUTS = 4
|
||||||
OUTPUTS = 5
|
OUTPUTS = 5
|
||||||
|
LAYERSWALL = 6
|
||||||
End Enum
|
End Enum
|
||||||
|
|
||||||
' Abilitazioni licenza
|
' Abilitazioni licenza
|
||||||
@@ -42,7 +42,6 @@ Public Module ConstGen
|
|||||||
NESTING_AUTO = 4
|
NESTING_AUTO = 4
|
||||||
SUPERVISOR = 8
|
SUPERVISOR = 8
|
||||||
NETWORK = 16
|
NETWORK = 16
|
||||||
ANY_DB = 32
|
|
||||||
End Enum
|
End Enum
|
||||||
|
|
||||||
' File di log generale
|
' File di log generale
|
||||||
|
|||||||
@@ -20,7 +20,6 @@ Public Module ConstIni
|
|||||||
'Public Const K_LICENCE As String = "Licence"
|
'Public Const K_LICENCE As String = "Licence"
|
||||||
'Public Const K_USERLEVEL As String = "UserLevel"
|
'Public Const K_USERLEVEL As String = "UserLevel"
|
||||||
'Public Const K_MAXINST As String = "MaxInstances"
|
'Public Const K_MAXINST As String = "MaxInstances"
|
||||||
Public Const K_NETKEY As String = "NetKey"
|
|
||||||
Public Const K_MAXCAMINST As String = "MaxCamInstances"
|
Public Const K_MAXCAMINST As String = "MaxCamInstances"
|
||||||
Public Const K_VIEWOPTIM_INSTANCES As String = "ViewOptimInstances"
|
Public Const K_VIEWOPTIM_INSTANCES As String = "ViewOptimInstances"
|
||||||
Public Const K_SUPERVISOR_INSTANCES As String = "SupervisorInstances"
|
Public Const K_SUPERVISOR_INSTANCES As String = "SupervisorInstances"
|
||||||
@@ -28,8 +27,6 @@ Public Module ConstIni
|
|||||||
'Public Const K_MESSAGESDIR As String = "MessagesDir"
|
'Public Const K_MESSAGESDIR As String = "MessagesDir"
|
||||||
'Public Const K_MESSAGES As String = "Messages"
|
'Public Const K_MESSAGES As String = "Messages"
|
||||||
'Public Const K_WINPLACE As String = "WinPlace"
|
'Public Const K_WINPLACE As String = "WinPlace"
|
||||||
Public Const K_VIEWOPTIMWINPLACE As String = "ViewOptimWinPlace"
|
|
||||||
Public Const K_SUPERVISORWINPLACE As String = "SupervisorWinPlace"
|
|
||||||
'Public Const K_LASTPROJ As String = "LastProj"
|
'Public Const K_LASTPROJ As String = "LastProj"
|
||||||
'Public Const K_AUTOLOADLASTPROJ As String = "AutoLoadLastProj"
|
'Public Const K_AUTOLOADLASTPROJ As String = "AutoLoadLastProj"
|
||||||
Public Const K_LASTIMPDIR As String = "LastImpDir"
|
Public Const K_LASTIMPDIR As String = "LastImpDir"
|
||||||
@@ -38,15 +35,11 @@ Public Module ConstIni
|
|||||||
Public Const K_PROJSINDEX As String = "ProjsIndex"
|
Public Const K_PROJSINDEX As String = "ProjsIndex"
|
||||||
Public Const K_PRODSINDEX As String = "ProdsIndex"
|
Public Const K_PRODSINDEX As String = "ProdsIndex"
|
||||||
'Public Const K_SUPPORT As String = "Support"
|
'Public Const K_SUPPORT As String = "Support"
|
||||||
|
Public Const K_WAREHOUSE As String = "Warehouse"
|
||||||
Public Const K_DBADDRESS As String = "DbAddress"
|
Public Const K_DBADDRESS As String = "DbAddress"
|
||||||
Public Const K_DBMASTERKEY As String = "DbMasterKey"
|
Public Const K_DBMASTERKEY As String = "DbMasterKey"
|
||||||
Public Const K_SHAREDFOLDER As String = "SharedFolder"
|
|
||||||
Public Const K_UPDATEBTL As String = "UpdateBtl"
|
Public Const K_UPDATEBTL As String = "UpdateBtl"
|
||||||
Public Const K_DATADIR As String = "DataDir"
|
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 K_PROJECTMODE As String = "ProjectMode"
|
|
||||||
|
|
||||||
'Public Const S_LANGUAGES As String = "Languages"
|
'Public Const S_LANGUAGES As String = "Languages"
|
||||||
'Public Const K_LANGUAGE As String = "Language"
|
'Public Const K_LANGUAGE As String = "Language"
|
||||||
@@ -97,7 +90,6 @@ Public Module ConstIni
|
|||||||
Public Const S_IMPORT As String = "Import"
|
Public Const S_IMPORT As String = "Import"
|
||||||
Public Const K_BTLFLAG As String = "BtlFlag"
|
Public Const K_BTLFLAG As String = "BtlFlag"
|
||||||
Public Const K_WALLBTLFLAG As String = "WallBtlFlag"
|
Public Const K_WALLBTLFLAG As String = "WallBtlFlag"
|
||||||
Public Const K_WALLOPPOSITESIDENESTING As String = "WallOppositeSideNesting"
|
|
||||||
|
|
||||||
'Public Const S_MACH As String = "Mach"
|
'Public Const S_MACH As String = "Mach"
|
||||||
'Public Const K_MACHINESDIR As String = "MachinesDir"
|
'Public Const K_MACHINESDIR As String = "MachinesDir"
|
||||||
@@ -105,8 +97,6 @@ Public Module ConstIni
|
|||||||
'Public Const K_CURRMACH As String = "CurrMach"
|
'Public Const K_CURRMACH As String = "CurrMach"
|
||||||
Public Const K_SUPERVISORMACH As String = "SupervisorMach"
|
Public Const K_SUPERVISORMACH As String = "SupervisorMach"
|
||||||
Public Const K_PASSWORD As String = "Password"
|
Public Const K_PASSWORD As String = "Password"
|
||||||
Public Const K_CHANGEMACH As String = "ChangeMach"
|
|
||||||
Public Const K_EXPORTBWE As String = "ExpBwe"
|
|
||||||
|
|
||||||
'Public Const S_SIMUL As String = "Simul"
|
'Public Const S_SIMUL As String = "Simul"
|
||||||
'Public Const K_SLIDERX As String = "SliderX"
|
'Public Const K_SLIDERX As String = "SliderX"
|
||||||
@@ -121,16 +111,6 @@ Public Module ConstIni
|
|||||||
Public Const K_WALLBASEDIR As String = "BaseDir"
|
Public Const K_WALLBASEDIR As String = "BaseDir"
|
||||||
Public Const K_WALLBWEEXEC As String = "BweExec"
|
Public Const K_WALLBWEEXEC As String = "BweExec"
|
||||||
|
|
||||||
Public Const S_MACHINELOGFILTER As String = "MachineLogFilters"
|
|
||||||
Public Const K_PARTEVENTTYPE As String = "PartEventType"
|
|
||||||
Public Const K_ENTITYTYPE As String = "EntityType"
|
|
||||||
Public Const K_DAYTYPE As String = "DayType"
|
|
||||||
Public Const K_STARTDATE As String = "StartDate"
|
|
||||||
Public Const K_ENDDATE As String = "EndDate"
|
|
||||||
|
|
||||||
Public Const S_OPENFILEDIALOG As String = "OpenFileDialog"
|
|
||||||
Public Const K_VIEWARCHIVED As String = "ViewArchived"
|
|
||||||
|
|
||||||
'Public Const S_NEST As String = "Nest"
|
'Public Const S_NEST As String = "Nest"
|
||||||
Public Const K_NESTEXEC As String = "NestExec"
|
Public Const K_NESTEXEC As String = "NestExec"
|
||||||
Public Const K_FLIPROT As String = "FlipRot"
|
Public Const K_FLIPROT As String = "FlipRot"
|
||||||
@@ -159,13 +139,4 @@ Public Module ConstIni
|
|||||||
Public Const S_BEAM_LIST As String = "Beam_List"
|
Public Const S_BEAM_LIST As String = "Beam_List"
|
||||||
Public Const S_WALL_LIST As String = "Wall_List"
|
Public Const S_WALL_LIST As String = "Wall_List"
|
||||||
|
|
||||||
Public Const S_WAREHOUSE As String = "Warehouse"
|
|
||||||
Public Const K_TYPE As String = "Type"
|
|
||||||
Public Const K_DEFAULTQUANTITY As String = "DefaultQuantity"
|
|
||||||
|
|
||||||
Public Const S_BACKUPANDRESTORE As String = "Backup&Restore"
|
|
||||||
Public Const K_EXTERNALBACKUPACTIVE As String = "ExternalBackupActive"
|
|
||||||
Public Const K_EXTERNALFILEPATH As String = "ExternalFilePath"
|
|
||||||
Public Const K_REMINDERFREQUENCY As String = "ReminderFrequency"
|
|
||||||
|
|
||||||
End Module
|
End Module
|
||||||
|
|||||||
@@ -1,12 +1,9 @@
|
|||||||
Public Module ConstMachIni
|
Public Module ConstMachIni
|
||||||
|
|
||||||
Public Const MACH_INI_FILE_NAME As String = "MachData.ini"
|
Public Const MACH_INI_FILE_NAME As String = "MachData.ini"
|
||||||
Public Const GETBEAMDATA_FILE_NAME As String = "GetBeamData.lua"
|
|
||||||
Public Const GETWALLDATA_FILE_NAME As String = "GetWallData.lua"
|
Public Const GETWALLDATA_FILE_NAME As String = "GetWallData.lua"
|
||||||
Public Const GETTS3DATA_FILE_NAME As String = "GetTs3Data.lua"
|
|
||||||
|
|
||||||
Public Const K_NCTYPE As String = "NCType"
|
Public Const K_NCTYPE As String = "NCType"
|
||||||
Public Const K_CONNECTIONSTRING As String = "ConnectionString"
|
|
||||||
|
|
||||||
Public Const S_CHANNELS As String = "Channels"
|
Public Const S_CHANNELS As String = "Channels"
|
||||||
|
|
||||||
|
|||||||
@@ -47,11 +47,13 @@
|
|||||||
<OptionInfer>On</OptionInfer>
|
<OptionInfer>On</OptionInfer>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Reference Include="EgtUILib">
|
<Reference Include="EgtUILib, Version=2.3.7.1, Culture=neutral, processorArchitecture=MSIL">
|
||||||
<HintPath>..\ExtLibs\EgtUILib.dll</HintPath>
|
<SpecificVersion>False</SpecificVersion>
|
||||||
|
<HintPath>..\..\..\..\..\..\EgtProg\Dll32\EgtUILib.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="EgtWPFLib5">
|
<Reference Include="EgtWPFLib5, Version=2.3.4.3, Culture=neutral, processorArchitecture=MSIL">
|
||||||
<HintPath>..\ExtLibs\EgtWPFLib5.dll</HintPath>
|
<SpecificVersion>False</SpecificVersion>
|
||||||
|
<HintPath>..\..\..\..\..\..\EgtProg\Dll32\EgtWPFLib5.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="PresentationCore" />
|
<Reference Include="PresentationCore" />
|
||||||
<Reference Include="PresentationFramework" />
|
<Reference Include="PresentationFramework" />
|
||||||
@@ -77,6 +79,8 @@
|
|||||||
<Import Include="System.Xml.Linq" />
|
<Import Include="System.Xml.Linq" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
<Compile Include="BTLModel\BTLLayerM.vb" />
|
||||||
|
<Compile Include="BTLModel\BTLElementM.vb" />
|
||||||
<Compile Include="BTLViewModel\BTLFeatureVM.vb" />
|
<Compile Include="BTLViewModel\BTLFeatureVM.vb" />
|
||||||
<Compile Include="CALCPanel\CalcEditEndEventArgs.vb" />
|
<Compile Include="CALCPanel\CalcEditEndEventArgs.vb" />
|
||||||
<Compile Include="Constants\ConstColumns.vb" />
|
<Compile Include="Constants\ConstColumns.vb" />
|
||||||
@@ -112,10 +116,6 @@
|
|||||||
<DependentUpon>LoadingWndV.xaml</DependentUpon>
|
<DependentUpon>LoadingWndV.xaml</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
<Compile Include="LoadingWnd\LoadingWndVM.vb" />
|
<Compile Include="LoadingWnd\LoadingWndVM.vb" />
|
||||||
<Compile Include="NewOpenProjectFileDialog\NewOpenProjectFileDialogV.xaml.vb">
|
|
||||||
<DependentUpon>NewOpenProjectFileDialogV.xaml</DependentUpon>
|
|
||||||
</Compile>
|
|
||||||
<Compile Include="NewOpenProjectFileDialog\NewOpenProjectFileDialogVM.vb" />
|
|
||||||
<Compile Include="Utility\DimensionsIniFile.vb" />
|
<Compile Include="Utility\DimensionsIniFile.vb" />
|
||||||
<Compile Include="Utility\Enum.vb" />
|
<Compile Include="Utility\Enum.vb" />
|
||||||
<Compile Include="MachGroupPanel\MyMachGroupPanelVM.vb" />
|
<Compile Include="MachGroupPanel\MyMachGroupPanelVM.vb" />
|
||||||
@@ -194,10 +194,6 @@
|
|||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
<Generator>XamlIntelliSenseFileGenerator</Generator>
|
<Generator>XamlIntelliSenseFileGenerator</Generator>
|
||||||
</Page>
|
</Page>
|
||||||
<Page Include="NewOpenProjectFileDialog\NewOpenProjectFileDialogV.xaml">
|
|
||||||
<Generator>MSBuild:Compile</Generator>
|
|
||||||
<SubType>Designer</SubType>
|
|
||||||
</Page>
|
|
||||||
<Page Include="OpenProjectFileDialog\OpenProjectFileDialogV.xaml">
|
<Page Include="OpenProjectFileDialog\OpenProjectFileDialogV.xaml">
|
||||||
<Generator>MSBuild:Compile</Generator>
|
<Generator>MSBuild:Compile</Generator>
|
||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ Public Module DataGridColumnsIniFile
|
|||||||
Dim bIsReadOnly As Boolean = sColumnParams(4).Equals("1")
|
Dim bIsReadOnly As Boolean = sColumnParams(4).Equals("1")
|
||||||
Dim Width As Double
|
Dim Width As Double
|
||||||
Dim WidthType As DataGridLengthUnitType
|
Dim WidthType As DataGridLengthUnitType
|
||||||
StringToDoubleAdv(sColumnParams(5), Width)
|
StringToDouble(sColumnParams(5), Width)
|
||||||
Integer.TryParse(sColumnParams(6), WidthType)
|
Integer.TryParse(sColumnParams(6), WidthType)
|
||||||
Dim bVisible As Boolean = sColumnParams(7).Equals("1")
|
Dim bVisible As Boolean = sColumnParams(7).Equals("1")
|
||||||
Dim bCanUserEditVisible As Boolean = sColumnParams(8).Equals("1")
|
Dim bCanUserEditVisible As Boolean = sColumnParams(8).Equals("1")
|
||||||
@@ -65,7 +65,7 @@ Public Module DataGridColumnsIniFile
|
|||||||
Dim bIsReadOnly As Boolean = sColumnParams(4).Equals("1")
|
Dim bIsReadOnly As Boolean = sColumnParams(4).Equals("1")
|
||||||
Dim Width As Double
|
Dim Width As Double
|
||||||
Dim WidthType As DataGridLengthUnitType
|
Dim WidthType As DataGridLengthUnitType
|
||||||
StringToDoubleAdv(sColumnParams(5), Width)
|
StringToDouble(sColumnParams(5), Width)
|
||||||
Integer.TryParse(sColumnParams(6), WidthType)
|
Integer.TryParse(sColumnParams(6), WidthType)
|
||||||
Dim bVisible As Boolean = sColumnParams(7).Equals("1")
|
Dim bVisible As Boolean = sColumnParams(7).Equals("1")
|
||||||
Dim bCanUserEditVisible As Boolean = sColumnParams(8).Equals("1")
|
Dim bCanUserEditVisible As Boolean = sColumnParams(8).Equals("1")
|
||||||
|
|||||||
@@ -12,8 +12,6 @@ Imports EgtWPFLib5
|
|||||||
|
|
||||||
Public Class EgtDataGrid
|
Public Class EgtDataGrid
|
||||||
|
|
||||||
Public Event ResetSort()
|
|
||||||
|
|
||||||
' vecchio indice da salvare per il Reorder delle colonne
|
' vecchio indice da salvare per il Reorder delle colonne
|
||||||
Public OldIndex As Integer = 0
|
Public OldIndex As Integer = 0
|
||||||
' indice header su cui è aperto il ContextMenu per gestione check/uncheck LockTable
|
' indice header su cui è aperto il ContextMenu per gestione check/uncheck LockTable
|
||||||
@@ -363,7 +361,6 @@ Public Class EgtDataGrid
|
|||||||
' resetto graficamente anche l'header della colonna
|
' resetto graficamente anche l'header della colonna
|
||||||
CurrDataGrid.Columns(column.DisplayIndex).SortDirection = Nothing
|
CurrDataGrid.Columns(column.DisplayIndex).SortDirection = Nothing
|
||||||
Next
|
Next
|
||||||
RaiseEvent ResetSort()
|
|
||||||
End If
|
End If
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
@@ -427,7 +424,6 @@ Public Class EgtDataGridColumn
|
|||||||
End Set
|
End Set
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
Private Property m_OrigIsReadOnly As Boolean = True
|
|
||||||
Private Property m_IsReadOnly As Boolean = True
|
Private Property m_IsReadOnly As Boolean = True
|
||||||
Public Property IsReadOnly As Boolean
|
Public Property IsReadOnly As Boolean
|
||||||
Get
|
Get
|
||||||
@@ -441,9 +437,6 @@ Public Class EgtDataGridColumn
|
|||||||
End If
|
End If
|
||||||
End Set
|
End Set
|
||||||
End Property
|
End Property
|
||||||
Public Sub ResetToOrigIsReadOnly()
|
|
||||||
IsReadOnly = m_OrigIsReadOnly
|
|
||||||
End Sub
|
|
||||||
|
|
||||||
Friend OldCanUserReorder As Boolean?
|
Friend OldCanUserReorder As Boolean?
|
||||||
Private m_CanUserReorder As Boolean
|
Private m_CanUserReorder As Boolean
|
||||||
@@ -568,7 +561,6 @@ Public Class EgtDataGridColumn
|
|||||||
m_CanUserReorder = bCanUserReorder
|
m_CanUserReorder = bCanUserReorder
|
||||||
m_CanUserResize = bCanUserResize
|
m_CanUserResize = bCanUserResize
|
||||||
m_CanUserSort = bCanUserSort
|
m_CanUserSort = bCanUserSort
|
||||||
m_OrigIsReadOnly = bIsReadOnly
|
|
||||||
m_IsReadOnly = bIsReadOnly
|
m_IsReadOnly = bIsReadOnly
|
||||||
m_Width = Width
|
m_Width = Width
|
||||||
m_Visible = bVisible
|
m_Visible = bVisible
|
||||||
@@ -596,7 +588,7 @@ Public Class EgtDataGridColumn
|
|||||||
Public Function SaveDataGridColumn() As Boolean
|
Public Function SaveDataGridColumn() As Boolean
|
||||||
Dim bOk As Boolean
|
Dim bOk As Boolean
|
||||||
Dim sColumnParams = String.Empty
|
Dim sColumnParams = String.Empty
|
||||||
sColumnParams = Name & "," & If(CanUserReorder, 1, 0) & "," & If(CanUserResize, 1, 0) & "," & If(CanUserSort, 1, 0) & "," & If(m_OrigIsReadOnly, 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(IsReadOnly, 1, 0) & "," & DoubleToString(Width.Value, 6) & "," & Width.UnitType & "," & If(Visible, 1, 0) & "," & If(CanUserEditVisible, 1, 0) & "," & CInt(SortDirection)
|
||||||
bOk = WriteColumnPrivateProfileParam(ParentDataGridName, DisplayIndex, sColumnParams)
|
bOk = WriteColumnPrivateProfileParam(ParentDataGridName, DisplayIndex, sColumnParams)
|
||||||
Return bOk
|
Return bOk
|
||||||
End Function
|
End Function
|
||||||
|
|||||||
@@ -94,6 +94,8 @@ Public Class NewMachGroupPanelVM
|
|||||||
AddHandler m_MachGroupPanelM.MachGroupAdded, AddressOf OnMachGroupAdded
|
AddHandler m_MachGroupPanelM.MachGroupAdded, AddressOf OnMachGroupAdded
|
||||||
If Not MachGroupPanelM.IsMultiMachGroup Then SetMachGroupPanelVisibility(False)
|
If Not MachGroupPanelM.IsMultiMachGroup Then SetMachGroupPanelVisibility(False)
|
||||||
CreateMachGroupVMList()
|
CreateMachGroupVMList()
|
||||||
|
' Creo riferimento a questa classe in LibMap
|
||||||
|
'''LibMap.SetRefMachGroupPanelVM(Me)
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
#End Region ' CONSTRUCTOR
|
#End Region ' CONSTRUCTOR
|
||||||
|
|||||||
@@ -16,19 +16,17 @@ Public Module LoadingWndHelper
|
|||||||
CHANGEPARAM = 10
|
CHANGEPARAM = 10
|
||||||
CREATINGPDF = 11
|
CREATINGPDF = 11
|
||||||
CHANGEMATERIAL = 12
|
CHANGEMATERIAL = 12
|
||||||
BACKUP = 13
|
|
||||||
RESTORE = 14
|
|
||||||
End Enum
|
End Enum
|
||||||
|
|
||||||
Dim m_MainWindow As Windows.Window
|
Dim m_MainWindow As Windows.Window
|
||||||
Public Sub SetMainWindow(MainWindow As Windows.Window)
|
Public Function SetMainWindow(MainWindow As Windows.Window)
|
||||||
m_MainWindow = MainWindow
|
m_MainWindow = MainWindow
|
||||||
End Sub
|
End Function
|
||||||
|
|
||||||
Private m_bMainWindow_IsActive As Boolean = True
|
Private m_bMainWindow_IsActive As Boolean = True
|
||||||
Public Sub SetMainWindowIsActive(IsActive As Boolean)
|
Public Function SetMainWindowIsActive(IsActive As Boolean)
|
||||||
m_bMainWindow_IsActive = IsActive
|
m_bMainWindow_IsActive = IsActive
|
||||||
End Sub
|
End Function
|
||||||
|
|
||||||
Delegate Sub CallbackLoadingDlg(ByRef CurrStep As Integer, ByRef StepText As String, ByRef nProgress As Integer, ByRef nNextProgress As Integer, ByRef MainWindow_IsActive As Boolean, ByRef bClose As Boolean)
|
Delegate Sub CallbackLoadingDlg(ByRef CurrStep As Integer, ByRef StepText As String, ByRef nProgress As Integer, ByRef nNextProgress As Integer, ByRef MainWindow_IsActive As Boolean, ByRef bClose As Boolean)
|
||||||
|
|
||||||
@@ -54,7 +52,7 @@ Public Module LoadingWndHelper
|
|||||||
Dim Left As Double = m_MainWindow.Left + (m_MainWindow.Width / 2) - 150
|
Dim Left As Double = m_MainWindow.Left + (m_MainWindow.Width / 2) - 150
|
||||||
Dim WindowStartupLocation As Windows.WindowStartupLocation = Windows.WindowStartupLocation.Manual
|
Dim WindowStartupLocation As Windows.WindowStartupLocation = Windows.WindowStartupLocation.Manual
|
||||||
If m_MainWindow.WindowState = Windows.WindowState.Maximized Then
|
If m_MainWindow.WindowState = Windows.WindowState.Maximized Then
|
||||||
WindowStartupLocation = Windows.WindowStartupLocation.CenterOwner
|
WindowStartupLocation = Windows.WindowStartupLocation.CenterScreen
|
||||||
End If
|
End If
|
||||||
m_thread = New Thread(Sub()
|
m_thread = New Thread(Sub()
|
||||||
m_LoadingWndVM = New Core.LoadingWndVM(nSteps, TotText, AddressOf LoadingCallback)
|
m_LoadingWndVM = New Core.LoadingWndVM(nSteps, TotText, AddressOf LoadingCallback)
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
Imports System.Windows
|
Imports System.Windows
|
||||||
Imports System.Windows.Input
|
|
||||||
|
|
||||||
Public Class LoadingWndV
|
Public Class LoadingWndV
|
||||||
|
|
||||||
@@ -26,11 +25,4 @@ Public Class LoadingWndV
|
|||||||
m_LoadingWndVM.StartFunction()
|
m_LoadingWndVM.StartFunction()
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Sub ToolsDbView_Closing(sender As Object, e As ComponentModel.CancelEventArgs) Handles Me.Closing
|
|
||||||
If (Keyboard.Modifiers And ModifierKeys.Alt) = ModifierKeys.Alt OrElse Keyboard.IsKeyDown(Key.F4) Then
|
|
||||||
e.Cancel = True
|
|
||||||
Return
|
|
||||||
End If
|
|
||||||
End Sub
|
|
||||||
|
|
||||||
End Class
|
End Class
|
||||||
|
|||||||
@@ -149,16 +149,6 @@ Public Class MyMachGroupM
|
|||||||
End Get
|
End Get
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
Protected m_dPosZ As Double = 0
|
|
||||||
Public Property dPosZ As Double
|
|
||||||
Get
|
|
||||||
Return m_dPosZ
|
|
||||||
End Get
|
|
||||||
Set(value As Double)
|
|
||||||
m_dPosZ = value
|
|
||||||
End Set
|
|
||||||
End Property
|
|
||||||
|
|
||||||
#End Region ' Wall
|
#End Region ' Wall
|
||||||
|
|
||||||
#Region "Calc"
|
#Region "Calc"
|
||||||
@@ -310,18 +300,17 @@ Public Class MyMachGroupM
|
|||||||
EgtGetInfo(NewMachGroupM.m_Id, MGR_RPT_BARLEN, NewMachGroupM.m_dL)
|
EgtGetInfo(NewMachGroupM.m_Id, MGR_RPT_BARLEN, NewMachGroupM.m_dL)
|
||||||
EgtGetInfo(NewMachGroupM.m_Id, MGR_RPT_BARHEIGHT, NewMachGroupM.m_dH)
|
EgtGetInfo(NewMachGroupM.m_Id, MGR_RPT_BARHEIGHT, NewMachGroupM.m_dH)
|
||||||
EgtGetInfo(NewMachGroupM.m_Id, MGR_RPT_BARWIDTH, NewMachGroupM.m_dW)
|
EgtGetInfo(NewMachGroupM.m_Id, MGR_RPT_BARWIDTH, NewMachGroupM.m_dW)
|
||||||
|
NewMachGroupM.m_dTotMat = NewMachGroupM.m_dL * NewMachGroupM.m_dW * NewMachGroupM.m_dH
|
||||||
NewMachGroupM.m_PartMList = LoadParts(NewMachGroupM)
|
NewMachGroupM.m_PartMList = LoadParts(NewMachGroupM)
|
||||||
For Each Part In NewMachGroupM.m_PartMList
|
For Each Part In NewMachGroupM.m_PartMList
|
||||||
Part.UpdateOffset()
|
Part.UpdateOffset()
|
||||||
NewMachGroupM.m_dTotMat += Part.dL + Part.dOffset
|
NewMachGroupM.m_dMatForPart += Part.dVolume
|
||||||
NewMachGroupM.m_dMatForPart += Part.dL
|
|
||||||
Next
|
Next
|
||||||
Else
|
Else
|
||||||
NewMachGroupM.m_nRawPartId = EgtGetFirstRawPart()
|
NewMachGroupM.m_nRawPartId = EgtGetFirstRawPart()
|
||||||
EgtGetInfo(NewMachGroupM.m_Id, MGR_RPT_PANELLEN, NewMachGroupM.m_dL)
|
EgtGetInfo(NewMachGroupM.m_Id, MGR_RPT_PANELLEN, NewMachGroupM.m_dL)
|
||||||
EgtGetInfo(NewMachGroupM.m_Id, MGR_RPT_PANELWIDTH, NewMachGroupM.m_dW)
|
EgtGetInfo(NewMachGroupM.m_Id, MGR_RPT_PANELWIDTH, NewMachGroupM.m_dW)
|
||||||
EgtGetInfo(NewMachGroupM.m_Id, MGR_RPT_PANELHEIGHT, NewMachGroupM.m_dH)
|
EgtGetInfo(NewMachGroupM.m_Id, MGR_RPT_PANELHEIGHT, NewMachGroupM.m_dH)
|
||||||
EgtGetInfo(NewMachGroupM.m_Id, MGR_RPT_PANELPOSZ, NewMachGroupM.m_dPosZ)
|
|
||||||
NewMachGroupM.m_dTotMat = NewMachGroupM.m_dL * NewMachGroupM.m_dW * NewMachGroupM.m_dH
|
NewMachGroupM.m_dTotMat = NewMachGroupM.m_dL * NewMachGroupM.m_dW * NewMachGroupM.m_dH
|
||||||
NewMachGroupM.m_PartMList = LoadParts(NewMachGroupM)
|
NewMachGroupM.m_PartMList = LoadParts(NewMachGroupM)
|
||||||
For Each Part In NewMachGroupM.m_PartMList
|
For Each Part In NewMachGroupM.m_PartMList
|
||||||
@@ -347,14 +336,13 @@ Public Class MyMachGroupM
|
|||||||
NewMachGroupM.m_PartMList = LoadParts(NewMachGroupM)
|
NewMachGroupM.m_PartMList = LoadParts(NewMachGroupM)
|
||||||
For Each Part In NewMachGroupM.m_PartMList
|
For Each Part In NewMachGroupM.m_PartMList
|
||||||
Part.UpdateOffset()
|
Part.UpdateOffset()
|
||||||
NewMachGroupM.m_dMatForPart += Part.dL + Part.dOffset
|
NewMachGroupM.m_dMatForPart += Part.dVolume
|
||||||
Next
|
Next
|
||||||
Else
|
Else
|
||||||
NewMachGroupM.m_nRawPartId = EgtGetFirstRawPart()
|
NewMachGroupM.m_nRawPartId = EgtGetFirstRawPart()
|
||||||
EgtGetInfo(NewMachGroupM.m_Id, MGR_RPT_PANELLEN, NewMachGroupM.m_dL)
|
EgtGetInfo(NewMachGroupM.m_Id, MGR_RPT_PANELLEN, NewMachGroupM.m_dL)
|
||||||
EgtGetInfo(NewMachGroupM.m_Id, MGR_RPT_PANELWIDTH, NewMachGroupM.m_dW)
|
EgtGetInfo(NewMachGroupM.m_Id, MGR_RPT_PANELWIDTH, NewMachGroupM.m_dW)
|
||||||
EgtGetInfo(NewMachGroupM.m_Id, MGR_RPT_PANELHEIGHT, NewMachGroupM.m_dH)
|
EgtGetInfo(NewMachGroupM.m_Id, MGR_RPT_PANELHEIGHT, NewMachGroupM.m_dH)
|
||||||
EgtGetInfo(NewMachGroupM.m_Id, MGR_RPT_PANELPOSZ, NewMachGroupM.m_dPosZ)
|
|
||||||
NewMachGroupM.m_dTotMat = NewMachGroupM.m_dL * NewMachGroupM.m_dW
|
NewMachGroupM.m_dTotMat = NewMachGroupM.m_dL * NewMachGroupM.m_dW
|
||||||
NewMachGroupM.m_PartMList = LoadParts(NewMachGroupM)
|
NewMachGroupM.m_PartMList = LoadParts(NewMachGroupM)
|
||||||
For Each Part In NewMachGroupM.m_PartMList
|
For Each Part In NewMachGroupM.m_PartMList
|
||||||
@@ -420,7 +408,7 @@ Public Class MyMachGroupM
|
|||||||
EgtGetInfo(Id, MGR_RPT_PART & 1, sInfo)
|
EgtGetInfo(Id, MGR_RPT_PART & 1, sInfo)
|
||||||
If Not String.IsNullOrWhiteSpace(sInfo) Then
|
If Not String.IsNullOrWhiteSpace(sInfo) Then
|
||||||
sSplitInfo = sInfo.Split(","c)
|
sSplitInfo = sInfo.Split(","c)
|
||||||
StringToDoubleAdv(sSplitInfo(1), m_dStartCut)
|
StringToDouble(sSplitInfo(1), m_dStartCut)
|
||||||
Else
|
Else
|
||||||
m_dStartCut = 0
|
m_dStartCut = 0
|
||||||
End If
|
End If
|
||||||
|
|||||||
@@ -338,8 +338,7 @@ Public Class MyMachGroupPanelM
|
|||||||
End Class
|
End Class
|
||||||
|
|
||||||
' funzione che cancella tutti i pezzi segnati da eliminare
|
' funzione che cancella tutti i pezzi segnati da eliminare
|
||||||
Public Shared Function DeleteDuplo() As List(Of Integer)
|
Public Shared Sub DeleteDuplo()
|
||||||
Dim ToRedrawMachGroupList As New List(Of Integer)
|
|
||||||
' reset necessario per poter accedere direttamente al grezzo dalle info pezzo e al MachGroup tramite la gerarchia Db geometrico
|
' reset necessario per poter accedere direttamente al grezzo dalle info pezzo e al MachGroup tramite la gerarchia Db geometrico
|
||||||
EgtResetCurrMachGroup()
|
EgtResetCurrMachGroup()
|
||||||
Dim nPartId As Integer = EgtGetFirstPart()
|
Dim nPartId As Integer = EgtGetFirstPart()
|
||||||
@@ -357,37 +356,16 @@ Public Class MyMachGroupPanelM
|
|||||||
Dim nRawPartId As Integer = DuploGetRawPart(nDuploId)
|
Dim nRawPartId As Integer = DuploGetRawPart(nDuploId)
|
||||||
' recupero gruppo di lavorazione
|
' recupero gruppo di lavorazione
|
||||||
Dim nMachGroupId As Integer = EgtGetParent(EgtGetParent(EgtGetParent(nRawPartId)))
|
Dim nMachGroupId As Integer = EgtGetParent(EgtGetParent(EgtGetParent(nRawPartId)))
|
||||||
|
|
||||||
' elimino eventuali successive info pezzi di troppo
|
|
||||||
Dim nIndex As Integer = 0
|
|
||||||
Dim sTemp As String = ""
|
|
||||||
While EgtGetInfo(nMachGroupId, MGR_RPT_PART & nIndex, sTemp)
|
|
||||||
Dim PartData() As String = sTemp.Split(","c)
|
|
||||||
If PartData(0) <> nDuploId Then
|
|
||||||
EgtSetInfo(nMachGroupId, MGR_RPT_PART & nIndex, sTemp)
|
|
||||||
nIndex += 1
|
|
||||||
End If
|
|
||||||
End While
|
|
||||||
ToRedrawMachGroupList.Add(nMachGroupId)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
'' elimino vecchio grezzo ed eseguo script creazione nuovo
|
|
||||||
'Dim nRawId As Integer = EgtGetFirstRawPart()
|
|
||||||
'While nRawId <> GDB_ID.NULL
|
|
||||||
' EgtRemovePartFromRawPart(EgtGetFirstPartInRawPart(nRawId))
|
|
||||||
' EgtRemoveRawPart(nRawId)
|
|
||||||
' nRawId = EgtGetFirstRawPart()
|
|
||||||
'End While
|
|
||||||
'If Not ExecBeam(Map.refMainWindowVM.MainWindowM.sTempDir, Map.refMachinePanelVM.SelectedMachine.Name, CalcIntegration.CmdTypes.RAWPART, False) Then Return False
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
' lo setto come corrente
|
' lo setto come corrente
|
||||||
EgtSetCurrMachGroup(nMachGroupId)
|
EgtSetCurrMachGroup(nMachGroupId)
|
||||||
' elimino pezzo copia
|
' elimino pezzo copia
|
||||||
EgtRemovePartFromRawPart(nDuploId)
|
EgtRemovePartFromRawPart(nDuploId)
|
||||||
EgtErase(nDuploId)
|
EgtErase(nDuploId)
|
||||||
|
'' recupero gruppo di lavorazione e trave dell'interfaccia
|
||||||
|
'Dim BeamMachGroup As BeamMachGroupM = MachGroupMList.FirstOrDefault(Function(x) x.Id = nMachGroupId)
|
||||||
|
'Dim Beam As BeamM = BeamMachGroup.PartMList.FirstOrDefault(Function(x) x.nPartId = nDuploId)
|
||||||
|
'EgtSetCurrMachGroup(BeamMachGroup.Id)
|
||||||
|
'''Beam.DeletePart()
|
||||||
Next
|
Next
|
||||||
End If
|
End If
|
||||||
DuploResetToDelete(nPartId)
|
DuploResetToDelete(nPartId)
|
||||||
@@ -395,8 +373,7 @@ Public Class MyMachGroupPanelM
|
|||||||
nPartId = EgtGetNextPart(nPartId)
|
nPartId = EgtGetNextPart(nPartId)
|
||||||
End While
|
End While
|
||||||
EgtResetCurrMachGroup()
|
EgtResetCurrMachGroup()
|
||||||
Return ToRedrawMachGroupList
|
End Sub
|
||||||
End Function
|
|
||||||
|
|
||||||
Friend Shared Function DuploGetToDelete(nSouId As Integer, ByRef bToDelete As Boolean) As Boolean
|
Friend Shared Function DuploGetToDelete(nSouId As Integer, ByRef bToDelete As Boolean) As Boolean
|
||||||
If IsNothing(nSouId) Then Return False
|
If IsNothing(nSouId) Then Return False
|
||||||
@@ -425,23 +402,12 @@ Public Class MyMachGroupPanelM
|
|||||||
End Function
|
End Function
|
||||||
|
|
||||||
Public Shared Function DuploGetRawPart(nDuploId As Integer) As Integer
|
Public Shared Function DuploGetRawPart(nDuploId As Integer) As Integer
|
||||||
Dim nSwapItem As Integer = GDB_ID.NULL
|
Dim nRawId As Integer = GDB_ID.NULL
|
||||||
Dim sSwapItem As String = String.Empty
|
If EgtGetInfo(nDuploId, GDB_SI_LIST, nRawId) AndAlso nRawId > 0 Then
|
||||||
EgtGetInfo(nDuploId, "!LST", sSwapItem)
|
Return nRawId
|
||||||
Dim LSTValues() As String = sSwapItem.Split(","c)
|
Else
|
||||||
If Not IsNothing(LSTValues(LSTValues.Count - 1)) AndAlso Integer.TryParse(LSTValues(LSTValues.Count - 1), nSwapItem) AndAlso nSwapItem > 0 Then
|
Return GDB_ID.NULL
|
||||||
Return EgtGetParent(nSwapItem)
|
|
||||||
End If
|
End If
|
||||||
Return GDB_ID.NULL
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
'Dim nRawId As Integer = GDB_ID.NULL
|
|
||||||
'If EgtGetInfo(nDuploId, GDB_SI_LIST, nRawId) AndAlso nRawId > 0 Then
|
|
||||||
' Return nRawId
|
|
||||||
'Else
|
|
||||||
' Return GDB_ID.NULL
|
|
||||||
'End If
|
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
#End Region ' METHODS
|
#End Region ' METHODS
|
||||||
|
|||||||
@@ -508,7 +508,7 @@ Public Class PartM
|
|||||||
Index += 1
|
Index += 1
|
||||||
End While
|
End While
|
||||||
If bFound Then
|
If bFound Then
|
||||||
StringToDoubleAdv(sSplitInfo(1), NewPartM.m_dPOSX)
|
StringToDouble(sSplitInfo(1), NewPartM.m_dPOSX)
|
||||||
End If
|
End If
|
||||||
Else
|
Else
|
||||||
' leggo PosX, PosY, Rot e Flip
|
' leggo PosX, PosY, Rot e Flip
|
||||||
|
|||||||
@@ -47,18 +47,6 @@ Public MustInherit Class MyMachGroupPanelVM
|
|||||||
End Get
|
End Get
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
Public ReadOnly Property dDoneTime As String
|
|
||||||
Get
|
|
||||||
Return m_MachGroupVMList.Sum(CType(Function(x As MyMachGroupVM) If(x.nProduction_State >= ItemState.Produced AndAlso Not IsNothing(x.dtEndTime) AndAlso x.dtEndTime <> DateTime.MinValue, (x.dtEndTime - x.dtStartTime).TotalSeconds(), 0), Func(Of MachGroupVM, Double)))
|
|
||||||
End Get
|
|
||||||
End Property
|
|
||||||
|
|
||||||
Public ReadOnly Property sDoneTime As String
|
|
||||||
Get
|
|
||||||
Return TimeSpan.FromSeconds(dDoneTime).ToString()
|
|
||||||
End Get
|
|
||||||
End Property
|
|
||||||
|
|
||||||
Public ReadOnly Property dRemainingTime As String
|
Public ReadOnly Property dRemainingTime As String
|
||||||
Get
|
Get
|
||||||
Return m_MachGroupVMList.Sum(CType(Function(x As MyMachGroupVM) If(x.nProduction_State < ItemState.Produced, x.nCALC_TIME, 0), Func(Of MachGroupVM, Double)))
|
Return m_MachGroupVMList.Sum(CType(Function(x As MyMachGroupVM) If(x.nProduction_State < ItemState.Produced, x.nCALC_TIME, 0), Func(Of MachGroupVM, Double)))
|
||||||
@@ -108,21 +96,6 @@ Public MustInherit Class MyMachGroupPanelVM
|
|||||||
Return True
|
Return True
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
Private Sub RedrawModifiedMachGroup(RedrawList As List(Of Integer))
|
|
||||||
For Each nMachGroupId In RedrawList
|
|
||||||
EgtSetCurrMachGroup(nMachGroupId)
|
|
||||||
' elimino vecchio grezzo ed eseguo script creazione nuovo
|
|
||||||
Dim nRawId As Integer = EgtGetFirstRawPart()
|
|
||||||
While nRawId <> GDB_ID.NULL
|
|
||||||
EgtRemovePartFromRawPart(EgtGetFirstPartInRawPart(nRawId))
|
|
||||||
EgtRemoveRawPart(nRawId)
|
|
||||||
nRawId = EgtGetFirstRawPart()
|
|
||||||
End While
|
|
||||||
'If Not ExecBeam(Map.refMainWindowVM.MainWindowM.sTempDir, Map.refMachinePanelVM.SelectedMachine.Name, CalcIntegration.CmdTypes.RAWPART, False) Then Return False
|
|
||||||
|
|
||||||
Next
|
|
||||||
End Sub
|
|
||||||
|
|
||||||
'Public Overrides Sub AddMachGroup()
|
'Public Overrides Sub AddMachGroup()
|
||||||
' Dim MyMachGroupM As MyMachGroupM = m_MyMachGroupPanelM.NewMyMachGroup(CurrentMachine.sMachineName, Map.refProjectVM.BTLStructureVM.nPROJTYPE)
|
' Dim MyMachGroupM As MyMachGroupM = m_MyMachGroupPanelM.NewMyMachGroup(CurrentMachine.sMachineName, Map.refProjectVM.BTLStructureVM.nPROJTYPE)
|
||||||
' ' e lo seleziono
|
' ' e lo seleziono
|
||||||
|
|||||||
@@ -85,13 +85,13 @@ Public MustInherit Class MyMachGroupVM
|
|||||||
|
|
||||||
Public ReadOnly Property dUsage As Double
|
Public ReadOnly Property dUsage As Double
|
||||||
Get
|
Get
|
||||||
Return If(MyMachGroupM.dMatForPart > 0 AndAlso MyMachGroupM.dTotMat > 0, If(nType = BWType.WALL, MyMachGroupM.dMatForPart / MyMachGroupM.dTotMat * 100, MyMachGroupM.dMatForPart / MyMachGroupM.dL * 100), 0)
|
Return If(MyMachGroupM.dMatForPart > 0 AndAlso MyMachGroupM.dTotMat > 0, MyMachGroupM.dMatForPart / MyMachGroupM.dTotMat * 100, 0)
|
||||||
End Get
|
End Get
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
Public ReadOnly Property dWaste As Double
|
Public ReadOnly Property dWaste As Double
|
||||||
Get
|
Get
|
||||||
Return If(MyMachGroupM.dMatForPart > 0 AndAlso MyMachGroupM.dTotMat > 0, If(nType = BWType.WALL, (MyMachGroupM.dTotMat - MyMachGroupM.dMatForPart) / 1000000000, MyMachGroupM.dL - MyMachGroupM.dTotMat), 0)
|
Return If(MyMachGroupM.dMatForPart > 0 AndAlso MyMachGroupM.dTotMat > 0, (MyMachGroupM.dTotMat - MyMachGroupM.dMatForPart) / MyMachGroupM.dTotMat * 100, 0)
|
||||||
End Get
|
End Get
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
@@ -103,7 +103,7 @@ Public MustInherit Class MyMachGroupVM
|
|||||||
|
|
||||||
Public ReadOnly Property sWaste As String
|
Public ReadOnly Property sWaste As String
|
||||||
Get
|
Get
|
||||||
Return LenToString(dWaste, 3)
|
Return DoubleToString(dWaste, 3)
|
||||||
End Get
|
End Get
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
@@ -169,7 +169,7 @@ Public MustInherit Class MyMachGroupVM
|
|||||||
Return LenToString(MyMachGroupM.dStartCut, 3)
|
Return LenToString(MyMachGroupM.dStartCut, 3)
|
||||||
End Get
|
End Get
|
||||||
Set(value As String)
|
Set(value As String)
|
||||||
StringToLenAdv(value, MyMachGroupM.dStartCut, True)
|
StringToLen(value, MyMachGroupM.dStartCut)
|
||||||
End Set
|
End Set
|
||||||
End Property
|
End Property
|
||||||
Public Property dStartCut As Double
|
Public Property dStartCut As Double
|
||||||
@@ -481,25 +481,13 @@ Public MustInherit Class MyMachGroupVM
|
|||||||
End Function
|
End Function
|
||||||
|
|
||||||
Public Sub UpdateUsage()
|
Public Sub UpdateUsage()
|
||||||
If nType = BWType.BEAM Then
|
MyMachGroupM.SetTotMat(dL * dH * dW)
|
||||||
MyMachGroupM.SetMatForPart(0)
|
MyMachGroupM.SetMatForPart(0)
|
||||||
Dim dPartLength As Double
|
Dim dPartVolume As Double
|
||||||
Dim dPartOffsetLength As Double
|
For Each Part In PartVMList
|
||||||
For Each Part In PartVMList
|
dPartVolume += Part.dVolume
|
||||||
dPartOffsetLength += Part.dL + Part.dOffset
|
Next
|
||||||
dPartLength += Part.dL
|
MyMachGroupM.SetMatForPart(dPartVolume)
|
||||||
Next
|
|
||||||
MyMachGroupM.SetTotMat(dPartOffsetLength)
|
|
||||||
MyMachGroupM.SetMatForPart(dPartLength)
|
|
||||||
Else
|
|
||||||
MyMachGroupM.SetTotMat(dL * dH * dW)
|
|
||||||
MyMachGroupM.SetMatForPart(0)
|
|
||||||
Dim dPartVolume As Double
|
|
||||||
For Each Part In PartVMList
|
|
||||||
dPartVolume += Part.dVolume
|
|
||||||
Next
|
|
||||||
MyMachGroupM.SetMatForPart(dPartVolume)
|
|
||||||
End If
|
|
||||||
NotifyPropertyChanged(NameOf(sUsage))
|
NotifyPropertyChanged(NameOf(sUsage))
|
||||||
NotifyPropertyChanged(NameOf(sWaste))
|
NotifyPropertyChanged(NameOf(sWaste))
|
||||||
End Sub
|
End Sub
|
||||||
@@ -632,17 +620,13 @@ Public MustInherit Class MyMachGroupVM
|
|||||||
Public ReadOnly Property DeleteMachGroup_Command As ICommand
|
Public ReadOnly Property DeleteMachGroup_Command As ICommand
|
||||||
Get
|
Get
|
||||||
If m_cmdDeleteMachGroup Is Nothing Then
|
If m_cmdDeleteMachGroup Is Nothing Then
|
||||||
m_cmdDeleteMachGroup = New Command(AddressOf DeleteMachGroupCmd)
|
m_cmdDeleteMachGroup = New Command(AddressOf DeleteMachGroup)
|
||||||
End If
|
End If
|
||||||
Return m_cmdDeleteMachGroup
|
Return m_cmdDeleteMachGroup
|
||||||
End Get
|
End Get
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
Public Sub DeleteMachGroupCmd()
|
Public Overridable Sub DeleteMachGroup()
|
||||||
DeleteMachGroup()
|
|
||||||
End Sub
|
|
||||||
|
|
||||||
Public Overridable Sub DeleteMachGroup(Optional bMultipleCommand As Boolean = False)
|
|
||||||
' elimino tutte le copie
|
' elimino tutte le copie
|
||||||
Dim nRawPartId As Integer = EgtGetFirstRawPart()
|
Dim nRawPartId As Integer = EgtGetFirstRawPart()
|
||||||
Dim nBeamId As Integer = EgtGetFirstPartInRawPart(nRawPartId)
|
Dim nBeamId As Integer = EgtGetFirstPartInRawPart(nRawPartId)
|
||||||
|
|||||||
@@ -107,7 +107,7 @@ Public MustInherit Class PartVM
|
|||||||
Return LenToString(m_PartM.dPOSX, 3)
|
Return LenToString(m_PartM.dPOSX, 3)
|
||||||
End Get
|
End Get
|
||||||
Set(value As String)
|
Set(value As String)
|
||||||
StringToLenAdv(value, m_PartM.dPOSX, True)
|
StringToLen(value, m_PartM.dPOSX)
|
||||||
End Set
|
End Set
|
||||||
End Property
|
End Property
|
||||||
Public Property dPOSX As Double
|
Public Property dPOSX As Double
|
||||||
@@ -217,7 +217,7 @@ Public MustInherit Class PartVM
|
|||||||
Return LenToString(m_PartM.dOffset, 3)
|
Return LenToString(m_PartM.dOffset, 3)
|
||||||
End Get
|
End Get
|
||||||
Set(value As String)
|
Set(value As String)
|
||||||
StringToLenAdv(value, m_PartM.dOffset, True)
|
StringToLen(value, m_PartM.dOffset)
|
||||||
End Set
|
End Set
|
||||||
End Property
|
End Property
|
||||||
Public ReadOnly Property dOffset As Double
|
Public ReadOnly Property dOffset As Double
|
||||||
@@ -235,7 +235,7 @@ Public MustInherit Class PartVM
|
|||||||
Return LenToString(m_PartM.dPOSY, 3)
|
Return LenToString(m_PartM.dPOSY, 3)
|
||||||
End Get
|
End Get
|
||||||
Set(value As String)
|
Set(value As String)
|
||||||
StringToLenAdv(value, m_PartM.dPOSY, True)
|
StringToLen(value, m_PartM.dPOSY)
|
||||||
End Set
|
End Set
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
@@ -250,7 +250,7 @@ Public MustInherit Class PartVM
|
|||||||
Return LenToString(m_PartM.dROT, 3) & "°"
|
Return LenToString(m_PartM.dROT, 3) & "°"
|
||||||
End Get
|
End Get
|
||||||
Set(value As String)
|
Set(value As String)
|
||||||
StringToLenAdv(value, m_PartM.dROT, True)
|
StringToLen(value, m_PartM.dROT)
|
||||||
End Set
|
End Set
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
@@ -562,9 +562,8 @@ Public MustInherit Class PartVM
|
|||||||
|
|
||||||
Public Sub CalcFallUpdate(FALL As Integer)
|
Public Sub CalcFallUpdate(FALL As Integer)
|
||||||
EgtSetInfo(nPartId, ITG_PROD_FALL, FALL, True)
|
EgtSetInfo(nPartId, ITG_PROD_FALL, FALL, True)
|
||||||
m_PartM.nCALC_FALL = FALL
|
m_PartM.nCALC_FALL = 0
|
||||||
NotifyPropertyChanged(NameOf(nCALC_FALL))
|
NotifyPropertyChanged(NameOf(nCALC_FALL))
|
||||||
NotifyPropertyChanged(NameOf(CALC_FALL_Visibility))
|
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
' funzione che aggiorna lo stato e gli errori dopo calcolo
|
' funzione che aggiorna lo stato e gli errori dopo calcolo
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ Imports System.Runtime.InteropServices
|
|||||||
<Assembly: AssemblyDescription("")>
|
<Assembly: AssemblyDescription("")>
|
||||||
<Assembly: AssemblyCompany("Egalware s.r.l.")>
|
<Assembly: AssemblyCompany("Egalware s.r.l.")>
|
||||||
<Assembly: AssemblyProduct("EgtBEAMWALL.Core")>
|
<Assembly: AssemblyProduct("EgtBEAMWALL.Core")>
|
||||||
<Assembly: AssemblyCopyright("Copyright © 2020-2023 by Egalware s.r.l.")>
|
<Assembly: AssemblyCopyright("Copyright © 2020-2022 by Egalware s.r.l.")>
|
||||||
<Assembly: AssemblyTrademark("")>
|
<Assembly: AssemblyTrademark("")>
|
||||||
|
|
||||||
<Assembly: ComVisible(False)>
|
<Assembly: ComVisible(False)>
|
||||||
@@ -35,5 +35,5 @@ Imports System.Runtime.InteropServices
|
|||||||
' by using the '*' as shown below:
|
' by using the '*' as shown below:
|
||||||
' <Assembly: AssemblyVersion("1.0.*")>
|
' <Assembly: AssemblyVersion("1.0.*")>
|
||||||
|
|
||||||
<Assembly: AssemblyVersion("2.5.8.1")>
|
<Assembly: AssemblyVersion("2.4.3.2")>
|
||||||
<Assembly: AssemblyFileVersion("2.5.8.1")>
|
<Assembly: AssemblyFileVersion("2.4.3.2")>
|
||||||
|
|||||||
@@ -1,249 +0,0 @@
|
|||||||
<EgtWPFLib5:EgtCustomWindow x:Class="NewOpenProjectFileDialogV"
|
|
||||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
||||||
xmlns:EgtWPFLib5="clr-namespace:EgtWPFLib5;assembly=EgtWPFLib5"
|
|
||||||
xmlns:EgtBEAMWALL="clr-namespace:EgtBEAMWALL.Core"
|
|
||||||
Title="{Binding Title}"
|
|
||||||
Style="{DynamicResource {x:Type EgtWPFLib5:EgtCustomWindow}}"
|
|
||||||
WindowStyle="None" ResizeMode="NoResize" TitleBarHeight="30" IsResizable="True"
|
|
||||||
IsMinimizable="False" WindowStartupLocation="CenterScreen" ShowInTaskbar="False"
|
|
||||||
IsClosable="False"
|
|
||||||
MinHeight="500" MinWidth="500"
|
|
||||||
DataContext="{Binding RelativeSource={RelativeSource Self}}">
|
|
||||||
|
|
||||||
<EgtWPFLib5:EgtCustomWindow.Resources>
|
|
||||||
<EgtWPFLib5:FileNameConverter x:Key="FileNameConverter"/>
|
|
||||||
</EgtWPFLib5:EgtCustomWindow.Resources>
|
|
||||||
|
|
||||||
<Grid>
|
|
||||||
<Grid.RowDefinitions>
|
|
||||||
<RowDefinition Height="Auto"/>
|
|
||||||
<RowDefinition Height="5*"/>
|
|
||||||
<RowDefinition Height="1*"/>
|
|
||||||
</Grid.RowDefinitions>
|
|
||||||
|
|
||||||
<GroupBox Header="{Binding Filters_Msg}"
|
|
||||||
Margin="5"
|
|
||||||
Visibility="{Binding Filters_Visibility}">
|
|
||||||
<Grid>
|
|
||||||
<Grid.RowDefinitions>
|
|
||||||
<RowDefinition Height="Auto"/>
|
|
||||||
<RowDefinition Height="Auto"/>
|
|
||||||
</Grid.RowDefinitions>
|
|
||||||
<Grid>
|
|
||||||
<Grid.ColumnDefinitions>
|
|
||||||
<ColumnDefinition Width="Auto"/>
|
|
||||||
<ColumnDefinition Width="1*"/>
|
|
||||||
<ColumnDefinition Width="Auto"/>
|
|
||||||
</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>
|
|
||||||
<CheckBox Grid.Column="2"
|
|
||||||
IsChecked="{Binding bViewArchived}"
|
|
||||||
Content="{Binding ViewArchived_Msg}"
|
|
||||||
VerticalAlignment="Center"/>
|
|
||||||
</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="{Binding Rows_Msg}"
|
|
||||||
Style="{StaticResource OptionTextBlock}"/>
|
|
||||||
<ComboBox ItemsSource="{Binding RowQuantityList}"
|
|
||||||
SelectedIndex="{Binding SelRowQuantity}"
|
|
||||||
Style="{StaticResource FeatureComboBox}"/>
|
|
||||||
</StackPanel>
|
|
||||||
</Grid>
|
|
||||||
</Grid>
|
|
||||||
</GroupBox>
|
|
||||||
|
|
||||||
<EgtBEAMWALL:EgtDataGrid x:Name="MainDataGrid"
|
|
||||||
Grid.Row="1"
|
|
||||||
ItemsSource="{Binding ProjectList}"
|
|
||||||
SelectedItem="{Binding SelProject}"
|
|
||||||
CanUserAddRows="False"
|
|
||||||
AutoGenerateColumns="False"
|
|
||||||
CanUserResizeRows="False"
|
|
||||||
SelectionMode="Single"
|
|
||||||
ScrollViewer.CanContentScroll="True"
|
|
||||||
ScrollViewer.VerticalScrollBarVisibility="Auto"
|
|
||||||
ScrollViewer.HorizontalScrollBarVisibility="Auto"
|
|
||||||
Margin="5"
|
|
||||||
RowDetailsVisibilityMode="Visible"
|
|
||||||
CellEditEnding="MainDataGrid_CellEditEnding"
|
|
||||||
BindingColumns="{Binding ProdColumns}">
|
|
||||||
<DataGrid.Resources>
|
|
||||||
<!-- ProdId -->
|
|
||||||
<DataGridTextColumn x:Key="colPRODID" Binding="{Binding sProdId}">
|
|
||||||
<DataGridTextColumn.HeaderTemplate>
|
|
||||||
<DataTemplate>
|
|
||||||
<TextBlock Text="{Binding Path=DataContext.Id_Msg,RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:NewOpenProjectFileDialogV}}}"/>
|
|
||||||
</DataTemplate>
|
|
||||||
</DataGridTextColumn.HeaderTemplate>
|
|
||||||
</DataGridTextColumn>
|
|
||||||
<!--Name-->
|
|
||||||
<DataGridTextColumn x:Key="colNAME" Binding="{Binding sName}">
|
|
||||||
<DataGridTextColumn.Header>
|
|
||||||
<Grid>
|
|
||||||
<Grid.ColumnDefinitions>
|
|
||||||
<ColumnDefinition Width="1*"/>
|
|
||||||
<ColumnDefinition Width="Auto"/>
|
|
||||||
</Grid.ColumnDefinitions>
|
|
||||||
<TextBlock Text="{Binding Path=DataContext.Name_Msg,RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:NewOpenProjectFileDialogV}}}"/>
|
|
||||||
<ToggleButton Grid.Column="1"
|
|
||||||
Margin="5,0,0,0"
|
|
||||||
IsChecked="{Binding Path=DataContext.bIsEditNameActive,RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:NewOpenProjectFileDialogV}}}"
|
|
||||||
Style="{StaticResource ToolBar_SmallToggleButton}">
|
|
||||||
<Image Source="\Resources\CalcPanel\Edit.png"
|
|
||||||
Style="{StaticResource LockImage}"/>
|
|
||||||
</ToggleButton>
|
|
||||||
</Grid>
|
|
||||||
</DataGridTextColumn.Header>
|
|
||||||
</DataGridTextColumn>
|
|
||||||
<!-- Creation date -->
|
|
||||||
<DataGridTextColumn x:Key="colCRTDATE" Binding="{Binding dtCreateDate}">
|
|
||||||
<DataGridTextColumn.Header>
|
|
||||||
<TextBlock Text="{Binding Path=DataContext.CreateDate_Msg, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:NewOpenProjectFileDialogV}}}"/>
|
|
||||||
</DataGridTextColumn.Header>
|
|
||||||
</DataGridTextColumn>
|
|
||||||
<!-- Machine -->
|
|
||||||
<DataGridTextColumn x:Key="colMACHINE" Binding="{Binding sMachine}">
|
|
||||||
<DataGridTextColumn.Header>
|
|
||||||
<TextBlock Text="{Binding Path=DataContext.Machine_Msg, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:NewOpenProjectFileDialogV}}}"/>
|
|
||||||
</DataGridTextColumn.Header>
|
|
||||||
</DataGridTextColumn>
|
|
||||||
<!-- Archived -->
|
|
||||||
<DataGridTemplateColumn x:Key="colARCHIVED">
|
|
||||||
<DataGridTemplateColumn.CellTemplate>
|
|
||||||
<DataTemplate>
|
|
||||||
<Image Source="\Resources\OpenProjectFileDialog\Archived.png"
|
|
||||||
Visibility="{Binding Archived_Visibility}"
|
|
||||||
Height="15"
|
|
||||||
Width="15"
|
|
||||||
Stretch="UniformToFill"/>
|
|
||||||
</DataTemplate>
|
|
||||||
</DataGridTemplateColumn.CellTemplate>
|
|
||||||
<DataGridTemplateColumn.Header>
|
|
||||||
<TextBlock Text="{Binding Path=DataContext.Archived_Msg, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:NewOpenProjectFileDialogV}}}"/>
|
|
||||||
</DataGridTemplateColumn.Header>
|
|
||||||
</DataGridTemplateColumn>
|
|
||||||
</DataGrid.Resources>
|
|
||||||
<DataGrid.RowStyle>
|
|
||||||
<Style TargetType="DataGridRow">
|
|
||||||
<Setter Property="FontWeight" Value="DemiBold"/>
|
|
||||||
<Setter Property="VerticalContentAlignment" Value="Center"/>
|
|
||||||
<EventSetter Event="MouseDoubleClick" Handler="ProjectList_MouseDoubleClick"/>
|
|
||||||
</Style>
|
|
||||||
</DataGrid.RowStyle>
|
|
||||||
<DataGrid.RowDetailsTemplate>
|
|
||||||
<DataTemplate>
|
|
||||||
<ItemsControl ItemsSource="{Binding ProjFileList}"
|
|
||||||
BorderThickness="0"
|
|
||||||
Margin="0,-1,0,0"
|
|
||||||
Padding="0">
|
|
||||||
<ItemsControl.ItemTemplate>
|
|
||||||
<DataTemplate>
|
|
||||||
<Grid TextBlock.FontSize="12"
|
|
||||||
TextBlock.FontWeight="Normal">
|
|
||||||
<Grid.ColumnDefinitions>
|
|
||||||
<ColumnDefinition Width="{Binding Path=DataContext.ProdColumns[0].ActualWidth, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:NewOpenProjectFileDialogV}}}"/>
|
|
||||||
<ColumnDefinition Width="1*"/>
|
|
||||||
</Grid.ColumnDefinitions>
|
|
||||||
<Grid.RowDefinitions>
|
|
||||||
<RowDefinition Height="1"/>
|
|
||||||
<RowDefinition Height="1*"/>
|
|
||||||
</Grid.RowDefinitions>
|
|
||||||
<Grid Grid.Row="0"
|
|
||||||
Grid.ColumnSpan="2"
|
|
||||||
Background="Gray"
|
|
||||||
Margin="40,0,40,0"/>
|
|
||||||
<Grid Grid.Column="1"
|
|
||||||
Grid.Row="1"
|
|
||||||
Margin="2">
|
|
||||||
<Grid.ColumnDefinitions>
|
|
||||||
<ColumnDefinition Width="Auto"/>
|
|
||||||
<ColumnDefinition Width="1*"/>
|
|
||||||
<ColumnDefinition Width="Auto"/>
|
|
||||||
<ColumnDefinition Width="1*"/>
|
|
||||||
</Grid.ColumnDefinitions>
|
|
||||||
<Grid.RowDefinitions>
|
|
||||||
<RowDefinition Height="1*"/>
|
|
||||||
<RowDefinition Height="1*"/>
|
|
||||||
</Grid.RowDefinitions>
|
|
||||||
<TextBlock Text="{Binding Path=DataContext.BTLFileName_Msg, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:NewOpenProjectFileDialogV}}}"
|
|
||||||
Style="{StaticResource OpenWnd_TextBlock}"/>
|
|
||||||
<TextBlock Grid.Column="1"
|
|
||||||
Text="{Binding sBTLFileName}"/>
|
|
||||||
<TextBlock Grid.Row="1"
|
|
||||||
Text="{Binding Path=DataContext.ListName_Msg, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:NewOpenProjectFileDialogV}}}"
|
|
||||||
Style="{StaticResource OpenWnd_TextBlock}"/>
|
|
||||||
<TextBlock Grid.Column="1"
|
|
||||||
Grid.Row="1"
|
|
||||||
Text="{Binding sListName}"/>
|
|
||||||
<TextBlock Grid.Column="2"
|
|
||||||
Text="{Binding Path=DataContext.ExportDate_Msg, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:NewOpenProjectFileDialogV}}}"
|
|
||||||
Style="{StaticResource OpenWnd_TextBlock}"/>
|
|
||||||
<TextBlock Grid.Column="3"
|
|
||||||
Text="{Binding dtExportDate}"/>
|
|
||||||
</Grid>
|
|
||||||
</Grid>
|
|
||||||
</DataTemplate>
|
|
||||||
</ItemsControl.ItemTemplate>
|
|
||||||
</ItemsControl>
|
|
||||||
</DataTemplate>
|
|
||||||
</DataGrid.RowDetailsTemplate>
|
|
||||||
</EgtBEAMWALL:EgtDataGrid>
|
|
||||||
|
|
||||||
<UniformGrid Columns="4" Grid.Row="2" Margin="0,0,0,5">
|
|
||||||
<Button IsDefault="True" Name="OpenBtn"
|
|
||||||
Content="{Binding Open_Msg}"
|
|
||||||
Style="{DynamicResource EgtWPFLib5_InputButton}"/>
|
|
||||||
<Button Content="{Binding Archive_Msg}"
|
|
||||||
Command="{Binding Archive_Command}"
|
|
||||||
IsEnabled="{Binding bArchived_IsEnabled}"
|
|
||||||
Style="{DynamicResource EgtWPFLib5_InputButton}"/>
|
|
||||||
<Button Content="{Binding Delete_Msg}"
|
|
||||||
Command="{Binding Delete_Command}"
|
|
||||||
IsEnabled="{Binding bDelete_IsEnabled}"
|
|
||||||
Style="{DynamicResource EgtWPFLib5_InputButton}"/>
|
|
||||||
<Button Command="{Binding Cancel_Command}"
|
|
||||||
Content="{Binding Cancel_Msg}"
|
|
||||||
Style="{DynamicResource EgtWPFLib5_InputButton}"/>
|
|
||||||
</UniformGrid>
|
|
||||||
|
|
||||||
</Grid>
|
|
||||||
|
|
||||||
</EgtWPFLib5:EgtCustomWindow>
|
|
||||||
@@ -1,86 +0,0 @@
|
|||||||
Imports System.ComponentModel
|
|
||||||
Imports System.IO
|
|
||||||
Imports System.Windows
|
|
||||||
Imports System.Windows.Controls
|
|
||||||
Imports System.Windows.Input
|
|
||||||
Imports EgtBEAMWALL.Core.ConstBeam
|
|
||||||
Imports EgtUILib
|
|
||||||
Imports EgtWPFLib5
|
|
||||||
Imports EgtBEAMWALL
|
|
||||||
Imports System.Windows.Media
|
|
||||||
|
|
||||||
Public Class NewOpenProjectFileDialogV
|
|
||||||
|
|
||||||
Private WithEvents m_OpenProjFileDialogVM As NewOpenProjectFileDialogVM
|
|
||||||
|
|
||||||
#Region "CONSTRUCTOR"
|
|
||||||
|
|
||||||
Sub New(Owner As Window, OpenProjFileDialogVM As NewOpenProjectFileDialogVM)
|
|
||||||
' Funzione che interpreta l'xaml
|
|
||||||
InitializeComponent()
|
|
||||||
Me.Owner = Owner
|
|
||||||
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
|
|
||||||
|
|
||||||
#Region "METHODS"
|
|
||||||
|
|
||||||
Public Function EgtShowDialog(ProjectType As ProjectType) As Boolean?
|
|
||||||
m_OpenProjFileDialogVM.Init(ProjectType)
|
|
||||||
' mostro la finestra di dialogo
|
|
||||||
Return Me.ShowDialog()
|
|
||||||
End Function
|
|
||||||
Public Function EgtShowDialog(ProjectType As ProjectType, ProjectList As List(Of ProjectFileVM)) As Boolean?
|
|
||||||
m_OpenProjFileDialogVM.Init(ProjectType, ProjectList)
|
|
||||||
' mostro la finestra di dialogo
|
|
||||||
Return Me.ShowDialog()
|
|
||||||
End Function
|
|
||||||
|
|
||||||
Public Function EgtShowDialog(ProjectType As ProjectType, GoToProd As Boolean) As Boolean?
|
|
||||||
m_OpenProjFileDialogVM.Init(ProjectType, Nothing, GoToProd)
|
|
||||||
' mostro la finestra di dialogo
|
|
||||||
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"
|
|
||||||
|
|
||||||
Private Sub ProjectList_MouseDoubleClick(sender As Object, e As MouseButtonEventArgs)
|
|
||||||
m_OpenProjFileDialogVM.ProjDoubleClick()
|
|
||||||
End Sub
|
|
||||||
|
|
||||||
#End Region ' EVENTS
|
|
||||||
|
|
||||||
Private Sub OpenBtn_Click(sender As Object, e As RoutedEventArgs) Handles OpenBtn.Click
|
|
||||||
DialogResult = m_OpenProjFileDialogVM.VerifySelected()
|
|
||||||
End Sub
|
|
||||||
|
|
||||||
Private Sub CloseWindow(bDialogResult As Boolean) Handles m_OpenProjFileDialogVM.m_CloseWindow
|
|
||||||
Me.DialogResult = bDialogResult
|
|
||||||
End Sub
|
|
||||||
|
|
||||||
Private Sub MainDataGrid_CellEditEnding(sender As Object, e As DataGridCellEditEndingEventArgs)
|
|
||||||
'm_OpenProjFileDialogVM.SetIsEditNameActive(False)
|
|
||||||
End Sub
|
|
||||||
|
|
||||||
End Class
|
|
||||||
@@ -1,872 +0,0 @@
|
|||||||
Imports System.Collections.ObjectModel
|
|
||||||
Imports System.IO
|
|
||||||
Imports System.Windows
|
|
||||||
Imports System.Windows.Controls
|
|
||||||
Imports System.Windows.Data
|
|
||||||
Imports System.Windows.Input
|
|
||||||
Imports EgtBEAMWALL.Core
|
|
||||||
Imports EgtBEAMWALL.Core.ConstBeam
|
|
||||||
Imports EgtUILib
|
|
||||||
Imports EgtWPFLib5
|
|
||||||
|
|
||||||
Public MustInherit Class NewOpenProjectFileDialogVM
|
|
||||||
Inherits VMBase
|
|
||||||
|
|
||||||
#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
|
|
||||||
ALWAYS = 4
|
|
||||||
End Enum
|
|
||||||
|
|
||||||
Public Enum RowQuantities As Integer
|
|
||||||
FIFTY = 0
|
|
||||||
HUNDRED = 1
|
|
||||||
HUNDREDANDFIFTY = 2
|
|
||||||
End Enum
|
|
||||||
|
|
||||||
Friend Event m_CloseWindow(bDialogResult As Boolean)
|
|
||||||
|
|
||||||
Protected m_ProdColumns As New ObservableCollection(Of EgtDataGridColumn)
|
|
||||||
Public Property ProdColumns As ObservableCollection(Of EgtDataGridColumn)
|
|
||||||
Get
|
|
||||||
Return m_ProdColumns
|
|
||||||
End Get
|
|
||||||
Set(value As ObservableCollection(Of EgtDataGridColumn))
|
|
||||||
m_ProdColumns = value
|
|
||||||
End Set
|
|
||||||
End Property
|
|
||||||
|
|
||||||
Private m_colProdFile_Name As EgtDataGridColumn
|
|
||||||
Public ReadOnly Property colProdFile_Name As EgtDataGridColumn
|
|
||||||
Get
|
|
||||||
Return m_colProdFile_Name
|
|
||||||
End Get
|
|
||||||
End Property
|
|
||||||
|
|
||||||
Private m_colArchived_Name As EgtDataGridColumn
|
|
||||||
Public ReadOnly Property colArchived_Name As EgtDataGridColumn
|
|
||||||
Get
|
|
||||||
Return m_colArchived_Name
|
|
||||||
End Get
|
|
||||||
End Property
|
|
||||||
|
|
||||||
Protected m_ProjColumns As New ObservableCollection(Of EgtDataGridColumn)
|
|
||||||
Public Property ProjColumns As ObservableCollection(Of EgtDataGridColumn)
|
|
||||||
Get
|
|
||||||
Return m_ProjColumns
|
|
||||||
End Get
|
|
||||||
Set(value As ObservableCollection(Of EgtDataGridColumn))
|
|
||||||
m_ProjColumns = value
|
|
||||||
End Set
|
|
||||||
End Property
|
|
||||||
|
|
||||||
Protected m_ProjectType As ProjectType
|
|
||||||
|
|
||||||
Protected m_sFilter As String
|
|
||||||
Public Property Filter As String
|
|
||||||
Get
|
|
||||||
Return m_sFilter
|
|
||||||
End Get
|
|
||||||
Set(value As String)
|
|
||||||
m_sFilter = value
|
|
||||||
End Set
|
|
||||||
End Property
|
|
||||||
|
|
||||||
Protected m_sFileNameFilter As Predicate(Of String)
|
|
||||||
Public Property FileNameFilter As Predicate(Of String)
|
|
||||||
Get
|
|
||||||
Return m_sFileNameFilter
|
|
||||||
End Get
|
|
||||||
Set(value As Predicate(Of String))
|
|
||||||
m_sFileNameFilter = value
|
|
||||||
End Set
|
|
||||||
End Property
|
|
||||||
|
|
||||||
Protected m_sExtensions As New List(Of String)
|
|
||||||
Public ReadOnly Property Extensions As List(Of String)
|
|
||||||
Get
|
|
||||||
Return m_sExtensions
|
|
||||||
End Get
|
|
||||||
End Property
|
|
||||||
|
|
||||||
Public m_ProjectList_View As CollectionView = Nothing
|
|
||||||
Protected m_ProjectList As New ObservableCollection(Of ProdItem)
|
|
||||||
Public ReadOnly Property ProjectList As ObservableCollection(Of ProdItem)
|
|
||||||
Get
|
|
||||||
Return m_ProjectList
|
|
||||||
End Get
|
|
||||||
End Property
|
|
||||||
|
|
||||||
Private m_nSelProjIndex As Integer
|
|
||||||
Public ReadOnly Property nSelProjIndex As Integer
|
|
||||||
Get
|
|
||||||
Return m_nSelProjIndex
|
|
||||||
End Get
|
|
||||||
End Property
|
|
||||||
|
|
||||||
Protected m_SelProject As ProdItem
|
|
||||||
Public Property SelProject As ProdItem
|
|
||||||
Get
|
|
||||||
Return m_SelProject
|
|
||||||
End Get
|
|
||||||
Set(value As ProdItem)
|
|
||||||
m_SelProject = value
|
|
||||||
' verifico se abilitare il bottone Delete
|
|
||||||
If IsNothing(m_SelProject) Then
|
|
||||||
SetDeleteIsEnabled(False)
|
|
||||||
SetArchivedIsEnabled(False)
|
|
||||||
ElseIf IsNothing(m_SelProject.ProdFileVM) Then
|
|
||||||
SetDeleteIsEnabled(True)
|
|
||||||
SetArchivedIsEnabled(False)
|
|
||||||
Else
|
|
||||||
SetDeleteIsEnabled(Not SelProject.ProdFileVM.bIsProduced)
|
|
||||||
SetArchivedIsEnabled(True)
|
|
||||||
End If
|
|
||||||
NotifyPropertyChanged(NameOf(Archive_Msg))
|
|
||||||
End Set
|
|
||||||
End Property
|
|
||||||
|
|
||||||
Protected m_FileName As String
|
|
||||||
Public Property FileName As String
|
|
||||||
Get
|
|
||||||
Return m_FileName
|
|
||||||
End Get
|
|
||||||
Set(value As String)
|
|
||||||
m_FileName = value
|
|
||||||
End Set
|
|
||||||
End Property
|
|
||||||
|
|
||||||
Private m_bFixedProjectList As Boolean
|
|
||||||
Public ReadOnly Property bFixedProjectList As Boolean
|
|
||||||
Get
|
|
||||||
Return m_bFixedProjectList
|
|
||||||
End Get
|
|
||||||
End Property
|
|
||||||
Public Sub SetFixedProjectList(bValue As Boolean)
|
|
||||||
m_bFixedProjectList = bValue
|
|
||||||
NotifyPropertyChanged(NameOf(Filters_Visibility))
|
|
||||||
End Sub
|
|
||||||
|
|
||||||
Public ReadOnly Property Filters_Visibility As Visibility
|
|
||||||
Get
|
|
||||||
Return If(m_bFixedProjectList, Visibility.Collapsed, Visibility.Visible)
|
|
||||||
End Get
|
|
||||||
End Property
|
|
||||||
|
|
||||||
Protected m_BTLDateTypeList As New List(Of String)
|
|
||||||
Public ReadOnly Property BTLDateTypeList As List(Of String)
|
|
||||||
Get
|
|
||||||
Return m_BTLDateTypeList
|
|
||||||
End Get
|
|
||||||
End Property
|
|
||||||
|
|
||||||
Protected m_SelBTLDateType As BTLDateTypes = Nothing
|
|
||||||
Public Property SelBTLDateType As Integer
|
|
||||||
Get
|
|
||||||
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)({EgtMsg(62532), EgtMsg(62533), EgtMsg(62534), EgtMsg(62531)})
|
|
||||||
Public Overridable 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_dtEndDate = DateTime.Today + TimeSpan.FromDays(1)
|
|
||||||
m_dtStartDate = m_dtEndDate - TimeSpan.FromDays(30.5)
|
|
||||||
Case DayTypes.LAST3MONTHS
|
|
||||||
m_dtEndDate = DateTime.Today + TimeSpan.FromDays(1)
|
|
||||||
m_dtStartDate = m_dtEndDate - TimeSpan.FromDays(30.5 * 3)
|
|
||||||
Case DayTypes.LAST6MONTHS
|
|
||||||
m_dtEndDate = DateTime.Today + TimeSpan.FromDays(1)
|
|
||||||
m_dtStartDate = m_dtEndDate - TimeSpan.FromDays(30.5 * 6)
|
|
||||||
Case DayTypes.ALWAYS
|
|
||||||
m_dtEndDate = DateTime.Today + TimeSpan.FromDays(1)
|
|
||||||
m_dtStartDate = New DateTime(2020, 1, 1)
|
|
||||||
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_OPENFILEDIALOG, 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_OPENFILEDIALOG, 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
|
|
||||||
m_SearchText = ""
|
|
||||||
NotifyPropertyChanged(NameOf(SearchText))
|
|
||||||
' 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_SelFilterType = m_FilterTypeList(0)
|
|
||||||
m_ProjectList_View.Refresh()
|
|
||||||
' ora setto il valore scelto come Tipo Filtro
|
|
||||||
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 BTLDateTypes.EXPORTDATE, BTLDateTypes.CREATEDATE
|
|
||||||
SearchText_Visibility = Visibility.Collapsed
|
|
||||||
SearchDate_Visibility = Visibility.Visible
|
|
||||||
Case Else
|
|
||||||
SearchText_Visibility = Visibility.Collapsed
|
|
||||||
SearchDate_Visibility = Visibility.Collapsed
|
|
||||||
End Select
|
|
||||||
End Set
|
|
||||||
End Property
|
|
||||||
|
|
||||||
Protected m_SearchText As String = ""
|
|
||||||
Public Property SearchText As String
|
|
||||||
Get
|
|
||||||
Return m_SearchText
|
|
||||||
End Get
|
|
||||||
Set(value As String)
|
|
||||||
m_SearchText = value
|
|
||||||
m_ProjectList_View.Refresh()
|
|
||||||
End Set
|
|
||||||
End Property
|
|
||||||
|
|
||||||
Friend m_SearchDate As SelectedDatesCollection = Nothing
|
|
||||||
Public ReadOnly Property SearchDate As SelectedDatesCollection
|
|
||||||
Get
|
|
||||||
Return m_SearchDate
|
|
||||||
End Get
|
|
||||||
End Property
|
|
||||||
|
|
||||||
Protected m_SearchText_Visibility As Visibility = Visibility.Collapsed
|
|
||||||
Public Property SearchText_Visibility As Visibility
|
|
||||||
Get
|
|
||||||
Return m_SearchText_Visibility
|
|
||||||
End Get
|
|
||||||
Set(value As Visibility)
|
|
||||||
m_SearchText_Visibility = value
|
|
||||||
NotifyPropertyChanged(NameOf(SearchText_Visibility))
|
|
||||||
End Set
|
|
||||||
End Property
|
|
||||||
|
|
||||||
Protected m_SearchDate_Visibility As Visibility = Visibility.Collapsed
|
|
||||||
Public Property SearchDate_Visibility As Visibility
|
|
||||||
Get
|
|
||||||
Return m_SearchDate_Visibility
|
|
||||||
End Get
|
|
||||||
Set(value As Visibility)
|
|
||||||
m_SearchDate_Visibility = value
|
|
||||||
NotifyPropertyChanged(NameOf(SearchDate_Visibility))
|
|
||||||
End Set
|
|
||||||
End Property
|
|
||||||
|
|
||||||
Public Property bIsEditNameActive As Boolean
|
|
||||||
Get
|
|
||||||
Return Not m_colProdFile_Name.IsReadOnly
|
|
||||||
End Get
|
|
||||||
Set(value As Boolean)
|
|
||||||
If Not IsNothing(m_colProdFile_Name) Then
|
|
||||||
m_colProdFile_Name.IsReadOnly = Not value
|
|
||||||
End If
|
|
||||||
End Set
|
|
||||||
End Property
|
|
||||||
Public Sub SetIsEditNameActive(value As Boolean)
|
|
||||||
If Not IsNothing(m_colProdFile_Name) Then
|
|
||||||
m_colProdFile_Name.IsReadOnly = Not value
|
|
||||||
End If
|
|
||||||
NotifyPropertyChanged(NameOf(bIsEditNameActive))
|
|
||||||
End Sub
|
|
||||||
|
|
||||||
Private m_bViewArchived As Boolean
|
|
||||||
Public Property bViewArchived As Boolean
|
|
||||||
Get
|
|
||||||
Return m_bViewArchived
|
|
||||||
End Get
|
|
||||||
Set(value As Boolean)
|
|
||||||
m_bViewArchived = value
|
|
||||||
WriteMainPrivateProfileString(S_OPENFILEDIALOG, K_VIEWARCHIVED, If(bViewArchived, 1, 0))
|
|
||||||
If Not IsNothing( m_colArchived_Name) Then
|
|
||||||
m_colArchived_Name.Visible = value
|
|
||||||
RefreshProjectList()
|
|
||||||
End If
|
|
||||||
End Set
|
|
||||||
End Property
|
|
||||||
|
|
||||||
Private m_bArchived_IsEnabled As Boolean
|
|
||||||
Public ReadOnly Property bArchived_IsEnabled As Boolean
|
|
||||||
Get
|
|
||||||
Return m_bArchived_IsEnabled
|
|
||||||
End Get
|
|
||||||
End Property
|
|
||||||
Public Sub SetArchivedIsEnabled(bValue As Boolean)
|
|
||||||
m_bArchived_IsEnabled = bValue
|
|
||||||
NotifyPropertyChanged(NameOf(bArchived_IsEnabled))
|
|
||||||
End Sub
|
|
||||||
|
|
||||||
Private m_bDelete_IsEnabled As Boolean
|
|
||||||
Public ReadOnly Property bDelete_IsEnabled As Boolean
|
|
||||||
Get
|
|
||||||
Return m_bDelete_IsEnabled
|
|
||||||
End Get
|
|
||||||
End Property
|
|
||||||
Public Sub SetDeleteIsEnabled(bValue As Boolean)
|
|
||||||
m_bDelete_IsEnabled = bValue
|
|
||||||
NotifyPropertyChanged(NameOf(bDelete_IsEnabled))
|
|
||||||
End Sub
|
|
||||||
|
|
||||||
Protected m_ChangeOpenedProjectOnCancel As Boolean = False
|
|
||||||
|
|
||||||
#Region "Messages"
|
|
||||||
|
|
||||||
Public ReadOnly Property Title As String
|
|
||||||
Get
|
|
||||||
Return EgtMsg(61986)
|
|
||||||
End Get
|
|
||||||
End Property
|
|
||||||
|
|
||||||
Public ReadOnly Property Filters_Msg As String
|
|
||||||
Get
|
|
||||||
Return EgtMsg(61985)
|
|
||||||
End Get
|
|
||||||
End Property
|
|
||||||
|
|
||||||
Public ReadOnly Property FilterType_Msg As String
|
|
||||||
Get
|
|
||||||
Return EgtMsg(61836)
|
|
||||||
End Get
|
|
||||||
End Property
|
|
||||||
Public ReadOnly Property Search_Msg As String
|
|
||||||
Get
|
|
||||||
Return EgtMsg(61837)
|
|
||||||
End Get
|
|
||||||
End Property
|
|
||||||
|
|
||||||
Public ReadOnly Property Id_Msg As String
|
|
||||||
Get
|
|
||||||
Return EgtMsg(61815)
|
|
||||||
End Get
|
|
||||||
End Property
|
|
||||||
Public ReadOnly Property BTLFileName_Msg As String
|
|
||||||
Get
|
|
||||||
Return EgtMsg(61819)
|
|
||||||
End Get
|
|
||||||
End Property
|
|
||||||
Public ReadOnly Property ListName_Msg As String
|
|
||||||
Get
|
|
||||||
Return EgtMsg(61820)
|
|
||||||
End Get
|
|
||||||
End Property
|
|
||||||
Public ReadOnly Property ExportDate_Msg As String
|
|
||||||
Get
|
|
||||||
Return EgtMsg(61821)
|
|
||||||
End Get
|
|
||||||
End Property
|
|
||||||
Public ReadOnly Property CreateDate_Msg As String
|
|
||||||
Get
|
|
||||||
Return EgtMsg(61822)
|
|
||||||
End Get
|
|
||||||
End Property
|
|
||||||
Public ReadOnly Property Machine_Msg As String
|
|
||||||
Get
|
|
||||||
Return EgtMsg(61886)
|
|
||||||
End Get
|
|
||||||
End Property
|
|
||||||
Public ReadOnly Property Name_Msg As String
|
|
||||||
Get
|
|
||||||
Return EgtMsg(61808)
|
|
||||||
End Get
|
|
||||||
End Property
|
|
||||||
|
|
||||||
Public ReadOnly Property Open_Msg As String
|
|
||||||
Get
|
|
||||||
Return EgtMsg(30006)
|
|
||||||
End Get
|
|
||||||
End Property
|
|
||||||
|
|
||||||
Public ReadOnly Property Archived_Msg As String
|
|
||||||
Get
|
|
||||||
Return EgtMsg(61983)
|
|
||||||
End Get
|
|
||||||
End Property
|
|
||||||
|
|
||||||
Public ReadOnly Property Archive_Msg As String
|
|
||||||
Get
|
|
||||||
If Not IsNothing(m_SelProject) AndAlso m_SelProject.bIsArchived Then
|
|
||||||
Return EgtMsg(61984)
|
|
||||||
Else
|
|
||||||
Return EgtMsg(61981)
|
|
||||||
End If
|
|
||||||
End Get
|
|
||||||
End Property
|
|
||||||
Public ReadOnly Property Delete_Msg As String
|
|
||||||
Get
|
|
||||||
Return EgtMsg(61823)
|
|
||||||
End Get
|
|
||||||
End Property
|
|
||||||
Public ReadOnly Property Cancel_Msg As String
|
|
||||||
Get
|
|
||||||
Return EgtMsg(30002)
|
|
||||||
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
|
|
||||||
|
|
||||||
Public ReadOnly Property ViewArchived_Msg As String
|
|
||||||
Get
|
|
||||||
Return EgtMsg(61982)
|
|
||||||
End Get
|
|
||||||
End Property
|
|
||||||
|
|
||||||
Public ReadOnly Property Rows_Msg As String
|
|
||||||
Get
|
|
||||||
Return EgtMsg(61995)
|
|
||||||
End Get
|
|
||||||
End Property
|
|
||||||
|
|
||||||
#End Region
|
|
||||||
|
|
||||||
' Definizione comandi
|
|
||||||
Private m_cmdProjectDoubleClick As ICommand
|
|
||||||
Private m_cmdDelete As ICommand
|
|
||||||
Private m_cmdArchive As ICommand
|
|
||||||
Private m_cmdCancel As ICommand
|
|
||||||
|
|
||||||
#End Region ' FIELDS & PROPERTIES
|
|
||||||
|
|
||||||
Sub New()
|
|
||||||
' assegno delegato a elementi lista
|
|
||||||
ProdItem.m_delIsModifiedSetUp = AddressOf SetIsEditNameActive
|
|
||||||
' carico colonne
|
|
||||||
LoadColumns()
|
|
||||||
m_colProdFile_Name = m_ProdColumns.FirstOrDefault(Function(x) x.Name = COL_NAME)
|
|
||||||
m_colArchived_Name = m_ProdColumns.FirstOrDefault(Function(x) x.Name = COL_ARCHIVED)
|
|
||||||
' leggo valori per filtri
|
|
||||||
m_SelDayType = GetMainPrivateProfileInt(S_OPENFILEDIALOG, K_DAYTYPE, 0)
|
|
||||||
Select Case m_SelDayType
|
|
||||||
Case DayTypes.LASTMONTH
|
|
||||||
m_dtEndDate = DateTime.Today + TimeSpan.FromDays(1)
|
|
||||||
m_dtStartDate = m_dtEndDate - TimeSpan.FromDays(30.5)
|
|
||||||
Case DayTypes.LAST3MONTHS
|
|
||||||
m_dtEndDate = DateTime.Today + TimeSpan.FromDays(1)
|
|
||||||
m_dtStartDate = m_dtEndDate - TimeSpan.FromDays(30.5 * 3)
|
|
||||||
Case DayTypes.LAST6MONTHS
|
|
||||||
m_dtEndDate = DateTime.Today + TimeSpan.FromDays(1)
|
|
||||||
m_dtStartDate = m_dtEndDate - TimeSpan.FromDays(30.5 * 6)
|
|
||||||
Case DayTypes.PERIOD
|
|
||||||
Dim sStartDate As String = "0"
|
|
||||||
Dim lStartDate As Long = 0
|
|
||||||
GetMainPrivateProfileString(S_OPENFILEDIALOG, 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_OPENFILEDIALOG, 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
|
|
||||||
m_bViewArchived = GetMainPrivateProfileInt(S_OPENFILEDIALOG, K_VIEWARCHIVED, 0) <> 0
|
|
||||||
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()
|
|
||||||
'If ProjectType = ProjectType.PROJ Then
|
|
||||||
' carico le colonne della datagrid
|
|
||||||
' GetPrivateProfileColumns(S_OPENPROJFILEDLG_PROJ, ProjColumns)
|
|
||||||
' ' carico campi su cui eseguire il filtro di ricerca
|
|
||||||
' 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_NEWOPENPROJFILEDLG_PROD, ProdColumns)
|
|
||||||
' carico campi su cui eseguire il filtro di ricerca
|
|
||||||
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.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))
|
|
||||||
'End If
|
|
||||||
' setto la visibilità delle colonne delle EgtDataGrid
|
|
||||||
For Each col In ProjColumns
|
|
||||||
col.ColumnVisibility = If(col.Visible, Visibility.Visible, Visibility.Collapsed)
|
|
||||||
Next
|
|
||||||
For Each col In ProdColumns
|
|
||||||
col.ColumnVisibility = If(col.Visible, Visibility.Visible, Visibility.Collapsed)
|
|
||||||
Next
|
|
||||||
End Sub
|
|
||||||
|
|
||||||
Friend Function VerifySelected() As Boolean
|
|
||||||
If IsNothing(SelProject) Then Return False
|
|
||||||
Dim AllFilesInDir As IEnumerable(Of String) = Nothing
|
|
||||||
If m_ProjectType = Core.ConstBeam.ProjectType.PROJ Then
|
|
||||||
If Not IsNothing(SelProject.ProdFileVM) Then
|
|
||||||
If String.IsNullOrWhiteSpace(SelProject.ProdFileVM.sProdDirPath) OrElse Not Directory.Exists(SelProject.ProdFileVM.sProdDirPath) Then Return False
|
|
||||||
AllFilesInDir = Directory.EnumerateFiles(SelProject.ProdFileVM.sProdDirPath)
|
|
||||||
ElseIf SelProject.ProjFileList.Count > 0 Then
|
|
||||||
If String.IsNullOrWhiteSpace(SelProject.ProjFileList(0).sProjDirPath) OrElse Not Directory.Exists(SelProject.ProjFileList(0).sProjDirPath) Then Return False
|
|
||||||
AllFilesInDir = Directory.EnumerateFiles(SelProject.ProjFileList(0).sProjDirPath)
|
|
||||||
Else Return False
|
|
||||||
End If
|
|
||||||
ElseIf m_ProjectType = Core.ConstBeam.ProjectType.PROD Then
|
|
||||||
If String.IsNullOrWhiteSpace(SelProject.ProdFileVM.sProdDirPath) OrElse Not Directory.Exists(SelProject.ProdFileVM.sProdDirPath) Then Return False
|
|
||||||
AllFilesInDir = Directory.EnumerateFiles(SelProject.ProdFileVM.sProdDirPath)
|
|
||||||
Else
|
|
||||||
Return False
|
|
||||||
End If
|
|
||||||
Return AllFilesInDir.Any(Function(x) Path.GetExtension(x).ToLower() = ".nge")
|
|
||||||
End Function
|
|
||||||
|
|
||||||
Protected Function ProjectFilter(Proj As Object) As Boolean
|
|
||||||
Dim bProjectOk As Boolean = True
|
|
||||||
'If TypeOf Proj Is ProjFileVM Then
|
|
||||||
Dim CurrProj As ProdItem = DirectCast(Proj, ProdItem)
|
|
||||||
If m_SelFilterType.Id <> FilterTypes.NULL AndAlso (
|
|
||||||
(m_SelFilterType.Id = BTLDateTypes.EXPORTDATE AndAlso Not CurrProj.ProjFileList.Any(Function(x) SearchDate.Contains(DirectCast(x, ProjFileVM).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.BTLFILENAME AndAlso CurrProj.ProjFileList.Any(Function(x) DirectCast(x, ProjFileVM).sBTLFileName.IndexOf(SearchText, StringComparison.InvariantCultureIgnoreCase) < 0)) OrElse
|
|
||||||
(m_SelFilterType.Id = FilterTypes.LISTNAME AndAlso CurrProj.ProjFileList.Any(Function(x) DirectCast(x, ProjFileVM).sListName.IndexOf(SearchText, StringComparison.InvariantCultureIgnoreCase) < 0)) OrElse
|
|
||||||
(m_SelFilterType.Id = FilterTypes.MACHINE AndAlso CurrProj.sMachine.IndexOf(SearchText, StringComparison.InvariantCultureIgnoreCase) < 0)) Then bProjectOk = False
|
|
||||||
'ElseIf TypeOf Proj Is ProdFileVM Then
|
|
||||||
' Dim CurrProj As ProdFileVM = DirectCast(Proj, ProdFileVM)
|
|
||||||
' 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
|
|
||||||
|
|
||||||
Protected Sub CloseWindow(bDialogResult As Boolean)
|
|
||||||
RaiseEvent m_CloseWindow(bDialogResult)
|
|
||||||
End Sub
|
|
||||||
|
|
||||||
#End Region ' METHODS
|
|
||||||
|
|
||||||
#Region "COMMANDS"
|
|
||||||
|
|
||||||
#Region "ProjectDoubleClick"
|
|
||||||
|
|
||||||
''' <summary>
|
|
||||||
''' Returns a command that do New.
|
|
||||||
''' </summary>
|
|
||||||
Public ReadOnly Property ProjectDoubleClick_Command As ICommand
|
|
||||||
Get
|
|
||||||
If m_cmdProjectDoubleClick Is Nothing Then
|
|
||||||
m_cmdProjectDoubleClick = New Command(AddressOf ProjDoubleClick)
|
|
||||||
End If
|
|
||||||
Return m_cmdProjectDoubleClick
|
|
||||||
End Get
|
|
||||||
End Property
|
|
||||||
|
|
||||||
''' <summary>
|
|
||||||
''' Execute the New. This method is invoked by the NewCommand.
|
|
||||||
''' </summary>
|
|
||||||
Friend Sub ProjDoubleClick()
|
|
||||||
' verifico se non e' attivo edit del nome
|
|
||||||
If bIsEditNameActive Then Return
|
|
||||||
' verifico validita' selezionato
|
|
||||||
If VerifySelected() Then
|
|
||||||
RaiseEvent m_CloseWindow(True)
|
|
||||||
End If
|
|
||||||
End Sub
|
|
||||||
|
|
||||||
#End Region ' ProjectDoubleClick
|
|
||||||
|
|
||||||
#Region "Archive"
|
|
||||||
|
|
||||||
''' <summary>
|
|
||||||
''' Returns a command that do New.
|
|
||||||
''' </summary>
|
|
||||||
Public ReadOnly Property Archive_Command As ICommand
|
|
||||||
Get
|
|
||||||
If m_cmdArchive Is Nothing Then
|
|
||||||
m_cmdArchive = New Command(AddressOf Archive)
|
|
||||||
End If
|
|
||||||
Return m_cmdArchive
|
|
||||||
End Get
|
|
||||||
End Property
|
|
||||||
|
|
||||||
''' <summary>
|
|
||||||
''' Execute the New. This method is invoked by the NewCommand.
|
|
||||||
''' </summary>
|
|
||||||
Public Overridable Sub Archive()
|
|
||||||
End Sub
|
|
||||||
|
|
||||||
#End Region ' Archive
|
|
||||||
|
|
||||||
#Region "Delete"
|
|
||||||
|
|
||||||
''' <summary>
|
|
||||||
''' Returns a command that do New.
|
|
||||||
''' </summary>
|
|
||||||
Public ReadOnly Property Delete_Command As ICommand
|
|
||||||
Get
|
|
||||||
If m_cmdDelete Is Nothing Then
|
|
||||||
m_cmdDelete = New Command(AddressOf Delete)
|
|
||||||
End If
|
|
||||||
Return m_cmdDelete
|
|
||||||
End Get
|
|
||||||
End Property
|
|
||||||
|
|
||||||
''' <summary>
|
|
||||||
''' Execute the New. This method is invoked by the NewCommand.
|
|
||||||
''' </summary>
|
|
||||||
Public Overridable Sub Delete()
|
|
||||||
End Sub
|
|
||||||
|
|
||||||
#End Region ' Delete
|
|
||||||
|
|
||||||
#Region "Cancel"
|
|
||||||
|
|
||||||
''' <summary>
|
|
||||||
''' Returns a command that do New.
|
|
||||||
''' </summary>
|
|
||||||
Public ReadOnly Property Cancel_Command As ICommand
|
|
||||||
Get
|
|
||||||
If m_cmdCancel Is Nothing Then
|
|
||||||
m_cmdCancel = New Command(AddressOf Cancel)
|
|
||||||
End If
|
|
||||||
Return m_cmdCancel
|
|
||||||
End Get
|
|
||||||
End Property
|
|
||||||
|
|
||||||
''' <summary>
|
|
||||||
''' Execute the New. This method is invoked by the NewCommand.
|
|
||||||
''' </summary>
|
|
||||||
Public Overridable Sub Cancel()
|
|
||||||
End Sub
|
|
||||||
|
|
||||||
#End Region ' Cancel
|
|
||||||
|
|
||||||
#End Region ' Commands
|
|
||||||
|
|
||||||
End Class
|
|
||||||
|
|
||||||
Public Class ProdItem
|
|
||||||
Inherits VMBase
|
|
||||||
|
|
||||||
Public Shared m_delIsModifiedSetUp As Action(Of Boolean)
|
|
||||||
|
|
||||||
Protected m_ProdFileVM As ProdFileVM
|
|
||||||
Public ReadOnly Property ProdFileVM As ProdFileVM
|
|
||||||
Get
|
|
||||||
Return m_ProdFileVM
|
|
||||||
End Get
|
|
||||||
End Property
|
|
||||||
|
|
||||||
Private m_ProjFileList As New List(Of ProjectFileVM)
|
|
||||||
Public ReadOnly Property ProjFileList As List(Of ProjectFileVM)
|
|
||||||
Get
|
|
||||||
Return m_ProjFileList
|
|
||||||
End Get
|
|
||||||
End Property
|
|
||||||
|
|
||||||
Public ReadOnly Property sProdId As String
|
|
||||||
Get
|
|
||||||
Return If(Not IsNothing(m_ProdFileVM), m_ProdFileVM.sProdId, "")
|
|
||||||
End Get
|
|
||||||
End Property
|
|
||||||
|
|
||||||
Public Overridable Property sName As String
|
|
||||||
Get
|
|
||||||
Return If(Not IsNothing(m_ProdFileVM), m_ProdFileVM.sName, "")
|
|
||||||
End Get
|
|
||||||
Set(value As String)
|
|
||||||
If Not IsNothing(m_ProdFileVM) Then
|
|
||||||
m_ProdFileVM.sName = value
|
|
||||||
End If
|
|
||||||
End Set
|
|
||||||
End Property
|
|
||||||
|
|
||||||
Public ReadOnly Property dtCreateDate As Date
|
|
||||||
Get
|
|
||||||
Return If(Not IsNothing(m_ProdFileVM), {m_ProdFileVM.dtCreateDate, m_ProjFileList.Min(Function(x) x.dtCreateDate)}.Min(), m_ProjFileList.Min(Function(x) x.dtCreateDate))
|
|
||||||
End Get
|
|
||||||
End Property
|
|
||||||
Public ReadOnly Property sCreateDate As String
|
|
||||||
Get
|
|
||||||
Return dtCreateDate.ToString()
|
|
||||||
End Get
|
|
||||||
End Property
|
|
||||||
|
|
||||||
Public ReadOnly Property sMachine As String
|
|
||||||
Get
|
|
||||||
If Not IsNothing(m_ProdFileVM) Then
|
|
||||||
Return m_ProdFileVM.sMachine
|
|
||||||
ElseIf Not IsNothing(m_ProjFileList(0)) Then
|
|
||||||
Return m_ProjFileList(0).sMachine
|
|
||||||
Else Return ""
|
|
||||||
End If
|
|
||||||
End Get
|
|
||||||
End Property
|
|
||||||
|
|
||||||
Public ReadOnly Property bIsArchived As Boolean
|
|
||||||
Get
|
|
||||||
If Not IsNothing(m_ProdFileVM) Then
|
|
||||||
Return m_ProdFileVM.bIsArchived
|
|
||||||
ElseIf Not IsNothing(m_ProjFileList(0)) Then
|
|
||||||
Return m_ProjFileList(0).bIsArchived
|
|
||||||
Else
|
|
||||||
Return True
|
|
||||||
End If
|
|
||||||
End Get
|
|
||||||
End Property
|
|
||||||
|
|
||||||
Public ReadOnly Property Archived_Visibility As Visibility
|
|
||||||
Get
|
|
||||||
Return If(bIsArchived, Visibility.Visible, Visibility.Collapsed)
|
|
||||||
End Get
|
|
||||||
End Property
|
|
||||||
|
|
||||||
Sub New(ProdFileVM As ProdFileVM, ProjFileVM As ProjFileVM)
|
|
||||||
m_ProdFileVM = ProdFileVM
|
|
||||||
m_ProjFileList.Add(ProjFileVM)
|
|
||||||
End Sub
|
|
||||||
|
|
||||||
Sub New(ProjFileVM As ProjFileVM)
|
|
||||||
m_ProjFileList = New List(Of ProjectFileVM)({ProjFileVM})
|
|
||||||
End Sub
|
|
||||||
|
|
||||||
Sub New(ProdFileVM As ProjectFileVM, ProjFileVMList As List(Of ProjectFileVM))
|
|
||||||
m_ProdFileVM = ProdFileVM
|
|
||||||
m_ProjFileList = ProjFileVMList
|
|
||||||
End Sub
|
|
||||||
|
|
||||||
End Class
|
|
||||||
@@ -5,9 +5,9 @@
|
|||||||
xmlns:EgtBEAMWALL="clr-namespace:EgtBEAMWALL.Core"
|
xmlns:EgtBEAMWALL="clr-namespace:EgtBEAMWALL.Core"
|
||||||
Title="{Binding Title}"
|
Title="{Binding Title}"
|
||||||
Style="{DynamicResource {x:Type EgtWPFLib5:EgtCustomWindow}}"
|
Style="{DynamicResource {x:Type EgtWPFLib5:EgtCustomWindow}}"
|
||||||
WindowStyle="None" ResizeMode="NoResize" TitleBarHeight="30" IsResizable="True"
|
WindowStyle="None" ResizeMode="NoResize" TitleBarHeight="30" IsResizable="False"
|
||||||
IsMinimizable="False" WindowStartupLocation="CenterScreen" ShowInTaskbar="False"
|
IsMinimizable="False" WindowStartupLocation="CenterScreen" ShowInTaskbar="False"
|
||||||
MinHeight="500" MinWidth="500"
|
Height="500" Width="500" Topmost="True"
|
||||||
DataContext="{Binding RelativeSource={RelativeSource Self}}">
|
DataContext="{Binding RelativeSource={RelativeSource Self}}">
|
||||||
|
|
||||||
<EgtWPFLib5:EgtCustomWindow.Resources>
|
<EgtWPFLib5:EgtCustomWindow.Resources>
|
||||||
@@ -21,106 +21,42 @@
|
|||||||
<RowDefinition Height="1*"/>
|
<RowDefinition Height="1*"/>
|
||||||
</Grid.RowDefinitions>
|
</Grid.RowDefinitions>
|
||||||
|
|
||||||
<GroupBox Header="Filters"
|
<StackPanel>
|
||||||
Margin="5"
|
<Grid Grid.Row="0" Margin="5">
|
||||||
Visibility="{Binding Filters_Visibility}">
|
<Grid.RowDefinitions>
|
||||||
<Grid>
|
<RowDefinition Height="1*" />
|
||||||
<Grid.RowDefinitions>
|
<RowDefinition Height="1*" />
|
||||||
<RowDefinition Height="Auto"/>
|
</Grid.RowDefinitions>
|
||||||
<RowDefinition Height="Auto"/>
|
<Grid.ColumnDefinitions>
|
||||||
</Grid.RowDefinitions>
|
<ColumnDefinition Width="1*" />
|
||||||
<Grid>
|
<ColumnDefinition Width="1*" />
|
||||||
<Grid.ColumnDefinitions>
|
</Grid.ColumnDefinitions>
|
||||||
<ColumnDefinition Width="Auto"/>
|
|
||||||
<ColumnDefinition Width="1*"/>
|
|
||||||
</Grid.ColumnDefinitions>
|
|
||||||
<ComboBox ItemsSource="{Binding BTLDateTypeList}"
|
|
||||||
SelectedIndex="{Binding SelBTLDateType}"
|
|
||||||
Width="105"
|
|
||||||
Margin="5"
|
|
||||||
Style="{StaticResource FeatureComboBox}"/>
|
|
||||||
<StackPanel Grid.Column="1" Orientation="Horizontal">
|
|
||||||
<ComboBox ItemsSource="{Binding DayTypeList}"
|
|
||||||
SelectedIndex="{Binding SelDayType}"
|
|
||||||
Width="105"
|
|
||||||
Margin="0,0,2.5,0"
|
|
||||||
Style="{StaticResource PartParam_ComboBox}"/>
|
|
||||||
<StackPanel Orientation="Horizontal" Visibility="{Binding Date_Visibility}">
|
|
||||||
<TextBlock Text="{Binding From_Msg}"
|
|
||||||
Style="{StaticResource Filter_TextBlock}"/>
|
|
||||||
<DatePicker SelectedDate="{Binding dtStartDate}"
|
|
||||||
Style="{StaticResource Filter_DatePicker}"/>
|
|
||||||
<TextBlock Text="{Binding To_Msg}"
|
|
||||||
Style="{StaticResource Filter_TextBlock}"/>
|
|
||||||
<DatePicker SelectedDate="{Binding dtEndDate}"
|
|
||||||
Style="{StaticResource Filter_DatePicker}"/>
|
|
||||||
</StackPanel>
|
|
||||||
</StackPanel>
|
|
||||||
</Grid>
|
|
||||||
<Grid Grid.Row="1">
|
|
||||||
<Grid.ColumnDefinitions>
|
|
||||||
<ColumnDefinition Width="Auto"/>
|
|
||||||
<ColumnDefinition Width="1*"/>
|
|
||||||
<ColumnDefinition Width="Auto"/>
|
|
||||||
</Grid.ColumnDefinitions>
|
|
||||||
<ComboBox ItemsSource="{Binding FilterTypeList}"
|
|
||||||
SelectedItem="{Binding SelFilterType}"
|
|
||||||
Width="105"
|
|
||||||
Margin="5"
|
|
||||||
Style="{StaticResource FeatureComboBox}"/>
|
|
||||||
<EgtWPFLib5:EgtTextBox Grid.Column="1"
|
|
||||||
Text="{Binding SearchText}"
|
|
||||||
Margin="5"
|
|
||||||
Visibility="{Binding SearchText_Visibility}"/>
|
|
||||||
<StackPanel Grid.Column="2"
|
|
||||||
Orientation="Horizontal">
|
|
||||||
<TextBlock Text="Rows"
|
|
||||||
Style="{StaticResource OptionTextBlock}"/>
|
|
||||||
<ComboBox ItemsSource="{Binding RowQuantityList}"
|
|
||||||
SelectedIndex="{Binding SelRowQuantity}"
|
|
||||||
Style="{StaticResource FeatureComboBox}"/>
|
|
||||||
</StackPanel>
|
|
||||||
</Grid>
|
|
||||||
</Grid>
|
|
||||||
</GroupBox>
|
|
||||||
|
|
||||||
|
<TextBlock Text="{Binding FilterType_Msg}"
|
||||||
<!--<StackPanel>
|
|
||||||
<Grid Grid.Row="0" Margin="5">
|
|
||||||
<Grid.RowDefinitions>
|
|
||||||
<RowDefinition Height="1*" />
|
|
||||||
<RowDefinition Height="1*" />
|
|
||||||
</Grid.RowDefinitions>
|
|
||||||
<Grid.ColumnDefinitions>
|
|
||||||
<ColumnDefinition Width="1*" />
|
|
||||||
<ColumnDefinition Width="1*" />
|
|
||||||
</Grid.ColumnDefinitions>
|
|
||||||
|
|
||||||
<TextBlock Text="{Binding FilterType_Msg}"
|
|
||||||
Grid.Row="0" Grid.Column="0"
|
Grid.Row="0" Grid.Column="0"
|
||||||
Style="{StaticResource OptionTextBlock}"/>
|
Style="{StaticResource OptionTextBlock}"/>
|
||||||
<ComboBox ItemsSource="{Binding SearchColumnList}"
|
<ComboBox ItemsSource="{Binding SearchColumnList}"
|
||||||
SelectedItem="{Binding SelSearchColumn}"
|
SelectedItem="{Binding SelSearchColumn}"
|
||||||
Width="Auto"
|
Width="Auto"
|
||||||
Margin="5"
|
Margin="5"
|
||||||
Grid.Row="0" Grid.Column="1"
|
Grid.Row="0" Grid.Column="1"
|
||||||
Style="{StaticResource FeatureComboBox}"/>
|
Style="{StaticResource FeatureComboBox}"/>
|
||||||
<TextBlock Text="{Binding Search_Msg}"
|
<TextBlock Text="{Binding Search_Msg}"
|
||||||
Margin="0,5,0,0"
|
Margin="0,5,0,0"
|
||||||
Grid.Row="1" Grid.Column="0"
|
Grid.Row="1" Grid.Column="0"
|
||||||
Style="{StaticResource OptionTextBlock}"/>
|
Style="{StaticResource OptionTextBlock}"/>
|
||||||
<EgtWPFLib5:EgtTextBox Text="{Binding SearchText}"
|
<EgtWPFLib5:EgtTextBox Text="{Binding SearchText}"
|
||||||
Margin="5"
|
Margin="5"
|
||||||
Grid.Row="1" Grid.Column="1"
|
Grid.Row="1" Grid.Column="1"
|
||||||
Visibility="{Binding SearchText_Visibility}"/>
|
Visibility="{Binding SearchText_Visibility}"/>
|
||||||
<Calendar SelectedDatesChanged="Calendar_SelectedDatesChanged"
|
<Calendar SelectedDatesChanged="Calendar_SelectedDatesChanged"
|
||||||
SelectionMode="MultipleRange"
|
SelectionMode="MultipleRange"
|
||||||
Grid.Row="1" Grid.Column="1"
|
Grid.Row="1" Grid.Column="1"
|
||||||
Visibility="{Binding SearchDate_Visibility}"/>
|
Visibility="{Binding SearchDate_Visibility}"/>
|
||||||
</Grid>
|
</Grid>
|
||||||
</StackPanel>-->
|
</StackPanel>
|
||||||
|
|
||||||
<EgtBEAMWALL:EgtDataGrid Grid.Row="1"
|
<EgtBEAMWALL:EgtDataGrid Grid.Row="1"
|
||||||
ItemsSource="{Binding ProjectList}"
|
ItemsSource="{Binding ProjectList}"
|
||||||
SelectedItem="{Binding SelProject}"
|
SelectedItem="{Binding SelProject}"
|
||||||
CanUserAddRows="False"
|
CanUserAddRows="False"
|
||||||
@@ -149,14 +85,6 @@
|
|||||||
</DataTemplate>
|
</DataTemplate>
|
||||||
</DataGridTextColumn.HeaderTemplate>
|
</DataGridTextColumn.HeaderTemplate>
|
||||||
</DataGridTextColumn>
|
</DataGridTextColumn>
|
||||||
<!-- Project Name -->
|
|
||||||
<DataGridTextColumn x:Key="colPROJNAME" Binding="{Binding sDescription}">
|
|
||||||
<DataGridTextColumn.HeaderTemplate>
|
|
||||||
<DataTemplate>
|
|
||||||
<TextBlock Text="{Binding Path=DataContext.BTLFileName_Msg,RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OpenProjectFileDialogV}}}"/>
|
|
||||||
</DataTemplate>
|
|
||||||
</DataGridTextColumn.HeaderTemplate>
|
|
||||||
</DataGridTextColumn>
|
|
||||||
<!-- BTL FileName -->
|
<!-- BTL FileName -->
|
||||||
<DataGridTextColumn x:Key="colBTLNAME" Binding="{Binding sBTLFileName}">
|
<DataGridTextColumn x:Key="colBTLNAME" Binding="{Binding sBTLFileName}">
|
||||||
<DataGridTextColumn.HeaderTemplate>
|
<DataGridTextColumn.HeaderTemplate>
|
||||||
@@ -226,7 +154,6 @@
|
|||||||
</ListBox.ItemTemplate>-->
|
</ListBox.ItemTemplate>-->
|
||||||
<DataGrid.RowStyle>
|
<DataGrid.RowStyle>
|
||||||
<Style TargetType="DataGridRow">
|
<Style TargetType="DataGridRow">
|
||||||
<Setter Property="IsEnabled" Value="{Binding bIsEnabled}"/>
|
|
||||||
<EventSetter Event="MouseDoubleClick" Handler="ProjectList_MouseDoubleClick"/>
|
<EventSetter Event="MouseDoubleClick" Handler="ProjectList_MouseDoubleClick"/>
|
||||||
</Style>
|
</Style>
|
||||||
</DataGrid.RowStyle>
|
</DataGrid.RowStyle>
|
||||||
|
|||||||
@@ -5,8 +5,6 @@ Imports System.Windows.Controls
|
|||||||
Imports System.Windows.Input
|
Imports System.Windows.Input
|
||||||
Imports EgtBEAMWALL.Core.ConstBeam
|
Imports EgtBEAMWALL.Core.ConstBeam
|
||||||
Imports EgtUILib
|
Imports EgtUILib
|
||||||
Imports EgtWPFLib5
|
|
||||||
Imports EgtBEAMWALL
|
|
||||||
|
|
||||||
Public Class OpenProjectFileDialogV
|
Public Class OpenProjectFileDialogV
|
||||||
|
|
||||||
@@ -21,8 +19,6 @@ Public Class OpenProjectFileDialogV
|
|||||||
Me.DataContext = OpenProjFileDialogVM
|
Me.DataContext = OpenProjFileDialogVM
|
||||||
' Assegno al riferimento locale al VM il VM preso dal DataContext
|
' Assegno al riferimento locale al VM il VM preso dal DataContext
|
||||||
m_OpenProjFileDialogVM = OpenProjFileDialogVM
|
m_OpenProjFileDialogVM = OpenProjFileDialogVM
|
||||||
AddHandler Me.Loaded, AddressOf OpenProjectFileDialog_Loaded
|
|
||||||
AddHandler Me.Closing, AddressOf OpenProjectFileDialog_Closing
|
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
#End Region ' CONSTRUCTOR
|
#End Region ' CONSTRUCTOR
|
||||||
@@ -46,20 +42,6 @@ Public Class OpenProjectFileDialogV
|
|||||||
Return Me.ShowDialog()
|
Return Me.ShowDialog()
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
Private Sub OpenProjectFileDialog_Loaded(sender As Object, e As RoutedEventArgs)
|
|
||||||
' Carico e imposto posizione finestra
|
|
||||||
WinPosFromIniToWindow(S_OPENFILEDIALOG, K_VIEWOPTIMWINPLACE, Me)
|
|
||||||
End Sub
|
|
||||||
|
|
||||||
Private Sub OpenProjectFileDialog_Closing(sender As Object, e As System.ComponentModel.CancelEventArgs)
|
|
||||||
If (Keyboard.Modifiers And ModifierKeys.Alt) = ModifierKeys.Alt OrElse Keyboard.IsKeyDown(Key.F4) Then
|
|
||||||
e.Cancel = True
|
|
||||||
Return
|
|
||||||
End If
|
|
||||||
' Salvo posizione finestra (se non minimizzata)
|
|
||||||
WinPosFromWindowToIni(Me, S_OPENFILEDIALOG, K_VIEWOPTIMWINPLACE)
|
|
||||||
End Sub
|
|
||||||
|
|
||||||
#End Region ' METHODS
|
#End Region ' METHODS
|
||||||
|
|
||||||
#Region "EVENTS"
|
#Region "EVENTS"
|
||||||
@@ -78,4 +60,10 @@ Public Class OpenProjectFileDialogV
|
|||||||
Me.DialogResult = bDialogResult
|
Me.DialogResult = bDialogResult
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
|
Private Sub Calendar_SelectedDatesChanged(sender As Object, e As SelectionChangedEventArgs)
|
||||||
|
Dim cal As System.Windows.Controls.Calendar = sender
|
||||||
|
m_OpenProjFileDialogVM.m_SearchDate = cal.SelectedDates
|
||||||
|
m_OpenProjFileDialogVM.m_ProjectList_View.Refresh()
|
||||||
|
End Sub
|
||||||
|
|
||||||
End Class
|
End Class
|
||||||
@@ -14,32 +14,6 @@ Public MustInherit Class OpenProjectFileDialogVM
|
|||||||
|
|
||||||
#Region "FIELDS & PROPERTIES"
|
#Region "FIELDS & PROPERTIES"
|
||||||
|
|
||||||
Public Enum BTLDateTypes As Integer
|
|
||||||
CREATEDATE = 0
|
|
||||||
EXPORTDATE = 1
|
|
||||||
End Enum
|
|
||||||
|
|
||||||
Private Enum FilterTypes As Integer
|
|
||||||
NULL = 0
|
|
||||||
ID = 1
|
|
||||||
BTLFILENAME = 2
|
|
||||||
LISTNAME = 3
|
|
||||||
MACHINE = 4
|
|
||||||
End Enum
|
|
||||||
|
|
||||||
Public Enum DayTypes As Integer
|
|
||||||
LASTMONTH = 0
|
|
||||||
LAST3MONTHS = 1
|
|
||||||
LAST6MONTHS = 2
|
|
||||||
PERIOD = 3
|
|
||||||
End Enum
|
|
||||||
|
|
||||||
Public Enum RowQuantities As Integer
|
|
||||||
FIFTY = 0
|
|
||||||
HUNDRED = 1
|
|
||||||
HUNDREDANDFIFTY = 2
|
|
||||||
End Enum
|
|
||||||
|
|
||||||
Friend Event m_CloseWindow(bDialogResult As Boolean)
|
Friend Event m_CloseWindow(bDialogResult As Boolean)
|
||||||
|
|
||||||
Protected m_ProjectColumns As New ObservableCollection(Of EgtDataGridColumn)
|
Protected m_ProjectColumns As New ObservableCollection(Of EgtDataGridColumn)
|
||||||
@@ -109,148 +83,18 @@ Public MustInherit Class OpenProjectFileDialogVM
|
|||||||
End Set
|
End Set
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
Private m_bFixedProjectList As Boolean
|
|
||||||
Public ReadOnly Property bFixedProjectList As Boolean
|
|
||||||
Get
|
|
||||||
Return m_bFixedProjectList
|
|
||||||
End Get
|
|
||||||
End Property
|
|
||||||
Public Sub SetFixedProjectList(bValue As Boolean)
|
|
||||||
m_bFixedProjectList = bValue
|
|
||||||
NotifyPropertyChanged(NameOf(Filters_Visibility))
|
|
||||||
End Sub
|
|
||||||
|
|
||||||
Public ReadOnly Property Filters_Visibility As Visibility
|
|
||||||
Get
|
|
||||||
Return If(m_bFixedProjectList, Visibility.Collapsed, Visibility.Visible)
|
|
||||||
End Get
|
|
||||||
End Property
|
|
||||||
|
|
||||||
Protected m_BTLDateTypeList As New List(Of String)
|
|
||||||
Public ReadOnly Property BTLDateTypeList As List(Of String)
|
|
||||||
Get
|
|
||||||
Return m_BTLDateTypeList
|
|
||||||
End Get
|
|
||||||
End Property
|
|
||||||
|
|
||||||
Protected m_SelBTLDateType As BTLDateTypes = Nothing
|
|
||||||
Public Property SelBTLDateType As Integer
|
|
||||||
Get
|
|
||||||
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)({EgtMsg(62532), EgtMsg(62533), EgtMsg(62534), 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(30.5)
|
|
||||||
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_OPENFILEDIALOG, 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_OPENFILEDIALOG, 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
|
' lista campi per ricerca testuale e con datepicker
|
||||||
Protected m_FilterTypeList As New ObservableCollection(Of IdNameStruct)
|
Protected m_SearchColumnList As New ObservableCollection(Of IdNameStruct)
|
||||||
Public ReadOnly Property FilterTypeList As ObservableCollection(Of IdNameStruct)
|
Public ReadOnly Property SearchColumnList As ObservableCollection(Of IdNameStruct)
|
||||||
Get
|
Get
|
||||||
Return m_FilterTypeList
|
Return m_SearchColumnList
|
||||||
End Get
|
End Get
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
Protected m_SelFilterType As IdNameStruct = Nothing
|
Protected m_SelSearchColumn As IdNameStruct = Nothing
|
||||||
Public Property SelFilterType As IdNameStruct
|
Public Property SelSearchColumn As IdNameStruct
|
||||||
Get
|
Get
|
||||||
Return m_SelFilterType
|
Return m_SelSearchColumn
|
||||||
End Get
|
End Get
|
||||||
Set(value As IdNameStruct)
|
Set(value As IdNameStruct)
|
||||||
' resetto il contenuto della barra di ricerca testuale
|
' resetto il contenuto della barra di ricerca testuale
|
||||||
@@ -259,15 +103,15 @@ Public MustInherit Class OpenProjectFileDialogVM
|
|||||||
' resetto le selezioni sul calendario
|
' resetto le selezioni sul calendario
|
||||||
If Not IsNothing(SearchDate) Then SearchDate.Clear()
|
If Not IsNothing(SearchDate) Then SearchDate.Clear()
|
||||||
' setto il Tipo Filtro a NULL e refresho la lista dei progetti (in modo da averli visibili tutti)
|
' setto il Tipo Filtro a NULL e refresho la lista dei progetti (in modo da averli visibili tutti)
|
||||||
m_SelFilterType = m_FilterTypeList(0)
|
m_SelSearchColumn = m_SearchColumnList(0)
|
||||||
m_ProjectList_View.Refresh()
|
m_ProjectList_View.Refresh()
|
||||||
' ora setto il valore scelto come Tipo Filtro
|
' ora setto il valore scelto come Tipo Filtro
|
||||||
m_SelFilterType = value
|
m_SelSearchColumn = value
|
||||||
Select Case m_SelFilterType.Id
|
Select Case m_SelSearchColumn.Id
|
||||||
Case FilterTypes.ID, FilterTypes.BTLFILENAME, FilterTypes.LISTNAME, FilterTypes.MACHINE
|
Case OpenProjFileColumn.ID, OpenProjFileColumn.BTLFILENAME, OpenProjFileColumn.LISTNAME, OpenProjFileColumn.MACHINE
|
||||||
SearchText_Visibility = Visibility.Visible
|
SearchText_Visibility = Visibility.Visible
|
||||||
SearchDate_Visibility = Visibility.Collapsed
|
SearchDate_Visibility = Visibility.Collapsed
|
||||||
Case BTLDateTypes.EXPORTDATE, BTLDateTypes.CREATEDATE
|
Case OpenProjFileColumn.EXPORTDATE, OpenProjFileColumn.CREATEDATE
|
||||||
SearchText_Visibility = Visibility.Collapsed
|
SearchText_Visibility = Visibility.Collapsed
|
||||||
SearchDate_Visibility = Visibility.Visible
|
SearchDate_Visibility = Visibility.Visible
|
||||||
Case Else
|
Case Else
|
||||||
@@ -317,13 +161,18 @@ Public MustInherit Class OpenProjectFileDialogVM
|
|||||||
End Set
|
End Set
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
|
Public Enum OpenProjFileColumn As Integer
|
||||||
|
NULL = 0
|
||||||
|
ID = 1
|
||||||
|
BTLFILENAME = 2
|
||||||
|
LISTNAME = 3
|
||||||
|
EXPORTDATE = 4
|
||||||
|
CREATEDATE = 5
|
||||||
|
MACHINE = 6
|
||||||
|
End Enum
|
||||||
|
|
||||||
#Region "Messages"
|
#Region "Messages"
|
||||||
|
|
||||||
Public ReadOnly Property Title As String
|
|
||||||
Get
|
|
||||||
Return "Open Project"
|
|
||||||
End Get
|
|
||||||
End Property
|
|
||||||
Public ReadOnly Property FilterType_Msg As String
|
Public ReadOnly Property FilterType_Msg As String
|
||||||
Get
|
Get
|
||||||
Return EgtMsg(61836)
|
Return EgtMsg(61836)
|
||||||
@@ -387,18 +236,6 @@ Public MustInherit Class OpenProjectFileDialogVM
|
|||||||
End Get
|
End Get
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
Public ReadOnly Property From_Msg As String
|
|
||||||
Get
|
|
||||||
Return EgtMsg(62523)
|
|
||||||
End Get
|
|
||||||
End Property
|
|
||||||
|
|
||||||
Public ReadOnly Property To_Msg As String
|
|
||||||
Get
|
|
||||||
Return EgtMsg(62524)
|
|
||||||
End Get
|
|
||||||
End Property
|
|
||||||
|
|
||||||
#End Region
|
#End Region
|
||||||
|
|
||||||
' Definizione comandi
|
' Definizione comandi
|
||||||
@@ -407,70 +244,31 @@ Public MustInherit Class OpenProjectFileDialogVM
|
|||||||
|
|
||||||
#End Region ' FIELDS & PROPERTIES
|
#End Region ' FIELDS & PROPERTIES
|
||||||
|
|
||||||
Sub New()
|
|
||||||
' leggo valori per filtri
|
|
||||||
m_SelDayType = GetMainPrivateProfileInt(S_OPENFILEDIALOG, K_DAYTYPE, 0)
|
|
||||||
Select Case m_SelDayType
|
|
||||||
Case DayTypes.LASTMONTH
|
|
||||||
m_dtEndDate = DateTime.Today + TimeSpan.FromDays(1)
|
|
||||||
m_dtStartDate = m_dtEndDate - TimeSpan.FromDays(30.5)
|
|
||||||
Case DayTypes.LAST3MONTHS
|
|
||||||
m_dtEndDate = DateTime.Today + TimeSpan.FromDays(1)
|
|
||||||
m_dtStartDate = m_dtEndDate - TimeSpan.FromDays(30.5 * 3)
|
|
||||||
Case DayTypes.LAST6MONTHS
|
|
||||||
m_dtEndDate = DateTime.Today + TimeSpan.FromDays(1)
|
|
||||||
m_dtStartDate = m_dtEndDate - TimeSpan.FromDays(30.5 * 6)
|
|
||||||
Case DayTypes.PERIOD
|
|
||||||
Dim sStartDate As String = "0"
|
|
||||||
Dim lStartDate As Long = 0
|
|
||||||
GetMainPrivateProfileString(S_OPENFILEDIALOG, 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_OPENFILEDIALOG, 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
|
|
||||||
|
|
||||||
#Region "METHODS"
|
#Region "METHODS"
|
||||||
|
|
||||||
Public MustOverride Function Init(ProjectType As ProjectType, Optional CurrProjectList As List(Of ProjectFileVM) = Nothing, Optional GoToProd As Boolean = False) As Boolean?
|
Public MustOverride Function Init(ProjectType As ProjectType, Optional CurrProjectList As List(Of ProjectFileVM) = Nothing, Optional GoToProd As Boolean = False) As Boolean?
|
||||||
Public Overridable Sub RefreshProjectList(Optional GoToProd As Boolean = False)
|
|
||||||
End Sub
|
|
||||||
|
|
||||||
Protected Sub LoadColumns(ProjectType As ProjectType)
|
Protected Sub LoadColumns(ProjectType As ProjectType)
|
||||||
If ProjectType = ProjectType.PROJ Then
|
If ProjectType = ProjectType.PROJ Then
|
||||||
' carico le colonne della datagrid
|
' carico le colonne della datagrid
|
||||||
GetPrivateProfileColumns(S_OPENPROJFILEDLG_PROJ, ProjectColumns)
|
GetPrivateProfileColumns(S_OPENPROJFILEDLG_PROJ, ProjectColumns)
|
||||||
' carico campi su cui eseguire il filtro di ricerca
|
' carico campi su cui eseguire il filtro di ricerca
|
||||||
m_BTLDateTypeList = New List(Of String)({CreateDate_Msg, ExportDate_Msg})
|
m_SearchColumnList = New ObservableCollection(Of IdNameStruct)({New IdNameStruct(OpenProjFileColumn.NULL, ""),
|
||||||
m_SelBTLDateType = BTLDateTypes.CREATEDATE
|
New IdNameStruct(OpenProjFileColumn.ID, Id_Msg),
|
||||||
NotifyPropertyChanged(NameOf(BTLDateTypeList))
|
New IdNameStruct(OpenProjFileColumn.BTLFILENAME, BTLFileName_Msg),
|
||||||
NotifyPropertyChanged(NameOf(SelBTLDateType))
|
New IdNameStruct(OpenProjFileColumn.LISTNAME, ListName_Msg),
|
||||||
m_FilterTypeList = New ObservableCollection(Of IdNameStruct)({New IdNameStruct(FilterTypes.NULL, ""),
|
New IdNameStruct(OpenProjFileColumn.EXPORTDATE, ExportDate_Msg),
|
||||||
New IdNameStruct(FilterTypes.ID, Id_Msg),
|
New IdNameStruct(OpenProjFileColumn.CREATEDATE, CreateDate_Msg),
|
||||||
New IdNameStruct(FilterTypes.BTLFILENAME, BTLFileName_Msg),
|
New IdNameStruct(OpenProjFileColumn.MACHINE, Machine_Msg)})
|
||||||
New IdNameStruct(FilterTypes.LISTNAME, ListName_Msg),
|
|
||||||
New IdNameStruct(FilterTypes.MACHINE, Machine_Msg)})
|
|
||||||
m_SelFilterType = m_FilterTypeList.FirstOrDefault(Function(x) x.Id = FilterTypes.NULL)
|
|
||||||
NotifyPropertyChanged(NameOf(SelFilterType))
|
|
||||||
ElseIf ProjectType = ProjectType.PROD Then
|
ElseIf ProjectType = ProjectType.PROD Then
|
||||||
' carico le colonne della datagrid
|
' carico le colonne della datagrid
|
||||||
GetPrivateProfileColumns(S_OPENPROJFILEDLG_PROD, ProjectColumns)
|
GetPrivateProfileColumns(S_OPENPROJFILEDLG_PROD, ProjectColumns)
|
||||||
' carico campi su cui eseguire il filtro di ricerca
|
' carico campi su cui eseguire il filtro di ricerca
|
||||||
m_BTLDateTypeList = New List(Of String)({CreateDate_Msg})
|
m_SearchColumnList = New ObservableCollection(Of IdNameStruct)({New IdNameStruct(OpenProjFileColumn.NULL, ""),
|
||||||
m_SelBTLDateType = BTLDateTypes.CREATEDATE
|
New IdNameStruct(OpenProjFileColumn.ID, Id_Msg),
|
||||||
NotifyPropertyChanged(NameOf(BTLDateTypeList))
|
New IdNameStruct(OpenProjFileColumn.BTLFILENAME, BTLFileName_Msg),
|
||||||
NotifyPropertyChanged(NameOf(SelBTLDateType))
|
New IdNameStruct(OpenProjFileColumn.CREATEDATE, CreateDate_Msg),
|
||||||
m_FilterTypeList = New ObservableCollection(Of IdNameStruct)({New IdNameStruct(FilterTypes.NULL, ""),
|
New IdNameStruct(OpenProjFileColumn.MACHINE, Machine_Msg)})
|
||||||
New IdNameStruct(FilterTypes.ID, Id_Msg),
|
|
||||||
New IdNameStruct(FilterTypes.BTLFILENAME, BTLFileName_Msg),
|
|
||||||
New IdNameStruct(FilterTypes.MACHINE, Machine_Msg)})
|
|
||||||
m_SelFilterType = m_FilterTypeList.FirstOrDefault(Function(x) x.Id = FilterTypes.NULL)
|
|
||||||
NotifyPropertyChanged(NameOf(SelFilterType))
|
|
||||||
End If
|
End If
|
||||||
' setto la visibilità delle colonne delle EgtDataGrid
|
' setto la visibilità delle colonne delle EgtDataGrid
|
||||||
For Each col In ProjectColumns
|
For Each col In ProjectColumns
|
||||||
@@ -480,16 +278,12 @@ Public MustInherit Class OpenProjectFileDialogVM
|
|||||||
|
|
||||||
Friend Function VerifySelected() As Boolean
|
Friend Function VerifySelected() As Boolean
|
||||||
If IsNothing(SelProject) Then Return False
|
If IsNothing(SelProject) Then Return False
|
||||||
Dim AllFilesInDir As IEnumerable(Of String) = Nothing
|
Dim AllFilesInDir As IEnumerable(Of String)
|
||||||
If m_ProjectType = Core.ConstBeam.ProjectType.PROJ Then
|
If m_ProjectType = Core.ConstBeam.ProjectType.PROJ Then
|
||||||
If String.IsNullOrWhiteSpace(SelProject.sProjDirPath) OrElse Not Directory.Exists(SelProject.sProjDirPath) Then Return False
|
|
||||||
' verifico se esiste ProdId
|
' verifico se esiste ProdId
|
||||||
AllFilesInDir = Directory.EnumerateFiles(SelProject.sProjDirPath)
|
AllFilesInDir = IO.Directory.EnumerateFiles(SelProject.sProjDirPath)
|
||||||
ElseIf m_ProjectType = Core.ConstBeam.ProjectType.PROD Then
|
ElseIf m_ProjectType = Core.ConstBeam.ProjectType.PROD Then
|
||||||
If String.IsNullOrWhiteSpace(SelProject.sProdDirPath) OrElse Not Directory.Exists(SelProject.sProdDirPath) Then Return False
|
AllFilesInDir = IO.Directory.EnumerateFiles(SelProject.sProdDirPath)
|
||||||
AllFilesInDir = Directory.EnumerateFiles(SelProject.sProdDirPath)
|
|
||||||
Else
|
|
||||||
Return False
|
|
||||||
End If
|
End If
|
||||||
For Each File In AllFilesInDir
|
For Each File In AllFilesInDir
|
||||||
If Path.GetExtension(File).ToLower() = ".nge" Then
|
If Path.GetExtension(File).ToLower() = ".nge" Then
|
||||||
@@ -503,22 +297,22 @@ Public MustInherit Class OpenProjectFileDialogVM
|
|||||||
Dim bProjectOk As Boolean = True
|
Dim bProjectOk As Boolean = True
|
||||||
If m_ProjectType = ProjectType.PROJ Then
|
If m_ProjectType = ProjectType.PROJ Then
|
||||||
Dim CurrProj As ProjFileVM = DirectCast(Proj, ProjFileVM)
|
Dim CurrProj As ProjFileVM = DirectCast(Proj, ProjFileVM)
|
||||||
If m_SelFilterType.Id <> FilterTypes.NULL AndAlso (
|
If m_SelSearchColumn.Id <> OpenProjFileColumn.NULL AndAlso (
|
||||||
(m_SelFilterType.Id = BTLDateTypes.EXPORTDATE AndAlso Not SearchDate.Contains(CurrProj.dtExportDate.Date)) OrElse
|
(m_SelSearchColumn.Id = OpenProjFileColumn.EXPORTDATE AndAlso Not SearchDate.Contains(CurrProj.dtExportDate.Date)) OrElse
|
||||||
(m_SelFilterType.Id = BTLDateTypes.CREATEDATE AndAlso Not SearchDate.Contains(CurrProj.dtCreateDate.Date))) Then bProjectOk = False
|
(m_SelSearchColumn.Id = OpenProjFileColumn.CREATEDATE AndAlso Not SearchDate.Contains(CurrProj.dtCreateDate.Date))) Then bProjectOk = False
|
||||||
If m_SelFilterType.Id <> FilterTypes.NULL AndAlso m_SearchText <> String.Empty AndAlso (
|
If m_SelSearchColumn.Id <> OpenProjFileColumn.NULL AndAlso m_SearchText <> String.Empty AndAlso (
|
||||||
(m_SelFilterType.Id = FilterTypes.ID AndAlso CurrProj.sProjId.ToString.IndexOf(SearchText, StringComparison.InvariantCultureIgnoreCase) < 0) OrElse
|
(m_SelSearchColumn.Id = OpenProjFileColumn.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_SelSearchColumn.Id = OpenProjFileColumn.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_SelSearchColumn.Id = OpenProjFileColumn.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
|
(m_SelSearchColumn.Id = OpenProjFileColumn.MACHINE AndAlso CurrProj.sMachine.IndexOf(SearchText, StringComparison.InvariantCultureIgnoreCase) < 0)) Then bProjectOk = False
|
||||||
ElseIf m_ProjectType = ProjectType.PROD Then
|
ElseIf m_ProjectType = ProjectType.PROD Then
|
||||||
Dim CurrProj As ProdFileVM = DirectCast(Proj, ProdFileVM)
|
Dim CurrProj As ProdFileVM = DirectCast(Proj, ProdFileVM)
|
||||||
If m_SelFilterType.Id <> FilterTypes.NULL AndAlso (
|
If m_SelSearchColumn.Id <> OpenProjFileColumn.NULL AndAlso (
|
||||||
(m_SelFilterType.Id = BTLDateTypes.CREATEDATE AndAlso Not SearchDate.Contains(CurrProj.dtCreateDate.Date))) Then bProjectOk = False
|
(m_SelSearchColumn.Id = OpenProjFileColumn.CREATEDATE AndAlso Not SearchDate.Contains(CurrProj.dtCreateDate.Date))) Then bProjectOk = False
|
||||||
If m_SelFilterType.Id <> FilterTypes.NULL AndAlso m_SearchText <> String.Empty AndAlso (
|
If m_SelSearchColumn.Id <> OpenProjFileColumn.NULL AndAlso m_SearchText <> String.Empty AndAlso (
|
||||||
(m_SelFilterType.Id = FilterTypes.ID AndAlso CurrProj.sProdId.ToString.IndexOf(SearchText, StringComparison.InvariantCultureIgnoreCase) < 0) OrElse
|
(m_SelSearchColumn.Id = OpenProjFileColumn.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_SelSearchColumn.Id = OpenProjFileColumn.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
|
(m_SelSearchColumn.Id = OpenProjFileColumn.MACHINE AndAlso CurrProj.sMachine.IndexOf(SearchText, StringComparison.InvariantCultureIgnoreCase) < 0)) Then bProjectOk = False
|
||||||
End If
|
End If
|
||||||
Return bProjectOk
|
Return bProjectOk
|
||||||
End Function
|
End Function
|
||||||
|
|||||||
@@ -10,28 +10,12 @@ Public Class ProdFileM
|
|||||||
Return m_nProjIdList
|
Return m_nProjIdList
|
||||||
End Get
|
End Get
|
||||||
End Property
|
End Property
|
||||||
Public Sub SetProjIdList(value As List(Of Integer))
|
|
||||||
m_nProjIdList = value
|
|
||||||
End Sub
|
|
||||||
|
|
||||||
Protected m_sName As String
|
Protected m_sName As String
|
||||||
Public Property sName As String
|
Public ReadOnly Property sName As String
|
||||||
Get
|
Get
|
||||||
Return m_sName
|
Return m_sName
|
||||||
End Get
|
End Get
|
||||||
Set(value As String)
|
|
||||||
m_sName = value
|
|
||||||
End Set
|
|
||||||
End Property
|
|
||||||
|
|
||||||
Protected m_bIsProduced As Boolean
|
|
||||||
Public Property bIsProduced As Boolean
|
|
||||||
Get
|
|
||||||
Return m_bIsProduced
|
|
||||||
End Get
|
|
||||||
Set(value As Boolean)
|
|
||||||
m_bIsProduced = value
|
|
||||||
End Set
|
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
#Region "CONSTRUCTORS"
|
#Region "CONSTRUCTORS"
|
||||||
@@ -43,8 +27,7 @@ Public Class ProdFileM
|
|||||||
Return New ProdFileM
|
Return New ProdFileM
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
Public Shared Function CreateProdFileM(nProdId As Integer, nProjIdList As List(Of Integer), dtCreateProjDate As DateTime, sName As String, nType As BWType,
|
Public Shared Function CreateProdFileM(nProdId As Integer, nProjIdList As List(Of Integer), dtCreateProjDate As DateTime, sName As String, nType As BWType, sMachine As String) As ProdFileM
|
||||||
sMachine As String, sLockedBy As String, dtLock As DateTime, bIsActive As Boolean, bIsProduced As Boolean, bIsArchived As Boolean) As ProdFileM
|
|
||||||
Dim NewProjectFileM As New ProdFileM
|
Dim NewProjectFileM As New ProdFileM
|
||||||
NewProjectFileM.m_nProdId = nProdId
|
NewProjectFileM.m_nProdId = nProdId
|
||||||
NewProjectFileM.m_nProjIdList = nProjIdList
|
NewProjectFileM.m_nProjIdList = nProjIdList
|
||||||
@@ -52,11 +35,6 @@ Public Class ProdFileM
|
|||||||
NewProjectFileM.m_sName = sName
|
NewProjectFileM.m_sName = sName
|
||||||
NewProjectFileM.m_nType = nType
|
NewProjectFileM.m_nType = nType
|
||||||
NewProjectFileM.m_sMachine = sMachine
|
NewProjectFileM.m_sMachine = sMachine
|
||||||
NewProjectFileM.m_sLockedBy = sLockedBy
|
|
||||||
NewProjectFileM.m_dtLock = dtLock
|
|
||||||
NewProjectFileM.m_bIsActive = bIsActive
|
|
||||||
NewProjectFileM.m_bIsProduced = bIsProduced
|
|
||||||
NewProjectFileM.m_bIsArchived = bIsArchived
|
|
||||||
Return NewProjectFileM
|
Return NewProjectFileM
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
|
|||||||
@@ -19,35 +19,26 @@ Public Class ProjFileM
|
|||||||
End Property
|
End Property
|
||||||
|
|
||||||
Protected m_sBTLFileName As String = String.Empty
|
Protected m_sBTLFileName As String = String.Empty
|
||||||
Public Property sBTLFileName As String
|
Public Property sBTLFileName As String
|
||||||
Get
|
Get
|
||||||
Return m_sBTLFileName
|
Return m_sBTLFileName
|
||||||
End Get
|
End Get
|
||||||
Set(value As String)
|
Set(value As String)
|
||||||
m_sBTLFileName = value
|
m_sBTLFileName = value
|
||||||
End Set
|
End Set
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
Protected m_sDescription As String = String.Empty
|
|
||||||
Public Property sDescription As String
|
|
||||||
Get
|
|
||||||
Return m_sDescription
|
|
||||||
End Get
|
|
||||||
Set(value As String)
|
|
||||||
m_sDescription = value
|
|
||||||
End Set
|
|
||||||
End Property
|
|
||||||
|
|
||||||
#Region "CONSTRUCTORS"
|
#Region "CONSTRUCTORS"
|
||||||
|
|
||||||
Protected Sub New()
|
Protected Sub New()
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Public Shared Function CreateNewProjFileM() As ProjFileM
|
Public Shared Function CreateNewProjFileM() As ProjFileM
|
||||||
Return New ProjFileM
|
Return New ProjFileM
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
Public Shared Function CreateProjFileM(nProjId As Integer, nProdId As Integer, dtCreateProjDate As DateTime, dtExportDate As DateTime, sListName As String, sBTLFileName As String, sDescription As String, IsNew As Boolean, IsLocked As Boolean, nType As BWType, sMachine As String, bIsActive As Boolean, bIsArchived As Boolean) As ProjFileM
|
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
|
Dim NewProjectFileM As New ProjFileM
|
||||||
NewProjectFileM.m_nProjId = nProjId
|
NewProjectFileM.m_nProjId = nProjId
|
||||||
NewProjectFileM.m_nProdId = nProdId
|
NewProjectFileM.m_nProdId = nProdId
|
||||||
@@ -55,13 +46,10 @@ Public Class ProjFileM
|
|||||||
NewProjectFileM.m_dtExportDate = dtExportDate
|
NewProjectFileM.m_dtExportDate = dtExportDate
|
||||||
NewProjectFileM.m_sListName = sListName
|
NewProjectFileM.m_sListName = sListName
|
||||||
NewProjectFileM.m_sBTLFileName = sBTLFileName
|
NewProjectFileM.m_sBTLFileName = sBTLFileName
|
||||||
NewProjectFileM.m_sDescription = sDescription
|
|
||||||
NewProjectFileM.m_bIsNew = IsNew
|
NewProjectFileM.m_bIsNew = IsNew
|
||||||
NewProjectFileM.m_bIsLocked = IsLocked
|
NewProjectFileM.m_bIsLocked = IsLocked
|
||||||
NewProjectFileM.m_nType = nType
|
NewProjectFileM.m_nType = nType
|
||||||
NewProjectFileM.m_sMachine = sMachine
|
NewProjectFileM.m_sMachine = sMachine
|
||||||
NewProjectFileM.m_bIsActive = bIsActive
|
|
||||||
NewProjectFileM.m_bIsArchived = bIsArchived
|
|
||||||
Return NewProjectFileM
|
Return NewProjectFileM
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
|
|||||||
@@ -74,46 +74,6 @@ Public Class ProjectFileM
|
|||||||
End Set
|
End Set
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
Protected m_sLockedBy As String
|
|
||||||
Public Property sLockedBy As String
|
|
||||||
Get
|
|
||||||
Return m_sLockedBy
|
|
||||||
End Get
|
|
||||||
Set(value As String)
|
|
||||||
m_sLockedBy = value
|
|
||||||
End Set
|
|
||||||
End Property
|
|
||||||
|
|
||||||
Protected m_dtLock As DateTime
|
|
||||||
Public Property dtLock As DateTime
|
|
||||||
Get
|
|
||||||
Return m_dtLock
|
|
||||||
End Get
|
|
||||||
Set(value As DateTime)
|
|
||||||
m_dtLock = value
|
|
||||||
End Set
|
|
||||||
End Property
|
|
||||||
|
|
||||||
Protected m_bIsActive As Boolean
|
|
||||||
Public Property bIsActive As Boolean
|
|
||||||
Get
|
|
||||||
Return m_bIsActive
|
|
||||||
End Get
|
|
||||||
Set(value As Boolean)
|
|
||||||
m_bIsActive = value
|
|
||||||
End Set
|
|
||||||
End Property
|
|
||||||
|
|
||||||
Protected m_bIsArchived As Boolean
|
|
||||||
Public Property bIsArchived As Boolean
|
|
||||||
Get
|
|
||||||
Return m_bIsArchived
|
|
||||||
End Get
|
|
||||||
Set(value As Boolean)
|
|
||||||
m_bIsArchived = value
|
|
||||||
End Set
|
|
||||||
End Property
|
|
||||||
|
|
||||||
#Region "CONSTRUCTORS"
|
#Region "CONSTRUCTORS"
|
||||||
|
|
||||||
#End Region ' CONSTRUCTORS
|
#End Region ' CONSTRUCTORS
|
||||||
|
|||||||
@@ -47,13 +47,10 @@ Public Class ProdFileVM
|
|||||||
End Set
|
End Set
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
Public Property sName As String
|
Public ReadOnly Property sName As String
|
||||||
Get
|
Get
|
||||||
Return ProdFileM.sName
|
Return ProdFileM.sName
|
||||||
End Get
|
End Get
|
||||||
Set(value As String)
|
|
||||||
ProdFileM.sName = value
|
|
||||||
End Set
|
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
Private m_sBTLFileName As String
|
Private m_sBTLFileName As String
|
||||||
@@ -66,12 +63,6 @@ Public Class ProdFileVM
|
|||||||
m_sBTLFileName = value
|
m_sBTLFileName = value
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Public ReadOnly Property bIsProduced As Boolean
|
|
||||||
Get
|
|
||||||
Return ProdFileM.bIsProduced
|
|
||||||
End Get
|
|
||||||
End Property
|
|
||||||
|
|
||||||
#Region "CONSTRUCTORS"
|
#Region "CONSTRUCTORS"
|
||||||
|
|
||||||
Sub New(ProdFileM As ProdFileM)
|
Sub New(ProdFileM As ProdFileM)
|
||||||
|
|||||||
@@ -68,12 +68,6 @@ Public Class ProjFileVM
|
|||||||
End Get
|
End Get
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
Public ReadOnly Property sDescription As String
|
|
||||||
Get
|
|
||||||
Return ProjFileM.sDescription
|
|
||||||
End Get
|
|
||||||
End Property
|
|
||||||
|
|
||||||
Public ReadOnly Property sListName As String
|
Public ReadOnly Property sListName As String
|
||||||
Get
|
Get
|
||||||
Return ProjFileM.sListName
|
Return ProjFileM.sListName
|
||||||
|
|||||||
@@ -117,18 +117,6 @@ Public Class ProjectFileVM
|
|||||||
End Get
|
End Get
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
Public ReadOnly Property bIsActive As Boolean
|
|
||||||
Get
|
|
||||||
Return m_ProjectFileM.bIsActive
|
|
||||||
End Get
|
|
||||||
End Property
|
|
||||||
|
|
||||||
Public ReadOnly Property bIsArchived As Boolean
|
|
||||||
Get
|
|
||||||
Return m_ProjectFileM.bIsArchived
|
|
||||||
End Get
|
|
||||||
End Property
|
|
||||||
|
|
||||||
#Region "Messages"
|
#Region "Messages"
|
||||||
|
|
||||||
Public ReadOnly Property Id_Msg As String
|
Public ReadOnly Property Id_Msg As String
|
||||||
|
|||||||
@@ -147,9 +147,9 @@ Public Module BTLIniFile
|
|||||||
Dim dMin As Double
|
Dim dMin As Double
|
||||||
Dim dMax As Double
|
Dim dMax As Double
|
||||||
Dim dDefault As Double
|
Dim dDefault As Double
|
||||||
StringToDoubleAdv(sBTLParamParams(2), dMin)
|
StringToDouble(sBTLParamParams(2), dMin)
|
||||||
StringToDoubleAdv(sBTLParamParams(3), dMax)
|
StringToDouble(sBTLParamParams(3), dMax)
|
||||||
StringToDoubleAdv(sBTLParamParams(4), dDefault)
|
StringToDouble(sBTLParamParams(4), dDefault)
|
||||||
Dim ParamType As BTLParamType
|
Dim ParamType As BTLParamType
|
||||||
If sBTLParamParams(0) = "d" Then
|
If sBTLParamParams(0) = "d" Then
|
||||||
ParamType = BTLParamType.DOUBLE_
|
ParamType = BTLParamType.DOUBLE_
|
||||||
@@ -159,7 +159,7 @@ Public Module BTLIniFile
|
|||||||
IpBTLParam = BTLParamM.CreateBTLParam(IpParentFeature, IsP, ParamType, sBTLParamParams(1), dMin, dMax, dDefault, sBTLParamParams(5))
|
IpBTLParam = BTLParamM.CreateBTLParam(IpParentFeature, IsP, ParamType, sBTLParamParams(1), dMin, dMax, dDefault, sBTLParamParams(5))
|
||||||
Return Not IsNothing(IpBTLParam)
|
Return Not IsNothing(IpBTLParam)
|
||||||
ElseIf sBTLParamParams(0) = "s" Then
|
ElseIf sBTLParamParams(0) = "s" Then
|
||||||
IpBTLParam = BTLParamM.CreateBTLParam(IpParentFeature, IsP, BTLParamType.STRING_, sBTLParamParams(1), sBTLParamParams(4), sBTLParamParams(5))
|
IpBTLParam = BTLParamM.CreateBTLParam(IpParentFeature, IsP, BTLParamType.STRING_, sBTLParamParams(1), sBTLParamParams(5))
|
||||||
Return Not IsNothing(IpBTLParam)
|
Return Not IsNothing(IpBTLParam)
|
||||||
ElseIf sBTLParamParams(0) = "c" Then
|
ElseIf sBTLParamParams(0) = "c" Then
|
||||||
Dim nMin As Integer
|
Dim nMin As Integer
|
||||||
@@ -200,9 +200,9 @@ Public Module BTLIniFile
|
|||||||
Dim dMin As Double
|
Dim dMin As Double
|
||||||
Dim dMax As Double
|
Dim dMax As Double
|
||||||
Dim dDefault As Double
|
Dim dDefault As Double
|
||||||
StringToDoubleAdv(sBTLParamParams(2), dMin)
|
StringToDouble(sBTLParamParams(2), dMin)
|
||||||
StringToDoubleAdv(sBTLParamParams(3), dMax)
|
StringToDouble(sBTLParamParams(3), dMax)
|
||||||
StringToDoubleAdv(sBTLParamParams(4), dDefault)
|
StringToDouble(sBTLParamParams(4), dDefault)
|
||||||
Dim ParamType As BTLParamType
|
Dim ParamType As BTLParamType
|
||||||
If sBTLParamParams(0) = "d" Then
|
If sBTLParamParams(0) = "d" Then
|
||||||
ParamType = BTLParamType.DOUBLE_
|
ParamType = BTLParamType.DOUBLE_
|
||||||
@@ -212,7 +212,7 @@ Public Module BTLIniFile
|
|||||||
IpBTLParam = BTLParamM.CreateBTLParam(IpParentFeature, IsP, ParamType, sBTLParamParams(1), dMin, dMax, dDefault, sBTLParamParams(5), sBWQParam)
|
IpBTLParam = BTLParamM.CreateBTLParam(IpParentFeature, IsP, ParamType, sBTLParamParams(1), dMin, dMax, dDefault, sBTLParamParams(5), sBWQParam)
|
||||||
Return Not IsNothing(IpBTLParam)
|
Return Not IsNothing(IpBTLParam)
|
||||||
ElseIf sBTLParamParams(0) = "s" Then
|
ElseIf sBTLParamParams(0) = "s" Then
|
||||||
IpBTLParam = BTLParamM.CreateBTLParam(IpParentFeature, IsP, BTLParamType.STRING_, sBTLParamParams(1), sBTLParamParams(4), sBTLParamParams(5), sBWQParam)
|
IpBTLParam = BTLParamM.CreateBTLParam(IpParentFeature, IsP, BTLParamType.STRING_, sBTLParamParams(1), sBTLParamParams(5), sBWQParam)
|
||||||
Return Not IsNothing(IpBTLParam)
|
Return Not IsNothing(IpBTLParam)
|
||||||
ElseIf sBTLParamParams(0) = "c" Then
|
ElseIf sBTLParamParams(0) = "c" Then
|
||||||
Dim nMin As Integer
|
Dim nMin As Integer
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ Public Module DimensionsIniFile
|
|||||||
Dim GridLenType As GridUnitType
|
Dim GridLenType As GridUnitType
|
||||||
Integer.TryParse(sValueParams(0), nDimIndex)
|
Integer.TryParse(sValueParams(0), nDimIndex)
|
||||||
Integer.TryParse(sValueParams(1), nDimType)
|
Integer.TryParse(sValueParams(1), nDimType)
|
||||||
StringToDoubleAdv(sValueParams(2), GridLenValue)
|
StringToDouble(sValueParams(2), GridLenValue)
|
||||||
Integer.TryParse(sValueParams(3), GridLenType)
|
Integer.TryParse(sValueParams(3), GridLenType)
|
||||||
GridDimsList.Add(New GridDimension(GridName, nDimIndex, nDimType, New GridLength(GridLenValue, GridLenType)))
|
GridDimsList.Add(New GridDimension(GridName, nDimIndex, nDimType, New GridLength(GridLenValue, GridLenType)))
|
||||||
End If
|
End If
|
||||||
|
|||||||
@@ -58,11 +58,9 @@ Public Enum StatusMapOpType
|
|||||||
SupervisorReleaseStop = 11
|
SupervisorReleaseStop = 11
|
||||||
ResetPartStart = 12
|
ResetPartStart = 12
|
||||||
ResetPartEnd = 13
|
ResetPartEnd = 13
|
||||||
SetPartScrapped = 14
|
ChangeProdInSupervisorRequest = 14
|
||||||
ChangeProdInSupervisorRequest = 15
|
ChangeProdInProdRequest = 15
|
||||||
ChangeProdInProdRequest = 16
|
OpenPageInViewOptimRequest = 16
|
||||||
OpenPageInViewOptimRequest = 17
|
|
||||||
MachGroupValidationUpdate = 18
|
|
||||||
End Enum
|
End Enum
|
||||||
|
|
||||||
Public Enum DimensionType
|
Public Enum DimensionType
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ Public Module LuaMsgManager
|
|||||||
If Not String.IsNullOrWhiteSpace(sMsg) Then
|
If Not String.IsNullOrWhiteSpace(sMsg) Then
|
||||||
Return sMsg
|
Return sMsg
|
||||||
Else
|
Else
|
||||||
Return EgtMsg(65000 + nMsg)
|
EgtMsg(65000 + nMsg)
|
||||||
End If
|
End If
|
||||||
Else
|
Else
|
||||||
Return EgtMsg(65000 + nMsg)
|
Return EgtMsg(65000 + nMsg)
|
||||||
@@ -25,7 +25,6 @@ Public Module LuaMsgManager
|
|||||||
Else
|
Else
|
||||||
Return LuaMsg
|
Return LuaMsg
|
||||||
End If
|
End If
|
||||||
Return ""
|
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
End Module
|
End Module
|
||||||
|
|||||||
@@ -2,19 +2,6 @@
|
|||||||
|
|
||||||
#Region "Private Fields"
|
#Region "Private Fields"
|
||||||
|
|
||||||
Public Enum MachLogTypes
|
|
||||||
PART_STATUS = 1
|
|
||||||
MACHGROUP_STATUS = 2
|
|
||||||
MACHINE_MODE = 3
|
|
||||||
MACHINE_STATUS = 4
|
|
||||||
MACHINE_COMMAND = 5
|
|
||||||
READ_VAR = 6
|
|
||||||
WRITE_VAR = 7
|
|
||||||
ALARM = 8
|
|
||||||
OPERATOR_MSG = 9
|
|
||||||
PROGRAM_SEND = 10
|
|
||||||
End Enum
|
|
||||||
|
|
||||||
Private m_AlarmCode As String
|
Private m_AlarmCode As String
|
||||||
Private m_AlarmDateTime As DateTime
|
Private m_AlarmDateTime As DateTime
|
||||||
Private m_AlarmMessage As String
|
Private m_AlarmMessage As String
|
||||||
@@ -24,73 +11,15 @@
|
|||||||
Private m_CommandState As CommandStates
|
Private m_CommandState As CommandStates
|
||||||
Private m_CommandType As LogCommandTypes
|
Private m_CommandType As LogCommandTypes
|
||||||
Private m_Description As String
|
Private m_Description As String
|
||||||
|
|
||||||
Private m_newOpState As Integer
|
Private m_newOpState As Integer
|
||||||
|
|
||||||
Private m_ResultType As ResultTypes
|
Private m_ResultType As ResultTypes
|
||||||
|
|
||||||
Private m_VarAddress As String
|
Private m_VarAddress As String
|
||||||
|
|
||||||
Private m_VarValue As String
|
Private m_VarValue As String
|
||||||
|
|
||||||
' variabili del log macchina
|
|
||||||
Public ReadOnly Property EventType As MachLogTypes
|
|
||||||
Get
|
|
||||||
Return m_ResultType
|
|
||||||
End Get
|
|
||||||
End Property
|
|
||||||
Public ReadOnly Property EventDateTime As DateTime
|
|
||||||
Get
|
|
||||||
Return m_AlarmDateTime
|
|
||||||
End Get
|
|
||||||
End Property
|
|
||||||
Public ReadOnly Property EventValue As String
|
|
||||||
Get
|
|
||||||
Return m_VarValue
|
|
||||||
End Get
|
|
||||||
End Property
|
|
||||||
|
|
||||||
Public ReadOnly Property sEventType As String
|
|
||||||
Get
|
|
||||||
Select Case m_ResultType
|
|
||||||
Case MachLogTypes.PART_STATUS
|
|
||||||
Return String.Format("({0}) Stato pezzo", 1)
|
|
||||||
Case MachLogTypes.MACHGROUP_STATUS
|
|
||||||
Return String.Format("({0}) Stato barra", 2)
|
|
||||||
Case MachLogTypes.MACHINE_MODE = 3
|
|
||||||
Return String.Format("({0}) Modalità macchina", 3)
|
|
||||||
Case MachLogTypes.MACHINE_STATUS = 4
|
|
||||||
Return String.Format("({0}) Stato macchina", 4)
|
|
||||||
Case MachLogTypes.MACHINE_COMMAND = 5
|
|
||||||
Return String.Format("({0}) Comando macchina", 5)
|
|
||||||
Case MachLogTypes.READ_VAR = 6
|
|
||||||
Return String.Format("({0}) Lettura variabile", 6)
|
|
||||||
Case MachLogTypes.WRITE_VAR = 7
|
|
||||||
Return String.Format("({0}) Scrittura variabile", 7)
|
|
||||||
Case MachLogTypes.ALARM = 8
|
|
||||||
Return String.Format("({0}) Allarme", 8)
|
|
||||||
Case MachLogTypes.OPERATOR_MSG = 9
|
|
||||||
Return String.Format("({0}) Messaggio opertore", 9)
|
|
||||||
Case MachLogTypes.PROGRAM_SEND = 10
|
|
||||||
Return String.Format("({0}) Invio programma", 10)
|
|
||||||
Case Else
|
|
||||||
Return "Altro"
|
|
||||||
End Select
|
|
||||||
End Get
|
|
||||||
End Property
|
|
||||||
Public ReadOnly Property sEventDateTime As String
|
|
||||||
Get
|
|
||||||
Return m_AlarmDateTime
|
|
||||||
End Get
|
|
||||||
End Property
|
|
||||||
Public ReadOnly Property sEventValue As String
|
|
||||||
Get
|
|
||||||
Return m_VarValue
|
|
||||||
End Get
|
|
||||||
End Property
|
|
||||||
|
|
||||||
Public ReadOnly Property sPROD As String
|
|
||||||
Get
|
|
||||||
Return m_VarValue
|
|
||||||
End Get
|
|
||||||
End Property
|
|
||||||
|
|
||||||
#End Region
|
#End Region
|
||||||
|
|
||||||
#Region "Protected Constructors"
|
#Region "Protected Constructors"
|
||||||
@@ -236,20 +165,11 @@
|
|||||||
Return NewMachLog
|
Return NewMachLog
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
Public Shared Function CreateMachLog(EventType As MachLogTypes, EventDateTime As DateTime, Value As String, SupervisorID As String)
|
|
||||||
Dim NewMachEvent As New MachLog
|
|
||||||
NewMachEvent.m_ResultType = EventType
|
|
||||||
NewMachEvent.m_AlarmDateTime = EventDateTime
|
|
||||||
NewMachEvent.m_VarValue = Value
|
|
||||||
NewMachEvent.m_VarAddress = SupervisorID
|
|
||||||
Return NewMachEvent
|
|
||||||
End Function
|
|
||||||
|
|
||||||
#End Region
|
#End Region
|
||||||
|
|
||||||
#Region "Public Methods"
|
#Region "Public Methods"
|
||||||
|
|
||||||
Public Shared Function CreateMachLog(AlarmCode As String, AlarmDateTime As Date, AlarmMessage As String, AlarmOperation As Integer, AlarmType As Integer, CommandExecutedCorrectly As Boolean, CommandState As CommandStates, CommandType As LogCommandTypes, Description As String, newOpState As Integer, ResultType As ResultTypes, VarAddress As String, VarValue As String) As MachLog
|
Public Shared Function CreateMacLog(AlarmCode As String, AlarmDateTime As Date, AlarmMessage As String, AlarmOperation As Integer, AlarmType As Integer, CommandExecutedCorrectly As Boolean, CommandState As CommandStates, CommandType As LogCommandTypes, Description As String, newOpState As Integer, ResultType As ResultTypes, VarAddress As String, VarValue As String) As MachLog
|
||||||
|
|
||||||
Dim NewMachLog As New MachLog
|
Dim NewMachLog As New MachLog
|
||||||
NewMachLog.m_AlarmCode = AlarmCode
|
NewMachLog.m_AlarmCode = AlarmCode
|
||||||
|
|||||||
@@ -15,80 +15,80 @@ Public Class ViewPanelVM
|
|||||||
' Posizione vista
|
' Posizione vista
|
||||||
Private Shared m_nViewDir As VT = VT.ISO_SW
|
Private Shared m_nViewDir As VT = VT.ISO_SW
|
||||||
|
|
||||||
Public Shared Sub BWSetView(nView As VT, Optional bRedraw As Boolean = True)
|
Public Shared Function BWSetView(nView As VT, Optional bRedraw As Boolean = True)
|
||||||
' condizioni che cambiano la vista del progetto
|
' condizioni che cambiano la vista del progetto
|
||||||
'Select Case m_Type
|
Select Case m_Type
|
||||||
' Case BWType.BEAM
|
Case BWType.BEAM
|
||||||
' Select Case nView
|
Select Case nView
|
||||||
' Case VT.TOP
|
Case VT.TOP
|
||||||
' EgtSetView(VT.TOP, bRedraw)
|
EgtSetView(VT.TOP, bRedraw)
|
||||||
' Case VT.FRONT
|
Case VT.FRONT
|
||||||
' EgtSetView(VT.FRONT, bRedraw)
|
EgtSetView(VT.FRONT, bRedraw)
|
||||||
' Case VT.BACK
|
Case VT.BACK
|
||||||
' EgtSetView(VT.BACK, bRedraw)
|
EgtSetView(VT.BACK, bRedraw)
|
||||||
' Case VT.RIGHT
|
Case VT.RIGHT
|
||||||
' EgtSetView(VT.RIGHT, bRedraw)
|
EgtSetView(VT.RIGHT, bRedraw)
|
||||||
' Case VT.LEFT
|
Case VT.LEFT
|
||||||
' EgtSetView(VT.LEFT, bRedraw)
|
EgtSetView(VT.LEFT, bRedraw)
|
||||||
' Case VT.ISO_SW
|
Case VT.ISO_SW
|
||||||
' EgtSetView(VT.ISO_SW, bRedraw)
|
EgtSetView(VT.ISO_SW, bRedraw)
|
||||||
' Case Else ' VT.ISO_SW
|
Case Else ' VT.ISO_SW
|
||||||
' EgtSetView(VT.ISO_SW, bRedraw)
|
EgtSetView(VT.ISO_SW, bRedraw)
|
||||||
' End Select
|
|
||||||
' Case BWType.WALL
|
|
||||||
Select Case nView
|
|
||||||
Case VT.TOP
|
|
||||||
Select Case m_nViewDir
|
|
||||||
Case VT.ISO_SW, VT.ISO_SE
|
|
||||||
EgtSetGenericView(0, -90, bRedraw) ' equivalente a vista TOP
|
|
||||||
Case VT.ISO_NW, VT.ISO_NE
|
|
||||||
EgtSetGenericView(0, 90, bRedraw) ' equivalente a vista TOP ruotata di 180 su Z
|
|
||||||
End Select
|
End Select
|
||||||
Case VT.FRONT
|
Case BWType.WALL
|
||||||
Select Case m_nViewDir
|
Select Case nView
|
||||||
Case VT.ISO_SW, VT.ISO_SE
|
Case VT.TOP
|
||||||
EgtSetGenericView(90, -90, bRedraw) ' equivalente a vista FRONT
|
Select Case m_nViewDir
|
||||||
Case VT.ISO_NW, VT.ISO_NE
|
Case VT.ISO_SW, VT.ISO_SE
|
||||||
EgtSetGenericView(90, 90, bRedraw) ' equivalente a vista FRONT ruotata di 180 su Z
|
EgtSetGenericView(0, -90, bRedraw) ' equivalente a vista TOP
|
||||||
End Select
|
Case VT.ISO_NW, VT.ISO_NE
|
||||||
Case VT.BACK
|
EgtSetGenericView(0, 90, bRedraw) ' equivalente a vista TOP ruotata di 180 su Z
|
||||||
Select Case m_nViewDir
|
End Select
|
||||||
Case VT.ISO_SW, VT.ISO_SE
|
Case VT.FRONT
|
||||||
EgtSetGenericView(-90, -90, bRedraw) ' equivalente a vista BACK
|
Select Case m_nViewDir
|
||||||
Case VT.ISO_NW, VT.ISO_NE
|
Case VT.ISO_SW, VT.ISO_SE
|
||||||
EgtSetGenericView(-90, 90, bRedraw) ' equivalente a vista BACK ruotata di 180 su Z
|
EgtSetGenericView(90, -90, bRedraw) ' equivalente a vista FRONT
|
||||||
End Select
|
Case VT.ISO_NW, VT.ISO_NE
|
||||||
Case VT.RIGHT
|
EgtSetGenericView(90, 90, bRedraw) ' equivalente a vista FRONT ruotata di 180 su Z
|
||||||
Select Case m_nViewDir
|
End Select
|
||||||
Case VT.ISO_SW, VT.ISO_SE
|
Case VT.BACK
|
||||||
EgtSetGenericView(90, 0, bRedraw) ' equivalente a vista RIGHT
|
Select Case m_nViewDir
|
||||||
Case VT.ISO_NW, VT.ISO_NE
|
Case VT.ISO_SW, VT.ISO_SE
|
||||||
EgtSetGenericView(-90, 0, bRedraw) ' equivalente a vista RIGHT ruotata di 180 su Z
|
EgtSetGenericView(-90, -90, bRedraw) ' equivalente a vista BACK
|
||||||
End Select
|
Case VT.ISO_NW, VT.ISO_NE
|
||||||
Case VT.LEFT
|
EgtSetGenericView(-90, 90, bRedraw) ' equivalente a vista BACK ruotata di 180 su Z
|
||||||
Select Case m_nViewDir
|
End Select
|
||||||
Case VT.ISO_SW, VT.ISO_SE
|
Case VT.RIGHT
|
||||||
EgtSetGenericView(-90, 0, bRedraw) ' equivalente a vista LEFT
|
Select Case m_nViewDir
|
||||||
Case VT.ISO_NW, VT.ISO_NE
|
Case VT.ISO_SW, VT.ISO_SE
|
||||||
EgtSetGenericView(90, 0, bRedraw) ' equivalente a vista LEFT ruotata di 180 su Z
|
EgtSetGenericView(90, 0, bRedraw) ' equivalente a vista RIGHT
|
||||||
End Select
|
Case VT.ISO_NW, VT.ISO_NE
|
||||||
Case VT.ISO_SW
|
EgtSetGenericView(-90, 0, bRedraw) ' equivalente a vista RIGHT ruotata di 180 su Z
|
||||||
Select Case m_nViewDir
|
End Select
|
||||||
Case VT.ISO_SW, VT.ISO_SE
|
Case VT.LEFT
|
||||||
EgtSetGenericView(60, 225, bRedraw) ' equivalente a vista ISO_SW
|
Select Case m_nViewDir
|
||||||
Case VT.ISO_NW, VT.ISO_NE
|
Case VT.ISO_SW, VT.ISO_SE
|
||||||
EgtSetGenericView(60, 45, bRedraw) ' equivalente a vista ISO_SW ruotata di 180 su Z
|
EgtSetGenericView(-90, 0, bRedraw) ' equivalente a vista LEFT
|
||||||
End Select
|
Case VT.ISO_NW, VT.ISO_NE
|
||||||
Case Else ' VT.ISO_SW
|
EgtSetGenericView(90, 0, bRedraw) ' equivalente a vista LEFT ruotata di 180 su Z
|
||||||
Select Case m_nViewDir
|
End Select
|
||||||
Case VT.ISO_SW, VT.ISO_SE
|
Case VT.ISO_SW
|
||||||
EgtSetGenericView(60, 225, bRedraw) ' equivalente a vista ISO_SW
|
Select Case m_nViewDir
|
||||||
Case VT.ISO_NW, VT.ISO_NE
|
Case VT.ISO_SW, VT.ISO_SE
|
||||||
EgtSetGenericView(60, 45, bRedraw) ' equivalente a vista ISO_SW ruotata di 180 su Z
|
EgtSetGenericView(60, 225, bRedraw) ' equivalente a vista ISO_SW
|
||||||
|
Case VT.ISO_NW, VT.ISO_NE
|
||||||
|
EgtSetGenericView(60, 45, bRedraw) ' equivalente a vista ISO_SW ruotata di 180 su Z
|
||||||
|
End Select
|
||||||
|
Case Else ' VT.ISO_SW
|
||||||
|
Select Case m_nViewDir
|
||||||
|
Case VT.ISO_SW, VT.ISO_SE
|
||||||
|
EgtSetGenericView(60, 225, bRedraw) ' equivalente a vista ISO_SW
|
||||||
|
Case VT.ISO_NW, VT.ISO_NE
|
||||||
|
EgtSetGenericView(60, 45, bRedraw) ' equivalente a vista ISO_SW ruotata di 180 su Z
|
||||||
|
End Select
|
||||||
End Select
|
End Select
|
||||||
End Select
|
End Select
|
||||||
'End Select
|
End Function
|
||||||
End Sub
|
|
||||||
|
|
||||||
Public Shared Sub UpdateMachParam(ViewDir As VT)
|
Public Shared Sub UpdateMachParam(ViewDir As VT)
|
||||||
m_nViewDir = ViewDir
|
m_nViewDir = ViewDir
|
||||||
|
|||||||
@@ -1,21 +1,26 @@
|
|||||||
using EgtBEAMWALL.DataLayer.DatabaseModels;
|
using System;
|
||||||
using EgtBEAMWALL.DataLayer.Migrations;
|
using System.Collections.Generic;
|
||||||
using MySql.Data.EntityFramework;
|
|
||||||
using System;
|
|
||||||
using System.Data.Entity;
|
using System.Data.Entity;
|
||||||
using System.Data.Entity.Migrations;
|
using System.Data.Entity.Migrations;
|
||||||
|
using MySql.Data.Entity;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using EgtBEAMWALL.DataLayer.DatabaseModels;
|
||||||
|
using EgtBEAMWALL.DataLayer.Migrations;
|
||||||
using System.ServiceProcess;
|
using System.ServiceProcess;
|
||||||
|
using System.IO;
|
||||||
|
using System.Data.Entity.Infrastructure;
|
||||||
|
|
||||||
namespace EgtBEAMWALL.DataLayer
|
namespace EgtBEAMWALL.DataLayer
|
||||||
{
|
{
|
||||||
[DbConfigurationType(typeof(MySqlEFConfiguration))]
|
[DbConfigurationType(typeof(MySqlEFConfiguration))]
|
||||||
|
//[DbConfigurationType(typeof(aMySqlConfiguration))]
|
||||||
public class AdminContext : DbContext
|
public class AdminContext : DbContext
|
||||||
{
|
{
|
||||||
#region Public Constructors
|
#region Public Constructors
|
||||||
|
|
||||||
[Obsolete("This constructor should never be used directly, and is only needed to generate entityframework stuff. Connection string can be adapted as pleased.")]
|
[Obsolete("This constructor should never be used directly, and is only needed to generate entityframework stuff. Connection string can be adapted as pleased.")]
|
||||||
public AdminContext() : base(DbConfig.ADMIN_CONNECTION_STRING)
|
public AdminContext() : base("DefaultConnection")
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -33,67 +38,5 @@ namespace EgtBEAMWALL.DataLayer
|
|||||||
public DbSet<UserPriv> UserList { get; set; }
|
public DbSet<UserPriv> UserList { get; set; }
|
||||||
|
|
||||||
#endregion Public Properties
|
#endregion Public Properties
|
||||||
|
|
||||||
#region Public Methods
|
|
||||||
|
|
||||||
public bool SetUpDbConnectionAndDbConfig()
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
String serviceName = getDbServiceName();
|
|
||||||
if (serviceName.Equals(""))
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
ServiceController service = new ServiceController(serviceName);
|
|
||||||
try
|
|
||||||
{
|
|
||||||
TimeSpan timeout = TimeSpan.FromSeconds(DbConfig.DATABASE_PROCESS_TIMEOUT);
|
|
||||||
service.WaitForStatus(ServiceControllerStatus.Running, timeout);
|
|
||||||
}
|
|
||||||
catch (Exception)
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
//Database.SetInitializer<DatabaseContext>(null);
|
|
||||||
Database.SetInitializer(new MigrateDatabaseToLatestVersion<DatabaseContext, Configuration>());
|
|
||||||
var migrator = new DbMigrator(new Configuration());
|
|
||||||
|
|
||||||
if (migrator.GetPendingMigrations().Any())
|
|
||||||
{
|
|
||||||
// Run migrations and seed.
|
|
||||||
migrator.Update();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
catch (Exception exc)
|
|
||||||
{
|
|
||||||
Console.WriteLine(exc.ToString());
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
#endregion Public Methods
|
|
||||||
|
|
||||||
#region Private Methods
|
|
||||||
|
|
||||||
private static string getDbServiceName()
|
|
||||||
{
|
|
||||||
ServiceController[] services = ServiceController.GetServices();
|
|
||||||
var service = services.FirstOrDefault(s => s.ServiceName == "MariaDB");
|
|
||||||
if (service != null)
|
|
||||||
return service.DisplayName;
|
|
||||||
|
|
||||||
service = services.FirstOrDefault(s => s.ServiceName == "MySQL");
|
|
||||||
if (service != null)
|
|
||||||
return service.DisplayName;
|
|
||||||
|
|
||||||
return "";
|
|
||||||
}
|
|
||||||
|
|
||||||
#endregion Private Methods
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,49 +1,29 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<configuration>
|
<configuration>
|
||||||
<configSections>
|
<configSections>
|
||||||
<!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
|
<!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
|
||||||
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
|
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
|
||||||
</configSections>
|
</configSections>
|
||||||
<entityFramework>
|
<entityFramework>
|
||||||
<!--<defaultConnectionFactory type="MySql.Data.Entity.MySqlConnectionFactory, MySql.Data.EntityFramework" />-->
|
<defaultConnectionFactory type="MySql.Data.Entity.MySqlConnectionFactory, MySql.Data.Entity.EF6" />
|
||||||
<defaultConnectionFactory type="System.Data.Entity.Infrastructure.SqlConnectionFactory, EntityFramework" />
|
<providers>
|
||||||
<providers>
|
<provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />
|
||||||
<provider invariantName="MySql.Data.MySqlClient" type="MySql.Data.MySqlClient.MySqlProviderServices, MySql.Data.EntityFramework, Version=8.0.21.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d">
|
<provider invariantName="MySql.Data.MySqlClient" type="MySql.Data.MySqlClient.MySqlProviderServices, MySql.Data.Entity.EF6, Version=6.10.9.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d" />
|
||||||
</provider>
|
</providers>
|
||||||
</providers>
|
</entityFramework>
|
||||||
</entityFramework>
|
<connectionStrings>
|
||||||
<connectionStrings>
|
<add name="DefaultConnection" connectionString="server=localhost;port=3306;User Id=EgtUser;password=viacremasca;Persist Security Info=True;database=EgtBwDb;SslMode=none" providerName="MySql.Data.MySqlClient" />
|
||||||
<add name="DefaultConnection" connectionString="server=localhost;port=3306;User Id=steamware;password=Egalware_24068!;Persist Security Info=True;database=EgtBwDb_000470;SslMode=none" providerName="MySql.Data.MySqlClient" />
|
</connectionStrings>
|
||||||
</connectionStrings>
|
<runtime>
|
||||||
<runtime>
|
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
|
||||||
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
|
<dependentAssembly>
|
||||||
<dependentAssembly>
|
<assemblyIdentity name="MySql.Data" publicKeyToken="c5687fc88969c44d" culture="neutral" />
|
||||||
<assemblyIdentity name="MySql.Data" publicKeyToken="c5687fc88969c44d" culture="neutral" />
|
<bindingRedirect oldVersion="0.0.0.0-6.10.9.0" newVersion="6.10.9.0" />
|
||||||
<bindingRedirect oldVersion="0.0.0.0-8.0.21.0" newVersion="8.0.21.0" />
|
</dependentAssembly>
|
||||||
</dependentAssembly>
|
</assemblyBinding>
|
||||||
<dependentAssembly>
|
</runtime>
|
||||||
<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" />
|
<startup>
|
||||||
</dependentAssembly>
|
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" />
|
||||||
<dependentAssembly>
|
</startup>
|
||||||
<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>
|
</configuration>
|
||||||
@@ -1,17 +1,25 @@
|
|||||||
using EgtBEAMWALL.DataLayer.DatabaseModels;
|
using System;
|
||||||
using NLog;
|
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using EgtBEAMWALL.DataLayer.DatabaseModels;
|
||||||
|
|
||||||
namespace EgtBEAMWALL.DataLayer.Controllers
|
namespace EgtBEAMWALL.DataLayer.Controllers
|
||||||
{
|
{
|
||||||
public class BTLPartController : IDisposable
|
public class BTLPartController : IDisposable
|
||||||
{
|
{
|
||||||
|
#region Private Fields
|
||||||
|
|
||||||
|
private DatabaseContext dbCtx;
|
||||||
|
|
||||||
|
#endregion Private Fields
|
||||||
|
|
||||||
#region Public Constructors
|
#region Public Constructors
|
||||||
|
|
||||||
public BTLPartController()
|
public BTLPartController()
|
||||||
{
|
{
|
||||||
|
// Initialize database context
|
||||||
|
dbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion Public Constructors
|
#endregion Public Constructors
|
||||||
@@ -24,7 +32,7 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
|||||||
/// <param name="corePart"></param>
|
/// <param name="corePart"></param>
|
||||||
/// <param name="currProjDbId"></param>
|
/// <param name="currProjDbId"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public BTLPartModel ConvertFromCore(Core.BTLPartM corePart, int currProjDbId)
|
public static BTLPartModel ConvertFromCore(Core.BTLPartM corePart, int currProjDbId)
|
||||||
{
|
{
|
||||||
BTLPartModel answ = new BTLPartModel();
|
BTLPartModel answ = new BTLPartModel();
|
||||||
if (corePart != null)
|
if (corePart != null)
|
||||||
@@ -97,19 +105,15 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
// Add to database
|
||||||
{
|
dbCtx.BTLPartList.AddRange(partData);
|
||||||
// Add to database
|
// Commit changes
|
||||||
localDbCtx.BTLPartList.AddRange(partData);
|
dbCtx.SaveChanges();
|
||||||
// Commit changes
|
ResetController();
|
||||||
localDbCtx.SaveChanges();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
catch (Exception exc)
|
catch (Exception exc)
|
||||||
{
|
{
|
||||||
string errMessage = $"EXCEPTION on BTLPart.Create: {Environment.NewLine}{exc}";
|
Console.WriteLine($"EXCEPTION on Create: {exc}");
|
||||||
Console.WriteLine(errMessage);
|
|
||||||
Log.Error(errMessage);
|
|
||||||
}
|
}
|
||||||
return partData;
|
return partData;
|
||||||
}
|
}
|
||||||
@@ -143,19 +147,15 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
|||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
// Add to database
|
||||||
{
|
dbCtx.BTLPartList.AddRange(partData);
|
||||||
// Add to database
|
// Commit changes
|
||||||
localDbCtx.BTLPartList.AddRange(partData);
|
dbCtx.SaveChanges();
|
||||||
// Commit changes
|
ResetController();
|
||||||
localDbCtx.SaveChanges();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
catch (Exception exc)
|
catch (Exception exc)
|
||||||
{
|
{
|
||||||
string errMessage = $"EXCEPTION on BTLPart.CreateBaseObj: {Environment.NewLine}{exc}";
|
Console.WriteLine($"EXCEPTION on CreateBaseObj: {exc}");
|
||||||
Console.WriteLine(errMessage);
|
|
||||||
Log.Error(errMessage);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return partData;
|
return partData;
|
||||||
@@ -169,26 +169,22 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
|||||||
public bool Delete(int PartDbId)
|
public bool Delete(int PartDbId)
|
||||||
{
|
{
|
||||||
bool done = false;
|
bool done = false;
|
||||||
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
var item2del = dbCtx
|
||||||
{
|
|
||||||
var item2del = localDbCtx
|
|
||||||
.BTLPartList
|
.BTLPartList
|
||||||
.Where(x => x.BTLPartDbId == PartDbId)
|
.Where(x => x.BTLPartDbId == PartDbId)
|
||||||
.SingleOrDefault();
|
.SingleOrDefault();
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
// Add to database
|
// Add to database
|
||||||
localDbCtx.BTLPartList.Remove(item2del);
|
dbCtx.BTLPartList.Remove(item2del);
|
||||||
// Commit changes
|
// Commit changes
|
||||||
localDbCtx.SaveChanges();
|
dbCtx.SaveChanges();
|
||||||
done = true;
|
ResetController();
|
||||||
}
|
done = true;
|
||||||
catch (Exception exc)
|
}
|
||||||
{
|
catch (Exception exc)
|
||||||
string errMessage = $"EXCEPTION on BTLPart.Delete: {Environment.NewLine}{exc}";
|
{
|
||||||
Console.WriteLine(errMessage);
|
Console.WriteLine($"EXCEPTION on Delete: {exc}");
|
||||||
Log.Error(errMessage);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return done;
|
return done;
|
||||||
}
|
}
|
||||||
@@ -201,31 +197,29 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
|||||||
public bool DeleteByProject(int ProjDbId)
|
public bool DeleteByProject(int ProjDbId)
|
||||||
{
|
{
|
||||||
bool done = false;
|
bool done = false;
|
||||||
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
var items2del = dbCtx
|
||||||
{
|
|
||||||
var items2del = localDbCtx
|
|
||||||
.BTLPartList
|
.BTLPartList
|
||||||
.Where(x => x.ProjDbId == ProjDbId);
|
.Where(x => x.ProjDbId == ProjDbId);
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
// Add to database
|
// Add to database
|
||||||
localDbCtx.BTLPartList.RemoveRange(items2del);
|
dbCtx.BTLPartList.RemoveRange(items2del);
|
||||||
// Commit changes
|
// Commit changes
|
||||||
localDbCtx.SaveChanges();
|
dbCtx.SaveChanges();
|
||||||
done = true;
|
ResetController();
|
||||||
}
|
done = true;
|
||||||
catch (Exception exc)
|
}
|
||||||
{
|
catch (Exception exc)
|
||||||
string errMessage = $"EXCEPTION on BTLPart.DeleteByProject: {Environment.NewLine}{exc}";
|
{
|
||||||
Console.WriteLine(errMessage);
|
Console.WriteLine($"EXCEPTION on DeleteByProject: {exc}");
|
||||||
Log.Error(errMessage);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return done;
|
return done;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Dispose()
|
public void Dispose()
|
||||||
{
|
{
|
||||||
|
// Clear database context
|
||||||
|
dbCtx.Dispose();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -235,13 +229,10 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
|||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public BTLPartModel FindByDbId(int PartDbId)
|
public BTLPartModel FindByDbId(int PartDbId)
|
||||||
{
|
{
|
||||||
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
return dbCtx
|
||||||
{
|
|
||||||
return localDbCtx
|
|
||||||
.BTLPartList
|
.BTLPartList
|
||||||
.Where(x => x.BTLPartDbId == PartDbId)
|
.Where(x => x.BTLPartDbId == PartDbId)
|
||||||
.SingleOrDefault();
|
.SingleOrDefault();
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -251,13 +242,10 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
|||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public BTLPartModel FindByPartId(int PartId)
|
public BTLPartModel FindByPartId(int PartId)
|
||||||
{
|
{
|
||||||
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
return dbCtx
|
||||||
{
|
|
||||||
return localDbCtx
|
|
||||||
.BTLPartList
|
.BTLPartList
|
||||||
.Where(x => x.PartId == PartId)
|
.Where(x => x.PartId == PartId)
|
||||||
.SingleOrDefault();
|
.SingleOrDefault();
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -268,13 +256,10 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
|||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public BTLPartModel FindByPartIdProjDbId(int PartId, int ProjDbId)
|
public BTLPartModel FindByPartIdProjDbId(int PartId, int ProjDbId)
|
||||||
{
|
{
|
||||||
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
return dbCtx
|
||||||
{
|
|
||||||
return localDbCtx
|
|
||||||
.BTLPartList
|
.BTLPartList
|
||||||
.Where(x => x.PartId == PartId && x.ProjDbId == ProjDbId)
|
.Where(x => x.PartId == PartId && x.ProjDbId == ProjDbId)
|
||||||
.FirstOrDefault();
|
.FirstOrDefault();
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -284,15 +269,12 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
|||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public List<BTLPartModel> GetByProjectAsc(int ProjDbId)
|
public List<BTLPartModel> GetByProjectAsc(int ProjDbId)
|
||||||
{
|
{
|
||||||
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
// retrieve
|
||||||
{
|
return dbCtx
|
||||||
// retrieve
|
|
||||||
return localDbCtx
|
|
||||||
.BTLPartList
|
.BTLPartList
|
||||||
.Where(x => x.ProjDbId == ProjDbId)
|
.Where(x => x.ProjDbId == ProjDbId)
|
||||||
.OrderBy(x => x.BTLPartDbId)
|
.OrderBy(x => x.BTLPartDbId)
|
||||||
.ToList();
|
.ToList();
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -302,15 +284,12 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
|||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public List<BTLPartModel> GetByProjectDesc(int ProjDbId)
|
public List<BTLPartModel> GetByProjectDesc(int ProjDbId)
|
||||||
{
|
{
|
||||||
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
// retrieve
|
||||||
{
|
return dbCtx
|
||||||
// retrieve
|
|
||||||
return localDbCtx
|
|
||||||
.BTLPartList
|
.BTLPartList
|
||||||
.Where(x => x.ProjDbId == ProjDbId)
|
.Where(x => x.ProjDbId == ProjDbId)
|
||||||
.OrderByDescending(x => x.BTLPartDbId)
|
.OrderByDescending(x => x.BTLPartDbId)
|
||||||
.ToList();
|
.ToList();
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -321,22 +300,17 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
|||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public List<BTLPartModel> GetPaginatedAsc(int PartDbIdStart, int numRecord)
|
public List<BTLPartModel> GetPaginatedAsc(int PartDbIdStart, int numRecord)
|
||||||
{
|
{
|
||||||
List<BTLPartModel> answ = new List<BTLPartModel>();
|
|
||||||
int numEnd = PartDbIdStart - numRecord;
|
int numEnd = PartDbIdStart - numRecord;
|
||||||
// check numEnd
|
// check numEnd
|
||||||
if (numEnd < 0)
|
if (numEnd < 0)
|
||||||
numEnd = 0;
|
numEnd = 0;
|
||||||
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
// retrieve
|
||||||
{
|
return dbCtx
|
||||||
// retrieve
|
.BTLPartList
|
||||||
answ = localDbCtx
|
.Where(x => x.BTLPartDbId <= PartDbIdStart)
|
||||||
.BTLPartList
|
.OrderBy(x => x.BTLPartDbId)
|
||||||
.Where(x => x.BTLPartDbId <= PartDbIdStart)
|
.Take(numRecord)
|
||||||
.OrderBy(x => x.BTLPartDbId)
|
.ToList();
|
||||||
.Take(numRecord)
|
|
||||||
.ToList();
|
|
||||||
}
|
|
||||||
return answ;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -347,22 +321,26 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
|||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public List<BTLPartModel> GetPaginatedDesc(int PartDbIdStart, int numRecord)
|
public List<BTLPartModel> GetPaginatedDesc(int PartDbIdStart, int numRecord)
|
||||||
{
|
{
|
||||||
List<BTLPartModel> answ = new List<BTLPartModel>();
|
|
||||||
int numEnd = PartDbIdStart - numRecord;
|
int numEnd = PartDbIdStart - numRecord;
|
||||||
// check numEnd
|
// check numEnd
|
||||||
if (numEnd < 0)
|
if (numEnd < 0)
|
||||||
numEnd = 0;
|
numEnd = 0;
|
||||||
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
// retrieve
|
||||||
{
|
return dbCtx
|
||||||
// retrieve
|
.BTLPartList
|
||||||
answ = localDbCtx
|
.Where(x => x.BTLPartDbId <= PartDbIdStart)
|
||||||
.BTLPartList
|
.OrderByDescending(x => x.BTLPartDbId)
|
||||||
.Where(x => x.BTLPartDbId <= PartDbIdStart)
|
.Take(numRecord)
|
||||||
.OrderByDescending(x => x.BTLPartDbId)
|
.ToList();
|
||||||
.Take(numRecord)
|
}
|
||||||
.ToList();
|
|
||||||
}
|
/// <summary>
|
||||||
return answ;
|
/// Reinizializzaizone del controller
|
||||||
|
/// </summary>
|
||||||
|
public void ResetController()
|
||||||
|
{
|
||||||
|
// Re-Initialize database context
|
||||||
|
dbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -373,44 +351,32 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
|||||||
public bool Update(BTLPartModel updItem)
|
public bool Update(BTLPartModel updItem)
|
||||||
{
|
{
|
||||||
bool done = false;
|
bool done = false;
|
||||||
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
var item2update = dbCtx
|
||||||
{
|
|
||||||
var item2update = localDbCtx
|
|
||||||
.BTLPartList
|
.BTLPartList
|
||||||
.Where(x => x.BTLPartDbId == updItem.BTLPartDbId)
|
.Where(x => x.BTLPartDbId == updItem.BTLPartDbId)
|
||||||
.SingleOrDefault();
|
.SingleOrDefault();
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
// update, vers 1...
|
// update, vers 1...
|
||||||
localDbCtx.Entry(item2update).CurrentValues.SetValues(updItem);
|
dbCtx.Entry(item2update).CurrentValues.SetValues(updItem);
|
||||||
|
|
||||||
//// update, vers 2
|
//// update, vers 2
|
||||||
//localDbCtx.BTLPartList.Remove(item2del);
|
//dbCtx.BTLPartList.Remove(item2del);
|
||||||
//localDbCtx.BTLPartList.Add(updItem);
|
//dbCtx.BTLPartList.Add(updItem);
|
||||||
|
|
||||||
// Commit changes
|
// Commit changes
|
||||||
localDbCtx.SaveChanges();
|
dbCtx.SaveChanges();
|
||||||
done = true;
|
done = true;
|
||||||
}
|
|
||||||
catch (Exception exc)
|
|
||||||
{
|
|
||||||
string errMessage = $"EXCEPTION on BTLPart.Update: {Environment.NewLine}{exc}";
|
|
||||||
Console.WriteLine(errMessage);
|
|
||||||
Log.Error(errMessage);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
catch (Exception exc)
|
||||||
|
{
|
||||||
|
Console.WriteLine($"EXCEPTION on Update: {exc}");
|
||||||
|
}
|
||||||
|
// reset...
|
||||||
|
ResetController();
|
||||||
return done;
|
return done;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion Public Methods
|
#endregion Public Methods
|
||||||
|
|
||||||
#region Private Fields
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Istanza logger
|
|
||||||
/// </summary>
|
|
||||||
private NLog.Logger Log = LogManager.GetCurrentClassLogger();
|
|
||||||
|
|
||||||
#endregion Private Fields
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,12 +1,19 @@
|
|||||||
using NLog;
|
using System;
|
||||||
using System;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Threading;
|
using System.Text;
|
||||||
|
using EgtBEAMWALL.DataLayer.DatabaseModels;
|
||||||
|
|
||||||
namespace EgtBEAMWALL.DataLayer.Controllers
|
namespace EgtBEAMWALL.DataLayer.Controllers
|
||||||
{
|
{
|
||||||
public class DbController : IDisposable
|
public class DbController : IDisposable
|
||||||
{
|
{
|
||||||
|
#region Private Fields
|
||||||
|
|
||||||
|
private AdminContext adbCtx;
|
||||||
|
|
||||||
|
#endregion Private Fields
|
||||||
|
|
||||||
#region Public Fields
|
#region Public Fields
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -22,8 +29,6 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
|||||||
{
|
{
|
||||||
// Initialize database context for ADMIN
|
// Initialize database context for ADMIN
|
||||||
adbCtx = new AdminContext(DbConfig.ADMIN_CONNECTION_STRING);
|
adbCtx = new AdminContext(DbConfig.ADMIN_CONNECTION_STRING);
|
||||||
// DB standard utente
|
|
||||||
dbCtx = new AdminContext(DbConfig.CONNECTION_STRING);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion Public Constructors
|
#endregion Public Constructors
|
||||||
@@ -41,78 +46,39 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
|||||||
{
|
{
|
||||||
bool answ = false;
|
bool answ = false;
|
||||||
string domain = isNetwork ? "%" : "localhost";
|
string domain = isNetwork ? "%" : "localhost";
|
||||||
answ = doCheckCreate(username, pwd, answ, domain, false);
|
// ricerca utente...
|
||||||
if (answ)
|
var numUser = adbCtx
|
||||||
|
.UserList
|
||||||
|
.Where(x => x.User == username)
|
||||||
|
.ToList()
|
||||||
|
.Count;
|
||||||
|
if (numUser > 0)
|
||||||
{
|
{
|
||||||
doGrantPriv(username, domain, "ALL ON *.*");
|
answ = true;
|
||||||
|
}
|
||||||
|
if (!answ)
|
||||||
|
{
|
||||||
|
// creo utente
|
||||||
|
string sqlCommand = "FLUSH PRIVILEGES;";
|
||||||
|
//string sqlCommand = $"CREATE USER '{username}'@'{domain}' IDENTIFIED BY '{pwd}'; GRANT ALL ON *.* TO '{username}'@'localhost'; FLUSH PRIVILEGES;";
|
||||||
|
//string sqlCommand = $"CREATE USER '{username}'@'{domain}' IDENTIFIED BY '{pwd}'; GRANT ALL ON *.* TO '{username}'@'localhost'; FLUSH PRIVILEGES;";
|
||||||
|
adbCtx.Database.ExecuteSqlCommand(System.Data.Entity.TransactionalBehavior.DoNotEnsureTransaction, sqlCommand);
|
||||||
|
sqlCommand = $"CREATE USER '{username}'@'{domain}' IDENTIFIED BY '{pwd}';";
|
||||||
|
adbCtx.Database.ExecuteSqlCommand(System.Data.Entity.TransactionalBehavior.DoNotEnsureTransaction, sqlCommand);
|
||||||
|
sqlCommand = $"GRANT ALL ON *.* TO '{username}'@'{domain}';";
|
||||||
|
adbCtx.Database.ExecuteSqlCommand(System.Data.Entity.TransactionalBehavior.DoNotEnsureTransaction, sqlCommand);
|
||||||
|
sqlCommand = "FLUSH PRIVILEGES;";
|
||||||
|
adbCtx.Database.ExecuteSqlCommand(System.Data.Entity.TransactionalBehavior.DoNotEnsureTransaction, sqlCommand);
|
||||||
}
|
}
|
||||||
return answ;
|
return answ;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Migrazione esplicita del DB da parte dell'admin controller
|
|
||||||
/// </summary>
|
|
||||||
/// <returns></returns>
|
|
||||||
public bool checkMigrateDb()
|
|
||||||
{
|
|
||||||
return adbCtx.SetUpDbConnectionAndDbConfig();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void Dispose()
|
public void Dispose()
|
||||||
{
|
{
|
||||||
// Clear database context
|
// Clear database context
|
||||||
adbCtx.Dispose();
|
adbCtx.Dispose();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Verifica esistenza views + utente relativo eventualmente ricreandole + fornendo accesso
|
|
||||||
/// all'utente ReadOnly Essetre
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="dbName"></param>
|
|
||||||
/// <param name="username"></param>
|
|
||||||
/// <param name="pwd"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
public bool refreshViews(string dbName, string username = "S3_User", string pwd = "S3_P4ssw0rd")
|
|
||||||
{
|
|
||||||
bool answ = false;
|
|
||||||
|
|
||||||
// in primis refresh delle view
|
|
||||||
string sqlCommand = @"CREATE OR REPLACE VIEW v_expProdRaw AS
|
|
||||||
SELECT DbId, AlarmDtEvent AS DtEvent, VarValue,
|
|
||||||
SUBSTRING_INDEX(VarValue, ';', 1) AS Prod,
|
|
||||||
SUBSTRING_INDEX(SUBSTRING_INDEX(VarValue, ';', 2), ';', -1) AS MachGroupId,
|
|
||||||
SUBSTRING_INDEX(SUBSTRING_INDEX(VarValue, ';', -2), ';', 1) AS PartId,
|
|
||||||
SUBSTRING_INDEX(VarValue, ';', -1) AS Status
|
|
||||||
FROM logmachine
|
|
||||||
WHERE ResultType = 1
|
|
||||||
AND VarAddress = 1;
|
|
||||||
|
|
||||||
CREATE OR REPLACE VIEW v_expProd AS
|
|
||||||
SELECT vp.DtEvent, vp.Prod, mgl.Name AS mgName, pl.PDN, vp.`Status`
|
|
||||||
FROM v_expProdRaw AS vp
|
|
||||||
INNER JOIN MachGroupList mgl ON vp.MachGroupId = mgl.Id
|
|
||||||
INNER JOIN partlist pl ON vp.PartId = pl.Id;";
|
|
||||||
dbCtx.Database.ExecuteSqlCommand(System.Data.Entity.TransactionalBehavior.DoNotEnsureTransaction, sqlCommand);
|
|
||||||
Thread.Sleep(100);
|
|
||||||
|
|
||||||
// ora setup parametri x utente
|
|
||||||
string domain = "%";
|
|
||||||
|
|
||||||
// ora controllo utente con diritti
|
|
||||||
answ = doCheckCreate(username, pwd, answ, domain, true);
|
|
||||||
if (answ)
|
|
||||||
{
|
|
||||||
doGrantPriv(username, domain, "USAGE ON *.*");
|
|
||||||
doGrantPriv(username, domain, $"SELECT ON {dbName}.v_expProd");
|
|
||||||
}
|
|
||||||
|
|
||||||
return answ;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// ATTENZIONE!!!! Procedura di Reset del DB
|
|
||||||
/// </summary>
|
|
||||||
/// <returns></returns>
|
|
||||||
public bool ResetDb()
|
public bool ResetDb()
|
||||||
{
|
{
|
||||||
bool answ = false;
|
bool answ = false;
|
||||||
@@ -128,100 +94,12 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
|||||||
}
|
}
|
||||||
catch (Exception exc)
|
catch (Exception exc)
|
||||||
{
|
{
|
||||||
string errMessage = $"EXCEPTION on DbController.ResetDb: {Environment.NewLine}{exc}";
|
Console.WriteLine($"EXCEPTION on ResetDb: {exc}");
|
||||||
Console.WriteLine(errMessage);
|
|
||||||
Log.Error(errMessage);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return answ;
|
return answ;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion Public Methods
|
#endregion Public Methods
|
||||||
|
|
||||||
#region Private Fields
|
|
||||||
|
|
||||||
private AdminContext adbCtx;
|
|
||||||
private AdminContext dbCtx;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Istanza logger
|
|
||||||
/// </summary>
|
|
||||||
private NLog.Logger Log = LogManager.GetCurrentClassLogger();
|
|
||||||
|
|
||||||
#endregion Private Fields
|
|
||||||
|
|
||||||
#region Private Methods
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Procedura interna effettiva di check utente ed eventuale creazione + grant level
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="username"></param>
|
|
||||||
/// <param name="pwd"></param>
|
|
||||||
/// <param name="answ"></param>
|
|
||||||
/// <param name="domain"></param>
|
|
||||||
/// <param name="force">Force = esegue un drop prima...</param>
|
|
||||||
/// <returns></returns>
|
|
||||||
private bool doCheckCreate(string username, string pwd, bool answ, string domain, bool force)
|
|
||||||
{
|
|
||||||
// ricerca utente...
|
|
||||||
var numUser = adbCtx
|
|
||||||
.UserList
|
|
||||||
.Where(x => x.User == username)
|
|
||||||
.ToList()
|
|
||||||
.Count;
|
|
||||||
if (numUser > 0)
|
|
||||||
{
|
|
||||||
answ = true;
|
|
||||||
}
|
|
||||||
if (!answ)
|
|
||||||
{
|
|
||||||
// creo utente
|
|
||||||
string sqlCommand = $"DROP USER IF EXISTS {username};";
|
|
||||||
if (force)
|
|
||||||
{
|
|
||||||
adbCtx.Database.ExecuteSqlCommand(System.Data.Entity.TransactionalBehavior.DoNotEnsureTransaction, sqlCommand);
|
|
||||||
Thread.Sleep(100);
|
|
||||||
}
|
|
||||||
sqlCommand = "FLUSH PRIVILEGES;";
|
|
||||||
adbCtx.Database.ExecuteSqlCommand(System.Data.Entity.TransactionalBehavior.DoNotEnsureTransaction, sqlCommand);
|
|
||||||
Thread.Sleep(100);
|
|
||||||
sqlCommand = $"CREATE USER '{username}'@'{domain}' IDENTIFIED BY '{pwd}';";
|
|
||||||
adbCtx.Database.ExecuteSqlCommand(System.Data.Entity.TransactionalBehavior.DoNotEnsureTransaction, sqlCommand);
|
|
||||||
Thread.Sleep(100);
|
|
||||||
sqlCommand = "FLUSH PRIVILEGES;";
|
|
||||||
adbCtx.Database.ExecuteSqlCommand(System.Data.Entity.TransactionalBehavior.DoNotEnsureTransaction, sqlCommand);
|
|
||||||
Thread.Sleep(100);
|
|
||||||
answ = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
return answ;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Procedura interna effettiva di grant level x utente
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="username"></param>
|
|
||||||
/// <param name="domain"></param>
|
|
||||||
/// <param name="grantLevel"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
private bool doGrantPriv(string username, string domain, string grantLevel)
|
|
||||||
{
|
|
||||||
bool answ = false;
|
|
||||||
|
|
||||||
string sqlCommand = "FLUSH PRIVILEGES;";
|
|
||||||
adbCtx.Database.ExecuteSqlCommand(System.Data.Entity.TransactionalBehavior.DoNotEnsureTransaction, sqlCommand);
|
|
||||||
Thread.Sleep(100);
|
|
||||||
sqlCommand = $"GRANT {grantLevel} TO '{username}'@'{domain}';";
|
|
||||||
adbCtx.Database.ExecuteSqlCommand(System.Data.Entity.TransactionalBehavior.DoNotEnsureTransaction, sqlCommand);
|
|
||||||
Thread.Sleep(100);
|
|
||||||
sqlCommand = "FLUSH PRIVILEGES;";
|
|
||||||
adbCtx.Database.ExecuteSqlCommand(System.Data.Entity.TransactionalBehavior.DoNotEnsureTransaction, sqlCommand);
|
|
||||||
Thread.Sleep(100);
|
|
||||||
answ = true;
|
|
||||||
|
|
||||||
return answ;
|
|
||||||
}
|
|
||||||
|
|
||||||
#endregion Private Methods
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,17 +1,25 @@
|
|||||||
using EgtBEAMWALL.DataLayer.DatabaseModels;
|
using System;
|
||||||
using NLog;
|
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using EgtBEAMWALL.DataLayer.DatabaseModels;
|
||||||
|
|
||||||
namespace EgtBEAMWALL.DataLayer.Controllers
|
namespace EgtBEAMWALL.DataLayer.Controllers
|
||||||
{
|
{
|
||||||
public class LogMachineController : IDisposable
|
public class LogMachineController : IDisposable
|
||||||
{
|
{
|
||||||
|
#region Private Fields
|
||||||
|
|
||||||
|
private DatabaseContext dbCtx;
|
||||||
|
|
||||||
|
#endregion Private Fields
|
||||||
|
|
||||||
#region Public Constructors
|
#region Public Constructors
|
||||||
|
|
||||||
public LogMachineController()
|
public LogMachineController()
|
||||||
{
|
{
|
||||||
|
// Initialize database context
|
||||||
|
dbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion Public Constructors
|
#endregion Public Constructors
|
||||||
@@ -23,7 +31,7 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="coreMacLog"></param>
|
/// <param name="coreMacLog"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public LogMachineModel ConvertFromCore(Core.MachLog coreMacLog)
|
public static LogMachineModel ConvertFromCore(Core.MachLog coreMacLog)
|
||||||
{
|
{
|
||||||
LogMachineModel answ = new LogMachineModel();
|
LogMachineModel answ = new LogMachineModel();
|
||||||
if (coreMacLog != null)
|
if (coreMacLog != null)
|
||||||
@@ -53,9 +61,9 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="dbLog"></param>
|
/// <param name="dbLog"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public Core.MachLog ConvertToCore(LogMachineModel dbLog)
|
public static Core.MachLog ConvertToCore(LogMachineModel dbLog)
|
||||||
{
|
{
|
||||||
var newRecord = Core.MachLog.CreateMachLog(dbLog.AlarmCode, dbLog.AlarmDatetime, dbLog.AlarmMessage, dbLog.AlarmOperation, dbLog.AlarmType, dbLog.CommandExecutedCorrectly, dbLog.CommandState, dbLog.CommandType, dbLog.Description, dbLog.NewOpState, dbLog.ResultType, dbLog.VarAddress, dbLog.VarValue);
|
var newRecord = Core.MachLog.CreateMacLog(dbLog.AlarmCode, dbLog.AlarmDatetime, dbLog.AlarmMessage, dbLog.AlarmOperation, dbLog.AlarmType, dbLog.CommandExecutedCorrectly, dbLog.CommandState, dbLog.CommandType, dbLog.Description, dbLog.NewOpState, dbLog.ResultType, dbLog.VarAddress, dbLog.VarValue);
|
||||||
return newRecord;
|
return newRecord;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -71,19 +79,18 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
using (var locallocalDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
using (var currDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
||||||
{
|
{
|
||||||
// Add to database
|
// Add to database
|
||||||
locallocalDbCtx.LogMachineList.Add(newLogMac);
|
currDbCtx.LogMachineList.Add(newLogMac);
|
||||||
// Commit changes
|
// Commit changes
|
||||||
locallocalDbCtx.SaveChanges();
|
currDbCtx.SaveChanges();
|
||||||
|
ResetController();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (Exception exc)
|
catch (Exception exc)
|
||||||
{
|
{
|
||||||
string errMessage = $"EXCEPTION on LogMachine.Create: {Environment.NewLine}{exc}";
|
Console.WriteLine($"EXCEPTION on Create LogMachine: {exc}");
|
||||||
Console.WriteLine(errMessage);
|
|
||||||
Log.Error(errMessage);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch
|
catch
|
||||||
@@ -110,31 +117,29 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
|||||||
public bool DeleteByKey(int LogDbId)
|
public bool DeleteByKey(int LogDbId)
|
||||||
{
|
{
|
||||||
bool done = false;
|
bool done = false;
|
||||||
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
var items2del = dbCtx
|
||||||
{
|
|
||||||
var items2del = localDbCtx
|
|
||||||
.LogMachineList
|
.LogMachineList
|
||||||
.Where(x => x.LogDbId == LogDbId);
|
.Where(x => x.LogDbId == LogDbId);
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
// Add to database
|
// Add to database
|
||||||
localDbCtx.LogMachineList.RemoveRange(items2del);
|
dbCtx.LogMachineList.RemoveRange(items2del);
|
||||||
// Commit changes
|
// Commit changes
|
||||||
localDbCtx.SaveChanges();
|
dbCtx.SaveChanges();
|
||||||
done = true;
|
ResetController();
|
||||||
}
|
done = true;
|
||||||
catch (Exception exc)
|
}
|
||||||
{
|
catch (Exception exc)
|
||||||
string errMessage = $"EXCEPTION on LogMachine.DeleteByKey: {Environment.NewLine}{exc}";
|
{
|
||||||
Console.WriteLine(errMessage);
|
Console.WriteLine($"EXCEPTION on DeleteByKey: {exc}");
|
||||||
Log.Error(errMessage);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return done;
|
return done;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Dispose()
|
public void Dispose()
|
||||||
{
|
{
|
||||||
|
// Clear database context
|
||||||
|
dbCtx.Dispose();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -144,13 +149,10 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
|||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public LogMachineModel FindByDbId(int LogDbId)
|
public LogMachineModel FindByDbId(int LogDbId)
|
||||||
{
|
{
|
||||||
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
return dbCtx
|
||||||
{
|
|
||||||
return localDbCtx
|
|
||||||
.LogMachineList
|
.LogMachineList
|
||||||
.Where(x => x.LogDbId == LogDbId)
|
.Where(x => x.LogDbId == LogDbId)
|
||||||
.SingleOrDefault();
|
.SingleOrDefault();
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -161,41 +163,12 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
|||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public List<LogMachineModel> GetAsc(DateTime dtStart, DateTime dtEnd)
|
public List<LogMachineModel> GetAsc(DateTime dtStart, DateTime dtEnd)
|
||||||
{
|
{
|
||||||
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
// retrieve
|
||||||
{
|
return dbCtx
|
||||||
// retrieve
|
|
||||||
return localDbCtx
|
|
||||||
.LogMachineList
|
.LogMachineList
|
||||||
.Where(x => x.AlarmDatetime >= dtStart && x.AlarmDatetime <= dtEnd)
|
.Where(x => x.AlarmDatetime >= dtStart && x.AlarmDatetime <= dtEnd)
|
||||||
.OrderBy(x => x.AlarmDatetime)
|
.OrderBy(x => x.AlarmDatetime)
|
||||||
.ToList();
|
.ToList();
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Get paginated data from DB (ASC ordered) in "core format"
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="dtStart"></param>
|
|
||||||
/// <param name="dtEnd"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
public List<Core.MachLog> GetCoreAsc(DateTime dtStart, DateTime dtEnd)
|
|
||||||
{
|
|
||||||
var rawData = GetAsc(dtStart, dtEnd);
|
|
||||||
var coreData = rawData.Select(x => ConvertToCore(x)).ToList();
|
|
||||||
return coreData;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Get paginated data from DB (DESC ordered) in "core format"
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="dtStart"></param>
|
|
||||||
/// <param name="dtEnd"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
public List<Core.MachLog> GetCoreDesc(DateTime dtStart, DateTime dtEnd)
|
|
||||||
{
|
|
||||||
var rawData = GetDesc(dtStart, dtEnd);
|
|
||||||
var coreData = rawData.Select(x => ConvertToCore(x)).ToList();
|
|
||||||
return coreData;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -206,15 +179,21 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
|||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public List<LogMachineModel> GetDesc(DateTime dtStart, DateTime dtEnd)
|
public List<LogMachineModel> GetDesc(DateTime dtStart, DateTime dtEnd)
|
||||||
{
|
{
|
||||||
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
// retrieve
|
||||||
{
|
return dbCtx
|
||||||
// retrieve
|
|
||||||
return localDbCtx
|
|
||||||
.LogMachineList
|
.LogMachineList
|
||||||
.Where(x => x.AlarmDatetime >= dtStart && x.AlarmDatetime <= dtEnd)
|
.Where(x => x.AlarmDatetime >= dtStart && x.AlarmDatetime <= dtEnd)
|
||||||
.OrderByDescending(x => x.AlarmDatetime)
|
.OrderByDescending(x => x.AlarmDatetime)
|
||||||
.ToList();
|
.ToList();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Reinizializzaizone del controller
|
||||||
|
/// </summary>
|
||||||
|
public void ResetController()
|
||||||
|
{
|
||||||
|
// Re-Initialize database context
|
||||||
|
dbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -225,40 +204,27 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
|||||||
public bool Update(LogMachineModel updItem)
|
public bool Update(LogMachineModel updItem)
|
||||||
{
|
{
|
||||||
bool done = false;
|
bool done = false;
|
||||||
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
var item2update = dbCtx
|
||||||
{
|
|
||||||
var item2update = localDbCtx
|
|
||||||
.LogMachineList
|
.LogMachineList
|
||||||
.Where(x => x.LogDbId == updItem.LogDbId)
|
.Where(x => x.LogDbId == updItem.LogDbId)
|
||||||
.SingleOrDefault();
|
.SingleOrDefault();
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
// update, vers 1...
|
// update, vers 1...
|
||||||
localDbCtx.Entry(item2update).CurrentValues.SetValues(updItem);
|
dbCtx.Entry(item2update).CurrentValues.SetValues(updItem);
|
||||||
|
|
||||||
// Commit changes
|
// Commit changes
|
||||||
localDbCtx.SaveChanges();
|
dbCtx.SaveChanges();
|
||||||
done = true;
|
ResetController();
|
||||||
}
|
done = true;
|
||||||
catch (Exception exc)
|
}
|
||||||
{
|
catch (Exception exc)
|
||||||
string errMessage = $"EXCEPTION on LogMachine.Update: {Environment.NewLine}{exc}";
|
{
|
||||||
Console.WriteLine(errMessage);
|
Console.WriteLine($"EXCEPTION on Update: {exc}");
|
||||||
Log.Error(errMessage);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return done;
|
return done;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion Public Methods
|
#endregion Public Methods
|
||||||
|
|
||||||
#region Private Fields
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Istanza logger
|
|
||||||
/// </summary>
|
|
||||||
private NLog.Logger Log = LogManager.GetCurrentClassLogger();
|
|
||||||
|
|
||||||
#endregion Private Fields
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,17 +1,25 @@
|
|||||||
using EgtBEAMWALL.DataLayer.DatabaseModels;
|
using System;
|
||||||
using NLog;
|
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using EgtBEAMWALL.DataLayer.DatabaseModels;
|
||||||
|
|
||||||
namespace EgtBEAMWALL.DataLayer.Controllers
|
namespace EgtBEAMWALL.DataLayer.Controllers
|
||||||
{
|
{
|
||||||
public class LogSupportController : IDisposable
|
public class LogSupportController : IDisposable
|
||||||
{
|
{
|
||||||
|
#region Private Fields
|
||||||
|
|
||||||
|
private DatabaseContext dbCtx;
|
||||||
|
|
||||||
|
#endregion Private Fields
|
||||||
|
|
||||||
#region Public Constructors
|
#region Public Constructors
|
||||||
|
|
||||||
public LogSupportController()
|
public LogSupportController()
|
||||||
{
|
{
|
||||||
|
// Initialize database context
|
||||||
|
dbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion Public Constructors
|
#endregion Public Constructors
|
||||||
@@ -33,28 +41,24 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
|||||||
public bool Create(DateTime dtCreated, Core.LogSupportLevel level, Core.LogSupportTarget target, string message)
|
public bool Create(DateTime dtCreated, Core.LogSupportLevel level, Core.LogSupportTarget target, string message)
|
||||||
{
|
{
|
||||||
bool fatto = false;
|
bool fatto = false;
|
||||||
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
try
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
try
|
LogSupportModel newItem = new LogSupportModel() { DtEvent = dtCreated, Level = level, Target = target, Message = message };
|
||||||
{
|
// Add to database
|
||||||
LogSupportModel newItem = new LogSupportModel() { DtEvent = dtCreated, Level = level, Target = target, Message = message };
|
dbCtx.LogSupportList.Add(newItem);
|
||||||
// Add to database
|
// Commit changes
|
||||||
localDbCtx.LogSupportList.Add(newItem);
|
dbCtx.SaveChanges();
|
||||||
// Commit changes
|
ResetController();
|
||||||
localDbCtx.SaveChanges();
|
}
|
||||||
}
|
catch (Exception exc)
|
||||||
catch (Exception exc)
|
{
|
||||||
{
|
Console.WriteLine($"EXCEPTION on Create LogSupport: {exc}");
|
||||||
string errMessage = $"EXCEPTION on LogSupport.Create: {Environment.NewLine}{exc}";
|
|
||||||
Console.WriteLine(errMessage);
|
|
||||||
Log.Error(errMessage);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
catch
|
|
||||||
{ }
|
|
||||||
}
|
}
|
||||||
|
catch
|
||||||
|
{ }
|
||||||
return fatto;
|
return fatto;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -66,31 +70,29 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
|||||||
public bool DeleteByKey(int LogDbId)
|
public bool DeleteByKey(int LogDbId)
|
||||||
{
|
{
|
||||||
bool done = false;
|
bool done = false;
|
||||||
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
var items2del = dbCtx
|
||||||
|
.LogSupportList
|
||||||
|
.Where(x => x.LogDbId == LogDbId);
|
||||||
|
try
|
||||||
{
|
{
|
||||||
var items2del = localDbCtx
|
// Add to database
|
||||||
.LogSupportList
|
dbCtx.LogSupportList.RemoveRange(items2del);
|
||||||
.Where(x => x.LogDbId == LogDbId);
|
// Commit changes
|
||||||
try
|
dbCtx.SaveChanges();
|
||||||
{
|
ResetController();
|
||||||
// Add to database
|
done = true;
|
||||||
localDbCtx.LogSupportList.RemoveRange(items2del);
|
}
|
||||||
// Commit changes
|
catch (Exception exc)
|
||||||
localDbCtx.SaveChanges();
|
{
|
||||||
done = true;
|
Console.WriteLine($"EXCEPTION on DeleteByKey: {exc}");
|
||||||
}
|
|
||||||
catch (Exception exc)
|
|
||||||
{
|
|
||||||
string errMessage = $"EXCEPTION on LogSupport.DeleteByKey: {Environment.NewLine}{exc}";
|
|
||||||
Console.WriteLine(errMessage);
|
|
||||||
Log.Error(errMessage);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return done;
|
return done;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Dispose()
|
public void Dispose()
|
||||||
{
|
{
|
||||||
|
// Clear database context
|
||||||
|
dbCtx.Dispose();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -100,13 +102,10 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
|||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public LogSupportModel FindByDbId(int LogDbId)
|
public LogSupportModel FindByDbId(int LogDbId)
|
||||||
{
|
{
|
||||||
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
return dbCtx
|
||||||
{
|
.LogSupportList
|
||||||
return localDbCtx
|
.Where(x => x.LogDbId == LogDbId)
|
||||||
.LogSupportList
|
.SingleOrDefault();
|
||||||
.Where(x => x.LogDbId == LogDbId)
|
|
||||||
.SingleOrDefault();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -118,14 +117,11 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
|||||||
public List<LogSupportModel> GetPaginatedAsc(DateTime dtStart, DateTime dtEnd)
|
public List<LogSupportModel> GetPaginatedAsc(DateTime dtStart, DateTime dtEnd)
|
||||||
{
|
{
|
||||||
// retrieve
|
// retrieve
|
||||||
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
return dbCtx
|
||||||
{
|
|
||||||
return localDbCtx
|
|
||||||
.LogSupportList
|
.LogSupportList
|
||||||
.Where(x => x.DtEvent >= dtStart && x.DtEvent <= dtEnd)
|
.Where(x => x.DtEvent >= dtStart && x.DtEvent <= dtEnd)
|
||||||
.OrderBy(x => x.DtEvent)
|
.OrderBy(x => x.DtEvent)
|
||||||
.ToList();
|
.ToList();
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -137,14 +133,20 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
|||||||
public List<LogSupportModel> GetPaginatedDesc(DateTime dtStart, DateTime dtEnd)
|
public List<LogSupportModel> GetPaginatedDesc(DateTime dtStart, DateTime dtEnd)
|
||||||
{
|
{
|
||||||
// retrieve
|
// retrieve
|
||||||
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
return dbCtx
|
||||||
{
|
|
||||||
return localDbCtx
|
|
||||||
.LogSupportList
|
.LogSupportList
|
||||||
.Where(x => x.DtEvent >= dtStart && x.DtEvent <= dtEnd)
|
.Where(x => x.DtEvent >= dtStart && x.DtEvent <= dtEnd)
|
||||||
.OrderByDescending(x => x.DtEvent)
|
.OrderByDescending(x => x.DtEvent)
|
||||||
.ToList();
|
.ToList();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Reinizializzaizone del controller
|
||||||
|
/// </summary>
|
||||||
|
public void ResetController()
|
||||||
|
{
|
||||||
|
// Re-Initialize database context
|
||||||
|
dbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -155,40 +157,27 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
|||||||
public bool Update(LogSupportModel updItem)
|
public bool Update(LogSupportModel updItem)
|
||||||
{
|
{
|
||||||
bool done = false;
|
bool done = false;
|
||||||
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
var item2update = dbCtx
|
||||||
{
|
|
||||||
var item2update = localDbCtx
|
|
||||||
.LogSupportList
|
.LogSupportList
|
||||||
.Where(x => x.LogDbId == updItem.LogDbId)
|
.Where(x => x.LogDbId == updItem.LogDbId)
|
||||||
.SingleOrDefault();
|
.SingleOrDefault();
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
// update, vers 1...
|
// update, vers 1...
|
||||||
localDbCtx.Entry(item2update).CurrentValues.SetValues(updItem);
|
dbCtx.Entry(item2update).CurrentValues.SetValues(updItem);
|
||||||
|
|
||||||
// Commit changes
|
// Commit changes
|
||||||
localDbCtx.SaveChanges();
|
dbCtx.SaveChanges();
|
||||||
done = true;
|
ResetController();
|
||||||
}
|
done = true;
|
||||||
catch (Exception exc)
|
}
|
||||||
{
|
catch (Exception exc)
|
||||||
string errMessage = $"EXCEPTION on LogSupport.Update: {Environment.NewLine}{exc}";
|
{
|
||||||
Console.WriteLine(errMessage);
|
Console.WriteLine($"EXCEPTION on Update: {exc}");
|
||||||
Log.Error(errMessage);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return done;
|
return done;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion Public Methods
|
#endregion Public Methods
|
||||||
|
|
||||||
#region Private Fields
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Istanza logger
|
|
||||||
/// </summary>
|
|
||||||
private NLog.Logger Log = LogManager.GetCurrentClassLogger();
|
|
||||||
|
|
||||||
#endregion Private Fields
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,5 +1,4 @@
|
|||||||
using EgtBEAMWALL.DataLayer.DatabaseModels;
|
using EgtBEAMWALL.DataLayer.DatabaseModels;
|
||||||
using NLog;
|
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
@@ -8,10 +7,24 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
|||||||
{
|
{
|
||||||
public class MachGroupController : IDisposable
|
public class MachGroupController : IDisposable
|
||||||
{
|
{
|
||||||
|
#region Private Fields
|
||||||
|
|
||||||
|
private DatabaseContext dbCtx;
|
||||||
|
|
||||||
|
#endregion Private Fields
|
||||||
|
|
||||||
|
#region Public Fields
|
||||||
|
|
||||||
|
public static MachGroupController man = new MachGroupController();
|
||||||
|
|
||||||
|
#endregion Public Fields
|
||||||
|
|
||||||
#region Public Constructors
|
#region Public Constructors
|
||||||
|
|
||||||
public MachGroupController()
|
public MachGroupController()
|
||||||
{
|
{
|
||||||
|
// Initialize database context
|
||||||
|
dbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion Public Constructors
|
#endregion Public Constructors
|
||||||
@@ -24,7 +37,7 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
|||||||
/// <param name="coreMachGroup"></param>
|
/// <param name="coreMachGroup"></param>
|
||||||
/// <param name="currProdDbId"></param>
|
/// <param name="currProdDbId"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public MachGroupModel ConvertFromCore(Core.MyMachGroupM coreMachGroup, int currProdDbId)
|
public static MachGroupModel ConvertFromCore(Core.MyMachGroupM coreMachGroup, int currProdDbId)
|
||||||
{
|
{
|
||||||
MachGroupModel answ = new MachGroupModel();
|
MachGroupModel answ = new MachGroupModel();
|
||||||
if (coreMachGroup != null)
|
if (coreMachGroup != null)
|
||||||
@@ -50,26 +63,21 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
|||||||
return answ;
|
return answ;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary> Add MachGroup as rebuilt from NeedRedo (on top of order priority) <param
|
/// <summary>
|
||||||
/// name="ProdId">Id del Prod</param> <param name="newMachGroup">Nuovo MachGroup da
|
/// Add MachGroup as rebuilt from NeedRedo (on top of order priority)
|
||||||
/// associare</param> <returns></returns>
|
/// <param name="ProdId">Id del Prod</param>
|
||||||
|
/// <param name="newMachGroup">Nuovo MachGroup da associare</param>
|
||||||
|
/// <returns></returns>
|
||||||
public ProdModel AddMachGroupRedo(int ProdId, Core.MyMachGroupM newMachGroup)
|
public ProdModel AddMachGroupRedo(int ProdId, Core.MyMachGroupM newMachGroup)
|
||||||
{
|
{
|
||||||
ProdModel currData = new ProdModel();
|
// Recupero il PROD
|
||||||
|
ProdModel currData = ProdController.man.FindByProdId(ProdId);
|
||||||
List<PartModel> PartList2Add = new List<PartModel>();
|
List<PartModel> PartList2Add = new List<PartModel>();
|
||||||
var myPartCtrl = new PartController();
|
|
||||||
var myStatusMapCtrl = new StatusMapController();
|
|
||||||
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
||||||
{
|
{
|
||||||
// Recupero il PROD nel contesto
|
|
||||||
currData = localDbCtx
|
|
||||||
.ProdList
|
|
||||||
.Where(x => x.ProdId == ProdId)
|
|
||||||
.SingleOrDefault();
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
var locMGCtrl = new MachGroupController();
|
var convCurrMG = MachGroupController.ConvertFromCore(newMachGroup, currData.ProdDbId);
|
||||||
var convCurrMG = locMGCtrl.ConvertFromCore(newMachGroup, currData.ProdDbId);
|
|
||||||
|
|
||||||
convCurrMG.ProdIndex = 1;
|
convCurrMG.ProdIndex = 1;
|
||||||
|
|
||||||
@@ -78,25 +86,15 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
|||||||
// Commit changes
|
// Commit changes
|
||||||
localDbCtx.SaveChanges();
|
localDbCtx.SaveChanges();
|
||||||
|
|
||||||
int MachGroupDbId = FindByMachGroupId(ProdId, newMachGroup.Id).MachGroupDbId;
|
int MachGroupDbId = MachGroupController.man.FindByMachGroupId(ProdId, newMachGroup.Id).MachGroupDbId;
|
||||||
// 2023.05.10 leggo elenco part in una sola volta
|
|
||||||
|
|
||||||
var currMgPartList = localDbCtx
|
|
||||||
.PartList
|
|
||||||
.Where(x => x.MachGroup.Prod.ProdId == ProdId && x.MachGroup.MachGroupId == newMachGroup.Id)
|
|
||||||
.ToList();
|
|
||||||
// verifico se uguali o meno...
|
// verifico se uguali o meno...
|
||||||
foreach (var currPartM in newMachGroup.PartMList)
|
foreach (var currPartM in newMachGroup.PartMList)
|
||||||
{
|
{
|
||||||
//var currPart = localDbCtx
|
var currPart = localDbCtx
|
||||||
// .PartList
|
.PartList
|
||||||
// .Where(x => x.MachGroup.Prod.ProdId == ProdId && x.MachGroup.MachGroupId == newMachGroup.Id && x.PartId == currPartM.nPartId)
|
.Where(x => x.MachGroup.Prod.ProdId == ProdId && x.MachGroup.MachGroupId == newMachGroup.Id && x.PartId == currPartM.nPartId)
|
||||||
// .SingleOrDefault();
|
|
||||||
var currPart = currMgPartList
|
|
||||||
.Where(x => x.PartId == currPartM.nPartId)
|
|
||||||
.SingleOrDefault();
|
.SingleOrDefault();
|
||||||
|
var convCurrPartM = PartController.ConvertFromCore(currPartM, MachGroupDbId);
|
||||||
var convCurrPartM = myPartCtrl.ConvertFromCore(currPartM, MachGroupDbId);
|
|
||||||
if (currPart != null)
|
if (currPart != null)
|
||||||
{
|
{
|
||||||
// se non identico x equality limitata a ViewOptim...
|
// se non identico x equality limitata a ViewOptim...
|
||||||
@@ -132,13 +130,11 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
|||||||
// Commit changes
|
// Commit changes
|
||||||
localDbCtx.SaveChanges();
|
localDbCtx.SaveChanges();
|
||||||
// aggiorno info sullo status
|
// aggiorno info sullo status
|
||||||
myStatusMapCtrl.UpdateAction("", ProdId, newMachGroup.Id, Core.StatusMapItemType.MachGroup, Core.StatusMapOpType.MachGroupAdd, "");
|
StatusMapController.man.UpdateAction("", ProdId, newMachGroup.Id, Core.StatusMapItemType.MachGroup, Core.StatusMapOpType.MachGroupAdd, "");
|
||||||
}
|
}
|
||||||
catch (Exception exc)
|
catch (Exception exc)
|
||||||
{
|
{
|
||||||
string errMessage = $"EXCEPTION on MachGroup.UpdateMachGroup: {Environment.NewLine}{exc}";
|
Console.WriteLine($"EXCEPTION on UpdateMachGroup: {exc}");
|
||||||
Console.WriteLine(errMessage);
|
|
||||||
Log.Error(errMessage);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return currData;
|
return currData;
|
||||||
@@ -165,9 +161,7 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
|||||||
}
|
}
|
||||||
catch (Exception exc)
|
catch (Exception exc)
|
||||||
{
|
{
|
||||||
string errMessage = $"EXCEPTION on MachGroup.Create: {Environment.NewLine}{exc}";
|
Console.WriteLine($"EXCEPTION on Create: {exc}");
|
||||||
Console.WriteLine(errMessage);
|
|
||||||
Log.Error(errMessage);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return newMachGroup;
|
return newMachGroup;
|
||||||
@@ -184,7 +178,6 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
|||||||
bool done = false;
|
bool done = false;
|
||||||
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
||||||
{
|
{
|
||||||
var myStatusMapCtrl = new StatusMapController();
|
|
||||||
// inizio eliminando le part
|
// inizio eliminando le part
|
||||||
var parts2del = localDbCtx
|
var parts2del = localDbCtx
|
||||||
.PartList
|
.PartList
|
||||||
@@ -205,25 +198,25 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
|||||||
localDbCtx.SaveChanges();
|
localDbCtx.SaveChanges();
|
||||||
|
|
||||||
// registro modifica StatusMap
|
// registro modifica StatusMap
|
||||||
myStatusMapCtrl.UpdateAction(MG2Del.SupervisorId, ProdId, MG2Del.MachGroupId, Core.StatusMapItemType.MachGroup, Core.StatusMapOpType.MachGroupRem, "");
|
StatusMapController.man.UpdateAction(MG2Del.SupervisorId, ProdId, MG2Del.MachGroupId, Core.StatusMapItemType.MachGroup, Core.StatusMapOpType.MachGroupRem, "");
|
||||||
|
|
||||||
done = true;
|
done = true;
|
||||||
}
|
}
|
||||||
catch (Exception exc)
|
catch (Exception exc)
|
||||||
{
|
{
|
||||||
string errMessage = $"EXCEPTION on MachGroup.Delete: ProdId: {ProdId} | MachGroupId: {MachGroupId}{Environment.NewLine}{exc}";
|
Console.WriteLine($"EXCEPTION on Delete: ProdId: {ProdId} | MachGroupId: {MachGroupId}{Environment.NewLine}{exc}");
|
||||||
Console.WriteLine(errMessage);
|
|
||||||
Log.Error(errMessage);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// se fatto aggiorno info sullo status
|
// se fatto aggiorno info sullo status
|
||||||
myStatusMapCtrl.UpdateAction("", ProdId, MachGroupId, Core.StatusMapItemType.MachGroup, Core.StatusMapOpType.MachGroupRem, "");
|
StatusMapController.man.UpdateAction("", ProdId, MachGroupId, Core.StatusMapItemType.MachGroup, Core.StatusMapOpType.MachGroupRem, "");
|
||||||
}
|
}
|
||||||
return done;
|
return done;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Dispose()
|
public void Dispose()
|
||||||
{
|
{
|
||||||
|
// Clear database context
|
||||||
|
dbCtx.Dispose();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -233,13 +226,10 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
|||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public MachGroupModel FindByMachGroupDbId(int MachGroupDbId)
|
public MachGroupModel FindByMachGroupDbId(int MachGroupDbId)
|
||||||
{
|
{
|
||||||
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
return dbCtx
|
||||||
{
|
.MachGroupList
|
||||||
return localDbCtx
|
.Where(x => x.MachGroupDbId == MachGroupDbId)
|
||||||
.MachGroupList
|
.SingleOrDefault();
|
||||||
.Where(x => x.MachGroupDbId == MachGroupDbId)
|
|
||||||
.SingleOrDefault();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -249,6 +239,7 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
|||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public MachGroupModel FindByMachGroupId(int ProdId, int MachGroupId)
|
public MachGroupModel FindByMachGroupId(int ProdId, int MachGroupId)
|
||||||
{
|
{
|
||||||
|
|
||||||
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
||||||
{
|
{
|
||||||
return localDbCtx
|
return localDbCtx
|
||||||
@@ -267,34 +258,27 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
|||||||
{
|
{
|
||||||
// verificare fattibilità in 1 solo passo
|
// verificare fattibilità in 1 solo passo
|
||||||
int ProdDbId = 0;
|
int ProdDbId = 0;
|
||||||
List<MachGroupModel> answ = new List<MachGroupModel>();
|
try
|
||||||
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
|
||||||
{
|
{
|
||||||
try
|
var currProd = dbCtx
|
||||||
|
.ProdList
|
||||||
|
.Where(x => x.ProdId == ProdId)
|
||||||
|
.FirstOrDefault();
|
||||||
|
if (currProd != null)
|
||||||
{
|
{
|
||||||
var currProd = localDbCtx
|
ProdDbId = currProd.ProdDbId;
|
||||||
.ProdList
|
|
||||||
.Where(x => x.ProdId == ProdId)
|
|
||||||
.FirstOrDefault();
|
|
||||||
if (currProd != null)
|
|
||||||
{
|
|
||||||
ProdDbId = currProd.ProdDbId;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
catch (Exception exc)
|
|
||||||
{
|
|
||||||
string errMessage = $"EXCEPTION on MachGroup.GetByProdAsc: {Environment.NewLine}{exc}";
|
|
||||||
Console.WriteLine(errMessage);
|
|
||||||
Log.Error(errMessage);
|
|
||||||
}
|
|
||||||
answ = localDbCtx
|
|
||||||
.MachGroupList
|
|
||||||
.Where(x => x.ProdDbId == ProdDbId)
|
|
||||||
.OrderBy(x => x.ProdIndex)
|
|
||||||
.ThenBy(x => x.MachGroupId)
|
|
||||||
.ToList();
|
|
||||||
}
|
}
|
||||||
return answ;
|
catch (Exception exc)
|
||||||
|
{
|
||||||
|
Console.WriteLine($"EXCEPTION on GetByProdAsc: {exc}");
|
||||||
|
}
|
||||||
|
return dbCtx
|
||||||
|
.MachGroupList
|
||||||
|
.Where(x => x.ProdDbId == ProdDbId)
|
||||||
|
.OrderBy(x => x.ProdIndex)
|
||||||
|
.ThenBy(x => x.MachGroupId)
|
||||||
|
.ToList();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -306,35 +290,29 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
|||||||
{
|
{
|
||||||
// recupero
|
// recupero
|
||||||
int ProdDbId = 0;
|
int ProdDbId = 0;
|
||||||
List<MachGroupModel> answ = new List<MachGroupModel>();
|
|
||||||
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
// verificare fattibilità in 1 solo passo
|
||||||
|
try
|
||||||
{
|
{
|
||||||
// verificare fattibilità in 1 solo passo
|
var currProd = dbCtx
|
||||||
try
|
.ProdList
|
||||||
|
.Where(x => x.ProdId == ProdId)
|
||||||
|
.FirstOrDefault();
|
||||||
|
if (currProd != null)
|
||||||
{
|
{
|
||||||
var currProd = localDbCtx
|
ProdDbId = currProd.ProdDbId;
|
||||||
.ProdList
|
|
||||||
.Where(x => x.ProdId == ProdId)
|
|
||||||
.FirstOrDefault();
|
|
||||||
if (currProd != null)
|
|
||||||
{
|
|
||||||
ProdDbId = currProd.ProdDbId;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
catch (Exception exc)
|
|
||||||
{
|
|
||||||
string errMessage = $"EXCEPTION on MachGroup.GetByProdDesc: {Environment.NewLine}{exc}";
|
|
||||||
Console.WriteLine(errMessage);
|
|
||||||
Log.Error(errMessage);
|
|
||||||
}
|
|
||||||
answ = localDbCtx
|
|
||||||
.MachGroupList
|
|
||||||
.Where(x => x.ProdDbId == ProdDbId)
|
|
||||||
.OrderByDescending(x => x.ProdIndex)
|
|
||||||
.ThenByDescending(x => x.MachGroupId)
|
|
||||||
.ToList();
|
|
||||||
}
|
}
|
||||||
return answ;
|
catch (Exception exc)
|
||||||
|
{
|
||||||
|
Console.WriteLine($"EXCEPTION on GetByProdDesc: {exc}");
|
||||||
|
}
|
||||||
|
return dbCtx
|
||||||
|
.MachGroupList
|
||||||
|
.Where(x => x.ProdDbId == ProdDbId)
|
||||||
|
.OrderByDescending(x => x.ProdIndex)
|
||||||
|
.ThenByDescending(x => x.MachGroupId)
|
||||||
|
.ToList();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -345,15 +323,12 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
|||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public List<MachGroupModel> GetByProdSupervisor(int ProdId, string SupervisorId)
|
public List<MachGroupModel> GetByProdSupervisor(int ProdId, string SupervisorId)
|
||||||
{
|
{
|
||||||
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
return dbCtx
|
||||||
{
|
.MachGroupList
|
||||||
return localDbCtx
|
.Where(x => x.Prod.ProdId == ProdId && x.SupervisorId == SupervisorId)
|
||||||
.MachGroupList
|
.OrderBy(x => x.ProdIndex)
|
||||||
.Where(x => x.Prod.ProdId == ProdId && x.SupervisorId == SupervisorId)
|
.ThenBy(x => x.MachGroupId)
|
||||||
.OrderBy(x => x.ProdIndex)
|
.ToList();
|
||||||
.ThenBy(x => x.MachGroupId)
|
|
||||||
.ToList();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -381,9 +356,7 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
|||||||
}
|
}
|
||||||
catch (Exception exc)
|
catch (Exception exc)
|
||||||
{
|
{
|
||||||
string errMessage = $"EXCEPTION on MachGroup.UpdateOrder: {Environment.NewLine}{exc}";
|
Console.WriteLine($"EXCEPTION on UpdateOrder: {exc}");
|
||||||
Console.WriteLine(errMessage);
|
|
||||||
Log.Error(errMessage);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -401,7 +374,6 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
|||||||
bool done = false;
|
bool done = false;
|
||||||
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
||||||
{
|
{
|
||||||
var myStatusMapCtrl = new StatusMapController();
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
// aggiorno
|
// aggiorno
|
||||||
@@ -414,30 +386,31 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
|||||||
currRecord.State = Core.ItemState.ND;
|
currRecord.State = Core.ItemState.ND;
|
||||||
currRecord.SupervisorId = "";
|
currRecord.SupervisorId = "";
|
||||||
currRecord.ProdIndex = 0;
|
currRecord.ProdIndex = 0;
|
||||||
// Commit changes
|
}
|
||||||
localDbCtx.SaveChanges();
|
// Commit changes
|
||||||
// aggiorno info sullo status
|
localDbCtx.SaveChanges();
|
||||||
myStatusMapCtrl.UpdateAction("", ProdId, MachGroupId, Core.StatusMapItemType.MachGroup, Core.StatusMapOpType.MachGroupRemovedFromSupervisor, "");
|
// aggiorno info sullo status
|
||||||
|
StatusMapController.man.UpdateAction("", ProdId, MachGroupId, Core.StatusMapItemType.MachGroup, Core.StatusMapOpType.MachGroupRemovedFromSupervisor, "");
|
||||||
|
|
||||||
done = true;
|
done = true;
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
string errMessage = $"ERROR on MachGroup.RemoveFromSupervisor: req item was not found | ProdId {ProdId} | MachGroupId {MachGroupId}";
|
|
||||||
Console.WriteLine(errMessage);
|
|
||||||
Log.Error(errMessage);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
catch (Exception exc)
|
catch (Exception exc)
|
||||||
{
|
{
|
||||||
string errMessage = $"EXCEPTION on MachGroup.RemoveFromSupervisor: {Environment.NewLine}{exc}";
|
Console.WriteLine($"EXCEPTION on RemoveFromSupervisor: {exc}");
|
||||||
Console.WriteLine(errMessage);
|
|
||||||
Log.Error(errMessage);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return done;
|
return done;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Reinizializzaizone del controller
|
||||||
|
/// </summary>
|
||||||
|
public void ResetController()
|
||||||
|
{
|
||||||
|
// Re-Initialize database context
|
||||||
|
dbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING);
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Set MachGroup as NeedRedo (ripresa = da rigenerare)
|
/// Set MachGroup as NeedRedo (ripresa = da rigenerare)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -450,35 +423,23 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
|||||||
bool done = false;
|
bool done = false;
|
||||||
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
||||||
{
|
{
|
||||||
var myStatusMapCtrl = new StatusMapController();
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
// aggiorno
|
// aggiorno
|
||||||
var item2upd = localDbCtx
|
localDbCtx
|
||||||
.MachGroupList
|
.MachGroupList
|
||||||
.Where(x => x.Prod.ProdId == ProdId && x.MachGroupId == MachGroupId)
|
.Where(x => x.Prod.ProdId == ProdId && x.MachGroupId == MachGroupId)
|
||||||
.FirstOrDefault();
|
.FirstOrDefault()
|
||||||
if (item2upd != null)
|
.State = newState;
|
||||||
{
|
// Commit changes
|
||||||
item2upd.State = newState;
|
localDbCtx.SaveChanges();
|
||||||
// Commit changes
|
done = true;
|
||||||
localDbCtx.SaveChanges();
|
// aggiorno info sullo status
|
||||||
done = true;
|
StatusMapController.man.UpdateAction("", ProdId, MachGroupId, Core.StatusMapItemType.MachGroup, Core.StatusMapOpType.MachGroupNeedRedo, Value);
|
||||||
// aggiorno info sullo status
|
|
||||||
myStatusMapCtrl.UpdateAction("", ProdId, MachGroupId, Core.StatusMapItemType.MachGroup, Core.StatusMapOpType.MachGroupNeedRedo, Value);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
string errMessage = $"ERROR on MachGroup.SetNeedRedo: req item was not found | ProdId {ProdId} | MachGroupId {MachGroupId} | newState {newState} | Value {Value}";
|
|
||||||
Console.WriteLine(errMessage);
|
|
||||||
Log.Error(errMessage);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
catch (Exception exc)
|
catch (Exception exc)
|
||||||
{
|
{
|
||||||
string errMessage = $"EXCEPTION on MachGroup.SetNeedRedo: {Environment.NewLine}{exc}";
|
Console.WriteLine($"EXCEPTION on UpdateStatus: {exc}");
|
||||||
Console.WriteLine(errMessage);
|
|
||||||
Log.Error(errMessage);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return done;
|
return done;
|
||||||
@@ -494,36 +455,24 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
|||||||
bool done = false;
|
bool done = false;
|
||||||
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
||||||
{
|
{
|
||||||
var myStatusMapCtrl = new StatusMapController();
|
var item2update = localDbCtx
|
||||||
|
.MachGroupList
|
||||||
|
.Where(x => x.MachGroupDbId == updItem.MachGroupDbId)
|
||||||
|
.SingleOrDefault();
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
var item2update = localDbCtx
|
// update, vers 1...
|
||||||
.MachGroupList
|
localDbCtx.Entry(item2update).CurrentValues.SetValues(updItem);
|
||||||
.Where(x => x.MachGroupDbId == updItem.MachGroupDbId)
|
|
||||||
.SingleOrDefault();
|
|
||||||
if (item2update != null)
|
|
||||||
{
|
|
||||||
// update, vers 1...
|
|
||||||
localDbCtx.Entry(item2update).CurrentValues.SetValues(updItem);
|
|
||||||
|
|
||||||
// Commit changes
|
// Commit changes
|
||||||
localDbCtx.SaveChanges();
|
localDbCtx.SaveChanges();
|
||||||
done = true;
|
done = true;
|
||||||
// aggiorno info sullo status
|
// aggiorno info sullo status
|
||||||
myStatusMapCtrl.UpdateAction("", updItem.Prod.ProdId, updItem.MachGroupId, Core.StatusMapItemType.MachGroup, Core.StatusMapOpType.MachGroupMod, "");
|
StatusMapController.man.UpdateAction("", updItem.Prod.ProdId, updItem.MachGroupId, Core.StatusMapItemType.MachGroup, Core.StatusMapOpType.MachGroupMod, "");
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
string errMessage = $"ERROR on MachGroup.Update: req item was not found | ProdDbId {updItem.ProdDbId} | MachGroupId {updItem.MachGroupId} | ProdIndex {updItem.ProdIndex}";
|
|
||||||
Console.WriteLine(errMessage);
|
|
||||||
Log.Error(errMessage);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
catch (Exception exc)
|
catch (Exception exc)
|
||||||
{
|
{
|
||||||
string errMessage = $"EXCEPTION on MachGroup.Update: {Environment.NewLine}{exc}";
|
Console.WriteLine($"EXCEPTION on Update: {exc}");
|
||||||
Console.WriteLine(errMessage);
|
|
||||||
Log.Error(errMessage);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return done;
|
return done;
|
||||||
@@ -541,7 +490,6 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
|||||||
bool done = false;
|
bool done = false;
|
||||||
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
||||||
{
|
{
|
||||||
var myStatusMapCtrl = new StatusMapController();
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
// aggiorno
|
// aggiorno
|
||||||
@@ -549,27 +497,19 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
|||||||
.MachGroupList
|
.MachGroupList
|
||||||
.Where(x => x.Prod.ProdId == ProdId && x.MachGroupId == MachGroupId)
|
.Where(x => x.Prod.ProdId == ProdId && x.MachGroupId == MachGroupId)
|
||||||
.FirstOrDefault();
|
.FirstOrDefault();
|
||||||
if (currRecord != null)
|
|
||||||
{
|
currRecord.DtEnd = DtEnd;
|
||||||
currRecord.DtEnd = DtEnd;
|
|
||||||
// Commit changes
|
// Commit changes
|
||||||
localDbCtx.SaveChanges();
|
localDbCtx.SaveChanges();
|
||||||
done = true;
|
|
||||||
// aggiorno info sullo status
|
done = true;
|
||||||
myStatusMapCtrl.UpdateAction("", ProdId, MachGroupId, Core.StatusMapItemType.MachGroup, DtEnd == DateTime.MinValue ? Core.StatusMapOpType.ResetPartEnd : Core.StatusMapOpType.PartEnd, "");
|
// aggiorno info sullo status
|
||||||
}
|
StatusMapController.man.UpdateAction("", ProdId, MachGroupId, Core.StatusMapItemType.MachGroup, DtEnd == DateTime.MinValue ? Core.StatusMapOpType.ResetPartEnd : Core.StatusMapOpType.PartEnd, "");
|
||||||
else
|
|
||||||
{
|
|
||||||
string errMessage = $"ERROR on MachGroup.UpdateEnd: req item was not found | ProdId {ProdId} | MachGroupId {MachGroupId} | DtEnd {DtEnd}";
|
|
||||||
Console.WriteLine(errMessage);
|
|
||||||
Log.Error(errMessage);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
catch (Exception exc)
|
catch (Exception exc)
|
||||||
{
|
{
|
||||||
string errMessage = $"EXCEPTION on MachGroup.UpdateEnd: {Environment.NewLine}{exc}";
|
Console.WriteLine($"EXCEPTION on UpdateStartEnd: {exc}");
|
||||||
Console.WriteLine(errMessage);
|
|
||||||
Log.Error(errMessage);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return done;
|
return done;
|
||||||
@@ -590,29 +530,19 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
// aggiorno
|
// aggiorno
|
||||||
var item2upd = localDbCtx
|
localDbCtx
|
||||||
.MachGroupList
|
.MachGroupList
|
||||||
.Where(x => x.Prod.ProdId == ProdId && x.MachGroupId == MachGroupId)
|
.Where(x => x.Prod.ProdId == ProdId && x.MachGroupId == MachGroupId)
|
||||||
.FirstOrDefault();
|
.FirstOrDefault()
|
||||||
if (item2upd != null)
|
.ProdIndex = newProdIndex;
|
||||||
{
|
// Commit changes
|
||||||
item2upd.ProdIndex = newProdIndex;
|
localDbCtx.SaveChanges();
|
||||||
// Commit changes
|
|
||||||
localDbCtx.SaveChanges();
|
done = true;
|
||||||
done = true;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
string errMessage = $"ERROR on MachGroup.UpdateOrder: req item was not found | ProdId {ProdId} | MachGroupId {MachGroupId} | newProdIndex {newProdIndex}";
|
|
||||||
Console.WriteLine(errMessage);
|
|
||||||
Log.Error(errMessage);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
catch (Exception exc)
|
catch (Exception exc)
|
||||||
{
|
{
|
||||||
string errMessage = $"EXCEPTION on MachGroup.UpdateOrder: {Environment.NewLine}{exc}";
|
Console.WriteLine($"EXCEPTION on UpdateOrder: {exc}");
|
||||||
Console.WriteLine(errMessage);
|
|
||||||
Log.Error(errMessage);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return done;
|
return done;
|
||||||
@@ -631,7 +561,6 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
|||||||
bool done = false;
|
bool done = false;
|
||||||
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
||||||
{
|
{
|
||||||
var myStatusMapCtrl = new StatusMapController();
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
// aggiorno
|
// aggiorno
|
||||||
@@ -639,27 +568,19 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
|||||||
.MachGroupList
|
.MachGroupList
|
||||||
.Where(x => x.Prod.ProdId == ProdId && x.MachGroupId == MachGroupId)
|
.Where(x => x.Prod.ProdId == ProdId && x.MachGroupId == MachGroupId)
|
||||||
.FirstOrDefault();
|
.FirstOrDefault();
|
||||||
if (currRecord != null)
|
|
||||||
{
|
currRecord.DtStart = DtStart;
|
||||||
currRecord.DtStart = DtStart;
|
|
||||||
// Commit changes
|
// Commit changes
|
||||||
localDbCtx.SaveChanges();
|
localDbCtx.SaveChanges();
|
||||||
done = true;
|
|
||||||
// aggiorno info sullo status
|
done = true;
|
||||||
myStatusMapCtrl.UpdateAction("", ProdId, MachGroupId, Core.StatusMapItemType.MachGroup, DtStart == DateTime.MinValue ? Core.StatusMapOpType.ResetPartStart : Core.StatusMapOpType.PartStart, "");
|
// aggiorno info sullo status
|
||||||
}
|
StatusMapController.man.UpdateAction("", ProdId, MachGroupId, Core.StatusMapItemType.MachGroup, DtStart == DateTime.MinValue ? Core.StatusMapOpType.ResetPartStart : Core.StatusMapOpType.PartStart, "");
|
||||||
else
|
|
||||||
{
|
|
||||||
string errMessage = $"ERROR on MachGroup.UpdateStart: req item was not found | ProdId {ProdId} | MachGroupId {MachGroupId} | DtStart {DtStart}";
|
|
||||||
Console.WriteLine(errMessage);
|
|
||||||
Log.Error(errMessage);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
catch (Exception exc)
|
catch (Exception exc)
|
||||||
{
|
{
|
||||||
string errMessage = $"EXCEPTION on MachGroup.UpdateStart: {Environment.NewLine}{exc}";
|
Console.WriteLine($"EXCEPTION on UpdateStartEnd: {exc}");
|
||||||
Console.WriteLine(errMessage);
|
|
||||||
Log.Error(errMessage);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return done;
|
return done;
|
||||||
@@ -678,7 +599,6 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
|||||||
bool done = false;
|
bool done = false;
|
||||||
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
||||||
{
|
{
|
||||||
var myStatusMapCtrl = new StatusMapController();
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
// aggiorno
|
// aggiorno
|
||||||
@@ -686,28 +606,19 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
|||||||
.MachGroupList
|
.MachGroupList
|
||||||
.Where(x => x.Prod.ProdId == ProdId && x.MachGroupId == MachGroupId)
|
.Where(x => x.Prod.ProdId == ProdId && x.MachGroupId == MachGroupId)
|
||||||
.FirstOrDefault();
|
.FirstOrDefault();
|
||||||
if (currRecord != null)
|
|
||||||
{
|
currRecord.DtStart = DtStart;
|
||||||
currRecord.DtStart = DtStart;
|
currRecord.DtEnd = DtEnd;
|
||||||
currRecord.DtEnd = DtEnd;
|
|
||||||
// Commit changes
|
// Commit changes
|
||||||
localDbCtx.SaveChanges();
|
localDbCtx.SaveChanges();
|
||||||
done = true;
|
done = true;
|
||||||
// aggiorno info sullo status
|
// aggiorno info sullo status
|
||||||
myStatusMapCtrl.UpdateAction("", ProdId, MachGroupId, Core.StatusMapItemType.MachGroup, Core.StatusMapOpType.MachGroupMod, "");
|
StatusMapController.man.UpdateAction("", ProdId, MachGroupId, Core.StatusMapItemType.MachGroup, Core.StatusMapOpType.MachGroupMod, "");
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
string errMessage = $"ERROR on MachGroup.UpdateStartEnd: req item was not found | ProdId {ProdId} | MachGroupId {MachGroupId} | DtStart {DtStart} | DtEnd {DtEnd}";
|
|
||||||
Console.WriteLine(errMessage);
|
|
||||||
Log.Error(errMessage);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
catch (Exception exc)
|
catch (Exception exc)
|
||||||
{
|
{
|
||||||
string errMessage = $"EXCEPTION on MachGroup.UpdateStartEnd: {Environment.NewLine}{exc}";
|
Console.WriteLine($"EXCEPTION on UpdateStartEnd: {exc}");
|
||||||
Console.WriteLine(errMessage);
|
|
||||||
Log.Error(errMessage);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return done;
|
return done;
|
||||||
@@ -724,93 +635,67 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
|||||||
bool done = false;
|
bool done = false;
|
||||||
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
||||||
{
|
{
|
||||||
var myStatusMapCtrl = new StatusMapController();
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
// aggiorno
|
// aggiorno
|
||||||
var item2upd = localDbCtx
|
localDbCtx
|
||||||
.MachGroupList
|
.MachGroupList
|
||||||
.Where(x => x.Prod.ProdId == ProdId && x.MachGroupId == MachGroupId)
|
.Where(x => x.Prod.ProdId == ProdId && x.MachGroupId == MachGroupId)
|
||||||
.FirstOrDefault();
|
.FirstOrDefault()
|
||||||
if (item2upd != null)
|
.State = newState;
|
||||||
{
|
// Commit changes
|
||||||
item2upd.State = newState;
|
localDbCtx.SaveChanges();
|
||||||
// Commit changes
|
|
||||||
localDbCtx.SaveChanges();
|
done = true;
|
||||||
done = true;
|
// aggiorno info sullo status
|
||||||
// aggiorno info sullo status
|
StatusMapController.man.UpdateAction("", ProdId, MachGroupId, Core.StatusMapItemType.MachGroup, Core.StatusMapOpType.MachGroupMod, "");
|
||||||
myStatusMapCtrl.UpdateAction("", ProdId, MachGroupId, Core.StatusMapItemType.MachGroup, Core.StatusMapOpType.MachGroupMod, "");
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
string errMessage = $"ERROR on MachGroup.UpdateStatus: req item was not found | ProdId {ProdId} | MachGroupId {MachGroupId} | newState {newState}";
|
|
||||||
Console.WriteLine(errMessage);
|
|
||||||
Log.Error(errMessage);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
catch (Exception exc)
|
catch (Exception exc)
|
||||||
{
|
{
|
||||||
string errMessage = $"EXCEPTION on MachGroup.UpdateStatus: {Environment.NewLine}{exc}";
|
Console.WriteLine($"EXCEPTION on UpdateStatus: {exc}");
|
||||||
Console.WriteLine(errMessage);
|
|
||||||
Log.Error(errMessage);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return done;
|
return done;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary> Set Supervisor & state for MachGroup </summary> <param name="ProdId"></param>
|
/// <summary>
|
||||||
/// <param name="MachGroupId"></param> <param name="SupervisorId"></param> <returns></returns>
|
/// Set Supervisor & state for MachGroup
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="ProdId"></param>
|
||||||
|
/// <param name="MachGroupId"></param>
|
||||||
|
/// <param name="SupervisorId"></param>
|
||||||
|
/// <returns></returns>
|
||||||
public bool UpdateSupervisor(int ProdId, int MachGroupId, string SupervisorId)
|
public bool UpdateSupervisor(int ProdId, int MachGroupId, string SupervisorId)
|
||||||
{
|
{
|
||||||
bool done = false;
|
bool done = false;
|
||||||
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
||||||
{
|
{
|
||||||
var myStatusMapCtrl = new StatusMapController();
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
// aggiorno
|
// aggiorno
|
||||||
var item2upd = localDbCtx
|
var currRecord = localDbCtx
|
||||||
.MachGroupList
|
.MachGroupList
|
||||||
.Where(x => x.Prod.ProdId == ProdId && x.MachGroupId == MachGroupId)
|
.Where(x => x.Prod.ProdId == ProdId && x.MachGroupId == MachGroupId)
|
||||||
.FirstOrDefault();
|
.FirstOrDefault();
|
||||||
if (item2upd != null)
|
|
||||||
{
|
|
||||||
item2upd.SupervisorId = SupervisorId;
|
|
||||||
item2upd.State = Core.ItemState.Assigned;
|
|
||||||
|
|
||||||
// Commit changes
|
currRecord.SupervisorId = SupervisorId;
|
||||||
localDbCtx.SaveChanges();
|
currRecord.State = Core.ItemState.Assigned;
|
||||||
done = true;
|
|
||||||
|
|
||||||
// aggiorno info sullo status
|
// Commit changes
|
||||||
myStatusMapCtrl.UpdateAction("", ProdId, MachGroupId, Core.StatusMapItemType.MachGroup, Core.StatusMapOpType.MachGroupAssignedToSupervisor, "");
|
localDbCtx.SaveChanges();
|
||||||
}
|
|
||||||
else
|
done = true;
|
||||||
{
|
// aggiorno info sullo status
|
||||||
string errMessage = $"ERROR on MachGroup.UpdateSupervisor: req item was not found | ProdId {ProdId} | MachGroupId {MachGroupId} | SupervisorId {SupervisorId}";
|
StatusMapController.man.UpdateAction("", ProdId, MachGroupId, Core.StatusMapItemType.MachGroup, Core.StatusMapOpType.MachGroupAssignedToSupervisor, "");
|
||||||
Console.WriteLine(errMessage);
|
|
||||||
Log.Error(errMessage);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
catch (Exception exc)
|
catch (Exception exc)
|
||||||
{
|
{
|
||||||
string errMessage = $"EXCEPTION on MachGroup.UpdateSupervisor: {Environment.NewLine}{exc}";
|
Console.WriteLine($"EXCEPTION on UpdateSupervisor: {exc}");
|
||||||
Console.WriteLine(errMessage);
|
|
||||||
Log.Error(errMessage);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return done;
|
return done;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion Public Methods
|
#endregion Public Methods
|
||||||
|
|
||||||
#region Private Fields
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Istanza logger
|
|
||||||
/// </summary>
|
|
||||||
private NLog.Logger Log = LogManager.GetCurrentClassLogger();
|
|
||||||
|
|
||||||
#endregion Private Fields
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,19 +1,105 @@
|
|||||||
using EgtBEAMWALL.DataLayer.DatabaseModels;
|
using System;
|
||||||
using NLog;
|
using System.Collections.Generic;
|
||||||
using System;
|
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using EgtBEAMWALL.DataLayer.DatabaseModels;
|
||||||
|
|
||||||
namespace EgtBEAMWALL.DataLayer.Controllers
|
namespace EgtBEAMWALL.DataLayer.Controllers
|
||||||
{
|
{
|
||||||
public class PartController : IDisposable
|
public class PartController : IDisposable
|
||||||
{
|
{
|
||||||
|
#region Private Fields
|
||||||
|
|
||||||
|
private DatabaseContext dbCtx;
|
||||||
|
|
||||||
|
#endregion Private Fields
|
||||||
|
|
||||||
|
#region Public Fields
|
||||||
|
|
||||||
|
public static PartController man = new PartController();
|
||||||
|
|
||||||
|
#endregion Public Fields
|
||||||
|
|
||||||
#region Public Constructors
|
#region Public Constructors
|
||||||
|
|
||||||
public PartController()
|
public PartController()
|
||||||
{ }
|
{
|
||||||
|
// Initialize database context
|
||||||
|
dbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING);
|
||||||
|
}
|
||||||
|
|
||||||
#endregion Public Constructors
|
#endregion Public Constructors
|
||||||
|
|
||||||
|
#region Protected Methods
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Get BtlPartDBId by ProjId + PDN
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="ProjId"></param>
|
||||||
|
/// <param name="PDN"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
protected int FindBtlPart(int ProjId, int PDN)
|
||||||
|
{
|
||||||
|
int BtlPartDbId = 0;
|
||||||
|
|
||||||
|
#if false
|
||||||
|
var currProj = dbCtx
|
||||||
|
.ProjList
|
||||||
|
.Where(x => x.ProjId == ProjId)
|
||||||
|
.FirstOrDefault();
|
||||||
|
|
||||||
|
if (currProj != null)
|
||||||
|
{
|
||||||
|
var btlPart = dbCtx
|
||||||
|
.BTLPartList
|
||||||
|
.Where(x => x.ProjDbId == currProj.ProjDbId && x.PDN == PDN)
|
||||||
|
.SingleOrDefault();
|
||||||
|
|
||||||
|
if (btlPart != null)
|
||||||
|
{
|
||||||
|
BtlPartDbId = btlPart.BTLPartDbId;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
var btlPart = dbCtx
|
||||||
|
.BTLPartList
|
||||||
|
.Where(x => x.Project.ProjId == ProjId && x.PDN == PDN)
|
||||||
|
.SingleOrDefault();
|
||||||
|
|
||||||
|
if (btlPart != null)
|
||||||
|
{
|
||||||
|
BtlPartDbId = btlPart.BTLPartDbId;
|
||||||
|
}
|
||||||
|
|
||||||
|
return BtlPartDbId;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Get BtlPartDBId by ProjId + BtlPartId
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="ProjId"></param>
|
||||||
|
/// <param name="BtlPartId"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
protected int FindBtlPartByBPI(int ProjId, int BtlPartId)
|
||||||
|
{
|
||||||
|
int BtlPartDbId = 0;
|
||||||
|
|
||||||
|
var btlPart = dbCtx
|
||||||
|
.BTLPartList
|
||||||
|
.Where(x => x.Project.ProjId == ProjId && x.PartId == BtlPartId)
|
||||||
|
.SingleOrDefault();
|
||||||
|
|
||||||
|
if (btlPart != null)
|
||||||
|
{
|
||||||
|
BtlPartDbId = btlPart.BTLPartDbId;
|
||||||
|
}
|
||||||
|
|
||||||
|
return BtlPartDbId;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion Protected Methods
|
||||||
|
|
||||||
#region Public Methods
|
#region Public Methods
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -22,12 +108,12 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
|||||||
/// <param name="corePart"></param>
|
/// <param name="corePart"></param>
|
||||||
/// <param name="currMachGroupDbId"></param>
|
/// <param name="currMachGroupDbId"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public PartModel ConvertFromCore(Core.PartM corePart, int currMachGroupDbId)
|
public static PartModel ConvertFromCore(Core.PartM corePart, int currMachGroupDbId)
|
||||||
{
|
{
|
||||||
PartModel answ = new PartModel();
|
PartModel answ = new PartModel();
|
||||||
if (corePart != null)
|
if (corePart != null)
|
||||||
{
|
{
|
||||||
int BTLPartId = FindBtlPartByBPI(corePart.nProjId, corePart.nBTLPartId);
|
int BTLPartId = man.FindBtlPartByBPI(corePart.nProjId, corePart.nBTLPartId);
|
||||||
answ = new PartModel()
|
answ = new PartModel()
|
||||||
{
|
{
|
||||||
PartId = corePart.nPartId,
|
PartId = corePart.nPartId,
|
||||||
@@ -65,39 +151,24 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
|||||||
public bool Delete(int ProdId, int MachGroupId, int PartId)
|
public bool Delete(int ProdId, int MachGroupId, int PartId)
|
||||||
{
|
{
|
||||||
bool done = false;
|
bool done = false;
|
||||||
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
var item2del = dbCtx
|
||||||
|
.PartList
|
||||||
|
.Where(x => x.MachGroup.Prod.ProdId == ProdId && x.MachGroup.MachGroupId == MachGroupId && x.PartId == PartId)
|
||||||
|
.SingleOrDefault();
|
||||||
|
try
|
||||||
{
|
{
|
||||||
var myStatusMapCtrl = new StatusMapController();
|
// Remove from database
|
||||||
var item2del = localDbCtx
|
dbCtx.PartList.Remove(item2del);
|
||||||
.PartList
|
// Commit changes
|
||||||
.Where(x => x.MachGroup.Prod.ProdId == ProdId && x.MachGroup.MachGroupId == MachGroupId && x.PartId == PartId)
|
dbCtx.SaveChanges();
|
||||||
.SingleOrDefault();
|
ResetController();
|
||||||
|
done = true;
|
||||||
if (item2del != null)
|
// aggiorno info sullo status
|
||||||
{
|
StatusMapController.man.UpdateAction("", ProdId, MachGroupId, Core.StatusMapItemType.MachGroup, Core.StatusMapOpType.MachGroupMod, "");
|
||||||
try
|
}
|
||||||
{
|
catch (Exception exc)
|
||||||
// Remove from database
|
{
|
||||||
localDbCtx.PartList.Remove(item2del);
|
Console.WriteLine($"EXCEPTION on Delete: ProdId: {ProdId} | MachGroupId: {MachGroupId} | PartId: {PartId}{Environment.NewLine}{exc}");
|
||||||
// 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);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
string errMessage = $"ERROR on Part.Delete (01): req item was not found | ProdId {ProdId} | MachGroupId {MachGroupId} | PartId {PartId}";
|
|
||||||
Console.WriteLine(errMessage);
|
|
||||||
Log.Error(errMessage);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return done;
|
return done;
|
||||||
}
|
}
|
||||||
@@ -110,36 +181,22 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
|||||||
public bool Delete(int PartDbId)
|
public bool Delete(int PartDbId)
|
||||||
{
|
{
|
||||||
bool done = false;
|
bool done = false;
|
||||||
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
var item2del = dbCtx
|
||||||
|
.PartList
|
||||||
|
.Where(x => x.PartDbId == PartDbId)
|
||||||
|
.SingleOrDefault();
|
||||||
|
try
|
||||||
{
|
{
|
||||||
var item2del = localDbCtx
|
// Add to database
|
||||||
.PartList
|
dbCtx.PartList.Remove(item2del);
|
||||||
.Where(x => x.PartDbId == PartDbId)
|
// Commit changes
|
||||||
.SingleOrDefault();
|
dbCtx.SaveChanges();
|
||||||
|
ResetController();
|
||||||
if (item2del != null)
|
done = true;
|
||||||
{
|
}
|
||||||
try
|
catch (Exception exc)
|
||||||
{
|
{
|
||||||
// Add to database
|
Console.WriteLine($"EXCEPTION on Delete: {exc}");
|
||||||
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);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
string errMessage = $"ERROR on Part.Delete (02): req item was not found | PartDbId {PartDbId}";
|
|
||||||
Console.WriteLine(errMessage);
|
|
||||||
Log.Error(errMessage);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return done;
|
return done;
|
||||||
}
|
}
|
||||||
@@ -152,31 +209,29 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
|||||||
public bool DeleteByMachGroup(int MachGroupDbId)
|
public bool DeleteByMachGroup(int MachGroupDbId)
|
||||||
{
|
{
|
||||||
bool done = false;
|
bool done = false;
|
||||||
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
var items2del = dbCtx
|
||||||
|
.PartList
|
||||||
|
.Where(x => x.MachGroupDbId == MachGroupDbId);
|
||||||
|
try
|
||||||
{
|
{
|
||||||
var items2del = localDbCtx
|
// Add to database
|
||||||
.PartList
|
dbCtx.PartList.RemoveRange(items2del);
|
||||||
.Where(x => x.MachGroupDbId == MachGroupDbId);
|
// Commit changes
|
||||||
try
|
dbCtx.SaveChanges();
|
||||||
{
|
ResetController();
|
||||||
// Add to database
|
done = true;
|
||||||
localDbCtx.PartList.RemoveRange(items2del);
|
}
|
||||||
// Commit changes
|
catch (Exception exc)
|
||||||
localDbCtx.SaveChanges();
|
{
|
||||||
done = true;
|
Console.WriteLine($"EXCEPTION on DeleteByMachGroup: {exc}");
|
||||||
}
|
|
||||||
catch (Exception exc)
|
|
||||||
{
|
|
||||||
string errMessage = $"EXCEPTION on Part.DeleteByMachGroup: {Environment.NewLine}{exc}";
|
|
||||||
Console.WriteLine(errMessage);
|
|
||||||
Log.Error(errMessage);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return done;
|
return done;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Dispose()
|
public void Dispose()
|
||||||
{
|
{
|
||||||
|
// Clear database context
|
||||||
|
dbCtx.Dispose();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -186,13 +241,10 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
|||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public PartModel FindByDbId(int PartDbId)
|
public PartModel FindByDbId(int PartDbId)
|
||||||
{
|
{
|
||||||
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
return dbCtx
|
||||||
{
|
.PartList
|
||||||
return localDbCtx
|
.Where(x => x.PartDbId == PartDbId)
|
||||||
.PartList
|
.SingleOrDefault();
|
||||||
.Where(x => x.PartDbId == PartDbId)
|
|
||||||
.SingleOrDefault();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -203,9 +255,9 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
|||||||
public PartModel FindByPartId(int ProdId, int PartId)
|
public PartModel FindByPartId(int ProdId, int PartId)
|
||||||
{
|
{
|
||||||
PartModel answ = null;
|
PartModel answ = null;
|
||||||
using (DatabaseContext locallocalDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
||||||
{
|
{
|
||||||
answ = locallocalDbCtx
|
answ = localDbCtx
|
||||||
.PartList
|
.PartList
|
||||||
.Where(x => x.MachGroup.Prod.ProdId == ProdId && x.PartId == PartId)
|
.Where(x => x.MachGroup.Prod.ProdId == ProdId && x.PartId == PartId)
|
||||||
.FirstOrDefault();
|
.FirstOrDefault();
|
||||||
@@ -213,6 +265,15 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
|||||||
return answ;
|
return answ;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Reinizializzaizone del controller
|
||||||
|
/// </summary>
|
||||||
|
public void ResetController()
|
||||||
|
{
|
||||||
|
// Re-Initialize database context
|
||||||
|
dbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING);
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Update single Part
|
/// Update single Part
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -221,43 +282,29 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
|||||||
public bool Update(PartModel updItem)
|
public bool Update(PartModel updItem)
|
||||||
{
|
{
|
||||||
bool done = false;
|
bool done = false;
|
||||||
using (DatabaseContext locallocalDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
||||||
{
|
{
|
||||||
var myStatusMapCtrl = new StatusMapController();
|
var item2update = localDbCtx
|
||||||
var item2upd = locallocalDbCtx
|
|
||||||
.PartList
|
.PartList
|
||||||
.Where(x => x.PartDbId == updItem.PartDbId)
|
.Where(x => x.PartDbId == updItem.PartDbId)
|
||||||
.SingleOrDefault();
|
.SingleOrDefault();
|
||||||
if (item2upd != null)
|
try
|
||||||
{
|
{
|
||||||
try
|
// update, vers 1...
|
||||||
{
|
localDbCtx.Entry(item2update).CurrentValues.SetValues(updItem);
|
||||||
// update, vers 1...
|
|
||||||
locallocalDbCtx.Entry(item2upd).CurrentValues.SetValues(updItem);
|
|
||||||
|
|
||||||
//// update, vers 2
|
//// update, vers 2
|
||||||
//localDbCtx.PartList.Remove(item2del);
|
//dbCtx.PartList.Remove(item2del);
|
||||||
//localDbCtx.PartList.Add(updItem);
|
//dbCtx.PartList.Add(updItem);
|
||||||
|
|
||||||
// Commit changes
|
// Commit changes
|
||||||
locallocalDbCtx.SaveChanges();
|
localDbCtx.SaveChanges();
|
||||||
done = true;
|
done = true;
|
||||||
// aggiorno info sullo status
|
// aggiorno info sullo status
|
||||||
myStatusMapCtrl.UpdateAction("", updItem.MachGroup.Prod.ProdId, updItem.PartId, Core.StatusMapItemType.Part, Core.StatusMapOpType.MachGroupMod, "");
|
StatusMapController.man.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);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
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);
|
|
||||||
}
|
}
|
||||||
|
catch
|
||||||
|
{ }
|
||||||
}
|
}
|
||||||
return done;
|
return done;
|
||||||
}
|
}
|
||||||
@@ -271,38 +318,25 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
|||||||
public bool UpdateEnd(int ProdId, int MachGroupId, int PartId, DateTime DtEnd)
|
public bool UpdateEnd(int ProdId, int MachGroupId, int PartId, DateTime DtEnd)
|
||||||
{
|
{
|
||||||
bool done = false;
|
bool done = false;
|
||||||
using (DatabaseContext locallocalDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
||||||
{
|
{
|
||||||
var myStatusMapCtrl = new StatusMapController();
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
// aggiorno
|
// aggiorno
|
||||||
var item2upd = locallocalDbCtx
|
localDbCtx
|
||||||
.PartList
|
.PartList
|
||||||
.Where(x => x.MachGroup.Prod.ProdId == ProdId && x.MachGroup.MachGroupId == MachGroupId && x.PartId == PartId)
|
.Where(x => x.MachGroup.Prod.ProdId == ProdId && x.MachGroup.MachGroupId == MachGroupId && x.PartId == PartId)
|
||||||
.FirstOrDefault();
|
.FirstOrDefault()
|
||||||
|
.DtEnd = DtEnd;
|
||||||
if (item2upd != null)
|
// Commit changes
|
||||||
{
|
localDbCtx.SaveChanges();
|
||||||
item2upd.DtEnd = DtEnd;
|
done = true;
|
||||||
// Commit changes
|
// aggiorno info sullo status
|
||||||
locallocalDbCtx.SaveChanges();
|
StatusMapController.man.UpdateAction("", ProdId, PartId, Core.StatusMapItemType.Part, DtEnd == DateTime.MinValue ? Core.StatusMapOpType.ResetPartEnd : Core.StatusMapOpType.PartEnd, "");
|
||||||
done = true;
|
|
||||||
// aggiorno info sullo status
|
|
||||||
myStatusMapCtrl.UpdateAction("", ProdId, PartId, Core.StatusMapItemType.Part, DtEnd == DateTime.MinValue ? Core.StatusMapOpType.ResetPartEnd : Core.StatusMapOpType.PartEnd, "");
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
string errMessage = $"ERROR on Part.UpdateEnd: req item was not found | ProdId {ProdId} | MachGroupId {MachGroupId} | PartId {PartId} | DtEnd {DtEnd}";
|
|
||||||
Console.WriteLine(errMessage);
|
|
||||||
Log.Error(errMessage);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
catch (Exception exc)
|
catch (Exception exc)
|
||||||
{
|
{
|
||||||
string errMessage = $"EXCEPTION on Part.UpdateEnd: {Environment.NewLine}{exc}";
|
Console.WriteLine($"EXCEPTION on UpdateStatus: {exc}");
|
||||||
Console.WriteLine(errMessage);
|
|
||||||
Log.Error(errMessage);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return done;
|
return done;
|
||||||
@@ -317,37 +351,25 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
|||||||
public bool UpdateStart(int ProdId, int MachGroupId, int PartId, DateTime DtStart)
|
public bool UpdateStart(int ProdId, int MachGroupId, int PartId, DateTime DtStart)
|
||||||
{
|
{
|
||||||
bool done = false;
|
bool done = false;
|
||||||
using (DatabaseContext locallocalDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
||||||
{
|
{
|
||||||
var myStatusMapCtrl = new StatusMapController();
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
// aggiorno
|
// aggiorno
|
||||||
var item2upd = locallocalDbCtx
|
localDbCtx
|
||||||
.PartList
|
.PartList
|
||||||
.Where(x => x.MachGroup.Prod.ProdId == ProdId && x.MachGroup.MachGroupId == MachGroupId && x.PartId == PartId)
|
.Where(x => x.MachGroup.Prod.ProdId == ProdId && x.MachGroup.MachGroupId == MachGroupId && x.PartId == PartId)
|
||||||
.FirstOrDefault();
|
.FirstOrDefault()
|
||||||
if (item2upd != null)
|
.DtStart = DtStart;
|
||||||
{
|
// Commit changes
|
||||||
item2upd.DtStart = DtStart;
|
localDbCtx.SaveChanges();
|
||||||
// Commit changes
|
done = true;
|
||||||
locallocalDbCtx.SaveChanges();
|
// aggiorno info sullo status
|
||||||
done = true;
|
StatusMapController.man.UpdateAction("", ProdId, PartId, Core.StatusMapItemType.Part, DtStart == DateTime.MinValue ? Core.StatusMapOpType.ResetPartStart : Core.StatusMapOpType.PartStart, "");
|
||||||
// aggiorno info sullo status
|
|
||||||
myStatusMapCtrl.UpdateAction("", ProdId, PartId, Core.StatusMapItemType.Part, DtStart == DateTime.MinValue ? Core.StatusMapOpType.ResetPartStart : Core.StatusMapOpType.PartStart, "");
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
string errMessage = $"ERROR on Part.UpdateStart: req item was not found | ProdId {ProdId} | MachGroupId {MachGroupId} | PartId {PartId} | DtStart {DtStart}";
|
|
||||||
Console.WriteLine(errMessage);
|
|
||||||
Log.Error(errMessage);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
catch (Exception exc)
|
catch (Exception exc)
|
||||||
{
|
{
|
||||||
string errMessage = $"EXCEPTION on Part.UpdateStart: {Environment.NewLine}{exc}";
|
Console.WriteLine($"EXCEPTION on UpdateStatus: {exc}");
|
||||||
Console.WriteLine(errMessage);
|
|
||||||
Log.Error(errMessage);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -363,37 +385,25 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
|||||||
public bool UpdateStatus(int ProdId, int MachGroupId, int PartId, Core.ItemState newState)
|
public bool UpdateStatus(int ProdId, int MachGroupId, int PartId, Core.ItemState newState)
|
||||||
{
|
{
|
||||||
bool done = false;
|
bool done = false;
|
||||||
using (DatabaseContext locallocalDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
||||||
{
|
{
|
||||||
var myStatusMapCtrl = new StatusMapController();
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
// aggiorno
|
// aggiorno
|
||||||
var item2upd = locallocalDbCtx
|
localDbCtx
|
||||||
.PartList
|
.PartList
|
||||||
.Where(x => x.MachGroup.Prod.ProdId == ProdId && x.MachGroup.MachGroupId == MachGroupId && x.PartId == PartId)
|
.Where(x => x.MachGroup.Prod.ProdId == ProdId && x.MachGroup.MachGroupId == MachGroupId && x.PartId == PartId)
|
||||||
.FirstOrDefault();
|
.FirstOrDefault()
|
||||||
if (item2upd != null)
|
.State = newState;
|
||||||
{
|
// Commit changes
|
||||||
item2upd.State = newState;
|
localDbCtx.SaveChanges();
|
||||||
// Commit changes
|
done = true;
|
||||||
locallocalDbCtx.SaveChanges();
|
// aggiorno info sullo status
|
||||||
done = true;
|
StatusMapController.man.UpdateAction("", ProdId, PartId, Core.StatusMapItemType.Part, Core.StatusMapOpType.MachGroupMod, "");
|
||||||
// aggiorno info sullo status
|
|
||||||
myStatusMapCtrl.UpdateAction("", ProdId, PartId, Core.StatusMapItemType.Part, newState == Core.ItemState.Scrapped ? Core.StatusMapOpType.SetPartScrapped : Core.StatusMapOpType.MachGroupMod, "");
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
string errMessage = $"ERROR on Part.UpdateStart: req item was not found | ProdId {ProdId} | MachGroupId {MachGroupId} | PartId {PartId} | newState {newState}";
|
|
||||||
Console.WriteLine(errMessage);
|
|
||||||
Log.Error(errMessage);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
catch (Exception exc)
|
catch (Exception exc)
|
||||||
{
|
{
|
||||||
string errMessage = $"EXCEPTION on Part.UpdateStatus: {Environment.NewLine}{exc}";
|
Console.WriteLine($"EXCEPTION on UpdateStatus: {exc}");
|
||||||
Console.WriteLine(errMessage);
|
|
||||||
Log.Error(errMessage);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -401,68 +411,5 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
|||||||
}
|
}
|
||||||
|
|
||||||
#endregion Public Methods
|
#endregion Public Methods
|
||||||
|
|
||||||
#region Protected Methods
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Get BtlPartDBId by ProjId + PDN
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="ProjId"></param>
|
|
||||||
/// <param name="PDN"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
protected int FindBtlPart(int ProjId, int PDN)
|
|
||||||
{
|
|
||||||
int BtlPartDbId = 0;
|
|
||||||
|
|
||||||
using (DatabaseContext locallocalDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
|
||||||
{
|
|
||||||
var btlPart = locallocalDbCtx
|
|
||||||
.BTLPartList
|
|
||||||
.Where(x => x.Project.ProjId == ProjId && x.PDN == PDN)
|
|
||||||
.SingleOrDefault();
|
|
||||||
|
|
||||||
if (btlPart != null)
|
|
||||||
{
|
|
||||||
BtlPartDbId = btlPart.BTLPartDbId;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return BtlPartDbId;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Get BtlPartDBId by ProjId + BtlPartId
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="ProjId"></param>
|
|
||||||
/// <param name="BtlPartId"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
protected int FindBtlPartByBPI(int ProjId, int BtlPartId)
|
|
||||||
{
|
|
||||||
int BtlPartDbId = 0;
|
|
||||||
|
|
||||||
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
|
||||||
{
|
|
||||||
var btlPart = localDbCtx
|
|
||||||
.BTLPartList
|
|
||||||
.Where(x => x.Project.ProjId == ProjId && x.PartId == BtlPartId)
|
|
||||||
.SingleOrDefault();
|
|
||||||
|
|
||||||
if (btlPart != null)
|
|
||||||
{
|
|
||||||
BtlPartDbId = btlPart.BTLPartDbId;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return BtlPartDbId;
|
|
||||||
}
|
|
||||||
|
|
||||||
#endregion Protected Methods
|
|
||||||
|
|
||||||
#region Private Fields
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Istanza logger
|
|
||||||
/// </summary>
|
|
||||||
private NLog.Logger Log = LogManager.GetCurrentClassLogger();
|
|
||||||
|
|
||||||
#endregion Private Fields
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -1,5 +1,4 @@
|
|||||||
using EgtBEAMWALL.DataLayer.DatabaseModels;
|
using EgtBEAMWALL.DataLayer.DatabaseModels;
|
||||||
using NLog;
|
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
@@ -8,10 +7,27 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
|||||||
{
|
{
|
||||||
public class StatusMapController : IDisposable
|
public class StatusMapController : IDisposable
|
||||||
{
|
{
|
||||||
|
#region Private Fields
|
||||||
|
|
||||||
|
private DatabaseContext dbCtx;
|
||||||
|
|
||||||
|
#endregion Private Fields
|
||||||
|
|
||||||
|
#region Public Fields
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Oggetto statico per gestione chiamate da altre classi
|
||||||
|
/// </summary>
|
||||||
|
public static StatusMapController man = new StatusMapController();
|
||||||
|
|
||||||
|
#endregion Public Fields
|
||||||
|
|
||||||
#region Public Constructors
|
#region Public Constructors
|
||||||
|
|
||||||
public StatusMapController()
|
public StatusMapController()
|
||||||
{
|
{
|
||||||
|
// Initialize database context
|
||||||
|
dbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion Public Constructors
|
#endregion Public Constructors
|
||||||
@@ -21,7 +37,7 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Elimina i dati di una sessione (SupervisorId) precedente
|
/// Elimina i dati di una sessione (SupervisorId) precedente
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="Session">Se vuoto --> tutti</param>
|
/// <param name="Session">Se vuoto --> tutti</param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public bool DeleteSession(string Session)
|
public bool DeleteSession(string Session)
|
||||||
{
|
{
|
||||||
@@ -29,42 +45,41 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
|||||||
DateTime adesso = DateTime.Now;
|
DateTime adesso = DateTime.Now;
|
||||||
List<StatusMapModel> SM2Del = new List<StatusMapModel>();
|
List<StatusMapModel> SM2Del = new List<StatusMapModel>();
|
||||||
|
|
||||||
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
// svuoto la tab mappa precedente (da rivalutare in futuro)
|
||||||
|
if (string.IsNullOrEmpty(Session))
|
||||||
{
|
{
|
||||||
// svuoto la tab mappa precedente (da rivalutare in futuro)
|
SM2Del = dbCtx
|
||||||
if (string.IsNullOrEmpty(Session))
|
.StatusMapList
|
||||||
{
|
.ToList();
|
||||||
SM2Del = localDbCtx
|
|
||||||
.StatusMapList
|
|
||||||
.ToList();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
SM2Del = localDbCtx
|
|
||||||
.StatusMapList
|
|
||||||
.Where(x => x.Session == Session)
|
|
||||||
.ToList();
|
|
||||||
}
|
|
||||||
try
|
|
||||||
{
|
|
||||||
// Remove to database
|
|
||||||
localDbCtx.StatusMapList.RemoveRange(SM2Del);
|
|
||||||
// Commit changes
|
|
||||||
localDbCtx.SaveChanges();
|
|
||||||
done = true;
|
|
||||||
}
|
|
||||||
catch (Exception exc)
|
|
||||||
{
|
|
||||||
string errMessage = $"EXCEPTION on StatusMap.DeleteSession: {Environment.NewLine}{exc}";
|
|
||||||
Console.WriteLine(errMessage);
|
|
||||||
Log.Error(errMessage);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
SM2Del = dbCtx
|
||||||
|
.StatusMapList
|
||||||
|
.Where(x => x.Session == Session)
|
||||||
|
.ToList();
|
||||||
|
}
|
||||||
|
try
|
||||||
|
{
|
||||||
|
// Remove to database
|
||||||
|
dbCtx.StatusMapList.RemoveRange(SM2Del);
|
||||||
|
// Commit changes
|
||||||
|
dbCtx.SaveChanges();
|
||||||
|
ResetController();
|
||||||
|
done = true;
|
||||||
|
}
|
||||||
|
catch (Exception exc)
|
||||||
|
{
|
||||||
|
Console.WriteLine($"EXCEPTION on DeleteSession: {exc}");
|
||||||
|
}
|
||||||
|
|
||||||
return done;
|
return done;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Dispose()
|
public void Dispose()
|
||||||
{
|
{
|
||||||
|
// Clear database context
|
||||||
|
dbCtx.Dispose();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -72,51 +87,44 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="Session"></param>
|
/// <param name="Session"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public List<StatusMapModel> GetBySession(string Session)
|
public List<StatusMapModel> GetBySession(string Session = "")
|
||||||
{
|
{
|
||||||
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
// retrieve
|
||||||
{
|
return dbCtx
|
||||||
// retrieve
|
|
||||||
return localDbCtx
|
|
||||||
.StatusMapList
|
.StatusMapList
|
||||||
.Where(x => x.Session == Session)
|
.Where(x => x.Session == Session)
|
||||||
.OrderByDescending(x => x.Index)
|
.OrderByDescending(x => x.Index)
|
||||||
.ToList();
|
.ToList();
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Get data for session where Index > minIndex ordered by index DESC
|
/// Get data for session where Index > minIndex ordered by index DESC
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="Session"></param>
|
|
||||||
/// <param name="minIndex"></param>
|
/// <param name="minIndex"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public List<StatusMapModel> GetFrom(string Session, int minIndex = 0)
|
public List<StatusMapModel> GetFrom(int minIndex = 0)
|
||||||
{
|
{
|
||||||
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
ResetController();
|
||||||
{
|
// retrieve
|
||||||
// retrieve
|
return dbCtx
|
||||||
return localDbCtx
|
|
||||||
.StatusMapList
|
.StatusMapList
|
||||||
.Where(x => x.Session == Session && x.Index >= minIndex)
|
.Where(x => x.Index >= minIndex)
|
||||||
.OrderBy(x => x.Index)
|
.OrderBy(x => x.Index)
|
||||||
.ToList();
|
.ToList();
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Get PROD (all)
|
/// Get PROD data for session
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="Session"></param>
|
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public List<StatusMapModel> GetProd()
|
public List<StatusMapModel> GetProd()
|
||||||
{
|
{
|
||||||
List<StatusMapModel> answ = new List<StatusMapModel>();
|
List<StatusMapModel> answ = new List<StatusMapModel>();
|
||||||
// Initialize database context
|
// Initialize database context
|
||||||
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
using (DatabaseContext myDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
||||||
{
|
{
|
||||||
// retrieve
|
// retrieve
|
||||||
answ = localDbCtx
|
answ = myDbCtx
|
||||||
.StatusMapList
|
.StatusMapList
|
||||||
.Where(x => x.ItemType == Core.StatusMapItemType.Prod)
|
.Where(x => x.ItemType == Core.StatusMapItemType.Prod)
|
||||||
.OrderByDescending(x => x.Index)
|
.OrderByDescending(x => x.Index)
|
||||||
@@ -126,24 +134,12 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Get PROD for session
|
/// Reinizializzaizone del controller
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="Session"></param>
|
public void ResetController()
|
||||||
/// <returns></returns>
|
|
||||||
public List<StatusMapModel> GetProd(string Session)
|
|
||||||
{
|
{
|
||||||
List<StatusMapModel> answ = new List<StatusMapModel>();
|
// Re-Initialize database context
|
||||||
// Initialize database context
|
dbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING);
|
||||||
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
|
||||||
{
|
|
||||||
// retrieve
|
|
||||||
answ = localDbCtx
|
|
||||||
.StatusMapList
|
|
||||||
.Where(x => x.Session == Session && x.ItemType == Core.StatusMapItemType.Prod)
|
|
||||||
.OrderByDescending(x => x.Index)
|
|
||||||
.ToList();
|
|
||||||
}
|
|
||||||
return answ;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -167,56 +163,23 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
|||||||
done = false;
|
done = false;
|
||||||
// inserisco dato prod
|
// inserisco dato prod
|
||||||
StatusMapModel prodSMRecord = new StatusMapModel() { Session = SupervisorId, Index = 0, ItemId = ProdId, ItemType = Core.StatusMapItemType.Prod, Operation = Core.StatusMapOpType.Startup, DtEvent = adesso, Val = "" };
|
StatusMapModel prodSMRecord = new StatusMapModel() { Session = SupervisorId, Index = 0, ItemId = ProdId, ItemType = Core.StatusMapItemType.Prod, Operation = Core.StatusMapOpType.Startup, DtEvent = adesso, Val = "" };
|
||||||
// Initialize database context
|
// aggiungo
|
||||||
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
dbCtx.StatusMapList.Add(prodSMRecord);
|
||||||
{
|
|
||||||
// per prima cosa indico come prodotto il PROD...
|
|
||||||
var currProdData = localDbCtx
|
|
||||||
.ProdList
|
|
||||||
.Where(x => x.ProdId == ProdId)
|
|
||||||
.SingleOrDefault();
|
|
||||||
if (currProdData != null)
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
// aggiorno valore descrizione
|
|
||||||
currProdData.IsProduced = true;
|
|
||||||
// Commit changes
|
|
||||||
localDbCtx.SaveChanges();
|
|
||||||
done = true;
|
|
||||||
}
|
|
||||||
catch (Exception exc)
|
|
||||||
{
|
|
||||||
string errMessage = $"EXCEPTION on Prod.UpdateProduced:{Environment.NewLine}{exc}";
|
|
||||||
Console.WriteLine(errMessage);
|
|
||||||
Log.Error(errMessage);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
string errMessage = $"ERROR on Prod.UpdateProduced: req item was not found | ProdId {ProdId} | IsProduced: true";
|
|
||||||
Console.WriteLine(errMessage);
|
|
||||||
Log.Error(errMessage);
|
|
||||||
}
|
|
||||||
// resetto done
|
|
||||||
done = false;
|
|
||||||
// aggiungo in StatusMap
|
|
||||||
localDbCtx.StatusMapList.Add(prodSMRecord);
|
|
||||||
|
|
||||||
// recupero MachGroup da PROD
|
// recupero MachGroup da PROD
|
||||||
var MGList = localDbCtx
|
var MGList = dbCtx
|
||||||
.MachGroupList
|
.MachGroupList
|
||||||
.Where(x => x.Prod.ProdId == ProdId)
|
.Where(x => x.Prod.ProdId == ProdId)
|
||||||
.ToList();
|
.ToList();
|
||||||
|
|
||||||
var mgSMRecords = MGList.Select(x => new StatusMapModel() { Session = SupervisorId, Index = 0, ItemId = x.MachGroupId, ItemType = Core.StatusMapItemType.MachGroup, Operation = Core.StatusMapOpType.Startup, DtEvent = adesso, Val = "" }).ToList();
|
var mgSMRecords = MGList.Select(x => new StatusMapModel() { Session = SupervisorId, Index = 0, ItemId = x.MachGroupId, ItemType = Core.StatusMapItemType.MachGroup, Operation = Core.StatusMapOpType.Startup, DtEvent = adesso, Val = "" }).ToList();
|
||||||
// aggiungo
|
// aggiungo
|
||||||
localDbCtx.StatusMapList.AddRange(mgSMRecords);
|
dbCtx.StatusMapList.AddRange(mgSMRecords);
|
||||||
|
|
||||||
// salvo
|
// salvo
|
||||||
localDbCtx.SaveChanges();
|
dbCtx.SaveChanges();
|
||||||
done = true;
|
ResetController();
|
||||||
}
|
done = true;
|
||||||
}
|
}
|
||||||
return done;
|
return done;
|
||||||
}
|
}
|
||||||
@@ -231,70 +194,56 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
|||||||
/// <param name="Operation"></param>
|
/// <param name="Operation"></param>
|
||||||
/// <param name="Value"></param>
|
/// <param name="Value"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public bool UpdateAction(string Session, int ProdId, int ItemId, Core.StatusMapItemType ItemType, Core.StatusMapOpType Operation, string Value)
|
public bool UpdateAction(String Session, int ProdId, int ItemId, Core.StatusMapItemType ItemType, Core.StatusMapOpType Operation, string Value)
|
||||||
{
|
{
|
||||||
bool fatto = false;
|
bool fatto = false;
|
||||||
// Recupero il record PROD (che è ultimo indice)
|
// Recupero il record PROD (che è ultimo indice)
|
||||||
StatusMapModel prodData = new StatusMapModel();
|
StatusMapModel prodData = new StatusMapModel();
|
||||||
// Initialize database context
|
// se è un prod --> vado x ID
|
||||||
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
if (Session == "")
|
||||||
{
|
{
|
||||||
// se è un prod --> vado x ID
|
prodData = dbCtx
|
||||||
if (Session == "")
|
.StatusMapList
|
||||||
|
.Where(x => x.ItemType == Core.StatusMapItemType.Prod && x.ItemId == ProdId)
|
||||||
|
.FirstOrDefault();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
prodData = dbCtx
|
||||||
|
.StatusMapList
|
||||||
|
.Where(x => x.ItemType == Core.StatusMapItemType.Prod && x.Session == Session)
|
||||||
|
.FirstOrDefault();
|
||||||
|
}
|
||||||
|
// se ho trovato
|
||||||
|
if (prodData != null)
|
||||||
|
{
|
||||||
|
try
|
||||||
{
|
{
|
||||||
prodData = localDbCtx
|
// aggiorno indice PROD
|
||||||
.StatusMapList
|
prodData.Index++;
|
||||||
.Where(x => x.ItemType == Core.StatusMapItemType.Prod && x.ItemId == ProdId)
|
// se session è nulla ma ho un PROD --> calcolo da li la sessione
|
||||||
.FirstOrDefault();
|
if (string.IsNullOrEmpty(Session))
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
prodData = localDbCtx
|
|
||||||
.StatusMapList
|
|
||||||
.Where(x => x.ItemType == Core.StatusMapItemType.Prod && x.Session == Session)
|
|
||||||
.FirstOrDefault();
|
|
||||||
}
|
|
||||||
// se ho trovato
|
|
||||||
if (prodData != null)
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
{
|
||||||
// aggiorno indice PROD
|
Session = prodData.Session;
|
||||||
prodData.Index++;
|
}
|
||||||
// se session è nulla ma ho un PROD --> calcolo da li la sessione
|
// creo un nuovo record
|
||||||
if (string.IsNullOrEmpty(Session))
|
DateTime adesso = DateTime.Now;
|
||||||
{
|
var newRec = new StatusMapModel() { Session = Session, Index = prodData.Index, ItemId = ItemId, ItemType = ItemType, Operation = Operation, DtEvent = adesso, Val = Value };
|
||||||
Session = prodData.Session;
|
dbCtx.StatusMapList.Add(newRec);
|
||||||
}
|
|
||||||
// creo un nuovo record
|
|
||||||
DateTime adesso = DateTime.Now;
|
|
||||||
var newRec = new StatusMapModel() { Session = Session, Index = prodData.Index, ItemId = ItemId, ItemType = ItemType, Operation = Operation, DtEvent = adesso, Val = Value };
|
|
||||||
localDbCtx.StatusMapList.Add(newRec);
|
|
||||||
|
|
||||||
// Commit changes
|
// Commit changes
|
||||||
localDbCtx.SaveChanges();
|
dbCtx.SaveChanges();
|
||||||
fatto = true;
|
ResetController();
|
||||||
}
|
fatto = true;
|
||||||
catch (Exception exc)
|
}
|
||||||
{
|
catch (Exception exc)
|
||||||
string errMessage = $"EXCEPTION on StatusMap.UpdateAction: {Environment.NewLine}{exc}";
|
{
|
||||||
Console.WriteLine(errMessage);
|
Console.WriteLine($"EXCEPTION on UpdateAction: {exc}");
|
||||||
Log.Error(errMessage);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return fatto;
|
return fatto;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion Public Methods
|
#endregion Public Methods
|
||||||
|
|
||||||
#region Private Fields
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Istanza logger
|
|
||||||
/// </summary>
|
|
||||||
private NLog.Logger Log = LogManager.GetCurrentClassLogger();
|
|
||||||
|
|
||||||
#endregion Private Fields
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,9 +1,15 @@
|
|||||||
using EgtBEAMWALL.DataLayer.DatabaseModels;
|
using System;
|
||||||
using MySql.Data.EntityFramework;
|
using System.Collections.Generic;
|
||||||
using System;
|
|
||||||
using System.Data.Entity;
|
using System.Data.Entity;
|
||||||
using System.Data.Entity.Infrastructure;
|
using System.Data.Entity.Migrations;
|
||||||
|
using MySql.Data.Entity;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using EgtBEAMWALL.DataLayer.DatabaseModels;
|
||||||
|
using EgtBEAMWALL.DataLayer.Migrations;
|
||||||
|
using System.ServiceProcess;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
|
using System.Data.Entity.Infrastructure;
|
||||||
|
|
||||||
namespace EgtBEAMWALL.DataLayer
|
namespace EgtBEAMWALL.DataLayer
|
||||||
{
|
{
|
||||||
@@ -27,13 +33,15 @@ namespace EgtBEAMWALL.DataLayer
|
|||||||
#region Public Constructors
|
#region Public Constructors
|
||||||
|
|
||||||
[Obsolete("This constructor should never be used directly, and is only needed to generate entityframework stuff. Connection string can be adapted as pleased.")]
|
[Obsolete("This constructor should never be used directly, and is only needed to generate entityframework stuff. Connection string can be adapted as pleased.")]
|
||||||
public DatabaseContext() : base(DbConfig.CONNECTION_STRING)
|
public DatabaseContext() : base("DefaultConnection")
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
public DatabaseContext(string connectionString) : base(connectionString)
|
public DatabaseContext(string connectionString) : base(connectionString)
|
||||||
{
|
{
|
||||||
Database.CreateIfNotExists();
|
//Database.CreateIfNotExists();
|
||||||
|
////Database.SetInitializer(new MigrateDatabaseToLatestVersion<StratonLocalizerDatabase, Migrations.Configuration>());
|
||||||
|
//Database.Initialize(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion Public Constructors
|
#endregion Public Constructors
|
||||||
@@ -82,6 +90,24 @@ namespace EgtBEAMWALL.DataLayer
|
|||||||
|
|
||||||
#endregion Public Properties
|
#endregion Public Properties
|
||||||
|
|
||||||
|
#region Private Methods
|
||||||
|
|
||||||
|
private static string getDbServiceName()
|
||||||
|
{
|
||||||
|
ServiceController[] services = ServiceController.GetServices();
|
||||||
|
var service = services.FirstOrDefault(s => s.ServiceName == "MariaDB");
|
||||||
|
if (service != null)
|
||||||
|
return service.DisplayName;
|
||||||
|
|
||||||
|
service = services.FirstOrDefault(s => s.ServiceName == "MySQL");
|
||||||
|
if (service != null)
|
||||||
|
return service.DisplayName;
|
||||||
|
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion Private Methods
|
||||||
|
|
||||||
#region Public Methods
|
#region Public Methods
|
||||||
|
|
||||||
public static DatabaseContext Create()
|
public static DatabaseContext Create()
|
||||||
@@ -89,6 +115,44 @@ namespace EgtBEAMWALL.DataLayer
|
|||||||
return new DatabaseContext(DbConfig.CONNECTION_STRING);
|
return new DatabaseContext(DbConfig.CONNECTION_STRING);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static bool SetUpDbConnectionAndDbConfig()
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
String serviceName = getDbServiceName();
|
||||||
|
if (serviceName.Equals(""))
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
ServiceController service = new ServiceController(serviceName);
|
||||||
|
try
|
||||||
|
{
|
||||||
|
TimeSpan timeout = TimeSpan.FromSeconds(DbConfig.DATABASE_PROCESS_TIMEOUT);
|
||||||
|
service.WaitForStatus(ServiceControllerStatus.Running, timeout);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
System.Data.Entity.Database.SetInitializer<DatabaseContext>(null);
|
||||||
|
var migrator = new DbMigrator(new Configuration());
|
||||||
|
|
||||||
|
if (migrator.GetPendingMigrations().Any())
|
||||||
|
{
|
||||||
|
// Run migrations and seed.
|
||||||
|
migrator.Update();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
#endregion Public Methods
|
#endregion Public Methods
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -98,5 +98,12 @@ namespace EgtBEAMWALL.DataLayer.DatabaseModels
|
|||||||
|
|
||||||
#endregion Public Properties
|
#endregion Public Properties
|
||||||
|
|
||||||
|
#if false
|
||||||
|
/// <summary>
|
||||||
|
/// MachineId del BTL
|
||||||
|
/// </summary>
|
||||||
|
[Column("MachineId")]
|
||||||
|
public string MachineId { get; set; } = "";
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -97,8 +97,6 @@ namespace EgtBEAMWALL.DataLayer.DatabaseModels
|
|||||||
if (!(obj is PartModel item))
|
if (!(obj is PartModel item))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (BTLPartDbId != item.BTLPartDbId)
|
|
||||||
return false;
|
|
||||||
if (H != item.H)
|
if (H != item.H)
|
||||||
return false;
|
return false;
|
||||||
if (L != item.L)
|
if (L != item.L)
|
||||||
|
|||||||
@@ -8,9 +8,6 @@ using static EgtBEAMWALL.Core.ConstBeam;
|
|||||||
|
|
||||||
namespace EgtBEAMWALL.DataLayer.DatabaseModels
|
namespace EgtBEAMWALL.DataLayer.DatabaseModels
|
||||||
{
|
{
|
||||||
// <Auto-Generated>
|
|
||||||
// This is here so CodeMaid doesn't reorganize this document
|
|
||||||
// </Auto-Generated>
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Tabella deiu raggruppamenti PROJ in forma di PROD
|
/// Tabella deiu raggruppamenti PROJ in forma di PROD
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -19,19 +16,12 @@ namespace EgtBEAMWALL.DataLayer.DatabaseModels
|
|||||||
{
|
{
|
||||||
#region Public Properties
|
#region Public Properties
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Chiave univoca DB
|
|
||||||
/// </summary>
|
|
||||||
[Key, Column("ProdDbId"), DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
|
||||||
public int ProdDbId { get; set; }
|
|
||||||
|
|
||||||
[Column("Description")]
|
[Column("Description")]
|
||||||
public string Description { get; set; } = "";
|
public string Description { get; set; } = "";
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Data Creazione
|
/// Data Creazione
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Index]
|
|
||||||
[Column("DtCreated")]
|
[Column("DtCreated")]
|
||||||
public DateTime DtCreated { get; set; }
|
public DateTime DtCreated { get; set; }
|
||||||
|
|
||||||
@@ -42,23 +32,11 @@ namespace EgtBEAMWALL.DataLayer.DatabaseModels
|
|||||||
public bool IsNew { get; set; } = true;
|
public bool IsNew { get; set; } = true;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Stato locked, quando aperto da un dispositivo in rete
|
/// Stato locked (quando aperto da un dispositivo in rete)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Column("Lock")]
|
[Column("Lock")]
|
||||||
public bool Locked { get; set; } = false;
|
public bool Locked { get; set; } = false;
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Chiave univoca per EgtBM
|
|
||||||
/// </summary>
|
|
||||||
[Column("Id")]
|
|
||||||
[Index]
|
|
||||||
public int ProdId { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Tipologia del progetto (Travi, Pareti, ...)
|
|
||||||
/// </summary>
|
|
||||||
public BWType PType { get; set; } = BWType.NULL;
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Macchina
|
/// Macchina
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -66,37 +44,21 @@ namespace EgtBEAMWALL.DataLayer.DatabaseModels
|
|||||||
public string Machine { get; set; } = "";
|
public string Machine { get; set; } = "";
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// ID utente che ha bloccato (NumKey), quando aperto da un dispositivo in rete
|
/// Chiave univoca DB
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Column("LockedBy")]
|
[Key, Column("ProdDbId"), DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
||||||
public string LockedBy { get; set; } = "";
|
public int ProdDbId { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// DataOra ultima operazione di Lock (o di rimozione di lock), quando aperto da un dispositivo in rete
|
/// chiave univoca per EgtBM
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Column("LockDate")]
|
[Column("Id")]
|
||||||
public DateTime LockDate { get; set; } = DateTime.MinValue;
|
public int ProdId { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Record attivo (se false == cancellazione logica)
|
/// Tipologia del progetto (Travi, Pareti, ...)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Index]
|
public BWType PType { get; set; } = BWType.NULL;
|
||||||
[Column("IsActive")]
|
|
||||||
public bool IsActive { get; set; } = true;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Stato Prodotto = inviato ALMENO UNA VOLTA al supervisore --> NON eliminabile se non in modo logico
|
|
||||||
/// </summary>
|
|
||||||
[Index]
|
|
||||||
[Column("IsProduced")]
|
|
||||||
public bool IsProduced { get; set; } = false;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Stato Archiviato = NON visualizzabile normalmente, già prodotto
|
|
||||||
/// </summary>
|
|
||||||
[Index]
|
|
||||||
[Column("IsArchived")]
|
|
||||||
public bool IsArchived { get; set; } = false;
|
|
||||||
|
|
||||||
#endregion Public Properties
|
#endregion Public Properties
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,13 +1,13 @@
|
|||||||
using System;
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
using System.ComponentModel.DataAnnotations;
|
using System.ComponentModel.DataAnnotations;
|
||||||
using System.ComponentModel.DataAnnotations.Schema;
|
using System.ComponentModel.DataAnnotations.Schema;
|
||||||
using static EgtBEAMWALL.Core.ConstBeam;
|
using static EgtBEAMWALL.Core.ConstBeam;
|
||||||
|
|
||||||
namespace EgtBEAMWALL.DataLayer.DatabaseModels
|
namespace EgtBEAMWALL.DataLayer.DatabaseModels
|
||||||
{
|
{
|
||||||
// <Auto-Generated>
|
|
||||||
// This is here so CodeMaid doesn't reorganize this document
|
|
||||||
// </Auto-Generated>
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Tabella dei PROJ caricati dal BTL
|
/// Tabella dei PROJ caricati dal BTL
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -16,9 +16,6 @@ namespace EgtBEAMWALL.DataLayer.DatabaseModels
|
|||||||
{
|
{
|
||||||
#region Public Properties
|
#region Public Properties
|
||||||
|
|
||||||
[Key, Column("ProjDbId"), DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
|
||||||
public int ProjDbId { get; set; }
|
|
||||||
|
|
||||||
[Column("BTLFileName")]
|
[Column("BTLFileName")]
|
||||||
public string BTLFileName { get; set; } = "";
|
public string BTLFileName { get; set; } = "";
|
||||||
|
|
||||||
@@ -26,20 +23,17 @@ namespace EgtBEAMWALL.DataLayer.DatabaseModels
|
|||||||
/// Data Creazione
|
/// Data Creazione
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Column("DtCreated")]
|
[Column("DtCreated")]
|
||||||
[Index]
|
|
||||||
public DateTime DtCreated { get; set; }
|
public DateTime DtCreated { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Data Esportazione
|
/// Data Esportazione
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Column("DtExported")]
|
[Column("DtExported")]
|
||||||
[Index]
|
|
||||||
public DateTime DtExported { get; set; }
|
public DateTime DtExported { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Stato NEW = creato ma NON salvato
|
/// Stato NEW = creato ma NON salvato
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Index]
|
|
||||||
[Column("IsNew")]
|
[Column("IsNew")]
|
||||||
public bool IsNew { get; set; } = true;
|
public bool IsNew { get; set; } = true;
|
||||||
|
|
||||||
@@ -55,14 +49,22 @@ namespace EgtBEAMWALL.DataLayer.DatabaseModels
|
|||||||
[Column("Lock")]
|
[Column("Lock")]
|
||||||
public bool Locked { get; set; } = false;
|
public bool Locked { get; set; } = false;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Macchina
|
||||||
|
/// </summary>
|
||||||
|
[Column("Machine")]
|
||||||
|
public string Machine { get; set; } = "";
|
||||||
|
|
||||||
|
[ForeignKey("ProdDbId")]
|
||||||
|
public virtual ProdModel Prod { get; set; }
|
||||||
|
|
||||||
[Column("ProdDbId")]
|
[Column("ProdDbId")]
|
||||||
public int? ProdDbId { get; set; }
|
public int? ProdDbId { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
[Key, Column("ProjDbId"), DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
||||||
/// ID da modello ext
|
public int ProjDbId { get; set; }
|
||||||
/// </summary>
|
|
||||||
[Column("Id")]
|
[Column("Id")]
|
||||||
[Index]
|
|
||||||
public int ProjId { get; set; }
|
public int ProjId { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -70,47 +72,6 @@ namespace EgtBEAMWALL.DataLayer.DatabaseModels
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public BWType PType { get; set; } = BWType.NULL;
|
public BWType PType { get; set; } = BWType.NULL;
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Macchina
|
|
||||||
/// </summary>
|
|
||||||
[Column("Machine")]
|
|
||||||
public string Machine { get; set; } = "";
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// ID utente che ha bloccato (NumKey), quando aperto da un dispositivo in rete
|
|
||||||
/// </summary>
|
|
||||||
[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>
|
|
||||||
/// Record attivo (se false == cancellazione logica)
|
|
||||||
/// </summary>
|
|
||||||
[Index]
|
|
||||||
[Column("IsActive")]
|
|
||||||
public bool IsActive { get; set; } = true;
|
|
||||||
/// <summary>
|
|
||||||
/// Descrizione progetto (copiata da BTLFileName inizialmente)
|
|
||||||
/// </summary>
|
|
||||||
[Column("ProjDescription")]
|
|
||||||
public string ProjDescription { get; set; } = "";
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Stato Archiviato = NON visualizzabile normalmente, già prodotto
|
|
||||||
/// </summary>
|
|
||||||
[Index]
|
|
||||||
[Column("IsArchived")]
|
|
||||||
public bool IsArchived { get; set; } = false;
|
|
||||||
|
|
||||||
[ForeignKey("ProdDbId")]
|
|
||||||
public virtual ProdModel Prod { get; set; }
|
|
||||||
|
|
||||||
#endregion Public Properties
|
#endregion Public Properties
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,10 +1,7 @@
|
|||||||
using Ionic.Zip;
|
using System;
|
||||||
using System;
|
using System.Collections.Generic;
|
||||||
using System.Diagnostics;
|
|
||||||
using System.IO;
|
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Reflection;
|
using System.Text;
|
||||||
using System.Xml.Linq;
|
|
||||||
|
|
||||||
namespace EgtBEAMWALL.DataLayer
|
namespace EgtBEAMWALL.DataLayer
|
||||||
{
|
{
|
||||||
@@ -21,7 +18,6 @@ namespace EgtBEAMWALL.DataLayer
|
|||||||
public static string DATABASE_SERV = "127.0.0.1";
|
public static string DATABASE_SERV = "127.0.0.1";
|
||||||
|
|
||||||
public static string DATABASE_USER = "EgtUser";
|
public static string DATABASE_USER = "EgtUser";
|
||||||
public static string ZIP_PWD = "viacremasca-viacremasca-viacremasca-viacremasca";
|
|
||||||
|
|
||||||
#endregion Public Fields
|
#endregion Public Fields
|
||||||
|
|
||||||
@@ -33,7 +29,7 @@ namespace EgtBEAMWALL.DataLayer
|
|||||||
public static string ADMIN_CONNECTION_STRING { get; set; } = "";
|
public static string ADMIN_CONNECTION_STRING { get; set; } = "";
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// DB Connection string, per effettuare migration riportare valore connessione admin cablato (server=localhost;port=3306;database=EgtBwDb_000102;)
|
/// DB Connection string
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static string CONNECTION_STRING { get; set; } = "";
|
public static string CONNECTION_STRING { get; set; } = "";
|
||||||
|
|
||||||
@@ -41,204 +37,31 @@ namespace EgtBEAMWALL.DataLayer
|
|||||||
|
|
||||||
#region Public Methods
|
#region Public Methods
|
||||||
|
|
||||||
|
#if false
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Effettua migrazione esplicita del DB
|
/// Metodo di init standard per DB locale
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <returns></returns>
|
/// <param name="server">Indirizzo del server (tipicamente localhost/127.0.0.1)</param>
|
||||||
public static bool CheckMigrateDb()
|
/// <param name="nKey">Numero chiave</param>
|
||||||
|
/// <param name="sKey">Codice/pwd associato a chaive</param>
|
||||||
|
public static void InitDb(string server, string nKey, string sKey)
|
||||||
{
|
{
|
||||||
// esecuzione script di migrations del DB
|
DATABASE_SERV = server;
|
||||||
return Controllers.DbController.man.checkMigrateDb();
|
DATABASE_NAME = $"EgtBwDb_{nKey}";
|
||||||
}
|
DATABASE_USER = $"user_{nKey}";
|
||||||
|
DATABASE_PWD = $"pwd_{sKey}";
|
||||||
/// <summary>
|
CONNECTION_STRING = $"server={DATABASE_SERV};port=3306;database={DATABASE_NAME};uid={DATABASE_USER};pwd={DATABASE_PWD};sslmode=None";
|
||||||
/// Effettua verifica presenza utente
|
// stringa admin con utente root egalware...
|
||||||
/// </summary>
|
ADMIN_CONNECTION_STRING = $"server={DATABASE_SERV};port=3306;database=mysql;uid=root;pwd=Egalware_24068!;sslmode=None;CHARSET=utf8";
|
||||||
/// <param name="nKey"></param>
|
}
|
||||||
/// <param name="sKey"></param>
|
#endif
|
||||||
/// <param name="isNetwork"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
public static bool CheckUser(string nKey, string sKey, bool isNetwork)
|
|
||||||
{
|
|
||||||
// esecuzione script di install locale
|
|
||||||
return Controllers.DbController.man.checkCreateUser(DATABASE_USER, DATABASE_PWD, isNetwork);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Effettua verifica presenza view prod + relativo utente
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="nKey"></param>
|
|
||||||
/// <param name="sKey"></param>
|
|
||||||
/// <param name="isNetwork"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
public static bool CheckViews(string nKey, string sKey)
|
|
||||||
{
|
|
||||||
// esecuzione script di install locale
|
|
||||||
return Controllers.DbController.man.refreshViews(DATABASE_NAME);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Effettua DUMP del DB dato utente admin + percorso salvataggio (zip cifrato)
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="zipFilePath">Percorso di salvataggio del dump (*.zip)</param>
|
|
||||||
/// <param name="dbName">Nome del DB da processare (se vuoto quello di default calcolato)</param>
|
|
||||||
/// <param name="mysqlDumpPath">Nome o Percorso Eseguibile mysqldump (opzionale)</param>
|
|
||||||
/// <param name="exportOpt">Opzioni in fase di export (default: --skip-extended-insert)</param>
|
|
||||||
/// <returns></returns>
|
|
||||||
public static bool DataBaseDumpToFile(string zipFilePath, string dbName = "", string mysqlDumpPath = "mysqldump", string exportOpt = "--skip-extended-insert")
|
|
||||||
{
|
|
||||||
bool fatto = false;
|
|
||||||
// fix path eseguibile
|
|
||||||
if (string.IsNullOrEmpty(mysqlDumpPath))
|
|
||||||
{
|
|
||||||
mysqlDumpPath = "mysqldump";
|
|
||||||
}
|
|
||||||
if (string.IsNullOrEmpty(dbName))
|
|
||||||
{
|
|
||||||
dbName = DATABASE_NAME;
|
|
||||||
}
|
|
||||||
// verifica zip finale
|
|
||||||
if (!zipFilePath.EndsWith(".zip"))
|
|
||||||
{
|
|
||||||
zipFilePath = $"{zipFilePath}.zip";
|
|
||||||
}
|
|
||||||
// creo nome file per export sql (temporaneo)
|
|
||||||
string tempSqlPath = zipFilePath.Replace(".zip", ".sql");
|
|
||||||
// esecuzione script x dump del DB
|
|
||||||
string dirPath = Path.GetDirectoryName(zipFilePath);
|
|
||||||
if (!Directory.Exists(dirPath))
|
|
||||||
{
|
|
||||||
Directory.CreateDirectory(dirPath);
|
|
||||||
}
|
|
||||||
// se ci fosse già file elimino (sql/zip)
|
|
||||||
if (File.Exists(tempSqlPath))
|
|
||||||
{
|
|
||||||
File.Delete(tempSqlPath);
|
|
||||||
}
|
|
||||||
if (File.Exists(zipFilePath))
|
|
||||||
{
|
|
||||||
File.Delete(zipFilePath);
|
|
||||||
}
|
|
||||||
// creazione SQL, tramite script esterno... importante parametro "--skip-extended-insert" altrimenti problemi con restore (anche se + verboso e lento in backup...)
|
|
||||||
string callScript = $"\"{mysqlDumpPath}\" -u{DATABASE_USER} -p{DATABASE_PWD} {dbName} {exportOpt} > {tempSqlPath}";
|
|
||||||
ExecuteCommand(callScript);
|
|
||||||
// compressione con pwd!
|
|
||||||
using (ZipFile zip = new ZipFile())
|
|
||||||
{
|
|
||||||
// aggiungo pwd
|
|
||||||
zip.Password = ZIP_PWD;
|
|
||||||
// inserisco file
|
|
||||||
zip.AddFile(tempSqlPath, "");
|
|
||||||
zip.Save(zipFilePath);
|
|
||||||
fatto = true;
|
|
||||||
}
|
|
||||||
// elimino file sql temporaneo...
|
|
||||||
if (File.Exists(tempSqlPath))
|
|
||||||
{
|
|
||||||
File.Delete(tempSqlPath);
|
|
||||||
}
|
|
||||||
return fatto;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Effettua restore come overwrite del DB di DEFAULT... irreversibile
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="zipFilePath">Percorso di lettura del dump cifrato (*.zip)</param>
|
|
||||||
/// <param name="dbName">Nome del DB da processare (se vuoto quello di default calcolato)</param>
|
|
||||||
/// <param name="tempFolder">Percorso cartella temp x esecuzione</param>
|
|
||||||
/// <param name="mysqlPath">Nome o Percorso Eseguibile mysql (opzionale)</param>
|
|
||||||
/// <param name="importOpt">Opzioni in fase di import (default: --force)</param>
|
|
||||||
/// <returns></returns>
|
|
||||||
public static bool DataBaseRestoreFromFile(string zipFilePath, string dbName = "", string tempFolder="", string mysqlPath = "mysql", string importOpt = "--force")
|
|
||||||
{
|
|
||||||
bool fatto = false;
|
|
||||||
// fix path eseguibile
|
|
||||||
if (string.IsNullOrEmpty(mysqlPath))
|
|
||||||
{
|
|
||||||
mysqlPath = "mysql";
|
|
||||||
}
|
|
||||||
if (string.IsNullOrEmpty(dbName))
|
|
||||||
{
|
|
||||||
dbName = DATABASE_NAME;
|
|
||||||
}
|
|
||||||
if (string.IsNullOrEmpty(tempFolder))
|
|
||||||
{
|
|
||||||
tempFolder = "C:\\Temp";
|
|
||||||
}
|
|
||||||
// verifica zip finale
|
|
||||||
if (!zipFilePath.EndsWith(".zip"))
|
|
||||||
{
|
|
||||||
zipFilePath = $"{zipFilePath}.zip";
|
|
||||||
}
|
|
||||||
// elimino eventuale temp folder precedente...
|
|
||||||
if (Directory.Exists(tempFolder))
|
|
||||||
{
|
|
||||||
Directory.Delete(tempFolder, true);
|
|
||||||
}
|
|
||||||
Directory.CreateDirectory(tempFolder);
|
|
||||||
// scompatto file zip --> sql
|
|
||||||
using (ZipFile zip = ZipFile.Read(zipFilePath))
|
|
||||||
{
|
|
||||||
zip.Password = ZIP_PWD;
|
|
||||||
zip.ExtractAll(tempFolder, ExtractExistingFileAction.OverwriteSilently);
|
|
||||||
}
|
|
||||||
// verifico che ci sia 1 file sql...
|
|
||||||
var sqlFiles = Directory.GetFiles(tempFolder, "*.sql");
|
|
||||||
if (sqlFiles != null && sqlFiles.Length == 1)
|
|
||||||
{
|
|
||||||
// verifico nome file per export sql (temporaneo)
|
|
||||||
string tempSqlPath = sqlFiles.FirstOrDefault();
|
|
||||||
// chiamo script esterno...
|
|
||||||
string callScript = $"\"{mysqlPath}\" -u{DATABASE_USER} -p{DATABASE_PWD} {importOpt} {dbName} < {tempSqlPath}";
|
|
||||||
ExecuteCommand(callScript);
|
|
||||||
// elimino il file sql importato...
|
|
||||||
File.Delete(tempSqlPath);
|
|
||||||
// elimino temp folder...
|
|
||||||
Directory.Delete(tempFolder, true);
|
|
||||||
fatto = true;
|
|
||||||
}
|
|
||||||
return fatto;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Esecuzione di un comando esterno
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="command"></param>
|
|
||||||
public static void ExecuteCommand(string command)
|
|
||||||
{
|
|
||||||
int exitCode;
|
|
||||||
ProcessStartInfo processInfo;
|
|
||||||
Process process;
|
|
||||||
|
|
||||||
processInfo = new ProcessStartInfo("cmd.exe", "/c " + command);
|
|
||||||
processInfo.CreateNoWindow = true;
|
|
||||||
processInfo.UseShellExecute = false;
|
|
||||||
// *** Redirect the output ***
|
|
||||||
processInfo.RedirectStandardError = true;
|
|
||||||
processInfo.RedirectStandardOutput = true;
|
|
||||||
|
|
||||||
process = Process.Start(processInfo);
|
|
||||||
process.WaitForExit();
|
|
||||||
|
|
||||||
// *** Read the streams ***
|
|
||||||
// Warning: This approach can lead to deadlocks, see Edit #2
|
|
||||||
string output = process.StandardOutput.ReadToEnd();
|
|
||||||
string error = process.StandardError.ReadToEnd();
|
|
||||||
|
|
||||||
exitCode = process.ExitCode;
|
|
||||||
|
|
||||||
Console.WriteLine("output>>" + (String.IsNullOrEmpty(output) ? "(none)" : output));
|
|
||||||
Console.WriteLine("error>>" + (String.IsNullOrEmpty(error) ? "(none)" : error));
|
|
||||||
Console.WriteLine("ExitCode: " + exitCode.ToString(), "ExecuteCommand");
|
|
||||||
process.Close();
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Metodo di init standard per DB in rete con Master_Key
|
/// Metodo di init standard per DB in rete con Master_Key
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="server">Indirizzo del server (tipicamente indirizzo di rete)</param>
|
/// <param name="server">Indirizzo del server (tipicamente indirizzo di rete)</param>
|
||||||
/// <param name="nKey">Numero chiave</param>
|
/// <param name="nKey">Numero chiave</param>
|
||||||
/// <param name="sKey">Codice/pwd associato a chiave</param>
|
/// <param name="sKey">Codice/pwd associato a chaive</param>
|
||||||
/// <param name="masterKey">Numero di chiave master con cui è creato il DB</param>
|
/// <param name="masterKey">Numero di chiave master con cui è creato il DB</param>
|
||||||
public static void InitDb(string server, string nKey, string sKey, string masterKey = "")
|
public static void InitDb(string server, string nKey, string sKey, string masterKey = "")
|
||||||
{
|
{
|
||||||
@@ -248,28 +71,15 @@ namespace EgtBEAMWALL.DataLayer
|
|||||||
DATABASE_NAME = $"EgtBwDb_{masterKey}";
|
DATABASE_NAME = $"EgtBwDb_{masterKey}";
|
||||||
DATABASE_USER = $"user_{nKey}";
|
DATABASE_USER = $"user_{nKey}";
|
||||||
DATABASE_PWD = $"pwd_{sKey}";
|
DATABASE_PWD = $"pwd_{sKey}";
|
||||||
ZIP_PWD = $"{DATABASE_USER}:{DATABASE_PWD}:{DATABASE_USER}:{DATABASE_PWD}";
|
CONNECTION_STRING = $"server={DATABASE_SERV};port=3306;database={DATABASE_NAME};uid={DATABASE_USER};pwd={DATABASE_PWD};sslmode=None";
|
||||||
CONNECTION_STRING = $"server={DATABASE_SERV};port=3306;database={DATABASE_NAME};uid={DATABASE_USER};pwd={DATABASE_PWD};SslMode=None";
|
|
||||||
// stringa admin con utente root egalware...
|
// stringa admin con utente root egalware...
|
||||||
ADMIN_CONNECTION_STRING = $"server={DATABASE_SERV};port=3306;database=mysql;uid=root;pwd=Egalware_24068!;SslMode=none;CHARSET=utf8";
|
ADMIN_CONNECTION_STRING = $"server={DATABASE_SERV};port=3306;database=mysql;uid=root;pwd=Egalware_24068!;sslmode=None;CHARSET=utf8";
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
public static bool CheckUser(string nKey, string sKey, bool isNetwork)
|
||||||
/// Aggiorna conf NLog x target DIR
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="logDir"></param>
|
|
||||||
public static void SetupLogDir(string logDir)
|
|
||||||
{
|
{
|
||||||
string appDir = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
|
// esecuzione script di install locale
|
||||||
string filePath = Path.Combine(appDir, "NLog.config");
|
return Controllers.DbController.man.checkCreateUser(DATABASE_USER, DATABASE_PWD, isNetwork);
|
||||||
// leggo il file NLog
|
|
||||||
string rawData = File.ReadAllText(filePath);
|
|
||||||
|
|
||||||
// sostituzione livello minimo da selezione
|
|
||||||
rawData = rawData.Replace("${basedir}", logDir);
|
|
||||||
|
|
||||||
// ri-scrivo file NLog
|
|
||||||
File.WriteAllText(filePath, rawData);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion Public Methods
|
#endregion Public Methods
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ namespace EgtBEAMWALL.DataLayer
|
|||||||
{
|
{
|
||||||
#region Public Fields
|
#region Public Fields
|
||||||
|
|
||||||
|
public static DbManager obj = new DbManager();
|
||||||
public Controllers.BTLPartController BtlPartCtr = new Controllers.BTLPartController();
|
public Controllers.BTLPartController BtlPartCtr = new Controllers.BTLPartController();
|
||||||
public Controllers.LogMachineController LogMacCtr = new Controllers.LogMachineController();
|
public Controllers.LogMachineController LogMacCtr = new Controllers.LogMachineController();
|
||||||
public Controllers.LogSupportController LogSupCtr = new Controllers.LogSupportController();
|
public Controllers.LogSupportController LogSupCtr = new Controllers.LogSupportController();
|
||||||
|
|||||||
@@ -37,14 +37,8 @@
|
|||||||
<Prefer32Bit>false</Prefer32Bit>
|
<Prefer32Bit>false</Prefer32Bit>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<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="DotNetZip, Version=1.16.0.0, Culture=neutral, PublicKeyToken=6583c7c814667745, processorArchitecture=MSIL">
|
|
||||||
<HintPath>..\packages\DotNetZip.1.16.0\lib\net40\DotNetZip.dll</HintPath>
|
|
||||||
</Reference>
|
|
||||||
<Reference Include="EgtWPFLib5">
|
<Reference Include="EgtWPFLib5">
|
||||||
<HintPath>..\ExtLibs\EgtWPFLib5.dll</HintPath>
|
<HintPath>..\..\..\EgtProg\DllD32\EgtWPFLib5.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL">
|
<Reference Include="EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\EntityFramework.6.4.4\lib\net45\EntityFramework.dll</HintPath>
|
<HintPath>..\packages\EntityFramework.6.4.4\lib\net45\EntityFramework.dll</HintPath>
|
||||||
@@ -52,37 +46,16 @@
|
|||||||
<Reference Include="EntityFramework.SqlServer, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL">
|
<Reference Include="EntityFramework.SqlServer, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\EntityFramework.6.4.4\lib\net45\EntityFramework.SqlServer.dll</HintPath>
|
<HintPath>..\packages\EntityFramework.6.4.4\lib\net45\EntityFramework.SqlServer.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="Google.Protobuf, Version=3.21.9.0, Culture=neutral, PublicKeyToken=a7d26565bac4d604, processorArchitecture=MSIL">
|
<Reference Include="MySql.Data, Version=6.10.9.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\Google.Protobuf.3.21.9\lib\net45\Google.Protobuf.dll</HintPath>
|
<HintPath>..\packages\MySql.Data.6.10.9\lib\net452\MySql.Data.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="K4os.Compression.LZ4, Version=1.3.5.0, Culture=neutral, PublicKeyToken=2186fa9121ef231d, processorArchitecture=MSIL">
|
<Reference Include="MySql.Data.Entity.EF6, Version=6.10.9.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\K4os.Compression.LZ4.1.3.5\lib\net462\K4os.Compression.LZ4.dll</HintPath>
|
<HintPath>..\packages\MySql.Data.Entity.6.10.9\lib\net452\MySql.Data.Entity.EF6.dll</HintPath>
|
||||||
</Reference>
|
|
||||||
<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.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>
|
|
||||||
</Reference>
|
|
||||||
<Reference Include="MySql.Data.EntityFramework, Version=8.0.21.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d, processorArchitecture=MSIL">
|
|
||||||
<HintPath>..\packages\MySql.Data.EntityFramework.8.0.21\lib\net452\MySql.Data.EntityFramework.dll</HintPath>
|
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
|
<Reference Include="Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\Newtonsoft.Json.13.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
|
<HintPath>..\packages\Newtonsoft.Json.13.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="NLog, Version=5.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL">
|
|
||||||
<HintPath>..\packages\NLog.5.0.1\lib\net46\NLog.dll</HintPath>
|
|
||||||
</Reference>
|
|
||||||
<Reference Include="Renci.SshNet, Version=2016.1.0.0, Culture=neutral, PublicKeyToken=1cee9f8bde3db106, processorArchitecture=MSIL">
|
|
||||||
<HintPath>..\packages\SSH.NET.2016.1.0\lib\net40\Renci.SshNet.dll</HintPath>
|
|
||||||
</Reference>
|
|
||||||
<Reference Include="System" />
|
<Reference Include="System" />
|
||||||
<Reference Include="System.Buffers, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
|
||||||
<HintPath>..\packages\System.Buffers.4.5.1\lib\net461\System.Buffers.dll</HintPath>
|
|
||||||
</Reference>
|
|
||||||
<Reference Include="System.ComponentModel" />
|
<Reference Include="System.ComponentModel" />
|
||||||
<Reference Include="System.ComponentModel.DataAnnotations" />
|
<Reference Include="System.ComponentModel.DataAnnotations" />
|
||||||
<Reference Include="System.Configuration" />
|
<Reference Include="System.Configuration" />
|
||||||
@@ -90,39 +63,16 @@
|
|||||||
<Reference Include="System.Core" />
|
<Reference Include="System.Core" />
|
||||||
<Reference Include="System.Drawing" />
|
<Reference Include="System.Drawing" />
|
||||||
<Reference Include="System.Drawing.Design" />
|
<Reference Include="System.Drawing.Design" />
|
||||||
<Reference Include="System.IO.Compression" />
|
|
||||||
<Reference Include="System.IO.Pipelines, Version=5.0.0.2, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
|
||||||
<HintPath>..\packages\System.IO.Pipelines.5.0.2\lib\net461\System.IO.Pipelines.dll</HintPath>
|
|
||||||
</Reference>
|
|
||||||
<Reference Include="System.Management" />
|
<Reference Include="System.Management" />
|
||||||
<Reference Include="System.Memory, Version=4.0.1.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=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.Security" />
|
||||||
<Reference Include="System.ServiceModel" />
|
<Reference Include="System.ServiceModel" />
|
||||||
<Reference Include="System.ServiceProcess" />
|
<Reference Include="System.ServiceProcess" />
|
||||||
<Reference Include="System.Threading.Tasks.Extensions, Version=4.2.0.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
|
||||||
<HintPath>..\packages\System.Threading.Tasks.Extensions.4.5.4\lib\net461\System.Threading.Tasks.Extensions.dll</HintPath>
|
|
||||||
</Reference>
|
|
||||||
<Reference Include="System.Transactions" />
|
<Reference Include="System.Transactions" />
|
||||||
<Reference Include="System.Xml.Linq" />
|
<Reference Include="System.Xml.Linq" />
|
||||||
<Reference Include="System.Data.DataSetExtensions" />
|
<Reference Include="System.Data.DataSetExtensions" />
|
||||||
<Reference Include="Microsoft.CSharp" />
|
<Reference Include="Microsoft.CSharp" />
|
||||||
<Reference Include="System.Data" />
|
<Reference Include="System.Data" />
|
||||||
<Reference Include="System.Xml" />
|
<Reference Include="System.Xml" />
|
||||||
<Reference Include="Ubiety.Dns.Core, Version=2.2.1.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d, processorArchitecture=MSIL">
|
|
||||||
<HintPath>..\packages\MySql.Data.8.0.21\lib\net452\Ubiety.Dns.Core.dll</HintPath>
|
|
||||||
</Reference>
|
|
||||||
<Reference Include="Zstandard.Net, Version=1.1.7.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d, processorArchitecture=MSIL">
|
|
||||||
<HintPath>..\packages\MySql.Data.8.0.21\lib\net452\Zstandard.Net.dll</HintPath>
|
|
||||||
</Reference>
|
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Compile Include="AdminContext.cs" />
|
<Compile Include="AdminContext.cs" />
|
||||||
@@ -171,31 +121,12 @@
|
|||||||
<Compile Include="Migrations\202109141058345_AddMachine2ProjProd.designer.cs">
|
<Compile Include="Migrations\202109141058345_AddMachine2ProjProd.designer.cs">
|
||||||
<DependentUpon>202109141058345_AddMachine2ProjProd.cs</DependentUpon>
|
<DependentUpon>202109141058345_AddMachine2ProjProd.cs</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
<Compile Include="Migrations\202207051703296_UpgradeLockModel.cs" />
|
|
||||||
<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\202308241516227_AddProdStatusVarAndIndex.cs" />
|
|
||||||
<Compile Include="Migrations\202308241516227_AddProdStatusVarAndIndex.designer.cs">
|
|
||||||
<DependentUpon>202308241516227_AddProdStatusVarAndIndex.cs</DependentUpon>
|
|
||||||
</Compile>
|
|
||||||
<Compile Include="Migrations\202308250853396_AddProjArchivedField.cs" />
|
|
||||||
<Compile Include="Migrations\202308250853396_AddProjArchivedField.designer.cs">
|
|
||||||
<DependentUpon>202308250853396_AddProjArchivedField.cs</DependentUpon>
|
|
||||||
</Compile>
|
|
||||||
<Compile Include="Migrations\Configuration.cs" />
|
<Compile Include="Migrations\Configuration.cs" />
|
||||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||||
<Compile Include="Utils.cs" />
|
<Compile Include="Utils.cs" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<None Include="App.config" />
|
<None Include="App.config" />
|
||||||
<None Include="NLog.config">
|
|
||||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
|
||||||
</None>
|
|
||||||
<None Include="packages.config" />
|
<None Include="packages.config" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
@@ -223,18 +154,6 @@
|
|||||||
<EmbeddedResource Include="Migrations\202109141058345_AddMachine2ProjProd.resx">
|
<EmbeddedResource Include="Migrations\202109141058345_AddMachine2ProjProd.resx">
|
||||||
<DependentUpon>202109141058345_AddMachine2ProjProd.cs</DependentUpon>
|
<DependentUpon>202109141058345_AddMachine2ProjProd.cs</DependentUpon>
|
||||||
</EmbeddedResource>
|
</EmbeddedResource>
|
||||||
<EmbeddedResource Include="Migrations\202207051703296_UpgradeLockModel.resx">
|
|
||||||
<DependentUpon>202207051703296_UpgradeLockModel.cs</DependentUpon>
|
|
||||||
</EmbeddedResource>
|
|
||||||
<EmbeddedResource Include="Migrations\202306081452095_UpdateProjModel.resx">
|
|
||||||
<DependentUpon>202306081452095_UpdateProjModel.cs</DependentUpon>
|
|
||||||
</EmbeddedResource>
|
|
||||||
<EmbeddedResource Include="Migrations\202308241516227_AddProdStatusVarAndIndex.resx">
|
|
||||||
<DependentUpon>202308241516227_AddProdStatusVarAndIndex.cs</DependentUpon>
|
|
||||||
</EmbeddedResource>
|
|
||||||
<EmbeddedResource Include="Migrations\202308250853396_AddProjArchivedField.resx">
|
|
||||||
<DependentUpon>202308250853396_AddProjArchivedField.cs</DependentUpon>
|
|
||||||
</EmbeddedResource>
|
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
|
|||||||
-29
@@ -1,29 +0,0 @@
|
|||||||
// <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 UpgradeLockModel : IMigrationMetadata
|
|
||||||
{
|
|
||||||
private readonly ResourceManager Resources = new ResourceManager(typeof(UpgradeLockModel));
|
|
||||||
|
|
||||||
string IMigrationMetadata.Id
|
|
||||||
{
|
|
||||||
get { return "202207051703296_UpgradeLockModel"; }
|
|
||||||
}
|
|
||||||
|
|
||||||
string IMigrationMetadata.Source
|
|
||||||
{
|
|
||||||
get { return null; }
|
|
||||||
}
|
|
||||||
|
|
||||||
string IMigrationMetadata.Target
|
|
||||||
{
|
|
||||||
get { return Resources.GetString("Target"); }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,28 +0,0 @@
|
|||||||
namespace EgtBEAMWALL.DataLayer.Migrations
|
|
||||||
{
|
|
||||||
using System;
|
|
||||||
using System.Data.Entity.Migrations;
|
|
||||||
|
|
||||||
public partial class UpgradeLockModel : DbMigration
|
|
||||||
{
|
|
||||||
public override void Up()
|
|
||||||
{
|
|
||||||
AddColumn("dbo.ProjList", "LockedBy", c => c.String(unicode: false, nullable: false, defaultValueSql:""));
|
|
||||||
AddColumn("dbo.ProjList", "LockDate", c => c.DateTime(nullable: false, precision: 0, defaultValueSql: "DATE('1900-01-01')"));
|
|
||||||
AddColumn("dbo.ProdList", "LockedBy", c => c.String(unicode: false, nullable: false, defaultValueSql: ""));
|
|
||||||
AddColumn("dbo.ProdList", "LockDate", c => c.DateTime(nullable: false, precision: 0, defaultValueSql: "DATE('1900-01-01')"));
|
|
||||||
//AddColumn("dbo.ProjList", "LockedBy", c => c.String(unicode: false));
|
|
||||||
//AddColumn("dbo.ProjList", "LockDate", c => c.DateTime(nullable: false, precision: 0, defaultValueSql: "DATE('1900 - 01 - 01')"));
|
|
||||||
//AddColumn("dbo.ProdList", "LockedBy", c => c.String(unicode: false));
|
|
||||||
//AddColumn("dbo.ProdList", "LockDate", c => c.DateTime(nullable: false, precision: 0, defaultValueSql: "DATE('1900 - 01 - 01')"));
|
|
||||||
}
|
|
||||||
|
|
||||||
public override void Down()
|
|
||||||
{
|
|
||||||
DropColumn("dbo.ProdList", "LockDate");
|
|
||||||
DropColumn("dbo.ProdList", "LockedBy");
|
|
||||||
DropColumn("dbo.ProjList", "LockDate");
|
|
||||||
DropColumn("dbo.ProjList", "LockedBy");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
File diff suppressed because one or more lines are too long
-29
@@ -1,29 +0,0 @@
|
|||||||
// <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"); }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,20 +0,0 @@
|
|||||||
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
-29
@@ -1,29 +0,0 @@
|
|||||||
// <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 AddProdStatusVarAndIndex : IMigrationMetadata
|
|
||||||
{
|
|
||||||
private readonly ResourceManager Resources = new ResourceManager(typeof(AddProdStatusVarAndIndex));
|
|
||||||
|
|
||||||
string IMigrationMetadata.Id
|
|
||||||
{
|
|
||||||
get { return "202308241516227_AddProdStatusVarAndIndex"; }
|
|
||||||
}
|
|
||||||
|
|
||||||
string IMigrationMetadata.Source
|
|
||||||
{
|
|
||||||
get { return null; }
|
|
||||||
}
|
|
||||||
|
|
||||||
string IMigrationMetadata.Target
|
|
||||||
{
|
|
||||||
get { return Resources.GetString("Target"); }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,42 +0,0 @@
|
|||||||
namespace EgtBEAMWALL.DataLayer.Migrations
|
|
||||||
{
|
|
||||||
using System;
|
|
||||||
using System.Data.Entity.Migrations;
|
|
||||||
|
|
||||||
public partial class AddProdStatusVarAndIndex : DbMigration
|
|
||||||
{
|
|
||||||
public override void Up()
|
|
||||||
{
|
|
||||||
AddColumn("dbo.ProdList", "IsActive", c => c.Boolean(nullable: false));
|
|
||||||
AddColumn("dbo.ProdList", "IsProduced", c => c.Boolean(nullable: false));
|
|
||||||
AddColumn("dbo.ProdList", "IsArchived", c => c.Boolean(nullable: false));
|
|
||||||
CreateIndex("dbo.ProjList", "DtCreated");
|
|
||||||
CreateIndex("dbo.ProjList", "DtExported");
|
|
||||||
CreateIndex("dbo.ProjList", "IsActive");
|
|
||||||
CreateIndex("dbo.ProjList", "IsNew");
|
|
||||||
CreateIndex("dbo.ProjList", "Id");
|
|
||||||
CreateIndex("dbo.ProdList", "DtCreated");
|
|
||||||
CreateIndex("dbo.ProdList", "Id");
|
|
||||||
CreateIndex("dbo.ProdList", "IsActive");
|
|
||||||
CreateIndex("dbo.ProdList", "IsProduced");
|
|
||||||
CreateIndex("dbo.ProdList", "IsArchived");
|
|
||||||
}
|
|
||||||
|
|
||||||
public override void Down()
|
|
||||||
{
|
|
||||||
DropIndex("dbo.ProdList", new[] { "IsArchived" });
|
|
||||||
DropIndex("dbo.ProdList", new[] { "IsProduced" });
|
|
||||||
DropIndex("dbo.ProdList", new[] { "IsActive" });
|
|
||||||
DropIndex("dbo.ProdList", new[] { "Id" });
|
|
||||||
DropIndex("dbo.ProdList", new[] { "DtCreated" });
|
|
||||||
DropIndex("dbo.ProjList", new[] { "Id" });
|
|
||||||
DropIndex("dbo.ProjList", new[] { "IsNew" });
|
|
||||||
DropIndex("dbo.ProjList", new[] { "IsActive" });
|
|
||||||
DropIndex("dbo.ProjList", new[] { "DtExported" });
|
|
||||||
DropIndex("dbo.ProjList", new[] { "DtCreated" });
|
|
||||||
DropColumn("dbo.ProdList", "IsArchived");
|
|
||||||
DropColumn("dbo.ProdList", "IsProduced");
|
|
||||||
DropColumn("dbo.ProdList", "IsActive");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
File diff suppressed because one or more lines are too long
-29
@@ -1,29 +0,0 @@
|
|||||||
// <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 AddProjArchivedField : IMigrationMetadata
|
|
||||||
{
|
|
||||||
private readonly ResourceManager Resources = new ResourceManager(typeof(AddProjArchivedField));
|
|
||||||
|
|
||||||
string IMigrationMetadata.Id
|
|
||||||
{
|
|
||||||
get { return "202308250853396_AddProjArchivedField"; }
|
|
||||||
}
|
|
||||||
|
|
||||||
string IMigrationMetadata.Source
|
|
||||||
{
|
|
||||||
get { return null; }
|
|
||||||
}
|
|
||||||
|
|
||||||
string IMigrationMetadata.Target
|
|
||||||
{
|
|
||||||
get { return Resources.GetString("Target"); }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,20 +0,0 @@
|
|||||||
namespace EgtBEAMWALL.DataLayer.Migrations
|
|
||||||
{
|
|
||||||
using System;
|
|
||||||
using System.Data.Entity.Migrations;
|
|
||||||
|
|
||||||
public partial class AddProjArchivedField : DbMigration
|
|
||||||
{
|
|
||||||
public override void Up()
|
|
||||||
{
|
|
||||||
AddColumn("dbo.ProjList", "IsArchived", c => c.Boolean(nullable: false));
|
|
||||||
CreateIndex("dbo.ProjList", "IsArchived");
|
|
||||||
}
|
|
||||||
|
|
||||||
public override void Down()
|
|
||||||
{
|
|
||||||
DropIndex("dbo.ProjList", new[] { "IsArchived" });
|
|
||||||
DropColumn("dbo.ProjList", "IsArchived");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
File diff suppressed because one or more lines are too long
@@ -1,6 +1,9 @@
|
|||||||
namespace EgtBEAMWALL.DataLayer.Migrations
|
namespace EgtBEAMWALL.DataLayer.Migrations
|
||||||
{
|
{
|
||||||
|
using System;
|
||||||
|
using System.Data.Entity;
|
||||||
using System.Data.Entity.Migrations;
|
using System.Data.Entity.Migrations;
|
||||||
|
using System.Linq;
|
||||||
|
|
||||||
internal sealed class Configuration : DbMigrationsConfiguration<EgtBEAMWALL.DataLayer.DatabaseContext>
|
internal sealed class Configuration : DbMigrationsConfiguration<EgtBEAMWALL.DataLayer.DatabaseContext>
|
||||||
{
|
{
|
||||||
@@ -9,6 +12,7 @@ namespace EgtBEAMWALL.DataLayer.Migrations
|
|||||||
public Configuration()
|
public Configuration()
|
||||||
{
|
{
|
||||||
AutomaticMigrationsEnabled = true;
|
AutomaticMigrationsEnabled = true;
|
||||||
|
//AutomaticMigrationsEnabled = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion Public Constructors
|
#endregion Public Constructors
|
||||||
@@ -17,14 +21,18 @@ namespace EgtBEAMWALL.DataLayer.Migrations
|
|||||||
|
|
||||||
protected override void Seed(EgtBEAMWALL.DataLayer.DatabaseContext context)
|
protected override void Seed(EgtBEAMWALL.DataLayer.DatabaseContext context)
|
||||||
{
|
{
|
||||||
// This method will be called after migrating to the latest version.
|
// This method will be called after migrating to the latest version.
|
||||||
|
|
||||||
// You can use the DbSet<T>.AddOrUpdate() helper extension method to avoid creating
|
// You can use the DbSet<T>.AddOrUpdate() helper extension method
|
||||||
// duplicate seed data. E.g.
|
// to avoid creating duplicate seed data. E.g.
|
||||||
|
//
|
||||||
|
// context.People.AddOrUpdate(
|
||||||
|
// p => p.FullName,
|
||||||
|
// new Person { FullName = "Andrew Peters" },
|
||||||
|
// new Person { FullName = "Brice Lambson" },
|
||||||
|
// new Person { FullName = "Rowan Miller" }
|
||||||
|
// );
|
||||||
//
|
//
|
||||||
// context.People.AddOrUpdate( p => p.FullName, new Person { FullName = "Andrew Peters"
|
|
||||||
// }, new Person { FullName = "Brice Lambson" }, new Person { FullName = "Rowan Miller"
|
|
||||||
// } );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion Protected Methods
|
#endregion Protected Methods
|
||||||
|
|||||||
@@ -1,39 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8" ?>
|
|
||||||
<nlog xmlns="http://www.nlog-project.org/schemas/NLog.xsd"
|
|
||||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
|
||||||
xsi:schemaLocation="http://www.nlog-project.org/schemas/NLog.xsd NLog.xsd"
|
|
||||||
autoReload="true"
|
|
||||||
throwExceptions="false"
|
|
||||||
internalLogLevel="Off" internalLogFile="c:\temp\nlog-internal.log">
|
|
||||||
|
|
||||||
<variable name="logDir" value="${basedir}"/>
|
|
||||||
<targets>
|
|
||||||
<target xsi:type="File"
|
|
||||||
name="f_base"
|
|
||||||
fileName="${logDir}/${shortdate}.log"
|
|
||||||
layout="${longdate} [${uppercase:${level}}] ${logger:shortName=true}|${message}"
|
|
||||||
archiveFileName="${logDir}/${shortdate}.{###}.log"
|
|
||||||
archiveNumbering="Sequence"
|
|
||||||
archiveAboveSize="10240000"
|
|
||||||
maxArchiveFiles="60"
|
|
||||||
enableArchiveFileCompression="false"
|
|
||||||
keepFileOpen="false"
|
|
||||||
/>
|
|
||||||
<target xsi:type="File"
|
|
||||||
name="f_error"
|
|
||||||
fileName="${logDir}/${shortdate}_err.log"
|
|
||||||
layout="${longdate} [${uppercase:${level}}] ${logger:shortName=true}|${message}${newline}${exception:format=tostring}"
|
|
||||||
archiveFileName="${logDir}/${shortdate}_err.{###}.log"
|
|
||||||
archiveNumbering="Sequence"
|
|
||||||
archiveAboveSize="10240000"
|
|
||||||
maxArchiveFiles="60"
|
|
||||||
enableArchiveFileCompression="false"
|
|
||||||
keepFileOpen="false"
|
|
||||||
/>
|
|
||||||
</targets>
|
|
||||||
<rules>
|
|
||||||
<!-- Logging Levels (Trace, Debug, Info, Warn, Error, Fatal)-->
|
|
||||||
<logger name="*" minlevel="Info" maxlevel="Warn" final="true" writeTo="f_base" />
|
|
||||||
<logger name="*" minlevel="Error" writeTo="f_error" />
|
|
||||||
</rules>
|
|
||||||
</nlog>
|
|
||||||
@@ -10,7 +10,7 @@ using System.Runtime.InteropServices;
|
|||||||
[assembly: AssemblyConfiguration("")]
|
[assembly: AssemblyConfiguration("")]
|
||||||
[assembly: AssemblyCompany("Egalware s.r.l.")]
|
[assembly: AssemblyCompany("Egalware s.r.l.")]
|
||||||
[assembly: AssemblyProduct("EgtBEAMWALL.DataLayer")]
|
[assembly: AssemblyProduct("EgtBEAMWALL.DataLayer")]
|
||||||
[assembly: AssemblyCopyright("Copyright © 2020-2023 by Egalware s.r.l.")]
|
[assembly: AssemblyCopyright("Copyright © 2020-2022 by Egalware s.r.l.")]
|
||||||
[assembly: AssemblyTrademark("")]
|
[assembly: AssemblyTrademark("")]
|
||||||
[assembly: AssemblyCulture("")]
|
[assembly: AssemblyCulture("")]
|
||||||
|
|
||||||
@@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
|
|||||||
// You can specify all the values or you can default the Build and Revision Numbers
|
// You can specify all the values or you can default the Build and Revision Numbers
|
||||||
// by using the '*' as shown below:
|
// by using the '*' as shown below:
|
||||||
// [assembly: AssemblyVersion("1.0.*")]
|
// [assembly: AssemblyVersion("1.0.*")]
|
||||||
[assembly: AssemblyVersion("2.5.8.1")]
|
[assembly: AssemblyVersion("2.4.3.2")]
|
||||||
[assembly: AssemblyFileVersion("2.5.8.1")]
|
[assembly: AssemblyFileVersion("2.4.3.2")]
|
||||||
|
|||||||
@@ -1,22 +1,7 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<packages>
|
<packages>
|
||||||
<package id="BouncyCastle" version="1.8.5" targetFramework="net472" />
|
|
||||||
<package id="DotNetZip" version="1.16.0" targetFramework="net472" />
|
|
||||||
<package id="EntityFramework" version="6.4.4" targetFramework="net452" />
|
<package id="EntityFramework" version="6.4.4" targetFramework="net452" />
|
||||||
<package id="Google.Protobuf" version="3.21.9" targetFramework="net472" />
|
<package id="MySql.Data" version="6.10.9" targetFramework="net452" />
|
||||||
<package id="K4os.Compression.LZ4" version="1.3.5" targetFramework="net472" />
|
<package id="MySql.Data.Entity" version="6.10.9" targetFramework="net452" />
|
||||||
<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="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.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="6.0.0" targetFramework="net472" />
|
|
||||||
<package id="System.Threading.Tasks.Extensions" version="4.5.4" targetFramework="net472" />
|
|
||||||
</packages>
|
</packages>
|
||||||
@@ -1,51 +1,31 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<configuration>
|
<configuration>
|
||||||
<configSections>
|
<configSections>
|
||||||
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
|
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false"/>
|
||||||
<!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
|
<!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
|
||||||
</configSections>
|
</configSections>
|
||||||
<entityFramework>
|
<entityFramework>
|
||||||
<defaultConnectionFactory type="MySql.Data.Entity.MySqlConnectionFactory, MySql.Data.Entity.EF6" />
|
<defaultConnectionFactory type="MySql.Data.Entity.MySqlConnectionFactory, MySql.Data.Entity.EF6"/>
|
||||||
<providers>
|
<providers>
|
||||||
|
|
||||||
<provider invariantName="MySql.Data.MySqlClient" type="MySql.Data.MySqlClient.MySqlProviderServices, Version=6.10.9.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d"></provider>
|
<provider invariantName="MySql.Data.MySqlClient" type="MySql.Data.MySqlClient.MySqlProviderServices, MySql.Data.Entity.EF6, Version=6.10.9.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d"></provider>
|
||||||
</providers>
|
</providers>
|
||||||
</entityFramework>
|
</entityFramework>
|
||||||
<connectionStrings>
|
<connectionStrings>
|
||||||
<add name="DefaultConnection" connectionString="server=localhost;port=3306;User Id=EgtUser;password=viacremasca;Persist Security Info=True;database=EgtBwDb;SslMode=none" providerName="MySql.Data.MySqlClient" />
|
<add name="DefaultConnection" connectionString="server=localhost;port=3306;User Id=EgtUser;password=viacremasca;Persist Security Info=True;database=EgtBwDb;SslMode=none" providerName="MySql.Data.MySqlClient"/>
|
||||||
</connectionStrings>
|
</connectionStrings>
|
||||||
<runtime>
|
<runtime>
|
||||||
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
|
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
|
||||||
<dependentAssembly>
|
<dependentAssembly>
|
||||||
<assemblyIdentity name="MySql.Data" publicKeyToken="c5687fc88969c44d" culture="neutral" />
|
<assemblyIdentity name="MySql.Data" publicKeyToken="c5687fc88969c44d" culture="neutral"/>
|
||||||
<bindingRedirect oldVersion="0.0.0.0-6.10.9.0" newVersion="6.10.9.0" />
|
<bindingRedirect oldVersion="0.0.0.0-6.10.9.0" newVersion="6.10.9.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>
|
|
||||||
<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>
|
||||||
</assemblyBinding>
|
</assemblyBinding>
|
||||||
</runtime>
|
</runtime>
|
||||||
<system.data>
|
<system.data>
|
||||||
<DbProviderFactories>
|
<DbProviderFactories>
|
||||||
<remove invariant="MySql.Data.MySqlClient" />
|
<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=6.10.9.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d" />
|
<add name="MySQL Data Provider" invariant="MySql.Data.MySqlClient" description=".Net Framework Data Provider for MySQL" type="MySql.Data.MySqlClient.MySqlClientFactory, MySql.Data, Version=6.10.9.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d"/>
|
||||||
</DbProviderFactories>
|
</DbProviderFactories>
|
||||||
</system.data>
|
</system.data>
|
||||||
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" /></startup></configuration>
|
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2"/></startup></configuration>
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
<OutputType>WinExe</OutputType>
|
<OutputType>WinExe</OutputType>
|
||||||
<RootNamespace>EgtBEAMWALL.StressTest</RootNamespace>
|
<RootNamespace>EgtBEAMWALL.StressTest</RootNamespace>
|
||||||
<AssemblyName>EgtBEAMWALL.StressTest</AssemblyName>
|
<AssemblyName>EgtBEAMWALL.StressTest</AssemblyName>
|
||||||
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
|
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
|
||||||
<FileAlignment>512</FileAlignment>
|
<FileAlignment>512</FileAlignment>
|
||||||
<Deterministic>true</Deterministic>
|
<Deterministic>true</Deterministic>
|
||||||
<TargetFrameworkProfile />
|
<TargetFrameworkProfile />
|
||||||
@@ -35,20 +35,8 @@
|
|||||||
<Prefer32Bit>false</Prefer32Bit>
|
<Prefer32Bit>false</Prefer32Bit>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Reference Include="EgtUILib, Version=2.4.6.1, Culture=neutral, processorArchitecture=MSIL">
|
|
||||||
<HintPath>..\packages\EgtWPFLib5.2.4.7.1\lib\EgtUILib.dll</HintPath>
|
|
||||||
</Reference>
|
|
||||||
<Reference Include="EgtWPFLib, Version=2.4.5.1, Culture=neutral, processorArchitecture=MSIL">
|
|
||||||
<HintPath>..\packages\EgtWPFLib5.2.4.7.1\lib\EgtWPFLib.dll</HintPath>
|
|
||||||
</Reference>
|
|
||||||
<Reference Include="EgtWPFLib5, Version=2.4.7.1, Culture=neutral, processorArchitecture=MSIL">
|
|
||||||
<HintPath>..\packages\EgtWPFLib5.2.4.7.1\lib\EgtWPFLib5.dll</HintPath>
|
|
||||||
</Reference>
|
|
||||||
<Reference Include="System" />
|
<Reference Include="System" />
|
||||||
<Reference Include="System.Core" />
|
<Reference Include="System.Core" />
|
||||||
<Reference Include="System.Windows.Interactivity, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
|
||||||
<HintPath>..\packages\EgtWPFLib5.2.4.7.1\lib\System.Windows.Interactivity.dll</HintPath>
|
|
||||||
</Reference>
|
|
||||||
<Reference Include="System.Xml.Linq" />
|
<Reference Include="System.Xml.Linq" />
|
||||||
<Reference Include="System.Data.DataSetExtensions" />
|
<Reference Include="System.Data.DataSetExtensions" />
|
||||||
<Reference Include="Microsoft.CSharp" />
|
<Reference Include="Microsoft.CSharp" />
|
||||||
@@ -83,7 +71,6 @@
|
|||||||
<DependentUpon>StressTest.cs</DependentUpon>
|
<DependentUpon>StressTest.cs</DependentUpon>
|
||||||
</EmbeddedResource>
|
</EmbeddedResource>
|
||||||
<None Include="App.config" />
|
<None Include="App.config" />
|
||||||
<None Include="packages.config" />
|
|
||||||
<None Include="Properties\Settings.settings">
|
<None Include="Properties\Settings.settings">
|
||||||
<Generator>SettingsSingleFileGenerator</Generator>
|
<Generator>SettingsSingleFileGenerator</Generator>
|
||||||
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
|
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
|
||||||
|
|||||||
+1
-1
@@ -19,7 +19,7 @@ namespace EgtBEAMWALL.StressTest.Properties {
|
|||||||
// class via a tool like ResGen or Visual Studio.
|
// class via a tool like ResGen or Visual Studio.
|
||||||
// To add or remove a member, edit your .ResX file then rerun ResGen
|
// To add or remove a member, edit your .ResX file then rerun ResGen
|
||||||
// with the /str option, or rebuild your VS project.
|
// with the /str option, or rebuild your VS project.
|
||||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")]
|
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")]
|
||||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||||
internal class Resources {
|
internal class Resources {
|
||||||
|
|||||||
+1
-1
@@ -12,7 +12,7 @@ namespace EgtBEAMWALL.StressTest.Properties {
|
|||||||
|
|
||||||
|
|
||||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.6.0.0")]
|
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.8.1.0")]
|
||||||
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
|
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
|
||||||
|
|
||||||
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
|
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
|
||||||
|
|||||||
@@ -1,11 +1,25 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.Diagnostics;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
|
||||||
namespace EgtBEAMWALL.StressTest
|
namespace EgtBEAMWALL.StressTest
|
||||||
{
|
{
|
||||||
public class Simulator
|
public class Simulator
|
||||||
{
|
{
|
||||||
|
#region Protected Fields
|
||||||
|
|
||||||
|
protected DataLayer.Controllers.BTLPartController BtlPartCtr = new DataLayer.Controllers.BTLPartController();
|
||||||
|
protected DataLayer.Controllers.MachGroupController MachGroupCtr = new DataLayer.Controllers.MachGroupController();
|
||||||
|
protected SimParams MaxParams = new SimParams();
|
||||||
|
|
||||||
|
protected DataLayer.Controllers.PartController PartCtr = new DataLayer.Controllers.PartController();
|
||||||
|
protected DataLayer.Controllers.ProdController ProdCtr = new DataLayer.Controllers.ProdController();
|
||||||
|
protected DataLayer.Controllers.ProjController ProjCtr = new DataLayer.Controllers.ProjController();
|
||||||
|
|
||||||
|
#endregion Protected Fields
|
||||||
|
|
||||||
#region Public Fields
|
#region Public Fields
|
||||||
|
|
||||||
public List<Core.BTLPartM> BtlPartList = new List<Core.BTLPartM>();
|
public List<Core.BTLPartM> BtlPartList = new List<Core.BTLPartM>();
|
||||||
@@ -16,6 +30,30 @@ namespace EgtBEAMWALL.StressTest
|
|||||||
|
|
||||||
#endregion Public Fields
|
#endregion Public Fields
|
||||||
|
|
||||||
|
#region Protected Properties
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// restituisce un set di parametri simulazione generando a caso dal set di base
|
||||||
|
/// </summary>
|
||||||
|
protected SimParams RandomParamSet
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
Random rndGen = new Random();
|
||||||
|
SimParams answ = new SimParams()
|
||||||
|
{
|
||||||
|
BtlPart2Proj = rndGen.Next(MaxParams.BtlPart2Proj) + 1,
|
||||||
|
BtlRepeat = rndGen.Next(MaxParams.BtlRepeat) + 1,
|
||||||
|
Part2MachGroup = rndGen.Next(MaxParams.Part2MachGroup) + 1,
|
||||||
|
Proj2Prod = rndGen.Next(MaxParams.Proj2Prod) + 1
|
||||||
|
};
|
||||||
|
|
||||||
|
return answ;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion Protected Properties
|
||||||
|
|
||||||
#region Public Methods
|
#region Public Methods
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -41,7 +79,7 @@ namespace EgtBEAMWALL.StressTest
|
|||||||
List<DataLayer.DatabaseModels.BTLPartModel> currPartList = new List<DataLayer.DatabaseModels.BTLPartModel>();
|
List<DataLayer.DatabaseModels.BTLPartModel> currPartList = new List<DataLayer.DatabaseModels.BTLPartModel>();
|
||||||
List<Core.MyMachGroupM> currMachGroupList = new List<Core.MyMachGroupM>();
|
List<Core.MyMachGroupM> currMachGroupList = new List<Core.MyMachGroupM>();
|
||||||
List<Core.PartM> currMGPartList = new List<Core.PartM>();
|
List<Core.PartM> currMGPartList = new List<Core.PartM>();
|
||||||
ProjCtr.UpdateInfo(currProjId, "TestBTL", $"{DateTime.Now:yyyyMMdd_HHmmssfff}", $"LN_{DateTime.Now:yyyyMMdd_HHmm}", DateTime.Now.AddSeconds(15), Core.ConstBeam.BWType.BEAM, "SIM01");
|
ProjCtr.UpdateInfo(currProjId, $"{DateTime.Now:yyyyMMdd_HHmmssfff}", $"LN_{DateTime.Now:yyyyMMdd_HHmm}", DateTime.Now.AddSeconds(15));
|
||||||
// genero le BTLParts ed assegno..
|
// genero le BTLParts ed assegno..
|
||||||
for (int j = 0; j < currRandom.BtlPart2Proj; j++)
|
for (int j = 0; j < currRandom.BtlPart2Proj; j++)
|
||||||
{
|
{
|
||||||
@@ -69,9 +107,9 @@ namespace EgtBEAMWALL.StressTest
|
|||||||
{
|
{
|
||||||
for (int l = 0; l < currRandom.Part2MachGroup; l++)
|
for (int l = 0; l < currRandom.Part2MachGroup; l++)
|
||||||
{
|
{
|
||||||
// FixME!!! non può creare x loop in CreateBeamDL che vuole
|
// FixME!!! non può creare x loop in CreateBeamDL che vuole nParentMachGroup
|
||||||
// nParentMachGroup genero le Part x MachGroup ed assegno
|
// genero le Part x MachGroup ed assegno
|
||||||
Core.PartM currPart = Core.PartM.CreatePart(Core.ConstBeam.BWType.BEAM, currMachGroupList.FirstOrDefault(), currPartList[BPIdx].PartId, 1);
|
Core.PartM currPart = Core.BeamM.CreateBeamDL(null, currPartList[BPIdx].PartId, 1);
|
||||||
currMGPartList.Add(currPart);
|
currMGPartList.Add(currPart);
|
||||||
//currMGPartList.Add(new DataLayer.DatabaseModels.PartModel() { BTLPartDbId = currBTLPart.BTLPartDbId, PDN = l * k * currRandom.Part2MachGroup, PartId = l, H = 10 * l, L = 50 * l, W = 5 * l });
|
//currMGPartList.Add(new DataLayer.DatabaseModels.PartModel() { BTLPartDbId = currBTLPart.BTLPartDbId, PDN = l * k * currRandom.Part2MachGroup, PartId = l, H = 10 * l, L = 50 * l, W = 5 * l });
|
||||||
}
|
}
|
||||||
@@ -100,45 +138,9 @@ namespace EgtBEAMWALL.StressTest
|
|||||||
|
|
||||||
public void initDb()
|
public void initDb()
|
||||||
{
|
{
|
||||||
var firstData = ProjCtr.GetLastDesc(1, true);
|
var firstData = ProjCtr.GetLastDesc(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion Public Methods
|
#endregion Public Methods
|
||||||
|
|
||||||
#region Protected Fields
|
|
||||||
|
|
||||||
protected DataLayer.Controllers.BTLPartController BtlPartCtr = new DataLayer.Controllers.BTLPartController();
|
|
||||||
protected DataLayer.Controllers.MachGroupController MachGroupCtr = new DataLayer.Controllers.MachGroupController();
|
|
||||||
protected SimParams MaxParams = new SimParams();
|
|
||||||
|
|
||||||
protected DataLayer.Controllers.PartController PartCtr = new DataLayer.Controllers.PartController();
|
|
||||||
protected DataLayer.Controllers.ProdController ProdCtr = new DataLayer.Controllers.ProdController();
|
|
||||||
protected DataLayer.Controllers.ProjController ProjCtr = new DataLayer.Controllers.ProjController();
|
|
||||||
|
|
||||||
#endregion Protected Fields
|
|
||||||
|
|
||||||
#region Protected Properties
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// restituisce un set di parametri simulazione generando a caso dal set di base
|
|
||||||
/// </summary>
|
|
||||||
protected SimParams RandomParamSet
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
Random rndGen = new Random();
|
|
||||||
SimParams answ = new SimParams()
|
|
||||||
{
|
|
||||||
BtlPart2Proj = rndGen.Next(MaxParams.BtlPart2Proj) + 1,
|
|
||||||
BtlRepeat = rndGen.Next(MaxParams.BtlRepeat) + 1,
|
|
||||||
Part2MachGroup = rndGen.Next(MaxParams.Part2MachGroup) + 1,
|
|
||||||
Proj2Prod = rndGen.Next(MaxParams.Proj2Prod) + 1
|
|
||||||
};
|
|
||||||
|
|
||||||
return answ;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#endregion Protected Properties
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
+1
-49
@@ -35,10 +35,6 @@ namespace EgtBEAMWALL.StressTest
|
|||||||
this.groupBox1 = new System.Windows.Forms.GroupBox();
|
this.groupBox1 = new System.Windows.Forms.GroupBox();
|
||||||
this.buttonDataSeed = new System.Windows.Forms.Button();
|
this.buttonDataSeed = new System.Windows.Forms.Button();
|
||||||
this.labelResult = new System.Windows.Forms.Label();
|
this.labelResult = new System.Windows.Forms.Label();
|
||||||
this.btnDbDump = new System.Windows.Forms.Button();
|
|
||||||
this.btnDbRestore = new System.Windows.Forms.Button();
|
|
||||||
this.txtDumpFile = new System.Windows.Forms.TextBox();
|
|
||||||
this.txtDbName = new System.Windows.Forms.TextBox();
|
|
||||||
this.groupBox1.SuspendLayout();
|
this.groupBox1.SuspendLayout();
|
||||||
this.SuspendLayout();
|
this.SuspendLayout();
|
||||||
//
|
//
|
||||||
@@ -96,57 +92,17 @@ namespace EgtBEAMWALL.StressTest
|
|||||||
// labelResult
|
// labelResult
|
||||||
//
|
//
|
||||||
this.labelResult.AutoSize = true;
|
this.labelResult.AutoSize = true;
|
||||||
this.labelResult.Location = new System.Drawing.Point(250, 75);
|
this.labelResult.Location = new System.Drawing.Point(479, 91);
|
||||||
this.labelResult.Name = "labelResult";
|
this.labelResult.Name = "labelResult";
|
||||||
this.labelResult.Size = new System.Drawing.Size(35, 13);
|
this.labelResult.Size = new System.Drawing.Size(35, 13);
|
||||||
this.labelResult.TabIndex = 4;
|
this.labelResult.TabIndex = 4;
|
||||||
this.labelResult.Text = "label2";
|
this.labelResult.Text = "label2";
|
||||||
//
|
//
|
||||||
// btnDbDump
|
|
||||||
//
|
|
||||||
this.btnDbDump.Location = new System.Drawing.Point(18, 136);
|
|
||||||
this.btnDbDump.Name = "btnDbDump";
|
|
||||||
this.btnDbDump.Size = new System.Drawing.Size(75, 45);
|
|
||||||
this.btnDbDump.TabIndex = 5;
|
|
||||||
this.btnDbDump.Text = "DB Dump";
|
|
||||||
this.btnDbDump.UseVisualStyleBackColor = true;
|
|
||||||
this.btnDbDump.Click += new System.EventHandler(this.btnDbDump_Click);
|
|
||||||
//
|
|
||||||
// btnDbRestore
|
|
||||||
//
|
|
||||||
this.btnDbRestore.Location = new System.Drawing.Point(338, 136);
|
|
||||||
this.btnDbRestore.Name = "btnDbRestore";
|
|
||||||
this.btnDbRestore.Size = new System.Drawing.Size(75, 45);
|
|
||||||
this.btnDbRestore.TabIndex = 6;
|
|
||||||
this.btnDbRestore.Text = "DB Restore";
|
|
||||||
this.btnDbRestore.UseVisualStyleBackColor = true;
|
|
||||||
this.btnDbRestore.Click += new System.EventHandler(this.btnDbRestore_Click);
|
|
||||||
//
|
|
||||||
// txtDumpFile
|
|
||||||
//
|
|
||||||
this.txtDumpFile.Location = new System.Drawing.Point(118, 161);
|
|
||||||
this.txtDumpFile.Name = "txtDumpFile";
|
|
||||||
this.txtDumpFile.Size = new System.Drawing.Size(186, 20);
|
|
||||||
this.txtDumpFile.TabIndex = 3;
|
|
||||||
this.txtDumpFile.Text = "C:\\Temp\\MyDbDump.zip";
|
|
||||||
//
|
|
||||||
// txtDbName
|
|
||||||
//
|
|
||||||
this.txtDbName.Location = new System.Drawing.Point(118, 136);
|
|
||||||
this.txtDbName.Name = "txtDbName";
|
|
||||||
this.txtDbName.Size = new System.Drawing.Size(186, 20);
|
|
||||||
this.txtDbName.TabIndex = 7;
|
|
||||||
this.txtDbName.Text = "egtbwdb_000142";
|
|
||||||
//
|
|
||||||
// StressTest
|
// StressTest
|
||||||
//
|
//
|
||||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||||
this.ClientSize = new System.Drawing.Size(800, 450);
|
this.ClientSize = new System.Drawing.Size(800, 450);
|
||||||
this.Controls.Add(this.txtDbName);
|
|
||||||
this.Controls.Add(this.txtDumpFile);
|
|
||||||
this.Controls.Add(this.btnDbRestore);
|
|
||||||
this.Controls.Add(this.btnDbDump);
|
|
||||||
this.Controls.Add(this.labelResult);
|
this.Controls.Add(this.labelResult);
|
||||||
this.Controls.Add(this.groupBox1);
|
this.Controls.Add(this.groupBox1);
|
||||||
this.Name = "StressTest";
|
this.Name = "StressTest";
|
||||||
@@ -166,10 +122,6 @@ namespace EgtBEAMWALL.StressTest
|
|||||||
private System.Windows.Forms.GroupBox groupBox1;
|
private System.Windows.Forms.GroupBox groupBox1;
|
||||||
private System.Windows.Forms.Button buttonDataSeed;
|
private System.Windows.Forms.Button buttonDataSeed;
|
||||||
private System.Windows.Forms.Label labelResult;
|
private System.Windows.Forms.Label labelResult;
|
||||||
private System.Windows.Forms.Button btnDbDump;
|
|
||||||
private System.Windows.Forms.Button btnDbRestore;
|
|
||||||
private System.Windows.Forms.TextBox txtDumpFile;
|
|
||||||
private System.Windows.Forms.TextBox txtDbName;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,25 +1,17 @@
|
|||||||
using System;
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.ComponentModel;
|
||||||
|
using System.Data;
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
using System.IO;
|
using System.Drawing;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
using System.Windows.Forms;
|
using System.Windows.Forms;
|
||||||
|
|
||||||
namespace EgtBEAMWALL.StressTest
|
namespace EgtBEAMWALL.StressTest
|
||||||
{
|
{
|
||||||
public partial class StressTest : Form
|
public partial class StressTest : Form
|
||||||
{
|
{
|
||||||
#region Public Constructors
|
|
||||||
|
|
||||||
public StressTest()
|
|
||||||
{
|
|
||||||
InitializeComponent();
|
|
||||||
// init cablato sul mio DB
|
|
||||||
DataLayer.DbConfig.InitDb("127.0.0.1", "000470", "36311", "000470");
|
|
||||||
//// warm up DB
|
|
||||||
//CurrSim.initDb();
|
|
||||||
}
|
|
||||||
|
|
||||||
#endregion Public Constructors
|
|
||||||
|
|
||||||
#region Protected Fields
|
#region Protected Fields
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -29,6 +21,17 @@ namespace EgtBEAMWALL.StressTest
|
|||||||
|
|
||||||
#endregion Protected Fields
|
#endregion Protected Fields
|
||||||
|
|
||||||
|
#region Public Constructors
|
||||||
|
|
||||||
|
public StressTest()
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
// warm up DB
|
||||||
|
CurrSim.initDb();
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion Public Constructors
|
||||||
|
|
||||||
#region Protected Properties
|
#region Protected Properties
|
||||||
|
|
||||||
protected int numProj
|
protected int numProj
|
||||||
@@ -49,54 +52,6 @@ namespace EgtBEAMWALL.StressTest
|
|||||||
|
|
||||||
#region Private Methods
|
#region Private Methods
|
||||||
|
|
||||||
private void btnDbDump_Click(object sender, EventArgs e)
|
|
||||||
{
|
|
||||||
var result = MessageBox.Show("Sicuro di voler generare il dump del DB corrente?", "DB Dump", MessageBoxButtons.YesNo, MessageBoxIcon.Exclamation);
|
|
||||||
|
|
||||||
if (result == DialogResult.Yes)
|
|
||||||
{
|
|
||||||
labelResult.Text = "...";
|
|
||||||
Stopwatch sw = new Stopwatch();
|
|
||||||
sw.Start();
|
|
||||||
//string binPath = "C:\\Program Files\\MariaDB 10.5\\bin";
|
|
||||||
//string myDumpPath = Path.Combine(binPath, "mysqldump.exe");
|
|
||||||
string outPath = txtDumpFile.Text.Trim();
|
|
||||||
string dbName = txtDbName.Text.Trim();
|
|
||||||
if (!string.IsNullOrEmpty(outPath))
|
|
||||||
{
|
|
||||||
// effettua dump
|
|
||||||
//DataLayer.DbConfig.DataBaseDumpToFile(outPath, "mysqldump");
|
|
||||||
//DataLayer.DbConfig.DataBaseDumpToFile(outPath, "mysqldump", "--skip-extended-insert");
|
|
||||||
DataLayer.DbConfig.DataBaseDumpToFile(outPath, dbName);
|
|
||||||
sw.Stop();
|
|
||||||
var elapsed = sw.Elapsed;
|
|
||||||
labelResult.Text = $"{DateTime.Now:yyyy/MM/dd HH:mm:ss} | Dump Done in {elapsed.TotalSeconds:N3} sec!";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void btnDbRestore_Click(object sender, EventArgs e)
|
|
||||||
{
|
|
||||||
var result = MessageBox.Show("Sicuro di voler ripristinare il file dump sul DB corrente?", "DB Restore", MessageBoxButtons.YesNo, MessageBoxIcon.Exclamation);
|
|
||||||
|
|
||||||
if (result == DialogResult.Yes)
|
|
||||||
{
|
|
||||||
labelResult.Text = "...";
|
|
||||||
string inPath = txtDumpFile.Text.Trim();
|
|
||||||
string dbName = txtDbName.Text.Trim();
|
|
||||||
string tempFolder = Path.Combine(Path.GetDirectoryName(inPath), "DbRestore");
|
|
||||||
Stopwatch sw = new Stopwatch();
|
|
||||||
sw.Start();
|
|
||||||
// effettua restore
|
|
||||||
DataLayer.DbConfig.DataBaseRestoreFromFile(inPath, dbName, tempFolder); sw.Stop();
|
|
||||||
//string binPath = "C:\\Program Files\\MariaDB 10.5\\bin";
|
|
||||||
//string mysqlPath = Path.Combine(binPath, "mysql.exe");
|
|
||||||
//DataLayer.DbConfig.DataBaseRestoreFromFile(inPath, "mysql");
|
|
||||||
var elapsed = sw.Elapsed;
|
|
||||||
labelResult.Text = $"{DateTime.Now:yyyy/MM/dd HH:mm:ss} | Restore Done in {elapsed.TotalSeconds:N3} sec!";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void buttonDataSeed_Click(object sender, EventArgs e)
|
private void buttonDataSeed_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
// genero dati col SIM
|
// genero dati col SIM
|
||||||
|
|||||||
@@ -1,4 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<packages>
|
|
||||||
<package id="EgtWPFLib5" version="2.4.7.1" targetFramework="net452" />
|
|
||||||
</packages>
|
|
||||||
@@ -3,7 +3,8 @@ Imports EgtBEAMWALL.Core
|
|||||||
|
|
||||||
Public Class AboutBoxV
|
Public Class AboutBoxV
|
||||||
|
|
||||||
Private Sub AboutBoxWD_Loaded(sender As Object, e As RoutedEventArgs) Handles Me.Loaded
|
Private Sub AboutBoxWD_Initialized(sender As Object, e As EventArgs) Handles Me.Initialized
|
||||||
|
Me.Owner = Application.Current.MainWindow
|
||||||
DescriptionLbl.Text = My.Application.Info.Description.ToString()
|
DescriptionLbl.Text = My.Application.Info.Description.ToString()
|
||||||
VersionLbl.Text = "Version : " & My.Application.Info.Version.Major.ToString() &
|
VersionLbl.Text = "Version : " & My.Application.Info.Version.Major.ToString() &
|
||||||
"." & My.Application.Info.Version.Minor.ToString() &
|
"." & My.Application.Info.Version.Minor.ToString() &
|
||||||
@@ -24,9 +25,6 @@ Public Class AboutBoxV
|
|||||||
sInfo &= sKey & " - " & sKlev & " - " & sOpts & sLeftDays & Environment.NewLine
|
sInfo &= sKey & " - " & sKlev & " - " & sOpts & sLeftDays & Environment.NewLine
|
||||||
sInfo &= "DataRoot " & Map.refMainWindowVM.MainWindowM.sDataRoot & Environment.NewLine
|
sInfo &= "DataRoot " & Map.refMainWindowVM.MainWindowM.sDataRoot & Environment.NewLine
|
||||||
sInfo &= "MachinesRoot " & Map.refMainWindowVM.MainWindowM.sMachinesRoot & Environment.NewLine
|
sInfo &= "MachinesRoot " & Map.refMainWindowVM.MainWindowM.sMachinesRoot & Environment.NewLine
|
||||||
Dim sOpSys As String = String.Empty
|
|
||||||
EgtGetOsInfo( sOpSys)
|
|
||||||
sInfo &= sOpSys & Environment.NewLine
|
|
||||||
Dim sCPU As String = String.Empty
|
Dim sCPU As String = String.Empty
|
||||||
EgtGetCpuInfo( sCPU)
|
EgtGetCpuInfo( sCPU)
|
||||||
sInfo &= sCPU & Environment.NewLine
|
sInfo &= sCPU & Environment.NewLine
|
||||||
@@ -34,7 +32,7 @@ Public Class AboutBoxV
|
|||||||
EgtGetSceneInfo(sScene)
|
EgtGetSceneInfo(sScene)
|
||||||
sInfo &= sScene
|
sInfo &= sScene
|
||||||
InfoLbl.Text = sInfo
|
InfoLbl.Text = sInfo
|
||||||
ExitBtn.Content = EgtMsg(MSG_MISSINGKEYWD + 4) 'Ok
|
ExitBtn.Content = EgtMsg(constmsg.MSG_MISSINGKEYWD + 4) 'Ok
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
End Class
|
End Class
|
||||||
|
|||||||
@@ -3,6 +3,7 @@
|
|||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
|
xmlns:local="clr-namespace:EgtCOMMTest"
|
||||||
mc:Ignorable="d"
|
mc:Ignorable="d"
|
||||||
d:DesignHeight="450" d:DesignWidth="800">
|
d:DesignHeight="450" d:DesignWidth="800">
|
||||||
<ItemsControl ItemsSource="{Binding AxesList}">
|
<ItemsControl ItemsSource="{Binding AxesList}">
|
||||||
|
|||||||
@@ -16,27 +16,6 @@ Public Class CALCPanelVM
|
|||||||
End Set
|
End Set
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
Private m_bMachineLog As Boolean = False
|
|
||||||
Public Property bMachineLog As Boolean
|
|
||||||
Get
|
|
||||||
Return m_bMachineLog
|
|
||||||
End Get
|
|
||||||
Set(value As Boolean)
|
|
||||||
m_bMachineLog = value
|
|
||||||
If value Then
|
|
||||||
Map.refProjectVM.SetSelTabPage(ProjectVM.TabPages.MACHINELOG)
|
|
||||||
ElseIf Not IsNothing(Map.refLeftPanelVM.SelOPMode) AndAlso Map.refLeftPanelVM.SelOPMode.Id = OPModes.Mdi Then
|
|
||||||
Map.refProjectVM.SetSelTabPage(ProjectVM.TabPages.MDI)
|
|
||||||
Else
|
|
||||||
Map.refProjectVM.SetSelTabPage(ProjectVM.TabPages.SCENE)
|
|
||||||
End If
|
|
||||||
End Set
|
|
||||||
End Property
|
|
||||||
Friend Sub SetMachineLog(value As Boolean)
|
|
||||||
m_bMachineLog = value
|
|
||||||
NotifyPropertyChanged(NameOf(bMachineLog))
|
|
||||||
End Sub
|
|
||||||
|
|
||||||
' Definizione comandi
|
' Definizione comandi
|
||||||
Private m_cmdVerify As ICommand
|
Private m_cmdVerify As ICommand
|
||||||
Private m_cmdVerifyAll As ICommand
|
Private m_cmdVerifyAll As ICommand
|
||||||
@@ -106,8 +85,6 @@ Public Class CALCPanelVM
|
|||||||
m_ProcessResultList = New List(Of Integer)
|
m_ProcessResultList = New List(Of Integer)
|
||||||
Map.refProjectVM.ManageIsEnabled(True)
|
Map.refProjectVM.ManageIsEnabled(True)
|
||||||
Map.refMyStatusBarVM.ResetStopProgress()
|
Map.refMyStatusBarVM.ResetStopProgress()
|
||||||
' riabilito bottoni di comunicazione a fine invio programma
|
|
||||||
Map.refMachCommandMessagePanelVM.SetCommBtnIsEnabled(True)
|
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Sub Calc_ProcessEnded(sender As Object, e As CalcProcessEndEventArgs)
|
Private Sub Calc_ProcessEnded(sender As Object, e As CalcProcessEndEventArgs)
|
||||||
@@ -118,10 +95,6 @@ Public Class CALCPanelVM
|
|||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Shared Sub ProcessResults(Bar As Bar)
|
Private Shared Sub ProcessResults(Bar As Bar)
|
||||||
If IsNothing(Bar) Then Return
|
|
||||||
|
|
||||||
' disabilito impostazione modificato
|
|
||||||
Dim DisableMgr As New DisableModifiedMgr
|
|
||||||
|
|
||||||
Dim BtlPath As String = Bar.sBarPath
|
Dim BtlPath As String = Bar.sBarPath
|
||||||
Dim ResPath As String = Path.ChangeExtension(BtlPath, ".txt")
|
Dim ResPath As String = Path.ChangeExtension(BtlPath, ".txt")
|
||||||
@@ -143,13 +116,14 @@ Public Class CALCPanelVM
|
|||||||
Dim cutId As Integer = 0
|
Dim cutId As Integer = 0
|
||||||
Dim taskId As Integer = 0
|
Dim taskId As Integer = 0
|
||||||
Dim prevCutId As Integer = GDB_ID.NULL
|
Dim prevCutId As Integer = GDB_ID.NULL
|
||||||
|
Dim currPart As PartVM
|
||||||
|
|
||||||
Dim lines As String() = System.IO.File.ReadAllLines(ResPath)
|
Dim lines As String() = System.IO.File.ReadAllLines(ResPath)
|
||||||
For Each line As String In lines
|
For Each line As String In lines
|
||||||
|
|
||||||
If line.StartsWith("ERR=") Then
|
If line.StartsWith("ERR=") Then
|
||||||
Dim nVal As Integer? = GetVal(line, "ERR")
|
Dim nVal As Integer? = GetVal(line, "ERR")
|
||||||
nErr = (If(Not IsNothing(nVal), nVal.Value, 0))
|
nErr = (If(nVal IsNot Nothing, nVal.Value, 0))
|
||||||
sMsg = ""
|
sMsg = ""
|
||||||
dRot = 0
|
dRot = 0
|
||||||
nFall = 0
|
nFall = 0
|
||||||
@@ -157,24 +131,24 @@ Public Class CALCPanelVM
|
|||||||
taskId = 0
|
taskId = 0
|
||||||
ElseIf line.StartsWith("ROT=") Then
|
ElseIf line.StartsWith("ROT=") Then
|
||||||
Dim nVal As Integer? = GetVal(line, "ROT")
|
Dim nVal As Integer? = GetVal(line, "ROT")
|
||||||
Dim nRot As Integer = (If(Not IsNothing(nVal), nVal.Value, 0))
|
Dim nRot As Integer = (If(nVal IsNot Nothing, nVal.Value, 0))
|
||||||
dRot = Math.Abs(((4 - nRot) Mod 4) * 90)
|
dRot = Math.Abs(((4 - nRot) Mod 4) * 90)
|
||||||
dPartRot = Math.Max(dPartRot, dRot)
|
dPartRot = Math.Max(dPartRot, dRot)
|
||||||
dTotRot = Math.Max(dTotRot, dRot)
|
dTotRot = Math.Max(dTotRot, dRot)
|
||||||
ElseIf line.StartsWith("CUTID=") Then
|
ElseIf line.StartsWith("CUTID=") Then
|
||||||
Dim nVal As Integer? = GetVal(line, "CUTID")
|
Dim nVal As Integer? = GetVal(line, "CUTID")
|
||||||
cutId = If(Not IsNothing(nVal), nVal.Value, 0)
|
cutId = If(nVal IsNot Nothing, nVal.Value, 0)
|
||||||
ElseIf line.StartsWith("TASKID=") Then
|
ElseIf line.StartsWith("TASKID=") Then
|
||||||
Dim nVal As Integer? = GetVal(line, "TASKID")
|
Dim nVal As Integer? = GetVal(line, "TASKID")
|
||||||
taskId = (If(Not IsNothing(nVal), nVal.Value, 0))
|
taskId = (If(nVal IsNot Nothing, nVal.Value, 0))
|
||||||
ProcessResultAdd(ProcessResultList, ProcessResult.CreateTaskResult(cutId, taskId, nErr, sMsg, dRot), Bar)
|
ProcessResultAdd(ProcessResultList, ProcessResult.CreateTaskResult(cutId, taskId, nErr, sMsg, dRot), Bar)
|
||||||
ElseIf line.StartsWith("FALL=") Then
|
ElseIf line.StartsWith("FALL=") Then
|
||||||
Dim nVal As Integer? = GetVal(line, "FALL")
|
Dim nVal As Integer? = GetVal(line, "FALL")
|
||||||
nFall = (If(Not IsNothing(nVal), nVal.Value, 0))
|
nFall = (If(nVal IsNot Nothing, nVal.Value, 0))
|
||||||
ProcessResultList.Add(ProcessResult.CreateFallResult(cutId, nErr, sMsg, nFall))
|
ProcessResultList.Add(ProcessResult.CreateFallResult(cutId, nErr, sMsg, nFall))
|
||||||
ElseIf line.StartsWith("TIME=") Then
|
ElseIf line.StartsWith("TIME=") Then
|
||||||
Dim nVal As Integer? = GetVal(line, "TIME")
|
Dim nVal As Integer? = GetVal(line, "TIME")
|
||||||
nTotTime = (If(Not IsNothing(nVal), nVal.Value, 0))
|
nTotTime = (If(nVal IsNot Nothing, nVal.Value, 0))
|
||||||
ProcessResultList.Add(ProcessResult.CreateTimeResult(cutId, nTotTime))
|
ProcessResultList.Add(ProcessResult.CreateTimeResult(cutId, nTotTime))
|
||||||
'If Bar.nBarType = ProjectType.PROJ AndAlso Not IsNothing(currBTLPart) Then
|
'If Bar.nBarType = ProjectType.PROJ AndAlso Not IsNothing(currBTLPart) Then
|
||||||
' EgtSetInfo(currBTLPart.nPartId, If(Bar.nBarType = ProjectType.PROJ, ITG_PROJ_TIME, ITG_PROD_TIME), nTotTime, True)
|
' EgtSetInfo(currBTLPart.nPartId, If(Bar.nBarType = ProjectType.PROJ, ITG_PROJ_TIME, ITG_PROD_TIME), nTotTime, True)
|
||||||
@@ -193,9 +167,9 @@ Public Class CALCPanelVM
|
|||||||
Machgroup.CalcMachGroupUpdate(0, 0, "")
|
Machgroup.CalcMachGroupUpdate(0, 0, "")
|
||||||
' Ciclo ...
|
' Ciclo ...
|
||||||
Dim nCUTID As Integer = -1
|
Dim nCUTID As Integer = -1
|
||||||
Dim CurrPartVM As PartVM = Nothing
|
Dim CurrPartVM As PartVM
|
||||||
Dim CurrMachgroupVM As MyMachGroupVM = Nothing
|
Dim CurrMachgroupVM As MyMachGroupVM
|
||||||
Dim CurrBTLFeatureVM As BTLFeatureVM = Nothing
|
Dim CurrBTLFeatureVM As BTLFeatureVM
|
||||||
For Each Line In ProcessResultList
|
For Each Line In ProcessResultList
|
||||||
' se necessario recupero part
|
' se necessario recupero part
|
||||||
If Line.nCUTID <> 0 Then
|
If Line.nCUTID <> 0 Then
|
||||||
@@ -217,39 +191,32 @@ Public Class CALCPanelVM
|
|||||||
End If
|
End If
|
||||||
Select Case Line.Type
|
Select Case Line.Type
|
||||||
Case ProcessResult.ProcessResultTypes.BAR
|
Case ProcessResult.ProcessResultTypes.BAR
|
||||||
If Not IsNothing(CurrMachgroupVM) Then CurrMachgroupVM.CalcMachGroupUpdate(Line.nERR, Line.dROT, Line.sMSG)
|
CurrMachgroupVM.CalcMachGroupUpdate(Line.nERR, Line.dROT, Line.sMSG)
|
||||||
Case ProcessResult.ProcessResultTypes.PART
|
Case ProcessResult.ProcessResultTypes.PART
|
||||||
If Not IsNothing(CurrPartVM) Then CurrPartVM.CalcPartUpdate(Line.nERR, Line.dROT, Line.sMSG)
|
CurrPartVM.CalcPartUpdate(Line.nERR, Line.dROT, Line.sMSG)
|
||||||
Case ProcessResult.ProcessResultTypes.TASKID
|
Case ProcessResult.ProcessResultTypes.TASKID
|
||||||
If Not IsNothing(CurrBTLFeatureVM) Then CurrBTLFeatureVM.CalcFeatureUpdate(Line.nERR, Line.dROT, Line.sMSG)
|
CurrBTLFeatureVM.CalcFeatureUpdate(Line.nERR, Line.dROT, Line.sMSG)
|
||||||
Case ProcessResult.ProcessResultTypes.FALL
|
Case ProcessResult.ProcessResultTypes.FALL
|
||||||
If Not IsNothing(CurrPartVM) Then CurrPartVM.CalcFallUpdate(Line.nFALL)
|
CurrPartVM.CalcFallUpdate(Line.nFALL)
|
||||||
Case ProcessResult.ProcessResultTypes.TIME
|
Case ProcessResult.ProcessResultTypes.TIME
|
||||||
If IsNothing(CurrMachgroupVM) Then CurrMachgroupVM = GetMachgroupVMFromMachgroupId(Bar.nBarId)
|
If IsNothing(CurrMachgroupVM) Then CurrMachgroupVM = GetMachgroupVMFromMachgroupId(Bar.nBarId)
|
||||||
If Not IsNothing(CurrMachgroupVM) Then CurrMachgroupVM.CalcTimeUpdate(Line.nTIME)
|
CurrMachgroupVM.CalcTimeUpdate(Line.nTIME)
|
||||||
End Select
|
End Select
|
||||||
Next
|
Next
|
||||||
Machgroup = GetMachgroupVMFromMachgroupId(Bar.nBarId)
|
Machgroup = GetMachgroupVMFromMachgroupId(Bar.nBarId)
|
||||||
If Not IsNothing(Machgroup) Then
|
For Each Part In Machgroup.PartVMList
|
||||||
For Each Part In Machgroup.PartVMList
|
Part.CalcGlobalUpdate()
|
||||||
Part.CalcGlobalUpdate()
|
Next
|
||||||
Next
|
Machgroup.CalcGlobalUpdate()
|
||||||
Machgroup.CalcGlobalUpdate()
|
|
||||||
End If
|
|
||||||
|
|
||||||
End If
|
End If
|
||||||
|
|
||||||
' mando notifica aggiornamento ad ottimizzatore
|
|
||||||
DbControllers.m_StatusMapController.UpdateAction(DbControllers.m_SupervisorId, Map.refSupervisorManagerVM.CurrProd.nProdId, Bar.nBarId, StatusMapItemType.MachGroup, StatusMapOpType.MachGroupValidationUpdate, "")
|
|
||||||
|
|
||||||
Else
|
Else
|
||||||
bErrors = True
|
bErrors = True
|
||||||
nLastErr = 25
|
nLastErr = 25
|
||||||
sLastMsg = "Execution Error"
|
sLastMsg = "Execution Error"
|
||||||
End If
|
End If
|
||||||
|
|
||||||
' ripristino precedente impostazione modificato
|
|
||||||
DisableMgr.ReEnable()
|
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Shared Function GetVal(sText As String, sKey As String) As Integer?
|
Private Shared Function GetVal(sText As String, sKey As String) As Integer?
|
||||||
@@ -265,7 +232,7 @@ Public Class CALCPanelVM
|
|||||||
End Function
|
End Function
|
||||||
|
|
||||||
Private Shared Sub ProcessResultAdd(PRList As List(Of ProcessResult), NewPR As ProcessResult, Bar As Bar)
|
Private Shared Sub ProcessResultAdd(PRList As List(Of ProcessResult), NewPR As ProcessResult, Bar As Bar)
|
||||||
Dim Prev As ProcessResult = Nothing
|
Dim Prev As ProcessResult
|
||||||
Select Case NewPR.Type
|
Select Case NewPR.Type
|
||||||
Case ProcessResult.ProcessResultTypes.BAR
|
Case ProcessResult.ProcessResultTypes.BAR
|
||||||
If Bar.nProgramPage = ProjectType.PROJ Then
|
If Bar.nProgramPage = ProjectType.PROJ Then
|
||||||
@@ -297,7 +264,6 @@ Public Class CALCPanelVM
|
|||||||
Dim PartVM As PartVM = MachGroupVM.PartVMList.FirstOrDefault(Function(x) x.nPartId = nPartId)
|
Dim PartVM As PartVM = MachGroupVM.PartVMList.FirstOrDefault(Function(x) x.nPartId = nPartId)
|
||||||
If Not IsNothing(PartVM) Then Return PartVM
|
If Not IsNothing(PartVM) Then Return PartVM
|
||||||
Next
|
Next
|
||||||
Return Nothing
|
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
Private Shared Function GetMachgroupVMFromMachgroupId(nMachGroupId As Integer) As MyMachGroupVM
|
Private Shared Function GetMachgroupVMFromMachgroupId(nMachGroupId As Integer) As MyMachGroupVM
|
||||||
@@ -380,8 +346,7 @@ Public Class CALCPanelVM
|
|||||||
.nProgramPage = ProjectType.PROD,
|
.nProgramPage = ProjectType.PROD,
|
||||||
.nProjType = ProjType,
|
.nProjType = ProjType,
|
||||||
.bBarOk = True,
|
.bBarOk = True,
|
||||||
.nMachineName = MachineName,
|
.nMachineName = MachineName}
|
||||||
.nGlobState = MachGroup.nGlobalState}
|
|
||||||
Select Case MachGroup.nGlobalState
|
Select Case MachGroup.nGlobalState
|
||||||
Case Core.CalcStates.OK, Core.CalcStates.INFO
|
Case Core.CalcStates.OK, Core.CalcStates.INFO
|
||||||
Bar.nCmdType = CalcIntegration.CmdTypes.GENERATE
|
Bar.nCmdType = CalcIntegration.CmdTypes.GENERATE
|
||||||
@@ -397,7 +362,7 @@ Public Class CALCPanelVM
|
|||||||
' disabilito interfaccia
|
' disabilito interfaccia
|
||||||
Map.refProjectVM.ManageIsEnabled(False)
|
Map.refProjectVM.ManageIsEnabled(False)
|
||||||
' lancio calcolo
|
' lancio calcolo
|
||||||
EgtBEAMWALL.Core.CalcIntegration.Run(BarList, Map.refSupervisorManagerVM.CurrProd.sProdDirPath, AddressOf ManageCalc, True)
|
EgtBEAMWALL.Core.CalcIntegration.Run(BarList, Map.refSupervisorManagerVM.CurrProd.sProdDirPath, AddressOf ManageCalc)
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
' funzione che gestisce risposta da thread di verifica, aggiorna progress e segnala comando di interruzione
|
' funzione che gestisce risposta da thread di verifica, aggiorna progress e segnala comando di interruzione
|
||||||
@@ -504,7 +469,7 @@ Public Class CALCPanelVM
|
|||||||
.bBarOk = True,
|
.bBarOk = True,
|
||||||
.nMachineName = MachineName,
|
.nMachineName = MachineName,
|
||||||
.nCmdType = CalcIntegration.CmdTypes.SIMULATE}
|
.nCmdType = CalcIntegration.CmdTypes.SIMULATE}
|
||||||
If SelMachGroup.nGlobalState = CalcStates.NOTCALCULATED Then
|
If SelMachGroup.nGlobalState <> Core.CalcStates.OK Then
|
||||||
Dim sMachGroupFilePath As String = Map.refSupervisorManagerVM.CurrProd.sProdDirPath & "\" & SelMachGroup.Name.ToString() & ".ori.bwe"
|
Dim sMachGroupFilePath As String = Map.refSupervisorManagerVM.CurrProd.sProdDirPath & "\" & SelMachGroup.Name.ToString() & ".ori.bwe"
|
||||||
If File.Exists(sMachGroupFilePath) Then File.Delete(sMachGroupFilePath)
|
If File.Exists(sMachGroupFilePath) Then File.Delete(sMachGroupFilePath)
|
||||||
End If
|
End If
|
||||||
|
|||||||
@@ -29,10 +29,5 @@
|
|||||||
IsEnabled="{Binding CALCPanel_IsEnabled}">
|
IsEnabled="{Binding CALCPanel_IsEnabled}">
|
||||||
<Image Source="/Resources/CALCPanel/Simulate.png" Stretch="Uniform"/>
|
<Image Source="/Resources/CALCPanel/Simulate.png" Stretch="Uniform"/>
|
||||||
</Button>
|
</Button>
|
||||||
<ToggleButton ToolTip="{Binding MachineLog_ToolTip}"
|
|
||||||
Content="Log"
|
|
||||||
IsChecked="{Binding bMachineLog}"
|
|
||||||
Style="{StaticResource ToolBar_ToggleButton}">
|
|
||||||
</ToggleButton>
|
|
||||||
|
|
||||||
</EgtFloating:EgtFloatingPanel>
|
</EgtFloating:EgtFloatingPanel>
|
||||||
|
|||||||
@@ -1,846 +0,0 @@
|
|||||||
Imports EgtBEAMWALL.Core
|
|
||||||
Imports EgtBEAMWALL.Core.ConstMachComm
|
|
||||||
Imports EgtUILib
|
|
||||||
Imports EgtWPFLib5
|
|
||||||
|
|
||||||
Public Class NUMAxiumComm
|
|
||||||
|
|
||||||
Enum CNMode As Integer
|
|
||||||
AUTO = 0
|
|
||||||
SINGLE_ = 1
|
|
||||||
MDI = 2
|
|
||||||
MANUAL = 7
|
|
||||||
End Enum
|
|
||||||
|
|
||||||
Private m_MachManaging As MachManaging
|
|
||||||
Friend ReadOnly Property MachManaging As MachManaging
|
|
||||||
Get
|
|
||||||
Return m_MachManaging
|
|
||||||
End Get
|
|
||||||
End Property
|
|
||||||
|
|
||||||
Public ReadOnly Property bIsTransferActive As Boolean
|
|
||||||
Get
|
|
||||||
Return If(Not IsNothing(objDFileTransfer), objDFileTransfer.IsTransferActive(), False)
|
|
||||||
End Get
|
|
||||||
End Property
|
|
||||||
|
|
||||||
'Private objDRunTimeSystem As FXServer.DRunTimeSystem
|
|
||||||
Private WithEvents objDGroupManager As APServer.DGroupManager
|
|
||||||
Private WithEvents objDGeneralFunction As APServer.DGeneralFunctions
|
|
||||||
Private WithEvents objDMainCncData As APServer.DMainCncData
|
|
||||||
Private WithEvents objErrorHandler As APLog.ErrorHandler
|
|
||||||
Private WithEvents objDReadELS As APServer.DReadELS
|
|
||||||
Private WithEvents objDReadPlcVarList As APServer.DReadPlcVarList
|
|
||||||
Private WithEvents objDFileTransfer As APServer.DFileTransfer
|
|
||||||
Private WithEvents objDPosition As APServer.DPosition
|
|
||||||
Private WithEvents objDMdiCommand As APServer.DMdiCommand
|
|
||||||
Private WithEvents objDVariables As APServer.DVariables
|
|
||||||
Private WithEvents objDCncMode As APServer.DCncMode
|
|
||||||
Private WithEvents objDReadOperatorMessage As APServer.DReadOperatorMessage
|
|
||||||
|
|
||||||
Private m_CNCVersion As String = ""
|
|
||||||
Private _PartProgramNumber As Single
|
|
||||||
Private _CNCAxisChannelArray As String() = New String() {"Channel 1", "Channel 2"}
|
|
||||||
Private m_ChannelList As New List(Of String)
|
|
||||||
' Arraylist for read out the messages
|
|
||||||
Private m_ReadFXMessages As New List(Of ReadMessages)
|
|
||||||
Private m_ReadOperatorMessages As New List(Of ReadMessages)
|
|
||||||
' lista variabili in lettura
|
|
||||||
Private Shared m_ReadingVars(100) As CommVar
|
|
||||||
Private m_BytesTransferedCounter As Integer
|
|
||||||
Private m_LinearAxisPrecision As Integer
|
|
||||||
|
|
||||||
Public Sub New(MachManaging As MachManaging)
|
|
||||||
m_MachManaging = MachManaging
|
|
||||||
End Sub
|
|
||||||
|
|
||||||
#Region "METHODS"
|
|
||||||
|
|
||||||
Friend Sub InitFxServer()
|
|
||||||
End Sub
|
|
||||||
|
|
||||||
Friend Sub InitFxObjects()
|
|
||||||
objDGroupManager = CreateObject("APServer.DGroupManager")
|
|
||||||
AddHandler objDGroupManager.ErrorHandler, AddressOf objDGroupManager_ErrorHandler
|
|
||||||
AddHandler objDGroupManager.AssignmentChanged, AddressOf objDGroupManager_AssignmentChanged
|
|
||||||
objDGroupManager.CncNumber = 0
|
|
||||||
objDGroupManager.AxisGroup = 0
|
|
||||||
|
|
||||||
objDMainCncData = CreateObject("APServer.DMainCncData")
|
|
||||||
Dim s = objDMainCncData.Init(objDGroupManager.Handle)
|
|
||||||
m_LinearAxisPrecision = objDMainCncData.GetLinearPrecision()
|
|
||||||
Dim CncFxIdentifier As String = objDMainCncData.GetCncIdentifier()
|
|
||||||
EgtOutLog("CncFxIdentifier: " & CncFxIdentifier)
|
|
||||||
|
|
||||||
m_CNCVersion = objDMainCncData.GetCncVersion()
|
|
||||||
|
|
||||||
' Initialize for Channel Change
|
|
||||||
Dim CncGroupNumber As Integer = objDMainCncData.GetCncGroupNumber()
|
|
||||||
Dim PlcGroupNumber As Integer = objDMainCncData.GetPlcGroupNumber()
|
|
||||||
|
|
||||||
Dim sumChannels As Integer = 0
|
|
||||||
sumChannels = PlcGroupNumber + CncGroupNumber
|
|
||||||
For i = 1 To sumChannels
|
|
||||||
m_ChannelList.Add(i)
|
|
||||||
Next
|
|
||||||
|
|
||||||
objDGeneralFunction = CreateObject("APServer.DGeneralFunctions")
|
|
||||||
AddHandler objDGeneralFunction.ProgramActivated, AddressOf objDGeneralFunction_ProgramActivated
|
|
||||||
AddHandler objDGeneralFunction.OnCncStart, AddressOf objDGeneralFunction_OnCncStart
|
|
||||||
AddHandler objDGeneralFunction.OnCncStop, AddressOf objDGeneralFunction_OnCncStop
|
|
||||||
AddHandler objDGeneralFunction.OnCncReset, AddressOf objDGeneralFunction_OnCncReset
|
|
||||||
AddHandler objDGeneralFunction.CncModeWritten, AddressOf objDGeneralFunction_CncModeWritten
|
|
||||||
AddHandler objDGeneralFunction.VariableWritten, AddressOf objDGeneralFunction_VariableWritten
|
|
||||||
Dim l = objDGeneralFunction.Init(objDGroupManager.Handle)
|
|
||||||
Dim MaxWaiting As Integer = 100
|
|
||||||
Dim WaitingIndex As Integer = 0
|
|
||||||
While objDGeneralFunction.ConnectionStatus <> 2 AndAlso WaitingIndex < MaxWaiting
|
|
||||||
Threading.Thread.Sleep(100)
|
|
||||||
UpdateUI()
|
|
||||||
WaitingIndex += 1
|
|
||||||
End While
|
|
||||||
Dim j = objDGeneralFunction.ConnectionStatus
|
|
||||||
Dim oi = objDGeneralFunction.ConnectionString
|
|
||||||
' Initialize FXLog Objects
|
|
||||||
objErrorHandler = CreateObject("APLog.ErrorHandler")
|
|
||||||
'AddHandler objErrorHandler.ErrorFromActiveCnc, AddressOf objErrorHandler_ErrorFromActiveCnc2
|
|
||||||
AddHandler objErrorHandler.ErrorOnCnc, AddressOf objErrorHandler_ErrorOnCnc
|
|
||||||
AddHandler objErrorHandler.ErrorOnOtherChannel, AddressOf objErrorHandler_ErrorOnOtherChannel
|
|
||||||
AddHandler objErrorHandler.Exception, AddressOf objErrorHandler_Exception
|
|
||||||
'Initialisation config for testing
|
|
||||||
'Accepting all messages
|
|
||||||
'Consult the documentation for detailed information
|
|
||||||
|
|
||||||
objErrorHandler.AllError = 1
|
|
||||||
objErrorHandler.ErrorGlobal = 0
|
|
||||||
objErrorHandler.SetChannel(0, 0)
|
|
||||||
objErrorHandler.AcceptBootSysMessage(1)
|
|
||||||
objErrorHandler.AcceptException(0)
|
|
||||||
|
|
||||||
'Initialize FXServer class DFileTransferv
|
|
||||||
objDFileTransfer = CreateObject("APServer.DFileTransfer")
|
|
||||||
AddHandler objDFileTransfer.Completed, AddressOf objDFileTransfer_Completed
|
|
||||||
AddHandler objDFileTransfer.TransferStarted, AddressOf objDFileTransfer_TransferStarted
|
|
||||||
AddHandler objDFileTransfer.Failed, AddressOf objDFileTransfer_Failed
|
|
||||||
AddHandler objDFileTransfer.BytesTransfered, AddressOf objDFileTransfer_BytesTransfered
|
|
||||||
objDFileTransfer.Init(objDGroupManager.Handle)
|
|
||||||
|
|
||||||
objDPosition = CreateObject("APServer.DPosition")
|
|
||||||
AddHandler objDPosition.PositionChanged, AddressOf objDPosition_PositionChanged
|
|
||||||
objDPosition.ModeOP = 1
|
|
||||||
objDPosition.Flag = 0
|
|
||||||
objDPosition.Init(objDGroupManager.Handle)
|
|
||||||
objDPosition.FireValidAxis()
|
|
||||||
objDPosition.FireValues()
|
|
||||||
|
|
||||||
'Initialize FXServer class DMdiCommand
|
|
||||||
objDMdiCommand = CreateObject("APServer.DMdiCommand")
|
|
||||||
AddHandler objDMdiCommand.CommandWritten, AddressOf objDMdiCommand_CommandWritten
|
|
||||||
objDMdiCommand.Init(objDGroupManager.Handle)
|
|
||||||
|
|
||||||
' Initialize FXServer class DCncMode
|
|
||||||
objDCncMode = CreateObject("APServer.DCncMode")
|
|
||||||
AddHandler objDCncMode.ValueChanged, AddressOf objDCncMode_ValueChanged
|
|
||||||
objDCncMode.Init(objDGroupManager.Handle)
|
|
||||||
|
|
||||||
' Initialize FXServer class DReadOperatorMessage
|
|
||||||
objDReadOperatorMessage = CreateObject("APServer.DReadOperatorMessage")
|
|
||||||
AddHandler objDReadOperatorMessage.ValueChanged, AddressOf objDReadOperatorMessage_ValueChanged
|
|
||||||
Dim tc = objDReadOperatorMessage.Init(objDGroupManager.Handle)
|
|
||||||
If tc <> 0 Then EgtOutLog("Init failed ! return code : " + tc)
|
|
||||||
|
|
||||||
' Initialize FXServer class DReadELS
|
|
||||||
'objDReadELS = CreateObject("APServer.DReadELS")
|
|
||||||
'AddHandler objDReadELS.ValueChanged, AddressOf objDReadELS_ValueChanged
|
|
||||||
'Dim y = objDReadELS.Init(objDGroupManager.Handle)
|
|
||||||
|
|
||||||
objDReadPlcVarList = CreateObject("APServer.DReadPlcVarList")
|
|
||||||
AddHandler objDReadPlcVarList.ValueChanged, AddressOf objDPlcVariables_ReadPLCVariablesChanged
|
|
||||||
' Init & send the list of requested variables
|
|
||||||
'tc = objDReadPlcVarList.Init(objDGroupManager.Handle)
|
|
||||||
'If tc <> 0 Then EgtOutLog(" objDReadPlcVarList.Init() Error : " + tc)
|
|
||||||
|
|
||||||
'Initialize FXServer class DVariables
|
|
||||||
objDVariables = CreateObject("APServer.DVariables")
|
|
||||||
'AddHandler objDVariables.ValueChanged, AddressOf objDVariables_ValueChanged
|
|
||||||
' Init & send the list of requested variables
|
|
||||||
'Dim rc As Short = objDVariables.Init(objDGroupManager.Handle, "E80000", 0)
|
|
||||||
AddHandler objDVariables.VariableWritten, AddressOf objDVariables_VariableWritten
|
|
||||||
AddHandler objDVariables.ValueChanged, AddressOf objDPlcVariables_ReadVariablesChanged
|
|
||||||
'If rc <> 0 Then EgtOutLog(" objDVariables.Init() Error : " + rc)
|
|
||||||
|
|
||||||
' attivo programma main
|
|
||||||
Map.refMachManaging.Num_Axium_APServer.ActivateProg(9000)
|
|
||||||
|
|
||||||
End Sub
|
|
||||||
|
|
||||||
Friend Sub CloseFxObjects()
|
|
||||||
If Not IsNothing(objDReadOperatorMessage) Then
|
|
||||||
objDReadOperatorMessage.Close()
|
|
||||||
System.Runtime.InteropServices.Marshal.ReleaseComObject(objDReadOperatorMessage)
|
|
||||||
objDReadOperatorMessage = Nothing
|
|
||||||
End If
|
|
||||||
If Not IsNothing(objDCncMode) Then
|
|
||||||
System.Runtime.InteropServices.Marshal.ReleaseComObject(objDCncMode)
|
|
||||||
objDCncMode = Nothing
|
|
||||||
End If
|
|
||||||
If Not IsNothing(objDReadPlcVarList) Then
|
|
||||||
objDReadPlcVarList.Close()
|
|
||||||
System.Runtime.InteropServices.Marshal.ReleaseComObject(objDReadPlcVarList)
|
|
||||||
objDReadPlcVarList = Nothing
|
|
||||||
End If
|
|
||||||
If Not IsNothing(objDVariables) Then
|
|
||||||
System.Runtime.InteropServices.Marshal.ReleaseComObject(objDVariables)
|
|
||||||
objDVariables = Nothing
|
|
||||||
End If
|
|
||||||
If Not IsNothing(objDMdiCommand) Then
|
|
||||||
System.Runtime.InteropServices.Marshal.ReleaseComObject(objDMdiCommand)
|
|
||||||
objDMdiCommand = Nothing
|
|
||||||
End If
|
|
||||||
If Not IsNothing(objDPosition) Then
|
|
||||||
System.Runtime.InteropServices.Marshal.ReleaseComObject(objDPosition)
|
|
||||||
objDPosition = Nothing
|
|
||||||
End If
|
|
||||||
If Not IsNothing(objDFileTransfer) Then
|
|
||||||
System.Runtime.InteropServices.Marshal.ReleaseComObject(objDFileTransfer)
|
|
||||||
objDFileTransfer = Nothing
|
|
||||||
End If
|
|
||||||
If Not IsNothing(objDReadELS) Then
|
|
||||||
objDReadELS.Close()
|
|
||||||
System.Runtime.InteropServices.Marshal.ReleaseComObject(objDReadELS)
|
|
||||||
objDReadELS = Nothing
|
|
||||||
End If
|
|
||||||
If Not IsNothing(objErrorHandler) Then
|
|
||||||
System.Runtime.InteropServices.Marshal.ReleaseComObject(objErrorHandler)
|
|
||||||
objErrorHandler = Nothing
|
|
||||||
End If
|
|
||||||
If Not IsNothing(objDGeneralFunction) Then
|
|
||||||
objDGeneralFunction.Connect(0)
|
|
||||||
System.Runtime.InteropServices.Marshal.ReleaseComObject(objDGeneralFunction)
|
|
||||||
objDGeneralFunction = Nothing
|
|
||||||
End If
|
|
||||||
If Not IsNothing(objDMainCncData) Then
|
|
||||||
System.Runtime.InteropServices.Marshal.ReleaseComObject(objDMainCncData)
|
|
||||||
objDMainCncData = Nothing
|
|
||||||
End If
|
|
||||||
If Not IsNothing(objDGroupManager) Then
|
|
||||||
System.Runtime.InteropServices.Marshal.ReleaseComObject(objDGroupManager)
|
|
||||||
objDGroupManager = Nothing
|
|
||||||
End If
|
|
||||||
Dim ServerProcList As Process() = Process.GetProcessesByName("APServer")
|
|
||||||
Dim LogProcList As Process() = Process.GetProcessesByName("APLog")
|
|
||||||
For Each ServerProc In ServerProcList
|
|
||||||
ServerProc.Kill()
|
|
||||||
Next
|
|
||||||
For Each LogProc In LogProcList
|
|
||||||
LogProc.Kill()
|
|
||||||
Next
|
|
||||||
End Sub
|
|
||||||
|
|
||||||
Friend Sub GetGeneralFunctions()
|
|
||||||
Dim _GetConnectState As Int16 = 0
|
|
||||||
Dim MaxWaiting As Integer = 100
|
|
||||||
Dim WaitingIndex As Integer = 0
|
|
||||||
While _GetConnectState <> 2 AndAlso WaitingIndex < MaxWaiting
|
|
||||||
_GetConnectState = objDGeneralFunction.ConnectionStatus
|
|
||||||
Threading.Thread.Sleep(100)
|
|
||||||
UpdateUI()
|
|
||||||
WaitingIndex += 1
|
|
||||||
End While
|
|
||||||
|
|
||||||
Select Case _GetConnectState
|
|
||||||
Case 0
|
|
||||||
' Not connected
|
|
||||||
m_MachManaging.SetConnected(False)
|
|
||||||
m_ResultCallbackDlg(CommandTypes.CONNECT, CommandStates.NULL, ResultTypes.RESULT, "")
|
|
||||||
Case 1
|
|
||||||
' Connection error
|
|
||||||
m_MachManaging.SetConnected(False)
|
|
||||||
m_ResultCallbackDlg(CommandTypes.CONNECT, CommandStates.ERROR_, ResultTypes.RESULT, "")
|
|
||||||
Case 2
|
|
||||||
' Connected
|
|
||||||
m_MachManaging.SetConnected(True)
|
|
||||||
m_ResultCallbackDlg(CommandTypes.CONNECT, CommandStates.OK, ResultTypes.RESULT, "")
|
|
||||||
' avvio lettura variabili
|
|
||||||
'MachManaging.CommandList.Add(ThreadCommand.CreateCommand(CommandTypes.READ_NUMFLEXIUM))
|
|
||||||
StartReadList()
|
|
||||||
StartReadPLCList()
|
|
||||||
'StartReadELS()
|
|
||||||
Case Else
|
|
||||||
End Select
|
|
||||||
End Sub
|
|
||||||
|
|
||||||
Friend Sub Start()
|
|
||||||
objDGeneralFunction.CncStart()
|
|
||||||
End Sub
|
|
||||||
|
|
||||||
Friend Sub Stop_()
|
|
||||||
objDGeneralFunction.CncStop()
|
|
||||||
End Sub
|
|
||||||
|
|
||||||
Friend Sub Reset()
|
|
||||||
objDGeneralFunction.CncReset()
|
|
||||||
End Sub
|
|
||||||
|
|
||||||
Friend Sub SetMode(value As CNMode)
|
|
||||||
objDGeneralFunction.WriteCncMode(value, 0)
|
|
||||||
End Sub
|
|
||||||
|
|
||||||
Friend Sub SetChannel(value As Integer)
|
|
||||||
ChangeChannel(CShort(value))
|
|
||||||
'objDGroupManager.AxisGroup = CShort(value)
|
|
||||||
End Sub
|
|
||||||
|
|
||||||
Friend Sub ActivateProg(PartProgramNumberActivate As Integer)
|
|
||||||
' attivo programma main
|
|
||||||
Dim _FXReturn As Int16 = objDGeneralFunction.ActivateProgram(PartProgramNumberActivate * 10, 0)
|
|
||||||
If _FXReturn <> 0 Then
|
|
||||||
EgtOutLog("Error Activate Program:" & " " & _FXReturn.ToString())
|
|
||||||
End If
|
|
||||||
End Sub
|
|
||||||
|
|
||||||
Private Sub ChangeChannel(Channel As Short)
|
|
||||||
objErrorHandler.SetChannel(1, Channel)
|
|
||||||
End Sub
|
|
||||||
|
|
||||||
Friend Sub StartReadList()
|
|
||||||
'Dim AddressList() As String = (From CommVar In m_ReadingVars
|
|
||||||
' Where Not IsNothing(CommVar) AndAlso CommVar.nType = CommVar.Types.PLC
|
|
||||||
' Select CommVar.sAddress).ToArray()
|
|
||||||
'm_PlcVariablesList = New ArrayList((From CommVar In m_ReadingVars
|
|
||||||
' Where Not IsNothing(CommVar) AndAlso CommVar.nType = CommVar.Types.PLC
|
|
||||||
' Select CommVar.sAddress).ToArray())
|
|
||||||
Dim nPLCVarIndex As Integer = 0
|
|
||||||
Dim PlcVariablesList As New ArrayList
|
|
||||||
Dim sPLCVariableList = ""
|
|
||||||
For VarIndex = 0 To m_ReadingVars.Length - 1
|
|
||||||
Dim CommVar As CommVar = m_ReadingVars(VarIndex)
|
|
||||||
If Not IsNothing(CommVar) AndAlso CommVar.Paragraph = CommVar.Paragraphs.MAIN AndAlso CommVar.nType = CommVar.Types.CN Then
|
|
||||||
PlcVariablesList.Add(CommVar.sAddress)
|
|
||||||
If Not String.IsNullOrWhiteSpace(sPLCVariableList) Then
|
|
||||||
sPLCVariableList &= ","
|
|
||||||
End If
|
|
||||||
sPLCVariableList &= """" & CommVar.sAddress & """"
|
|
||||||
CommVar.Index = nPLCVarIndex
|
|
||||||
nPLCVarIndex += 1
|
|
||||||
End If
|
|
||||||
Next
|
|
||||||
'Dim sPLCVariableList = ""
|
|
||||||
'For VariableIndex = 0 To PlcVariablesList.Count - 1
|
|
||||||
' If VariableIndex <> 0 Then
|
|
||||||
' sPLCVariableList &= ","
|
|
||||||
' End If
|
|
||||||
' sPLCVariableList &= """" & PlcVariablesList(VariableIndex) & """"
|
|
||||||
'Next
|
|
||||||
Dim _FXReturn As Short = objDVariables.Init(objDGroupManager.Handle, sPLCVariableList, 1) 'PlcVariablesList.ToArray().ToString())
|
|
||||||
'Dim _FXReturn As Short = objDVariables.ReadVariables(PlcVariablesList.ToArray())
|
|
||||||
|
|
||||||
'If _FXReturn <> 0 Then
|
|
||||||
' EgtOutLog("Error ReadVariables:" & " " & _FXReturn.ToString())
|
|
||||||
'End If
|
|
||||||
End Sub
|
|
||||||
|
|
||||||
Friend Sub StartReadPLCList()
|
|
||||||
'Dim AddressList() As String = (From CommVar In m_ReadingVars
|
|
||||||
' Where Not IsNothing(CommVar) AndAlso CommVar.nType = CommVar.Types.PLC
|
|
||||||
' Select CommVar.sAddress).ToArray()
|
|
||||||
'm_PlcVariablesList = New ArrayList((From CommVar In m_ReadingVars
|
|
||||||
' Where Not IsNothing(CommVar) AndAlso CommVar.nType = CommVar.Types.PLC
|
|
||||||
' Select CommVar.sAddress).ToArray())
|
|
||||||
Dim nPLCVarIndex As Integer = 0
|
|
||||||
Dim PlcVariablesList As New ArrayList
|
|
||||||
Dim sPLCVariableList = ""
|
|
||||||
For VarIndex = 0 To m_ReadingVars.Length - 1
|
|
||||||
Dim CommVar As CommVar = m_ReadingVars(VarIndex)
|
|
||||||
If Not IsNothing(CommVar) AndAlso CommVar.nType = CommVar.Types.PLC AndAlso
|
|
||||||
CommVar.Paragraph = CommVar.Paragraphs.MAIN Then
|
|
||||||
PlcVariablesList.Add(CommVar.sAddress)
|
|
||||||
If Not String.IsNullOrWhiteSpace(sPLCVariableList) Then
|
|
||||||
sPLCVariableList &= ","
|
|
||||||
End If
|
|
||||||
sPLCVariableList &= CommVar.sAddress
|
|
||||||
CommVar.Index = nPLCVarIndex
|
|
||||||
nPLCVarIndex += 1
|
|
||||||
End If
|
|
||||||
Next
|
|
||||||
objDReadPlcVarList.Argument = sPLCVariableList ' "%M5.L,%M5.B"
|
|
||||||
Dim h = objDReadPlcVarList.Init(objDGroupManager.Handle)
|
|
||||||
'Dim _FXReturn As Short = objDVariables.ReadVariables(PlcVariablesList.ToArray())
|
|
||||||
|
|
||||||
'If _FXReturn <> 0 Then
|
|
||||||
' EgtOutLog("Error ReadVariables:" & " " & _FXReturn.ToString())
|
|
||||||
'End If
|
|
||||||
End Sub
|
|
||||||
|
|
||||||
Friend Sub CloseReadList()
|
|
||||||
'objDPlcVariables.CloseReadList()
|
|
||||||
End Sub
|
|
||||||
|
|
||||||
Private Sub ReadVariablesOnce(Address As String)
|
|
||||||
'Dim _ReadSymbolicPlcVariableOnetime As String = "Application.IOCONFIG_GLOBALS.Flexium_NCK.RCNC.General.Mode"
|
|
||||||
'Dim _FXReturn As Int16 = objDPlcVariables.ReadVariablesOnce(10, Address)
|
|
||||||
|
|
||||||
'If _FXReturn <> 0 Then
|
|
||||||
' EgtOutLog("Error ReadVariablesOnce:" & " " & _FXReturn.ToString())
|
|
||||||
'End If
|
|
||||||
|
|
||||||
End Sub
|
|
||||||
|
|
||||||
Friend Sub WritePlcVariables(Address As String, value As String)
|
|
||||||
'Dim _WriteSymbolicPlcVariable As String = _txtReadWritePlcVariables0.Text
|
|
||||||
'Dim _FXReturn As Int16 = objDPlcVariables.WriteVariables2(11, Address, value)
|
|
||||||
'
|
|
||||||
'If _FXReturn <> 0 Then
|
|
||||||
' EgtOutLog("Error WriteVariables2 :" & " " & _FXReturn.ToString())
|
|
||||||
'End If
|
|
||||||
|
|
||||||
End Sub
|
|
||||||
|
|
||||||
Public Shared Function InitVar(Variable As CommVar) As CommVar
|
|
||||||
Dim Index As Integer = Array.IndexOf(m_ReadingVars, Nothing)
|
|
||||||
m_ReadingVars(Index) = Variable
|
|
||||||
Return m_ReadingVars(Index)
|
|
||||||
End Function
|
|
||||||
|
|
||||||
Friend Sub StartReadELS()
|
|
||||||
For Index = 0 To m_ReadingVars.Length - 1
|
|
||||||
If IsNothing(m_ReadingVars(Index)) Then Continue For 'OrElse m_ReadingVars(Index).nType <> CommVar.Types.CN Then Continue For
|
|
||||||
Dim rc As Short = objDReadELS.AddParameter(m_ReadingVars(Index).sAddress, Index + 1)
|
|
||||||
If rc <> 0 Then EgtOutLog(" Error AddParameter2 : " & rc & " on Variable : " & m_ReadingVars(Index).sAddress)
|
|
||||||
Next
|
|
||||||
End Sub
|
|
||||||
|
|
||||||
Friend Sub CloseReadELS()
|
|
||||||
'objDPlcVariables.CloseReadList()
|
|
||||||
End Sub
|
|
||||||
|
|
||||||
#Region "File transfer"
|
|
||||||
|
|
||||||
Friend Sub FileDownload(sFileType As String, sFilePath As String)
|
|
||||||
Dim _Return_Download As Short
|
|
||||||
|
|
||||||
_Return_Download = objDFileTransfer.FileDownload(10, sFileType, sFilePath, "", 1)
|
|
||||||
|
|
||||||
If _Return_Download <> 0 Then
|
|
||||||
EgtOutLog("Error: File not stored to the job list:" & " " & _Return_Download.ToString())
|
|
||||||
End If
|
|
||||||
End Sub
|
|
||||||
|
|
||||||
Private Sub FileUpload(sFileType As String, sFilePath As String)
|
|
||||||
Dim _Return_Upload As Short
|
|
||||||
_Return_Upload = objDFileTransfer.FileUpload(20, sFileType, sFilePath, "")
|
|
||||||
|
|
||||||
If _Return_Upload <> 0 Then
|
|
||||||
EgtOutLog("Error: File not stored to the job list:" & " " & _Return_Upload.ToString())
|
|
||||||
End If
|
|
||||||
End Sub
|
|
||||||
|
|
||||||
Friend Sub FileDelete(sFileType As String, sFilePath As String)
|
|
||||||
Dim _ReturnFileDelete As Short
|
|
||||||
_ReturnFileDelete = objDFileTransfer.FileDelete(20, sFileType, "")
|
|
||||||
|
|
||||||
If _ReturnFileDelete <> 0 Then
|
|
||||||
EgtOutLog("Error: File not deleted:" & " " & _ReturnFileDelete.ToString())
|
|
||||||
End If
|
|
||||||
End Sub
|
|
||||||
|
|
||||||
Friend Sub StartTransfer()
|
|
||||||
Dim _Return_StartTransfer As Short
|
|
||||||
_Return_StartTransfer = objDFileTransfer.StartTransfer()
|
|
||||||
|
|
||||||
If _Return_StartTransfer <> 0 Then
|
|
||||||
EgtOutLog("Error: Start transfer not executed:" & " " & _Return_StartTransfer.ToString())
|
|
||||||
Else
|
|
||||||
m_BytesTransferedCounter = 0
|
|
||||||
End If
|
|
||||||
End Sub
|
|
||||||
|
|
||||||
#End Region ' File transfer
|
|
||||||
|
|
||||||
#Region "MDI"
|
|
||||||
|
|
||||||
Friend Sub MDI_Execute(sCommand As String)
|
|
||||||
Dim nRet As Int16 = objDMdiCommand.ExecuteCommand(sCommand)
|
|
||||||
If nRet <> 0 Then
|
|
||||||
EgtOutLog("Error ExecuteCommand :" & " " & nRet.ToString())
|
|
||||||
End If
|
|
||||||
End Sub
|
|
||||||
|
|
||||||
#End Region ' MDI
|
|
||||||
|
|
||||||
#Region "Variables"
|
|
||||||
|
|
||||||
Friend Sub WriteNCVariables(Address As String, value As String)
|
|
||||||
Try
|
|
||||||
Dim dValue As Double = 0
|
|
||||||
StringToDoubleAdv(value, dValue)
|
|
||||||
Dim rc As Short = objDVariables.WriteVariables(objDGroupManager.Handle, Address, value)
|
|
||||||
|
|
||||||
'If rc <> 0 Then EgtOutLog(" objDVariables.WriteVariables2() Error : " & rc)
|
|
||||||
|
|
||||||
Catch ex As Exception
|
|
||||||
EgtOutLog(" objDVariables.WriteVariables2() Exception : " & ex.Message)
|
|
||||||
End Try
|
|
||||||
End Sub
|
|
||||||
|
|
||||||
#End Region ' Variables
|
|
||||||
|
|
||||||
#End Region ' METHODS
|
|
||||||
|
|
||||||
#Region "EVENTS"
|
|
||||||
|
|
||||||
Private Sub objDRunTimeSystem_ServerInitializationFinished()
|
|
||||||
InitFxObjects()
|
|
||||||
GetGeneralFunctions()
|
|
||||||
End Sub
|
|
||||||
|
|
||||||
Private Sub objDRunTimeSystem_ServerReinitializationStarted()
|
|
||||||
CloseFxObjects()
|
|
||||||
End Sub
|
|
||||||
|
|
||||||
Private Sub objDGeneralFunction_ProgramActivated(ByVal nerrorCode As Short)
|
|
||||||
EgtOutLog("Part program activated:" & " " & nerrorCode)
|
|
||||||
'DbControllers.m_LogMachineController.Create(MachLog.CreateResultLog(CommandTypes.SENDPROG, CommandStates.OK, ResultTypes.EXECUTED, "Part program activated:" & " " & nerrorCode))
|
|
||||||
' scrivo evento programma attivato
|
|
||||||
DbControllers.m_LogMachineController.Create(LogEvent.CreateMachCommandLog(LogEvent.MachineCommands.PROGRAM_ACTIVATION, "", nerrorCode, DbControllers.SupervisorId))
|
|
||||||
End Sub
|
|
||||||
|
|
||||||
Private Sub objDGeneralFunction_OnCncStart(ByVal errorCode As Short)
|
|
||||||
Dim bOk As Boolean = (errorCode = 0)
|
|
||||||
m_MachManaging.SetStartPending(bOk)
|
|
||||||
m_ResultCallbackDlg(CommandTypes.START, If(bOk, CommandStates.OK, CommandStates.ERROR_), ResultTypes.EXECUTED, If(bOk, "", "Error CNC Start: " & errorCode.ToString()))
|
|
||||||
End Sub
|
|
||||||
|
|
||||||
Private Sub objDGeneralFunction_OnCncStop(ByVal errorCode As Short)
|
|
||||||
Dim bOk As Boolean = (errorCode = 0)
|
|
||||||
m_ResultCallbackDlg(CommandTypes.STOP_, If(bOk, CommandStates.OK, CommandStates.ERROR_), ResultTypes.EXECUTED, If(bOk, "", "Error Feed Hold: " & errorCode.ToString()))
|
|
||||||
End Sub
|
|
||||||
|
|
||||||
Private Sub objDGeneralFunction_OnCncReset(ByVal errorCode As Short)
|
|
||||||
Dim bOk As Boolean = (errorCode = 0)
|
|
||||||
m_ResultCallbackDlg(CommandTypes.RESET, If(bOk, CommandStates.OK, CommandStates.ERROR_), ResultTypes.EXECUTED, If(bOk, "", "Error CNC Reset: " & errorCode.ToString()))
|
|
||||||
End Sub
|
|
||||||
|
|
||||||
Private Sub objDGeneralFunction_CncModeWritten(ByVal errorCode As Short)
|
|
||||||
If errorCode <> 0 Then EgtOutLog("Error CNC Mode selection completed:" & " " & errorCode.ToString())
|
|
||||||
End Sub
|
|
||||||
|
|
||||||
Private Sub objDGroupManager_ErrorHandler(ByVal sError As String, ByVal nTextNumber As Short)
|
|
||||||
EgtOutLog("ErrorHandler message:" & " " & sError & " " & "ErrorHandler number:" & " " & nTextNumber.ToString())
|
|
||||||
End Sub
|
|
||||||
|
|
||||||
Private Sub objDGroupManager_AssignmentChanged(ByVal CncNumber As Short, ByVal AxisGroup As Short)
|
|
||||||
m_ChannelCallbackDlg(AxisGroup)
|
|
||||||
End Sub
|
|
||||||
|
|
||||||
Private Sub _comboCncAxisChannel_SelectedIndexChanged(ByVal sender As Object, ByVal e As EventArgs)
|
|
||||||
'Select Case _comboCncAxisChannel.SelectedItem.ToString()
|
|
||||||
' Case "Channel 1"
|
|
||||||
' objDGroupManager.AxisGroup = 0
|
|
||||||
' Case "Channel 2"
|
|
||||||
' objDGroupManager.AxisGroup = 1
|
|
||||||
' Case Else
|
|
||||||
'End Select
|
|
||||||
End Sub
|
|
||||||
|
|
||||||
Private Sub objDGeneralFunction_VariableWritten(ByVal errorCode As Short)
|
|
||||||
If errorCode <> 0 Then
|
|
||||||
MessageBox.Show("Error from VariableWritten:" & " " & errorCode.ToString())
|
|
||||||
Else
|
|
||||||
MessageBox.Show("VariableWritten successfully")
|
|
||||||
End If
|
|
||||||
End Sub
|
|
||||||
|
|
||||||
Private Sub objErrorHandler_ErrorOnCnc(ByVal cnc As Short, ByVal channel As Short, ByVal [set] As Short)
|
|
||||||
'AplCncNumber.Add(cnc)
|
|
||||||
'AplChannel.Add(channel)
|
|
||||||
'AplSet.Add([set])
|
|
||||||
End Sub
|
|
||||||
|
|
||||||
Private Sub objErrorHandler_ErrorOnOtherChannel(ByVal status As Short)
|
|
||||||
'AplStatus = status
|
|
||||||
End Sub
|
|
||||||
|
|
||||||
Private Sub objErrorHandler_Exception(ByVal status As Short)
|
|
||||||
'ExceptStatus = status
|
|
||||||
End Sub
|
|
||||||
|
|
||||||
Friend Sub objErrorHandler_ErrorFromActiveCnc2(ErrorNumber As List(Of Integer))
|
|
||||||
' resetto stati bFound
|
|
||||||
For Each Message In m_ReadFXMessages
|
|
||||||
Message.bFound = False
|
|
||||||
Next
|
|
||||||
|
|
||||||
For index As Integer = 0 To ErrorNumber.Count - 1
|
|
||||||
Dim nIndex As Integer = index
|
|
||||||
Dim NewMessageInList As ReadMessages = m_ReadFXMessages.FirstOrDefault(Function(x) x.CMsgCncNumber = 0.ToString() AndAlso
|
|
||||||
x.CMsgErrorType = 6.ToString() AndAlso
|
|
||||||
x.CMsgErrorIndex = "" AndAlso
|
|
||||||
x.CMsgErrorNumber = ErrorNumber(nIndex).ToString() AndAlso
|
|
||||||
x.CMsgErrorLine = "" AndAlso
|
|
||||||
x.CMsgErrorMessage = "")
|
|
||||||
' se il messaggio e' gia' in lista
|
|
||||||
If Not IsNothing(NewMessageInList) Then
|
|
||||||
' lo segno come trovato
|
|
||||||
NewMessageInList.bFound = True
|
|
||||||
Else
|
|
||||||
' lo aggiungo
|
|
||||||
Dim NewMessage As ReadMessages = New ReadMessages(0.ToString(),
|
|
||||||
6.ToString(),
|
|
||||||
"",
|
|
||||||
ErrorNumber(index).ToString(),
|
|
||||||
"",
|
|
||||||
"",
|
|
||||||
"")
|
|
||||||
NewMessage.bFound = True
|
|
||||||
m_ReadFXMessages.Add(NewMessage)
|
|
||||||
m_NUMAlarmCallbackDlg(0, 0, 6.ToString(), "", ErrorNumber(index).ToString(), "", "", "")
|
|
||||||
End If
|
|
||||||
Next
|
|
||||||
|
|
||||||
' cancello messaggi non trovati
|
|
||||||
For Index = m_ReadFXMessages.Count - 1 To 0 Step -1
|
|
||||||
Dim Message As ReadMessages = m_ReadFXMessages(Index)
|
|
||||||
If Not Message.bFound Then
|
|
||||||
m_NUMAlarmCallbackDlg(Message.CMsgCncNumber, 1, Message.CMsgErrorType, Message.CMsgErrorIndex, Message.CMsgErrorNumber, Message.CMsgErrorLine, Message.CMsgErrorMessage, Message.CMsgErrorAdditional)
|
|
||||||
m_ReadFXMessages.RemoveAt(Index)
|
|
||||||
End If
|
|
||||||
Next
|
|
||||||
|
|
||||||
End Sub
|
|
||||||
|
|
||||||
#Region "PLC Variables"
|
|
||||||
|
|
||||||
Private Sub objDPlcVariables_ReadVariablesChanged(ByVal index As Object, ByVal value As Object)
|
|
||||||
Dim _ObjIndex As Object() = CType(index, Object())
|
|
||||||
Dim _ObjValue As Object() = CType(value, Object())
|
|
||||||
|
|
||||||
For index = 0 To _ObjIndex.Length - 1
|
|
||||||
Dim nObjIndex As Integer = Integer.Parse(_ObjIndex(index).ToString())
|
|
||||||
Dim CommVar As CommVar = m_ReadingVars.FirstOrDefault(Function(x) Not IsNothing(x) AndAlso
|
|
||||||
x.Paragraph = CommVar.Paragraphs.MAIN AndAlso
|
|
||||||
x.nType = CommVar.Types.CN AndAlso
|
|
||||||
x.Index = nObjIndex)
|
|
||||||
If Not IsNothing(CommVar) Then
|
|
||||||
CommVar.SetValue(_ObjValue(index).ToString())
|
|
||||||
End If
|
|
||||||
Next
|
|
||||||
End Sub
|
|
||||||
|
|
||||||
Private Sub objDPlcVariables_ReadPLCVariablesChanged(ByVal index As Object, ByVal value As Object)
|
|
||||||
Dim _ObjIndex As Object() = CType(index, Object())
|
|
||||||
Dim _ObjValue As Object() = CType(value, Object())
|
|
||||||
|
|
||||||
For index = 0 To _ObjIndex.Length - 1
|
|
||||||
Dim nObjIndex As Integer = Integer.Parse(_ObjIndex(index).ToString())
|
|
||||||
Dim CommVar As CommVar = m_ReadingVars.FirstOrDefault(Function(x) Not IsNothing(x) AndAlso
|
|
||||||
x.Paragraph = CommVar.Paragraphs.MAIN AndAlso
|
|
||||||
x.nType = CommVar.Types.PLC AndAlso
|
|
||||||
x.Index = nObjIndex)
|
|
||||||
If Not IsNothing(CommVar) Then
|
|
||||||
CommVar.SetValue(_ObjValue(index).ToString())
|
|
||||||
End If
|
|
||||||
Next
|
|
||||||
End Sub
|
|
||||||
|
|
||||||
Private Sub objDPlcVariables_InvalidReadList(ByVal errorCode As Short)
|
|
||||||
EgtOutLog("InvalidReadList - ErrorCode: " & errorCode)
|
|
||||||
End Sub
|
|
||||||
|
|
||||||
Private Sub objDPlcVariables_AbortReadVariables()
|
|
||||||
EgtOutLog("InvalidReadList - ErrorCode: ")
|
|
||||||
End Sub
|
|
||||||
|
|
||||||
Private Sub objDPlcVariables_ReadOnceVariablesChanged(ByVal lHandle As Integer, ByVal value As Object)
|
|
||||||
'Dim _ObjValue As Object() = CType(value, Object())
|
|
||||||
|
|
||||||
'If lHandle = 10 Then
|
|
||||||
|
|
||||||
' For i As Integer = 0 To _ObjValue.Length - 1
|
|
||||||
' _ReadPlcVariableOnetime(i).Invoke(CType(Function()
|
|
||||||
' _ReadPlcVariableOnetime(i).Text = _ObjValue(i).ToString()
|
|
||||||
' End Function, MethodInvoker))
|
|
||||||
' Next
|
|
||||||
'End If
|
|
||||||
End Sub
|
|
||||||
|
|
||||||
Private Sub objDPlcVariables_VariablesWritten2(ByVal lHandle As Integer, ByVal errorCode As Integer)
|
|
||||||
Dim bOk As Boolean = (errorCode <> 0)
|
|
||||||
m_ResultCallbackDlg(CommandTypes.WRITE, If(bOk, CommandStates.OK, CommandStates.ERROR_), ResultTypes.RESULT, If(bOk, "", "Error VariablesWritten2 :" & " " & errorCode.ToString()))
|
|
||||||
End Sub
|
|
||||||
|
|
||||||
#End Region ' PLC Variables
|
|
||||||
|
|
||||||
#Region "ReadELS"
|
|
||||||
|
|
||||||
Private Sub objDReadELS_ValueChanged(ByVal nHandle As Short, ByVal dValue As Double, ByVal nerrorCode As Short)
|
|
||||||
If nHandle < 1 OrElse nHandle > m_ReadingVars.Count - 1 Then Return
|
|
||||||
If nerrorCode <> 0 Then EgtOutLog(" Error in Validchanged2 : " & nerrorCode & " Handle : " & nHandle)
|
|
||||||
|
|
||||||
Try
|
|
||||||
m_ReadingVars(nHandle - 1).SetValue(dValue.ToString("F04"))
|
|
||||||
Catch Ex As Exception
|
|
||||||
EgtOutLog(Ex.Message)
|
|
||||||
End Try
|
|
||||||
End Sub
|
|
||||||
|
|
||||||
#End Region ' ReadELS
|
|
||||||
|
|
||||||
#Region "File transfer"
|
|
||||||
|
|
||||||
Private Sub objDFileTransfer_Completed(ByVal lHandle As Integer)
|
|
||||||
If lHandle = 10 OrElse lHandle = 20 Then
|
|
||||||
'resetto contatore di trasferimento
|
|
||||||
m_BytesTransferedCounter = 0
|
|
||||||
EgtOutLog("Up- or Download successful completed:" & " " & lHandle.ToString())
|
|
||||||
' aggiorno variabili del MAIN
|
|
||||||
Dim ISONumVariable As Variable = Map.refMachCommandMessagePanelVM.MainVariablesList.FirstOrDefault(Function(x) x.sName = ISO_NUM)
|
|
||||||
Dim ISOSentVariable As Variable = Map.refMachCommandMessagePanelVM.MainVariablesList.FirstOrDefault(Function(x) x.sName = ISO_SENT)
|
|
||||||
Dim SentMachGroup As MyMachGroupVM = Map.refSupervisorMachGroupPanelVM.MachGroupVMList.FirstOrDefault(Function(x As MyMachGroupVM) x.bSendingToMachine)
|
|
||||||
If Not IsNothing(SentMachGroup) Then
|
|
||||||
ISONumVariable.sValue = SentMachGroup.Name
|
|
||||||
ISOSentVariable.sValue = 0
|
|
||||||
SentMachGroup.SetSentToMachine(True)
|
|
||||||
End If
|
|
||||||
End If
|
|
||||||
End Sub
|
|
||||||
|
|
||||||
Private Sub objDFileTransfer_TransferStarted(ByVal lHandle As Integer)
|
|
||||||
EgtOutLog("Transfer has been started !")
|
|
||||||
End Sub
|
|
||||||
|
|
||||||
Private Sub objDFileTransfer_Failed(ByVal lHandle As Integer, ByVal nSeq As Short, ByVal nReason As Short)
|
|
||||||
EgtOutLog("Sequence:" & " " & nSeq.ToString() & " " & "Reason:" & " " & nReason.ToString())
|
|
||||||
End Sub
|
|
||||||
|
|
||||||
Private Sub objDFileTransfer_BytesTransfered(ByVal lHandle As Integer, ByVal lBytes As Integer)
|
|
||||||
m_BytesTransferedCounter += lBytes
|
|
||||||
End Sub
|
|
||||||
|
|
||||||
#End Region ' File transfer
|
|
||||||
|
|
||||||
#Region "Position"
|
|
||||||
|
|
||||||
Private Sub objDPosition_PositionChanged(ByVal vtArrayIndex As Object, ByVal vtArrayValues As Object)
|
|
||||||
Dim _indexArray As Object() = CType(vtArrayIndex, Object())
|
|
||||||
Dim _valueArray As Object() = CType(vtArrayValues, Object())
|
|
||||||
|
|
||||||
For _index As Integer = 0 To _indexArray.Length - 1
|
|
||||||
|
|
||||||
Dim _index1 As Int16 = CType(_indexArray.GetValue(_index), Int16)
|
|
||||||
Dim _axisPosValue As Int32 = CType(_valueArray.GetValue(_index), Int32)
|
|
||||||
Dim _axisRefPosValue As Single = CSng(_axisPosValue) / m_LinearAxisPrecision
|
|
||||||
m_AxisCoordinatesCallbackDlg(_axisPosValue, _index1)
|
|
||||||
|
|
||||||
Next
|
|
||||||
End Sub
|
|
||||||
|
|
||||||
#End Region ' Position
|
|
||||||
|
|
||||||
#Region "MDI"
|
|
||||||
|
|
||||||
Private Sub objDMdiCommand_CommandWritten(ByVal retVal As Short)
|
|
||||||
If retVal <> 0 Then
|
|
||||||
EgtOutLog("Error CommandWritten :" & " " & retVal.ToString())
|
|
||||||
End If
|
|
||||||
Map.refMDIPageVM.SendMDIResult(retVal)
|
|
||||||
End Sub
|
|
||||||
|
|
||||||
#End Region ' MDI
|
|
||||||
|
|
||||||
#Region "Variables"
|
|
||||||
|
|
||||||
Private Sub objDVariables_VariableWritten2(ByVal lHandle As Integer, ByVal errorCode As Short)
|
|
||||||
If lHandle <> 2 OrElse errorCode <> 0 Then
|
|
||||||
EgtOutLog(" Error on objDVariables_VariableWritten2 : handle " & lHandle.ToString() & " errorCode : " & errorCode.ToString())
|
|
||||||
End If
|
|
||||||
End Sub
|
|
||||||
|
|
||||||
Private Sub objDVariables_VariableWritten(ByVal errorCode As Short)
|
|
||||||
If errorCode <> 0 Then
|
|
||||||
EgtOutLog(" Error on objDVariables_VariableWritten errorCode : " & errorCode.ToString())
|
|
||||||
End If
|
|
||||||
End Sub
|
|
||||||
|
|
||||||
Private Sub objDVariables_ValueChanged(ByVal vtArrayIndex As Object, ByVal vtArrayValues As Object)
|
|
||||||
Dim AplArrayIndex As Object() = CType(vtArrayIndex, Object())
|
|
||||||
Dim AplArrayValue As Object() = CType(vtArrayValues, Object())
|
|
||||||
|
|
||||||
For index As Integer = 0 To AplArrayIndex.Length - 1
|
|
||||||
Dim nHandle As Integer = CType(AplArrayIndex.GetValue(index), Int16)
|
|
||||||
If nHandle < 1 OrElse nHandle > m_ReadingVars.Count - 1 Then Return
|
|
||||||
Dim dValue As Double = CDbl(AplArrayValue.GetValue(index))
|
|
||||||
Try
|
|
||||||
m_ReadingVars(nHandle - 1).SetValue(dValue.ToString("F04"))
|
|
||||||
Catch Ex As Exception
|
|
||||||
EgtOutLog(Ex.Message)
|
|
||||||
End Try
|
|
||||||
Next
|
|
||||||
End Sub
|
|
||||||
|
|
||||||
#End Region ' Variables
|
|
||||||
|
|
||||||
#Region "CNCMode"
|
|
||||||
|
|
||||||
Private Sub objDCncMode_ValueChanged(ByVal mode As Short, ByVal preselected As Short)
|
|
||||||
m_OpModeCallbackDlg(mode)
|
|
||||||
End Sub
|
|
||||||
|
|
||||||
#End Region ' CNCMode
|
|
||||||
|
|
||||||
#Region "ReadOperatorMessage"
|
|
||||||
|
|
||||||
Private Sub objDReadOperatorMessage_ValueChanged(ByVal line As Object)
|
|
||||||
' resetto stati bFound
|
|
||||||
For Each Message In m_ReadOperatorMessages
|
|
||||||
Message.bFound = False
|
|
||||||
Next
|
|
||||||
Dim objLine As String = TryCast(line, String)
|
|
||||||
Dim OpMsgErrType As Integer = 30
|
|
||||||
Dim NewMessageInList As ReadMessages = m_ReadOperatorMessages.FirstOrDefault(Function(x) x.CMsgCncNumber = 0 AndAlso
|
|
||||||
x.CMsgErrorType = OpMsgErrType.ToString() AndAlso
|
|
||||||
x.CMsgErrorIndex = "" AndAlso
|
|
||||||
x.CMsgErrorNumber = "" AndAlso
|
|
||||||
x.CMsgErrorLine = "" AndAlso
|
|
||||||
x.CMsgErrorMessage = objLine AndAlso
|
|
||||||
x.CMsgErrorAdditional = "")
|
|
||||||
' se il messaggio e' gia' in lista
|
|
||||||
If Not IsNothing(NewMessageInList) Then
|
|
||||||
' lo segno come trovato
|
|
||||||
NewMessageInList.bFound = True
|
|
||||||
Else
|
|
||||||
' se e' diverso da stringa vuota
|
|
||||||
If Not String.IsNullOrWhiteSpace(objLine.ToString()) Then
|
|
||||||
' lo aggiungo
|
|
||||||
Dim NewMessage As ReadMessages = New ReadMessages(0,
|
|
||||||
OpMsgErrType.ToString(),
|
|
||||||
"",
|
|
||||||
"",
|
|
||||||
"",
|
|
||||||
objLine,
|
|
||||||
"")
|
|
||||||
NewMessage.bFound = True
|
|
||||||
m_ReadOperatorMessages.Add(NewMessage)
|
|
||||||
m_NUMAlarmCallbackDlg(0, 0, OpMsgErrType.ToString(), "", "", "", objLine, "")
|
|
||||||
End If
|
|
||||||
End If
|
|
||||||
|
|
||||||
' cancello messaggi non trovati
|
|
||||||
If m_ReadOperatorMessages.Count > 0 Then
|
|
||||||
For Index = m_ReadOperatorMessages.Count - 1 To 0 Step -1
|
|
||||||
Dim Message As ReadMessages = m_ReadOperatorMessages(Index)
|
|
||||||
If Not Message.bFound Then
|
|
||||||
m_NUMAlarmCallbackDlg(Message.CMsgCncNumber, 1, Message.CMsgErrorType, Message.CMsgErrorIndex, Message.CMsgErrorNumber, Message.CMsgErrorLine, Message.CMsgErrorMessage, Message.CMsgErrorAdditional)
|
|
||||||
m_ReadOperatorMessages.RemoveAt(Index)
|
|
||||||
End If
|
|
||||||
Next
|
|
||||||
End If
|
|
||||||
|
|
||||||
End Sub
|
|
||||||
|
|
||||||
#End Region ' ReadOperatorMessage
|
|
||||||
|
|
||||||
#End Region ' EVENTS
|
|
||||||
|
|
||||||
End Class
|
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -53,7 +53,7 @@ Public Class NUMFlexiumComm
|
|||||||
Private m_ReadFXMessages As New List(Of ReadMessages)
|
Private m_ReadFXMessages As New List(Of ReadMessages)
|
||||||
Private m_ReadOperatorMessages As New List(Of ReadMessages)
|
Private m_ReadOperatorMessages As New List(Of ReadMessages)
|
||||||
' lista variabili in lettura
|
' lista variabili in lettura
|
||||||
Private Shared m_ReadingVars(230) As CommVar
|
Private Shared m_ReadingVars(100) As CommVar
|
||||||
Private m_BytesTransferedCounter As Integer
|
Private m_BytesTransferedCounter As Integer
|
||||||
Private m_LinearAxisPrecision As Integer
|
Private m_LinearAxisPrecision As Integer
|
||||||
|
|
||||||
@@ -368,31 +368,6 @@ Public Class NUMFlexiumComm
|
|||||||
|
|
||||||
Friend Sub FileDownload(sFileType As String, sFilePath As String)
|
Friend Sub FileDownload(sFileType As String, sFilePath As String)
|
||||||
Dim _Return_Download As Short
|
Dim _Return_Download As Short
|
||||||
'' leggo variabile E30099
|
|
||||||
'Dim SendPermissionVariable As Variable = Map.refMachCommandMessagePanelVM.MainVariablesList.FirstOrDefault(Function(x) x.sName = SENDPERMISSION)
|
|
||||||
'Dim dTemp As Double = 0
|
|
||||||
'Dim nSendPermission As Integer = 0
|
|
||||||
'EgtOutLog("Inizio invio programma")
|
|
||||||
'While nSendPermission <> 2
|
|
||||||
' Dim bFirstWriteOne = True
|
|
||||||
' EgtOutLog("Inizio ciclo verifica diverso da 2")
|
|
||||||
' ' leggo valore
|
|
||||||
' If Not IsNothing(SendPermissionVariable.sValue) Then
|
|
||||||
' StringToDoubleAdv(SendPermissionVariable.sValue, dTemp)
|
|
||||||
' Integer.TryParse(dTemp, nSendPermission)
|
|
||||||
' EgtOutLog("Lettura variabile E30099: " & nSendPermission)
|
|
||||||
' Else
|
|
||||||
' EgtOutLog("nSendPermission = -1")
|
|
||||||
' nSendPermission = -1
|
|
||||||
' End If
|
|
||||||
' ' se uguale a zero ci scrivo uno
|
|
||||||
' If nSendPermission = 0 And bFirstWriteOne Then
|
|
||||||
' bFirstWriteOne = False
|
|
||||||
' SendPermissionVariable.sValue = 1
|
|
||||||
' EgtOutLog("Scrittura variabile E30099 = 1")
|
|
||||||
' End If
|
|
||||||
' Threading.Thread.Sleep(1000)
|
|
||||||
'End While
|
|
||||||
|
|
||||||
_Return_Download = objDFileTransfer.FileDownload2(10, sFileType, sFilePath, "", 1, 0)
|
_Return_Download = objDFileTransfer.FileDownload2(10, sFileType, sFilePath, "", 1, 0)
|
||||||
|
|
||||||
@@ -449,7 +424,7 @@ Public Class NUMFlexiumComm
|
|||||||
Friend Sub WriteNCVariables(Address As String, value As String)
|
Friend Sub WriteNCVariables(Address As String, value As String)
|
||||||
Try
|
Try
|
||||||
Dim dValue As Double = 0
|
Dim dValue As Double = 0
|
||||||
StringToDoubleAdv(value, dValue)
|
StringToDouble(value, dValue)
|
||||||
Dim rc As Short = objDVariables.WriteVariables2(2, objDGroupManager.Handle, Address, dValue)
|
Dim rc As Short = objDVariables.WriteVariables2(2, objDGroupManager.Handle, Address, dValue)
|
||||||
|
|
||||||
If rc <> 0 Then EgtOutLog(" objDVariables.WriteVariables2() Error : " & rc)
|
If rc <> 0 Then EgtOutLog(" objDVariables.WriteVariables2() Error : " & rc)
|
||||||
@@ -476,9 +451,7 @@ Public Class NUMFlexiumComm
|
|||||||
|
|
||||||
Private Sub objDGeneralFunction_ProgramActivated(ByVal nerrorCode As Short)
|
Private Sub objDGeneralFunction_ProgramActivated(ByVal nerrorCode As Short)
|
||||||
EgtOutLog("Part program activated:" & " " & nerrorCode)
|
EgtOutLog("Part program activated:" & " " & nerrorCode)
|
||||||
'DbControllers.m_LogMachineController.Create(MachLog.CreateResultLog(CommandTypes.SENDPROG, CommandStates.OK, ResultTypes.EXECUTED, "Part program activated:" & " " & nerrorCode))
|
DbControllers.m_LogMachineController.Create(MachLog.CreateResultLog(CommandTypes.SENDPROG, CommandStates.OK, ResultTypes.EXECUTED, "Part program activated:" & " " & nerrorCode))
|
||||||
' scrivo evento programma attivato
|
|
||||||
DbControllers.m_LogMachineController.Create(LogEvent.CreateMachCommandLog(LogEvent.MachineCommands.PROGRAM_ACTIVATION, "", nerrorCode, DbControllers.SupervisorId))
|
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Sub objDGeneralFunction_OnCncStart(ByVal errorCode As Short)
|
Private Sub objDGeneralFunction_OnCncStart(ByVal errorCode As Short)
|
||||||
@@ -556,14 +529,13 @@ Public Class NUMFlexiumComm
|
|||||||
Dim AplErrorAdditional As Object() = CType(ErrorAdditional, Object())
|
Dim AplErrorAdditional As Object() = CType(ErrorAdditional, Object())
|
||||||
|
|
||||||
For index As Integer = 0 To numberOfError - 1
|
For index As Integer = 0 To numberOfError - 1
|
||||||
Dim nIndex As Integer = index
|
|
||||||
Dim NewMessageInList As ReadMessages = m_ReadFXMessages.FirstOrDefault(Function(x) x.CMsgCncNumber = AplCnCNumber AndAlso
|
Dim NewMessageInList As ReadMessages = m_ReadFXMessages.FirstOrDefault(Function(x) x.CMsgCncNumber = AplCnCNumber AndAlso
|
||||||
x.CMsgErrorType = AplErrorType(nIndex).ToString() AndAlso
|
x.CMsgErrorType = AplErrorType(index).ToString() AndAlso
|
||||||
x.CMsgErrorIndex = AplErrorIndex(nIndex).ToString() AndAlso
|
x.CMsgErrorIndex = AplErrorIndex(index).ToString() AndAlso
|
||||||
x.CMsgErrorNumber = AplErrorNumber(nIndex).ToString() AndAlso
|
x.CMsgErrorNumber = AplErrorNumber(index).ToString() AndAlso
|
||||||
x.CMsgErrorLine = AplErrorLine(nIndex).ToString() AndAlso
|
x.CMsgErrorLine = AplErrorLine(index).ToString() AndAlso
|
||||||
x.CMsgErrorMessage = AplErrorMessage(nIndex).ToString() AndAlso
|
x.CMsgErrorMessage = AplErrorMessage(index).ToString() AndAlso
|
||||||
x.CMsgErrorAdditional = AplErrorAdditional(nIndex).ToString())
|
x.CMsgErrorAdditional = AplErrorAdditional(index).ToString())
|
||||||
' se il messaggio e' gia' in lista
|
' se il messaggio e' gia' in lista
|
||||||
If Not IsNothing(NewMessageInList) Then
|
If Not IsNothing(NewMessageInList) Then
|
||||||
' lo segno come trovato
|
' lo segno come trovato
|
||||||
@@ -917,13 +889,12 @@ Public Class NUMFlexiumComm
|
|||||||
Dim objLine As Object() = CType(line, Object())
|
Dim objLine As Object() = CType(line, Object())
|
||||||
Dim OpMsgErrType As Integer = 30
|
Dim OpMsgErrType As Integer = 30
|
||||||
For index As Integer = 0 To objMsgNumber.Length - 1
|
For index As Integer = 0 To objMsgNumber.Length - 1
|
||||||
Dim nIndex As Integer = index
|
|
||||||
Dim NewMessageInList As ReadMessages = m_ReadOperatorMessages.FirstOrDefault(Function(x) x.CMsgCncNumber = 0 AndAlso
|
Dim NewMessageInList As ReadMessages = m_ReadOperatorMessages.FirstOrDefault(Function(x) x.CMsgCncNumber = 0 AndAlso
|
||||||
x.CMsgErrorType = OpMsgErrType.ToString() AndAlso
|
x.CMsgErrorType = OpMsgErrType.ToString() AndAlso
|
||||||
x.CMsgErrorIndex = "" AndAlso
|
x.CMsgErrorIndex = "" AndAlso
|
||||||
x.CMsgErrorNumber = objMsgNumber(nIndex).ToString() AndAlso
|
x.CMsgErrorNumber = objMsgNumber(index).ToString() AndAlso
|
||||||
x.CMsgErrorLine = "" AndAlso
|
x.CMsgErrorLine = "" AndAlso
|
||||||
x.CMsgErrorMessage = objLine(nIndex).ToString() AndAlso
|
x.CMsgErrorMessage = objLine(index).ToString() AndAlso
|
||||||
x.CMsgErrorAdditional = "")
|
x.CMsgErrorAdditional = "")
|
||||||
' se il messaggio e' gia' in lista
|
' se il messaggio e' gia' in lista
|
||||||
If Not IsNothing(NewMessageInList) Then
|
If Not IsNothing(NewMessageInList) Then
|
||||||
|
|||||||
@@ -93,7 +93,7 @@ Public Class TPAComm
|
|||||||
System.Runtime.Remoting.Channels.ChannelServices.RegisterChannel(channel, False)
|
System.Runtime.Remoting.Channels.ChannelServices.RegisterChannel(channel, False)
|
||||||
Dim remoteType As System.Runtime.Remoting.WellKnownClientTypeEntry = New System.Runtime.Remoting.WellKnownClientTypeEntry(GetType(ISOCNC.Remoting_Server), serverURI)
|
Dim remoteType As System.Runtime.Remoting.WellKnownClientTypeEntry = New System.Runtime.Remoting.WellKnownClientTypeEntry(GetType(ISOCNC.Remoting_Server), serverURI)
|
||||||
System.Runtime.Remoting.RemotingConfiguration.RegisterWellKnownClientType(remoteType)
|
System.Runtime.Remoting.RemotingConfiguration.RegisterWellKnownClientType(remoteType)
|
||||||
Dim objectUri As String = Nothing
|
Dim objectUri As String
|
||||||
Dim messageSink As System.Runtime.Remoting.Messaging.IMessageSink = channel.CreateMessageSink("ipc://localhost:9090/IRemoteObject.rem", Nothing, objectUri)
|
Dim messageSink As System.Runtime.Remoting.Messaging.IMessageSink = channel.CreateMessageSink("ipc://localhost:9090/IRemoteObject.rem", Nothing, objectUri)
|
||||||
Console.WriteLine("The URI of the message sink is {0}.", objectUri)
|
Console.WriteLine("The URI of the message sink is {0}.", objectUri)
|
||||||
|
|
||||||
|
|||||||
@@ -17,8 +17,6 @@ Module ConstCommVar
|
|||||||
NULL = 0
|
NULL = 0
|
||||||
TPA = 1
|
TPA = 1
|
||||||
NUM_FLEXIUM = 2
|
NUM_FLEXIUM = 2
|
||||||
NUM_AXIUM_APSERVER = 3
|
|
||||||
NUM_AXIUM_PCTOOLKIT = 4
|
|
||||||
End Enum
|
End Enum
|
||||||
|
|
||||||
' Assi
|
' Assi
|
||||||
@@ -46,14 +44,6 @@ Module ConstCommVar
|
|||||||
Public Const RUNNING As String = "Running"
|
Public Const RUNNING As String = "Running"
|
||||||
' indice della lavorazione in corso (pareti NUM)
|
' indice della lavorazione in corso (pareti NUM)
|
||||||
Public Const MACHINDEX As String = "MachIndex"
|
Public Const MACHINDEX As String = "MachIndex"
|
||||||
' indice dell'utensile montato sulla testa 1
|
|
||||||
Public Const TOOLINDEX As String = "ToolIndex"
|
|
||||||
' indice dell'utensile montato sulla testa 1
|
|
||||||
Public Const TOOLINDEX2 As String = "ToolIndex2"
|
|
||||||
' variabile per lettura errori PLC bit a bit
|
|
||||||
Public Const PLC_MESSAGES As String = "PLC_Messages"
|
|
||||||
' variabile per leggere e scrivere permesso invio cn a macchina
|
|
||||||
Public Const SENDPERMISSION As String = "SendPermission"
|
|
||||||
|
|
||||||
Public Enum OPStates
|
Public Enum OPStates
|
||||||
Start = 1
|
Start = 1
|
||||||
|
|||||||
@@ -3,7 +3,5 @@
|
|||||||
Public Const MDI_MSG As String = "MDI"
|
Public Const MDI_MSG As String = "MDI"
|
||||||
Public Const PLC_MSG As String = "PLC"
|
Public Const PLC_MSG As String = "PLC"
|
||||||
Public Const CNC_MSG As String = "CNC"
|
Public Const CNC_MSG As String = "CNC"
|
||||||
Public Const INPUT_MSG As String = "INPUT"
|
|
||||||
Public Const OUTPUT_MSG As String = "OUTPUT"
|
|
||||||
|
|
||||||
End Module
|
End Module
|
||||||
|
|||||||
@@ -99,66 +99,20 @@
|
|||||||
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
||||||
<Prefer32Bit>false</Prefer32Bit>
|
<Prefer32Bit>false</Prefer32Bit>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup>
|
|
||||||
<ApplicationManifest>app.manifest</ApplicationManifest>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'RemoteDebug|AnyCPU'">
|
|
||||||
<DebugSymbols>true</DebugSymbols>
|
|
||||||
<DefineDebug>true</DefineDebug>
|
|
||||||
<DefineTrace>true</DefineTrace>
|
|
||||||
<OutputPath>bin\RemoteDebug\</OutputPath>
|
|
||||||
<DocumentationFile>EgtBEAMWALL.Supervisor.xml</DocumentationFile>
|
|
||||||
<NoWarn>41999,42016,42017,42018,42019,42020,42021,42022,42032,42036,42314</NoWarn>
|
|
||||||
<DebugType>full</DebugType>
|
|
||||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'RemoteDebug|x64'">
|
|
||||||
<DebugSymbols>true</DebugSymbols>
|
|
||||||
<DefineDebug>true</DefineDebug>
|
|
||||||
<DefineTrace>true</DefineTrace>
|
|
||||||
<OutputPath>bin\x64\RemoteDebug\</OutputPath>
|
|
||||||
<DocumentationFile>EgtBEAMWALL.Supervisor.xml</DocumentationFile>
|
|
||||||
<NoWarn>41999,42016,42017,42018,42019,42020,42021,42022,42032,42036,42314</NoWarn>
|
|
||||||
<DebugType>full</DebugType>
|
|
||||||
<PlatformTarget>x64</PlatformTarget>
|
|
||||||
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'RemoteDebug|x86'">
|
|
||||||
<DebugSymbols>true</DebugSymbols>
|
|
||||||
<DefineDebug>true</DefineDebug>
|
|
||||||
<DefineTrace>true</DefineTrace>
|
|
||||||
<OutputPath>bin\x86\RemoteDebug\</OutputPath>
|
|
||||||
<DocumentationFile>EgtBEAMWALL.Supervisor.xml</DocumentationFile>
|
|
||||||
<NoWarn>41999,42016,42017,42018,42019,42020,42021,42022,42032,42036,42314</NoWarn>
|
|
||||||
<DebugType>full</DebugType>
|
|
||||||
<PlatformTarget>x86</PlatformTarget>
|
|
||||||
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
|
||||||
</PropertyGroup>
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Reference Include="APLog">
|
<Reference Include="BouncyCastle.Crypto, Version=1.8.2.0, Culture=neutral, PublicKeyToken=0e99375e54769942, processorArchitecture=MSIL">
|
||||||
<HintPath>..\ExtLibs\APLog.dll</HintPath>
|
<HintPath>..\packages\Portable.BouncyCastle.1.8.2\lib\net40\BouncyCastle.Crypto.dll</HintPath>
|
||||||
<EmbedInteropTypes>True</EmbedInteropTypes>
|
|
||||||
</Reference>
|
|
||||||
<Reference Include="APServer">
|
|
||||||
<HintPath>..\ExtLibs\APServer.dll</HintPath>
|
|
||||||
<EmbedInteropTypes>True</EmbedInteropTypes>
|
|
||||||
</Reference>
|
|
||||||
<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>
|
||||||
<Reference Include="Csv, Version=1.0.31.0, Culture=neutral, processorArchitecture=MSIL">
|
<Reference Include="Csv, Version=1.0.31.0, Culture=neutral, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\Csv.1.0.31\lib\net40\Csv.dll</HintPath>
|
<HintPath>..\packages\Csv.1.0.31\lib\net40\Csv.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="DotNetZip, Version=1.16.0.0, Culture=neutral, PublicKeyToken=6583c7c814667745, processorArchitecture=MSIL">
|
<Reference Include="EgtUILib, Version=2.3.2.1, Culture=neutral, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\DotNetZip.1.16.0\lib\net40\DotNetZip.dll</HintPath>
|
|
||||||
</Reference>
|
|
||||||
<Reference Include="EgtUILib, Version=2.4.3.1, Culture=neutral, processorArchitecture=MSIL">
|
|
||||||
<SpecificVersion>False</SpecificVersion>
|
<SpecificVersion>False</SpecificVersion>
|
||||||
<HintPath>..\ExtLibs\EgtUILib.dll</HintPath>
|
<HintPath>..\..\..\..\..\..\EgtProg\Dll32\EgtUILib.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="EgtWPFLib5, Version=2.4.2.1, Culture=neutral, processorArchitecture=MSIL">
|
<Reference Include="EgtWPFLib5, Version=2.3.1.1, Culture=neutral, processorArchitecture=MSIL">
|
||||||
<SpecificVersion>False</SpecificVersion>
|
<SpecificVersion>False</SpecificVersion>
|
||||||
<HintPath>..\ExtLibs\EgtWPFLib5.dll</HintPath>
|
<HintPath>..\..\..\..\..\..\EgtProg\Dll32\EgtWPFLib5.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL">
|
<Reference Include="EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\EntityFramework.6.4.4\lib\net45\EntityFramework.dll</HintPath>
|
<HintPath>..\packages\EntityFramework.6.4.4\lib\net45\EntityFramework.dll</HintPath>
|
||||||
@@ -169,28 +123,16 @@
|
|||||||
<Reference Include="FluentFTP, Version=19.2.2.0, Culture=neutral, PublicKeyToken=f4af092b1d8df44f, processorArchitecture=MSIL">
|
<Reference Include="FluentFTP, Version=19.2.2.0, Culture=neutral, PublicKeyToken=f4af092b1d8df44f, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\FluentFTP.19.2.2\lib\net45\FluentFTP.dll</HintPath>
|
<HintPath>..\packages\FluentFTP.19.2.2\lib\net45\FluentFTP.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="Google.Protobuf, Version=3.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">
|
<Reference Include="Interop.FXLog">
|
||||||
<HintPath>..\ExtLibs\Interop.FXLog.dll</HintPath>
|
<HintPath>..\..\..\EgtProg\EgtBEAMWALL\Interop.FXLog.dll</HintPath>
|
||||||
<EmbedInteropTypes>True</EmbedInteropTypes>
|
<EmbedInteropTypes>True</EmbedInteropTypes>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="Interop.FXServer">
|
<Reference Include="Interop.FXServer">
|
||||||
<HintPath>..\ExtLibs\Interop.FXServer.dll</HintPath>
|
<HintPath>..\..\..\EgtProg\EgtBEAMWALL\Interop.FXServer.dll</HintPath>
|
||||||
<EmbedInteropTypes>True</EmbedInteropTypes>
|
<EmbedInteropTypes>True</EmbedInteropTypes>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="ISOCNC.Remoting">
|
<Reference Include="ISOCNC.Remoting">
|
||||||
<HintPath>..\ExtLibs\ISOCNC.Remoting.dll</HintPath>
|
<HintPath>..\..\..\Albatros\Bin\ISOCNC.Remoting.dll</HintPath>
|
||||||
</Reference>
|
|
||||||
<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.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.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>
|
||||||
<Reference Include="Microsoft.CSharp" />
|
<Reference Include="Microsoft.CSharp" />
|
||||||
<Reference Include="Microsoft.DotNet.PlatformAbstractions, Version=2.1.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
|
<Reference Include="Microsoft.DotNet.PlatformAbstractions, Version=2.1.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
|
||||||
@@ -199,21 +141,15 @@
|
|||||||
<Reference Include="Microsoft.Extensions.DependencyModel, Version=2.1.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
|
<Reference Include="Microsoft.Extensions.DependencyModel, Version=2.1.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\Microsoft.Extensions.DependencyModel.2.1.0\lib\net451\Microsoft.Extensions.DependencyModel.dll</HintPath>
|
<HintPath>..\packages\Microsoft.Extensions.DependencyModel.2.1.0\lib\net451\Microsoft.Extensions.DependencyModel.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="MySql.Data, Version=8.0.21.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d, processorArchitecture=MSIL">
|
<Reference Include="MySql.Data, Version=6.10.9.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\MySql.Data.8.0.21\lib\net452\MySql.Data.dll</HintPath>
|
<HintPath>..\packages\MySql.Data.6.10.9\lib\net452\MySql.Data.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="MySql.Data.EntityFramework, Version=8.0.21.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d, processorArchitecture=MSIL">
|
<Reference Include="MySql.Data.Entity.EF6, Version=6.10.9.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\MySql.Data.EntityFramework.8.0.21\lib\net452\MySql.Data.EntityFramework.dll</HintPath>
|
<HintPath>..\packages\MySql.Data.Entity.6.10.9\lib\net452\MySql.Data.Entity.EF6.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
|
<Reference Include="Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\Newtonsoft.Json.13.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
|
<HintPath>..\packages\Newtonsoft.Json.13.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="NLog, Version=5.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL">
|
|
||||||
<HintPath>..\packages\NLog.5.0.1\lib\net46\NLog.dll</HintPath>
|
|
||||||
</Reference>
|
|
||||||
<Reference Include="Renci.SshNet, Version=2016.1.0.0, Culture=neutral, PublicKeyToken=1cee9f8bde3db106, processorArchitecture=MSIL">
|
|
||||||
<HintPath>..\packages\SSH.NET.2016.1.0\lib\net40\Renci.SshNet.dll</HintPath>
|
|
||||||
</Reference>
|
|
||||||
<Reference Include="SdkApi.Core, Version=2.15.2634.0, Culture=neutral, processorArchitecture=MSIL">
|
<Reference Include="SdkApi.Core, Version=2.15.2634.0, Culture=neutral, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\Zebra.Printer.SDK.2.15.2634\lib\net471\SdkApi.Core.dll</HintPath>
|
<HintPath>..\packages\Zebra.Printer.SDK.2.15.2634\lib\net471\SdkApi.Core.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
@@ -226,9 +162,6 @@
|
|||||||
<Reference Include="SharpSnmpLib, Version=10.0.9.0, Culture=neutral, PublicKeyToken=4c00852d3788e005, processorArchitecture=MSIL">
|
<Reference Include="SharpSnmpLib, Version=10.0.9.0, Culture=neutral, PublicKeyToken=4c00852d3788e005, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\Lextm.SharpSnmpLib.10.0.9\lib\net452\SharpSnmpLib.dll</HintPath>
|
<HintPath>..\packages\Lextm.SharpSnmpLib.10.0.9\lib\net452\SharpSnmpLib.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="System.Buffers, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
|
||||||
<HintPath>..\packages\System.Buffers.4.5.1\lib\net461\System.Buffers.dll</HintPath>
|
|
||||||
</Reference>
|
|
||||||
<Reference Include="System.Collections.Specialized, Version=4.0.2.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
<Reference Include="System.Collections.Specialized, Version=4.0.2.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\System.Collections.Specialized.4.3.0\lib\net46\System.Collections.Specialized.dll</HintPath>
|
<HintPath>..\packages\System.Collections.Specialized.4.3.0\lib\net46\System.Collections.Specialized.dll</HintPath>
|
||||||
<Private>True</Private>
|
<Private>True</Private>
|
||||||
@@ -241,14 +174,7 @@
|
|||||||
<Reference Include="System.Core" />
|
<Reference Include="System.Core" />
|
||||||
<Reference Include="System.Drawing" />
|
<Reference Include="System.Drawing" />
|
||||||
<Reference Include="System.Drawing.Design" />
|
<Reference Include="System.Drawing.Design" />
|
||||||
<Reference Include="System.IO.Compression" />
|
|
||||||
<Reference Include="System.IO.Pipelines, Version=5.0.0.2, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
|
||||||
<HintPath>..\packages\System.IO.Pipelines.5.0.2\lib\net461\System.IO.Pipelines.dll</HintPath>
|
|
||||||
</Reference>
|
|
||||||
<Reference Include="System.Management" />
|
<Reference Include="System.Management" />
|
||||||
<Reference Include="System.Memory, Version=4.0.1.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">
|
<Reference Include="System.Net.NameResolution, Version=4.0.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\System.Net.NameResolution.4.3.0\lib\net46\System.Net.NameResolution.dll</HintPath>
|
<HintPath>..\packages\System.Net.NameResolution.4.3.0\lib\net46\System.Net.NameResolution.dll</HintPath>
|
||||||
<Private>True</Private>
|
<Private>True</Private>
|
||||||
@@ -259,13 +185,6 @@
|
|||||||
<Private>True</Private>
|
<Private>True</Private>
|
||||||
<Private>True</Private>
|
<Private>True</Private>
|
||||||
</Reference>
|
</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=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">
|
<Reference Include="System.Runtime.InteropServices.RuntimeInformation, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\System.Runtime.InteropServices.RuntimeInformation.4.0.0\lib\net45\System.Runtime.InteropServices.RuntimeInformation.dll</HintPath>
|
<HintPath>..\packages\System.Runtime.InteropServices.RuntimeInformation.4.0.0\lib\net45\System.Runtime.InteropServices.RuntimeInformation.dll</HintPath>
|
||||||
<Private>True</Private>
|
<Private>True</Private>
|
||||||
@@ -273,9 +192,6 @@
|
|||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="System.Runtime.Remoting" />
|
<Reference Include="System.Runtime.Remoting" />
|
||||||
<Reference Include="System.Security" />
|
<Reference Include="System.Security" />
|
||||||
<Reference Include="System.Threading.Tasks.Extensions, Version=4.2.0.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
|
||||||
<HintPath>..\packages\System.Threading.Tasks.Extensions.4.5.4\lib\net461\System.Threading.Tasks.Extensions.dll</HintPath>
|
|
||||||
</Reference>
|
|
||||||
<Reference Include="System.Transactions" />
|
<Reference Include="System.Transactions" />
|
||||||
<Reference Include="System.Web" />
|
<Reference Include="System.Web" />
|
||||||
<Reference Include="System.Windows.Forms" />
|
<Reference Include="System.Windows.Forms" />
|
||||||
@@ -292,9 +208,6 @@
|
|||||||
<Private>True</Private>
|
<Private>True</Private>
|
||||||
<Private>True</Private>
|
<Private>True</Private>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="Ubiety.Dns.Core, Version=2.2.1.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d, processorArchitecture=MSIL">
|
|
||||||
<HintPath>..\packages\MySql.Data.8.0.21\lib\net452\Ubiety.Dns.Core.dll</HintPath>
|
|
||||||
</Reference>
|
|
||||||
<Reference Include="WindowsBase" />
|
<Reference Include="WindowsBase" />
|
||||||
<Reference Include="PresentationCore" />
|
<Reference Include="PresentationCore" />
|
||||||
<Reference Include="PresentationFramework" />
|
<Reference Include="PresentationFramework" />
|
||||||
@@ -302,9 +215,6 @@
|
|||||||
<Reference Include="ZebraPrinterSdk, Version=2.15.2634.0, Culture=neutral, processorArchitecture=MSIL">
|
<Reference Include="ZebraPrinterSdk, Version=2.15.2634.0, Culture=neutral, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\Zebra.Printer.SDK.2.15.2634\lib\net471\ZebraPrinterSdk.dll</HintPath>
|
<HintPath>..\packages\Zebra.Printer.SDK.2.15.2634\lib\net471\ZebraPrinterSdk.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="Zstandard.Net, Version=1.1.7.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d, processorArchitecture=MSIL">
|
|
||||||
<HintPath>..\packages\MySql.Data.8.0.21\lib\net452\Zstandard.Net.dll</HintPath>
|
|
||||||
</Reference>
|
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ApplicationDefinition Include="Application.xaml">
|
<ApplicationDefinition Include="Application.xaml">
|
||||||
@@ -323,15 +233,9 @@
|
|||||||
<DependentUpon>CalcPanelV.xaml</DependentUpon>
|
<DependentUpon>CalcPanelV.xaml</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
<Compile Include="CALCPanel\CALCPanelVM.vb" />
|
<Compile Include="CALCPanel\CALCPanelVM.vb" />
|
||||||
<Compile Include="Comms\NUMAxiumComm.vb" />
|
|
||||||
<Compile Include="Comms\NUMAxiumPcToolkitComm.vb" />
|
|
||||||
<Compile Include="Comms\NUMFlexiumComm.vb" />
|
<Compile Include="Comms\NUMFlexiumComm.vb" />
|
||||||
<Compile Include="Comms\TPAComm.vb" />
|
<Compile Include="Comms\TPAComm.vb" />
|
||||||
<Compile Include="Constants\ConstMachMsg.vb" />
|
<Compile Include="Constants\ConstMachMsg.vb" />
|
||||||
<Compile Include="MachineLogPage\MachineLogPageV.xaml.vb">
|
|
||||||
<DependentUpon>MachineLogPageV.xaml</DependentUpon>
|
|
||||||
</Compile>
|
|
||||||
<Compile Include="MachineLogPage\MachineLogPageVM.vb" />
|
|
||||||
<Compile Include="MDIPage\MDIPageV.xaml.vb">
|
<Compile Include="MDIPage\MDIPageV.xaml.vb">
|
||||||
<DependentUpon>MDIPageV.xaml</DependentUpon>
|
<DependentUpon>MDIPageV.xaml</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
@@ -414,7 +318,6 @@
|
|||||||
<DependentUpon>Dictionary.xaml</DependentUpon>
|
<DependentUpon>Dictionary.xaml</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
<Compile Include="Utility\DisableModifiedMgr.vb" />
|
<Compile Include="Utility\DisableModifiedMgr.vb" />
|
||||||
<Compile Include="Utility\LogEvent.vb" />
|
|
||||||
<Compile Include="Utility\LuaExec.vb" />
|
<Compile Include="Utility\LuaExec.vb" />
|
||||||
<Compile Include="Utility\ManageBTLParts.vb" />
|
<Compile Include="Utility\ManageBTLParts.vb" />
|
||||||
<Compile Include="Utility\Map.vb" />
|
<Compile Include="Utility\Map.vb" />
|
||||||
@@ -444,10 +347,6 @@
|
|||||||
<Generator>MSBuild:Compile</Generator>
|
<Generator>MSBuild:Compile</Generator>
|
||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
</Page>
|
</Page>
|
||||||
<Page Include="MachineLogPage\MachineLogPageV.xaml">
|
|
||||||
<Generator>MSBuild:Compile</Generator>
|
|
||||||
<SubType>Designer</SubType>
|
|
||||||
</Page>
|
|
||||||
<Page Include="MDIPage\MDIPageV.xaml">
|
<Page Include="MDIPage\MDIPageV.xaml">
|
||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
<Generator>MSBuild:Compile</Generator>
|
<Generator>MSBuild:Compile</Generator>
|
||||||
@@ -584,7 +483,6 @@
|
|||||||
<CustomToolNamespace>My.Resources</CustomToolNamespace>
|
<CustomToolNamespace>My.Resources</CustomToolNamespace>
|
||||||
</EmbeddedResource>
|
</EmbeddedResource>
|
||||||
<None Include="app.config" />
|
<None Include="app.config" />
|
||||||
<None Include="app.manifest" />
|
|
||||||
<None Include="My Project\Settings.settings">
|
<None Include="My Project\Settings.settings">
|
||||||
<Generator>SettingsSingleFileGenerator</Generator>
|
<Generator>SettingsSingleFileGenerator</Generator>
|
||||||
<LastGenOutput>Settings.Designer.vb</LastGenOutput>
|
<LastGenOutput>Settings.Designer.vb</LastGenOutput>
|
||||||
@@ -658,18 +556,6 @@
|
|||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Resource Include="Resources\ProjectManager\Save.png" />
|
<Resource Include="Resources\ProjectManager\Save.png" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
|
||||||
<BootstrapperPackage Include=".NETFramework,Version=v4.7.2">
|
|
||||||
<Visible>False</Visible>
|
|
||||||
<ProductName>Microsoft .NET Framework 4.7.2 %28x86 and x64%29</ProductName>
|
|
||||||
<Install>true</Install>
|
|
||||||
</BootstrapperPackage>
|
|
||||||
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
|
|
||||||
<Visible>False</Visible>
|
|
||||||
<ProductName>.NET Framework 3.5 SP1</ProductName>
|
|
||||||
<Install>false</Install>
|
|
||||||
</BootstrapperPackage>
|
|
||||||
</ItemGroup>
|
|
||||||
<Import Project="$(MSBuildToolsPath)\Microsoft.VisualBasic.targets" />
|
<Import Project="$(MSBuildToolsPath)\Microsoft.VisualBasic.targets" />
|
||||||
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
|
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user