diff --git a/DirectCuts/FlatteningCut.xaml.vb b/DirectCuts/FlatteningCut.xaml.vb index 48353e9..b48c0ef 100644 --- a/DirectCuts/FlatteningCut.xaml.vb +++ b/DirectCuts/FlatteningCut.xaml.vb @@ -580,7 +580,7 @@ Public Class FlatteningCut Dim sWrkPath As String = m_MainWindow.GetTempDir() & "\" & "WorkProj.nge" My.Computer.FileSystem.CopyFile(sMchPath, sWrkPath, True) ' lancio eventuale lua post-trasmissione - m_MainWindow.ExecSentProgScript() + m_MainWindow.ExecSentProgScript( True) End If #End If End Sub diff --git a/DirectCuts/GridCut.xaml.vb b/DirectCuts/GridCut.xaml.vb index cd07cd0..3ce6bf2 100644 --- a/DirectCuts/GridCut.xaml.vb +++ b/DirectCuts/GridCut.xaml.vb @@ -514,7 +514,7 @@ Public Class GridCut Dim sWrkPath As String = m_MainWindow.GetTempDir() & "\" & "WorkProj.nge" My.Computer.FileSystem.CopyFile(sMchPath, sWrkPath, True) ' lancio eventuale lua post-trasmissione - m_MainWindow.ExecSentProgScript() + m_MainWindow.ExecSentProgScript( True) End If #End If End Sub diff --git a/DirectCuts/MultipleCut.xaml.vb b/DirectCuts/MultipleCut.xaml.vb index 2e6f014..19392a2 100644 --- a/DirectCuts/MultipleCut.xaml.vb +++ b/DirectCuts/MultipleCut.xaml.vb @@ -558,7 +558,7 @@ Public Class MultipleCut Dim sWrkPath As String = m_MainWindow.GetTempDir() & "\" & "WorkProj.nge" My.Computer.FileSystem.CopyFile(sMchPath, sWrkPath, True) ' lancio eventuale lua post-trasmissione - m_MainWindow.ExecSentProgScript() + m_MainWindow.ExecSentProgScript( True) End If #End If End Sub diff --git a/DirectCuts/Polishing.xaml.vb b/DirectCuts/Polishing.xaml.vb index 8bdc42c..fd80210 100644 --- a/DirectCuts/Polishing.xaml.vb +++ b/DirectCuts/Polishing.xaml.vb @@ -182,7 +182,7 @@ Public Class Polishing Dim sWrkPath As String = m_MainWindow.GetTempDir() & "\" & "WorkProj.nge" My.Computer.FileSystem.CopyFile(sMchPath, sWrkPath, True) ' lancio eventuale lua post-trasmissione - m_MainWindow.ExecSentProgScript() + m_MainWindow.ExecSentProgScript( True) End If #End If End Sub diff --git a/DirectCuts/SawTestUC.xaml.vb b/DirectCuts/SawTestUC.xaml.vb index fa4910f..693a3ba 100644 --- a/DirectCuts/SawTestUC.xaml.vb +++ b/DirectCuts/SawTestUC.xaml.vb @@ -453,7 +453,7 @@ Public Class SawTestUC Dim sWrkPath As String = m_MainWindow.GetTempDir() & "\" & "WorkProj.nge" My.Computer.FileSystem.CopyFile(sMchPath, sWrkPath, True) ' lancio eventuale lua post-trasmissione - m_MainWindow.ExecSentProgScript() + m_MainWindow.ExecSentProgScript( True) End If #End If End Sub diff --git a/DirectCuts/SingleCutAuto.xaml.vb b/DirectCuts/SingleCutAuto.xaml.vb index 744b186..fc3d8fd 100644 --- a/DirectCuts/SingleCutAuto.xaml.vb +++ b/DirectCuts/SingleCutAuto.xaml.vb @@ -659,7 +659,7 @@ Public Class SingleCutAuto Dim sWrkPath As String = m_MainWindow.GetTempDir() & "\" & "WorkProj.nge" My.Computer.FileSystem.CopyFile(sMchPath, sWrkPath, True) ' lancio eventuale lua post-trasmissione - m_MainWindow.ExecSentProgScript() + m_MainWindow.ExecSentProgScript( True) End If #End If End Sub diff --git a/DirectCuts/SingleCutUC.xaml.vb b/DirectCuts/SingleCutUC.xaml.vb index d126deb..ea4fdf8 100644 --- a/DirectCuts/SingleCutUC.xaml.vb +++ b/DirectCuts/SingleCutUC.xaml.vb @@ -538,7 +538,7 @@ Public Class SingleCutUC Dim sWrkPath As String = m_MainWindow.GetTempDir() & "\" & "WorkProj.nge" My.Computer.FileSystem.CopyFile(sMchPath, sWrkPath, True) ' lancio eventuale lua post-trasmissione - m_MainWindow.ExecSentProgScript() + m_MainWindow.ExecSentProgScript( True) End If #End If End Sub diff --git a/MainWindow.xaml.vb b/MainWindow.xaml.vb index 3586ca7..fff9642 100644 --- a/MainWindow.xaml.vb +++ b/MainWindow.xaml.vb @@ -1611,7 +1611,7 @@ Class MainWindow Return True End Function - Friend Function ExecSentProgScript( Optional bAlreadySent As Boolean = False) As Boolean + Friend Function ExecSentProgScript( bDirectCut As Boolean, Optional bAlreadySent As Boolean = False) As Boolean ' Verifico esistenza script Dim sLuaPath As String = m_CurrentMachine.sMachDir() & "\Scripts\SentProg.lua" If Not My.Computer.FileSystem.FileExists(sLuaPath) Then Return True @@ -1620,6 +1620,7 @@ Class MainWindow EgtLuaSetGlobBoolVar("SPS.NCLINK", m_bNCLink) EgtLuaSetGlobBoolVar("SPS.PRODLINE", m_CurrentMachine.bProdLine) EgtLuaSetGlobBoolVar("SPS.ALREADYSENT", bAlreadySent) + EgtLuaSetGlobBoolVar("SPS.DIRECTCUT", bDirectCut) ' Esecuzione Dim nErr As Integer = 999 If EgtLuaExecFile(sLuaPath) AndAlso diff --git a/Project/ProjectMgrUC.xaml.vb b/Project/ProjectMgrUC.xaml.vb index 6883040..b37f8c4 100644 --- a/Project/ProjectMgrUC.xaml.vb +++ b/Project/ProjectMgrUC.xaml.vb @@ -324,6 +324,7 @@ Public Class ProjectMgrUC Case 2 ' NO EgtEnableModified() m_CurrProjPage.ResetProjectNcRestart() + nPhaseRestart = 0 EgtDisableModified() Case Else ' CANCEL Return @@ -358,9 +359,9 @@ Public Class ProjectMgrUC ' copio il progetto corrente come progetto in lavorazione Dim sWrkPath As String = m_MainWindow.GetTempDir() & "\" & "WorkProj.nge" My.Computer.FileSystem.CopyFile(sMchPath, sWrkPath, True) - ' se abilitato, lancio eventuale lua post-trasmissione - If m_MainWindow.GetKeyOption( MainWindow.KEY_OPT.SIMPLESTATISTICS) Then - m_MainWindow.ExecSentProgScript() + ' se abilitato e non è restart, lancio eventuale lua post-trasmissione + If m_MainWindow.GetKeyOption( MainWindow.KEY_OPT.SIMPLESTATISTICS) And nPhaseRestart = 0 Then + m_MainWindow.ExecSentProgScript( False) End If End If ' Altrimenti linea di produzione @@ -436,7 +437,7 @@ Public Class ProjectMgrUC ' Salvo il progetto m_CurrProjPage.SaveProject() ' lancio eventuale lua post-trasmissione - m_MainWindow.ExecSentProgScript( bAlreadySent) + m_MainWindow.ExecSentProgScript( False, bAlreadySent) Return End If ' Leggo variabile relativa al programma 1 (standard E80021) @@ -488,7 +489,7 @@ Public Class ProjectMgrUC ' Dichiaro programma inviato m_CurrNcComm.m_CN.DVariables_WriteVariables2(m_CurrMachine.sVarProg1, "1") ' lancio eventuale lua post-trasmissione - m_MainWindow.ExecSentProgScript( bAlreadySent) + m_MainWindow.ExecSentProgScript( False, bAlreadySent) End If m_CurrNcComm.SetProgramMainOrSub(True) ' Altrimenti verifico se posso scrivere nell'area 2 @@ -505,7 +506,7 @@ Public Class ProjectMgrUC ' Dichiaro programma inviato m_CurrNcComm.m_CN.DVariables_WriteVariables2(m_CurrMachine.sVarProg2, "1") ' lancio eventuale lua post-trasmissione - m_MainWindow.ExecSentProgScript( bAlreadySent) + m_MainWindow.ExecSentProgScript( False, bAlreadySent) End If m_CurrNcComm.SetProgramMainOrSub(True) ' Altrimenti aree di memoria non disponibili diff --git a/Simulation/SimulationPageUC.xaml.vb b/Simulation/SimulationPageUC.xaml.vb index 8937431..51519b0 100644 --- a/Simulation/SimulationPageUC.xaml.vb +++ b/Simulation/SimulationPageUC.xaml.vb @@ -293,6 +293,8 @@ Public Class SimulationPageUC Private Sub SkipForRestart() ' Se non c'è restart esco If m_nRestart = 0 Then Return + ' Se tagli diretti restart non valido ed esco + If GetDirectCutPart() <> GDB_ID.NULL Then Return ' Info m_CurrProjPage.SetInfoMessage( EgtMsg(90359) & " (" & m_nRestart.ToString() & ")") 'Restart (n) ' Salto