Exemplo n.º 1
0
        //---------------------------------------------------------------------------
        //
        // Function    :  DisplaySystemInfo
        //
        // Description :  Display information about this board system
        //
        //---------------------------------------------------------------------------

        static public unsafe bool DisplaySystemInfo(UInt32 systemId)
        {
            UInt32 boardCount = AlazarAPI.AlazarBoardsInSystemBySystemID(systemId);

            if (boardCount == 0)
            {
                Console.WriteLine("Error: No boards found in system.");
                return(false);
            }

            IntPtr handle = AlazarAPI.AlazarGetSystemHandle(systemId);

            if (handle == IntPtr.Zero)
            {
                Console.WriteLine("Error: AlazarGetSystemHandle system failed.");
                return(false);
            }

            UInt32 boardType = AlazarAPI.AlazarGetBoardKind(handle);

            if (boardType == AlazarAPI.ATS_NONE || boardType >= AlazarAPI.ATS_LAST)
            {
                Console.WriteLine("Error: Unknown board type " + boardType);
                return(false);
            }

            byte   driverMajor, driverMinor, driverRev;
            UInt32 retCode = AlazarAPI.AlazarGetDriverVersion(&driverMajor, &driverMinor, &driverRev);

            if (retCode != AlazarAPI.ApiSuccess)
            {
                Console.WriteLine("Error: AlazarGetDriverVersion failed -- " +
                                  AlazarAPI.AlazarErrorToText(retCode));
                return(false);
            }

            Console.WriteLine("System ID                 = {0}", systemId);
            Console.WriteLine("Board type                = {0}", BoardTypeToText(boardType));
            Console.WriteLine("Board count               = {0}", boardCount);
            Console.WriteLine("Driver version            = {0}.{1}.{2}", driverMajor, driverMinor, driverRev);
            Console.WriteLine("");

            // Display informataion about each board in this board system

            for (UInt32 boardId = 1; boardId <= boardCount; boardId++)
            {
                if (!DisplayBoardInfo(systemId, boardId))
                {
                    return(false);
                }
            }

            return(true);
        }