Compare commits
79 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 0a45d1af95 | |||
| b41454183f | |||
| 7e7258dd7c | |||
| 19a8ca1267 | |||
| e88c603fca | |||
| a62f0ca724 | |||
| 370b270d95 | |||
| 2d1de6ccf3 | |||
| 527a3bc3b9 | |||
| 77f225f866 | |||
| 0e662a8799 | |||
| ca2828958d | |||
| 97d6b26df5 | |||
| e01104dba3 | |||
| 443f72d86a | |||
| 794b45e4f3 | |||
| 52b111aff3 | |||
| e3a436ff4d | |||
| cc04872cc1 | |||
| 4075563e9f | |||
| c68efe69be | |||
| bb0a838d91 | |||
| 217a3b6fcc | |||
| a7de0d3b1e | |||
| 77be897037 | |||
| 2ef75b21d0 | |||
| b5066816e1 | |||
| 34e5b6ec55 | |||
| 14e3fa908a | |||
| 81427b38b3 | |||
| d95bd48d9e | |||
| 342472c625 | |||
| 694feab56e | |||
| d7262bfbb6 | |||
| 1f510bfae8 | |||
| a054c472cf | |||
| 24827b336a | |||
| d9681dbcb5 | |||
| dd9ff98329 | |||
| 3fe0400219 | |||
| 5cf6343518 | |||
| 69a2905d9b | |||
| b1254c3247 | |||
| c2a3fdfbd4 | |||
| fd92dbbe23 | |||
| 0218880d93 | |||
| 057d31ab49 | |||
| 1ec1e4539f | |||
| 1c2f87d79f | |||
| 5d0a7705d5 | |||
| e357e54152 | |||
| e598c7af90 | |||
| ab930e2e90 | |||
| 3752846faa | |||
| 7deafdde51 | |||
| 145ba2afda | |||
| 31822c78a4 | |||
| a36313b9b2 | |||
| 9e7be2740e | |||
| 5f6572d0ef | |||
| ce794f55dc | |||
| bd13256399 | |||
| 76bdc0bb19 | |||
| 83bfe07c50 | |||
| cd940ccf7e | |||
| ae7474445d | |||
| ebec1bb583 | |||
| 3ddc441674 | |||
| acd66d7738 | |||
| 7be48bd00a | |||
| 136de45c47 | |||
| 93c4e02633 | |||
| f47bf047b8 | |||
| b0c6bb52f8 | |||
| 7642884442 | |||
| f8dc8d075b | |||
| 927f171cd6 | |||
| 5ca6f13899 | |||
| b68f6bfeee |
@@ -327,3 +327,4 @@ _UpgradeReport_Files/
|
||||
Backup*/
|
||||
UpgradeLog*.XML
|
||||
|
||||
.ionide/symbolCache.db
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -174,7 +174,7 @@ Public Class BTLFeatureM
|
||||
Protected m_sCALC_MSG As String
|
||||
Public Property sCALC_MSG As String
|
||||
Get
|
||||
Return m_sCALC_MSG
|
||||
Return MessageFromLuaMsg(m_sCALC_MSG)
|
||||
End Get
|
||||
Set(value As String)
|
||||
m_sCALC_MSG = value
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -666,7 +666,7 @@ Public Class BTLPartM
|
||||
Private m_sCALC_MSG As String
|
||||
Public Property sCALC_MSG As String
|
||||
Get
|
||||
Return m_sCALC_MSG
|
||||
Return MessageFromLuaMsg(m_sCALC_MSG)
|
||||
End Get
|
||||
Set(value As String)
|
||||
m_sCALC_MSG = value
|
||||
|
||||
@@ -18,6 +18,35 @@ Public Class BTLStructureM
|
||||
End Get
|
||||
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
|
||||
Public m_BTLPartMList As List(Of BTLPartM)
|
||||
Public Property BTLPartMList As List(Of BTLPartM)
|
||||
@@ -406,7 +435,35 @@ Public Class BTLStructureM
|
||||
Else
|
||||
NewBTLStructure.m_nAsseBaseId = EgtGetFirstNameInGroup(GDB_ID.ROOT, ASSEBASE)
|
||||
NewBTLStructure.m_nBTLInfoId = EgtGetFirstNameInGroup(GDB_ID.ROOT, BTLINFO)
|
||||
NewBTLStructure.m_nCompositesId = EgtGetFirstNameInGroup(GDB_ID.ROOT, COMPOSITES)
|
||||
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_PROJNAME, NewBTLStructure.m_sPROJNAME)
|
||||
EgtGetInfo(NewBTLStructure.m_nBTLInfoId, BTL_GEN_PROJPART, NewBTLStructure.m_sPROJPART)
|
||||
@@ -465,6 +522,56 @@ Public Class BTLStructureM
|
||||
Return TempList
|
||||
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
|
||||
|
||||
#Region "METHODS"
|
||||
@@ -486,6 +593,22 @@ Public Class BTLStructureM
|
||||
'RaiseEvent BTLPartAdded(Me, New BTLPartAddedEventArgs(BTLPartM))
|
||||
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)
|
||||
Return New List(Of BTLPartM)(m_BTLPartMList)
|
||||
End Function
|
||||
|
||||
@@ -113,11 +113,18 @@
|
||||
PROD = 2
|
||||
End Enum
|
||||
|
||||
' Tipo di progetto (Beam o Wall)
|
||||
Public Enum BWType As Integer
|
||||
NULL = 0
|
||||
BEAM = 1
|
||||
WALL = 2
|
||||
' Tipo di progetto (Beam o Wall)
|
||||
Public Enum BWType As Integer
|
||||
NULL = 0
|
||||
BEAM = 1
|
||||
WALL = 2
|
||||
End Enum
|
||||
|
||||
' Tipo di Composite (Element o Layer)
|
||||
Public Enum CompositeType As Integer
|
||||
NULL = 0
|
||||
ELEMENT = 1
|
||||
LAYER = 2
|
||||
End Enum
|
||||
|
||||
Public Const PROJ As String = "PROJ"
|
||||
@@ -126,9 +133,16 @@
|
||||
|
||||
' layer per assemblato
|
||||
Public Const ASSEBASE As String = "AsseBase"
|
||||
' info parametri assemblato
|
||||
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
|
||||
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_DO As String = "DO"
|
||||
Public Const BTL_PRT_NAM As String = "NAM"
|
||||
@@ -284,6 +298,7 @@
|
||||
Public Const WRH_CURRENT As String = "Current"
|
||||
Public Const WRH_STARTOFFSET As String = "StartOffset"
|
||||
Public Const WRH_OFFSET As String = "Offset"
|
||||
Public Const WRH_RANGE As String = "Range"
|
||||
Public Const WRH_QUANTITY As String = "Quantity"
|
||||
Public Const WRH_L As String = "L"
|
||||
Public Const WRH_KERF As String = "Kerf"
|
||||
|
||||
@@ -27,6 +27,7 @@
|
||||
Public Const S_SECTXMATLIST_WALL As String = "DG_SectXMatList_WALL"
|
||||
Public Const S_VARIABLESLIST As String = "DG_VariablesList"
|
||||
Public Const S_MDICOMMANDS As String = "DG_MDICommands"
|
||||
Public Const S_UPDATEBTLPARTLIST As String = "DG_UpdateBTLPartList"
|
||||
|
||||
Public Const K_LOCKTABLE As String = "LockTable"
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
Public Const PROJECT_OPTIMIZER As String = "Project_Optimizer"
|
||||
Public Const LEFTPANEL_VIEW As String = "LeftPanel_View"
|
||||
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 LEFTPANEL_SUPERVISOR As String = "LeftPanel_Supervisor"
|
||||
Public Const PROJECT_SUPERVISOR As String = "Project_Supervisor"
|
||||
|
||||
@@ -32,6 +32,7 @@ Public Module ConstGen
|
||||
CONFIG = 3
|
||||
INPUTS = 4
|
||||
OUTPUTS = 5
|
||||
LAYERSWALL = 6
|
||||
End Enum
|
||||
|
||||
' Abilitazioni licenza
|
||||
|
||||
@@ -37,6 +37,9 @@ Public Module ConstIni
|
||||
'Public Const K_SUPPORT As String = "Support"
|
||||
Public Const K_WAREHOUSE As String = "Warehouse"
|
||||
Public Const K_DBADDRESS As String = "DbAddress"
|
||||
Public Const K_DBMASTERKEY As String = "DbMasterKey"
|
||||
Public Const K_UPDATEBTL As String = "UpdateBtl"
|
||||
Public Const K_DATADIR As String = "DataDir"
|
||||
|
||||
'Public Const S_LANGUAGES As String = "Languages"
|
||||
'Public Const K_LANGUAGE As String = "Language"
|
||||
|
||||
@@ -59,6 +59,7 @@
|
||||
<Reference Include="PresentationFramework" />
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Drawing" />
|
||||
<Reference Include="System.Windows.Forms" />
|
||||
<Reference Include="System.Xaml" />
|
||||
<Reference Include="System.Xml" />
|
||||
@@ -78,6 +79,8 @@
|
||||
<Import Include="System.Xml.Linq" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="BTLModel\BTLLayerM.vb" />
|
||||
<Compile Include="BTLModel\BTLElementM.vb" />
|
||||
<Compile Include="BTLViewModel\BTLFeatureVM.vb" />
|
||||
<Compile Include="CALCPanel\CalcEditEndEventArgs.vb" />
|
||||
<Compile Include="Constants\ConstColumns.vb" />
|
||||
@@ -108,12 +111,18 @@
|
||||
<Compile Include="BTLModel\BTLPartM.vb" />
|
||||
<Compile Include="BTLModel\BTLStructureM.vb" />
|
||||
<Compile Include="Constants\ConstBeam.vb" />
|
||||
<Compile Include="LoadingWnd\LoadingWndHelper.vb" />
|
||||
<Compile Include="LoadingWnd\LoadingWndV.xaml.vb">
|
||||
<DependentUpon>LoadingWndV.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="LoadingWnd\LoadingWndVM.vb" />
|
||||
<Compile Include="Utility\DimensionsIniFile.vb" />
|
||||
<Compile Include="Utility\Enum.vb" />
|
||||
<Compile Include="MachGroupPanel\MyMachGroupPanelVM.vb" />
|
||||
<Compile Include="MachGroupPanel\MyMachGroupVM.vb" />
|
||||
<Compile Include="MachGroupPanel\PartVM.vb" />
|
||||
<Compile Include="Utility\GridDimension.vb" />
|
||||
<Compile Include="Utility\LuaMsgManager.vb" />
|
||||
<Compile Include="Utility\MachLog.vb" />
|
||||
<Compile Include="My Project\AssemblyInfo.vb" />
|
||||
<Compile Include="My Project\Application.Designer.vb">
|
||||
@@ -135,6 +144,7 @@
|
||||
<Compile Include="Lib\MachGroupM.vb" />
|
||||
<Compile Include="Lib\MachGroupPanelM.vb" />
|
||||
<Compile Include="MachGroupModel\MyMachGroupPanelM.vb" />
|
||||
<Compile Include="Utility\ManageWindow.vb" />
|
||||
<Compile Include="Utility\MyMachine.vb" />
|
||||
<Compile Include="OpenProjectFileDialog\OpenProjectFileDialogV.xaml.vb">
|
||||
<DependentUpon>OpenProjectFileDialogV.xaml</DependentUpon>
|
||||
@@ -180,6 +190,10 @@
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Page Include="LoadingWnd\LoadingWndV.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>XamlIntelliSenseFileGenerator</Generator>
|
||||
</Page>
|
||||
<Page Include="OpenProjectFileDialog\OpenProjectFileDialogV.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
|
||||
@@ -2,13 +2,16 @@
|
||||
x:Name="CurrDataGrid"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
<DataGrid.ColumnHeaderStyle>
|
||||
<Style TargetType="DataGridColumnHeader">
|
||||
<EventSetter Event="SizeChanged" Handler="Cell_SizedChanged" />
|
||||
<EventSetter Event="MouseRightButtonDown" Handler="Cell_MouseRightButtonDown" />
|
||||
<EventSetter Event="FrameworkElement.Loaded" Handler="DataGridColumnHeader_Loaded"/>
|
||||
</Style>
|
||||
</DataGrid.ColumnHeaderStyle>
|
||||
<DataGrid.ColumnHeaderStyle>
|
||||
<Style TargetType="DataGridColumnHeader">
|
||||
<Setter Property="HorizontalContentAlignment"
|
||||
Value="Stretch" />
|
||||
<EventSetter Event="SizeChanged"
|
||||
Handler="Cell_SizedChanged" />
|
||||
<EventSetter Event="MouseRightButtonDown"
|
||||
Handler="Cell_MouseRightButtonDown" />
|
||||
</Style>
|
||||
</DataGrid.ColumnHeaderStyle>
|
||||
|
||||
</DataGrid>
|
||||
|
||||
|
||||
@@ -14,20 +14,13 @@ Public Class EgtDataGrid
|
||||
|
||||
' vecchio indice da salvare per il Reorder delle colonne
|
||||
Public OldIndex As Integer = 0
|
||||
|
||||
' variabili e costanti per il Resize delle colonne adiacenti
|
||||
Private Const LEFT As String = "PART_LeftHeaderGripper"
|
||||
Private Const RIGHT As String = "PART_RightHeaderGripper"
|
||||
Private startPoint As Point
|
||||
Private startWidth As Double
|
||||
Private adjacentStartWidth As Double
|
||||
'Private startUnitType As DataGridLengthUnitType
|
||||
'Private adjacentUnitType As DataGridLengthUnitType
|
||||
Private targetColumn As DataGridColumn
|
||||
Private adjacentColumn As DataGridColumn
|
||||
|
||||
' indice header su cui è aperto il ContextMenu per gestione check/uncheck LockTable
|
||||
Private HeaderDispIndex As Integer = 0
|
||||
' somma delle larghezze delle colonne di EgtDataGrid
|
||||
Private columnsWidth As Double = 0
|
||||
|
||||
' larghezza minima dell'ultima colonna per attivare/disattivare ScrollBar orizzontale
|
||||
Private Const LASTCOLUMN_MINWIDTH As Double = 40
|
||||
|
||||
Sub New()
|
||||
InitializeComponent()
|
||||
@@ -138,6 +131,44 @@ Public Class EgtDataGrid
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub DataGrid_SizedChanged(sender As Object, e As SizeChangedEventArgs) Handles CurrDataGrid.SizeChanged
|
||||
' confronto la larghezza effettiva della EgtDataGrid con la somma delle larghezze delle colonne
|
||||
UpdateColumnsWidth()
|
||||
If BindingColumns.Count > 0 Then
|
||||
If CurrDataGrid.ActualWidth - LASTCOLUMN_MINWIDTH > columnsWidth Then
|
||||
' nascondo la ScrollBar orizzontale e setto lo UnitType dell'ultima colonna visibile a Star
|
||||
ScrollViewer.SetHorizontalScrollBarVisibility(CurrDataGrid, ScrollBarVisibility.Hidden)
|
||||
BindingColumns.Last(Function(x) x.Visible = True).Width = New DataGridLength(1, DataGridLengthUnitType.Star)
|
||||
Else
|
||||
' mostro la ScrollBar orizzontale e se UnitType delle colonne è Star lo setto a Pixel
|
||||
ScrollViewer.SetHorizontalScrollBarVisibility(CurrDataGrid, ScrollBarVisibility.Visible)
|
||||
For Each bc In BindingColumns
|
||||
If bc.Width.IsStar Then
|
||||
bc.Width = New DataGridLength(bc.ActualWidth, DataGridLengthUnitType.Pixel)
|
||||
End If
|
||||
Next
|
||||
End If
|
||||
' scrivo nell'INI la Width dell'ultima colonna visibile
|
||||
BindingColumns.Last(Function(x) x.Visible = True).SaveDataGridColumn()
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Public Sub UpdateColumnsWidth()
|
||||
' ricalcolo la somma delle larghezze delle colonne visibili
|
||||
columnsWidth = 0
|
||||
For Each col In BindingColumns
|
||||
If col.ColumnVisibility = Visibility.Visible Then
|
||||
columnsWidth += col.ActualWidth
|
||||
End If
|
||||
Next
|
||||
' alla somma calcolata tolgo la larghezza dell'ultima colonna visibile e aggiungo LASTCOLUMN_MINWIDTH
|
||||
' (in questo modo si attiva/disattiva la ScrollBar orizzontale non appena l'ultima colonna viene ristretta/estesa a LASTCOLUMN_MINWIDTH px)
|
||||
If BindingColumns.Count > 0 AndAlso
|
||||
BindingColumns.Any(Function(x) x.Visible = True) Then
|
||||
columnsWidth = columnsWidth - BindingColumns.Last(Function(x) x.Visible = True).ActualWidth + LASTCOLUMN_MINWIDTH
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub Cell_MouseRightButtonDown(sender As Object, e As RoutedEventArgs)
|
||||
Dim nDispIndex As Integer = sender.DisplayIndex
|
||||
' creo il ContextMenu con gli item checkabili
|
||||
@@ -240,86 +271,6 @@ Public Class EgtDataGrid
|
||||
Next
|
||||
End Sub
|
||||
|
||||
Private Sub DataGridColumnHeader_Loaded(sender As Object, e As RoutedEventArgs)
|
||||
Dim header = DirectCast(sender, DataGridColumnHeader)
|
||||
|
||||
Dim thumbLeft As Thumb = header.Template.FindName(LEFT, header)
|
||||
thumbLeft.AddHandler(Thumb.DragStartedEvent, CType(AddressOf Thumb_DragStarted, DragStartedEventHandler), True)
|
||||
thumbLeft.AddHandler(Thumb.DragCompletedEvent, CType(AddressOf Thumb_DragCompleted, DragCompletedEventHandler), True)
|
||||
|
||||
Dim thumbRight As Thumb = header.Template.FindName(RIGHT, header)
|
||||
thumbRight.AddHandler(Thumb.DragStartedEvent, CType(AddressOf Thumb_DragStarted, DragStartedEventHandler), True)
|
||||
thumbRight.AddHandler(Thumb.DragCompletedEvent, CType(AddressOf Thumb_DragCompleted, DragCompletedEventHandler), True)
|
||||
End Sub
|
||||
|
||||
Private Sub Thumb_DragStarted(sender As Object, e As DragStartedEventArgs)
|
||||
Dim thumb = CType(sender, Thumb)
|
||||
Dim dg As DataGrid = GetParent(Of DataGrid)(thumb)
|
||||
startPoint = Mouse.GetPosition(dg)
|
||||
|
||||
Dim header As DataGridColumnHeader = GetParent(Of DataGridColumnHeader)(thumb)
|
||||
|
||||
If thumb.Name = RIGHT Then
|
||||
targetColumn = header.Column
|
||||
Dim Index As Integer = header.Column.DisplayIndex + 1
|
||||
If (Index < BindingColumns.Count) Then
|
||||
adjacentColumn = dg.Columns.FirstOrDefault(Function(x) x.DisplayIndex = Index)
|
||||
End If
|
||||
Else
|
||||
Dim Index As Integer = header.Column.DisplayIndex - 1
|
||||
If (Index >= 0) Then
|
||||
adjacentColumn = dg.Columns.FirstOrDefault(Function(x) x.DisplayIndex = Index + 1)
|
||||
End If
|
||||
targetColumn = dg.Columns.FirstOrDefault(Function(x) x.DisplayIndex = Index)
|
||||
End If
|
||||
startWidth = targetColumn.ActualWidth
|
||||
'startUnitType = targetColumn.Width.UnitType
|
||||
If Not IsNothing(adjacentColumn) Then
|
||||
adjacentStartWidth = adjacentColumn.ActualWidth
|
||||
'adjacentUnitType = adjacentColumn.Width.UnitType
|
||||
End If
|
||||
AddHandler thumb.PreviewMouseMove, AddressOf Thumb_PreviewMouseMove
|
||||
End Sub
|
||||
|
||||
Private Sub Thumb_PreviewMouseMove(sender As Object, e As MouseEventArgs)
|
||||
Dim thumb = CType(sender, Thumb)
|
||||
If (Not thumb.IsDragging Or IsNothing(targetColumn)) Then Return
|
||||
|
||||
e.Handled = True
|
||||
|
||||
Dim dg As DataGrid = GetParent(Of DataGrid)(thumb)
|
||||
Dim currentPoint As Point = Mouse.GetPosition(dg)
|
||||
Dim diffX As Double = (currentPoint - startPoint).X
|
||||
Dim newWidth As Double = Math.Max(targetColumn.MinWidth, Math.Min(startWidth + diffX, targetColumn.MaxWidth))
|
||||
Dim length = New DataGridLength(newWidth)
|
||||
|
||||
targetColumn.SetValue(DataGridColumn.WidthProperty, length)
|
||||
|
||||
If Not IsNothing(adjacentColumn) Then
|
||||
newWidth = Math.Max(adjacentColumn.MinWidth, Math.Min(adjacentStartWidth - diffX, adjacentColumn.MaxWidth))
|
||||
length = New DataGridLength(newWidth)
|
||||
adjacentColumn.SetValue(DataGridColumn.WidthProperty, length)
|
||||
End If
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub Thumb_DragCompleted(sender As Object, e As DragCompletedEventArgs)
|
||||
RemoveHandler CType(sender, Thumb).PreviewMouseMove, AddressOf Thumb_PreviewMouseMove
|
||||
targetColumn = Nothing
|
||||
adjacentColumn = Nothing
|
||||
End Sub
|
||||
|
||||
Private Function GetParent(Of T As DependencyObject)(d As DependencyObject) As T
|
||||
Dim tObj As T = Nothing
|
||||
|
||||
While IsNothing(tObj)
|
||||
tObj = TryCast(d, T)
|
||||
d = VisualTreeHelper.GetParent(d)
|
||||
End While
|
||||
|
||||
Return tObj
|
||||
End Function
|
||||
|
||||
Private Sub miLock_Checked(sender As Object, e As RoutedEventArgs)
|
||||
Dim miLock = DirectCast(sender, MenuItem)
|
||||
' disabilito Reorder e Resize di tutte le colonne salvandone prima il valore
|
||||
@@ -359,12 +310,8 @@ Public Class EgtDataGrid
|
||||
End Sub
|
||||
|
||||
Private Sub miResetSort_Click(sender As Object, e As RoutedEventArgs)
|
||||
CurrDataGrid.Items.SortDescriptions.Clear()
|
||||
For Each column In BindingColumns 'Grid.Columns
|
||||
column.SortDirection = 0
|
||||
' resettiamo graficamente anche l'header della colonna
|
||||
CurrDataGrid.Columns(column.DisplayIndex).SortDirection = Nothing
|
||||
Next
|
||||
' resetto le SortDirection di tutte le colonne della datagrid
|
||||
ResetSortDirections()
|
||||
End Sub
|
||||
|
||||
Private Sub CurrDataGrid_Loaded(sender As Object, e As RoutedEventArgs) Handles CurrDataGrid.Loaded
|
||||
@@ -377,19 +324,46 @@ Public Class EgtDataGrid
|
||||
End If
|
||||
colIndex += 1
|
||||
Next
|
||||
' calcolo la somma delle larghezze delle colonne visibili
|
||||
For Each col In BindingColumns
|
||||
If col.ColumnVisibility = Visibility.Visible Then
|
||||
columnsWidth += col.ActualWidth
|
||||
End If
|
||||
Next
|
||||
End Sub
|
||||
|
||||
Private Sub CurrDataGrid_Sorting(sender As Object, e As DataGridSortingEventArgs) Handles CurrDataGrid.Sorting
|
||||
Select Case e.Column.SortDirection
|
||||
' salvo la SortDirection corrente della colonna prima di resettarla per tutte le colonne
|
||||
Dim CurrSortDirection As ListSortDirection? = e.Column.SortDirection
|
||||
ResetSortDirections(True)
|
||||
' ora applico la SortDirection corretta
|
||||
Select Case CurrSortDirection
|
||||
Case ListSortDirection.Ascending
|
||||
BindingColumns(e.Column.DisplayIndex).SortDirection = 2 ' la settiamo a Descending
|
||||
BindingColumns(e.Column.DisplayIndex).SortDirection = 2 ' la setto a Descending
|
||||
Case ListSortDirection.Descending
|
||||
BindingColumns(e.Column.DisplayIndex).SortDirection = 1 ' la settiamo a Ascending
|
||||
BindingColumns(e.Column.DisplayIndex).SortDirection = 1 ' la setto a Ascending
|
||||
Case Else
|
||||
BindingColumns(e.Column.DisplayIndex).SortDirection = 1 ' la settiamo a Ascending
|
||||
BindingColumns(e.Column.DisplayIndex).SortDirection = 1 ' la setto a Ascending
|
||||
End Select
|
||||
End Sub
|
||||
|
||||
Private Sub ResetSortDirections(Optional bUserClick As Boolean = False)
|
||||
If bUserClick Then
|
||||
' nel caso di click dell'utente sulla colonna da sortare occorre solamente settare a 0 la SortDirection di tutte le colonne
|
||||
For Each column In BindingColumns
|
||||
column.SortDirection = 0
|
||||
Next
|
||||
Else
|
||||
' altrimenti (caso ResetSort da ContextMenu) è necessatio un Clear più ampio e anche grafico
|
||||
CurrDataGrid.Items.SortDescriptions.Clear()
|
||||
For Each column In BindingColumns
|
||||
column.SortDirection = 0
|
||||
' resetto graficamente anche l'header della colonna
|
||||
CurrDataGrid.Columns(column.DisplayIndex).SortDirection = Nothing
|
||||
Next
|
||||
End If
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
|
||||
Public Class EgtDataGridColumn
|
||||
@@ -430,6 +404,12 @@ Public Class EgtDataGridColumn
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property ActualWidth As Double
|
||||
Get
|
||||
Return m_dgColumn.ActualWidth
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private Property m_DisplayIndex As Integer
|
||||
Public Property DisplayIndex As Integer
|
||||
Get
|
||||
@@ -526,6 +506,17 @@ Public Class EgtDataGridColumn
|
||||
m_ColumnVisibility = value
|
||||
If Not IsNothing(m_dgColumn) Then
|
||||
m_dgColumn.Visibility = value
|
||||
' ricavo la EgtDataGrid a cui appartiene la DataGridColumn
|
||||
Dim propertyInfo As Reflection.PropertyInfo = m_dgColumn.GetType().GetProperty("DataGridOwner",
|
||||
Reflection.BindingFlags.Instance Or
|
||||
Reflection.BindingFlags.NonPublic)
|
||||
Dim dg As EgtDataGrid = propertyInfo.GetValue(m_dgColumn, Nothing)
|
||||
' ogni colonna visibile con UnitType a Star tranne l'ultima verrà settata a Pixel
|
||||
For Each bc In dg.BindingColumns
|
||||
If bc.Width.IsStar And Not bc.Name = dg.BindingColumns.Last(Function(x) x.Visible = True).Name Then
|
||||
bc.Width = New DataGridLength(bc.ActualWidth, DataGridLengthUnitType.Pixel)
|
||||
End If
|
||||
Next
|
||||
End If
|
||||
End Set
|
||||
End Property
|
||||
|
||||
@@ -0,0 +1,99 @@
|
||||
Imports System.Threading
|
||||
Imports System.Windows.Threading
|
||||
|
||||
Public Module LoadingWndHelper
|
||||
|
||||
Public Enum ActiveIds As Integer
|
||||
OPENPROJ = 1
|
||||
SAVEPROJ = 2
|
||||
IMPORTBTL = 3
|
||||
GOTOPROD = 4
|
||||
OPENPROD = 5
|
||||
SAVEPROD = 6
|
||||
GOTOPROJ = 7
|
||||
EXPORTPROJECT = 8
|
||||
IMPORTPROJECT = 9
|
||||
CHANGEPARAM = 10
|
||||
CREATINGPDF = 11
|
||||
CHANGEMATERIAL = 12
|
||||
End Enum
|
||||
|
||||
Dim m_MainWindow As Windows.Window
|
||||
Public Function SetMainWindow(MainWindow As Windows.Window)
|
||||
m_MainWindow = MainWindow
|
||||
End Function
|
||||
|
||||
Private m_bMainWindow_IsActive As Boolean = True
|
||||
Public Function SetMainWindowIsActive(IsActive As Boolean)
|
||||
m_bMainWindow_IsActive = IsActive
|
||||
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)
|
||||
|
||||
Private m_thread As Thread
|
||||
Private m_LoadingWndVM As Core.LoadingWndVM
|
||||
Private m_CurrStep As Integer
|
||||
Private m_StepText As String
|
||||
Private m_nProgress As Integer
|
||||
Private m_nNextProgress As Integer
|
||||
Private m_bClose As Boolean
|
||||
Private m_bActiveId As Integer = -1
|
||||
|
||||
Public Function OpenLoadingWnd(Id As Integer, nSteps As Integer, TotText As String, FirstStepText As String, nNextProgress As Integer) As Boolean
|
||||
If m_bActiveId > 0 Then Return False
|
||||
m_bActiveId = Id
|
||||
m_LoadingWndVM = Nothing
|
||||
m_CurrStep = 1
|
||||
m_StepText = FirstStepText
|
||||
m_nProgress = 1
|
||||
m_nNextProgress = nNextProgress
|
||||
m_bClose = False
|
||||
Dim Top As Double = m_MainWindow.Top + (m_MainWindow.Height / 2) - 100
|
||||
Dim Left As Double = m_MainWindow.Left + (m_MainWindow.Width / 2) - 150
|
||||
Dim WindowStartupLocation As Windows.WindowStartupLocation = Windows.WindowStartupLocation.Manual
|
||||
If m_MainWindow.WindowState = Windows.WindowState.Maximized Then
|
||||
WindowStartupLocation = Windows.WindowStartupLocation.CenterScreen
|
||||
End If
|
||||
m_thread = New Thread(Sub()
|
||||
m_LoadingWndVM = New Core.LoadingWndVM(nSteps, TotText, AddressOf LoadingCallback)
|
||||
m_LoadingWndVM.UpdateProgress(m_CurrStep, m_StepText, m_nProgress, m_nNextProgress)
|
||||
Dim LoadingWnd As New LoadingWndV(Nothing, m_LoadingWndVM)
|
||||
' posiziono la finestra
|
||||
If WindowStartupLocation = Windows.WindowStartupLocation.CenterScreen Then
|
||||
LoadingWnd.WindowStartupLocation = Windows.WindowStartupLocation.CenterScreen
|
||||
Else
|
||||
LoadingWnd.Top = Top
|
||||
LoadingWnd.Left = Left
|
||||
End If
|
||||
LoadingWnd.Show()
|
||||
Dispatcher.Run()
|
||||
End Sub)
|
||||
m_thread.SetApartmentState(ApartmentState.STA)
|
||||
m_thread.Start()
|
||||
Return True
|
||||
End Function
|
||||
|
||||
Private Sub LoadingCallback(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)
|
||||
CurrStep = m_CurrStep
|
||||
StepText = m_StepText
|
||||
nProgress = m_nProgress
|
||||
nNextProgress = m_nNextProgress
|
||||
m_bMainWindow_IsActive = MainWindow_IsActive
|
||||
bClose = m_bClose
|
||||
End Sub
|
||||
|
||||
Public Sub UpdateLoadingWnd(Id As Integer, CurrStep As Integer, StepText As String, nProgress As Integer, nNextProgress As Integer)
|
||||
If Id <> m_bActiveId Then Return
|
||||
m_CurrStep = CurrStep
|
||||
m_StepText = StepText
|
||||
m_nProgress = nProgress
|
||||
m_nNextProgress = nNextProgress
|
||||
End Sub
|
||||
|
||||
Public Sub CloseLoadingWnd(Id As Integer)
|
||||
If Id <> m_bActiveId Then Return
|
||||
m_bClose = True
|
||||
m_bActiveId = -1
|
||||
End Sub
|
||||
|
||||
End Module
|
||||
@@ -0,0 +1,56 @@
|
||||
<EgtWPFLib5:EgtCustomWindow x:Class="LoadingWndV"
|
||||
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"
|
||||
Style="{DynamicResource {x:Type EgtWPFLib5:EgtCustomWindow}}"
|
||||
Height="200" Width="300"
|
||||
TitleBarHeight="0"
|
||||
ResizeMode="NoResize" WindowStyle="None"
|
||||
IsClosable="False" IsMinimizable="False"
|
||||
WindowStartupLocation="Manual" ShowInTaskbar="False">
|
||||
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
</Grid.RowDefinitions>
|
||||
<TextBlock Grid.Row="1"
|
||||
Text="{Binding TotText_Msg}"
|
||||
TextAlignment="Center"/>
|
||||
<TextBlock Grid.Row="2"
|
||||
Text="{Binding StepText_Msg}"
|
||||
TextAlignment="Center"
|
||||
Visibility="{Binding StepText_Visibility}"/>
|
||||
<Grid Grid.Row="3"
|
||||
Visibility="{Binding StepProgress_Visibility}">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
</Grid.RowDefinitions>
|
||||
<Grid Height="20"/>
|
||||
<ProgressBar Grid.Row="1"
|
||||
Minimum="0"
|
||||
Maximum="100"
|
||||
Value="{Binding StepProgress_Value}"
|
||||
Height="20"
|
||||
Margin="40,0,40,0"/>
|
||||
</Grid>
|
||||
<ProgressBar Grid.Row="5"
|
||||
Minimum="0"
|
||||
Maximum="100"
|
||||
Value="{Binding TotProgress_Value}"
|
||||
Height="20"
|
||||
Margin="40,0,40,0"/>
|
||||
<TextBlock Grid.Row="7"
|
||||
Text="{Binding TotProgress_Msg}"
|
||||
TextAlignment="Center"/>
|
||||
</Grid>
|
||||
|
||||
</EgtWPFLib5:EgtCustomWindow>
|
||||
@@ -0,0 +1,28 @@
|
||||
Imports System.Windows
|
||||
|
||||
Public Class LoadingWndV
|
||||
|
||||
Private WithEvents m_LoadingWndVM As LoadingWndVM
|
||||
|
||||
Sub New(Owner As Window, LoadingWndVM As LoadingWndVM)
|
||||
MyBase.New(Owner)
|
||||
' This call is required by the designer.
|
||||
InitializeComponent()
|
||||
Me.DataContext = LoadingWndVM
|
||||
' Assegno al riferimento locale al VM il VM preso dal DataContext
|
||||
m_LoadingWndVM = LoadingWndVM
|
||||
End Sub
|
||||
|
||||
Private Sub CloseWindow(bDialogResult As Boolean) Handles m_LoadingWndVM.m_CloseWindow
|
||||
Me.Close()
|
||||
End Sub
|
||||
|
||||
Private Sub ActivateWindow() Handles m_LoadingWndVM.m_ActivateWindow
|
||||
Me.Activate()
|
||||
End Sub
|
||||
|
||||
Private Sub Me_ContentRendered() Handles Me.ContentRendered
|
||||
m_LoadingWndVM.StartFunction()
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
@@ -0,0 +1,233 @@
|
||||
Imports System.Timers
|
||||
Imports System.Windows
|
||||
Imports System.Windows.Input
|
||||
Imports System.Windows.Threading
|
||||
Imports EgtBEAMWALL.Core
|
||||
Imports EgtUILib
|
||||
Imports EgtWPFLib5
|
||||
|
||||
Public Class LoadingWndVM
|
||||
Inherits VMBase
|
||||
|
||||
#Region "FIELDS & PROPERTIES"
|
||||
|
||||
Enum LoadingTypes As Integer
|
||||
NULL = 0
|
||||
OPEN = 1
|
||||
IMPORT = 2
|
||||
End Enum
|
||||
|
||||
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)
|
||||
|
||||
Friend Event m_CloseWindow(bDialogResult As Boolean)
|
||||
Friend Event m_ActivateWindow()
|
||||
|
||||
Private m_CallbackLoading As CallbackLoadingDlg
|
||||
Private m_Waiting_Timer As New DispatcherTimer
|
||||
|
||||
' numero di passaggi di caricamento
|
||||
Private m_nSteps As Integer
|
||||
' titolo testo di caricamento
|
||||
Private m_TotText As String
|
||||
' numero passaggio corrente
|
||||
Private m_CurrStep As Integer
|
||||
' testo del passaggio corrente
|
||||
Private m_StepText As String
|
||||
' indice d'inizio di questo passaggio
|
||||
Private m_nStartProgress As Integer
|
||||
' indice d'inizio del prossimo passaggio
|
||||
Private m_nNextProgress As Integer
|
||||
' variabile che indica richiesta chiusura della finestra
|
||||
Private m_bClosing As Boolean = False
|
||||
Private m_bMainWindow_IsActive As Boolean = True
|
||||
|
||||
Private m_StepProgress_Value As Double = 0
|
||||
Public Property StepProgress_Value As Double
|
||||
Get
|
||||
Return m_StepProgress_Value
|
||||
End Get
|
||||
Set(value As Double)
|
||||
m_StepProgress_Value = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_TotProgress_Value As Double = 0
|
||||
Public Property TotProgress_Value As Double
|
||||
Get
|
||||
Return Math.Floor(m_TotProgress_Value)
|
||||
End Get
|
||||
Set(value As Double)
|
||||
m_TotProgress_Value = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_StepText_Visibility As Visibility
|
||||
Public ReadOnly Property StepText_Visibility As Visibility
|
||||
Get
|
||||
Return m_StepText_Visibility
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_StepProgress_Visibility As Visibility
|
||||
Public ReadOnly Property StepProgress_Visibility As Visibility
|
||||
Get
|
||||
Return m_StepProgress_Visibility
|
||||
End Get
|
||||
End Property
|
||||
|
||||
#Region "Messages"
|
||||
|
||||
Public ReadOnly Property TotText_Msg As String
|
||||
Get
|
||||
Return If(m_nSteps > 0, m_TotText & " (" & m_CurrStep & "/" & m_nSteps & ")", m_TotText)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property StepText_Msg As String
|
||||
Get
|
||||
Return m_StepText
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property TotProgress_Msg As String
|
||||
Get
|
||||
Return m_TotProgress_Value.ToString("0.#") & "%"
|
||||
End Get
|
||||
End Property
|
||||
|
||||
#End Region ' Messages
|
||||
|
||||
' Definizione comandi
|
||||
Private m_cmdCancel As ICommand
|
||||
|
||||
#End Region ' FIELDS & PROPERTIES
|
||||
|
||||
Sub New(Steps As Integer, TotText As String, callback As CallbackLoadingDlg)
|
||||
m_nSteps = Steps
|
||||
m_TotText = TotText
|
||||
m_CallbackLoading = callback
|
||||
m_bClosing = False
|
||||
If Steps = 1 Then
|
||||
m_StepText_Visibility = Visibility.Collapsed
|
||||
m_StepProgress_Visibility = Visibility.Collapsed
|
||||
Else
|
||||
m_StepText_Visibility = Visibility.Visible
|
||||
m_StepProgress_Visibility = Visibility.Visible
|
||||
End If
|
||||
' imposto contatore
|
||||
m_Waiting_Timer.Interval = TimeSpan.FromMilliseconds(200)
|
||||
AddHandler m_Waiting_Timer.Tick, AddressOf WaitingTimer_Tick
|
||||
End Sub
|
||||
|
||||
Public Sub UpdateProgress(CurrStep As Integer, StepText As String, nStartProgress As Integer, nNextProgress As Integer)
|
||||
m_CurrStep = CurrStep
|
||||
m_StepText = StepText
|
||||
m_StepProgress_Value = nStartProgress
|
||||
m_nNextProgress = nNextProgress
|
||||
NotifyPropertyChanged(NameOf(StepText_Msg))
|
||||
NotifyPropertyChanged(NameOf(TotText_Msg))
|
||||
End Sub
|
||||
|
||||
Public Overridable Sub StartFunction()
|
||||
m_Waiting_Timer.Start()
|
||||
End Sub
|
||||
|
||||
Protected Overridable Sub WaitingTimer_Tick()
|
||||
' leggo eventuali nuovi valori
|
||||
Dim CurrStep As Integer = 0
|
||||
Dim StepText As String = ""
|
||||
Dim nStartProgress As Integer = 0
|
||||
Dim nNextProgress As Integer = 0
|
||||
Dim bMainWindow_IsActive As Boolean = True
|
||||
Dim bClose As Boolean = False
|
||||
m_CallbackLoading(CurrStep, StepText, nStartProgress, nNextProgress, bMainWindow_IsActive, bClose)
|
||||
If bMainWindow_IsActive <> m_bMainWindow_IsActive Then
|
||||
RaiseEvent m_ActivateWindow()
|
||||
End If
|
||||
If m_bClosing Then
|
||||
Close()
|
||||
Dispatcher.CurrentDispatcher.InvokeShutdown()
|
||||
Return
|
||||
ElseIf bClose Then
|
||||
m_bClosing = True
|
||||
' mostro completamento caricamento
|
||||
m_CurrStep = m_nSteps
|
||||
m_StepProgress_Value = 100
|
||||
m_TotProgress_Value = 100
|
||||
m_Waiting_Timer.Interval = TimeSpan.FromMilliseconds(1000)
|
||||
Else
|
||||
If m_CurrStep <> CurrStep Then
|
||||
If m_StepProgress_Value < 100 Then
|
||||
m_StepProgress_Value = 100
|
||||
ElseIf m_StepProgress_Value = 100 Then
|
||||
m_StepProgress_Value = 0
|
||||
m_CurrStep = CurrStep
|
||||
m_StepText = StepText
|
||||
m_nStartProgress = nStartProgress
|
||||
m_nNextProgress = nNextProgress
|
||||
End If
|
||||
Else
|
||||
' incremento Step corrente
|
||||
If m_StepProgress_Value < 80 Then
|
||||
m_StepProgress_Value += 1
|
||||
ElseIf m_StepProgress_Value < 90 Then
|
||||
m_StepProgress_Value += 0.4
|
||||
ElseIf m_StepProgress_Value < 98 Then
|
||||
m_StepProgress_Value += 0.1
|
||||
Else
|
||||
m_StepProgress_Value += 0.01
|
||||
End If
|
||||
End If
|
||||
' calcolo totale
|
||||
Dim dStepStart As Double = If(m_CurrStep > 1, m_nStartProgress, 0)
|
||||
Dim dStepEnd As Double = m_nNextProgress
|
||||
m_TotProgress_Value = dStepStart + ((dStepEnd - dStepStart) / 100 * m_StepProgress_Value)
|
||||
End If
|
||||
' aggiorno grafica
|
||||
NotifyPropertyChanged(NameOf(StepText_Msg))
|
||||
NotifyPropertyChanged(NameOf(TotText_Msg))
|
||||
NotifyPropertyChanged(NameOf(StepProgress_Value))
|
||||
NotifyPropertyChanged(NameOf(TotProgress_Value))
|
||||
NotifyPropertyChanged(NameOf(TotProgress_Msg))
|
||||
End Sub
|
||||
|
||||
Public Sub Close()
|
||||
' fermo timer
|
||||
m_Waiting_Timer.Stop()
|
||||
' chiudo finestra
|
||||
RaiseEvent m_CloseWindow(True)
|
||||
End Sub
|
||||
|
||||
#Region "COMMANDS"
|
||||
|
||||
#Region "Cancel"
|
||||
|
||||
''' <summary>
|
||||
''' Returns a command that do Open.
|
||||
''' </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 Open. This method is invoked by the OpenCommand.
|
||||
''' </summary>
|
||||
Friend Sub Cancel()
|
||||
'' chiedo conferma
|
||||
'If MessageBox.Show("Are you sure you want to stop the nesting?", "Warning", MessageBoxButton.YesNo, MessageBoxImage.Warning) = MessageBoxResult.No Then Return
|
||||
'' fermo il nesting
|
||||
'Map.refOptimizePanelVM.m_StopNesting = True
|
||||
'' fermo timer e chiudo finestra
|
||||
'CloseNesting()
|
||||
End Sub
|
||||
|
||||
#End Region ' Cancel
|
||||
|
||||
#End Region ' COMMANDS
|
||||
|
||||
End Class
|
||||
@@ -176,7 +176,7 @@ Public Class MyMachGroupM
|
||||
Private m_sCALC_MSG As String
|
||||
Public Property sCALC_MSG As String
|
||||
Get
|
||||
Return m_sCALC_MSG
|
||||
Return MessageFromLuaMsg(m_sCALC_MSG)
|
||||
End Get
|
||||
Set(value As String)
|
||||
m_sCALC_MSG = value
|
||||
|
||||
@@ -139,21 +139,28 @@ Public Class PartM
|
||||
Public Property dPOSX As Double
|
||||
Get
|
||||
If nType = BWType.WALL Then
|
||||
' recupero box pezzo
|
||||
Dim b3Part As New BBox3d
|
||||
EgtGetBBoxGlob(nPartId, GDB_BB.ONLY_VISIBLE + GDB_BB.IGNORE_TEXT + GDB_BB.IGNORE_DIM, b3Part)
|
||||
' recupero layer del box
|
||||
Dim nBoxLayerId As Integer = EgtGetFirstNameInGroup(nPartId, "Box")
|
||||
' recupero box del layer box
|
||||
Dim b3Box As New BBox3d
|
||||
EgtGetBBoxGlob(nBoxLayerId, GDB_BB.STANDARD, b3Box)
|
||||
' recupero origine grezzo
|
||||
Dim nrawPartId As Integer = EgtGetRawPartFromPart(nPartId)
|
||||
Dim b3Raw As New BBox3d
|
||||
EgtGetRawPartBBox(nrawPartId, b3Raw)
|
||||
' calcolo distanza tra origine pezzo e tavolo
|
||||
Dim vtPartRef As New Vector3d(b3Box.Min() - b3Raw.Min())
|
||||
Return vtPartRef.x
|
||||
' verifico che sia attivo MachGroup di questo pezzo
|
||||
If EgtGetCurrMachGroup() = ParentMachGroup.Id Then
|
||||
' recupero box pezzo
|
||||
Dim b3Part As New BBox3d
|
||||
EgtGetBBoxGlob(nPartId, GDB_BB.ONLY_VISIBLE + GDB_BB.IGNORE_TEXT + GDB_BB.IGNORE_DIM, b3Part)
|
||||
' recupero layer del box
|
||||
Dim nBoxLayerId As Integer = EgtGetFirstNameInGroup(nPartId, "Box")
|
||||
' recupero box del layer box
|
||||
Dim b3Box As New BBox3d
|
||||
EgtGetBBoxGlob(nBoxLayerId, GDB_BB.STANDARD, b3Box)
|
||||
' recupero origine grezzo
|
||||
Dim nrawPartId As Integer = EgtGetRawPartFromPart(nPartId)
|
||||
Dim b3Raw As New BBox3d
|
||||
EgtGetRawPartBBox(nrawPartId, b3Raw)
|
||||
' calcolo distanza tra origine pezzo e tavolo
|
||||
Dim vtPartRef As New Vector3d(b3Box.Min() - b3Raw.Min())
|
||||
m_dPOSX = vtPartRef.x
|
||||
Return vtPartRef.x
|
||||
' altrimenti restituisco valore salvato (per quando viene clickato un BTLPart)
|
||||
Else
|
||||
Return m_dPOSX
|
||||
End If
|
||||
Else ' nType = BWType.BEAM
|
||||
Return m_dPOSX
|
||||
End If
|
||||
@@ -203,6 +210,16 @@ Public Class PartM
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public m_sSTOREY As String
|
||||
Public Property sSTOREY As String
|
||||
Get
|
||||
Return m_sSTOREY
|
||||
End Get
|
||||
Set(value As String)
|
||||
m_sSTOREY = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public m_sGROUP As String
|
||||
Public Property sGROUP As String
|
||||
Get
|
||||
@@ -260,21 +277,28 @@ Public Class PartM
|
||||
Protected m_dPOSY As Double
|
||||
Public Property dPOSY As Double
|
||||
Get
|
||||
' recupero box pezzo
|
||||
Dim b3Part As New BBox3d
|
||||
EgtGetBBoxGlob(nPartId, GDB_BB.ONLY_VISIBLE + GDB_BB.IGNORE_TEXT + GDB_BB.IGNORE_DIM, b3Part)
|
||||
' recupero layer del box
|
||||
Dim nBoxLayerId As Integer = EgtGetFirstNameInGroup(nPartId, "Box")
|
||||
' recupero box del layer box
|
||||
Dim b3Box As New BBox3d
|
||||
EgtGetBBoxGlob(nBoxLayerId, GDB_BB.STANDARD, b3Box)
|
||||
' recupero origine grezzo
|
||||
Dim nrawPartId As Integer = EgtGetRawPartFromPart(nPartId)
|
||||
Dim b3Raw As New BBox3d
|
||||
EgtGetRawPartBBox(nrawPartId, b3Raw)
|
||||
' calcolo distanza tra origine pezzo e tavolo
|
||||
Dim vtPartRef As New Vector3d(b3Box.Min() - b3Raw.Min())
|
||||
Return vtPartRef.y
|
||||
' verifico che sia attivo MachGroup di questo pezzo
|
||||
If EgtGetCurrMachGroup() = ParentMachGroup.Id Then
|
||||
' recupero box pezzo
|
||||
Dim b3Part As New BBox3d
|
||||
EgtGetBBoxGlob(nPartId, GDB_BB.ONLY_VISIBLE + GDB_BB.IGNORE_TEXT + GDB_BB.IGNORE_DIM, b3Part)
|
||||
' recupero layer del box
|
||||
Dim nBoxLayerId As Integer = EgtGetFirstNameInGroup(nPartId, "Box")
|
||||
' recupero box del layer box
|
||||
Dim b3Box As New BBox3d
|
||||
EgtGetBBoxGlob(nBoxLayerId, GDB_BB.STANDARD, b3Box)
|
||||
' recupero origine grezzo
|
||||
Dim nrawPartId As Integer = EgtGetRawPartFromPart(nPartId)
|
||||
Dim b3Raw As New BBox3d
|
||||
EgtGetRawPartBBox(nrawPartId, b3Raw)
|
||||
' calcolo distanza tra origine pezzo e tavolo
|
||||
Dim vtPartRef As New Vector3d(b3Box.Min() - b3Raw.Min())
|
||||
m_dPOSY = vtPartRef.y
|
||||
Return vtPartRef.y
|
||||
' altrimenti restituisco valore salvato (per quando viene clickato un BTLPart)
|
||||
Else
|
||||
Return m_dPOSY
|
||||
End If
|
||||
'Return m_dPOSY
|
||||
End Get
|
||||
Set(value As Double)
|
||||
@@ -359,7 +383,7 @@ Public Class PartM
|
||||
Protected m_sCALC_MSG As String = String.Empty
|
||||
Public Property sCALC_MSG As String
|
||||
Get
|
||||
Return m_sCALC_MSG
|
||||
Return MessageFromLuaMsg(m_sCALC_MSG)
|
||||
End Get
|
||||
Set(value As String)
|
||||
m_sCALC_MSG = value
|
||||
@@ -456,6 +480,7 @@ Public Class PartM
|
||||
EgtGetInfo(nPartId, BTL_PRT_H, NewPartM.m_dBtlH)
|
||||
EgtGetInfo(nPartId, BTL_PRT_CNT, NewPartM.m_nCNT)
|
||||
EgtGetInfo(nPartId, BTL_PRT_GROUP, NewPartM.m_sGROUP)
|
||||
EgtGetInfo(nPartId, BTL_PRT_STOREY, NewPartM.m_sSTOREY)
|
||||
EgtGetInfo(nPartId, BTL_PRT_MATERIAL, NewPartM.m_sMATERIAL)
|
||||
Dim nTemp As Integer = 0
|
||||
If Not EgtGetInfo(nPartId, BTL_PRT_ROTATED, nTemp) Then
|
||||
|
||||
@@ -162,6 +162,18 @@ Public MustInherit Class PartVM
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property sSTOREY As String
|
||||
Get
|
||||
Return m_PartM.sSTOREY
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property sGROUP As String
|
||||
Get
|
||||
Return m_PartM.sGROUP
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property dVolume As Double
|
||||
Get
|
||||
Return m_PartM.dVolume
|
||||
|
||||
@@ -35,5 +35,5 @@ Imports System.Runtime.InteropServices
|
||||
' by using the '*' as shown below:
|
||||
' <Assembly: AssemblyVersion("1.0.*")>
|
||||
|
||||
<Assembly: AssemblyVersion("2.4.2.1")>
|
||||
<Assembly: AssemblyFileVersion("2.4.2.1")>
|
||||
<Assembly: AssemblyVersion("2.4.3.2")>
|
||||
<Assembly: AssemblyFileVersion("2.4.3.2")>
|
||||
|
||||
@@ -108,7 +108,7 @@ Public MustInherit Class OpenProjectFileDialogVM
|
||||
' ora setto il valore scelto come Tipo Filtro
|
||||
m_SelSearchColumn = value
|
||||
Select Case m_SelSearchColumn.Id
|
||||
Case OpenProjFileColumn.ID, OpenProjFileColumn.BTLFILENAME, OpenProjFileColumn.LISTNAME
|
||||
Case OpenProjFileColumn.ID, OpenProjFileColumn.BTLFILENAME, OpenProjFileColumn.LISTNAME, OpenProjFileColumn.MACHINE
|
||||
SearchText_Visibility = Visibility.Visible
|
||||
SearchDate_Visibility = Visibility.Collapsed
|
||||
Case OpenProjFileColumn.EXPORTDATE, OpenProjFileColumn.CREATEDATE
|
||||
@@ -168,6 +168,7 @@ Public MustInherit Class OpenProjectFileDialogVM
|
||||
LISTNAME = 3
|
||||
EXPORTDATE = 4
|
||||
CREATEDATE = 5
|
||||
MACHINE = 6
|
||||
End Enum
|
||||
|
||||
#Region "Messages"
|
||||
@@ -257,7 +258,8 @@ Public MustInherit Class OpenProjectFileDialogVM
|
||||
New IdNameStruct(OpenProjFileColumn.BTLFILENAME, BTLFileName_Msg),
|
||||
New IdNameStruct(OpenProjFileColumn.LISTNAME, ListName_Msg),
|
||||
New IdNameStruct(OpenProjFileColumn.EXPORTDATE, ExportDate_Msg),
|
||||
New IdNameStruct(OpenProjFileColumn.CREATEDATE, CreateDate_Msg)})
|
||||
New IdNameStruct(OpenProjFileColumn.CREATEDATE, CreateDate_Msg),
|
||||
New IdNameStruct(OpenProjFileColumn.MACHINE, Machine_Msg)})
|
||||
ElseIf ProjectType = ProjectType.PROD Then
|
||||
' carico le colonne della datagrid
|
||||
GetPrivateProfileColumns(S_OPENPROJFILEDLG_PROD, ProjectColumns)
|
||||
@@ -265,7 +267,8 @@ Public MustInherit Class OpenProjectFileDialogVM
|
||||
m_SearchColumnList = New ObservableCollection(Of IdNameStruct)({New IdNameStruct(OpenProjFileColumn.NULL, ""),
|
||||
New IdNameStruct(OpenProjFileColumn.ID, Id_Msg),
|
||||
New IdNameStruct(OpenProjFileColumn.BTLFILENAME, BTLFileName_Msg),
|
||||
New IdNameStruct(OpenProjFileColumn.CREATEDATE, CreateDate_Msg)})
|
||||
New IdNameStruct(OpenProjFileColumn.CREATEDATE, CreateDate_Msg),
|
||||
New IdNameStruct(OpenProjFileColumn.MACHINE, Machine_Msg)})
|
||||
End If
|
||||
' setto la visibilità delle colonne delle EgtDataGrid
|
||||
For Each col In ProjectColumns
|
||||
@@ -300,14 +303,16 @@ Public MustInherit Class OpenProjectFileDialogVM
|
||||
If m_SelSearchColumn.Id <> OpenProjFileColumn.NULL AndAlso m_SearchText <> String.Empty AndAlso (
|
||||
(m_SelSearchColumn.Id = OpenProjFileColumn.ID AndAlso CurrProj.sProjId.ToString.IndexOf(SearchText, StringComparison.InvariantCultureIgnoreCase) < 0) OrElse
|
||||
(m_SelSearchColumn.Id = OpenProjFileColumn.BTLFILENAME AndAlso CurrProj.sBTLFileName.IndexOf(SearchText, StringComparison.InvariantCultureIgnoreCase) < 0) OrElse
|
||||
(m_SelSearchColumn.Id = OpenProjFileColumn.LISTNAME AndAlso CurrProj.sListName.IndexOf(SearchText, StringComparison.InvariantCultureIgnoreCase) < 0)) Then bProjectOk = False
|
||||
(m_SelSearchColumn.Id = OpenProjFileColumn.LISTNAME AndAlso CurrProj.sListName.IndexOf(SearchText, StringComparison.InvariantCultureIgnoreCase) < 0) OrElse
|
||||
(m_SelSearchColumn.Id = OpenProjFileColumn.MACHINE AndAlso CurrProj.sMachine.IndexOf(SearchText, StringComparison.InvariantCultureIgnoreCase) < 0)) Then bProjectOk = False
|
||||
ElseIf m_ProjectType = ProjectType.PROD Then
|
||||
Dim CurrProj As ProdFileVM = DirectCast(Proj, ProdFileVM)
|
||||
If m_SelSearchColumn.Id <> OpenProjFileColumn.NULL AndAlso (
|
||||
(m_SelSearchColumn.Id = OpenProjFileColumn.CREATEDATE AndAlso Not SearchDate.Contains(CurrProj.dtCreateDate.Date))) Then bProjectOk = False
|
||||
If m_SelSearchColumn.Id <> OpenProjFileColumn.NULL AndAlso m_SearchText <> String.Empty AndAlso (
|
||||
(m_SelSearchColumn.Id = OpenProjFileColumn.ID AndAlso CurrProj.sProdId.ToString.IndexOf(SearchText, StringComparison.InvariantCultureIgnoreCase) < 0) OrElse
|
||||
(m_SelSearchColumn.Id = OpenProjFileColumn.BTLFILENAME AndAlso CurrProj.sBTLFileName.IndexOf(SearchText, StringComparison.InvariantCultureIgnoreCase) < 0)) Then bProjectOk = False
|
||||
(m_SelSearchColumn.Id = OpenProjFileColumn.BTLFILENAME AndAlso CurrProj.sBTLFileName.IndexOf(SearchText, StringComparison.InvariantCultureIgnoreCase) < 0) OrElse
|
||||
(m_SelSearchColumn.Id = OpenProjFileColumn.MACHINE AndAlso CurrProj.sMachine.IndexOf(SearchText, StringComparison.InvariantCultureIgnoreCase) < 0)) Then bProjectOk = False
|
||||
End If
|
||||
Return bProjectOk
|
||||
End Function
|
||||
|
||||
@@ -58,6 +58,9 @@ Public Enum StatusMapOpType
|
||||
SupervisorReleaseStop = 11
|
||||
ResetPartStart = 12
|
||||
ResetPartEnd = 13
|
||||
ChangeProdInSupervisorRequest = 14
|
||||
ChangeProdInProdRequest = 15
|
||||
OpenPageInViewOptimRequest = 16
|
||||
End Enum
|
||||
|
||||
Public Enum DimensionType
|
||||
|
||||
@@ -6,6 +6,8 @@ Imports EgtWPFLib5
|
||||
Public Class GridDimension
|
||||
Inherits VMBase
|
||||
|
||||
Private Shared m_SoftwareModActive As Boolean = False
|
||||
|
||||
Private Property m_GridName As String
|
||||
Public Property GridName As String
|
||||
Get
|
||||
@@ -43,7 +45,7 @@ Public Class GridDimension
|
||||
End Get
|
||||
Set(value As GridLength)
|
||||
m_GridLen = value
|
||||
DimensionsIniFile.SaveGridDimensions(GridName, GridDimensions)
|
||||
If Not m_SoftwareModActive Then DimensionsIniFile.SaveGridDimensions(GridName, GridDimensions)
|
||||
End Set
|
||||
End Property
|
||||
|
||||
@@ -64,4 +66,8 @@ Public Class GridDimension
|
||||
m_GridLen = GridLen
|
||||
End Sub
|
||||
|
||||
Public Shared Sub SetSoftwareMod(bActive As Boolean)
|
||||
m_SoftwareModActive = bActive
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
Imports EgtUILib
|
||||
|
||||
Public Module LuaMsgManager
|
||||
|
||||
Public Function MessageFromLuaMsg(LuaMsg As String) As String
|
||||
' verifico se inizia con $$
|
||||
If Not String.IsNullOrWhiteSpace(LuaMsg) AndAlso LuaMsg.Length >= 2 AndAlso LuaMsg.Substring(0, 2) = "$$" Then
|
||||
Dim sMsgArgs() As String = LuaMsg.Substring(2).Split(",")
|
||||
Dim nMsg As Integer = -1
|
||||
If sMsgArgs.Count > 1 AndAlso Integer.TryParse(sMsgArgs(0), nMsg) AndAlso nMsg > 0 Then
|
||||
If sMsgArgs.Count > 1 Then
|
||||
Dim sArgs() As String = sMsgArgs.Skip(1).ToArray()
|
||||
Dim sMsg As String = String.Format(EgtMsg(65000 + nMsg), sArgs)
|
||||
If Not String.IsNullOrWhiteSpace(sMsg) Then
|
||||
Return sMsg
|
||||
Else
|
||||
EgtMsg(65000 + nMsg)
|
||||
End If
|
||||
Else
|
||||
Return EgtMsg(65000 + nMsg)
|
||||
End If
|
||||
Else
|
||||
Return LuaMsg
|
||||
End If
|
||||
Else
|
||||
Return LuaMsg
|
||||
End If
|
||||
End Function
|
||||
|
||||
End Module
|
||||
@@ -1,6 +1,6 @@
|
||||
Imports System.Runtime.InteropServices
|
||||
|
||||
Module ManageWindow
|
||||
Public Module ManageWindow
|
||||
|
||||
|
||||
<DllImport("user32.dll")>
|
||||
@@ -41,7 +41,7 @@ Module ManageWindow
|
||||
Public rcNormalPosition As System.Drawing.Rectangle
|
||||
End Structure
|
||||
|
||||
Friend Sub BringWindowToFront(wdwIntPtr As IntPtr)
|
||||
Public Sub BringWindowToFront(wdwIntPtr As IntPtr)
|
||||
'Dim wdwIntPtr As IntPtr = FindWindow(Nothing, "0016 - EgtBEAMWALL")
|
||||
Dim placement As Windowplacement = New Windowplacement()
|
||||
GetWindowPlacement(wdwIntPtr, placement)
|
||||
@@ -6,92 +6,100 @@ using EgtBEAMWALL.DataLayer.DatabaseModels;
|
||||
|
||||
namespace EgtBEAMWALL.DataLayer.Controllers
|
||||
{
|
||||
public class DbController : IDisposable
|
||||
{
|
||||
#region Private Fields
|
||||
public class DbController : IDisposable
|
||||
{
|
||||
#region Private Fields
|
||||
|
||||
private AdminContext adbCtx;
|
||||
private AdminContext adbCtx;
|
||||
|
||||
#endregion Private Fields
|
||||
#endregion Private Fields
|
||||
|
||||
#region Public Fields
|
||||
#region Public Fields
|
||||
|
||||
/// <summary>
|
||||
/// Singleton gestione
|
||||
/// </summary>
|
||||
public static DbController man = new DbController();
|
||||
/// <summary>
|
||||
/// Singleton gestione
|
||||
/// </summary>
|
||||
public static DbController man = new DbController();
|
||||
|
||||
#endregion Public Fields
|
||||
#endregion Public Fields
|
||||
|
||||
#region Public Constructors
|
||||
#region Public Constructors
|
||||
|
||||
public DbController()
|
||||
{
|
||||
// Initialize database context for ADMIN
|
||||
adbCtx = new AdminContext(DbConfig.ADMIN_CONNECTION_STRING);
|
||||
}
|
||||
public DbController()
|
||||
{
|
||||
// Initialize database context for ADMIN
|
||||
adbCtx = new AdminContext(DbConfig.ADMIN_CONNECTION_STRING);
|
||||
}
|
||||
|
||||
#endregion Public Constructors
|
||||
#endregion Public Constructors
|
||||
|
||||
#region Public Methods
|
||||
#region Public Methods
|
||||
|
||||
public bool checkCreateUser(string username, string pwd)
|
||||
{
|
||||
bool answ = false;
|
||||
// ricerca utente...
|
||||
var numUser = adbCtx
|
||||
.UserList
|
||||
.Where(x => x.User == username)
|
||||
.ToList()
|
||||
.Count;
|
||||
if (numUser > 0)
|
||||
{
|
||||
answ = true;
|
||||
}
|
||||
if (!answ)
|
||||
{
|
||||
// creo utente
|
||||
string sqlCommand = "FLUSH PRIVILEGES;";
|
||||
//string sqlCommand = $"CREATE USER '{username}'@'localhost' IDENTIFIED BY '{pwd}'; GRANT ALL ON *.* TO '{username}'@'localhost'; FLUSH PRIVILEGES;";
|
||||
//string sqlCommand = $"CREATE USER '{username}'@'localhost' IDENTIFIED BY '{pwd}'; GRANT ALL ON *.* TO '{username}'@'localhost'; FLUSH PRIVILEGES;";
|
||||
adbCtx.Database.ExecuteSqlCommand(System.Data.Entity.TransactionalBehavior.DoNotEnsureTransaction, sqlCommand);
|
||||
sqlCommand = $"CREATE USER '{username}'@'localhost' IDENTIFIED BY '{pwd}';";
|
||||
adbCtx.Database.ExecuteSqlCommand(System.Data.Entity.TransactionalBehavior.DoNotEnsureTransaction, sqlCommand);
|
||||
sqlCommand = $"GRANT ALL ON *.* TO '{username}'@'localhost';";
|
||||
adbCtx.Database.ExecuteSqlCommand(System.Data.Entity.TransactionalBehavior.DoNotEnsureTransaction, sqlCommand);
|
||||
sqlCommand = "FLUSH PRIVILEGES;";
|
||||
adbCtx.Database.ExecuteSqlCommand(System.Data.Entity.TransactionalBehavior.DoNotEnsureTransaction, sqlCommand);
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
/// <summary>
|
||||
/// Verifica necessità creazione utente (locale o in rete)
|
||||
/// </summary>
|
||||
/// <param name="username"></param>
|
||||
/// <param name="pwd"></param>
|
||||
/// <param name="isNetwork"></param>
|
||||
/// <returns></returns>
|
||||
public bool checkCreateUser(string username, string pwd, bool isNetwork)
|
||||
{
|
||||
bool answ = false;
|
||||
string domain = isNetwork ? "%" : "localhost";
|
||||
// ricerca utente...
|
||||
var numUser = adbCtx
|
||||
.UserList
|
||||
.Where(x => x.User == username)
|
||||
.ToList()
|
||||
.Count;
|
||||
if (numUser > 0)
|
||||
{
|
||||
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;
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
// Clear database context
|
||||
adbCtx.Dispose();
|
||||
}
|
||||
public void Dispose()
|
||||
{
|
||||
// Clear database context
|
||||
adbCtx.Dispose();
|
||||
}
|
||||
|
||||
public bool ResetDb()
|
||||
{
|
||||
bool answ = false;
|
||||
public bool ResetDb()
|
||||
{
|
||||
bool answ = false;
|
||||
|
||||
try
|
||||
{
|
||||
adbCtx
|
||||
.Database
|
||||
.SqlQuery<int>("CALL stp_ResetDb()");
|
||||
answ = true;
|
||||
try
|
||||
{
|
||||
adbCtx
|
||||
.Database
|
||||
.SqlQuery<int>("CALL stp_ResetDb()");
|
||||
answ = true;
|
||||
|
||||
adbCtx.SaveChanges();
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
Console.WriteLine($"EXCEPTION on ResetDb: {exc}");
|
||||
}
|
||||
adbCtx.SaveChanges();
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
Console.WriteLine($"EXCEPTION on ResetDb: {exc}");
|
||||
}
|
||||
|
||||
return answ;
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
|
||||
#endregion Public Methods
|
||||
}
|
||||
#endregion Public Methods
|
||||
}
|
||||
}
|
||||
@@ -37,6 +37,13 @@ namespace EgtBEAMWALL.DataLayer
|
||||
|
||||
#region Public Methods
|
||||
|
||||
#if false
|
||||
/// <summary>
|
||||
/// Metodo di init standard per DB locale
|
||||
/// </summary>
|
||||
/// <param name="server">Indirizzo del server (tipicamente localhost/127.0.0.1)</param>
|
||||
/// <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)
|
||||
{
|
||||
DATABASE_SERV = server;
|
||||
@@ -46,14 +53,35 @@ namespace EgtBEAMWALL.DataLayer
|
||||
CONNECTION_STRING = $"server={DATABASE_SERV};port=3306;database={DATABASE_NAME};uid={DATABASE_USER};pwd={DATABASE_PWD};sslmode=None";
|
||||
// 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";
|
||||
}
|
||||
#endif
|
||||
|
||||
/// <summary>
|
||||
/// Metodo di init standard per DB in rete con Master_Key
|
||||
/// </summary>
|
||||
/// <param name="server">Indirizzo del server (tipicamente indirizzo di rete)</param>
|
||||
/// <param name="nKey">Numero chiave</param>
|
||||
/// <param name="sKey">Codice/pwd associato a chaive</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 = "")
|
||||
{
|
||||
// se nulla metto amster come nKey...
|
||||
masterKey = string.IsNullOrEmpty(masterKey) ? nKey : masterKey;
|
||||
DATABASE_SERV = server;
|
||||
DATABASE_NAME = $"EgtBwDb_{masterKey}";
|
||||
DATABASE_USER = $"user_{nKey}";
|
||||
DATABASE_PWD = $"pwd_{sKey}";
|
||||
CONNECTION_STRING = $"server={DATABASE_SERV};port=3306;database={DATABASE_NAME};uid={DATABASE_USER};pwd={DATABASE_PWD};sslmode=None";
|
||||
// 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";
|
||||
}
|
||||
|
||||
public static bool CheckUser(string nKey, string sKey)
|
||||
{
|
||||
// esecuzione script di install locale
|
||||
return Controllers.DbController.man.checkCreateUser(DATABASE_USER, DATABASE_PWD);
|
||||
}
|
||||
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);
|
||||
}
|
||||
|
||||
#endregion Public Methods
|
||||
}
|
||||
#endregion Public Methods
|
||||
}
|
||||
}
|
||||
@@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("2.4.2.1")]
|
||||
[assembly: AssemblyFileVersion("2.4.2.1")]
|
||||
[assembly: AssemblyVersion("2.4.3.2")]
|
||||
[assembly: AssemblyFileVersion("2.4.3.2")]
|
||||
|
||||
@@ -101,27 +101,35 @@ Public Class Axis
|
||||
Public ReadOnly Property sValue As String
|
||||
Get
|
||||
Dim nDec As Integer = 0
|
||||
Select Case Type
|
||||
Case AxisTypes.LINEAR
|
||||
nDec = -3
|
||||
Case AxisTypes.ROTATIONAL
|
||||
nDec = -4
|
||||
Case Else
|
||||
nDec = 0
|
||||
End Select
|
||||
If CurrentMachine.NCType = NCTypes.TPA Then
|
||||
nDec = -3
|
||||
Else
|
||||
Select Case Type
|
||||
Case AxisTypes.LINEAR
|
||||
nDec = -3
|
||||
Case AxisTypes.ROTATIONAL
|
||||
nDec = -4
|
||||
Case Else
|
||||
nDec = 0
|
||||
End Select
|
||||
End If
|
||||
Return DoubleToString(m_dValue, nDec)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Friend Sub SetValue(value As Double)
|
||||
Select Case Type
|
||||
Case AxisTypes.LINEAR
|
||||
m_dValue = value / 1000
|
||||
Case AxisTypes.ROTATIONAL
|
||||
m_dValue = value / 10000
|
||||
Case Else
|
||||
m_dValue = value
|
||||
End Select
|
||||
If CurrentMachine.NCType = NCTypes.TPA Then
|
||||
m_dValue = value
|
||||
Else
|
||||
Select Case Type
|
||||
Case AxisTypes.LINEAR
|
||||
m_dValue = value / 1000
|
||||
Case AxisTypes.ROTATIONAL
|
||||
m_dValue = value / 10000
|
||||
Case Else
|
||||
m_dValue = value
|
||||
End Select
|
||||
End If
|
||||
NotifyPropertyChanged(NameOf(sValue))
|
||||
End Sub
|
||||
|
||||
|
||||
@@ -21,6 +21,8 @@ Public Class CALCPanelVM
|
||||
Private m_cmdVerifyAll As ICommand
|
||||
Private m_cmdSimulate As ICommand
|
||||
|
||||
Private m_ProcessResultList As New List(Of Integer)
|
||||
|
||||
#Region "Messages"
|
||||
|
||||
Public ReadOnly Property Verify_ToolTip As String
|
||||
@@ -58,6 +60,7 @@ Public Class CALCPanelVM
|
||||
End Sub
|
||||
|
||||
Private Sub Calc_ProcessResult(sender As Object, e As CalcResultEventArgs)
|
||||
m_ProcessResultList.Add(e.m_Result.nBarId)
|
||||
ProcessResults(e.m_Result)
|
||||
Dim nRawid As Integer = e.m_Result.nBarId
|
||||
If nRawid <= 0 Then Return
|
||||
@@ -71,13 +74,15 @@ Public Class CALCPanelVM
|
||||
End If
|
||||
' ciclo sui pezzi
|
||||
Dim bNotOkFound As Boolean = False
|
||||
For Each MachGroup As MyMachGroupVM In Map.refProjectVM.SupervisorMachGroupPanelVM.MachGroupVMList
|
||||
Dim MachGroupList As List(Of MachGroupVM) = Map.refProjectVM.SupervisorMachGroupPanelVM.MachGroupVMList.Where(Function(x) m_ProcessResultList.Contains(x.Id)).ToList()
|
||||
For Each MachGroup As MyMachGroupVM In MachGroupList
|
||||
' se trovo pezzo errato, resetto tutti i successivi
|
||||
If Not bNotOkFound AndAlso MachGroup.MyMachGroupM.m_nCALC_GlobalState <> CalcStates.OK AndAlso MachGroup.MyMachGroupM.m_nCALC_GlobalState <> CalcStates.INFO Then
|
||||
bNotOkFound = True
|
||||
End If
|
||||
If bNotOkFound Then MachGroup.ResetProduce()
|
||||
Next
|
||||
m_ProcessResultList = New List(Of Integer)
|
||||
Map.refProjectVM.ManageIsEnabled(True)
|
||||
Map.refMyStatusBarVM.ResetStopProgress()
|
||||
End Sub
|
||||
|
||||
@@ -68,7 +68,7 @@ Public Class TPAComm
|
||||
Private m_Proxy_ListInfoEventHandler As New ListInfoEventHandler(AddressOf RemoteObject_ListInfoResponse)
|
||||
Private m_Proxy_RPCUpdateEventHandler As New RPCUpdateEventHandler(AddressOf RemoteObject_RPCUpdate)
|
||||
Private m_Proxy_VariableCommandExecutedEventHandler As New VariableCommandExecutedEventHandler(AddressOf RemoteObject_VariableCommandExecuted)
|
||||
Private m_Proxy_TickUpdateEventHandler As New TickUpdateEventHandler(AddressOf RemoteObject_TickUpdate)
|
||||
'Private m_Proxy_TickUpdateEventHandler As New TickUpdateEventHandler(AddressOf RemoteObject_TickUpdate)
|
||||
Private m_Rem_CommandExecutedEventHandler As CommandExecutedEventHandler
|
||||
Private m_Rem_ServerErrorEventHandler As ServerErrorEventHandler
|
||||
Private m_Rem_AxesCoordinatesUpdateEventHandler As AxesCoordinatesUpdateEventHandler
|
||||
@@ -77,7 +77,7 @@ Public Class TPAComm
|
||||
Private m_Rem_ListInfoEventHandler As ListInfoEventHandler
|
||||
Private m_Rem_RPCUpdateEventHandler As RPCUpdateEventHandler
|
||||
Private m_Rem_VariableCommandExecutedEventHandler As VariableCommandExecutedEventHandler
|
||||
|
||||
'Private m_Rem_TickUpdateEventHandler As TickUpdateEventHandler
|
||||
|
||||
<SecurityPermission(SecurityAction.Demand)>
|
||||
Public Sub New(MachManaging As MachManaging)
|
||||
@@ -110,7 +110,7 @@ Public Class TPAComm
|
||||
AddHandler m_eventProxy.ListInfoResponse, m_Proxy_ListInfoEventHandler
|
||||
AddHandler m_eventProxy.RPCUpdate, m_Proxy_RPCUpdateEventHandler
|
||||
AddHandler m_eventProxy.VariableCommandExecuted, m_Proxy_VariableCommandExecutedEventHandler
|
||||
AddHandler m_eventProxy.TickUpdate, m_Proxy_TickUpdateEventHandler
|
||||
'AddHandler m_eventProxy.TickUpdate, m_Proxy_TickUpdateEventHandler
|
||||
|
||||
_remObject = CType(Activator.GetObject(GetType(ISOCNC.Remoting_Server), serverURI), ISOCNC.Remoting_Server)
|
||||
Try
|
||||
@@ -122,6 +122,7 @@ Public Class TPAComm
|
||||
m_Rem_ListInfoEventHandler = New ListInfoEventHandler(AddressOf m_eventProxy.LocallyHandleListInfo)
|
||||
m_Rem_RPCUpdateEventHandler = New RPCUpdateEventHandler(AddressOf m_eventProxy.LocallyHandleRPCUpdate)
|
||||
m_Rem_VariableCommandExecutedEventHandler = New VariableCommandExecutedEventHandler(AddressOf m_eventProxy.LocallyHandleVariableCommandExecuted)
|
||||
'm_Rem_TickUpdateEventHandler = New TickUpdateEventHandler(AddressOf m_eventProxy.LocallyHandleTickUpdate)
|
||||
AddHandler _remObject.CommandExecuted, m_Rem_CommandExecutedEventHandler
|
||||
AddHandler _remObject.ServerError, m_Rem_ServerErrorEventHandler
|
||||
AddHandler _remObject.AxisCoordinatesUpdate, m_Rem_AxesCoordinatesUpdateEventHandler
|
||||
@@ -130,6 +131,7 @@ Public Class TPAComm
|
||||
AddHandler _remObject.ListInfoResponse, m_Rem_ListInfoEventHandler
|
||||
AddHandler _remObject.RPCUpdate, m_Rem_RPCUpdateEventHandler
|
||||
AddHandler _remObject.VariableCommandExecuted, m_Rem_VariableCommandExecutedEventHandler
|
||||
'AddHandler _remObject.TickUpdate, m_Rem_TickUpdateEventHandler
|
||||
Catch ex As System.Runtime.Remoting.RemotingException
|
||||
Dim dR As MessageBoxResult = MessageBox.Show(ex.Message)
|
||||
End Try
|
||||
@@ -154,9 +156,10 @@ Public Class TPAComm
|
||||
RemoveHandler m_eventProxy.ListInfoResponse, m_Proxy_ListInfoEventHandler
|
||||
RemoveHandler m_eventProxy.RPCUpdate, m_Proxy_RPCUpdateEventHandler
|
||||
RemoveHandler m_eventProxy.VariableCommandExecuted, m_Proxy_VariableCommandExecutedEventHandler
|
||||
RemoveHandler m_eventProxy.TickUpdate, m_Proxy_TickUpdateEventHandler
|
||||
'RemoveHandler m_eventProxy.TickUpdate, m_Proxy_TickUpdateEventHandler
|
||||
End Sub
|
||||
|
||||
|
||||
Private Sub RemoteObject_OpStateUpdate(ByVal newOpState As ISOCNC.Remoting.MachineOperatingState)
|
||||
' resetto stato pending iniziale
|
||||
If Map.refMachManaging.StartPending AndAlso newOpState = MachineOperatingState.Pending Then
|
||||
@@ -239,6 +242,7 @@ Public Class TPAComm
|
||||
End Sub
|
||||
|
||||
Private Sub RemoteObject_TickUpdate(ByVal newTick As ULong)
|
||||
'EgtUILib.EgtOutLog("Tick: " & newTick)
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
|
||||
@@ -503,17 +503,6 @@
|
||||
<Resource Include="Resources\EgtBEAMWALL.ico" />
|
||||
<Resource Include="Resources\TreeView\Folder.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Resource Include="Resources\ProjectManager\DxfOut.png" />
|
||||
<Resource Include="Resources\ProjectManager\Export.png" />
|
||||
<Resource Include="Resources\ProjectManager\Import.png" />
|
||||
<Resource Include="Resources\ProjectManager\New.png" />
|
||||
<Resource Include="Resources\ProjectManager\Open.png" />
|
||||
<Resource Include="Resources\ProjectManager\Options.png" />
|
||||
<Resource Include="Resources\ProjectManager\Save.png" />
|
||||
<Resource Include="Resources\ProjectManager\SaveAs.png" />
|
||||
<Resource Include="Resources\ProjectManager\Send.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Resource Include="Resources\ShowPanel\RenderingHL.png" />
|
||||
<Resource Include="Resources\ShowPanel\RenderingSH.png" />
|
||||
@@ -558,6 +547,15 @@
|
||||
<ItemGroup>
|
||||
<Resource Include="Resources\MDIPage\Send.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Resource Include="Resources\ProjectManager\GoToProd.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Resource Include="Resources\ProjectManager\Open.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Resource Include="Resources\ProjectManager\Save.png" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.VisualBasic.targets" />
|
||||
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
|
||||
<PropertyGroup>
|
||||
|
||||
@@ -16,7 +16,6 @@
|
||||
CanUserAddRows="False"
|
||||
AutoGenerateColumns="False"
|
||||
CanUserSortColumns="False"
|
||||
CanUserResizeColumns="False"
|
||||
CanUserResizeRows="False"
|
||||
CanUserReorderColumns="False"
|
||||
SelectionMode="Single"
|
||||
|
||||
@@ -156,6 +156,18 @@
|
||||
RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:PartInRawPartListV}}}"/>
|
||||
</DataGridTextColumn.Header>
|
||||
</DataGridTextColumn>
|
||||
<!--GRP - Gruppo-->
|
||||
<DataGridTextColumn x:Key="colGROUP" Binding="{Binding sGROUP}">
|
||||
<DataGridTextColumn.Header>
|
||||
<TextBlock Text="{Binding Path=DataContext.GRP_Msg,RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:PartInRawPartListV}}}"/>
|
||||
</DataGridTextColumn.Header>
|
||||
</DataGridTextColumn>
|
||||
<!--STOREY - Sottogruppo-->
|
||||
<DataGridTextColumn x:Key="colSTOREY" Binding="{Binding sSTOREY}">
|
||||
<DataGridTextColumn.Header>
|
||||
<TextBlock Text="{Binding Path=DataContext.STOREY_Msg,RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:PartInRawPartListV}}}"/>
|
||||
</DataGridTextColumn.Header>
|
||||
</DataGridTextColumn>
|
||||
|
||||
</DataGrid.Resources>
|
||||
<DataGrid.RowStyle>
|
||||
|
||||
@@ -113,6 +113,18 @@ Public Class PartInRawPartListVM
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property GRP_Msg As String
|
||||
Get
|
||||
Return EgtMsg(61624)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property STOREY_Msg As String
|
||||
Get
|
||||
Return EgtMsg(61623)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
#End Region ' Messages
|
||||
|
||||
#Region "CONSTRUCTOR"
|
||||
@@ -151,6 +163,9 @@ Public Class PartInRawPartListVM
|
||||
For Each col In PartInRawPartColumns
|
||||
col.ColumnVisibility = If(col.Visible, Visibility.Visible, Visibility.Collapsed)
|
||||
Next
|
||||
If Not IsNothing(colPartInRawPart_Redo) Then
|
||||
colPartInRawPart_Redo.ColumnVisibility = Visibility.Collapsed
|
||||
End If
|
||||
If Not IsNothing(m_colPartInRawPart_Rot) Then
|
||||
m_colPartInRawPart_Rot.ColumnVisibility = Visibility.Collapsed
|
||||
End If
|
||||
@@ -182,6 +197,9 @@ Public Class PartInRawPartListVM
|
||||
For Each col In PartInRawPartColumns
|
||||
col.ColumnVisibility = If(col.Visible, Visibility.Visible, Visibility.Collapsed)
|
||||
Next
|
||||
If Not IsNothing(colPartInRawPart_Redo) Then
|
||||
colPartInRawPart_Redo.ColumnVisibility = Visibility.Collapsed
|
||||
End If
|
||||
If Not IsNothing(m_colPartInRawPart_Offset) Then
|
||||
m_colPartInRawPart_Offset.ColumnVisibility = Visibility.Collapsed
|
||||
End If
|
||||
|
||||
@@ -82,7 +82,7 @@
|
||||
</DataGridTextColumn.Header>
|
||||
</DataGridTextColumn>
|
||||
<!--MAT - Materiale-->
|
||||
<DataGridTextColumn x:Key="colMATERIAL" Binding="{Binding dL}">
|
||||
<DataGridTextColumn x:Key="colMATERIAL" Binding="{Binding sMATERIAL}">
|
||||
<DataGridTextColumn.Header>
|
||||
<TextBlock Text="{Binding Path=DataContext.Material_Msg,
|
||||
RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:RawPartListV}}}"/>
|
||||
|
||||
@@ -410,9 +410,6 @@ Public Class LeftPanelVM
|
||||
m_OPModeList = New List(Of OPState) From {
|
||||
New OPState("Manual", OPModes.Manual)
|
||||
}
|
||||
' imposto stato manuale
|
||||
Dim ManualMode As OPState = m_OPModeList.FirstOrDefault(Function(x) x.Id = OPModes.Manual)
|
||||
SetOPState(ManualMode)
|
||||
Case NCTypes.NUM_FLEXIUM
|
||||
m_OPModeList = New List(Of OPState) From {
|
||||
New OPState("Auto", OPModes.Auto),
|
||||
@@ -494,6 +491,8 @@ Public Class LeftPanelVM
|
||||
Dim Part As PartVM = SelMachGroup.PartVMList(PartIndex)
|
||||
SetDonePart(SelMachGroup, Part)
|
||||
Next
|
||||
' riseleziono il gruppo
|
||||
Map.refSupervisorMachGroupPanelVM.SelectedMachGroup = SelMachGroup
|
||||
' aggiorno bottoni
|
||||
NotifyPropertyChanged(NameOf(DeleteRawPart_IsEnabled))
|
||||
NotifyPropertyChanged(NameOf(DoneRawPart_IsEnabled))
|
||||
@@ -586,32 +585,8 @@ Public Class LeftPanelVM
|
||||
DbControllers.m_MachGroupController.UpdateOrder(Map.refSupervisorManagerVM.CurrProd.nProdId, SelMachGroup.Id, SelMachGroup.nProductionIndex)
|
||||
Map.refProjectVM.SupervisorMachGroupPanelVM.MachGroupVMList.Move(OldIndex, NewIndex - 1)
|
||||
|
||||
|
||||
|
||||
|
||||
'' scrivo tutti pezzi completati
|
||||
'For PartIndex = 0 To SelMachGroup.PartVMList.Count - 1
|
||||
' Dim Part As PartVM = SelMachGroup.PartVMList(PartIndex)
|
||||
' ' reset start, end e stato pezzo
|
||||
' DbControllers.m_PartController.UpdateStart(Map.refSupervisorManagerVM.CurrProd.nProdId, SelMachGroup.Id, Part.nPartId, DateTime.MinValue)
|
||||
' DbControllers.m_PartController.UpdateEnd(Map.refSupervisorManagerVM.CurrProd.nProdId, SelMachGroup.Id, Part.nPartId, DateTime.MinValue)
|
||||
' DbControllers.m_PartController.UpdateStatus(Map.refSupervisorManagerVM.CurrProd.nProdId, SelMachGroup.Id, Part.nPartId, ItemState.ND)
|
||||
' Part.dtStartTime = DateTime.MinValue
|
||||
' Part.dtEndTime = DateTime.MinValue
|
||||
' Part.nProduction_State = ItemState.ND
|
||||
|
||||
' Part.NotifyPropertyChanged(NameOf(Part.Production_Background))
|
||||
'Next
|
||||
'' reset start, end e stato MachGroup
|
||||
'DbControllers.m_MachGroupController.UpdateStart(Map.refSupervisorManagerVM.CurrProd.nProdId, SelMachGroup.Id, Time)
|
||||
'DbControllers.m_MachGroupController.UpdateEnd(Map.refSupervisorManagerVM.CurrProd.nProdId, SelMachGroup.Id, Time)
|
||||
'DbControllers.m_MachGroupController.UpdateStatus(Map.refSupervisorManagerVM.CurrProd.nProdId, SelMachGroup.Id, ItemState.WIP)
|
||||
'SelMachGroup.dtStartTime = DateTime.MinValue
|
||||
'SelMachGroup.dtEndTime = DateTime.MinValue
|
||||
'SelMachGroup.nProduction_State = ItemState.ND
|
||||
'SelMachGroup.NotifyPropertyChanged(NameOf(SelMachGroup.Production_Background))
|
||||
'SelMachGroup.NotifyPropertyChanged(NameOf(SelMachGroup.Produce_IsEnabled))
|
||||
|
||||
' riseleziono il gruppo
|
||||
Map.refSupervisorMachGroupPanelVM.SelectedMachGroup = SelMachGroup
|
||||
' aggiorno bottoni
|
||||
NotifyPropertyChanged(NameOf(DeleteRawPart_IsEnabled))
|
||||
NotifyPropertyChanged(NameOf(DoneRawPart_IsEnabled))
|
||||
@@ -709,10 +684,15 @@ Public Class LeftPanelVM
|
||||
For Each Part In SelMachGroup.PartVMList
|
||||
DbControllers.m_PartController.UpdateStatus(Map.refSupervisorManagerVM.CurrProd.nProdId, SelMachGroup.Id, Part.nPartId, ItemState.ND)
|
||||
Next
|
||||
Dim nRemovedIndex As Integer = Map.refProjectVM.SupervisorMachGroupPanelVM.MachGroupVMList.IndexOf(SelMachGroup)
|
||||
' se rimozione da Db ok, lo rimuovo da lista
|
||||
Map.refProjectVM.SupervisorMachGroupPanelVM.MachGroupVMList.Remove(SelMachGroup)
|
||||
If Map.refProjectVM.SupervisorMachGroupPanelVM.MachGroupVMList.Count = 0 Then
|
||||
EgtResetCurrMachGroup()
|
||||
ManageBTLParts.HideAll()
|
||||
Else
|
||||
If nRemovedIndex >= Map.refProjectVM.SupervisorMachGroupPanelVM.MachGroupVMList.Count Then nRemovedIndex = Map.refProjectVM.SupervisorMachGroupPanelVM.MachGroupVMList.Count - 1
|
||||
Map.refProjectVM.SupervisorMachGroupPanelVM.SelectedMachGroup = Map.refProjectVM.SupervisorMachGroupPanelVM.MachGroupVMList(nRemovedIndex)
|
||||
End If
|
||||
End If
|
||||
End Sub
|
||||
|
||||
@@ -521,6 +521,9 @@ Public Class MachCommandMessagePanelVM
|
||||
_Connected = True
|
||||
NotifyPropertyChanged(NameOf(Connect_Background))
|
||||
If ResultType = ResultTypes.EXECUTED Then
|
||||
' avvio tick di comunicazione con la macchina
|
||||
MachineCommThread.StartTick()
|
||||
' inizializzo variabili
|
||||
Init()
|
||||
End If
|
||||
End If
|
||||
@@ -549,9 +552,9 @@ Public Class MachCommandMessagePanelVM
|
||||
Select Case AlarmType
|
||||
Case CInt(ISOCNC.Remoting.AlarmType.Cycle)
|
||||
If AlarmOperation = CInt(ISOCNC.Remoting.AlarmOperation.Addition) Then
|
||||
m_ErrCycle.Add(Alarm.CreateAlarm(AlarmCode, AlarmMessage))
|
||||
m_Iso.Add(Alarm.CreateAlarm(AlarmCode, AlarmMessage))
|
||||
Else
|
||||
m_ErrCycle.RemoveAll(Function(x) x.sCode = AlarmCode)
|
||||
m_Iso.RemoveAll(Function(x) x.sCode = AlarmCode)
|
||||
'Dim ToRemove As Alarm = m_ErrCycle.FirstOrDefault(Function(x) x.sCode = AlarmCode)
|
||||
'If Not IsNothing(ToRemove) Then
|
||||
' m_ErrCycle.Remove(ToRemove)
|
||||
@@ -559,9 +562,9 @@ Public Class MachCommandMessagePanelVM
|
||||
End If
|
||||
Case CInt(ISOCNC.Remoting.AlarmType.ISO)
|
||||
If AlarmOperation = CInt(ISOCNC.Remoting.AlarmOperation.Addition) Then
|
||||
m_Iso.Add(Alarm.CreateAlarm(AlarmCode, AlarmMessage))
|
||||
m_ErrSystem.Add(Alarm.CreateAlarm(AlarmCode, AlarmMessage))
|
||||
Else
|
||||
m_Iso.RemoveAll(Function(x) x.sCode = AlarmCode)
|
||||
m_ErrSystem.RemoveAll(Function(x) x.sCode = AlarmCode)
|
||||
'Dim ToRemove As Alarm = m_Iso.FirstOrDefault(Function(x) x.sCode = AlarmCode)
|
||||
'If Not IsNothing(ToRemove) Then
|
||||
' m_Iso.Remove(ToRemove)
|
||||
@@ -580,9 +583,9 @@ Public Class MachCommandMessagePanelVM
|
||||
Case CInt(ISOCNC.Remoting.AlarmType.None)
|
||||
Case CInt(ISOCNC.Remoting.AlarmType.System)
|
||||
If AlarmOperation = CInt(ISOCNC.Remoting.AlarmOperation.Addition) Then
|
||||
m_ErrSystem.Add(Alarm.CreateAlarm(AlarmCode, AlarmMessage))
|
||||
m_ErrCycle.Add(Alarm.CreateAlarm(AlarmCode, AlarmMessage))
|
||||
Else
|
||||
m_ErrSystem.RemoveAll(Function(x) x.sCode = AlarmCode)
|
||||
m_ErrCycle.RemoveAll(Function(x) x.sCode = AlarmCode)
|
||||
'Dim ToRemove As Alarm = m_ErrSystem.FirstOrDefault(Function(x) x.sCode = AlarmCode)
|
||||
'If Not IsNothing(ToRemove) Then
|
||||
' m_ErrSystem.Remove(ToRemove)
|
||||
|
||||
@@ -124,7 +124,19 @@ Public Class MyMachGroupVM
|
||||
End Sub
|
||||
|
||||
Public Overrides Sub RefreshPartList()
|
||||
|
||||
If nType = BWType.BEAM Then
|
||||
' leggo StartCut da posizione primo pezzo
|
||||
Dim sInfo As String = ""
|
||||
Dim sSplitInfo() As String
|
||||
Dim bFound As Boolean = False
|
||||
EgtGetInfo(Id, MGR_RPT_PART & 1, sInfo)
|
||||
If Not String.IsNullOrWhiteSpace(sInfo) Then
|
||||
sSplitInfo = sInfo.Split(","c)
|
||||
StringToDouble(sSplitInfo(1), MyMachGroupM.dStartCut)
|
||||
Else
|
||||
MyMachGroupM.dStartCut = 0
|
||||
End If
|
||||
End If
|
||||
End Sub
|
||||
|
||||
#End Region ' Parts
|
||||
@@ -356,7 +368,7 @@ Public Class MyMachGroupVM
|
||||
EgtBeamEnableProcess(Feature.nFeatureId, bOk)
|
||||
Next
|
||||
' scrivo dati costruzione grezzo in gruppo di lavorazione
|
||||
EgtSetInfo(nCurrMachGroup, MGR_RPT_PART & nDone, nPartDuploId & "," & CurrPart.sPOSX - dInitialCutOut)
|
||||
EgtSetInfo(nCurrMachGroup, MGR_RPT_PART & nDone, nPartDuploId & "," & DoubleToString(CurrPart.dPOSX - dInitialCutOut, 3))
|
||||
Else
|
||||
dInitialCutOut += CurrPart.dOffset + CurrPart.dL
|
||||
End If
|
||||
|
||||
@@ -32,6 +32,15 @@ Public Class PartVM
|
||||
NotifyPropertyChanged(NameOf(bDO))
|
||||
End Sub
|
||||
|
||||
Public Property bFLIP As Boolean
|
||||
Get
|
||||
Return m_PartM.nFLIP <> 0
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
Return
|
||||
End Set
|
||||
End Property
|
||||
|
||||
#End Region ' Supervisor
|
||||
|
||||
#End Region ' FIELDS & PROPERTIES
|
||||
|
||||
@@ -12,6 +12,9 @@ Public Class SupervisorMachGroupPanelVM
|
||||
|
||||
#Region "FIELDS & PROPERTIES"
|
||||
|
||||
Private m_ReloadProj_Timer As New DispatcherTimer
|
||||
Private m_bReloadProj As Boolean = False
|
||||
|
||||
' lock per aggiunta elemento a lista MachGroup
|
||||
Private m_Lock_AddMachGroup As New Object
|
||||
|
||||
@@ -37,8 +40,8 @@ Public Class SupervisorMachGroupPanelVM
|
||||
Map.SetRefSupervisorMachGroupPanelVM(Me)
|
||||
BindingOperations.EnableCollectionSynchronization(m_MachGroupVMList, m_Lock_AddMachGroup)
|
||||
m_ReloadProj_Timer.Interval = TimeSpan.FromMilliseconds(500)
|
||||
m_ReloadProj_Timer.Start()
|
||||
AddHandler m_ReloadProj_Timer.Tick, AddressOf ReloadProject_Tick
|
||||
m_ReloadProj_Timer.Start()
|
||||
End Sub
|
||||
|
||||
#End Region ' CONSTRUCTOR
|
||||
@@ -56,9 +59,6 @@ Public Class SupervisorMachGroupPanelVM
|
||||
MachGroup.NotifyPropertyChanged(NameOf(MachGroup.Produce_IsEnabled))
|
||||
End Sub
|
||||
|
||||
Private m_bReloadProj As Boolean = False
|
||||
Private m_ReloadProj_Timer As New DispatcherTimer
|
||||
|
||||
Public Sub ReloadProjectFile()
|
||||
m_bReloadProj = True
|
||||
End Sub
|
||||
|
||||
@@ -403,6 +403,14 @@ Public Class MachManaging
|
||||
Part.NotifyPropertyChanged(NameOf(Part.nProduction_State))
|
||||
' resetto stato redo
|
||||
Part.bRedo = False
|
||||
' se non impostata data start
|
||||
If Part.dtStartTime = DateTime.MinValue Then
|
||||
' scrivo data start su Db pezzo
|
||||
Dim dtStart As DateTime = Part.dtEndTime - TimeSpan.FromSeconds(60)
|
||||
DbControllers.m_PartController.UpdateStart(nP_Prod, nP_Machgroup, Part.nPartId, dtStart)
|
||||
Part.dtStartTime = dtStart
|
||||
End If
|
||||
|
||||
Next
|
||||
Else
|
||||
' scrivo data end su Db pezzo
|
||||
@@ -417,12 +425,6 @@ Public Class MachManaging
|
||||
' resetto stato redo
|
||||
Part.bRedo = False
|
||||
End If
|
||||
'Select Case CurrentMachine.NCType
|
||||
' Case NCTypes.TPA
|
||||
' Tpa.RWVariableManager.WriteVar(P_STATE, 0)
|
||||
' Case NCTypes.NUM_FLEXIUM
|
||||
' StateVariable.sValue = "0"
|
||||
'End Select
|
||||
|
||||
' se tutti i pezzi della barra sono in end
|
||||
If MachGroup.PartVMList.All(Function(x) x.nProduction_State >= 2) Then
|
||||
@@ -438,15 +440,24 @@ Public Class MachManaging
|
||||
MachGroupVariable.sValue = "0"
|
||||
PartVariable.sValue = "0"
|
||||
StateVariable.sValue = "0"
|
||||
' azzero variabile per far ripartire macchina
|
||||
'Select Case CurrentMachine.NCType
|
||||
' 'Case NCTypes.TPA
|
||||
' ' Tpa.RWVariableManager.WriteVar(P_PROD, 0)
|
||||
' ' Tpa.RWVariableManager.WriteVar(P_MACHGROUP, 0)
|
||||
' ' Tpa.RWVariableManager.WriteVar(P_PART, 0)
|
||||
' ' Tpa.RWVariableManager.WriteVar(P_STATE, 0)
|
||||
'End Select
|
||||
|
||||
' se non impostata data start
|
||||
If MachGroup.dtStartTime = DateTime.MinValue Then
|
||||
EgtOutLog("Start date not set on Prod " & nP_Prod & " Machgroup " & nP_Machgroup)
|
||||
Dim dtStart As DateTime = MachGroup.dtEndTime - TimeSpan.FromSeconds(60)
|
||||
' provo a recuperare tempo stimato
|
||||
If MachGroup.nCALC_TIME > 0 Then
|
||||
Dim MinPartStart As DateTime = MachGroup.PartVMList.Min(Function(x) x.dtStartTime)
|
||||
If MinPartStart > DateTime.MinValue Then
|
||||
dtStart = New DateTime(Math.Min((MachGroup.dtEndTime - TimeSpan.FromSeconds(MachGroup.nCALC_TIME)).Ticks, MinPartStart.Ticks))
|
||||
Else
|
||||
dtStart = MachGroup.dtEndTime - TimeSpan.FromSeconds(MachGroup.nCALC_TIME)
|
||||
End If
|
||||
End If
|
||||
' scrivo data start su Db barra
|
||||
DbControllers.m_MachGroupController.UpdateStart(nP_Prod, nP_Machgroup, dtStart)
|
||||
MachGroup.dtStartTime = dtStart
|
||||
End If
|
||||
' resetto stati di produzione
|
||||
MachGroup.ResetProduce()
|
||||
' se partenza pezzi uno a uno
|
||||
@@ -605,6 +616,9 @@ Public Class MachManaging
|
||||
m_CN = New TPAComm(Me)
|
||||
m_bConnected = Tpa.remObject.OnConnect()
|
||||
m_ResultCallbackDlg(CommandTypes.CONNECT, CommandStates.OK, ResultTypes.EXECUTED, "")
|
||||
' imposto stato manuale
|
||||
Dim ManualMode As OPState = Map.refLeftPanelVM.OPModeList.FirstOrDefault(Function(x) x.Id = OPModes.Manual)
|
||||
Map.refLeftPanelVM.SetOPMode(ManualMode)
|
||||
' creo classe di gestione variabili
|
||||
Catch ex As Exception
|
||||
m_ResultCallbackDlg(CommandTypes.CONNECT, CommandStates.ERROR_, ResultTypes.EXECUTED, "Errore: impossibile connettersi!")
|
||||
|
||||
@@ -4,10 +4,14 @@ Class MachineCommThread
|
||||
|
||||
' variabile che ferma il ciclo
|
||||
Private Shared m_Stop As Boolean = False
|
||||
Private Shared m_StartTick As Boolean = False
|
||||
|
||||
Friend Shared Sub StopThread()
|
||||
m_Stop = True
|
||||
End Sub
|
||||
Friend Shared Sub StartTick()
|
||||
m_StartTick = True
|
||||
End Sub
|
||||
|
||||
' variabile in cui ci sono stati inizio e fine pezzo
|
||||
Private Shared sP1VarName As String = "0.FUNM.E81295"
|
||||
@@ -37,7 +41,9 @@ Class MachineCommThread
|
||||
|
||||
While Not m_Stop
|
||||
' eseguo ciclo principale che tiene vivo il thread
|
||||
m_MachManaging.Timer_Tick()
|
||||
If m_StartTick Then
|
||||
m_MachManaging.Timer_Tick()
|
||||
End If
|
||||
Threading.Thread.Sleep(TimeSpan.FromMilliseconds(1000))
|
||||
End While
|
||||
|
||||
|
||||
@@ -6,14 +6,22 @@
|
||||
|
||||
<!--Barra superiore dei comandi-->
|
||||
<UniformGrid Rows="1">
|
||||
<Button Content="{Binding Viewer_Msg}"
|
||||
Command="{Binding Viewer_Command}"
|
||||
Style="{StaticResource MainMenu_Button}"/>
|
||||
<Button Content="{Binding Optimizer_Msg}"
|
||||
Command="{Binding Optimizer_Command}"
|
||||
Style="{StaticResource MainMenu_Button}"/>
|
||||
<RadioButton Content="{Binding Supervisor_Msg}"
|
||||
IsChecked="{Binding Supervisor_IsChecked}"
|
||||
Style="{StaticResource MainMenu_ToggleButton}"/>
|
||||
<RadioButton Content="{Binding Inputs_Msg}"
|
||||
IsChecked="{Binding Inputs_IsChecked}"
|
||||
Visibility="{Binding Inputs_Visibility}"
|
||||
Style="{StaticResource MainMenu_ToggleButton}"/>
|
||||
<RadioButton Content="{Binding Outputs_Msg}"
|
||||
IsChecked="{Binding Outputs_IsChecked}"
|
||||
Visibility="{Binding Outputs_Visibility}"
|
||||
Style="{StaticResource MainMenu_ToggleButton}"/>
|
||||
<RadioButton Content="{Binding Configuration_Msg}"
|
||||
IsChecked="{Binding Config_IsChecked}"
|
||||
|
||||
@@ -53,6 +53,20 @@ Public Class MainMenuVM
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_Inputs_Visibility As Visibility
|
||||
Public ReadOnly Property Inputs_Visibility As Visibility
|
||||
Get
|
||||
Return m_Inputs_Visibility
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_Outputs_Visibility As Visibility
|
||||
Public ReadOnly Property Outputs_Visibility As Visibility
|
||||
Get
|
||||
Return m_Outputs_Visibility
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_SelPage As Integer = -1
|
||||
Public Property SelPage As Integer
|
||||
Get
|
||||
@@ -106,9 +120,9 @@ Public Class MainMenuVM
|
||||
|
||||
#Region "Messages"
|
||||
|
||||
Public ReadOnly Property Supervisor_Msg As String
|
||||
Public ReadOnly Property Viewer_Msg As String
|
||||
Get
|
||||
Return EgtMsg(62500)
|
||||
Return EgtMsg(61830)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
@@ -118,6 +132,12 @@ Public Class MainMenuVM
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property Supervisor_Msg As String
|
||||
Get
|
||||
Return EgtMsg(62500)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property Configuration_Msg As String
|
||||
Get
|
||||
Return EgtMsg(61832)
|
||||
@@ -138,6 +158,10 @@ Public Class MainMenuVM
|
||||
|
||||
#End Region ' Messages
|
||||
|
||||
' Definizione comandi
|
||||
Private m_cmdViewer As ICommand
|
||||
Private m_cmdOptimizer As ICommand
|
||||
|
||||
#End Region ' Fields & Properties
|
||||
|
||||
#Region "CONSTRUCTOR"
|
||||
@@ -151,6 +175,13 @@ Public Class MainMenuVM
|
||||
|
||||
#Region "METHODS"
|
||||
|
||||
Friend Sub SetInputOutputVisibility()
|
||||
If CurrentMachine.NCType = NCTypes.TPA Then
|
||||
m_Inputs_Visibility = Visibility.Collapsed
|
||||
m_Outputs_Visibility = Visibility.Collapsed
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Friend Sub SetMainMenuIsEnabled(bIsEnabled As Boolean)
|
||||
m_MainMenu_IsEnabled = bIsEnabled
|
||||
NotifyPropertyChanged(NameOf(MainMenu_IsEnabled))
|
||||
@@ -276,4 +307,76 @@ Public Class MainMenuVM
|
||||
|
||||
#End Region ' METHODS
|
||||
|
||||
#Region "COMMANDS"
|
||||
|
||||
#Region "Viewer"
|
||||
|
||||
Public ReadOnly Property Viewer_Command As ICommand
|
||||
Get
|
||||
If m_cmdViewer Is Nothing Then
|
||||
m_cmdViewer = New Command(AddressOf Viewer)
|
||||
End If
|
||||
Return m_cmdViewer
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public Sub Viewer()
|
||||
Dim sViewerOptimizerName As String = "EgtBEAMWALL.ViewerOptimizerR32"
|
||||
' recupero processo del supervisore
|
||||
Dim localProc As Process() = Process.GetProcessesByName(sViewerOptimizerName)
|
||||
If localProc.Length > 0 Then
|
||||
For Each p As Process In localProc
|
||||
' porto in primo piano il ViewerOptimizer
|
||||
BringWindowToFront(p.MainWindowHandle)
|
||||
DbControllers.m_StatusMapController.UpdateAction(DbControllers.m_SupervisorId, Map.refSupervisorManagerVM.CurrProd.nProdId, -Pages.VIEW, StatusMapItemType.Comm, StatusMapOpType.OpenPageInViewOptimRequest, "")
|
||||
Exit For
|
||||
Next
|
||||
Else
|
||||
Dim sViewerOptimizerPath As String = Path.GetDirectoryName(System.AppDomain.CurrentDomain.BaseDirectory) & "\" & sViewerOptimizerName & ".exe"
|
||||
Try
|
||||
Process.Start(sViewerOptimizerPath, "2 " & Pages.VIEW)
|
||||
Catch ex As Exception
|
||||
EgtOutLog("Error: impossible starting vieweroptimizer from path " & sViewerOptimizerPath)
|
||||
End Try
|
||||
End If
|
||||
End Sub
|
||||
|
||||
#End Region ' Viewer
|
||||
|
||||
#Region "Optimizer"
|
||||
|
||||
Public ReadOnly Property Optimizer_Command As ICommand
|
||||
Get
|
||||
If m_cmdOptimizer Is Nothing Then
|
||||
m_cmdOptimizer = New Command(AddressOf Optimizer)
|
||||
End If
|
||||
Return m_cmdOptimizer
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public Sub Optimizer()
|
||||
Dim sViewerOptimizerName As String = "EgtBEAMWALL.ViewerOptimizerR32"
|
||||
' recupero processo del supervisore
|
||||
Dim localProc As Process() = Process.GetProcessesByName(sViewerOptimizerName)
|
||||
If localProc.Length > 0 Then
|
||||
For Each p As Process In localProc
|
||||
' porto in primo piano il ViewerOptimizer
|
||||
BringWindowToFront(p.MainWindowHandle)
|
||||
DbControllers.m_StatusMapController.UpdateAction(DbControllers.m_SupervisorId, Map.refSupervisorManagerVM.CurrProd.nProdId, -Pages.MACHINING, StatusMapItemType.Comm, StatusMapOpType.OpenPageInViewOptimRequest, "")
|
||||
Exit For
|
||||
Next
|
||||
Else
|
||||
Dim sViewerOptimizerPath As String = Path.GetDirectoryName(System.AppDomain.CurrentDomain.BaseDirectory) & "\" & sViewerOptimizerName & ".exe"
|
||||
Try
|
||||
Process.Start(sViewerOptimizerPath, "2 " & Pages.MACHINING)
|
||||
Catch ex As Exception
|
||||
EgtOutLog("Error: impossible starting vieweroptimizer from path " & sViewerOptimizerPath)
|
||||
End Try
|
||||
End If
|
||||
End Sub
|
||||
|
||||
#End Region ' Optimizer
|
||||
|
||||
#End Region ' COMMANDS
|
||||
|
||||
End Class
|
||||
@@ -229,8 +229,8 @@ Public Class MainWindowM
|
||||
' Verifico abilitazione nesting automatico
|
||||
m_bAutoNestOption = Not String.IsNullOrWhiteSpace(sNestKey)
|
||||
' Recupero livello e opzioni della chiave
|
||||
Dim bKey As Boolean = EgtGetKeyLevel(5327, 2402, 1, m_nKeyLevel) And
|
||||
EgtGetKeyOptions(5327, 2402, 1, m_nKeyOptions)
|
||||
Dim bKey As Boolean = EgtGetKeyLevel(5327, 2403, 1, m_nKeyLevel) And
|
||||
EgtGetKeyOptions(5327, 2403, 1, m_nKeyOptions)
|
||||
' Inizializzazione generale di EgtInterface
|
||||
m_nDebug = GetMainPrivateProfileInt(S_GENERAL, K_DEBUG, 0)
|
||||
m_sLogFile = m_sTempDir & "\" & SUPGENLOG_FILE_NAME.Replace("#", m_nInstance.ToString())
|
||||
|
||||
@@ -101,25 +101,35 @@ Public Class MainWindowVM
|
||||
' apro in modalita' VIEW
|
||||
' Map.refMainMenuVM.SelPage = Pages.VIEW
|
||||
|
||||
' setto il primo file dalla lista degli MRU come prod corrente da aprire
|
||||
Dim sLastProdPath As String = String.Empty
|
||||
GetMainPrivateProfileString(S_MRUSUPERVISORPRODFILES, K_FILE & "1", String.Empty, sLastProdPath)
|
||||
If Not String.IsNullOrWhiteSpace(sLastProdPath) AndAlso File.Exists(sLastProdPath) Then
|
||||
' ricavo l'Id e il prod associato per l'apertura di quest'ultimo
|
||||
Dim PdId As Integer = 0
|
||||
Dim sPdId As String = Path.GetFileNameWithoutExtension(sLastProdPath)
|
||||
Integer.TryParse(sPdId, PdId)
|
||||
Map.refSupervisorManagerVM.SetCurrProd(PdId)
|
||||
' apro prod
|
||||
If Not IsNothing(Map.refSupervisorManagerVM.CurrProd) Then Map.refSupervisorManagerVM.OpenProject(Map.refSupervisorManagerVM.CurrProd)
|
||||
End If
|
||||
' imposto MainWindow per finestra di Loading
|
||||
LoadingWndHelper.SetMainWindow(Application.Current.MainWindow)
|
||||
|
||||
|
||||
' leggo riga di comando
|
||||
Dim nCommandType As Integer = 0
|
||||
Dim nPage As Pages = Pages.VIEW
|
||||
Dim nProdId As Integer = 0
|
||||
If ProcessCommandLine(nCommandType, nProdId) AndAlso nCommandType = 1 Then
|
||||
Map.refSupervisorManagerVM.SetCurrProd(nProdId)
|
||||
Else
|
||||
' setto il primo file dalla lista degli MRU come progetto corrente da aprire
|
||||
Dim sLastProdPath As String = String.Empty
|
||||
GetMainPrivateProfileString(S_MRUSUPERVISORPRODFILES, K_FILE & "1", String.Empty, sLastProdPath)
|
||||
If Not String.IsNullOrWhiteSpace(sLastProdPath) AndAlso File.Exists(sLastProdPath) Then
|
||||
' ricavo l'Id e il prod associato per l'apertura di quest'ultimo
|
||||
Dim PdId As Integer = 0
|
||||
Dim sPdId As String = Path.GetFileNameWithoutExtension(sLastProdPath)
|
||||
Integer.TryParse(sPdId, PdId)
|
||||
Map.refSupervisorManagerVM.SetCurrProd(PdId)
|
||||
End If
|
||||
End If
|
||||
' apro prod
|
||||
If Not IsNothing(Map.refSupervisorManagerVM.CurrProd) Then Map.refSupervisorManagerVM.OpenProject(Map.refSupervisorManagerVM.CurrProd)
|
||||
' apro in modalita' SUPERVISOR
|
||||
Map.refMainMenuVM.SelPage = Pages.SUPERVISOR
|
||||
|
||||
Map.refLeftPanelVM.NotifyPropertyChanged(NameOf(Map.refLeftPanelVM.FeatureList_Visibility))
|
||||
|
||||
|
||||
' inizializzo thread di aggiornamento e comunicazione con DB
|
||||
' creo thread gestione macchina
|
||||
m_ViewerOptimizerCommThread = New Thread(Sub()
|
||||
@@ -128,10 +138,23 @@ Public Class MainWindowVM
|
||||
m_ViewerOptimizerCommThread.SetApartmentState(ApartmentState.STA)
|
||||
' avvio thread di gestione della macchina che avvia la connessione
|
||||
m_ViewerOptimizerCommThread.Start()
|
||||
|
||||
|
||||
End Sub
|
||||
|
||||
Friend Function ProcessCommandLine(ByRef nCommandType As Integer, ByRef nProdId As Integer) As Boolean
|
||||
' Se non ci sono veri parametri su linea di comando, esco (il primo è sempre il nome del programma)
|
||||
If Environment.GetCommandLineArgs.Count() <= 1 Then Return False
|
||||
' Recupero primo parametro che dovrebbe essere il tipo di modalita' riga di comando
|
||||
Dim sFile As String = Environment.GetCommandLineArgs(1)
|
||||
If String.IsNullOrWhiteSpace(sFile) OrElse Not Integer.TryParse(sFile, nCommandType) OrElse nCommandType <= 0 Then Return False
|
||||
Select Case nCommandType
|
||||
Case 1 ' apri progetto in supervisore
|
||||
' recupero secondo parametro
|
||||
Dim sProdId As String = Environment.GetCommandLineArgs(2)
|
||||
If Not Integer.TryParse(sProdId, nProdId) OrElse nProdId <= 0 Then Return False
|
||||
Return True
|
||||
End Select
|
||||
End Function
|
||||
|
||||
Friend Sub KeyDown(PressedKey As Key)
|
||||
' Con ESC esco dall'azione corrente
|
||||
If PressedKey = Key.Escape Then
|
||||
|
||||
@@ -55,5 +55,5 @@ Imports System.Windows
|
||||
' by using the '*' as shown below:
|
||||
' <Assembly: AssemblyVersion("1.0.*")>
|
||||
|
||||
<Assembly: AssemblyVersion("2.4.2.1")>
|
||||
<Assembly: AssemblyFileVersion("2.4.2.1")>
|
||||
<Assembly: AssemblyVersion("2.4.3.2")>
|
||||
<Assembly: AssemblyFileVersion("2.4.3.2")>
|
||||
|
||||
@@ -25,7 +25,7 @@ Public Class OutputsPageVM
|
||||
Sub New()
|
||||
'' imposto riferimento in Map
|
||||
'Map.SetRefOutputsPageVM(Me)
|
||||
m_OutputVariableListVM = New VariablesListVM(S_outPUTVARIABLES)
|
||||
m_OutputVariableListVM = New VariablesListVM(S_OUTPUTVARIABLES)
|
||||
End Sub
|
||||
|
||||
#End Region ' Constructor
|
||||
|
||||
|
Before Width: | Height: | Size: 1002 B |
|
Before Width: | Height: | Size: 1.8 KiB |
|
After Width: | Height: | Size: 622 B |
|
Before Width: | Height: | Size: 671 B |
|
Before Width: | Height: | Size: 538 B |
|
Before Width: | Height: | Size: 2.3 KiB |
|
Before Width: | Height: | Size: 951 B |
|
Before Width: | Height: | Size: 1.0 KiB |
@@ -235,6 +235,7 @@ Public Class MySceneHostVM
|
||||
Private Sub OnOpenProject(sender As Object, sFile As String, bOk As Boolean)
|
||||
' Procedo a seconda del risultato
|
||||
If bOk Then
|
||||
LoadingWndHelper.UpdateLoadingWnd(ActiveIds.OPENPROD, 2, EgtMsg(63003), 50, 70) ' Loading machining groups
|
||||
' leggo MachGroup
|
||||
Map.refProjectVM.ProdMachGroupPanelVM = New MyMachGroupPanelVM(MyMachGroupPanelM.CreateMyMachGroupPanel(Map.refMachinePanelVM.MachineList.ToList()))
|
||||
WriteMainPrivateProfileString(S_GENERAL, K_LASTPROJ, sFile)
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
IsRightDockable="False"
|
||||
IsEnabled="{Binding SupervisorManager_IsEnabled}"
|
||||
Style="{StaticResource ToolBar_EgtFloatingPanel}">
|
||||
|
||||
|
||||
<!--Barra superiore dei comandi-->
|
||||
<Button Command="{Binding OpenCommand}"
|
||||
ToolTip="{Binding OpenToolTip}"
|
||||
@@ -14,49 +14,23 @@
|
||||
Tag="{Binding}"
|
||||
Style="{StaticResource ToolBar_Button}">
|
||||
<Button.ContextMenu>
|
||||
<ContextMenu ItemsSource="{Binding MruFileNames}">
|
||||
<ContextMenu.Resources>
|
||||
<Style TargetType="{x:Type MenuItem}">
|
||||
<Setter Property="Command"
|
||||
<ContextMenu ItemsSource="{Binding MruFileNames}">
|
||||
<ContextMenu.Resources>
|
||||
<Style TargetType="{x:Type MenuItem}">
|
||||
<Setter Property="Command"
|
||||
Value="{Binding PlacementTarget.Tag.OpenMruFileCommand, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=ContextMenu}}" />
|
||||
<Setter Property="CommandParameter" Value="{Binding}" />
|
||||
</Style>
|
||||
</ContextMenu.Resources>
|
||||
</ContextMenu>
|
||||
<Setter Property="CommandParameter" Value="{Binding}" />
|
||||
</Style>
|
||||
</ContextMenu.Resources>
|
||||
</ContextMenu>
|
||||
</Button.ContextMenu>
|
||||
<Image Source="/Resources/ProjectManager/Open.png" Stretch="Uniform"/>
|
||||
</Button>
|
||||
<!--<Button Command="{Binding SaveCommand}"
|
||||
ToolTip="{Binding SaveToolTip}"
|
||||
<Button Command="{Binding GoToProd_Command}"
|
||||
ToolTip="{Binding GoToProd_ToolTip}"
|
||||
Style="{StaticResource ToolBar_Button}">
|
||||
<Image Source="/Resources/ProjectManager/Save.png" Stretch="Uniform"/>
|
||||
<Image Source="/Resources/ProjectManager/GoToProd.png" Stretch="Uniform"/>
|
||||
</Button>
|
||||
--><!--<Button Command="{Binding SaveAsCommand}"
|
||||
ToolTip="{Binding SaveAsToolTip}"
|
||||
Style="{StaticResource ToolBar_Button}">
|
||||
<Image Source="/Resources/ProjectManager/SaveAs.png" Stretch="Uniform"/>
|
||||
</Button>--><!--
|
||||
<Button Command="{Binding AddProj_Command}" ToolTip="{Binding AddProjToolTip}"
|
||||
Style="{StaticResource ToolBar_Button}">
|
||||
<Image Source="/Resources/ProjectManager/Import.png" Stretch="Uniform"/>
|
||||
</Button>
|
||||
<Button Content="<"
|
||||
Command="{Binding GoToProj_Command}" ToolTip="{Binding AddProjToolTip}"
|
||||
Style="{StaticResource ToolBar_Button}"/>-->
|
||||
|
||||
<!--<Button Command="{Binding OptionsCommand}"
|
||||
ToolTip="{Binding OptionsToolTip}"
|
||||
Style="{StaticResource ToolBar_Button}">
|
||||
<Image Source="/Resources/ProjectManager/Options.png" Height="22"/>
|
||||
</Button>-->
|
||||
<!--<Button Command="{Binding SendFeedbackCommand}"
|
||||
ToolTip="{Binding SendFeedbackToolTip}"
|
||||
Style="{StaticResource ToolBar_Button}">
|
||||
<Image Source="/Resources/ProjectManager/Send.png" Height="22" Margin="3,0,3,0" />
|
||||
</Button>-->
|
||||
<!--<Button Command="{Binding UpdateBTL_Command}" ToolTip="{Binding UpdateBTLToolTip}"
|
||||
Style="{StaticResource ToolBar_Button}">
|
||||
<Image Source="/Resources/ProjectManager/Import.png" Stretch="Uniform"/>
|
||||
</Button>-->
|
||||
|
||||
</EgtFloating:EgtFloatingPanel>
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
Imports System.Collections.ObjectModel
|
||||
Imports System.IO
|
||||
Imports System.Windows.Threading
|
||||
Imports EgtBEAMWALL.Core
|
||||
Imports EgtBEAMWALL.Core.ConstBeam
|
||||
Imports EgtBEAMWALL.DataLayer.DatabaseModels
|
||||
@@ -11,6 +12,10 @@ Public Class SupervisorManagerVM
|
||||
|
||||
#Region "FIELDS & PROPERTIES"
|
||||
|
||||
Private m_OpenProj_Timer As New DispatcherTimer
|
||||
Private m_bOpenProj As Boolean = False
|
||||
Private m_nProjIdToOpen As Integer = GDB_ID.NULL
|
||||
|
||||
Private m_SupervisorManager_IsEnabled As Boolean = True
|
||||
Public ReadOnly Property SupervisorManager_IsEnabled As Boolean
|
||||
Get
|
||||
@@ -70,7 +75,7 @@ Public Class SupervisorManagerVM
|
||||
Private m_cmdOpen As ICommand
|
||||
Private m_cmdOpenMruFile As ICommand
|
||||
'Private m_cmdSave As ICommand
|
||||
'Private m_cmdGoToProj As ICommand
|
||||
Private m_cmdGoToProd As ICommand
|
||||
|
||||
'#Region "ToolTip"
|
||||
|
||||
@@ -97,6 +102,10 @@ Public Class SupervisorManagerVM
|
||||
Map.SetRefSupervisorManagerVM(Me)
|
||||
' Impostazioni MruLists
|
||||
m_MruFiles.Init(S_MRUSUPERVISORPRODFILES, 8)
|
||||
' imposto timer di apertura da ottimizzatore
|
||||
m_OpenProj_Timer.Interval = TimeSpan.FromMilliseconds(500)
|
||||
AddHandler m_OpenProj_Timer.Tick, AddressOf OpenProject_Tick
|
||||
m_OpenProj_Timer.Start()
|
||||
End Sub
|
||||
|
||||
#End Region ' CONSTRUCTOR
|
||||
@@ -129,6 +138,24 @@ Public Class SupervisorManagerVM
|
||||
DbControllers.m_ProdController.UpdateMachGroup(CurrProd.nProdId, MyMachGroupList)
|
||||
End Sub
|
||||
|
||||
Public Sub OpenProjectFromOptimizer(ProjIdToOpen As Integer)
|
||||
If ProjIdToOpen <> Map.refSupervisorManagerVM.m_CurrProd.nProdId Then
|
||||
m_nProjIdToOpen = ProjIdToOpen
|
||||
m_bOpenProj = True
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Public Sub OpenProject_Tick()
|
||||
If Not m_bOpenProj Then Return
|
||||
m_bOpenProj = False
|
||||
' recupero progetto da Id
|
||||
Dim DbProject As ProdFileM
|
||||
DbProject = DbControllers.m_ProdController.FindCoreByProdId(m_nProjIdToOpen)
|
||||
Dim ProjectVM As New ProdFileVM(DbProject)
|
||||
OpenProject(ProjectVM)
|
||||
m_nProjIdToOpen = GDB_ID.NULL
|
||||
End Sub
|
||||
|
||||
#End Region ' METHODS
|
||||
|
||||
#Region "COMMANDS"
|
||||
@@ -194,9 +221,12 @@ Public Class SupervisorManagerVM
|
||||
m_bLoadingProd = False
|
||||
Return
|
||||
End If
|
||||
LoadingWndHelper.OpenLoadingWnd(ActiveIds.OPENPROD, 3, EgtMsg(63000), EgtMsg(63001), 50) 'Project opening 'Loading project geometries
|
||||
If Map.refSceneHostVM.MainController.OpenProject(sFilePath, False) Then
|
||||
m_CurrProd = TempCurrProd
|
||||
Map.refMainWindowVM.UpdateTitle()
|
||||
' inizializzo visibilita' bottone done per i Part
|
||||
Map.refLeftPanelVM.NotifyPropertyChanged(NameOf(Map.refLeftPanelVM.DonePart_Visibility))
|
||||
'If Map.refMachGroupPanelVM.InitMachGroupList() Then
|
||||
' m_CurrProd = TempCurrProd
|
||||
' Map.refMainWindowVM.SetTitle(CurrProd.nProdId.ToString("0000") & " - EgtBEAMWALL")
|
||||
@@ -215,6 +245,7 @@ Public Class SupervisorManagerVM
|
||||
Map.refSceneHostVM.MainController.NewProject()
|
||||
Map.refMainWindowVM.SetTitle("New - EgtBEAMWALL")
|
||||
End If
|
||||
LoadingWndHelper.UpdateLoadingWnd(ActiveIds.OPENPROD, 3, EgtMsg(63004), 70, 100) ' Loading production data
|
||||
Map.refProjectVM.SupervisorMachGroupPanelVM = New SupervisorMachGroupPanelVM(MachGroupPanelM.CreateNewMachGroupPanel())
|
||||
' apro sessione di comunicazione e fisso indice a 0
|
||||
DbControllers.m_StatusMapController.StartProd(Map.refSupervisorManagerVM.CurrProd.nProdId, m_SupervisorId)
|
||||
@@ -257,6 +288,7 @@ Public Class SupervisorManagerVM
|
||||
Map.refProjectVM.SupervisorMachGroupPanelVM.NotifyPropertyChanged(NameOf(Map.refProjectVM.SupervisorMachGroupPanelVM.MachGroupVMList))
|
||||
m_bLoadingProd = False
|
||||
NotifyPropertyChanged(NameOf(MruFileNames))
|
||||
LoadingWndHelper.CloseLoadingWnd(ActiveIds.OPENPROD)
|
||||
End Sub
|
||||
|
||||
#End Region ' OpenCommand
|
||||
@@ -292,6 +324,49 @@ Public Class SupervisorManagerVM
|
||||
|
||||
#End Region ' OpenMruFileCommand
|
||||
|
||||
#Region "GoToProd"
|
||||
|
||||
''' <summary>
|
||||
''' Returns a command that do Open.
|
||||
''' </summary>
|
||||
Public ReadOnly Property GoToProd_Command As ICommand
|
||||
Get
|
||||
If m_cmdGoToProd Is Nothing Then
|
||||
m_cmdGoToProd = New Command(AddressOf GoToProd)
|
||||
End If
|
||||
Return m_cmdGoToProd
|
||||
End Get
|
||||
End Property
|
||||
|
||||
''' <summary>
|
||||
''' Execute the Open. This method is invoked by the OpenCommand.
|
||||
''' </summary>
|
||||
Friend Sub GoToProd()
|
||||
If IsNothing(m_CurrProd) Then Return
|
||||
' apro ottimizzatore
|
||||
Dim sOptimizerName As String = "EgtBEAMWALL.ViewerOptimizerR32"
|
||||
' recupero processo del supervisore
|
||||
Dim localProc As Process() = Process.GetProcessesByName(sOptimizerName)
|
||||
If localProc.Length > 0 Then
|
||||
For Each p As Process In localProc
|
||||
' porto in primo piano il Supervisor
|
||||
BringWindowToFront(p.MainWindowHandle)
|
||||
Exit For
|
||||
Next
|
||||
Else
|
||||
Dim sOptimizerPath As String = Path.GetDirectoryName(System.AppDomain.CurrentDomain.BaseDirectory) & "\" & sOptimizerName & ".exe"
|
||||
Try
|
||||
Process.Start(sOptimizerPath, "1 " & CurrProd.nProdId)
|
||||
Catch ex As Exception
|
||||
EgtOutLog("Error: impossible starting optimizer from path " & sOptimizerPath)
|
||||
End Try
|
||||
End If
|
||||
' mando richiesta di apertura progetto in ottimizzatore
|
||||
DbControllers.m_StatusMapController.UpdateAction(DbControllers.m_SupervisorId, Map.refSupervisorManagerVM.CurrProd.nProdId, Map.refSupervisorManagerVM.CurrProd.nProdId, StatusMapItemType.Comm, StatusMapOpType.ChangeProdInProdRequest, "")
|
||||
End Sub
|
||||
|
||||
#End Region ' GoToProd
|
||||
|
||||
#End Region ' Commands
|
||||
|
||||
End Class
|
||||
|
||||
@@ -160,6 +160,8 @@ Public Module CurrentMachine
|
||||
' inizializzo assi
|
||||
Map.refAxesPanelVM.LoadAxes()
|
||||
|
||||
' imposto visibilita' input output
|
||||
Map.refMainMenuVM.SetInputOutputVisibility()
|
||||
' leggo parametri macchina da WallData
|
||||
If nType = MachineType.WALL Then
|
||||
' Assegno i dati
|
||||
@@ -201,8 +203,6 @@ Public Module CurrentMachine
|
||||
Map.refLeftPanelVM.LoadChannels()
|
||||
Map.refLeftPanelVM.LoadOPStates()
|
||||
Map.refLeftPanelVM.LoadOPModes()
|
||||
' inizializzo visibilita' bottone done per i Part
|
||||
Map.refLeftPanelVM.NotifyPropertyChanged(NameOf(Map.refLeftPanelVM.DonePart_Visibility))
|
||||
End Sub
|
||||
|
||||
#End Region 'Init
|
||||
|
||||
@@ -27,18 +27,32 @@ Module DbControllers
|
||||
End If
|
||||
Try
|
||||
Dim DbAddress As String = "127.0.0.1"
|
||||
Dim DbMasterKey As Integer = 0
|
||||
Dim sDbMasterKey As String = ""
|
||||
If Map.refMainWindowVM.MainWindowM.GetKeyOption(KEY_OPT.NETWORK) Then
|
||||
GetMainPrivateProfileString(S_GENERAL, K_DBADDRESS, "127.0.0.1", DbAddress)
|
||||
DbMasterKey = GetMainPrivateProfileInt(S_GENERAL, K_DBMASTERKEY, 0)
|
||||
If DbMasterKey > 0 Then
|
||||
sDbMasterKey = DbMasterKey.ToString("000000")
|
||||
End If
|
||||
If String.IsNullOrWhiteSpace(DbAddress) OrElse DbMasterKey <= 0 Then
|
||||
DbAddress = "127.0.0.1"
|
||||
DbMasterKey = 0
|
||||
End If
|
||||
End If
|
||||
DataLayer.DbConfig.InitDb(DbAddress, sUser, sPwd)
|
||||
DataLayer.DbConfig.CheckUser(sUser, sPwd)
|
||||
DataLayer.DbConfig.InitDb(DbAddress, sUser, sPwd, sDbMasterKey)
|
||||
DataLayer.DbConfig.CheckUser(sUser, sPwd, Map.refMainWindowVM.MainWindowM.GetKeyOption(KEY_OPT.NETWORK))
|
||||
Catch ex As Exception
|
||||
EgtOutLog("InitDb error: " & ex.ToString())
|
||||
MessageBox.Show(Application.Current.MainWindow, "Db connection error!!", "Error")
|
||||
End
|
||||
End Try
|
||||
DataLayer.DbConfig.InitDb("127.0.0.1", sUser, sPwd)
|
||||
DataLayer.DbConfig.CheckUser(sUser, sPwd)
|
||||
|
||||
If Map.refMainWindowVM.MainWindowM.GetKeyOption(KEY_OPT.NETWORK) Then
|
||||
Dim sSupervisorMachName As String = ""
|
||||
GetMainPrivateProfileString(S_MACH, K_SUPERVISORMACH, "", sSupervisorMachName)
|
||||
If Not String.IsNullOrWhiteSpace(sSupervisorMachName) Then m_SupervisorId = sSupervisorMachName
|
||||
End If
|
||||
|
||||
m_ProjController = New DataLayer.Controllers.ProjController
|
||||
m_ProdController = New DataLayer.Controllers.ProdController
|
||||
|
||||
@@ -276,6 +276,14 @@
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
|
||||
<Style x:Key="MainMenu_Button" TargetType="{x:Type Button}" BasedOn="{StaticResource {x:Type Button}}">
|
||||
<Setter Property="Background" Value="{StaticResource Omag_White}"/>
|
||||
<Setter Property="Foreground" Value="{StaticResource Omag_DarkGray}"/>
|
||||
<Setter Property="TextBlock.FontWeight" Value="Normal"/>
|
||||
<Setter Property="Height" Value="30"/>
|
||||
<Setter Property="Width" Value="90"/>
|
||||
</Style>
|
||||
|
||||
<Style x:Key="Option_ColorButton" TargetType="{x:Type Button}" BasedOn="{StaticResource {x:Type Button}}">
|
||||
<Setter Property="Padding" Value="5"/>
|
||||
<Setter Property="HorizontalContentAlignment" Value="Center"/>
|
||||
|
||||
@@ -1,15 +1,26 @@
|
||||
Imports EgtBEAMWALL.DataLayer.DatabaseModels
|
||||
Imports EgtBEAMWALL.Core
|
||||
Imports EgtBEAMWALL.DataLayer.DatabaseModels
|
||||
|
||||
Public Class ViewerOptimizerComm
|
||||
|
||||
Private m_bTickInExecution As Boolean = False
|
||||
|
||||
Sub New()
|
||||
' imposto in Map
|
||||
'Map.SetRefMachManaging(Me)
|
||||
End Sub
|
||||
|
||||
Friend Sub Timer_Tick()
|
||||
If m_bTickInExecution Then
|
||||
EgtUILib.EgtOutLog("Tick gia' in esecuzione!!")
|
||||
Return
|
||||
End If
|
||||
m_bTickInExecution = True
|
||||
' se c'e' un progetto aperto o in caricamento
|
||||
If IsNothing(Map.refSupervisorManagerVM.CurrProd) OrElse Map.refSupervisorManagerVM.bLoadingProd Then Return
|
||||
If IsNothing(Map.refSupervisorManagerVM.CurrProd) OrElse Map.refSupervisorManagerVM.bLoadingProd Then
|
||||
m_bTickInExecution = False
|
||||
Return
|
||||
End If
|
||||
' recupero indice modifica del prod
|
||||
Dim nModificationIndex As Integer = 0
|
||||
Dim ActiveSessionList As List(Of StatusMapModel) = DbControllers.m_StatusMapController.GetProd()
|
||||
@@ -64,8 +75,13 @@ Public Class ViewerOptimizerComm
|
||||
End If
|
||||
End If
|
||||
End Select
|
||||
ElseIf MachGroupModification.ItemType = Core.StatusMapItemType.Comm AndAlso MachGroupModification.Operation = Core.StatusMapOpType.ViewOptimStoped Then
|
||||
ViewerOptimizerCommThread.SetViewerOptimizerBlocked(True)
|
||||
ElseIf MachGroupModification.ItemType = Core.StatusMapItemType.Comm Then
|
||||
If MachGroupModification.Operation = Core.StatusMapOpType.ViewOptimStoped Then
|
||||
ViewerOptimizerCommThread.SetViewerOptimizerBlocked(True)
|
||||
ElseIf MachGroupModification.Operation = Core.StatusMapOpType.ChangeProdInSupervisorRequest Then
|
||||
' lo apro
|
||||
Map.refSupervisorManagerVM.OpenProjectFromOptimizer(MachGroupModification.ItemId)
|
||||
End If
|
||||
End If
|
||||
Next
|
||||
' se devo ricaricare il file
|
||||
@@ -74,39 +90,11 @@ Public Class ViewerOptimizerComm
|
||||
For Each MachGroupModification In Map.refProjectVM.SupervisorMachGroupPanelVM.MachGroupFullList.Where(Function(x) x.Value(0) <> x.Value(1))
|
||||
MachGroupModification.Value(1) = MachGroupModification.Value(0)
|
||||
Next
|
||||
|
||||
|
||||
' ricarico il progetto
|
||||
'Map.refProjectVM.SupervisorMachGroupPanelVM.ReloadProjectFile()
|
||||
End If
|
||||
|
||||
|
||||
|
||||
' aggiorno indice del prod
|
||||
Map.refSupervisorManagerVM.CurrProd.SetModificationIndex(nModificationIndex)
|
||||
End If
|
||||
|
||||
|
||||
|
||||
|
||||
' verifico se e' aperto in qualche ottimizzatore
|
||||
'DbControllers.m_ProdController.
|
||||
'Map.refSupervisorManagerVM.CurrProd.bIsLocked
|
||||
' verifico se la mappa messaggi ha indice maggiore del mio
|
||||
|
||||
' ricarico il progetto
|
||||
|
||||
' aggiorno eventuali nuovi machgroup
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
' se devo ripartire a meta' di una barra
|
||||
|
||||
' mando messaggio di blocco dell'ottimizzatore
|
||||
|
||||
|
||||
m_bTickInExecution = False
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
|
||||
@@ -91,7 +91,7 @@ Public Class AddRawPartWndVM
|
||||
m_nProjectType = ProjectType
|
||||
Select Case ProjectType
|
||||
Case BWType.BEAM
|
||||
m_VariableList = New ObservableCollection(Of Variable)({New Variable(Variable.VariableType.LENGTH, EgtMsg(61935), dL), ' lunghezza
|
||||
m_VariableList = New ObservableCollection(Of Variable)({New Variable(Variable.VariableType.LENGTH, EgtMsg(61935), dL + dPosx), ' lunghezza + ritaglio iniziale
|
||||
New Variable(Variable.VariableType.LENGTH, EgtMsg(61816), dPosx), ' ritaglio iniziale
|
||||
New Variable(Variable.VariableType.LENGTH, EgtMsg(61937), dOffset)}) ' offset
|
||||
Case BWType.WALL
|
||||
|
||||
@@ -82,6 +82,7 @@ Public Class BTLFeatureVM
|
||||
End Property
|
||||
|
||||
' proprieta' che indica se e' attivo l'update del parametro bDO su piu' feature (attiva/disattiva tutti su pezzo, o per tipo con tasto destro)
|
||||
' necessario per evitare ricalcolo della grafica sulla modifica del parametro per ogni feature
|
||||
Private Shared m_bDO_MultipleUpdate As Boolean = False
|
||||
Public Shared Property bDO_MultipleUpdate As Boolean
|
||||
Get
|
||||
@@ -174,7 +175,7 @@ Public Class BTLFeatureVM
|
||||
|
||||
Public ReadOnly Property Edit_Visibility As Visibility
|
||||
Get
|
||||
Return If(BTLFeatureM.IsFreeContour AndAlso Not Map.refFreeContourManagerVM.bIsActive, Visibility.Visible, Visibility.Collapsed)
|
||||
Return If(Map.refMainWindowVM.MainWindowM.nUserLevel > 5 AndAlso BTLFeatureM.IsFreeContour AndAlso Not Map.refFreeContourManagerVM.bIsActive, Visibility.Visible, Visibility.Collapsed)
|
||||
End Get
|
||||
End Property
|
||||
Public ReadOnly Property SaveCancel_Visibility As Visibility
|
||||
@@ -281,6 +282,7 @@ Public Class BTLFeatureVM
|
||||
End Select
|
||||
NotifyPropertyChanged(NameOf(Calc_Background))
|
||||
NotifyPropertyChanged(NameOf(CALC_ROT_Visibility))
|
||||
NotifyPropertyChanged(NameOf(sCALC_MSG))
|
||||
NotifyPropertyChanged(NameOf(CALC_ERR_Letter))
|
||||
NotifyPropertyChanged(NameOf(CALC_ERR_Foreground))
|
||||
End Sub
|
||||
@@ -295,6 +297,7 @@ Public Class BTLFeatureVM
|
||||
m_BTLFeatureM.sCALC_MSG = ""
|
||||
NotifyPropertyChanged(NameOf(Calc_Background))
|
||||
NotifyPropertyChanged(NameOf(CALC_ROT_Visibility))
|
||||
NotifyPropertyChanged(NameOf(sCALC_MSG))
|
||||
NotifyPropertyChanged(NameOf(CALC_ERR_Letter))
|
||||
NotifyPropertyChanged(NameOf(CALC_ERR_Foreground))
|
||||
End Sub
|
||||
|
||||
@@ -314,13 +314,13 @@ Public Class BTLParamVM
|
||||
m_BTLFeatureM.nPRID, m_BTLFeatureM.frFRAME, vPar, sPar, vParQ)
|
||||
|
||||
If bOK Then
|
||||
m_BTLParamM.bCustom = True
|
||||
' se sono in ottimizzazione
|
||||
If Map.refMainMenuVM.SelPage = Pages.VIEW Then
|
||||
' setto nel progetto il fatto che il parametro attuale è custom o meno
|
||||
EgtSetInfo(m_BTLFeatureM.nFeatureId, m_BTLParamM.sName & "A", If(bCustom, "1", ""))
|
||||
NotifyPropertyChanged(NameOf(bCustom))
|
||||
End If
|
||||
m_BTLParamM.bCustom = True
|
||||
m_BTLParamM.dValue = dNewValue
|
||||
' modifica provvisoria per mancanza aggiornamento su freecontour
|
||||
If m_BTLFeatureM.IsFreeContour Then
|
||||
|
||||
@@ -41,7 +41,7 @@ Public Class BTLPartVM
|
||||
Set(value As Boolean)
|
||||
m_BTLPartM.bDO = value
|
||||
EgtSetInfo(m_BTLPartM.nPartId, BTL_PRT_DO, If(value, 1, 0))
|
||||
NotifyPropertyChanged("Calc_BorderBrush")
|
||||
NotifyPropertyChanged(NameOf(Calc_BorderBrush))
|
||||
End Set
|
||||
End Property
|
||||
|
||||
@@ -1362,8 +1362,12 @@ Public Class BTLPartVM
|
||||
|
||||
Public ReadOnly Property Section As SectionXMaterial
|
||||
Get
|
||||
Dim nOrigGroupId As Integer = nPartId
|
||||
If Map.refMainMenuVM.SelPage = Pages.VIEW AndAlso Map.refShowBeamPanelVM.ShowBuilding_IsChecked AndAlso Map.refShowBeamPanelVM.bShowAll Then
|
||||
nOrigGroupId = GetOrigFrameGroup(nPartId)
|
||||
End If
|
||||
Dim frBeam As New Frame3d
|
||||
EgtGetGroupGlobFrame(nPartId, frBeam)
|
||||
EgtGetGroupGlobFrame(nOrigGroupId, frBeam)
|
||||
Dim dL As Double
|
||||
If IsX(frBeam.VersX(), EPS_SMALL) Then
|
||||
dL = m_BTLPartM.dBtlL
|
||||
@@ -1440,7 +1444,7 @@ Public Class BTLPartVM
|
||||
End Get
|
||||
Set(value As Boolean?)
|
||||
If BTLFeatureVMList.Count = 0 Then
|
||||
NotifyPropertyChanged("bDOALL")
|
||||
NotifyPropertyChanged(NameOf(bDOALL))
|
||||
Return
|
||||
End If
|
||||
' imposto modalita' update multiplo
|
||||
@@ -1496,6 +1500,21 @@ Public Class BTLPartVM
|
||||
EgtDeselectAll()
|
||||
End If
|
||||
Map.refLeftPanelVM.FeatureSelectionChanged()
|
||||
ElseIf Map.refMainMenuVM.SelPage = Pages.LAYERSWALL Then
|
||||
If Not IsNothing(m_SelBTLFeatureVM) Then
|
||||
DirectCast(m_SelBTLFeatureVM, BTLFeatureVM).SelGeomFeature()
|
||||
' imposto path disegno da mostrare in BottomPanel
|
||||
Map.refLayersWallBottomPanelVM.SetCurrDraw(DirectCast(m_SelBTLFeatureVM, BTLFeatureVM).sDrawPath)
|
||||
' seleziono pagina BottomPanel
|
||||
Map.refLayersWallBottomPanelVM.SetSelPartFeatureTab(LayersWallBottomPanelVM.PartFeatureTab.FEATURE)
|
||||
' deseleziono i parametri
|
||||
If Not IsNothing(SelBTLFeatureVM.SelPBTLParam) Then SelBTLFeatureVM.SelPBTLParam = Nothing
|
||||
' rinfresco bottoni freecontour
|
||||
m_SelBTLFeatureVM.RefreshFCMBtnVisibility()
|
||||
Else
|
||||
EgtDeselectAll()
|
||||
End If
|
||||
Map.refLayersWallLeftPanelVM.FeatureSelectionChanged()
|
||||
End If
|
||||
EgtDraw()
|
||||
NotifyPropertyChanged(NameOf(SelBTLFeatureVM))
|
||||
@@ -1544,8 +1563,10 @@ Public Class BTLPartVM
|
||||
CreateBTLFeatureVMList()
|
||||
m_BTLFeatureVMList_ViewSource = New CollectionViewSource With {.Source = m_BTLFeatureVMList}
|
||||
m_BTLFeatureVMList_View = m_BTLFeatureVMList_ViewSource.View
|
||||
m_BTLFeatureVMList_View.CustomSort = New FeatureSorter
|
||||
m_BTLFeatureVMList_View.Filter = AddressOf FeatureFilter
|
||||
If Not IsNothing(m_BTLFeatureVMList_View) Then
|
||||
m_BTLFeatureVMList_View.CustomSort = New FeatureSorter
|
||||
m_BTLFeatureVMList_View.Filter = AddressOf FeatureFilter
|
||||
End If
|
||||
' Aggiorno check DOALL
|
||||
NotifyPropertyChanged(NameOf(bDOALL))
|
||||
' Aggiorno stato da stati feature
|
||||
@@ -1572,7 +1593,7 @@ Public Class BTLPartVM
|
||||
|
||||
#Region "METHODS"
|
||||
|
||||
Private Sub CreateBTLFeatureVMList()
|
||||
Protected Overridable Sub CreateBTLFeatureVMList()
|
||||
Dim all As List(Of BTLFeatureVM) = (From BTLFeatureM In m_BTLPartM.GetBTLFeatures()
|
||||
Select New BTLFeatureVM(BTLFeatureM, m_BTLPartM)).ToList()
|
||||
|
||||
@@ -1823,8 +1844,13 @@ Public Class BTLPartVM
|
||||
Dim b3Part As New BBox3d
|
||||
EgtGetBBoxGlob(nNewPartId, GDB_BB.STANDARD, b3Part)
|
||||
' ripristino le rotazioni di ROT e FLIP
|
||||
EgtRotate(nNewPartId, b3Part.Center, -Vector3d.Z_AX, nROTATED)
|
||||
EgtRotate(nNewPartId, b3Part.Center, Vector3d.X_AX, nINVERTED)
|
||||
If Map.refProjectVM.BTLStructureVM.nPROJTYPE = BWType.BEAM Then
|
||||
EgtRotate(nNewPartId, b3Part.Center, Vector3d.X_AX, nROTATED)
|
||||
EgtRotate(nNewPartId, b3Part.Center, Vector3d.Z_AX, nINVERTED)
|
||||
Else
|
||||
EgtRotate(nNewPartId, b3Part.Center, -Vector3d.Z_AX, nROTATED)
|
||||
EgtRotate(nNewPartId, b3Part.Center, Vector3d.X_AX, nINVERTED)
|
||||
End If
|
||||
' aggiungo pezzo alla lista
|
||||
m_BTLStructureM.AddBTLPart(NewPart)
|
||||
Return NewPart
|
||||
@@ -2062,12 +2088,12 @@ Public Class BTLPartVM
|
||||
|
||||
#Region "EVENTS"
|
||||
|
||||
Private Sub OnBTLFeatureAdded(sender As Object, e As BTLFeatureAddedEventArgs)
|
||||
Protected Sub OnBTLFeatureAdded(sender As Object, e As BTLFeatureAddedEventArgs)
|
||||
Dim BTLFeatureVM As BTLFeatureVM = New BTLFeatureVM(e.NewBTLFeature, m_BTLPartM)
|
||||
BTLFeatureVMList.Add(BTLFeatureVM)
|
||||
End Sub
|
||||
|
||||
Private Sub OnBTLFeatureVMListChanged(sender As Object, e As NotifyCollectionChangedEventArgs)
|
||||
Protected Sub OnBTLFeatureVMListChanged(sender As Object, e As NotifyCollectionChangedEventArgs)
|
||||
If Not IsNothing(e.NewItems) AndAlso e.NewItems.Count > 0 Then
|
||||
For Each BTLFeatureVM As BTLFeatureVM In e.NewItems
|
||||
AddHandler BTLFeatureVM.PropertyChanged, AddressOf OnBTLFeatureVMPropertyChanged
|
||||
|
||||
@@ -20,6 +20,136 @@ Public Class BTLStructureVM
|
||||
End Get
|
||||
End Property
|
||||
|
||||
' pezzi da BTL
|
||||
Private m_BTLElementVMList_View As CollectionView = Nothing
|
||||
Private m_BTLElementVMList As ObservableCollection(Of BTLElementVM)
|
||||
Public Property BTLElementVMList As ObservableCollection(Of BTLElementVM)
|
||||
Get
|
||||
Return m_BTLElementVMList
|
||||
End Get
|
||||
Set(value As ObservableCollection(Of BTLElementVM))
|
||||
m_BTLElementVMList = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
' pezzi da BTL
|
||||
Private m_BTLLayerVMList_View As CollectionView = Nothing
|
||||
Private m_BTLLayerVMList As ObservableCollection(Of BTLLayerVM)
|
||||
Public Property BTLLayerVMList As ObservableCollection(Of BTLLayerVM)
|
||||
Get
|
||||
Return m_BTLLayerVMList
|
||||
End Get
|
||||
Set(value As ObservableCollection(Of BTLLayerVM))
|
||||
m_BTLLayerVMList = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_SelBTLLayer As BTLLayerVM = Nothing
|
||||
Public Property SelBTLLayer As BTLLayerVM
|
||||
Get
|
||||
Return m_SelBTLLayer
|
||||
End Get
|
||||
Set(value As BTLLayerVM)
|
||||
If Not IsNothing(m_SelBTLLayer) Then
|
||||
' se necessario tolgo solido dal precedentemente selezionato
|
||||
If Map.refShowBeamPanelVM.ShowSolid_IsChecked Then
|
||||
Map.refShowBeamPanelVM.SetShowSolid(False)
|
||||
End If
|
||||
' disabilito eventuale feature selezionata
|
||||
If Not IsNothing(m_SelBTLLayer.m_SelBTLFeatureVM) Then m_SelBTLLayer.SelBTLFeatureVM = Nothing
|
||||
End If
|
||||
m_SelBTLLayer = value
|
||||
' se seleziono un layer
|
||||
If Not IsNothing(m_SelBTLLayer) Then
|
||||
If Map.refMainMenuVM.SelPage = Pages.VIEW Then
|
||||
' se modalità building, la tolgo
|
||||
If Map.refShowBeamPanelVM.ShowBuilding_IsChecked Then
|
||||
ShowBuilding(False, False)
|
||||
End If
|
||||
' seleziono pezzo nella scena
|
||||
SceneSelPartSelection()
|
||||
' seleziono pezzo in Db geometrico
|
||||
EgtBeamSetPart(m_SelBTLLayer.nPartId)
|
||||
' seleziono pagina BottomPanel
|
||||
Map.refBottomPanelVM.SetSelPartFeatureTab(BottomPanelVM.PartFeatureTab.PART)
|
||||
' mostro barra di gestione pezzo
|
||||
Map.refProjectVM.SetPartManager_Visibility(True)
|
||||
Map.refProjectVM.NotifyPropertyChanged(NameOf(Map.refProjectVM.PartManager_Visibility))
|
||||
' deseleziono le feature
|
||||
If Not IsNothing(m_SelBTLLayer.SelBTLFeatureVM) Then SelBTLLayer.SelBTLFeatureVM = Nothing
|
||||
' aggiorno stato selezionato tutto
|
||||
Map.refShowBeamPanelVM.bShowAll = False
|
||||
Core.ViewPanelVM.BWSetView(If(Core.ViewPanelVM.Type = BWType.BEAM, VT.ISO_SW, VT.TOP), False)
|
||||
EgtZoom(ZM.ALL)
|
||||
ElseIf Map.refMainMenuVM.SelPage = Pages.MACHINING Then
|
||||
' resetto gruppo di lavorazione corrente
|
||||
EgtResetCurrMachGroup()
|
||||
' trovo ed evidenzio MachGroup e Duplo di questo pezzo
|
||||
If Not IsNothing(Map.refProjectVM.MachGroupPanelVM) Then
|
||||
Dim MachGroupList As New List(Of MyMachGroupVM)
|
||||
For Each Machgroup As MyMachGroupVM In Map.refProjectVM.MachGroupPanelVM.MachGroupVMList
|
||||
Dim bFound As Boolean = False
|
||||
For Each Layer As PartVM In Machgroup.PartVMList
|
||||
If EgtDuploGetOriginal(Layer.nPartId) = m_SelBTLLayer.nPartId Then
|
||||
Layer.SetSearchFound()
|
||||
bFound = True
|
||||
Else
|
||||
Layer.ResetSearchFound()
|
||||
End If
|
||||
Next
|
||||
If bFound Then
|
||||
Machgroup.SetSearchFound()
|
||||
Else
|
||||
Machgroup.ResetSearchFound()
|
||||
End If
|
||||
Next
|
||||
End If
|
||||
' seleziono pezzo nella scena
|
||||
SceneSelPartSelection()
|
||||
Core.ViewPanelVM.BWSetView(If(Core.ViewPanelVM.Type = BWType.BEAM, VT.ISO_SW, VT.TOP), False)
|
||||
EgtZoom(ZM.ALL)
|
||||
ElseIf Map.refMainMenuVM.SelPage = Pages.LAYERSWALL Then
|
||||
' se c'era un Part selezionato lo deseleziono
|
||||
SelBTLLayer.SelBTLPart = Nothing
|
||||
' se modalità building, la tolgo
|
||||
If Map.refShowBeamPanelVM.ShowBuilding_IsChecked Then
|
||||
ShowBuilding(False, False)
|
||||
End If
|
||||
' seleziono pezzo nella scena
|
||||
SceneSelPartSelection()
|
||||
' seleziono pezzo in Db geometrico
|
||||
EgtBeamSetPart(m_SelBTLLayer.nPartId)
|
||||
' mostro tutti i pezzi
|
||||
Map.refShowBeamPanelVM.ShowAll(True)
|
||||
' seleziono pagina LayersWallBottomPanel
|
||||
Map.refLayersWallBottomPanelVM.SetSelPartFeatureTab(LayersWallBottomPanelVM.PartFeatureTab.LAYER)
|
||||
' mostro barra di gestione pezzo
|
||||
Map.refProjectVM.SetLayersWallLayerPartManager_Visibility(True)
|
||||
' deseleziono le feature
|
||||
If Not IsNothing(m_SelBTLLayer.SelBTLFeatureVM) Then SelBTLLayer.SelBTLFeatureVM = Nothing
|
||||
If Not IsNothing(m_SelBTLLayer.SelBTLPart) AndAlso Not IsNothing(m_SelBTLLayer.SelBTLPart.SelBTLFeatureVM) Then SelBTLLayer.SelBTLPart.SelBTLFeatureVM = Nothing
|
||||
' aggiorno FeatureList, FeatureManager e Parametri P e Q da far vedere
|
||||
Map.refFeatureListVM.SetLayerFeatureList_Visibility(True)
|
||||
Map.refFeatureListVM.SetPartFeatureList_Visibility(False)
|
||||
Map.refFeatureManagerVM.SetLayerFeature_Visibility(True)
|
||||
Map.refFeatureManagerVM.SetPartFeature_Visibility(False)
|
||||
Map.refLayersWallBottomPanelVM.SetLayerFeature_Visibility(True)
|
||||
Map.refLayersWallBottomPanelVM.SetPartFeature_Visibility(False)
|
||||
' aggiorno stato selezionato tutto
|
||||
Map.refShowBeamPanelVM.bShowAll = False
|
||||
Core.ViewPanelVM.BWSetView(If(Core.ViewPanelVM.Type = BWType.BEAM, VT.ISO_SW, VT.TOP), False)
|
||||
EgtZoom(ZM.ALL)
|
||||
End If
|
||||
End If
|
||||
NotifyPropertyChanged(NameOf(SelBTLLayer))
|
||||
End Set
|
||||
End Property
|
||||
' funzione che imposta layer BTL selezionato senza aggiornare nulla
|
||||
Friend Sub SetSelBTLLayer(BTLLayer As BTLLayerVM)
|
||||
m_SelBTLLayer = BTLLayer
|
||||
NotifyPropertyChanged(NameOf(SelBTLLayer))
|
||||
End Sub
|
||||
|
||||
' pezzi da BTL
|
||||
Private m_BTLPartVMList_View As CollectionView = Nothing
|
||||
Private m_BTLPartVMList As ObservableCollection(Of BTLPartVM)
|
||||
@@ -60,9 +190,9 @@ Public Class BTLStructureVM
|
||||
EgtBeamSetPart(m_SelBTLPart.nPartId)
|
||||
' seleziono pagina BottomPanel
|
||||
Map.refBottomPanelVM.SetSelPartFeatureTab(BottomPanelVM.PartFeatureTab.PART)
|
||||
' mostro barra di gestione pezzo
|
||||
Map.refProjectVM.SetPartManager_Visibility(True)
|
||||
Map.refProjectVM.NotifyPropertyChanged(NameOf(Map.refProjectVM.PartManager_Visibility))
|
||||
'' mostro barra di gestione pezzo
|
||||
'Map.refProjectVM.SetPartManager_Visibility(True)
|
||||
'Map.refProjectVM.NotifyPropertyChanged(NameOf(Map.refProjectVM.PartManager_Visibility))
|
||||
' deseleziono le feature
|
||||
If Not IsNothing(m_SelBTLPart.SelBTLFeatureVM) Then SelBTLPart.SelBTLFeatureVM = Nothing
|
||||
' aggiorno stato selezionato tutto
|
||||
@@ -72,10 +202,50 @@ Public Class BTLStructureVM
|
||||
ElseIf Map.refMainMenuVM.SelPage = Pages.MACHINING Then
|
||||
' resetto gruppo di lavorazione corrente
|
||||
EgtResetCurrMachGroup()
|
||||
' trovo ed evidenzio MachGroup e Duplo di questo pezzo
|
||||
If Not IsNothing(Map.refProjectVM.MachGroupPanelVM) Then
|
||||
Dim MachGroupList As New List(Of MyMachGroupVM)
|
||||
For Each Machgroup As MyMachGroupVM In Map.refProjectVM.MachGroupPanelVM.MachGroupVMList
|
||||
Dim bFound As Boolean = False
|
||||
For Each Part As PartVM In Machgroup.PartVMList
|
||||
If EgtDuploGetOriginal(Part.nPartId) = m_SelBTLPart.nPartId Then
|
||||
Part.SetSearchFound()
|
||||
bFound = True
|
||||
Else
|
||||
Part.ResetSearchFound()
|
||||
End If
|
||||
Next
|
||||
If bFound Then
|
||||
Machgroup.SetSearchFound()
|
||||
Else
|
||||
Machgroup.ResetSearchFound()
|
||||
End If
|
||||
Next
|
||||
End If
|
||||
' seleziono pezzo nella scena
|
||||
SceneSelPartSelection()
|
||||
Core.ViewPanelVM.BWSetView(If(Core.ViewPanelVM.Type = BWType.BEAM, VT.ISO_SW, VT.TOP), False)
|
||||
EgtZoom(ZM.ALL)
|
||||
ElseIf Map.refMainMenuVM.SelPage = Pages.LAYERSWALL Then
|
||||
' se modalità building, la tolgo
|
||||
If Map.refShowBeamPanelVM.ShowBuilding_IsChecked Then
|
||||
ShowBuilding(False, False)
|
||||
End If
|
||||
' seleziono pezzo nella scena
|
||||
SceneSelPartSelection()
|
||||
' seleziono pezzo in Db geometrico
|
||||
EgtBeamSetPart(m_SelBTLPart.nPartId)
|
||||
' seleziono pagina BottomPanel
|
||||
Map.refBottomPanelVM.SetSelPartFeatureTab(BottomPanelVM.PartFeatureTab.PART)
|
||||
' mostro barra di gestione pezzo
|
||||
Map.refProjectVM.SetPartManager_Visibility(True)
|
||||
Map.refProjectVM.NotifyPropertyChanged(NameOf(Map.refProjectVM.PartManager_Visibility))
|
||||
' deseleziono le feature
|
||||
If Not IsNothing(m_SelBTLPart.SelBTLFeatureVM) Then SelBTLPart.SelBTLFeatureVM = Nothing
|
||||
' aggiorno stato selezionato tutto
|
||||
Map.refShowBeamPanelVM.bShowAll = False
|
||||
Core.ViewPanelVM.BWSetView(If(Core.ViewPanelVM.Type = BWType.BEAM, VT.ISO_SW, VT.TOP), False)
|
||||
EgtZoom(ZM.ALL)
|
||||
End If
|
||||
End If
|
||||
NotifyPropertyChanged(NameOf(SelBTLPart))
|
||||
@@ -89,9 +259,8 @@ Public Class BTLStructureVM
|
||||
|
||||
' lista parametri per ricerca testuale
|
||||
Private m_SearchParamList As New ObservableCollection(Of IdNameStruct)({New IdNameStruct(BTLPartParam.NULL, ""),
|
||||
New IdNameStruct(BTLPartParam.PDN, "PDN"),
|
||||
New IdNameStruct(BTLPartParam.NAM, "Descrizione"),
|
||||
New IdNameStruct(BTLPartParam.GRP, "Gruppo")})
|
||||
New IdNameStruct(BTLPartParam.PDN, EgtMsg(61809)),
|
||||
New IdNameStruct(BTLPartParam.NAM, EgtMsg(61603))})
|
||||
Public ReadOnly Property SearchParamList As ObservableCollection(Of IdNameStruct)
|
||||
Get
|
||||
Return m_SearchParamList
|
||||
@@ -112,27 +281,53 @@ Public Class BTLStructureVM
|
||||
End Set
|
||||
End Property
|
||||
|
||||
' lista dei materiali utilizzati
|
||||
Private m_MaterialList_View As CollectionView = Nothing
|
||||
Private m_MaterialList As New ObservableCollection(Of String)({""})
|
||||
Public Property MaterialList As ObservableCollection(Of String)
|
||||
' lista dei gruppi
|
||||
Private m_GroupList_View As CollectionView = Nothing
|
||||
Private m_GroupList As New ObservableCollection(Of String)({""})
|
||||
Public Property GroupList As ObservableCollection(Of String)
|
||||
Get
|
||||
Return m_MaterialList
|
||||
Return m_GroupList
|
||||
End Get
|
||||
Set(value As ObservableCollection(Of String))
|
||||
m_MaterialList = value
|
||||
m_GroupList = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_SelMaterial As String = ""
|
||||
Public Property SelMaterial As String
|
||||
Private m_SelGroup As String = ""
|
||||
Public Property SelGroup As String
|
||||
Get
|
||||
Return m_SelMaterial
|
||||
Return m_SelGroup
|
||||
End Get
|
||||
Set(value As String)
|
||||
m_SelMaterial = value
|
||||
m_SelGroup = value
|
||||
m_BTLPartVMList_View.Refresh()
|
||||
m_SectionList_View.Refresh()
|
||||
m_SubGroupList_View.Refresh()
|
||||
End Set
|
||||
End Property
|
||||
|
||||
' lista dei SubGroup
|
||||
Private m_SubGroupList_View As CollectionView = Nothing
|
||||
Private m_SubGroupList As New ObservableCollection(Of String)({""})
|
||||
Public Property SubGroupList As ObservableCollection(Of String)
|
||||
Get
|
||||
Return m_SubGroupList
|
||||
End Get
|
||||
Set(value As ObservableCollection(Of String))
|
||||
m_SubGroupList = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_SelSubGroup As String = ""
|
||||
Public Property SelSubGroup As String
|
||||
Get
|
||||
Return m_SelSubGroup
|
||||
End Get
|
||||
Set(value As String)
|
||||
m_SelSubGroup = value
|
||||
m_BTLPartVMList_View.Refresh()
|
||||
m_SectionList_View.Refresh()
|
||||
m_GroupList_View.Refresh()
|
||||
End Set
|
||||
End Property
|
||||
|
||||
@@ -157,7 +352,8 @@ Public Class BTLStructureVM
|
||||
If Not IsNothing(value) Then
|
||||
m_SelSection = value
|
||||
m_BTLPartVMList_View.Refresh()
|
||||
m_MaterialList_View.Refresh()
|
||||
m_GroupList_View.Refresh()
|
||||
m_SubGroupList_View.Refresh()
|
||||
End If
|
||||
End Set
|
||||
End Property
|
||||
@@ -170,11 +366,40 @@ Public Class BTLStructureVM
|
||||
Set(value As String)
|
||||
m_SearchText = value
|
||||
m_BTLPartVMList_View.Refresh()
|
||||
m_MaterialList_View.Refresh()
|
||||
m_GroupList_View.Refresh()
|
||||
m_SectionList_View.Refresh()
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property bDOALL As Boolean?
|
||||
Get
|
||||
If BTLPartVMList.Count = 0 Then Return False
|
||||
Dim bTemp As Boolean = BTLPartVMList(0).bDO
|
||||
For FeatureIndex = 1 To BTLPartVMList.Count - 1
|
||||
If BTLPartVMList(FeatureIndex).bDO <> bTemp Then Return Nothing
|
||||
Next
|
||||
Return bTemp
|
||||
End Get
|
||||
Set(value As Boolean?)
|
||||
If BTLPartVMList.Count = 0 Then
|
||||
NotifyPropertyChanged(NameOf(bDOALL))
|
||||
Return
|
||||
End If
|
||||
For PartIndex = 0 To BTLPartVMList.Count - 1
|
||||
Dim Part As BTLPartVM = BTLPartVMList(PartIndex)
|
||||
If (IsNothing(m_SelSection) OrElse m_SelSection.dH = -1 OrElse Part.Section = m_SelSection) AndAlso
|
||||
(SelGroup = "" OrElse Part.sGROUP = SelGroup) AndAlso
|
||||
(SelSubGroup = "" OrElse Part.sSTOREY = SelSubGroup) AndAlso
|
||||
(SelSearchParam.Id = BTLPartParam.NULL OrElse SearchText = String.Empty OrElse (
|
||||
(SelSearchParam.Id = BTLPartParam.PDN AndAlso Part.nPDN.ToString.IndexOf(SearchText, StringComparison.InvariantCultureIgnoreCase) >= 0) OrElse
|
||||
(SelSearchParam.Id = BTLPartParam.NAM AndAlso Part.sNAM.IndexOf(SearchText, StringComparison.InvariantCultureIgnoreCase) >= 0))) Then
|
||||
Part.bDO = value
|
||||
Part.NotifyPropertyChanged(NameOf(Part.bDO))
|
||||
End If
|
||||
Next
|
||||
End Set
|
||||
End Property
|
||||
|
||||
#Region "Parametri generici"
|
||||
|
||||
Public Property sPROJNUM As String
|
||||
@@ -236,6 +461,8 @@ Public Class BTLStructureVM
|
||||
Return Map.refProjManagerVM.nProjType
|
||||
Case Pages.MACHINING
|
||||
Return Map.refProdManagerVM.nProdType
|
||||
Case Pages.LAYERSWALL
|
||||
Return Map.refProjManagerVM.nProjType
|
||||
Case Else
|
||||
Return BWType.NULL
|
||||
End Select
|
||||
@@ -566,17 +793,36 @@ Public Class BTLStructureVM
|
||||
Sub New(BTLStructureM As BTLStructureM)
|
||||
m_BTLStructureM = BTLStructureM
|
||||
AddHandler m_BTLStructureM.BTLPartAdded, AddressOf OnBTLPartAdded
|
||||
CreateBTLElementVMList()
|
||||
' creo lista di BTLLayerVM
|
||||
CreateBTLLayerVMList()
|
||||
If Not IsNothing(BTLElementVMList) Then
|
||||
For Each BTLElementVMItem In BTLElementVMList
|
||||
BTLElementVMItem.m_BTLLayerVMList = New ObservableCollection(Of BTLLayerVM)
|
||||
For Each BTLLayerVMItem In BTLLayerVMList
|
||||
If Not IsNothing(BTLElementVMItem.BTLElementM.sGROUP) AndAlso
|
||||
Not IsNothing(BTLLayerVMItem.BTLLayerM.sGROUP) AndAlso
|
||||
BTLElementVMItem.BTLElementM.sGROUP = BTLLayerVMItem.BTLLayerM.sGROUP Then
|
||||
BTLElementVMItem.m_BTLLayerVMList.Add(BTLLayerVMItem)
|
||||
End If
|
||||
Next
|
||||
Next
|
||||
End If
|
||||
' creo lista di BTLPartVM
|
||||
CreateBTLPartVMList()
|
||||
m_BTLPartVMList = Me.m_BTLPartVMList
|
||||
m_BTLPartVMList_View = CollectionViewSource.GetDefaultView(m_BTLPartVMList)
|
||||
m_MaterialList_View = CollectionViewSource.GetDefaultView(m_MaterialList)
|
||||
m_GroupList_View = CollectionViewSource.GetDefaultView(m_GroupList)
|
||||
m_SubGroupList_View = CollectionViewSource.GetDefaultView(m_SubGroupList)
|
||||
m_SectionList_View = CollectionViewSource.GetDefaultView(m_SectionList)
|
||||
m_BTLPartVMList_View.Filter = AddressOf PartFilter
|
||||
m_MaterialList_View.Filter = AddressOf MaterialFilter
|
||||
m_GroupList_View.Filter = AddressOf GroupFilter
|
||||
m_SectionList_View.Filter = AddressOf SectionFilter
|
||||
m_Calc_PartEnd.Interval = TimeSpan.FromMilliseconds(500)
|
||||
AddHandler m_Calc_PartEnd.Tick, AddressOf Calc_PartEnd_Tick
|
||||
m_Calc_PartEnd.Start()
|
||||
' Aggiorno check DOALL
|
||||
NotifyPropertyChanged(NameOf(bDOALL))
|
||||
If BTLStructureM.nAsseBaseId = GDB_ID.NULL Then
|
||||
Map.refShowBeamPanelVM.SetShowBuilding(False)
|
||||
End If
|
||||
@@ -586,25 +832,59 @@ Public Class BTLStructureVM
|
||||
|
||||
#Region "METHODS"
|
||||
|
||||
Private Sub CreateBTLElementVMList()
|
||||
If IsNothing(m_BTLStructureM.GetBTLElements()) Then Return
|
||||
Dim all As List(Of BTLElementVM) = (From BTLElementM In m_BTLStructureM.GetBTLElements()
|
||||
Select New BTLElementVM(BTLElementM, m_BTLStructureM)).ToList()
|
||||
|
||||
'For Each BTLElementVM As BTLElementVM In all
|
||||
' AddHandler BTLElementVM.PropertyChanged, AddressOf OnBTLElementVMPropertyChanged
|
||||
'Next
|
||||
|
||||
m_BTLElementVMList = New ObservableCollection(Of BTLElementVM)(all)
|
||||
'AddHandler m_BTLElementVMList.CollectionChanged, AddressOf OnBTLElementVMListChanged
|
||||
End Sub
|
||||
|
||||
Private Sub CreateBTLLayerVMList()
|
||||
If IsNothing(m_BTLStructureM.GetBTLLayers()) Then Return
|
||||
Dim all As List(Of BTLLayerVM) = (From BTLLayerM In m_BTLStructureM.GetBTLLayers()
|
||||
Select New BTLLayerVM(BTLLayerM, m_BTLStructureM)).ToList()
|
||||
|
||||
'For Each BTLLayerVM As BTLLayerVM In all
|
||||
' AddHandler BTLLayerVM.PropertyChanged, AddressOf OnBTLLayerVMPropertyChanged
|
||||
'Next
|
||||
|
||||
m_BTLLayerVMList = New ObservableCollection(Of BTLLayerVM)(all)
|
||||
'AddHandler m_BTLLayerVMList.CollectionChanged, AddressOf OnBTLLayerVMListChanged
|
||||
End Sub
|
||||
|
||||
Private Sub CreateBTLPartVMList()
|
||||
Dim all As List(Of BTLPartVM) = (From BTLPartM In m_BTLStructureM.GetBTLParts()
|
||||
Select New BTLPartVM(BTLPartM, m_BTLStructureM)).ToList()
|
||||
|
||||
For Each BTLPartVM As BTLPartVM In all
|
||||
AddHandler BTLPartVM.PropertyChanged, AddressOf OnBTLPartVMPropertyChanged
|
||||
' verifico sezione e materiale per inserirli nei filtri
|
||||
If Not MaterialList.Contains(BTLPartVM.sMATERIAL) Then
|
||||
MaterialList.Add(BTLPartVM.sMATERIAL)
|
||||
End If
|
||||
If Not SectionList.Contains(BTLPartVM.Section) Then
|
||||
SectionList.Add(BTLPartVM.Section)
|
||||
End If
|
||||
Next
|
||||
|
||||
m_BTLPartVMList = New ObservableCollection(Of BTLPartVM)(all)
|
||||
AddHandler m_BTLPartVMList.CollectionChanged, AddressOf OnBTLPartVMListChanged
|
||||
End Sub
|
||||
|
||||
Friend Sub LoadFilters()
|
||||
For Each BTLPartVM As BTLPartVM In m_BTLPartVMList
|
||||
' verifico sezione, gruppo e sottogruppo per inserirli nei filtri
|
||||
If Not SectionList.Contains(BTLPartVM.Section) Then
|
||||
SectionList.Add(BTLPartVM.Section)
|
||||
End If
|
||||
If Not GroupList.Contains(BTLPartVM.sGROUP) Then
|
||||
GroupList.Add(BTLPartVM.sGROUP)
|
||||
End If
|
||||
If Not SubGroupList.Contains(BTLPartVM.sSTOREY) Then
|
||||
SubGroupList.Add(BTLPartVM.sSTOREY)
|
||||
End If
|
||||
Next
|
||||
End Sub
|
||||
|
||||
Private Sub Calc_PartEnd_Tick()
|
||||
' se calcolo non in corso (mainmenu e' attivo), esco
|
||||
If Map.refMainMenuVM.MainMenu_IsEnabled Then Return
|
||||
@@ -617,14 +897,14 @@ Public Class BTLStructureVM
|
||||
Next
|
||||
End Sub
|
||||
|
||||
Private Sub SceneSelPartSelection()
|
||||
Friend Sub SceneSelPartSelection()
|
||||
' deseleziono tutto
|
||||
EgtDeselectAll()
|
||||
' disabilito impostazione modificato
|
||||
Dim DisableMgr As New DisableModifiedMgr
|
||||
' ciclo sui pezzi
|
||||
For Each Part As BTLPartVM In m_BTLPartVMList
|
||||
' se non è quello selezionato, lo nasondo
|
||||
' se non è quello selezionato, lo nascondo
|
||||
If Part IsNot m_SelBTLPart Then
|
||||
EgtSetMode(Part.nPartId, GDB_MD.HIDDEN)
|
||||
Else
|
||||
@@ -635,6 +915,26 @@ Public Class BTLStructureVM
|
||||
DisableMgr.ReEnable()
|
||||
End Sub
|
||||
|
||||
Friend Sub SceneSelPartInLayerSelection()
|
||||
' deseleziono tutto
|
||||
EgtDeselectAll()
|
||||
' disabilito impostazione modificato
|
||||
Dim DisableMgr As New DisableModifiedMgr
|
||||
' ciclo sui pezzi
|
||||
If Not IsNothing(m_SelBTLLayer.SelBTLPart) Then
|
||||
For Each Part As BTLPartVM In m_SelBTLLayer.BTLPartVMList
|
||||
' se non è quello selezionato, lo nascondo
|
||||
If Not Part.nPartId = m_SelBTLLayer.SelBTLPart.nPartId Then
|
||||
EgtSetMode(Part.nPartId, GDB_MD.HIDDEN)
|
||||
Else
|
||||
EgtSetMode(Part.nPartId, GDB_MD.STD)
|
||||
End If
|
||||
Next
|
||||
End If
|
||||
' ripristino precedente impostazione modificato
|
||||
DisableMgr.ReEnable()
|
||||
End Sub
|
||||
|
||||
Friend Sub ShowAll(Optional bRedraw As Boolean = True)
|
||||
' disabilito impostazione modificato
|
||||
Dim DisableMgr As New DisableModifiedMgr
|
||||
@@ -655,7 +955,7 @@ Public Class BTLStructureVM
|
||||
BTLPartIdList.Sort()
|
||||
Dim nGeomPartId As Integer = EgtGetFirstPart()
|
||||
While nGeomPartId <> GDB_ID.NULL
|
||||
Dim CurrPart As BTLPartVM = BTLPartVMList.FirstOrDefault(Function(x) x.nPartId = nGeomPartId)
|
||||
Dim CurrPart As BTLPartVM = If(Not IsNothing(SelBTLLayer), SelBTLLayer.BTLPartVMList.FirstOrDefault(Function(x) x.nPartId = nGeomPartId), BTLPartVMList.FirstOrDefault(Function(x) x.nPartId = nGeomPartId))
|
||||
If Not IsNothing(CurrPart) Then
|
||||
Dim nMode As Integer
|
||||
EgtGetMode(CurrPart.nPartId, nMode)
|
||||
@@ -877,24 +1177,41 @@ Public Class BTLStructureVM
|
||||
|
||||
Private Function PartFilter(Part As Object) As Boolean
|
||||
Dim CurrBTLPart As BTLPartVM = DirectCast(Part, BTLPartVM)
|
||||
Dim bMaterialOk As Boolean = True
|
||||
Dim bGroupOk As Boolean = True
|
||||
Dim bSubGroupOk As Boolean = True
|
||||
Dim bSectionOk As Boolean = True
|
||||
Dim bSearchTextOk As Boolean = True
|
||||
If SelMaterial <> "" AndAlso CurrBTLPart.sMATERIAL <> SelMaterial Then bMaterialOk = False
|
||||
If SelSection <> SectionXMaterial.Empty AndAlso CurrBTLPart.Section <> SelSection Then bSectionOk = False
|
||||
'If SearchText <> "" AndAlso CurrBTLPart.sNAM.IndexOf(SearchText, StringComparison.InvariantCultureIgnoreCase) < 0 Then bSectionOk = False
|
||||
If SelGroup <> "" AndAlso CurrBTLPart.sGROUP <> SelGroup Then bGroupOk = False
|
||||
If SelSubGroup <> "" AndAlso CurrBTLPart.sSTOREY <> SelSubGroup Then bSubGroupOk = False
|
||||
If m_SelSearchParam.Id <> BTLPartParam.NULL AndAlso m_SearchText <> String.Empty AndAlso (
|
||||
(m_SelSearchParam.Id = BTLPartParam.PDN AndAlso CurrBTLPart.nPDN.ToString.IndexOf(SearchText, StringComparison.InvariantCultureIgnoreCase) < 0) OrElse
|
||||
(m_SelSearchParam.Id = BTLPartParam.NAM AndAlso CurrBTLPart.sNAM.IndexOf(SearchText, StringComparison.InvariantCultureIgnoreCase) < 0) OrElse
|
||||
(m_SelSearchParam.Id = BTLPartParam.GRP AndAlso (IsNothing(CurrBTLPart.sGROUP) OrElse CurrBTLPart.sGROUP.ToString.IndexOf(SearchText, StringComparison.InvariantCultureIgnoreCase)) < 0)) Then bSectionOk = False
|
||||
Return (bMaterialOk AndAlso bSectionOk)
|
||||
(m_SelSearchParam.Id = BTLPartParam.NAM AndAlso CurrBTLPart.sNAM.IndexOf(SearchText, StringComparison.InvariantCultureIgnoreCase) < 0)) Then
|
||||
bSearchTextOk = False
|
||||
End If
|
||||
Return bSectionOk AndAlso bGroupOk AndAlso bSubGroupOk AndAlso bSearchTextOk
|
||||
End Function
|
||||
|
||||
Private Function MaterialFilter(Material As Object) As Boolean
|
||||
Dim CurrMaterial As String = DirectCast(Material, String)
|
||||
Private Function GroupFilter(Group As Object) As Boolean
|
||||
Dim CurrGroup As String = DirectCast(Group, String)
|
||||
Dim bOk As Boolean = True
|
||||
If SelSection <> SectionXMaterial.Empty AndAlso SearchText <> "" AndAlso CurrMaterial <> "" Then
|
||||
bOk = m_BTLPartVMList.Any(Function(x) x.sMATERIAL = CurrMaterial AndAlso x.Section = SelSection AndAlso Not x.sNAM.IndexOf(SearchText, StringComparison.InvariantCultureIgnoreCase) >= 0)
|
||||
If CurrGroup <> "" AndAlso (SelSection <> SectionXMaterial.Empty OrElse SelSubGroup <> "" OrElse SearchText <> "") Then
|
||||
bOk = m_BTLPartVMList.Any(Function(x) x.sGROUP = CurrGroup AndAlso
|
||||
(SelSection = SectionXMaterial.Empty OrElse x.Section = SelSection) AndAlso
|
||||
(SelSubGroup = "" OrElse x.sSTOREY = SelSubGroup) AndAlso
|
||||
(SearchText = "" OrElse Not x.sNAM.IndexOf(SearchText, StringComparison.InvariantCultureIgnoreCase) >= 0))
|
||||
End If
|
||||
Return bOk
|
||||
End Function
|
||||
|
||||
Private Function SubGroupFilter(SubGroup As Object) As Boolean
|
||||
Dim CurrSubGroup As String = DirectCast(SubGroup, String)
|
||||
Dim bOk As Boolean = True
|
||||
If CurrSubGroup <> "" AndAlso (SelSection <> SectionXMaterial.Empty OrElse SearchText <> "" OrElse SelGroup <> "") Then
|
||||
bOk = m_BTLPartVMList.Any(Function(x) x.sGROUP = CurrSubGroup AndAlso
|
||||
(SelSection = SectionXMaterial.Empty OrElse x.Section = SelSection) AndAlso
|
||||
(SelGroup = "" OrElse x.sGROUP = SelGroup) AndAlso
|
||||
(SearchText = "" OrElse Not x.sNAM.IndexOf(SearchText, StringComparison.InvariantCultureIgnoreCase) >= 0))
|
||||
End If
|
||||
Return bOk
|
||||
End Function
|
||||
@@ -902,8 +1219,11 @@ Public Class BTLStructureVM
|
||||
Private Function SectionFilter(Section As Object) As Boolean
|
||||
Dim CurrSection As SectionXMaterial = DirectCast(Section, SectionXMaterial)
|
||||
Dim bOk As Boolean = True
|
||||
If SelMaterial <> "" AndAlso SearchText <> "" AndAlso CurrSection <> Section.Empty Then
|
||||
bOk = m_BTLPartVMList.Any(Function(x) x.sMATERIAL = SelMaterial AndAlso x.Section = CurrSection AndAlso Not x.sNAM.IndexOf(SearchText, StringComparison.InvariantCultureIgnoreCase) >= 0)
|
||||
If CurrSection <> Section.Empty AndAlso (SelGroup <> "" OrElse SelSubGroup <> "" OrElse SearchText <> "") Then
|
||||
bOk = m_BTLPartVMList.Any(Function(x) x.Section = CurrSection AndAlso
|
||||
(SelGroup = "" OrElse x.sGROUP = SelGroup) AndAlso
|
||||
(SelSubGroup = "" OrElse x.sSTOREY = SelSubGroup) AndAlso
|
||||
(SearchText = "" OrElse Not x.sNAM.IndexOf(SearchText, StringComparison.InvariantCultureIgnoreCase) >= 0))
|
||||
End If
|
||||
Return bOk
|
||||
End Function
|
||||
@@ -913,16 +1233,16 @@ Public Class BTLStructureVM
|
||||
'If Map.refProjectVM.BTLStructureVM.nPROJTYPE = MachineType.BEAM Then
|
||||
' verifico se era unico con vecchia sezione
|
||||
If Not m_BTLPartVMList.Any(Function(x) x.Section = OldPartSection) Then
|
||||
' nel caso seleziono filtro generico
|
||||
SelSection = m_SectionList(0)
|
||||
' e poi lo cerco ed elimino
|
||||
m_SectionList.FirstOrDefault(Function(x) x = OldPartSection)
|
||||
m_SectionList.Remove(m_SectionList.FirstOrDefault(Function(x) x = OldPartSection))
|
||||
End If
|
||||
' verifico se esiste già nuova sezione
|
||||
If Not m_SectionList.Any(Function(x) x = NewPartSection) Then
|
||||
m_SectionList.Add(NewPartSection)
|
||||
End If
|
||||
' nel caso seleziono filtro generico
|
||||
SelSection = m_SectionList(0)
|
||||
' e poi lo cerco ed elimino
|
||||
m_SectionList.FirstOrDefault(Function(x) x = OldPartSection)
|
||||
m_SectionList.Remove(m_SectionList.FirstOrDefault(Function(x) x = OldPartSection))
|
||||
End If
|
||||
' verifico se esiste già nuova sezione
|
||||
If Not m_SectionList.Any(Function(x) x = NewPartSection) Then
|
||||
m_SectionList.Add(NewPartSection)
|
||||
End If
|
||||
'ElseIf Map.refProjectVM.BTLStructureVM.nPROJTYPE = MachineType.WALL Then
|
||||
' ' se ruoto o inverto parete, la sezione non cambia
|
||||
'End If
|
||||
@@ -983,8 +1303,8 @@ Public Class BTLStructureVM
|
||||
Private Sub OnBTLPartVMPropertyChanged(sender As Object, e As PropertyChangedEventArgs)
|
||||
Select Case e.PropertyName
|
||||
Case NameOf(sender.sMATERIAL)
|
||||
If Not MaterialList.Contains(sender.sMATERIAL) Then
|
||||
MaterialList.Add(sender.sMATERIAL)
|
||||
If Not GroupList.Contains(sender.sMATERIAL) Then
|
||||
GroupList.Add(sender.sMATERIAL)
|
||||
End If
|
||||
Case NameOf(sender.sW), NameOf(sender.sH), NameOf(sender.sL)
|
||||
'If Not SectionList.Contains(sender.Section) Then
|
||||
@@ -994,6 +1314,8 @@ Public Class BTLStructureVM
|
||||
' UpdateSection(CType(sender, BTLPartVM).BTLPartM)
|
||||
Case NameOf(sender.nDONE)
|
||||
NotifyPropertyChanged(NameOf(sBTLRemainingTime))
|
||||
Case NameOf(sender.bDOALL)
|
||||
NotifyPropertyChanged(NameOf(bDOALL))
|
||||
End Select
|
||||
End Sub
|
||||
|
||||
|
||||
@@ -148,7 +148,7 @@ Public Class CALCPanelVM
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property ResetCalc_ToopTip As String
|
||||
Public ReadOnly Property ResetCalc_ToolTip As String
|
||||
Get
|
||||
Return EgtMsg(61940)
|
||||
End Get
|
||||
@@ -304,11 +304,23 @@ Public Class CALCPanelVM
|
||||
' Inizializzo il pezzo in verifica
|
||||
Dim BTLPart As BTLPartVM = GetBTLPartVMFromBTLPartId(Bar.nBarId)
|
||||
BTLPart.CalcPartUpdate(0, 0, "")
|
||||
' Resetto feature in collisione
|
||||
For Each Feature In BTLPart.m_BTLFeatureVMList
|
||||
If Feature.nState = CalcStates.COLLISION Then
|
||||
Feature.CalcFeatureUpdate(0, 0, "")
|
||||
End If
|
||||
Next
|
||||
Else
|
||||
' Inizializzo i pezzi del gruppo di lavoro in verifica
|
||||
Dim Machgroup As MyMachGroupVM = GetMachgroupVMFromMachgroupId(Bar.nBarId)
|
||||
For Each Part In Machgroup.PartVMList
|
||||
For Each Part As PartVM In Machgroup.PartVMList
|
||||
Part.CalcPartUpdate(0, 0, "")
|
||||
' Resetto feature in collisione
|
||||
For Each Feature As BTLFeatureVM In Part.FeatureVMList
|
||||
If Feature.nState = CalcStates.COLLISION Then
|
||||
Feature.CalcFeatureUpdate(0, 0, "")
|
||||
End If
|
||||
Next
|
||||
Next
|
||||
Machgroup.CalcMachGroupUpdate(0, 0, "")
|
||||
End If
|
||||
@@ -728,7 +740,7 @@ Public Class CALCPanelVM
|
||||
Case Core.CalcStates.OK, CalcStates.INFO
|
||||
Bar.nCmdType = CalcIntegration.CmdTypes.GENERATE
|
||||
Case Else
|
||||
If CurrPart.nGlobalState = CalcStates.NOTCALCULATED Then
|
||||
If CurrPart.nGlobalState = CalcStates.NOTCALCULATED OrElse CurrPart.nFeaturesGlobalState > CalcStates.INFO Then
|
||||
Dim sBTLPartFilePath As String = Map.refProjManagerVM.CurrProj.sProjDirPath & "\" & CurrPart.nPDN.ToString() & ".ori.bwe"
|
||||
If File.Exists(sBTLPartFilePath) Then File.Delete(sBTLPartFilePath)
|
||||
End If
|
||||
@@ -759,7 +771,7 @@ Public Class CALCPanelVM
|
||||
Case Core.CalcStates.OK, CalcStates.INFO
|
||||
Bar.nCmdType = CalcIntegration.CmdTypes.GENERATE
|
||||
Case Else
|
||||
If CurrMachGroup.nGlobalState = CalcStates.NOTCALCULATED Then
|
||||
If CurrMachGroup.nGlobalState = CalcStates.NOTCALCULATED OrElse (CurrMachGroup.nPartsGlobalState > CalcStates.INFO) Then
|
||||
Dim sMachGroupFilePath As String = Map.refProdManagerVM.CurrProd.sProdDirPath & "\" & CurrMachGroup.Name.ToString() & ".ori.bwe"
|
||||
If File.Exists(sMachGroupFilePath) Then File.Delete(sMachGroupFilePath)
|
||||
End If
|
||||
@@ -767,6 +779,7 @@ Public Class CALCPanelVM
|
||||
End Select
|
||||
TempBarList.Add(Bar)
|
||||
Next
|
||||
If TempBarList.Count = 0 Then Return
|
||||
BarList = TempBarList.ToArray()
|
||||
' disabilito interfaccia
|
||||
Map.refProjectVM.SetCalcRunning(True)
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
<Image Source="/Resources/CALCPanel/VerifyAll.png" Stretch="Uniform"/>
|
||||
</Button>
|
||||
<Button Command="{Binding ResetCalc_Command}"
|
||||
ToolTip="{Binding ResetCalc_ToopTip}"
|
||||
ToolTip="{Binding ResetCalc_ToolTip}"
|
||||
IsEnabled="{Binding CALCPanel_IsEnabled}"
|
||||
Style="{StaticResource ToolBar_Button}">
|
||||
<Image Source="/Resources/CALCPanel/ResetCalc.png" Stretch="Uniform"/>
|
||||
|
||||
@@ -0,0 +1,77 @@
|
||||
<EgtWPFLib5:EgtCustomWindow x:Class="ChangeMaterialWndV"
|
||||
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.ViewerOptimizer"
|
||||
Style="{DynamicResource {x:Type EgtWPFLib5:EgtCustomWindow}}"
|
||||
WindowStyle="None" ResizeMode="NoResize"
|
||||
SizeToContent="WidthAndHeight"
|
||||
WindowStartupLocation="CenterOwner"
|
||||
IsClosable="False"
|
||||
IsMinimizable="False"
|
||||
IsResizable="False"
|
||||
Title="ChangeMaterialWnd">
|
||||
|
||||
<Grid Margin="5,5,5,0">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<Grid HorizontalAlignment="Center"
|
||||
Grid.Row="0"
|
||||
Margin="0,0,0,5">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
</Grid.RowDefinitions>
|
||||
<TextBlock Text="{Binding ProjMaterial_Msg}"
|
||||
Style="{StaticResource OptionTextBlock}"/>
|
||||
<ComboBox ItemsSource="{Binding ProjMaterialList}"
|
||||
SelectedItem="{Binding SelProjMaterial}"
|
||||
Grid.Column="1"
|
||||
Width="150"
|
||||
Style="{StaticResource FeatureComboBox}"/>
|
||||
</Grid>
|
||||
<Grid HorizontalAlignment="Center"
|
||||
Grid.Row="1"
|
||||
Margin="0,0,0,5">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBlock Text="{Binding WjMaterial_Msg}"
|
||||
Style="{StaticResource OptionTextBlock}"/>
|
||||
<ComboBox ItemsSource="{Binding WhMaterialList}"
|
||||
SelectedItem="{Binding SelWhMaterial}"
|
||||
Grid.Column="1"
|
||||
Width="150"
|
||||
Style="{StaticResource FeatureComboBox}"/>
|
||||
</Grid>
|
||||
|
||||
<Grid Grid.Row="2"
|
||||
Margin="0,0,0,5">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Button Content="{Binding Ok_Msg}"
|
||||
Command="{Binding Ok_Command}"
|
||||
IsDefault="True"
|
||||
Grid.Column="1"
|
||||
Style="{StaticResource EgtWPFLib5_InputButton}"/>
|
||||
<Button Content="{Binding Cancel_Msg}"
|
||||
IsCancel="True"
|
||||
Grid.Column="3"
|
||||
Style="{StaticResource EgtWPFLib5_InputButton}"/>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</EgtWPFLib5:EgtCustomWindow>
|
||||
@@ -0,0 +1,18 @@
|
||||
Public Class ChangeMaterialWndV
|
||||
|
||||
Private WithEvents m_ChangeMaterialWndVM As ChangeMaterialWndVM
|
||||
|
||||
Sub New(Owner As Window, ChangeMaterialWndVM As ChangeMaterialWndVM)
|
||||
MyBase.New(Owner)
|
||||
' This call is required by the designer.
|
||||
InitializeComponent()
|
||||
Me.DataContext = ChangeMaterialWndVM
|
||||
' Assegno al riferimento locale al VM il VM preso dal DataContext
|
||||
m_ChangeMaterialWndVM = ChangeMaterialWndVM
|
||||
End Sub
|
||||
|
||||
Private Sub CloseWindow(bDialogResult As Boolean) Handles m_ChangeMaterialWndVM.m_CloseWindow
|
||||
Me.DialogResult = bDialogResult
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
@@ -0,0 +1,140 @@
|
||||
Imports System.Collections.ObjectModel
|
||||
Imports EgtUILib
|
||||
Imports EgtWPFLib5
|
||||
Imports EgtBEAMWALL.Core
|
||||
|
||||
Public Class ChangeMaterialWndVM
|
||||
Inherits VMBase
|
||||
|
||||
#Region "FIELDS & PROPERTIES"
|
||||
|
||||
Friend Event m_CloseWindow(bDialogResult As Boolean)
|
||||
|
||||
Private m_ProjMaterialList As New ObservableCollection(Of String)
|
||||
Public Property ProjMaterialList As ObservableCollection(Of String)
|
||||
Get
|
||||
Return m_ProjMaterialList
|
||||
End Get
|
||||
Set(value As ObservableCollection(Of String))
|
||||
m_ProjMaterialList = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_SelProjMaterial As String
|
||||
Public Property SelProjMaterial As String
|
||||
Get
|
||||
Return m_SelProjMaterial
|
||||
End Get
|
||||
Set(value As String)
|
||||
m_SelProjMaterial = value
|
||||
NotifyPropertyChanged(NameOf(SelProjMaterial))
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_WhMaterialList As New ObservableCollection(Of String)
|
||||
Public Property WhMaterialList As ObservableCollection(Of String)
|
||||
Get
|
||||
Return m_WhMaterialList
|
||||
End Get
|
||||
Set(value As ObservableCollection(Of String))
|
||||
m_WhMaterialList = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_SelWhMaterial As String
|
||||
Public Property SelWhMaterial As String
|
||||
Get
|
||||
Return m_SelWhMaterial
|
||||
End Get
|
||||
Set(value As String)
|
||||
m_SelWhMaterial = value
|
||||
NotifyPropertyChanged(NameOf(SelWhMaterial))
|
||||
End Set
|
||||
End Property
|
||||
|
||||
' Definizione comandi
|
||||
Private m_cmdOk As ICommand
|
||||
|
||||
#End Region ' FIELDS & PROPERTIES
|
||||
|
||||
#Region "MESSAGES"
|
||||
|
||||
Public ReadOnly Property ProjMaterial_Msg As String
|
||||
Get
|
||||
Return EgtMsg(61962)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property WjMaterial_Msg As String
|
||||
Get
|
||||
Return EgtMsg(61963)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property Ok_Msg As String
|
||||
Get
|
||||
Return EgtMsg(61761)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property Cancel_Msg As String
|
||||
Get
|
||||
Return EgtMsg(61763)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
#End Region ' MESSAGES
|
||||
|
||||
#Region "CONSTRUCTOR"
|
||||
|
||||
Sub New()
|
||||
' recupero i materiali del progetto
|
||||
m_ProjMaterialList.Clear()
|
||||
For Each BTLPart In Map.refProjectVM.BTLStructureVM.BTLPartVMList
|
||||
If Not m_ProjMaterialList.Contains(BTLPart.sMATERIAL) Then
|
||||
m_ProjMaterialList.Add(BTLPart.sMATERIAL)
|
||||
End If
|
||||
Next
|
||||
' recupero la lista dei SectionXMaterial presenti in Warehouse
|
||||
Dim WhSectXMatList As List(Of SectionXMaterial) = WarehouseWndVM.GetSectionXMaterialsFromWarehouse()
|
||||
' ricavo la lista dei materiali presenti in Warehouse
|
||||
m_WhMaterialList.Clear()
|
||||
For Each WhSectXMat In WhSectXMatList
|
||||
For Each sMatItem In WhSectXMat.sMaterial
|
||||
If Not m_WhMaterialList.Contains(sMatItem) Then
|
||||
m_WhMaterialList.Add(sMatItem)
|
||||
End If
|
||||
Next
|
||||
Next
|
||||
End Sub
|
||||
|
||||
#End Region ' CONSTRUCTOR
|
||||
|
||||
#Region "COMMANDS"
|
||||
|
||||
#Region "Ok"
|
||||
|
||||
Public ReadOnly Property Ok_Command As ICommand
|
||||
Get
|
||||
If m_cmdOk Is Nothing Then
|
||||
m_cmdOk = New Command(AddressOf Ok)
|
||||
End If
|
||||
Return m_cmdOk
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public Sub Ok()
|
||||
'verifico che tutti i campi contengano un valore valido
|
||||
If Not IsNothing(m_SelProjMaterial) AndAlso m_SelProjMaterial <> "" AndAlso
|
||||
Not IsNothing(m_SelWhMaterial) AndAlso m_SelWhMaterial <> "" Then
|
||||
RaiseEvent m_CloseWindow(True)
|
||||
Else
|
||||
MessageBox.Show(EgtMsg(61858), EgtMsg(30007))
|
||||
End If
|
||||
End Sub
|
||||
|
||||
#End Region ' Ok
|
||||
|
||||
#End Region ' COMMANDS
|
||||
|
||||
End Class
|
||||
@@ -1,105 +1,78 @@
|
||||
<EgtWPFLib5:EgtCustomWindow x:Class="ChangeParameterWndV"
|
||||
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.ViewerOptimizer"
|
||||
Style="{DynamicResource {x:Type EgtWPFLib5:EgtCustomWindow}}"
|
||||
WindowStyle="None" ResizeMode="NoResize"
|
||||
SizeToContent="WidthAndHeight"
|
||||
WindowStartupLocation="CenterOwner"
|
||||
IsClosable="False"
|
||||
IsMinimizable="False"
|
||||
IsResizable="False"
|
||||
Title="ChangeParameterWnd">
|
||||
|
||||
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.ViewerOptimizer"
|
||||
Style="{DynamicResource {x:Type EgtWPFLib5:EgtCustomWindow}}"
|
||||
WindowStyle="None" ResizeMode="NoResize"
|
||||
SizeToContent="Height"
|
||||
Width="300"
|
||||
WindowStartupLocation="CenterOwner"
|
||||
IsClosable="False"
|
||||
IsMinimizable="False"
|
||||
IsResizable="False"
|
||||
Title="ChangeParameterWnd">
|
||||
|
||||
<Grid Margin="5,5,5,0">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="2*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="5"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="5"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="5"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="5"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<Grid HorizontalAlignment="Center"
|
||||
Grid.Row="0"
|
||||
Margin="0,0,0,5">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
</Grid.RowDefinitions>
|
||||
<TextBlock Text="Process"
|
||||
Style="{StaticResource OptionTextBlock}"/>
|
||||
<ComboBox ItemsSource="{Binding PRCList}"
|
||||
SelectedItem="{Binding SelPRC}"
|
||||
DisplayMemberPath="ghDesc"
|
||||
Width="150"
|
||||
Grid.Column="1"
|
||||
Style="{StaticResource FeatureComboBox}"/>
|
||||
</Grid>
|
||||
<Grid HorizontalAlignment="Center"
|
||||
Grid.Row="1"
|
||||
Margin="0,0,0,5">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBlock Text="Parameter"
|
||||
Style="{StaticResource OptionTextBlock}"/>
|
||||
<ComboBox ItemsSource="{Binding ParamList}"
|
||||
SelectedItem="{Binding SelParam}"
|
||||
DisplayMemberPath="sNameAndDescription"
|
||||
Grid.Column="1"
|
||||
Width="100"
|
||||
Style="{StaticResource FeatureComboBox}"/>
|
||||
</Grid>
|
||||
<Grid HorizontalAlignment="Center"
|
||||
Grid.Row="2"
|
||||
Height="22"
|
||||
Margin="0,0,0,5">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBlock Text="Actual value"
|
||||
Style="{StaticResource OptionTextBlock}"/>
|
||||
<EgtWPFLib5:EgtTextBox Text="{Binding SelParam.sActualValue}"
|
||||
Grid.Column="1"
|
||||
Width="45"
|
||||
Visibility="{Binding SelParam.IsTextBox_Visibility}"/>
|
||||
<CheckBox IsChecked="{Binding SelParam.bActualValue}"
|
||||
Grid.Column="1"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"
|
||||
Visibility="{Binding SelParam.IsCheckBox_Visibility}"/>
|
||||
</Grid>
|
||||
<TextBlock Text="Process"
|
||||
Style="{StaticResource OptionTextBlock}"/>
|
||||
<ComboBox Grid.Column="1"
|
||||
ItemsSource="{Binding PRCList}"
|
||||
SelectedItem="{Binding SelPRC}"
|
||||
DisplayMemberPath="ghDesc"
|
||||
HorizontalAlignment="Stretch"
|
||||
Style="{StaticResource FeatureComboBox}"/>
|
||||
|
||||
<Grid HorizontalAlignment="Center"
|
||||
Grid.Row="3"
|
||||
Height="22"
|
||||
Margin="0,0,0,5">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBlock Text="New Value"
|
||||
Style="{StaticResource OptionTextBlock}"/>
|
||||
<EgtWPFLib5:EgtTextBox Text="{Binding SelParam.sNewValue}"
|
||||
Grid.Column="1"
|
||||
Width="45"
|
||||
Visibility="{Binding SelParam.IsTextBox_Visibility}"/>
|
||||
<CheckBox IsChecked="{Binding SelParam.bNewValue}"
|
||||
Grid.Column="1"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"
|
||||
Visibility="{Binding SelParam.IsCheckBox_Visibility}"/>
|
||||
</Grid>
|
||||
<TextBlock Grid.Row="2"
|
||||
Text="Parameter"
|
||||
Style="{StaticResource OptionTextBlock}"/>
|
||||
<ComboBox Grid.Row="2" Grid.Column="1"
|
||||
ItemsSource="{Binding ParamList}"
|
||||
SelectedItem="{Binding SelParam}"
|
||||
DisplayMemberPath="sNameAndDescription"
|
||||
HorizontalAlignment="Stretch"
|
||||
Style="{StaticResource FeatureComboBox}"/>
|
||||
|
||||
<Grid Grid.Row="4"
|
||||
<TextBlock Grid.Row="4"
|
||||
Text="Actual value"
|
||||
Style="{StaticResource OptionTextBlock}"/>
|
||||
<EgtWPFLib5:EgtTextBox Grid.Row="4" Grid.Column="1"
|
||||
Text="{Binding SelParam.sActualValue}"
|
||||
Visibility="{Binding SelParam.IsTextBox_Visibility}"/>
|
||||
<CheckBox Grid.Row="4" Grid.Column="1"
|
||||
IsChecked="{Binding SelParam.bActualValue}"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"
|
||||
Visibility="{Binding SelParam.IsCheckBox_Visibility}"/>
|
||||
|
||||
<TextBlock Grid.Row="6" Text="New Value"
|
||||
Style="{StaticResource OptionTextBlock}"/>
|
||||
<EgtWPFLib5:EgtTextBox Grid.Row="6" Grid.Column="1"
|
||||
Text="{Binding SelParam.sNewValue}"
|
||||
Visibility="{Binding SelParam.IsTextBox_Visibility}"/>
|
||||
<CheckBox Grid.Row="6" Grid.Column="1"
|
||||
IsChecked="{Binding SelParam.bNewValue}"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"
|
||||
Visibility="{Binding SelParam.IsCheckBox_Visibility}"/>
|
||||
|
||||
<Grid Grid.Row="8" Grid.ColumnSpan="2"
|
||||
Margin="0,0,0,5">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
|
||||
@@ -42,6 +42,9 @@ Public Class ChangeParameterWndVM
|
||||
'End While
|
||||
' aggiungo bDO come parametro
|
||||
m_ParamList.Add(New Parameters(NewBTLParam, True))
|
||||
' seleziono parametro vuoto per dargli un valore iniziale ed evitare che visualizzi sia text che check
|
||||
m_SelParam = New Parameters(BTLParamM.CreateNewBTLParam())
|
||||
NotifyPropertyChanged(NameOf(SelParam))
|
||||
End If
|
||||
End Set
|
||||
End Property
|
||||
@@ -78,11 +81,15 @@ Public Class ChangeParameterWndVM
|
||||
GetBeamPrivateProfileProcessList(GRPType.T, TempPRCList)
|
||||
m_PRCList.Clear()
|
||||
For Each PRC In TempPRCList
|
||||
m_PRCList.Add(New PRC(GRPType.T, PRC, GetBeamPrivateProfileName(GRPType.T, PRC)))
|
||||
If Not IsNothing(Map.refProjectVM.BTLStructureVM) AndAlso Map.refProjectVM.BTLStructureVM.BTLPartVMList.Any(Function(x) x.BTLFeatureVMList.Any(Function(y) y.nPRC = PRC AndAlso CalcBeamPrivateProfileGRP(y.nSelGRP) = 1)) Then
|
||||
m_PRCList.Add(New PRC(GRPType.T, PRC, GetBeamPrivateProfileName(GRPType.T, PRC)))
|
||||
End If
|
||||
Next
|
||||
GetBeamPrivateProfileProcessList(GRPType.L, TempPRCList)
|
||||
For Each PRC In TempPRCList
|
||||
m_PRCList.Add(New PRC(GRPType.L, PRC, GetBeamPrivateProfileName(GRPType.L, PRC)))
|
||||
If Not IsNothing(Map.refProjectVM.BTLStructureVM) AndAlso Map.refProjectVM.BTLStructureVM.BTLPartVMList.Any(Function(x) x.BTLFeatureVMList.Any(Function(y) y.nPRC = PRC AndAlso CalcBeamPrivateProfileGRP(y.nSelGRP) = 0)) Then
|
||||
m_PRCList.Add(New PRC(GRPType.L, PRC, GetBeamPrivateProfileName(GRPType.L, PRC)))
|
||||
End If
|
||||
Next
|
||||
End Sub
|
||||
|
||||
|
||||
@@ -13,5 +13,6 @@
|
||||
Public Const K_QUANTITY As String = "Quantity"
|
||||
Public Const K_L As String = "L"
|
||||
Public Const K_S As String = "S"
|
||||
Public Const K_RANGE As String = "Range"
|
||||
|
||||
End Module
|
||||
|
||||
@@ -165,6 +165,28 @@
|
||||
<Compile Include="AboutBoxWindow\AboutBoxV.xaml.vb">
|
||||
<DependentUpon>AboutBoxV.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="LayersWallBottomPanel\LayersWallBottomPanelV.xaml.vb">
|
||||
<DependentUpon>LayersWallBottomPanelV.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="LayersWallBottomPanel\LayersWallBottomPanelVM.vb" />
|
||||
<Compile Include="BTLViewModel\BTLLayerVM.vb" />
|
||||
<Compile Include="BTLViewModel\BTLElementVM.vb" />
|
||||
<Compile Include="ChangeMaterialWnd\ChangeMaterialWndV.xaml.vb">
|
||||
<DependentUpon>ChangeMaterialWndV.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="ChangeMaterialWnd\ChangeMaterialWndVM.vb" />
|
||||
<Compile Include="ElementLayerTreeView\ElementLayerTreeView.vb" />
|
||||
<Compile Include="ElementLayerTreeView\ElementLayerTreeViewV.xaml.vb">
|
||||
<DependentUpon>ElementLayerTreeViewV.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="ElementLayerTreeView\ElementLayerTreeViewVM.vb" />
|
||||
<Compile Include="LayersWallFeatureList\LayersWallFeatureListV.xaml.vb">
|
||||
<DependentUpon>LayersWallFeatureListV.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="LayersWallLeftPanel\LayersWallLeftPanelV.xaml.vb">
|
||||
<DependentUpon>LayersWallLeftPanelV.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="LayersWallLeftPanel\LayersWallLeftPanelVM.vb" />
|
||||
<Compile Include="MovePartInRawPartWnd\MovePartInRawPartWndV.xaml.vb">
|
||||
<DependentUpon>MovePartInRawPartWndV.xaml</DependentUpon>
|
||||
</Compile>
|
||||
@@ -229,11 +251,19 @@
|
||||
<DependentUpon>NestingRunningWndV.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="NestingRunningWnd\NestingRunningWndVM.vb" />
|
||||
<Compile Include="LayersWallPartManager\LayersWallPartManagerV.xaml.vb">
|
||||
<DependentUpon>LayersWallPartManagerV.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="LayersWallPartManager\LayersWallPartManagerVM.vb" />
|
||||
<Compile Include="ProjectTypeWnd\ProjectTypeWndV.xaml.vb">
|
||||
<DependentUpon>ProjectTypeWndV.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="ProjectTypeWnd\ProjectTypeWndVM.vb" />
|
||||
<Compile Include="ProjectFileVM\ProdFileVM.vb" />
|
||||
<Compile Include="LayersWallProjManager\LayersWallProjManagerV.xaml.vb">
|
||||
<DependentUpon>LayersWallProjManagerV.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="LayersWallProjManager\LayersWallProjManagerVM.vb" />
|
||||
<Compile Include="SetUp\SetUpSupportClass.vb" />
|
||||
<Compile Include="SetUp\SetUpV.xaml.vb">
|
||||
<DependentUpon>SetUpV.xaml</DependentUpon>
|
||||
@@ -252,10 +282,17 @@
|
||||
<Compile Include="SupervisorCommThread\SupervisorCommThread.vb" />
|
||||
<Compile Include="ToolsDbWindow\MyToolDbWindowVM.vb" />
|
||||
<Compile Include="ToolsDbWindow\ToolsUpdate.vb" />
|
||||
<Compile Include="UpdateBTLWnd\UpdateOrAppendWndVM.vb" />
|
||||
<Compile Include="UpdateBTLWnd\UpdateBTLWndV.xaml.vb">
|
||||
<DependentUpon>UpdateBTLWndV.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="UpdateBTLWnd\UpdateBTLWndVM.vb" />
|
||||
<Compile Include="UpdateBTLWnd\UpdateOrAppendWndV.xaml.vb">
|
||||
<DependentUpon>UpdateOrAppendWndV.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Utility\DbControllers.vb" />
|
||||
<Compile Include="Utility\DisableModifiedMgr.vb" />
|
||||
<Compile Include="Utility\LuaExec.vb" />
|
||||
<Compile Include="Utility\ManageWindow.vb" />
|
||||
<Compile Include="Utility\SectionXMaterialToBeAdded.vb" />
|
||||
<Compile Include="Utility\TextBlockUtils.vb" />
|
||||
<Compile Include="Utility\TreeViewItemBase.vb" />
|
||||
@@ -357,6 +394,26 @@
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="LayersWallBottomPanel\LayersWallBottomPanelV.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Page Include="ChangeMaterialWnd\ChangeMaterialWndV.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Page Include="ElementLayerTreeView\ElementLayerTreeViewV.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="LayersWallFeatureList\LayersWallFeatureListV.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Page Include="LayersWallLeftPanel\LayersWallLeftPanelV.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Page Include="MovePartInRawPartWnd\MovePartInRawPartWndV.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
@@ -421,10 +478,18 @@
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="LayersWallPartManager\LayersWallPartManagerV.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Page Include="ProjectTypeWnd\ProjectTypeWndV.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Page Include="LayersWallProjManager\LayersWallProjManagerV.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Page Include="SetUp\SetUpV.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
@@ -437,6 +502,14 @@
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="UpdateBTLWnd\UpdateBTLWndV.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Page Include="UpdateBTLWnd\UpdateOrAppendWndV.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="WarehouseWnd\WarehouseWndV.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
|
||||
@@ -0,0 +1,123 @@
|
||||
Imports EgtUILib
|
||||
|
||||
''' <summary>
|
||||
''' Class that represent a Machining in the treeview.
|
||||
''' It's an element in the treeview that represent the child of familymachiningtreeviewitem, but also the class that read and write in the machining's database
|
||||
''' </summary>
|
||||
Public Class ElementLayerTreeViewItem
|
||||
Inherits ChildItem
|
||||
|
||||
#Region "Machining Property"
|
||||
|
||||
Private m_Type As MCH_MY
|
||||
Public ReadOnly Property Type As Integer
|
||||
Get
|
||||
Return m_Type
|
||||
End Get
|
||||
End Property
|
||||
|
||||
''' <summary>
|
||||
''' Property that determines if the Machining is selected or not
|
||||
''' </summary>
|
||||
Public Overrides Property IsSelected As Boolean
|
||||
Get
|
||||
Return m_isSelected
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
If (value <> m_isSelected) Then
|
||||
m_isSelected = value
|
||||
' If Machining is selected, set it as current and notify all machining's property
|
||||
' to refresh them values with those of the new selected machining
|
||||
If value Then
|
||||
EgtMdbSetCurrMachining(Me.Name)
|
||||
Else
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
End Set
|
||||
|
||||
End Property
|
||||
|
||||
Private m_Tool As String
|
||||
Public Property Tool As String
|
||||
Get
|
||||
Return m_Tool
|
||||
End Get
|
||||
Set(value As String)
|
||||
m_Tool = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
#End Region ' Machining Property
|
||||
|
||||
#Region "Constructors"
|
||||
|
||||
Sub New(Name As String, Tool As String)
|
||||
MyBase.New(Name)
|
||||
Me.Tool = If(Not String.IsNullOrEmpty(Tool), "(" & Tool & ")", String.Empty)
|
||||
End Sub
|
||||
|
||||
#End Region ' Constructors
|
||||
|
||||
End Class
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' Class that represent a FamilyMachining in the treeview.
|
||||
''' It's an element in the treeview that represent a folder, but also a machining family
|
||||
''' </summary>
|
||||
Public Class FamilyElementLayerTreeViewItem
|
||||
Inherits ParentItem
|
||||
|
||||
Private m_MachiningType As MCH_MY
|
||||
''' <summary>
|
||||
''' Property that determines the machining type of the family
|
||||
''' </summary>
|
||||
Public Property MachiningType As MCH_MY
|
||||
Get
|
||||
Return m_MachiningType
|
||||
End Get
|
||||
Set(value As MCH_MY)
|
||||
m_MachiningType = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
''' <summary>
|
||||
''' Property that determines if the Machining is selected or not
|
||||
''' </summary>
|
||||
Public Overrides Property IsSelected As Boolean
|
||||
Get
|
||||
Return m_isSelected
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
If (value <> m_isSelected) Then
|
||||
m_isSelected = value
|
||||
End If
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property sName As String
|
||||
Get
|
||||
Return "Prova"
|
||||
End Get
|
||||
End Property
|
||||
|
||||
''' <summary>
|
||||
''' Constructor that receive the name of the FamilyMachiningTreeViewItem, the MachiningType, and set
|
||||
''' the picture(Folder.png)
|
||||
''' </summary>
|
||||
Sub New(Name As String)
|
||||
MyBase.New(Name)
|
||||
Me.PictureString = "/Resources/TreeView/Folder.png"
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
|
||||
Public Class Element
|
||||
|
||||
End Class
|
||||
|
||||
Public Class Layer
|
||||
|
||||
End Class
|
||||
@@ -0,0 +1,78 @@
|
||||
<UserControl x:Class="ElementLayerTreeViewV"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:interactivity="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity"
|
||||
xmlns:local="clr-namespace:EgtBEAMWALL.ViewerOptimizer">
|
||||
|
||||
<UniformGrid MaxHeight="300">
|
||||
<TreeView Name="ElementLayersTreeView" Grid.Row="1"
|
||||
ItemsSource="{Binding Tag.BTLElementVMList,
|
||||
RelativeSource={RelativeSource AncestorType={x:Type local:ElementLayerTreeViewV}}}">
|
||||
<!--ItemsSource="{Binding Path=ElementLayersList}">-->
|
||||
|
||||
<!--<interactivity:Interaction.Triggers>
|
||||
<interactivity:EventTrigger EventName="MouseDoubleClick">
|
||||
<interactivity:InvokeCommandAction Command="{Binding TreeViewDoubleClickCommand}" CommandParameter="{Binding ElementName=MachiningsTreeView,Path=SelectedItem}"/>
|
||||
</interactivity:EventTrigger>
|
||||
</interactivity:Interaction.Triggers>-->
|
||||
<!--<TreeView.InputBindings>
|
||||
<KeyBinding Key="Escape" Command="{Binding CancelNewCommand}" CommandParameter="Escape"/>
|
||||
</TreeView.InputBindings>-->
|
||||
<TreeView.Resources>
|
||||
<!--Modifico HierarchicalDataTemplate del CathegoryItem per poter inserire immagine e testo e per -->
|
||||
<!--renderlo apribile con un solo click -->
|
||||
<HierarchicalDataTemplate DataType="{x:Type local:BTLElementVM}" ItemsSource="{Binding BTLLayerVMList}">
|
||||
<!--<HierarchicalDataTemplate DataType="{x:Type local:FamilyElementLayerTreeViewItem}" ItemsSource="{Binding Items}">-->
|
||||
<!--<HierarchicalDataTemplate DataType="{x:Type local:FamilyElementLayerTreeViewItem}" ItemsSource="{Binding ElementLayersList}">-->
|
||||
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<Image Grid.Column="0" Source="{Binding PictureString}" Height="15" Margin="0,0,5,0"/>
|
||||
<TextBlock Grid.Column="1" Text="{Binding sNAMplus}"/>
|
||||
|
||||
</Grid>
|
||||
|
||||
<!--Assegna ai nodi ToolItem lo Style normale dei TreeViewItem, eliminando l'ombra, data dal
|
||||
multibinding quando sono attivi.-->
|
||||
<HierarchicalDataTemplate.ItemContainerStyle>
|
||||
<Style TargetType="{x:Type TreeViewItem}" >
|
||||
<Setter Property="IsSelected" Value="{Binding IsSelected, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />
|
||||
</Style>
|
||||
</HierarchicalDataTemplate.ItemContainerStyle>
|
||||
|
||||
</HierarchicalDataTemplate>
|
||||
<!--Modifico DataTemplate del ToolItem per poter inserire immagine e testo-->
|
||||
<DataTemplate DataType="{x:Type local:BTLLayerVM}">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<TextBlock Grid.Column="0" Text="{Binding sNAMplus}" Margin="0,0,5,0"/>
|
||||
<!--<TextBlock Grid.Column="1" Text="{Binding Tool}"/>-->
|
||||
|
||||
</Grid>
|
||||
</DataTemplate>
|
||||
</TreeView.Resources>
|
||||
|
||||
<!--Style dei nodi CathegoryItem che li riquadra di azzurro quando clicckati ed elimina l'ombra grigia -->
|
||||
<!--che si presenta quando la categoria rimane vuota (ombra causata dal multibinding). -->
|
||||
<TreeView.ItemContainerStyle>
|
||||
<Style TargetType="{x:Type TreeViewItem}">
|
||||
<Setter Property="IsSelected" Value="{Binding IsSelected, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />
|
||||
<Setter Property="IsExpanded" Value="{Binding IsExpanded, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />
|
||||
<EventSetter Event="PreviewMouseDown" Handler="ElementLayerTreeView_PreviewMouseDown"/>
|
||||
<EventSetter Event="PreviewMouseUp" Handler="ElementLayerTreeView_PreviewMouseUp"/>
|
||||
</Style>
|
||||
</TreeView.ItemContainerStyle>
|
||||
|
||||
</TreeView>
|
||||
</UniformGrid>
|
||||
|
||||
</UserControl>
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
Public Class ElementLayerTreeViewV
|
||||
|
||||
Dim nPrevPartId As Integer = 0
|
||||
|
||||
Private Sub ElementLayerTreeView_PreviewMouseDown(sender As Object, e As MouseButtonEventArgs)
|
||||
' se ci troviamo nella pagina LayersWall e un Layer è già selezionato
|
||||
If Map.refMainMenuVM.SelPage = EgtBEAMWALL.Core.ConstGen.Pages.LAYERSWALL AndAlso
|
||||
Not IsNothing(Map.refProjectVM.BTLStructureVM.SelBTLLayer) AndAlso
|
||||
Map.refProjectVM.BTLStructureVM.SelBTLLayer.IsSelected Then
|
||||
' salvo il PartId dell'elemento che era già selezionato
|
||||
nPrevPartId = Map.refProjectVM.BTLStructureVM.SelBTLLayer.nPartId
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub ElementLayerTreeView_PreviewMouseUp(sender As Object, e As MouseButtonEventArgs)
|
||||
' se ci troviamo nella pagina LayersWall e un Layer è già selezionato
|
||||
If Map.refMainMenuVM.SelPage = EgtBEAMWALL.Core.ConstGen.Pages.LAYERSWALL AndAlso
|
||||
Not IsNothing(Map.refProjectVM.BTLStructureVM.SelBTLLayer) AndAlso
|
||||
Map.refProjectVM.BTLStructureVM.SelBTLLayer.IsSelected Then
|
||||
' se l'elemento su cui ho clickato è lo stesso che era selezionato
|
||||
If Map.refProjectVM.BTLStructureVM.SelBTLLayer.nPartId = nPrevPartId Then
|
||||
' riassegno SelBTLLayer a se stesso per eseguire la riselezione di se stesso
|
||||
Map.refProjectVM.BTLStructureVM.SelBTLLayer = Map.refProjectVM.BTLStructureVM.SelBTLLayer
|
||||
End If
|
||||
End If
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
@@ -0,0 +1,156 @@
|
||||
Imports System.Collections.ObjectModel
|
||||
Imports EgtBEAMWALL.Core
|
||||
Imports EgtUILib
|
||||
Imports EgtWPFLib5
|
||||
|
||||
Public Class ElementLayerTreeViewVM
|
||||
Inherits VMBase
|
||||
|
||||
#Region "FIELDS & PROPERTIES"
|
||||
|
||||
Friend CodeCommand As Boolean = False
|
||||
|
||||
Private m_IsEnabled As Boolean
|
||||
Public Property IsEnabled As Boolean
|
||||
Get
|
||||
Return m_IsEnabled
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
If value <> m_IsEnabled Then
|
||||
'Map.refMachiningOptionPanelVM.Set_IsExpanded(MachiningOptionPanelVM.MachiningOptionPanelExpander.NEWMACHININGS, value)
|
||||
End If
|
||||
End Set
|
||||
End Property
|
||||
|
||||
' Lista delle lavorazioni
|
||||
Private m_ElementLayersList As New ObservableCollection(Of FamilyElementLayerTreeViewItem)
|
||||
Public Property ElementLayersList As ObservableCollection(Of FamilyElementLayerTreeViewItem)
|
||||
Get
|
||||
Return m_ElementLayersList
|
||||
End Get
|
||||
Set(value As ObservableCollection(Of FamilyElementLayerTreeViewItem))
|
||||
m_ElementLayersList = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property LayersWallPage_Visibility As Visibility
|
||||
Get
|
||||
Return If(Map.refMainMenuVM.SelPage = Pages.LAYERSWALL, Visibility.Visible, Visibility.Collapsed)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
' Operazione correntemente selezionata, che permette di aggiungere al posto giusto quella nuova
|
||||
Friend nSelectedOperationId As Integer = GDB_ID.NULL
|
||||
|
||||
'Public ReadOnly Property MachListHdr As String
|
||||
' Get
|
||||
' Return EgtMsg(MSG_OPERATION + 12) ' Nuove Lavorazioni
|
||||
' End Get
|
||||
'End Property
|
||||
|
||||
|
||||
' Definizione comandi
|
||||
Private m_cmdTreeViewDoubleClick As ICommand
|
||||
Private m_cmdCancelNew As ICommand
|
||||
|
||||
#End Region
|
||||
|
||||
#Region "CONSTRUCTOR"
|
||||
|
||||
Sub New()
|
||||
Map.SetRefElementLayerTreeViewVM(Me)
|
||||
' Per caricare l'albero la prima volta che viene aperto
|
||||
IsEnabled = False
|
||||
'LoadSelectedMachineMachinings()
|
||||
End Sub
|
||||
|
||||
#End Region
|
||||
|
||||
#Region "COMMANDS"
|
||||
|
||||
#End Region ' Commands
|
||||
|
||||
#Region "METHODS"
|
||||
|
||||
Friend Function InitMachiningTreeExpander() As Boolean
|
||||
'm_IsEnabled = True
|
||||
|
||||
'Map.refOperationParametersExpanderVM.OperParamsViewIsEnabled = False
|
||||
'Map.refSimulationExpanderVM.Simulation_IsEnabled = False
|
||||
'Map.refEstimationsExpanderVM.Estimation_IsEnabled = False
|
||||
|
||||
'' Abilito la selezione delle geometrie di lavorazione
|
||||
'Map.refProjectVM.SceneSelType = SceneSelTypeOpt.MACHINING
|
||||
'' Abilito la selezione di curve e superfici del pezzo
|
||||
'Map.refProjectVM.SceneSelMode = SceneSelModeOpt.ALL
|
||||
|
||||
'CodeCommand = False
|
||||
'OnPropertyChanged("IsEnabled")
|
||||
Return True
|
||||
End Function
|
||||
|
||||
Friend Function ExitMachiningTreeExpander() As Boolean
|
||||
'm_IsEnabled = False
|
||||
|
||||
'Map.refOperationParametersExpanderVM.OperParamsViewIsEnabled = True
|
||||
'Map.refSimulationExpanderVM.Simulation_IsEnabled = True
|
||||
'Map.refEstimationsExpanderVM.Estimation_IsEnabled = True
|
||||
|
||||
'If Not CodeCommand Then
|
||||
' Map.refOperationsListExpanderVM.CancelOperationCmd()
|
||||
' CodeCommand = False
|
||||
' OnPropertyChanged("IsEnabled")
|
||||
' Return False
|
||||
'End If
|
||||
'CodeCommand = False
|
||||
'OnPropertyChanged("IsEnabled")
|
||||
Return True
|
||||
End Function
|
||||
|
||||
''' <summary>
|
||||
''' Method that search the machines in the correct folder and add to the MachinesList those valid.
|
||||
''' </summary>
|
||||
Private Sub LoadSelectedMachineMachinings()
|
||||
'Dim ActiveMachiningsTypes() As MachiningsType = MachineModel.ReadActiveMachiningsFamilies()
|
||||
'For Each MachiningsType In ActiveMachiningsTypes
|
||||
' Dim FamilyTreeView As New FamilyMachiningTreeViewExpanderItem(MachiningsType.TypeName, MachiningsType.TypeId)
|
||||
' MachiningsList.Add(FamilyTreeView)
|
||||
' Dim MachiningName As String = String.Empty
|
||||
' Dim MachiningToolName As String = String.Empty
|
||||
' EgtMdbGetFirstMachining(MachiningsType.TypeId, MachiningName)
|
||||
' While Not String.IsNullOrEmpty(MachiningName)
|
||||
' EgtMdbSetCurrMachining(MachiningName)
|
||||
' EgtMdbGetCurrMachiningParam(MCH_MP.TOOL, MachiningToolName)
|
||||
' FamilyTreeView.Items.Add(New MachiningTreeViewExpanderItem(MachiningName, MachiningsType.TypeId, MachiningToolName))
|
||||
' EgtMdbGetNextMachining(MachiningsType.TypeId, MachiningName)
|
||||
' End While
|
||||
'Next
|
||||
'' Se esiste almeno una famiglia di lavorazioni, la seleziono
|
||||
'If MachiningsList.Count > 0 Then
|
||||
' MachiningsList(0).IsSelected = True
|
||||
' MachiningsList(0).NotifyPropertyChanged("IsSelected")
|
||||
'End If
|
||||
|
||||
Dim ActiveMachiningsTypes() As String = {"A", "B", "C"}
|
||||
For Each MachiningsType In ActiveMachiningsTypes
|
||||
Dim FamilyTreeView As New FamilyElementLayerTreeViewItem(MachiningsType)
|
||||
ElementLayersList.Add(FamilyTreeView)
|
||||
Dim MachiningName As String = "1"
|
||||
FamilyTreeView.Items.Add(New ElementLayerTreeViewItem(MachiningName, MachiningsType))
|
||||
Next
|
||||
' Se esiste almeno una famiglia di lavorazioni, la seleziono
|
||||
If ElementLayersList.Count > 0 Then
|
||||
ElementLayersList(0).IsSelected = True
|
||||
ElementLayersList(0).NotifyPropertyChanged("IsSelected")
|
||||
End If
|
||||
|
||||
End Sub
|
||||
|
||||
Friend Sub UpdateOperationMachiningList()
|
||||
m_ElementLayersList.Clear()
|
||||
LoadSelectedMachineMachinings()
|
||||
End Sub
|
||||
|
||||
#End Region
|
||||
|
||||
End Class
|
||||
@@ -16,6 +16,34 @@ Public Class FeatureManagerVM
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_LayerFeature_Visibility As Boolean = False
|
||||
Public Property LayerFeature_Visibility As Visibility
|
||||
Get
|
||||
Return If(m_LayerFeature_Visibility, Visibility.Visible, Visibility.Collapsed)
|
||||
End Get
|
||||
Set(value As Visibility)
|
||||
m_LayerFeature_Visibility = (value = Visibility.Visible)
|
||||
End Set
|
||||
End Property
|
||||
Friend Sub SetLayerFeature_Visibility(IsVisible As Boolean)
|
||||
m_LayerFeature_Visibility = IsVisible
|
||||
NotifyPropertyChanged(NameOf(LayerFeature_Visibility))
|
||||
End Sub
|
||||
|
||||
Private m_PartFeature_Visibility As Boolean = False
|
||||
Public Property PartFeature_Visibility As Visibility
|
||||
Get
|
||||
Return If(m_PartFeature_Visibility, Visibility.Visible, Visibility.Collapsed)
|
||||
End Get
|
||||
Set(value As Visibility)
|
||||
m_PartFeature_Visibility = (value = Visibility.Visible)
|
||||
End Set
|
||||
End Property
|
||||
Friend Sub SetPartFeature_Visibility(IsVisible As Boolean)
|
||||
m_PartFeature_Visibility = IsVisible
|
||||
NotifyPropertyChanged(NameOf(PartFeature_Visibility))
|
||||
End Sub
|
||||
|
||||
#Region "Messages"
|
||||
|
||||
Public ReadOnly Property Face_Msg As String
|
||||
|
||||
@@ -28,6 +28,15 @@
|
||||
<Image Source="/Resources/InstrumentPanel/ChangeParam.png" Stretch="Uniform"/>
|
||||
</Button>
|
||||
|
||||
<Button ToolTip="{Binding ChangeMaterial_ToolTip}"
|
||||
Style="{StaticResource ToolBar_Button}"
|
||||
Command="{Binding ChangeMaterial_Command}"
|
||||
Visibility="{Binding ChangeMaterial_Visibility}"
|
||||
IsEnabled="{Binding InstrumentPanel_IsEnabled}"
|
||||
Content="MAT">
|
||||
<!--<Image Source="/Resources/CALCPanel/ChooseMachine.png" Stretch="Uniform"/>-->
|
||||
</Button>
|
||||
|
||||
<ToggleButton ToolTip="{Binding Statistics_Msg}"
|
||||
Style="{StaticResource ToolBar_ToggleButton}"
|
||||
IsChecked="{Binding Statistics_IsChecked}">
|
||||
|
||||
@@ -13,6 +13,12 @@ Public Class MyInstrumentPanelVM
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property ChangeMaterial_Visibility As Visibility
|
||||
Get
|
||||
Return If(Map.refMainWindowVM.MainWindowM.nUserLevel > 5 AndAlso Map.refMainMenuVM.SelPage = Pages.VIEW, Visibility.Visible, Visibility.Collapsed)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_InstrumentPanel_IsEnabled As Boolean = True
|
||||
Public Property InstrumentPanel_IsEnabled As Boolean
|
||||
Get
|
||||
@@ -48,7 +54,7 @@ Public Class MyInstrumentPanelVM
|
||||
' aggiorno valori totali
|
||||
If Not IsNothing(Map.refProjectVM.MachGroupPanelVM) Then Map.refProjectVM.MachGroupPanelVM.CalcGlobalUpdate()
|
||||
' aggiorno conto materiali usati
|
||||
Map.refStatisticsVM.LoadRawPart()
|
||||
If Not IsNothing(Map.refProdManagerVM.CurrProd) Then Map.refStatisticsVM.LoadRawPart()
|
||||
' seleziono pagina Statistics
|
||||
Map.refTopPanelVM.SetSelTab(TopPanelVM.Tabs.STATISTICS)
|
||||
Else
|
||||
@@ -66,6 +72,7 @@ Public Class MyInstrumentPanelVM
|
||||
' Definizione comandi
|
||||
Private m_cmdData As ICommand
|
||||
Private m_cmdChangeParameter As ICommand
|
||||
Private m_cmdChangeMaterial As ICommand
|
||||
Private m_cmdStatistics As ICommand
|
||||
|
||||
#Region "Messages"
|
||||
@@ -76,6 +83,12 @@ Public Class MyInstrumentPanelVM
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property ChangeMaterial_ToolTip As String
|
||||
Get
|
||||
Return EgtMsg(61961)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property Statistics_Msg As String
|
||||
Get
|
||||
Return EgtMsg(61923)
|
||||
@@ -167,6 +180,7 @@ Public Class MyInstrumentPanelVM
|
||||
Dim ChangeParameterWndVM As New ChangeParameterWndVM
|
||||
Dim ChangeParameterWnd As New ChangeParameterWndV(Application.Current.MainWindow, ChangeParameterWndVM)
|
||||
If ChangeParameterWnd.ShowDialog() Then
|
||||
LoadingWndHelper.OpenLoadingWnd(ActiveIds.CHANGEPARAM, 1, EgtMsg(63014), "", 100) ' Modifying parameters
|
||||
' faccio passare pezzi
|
||||
If Not IsNothing(ChangeParameterWndVM.SelParam) Then
|
||||
For Each Part In Map.refProjectVM.BTLStructureVM.BTLPartVMList
|
||||
@@ -228,11 +242,48 @@ Public Class MyInstrumentPanelVM
|
||||
'Next
|
||||
Next
|
||||
End If
|
||||
LoadingWndHelper.CloseLoadingWnd(ActiveIds.CHANGEPARAM)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
#End Region ' ChangeParameter
|
||||
|
||||
#Region "ChangeMaterial"
|
||||
|
||||
''' <summary>
|
||||
''' Returns a command that do Open.
|
||||
''' </summary>
|
||||
Public ReadOnly Property ChangeMaterial_Command As ICommand
|
||||
Get
|
||||
If m_cmdChangeMaterial Is Nothing Then
|
||||
m_cmdChangeMaterial = New Command(AddressOf ChangeMaterial)
|
||||
End If
|
||||
Return m_cmdChangeMaterial
|
||||
End Get
|
||||
End Property
|
||||
|
||||
''' <summary>
|
||||
''' Execute the Open. This method is invoked by the OpenCommand.
|
||||
''' </summary>
|
||||
Friend Sub ChangeMaterial()
|
||||
If (Map.refMainMenuVM.SelPage = Pages.VIEW AndAlso (IsNothing(Map.refProjManagerVM.CurrProj) OrElse IsNothing(Map.refProjectVM.BTLStructureVM)) OrElse
|
||||
(Map.refMainMenuVM.SelPage = Pages.MACHINING AndAlso (IsNothing(Map.refProdManagerVM.CurrProd) OrElse IsNothing(Map.refProjectVM.MachGroupPanelVM)))) Then Return
|
||||
Dim ChangeMaterialWndVM As New ChangeMaterialWndVM
|
||||
Dim ChangeMaterialWnd As New ChangeMaterialWndV(Application.Current.MainWindow, ChangeMaterialWndVM)
|
||||
If ChangeMaterialWnd.ShowDialog() Then
|
||||
LoadingWndHelper.OpenLoadingWnd(ActiveIds.CHANGEMATERIAL, 1, EgtMsg(63021), "", 100) ' Modifying materials
|
||||
' faccio passare pezzi
|
||||
If Not IsNothing(ChangeMaterialWndVM.SelProjMaterial) AndAlso Not IsNothing(ChangeMaterialWndVM.SelWhMaterial) Then
|
||||
For Each Part In Map.refProjectVM.BTLStructureVM.BTLPartVMList.Where(Function(x) x.sMATERIAL = ChangeMaterialWndVM.SelProjMaterial)
|
||||
Part.sMATERIAL = ChangeMaterialWndVM.SelWhMaterial
|
||||
Next
|
||||
End If
|
||||
LoadingWndHelper.CloseLoadingWnd(ActiveIds.CHANGEMATERIAL)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
#End Region ' ChangeMaterial
|
||||
|
||||
#End Region ' COMMANDS
|
||||
|
||||
End Class
|
||||
|
||||
@@ -95,9 +95,11 @@
|
||||
</DataGridTemplateColumn.CellTemplate>
|
||||
</DataGridTemplateColumn>
|
||||
<!--DO - Abilitazione-->
|
||||
<DataGridCheckBoxColumn x:Key="colDO" Binding="{Binding bDO, UpdateSourceTrigger=PropertyChanged}">
|
||||
<DataGridCheckBoxColumn x:Key="colDO" Binding="{Binding bDO, UpdateSourceTrigger=PropertyChanged}"
|
||||
MinWidth="28">
|
||||
<DataGridCheckBoxColumn.Header>
|
||||
<TextBlock Text="{Binding Path=DataContext.DO_Msg,RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:BTLPartListV}}}"/>
|
||||
<CheckBox IsChecked="{Binding Path=Tag.bDOALL, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:BTLPartListV}}}"
|
||||
HorizontalAlignment="Center"/>
|
||||
</DataGridCheckBoxColumn.Header>
|
||||
</DataGridCheckBoxColumn>
|
||||
<!--W - Larghezza-->
|
||||
@@ -133,13 +135,15 @@
|
||||
<!--CNT - Richiesti da BTL-->
|
||||
<DataGridTextColumn x:Key="colCNT" Binding="{Binding sCNT}" SortMemberPath="nCNT">
|
||||
<DataGridTextColumn.Header>
|
||||
<TextBlock Text="{Binding Path=DataContext.CNT_Msg,RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:BTLPartListV}}}"/>
|
||||
<TextBlock Text="{Binding Path=DataContext.ShortCNT_Msg,RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:BTLPartListV}}}"
|
||||
ToolTip="{Binding Path=DataContext.CNT_Msg,RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:BTLPartListV}}}"/>
|
||||
</DataGridTextColumn.Header>
|
||||
</DataGridTextColumn>
|
||||
<!--ADDED - Aggiunti-->
|
||||
<DataGridTextColumn x:Key="colADDED" Binding="{Binding sADDED}" SortMemberPath="nADDED">
|
||||
<DataGridTextColumn.Header>
|
||||
<TextBlock Text="{Binding Path=DataContext.ADDED_Msg,RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:BTLPartListV}}}"/>
|
||||
<TextBlock Text="{Binding Path=DataContext.ShortADDED_Msg,RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:BTLPartListV}}}"
|
||||
ToolTip="{Binding Path=DataContext.ADDED_Msg,RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:BTLPartListV}}}"/>
|
||||
</DataGridTextColumn.Header>
|
||||
<DataGridTextColumn.EditingElementStyle>
|
||||
<Style TargetType="{x:Type TextBox}">
|
||||
@@ -150,13 +154,15 @@
|
||||
<!--INPROD - IN OTTIMIZZAZIONE-->
|
||||
<DataGridTextColumn x:Key="colINPROD" Binding="{Binding nINPROD}">
|
||||
<DataGridTextColumn.Header>
|
||||
<TextBlock Text="{Binding Path=DataContext.INPROD_Msg,RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:BTLPartListV}}}"/>
|
||||
<TextBlock Text="{Binding Path=DataContext.ShortINPROD_Msg,RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:BTLPartListV}}}"
|
||||
ToolTip="{Binding Path=DataContext.INPROD_Msg,RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:BTLPartListV}}}"/>
|
||||
</DataGridTextColumn.Header>
|
||||
</DataGridTextColumn>
|
||||
<!--DONE - PRODOTTI-->
|
||||
<DataGridTextColumn x:Key="colDONE" Binding="{Binding nDONE}">
|
||||
<DataGridTextColumn.Header>
|
||||
<TextBlock Text="{Binding Path=DataContext.DONE_Msg,RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:BTLPartListV}}}"/>
|
||||
<TextBlock Text="{Binding Path=DataContext.ShortDONE_Msg,RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:BTLPartListV}}}"
|
||||
ToolTip="{Binding Path=DataContext.DONE_Msg,RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:BTLPartListV}}}"/>
|
||||
</DataGridTextColumn.Header>
|
||||
</DataGridTextColumn>
|
||||
<!--TBP - In produzione-->
|
||||
@@ -186,6 +192,12 @@
|
||||
<TextBlock Text="{Binding Path=DataContext.GRP_Msg,RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:BTLPartListV}}}"/>
|
||||
</DataGridTextColumn.Header>
|
||||
</DataGridTextColumn>
|
||||
<!--STOREY - Sottogruppo-->
|
||||
<DataGridTextColumn x:Key="colSTOREY" Binding="{Binding sSTOREY}">
|
||||
<DataGridTextColumn.Header>
|
||||
<TextBlock Text="{Binding Path=DataContext.STOREY_Msg,RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:BTLPartListV}}}"/>
|
||||
</DataGridTextColumn.Header>
|
||||
</DataGridTextColumn>
|
||||
<!--UNT - Unit Time-->
|
||||
<!--<DataGridTextColumn Binding="{Binding nUNT}"
|
||||
IsReadOnly="True">
|
||||
|
||||
@@ -4,7 +4,11 @@
|
||||
If TypeOf sender Is DataGridRow Then
|
||||
Dim Row As DataGridRow = DirectCast(sender, DataGridRow)
|
||||
If Not IsNothing(Row) AndAlso Row.IsSelected Then
|
||||
Map.refProjectVM.BTLStructureVM.SelBTLPart = Map.refProjectVM.BTLStructureVM.SelBTLPart
|
||||
If Map.refMainMenuVM.SelPage = EgtBEAMWALL.Core.ConstGen.Pages.LAYERSWALL Then
|
||||
Map.refProjectVM.BTLStructureVM.SelBTLLayer.SelBTLPart = Map.refProjectVM.BTLStructureVM.SelBTLLayer.SelBTLPart
|
||||
Else
|
||||
Map.refProjectVM.BTLStructureVM.SelBTLPart = Map.refProjectVM.BTLStructureVM.SelBTLPart
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
End Sub
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
Imports System.Collections.ObjectModel
|
||||
Imports EgtBEAMWALL.Core
|
||||
Imports EgtUILib
|
||||
Imports EgtWPFLib5
|
||||
|
||||
Public Class BTLPartListVM
|
||||
Inherits VMBase
|
||||
|
||||
Private m_colPart_Do As EgtDataGridColumn
|
||||
Public ReadOnly Property colPart_Do As EgtDataGridColumn
|
||||
@@ -21,6 +23,18 @@ Public Class BTLPartListVM
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property ViewMachiningPage_Visibility As Visibility
|
||||
Get
|
||||
Return If(Map.refMainMenuVM.SelPage = Pages.VIEW Or Map.refMainMenuVM.SelPage = Pages.MACHINING, Visibility.Visible, Visibility.Collapsed)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property LayersWallPage_Visibility As Visibility
|
||||
Get
|
||||
Return If(Map.refMainMenuVM.SelPage = Pages.LAYERSWALL, Visibility.Visible, Visibility.Collapsed)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
#Region "Messages"
|
||||
|
||||
Public ReadOnly Property PDN_Msg As String
|
||||
@@ -70,26 +84,52 @@ Public Class BTLPartListVM
|
||||
Return EgtMsg(61608)
|
||||
End Get
|
||||
End Property
|
||||
Public ReadOnly Property ShortCNT_Msg As String
|
||||
Get
|
||||
Return EgtMsg(61952)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property ADDED_Msg As String
|
||||
Get
|
||||
Return EgtMsg(61813)
|
||||
End Get
|
||||
End Property
|
||||
Public ReadOnly Property ShortADDED_Msg As String
|
||||
Get
|
||||
Return EgtMsg(61953)
|
||||
End Get
|
||||
End Property
|
||||
Public ReadOnly Property INPROD_Msg As String
|
||||
Get
|
||||
Return EgtMsg(61609)
|
||||
End Get
|
||||
End Property
|
||||
Public ReadOnly Property ShortINPROD_Msg As String
|
||||
Get
|
||||
Return EgtMsg(61954)
|
||||
End Get
|
||||
End Property
|
||||
Public ReadOnly Property DONE_Msg As String
|
||||
Get
|
||||
Return EgtMsg(61814)
|
||||
End Get
|
||||
End Property
|
||||
Public ReadOnly Property ShortDONE_Msg As String
|
||||
Get
|
||||
Return EgtMsg(61955)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property GRP_Msg As String
|
||||
Get
|
||||
Return EgtMsg(61612)
|
||||
Return EgtMsg(61624)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property STOREY_Msg As String
|
||||
Get
|
||||
Return EgtMsg(61623)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
|
||||
@@ -20,7 +20,8 @@
|
||||
Style="{StaticResource DataGrid_CustomHighLight}">
|
||||
<DataGrid.Resources>
|
||||
<!--DO - Abilitazione-->
|
||||
<DataGridCheckBoxColumn x:Key="colDO" Binding="{Binding bDO, UpdateSourceTrigger=PropertyChanged}">
|
||||
<DataGridCheckBoxColumn x:Key="colDO" Binding="{Binding bDO, UpdateSourceTrigger=PropertyChanged}"
|
||||
MinWidth="28">
|
||||
<DataGridCheckBoxColumn.Header>
|
||||
<CheckBox IsChecked="{Binding Path=Tag.bDOALL, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:FeatureListV}}}"/>
|
||||
</DataGridCheckBoxColumn.Header>
|
||||
|
||||
@@ -4,6 +4,7 @@ Imports EgtUILib
|
||||
Imports EgtWPFLib5
|
||||
|
||||
Public Class FeatureListVM
|
||||
Inherits VMBase
|
||||
|
||||
Private m_colFeature_Do As EgtDataGridColumn
|
||||
Public ReadOnly Property colFeature_Do As EgtDataGridColumn
|
||||
@@ -22,6 +23,34 @@ Public Class FeatureListVM
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_LayerFeatureList_Visibility As Boolean = True
|
||||
Public Property LayerFeatureList_Visibility As Visibility
|
||||
Get
|
||||
Return If(m_LayerFeatureList_Visibility, Visibility.Visible, Visibility.Collapsed)
|
||||
End Get
|
||||
Set(value As Visibility)
|
||||
m_LayerFeatureList_Visibility = (value = Visibility.Visible)
|
||||
End Set
|
||||
End Property
|
||||
Friend Sub SetLayerFeatureList_Visibility(IsVisible As Boolean)
|
||||
m_LayerFeatureList_Visibility = IsVisible
|
||||
NotifyPropertyChanged(NameOf(LayerFeatureList_Visibility))
|
||||
End Sub
|
||||
|
||||
Private m_PartFeatureList_Visibility As Boolean = True
|
||||
Public Property PartFeatureList_Visibility As Visibility
|
||||
Get
|
||||
Return If(m_PartFeatureList_Visibility, Visibility.Visible, Visibility.Collapsed)
|
||||
End Get
|
||||
Set(value As Visibility)
|
||||
m_PartFeatureList_Visibility = (value = Visibility.Visible)
|
||||
End Set
|
||||
End Property
|
||||
Friend Sub SetPartFeatureList_Visibility(IsVisible As Boolean)
|
||||
m_PartFeatureList_Visibility = IsVisible
|
||||
NotifyPropertyChanged(NameOf(PartFeatureList_Visibility))
|
||||
End Sub
|
||||
|
||||
#Region "Messages"
|
||||
|
||||
Public ReadOnly Property Description_Msg As String
|
||||
|
||||
@@ -26,6 +26,17 @@
|
||||
<DataGridTextColumn.Header>
|
||||
<TextBlock Text="{Binding Path=DataContext.PDN_Msg,RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:PartInRawPartListV}}}"/>
|
||||
</DataGridTextColumn.Header>
|
||||
<DataGridTextColumn.CellStyle>
|
||||
<Style TargetType="{x:Type DataGridCell}">
|
||||
<Setter Property="BorderBrush" Value="{Binding Search_Background}"/>
|
||||
<Setter Property="BorderThickness" Value="2"/>
|
||||
<Style.Triggers>
|
||||
<Trigger Property="IsSelected" Value="True">
|
||||
<Setter Property="Foreground" Value="Blue" />
|
||||
</Trigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
</DataGridTextColumn.CellStyle>
|
||||
</DataGridTextColumn>
|
||||
<!--Validità pezzo-->
|
||||
<DataGridTemplateColumn x:Key="colCALC">
|
||||
@@ -143,7 +154,7 @@
|
||||
</DataGridTemplateColumn.CellTemplate>
|
||||
</DataGridTemplateColumn>
|
||||
<!--PosX - Posizione-->
|
||||
<DataGridTextColumn x:Key="colPOSX" Binding="{Binding sPOSX, UpdateSourceTrigger=PropertyChanged}" SortMemberPath="dPOSX">
|
||||
<DataGridTextColumn x:Key="colPOSX" Binding="{Binding sPOSX}" SortMemberPath="dPOSX">
|
||||
<DataGridTextColumn.HeaderTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock Text="{Binding Path=DataContext.PosX_Msg,RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:PartInRawPartListV}}}"/>
|
||||
@@ -156,7 +167,7 @@
|
||||
</DataGridTextColumn.EditingElementStyle>
|
||||
</DataGridTextColumn>
|
||||
<!--PosY - Posizione-->
|
||||
<DataGridTextColumn x:Key="colPOSY" Binding="{Binding sPOSY, UpdateSourceTrigger=PropertyChanged}" SortMemberPath="dPOSY">
|
||||
<DataGridTextColumn x:Key="colPOSY" Binding="{Binding sPOSY}" SortMemberPath="dPOSY">
|
||||
<DataGridTextColumn.HeaderTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock Text="{Binding Path=DataContext.PosY_Msg,RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:PartInRawPartListV}}}"/>
|
||||
@@ -187,6 +198,18 @@
|
||||
<TextBlock Text="{Binding Path=DataContext.MAT_Msg,RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:PartInRawPartListV}}}"/>
|
||||
</DataGridTextColumn.Header>
|
||||
</DataGridTextColumn>
|
||||
<!--GRP - Gruppo-->
|
||||
<DataGridTextColumn x:Key="colGROUP" Binding="{Binding sGROUP}">
|
||||
<DataGridTextColumn.Header>
|
||||
<TextBlock Text="{Binding Path=DataContext.GRP_Msg,RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:PartInRawPartListV}}}"/>
|
||||
</DataGridTextColumn.Header>
|
||||
</DataGridTextColumn>
|
||||
<!--STOREY - Sottogruppo-->
|
||||
<DataGridTextColumn x:Key="colSTOREY" Binding="{Binding sSTOREY}">
|
||||
<DataGridTextColumn.Header>
|
||||
<TextBlock Text="{Binding Path=DataContext.STOREY_Msg,RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:PartInRawPartListV}}}"/>
|
||||
</DataGridTextColumn.Header>
|
||||
</DataGridTextColumn>
|
||||
|
||||
</DataGrid.Resources>
|
||||
<DataGrid.InputBindings>
|
||||
|
||||
@@ -102,6 +102,18 @@ Public Class PartInRawPartListVM
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property GRP_Msg As String
|
||||
Get
|
||||
Return EgtMsg(61624)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property STOREY_Msg As String
|
||||
Get
|
||||
Return EgtMsg(61623)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
#End Region ' Messages
|
||||
|
||||
#Region "CONSTRUCTOR"
|
||||
@@ -110,7 +122,7 @@ Public Class PartInRawPartListVM
|
||||
' aggiungo riferimento a map
|
||||
Map.SetRefPartInRawPartListVM(Me)
|
||||
' carico le colonne della datagrid
|
||||
GetPrivateProfileColumns(S_PARTINRAWPARTLIST_BEAM, PartInRawPartColumns)
|
||||
'GetPrivateProfileColumns(S_PARTINRAWPARTLIST_BEAM, PartInRawPartColumns)
|
||||
End Sub
|
||||
|
||||
#End Region ' CONSTRUCTOR
|
||||
|
||||
@@ -4,19 +4,19 @@
|
||||
xmlns:EgtBEAMWALL="clr-namespace:EgtBEAMWALL.ViewerOptimizer"
|
||||
xmlns:EgtBEAMWALLCORE="clr-namespace:EgtBEAMWALL.Core;assembly=EgtBEAMWALL.Core">
|
||||
|
||||
<EgtBEAMWALLCORE:EgtDataGrid
|
||||
AutoGenerateColumns="False"
|
||||
CanUserDeleteRows="False"
|
||||
CanUserResizeRows="False"
|
||||
SelectionMode="Single"
|
||||
ScrollViewer.CanContentScroll="True"
|
||||
ScrollViewer.VerticalScrollBarVisibility="Auto"
|
||||
ScrollViewer.HorizontalScrollBarVisibility="Auto"
|
||||
Margin="0,0,0,5"
|
||||
ItemsSource="{Binding Tag.QBTLParamVMList, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:QParameterListV}}}"
|
||||
SelectedItem="{Binding Tag.SelQBTLParam, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:QParameterListV}}}"
|
||||
BindingColumns="{Binding QParameterListColumns}"
|
||||
Style="{StaticResource DataGrid_CustomHighLight}">
|
||||
<EgtBEAMWALLCORE:EgtDataGrid AutoGenerateColumns="False"
|
||||
CanUserDeleteRows="False"
|
||||
CanUserResizeRows="False"
|
||||
SelectionMode="Single"
|
||||
ScrollViewer.CanContentScroll="True"
|
||||
ScrollViewer.VerticalScrollBarVisibility="Auto"
|
||||
ScrollViewer.HorizontalScrollBarVisibility="Auto"
|
||||
Margin="0,0,0,5"
|
||||
ItemsSource="{Binding Tag.QBTLParamVMList, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:QParameterListV}}}"
|
||||
SelectedItem="{Binding Tag.SelQBTLParam, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:QParameterListV}}}"
|
||||
BeginningEdit="QParameterList_BeginningEdit"
|
||||
BindingColumns="{Binding QParameterListColumns}"
|
||||
Style="{StaticResource DataGrid_CustomHighLight}">
|
||||
|
||||
<DataGrid.RowStyle>
|
||||
<Style TargetType="DataGridRow" BasedOn="{StaticResource RowDataGrid_CustomHighLight}">
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
Class QParameterListV
|
||||
Imports EgtBEAMWALL.Core
|
||||
|
||||
Class QParameterListV
|
||||
|
||||
Private Sub QParameterList_PreviewMouseDown(sender As Object, e As MouseButtonEventArgs)
|
||||
If TypeOf sender Is DataGridRow Then
|
||||
@@ -9,4 +11,16 @@
|
||||
End If
|
||||
End Sub
|
||||
|
||||
' funzione che impedisce di editare le righe che sono gia' in produzione
|
||||
Private Sub QParameterList_BeginningEdit(sender As Object, e As DataGridBeginningEditEventArgs)
|
||||
If IsNothing(e.Row) Then Return
|
||||
If Map.refMainMenuVM.SelPage <> Pages.MACHINING Then Return
|
||||
Dim RowVM As BTLParamVM = DirectCast(e.Row.DataContext, BTLParamVM)
|
||||
' se in produzione impedisco modifica dei parametri
|
||||
If DirectCast(RowVM.BTLParamM.ParentFeature.ParentPart, PartM).nProductionState > ItemState.ND Then
|
||||
'For Each cell In Row.Item
|
||||
e.Cancel = True
|
||||
End If
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
|
||||
@@ -26,6 +26,17 @@
|
||||
<DataGridTextColumn.Header>
|
||||
<TextBlock Text="{Binding Path=DataContext.ID_Msg, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:RawPartListV}}}"/>
|
||||
</DataGridTextColumn.Header>
|
||||
<DataGridTextColumn.CellStyle>
|
||||
<Style TargetType="{x:Type DataGridCell}">
|
||||
<Setter Property="BorderBrush" Value="{Binding Search_Background}"/>
|
||||
<Setter Property="BorderThickness" Value="2"/>
|
||||
<Style.Triggers>
|
||||
<Trigger Property="IsSelected" Value="True">
|
||||
<Setter Property="Foreground" Value="Blue" />
|
||||
</Trigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
</DataGridTextColumn.CellStyle>
|
||||
</DataGridTextColumn>
|
||||
<!--Validità pezzo-->
|
||||
<DataGridTemplateColumn x:Key="colCALC">
|
||||
@@ -88,7 +99,7 @@
|
||||
<DataGridTextColumn x:Key="colW" Binding="{Binding sW}">
|
||||
<DataGridTextColumn.Header>
|
||||
<TextBlock Text="{Binding Path=DataContext.W_Msg,
|
||||
RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:RawPartListV}}}"/>
|
||||
RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:RawPartListV}}}"/>
|
||||
</DataGridTextColumn.Header>
|
||||
<DataGridTextColumn.EditingElementStyle>
|
||||
<Style TargetType="{x:Type TextBox}">
|
||||
|
||||
@@ -97,7 +97,7 @@ Public Class RawPartListVM
|
||||
' Aggiungo riferimento a Map
|
||||
Map.SetRefRawPartListVM(Me)
|
||||
' carico le colonne della datagrid
|
||||
GetPrivateProfileColumns(S_RAWPARTLIST_BEAM, RawPartColumns)
|
||||
'GetPrivateProfileColumns(S_RAWPARTLIST_BEAM, RawPartColumns)
|
||||
End Sub
|
||||
|
||||
#End Region ' CONSTRUCTOR
|
||||
|
||||