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/AboutBoxWindow/AboutBoxView.xaml.vb b/AboutBoxWindow/AboutBoxView.xaml.vb
new file mode 100644
index 0000000..2c27444
--- /dev/null
+++ b/AboutBoxWindow/AboutBoxView.xaml.vb
@@ -0,0 +1,46 @@
+Imports EgtUILib
+
+Public Class AboutBoxView
+
+ ' Riferimento alla MainWindow
+ Private m_MainWindow As Window = Application.Current.MainWindow
+
+ Sub New()
+ ' This call is required by the designer.
+ InitializeComponent()
+
+ ' '' Add any initialization after the InitializeComponent() call.
+ ''Application.Msn.Register(Application.CLOSEAPPLICATION, Sub()
+ ''Me.Close()
+ '' End Sub)
+ End Sub
+
+ Private Sub AboutBoxView_Loaded(sender As Object, e As RoutedEventArgs) Handles Me.Loaded
+ Me.Owner = Application.Current.MainWindow
+ Me.Owner = Owner
+ Me.Top = Owner.Top + (Owner.Height / 2 - Me.Height / 2)
+ Me.Left = Owner.Left + (Owner.Width / 2 - Me.Width / 2)
+ End Sub
+
+ Private Sub ExitBtn_Click(sender As Object, e As RoutedEventArgs) Handles ExitBtn.Click
+ Me.Visibility = Windows.Visibility.Hidden
+ End Sub
+
+ Private Sub AboutBoxWD_Initialized(sender As Object, e As EventArgs) Handles Me.Initialized
+ Me.Owner = Application.Current.MainWindow
+ DescriptionLbl.Text = My.Application.Info.Description.ToString()
+ VersionLbl.Text = "Version : " & My.Application.Info.Version.Major.ToString() &
+ "." & My.Application.Info.Version.Minor.ToString() &
+ (ChrW(97 - 1 + My.Application.Info.Version.Build)).ToString() &
+ My.Application.Info.Version.Revision.ToString()
+ Dim sKey As String = String.Empty
+ EgtGetKeyInfo(sKey)
+ Dim sKlev As String = IniFile.m_nKeyLevel.ToString()
+ Dim sOpts As String = IniFile.m_nKeyOptions.ToString()
+ KeyLbl.Text = sKey & " - " & sKlev & " - " & sOpts
+ CopyrightLbl.Text = My.Application.Info.Copyright.ToString()
+ 'ProjectLbl.Text = "Project : " & m_MainWindow.m_CurrentProjectPageUC.GetCurrentProjectName()
+ ExitBtn.Content = EgtMsg(MSG_MISSINGKEYWD + 4) 'Ok
+ End Sub
+
+End Class
diff --git a/AboutBoxWindow/AboutBoxViewModel.vb b/AboutBoxWindow/AboutBoxViewModel.vb
new file mode 100644
index 0000000..2d281ca
--- /dev/null
+++ b/AboutBoxWindow/AboutBoxViewModel.vb
@@ -0,0 +1,64 @@
+Imports System.ComponentModel
+Namespace EgtCAM5
+
+ Public Class AboutBoxViewModel
+ Implements INotifyPropertyChanged
+ 'Inherits ViewModelBase
+
+ Private m_AboutBoxVisibility As Visibility
+ Public Property AboutBoxVisibility As Visibility
+ Get
+ Return m_AboutBoxVisibility
+ End Get
+ Set(value As Visibility)
+ If value <> m_AboutBoxVisibility Then
+ m_AboutBoxVisibility = value
+ NotifyPropertyChanged("AboutBoxVisibility")
+ End If
+ End Set
+ End Property
+ ' Definizione comandi
+ Private m_cmdClose As ICommand
+
+#Region "COMMANDS"
+
+#Region "CloseCommand"
+
+ '''
+ ''' Returns a command that do Point.
+ '''
+ Public ReadOnly Property CloseCommand As ICommand
+ Get
+ If m_cmdClose Is Nothing Then
+ m_cmdClose = New Command(AddressOf Close, AddressOf CanClose)
+ End If
+ Return m_cmdClose
+ End Get
+ End Property
+
+ '''
+ ''' Execute the Point. This method is invoked by the PointCommand.
+ '''
+ Public Sub Close(ByVal param As Object)
+ AboutBoxVisibility = Visibility.Hidden
+ End Sub
+
+ '''
+ ''' Returns always true.
+ '''
+ Private Function CanClose(ByVal param As Object) As Boolean
+ Return True
+ End Function
+
+#End Region ' CloseCommand
+
+#End Region ' Commands
+
+ Public Event PropertyChanged As PropertyChangedEventHandler Implements INotifyPropertyChanged.PropertyChanged
+
+ Public Sub NotifyPropertyChanged(propName As String)
+ RaiseEvent PropertyChanged(Me, New PropertyChangedEventArgs(propName))
+ End Sub
+ End Class
+
+End Namespace
\ No newline at end of file
diff --git a/CompoPanel/CompoPanelViewModel.vb b/CompoPanel/CompoPanelViewModel.vb
index 3bca125..fc122b6 100644
--- a/CompoPanel/CompoPanelViewModel.vb
+++ b/CompoPanel/CompoPanelViewModel.vb
@@ -24,21 +24,34 @@ Public Class CompoPanelViewModel
Sub New(MainWindowViewModel As MainWindowViewModel)
m_rfMainWindowViewModel = MainWindowViewModel
m_rfDoorParametersViewModel = DirectCast(m_rfMainWindowViewModel.DoorParameters.DataContext, DoorParametersViewModel)
+ Dim IndexCompoOrder = 0
+ Dim CompoPanelList As List(Of String) = OptionModule.m_CompoPaneOrder
' Lettura file ini per generare bottoni
Dim Index As Integer = 1
Dim CompoName As String = String.Empty
Dim CompoNameDDF As String = String.Empty
' Carico un vettore con il nome delle Path delle componenti
- Dim CompoArray() As String = Directory.GetDirectories("c:\EgtData\Doors\Compo")
- For Index = 0 To CompoArray.Count - 1
- ' apro ogni directory e cerco un file di testo di nome Config.ini
- Dim CurrCompoPath As String = CompoArray(Index) & "\" & ConstCompo.CONFIGINI_FILE_NAME
- If File.Exists(CurrCompoPath) Then
- GetPrivateProfileCompoName(ConstCompo.S_COMPO, ConstCompo.K_NAME, CompoNameDDF, CompoName, CurrCompoPath)
- m_CompoTypeList.Add(New CompoType(CompoName, CompoNameDDF, CompoArray(Index)))
- End If
+ Dim CompoDirectory As String = String.Empty
+ If GetPrivateProfileString(S_DOORS, K_COMPODIR, "", CompoDirectory) <> 0 Then
+ IniFile.m_CompoDir = CompoDirectory
+ End If
+ Dim CompoArray() As String = Directory.GetDirectories(CompoDirectory)
+ ' carico i valori dei bottoni con un preciso ordine
+ For IndexCompoOrder = 0 To DdfFile.CompoListOrder.Count - 1
+ For Index = 0 To CompoArray.Count - 1
+ ' apro ogni directory e cerco un file di testo di nome Config.ini
+ Dim CurrCompoPath As String = CompoArray(Index) & "\" & ConstCompo.CONFIGINI_FILE_NAME
+ If File.Exists(CurrCompoPath) Then
+ GetPrivateProfileCompoName(ConstCompo.S_COMPO, ConstCompo.K_NAME, CompoNameDDF, CompoName, CurrCompoPath)
+ If CompoPanelList(IndexCompoOrder) = CompoNameDDF Then
+ m_CompoTypeList.Add(New CompoType(CompoName, CompoNameDDF, CompoArray(Index)))
+ Exit For
+ End If
+ End If
+ Next
Next
+
End Sub
#Region "COMMANDS"
diff --git a/Constants/ConstIni.vb b/Constants/ConstIni.vb
index 1beafc3..7eb59f2 100644
--- a/Constants/ConstIni.vb
+++ b/Constants/ConstIni.vb
@@ -35,6 +35,7 @@ Module ConstIni
Public Const K_MODIFY As String = "Modify"
Public Const K_TRANSFORM As String = "Transform"
Public Const K_ONLYDRAW As String = "OnlyDraw"
+ Public Const K_SUPPORT As String = "Support"
Public Const S_SIZE As String = "Size"
Public Const K_WIDTH_INI As String = "Width"
@@ -122,6 +123,8 @@ Module ConstIni
Public Const K_DDFDEFAULTDIR As String = "DdfDefaultDir"
Public Const K_DDFMACHEXEC As String = "DdfMachExec"
Public Const K_TABLESDIR As String = "TablesDir"
+ Public Const K_COMPODIR As String = "CompoDirectory"
+ Public Const K_MYPROJECTDIR As String = "ProjectDirectory"
Public Const S_OPTIONS As String = "Options"
diff --git a/Constants/ConstMsg.vb b/Constants/ConstMsg.vb
index 177b54c..c9a09fc 100644
--- a/Constants/ConstMsg.vb
+++ b/Constants/ConstMsg.vb
@@ -3,7 +3,7 @@
Public Const MSG_EGTDOORCREATOR As Integer = 50000
Public Const MSG_MAINWINDOW As Integer = MSG_EGTDOORCREATOR
Public Const MSG_MISSINGKEYWD As Integer = 10100
- Public Const MSG_TOPCOMMANDBAR As Integer = 10300
+ Public Const MSG_TOPCOMMANDBAR As Integer = 5100
Public Const MSG_ERROR As Integer = MSG_EGTDOORCREATOR + 100
Public Const MSG_EGTWPFLIB5 As Integer = 30000
Public Const MSG_OPTIONPAGE As Integer = 6500
diff --git a/DdfFile.vb b/DdfFile.vb
index daf4019..f718577 100644
--- a/DdfFile.vb
+++ b/DdfFile.vb
@@ -810,6 +810,9 @@ Friend Module DdfFile
End If
DdfFileContent.Add("#EGTDOORCREATOR")
'Genero una lista di stringhe
+ If Door.Measure = "Inches" Then
+ Door.Measure = "inches"
+ End If
DdfFileContent.Add(ConstCompo.K_MEASURES & ": " & Door.Measure)
' aggiungo una riga vuota per separare la lista successiva
DdfFileContent.Add("")
diff --git a/DoorManager/DoorManagerViewModel.vb b/DoorManager/DoorManagerViewModel.vb
index eb1c13d..3124170 100644
--- a/DoorManager/DoorManagerViewModel.vb
+++ b/DoorManager/DoorManagerViewModel.vb
@@ -212,9 +212,11 @@ Public Class DoorManagerViewModel
' lancio la finestra per la creazione di una nuova porta
Dim SaveFileDialog As New EgtWPFLib5.EgtSaveFileDialog
SaveFileDialog.Title = "New Door"
- SaveFileDialog.FileName = m_CurrProject.Name & "\"
+ SaveFileDialog.Directory = m_CurrProject.Name
+ SaveFileDialog.Extension = ".ddf"
+ 'SaveFileDialog.FileName = m_CurrProject.Name & "\"
' se decido di chiuedere la finestra
- If Not SaveFileDialog.ShowDialog Then
+ If Not SaveFileDialog.EgtShowDialog Then
Return
End If
' Controllo se ha estensione il nome della porta
@@ -226,26 +228,28 @@ Public Class DoorManagerViewModel
Else
SaveFileDialog.FileName &= ".ddf"
End If
- ' controllo che il nome del file già non esiste nella lista!
- If CurrProject.DoorList.Count > 0 Then
- For IndexDoorList = 0 To CurrProject.DoorList.Count - 1
- ' se il nome esiste già nella lista
- If CurrProject.DoorList(IndexDoorList) = SaveFileDialog.FileName Then
- MessageBox.Show(String.Format(EgtMsg(50114), CurrProject.Name), EgtMsg(50115), MessageBoxButton.OK, MessageBoxImage.Exclamation)
- 'esco dalla lista e chiedo nuovamente il nome da inserire
- NameExist = True
- Exit For
- Else
- NameExist = False
- End If
- Next
- Else
- ' sicuramente non esiste alcuna porta
- NameExist = False
- End If
- ' se il nome esiste allora esco dalla sub
- If NameExist Then Exit Sub
+
+ '' '' controllo che il nome del file già non esiste nella lista!
+ ' ''If CurrProject.DoorList.Count > 0 Then
+ ' '' For IndexDoorList = 0 To CurrProject.DoorList.Count - 1
+ ' '' ' se il nome esiste già nella lista
+ ' '' If CurrProject.DoorList(IndexDoorList) = SaveFileDialog.FileName Then
+ ' '' MessageBox.Show(String.Format(EgtMsg(50114), CurrProject.Name), EgtMsg(50115), MessageBoxButton.OK, MessageBoxImage.Exclamation)
+ ' '' 'esco dalla lista e chiedo nuovamente il nome da inserire
+ ' '' NameExist = True
+ ' '' Exit For
+ ' '' Else
+ ' '' NameExist = False
+ ' '' End If
+ ' '' Next
+ ' ''Else
+ ' '' ' sicuramente non esiste alcuna porta
+ ' '' NameExist = False
+ ' ''End If
+ '' '' se il nome esiste allora esco dalla sub
+ ' ''If NameExist Then Exit Sub
' altrimenti se non esco
+
' aggiungo il nome del file alla lista delle porte
CurrProject.DoorList.Add(SaveFileDialog.FileName)
' aggiorno la lista
@@ -253,7 +257,7 @@ Public Class DoorManagerViewModel
NewDoor = True
SelectedDoor = SaveFileDialog.FileName
DeleteNewDoor = 0
- m_rfMainWindowViewModel.ProjectNameMsg = "*"
+ 'm_rfMainWindowViewModel.ProjectNameMsg = "*"
End Sub
#End Region ' AddDoorCommand
diff --git a/DoorParameters/Compo.vb b/DoorParameters/Compo.vb
index ab994a8..1e961d0 100644
--- a/DoorParameters/Compo.vb
+++ b/DoorParameters/Compo.vb
@@ -5,7 +5,7 @@ Imports EgtUILib
Public Class Compo
Implements INotifyPropertyChanged
- Friend TempFileDDF As String = "c:\EgtData\EgtDOORCreator\Temp\CurrDoor.ddf"
+ Friend TempFileDDF As String = IniFile.m_sTempDir & "\CurrDoor.ddf"
Friend m_rfCurrDoor As Door
' definizione della funzione delegato: riceve il valore di modifica della compo e della general
'Delegate Function CompareIsModify(rIsModifyCompo As Boolean, rIsModifyDoor As Boolean) As Boolean
@@ -354,6 +354,7 @@ Public Class Compo
' il primo elemento del vettore disti gue tre categorie
Select Case sItems(0)
Case "ComboBox"
+ ConvertComboBoxString(sItems)
' se la combobox contiene almeno un elemento "ComboBox; NomeDDF; Nome; NomeDDFItem/NomeItem"
If sItems.Count >= 4 Then
' carico gli elementi della lista in un vettore
@@ -384,6 +385,7 @@ Public Class Compo
End If
Case "TextBox"
+ ConvertTextBoxString(sItems)
Dim dHeight As Double
' leggo il valore altezza che già esite nella porta
StringToDouble(m_rfCurrDoor.Height, dHeight)
@@ -464,6 +466,7 @@ Public Class Compo
End If
Case "TextBoxOnOff"
+ ConvertTextBoxString(sItems)
Dim dHeight As Double
' leggo il valore altezza che già esite nella porta
StringToDouble(m_rfCurrDoor.Height, dHeight)
@@ -559,6 +562,58 @@ Public Class Compo
Return False
End Function
+ ' converto questo vettore {"TextBox", "NomeDDF/Nome"} in {"TextBox", "NomeDDF", "Nome"}
+ Private Sub ConvertTextBoxString(ByRef Items() As String)
+ Dim Arrays(Items.Count) As String
+ Dim IndexArray As Integer = 0
+ Dim IndexItems As Integer = 0
+ For IndexItems = 0 To Items.Count - 1
+ If Items(IndexItems).Split("/"c).Count = 1 Then
+ Arrays(IndexArray) = Trim(Items(IndexItems))
+ IndexArray += 1
+ ElseIf Items(IndexItems).Split("/"c).Count = 2 Then
+ Arrays(IndexArray) = Trim(Items(IndexItems).Split("/"c)(0))
+ Arrays(IndexArray + 1) = Trim(Items(IndexItems).Split("/"c)(1))
+ IndexArray += 2
+ End If
+ Next
+ If IndexArray = IndexItems + 1 Then
+ System.Array.Resize(Items, IndexArray)
+ Items = Arrays
+ 'Else
+ ' Items = Arrays
+ End If
+ End Sub
+
+ ' converto questo vettore {"ComboBox", "NomeDDF/Nome"} in {"ComboBox", "NomeDDF", "Nome"}
+ Private Sub ConvertComboBoxString(ByRef Items() As String)
+ Dim bCovert As Boolean = False
+ Dim Arrays(Items.Count) As String
+ Dim IndexArray As Integer = 0
+ Dim IndexItems As Integer = 0
+ For IndexItems = 0 To Items.Count - 1
+ If Items(IndexItems).Split("/"c).Count = 1 Then
+ Arrays(IndexArray) = Trim(Items(IndexItems))
+ IndexArray += 1
+ ElseIf Items(IndexItems).Split("/"c).Count = 2 Then
+ Arrays(IndexArray) = Trim(Items(IndexItems).Split("/"c)(0))
+ Arrays(IndexArray + 1) = Trim(Items(IndexItems).Split("/"c)(1))
+ IndexArray += 2
+ For Index = IndexItems + 1 To Items.Count - 1
+ Arrays(Index + 1) = Trim(Items(Index))
+ Next
+ bCovert = True
+ Exit For
+ End If
+ Next
+ If bCovert Then
+ System.Array.Resize(Items, Items.Count)
+ Items = Arrays
+ 'Else
+ ' Items = Arrays
+ End If
+ End Sub
+
Private m_TemplateVisibility As Visibility
Public Property TemplateVisibility As Visibility
Get
diff --git a/DoorParameters/Door.vb b/DoorParameters/Door.vb
index 18169b4..832fa5b 100644
--- a/DoorParameters/Door.vb
+++ b/DoorParameters/Door.vb
@@ -32,26 +32,6 @@ Public Class Door
m_rfModifyTitle(IsModify)
End Sub
- ' definizione della funzione che viene passata al delegato presente nella compo
- ''Function SetChange(IsMCompo As Boolean, ByVal IsmDoor As Boolean) As Boolean
- '' If IsMCompo = False And IsmDoor = False Then
- '' Return False
- '' Else
- '' Return True
- '' End If
- ''End Function
-
- ''Private m_SetChange As Integer = 0
- ''Public Property SetChange As Integer
- '' Get
- '' Return m_SetChange
- '' End Get
- '' Set(value As Integer)
- '' m_SetChange = value
- '' NotifyPropertyChanged("SetChange")
- '' End Set
- ''End Property
-
#Region "GENERAL"
Private m_SwingTypeList As List(Of String) = New List(Of String)
@@ -390,6 +370,7 @@ Public Class Door
' SetChange += 1
'End If
m_IsModifyDoor = True
+ SetTitle()
End Set
End Property
@@ -409,6 +390,7 @@ Public Class Door
' SetChange += 1
'End If
m_IsModifyDoor = True
+ SetTitle()
End Set
End Property
@@ -428,6 +410,7 @@ Public Class Door
' SetChange += 1
'End If
m_IsModifyDoor = True
+ SetTitle()
End Set
End Property
@@ -447,6 +430,7 @@ Public Class Door
' SetChange += 1
'End If
m_IsModifyDoor = True
+ SetTitle()
End Set
End Property
@@ -456,14 +440,16 @@ Public Class Door
Dim dHeight As Double
Dim dWidth As Double
Dim dThickness As Double
- If StringToDouble(m_Height, dHeight) Then
- EgtLuaSetGlobNumVar("H", dHeight)
- End If
- If StringToDouble(m_Width, dWidth) Then
- EgtLuaSetGlobNumVar("W", dWidth)
- End If
- If StringToDouble(m_Thickness, dThickness) Then
- EgtLuaSetGlobNumVar("T", dThickness)
+ If Not IsNothing(m_Height) And Not IsNothing(m_Width) And Not IsNothing(m_Thickness) Then
+ If StringToDouble(m_Height, dHeight) Then
+ EgtLuaSetGlobNumVar("H", dHeight)
+ End If
+ If StringToDouble(m_Width, dWidth) Then
+ EgtLuaSetGlobNumVar("W", dWidth)
+ End If
+ If StringToDouble(m_Thickness, dThickness) Then
+ EgtLuaSetGlobNumVar("T", dThickness)
+ End If
End If
End Sub
@@ -498,17 +484,28 @@ Public Class Door
NewCompo.TemplateDDFName = DDFName
NewCompo.TemplateName = Name
NewCompo.TemplateItemList = TemplateList
- ' se esiste un lista di template
- If NewCompo.TemplateItemList.Count > 0 Then
- Dim SelItemindex As Integer = 0
- ' cerco il primo elemento della lista che abbia estensione lua
- While Path.HasExtension(NewCompo.TemplateItemList(SelItemindex)) And SelItemindex < NewCompo.TemplateItemList.Count - 1
- SelItemindex += 1
- End While
- ' inizializzo la combobox template
- 'NewCompo.TemplateSelItem = NewCompo.TemplateItemList(SelItemindex)
- NewCompo.SetTemplateSelItem(NewCompo.TemplateItemList(SelItemindex))
+ ' se la lista delle componenti contiene già almeno un elemento
+ ''If CompoList.Count > 0 Then
+ '' NewCompo.SetTemplateSelItem(SetItemTemplate(NewCompo.CompoType.DDFName))
+ ''End If
+
+ If Not SetItemTemplate(NewCompo.CompoType.DDFName) = String.Empty Then
+ NewCompo.SetTemplateSelItem(SetItemTemplate(NewCompo.CompoType.DDFName))
+ Else
+
+ ' se esiste un lista di template
+ If NewCompo.TemplateItemList.Count > 0 Then
+ Dim SelItemindex As Integer = 0
+ ' cerco il primo elemento della lista che abbia estensione lua
+ While Path.HasExtension(NewCompo.TemplateItemList(SelItemindex)) And SelItemindex < NewCompo.TemplateItemList.Count - 1
+ SelItemindex += 1
+ End While
+ ' inizializzo la combobox template
+ 'NewCompo.TemplateSelItem = NewCompo.TemplateItemList(SelItemindex)
+ NewCompo.SetTemplateSelItem(NewCompo.TemplateItemList(SelItemindex))
+
+ End If
End If
' se non c'è il template
Else
@@ -549,13 +546,26 @@ Public Class Door
CompoList.Add(NewCompo)
End If
End If
-
+ m_IsModifyDoor = True
+ SetTitle()
Return CompoList.Count - 1
+ End Function
+ Private Function SetItemTemplate(CompoName As String) As String
+ Dim IndexCompo As Integer = 0
+ For IndexCompo = 0 To CompoList.Count - 1
+ If CompoList(IndexCompo).CompoType.DDFName = CompoName Then
+ Return CompoList(IndexCompo).TemplateSelItem
+ Exit For
+ End If
+ Next
+ Return String.Empty
End Function
Friend Sub RemoveCompo(CompoToRemove As Compo)
CompoList.Remove(CompoToRemove)
+ m_IsModifyDoor = True
+ SetTitle()
End Sub
#Region "LETTURA DDF"
diff --git a/DoorParameters/DoorParametersView.xaml b/DoorParameters/DoorParametersView.xaml
index 9665a76..bdb45ca 100644
--- a/DoorParameters/DoorParametersView.xaml
+++ b/DoorParameters/DoorParametersView.xaml
@@ -8,7 +8,7 @@
-
+
@@ -19,7 +19,7 @@
-
@@ -36,15 +36,24 @@
+
+
+
+
+
-
+
+ Margin="0.4,2,39.6,3.2" VerticalAlignment="Stretch" Height="Auto" />
-
+ Margin="0.4,0.4,39.6,3.2" VerticalAlignment="Stretch" Height="Auto"/>
-
+ Style="{StaticResource DoorParamsCmBx}" Height="Auto"/>
-
-
+ Style="{StaticResource DoorParamsCmBx}" Height="Auto"/>
-
-
+
-
+
-
+
-
+
-
+
-
-
-
-
-
-
+
-
+
-
+
+ Margin="10,2,40,4"/>
diff --git a/DoorParameters/DoorParametersViewModel.vb b/DoorParameters/DoorParametersViewModel.vb
index 1a8d724..5f98d40 100644
--- a/DoorParameters/DoorParametersViewModel.vb
+++ b/DoorParameters/DoorParametersViewModel.vb
@@ -11,13 +11,13 @@ Public Class DoorParametersViewModel
Private m_CurrDoor As Door
Public Property CurrDoor As Door
Get
- 'SetChange(m_CurrDoor)
Return m_CurrDoor
End Get
Set(value As Door)
m_CurrDoor = value
- m_CurrDoor.SetVarSize()
- 'm_CurrDoor.SetChange = 1
+ If Not IsNothing(m_CurrDoor) Then
+ m_CurrDoor.SetVarSize()
+ End If
NotifyPropertyChanged("CurrDoor")
End Set
End Property
@@ -44,6 +44,19 @@ Public Class DoorParametersViewModel
#Region "Messages"
'General'
+
+ Public ReadOnly Property EdgeMsg As String
+ Get
+ Return "Edge Type"
+ End Get
+ End Property
+
+ Public ReadOnly Property OverMaterialMsg As String
+ Get
+ Return "Over Material"
+ End Get
+ End Property
+
Public ReadOnly Property GeneralMsg As String
Get
Return EgtMsg(50040)
diff --git a/EgtDOORCreator.vbproj b/EgtDOORCreator.vbproj
index cb86336..abc0ad7 100644
--- a/EgtDOORCreator.vbproj
+++ b/EgtDOORCreator.vbproj
@@ -68,6 +68,9 @@
False..\..\EgtProg\DllD32\EgtWPFLib5.dll
+
+ ..\..\EgtProg\EgtDOORCreator\Ionic.Zip.dll
+
@@ -88,6 +91,10 @@
MSBuild:CompileDesigner
+
+ AboutBoxView.xaml
+
+
@@ -130,10 +137,10 @@
PopUpViewPanelView.xaml
-
+ RefreshPanelView.xaml
-
+ SceneManagerView.xaml
@@ -151,6 +158,10 @@
+
+ MSBuild:Compile
+ Designer
+ DesignerMSBuild:Compile
@@ -204,7 +215,7 @@
MSBuild:CompileDesigner
-
+ DesignerMSBuild:Compile
@@ -315,6 +326,10 @@
+
+
+
+ IF "$(PlatformName)"=="x86" IF "$(ConfigurationName)" == "Release" copy $(TargetPath) c:\EgtProg\EgtDOORCreator\EgtDOORCreatorR32.exe
diff --git a/IniFile.vb b/IniFile.vb
index 7c843c0..5c9cb27 100644
--- a/IniFile.vb
+++ b/IniFile.vb
@@ -11,6 +11,13 @@ Friend Module IniFile
End Enum
' Path cartella Config
+
+ ' Livello della chiave inserita nel PC
+ Friend m_nKeyLevel As Integer = 0
+ ' Opzioni attive sulla chiave
+ Friend m_nKeyOptions As UInteger = 0
+
+
Friend m_sConfigDir As String = String.Empty
' Path IniFile
Friend m_sIniFile As String = String.Empty
@@ -18,6 +25,10 @@ Friend Module IniFile
Friend m_sTempDir As String = String.Empty
' Path Compo.ini file
Friend m_DefaultIniFile As String = String.Empty
+ ' Path MyProject directory
+ Friend m_MyProjectDir As String = String.Empty
+ ' Path Compo directory
+ Friend m_CompoDir As String = String.Empty
' Path del file ddf
Friend m_DDFFilePath As String = String.Empty
diff --git a/Launcher/LauncherView.xaml b/Launcher/LauncherView.xaml
index 6cc8538..af80c74 100644
--- a/Launcher/LauncherView.xaml
+++ b/Launcher/LauncherView.xaml
@@ -15,8 +15,20 @@
+
-
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/OptionsWindow/OptionsViewModel.vb b/OptionsWindow/OptionsViewModel.vb
index 73b5eb1..813dc8f 100644
--- a/OptionsWindow/OptionsViewModel.vb
+++ b/OptionsWindow/OptionsViewModel.vb
@@ -1,8 +1,9 @@
Imports System.Collections.ObjectModel
+Imports System.ComponentModel
Imports EgtUILib
Public Class OptionsViewModel
-
+ Implements INotifyPropertyChanged
Public ReadOnly Property LanguageList As ObservableCollection(Of Language)
Get
Return OptionModule.m_LanguageList
@@ -264,8 +265,23 @@ Public Class OptionsViewModel
End Set
End Property
+ Public Property MyProjectDir As String
+ Get
+ Return IniFile.m_MyProjectDir
+ End Get
+ Set(value As String)
+ If value IsNot IniFile.m_MyProjectDir Then
+ IniFile.m_MyProjectDir = value
+ ' iniziliazzo il valore dell'unità di misura
+ WritePrivateProfileString(S_DOORS, K_MYPROJECTDIR, value)
+ End If
+ NotifyPropertyChanged("MyProjectDir")
+ End Set
+ End Property
+
' Definizione comandi
Private m_cmdCloseOptions As ICommand
+ Private m_cmdBrowse As ICommand
#Region "Messages"
@@ -294,7 +310,13 @@ Public Class OptionsViewModel
Public ReadOnly Property MeasureUnit As String
Get
- Return EgtMsg(MSG_MAINWINDOW + 200)
+ Return "Unit measure new door."
+ End Get
+ End Property
+
+ Public ReadOnly Property DirectoryMsg As String
+ Get
+ Return "Directory Project"
End Get
End Property
@@ -304,12 +326,42 @@ Public Class OptionsViewModel
End Get
End Property
+ Public ReadOnly Property OptionStart As String
+ Get
+ Return "Option Start"
+ End Get
+ End Property
+
+ Public ReadOnly Property CurrentUnitMeasure As String
+ Get
+ Return "Unit Measure"
+ End Get
+ End Property
+
+ Public ReadOnly Property CurrentDirectiry As String
+ Get
+ Return "Current Directory"
+ End Get
+ End Property
+
Public ReadOnly Property WidthMsg As String
Get
Return EgtMsg(MSG_MAINWINDOW + 1)
End Get
End Property
+ Public ReadOnly Property EdgeMsg As String
+ Get
+ Return "Edge Type"
+ End Get
+ End Property
+
+ Public ReadOnly Property OverMaterialMsg As String
+ Get
+ Return "Over Material"
+ End Get
+ End Property
+
Public ReadOnly Property HeightMsg As String
Get
Return EgtMsg(MSG_MAINWINDOW + 2)
@@ -377,6 +429,18 @@ Public Class OptionsViewModel
End Get
End Property
+ Public ReadOnly Property MsgBrowse As String
+ Get
+ Return "Browse"
+ End Get
+ End Property
+
+ Public ReadOnly Property MsgClose As String
+ Get
+ Return "Close"
+ End Get
+ End Property
+
#End Region
#Region "COMMANDS"
@@ -410,6 +474,32 @@ Public Class OptionsViewModel
#End Region ' CloseOptionsCommand
+ Public ReadOnly Property BrowseCommand() As ICommand
+ Get
+ If m_cmdBrowse Is Nothing Then
+ m_cmdBrowse = New Command(AddressOf Browse)
+ End If
+ Return m_cmdBrowse
+ End Get
+ End Property
+
+ Public Sub Browse()
+ Dim FolderBrowserDialog As New System.Windows.Forms.FolderBrowserDialog
+ 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
+ Return
+ End If
+ MyProjectDir = FolderBrowserDialog.SelectedPath
+ End Sub
+
#End Region ' COMMANDS
+ Public Event PropertyChanged As PropertyChangedEventHandler Implements INotifyPropertyChanged.PropertyChanged
+
+ Public Sub NotifyPropertyChanged(propName As String)
+ RaiseEvent PropertyChanged(Me, New PropertyChangedEventArgs(propName))
+ End Sub
+
End Class
diff --git a/ProjectManager/ProjectManagerView.xaml b/ProjectManager/ProjectManagerView.xaml
index 5936934..e6a2d7b 100644
--- a/ProjectManager/ProjectManagerView.xaml
+++ b/ProjectManager/ProjectManagerView.xaml
@@ -21,6 +21,9 @@
+
+
+
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 @@
+
+
+
+
+
+
+
+
+
diff --git a/SceneManager/RefreshPanelView.xaml.vb b/SceneManager/Refresh/RefreshPanelView.xaml.vb
similarity index 52%
rename from SceneManager/RefreshPanelView.xaml.vb
rename to SceneManager/Refresh/RefreshPanelView.xaml.vb
index d79c91b..f5c422d 100644
--- a/SceneManager/RefreshPanelView.xaml.vb
+++ b/SceneManager/Refresh/RefreshPanelView.xaml.vb
@@ -1,3 +1,5 @@
Public Class RefreschPanelView
+ Property DataContext As Object
+
End Class
diff --git a/SceneManager/Refresh/RefreshPanelViewModel.vb b/SceneManager/Refresh/RefreshPanelViewModel.vb
new file mode 100644
index 0000000..e718c95
--- /dev/null
+++ b/SceneManager/Refresh/RefreshPanelViewModel.vb
@@ -0,0 +1,100 @@
+Imports System.ComponentModel
+Imports EgtUILib
+
+
+Public Class RefreshPanelViewModel
+ Implements INotifyPropertyChanged
+ Private m_rfSceneManagerViewModel As SceneManagerViewModel
+
+ Private m_MsgError As String
+ Public Property MsgError As String
+ Get
+ Return m_MsgError
+ End Get
+ Set(value As String)
+ m_MsgError = value
+ NotifyPropertyChanged("MsgError")
+ End Set
+ End Property
+
+ Private m_ButtonVisibility As Visibility = Visibility.Collapsed
+ Public Property ButtonVisibility As Visibility
+ Get
+ Return m_ButtonVisibility
+ End Get
+ Set(value As Visibility)
+ m_ButtonVisibility = value
+ NotifyPropertyChanged("ButtonVisibility")
+ End Set
+ End Property
+
+#Region "Messages"
+ Public ReadOnly Property RefreshMsg As String
+ Get
+ Return EgtMsg(50301)
+ End Get
+ End Property
+
+#End Region
+
+#Region "ToolTip"
+ Public ReadOnly Property RefreshToolTip As String
+ Get
+ Return EgtMsg(50301)
+ End Get
+ End Property
+
+#End Region
+
+
+
+ Private m_CmdRefreshBtn As ICommand
+ Private m_CmdShowErrorBtn As ICommand
+
+ Sub New(ByRef rSceneManagerViewModel As SceneManagerViewModel)
+ m_rfSceneManagerViewModel = rSceneManagerViewModel
+ End Sub
+
+#Region "COMMAND"
+
+#Region "RefreshBtnCommand"
+
+ '''
+ ''' Returns a command that do Exec.
+ '''
+ Public ReadOnly Property RefreshBtnCommand As ICommand
+ Get
+ If m_CmdRefreshBtn Is Nothing Then
+ ' Richiamo il comando che già esiste
+ m_CmdRefreshBtn = New Command(AddressOf m_rfSceneManagerViewModel.RefreshBtn)
+ End If
+ Return m_CmdRefreshBtn
+ End Get
+ End Property
+
+
+#End Region ' RefreshBtnCommand
+ Friend m_MsgGraphic As String
+
+ Public ReadOnly Property ShowErrorBtnCommand As ICommand
+ Get
+ If m_CmdShowErrorBtn Is Nothing Then
+ m_CmdShowErrorBtn = New Command(AddressOf ShowErrorBtn)
+ End If
+ Return m_CmdShowErrorBtn
+ End Get
+ End Property
+
+ Public Sub ShowErrorBtn()
+ MessageBox.Show(m_MsgGraphic, "Error", MessageBoxButton.OK, MessageBoxImage.Error)
+ End Sub
+
+#End Region ' Command
+
+ Public Event PropertyChanged As PropertyChangedEventHandler Implements INotifyPropertyChanged.PropertyChanged
+
+ Public Sub NotifyPropertyChanged(propName As String)
+ RaiseEvent PropertyChanged(Me, New PropertyChangedEventArgs(propName))
+ End Sub
+
+End Class
diff --git a/SceneManager/RefreshPanelView.xaml b/SceneManager/RefreshPanelView.xaml
deleted file mode 100644
index 6295ff9..0000000
--- a/SceneManager/RefreshPanelView.xaml
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-
-
-
-
-
diff --git a/SceneManager/RefreshPanelViewModel.vb b/SceneManager/RefreshPanelViewModel.vb
deleted file mode 100644
index ab2613e..0000000
--- a/SceneManager/RefreshPanelViewModel.vb
+++ /dev/null
@@ -1,30 +0,0 @@
-Imports System.ComponentModel
-Imports System.IO
-Imports System.Windows.Forms.Integration
-Imports EgtUILib
-
-Public Class RefreshPanelViewModel
- Private m_rfSceneManagerViewModel As SceneManagerViewModel
-
-#Region "Messages"
- Public ReadOnly Property RefreshMsg As String
- Get
- Return EgtMsg(50301)
- End Get
- End Property
-
-#End Region
-
-#Region "ToolTip"
- Public ReadOnly Property RefreshToolTip As String
- Get
- Return EgtMsg(50301)
- End Get
- End Property
-
-#End Region
-
- Sub New(ByRef rSceneManagerViewModel As SceneManagerViewModel)
- m_rfSceneManagerViewModel = rSceneManagerViewModel
- End Sub
-End Class
diff --git a/SceneManager/SceneManagerView.xaml b/SceneManager/SceneManagerView.xaml
index 08b832b..d286c3f 100644
--- a/SceneManager/SceneManagerView.xaml
+++ b/SceneManager/SceneManagerView.xaml
@@ -11,23 +11,28 @@
-
-
-
-
+ Command="{Binding DataContext.RefreshBtnCommand,RelativeSource={RelativeSource AncestorType={x:Type UserControl}}}"/>-->
-
+
+
+
+
+
+
+
+