コード例 #1
0
ファイル: PVCAMParam.cpp プロジェクト: erisir/Micro-Manager
int PvUniversalParam::initialize()
{
   plGetParam( ATTR_CURRENT, mValue );

   if ( mType == TYPE_ENUM )
   {
       mEnumStrings.clear();
       
       uns32 count;
       char enumStr[MAX_ENUM_STR_LEN];
       int32 enumValue;
       if (pl_get_param( mCamera->Handle(), mId, ATTR_COUNT, (void_ptr)&count) != PV_OK)
       {
           mCamera->LogCamError(__LINE__, "PvUniversalParam::initialize() pl_get_param ATTR_COUNT");
           return DEVICE_ERR;
       }
       for ( uns32 i = 0; i < count; i++ )
       {
           if (pl_get_enum_param( mCamera->Handle(), mId, i, &enumValue, enumStr, MAX_ENUM_STR_LEN) != PV_OK )
           {
               mCamera->LogCamError(__LINE__, "PvUniversalParam::initialize() pl_get_enum_param");
               return DEVICE_ERR;
           }
           mEnumStrings.push_back(std::string( enumStr ));
       }
   }
   else
   {
       plGetParam( ATTR_MIN, mValueMin );
       plGetParam( ATTR_MAX, mValueMax );
   }

   return DEVICE_OK;
}
コード例 #2
0
int PvUniversalParam::initialize()
{
    plGetParam( ATTR_CURRENT, mValue );

    if ( mType == TYPE_ENUM )
    {
        mEnumStrings.clear();
        mEnumValues.clear();

        uns32 count;
        int32 enumValue;
        if (pl_get_param( mCamera->Handle(), mId, ATTR_COUNT, (void_ptr)&count) != PV_OK)
        {
            mCamera->LogCamError(__LINE__, "PvUniversalParam::initialize() pl_get_param ATTR_COUNT");
            return DEVICE_ERR;
        }
        for ( uns32 i = 0; i < count; i++ )
        {
            uns32 enumStrLen;
            if ( pl_enum_str_length( mCamera->Handle(), mId, i, &enumStrLen ) != PV_OK )
            {
                mCamera->LogCamError(__LINE__, "PvUniversalParam::initialize() pl_enum_str_length");
                return DEVICE_ERR;
            }
            char* enumStrBuf = new char[enumStrLen+1];
            enumStrBuf[enumStrLen] = '\0';
            if (pl_get_enum_param( mCamera->Handle(), mId, i, &enumValue, enumStrBuf, enumStrLen) != PV_OK )
            {
                mCamera->LogCamError(__LINE__, "PvUniversalParam::initialize() pl_get_enum_param");
                return DEVICE_ERR;
            }
            mEnumStrings.push_back(std::string( enumStrBuf ));
            mEnumValues.push_back(enumValue);
            delete[] enumStrBuf;
        }
    }
    else
    {
        plGetParam( ATTR_MIN, mValueMin );
        plGetParam( ATTR_MAX, mValueMax );
    }

    return DEVICE_OK;
}
コード例 #3
0
ファイル: QuantixCamera.cpp プロジェクト: jasonhogan/sti
double QuantixCamera::getMinExposureTime()
{
	//Best Case Scenario: get minimum exposure time from Camera
	flt64 minExpTimeS;

	char enumStr[100];
	int32 enumValue;
	uns32 currentMode = 0;
	//experimentally-determined min exposure time: 0.3*ms, but keep 1 ms to be safe

	if(!pl_get_param(cameraHandle, PARAM_EXP_MIN_TIME, ATTR_CURRENT, (void *)&minExpTimeS))
	{
		pl_get_param(cameraHandle, PARAM_EXP_RES, ATTR_CURRENT, (void *) &currentMode);
		pl_get_enum_param (cameraHandle, PARAM_EXP_RES, currentMode, &enumValue, enumStr, 100);
		if (enumValue == EXP_RES_ONE_MICROSEC)
			minExpTimeS = 0.000001;
		else if (enumValue == EXP_RES_ONE_MILLISEC)
			minExpTimeS = 0.001;
		else
			minExpTimeS = 0;
	}

	return (double) (1000000000 * minExpTimeS);
}