Aggiunte funzioni per gestione CN Axium DripFeed

This commit is contained in:
Nicola Pievani
2023-02-27 19:28:46 +01:00
parent d9de23daca
commit e7e9d26b75
4 changed files with 897 additions and 793 deletions
+2 -2
View File
@@ -62,5 +62,5 @@ Imports System.Windows
' by using the '*' as shown below:
' <Assembly: AssemblyVersion("1.0.*")>
<Assembly: AssemblyVersion("2.5.2.1")>
<Assembly: AssemblyFileVersion("2.5.2.1")>
<Assembly: AssemblyVersion("2.5.2.2")>
<Assembly: AssemblyFileVersion("2.5.2.2")>
+24 -2
View File
@@ -2,6 +2,7 @@
Imports System.Globalization
Imports System.Collections.ObjectModel
Imports EgtUILib
Imports OmagCUT.Num
Public Class CNCommunication
@@ -354,8 +355,8 @@ Public Class CNCommunication
If Not String.IsNullOrEmpty(sVal) Then m_CN.SetCnDataVar(CN_generico.CnData.Remote, sVal)
End If
' Inizializzo la comunicazione
m_CN.Init()
' Inizializzo la comunicazione
m_CN.Init()
Catch ex As Exception
' set status to statusbar
@@ -907,28 +908,49 @@ Public Class CNCommunication
End If
' Se richiesta successiva attivazione, faccio reset
If bActivate Then
EgtOutLog("Call function: DGeneralFunctions_Reset")
TimeSpanInit()
m_CN.DGeneralFunctions_Reset()
EgtOutLog(TimeSpanEnd())
End If
' Attesa opportuna
System.Threading.Thread.Sleep(m_MainWindow.m_CurrentMachine.nResetSendDelay)
If m_nNCType = 1 Then
' Cancellazione eventuale file già presente con lo stesso nome (ignoro eventuale errore)
EgtOutLog("Delete_NC_prog(sNumProg)")
TimeSpanInit()
m_CN.Delete_NC_prog(sNumProg)
EgtOutLog(TimeSpanEnd())
' Attesa opportuna
System.Threading.Thread.Sleep(100)
End If
EgtOutLog("Download_NC_prog(sCncPath, sNumProg)")
TimeSpanInit()
bOk = bOk AndAlso (m_CN.Download_NC_prog(sCncPath, sNumProg) = 0)
If m_nNCType = 1 AndAlso TypeOf m_CN Is NumNCOld AndAlso DirectCast(m_CN, NumNCOld).bIsDripFeed Then
' eventauli cambi di stato sono trattati all'interno della funzione
Return True
End If
EgtOutLog(TimeSpanEnd())
' Attesa opportuna
System.Threading.Thread.Sleep(100)
' Se richiesta attivazione
If bActivate Then
' Attivazione programma
EgtOutLog("ActivateProgram(nNumProg)")
TimeSpanInit()
bOk = bOk AndAlso (m_CN.ActivateProgram(nNumProg) = 0)
EgtOutLog(TimeSpanEnd())
' Attesa opportuna
System.Threading.Thread.Sleep(100)
' Modalità automatica
EgtOutLog("DGeneralFunctions_WriteCncMode(0)")
TimeSpanInit()
bOk = bOk AndAlso (m_CN.DGeneralFunctions_WriteCncMode(0) = 0)
EgtOutLog(TimeSpanEnd())
End If
' Messaggio con risultato
If bOk Then
m_CurrProjPage.SetInfoMessage(EgtMsg(90317)) 'Programma CN trasmesso con successo
+851 -787
View File
File diff suppressed because it is too large Load Diff
+20 -2
View File
@@ -1,4 +1,5 @@
Imports System.Globalization
Imports System.Diagnostics
Imports System.Collections.ObjectModel
Imports System.Text.RegularExpressions
Imports EgtWPFLib
@@ -17,8 +18,25 @@ Module Utility
End Function
'--------------------------------------------------------------------------------------------------
Friend Sub UpdateUI()
Friend StopWatch As Stopwatch
Friend Sub TimeSpanInit()
StopWatch = New Stopwatch
StopWatch.Start()
End Sub
Friend Function TimeSpanEnd()
Dim sTime As String = ""
If Not IsNothing(StopWatch) Then
StopWatch.Stop()
Dim ts As TimeSpan = StopWatch.Elapsed
sTime = String.Format("{0:00}:{1:00}:{2:00}.{3:000}", ts.Hours, ts.Minutes, ts.Seconds, ts.Milliseconds)
End If
Return sTime
End Function
'--------------------------------------------------------------------------------------------------
Friend Sub UpdateUI()
' Costringo ad aggiornare UI
Dim nDummy As Integer
Application.Current.Dispatcher.Invoke(Windows.Threading.DispatcherPriority.Background, _