Compare commits

..

6 Commits

Author SHA1 Message Date
Nicola Pievani 0cc673b047 Nuova gestione chiave di protezione CUT_LIGHT 2024-02-09 17:58:33 +01:00
Nicola Pievani acc1365fd2 Correzione init chiave per CUT_LIGHT 2024-02-09 15:38:37 +01:00
Nicola Pievani 7dcf1fe8dc Inserita lettura Flag CUT_LIGHT 2024-02-09 15:09:53 +01:00
Nicola Pievani cd748dea7a Cambio nome variabile 2024-02-08 09:32:02 +01:00
Nicola Pievani c2f03a883a Inserito commeto per gestione chiave di protezione 2024-02-07 18:11:40 +01:00
Nicola Pievani 9b09eeaa9c Aggiunta variabile per gestione OnlyFrame 2024-02-07 18:04:59 +01:00
12 changed files with 73 additions and 65 deletions
+2 -4
View File
@@ -600,15 +600,13 @@ 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, sNameProg) Then
If m_MainWindow.m_CNCommunication.SendProgram(sCncPath, 900) 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
+2 -4
View File
@@ -535,15 +535,13 @@ 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, sNameProg) Then
If m_MainWindow.m_CNCommunication.SendProgram(sCncPath, 900) 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
+2 -4
View File
@@ -580,15 +580,13 @@ 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, sNameProg) Then
If m_MainWindow.m_CNCommunication.SendProgram(sCncPath, 900) 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
+2 -4
View File
@@ -180,15 +180,13 @@ 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, sNameProg) Then
If m_MainWindow.m_CNCommunication.SendProgram(sCncPath, 900) 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
+2 -4
View File
@@ -450,15 +450,13 @@ 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, sNameProg) Then
If m_MainWindow.m_CNCommunication.SendProgram(sCncPath, 900) 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
+2 -4
View File
@@ -584,15 +584,13 @@ 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, sNameProg) Then
If m_MainWindow.m_CNCommunication.SendProgram(sCncPath, 900) 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
+1 -3
View File
@@ -371,10 +371,8 @@ 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, sNameProg) Then
If m_MainWindow.m_CNCommunication.SendProgram(sCncPath, 900) 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)
+1 -3
View File
@@ -287,10 +287,8 @@ 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, sNameProg) Then
If m_MainWindow.m_CNCommunication.SendProgram(sCncPath, 900) 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)
+46 -14
View File
@@ -23,6 +23,9 @@ Class MainWindow
' Coefficiente di scalatura della finestra rispetto a standard
Friend m_dMWinScale As Double = 1
' Variabile che definisce l'avvio forzato in modalità FRAME
Friend m_OnlyFrame As Boolean = False
' Dichiarazione delle Page UserControl
Friend m_WorkInProgressPageUC As WorkInProgressPageUC
Friend m_CurrentProjectPageUC As CurrentProjectPageUC
@@ -101,6 +104,7 @@ Class MainWindow
REGISTRATION = 2 ^ 20 ' 1048576
SIMPLESTATISTICS = 2 ^ 21 ' 2097152
COMPOFRAME = 2 ^ 22 ' 4194304
CUT_LIGHT = 2 ^ 23 ' 8388608
End Enum
' Opzione nesting automatico
Private m_bAutoNest As Boolean = False
@@ -343,6 +347,12 @@ Class MainWindow
EgtGetKeyOptions(9423, 2512, 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
If Not bProd Then
m_OnlyFrame = GetKeyOption(KEY_OPT.CUT_LIGHT)
End If
' Inizializzazione generale di EgtInterface
m_nDebug = GetPrivateProfileInt(S_GENERAL, K_DEBUG, 0, m_sIniFile)
m_sVersion = My.Application.Info.Version.Major.ToString() & "." &
@@ -656,20 +666,13 @@ Class MainWindow
End If
End If
' Or nAssLeftDays = 358
If (nAssLeftDays <= 7 And nAssLeftDays >= 0) Or nAssLeftDays = 14 Or nAssLeftDays = 21 Or nAssLeftDays = 28 Then
If (nAssLeftDays <= 7 And nAssLeftDays >= 0) Or nAssLeftDays = 14 Or nAssLeftDays = 21 Or nAssLeftDays = 28 Or nAssLeftDays = 364 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 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)
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)
MyLicWn.Show()
End If
@@ -1139,7 +1142,7 @@ Class MainWindow
End If
' Inizio la chiusura del programma (se NUM_OLD verifico di aver terminato il processo DripFeed)
EgtOutLog("Iniziato processo di chiusura programma")
m_IsClosingApplication = If( m_CNCommunication.m_nNCType = 1, 1, 2)
m_IsClosingApplication = If(m_CNCommunication.m_nNCType = 1, 1, 2)
Dim nCount As Integer = 0
While m_IsClosingApplication <> 2
If nCount > 5 Then
@@ -1277,7 +1280,11 @@ Class MainWindow
m_ProdLineTimer.Start()
End If
' di default attivo la pagina CadCut
m_ActivePage = MainWindow.Pages.CadCut
If m_OnlyFrame Then
m_ActivePage = MainWindow.Pages.FrameCut
Else
m_ActivePage = MainWindow.Pages.CadCut
End If
' seleziono il tipo di avvio
m_CurrentProjectPageUC.StartProgram()
' aggiorno la grafica
@@ -1314,8 +1321,33 @@ Class MainWindow
Dim bHeadH1 As Boolean = (EgtGetHeadId("H1") <> GDB_ID.NULL)
EgtSetCurrentContext(nCurrCtx)
' Aggiorno interfaccia
CadCutBtn.IsEnabled = (nPrjType <> CurrentProjectPageUC.PRJ_TYPE.FRAMES)
FrameCutBtn.IsEnabled = (nPrjType <> CurrentProjectPageUC.PRJ_TYPE.FLATS) AndAlso bHeadH1
If m_OnlyFrame Then
If nPrjType = CurrentProjectPageUC.PRJ_TYPE.FLATS And m_ActivePage <> Pages.RawPart Then
Dim FrameWnd As New EgtMsgBox(Me, "NON PUOI", "La tua licenza non è abilitata CAD", EgtMsgBox.Buttons.OK, EgtMsgBox.Icons.NULL)
'' Gestione stato FastGrid
'm_CadCutPageUC.m_FastGridSlabManager.OnPreNewProject()
' Cancello progetto salvato con nome da file ini
WritePrivateProfileString(S_GENERAL, K_LASTNAMEPROJ, "", GetIniFile())
' Scelta tavola della macchina
Dim nTabInd As Integer = m_CadCutPageUC.m_ProjectMgr.ChooseTable()
' Creo nuovo progetto
m_CurrentProjectPageUC.NewProject(nTabInd, False)
'' Gestione stato FastGrid
'm_CadCutPageUC.m_FastGridSlabManager.OnPostNewProject()
FrameCutBtn_Click(Nothing, Nothing)
CadCutBtn.IsEnabled = False
Else
FrameCutBtn.IsEnabled = True
CadCutBtn.IsEnabled = False
' Attivo il pulsante FRAME
'FrameCutBtn.IsChecked = True
'CadCutBtn.IsChecked = False
End If
Else
CadCutBtn.IsEnabled = (nPrjType <> CurrentProjectPageUC.PRJ_TYPE.FRAMES)
FrameCutBtn.IsEnabled = (nPrjType <> CurrentProjectPageUC.PRJ_TYPE.FLATS) AndAlso bHeadH1
End If
' DirectCutBtn.IsEnabled = bHeadH1
End Sub
+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.4")>
<Assembly: AssemblyFileVersion("2.5.12.4")>
<Assembly: AssemblyVersion("2.5.12.3")>
<Assembly: AssemblyFileVersion("2.5.12.3")>
+1 -1
View File
@@ -276,7 +276,7 @@ Public Class CurrentProjectPageUC
' se apro la finestra "OpenFolder" l'assegnazione dei Children è fatta direttamente nella classe ProjectMgrUC
If MyStartLancherWD.CurrSelection <> MODE_LAUNCHER.OpenFolder Then
' Carico sottopagina opportuna
If GetProjectType() <> PRJ_TYPE.FRAMES Then
If GetProjectType() <> PRJ_TYPE.FRAMES And Not m_MainWindow.m_OnlyFrame Then
CurrentProjectPageGrid.Children.Add(m_MainWindow.m_CadCutPageUC)
m_MainWindow.m_ActivePage = MainWindow.Pages.CadCut
m_MainWindow.CadCutBtn.IsChecked = True
+10 -18
View File
@@ -189,33 +189,25 @@ 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
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")
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()
' 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
If bCurrPhaseExists Then m_MainWindow.m_CNCommunication.m_CN.ReadEls_Add_Parameter(sPhaseVar, 3)
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)
@@ -246,7 +238,7 @@ Public Class WorkInProgressPageUC
' Per evitare di ciclare rapidissimamente e consumare inutilmente CPU
System.Threading.Thread.Sleep(nTimeStep)
' Leggo la fase
If bCurrPhaseExists AndAlso m_MainWindow.m_CNCommunication.m_CN.n_DReadELS_handle = 3 Then
If 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