Attivazione modalità auto prima di DripFeed

This commit is contained in:
Nicola Pievani
2023-03-10 16:27:48 +01:00
parent 6f59cddd80
commit 4ce898c25c
3 changed files with 26 additions and 8 deletions
+8 -2
View File
@@ -1088,10 +1088,16 @@ Class MainWindow
m_CurrentProjectPageUC.SaveProject()
End If
' Inizio la chiusura del programma (verifico di aver terminato il processo DripFeed)
EgtOutLog("Iniziato processo di chiusura programma")
m_IsClosingApplication = 1
Dim nCount As Integer = 0
While m_IsClosingApplication <> 2 Or nCount < 10
Thread.Sleep(500)
While m_IsClosingApplication <> 2
If nCount > 5 Then
Exit While
End If
' verifico che il processo DripFeed sia terminato
EgtOutLog("Stato chiusura programma: " & m_IsClosingApplication.ToString)
Thread.Sleep(100)
nCount += 1
End While
' Uscita
+8 -3
View File
@@ -620,12 +620,17 @@ Public Class CNCommunication
End If
' Nuove bottoni (Power Macchina)
If m_IsNewConsole AndAlso m_MainWindow.m_ActivePage = MainWindow.Pages.Machine Then
m_MainWindow.m_MachinePageUC.m_MachineCNPageUC.PowerONChanged(m_CN.bPowerON)
m_MainWindow.m_MachinePageUC.m_MachineCNPageUC.PowerOFFChanged(Not m_CN.bPowerON)
If m_MainWindow.m_ActivePage = MainWindow.Pages.Machine Then
If m_IsNewConsole Then
m_MainWindow.m_MachinePageUC.m_MachineCNPageUC.PowerONChanged(m_CN.bPowerON)
m_MainWindow.m_MachinePageUC.m_MachineCNPageUC.PowerOFFChanged(Not m_CN.bPowerON)
m_MainWindow.m_MachinePageUC.m_MachineCNPageUC.CncModeChange(m_CN.nMachineMode)
End If
m_MainWindow.m_MachinePageUC.m_MachineCNPageUC.CncModeChange(m_CN.nMachineMode)
End If
If m_MainWindow.m_ActivePage = MainWindow.Pages.WorkInProgress Then
m_MainWindow.m_WorkInProgressPageUC.m_MachineButtons.SpindleStateChanged(m_CN.bSpindleState)
m_MainWindow.m_WorkInProgressPageUC.m_MachineButtons.CoolantStateChanged(m_CN.bCoolantState OrElse m_CN.bInternalCoolantState OrElse m_CN.bExternCoolantState)
+10 -3
View File
@@ -14,6 +14,7 @@ Imports System.Threading
Imports System.Windows.Threading
Imports System.Reflection.Emit
Imports System.Drawing.Text
Imports OmagCUT.CN_Siemens
Namespace Num
@@ -40,7 +41,7 @@ Namespace Num
m_MainWindow.m_CurrentProjectPageUC.SetInfoMessage(EgtMsg(m_nMsg))
ElseIf m_nMsg < 0 Then
m_MainWindow.m_CurrentProjectPageUC.ClearMessage()
m_MainWindow.m_CurrentProjectPageUC.SetErrorMessage(EgtMsg(Math.Abs(m_nMsg)))
m_MainWindow.m_CurrentProjectPageUC.SetWarningMessage(EgtMsg(Math.Abs(m_nMsg)))
End If
' dopo la stampa del messaggio resetto l'indice
m_nMsg = 0
@@ -538,6 +539,8 @@ Namespace Num
If nret <> 0 Then
EgtOutLog("Error in set_NC_mode(" & n_mode.ToString() & ") : " & nret.ToString())
Else
EgtOutLog("set_NC_mode(" & n_mode.ToString() & ") : " & nret.ToString() & " → ok")
End If
global_state = eStateType.READY
@@ -875,6 +878,10 @@ Namespace Num
If sizeInBytes > 32000 Then
' Trasmetto il programma (asincrono)
EgtOutLog(" --- START DOWNLOAD PPP FILE --- ")
' Imposto la modalità AUTO
set_NC_mode(0)
' Attesa opportuna
System.Threading.Thread.Sleep(1000)
' 90969=Drip feed has been started
m_nMsg = 90969
bIsDripFeed = True
@@ -931,7 +938,7 @@ Namespace Num
If nRet <> DNC_IN_PROGRES And nRet <> DNC_RING_BUFFER_FULL And m_MainWindow.m_IsClosingApplication <> 1 Then
' 90970=Drip feed has been failed (Error)
m_nMsg = -90970
EgtOutLog("Error in Download_NC_prog/DownLoadPPPFile : " & nRet.ToString() & ", DownLoadPPPFile is aborted")
EgtOutLog("Error in Download_NC_prog/DownLoadPPPFile : " & nRet.ToString())
Else
' 90969=Drip feed has been started (Info)
m_nMsg = 90969
@@ -949,7 +956,7 @@ Namespace Num
' se in precedenza non è stato generato un messaggio di errore (m_nMsg = -90970) comunico che il processo è stato interrotto
m_nMsg = -90971
End If
EgtOutLog("Error in Download_NC_prog/DownLoadPPPFile : " & nRet.ToString())
EgtOutLog("Error in Download_NC_prog/DownLoadPPPFile : " & nRet.ToString() & ", DownLoadPPPFile is aborted")
Else
' 90972=Drip feed has been ended (Info)
m_nMsg = 90972