Namespace CNC

    Partial Public Class FANUC
        'Private Class Err

        '    Private _Errors As Dictionary(Of Integer, String)  'Hashtable

        '    Public Sub New()
        '        _Errors = New Dictionary(Of Integer, String) 'Hashtable
        '        _Errors.Add(Focas1.EW_PROTOCOL, "protocol error")               '-17
        '        _Errors.Add(Focas1.EW_SOCKET, "Windows socket error")           '-16
        '        _Errors.Add(Focas1.EW_NODLL, "DLL not exist error")             '-15
        '        _Errors.Add(Focas1.EW_BUS, "bus error")                         '-11
        '        _Errors.Add(Focas1.EW_SYSTEM2, "system error")                  '-10
        '        _Errors.Add(Focas1.EW_HSSB, "hssb communication error")         '-9
        '        _Errors.Add(Focas1.EW_HANDLE, "Windows library handle error")   '-8
        '        _Errors.Add(Focas1.EW_VERSION, "CNC/PMC version missmatch")     '-7
        '        _Errors.Add(Focas1.EW_UNEXP, "abnormal error")                  '-6
        '        _Errors.Add(Focas1.EW_SYSTEM, "system error")                   '-5
        '        _Errors.Add(Focas1.EW_PARITY, "shared RAM parity error")        '-4
        '        _Errors.Add(Focas1.EW_MMCSYS, "emm386 or mmcsys install error") '-3
        '        _Errors.Add(Focas1.EW_RESET, "reset or stop occured error")     '-2
        '        _Errors.Add(Focas1.EW_BUSY, "busy error")                       '-1
        '        _Errors.Add(Focas1.EW_OK, "no problem")                         '0
        '        '_Errors.Add(Focas1.EW_FUNC, "command prepare error")           '1
        '        '_Errors.Add(Focas1.EW_NOPMC, "pmc not exist")                  '1
        '        _Errors.Add(1, "command prepare error OR pmc not exist")        '1
        '        _Errors.Add(Focas1.EW_LENGTH, "data block length error")        '2
        '        '_Errors.Add(Focas1.EW_NUMBER, "data number error")             '3
        '        '_Errors.Add(Focas1.EW_RANGE, "address range error")            '3
        '        _Errors.Add(3, "data number error OR address range error")      '3
        '        '_Errors.Add(Focas1.EW_ATTRIB, "data attribute error")          '4
        '        '_Errors.Add(Focas1.EW_TYPE, "data type error")                 '4  
        '        _Errors.Add(4, "data attribute error OR data type error")       '4
        '        _Errors.Add(Focas1.EW_DATA, "data error")                       '5
        '        _Errors.Add(Focas1.EW_NOOPT, "no option error")                 '6
        '        _Errors.Add(Focas1.EW_PROT, "write protect error")              '7
        '        _Errors.Add(Focas1.EW_OVRFLOW, "memory overflow error")         '8
        '        _Errors.Add(Focas1.EW_PARAM, "cnc parameter not correct error") '9
        '        _Errors.Add(Focas1.EW_BUFFER, "buffer error")                   '10
        '        _Errors.Add(Focas1.EW_PATH, "path error")                       '11
        '        _Errors.Add(Focas1.EW_MODE, "cnc mode error")                   '12
        '        _Errors.Add(Focas1.EW_REJECT, "execution rejected error")       '13
        '        _Errors.Add(Focas1.EW_DTSRVR, "data server error")              '14
        '        _Errors.Add(Focas1.EW_ALARM, "alarm has been occurred")         '15
        '        _Errors.Add(Focas1.EW_STOP, "CNC is not running")               '16
        '        _Errors.Add(Focas1.EW_PASSWD, "protection data error")          '17
        '    End Sub

        '    ''' <summary>
        '    ''' Restituisce una stringa con la descrizione dell'errore
        '    ''' </summary>
        '    Public Function GetInfo(ByVal nError As Integer) As String
        '        Try
        '            Return String.Format("({0}) ""{1}""", nError, _Errors(nError))  'es: (0) "no problem"
        '        Catch ex As Exception
        '            Return "!!! Error Info not available !!!"
        '        End Try
        '    End Function

        'End Class
    End Class

End Namespace

