Compare commits
9 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 37adc352a1 | |||
| 2708670d9a | |||
| 737366ba27 | |||
| d10588867f | |||
| 54158406b7 | |||
| 5c3c231729 | |||
| d3c0b1c2c6 | |||
| ad04e5d916 | |||
| db623544e9 |
@@ -24,7 +24,7 @@
|
||||
<RowDefinition Height="0.5*"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<TextBlock Name="Title" Grid.Row="1" Grid.Column="1"
|
||||
<TextBlock Name="TableListMsg" Grid.Row="1" Grid.Column="1"
|
||||
Style="{DynamicResource OmagCut_CenteredLowerCaseCharacterTextBlock}"/>
|
||||
|
||||
<ItemsControl Name="TableList"
|
||||
|
||||
@@ -20,7 +20,7 @@ Public Class SelectTableWD
|
||||
|
||||
Private Sub ChangeTable_Initialized() Handles Me.Initialized
|
||||
|
||||
Title.Text = EgtUILib.EgtMsg(91234) ' Seleziona la tavola da usare
|
||||
TableListMsg.Text = EgtUILib.EgtMsg(91234) ' Seleziona la tavola da usare
|
||||
' recuepero l'inidce della tavola corrente
|
||||
Dim nIndeXCurrTab As Integer = GetCurrentTable()
|
||||
' creo la lista delle tavole disponibili (attivo il bottone della tavola attualmente in uso)
|
||||
|
||||
+478
-205
@@ -1,5 +1,6 @@
|
||||
Imports System.Collections.ObjectModel
|
||||
Imports System.ComponentModel
|
||||
Imports System.Reflection
|
||||
Imports EgtUILib
|
||||
|
||||
Public Class SplitPageUC
|
||||
@@ -203,7 +204,7 @@ Public Class SplitPageUC
|
||||
If Mach.m_sLay = NAME_ONPATH Then AddTopText(sText)
|
||||
If Mach.m_bFinalCut Then AddFinalText(sText)
|
||||
Else
|
||||
sText = EgtMsg(90791) & " " & i.ToString() & " " & DoubleToString(Mach.m_dSideAng, 2) & "°"
|
||||
sText = EgtMsg(90791) & " " & i.ToString() & " " & DoubleToString(Mach.m_dSideAng, 2) & "°"
|
||||
End If
|
||||
If Mach.m_bPause Then AddPauseText(sText)
|
||||
AddItemToList(i, Mach, sText, MCH_OY.SAWING)
|
||||
@@ -971,14 +972,18 @@ Public Class SplitPageUC
|
||||
If Not MoveUpBtn.IsEnabled And Not MoveDownBtn.IsEnabled Then Return
|
||||
|
||||
' MOVE UP (-1)
|
||||
Dim OldItem As SplitMach = m_MachiningList(m_CurrFirstInd - 1)
|
||||
Dim NewItem As SplitMach = m_MachiningList(m_CurrLastInd)
|
||||
MoveUpBtn.IsEnabled = Not (OldItem.m_bFinalCut Or NewItem.m_bFinalCut) Or (OldItem.m_bFinalCut And NewItem.m_bFinalCut)
|
||||
If m_CurrFirstInd > 0 Then
|
||||
Dim OldItem As SplitMach = m_MachiningList(m_CurrFirstInd - 1)
|
||||
Dim NewItem As SplitMach = m_MachiningList(m_CurrLastInd)
|
||||
MoveUpBtn.IsEnabled = Not (OldItem.m_bFinalCut Or NewItem.m_bFinalCut) Or (OldItem.m_bFinalCut And NewItem.m_bFinalCut)
|
||||
End If
|
||||
|
||||
' MOVE DOWN (1)
|
||||
OldItem = m_MachiningList(m_CurrLastInd + 1)
|
||||
NewItem = m_MachiningList(m_CurrFirstInd)
|
||||
MoveDownBtn.IsEnabled = Not (OldItem.m_bFinalCut Or NewItem.m_bFinalCut) Or (OldItem.m_bFinalCut And NewItem.m_bFinalCut)
|
||||
If m_CurrLastInd < m_MachiningList.Count - 1 Then
|
||||
Dim OldItem = m_MachiningList(m_CurrLastInd + 1)
|
||||
Dim NewItem = m_MachiningList(m_CurrFirstInd)
|
||||
MoveDownBtn.IsEnabled = Not (OldItem.m_bFinalCut Or NewItem.m_bFinalCut) Or (OldItem.m_bFinalCut And NewItem.m_bFinalCut)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub MoveItem(direction As Integer)
|
||||
@@ -1271,17 +1276,31 @@ Public Class SplitPageUC
|
||||
|
||||
End Sub
|
||||
|
||||
' Dato l'indice della lavorazione restituisce l'indice della lavorazione TwinCut
|
||||
Private Function GetIndexTwinCut(nIndex As Integer, Optional OnlyFinalCut As Boolean = True) As Integer
|
||||
Dim nIndexTwinCut As Integer = -1
|
||||
If m_MachiningList(nIndex).m_bFinalCut Or Not OnlyFinalCut Then
|
||||
Dim nIdTwinCut As Integer = -1
|
||||
EgtGetInfo(m_MachiningList(nIndex).m_nId, "IdTwinCut", nIdTwinCut)
|
||||
nIndexTwinCut = m_MachiningList.FindIndex(Function(x) x.m_nId = nIdTwinCut)
|
||||
End If
|
||||
Return nIndexTwinCut
|
||||
End Function
|
||||
|
||||
' Ok: gestione info 'IdTwinCut' per tagli FinalCut
|
||||
Private Function AdjustBothCuts(nI As Integer,
|
||||
Optional bAllForced As Boolean = False,
|
||||
Optional bAccForced As Boolean = False) As Boolean
|
||||
Dim nIndexTwinCut As Integer = GetIndexTwinCut(nI, False)
|
||||
' Verifico che entrambi gli estremi siano allungabili
|
||||
If Not (m_MachiningList(nI).m_bCanStartAll And m_MachiningList(nI).m_bCanEndAll) Then Return False
|
||||
If Not ((m_MachiningList(nI).m_bCanStartAll And m_MachiningList(nI).m_bCanEndAll) Or nIndexTwinCut > -1) Then Return False
|
||||
' Eseguo allungamento o riporto allo standard
|
||||
EgtSetCurrMachining(m_MachiningList(nI).m_nId)
|
||||
Dim nLiPrev As Integer
|
||||
EgtGetMachiningParam(MCH_MP.LEADINTYPE, nLiPrev)
|
||||
Dim nLoPrev As Integer
|
||||
EgtGetMachiningParam(MCH_MP.LEADOUTTYPE, nLoPrev)
|
||||
|
||||
If (m_MachiningList(nI).m_bStartAll Or m_MachiningList(nI).m_bEndAll) And Not bAllForced Then
|
||||
' accorcio
|
||||
If nLiPrev = MCH_SAW_LI.EXT_OUT Then
|
||||
@@ -1297,6 +1316,28 @@ Public Class SplitPageUC
|
||||
UpdateMachiningPreview(m_MachiningList(nI).m_nId, True)
|
||||
m_MachiningList(nI).m_bStartAll = False
|
||||
m_MachiningList(nI).m_bEndAll = False
|
||||
|
||||
' ver_2.7h3
|
||||
If nIndexTwinCut > -1 And nIndexTwinCut < m_MachiningList.Count Then
|
||||
' Eseguo allungamento o riporto allo standard
|
||||
EgtSetCurrMachining(m_MachiningList(nIndexTwinCut).m_nId)
|
||||
EgtGetMachiningParam(MCH_MP.LEADINTYPE, nLiPrev)
|
||||
EgtGetMachiningParam(MCH_MP.LEADOUTTYPE, nLoPrev)
|
||||
|
||||
' accorcio
|
||||
If nLiPrev = MCH_SAW_LI.EXT_OUT Then
|
||||
EgtSetMachiningParam(MCH_MP.LEADINTYPE, MCH_SAW_LI.OUT)
|
||||
Else
|
||||
EgtSetMachiningParam(MCH_MP.LEADINTYPE, MCH_SAW_LI.CENT)
|
||||
End If
|
||||
If nLoPrev = MCH_SAW_LO.EXT_OUT Then
|
||||
EgtSetMachiningParam(MCH_MP.LEADOUTTYPE, MCH_SAW_LO.OUT)
|
||||
Else
|
||||
EgtSetMachiningParam(MCH_MP.LEADOUTTYPE, MCH_SAW_LO.CENT)
|
||||
End If
|
||||
UpdateMachiningPreview(m_MachiningList(nIndexTwinCut).m_nId, True)
|
||||
End If
|
||||
|
||||
ElseIf m_MachiningList(nI).m_bEnabled And Not bAccForced Then
|
||||
' allungo
|
||||
If nLiPrev = MCH_SAW_LI.OUT Then
|
||||
@@ -1312,20 +1353,44 @@ Public Class SplitPageUC
|
||||
UpdateMachiningPreview(m_MachiningList(nI).m_nId, True)
|
||||
m_MachiningList(nI).m_bStartAll = True
|
||||
m_MachiningList(nI).m_bEndAll = True
|
||||
|
||||
' ver_2.7h3
|
||||
If nIndexTwinCut > -1 And nIndexTwinCut < m_MachiningList.Count Then
|
||||
' Eseguo allungamento o riporto allo standard
|
||||
EgtSetCurrMachining(m_MachiningList(nIndexTwinCut).m_nId)
|
||||
EgtGetMachiningParam(MCH_MP.LEADINTYPE, nLiPrev)
|
||||
EgtGetMachiningParam(MCH_MP.LEADOUTTYPE, nLoPrev)
|
||||
|
||||
If nLiPrev = MCH_SAW_LI.OUT Then
|
||||
EgtSetMachiningParam(MCH_MP.LEADINTYPE, MCH_SAW_LI.EXT_OUT)
|
||||
Else
|
||||
EgtSetMachiningParam(MCH_MP.LEADINTYPE, MCH_SAW_LI.EXT_CENT)
|
||||
End If
|
||||
If nLoPrev = MCH_SAW_LO.OUT Then
|
||||
EgtSetMachiningParam(MCH_MP.LEADOUTTYPE, MCH_SAW_LO.EXT_OUT)
|
||||
Else
|
||||
EgtSetMachiningParam(MCH_MP.LEADOUTTYPE, MCH_SAW_LO.EXT_CENT)
|
||||
End If
|
||||
UpdateMachiningPreview(m_MachiningList(nIndexTwinCut).m_nId, True)
|
||||
End If
|
||||
|
||||
End If
|
||||
ColorMachining(m_MachiningList(nI))
|
||||
Return True
|
||||
End Function
|
||||
|
||||
' Ok: gestione info 'IdTwinCut' per tagli FinalCut
|
||||
Private Function AdjustStartCut(nI As Integer,
|
||||
Optional bAllForced As Boolean = False,
|
||||
Optional bAccForced As Boolean = False) As Boolean
|
||||
Dim nIndexTwinCut As Integer = GetIndexTwinCut(nI, False)
|
||||
' Verifico che l'estremo iniziale sia allungabile
|
||||
If Not m_MachiningList(nI).m_bCanStartAll Then Return False
|
||||
If Not (m_MachiningList(nI).m_bCanStartAll Or nIndexTwinCut > -1) Then Return False
|
||||
' Eseguo allungamento o riporto allo standard
|
||||
EgtSetCurrMachining(m_MachiningList(nI).m_nId)
|
||||
Dim nLiPrev As Integer
|
||||
EgtGetMachiningParam(MCH_MP.LEADINTYPE, nLiPrev)
|
||||
|
||||
If m_MachiningList(nI).m_bStartAll And Not bAllForced Then
|
||||
' accorcio
|
||||
If nLiPrev = MCH_SAW_LI.EXT_OUT Then
|
||||
@@ -1335,6 +1400,21 @@ Public Class SplitPageUC
|
||||
End If
|
||||
UpdateMachiningPreview(m_MachiningList(nI).m_nId, True)
|
||||
m_MachiningList(nI).m_bStartAll = False
|
||||
|
||||
' ver_2.7h3
|
||||
If nIndexTwinCut > -1 And nIndexTwinCut < m_MachiningList.Count Then
|
||||
' Eseguo allungamento o riporto allo standard
|
||||
EgtSetCurrMachining(m_MachiningList(nIndexTwinCut).m_nId)
|
||||
EgtGetMachiningParam(MCH_MP.LEADINTYPE, nLiPrev)
|
||||
' accorcio
|
||||
If nLiPrev = MCH_SAW_LI.EXT_OUT Then
|
||||
EgtSetMachiningParam(MCH_MP.LEADINTYPE, MCH_SAW_LI.OUT)
|
||||
Else
|
||||
EgtSetMachiningParam(MCH_MP.LEADINTYPE, MCH_SAW_LI.CENT)
|
||||
End If
|
||||
UpdateMachiningPreview(m_MachiningList(nIndexTwinCut).m_nId, True)
|
||||
End If
|
||||
|
||||
ElseIf m_MachiningList(nI).m_bEnabled And Not bAccForced Then
|
||||
' allungo
|
||||
If nLiPrev = MCH_SAW_LI.OUT Then
|
||||
@@ -1344,20 +1424,38 @@ Public Class SplitPageUC
|
||||
End If
|
||||
UpdateMachiningPreview(m_MachiningList(nI).m_nId, True)
|
||||
m_MachiningList(nI).m_bStartAll = True
|
||||
|
||||
' ver_2.7h3
|
||||
If nIndexTwinCut > -1 And nIndexTwinCut < m_MachiningList.Count Then
|
||||
' Eseguo allungamento o riporto allo standard
|
||||
EgtSetCurrMachining(m_MachiningList(nIndexTwinCut).m_nId)
|
||||
EgtGetMachiningParam(MCH_MP.LEADINTYPE, nLiPrev)
|
||||
' allungo
|
||||
If nLiPrev = MCH_SAW_LI.OUT Then
|
||||
EgtSetMachiningParam(MCH_MP.LEADINTYPE, MCH_SAW_LI.EXT_OUT)
|
||||
Else
|
||||
EgtSetMachiningParam(MCH_MP.LEADINTYPE, MCH_SAW_LI.EXT_CENT)
|
||||
End If
|
||||
UpdateMachiningPreview(m_MachiningList(nIndexTwinCut).m_nId, True)
|
||||
End If
|
||||
|
||||
End If
|
||||
ColorMachining(m_MachiningList(nI))
|
||||
Return True
|
||||
End Function
|
||||
|
||||
' Ok: gestione info 'IdTwinCut' per tagli FinalCut
|
||||
Private Function AdjustEndCut(nI As Integer,
|
||||
Optional bAllForced As Boolean = False,
|
||||
Optional bAccForced As Boolean = False) As Boolean
|
||||
Dim nIndexTwinCut As Integer = GetIndexTwinCut(nI, False)
|
||||
' Verifico che l'estremo finale sia allungabile
|
||||
If Not m_MachiningList(nI).m_bCanEndAll Then Return False
|
||||
If Not (m_MachiningList(nI).m_bCanEndAll Or nIndexTwinCut > -1) Then Return False
|
||||
' Eseguo allungamento o riporto allo standard
|
||||
EgtSetCurrMachining(m_MachiningList(nI).m_nId)
|
||||
Dim nLoPrev As Integer
|
||||
EgtGetMachiningParam(MCH_MP.LEADOUTTYPE, nLoPrev)
|
||||
|
||||
If m_MachiningList(nI).m_bEndAll And Not bAllForced Then
|
||||
' accorcio
|
||||
If nLoPrev = MCH_SAW_LO.EXT_OUT Then
|
||||
@@ -1366,6 +1464,21 @@ Public Class SplitPageUC
|
||||
EgtSetMachiningParam(MCH_MP.LEADOUTTYPE, MCH_SAW_LO.CENT)
|
||||
End If
|
||||
m_MachiningList(nI).m_bEndAll = False
|
||||
|
||||
' ver_2.7h3
|
||||
If nIndexTwinCut > -1 And nIndexTwinCut < m_MachiningList.Count Then
|
||||
' Eseguo allungamento o riporto allo standard
|
||||
EgtSetCurrMachining(m_MachiningList(nIndexTwinCut).m_nId)
|
||||
EgtGetMachiningParam(MCH_MP.LEADOUTTYPE, nLoPrev)
|
||||
' accorcio
|
||||
If nLoPrev = MCH_SAW_LO.EXT_OUT Then
|
||||
EgtSetMachiningParam(MCH_MP.LEADOUTTYPE, MCH_SAW_LO.OUT)
|
||||
Else
|
||||
EgtSetMachiningParam(MCH_MP.LEADOUTTYPE, MCH_SAW_LO.CENT)
|
||||
End If
|
||||
UpdateMachiningPreview(m_MachiningList(nIndexTwinCut).m_nId, True)
|
||||
End If
|
||||
|
||||
ElseIf m_MachiningList(nI).m_bEnabled And Not bAccForced Then
|
||||
' allungo
|
||||
If nLoPrev = MCH_SAW_LO.OUT Then
|
||||
@@ -1374,62 +1487,106 @@ Public Class SplitPageUC
|
||||
EgtSetMachiningParam(MCH_MP.LEADOUTTYPE, MCH_SAW_LO.EXT_CENT)
|
||||
End If
|
||||
m_MachiningList(nI).m_bEndAll = True
|
||||
|
||||
' ver_2.7h3
|
||||
If nIndexTwinCut > -1 And nIndexTwinCut < m_MachiningList.Count Then
|
||||
' Eseguo allungamento o riporto allo standard
|
||||
EgtSetCurrMachining(m_MachiningList(nIndexTwinCut).m_nId)
|
||||
EgtGetMachiningParam(MCH_MP.LEADOUTTYPE, nLoPrev)
|
||||
' allungo
|
||||
If nLoPrev = MCH_SAW_LO.OUT Then
|
||||
EgtSetMachiningParam(MCH_MP.LEADOUTTYPE, MCH_SAW_LO.EXT_OUT)
|
||||
Else
|
||||
EgtSetMachiningParam(MCH_MP.LEADOUTTYPE, MCH_SAW_LO.EXT_CENT)
|
||||
End If
|
||||
UpdateMachiningPreview(m_MachiningList(nIndexTwinCut).m_nId, True)
|
||||
End If
|
||||
|
||||
End If
|
||||
UpdateMachiningPreview(m_MachiningList(nI).m_nId, True)
|
||||
ColorMachining(m_MachiningList(nI))
|
||||
Return True
|
||||
End Function
|
||||
|
||||
' Ok: gestione info 'IdTwinCut' per tagli FinalCut
|
||||
Private Sub OutCenStartBtn_Click(sender As Object, e As RoutedEventArgs) Handles OutCenStartBtn.Click
|
||||
If m_CurrFirstInd = -1 Then Return
|
||||
Dim bGenModif As Boolean = False
|
||||
|
||||
For Index As Integer = m_CurrFirstInd To m_CurrLastInd
|
||||
If Not m_ItemList(Index).IsSelected Then
|
||||
Dim nIndexTwinCut As Integer = -1
|
||||
' Indice di controllo LOOP: se > 10 allora il ciclo è potenzialmente infinito!
|
||||
Dim nCount As Integer = 0
|
||||
Dim CurrIndex = Index
|
||||
If Not m_ItemList(CurrIndex).IsSelected Then
|
||||
Continue For
|
||||
End If
|
||||
Dim nI As Integer = m_ItemList(Index).Ind
|
||||
If m_MachiningList(nI).m_sLay = NAME_OUTLOOP Then
|
||||
|
||||
' se ho forzato il tipo di ingresso da CamAuto qui non posso moficarlo!
|
||||
If m_MachiningList(nI).m_bMngLeadInOnIntCorner Then
|
||||
EgtOutLog("L'ingresso di taglio associato all'entita'_" & m_MachiningList(nI).m_nEntId & " non puo' essere modificato per problemi di ingombro lama")
|
||||
Else
|
||||
Do
|
||||
nCount = nCount + 1
|
||||
Dim nI As Integer = m_ItemList(CurrIndex).Ind
|
||||
If m_MachiningList(nI).m_sLay = NAME_OUTLOOP Then
|
||||
|
||||
' se ho forzato il tipo di ingresso da CamAuto qui non posso moficarlo!
|
||||
If m_MachiningList(nI).m_bMngLeadInOnIntCorner Then
|
||||
EgtOutLog("L'ingresso di taglio associato all'entita'_" & m_MachiningList(nI).m_nEntId & " non puo' essere modificato per problemi di ingombro lama")
|
||||
Else
|
||||
|
||||
EgtSetCurrMachining(m_MachiningList(nI).m_nId)
|
||||
Dim nLiPrev As Integer
|
||||
EgtGetMachiningParam(MCH_MP.LEADINTYPE, nLiPrev)
|
||||
If nLiPrev = MCH_SAW_LI.OUT Then
|
||||
' accorcio
|
||||
EgtSetMachiningParam(MCH_MP.LEADINTYPE, MCH_SAW_LI.CENT)
|
||||
UpdateMachiningPreview(m_MachiningList(nI).m_nId, True)
|
||||
ModifyOtherLeadIn(nI, MCH_SAW_LI.CENT)
|
||||
' ri-verifico interferenza
|
||||
EgtVerifyMachining(m_MachiningList(nI).m_nId, m_MachiningList(nI).m_nInterf)
|
||||
ElseIf nLiPrev = MCH_SAW_LI.EXT_OUT Then
|
||||
' accorcio
|
||||
EgtSetMachiningParam(MCH_MP.LEADINTYPE, MCH_SAW_LI.EXT_CENT)
|
||||
UpdateMachiningPreview(m_MachiningList(nI).m_nId, True)
|
||||
ModifyOtherLeadIn(nI, MCH_SAW_LI.CENT)
|
||||
ElseIf nLiPrev = MCH_SAW_LI.CENT Then
|
||||
' allungo
|
||||
EgtSetMachiningParam(MCH_MP.LEADINTYPE, MCH_SAW_LI.OUT)
|
||||
UpdateMachiningPreview(m_MachiningList(nI).m_nId, True)
|
||||
ModifyOtherLeadIn(nI, MCH_SAW_LI.OUT)
|
||||
' ri-verifico interferenza
|
||||
EgtVerifyMachining(m_MachiningList(nI).m_nId, m_MachiningList(nI).m_nInterf)
|
||||
ElseIf nLiPrev = MCH_SAW_LI.EXT_CENT Then
|
||||
' allungo
|
||||
EgtSetMachiningParam(MCH_MP.LEADINTYPE, MCH_SAW_LI.EXT_OUT)
|
||||
UpdateMachiningPreview(m_MachiningList(nI).m_nId, True)
|
||||
ModifyOtherLeadIn(nI, MCH_SAW_LI.OUT)
|
||||
End If
|
||||
ColorMachining(m_MachiningList(nI))
|
||||
ColorNumberArrow(nI)
|
||||
bGenModif = True
|
||||
|
||||
' Recupero il taglio TwinCut associato (Optional: False -> non controllo se è FinalCut)
|
||||
nIndexTwinCut = GetIndexTwinCut(nI, False)
|
||||
If nIndexTwinCut > -1 Then
|
||||
' Se non è stato selezionato allora devo modificarlo, alrtimenti resetto l'indice
|
||||
If m_ItemList(nIndexTwinCut).IsSelected Then
|
||||
nIndexTwinCut = -1
|
||||
Else
|
||||
CurrIndex = nIndexTwinCut
|
||||
End If
|
||||
End If
|
||||
|
||||
EgtSetCurrMachining(m_MachiningList(nI).m_nId)
|
||||
Dim nLiPrev As Integer
|
||||
EgtGetMachiningParam(MCH_MP.LEADINTYPE, nLiPrev)
|
||||
If nLiPrev = MCH_SAW_LI.OUT Then
|
||||
' accorcio
|
||||
EgtSetMachiningParam(MCH_MP.LEADINTYPE, MCH_SAW_LI.CENT)
|
||||
UpdateMachiningPreview(m_MachiningList(nI).m_nId, True)
|
||||
ModifyOtherLeadIn(nI, MCH_SAW_LI.CENT)
|
||||
' ri-verifico interferenza
|
||||
EgtVerifyMachining(m_MachiningList(nI).m_nId, m_MachiningList(nI).m_nInterf)
|
||||
ElseIf nLiPrev = MCH_SAW_LI.EXT_OUT Then
|
||||
' accorcio
|
||||
EgtSetMachiningParam(MCH_MP.LEADINTYPE, MCH_SAW_LI.EXT_CENT)
|
||||
UpdateMachiningPreview(m_MachiningList(nI).m_nId, True)
|
||||
ModifyOtherLeadIn(nI, MCH_SAW_LI.CENT)
|
||||
ElseIf nLiPrev = MCH_SAW_LI.CENT Then
|
||||
' allungo
|
||||
EgtSetMachiningParam(MCH_MP.LEADINTYPE, MCH_SAW_LI.OUT)
|
||||
UpdateMachiningPreview(m_MachiningList(nI).m_nId, True)
|
||||
ModifyOtherLeadIn(nI, MCH_SAW_LI.OUT)
|
||||
' ri-verifico interferenza
|
||||
EgtVerifyMachining(m_MachiningList(nI).m_nId, m_MachiningList(nI).m_nInterf)
|
||||
ElseIf nLiPrev = MCH_SAW_LI.EXT_CENT Then
|
||||
' allungo
|
||||
EgtSetMachiningParam(MCH_MP.LEADINTYPE, MCH_SAW_LI.EXT_OUT)
|
||||
UpdateMachiningPreview(m_MachiningList(nI).m_nId, True)
|
||||
ModifyOtherLeadIn(nI, MCH_SAW_LI.OUT)
|
||||
End If
|
||||
ColorMachining(m_MachiningList(nI))
|
||||
ColorNumberArrow(nI)
|
||||
bGenModif = True
|
||||
|
||||
End If
|
||||
|
||||
End If
|
||||
If nCount > 10 Then
|
||||
EgtOutLog("! FATAL ERROR ! In function 'OutCenEndBtn' cycle 'Do Loop Until' is potentially infinte")
|
||||
' Forzo l'uscita dal ciclo
|
||||
nIndexTwinCut = -1
|
||||
End If
|
||||
Loop Until nIndexTwinCut < 0
|
||||
|
||||
' ---- FINE ----- metodo per mofica paramtri
|
||||
|
||||
Next
|
||||
' Se modificato qualcosa
|
||||
If bGenModif Then
|
||||
@@ -1438,6 +1595,7 @@ Public Class SplitPageUC
|
||||
End If
|
||||
End Sub
|
||||
|
||||
' Ok: anche per tagli TwinCut con affondament ridotto
|
||||
Private Sub AllOutStartBtn_Click(sender As Object, e As RoutedEventArgs) Handles AllOutStartBtn.Click
|
||||
For nI As Integer = 0 To m_MachiningList.Count() - 1
|
||||
EgtSetCurrMachining(m_MachiningList(nI).m_nId)
|
||||
@@ -1464,6 +1622,7 @@ Public Class SplitPageUC
|
||||
m_bModified = True
|
||||
End Sub
|
||||
|
||||
' Ok: anche per tagli TwinCut con affondament ridotto
|
||||
Private Sub AllCenStartBtn_Click(sender As Object, e As RoutedEventArgs) Handles AllCenStartBtn.Click
|
||||
For nI As Integer = 0 To m_MachiningList.Count() - 1
|
||||
|
||||
@@ -1499,56 +1658,84 @@ Public Class SplitPageUC
|
||||
m_bModified = True
|
||||
End Sub
|
||||
|
||||
' Ok: gestione info 'IdTwinCut' per tagli FinalCut
|
||||
Private Sub OutCenEndBtn_Click(sender As Object, e As RoutedEventArgs) Handles OutCenEndBtn.Click
|
||||
If m_CurrFirstInd = -1 Then Return
|
||||
Dim bGenModif As Boolean = False
|
||||
|
||||
For Index As Integer = m_CurrFirstInd To m_CurrLastInd
|
||||
If Not m_ItemList(Index).IsSelected Then
|
||||
Dim nIndexTwinCut As Integer = -1
|
||||
' Indice di controllo LOOP: se > 10 allora il ciclo è potenzialmente infinito!
|
||||
Dim nCount As Integer = 0
|
||||
Dim CurrIndex = Index
|
||||
If Not m_ItemList(CurrIndex).IsSelected Then
|
||||
Continue For
|
||||
End If
|
||||
Dim nI As Integer = m_ItemList(Index).Ind
|
||||
If m_MachiningList(nI).m_sLay = NAME_OUTLOOP Then
|
||||
|
||||
' se ho forzato il tipo di ingresso da CamAuto qui non posso moficarlo!
|
||||
If m_MachiningList(nI).m_bMngLeadInOnIntCorner Then
|
||||
EgtOutLog("L'uscita di taglio associato all'entita'_" & m_MachiningList(nI).m_nEntId & " non puo' essere modificato per problemi di ingombro lama")
|
||||
Else
|
||||
Do
|
||||
nCount = nCount + 1
|
||||
Dim nI As Integer = m_ItemList(CurrIndex).Ind
|
||||
If m_MachiningList(nI).m_sLay = NAME_OUTLOOP Then
|
||||
|
||||
' se ho forzato il tipo di ingresso da CamAuto qui non posso moficarlo!
|
||||
If m_MachiningList(nI).m_bMngLeadInOnIntCorner Then
|
||||
EgtOutLog("L'uscita di taglio associato all'entita'_" & m_MachiningList(nI).m_nEntId & " non puo' essere modificato per problemi di ingombro lama")
|
||||
Else
|
||||
|
||||
EgtSetCurrMachining(m_MachiningList(nI).m_nId)
|
||||
Dim nLoPrev As Integer
|
||||
EgtGetMachiningParam(MCH_MP.LEADOUTTYPE, nLoPrev)
|
||||
If nLoPrev = MCH_SAW_LO.OUT Then
|
||||
' accorcio
|
||||
EgtSetMachiningParam(MCH_MP.LEADOUTTYPE, MCH_SAW_LO.CENT)
|
||||
UpdateMachiningPreview(m_MachiningList(nI).m_nId, True)
|
||||
ModifyOtherLeadOut(nI, MCH_SAW_LO.CENT)
|
||||
' ri-verifico interferenza
|
||||
EgtVerifyMachining(m_MachiningList(nI).m_nId, m_MachiningList(nI).m_nInterf)
|
||||
ElseIf nLoPrev = MCH_SAW_LO.EXT_OUT Then
|
||||
' accorcio
|
||||
EgtSetMachiningParam(MCH_MP.LEADOUTTYPE, MCH_SAW_LO.EXT_CENT)
|
||||
UpdateMachiningPreview(m_MachiningList(nI).m_nId, True)
|
||||
ModifyOtherLeadOut(nI, MCH_SAW_LO.CENT)
|
||||
ElseIf nLoPrev = MCH_SAW_LO.CENT Then
|
||||
' allungo
|
||||
EgtSetMachiningParam(MCH_MP.LEADOUTTYPE, MCH_SAW_LO.OUT)
|
||||
UpdateMachiningPreview(m_MachiningList(nI).m_nId, True)
|
||||
ModifyOtherLeadOut(nI, MCH_SAW_LO.OUT)
|
||||
' ri-verifico interferenza
|
||||
EgtVerifyMachining(m_MachiningList(nI).m_nId, m_MachiningList(nI).m_nInterf)
|
||||
ElseIf nLoPrev = MCH_SAW_LO.EXT_CENT Then
|
||||
' allungo
|
||||
EgtSetMachiningParam(MCH_MP.LEADOUTTYPE, MCH_SAW_LO.EXT_OUT)
|
||||
UpdateMachiningPreview(m_MachiningList(nI).m_nId, True)
|
||||
ModifyOtherLeadOut(nI, MCH_SAW_LO.OUT)
|
||||
End If
|
||||
ColorMachining(m_MachiningList(nI))
|
||||
ColorNumberArrow(nI)
|
||||
bGenModif = True
|
||||
|
||||
' Recupero il taglio TwinCut associato (Optional: False -> non controllo se è FinalCut)
|
||||
nIndexTwinCut = GetIndexTwinCut(nI, False)
|
||||
If nIndexTwinCut > -1 Then
|
||||
' Se non è stato selezionato allora devo modificarlo, alrtimenti resetto l'indice
|
||||
If m_ItemList(nIndexTwinCut).IsSelected Then
|
||||
nIndexTwinCut = -1
|
||||
Else
|
||||
CurrIndex = nIndexTwinCut
|
||||
End If
|
||||
End If
|
||||
|
||||
EgtSetCurrMachining(m_MachiningList(nI).m_nId)
|
||||
Dim nLoPrev As Integer
|
||||
EgtGetMachiningParam(MCH_MP.LEADOUTTYPE, nLoPrev)
|
||||
If nLoPrev = MCH_SAW_LO.OUT Then
|
||||
' accorcio
|
||||
EgtSetMachiningParam(MCH_MP.LEADOUTTYPE, MCH_SAW_LO.CENT)
|
||||
UpdateMachiningPreview(m_MachiningList(nI).m_nId, True)
|
||||
ModifyOtherLeadOut(nI, MCH_SAW_LO.CENT)
|
||||
' ri-verifico interferenza
|
||||
EgtVerifyMachining(m_MachiningList(nI).m_nId, m_MachiningList(nI).m_nInterf)
|
||||
ElseIf nLoPrev = MCH_SAW_LO.EXT_OUT Then
|
||||
' accorcio
|
||||
EgtSetMachiningParam(MCH_MP.LEADOUTTYPE, MCH_SAW_LO.EXT_CENT)
|
||||
UpdateMachiningPreview(m_MachiningList(nI).m_nId, True)
|
||||
ModifyOtherLeadOut(nI, MCH_SAW_LO.CENT)
|
||||
ElseIf nLoPrev = MCH_SAW_LO.CENT Then
|
||||
' allungo
|
||||
EgtSetMachiningParam(MCH_MP.LEADOUTTYPE, MCH_SAW_LO.OUT)
|
||||
UpdateMachiningPreview(m_MachiningList(nI).m_nId, True)
|
||||
ModifyOtherLeadOut(nI, MCH_SAW_LO.OUT)
|
||||
' ri-verifico interferenza
|
||||
EgtVerifyMachining(m_MachiningList(nI).m_nId, m_MachiningList(nI).m_nInterf)
|
||||
ElseIf nLoPrev = MCH_SAW_LO.EXT_CENT Then
|
||||
' allungo
|
||||
EgtSetMachiningParam(MCH_MP.LEADOUTTYPE, MCH_SAW_LO.EXT_OUT)
|
||||
UpdateMachiningPreview(m_MachiningList(nI).m_nId, True)
|
||||
ModifyOtherLeadOut(nI, MCH_SAW_LO.OUT)
|
||||
End If
|
||||
ColorMachining(m_MachiningList(nI))
|
||||
ColorNumberArrow(nI)
|
||||
bGenModif = True
|
||||
|
||||
End If
|
||||
|
||||
End If
|
||||
If nCount > 10 Then
|
||||
EgtOutLog("! FATAL ERROR ! In function 'OutCenEndBtn' cycle 'Do Loop Until' is potentially infinte")
|
||||
' Forzo l'uscita dal ciclo
|
||||
nIndexTwinCut = -1
|
||||
End If
|
||||
Loop Until nIndexTwinCut < 0
|
||||
|
||||
|
||||
Next
|
||||
' Se modificato qualcosa
|
||||
If bGenModif Then
|
||||
@@ -1557,6 +1744,7 @@ Public Class SplitPageUC
|
||||
End If
|
||||
End Sub
|
||||
|
||||
' Ok: anche per tagli TwinCut con affondament ridotto
|
||||
Private Sub AllOutEndBtn_Click(sender As Object, e As RoutedEventArgs) Handles AllOutEndBtn.Click
|
||||
For nI As Integer = 0 To m_MachiningList.Count() - 1
|
||||
EgtSetCurrMachining(m_MachiningList(nI).m_nId)
|
||||
@@ -1583,6 +1771,7 @@ Public Class SplitPageUC
|
||||
m_bModified = True
|
||||
End Sub
|
||||
|
||||
' Ok
|
||||
Private Sub AllCenEndBtn_Click(sender As Object, e As RoutedEventArgs) Handles AllCenEndBtn.Click
|
||||
For nI As Integer = 0 To m_MachiningList.Count() - 1
|
||||
|
||||
@@ -1618,6 +1807,7 @@ Public Class SplitPageUC
|
||||
m_bModified = True
|
||||
End Sub
|
||||
|
||||
' Ok
|
||||
Private Sub AllExtendBtn_Click(sender As Object, e As RoutedEventArgs) Handles AllExtendBtn.Click
|
||||
Dim bModif As Boolean = False
|
||||
For nI As Integer = 0 To m_MachiningList.Count() - 1
|
||||
@@ -1639,6 +1829,7 @@ Public Class SplitPageUC
|
||||
EnableButtons()
|
||||
End Sub
|
||||
|
||||
' Ok
|
||||
Private Sub AllReduceBtn_Click(sender As Object, e As RoutedEventArgs) Handles AllReduceBtn.Click
|
||||
Dim bModif As Boolean = False
|
||||
For nI As Integer = 0 To m_MachiningList.Count() - 1
|
||||
@@ -1660,6 +1851,7 @@ Public Class SplitPageUC
|
||||
EnableButtons()
|
||||
End Sub
|
||||
|
||||
' Ok
|
||||
Private Sub ModifStartBtn_Click(sender As Object, e As RoutedEventArgs) Handles ModifStartBtn.Click
|
||||
Dim bLen As Boolean = True
|
||||
' abilito la finestra per inserire i valori solo per il primo elemento della lista (di default tutti gli altri oggetti assumono lo stesso valore)
|
||||
@@ -1680,76 +1872,115 @@ Public Class SplitPageUC
|
||||
If m_CurrFirstInd = -1 Then Return
|
||||
Dim bGenModif As Boolean = False
|
||||
For Index As Integer = m_CurrFirstInd To m_CurrLastInd
|
||||
If Not m_ItemList(Index).IsSelected Then
|
||||
Dim nIndexTwinCut As Integer = -1
|
||||
Dim CurrIndex As Integer = Index
|
||||
' Indice di controllo LOOP: se > 10 allora il ciclo è potenzialmente infinito!
|
||||
Dim nCount As Integer = 0
|
||||
|
||||
If Not m_ItemList(CurrIndex).IsSelected Then
|
||||
Continue For
|
||||
End If
|
||||
Dim nI As Integer = m_ItemList(Index).Ind
|
||||
|
||||
Dim nI As Integer = m_ItemList(CurrIndex).Ind
|
||||
Dim nOperId As Integer = m_MachiningList(nI).m_nId
|
||||
Dim nMachiningType As Integer = EgtGetOperationType(nOperId)
|
||||
|
||||
' Se taglio con lama
|
||||
If nMachiningType = MCH_MY.SAWING And
|
||||
(m_MachiningList(nI).m_bIsLine Or m_MachiningList(nI).m_dPrevAng > FL_ARC_ANG_MIN Or m_MachiningList(nI).m_sLay = NAME_ONPATH) Then
|
||||
If nMachiningType = MCH_MY.SAWING Then
|
||||
|
||||
If Not m_MachiningList(nI).m_bCanStartAll Then
|
||||
EgtOutLog("Il taglio non puo' essere allungato all'interno del pezzo")
|
||||
Return
|
||||
End If
|
||||
|
||||
' leggo il valore salvato nella geometria
|
||||
Dim dOrigUsal As Double = 0
|
||||
EgtGetInfo(nOperId, INFO_MCH_USER_SAL, dOrigUsal)
|
||||
|
||||
' ------------------ INIZIO PREPARAZIONE TASTIERINO VIRTUALE ------------------
|
||||
If bFirstInd Then
|
||||
' Dialogo richiesta valore
|
||||
Dim ValWnd As New EditValueWD(m_MainWindow, "SAW: " & EgtMsg(90375)) ' Allungamento
|
||||
ValWnd.SetVal(dOrigUsal, bLen)
|
||||
If Not ValWnd.ShowDialog() Then Return
|
||||
' carico il valore letto dal testierino virtuale
|
||||
dUsal = ValWnd.GetVal(bLen)
|
||||
' comunico che ho letto il primo dato
|
||||
bFirstInd = False
|
||||
End If
|
||||
' ------------------ FINE PREPARAZIONE TASTIERINO VIRTUALE ------------------
|
||||
Dim bRepeat As Boolean = False
|
||||
Do
|
||||
' Se c'è limite alla lunghezza libera
|
||||
If m_MachiningList(nI).m_dStartFreeLen < FREELEN_INF Then
|
||||
' se abilitati i controlli sugli allungamenti dei lati interni
|
||||
If Not m_StartEndModifyOnIntCorner Then
|
||||
' Recupero sicurezza in corner interno
|
||||
Dim dCornerSafety As Double = Math.Max(GetPrivateProfileDouble(S_MACH_NEST, K_MACH_SAFE_LEN_INTCORNER, 1, m_MainWindow.GetMachIniFile()), 10 * EPS_SMALL)
|
||||
' Recupero lunghezza baffo del taglio
|
||||
Dim nPvId As Integer = GDB_ID.NULL
|
||||
EgtGetInfo(EgtGetFirstNameInGroup(nOperId, NAME_PREVIEW), INFO_PV_ONPART_ID, nPvId)
|
||||
Dim dDT As Double = 0
|
||||
EgtGetInfo(EgtGetFirstGroupInGroup(nPvId), "DT", dDT)
|
||||
dUsal = Math.Min(dUsal, m_MachiningList(nI).m_dStartFreeLen - dDT - dCornerSafety)
|
||||
' Riassegno i valori dell'indice corrente
|
||||
nI = m_ItemList(CurrIndex).Ind
|
||||
nOperId = m_MachiningList(nI).m_nId
|
||||
|
||||
nCount = nCount + 1
|
||||
If Not (m_MachiningList(nI).m_bIsLine Or m_MachiningList(nI).m_dPrevAng > FL_ARC_ANG_MIN Or m_MachiningList(nI).m_sLay = NAME_ONPATH) Then
|
||||
Continue For
|
||||
End If
|
||||
|
||||
nIndexTwinCut = GetIndexTwinCut(nI, False)
|
||||
If Not (m_MachiningList(nI).m_bCanStartAll Or nIndexTwinCut > -1) Then
|
||||
EgtOutLog("Il taglio non puo' essere allungato all'interno del pezzo")
|
||||
' Passo al prossimo indice disponibile
|
||||
Continue For
|
||||
End If
|
||||
|
||||
' leggo il valore salvato nella geometria
|
||||
Dim dOrigUsal As Double = 0
|
||||
EgtGetInfo(nOperId, INFO_MCH_USER_SAL, dOrigUsal)
|
||||
|
||||
' ------------------ INIZIO PREPARAZIONE TASTIERINO VIRTUALE ------------------
|
||||
If bFirstInd Then
|
||||
' Dialogo richiesta valore
|
||||
Dim ValWnd As New EditValueWD(m_MainWindow, "SAW: " & EgtMsg(90375)) ' Allungamento
|
||||
ValWnd.SetVal(dOrigUsal, bLen)
|
||||
If Not ValWnd.ShowDialog() Then Return
|
||||
' carico il valore letto dal testierino virtuale
|
||||
dUsal = ValWnd.GetVal(bLen)
|
||||
' comunico che ho letto il primo dato
|
||||
bFirstInd = False
|
||||
End If
|
||||
' ------------------ FINE PREPARAZIONE TASTIERINO VIRTUALE ------------------
|
||||
Dim bRepeat As Boolean = False
|
||||
Do
|
||||
' Se c'è limite alla lunghezza libera
|
||||
If m_MachiningList(nI).m_dStartFreeLen < FREELEN_INF Then
|
||||
' se abilitati i controlli sugli allungamenti dei lati interni
|
||||
If Not m_StartEndModifyOnIntCorner Then
|
||||
' Recupero sicurezza in corner interno
|
||||
Dim dCornerSafety As Double = Math.Max(GetPrivateProfileDouble(S_MACH_NEST, K_MACH_SAFE_LEN_INTCORNER, 1, m_MainWindow.GetMachIniFile()), 10 * EPS_SMALL)
|
||||
' Recupero lunghezza baffo del taglio
|
||||
Dim nPvId As Integer = GDB_ID.NULL
|
||||
EgtGetInfo(EgtGetFirstNameInGroup(nOperId, NAME_PREVIEW), INFO_PV_ONPART_ID, nPvId)
|
||||
Dim dDT As Double = 0
|
||||
EgtGetInfo(EgtGetFirstGroupInGroup(nPvId), "DT", dDT)
|
||||
dUsal = Math.Min(dUsal, m_MachiningList(nI).m_dStartFreeLen - dDT - dCornerSafety)
|
||||
End If
|
||||
End If
|
||||
' Modifica della lavorazione
|
||||
EgtSetCurrMachining(nOperId)
|
||||
Dim dAddLen As Double = 0
|
||||
EgtGetMachiningParam(MCH_MP.STARTADDLEN, dAddLen)
|
||||
' verifico che non sia sull'angolo interno (altrimenti vieto la modifica)
|
||||
If Not m_StartEndModifyOnIntCorner And (dAddLen - dOrigUsal < -10 * EPS_SMALL) Then
|
||||
' Passo al prossimo indice disponibile
|
||||
Continue For
|
||||
Return
|
||||
End If
|
||||
EgtSetMachiningParam(MCH_MP.STARTADDLEN, dAddLen + dUsal - dOrigUsal)
|
||||
EgtSetInfo(nOperId, INFO_MCH_USER_SAL, dUsal)
|
||||
bRepeat = Not UpdateMachiningPreview(m_MachiningList(nI).m_nId, True)
|
||||
If bRepeat Then
|
||||
EgtSetMachiningParam(MCH_MP.STARTADDLEN, dOrigUsal)
|
||||
EgtSetInfo(nOperId, INFO_MCH_USER_SAL, dOrigUsal)
|
||||
dUsal = dOrigUsal
|
||||
End If
|
||||
Loop Until Not bRepeat
|
||||
|
||||
' verifico interferenza
|
||||
EgtVerifyMachining(m_MachiningList(nI).m_nId, m_MachiningList(nI).m_nInterf)
|
||||
ColorMachining(m_MachiningList(nI))
|
||||
ColorNumberArrow(nI)
|
||||
bGenModif = True
|
||||
|
||||
' Recupero il taglio TwinCut associato (Optional: False -> non controllo se è FinalCut)
|
||||
nIndexTwinCut = GetIndexTwinCut(nI, False)
|
||||
If nIndexTwinCut > -1 Then
|
||||
' Se non è stato selezionato allora devo modificarlo, alrtimenti resetto l'indice
|
||||
If m_ItemList(nIndexTwinCut).IsSelected Then
|
||||
nIndexTwinCut = -1
|
||||
Else
|
||||
CurrIndex = nIndexTwinCut
|
||||
End If
|
||||
End If
|
||||
' Modifica della lavorazione
|
||||
EgtSetCurrMachining(nOperId)
|
||||
Dim dAddLen As Double = 0
|
||||
EgtGetMachiningParam(MCH_MP.STARTADDLEN, dAddLen)
|
||||
' verifico che non sia sull'angolo interno (altrimenti vieto la modifica)
|
||||
If Not m_StartEndModifyOnIntCorner And (dAddLen - dOrigUsal < -10 * EPS_SMALL) Then
|
||||
Return
|
||||
End If
|
||||
EgtSetMachiningParam(MCH_MP.STARTADDLEN, dAddLen + dUsal - dOrigUsal)
|
||||
EgtSetInfo(nOperId, INFO_MCH_USER_SAL, dUsal)
|
||||
bRepeat = Not UpdateMachiningPreview(m_MachiningList(nI).m_nId, True)
|
||||
If bRepeat Then
|
||||
EgtSetMachiningParam(MCH_MP.STARTADDLEN, dOrigUsal)
|
||||
EgtSetInfo(nOperId, INFO_MCH_USER_SAL, dOrigUsal)
|
||||
dUsal = dOrigUsal
|
||||
End If
|
||||
Loop Until Not bRepeat
|
||||
|
||||
' verifico interferenza
|
||||
EgtVerifyMachining(m_MachiningList(nI).m_nId, m_MachiningList(nI).m_nInterf)
|
||||
ColorMachining(m_MachiningList(nI))
|
||||
ColorNumberArrow(nI)
|
||||
bGenModif = True
|
||||
If nCount > 10 Then
|
||||
EgtOutLog("! FATAL ERROR ! In function 'ModifStartBtn' cycle 'Do Loop Until' is potentially infinte")
|
||||
' Forzo l'uscita dal ciclo
|
||||
nIndexTwinCut = -1
|
||||
End If
|
||||
|
||||
Loop Until nIndexTwinCut < 0
|
||||
|
||||
' se altrimenti fresatura sopra
|
||||
ElseIf nMachiningType = MCH_MY.MILLING And m_MachiningList(nI).m_sLay = NAME_ONPATH Then
|
||||
@@ -1762,7 +1993,10 @@ Public Class SplitPageUC
|
||||
' Dialogo richiesta valore
|
||||
Dim ValWnd As New EditValueWD(m_MainWindow, "MILL: " & EgtMsg(90375)) ' Allungamento
|
||||
ValWnd.SetVal(dOrigUsal, bLen)
|
||||
If Not ValWnd.ShowDialog() Then Return
|
||||
If Not ValWnd.ShowDialog() Then
|
||||
' Esco da tutto
|
||||
Return
|
||||
End If
|
||||
' carico il valore letto dal testierino virtuale
|
||||
dUsal = ValWnd.GetVal(bLen)
|
||||
' comunico che ho letto il primo dato
|
||||
@@ -1804,8 +2038,10 @@ Public Class SplitPageUC
|
||||
ModifStartWnd.SetLiTangDist(nOriginalTangDist)
|
||||
ModifStartWnd.SetLiPerpDist(nOriginalPerpDist)
|
||||
ModifStartWnd.SetLeadInType(nOriginalLeadInType)
|
||||
If Not ModifStartWnd.ShowDialog() Then Return
|
||||
|
||||
If Not ModifStartWnd.ShowDialog() Then
|
||||
' esco da tutto
|
||||
Return
|
||||
End If
|
||||
' carico il valore letto dal testierino virtuale
|
||||
dWJAddLen = ModifStartWnd.GetElongation()
|
||||
bWJLiHole = ModifStartWnd.GetHole()
|
||||
@@ -1841,6 +2077,7 @@ Public Class SplitPageUC
|
||||
End If
|
||||
End Sub
|
||||
|
||||
' Ok
|
||||
Private Sub ModifEndBtn_Click(sender As Object, e As RoutedEventArgs) Handles ModifEndBtn.Click
|
||||
Dim bLen As Boolean = True
|
||||
' abilito la finestra per inserire i valori solo per il primo elemento della lista (di default tutti gli altri oggetti assumono lo stesso valore)
|
||||
@@ -1860,74 +2097,110 @@ Public Class SplitPageUC
|
||||
If m_CurrFirstInd = -1 Then Return
|
||||
Dim bGenModif As Boolean = False
|
||||
For Index As Integer = m_CurrFirstInd To m_CurrLastInd
|
||||
Dim nIndexTwinCut As Integer = -1
|
||||
Dim CurrIndex As Integer = Index
|
||||
' Indice di controllo LOOP: se > 10 allora il ciclo è potenzialmente infinito!
|
||||
Dim nCount As Integer = 0
|
||||
|
||||
If Not m_ItemList(Index).IsSelected Then
|
||||
Continue For
|
||||
End If
|
||||
|
||||
Dim nI As Integer = m_ItemList(Index).Ind
|
||||
Dim nOperId As Integer = m_MachiningList(nI).m_nId
|
||||
Dim nMachiningType As Integer = EgtGetOperationType(nOperId)
|
||||
|
||||
' Se taglio con lama
|
||||
If nMachiningType = MCH_MY.SAWING And
|
||||
(m_MachiningList(nI).m_bIsLine Or m_MachiningList(nI).m_dNextAng > FL_ARC_ANG_MIN Or m_MachiningList(nI).m_sLay = NAME_ONPATH) Then
|
||||
If nMachiningType = MCH_MY.SAWING Then
|
||||
|
||||
If Not m_MachiningList(nI).m_bCanEndAll Then
|
||||
EgtOutLog("Il taglio non puo' essere allungato all'interno del pezzo")
|
||||
Return
|
||||
End If
|
||||
|
||||
Dim dOrigUeal As Double = 0
|
||||
EgtGetInfo(nOperId, INFO_MCH_USER_EAL, dOrigUeal)
|
||||
|
||||
' ------------------ INIZIO PREPARAZIONE TASTIERINO VIRTUALE ------------------
|
||||
If bFirstInd Then
|
||||
' Dialogo richiesta valore
|
||||
Dim ValWnd As New EditValueWD(m_MainWindow, "SAW: " & EgtMsg(90375)) ' Allungamento
|
||||
ValWnd.SetVal(dOrigUeal, bLen)
|
||||
If Not ValWnd.ShowDialog() Then Return
|
||||
dUeal = ValWnd.GetVal(bLen)
|
||||
bFirstInd = False
|
||||
End If
|
||||
' ------------------ FINE PREPARAZIONE TASTIERINO VIRTUALE ------------------
|
||||
Dim bRepeat As Boolean = False
|
||||
Do
|
||||
' Se c'è limite alla lunghezza libera
|
||||
If m_MachiningList(nI).m_dEndFreeLen < FREELEN_INF Then
|
||||
' se abilitati i controlli sugli allungamenti dei lati interni
|
||||
If Not m_StartEndModifyOnIntCorner Then
|
||||
' Recupero sicurezza in corner interno
|
||||
Dim dCornerSafety As Double = Math.Max(GetPrivateProfileDouble(S_MACH_NEST, K_MACH_SAFE_LEN_INTCORNER, 1, m_MainWindow.GetMachIniFile()), 10 * EPS_SMALL)
|
||||
' Recupero lunghezza baffo del taglio
|
||||
Dim nPvId As Integer = GDB_ID.NULL
|
||||
EgtGetInfo(EgtGetFirstNameInGroup(nOperId, NAME_PREVIEW), INFO_PV_ONPART_ID, nPvId)
|
||||
Dim dDT As Double = 0
|
||||
EgtGetInfo(EgtGetFirstGroupInGroup(nPvId), "DT", dDT)
|
||||
dUeal = Math.Min(dUeal, m_MachiningList(nI).m_dEndFreeLen - dDT - dCornerSafety)
|
||||
' Riassegno i valori dell'indice corrente
|
||||
nI = m_ItemList(CurrIndex).Ind
|
||||
nOperId = m_MachiningList(nI).m_nId
|
||||
|
||||
nCount = nCount + 1
|
||||
If Not (m_MachiningList(nI).m_bIsLine Or m_MachiningList(nI).m_dNextAng > FL_ARC_ANG_MIN Or m_MachiningList(nI).m_sLay = NAME_ONPATH) Then
|
||||
Continue For
|
||||
End If
|
||||
|
||||
nIndexTwinCut = GetIndexTwinCut(nI, False)
|
||||
If Not (m_MachiningList(nI).m_bCanEndAll Or nIndexTwinCut > -1) Then
|
||||
EgtOutLog("Il taglio non puo' essere allungato all'interno del pezzo")
|
||||
Return
|
||||
End If
|
||||
|
||||
Dim dOrigUeal As Double = 0
|
||||
EgtGetInfo(nOperId, INFO_MCH_USER_EAL, dOrigUeal)
|
||||
|
||||
' ------------------ INIZIO PREPARAZIONE TASTIERINO VIRTUALE ------------------
|
||||
If bFirstInd Then
|
||||
' Dialogo richiesta valore
|
||||
Dim ValWnd As New EditValueWD(m_MainWindow, "SAW: " & EgtMsg(90375)) ' Allungamento
|
||||
ValWnd.SetVal(dOrigUeal, bLen)
|
||||
If Not ValWnd.ShowDialog() Then Return
|
||||
dUeal = ValWnd.GetVal(bLen)
|
||||
bFirstInd = False
|
||||
End If
|
||||
' ------------------ FINE PREPARAZIONE TASTIERINO VIRTUALE ------------------
|
||||
Dim bRepeat As Boolean = False
|
||||
Do
|
||||
' Se c'è limite alla lunghezza libera
|
||||
If m_MachiningList(nI).m_dEndFreeLen < FREELEN_INF Then
|
||||
' se abilitati i controlli sugli allungamenti dei lati interni
|
||||
If Not m_StartEndModifyOnIntCorner Then
|
||||
' Recupero sicurezza in corner interno
|
||||
Dim dCornerSafety As Double = Math.Max(GetPrivateProfileDouble(S_MACH_NEST, K_MACH_SAFE_LEN_INTCORNER, 1, m_MainWindow.GetMachIniFile()), 10 * EPS_SMALL)
|
||||
' Recupero lunghezza baffo del taglio
|
||||
Dim nPvId As Integer = GDB_ID.NULL
|
||||
EgtGetInfo(EgtGetFirstNameInGroup(nOperId, NAME_PREVIEW), INFO_PV_ONPART_ID, nPvId)
|
||||
Dim dDT As Double = 0
|
||||
EgtGetInfo(EgtGetFirstGroupInGroup(nPvId), "DT", dDT)
|
||||
dUeal = Math.Min(dUeal, m_MachiningList(nI).m_dEndFreeLen - dDT - dCornerSafety)
|
||||
End If
|
||||
End If
|
||||
|
||||
' Modifica della lavorazione
|
||||
EgtSetCurrMachining(nOperId)
|
||||
Dim dAddLen As Double = 0
|
||||
EgtGetMachiningParam(MCH_MP.ENDADDLEN, dAddLen)
|
||||
If Not m_StartEndModifyOnIntCorner And (dAddLen - dOrigUeal < -10 * EPS_SMALL) Then
|
||||
Return
|
||||
End If
|
||||
EgtSetMachiningParam(MCH_MP.ENDADDLEN, dAddLen + dUeal - dOrigUeal)
|
||||
EgtSetInfo(nOperId, INFO_MCH_USER_EAL, dUeal)
|
||||
UpdateMachiningPreview(m_MachiningList(nI).m_nId, True)
|
||||
bRepeat = Not UpdateMachiningPreview(m_MachiningList(nI).m_nId, True)
|
||||
If bRepeat Then
|
||||
EgtSetMachiningParam(MCH_MP.ENDADDLEN, dOrigUeal)
|
||||
EgtSetInfo(nOperId, INFO_MCH_USER_EAL, dOrigUeal)
|
||||
dUeal = dOrigUeal
|
||||
End If
|
||||
Loop Until Not bRepeat
|
||||
|
||||
' verifico interferenza
|
||||
EgtVerifyMachining(m_MachiningList(nI).m_nId, m_MachiningList(nI).m_nInterf)
|
||||
ColorMachining(m_MachiningList(nI))
|
||||
ColorNumberArrow(nI)
|
||||
bGenModif = True
|
||||
|
||||
' Recupero il taglio TwinCut associato (Optional: False -> non controllo se è FinalCut)
|
||||
nIndexTwinCut = GetIndexTwinCut(nI, False)
|
||||
If nIndexTwinCut > -1 Then
|
||||
' Se non è stato selezionato allora devo modificarlo, alrtimenti resetto l'indice
|
||||
If m_ItemList(nIndexTwinCut).IsSelected Then
|
||||
nIndexTwinCut = -1
|
||||
Else
|
||||
CurrIndex = nIndexTwinCut
|
||||
End If
|
||||
End If
|
||||
|
||||
' Modifica della lavorazione
|
||||
EgtSetCurrMachining(nOperId)
|
||||
Dim dAddLen As Double = 0
|
||||
EgtGetMachiningParam(MCH_MP.ENDADDLEN, dAddLen)
|
||||
If Not m_StartEndModifyOnIntCorner And (dAddLen - dOrigUeal < -10 * EPS_SMALL) Then
|
||||
Return
|
||||
If nCount > 10 Then
|
||||
EgtOutLog("! FATAL ERROR ! In function 'ModifStartBtn' cycle 'Do Loop Until' is potentially infinte")
|
||||
' Forzo l'uscita dal ciclo
|
||||
nIndexTwinCut = -1
|
||||
End If
|
||||
EgtSetMachiningParam(MCH_MP.ENDADDLEN, dAddLen + dUeal - dOrigUeal)
|
||||
EgtSetInfo(nOperId, INFO_MCH_USER_EAL, dUeal)
|
||||
UpdateMachiningPreview(m_MachiningList(nI).m_nId, True)
|
||||
bRepeat = Not UpdateMachiningPreview(m_MachiningList(nI).m_nId, True)
|
||||
If bRepeat Then
|
||||
EgtSetMachiningParam(MCH_MP.ENDADDLEN, dOrigUeal)
|
||||
EgtSetInfo(nOperId, INFO_MCH_USER_EAL, dOrigUeal)
|
||||
dUeal = dOrigUeal
|
||||
End If
|
||||
Loop Until Not bRepeat
|
||||
Loop Until nIndexTwinCut < 0
|
||||
|
||||
' verifico interferenza
|
||||
EgtVerifyMachining(m_MachiningList(nI).m_nId, m_MachiningList(nI).m_nInterf)
|
||||
ColorMachining(m_MachiningList(nI))
|
||||
ColorNumberArrow(nI)
|
||||
bGenModif = True
|
||||
' se altrimenti fresatura sopra
|
||||
ElseIf nMachiningType = MCH_MY.MILLING And m_MachiningList(nI).m_sLay = NAME_ONPATH Then
|
||||
|
||||
|
||||
@@ -261,17 +261,11 @@ Module ConstIni
|
||||
Public Const K_REGANGSTEP As String = "AngStep"
|
||||
|
||||
Public Const S_CAMERA As String = "Camera"
|
||||
Public Const K_CAM_COUNT As String = "Count"
|
||||
Public Const K_CAM_EXEPATH As String = "ExePath"
|
||||
Public Const K_CAM_IMAGE As String = "Image"
|
||||
Public Const K_CAM_INFO As String = "Info"
|
||||
Public Const K_CAM_RESULT As String = "Result"
|
||||
Public Const K_CAM_CONTOUR As String = "Contour"
|
||||
Public Const K_CAM_EXEPATH2 As String = "ExePath2"
|
||||
Public Const K_CAM_IMAGE2 As String = "Image2"
|
||||
Public Const K_CAM_INFO2 As String = "Info2"
|
||||
Public Const K_CAM_RESULT2 As String = "Result2"
|
||||
Public Const K_CAM_CONTOUR2 As String = "Contour2"
|
||||
Public Const K_CAM_THRESHOLD As String = "Threshold"
|
||||
Public Const K_CAM_TOLERANCE As String = "Tolerance"
|
||||
Public Const K_CAM_TIMEOUT As String = "Timeout"
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
Public Const S_NUMERICALCONTROL As String = "NumericalControl"
|
||||
Public Const K_TYPE As String = "Type"
|
||||
Public Const K_SPECIALSEND As String = "SpecialSend"
|
||||
|
||||
Public Const S_PARTPROGRAM As String = "PartProgram"
|
||||
Public Const K_EXTENSION As String = "Extension"
|
||||
|
||||
@@ -267,6 +267,7 @@ Public Class GridCut
|
||||
EraseDirectCutPart()
|
||||
' Riattivo eventuali lavorazioni presenti
|
||||
ActivateAllMachinings()
|
||||
EgtSetCurrPhase(1)
|
||||
' Abilito registrazione progetto modificato
|
||||
EgtEnableModified()
|
||||
' Nascondo la macchina
|
||||
@@ -763,10 +764,37 @@ Public Class GridCut
|
||||
If Not m_MainWindow.m_CurrentMachine.bDirectCutsFinalHome Then
|
||||
RemoveFinalHome()
|
||||
End If
|
||||
' Se richiesta gestione tagli finali
|
||||
OrderFinalSawCuts()
|
||||
' Aggiorno stato bottoni
|
||||
UpdateSimulOkBtn()
|
||||
Return m_bCutOk
|
||||
End Function
|
||||
|
||||
Private Function OrderFinalSawCuts() As Boolean
|
||||
' Se gestione tagli finali non richiesta, esco
|
||||
If Not m_MainWindow.m_CurrentMachine.bEnableFinalSawCut Then Return False
|
||||
' Sposto i tagli finali alla fine, conservando l'ordine relativo
|
||||
Dim nFirstMovedId As Integer = GDB_ID.NULL
|
||||
Dim nRefId As Integer = EgtGetLastActiveOperation()
|
||||
Dim nOpeId As Integer = EgtGetFirstActiveOperation()
|
||||
While nOpeId <> GDB_ID.NULL
|
||||
If nOpeId = nFirstMovedId Then Exit While
|
||||
Dim nNextOpeId As Integer = EgtGetNextActiveOperation( nOpeId)
|
||||
If EgtGetOperationType( nOpeId) = MCH_OY.SAWING Then
|
||||
Dim bFinalCut As Boolean = False
|
||||
IF EgtGetInfo( nOpeId, "FinalCut", bFinalCut) AndAlso bFinalCut Then
|
||||
EgtRelocateGlob( nOpeId, nRefId, GDB_POS.AFTER)
|
||||
nRefId = nOpeId
|
||||
If nFirstMovedId = GDB_ID.NULL Then nFirstMovedId = nOpeId
|
||||
End If
|
||||
End If
|
||||
nOpeId = nNextOpeId
|
||||
End While
|
||||
' Esco
|
||||
Return True
|
||||
End Function
|
||||
|
||||
Private Function MultiplyCut(nLayerId As Integer) As Boolean
|
||||
If m_bCustomGrid Then
|
||||
Return MultiplyCut_1(nLayerId)
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="7.5*"/>
|
||||
<ColumnDefinition Width="1.5*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="2*"/>
|
||||
<ColumnDefinition Width="5*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
@@ -103,7 +103,7 @@
|
||||
|
||||
<GroupBox Name="PartProgTransferGpBx"
|
||||
Style="{DynamicResource OmagCut_GroupBox}" Grid.Row="2"
|
||||
Grid.ColumnSpan="3">
|
||||
Grid.ColumnSpan="2">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="2*"/>
|
||||
@@ -127,9 +127,16 @@
|
||||
</Grid>
|
||||
</GroupBox>
|
||||
|
||||
<GroupBox Name="SpecialSendGpBx" Style="{DynamicResource OmagCut_GroupBox}" Grid.Row="2"
|
||||
Grid.Column="2" Grid.ColumnSpan="1" Margin="5,0,5,0">
|
||||
<CheckBox Name="SpecialSendChBx"
|
||||
Style="{DynamicResource OmagCut_CheckBox_Single}"
|
||||
HorizontalAlignment="Center" Margin="0,0,0,0"/>
|
||||
</GroupBox>
|
||||
|
||||
<GroupBox Name="PowerGpBx" Style="{DynamicResource OmagCut_GroupBox}" Grid.Row="2"
|
||||
Grid.Column="3" Grid.ColumnSpan="3" Margin="5,0,0,0">
|
||||
<Grid>
|
||||
Grid.Column="3" Grid.ColumnSpan="1" Margin="5,0,0,0">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="2*"/>
|
||||
<ColumnDefinition Width="2*"/>
|
||||
|
||||
@@ -37,6 +37,16 @@ Public Class MachineCNPageUC
|
||||
PartProgTransferGpBx.Visibility = Windows.Visibility.Hidden
|
||||
End If
|
||||
|
||||
' Se prevista, scelta invio speciale part program
|
||||
Dim nSpecialSend As Integer = GetPrivateProfileInt(S_NUMERICALCONTROL, K_SPECIALSEND, -1, m_MainWindow.GetMachIniFile())
|
||||
If nSpecialSend <> -1 Then
|
||||
SpecialSendChBx.IsChecked() = (nSpecialSend = 1)
|
||||
SpecialSendGpBx.Header = "Special Send"
|
||||
SpecialSendGpBx.Visibility = Visibility.Visible
|
||||
else
|
||||
SpecialSendGpBx.Visibility = Visibility.Collapsed
|
||||
End If
|
||||
|
||||
' nuovi pulsanti
|
||||
If GetPrivateProfileInt(S_NCDATA, K_NEWCONSOLE, 0, m_MainWindow.GetMachIniFile()) = 1 Then
|
||||
PowerONBtn.Content = "ON"
|
||||
@@ -85,7 +95,7 @@ Public Class MachineCNPageUC
|
||||
Dim m_nCount As Integer = 1
|
||||
Dim bFoundBtn As Boolean = True
|
||||
Dim sTestVal As String = String.Empty
|
||||
' se non trovo il primo pulsante della lista allora nascondo l'elenco dei pulasnti per accensione
|
||||
' se non trovo il primo pulsante della lista allora nascondo l'elenco dei pulsanti per accensione
|
||||
If GetPrivateProfileString("MachineButtons", K_BUTTON & "1", "", sTestVal, m_MainWindow.GetMachIniFile()) = 0 Then
|
||||
PowerGpBx.Visibility = Visibility.Collapsed
|
||||
Return
|
||||
@@ -323,6 +333,10 @@ Public Class MachineCNPageUC
|
||||
MDITxBx.Background = Brushes.LightGray
|
||||
End Sub
|
||||
|
||||
Private Sub SpecialSend_Click(sender As Object, e As RoutedEventArgs) Handles SpecialSendChBx.Click
|
||||
m_MainWindow.m_CNCommunication.SpecialSend() = If( SpecialSendChBx.IsChecked(), 1, 0)
|
||||
End Sub
|
||||
|
||||
Private Sub PowerON_Click(sender As Object, e As RoutedEventArgs) Handles PowerONBtn.Click
|
||||
Dim PowerOnButton As MachineButton = m_ButtonPower(0)
|
||||
' eseguo lo script lua associato
|
||||
|
||||
@@ -2221,7 +2221,7 @@ Public Class MachiningDbPageUC
|
||||
Friend Function SaveCurrMachining() As Boolean
|
||||
SetMachiningParams()
|
||||
If EgtMdbIsCurrMachiningModified() Then
|
||||
Dim SaveCurrMachiningWnd As New EgtMsgBox(m_MainWindow, "", EgtMsg(91003), EgtMsgBox.Buttons.YES_NO_CANCEL, EgtMsgBox.Icons.NULL) ' Inclinazione
|
||||
Dim SaveCurrMachiningWnd As New EgtMsgBox(m_MainWindow, "", EgtMsg(91103), EgtMsgBox.Buttons.YES_NO_CANCEL, EgtMsgBox.Icons.NULL) ' Inclinazione
|
||||
Select Case SaveCurrMachiningWnd.m_nPressedBtn
|
||||
Case 0 ' Annulla
|
||||
Return False
|
||||
|
||||
+2
-2
@@ -362,8 +362,8 @@ Class MainWindow
|
||||
' Verifico abilitazione nesting automatico
|
||||
m_bAutoNest = Not String.IsNullOrWhiteSpace(sNestKey)
|
||||
' Recupero opzioni della chiave
|
||||
Dim bKey As Boolean = EgtGetKeyLevel(9423, 2707, 1, m_nKeyLevel) And
|
||||
EgtGetKeyOptions(9423, 2707, 1, m_nKeyOptions)
|
||||
Dim bKey As Boolean = EgtGetKeyLevel(9423, 2709, 1, m_nKeyLevel) And
|
||||
EgtGetKeyOptions(9423, 2709, 1, m_nKeyOptions)
|
||||
' Verifico abilitazione prodotto
|
||||
Dim bProd As Boolean = GetKeyOption(KEY_OPT.CUT_BASE)
|
||||
' Impostazione per programma OnlyFrame: solo se CUT_BASE non attivo
|
||||
|
||||
@@ -62,5 +62,5 @@ Imports System.Windows
|
||||
' by using the '*' as shown below:
|
||||
' <Assembly: AssemblyVersion("1.0.*")>
|
||||
|
||||
<Assembly: AssemblyVersion("2.7.8.2")>
|
||||
<Assembly: AssemblyFileVersion("2.7.8.2")>
|
||||
<Assembly: AssemblyVersion("2.7.9.3")>
|
||||
<Assembly: AssemblyFileVersion("2.7.9.3")>
|
||||
|
||||
+107
-33
@@ -20,6 +20,21 @@ Public Class CNCommunication
|
||||
' Variabile per tipologia CN
|
||||
Friend m_nNCType As Integer
|
||||
|
||||
' Modalità speciale invio programmi (attualmente solo per Fanuc, fino a 4 programmi)
|
||||
Private m_nSpecialSend As Integer = -1
|
||||
Friend Property SpecialSend As Integer
|
||||
Get
|
||||
Return m_nSpecialSend
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
value = Math.Max( Math.Min( value, 1), -1)
|
||||
If value <> m_nSpecialSend Then
|
||||
m_nSpecialSend = value
|
||||
WritePrivateProfileString( S_NUMERICALCONTROL, K_SPECIALSEND, value.ToString(), m_MainWindow.GetMachIniFile())
|
||||
End If
|
||||
End Set
|
||||
End Property
|
||||
|
||||
' Variabile che indica il Mode corrente
|
||||
Private m_nCurrMode As Integer = -1
|
||||
|
||||
@@ -98,6 +113,10 @@ Public Class CNCommunication
|
||||
|
||||
EgtOutLog("NcLink=" & m_MainWindow.m_bNCLink.ToString & " type=" & m_nNCType)
|
||||
|
||||
' Leggo flag invio speciale programma di lavoro
|
||||
Dim nTemp As Integer = GetPrivateProfileInt(S_NUMERICALCONTROL, K_SPECIALSEND, -1, m_MainWindow.GetMachIniFile())
|
||||
m_nSpecialSend = Math.Max( Math.Min( nTemp, 1), -1)
|
||||
|
||||
' Se CN Siemens leggo dati programma intermedio di comunicazione
|
||||
If m_nNCType = 3 Then
|
||||
Dim sExeName As String = String.Empty
|
||||
@@ -1183,7 +1202,7 @@ Public Class CNCommunication
|
||||
'Laser = 16384
|
||||
End Enum
|
||||
|
||||
#Region "MASCHERA per conttrollo Bit a Bit"
|
||||
#Region "MASCHERA per controllo Bit a Bit"
|
||||
<Flags()>
|
||||
Public Enum Mask As Integer
|
||||
bit_Err = -1
|
||||
@@ -1568,10 +1587,6 @@ Public Class CNCommunication
|
||||
Optional bActivate As Boolean = True) As Boolean
|
||||
Dim bOk As Boolean = True
|
||||
|
||||
' !!!!!!!!!!!!!!!!!! FORZO IL PROGRAMMA !!!!!!!!!!!!!!!!!!
|
||||
' m_nNCType = 2
|
||||
' !!!!!!!!!!!!!!!!!! FORZO IL PROGRAMMA !!!!!!!!!!!!!!!!!!
|
||||
|
||||
' Download programma
|
||||
If m_MainWindow.m_bNCLink Then
|
||||
bOk = (m_nNCType > 0)
|
||||
@@ -1582,6 +1597,10 @@ Public Class CNCommunication
|
||||
Else
|
||||
sNumProg = nNumProg.ToString()
|
||||
End If
|
||||
' Se Fanuc con trasmissione speciale, disabilito attivazione
|
||||
If m_nNCType = 4 AndAlso m_nSpecialSend = 1 Then
|
||||
bActivate = False
|
||||
End If
|
||||
' Se richiesta successiva attivazione, faccio reset
|
||||
If bActivate Then
|
||||
EgtOutLog("Call function: DGeneralFunctions_Reset")
|
||||
@@ -1600,42 +1619,47 @@ Public Class CNCommunication
|
||||
' Attesa opportuna
|
||||
System.Threading.Thread.Sleep(100)
|
||||
ElseIf m_nNCType = 4 Then
|
||||
' FANUC: imposto modalità EDIT
|
||||
bOk = bOk AndAlso (m_CN.DGeneralFunctions_WriteCncMode(1) = 0)
|
||||
' Attesa opportuna
|
||||
System.Threading.Thread.Sleep(m_MainWindow.m_CurrentMachine.nThreadSleep)
|
||||
' FANUC: imposto modalità EDIT se non special send
|
||||
If m_nSpecialSend <> 1 Then
|
||||
bOk = bOk AndAlso (m_CN.DGeneralFunctions_WriteCncMode(1) = 0)
|
||||
' Attesa opportuna
|
||||
System.Threading.Thread.Sleep(m_MainWindow.m_CurrentMachine.nThreadSleep)
|
||||
End If
|
||||
End If
|
||||
EgtOutLog("Download_NC_prog(" & sCncPath & ", " & sNumProg.ToString & ")")
|
||||
' -------------- START DOWNLOAD --------------
|
||||
TimeSpanInit()
|
||||
bOk = bOk AndAlso (m_CN.Download_NC_prog(sCncPath, sNumProg) = 0)
|
||||
' Attesa opportuna
|
||||
System.Threading.Thread.Sleep(100)
|
||||
' FANUC: genero un file 901 vuoto da aspedire, attivare; poi rispedisco il file 900
|
||||
If m_nNCType = 4 And Not bOk Then
|
||||
bOk = True
|
||||
Dim sCncPath1 As String = m_MainWindow.GetCncDir() & "\PlaceHolder" & m_MainWindow.m_CurrentMachine.sIsoFileExt
|
||||
Dim fs As FileStream = File.Create(sCncPath1)
|
||||
' Add text to the file.
|
||||
Dim info As Byte() = New UTF8Encoding(True).GetBytes(vbLf & "(PlaceHolder)")
|
||||
fs.Write(info, 0, info.Length)
|
||||
fs.Close()
|
||||
bOk = bOk AndAlso (m_CN.Download_NC_prog(sCncPath1, "901") = 0)
|
||||
If m_nNCType = 4 AndAlso m_nSpecialSend = 1 Then
|
||||
bOk = bOk AndAlso SpecialSendProgram(sCncPath, sNumProg)
|
||||
Else
|
||||
bOk = bOk AndAlso (m_CN.Download_NC_prog(sCncPath, sNumProg) = 0)
|
||||
' Attesa opportuna
|
||||
System.Threading.Thread.Sleep(m_MainWindow.m_CurrentMachine.nThreadSleep)
|
||||
If bActivate Then
|
||||
bOk = bOk AndAlso (m_CN.ActivateProgram("901") = 0)
|
||||
System.Threading.Thread.Sleep(100)
|
||||
' FANUC: genero un file 901 vuoto da spedire, attivare; poi rispedisco il file 900
|
||||
If m_nNCType = 4 And Not bOk Then
|
||||
bOk = True
|
||||
Dim sCncPath1 As String = m_MainWindow.GetCncDir() & "\PlaceHolder" & m_MainWindow.m_CurrentMachine.sIsoFileExt
|
||||
Dim fs As FileStream = File.Create(sCncPath1)
|
||||
' Add text to the file.
|
||||
Dim info As Byte() = New UTF8Encoding(True).GetBytes(vbLf & "(PlaceHolder)")
|
||||
fs.Write(info, 0, info.Length)
|
||||
fs.Close()
|
||||
bOk = bOk AndAlso (m_CN.Download_NC_prog(sCncPath1, "901") = 0)
|
||||
' Attesa opportuna
|
||||
System.Threading.Thread.Sleep(m_MainWindow.m_CurrentMachine.nThreadSleep)
|
||||
If bActivate Then
|
||||
bOk = bOk AndAlso (m_CN.ActivateProgram("901") = 0)
|
||||
' Attesa opportuna
|
||||
System.Threading.Thread.Sleep(m_MainWindow.m_CurrentMachine.nThreadSleep)
|
||||
End If
|
||||
' riprovo ad eseguire il programma 900
|
||||
bOk = True
|
||||
bOk = bOk AndAlso (m_CN.Download_NC_prog(sCncPath, sNumProg) = 0)
|
||||
' Attesa opportuna
|
||||
System.Threading.Thread.Sleep(m_MainWindow.m_CurrentMachine.nThreadSleep)
|
||||
End If
|
||||
' riprovo ad eseguire il programma 900
|
||||
bOk = True
|
||||
bOk = bOk AndAlso (m_CN.Download_NC_prog(sCncPath, sNumProg) = 0)
|
||||
' Attesa opportuna
|
||||
System.Threading.Thread.Sleep(m_MainWindow.m_CurrentMachine.nThreadSleep)
|
||||
End If
|
||||
EgtOutLog("Nc Type : " & m_nNCType.ToString)
|
||||
' AXIUM (NUM OLD): se DripFeed non esegluo attivazione programma)
|
||||
' AXIUM (NUM OLD): se DripFeed non eseguo attivazione programma)
|
||||
If m_nNCType = 1 AndAlso m_CN.bIsDripFeed Then
|
||||
' eventauli cambi di stato sono trattati all'interno della funzione DownLoad_NC_prog
|
||||
Return True
|
||||
@@ -1652,7 +1676,7 @@ Public Class CNCommunication
|
||||
EgtOutLog(TimeSpanEnd())
|
||||
' Attesa opportuna
|
||||
System.Threading.Thread.Sleep(100)
|
||||
' Attivo la modalità AUTO prima per preparar il cyclo start
|
||||
' Attivo la modalità AUTO prima per preparare il cyclo start
|
||||
bOk = bOk AndAlso (m_CN.DGeneralFunctions_WriteCncMode(0) = 0)
|
||||
' Attesa opportuna
|
||||
System.Threading.Thread.Sleep(100)
|
||||
@@ -1675,6 +1699,56 @@ Public Class CNCommunication
|
||||
Return bOk
|
||||
End Function
|
||||
|
||||
Private Function SpecialSendProgram(sz_PC_filename As String, sz_NC_filename As String) As Boolean
|
||||
' Solo per Fanuc
|
||||
If m_nNCType <> 4 Then Return False
|
||||
' Indice base
|
||||
Dim nBase As Integer = 900
|
||||
' Ho possibilità di trasmettere in 4 aree consecutive (901, 902, 903 e 904)
|
||||
For I As Integer = 1 To 4
|
||||
' Leggo la variabile semaforo dell'area I-esima
|
||||
Dim nVal As Integer = -1
|
||||
Dim sVar As String = "#" & (nBase + I).ToString()
|
||||
EgtOutLog( "IndVar=" & sVar)
|
||||
For J As Integer = 1 To 20
|
||||
' Devo rileggere la variabile ad ogni ciclo
|
||||
m_CN.ReadEls_Add_Parameter(sVar, 3)
|
||||
System.Threading.Thread.Sleep(100)
|
||||
If m_CN.n_DReadELS_handle = 3 Then
|
||||
nVal = CInt(m_MainWindow.m_CNCommunication.m_CN.d_DReadELS_value)
|
||||
EgtOutLog( "Value=" & nVal.ToString())
|
||||
If nVal <> -1 Then
|
||||
Exit For
|
||||
End If
|
||||
End If
|
||||
Next
|
||||
' Se posso trasmettere
|
||||
If nVal = 0 Then
|
||||
' Assegno numero di programma
|
||||
Dim sNumProg As String = "O0" & ( nBase + I).ToString()
|
||||
EgtOutLog( "NumProg=" & sNumProg)
|
||||
' Eseguo trasmissione
|
||||
Dim bOk As Boolean = ( m_CN.Download_NC_prog(sz_PC_filename, sNumProg) = 0)
|
||||
System.Threading.Thread.Sleep(100)
|
||||
EgtOutLog( "SendResult=" & bOk.ToString())
|
||||
' Se non riuscita riprovo
|
||||
If Not bOk Then
|
||||
bOk = ( m_CN.Download_NC_prog(sz_PC_filename, sNumProg) = 0)
|
||||
System.Threading.Thread.Sleep(100)
|
||||
EgtOutLog( "SecondSendResult=" & bOk.ToString())
|
||||
End If
|
||||
' Se andata a buon fine
|
||||
If bOk Then
|
||||
' Dichiaro programma trasmesso
|
||||
m_MainWindow.m_CNCommunication.m_CN.DVariables_WriteVariables2(sVar, "1")
|
||||
System.Threading.Thread.Sleep(100)
|
||||
Return True
|
||||
End If
|
||||
End If
|
||||
Next
|
||||
Return False
|
||||
End Function
|
||||
|
||||
Private Sub GetSpecialCAxes()
|
||||
If m_CN.bCPos Then
|
||||
m_CN.d_axis_position(m_nA4) = m_CN.dCPos
|
||||
|
||||
+5
-1
@@ -1372,7 +1372,11 @@ Module M_Fanuc
|
||||
FileOpen(nFilew, szFileProgramma, OpenMode.Output)
|
||||
|
||||
' PrintLine(nFilew, "%" & vbLf & "<" & NomeSend & ">") ' !!!!!!!! da spostare
|
||||
PrintLine(nFilew, vbLf & "<" & NomeSend & ">") ' !!
|
||||
If NomeSend.StartsWith( "O") Then
|
||||
PrintLine(nFilew, vbLf & NomeSend) ' !!
|
||||
Else
|
||||
PrintLine(nFilew, vbLf & "<" & NomeSend & ">") ' !!
|
||||
End If
|
||||
|
||||
'trascrivo file tranne prima linea
|
||||
While (Not EOF(nFiler))
|
||||
|
||||
@@ -766,7 +766,8 @@ Public Class ProjectMgrUC
|
||||
End If
|
||||
|
||||
'------------------- INIZIO Avvio il Ciclo-Start-------------------------
|
||||
If GetPrivateProfileInt(S_GENERAL, K_STARTPROGRAM, 0, m_MainWindow.GetIniFile()) <> 0 Then
|
||||
If GetPrivateProfileInt(S_GENERAL, K_STARTPROGRAM, 0, m_MainWindow.GetIniFile()) <> 0 AndAlso
|
||||
( m_MainWindow.m_CNCommunication.m_nNCType <> 4 Or m_MainWindow.m_CNCommunication.SpecialSend <> 1) Then
|
||||
Dim MyCicloStartWD As New CicloStartWD(m_MainWindow)
|
||||
MyCicloStartWD.ShowDialog()
|
||||
End If
|
||||
|
||||
+32
-27
@@ -26,28 +26,19 @@ Public Class Camera
|
||||
Private m_bCalcContour As Boolean = False
|
||||
Private m_nCameraCount As Integer = 0
|
||||
Private m_sCameraPath As String = String.Empty
|
||||
'Private m_sCameraPath2 As String = String.Empty
|
||||
Private m_sCameraProcName As String = String.Empty
|
||||
'Private m_sCameraProcName2 As String = String.Empty
|
||||
Private m_sImage As String = String.Empty
|
||||
'Private m_sImage2 As String = String.Empty
|
||||
Private m_sInfo As String = String.Empty
|
||||
'Private m_sInfo2 As String = String.Empty
|
||||
Private m_sResult As String = String.Empty
|
||||
'Private m_sResult2 As String = String.Empty
|
||||
Private m_sContour As String = String.Empty
|
||||
'Private m_sContour2 As String = String.Empty
|
||||
Private m_nThreshold As Integer = 60
|
||||
Private m_dTolerance As Double = 5
|
||||
Private m_nTimeout As Integer = 30
|
||||
Private m_sImageDir As String = String.Empty
|
||||
|
||||
Private Const CAMERAMNG As String = "CameraMng"
|
||||
Private Const N_LOOP As Integer = 20
|
||||
|
||||
'Public m_ProcessCmg As New Process()
|
||||
|
||||
' Lista dei processi Cmg associati ad igni tavola
|
||||
' Lista dei processi Cmg associati ad ogni tavola
|
||||
Public m_ProcessCmgList As New List(Of Process)
|
||||
' restituisce lo stato che il processo associato alla tavola corrente (PrepareCamera)
|
||||
Private m_bIsRunnigProc As Boolean = False
|
||||
@@ -96,6 +87,8 @@ Public Class Camera
|
||||
(GetPrivateProfileInt(S_GENERAL, K_CONTOURFROMCAMERA, 1, m_MainWindow.GetIniFile()) <> 0)
|
||||
' Ricavo il nome del processo associato
|
||||
m_sCameraProcName = Path.GetFileNameWithoutExtension(m_sCameraPath)
|
||||
' Terminazione di eventuali processi omonimi in esecuzione
|
||||
KillPreviousProcesses()
|
||||
' Avvio processi del camera manager per ogni tavola
|
||||
CamerasHide()
|
||||
Return True
|
||||
@@ -104,7 +97,7 @@ Public Class Camera
|
||||
Public Function Close() As Boolean
|
||||
If m_bBusy Then Return False
|
||||
If m_bCameraLink Then
|
||||
KillProcess()
|
||||
KillProcesses()
|
||||
End If
|
||||
Return True
|
||||
End Function
|
||||
@@ -179,7 +172,7 @@ Public Class Camera
|
||||
' Indice di processo uguale all'indice della tavola
|
||||
nIndProc = nIndTab
|
||||
Case 1
|
||||
' Alla tavola 1 possono essre associati 2 processi (solo se camera Hq abilitata e attiva)
|
||||
' Alla tavola 1 possono essere associati 2 processi (solo se camera Hq abilitata e attiva)
|
||||
If nIndTab = 1 And
|
||||
(GetPrivateProfileInt(S_CAMERAHQ, K_CAMERAHQ_ENABLE, 0, m_MainWindow.GetMachIniFile()) <> 0) AndAlso
|
||||
(GetPrivateProfileInt(S_CAMERAHQ, K_CAMERAHQ_ACTIVATE, 0, m_MainWindow.GetMachIniFile()) <> 0) Then
|
||||
@@ -467,10 +460,12 @@ Public Class Camera
|
||||
GetPrivateProfileString(S_CAMERA, K_CAM_RESULT, "", m_sResult, m_MainWindow.GetIniFile())
|
||||
GetPrivateProfileString(S_CAMERA, K_CAM_CONTOUR, "", m_sContour, m_MainWindow.GetIniFile())
|
||||
|
||||
m_sImage = m_sImage.Replace(CAMERAMNG, CAMERAMNG & (nIndProc).ToString())
|
||||
m_sInfo = m_sInfo.Replace(CAMERAMNG, CAMERAMNG & (nIndProc).ToString())
|
||||
m_sResult = m_sResult.Replace(CAMERAMNG, CAMERAMNG & (nIndProc).ToString())
|
||||
m_sContour = m_sContour.Replace(CAMERAMNG, CAMERAMNG & (nIndProc).ToString())
|
||||
If nIndProc <> 1 Then
|
||||
m_sImage = m_sImage.Replace(m_sCameraProcName, m_sCameraProcName & (nIndProc).ToString())
|
||||
m_sInfo = m_sInfo.Replace(m_sCameraProcName, m_sCameraProcName & (nIndProc).ToString())
|
||||
m_sResult = m_sResult.Replace(m_sCameraProcName, m_sCameraProcName & (nIndProc).ToString())
|
||||
m_sContour = m_sContour.Replace(m_sCameraProcName, m_sCameraProcName & (nIndProc).ToString())
|
||||
End If
|
||||
|
||||
Return If(m_bIsRunnigProc, nIndProc, -1)
|
||||
End Function
|
||||
@@ -799,20 +794,30 @@ Public Class Camera
|
||||
Return bOk
|
||||
End Function
|
||||
|
||||
Private Function ProcessIsRunning() As Boolean
|
||||
' OK: chiudo tutti i processi di CameraMng in esecuzione prima dell'avvio
|
||||
Private Sub KillPreviousProcesses()
|
||||
If Not m_bCameraLink Then Return
|
||||
Dim Procs() As Process
|
||||
Procs = Process.GetProcessesByName(m_sCameraProcName)
|
||||
Return (Procs.Length() > 0)
|
||||
End Function
|
||||
For i As Integer = 0 To Procs.Count() - 1
|
||||
Try
|
||||
Procs(i).Kill()
|
||||
Procs(i).WaitForExit( 50)
|
||||
Catch Ex As Exception
|
||||
EgtOutLog(ex.Message())
|
||||
End Try
|
||||
Next
|
||||
End Sub
|
||||
|
||||
' OK: chiudo tutti i processi che hanno il nome CameraMng.exe
|
||||
Private Sub KillProcess()
|
||||
Dim Procs() As Process
|
||||
Procs = Process.GetProcessesByName(m_sCameraProcName)
|
||||
For i As Integer = 0 To Procs.Length() - 1
|
||||
Procs(i).Kill()
|
||||
Procs(i).WaitForExit(2000)
|
||||
Next i
|
||||
' OK: chiudo tutti i processi di CameraMng lanciati
|
||||
Private Sub KillProcesses()
|
||||
For i As Integer = 0 To m_ProcessCmgList.Count() - 1
|
||||
Try
|
||||
m_ProcessCmgList(i).Kill()
|
||||
Catch Ex As Exception
|
||||
EgtOutLog(ex.Message())
|
||||
End Try
|
||||
Next
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
|
||||
Reference in New Issue
Block a user