Jump to content

Stargazers Lounge Uses Cookies

Like most websites, SGL uses cookies in order to deliver a secure, personalised service, to provide social media functions and to analyse our traffic. Continued use of SGL indicates your acceptance of our cookie policy.

sgl_imaging_challenge_banner_open_clusters.thumb.jpg.f534ff4cbeb9f1a55a0d894ac8bc190b.jpg

  • entries
    90
  • comments
    91
  • views
    48,989

R1.43 OSX ATIK C++ & Obj-C++ drivers released.

NickK

1,180 views

ATIK OSX R1.43 Driver Release (Beta for C++ variant)

Built on a 10.10.1 64 bit mini using Xcode 6.. but set for Universal.

R1.43 C++ dynamic library + dependancies: ATIKOSX R1.43 C++ Drivers.zip

In this zip the follow files exist

* usr/include - include files for the C++ driver

* libATIK.dylib - C++ Modern driver itself

* libLegacyATK.dylib - C++ Legacy driver itself

* libusb-1.0.0.dylib - both drivers above use this

* libftdi2xx.1.2.2.dylib - legacy driver dependency

* libhidapi.dynlib - HID library although this will be removed in the next version (going through libusb instead)

Or for those coding against Objective-C++

R1.43 Objective-C++ Modern Drivers framework: ATIKOSXDrivers.framework.zip

R1.43 Objective-C++ Legacy Drivers framework (requires modern): ATIKOSXLegacyDrivers.framework.zip

Note - these don't use libusb but use native IOKit operations directly.

An application developer's guide to the new drivers (talks more about threading models): Application Developer.pdf

Next steps

* Addition of some of the passive search abilities found in the C++ library to be added to the Objective-C++ frameworks

* Active Proxies being available by request from the C++ drivers (these are discussed in the application developer PDF).

* Enhance the header files with a bit more info..

One of the nice things about the C++ driver is the enhancement of passive mode searching. This means you don't communicate with the camera and so it allows the driver to return prospective lists of matches to you based on the model or wildcard 'kATIKModelModernAnyCamera' for example.

Here's an excerpt from the OpenPHD2 code to illustrate:

    _driversModern = new ATIKLinuxDrivers();    _driversModern->startSelectiveSupport();    _driversLegacy = new ATIKLinuxLegacyDrivers();    //    Logger::globalLogger("ATIKUniversalDrivers");    //    Logger::setDebugLogging(false);    //    Logger::important("OpenPHD2 instantiated driver instance");    _driversLegacy->startSelectiveSupport();

    if( _userSelectedBusId==0 ){                // build list of modern and legacy cameras        // how the FTDIChipID would work here - that's something for later..        // for the moment we're only going to ask for guider models..                        // Find available cameras        // build a list of potential ATIK devices without connecting to them...                int i=-1, index=0;        wxArrayString usbATIKDevices;        uint16_t addresses[1024];                // we know the camera we're looking for is a modern..        //    PotentialDeviceList* modernList = _driversModern->scanForPerspectiveServices(kATIKModelATIKTitan);        PotentialDeviceList* modernList = _driversModern->scanForPerspectiveServices(kATIKModelModernAnyCamera);        if( modernList->size() >0 ) {            for(PotentialDeviceListIterator it=modernList->begin(); it!=modernList->end(); ++it) {                // because c++ string streams are ugly (although printf isn't particularly safe..)                addresses[index]=it->first;                char tempString[1024];                sprintf(tempString,"%s (usb location 0x%04x)",it->second.c_str(),it->first);                wxString wxS = wxString(tempString);                usbATIKDevices.Add(tempString);                index++;            }        }        int legacyIndex = index;        PotentialDeviceList* legacyList=_driversLegacy->scanForPerspectiveServices(kATIKModelLegacyAnyCamera);        for(PotentialDeviceListIterator it=legacyList->begin(); it!=legacyList->end(); ++it) {            // because c++ string streams are ugly (although printf isn't particularly safe..)            addresses[index]=it->first;            char tempString[1024];            sprintf(tempString,"%s (usb location 0x%04x)",it->second.c_str(),it->first);            wxString wxS = wxString(tempString);            usbATIKDevices.Add(tempString);            index++;        }                if(index==1)            i=0; // one camera connected        else if (index==0)            return true; // no cameras.        else {            i = wxGetSingleChoiceIndex(_("Select camera"),_("Camera name"), usbATIKDevices);            if (i == -1) {                Disconnect();                return true;            }        }                _isLegacy = i>=legacyIndex;        _userSelectedBusId = addresses[i];            }        // add and claim camera    ServiceInterface* service=NULL;        if(!_isLegacy) {        _driversModern->supportCameraIdentifiedByBusAddress(_userSelectedBusId);        Services* serviceMgmt = _driversModern->serviceManagement();        ServiceIdentityList* available = _driversModern->availableServices();        // Check for modern camera        if( available->size() != 0) {  // May have found a legacy device            for(ServiceIdentityListIterator it=available->begin(); it!=available->end(); ++it) {                std::string deviceIdentity = it->first;                std::string protocol = it->second;                if( protocol == "Imager100" ) { // in theory this should be Imager101 but for now this is 100.                    //bIsLegacy = false;                    service = serviceMgmt->claimService(deviceIdentity);                    break;                }            }        }    } else {        _driversLegacy->supportCameraIdentifiedByBusAddress(_userSelectedBusId);        Services* serviceMgmt = _driversLegacy->serviceManagement();        ServiceIdentityList* available = _driversLegacy->availableServices();        // Check for modern camera        if( available->size() != 0) {  // May have found a legacy device            for(ServiceIdentityListIterator it=available->begin(); it!=available->end(); ++it) {                std::string deviceIdentity = it->first;                std::string protocol = it->second;                if( protocol == "Imager100" ) { // in theory this should be Imager101 but for now this is 100.                    //bIsLegacy = false;                    service = serviceMgmt->claimService(deviceIdentity);                    break;                }            }        }    }            if(service==NULL) {        wxMessageBox(wxString::Format("Filed to connect to ATIK Camera (Driver version %s)",_driversModern->version()));        return true;    }        //    _imager=dynamic_cast<Imager100*>(service);        // now have our camera all ready...        // update properties    //    FullSize = wxSize(pProp.nPixelsX,pProp.nPixelsY);    //    //  PixelSize[0]=pProp.PixelMicronsX;    //    ArtemisBin(Cam_Handle,1,1);    //    ArtemisSubframe(Cam_Handle, 0,0,pProp.nPixelsX,pProp.nPixelsY);    //    HasShutter = false; // (pProp.cameraflags & 0x10)?true:false;        Name = _imager->uniqueIdentity();        FullSize = wxSize(_imager->xPixels(), _imager->yPixels());        // PHD assumes square pixels    PixelSize = _imager->yPixelSize();        HasPortNum = false;    HasDelayParam = false;    HasGainControl = false; // could use this to engage preview?    HasShutter = false;    HasSubframes = true;        // set cooling..

In the above example, this is using the passive scans to locate all the cameras and providing a list of cameras to the user (that's the wxStringArray etc) and then later it's making a selection by using "supportCameraIdentifiedByBusAddress()" to make the driver provide a single camera support - note if the camera moved location then the camera would no longer be supported.

Then the camera is initialised and made available to the application as an Imager100 service.

Once finished, the application can release the camera back and even end support for the location.

There's a little more work todo - however I think the next step is complete the port to Linux.

Source: ATIK OSX Drivers R1.00 & Example App



0 Comments


Recommended Comments

There are no comments to display.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×

Important Information

By using this site, you agree to our Terms of Use.