Example #1
0
static void QHYSDKUninit()
{
    if (s_qhySdkInitDone)
    {
        ReleaseQHYCCDResource();
        s_qhySdkInitDone = false;
    }
}
Example #2
0
static void cleanup()
{
  for (int i = 0; i < cameraCount; i++)
  {
    delete cameras[i];
  }

  ReleaseQHYCCDResource();
}
int main(void)
{
    char path[1024] = "The Path to your firmware Directroy";
    /* 
    for example:
    firmware dirctory path is /opt/phd2_qhy/tmp/firmware
    path = "/opt/phd2_qhy/tmp/";
    */   

    InitQHYCCDResource();

    /*
    remember you should put the .HEX and .IMG files to firmware folder before run this sample 
    */
    OSXInitQHYCCDFirmware(path);

    ReleaseQHYCCDResource();
}
Example #4
0
bool QHYCCD::Disconnect()
{
  DEBUG(INDI::Logger::DBG_SESSION, "CCD is offline.");

  pthread_mutex_lock(&condMutex);
#ifndef OSX_EMBEDED_MODE
  streamPredicate=0;
#endif
  terminateThread=true;
  pthread_cond_signal(&cv);
  pthread_mutex_unlock(&condMutex);

  if (sim == false)
  {
      CloseQHYCCD(camhandle);
      ReleaseQHYCCDResource();
  }

  return true;
}
Example #5
0
QHYCCD::~QHYCCD()
{
    ReleaseQHYCCDResource();
}
Example #6
0
int main(void)
{
    int num = 0;
    qhyccd_handle *camhandle;
    int ret;
    char id[32];
    char camtype[16];
    int found = 0;
    int ch = '0';

    ret = InitQHYCCDResource();
    if(ret == QHYCCD_SUCCESS)
    {
        printf("Init SDK success!\n");
    }
    else
    {
        goto failure;
    }
    num = ScanQHYCCD();
    if(num > 0)
    {
        printf("Yes!Found QHYCCD,the num is %d \n",num);
    }
    else
    {
        printf("Not Found QHYCCD,please check the usblink or the power\n");
 
    }

    for(int i = 0;i < num;i++)
    {
        ret = GetQHYCCDId(i,id);
        if(ret == QHYCCD_SUCCESS)
        {
            strncpy(camtype,id,6);
            if(!strcmp(camtype,"IC8300"))
            {
                found = 1;
                break;
            }
        }
    }

    if(found == 1)
    {
        camhandle = OpenQHYCCD(id);
        if(camhandle != NULL)
        {
            printf("Open IC8300 success!\n");
        }
        
            printf("Please enter the command you want to control:\n");
            printf("Choice is 0 - 63\n");
            scanf("%d",&ch);
            getchar();
            
            if(ch >= 0 && ch <= 63)
            {
                ret = SetQHYCCDParam(camhandle,CONTROL_GAIN,ch);
                if(ret != QHYCCD_SUCCESS)
                {
                    printf("Control the color filter wheel failure \n");
                    goto failure;
                }
            }
    }
    else
    {
        printf("The camera is not IC8300 or other error \n");
        goto failure;
    }
    
        
    ret = CloseQHYCCD(camhandle);
    if(ret == QHYCCD_SUCCESS)
    {
        printf("Close IC8300 success!\n");
    }
    else
    {
        goto failure;
    }

    ret = ReleaseQHYCCDResource();
    if(ret == QHYCCD_SUCCESS)
    {
        printf("Rlease SDK Resource  success!\n");
    }
    else
    {
        goto failure;
    }

    return 0;

failure:
    printf("some fatal error happened\n");
    return 1;
}