Compare commits

...

7 Commits

Author SHA1 Message Date
NicolaP 7581ae0bdb Miglioramenti scrittura codice e commneti 2022-04-28 14:48:29 +02:00
NicolaP 661ae9f09c Gestione limiti corsa in fase di manipolazione 2022-04-13 17:51:13 +02:00
NicolaP 44d411819f Notifica dei limiti di corsa in fase di prelievo pezzi 2022-04-11 19:35:52 +02:00
NicolaP 46134c10b6 Gestione del carico massio delle ventose 2022-04-07 18:31:09 +02:00
NicolaP 36b7ae4843 Migliorata gestione comando Ctrl nella pagina Split 2022-03-21 14:33:43 +01:00
NicolaP 63b4977c39 Migliorara gestione lavorazioni pagina split 2022-03-16 19:27:51 +01:00
NicolaP ae927719c6 Merge branch 'Features/Multiple_CSV' 2022-03-10 20:43:26 +01:00
11 changed files with 609 additions and 117 deletions
+2
View File
@@ -35,6 +35,8 @@ Module ConstMach
Public Const KEY_VACLAY_PREFROT As String = "PreferredRot"
Public Const KEY_VACLAY_PREFVROTXMINUS As String = "PrefVertRotXMinus"
Public Const KEY_VACLAY_PREFVROTXPLUS As String = "PrefVertRotXPlus"
Public Const KEY_VACLAY_PREFVROTYMINUS As String = "PrefVertRotYMinus"
Public Const KEY_VACLAY_PREFVROTYPLUS As String = "PrefVertRotYPlus"
' Info in gruppo layout per direzione di riferimento ventose per tagli da sotto
Public Const KEY_VACLAY_DRIPREFDIR As String = "DripRefDir"
' Info in asse rotante ventosa per step discreti
+5
View File
@@ -198,6 +198,10 @@
Public Const S_MACH_RAWMOVE As String = "RawMove"
Public Const K_MACH_RM_ROTATE As String = "Rotate"
Public Const K_MACH_RM_FINALMOVE As String = "FinalMove"
Public Const K_MACH_WEIGHT_SINGLEPLUGGER As String = "MaxWeightSinglePlugger"
Public Const K_MACH_WEIGHT_DOUBLEPLUGGER As String = "MaxWeightDoublePlugger"
Public Const K_MACH_ROTATEVACUUMFOREXTRASTROKEY As String = "RotateVacuumForExtraStrokeY"
Public Const K_MACH_ROTATEVACUUMFOREXTRASTROKEX As String = "RotateVacuumForExtraStrokeX"
Public Const S_MACH_REG As String = "Reg"
Public Const K_MACH_MAX_ROT_ANG As String = "MaxRotAng"
@@ -260,6 +264,7 @@
Public Const K_CURROFFICEMATERIAL As String = "CurrOfficeMaterial"
Public Const K_MATERIAL As String = "Material"
Public Const K_FROMDBWATERJET As String = "FromDBWaterJet"
Public Const K_AVERAGEDENSITY As String = "AverageDensity"
Public Const S_SETUP As String = "SetUp"
Public Const K_DEFAULT As String = "Default"
+134 -1
View File
@@ -10,7 +10,22 @@ Module VacuumCups
Private m_dPreferredRot As Double = 0
Private m_dPrefVertRotXMinus As Double = 0
Private m_dPrefVertRotXPlus As Double = 0
Private m_dPrefVertRotYMinus As Double = 0
Private m_dPrefVertRotYPlus As Double = 0
Private m_dDripRefAng As Double = 0
' dati carico massimo manipolatore
Private m_RawDensity As Double = 2500
Private m_RawWeight As Double = 0
Private m_MaxWeightSinglePlugger As Double = 250
Private m_MaxWeightDoublePlugger As Double = 750
Public bOverWeight As Boolean = False
' dati per rotazione ventose vicono al fine corsa Y e X
Private bRotateVacuumNearExtraStrokeY As Boolean = False
Private bRotateVacuumNearExtraStrokeX As Boolean = False
' dati stroke
Public bExtraStroke As Boolean = False
Public ptStartPointLift As Point3d
Public dDegRotStartAng As Double
' Nome del gruppo temporaneo per le ventose
Private Const VACTMP_GRP As String = "VacTmp"
@@ -50,6 +65,20 @@ Module VacuumCups
Return m_nVacType
End Function
Friend Sub GetWeightInformation(Density As Double, MaxSingle As Double, MaxDouble As Double)
m_RawDensity = Density
m_MaxWeightSinglePlugger = MaxSingle
m_MaxWeightDoublePlugger = MaxDouble
End Sub
Friend Sub GetRotationForExtraStrokeY(Rotate As Boolean)
bRotateVacuumNearExtraStrokeY = Rotate
End Sub
Friend Sub GetRotationForExtraStrokeX(Rotate As Boolean)
bRotateVacuumNearExtraStrokeX = Rotate
End Sub
Friend Function GetVacuumId() As Integer
Return m_nVacId
End Function
@@ -66,6 +95,8 @@ Module VacuumCups
' Identificativo riferimento della testa nella macchina
Dim nT1Id As Integer = EgtGetFirstNameInGroup(EgtGetHeadId(VACUUM_HEAD), HEAD_FIRST_EXIT)
If nT1Id = GDB_ID.NULL Then Return False
' imposto la l'uscita della ventosa come fosse l'uscita di un utensile
EgtSetCalcTool("", "H4", 1)
' Creo gruppo temporaneo in cui copiarli
m_nTempId = EgtCreateGroup(GDB_ID.ROOT)
If m_nTempId = GDB_ID.NULL Then Return False
@@ -79,6 +110,8 @@ Module VacuumCups
' Angoli di rotazione preferiti per ventosa in verticale (lungo Y) a sinistra e a destra del centro tavola
EgtGetInfo(m_nVacId, KEY_VACLAY_PREFVROTXMINUS, m_dPrefVertRotXMinus)
EgtGetInfo(m_nVacId, KEY_VACLAY_PREFVROTXPLUS, m_dPrefVertRotXPlus)
EgtGetInfo(m_nVacId, KEY_VACLAY_PREFVROTYMINUS, m_dPrefVertRotYMinus)
EgtGetInfo(m_nVacId, KEY_VACLAY_PREFVROTYPLUS, m_dPrefVertRotYPlus)
' Direzione di riferimento per tagli Drip
EgtGetInfo( m_nVacId, KEY_VACLAY_DRIPREFDIR, m_dDripRefAng)
' Nascondo il gruppo ma rendo visibili le curve di contorno delle ventose
@@ -165,6 +198,18 @@ Module VacuumCups
EgtGetBBoxGlob(nRKerfId, GDB_BB.STANDARD, b3Kerf)
Dim ptKerfCen As Point3d
EgtCentroid(nRKerfId, GDB_ID.ROOT, ptKerfCen)
'-------------------- INIZIO CALCOLO PESO --------------------
' recupero l'area del grezzo da muovere
Dim RawArea As Double = 0
' superficie del grezzo senza considerare eventuali fori
EgtSurfFrGrossArea(nRKerfId, RawArea)
' volume calcolato in mmc
Dim RawVolume As Double = RawArea * b3Raw.DimZ()
' peso calolato in kg
m_RawWeight = RawVolume * m_RawDensity / Math.Pow(10, 9)
'-------------------- FINE CALCOLO PESO --------------------
' Eseguo ricerca
If FindVacuumCupsOnRaw(nRawId, ptRawCen, b3Kerf, ptKerfCen, nKerfId, nRKerfId, rmData) Then
Return True
@@ -266,6 +311,7 @@ Module VacuumCups
Dim sCups() As String = Nothing
Dim sCups2() As String = Nothing
If Not GetVacuumCupSelection(nI, sCups, sCups2) Then Return False
bExtraStroke = False
' Determino validità soluzioni della configurazione
Dim vtMove As New Vector3d
Dim ptRotCen As New Point3d
@@ -368,6 +414,23 @@ Module VacuumCups
If b3Vac.IsEmpty() Then Return INFINITO
' Se box maggiore di quello del pezzo, scarto soluzione
If b3Vac.Radius() > b3Raw.Radius() Then Return INFINITO
'-------------------- INIZIO VERIFICA PESO --------------------
bOverWeight = False
Select Case GetPluggerFromCameras(sCups)
Case 2
' se peso del grezzo oltre il limite consentito allora scarto la soluzione
If m_RawWeight > m_MaxWeightDoublePlugger Then
bOverWeight = True
Return INFINITO
End If
Case 1
' se peso del grezzo oltre il limite consentito allora scarto la soluzione
If m_RawWeight > m_MaxWeightSinglePlugger Then
bOverWeight = True
Return INFINITO
End If
End Select
'-------------------- FINE VERIFICA PESO --------------------
' Recupero l'area della tavola
Dim b3Tab As New BBox3d
EgtGetTableArea(1, b3Tab)
@@ -383,12 +446,19 @@ Module VacuumCups
dRotAngDeg = dAngOrizzDeg
If b3Vac.DimY() > b3Vac.DimX() + EPS_SMALL Then dRotAngDeg -= 90
Dim dPreferredRot As Double = m_dPreferredRot
If Math.Abs(dRotAngDeg - 90) < 45 Or Math.Abs(dRotAngDeg - 270) < 45 Then
If bRotateVacuumNearExtraStrokeX And (Math.Abs(dRotAngDeg - 90) < 45 Or Math.Abs(dRotAngDeg - 270) < 45) Then
If frMinRect.Orig().x < b3Tab.Center().x Then
dPreferredRot = m_dPrefVertRotXMinus
Else
dPreferredRot = m_dPrefVertRotXPlus
End If
ElseIf bRotateVacuumNearExtraStrokeY And (Math.Abs(dRotAngDeg - 90) > 45 Or Math.Abs(dRotAngDeg - 270) > 45) Then
' se l'orientemanto è orizzontale e la macchina è stata abilitata
If frMinRect.Orig().y < b3Tab.Center().y Then
dPreferredRot = m_dPrefVertRotYPlus
Else
dPreferredRot = m_dPrefVertRotYMinus
End If
End If
Dim dAngDelta As Double = If( Math.Abs( b3Vac.DimY() - b3Vac.DimX()) < 10 * EPS_SMALL, 90, 180)
While dRotAngDeg - dPreferredRot >= dAngDelta / 2
@@ -446,11 +516,53 @@ Module VacuumCups
' Applico movimento e rotazione al punto
ptRef.Move(vtMove)
ptRef.Rotate(ptRotCen, Vector3d.Z_AX(), dRotAngDeg)
' -------------- INIZIO verifica di essere nel limite delle corse macchina --------------
If VerifyOutOfStrokes(ptRef, dRotAngDeg) <> 0 Then
bExtraStroke = True
Return INFINITO
End If
' se la posizione è accettbaile allora salvo i dati
ptStartPointLift = ptRef
dDegRotStartAng = dRotAngDeg
' -------------- FINE verifica di essere nel limite delle corse macchina --------------
' Ne calcolo la distanza dal centro della tavola
Dim dDist As Double = Point3d.DistXY(ptRef, b3Tab.Center())
Return dDist
End Function
' assegante le posizioni del centro delle ventose e l'angolo di posizionamento orizzontale verifica che la posizione sia raggiungibile
Public Function VerifyOutOfStrokes(ptRef As Point3d, dRotAngDeg As Double) As Integer
Dim dX, dY, dZ As Double
Dim nStat As Integer
Dim dCHome As Double
EgtGetAxisHomePos("C", dCHome)
' imposto la l'uscita della ventosa come fosse l'uscita di un utensile
EgtSetCalcTool("", "H4", 1)
EgtGetCalcPositions(ptRef, dRotAngDeg + dCHome, 0, nStat, dX, dY, dZ)
EgtVerifyOutstroke(dX, dY, dZ, dRotAngDeg + dCHome, 0, nStat)
Return nStat
End Function
' dall'informazione di extra corsa recupera il valore indicato
Public Function GetExtraStrokeValue(sInfo As String) As Double
Dim dExtraStroke As Double = 0
Dim sItems As String() = sInfo.Split("="c)
If sItems.Count = 2 Then
Dim nStartIndex As Integer = 0
For Each ItemChar As Char In sItems(1)
If ItemChar = "("c Then
Exit For
End If
nStartIndex += 1
Next
If nStartIndex > 0 Then
Dim sValue As String = sItems(1).Remove(nStartIndex, sItems(1).Count - nStartIndex)
StringToLen(sValue, dExtraStroke)
End If
End If
Return dExtraStroke
End Function
Private Function TestVacuumCups(nCups() As Integer, nRawRegId As Integer,
vtMove As Vector3d, ptRotCen As Point3d, dRotAngDeg As Double) As Boolean
' Eseguo verifica delle ventose rispetto al grezzo
@@ -471,6 +583,27 @@ Module VacuumCups
Return bVacOk
End Function
Private Function GetPluggerFromCameras(sCups) As Integer
Dim nCountPlunger As Integer = 1
Dim bPlugger1 As Boolean = False
Dim bPlugger2 As Boolean = False
For Each Camera As String In sCups
If (Camera.Contains("1") Or Camera.Contains("2") Or Camera.Contains("3")) Then
bPlugger1 = True
Else
bPlugger2 = True
End If
Next
' verifico quali sono le camere attive
If bPlugger1 And bPlugger2 Then
nCountPlunger = 2
ElseIf Not bPlugger1 And Not bPlugger2 Then
nCountPlunger = 0
End If
' restituisco il numero di Plugger in uso
Return nCountPlunger
End Function
Friend Function SaveOneMoveInfo(nId As Integer, rmData As RawMoveData) As Boolean
' Assegno le informazioni
EgtSetInfo(nId, "Id", rmData.m_nId)
+2 -2
View File
@@ -69,6 +69,6 @@ Imports System.Windows
' by using the '*' as shown below:
' <Assembly: AssemblyVersion("1.0.*")>
<Assembly: AssemblyVersion("2.4.2.3")>
<Assembly: AssemblyFileVersion("2.4.2.3")>
<Assembly: AssemblyVersion("2.4.3.1")>
<Assembly: AssemblyFileVersion("2.4.3.1")>
@@ -4,6 +4,7 @@
xmlns:EgtWPFLib5="clr-namespace:EgtWPFLib5;assembly=EgtWPFLib5"
IsMinimizable="False"
ShowInTaskbar="False"
Title="{Binding Title}"
Style="{DynamicResource {x:Type EgtWPFLib5:EgtCustomWindow}}"
Height="200" Width="400"
WindowStartupLocation="CenterOwner">
@@ -3,6 +3,15 @@ Imports EgtUILib
Public Class ModifStartEndCutWindowVM
Private m_Title As String = String.Empty
Public Property Title As String
Get
Return m_Title
End Get
Set(value As String)
m_Title = value
End Set
End Property
Public ReadOnly Property ValueMsg As String
Get
Return EgtMsg(MSG_SPLITPAGEUC + 35)
@@ -4,6 +4,7 @@
xmlns:EgtWPFLib5="clr-namespace:EgtWPFLib5;assembly=EgtWPFLib5"
IsMinimizable="False"
ShowInTaskbar="False"
Title="{Binding Title}"
Style="{DynamicResource {x:Type EgtWPFLib5:EgtCustomWindow}}"
Height="400" Width="400"
WindowStartupLocation="CenterOwner">
@@ -6,6 +6,15 @@ Imports EgtWPFLib5
Public Class ModifStartEndWjWindowVM
Inherits VMBase
Private m_Title As String = String.Empty
Public Property Title As String
Get
Return m_Title
End Get
Set(value As String)
m_Title = value
End Set
End Property
Public ReadOnly Property ValueMsg As String
Get
Return EgtMsg(MSG_SPLITPAGEUC + 35)
+167 -8
View File
@@ -249,6 +249,108 @@ Public Class MoveRawModeVM
NotifyPropertyChanged("MoveStep")
End Sub
' verifica che la posizione di rialascio sia corretta, altrimenti coreggo il vettore di posizione
Private Function VerifyReleasdPositionIsValid(ByRef vtMove As Vector3d) As Boolean
Dim bOk As Boolean = True
' determino il punto finale dello spostamento
Dim ptEndPointLift As Point3d = VacuumCups.ptStartPointLift
ptEndPointLift.x += vtMove.x
ptEndPointLift.y += vtMove.y
Dim sInfo As String = String.Empty
Select Case VacuumCups.VerifyOutOfStrokes(ptEndPointLift, VacuumCups.dDegRotStartAng)
Case 1
' extra corsa sulla x-: devo ridurre del valore di extra corsa
EgtGetOutstrokeInfo(sInfo)
OmagOFFICEMap.refStatusBarVM.SetOutputMessage(EgtMsg(MSG_SIMULATIONPAGEUC + 2) & " " & sInfo, 3, MSG_TYPE.WARNING) 'Extracorsa ...
ptEndPointLift.x -= vtMove.x
Dim dMaxMove As Double = VacuumCups.GetExtraStrokeValue(sInfo)
If Math.Abs(dMaxMove - vtMove.x) <= EPS_SMALL * 100 Then
vtMove.x = 0
Else
vtMove.x -= dMaxMove - EPS_SMALL * 100
End If
ptEndPointLift.x += vtMove.x
bOk = False
Case 2
' extra corsa sulla x+: devo ridurre del valore di extra corsa
EgtGetOutstrokeInfo(sInfo)
OmagOFFICEMap.refStatusBarVM.SetOutputMessage(EgtMsg(MSG_SIMULATIONPAGEUC + 2) & " " & sInfo, 3, MSG_TYPE.WARNING) 'Extracorsa ...
ptEndPointLift.x -= vtMove.x
Dim dMaxMove As Double = VacuumCups.GetExtraStrokeValue(sInfo)
If Math.Abs(dMaxMove - vtMove.x) <= EPS_SMALL * 100 Then
vtMove.x = 0
Else
vtMove.x -= dMaxMove + EPS_SMALL * 100
End If
ptEndPointLift.x += vtMove.x
bOk = False
Case 4
' extra corsa sulla y-
EgtGetOutstrokeInfo(sInfo)
OmagOFFICEMap.refStatusBarVM.SetOutputMessage(EgtMsg(MSG_SIMULATIONPAGEUC + 2) & " " & sInfo, 3, MSG_TYPE.WARNING) 'Extracorsa ...
ptEndPointLift.y -= vtMove.y
Dim dMaxMove As Double = VacuumCups.GetExtraStrokeValue(sInfo)
If Math.Abs(dMaxMove - vtMove.y) <= EPS_SMALL * 100 Then
vtMove.y = 0
Else
vtMove.y -= dMaxMove - EPS_SMALL * 100
End If
ptEndPointLift.y += vtMove.y
bOk = False
Case 8
' extra corsa sulla y+
EgtGetOutstrokeInfo(sInfo)
OmagOFFICEMap.refStatusBarVM.SetOutputMessage(EgtMsg(MSG_SIMULATIONPAGEUC + 2) & " " & sInfo, 3, MSG_TYPE.WARNING) 'Extracorsa ...
ptEndPointLift.y -= vtMove.y
Dim dMaxMove As Double = VacuumCups.GetExtraStrokeValue(sInfo)
If Math.Abs(dMaxMove - vtMove.y) <= EPS_SMALL * 100 Then
vtMove.y = 0
Else
vtMove.y -= dMaxMove + EPS_SMALL * 100
End If
ptEndPointLift.y += vtMove.y
bOk = False
End Select
' il movimento del pezzo è accettabile, aggiorno le posizione per la verifica dello step successivo
VacuumCups.ptStartPointLift = ptEndPointLift
Return bOk
End Function
' verifica che la posizione di rialascio sia corretta, altrimenti coreggo l'angolo di posizione
Private Function VerifyReleasdAngleIsValid(ByRef dAngDeg As Double, ByVal ptCenter As Point3d) As Boolean
Dim bOk As Boolean = True
' determino il punto finale dello spostamento
Dim ptEndPointLift As Point3d = VacuumCups.ptStartPointLift
Dim dDegRotEndAng As Double = VacuumCups.dDegRotStartAng + dAngDeg
ptEndPointLift.Rotate(ptCenter, Vector3d.Z_AX(), dAngDeg)
Dim sInfo As String = String.Empty
Select Case VacuumCups.VerifyOutOfStrokes(ptEndPointLift, dDegRotEndAng)
Case 16
' extra corsa sulla c-
EgtGetOutstrokeInfo(sInfo)
OmagOFFICEMap.refStatusBarVM.SetOutputMessage(EgtMsg(MSG_SIMULATIONPAGEUC + 2) & " " & sInfo, 3, MSG_TYPE.WARNING) 'Extracorsa ...
ptEndPointLift.Rotate(ptCenter, Vector3d.Z_AX(), -dAngDeg)
dDegRotEndAng -= dAngDeg
dAngDeg += VacuumCups.GetExtraStrokeValue(sInfo) + EPS_SMALL
dDegRotEndAng += dAngDeg
ptEndPointLift.Rotate(ptCenter, Vector3d.Z_AX(), dAngDeg)
bOk = False
Case 34
' extra corsa sulla c+
EgtGetOutstrokeInfo(sInfo)
OmagOFFICEMap.refStatusBarVM.SetOutputMessage(EgtMsg(MSG_SIMULATIONPAGEUC + 2) & " " & sInfo, 3, MSG_TYPE.WARNING) 'Extracorsa ...
ptEndPointLift.Rotate(ptCenter, Vector3d.Z_AX(), -dAngDeg)
dDegRotEndAng -= dAngDeg
dAngDeg -= VacuumCups.GetExtraStrokeValue(sInfo) + EPS_SMALL
dDegRotEndAng += dAngDeg
ptEndPointLift.Rotate(ptCenter, Vector3d.Z_AX(), dAngDeg)
bOk = False
End Select
' il movimento del pezzo è accettabile, aggiorno le posizione per la verifica dello step successivo
VacuumCups.ptStartPointLift = ptEndPointLift
VacuumCups.dDegRotStartAng = dDegRotEndAng
Return bOk
End Function
#End Region ' METHODS
#Region "COMMANDS"
@@ -286,9 +388,15 @@ Public Class MoveRawModeVM
Else
If m_bRawWithCups Then
Dim vtMove As New Vector3d(0, m_dMoveStep, 0)
' ----------- INIZIO verifica di essere entro i limiti macchina -----------
OmagOFFICEMap.refStatusBarVM.ClearOutputMessage()
VerifyReleasdPositionIsValid(vtMove)
' ----------- FINE verifica di essere entro i limiti macchina -----------
If EgtMoveRawPart(nRawId, vtMove) Then
EgtMove(GetVacuumId(), vtMove, GDB_RT.GLOB)
AddRawMoveData(nRawId, vtMove, m_RawMoveDataList)
Else
VacuumCups.ptStartPointLift.y -= vtMove.y
End If
Else
' Pezzo troppo piccolo : non si può muovere
@@ -320,9 +428,15 @@ Public Class MoveRawModeVM
While nRawId <> GDB_ID.NULL
If m_bRawWithCups Then
Dim vtMove As New Vector3d(-m_dMoveStep, 0, 0)
' ----------- INIZIO verifica di essere entro i limiti macchina -----------
OmagOFFICEMap.refStatusBarVM.ClearOutputMessage()
VerifyReleasdPositionIsValid(vtMove)
' ----------- FINE verifica di essere entro i limiti macchina -----------
If EgtMoveRawPart(nRawId, vtMove) Then
EgtMove(GetVacuumId(), vtMove, GDB_RT.GLOB)
AddRawMoveData(nRawId, vtMove, m_RawMoveDataList)
Else
VacuumCups.ptStartPointLift.x -= vtMove.x
End If
Else
' Pezzo troppo piccolo : non si può muovere
@@ -353,9 +467,15 @@ Public Class MoveRawModeVM
While nRawId <> GDB_ID.NULL
If m_bRawWithCups Then
Dim vtMove As New Vector3d(m_dMoveStep, 0, 0)
' ----------- INIZIO verifica di essere entro i limiti macchina -----------
OmagOFFICEMap.refStatusBarVM.ClearOutputMessage()
VerifyReleasdPositionIsValid(vtMove)
' ----------- FINE verifica di essere entro i limiti macchina -----------
If EgtMoveRawPart(nRawId, vtMove) Then
EgtMove(GetVacuumId(), vtMove, GDB_RT.GLOB)
AddRawMoveData(nRawId, vtMove, m_RawMoveDataList)
Else
VacuumCups.ptStartPointLift.x -= vtMove.x
End If
Else
' Pezzo troppo piccolo : non si può muovere
@@ -403,9 +523,15 @@ Public Class MoveRawModeVM
Else
If m_bRawWithCups Then
Dim vtMove As New Vector3d(0, -m_dMoveStep, 0)
' ----------- INIZIO verifica di essere entro i limiti macchina -----------
OmagOFFICEMap.refStatusBarVM.ClearOutputMessage()
VerifyReleasdPositionIsValid(vtMove)
' ----------- FINE verifica di essere entro i limiti macchina -----------
If EgtMoveRawPart(nRawId, vtMove) Then
EgtMove(GetVacuumId(), vtMove, GDB_RT.GLOB)
AddRawMoveData(nRawId, vtMove, m_RawMoveDataList)
Else
VacuumCups.ptStartPointLift.y -= vtMove.y
End If
Else
' Pezzo troppo piccolo : non si può muovere
@@ -437,12 +563,19 @@ Public Class MoveRawModeVM
While nRawId <> GDB_ID.NULL
If m_bRawWithCups Then
Dim dAng As Double = m_dRotationStep
' ----------- INIZIO verifica di essere entro i limiti macchina -----------
' Recupero il centro del grezzo
Dim ptRawCen As Point3d
EgtGetRawPartCenter(nRawId, ptRawCen)
OmagOFFICEMap.refStatusBarVM.ClearOutputMessage()
VerifyReleasdAngleIsValid(dAng, ptRawCen)
' ----------- FINE verifica di essere entro i limiti macchina -----------
If EgtRotateRawPart(nRawId, Vector3d.Z_AX(), dAng) Then
' Recupero il centro del grezzo
Dim ptRawCen As Point3d
EgtGetRawPartCenter(nRawId, ptRawCen)
EgtRotate(GetVacuumId(), ptRawCen, Vector3d.Z_AX(), dAng, GDB_RT.GLOB)
AddRawMoveData(nRawId, dAng, m_RawMoveDataList)
Else
VacuumCups.ptStartPointLift.Rotate(ptRawCen, Vector3d.Z_AX(), dAng)
VacuumCups.dDegRotStartAng -= dAng
End If
Else
OmagOFFICEMap.refStatusBarVM.SetOutputMessage(EgtMsg(MSG_MOVERAWPAGEUC + 2), 3, MSG_TYPE.WARNING)
@@ -472,12 +605,19 @@ Public Class MoveRawModeVM
While nRawId <> GDB_ID.NULL
If m_bRawWithCups Then
Dim dAng As Double = -m_dRotationStep
' ----------- INIZIO verifica di essere entro i limiti macchina -----------
' Recupero il centro del grezzo
Dim ptRawCen As Point3d
EgtGetRawPartCenter(nRawId, ptRawCen)
OmagOFFICEMap.refStatusBarVM.ClearOutputMessage()
VerifyReleasdAngleIsValid(dAng, ptRawCen)
' ----------- FINE verifica di essere entro i limiti macchina -----------
If EgtRotateRawPart(nRawId, Vector3d.Z_AX(), dAng) Then
' Recupero il centro del grezzo
Dim ptRawCen As Point3d
EgtGetRawPartCenter(nRawId, ptRawCen)
EgtRotate(GetVacuumId(), ptRawCen, Vector3d.Z_AX(), dAng, GDB_RT.GLOB)
AddRawMoveData(nRawId, dAng, m_RawMoveDataList)
Else
VacuumCups.ptStartPointLift.Rotate(ptRawCen, Vector3d.Z_AX(), dAng)
VacuumCups.dDegRotStartAng -= dAng
End If
Else
OmagOFFICEMap.refStatusBarVM.SetOutputMessage(EgtMsg(MSG_MOVERAWPAGEUC + 2), 3, MSG_TYPE.WARNING)
@@ -556,6 +696,16 @@ Public Class MoveRawModeVM
' Se con ventose, le posiziono sul grezzo
If Not OmagOFFICEMap.refMachiningTabVM.ByHand Then
Dim rmData As New RawMoveData
' inizializzo i dati del grezzo per il cacolo del peso
Dim MaxSinglePlugger As Double = 250
MaxSinglePlugger = GetPrivateProfileDouble(S_MACH_RAWMOVE, K_MACH_WEIGHT_SINGLEPLUGGER, MaxSinglePlugger, sMachIniFile)
Dim MaxDoublePlugger As Double = 750
MaxDoublePlugger = GetPrivateProfileDouble(S_MACH_RAWMOVE, K_MACH_WEIGHT_DOUBLEPLUGGER, MaxDoublePlugger, sMachIniFile)
Dim AverageDensity As Double = 2700
AverageDensity = GetPrivateProfileDouble(S_MATERIALS, K_AVERAGEDENSITY, AverageDensity, sMachIniFile)
VacuumCups.GetWeightInformation(AverageDensity, MaxSinglePlugger, MaxDoublePlugger)
VacuumCups.GetRotationForExtraStrokeY(GetPrivateProfileInt(S_MACH_RAWMOVE, K_MACH_ROTATEVACUUMFOREXTRASTROKEY, 0, sMachIniFile) <> 0)
VacuumCups.GetRotationForExtraStrokeX(GetPrivateProfileInt(S_MACH_RAWMOVE, K_MACH_ROTATEVACUUMFOREXTRASTROKEX, 0, sMachIniFile) <> 0)
If PutVacuumCupsOnRaw(nId, rmData) Then
' Visualizzo le ventose
EgtSetStatus(GetVacuumId(), GDB_ST.ON_)
@@ -565,10 +715,19 @@ Public Class MoveRawModeVM
' Reset eventuale messaggio
OmagOFFICEMap.refStatusBarVM.ClearOutputMessage()
Else
' Visualizzo le ventose
EgtSetStatus(GetVacuumId(), GDB_ST.OFF)
' Aggiorno i dati
m_bRawWithCups = False
' Messaggio di avvertimento (Pezzo troppo piccolo : non si può muovere)
OmagOFFICEMap.refStatusBarVM.SetOutputMessage(EgtMsg(MSG_MOVERAWPAGEUC + 2), 3, MSG_TYPE.WARNING)
If VacuumCups.bOverWeight Then
' Messaggio di avvertimento (Pezzo troppo piccolo : non si può muovere)
OmagOFFICEMap.refStatusBarVM.SetOutputMessage(EgtMsg(MSG_MOVERAWPAGEUC + 4), 3, MSG_TYPE.WARNING)
ElseIf VacuumCups.bExtraStroke Then
OmagOFFICEMap.refStatusBarVM.SetOutputMessage(EgtMsg(MSG_MOVERAWPAGEUC + 5), 3, MSG_TYPE.WARNING) 'Pezzo oltre le corse : non si può muovere
Else
' Messaggio di avvertimento (Pezzo troppo piccolo : non si può muovere)
OmagOFFICEMap.refStatusBarVM.SetOutputMessage(EgtMsg(MSG_MOVERAWPAGEUC + 2), 3, MSG_TYPE.WARNING)
End If
End If
End If
End If
+2
View File
@@ -29,11 +29,13 @@
</Grid.ColumnDefinitions>
<Button Grid.Column="1"
IsEnabled="{Binding bEnabledCommandMove}"
Style="{StaticResource OptionPanel_Button}"
Command="{Binding MoveUpCommand}">
<Image Source="/Resources/MachiningTab/UpArrow.png"/>
</Button>
<Button Grid.Column="2"
IsEnabled="{Binding bEnabledCommandMove}"
Style="{StaticResource OptionPanel_Button}"
Command="{Binding MoveDownCommand}">
<Image Source="/Resources/MachiningTab/DownArrow.png"/>
+277 -106
View File
@@ -42,6 +42,17 @@ Public Class SplitModeVM
End Get
End Property
Private m_bEnabledCommandMove As Boolean = False
Public Property bEnabledCommandMove As Boolean
Get
Return m_bEnabledCommandMove
End Get
Set(value As Boolean)
m_bEnabledCommandMove = value
NotifyPropertyChanged("bEnabledCommandMove")
End Set
End Property
Private m_SplitModeIsEnabled As Boolean
Public Property SplitModeIsEnabled As Boolean
Get
@@ -1054,16 +1065,21 @@ Public Class SplitModeVM
Public Sub OnOff(ByVal param As Object)
If m_CurrFirstInd = -1 Then Return
For Index = m_CurrFirstInd To m_CurrLastInd
Dim nI As Integer = m_ItemList(Index).Ind
If m_MachiningList(nI).m_bEnabled Then
m_MachiningList(nI).m_bEnabled = False
m_ItemList(Index).bIsActive = False
Else
m_MachiningList(nI).m_bEnabled = True
m_ItemList(Index).bIsActive = True
If m_ItemList(Index).IsSelected Then
If Not m_ItemList(Index).IsSelected Then
Continue For
End If
Dim nI As Integer = m_ItemList(Index).Ind
If m_MachiningList(nI).m_bEnabled Then
m_MachiningList(nI).m_bEnabled = False
m_ItemList(Index).bIsActive = False
Else
m_MachiningList(nI).m_bEnabled = True
m_ItemList(Index).bIsActive = True
End If
ColorMachining(m_MachiningList(nI))
ColorNumberArrow(nI)
End If
ColorMachining(m_MachiningList(nI))
ColorNumberArrow(nI)
Next
EgtDraw()
' Imposto flag di modifica
@@ -1156,6 +1172,9 @@ Public Class SplitModeVM
If m_CurrFirstInd = -1 Then Return
Dim bGenModif As Boolean = False
For Index = m_CurrFirstInd To m_CurrLastInd
If Not m_ItemList(Index).IsSelected Then
Continue For
End If
Dim nI As Integer = m_ItemList(Index).Ind
' Provo ad entrambi gli estremi
Dim bModif As Boolean = AdjustBothCuts(nI)
@@ -1190,6 +1209,9 @@ Public Class SplitModeVM
If m_CurrFirstInd = -1 Then Return
Dim bGenModif As Boolean = False
For Index = m_CurrFirstInd To m_CurrLastInd
If Not m_ItemList(Index).IsSelected Then
Continue For
End If
Dim nI As Integer = m_ItemList(Index).Ind
' Eseguo
If AdjustStartCut(nI) Then
@@ -1218,6 +1240,9 @@ Public Class SplitModeVM
If m_CurrFirstInd = -1 Then Return
Dim bGenModif As Boolean = False
For Index = m_CurrFirstInd To m_CurrLastInd
If Not m_ItemList(Index).IsSelected Then
Continue For
End If
Dim nI As Integer = m_ItemList(Index).Ind
' Eseguo
If AdjustEndCut(nI) Then
@@ -1359,6 +1384,9 @@ Public Class SplitModeVM
If m_CurrFirstInd = -1 Then Return
Dim bGenModif As Boolean = False
For Index = m_CurrFirstInd To m_CurrLastInd
If Not m_ItemList(Index).IsSelected Then
Continue For
End If
Dim nI As Integer = m_ItemList(Index).Ind
If m_MachiningList(nI).m_sLay = NAME_OUTLOOP Then
EgtSetCurrMachining(m_MachiningList(nI).m_nId)
@@ -1496,6 +1524,9 @@ Public Class SplitModeVM
If m_CurrFirstInd = -1 Then Return
Dim bGenModif As Boolean = False
For Index = m_CurrFirstInd To m_CurrLastInd
If Not m_ItemList(Index).IsSelected Then
Continue For
End If
Dim nI As Integer = m_ItemList(Index).Ind
If m_MachiningList(nI).m_sLay = NAME_OUTLOOP Then
EgtSetCurrMachining(m_MachiningList(nI).m_nId)
@@ -1698,10 +1729,24 @@ Public Class SplitModeVM
End Property
Public Sub ModifStart(ByVal param As Object)
Dim bFirstInd As Boolean = True
Dim bFirstMill As Boolean = True
Dim bFirstWJ As Boolean = True
' elenco delle variabili : MCH_MY.SAWING/MCH_MY.MILLING
Dim dUsal As Double = 0
' elenco delle variabili : MCH_MY.WATERJETTING
Dim dWJAddLen As Double = 0
Dim bWJLiHole As Boolean = True
Dim nWJTangDist As Double = 0
Dim nWJPerpDist As Double = 0
Dim nWJLeadInType As Integer = 0
' Recupero la lavorazione corrente
If m_CurrFirstInd = -1 Then Return
Dim bGenModif As Boolean = False
For Index = m_CurrFirstInd To m_CurrLastInd
If Not m_ItemList(Index).IsSelected Then
Continue For
End If
Dim nI As Integer = m_ItemList(Index).Ind
Dim nOperId As Integer = m_MachiningList(nI).m_nId
Dim nMachiningType As Integer = EgtGetOperationType(nOperId)
@@ -1710,14 +1755,19 @@ Public Class SplitModeVM
Dim dOrigUsal As Double = 0
EgtGetInfo(nOperId, INFO_MCH_USER_SAL, dOrigUsal)
' Dialogo richiesta valore
Dim ModifStartWindow As New ModifStartEndCutWindowV
Dim ModifStartWindowVM As New ModifStartEndCutWindowVM
ModifStartWindow.DataContext = ModifStartWindowVM
ModifStartWindow.Owner = Application.Current.MainWindow
ModifStartWindowVM.SetVal(dOrigUsal)
If Not ModifStartWindow.ShowDialog() Then Return
' Modifica della lavorazione
Dim dUsal As Double = ModifStartWindowVM.GetVal()
If bFirstInd Then
Dim ModifStartWindow As New ModifStartEndCutWindowV
Dim ModifStartWindowVM As New ModifStartEndCutWindowVM
ModifStartWindowVM.Title = "Sawing"
ModifStartWindow.DataContext = ModifStartWindowVM
ModifStartWindow.Owner = Application.Current.MainWindow
ModifStartWindowVM.SetVal(dOrigUsal)
If Not ModifStartWindow.ShowDialog() Then Return
' Modifica della lavorazione
dUsal = ModifStartWindowVM.GetVal()
bFirstInd = False
End If
Dim bRepeat As Boolean = False
Do
EgtSetCurrMachining(nOperId)
@@ -1739,41 +1789,81 @@ Public Class SplitModeVM
ColorMachining(m_MachiningList(nI))
ColorNumberArrow(nI)
bGenModif = True
' se altrimenti getto d'acqua
ElseIf nMachiningType = MCH_MY.WATERJETTING Then
' Recupero i valori attuali della lavorazione
Dim dAddLen As Double = 0
Dim bLiHole As Boolean = True
Dim nTangDist As Double = 0
Dim nPerpDist As Double = 0
Dim LeadInTypeId As Integer = 0
EgtSetCurrMachining(nOperId)
EgtGetMachiningParam(MCH_MP.STARTADDLEN, dAddLen)
EgtGetMachiningParam(MCH_MP.LIHOLE, bLiHole)
EgtGetMachiningParam(MCH_MP.LITANG, nTangDist)
EgtGetMachiningParam(MCH_MP.LIPERP, nPerpDist)
EgtGetMachiningParam(MCH_MP.LEADINTYPE, LeadInTypeId)
' Dialogo richiesta valori
Dim ModifStartWnd As New ModifStartEndWjWindowV
Dim ModifStartWndVM As New ModifStartEndWjWindowVM
ModifStartWnd.DataContext = ModifStartWndVM
ModifStartWnd.Owner = Application.Current.MainWindow
ModifStartWndVM.HoleVisibility = Visibility.Visible
ModifStartWndVM.LeadInVisibility = Visibility.Visible
ModifStartWndVM.LeadOutVisibility = Visibility.Hidden
ModifStartWndVM.SetVal(dAddLen)
ModifStartWndVM.SetHole(bLiHole)
ModifStartWndVM.SetLeadInType(LeadInTypeId)
ModifStartWndVM.SetLiTangDist(nTangDist)
ModifStartWndVM.SetLiPerpDist(nPerpDist)
If Not ModifStartWnd.ShowDialog() Then Return
ElseIf nMachiningType = MCH_MY.MILLING Then ' And m_MachiningList(nI).m_sLay = NAME_ONPATH
' leggo il valore salvato nella geometria
Dim dOrigUsal As Double = 0
EgtGetInfo(nOperId, INFO_MCH_USER_SAL, dOrigUsal)
' Dialogo richiesta valore
If bFirstMill Then
Dim ModifStartWindow As New ModifStartEndCutWindowV
Dim ModifStartWindowVM As New ModifStartEndCutWindowVM
ModifStartWindowVM.Title = "Milling"
ModifStartWindow.DataContext = ModifStartWindowVM
ModifStartWindow.Owner = Application.Current.MainWindow
ModifStartWindowVM.SetVal(dOrigUsal)
If Not ModifStartWindow.ShowDialog() Then Return
' Modifica della lavorazione
dUsal = ModifStartWindowVM.GetVal()
bFirstMill = False
End If
' Modifica della lavorazione
EgtSetCurrMachining(nOperId)
EgtSetMachiningParam(MCH_MP.LIHOLE, ModifStartWndVM.GetHole())
EgtSetMachiningParam(MCH_MP.STARTADDLEN, ModifStartWndVM.GetVal())
EgtSetMachiningParam(MCH_MP.LEADINTYPE, ModifStartWndVM.GetLeadInType().Id)
EgtSetMachiningParam(MCH_MP.LITANG, ModifStartWndVM.GetLiTangDist())
EgtSetMachiningParam(MCH_MP.LIPERP, ModifStartWndVM.GetLiPerpDist())
Dim dAddLen As Double = 0
EgtGetMachiningParam(MCH_MP.STARTADDLEN, dAddLen)
EgtSetMachiningParam(MCH_MP.STARTADDLEN, dAddLen + dUsal - dOrigUsal)
EgtSetInfo(nOperId, INFO_MCH_USER_SAL, dUsal)
UpdateMachiningPreview(m_MachiningList(nI).m_nId, True)
bGenModif = True
' se altrimenti getto d'acqua
ElseIf nMachiningType = MCH_MY.WATERJETTING Then
' Recupero i valori attuali della lavorazione
If bFirstWJ Then
Dim bOriginalIsLeadIn As Boolean = True
Dim dOriginalAddLen As Double = 0
Dim bOriginalLiHole As Boolean = True
Dim nOriginalTangDist As Double = 0
Dim nOriginalPerpDist As Double = 0
Dim nOriginalLeadInType As Integer = 0
EgtSetCurrMachining(nOperId)
EgtGetMachiningParam(MCH_MP.STARTADDLEN, dOriginalAddLen)
EgtGetMachiningParam(MCH_MP.LIHOLE, bOriginalLiHole)
EgtGetMachiningParam(MCH_MP.LITANG, nOriginalTangDist)
EgtGetMachiningParam(MCH_MP.LIPERP, nOriginalPerpDist)
EgtGetMachiningParam(MCH_MP.LEADINTYPE, nOriginalLeadInType)
' Dialogo richiesta valori
Dim ModifStartWnd As New ModifStartEndWjWindowV
Dim ModifStartWndVM As New ModifStartEndWjWindowVM
ModifStartWndVM.Title = "Water jetting"
ModifStartWnd.DataContext = ModifStartWndVM
ModifStartWnd.Owner = Application.Current.MainWindow
ModifStartWndVM.HoleVisibility = Visibility.Visible
ModifStartWndVM.LeadInVisibility = Visibility.Visible
ModifStartWndVM.LeadOutVisibility = Visibility.Hidden
ModifStartWndVM.SetVal(dOriginalAddLen)
ModifStartWndVM.SetHole(bOriginalLiHole)
ModifStartWndVM.SetLeadInType(nOriginalLeadInType)
ModifStartWndVM.SetLiTangDist(nOriginalTangDist)
ModifStartWndVM.SetLiPerpDist(nOriginalPerpDist)
If Not ModifStartWnd.ShowDialog() Then Return
dWJAddLen = ModifStartWndVM.GetVal()
bWJLiHole = ModifStartWndVM.GetHole()
nWJTangDist = ModifStartWndVM.GetLiTangDist()
nWJPerpDist = ModifStartWndVM.GetLiPerpDist()
nWJLeadInType = ModifStartWndVM.GetLeadInType().Id
bFirstWJ = False
End If
' Modifica della lavorazione
EgtSetCurrMachining(nOperId)
EgtSetMachiningParam(MCH_MP.LIHOLE, bWJLiHole)
EgtSetMachiningParam(MCH_MP.STARTADDLEN, dWJAddLen)
EgtSetMachiningParam(MCH_MP.LEADINTYPE, nWJLeadInType)
EgtSetMachiningParam(MCH_MP.LITANG, nWJTangDist)
EgtSetMachiningParam(MCH_MP.LIPERP, nWJPerpDist)
UpdateMachiningPreview(m_MachiningList(nI).m_nId, True)
' verifico interferenza
EgtVerifyMachining(m_MachiningList(nI).m_nId, m_MachiningList(nI).m_nInterf)
@@ -1803,10 +1893,24 @@ Public Class SplitModeVM
End Property
Public Sub ModifEnd(ByVal param As Object)
Dim bFirstInd As Boolean = True
Dim bFirstMill As Boolean = True
Dim bFirstWJ As Boolean = True
' elenco delle variabili : MCH_MY.SAWING/MCH_MY.MILLING
Dim dUeal As Double = 0
' elenco delle variabili : MCH_MY.WATERJETTING
Dim dWJAddLen As Double = 0
Dim nWJTangDist As Double = 0
Dim nWJPerpDist As Double = 0
Dim nWJLeadInType As Integer = 0
' Recupero la lavorazione corrente
If m_CurrFirstInd = -1 Then Return
Dim bGenModif As Boolean = False
For Index = m_CurrFirstInd To m_CurrLastInd
If Not m_ItemList(Index).IsSelected Then
Continue For
End If
Dim nI As Integer = m_ItemList(Index).Ind
Dim nOperId As Integer = m_MachiningList(nI).m_nId
Dim nMachiningType As Integer = EgtGetOperationType(nOperId)
@@ -1815,14 +1919,18 @@ Public Class SplitModeVM
Dim dOrigUeal As Double = 0
EgtGetInfo(nOperId, INFO_MCH_USER_EAL, dOrigUeal)
' Dialogo richiesta valore
Dim ModifStartWindow As New ModifStartEndCutWindowV
Dim ModifStartWindowVM As New ModifStartEndCutWindowVM
ModifStartWindow.DataContext = ModifStartWindowVM
ModifStartWindow.Owner = Application.Current.MainWindow
ModifStartWindowVM.SetVal(dOrigUeal)
If Not ModifStartWindow.ShowDialog() Then Return
' Modifica della lavorazione
Dim dUeal As Double = ModifStartWindowVM.GetVal()
If bFirstInd Then
Dim ModifStartWindow As New ModifStartEndCutWindowV
Dim ModifStartWindowVM As New ModifStartEndCutWindowVM
ModifStartWindowVM.Title = "Sawing"
ModifStartWindow.DataContext = ModifStartWindowVM
ModifStartWindow.Owner = Application.Current.MainWindow
ModifStartWindowVM.SetVal(dOrigUeal)
If Not ModifStartWindow.ShowDialog() Then Return
' Modifica della lavorazione
dUeal = ModifStartWindowVM.GetVal()
bFirstInd = False
End If
Dim bRepeat As Boolean = False
Do
EgtSetCurrMachining(nOperId)
@@ -1846,37 +1954,75 @@ Public Class SplitModeVM
ColorMachining(m_MachiningList(nI))
ColorNumberArrow(nI)
bGenModif = True
ElseIf nMachiningType = MCH_MY.MILLING Then ' And m_MachiningList(nI).m_sLay = NAME_ONPATH
Dim dOrigUeal As Double = 0
EgtGetInfo(nOperId, INFO_MCH_USER_EAL, dOrigUeal)
' ------------------ INIZIO PREPARAZIONE TASTIERINO VIRTUALE ------------------
If bFirstMill Then
Dim ModifStartWindow As New ModifStartEndCutWindowV
Dim ModifStartWindowVM As New ModifStartEndCutWindowVM
ModifStartWindowVM.Title = "Milling"
ModifStartWindow.DataContext = ModifStartWindowVM
ModifStartWindow.Owner = Application.Current.MainWindow
ModifStartWindowVM.SetVal(dOrigUeal)
If Not ModifStartWindow.ShowDialog() Then Return
' Modifica della lavorazione
dUeal = ModifStartWindowVM.GetVal()
bFirstMill = False
End If
' ------------------ FINE PREPARAZIONE TASTIERINO VIRTUALE ------------------
' Modifica della lavorazione
EgtSetCurrMachining(nOperId)
Dim dAddLen As Double = 0
EgtGetMachiningParam(MCH_MP.ENDADDLEN, dAddLen)
EgtSetMachiningParam(MCH_MP.ENDADDLEN, dAddLen + dUeal - dOrigUeal)
EgtSetInfo(nOperId, INFO_MCH_USER_EAL, dUeal)
UpdateMachiningPreview(m_MachiningList(nI).m_nId, True)
bGenModif = True
' se altrimenti getto d'acqua
ElseIf nMachiningType = MCH_MY.WATERJETTING Then
' Recupero i valori attuali della lavorazione
Dim dAddLen As Double = 0
Dim nTangDist As Double = 0
Dim nPerpDist As Double = 0
Dim LeadOutTypeId As Integer = 0
EgtSetCurrMachining(nOperId)
EgtGetMachiningParam(MCH_MP.ENDADDLEN, dAddLen)
EgtGetMachiningParam(MCH_MP.LOTANG, nTangDist)
EgtGetMachiningParam(MCH_MP.LOPERP, nPerpDist)
EgtGetMachiningParam(MCH_MP.LEADOUTTYPE, LeadOutTypeId)
' Dialogo richiesta valori
Dim ModifStartWnd As New ModifStartEndWjWindowV()
Dim ModifStartWndVM As New ModifStartEndWjWindowVM
ModifStartWnd.DataContext = ModifStartWndVM
ModifStartWnd.Owner = Application.Current.MainWindow
ModifStartWndVM.HoleVisibility = Visibility.Hidden
ModifStartWndVM.LeadInVisibility = Visibility.Hidden
ModifStartWndVM.LeadOutVisibility = Visibility.Visible
ModifStartWndVM.SetVal(dAddLen)
ModifStartWndVM.SetLeadOutType(LeadOutTypeId)
ModifStartWndVM.SetLoTangDist(nTangDist)
ModifStartWndVM.SetLoPerpDist(nPerpDist)
If Not ModifStartWnd.ShowDialog() Then Return
If bFirstWJ Then
Dim dAddLen As Double = 0
Dim nTangDist As Double = 0
Dim nPerpDist As Double = 0
Dim LeadOutTypeId As Integer = 0
EgtSetCurrMachining(nOperId)
EgtGetMachiningParam(MCH_MP.ENDADDLEN, dAddLen)
EgtGetMachiningParam(MCH_MP.LOTANG, nTangDist)
EgtGetMachiningParam(MCH_MP.LOPERP, nPerpDist)
EgtGetMachiningParam(MCH_MP.LEADOUTTYPE, LeadOutTypeId)
' Dialogo richiesta valori
Dim ModifStartWnd As New ModifStartEndWjWindowV()
Dim ModifStartWndVM As New ModifStartEndWjWindowVM
ModifStartWndVM.Title = "Water jetting"
ModifStartWnd.DataContext = ModifStartWndVM
ModifStartWnd.Owner = Application.Current.MainWindow
ModifStartWndVM.HoleVisibility = Visibility.Hidden
ModifStartWndVM.LeadInVisibility = Visibility.Hidden
ModifStartWndVM.LeadOutVisibility = Visibility.Visible
ModifStartWndVM.SetVal(dAddLen)
ModifStartWndVM.SetLeadOutType(LeadOutTypeId)
ModifStartWndVM.SetLoTangDist(nTangDist)
ModifStartWndVM.SetLoPerpDist(nPerpDist)
If Not ModifStartWnd.ShowDialog() Then Return
dWJAddLen = ModifStartWndVM.GetVal()
nWJTangDist = ModifStartWndVM.GetLoTangDist()
nWJPerpDist = ModifStartWndVM.GetLoPerpDist()
nWJLeadInType = ModifStartWndVM.GetLeadOutType().Id
bFirstWJ = False
End If
' Modifica della lavorazione
EgtSetCurrMachining(nOperId)
EgtSetMachiningParam(MCH_MP.ENDADDLEN, ModifStartWndVM.GetVal())
EgtSetMachiningParam(MCH_MP.LEADOUTTYPE, ModifStartWndVM.GetLeadOutType().Id)
EgtSetMachiningParam(MCH_MP.LOTANG, ModifStartWndVM.GetLoTangDist())
EgtSetMachiningParam(MCH_MP.LOPERP, ModifStartWndVM.GetLoPerpDist())
EgtSetMachiningParam(MCH_MP.ENDADDLEN, dWJAddLen)
EgtSetMachiningParam(MCH_MP.LEADOUTTYPE, nWJLeadInType)
EgtSetMachiningParam(MCH_MP.LOTANG, nWJTangDist)
EgtSetMachiningParam(MCH_MP.LOPERP, nWJPerpDist)
UpdateMachiningPreview(m_MachiningList(nI).m_nId, True)
' verifico interferenza
EgtVerifyMachining(m_MachiningList(nI).m_nId, m_MachiningList(nI).m_nInterf)
@@ -1908,6 +2054,9 @@ Public Class SplitModeVM
Public Sub Pause(ByVal param As Object)
If m_CurrFirstInd = -1 Then Return
For Index = m_CurrFirstInd To m_CurrLastInd
If Not m_ItemList(Index).IsSelected Then
Continue For
End If
Dim nI As Integer = m_ItemList(Index).Ind
Dim nOperId As Integer = m_MachiningList(nI).m_nId
If GetPause(nOperId) Then
@@ -1940,6 +2089,9 @@ Public Class SplitModeVM
Public Sub Invert(ByVal param As Object)
If m_CurrFirstInd = -1 Then Return
For Index = m_CurrFirstInd To m_CurrLastInd
If Not m_ItemList(Index).IsSelected Then
Continue For
End If
Dim nI As Integer = m_ItemList(Index).Ind
' Si possono invertire solo i tagli di lama
If m_MachiningList(nI).m_nType <> MCH_OY.SAWING Then Continue For
@@ -2252,29 +2404,34 @@ Public Class SplitModeVM
' ------------------------ verifico che le lavorazioni siano dello stesso tipo ------------------------
OmagOFFICEMap.refSplitModeVM.VerifyHomogenousMachining(ItemList)
' -----------------------------------------------------------------------------------------------------
' riordino l'elenco delle lavorazioni
ItemList.Sort(Function(x, y) Comparer(Of Integer).Default.Compare(OmagOFFICEMap.refSplitModeVM.m_ItemList.IndexOf(x), OmagOFFICEMap.refSplitModeVM.m_ItemList.IndexOf(y)))
' ------------------------ verifico che le lavorazioni siano contigue ---------------------------------
OmagOFFICEMap.refSplitModeVM.bEnabledCommandMove = VerifyContinuity(ItemList)
' -----------------------------------------------------------------------------------------------------
'If Not My.Computer.Keyboard.ShiftKeyDown And (My.Computer.Keyboard.CtrlKeyDown And value) Then
' ' verifico che siano contigui
' Dim bContigus As Boolean = False
' Dim LastSel As NameIdLsBxItem = OmagOFFICEMap.refSplitModeVM.m_SelectedItemsList(OmagOFFICEMap.refSplitModeVM.m_SelectedItemsList.Count - 1)
' If OmagOFFICEMap.refSplitModeVM.m_SelectedItemsList.Count = 1 Then
' bContigus = True
' Else
' For Each Item In ItemList
' If Item.Ind = LastSel.Ind + 1 Or Item.Ind = LastSel.Ind - 1 Then
' bContigus = True
' End If
' Next
' End If
' ' se non contiguo, elimino dai selezionati il primo(che è l'ultimo ad essere stato selezionato)
' If Not bContigus Then
' ItemList.Remove(LastSel)
' OmagOFFICEMap.refSplitModeVM.m_SelectedItemsList.RemoveAt(OmagOFFICEMap.refSplitModeVM.m_SelectedItemsList.Count - 1)
' OmagOFFICEMap.refSplitModeVM.ItemList(LastSel.Ind).IsSelected = Not value 'm_IsSelected = Not value
' ' disabilito il pulsanti per spostare le lavorazioni
' End If
'End If
ItemList.Sort(Function(x, y) Comparer(Of Integer).Default.Compare(OmagOFFICEMap.refSplitModeVM.m_ItemList.IndexOf(x),
OmagOFFICEMap.refSplitModeVM.m_ItemList.IndexOf(y)))
If Not My.Computer.Keyboard.ShiftKeyDown And (My.Computer.Keyboard.CtrlKeyDown And value) Then
' verifico che siano contigui
Dim bContigus As Boolean = False
Dim LastSel As NameIdLsBxItem = OmagOFFICEMap.refSplitModeVM.m_SelectedItemsList(OmagOFFICEMap.refSplitModeVM.m_SelectedItemsList.Count - 1)
If OmagOFFICEMap.refSplitModeVM.m_SelectedItemsList.Count = 1 Then
bContigus = True
Else
For Each Item In ItemList
If Item.Ind = LastSel.Ind + 1 Or Item.Ind = LastSel.Ind - 1 Then
bContigus = True
End If
Next
End If
' se non contiguo, elimino dai selezionati il primo(che è l'ultimo ad essere stato selezionato)
If Not bContigus Then
ItemList.Remove(LastSel)
OmagOFFICEMap.refSplitModeVM.m_SelectedItemsList.RemoveAt(OmagOFFICEMap.refSplitModeVM.m_SelectedItemsList.Count - 1)
OmagOFFICEMap.refSplitModeVM.ItemList(LastSel.Ind).IsSelected = Not value 'm_IsSelected = Not value
End If
End If
' resetto marcatura lavorazioni
If OmagOFFICEMap.refSplitModeVM.m_CurrFirstInd > -1 Then
For Index = OmagOFFICEMap.refSplitModeVM.m_CurrFirstInd To OmagOFFICEMap.refSplitModeVM.m_CurrLastInd
@@ -2298,6 +2455,20 @@ Public Class SplitModeVM
End Set
End Property
Public Function VerifyContinuity(ItemList As List(Of NameIdLsBxItem)) As Boolean
If ItemList.Count < 2 Then Return True
Dim bContigus As Boolean = False
For Index As Integer = 0 To ItemList.Count - 2
If ItemList(Index).Ind = ItemList(Index + 1).Ind + 1 Or ItemList(Index).Ind = ItemList(Index + 1).Ind - 1 Then
bContigus = True
Else
bContigus = False
Exit For
End If
Next
Return bContigus
End Function
Public Property Type As Integer
Get
Return m_nType