Пример #1
0
	void Device::GetGlInfo(std::ostream& ostr)
	{
		ostr << std::endl;
		ostr << "GL_VERSION: " << GetVersion() << std::endl;
		ostr << "GL_VENDOR: " << GetVendorName() << std::endl;
		ostr << "GL_RENDERER: " << GetRendererName() << std::endl;
		ostr << "GL_SHADING_LANGUAGE_VERSION: " << GetGLSLVersion() << std::endl;
	}
Пример #2
0
/**\brief Indexes into the current device list to point the class at a particular camera
 * \ingroup camcore
 * \param node: the (zero-indexed) id of the camera to select
 * \return
 *   - CAM_SUCCESS on success
 *   - CAM_ERROR_PARAM_OUT_OF_RANGE: you gave a bad camera number
 *   - CAM_ERROR_BUSY: The currently Selected Camera is Busy, call StopImageAcquisition() first
 *   - CAM_ERROR: general I/O error (probably GetCameraSpecification)
 *
 *   This is the only class function that will generate dialog boxes and will do so
 *   if and only if it believes that the device you selected isn't *really* a camera
 *   that complies with the 1394 Digital Camera Specification.
 */
int C1394Camera::SelectCamera(int node)
{
	char buf[256];
	ULONG sz = sizeof(buf);
	int format, mode;
	int ret = CAM_ERROR;
	ULONG ulRet;

	DllTrace(DLL_TRACE_ENTER,"ENTER SelectCamera (%d)\n",node);

	if(m_hDeviceAcquisition != INVALID_HANDLE_VALUE)
	{
		DllTrace(DLL_TRACE_ERROR,"SelectCamera: Currently Selected Camera is Busy, you must call StopImageAcquisition First\n");
		ret = CAM_ERROR_BUSY;
		goto _exit;
	}

	if(node < 0 || (unsigned int)node >= m_dwDevCount)
	{
		DllTrace(DLL_TRACE_ERROR,"SelectCamera: Camera %d out of range\n",node);
		ret = CAM_ERROR_PARAM_OUT_OF_RANGE;
		goto _exit;
	}

	if(t1394CmdrGetDevicePath(m_hDevInfo,node,buf,&sz) <= 0)
	{
		DllTrace(DLL_TRACE_ERROR,"SelectCamera: Error on GetDevicePath (%d)\n",GetLastError());
		ret = CAM_ERROR;
		goto _exit;
	}

	// check the software version
	ZeroMemory(&m_spec,sizeof(CAMERA_SPECIFICATION));
	if((ulRet = GetCameraSpecification(buf,&m_spec)))
	{
		DllTrace(DLL_TRACE_ERROR,"SelectCamera: Error %08x getting Camera Specification\n",ulRet);
		ret = CAM_ERROR;
		goto _exit;
	}

	if(m_spec.ulSpecification != 0x00A02D)
		DllTrace(DLL_TRACE_ALWAYS, "SelectCamera: Warning: Camera specification (%06x) does not match 0x00A02D\n", m_spec.ulSpecification);

	if (m_spec.ulVersion  < 0x000100 || m_spec.ulVersion > 0x000104)
		DllTrace(DLL_TRACE_ALWAYS,"SelectCamera: Warning: Camera software version (%06x) is not supported\n",m_spec.ulVersion);

	// get the vendor and model names from the driver
	if((ulRet = GetModelName(buf,m_nameModel,255)) < 0)
	{
		DllTrace(DLL_TRACE_ERROR,"SelectCamera: Error on GetModelName\n");
		DllTrace(DLL_TRACE_EXIT,"EXIT SelectCamera (%d)\n",CAM_ERROR);
		return CAM_ERROR;
	} else {
		// Null-Terminate
		m_nameModel[ulRet] = 0;
	}

	if((ulRet = GetVendorName(buf,m_nameVendor,255)) < 0)
	{
		DllTrace(DLL_TRACE_ERROR,"SelectCamera: Error on GetVendorName\n");
		DllTrace(DLL_TRACE_EXIT,"EXIT SelectCamera (%d)\n",CAM_ERROR);
		return CAM_ERROR;
	} else {
		// Null-Terminate
		m_nameVendor[ulRet] = 0;
	}

	GetUniqueID(buf,&m_UniqueID);
	
	// whenever we switch cameras, reset our internal stuff
	m_cameraInitialized = false;
	
	// initialize video settings matrices to false
	m_InqVideoFormats = 0;
	for (format=0; format<8; format++)
	{
		m_InqVideoModes[format] = 0;
		for (mode=0; mode<8; mode++)
			m_InqVideoRates[format][mode] = 0;
	}
	
	// empty out the static registers
	m_InqBasicFunc = 0;
	m_InqVideoFormats = 0;
	m_InqFeatureHi = m_InqFeatureLo = 0;
	
	strncpy(m_DevicePath,buf,sizeof(m_DevicePath));
	m_pName = m_DevicePath;
	m_node = node;
	ret = CAM_SUCCESS;
	DllTrace(DLL_TRACE_CHECK,"SelectCamera: Selected \"%s\"\n",m_pName);
_exit:
	DllTrace(DLL_TRACE_EXIT,"EXIT SelectCamera (%d)\n",ret);
	return ret;
}
Пример #3
0
void CTestPage::OnRefresh() 
/////////////////////////////////////////////////////////////////////////////
{
#ifdef USEHARDWARE
	ULONG	ulVendorID;
	ULONG	ulDeviceID;
	ULONG	ulInterruptLine;
	ULONG	ulBAR[ PCI_TYPE0_ADDRESSES ];
	BYTE	ucBusNumber;
	BYTE	ucDeviceFunction;
	BYTE	ucDevice;
	int		iItem = 0;
	int		i;

	// no painting during change
	LockWindowUpdate();

	m_DeviceList.DeleteAllItems();
	
	for( ucBusNumber=0; ucBusNumber<0xFF; ucBusNumber++ )
	{
		for( ucDevice=0; ucDevice<0x1F; ucDevice++ )
		{
			ucDeviceFunction = ucDevice << 3;
			
			ReadConfigurationArea( READ_CONFIG_WORD, ucBusNumber, ucDeviceFunction, PCI_CS_VENDOR_ID, &ulVendorID );
			ulVendorID &= 0xFFFF;
			if( ulVendorID == 0xFFFF )
				continue;
			
			ReadConfigurationArea( READ_CONFIG_WORD, ucBusNumber, ucDeviceFunction, PCI_CS_DEVICE_ID, &ulDeviceID );
			ulDeviceID &= 0xFFFF;
			if( ulDeviceID == 0xFFFF )
				continue;
			
			CString strText;
			
			// Insert items in the list view control.
			m_DeviceList.InsertItem( iItem, GetVendorName( (USHORT)ulVendorID, (USHORT)ulDeviceID ) );

			strText.Format( "%d", ucBusNumber );
			m_DeviceList.SetItemText( iItem, COLUMN_BUS, strText );

			strText.Format( "%2d", ucDevice );
			m_DeviceList.SetItemText( iItem, COLUMN_DEVICE, strText );

			strText.Format( "%04lx", ulVendorID );
			m_DeviceList.SetItemText( iItem, COLUMN_VENDORID, strText );

			strText.Format( "%04lx", ulDeviceID );
			m_DeviceList.SetItemText( iItem, COLUMN_DEVICEID, strText );

			ReadConfigurationArea( READ_CONFIG_BYTE, ucBusNumber, ucDeviceFunction, PCI_CS_INTERRUPT_LINE, &ulInterruptLine );
			ulInterruptLine &= 0xFF;
			strText.Format( "%2ld", ulInterruptLine );
			m_DeviceList.SetItemText( iItem, COLUMN_IRQ, strText );

			for( i=0; i<PCI_TYPE0_ADDRESSES; i++ )
			{
				ReadConfigurationArea( 
					READ_CONFIG_DWORD, 
					ucBusNumber, ucDeviceFunction, 
					PCI_CS_BASE_ADDRESS_0+(i*sizeof(DWORD)), 
					&ulBAR[ i ] );

				strText.Format( "%08lx", ulBAR[ i ] );
				m_DeviceList.SetItemText( iItem, COLUMN_BAR0+i, strText );
			}

			iItem++;
		}
	}

	m_DeviceList.SetColumnWidth( COLUMN_VENDORNAME, LVSCW_AUTOSIZE );
	for( i=0; i<PCI_TYPE0_ADDRESSES; i++ )
	{
		m_DeviceList.SetColumnWidth( COLUMN_BAR0+i, LVSCW_AUTOSIZE );
	}

	// repaint changes
	UnlockWindowUpdate();
#else
	m_DeviceList.InsertItem( 0, "Use Hardware is OFF" );
	m_DeviceList.SetColumnWidth( COLUMN_VENDORNAME, LVSCW_AUTOSIZE );
#endif
}