From 5e53f20fecacc4c312135bcac74954440d7828e9 Mon Sep 17 00:00:00 2001 From: Dario Sassi Date: Tue, 1 Oct 2024 13:10:43 +0200 Subject: [PATCH] EgtCAM5 : - aggiunta gestione messaggi lavorazioni avanzate non abilitate in simulazione, stima e generazione - piccola miglioria in default VMillQuality se non trovata in Ini file. --- .../EstimationsExpander.vb | 11 +++++--- .../SimulationExpanderVM.vb | 26 ++++++++++++++----- OptionsWindow/OptionModule.vb | 2 +- 3 files changed, 28 insertions(+), 11 deletions(-) diff --git a/OptionPanel/MachiningOptionPanel/EstimationsExpander/EstimationsExpander.vb b/OptionPanel/MachiningOptionPanel/EstimationsExpander/EstimationsExpander.vb index 005caa7..bb993a4 100644 --- a/OptionPanel/MachiningOptionPanel/EstimationsExpander/EstimationsExpander.vb +++ b/OptionPanel/MachiningOptionPanel/EstimationsExpander/EstimationsExpander.vb @@ -177,12 +177,17 @@ Public Class EstimationsExpanderVM If Not bOk Then Return False ' Calcolo della stima If Not EgtEstimate(sEstFile, sInfo) Then - If EgtGetLastMachMgrErrorId() <> 0 Then + Dim nErr As Integer = EgtGetLastMachMgrErrorId() + If nErr = 1000 Then + MessageBox.Show(EgtMsg(5333), EgtMsg(5320), MessageBoxButton.OK, MessageBoxImage.Information) + ElseIf nErr = 1001 Then + MessageBox.Show(EgtMsg(5334), EgtMsg(5320), MessageBoxButton.OK, MessageBoxImage.Information) + ElseIf nErr <> 0 Then Dim sErr As String = EgtGetLastMachMgrErrorString() sErr = sErr.Replace("Cnc", "Est") - MessageBox.Show(sErr, EgtMsg(MSG_SIMULATION + 5), MessageBoxButton.OK, MessageBoxImage.Exclamation) + MessageBox.Show(sErr, EgtMsg(5305), MessageBoxButton.OK, MessageBoxImage.Exclamation) Else - MessageBox.Show(EgtMsg(MSG_SIMULATION + 17), EgtMsg(MSG_SIMULATION + 5), MessageBoxButton.OK, MessageBoxImage.Error) + MessageBox.Show(EgtMsg(5317), EgtMsg(5305), MessageBoxButton.OK, MessageBoxImage.Error) End If bOk = False End If diff --git a/OptionPanel/MachiningOptionPanel/SimulationExpander/SimulationExpanderVM.vb b/OptionPanel/MachiningOptionPanel/SimulationExpander/SimulationExpanderVM.vb index 4416523..ed42214 100644 --- a/OptionPanel/MachiningOptionPanel/SimulationExpander/SimulationExpanderVM.vb +++ b/OptionPanel/MachiningOptionPanel/SimulationExpander/SimulationExpanderVM.vb @@ -101,9 +101,11 @@ Public Class SimulationExpanderVM If Not GetCncFileName(True, sCncFile, sInfo) Then Return ' Eseguo If Not EgtGenerate(sCncFile, sInfo) Then - Dim nErr = EgtGetLastMachMgrErrorId() + Dim nErr As Integer = EgtGetLastMachMgrErrorId() If nErr = 1000 Then MessageBox.Show(EgtMsg(5333), EgtMsg(5320), MessageBoxButton.OK, MessageBoxImage.Information) + ElseIf nErr = 1001 Then + MessageBox.Show(EgtMsg(5334), EgtMsg(5320), MessageBoxButton.OK, MessageBoxImage.Information) ElseIf nErr <> 0 Then Dim sErr As String = EgtGetLastMachMgrErrorString() MessageBox.Show(sErr, EgtMsg(5305), MessageBoxButton.OK, MessageBoxImage.Exclamation) @@ -225,11 +227,16 @@ Public Class SimulationExpanderVM UpdateUI() ' Messaggio in caso di errore If Not bOk Then - If EgtGetLastMachMgrErrorId() <> 0 Then + Dim nErr As Integer = EgtGetLastMachMgrErrorId() + If nErr = 1000 Then + MessageBox.Show(EgtMsg(5333), EgtMsg(5320), MessageBoxButton.OK, MessageBoxImage.Information) + ElseIf nErr = 1001 Then + MessageBox.Show(EgtMsg(5334), EgtMsg(5320), MessageBoxButton.OK, MessageBoxImage.Information) + ElseIf nErr <> 0 Then Dim sErr As String = EgtGetLastMachMgrErrorString() - MessageBox.Show(sErr, EgtMsg(MSG_SIMULATION + 5), MessageBoxButton.OK, MessageBoxImage.Exclamation) '.... - ERRORE + MessageBox.Show(sErr, EgtMsg(5305), MessageBoxButton.OK, MessageBoxImage.Exclamation) '.... - ERRORE Else - MessageBox.Show(EgtMsg(MSG_MESSAGEBOX + 10), EgtMsg(MSG_SIMULATION + 5), MessageBoxButton.OK, MessageBoxImage.Error) 'Errore sconosciuto - ERRORE + MessageBox.Show(EgtMsg(15010), EgtMsg(5305), MessageBoxButton.OK, MessageBoxImage.Error) 'Errore sconosciuto - ERRORE End If End If ' Imposto stato corrente @@ -267,11 +274,16 @@ Public Class SimulationExpanderVM Map.refEstimationsExpanderVM.NotifyPropertyChanged("Estimation_IsEnabled") m_bStopOnNextCollision = True If Not EgtSimStart(False) Then - If EgtGetLastMachMgrErrorId() <> 0 Then + Dim nErr As Integer = EgtGetLastMachMgrErrorId() + If nErr = 1000 Then + MessageBox.Show(EgtMsg(5333), EgtMsg(5320), MessageBoxButton.OK, MessageBoxImage.Information) + ElseIf nErr = 1001 Then + MessageBox.Show(EgtMsg(5334), EgtMsg(5320), MessageBoxButton.OK, MessageBoxImage.Information) + ElseIf nErr <> 0 Then Dim sErr As String = EgtGetLastMachMgrErrorString() - MessageBox.Show(sErr, EgtMsg(MSG_SIMULATION + 5), MessageBoxButton.OK, MessageBoxImage.Exclamation) '.... - ERRORE + MessageBox.Show(sErr, EgtMsg(5305), MessageBoxButton.OK, MessageBoxImage.Exclamation) '.... - ERRORE Else - MessageBox.Show(EgtMsg(MSG_MESSAGEBOX + 10), EgtMsg(MSG_SIMULATION + 5), MessageBoxButton.OK, MessageBoxImage.Error) 'Errore sconosciuto - ERRORE + MessageBox.Show(EgtMsg(15010), EgtMsg(5305), MessageBoxButton.OK, MessageBoxImage.Error) 'Errore sconosciuto - ERRORE End If SetSimulationStatus(MCH_SIM_ST.UI_STOP) End If diff --git a/OptionsWindow/OptionModule.vb b/OptionsWindow/OptionModule.vb index 7222992..fb35db2 100644 --- a/OptionsWindow/OptionModule.vb +++ b/OptionsWindow/OptionModule.vb @@ -148,7 +148,7 @@ Friend Module OptionModule m_SelGeomSurfRoughing = If(Temp < 0 Or Temp > 3, SceneSelModeOpt.PARTCURVESANDSURFACES, DirectCast(Temp, SceneSelModeOpt)) Temp = GetPrivateProfileInt(S_MACH, K_SELGEOMFIVEAXMILLING, -1) m_SelGeomFiveAxMilling = If(Temp < 0 Or Temp > 3, SceneSelModeOpt.PARTCURVESANDSURFACES, DirectCast(Temp, SceneSelModeOpt)) - Temp = GetPrivateProfileInt(S_MACH, K_SELVMILLQUALITY, -1) + Temp = GetPrivateProfileInt(S_MACH, K_SELVMILLQUALITY, 0) m_SelVMillQuality = If(Temp < -2 Or Temp > 2, VMillSelTypeOpt.HIGHER, DirectCast(Temp, VMillSelTypeOpt)) m_SelGeomWaterJetting = SceneSelModeOpt.PARTCURVES ' Inizializzo variabile che indica posizione nuova operazione di lavorazione