MapDriver
Maps the device driver image buffer, with the specified size, so the CController class can have direct access.
Syntax
void MapDriver( bytes );
Parameters
unsigned long bytes
The size of the kernel image buffer to allocate ( in bytes ).
Returns
None
Required Headers
CController.h
Namespace
arc
Throws
std::runtime_error
Remarks
This method must be called before any exposure is taken or the host computer may crash. The mapping of the image buffer may also be done using the OpenDriver() method. Exceptions can be caught using a try/catch block.
Example
        // This code demonstrates how to use MapDriver().

        #include <iostream.h>
        #include "CController.h"
        using namespace std;
        using namespace arc;

        CController cController;

        try {
            // This MUST be called first!
            cController.GetDeviceBindings();

            if ( cController.GetDeviceBindingCount() <= 0 )
                throw std::runtime_error( "Failed to find any ARC devices!" );
 
            cout << "Opening device #0 ..." << endl;
            cController.OpenDriver( 0 );

            cout << "Mapping 2200x2200 pixel image buffer ..." << endl;
            cController.MapDriver( 2200 * 2200 * sizeof( unsigned short ) );

            // .... do something here ....

            // Unmap the driver when all done.
            cController.UnmapDriver();
 
            // Close the driver when we're all done.
            cController.CloseDriver();
        }
        catch ( std::exception &e )
        {
            cerr << "Exception Occurred: " << e.what() << endl;
        }

© Astronomical Research Cameras, Inc.