Imports System.ComponentModel
Imports System.Drawing

Namespace Config

    Class Settings
        Const MAX_NUM_TOOLTABLE_PATH = 19

        Public Shared Settings As SettingsProperty
        Public Shared SettingsEdit As SettingsProperty
        Public Shared sPathFile As String

        Friend Enum MemoryMapping
            [Default] = 0
            ElsManager = 1
            ToolManager = 2
            ToolTable = 3
        End Enum

        Public Shared Sub CreateSettings(ByVal sPathF As String, Optional ByVal bReadToolTable As Boolean = True)
            If Settings Is Nothing Then
                Settings = New SettingsProperty
                SettingsEdit = New SettingsProperty
            End If


            ' Memorizzo il percorso del file INI
            sPathFile = sPathF

            LoadSettings(bReadToolTable)
        End Sub

        Public Shared Sub LoadSettings(Optional ByVal bReadToolTable As Boolean = True)
            Dim szFileIni As String
            Dim nTmp As Integer
            Dim Ini As App.Native.Ini
            Dim sFont As Single

            ' imposto il nome del file
            szFileIni = sPathFile & "\" & My.Application.Info.AssemblyName & ".ini"

            ' verifico che esista il file
            If My.Computer.FileSystem.FileExists(szFileIni) Then
                'istanzio la classe di gestione del file
                Ini = New App.Native.Ini(szFileIni)
                'leggo i settaggi dal file
                With Settings
                    .Debug = Ini.GetInteger("CONFIG", "DEBUG", 0)
                    .Language = Trim(Ini.GetString("CONFIG", "LANGUAGE", "English"))
                    ' Quando è attiva l'impostazione TOOLTABLEREMOTE in SettingsBase, 
                    ' il CN è "sempre" da impostare a DEMO 
                    If Config.Settings.Settings.ToolTable_Remote Then
                        .TypeNC = CNC.CNC.NcType.DEMO
                    Else
                        .TypeNC = Ini.GetInteger("NC", "TYPE", 0)
                    End If

                    nTmp = Ini.GetInteger("NC", "MEMORYMAPPING", 0)
                    If nTmp = 0 Then 'se MEMORYMAPPING viene lasciata a 0, imposto il valore di default
                        Select Case nTmp
                            Case CNC.CNC.NcType.FANUC : .MemoryMapping = MemoryMapping.ElsManager
                            Case CNC.CNC.NcType.OSAI : .MemoryMapping = MemoryMapping.ElsManager
                            Case CNC.CNC.NcType.SIEMENS : .MemoryMapping = MemoryMapping.ToolTable
                        End Select
                    Else
                        .MemoryMapping = nTmp
                    End If
                    If bReadToolTable Then
                        .SerialNumber = Ini.GetInteger("NC", "SERIALNUMBER", "0")
                    End If

                    .Hssb = Ini.GetBoolean("FANUC", "HSSB", 0)
                    .IpFanuc = Trim(Ini.GetString("FANUC", "IP", "192.168.1.1"))
                    .PortIpFanuc = Ini.GetInteger("FANUC", "PORT", "8193")
                    .CncScreenHssb = Ini.GetInteger("FANUC", "CNCSCREEN_HSSB", "0")
                    .NcName = Trim(Ini.GetString("OSAI", "NAME", "NC0000"))
                    .OsaiCommType = Trim(Ini.GetInteger("OSAI", "COMM_TYPE", "0"))
                    .IpOsai = Trim(Ini.GetString("OSAI", "IP", "192.168.1.1"))
                    .DncPcPath = Trim(Ini.GetString("OSAI", "DNC_PC_PATH", "C:\PARTPRG\"))
                    .DncNcPath = Trim(Ini.GetString("OSAI", "DNC_NC_PATH", "P:\"))
                    .DncTimeout = Ini.GetInteger("OSAI", "DNC_TIMEOUT", "20")
                    .AlwaysOnTop = CBool(Ini.GetString("POSITION", "ALWAYSONTOP", "0"))
                    .HeadsPanel_ShowOnOpPanel = CBool(Ini.GetString("HEADS_PANEL", "SHOW_ON_OPPANEL", "1"))
                    .HeadsPanel_ReverseOrder = CBool(Ini.GetString("HEADS_PANEL", "REVERSE_ORDER", "0"))
                    For i As Integer = 0 To 19
                        .HeadsPanel_Name(i) = Ini.GetString("HEADS_PANEL", "HEADNAME" & (i + 1).ToString, "")
                        Try
                            '.HeadsPanel_Type(i) = CType(Ini.GetInteger("HEADS_PANEL", "HEADTYPE" & (i + 1).ToString, "0"), Control.Heads.HeadTypes)
                        Catch ex As Exception
                        End Try
                    Next
                    .ControlPosition = New Rectangle(Ini.GetInteger("POSITION", "LEFT", 60),
                                                     Ini.GetInteger("POSITION", "TOP", 80),
                                                     Ini.GetInteger("POSITION", "WIDTH", 800),
                                                     Ini.GetInteger("POSITION", "HEIGHT", 600))
                    .OpPanel_FollowCnc = CBool(Ini.GetString("SETTINGS", "OPPANEL_FOLLOWCNC", "1"))

                    Dim ScreenW = Ini.GetInteger("SETTINGS", "SCREEN_WIDTH", 0)
                    Dim ScreenH = Ini.GetInteger("SETTINGS", "SCREEN_HEIGHT", 0)
                    If ScreenW > 0 And ScreenH > 0 Then
                        .OpPanel_ScreenSize = New Size(ScreenW, ScreenH)
                        .OpPanel_ForcedScreenSize = True
                    Else
                        '.OpPanel_ScreenSize = Screen.PrimaryScreen.Bounds.Size
                        .OpPanel_ForcedScreenSize = False
                    End If

                    Select Case .OpPanel_ScreenSize
                        Case New Size(800, 600)  '10"
                            sFont = 6.75!
                        Case New Size(1024, 768), New Size(2048, 768)  '15", 15" doppio monitor
                            sFont = 8.25!
                        Case New Size(1280, 800), New Size(1366, 768), New Size(1280, 1024)  '15,6" widescreen,17"
                            sFont = 9.75!
                        Case Else
                            sFont = 8.25!
                    End Select
                    .DefaultFont = New System.Drawing.Font("Tahoma", sFont, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))

                    .TcpSocket_Ip = Trim(Ini.GetString("SETTINGS", "TCPSOCKET_IP", "192.168.139.100"))
                    .TcpSocket_Port = Ini.GetInteger("SETTINGS", "TCPSOCKET_PORT", "4999")

                    ' ToolTable REMOTE
                    If bReadToolTable Then
                        .ToolTable_Remote = Ini.GetBoolean("TOOLTABLE", "REMOTE", 0)
                        For i As Integer = 0 To MAX_NUM_TOOLTABLE_PATH
                            .ToolTable_Path(i) = Ini.GetString("TOOLTABLE", "PATH" & (i + 1).ToString, "")
                            .ToolTable_Descr(i) = Ini.GetString("TOOLTABLE", "DESCRIPTION" & (i + 1).ToString, "")
                            If .ToolTable_Path(i) <> "" Then
                                .ToolTable_CountPaths = i + 1
                            End If
                        Next
                    End If
                End With
            Else
                'CMSCncLib.App.Runtime.Log.WW("ERR LoadFromFile", String.Format("File {0} not found", szFileIni), True)
            End If
        End Sub

        Public Shared Sub SaveToFile()
            Dim szFileIni As String
            Dim Ini As App.Native.Ini

            ' imposto il nome del file
            szFileIni = sPathFile & "\" & My.Application.Info.AssemblyName & ".ini"

            ' verifico che esista il file
            If My.Computer.FileSystem.FileExists(szFileIni) Then
                'istanzio la classe di gestione del file
                Ini = New App.Native.Ini(szFileIni)
                With Settings
                    ' salvo su file
                    Ini.WriteInteger("CONFIG", "DEBUG", .Debug)
                    Ini.WriteString("CONFIG", "LANGUAGE", .Language)

                    Ini.WriteInteger("POSITION", "ALWAYSONTOP", IIf((.AlwaysOnTop), 1, 0))
                    Ini.WriteInteger("POSITION", "LEFT", .ControlPosition.Left)
                    Ini.WriteInteger("POSITION", "TOP", .ControlPosition.Top)
                    Ini.WriteInteger("POSITION", "WIDTH", .ControlPosition.Width)
                    Ini.WriteInteger("POSITION", "HEIGHT", .ControlPosition.Height)

                    Ini.WriteInteger("TOOLTABLE", "REMOTE", IIf((.ToolTable_Remote), 1, 0))
                    ' Uso 2 cicli per mantenere Path e Descr separati
                    For i As Integer = 0 To MAX_NUM_TOOLTABLE_PATH
                        If .ToolTable_Path(i) <> "" Then
                            Ini.WriteString("TOOLTABLE", "PATH" & (i + 1).ToString, .ToolTable_Path(i))
                        End If
                    Next
                    For i As Integer = 0 To MAX_NUM_TOOLTABLE_PATH
                        If .ToolTable_Descr(i) <> "" Then
                            Ini.WriteString("TOOLTABLE", "DESCRIPTION" & (i + 1).ToString, .ToolTable_Descr(i))
                        End If
                    Next
                End With

                'CMSCncLib.App.Runtime.Log.WI("END SaveToFile", , CCMSCncLib.App.Runtime.Log.Lev.Secondary)
            Else
                'CMSCncLib.App.Runtime.Log.WW("ERR SaveToFile", String.Format("File {0} not found", szFileIni), True)
            End If
        End Sub

        Public Shared Sub SettingsToEdit()
            SettingsEdit.Debug = Settings.Debug
            SettingsEdit.Language = Settings.Language
            SettingsEdit.TypeNC = Settings.TypeNC
            SettingsEdit.MemoryMapping = Settings.MemoryMapping
            SettingsEdit.SerialNumber = Settings.SerialNumber
            SettingsEdit.Hssb = Settings.Hssb
            SettingsEdit.IpFanuc = Settings.IpFanuc
            SettingsEdit.PortIpFanuc = Settings.PortIpFanuc
            SettingsEdit.CncScreenHssb = Settings.CncScreenHssb
            SettingsEdit.NcName = Settings.NcName
            SettingsEdit.OsaiCommType = Settings.OsaiCommType
            SettingsEdit.IpOsai = Settings.IpOsai
            SettingsEdit.DncPcPath = Settings.DncPcPath
            SettingsEdit.DncNcPath = Settings.DncNcPath
            SettingsEdit.DncTimeout = Settings.DncTimeout
            SettingsEdit.AlwaysOnTop = Settings.AlwaysOnTop
            SettingsEdit.HeadsPanel_ShowOnOpPanel = Settings.HeadsPanel_ShowOnOpPanel
            SettingsEdit.HeadsPanel_ReverseOrder = Settings.HeadsPanel_ReverseOrder
            SettingsEdit.ControlPosition = New Rectangle(Settings.ControlPosition.X,
                                                         Settings.ControlPosition.Y,
                                                         Settings.ControlPosition.Width,
                                                         Settings.ControlPosition.Height)
            SettingsEdit.OpPanel_FollowCnc = Settings.OpPanel_FollowCnc
            SettingsEdit.OpPanel_ScreenSize = New Size(Settings.OpPanel_ScreenSize.Width,
                                                       Settings.OpPanel_ScreenSize.Height)
            SettingsEdit.TcpSocket_Ip = Settings.TcpSocket_Ip
            SettingsEdit.TcpSocket_Port = Settings.TcpSocket_Port

            SettingsEdit.ToolTable_Remote = Settings.ToolTable_Remote
            For i As Integer = 0 To MAX_NUM_TOOLTABLE_PATH
                SettingsEdit.ToolTable_Path(i) = Settings.ToolTable_Path(i)
                SettingsEdit.ToolTable_Descr(i) = Settings.ToolTable_Descr(i)
            Next
        End Sub

        Public Shared Sub EditToSettings()
            Settings.Debug = SettingsEdit.Debug
            Settings.Language = SettingsEdit.Language
            Settings.TypeNC = SettingsEdit.TypeNC
            Settings.MemoryMapping = SettingsEdit.MemoryMapping
            Settings.SerialNumber = SettingsEdit.SerialNumber
            Settings.Hssb = SettingsEdit.Hssb
            Settings.IpFanuc = SettingsEdit.IpFanuc
            Settings.PortIpFanuc = SettingsEdit.PortIpFanuc
            Settings.CncScreenHssb = SettingsEdit.CncScreenHssb
            Settings.NcName = SettingsEdit.NcName
            Settings.OsaiCommType = SettingsEdit.OsaiCommType
            Settings.IpOsai = SettingsEdit.IpOsai
            Settings.DncPcPath = SettingsEdit.DncPcPath
            Settings.DncNcPath = SettingsEdit.DncNcPath
            Settings.DncTimeout = SettingsEdit.DncTimeout
            Settings.AlwaysOnTop = SettingsEdit.AlwaysOnTop
            Settings.HeadsPanel_ShowOnOpPanel = SettingsEdit.HeadsPanel_ShowOnOpPanel
            Settings.HeadsPanel_ReverseOrder = SettingsEdit.HeadsPanel_ReverseOrder
            Settings.ControlPosition = New Rectangle(SettingsEdit.ControlPosition.X,
                                                     SettingsEdit.ControlPosition.Y,
                                                     SettingsEdit.ControlPosition.Width,
                                                     SettingsEdit.ControlPosition.Height)
            Settings.OpPanel_FollowCnc = SettingsEdit.OpPanel_FollowCnc
            Settings.OpPanel_ScreenSize = New Size(SettingsEdit.OpPanel_ScreenSize.Width,
                                                   SettingsEdit.OpPanel_ScreenSize.Height)
            Settings.TcpSocket_Ip = SettingsEdit.TcpSocket_Ip
            Settings.TcpSocket_Port = SettingsEdit.TcpSocket_Port

            Settings.ToolTable_Remote = SettingsEdit.ToolTable_Remote
            For i As Integer = 0 To MAX_NUM_TOOLTABLE_PATH
                Settings.ToolTable_Path(i) = SettingsEdit.ToolTable_Path(i)
                Settings.ToolTable_Descr(i) = SettingsEdit.ToolTable_Descr(i)
            Next

            RaiseEvent SettingsChanged(New Object, New EventArgs)
        End Sub

        Public Shared Event SettingsChanged(ByVal sender As Object, ByVal e As EventArgs)

        Friend Class SettingsProperty

            Private _Debug As Integer = 0
            <Category("CONFIG"),
               Browsable(True),
               DisplayName("DEBUG"),
               Description("Level of Debug")>
            Public Property Debug() As Integer
                Get
                    Return Me._Debug
                End Get
                Set(ByVal value As Integer)
                    Me._Debug = value
                End Set
            End Property
            Private _Language As String = "English"
            <Category("CONFIG"),
               Browsable(False),
               DisplayName("LANGUAGE"),
               Description("Language of Application")>
            Public Property Language() As String
                Get
                    Return Me._Language
                End Get
                Set(ByVal value As String)
                    Me._Language = value
                End Set
            End Property

            Private _TypeNC As CNC.CNC.NcType = CNC.CNC.NcType.DEMO
            <Category("NC"),
               Browsable(True),
               DisplayName("TYPE"),
               Description("Type of CNC"),
               [ReadOnly](True)>
            Public Property TypeNC() As CNC.CNC.NcType
                Get
                    Return Me._TypeNC
                End Get
                Set(ByVal value As CNC.CNC.NcType)
                    Me._TypeNC = value
                End Set
            End Property

            Private _MemoryMapping As Config.Settings.MemoryMapping = MemoryMapping.Default
            <Category("NC"),
               Browsable(True),
               DisplayName("MemoryMapping"),
               Description("Memory Mapping"),
               [ReadOnly](True)>
            Public Property MemoryMapping() As Config.Settings.MemoryMapping
                Get
                    Return Me._MemoryMapping
                End Get
                Set(ByVal value As Config.Settings.MemoryMapping)
                    Me._MemoryMapping = value
                End Set
            End Property

            Private _SerialNumber As Integer = 0
            <Category("NC"),
               Browsable(True),
               DisplayName("SerialNumber"),
               Description("Machine matricula")>
            Public Property SerialNumber() As Integer
                Get
                    Return Me._SerialNumber
                End Get
                Set(ByVal value As Integer)
                    Me._SerialNumber = value
                End Set
            End Property

            Private _Hssb As Integer = 0
            <Category("FANUC"),
               Browsable(True),
               DisplayName("HSSB"),
               Description("Use Hssb connection")>
            Public Property Hssb() As Integer
                Get
                    Return Me._Hssb
                End Get
                Set(ByVal value As Integer)
                    Me._Hssb = value
                End Set
            End Property

            Private _IpFanuc As String = "192.168.1.1"
            <Category("FANUC"),
               Browsable(True),
               DisplayName("IP"),
               Description("IP Address")>
            Public Property IpFanuc() As String
                Get
                    Return Me._IpFanuc
                End Get
                Set(ByVal value As String)
                    Me._IpFanuc = value
                End Set
            End Property

            Private _PortIpFanuc As Integer = 8193
            <Category("FANUC"),
               Browsable(True),
               DisplayName("PORT"),
               Description("TCP Port")>
            Public Property PortIpFanuc() As Integer
                Get
                    Return Me._PortIpFanuc
                End Get
                Set(ByVal value As Integer)
                    Me._PortIpFanuc = value
                End Set
            End Property

            Private _CncScreenHssb As Integer = 0
            <Category("FANUC"),
               Browsable(True),
               DisplayName("CNCSCREEN_HSSB"),
               Description("Use CncScreenDisplay Hssb version")>
            Public Property CncScreenHssb() As Integer
                Get
                    Return Me._CncScreenHssb
                End Get
                Set(ByVal value As Integer)
                    Me._CncScreenHssb = value
                End Set
            End Property

            Private _NcName As String = "NC0000"
            <Category("OSAI"),
               Browsable(True),
               DisplayName("NAME"),
               Description("Nc Name")>
            Public Property NcName() As String
                Get
                    Return Me._NcName
                End Get
                Set(ByVal value As String)
                    Me._NcName = value
                End Set
            End Property

            Private _OsaiCommType As Integer = 1
            <Category("OSAI"),
               Browsable(True),
               DisplayName("CommType"),
               Description("Communication type")>
            Public Property OsaiCommType() As Integer
                Get
                    Return Me._OsaiCommType
                End Get
                Set(ByVal value As Integer)
                    Me._OsaiCommType = value
                End Set
            End Property

            Private _IpOsai As String = "192.168.1.1"
            <Category("OSAI"),
               Browsable(True),
               DisplayName("IP"),
               Description("IP Address")>
            Public Property IpOsai() As String
                Get
                    Return Me._IpOsai
                End Get
                Set(ByVal value As String)
                    Me._IpOsai = value
                End Set
            End Property

            Private _DncPcPath As String = "C:\PARTPRG\"
            <Category("OSAI"),
               Browsable(True),
               DisplayName("DNC_PC_PATH"),
               Description("PC directory for DNC")>
            Public Property DncPcPath() As String
                Get
                    Return Me._DncPcPath
                End Get
                Set(ByVal value As String)
                    Me._DncPcPath = value
                End Set
            End Property

            Private _DncNcPath As String = "P:\"
            <Category("OSAI"),
               Browsable(True),
               DisplayName("DNC_NC_PATH"),
               Description("NC directory for DNC")>
            Public Property DncNcPath() As String
                Get
                    Return Me._DncNcPath
                End Get
                Set(ByVal value As String)
                    Me._DncNcPath = value
                End Set
            End Property

            Private _DncTimeout As Integer = 20
            <Category("OSAI"),
               Browsable(True),
               DisplayName("DNC_TIMEOUT"),
               Description("Timeout on loading program via DNC")>
            Public Property DncTimeout() As Integer
                Get
                    Return Me._DncTimeout
                End Get
                Set(ByVal value As Integer)
                    Me._DncTimeout = value
                End Set
            End Property

            Private _ControlPosition As Rectangle = New Rectangle(80, 60, 800, 600)
            <Category("POSITION"),
               Browsable(True),
               DisplayName("Position"),
               Description("Control window position")>
            Public Property ControlPosition() As Rectangle
                Get
                    Return Me._ControlPosition
                End Get
                Set(ByVal value As Rectangle)
                    Me._ControlPosition = value
                End Set
            End Property

            Private _AlwaysOnTop As Boolean
            <Category("POSITION"),
               Browsable(True),
               DisplayName("AlwaysOnTop"),
               Description("Window always on top")>
            Public Property AlwaysOnTop() As Boolean
                Get
                    Return Me._AlwaysOnTop
                End Get
                Set(ByVal value As Boolean)
                    Me._AlwaysOnTop = value
                End Set
            End Property

            Private _HeadsPanel_ShowOnOpPanel As Boolean
            <Category("HEADS_PANEL"),
               Browsable(True),
               DisplayName("ShowOnOpPanel"),
               Description("Show on OpPanel")>
            Public Property HeadsPanel_ShowOnOpPanel() As Boolean
                Get
                    Return Me._HeadsPanel_ShowOnOpPanel
                End Get
                Set(ByVal value As Boolean)
                    Me._HeadsPanel_ShowOnOpPanel = value
                End Set
            End Property

            Private _HeadsPanel_ReverseOrder As Boolean
            <Category("HEADS_PANEL"),
               Browsable(True),
               DisplayName("ReverseOrder"),
               Description("Reverse Order")>
            Public Property HeadsPanel_ReverseOrder() As Boolean
                Get
                    Return Me._HeadsPanel_ReverseOrder
                End Get
                Set(ByVal value As Boolean)
                    Me._HeadsPanel_ReverseOrder = value
                End Set
            End Property

            Private _HeadsPanel_Name(19) As String
            <Category("HEADS_PANEL"),
               Browsable(True),
               DisplayName("Name"),
               Description("Name")>
            Public Property HeadsPanel_Name() As String()
                Get
                    Return Me._HeadsPanel_Name
                End Get
                Set(ByVal value As String())
                    Me._HeadsPanel_Name = value
                End Set
            End Property

            'Private _HeadsPanel_Type(19) As Control.Heads.HeadTypes
            '<Category("HEADS_PANEL"), _
            '   Browsable(True), _
            '   DisplayName("Type"), _
            '   Description("Type")> _
            'Public Property HeadsPanel_Type() As Control.Heads.HeadTypes()
            '    Get
            '        Return Me._HeadsPanel_Type
            '    End Get
            '    Set(ByVal value As Control.Heads.HeadTypes())
            '        Me._HeadsPanel_Type = value
            '    End Set
            'End Property

            Private _OpPanel_FollowCnc As Boolean
            <Category("SETTINGS"),
               Browsable(True),
               DisplayName("Follow CNC"),
               Description("OpPanel follow CNC window status")>
            Public Property OpPanel_FollowCnc() As Boolean
                Get
                    Return Me._OpPanel_FollowCnc
                End Get
                Set(ByVal value As Boolean)
                    Me._OpPanel_FollowCnc = value
                End Set
            End Property

            Private _OpPanel_ScreenSize As Size = New Size(0, 0)
            <Category("SETTINGS"),
               Browsable(True),
               DisplayName("Screen Size"),
               Description("Force custom Screen Size")>
            Public Property OpPanel_ScreenSize() As Size
                Get
                    Return Me._OpPanel_ScreenSize
                End Get
                Set(ByVal value As Size)
                    Me._OpPanel_ScreenSize = value
                End Set
            End Property

            Private _OpPanel_ForcedScreenSize As Boolean = False
            <Category("SETTINGS"),
               Browsable(False),
               DisplayName("Forced Screen Size"),
               Description("Screen Size is Forced from INI")>
            Public Property OpPanel_ForcedScreenSize() As Boolean
                Get
                    Return Me._OpPanel_ForcedScreenSize
                End Get
                Set(ByVal value As Boolean)
                    Me._OpPanel_ForcedScreenSize = value
                End Set
            End Property

            Private _DefaultFont As Font
            <Category("SETTINGS"),
               Browsable(False),
               DisplayName("Default Font"),
               Description("Type and size Font")>
            Public Property DefaultFont() As Font
                Get
                    Return Me._DefaultFont
                End Get
                Set(ByVal value As Font)
                    Me._DefaultFont = value
                End Set
            End Property

            Private _TcpSocket_Ip As String = "192.168.139.100"
            <Category("SETTINGS"),
               Browsable(False),
               DisplayName("TCPSOCKET_IP"),
               Description("TCPSOCKET IP Address")>
            Public Property TcpSocket_Ip() As String
                Get
                    Return Me._TcpSocket_Ip
                End Get
                Set(ByVal value As String)
                    Me._TcpSocket_Ip = value
                End Set
            End Property

            Private _TcpSocket_Port As Integer = 4999
            <Category("SETTINGS"),
               Browsable(False),
               DisplayName("TCPSOCKET_PORT"),
               Description("TCPSOCKET PORT Address")>
            Public Property TcpSocket_Port() As Integer
                Get
                    Return Me._TcpSocket_Port
                End Get
                Set(ByVal value As Integer)
                    Me._TcpSocket_Port = value
                End Set
            End Property
            Private _ToolTable_Remote As Boolean = False
            <Category("TOOLTABLE"),
               Browsable(True),
               DisplayName("REMOTE"),
               Description("ToolTable remote")>
            Public Property ToolTable_Remote() As Boolean
                Get
                    Return Me._ToolTable_Remote
                End Get
                Set(ByVal value As Boolean)
                    Me._ToolTable_Remote = value
                End Set
            End Property
            Private _ToolTable_Path(MAX_NUM_TOOLTABLE_PATH) As String
            <Category("TOOLTABLE"),
               Browsable(True),
               DisplayName("PATH"),
               Description("PATH")>
            Public Property ToolTable_Path() As String()
                Get
                    Return Me._ToolTable_Path
                End Get
                Set(ByVal value As String())
                    Me._ToolTable_Path = value
                End Set
            End Property
            Private _ToolTable_Descr(MAX_NUM_TOOLTABLE_PATH) As String
            <Category("TOOLTABLE"),
               Browsable(True),
               DisplayName("DESCRIPTION"),
               Description("DESCRIPTION")>
            Public Property ToolTable_Descr() As String()
                Get
                    Return Me._ToolTable_Descr
                End Get
                Set(ByVal value As String())
                    Me._ToolTable_Descr = value
                End Set
            End Property
            Private _ToolTable_CountPaths As Integer = 0
            <Category("TOOLTABLE"),
               Browsable(True),
               DisplayName("CCOUNTPATHS"),
               Description("ToolTable paths number")>
            Public Property ToolTable_CountPaths() As Integer
                Get
                    Return Me._ToolTable_CountPaths
                End Get
                Set(ByVal value As Integer)
                    Me._ToolTable_CountPaths = value
                End Set
            End Property





        End Class

    End Class
End Namespace
