EgtCAM5 2.2b6 :

- ora Shift+Genera esegue la generazione del CN e poi lo visualizza.
This commit is contained in:
Dario Sassi
2020-02-20 07:39:26 +00:00
parent ec59403704
commit 18428e68ff
2 changed files with 30 additions and 31 deletions
@@ -574,38 +574,37 @@ Public Class SimulationExpanderVM
''' Creata the new tool. This method is invoked by the NewCommand.
''' </summary>
Public Sub Generate(ByVal param As Object)
' Normalmente, Genero
If (Keyboard.Modifiers And ModifierKeys.Shift) <> ModifierKeys.Shift Then
' Recupero la fase corrente
Dim nPhase As Integer = EgtGetCurrPhase()
' Aggiorno le lavorazioni
If Not UpdateAllMachinings() Then
EgtSetCurrPhase(If(nPhase = 0, 1, nPhase), True)
Return
End If
' Recupero nome file CN (dopo aver verificato salvataggio progetto)
Dim sCncFile As String = ""
Dim sInfo As String = ""
If Not GetCncFileName( True, sCncFile, sInfo) Then Return
' Eseguo
If Not EgtGenerate(sCncFile, sInfo) Then
If EgtGetLastMachMgrErrorId() <> 0 Then
Dim sErr As String = EgtGetLastMachMgrErrorString()
MessageBox.Show(sErr, EgtMsg(MSG_SIMULATION + 5), MessageBoxButton.OK, MessageBoxImage.Exclamation)
Else
MessageBox.Show(EgtMsg(MSG_SIMULATION + 6), EgtMsg(MSG_SIMULATION + 5), MessageBoxButton.OK, MessageBoxImage.Error)
End If
' Verifico se richiesta anche visualizzazione del CN
Dim bNcView As Boolean = ( (Keyboard.Modifiers And ModifierKeys.Shift) = ModifierKeys.Shift)
' Recupero la fase corrente
Dim nPhase As Integer = EgtGetCurrPhase()
' Aggiorno le lavorazioni
If Not UpdateAllMachinings() Then
EgtSetCurrPhase( If( nPhase = 0, 1, nPhase), True)
Return
End If
' Recupero nome file CN (dopo aver verificato salvataggio progetto)
Dim sCncFile As String = ""
Dim sInfo As String = ""
If Not GetCncFileName( True, sCncFile, sInfo) Then Return
' Eseguo
If Not EgtGenerate(sCncFile, sInfo) Then
If EgtGetLastMachMgrErrorId() <> 0 Then
Dim sErr As String = EgtGetLastMachMgrErrorString()
MessageBox.Show(sErr, EgtMsg(MSG_SIMULATION + 5), MessageBoxButton.OK, MessageBoxImage.Exclamation)
Else
Application.Msn.NotifyColleagues(Application.NOTIFYSTATUSOUTPUT, EgtMsg(MSG_SIMULATION + 32) & " (" & sCncFile & ")")
MessageBox.Show(EgtMsg(MSG_SIMULATION + 6), EgtMsg(MSG_SIMULATION + 5), MessageBoxButton.OK, MessageBoxImage.Error)
End If
' Torno alla fase originale (o alla prima se non definita)
EgtSetCurrPhase(If(nPhase = 0, 1, nPhase), True)
' Altrimenti premuto shift, Visualizzo CN corrente
Else
' Recupero nome file CN
Dim sCncFile As String = ""
Dim sInfo As String = ""
If Not GetCncFileName( False, sCncFile, sInfo) Then Return
Application.Msn.NotifyColleagues(Application.NOTIFYSTATUSOUTPUT, EgtMsg(MSG_SIMULATION + 32) & " (" & sCncFile & ")")
End If
' Torno alla fase originale (o alla prima se non definita)
EgtSetCurrPhase(If(nPhase = 0, 1, nPhase), True)
' Se richiesta anche la visualizzazione del CN corrente, procedo
If bNcView Then
' Se esiste ne lancio l'editing
If File.Exists( sCncFile) Then
Process.Start( "Notepad.exe", sCncFile)