From 1158fa4d9f9bfdb61850ad900d01562f4d8e9aa0 Mon Sep 17 00:00:00 2001 From: Nicola Pievani Date: Fri, 21 Apr 2017 15:47:51 +0000 Subject: [PATCH] EgtDOORCreator 1.8d1 : - modifiche e migliorie varie. --- AboutBoxWindow/AboutBoxView.xaml | 55 ++++ AboutBoxWindow/AboutBoxView.xaml.vb | 46 ++++ AboutBoxWindow/AboutBoxViewModel.vb | 64 +++++ CompoPanel/CompoPanelViewModel.vb | 29 ++- Constants/ConstIni.vb | 3 + Constants/ConstMsg.vb | 2 +- DdfFile.vb | 3 + DoorManager/DoorManagerViewModel.vb | 48 ++-- DoorParameters/Compo.vb | 57 ++++- DoorParameters/Door.vb | 88 ++++--- DoorParameters/DoorParametersView.xaml | 79 +++--- DoorParameters/DoorParametersViewModel.vb | 19 +- EgtDOORCreator.vbproj | 21 +- IniFile.vb | 11 + Launcher/LauncherView.xaml | 28 +-- MainWindow/MainWindow.xaml.vb | 17 +- MainWindow/MainWindowModel.vb | 14 +- MainWindow/MainWindowViewModel.vb | 100 +++++--- OptionsWindow/OptionModule.vb | 13 +- OptionsWindow/OptionsView.xaml | 236 +++++++++++++++--- OptionsWindow/OptionsViewModel.vb | 94 ++++++- ProjectManager/ProjectManagerView.xaml | 3 + ProjectManager/ProjectManagerViewModel.vb | 176 ++++++++++--- RegexFunction.vb | 13 + Resources/AboutBoxImage.png | Bin 0 -> 4169 bytes Resources/EgtCAM5.ico | Bin 9158 -> 9158 bytes Resources/TopCommandBar/Send.png | Bin 0 -> 1036 bytes .../InstrumentPanelViewModel.vb | 6 + SceneManager/Refresh/RefreshPanelView.xaml | 13 + .../{ => Refresh}/RefreshPanelView.xaml.vb | 2 + SceneManager/Refresh/RefreshPanelViewModel.vb | 100 ++++++++ SceneManager/RefreshPanelView.xaml | 11 - SceneManager/RefreshPanelViewModel.vb | 30 --- SceneManager/SceneManagerView.xaml | 17 +- SceneManager/SceneManagerViewModel.vb | 92 +++++-- StatusBar/StatusBarView.xaml | 8 + StatusBar/StatusBarViewModel.vb | 51 +++- 37 files changed, 1250 insertions(+), 299 deletions(-) create mode 100644 AboutBoxWindow/AboutBoxView.xaml create mode 100644 AboutBoxWindow/AboutBoxView.xaml.vb create mode 100644 AboutBoxWindow/AboutBoxViewModel.vb create mode 100644 Resources/AboutBoxImage.png create mode 100644 Resources/TopCommandBar/Send.png create mode 100644 SceneManager/Refresh/RefreshPanelView.xaml rename SceneManager/{ => Refresh}/RefreshPanelView.xaml.vb (52%) create mode 100644 SceneManager/Refresh/RefreshPanelViewModel.vb delete mode 100644 SceneManager/RefreshPanelView.xaml delete mode 100644 SceneManager/RefreshPanelViewModel.vb diff --git a/AboutBoxWindow/AboutBoxView.xaml b/AboutBoxWindow/AboutBoxView.xaml new file mode 100644 index 0000000..595febb --- /dev/null +++ b/AboutBoxWindow/AboutBoxView.xaml @@ -0,0 +1,55 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - diff --git a/MainWindow/MainWindow.xaml.vb b/MainWindow/MainWindow.xaml.vb index 417faab..549ed21 100644 --- a/MainWindow/MainWindow.xaml.vb +++ b/MainWindow/MainWindow.xaml.vb @@ -1,9 +1,22 @@ -Class MainWindow +Imports EgtWPFLib5 +Class MainWindow Public Sub Me_ContentRendered() Handles Me.ContentRendered Dim rfMainWindowViewModel As MainWindowViewModel = DirectCast(Me.DataContext, MainWindowViewModel) ' richiamo la sub che è stata costruita nel MainWindowViewModel - rfMainWindowViewModel.SetLauncher() + Dim SceneManagerViewModel As SceneManagerViewModel = DirectCast(rfMainWindowViewModel.SceneManager.DataContext, SceneManagerViewModel) + ' se è assente la chiave di protezione non mostro la finestra Launcher + If SceneManagerViewModel.bProtectKey Then + rfMainWindowViewModel.SetLauncher() + End If + End Sub + + Private Sub EgtCustomWindow_Loaded(sender As Object, e As RoutedEventArgs) Handles Me.Loaded + Dim rfMainWindowViewModel As MainWindowViewModel = DirectCast(Me.DataContext, MainWindowViewModel) + ' Posizione e dimensioni del Form + Dim WinPos As New WinPos + GetPrivateProfileWinPos(S_GENERAL, K_WINPLACE, WinPos.nFlag, WinPos.nLeft, WinPos.nTop, WinPos.nWidth, WinPos.nHeight) + rfMainWindowViewModel.WinPosToWindow(Me, WinPos) End Sub End Class diff --git a/MainWindow/MainWindowModel.vb b/MainWindow/MainWindowModel.vb index 5853904..d80fb4a 100644 --- a/MainWindow/MainWindowModel.vb +++ b/MainWindow/MainWindowModel.vb @@ -16,10 +16,10 @@ Friend Class MainWindowModel ' Livello dell'utilizzatore Friend m_nUserLevel As Integer = 1 - ' Livello della chiave inserita nel PC - Friend m_nKeyLevel As Integer = 0 - ' Opzioni attive sulla chiave - Friend m_nKeyOptions As UInteger = 0 + ' '' Livello della chiave inserita nel PC + ''Friend m_nKeyLevel As Integer = 0 + ' '' Opzioni attive sulla chiave + ''Friend m_nKeyOptions As UInteger = 0 Private m_nDebug As Integer = 0 @@ -51,9 +51,9 @@ Friend Class MainWindowModel EgtUILib.GetPrivateProfileString(S_LICENCE, K_KEY, "", sKey, sLicFile) EgtSetKey(sKey) ' Recupero livello e opzioni della chiave - 'Dim bKey As Boolean = EgtGetKeyLevel(3279, 16, 1, IniFile.m_nKeyLevel) And - ' EgtGetKeyOptions(3279, 16, 1, IniFile.m_nKeyOptions) - ' Inizializzazione generale di EgtInterface + Dim bKey As Boolean = EgtGetKeyLevel(3279, 16, 1, IniFile.m_nKeyLevel) And + EgtGetKeyOptions(3279, 16, 1, IniFile.m_nKeyOptions) + 'Inizializzazione generale di EgtInterface m_nDebug = GetPrivateProfileInt(S_GENERAL, K_DEBUG, 0) Dim sLogFile As String = IniFile.m_sTempDir & "\" & GENLOG_FILE_NAME.Replace("#", m_nInstance.ToString()) Dim sLogMsg As String = "User " & Environment.UserName & "\" & Environment.MachineName & " (" & m_nInstance.ToString() & ")" & vbLf & diff --git a/MainWindow/MainWindowViewModel.vb b/MainWindow/MainWindowViewModel.vb index a5ad109..5e3cb09 100644 --- a/MainWindow/MainWindowViewModel.vb +++ b/MainWindow/MainWindowViewModel.vb @@ -1,6 +1,7 @@ Imports EgtUILib Imports System.ComponentModel Imports System.IO +Imports EgtWPFLib5 Public Class MainWindowViewModel Implements INotifyPropertyChanged @@ -19,31 +20,6 @@ Public Class MainWindowViewModel End Set End Property - ' questa funzione restituisce il nome del direttorio corrente - Friend Function SetTitle(DirectoryTitle As String) As String - If Not String.IsNullOrWhiteSpace(DirectoryTitle) Then - Dim Items() As String = DirectoryTitle.Split("\".ToCharArray) - If Items.Count = 1 Then - Items = DirectoryTitle.Split("-".ToCharArray) - End If - ' restituisco il nome dell'ultimo direttorio aperto - DirectoryTitle = Items(Items.Count - 1) - End If - Return DirectoryTitle - End Function - - Friend Sub ModifyTitle(bModified As Boolean) - If bModified Then - If Not m_ProjectNameMsg(m_ProjectNameMsg.Count - 1) = "*" Then - ProjectNameMsg &= "*" - End If - Else - If m_ProjectNameMsg(m_ProjectNameMsg.Count - 1) = "*" Then - ProjectNameMsg.Trim("*"c) - End If - End If - End Sub - Private m_CompoPanel As CompoPanelView Public ReadOnly Property CompoPanel As CompoPanelView Get @@ -110,6 +86,17 @@ Public Class MainWindowViewModel End Property + Private m_AboutBox As Window + Private bFirstAboutBox As Boolean = True + Public ReadOnly Property AboutBox As Window + Get + If bFirstAboutBox Then + m_AboutBox = New AboutBoxView() + End If + Return New AboutBoxView + End Get + End Property + ' MainWindow Closing Event Private m_cmdClose As ICommand @@ -118,8 +105,8 @@ Public Class MainWindowViewModel Case 0 ' apre la finestra Dim Launcher As New LauncherView - Launcher.Height = 500 - Launcher.Width = 300 + Launcher.Height = 200 + Launcher.Width = 250 LauncherModule.InitLauncherModule() Launcher.DataContext = New LauncherViewModel(Me) Launcher.Owner = Application.Current.MainWindow @@ -132,11 +119,56 @@ Public Class MainWindowViewModel ' apro l'ultimo progetto Me.ProjectManagerViewModel.OpenLastProject() End If - Case 2 ' non fa assolutamente nulla End Select End Sub + ' questa funzione restituisce il nome del direttorio corrente + Friend Function SetTitle(DirectoryTitle As String) As String + If Not String.IsNullOrWhiteSpace(DirectoryTitle) Then + Dim Items() As String = DirectoryTitle.Split("\".ToCharArray) + If Items.Count = 1 Then + Items = DirectoryTitle.Split("-".ToCharArray) + End If + ' restituisco il nome dell'ultimo direttorio aperto + DirectoryTitle = Items(Items.Count - 1) + End If + Return DirectoryTitle + End Function + + Friend Sub ModifyTitle(bModified As Boolean) + If bModified Then + If Not m_ProjectNameMsg(m_ProjectNameMsg.Count - 1) = "*" Then + ProjectNameMsg &= "*" + End If + Else + If m_ProjectNameMsg(m_ProjectNameMsg.Count - 1) = "*" Then + ProjectNameMsg.Trim("*"c) + End If + End If + End Sub + + Friend Sub WinPosToWindow(Window As Window, WinPos As WinPos) + Window.WindowStartupLocation = WindowStartupLocation.Manual + Window.Top = WinPos.nTop + Window.Left = WinPos.nLeft + Window.Height = WinPos.nHeight + Window.Width = WinPos.nWidth + Window.WindowState = If(WinPos.nFlag = 1, WindowState.Maximized, WindowState.Normal) + End Sub + + Friend Sub WindowToWinPos(Window As Window, WinPos As WinPos) + WinPos.nTop = CInt(Window.Top) + WinPos.nLeft = CInt(Window.Left) + WinPos.nHeight = CInt(Window.Height) + WinPos.nWidth = CInt(Window.Width) + WinPos.nFlag = If(Window.WindowState = WindowState.Maximized, 1, 0) + If Window.WindowState = WindowState.Maximized Then + WinPos.nHeight = CInt(Window.RestoreBounds.Height) + WinPos.nWidth = CInt(Window.RestoreBounds.Width) + End If + End Sub + #Region "CloseApplicationCommand" ''' @@ -159,12 +191,12 @@ Public Class MainWindowViewModel 'Application.Msn.NotifyColleagues(Application.MANAGEMODIFIED) 'If m_allowWindowToClose Then ' Application.Msn.NotifyColleagues(Application.CLOSEAPPLICATION) - ' ' Salvo posizione Form (se non minimizzato) - ' If Application.Current.MainWindow.WindowState <> WindowState.Minimized Then - ' Dim WinPos As New WinPos - ' WindowToWinPos(Application.Current.MainWindow, WinPos) - ' WritePrivateProfileWinPos(S_GENERAL, K_WINPLACE, WinPos.nFlag, WinPos.nLeft, WinPos.nTop, WinPos.nWidth, WinPos.nHeight) - ' End If + ' Salvo posizione Form (se non minimizzato) + If Application.Current.MainWindow.WindowState <> WindowState.Minimized Then + Dim WinPos As New WinPos + WindowToWinPos(Application.Current.MainWindow, WinPos) + WritePrivateProfileWinPos(S_GENERAL, K_WINPLACE, WinPos.nFlag, WinPos.nLeft, WinPos.nTop, WinPos.nWidth, WinPos.nHeight) + End If ' ' Terminazione generale di EgtInterface ' EgtExit() ' ' Rilascio mutex diff --git a/OptionsWindow/OptionModule.vb b/OptionsWindow/OptionModule.vb index 90481d1..5d7f2a6 100644 --- a/OptionsWindow/OptionModule.vb +++ b/OptionsWindow/OptionModule.vb @@ -12,7 +12,7 @@ Friend Module OptionModule Friend m_sLastProject As String = String.Empty ' Parametri che contengono lista delle unità di misura disponibili e quella selezionata - Friend m_MeasureUnitList As New List(Of String)({"mm", "inches"}) + Friend m_MeasureUnitList As New List(Of String)({"mm", "Inches"}) Friend m_SelectedMeasureUnit As String Friend m_bIsMmUnit As Boolean @@ -41,6 +41,8 @@ Friend Module OptionModule Friend m_TopOverMaterial As String Friend m_BottomOverMaterial As String + Friend m_CompoPaneOrder As List(Of String) = New List(Of String) + ' inizializzazione lettura variabili ad inizio programma Friend Sub InitOptionModule() ' Leggo elenco lingue disponibili da file ini @@ -56,6 +58,7 @@ Friend Module OptionModule If GetPrivateProfileString(S_GENERAL, K_MESSAGESDIR, "", sMsgDir) = 0 Then sMsgDir = IniFile.m_sConfigDir End If + ' Leggo file messaggi Dim sMsgName As String = String.Empty GetPrivateProfileString(S_GENERAL, K_MESSAGES, "", sMsgName) @@ -84,6 +87,12 @@ Friend Module OptionModule nOptionLauncher = GetPrivateProfileInt(S_LAUNCHERWINDOW, K_LAUNCHER, 1) End If + ' leggo il direttorio di salvataggio dei progetti + Dim sMyProjectDir As String = String.Empty + If GetPrivateProfileString(S_DOORS, K_MYPROJECTDIR, "", sMyProjectDir) <> 0 Then + IniFile.m_MyProjectDir = sMyProjectDir + End If + ' Leggo le dimensioni della porta dal file Default.ini Dim Width As String = String.Empty DefaultGetPrivateProfileString(S_SIZE, K_WIDTH_INI, "", Width) @@ -145,6 +154,8 @@ Friend Module OptionModule m_BottomOverMaterial = BottomOverMaterial ' carico l'ordinamento delle componenti DefaultGetPrivateProfileList(S_COMPOORDER, K_COMPOORDER_INI, DdfFile.CompoListOrder) + ' carico l'ordinamento dei bottoni + DefaultGetPrivateProfileList(S_COMPOORDER, K_COMPOORDER_INI, m_CompoPaneOrder) m_OptionLauncherList.Add(EgtMsg(50206)) m_OptionLauncherList.Add(EgtMsg(50207)) diff --git a/OptionsWindow/OptionsView.xaml b/OptionsWindow/OptionsView.xaml index d947f58..85e2746 100644 --- a/OptionsWindow/OptionsView.xaml +++ b/OptionsWindow/OptionsView.xaml @@ -10,20 +10,195 @@ IsMinimizable="False" WindowStartupLocation="CenterScreen" ShowInTaskbar="False" CloseCommand="{Binding CloseOptionsCommand,Mode=OneWay,UpdateSourceTrigger=PropertyChanged}"> - + - - - + + + - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ProjectManager/ProjectManagerViewModel.vb b/ProjectManager/ProjectManagerViewModel.vb index 1742f27..b2ae843 100644 --- a/ProjectManager/ProjectManagerViewModel.vb +++ b/ProjectManager/ProjectManagerViewModel.vb @@ -2,6 +2,7 @@ Imports System.ComponentModel Imports System.IO Imports EgtUILib +Imports Ionic.zip Public Class ProjectManagerViewModel Implements INotifyPropertyChanged @@ -30,10 +31,7 @@ Public Class ProjectManagerViewModel Private m_cmdExport As ICommand Private m_cmdOptions As ICommand Private m_CmdLastProject As ICommand - -#Region "Messages" - -#End Region ' Messages + Private m_cmdSendFeedback As ICommand #Region "ToolTip" @@ -68,14 +66,14 @@ Public Class ProjectManagerViewModel Return EgtMsg(MSG_TOPCOMMANDBAR + 6) End Get End Property - Public ReadOnly Property ExportToolTip As String + Public ReadOnly Property SendFeedbackToolTip As String Get - Return EgtMsg(MSG_TOPCOMMANDBAR + 7) + Return "Send Feedback" End Get End Property Public ReadOnly Property OptionsToolTip As String Get - Return EgtMsg(MSG_TOPCOMMANDBAR + 4) + Return EgtMsg(MSG_MAINWINDOW + 209) End Get End Property @@ -142,10 +140,10 @@ Public Class ProjectManagerViewModel ''' Public Sub NewCmd() Dim SaveFileDialog As New EgtWPFLib5.EgtSaveFileDialog - SaveFileDialog.Title = EgtMsg(50304) - SaveFileDialog.FileName = "c:\EgtData\EgtDOORCreator\MyProjects\" - If Not SaveFileDialog.ShowDialog Then + SaveFileDialog.Directory = IniFile.m_MyProjectDir & "\" + SaveFileDialog.Extension = "\" + If Not SaveFileDialog.EgtShowDialog Then Return End If Directory.CreateDirectory(SaveFileDialog.FileName) @@ -168,7 +166,9 @@ Public Class ProjectManagerViewModel ' Notifico aggiornamento DoorList e Name per aggiornare la grafica CurrProject.NotifyPropertyChanged("Name") CurrProject.NotifyPropertyChanged("DoorList") - m_rfMainWindowViewModel.ProjectNameMsg = m_CurrProject.Name + m_rfMainWindowViewModel.ProjectNameMsg = m_rfMainWindowViewModel.SetTitle(m_CurrProject.Name) + m_rfMainWindowViewModel.ModifyTitle(True) + 'm_rfMainWindowViewModel.ProjectNameMsg = m_CurrProject.Name End Sub #End Region ' NewCommand @@ -192,7 +192,7 @@ Public Class ProjectManagerViewModel ''' Public Sub Open() Dim FolderBrowserDialog As New System.Windows.Forms.FolderBrowserDialog - FolderBrowserDialog.SelectedPath = "c:\EgtData\EgtDOORCreator\MyProjects" + FolderBrowserDialog.SelectedPath = IniFile.m_MyProjectDir ' mostriamo la finestra di dialogo aperta fino alla directory MyProjects If FolderBrowserDialog.ShowDialog <> Forms.DialogResult.OK Then ' se la risposta è diversa da OK esce @@ -272,7 +272,7 @@ Public Class ProjectManagerViewModel ''' ''' Execute the Save. This method is invoked by the SaveCommand. ''' - Public Sub Save(ByVal param As Object) + Public Sub Save() Dim SetTitle As String Dim CurrDoor As Door = DirectCast(m_rfMainWindowViewModel.DoorParameters.DataContext, DoorParametersViewModel).CurrDoor Dim DoorManagerViewModel As DoorManagerViewModel = DirectCast(m_rfMainWindowViewModel.DoorManager.DataContext, DoorManagerViewModel) @@ -337,8 +337,8 @@ Public Class ProjectManagerViewModel ''' Public Sub Options(ByVal param As Object) Dim OptionsWindow As New OptionsView - OptionsWindow.Height = 614 - OptionsWindow.Width = 1024 + OptionsWindow.Height = 550 + OptionsWindow.Width = 550 OptionsWindow.DataContext = New OptionsViewModel OptionsWindow.Owner = Application.Current.MainWindow OptionsWindow.ShowDialog() @@ -365,29 +365,141 @@ Public Class ProjectManagerViewModel CurrProject.Name = OptionModule.m_sLastProject ' ripulisco la lista di porte CurrProject.DoorList.Clear() - ' Aggiungo porte trovate nella cartella ad un vettore - Dim DDFFileArray() As String = Directory.GetFiles(CurrProject.Name) - ' ripulisco il nome della porta (cancello tutto il percorso del file lasciando solo il nome del file) - For DDFIndex = 0 To DDFFileArray.Count - 1 - If Path.GetExtension(DDFFileArray(DDFIndex)).ToLower = ".ddf" Then - ' lo aggiungo alla lista delle porte - CurrProject.DoorList.Add(DDFFileArray(DDFIndex)) + ' verifico che esista la cartella + If Directory.Exists(CurrProject.Name) Then + ' Aggiungo porte trovate nella cartella ad un vettore + Dim DDFFileArray() As String = Directory.GetFiles(CurrProject.Name) + ' ripulisco il nome della porta (cancello tutto il percorso del file lasciando solo il nome del file) + For DDFIndex = 0 To DDFFileArray.Count - 1 + If Path.GetExtension(DDFFileArray(DDFIndex)).ToLower = ".ddf" Then + ' lo aggiungo alla lista delle porte + CurrProject.DoorList.Add(DDFFileArray(DDFIndex)) + End If + Next + ' Notifico aggiornamento DoorList e Name per aggiornare la grafica + CurrProject.NotifyPropertyChanged("Name") + CurrProject.NotifyPropertyChanged("DoorList") + ' Se c'è almeno una porta la visualizzo + If CurrProject.DoorList.Count > 0 Then + DoorManagerViewModel.SelectedDoor = CurrProject.DoorList(0) End If - Next - ' Notifico aggiornamento DoorList e Name per aggiornare la grafica - CurrProject.NotifyPropertyChanged("Name") - CurrProject.NotifyPropertyChanged("DoorList") - ' Se c'è almeno una porta la visualizzo - If CurrProject.DoorList.Count > 0 Then - DoorManagerViewModel.SelectedDoor = CurrProject.DoorList(0) + m_rfMainWindowViewModel.ProjectNameMsg = CurrProject.Name End If - - m_rfMainWindowViewModel.ProjectNameMsg = CurrProject.Name - End Sub #End Region ' LastProject +#Region "SendFeedbackCommand" + + ''' + ''' Returns a command that do SendFeedback. + ''' + Public ReadOnly Property SendFeedbackCommand As ICommand + Get + If m_cmdSendFeedback Is Nothing Then + m_cmdSendFeedback = New Command(AddressOf SendFeedback) + End If + Return m_cmdSendFeedback + End Get + End Property + + ''' + ''' Execute the SendFeedback. This method is invoked by the SendFeedbackCommand. + ''' + Public Sub SendFeedback() + ' Recupero indirizzo a cui spedire la mail + Dim sSupportAddress As String = String.Empty + GetPrivateProfileString(S_GENERAL, K_SUPPORT, "support@egaltech.com", sSupportAddress) + ' se vuoto do messaggio di errore ed esco + If String.IsNullOrWhiteSpace(sSupportAddress) Then + MessageBox.Show(EgtMsg(MSG_TOPCOMMANDBAR + 10), EgtMsg(50101), MessageBoxButton.OK, MessageBoxImage.Error) + Return + End If + ' Recupero numero chiave + Dim sKey As String = String.Empty + EgtGetKeyInfo(sKey) + ' Recupero file del progetto corrente (tipo file .nge) + Dim sCurrProject As String = String.Empty + EgtGetCurrFilePath(sCurrProject) + ' se nome file vuoto, chiedo se si vuole salvare (file .nge) + If String.IsNullOrWhiteSpace(sCurrProject) Then + If MessageBox.Show(EgtMsg(MSG_TOPCOMMANDBAR + 11), "", MessageBoxButton.YesNo, MessageBoxImage.Question) = MessageBoxResult.Yes Then + Save() + End If + EgtGetCurrFilePath(sCurrProject) + ' se modificato, chiedo se si vuole salvare + Else + If EgtGetModified() Then + If MessageBox.Show(EgtMsg(MSG_TOPCOMMANDBAR + 11), "", MessageBoxButton.YesNo, MessageBoxImage.Question) = MessageBoxResult.Yes Then + Save() + End If + End If + End If + ' recuro il file DDF associato al file .nge + Dim sCurrProjectDDF As String = String.Empty + sCurrProjectDDF = IniFile.m_sTempDir & "\CurrDoor.ddf" + ' recupero il file di log + Dim sFileLog As String = String.Empty + sFileLog = IniFile.m_sTempDir & "\EgtDOORCreatorLog1.txt" + + ' Creo zip file da allegare + Dim sZipToCreate As String = IniFile.m_sTempDir & "\Feedback.zip" + If File.Exists(sZipToCreate) Then + File.Delete(sZipToCreate) + End If + Try + Using zip As New Ionic.Zip.ZipFile(sZipToCreate, Console.Out) + ' aggiungo progetto corrente .nge + If Not String.IsNullOrWhiteSpace(sCurrProject) Then + zip.AddItem(sCurrProject, "") + End If + ' aggiungo progetto corrente .ddf + If Not String.IsNullOrWhiteSpace(sCurrProjectDDF) Then + zip.AddItem(sCurrProjectDDF, "") + End If + ' aggiungo file log + If Not String.IsNullOrWhiteSpace(sFileLog) Then + zip.AddItem(sFileLog, "") + End If + ' aggiungo la cartella Doors + If Directory.Exists(IniFile.m_sDoorsDirPath) Then + zip.AddItem(IniFile.m_sDoorsDirPath, "Doors") + End If + zip.Save() + End Using + Catch ex1 As Exception + EgtOutLog("Exception in zip: " & ex1.ToString()) + End Try + + ' preparo la mail per il supporto + Dim bEx As Boolean = False + Try + Dim SendFeedbackWindow As New EgtWPFLib5.MapiMailMessage("EgtCAM5 Feedback - " & sKey) + SendFeedbackWindow.Recipients.Add(sSupportAddress) + If Not String.IsNullOrWhiteSpace(sZipToCreate) AndAlso File.Exists(sZipToCreate) Then + SendFeedbackWindow.Files.Add(IniFile.m_sTempDir & "\Feedback.zip") + End If + SendFeedbackWindow.ShowDialog() + Catch ex As Exception + EgtOutLog("Feedback exception: " & ex.ToString) + bEx = True + End Try + If bEx OrElse EgtWPFLib5.MapiMailMessage.m_ErrorCode <> 0 Then + MessageBox.Show(String.Format(EgtMsg(MSG_TOPCOMMANDBAR + 12), sSupportAddress, sZipToCreate), EgtMsg(MSG_EGTDOORCREATOR + 118), MessageBoxButton.OK, MessageBoxImage.Information) + Dim rfStatusBarView As StatusBarView = DirectCast(m_rfMainWindowViewModel.SceneManager.DataContext, SceneManagerViewModel).StatusBar + Dim rfStatusBarViewModel As StatusBarViewModel = DirectCast(rfStatusBarView.DataContext, StatusBarViewModel) + ' stampo il messaggio nella StatusBar + rfStatusBarViewModel.StatusOutput = EgtMsg(MSG_TOPCOMMANDBAR + 14) + Else + Dim rfStatusBarView As StatusBarView = DirectCast(m_rfMainWindowViewModel.SceneManager.DataContext, SceneManagerViewModel).StatusBar + Dim rfStatusBarViewModel As StatusBarViewModel = DirectCast(rfStatusBarView.DataContext, StatusBarViewModel) + ' stampo il messaggio nella StatusBar + rfStatusBarViewModel.StatusOutput = EgtMsg(MSG_TOPCOMMANDBAR + 14) + End If + End Sub + +#End Region ' SendFeedbackCommand + #End Region ' Commands Public Event PropertyChanged As PropertyChangedEventHandler Implements INotifyPropertyChanged.PropertyChanged diff --git a/RegexFunction.vb b/RegexFunction.vb index 887dad1..d7ac7f4 100644 --- a/RegexFunction.vb +++ b/RegexFunction.vb @@ -33,4 +33,17 @@ Module RegexFunction Return Regex.Match(sLine, "\s*(.*?)\s*#.*$").Groups(1).Value End Function + ' restituisce quello che segue l'uguale assegnata la parola chiave Err + Friend Function ErrDraw(sLine As String) As Integer + Dim sErrMsg As String = Regex.Match(sLine, "\s*(Err)\s*=\s*(.*?\b)\s*$").Groups(2).Value + ' se il valore è numerico allora lo restituisco + If IsNumeric(sErrMsg) Then + Return CInt(sErrMsg) + Else + ' altrimenti restituisco il valore zero (non errore) + Return 0 + End If + + End Function + End Module diff --git a/Resources/AboutBoxImage.png b/Resources/AboutBoxImage.png new file mode 100644 index 0000000000000000000000000000000000000000..a11230b23350efcbcdcc6b04c18d23d73ee78359 GIT binary patch literal 4169 zcmV-P5Vr4$P)2huHA> z98M8}ppgNh5#T$3A_PGIBA^ICkj{#%4N(HFCjWdA@@Ll`-o9$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