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 0000000..a11230b Binary files /dev/null and b/Resources/AboutBoxImage.png differ diff --git a/Resources/EgtCAM5.ico b/Resources/EgtCAM5.ico index 3eec029..009c668 100644 Binary files a/Resources/EgtCAM5.ico and b/Resources/EgtCAM5.ico differ diff --git a/Resources/TopCommandBar/Send.png b/Resources/TopCommandBar/Send.png new file mode 100644 index 0000000..a9bcbe4 Binary files /dev/null and b/Resources/TopCommandBar/Send.png differ diff --git a/SceneManager/InstrumentPanel/InstrumentPanelViewModel.vb b/SceneManager/InstrumentPanel/InstrumentPanelViewModel.vb index ec0a56e..415fcdd 100644 --- a/SceneManager/InstrumentPanel/InstrumentPanelViewModel.vb +++ b/SceneManager/InstrumentPanel/InstrumentPanelViewModel.vb @@ -37,10 +37,16 @@ Public Class InstrumentPanelViewModel Public Sub GetDistance(bGetDistanceIsChecked As Boolean) If bGetDistanceIsChecked Then m_rfSceneManagerViewModel.ProjectScene.SetStatusGetDistance() + 'If DirectCast(m_rfSceneManagerViewModel.StatusBar.DataContext, StatusBarViewModel).ButtonVisibility = Visibility.Visible Then + ' DirectCast(m_rfSceneManagerViewModel.StatusBar.DataContext, StatusBarViewModel).ButtonVisibility = Visibility.Collapsed + 'End If Else m_rfSceneManagerViewModel.ProjectScene.ResetStatusGetDistance() + m_rfSceneManagerViewModel.ProjectScene.SetStatusNull() Dim rfStatusBarViewModel As StatusBarViewModel = DirectCast(m_rfSceneManagerViewModel.StatusBar.DataContext, StatusBarViewModel) rfStatusBarViewModel.StatusOutput = String.Empty + '' controllo che non ci siano errori nel disegno + 'm_rfSceneManagerViewModel.ShowGraphicError() End If End Sub diff --git a/SceneManager/Refresh/RefreshPanelView.xaml b/SceneManager/Refresh/RefreshPanelView.xaml new file mode 100644 index 0000000..c336938 --- /dev/null +++ b/SceneManager/Refresh/RefreshPanelView.xaml @@ -0,0 +1,13 @@ + + + +