diff --git a/App.config b/App.config
new file mode 100644
index 0000000..3fa3cae
--- /dev/null
+++ b/App.config
@@ -0,0 +1,6 @@
+
+
+
+
+
+
diff --git a/Application.xaml b/Application.xaml
new file mode 100644
index 0000000..59d2741
--- /dev/null
+++ b/Application.xaml
@@ -0,0 +1,10 @@
+
+
+
+
+
+
+
diff --git a/Application.xaml.vb b/Application.xaml.vb
new file mode 100644
index 0000000..2561359
--- /dev/null
+++ b/Application.xaml.vb
@@ -0,0 +1,19 @@
+Class Application
+
+ ' Application-level events, such as Startup, Exit, and DispatcherUnhandledException
+ ' can be handled in this file.
+ Protected Overrides Sub OnStartUp(e As System.Windows.StartupEventArgs)
+ MyBase.OnStartup(e)
+ ShutdownMode = System.Windows.ShutdownMode.OnMainWindowClose
+ ' Creo la View principale
+ Dim MainWndView As New MainWindow
+ MainWindow = MainWndView
+ ' Creo il ViewModel principale
+ Dim MainWndViewModel As New MainWindowViewModel
+ ' Assegno il ViewModel alla View
+ MainWndView.DataContext = MainWndViewModel
+ ' Mostro la View principale
+ MainWndView.Show()
+ End Sub
+
+End Class
diff --git a/Command/Command.vb b/Command/Command.vb
new file mode 100644
index 0000000..9fe3775
--- /dev/null
+++ b/Command/Command.vb
@@ -0,0 +1,68 @@
+
+'''
+''' A command whose sole purpose is to
+''' relay its functionality to other
+''' objects by invoking delegates. The
+''' default return value for the CanExecute
+''' method is 'true'.
+'''
+Public Class Command
+ Implements ICommand
+
+#Region "Fields"
+
+ Private ReadOnly _execute As Action(Of Object)
+ Private ReadOnly _canExecute As Predicate(Of Object)
+
+#End Region ' Fields
+
+#Region "Constructors"
+
+ '''
+ ''' Creates a new command that can always execute.
+ '''
+ ''' The execution logic.
+ Public Sub New(ByVal execute As Action(Of Object))
+ Me.New(execute, Nothing)
+ End Sub
+
+ '''
+ ''' Creates a new command.
+ '''
+ ''' The execution logic.
+ ''' The execution status logic.
+ Public Sub New(ByVal execute As Action(Of Object), ByVal canExecute As Predicate(Of Object))
+ If execute Is Nothing Then
+ Throw New ArgumentNullException("execute")
+ End If
+
+ _execute = execute
+ _canExecute = canExecute
+ End Sub
+
+#End Region ' Constructors
+
+#Region "ICommand Members"
+
+ _
+ Public Function CanExecute(ByVal parameter As Object) As Boolean Implements ICommand.CanExecute
+ Return If(_canExecute Is Nothing, True, _canExecute(parameter))
+ End Function
+
+ Public Custom Event CanExecuteChanged As EventHandler Implements ICommand.CanExecuteChanged
+ AddHandler(ByVal value As EventHandler)
+ AddHandler CommandManager.RequerySuggested, value
+ End AddHandler
+ RemoveHandler(ByVal value As EventHandler)
+ RemoveHandler CommandManager.RequerySuggested, value
+ End RemoveHandler
+ RaiseEvent(ByVal sender As System.Object, ByVal e As System.EventArgs)
+ End RaiseEvent
+ End Event
+
+ Public Sub Execute(ByVal parameter As Object) Implements ICommand.Execute
+ _execute(parameter)
+ End Sub
+
+#End Region ' ICommand Members
+End Class
\ No newline at end of file
diff --git a/Command/RelayCommand.vb b/Command/RelayCommand.vb
new file mode 100644
index 0000000..f000571
--- /dev/null
+++ b/Command/RelayCommand.vb
@@ -0,0 +1,71 @@
+Namespace EgtCAM5
+
+ '''
+ ''' A command whose sole purpose is to
+ ''' relay its functionality to other
+ ''' objects by invoking delegates. The
+ ''' default return value for the CanExecute
+ ''' method is 'true'.
+ '''
+ Public Class RelayCommand
+ Implements ICommand
+
+#Region "Fields"
+
+ Private ReadOnly _execute As Action(Of Object)
+ Private ReadOnly _canExecute As Predicate(Of Object)
+
+#End Region ' Fields
+
+#Region "Constructors"
+
+ '''
+ ''' Creates a new command that can always execute.
+ '''
+ ''' The execution logic.
+ Public Sub New(ByVal execute As Action(Of Object))
+ Me.New(execute, Nothing)
+ End Sub
+
+ '''
+ ''' Creates a new command.
+ '''
+ ''' The execution logic.
+ ''' The execution status logic.
+ Public Sub New(ByVal execute As Action(Of Object), ByVal canExecute As Predicate(Of Object))
+ If execute Is Nothing Then
+ Throw New ArgumentNullException("execute")
+ End If
+
+ _execute = execute
+ _canExecute = canExecute
+ End Sub
+
+#End Region ' Constructors
+
+#Region "ICommand Members"
+
+ _
+ Public Function CanExecute(ByVal parameter As Object) As Boolean Implements ICommand.CanExecute
+ Return If(_canExecute Is Nothing, True, _canExecute(parameter))
+ End Function
+
+ Public Custom Event CanExecuteChanged As EventHandler Implements ICommand.CanExecuteChanged
+ AddHandler(ByVal value As EventHandler)
+ AddHandler CommandManager.RequerySuggested, value
+ End AddHandler
+ RemoveHandler(ByVal value As EventHandler)
+ RemoveHandler CommandManager.RequerySuggested, value
+ End RemoveHandler
+ RaiseEvent(ByVal sender As System.Object, ByVal e As System.EventArgs)
+ End RaiseEvent
+ End Event
+
+ Public Sub Execute(ByVal parameter As Object) Implements ICommand.Execute
+ _execute(parameter)
+ End Sub
+
+#End Region ' ICommand Members
+ End Class
+
+End Namespace
\ No newline at end of file
diff --git a/CompoPanel/CompoBtn.vb b/CompoPanel/CompoBtn.vb
new file mode 100644
index 0000000..3a20551
--- /dev/null
+++ b/CompoPanel/CompoBtn.vb
@@ -0,0 +1,65 @@
+Public Class CompoBtn
+
+ Private m_AddNewDoor As Action(Of String)
+
+ Private m_Name As String
+ Public ReadOnly Property Name As String
+ Get
+ Return m_Name
+ End Get
+ End Property
+
+ Private m_IniCompoName As String
+ Public ReadOnly Property IniCompoName As String
+ Get
+ Return m_IniCompoName
+ End Get
+ End Property
+
+ Private m_DDFCompoName As String
+ Public ReadOnly Property DDFCompoName As String
+ Get
+ Return m_DDFCompoName
+ End Get
+ End Property
+
+
+ Sub New(sName As String, sIniCompoName As String, sDDFCompoName As String, ByRef AddNewDoor As Action(Of String))
+ m_AddNewDoor = AddNewDoor
+ m_Name = sName
+ m_IniCompoName = sIniCompoName
+ m_DDFCompoName = sDDFCompoName
+ End Sub
+
+ ' Definizione comando
+ Private m_CmdCompoBtn As ICommand
+
+#Region "COMMANDS"
+
+#Region "CompoBtnCommand"
+
+ '''
+ ''' Returns a command that do Exec.
+ '''
+ Public ReadOnly Property CompoBtnCommand As ICommand
+ Get
+ If m_CmdCompoBtn Is Nothing Then
+ m_CmdCompoBtn = New Command(AddressOf CompoBtn)
+ End If
+ Return m_CmdCompoBtn
+ End Get
+ End Property
+
+ '''
+ ''' Execute the Exec. This method is invoked by the ExecCommand.
+ '''
+ Public Sub CompoBtn()
+ m_AddNewDoor(m_IniCompoName)
+ End Sub
+
+
+#End Region ' CompoBtnCommand
+
+#End Region 'Commands
+
+End Class
diff --git a/CompoPanel/CompoPanelView.xaml b/CompoPanel/CompoPanelView.xaml
new file mode 100644
index 0000000..bd309df
--- /dev/null
+++ b/CompoPanel/CompoPanelView.xaml
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
+
+
+
diff --git a/CompoPanel/CompoPanelView.xaml.vb b/CompoPanel/CompoPanelView.xaml.vb
new file mode 100644
index 0000000..d57b9e8
--- /dev/null
+++ b/CompoPanel/CompoPanelView.xaml.vb
@@ -0,0 +1,3 @@
+Public Class CompoPanelView
+
+End Class
diff --git a/CompoPanel/CompoPanelViewModel.vb b/CompoPanel/CompoPanelViewModel.vb
new file mode 100644
index 0000000..3844772
--- /dev/null
+++ b/CompoPanel/CompoPanelViewModel.vb
@@ -0,0 +1,50 @@
+Imports System.ComponentModel
+Imports System.Collections.ObjectModel
+Imports EgtUILib
+
+Public Class CompoPanelViewModel
+ Implements INotifyPropertyChanged
+
+ Private m_Door As Door
+ Public Property Door As Door
+ Get
+ Return m_Door
+ End Get
+ Set(value As Door)
+ m_Door = value
+ End Set
+ End Property
+
+ Private Shared m_CompoBtnList As New ObservableCollection(Of CompoBtn)
+ Public Shared ReadOnly Property CompoBtnList As ObservableCollection(Of CompoBtn)
+ Get
+ Return m_CompoBtnList
+ End Get
+ End Property
+
+ Sub New(ByRef Door As Door)
+ Me.m_Door = Door
+ ' Lettura file ini per generare bottoni
+ Dim Index As Integer = 1
+ Dim CompoName As String = String.Empty
+ Dim CompoNameDDF As String = String.Empty
+ Dim nCompoName As Integer = 0
+ ' ciclo sui Compo
+ While Index <> -1
+ CompoGetPrivateProfileNameGroup(ConstCompo.S_COMPO & Index, ConstCompo.K_NAME, CompoNameDDF, CompoName)
+ ' se lo trovo
+ If CompoName = String.Empty Then
+ Index = -1
+ Else
+ m_CompoBtnList.Add(New CompoBtn(CompoName, ConstCompo.S_COMPO & Index, CompoNameDDF, AddressOf Door.AddNewCompo))
+ Index += 1
+ End If
+ End While
+ End Sub
+
+ 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/Constants/ConstCompo.vb b/Constants/ConstCompo.vb
new file mode 100644
index 0000000..d891fbf
--- /dev/null
+++ b/Constants/ConstCompo.vb
@@ -0,0 +1,42 @@
+'----------------------------------------------------------------------------
+' EgalTech 2015-2015
+'----------------------------------------------------------------------------
+' File : ConstCompo.vb Data : 12.02.15 Versione : 1.6b3
+' Contenuto : Modulo costanti sezione e chiavi per file Ini.
+'
+'
+'
+' Modifiche : 12.02.15 DS Creazione modulo.
+'
+'
+'----------------------------------------------------------------------------
+
+Module ConstCompo
+
+ Public Const COMPOINI_FILE_NAME As String = "Compo.ini"
+
+ Public Const S_COMPO As String = "Compo"
+ Public Const K_NAME As String = "Name"
+ Public Const K_COMBOBOX As String = "ComboBox"
+ Public Const K_TEXTBOX As String = "TextBox"
+ Public Const K_SPECIALTEXTBOX As String = "SpecialTextBox"
+
+ Public Const K_SIZE As String = "size"
+ Public Const K_WIDTH As String = "width"
+ Public Const K_HEIGHT As String = "height"
+ Public Const K_THICKNESS As String = "thickness"
+ Public Const K_SWING As String = "swing"
+ Public Const K_PROFILES As String = "profiles"
+ Public Const K_LOCKEDGE As String = "lockedge"
+ Public Const K_MACHINING As String = "machining"
+ Public Const K_OVERMATERAL As String = "overmaterial"
+ Public Const K_HINGEEDGE As String = "hingeedge"
+ Public Const K_TOP As String = "top"
+ Public Const K_BOTTOM As String = "bottom"
+ Public Const K_SPACE3 As String = " "
+ Public Const K_SPACE5 As String = " "
+ Public Const K_LIST As String = "List"
+ Public Const K_ON As String = "ON"
+ Public Const K_OFF As String = "OFF"
+
+End Module
diff --git a/Constants/ConstGen.vb b/Constants/ConstGen.vb
new file mode 100644
index 0000000..bdc622e
--- /dev/null
+++ b/Constants/ConstGen.vb
@@ -0,0 +1,41 @@
+'----------------------------------------------------------------------------
+' EgalTech 2015-2015
+'----------------------------------------------------------------------------
+' File : ConstGen.vb Data : 12.02.15 Versione : 1.6b3
+' Contenuto : Modulo costanti generali.
+'
+'
+'
+' Modifiche : 12.02.15 DS Creazione modulo.
+'
+'
+'----------------------------------------------------------------------------
+Imports EgtUILib
+
+Module ConstGen
+
+ ' File con direttorio radice dei dati
+ Public Const DAT_FILE_NAME As String = "DataRoot.Ini"
+ Public Const S_DATA As String = "Data"
+ Public Const K_DATAROOT As String = "DataRoot"
+
+ ' File con dati di licenza
+ Public Const LIC_FILE_NAME As String = "EgtDOORCreator.lic"
+ Public Const S_LICENCE As String = "Licence"
+ Public Const K_KEY As String = "Key"
+
+ ' File di log generale
+ Public Const GENLOG_FILE_NAME As String = "EgtDOORCreatorLog#.txt"
+ ' File di log dei comandi
+ Public Const CMDLOG_FILE_NAME As String = "EgtDOORCreatorLog#.tua"
+
+ ' Sottodirettorio di configurazione
+ Public Const CONF_DIR As String = "Config"
+ ' Sottodirettorio delle risorse
+ Public Const RES_DIR As String = "Resources"
+ ' Sottodirettorio temporaneo
+ Public Const TEMP_DIR As String = "Temp"
+ ' Sottodirettorio di default per il salvataggio con nome
+ Public Const SAVE_DFL_NAMEDIR As String = "MyProjects"
+
+End Module
diff --git a/Constants/ConstIni.vb b/Constants/ConstIni.vb
new file mode 100644
index 0000000..705fc81
--- /dev/null
+++ b/Constants/ConstIni.vb
@@ -0,0 +1,97 @@
+'----------------------------------------------------------------------------
+' EgalTech 2015-2015
+'----------------------------------------------------------------------------
+' File : ConstIni.vb Data : 12.02.15 Versione : 1.6b3
+' Contenuto : Modulo costanti sezione e chiavi per file Ini.
+'
+'
+'
+' Modifiche : 12.02.15 DS Creazione modulo.
+'
+'
+'----------------------------------------------------------------------------
+
+Module ConstIni
+
+ Public Const INI_FILE_NAME As String = "EgtDOORCreator.ini"
+
+ Public Const S_GENERAL As String = "General"
+ Public Const K_DEBUG As String = "Debug"
+ Public Const K_LICENCE As String = "Licence"
+ Public Const K_USERLEVEL As String = "UserLevel"
+ Public Const K_MAXINST As String = "MaxInstances"
+ Public Const K_INSTANCES As String = "Instances"
+ Public Const K_COMMANDLOG As String = "CommandLog"
+ Public Const K_MESSAGESDIR As String = "MessagesDir"
+ Public Const K_MESSAGES As String = "Messages"
+ Public Const K_WINPLACE As String = "WinPlace"
+ Public Const K_LASTNGEDIR As String = "LastNgeDir"
+ Public Const K_LASTNGEOBJDIR As String = "LastNgeObjDir"
+ Public Const K_LASTLUADIR As String = "LastLuaDir"
+ Public Const K_LASTIMPDIR As String = "LastImpDir"
+ Public Const K_LASTEXPDIR As String = "LastExpDir"
+ Public Const K_DRAW2D As String = "2DDraw"
+ Public Const K_DRAW3D As String = "3DDraw"
+ Public Const K_MODIFY As String = "Modify"
+ Public Const K_TRANSFORM As String = "Transform"
+ Public Const K_ONLYDRAW As String = "OnlyDraw"
+
+ Public Const S_LANGUAGES As String = "Languages"
+ Public Const K_LANGUAGE As String = "Language"
+
+ Public Const S_LUA As String = "Lua"
+ Public Const K_LIBSDIR As String = "LibsDir"
+ Public Const K_BASELIB As String = "BaseLib"
+
+ Public Const S_GEOMDB As String = "GeomDB"
+ Public Const K_DEFAULTFONT As String = "DefaultFont"
+ Public Const K_NFEFONTDIR As String = "NfeFontDir"
+ Public Const K_DEFAULTCOLOR As String = "DefaultColor"
+ Public Const K_SAVETYPE As String = "SaveType"
+
+ Public Const S_OPENGL As String = "OpenGL"
+ Public Const K_DOUBLEBUFFER As String = "DoubleBuffer"
+ Public Const K_COLORBITS As String = "ColorBits"
+ Public Const K_DEPTHBITS As String = "DepthBits"
+ Public Const K_DRIVER As String = "Driver"
+
+ Public Const S_SCENE As String = "Scene"
+ Public Const K_BACKTOP As String = "BackTop"
+ Public Const K_BACKBOTTOM As String = "BackBottom"
+ Public Const K_SHOWGFRAME As String = "ShowGFrame"
+ Public Const K_MARK As String = "Mark"
+ Public Const K_SELSURF As String = "SelSurf"
+ Public Const K_SHOWMODE As String = "ShowMode"
+ Public Const K_CURVEDIR As String = "CurveDir"
+ Public Const K_SHOWTRIAADV As String = "ShowTriaAdv"
+ Public Const K_ZOOMWIN As String = "ZoomWin"
+ Public Const K_DISTLINE As String = "DistLine"
+ Public Const K_MMUNITS As String = "MmUnits"
+
+ Public Const S_GRID As String = "Grid"
+ Public Const K_DRAWSHOWGRID As String = "DrawShowGrid"
+ Public Const K_MACHININGSHOWGRID As String = "MachiningShowGrid"
+ Public Const K_SHOWFRAME As String = "ShowFrame"
+ Public Const K_SNAPSTEP As String = "SnapStep"
+ Public Const K_SNAPSTEPINCH As String = "SnapStepInch"
+ Public Const K_MINLINESSTEP As String = "MinLineSStep"
+ Public Const K_MAJLINESSTEP As String = "MajLineSStep"
+ Public Const K_EXTSSTEP As String = "ExtSStep"
+ Public Const K_MINLNCOLOR As String = "MinLnColor"
+ Public Const K_MAJLNCOLOR As String = "MajLnColor"
+
+ Public Const S_DOORS As String = "Doors"
+ Public Const K_DDFENABLE As String = "DdfEnable"
+ Public Const K_DDFEXEC As String = "DdfExec"
+ Public Const K_DDFFUNCTION As String = "DdfFun"
+ Public Const K_DDFDIR As String = "DdfDir"
+ Public Const K_DDFDEFAULTDIR As String = "DdfDefaultDir"
+ Public Const K_DDFMACHEXEC As String = "DdfMachExec"
+ Public Const K_TABLESDIR As String = "TablesDir"
+
+ Public Const S_OPTIONS As String = "Options"
+
+ Public Const S_MRUDOORS As String = "MruDoors"
+ Public Const K_FILE As String = "File"
+
+End Module
diff --git a/Constants/ConstMsg.vb b/Constants/ConstMsg.vb
new file mode 100644
index 0000000..0306c21
--- /dev/null
+++ b/Constants/ConstMsg.vb
@@ -0,0 +1,11 @@
+Module ConstMsg
+
+ 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_ERROR As Integer = MSG_EGTDOORCREATOR + 100
+ Public Const MSG_EGTWPFLIB5 As Integer = 30000
+ Public Const MSG_EGTSAVEFILEDIALOG As Integer = MSG_EGTWPFLIB5
+
+End Module
diff --git a/DdfFile.vb b/DdfFile.vb
new file mode 100644
index 0000000..534a39f
--- /dev/null
+++ b/DdfFile.vb
@@ -0,0 +1,306 @@
+Imports System.Collections.ObjectModel
+Imports System.IO
+Imports EgtUILib
+Imports System.Text.RegularExpressions
+
+Friend Module DdfFile
+
+ Friend m_Door As New Door
+ Private FileContent As String()
+
+#Region "Lettura ddf"
+
+ Public Function ReadDDF(sPath As String) As Boolean
+ If Not File.Exists(sPath) Then Return False
+ FileContent = File.ReadAllLines(sPath)
+ If FileContent.Count = 0 Then Return False
+ For LineIndex As Integer = 0 To FileContent.Count - 1
+ ' size
+ If SearchKey(FileContent(LineIndex), K_SIZE) Then
+ LineIndex = GetSize(LineIndex + 1)
+ If LineIndex = -1 Then
+ MessageBox.Show("Errore in lettura DDF", "Errore", MessageBoxButton.OK, MessageBoxImage.Error)
+ End If
+ End If
+ '' swing
+ 'If SearchKey(FileContent(LineIndex), K_SWING) Then
+ ' If Not GetProfiles(LineIndex + 1) Then
+ ' MessageBox.Show("Errore in lettura DDF", "Errore", MessageBoxButton.OK, MessageBoxImage.Error)
+ ' End If
+ 'End If
+ ' profiles
+ If SearchKey(FileContent(LineIndex), K_PROFILES) Then
+ LineIndex = GetProfiles(LineIndex + 1)
+ If LineIndex = -1 Then
+ MessageBox.Show("Errore in lettura DDF", "Errore", MessageBoxButton.OK, MessageBoxImage.Error)
+ End If
+ End If
+ Next
+ Return True
+ End Function
+
+ Friend Function SearchKeyValue(sLine As String, sKey As String) As String
+ Return Regex.Match(sLine, "\s*" & sKey & "\s*:\s*(.*?\b)\s*$").Groups(1).Value
+ End Function
+
+ Friend Function SearchKey(sLine As String, sKey As String) As Boolean
+ If Not Regex.Match(sLine, "\s*(" & sKey & ")\s*:\s*$").Groups(1).Value = sKey Then Return False
+ Return True
+ End Function
+
+
+ '' Lettura di file DDF e scrittura su lista
+ 'Public Function ReadDDF(ByRef DdfList As List(Of String)) As Boolean
+ ' ' Path Compo.ini file
+ ' Dim m_sCompoIniFile As String = String.Empty
+ ' ' Path DdfFile
+ ' Dim m_sDdfFile As New StreamReader("c:\EgtData\EgtDOORCreator\Myprojects\Prova1.ddf")
+ ' Dim sLine As String = String.Empty
+
+ ' ' Lettura e caricamento del file ddf su una lista
+ ' Do
+ ' sLine = m_sDdfFile.ReadLine()
+ ' If Not sLine Is Nothing Then
+ ' DdfList.Add(sLine)
+ ' End If
+ ' Loop Until sLine Is Nothing
+ ' m_sDdfFile.Close()
+ ' Return True
+ 'End Function
+
+ ' Cerco l'indice del paragrafo
+ Private Function DDFGetLeadIndex(ByRef DdfList As List(Of String), ByRef Lead As String) As Integer
+ Dim Index As Integer
+ For Index = 0 To DdfList.Count()
+ If LTrim(DdfList.Item(Index)) = DdfList.Item(Index) Then
+ Dim sItem() As String = DdfList.Item(Index).Split(":".ToCharArray)
+ If sItem(0) = Lead Then
+ Return Index
+ End If
+ End If
+ Next
+ Return -1
+ End Function
+
+ ' carico valori di Size
+ Public Function GetSize(Index As Integer) As Integer
+ Dim Width As String = SearchKeyValue(FileContent(Index), K_WIDTH)
+ If String.IsNullOrEmpty(Width) Then
+ If Not SearchKey(FileContent(Index), K_LOCKEDGE) Then Return -1
+ Index += 1
+ Else
+ m_Door.Width = Width
+ Index += 1
+ End If
+ Dim Height As String = SearchKeyValue(FileContent(Index), K_HEIGHT)
+ If String.IsNullOrEmpty(Height) Then
+ If Not SearchKey(FileContent(Index), K_HEIGHT) Then Return -1
+ Index += 1
+ Else
+ m_Door.Height = Height
+ Index += 1
+ End If
+ Dim Thickness As String = SearchKeyValue(FileContent(Index), K_THICKNESS)
+ If String.IsNullOrEmpty(Thickness) Then
+ If Not SearchKey(FileContent(Index), K_THICKNESS) Then Return -1
+ Index += 1
+ Else
+ m_Door.Thickness = Thickness
+ Index += 1
+ End If
+ Return Index
+ End Function
+
+ ' carico valori swing
+ Public Function DDFGetSwing(ByRef DdfList As List(Of String)) As Boolean
+ Dim Index As Integer = DDFGetLeadIndex(DdfList, K_SWING)
+ If Index <> -1 Then
+ Dim sItem() As String = DdfList.Item(Index).Split(":".ToCharArray)
+ m_Door.Swing = sItem(1)
+ Return True
+ Else
+ Return False
+ End If
+ End Function
+
+ Public Function ConvertStringToBoolean(sItem As String) As Boolean
+ If sItem = K_ON Then
+ Return True
+ Else
+ Return False
+ End If
+ End Function
+
+ ' carico valori profiles
+ Public Function GetProfiles(Index As Integer) As Integer
+
+ ' Lock
+ Dim LockEdgeType As String = SearchKeyValue(FileContent(Index), K_LOCKEDGE)
+ If String.IsNullOrEmpty(LockEdgeType) Then
+ If Not SearchKey(FileContent(Index), K_LOCKEDGE) Then Return -1
+ Index += 1
+ Else
+ m_Door.LockEdgeType = LockEdgeType
+ Index += 1
+ End If
+ Dim LockEdgeMachining As String = SearchKeyValue(FileContent(Index), K_MACHINING)
+ If String.IsNullOrEmpty(LockEdgeMachining) Then
+ If Not SearchKey(FileContent(Index), K_MACHINING) Then Return -1
+ Index += 1
+ Else
+ m_Door.LockEdgeMachining = ConvertStringToBoolean(LockEdgeMachining)
+ Index += 1
+ End If
+ Dim LockEdgeOverMaterial As String = SearchKeyValue(FileContent(Index), K_OVERMATERAL)
+ If String.IsNullOrEmpty(LockEdgeOverMaterial) Then
+ If Not SearchKey(FileContent(Index), K_OVERMATERAL) Then Return -1
+ Index += 1
+ Else
+ m_Door.LockEdgeOverMaterial = LockEdgeOverMaterial
+ Index += 1
+ End If
+
+ ' Hinge
+ Dim HingeEdgeType As String = SearchKeyValue(FileContent(Index), K_HINGEEDGE)
+ If String.IsNullOrEmpty(HingeEdgeType) Then
+ If Not SearchKey(FileContent(Index), K_HINGEEDGE) Then Return -1
+ Index += 1
+ Else
+ m_Door.HingeEdgeType = HingeEdgeType
+ Index += 1
+ End If
+ Dim HingeEdgeMachining As String = SearchKeyValue(FileContent(Index), K_MACHINING)
+ If String.IsNullOrEmpty(HingeEdgeMachining) Then
+ If Not SearchKey(FileContent(Index), K_MACHINING) Then Return -1
+ Index += 1
+ Else
+ m_Door.HingeEdgeMachining = ConvertStringToBoolean(HingeEdgeMachining)
+ Index += 1
+ End If
+ Dim HingeEdgeOverMaterial As String = SearchKeyValue(FileContent(Index), K_OVERMATERAL)
+ If String.IsNullOrEmpty(HingeEdgeOverMaterial) Then
+ If Not SearchKey(FileContent(Index), K_OVERMATERAL) Then Return -1
+ Index += 1
+ Else
+ m_Door.HingeEdgeOverMaterial = HingeEdgeOverMaterial
+ Index += 1
+ End If
+
+ ' Top
+ Dim TopType As String = SearchKeyValue(FileContent(Index), K_TOP)
+ If String.IsNullOrEmpty(TopType) Then
+ If Not SearchKey(FileContent(Index), K_TOP) Then Return -1
+ Index += 1
+ Else
+ m_Door.TopType = TopType
+ Index += 1
+ End If
+ Dim TopMachining As String = SearchKeyValue(FileContent(Index), K_MACHINING)
+ If String.IsNullOrEmpty(TopMachining) Then
+ If Not SearchKey(FileContent(Index), K_MACHINING) Then Return -1
+ Index += 1
+ Else
+ m_Door.TopMachining = ConvertStringToBoolean(TopMachining)
+ Index += 1
+ End If
+ Dim TopOverMaterial As String = SearchKeyValue(FileContent(Index), K_OVERMATERAL)
+ If String.IsNullOrEmpty(TopOverMaterial) Then
+ If Not SearchKey(FileContent(Index), K_OVERMATERAL) Then Return -1
+ Index += 1
+ Else
+ m_Door.TopOverMaterial = TopOverMaterial
+ Index += 1
+ End If
+
+ ' Bottom
+ Dim BottomType As String = SearchKeyValue(FileContent(Index), K_BOTTOM)
+ If String.IsNullOrEmpty(BottomType) Then
+ If Not SearchKey(FileContent(Index), K_BOTTOM) Then Return -1
+ Index += 1
+ Else
+ m_Door.BottomType = BottomType
+ Index += 1
+ End If
+
+ Dim BottomMachining As String = SearchKeyValue(FileContent(Index), K_MACHINING)
+ If String.IsNullOrEmpty(BottomMachining) Then
+ If Not SearchKey(FileContent(Index), K_MACHINING) Then Return -1
+ Index += 1
+ Else
+ m_Door.BottomMachining = ConvertStringToBoolean(BottomMachining)
+ Index += 1
+ End If
+
+ Dim BottomOverMaterial As String = SearchKeyValue(FileContent(Index), K_OVERMATERAL)
+ If String.IsNullOrEmpty(BottomOverMaterial) Then
+ If Not SearchKey(FileContent(Index), K_OVERMATERAL) Then Return -1
+ Index += 1
+ Else
+ m_Door.BottomOverMaterial = BottomOverMaterial
+ Index += 1
+ End If
+
+ Return Index
+ End Function
+
+ ' restituisce il nome della componenente
+ Public Function DDFGetCompoName(ByRef DdfList As List(Of String), ByRef LastIndex As Integer) As String
+ Dim CompoName As String = String.Empty
+ Dim Index As Integer
+ For Index = LastIndex To DdfList.Count()
+ If LTrim(DdfList.Item(Index)) = DdfList.Item(Index) Then
+ Dim sItem() As String = DdfList.Item(Index).Split(":".ToCharArray)
+ CompoName = sItem(0)
+ End If
+ Next
+ Return CompoName
+ End Function
+
+
+#End Region ' Lettura ddf
+
+ 'Genero la lista di parametri di ogni compo che vedo a video
+ Public Function GenerateCompolistDDF(Compo As Compo) As List(Of String)
+ Dim CompoListDDF As New List(Of String)
+ CompoListDDF.Add(Compo.NameDDF & ":")
+ 'aggiungo le combobox
+ If Compo.ComboBox1Visibility = Visibility.Visible Then
+ CompoListDDF.Add(ConstCompo.K_SPACE3 & "- " & Compo.ComboBox1DDFName & ": " & If(Not Path.HasExtension(Compo.ComboBox1SelItem), Compo.ComboBox1ListDDF.Item(Compo.ComboBox1List.IndexOf(Compo.ComboBox1SelItem)), Compo.ComboBox1SelItem.Replace(Path.GetExtension(Compo.ComboBox1SelItem), "")))
+ End If
+ If Compo.ComboBox2Visibility = Visibility.Visible Then
+ CompoListDDF.Add(ConstCompo.K_SPACE5 & Compo.ComboBox2DDFName & ": " & If(Not Path.HasExtension(Compo.ComboBox2SelItem), Compo.ComboBox2ListDDF.Item(Compo.ComboBox2List.IndexOf(Compo.ComboBox2SelItem)), Compo.ComboBox2SelItem.Replace(Path.GetExtension(Compo.ComboBox2SelItem), "")))
+ End If
+ If Compo.ComboBox3Visibility = Visibility.Visible Then
+ CompoListDDF.Add(ConstCompo.K_SPACE5 & Compo.ComboBox3DDFName & ": " & If(Not Path.HasExtension(Compo.ComboBox3SelItem), Compo.ComboBox3ListDDF.Item(Compo.ComboBox3List.IndexOf(Compo.ComboBox3SelItem)), Compo.ComboBox3SelItem.Replace(Path.GetExtension(Compo.ComboBox3SelItem), "")))
+ End If
+ 'aggiungo le textbox
+ Dim dVal As Double = 0
+ If Compo.TextBox1Visibility = Visibility.Visible Then
+ StringToDouble(Compo.TextBox1Value, dVal)
+ CompoListDDF.Add(ConstCompo.K_SPACE5 & Compo.TextBox1DDFName & ": " & DoubleToString(dVal, 3))
+ End If
+ If Compo.TextBox2Visibility = Visibility.Visible Then
+ StringToDouble(Compo.TextBox2Value, dVal)
+ CompoListDDF.Add(ConstCompo.K_SPACE5 & Compo.TextBox2DDFName & ": " & DoubleToString(dVal, 3))
+ End If
+ If Compo.TextBox3Visibility = Visibility.Visible Then
+ StringToDouble(Compo.TextBox3Value, dVal)
+ CompoListDDF.Add(ConstCompo.K_SPACE5 & Compo.TextBox3DDFName & ": " & DoubleToString(dVal, 3))
+ End If
+ If Compo.TextBox4Visibility = Visibility.Visible Then
+ StringToDouble(Compo.TextBox4Value, dVal)
+ CompoListDDF.Add(ConstCompo.K_SPACE5 & Compo.TextBox4DDFName & ": " & DoubleToString(dVal, 3))
+ End If
+ If Compo.TextBox5Visibility = Visibility.Visible Then
+ StringToDouble(Compo.TextBox5Value, dVal)
+ CompoListDDF.Add(ConstCompo.K_SPACE5 & Compo.TextBox5DDFName & ": " & DoubleToString(dVal, 3))
+ End If
+ If Compo.SpecialTextBox1Visibility = Visibility.Visible Then
+ StringToDouble(Compo.SpecialTextBox1Value, dVal)
+ CompoListDDF.Add(ConstCompo.K_SPACE5 & Compo.SpecialTextBox1DDFName & ": " & DoubleToString(dVal, 3))
+ End If
+ ' aggiungo una riga vuota
+ CompoListDDF.Add("")
+ Return CompoListDDF
+ End Function
+End Module
diff --git a/DoorParameters/Compo.vb b/DoorParameters/Compo.vb
new file mode 100644
index 0000000..db88c70
--- /dev/null
+++ b/DoorParameters/Compo.vb
@@ -0,0 +1,646 @@
+Imports System.ComponentModel
+
+Public Class Compo
+ Implements INotifyPropertyChanged
+
+#Region "GROUP"
+
+ Private m_Name As String
+ Public Property Name As String
+ Get
+ Return m_Name
+ End Get
+ Set(value As String)
+ m_Name = value
+ End Set
+ End Property
+
+ Private m_NameDDF As String
+ Public Property NameDDF As String
+ Get
+ Return m_NameDDF
+ End Get
+ Set(value As String)
+ m_NameDDF = value
+ End Set
+ End Property
+
+#Region "ComboBox"
+
+#Region "ComboBox1"
+ Private m_ComboBox1Index As Integer
+ Public Property ComboBox1Index As Integer
+ Get
+ Return m_ComboBox1Index
+ End Get
+ Set(value As Integer)
+ m_ComboBox1Index = value
+ End Set
+ End Property
+
+ Private m_ComboBox1Name As String
+ Public Property ComboBox1Name As String
+ Get
+ Return m_ComboBox1Name
+ End Get
+ Set(value As String)
+ m_ComboBox1Name = value
+ End Set
+ End Property
+
+ Private m_ComboBox1List As List(Of String)
+ Public Property ComboBox1List As List(Of String)
+ Get
+ Return m_ComboBox1List
+ End Get
+ Set(value As List(Of String))
+ m_ComboBox1List = value
+ End Set
+ End Property
+
+ Private m_ComboBox1ListDDF As List(Of String)
+ Public Property ComboBox1ListDDF As List(Of String)
+ Get
+ Return m_ComboBox1ListDDF
+ End Get
+ Set(value As List(Of String))
+ m_ComboBox1ListDDF = value
+ End Set
+ End Property
+
+ Private m_ComboBox1SpecialList As List(Of String)
+ Public Property ComboBox1SpecialList As List(Of String)
+ Get
+ Return m_ComboBox1SpecialList
+ End Get
+ Set(value As List(Of String))
+ m_ComboBox1SpecialList = value
+ End Set
+ End Property
+
+ Private m_ComboBox1SelItem As String
+ Public Property ComboBox1SelItem As String
+ Get
+ Return m_ComboBox1SelItem
+ End Get
+ Set(value As String)
+ m_ComboBox1SelItem = value
+ Dim bFound As Boolean = False
+ If Not IsNothing(ComboBox1SpecialList) Then
+ For Index = 0 To m_ComboBox1SpecialList.Count() - 1
+ If m_ComboBox1SpecialList(Index) = m_ComboBox1SelItem Then
+ bFound = True
+ Exit For
+ End If
+ Next
+ If bFound Then
+ m_SpecialTextBox1Visibility = Visibility.Visible
+ Else
+ m_SpecialTextBox1Visibility = Visibility.Collapsed
+ End If
+ NotifyPropertyChanged("SpecialTextBox1Visibility")
+ End If
+ End Set
+ End Property
+
+ Private m_ComboBox1DDFName As String
+ Public Property ComboBox1DDFName As String
+ Get
+ Return m_ComboBox1DDFName
+ End Get
+ Set(value As String)
+ m_ComboBox1DDFName = value
+ End Set
+ End Property
+
+ Private m_ComboBox1Visibility As Visibility
+ Public Property ComboBox1Visibility As Visibility
+ Get
+ Return m_ComboBox1Visibility
+ End Get
+ Set(value As Visibility)
+ m_ComboBox1Visibility = value
+ End Set
+ End Property
+
+#End Region ' ComboBox 1
+
+#Region "ComboBox2"
+ Private m_ComboBox2Index As Integer
+ Public Property ComboBox2Index As Integer
+ Get
+ Return m_ComboBox2Index
+ End Get
+ Set(value As Integer)
+ m_ComboBox2Index = value
+ End Set
+ End Property
+
+ Private m_ComboBox2Name As String
+ Public Property ComboBox2Name As String
+ Get
+ Return m_ComboBox2Name
+ End Get
+ Set(value As String)
+ m_ComboBox2Name = value
+ End Set
+ End Property
+
+ Private m_ComboBox2List As List(Of String)
+ Public Property ComboBox2List As List(Of String)
+ Get
+ Return m_ComboBox2List
+ End Get
+ Set(value As List(Of String))
+ m_ComboBox2List = value
+ End Set
+ End Property
+
+ Private m_ComboBox2ListDDF As List(Of String)
+ Public Property ComboBox2ListDDF As List(Of String)
+ Get
+ Return m_ComboBox2ListDDF
+ End Get
+ Set(value As List(Of String))
+ m_ComboBox2ListDDF = value
+ End Set
+ End Property
+
+ Private m_ComboBox2SpecialList As List(Of String)
+ Public Property ComboBox2SpecialList As List(Of String)
+ Get
+ Return m_ComboBox2SpecialList
+ End Get
+ Set(value As List(Of String))
+ m_ComboBox2SpecialList = value
+ End Set
+ End Property
+
+ Private m_ComboBox2SelItem As String
+ Public Property ComboBox2SelItem As String
+ Get
+ Return m_ComboBox2SelItem
+ End Get
+ Set(value As String)
+ m_ComboBox2SelItem = value
+ Dim bFound As Boolean = False
+ If Not IsNothing(ComboBox2SpecialList) Then
+ For Index = 0 To m_ComboBox2SpecialList.Count() - 1
+ If m_ComboBox2SpecialList(Index) = m_ComboBox2SelItem Then
+ bFound = True
+ Exit For
+ End If
+ Next
+ If bFound Then
+ m_SpecialTextBox1Visibility = Visibility.Visible
+ Else
+ m_SpecialTextBox1Visibility = Visibility.Collapsed
+ End If
+ NotifyPropertyChanged("SpecialTextBox1Visibility")
+ End If
+ End Set
+ End Property
+
+ Private m_ComboBox2DDFName As String
+ Public Property ComboBox2DDFName As String
+ Get
+ Return m_ComboBox2DDFName
+ End Get
+ Set(value As String)
+ m_ComboBox2DDFName = value
+ End Set
+ End Property
+
+ Private m_ComboBox2Visibility As Visibility
+ Public Property ComboBox2Visibility As Visibility
+ Get
+ Return m_ComboBox2Visibility
+ End Get
+ Set(value As Visibility)
+ m_ComboBox2Visibility = value
+ End Set
+ End Property
+
+#End Region ' ComboBox2
+
+#Region "ComboBox3"
+ Private m_ComboBox3Index As Integer
+ Public Property ComboBox3Index As Integer
+ Get
+ Return m_ComboBox3Index
+ End Get
+ Set(value As Integer)
+ m_ComboBox3Index = value
+ End Set
+ End Property
+
+ Private m_ComboBox3Name As String
+ Public Property ComboBox3Name As String
+ Get
+ Return m_ComboBox3Name
+ End Get
+ Set(value As String)
+ m_ComboBox3Name = value
+ End Set
+ End Property
+
+ Private m_ComboBox3List As List(Of String)
+ Public Property ComboBox3List As List(Of String)
+ Get
+ Return m_ComboBox3List
+ End Get
+ Set(value As List(Of String))
+ m_ComboBox3List = value
+ End Set
+ End Property
+
+ Private m_ComboBox3ListDDF As List(Of String)
+ Public Property ComboBox3ListDDF As List(Of String)
+ Get
+ Return m_ComboBox3ListDDF
+ End Get
+ Set(value As List(Of String))
+ m_ComboBox3ListDDF = value
+ End Set
+ End Property
+
+ Private m_ComboBox3SpecialList As List(Of String)
+ Public Property ComboBox3SpecialList As List(Of String)
+ Get
+ Return m_ComboBox3SpecialList
+ End Get
+ Set(value As List(Of String))
+ m_ComboBox3SpecialList = value
+ End Set
+ End Property
+
+ Private m_ComboBox3SelItem As String
+ Public Property ComboBox3SelItem As String
+ Get
+ Return m_ComboBox3SelItem
+ End Get
+ Set(value As String)
+ m_ComboBox3SelItem = value
+ Dim bFound As Boolean = False
+ If Not IsNothing(ComboBox3SpecialList) Then
+ For Index = 0 To m_ComboBox3SpecialList.Count() - 1
+ If m_ComboBox3SpecialList(Index) = m_ComboBox3SelItem Then
+ bFound = True
+ Exit For
+ End If
+ Next
+ If bFound Then
+ m_SpecialTextBox1Visibility = Visibility.Visible
+ Else
+ m_SpecialTextBox1Visibility = Visibility.Collapsed
+ End If
+ NotifyPropertyChanged("SpecialTextBox1Visibility")
+ End If
+ End Set
+ End Property
+
+ Private m_ComboBox3DDFName As String
+ Public Property ComboBox3DDFName As String
+ Get
+ Return m_ComboBox3DDFName
+ End Get
+ Set(value As String)
+ m_ComboBox3DDFName = value
+ End Set
+ End Property
+
+ Private m_ComboBox3Visibility As Visibility
+ Public Property ComboBox3Visibility As Visibility
+ Get
+ Return m_ComboBox3Visibility
+ End Get
+ Set(value As Visibility)
+ m_ComboBox3Visibility = value
+ End Set
+ End Property
+
+#End Region
+
+#End Region ' ComboBox
+
+#Region "TextBox"
+
+#Region "TextBox1"
+ Private m_TextBox1Name As String
+ Public Property TextBox1Name As String
+ Get
+ Return m_TextBox1Name
+ End Get
+ Set(value As String)
+ m_TextBox1Name = value
+ End Set
+ End Property
+
+ Private m_TextBox1DDFName As String
+ Public Property TextBox1DDFName As String
+ Get
+ Return m_TextBox1DDFName
+ End Get
+ Set(value As String)
+ m_TextBox1DDFName = value
+ End Set
+ End Property
+
+ Private m_TextBox1Value As String
+ Public Property TextBox1Value As String
+ Get
+ Return m_TextBox1Value
+ End Get
+ Set(value As String)
+ m_TextBox1Value = value
+ End Set
+ End Property
+
+ Private m_TextBox1Visibility As Visibility
+ Public Property TextBox1Visibility As Visibility
+ Get
+ Return m_TextBox1Visibility
+ End Get
+ Set(value As Visibility)
+ m_TextBox1Visibility = value
+ End Set
+ End Property
+#End Region
+
+#Region "TextBox2"
+ Private m_TextBox2Name As String
+ Public Property TextBox2Name As String
+ Get
+ Return m_TextBox2Name
+ End Get
+ Set(value As String)
+ m_TextBox2Name = value
+ End Set
+ End Property
+
+ Private m_TextBox2DDFName As String
+ Public Property TextBox2DDFName As String
+ Get
+ Return m_TextBox2DDFName
+ End Get
+ Set(value As String)
+ m_TextBox2DDFName = value
+ End Set
+ End Property
+
+ Private m_TextBox2Value As String
+ Public Property TextBox2Value As String
+ Get
+ Return m_TextBox2Value
+ End Get
+ Set(value As String)
+ m_TextBox2Value = value
+ End Set
+ End Property
+
+ Private m_TextBox2Visibility As Visibility
+ Public Property TextBox2Visibility As Visibility
+ Get
+ Return m_TextBox2Visibility
+ End Get
+ Set(value As Visibility)
+ m_TextBox2Visibility = value
+ End Set
+ End Property
+#End Region
+
+#Region "TextBox3"
+ Private m_TextBox3Name As String
+ Public Property TextBox3Name As String
+ Get
+ Return m_TextBox3Name
+ End Get
+ Set(value As String)
+ m_TextBox3Name = value
+ End Set
+ End Property
+
+ Private m_TextBox3DDFName As String
+ Public Property TextBox3DDFName As String
+ Get
+ Return m_TextBox3DDFName
+ End Get
+ Set(value As String)
+ m_TextBox3DDFName = value
+ End Set
+ End Property
+
+ Private m_TextBox3Value As String
+ Public Property TextBox3Value As String
+ Get
+ Return m_TextBox3Value
+ End Get
+ Set(value As String)
+ m_TextBox3Value = value
+ End Set
+ End Property
+
+ Private m_TextBox3Visibility As Visibility
+ Public Property TextBox3Visibility As Visibility
+ Get
+ Return m_TextBox3Visibility
+ End Get
+ Set(value As Visibility)
+ m_TextBox3Visibility = value
+ End Set
+ End Property
+#End Region
+
+#Region "TextBox4"
+ Private m_TextBox4Name As String
+ Public Property TextBox4Name As String
+ Get
+ Return m_TextBox4Name
+ End Get
+ Set(value As String)
+ m_TextBox4Name = value
+ End Set
+ End Property
+
+ Private m_TextBox4DDFName As String
+ Public Property TextBox4DDFName As String
+ Get
+ Return m_TextBox4DDFName
+ End Get
+ Set(value As String)
+ m_TextBox4DDFName = value
+ End Set
+ End Property
+
+ Private m_TextBox4Value As String
+ Public Property TextBox4Value As String
+ Get
+ Return m_TextBox4Value
+ End Get
+ Set(value As String)
+ m_TextBox4Value = value
+ End Set
+ End Property
+
+ Private m_TextBox4Visibility As Visibility
+ Public Property TextBox4Visibility As Visibility
+ Get
+ Return m_TextBox4Visibility
+ End Get
+ Set(value As Visibility)
+ m_TextBox4Visibility = value
+ End Set
+ End Property
+#End Region
+
+#Region "TextBox5"
+ Private m_TextBox5Name As String
+ Public Property TextBox5Name As String
+ Get
+ Return m_TextBox5Name
+ End Get
+ Set(value As String)
+ m_TextBox5Name = value
+ End Set
+ End Property
+
+ Private m_TextBox5DDFName As String
+ Public Property TextBox5DDFName As String
+ Get
+ Return m_TextBox5DDFName
+ End Get
+ Set(value As String)
+ m_TextBox5DDFName = value
+ End Set
+ End Property
+
+ Private m_TextBox5Value As String
+ Public Property TextBox5Value As String
+ Get
+ Return m_TextBox5Value
+ End Get
+ Set(value As String)
+ m_TextBox5Value = value
+ End Set
+ End Property
+
+ Private m_TextBox5Visibility As Visibility
+ Public Property TextBox5Visibility As Visibility
+ Get
+ Return m_TextBox5Visibility
+ End Get
+ Set(value As Visibility)
+ m_TextBox5Visibility = value
+ End Set
+ End Property
+#End Region
+
+#Region "SpecialTextBox1"
+
+ Private m_SpecialTextBox1Name As String
+ Public Property SpecialTextBox1Name As String
+ Get
+ Return m_SpecialTextBox1Name
+ End Get
+ Set(value As String)
+ m_SpecialTextBox1Name = value
+ End Set
+ End Property
+
+ Private m_SpecialTextBox1DDFName As String
+ Public Property SpecialTextBox1DDFName As String
+ Get
+ Return m_SpecialTextBox1DDFName
+ End Get
+ Set(value As String)
+ m_SpecialTextBox1DDFName = value
+ End Set
+ End Property
+
+ Private m_SpecialTextBox1Value As String
+ Public Property SpecialTextBox1Value As String
+ Get
+ Return m_SpecialTextBox1Value
+ End Get
+ Set(value As String)
+ m_SpecialTextBox1Value = value
+ End Set
+ End Property
+
+ Private m_SpecialTextBox1Visibility As Visibility
+ Public Property SpecialTextBox1Visibility As Visibility
+ Get
+ Return m_SpecialTextBox1Visibility
+ End Get
+ Set(value As Visibility)
+ m_SpecialTextBox1Visibility = value
+ End Set
+ End Property
+
+#End Region ' SpecialTextBox1
+
+#End Region ' TextBox
+
+#End Region ' Group
+
+ ' Definizione comando
+ Private m_CmdApply As ICommand
+ Private m_CmdDelete As ICommand
+
+#Region "COMMANDS"
+
+#Region "ApplyCommand"
+
+ '''
+ ''' Returns a command that do Exec.
+ '''
+ Public ReadOnly Property ApplyCommand As ICommand
+ Get
+ If m_CmdApply Is Nothing Then
+ m_CmdApply = New Command(AddressOf Apply)
+ End If
+ Return m_CmdApply
+ End Get
+ End Property
+
+ '''
+ ''' Execute the Exec. This method is invoked by the ExecCommand.
+ '''
+ Public Sub Apply()
+ EgtDoorCreatorMap.m_Door.WriteDDF()
+ End Sub
+
+#End Region ' ApplyCommand
+
+#Region "DeleteCommand"
+
+ '''
+ ''' Returns a command that do Exec.
+ '''
+ Public ReadOnly Property DeleteCommand As ICommand
+ Get
+ If m_CmdDelete Is Nothing Then
+ m_CmdDelete = New Command(AddressOf Delete)
+ End If
+ Return m_CmdDelete
+ End Get
+ End Property
+
+ '''
+ ''' Execute the Exec. This method is invoked by the ExecCommand.
+ '''
+ Public Sub Delete()
+ EgtDoorCreatorMap.m_Door.RemoveCompo(Me)
+ End Sub
+
+#End Region ' DeleteCommand
+
+#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/DoorParameters/Door.vb b/DoorParameters/Door.vb
new file mode 100644
index 0000000..a944b6a
--- /dev/null
+++ b/DoorParameters/Door.vb
@@ -0,0 +1,363 @@
+Imports System.Collections.ObjectModel
+Imports System.ComponentModel
+Imports System.IO
+Imports EgtUILib
+' data ultima modifica 30/12/2016 ore 19:09
+Public Class Door
+ Implements INotifyPropertyChanged
+
+#Region "GENERAL"
+
+#Region "Size"
+
+ Private m_SwingTypeList As List(Of String) = New List(Of String)({"LH", "RH", "LHA", "RHA", "LHI", "RHI", "LHRA", "RHRA", "LHRI", "RHRI"})
+ Public ReadOnly Property SwingTypeList As List(Of String)
+ Get
+ Return m_SwingTypeList
+ End Get
+ End Property
+
+ Private m_Height As String
+ Public Property Height As String
+ Get
+ Return m_Height
+ End Get
+ Set(value As String)
+ m_Height = value
+ End Set
+ End Property
+
+ Private m_Width As String
+ Public Property Width As String
+ Get
+ Return m_Width
+ End Get
+ Set(value As String)
+ m_Width = value
+ End Set
+ End Property
+
+ Private m_Thickness As String
+ Public Property Thickness As String
+ Get
+ Return m_Thickness
+ End Get
+ Set(value As String)
+ m_Thickness = value
+ End Set
+ End Property
+
+ Private m_Swing As String
+ Public Property Swing As String
+ Get
+ Return m_Swing
+ End Get
+ Set(value As String)
+ m_Swing = value
+ End Set
+ End Property
+
+#End Region ' Size
+
+#Region "TypeEdge"
+
+ Private m_EdgeTypeList As List(Of String) = New List(Of String)({"SQ", "B", "1B", "2B", "3B", "4B", "CV"})
+ Public ReadOnly Property EdgeTypeList As List(Of String)
+ Get
+ Return m_EdgeTypeList
+ End Get
+ End Property
+
+ Private m_LockEdgeType As String
+ Public Property LockEdgeType As String
+ Get
+ Return m_LockEdgeType
+ End Get
+ Set(value As String)
+ m_LockEdgeType = value
+ End Set
+ End Property
+
+ Private m_HingeEdgeType As String
+ Public Property HingeEdgeType As String
+ Get
+ Return m_HingeEdgeType
+ End Get
+ Set(value As String)
+ m_HingeEdgeType = value
+ End Set
+ End Property
+
+ Private m_TopType As String
+ Public Property TopType As String
+ Get
+ Return m_TopType
+ End Get
+ Set(value As String)
+ m_TopType = value
+ End Set
+ End Property
+
+ Private m_BottomType As String
+ Public Property BottomType As String
+ Get
+ Return m_BottomType
+ End Get
+ Set(value As String)
+ m_BottomType = value
+ End Set
+ End Property
+
+#End Region
+
+#Region "Machining"
+
+ Private m_TopMachining As Boolean
+ Public Property TopMachining As Boolean
+ Get
+ Return m_TopMachining
+ End Get
+ Set(value As Boolean)
+ m_TopMachining = value
+ End Set
+ End Property
+
+ Private m_LockEdgeMachining As Boolean
+ Public Property LockEdgeMachining As Boolean
+ Get
+ Return m_LockEdgeMachining
+ End Get
+ Set(value As Boolean)
+ m_LockEdgeMachining = value
+ End Set
+ End Property
+
+ Private m_HingeEdgeMachining As Boolean
+ Public Property HingeEdgeMachining As Boolean
+ Get
+ Return m_HingeEdgeMachining
+ End Get
+ Set(value As Boolean)
+ m_HingeEdgeMachining = value
+ End Set
+ End Property
+
+ Private m_BottomMachining As Boolean
+ Public Property BottomMachining As Boolean
+ Get
+ Return m_BottomMachining
+ End Get
+ Set(value As Boolean)
+ m_BottomMachining = value
+ End Set
+ End Property
+
+#End Region
+
+#Region "OverMaterial"
+
+ Private m_LockEdgeOverMaterial As String
+ Public Property LockEdgeOverMaterial As String
+ Get
+ Return m_LockEdgeOverMaterial
+ End Get
+ Set(value As String)
+ m_LockEdgeOverMaterial = value
+ End Set
+ End Property
+
+ Private m_HingeEdgeOverMaterial As String
+ Public Property HingeEdgeOverMaterial As String
+ Get
+ Return m_HingeEdgeOverMaterial
+ End Get
+ Set(value As String)
+ m_HingeEdgeOverMaterial = value
+ End Set
+ End Property
+
+ Private m_TopOverMaterial As String
+ Public Property TopOverMaterial As String
+ Get
+ Return m_TopOverMaterial
+ End Get
+ Set(value As String)
+ m_TopOverMaterial = value
+ End Set
+ End Property
+
+ Private m_BottomOverMaterial As String
+ Public Property BottomOverMaterial As String
+ Get
+ Return m_BottomOverMaterial
+ End Get
+ Set(value As String)
+ m_BottomOverMaterial = value
+ End Set
+ End Property
+
+#End Region
+
+#End Region ' General
+
+ Private m_CompoList As ObservableCollection(Of Compo)
+ Public Property CompoList As ObservableCollection(Of Compo)
+ Get
+ If IsNothing(m_CompoList) Then
+ m_CompoList = New ObservableCollection(Of Compo)
+ End If
+ Return m_CompoList
+ End Get
+ Set(value As ObservableCollection(Of Compo))
+ m_CompoList = value
+ End Set
+ End Property
+
+ 'Gestione ComboBox e TextBox di ogni compo della pulsantiera letta da Compo.ini
+ Friend Sub AddNewCompo(IniCompoName As String)
+ ' creo il nuovo compo
+ Dim NewCompo As New Compo
+ ' lo modifico in base al tipo passatomi
+ CompoGetPrivateProfileNameGroup(IniCompoName, ConstCompo.K_NAME, NewCompo.NameDDF, NewCompo.Name)
+
+ If CompoGetPrivateProfileComboBox(IniCompoName, ConstCompo.K_COMBOBOX & 1, NewCompo.ComboBox1DDFName, NewCompo.ComboBox1Name) Then
+ NewCompo.ComboBox1Index = 1
+ Else
+ Return
+ End If
+
+ Select Case CompoGetPrivateProfileComboBoxList(IniCompoName, ConstCompo.K_COMBOBOX & 1 & ConstCompo.K_LIST, NewCompo.ComboBox1List, NewCompo.ComboBox1ListDDF)
+ Case ComboListResult.NOTFOUND
+ NewCompo.ComboBox1Visibility = Visibility.Collapsed
+ Case ComboListResult.FOUND
+ NewCompo.ComboBox1Visibility = Visibility.Visible
+ Case ComboListResult.MISTAKE
+ Return
+ End Select
+
+ If CompoGetPrivateProfileComboBox(IniCompoName, ConstCompo.K_COMBOBOX & 2, NewCompo.ComboBox2DDFName, NewCompo.ComboBox2Name) Then
+ NewCompo.ComboBox2Index = 2
+ Else
+ NewCompo.ComboBox2Visibility = Visibility.Collapsed
+ End If
+
+ Select Case CompoGetPrivateProfileComboBoxList(IniCompoName, ConstCompo.K_COMBOBOX & 2 & ConstCompo.K_LIST, NewCompo.ComboBox2List, NewCompo.ComboBox2ListDDF)
+ Case ComboListResult.NOTFOUND
+ NewCompo.ComboBox2Visibility = Visibility.Collapsed
+ Case ComboListResult.FOUND
+ NewCompo.ComboBox2Visibility = Visibility.Visible
+ Case ComboListResult.MISTAKE
+ Return
+ End Select
+
+ If CompoGetPrivateProfileComboBox(IniCompoName, ConstCompo.K_COMBOBOX & 3, NewCompo.ComboBox3DDFName, NewCompo.ComboBox3Name) Then
+ NewCompo.ComboBox3Index = 3
+ Else
+ NewCompo.ComboBox3Visibility = Visibility.Collapsed
+ End If
+
+ Select Case CompoGetPrivateProfileComboBoxList(IniCompoName, ConstCompo.K_COMBOBOX & 3 & ConstCompo.K_LIST, NewCompo.ComboBox3List, NewCompo.ComboBox3ListDDF)
+ Case ComboListResult.NOTFOUND
+ NewCompo.ComboBox3Visibility = Visibility.Collapsed
+ Case ComboListResult.FOUND
+ NewCompo.ComboBox3Visibility = Visibility.Visible
+ Case ComboListResult.MISTAKE
+ Return
+ End Select
+
+ ' TextBox
+ If Not CompoGetPrivateProfileTextBox(IniCompoName, ConstCompo.K_TEXTBOX & 1, NewCompo.TextBox1DDFName, NewCompo.TextBox1Name) Then
+ NewCompo.TextBox1Visibility = Visibility.Collapsed
+ End If
+
+ If Not CompoGetPrivateProfileTextBox(IniCompoName, ConstCompo.K_TEXTBOX & 2, NewCompo.TextBox2DDFName, NewCompo.TextBox2Name) Then
+ NewCompo.TextBox2Visibility = Visibility.Collapsed
+ End If
+
+ If Not CompoGetPrivateProfileTextBox(IniCompoName, ConstCompo.K_TEXTBOX & 3, NewCompo.TextBox3DDFName, NewCompo.TextBox3Name) Then
+ NewCompo.TextBox3Visibility = Visibility.Collapsed
+ End If
+
+ If Not CompoGetPrivateProfileTextBox(IniCompoName, ConstCompo.K_TEXTBOX & 4, NewCompo.TextBox4DDFName, NewCompo.TextBox4Name) Then
+ NewCompo.TextBox4Visibility = Visibility.Collapsed
+ End If
+
+ If Not CompoGetPrivateProfileTextBox(IniCompoName, ConstCompo.K_TEXTBOX & 5, NewCompo.TextBox5DDFName, NewCompo.TextBox5Name) Then
+ NewCompo.TextBox5Visibility = Visibility.Collapsed
+ End If
+
+ 'gestione SpeciaTextBox
+ Dim nComboIndex As Integer = 0
+ Dim SpecialList As New List(Of String)
+ If CompoGetPrivateProfileSpecialTextBox(IniCompoName, ConstCompo.K_SPECIALTEXTBOX & 1, NewCompo.SpecialTextBox1DDFName, NewCompo.SpecialTextBox1Name, nComboIndex, SpecialList) Then
+ Select Case nComboIndex
+ Case 1
+ NewCompo.ComboBox1SpecialList = SpecialList
+ Case 2
+ NewCompo.ComboBox2SpecialList = SpecialList
+ Case 3
+ NewCompo.ComboBox3SpecialList = SpecialList
+ End Select
+ End If
+ ' nascondo la SpecialTextBox
+ NewCompo.SpecialTextBox1Visibility = Visibility.Collapsed
+
+ ' aggiungo il nuovo compo alla lista
+ CompoList.Add(NewCompo)
+ End Sub
+
+ Friend Sub RemoveCompo(CompoToRemove As Compo)
+ CompoList.Remove(CompoToRemove)
+ End Sub
+
+ Friend Sub WriteDDF()
+ 'genero le stringhe che dovranno essere scritte nel DDF
+ Dim m_GeneralListDDF As New List(Of String)
+ Dim m_CompoListDDF As New List(Of List(Of String))
+ 'Genero una lista di stringhe senza spaziature
+ Dim dVal As Double = 0
+ m_GeneralListDDF.Add(ConstCompo.K_SIZE & ":")
+ StringToDouble(Width, dVal)
+ m_GeneralListDDF.Add(ConstCompo.K_SPACE3 & ConstCompo.K_WIDTH & ": " & DoubleToString(dVal, 3))
+ StringToDouble(Height, dVal)
+ m_GeneralListDDF.Add(ConstCompo.K_SPACE3 & ConstCompo.K_HEIGHT & ": " & DoubleToString(dVal, 3))
+ StringToDouble(Thickness, dVal)
+ m_GeneralListDDF.Add(ConstCompo.K_SPACE3 & ConstCompo.K_THICKNESS & ": " & DoubleToString(dVal, 3))
+ ' aggiungo una riga vuota per separare la lista successiva
+ m_GeneralListDDF.Add("")
+ m_GeneralListDDF.Add("" & ConstCompo.K_SWING & ": " & Swing)
+ ' aggiungo una riga vuota per separare la lista successiva
+ m_GeneralListDDF.Add("")
+ m_GeneralListDDF.Add("" & ConstCompo.K_PROFILES & ":")
+ m_GeneralListDDF.Add(ConstCompo.K_SPACE3 & ConstCompo.K_LOCKEDGE & ": " & LockEdgeType)
+ m_GeneralListDDF.Add(ConstCompo.K_SPACE5 & ConstCompo.K_MACHINING & ": " & ConvertBooleanToOnOff(LockEdgeMachining))
+ StringToDouble(LockEdgeOverMaterial, dVal)
+ m_GeneralListDDF.Add(ConstCompo.K_SPACE5 & ConstCompo.K_OVERMATERAL & ": " & DoubleToString(dVal, 3))
+ m_GeneralListDDF.Add(ConstCompo.K_SPACE3 & ConstCompo.K_HINGEEDGE & ": " & HingeEdgeType)
+ m_GeneralListDDF.Add(ConstCompo.K_SPACE5 & ConstCompo.K_MACHINING & ": " & ConvertBooleanToOnOff(HingeEdgeMachining))
+ StringToDouble(HingeEdgeOverMaterial, dVal)
+ m_GeneralListDDF.Add(ConstCompo.K_SPACE5 & ConstCompo.K_OVERMATERAL & ": " & DoubleToString(dVal, 3))
+ m_GeneralListDDF.Add(ConstCompo.K_SPACE3 & ConstCompo.K_TOP & ": " & TopType)
+ m_GeneralListDDF.Add(ConstCompo.K_SPACE5 & ConstCompo.K_MACHINING & ": " & ConvertBooleanToOnOff(TopMachining))
+ StringToDouble(TopOverMaterial, dVal)
+ m_GeneralListDDF.Add(ConstCompo.K_SPACE5 & ConstCompo.K_OVERMATERAL & ": " & DoubleToString(dVal, 3))
+ m_GeneralListDDF.Add(ConstCompo.K_SPACE3 & ConstCompo.K_BOTTOM & ": " & BottomType)
+ m_GeneralListDDF.Add(ConstCompo.K_SPACE5 & ConstCompo.K_MACHINING & ": " & ConvertBooleanToOnOff(BottomMachining))
+ StringToDouble(BottomOverMaterial, dVal)
+ m_GeneralListDDF.Add(ConstCompo.K_SPACE5 & ConstCompo.K_OVERMATERAL & ": " & DoubleToString(dVal, 3))
+ ' aggiungo una riga vuota per separare la lista successiva
+ m_GeneralListDDF.Add("")
+ 'per ogni compo della compolist devo stampare a video
+ For Each Item As Compo In CompoList
+ m_GeneralListDDF.AddRange(GenerateCompolistDDF(Item))
+ Next
+ File.WriteAllLines("c:\EgtData\EgtDOORCreator\MyProjects\Prova1.ddf", m_GeneralListDDF, Text.Encoding.UTF8)
+ End Sub
+
+ 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/DoorParameters/DoorParametersView.xaml b/DoorParameters/DoorParametersView.xaml
new file mode 100644
index 0000000..329e7b4
--- /dev/null
+++ b/DoorParameters/DoorParametersView.xaml
@@ -0,0 +1,158 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/DoorParameters/DoorParametersView.xaml.vb b/DoorParameters/DoorParametersView.xaml.vb
new file mode 100644
index 0000000..648a6cf
--- /dev/null
+++ b/DoorParameters/DoorParametersView.xaml.vb
@@ -0,0 +1,6 @@
+Public Class DoorParametersView
+
+ Private Sub ComboBox_DataContextChanged(sender As Object, e As DependencyPropertyChangedEventArgs)
+
+ End Sub
+End Class
diff --git a/DoorParameters/DoorParametersViewModel.vb b/DoorParameters/DoorParametersViewModel.vb
new file mode 100644
index 0000000..2d2a13a
--- /dev/null
+++ b/DoorParameters/DoorParametersViewModel.vb
@@ -0,0 +1,83 @@
+Imports System.ComponentModel
+
+Public Class DoorParametersViewModel
+ Implements INotifyPropertyChanged
+
+ Private m_Door As Door
+ Public Property Door As Door
+ Get
+ Return m_Door
+ End Get
+ Set(value As Door)
+ m_Door = value
+ End Set
+ End Property
+
+#Region "Messages"
+
+ 'General'
+ Public ReadOnly Property WidthMsg As String
+ Get
+ Return "Width"
+ End Get
+ End Property
+ Public ReadOnly Property HeightMsg As String
+ Get
+ Return "Height"
+ End Get
+ End Property
+ Public ReadOnly Property ThicknessMsg As String
+ Get
+ Return "Thickness"
+ End Get
+ End Property
+ Public ReadOnly Property SwingMsg As String
+ Get
+ Return "Swing"
+ End Get
+ End Property
+
+ 'Profiles'
+ Public ReadOnly Property LockedgeMsg As String
+ Get
+ Return "Lockedge"
+ End Get
+ End Property
+ Public ReadOnly Property HingeedgeMsg As String
+ Get
+ Return "Hingeedge"
+ End Get
+ End Property
+ Public ReadOnly Property TopMsg As String
+ Get
+ Return "Top"
+ End Get
+ End Property
+ Public ReadOnly Property BottomMsg As String
+ Get
+ Return "Bottom"
+ End Get
+ End Property
+ Public ReadOnly Property ApplyBtnMsg As String
+ Get
+ Return "Apply"
+ End Get
+ End Property
+ Public ReadOnly Property DeleteBtnMsg As String
+ Get
+ Return "Delete"
+ End Get
+ End Property
+#End Region
+
+ Sub New(ByRef Door As Door)
+ Me.m_Door = Door
+ End Sub
+
+ 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/EgtDOORCreator.sln b/EgtDOORCreator.sln
new file mode 100644
index 0000000..9180f57
--- /dev/null
+++ b/EgtDOORCreator.sln
@@ -0,0 +1,22 @@
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio 2013
+VisualStudioVersion = 12.0.40629.0
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "EgtDOORCreator", "EgtDOORCreator.vbproj", "{1BFAA89F-B93D-4A05-9055-CF63D76016BC}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|x86 = Debug|x86
+ Release|x86 = Release|x86
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {1BFAA89F-B93D-4A05-9055-CF63D76016BC}.Debug|x86.ActiveCfg = Debug|x86
+ {1BFAA89F-B93D-4A05-9055-CF63D76016BC}.Debug|x86.Build.0 = Debug|x86
+ {1BFAA89F-B93D-4A05-9055-CF63D76016BC}.Release|x86.ActiveCfg = Release|x86
+ {1BFAA89F-B93D-4A05-9055-CF63D76016BC}.Release|x86.Build.0 = Release|x86
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+EndGlobal
diff --git a/EgtDOORCreator.vbproj b/EgtDOORCreator.vbproj
new file mode 100644
index 0000000..cb626d8
--- /dev/null
+++ b/EgtDOORCreator.vbproj
@@ -0,0 +1,197 @@
+
+
+
+
+ Debug
+ AnyCPU
+ {1BFAA89F-B93D-4A05-9055-CF63D76016BC}
+ {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{F184B08F-C81C-45F6-A57F-5ABD9991F28F}
+ WinExe
+ EgtDOORCreator
+ EgtDOORCreator
+ v4.0
+ Custom
+ Client
+
+
+ On
+
+
+ Binary
+
+
+ Off
+
+
+ On
+
+
+ true
+ true
+ true
+ bin\x86\Debug\
+ EgtDOORCreator.xml
+
+
+ full
+ x86
+ MinimumRecommendedRules.ruleset
+ true
+
+
+
+
+ true
+ bin\x86\Release\
+ EgtDOORCreator.xml
+ true
+
+
+ pdbonly
+ x86
+ MinimumRecommendedRules.ruleset
+ true
+
+
+
+
+ Resources\EgtCAM5.ico
+
+
+ My Project\app.manifest
+
+
+
+ ..\..\EgtProg\DllD32\EgtUILib.dll
+
+
+ ..\..\EgtProg\DllD32\EgtWPFLib5.dll
+
+
+
+
+
+
+
+
+ 4.0
+
+
+
+
+
+
+
+ MSBuild:Compile
+ Designer
+
+
+
+
+
+
+
+
+
+
+
+ CompoPanelView.xaml
+
+
+
+
+
+ Designer
+ MSBuild:Compile
+
+
+ Designer
+ MSBuild:Compile
+
+
+ MSBuild:Compile
+ Designer
+
+
+ Application.xaml
+ Code
+
+
+
+ DoorParametersView.xaml
+
+
+
+ MainWindow.xaml
+ Code
+
+
+ Designer
+ MSBuild:Compile
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Code
+
+
+ Microsoft.VisualBasic.WPF.MyExtension
+ 1.0.0.0
+
+
+ True
+ True
+ Resources.resx
+
+
+ True
+ Settings.settings
+ True
+
+
+ VbMyResourcesResXFileCodeGenerator
+ Resources.Designer.vb
+ My.Resources
+
+
+
+ SettingsSingleFileGenerator
+ Settings.Designer.vb
+
+
+
+
+
+
+
+
+
+
+
+
+ IF "$(PlatformName)"=="x86" IF "$(ConfigurationName)" == "Release" copy $(TargetPath) c:\EgtProg\EgtDOORCreator\EgtDOORCreatorR32.exe
+IF "$(PlatformName)"=="x86" IF "$(ConfigurationName)" == "Debug" copy $(TargetPath) c:\EgtProg\EgtDOORCreator\EgtDOORCreatorD32.exe
+
+
+
\ No newline at end of file
diff --git a/EgtDOORCreatorDictionary.xaml b/EgtDOORCreatorDictionary.xaml
new file mode 100644
index 0000000..bcfbb3c
--- /dev/null
+++ b/EgtDOORCreatorDictionary.xaml
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/EgtDoorCreatorMap.vb b/EgtDoorCreatorMap.vb
new file mode 100644
index 0000000..e348b23
--- /dev/null
+++ b/EgtDoorCreatorMap.vb
@@ -0,0 +1,5 @@
+Module EgtDoorCreatorMap
+
+ Friend m_Door As Door
+
+End Module
diff --git a/IniFile.vb b/IniFile.vb
new file mode 100644
index 0000000..1c17121
--- /dev/null
+++ b/IniFile.vb
@@ -0,0 +1,258 @@
+Imports System.Collections.ObjectModel
+Imports System.IO
+Imports EgtUILib
+
+Friend Module IniFile
+
+ Public Enum ComboListResult As Integer
+ MISTAKE = -1
+ NOTFOUND = 0
+ FOUND = 1
+ End Enum
+
+ ' Path IniFile
+ Friend m_sIniFile As String = String.Empty
+ ' Path Compo.ini file
+ Friend m_sCompoIniFile As String = String.Empty
+
+ ' IniFile
+ Public Function GetPrivateProfileInt(IpAppName As String, IpKeyName As String, nDefault As Integer) As Integer
+ Return EgtUILib.GetPrivateProfileInt(IpAppName, IpKeyName, nDefault, m_sIniFile)
+ End Function
+
+ Public Function GetPrivateProfileDouble(IpAppName As String, IpKeyName As String, nDefault As Integer) As Double
+ Return EgtUILib.GetPrivateProfileDouble(IpAppName, IpKeyName, nDefault, m_sIniFile)
+ End Function
+
+ Public Function GetPrivateProfileString(IpAppName As String, IpKeyName As String, IpDefault As String, ByRef IpString As String) As Integer
+ Return EgtUILib.GetPrivateProfileString(IpAppName, IpKeyName, IpDefault, IpString, m_sIniFile)
+ End Function
+
+ Public Function GetPrivateProfileColor(IpAppName As String, IpKeyName As String, ByRef Col As EgtUILib.EgtInterface.Color3d) As Boolean
+ Return EgtUILib.GetPrivateProfileColor(IpAppName, IpKeyName, Col, m_sIniFile)
+ End Function
+
+ Public Function GetPrivateProfileWinPos(IpAppName As String, IpKeyName As String, ByRef nFlag As Integer, ByRef nLeft As Integer, ByRef nTop As Integer, ByRef nWidth As Integer, ByRef nHeight As Integer) As Boolean
+ Return EgtUILib.GetPrivateProfileWinPos(IpAppName, IpKeyName, nFlag, nLeft, nTop, nWidth, nHeight, m_sIniFile)
+ End Function
+
+ Public Function GetPrivateProfileZoomWin(IpAppName As String, IpKeyName As String, ByRef bOutline As Boolean, ByRef Col As EgtUILib.EgtInterface.Color3d) As Boolean
+ Return EgtUILib.GetPrivateProfileZoomWin(IpAppName, IpKeyName, bOutline, Col, m_sIniFile)
+ End Function
+
+ Public Function GetPrivateProfileFloatingWinPos(lpAppName As String, lpKeyName As String, ByRef nState As String, ByRef nIndex As Integer, ByRef nLeft As Integer, ByRef nTop As Integer) As Boolean
+ Dim sVal As String = String.Empty
+ GetPrivateProfileString(lpAppName, lpKeyName, "", sVal)
+ Dim sItems() As String = sVal.Split(",".ToCharArray)
+ If sItems.Count() >= 4 Then
+ nState = sItems(0)
+ nIndex = CInt(sItems(1))
+ nLeft = CInt(sItems(2))
+ nTop = CInt(sItems(3))
+ Return True
+ End If
+ Return False
+ End Function
+
+ Public Function GetPrivateProfileLanguage(ByVal lpAppName As String, ByVal lpKeyName As String) As Language
+ Dim sVal As String = String.Empty
+ GetPrivateProfileString(lpAppName, lpKeyName, "", sVal)
+ Dim sItems() As String = sVal.Split(",".ToCharArray)
+ If sItems.Count() = 2 Then
+ Return New Language(sItems(0), sItems(1))
+ End If
+ Return Nothing
+ End Function
+
+ Public Function WritePrivateProfileString(IpAppName As String, IpKeyName As String, ByRef IpString As String) As Boolean
+ Return EgtUILib.WritePrivateProfileString(IpAppName, IpKeyName, IpString, m_sIniFile)
+ End Function
+
+ Public Function WritePrivateProfileWinPos(IpAppName As String, IpKeyName As String, ByRef nFlag As Integer, ByRef nLeft As Integer, ByRef nTop As Integer, ByRef nWidth As Integer, ByRef nHeight As Integer) As Boolean
+ Return EgtUILib.WritePrivateProfileWinPos(IpAppName, IpKeyName, nFlag, nLeft, nTop, nWidth, nHeight, m_sIniFile)
+ End Function
+
+ ' Compo
+ Public Function CompoGetPrivateProfileInt(IpAppName As String, IpKeyName As String, nDefault As Integer) As Integer
+ Return EgtUILib.GetPrivateProfileInt(IpAppName, IpKeyName, nDefault, m_sCompoIniFile)
+ End Function
+
+ Public Function CompoGetPrivateProfileDouble(IpAppName As String, IpKeyName As String, nDefault As Integer) As Double
+ Return EgtUILib.GetPrivateProfileDouble(IpAppName, IpKeyName, nDefault, m_sCompoIniFile)
+ End Function
+
+ Public Function CompoGetPrivateProfileString(IpAppName As String, IpKeyName As String, IpDefault As String, ByRef IpString As String) As Integer
+ Return EgtUILib.GetPrivateProfileString(IpAppName, IpKeyName, IpDefault, IpString, m_sCompoIniFile)
+ End Function
+
+ 'Funzione che gestisce il nome della componente
+ Public Function CompoGetPrivateProfileNameGroup(IpAppName As String, IpKeyName As String, ByRef NameDDF As String, ByRef Name As String) As Boolean
+ Dim sVal As String = String.Empty
+ CompoGetPrivateProfileString(IpAppName, IpKeyName, "", sVal)
+ Dim sItems() As String = sVal.Split("/".ToCharArray)
+ If sItems.Count() = 2 Then
+ If IsNumeric(sItems(1)) Then
+ Name = EgtMsg(CInt(sItems(1)))
+ Else
+ Name = sItems(1)
+ End If
+ NameDDF = sItems(0)
+ Else
+ NameDDF = sItems(0)
+ Name = sItems(0)
+ Return True
+ End If
+ Return False
+ End Function
+
+ ' Funzione che legge valori TextBox
+ Public Function CompoGetPrivateProfileTextBox(IpAppName As String, IpKeyName As String, ByRef DDFName As String, ByRef Name As String) As Boolean
+ Dim sVal As String = String.Empty
+ CompoGetPrivateProfileString(IpAppName, IpKeyName, "", sVal)
+ Dim sItems() As String = sVal.Split(",".ToCharArray)
+
+ If sItems.Count() >= 2 Then
+ DDFName = sItems(0)
+ If IsNumeric(sItems(1)) Then
+ Name = EgtMsg(CInt(sItems(1)))
+ Else
+ Name = DDFName
+ End If
+ Return True
+ End If
+ Return False
+ End Function
+
+ ' Funzione che legge valori SpecialTextBox
+ Public Function CompoGetPrivateProfileSpecialTextBox(IpAppName As String, IpKeyName As String, ByRef DDFName As String, ByRef Name As String, ByRef ComboIndex As Integer, ByRef SelComboItemList As List(Of String)) As Boolean
+ Dim sVal As String = String.Empty
+ CompoGetPrivateProfileString(IpAppName, IpKeyName, "", sVal)
+ Dim sItems() As String = sVal.Split(",".ToCharArray)
+ If sItems.Count() >= 2 Then
+ DDFName = sItems(0)
+ If IsNumeric(sItems(1)) Then
+ Name = (EgtMsg(CInt(sItems(1))))
+ Else
+ Name = DDFName
+ End If
+ If sItems.Count() >= 3 Then
+ ComboIndex = CInt(sItems(2))
+ SelComboItemList = New List(Of String)
+ For Index = 3 To sItems.Count() - 1
+ If IsNumeric(sItems(Index)) Then
+ SelComboItemList.Add(EgtMsg(CInt(sItems(Index))))
+ Else
+ SelComboItemList.Add(sItems(Index))
+ End If
+ Next
+ Return True
+ End If
+ End If
+ Return False
+ End Function
+
+ ' Funzione che legge valori ComboBox
+ Public Function CompoGetPrivateProfileComboBox(IpAppName As String, IpKeyName As String, ByRef DDFName As String, ByRef Name As String) As Boolean
+ Dim sVal As String = String.Empty
+ CompoGetPrivateProfileString(IpAppName, IpKeyName, "", sVal)
+ Dim sItems() As String = sVal.Split(",".ToCharArray)
+ If sItems.Count() >= 2 Then
+ DDFName = sItems(0)
+ If IsNumeric(sItems(1)) Then
+ Name = EgtMsg(CInt(sItems(1)))
+ Else
+ Name = DDFName
+ End If
+
+ Return True
+ End If
+ Return False
+ End Function
+
+ ' Funzione che legge valori ComboBoxList
+ Public Function CompoGetPrivateProfileComboBoxList(IpAppName As String, IpKeyName As String, ByRef ComboList As List(Of String), ByRef ComboListDDF As List(Of String)) As Integer
+ Dim sVal As String = String.Empty
+
+ CompoGetPrivateProfileString(IpAppName, IpKeyName, "", sVal)
+ Dim sItems() As String = sVal.Split(",".ToCharArray)
+ Dim ListType As Integer = 0
+ Dim ListPath As String = String.Empty
+ If sItems.Count() >= 2 Then
+ ListType = CInt(sItems(0))
+ If ListType = 0 Then
+ ComboList = New List(Of String)
+ ComboListDDF = New List(Of String)
+ For Index = 1 To sItems.Count() - 1
+ Dim sItemsDDF() As String = sItems(Index).Split("/".ToCharArray)
+ If sItemsDDF.Count() = 2 Then
+ ComboListDDF.Add(sItemsDDF(0))
+ If IsNumeric(sItemsDDF(1)) Then
+ ComboList.Add(EgtMsg(CInt(sItemsDDF(1))))
+ Else
+ ComboList.Add(sItemsDDF(1))
+ End If
+ Else
+ ComboList.Add(sItemsDDF(0))
+ End If
+ Next
+ Else
+ If Directory.Exists(sItems(1)) Then
+ ListPath = sItems(1)
+ ComboList = New List(Of String)
+ OpenDirectory(ListPath, ComboList, ListPath & "\")
+ Else
+ MessageBox.Show(EgtMsg(ConstMsg.MSG_ERROR) & ListPath, EgtMsg(ConstMsg.MSG_ERROR + 1), MessageBoxButton.OK, MessageBoxImage.Error)
+ ListPath = String.Empty
+ ComboList = New List(Of String)
+ Return ComboListResult.Mistake
+ End If
+ End If
+ Return ComboListResult.Found
+ End If
+ Return ComboListResult.NotFound
+
+ End Function
+
+ Private Sub OpenDirectory(DirectoryPath As String, ByRef ComboList As List(Of String), ListPath As String)
+ Dim SubDir() As String = Directory.GetDirectories(DirectoryPath)
+ For Index = 0 To SubDir.Count - 1
+ OpenDirectory(SubDir(Index), ComboList, ListPath)
+ Next
+ Dim Files() As String = Directory.GetFiles(DirectoryPath)
+ For Index = 0 To Files.Count - 1
+ ComboList.Add(Files(Index).Replace(ListPath, ""))
+ Next
+ End Sub
+
+End Module
+
+' Classe che identifica una lingua del programma con nome e path del file dei messaggi
+Public Class Language
+
+ Private m_sName As String
+ Private m_sFilePath As String
+
+ Public Property Name As String
+ Get
+ Return m_sName
+ End Get
+ Set(value As String)
+ m_sName = value
+ End Set
+ End Property
+
+ Public Property FilePath As String
+ Get
+ Return m_sFilePath
+ End Get
+ Set(value As String)
+ m_sFilePath = value
+ End Set
+ End Property
+
+ Sub New(sName As String, sFilePath As String)
+ Me.Name = sName
+ Me.FilePath = sFilePath
+ End Sub
+
+End Class
diff --git a/MainWindow/MainWindow.xaml b/MainWindow/MainWindow.xaml
new file mode 100644
index 0000000..6ca75ab
--- /dev/null
+++ b/MainWindow/MainWindow.xaml
@@ -0,0 +1,24 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/MainWindow/MainWindow.xaml.vb b/MainWindow/MainWindow.xaml.vb
new file mode 100644
index 0000000..ebaef57
--- /dev/null
+++ b/MainWindow/MainWindow.xaml.vb
@@ -0,0 +1,3 @@
+Class MainWindow
+
+End Class
diff --git a/MainWindow/MainWindowModel.vb b/MainWindow/MainWindowModel.vb
new file mode 100644
index 0000000..710467e
--- /dev/null
+++ b/MainWindow/MainWindowModel.vb
@@ -0,0 +1,207 @@
+Imports System.Threading
+Imports System.Math
+Imports EgtUILib
+
+Friend Class MainWindowModel
+
+#Region "FIELDS"
+
+ ' Riferimento alla porta corrente
+ Friend m_Door As Door
+
+ ' Mutex che permette di controllare il numero massimo di istanze aperta contemporaneamente
+ Private m_objMutex As New Mutex
+ ' Variabile che indica il numero di istanze aperte del programma
+ Friend m_nInstance As Integer = 0
+
+ ' Path cartella Data
+ Friend m_sDataRoot As String = String.Empty
+ ' Path cartella Config
+ Friend m_sConfigDir As String = String.Empty
+ ' Path cartella Temp
+ Friend m_sTempDir As String = String.Empty
+
+ ' 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
+
+ Private m_nDebug As Integer = 0
+
+#End Region
+
+#Region "CONSTRUCTOR"
+
+ Sub New()
+ ' Impostazione path radice per i dati
+ m_sDataRoot = System.AppDomain.CurrentDomain.BaseDirectory
+ If EgtUILib.GetPrivateProfileString(S_DATA, K_DATAROOT, "", m_sDataRoot, m_sDataRoot & "\" & DAT_FILE_NAME) = 0 Then
+ m_sDataRoot = System.AppDomain.CurrentDomain.BaseDirectory
+ End If
+ ' Impostazione direttorio di configurazione
+ m_sConfigDir = m_sDataRoot & "\" & CONF_DIR
+ ' Impostazione direttorio per file temporanei
+ m_sTempDir = m_sDataRoot & "\" & TEMP_DIR
+ ' Impostazione path Ini file
+ IniFile.m_sIniFile = m_sConfigDir & "\" & INI_FILE_NAME
+ ' Impostazione path CompoIni file
+ IniFile.m_sCompoIniFile = m_sConfigDir & "\" & COMPOINI_FILE_NAME
+ ' Verifico indice di istanza
+ ManageIstance()
+ '' Imposto tipo di chiave
+ 'EgtSetLockType(KEY_TYPE.HW)
+ '' Leggo e imposto chiave di protezione
+ 'Dim sLicFileName As String = String.Empty
+ 'GetPrivateProfileString(S_GENERAL, K_LICENCE, LIC_FILE_NAME, sLicFileName)
+ 'Dim sLicFile As String = m_sConfigDir & "\" & sLicFileName
+ 'Dim sKey As String = String.Empty
+ '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
+ m_nDebug = GetPrivateProfileInt(S_GENERAL, K_DEBUG, 0)
+ Dim sLogFile As String = m_sTempDir & "\" & GENLOG_FILE_NAME.Replace("#", m_nInstance.ToString())
+ Dim sLogMsg As String = "User " & Environment.UserName & "\" & Environment.MachineName & " (" & m_nInstance.ToString() & ")" & vbLf &
+ My.Application.Info.Description.ToString() & " ver. " &
+ 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()
+ EgtInit(m_nDebug, sLogFile, sLogMsg)
+ ' Leggo direttorio dei messaggi (se manca uso direttorio di configurazione)
+ Dim sMsgDir As String = String.Empty
+ If GetPrivateProfileString(S_GENERAL, K_MESSAGESDIR, "", sMsgDir) = 0 Then
+ sMsgDir = m_sConfigDir
+ End If
+ ' Leggo elenco lingue disponibili da file ini
+ Dim nIndex As Integer = 1
+ Dim ReadLanguage As Language = GetPrivateProfileLanguage(S_LANGUAGES, K_LANGUAGE & nIndex)
+ While Not IsNothing(ReadLanguage)
+ 'OptionModule.m_LanguageList.Add(ReadLanguage)
+ nIndex += 1
+ ReadLanguage = GetPrivateProfileLanguage(S_LANGUAGES, K_LANGUAGE & nIndex)
+ End While
+ ' Inizializzo OptionModule
+ 'OptionModule.InitOptionModule()
+ ' Leggo file messaggi
+ Dim sMsgName As String = String.Empty
+ GetPrivateProfileString(S_GENERAL, K_MESSAGES, "", sMsgName)
+ Dim sMsgFilePath As String = sMsgDir & "\EgalTechEng.txt"
+ 'For Each Language In OptionModule.m_LanguageList
+ ' If Language.Name = sMsgName Then
+ ' OptionModule.m_SelectedLanguage = Language
+ ' sMsgFilePath = sMsgDir & "\" & Language.FilePath
+ ' End If
+ 'Next
+ If Not EgtLoadMessages(sMsgFilePath) Then
+ EgtOutLog("Error in EgtLoadMessages")
+ End If
+
+ ' imposto dir di default per libreria Lua e lancio libreria di base
+ Dim sLuaLibsDir As String = String.Empty
+ GetPrivateProfileString(S_LUA, K_LIBSDIR, "", sLuaLibsDir)
+ EgtSetLuaLibs(sLuaLibsDir)
+ Dim sLuaBaseLib As String = String.Empty
+ GetPrivateProfileString(S_LUA, K_BASELIB, "EgtBase", sLuaBaseLib)
+ EgtLuaRequire(sLuaBaseLib)
+
+
+
+ ' Prova generazione porta
+ 'NewDoor()
+ DdfFile.ReadDDF("c:\EgtData\EgtDOORCreator\Myprojects\Prova1.ddf")
+ m_Door = DdfFile.m_Door
+ End Sub
+
+ Public Sub NewDoor()
+ m_Door = New Door
+ EgtDoorCreatorMap.m_Door = Me.m_Door
+ ' m_Door.Height = "15"
+ ' m_Door.Thickness = "1"
+ ' m_Door.Width = "9"
+ ' m_Door.Swing = "LH"
+ ' m_Door.TopType = "SQ"
+ ' m_Door.BottomType = "SQ"
+ ' m_Door.HingeEdgeType = "2B"
+ ' m_Door.LockEdgeType = "SQ"
+ ' m_Door.LockEdgeMachining = False
+ ' m_Door.HingeEdgeMachining = False
+ ' m_Door.TopMachining = False
+ ' m_Door.BottomMachining = True
+ ' m_Door.LockEdgeOverMaterial = "0.2"
+ ' m_Door.HingeEdgeOverMaterial = "0.3"
+ ' m_Door.TopOverMaterial = "0.4"
+ ' m_Door.BottomOverMaterial = "0"
+
+ End Sub
+#End Region
+
+#Region "METHODS"
+
+ '''
+ ''' Funzione che permette di gestire il numero di istanze del programma attive contemporaneamente
+ '''
+ Private Sub ManageIstance()
+ Dim bCreated As Boolean
+ Try
+ m_objMutex = New Mutex(False, "Global\EgtDOORCreator", bCreated)
+ Catch
+ bCreated = False
+ End Try
+ If bCreated Then
+ ' Prima istanza
+ m_nInstance = 1
+ ' Aggiorno stato istanze attive
+ WritePrivateProfileString(S_GENERAL, K_INSTANCES, m_nInstance.ToString)
+ Else
+ ' Leggo il massimo numero di istanze ammesse
+ Dim nMaxInst As Integer = GetPrivateProfileInt(S_GENERAL, K_MAXINST, 1)
+ nMaxInst = Max(1, Min(nMaxInst, 32))
+ ' Cerco il primo indice di istanza libero (max 32)
+ Dim nTmp As Integer = GetPrivateProfileInt(S_GENERAL, K_INSTANCES, 0)
+ m_nInstance = 1
+ Dim nMask As Integer = 1
+ While (nTmp And nMask) <> 0 And m_nInstance <= m_nInstance
+ m_nInstance += 1
+ nMask *= 2
+ End While
+ ' Se l'indice supera il massimo
+ If m_nInstance > nMaxInst Then
+ ' porto in primo piano la prima istanza
+ Dim bFound As Boolean = False
+ ' processi del programma a 32 bit
+ Dim localProc As Process() = Process.GetProcessesByName("EgtDOORCreatorR32")
+ For Each p As Process In localProc
+ If p.Id <> Process.GetCurrentProcess().Id Then
+ bFound = True
+ ShowWindow(p.MainWindowHandle, SW.SHOWMAXIMIZED)
+ Exit For
+ End If
+ Next
+ ' se non trovati processi a 32 bit provo a 64 bit
+ If Not bFound Then
+ localProc = Process.GetProcessesByName("EgtDOORCreatorR64")
+ For Each p As Process In localProc
+ If p.Id <> Process.GetCurrentProcess().Id Then
+ bFound = True
+ ShowWindow(p.MainWindowHandle, SW.SHOWMAXIMIZED)
+ Exit For
+ End If
+ Next
+ End If
+ ' esco dal programma
+ End
+ End If
+ ' Aggiorno stato istanze attive
+ nTmp += (1 << (m_nInstance - 1))
+ WritePrivateProfileString(S_GENERAL, K_INSTANCES, nTmp.ToString())
+ End If
+ End Sub
+
+#End Region
+
+End Class
diff --git a/MainWindow/MainWindowViewModel.vb b/MainWindow/MainWindowViewModel.vb
new file mode 100644
index 0000000..43f0e84
--- /dev/null
+++ b/MainWindow/MainWindowViewModel.vb
@@ -0,0 +1,29 @@
+
+Public Class MainWindowViewModel
+
+ ' Modello del MainWindow (classe vera e propria)
+ Private m_MainWindowModel As New MainWindowModel
+
+ Private m_CompoPanel As CompoPanelView
+ Public ReadOnly Property CompoPanel As CompoPanelView
+ Get
+ If IsNothing(m_CompoPanel) Then
+ m_CompoPanel = New CompoPanelView
+ m_CompoPanel.DataContext = New CompoPanelViewModel(m_MainWindowModel.m_Door)
+ End If
+ Return m_CompoPanel
+ End Get
+ End Property
+
+ Private m_DoorParameters As DoorParametersView
+ Public ReadOnly Property DoorParameters As DoorParametersView
+ Get
+ If IsNothing(m_DoorParameters) Then
+ m_DoorParameters = New DoorParametersView
+ m_DoorParameters.DataContext = New DoorParametersViewModel(m_MainWindowModel.m_Door)
+ End If
+ Return m_DoorParameters
+ End Get
+ End Property
+
+End Class
diff --git a/My Project/AssemblyInfo.vb b/My Project/AssemblyInfo.vb
new file mode 100644
index 0000000..a9fa23d
--- /dev/null
+++ b/My Project/AssemblyInfo.vb
@@ -0,0 +1,76 @@
+Imports System
+Imports System.Reflection
+Imports System.Runtime.InteropServices
+Imports System.Globalization
+Imports System.Resources
+Imports System.Windows
+
+' General Information about an assembly is controlled through the following
+' set of attributes. Change these attribute values to modify the information
+' associated with an assembly.
+
+' Review the values of the assembly attributes
+
+
+#If PLATFORM = "x64" Then
+#If DEBUG Then
+
+
+#Else
+
+
+#End if
+#Else
+#If DEBUG Then
+
+
+#Else
+
+
+#End If
+#End If
+
+
+
+
+
+
+
+'In order to begin building localizable applications, set
+'CultureYouAreCodingWith in your .vbproj file
+'inside a . For example, if you are using US english
+'in your source files, set the to "en-US". Then uncomment the
+'NeutralResourceLanguage attribute below. Update the "en-US" in the line
+'below to match the UICulture setting in the project file.
+
+'
+
+
+'The ThemeInfo attribute describes where any theme specific and generic resource dictionaries can be found.
+'1st parameter: where theme specific resource dictionaries are located
+'(used if a resource is not found in the page,
+' or application resource dictionaries)
+
+'2nd parameter: where the generic resource dictionary is located
+'(used if a resource is not found in the page,
+'app, and any theme specific resource dictionaries)
+
+
+
+
+'The following GUID is for the ID of the typelib if this project is exposed to COM
+
+
+' Version information for an assembly consists of the following four values:
+'
+' Major Version
+' Minor Version
+' Build Number
+' Revision
+'
+' You can specify all the values or you can default the Build and Revision Numbers
+' by using the '*' as shown below:
+'
+
+
+
diff --git a/My Project/MyExtensions/MyWpfExtension.vb b/My Project/MyExtensions/MyWpfExtension.vb
new file mode 100644
index 0000000..2f5639e
--- /dev/null
+++ b/My Project/MyExtensions/MyWpfExtension.vb
@@ -0,0 +1,121 @@
+#If _MyType <> "Empty" Then
+
+Namespace My
+ '''
+ ''' Module used to define the properties that are available in the My Namespace for WPF
+ '''
+ '''
+ _
+ Module MyWpfExtension
+ Private s_Computer As New ThreadSafeObjectProvider(Of Global.Microsoft.VisualBasic.Devices.Computer)
+ Private s_User As New ThreadSafeObjectProvider(Of Global.Microsoft.VisualBasic.ApplicationServices.User)
+ Private s_Windows As New ThreadSafeObjectProvider(Of MyWindows)
+ Private s_Log As New ThreadSafeObjectProvider(Of Global.Microsoft.VisualBasic.Logging.Log)
+ '''
+ ''' Returns the application object for the running application
+ '''
+ _
+ Friend ReadOnly Property Application() As Application
+ Get
+ Return CType(Global.System.Windows.Application.Current, Application)
+ End Get
+ End Property
+ '''
+ ''' Returns information about the host computer.
+ '''
+ _
+ Friend ReadOnly Property Computer() As Global.Microsoft.VisualBasic.Devices.Computer
+ Get
+ Return s_Computer.GetInstance()
+ End Get
+ End Property
+ '''
+ ''' Returns information for the current user. If you wish to run the application with the current
+ ''' Windows user credentials, call My.User.InitializeWithWindowsUser().
+ '''
+ _
+ Friend ReadOnly Property User() As Global.Microsoft.VisualBasic.ApplicationServices.User
+ Get
+ Return s_User.GetInstance()
+ End Get
+ End Property
+ '''
+ ''' Returns the application log. The listeners can be configured by the application's configuration file.
+ '''
+ _
+ Friend ReadOnly Property Log() As Global.Microsoft.VisualBasic.Logging.Log
+ Get
+ Return s_Log.GetInstance()
+ End Get
+ End Property
+
+ '''
+ ''' Returns the collection of Windows defined in the project.
+ '''
+ _
+ Friend ReadOnly Property Windows() As MyWindows
+ _
+ Get
+ Return s_Windows.GetInstance()
+ End Get
+ End Property
+ _
+ _
+ Friend NotInheritable Class MyWindows
+ _
+ Private Shared Function Create__Instance__(Of T As {New, Global.System.Windows.Window})(ByVal Instance As T) As T
+ If Instance Is Nothing Then
+ If s_WindowBeingCreated IsNot Nothing Then
+ If s_WindowBeingCreated.ContainsKey(GetType(T)) = True Then
+ Throw New Global.System.InvalidOperationException("The window cannot be accessed via My.Windows from the Window constructor.")
+ End If
+ Else
+ s_WindowBeingCreated = New Global.System.Collections.Hashtable()
+ End If
+ s_WindowBeingCreated.Add(GetType(T), Nothing)
+ Return New T()
+ s_WindowBeingCreated.Remove(GetType(T))
+ Else
+ Return Instance
+ End If
+ End Function
+ _
+ _
+ Private Sub Dispose__Instance__(Of T As Global.System.Windows.Window)(ByRef instance As T)
+ instance = Nothing
+ End Sub
+ _
+ _
+ Public Sub New()
+ MyBase.New()
+ End Sub
+ Private Shared s_WindowBeingCreated As Global.System.Collections.Hashtable
+ Public Overrides Function Equals(ByVal o As Object) As Boolean
+ Return MyBase.Equals(o)
+ End Function
+ Public Overrides Function GetHashCode() As Integer
+ Return MyBase.GetHashCode
+ End Function
+ _
+ _
+ Friend Overloads Function [GetType]() As Global.System.Type
+ Return GetType(MyWindows)
+ End Function
+ Public Overrides Function ToString() As String
+ Return MyBase.ToString
+ End Function
+ End Class
+ End Module
+End Namespace
+Partial Class Application
+ Inherits Global.System.Windows.Application
+ _
+ _
+ Friend ReadOnly Property Info() As Global.Microsoft.VisualBasic.ApplicationServices.AssemblyInfo
+ _
+ Get
+ Return New Global.Microsoft.VisualBasic.ApplicationServices.AssemblyInfo(Global.System.Reflection.Assembly.GetExecutingAssembly())
+ End Get
+ End Property
+End Class
+#End If
\ No newline at end of file
diff --git a/My Project/Resources.Designer.vb b/My Project/Resources.Designer.vb
new file mode 100644
index 0000000..ca76024
--- /dev/null
+++ b/My Project/Resources.Designer.vb
@@ -0,0 +1,63 @@
+'------------------------------------------------------------------------------
+'
+' This code was generated by a tool.
+' Runtime Version:4.0.30319.42000
+'
+' Changes to this file may cause incorrect behavior and will be lost if
+' the code is regenerated.
+'
+'------------------------------------------------------------------------------
+
+Option Strict On
+Option Explicit On
+
+Imports System
+
+Namespace My.Resources
+
+ 'This class was auto-generated by the StronglyTypedResourceBuilder
+ 'class via a tool like ResGen or Visual Studio.
+ 'To add or remove a member, edit your .ResX file then rerun ResGen
+ 'with the /str option, or rebuild your VS project.
+ '''
+ ''' A strongly-typed resource class, for looking up localized strings, etc.
+ '''
+ _
+ Friend Module Resources
+
+ Private resourceMan As Global.System.Resources.ResourceManager
+
+ Private resourceCulture As Global.System.Globalization.CultureInfo
+
+ '''
+ ''' Returns the cached ResourceManager instance used by this class.
+ '''
+ _
+ Friend ReadOnly Property ResourceManager() As Global.System.Resources.ResourceManager
+ Get
+ If Object.ReferenceEquals(resourceMan, Nothing) Then
+ Dim temp As Global.System.Resources.ResourceManager = New Global.System.Resources.ResourceManager("EgtDOORCreator.Resources", GetType(Resources).Assembly)
+ resourceMan = temp
+ End If
+ Return resourceMan
+ End Get
+ End Property
+
+ '''
+ ''' Overrides the current thread's CurrentUICulture property for all
+ ''' resource lookups using this strongly typed resource class.
+ '''
+ _
+ Friend Property Culture() As Global.System.Globalization.CultureInfo
+ Get
+ Return resourceCulture
+ End Get
+ Set
+ resourceCulture = value
+ End Set
+ End Property
+ End Module
+End Namespace
diff --git a/My Project/Resources.resx b/My Project/Resources.resx
new file mode 100644
index 0000000..ffecec8
--- /dev/null
+++ b/My Project/Resources.resx
@@ -0,0 +1,117 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
\ No newline at end of file
diff --git a/My Project/Settings.Designer.vb b/My Project/Settings.Designer.vb
new file mode 100644
index 0000000..5ff2570
--- /dev/null
+++ b/My Project/Settings.Designer.vb
@@ -0,0 +1,71 @@
+'------------------------------------------------------------------------------
+'
+' This code was generated by a tool.
+' Runtime Version:4.0.30319.42000
+'
+' Changes to this file may cause incorrect behavior and will be lost if
+' the code is regenerated.
+'
+'------------------------------------------------------------------------------
+
+Option Strict On
+Option Explicit On
+
+
+
+ _
+Partial Friend NotInheritable Class MySettings
+ Inherits Global.System.Configuration.ApplicationSettingsBase
+
+ Private Shared defaultInstance As MySettings = CType(Global.System.Configuration.ApplicationSettingsBase.Synchronized(New MySettings()),MySettings)
+
+#Region "My.Settings Auto-Save Functionality"
+#If _MyType = "WindowsForms" Then
+ Private Shared addedHandler As Boolean
+
+ Private Shared addedHandlerLockObject As New Object
+
+ _
+ Private Shared Sub AutoSaveSettings(ByVal sender As Global.System.Object, ByVal e As Global.System.EventArgs)
+ If My.Application.SaveMySettingsOnExit Then
+ My.Settings.Save()
+ End If
+ End Sub
+#End If
+#End Region
+
+ Public Shared ReadOnly Property [Default]() As MySettings
+ Get
+
+#If _MyType = "WindowsForms" Then
+ If Not addedHandler Then
+ SyncLock addedHandlerLockObject
+ If Not addedHandler Then
+ AddHandler My.Application.Shutdown, AddressOf AutoSaveSettings
+ addedHandler = True
+ End If
+ End SyncLock
+ End If
+#End If
+ Return defaultInstance
+ End Get
+ End Property
+End Class
+
+Namespace My
+
+ _
+ Friend Module MySettingsProperty
+
+ _
+ Friend ReadOnly Property Settings() As Global.EgtDOORCreator.MySettings
+ Get
+ Return Global.EgtDOORCreator.MySettings.Default
+ End Get
+ End Property
+ End Module
+End Namespace
diff --git a/My Project/Settings.settings b/My Project/Settings.settings
new file mode 100644
index 0000000..2b428d2
--- /dev/null
+++ b/My Project/Settings.settings
@@ -0,0 +1,7 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/My Project/app.manifest b/My Project/app.manifest
new file mode 100644
index 0000000..684187d
--- /dev/null
+++ b/My Project/app.manifest
@@ -0,0 +1,58 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Resources/EgtCAM5.ico b/Resources/EgtCAM5.ico
new file mode 100644
index 0000000..3eec029
Binary files /dev/null and b/Resources/EgtCAM5.ico differ
diff --git a/Utility.vb b/Utility.vb
new file mode 100644
index 0000000..4164343
--- /dev/null
+++ b/Utility.vb
@@ -0,0 +1,50 @@
+Imports System.Collections.ObjectModel
+Imports System.Globalization
+Imports EgtUILib
+
+Public Module Utility
+
+ Friend Function DoubleToString(ByVal dVal As Double, ByVal nNumDec As Integer) As String
+ Dim sFormat As String = "F" + Math.Abs(nNumDec).ToString()
+ Dim sVal As String = dVal.ToString(sFormat, CultureInfo.InvariantCulture)
+ If nNumDec > 0 Then
+ Return sVal.TrimEnd("0".ToCharArray()).TrimEnd(".".ToCharArray)
+ Else
+ Return sVal
+ End If
+ End Function
+
+ Friend Function StringToDouble(ByVal sVal As String, ByRef dVal As Double) As Boolean
+ Return EgtLuaEvalNumExpr(sVal, dVal)
+ End Function
+
+ Friend Function LenToString(ByVal dVal As Double, ByVal nNumDec As Integer) As String
+ Return DoubleToString(EgtToUiUnits(dVal), nNumDec)
+ End Function
+
+ Friend Function StringToLen(ByVal sVal As String, ByRef dVal As Double) As Boolean
+ If EgtLuaEvalNumExpr(sVal, dVal) Then
+ dVal = EgtFromUiUnits(dVal)
+ Return True
+ Else
+ Return False
+ End If
+ End Function
+
+ 'Converte il valore Boolean in una stringa ON/OFF (attributo machining)
+ Public Function ConvertBooleanToOnOff(bValue As Boolean) As String
+ If bValue Then
+ Return K_ON
+ Else
+ Return K_OFF
+ End If
+ End Function
+
+ Friend Sub UpdateUI()
+ ' Costringo ad aggiornare UI
+ Dim nDummy As Integer
+ Application.Current.Dispatcher.Invoke(Windows.Threading.DispatcherPriority.Background, _
+ New Action(Function() nDummy = 0))
+ End Sub
+
+End Module