From c19dabea5229cefefc7534988d6884d49b1e7b1d Mon Sep 17 00:00:00 2001 From: Dario Sassi Date: Mon, 30 Oct 2017 19:26:46 +0000 Subject: [PATCH] =?UTF-8?q?EgtCAM5=201.8j6=20:=20-=20per=20default=20in=20?= =?UTF-8?q?lavorazione=20si=20carica=20solo=20la=20tavola=20-=20non=20si?= =?UTF-8?q?=20salvano=20pi=C3=B9=20in=20MRU=20i=20comandi=20lua=20dei=20bo?= =?UTF-8?q?ttoni=20Special.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Application.xaml.vb | 1 + My Project/AssemblyInfo.vb | 4 ++-- ProjectPage/ExecutePanel/ExecutePanelViewModel.vb | 2 ++ ProjectPage/ProjectViewModel.vb | 12 +++++++++--- ProjectPage/SpecialPanel/SpecialPanelViewModel.vb | 1 + 5 files changed, 15 insertions(+), 5 deletions(-) diff --git a/Application.xaml.vb b/Application.xaml.vb index 53b9c9a..210ce4a 100644 --- a/Application.xaml.vb +++ b/Application.xaml.vb @@ -193,6 +193,7 @@ Class Application Friend Const INSERTPROJECT As String = "InsertProject" Friend Const IMPORTPROJECT As String = "ImportProject" Friend Const EXPORTPROJECT As String = "ExportProject" + Friend Const PREEXECSCRIPT As String = "PreExecScript" Friend Const EXECSCRIPT As String = "ExecScript" Friend Const SETDRAWISENABLED As String = "SetDrawIsEnabled" diff --git a/My Project/AssemblyInfo.vb b/My Project/AssemblyInfo.vb index 58f3b96..b8963ea 100644 --- a/My Project/AssemblyInfo.vb +++ b/My Project/AssemblyInfo.vb @@ -70,5 +70,5 @@ Imports System.Windows ' by using the '*' as shown below: ' - - + + diff --git a/ProjectPage/ExecutePanel/ExecutePanelViewModel.vb b/ProjectPage/ExecutePanel/ExecutePanelViewModel.vb index bcd6068..61c3026 100644 --- a/ProjectPage/ExecutePanel/ExecutePanelViewModel.vb +++ b/ProjectPage/ExecutePanel/ExecutePanelViewModel.vb @@ -50,6 +50,7 @@ Namespace EgtCAM5 ''' Execute the Exec. This method is invoked by the ExecCommand. ''' Public Sub Exec(ByVal param As Object) + Application.Msn.NotifyColleagues(Application.PREEXECSCRIPT, True) Application.Msn.NotifyColleagues(Application.EXECSCRIPT, String.Empty) End Sub @@ -73,6 +74,7 @@ Namespace EgtCAM5 ''' Execute the Open. This method is invoked by the OpenCommand. ''' Public Shared Sub OpenMruScript(ByVal param As Object) + Application.Msn.NotifyColleagues(Application.PREEXECSCRIPT, True) Application.Msn.NotifyColleagues(Application.EXECSCRIPT, DirectCast(param, String).Replace("__", "_")) End Sub diff --git a/ProjectPage/ProjectViewModel.vb b/ProjectPage/ProjectViewModel.vb index 75ff16f..bee8760 100644 --- a/ProjectPage/ProjectViewModel.vb +++ b/ProjectPage/ProjectViewModel.vb @@ -46,6 +46,9 @@ Namespace EgtCAM5 ' Definizione comandi Private m_cmdLoaded As ICommand + ' Flag per non salvare Script appena eseguito in elenco MruScript + Private m_bScriptInMru As Boolean = True + #End Region #Region "EGTUILIB FIELDS" @@ -260,7 +263,7 @@ Namespace EgtCAM5 IniFile.m_bMachiningGroup = (GetPrivateProfileInt(S_MACH, K_MACHININGGROUP, 0) <> 0) Application.Msn.NotifyColleagues(Application.DRAWMODE_ISCHECKED) ' lettura flag visualizzazione solo tavola in definizione lavorazioni - IniFile.m_bShowOnlyTable = (GetPrivateProfileInt(S_MACH, K_SHOWONLYTABLE, 0) <> 0) + IniFile.m_bShowOnlyTable = (GetPrivateProfileInt(S_MACH, K_SHOWONLYTABLE, 1) <> 0) ' ObjTree non selezionato Application.Msn.NotifyColleagues(Application.UPDATEOBJTREEOLDID, GDB_ID.NULL) ' nascondo input box @@ -470,6 +473,9 @@ Namespace EgtCAM5 Application.Msn.Register(Application.EXPORTPROJECT, Sub() m_Controller.ExportProject(Path.ChangeExtension(m_Controller.GetCurrFile(), "dxf")) End Sub) + Application.Msn.Register(Application.PREEXECSCRIPT, Sub(bScriptInMru As Boolean) + m_bScriptInMru = bScriptInMru + End Sub) Application.Msn.Register(Application.EXECSCRIPT, Sub(sFilePath As String) If String.IsNullOrEmpty(sFilePath) Then Dim sDir As String = String.Empty @@ -1293,9 +1299,9 @@ Namespace EgtCAM5 ' Salvo path dello script in lista recenti WritePrivateProfileString(S_GENERAL, K_LASTLUADIR, Path.GetDirectoryName(sFile)) If bOk Then - IniFile.m_MruScripts.Add(sFile) + If m_bScriptInMru Then IniFile.m_MruScripts.Add(sFile) Else - IniFile.m_MruScripts.Remove(sFile) + If m_bScriptInMru Then IniFile.m_MruScripts.Remove(sFile) MessageBox.Show(sError, EgtMsg(10001), MessageBoxButton.OK, MessageBoxImage.Error) ' Error End If ' Disabilito progress e bottone stop diff --git a/ProjectPage/SpecialPanel/SpecialPanelViewModel.vb b/ProjectPage/SpecialPanel/SpecialPanelViewModel.vb index 0ae4c77..969b9f6 100644 --- a/ProjectPage/SpecialPanel/SpecialPanelViewModel.vb +++ b/ProjectPage/SpecialPanel/SpecialPanelViewModel.vb @@ -77,6 +77,7 @@ Public Class ButtonItem If Not File.Exists(m_sLuaCmdPath) Then Return If Not Path.GetExtension(m_sLuaCmdPath).ToLower = ".lua" Then Return ' eseguo file Lua + Application.Msn.NotifyColleagues(Application.PREEXECSCRIPT, False) Application.Msn.NotifyColleagues(Application.EXECSCRIPT, m_sLuaCmdPath) End Sub