Compare commits
28 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| bcdb79e796 | |||
| d7aa8902d9 | |||
| 9d7fb9ab99 | |||
| 8becdfb219 | |||
| 7c6b18d996 | |||
| 44e9a448fe | |||
| 5740820eed | |||
| 3202993a3e | |||
| b293156a30 | |||
| dfe876638f | |||
| 1c861ee7e3 | |||
| 5da026accb | |||
| 5396796d28 | |||
| ae18c7f027 | |||
| 54122d82e6 | |||
| f85e97a126 | |||
| 06654d923c | |||
| ce1c6fcf02 | |||
| da11ec0a11 | |||
| 52688ed0da | |||
| 60eda04669 | |||
| b95dd8f41d | |||
| 4b2351c20a | |||
| 988743187b | |||
| a5d6d34664 | |||
| 10cb8f64f5 | |||
| 4ba0fe2520 | |||
| 419776c89f |
@@ -30,7 +30,7 @@
|
|||||||
</Grid.ColumnDefinitions>
|
</Grid.ColumnDefinitions>
|
||||||
|
|
||||||
<Button Name="PhotoBtn" Grid.Column="0" Style="{DynamicResource OmagCut_RightGrayGradientYellowButton}">
|
<Button Name="PhotoBtn" Grid.Column="0" Style="{DynamicResource OmagCut_RightGrayGradientYellowButton}">
|
||||||
<Image Source="{DynamicResource PhotoImg}" Style="{StaticResource OmagCut_ButtonIcon}"/>
|
<Image Name="PhotoIMG" Source="{DynamicResource PhotoImg}" Style="{StaticResource OmagCut_ButtonIcon}"/>
|
||||||
</Button>
|
</Button>
|
||||||
<Button Name="RawPartBtn" Grid.Column="1" Style="{DynamicResource OmagCut_RightGrayGradientYellowButton}">
|
<Button Name="RawPartBtn" Grid.Column="1" Style="{DynamicResource OmagCut_RightGrayGradientYellowButton}">
|
||||||
<Image Source="{DynamicResource RawPartImg}" Style="{StaticResource OmagCut_ButtonIcon}"/>
|
<Image Source="{DynamicResource RawPartImg}" Style="{StaticResource OmagCut_ButtonIcon}"/>
|
||||||
|
|||||||
@@ -370,7 +370,15 @@ Public Class MoveRawPartPage
|
|||||||
VacuumCups.SetWeightInformation(AverageDensity, MaxSinglePlugger, MaxDoublePlugger)
|
VacuumCups.SetWeightInformation(AverageDensity, MaxSinglePlugger, MaxDoublePlugger)
|
||||||
VacuumCups.SetRotationForExtraStrokeY(GetPrivateProfileInt(S_MACH_RAWMOVE, K_MACH_ROTATEVACUUMFOREXTRASTROKEY, 0, m_MainWindow.GetMachIniFile()) <> 0)
|
VacuumCups.SetRotationForExtraStrokeY(GetPrivateProfileInt(S_MACH_RAWMOVE, K_MACH_ROTATEVACUUMFOREXTRASTROKEY, 0, m_MainWindow.GetMachIniFile()) <> 0)
|
||||||
VacuumCups.SetRotationForExtraStrokeX(GetPrivateProfileInt(S_MACH_RAWMOVE, K_MACH_ROTATEVACUUMFOREXTRASTROKEX, 0, m_MainWindow.GetMachIniFile()) <> 0)
|
VacuumCups.SetRotationForExtraStrokeX(GetPrivateProfileInt(S_MACH_RAWMOVE, K_MACH_ROTATEVACUUMFOREXTRASTROKEX, 0, m_MainWindow.GetMachIniFile()) <> 0)
|
||||||
If PutVacuumCupsOnRaw(nId, rmData) Then
|
|
||||||
|
VacuumCups.ResetHeadName()
|
||||||
|
Dim bPutVacuum As Boolean = PutVacuumCupsOnRaw(nId, rmData)
|
||||||
|
If Not bPutVacuum Then
|
||||||
|
Dim bTwoHeadVac As Boolean = ( EgtGetHeadId( VACUUM_HEAD_2) <> GDB_ID.NULL)
|
||||||
|
If bTwoHeadVac Then bPutVacuum = PutVacuumCupsOnRaw(nId, rmData)
|
||||||
|
End If
|
||||||
|
|
||||||
|
If bPutVacuum Then
|
||||||
' Visualizzo le ventose
|
' Visualizzo le ventose
|
||||||
EgtSetStatus(GetVacuumId(), GDB_ST.ON_)
|
EgtSetStatus(GetVacuumId(), GDB_ST.ON_)
|
||||||
' Aggiorno i dati
|
' Aggiorno i dati
|
||||||
@@ -392,6 +400,8 @@ Public Class MoveRawPartPage
|
|||||||
m_CurrProjPage.SetWarningMessage(EgtMsg(MSG_MOVERAWPAGEUC + 2)) 'Pezzo troppo piccolo : non si può muovere
|
m_CurrProjPage.SetWarningMessage(EgtMsg(MSG_MOVERAWPAGEUC + 2)) 'Pezzo troppo piccolo : non si può muovere
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
EgtDraw()
|
EgtDraw()
|
||||||
|
|||||||
+26
-1
@@ -100,7 +100,32 @@
|
|||||||
VerticalAlignment="Center" />
|
VerticalAlignment="Center" />
|
||||||
</Button>
|
</Button>
|
||||||
|
|
||||||
<UniformGrid Name ="UG0" Grid.Column="0" Grid.Row="5" Grid.ColumnSpan="3" Columns="3" >
|
<!--Comandi attivi solo in madalità REG-->
|
||||||
|
<UniformGrid Name ="UG0_Reg" Grid.Column="0" Grid.Row="6" Grid.ColumnSpan="3" Columns="3" Visibility="Hidden">
|
||||||
|
<ToggleButton Name="AddPointRegBtn" Visibility="Hidden"
|
||||||
|
Style="{DynamicResource OmagCut_YellowIconToggleButton}">
|
||||||
|
<Image Source="{DynamicResource RefTabImg}" Style="{StaticResource OmagCut_ArrowButtonIcon}"/>
|
||||||
|
</ToggleButton>
|
||||||
|
<ToggleButton Name="ModPointRegBtn" Style="{DynamicResource OmagCut_YellowIconToggleButton}">
|
||||||
|
<Image Source="{DynamicResource RefTabImg}" Style="{StaticResource OmagCut_ArrowButtonIcon}"/>
|
||||||
|
</ToggleButton>
|
||||||
|
<ToggleButton Name="RemovePointRegBtn" Visibility="Hidden"
|
||||||
|
Style="{DynamicResource OmagCut_YellowIconToggleButton}">
|
||||||
|
<Image Source="{DynamicResource RefTabImg}" Style="{StaticResource OmagCut_ArrowButtonIcon}"/>
|
||||||
|
</ToggleButton>
|
||||||
|
</UniformGrid>
|
||||||
|
|
||||||
|
<!--Comandi attivi solo in madalità REG-->
|
||||||
|
<UniformGrid Name ="UG1_Reg" Grid.Column="0" Grid.Row="5" Grid.ColumnSpan="3" Columns="2" Visibility="Hidden">
|
||||||
|
<Button Name="AdjustPointRegBtn" Style="{DynamicResource OmagCut_YellowIconButton}">
|
||||||
|
<Image Source="{DynamicResource Parcheggia-pezzoImg}" Style="{StaticResource OmagCut_ArrowButtonIcon}"/>
|
||||||
|
</Button>
|
||||||
|
<ToggleButton Name="ActivatePointRegBtn" Style="{DynamicResource OmagCut_YellowIconToggleButton}">
|
||||||
|
<Image Source="{DynamicResource ON_OFF-singolo-taglioImg}" Style="{StaticResource OmagCut_ArrowButtonIcon}"/>
|
||||||
|
</ToggleButton>
|
||||||
|
</UniformGrid>
|
||||||
|
|
||||||
|
<UniformGrid Name ="UG0" Grid.Column="0" Grid.Row="5" Grid.ColumnSpan="3" Columns="3">
|
||||||
<Button Name="InsertPartBtn" Style="{DynamicResource OmagCut_YellowIconButton}">
|
<Button Name="InsertPartBtn" Style="{DynamicResource OmagCut_YellowIconButton}">
|
||||||
<Image Source="{DynamicResource Inserisci-pezzoImg}" Style="{StaticResource OmagCut_ArrowButtonIcon}"/>
|
<Image Source="{DynamicResource Inserisci-pezzoImg}" Style="{StaticResource OmagCut_ArrowButtonIcon}"/>
|
||||||
</Button>
|
</Button>
|
||||||
|
|||||||
+723
-9
@@ -1,4 +1,8 @@
|
|||||||
Imports EgtUILib
|
Imports System.ComponentModel
|
||||||
|
Imports System.Reflection
|
||||||
|
Imports System.Windows.Forms
|
||||||
|
Imports System.Windows.Forms.Integration
|
||||||
|
Imports EgtUILib
|
||||||
Imports EgtWPFLib
|
Imports EgtWPFLib
|
||||||
|
|
||||||
Public Class NestPageUC
|
Public Class NestPageUC
|
||||||
@@ -104,12 +108,17 @@ Public Class NestPageUC
|
|||||||
DeselectAllBtn.ToolTip = EgtMsg(MSG_NESTPAGEUC + 5) 'Deselect All - Deseleziona Tutto
|
DeselectAllBtn.ToolTip = EgtMsg(MSG_NESTPAGEUC + 5) 'Deselect All - Deseleziona Tutto
|
||||||
DragRettanleBtn.ToolTip = "Strech"
|
DragRettanleBtn.ToolTip = "Strech"
|
||||||
|
|
||||||
|
' Nascondo i pulsanti in uso quando attivo la modalità REG
|
||||||
|
UG0_Reg.Visibility = Visibility.Hidden
|
||||||
|
|
||||||
Dim nColumsIn_UG1 As Integer = 2
|
Dim nColumsIn_UG1 As Integer = 2
|
||||||
' gestisco la visualizzazione del comando PAN (per il drag dei rettangoli)
|
' gestisco la visualizzazione del comando PAN (per il drag dei rettangoli)
|
||||||
m_bIsVisibleDragRettangle = (GetPrivateProfileInt(S_NEST, K_DRAG_RETTANGLE, 0, m_MainWindow.GetIniFile()) <> 0)
|
m_bIsVisibleDragRettangle = (GetPrivateProfileInt(S_NEST, K_DRAG_RETTANGLE, 0, m_MainWindow.GetIniFile()) <> 0)
|
||||||
If Not m_bIsVisibleDragRettangle Then
|
If Not m_bIsVisibleDragRettangle Then
|
||||||
nColumsIn_UG1 = 1
|
nColumsIn_UG1 = 1
|
||||||
DragRettanleBtn.Visibility = Visibility.Collapsed
|
DragRettanleBtn.Visibility = Visibility.Collapsed
|
||||||
|
Else
|
||||||
|
DragRettanleBtn.Visibility = Visibility.Visible
|
||||||
End If
|
End If
|
||||||
|
|
||||||
' gestisco la visualizzazione del comando Splt (per i tagli waterjet)
|
' gestisco la visualizzazione del comando Splt (per i tagli waterjet)
|
||||||
@@ -186,6 +195,33 @@ Public Class NestPageUC
|
|||||||
ShowParkedParts()
|
ShowParkedParts()
|
||||||
' Garantisco visibilità eventuale contorno da foto
|
' Garantisco visibilità eventuale contorno da foto
|
||||||
m_CurrProjPage.ShowContour(True)
|
m_CurrProjPage.ShowContour(True)
|
||||||
|
|
||||||
|
' Veroifico se esiste il gruppo "REG"
|
||||||
|
Dim nIdRaws As Integer = EgtGetParent(m_CurrProjPage.m_nRawId)
|
||||||
|
Dim nIdReg As Integer = EgtGetFirstNameInGroup(EgtGetParent(nIdRaws), "Reg")
|
||||||
|
If nIdReg <> GDB_ID.NULL Then
|
||||||
|
m_nRegGroupId = nIdReg
|
||||||
|
EgtGetInfo(m_nRegGroupId, COUNTSPOT, m_nCountSpot)
|
||||||
|
EgtGetInfo(m_nRegGroupId, COUNTSPOTCUT, m_nCountSpotCUT)
|
||||||
|
' Lo nascondo
|
||||||
|
EgtSetStatus(m_nRegGroupId, GDB_ST.OFF)
|
||||||
|
Else
|
||||||
|
' Creo layer per definire i punti di REG
|
||||||
|
m_nRegGroupId = EgtCreateGroup(EgtGetParent(nIdRaws))
|
||||||
|
EgtSetName(m_nRegGroupId, REG)
|
||||||
|
m_nCountSpot = 0
|
||||||
|
m_nCountSpotCUT = 0
|
||||||
|
End If
|
||||||
|
' Se nel progetto non sono inseriti punti SpotReg disabilito i comandi
|
||||||
|
If m_nCountSpot < 1 Then
|
||||||
|
UG0_Reg.IsEnabled = False
|
||||||
|
UG1_Reg.IsEnabled = False
|
||||||
|
End If
|
||||||
|
' Se nel progetto non sono inseriti punti SpotRegCUT provvedo ad aggiungerli
|
||||||
|
If m_nCountSpotCUT < 1 Then
|
||||||
|
InsertSportRegistration()
|
||||||
|
End If
|
||||||
|
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Public Sub UpdateStepsOnUI()
|
Public Sub UpdateStepsOnUI()
|
||||||
@@ -890,10 +926,103 @@ Public Class NestPageUC
|
|||||||
|
|
||||||
Private Sub OnMyMouseDownScene(sender As Object, e As System.Windows.Forms.MouseEventArgs) Handles m_CurrProjPage.OnMouseDownScene
|
Private Sub OnMyMouseDownScene(sender As Object, e As System.Windows.Forms.MouseEventArgs) Handles m_CurrProjPage.OnMouseDownScene
|
||||||
' Verifico di essere il gestore attivo e non in modalità registrazione
|
' Verifico di essere il gestore attivo e non in modalità registrazione
|
||||||
If Not m_bActive Or m_bRegister Then Return
|
If Not m_bActive Or m_bRegister Then
|
||||||
|
' procedo solo sel il click è avvenuto con il tasto sinistro del mouse
|
||||||
|
If e.Button <> MouseButtons.Left Then Return
|
||||||
|
' se aggiungo SpotReg e numero di Spot inferiore a quelli inseriti in Office
|
||||||
|
If AddPointRegBtn.IsChecked Then
|
||||||
|
If m_nCountSpotCUT < m_nCountSpot Then
|
||||||
|
' Acquisisco punto da disegno
|
||||||
|
EgtUnProjectPoint(e.Location, m_ptPrev)
|
||||||
|
Dim ptRawMax As Point3d = m_b3Raw.Max()
|
||||||
|
m_ptPrev.z = ptRawMax.z
|
||||||
|
' Inserisco un nuovo punto registrazione
|
||||||
|
CreateSpotRegistration(m_nRegGroupId, m_ptPrev, m_nCountSpotCUT + 1)
|
||||||
|
EgtDraw()
|
||||||
|
' disattivo il comando di inserimento
|
||||||
|
AddPointRegBtn.IsChecked = False
|
||||||
|
Else
|
||||||
|
m_MainWindow.m_CurrentProjectPageUC.ClearMessage()
|
||||||
|
m_MainWindow.m_CurrentProjectPageUC.SetWarningMessage("Max spot for reg: " & m_nCountSpot.ToString)
|
||||||
|
End If
|
||||||
|
ElseIf RemovePointRegBtn.IsChecked Then
|
||||||
|
' Verifico se selezionato indicativo di pezzo
|
||||||
|
EgtSetObjFilterForSelWin(True, True, True, True, True)
|
||||||
|
Dim nSelect As Integer
|
||||||
|
EgtSelect(e.Location, Scene.DIM_SEL, Scene.DIM_SEL, nSelect)
|
||||||
|
Dim nSelId As Integer = EgtGetFirstObjInSelWin()
|
||||||
|
Dim sName As String = String.Empty
|
||||||
|
While nSelId <> GDB_ID.NULL
|
||||||
|
sName = String.Empty
|
||||||
|
EgtGetName(nSelId, sName)
|
||||||
|
If sName.StartsWith(SPOTREGCUT_) Then
|
||||||
|
' recupero recupero il centro della prima curva
|
||||||
|
Dim nIdParent As Integer = EgtGetParent(nSelId)
|
||||||
|
RemoveSpotRegistration(nIdParent)
|
||||||
|
EgtDraw()
|
||||||
|
EgtErase(nIdParent)
|
||||||
|
RemovePointRegBtn.IsChecked = False
|
||||||
|
' Esco dal ciclo
|
||||||
|
Exit While
|
||||||
|
End If
|
||||||
|
nSelId = EgtGetNextObjInSelWin()
|
||||||
|
End While
|
||||||
|
ElseIf ModPointRegBtn.IsChecked Then
|
||||||
|
' Verifico se selezionato indicativo di pezzo
|
||||||
|
EgtSetObjFilterForSelWin(True, True, True, True, True)
|
||||||
|
Dim nSelect As Integer
|
||||||
|
EgtSelect(e.Location, Scene.DIM_SEL, Scene.DIM_SEL, nSelect)
|
||||||
|
Dim nSelId As Integer = EgtGetFirstObjInSelWin()
|
||||||
|
Dim sName As String = String.Empty
|
||||||
|
While nSelId <> GDB_ID.NULL
|
||||||
|
sName = String.Empty
|
||||||
|
EgtGetName(nSelId, sName)
|
||||||
|
If sName.StartsWith(SPOTREGCUT_) Then
|
||||||
|
EgtDeselectAll()
|
||||||
|
EgtResetMark(m_nCurrSpotRegId)
|
||||||
|
' recupero l'Id del gruppo di appartenenza
|
||||||
|
Dim nIdParent As Integer = EgtGetParent(nSelId)
|
||||||
|
EgtSelectGroupObjs(nIdParent)
|
||||||
|
EgtSetMark(nIdParent)
|
||||||
|
EgtDraw()
|
||||||
|
' Acquisisco punto da disegno
|
||||||
|
EgtUnProjectPoint(e.Location, m_ptPrev)
|
||||||
|
m_bDrag = True
|
||||||
|
' Salvo l'Id del punto SpotReg da spostare
|
||||||
|
m_nCurrSpotRegId = nIdParent
|
||||||
|
' Esco dal ciclo
|
||||||
|
Exit While
|
||||||
|
End If
|
||||||
|
nSelId = EgtGetNextObjInSelWin()
|
||||||
|
End While
|
||||||
|
ElseIf ActivatePointRegBtn.IsChecked Then
|
||||||
|
' Verifico se selezionato indicativo di pezzo
|
||||||
|
EgtSetObjFilterForSelWin(True, True, True, True, True)
|
||||||
|
Dim nSelect As Integer
|
||||||
|
EgtSelect(e.Location, Scene.DIM_SEL, Scene.DIM_SEL, nSelect)
|
||||||
|
Dim nSelId As Integer = EgtGetFirstObjInSelWin()
|
||||||
|
Dim sName As String = String.Empty
|
||||||
|
While nSelId <> GDB_ID.NULL
|
||||||
|
sName = String.Empty
|
||||||
|
EgtGetName(nSelId, sName)
|
||||||
|
' accetto qualsiasi punto di tipo SpotReg (sia da OFFICE che da CUT)
|
||||||
|
If sName.StartsWith(SPOTREG_) Or sName.StartsWith(SPOTREGCUT_) Then
|
||||||
|
Dim nIdParent As Integer = EgtGetParent(nSelId)
|
||||||
|
ActivateSpotRegistration(nIdParent)
|
||||||
|
EgtDraw()
|
||||||
|
' Esco dal ciclo
|
||||||
|
Exit While
|
||||||
|
End If
|
||||||
|
nSelId = EgtGetNextObjInSelWin()
|
||||||
|
End While
|
||||||
|
End If
|
||||||
|
' Devo sempre uscire da questa condizione
|
||||||
|
Return
|
||||||
|
End If
|
||||||
|
|
||||||
' Si può selezionare solo con il tasto sinistro e se stato NULL
|
' Si può selezionare solo con il tasto sinistro e se stato NULL
|
||||||
If e.Button <> Windows.Forms.MouseButtons.Left Or
|
If e.Button <> Windows.Forms.MouseButtons.Left Or
|
||||||
Not m_CurrProjPage.CurrentProjectScene.IsStatusNull() Then
|
Not m_CurrProjPage.CurrentProjectScene.IsStatusNull() Then
|
||||||
Return
|
Return
|
||||||
End If
|
End If
|
||||||
|
|
||||||
@@ -902,7 +1031,6 @@ Public Class NestPageUC
|
|||||||
OnMyMouseDownSceneSelCurv(sender, e)
|
OnMyMouseDownSceneSelCurv(sender, e)
|
||||||
Return
|
Return
|
||||||
End If
|
End If
|
||||||
|
|
||||||
m_bIsCounterLy = False
|
m_bIsCounterLy = False
|
||||||
' se in modalità DragRettangle (deformazione delle componenti rettangolari)
|
' se in modalità DragRettangle (deformazione delle componenti rettangolari)
|
||||||
If m_bIsCheckedDragRettangle Then
|
If m_bIsCheckedDragRettangle Then
|
||||||
@@ -963,7 +1091,6 @@ Public Class NestPageUC
|
|||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
|
|
||||||
If Not m_bIsCounterLy Then
|
If Not m_bIsCounterLy Then
|
||||||
' Se già selezionato o posizione oggetto incompatibile con flag posizione selezionati
|
' Se già selezionato o posizione oggetto incompatibile con flag posizione selezionati
|
||||||
If nStat = GDB_ST.SEL Then
|
If nStat = GDB_ST.SEL Then
|
||||||
@@ -1022,6 +1149,10 @@ Public Class NestPageUC
|
|||||||
EgtSetCurrPhase(nI)
|
EgtSetCurrPhase(nI)
|
||||||
EgtSetTableAreaOffset(TAB_OFFS, TAB_OFFS, TAB_OFFS, TAB_OFFS)
|
EgtSetTableAreaOffset(TAB_OFFS, TAB_OFFS, TAB_OFFS, TAB_OFFS)
|
||||||
Next
|
Next
|
||||||
|
' aggiorno posizionamento ventose per lavorazioni da sotto
|
||||||
|
UpdateVacuumsForDrip()
|
||||||
|
' dichiaro tutto aggiornato
|
||||||
|
m_CurrProjPage.SetOrderMachiningFlag()
|
||||||
EgtSetCurrPhase(1)
|
EgtSetCurrPhase(1)
|
||||||
' Rotazione
|
' Rotazione
|
||||||
Dim dAngRot As Double = If(sOtherTab = SECOND_TAB, 180, -180)
|
Dim dAngRot As Double = If(sOtherTab = SECOND_TAB, 180, -180)
|
||||||
@@ -1067,7 +1198,6 @@ Public Class NestPageUC
|
|||||||
m_bKeyLeftShiftPressed = m_bVerify
|
m_bKeyLeftShiftPressed = m_bVerify
|
||||||
m_vtTotMove = Vector3d.NULL()
|
m_vtTotMove = Vector3d.NULL()
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Sub OnMyMouseMoveScene(sender As Object, e As System.Windows.Forms.MouseEventArgs) Handles m_CurrProjPage.OnMouseMoveScene
|
Private Sub OnMyMouseMoveScene(sender As Object, e As System.Windows.Forms.MouseEventArgs) Handles m_CurrProjPage.OnMouseMoveScene
|
||||||
' Verifico di essere il gestore attivo
|
' Verifico di essere il gestore attivo
|
||||||
If Not m_bActive Then Return
|
If Not m_bActive Then Return
|
||||||
@@ -1076,7 +1206,7 @@ Public Class NestPageUC
|
|||||||
' Se primo movimento di drag, verifico di aver superato la soglia di movimento in pixel
|
' Se primo movimento di drag, verifico di aver superato la soglia di movimento in pixel
|
||||||
If m_bDragToStart Then
|
If m_bDragToStart Then
|
||||||
If Math.Abs(e.Location.X - m_locPrev.X) < m_nRestRadius And
|
If Math.Abs(e.Location.X - m_locPrev.X) < m_nRestRadius And
|
||||||
Math.Abs(e.Location.Y - m_locPrev.Y) < m_nRestRadius Then
|
Math.Abs(e.Location.Y - m_locPrev.Y) < m_nRestRadius Then
|
||||||
Return
|
Return
|
||||||
End If
|
End If
|
||||||
m_bDragToStart = False
|
m_bDragToStart = False
|
||||||
@@ -1087,6 +1217,19 @@ Public Class NestPageUC
|
|||||||
OnMyMouseMoveSawRettangle(sender, e)
|
OnMyMouseMoveSawRettangle(sender, e)
|
||||||
Return
|
Return
|
||||||
End If
|
End If
|
||||||
|
If ModPointRegBtn.IsChecked Then
|
||||||
|
' Ricavo il punto corrente in coordinate mondo
|
||||||
|
Dim ptCurr_ As Point3d
|
||||||
|
EgtUnProjectPoint(e.Location, ptCurr_)
|
||||||
|
' Ricavo il vettore di movimento
|
||||||
|
Dim vtMove As Vector3d = ptCurr_ - m_ptPrev
|
||||||
|
MoveSpotRegistration(m_nCurrSpotRegId, vtMove)
|
||||||
|
' Aggiorno il punto precedente
|
||||||
|
m_ptPrev = ptCurr_
|
||||||
|
' Terminata esecuzione di drag
|
||||||
|
m_bDragging = False
|
||||||
|
Return
|
||||||
|
End If
|
||||||
|
|
||||||
' Determino cosa muovere
|
' Determino cosa muovere
|
||||||
Dim nMoveId = If(m_nIdToSel <> GDB_ID.NULL, m_nIdToSel, GDB_ID.SEL)
|
Dim nMoveId = If(m_nIdToSel <> GDB_ID.NULL, m_nIdToSel, GDB_ID.SEL)
|
||||||
@@ -1650,6 +1793,10 @@ Public Class NestPageUC
|
|||||||
nRevPhase += 1
|
nRevPhase += 1
|
||||||
End While
|
End While
|
||||||
End If
|
End If
|
||||||
|
' Muovo i punti SpotReg generati nel programma OFFICE
|
||||||
|
If bMoveOk Then
|
||||||
|
MoveAllSpotRegistration(vtMove)
|
||||||
|
End If
|
||||||
' Ripristino lo stato iniziale
|
' Ripristino lo stato iniziale
|
||||||
EgtSetCurrPhase(1)
|
EgtSetCurrPhase(1)
|
||||||
HideAllMachinings()
|
HideAllMachinings()
|
||||||
@@ -1909,12 +2056,160 @@ Public Class NestPageUC
|
|||||||
' Dichiaro grezzo per punti
|
' Dichiaro grezzo per punti
|
||||||
EgtSetInfo(GetCurrentRaw(), KEY_RAWBYPOINTS, 1)
|
EgtSetInfo(GetCurrentRaw(), KEY_RAWBYPOINTS, 1)
|
||||||
End If
|
End If
|
||||||
|
' Ruoto i punti SpotReg disegnati in Office
|
||||||
|
If bMoveOk Then
|
||||||
|
RotateAllSpotRegistration(dAngDeg, ptCen)
|
||||||
|
End If
|
||||||
' Ripristino lo stato iniziale
|
' Ripristino lo stato iniziale
|
||||||
EgtSetCurrPhase(1)
|
EgtSetCurrPhase(1)
|
||||||
HideAllMachinings()
|
HideAllMachinings()
|
||||||
Return bMoveOk
|
Return bMoveOk
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
|
Friend Function RotateAllRawParts(dAngDeg As Double, ptCen As Point3d, Optional bIsReg As Boolean = True) As Boolean
|
||||||
|
' Recupero rotazione totale
|
||||||
|
Dim dRegRot As Double = GetRegistrationRotation()
|
||||||
|
' Recupero il centro del grezzo iniziale per usarlo come centro della rotazione
|
||||||
|
'Dim ptCen As New Point3d
|
||||||
|
'GetRawCenter(ptCen)
|
||||||
|
' Provo la rotazione
|
||||||
|
Dim bMoveOk As Boolean = True
|
||||||
|
Dim nPhase As Integer = 1
|
||||||
|
Dim nRawId As Integer = GDB_ID.NULL
|
||||||
|
While nPhase <= EgtGetPhaseCount()
|
||||||
|
EgtSetCurrPhase(nPhase)
|
||||||
|
nRawId = EgtGetFirstRawPart()
|
||||||
|
While nRawId <> GDB_ID.NULL
|
||||||
|
If EgtVerifyRawPartPhase(nRawId, nPhase) Then
|
||||||
|
' Rotazione del centro come spostamento grezzo più rotazione grezzo attorno al suo centro
|
||||||
|
Dim ptRawCen As New Point3d
|
||||||
|
EgtGetRawPartCenter(nRawId, ptRawCen)
|
||||||
|
Dim ptMovCen As New Point3d(ptRawCen)
|
||||||
|
ptMovCen.Rotate(ptCen, Vector3d.Z_AX(), dAngDeg)
|
||||||
|
If Not EgtMoveRawPart(nRawId, ptMovCen - ptRawCen) Then
|
||||||
|
bMoveOk = False
|
||||||
|
Exit While
|
||||||
|
End If
|
||||||
|
If Not EgtRotateRawPart(nRawId, Vector3d.Z_AX(), dAngDeg) Then
|
||||||
|
EgtMoveRawPart(nRawId, -(ptMovCen - ptRawCen))
|
||||||
|
bMoveOk = False
|
||||||
|
Exit While
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
nRawId = EgtGetNextRawPart(nRawId)
|
||||||
|
End While
|
||||||
|
If Not bMoveOk Then Exit While
|
||||||
|
nPhase += 1
|
||||||
|
End While
|
||||||
|
' Se rotazione impossibile, ripristino posizione dei grezzi già spostati
|
||||||
|
If Not bMoveOk Then
|
||||||
|
Dim nRevPhase As Integer = 1
|
||||||
|
Dim nRevRawId As Integer = GDB_ID.NULL
|
||||||
|
While nRevPhase <= nPhase
|
||||||
|
EgtSetCurrPhase(nRevPhase)
|
||||||
|
nRevRawId = EgtGetFirstRawPart()
|
||||||
|
While nRevRawId <> GDB_ID.NULL And (nRevPhase < nPhase Or nRevRawId <> nRawId)
|
||||||
|
If EgtVerifyRawPartPhase(nRevRawId, nRevPhase) Then
|
||||||
|
' Eseguo al contrario
|
||||||
|
EgtRotateRawPart(nRevRawId, Vector3d.Z_AX(), -dAngDeg)
|
||||||
|
Dim ptRawCen As New Point3d
|
||||||
|
EgtGetRawPartCenter(nRevRawId, ptRawCen)
|
||||||
|
Dim ptMovCen As New Point3d(ptRawCen)
|
||||||
|
ptMovCen.Rotate(ptCen, Vector3d.Z_AX(), -dAngDeg)
|
||||||
|
EgtMoveRawPart(nRevRawId, (ptMovCen - ptRawCen))
|
||||||
|
End If
|
||||||
|
nRevRawId = EgtGetNextRawPart(nRevRawId)
|
||||||
|
End While
|
||||||
|
nRevPhase += 1
|
||||||
|
End While
|
||||||
|
' Altrimenti eseguo sistemazioni
|
||||||
|
Else
|
||||||
|
' Origine della tavola
|
||||||
|
Dim ptOri As Point3d
|
||||||
|
EgtGetTableRef(1, ptOri)
|
||||||
|
' Annullo rotazioni dei grezzi e le rifaccio sulle parti componenti
|
||||||
|
Dim nRevPhase As Integer = 1
|
||||||
|
Dim nRevRawId As Integer = GDB_ID.NULL
|
||||||
|
While nRevPhase <= EgtGetPhaseCount()
|
||||||
|
EgtSetCurrPhase(nRevPhase)
|
||||||
|
nRevRawId = EgtGetFirstRawPart()
|
||||||
|
While nRevRawId <> GDB_ID.NULL
|
||||||
|
If EgtVerifyRawPartPhase(nRevRawId, nRevPhase) Then
|
||||||
|
' Eseguo al contrario
|
||||||
|
EgtRotateRawPart(nRevRawId, Vector3d.Z_AX(), -dAngDeg)
|
||||||
|
Dim ptRawCen As New Point3d
|
||||||
|
EgtGetRawPartCenter(nRevRawId, ptRawCen)
|
||||||
|
Dim ptMovCen As New Point3d(ptRawCen)
|
||||||
|
ptMovCen.Rotate(ptCen, Vector3d.Z_AX(), -dAngDeg)
|
||||||
|
EgtMoveRawPart(nRevRawId, (ptMovCen - ptRawCen))
|
||||||
|
' Rifaccio sugli oggetti contenuti nel grezzo
|
||||||
|
Dim nId As Integer = EgtGetFirstInGroup(nRevRawId)
|
||||||
|
While nId <> GDB_ID.NULL
|
||||||
|
EgtRotate(nId, ptCen, Vector3d.Z_AX(), dAngDeg, GDB_RT.GLOB)
|
||||||
|
nId = EgtGetNext(nId)
|
||||||
|
End While
|
||||||
|
' Imposto posizione esatta del grezzo dopo rotazione
|
||||||
|
Dim b3Raw As New BBox3d
|
||||||
|
EgtGetRawPartBBox(nRevRawId, b3Raw)
|
||||||
|
EgtMoveToCornerRawPart(nRevRawId, (b3Raw.Min() - ptOri) + Point3d.ORIG(), MCH_CR.BL)
|
||||||
|
End If
|
||||||
|
nRevRawId = EgtGetNextRawPart(nRevRawId)
|
||||||
|
End While
|
||||||
|
nRevPhase += 1
|
||||||
|
End While
|
||||||
|
' Ruoto opportunamente anche i dati di movimento
|
||||||
|
Dim nOpeId As Integer = EgtGetFirstActiveOperation()
|
||||||
|
While nOpeId <> GDB_ID.NULL
|
||||||
|
If EgtGetOperationType(nOpeId) = MCH_OY.DISP Then
|
||||||
|
' Recupero i gruppi con i dati
|
||||||
|
Dim nRpmId As Integer = EgtGetFirstNameInGroup(nOpeId, "Rpm*")
|
||||||
|
While nRpmId <> GDB_ID.NULL
|
||||||
|
' Recupero le informazioni
|
||||||
|
Dim vtRawMove As New Vector3d
|
||||||
|
If EgtGetInfo(nRpmId, "Mv", vtRawMove) Then
|
||||||
|
vtRawMove.Rotate(Vector3d.Z_AX(), dAngDeg)
|
||||||
|
EgtSetInfo(nRpmId, "Mv", vtRawMove)
|
||||||
|
End If
|
||||||
|
Dim vtDelta As New Vector3d
|
||||||
|
If EgtGetInfo(nRpmId, "Dt", vtDelta) Then
|
||||||
|
vtDelta.Rotate(Vector3d.Z_AX(), dAngDeg)
|
||||||
|
EgtSetInfo(nRpmId, "Dt", vtDelta)
|
||||||
|
End If
|
||||||
|
Dim dAngRotDeg As Double = 0
|
||||||
|
If EgtGetInfo(nRpmId, "Ad", dAngRotDeg) Then
|
||||||
|
EgtSetInfo(nRpmId, "Ad", dAngRotDeg + dAngDeg)
|
||||||
|
End If
|
||||||
|
' Cerco un altro gruppo
|
||||||
|
nRpmId = EgtGetNextName(nRpmId, "Rpm*")
|
||||||
|
End While
|
||||||
|
End If
|
||||||
|
nOpeId = EgtGetNextActiveOperation(nOpeId)
|
||||||
|
End While
|
||||||
|
' Se non è registrazione, ruoto anche l'eventuale foto della lastra
|
||||||
|
'If Not bIsReg Then
|
||||||
|
' Dim nPhotoId = m_CurrProjPage.GetPhoto()
|
||||||
|
' If nPhotoId <> GDB_ID.NULL then EgtRotatePhoto(nPhotoId, ptCen, Vector3d.Z_AX(), dAngDeg)
|
||||||
|
'End If
|
||||||
|
' Aggiorno rotazione totale
|
||||||
|
If bIsReg Then
|
||||||
|
SetRegistrationRotation(dRegRot + dAngDeg)
|
||||||
|
Else
|
||||||
|
SetRegistrationRotation(0)
|
||||||
|
End If
|
||||||
|
' Dichiaro grezzo per punti
|
||||||
|
EgtSetInfo(GetCurrentRaw(), KEY_RAWBYPOINTS, 1)
|
||||||
|
End If
|
||||||
|
' Ruoto i punti SpotReg disegnati in Office
|
||||||
|
If bMoveOk Then
|
||||||
|
RotateAllSpotRegistration(dAngDeg, ptCen)
|
||||||
|
End If
|
||||||
|
' Ripristino lo stato iniziale
|
||||||
|
EgtSetCurrPhase(1)
|
||||||
|
HideAllMachinings()
|
||||||
|
Return bMoveOk
|
||||||
|
End Function
|
||||||
|
|
||||||
|
|
||||||
Private Sub InsertPartBtn_Click(sender As Object, e As RoutedEventArgs) Handles InsertPartBtn.Click
|
Private Sub InsertPartBtn_Click(sender As Object, e As RoutedEventArgs) Handles InsertPartBtn.Click
|
||||||
' Se inserimento automatico
|
' Se inserimento automatico
|
||||||
If GetPrivateProfileInt(S_NEST, K_AUTOMATICOPTIMIZE, 0, m_MainWindow.GetIniFile()) <> 0 And
|
If GetPrivateProfileInt(S_NEST, K_AUTOMATICOPTIMIZE, 0, m_MainWindow.GetIniFile()) <> 0 And
|
||||||
@@ -2482,8 +2777,11 @@ Public Class NestPageUC
|
|||||||
Const STORE_LARGH As Double = 6000
|
Const STORE_LARGH As Double = 6000
|
||||||
Const STORE_DIST As Double = 200
|
Const STORE_DIST As Double = 200
|
||||||
Const STORE_OFFS As Double = 20 + 40 + 20
|
Const STORE_OFFS As Double = 20 + 40 + 20
|
||||||
Dim dStXmin As Double = b3Tab.Min().x - 0.5 * (STORE_LARGH - b3Tab.DimX())
|
Dim dStoreLarg As Double = GetPrivateProfileDouble("Store", "StoreLargh", STORE_LARGH, m_MainWindow.GetMachIniFile())
|
||||||
Return EgtPackBox(nId, dStXmin, -INFINITO, dStXmin + STORE_LARGH, b3Tab.Min().y - STORE_DIST, STORE_OFFS, False)
|
Dim dStoreDist As Double = GetPrivateProfileDouble("Store", "StoreDist", STORE_DIST, m_MainWindow.GetMachIniFile())
|
||||||
|
Dim dStoreOffs As Double = GetPrivateProfileDouble("Store", "StoreOffs", STORE_OFFS, m_MainWindow.GetMachIniFile())
|
||||||
|
Dim dStXmin As Double = b3Tab.Min().x - 0.5 * (dStoreLarg - b3Tab.DimX())
|
||||||
|
Return EgtPackBox(nId, dStXmin, -INFINITO, dStXmin + dStoreLarg, b3Tab.Min().y - dStoreDist, dStoreOffs, False)
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
Private Sub RemovePartBtn_Click(sender As Object, e As RoutedEventArgs) Handles RemovePartBtn.Click
|
Private Sub RemovePartBtn_Click(sender As Object, e As RoutedEventArgs) Handles RemovePartBtn.Click
|
||||||
@@ -2852,6 +3150,422 @@ Public Class NestPageUC
|
|||||||
Return True
|
Return True
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
|
#Region "SPOT REG"
|
||||||
|
|
||||||
|
' Layer per crocette dei punti REG (creato in Office)
|
||||||
|
Public m_nRegGroupId As Integer = GDB_ID.NULL
|
||||||
|
' Numero di spot inseriti nel grezzo corrente (da Office)
|
||||||
|
Private m_nCountSpot As Integer = 0
|
||||||
|
' Gruppo Spot attualmente selezionato
|
||||||
|
Private m_nCurrSpotRegId As Integer = GDB_ID.NULL
|
||||||
|
' Nome info nuomero Spot (da Office)
|
||||||
|
Private Const COUNTSPOT As String = "CountSpot"
|
||||||
|
' Nome gruppo
|
||||||
|
Private Const REG As String = "Reg"
|
||||||
|
' Nome del gruppo di ogno Spot (da Office)
|
||||||
|
Private Const SPOTREG_ As String = "SpotReg_"
|
||||||
|
Private Const RADSPOT As Double = 20
|
||||||
|
|
||||||
|
' numero di Spot inseriti (da Cut)
|
||||||
|
Private m_nCountSpotCUT As Integer = 0
|
||||||
|
' Nome del gruppo di ogno Spot (da Cut)
|
||||||
|
Private Const SPOTREGCUT_ As String = "SpotRegCUT_"
|
||||||
|
' Nome info nuomero Spot (da Office)
|
||||||
|
Private Const COUNTSPOTCUT As String = "CountSpotCUT"
|
||||||
|
' Nome della Info per indicare se il punto è da usare
|
||||||
|
Private Const ACTIVATESPOTCUT As String = "ActivateSpotCut"
|
||||||
|
|
||||||
|
Private Sub AddPointReg_Click() Handles AddPointRegBtn.Click
|
||||||
|
DeselectCurSpotReg()
|
||||||
|
ModPointRegBtn.IsChecked = False
|
||||||
|
RemovePointRegBtn.IsChecked = False
|
||||||
|
ActivatePointRegBtn.IsChecked = False
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Private Sub ModPointReg_Click() Handles ModPointRegBtn.Click
|
||||||
|
' Deseleziono lo Spotreg selezionato
|
||||||
|
DeselectCurSpotReg()
|
||||||
|
AddPointRegBtn.IsChecked = False
|
||||||
|
RemovePointRegBtn.IsChecked = False
|
||||||
|
ActivatePointRegBtn.IsChecked = False
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Private Sub RemovePointReg_Click() Handles RemovePointRegBtn.Click
|
||||||
|
DeselectCurSpotReg()
|
||||||
|
ModPointRegBtn.IsChecked = False
|
||||||
|
AddPointRegBtn.IsChecked = False
|
||||||
|
ActivatePointRegBtn.IsChecked = False
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Private Sub AdjustPointReg_Click() Handles AdjustPointRegBtn.Click
|
||||||
|
PointRegCheckedOff()
|
||||||
|
AdjustRawWithSpotReg()
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Private Sub ActivatePointRegBtn_Click() Handles ActivatePointRegBtn.Click
|
||||||
|
DeselectCurSpotReg()
|
||||||
|
AddPointRegBtn.IsChecked = False
|
||||||
|
ModPointRegBtn.IsChecked = False
|
||||||
|
RemovePointRegBtn.IsChecked = False
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Private Sub DeselectCurSpotReg()
|
||||||
|
EgtDeselectAll()
|
||||||
|
If m_nCurrSpotRegId <> GDB_ID.NULL Then
|
||||||
|
EgtResetMark(m_nCurrSpotRegId)
|
||||||
|
m_nCurrSpotRegId = GDB_ID.NULL
|
||||||
|
EgtDraw()
|
||||||
|
End If
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
' disabilito contemporaneamente tutti i comandi per la gestione punti SpotReg
|
||||||
|
Public Sub PointRegCheckedOff()
|
||||||
|
DeselectCurSpotReg()
|
||||||
|
AddPointRegBtn.IsChecked = False
|
||||||
|
ModPointRegBtn.IsChecked = False
|
||||||
|
RemovePointRegBtn.IsChecked = False
|
||||||
|
ActivatePointRegBtn.IsChecked = False
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
' riceve l'ID del gruppo da muovere
|
||||||
|
Private Function MoveSpotRegistration(nIdGroup As Integer, vtMove As Vector3d) As Boolean
|
||||||
|
If nIdGroup = GDB_ID.NULL Then Return False
|
||||||
|
' Non ci deve essere movimento in Z
|
||||||
|
vtMove.z = 0
|
||||||
|
' Recupero il cercio di riferimento
|
||||||
|
Dim nArcId As Integer = EgtGetFirstInGroup(nIdGroup)
|
||||||
|
Dim b3Crv As New BBox3d
|
||||||
|
EgtGetBBoxGlob(nArcId, GDB_BB.STANDARD, b3Crv)
|
||||||
|
Dim ptMin, ptMax As Point3d
|
||||||
|
If EgtGetTableArea(1, ptMin, ptMax) Then
|
||||||
|
Dim m_ptTableMin As Point3d = ptMin
|
||||||
|
Dim m_dTableLength As Double = ptMax.x - ptMin.x
|
||||||
|
Dim m_dTableWidth As Double = ptMax.y - ptMin.y
|
||||||
|
b3Crv.Move(vtMove)
|
||||||
|
If b3Crv.Min().x < m_ptTableMin.x + 10 * EPS_SMALL Then
|
||||||
|
vtMove.x += m_ptTableMin.x + 10 * EPS_SMALL - b3Crv.Min().x
|
||||||
|
ElseIf b3Crv.Max().x > m_ptTableMin.x + m_dTableLength + 10 * EPS_SMALL Then
|
||||||
|
vtMove.x += m_ptTableMin.x + m_dTableLength - 10 * EPS_SMALL - b3Crv.Max().x
|
||||||
|
End If
|
||||||
|
If b3Crv.Min().y < m_ptTableMin.y + 10 * EPS_SMALL Then
|
||||||
|
vtMove.y += m_ptTableMin.y + 10 * EPS_SMALL - b3Crv.Min().y
|
||||||
|
ElseIf b3Crv.Max().y > m_ptTableMin.y + m_dTableWidth + 10 * EPS_SMALL Then
|
||||||
|
vtMove.y += m_ptTableMin.y + m_dTableWidth - 10 * EPS_SMALL - b3Crv.Max().y
|
||||||
|
End If
|
||||||
|
' muovo il gruppo
|
||||||
|
EgtMove(nIdGroup, vtMove)
|
||||||
|
EgtDraw()
|
||||||
|
Return True
|
||||||
|
End If
|
||||||
|
Return False
|
||||||
|
End Function
|
||||||
|
|
||||||
|
' Muovo solo gli elementi SpotReg creati nel programma OFFICE
|
||||||
|
Private Sub MoveAllSpotRegistration(vtMove As Vector3d, Optional bOnlyOfficeSpot As Boolean = True)
|
||||||
|
Dim nId As Integer = EgtGetFirstInGroup(m_nRegGroupId)
|
||||||
|
While nId <> GDB_ID.NULL
|
||||||
|
Dim sName As String = String.Empty
|
||||||
|
EgtGetName(nId, sName)
|
||||||
|
If Not sName.Contains("CUT") Or Not bOnlyOfficeSpot Then
|
||||||
|
EgtMove(nId, vtMove)
|
||||||
|
End If
|
||||||
|
nId = EgtGetNext(nId)
|
||||||
|
End While
|
||||||
|
EgtDraw()
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
' Riposiziono i punti SpotReg (tutti) in funzione dell'altezza del grezzo
|
||||||
|
Public Sub UpdateSpotRegistration()
|
||||||
|
Dim ptCentArc As Point3d
|
||||||
|
Dim nId As Integer = EgtGetFirstInGroup(m_nRegGroupId)
|
||||||
|
Dim sNameEnt As String = String.Empty
|
||||||
|
Dim sName As String = String.Empty
|
||||||
|
EgtGetName(nId, sName)
|
||||||
|
If sName.Contains("CUT") Then
|
||||||
|
sNameEnt = SPOTREGCUT_ & "Arc"
|
||||||
|
Else
|
||||||
|
sNameEnt = SPOTREG_ & "Arc"
|
||||||
|
End If
|
||||||
|
Dim nIdArc As Integer = EgtGetFirstNameInGroup(nId, sNameEnt)
|
||||||
|
If Not EgtCenterPoint(nIdArc, GDB_ID.ROOT, ptCentArc) Then
|
||||||
|
Return
|
||||||
|
End If
|
||||||
|
Dim dOffsetZ As Double = m_b3Raw.Max().z - ptCentArc.z
|
||||||
|
If Math.Abs(dOffsetZ) > 0.1 Then
|
||||||
|
MoveAllSpotRegistration(New Vector3d(0, 0, dOffsetZ + 0.1), False)
|
||||||
|
Else
|
||||||
|
' se già in posizione allora mi occupo solo di visualizzarli
|
||||||
|
EgtDraw()
|
||||||
|
End If
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
' Ruoto solo gli elementi SpotReg creati nel programma OFFICE
|
||||||
|
Private Sub RotateAllSpotRegistration(dAngRot As Double, ptCen As Point3d)
|
||||||
|
Dim nId As Integer = EgtGetFirstInGroup(m_nRegGroupId)
|
||||||
|
While nId <> GDB_ID.NULL
|
||||||
|
Dim sName As String = String.Empty
|
||||||
|
EgtGetName(nId, sName)
|
||||||
|
If Not sName.Contains("CUT") Then
|
||||||
|
EgtRotate(nId, ptCen, Vector3d.Z_AX, dAngRot)
|
||||||
|
End If
|
||||||
|
nId = EgtGetNext(nId)
|
||||||
|
End While
|
||||||
|
EgtDraw()
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
' Per ogni SpotReg di OFFICE viene generato (nella stessa posizione) uno SpotRegCUT
|
||||||
|
Private Function InsertSportRegistration() As Boolean
|
||||||
|
' recupero l'elenco non ordinato degli Id dei punti SpotReg (da Office)
|
||||||
|
Dim SpotRegList As New List(Of Integer)
|
||||||
|
Dim nId As Integer = GDB_ID.NULL
|
||||||
|
' Creo la lista ordinata dei punti SpotReg (da OFFICE)
|
||||||
|
For nIndexSpot As Integer = 1 To m_nCountSpot
|
||||||
|
nId = EgtGetFirstNameInGroup(m_nRegGroupId, SPOTREG_ & nIndexSpot.ToString)
|
||||||
|
SpotRegList.Add(nId)
|
||||||
|
Next
|
||||||
|
' Creo i punti SpotRegCUT sovrapposti a quelli inseriti in OFFICE
|
||||||
|
Dim bOk As Boolean = True
|
||||||
|
For nIndex As Integer = 0 To SpotRegList.Count - 1
|
||||||
|
Dim ptCent As Point3d
|
||||||
|
GetCenterSpotReg(SpotRegList, SPOTREG_ & "Arc", nIndex + 1, ptCent)
|
||||||
|
bOk = bOk And CreateSpotRegistration(m_nRegGroupId, ptCent, nIndex + 1)
|
||||||
|
Next
|
||||||
|
Return bOk
|
||||||
|
End Function
|
||||||
|
|
||||||
|
' Creo il punto nel gruppo "Reg/SpotRegCUT_"
|
||||||
|
Private Function CreateSpotRegistration(nLayerIdReg As Integer, ptP As Point3d, nIndexSpot As Integer) As Boolean
|
||||||
|
' creo uno specifico layer per ogni spot (definito da una croce inscritta in un cerchio)
|
||||||
|
Dim nIdSpotLay As Integer = EgtCreateGroup(nLayerIdReg)
|
||||||
|
' Aggiungo cerchio
|
||||||
|
Dim nCircId As Integer = EgtCreateCircle(nIdSpotLay, ptP, RADSPOT)
|
||||||
|
' Inserisco una croce all'interno del
|
||||||
|
Dim nLineVId As Integer = EgtCreateLinePVL(nIdSpotLay, ptP, Vector3d.Y_AX, RADSPOT)
|
||||||
|
EgtExtendCurveStartByLen(nLineVId, RADSPOT)
|
||||||
|
Dim nLineHId As Integer = EgtCreateLinePVL(nIdSpotLay, ptP, Vector3d.X_AX, RADSPOT)
|
||||||
|
EgtExtendCurveStartByLen(nLineHId, RADSPOT)
|
||||||
|
Dim nTextId As Integer = EgtCreateText(nIdSpotLay, ptP + New Vector3d(1, 1, 0), nIndexSpot.ToString, 10)
|
||||||
|
' coloro gli oggetti appena creati ed assegno il nome
|
||||||
|
Dim bOk As Boolean = EgtSetColor(nCircId, New Color3d(0, 255, 0))
|
||||||
|
bOk = bOk And EgtSetName(nCircId, SPOTREGCUT_ & "Arc")
|
||||||
|
bOk = bOk And EgtSetColor(nLineVId, New Color3d(0, 255, 0))
|
||||||
|
bOk = bOk And EgtSetName(nLineVId, SPOTREGCUT_ & "LineV")
|
||||||
|
bOk = bOk And EgtSetColor(nLineHId, New Color3d(0, 255, 0))
|
||||||
|
bOk = bOk And EgtSetName(nLineHId, SPOTREGCUT_ & "LineH")
|
||||||
|
bOk = bOk And EgtSetColor(nTextId, New Color3d(255, 0, 0))
|
||||||
|
bOk = bOk And EgtSetName(nTextId, SPOTREGCUT_ & "Text")
|
||||||
|
' assegno il nome del gruppo corrente
|
||||||
|
bOk = bOk And EgtSetName(nIdSpotLay, SPOTREGCUT_ & nIndexSpot.ToString)
|
||||||
|
If bOk Then
|
||||||
|
' Aggiorno il contatore degli Spot
|
||||||
|
EgtSetInfo(nLayerIdReg, COUNTSPOTCUT, nIndexSpot)
|
||||||
|
m_nCountSpotCUT = nIndexSpot
|
||||||
|
End If
|
||||||
|
Return bOk
|
||||||
|
End Function
|
||||||
|
|
||||||
|
' Elimino il punto nel gruppo "Reg/SpotRegCUT_"
|
||||||
|
Private Function RemoveSpotRegistration(nSpotRegId As Integer) As Boolean
|
||||||
|
Dim nIndSpotReg As Integer = GetIndexGroupSpotReg(nSpotRegId)
|
||||||
|
If Not EgtErase(nSpotRegId) Then Return False
|
||||||
|
' faccio scorrere tutti i gruppi ed eventualmente li rinomino
|
||||||
|
Dim n_IdSR As Integer = EgtGetFirstInGroup(m_nRegGroupId)
|
||||||
|
m_nCountSpotCUT -= 1
|
||||||
|
EgtSetInfo(m_nRegGroupId, COUNTSPOTCUT, m_nCountSpotCUT)
|
||||||
|
While n_IdSR <> GDB_ID.NULL
|
||||||
|
Dim sName As String = String.Empty
|
||||||
|
EgtGetName(n_IdSR, sName)
|
||||||
|
If sName.Contains("CUT") Then
|
||||||
|
Dim nCurrIndSpotReg As Integer = GetIndexGroupSpotReg(n_IdSR)
|
||||||
|
If nCurrIndSpotReg > nIndSpotReg Then
|
||||||
|
' Recupero il testo
|
||||||
|
Dim nIdtext As Integer = EgtGetFirstNameInGroup(n_IdSR, SPOTREGCUT_ & "Text")
|
||||||
|
nCurrIndSpotReg -= 1
|
||||||
|
EgtModifyText(nIdtext, nCurrIndSpotReg.ToString)
|
||||||
|
EgtSetName(n_IdSR, SPOTREGCUT_ & nCurrIndSpotReg.ToString)
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
n_IdSR = EgtGetNext(n_IdSR)
|
||||||
|
|
||||||
|
End While
|
||||||
|
EgtDraw()
|
||||||
|
Return True
|
||||||
|
End Function
|
||||||
|
|
||||||
|
' Cambio lo stato dello SpotReg (sia di OFFICE che di CUT)
|
||||||
|
Private Function ActivateSpotRegistration(nSpotRegId As Integer) As Boolean
|
||||||
|
Dim nIndexSpot As Integer = GetIndexGroupSpotReg(nSpotRegId)
|
||||||
|
Dim nParentId As Integer = EgtGetParent(nSpotRegId)
|
||||||
|
Dim nInfo As Integer = 0
|
||||||
|
Dim bOk As Boolean = True
|
||||||
|
If Not EgtGetInfo(nSpotRegId, ACTIVATESPOTCUT, nInfo) Then
|
||||||
|
nInfo = 1
|
||||||
|
End If
|
||||||
|
If nInfo = 1 Then
|
||||||
|
' inserisco una Info sullo SpotRegCUT che indica che è disattivo
|
||||||
|
nSpotRegId = EgtGetFirstNameInGroup(nParentId, SPOTREGCUT_ & nIndexSpot.ToString)
|
||||||
|
bOk = EgtSetInfo(nSpotRegId, ACTIVATESPOTCUT, 0)
|
||||||
|
Dim nEntId As Integer = EgtGetFirstNameInGroup(nSpotRegId, SPOTREGCUT_ & "Arc")
|
||||||
|
bOk = bOk And EgtSetColor(nEntId, New Color3d(255, 0, 0))
|
||||||
|
nEntId = EgtGetFirstNameInGroup(nSpotRegId, SPOTREGCUT_ & "LineV")
|
||||||
|
bOk = bOk And EgtSetColor(nEntId, New Color3d(255, 0, 0))
|
||||||
|
nEntId = EgtGetFirstNameInGroup(nSpotRegId, SPOTREGCUT_ & "LineH")
|
||||||
|
bOk = bOk And EgtSetColor(nEntId, New Color3d(255, 0, 0))
|
||||||
|
nEntId = EgtGetFirstNameInGroup(nSpotRegId, SPOTREGCUT_ & "Text")
|
||||||
|
bOk = bOk And EgtSetColor(nEntId, New Color3d(255, 255, 0))
|
||||||
|
' inserisco una Info sullo SpotReg (OFFICE) che indica che è disattivo
|
||||||
|
nSpotRegId = EgtGetFirstNameInGroup(nParentId, SPOTREG_ & nIndexSpot.ToString)
|
||||||
|
bOk = EgtSetInfo(nSpotRegId, ACTIVATESPOTCUT, 0)
|
||||||
|
nEntId = EgtGetFirstNameInGroup(nSpotRegId, SPOTREG_ & "Arc")
|
||||||
|
bOk = bOk And EgtSetColor(nEntId, New Color3d(0, 0, 255))
|
||||||
|
nEntId = EgtGetFirstNameInGroup(nSpotRegId, SPOTREG_ & "LineV")
|
||||||
|
bOk = bOk And EgtSetColor(nEntId, New Color3d(0, 0, 255))
|
||||||
|
nEntId = EgtGetFirstNameInGroup(nSpotRegId, SPOTREG_ & "LineH")
|
||||||
|
bOk = bOk And EgtSetColor(nEntId, New Color3d(0, 0, 255))
|
||||||
|
nEntId = EgtGetFirstNameInGroup(nSpotRegId, SPOTREG_ & "Text")
|
||||||
|
bOk = bOk And EgtSetColor(nEntId, New Color3d(0, 0, 0))
|
||||||
|
Else
|
||||||
|
' inserisco una Info sul pezzo che indica che è attivo
|
||||||
|
nSpotRegId = EgtGetFirstNameInGroup(nParentId, SPOTREGCUT_ & nIndexSpot.ToString)
|
||||||
|
bOk = EgtSetInfo(nSpotRegId, ACTIVATESPOTCUT, 1)
|
||||||
|
Dim nEntId As Integer = EgtGetFirstNameInGroup(nSpotRegId, SPOTREGCUT_ & "Arc")
|
||||||
|
bOk = bOk And EgtSetColor(nEntId, New Color3d(0, 255, 0))
|
||||||
|
nEntId = EgtGetFirstNameInGroup(nSpotRegId, SPOTREGCUT_ & "LineV")
|
||||||
|
bOk = bOk And EgtSetColor(nEntId, New Color3d(0, 255, 0))
|
||||||
|
nEntId = EgtGetFirstNameInGroup(nSpotRegId, SPOTREGCUT_ & "LineH")
|
||||||
|
bOk = bOk And EgtSetColor(nEntId, New Color3d(0, 255, 0))
|
||||||
|
nEntId = EgtGetFirstNameInGroup(nSpotRegId, SPOTREGCUT_ & "Text")
|
||||||
|
bOk = bOk And EgtSetColor(nEntId, New Color3d(255, 0, 0))
|
||||||
|
' inserisco una Info sullo SpotReg (OFFICE) che indica che è disattivo
|
||||||
|
nSpotRegId = EgtGetFirstNameInGroup(nParentId, SPOTREG_ & nIndexSpot.ToString)
|
||||||
|
bOk = EgtSetInfo(nSpotRegId, ACTIVATESPOTCUT, 0)
|
||||||
|
nEntId = EgtGetFirstNameInGroup(nSpotRegId, SPOTREG_ & "Arc")
|
||||||
|
bOk = bOk And EgtSetColor(nEntId, New Color3d(0, 0, 0))
|
||||||
|
nEntId = EgtGetFirstNameInGroup(nSpotRegId, SPOTREG_ & "LineV")
|
||||||
|
bOk = bOk And EgtSetColor(nEntId, New Color3d(0, 0, 0))
|
||||||
|
nEntId = EgtGetFirstNameInGroup(nSpotRegId, SPOTREG_ & "LineH")
|
||||||
|
bOk = bOk And EgtSetColor(nEntId, New Color3d(0, 0, 0))
|
||||||
|
nEntId = EgtGetFirstNameInGroup(nSpotRegId, SPOTREG_ & "Text")
|
||||||
|
bOk = bOk And EgtSetColor(nEntId, New Color3d(255, 0, 0))
|
||||||
|
End If
|
||||||
|
Return bOk
|
||||||
|
End Function
|
||||||
|
|
||||||
|
' Restituisce l'indice dello "SpotReg_" oppure "SpotRegCUT_"
|
||||||
|
Private Function GetIndexGroupSpotReg(nSpotRegId As Integer) As Integer
|
||||||
|
Dim sNameParent As String = String.Empty
|
||||||
|
EgtGetName(nSpotRegId, sNameParent)
|
||||||
|
' Ricavo l'indice dal nome
|
||||||
|
Dim sItems As String() = sNameParent.Split("_"c)
|
||||||
|
Dim nCurrIndex As Integer = 0
|
||||||
|
If sItems.Count = 2 Then
|
||||||
|
If Not Integer.TryParse(sItems(1), nCurrIndex) Then
|
||||||
|
nCurrIndex = -1
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
Return nCurrIndex
|
||||||
|
End Function
|
||||||
|
|
||||||
|
' Calcola gli spostamenti del grezzo per posizionare i punti di SpotReg
|
||||||
|
Private Function AdjustRawWithSpotReg() As Boolean
|
||||||
|
' Verifico che almeno un punto sia stato inserito
|
||||||
|
If m_nCountSpotCUT < 1 Then
|
||||||
|
m_MainWindow.m_CurrentProjectPageUC.ClearMessage()
|
||||||
|
m_MainWindow.m_CurrentProjectPageUC.SetWarningMessage("Insert one spot reg to start.")
|
||||||
|
End If
|
||||||
|
|
||||||
|
' recupero l'elenco non ordinato degli Id dei punti SpotReg (da Office)
|
||||||
|
Dim SpotRegList As New List(Of Integer)
|
||||||
|
Dim SpotRegCUTList As New List(Of Integer)
|
||||||
|
Dim nId As Integer = EgtGetFirstInGroup(m_nRegGroupId)
|
||||||
|
' Creo la lista ordinata dei punti
|
||||||
|
For nIndexSpot As Integer = 1 To m_nCountSpotCUT
|
||||||
|
nId = EgtGetFirstNameInGroup(m_nRegGroupId, SPOTREGCUT_ & nIndexSpot.ToString)
|
||||||
|
Dim nActivate As Integer = 0
|
||||||
|
If Not EgtGetInfo(nId, ACTIVATESPOTCUT, nActivate) Then
|
||||||
|
nActivate = 1
|
||||||
|
End If
|
||||||
|
If nId <> GDB_ID.NULL And nActivate = 1 Then
|
||||||
|
SpotRegCUTList.Add(nId)
|
||||||
|
nId = EgtGetFirstNameInGroup(m_nRegGroupId, SPOTREG_ & nIndexSpot.ToString)
|
||||||
|
SpotRegList.Add(nId)
|
||||||
|
End If
|
||||||
|
Next
|
||||||
|
|
||||||
|
' Carico la lista dei centri
|
||||||
|
Dim ptCentCUTList As New List(Of Point3d)
|
||||||
|
Dim ptCentLIst As New List(Of Point3d)
|
||||||
|
If Not GetAllCenterSpotReg(SpotRegCUTList, SpotRegList, ptCentCUTList, ptCentLIst) Then Return False
|
||||||
|
|
||||||
|
' Eseguo il primo posizionamento di massima
|
||||||
|
Dim vtMoveStart As Vector3d = ptCentCUTList(0) - ptCentLIst(0)
|
||||||
|
Dim dAngRotSum As Double = 0.0
|
||||||
|
Dim dScaleSum As Double = 0.0
|
||||||
|
For nIndex As Integer = 1 To ptCentCUTList.Count - 1
|
||||||
|
Dim vtDirCUT As Vector3d = ptCentCUTList(nIndex) - ptCentCUTList(0)
|
||||||
|
Dim vtDir As Vector3d = ptCentLIst(nIndex) - ptCentLIst(0)
|
||||||
|
Dim dLenCUT, dLen, dAngVCUT, dAngV, dAngHCUT, dAngH As Double
|
||||||
|
vtDirCUT.ToSpherical(dLenCUT, dAngVCUT, dAngHCUT)
|
||||||
|
vtDir.ToSpherical(dLen, dAngV, dAngH)
|
||||||
|
dScaleSum += Math.Abs(dLenCUT - dLen) / dLenCUT
|
||||||
|
dAngRotSum += dAngHCUT - dAngH
|
||||||
|
Next
|
||||||
|
vtMoveStart.z = 0
|
||||||
|
' Determino la deformazione media
|
||||||
|
dScaleSum = 1 - dScaleSum / (ptCentCUTList.Count - 1)
|
||||||
|
MoveAllRawParts(vtMoveStart)
|
||||||
|
' Ruoto del valor medio delle differenze angolari
|
||||||
|
RotateAllRawParts(dAngRotSum / (ptCentCUTList.Count - 1), ptCentCUTList(0))
|
||||||
|
|
||||||
|
' Correggo lo spostamento in funzione della deformazione misurata
|
||||||
|
Dim vtMoveSum As Vector3d = New Vector3d(0, 0, 0)
|
||||||
|
GetAllCenterSpotReg(SpotRegCUTList, SpotRegList, ptCentCUTList, ptCentLIst)
|
||||||
|
For nIndex As Integer = 1 To ptCentCUTList.Count - 1
|
||||||
|
vtMoveSum += ptCentCUTList(nIndex) - ptCentLIst(nIndex)
|
||||||
|
Next
|
||||||
|
vtMoveSum.z = 0
|
||||||
|
vtMoveSum = vtMoveSum / (ptCentCUTList.Count - 1)
|
||||||
|
MoveAllRawParts(vtMoveSum * dScaleSum / 2)
|
||||||
|
EgtDraw()
|
||||||
|
|
||||||
|
Return True
|
||||||
|
End Function
|
||||||
|
|
||||||
|
Private Function GetAllCenterSpotReg(SpotRegCUTList As List(Of Integer), SpotRegList As List(Of Integer),
|
||||||
|
ByRef ptCentCUTList As List(Of Point3d), ByRef ptCentLIst As List(Of Point3d)) As Boolean
|
||||||
|
ptCentCUTList.Clear()
|
||||||
|
ptCentLIst.Clear()
|
||||||
|
For nIndex As Integer = 0 To m_nCountSpotCUT
|
||||||
|
Dim ptCenCUT As Point3d
|
||||||
|
Dim ptCent As Point3d
|
||||||
|
If GetCenterSpotReg(SpotRegCUTList, SPOTREGCUT_ & "Arc", nIndex + 1, ptCenCUT) Then
|
||||||
|
ptCentCUTList.Add(ptCenCUT)
|
||||||
|
GetCenterSpotReg(SpotRegList, SPOTREG_ & "Arc", nIndex + 1, ptCent)
|
||||||
|
ptCentLIst.Add(ptCent)
|
||||||
|
End If
|
||||||
|
Next
|
||||||
|
If ptCentCUTList.Count > 0 AndAlso ptCentCUTList.Count = ptCentLIst.Count Then
|
||||||
|
Return True
|
||||||
|
Else
|
||||||
|
Return False
|
||||||
|
End If
|
||||||
|
End Function
|
||||||
|
|
||||||
|
' Data la lista di punti Spot e l'indice dello spot da ricercare restituisce il centro del punto indicato
|
||||||
|
Private Function GetCenterSpotReg(ListSR As List(Of Integer), sName As String, nIndex As Integer, ByRef ptCentArc As Point3d) As Boolean
|
||||||
|
For Each ItemSR As Integer In ListSR
|
||||||
|
If GetIndexGroupSpotReg(ItemSR) = nIndex Then
|
||||||
|
Dim nIdArc As Integer = EgtGetFirstNameInGroup(ItemSR, sName)
|
||||||
|
If EgtCenterPoint(nIdArc, GDB_ID.ROOT, ptCentArc) Then
|
||||||
|
Return True
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
Next
|
||||||
|
Return False
|
||||||
|
End Function
|
||||||
|
|
||||||
|
#End Region
|
||||||
|
|
||||||
End Class
|
End Class
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
+20
-8
@@ -1,4 +1,5 @@
|
|||||||
Imports System.Windows.Forms.Integration
|
Imports System.Net
|
||||||
|
Imports System.Windows.Forms.Integration
|
||||||
Imports EgtUILib
|
Imports EgtUILib
|
||||||
|
|
||||||
Public Module SplitAuto
|
Public Module SplitAuto
|
||||||
@@ -119,6 +120,9 @@ Public Module SplitAuto
|
|||||||
Mach.m_dStartFreeLen > FREELEN_INF And Mach.m_bIsLine
|
Mach.m_dStartFreeLen > FREELEN_INF And Mach.m_bIsLine
|
||||||
Mach.m_bCanEndAll = (dEndAddLen > -EPS_SMALL And (nRes And CAR_RES.LO_OK) <> 0) And
|
Mach.m_bCanEndAll = (dEndAddLen > -EPS_SMALL And (nRes And CAR_RES.LO_OK) <> 0) And
|
||||||
Mach.m_dEndFreeLen > FREELEN_INF And Mach.m_bIsLine
|
Mach.m_dEndFreeLen > FREELEN_INF And Mach.m_bIsLine
|
||||||
|
If nRes = 0 Then
|
||||||
|
EgtOutLog("Operation ID " & nOperId.ToString & " isn't split cut! verify depth machining.")
|
||||||
|
End If
|
||||||
End If
|
End If
|
||||||
' se trasformabile in taglio di separazione, verifico se lo è
|
' se trasformabile in taglio di separazione, verifico se lo è
|
||||||
If Mach.m_bCanStartAll Or Mach.m_bCanEndAll Then
|
If Mach.m_bCanStartAll Or Mach.m_bCanEndAll Then
|
||||||
@@ -795,21 +799,29 @@ Public Module SplitAuto
|
|||||||
|
|
||||||
Private Function ExecMove(nDispId As Integer, vNewRaws As List(Of Integer),
|
Private Function ExecMove(nDispId As Integer, vNewRaws As List(Of Integer),
|
||||||
vtMove As Vector3d, dMinMove As Double) As Boolean
|
vtMove As Vector3d, dMinMove As Double) As Boolean
|
||||||
Dim vtMove2 As Vector3d = -vtMove
|
Dim bTwoHeadVac As Boolean = ( EgtGetHeadId( VACUUM_HEAD_2) <> GDB_ID.NULL)
|
||||||
Dim rmData As New RawMoveData
|
Dim rmData As New RawMoveData
|
||||||
If PutVacuumCupsOnRaw(vNewRaws(1), rmData) AndAlso
|
Dim vtMove2 As Vector3d = -vtMove
|
||||||
SafeMoveRawPart(vNewRaws(1), vtMove, dMinMove) Then
|
|
||||||
|
VacuumCups.ResetHeadName()
|
||||||
|
Dim bPutVacuum As Boolean = PutVacuumCupsOnRaw(vNewRaws(1), rmData)
|
||||||
|
If Not bPutVacuum And bTwoHeadVac Then bPutVacuum= PutVacuumCupsOnRaw(vNewRaws(1), rmData)
|
||||||
|
If bPutVacuum AndAlso SafeMoveRawPart(vNewRaws(1), vtMove, dMinMove) Then
|
||||||
rmData.m_vtRawMove = vtMove
|
rmData.m_vtRawMove = vtMove
|
||||||
SaveOneMoveInfoInDisposition(nDispId, rmData)
|
SaveOneMoveInfoInDisposition(nDispId, rmData)
|
||||||
Return True
|
Return True
|
||||||
ElseIf PutVacuumCupsOnRaw(vNewRaws(0), rmData) AndAlso
|
End If
|
||||||
SafeMoveRawPart(vNewRaws(0), vtMove2, dMinMove) Then
|
|
||||||
|
VacuumCups.ResetHeadName()
|
||||||
|
Dim bPut2Vacuum As Boolean = PutVacuumCupsOnRaw(vNewRaws(0), rmData)
|
||||||
|
If Not bPut2Vacuum And bTwoHeadVac Then bPutVacuum = PutVacuumCupsOnRaw(vNewRaws(0), rmData)
|
||||||
|
If bPut2Vacuum AndAlso SafeMoveRawPart(vNewRaws(0), vtMove2, dMinMove) Then
|
||||||
rmData.m_vtRawMove = vtMove2
|
rmData.m_vtRawMove = vtMove2
|
||||||
SaveOneMoveInfoInDisposition(nDispId, rmData)
|
SaveOneMoveInfoInDisposition(nDispId, rmData)
|
||||||
Return True
|
Return True
|
||||||
Else
|
|
||||||
Return False
|
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
Return False
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
Private Function SafeMoveRawPart(nRawId As Integer, ByRef vtMove As Vector3d, dMindist As Double) As Boolean
|
Private Function SafeMoveRawPart(nRawId As Integer, ByRef vtMove As Vector3d, dMindist As Double) As Boolean
|
||||||
|
|||||||
+75
-40
@@ -1,5 +1,6 @@
|
|||||||
Imports EgtUILib
|
Imports EgtUILib
|
||||||
Imports System.Text.RegularExpressions
|
Imports System.Text.RegularExpressions
|
||||||
|
Imports System.Threading
|
||||||
|
|
||||||
Module VacuumCups
|
Module VacuumCups
|
||||||
' Tipo manipolatore con ventosa (0=assente, 1=dietro, 2=laterale)
|
' Tipo manipolatore con ventosa (0=assente, 1=dietro, 2=laterale)
|
||||||
@@ -31,6 +32,19 @@ Module VacuumCups
|
|||||||
' Nome del gruppo temporaneo per le ventose
|
' Nome del gruppo temporaneo per le ventose
|
||||||
Private Const VACTMP_GRP As String = "VacTmp"
|
Private Const VACTMP_GRP As String = "VacTmp"
|
||||||
|
|
||||||
|
Private m_sHeadName As String = VACUUM_HEAD
|
||||||
|
Public Sub ResetHeadName()
|
||||||
|
Dim bReload As Boolean = (m_sHeadName <> VACUUM_HEAD)
|
||||||
|
m_sHeadName = VACUUM_HEAD
|
||||||
|
If bReload Then LoadVacuumCups()
|
||||||
|
End Sub
|
||||||
|
Public Function ChangeHeadName() As Boolean
|
||||||
|
If EgtGetHeadId( VACUUM_HEAD_2) = GDB_ID.NULL Then Return False
|
||||||
|
m_sHeadName = If( m_sHeadName = VACUUM_HEAD, VACUUM_HEAD_2, VACUUM_HEAD)
|
||||||
|
LoadVacuumCups()
|
||||||
|
Return True
|
||||||
|
End Function
|
||||||
|
|
||||||
'-----------------------------------------------------------------------------------------------
|
'-----------------------------------------------------------------------------------------------
|
||||||
Friend Class RawMoveData
|
Friend Class RawMoveData
|
||||||
|
|
||||||
@@ -87,17 +101,17 @@ Module VacuumCups
|
|||||||
Friend Function LoadVacuumCups() As Boolean
|
Friend Function LoadVacuumCups() As Boolean
|
||||||
' Leggo tipo manipolatore con ventosa
|
' Leggo tipo manipolatore con ventosa
|
||||||
m_nVacType = 0
|
m_nVacType = 0
|
||||||
EgtGetInfo(EgtGetHeadId(VACUUM_HEAD), KEY_VAC_TYPE, m_nVacType)
|
EgtGetInfo(EgtGetHeadId(m_sHeadName), KEY_VAC_TYPE, m_nVacType)
|
||||||
' Cancello eventuali vecchie ventose
|
' Cancello eventuali vecchie ventose
|
||||||
RemoveVacuumCups()
|
RemoveVacuumCups()
|
||||||
' Identificativo ventose nella macchina
|
' Identificativo ventose nella macchina
|
||||||
Dim nLayId As Integer = EgtGetFirstNameInGroup(EgtGetHeadId(VACUUM_HEAD), VACUUM_HEAD_LAYOUT)
|
Dim nLayId As Integer = EgtGetFirstNameInGroup(EgtGetHeadId(m_sHeadName), VACUUM_HEAD_LAYOUT)
|
||||||
If nLayId = GDB_ID.NULL Then Return False
|
If nLayId = GDB_ID.NULL Then Return False
|
||||||
' Identificativo riferimento della testa nella macchina
|
' Identificativo riferimento della testa nella macchina
|
||||||
Dim nT1Id As Integer = EgtGetFirstNameInGroup(EgtGetHeadId(VACUUM_HEAD), HEAD_FIRST_EXIT)
|
Dim nT1Id As Integer = EgtGetFirstNameInGroup(EgtGetHeadId(m_sHeadName), HEAD_FIRST_EXIT)
|
||||||
If nT1Id = GDB_ID.NULL Then Return False
|
If nT1Id = GDB_ID.NULL Then Return False
|
||||||
' imposto la l'uscita della ventosa come fosse l'uscita di un utensile
|
' imposto la l'uscita della ventosa come fosse l'uscita di un utensile
|
||||||
EgtSetCalcTool("", "H4", 1)
|
EgtSetCalcTool("", m_sHeadName, 1)
|
||||||
' Creo gruppo temporaneo in cui copiarli
|
' Creo gruppo temporaneo in cui copiarli
|
||||||
m_nTempId = EgtCreateGroup(GDB_ID.ROOT)
|
m_nTempId = EgtCreateGroup(GDB_ID.ROOT)
|
||||||
If m_nTempId = GDB_ID.NULL Then Return False
|
If m_nTempId = GDB_ID.NULL Then Return False
|
||||||
@@ -107,23 +121,23 @@ Module VacuumCups
|
|||||||
m_nVacId = EgtCopyGlob(nLayId, m_nTempId)
|
m_nVacId = EgtCopyGlob(nLayId, m_nTempId)
|
||||||
If m_nVacId = GDB_ID.NULL Then Return False
|
If m_nVacId = GDB_ID.NULL Then Return False
|
||||||
' Angolo di rotazione preferito
|
' Angolo di rotazione preferito
|
||||||
EgtGetInfo( m_nVacId, KEY_VACLAY_PREFROT, m_dPreferredRot)
|
EgtGetInfo(m_nVacId, KEY_VACLAY_PREFROT, m_dPreferredRot)
|
||||||
' Angoli di rotazione preferiti per ventosa in verticale (lungo Y) a sinistra e a destra del centro tavola
|
' 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_PREFVROTXMINUS, m_dPrefVertRotXMinus)
|
||||||
EgtGetInfo(m_nVacId, KEY_VACLAY_PREFVROTXPLUS, m_dPrefVertRotXPlus)
|
EgtGetInfo(m_nVacId, KEY_VACLAY_PREFVROTXPLUS, m_dPrefVertRotXPlus)
|
||||||
EgtGetInfo(m_nVacId, KEY_VACLAY_PREFVROTYMINUS, m_dPrefVertRotYMinus)
|
EgtGetInfo(m_nVacId, KEY_VACLAY_PREFVROTYMINUS, m_dPrefVertRotYMinus)
|
||||||
EgtGetInfo(m_nVacId, KEY_VACLAY_PREFVROTYPLUS, m_dPrefVertRotYPlus)
|
EgtGetInfo(m_nVacId, KEY_VACLAY_PREFVROTYPLUS, m_dPrefVertRotYPlus)
|
||||||
' Direzione di riferimento per tagli Drip
|
' Direzione di riferimento per tagli Drip
|
||||||
EgtGetInfo( m_nVacId, KEY_VACLAY_DRIPREFDIR, m_dDripRefAng)
|
EgtGetInfo(m_nVacId, KEY_VACLAY_DRIPREFDIR, m_dDripRefAng)
|
||||||
' Nascondo il gruppo ma rendo visibili le curve di contorno delle ventose
|
' Nascondo il gruppo ma rendo visibili le curve di contorno delle ventose
|
||||||
EgtSetStatus(m_nVacId, GDB_ST.OFF)
|
EgtSetStatus(m_nVacId, GDB_ST.OFF)
|
||||||
Dim nId As Integer = EgtGetFirstInGroup(m_nVacId)
|
Dim nId As Integer = EgtGetFirstInGroup(m_nVacId)
|
||||||
While nId <> GDB_ID.NULL
|
While nId <> GDB_ID.NULL
|
||||||
Select Case EgtGetType(nId)
|
Select Case EgtGetType(nId)
|
||||||
Case GDB_TY.CRV_LINE, GDB_TY.CRV_ARC, GDB_TY.CRV_BEZ, GDB_TY.CRV_COMPO
|
Case GDB_TY.CRV_LINE, GDB_TY.CRV_ARC, GDB_TY.CRV_BEZ, GDB_TY.CRV_COMPO
|
||||||
EgtSetStatus(nId, GDB_ST.ON_)
|
EgtSetStatus(nId, GDB_ST.ON_)
|
||||||
Case Else
|
Case Else
|
||||||
EgtSetStatus(nId, GDB_ST.OFF)
|
EgtSetStatus(nId, GDB_ST.OFF)
|
||||||
End Select
|
End Select
|
||||||
nId = EgtGetNext(nId)
|
nId = EgtGetNext(nId)
|
||||||
End While
|
End While
|
||||||
@@ -152,7 +166,7 @@ Module VacuumCups
|
|||||||
Friend Function ResetVacuumCups() As Boolean
|
Friend Function ResetVacuumCups() As Boolean
|
||||||
' Ripristino posizione e rotazione originali
|
' Ripristino posizione e rotazione originali
|
||||||
Dim frOriRef As New Frame3d
|
Dim frOriRef As New Frame3d
|
||||||
EgtFrame(EgtGetFirstNameInGroup(EgtGetHeadId(VACUUM_HEAD), HEAD_FIRST_EXIT), GDB_ID.ROOT, frOriRef)
|
EgtFrame(EgtGetFirstNameInGroup(EgtGetHeadId(m_sHeadName), HEAD_FIRST_EXIT), GDB_ID.ROOT, frOriRef)
|
||||||
Dim frCurrRef As New Frame3d
|
Dim frCurrRef As New Frame3d
|
||||||
EgtFrame(m_nRefId, GDB_ID.ROOT, frCurrRef)
|
EgtFrame(m_nRefId, GDB_ID.ROOT, frCurrRef)
|
||||||
EgtMove(m_nVacId, frOriRef.Orig() - frCurrRef.Orig(), GDB_RT.GLOB)
|
EgtMove(m_nVacId, frOriRef.Orig() - frCurrRef.Orig(), GDB_RT.GLOB)
|
||||||
@@ -164,10 +178,10 @@ Module VacuumCups
|
|||||||
Dim nId As Integer = EgtGetFirstInGroup(m_nVacId)
|
Dim nId As Integer = EgtGetFirstInGroup(m_nVacId)
|
||||||
While nId <> GDB_ID.NULL
|
While nId <> GDB_ID.NULL
|
||||||
Select Case EgtGetType(nId)
|
Select Case EgtGetType(nId)
|
||||||
Case GDB_TY.CRV_LINE, GDB_TY.CRV_ARC, GDB_TY.CRV_BEZ, GDB_TY.CRV_COMPO
|
Case GDB_TY.CRV_LINE, GDB_TY.CRV_ARC, GDB_TY.CRV_BEZ, GDB_TY.CRV_COMPO
|
||||||
EgtSetStatus(nId, GDB_ST.ON_)
|
EgtSetStatus(nId, GDB_ST.ON_)
|
||||||
Case Else
|
Case Else
|
||||||
EgtSetStatus(nId, GDB_ST.OFF)
|
EgtSetStatus(nId, GDB_ST.OFF)
|
||||||
End Select
|
End Select
|
||||||
nId = EgtGetNext(nId)
|
nId = EgtGetNext(nId)
|
||||||
End While
|
End While
|
||||||
@@ -207,14 +221,17 @@ Module VacuumCups
|
|||||||
EgtSurfFrGrossArea(nRKerfId, RawArea)
|
EgtSurfFrGrossArea(nRKerfId, RawArea)
|
||||||
' volume calcolato in mmc
|
' volume calcolato in mmc
|
||||||
Dim RawVolume As Double = RawArea * b3Raw.DimZ()
|
Dim RawVolume As Double = RawArea * b3Raw.DimZ()
|
||||||
' peso calolato in kg
|
' peso calcolato in kg
|
||||||
m_RawWeight = RawVolume * m_RawDensity / Math.Pow(10, 9)
|
m_RawWeight = RawVolume * m_RawDensity / Math.Pow(10, 9)
|
||||||
'-------------------- FINE CALCOLO PESO --------------------
|
'-------------------- FINE CALCOLO PESO --------------------
|
||||||
|
|
||||||
' Eseguo ricerca
|
' Eseguo ricerca
|
||||||
If FindVacuumCupsOnRaw(nRawId, ptRawCen, b3Kerf, ptKerfCen, nKerfId, nRKerfId, rmData) Then
|
If FindVacuumCupsOnRaw(nRawId, ptRawCen, b3Kerf, ptKerfCen, nKerfId, nRKerfId, rmData) Then
|
||||||
Return True
|
Return True
|
||||||
|
Else
|
||||||
|
If ChangeHeadName() Then Return False
|
||||||
End If
|
End If
|
||||||
|
|
||||||
' In caso di fallimento, provo riducendo con offset la regione di kerf
|
' In caso di fallimento, provo riducendo con offset la regione di kerf
|
||||||
' (così si simula la proiezione del centro sul MAT - medial axis transform)
|
' (così si simula la proiezione del centro sul MAT - medial axis transform)
|
||||||
Dim bOkFind As Boolean = False
|
Dim bOkFind As Boolean = False
|
||||||
@@ -241,20 +258,20 @@ Module VacuumCups
|
|||||||
' Verifico sia veramente un pezzo
|
' Verifico sia veramente un pezzo
|
||||||
If EgtGetRawPartFromPart(nPartId) = GDB_ID.NULL Then Return False
|
If EgtGetRawPartFromPart(nPartId) = GDB_ID.NULL Then Return False
|
||||||
' Cerco la direzione del primo taglio attivo da sotto
|
' Cerco la direzione del primo taglio attivo da sotto
|
||||||
Dim nDripLayId As Integer = EgtGetFirstNameInGroup( nPartId, NAME_DRIPCUT)
|
Dim nDripLayId As Integer = EgtGetFirstNameInGroup(nPartId, NAME_DRIPCUT)
|
||||||
Dim nDripLineId As Integer = EgtGetFirstInGroup( nDripLayId)
|
Dim nDripLineId As Integer = EgtGetFirstInGroup(nDripLayId)
|
||||||
While nDripLineId <> GDB_ID.NULL
|
While nDripLineId <> GDB_ID.NULL
|
||||||
Dim nMchId As Integer = EgtGetOperationId( "DripSaw" & nDripLineId.ToString())
|
Dim nMchId As Integer = EgtGetOperationId("DripSaw" & nDripLineId.ToString())
|
||||||
Dim nMode As Integer
|
Dim nMode As Integer
|
||||||
If EgtGetMode( nMchId, nMode) AndAlso nMode = GDB_MD.STD Then Exit While
|
If EgtGetMode(nMchId, nMode) AndAlso nMode = GDB_MD.STD Then Exit While
|
||||||
nDripLineId = EgtGetNext( nDripLineId)
|
nDripLineId = EgtGetNext(nDripLineId)
|
||||||
End While
|
End While
|
||||||
Dim vtDir As New Vector3d
|
Dim vtDir As New Vector3d
|
||||||
if EgtStartVector( nDripLineId, GDB_ID.ROOT, vtDir) Then
|
If EgtStartVector(nDripLineId, GDB_ID.ROOT, vtDir) Then
|
||||||
Dim dLen, dAngV, dAngH As Double
|
Dim dLen, dAngV, dAngH As Double
|
||||||
vtDir.ToSpherical( dLen, dAngV, dAngH)
|
vtDir.ToSpherical(dLen, dAngV, dAngH)
|
||||||
Dim dOffsAng = dAngH - m_dDripRefAng
|
Dim dOffsAng = dAngH - m_dDripRefAng
|
||||||
While dOffsAng - m_dPreferredRot >= 90
|
While dOffsAng - m_dPreferredRot >= 90
|
||||||
dOffsAng -= 180
|
dOffsAng -= 180
|
||||||
End While
|
End While
|
||||||
While dOffsAng - m_dPreferredRot <= -90
|
While dOffsAng - m_dPreferredRot <= -90
|
||||||
@@ -388,7 +405,7 @@ Module VacuumCups
|
|||||||
|
|
||||||
Private Function GetVacRotAxisSteps(ByRef vAngRot As List(Of Double)) As Boolean
|
Private Function GetVacRotAxisSteps(ByRef vAngRot As List(Of Double)) As Boolean
|
||||||
' Recupero l'asse rotante della testa ventosa
|
' Recupero l'asse rotante della testa ventosa
|
||||||
Dim nRotAxId As Integer = EgtGetParent(EgtGetHeadId(VACUUM_HEAD))
|
Dim nRotAxId As Integer = EgtGetParent(EgtGetHeadId(m_sHeadName))
|
||||||
' Verifico se contiene info con STEPS
|
' Verifico se contiene info con STEPS
|
||||||
Dim sSteps As String = ""
|
Dim sSteps As String = ""
|
||||||
If Not EgtGetInfo(nRotAxId, KEY_ROTVAC_STEPS, sSteps) Then Return False
|
If Not EgtGetInfo(nRotAxId, KEY_ROTVAC_STEPS, sSteps) Then Return False
|
||||||
@@ -493,15 +510,15 @@ Module VacuumCups
|
|||||||
' Ordino secondo distanza angolare crescente da direzione di allineamento (modulo 180 deg)
|
' Ordino secondo distanza angolare crescente da direzione di allineamento (modulo 180 deg)
|
||||||
Dim dRotRefDeg As Double = dRotAngDeg
|
Dim dRotRefDeg As Double = dRotAngDeg
|
||||||
vAngRot.Sort(Function(P, Q)
|
vAngRot.Sort(Function(P, Q)
|
||||||
Dim dDiffP = Math.Abs( P - dRotRefDeg)
|
Dim dDiffP = Math.Abs(P - dRotRefDeg)
|
||||||
If Math.Abs( dDiffP - 180) < 10 * EPS_ANG_SMALL Then dDiffP = 1
|
If Math.Abs(dDiffP - 180) < 10 * EPS_ANG_SMALL Then dDiffP = 1
|
||||||
Dim dDiffQ = Math.Abs( Q - dRotRefDeg)
|
Dim dDiffQ = Math.Abs(Q - dRotRefDeg)
|
||||||
If Math.Abs( dDiffQ - 180) < 10 * EPS_ANG_SMALL Then dDiffQ = 1
|
If Math.Abs(dDiffQ - 180) < 10 * EPS_ANG_SMALL Then dDiffQ = 1
|
||||||
Return ( dDiffP - dDiffQ)
|
Return (dDiffP - dDiffQ)
|
||||||
End Function)
|
End Function)
|
||||||
' Annullo la rotazione di allineamento
|
' Annullo la rotazione di allineamento
|
||||||
dRotAngDeg = 0
|
dRotAngDeg = 0
|
||||||
' altrimenti in continuo
|
' altrimenti in continuo
|
||||||
Else
|
Else
|
||||||
' Assegno più valori di ricerca e conservo angolo di allineamento
|
' Assegno più valori di ricerca e conservo angolo di allineamento
|
||||||
vAngRot.AddRange({0, +5, -5, +12.5, -12.5, +25, -25, +45, -45})
|
vAngRot.AddRange({0, +5, -5, +12.5, -12.5, +25, -25, +45, -45})
|
||||||
@@ -548,25 +565,43 @@ Module VacuumCups
|
|||||||
|
|
||||||
' assegnate le posizioni del centro delle ventose e l'angolo di posizionamento orizzontale verifica che la posizione sia raggiungibile
|
' assegnate 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
|
Public Function VerifyOutOfStrokes(ptRef As Point3d, dRotAngDeg As Double) As Integer
|
||||||
|
Dim sAxisName As String = "C"
|
||||||
|
' verifico che il nome dell'asse impostato sia corretto
|
||||||
|
If EgtGetAxisId(sAxisName) = GDB_ID.NULL Then
|
||||||
|
If m_sHeadName = VACUUM_HEAD Then
|
||||||
|
sAxisName = "C1"
|
||||||
|
Else
|
||||||
|
sAxisName = "C2"
|
||||||
|
End If
|
||||||
|
End If
|
||||||
' Posizione Home dell'asse rotante
|
' Posizione Home dell'asse rotante
|
||||||
Dim dCHome As Double
|
Dim dCHome As Double
|
||||||
EgtGetAxisHomePos("C", dCHome)
|
EgtGetAxisHomePos(sAxisName, dCHome)
|
||||||
' Corse dell'asse
|
' Corse dell'asse
|
||||||
Dim dCMin As Double
|
Dim dCMin As Double
|
||||||
EgtGetAxisMin("C", dCMin)
|
EgtGetAxisMin(sAxisName, dCMin)
|
||||||
Dim dCMax As Double
|
Dim dCMax As Double
|
||||||
EgtGetAxisMax("C", dCMax)
|
EgtGetAxisMax(sAxisName, dCMax)
|
||||||
' Porto l'angolo nel range
|
' Porto l'angolo nel range
|
||||||
Dim dRotAngMachDeg As Double = dRotAngDeg + dCHome
|
Dim dRotAngMachDeg As Double = dRotAngDeg + dCHome
|
||||||
AdjustAngleInRange(dRotAngMachDeg, dCMin, dCMax)
|
AdjustAngleInRange(dRotAngMachDeg, dCMin, dCMax)
|
||||||
' Imposto la ventosa come fosse un utensile
|
' Imposto la ventosa come fosse un utensile
|
||||||
EgtSetCalcTool("", "H4", 1)
|
EgtSetCalcTool("", m_sHeadName, 1)
|
||||||
' Calcolo gli assi macchina
|
' Calcolo gli assi macchina
|
||||||
Dim dX, dY, dZ As Double
|
Dim dX, dY, dZ As Double
|
||||||
Dim nStat As Integer
|
Dim nStat As Integer
|
||||||
EgtGetCalcPositions(ptRef, dRotAngMachDeg, 0, nStat, dX, dY, dZ)
|
If EgtGetAxisId("A") <> GDB_ID.NULL Then
|
||||||
' Verifico le corse
|
' Asse tavola rotante (movimenti solo con A0)
|
||||||
EgtVerifyOutstroke(dX, dY, dZ, dRotAngMachDeg, 0, nStat)
|
EgtGetCalcPositions(ptRef, 0, dRotAngMachDeg, nStat, dX, dY, dZ)
|
||||||
|
' Verifico le corse
|
||||||
|
EgtVerifyOutstroke(dX, dY, dZ, 0, dRotAngMachDeg, nStat)
|
||||||
|
Else
|
||||||
|
EgtGetCalcPositions(ptRef, dRotAngMachDeg, 0, nStat, dX, dY, dZ)
|
||||||
|
' Verifico le corse
|
||||||
|
EgtVerifyOutstroke(dX, dY, dZ, dRotAngMachDeg, 0, nStat)
|
||||||
|
End If
|
||||||
|
|
||||||
|
|
||||||
Return nStat
|
Return nStat
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
@@ -732,7 +767,7 @@ Module VacuumCups
|
|||||||
rmList.RemoveAt(nInd)
|
rmList.RemoveAt(nInd)
|
||||||
nInd = rmList.Count() - 1
|
nInd = rmList.Count() - 1
|
||||||
End If
|
End If
|
||||||
' Se non trovato, lo accodo
|
' Se non trovato, lo accodo
|
||||||
Else
|
Else
|
||||||
rmList.Add(New RawMoveData(nRawId))
|
rmList.Add(New RawMoveData(nRawId))
|
||||||
nInd = rmList.Count() - 1
|
nInd = rmList.Count() - 1
|
||||||
|
|||||||
@@ -84,6 +84,11 @@ Module ConstGen
|
|||||||
|
|
||||||
' Nome testa con ventose per spostamento pezzi
|
' Nome testa con ventose per spostamento pezzi
|
||||||
Public Const VACUUM_HEAD As String = "H4"
|
Public Const VACUUM_HEAD As String = "H4"
|
||||||
|
Public Const VACUUM_HEAD_2 As String = "H104"
|
||||||
|
' Nome teste laser
|
||||||
|
Public Const LASER_HEAD As String = "H3"
|
||||||
|
Public Const LASER_HEAD_2 As String = "H103"
|
||||||
|
|
||||||
' Info tipo ventosa
|
' Info tipo ventosa
|
||||||
Public Const KEY_VAC_TYPE As String = "VacType"
|
Public Const KEY_VAC_TYPE As String = "VacType"
|
||||||
' Nome gruppo layout in testa con ventose
|
' Nome gruppo layout in testa con ventose
|
||||||
|
|||||||
@@ -5,6 +5,7 @@
|
|||||||
|
|
||||||
Public Const S_PARTPROGRAM As String = "PartProgram"
|
Public Const S_PARTPROGRAM As String = "PartProgram"
|
||||||
Public Const K_EXTENSION As String = "Extension"
|
Public Const K_EXTENSION As String = "Extension"
|
||||||
|
Public Const K_EXTFILECN As String = "ExtFileCN"
|
||||||
|
|
||||||
Public Const S_AXES As String = "Axes"
|
Public Const S_AXES As String = "Axes"
|
||||||
Public Const K_AXESNUM As String = "AxesNum"
|
Public Const K_AXESNUM As String = "AxesNum"
|
||||||
@@ -56,6 +57,10 @@
|
|||||||
Public Const S_EXECLUA As String = "ExecLua"
|
Public Const S_EXECLUA As String = "ExecLua"
|
||||||
Public Const K_FILESCRIPT_LUA As String = "FileScript"
|
Public Const K_FILESCRIPT_LUA As String = "FileScript"
|
||||||
|
|
||||||
|
Public Const S_CAMERAHQ As String = "CameraHQ"
|
||||||
|
Public Const K_CAMERAHQ_ENABLE As String = "EnableHQ"
|
||||||
|
Public Const K_CAMERAHQ_ACTIVATE As String = "ActivateHQ"
|
||||||
|
|
||||||
Public Const S_NCDATA As String = "NcData"
|
Public Const S_NCDATA As String = "NcData"
|
||||||
Public Const K_NEWVARIABLE As String = "NewVariable"
|
Public Const K_NEWVARIABLE As String = "NewVariable"
|
||||||
Public Const K_NEWCONSOLE As String = "NewConsole"
|
Public Const K_NEWCONSOLE As String = "NewConsole"
|
||||||
|
|||||||
@@ -409,7 +409,7 @@ Public Class FlatteningCut
|
|||||||
|
|
||||||
Private Sub DepthTxBx_EgtClosed(sender As Object, e As EventArgs) Handles DepthTxBx.EgtClosed
|
Private Sub DepthTxBx_EgtClosed(sender As Object, e As EventArgs) Handles DepthTxBx.EgtClosed
|
||||||
' Verifico che l'affondamento impostato non sia superiore a quello massimo
|
' Verifico che l'affondamento impostato non sia superiore a quello massimo
|
||||||
Dim dMaxDepth = m_ptRawMax.z - m_ptRawMin.z + MAX_TAB_DEPTH
|
Dim dMaxDepth = m_ptRawMax.z - m_ptRawMin.z + m_MainWindow.m_CurrentMachine.MaxTabDepth
|
||||||
Dim dDepth As Double = 0
|
Dim dDepth As Double = 0
|
||||||
StringToLen(DepthTxBx.Text, dDepth)
|
StringToLen(DepthTxBx.Text, dDepth)
|
||||||
If dDepth < 0 Then
|
If dDepth < 0 Then
|
||||||
|
|||||||
@@ -405,7 +405,7 @@ Public Class GridCut
|
|||||||
|
|
||||||
Private Sub DepthTxBx_EgtClosed(sender As Object, e As EventArgs) Handles DepthTxBx.EgtClosed
|
Private Sub DepthTxBx_EgtClosed(sender As Object, e As EventArgs) Handles DepthTxBx.EgtClosed
|
||||||
' Verifico che l'affondamento impostato non sia superiore a quello massimo
|
' Verifico che l'affondamento impostato non sia superiore a quello massimo
|
||||||
Dim dMaxDepth = m_ptRawMax.z - m_ptRawMin.z + MAX_TAB_DEPTH
|
Dim dMaxDepth = m_ptRawMax.z - m_ptRawMin.z + m_MainWindow.m_CurrentMachine.MaxTabDepth
|
||||||
Dim dDepth As Double = 0
|
Dim dDepth As Double = 0
|
||||||
StringToLen(DepthTxBx.Text, dDepth)
|
StringToLen(DepthTxBx.Text, dDepth)
|
||||||
If dDepth < 0 Then
|
If dDepth < 0 Then
|
||||||
|
|||||||
@@ -435,7 +435,7 @@ Public Class MultipleCut
|
|||||||
|
|
||||||
Private Sub DepthTxBx_EgtClosed(sender As Object, e As EventArgs) Handles DepthTxBx.EgtClosed
|
Private Sub DepthTxBx_EgtClosed(sender As Object, e As EventArgs) Handles DepthTxBx.EgtClosed
|
||||||
' Verifico che l'affondamento impostato non sia superiore a quello massimo
|
' Verifico che l'affondamento impostato non sia superiore a quello massimo
|
||||||
Dim dMaxDepth = m_ptRawMax.z - m_ptRawMin.z + MAX_TAB_DEPTH
|
Dim dMaxDepth = m_ptRawMax.z - m_ptRawMin.z + m_MainWindow.m_CurrentMachine.MaxTabDepth
|
||||||
Dim dDepth As Double = 0
|
Dim dDepth As Double = 0
|
||||||
StringToLen(DepthTxBx.Text, dDepth)
|
StringToLen(DepthTxBx.Text, dDepth)
|
||||||
If dDepth < 0 Then
|
If dDepth < 0 Then
|
||||||
|
|||||||
@@ -351,7 +351,7 @@ Public Class SawTestUC
|
|||||||
|
|
||||||
Private Sub DepthTxBx_EgtClosed(sender As Object, e As EventArgs) Handles DepthTxBx.EgtClosed
|
Private Sub DepthTxBx_EgtClosed(sender As Object, e As EventArgs) Handles DepthTxBx.EgtClosed
|
||||||
' Verifico che l'affondamento impostato non sia superiore a quello massimo
|
' Verifico che l'affondamento impostato non sia superiore a quello massimo
|
||||||
Dim dMaxDepth = m_ptRawMax.z - m_ptRawMin.z + MAX_TAB_DEPTH
|
Dim dMaxDepth = m_ptRawMax.z - m_ptRawMin.z + m_MainWindow.m_CurrentMachine.MaxTabDepth
|
||||||
Dim dDepth As Double = 0
|
Dim dDepth As Double = 0
|
||||||
StringToLen(DepthTxBx.Text, dDepth)
|
StringToLen(DepthTxBx.Text, dDepth)
|
||||||
If dDepth < 0 Then
|
If dDepth < 0 Then
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ Public Class SingleCutUC
|
|||||||
Private m_nTempLay As Integer = GDB_ID.NULL
|
Private m_nTempLay As Integer = GDB_ID.NULL
|
||||||
|
|
||||||
' Costanti
|
' Costanti
|
||||||
Private Const MAX_TAB_DEPTH As Double = 10.0
|
Private Const MAX_TAB_DEPTH As Double = 10.0 ' sostituita da un m_MaxTabDepth letto da file ini macchina
|
||||||
Private Const MIN_CUT_LEN As Double = 10.0
|
Private Const MIN_CUT_LEN As Double = 10.0
|
||||||
Private Const MAX_SIDE_ANG As Double = 60.0
|
Private Const MAX_SIDE_ANG As Double = 60.0
|
||||||
' Costanti che indicano la modalità di acquisizione dei punti
|
' Costanti che indicano la modalità di acquisizione dei punti
|
||||||
@@ -429,7 +429,7 @@ Public Class SingleCutUC
|
|||||||
|
|
||||||
Private Sub DepthTxBx_EgtClosed(sender As Object, e As EventArgs) Handles DepthTxBx.EgtClosed
|
Private Sub DepthTxBx_EgtClosed(sender As Object, e As EventArgs) Handles DepthTxBx.EgtClosed
|
||||||
' Verifico che l'affondamento impostato non sia superiore a quello massimo
|
' Verifico che l'affondamento impostato non sia superiore a quello massimo
|
||||||
Dim dMaxDepth = m_ptRawMax.z - m_ptRawMin.z + MAX_TAB_DEPTH
|
Dim dMaxDepth = m_ptRawMax.z - m_ptRawMin.z + m_MainWindow.m_CurrentMachine.MaxTabDepth
|
||||||
Dim dDepth As Double = 0
|
Dim dDepth As Double = 0
|
||||||
StringToLen(DepthTxBx.Text, dDepth)
|
StringToLen(DepthTxBx.Text, dDepth)
|
||||||
If dDepth < 0 Then
|
If dDepth < 0 Then
|
||||||
|
|||||||
@@ -54,6 +54,8 @@ Public Class CurrentMachine
|
|||||||
Private m_sProdLiSawDiameter2Var As String = ""
|
Private m_sProdLiSawDiameter2Var As String = ""
|
||||||
Private m_sClickState As String = "E80028"
|
Private m_sClickState As String = "E80028"
|
||||||
Private m_sClickDir As String = ""
|
Private m_sClickDir As String = ""
|
||||||
|
' Gestione speciale per canali CN
|
||||||
|
Private m_sExtFileCN As String = ".0"
|
||||||
|
|
||||||
' Numero e tipo di utensili correntemente disponibili sulla macchina
|
' Numero e tipo di utensili correntemente disponibili sulla macchina
|
||||||
Private m_MountedToolConfig As MountedToolConfigs = MountedToolConfigs.SAW
|
Private m_MountedToolConfig As MountedToolConfigs = MountedToolConfigs.SAW
|
||||||
@@ -197,8 +199,15 @@ Public Class CurrentMachine
|
|||||||
' Massimo numero di utensili su Tc manuale
|
' Massimo numero di utensili su Tc manuale
|
||||||
Friend MAX_TCMAN_TOOLS As Integer = 60
|
Friend MAX_TCMAN_TOOLS As Integer = 60
|
||||||
|
|
||||||
|
' Massima profondità lavorabile nei tagli diretti
|
||||||
|
Private m_MaxTabDepth As Double = 10.0
|
||||||
|
|
||||||
#Region "Proprietà che leggono e scrivono i valori anche da o su file ini"
|
#Region "Proprietà che leggono e scrivono i valori anche da o su file ini"
|
||||||
|
Friend ReadOnly Property MaxTabDepth As Double
|
||||||
|
Get
|
||||||
|
Return m_MaxTabDepth
|
||||||
|
End Get
|
||||||
|
End Property
|
||||||
|
|
||||||
Friend ReadOnly Property sMachineName As String
|
Friend ReadOnly Property sMachineName As String
|
||||||
Get
|
Get
|
||||||
@@ -339,6 +348,12 @@ Public Class CurrentMachine
|
|||||||
End Get
|
End Get
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
|
Friend ReadOnly Property sExtFileCN As String
|
||||||
|
Get
|
||||||
|
Return m_sExtFileCN
|
||||||
|
End Get
|
||||||
|
End Property
|
||||||
|
|
||||||
Friend Function sProdLiProbingStateVar(nI As Integer) As String
|
Friend Function sProdLiProbingStateVar(nI As Integer) As String
|
||||||
If nI = 1 Then Return m_sProdLiProbingStateVar
|
If nI = 1 Then Return m_sProdLiProbingStateVar
|
||||||
If nI = 2 Then Return m_sProdLiProbingState2Var
|
If nI = 2 Then Return m_sProdLiProbingState2Var
|
||||||
@@ -1135,6 +1150,8 @@ Public Class CurrentMachine
|
|||||||
m_sMachIniFile = m_MainWindow.GetMachinesRootDir & "\" & sMachineName & "\" & sMachineName & ".ini"
|
m_sMachIniFile = m_MainWindow.GetMachinesRootDir & "\" & sMachineName & "\" & sMachineName & ".ini"
|
||||||
' Leggo estensione del file programma pezzo
|
' Leggo estensione del file programma pezzo
|
||||||
GetPrivateProfileString(S_PARTPROGRAM, K_EXTENSION, "xpi", m_sIsoFileExt, sMachIniFile)
|
GetPrivateProfileString(S_PARTPROGRAM, K_EXTENSION, "xpi", m_sIsoFileExt, sMachIniFile)
|
||||||
|
' per gestione canali separati (macchina NUM con più di 5 Assi) ver. 2.5g1
|
||||||
|
GetPrivateProfileString(S_PARTPROGRAM, K_EXTFILECN, ".0", m_sExtFileCN, sMachIniFile)
|
||||||
If m_sIsoFileExt(0) <> "." Then m_sIsoFileExt = "." & m_sIsoFileExt
|
If m_sIsoFileExt(0) <> "." Then m_sIsoFileExt = "." & m_sIsoFileExt
|
||||||
' Leggo flag incremento asse C
|
' Leggo flag incremento asse C
|
||||||
m_dDeltaC = GetPrivateProfileDouble(S_AXES, K_DELTA_C, 0.0, sMachIniFile)
|
m_dDeltaC = GetPrivateProfileDouble(S_AXES, K_DELTA_C, 0.0, sMachIniFile)
|
||||||
@@ -1382,6 +1399,12 @@ Public Class CurrentMachine
|
|||||||
m_HasRawProbe = (GetPrivateProfileInt(S_MACH_PROBING, K_ENABLERAWPROBE, 1, sMachIniFile) <> 0)
|
m_HasRawProbe = (GetPrivateProfileInt(S_MACH_PROBING, K_ENABLERAWPROBE, 1, sMachIniFile) <> 0)
|
||||||
' leggo se la macchina ha il lettore di codice a barre della lastra
|
' leggo se la macchina ha il lettore di codice a barre della lastra
|
||||||
m_nEnableBarCodeReader = GetPrivateProfileInt(S_MACH_BARCODEREADER, K_ENABLEBCR, 0, sMachIniFile)
|
m_nEnableBarCodeReader = GetPrivateProfileInt(S_MACH_BARCODEREADER, K_ENABLEBCR, 0, sMachIniFile)
|
||||||
|
|
||||||
|
' affonadamento massimo oltre la tavola (inidicata in positivo!)
|
||||||
|
m_MaxTabDepth = GetPrivateProfileDouble(S_MACH_NEST, "MaxTabDepth", 10.0, m_MainWindow.GetMachIniFile())
|
||||||
|
If m_MaxTabDepth < 0 Then
|
||||||
|
m_MaxTabDepth = 10.0
|
||||||
|
End If
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
' Per il controllo FANUC al momento dell'inizializzazione del CN devono essere lette alcune variabili
|
' Per il controllo FANUC al momento dell'inizializzazione del CN devono essere lette alcune variabili
|
||||||
|
|||||||
@@ -7,110 +7,123 @@
|
|||||||
mc:Ignorable="d"
|
mc:Ignorable="d"
|
||||||
d:DesignHeight="768" d:DesignWidth="1280">
|
d:DesignHeight="768" d:DesignWidth="1280">
|
||||||
|
|
||||||
<!-- Definizione della ImportPage -->
|
<!-- Definizione della ImportPage -->
|
||||||
<Border Background="{DynamicResource OmagCut_Gray}" >
|
<Border Background="{DynamicResource OmagCut_Gray}" >
|
||||||
|
|
||||||
<Grid Name="ImportPageGrid">
|
<Grid Name="ImportPageGrid">
|
||||||
<Grid.ColumnDefinitions>
|
<Grid.ColumnDefinitions>
|
||||||
<ColumnDefinition Width="7.5*"/>
|
<ColumnDefinition Width="7.5*"/>
|
||||||
<ColumnDefinition Width="1.5*"/>
|
<ColumnDefinition Width="1.5*"/>
|
||||||
<ColumnDefinition Width="1*"/>
|
<ColumnDefinition Width="1*"/>
|
||||||
<ColumnDefinition Width="5*"/>
|
<ColumnDefinition Width="5*"/>
|
||||||
</Grid.ColumnDefinitions>
|
</Grid.ColumnDefinitions>
|
||||||
<Grid.RowDefinitions>
|
<Grid.RowDefinitions>
|
||||||
<RowDefinition Height="1.5*"/>
|
<RowDefinition Height="1.5*"/>
|
||||||
<RowDefinition Height="1.5*"/>
|
<RowDefinition Height="1.5*"/>
|
||||||
<RowDefinition Height="1.5*"/>
|
<RowDefinition Height="1.5*"/>
|
||||||
<RowDefinition Height="4.5*"/>
|
<RowDefinition Height="4.5*"/>
|
||||||
</Grid.RowDefinitions>
|
</Grid.RowDefinitions>
|
||||||
|
|
||||||
<GroupBox Name="CNModeGpBx" Style="{DynamicResource OmagCut_GroupBox}" Grid.ColumnSpan="2" Margin="0,0,4,0">
|
<GroupBox Name="CNModeGpBx" Style="{DynamicResource OmagCut_GroupBox}" Grid.ColumnSpan="2" Margin="0,0,4,0">
|
||||||
<Grid>
|
<Grid>
|
||||||
<Grid.ColumnDefinitions>
|
<Grid.ColumnDefinitions>
|
||||||
<ColumnDefinition Width="2*"/>
|
<ColumnDefinition Width="2*"/>
|
||||||
<ColumnDefinition Width="2*"/>
|
<ColumnDefinition Width="2*"/>
|
||||||
<ColumnDefinition Width="2*"/>
|
<ColumnDefinition Width="2*"/>
|
||||||
<ColumnDefinition Width="1.5*"/>
|
<ColumnDefinition Width="1.5*"/>
|
||||||
<ColumnDefinition Width="1.5*"/>
|
<ColumnDefinition Width="1.5*"/>
|
||||||
</Grid.ColumnDefinitions>
|
</Grid.ColumnDefinitions>
|
||||||
|
|
||||||
<ToggleButton Name="AutoBtn" Grid.Column="0"
|
<ToggleButton Name="AutoBtn" Grid.Column="0"
|
||||||
Style="{DynamicResource OmagCut_GradientYellowIconToggleButton}"
|
Style="{DynamicResource OmagCut_GradientYellowIconToggleButton}"
|
||||||
Foreground="White"/>
|
Foreground="White"/>
|
||||||
<ToggleButton Name="ManualBtn" Grid.Column="1"
|
<ToggleButton Name="ManualBtn" Grid.Column="1"
|
||||||
Style="{DynamicResource OmagCut_GradientYellowIconToggleButton}"
|
Style="{DynamicResource OmagCut_GradientYellowIconToggleButton}"
|
||||||
Foreground="White"/>
|
Foreground="White"/>
|
||||||
<ToggleButton Name="MDIBtn" Grid.Column="2"
|
<ToggleButton Name="MDIBtn" Grid.Column="2"
|
||||||
Style="{DynamicResource OmagCut_GradientYellowIconToggleButton}"
|
Style="{DynamicResource OmagCut_GradientYellowIconToggleButton}"
|
||||||
Foreground="White"/>
|
Foreground="White"/>
|
||||||
<ToggleButton Name="SingleBtn" Grid.Column="3"
|
<ToggleButton Name="SingleBtn" Grid.Column="3"
|
||||||
Style="{DynamicResource OmagCut_GradientYellowIconToggleButton}"
|
Style="{DynamicResource OmagCut_GradientYellowIconToggleButton}"
|
||||||
Foreground="White"/>
|
Foreground="White"/>
|
||||||
<ToggleButton Name="HomeBtn" Grid.Column="4"
|
<ToggleButton Name="HomeBtn" Grid.Column="4"
|
||||||
Style="{DynamicResource OmagCut_GradientYellowIconToggleButton}"
|
Style="{DynamicResource OmagCut_GradientYellowIconToggleButton}"
|
||||||
Foreground="White"/>
|
Foreground="White"/>
|
||||||
|
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|
||||||
</GroupBox>
|
</GroupBox>
|
||||||
|
|
||||||
<GroupBox Name="CommandsGpBx" Style="{DynamicResource OmagCut_GroupBox}" Grid.Column="2" Grid.ColumnSpan="2">
|
<GroupBox Name="CommandsGpBx" Style="{DynamicResource OmagCut_GroupBox}" Grid.Column="2" Grid.ColumnSpan="2">
|
||||||
<Grid>
|
<Grid>
|
||||||
<Grid.ColumnDefinitions>
|
<Grid.ColumnDefinitions>
|
||||||
<ColumnDefinition Width="2*"/>
|
<ColumnDefinition Width="2*"/>
|
||||||
<ColumnDefinition Width="2*"/>
|
<ColumnDefinition Width="2*"/>
|
||||||
<ColumnDefinition Width="2*"/>
|
<ColumnDefinition Width="2*"/>
|
||||||
</Grid.ColumnDefinitions>
|
</Grid.ColumnDefinitions>
|
||||||
|
|
||||||
<Button Name="StartBtn" Style="{DynamicResource OmagCut_RightGrayGradientYellowTextButton}"/>
|
<Button Name="StartBtn" Style="{DynamicResource OmagCut_RightGrayGradientYellowTextButton}"/>
|
||||||
<Button Name="StopBtn" Grid.Column="1"
|
<Button Name="StopBtn" Grid.Column="1"
|
||||||
Style="{DynamicResource OmagCut_RightGrayGradientYellowTextButton}"/>
|
Style="{DynamicResource OmagCut_RightGrayGradientYellowTextButton}"/>
|
||||||
<Button Name="ResetBtn" Grid.Column="2"
|
<Button Name="ResetBtn" Grid.Column="2"
|
||||||
Style="{DynamicResource OmagCut_RightGrayGradientYellowTextButton}"/>
|
Style="{DynamicResource OmagCut_RightGrayGradientYellowTextButton}"/>
|
||||||
|
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|
||||||
</GroupBox>
|
</GroupBox>
|
||||||
|
|
||||||
<GroupBox Name="MDICommandGpBx" Style="{DynamicResource OmagCut_GroupBox}" Grid.Row="1">
|
<GroupBox Name="MDICommandGpBx" Style="{DynamicResource OmagCut_GroupBox}" Grid.Row="1">
|
||||||
<Grid>
|
<Grid>
|
||||||
<Grid.ColumnDefinitions>
|
<Grid.ColumnDefinitions>
|
||||||
<ColumnDefinition Width="6*"/>
|
<ColumnDefinition Width="6*"/>
|
||||||
<ColumnDefinition Width="1.5*"/>
|
<ColumnDefinition Width="1.5*"/>
|
||||||
</Grid.ColumnDefinitions>
|
</Grid.ColumnDefinitions>
|
||||||
|
|
||||||
<EgtWPFLib:EgtTextBox Name="MDITxBx" Margin="10,0,10,0" Style="{DynamicResource OmagCut_MDIKeyboardTextBox}"/>
|
<EgtWPFLib:EgtTextBox Name="MDITxBx" Margin="10,0,10,0" Style="{DynamicResource OmagCut_MDIKeyboardTextBox}"/>
|
||||||
<Button Name="MDIConfirmBtn" Grid.Column="1"
|
<Button Name="MDIConfirmBtn" Grid.Column="1"
|
||||||
Style="{DynamicResource OmagCut_RightGrayGradientYellowTextButton}"/>
|
Style="{DynamicResource OmagCut_RightGrayGradientYellowTextButton}"/>
|
||||||
|
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|
||||||
</GroupBox>
|
</GroupBox>
|
||||||
|
|
||||||
<GroupBox Name="PartProgTransferGpBx" Style="{DynamicResource OmagCut_GroupBox}" Grid.Row="2"
|
<GroupBox Name="CameraHQ" Style="{DynamicResource OmagCut_GroupBox}" Grid.Row="1" Grid.Column="2" Grid.ColumnSpan="2">
|
||||||
|
<Grid>
|
||||||
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition Width="2*"/>
|
||||||
|
<ColumnDefinition Width="2*"/>
|
||||||
|
<ColumnDefinition Width="2*"/>
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
<ToggleButton Name="CameraHQBtn" Grid.Column="2"
|
||||||
|
Style="{DynamicResource OmagCut_GradientYellowIconToggleButton}"
|
||||||
|
Foreground="White"/>
|
||||||
|
</Grid>
|
||||||
|
</GroupBox>
|
||||||
|
|
||||||
|
<GroupBox Name="PartProgTransferGpBx" Style="{DynamicResource OmagCut_GroupBox}" Grid.Row="2"
|
||||||
Grid.ColumnSpan="3">
|
Grid.ColumnSpan="3">
|
||||||
<Grid>
|
<Grid>
|
||||||
<Grid.ColumnDefinitions>
|
<Grid.ColumnDefinitions>
|
||||||
<ColumnDefinition Width="2*"/>
|
<ColumnDefinition Width="2*"/>
|
||||||
<ColumnDefinition Width="2*"/>
|
<ColumnDefinition Width="2*"/>
|
||||||
<ColumnDefinition Width="2*"/>
|
<ColumnDefinition Width="2*"/>
|
||||||
<ColumnDefinition Width="2*"/>
|
<ColumnDefinition Width="2*"/>
|
||||||
<ColumnDefinition Width="2*"/>
|
<ColumnDefinition Width="2*"/>
|
||||||
</Grid.ColumnDefinitions>
|
</Grid.ColumnDefinitions>
|
||||||
|
|
||||||
<Button Name="DownloadBtn" Grid.Column="0"
|
<Button Name="DownloadBtn" Grid.Column="0"
|
||||||
Style="{DynamicResource OmagCut_RightGrayGradientYellowTextButton}"/>
|
Style="{DynamicResource OmagCut_RightGrayGradientYellowTextButton}"/>
|
||||||
<Button Name="UploadBtn" Grid.Column="1"
|
<Button Name="UploadBtn" Grid.Column="1"
|
||||||
Style="{DynamicResource OmagCut_RightGrayGradientYellowTextButton}"/>
|
Style="{DynamicResource OmagCut_RightGrayGradientYellowTextButton}"/>
|
||||||
<Button Name="ActivateBtn" Grid.Column="2"
|
<Button Name="ActivateBtn" Grid.Column="2"
|
||||||
Style="{DynamicResource OmagCut_RightGrayGradientYellowTextButton}"/>
|
Style="{DynamicResource OmagCut_RightGrayGradientYellowTextButton}"/>
|
||||||
<Button Name="DeleteBtn" Grid.Column="3"
|
<Button Name="DeleteBtn" Grid.Column="3"
|
||||||
Style="{DynamicResource OmagCut_RightGrayGradientYellowTextButton}"/>
|
Style="{DynamicResource OmagCut_RightGrayGradientYellowTextButton}"/>
|
||||||
<EgtWPFLib:EgtTextBox Name="DULoadTxBx" Grid.Column="4" Width="100" Text="900.0"
|
<EgtWPFLib:EgtTextBox Name="DULoadTxBx" Grid.Column="4" Width="100" Text="900.0"
|
||||||
Style="{DynamicResource OmagCut_KeyboardTextBox}"/>
|
Style="{DynamicResource OmagCut_KeyboardTextBox}"/>
|
||||||
|
|
||||||
</Grid>
|
</Grid>
|
||||||
</GroupBox>
|
</GroupBox>
|
||||||
|
|
||||||
<GroupBox Name="PowerGpBx" Style="{DynamicResource OmagCut_GroupBox}" Grid.Row="2"
|
<GroupBox Name="PowerGpBx" Style="{DynamicResource OmagCut_GroupBox}" Grid.Row="2"
|
||||||
Grid.Column="3" Grid.ColumnSpan="3" Margin="5,0,0,0">
|
Grid.Column="3" Grid.ColumnSpan="3" Margin="5,0,0,0">
|
||||||
@@ -131,18 +144,18 @@
|
|||||||
</GroupBox>
|
</GroupBox>
|
||||||
|
|
||||||
<GroupBox Name="ErrorLstGpBx" Style="{DynamicResource OmagCut_GroupBox}" Grid.Row="3" Grid.ColumnSpan="4">
|
<GroupBox Name="ErrorLstGpBx" Style="{DynamicResource OmagCut_GroupBox}" Grid.Row="3" Grid.ColumnSpan="4">
|
||||||
<ListBox Name="ErrorLstBx">
|
<ListBox Name="ErrorLstBx">
|
||||||
<ListBox.ItemTemplate>
|
<ListBox.ItemTemplate>
|
||||||
<DataTemplate>
|
<DataTemplate>
|
||||||
<TextBlock Text="{Binding}" Style="{StaticResource OmagCut_LowerCaseCharacterTextBlock}"/>
|
<TextBlock Text="{Binding}" Style="{StaticResource OmagCut_LowerCaseCharacterTextBlock}"/>
|
||||||
</DataTemplate>
|
</DataTemplate>
|
||||||
</ListBox.ItemTemplate>
|
</ListBox.ItemTemplate>
|
||||||
</ListBox>
|
</ListBox>
|
||||||
|
|
||||||
</GroupBox>
|
</GroupBox>
|
||||||
|
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|
||||||
</Border>
|
</Border>
|
||||||
|
|
||||||
</UserControl>
|
</UserControl>
|
||||||
|
|||||||
@@ -29,6 +29,7 @@ Public Class MachineCNPageUC
|
|||||||
MDICommandGpBx.Header = EgtMsg(MSG_MACHINECNPAGEUC + 16)
|
MDICommandGpBx.Header = EgtMsg(MSG_MACHINECNPAGEUC + 16)
|
||||||
PartProgTransferGpBx.Header = EgtMsg(MSG_MACHINECNPAGEUC + 17)
|
PartProgTransferGpBx.Header = EgtMsg(MSG_MACHINECNPAGEUC + 17)
|
||||||
ErrorLstGpBx.Header = EgtMsg(MSG_ALARMSPAGEUC + 12)
|
ErrorLstGpBx.Header = EgtMsg(MSG_ALARMSPAGEUC + 12)
|
||||||
|
|
||||||
' Attivo gruppo PartProgTransferGpBx leggendo la variabile nel file ini
|
' Attivo gruppo PartProgTransferGpBx leggendo la variabile nel file ini
|
||||||
If GetPrivateProfileInt(S_GENERAL, K_TESTINGPAGE, 0, m_MainWindow.GetIniFile()) = 1 Then
|
If GetPrivateProfileInt(S_GENERAL, K_TESTINGPAGE, 0, m_MainWindow.GetIniFile()) = 1 Then
|
||||||
PartProgTransferGpBx.Visibility = Windows.Visibility.Visible
|
PartProgTransferGpBx.Visibility = Windows.Visibility.Visible
|
||||||
@@ -44,6 +45,28 @@ Public Class MachineCNPageUC
|
|||||||
Else
|
Else
|
||||||
PowerGpBx.Visibility = Visibility.Collapsed
|
PowerGpBx.Visibility = Visibility.Collapsed
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
' verifico che sia attiva la modalità per l'uso di due fotocamere
|
||||||
|
If GetPrivateProfileInt(S_CAMERAHQ, K_CAMERAHQ_ENABLE, 0, m_MainWindow.GetMachIniFile()) = 1 Then
|
||||||
|
CameraHQ.Visibility = Visibility.Visible
|
||||||
|
CameraHQ.Header = "Photo on table"
|
||||||
|
CameraHQBtn.Content = "HQ"
|
||||||
|
' verifico quale camera è impostata
|
||||||
|
If GetPrivateProfileInt(S_CAMERAHQ, K_CAMERAHQ_ACTIVATE, 0, m_MainWindow.GetMachIniFile()) = 1 Then
|
||||||
|
CameraHQBtn.IsChecked = True
|
||||||
|
If Not IsNothing(m_MainWindow.m_CadCutPageUC.PhotoIMG) Then
|
||||||
|
m_MainWindow.m_CadCutPageUC.PhotoIMG.Source = New System.Windows.Media.Imaging.BitmapImage(New Uri("/Resources/NewIcons/icone-tagli-1HQ.png", UriKind.Relative))
|
||||||
|
End If
|
||||||
|
Else
|
||||||
|
CameraHQBtn.IsChecked = False
|
||||||
|
If Not IsNothing(m_MainWindow.m_CadCutPageUC.PhotoIMG) Then
|
||||||
|
m_MainWindow.m_CadCutPageUC.PhotoIMG.Source = New System.Windows.Media.Imaging.BitmapImage(New Uri("/Resources/NewIcons/icone-tagli-1.png", UriKind.Relative))
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
Else
|
||||||
|
CameraHQ.Visibility = Visibility.Collapsed
|
||||||
|
End If
|
||||||
|
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Sub TestingPage_Loaded(sender As Object, e As RoutedEventArgs) Handles Me.Loaded
|
Private Sub TestingPage_Loaded(sender As Object, e As RoutedEventArgs) Handles Me.Loaded
|
||||||
@@ -203,6 +226,20 @@ Public Class MachineCNPageUC
|
|||||||
m_CN.DGeneralFunctions_WriteCncMode(8)
|
m_CN.DGeneralFunctions_WriteCncMode(8)
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
|
Private Sub CameraHQBtn_Click(sender As Object, e As RoutedEventArgs) Handles CameraHQBtn.Click
|
||||||
|
Dim sEnableHQ As String = If(CameraHQBtn.IsChecked, "1", "0")
|
||||||
|
WritePrivateProfileString(S_CAMERAHQ, K_CAMERAHQ_ACTIVATE, sEnableHQ, m_MainWindow.GetMachIniFile())
|
||||||
|
If CameraHQBtn.IsChecked Then
|
||||||
|
If Not IsNothing(m_MainWindow.m_CadCutPageUC.PhotoIMG) Then
|
||||||
|
m_MainWindow.m_CadCutPageUC.PhotoIMG.Source = New System.Windows.Media.Imaging.BitmapImage(New Uri("/Resources/NewIcons/icone-tagli-1HQ.png", UriKind.Relative))
|
||||||
|
End If
|
||||||
|
Else
|
||||||
|
If Not IsNothing(m_MainWindow.m_CadCutPageUC.PhotoIMG) Then
|
||||||
|
m_MainWindow.m_CadCutPageUC.PhotoIMG.Source = New System.Windows.Media.Imaging.BitmapImage(New Uri("/Resources/NewIcons/icone-tagli-1.png", UriKind.Relative))
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
End Sub
|
||||||
|
|
||||||
Private Sub MDITxBx_KeyDown(sender As Object, e As KeyEventArgs) Handles MDITxBx.KeyDown
|
Private Sub MDITxBx_KeyDown(sender As Object, e As KeyEventArgs) Handles MDITxBx.KeyDown
|
||||||
If e.Key = Key.Return Then
|
If e.Key = Key.Return Then
|
||||||
' leggo se stato reset
|
' leggo se stato reset
|
||||||
|
|||||||
+52
-38
@@ -324,13 +324,13 @@ Class MainWindow
|
|||||||
Dim sNestKey As String = ""
|
Dim sNestKey As String = ""
|
||||||
EgtUILib.GetPrivateProfileString(S_LICENCE, K_NESTKEY, "", sNestKey, sLicFile)
|
EgtUILib.GetPrivateProfileString(S_LICENCE, K_NESTKEY, "", sNestKey, sLicFile)
|
||||||
EgtSetNestKey(sNestKey)
|
EgtSetNestKey(sNestKey)
|
||||||
Dim bNetHwKey As Boolean = ( GetPrivateProfileInt(S_GENERAL, K_NETKEY, 0, m_sIniFile) = 1)
|
Dim bNetHwKey As Boolean = (GetPrivateProfileInt(S_GENERAL, K_NETKEY, 0, m_sIniFile) = 1)
|
||||||
EgtSetNetHwKey( bNetHwKey)
|
EgtSetNetHwKey(bNetHwKey)
|
||||||
' Verifico abilitazione nesting automatico
|
' Verifico abilitazione nesting automatico
|
||||||
m_bAutoNest = Not String.IsNullOrWhiteSpace(sNestKey)
|
m_bAutoNest = Not String.IsNullOrWhiteSpace(sNestKey)
|
||||||
' Recupero opzioni della chiave
|
' Recupero opzioni della chiave
|
||||||
Dim bKey As Boolean = EgtGetKeyLevel(9423, 2506, 1, m_nKeyLevel) And
|
Dim bKey As Boolean = EgtGetKeyLevel(9423, 2508, 1, m_nKeyLevel) And
|
||||||
EgtGetKeyOptions(9423, 2506, 1, m_nKeyOptions)
|
EgtGetKeyOptions(9423, 2508, 1, m_nKeyOptions)
|
||||||
' Verifico abilitazione prodotto
|
' Verifico abilitazione prodotto
|
||||||
Dim bProd As Boolean = GetKeyOption(KEY_OPT.CUT_BASE)
|
Dim bProd As Boolean = GetKeyOption(KEY_OPT.CUT_BASE)
|
||||||
' Inizializzazione generale di EgtInterface
|
' Inizializzazione generale di EgtInterface
|
||||||
@@ -440,7 +440,7 @@ Class MainWindow
|
|||||||
|
|
||||||
' abilito il bottone per la gestione del comando di Check-Up-Start (posziona lama prelavorazione)
|
' abilito il bottone per la gestione del comando di Check-Up-Start (posziona lama prelavorazione)
|
||||||
If GetPrivateProfileInt(S_GENERAL, "Test", "0", m_sIniFile) = 0 OrElse
|
If GetPrivateProfileInt(S_GENERAL, "Test", "0", m_sIniFile) = 0 OrElse
|
||||||
Not File.Exists( m_CurrentMachine.sMachDir() & "\DirectCmd\TestWork.lua") Then
|
Not File.Exists(m_CurrentMachine.sMachDir() & "\DirectCmd\TestWork.lua") Then
|
||||||
m_CadCutPageUC.m_ProjectMgr.TestBtn.Visibility = Visibility.Collapsed
|
m_CadCutPageUC.m_ProjectMgr.TestBtn.Visibility = Visibility.Collapsed
|
||||||
Else
|
Else
|
||||||
m_CadCutPageUC.m_ProjectMgr.TestBtn.Visibility = Visibility.Visible
|
m_CadCutPageUC.m_ProjectMgr.TestBtn.Visibility = Visibility.Visible
|
||||||
@@ -554,11 +554,11 @@ Class MainWindow
|
|||||||
|
|
||||||
' è permessa una sola istanza alla volta del programma OmagCUT -> "(1)" : "(" & nIstance.ToString & ")"
|
' è permessa una sola istanza alla volta del programma OmagCUT -> "(1)" : "(" & nIstance.ToString & ")"
|
||||||
EgtPHOTOLib.MainData.SetUser(Environment.MachineName & "\" & Environment.UserName & " (1)")
|
EgtPHOTOLib.MainData.SetUser(Environment.MachineName & "\" & Environment.UserName & " (1)")
|
||||||
Dim sIdKey As String = String.Empty
|
Dim sIdKey As String = String.Empty
|
||||||
EgtGetKeyInfo(sIdKey)
|
EgtGetKeyInfo(sIdKey)
|
||||||
EgtPHOTOLib.MainData.SetKey(sIdKey)
|
EgtPHOTOLib.MainData.SetKey(sIdKey)
|
||||||
End If
|
|
||||||
End If
|
End If
|
||||||
|
End If
|
||||||
End If
|
End If
|
||||||
' --------------------------------- SLAB DB -------------------------------------------------------
|
' --------------------------------- SLAB DB -------------------------------------------------------
|
||||||
ExitBtn.ToolTip = "Exit" & vbCrLf & "Minimize (Shift)"
|
ExitBtn.ToolTip = "Exit" & vbCrLf & "Minimize (Shift)"
|
||||||
@@ -998,6 +998,16 @@ Class MainWindow
|
|||||||
' Se già visualizzato errore, lo nascondo
|
' Se già visualizzato errore, lo nascondo
|
||||||
If m_CurrentProjectPageUC.OutMessageBrd.IsMouseOver Then
|
If m_CurrentProjectPageUC.OutMessageBrd.IsMouseOver Then
|
||||||
m_CurrentProjectPageUC.ClearMessage()
|
m_CurrentProjectPageUC.ClearMessage()
|
||||||
|
' se è premuto il pulsante Shift allora provvedo ad aprire il file di Log
|
||||||
|
If Keyboard.Modifiers And ModifierKeys.Shift Then
|
||||||
|
' Genero file CNC (lancio anche se errore in precedenza)
|
||||||
|
Dim sTemoDirect As String = GetTempDir() & "\OmagCUTLog.txt"
|
||||||
|
Try
|
||||||
|
Process.Start("Notepad.exe", sTemoDirect)
|
||||||
|
Catch ex As Exception
|
||||||
|
EgtOutLog(ex.ToString)
|
||||||
|
End Try
|
||||||
|
End If
|
||||||
End If
|
End If
|
||||||
' Condizioni che impediscono di clickare fuori dalla calcolatrice o tastiera quando una di queste è aperta
|
' Condizioni che impediscono di clickare fuori dalla calcolatrice o tastiera quando una di queste è aperta
|
||||||
If EgtWPFLib.EgtCalculator.GetbIsActive Then
|
If EgtWPFLib.EgtCalculator.GetbIsActive Then
|
||||||
@@ -1088,9 +1098,9 @@ Class MainWindow
|
|||||||
m_CurrentProjectPageUC.SaveNamedProject()
|
m_CurrentProjectPageUC.SaveNamedProject()
|
||||||
m_CurrentProjectPageUC.SaveProject()
|
m_CurrentProjectPageUC.SaveProject()
|
||||||
End If
|
End If
|
||||||
' Inizio la chiusura del programma (verifico di aver terminato il processo DripFeed)
|
' Inizio la chiusura del programma (se NUM_OLD verifico di aver terminato il processo DripFeed)
|
||||||
EgtOutLog("Iniziato processo di chiusura programma")
|
EgtOutLog("Iniziato processo di chiusura programma")
|
||||||
m_IsClosingApplication = 1
|
m_IsClosingApplication = If( m_CNCommunication.m_nNCType = 1, 1, 2)
|
||||||
Dim nCount As Integer = 0
|
Dim nCount As Integer = 0
|
||||||
While m_IsClosingApplication <> 2
|
While m_IsClosingApplication <> 2
|
||||||
If nCount > 5 Then
|
If nCount > 5 Then
|
||||||
@@ -1217,7 +1227,7 @@ Class MainWindow
|
|||||||
Private Sub MainWindow_ContentRendered(sender As Object, e As EventArgs) Handles Me.ContentRendered
|
Private Sub MainWindow_ContentRendered(sender As Object, e As EventArgs) Handles Me.ContentRendered
|
||||||
' Verifico presenza del collegamento al CN
|
' Verifico presenza del collegamento al CN
|
||||||
m_bNCLink = (GetPrivateProfileInt(S_GENERAL, K_CNLINK, 0, m_sIniFile) <> 0) And
|
m_bNCLink = (GetPrivateProfileInt(S_GENERAL, K_CNLINK, 0, m_sIniFile) <> 0) And
|
||||||
Not GetKeyOption( KEY_OPT.OFFICE_TYPE)
|
Not GetKeyOption(KEY_OPT.OFFICE_TYPE)
|
||||||
m_CNCommunication.CNCommunication_Initialization()
|
m_CNCommunication.CNCommunication_Initialization()
|
||||||
' Se linea di produzione abilitata e collegata, lancio relativo timer
|
' Se linea di produzione abilitata e collegata, lancio relativo timer
|
||||||
If m_bNCLink And m_CurrentMachine.bProdLine Then
|
If m_bNCLink And m_CurrentMachine.bProdLine Then
|
||||||
@@ -1294,7 +1304,9 @@ Class MainWindow
|
|||||||
m_CNCommunication.m_CN.ReadEls_Add_Parameter(m_CurrentMachine.sVarProjFinished, 1)
|
m_CNCommunication.m_CN.ReadEls_Add_Parameter(m_CurrentMachine.sVarProjFinished, 1)
|
||||||
Dim nVarFin As Integer = 0
|
Dim nVarFin As Integer = 0
|
||||||
For I As Integer = 1 To 4
|
For I As Integer = 1 To 4
|
||||||
System.Threading.Thread.Sleep(50)
|
If Not m_CurrentMachine.bDemo Then
|
||||||
|
System.Threading.Thread.Sleep(50)
|
||||||
|
End If
|
||||||
If m_CNCommunication.m_CN.n_DReadELS_handle = 1 Then
|
If m_CNCommunication.m_CN.n_DReadELS_handle = 1 Then
|
||||||
nVarFin = CInt(m_CNCommunication.m_CN.d_DReadELS_value)
|
nVarFin = CInt(m_CNCommunication.m_CN.d_DReadELS_value)
|
||||||
Exit For
|
Exit For
|
||||||
@@ -1307,11 +1319,11 @@ Class MainWindow
|
|||||||
' Salvo in INI indice del progetto terminato
|
' Salvo in INI indice del progetto terminato
|
||||||
WritePrivateProfileString(S_GENERAL, K_LASTPROJFINISHED, nVarFin.ToString("D4"), GetIniFile())
|
WritePrivateProfileString(S_GENERAL, K_LASTPROJFINISHED, nVarFin.ToString("D4"), GetIniFile())
|
||||||
' Salvo in INI data e ora attuali di termine lavorazione del progetto (solo gli ultimi 10 tramite modulo)
|
' Salvo in INI data e ora attuali di termine lavorazione del progetto (solo gli ultimi 10 tramite modulo)
|
||||||
Dim sKey As String = K_DATETIMEFINISHED & "." & ( nVarFin Mod 10).ToString()
|
Dim sKey As String = K_DATETIMEFINISHED & "." & (nVarFin Mod 10).ToString()
|
||||||
Dim sDateTime As String = My.Computer.Clock.LocalTime.ToString("dd.MM.yyyy HH\:mm\:ss")
|
Dim sDateTime As String = My.Computer.Clock.LocalTime.ToString("dd.MM.yyyy HH\:mm\:ss")
|
||||||
WritePrivateProfileString(S_GENERAL, sKey, sDateTime, GetIniFile())
|
WritePrivateProfileString(S_GENERAL, sKey, sDateTime, GetIniFile())
|
||||||
' Eseguo script
|
' Eseguo script
|
||||||
ExecFinishedProgScript( nVarFin, sDateTime)
|
ExecFinishedProgScript(nVarFin, sDateTime)
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
' Se OmagVIEW blocca, esco (riproverò al prossimo giro)
|
' Se OmagVIEW blocca, esco (riproverò al prossimo giro)
|
||||||
@@ -1347,16 +1359,18 @@ Class MainWindow
|
|||||||
' Se richieste modalità standard o speciali
|
' Se richieste modalità standard o speciali
|
||||||
If m_CurrentMachine.nSaveProduced <> 3 Then
|
If m_CurrentMachine.nSaveProduced <> 3 Then
|
||||||
StandardAndSpecialViewFileManagement()
|
StandardAndSpecialViewFileManagement()
|
||||||
' altrimenti modalità custom
|
' altrimenti modalità custom
|
||||||
Else
|
Else
|
||||||
CustomViewFileManagement( nProjInd)
|
CustomViewFileManagement(nProjInd)
|
||||||
End If
|
End If
|
||||||
' Leggo variabile con indice progetto da copiare per OmagVIEW (standard E80025)
|
' Leggo variabile con indice progetto da copiare per OmagVIEW (standard E80025)
|
||||||
m_CNCommunication.m_CN.n_DReadELS_handle = 0
|
m_CNCommunication.m_CN.n_DReadELS_handle = 0
|
||||||
m_CNCommunication.m_CN.ReadEls_Add_Parameter(m_CurrentMachine.sVarProjCopy, 1)
|
m_CNCommunication.m_CN.ReadEls_Add_Parameter(m_CurrentMachine.sVarProjCopy, 1)
|
||||||
Dim nVarCopy As Integer = 0
|
Dim nVarCopy As Integer = 0
|
||||||
For I As Integer = 1 To 10
|
For I As Integer = 1 To 10
|
||||||
System.Threading.Thread.Sleep(50)
|
If Not m_CurrentMachine.bDemo Then
|
||||||
|
System.Threading.Thread.Sleep(50)
|
||||||
|
End If
|
||||||
If m_CNCommunication.m_CN.n_DReadELS_handle = 1 Then
|
If m_CNCommunication.m_CN.n_DReadELS_handle = 1 Then
|
||||||
nVarCopy = CInt(m_CNCommunication.m_CN.d_DReadELS_value)
|
nVarCopy = CInt(m_CNCommunication.m_CN.d_DReadELS_value)
|
||||||
Exit For
|
Exit For
|
||||||
@@ -1557,7 +1571,7 @@ Class MainWindow
|
|||||||
nNewProjInd -= 1
|
nNewProjInd -= 1
|
||||||
End While
|
End While
|
||||||
End If
|
End If
|
||||||
' se altrimenti richiesto progetto successivo
|
' se altrimenti richiesto progetto successivo
|
||||||
ElseIf nMove > 0 Then
|
ElseIf nMove > 0 Then
|
||||||
nNewProjInd = nProjInd + 1
|
nNewProjInd = nProjInd + 1
|
||||||
If nProjInd > nLastProj Then
|
If nProjInd > nLastProj Then
|
||||||
@@ -1658,7 +1672,7 @@ Class MainWindow
|
|||||||
Catch ex As Exception
|
Catch ex As Exception
|
||||||
EgtOutLog("Error erasing " & sDestEplFile)
|
EgtOutLog("Error erasing " & sDestEplFile)
|
||||||
End Try
|
End Try
|
||||||
' altrimenti, ogni commessa ha il suo file dei pezzi rovinati
|
' altrimenti, ogni commessa ha il suo file dei pezzi rovinati
|
||||||
Else
|
Else
|
||||||
' Sposto nel direttorio temporaneo
|
' Sposto nel direttorio temporaneo
|
||||||
Dim sDestEplFile = m_sTempDir & "\" & CURR_PROJ_EPL
|
Dim sDestEplFile = m_sTempDir & "\" & CURR_PROJ_EPL
|
||||||
@@ -1768,7 +1782,7 @@ Class MainWindow
|
|||||||
Return True
|
Return True
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
Private Function CustomViewFileManagement( nProjInd As Integer) As Boolean
|
Private Function CustomViewFileManagement(nProjInd As Integer) As Boolean
|
||||||
' Se non esiste file EPL, esco
|
' Se non esiste file EPL, esco
|
||||||
Dim sSouEplFile As String = m_CurrentMachine.sLineDataDir & "\" & CURR_PROJ_EPL
|
Dim sSouEplFile As String = m_CurrentMachine.sLineDataDir & "\" & CURR_PROJ_EPL
|
||||||
If Not My.Computer.FileSystem.FileExists(sSouEplFile) Then Return True
|
If Not My.Computer.FileSystem.FileExists(sSouEplFile) Then Return True
|
||||||
@@ -1807,7 +1821,7 @@ Class MainWindow
|
|||||||
' Verifico progetto restituito da View
|
' Verifico progetto restituito da View
|
||||||
If nProjInd = 0 Then nProjInd = nLastCopy
|
If nProjInd = 0 Then nProjInd = nLastCopy
|
||||||
' Leggo variabile con data termine lavorazione
|
' Leggo variabile con data termine lavorazione
|
||||||
Dim sKey As String = K_DATETIMEFINISHED & "." & ( nProjInd Mod 10).ToString()
|
Dim sKey As String = K_DATETIMEFINISHED & "." & (nProjInd Mod 10).ToString()
|
||||||
GetPrivateProfileString(S_GENERAL, sKey, sDateTime, sDateTime, GetIniFile())
|
GetPrivateProfileString(S_GENERAL, sKey, sDateTime, sDateTime, GetIniFile())
|
||||||
' Recupero direttorio per pezzi rovinati
|
' Recupero direttorio per pezzi rovinati
|
||||||
Dim sRuPartsDir As String = GetRuinedPartsDir()
|
Dim sRuPartsDir As String = GetRuinedPartsDir()
|
||||||
@@ -1834,7 +1848,7 @@ Class MainWindow
|
|||||||
Return True
|
Return True
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
Friend Function ExecSentProgScript( bDirectCut As Boolean, Optional bAlreadySent As Boolean = False) As Boolean
|
Friend Function ExecSentProgScript(bDirectCut As Boolean, Optional bAlreadySent As Boolean = False) As Boolean
|
||||||
' Verifico esistenza script
|
' Verifico esistenza script
|
||||||
Dim sLuaPath As String = m_CurrentMachine.sMachDir() & "\Scripts\SentProg.lua"
|
Dim sLuaPath As String = m_CurrentMachine.sMachDir() & "\Scripts\SentProg.lua"
|
||||||
If Not My.Computer.FileSystem.FileExists(sLuaPath) Then Return True
|
If Not My.Computer.FileSystem.FileExists(sLuaPath) Then Return True
|
||||||
@@ -1853,8 +1867,8 @@ Class MainWindow
|
|||||||
End If
|
End If
|
||||||
EgtLuaResetGlobVar("SPS")
|
EgtLuaResetGlobVar("SPS")
|
||||||
If nErr <> 0 Then
|
If nErr <> 0 Then
|
||||||
EgtOutLog("Error in SentProg : " & nErr.ToString())
|
EgtOutLog("Error in SentProg : " & nErr.ToString())
|
||||||
m_CurrentProjectPageUC.SetErrorMessage(EgtMsg(90325)) 'Errore nel salvataggio delle statistiche
|
m_CurrentProjectPageUC.SetErrorMessage(EgtMsg(90325)) 'Errore nel salvataggio delle statistiche
|
||||||
End If
|
End If
|
||||||
Return (nErr = 0)
|
Return (nErr = 0)
|
||||||
End Function
|
End Function
|
||||||
@@ -1936,15 +1950,15 @@ Class MainWindow
|
|||||||
End If
|
End If
|
||||||
' Dichiaro progetto passato da View
|
' Dichiaro progetto passato da View
|
||||||
If nProjInd = m_CurrentProjectPageUC.GetCurrentProject() Then
|
If nProjInd = m_CurrentProjectPageUC.GetCurrentProject() Then
|
||||||
EgtSetInfo( EgtGetFirstNameInGroup(GDB_ID.ROOT, NAME_PROJMARK), INFO_UNLOADSAVED, 1)
|
EgtSetInfo(EgtGetFirstNameInGroup(GDB_ID.ROOT, NAME_PROJMARK), INFO_UNLOADSAVED, 1)
|
||||||
Else
|
Else
|
||||||
Dim nTmpCtx As Integer = EgtInitContext()
|
Dim nTmpCtx As Integer = EgtInitContext()
|
||||||
If nTmpCtx <> 0 Then
|
If nTmpCtx <> 0 Then
|
||||||
Dim sNgeFile As String = GetSaveDir() & "\" & nProjInd.ToString("D4") & ".nge"
|
Dim sNgeFile As String = GetSaveDir() & "\" & nProjInd.ToString("D4") & ".nge"
|
||||||
EgtOpenFile( sNgeFile)
|
EgtOpenFile(sNgeFile)
|
||||||
EgtSetInfo( EgtGetFirstNameInGroup(GDB_ID.ROOT, NAME_PROJMARK), INFO_UNLOADSAVED, 1)
|
EgtSetInfo(EgtGetFirstNameInGroup(GDB_ID.ROOT, NAME_PROJMARK), INFO_UNLOADSAVED, 1)
|
||||||
EgtSaveFile( sNgeFile, NGE.CMPTEXT)
|
EgtSaveFile(sNgeFile, NGE.CMPTEXT)
|
||||||
EgtDeleteContext( nTmpCtx)
|
EgtDeleteContext(nTmpCtx)
|
||||||
EgtSetCurrentContext(m_CurrentProjectPageUC.CurrentProjectScene.GetCtx())
|
EgtSetCurrentContext(m_CurrentProjectPageUC.CurrentProjectScene.GetCtx())
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
@@ -1978,21 +1992,21 @@ Class MainWindow
|
|||||||
' Evento che apre AboutBox quando viene clickato il logo
|
' Evento che apre AboutBox quando viene clickato il logo
|
||||||
Private Sub LogoBrd_MouseDown(sender As Object, e As MouseButtonEventArgs) Handles LogoBrd.MouseDown
|
Private Sub LogoBrd_MouseDown(sender As Object, e As MouseButtonEventArgs) Handles LogoBrd.MouseDown
|
||||||
' Se non premuto Shift -> AboutBox
|
' Se non premuto Shift -> AboutBox
|
||||||
If ( Keyboard.Modifiers And ModifierKeys.Shift) = 0 Then
|
If (Keyboard.Modifiers And ModifierKeys.Shift) = 0 Then
|
||||||
Dim AboutBox As New AboutBoxWD( Me)
|
Dim AboutBox As New AboutBoxWD(Me)
|
||||||
' Altrimenti lancio cambio macchina (solo uso interno)
|
' Altrimenti lancio cambio macchina (solo uso interno)
|
||||||
Else
|
Else
|
||||||
If m_ActivePage = Pages.CadCut Or m_ActivePage = Pages.FrameCut Then
|
If m_ActivePage = Pages.CadCut Or m_ActivePage = Pages.FrameCut Then
|
||||||
' Cambio macchina
|
' Cambio macchina
|
||||||
EgtLuaCreateGlobTable( "CHM")
|
EgtLuaCreateGlobTable("CHM")
|
||||||
EgtLuaExecFile( GetConfigDir() & "\ChangeMachine.lua")
|
EgtLuaExecFile(GetConfigDir() & "\ChangeMachine.lua")
|
||||||
Dim nRestart As Integer = 0
|
Dim nRestart As Integer = 0
|
||||||
EgtLuaGetGlobIntVar( "CHM.RESTART", nRestart)
|
EgtLuaGetGlobIntVar("CHM.RESTART", nRestart)
|
||||||
EgtLuaResetGlobVar( "CHM")
|
EgtLuaResetGlobVar("CHM")
|
||||||
' Riavvio
|
' Riavvio
|
||||||
If nRestart = 1 Then
|
If nRestart = 1 Then
|
||||||
Close()
|
Close()
|
||||||
Process.Start( Application.ResourceAssembly.Location)
|
Process.Start(Application.ResourceAssembly.Location)
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
|
|||||||
@@ -62,5 +62,5 @@ Imports System.Windows
|
|||||||
' by using the '*' as shown below:
|
' by using the '*' as shown below:
|
||||||
' <Assembly: AssemblyVersion("1.0.*")>
|
' <Assembly: AssemblyVersion("1.0.*")>
|
||||||
|
|
||||||
<Assembly: AssemblyVersion("2.5.6.2")>
|
<Assembly: AssemblyVersion("2.5.8.1")>
|
||||||
<Assembly: AssemblyFileVersion("2.5.6.2")>
|
<Assembly: AssemblyFileVersion("2.5.8.1")>
|
||||||
|
|||||||
@@ -515,7 +515,9 @@ Public Class CNCommunication
|
|||||||
If nClickState = 1 Then
|
If nClickState = 1 Then
|
||||||
' procedo a costruire un nuovo file nella cartella indicata in configurazione
|
' procedo a costruire un nuovo file nella cartella indicata in configurazione
|
||||||
Try
|
Try
|
||||||
File.Create(m_MainWindow.m_CurrentMachine.sClickDir & "\NewClick.txt")
|
Dim fs As FileStream = File.Create(m_MainWindow.m_CurrentMachine.sClickDir & "\NewClick.txt")
|
||||||
|
' chiudo il file creato
|
||||||
|
fs.Close()
|
||||||
' Dichiaro di aver provveduto a comunicare di scattare la foto
|
' Dichiaro di aver provveduto a comunicare di scattare la foto
|
||||||
m_CN.DVariables_WriteVariables2(m_MainWindow.m_CurrentMachine.sClickState, "0")
|
m_CN.DVariables_WriteVariables2(m_MainWindow.m_CurrentMachine.sClickState, "0")
|
||||||
Catch ex As Exception
|
Catch ex As Exception
|
||||||
@@ -1165,7 +1167,8 @@ Public Class CNCommunication
|
|||||||
bOk = (m_nNCType > 0)
|
bOk = (m_nNCType > 0)
|
||||||
Dim sNumProg As String = String.Empty
|
Dim sNumProg As String = String.Empty
|
||||||
If m_nNCType = 1 Or m_nNCType = 2 Then
|
If m_nNCType = 1 Or m_nNCType = 2 Then
|
||||||
sNumProg = "%" & nNumProg.ToString() & ".0"
|
Dim sExtFileCN As String = m_MainWindow.m_CurrentMachine.sExtFileCN
|
||||||
|
sNumProg = "%" & nNumProg.ToString() & sExtFileCN
|
||||||
Else
|
Else
|
||||||
sNumProg = nNumProg.ToString()
|
sNumProg = nNumProg.ToString()
|
||||||
End If
|
End If
|
||||||
|
|||||||
@@ -144,7 +144,7 @@ Public Class CN_Siemens
|
|||||||
End Select
|
End Select
|
||||||
Else
|
Else
|
||||||
' per verificare che la comunicazione funzioni correttamente
|
' per verificare che la comunicazione funzioni correttamente
|
||||||
EgtOutLog("Modo -read_active_mode-: " & M_MMFiles.SiemensRet.n_param2.ToString)
|
' EgtOutLog("Modo -read_active_mode-: " & M_MMFiles.SiemensRet.n_param2.ToString)
|
||||||
Return M_MMFiles.read_active_mode()
|
Return M_MMFiles.read_active_mode()
|
||||||
'Return CShort(M_MMFiles.SiemensRet.n_param2)
|
'Return CShort(M_MMFiles.SiemensRet.n_param2)
|
||||||
End If
|
End If
|
||||||
|
|||||||
@@ -1340,6 +1340,18 @@
|
|||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Resource Include="Resources\NewIcons\RefTab.png" />
|
<Resource Include="Resources\NewIcons\RefTab.png" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Resource Include="Resources\PhotoHQ.png" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Resource Include="Resources\NewIcons\icone-tagli-1HQ.png" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Resource Include="Resources\ImportPageListBoxImages\4.png" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Resource Include="Resources\ImportPageListBoxImages\5.png" />
|
||||||
|
</ItemGroup>
|
||||||
<Import Project="$(MSBuildToolsPath)\Microsoft.VisualBasic.targets" />
|
<Import Project="$(MSBuildToolsPath)\Microsoft.VisualBasic.targets" />
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<PostBuildEvent>IF "$(PlatformName)"=="x86" IF "$(ConfigurationName)" == "Release" copy $(TargetPath) c:\EgtProg\OmagCUT\OmagCUTR32.exe
|
<PostBuildEvent>IF "$(PlatformName)"=="x86" IF "$(ConfigurationName)" == "Release" copy $(TargetPath) c:\EgtProg\OmagCUT\OmagCUTR32.exe
|
||||||
|
|||||||
@@ -1400,7 +1400,8 @@ Public Class CurrentProjectPageUC
|
|||||||
|
|
||||||
Friend Sub ClearMessage()
|
Friend Sub ClearMessage()
|
||||||
OutMessageBrd.Background = Brushes.Transparent
|
OutMessageBrd.Background = Brushes.Transparent
|
||||||
OutMessageBrd.Visibility = Windows.Visibility.Hidden
|
OutMessageTxBl.Text = ""
|
||||||
|
'OutMessageBrd.Visibility = Windows.Visibility.Hidden
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
End Class
|
End Class
|
||||||
|
|||||||
@@ -517,7 +517,6 @@ Public Class ProjectMgrUC
|
|||||||
' apro la finestra con l'elenco degli sfridi
|
' apro la finestra con l'elenco degli sfridi
|
||||||
Dim MyScrapsWD As New ScrapsWD(m_MainWindow, Me, NewScrapsList)
|
Dim MyScrapsWD As New ScrapsWD(m_MainWindow, Me, NewScrapsList)
|
||||||
MyScrapsWD.ShowDialog()
|
MyScrapsWD.ShowDialog()
|
||||||
|
|
||||||
End If
|
End If
|
||||||
' ------------------ FINE gestione SCRAPS -----------------------------
|
' ------------------ FINE gestione SCRAPS -----------------------------
|
||||||
|
|
||||||
@@ -587,6 +586,13 @@ Public Class ProjectMgrUC
|
|||||||
EgtDraw()
|
EgtDraw()
|
||||||
' Dichiaro che il progetto è nuovo
|
' Dichiaro che il progetto è nuovo
|
||||||
bAlreadySent = False
|
bAlreadySent = False
|
||||||
|
' reimposto tutti gli sfridi come nuovi sfridi
|
||||||
|
Dim CurrScrapsList As New List(Of Scrap)
|
||||||
|
' procedo all'aggiornamento della lista degli sfridi
|
||||||
|
UpDateScrapList(CurrScrapsList)
|
||||||
|
For Each ItemScrap As Scrap In CurrScrapsList
|
||||||
|
ItemScrap.ResetState()
|
||||||
|
Next
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
If bAlreadySent Then
|
If bAlreadySent Then
|
||||||
@@ -597,6 +603,18 @@ Public Class ProjectMgrUC
|
|||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
' ------------------ INIZIO gestione SCRAPS ---------------------------
|
||||||
|
Dim NewScrapsList As New List(Of Scrap)
|
||||||
|
' procedo all'aggiornamento della lista degli sfridi
|
||||||
|
UpDateScrapList(NewScrapsList)
|
||||||
|
' se esiste almeno uno sfrido da inserire come nuovo grezzo
|
||||||
|
If NewScrapsList.Count > 0 Then
|
||||||
|
' apro la finestra con l'elenco degli sfridi
|
||||||
|
Dim MyScrapsWD As New ScrapsWD(m_MainWindow, Me, NewScrapsList)
|
||||||
|
MyScrapsWD.ShowDialog()
|
||||||
|
End If
|
||||||
|
' ------------------ FINE gestione SCRAPS -----------------------------
|
||||||
|
|
||||||
' Se non collegato alla macchina
|
' Se non collegato alla macchina
|
||||||
If Not m_MainWindow.m_bNCLink Then
|
If Not m_MainWindow.m_bNCLink Then
|
||||||
' salvo il progetto corrente incrementando il valore del progetto
|
' salvo il progetto corrente incrementando il valore del progetto
|
||||||
@@ -964,6 +982,7 @@ Public Class ProjectMgrUC
|
|||||||
ResetCutBtn.Visibility = Windows.Visibility.Hidden
|
ResetCutBtn.Visibility = Windows.Visibility.Hidden
|
||||||
SimulateBtn.Visibility = Windows.Visibility.Hidden
|
SimulateBtn.Visibility = Windows.Visibility.Hidden
|
||||||
WorkBtn.Visibility = Windows.Visibility.Hidden
|
WorkBtn.Visibility = Windows.Visibility.Hidden
|
||||||
|
If TestBtn.Visibility = Windows.Visibility.Visible Then TestBtn.Visibility = Windows.Visibility.Hidden
|
||||||
' Nascondo bottoni CadCutPageUC
|
' Nascondo bottoni CadCutPageUC
|
||||||
m_MainWindow.m_CadCutPageUC.PhotoBtn.Visibility = Windows.Visibility.Hidden
|
m_MainWindow.m_CadCutPageUC.PhotoBtn.Visibility = Windows.Visibility.Hidden
|
||||||
m_MainWindow.m_CadCutPageUC.RawPartBtn.Visibility = Windows.Visibility.Hidden
|
m_MainWindow.m_CadCutPageUC.RawPartBtn.Visibility = Windows.Visibility.Hidden
|
||||||
@@ -979,6 +998,18 @@ Public Class ProjectMgrUC
|
|||||||
m_MainWindow.m_CadCutPageUC.m_NestPage.RemovePartBtn.Visibility = Windows.Visibility.Hidden
|
m_MainWindow.m_CadCutPageUC.m_NestPage.RemovePartBtn.Visibility = Windows.Visibility.Hidden
|
||||||
m_MainWindow.m_CadCutPageUC.m_NestPage.SelectAllBtn.Visibility = Windows.Visibility.Hidden
|
m_MainWindow.m_CadCutPageUC.m_NestPage.SelectAllBtn.Visibility = Windows.Visibility.Hidden
|
||||||
m_MainWindow.m_CadCutPageUC.m_NestPage.DeselectAllBtn.Visibility = Windows.Visibility.Hidden
|
m_MainWindow.m_CadCutPageUC.m_NestPage.DeselectAllBtn.Visibility = Windows.Visibility.Hidden
|
||||||
|
' nuovi bottoni pagina di Nesting
|
||||||
|
m_MainWindow.m_CadCutPageUC.m_NestPage.DragRettanleBtn.Visibility = Windows.Visibility.Hidden
|
||||||
|
If m_MainWindow.m_CadCutPageUC.m_NestPage.SplitCurveWJBtn.Visibility = Windows.Visibility.Visible Then
|
||||||
|
m_MainWindow.m_CadCutPageUC.m_NestPage.SplitCurveWJBtn.Visibility = Windows.Visibility.Hidden
|
||||||
|
End If
|
||||||
|
' Nascondo bottoni rawpage
|
||||||
|
m_MainWindow.m_RawPartPage.OtherRefTabBtn.Visibility = Windows.Visibility.Hidden
|
||||||
|
|
||||||
|
' Rendo visibili i bottoni per la definizione degli Spotreg
|
||||||
|
m_MainWindow.m_CadCutPageUC.m_NestPage.UG0_Reg.Visibility = Visibility.Visible
|
||||||
|
m_MainWindow.m_CadCutPageUC.m_NestPage.UG1_Reg.Visibility = Visibility.Visible
|
||||||
|
|
||||||
' Deseleziono tutto
|
' Deseleziono tutto
|
||||||
EgtDeselectAll()
|
EgtDeselectAll()
|
||||||
' Se c'è la foto devo sistemare
|
' Se c'è la foto devo sistemare
|
||||||
@@ -1010,6 +1041,12 @@ Public Class ProjectMgrUC
|
|||||||
End If
|
End If
|
||||||
' Visualizzo step adatti alla scelta fatta
|
' Visualizzo step adatti alla scelta fatta
|
||||||
m_MainWindow.m_CadCutPageUC.m_NestPage.UpdateStepsOnUI()
|
m_MainWindow.m_CadCutPageUC.m_NestPage.UpdateStepsOnUI()
|
||||||
|
|
||||||
|
' visualizzo i punti di SpotReg
|
||||||
|
EgtSetStatus(m_MainWindow.m_CadCutPageUC.m_NestPage.m_nRegGroupId, GDB_ST.ON_)
|
||||||
|
' eventualmente risistemo tutti i punti Spotreg in funzione dell'altezza del grezzo
|
||||||
|
m_MainWindow.m_CadCutPageUC.m_NestPage.UpdateSpotRegistration()
|
||||||
|
|
||||||
' Cancello eventuali messaggi di errore/avvertimento
|
' Cancello eventuali messaggi di errore/avvertimento
|
||||||
m_CurrProjPage.ClearMessage()
|
m_CurrProjPage.ClearMessage()
|
||||||
End Sub
|
End Sub
|
||||||
@@ -1039,6 +1076,7 @@ Public Class ProjectMgrUC
|
|||||||
m_MainWindow.m_CadCutPageUC.DrawBtn.Visibility = Windows.Visibility.Visible
|
m_MainWindow.m_CadCutPageUC.DrawBtn.Visibility = Windows.Visibility.Visible
|
||||||
m_MainWindow.m_CadCutPageUC.ImportBtn.Visibility = Windows.Visibility.Visible
|
m_MainWindow.m_CadCutPageUC.ImportBtn.Visibility = Windows.Visibility.Visible
|
||||||
m_MainWindow.m_CadCutPageUC.SplitBtn.Visibility = Windows.Visibility.Visible
|
m_MainWindow.m_CadCutPageUC.SplitBtn.Visibility = Windows.Visibility.Visible
|
||||||
|
If TestBtn.Visibility = Windows.Visibility.Hidden Then TestBtn.Visibility = Windows.Visibility.Visible
|
||||||
' Visualizzo bottoni nesting
|
' Visualizzo bottoni nesting
|
||||||
m_MainWindow.m_CadCutPageUC.m_NestPage.m_bRegister = False
|
m_MainWindow.m_CadCutPageUC.m_NestPage.m_bRegister = False
|
||||||
m_MainWindow.m_CadCutPageUC.m_NestPage.MaximizeMoveBtn.IsEnabled = True
|
m_MainWindow.m_CadCutPageUC.m_NestPage.MaximizeMoveBtn.IsEnabled = True
|
||||||
@@ -1048,6 +1086,22 @@ Public Class ProjectMgrUC
|
|||||||
m_MainWindow.m_CadCutPageUC.m_NestPage.RemovePartBtn.Visibility = Windows.Visibility.Visible
|
m_MainWindow.m_CadCutPageUC.m_NestPage.RemovePartBtn.Visibility = Windows.Visibility.Visible
|
||||||
m_MainWindow.m_CadCutPageUC.m_NestPage.SelectAllBtn.Visibility = Windows.Visibility.Visible
|
m_MainWindow.m_CadCutPageUC.m_NestPage.SelectAllBtn.Visibility = Windows.Visibility.Visible
|
||||||
m_MainWindow.m_CadCutPageUC.m_NestPage.DeselectAllBtn.Visibility = Windows.Visibility.Visible
|
m_MainWindow.m_CadCutPageUC.m_NestPage.DeselectAllBtn.Visibility = Windows.Visibility.Visible
|
||||||
|
' nuovi bottoni pagina di Nesting
|
||||||
|
m_MainWindow.m_CadCutPageUC.m_NestPage.DragRettanleBtn.Visibility = Windows.Visibility.Visible
|
||||||
|
If m_MainWindow.m_CadCutPageUC.m_NestPage.SplitCurveWJBtn.Visibility = Windows.Visibility.Hidden Then
|
||||||
|
m_MainWindow.m_CadCutPageUC.m_NestPage.SplitCurveWJBtn.Visibility = Windows.Visibility.Visible
|
||||||
|
End If
|
||||||
|
' disabilito i comandi per gestioen SpotReg
|
||||||
|
m_MainWindow.m_CadCutPageUC.m_NestPage.PointRegCheckedOff()
|
||||||
|
m_MainWindow.m_CadCutPageUC.m_NestPage.UG0_Reg.Visibility = Visibility.Hidden
|
||||||
|
m_MainWindow.m_CadCutPageUC.m_NestPage.UG1_Reg.Visibility = Visibility.Hidden
|
||||||
|
|
||||||
|
' Nascondo bottoni rawpage
|
||||||
|
m_MainWindow.m_RawPartPage.OtherRefTabBtn.Visibility = Windows.Visibility.Visible
|
||||||
|
|
||||||
|
' Nascondo i bottoni per la definizione degli Spotreg
|
||||||
|
m_MainWindow.m_CadCutPageUC.m_NestPage.UG0_Reg.Visibility = Visibility.Hidden
|
||||||
|
|
||||||
' Se c'è la foto devo sistemare
|
' Se c'è la foto devo sistemare
|
||||||
If m_CurrProjPage.GetPhoto() <> GDB_ID.NULL Then
|
If m_CurrProjPage.GetPhoto() <> GDB_ID.NULL Then
|
||||||
' Recupero il riferimento originale del primo grezzo
|
' Recupero il riferimento originale del primo grezzo
|
||||||
@@ -1092,6 +1146,11 @@ Public Class ProjectMgrUC
|
|||||||
End If
|
End If
|
||||||
' Visualizzo step adatti alla scelta fatta
|
' Visualizzo step adatti alla scelta fatta
|
||||||
m_MainWindow.m_CadCutPageUC.m_NestPage.UpdateStepsOnUI()
|
m_MainWindow.m_CadCutPageUC.m_NestPage.UpdateStepsOnUI()
|
||||||
|
|
||||||
|
' nascondi i punti di SpotReg
|
||||||
|
EgtSetStatus(m_MainWindow.m_CadCutPageUC.m_NestPage.m_nRegGroupId, GDB_ST.OFF)
|
||||||
|
EgtDraw()
|
||||||
|
|
||||||
' Cancello eventuali messaggi di errore/avvertimento
|
' Cancello eventuali messaggi di errore/avvertimento
|
||||||
m_CurrProjPage.ClearMessage()
|
m_CurrProjPage.ClearMessage()
|
||||||
End Sub
|
End Sub
|
||||||
@@ -1103,6 +1162,7 @@ Public Class Scrap
|
|||||||
Private m_iPictureID As Integer
|
Private m_iPictureID As Integer
|
||||||
Private m_sName As String
|
Private m_sName As String
|
||||||
Private m_IdRaw As Integer
|
Private m_IdRaw As Integer
|
||||||
|
' nState=1 -> da inserire in DB, nState=2 -> già inserito in DB
|
||||||
Private m_nState As Integer
|
Private m_nState As Integer
|
||||||
|
|
||||||
Public Property PictureID() As Integer
|
Public Property PictureID() As Integer
|
||||||
@@ -1135,9 +1195,16 @@ Public Class Scrap
|
|||||||
End Get
|
End Get
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
Public ReadOnly Property PictureString() As String
|
Public Sub ResetState(Optional nNewState As Integer = 1)
|
||||||
|
m_nState = nNewState
|
||||||
|
EgtSetInfo(m_IdRaw, K_ISNEWSCRAPS, nNewState)
|
||||||
|
EgtRemoveInfo(m_IdRaw, K_DATABASEID)
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Public ReadOnly Property PreviewState As System.Windows.Media.Imaging.BitmapImage
|
||||||
Get
|
Get
|
||||||
Return "/Resources/ImportPageListBoxImages/" + PictureID.ToString() + ".png"
|
Dim sPath As String = "/Resources/ImportPageListBoxImages/" & PictureID.ToString() & ".png"
|
||||||
|
Return New System.Windows.Media.Imaging.BitmapImage(New Uri(sPath, UriKind.Relative))
|
||||||
End Get
|
End Get
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
|
|||||||
+19
-3
@@ -22,10 +22,26 @@
|
|||||||
</Grid.RowDefinitions>
|
</Grid.RowDefinitions>
|
||||||
|
|
||||||
<Label Name="TitleTxBl" Grid.Column="1" Grid.Row="1" Foreground="White" FontSize="20" VerticalAlignment="Center"/>
|
<Label Name="TitleTxBl" Grid.Column="1" Grid.Row="1" Foreground="White" FontSize="20" VerticalAlignment="Center"/>
|
||||||
<ListBox Name="ScrapsListBox" Grid.Column="1" Grid.Row="2" ItemTemplate="{DynamicResource DataTemplateItem}"
|
<ListBox Name="ScrapsListBox" Grid.Column="1" Grid.Row="2">
|
||||||
ItemsSource="{Binding ItemList, NotifyOnSourceUpdated=True}"/>
|
<ListBox.ItemTemplate>
|
||||||
|
<DataTemplate>
|
||||||
|
<Grid Margin="0,2">
|
||||||
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition Width="0.5*" />
|
||||||
|
<ColumnDefinition Width="1*" />
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
<Image Source="{Binding PreviewState}" VerticalAlignment="Center"
|
||||||
|
MaxWidth="50" MaxHeight="50"
|
||||||
|
Stretch="Uniform" Grid.Column="0" />
|
||||||
|
<TextBlock Text="{Binding Name}" VerticalAlignment="Center"
|
||||||
|
Style="{StaticResource OmagCut_CurrProjSummeryTextBlock}"
|
||||||
|
Grid.Column="1"/>
|
||||||
|
</Grid>
|
||||||
|
</DataTemplate>
|
||||||
|
</ListBox.ItemTemplate>
|
||||||
|
</ListBox>
|
||||||
|
|
||||||
<Grid Grid.Column="1" Grid.Row="4">
|
<Grid Grid.Column="1" Grid.Row="4">
|
||||||
<Grid.ColumnDefinitions>
|
<Grid.ColumnDefinitions>
|
||||||
<ColumnDefinition Width="0.1*"/>
|
<ColumnDefinition Width="0.1*"/>
|
||||||
<ColumnDefinition Width="1*"/>
|
<ColumnDefinition Width="1*"/>
|
||||||
|
|||||||
@@ -205,6 +205,12 @@ Public Class Camera
|
|||||||
Dim nInd As Integer = 1
|
Dim nInd As Integer = 1
|
||||||
If m_nCameraCount = 2 Then
|
If m_nCameraCount = 2 Then
|
||||||
nInd = GetCurrentTable()
|
nInd = GetCurrentTable()
|
||||||
|
' verifico se la macchina è configurata per fotocamera sulla tavola di lavoro
|
||||||
|
If (GetPrivateProfileInt(S_CAMERAHQ, K_CAMERAHQ_ENABLE, 0, m_MainWindow.GetMachIniFile()) <> 0) AndAlso
|
||||||
|
(GetPrivateProfileInt(S_CAMERAHQ, K_CAMERAHQ_ACTIVATE, 0, m_MainWindow.GetMachIniFile()) <> 0) Then
|
||||||
|
' forzo l'utilizzo della seconda camera (sopra alla tavola di lavoro)
|
||||||
|
nInd = 2
|
||||||
|
End If
|
||||||
If nInd <> 1 And nInd <> 2 Then Return 0
|
If nInd <> 1 And nInd <> 2 Then Return 0
|
||||||
End If
|
End If
|
||||||
' Se gestore macchina non attivo, lo lancio in modo cieco
|
' Se gestore macchina non attivo, lo lancio in modo cieco
|
||||||
|
|||||||
@@ -362,6 +362,8 @@ Public Class RawPartPageUC
|
|||||||
OtherRefTabChBx.Visibility = Visibility.Collapsed
|
OtherRefTabChBx.Visibility = Visibility.Collapsed
|
||||||
OtherRefTabTxBl.Visibility = Visibility.Collapsed
|
OtherRefTabTxBl.Visibility = Visibility.Collapsed
|
||||||
Return
|
Return
|
||||||
|
Else
|
||||||
|
OtherRefTabBtn.Visibility = Visibility.Visible
|
||||||
End If
|
End If
|
||||||
m_bOtherRefTab = (GetPrivateProfileInt(S_RAWPART, K_OTHERREFTAB, 0, m_MainWindow.GetIniFile()) <> 0)
|
m_bOtherRefTab = (GetPrivateProfileInt(S_RAWPART, K_OTHERREFTAB, 0, m_MainWindow.GetIniFile()) <> 0)
|
||||||
m_OtherRefTabX = GetPrivateProfileDouble(S_RAWPART, K_OTHERREFTABX, 0, m_MainWindow.GetIniFile())
|
m_OtherRefTabX = GetPrivateProfileDouble(S_RAWPART, K_OTHERREFTABX, 0, m_MainWindow.GetIniFile())
|
||||||
@@ -1420,7 +1422,7 @@ Public Class RawPartPageUC
|
|||||||
Dim nExit As Integer = 0
|
Dim nExit As Integer = 0
|
||||||
EgtGetCalcTool(sTool, sHead, nExit)
|
EgtGetCalcTool(sTool, sHead, nExit)
|
||||||
' Imposto come testa corrente il laser (senza utensile ovviamente)
|
' Imposto come testa corrente il laser (senza utensile ovviamente)
|
||||||
If Not EgtSetCalcTool("", "H3", 1) Then
|
If Not EgtSetCalcTool("", LASER_HEAD, 1) Then
|
||||||
Return False
|
Return False
|
||||||
End If
|
End If
|
||||||
' Trasformo in posizione punta utensile in basso
|
' Trasformo in posizione punta utensile in basso
|
||||||
@@ -1432,6 +1434,10 @@ Public Class RawPartPageUC
|
|||||||
' Porto il tip nell'origine tavola
|
' Porto il tip nell'origine tavola
|
||||||
ptAcquired = ptTipP1
|
ptAcquired = ptTipP1
|
||||||
ptAcquired.ToLoc(New Frame3d(m_ptTableMin))
|
ptAcquired.ToLoc(New Frame3d(m_ptTableMin))
|
||||||
|
EgtOutLog("Actual axis laser H3: L1=" & dL1.ToString & ", L2=" & dL2.ToString & ", L3=" & dL3.ToString &
|
||||||
|
", R1=" & dR1.ToString & ", R2=" & dR2.ToString)
|
||||||
|
EgtOutLog("Actual pos laser H3: " & ptTipP1.x.ToString & "," & ptTipP1.y.ToString & "," & ptTipP1.z.ToString &
|
||||||
|
"; on table: " & ptAcquired.x.ToString & "," & ptAcquired.y.ToString & "," & ptAcquired.z.ToString)
|
||||||
Return True
|
Return True
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
@@ -1449,6 +1455,8 @@ Public Class RawPartPageUC
|
|||||||
EgtGetCalcTool(sTool, sHead, nExit)
|
EgtGetCalcTool(sTool, sHead, nExit)
|
||||||
' Trasformo in posizione punta utensile in basso
|
' Trasformo in posizione punta utensile in basso
|
||||||
If Not EgtGetCalcTipFromPositions(dL1, dL2, dL3, dR1, dR2, True, ptTipP1) Then
|
If Not EgtGetCalcTipFromPositions(dL1, dL2, dL3, dR1, dR2, True, ptTipP1) Then
|
||||||
|
EgtOutLog("Actual pos " & sHead & ": L1=" & dL1.ToString & ", L2=" & dL2.ToString & ", L3=" & dL3.ToString &
|
||||||
|
", R1=" & dR1.ToString & ", R2=" & dR2.ToString)
|
||||||
Return False
|
Return False
|
||||||
End If
|
End If
|
||||||
' Porto il tip nell'origine tavola
|
' Porto il tip nell'origine tavola
|
||||||
|
|||||||
Binary file not shown.
|
After Width: | Height: | Size: 2.0 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 1.7 KiB |
@@ -240,10 +240,10 @@
|
|||||||
<ColumnDefinition Width="1*"/>
|
<ColumnDefinition Width="1*"/>
|
||||||
<ColumnDefinition Width="1*"/>
|
<ColumnDefinition Width="1*"/>
|
||||||
</Grid.ColumnDefinitions>
|
</Grid.ColumnDefinitions>
|
||||||
<Button Name="GenerateCN_Btn" Grid.Column="1" Style="{DynamicResource OmagCut_GradientBlueIconButton}" Click="GenerateXPIUC_Click">
|
<Button Name="GenerateCN_Btn" Grid.Column="1" Style="{DynamicResource OmagCut_GradientBlueIconButton}" Click="GenerateCN_Click">
|
||||||
<Image Source="{DynamicResource GenerateCNImg}" Style="{StaticResource OmagCut_ButtonIcon}" />
|
<Image Source="{DynamicResource GenerateCNImg}" Style="{StaticResource OmagCut_ButtonIcon}" />
|
||||||
</Button>
|
</Button>
|
||||||
<Button Grid.Column="2" Style="{DynamicResource OmagCut_GradientBlueIconButton}" Click="ExitBtnUC_Click">
|
<Button Grid.Column="2" Style="{DynamicResource OmagCut_GradientBlueIconButton}" Click="ExitBtn_Click">
|
||||||
<Image Source="{DynamicResource VImg}" Style="{StaticResource OmagCut_ButtonIcon}" />
|
<Image Source="{DynamicResource VImg}" Style="{StaticResource OmagCut_ButtonIcon}" />
|
||||||
</Button>
|
</Button>
|
||||||
|
|
||||||
|
|||||||
@@ -77,7 +77,7 @@ Public Class SimulationPageUC
|
|||||||
End If
|
End If
|
||||||
' Pulsante Play
|
' Pulsante Play
|
||||||
PlayPauseImage.Source = New System.Windows.Media.Imaging.BitmapImage(New Uri("/Resources/Play.png", UriKind.Relative))
|
PlayPauseImage.Source = New System.Windows.Media.Imaging.BitmapImage(New Uri("/Resources/Play.png", UriKind.Relative))
|
||||||
' abilito la visualizzazione del pulsante per la sola generazione del codice CN
|
' abilito la visualizzazione del pulsante per la generazione del codice CN (se previsto)
|
||||||
If GetPrivateProfileInt(S_GENERAL, K_GENERATECN, 0, m_MainWindow.GetIniFile()) <> 0 Then
|
If GetPrivateProfileInt(S_GENERAL, K_GENERATECN, 0, m_MainWindow.GetIniFile()) <> 0 Then
|
||||||
GenerateCN_Btn.Visibility = Visibility.Visible
|
GenerateCN_Btn.Visibility = Visibility.Visible
|
||||||
Else
|
Else
|
||||||
@@ -535,7 +535,7 @@ Public Class SimulationPageUC
|
|||||||
End If
|
End If
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Sub ExitBtnUC_Click(sender As Object, e As RoutedEventArgs)
|
Private Sub ExitBtn_Click(sender As Object, e As RoutedEventArgs)
|
||||||
' Mi assicuro di terminare la simulazione
|
' Mi assicuro di terminare la simulazione
|
||||||
ResetSimulation()
|
ResetSimulation()
|
||||||
' Nascondo tutte le lavorazioni
|
' Nascondo tutte le lavorazioni
|
||||||
@@ -566,102 +566,23 @@ Public Class SimulationPageUC
|
|||||||
|
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Sub GenerateXPIUC_Click(sender As Object, e As RoutedEventArgs)
|
Private Sub GenerateCN_Click(sender As Object, e As RoutedEventArgs)
|
||||||
' se il bottone Shift è premuto apro il file CadCut1 nel programma NotePad
|
' Se il bottone Shift è premuto apro il file CadCut1 nel programma NotePad
|
||||||
Dim IsPressedShiftKey As Boolean = False
|
Dim IsPressedShiftKey As Boolean = False
|
||||||
If Keyboard.Modifiers And ModifierKeys.Shift Then
|
If Keyboard.Modifiers And ModifierKeys.Shift Then IsPressedShiftKey = True
|
||||||
IsPressedShiftKey = True
|
|
||||||
End If
|
|
||||||
|
|
||||||
' eventualmente fermo la simulazione
|
' Eventualmente fermo la simulazione
|
||||||
m_nStatus = MCH_SIM_ST.UI_STOP
|
m_nStatus = MCH_SIM_ST.UI_STOP
|
||||||
m_bPlay = False
|
m_bPlay = False
|
||||||
PlayPauseBtn_Click(Nothing, Nothing)
|
PlayPauseBtn_Click(Nothing, Nothing)
|
||||||
|
|
||||||
' Se nella pagina di tagli diretti
|
' Se versione ufficio non genero
|
||||||
If m_MainWindow.DirectCutBtn.IsChecked And Not m_MainWindow.CadCutBtn.IsChecked Then
|
If m_MainWindow.GetKeyOption(MainWindow.KEY_OPT.OFFICE_TYPE) Then
|
||||||
' Genero file CNC (lancio anche se errore in precedenza)
|
m_CurrProjPage.SetWarningMessage("Office Version")
|
||||||
Dim sCncPathDirect As String = m_MainWindow.GetCncDir() & "\DirectCut" & m_MainWindow.m_CurrentMachine.sIsoFileExt
|
|
||||||
Dim bOkDirect As Boolean = EgtGenerate(sCncPathDirect, "OmagCut ver." & m_MainWindow.GetVersion())
|
|
||||||
|
|
||||||
' Costringo ad aggiornare UI
|
|
||||||
UpdateUI()
|
|
||||||
' Ripristino come fase corrente quella iniziale
|
|
||||||
EgtSetCurrPhase(1)
|
|
||||||
If bOkDirect Then
|
|
||||||
m_CurrProjPage.SetInfoMessage("Genarato file " & "DirectCut" & m_MainWindow.m_CurrentMachine.sIsoFileExt)
|
|
||||||
Else
|
|
||||||
m_CurrProjPage.SetErrorMessage(EgtMsg(90314)) 'Errore nella generazione del programma CN
|
|
||||||
End If
|
|
||||||
' procedo all'apertura del file CadCut1 apenna generato (solo se generazione corretta)
|
|
||||||
If bOkDirect And IsPressedShiftKey Then
|
|
||||||
Try
|
|
||||||
Process.Start("Notepad.exe", sCncPathDirect)
|
|
||||||
Catch ex As Exception
|
|
||||||
EgtOutLog(ex.ToString)
|
|
||||||
End Try
|
|
||||||
End If
|
|
||||||
' ricarico la pagina di simulazione
|
|
||||||
EgtSetCurrPhase(1)
|
|
||||||
' nascondo i pezzi in parcheggio
|
|
||||||
HideParkedParts(True)
|
|
||||||
' Avvio ambiente di simulazione
|
|
||||||
EgtSimInit()
|
|
||||||
EgtSimStart()
|
|
||||||
' Imposto stato corrente
|
|
||||||
SetStatus(MCH_SIM_ST.UI_STOP)
|
|
||||||
m_bPlay = True
|
|
||||||
' Costringo ad aggiornare UI
|
|
||||||
UpdateUI()
|
|
||||||
' esco
|
|
||||||
Return
|
Return
|
||||||
End If
|
End If
|
||||||
|
|
||||||
Dim bOk As Boolean = True
|
|
||||||
EgtSetCurrentContext(m_CurrProjPage.CurrentProjectScene.GetCtx())
|
EgtSetCurrentContext(m_CurrProjPage.CurrentProjectScene.GetCtx())
|
||||||
' Elimino eventuale attrezzaggio da OmagOFFICE
|
|
||||||
EgtEraseCurrSetup()
|
|
||||||
' Verifico l'attrezzaggio degli utensili utilizzati
|
|
||||||
Dim sMissingTools As String = String.Empty
|
|
||||||
If Not VerifySetup(sMissingTools) Then
|
|
||||||
m_CurrProjPage.SetErrorMessage(EgtMsg(90322) & " " & sMissingTools) 'Mancano gli utensili : ...
|
|
||||||
Return
|
|
||||||
End If
|
|
||||||
' Costringo ad aggiornare UI
|
|
||||||
UpdateUI()
|
|
||||||
' Aggiorno flag per lavaggio
|
|
||||||
m_CurrProjPage.UpdateWashingFlag()
|
|
||||||
' Aggiorno flag per tastatura per tagli con angolo di fianco
|
|
||||||
m_CurrProjPage.UpdateSideAngCutProbeFlag()
|
|
||||||
' Se pezzi piani e non c'è ordine delle lavorazioni, ricalcolo tutto e ne faccio uno automatico
|
|
||||||
Dim nPrjType As Integer = m_CurrProjPage.GetCurrentProjectType()
|
|
||||||
Dim bDirectCut As Boolean = (GetDirectCutPart() <> GDB_ID.NULL)
|
|
||||||
If nPrjType = CurrentProjectPageUC.PRJ_TYPE.FLATS And
|
|
||||||
Not bDirectCut And
|
|
||||||
Not m_CurrProjPage.GetOrderMachiningFlag() Then
|
|
||||||
ResetAllMachinings()
|
|
||||||
bOk = SortAllMachinings()
|
|
||||||
If bOk Then
|
|
||||||
m_CurrProjPage.SetOrderMachiningFlag()
|
|
||||||
Dim bModif As Boolean = TestAllMachiningsForStrict()
|
|
||||||
If bModif Then
|
|
||||||
m_CurrProjPage.SetWarningMessage(EgtMsg(90321)) 'Ridotte alcune lavorazioni per evitare interferenze
|
|
||||||
Else
|
|
||||||
m_CurrProjPage.SetInfoMessage(EgtMsg(90399)) 'Aggiornate tutte le lavorazioni
|
|
||||||
End If
|
|
||||||
EgtDraw()
|
|
||||||
End If
|
|
||||||
End If
|
|
||||||
' Costringo ad aggiornare UI
|
|
||||||
UpdateUI()
|
|
||||||
' Disabilito impostazione modificato
|
|
||||||
EgtDisableModified()
|
|
||||||
' Aggiorno le lavorazioni
|
|
||||||
bOk = UpdateAllMachiningsToolpaths() And bOk
|
|
||||||
' Aggiorno posizionamento ventose sui pezzi per eventuali tagli da sotto con lama
|
|
||||||
bOk = UpdateVacuumsForDrip() And bOk
|
|
||||||
' Costringo ad aggiornare UI
|
|
||||||
UpdateUI()
|
|
||||||
' Inserisco indice di progetto
|
' Inserisco indice di progetto
|
||||||
m_CurrProjPage.SetProjectIndexFlag()
|
m_CurrProjPage.SetProjectIndexFlag()
|
||||||
' Inserisco il materiale
|
' Inserisco il materiale
|
||||||
@@ -671,45 +592,22 @@ Public Class SimulationPageUC
|
|||||||
m_CurrProjPage.SaveFile(sMchPath)
|
m_CurrProjPage.SaveFile(sMchPath)
|
||||||
' Costringo ad aggiornare UI
|
' Costringo ad aggiornare UI
|
||||||
UpdateUI()
|
UpdateUI()
|
||||||
' Se modalità Ufficio, copio il progetto ed esco
|
|
||||||
If m_MainWindow.GetKeyOption(MainWindow.KEY_OPT.OFFICE_TYPE) Then
|
' Nome e path del file CN da generare
|
||||||
' Ripristino come fase corrente quella iniziale
|
Dim sFileName As String = ""
|
||||||
EgtSetCurrPhase(1)
|
' Se in Tagli Diretti
|
||||||
' Chiedo il nome del file esportato
|
If m_MainWindow.DirectCutBtn.IsChecked And Not m_MainWindow.CadCutBtn.IsChecked Then
|
||||||
Dim MySaveNameWD As New SaveNameWD(m_MainWindow, SaveNameWD.SAVE_TYPE.PRJ_COPY)
|
sFileName = "DirectCut"
|
||||||
MySaveNameWD.ShowDialog()
|
' Altrimenti in Tagli Cad
|
||||||
Return
|
Else
|
||||||
|
Dim nIndexTab As Integer = CamAuto.GetCurrentTable()
|
||||||
|
Dim sIndexTab As String = If( nIndexTab > 0, nIndexTab.ToString, "")
|
||||||
|
sFileName = "CadCut" & sIndexTab
|
||||||
End If
|
End If
|
||||||
' Se presente ripartenza, ne chiedo conferma
|
|
||||||
Dim nPhaseRestart As Integer = m_CurrProjPage.GetProjectNcRestart()
|
|
||||||
If nPhaseRestart <> 0 Then
|
|
||||||
' Confermi ripartenza dalla fase NNN ?
|
|
||||||
Dim AskNcRestart As New EgtMsgBox(m_MainWindow, "", String.Format(EgtMsg(90326), nPhaseRestart),
|
|
||||||
EgtMsgBox.Buttons.YES_NO_CANCEL, EgtMsgBox.Icons.NULL, 2)
|
|
||||||
Select Case AskNcRestart.m_nPressedBtn
|
|
||||||
Case 1 ' YES
|
|
||||||
Case 2 ' NO
|
|
||||||
EgtEnableModified()
|
|
||||||
m_CurrProjPage.ResetProjectNcRestart()
|
|
||||||
nPhaseRestart = 0
|
|
||||||
EgtDisableModified()
|
|
||||||
Case Else ' CANCEL
|
|
||||||
Return
|
|
||||||
End Select
|
|
||||||
End If
|
|
||||||
' Se abilitate, eseguo le stime
|
|
||||||
If GetPrivateProfileInt(S_MACH_ESTIMATIONS, K_ENABLEEST, 0, m_MainWindow.GetMachIniFile()) <> 0 Then
|
|
||||||
EgtEstimate(m_MainWindow.GetTempDir() & "\MachProj.html", "OmagCut ver." & m_MainWindow.GetVersion())
|
|
||||||
End If
|
|
||||||
' Genero file CNC (lancio anche se errore in precedenza) -> recupero la tavola corrente! CamAuto.GetCurrentTable()
|
|
||||||
Dim nIndexTab As Integer = CamAuto.GetCurrentTable()
|
|
||||||
Dim sIndexTab As String = String.Empty
|
|
||||||
If nIndexTab > 0 Then
|
|
||||||
sIndexTab = nIndexTab.ToString
|
|
||||||
End If
|
|
||||||
Dim sFileName As String = "CadCut" & sIndexTab
|
|
||||||
Dim sCncPath As String = m_MainWindow.GetCncDir() & "\" & sFileName & m_MainWindow.m_CurrentMachine.sIsoFileExt
|
Dim sCncPath As String = m_MainWindow.GetCncDir() & "\" & sFileName & m_MainWindow.m_CurrentMachine.sIsoFileExt
|
||||||
bOk = EgtGenerate(sCncPath, "OmagCut ver." & m_MainWindow.GetVersion()) And bOk
|
|
||||||
|
' Genero file CNC
|
||||||
|
Dim bOk As Boolean = EgtGenerate(sCncPath, "OmagCut ver." & m_MainWindow.GetVersion())
|
||||||
' Costringo ad aggiornare UI
|
' Costringo ad aggiornare UI
|
||||||
UpdateUI()
|
UpdateUI()
|
||||||
' Ripristino come fase corrente quella iniziale
|
' Ripristino come fase corrente quella iniziale
|
||||||
@@ -719,7 +617,7 @@ Public Class SimulationPageUC
|
|||||||
Else
|
Else
|
||||||
m_CurrProjPage.SetErrorMessage(EgtMsg(90314)) 'Errore nella generazione del programma CN
|
m_CurrProjPage.SetErrorMessage(EgtMsg(90314)) 'Errore nella generazione del programma CN
|
||||||
End If
|
End If
|
||||||
' procedo all'apertura del file CadCut1 apenna generato (solo se generazione corretta)
|
' procedo all'apertura del file CadCut1 appena generato (solo se generazione corretta)
|
||||||
If bOk And IsPressedShiftKey Then
|
If bOk And IsPressedShiftKey Then
|
||||||
Try
|
Try
|
||||||
Process.Start("Notepad.exe", sCncPath)
|
Process.Start("Notepad.exe", sCncPath)
|
||||||
|
|||||||
Reference in New Issue
Block a user