Compare commits

...

2 Commits

Author SHA1 Message Date
Nicola Pievani fcca1ed72c - Inseriti commenti per lettura variabili CurrPhase - Definizione nome programma tagli diretti 2024-02-08 18:12:46 +01:00
Nicola Pievani 36b667fcc5 Lettura variabile opzionale della fase corrente 2024-02-08 12:18:00 +01:00
11 changed files with 60 additions and 29 deletions
+4 -2
View File
@@ -600,13 +600,15 @@ Public Class FlatteningCut
m_CurrProjPage.SetErrorMessage(EgtMsg(90314)) 'Errore nella generazione del programma CN
Return
End If
Dim sNameProg As Integer = 900
sNameProg = GetPrivateProfileInt(S_PARTPROGRAM, "NameProg", sNameProg, m_MainWindow.GetMachIniFile)
' Download programma (eventuali errori sono segnalati dalla funzione)
If m_MainWindow.m_CNCommunication.SendProgram(sCncPath, 900) Then
If m_MainWindow.m_CNCommunication.SendProgram(sCncPath, sNameProg) Then
' copio il progetto corrente come progetto in lavorazione
Dim sWrkPath As String = m_MainWindow.GetTempDir() & "\" & "WorkProj.nge"
My.Computer.FileSystem.CopyFile(sMchPath, sWrkPath, True)
' lancio eventuale lua post-trasmissione
m_MainWindow.ExecSentProgScript( True)
m_MainWindow.ExecSentProgScript(True)
End If
#End If
End Sub
+4 -2
View File
@@ -535,13 +535,15 @@ Public Class GridCut
m_CurrProjPage.SetErrorMessage(EgtMsg(90314)) 'Errore nella generazione del programma CN
Return
End If
Dim sNameProg As Integer = 900
sNameProg = GetPrivateProfileInt(S_PARTPROGRAM, "NameProg", sNameProg, m_MainWindow.GetMachIniFile)
' Download programma (eventuali errori sono segnalati dalla funzione)
If m_MainWindow.m_CNCommunication.SendProgram(sCncPath, 900) Then
If m_MainWindow.m_CNCommunication.SendProgram(sCncPath, sNameProg) Then
' copio il progetto corrente come progetto in lavorazione
Dim sWrkPath As String = m_MainWindow.GetTempDir() & "\" & "WorkProj.nge"
My.Computer.FileSystem.CopyFile(sMchPath, sWrkPath, True)
' lancio eventuale lua post-trasmissione
m_MainWindow.ExecSentProgScript( True)
m_MainWindow.ExecSentProgScript(True)
End If
#End If
End Sub
+4 -2
View File
@@ -580,13 +580,15 @@ Public Class MultipleCut
m_CurrProjPage.SetErrorMessage(EgtMsg(90314)) 'Errore nella generazione del programma CN
Return
End If
Dim sNameProg As Integer = 900
sNameProg = GetPrivateProfileInt(S_PARTPROGRAM, "NameProg", sNameProg, m_MainWindow.GetMachIniFile)
' Download programma (eventuali errori sono segnalati dalla funzione)
If m_MainWindow.m_CNCommunication.SendProgram(sCncPath, 900) Then
If m_MainWindow.m_CNCommunication.SendProgram(sCncPath, sNameProg) Then
' copio il progetto corrente come progetto in lavorazione
Dim sWrkPath As String = m_MainWindow.GetTempDir() & "\" & "WorkProj.nge"
My.Computer.FileSystem.CopyFile(sMchPath, sWrkPath, True)
' lancio eventuale lua post-trasmissione
m_MainWindow.ExecSentProgScript( True)
m_MainWindow.ExecSentProgScript(True)
End If
#End If
End Sub
+4 -2
View File
@@ -180,13 +180,15 @@ Public Class Polishing
m_CurrProjPage.SetErrorMessage(EgtMsg(90314)) 'Errore nella generazione del programma CN
Return
End If
Dim sNameProg As Integer = 900
sNameProg = GetPrivateProfileInt(S_PARTPROGRAM, "NameProg", sNameProg, m_MainWindow.GetMachIniFile)
' Download programma (eventuali errori sono segnalati dalla funzione)
If m_MainWindow.m_CNCommunication.SendProgram(sCncPath, 900) Then
If m_MainWindow.m_CNCommunication.SendProgram(sCncPath, sNameProg) Then
' copio il progetto corrente come progetto in lavorazione
Dim sWrkPath As String = m_MainWindow.GetTempDir() & "\" & "WorkProj.nge"
My.Computer.FileSystem.CopyFile(sMchPath, sWrkPath, True)
' lancio eventuale lua post-trasmissione
m_MainWindow.ExecSentProgScript( True)
m_MainWindow.ExecSentProgScript(True)
End If
#End If
End Sub
+4 -2
View File
@@ -450,13 +450,15 @@ Public Class SawTestUC
m_CurrProjPage.SetErrorMessage(EgtMsg(90314)) 'Errore nella generazione del programma CN
Return
End If
Dim sNameProg As Integer = 900
sNameProg = GetPrivateProfileInt(S_PARTPROGRAM, "NameProg", sNameProg, m_MainWindow.GetMachIniFile)
' Download programma (eventuali errori sono segnalati dalla funzione)
If m_MainWindow.m_CNCommunication.SendProgram(sCncPath, 900) Then
If m_MainWindow.m_CNCommunication.SendProgram(sCncPath, sNameProg) Then
' copio il progetto corrente come progetto in lavorazione
Dim sWrkPath As String = m_MainWindow.GetTempDir() & "\" & "WorkProj.nge"
My.Computer.FileSystem.CopyFile(sMchPath, sWrkPath, True)
' lancio eventuale lua post-trasmissione
m_MainWindow.ExecSentProgScript( True)
m_MainWindow.ExecSentProgScript(True)
End If
#End If
End Sub
+4 -2
View File
@@ -584,13 +584,15 @@ Public Class SingleCutUC
m_CurrProjPage.SetErrorMessage(EgtMsg(90314)) 'Errore nella generazione del programma CN
Return
End If
Dim sNameProg As Integer = 900
sNameProg = GetPrivateProfileInt(S_PARTPROGRAM, "NameProg", sNameProg, m_MainWindow.GetMachIniFile)
' Download programma (eventuali errori sono segnalati dalla funzione)
If m_MainWindow.m_CNCommunication.SendProgram(sCncPath, 900) Then
If m_MainWindow.m_CNCommunication.SendProgram(sCncPath, sNameProg) Then
' copio il progetto corrente come progetto in lavorazione
Dim sWrkPath As String = m_MainWindow.GetTempDir() & "\" & "WorkProj.nge"
My.Computer.FileSystem.CopyFile(sMchPath, sWrkPath, True)
' lancio eventuale lua post-trasmissione
m_MainWindow.ExecSentProgScript( True)
m_MainWindow.ExecSentProgScript(True)
End If
#End If
End Sub
+3 -1
View File
@@ -371,8 +371,10 @@ Public Class SingleDrillUC
m_CurrProjPage.SetErrorMessage(EgtMsg(90314)) 'Errore nella generazione del programma CN
Return
End If
Dim sNameProg As Integer = 900
sNameProg = GetPrivateProfileInt(S_PARTPROGRAM, "NameProg", sNameProg, m_MainWindow.GetMachIniFile)
' Download programma (eventuali errori sono segnalati dalla funzione)
If m_MainWindow.m_CNCommunication.SendProgram(sCncPath, 900) Then
If m_MainWindow.m_CNCommunication.SendProgram(sCncPath, sNameProg) Then
' copio il progetto corrente come progetto in lavorazione
Dim sWrkPath As String = m_MainWindow.GetTempDir() & "\" & "WorkProj.nge"
My.Computer.FileSystem.CopyFile(sMchPath, sWrkPath, True)
+3 -1
View File
@@ -287,8 +287,10 @@ Public Class SquaringUC
m_CurrProjPage.SetErrorMessage(EgtMsg(90314)) 'Errore nella generazione del programma CN
Return
End If
Dim sNameProg As Integer = 900
sNameProg = GetPrivateProfileInt(S_PARTPROGRAM, "NameProg", sNameProg, m_MainWindow.GetMachIniFile)
' Download programma (eventuali errori sono segnalati dalla funzione)
If m_MainWindow.m_CNCommunication.SendProgram(sCncPath, 900) Then
If m_MainWindow.m_CNCommunication.SendProgram(sCncPath, sNameProg) Then
' copio il progetto corrente come progetto in lavorazione
Dim sWrkPath As String = m_MainWindow.GetTempDir() & "\" & "WorkProj.nge"
My.Computer.FileSystem.CopyFile(sMchPath, sWrkPath, True)
+10 -3
View File
@@ -656,13 +656,20 @@ Class MainWindow
End If
End If
If (nAssLeftDays <= 7 And nAssLeftDays >= 0) Or nAssLeftDays = 14 Or nAssLeftDays = 21 Or nAssLeftDays = 28 Or nAssLeftDays = 364 Then
' Or nAssLeftDays = 358
If (nAssLeftDays <= 7 And nAssLeftDays >= 0) Or nAssLeftDays = 14 Or nAssLeftDays = 21 Or nAssLeftDays = 28 Then
'Dim sText As String = "Fai ammenda," & vbCrLf & "gli aggiornamenti sono in fase di scadenza!"
'Dim sTitle As String = "⚠️ Warning!"
'Dim MissingKeyWnd As New EgtMsgBox(Me, sTitle, sText, EgtMsgBox.Buttons.OK, EgtMsgBox.Icons.NULL)
' finestra Custom
Dim MyLicWn As New LicenseWindow(Me, "FAI AMMENDA /nSTAI ACCORTO /ncontatta chi potrebbe aiutari, du seguito gli indirizzi utili per risolvere" &
" alcuni problemi, ricorda che NON FACCIAMO MIRACOLI : /n → Assorrata", "Assistance " & sAssStatus)
Dim sMsg As String = EgtMsg(91141)
Dim sAssistance As String = String.Empty
GetPrivateProfileString(S_GENERAL, "Assistances", "", sAssistance, GetIniFile)
Dim sItems As String() = sAssistance.Split(","c)
For Each Item As String In sItems
sMsg &= "" & Item.Trim & " /n"
Next
Dim MyLicWn As New LicenseWindow(Me, sMsg, "Assistance " & sAssStatus)
MyLicWn.Show()
End If
+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.12.3")>
<Assembly: AssemblyFileVersion("2.5.12.3")>
<Assembly: AssemblyVersion("2.5.12.4")>
<Assembly: AssemblyFileVersion("2.5.12.4")>
+18 -10
View File
@@ -189,25 +189,33 @@ Public Class WorkInProgressPageUC
' Valori precedenti degli assi macchina
Dim dL1p, dL2p, dL3p, dR1p, dR2p As Double
Dim bFirst As Boolean = True
' Gestione fase di lavoro
Dim sPhaseVar As String = String.Empty
GetPrivateProfileString(S_MACH_INPROGRESS, K_PHASEVAR, "E80020", sPhaseVar, m_MainWindow.GetMachIniFile())
m_MainWindow.m_CNCommunication.m_CN.n_DReadELS_handle = 0
m_MainWindow.m_CNCommunication.m_CN.ReadEls_Add_Parameter(sPhaseVar, 3)
System.Threading.Thread.Sleep(100)
Dim nCurrPhase = 1
If m_MainWindow.m_CNCommunication.m_CN.n_DReadELS_handle = 3 Then
nCurrPhase = CInt(m_MainWindow.m_CNCommunication.m_CN.d_DReadELS_value)
Dim bCurrPhaseExists As Boolean = False
If GetPrivateProfileString(S_MACH_INPROGRESS, K_PHASEVAR, "E80020", sPhaseVar, m_MainWindow.GetMachIniFile()) <> 0 Then
bCurrPhaseExists = True
m_MainWindow.m_CNCommunication.m_CN.n_DReadELS_handle = 0
m_MainWindow.m_CNCommunication.m_CN.ReadEls_Add_Parameter(sPhaseVar, 3)
System.Threading.Thread.Sleep(100)
If m_MainWindow.m_CNCommunication.m_CN.n_DReadELS_handle = 3 Then
nCurrPhase = CInt(m_MainWindow.m_CNCommunication.m_CN.d_DReadELS_value)
End If
EgtSetCurrPhase(nCurrPhase, True)
EgtDraw()
Else
EgtOutLog("Variabile 'PhaseVar' mancante! In CurrentMachine non sarà aggiornata la fase del grezzo")
End If
EgtSetCurrPhase(nCurrPhase, True)
EgtDraw()
' Tempo di ritardo nel ciclo
Dim nTimeStep As Integer = 50
nTimeStep = GetPrivateProfileInt(S_MACH_INPROGRESS, K_WP_STEPTIME, nTimeStep, m_MainWindow.GetMachIniFile())
EgtOutLog("Tempo di attesa tra una lettura degli assi e la successiva: " & nTimeStep.ToString & " (ms)")
' Ciclo
While m_bContinue
' Rileggo la variabile di fase
m_MainWindow.m_CNCommunication.m_CN.ReadEls_Add_Parameter(sPhaseVar, 3)
If bCurrPhaseExists Then m_MainWindow.m_CNCommunication.m_CN.ReadEls_Add_Parameter(sPhaseVar, 3)
' Recupero la posizione degli assi macchina
Dim dL1, dL2, dL3, dR1, dR2 As Double
m_MainWindow.m_CNCommunication.GetAxesPositions(dL1, dL2, dL3, dR1, dR2)
@@ -238,7 +246,7 @@ Public Class WorkInProgressPageUC
' Per evitare di ciclare rapidissimamente e consumare inutilmente CPU
System.Threading.Thread.Sleep(nTimeStep)
' Leggo la fase
If m_MainWindow.m_CNCommunication.m_CN.n_DReadELS_handle = 3 Then
If bCurrPhaseExists AndAlso m_MainWindow.m_CNCommunication.m_CN.n_DReadELS_handle = 3 Then
m_MainWindow.m_CNCommunication.m_CN.n_DReadELS_handle = 0
Dim nNextPhase As Integer = CInt(m_MainWindow.m_CNCommunication.m_CN.d_DReadELS_value)
If nNextPhase > nCurrPhase Then